[svn:parrot] r43541 - in branches/orderedhash_revamp: . compilers/data_json compilers/data_json/data_json compilers/imcc compilers/json/JSON compilers/ncigen compilers/ncigen/src compilers/ncigen/src/builtins compilers/ncigen/src/parser compilers/nqp/src compilers/nqp/src/Grammar compilers/nqp/t compilers/pct/src/PAST compilers/pct/src/PCT compilers/pct/src/POST compilers/pge compilers/pge/PGE compilers/pirc/heredoc compilers/pirc/macro compilers/pirc/src compilers/tge compilers/tge/TGE config/auto config/auto/byteorder config/auto/cpu/i386 config/auto/env config/auto/frames config/auto/funcptr config/auto/gmp config/auto/jit config/auto/readline config/gen config/gen/call_list config/gen/config_h config/gen/crypto config/gen/makefiles config/gen/platform config/gen/platform/ansi config/gen/platform/darwin config/gen/platform/generic config/gen/platform/netbsd config/gen/platform/openbsd config/gen/platform/win32 config/init config/init/hints config/inter docs docs/b ook/draft docs/book/pct docs/book/pir docs/dev docs/pdds docs/pdds/draft docs/pmc docs/project docs/resources docs/user/pir editor examples/benchmarks examples/c examples/compilers examples/config examples/config/file examples/embed examples/japh examples/json examples/languages/abc examples/languages/abc/config/makefiles examples/languages/abc/src/builtins examples/languages/abc/src/parser examples/languages/abc/t examples/languages/squaak examples/languages/squaak/config/makefiles examples/languages/squaak/src/builtins examples/languages/squaak/t examples/library examples/nci examples/opengl examples/pasm examples/past examples/pir examples/pir/befunge examples/pir/befunge/config/makefiles examples/pir/befunge/t examples/sdl examples/sdl/minesweeper examples/sdl/tetris examples/shootout examples/subs examples/tutorial ext/SQLite3 ext/nqp-rx ext/nqp-rx/src ext/nqp-rx/src/stage0 ext/nqp-rx/t ext/nqp-rx/t/nqp ext/nqp-rx/t/p6regex include/parrot include/pmc lib/IO lib/Parrot l ib/Parrot/Configure lib/Parrot/Configure/Options lib/Parrot/Configure/Options/Conf lib/Parrot/Configure/Options/Test lib/Parrot/Configure/Step lib/Parrot/Docs lib/Parrot/Docs/Section lib/Parrot/Harness lib/Parrot/OpTrans lib/Parrot/Ops2c lib/Parrot/Pmc2c lib/Parrot/Pmc2c/PMC lib/Parrot/Test ports/cygwin ports/debian ports/fedora ports/macports ports/mandriva ports/suse ports/ubuntu ports/ubuntu/patches runtime/parrot/include runtime/parrot/library runtime/parrot/library/Config runtime/parrot/library/Configure runtime/parrot/library/Data runtime/parrot/library/Data/Dumper runtime/parrot/library/Getopt runtime/parrot/library/NCI runtime/parrot/library/PGE runtime/parrot/library/SDL runtime/parrot/library/Stream runtime/parrot/library/Tcl runtime/parrot/library/Test runtime/parrot/library/YAML/Dumper runtime/parrot/library/YAML/Parser src src/call src/dynoplibs src/dynpmc src/gc src/interp src/io src/jit/alpha src/jit/amd64 src/jit/arm src/jit/hppa src/jit/i386 src/jit/ia64 src /jit/mips src/jit/ppc src/jit/skeleton src/jit/sun4 src/ops src/packfile src/pmc src/runcore src/string src/string/charset src/string/encoding t t/benchmark t/codingstd t/compilers/imcc/imcpasm t/compilers/imcc/syn t/compilers/json t/compilers/pct t/compilers/pge t/compilers/pge/p5regex t/compilers/pge/perl6regex t/compilers/tge t/configure t/configure/testlib t/configure/testlib/init t/configure/testlib/inter t/dynoplibs t/dynpmc t/examples t/include t/library t/native_pbc t/native_pbc/testdata t/oo t/op t/perl t/pharness t/pir t/pmc t/run t/src t/steps/auto t/steps/gen t/steps/init t/steps/init/hints t/steps/inter t/tools t/tools/dev/searchops t/tools/install t/tools/ops2cutils/testlib t/tools/ops2pm t/tools/ops2pm/samples t/tools/pmc2cutils tools/build tools/dev tools/install tools/util xconf/samples

bacek at svn.parrot.org bacek at svn.parrot.org
Sat Jan 23 01:51:14 UTC 2010


Author: bacek
Date: Sat Jan 23 01:49:53 2010
New Revision: 43541
URL: https://trac.parrot.org/parrot/changeset/43541

Log:
Merge branch 'master' into orderedhash_revamp_local

Conflicts:
	src/pmc/orderedhash.pmc
	src/pmc/orderedhashiterator.pmc

Added:
   branches/orderedhash_revamp/compilers/data_json/
   branches/orderedhash_revamp/compilers/data_json/data_json/
   branches/orderedhash_revamp/compilers/data_json/data_json.pir
   branches/orderedhash_revamp/compilers/data_json/data_json/grammar.pg
   branches/orderedhash_revamp/compilers/data_json/data_json/pge2pir.tg
   branches/orderedhash_revamp/compilers/nqp/t/30-subclass.t
   branches/orderedhash_revamp/config/auto/frames/
   branches/orderedhash_revamp/config/auto/frames.pm
   branches/orderedhash_revamp/config/auto/frames/test_exec_cygwin_c.in
      - copied, changed from r40254, branches/orderedhash_revamp/config/auto/jit/test_exec_cygwin_c.in
   branches/orderedhash_revamp/config/auto/frames/test_exec_linux_c.in
      - copied, changed from r40254, branches/orderedhash_revamp/config/auto/jit/test_exec_linux_c.in
   branches/orderedhash_revamp/config/auto/frames/test_exec_openbsd_c.in
      - copied, changed from r40254, branches/orderedhash_revamp/config/auto/jit/test_exec_openbsd_c.in
   branches/orderedhash_revamp/config/gen/makefiles/data_json.in
   branches/orderedhash_revamp/config/gen/makefiles/nqp-rx.in
   branches/orderedhash_revamp/config/gen/platform/darwin/hires_timer.c
   branches/orderedhash_revamp/config/gen/platform/generic/hires_timer.c
   branches/orderedhash_revamp/config/gen/platform/win32/hires_timer.c
   branches/orderedhash_revamp/docs/book/pct/
   branches/orderedhash_revamp/docs/book/pct/ch01_introduction.pod
   branches/orderedhash_revamp/docs/book/pct/ch02_getting_started.pod
   branches/orderedhash_revamp/docs/book/pct/ch03_compiler_tools.pod
   branches/orderedhash_revamp/docs/book/pct/ch04_pge.pod
   branches/orderedhash_revamp/docs/book/pct/ch05_nqp.pod
   branches/orderedhash_revamp/docs/dev/profiling.pod
   branches/orderedhash_revamp/docs/pdds/draft/pdd31_hll.pod
   branches/orderedhash_revamp/examples/benchmarks/fib.cs
   branches/orderedhash_revamp/examples/benchmarks/hamming.pir
   branches/orderedhash_revamp/examples/benchmarks/hello.pir
   branches/orderedhash_revamp/examples/benchmarks/oo1.pir
   branches/orderedhash_revamp/examples/benchmarks/oo2.pir
   branches/orderedhash_revamp/examples/benchmarks/oo3.pir
   branches/orderedhash_revamp/examples/benchmarks/rand.pir
   branches/orderedhash_revamp/examples/c/pbc_info.c
   branches/orderedhash_revamp/examples/config/
   branches/orderedhash_revamp/examples/config/file/
   branches/orderedhash_revamp/examples/config/file/configcompiler
      - copied, changed from r40254, branches/orderedhash_revamp/xconf/samples/yourfoobar
   branches/orderedhash_revamp/examples/config/file/configwithfatalstep
      - copied, changed from r40254, branches/orderedhash_revamp/xconf/samples/testfoobar
   branches/orderedhash_revamp/examples/embed/cotorra.c
   branches/orderedhash_revamp/examples/languages/abc/setup.pir   (contents, props changed)
   branches/orderedhash_revamp/examples/languages/abc/src/parser/actions.nqp
   branches/orderedhash_revamp/examples/languages/abc/src/parser/grammar.nqp
   branches/orderedhash_revamp/examples/languages/squaak/setup.pir   (contents, props changed)
   branches/orderedhash_revamp/examples/opengl/static-triangle-hll.pir
   branches/orderedhash_revamp/examples/pir/befunge/setup.pir   (contents, props changed)
   branches/orderedhash_revamp/examples/pir/make_hello_pbc.pir
   branches/orderedhash_revamp/ext/nqp-rx/
   branches/orderedhash_revamp/ext/nqp-rx/.gitignore
   branches/orderedhash_revamp/ext/nqp-rx/CREDITS
   branches/orderedhash_revamp/ext/nqp-rx/LICENSE
   branches/orderedhash_revamp/ext/nqp-rx/README
   branches/orderedhash_revamp/ext/nqp-rx/STATUS
   branches/orderedhash_revamp/ext/nqp-rx/src/
   branches/orderedhash_revamp/ext/nqp-rx/src/stage0/
   branches/orderedhash_revamp/ext/nqp-rx/src/stage0/HLL-s0.pir
   branches/orderedhash_revamp/ext/nqp-rx/src/stage0/NQP-s0.pir
   branches/orderedhash_revamp/ext/nqp-rx/src/stage0/P6Regex-s0.pir
   branches/orderedhash_revamp/ext/nqp-rx/src/stage0/Regex-s0.pir
   branches/orderedhash_revamp/ext/nqp-rx/t/
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/01-literals.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/02-if.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/03-if-else.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/04-unless.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/05-comments.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/06-args-pos.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/07-boolean.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/08-blocks.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/09-var.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/10-cmp.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/11-sub.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/12-logical.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/13-op.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/14-while.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/15-list.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/16-ternary.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/17-positional.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/18-associative.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/19-inline.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/20-return.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/21-contextual.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/22-optional-args.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/23-named-args.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/24-module.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/25-class.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/26-methodops.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/27-self.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/28-subclass.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/29-make.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/30-pirop.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/31-grammar.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/32-protoregex.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/33-init.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/34-rxcodeblock.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/35-prefix-sigil.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/36-callable.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/37-slurpy.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/38-quotes.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/39-pointy.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/40-lists.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/41-flat.t
   branches/orderedhash_revamp/ext/nqp-rx/t/nqp/42-cond-loop.t
   branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/
   branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/01-regex.t
   branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_backtrack
   branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_basic
   branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_captures
   branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_charclass
   branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_goal
   branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_lookarounds
   branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_metachars
   branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_modifiers
   branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_quantifiers
   branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_subrules
   branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_syntax
   branches/orderedhash_revamp/include/parrot/context.h
   branches/orderedhash_revamp/include/parrot/runcore_profiling.h
   branches/orderedhash_revamp/include/pmc/
   branches/orderedhash_revamp/include/pmc/dummy
   branches/orderedhash_revamp/lib/Parrot/Configure/Step/Test.pm
   branches/orderedhash_revamp/ports/fedora/parrot-1.x.0.patch
   branches/orderedhash_revamp/runtime/parrot/library/Configure/
   branches/orderedhash_revamp/runtime/parrot/library/Configure/genfile.pir
   branches/orderedhash_revamp/runtime/parrot/library/SQLite3.pir
   branches/orderedhash_revamp/runtime/parrot/library/distutils.pir
   branches/orderedhash_revamp/src/call/args.c
   branches/orderedhash_revamp/src/call/context.c
   branches/orderedhash_revamp/src/call/context_accessors.c
   branches/orderedhash_revamp/src/dynoplibs/math.ops
   branches/orderedhash_revamp/src/dynpmc/foo2.pmc
   branches/orderedhash_revamp/src/frame_builder.c
   branches/orderedhash_revamp/src/frame_builder.h
   branches/orderedhash_revamp/src/pmc/callcontext.pmc
   branches/orderedhash_revamp/src/runcore/profiling.c
   branches/orderedhash_revamp/t/compilers/pge/regression.t
   branches/orderedhash_revamp/t/dynoplibs/math.t
   branches/orderedhash_revamp/t/dynoplibs/obscure.t
   branches/orderedhash_revamp/t/dynpmc/foo2.t
   branches/orderedhash_revamp/t/include/
   branches/orderedhash_revamp/t/include/fp_equality.t
   branches/orderedhash_revamp/t/library/configure.t
   branches/orderedhash_revamp/t/native_pbc/testdata/number.pasm
   branches/orderedhash_revamp/t/native_pbc/testdata/string.pasm
   branches/orderedhash_revamp/t/oo/new-old.t
   branches/orderedhash_revamp/t/op/annotate-old.t
   branches/orderedhash_revamp/t/op/cc_params_old.t
   branches/orderedhash_revamp/t/op/exit.t
   branches/orderedhash_revamp/t/op/fetch.t
   branches/orderedhash_revamp/t/op/inf_nan.t
   branches/orderedhash_revamp/t/op/literal-old.t
      - copied, changed from r40254, branches/orderedhash_revamp/t/op/literal.t
   branches/orderedhash_revamp/t/op/string_cmp.t
   branches/orderedhash_revamp/t/op/time_old.t
   branches/orderedhash_revamp/t/op/vivify.t
   branches/orderedhash_revamp/t/pir/
   branches/orderedhash_revamp/t/pir/macro.t
   branches/orderedhash_revamp/t/pir/registernames.t
   branches/orderedhash_revamp/t/pmc/callcontext.t
   branches/orderedhash_revamp/t/pmc/context.t
   branches/orderedhash_revamp/t/pmc/exception-old.t
   branches/orderedhash_revamp/t/pmc/namespace-old.t
   branches/orderedhash_revamp/t/steps/auto/frames-01.t
   branches/orderedhash_revamp/t/steps/init/hints/linux-01.t
   branches/orderedhash_revamp/t/tools/pbc_disassemble.t
   branches/orderedhash_revamp/t/tools/pbc_dump.t
   branches/orderedhash_revamp/t/tools/pgegrep.t
   branches/orderedhash_revamp/t/tools/testdata
   branches/orderedhash_revamp/tools/dev/checkdepend.pl
   branches/orderedhash_revamp/tools/dev/install_doc_files.pl
   branches/orderedhash_revamp/tools/dev/parrot_shell.pl
   branches/orderedhash_revamp/tools/dev/pprof2cg.nqp   (contents, props changed)
   branches/orderedhash_revamp/tools/dev/pprof2cg.pl   (contents, props changed)
   branches/orderedhash_revamp/tools/dev/vgp_darwin   (contents, props changed)
Deleted:
   branches/orderedhash_revamp/config/auto/cpu/i386/Makefile
   branches/orderedhash_revamp/config/auto/cpu/i386/memcpy_mmx.c
   branches/orderedhash_revamp/config/auto/cpu/i386/memcpy_mmx_in.c
   branches/orderedhash_revamp/config/auto/cpu/i386/memcpy_sse.c
   branches/orderedhash_revamp/config/auto/cpu/i386/memcpy_sse_in.c
   branches/orderedhash_revamp/config/auto/fink.pm
   branches/orderedhash_revamp/config/auto/funcptr.pm
   branches/orderedhash_revamp/config/auto/funcptr/test_c.in
   branches/orderedhash_revamp/config/auto/jit/test_c.in
   branches/orderedhash_revamp/config/auto/jit/test_exec_cygwin_c.in
   branches/orderedhash_revamp/config/auto/jit/test_exec_linux_c.in
   branches/orderedhash_revamp/config/auto/jit/test_exec_openbsd_c.in
   branches/orderedhash_revamp/config/auto/macports.pm
   branches/orderedhash_revamp/docs/book/draft/ch04_compiler_tools.pod
   branches/orderedhash_revamp/docs/book/draft/ch05_pge.pod
   branches/orderedhash_revamp/docs/book/draft/ch06_nqp.pod
   branches/orderedhash_revamp/docs/dev/jit_i386.pod
   branches/orderedhash_revamp/docs/jit.pod
   branches/orderedhash_revamp/docs/native_exec.pod
   branches/orderedhash_revamp/examples/benchmarks/oo1.pasm
   branches/orderedhash_revamp/examples/benchmarks/oo2.pasm
   branches/orderedhash_revamp/examples/benchmarks/oo3.pasm
   branches/orderedhash_revamp/examples/embed/lorito.c
   branches/orderedhash_revamp/examples/languages/abc/Configure.pl
   branches/orderedhash_revamp/examples/languages/abc/config/makefiles/root.in
   branches/orderedhash_revamp/examples/languages/abc/src/parser/actions.pm
   branches/orderedhash_revamp/examples/languages/abc/src/parser/grammar-oper.pg
   branches/orderedhash_revamp/examples/languages/abc/src/parser/grammar.pg
   branches/orderedhash_revamp/examples/languages/abc/t/harness
   branches/orderedhash_revamp/examples/languages/squaak/Configure.pl
   branches/orderedhash_revamp/examples/languages/squaak/config/makefiles/root.in
   branches/orderedhash_revamp/examples/languages/squaak/t/harness
   branches/orderedhash_revamp/examples/nci/Mysql.pir
   branches/orderedhash_revamp/examples/nci/mysqltest.p6
   branches/orderedhash_revamp/examples/nci/mysqltest.pir
   branches/orderedhash_revamp/examples/pir/befunge/Configure.pl
   branches/orderedhash_revamp/examples/pir/befunge/config/makefiles/root.in
   branches/orderedhash_revamp/examples/pir/befunge/t/harness
   branches/orderedhash_revamp/examples/subs/jsr_ret.pasm
   branches/orderedhash_revamp/include/parrot/exec.h
   branches/orderedhash_revamp/include/parrot/pic.h
   branches/orderedhash_revamp/include/parrot/register.h
   branches/orderedhash_revamp/include/parrot/slice.h
   branches/orderedhash_revamp/include/parrot/stacks.h
   branches/orderedhash_revamp/lib/Parrot/Test/Cardinal.pm
   branches/orderedhash_revamp/lib/Parrot/Test/Perl6.pm
   branches/orderedhash_revamp/ports/ubuntu/patches/01-lpia-FTBFS.path
   branches/orderedhash_revamp/ports/ubuntu/patches/series
   branches/orderedhash_revamp/ports/ubuntu/rules
   branches/orderedhash_revamp/runtime/parrot/library/Data/Replace.pir
   branches/orderedhash_revamp/runtime/parrot/library/NCI/call_toolkit_init.pir
   branches/orderedhash_revamp/runtime/parrot/library/YAML/Parser/Syck.pir
   branches/orderedhash_revamp/src/dynpmc/pair.pmc
   branches/orderedhash_revamp/src/exec.c
   branches/orderedhash_revamp/src/exec_save.c
   branches/orderedhash_revamp/src/exec_save.h
   branches/orderedhash_revamp/src/exec_start.c
   branches/orderedhash_revamp/src/gc/alloc_register.c
   branches/orderedhash_revamp/src/gc/gc_malloc.c
   branches/orderedhash_revamp/src/gc/generational_ms.c
   branches/orderedhash_revamp/src/gc/incremental_ms.c
   branches/orderedhash_revamp/src/gc/res_lea.c
   branches/orderedhash_revamp/src/jit.c
   branches/orderedhash_revamp/src/jit.h
   branches/orderedhash_revamp/src/jit/alpha/core.jit
   branches/orderedhash_revamp/src/jit/alpha/jit_defs.c
   branches/orderedhash_revamp/src/jit/alpha/jit_emit.h
   branches/orderedhash_revamp/src/jit/amd64/core.jit
   branches/orderedhash_revamp/src/jit/amd64/jit_defs.c
   branches/orderedhash_revamp/src/jit/amd64/jit_emit.h
   branches/orderedhash_revamp/src/jit/arm/core.jit
   branches/orderedhash_revamp/src/jit/arm/exec_dep.c
   branches/orderedhash_revamp/src/jit/arm/exec_dep.h
   branches/orderedhash_revamp/src/jit/arm/jit_defs.c
   branches/orderedhash_revamp/src/jit/arm/jit_emit.h
   branches/orderedhash_revamp/src/jit/hppa/core.jit
   branches/orderedhash_revamp/src/jit/hppa/jit_defs.c
   branches/orderedhash_revamp/src/jit/hppa/jit_emit.h
   branches/orderedhash_revamp/src/jit/i386/core.jit
   branches/orderedhash_revamp/src/jit/i386/exec_dep.c
   branches/orderedhash_revamp/src/jit/i386/exec_dep.h
   branches/orderedhash_revamp/src/jit/i386/jit_defs.c
   branches/orderedhash_revamp/src/jit/i386/jit_emit.h
   branches/orderedhash_revamp/src/jit/ia64/core.jit
   branches/orderedhash_revamp/src/jit/ia64/jit_defs.c
   branches/orderedhash_revamp/src/jit/ia64/jit_emit.h
   branches/orderedhash_revamp/src/jit/mips/core.jit
   branches/orderedhash_revamp/src/jit/mips/jit_defs.c
   branches/orderedhash_revamp/src/jit/mips/jit_emit.h
   branches/orderedhash_revamp/src/jit/ppc/asm.s
   branches/orderedhash_revamp/src/jit/ppc/core.jit
   branches/orderedhash_revamp/src/jit/ppc/exec_dep.c
   branches/orderedhash_revamp/src/jit/ppc/exec_dep.h
   branches/orderedhash_revamp/src/jit/ppc/jit_defs.c
   branches/orderedhash_revamp/src/jit/ppc/jit_emit.h
   branches/orderedhash_revamp/src/jit/ppc/ppc-linux.s
   branches/orderedhash_revamp/src/jit/skeleton/jit_defs.c
   branches/orderedhash_revamp/src/jit/skeleton/jit_emit.h
   branches/orderedhash_revamp/src/jit/sun4/core.jit
   branches/orderedhash_revamp/src/jit/sun4/jit_defs.c
   branches/orderedhash_revamp/src/jit/sun4/jit_emit.h
   branches/orderedhash_revamp/src/jit_debug.c
   branches/orderedhash_revamp/src/jit_debug_xcoff.c
   branches/orderedhash_revamp/src/ops/pic.ops
   branches/orderedhash_revamp/src/pbc_info.c
   branches/orderedhash_revamp/src/pic.c
   branches/orderedhash_revamp/src/pic_jit.c
   branches/orderedhash_revamp/src/pmc/callsignature.pmc
   branches/orderedhash_revamp/src/pmc/random.pmc
   branches/orderedhash_revamp/src/stacks.c
   branches/orderedhash_revamp/t/codingstd/test_file_coverage.t
   branches/orderedhash_revamp/t/compilers/imcc/imcpasm/sub.t
   branches/orderedhash_revamp/t/compilers/imcc/syn/bsr.t
   branches/orderedhash_revamp/t/dynpmc/pair.t
   branches/orderedhash_revamp/t/library/yaml_parser_syck.t
   branches/orderedhash_revamp/t/op/hacks.t
   branches/orderedhash_revamp/t/pmc/callsignature.t
   branches/orderedhash_revamp/t/pmc/random.t
   branches/orderedhash_revamp/t/steps/auto/fink-01.t
   branches/orderedhash_revamp/t/steps/auto/funcptr-01.t
   branches/orderedhash_revamp/t/steps/auto/macports-01.t
   branches/orderedhash_revamp/t/steps/auto/macports-02.t
   branches/orderedhash_revamp/t/tools/pmc2c.t
   branches/orderedhash_revamp/tools/build/jit2c.pl
   branches/orderedhash_revamp/xconf/samples/testfoobar
   branches/orderedhash_revamp/xconf/samples/yourfoobar
Modified:
   branches/orderedhash_revamp/CREDITS
   branches/orderedhash_revamp/ChangeLog
   branches/orderedhash_revamp/Configure.pl
   branches/orderedhash_revamp/DEPRECATED.pod
   branches/orderedhash_revamp/MANIFEST
   branches/orderedhash_revamp/MANIFEST.SKIP
   branches/orderedhash_revamp/MANIFEST.generated
   branches/orderedhash_revamp/META.yml
   branches/orderedhash_revamp/NEWS
   branches/orderedhash_revamp/PBC_COMPAT
   branches/orderedhash_revamp/PLATFORMS
   branches/orderedhash_revamp/README
   branches/orderedhash_revamp/README_cygwin.pod
   branches/orderedhash_revamp/README_win32.pod
   branches/orderedhash_revamp/RESPONSIBLE_PARTIES
   branches/orderedhash_revamp/TODO
   branches/orderedhash_revamp/VERSION
   branches/orderedhash_revamp/compilers/imcc/cfg.c
   branches/orderedhash_revamp/compilers/imcc/cfg.h
   branches/orderedhash_revamp/compilers/imcc/debug.h
   branches/orderedhash_revamp/compilers/imcc/imc.c
   branches/orderedhash_revamp/compilers/imcc/imc.h
   branches/orderedhash_revamp/compilers/imcc/imcc.l
   branches/orderedhash_revamp/compilers/imcc/imcc.y
   branches/orderedhash_revamp/compilers/imcc/imclexer.c
   branches/orderedhash_revamp/compilers/imcc/imcparser.c
   branches/orderedhash_revamp/compilers/imcc/imcparser.h
   branches/orderedhash_revamp/compilers/imcc/instructions.c
   branches/orderedhash_revamp/compilers/imcc/instructions.h
   branches/orderedhash_revamp/compilers/imcc/main.c
   branches/orderedhash_revamp/compilers/imcc/optimizer.c
   branches/orderedhash_revamp/compilers/imcc/optimizer.h
   branches/orderedhash_revamp/compilers/imcc/parser.h
   branches/orderedhash_revamp/compilers/imcc/parser_util.c
   branches/orderedhash_revamp/compilers/imcc/pbc.c
   branches/orderedhash_revamp/compilers/imcc/pbc.h
   branches/orderedhash_revamp/compilers/imcc/pcc.c
   branches/orderedhash_revamp/compilers/imcc/reg_alloc.c
   branches/orderedhash_revamp/compilers/imcc/sets.h
   branches/orderedhash_revamp/compilers/imcc/symreg.c
   branches/orderedhash_revamp/compilers/imcc/symreg.h
   branches/orderedhash_revamp/compilers/imcc/unit.h
   branches/orderedhash_revamp/compilers/json/JSON/pge2pir.tg
   branches/orderedhash_revamp/compilers/ncigen/NCIGENP6.pm
   branches/orderedhash_revamp/compilers/ncigen/src/NCIPIR.pir
   branches/orderedhash_revamp/compilers/ncigen/src/builtins/say.pir
   branches/orderedhash_revamp/compilers/ncigen/src/parser/actions.pm
   branches/orderedhash_revamp/compilers/nqp/src/Grammar.pg
   branches/orderedhash_revamp/compilers/nqp/src/Grammar/Actions.pir
   branches/orderedhash_revamp/compilers/nqp/src/builtins.pir
   branches/orderedhash_revamp/compilers/pct/src/PAST/Compiler.pir
   branches/orderedhash_revamp/compilers/pct/src/PAST/Node.pir
   branches/orderedhash_revamp/compilers/pct/src/PCT/HLLCompiler.pir
   branches/orderedhash_revamp/compilers/pct/src/PCT/Node.pir
   branches/orderedhash_revamp/compilers/pct/src/POST/Compiler.pir
   branches/orderedhash_revamp/compilers/pct/src/POST/Node.pir
   branches/orderedhash_revamp/compilers/pge/PGE/Exp.pir
   branches/orderedhash_revamp/compilers/pge/PGE/Match.pir
   branches/orderedhash_revamp/compilers/pge/PGE/OPTable.pir
   branches/orderedhash_revamp/compilers/pge/PGE/Perl6Regex.pir
   branches/orderedhash_revamp/compilers/pge/README.pod
   branches/orderedhash_revamp/compilers/pge/STATUS
   branches/orderedhash_revamp/compilers/pirc/heredoc/heredocmain.c
   branches/orderedhash_revamp/compilers/pirc/macro/macro.l
   branches/orderedhash_revamp/compilers/pirc/macro/macroparser.c
   branches/orderedhash_revamp/compilers/pirc/src/bcgen.c
   branches/orderedhash_revamp/compilers/pirc/src/bcgen.h
   branches/orderedhash_revamp/compilers/pirc/src/hdocprep.c
   branches/orderedhash_revamp/compilers/pirc/src/hdocprep.l
   branches/orderedhash_revamp/compilers/pirc/src/main.c
   branches/orderedhash_revamp/compilers/pirc/src/pir.l
   branches/orderedhash_revamp/compilers/pirc/src/pir.y
   branches/orderedhash_revamp/compilers/pirc/src/pircapi.c
   branches/orderedhash_revamp/compilers/pirc/src/pircapi.h
   branches/orderedhash_revamp/compilers/pirc/src/pircompiler.h
   branches/orderedhash_revamp/compilers/pirc/src/pircompunit.c
   branches/orderedhash_revamp/compilers/pirc/src/pircompunit.h
   branches/orderedhash_revamp/compilers/pirc/src/piremit.c
   branches/orderedhash_revamp/compilers/pirc/src/piremit.h
   branches/orderedhash_revamp/compilers/pirc/src/pirerr.h
   branches/orderedhash_revamp/compilers/pirc/src/pirlexer.c
   branches/orderedhash_revamp/compilers/pirc/src/pirlexer.h
   branches/orderedhash_revamp/compilers/pirc/src/pirmacro.c
   branches/orderedhash_revamp/compilers/pirc/src/pirop.c
   branches/orderedhash_revamp/compilers/pirc/src/pirop.h
   branches/orderedhash_revamp/compilers/pirc/src/pirparser.c
   branches/orderedhash_revamp/compilers/pirc/src/pirparser.h
   branches/orderedhash_revamp/compilers/pirc/src/pirpcc.c
   branches/orderedhash_revamp/compilers/pirc/src/pirregalloc.c
   branches/orderedhash_revamp/compilers/tge/TGE.pir
   branches/orderedhash_revamp/compilers/tge/TGE/Compiler.pir
   branches/orderedhash_revamp/compilers/tge/TGE/Grammar.pir
   branches/orderedhash_revamp/compilers/tge/tgc.pir
   branches/orderedhash_revamp/config/auto/alignptrs.pm
   branches/orderedhash_revamp/config/auto/arch.pm
   branches/orderedhash_revamp/config/auto/byteorder/test_c.in
   branches/orderedhash_revamp/config/auto/cgoto.pm
   branches/orderedhash_revamp/config/auto/cpu.pm
   branches/orderedhash_revamp/config/auto/cpu/i386/auto.pm
   branches/orderedhash_revamp/config/auto/crypto.pm
   branches/orderedhash_revamp/config/auto/env/test_unsetenv_c.in
   branches/orderedhash_revamp/config/auto/format.pm
   branches/orderedhash_revamp/config/auto/gc.pm
   branches/orderedhash_revamp/config/auto/gdbm.pm
   branches/orderedhash_revamp/config/auto/gettext.pm
   branches/orderedhash_revamp/config/auto/gmp.pm
   branches/orderedhash_revamp/config/auto/gmp/gmp_c.in
   branches/orderedhash_revamp/config/auto/headers.pm
   branches/orderedhash_revamp/config/auto/icu.pm
   branches/orderedhash_revamp/config/auto/jit.pm
   branches/orderedhash_revamp/config/auto/msvc.pm
   branches/orderedhash_revamp/config/auto/opengl.pm
   branches/orderedhash_revamp/config/auto/pcre.pm
   branches/orderedhash_revamp/config/auto/perldoc.pm
   branches/orderedhash_revamp/config/auto/pmc.pm
   branches/orderedhash_revamp/config/auto/pod2man.pm
   branches/orderedhash_revamp/config/auto/readline.pm
   branches/orderedhash_revamp/config/auto/readline/readline_c.in
   branches/orderedhash_revamp/config/auto/signal.pm
   branches/orderedhash_revamp/config/auto/socklen_t.pm
   branches/orderedhash_revamp/config/auto/thread.pm
   branches/orderedhash_revamp/config/gen/call_list/misc.in
   branches/orderedhash_revamp/config/gen/config_h.pm
   branches/orderedhash_revamp/config/gen/config_h/config_h.in
   branches/orderedhash_revamp/config/gen/core_pmcs.pm
   branches/orderedhash_revamp/config/gen/crypto.pm
   branches/orderedhash_revamp/config/gen/crypto/digest_pmc.in
   branches/orderedhash_revamp/config/gen/crypto/digest_t.in
   branches/orderedhash_revamp/config/gen/makefiles.pm
   branches/orderedhash_revamp/config/gen/makefiles/docs.in
   branches/orderedhash_revamp/config/gen/makefiles/dynoplibs.in
   branches/orderedhash_revamp/config/gen/makefiles/dynpmc.in
   branches/orderedhash_revamp/config/gen/makefiles/dynpmc_pl.in
   branches/orderedhash_revamp/config/gen/makefiles/pirc.in
   branches/orderedhash_revamp/config/gen/makefiles/root.in
   branches/orderedhash_revamp/config/gen/opengl.pm
   branches/orderedhash_revamp/config/gen/parrot_include.pm
   branches/orderedhash_revamp/config/gen/platform.pm
   branches/orderedhash_revamp/config/gen/platform/ansi/dl.c
   branches/orderedhash_revamp/config/gen/platform/ansi/exec.c
   branches/orderedhash_revamp/config/gen/platform/ansi/time.c
   branches/orderedhash_revamp/config/gen/platform/generic/env.c
   branches/orderedhash_revamp/config/gen/platform/generic/exec.c
   branches/orderedhash_revamp/config/gen/platform/generic/platform_limits.h
   branches/orderedhash_revamp/config/gen/platform/generic/stat.c
   branches/orderedhash_revamp/config/gen/platform/netbsd/math.c
   branches/orderedhash_revamp/config/gen/platform/netbsd/misc.c
   branches/orderedhash_revamp/config/gen/platform/openbsd/memexec.c
   branches/orderedhash_revamp/config/gen/platform/platform_interface.h
   branches/orderedhash_revamp/config/gen/platform/win32/env.c
   branches/orderedhash_revamp/config/gen/platform/win32/exec.c
   branches/orderedhash_revamp/config/gen/platform/win32/stat.c
   branches/orderedhash_revamp/config/gen/platform/win32/time.c
   branches/orderedhash_revamp/config/init/defaults.pm
   branches/orderedhash_revamp/config/init/hints.pm
   branches/orderedhash_revamp/config/init/hints/cygwin.pm
   branches/orderedhash_revamp/config/init/hints/darwin.pm
   branches/orderedhash_revamp/config/init/hints/dec_osf.pm
   branches/orderedhash_revamp/config/init/hints/dragonfly.pm
   branches/orderedhash_revamp/config/init/hints/hpux.pm
   branches/orderedhash_revamp/config/init/hints/irix.pm
   branches/orderedhash_revamp/config/init/hints/linux.pm
   branches/orderedhash_revamp/config/init/hints/mswin32.pm
   branches/orderedhash_revamp/config/init/hints/netbsd.pm
   branches/orderedhash_revamp/config/init/hints/openbsd.pm
   branches/orderedhash_revamp/config/init/hints/solaris.pm
   branches/orderedhash_revamp/config/init/optimize.pm
   branches/orderedhash_revamp/config/inter/charset.pm
   branches/orderedhash_revamp/config/inter/encoding.pm
   branches/orderedhash_revamp/config/inter/libparrot.pm
   branches/orderedhash_revamp/config/inter/make.pm
   branches/orderedhash_revamp/config/inter/progs.pm
   branches/orderedhash_revamp/docs/book/draft/appc_command_line_options.pod
   branches/orderedhash_revamp/docs/book/draft/ch07_dynpmcs.pod
   branches/orderedhash_revamp/docs/book/draft/ch08_dynops.pod
   branches/orderedhash_revamp/docs/book/draft/ch10_opcode_reference.pod
   branches/orderedhash_revamp/docs/book/draft/ch11_directive_reference.pod
   branches/orderedhash_revamp/docs/book/pir/ch01_introduction.pod
   branches/orderedhash_revamp/docs/book/pir/ch03_basic_syntax.pod
   branches/orderedhash_revamp/docs/book/pir/ch04_variables.pod
   branches/orderedhash_revamp/docs/book/pir/ch05_control_structures.pod
   branches/orderedhash_revamp/docs/book/pir/ch06_subroutines.pod
   branches/orderedhash_revamp/docs/book/pir/ch09_exceptions.pod
   branches/orderedhash_revamp/docs/compiler_faq.pod
   branches/orderedhash_revamp/docs/configuration.pod
   branches/orderedhash_revamp/docs/debug.pod
   branches/orderedhash_revamp/docs/debugger.pod
   branches/orderedhash_revamp/docs/dev/events.pod
   branches/orderedhash_revamp/docs/dev/pmc_freeze.pod
   branches/orderedhash_revamp/docs/embed.pod
   branches/orderedhash_revamp/docs/intro.pod
   branches/orderedhash_revamp/docs/memory_internals.pod
   branches/orderedhash_revamp/docs/parrot.pod
   branches/orderedhash_revamp/docs/parrothist.pod
   branches/orderedhash_revamp/docs/pdds/draft/pdd06_pasm.pod
   branches/orderedhash_revamp/docs/pdds/draft/pdd08_keys.pod
   branches/orderedhash_revamp/docs/pdds/draft/pdd10_embedding.pod
   branches/orderedhash_revamp/docs/pdds/draft/pdd16_native_call.pod
   branches/orderedhash_revamp/docs/pdds/pdd03_calling_conventions.pod
   branches/orderedhash_revamp/docs/pdds/pdd07_codingstd.pod
   branches/orderedhash_revamp/docs/pdds/pdd09_gc.pod
   branches/orderedhash_revamp/docs/pdds/pdd13_bytecode.pod
   branches/orderedhash_revamp/docs/pdds/pdd15_objects.pod
   branches/orderedhash_revamp/docs/pdds/pdd17_pmc.pod
   branches/orderedhash_revamp/docs/pdds/pdd19_pir.pod
   branches/orderedhash_revamp/docs/pdds/pdd22_io.pod
   branches/orderedhash_revamp/docs/pdds/pdd28_strings.pod
   branches/orderedhash_revamp/docs/pdds/pdd30_install.pod
   branches/orderedhash_revamp/docs/pmc.pod
   branches/orderedhash_revamp/docs/pmc/subs.pod
   branches/orderedhash_revamp/docs/pmc2c.pod
   branches/orderedhash_revamp/docs/porting_intro.pod
   branches/orderedhash_revamp/docs/project/branching_guide.pod
   branches/orderedhash_revamp/docs/project/cage_cleaners_guide.pod
   branches/orderedhash_revamp/docs/project/debian_packaging_guide.pod
   branches/orderedhash_revamp/docs/project/release_manager_guide.pod
   branches/orderedhash_revamp/docs/project/support_policy.pod
   branches/orderedhash_revamp/docs/project/ticket_triaging.pod
   branches/orderedhash_revamp/docs/project/ubuntu_packaging_guide.pod
   branches/orderedhash_revamp/docs/resources/parrot.css
   branches/orderedhash_revamp/docs/running.pod
   branches/orderedhash_revamp/docs/submissions.pod
   branches/orderedhash_revamp/docs/tests.pod
   branches/orderedhash_revamp/docs/user/pir/intro.pod
   branches/orderedhash_revamp/docs/user/pir/pmcs.pod
   branches/orderedhash_revamp/docs/vtables.pod
   branches/orderedhash_revamp/editor/README.pod
   branches/orderedhash_revamp/editor/pir-mode.el
   branches/orderedhash_revamp/examples/benchmarks/addit.pasm
   branches/orderedhash_revamp/examples/benchmarks/array_access.pir
   branches/orderedhash_revamp/examples/benchmarks/oofib.pir
   branches/orderedhash_revamp/examples/benchmarks/overload.pir
   branches/orderedhash_revamp/examples/benchmarks/primes.c
   branches/orderedhash_revamp/examples/benchmarks/primes.pasm
   branches/orderedhash_revamp/examples/benchmarks/primes2.c
   branches/orderedhash_revamp/examples/benchmarks/stress.pasm
   branches/orderedhash_revamp/examples/benchmarks/stress1.pasm
   branches/orderedhash_revamp/examples/benchmarks/stress2.pasm
   branches/orderedhash_revamp/examples/benchmarks/stress3.pasm
   branches/orderedhash_revamp/examples/c/test_main.c
   branches/orderedhash_revamp/examples/compilers/japhc.c
   branches/orderedhash_revamp/examples/embed/Makefile
   branches/orderedhash_revamp/examples/embed/Makefile.msvc
   branches/orderedhash_revamp/examples/japh/japh3.pasm
   branches/orderedhash_revamp/examples/json/postalcodes.pir
   branches/orderedhash_revamp/examples/json/test.pir
   branches/orderedhash_revamp/examples/languages/abc/abc.pir
   branches/orderedhash_revamp/examples/languages/abc/src/builtins/all.pir
   branches/orderedhash_revamp/examples/languages/abc/t/01-tests.t
   branches/orderedhash_revamp/examples/languages/squaak/squaak.pir
   branches/orderedhash_revamp/examples/languages/squaak/src/builtins/say.pir
   branches/orderedhash_revamp/examples/library/getopt_demo.pir
   branches/orderedhash_revamp/examples/nci/Xlib.pir
   branches/orderedhash_revamp/examples/nci/xlibtest.p6
   branches/orderedhash_revamp/examples/opengl/shapes.pir
   branches/orderedhash_revamp/examples/pasm/fact.pasm
   branches/orderedhash_revamp/examples/past/01-sub.pir
   branches/orderedhash_revamp/examples/past/four_plus_one.pir
   branches/orderedhash_revamp/examples/pir/befunge/flow.pir
   branches/orderedhash_revamp/examples/pir/life.pir
   branches/orderedhash_revamp/examples/pir/pirric.pir
   branches/orderedhash_revamp/examples/pir/quine_ord.pir
   branches/orderedhash_revamp/examples/pir/sudoku.pir
   branches/orderedhash_revamp/examples/sdl/mandel.pir
   branches/orderedhash_revamp/examples/sdl/minesweeper/field.pir
   branches/orderedhash_revamp/examples/sdl/tetris/board.pir
   branches/orderedhash_revamp/examples/shootout/knucleotide.pir
   branches/orderedhash_revamp/examples/shootout/random.pasm
   branches/orderedhash_revamp/examples/shootout/regexdna.pir
   branches/orderedhash_revamp/examples/subs/bsr_ret.pasm
   branches/orderedhash_revamp/examples/tutorial/55_iterator.pir
   branches/orderedhash_revamp/ext/SQLite3/SQLite3.pir
   branches/orderedhash_revamp/ext/SQLite3/gen_sqlite3.pl
   branches/orderedhash_revamp/ext/SQLite3/test.pir
   branches/orderedhash_revamp/include/parrot/call.h
   branches/orderedhash_revamp/include/parrot/charset.h
   branches/orderedhash_revamp/include/parrot/compiler.h
   branches/orderedhash_revamp/include/parrot/datatypes.h
   branches/orderedhash_revamp/include/parrot/debugger.h
   branches/orderedhash_revamp/include/parrot/dynext.h
   branches/orderedhash_revamp/include/parrot/encoding.h
   branches/orderedhash_revamp/include/parrot/enums.h
   branches/orderedhash_revamp/include/parrot/events.h
   branches/orderedhash_revamp/include/parrot/exceptions.h
   branches/orderedhash_revamp/include/parrot/exit.h
   branches/orderedhash_revamp/include/parrot/extend.h
   branches/orderedhash_revamp/include/parrot/gc_api.h
   branches/orderedhash_revamp/include/parrot/global.h
   branches/orderedhash_revamp/include/parrot/global_setup.h
   branches/orderedhash_revamp/include/parrot/hash.h
   branches/orderedhash_revamp/include/parrot/hll.h
   branches/orderedhash_revamp/include/parrot/interpreter.h
   branches/orderedhash_revamp/include/parrot/io.h
   branches/orderedhash_revamp/include/parrot/io_portable.h
   branches/orderedhash_revamp/include/parrot/io_unix.h
   branches/orderedhash_revamp/include/parrot/io_win32.h
   branches/orderedhash_revamp/include/parrot/key.h
   branches/orderedhash_revamp/include/parrot/library.h
   branches/orderedhash_revamp/include/parrot/list.h
   branches/orderedhash_revamp/include/parrot/longopt.h
   branches/orderedhash_revamp/include/parrot/memory.h
   branches/orderedhash_revamp/include/parrot/misc.h
   branches/orderedhash_revamp/include/parrot/multidispatch.h
   branches/orderedhash_revamp/include/parrot/oo.h
   branches/orderedhash_revamp/include/parrot/op.h
   branches/orderedhash_revamp/include/parrot/packfile.h
   branches/orderedhash_revamp/include/parrot/parrot.h
   branches/orderedhash_revamp/include/parrot/pmc.h
   branches/orderedhash_revamp/include/parrot/pmc_freeze.h
   branches/orderedhash_revamp/include/parrot/pobj.h
   branches/orderedhash_revamp/include/parrot/runcore_api.h
   branches/orderedhash_revamp/include/parrot/runcore_trace.h
   branches/orderedhash_revamp/include/parrot/scheduler.h
   branches/orderedhash_revamp/include/parrot/settings.h
   branches/orderedhash_revamp/include/parrot/string_funcs.h
   branches/orderedhash_revamp/include/parrot/string_primitives.h
   branches/orderedhash_revamp/include/parrot/sub.h
   branches/orderedhash_revamp/include/parrot/thread.h
   branches/orderedhash_revamp/include/parrot/tsq.h
   branches/orderedhash_revamp/include/parrot/vtables.h
   branches/orderedhash_revamp/include/parrot/warnings.h
   branches/orderedhash_revamp/lib/IO/CaptureOutput.pm
   branches/orderedhash_revamp/lib/Parrot/Configure/Options/Conf.pm
   branches/orderedhash_revamp/lib/Parrot/Configure/Options/Conf/Shared.pm
   branches/orderedhash_revamp/lib/Parrot/Configure/Options/Test.pm
   branches/orderedhash_revamp/lib/Parrot/Configure/Options/Test/Prepare.pm
   branches/orderedhash_revamp/lib/Parrot/Configure/Step/List.pm
   branches/orderedhash_revamp/lib/Parrot/Configure/Step/Methods.pm
   branches/orderedhash_revamp/lib/Parrot/Configure/Trace.pm
   branches/orderedhash_revamp/lib/Parrot/Distribution.pm
   branches/orderedhash_revamp/lib/Parrot/Docs/File.pm
   branches/orderedhash_revamp/lib/Parrot/Docs/Section/C.pm
   branches/orderedhash_revamp/lib/Parrot/Docs/Section/Developer.pm
   branches/orderedhash_revamp/lib/Parrot/Docs/Section/Parrot.pm
   branches/orderedhash_revamp/lib/Parrot/Docs/Section/Tools.pm
   branches/orderedhash_revamp/lib/Parrot/Harness/DefaultTests.pm
   branches/orderedhash_revamp/lib/Parrot/Harness/Options.pm
   branches/orderedhash_revamp/lib/Parrot/Harness/Smoke.pm
   branches/orderedhash_revamp/lib/Parrot/Manifest.pm
   branches/orderedhash_revamp/lib/Parrot/Op.pm
   branches/orderedhash_revamp/lib/Parrot/OpTrans.pm
   branches/orderedhash_revamp/lib/Parrot/OpTrans/C.pm
   branches/orderedhash_revamp/lib/Parrot/OpTrans/CGP.pm
   branches/orderedhash_revamp/lib/Parrot/OpTrans/CGoto.pm
   branches/orderedhash_revamp/lib/Parrot/OpTrans/CPrederef.pm
   branches/orderedhash_revamp/lib/Parrot/OpTrans/CSwitch.pm
   branches/orderedhash_revamp/lib/Parrot/Ops2c/Utils.pm
   branches/orderedhash_revamp/lib/Parrot/OpsFile.pm
   branches/orderedhash_revamp/lib/Parrot/Pmc2c/Attribute.pm
   branches/orderedhash_revamp/lib/Parrot/Pmc2c/Dumper.pm
   branches/orderedhash_revamp/lib/Parrot/Pmc2c/Method.pm
   branches/orderedhash_revamp/lib/Parrot/Pmc2c/MethodEmitter.pm
   branches/orderedhash_revamp/lib/Parrot/Pmc2c/Object.pm
   branches/orderedhash_revamp/lib/Parrot/Pmc2c/PCCMETHOD.pm
   branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMC.pm
   branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMC/Null.pm
   branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMC/Object.pm
   branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMC/ParrotClass.pm
   branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMC/RO.pm
   branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMC/default.pm
   branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMCEmitter.pm
   branches/orderedhash_revamp/lib/Parrot/Pmc2c/Parser.pm
   branches/orderedhash_revamp/lib/Parrot/Pmc2c/UtilFunctions.pm
   branches/orderedhash_revamp/lib/Parrot/Revision.pm
   branches/orderedhash_revamp/lib/Parrot/Test.pm
   branches/orderedhash_revamp/lib/Parrot/Test/Harness.pm
   branches/orderedhash_revamp/lib/Parrot/Test/PIR_PGE.pm
   branches/orderedhash_revamp/lib/Parrot/Test/Pod.pm
   branches/orderedhash_revamp/lib/Parrot/Vtable.pm
   branches/orderedhash_revamp/ports/cygwin/README
   branches/orderedhash_revamp/ports/debian/changelog
   branches/orderedhash_revamp/ports/debian/parrot-devel.install.in
   branches/orderedhash_revamp/ports/debian/rules
   branches/orderedhash_revamp/ports/fedora/parrot.spec.fedora
   branches/orderedhash_revamp/ports/macports/Portfile
   branches/orderedhash_revamp/ports/mandriva/parrot.spec.mandriva
   branches/orderedhash_revamp/ports/suse/parrot.spec.suse
   branches/orderedhash_revamp/ports/ubuntu/changelog
   branches/orderedhash_revamp/ports/ubuntu/control.in
   branches/orderedhash_revamp/runtime/parrot/include/fp_equality.pasm
   branches/orderedhash_revamp/runtime/parrot/include/hllmacros.pir
   branches/orderedhash_revamp/runtime/parrot/include/test_more.pir
   branches/orderedhash_revamp/runtime/parrot/library/Config/JSON.pir
   branches/orderedhash_revamp/runtime/parrot/library/Crow.pir
   branches/orderedhash_revamp/runtime/parrot/library/Curses.pir
   branches/orderedhash_revamp/runtime/parrot/library/Data/Dumper/Default.pir
   branches/orderedhash_revamp/runtime/parrot/library/Getopt/Obj.pir
   branches/orderedhash_revamp/runtime/parrot/library/JSON.pir
   branches/orderedhash_revamp/runtime/parrot/library/OpenGL.pir
   branches/orderedhash_revamp/runtime/parrot/library/P6object.pir
   branches/orderedhash_revamp/runtime/parrot/library/PGE/Dumper.pir
   branches/orderedhash_revamp/runtime/parrot/library/PGE/Glob.pir
   branches/orderedhash_revamp/runtime/parrot/library/PGE/Hs.pir
   branches/orderedhash_revamp/runtime/parrot/library/PGE/Perl6Grammar.pir
   branches/orderedhash_revamp/runtime/parrot/library/PGE/Text.pir
   branches/orderedhash_revamp/runtime/parrot/library/PGE/Util.pir
   branches/orderedhash_revamp/runtime/parrot/library/Protoobject.pir
   branches/orderedhash_revamp/runtime/parrot/library/Range.pir
   branches/orderedhash_revamp/runtime/parrot/library/SDL/StopWatch.pir
   branches/orderedhash_revamp/runtime/parrot/library/Stream/Combiner.pir
   branches/orderedhash_revamp/runtime/parrot/library/Tcl/Glob.pir
   branches/orderedhash_revamp/runtime/parrot/library/Test/Class.pir
   branches/orderedhash_revamp/runtime/parrot/library/Test/More.pir
   branches/orderedhash_revamp/runtime/parrot/library/YAML/Dumper/Default.pir
   branches/orderedhash_revamp/runtime/parrot/library/parrotlib.pir
   branches/orderedhash_revamp/runtime/parrot/library/pcre.pir
   branches/orderedhash_revamp/src/byteorder.c
   branches/orderedhash_revamp/src/call/ops.c
   branches/orderedhash_revamp/src/call/pcc.c
   branches/orderedhash_revamp/src/debug.c
   branches/orderedhash_revamp/src/dynext.c
   branches/orderedhash_revamp/src/dynoplibs/obscure.ops
   branches/orderedhash_revamp/src/dynpmc/dynlexpad.pmc
   branches/orderedhash_revamp/src/dynpmc/foo.pmc
   branches/orderedhash_revamp/src/dynpmc/gdbmhash.pmc
   branches/orderedhash_revamp/src/dynpmc/rational.pmc
   branches/orderedhash_revamp/src/dynpmc/rotest.pmc
   branches/orderedhash_revamp/src/dynpmc/subproxy.pmc
   branches/orderedhash_revamp/src/embed.c
   branches/orderedhash_revamp/src/events.c
   branches/orderedhash_revamp/src/exceptions.c
   branches/orderedhash_revamp/src/exit.c
   branches/orderedhash_revamp/src/extend.c
   branches/orderedhash_revamp/src/gc/alloc_memory.c
   branches/orderedhash_revamp/src/gc/alloc_resources.c
   branches/orderedhash_revamp/src/gc/api.c
   branches/orderedhash_revamp/src/gc/gc_inf.c
   branches/orderedhash_revamp/src/gc/gc_ms.c
   branches/orderedhash_revamp/src/gc/gc_private.h
   branches/orderedhash_revamp/src/gc/malloc_trace.c
   branches/orderedhash_revamp/src/gc/mark_sweep.c
   branches/orderedhash_revamp/src/gc/system.c
   branches/orderedhash_revamp/src/global.c
   branches/orderedhash_revamp/src/global_setup.c
   branches/orderedhash_revamp/src/hash.c
   branches/orderedhash_revamp/src/hll.c
   branches/orderedhash_revamp/src/interp/inter_cb.c
   branches/orderedhash_revamp/src/interp/inter_create.c
   branches/orderedhash_revamp/src/interp/inter_misc.c
   branches/orderedhash_revamp/src/io/api.c
   branches/orderedhash_revamp/src/io/buffer.c
   branches/orderedhash_revamp/src/io/core.c
   branches/orderedhash_revamp/src/io/filehandle.c
   branches/orderedhash_revamp/src/io/portable.c
   branches/orderedhash_revamp/src/io/socket_api.c
   branches/orderedhash_revamp/src/io/socket_unix.c
   branches/orderedhash_revamp/src/io/socket_win32.c
   branches/orderedhash_revamp/src/io/unix.c
   branches/orderedhash_revamp/src/io/utf8.c
   branches/orderedhash_revamp/src/io/win32.c
   branches/orderedhash_revamp/src/key.c
   branches/orderedhash_revamp/src/library.c
   branches/orderedhash_revamp/src/list.c
   branches/orderedhash_revamp/src/longopt.c
   branches/orderedhash_revamp/src/misc.c
   branches/orderedhash_revamp/src/multidispatch.c
   branches/orderedhash_revamp/src/nci_test.c
   branches/orderedhash_revamp/src/oo.c
   branches/orderedhash_revamp/src/ops/bit.ops
   branches/orderedhash_revamp/src/ops/cmp.ops
   branches/orderedhash_revamp/src/ops/core.ops
   branches/orderedhash_revamp/src/ops/debug.ops
   branches/orderedhash_revamp/src/ops/experimental.ops
   branches/orderedhash_revamp/src/ops/io.ops
   branches/orderedhash_revamp/src/ops/math.ops
   branches/orderedhash_revamp/src/ops/object.ops
   branches/orderedhash_revamp/src/ops/ops.num
   branches/orderedhash_revamp/src/ops/pmc.ops
   branches/orderedhash_revamp/src/ops/set.ops
   branches/orderedhash_revamp/src/ops/string.ops
   branches/orderedhash_revamp/src/ops/sys.ops
   branches/orderedhash_revamp/src/ops/var.ops
   branches/orderedhash_revamp/src/packdump.c
   branches/orderedhash_revamp/src/packfile.c
   branches/orderedhash_revamp/src/packfile/pf_items.c
   branches/orderedhash_revamp/src/packout.c
   branches/orderedhash_revamp/src/parrot_debugger.c
   branches/orderedhash_revamp/src/pbc_disassemble.c
   branches/orderedhash_revamp/src/pbc_dump.c
   branches/orderedhash_revamp/src/pbc_merge.c
   branches/orderedhash_revamp/src/pmc.c
   branches/orderedhash_revamp/src/pmc/addrregistry.pmc
   branches/orderedhash_revamp/src/pmc/array.pmc
   branches/orderedhash_revamp/src/pmc/arrayiterator.pmc
   branches/orderedhash_revamp/src/pmc/bigint.pmc
   branches/orderedhash_revamp/src/pmc/bignum.pmc
   branches/orderedhash_revamp/src/pmc/boolean.pmc
   branches/orderedhash_revamp/src/pmc/capture.pmc
   branches/orderedhash_revamp/src/pmc/class.pmc
   branches/orderedhash_revamp/src/pmc/codestring.pmc
   branches/orderedhash_revamp/src/pmc/complex.pmc
   branches/orderedhash_revamp/src/pmc/continuation.pmc
   branches/orderedhash_revamp/src/pmc/coroutine.pmc
   branches/orderedhash_revamp/src/pmc/cpointer.pmc
   branches/orderedhash_revamp/src/pmc/default.pmc
   branches/orderedhash_revamp/src/pmc/env.pmc
   branches/orderedhash_revamp/src/pmc/eval.pmc
   branches/orderedhash_revamp/src/pmc/eventhandler.pmc
   branches/orderedhash_revamp/src/pmc/exception.pmc
   branches/orderedhash_revamp/src/pmc/exceptionhandler.pmc
   branches/orderedhash_revamp/src/pmc/exporter.pmc
   branches/orderedhash_revamp/src/pmc/file.pmc
   branches/orderedhash_revamp/src/pmc/filehandle.pmc
   branches/orderedhash_revamp/src/pmc/fixedbooleanarray.pmc
   branches/orderedhash_revamp/src/pmc/fixedfloatarray.pmc
   branches/orderedhash_revamp/src/pmc/fixedintegerarray.pmc
   branches/orderedhash_revamp/src/pmc/fixedpmcarray.pmc
   branches/orderedhash_revamp/src/pmc/fixedstringarray.pmc
   branches/orderedhash_revamp/src/pmc/float.pmc
   branches/orderedhash_revamp/src/pmc/hash.pmc
   branches/orderedhash_revamp/src/pmc/hashiterator.pmc
   branches/orderedhash_revamp/src/pmc/hashiteratorkey.pmc
   branches/orderedhash_revamp/src/pmc/integer.pmc
   branches/orderedhash_revamp/src/pmc/iterator.pmc
   branches/orderedhash_revamp/src/pmc/key.pmc
   branches/orderedhash_revamp/src/pmc/lexinfo.pmc
   branches/orderedhash_revamp/src/pmc/lexpad.pmc
   branches/orderedhash_revamp/src/pmc/managedstruct.pmc
   branches/orderedhash_revamp/src/pmc/multisub.pmc
   branches/orderedhash_revamp/src/pmc/namespace.pmc
   branches/orderedhash_revamp/src/pmc/nci.pmc
   branches/orderedhash_revamp/src/pmc/null.pmc
   branches/orderedhash_revamp/src/pmc/object.pmc
   branches/orderedhash_revamp/src/pmc/orderedhashiterator.pmc
   branches/orderedhash_revamp/src/pmc/os.pmc
   branches/orderedhash_revamp/src/pmc/packfile.pmc
   branches/orderedhash_revamp/src/pmc/packfileannotation.pmc
   branches/orderedhash_revamp/src/pmc/packfileannotations.pmc
   branches/orderedhash_revamp/src/pmc/packfileconstanttable.pmc
   branches/orderedhash_revamp/src/pmc/packfiledirectory.pmc
   branches/orderedhash_revamp/src/pmc/packfilefixupentry.pmc
   branches/orderedhash_revamp/src/pmc/packfilefixuptable.pmc
   branches/orderedhash_revamp/src/pmc/packfilerawsegment.pmc
   branches/orderedhash_revamp/src/pmc/packfilesegment.pmc
   branches/orderedhash_revamp/src/pmc/parrotinterpreter.pmc
   branches/orderedhash_revamp/src/pmc/parrotlibrary.pmc
   branches/orderedhash_revamp/src/pmc/parrotrunningthread.pmc
   branches/orderedhash_revamp/src/pmc/parrotthread.pmc
   branches/orderedhash_revamp/src/pmc/pccmethod_test.pmc
   branches/orderedhash_revamp/src/pmc/pmcproxy.pmc
   branches/orderedhash_revamp/src/pmc/pointer.pmc
   branches/orderedhash_revamp/src/pmc/resizablebooleanarray.pmc
   branches/orderedhash_revamp/src/pmc/resizablefloatarray.pmc
   branches/orderedhash_revamp/src/pmc/resizableintegerarray.pmc
   branches/orderedhash_revamp/src/pmc/resizablepmcarray.pmc
   branches/orderedhash_revamp/src/pmc/resizablestringarray.pmc
   branches/orderedhash_revamp/src/pmc/retcontinuation.pmc
   branches/orderedhash_revamp/src/pmc/role.pmc
   branches/orderedhash_revamp/src/pmc/scalar.pmc
   branches/orderedhash_revamp/src/pmc/scheduler.pmc
   branches/orderedhash_revamp/src/pmc/schedulermessage.pmc
   branches/orderedhash_revamp/src/pmc/sockaddr.pmc
   branches/orderedhash_revamp/src/pmc/socket.pmc
   branches/orderedhash_revamp/src/pmc/string.pmc
   branches/orderedhash_revamp/src/pmc/stringhandle.pmc
   branches/orderedhash_revamp/src/pmc/stringiterator.pmc
   branches/orderedhash_revamp/src/pmc/sub.pmc
   branches/orderedhash_revamp/src/pmc/task.pmc
   branches/orderedhash_revamp/src/pmc/timer.pmc
   branches/orderedhash_revamp/src/pmc/undef.pmc
   branches/orderedhash_revamp/src/pmc/unmanagedstruct.pmc
   branches/orderedhash_revamp/src/pmc_freeze.c
   branches/orderedhash_revamp/src/runcore/cores.c
   branches/orderedhash_revamp/src/runcore/main.c
   branches/orderedhash_revamp/src/runcore/trace.c
   branches/orderedhash_revamp/src/scheduler.c
   branches/orderedhash_revamp/src/spf_render.c
   branches/orderedhash_revamp/src/spf_vtable.c
   branches/orderedhash_revamp/src/string/api.c
   branches/orderedhash_revamp/src/string/charset.c
   branches/orderedhash_revamp/src/string/charset/ascii.c
   branches/orderedhash_revamp/src/string/charset/ascii.h
   branches/orderedhash_revamp/src/string/charset/binary.c
   branches/orderedhash_revamp/src/string/charset/binary.h
   branches/orderedhash_revamp/src/string/charset/iso-8859-1.c
   branches/orderedhash_revamp/src/string/charset/iso-8859-1.h
   branches/orderedhash_revamp/src/string/charset/unicode.c
   branches/orderedhash_revamp/src/string/charset/unicode.h
   branches/orderedhash_revamp/src/string/encoding.c
   branches/orderedhash_revamp/src/string/encoding/fixed_8.c
   branches/orderedhash_revamp/src/string/encoding/fixed_8.h
   branches/orderedhash_revamp/src/string/encoding/ucs2.c
   branches/orderedhash_revamp/src/string/encoding/ucs2.h
   branches/orderedhash_revamp/src/string/encoding/utf16.c
   branches/orderedhash_revamp/src/string/encoding/utf16.h
   branches/orderedhash_revamp/src/string/encoding/utf8.c
   branches/orderedhash_revamp/src/string/encoding/utf8.h
   branches/orderedhash_revamp/src/string/primitives.c
   branches/orderedhash_revamp/src/sub.c
   branches/orderedhash_revamp/src/thread.c
   branches/orderedhash_revamp/src/utils.c
   branches/orderedhash_revamp/src/vtable.tbl
   branches/orderedhash_revamp/src/vtables.c
   branches/orderedhash_revamp/src/warnings.c
   branches/orderedhash_revamp/t/benchmark/benchmarks.t
   branches/orderedhash_revamp/t/codingstd/c_function_docs.t
   branches/orderedhash_revamp/t/codingstd/c_indent.t
   branches/orderedhash_revamp/t/codingstd/c_parens.t
   branches/orderedhash_revamp/t/codingstd/copyright.t
   branches/orderedhash_revamp/t/codingstd/linelength.t
   branches/orderedhash_revamp/t/codingstd/pod_description.t
   branches/orderedhash_revamp/t/codingstd/svn_id.t
   branches/orderedhash_revamp/t/compilers/imcc/imcpasm/cfg.t
   branches/orderedhash_revamp/t/compilers/imcc/imcpasm/opt0.t
   branches/orderedhash_revamp/t/compilers/imcc/imcpasm/optc.t
   branches/orderedhash_revamp/t/compilers/imcc/syn/clash.t
   branches/orderedhash_revamp/t/compilers/imcc/syn/const.t
   branches/orderedhash_revamp/t/compilers/imcc/syn/errors.t
   branches/orderedhash_revamp/t/compilers/imcc/syn/file.t
   branches/orderedhash_revamp/t/compilers/imcc/syn/hll.t
   branches/orderedhash_revamp/t/compilers/imcc/syn/labels.t
   branches/orderedhash_revamp/t/compilers/imcc/syn/macro.t
   branches/orderedhash_revamp/t/compilers/imcc/syn/objects.t
   branches/orderedhash_revamp/t/compilers/imcc/syn/op.t
   branches/orderedhash_revamp/t/compilers/imcc/syn/pcc.t
   branches/orderedhash_revamp/t/compilers/imcc/syn/pod.t
   branches/orderedhash_revamp/t/compilers/imcc/syn/regressions.t
   branches/orderedhash_revamp/t/compilers/imcc/syn/scope.t
   branches/orderedhash_revamp/t/compilers/imcc/syn/subflags.t
   branches/orderedhash_revamp/t/compilers/imcc/syn/symbols.t
   branches/orderedhash_revamp/t/compilers/imcc/syn/veracity.t
   branches/orderedhash_revamp/t/compilers/json/from_parrot.t
   branches/orderedhash_revamp/t/compilers/json/to_parrot.t
   branches/orderedhash_revamp/t/compilers/pct/past.t
   branches/orderedhash_revamp/t/compilers/pct/post.t
   branches/orderedhash_revamp/t/compilers/pge/02-match.t
   branches/orderedhash_revamp/t/compilers/pge/03-optable.t
   branches/orderedhash_revamp/t/compilers/pge/04-compile.t
   branches/orderedhash_revamp/t/compilers/pge/06-grammar.t
   branches/orderedhash_revamp/t/compilers/pge/p5regex/p5rx.t
   branches/orderedhash_revamp/t/compilers/pge/perl6regex/01-regex.t
   branches/orderedhash_revamp/t/compilers/pge/perl6regex/context.t
   branches/orderedhash_revamp/t/compilers/pge/perl6regex/rx_quantifiers
   branches/orderedhash_revamp/t/compilers/pge/pge-hs.t
   branches/orderedhash_revamp/t/compilers/pge/pge.t
   branches/orderedhash_revamp/t/compilers/pge/pge_examples.t
   branches/orderedhash_revamp/t/compilers/pge/pge_globs.t
   branches/orderedhash_revamp/t/compilers/pge/pge_text.t
   branches/orderedhash_revamp/t/compilers/pge/pge_util.t
   branches/orderedhash_revamp/t/compilers/tge/basic.t
   branches/orderedhash_revamp/t/compilers/tge/grammar.t
   branches/orderedhash_revamp/t/compilers/tge/parser.t
   branches/orderedhash_revamp/t/configure/008-file_based_configuration.t
   branches/orderedhash_revamp/t/configure/033-step.t
   branches/orderedhash_revamp/t/configure/testlib/Make_VERSION_File.pm
   branches/orderedhash_revamp/t/configure/testlib/init/alpha.pm
   branches/orderedhash_revamp/t/configure/testlib/init/beta.pm
   branches/orderedhash_revamp/t/configure/testlib/init/delta.pm
   branches/orderedhash_revamp/t/configure/testlib/init/epsilon.pm
   branches/orderedhash_revamp/t/configure/testlib/init/foobar.pm
   branches/orderedhash_revamp/t/configure/testlib/init/gamma.pm
   branches/orderedhash_revamp/t/configure/testlib/init/iota.pm
   branches/orderedhash_revamp/t/configure/testlib/init/kappa.pm
   branches/orderedhash_revamp/t/configure/testlib/init/lambda.pm
   branches/orderedhash_revamp/t/configure/testlib/init/mu.pm
   branches/orderedhash_revamp/t/configure/testlib/init/zeta.pm
   branches/orderedhash_revamp/t/configure/testlib/inter/theta.pm
   branches/orderedhash_revamp/t/dynpmc/dynlexpad.t
   branches/orderedhash_revamp/t/dynpmc/foo.t
   branches/orderedhash_revamp/t/dynpmc/subproxy.t
   branches/orderedhash_revamp/t/examples/pir.t
   branches/orderedhash_revamp/t/examples/pod.t
   branches/orderedhash_revamp/t/examples/shootout.t
   branches/orderedhash_revamp/t/examples/subs.t
   branches/orderedhash_revamp/t/harness
   branches/orderedhash_revamp/t/library/getopt_obj.t
   branches/orderedhash_revamp/t/library/md5.t
   branches/orderedhash_revamp/t/library/mime_base64.t
   branches/orderedhash_revamp/t/library/mt19937ar.t
   branches/orderedhash_revamp/t/library/p6object.t
   branches/orderedhash_revamp/t/library/parrotlib.t
   branches/orderedhash_revamp/t/library/pcre.t
   branches/orderedhash_revamp/t/library/protoobject.t
   branches/orderedhash_revamp/t/library/rand.t
   branches/orderedhash_revamp/t/library/string_utils.t
   branches/orderedhash_revamp/t/library/tcl_glob.t
   branches/orderedhash_revamp/t/library/tcl_lib.t
   branches/orderedhash_revamp/t/library/test_more.t
   branches/orderedhash_revamp/t/library/uuid.t
   branches/orderedhash_revamp/t/native_pbc/annotations.pbc
   branches/orderedhash_revamp/t/native_pbc/integer_1.pbc
   branches/orderedhash_revamp/t/native_pbc/number_1.pbc
   branches/orderedhash_revamp/t/native_pbc/number_2.pbc
   branches/orderedhash_revamp/t/native_pbc/string_1.pbc
   branches/orderedhash_revamp/t/oo/metamodel.t
   branches/orderedhash_revamp/t/op/00ff-dos.t
   branches/orderedhash_revamp/t/op/00ff-unix.t
   branches/orderedhash_revamp/t/op/01-parse_ops.t
   branches/orderedhash_revamp/t/op/64bit.t
   branches/orderedhash_revamp/t/op/annotate.t
   branches/orderedhash_revamp/t/op/arithmetics.t
   branches/orderedhash_revamp/t/op/arithmetics_pmc.t
   branches/orderedhash_revamp/t/op/basic.t
   branches/orderedhash_revamp/t/op/bitwise.t
   branches/orderedhash_revamp/t/op/box.t
   branches/orderedhash_revamp/t/op/calling.t
   branches/orderedhash_revamp/t/op/cc_params.t
   branches/orderedhash_revamp/t/op/cc_state.t
   branches/orderedhash_revamp/t/op/cmp-nonbranch.t
   branches/orderedhash_revamp/t/op/comp.t
   branches/orderedhash_revamp/t/op/debuginfo.t
   branches/orderedhash_revamp/t/op/exceptions.t
   branches/orderedhash_revamp/t/op/gc.t
   branches/orderedhash_revamp/t/op/interp.t
   branches/orderedhash_revamp/t/op/io.t
   branches/orderedhash_revamp/t/op/jit.t
   branches/orderedhash_revamp/t/op/lexicals.t
   branches/orderedhash_revamp/t/op/literal.t
   branches/orderedhash_revamp/t/op/number.t
   branches/orderedhash_revamp/t/op/pushaction.t
   branches/orderedhash_revamp/t/op/say.t
   branches/orderedhash_revamp/t/op/spawnw.t
   branches/orderedhash_revamp/t/op/sprintf.t
   branches/orderedhash_revamp/t/op/sprintf2.t
   branches/orderedhash_revamp/t/op/string.t
   branches/orderedhash_revamp/t/op/string_cs.t
   branches/orderedhash_revamp/t/op/stringu.t
   branches/orderedhash_revamp/t/op/sysinfo.t
   branches/orderedhash_revamp/t/op/time.t
   branches/orderedhash_revamp/t/op/trans.t
   branches/orderedhash_revamp/t/perl/Parrot_Distribution.t
   branches/orderedhash_revamp/t/perl/Parrot_Test.t
   branches/orderedhash_revamp/t/pharness/01-default_tests.t
   branches/orderedhash_revamp/t/pmc/array.t
   branches/orderedhash_revamp/t/pmc/arrayiterator.t
   branches/orderedhash_revamp/t/pmc/bigint.t
   branches/orderedhash_revamp/t/pmc/boolean.t
   branches/orderedhash_revamp/t/pmc/capture.t
   branches/orderedhash_revamp/t/pmc/class.t
   branches/orderedhash_revamp/t/pmc/codestring.t
   branches/orderedhash_revamp/t/pmc/complex.t
   branches/orderedhash_revamp/t/pmc/coroutine.t
   branches/orderedhash_revamp/t/pmc/default.t
   branches/orderedhash_revamp/t/pmc/env.t
   branches/orderedhash_revamp/t/pmc/eval.t
   branches/orderedhash_revamp/t/pmc/exception.t
   branches/orderedhash_revamp/t/pmc/exceptionhandler.t
   branches/orderedhash_revamp/t/pmc/exporter.t
   branches/orderedhash_revamp/t/pmc/filehandle.t
   branches/orderedhash_revamp/t/pmc/fixedbooleanarray.t
   branches/orderedhash_revamp/t/pmc/fixedfloatarray.t
   branches/orderedhash_revamp/t/pmc/fixedintegerarray.t
   branches/orderedhash_revamp/t/pmc/fixedpmcarray.t
   branches/orderedhash_revamp/t/pmc/fixedstringarray.t
   branches/orderedhash_revamp/t/pmc/float.t
   branches/orderedhash_revamp/t/pmc/freeze.t
   branches/orderedhash_revamp/t/pmc/hash.t
   branches/orderedhash_revamp/t/pmc/hashiterator.t
   branches/orderedhash_revamp/t/pmc/hashiteratorkey.t
   branches/orderedhash_revamp/t/pmc/integer.t
   branches/orderedhash_revamp/t/pmc/io.t
   branches/orderedhash_revamp/t/pmc/io_iterator.t
   branches/orderedhash_revamp/t/pmc/iterator.t
   branches/orderedhash_revamp/t/pmc/key.t
   branches/orderedhash_revamp/t/pmc/lexpad.t
   branches/orderedhash_revamp/t/pmc/multidispatch.t
   branches/orderedhash_revamp/t/pmc/multisub.t
   branches/orderedhash_revamp/t/pmc/namespace.t
   branches/orderedhash_revamp/t/pmc/nci.t
   branches/orderedhash_revamp/t/pmc/null.t
   branches/orderedhash_revamp/t/pmc/object-meths.t
   branches/orderedhash_revamp/t/pmc/object-mro.t
   branches/orderedhash_revamp/t/pmc/objects.t
   branches/orderedhash_revamp/t/pmc/orderedhash.t
   branches/orderedhash_revamp/t/pmc/packfile.t
   branches/orderedhash_revamp/t/pmc/packfileannotation.t
   branches/orderedhash_revamp/t/pmc/packfileannotations.t
   branches/orderedhash_revamp/t/pmc/packfileconstanttable.t
   branches/orderedhash_revamp/t/pmc/packfiledirectory.t
   branches/orderedhash_revamp/t/pmc/packfilefixupentry.t
   branches/orderedhash_revamp/t/pmc/packfilefixuptable.t
   branches/orderedhash_revamp/t/pmc/packfilerawsegment.t
   branches/orderedhash_revamp/t/pmc/packfilesegment.t
   branches/orderedhash_revamp/t/pmc/parrotinterpreter.t
   branches/orderedhash_revamp/t/pmc/parrotio.t
   branches/orderedhash_revamp/t/pmc/parrotobject.t
   branches/orderedhash_revamp/t/pmc/pccmethod_test.t
   branches/orderedhash_revamp/t/pmc/pmc.t
   branches/orderedhash_revamp/t/pmc/pmcproxy.t
   branches/orderedhash_revamp/t/pmc/resizablebooleanarray.t
   branches/orderedhash_revamp/t/pmc/resizablefloatarray.t
   branches/orderedhash_revamp/t/pmc/resizableintegerarray.t
   branches/orderedhash_revamp/t/pmc/resizablepmcarray.t
   branches/orderedhash_revamp/t/pmc/resizablestringarray.t
   branches/orderedhash_revamp/t/pmc/ro.t
   branches/orderedhash_revamp/t/pmc/string.t
   branches/orderedhash_revamp/t/pmc/stringhandle.t
   branches/orderedhash_revamp/t/pmc/stringiterator.t
   branches/orderedhash_revamp/t/pmc/sub.t
   branches/orderedhash_revamp/t/pmc/threads.t
   branches/orderedhash_revamp/t/pmc/timer.t
   branches/orderedhash_revamp/t/pmc/undef.t
   branches/orderedhash_revamp/t/run/options.t
   branches/orderedhash_revamp/t/src/extend.t
   branches/orderedhash_revamp/t/src/warnings.t
   branches/orderedhash_revamp/t/steps/auto/alignptrs-01.t
   branches/orderedhash_revamp/t/steps/auto/alignptrs-02.t
   branches/orderedhash_revamp/t/steps/auto/arch-01.t
   branches/orderedhash_revamp/t/steps/auto/attributes-01.t
   branches/orderedhash_revamp/t/steps/auto/backtrace-01.t
   branches/orderedhash_revamp/t/steps/auto/byteorder-01.t
   branches/orderedhash_revamp/t/steps/auto/cgoto-01.t
   branches/orderedhash_revamp/t/steps/auto/cpu-01.t
   branches/orderedhash_revamp/t/steps/auto/crypto-01.t
   branches/orderedhash_revamp/t/steps/auto/ctags-01.t
   branches/orderedhash_revamp/t/steps/auto/env-01.t
   branches/orderedhash_revamp/t/steps/auto/format-01.t
   branches/orderedhash_revamp/t/steps/auto/gc-01.t
   branches/orderedhash_revamp/t/steps/auto/gcc-01.t
   branches/orderedhash_revamp/t/steps/auto/gdbm-01.t
   branches/orderedhash_revamp/t/steps/auto/gettext-01.t
   branches/orderedhash_revamp/t/steps/auto/glibc-01.t
   branches/orderedhash_revamp/t/steps/auto/gmp-01.t
   branches/orderedhash_revamp/t/steps/auto/headers-01.t
   branches/orderedhash_revamp/t/steps/auto/inline-01.t
   branches/orderedhash_revamp/t/steps/auto/isreg-01.t
   branches/orderedhash_revamp/t/steps/auto/jit-01.t
   branches/orderedhash_revamp/t/steps/auto/memalign-01.t
   branches/orderedhash_revamp/t/steps/auto/msvc-01.t
   branches/orderedhash_revamp/t/steps/auto/neg_0-01.t
   branches/orderedhash_revamp/t/steps/auto/opengl-01.t
   branches/orderedhash_revamp/t/steps/auto/ops-01.t
   branches/orderedhash_revamp/t/steps/auto/pcre-01.t
   branches/orderedhash_revamp/t/steps/auto/perldoc-01.t
   branches/orderedhash_revamp/t/steps/auto/pmc-01.t
   branches/orderedhash_revamp/t/steps/auto/pod2man-01.t
   branches/orderedhash_revamp/t/steps/auto/readline-01.t
   branches/orderedhash_revamp/t/steps/auto/readline-02.t
   branches/orderedhash_revamp/t/steps/auto/revision-01.t
   branches/orderedhash_revamp/t/steps/auto/signal-01.t
   branches/orderedhash_revamp/t/steps/auto/sizes-01.t
   branches/orderedhash_revamp/t/steps/auto/snprintf-01.t
   branches/orderedhash_revamp/t/steps/auto/socklen_t-01.t
   branches/orderedhash_revamp/t/steps/auto/thread-01.t
   branches/orderedhash_revamp/t/steps/auto/va_ptr-01.t
   branches/orderedhash_revamp/t/steps/auto/warnings-01.t
   branches/orderedhash_revamp/t/steps/gen/call_list-01.t
   branches/orderedhash_revamp/t/steps/gen/config_h-01.t
   branches/orderedhash_revamp/t/steps/gen/config_pm-01.t
   branches/orderedhash_revamp/t/steps/gen/core_pmcs-01.t
   branches/orderedhash_revamp/t/steps/gen/crypto-01.t
   branches/orderedhash_revamp/t/steps/gen/makefiles-01.t
   branches/orderedhash_revamp/t/steps/gen/opengl-01.t
   branches/orderedhash_revamp/t/steps/gen/parrot_include-01.t
   branches/orderedhash_revamp/t/steps/gen/platform-01.t
   branches/orderedhash_revamp/t/steps/init/headers-01.t
   branches/orderedhash_revamp/t/steps/init/hints-01.t
   branches/orderedhash_revamp/t/steps/init/hints/darwin-01.t
   branches/orderedhash_revamp/t/steps/init/optimize-01.t
   branches/orderedhash_revamp/t/steps/inter/charset-01.t
   branches/orderedhash_revamp/t/steps/inter/encoding-01.t
   branches/orderedhash_revamp/t/steps/inter/lex-01.t
   branches/orderedhash_revamp/t/steps/inter/lex-02.t
   branches/orderedhash_revamp/t/steps/inter/lex-03.t
   branches/orderedhash_revamp/t/steps/inter/libparrot-01.t
   branches/orderedhash_revamp/t/steps/inter/make-01.t
   branches/orderedhash_revamp/t/steps/inter/progs-01.t
   branches/orderedhash_revamp/t/steps/inter/progs-02.t
   branches/orderedhash_revamp/t/steps/inter/progs-03.t
   branches/orderedhash_revamp/t/steps/inter/progs-04.t
   branches/orderedhash_revamp/t/steps/inter/shlibs-01.t
   branches/orderedhash_revamp/t/steps/inter/types-01.t
   branches/orderedhash_revamp/t/steps/inter/yacc-01.t
   branches/orderedhash_revamp/t/steps/inter/yacc-02.t
   branches/orderedhash_revamp/t/tools/dev/searchops/samples.pm
   branches/orderedhash_revamp/t/tools/dump_pbc.t
   branches/orderedhash_revamp/t/tools/install/01-create_directories.t
   branches/orderedhash_revamp/t/tools/install/02-install_files.t
   branches/orderedhash_revamp/t/tools/install/03-lines_to_files.t
   branches/orderedhash_revamp/t/tools/install/dev_overall.t
   branches/orderedhash_revamp/t/tools/install/overall.t
   branches/orderedhash_revamp/t/tools/ops2cutils/testlib/GenerateCore.pm
   branches/orderedhash_revamp/t/tools/ops2pm/04-prepare_ops.t
   branches/orderedhash_revamp/t/tools/ops2pm/08-sort_ops.t
   branches/orderedhash_revamp/t/tools/ops2pm/samples/core_ops.original
   branches/orderedhash_revamp/t/tools/ops2pm/samples/pic_ops.original
   branches/orderedhash_revamp/t/tools/parrot_debugger.t
   branches/orderedhash_revamp/t/tools/pmc2cutils/05-gen_c.t
   branches/orderedhash_revamp/t/tools/pmc2cutils/08-pmc-pm.t
   branches/orderedhash_revamp/tools/build/c2str.pl
   branches/orderedhash_revamp/tools/build/headerizer.pl
   branches/orderedhash_revamp/tools/build/nativecall.pl
   branches/orderedhash_revamp/tools/build/pmc2c.pl
   branches/orderedhash_revamp/tools/dev/bench_op.pir
   branches/orderedhash_revamp/tools/dev/branch_status.pl
   branches/orderedhash_revamp/tools/dev/create_language.pl
   branches/orderedhash_revamp/tools/dev/debian_docs.sh
   branches/orderedhash_revamp/tools/dev/fetch_languages.pl
   branches/orderedhash_revamp/tools/dev/gen_makefile.pl
   branches/orderedhash_revamp/tools/dev/install_dev_files.pl
   branches/orderedhash_revamp/tools/dev/install_files.pl
   branches/orderedhash_revamp/tools/dev/list_unjitted.pl
   branches/orderedhash_revamp/tools/dev/mk_inno.pl
   branches/orderedhash_revamp/tools/dev/mk_inno_language.pl
   branches/orderedhash_revamp/tools/dev/mk_language_shell.pl
   branches/orderedhash_revamp/tools/dev/mk_manifest_and_skip.pl
   branches/orderedhash_revamp/tools/dev/mk_native_pbc
   branches/orderedhash_revamp/tools/dev/ops_not_tested.pl
   branches/orderedhash_revamp/tools/dev/parrot-fuzzer
   branches/orderedhash_revamp/tools/dev/parrot.supp
   branches/orderedhash_revamp/tools/dev/pbc_header.pl
   branches/orderedhash_revamp/tools/dev/pbc_to_exe.pir
   branches/orderedhash_revamp/tools/dev/pmcrenumber.pl
   branches/orderedhash_revamp/tools/dev/search-ops.pl
   branches/orderedhash_revamp/tools/dev/vtablize.pl
   branches/orderedhash_revamp/tools/install/smoke.pl
   branches/orderedhash_revamp/tools/install/smoke_languages.pl
   branches/orderedhash_revamp/tools/util/ncidef2pasm.pl
   branches/orderedhash_revamp/tools/util/perlcritic.conf
   branches/orderedhash_revamp/tools/util/pgegrep
   branches/orderedhash_revamp/tools/util/release.json
   branches/orderedhash_revamp/tools/util/templates.json
   branches/orderedhash_revamp/tools/util/update_copyright.pl

Modified: branches/orderedhash_revamp/CREDITS
==============================================================================
--- branches/orderedhash_revamp/CREDITS	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/CREDITS	Sat Jan 23 01:49:53 2010	(r43541)
@@ -92,7 +92,7 @@
 N: Andrew Whitworth
 D: Internals development
 D: Documentation
-D: Release manager for 0.8.2 and 1.3.0
+D: Release manager for 0.8.2, 1.3.0 and 1.5.0
 E: wknight8111 at gmail.com
 U: Whiteknight
 
@@ -149,18 +149,21 @@
 
 N: Bernhard Schmalhofer
 U: bernhard
-D: Bugfixes
 D: Eclectus, Scheme on Parrot
 D: Parrot m4
 D: Pipp, PHP on Parrot
 D: HQ9plus
-D: Release manager for Parrot 0.6.0 and Parrot 0.6.4
-D: Tests for languages/lisp
+D: Release manager for Parrot 0.6.0, Parrot 0.6.4, and Parrot 1.8.0
 E: Bernhard.Schmalhofer at gmx.de
 
 N: Bob Diertens
 D: patch regarding macro argument expansion
 
+N: Bob Kuo
+D: Convert some perl tests to PIR
+E: bobjkuo at gmail.com
+U: bubaflub
+
 N: Bob Rogers
 D: Random small bug fixes, including one for the linguine bug.
 E: rogers-perl6 at rgrjr.dyndns.org
@@ -192,6 +195,11 @@
 N: Brian Wheeler
 E: bdwheele at indiana.edu
 
+U: brianwisti
+N: Brian Wisti
+E: brian.wisti at gmail.com
+D: PIR Test demonstrating that $I1 and $I01 are different variables
+
 N: Bruce Gray
 U: util
 E: bruce.gray at acm.org
@@ -237,6 +245,7 @@
 D: Patch for key flags in pdd08
 D: Range check in Env PMC
 A: christoph_googleacct at mksig.org
+A: christop... at mksig.org
 D: Pipp
 E: christoph at mksig.org
 
@@ -304,7 +313,7 @@
 U: darbelo
 A: arbelo
 D: OpenBSD fixes and testing, gsoc2009-decnum-dynpmcs
-E: dany.arbelo at gmail.com
+E: arbelo at gmail.com
 
 N: Dave Woldrich
 D: Win32 build fixes
@@ -383,6 +392,7 @@
 
 N: Gerd Pokorra
 E: pokorra at uni-siegen.de
+D: Release manager for 1.9.0
 
 N: Goplat
 D: Win98 and other fixes.
@@ -480,6 +490,10 @@
 D: Whatever
 S: Seattle, WA
 
+N: Jesse Taylor
+U: jrtayloriv
+E: jrtayloriv at gmail.com
+
 N: Jesse Vincent
 U: jesse
 E: jesse at fsck.com
@@ -496,6 +510,15 @@
 N: John Paul Wallington
 D: pir-mode.el: fix for xemacs plus bugfixes and cleanups
 
+N: Jonathan Leto
+E: jonathan at leto.net
+W: http://leto.net
+D: Release manager for 1.7.0
+U: dukeleto
+A: leto
+A: Duke Leto
+S: Portland, OR
+
 N: Jonathan Scott Duff
 U: duff
 E: duff at pobox.com
@@ -667,6 +690,11 @@
 E: Michael.Cartmell at thomson.com
 D: README.win32 spelling patch
 
+N: Michael H. Hind
+U: mikehh
+D: codingstd patches
+E: mike.hind at gmail.com
+
 N: Michael G. Schwern
 
 N: Michael Scott
@@ -677,9 +705,6 @@
 U: mikescott
 W: http://xrl.us/sml
 
-U: mikehh
-D: codingstd patches
-
 N: Michael Stevens
 D: Remove an unused variable in C-land
 
@@ -774,6 +799,10 @@
 E: peter at emkel.co.za
 D: String subsystem
 
+N: Peter Lobsinger
+U: plobsing
+E: plobsing at gmail.com
+
 N: Philip Taylor
 D: Win32 ICC support
 
@@ -845,6 +874,11 @@
 N: Sam Vilain
 D: Prototype object model and tests
 
+N: Samuel Harrington
+E: samuel.harrington at mines.sdsmt.edu
+U: samlh
+D: css patch
+
 N: Sean O'Rourke
 E: educated_foo at yahoo.com
 U: educated_foo
@@ -922,6 +956,11 @@
 U: thgibbs
 E: thgibbs at deltafarms.com
 
+N: Ted Reed
+U: treed
+E: ted.reed at gmail.com
+D: cardinal
+
 N: Thilo Planz
 D: partcl tests and inspiration
 

Modified: branches/orderedhash_revamp/ChangeLog
==============================================================================
--- branches/orderedhash_revamp/ChangeLog	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/ChangeLog	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,12 +1,36 @@
 #1 $Id$
 
+2009.12.15     Gerd
+	* Released 1.9.0
+	See NEWS for more.
+
+2009.11.17     barney
+	* Released 1.8.0
+	See NEWS for more.
+
+2009.10.20     dukeleto
+	* Released 1.7.0
+	See NEWS for more.
+
+2009.9.15     particle
+	* Released 1.6.0
+	See NEWS for more.
+
+2009.8.18     Whiteknight
+	* Released 1.5.0
+	See NEWS for more.
+
+2009.7.21     cotto
+	* Released 1.4.0
+	See NEWS for more.
+
 2009.06.16    Whiteknight
-        * Released 1.3.0
-        Ses NEWS for more.
+	* Released 1.3.0
+	See NEWS for more.
 
 2009.05.19    Infinoid
-        * Released 1.2.0
-        See NEWS for more.
+	* Released 1.2.0
+	See NEWS for more.
 
 2009.04.21    fperrad
 	* Released 1.1.0

Modified: branches/orderedhash_revamp/Configure.pl
==============================================================================
--- branches/orderedhash_revamp/Configure.pl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/Configure.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -196,6 +196,25 @@
 
 =back
 
+=item C<--configure_trace>
+
+Store the results of each configuration step in a Storable F<.sto> file on
+disk, for later analysis by F<Parrot::Configure::Trace> methods.
+
+=item Operating system-specific configuration options
+
+=over 4
+
+=item C<--darwin_no_fink>
+
+On Darwin, do not probe for Fink libraries.
+
+=item C<--darwin_no_macports>
+
+On Darwin, do not probe for Macports libraries.
+
+=back
+
 =back
 
 =head2 Compile Options
@@ -213,8 +232,8 @@
 =item C<--m=32>
 
 Create a 32-bit executable on 64-architectures like x86_64. This
-option appends -m32 to compiler and linker programs and does
-s/lib64/lib/g on link flags.
+option appends C<-m32> to compiler and linker programs and does
+C<s/lib64/lib/g> on link flags.
 
 This option is experimental. See F<config/init/defaults.pm> for more.
 
@@ -228,7 +247,7 @@
 
 =item C<--optimize>
 
-Add perl5's $Config{optimize} to the compiler flags.
+Add Perl 5's C<$Config{optimize}> to the compiler flags.
 
 =item C<--optimize=flags>
 
@@ -332,14 +351,13 @@
 
 Use JIT system.
 
-=item C<--execcapable>
+=item C<--buildframes>
 
-Use JIT to emit a native executable.
+Dynamically build NCI call frames.
 
-=item C<--gc=(type)>
+=item C<--execcapable>
 
-Determine the type of garbage collection. The value for C<type> should be one
-of: C<gc>, C<libc>, C<malloc> or C<malloc-trace>. The default is C<gc>.
+Use JIT to emit a native executable.
 
 =back
 
@@ -603,8 +621,8 @@
     auto::isreg
     auto::arch
     auto::jit
+    auto::frames
     auto::cpu
-    auto::funcptr
     auto::cgoto
     auto::inline
     auto::gc
@@ -638,11 +656,11 @@
 
 You may see how this works in practice by calling:
 
-    perl Configure.pl --file=xconf/samples/yourfoobar
+    perl Configure.pl --file=examples/config/file/configcompiler
 
 or
 
-    perl Configure.pl --file=xconf/samples/testfoobar
+    perl Configure.pl --file=examples/config/file/configwithfatalstep
 
 =head1 SEE ALSO
 

Modified: branches/orderedhash_revamp/DEPRECATED.pod
==============================================================================
--- branches/orderedhash_revamp/DEPRECATED.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/DEPRECATED.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -33,31 +33,10 @@
  .include 'warnings.pasm'
  warningson .PARROT_WARNINGS_DEPRECATED_FLAG
 
-=head1 Configuration
-
-=over 4
-
-=item Alternate GC configurations [eligible in 1.5]
-
-C<malloc>, C<malloc-trace> and C<libc> will be removed as potential
-options for the C<--gc> config option.
-
-L<https://trac.parrot.org/parrot/ticket/490>
-
-=back
-
 =head1 PMCS
 
 =over 4
 
-=item pair (dynamic PMC) [eligible in 1.5]
-
-L<https://trac.parrot.org/parrot/ticket/187>
-
-=item random [eligible in 1.1]
-
-L<https://trac.parrot.org/parrot/ticket/189>
-
 =item moved to dynpmc [eligible in 1.1]
 
 AddrRegistry, CodeString, Env, Eval, File, OS, PCCMETHOD_Test, StringHandle,
@@ -79,20 +58,74 @@
 
 L<https://trac.parrot.org/parrot/ticket/264>
 
-=back
+=item various VTABLE functions [eligible in 1.5]
 
-=head1 Opcodes
+The get_bigint, set_bigint_*, pow, i_pow and nextkey_keyed VTABLE functions are
+deprecated and will be removed.
 
-=over 4
+L<https://trac.parrot.org/parrot/ticket/866>
+
+=item Use of undocumented variables in class_init [eligible in 2.1]
+
+The current implementation allows the class_init vtable function body to
+use local symbols from the generated part. For example, some PMC used
+to use the pass counter. In the future, the class_init body from the PMC
+file may not be inserted directly in the body of the generated one,
+so this usage will not be allowed.
+
+L<https://trac.parrot.org/parrot/ticket/918>
+
+=item The visit_info structure and associated VTABLEs. [eligible in 2.1]
+
+The current freeze/thaw implementation makes heavy use of the visit_info
+structure and the VTABLE interface attached to it. This structure will
+be replaced with a PMC of equivalent functionality and with a possibly
+similar interface. The freeze, thaw, and visit vtables of all PMCs should be
+updated to the provided interim API before this change is made.
+
+L<https://trac.parrot.org/parrot/ticket/1305>
+
+=item Overriding vtable invoke in PIR objects [experimental]
+
+The VTABLE invoke in object.pmc puts SELF at the start of the
+signature call arguments when there is no current object and is
+not already here. This allows the usage of $P0() instead of $P0($P0).
+
+L<https://trac.parrot.org/parrot/ticket/103>
 
-=item ops file format [eligible in 1.5]
+=item All bitwise VTABLE functions [eligible in 2.1]
 
-The ops file format has some cruft in the form of the "VERSION =
-PARROT_VERSION;" line and is hard to parse when several ops files are
-concatenated together.   This item covers the removal of the VERSION line and
-an improved syntax for ops preambles.
+All bitwise VTABLE functions (all VTABLE functions containing C<bitwise> in
+their names) will be removed.  Equivalent functionality will by supplied by
+bitwise dynops.
 
-L<https://trac.parrot.org/parrot/ticket/836>
+L<https://trac.parrot.org/parrot/ticket/1260>
+
+=item Array PMC [eligible in 2.1]
+
+This PMC is old, ill-used and is superseded by other array-like PMCs.  Any code
+using this PMC should migrate to ResizablePMCArray or something more suitable.
+
+L<https://trac.parrot.org/parrot/ticket/1303>
+
+=item OrderedHash PMC [eligible in 2.1]
+
+This PMC is old, haskish and will be reimplemented with some backward incompatible
+changes in semantic of handling removed elements.
+
+L<https://trac.parrot.org/parrot/ticket/1403>
+
+=item CPointer PMC [eligible in 2.1]
+
+And all uses in the Parrot calling conventions.
+
+L<https://trac.parrot.org/parrot/ticket/1407>
+
+=back
+
+=head1 Opcodes
+
+=over 4
 
 =item moved to dynop [eligible in 1.1]
 
@@ -101,10 +134,6 @@
 
 L<https://trac.parrot.org/parrot/ticket/449>
 
-=item experimental ops [eligible in 1.1]
-
-F<src/ops/experimental.ops> - only the C<trap> opcode remains
-
 =item get_addr and set_addr [eligible in 1.5]
 
 L<https://trac.parrot.org/parrot/ticket/218>
@@ -114,13 +143,32 @@
 for Sub, Exception, and related PMC types will instead be handled by
 get_label and set_label.
 
-=item C<bsr>, C<jsr>, and C<ret> [eligible in 1.5]
+=item All bitwise ops [eligible in 2.1]
+
+All bitwise ops (all ops containing C<bitwise> in their names) will be provided
+by dynops.  B<NOTE>: Before removing the bitwise ops, make sure that the
+equivalent dynops are available and that the major HLLs (Rakudo, Partcl, Lua,
+etc) have switched to using them.
+
+L<https://trac.parrot.org/parrot/ticket/1260>
+
+=item get_results opcode order and features [eligible in 2.1]
+
+Move get_results to follow invoke.
+
+L<https://trac.parrot.org/parrot/ticket/1405>
+
+get_results no longer used to fetch exception object.
 
-L<https://trac.parrot.org/parrot/ticket/702>
+L<https://trac.parrot.org/parrot/ticket/1406>
 
-=item C<branch_cs> [eligible in 1.5]
+=item dlfunc signatures [eligible in 2.1]
 
-L<https://trac.parrot.org/parrot/ticket/470>
+C<xv>-style signatures will no longer work. See PDD16 for details.
+
+F<pdds/draft/pdd16_native_call.pod>
+
+L<https://trac.parrot.org/parrot/ticket/1410>
 
 =back
 
@@ -144,9 +192,11 @@
 
 =head1 Class Features
 
-=over 4
+[Nothing at this time.]
 
-=back
+=head1 Debugger
+
+Assigning to registers [experimental]
 
 =head1 PIR syntax
 
@@ -154,23 +204,9 @@
 
 =item Assignment syntax with opcodes [eligible in 1.1]
 
-When the first argument of an opcode is C<OUT>, then
-the assignment syntax will be allowed, as it is today.
-
-In any other case (i.e. C<INOUT>, C<IN>), this will become
-a syntax error. For example:
+L<https://trac.parrot.org/parrot/ticket/906>
 
-    $S0 = print
-    $P0 = substr 1, 2, "x"
-
-Will have to be:
-
-    print $S0
-    substr $P0, 1, 2, "x"
-
-L<http://rt.perl.org/rt3/Ticket/Display.html?id=36283>
-
-=item named class/pmc lookup in pir syntax such as new, isa, subclass, 
+=item named class/pmc lookup in pir syntax such as new, isa, subclass,
     get_class, etc [eligible in 1.1]
 
 Class PMC name resolution will be the following.
@@ -182,7 +218,7 @@
   Relative to the current HLL Namespace
 
 if the arg is a Namespace or Class PMC
-  The passed in class or the class attatched to the passed in namespace.
+  The passed in class or the class attached to the passed in namespace.
 
 L<https://trac.parrot.org/parrot/ticket/159>
 
@@ -191,6 +227,14 @@
 
 L<https://trac.parrot.org/parrot/ticket/511>
 
+=item continuation-based ExceptionHandlers [eligible in 2.1]
+
+L<https://trac.parrot.org/parrot/ticket/1091>
+
+=item implicit optional named parameters [eligible in 2.1]
+
+L<https://trac.parrot.org/parrot/ticket/1103>
+
 =back
 
 =head1 Functions
@@ -199,15 +243,7 @@
 
 =item mmd_cvt_to_types [eligible in 1.1]
 
-L<http://rt.perl.org/rt3/Ticket/Display.html?id=60626>
-
-=item src/pic.c and src/pic_jit.c [eligible in 1.1]
-
-These two files were a thin prototype implementation of Polymorphic Inline
-Caching that only ever applied to 4 opcodes, one of which has now been removed.
-The files (and all functions in them) are deprecated, and will be removed.
-
-L<http://rt.perl.org/rt3/Ticket/Display.html?id=60048>
+L<https://trac.parrot.org/parrot/ticket/907>
 
 =item Subs marked with C<:vtable>/C<:method> aren't in namespace [eligible in 1.1]
 
@@ -215,7 +251,7 @@
 namespace entry by default.  Use the C<:nsentry> flag to cause this
 to happen.
 
-L<http://rt.perl.org/rt3/Ticket/Display.html?id=53302>
+L<https://trac.parrot.org/parrot/ticket/389>
 
 =item C API coding standards cleanup [eligible in 1.1]
 
@@ -226,64 +262,60 @@
 
 L<https://trac.parrot.org/parrot/ticket/443>
 
-=item parrot_new_pmc_hash [eligible in 1.5]
+=item Sub/method invocation functions [eligible in 2.1]
+
+The old 'Parrot_call_*' functions for invoking a sub/method object from C are
+deprecated, replaced by 'Parrot_ext_call'.
 
-This function will be removed.  parrot_new_hash should be used in its place.
+L<https://trac.parrot.org/parrot/ticket/1145>
 
-L<https://trac.parrot.org/parrot/ticket/494>
+=item PMC Attributes Allocation Functions [experimental]
 
-=item Parrot_get_namespace_autobase [eligible in 1.5]
+ Parrot_gc_allocate_pmc_attributes
+ Parrot_gc_free_pmc_attributes
 
-L<https://trac.parrot.org/parrot/ticket/155>
+These items and related helper functions are added as experimental support
+for TT #895
 
-=item Parrot_find_global_k [eligible in 1.5]
+=item PDB_compile and PDB_eval [eligible in 2.1]
 
-L<https://trac.parrot.org/parrot/ticket/156>
+The function PDB_compile doesn't work since some time, and his implementation
+was a hack. His functionality may be reimplemented in another way. Until the
+end of deprecation cycle it just throws an exception.
 
-=item Parrot_MMD_method_name [eligible in 1.5]
+The PDB_eval function, that used in the debugger to support the eval
+command, was using PDB_compile. His functionality must be reimplemented
+in another way and with a name that follows current conventions, in the
+meantime and until the end of the deprecation cycle it just shows a
+diagnostic message.
 
-L<https://trac.parrot.org/parrot/ticket/625>
+L<https://trac.parrot.org/parrot/ticket/872>
 
-=item pobject_lives [eligible in 1.5]
+=item Parrot_oo_get_namespace [eligible in 2.1]
 
-L<https://trac.parrot.org/parrot/ticket/664>
+L<https://trac.parrot.org/parrot/ticket/1069>
 
-=item functions in src/stack.c [eligible in 1.5]
+=item STRING Out parameters in Parrot_str_* functions [eligible in 2.1]
 
-L<https://trac.parrot.org/parrot/ticket/702>
-Here is a list of functions in this file which are currently being exported:
+All STRING modification functions will return a STRING pointer; capture and use
+this rather than relying on in-place modification of an existing pointer.
 
-  stack_system_init
-  cst_new_stack_chunk
-  new_stack
-  mark_stack
-  stack_height
-  stack_entry
-  stack_prepare_push
-  stack_push
-  stack_prepare_pop
-  stack_pop
-  pop_dest
-  stack_peep
-  Parrot_dump_dynamic_environment
-  Parrot_push_action*
-  Parrot_push_mark*
-  Parrot_pop_mark*
+=back
+
+=head1 Compiler tools
 
-* = item may be kept but reimplemented.
+=head2 PASM1 compiler
 
-=item Parrot_str_free [eligible in 1.5]
+=over 4
 
-L<https://trac.parrot.org/parrot/ticket/826>
+=item C<PASM1 compiler> [eligible in 2.1]
 
-This function was an attempt of optimization, but is error prone. Let the
-garbage collector take care.
+See PDB_compile. Note that the current version of the C<PASM1> compiler
+issues a warning and is not functional. (However, it used to segfault.)
 
 =back
 
-=head1 Compiler tools
-
-=head2 Parrot Grammar Engine
+=head2 Parrot Grammar Engine (PGE)
 
 =over 4
 
@@ -303,7 +335,7 @@
 
 =item PCT::HLLCompiler stages [eligible in 1.1]
 
-The interface of various methods for adding, removing, and modifying 
+The interface of various methods for adding, removing, and modifying
 the list stages in a PCT::HLLCompiler object is subject to change.
 The existing actual stages will remain; only the mechanism for specifying
 the order of individual stages is likely to change.
@@ -313,7 +345,7 @@
 =item PCT::HLLCompiler from Perl 5's Test::Harness [eligible in 1.1]
 
 In order to facilitate using PCT::HLLCompiler with test harnesses,
-the C<command_line> method of PCT::HLLCompiler object exits silently 
+the C<command_line> method of PCT::HLLCompiler object exits silently
 if it detects that it is being run in a sample run from Perl's
 Test::Harness.  Currently this detection is done by checking the
 second command line argument for "@INC"; future releases may
@@ -321,6 +353,14 @@
 
 L<https://trac.parrot.org/parrot/ticket/463>
 
+=item PAST::Val node generation [eligible in 1.5]
+
+The PAST::Compiler may generate the code for PAST::Val nodes
+(i.e., constants) at the beginning of the block (Parrot sub) instead
+of the location where they occur in the PAST tree.
+
+L<https://trac.parrot.org/parrot/ticket/868>
+
 =back
 
 =head2 Not Quite Perl (NQP)
@@ -330,7 +370,7 @@
 =item C< $(...) > syntax  [eligible in 1.5]
 
 The C< $(...) > syntax for obtaining a result object from a Match
-object will no longer work.  The new syntax is to invoke the 
+object will no longer work.  The new syntax is to invoke the
 C<.ast> method on the Match object.
 
 L<https://trac.parrot.org/parrot/ticket/459>
@@ -338,7 +378,7 @@
 =item Quoted items [eligible in 1.5]
 
 Double-quoted strings will interpret unescaped $-names
-as interpolated variables in the string.  Bare slashes 
+as interpolated variables in the string.  Bare slashes
 will introduce regular expressions.  The C<< <foo bar> >>
 syntax will produce an array of strings instead of a single
 string.
@@ -353,12 +393,8 @@
 
 L<https://trac.parrot.org/parrot/ticket/842>
 
-=cut
-
 =back
 
-=cut
-
 =head1 build tools
 
 =over 4
@@ -371,41 +407,38 @@
 
 =back
 
-=head1 pmc2c syntax
-
-=over 4
-
-=item "pmclass" with name not matching file's basename [eligible in 1.5]
-
-When foo.pmc contains a the line "pmclass bar", pmc2c generates a pmc_foo.h
-but tries to include pmc_bar.h.  This is a bug, but it's possible someone out
-there is using it.  This usage will result in a warning for now; after
-the 1.4 release, this warning will be upgraded to an error.
-
-L<https://trac.parrot.org/parrot/ticket/665>
-
-=back
-
 =head1 Parrot library
 
 =over 4
 
-=item Data::Replace [eligible in 1.5]
+=item MT19937 [eligible in 2.1]
 
-L<https://trac.parrot.org/parrot/ticket/108>
+L<https://trac.parrot.org/parrot/ticket/1278> - latest version now hosted
+at L<http://github.com/fperrad/parrot-MT19937>. After 2.0, users will have
+to install via C<plumage>.
 
 =item JSON, JSON, and Config;JSON [eligible in 1.5]
 
 L<https://trac.parrot.org/parrot/ticket/508>
 
-=item NCI::call_toolkit_init [eligible in 1.5]
-
-L<https://trac.parrot.org/parrot/ticket/753>
-
 =item Cross-HLL library loading [experimental]
 
 L<https://trac.parrot.org/parrot/ticket/754>
 
+=item OpenGL bindings and libraries [experimental]
+
+L<https://trac.parrot.org/parrot/ticket/852>
+
+=item Library name changes [eligible in 2.1]
+
+The use of C<::> a namespace separator is deprecated.  Core libraries will
+change to use multi-level keys instead.  For example, C<Getopt::Obj> will
+change to C<Getopt; Obj>.  Affected libraries include C<Data::Dumper>,
+C<Getopt::Obj>, C<Parrot::Coroutine>, C<SDL>, C<Test::Builder>,
+C<YAML::Dumper>, and C<PCRE::NCI>.
+
+As well, anything under F<examples/> is subject to this change.
+
 =back
 
 =head1 Footnotes
@@ -416,8 +449,6 @@
 
 L<Trac|http://trac.parrot.org/> is parrot's primary issue tracking system.
 
-Older tickets may be listed at L<RT|https://rt.perl.org/rt3>.
-
 =item 2
 
 For an item to be considered experimental, it can B<never> have shipped in

Modified: branches/orderedhash_revamp/MANIFEST
==============================================================================
--- branches/orderedhash_revamp/MANIFEST	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/MANIFEST	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,18 +1,18 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Fri Jul 17 06:05:46 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Wed Jan 13 12:09:32 2010 UT
 #
 # See below for documentation on the format of this file.
 #
 # See docs/submissions.pod on how to recreate this file after SVN
 # has been told about new or deleted files.
-CREDITS                                                     []
+CREDITS                                                     [main]doc
 ChangeLog                                                   []
 Configure.pl                                                []
-DEPRECATED.pod                                              []
+DEPRECATED.pod                                              [devel]doc
 DEVELOPING                                                  []
-DONORS.pod                                                  []
+DONORS.pod                                                  [main]doc
 LICENSE                                                     [main]doc
 MANIFEST                                                    []
 MANIFEST.SKIP                                               []
@@ -23,11 +23,14 @@
 PBC_COMPAT                                                  [main]doc
 PLATFORMS                                                   [devel]doc
 README                                                      [devel]doc
-README_cygwin.pod                                           []
-README_win32.pod                                            []
+README_cygwin.pod                                           [devel]doc
+README_win32.pod                                            [devel]doc
 RESPONSIBLE_PARTIES                                         [main]doc
-TODO                                                        []
+TODO                                                        [devel]doc
 VERSION                                                     [devel]
+compilers/data_json/data_json.pir                           [data_json]
+compilers/data_json/data_json/grammar.pg                    [data_json]
+compilers/data_json/data_json/pge2pir.tg                    [data_json]
 compilers/imcc/cfg.c                                        [imcc]
 compilers/imcc/cfg.h                                        [imcc]
 compilers/imcc/debug.c                                      [imcc]
@@ -115,6 +118,7 @@
 compilers/nqp/t/27-ternary.t                                [test]
 compilers/nqp/t/28-return.t                                 [test]
 compilers/nqp/t/29-self.t                                   [test]
+compilers/nqp/t/30-subclass.t                               [test]
 compilers/nqp/t/harness                                     [test]
 compilers/pct/PCT.pir                                       [pct]
 compilers/pct/README.pod                                    []doc
@@ -210,12 +214,7 @@
 config/auto/cgoto.pm                                        []
 config/auto/cgoto/test_c.in                                 []
 config/auto/cpu.pm                                          []
-config/auto/cpu/i386/Makefile                               []
 config/auto/cpu/i386/auto.pm                                []
-config/auto/cpu/i386/memcpy_mmx.c                           []
-config/auto/cpu/i386/memcpy_mmx_in.c                        []
-config/auto/cpu/i386/memcpy_sse.c                           []
-config/auto/cpu/i386/memcpy_sse_in.c                        []
 config/auto/cpu/i386/test_gcc_cmpxchg_c.in                  []
 config/auto/cpu/ppc/auto.pm                                 []
 config/auto/cpu/ppc/test_gcc_cmpset_c.in                    []
@@ -228,10 +227,11 @@
 config/auto/env.pm                                          []
 config/auto/env/test_setenv_c.in                            []
 config/auto/env/test_unsetenv_c.in                          []
-config/auto/fink.pm                                         []
 config/auto/format.pm                                       []
-config/auto/funcptr.pm                                      []
-config/auto/funcptr/test_c.in                               []
+config/auto/frames.pm                                       []
+config/auto/frames/test_exec_cygwin_c.in                    []
+config/auto/frames/test_exec_linux_c.in                     []
+config/auto/frames/test_exec_openbsd_c.in                   []
 config/auto/gc.pm                                           []
 config/auto/gc/test_c.in                                    []
 config/auto/gcc.pm                                          []
@@ -253,11 +253,6 @@
 config/auto/isreg.pm                                        []
 config/auto/isreg/test_c.in                                 []
 config/auto/jit.pm                                          []
-config/auto/jit/test_c.in                                   []
-config/auto/jit/test_exec_cygwin_c.in                       []
-config/auto/jit/test_exec_linux_c.in                        []
-config/auto/jit/test_exec_openbsd_c.in                      []
-config/auto/macports.pm                                     []
 config/auto/memalign.pm                                     []
 config/auto/memalign/test2_c.in                             []
 config/auto/memalign/test_c.in                              []
@@ -312,6 +307,7 @@
 config/gen/crypto/digest_t.in                               []
 config/gen/makefiles.pm                                     []
 config/gen/makefiles/CFLAGS.in                              []
+config/gen/makefiles/data_json.in                           []
 config/gen/makefiles/docs.in                                []
 config/gen/makefiles/dynoplibs.in                           []
 config/gen/makefiles/dynoplibs_pl.in                        []
@@ -320,6 +316,7 @@
 config/gen/makefiles/editor.in                              []
 config/gen/makefiles/ext.in                                 []
 config/gen/makefiles/json.in                                []
+config/gen/makefiles/nqp-rx.in                              []
 config/gen/makefiles/nqp.in                                 []
 config/gen/makefiles/parrot_embed_pl.in                     []
 config/gen/makefiles/parrot_pc.in                           []
@@ -338,11 +335,13 @@
 config/gen/platform/ansi/time.c                             []
 config/gen/platform/cygwin/math.c                           []
 config/gen/platform/darwin/begin.c                          []
+config/gen/platform/darwin/hires_timer.c                    []
 config/gen/platform/darwin/memalign.c                       []
 config/gen/platform/generic/dl.c                            []
 config/gen/platform/generic/dl.h                            []
 config/gen/platform/generic/env.c                           []
 config/gen/platform/generic/exec.c                          []
+config/gen/platform/generic/hires_timer.c                   []
 config/gen/platform/generic/io.h                            []
 config/gen/platform/generic/itimer.c                        []
 config/gen/platform/generic/math.c                          []
@@ -370,6 +369,7 @@
 config/gen/platform/win32/dl.c                              []
 config/gen/platform/win32/env.c                             []
 config/gen/platform/win32/exec.c                            []
+config/gen/platform/win32/hires_timer.c                     []
 config/gen/platform/win32/io.h                              []
 config/gen/platform/win32/misc.c                            []
 config/gen/platform/win32/misc.h                            []
@@ -412,7 +412,7 @@
 config/inter/shlibs.pm                                      []
 config/inter/types.pm                                       []
 config/inter/yacc.pm                                        []
-docs/book/draft/README                                      []doc
+docs/book/draft/README                                      []
 docs/book/draft/appa_glossary.pod                           []
 docs/book/draft/appb_patch_submission.pod                   []
 docs/book/draft/appc_command_line_options.pod               []
@@ -420,9 +420,6 @@
 docs/book/draft/appe_source_code.pod                        []
 docs/book/draft/ch01_introduction.pod                       []
 docs/book/draft/ch02_getting_started.pod                    []
-docs/book/draft/ch04_compiler_tools.pod                     []
-docs/book/draft/ch05_pge.pod                                []
-docs/book/draft/ch06_nqp.pod                                []
 docs/book/draft/ch07_dynpmcs.pod                            []
 docs/book/draft/ch08_dynops.pod                             []
 docs/book/draft/ch10_opcode_reference.pod                   []
@@ -431,117 +428,121 @@
 docs/book/draft/chXX_hlls.pod                               []
 docs/book/draft/chXX_library.pod                            []
 docs/book/draft/chXX_testing_and_debugging.pod              []
-docs/book/pir/ch01_introduction.pod                         []
-docs/book/pir/ch02_getting_started.pod                      []
-docs/book/pir/ch03_basic_syntax.pod                         []
-docs/book/pir/ch04_variables.pod                            []
-docs/book/pir/ch05_control_structures.pod                   []
-docs/book/pir/ch06_subroutines.pod                          []
-docs/book/pir/ch07_objects.pod                              []
-docs/book/pir/ch08_io.pod                                   []
-docs/book/pir/ch09_exceptions.pod                           []
-docs/compiler_faq.pod                                       [devel]doc
-docs/configuration.pod                                      []
-docs/debug.pod                                              [devel]doc
-docs/debugger.pod                                           []
-docs/dev/byteorder.pod                                      []
-docs/dev/c_functions.pod                                    []
-docs/dev/debugging_with_msvc.pod                            []
-docs/dev/events.pod                                         []
-docs/dev/headerizer.pod                                     []
-docs/dev/infant.pod                                         []
-docs/dev/jit_i386.pod                                       []
-docs/dev/longopt.pod                                        []
-docs/dev/optimizer.pod                                      []
-docs/dev/parrot_api.pod                                     []
-docs/dev/pcc_state.pod                                      []
-docs/dev/pccmethods.pod                                     []
-docs/dev/pmc_freeze.pod                                     []
-docs/dev/pmc_obj_design_meeting_notes.pod                   []
-docs/embed.pod                                              []
-docs/extend.pod                                             []
-docs/faq.pod                                                [main]doc
-docs/gettingstarted.pod                                     [main]doc
-docs/glossary.pod                                           [main]doc
-docs/imcc/README                                            []doc
-docs/imcc/imcfaq.pod                                        []
-docs/imcc/operation.pod                                     []
-docs/intro.pod                                              [main]doc
-docs/jit.pod                                                []
-docs/memory_internals.pod                                   []
-docs/multidispatch.pod                                      []
-docs/native_exec.pod                                        []
-docs/optable.pod                                            []
-docs/overview.pod                                           []
-docs/parrot.pod                                             []
-docs/parrotbyte.pod                                         []
-docs/parrothist.pod                                         []
-docs/pct/gettingstarted.pod                                 [pct]doc
-docs/pct/past_building_blocks.pod                           [pct]doc
-docs/pct/pct_optable_guide.pod                              [pct]doc
-docs/pdds/draft/pdd01_overview.pod                          []
-docs/pdds/draft/pdd05_opfunc.pod                            []
-docs/pdds/draft/pdd06_pasm.pod                              []
-docs/pdds/draft/pdd08_keys.pod                              []
-docs/pdds/draft/pdd10_embedding.pod                         []
-docs/pdds/draft/pdd11_extending.pod                         []
-docs/pdds/draft/pdd14_numbers.pod                           []
-docs/pdds/draft/pdd16_native_call.pod                       []
-docs/pdds/draft/pdd29_compiler_tools.pod                    []
-docs/pdds/draft/pdd31_hll_interop.pod                       []
-docs/pdds/pdd00_pdd.pod                                     []
-docs/pdds/pdd03_calling_conventions.pod                     []
-docs/pdds/pdd07_codingstd.pod                               []
-docs/pdds/pdd09_gc.pod                                      []
-docs/pdds/pdd13_bytecode.pod                                []
-docs/pdds/pdd15_object_metamodel.png                        []
-docs/pdds/pdd15_object_metamodel.svg                        []
-docs/pdds/pdd15_objects.pod                                 []
-docs/pdds/pdd17_pmc.pod                                     []
-docs/pdds/pdd18_security.pod                                []
-docs/pdds/pdd19_pir.pod                                     []
-docs/pdds/pdd20_lexical_vars.pod                            []
-docs/pdds/pdd21_namespaces.pod                              []
-docs/pdds/pdd22_io.pod                                      []
-docs/pdds/pdd23_exceptions.pod                              []
-docs/pdds/pdd24_events.pod                                  []
-docs/pdds/pdd25_concurrency.pod                             []
-docs/pdds/pdd26_ast.pod                                     []
-docs/pdds/pdd27_multiple_dispatch.pod                       []
-docs/pdds/pdd28_strings.pod                                 []
-docs/pdds/pdd30_install.pod                                 []
-docs/pdds/pdd_template.pod                                  []
-docs/pmc.pod                                                []
-docs/pmc/array.pod                                          [main]doc
-docs/pmc/documentation.pod                                  [main]doc
-docs/pmc/struct.pod                                         [main]doc
-docs/pmc/subs.pod                                           [main]doc
-docs/pmc2c.pod                                              [devel]doc
-docs/porting_intro.pod                                      []
-docs/project/branching_guide.pod                            [devel]doc
-docs/project/cage_cleaners_guide.pod                        [devel]doc
-docs/project/committer_guide.pod                            [devel]doc
-docs/project/debian_packaging_guide.pod                     [devel]doc
-docs/project/metacommitter_guide.pod                        [devel]doc
-docs/project/release_manager_guide.pod                      [devel]doc
-docs/project/roles_responsibilities.pod                     [devel]doc
-docs/project/support_policy.pod                             [devel]doc
-docs/project/ticket_triaging.pod                            [devel]doc
-docs/project/ubuntu_packaging_guide.pod                     [devel]doc
-docs/req/model_users.pod                                    []
-docs/resources/favicon.ico                                  []
-docs/resources/parrot.css                                   []
-docs/resources/parrot_logo.png                              []
-docs/resources/up.gif                                       []
-docs/running.pod                                            []
-docs/stability.pod                                          []
-docs/submissions.pod                                        []
-docs/tests.pod                                              []
-docs/user/pir/exceptions.pod                                [main]doc
-docs/user/pir/intro.pod                                     [main]doc
-docs/user/pir/objects.pod                                   [main]doc
-docs/user/pir/pmcs.pod                                      [main]doc
-docs/vtables.pod                                            [devel]doc
+docs/book/pct/ch01_introduction.pod                         [doc]
+docs/book/pct/ch02_getting_started.pod                      [doc]
+docs/book/pct/ch03_compiler_tools.pod                       [doc]
+docs/book/pct/ch04_pge.pod                                  [doc]
+docs/book/pct/ch05_nqp.pod                                  [doc]
+docs/book/pir/ch01_introduction.pod                         [doc]
+docs/book/pir/ch02_getting_started.pod                      [doc]
+docs/book/pir/ch03_basic_syntax.pod                         [doc]
+docs/book/pir/ch04_variables.pod                            [doc]
+docs/book/pir/ch05_control_structures.pod                   [doc]
+docs/book/pir/ch06_subroutines.pod                          [doc]
+docs/book/pir/ch07_objects.pod                              [doc]
+docs/book/pir/ch08_io.pod                                   [doc]
+docs/book/pir/ch09_exceptions.pod                           [doc]
+docs/compiler_faq.pod                                       [doc]
+docs/configuration.pod                                      [doc]
+docs/debug.pod                                              [doc]
+docs/debugger.pod                                           [doc]
+docs/dev/byteorder.pod                                      [doc]
+docs/dev/c_functions.pod                                    [doc]
+docs/dev/debugging_with_msvc.pod                            [doc]
+docs/dev/events.pod                                         [doc]
+docs/dev/headerizer.pod                                     [doc]
+docs/dev/infant.pod                                         [doc]
+docs/dev/longopt.pod                                        [doc]
+docs/dev/optimizer.pod                                      [doc]
+docs/dev/parrot_api.pod                                     [doc]
+docs/dev/pcc_state.pod                                      [doc]
+docs/dev/pccmethods.pod                                     [doc]
+docs/dev/pmc_freeze.pod                                     [doc]
+docs/dev/pmc_obj_design_meeting_notes.pod                   [doc]
+docs/dev/profiling.pod                                      [doc]
+docs/embed.pod                                              [doc]
+docs/extend.pod                                             [doc]
+docs/faq.pod                                                [doc]
+docs/gettingstarted.pod                                     [doc]
+docs/glossary.pod                                           [doc]
+docs/imcc/README                                            [doc]
+docs/imcc/imcfaq.pod                                        [doc]
+docs/imcc/operation.pod                                     [doc]
+docs/intro.pod                                              [doc]
+docs/memory_internals.pod                                   [doc]
+docs/multidispatch.pod                                      [doc]
+docs/optable.pod                                            [doc]
+docs/overview.pod                                           [doc]
+docs/parrot.pod                                             [doc]
+docs/parrotbyte.pod                                         [doc]
+docs/parrothist.pod                                         [doc]
+docs/pct/gettingstarted.pod                                 [doc]
+docs/pct/past_building_blocks.pod                           [doc]
+docs/pct/pct_optable_guide.pod                              [doc]
+docs/pdds/draft/pdd01_overview.pod                          [doc]
+docs/pdds/draft/pdd05_opfunc.pod                            [doc]
+docs/pdds/draft/pdd06_pasm.pod                              [doc]
+docs/pdds/draft/pdd08_keys.pod                              [doc]
+docs/pdds/draft/pdd10_embedding.pod                         [doc]
+docs/pdds/draft/pdd11_extending.pod                         [doc]
+docs/pdds/draft/pdd14_numbers.pod                           [doc]
+docs/pdds/draft/pdd16_native_call.pod                       [doc]
+docs/pdds/draft/pdd29_compiler_tools.pod                    [doc]
+docs/pdds/draft/pdd31_hll.pod                               [doc]
+docs/pdds/draft/pdd31_hll_interop.pod                       [doc]
+docs/pdds/pdd00_pdd.pod                                     [doc]
+docs/pdds/pdd03_calling_conventions.pod                     [doc]
+docs/pdds/pdd07_codingstd.pod                               [doc]
+docs/pdds/pdd09_gc.pod                                      [doc]
+docs/pdds/pdd13_bytecode.pod                                [doc]
+docs/pdds/pdd15_object_metamodel.png                        [doc]
+docs/pdds/pdd15_object_metamodel.svg                        [doc]
+docs/pdds/pdd15_objects.pod                                 [doc]
+docs/pdds/pdd17_pmc.pod                                     [doc]
+docs/pdds/pdd18_security.pod                                [doc]
+docs/pdds/pdd19_pir.pod                                     [doc]
+docs/pdds/pdd20_lexical_vars.pod                            [doc]
+docs/pdds/pdd21_namespaces.pod                              [doc]
+docs/pdds/pdd22_io.pod                                      [doc]
+docs/pdds/pdd23_exceptions.pod                              [doc]
+docs/pdds/pdd24_events.pod                                  [doc]
+docs/pdds/pdd25_concurrency.pod                             [doc]
+docs/pdds/pdd26_ast.pod                                     [doc]
+docs/pdds/pdd27_multiple_dispatch.pod                       [doc]
+docs/pdds/pdd28_strings.pod                                 [doc]
+docs/pdds/pdd30_install.pod                                 [doc]
+docs/pdds/pdd_template.pod                                  [doc]
+docs/pmc.pod                                                [doc]
+docs/pmc/array.pod                                          [doc]
+docs/pmc/documentation.pod                                  [doc]
+docs/pmc/struct.pod                                         [doc]
+docs/pmc/subs.pod                                           [doc]
+docs/pmc2c.pod                                              [doc]
+docs/porting_intro.pod                                      [doc]
+docs/project/branching_guide.pod                            [doc]
+docs/project/cage_cleaners_guide.pod                        [doc]
+docs/project/committer_guide.pod                            [doc]
+docs/project/debian_packaging_guide.pod                     [doc]
+docs/project/metacommitter_guide.pod                        [doc]
+docs/project/release_manager_guide.pod                      [doc]
+docs/project/roles_responsibilities.pod                     [doc]
+docs/project/support_policy.pod                             [doc]
+docs/project/ticket_triaging.pod                            [doc]
+docs/project/ubuntu_packaging_guide.pod                     [doc]
+docs/req/model_users.pod                                    [doc]
+docs/resources/favicon.ico                                  [doc]
+docs/resources/parrot.css                                   [doc]
+docs/resources/parrot_logo.png                              [doc]
+docs/resources/up.gif                                       [doc]
+docs/running.pod                                            [doc]
+docs/stability.pod                                          [doc]
+docs/submissions.pod                                        [doc]
+docs/tests.pod                                              [doc]
+docs/user/pir/exceptions.pod                                [doc]
+docs/user/pir/intro.pod                                     [doc]
+docs/user/pir/objects.pod                                   [doc]
+docs/user/pir/pmcs.pod                                      [doc]
+docs/vtables.pod                                            [doc]
 editor/README.pod                                           []doc
 editor/filetype_parrot.vim                                  []
 editor/indent_pir.vim                                       []
@@ -555,7 +556,7 @@
 editor/pmc.vim                                              []
 editor/skeleton.pir                                         []
 editor/subversion_config                                    []
-examples/README                                             []doc
+examples/README                                             [examples]
 examples/benchmarks/addit.pasm                              [examples]
 examples/benchmarks/addit.pir                               [examples]
 examples/benchmarks/addit.pl                                [examples]
@@ -567,6 +568,7 @@
 examples/benchmarks/arriter.rb                              [examples]
 examples/benchmarks/arriter_o1.pir                          [examples]
 examples/benchmarks/bench_newp.pasm                         [examples]
+examples/benchmarks/fib.cs                                  [examples]
 examples/benchmarks/fib.pir                                 [examples]
 examples/benchmarks/fib.pl                                  [examples]
 examples/benchmarks/fib.py                                  [examples]
@@ -582,18 +584,20 @@
 examples/benchmarks/gc_waves_headers.pasm                   [examples]
 examples/benchmarks/gc_waves_sizeable_data.pasm             [examples]
 examples/benchmarks/gc_waves_sizeable_headers.pasm          [examples]
+examples/benchmarks/hamming.pir                             [examples]
+examples/benchmarks/hello.pir                               [examples]
 examples/benchmarks/mops.pasm                               [examples]
 examples/benchmarks/mops.pl                                 [examples]
 examples/benchmarks/mops_intval.pasm                        [examples]
-examples/benchmarks/oo1.pasm                                [examples]
+examples/benchmarks/oo1.pir                                 [examples]
 examples/benchmarks/oo1.pl                                  [examples]
 examples/benchmarks/oo1.py                                  [examples]
 examples/benchmarks/oo1.rb                                  [examples]
-examples/benchmarks/oo2.pasm                                [examples]
+examples/benchmarks/oo2.pir                                 [examples]
 examples/benchmarks/oo2.pl                                  [examples]
 examples/benchmarks/oo2.py                                  [examples]
 examples/benchmarks/oo2.rb                                  [examples]
-examples/benchmarks/oo3.pasm                                [examples]
+examples/benchmarks/oo3.pir                                 [examples]
 examples/benchmarks/oo3.pl                                  [examples]
 examples/benchmarks/oo3.py                                  [examples]
 examples/benchmarks/oo3.rb                                  [examples]
@@ -626,6 +630,7 @@
 examples/benchmarks/primes2.rb                              [examples]
 examples/benchmarks/primes2_i.pir                           [examples]
 examples/benchmarks/primes_i.pasm                           [examples]
+examples/benchmarks/rand.pir                                [examples]
 examples/benchmarks/stress.pasm                             [examples]
 examples/benchmarks/stress.pl                               [examples]
 examples/benchmarks/stress.rb                               [examples]
@@ -640,41 +645,39 @@
 examples/benchmarks/vpm.py                                  [examples]
 examples/benchmarks/vpm.rb                                  [examples]
 examples/c/nanoparrot.c                                     [examples]
+examples/c/pbc_info.c                                       [examples]
 examples/c/test_main.c                                      [examples]
 examples/compilers/Makefile                                 [examples]
 examples/compilers/japhc.c                                  [examples]
+examples/config/file/configcompiler                         [examples]
+examples/config/file/configwithfatalstep                    [examples]
 examples/embed/Makefile                                     [examples]
 examples/embed/Makefile.msvc                                [examples]
-examples/embed/lorito.c                                     [examples]
+examples/embed/cotorra.c                                    [examples]
 examples/io/http.pir                                        [examples]
 examples/io/httpd.pir                                       [examples]
-examples/japh/README                                        []doc
+examples/japh/README                                        [examples]
 examples/japh/japh1.pasm                                    [examples]
 examples/japh/japh3.pasm                                    [examples]
 examples/japh/japh4.pasm                                    [examples]
 examples/japh/japh5.pasm                                    [examples]
 examples/json/postalcodes.pir                               [examples]
 examples/json/test.pir                                      [examples]
-examples/languages/abc/Configure.pl                         [examples]
 examples/languages/abc/MAINTAINER                           [examples]
-examples/languages/abc/README                               []doc
+examples/languages/abc/README                               [examples]
 examples/languages/abc/TODO                                 [examples]
 examples/languages/abc/abc.pir                              [examples]
-examples/languages/abc/config/makefiles/root.in             [examples]
+examples/languages/abc/setup.pir                            [examples]
 examples/languages/abc/src/builtins/all.pir                 [examples]
-examples/languages/abc/src/parser/actions.pm                [examples]
-examples/languages/abc/src/parser/grammar-oper.pg           [examples]
-examples/languages/abc/src/parser/grammar.pg                [examples]
+examples/languages/abc/src/parser/actions.nqp               [examples]
+examples/languages/abc/src/parser/grammar.nqp               [examples]
 examples/languages/abc/t/01-tests.t                         [examples]
 examples/languages/abc/t/abc_basic                          [examples]
 examples/languages/abc/t/abc_functions                      [examples]
 examples/languages/abc/t/abc_special_variables              [examples]
 examples/languages/abc/t/abc_statement                      [examples]
-examples/languages/abc/t/harness                            [examples]
-examples/languages/squaak/Configure.pl                      [examples]
 examples/languages/squaak/MAINTAINER                        [examples]
-examples/languages/squaak/README                            []doc
-examples/languages/squaak/config/makefiles/root.in          [examples]
+examples/languages/squaak/README                            [examples]
 examples/languages/squaak/doc/tutorial_episode_1.pod        [examples]
 examples/languages/squaak/doc/tutorial_episode_2.pod        [examples]
 examples/languages/squaak/doc/tutorial_episode_3.pod        [examples]
@@ -686,19 +689,19 @@
 examples/languages/squaak/doc/tutorial_episode_9.pod        [examples]
 examples/languages/squaak/examples/factorial.sq             [examples]
 examples/languages/squaak/examples/life.sq                  [examples]
+examples/languages/squaak/setup.pir                         [examples]
 examples/languages/squaak/squaak.pir                        [examples]
 examples/languages/squaak/src/builtins/say.pir              [examples]
 examples/languages/squaak/src/parser/actions.pm             [examples]
 examples/languages/squaak/src/parser/grammar.pg             [examples]
 examples/languages/squaak/t/00-sanity.t                     [examples]
 examples/languages/squaak/t/01-math.t                       [examples]
-examples/languages/squaak/t/harness                         [examples]
 examples/library/acorn.life                                 [examples]
 examples/library/getopt_demo.pir                            [examples]
 examples/library/md5sum.pir                                 [examples]
 examples/library/ncurses_life.pir                           [examples]
 examples/library/pcre.pir                                   [examples]
-examples/mops/README                                        []doc
+examples/mops/README                                        [examples]
 examples/mops/mops.c                                        [examples]
 examples/mops/mops.cs                                       [examples]
 examples/mops/mops.il                                       [examples]
@@ -709,15 +712,12 @@
 examples/mops/mops.rb                                       [examples]
 examples/mops/mops.scheme                                   [examples]
 examples/namespace/namespace_dump.pir                       [examples]
-examples/nci/Mysql.pir                                      [examples]
 examples/nci/PQt.cpp                                        [examples]
 examples/nci/QtHelloWorld.pasm                              [examples]
 examples/nci/QtHelloWorld.pir                               [examples]
 examples/nci/Xlib.pir                                       [examples]
 examples/nci/Xlibconstants.pir                              [examples]
 examples/nci/ls.pir                                         [examples]
-examples/nci/mysqltest.p6                                   [examples]
-examples/nci/mysqltest.pir                                  [examples]
 examples/nci/sdl_blue_rectangle.pir                         [examples]
 examples/nci/win32api.pir                                   [examples]
 examples/nci/xlibtest.nqp                                   [examples]
@@ -727,6 +727,7 @@
 examples/opengl/math.pir                                    [examples]
 examples/opengl/shapes.p6                                   [examples]
 examples/opengl/shapes.pir                                  [examples]
+examples/opengl/static-triangle-hll.pir                     [examples]
 examples/opengl/static-triangle.p6                          [examples]
 examples/opengl/static-triangle.pir                         [examples]
 examples/opengl/triangle.p6                                 [examples]
@@ -740,20 +741,18 @@
 examples/past/four_plus_one.pir                             [examples]
 examples/pge/demo.pir                                       [examples]
 examples/pir/befunge/Changes                                [examples]
-examples/pir/befunge/Configure.pl                           [examples]
 examples/pir/befunge/MAINTAINER                             [examples]
-examples/pir/befunge/README                                 []doc
+examples/pir/befunge/README                                 [examples]
 examples/pir/befunge/befunge.pir                            [examples]
-examples/pir/befunge/config/makefiles/root.in               [examples]
 examples/pir/befunge/debug.pir                              [examples]
 examples/pir/befunge/flow.pir                               [examples]
 examples/pir/befunge/io.pir                                 [examples]
 examples/pir/befunge/load.pir                               [examples]
 examples/pir/befunge/maths.pir                              [examples]
 examples/pir/befunge/pascserp.bef                           [examples]
+examples/pir/befunge/setup.pir                              [examples]
 examples/pir/befunge/stack.pir                              [examples]
 examples/pir/befunge/t/basic.t                              [examples]
-examples/pir/befunge/t/harness                              [examples]
 examples/pir/befunge/test.bef                               [examples]
 examples/pir/circle.pir                                     [examples]
 examples/pir/euclid.pir                                     [examples]
@@ -765,6 +764,7 @@
 examples/pir/levenshtein.pir                                [examples]
 examples/pir/life.pir                                       [examples]
 examples/pir/local_label.pir                                [examples]
+examples/pir/make_hello_pbc.pir                             [examples]
 examples/pir/mandel.pir                                     [examples]
 examples/pir/mysqltest.bas                                  [examples]
 examples/pir/perl6.bas                                      [examples]
@@ -783,7 +783,7 @@
 examples/sdl/bounce_parrot_logo.pir                         [examples]
 examples/sdl/lcd/clock.pir                                  [examples]
 examples/sdl/mandel.pir                                     [examples]
-examples/sdl/minesweeper/README                             []doc
+examples/sdl/minesweeper/README                             [examples]
 examples/sdl/minesweeper/eventhandler.pir                   [examples]
 examples/sdl/minesweeper/field.pir                          [examples]
 examples/sdl/minesweeper/mines.pir                          [examples]
@@ -793,7 +793,7 @@
 examples/sdl/move_parrot_logo.pir                           [examples]
 examples/sdl/parrot_small.png                               [examples]
 examples/sdl/raw_pixels.pir                                 [examples]
-examples/sdl/tetris/README                                  []doc
+examples/sdl/tetris/README                                  [examples]
 examples/sdl/tetris/app.pir                                 [examples]
 examples/sdl/tetris/block.pir                               [examples]
 examples/sdl/tetris/blockdata.pir                           [examples]
@@ -802,7 +802,7 @@
 examples/sdl/tetris/boarddata.pir                           [examples]
 examples/sdl/tetris/eventhandler.pir                        [examples]
 examples/sdl/tetris/tetris.pir                              [examples]
-examples/shootout/README                                    []doc
+examples/shootout/README                                    [examples]
 examples/shootout/ack.pir                                   [examples]
 examples/shootout/ack.pir_output                            [examples]
 examples/shootout/binarytrees.pir                           [examples]
@@ -864,20 +864,19 @@
 examples/streams/Writer.pir                                 [examples]
 examples/subs/bsr_ret.pasm                                  [examples]
 examples/subs/coroutine.pasm                                [examples]
-examples/subs/jsr_ret.pasm                                  [examples]
 examples/subs/multi_retvals.pir                             [examples]
 examples/subs/no_retval.pir                                 [examples]
 examples/subs/pasm_sub1.pasm                                [examples]
 examples/subs/single_retval.pir                             [examples]
 examples/tcl/tcltkdemo.pir                                  [examples]
-examples/tge/README                                         []doc
+examples/tge/README                                         [examples]
 examples/tge/branch/branch.g                                [examples]
 examples/tge/branch/lib/Branch.pir                          [examples]
 examples/tge/branch/lib/Leaf.pir                            [examples]
 examples/tge/branch/transform.pir                           [examples]
 examples/tools/Makefile                                     [examples]
 examples/tools/pbc_checker.cpp                              [examples]
-examples/tutorial/00_README.pod                             []doc
+examples/tutorial/00_README.pod                             [examples]
 examples/tutorial/01_temp_var.pir                           [examples]
 examples/tutorial/02_local_var.pir                          [examples]
 examples/tutorial/03_temp_var_basic_pmcs.pir                [examples]
@@ -937,6 +936,69 @@
 ext/SQLite3/gen_sqlite3.pl                                  []
 ext/SQLite3/t/test.p6                                       [test]
 ext/SQLite3/test.pir                                        []
+ext/nqp-rx/.gitignore                                       []
+ext/nqp-rx/CREDITS                                          []
+ext/nqp-rx/LICENSE                                          []
+ext/nqp-rx/README                                           []doc
+ext/nqp-rx/STATUS                                           []
+ext/nqp-rx/src/stage0/HLL-s0.pir                            []
+ext/nqp-rx/src/stage0/NQP-s0.pir                            []
+ext/nqp-rx/src/stage0/P6Regex-s0.pir                        []
+ext/nqp-rx/src/stage0/Regex-s0.pir                          []
+ext/nqp-rx/t/nqp/01-literals.t                              [test]
+ext/nqp-rx/t/nqp/02-if.t                                    [test]
+ext/nqp-rx/t/nqp/03-if-else.t                               [test]
+ext/nqp-rx/t/nqp/04-unless.t                                [test]
+ext/nqp-rx/t/nqp/05-comments.t                              [test]
+ext/nqp-rx/t/nqp/06-args-pos.t                              [test]
+ext/nqp-rx/t/nqp/07-boolean.t                               [test]
+ext/nqp-rx/t/nqp/08-blocks.t                                [test]
+ext/nqp-rx/t/nqp/09-var.t                                   [test]
+ext/nqp-rx/t/nqp/10-cmp.t                                   [test]
+ext/nqp-rx/t/nqp/11-sub.t                                   [test]
+ext/nqp-rx/t/nqp/12-logical.t                               [test]
+ext/nqp-rx/t/nqp/13-op.t                                    [test]
+ext/nqp-rx/t/nqp/14-while.t                                 [test]
+ext/nqp-rx/t/nqp/15-list.t                                  [test]
+ext/nqp-rx/t/nqp/16-ternary.t                               [test]
+ext/nqp-rx/t/nqp/17-positional.t                            [test]
+ext/nqp-rx/t/nqp/18-associative.t                           [test]
+ext/nqp-rx/t/nqp/19-inline.t                                [test]
+ext/nqp-rx/t/nqp/20-return.t                                [test]
+ext/nqp-rx/t/nqp/21-contextual.t                            [test]
+ext/nqp-rx/t/nqp/22-optional-args.t                         [test]
+ext/nqp-rx/t/nqp/23-named-args.t                            [test]
+ext/nqp-rx/t/nqp/24-module.t                                [test]
+ext/nqp-rx/t/nqp/25-class.t                                 [test]
+ext/nqp-rx/t/nqp/26-methodops.t                             [test]
+ext/nqp-rx/t/nqp/27-self.t                                  [test]
+ext/nqp-rx/t/nqp/28-subclass.t                              [test]
+ext/nqp-rx/t/nqp/29-make.t                                  [test]
+ext/nqp-rx/t/nqp/30-pirop.t                                 [test]
+ext/nqp-rx/t/nqp/31-grammar.t                               [test]
+ext/nqp-rx/t/nqp/32-protoregex.t                            [test]
+ext/nqp-rx/t/nqp/33-init.t                                  [test]
+ext/nqp-rx/t/nqp/34-rxcodeblock.t                           [test]
+ext/nqp-rx/t/nqp/35-prefix-sigil.t                          [test]
+ext/nqp-rx/t/nqp/36-callable.t                              [test]
+ext/nqp-rx/t/nqp/37-slurpy.t                                [test]
+ext/nqp-rx/t/nqp/38-quotes.t                                [test]
+ext/nqp-rx/t/nqp/39-pointy.t                                [test]
+ext/nqp-rx/t/nqp/40-lists.t                                 [test]
+ext/nqp-rx/t/nqp/41-flat.t                                  [test]
+ext/nqp-rx/t/nqp/42-cond-loop.t                             [test]
+ext/nqp-rx/t/p6regex/01-regex.t                             [test]
+ext/nqp-rx/t/p6regex/rx_backtrack                           [test]
+ext/nqp-rx/t/p6regex/rx_basic                               [test]
+ext/nqp-rx/t/p6regex/rx_captures                            [test]
+ext/nqp-rx/t/p6regex/rx_charclass                           [test]
+ext/nqp-rx/t/p6regex/rx_goal                                [test]
+ext/nqp-rx/t/p6regex/rx_lookarounds                         [test]
+ext/nqp-rx/t/p6regex/rx_metachars                           [test]
+ext/nqp-rx/t/p6regex/rx_modifiers                           [test]
+ext/nqp-rx/t/p6regex/rx_quantifiers                         [test]
+ext/nqp-rx/t/p6regex/rx_subrules                            [test]
+ext/nqp-rx/t/p6regex/rx_syntax                              [test]
 include/parrot/atomic.h                                     [main]include
 include/parrot/atomic/fallback.h                            [main]include
 include/parrot/atomic/gcc_pcc.h                             [main]include
@@ -947,6 +1009,7 @@
 include/parrot/cclass.h                                     [main]include
 include/parrot/charset.h                                    [main]include
 include/parrot/compiler.h                                   [main]include
+include/parrot/context.h                                    [main]include
 include/parrot/core_types.h                                 [main]include
 include/parrot/datatypes.h                                  [main]include
 include/parrot/debugger.h                                   [main]include
@@ -956,7 +1019,6 @@
 include/parrot/enums.h                                      [main]include
 include/parrot/events.h                                     [main]include
 include/parrot/exceptions.h                                 [main]include
-include/parrot/exec.h                                       [main]include
 include/parrot/exit.h                                       [main]include
 include/parrot/extend.h                                     [main]include
 include/parrot/gc_api.h                                     [main]include
@@ -984,18 +1046,15 @@
 include/parrot/oplib.h                                      [main]include
 include/parrot/packfile.h                                   [main]include
 include/parrot/parrot.h                                     [main]include
-include/parrot/pic.h                                        [main]include
 include/parrot/pmc.h                                        [main]include
 include/parrot/pmc_freeze.h                                 [main]include
 include/parrot/pobj.h                                       [main]include
-include/parrot/register.h                                   [main]include
 include/parrot/runcore_api.h                                [main]include
+include/parrot/runcore_profiling.h                          [main]include
 include/parrot/runcore_trace.h                              [main]include
 include/parrot/scheduler.h                                  [main]include
 include/parrot/scheduler_private.h                          [main]include
 include/parrot/settings.h                                   [main]include
-include/parrot/slice.h                                      [main]include
-include/parrot/stacks.h                                     [main]include
 include/parrot/stat.h                                       [main]include
 include/parrot/string.h                                     [main]include
 include/parrot/string_funcs.h                               [main]include
@@ -1007,6 +1066,7 @@
 include/parrot/tsq.h                                        [main]include
 include/parrot/vtables.h                                    [main]include
 include/parrot/warnings.h                                   [main]include
+include/pmc/dummy                                           [main]include
 lib/File/Which.pm                                           [devel]lib
 lib/IO/CaptureOutput.pm                                     []
 lib/Parrot/BuildUtil.pm                                     [devel]lib
@@ -1026,6 +1086,7 @@
 lib/Parrot/Configure/Step.pm                                [devel]lib
 lib/Parrot/Configure/Step/List.pm                           [devel]lib
 lib/Parrot/Configure/Step/Methods.pm                        [devel]lib
+lib/Parrot/Configure/Step/Test.pm                           [devel]lib
 lib/Parrot/Configure/Test.pm                                [devel]lib
 lib/Parrot/Configure/Trace.pm                               [devel]lib
 lib/Parrot/Configure/Utils.pm                               [devel]lib
@@ -1101,11 +1162,9 @@
 lib/Parrot/Revision.pm                                      [devel]lib
 lib/Parrot/SearchOps.pm                                     [devel]lib
 lib/Parrot/Test.pm                                          [devel]lib
-lib/Parrot/Test/Cardinal.pm                                 [devel]lib
 lib/Parrot/Test/Harness.pm                                  [devel]lib
 lib/Parrot/Test/PGE.pm                                      [devel]lib
 lib/Parrot/Test/PIR_PGE.pm                                  [devel]lib
-lib/Parrot/Test/Perl6.pm                                    [devel]lib
 lib/Parrot/Test/Pod.pm                                      [devel]lib
 lib/Parrot/Test/Pod/Utils.pm                                [devel]lib
 lib/Parrot/Test/Util.pm                                     [devel]lib
@@ -1155,12 +1214,12 @@
 runtime/parrot/languages/parrot/parrot.pir                  [library]
 runtime/parrot/library/CGI/QueryHash.pir                    [library]
 runtime/parrot/library/Config/JSON.pir                      [library]
+runtime/parrot/library/Configure/genfile.pir                [library]
 runtime/parrot/library/Crow.pir                             [library]
 runtime/parrot/library/Curses.pir                           [library]
 runtime/parrot/library/Data/Dumper.pir                      [library]
 runtime/parrot/library/Data/Dumper/Base.pir                 [library]
 runtime/parrot/library/Data/Dumper/Default.pir              [library]
-runtime/parrot/library/Data/Replace.pir                     [library]
 runtime/parrot/library/Digest/MD5.pir                       [library]
 runtime/parrot/library/Getopt/Obj.pir                       [library]
 runtime/parrot/library/HTTP/Daemon.pir                      [library]
@@ -1170,7 +1229,6 @@
 runtime/parrot/library/Math/Rand.pir                        [library]
 runtime/parrot/library/Math/Random/mt19937ar.pir            [library]
 runtime/parrot/library/NCI/Utils.pir                        [library]
-runtime/parrot/library/NCI/call_toolkit_init.pir            [library]
 runtime/parrot/library/OpenGL.pir                           [library]
 runtime/parrot/library/OpenGL/Math.pir                      [library]
 runtime/parrot/library/P6object.pir                         [library]
@@ -1201,6 +1259,7 @@
 runtime/parrot/library/SDL/Sprite.pir                       [library]
 runtime/parrot/library/SDL/StopWatch.pir                    [library]
 runtime/parrot/library/SDL/Surface.pir                      [library]
+runtime/parrot/library/SQLite3.pir                          [library]
 runtime/parrot/library/Stream/Base.pir                      [library]
 runtime/parrot/library/Stream/Combiner.pir                  [library]
 runtime/parrot/library/Stream/Coroutine.pir                 [library]
@@ -1223,7 +1282,7 @@
 runtime/parrot/library/YAML/Dumper.pir                      [library]
 runtime/parrot/library/YAML/Dumper/Base.pir                 [library]
 runtime/parrot/library/YAML/Dumper/Default.pir              [library]
-runtime/parrot/library/YAML/Parser/Syck.pir                 [library]
+runtime/parrot/library/distutils.pir                        [library]
 runtime/parrot/library/dumper.pir                           [library]
 runtime/parrot/library/libpcre.pir                          [library]
 runtime/parrot/library/ncurses.declarations                 [library]
@@ -1241,46 +1300,43 @@
 src/atomic/gcc_x86.c                                        []
 src/atomic/sparc_v9.s                                       []
 src/byteorder.c                                             []
+src/call/args.c                                             []
+src/call/context.c                                          []
+src/call/context_accessors.c                                []
 src/call/ops.c                                              []
 src/call/pcc.c                                              []
 src/datatypes.c                                             []
 src/debug.c                                                 []
 src/dynext.c                                                []
 src/dynoplibs/README                                        []doc
+src/dynoplibs/math.ops                                      []
 src/dynoplibs/obscure.ops                                   []
 src/dynpmc/README.pod                                       []doc
 src/dynpmc/dynlexpad.pmc                                    [devel]src
 src/dynpmc/ext.pir                                          []
 src/dynpmc/foo.pmc                                          [devel]src
+src/dynpmc/foo2.pmc                                         [devel]src
 src/dynpmc/gdbmhash.pmc                                     [devel]src
 src/dynpmc/main.pasm                                        []
-src/dynpmc/pair.pmc                                         [devel]src
 src/dynpmc/rational.pmc                                     [devel]src
 src/dynpmc/rotest.pmc                                       [devel]src
 src/dynpmc/subproxy.pmc                                     [devel]src
 src/embed.c                                                 []
 src/events.c                                                []
 src/exceptions.c                                            []
-src/exec.c                                                  []
-src/exec_save.c                                             []
-src/exec_save.h                                             []
-src/exec_start.c                                            []
 src/exit.c                                                  []
 src/extend.c                                                []
+src/frame_builder.c                                         []
+src/frame_builder.h                                         []
 src/gc/alloc_memory.c                                       []
-src/gc/alloc_register.c                                     []
 src/gc/alloc_resources.c                                    []
 src/gc/api.c                                                []
 src/gc/gc_inf.c                                             []
-src/gc/gc_malloc.c                                          []
 src/gc/gc_ms.c                                              []
 src/gc/gc_private.h                                         []
-src/gc/generational_ms.c                                    []
-src/gc/incremental_ms.c                                     []
 src/gc/malloc.c                                             []
 src/gc/malloc_trace.c                                       []
 src/gc/mark_sweep.c                                         []
-src/gc/res_lea.c                                            []
 src/gc/system.c                                             []
 src/global.c                                                []
 src/global_setup.c                                          []
@@ -1301,47 +1357,6 @@
 src/io/unix.c                                               []
 src/io/utf8.c                                               []
 src/io/win32.c                                              []
-src/jit.c                                                   []
-src/jit.h                                                   []
-src/jit/alpha/core.jit                                      []
-src/jit/alpha/jit_defs.c                                    []
-src/jit/alpha/jit_emit.h                                    []
-src/jit/amd64/core.jit                                      []
-src/jit/amd64/jit_defs.c                                    []
-src/jit/amd64/jit_emit.h                                    []
-src/jit/arm/core.jit                                        []
-src/jit/arm/exec_dep.c                                      []
-src/jit/arm/exec_dep.h                                      []
-src/jit/arm/jit_defs.c                                      []
-src/jit/arm/jit_emit.h                                      []
-src/jit/hppa/core.jit                                       []
-src/jit/hppa/jit_defs.c                                     []
-src/jit/hppa/jit_emit.h                                     []
-src/jit/i386/core.jit                                       []
-src/jit/i386/exec_dep.c                                     []
-src/jit/i386/exec_dep.h                                     []
-src/jit/i386/jit_defs.c                                     []
-src/jit/i386/jit_emit.h                                     []
-src/jit/ia64/core.jit                                       []
-src/jit/ia64/jit_defs.c                                     []
-src/jit/ia64/jit_emit.h                                     []
-src/jit/mips/core.jit                                       []
-src/jit/mips/jit_defs.c                                     []
-src/jit/mips/jit_emit.h                                     []
-src/jit/ppc/asm.s                                           []
-src/jit/ppc/core.jit                                        []
-src/jit/ppc/exec_dep.c                                      []
-src/jit/ppc/exec_dep.h                                      []
-src/jit/ppc/jit_defs.c                                      []
-src/jit/ppc/jit_emit.h                                      []
-src/jit/ppc/ppc-linux.s                                     []
-src/jit/skeleton/jit_defs.c                                 []
-src/jit/skeleton/jit_emit.h                                 []
-src/jit/sun4/core.jit                                       []
-src/jit/sun4/jit_defs.c                                     []
-src/jit/sun4/jit_emit.h                                     []
-src/jit_debug.c                                             []
-src/jit_debug_xcoff.c                                       []
 src/key.c                                                   []
 src/libnci_test.def                                         []
 src/library.c                                               []
@@ -1362,7 +1377,6 @@
 src/ops/object.ops                                          []
 src/ops/ops.num                                             [devel]src
 src/ops/ops.skip                                            []
-src/ops/pic.ops                                             []
 src/ops/pmc.ops                                             []
 src/ops/set.ops                                             []
 src/ops/string.ops                                          []
@@ -1375,10 +1389,7 @@
 src/parrot_debugger.c                                       []
 src/pbc_disassemble.c                                       []
 src/pbc_dump.c                                              []
-src/pbc_info.c                                              []
 src/pbc_merge.c                                             []
-src/pic.c                                                   []
-src/pic_jit.c                                               []
 src/pmc.c                                                   []
 src/pmc/addrregistry.pmc                                    [devel]src
 src/pmc/array.pmc                                           [devel]src
@@ -1386,7 +1397,7 @@
 src/pmc/bigint.pmc                                          [devel]src
 src/pmc/bignum.pmc                                          [devel]src
 src/pmc/boolean.pmc                                         [devel]src
-src/pmc/callsignature.pmc                                   [devel]src
+src/pmc/callcontext.pmc                                     [devel]src
 src/pmc/capture.pmc                                         [devel]src
 src/pmc/class.pmc                                           [devel]src
 src/pmc/codestring.pmc                                      [devel]src
@@ -1444,7 +1455,6 @@
 src/pmc/pmc.num                                             []
 src/pmc/pmcproxy.pmc                                        [devel]src
 src/pmc/pointer.pmc                                         [devel]src
-src/pmc/random.pmc                                          [devel]src
 src/pmc/resizablebooleanarray.pmc                           [devel]src
 src/pmc/resizablefloatarray.pmc                             [devel]src
 src/pmc/resizableintegerarray.pmc                           [devel]src
@@ -1468,11 +1478,11 @@
 src/pmc_freeze.c                                            []
 src/runcore/cores.c                                         []
 src/runcore/main.c                                          []
+src/runcore/profiling.c                                     []
 src/runcore/trace.c                                         []
 src/scheduler.c                                             []
 src/spf_render.c                                            []
 src/spf_vtable.c                                            []
-src/stacks.c                                                []
 src/string/api.c                                            []
 src/string/charset.c                                        []
 src/string/charset/ascii.c                                  []
@@ -1537,7 +1547,6 @@
 t/codingstd/pod_todo.t                                      [test]
 t/codingstd/svn_id.t                                        [test]
 t/codingstd/tabs.t                                          [test]
-t/codingstd/test_file_coverage.t                            [test]
 t/codingstd/trailing_space.t                                [test]
 t/compilers/imcc/imcpasm/cfg.t                              [test]
 t/compilers/imcc/imcpasm/opt0.t                             [test]
@@ -1545,10 +1554,8 @@
 t/compilers/imcc/imcpasm/opt2.t                             [test]
 t/compilers/imcc/imcpasm/optc.t                             [test]
 t/compilers/imcc/imcpasm/pcc.t                              [test]
-t/compilers/imcc/imcpasm/sub.t                              [test]
 t/compilers/imcc/reg/alloc.t                                [test]
 t/compilers/imcc/reg/spill.t                                [test]
-t/compilers/imcc/syn/bsr.t                                  [test]
 t/compilers/imcc/syn/clash.t                                [test]
 t/compilers/imcc/syn/const.t                                [test]
 t/compilers/imcc/syn/errors.t                               [test]
@@ -1601,6 +1608,7 @@
 t/compilers/pge/pge_globs.t                                 [test]
 t/compilers/pge/pge_text.t                                  [test]
 t/compilers/pge/pge_util.t                                  [test]
+t/compilers/pge/regression.t                                [test]
 t/compilers/tge/NoneGrammar.tg                              [test]
 t/compilers/tge/basic.t                                     [test]
 t/compilers/tge/grammar.t                                   [test]
@@ -1676,10 +1684,12 @@
 t/distro/file_metadata.t                                    [test]
 t/distro/manifest.t                                         [test]
 t/distro/meta_yml.t                                         [test]
+t/dynoplibs/math.t                                          [test]
+t/dynoplibs/obscure.t                                       [test]
 t/dynpmc/dynlexpad.t                                        [test]
 t/dynpmc/foo.t                                              [test]
+t/dynpmc/foo2.t                                             [test]
 t/dynpmc/gdbmhash.t                                         [test]
-t/dynpmc/pair.t                                             [test]
 t/dynpmc/rational.t                                         [test]
 t/dynpmc/rotest.t                                           [test]
 t/dynpmc/subclass_with_pir_method.t                         [test]
@@ -1697,7 +1707,9 @@
 t/examples/subs.t                                           [test]
 t/examples/tutorial.t                                       [test]
 t/harness                                                   [test]
+t/include/fp_equality.t                                     [test]
 t/library/cgi_query_hash.t                                  [test]
+t/library/configure.t                                       [test]
 t/library/coroutine.t                                       [test]
 t/library/dumper.t                                          [test]
 t/library/getopt_obj.t                                      [test]
@@ -1724,7 +1736,6 @@
 t/library/test_more.t                                       [test]
 t/library/uuid.t                                            [test]
 t/library/yaml_dumper.t                                     [test]
-t/library/yaml_parser_syck.t                                [test]
 t/manifest/01-basic.t                                       [test]
 t/manifest/02-regenerate_file.t                             [test]
 t/manifest/03-regenerate_skip.t                             [test]
@@ -1758,6 +1769,8 @@
 t/native_pbc/string_7.pbc                                   [test]
 t/native_pbc/testdata/README                                []doc
 t/native_pbc/testdata/annotations.pir                       [test]
+t/native_pbc/testdata/number.pasm                           [test]
+t/native_pbc/testdata/string.pasm                           [test]
 t/oo/attributes.t                                           [test]
 t/oo/composition.t                                          [test]
 t/oo/inheritance.t                                          [test]
@@ -1766,6 +1779,7 @@
 t/oo/methods.t                                              [test]
 t/oo/mro-c3.t                                               [test]
 t/oo/names.t                                                [test]
+t/oo/new-old.t                                              [test]
 t/oo/new.t                                                  [test]
 t/oo/ops.t                                                  [test]
 t/oo/proxy.t                                                [test]
@@ -1776,6 +1790,7 @@
 t/op/00ff-unix.t                                            [test]
 t/op/01-parse_ops.t                                         [test]
 t/op/64bit.t                                                [test]
+t/op/annotate-old.t                                         [test]
 t/op/annotate.t                                             [test]
 t/op/arithmetics.t                                          [test]
 t/op/arithmetics_pmc.t                                      [test]
@@ -1784,22 +1799,26 @@
 t/op/box.t                                                  [test]
 t/op/calling.t                                              [test]
 t/op/cc_params.t                                            [test]
+t/op/cc_params_old.t                                        [test]
 t/op/cc_state.t                                             [test]
 t/op/cmp-nonbranch.t                                        [test]
 t/op/comp.t                                                 [test]
 t/op/copy.t                                                 [test]
 t/op/debuginfo.t                                            [test]
 t/op/exceptions.t                                           [test]
+t/op/exit.t                                                 [test]
+t/op/fetch.t                                                [test]
 t/op/gc.t                                                   [test]
 t/op/globals.t                                              [test]
-t/op/hacks.t                                                [test]
 t/op/ifunless.t                                             [test]
+t/op/inf_nan.t                                              [test]
 t/op/integer.t                                              [test]
 t/op/interp.t                                               [test]
 t/op/io.t                                                   [test]
 t/op/jit.t                                                  [test]
 t/op/jitn.t                                                 [test]
 t/op/lexicals.t                                             [test]
+t/op/literal-old.t                                          [test]
 t/op/literal.t                                              [test]
 t/op/load_bytecode.t                                        [test]
 t/op/number.t                                               [test]
@@ -1811,12 +1830,15 @@
 t/op/sprintf_tests                                          [test]
 t/op/string.t                                               [test]
 t/op/string_cclass.t                                        [test]
+t/op/string_cmp.t                                           [test]
 t/op/string_cs.t                                            [test]
 t/op/string_mem.t                                           [test]
 t/op/stringu.t                                              [test]
 t/op/sysinfo.t                                              [test]
 t/op/time.t                                                 [test]
+t/op/time_old.t                                             [test]
 t/op/trans.t                                                [test]
+t/op/vivify.t                                               [test]
 t/perl/Parrot_Distribution.t                                [test]
 t/perl/Parrot_Docs.t                                        [test]
 t/perl/Parrot_IO.t                                          [test]
@@ -1829,18 +1851,21 @@
 t/pharness/02-get_test_prog_args.t                          [test]
 t/pharness/03-handle_long_options.t                         [test]
 t/pharness/04-Usage.t                                       [test]
+t/pir/macro.t                                               [test]
+t/pir/registernames.t                                       [test]
 t/pmc/addrregistry.t                                        [test]
 t/pmc/array.t                                               [test]
 t/pmc/arrayiterator.t                                       [test]
 t/pmc/bigint.t                                              [test]
 t/pmc/bignum.t                                              [test]
 t/pmc/boolean.t                                             [test]
-t/pmc/callsignature.t                                       [test]
+t/pmc/callcontext.t                                         [test]
 t/pmc/capture.t                                             [test]
 t/pmc/class.t                                               [test]
 t/pmc/codestring.t                                          [test]
 t/pmc/complex.t                                             [test]
 t/pmc/config.t                                              [test]
+t/pmc/context.t                                             [test]
 t/pmc/continuation.t                                        [test]
 t/pmc/coroutine.t                                           [test]
 t/pmc/cpointer.t                                            [test]
@@ -1848,6 +1873,7 @@
 t/pmc/env.t                                                 [test]
 t/pmc/eval.t                                                [test]
 t/pmc/eventhandler.t                                        [test]
+t/pmc/exception-old.t                                       [test]
 t/pmc/exception.t                                           [test]
 t/pmc/exceptionhandler.t                                    [test]
 t/pmc/exporter.t                                            [test]
@@ -1876,6 +1902,7 @@
 t/pmc/managedstruct.t                                       [test]
 t/pmc/multidispatch.t                                       [test]
 t/pmc/multisub.t                                            [test]
+t/pmc/namespace-old.t                                       [test]
 t/pmc/namespace.t                                           [test]
 t/pmc/nci.t                                                 [test]
 t/pmc/null.t                                                [test]
@@ -1907,7 +1934,6 @@
 t/pmc/pmcproxy.t                                            [test]
 t/pmc/pointer.t                                             [test]
 t/pmc/prop.t                                                [test]
-t/pmc/random.t                                              [test]
 t/pmc/resizablebooleanarray.t                               [test]
 t/pmc/resizablefloatarray.t                                 [test]
 t/pmc/resizableintegerarray.t                               [test]
@@ -1958,9 +1984,8 @@
 t/steps/auto/crypto-01.t                                    [test]
 t/steps/auto/ctags-01.t                                     [test]
 t/steps/auto/env-01.t                                       [test]
-t/steps/auto/fink-01.t                                      [test]
 t/steps/auto/format-01.t                                    [test]
-t/steps/auto/funcptr-01.t                                   [test]
+t/steps/auto/frames-01.t                                    [test]
 t/steps/auto/gc-01.t                                        [test]
 t/steps/auto/gcc-01.t                                       [test]
 t/steps/auto/gdbm-01.t                                      [test]
@@ -1972,8 +1997,6 @@
 t/steps/auto/inline-01.t                                    [test]
 t/steps/auto/isreg-01.t                                     [test]
 t/steps/auto/jit-01.t                                       [test]
-t/steps/auto/macports-01.t                                  [test]
-t/steps/auto/macports-02.t                                  [test]
 t/steps/auto/memalign-01.t                                  [test]
 t/steps/auto/msvc-01.t                                      [test]
 t/steps/auto/neg_0-01.t                                     [test]
@@ -2006,6 +2029,7 @@
 t/steps/init/headers-01.t                                   [test]
 t/steps/init/hints-01.t                                     [test]
 t/steps/init/hints/darwin-01.t                              [test]
+t/steps/init/hints/linux-01.t                               [test]
 t/steps/init/install-01.t                                   [test]
 t/steps/init/manifest-01.t                                  [test]
 t/steps/init/optimize-01.t                                  [test]
@@ -2089,8 +2113,10 @@
 t/tools/ops2pm/samples/ops_num.original                     [test]
 t/tools/ops2pm/samples/pic_ops.original                     [test]
 t/tools/parrot_debugger.t                                   [test]
+t/tools/pbc_disassemble.t                                   [test]
+t/tools/pbc_dump.t                                          [test]
 t/tools/pbc_merge.t                                         [test]
-t/tools/pmc2c.t                                             [test]
+t/tools/pgegrep.t                                           [test]
 t/tools/pmc2cutils/00-qualify.t                             [test]
 t/tools/pmc2cutils/01-pmc2cutils.t                          [test]
 t/tools/pmc2cutils/02-find_file.t                           [test]
@@ -2099,11 +2125,11 @@
 t/tools/pmc2cutils/05-gen_c.t                               [test]
 t/tools/pmc2cutils/08-pmc-pm.t                              [test]
 t/tools/pmc2cutils/README                                   []doc
+t/tools/testdata                                            [test]
 tools/build/addopstags.pl                                   []
 tools/build/c2str.pl                                        []
 tools/build/fixup_gen_file.pl                               []
 tools/build/headerizer.pl                                   []
-tools/build/jit2c.pl                                        []
 tools/build/nativecall.pl                                   []
 tools/build/ops2c.pl                                        [devel]
 tools/build/ops2pm.pl                                       []
@@ -2117,7 +2143,8 @@
 tools/dev/bench_op.pir                                      []
 tools/dev/branch_status.pl                                  []
 tools/dev/cc_flags.pl                                       []
-tools/dev/create_language.pl                                []
+tools/dev/checkdepend.pl                                    []
+tools/dev/create_language.pl                                [devel]
 tools/dev/debian_docs.sh                                    []
 tools/dev/fetch_languages.pl                                []
 tools/dev/gen_charset_tables.pl                             []
@@ -2125,6 +2152,7 @@
 tools/dev/gen_makefile.pl                                   [devel]
 tools/dev/gen_valgrind_suppressions.pl                      []
 tools/dev/install_dev_files.pl                              []
+tools/dev/install_doc_files.pl                              []
 tools/dev/install_files.pl                                  []
 tools/dev/lib_deps.pl                                       []
 tools/dev/list_unjitted.pl                                  []
@@ -2145,16 +2173,20 @@
 tools/dev/parrot.supp                                       []
 tools/dev/parrot_api.pl                                     []
 tools/dev/parrot_coverage.pl                                []
+tools/dev/parrot_shell.pl                                   []
 tools/dev/parrotbench.pl                                    []
 tools/dev/pbc_header.pl                                     []
 tools/dev/pbc_to_exe.pir                                    [devel]
 tools/dev/pmcrenumber.pl                                    []
 tools/dev/pmctree.pl                                        []
+tools/dev/pprof2cg.nqp                                      []
+tools/dev/pprof2cg.pl                                       []
 tools/dev/reconfigure.pl                                    [devel]
 tools/dev/search-ops.pl                                     []
 tools/dev/svnclobber.pl                                     []
 tools/dev/symlink.pl                                        []
 tools/dev/vgp                                               []
+tools/dev/vgp_darwin                                        []
 tools/dev/vms-patch                                         []
 tools/dev/vtablize.pl                                       []
 tools/docs/mk_chm.pl                                        []
@@ -2174,8 +2206,6 @@
 tools/util/release.json                                     []
 tools/util/templates.json                                   []
 tools/util/update_copyright.pl                              []
-xconf/samples/testfoobar                                    []
-xconf/samples/yourfoobar                                    []
 # Local variables:
 #   mode: text
 #   buffer-read-only: t

Modified: branches/orderedhash_revamp/MANIFEST.SKIP
==============================================================================
--- branches/orderedhash_revamp/MANIFEST.SKIP	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/MANIFEST.SKIP	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,6 +1,6 @@
 # ex: set ro:
 # $Id$
-# generated by tools/dev/mk_manifest_and_skip.pl Thu Jun 25 20:34:12 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Wed Dec 16 15:31:13 2009 UT
 #
 # This file should contain a transcript of the svn:ignore properties
 # of the directories in the Parrot subversion repository. (Needed for
@@ -83,6 +83,12 @@
 ^myconfig/
 ^parrot$
 ^parrot/
+^parrot-nqp$
+^parrot-nqp/
+^parrot-nqp\.c$
+^parrot-nqp\.c/
+^parrot-nqp\.pbc$
+^parrot-nqp\.pbc/
 ^parrot\.ilk$
 ^parrot\.ilk/
 ^parrot\.iss$
@@ -143,6 +149,16 @@
 ^vc70\.pdb/
 ^vtable\.dump$
 ^vtable\.dump/
+# generated from svn:ignore of 'compilers/data_json/'
+^compilers/data_json/Makefile$
+^compilers/data_json/Makefile/
+^compilers/data_json/data_json\.pbc$
+^compilers/data_json/data_json\.pbc/
+# generated from svn:ignore of 'compilers/data_json/data_json/'
+^compilers/data_json/data_json/.*\.pbc$
+^compilers/data_json/data_json/.*\.pbc/
+^compilers/data_json/data_json/.*\.pir$
+^compilers/data_json/data_json/.*\.pir/
 # generated from svn:ignore of 'compilers/imcc/'
 ^compilers/imcc/.*\.flag$
 ^compilers/imcc/.*\.flag/
@@ -263,6 +279,8 @@
 ^docs/.*\.tmp/
 ^docs/Makefile$
 ^docs/Makefile/
+^docs/doc-prep$
+^docs/doc-prep/
 ^docs/html$
 ^docs/html/
 ^docs/packfile-c\.pod$
@@ -297,8 +315,8 @@
 ^examples/languages/abc/.*\.obj/
 ^examples/languages/abc/.*\.pbc$
 ^examples/languages/abc/.*\.pbc/
-^examples/languages/abc/Makefile$
-^examples/languages/abc/Makefile/
+^examples/languages/abc/MANIFEST$
+^examples/languages/abc/MANIFEST/
 ^examples/languages/abc/abc$
 ^examples/languages/abc/abc/
 ^examples/languages/abc/installable_abc$
@@ -330,12 +348,10 @@
 ^examples/languages/squaak/.*\.obj/
 ^examples/languages/squaak/.*\.pbc$
 ^examples/languages/squaak/.*\.pbc/
-^examples/languages/squaak/Makefile$
-^examples/languages/squaak/Makefile/
+^examples/languages/squaak/MANIFEST$
+^examples/languages/squaak/MANIFEST/
 ^examples/languages/squaak/installable_squaak$
 ^examples/languages/squaak/installable_squaak/
-^examples/languages/squaak/man$
-^examples/languages/squaak/man/
 ^examples/languages/squaak/squaak$
 ^examples/languages/squaak/squaak/
 # generated from svn:ignore of 'examples/languages/squaak/src/'
@@ -369,8 +385,8 @@
 ^examples/pir/befunge/.*\.obj/
 ^examples/pir/befunge/.*\.pbc$
 ^examples/pir/befunge/.*\.pbc/
-^examples/pir/befunge/Makefile$
-^examples/pir/befunge/Makefile/
+^examples/pir/befunge/MANIFEST$
+^examples/pir/befunge/MANIFEST/
 ^examples/pir/befunge/befunge$
 ^examples/pir/befunge/befunge/
 ^examples/pir/befunge/installable_befunge$
@@ -445,6 +461,11 @@
 # generated from svn:ignore of 'ext/Parrot-Embed/t/'
 ^ext/Parrot-Embed/t/.*\.pbc$
 ^ext/Parrot-Embed/t/.*\.pbc/
+# generated from svn:ignore of 'ext/nqp-rx/'
+^ext/nqp-rx/.*\.pbc$
+^ext/nqp-rx/.*\.pbc/
+^ext/nqp-rx/Makefile$
+^ext/nqp-rx/Makefile/
 # generated from svn:ignore of 'include/parrot/'
 ^include/parrot/.*\.tmp$
 ^include/parrot/.*\.tmp/
@@ -477,6 +498,9 @@
 ^include/parrot/oplib/.*_ops_switch\.h/
 ^include/parrot/oplib/ops\.h$
 ^include/parrot/oplib/ops\.h/
+# generated from svn:ignore of 'include/pmc/'
+^include/pmc/.*\.h$
+^include/pmc/.*\.h/
 # generated from svn:ignore of 'lib/'
 ^lib/DumbLink\.pm$
 ^lib/DumbLink\.pm/
@@ -554,6 +578,9 @@
 # generated from svn:ignore of 'runtime/parrot/library/Config/'
 ^runtime/parrot/library/Config/.*\.pbc$
 ^runtime/parrot/library/Config/.*\.pbc/
+# generated from svn:ignore of 'runtime/parrot/library/Configure/'
+^runtime/parrot/library/Configure/.*\.pbc$
+^runtime/parrot/library/Configure/.*\.pbc/
 # generated from svn:ignore of 'runtime/parrot/library/Data/'
 ^runtime/parrot/library/Data/.*\.pbc$
 ^runtime/parrot/library/Data/.*\.pbc/
@@ -667,6 +694,8 @@
 ^src/atomic/.*\.o$
 ^src/atomic/.*\.o/
 # generated from svn:ignore of 'src/call/'
+^src/call/.*\.o$
+^src/call/.*\.o/
 ^src/call/.*\.obj$
 ^src/call/.*\.obj/
 ^src/call/.*\.str$
@@ -785,6 +814,8 @@
 ^src/gc/Makefile$
 ^src/gc/Makefile/
 # generated from svn:ignore of 'src/interp/'
+^src/interp/.*\.o$
+^src/interp/.*\.o/
 ^src/interp/.*\.str$
 ^src/interp/.*\.str/
 # generated from svn:ignore of 'src/io/'
@@ -823,6 +854,13 @@
 ^src/pmc/.*\.tmp/
 ^src/pmc/Makefile$
 ^src/pmc/Makefile/
+# generated from svn:ignore of 'src/runcore/'
+^src/runcore/.*\.o$
+^src/runcore/.*\.o/
+^src/runcore/.*\.obj$
+^src/runcore/.*\.obj/
+^src/runcore/.*\.str$
+^src/runcore/.*\.str/
 # generated from svn:ignore of 'src/string/'
 ^src/string/.*\.o$
 ^src/string/.*\.o/

Modified: branches/orderedhash_revamp/MANIFEST.generated
==============================================================================
--- branches/orderedhash_revamp/MANIFEST.generated	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/MANIFEST.generated	Sat Jan 23 01:49:53 2010	(r43541)
@@ -2,34 +2,35 @@
 # See tools/dev/install_files.pl for documentation on the
 # format of this file.
 # Please re-sort this file after *EVERY* modification
-blib/lib/libparrot.1.3.0.dylib                    [main]lib
+blib/lib/libparrot.1.9.0.dylib                    [main]lib
 blib/lib/libparrot.a                              [main]lib
 blib/lib/libparrot.dylib                          [main]lib
-blib/lib/libparrot.so.1.3.0                       [main]lib
+blib/lib/libparrot.so.1.9.0                       [main]lib
 blib/lib/libparrot.so                             [main]lib
-compilers/json/JSON/grammar.pbc                   [json]
+compilers/data_json/data_json.pbc                 [data_json]
 compilers/json/JSON.pbc                           [json]
+compilers/json/JSON/grammar.pbc                   [json]
 compilers/json/JSON/pge2pir.pbc                   [json]
 compilers/nqp/nqp.pbc                             [nqp]
 config/gen/call_list/opengl.in                    []
-docs/ops/bit.pod                                  [main]doc
-docs/ops/cmp.pod                                  [main]doc
-docs/ops/core.pod                                 [main]doc
-docs/ops/debug.pod                                [main]doc
-docs/ops/dotgnu.pod                               [main]doc
-docs/ops/experimental.pod                         [main]doc
-docs/ops/io.pod                                   [main]doc
-docs/ops/math.pod                                 [main]doc
-docs/ops/object.pod                               [main]doc
-docs/ops/obscure.pod                              [main]doc
-docs/ops/pic.pod                                  [main]doc
-docs/ops/pmc.pod                                  [main]doc
-docs/ops/python.pod                               [main]doc
-docs/ops/set.pod                                  [main]doc
-docs/ops/stack.pod                                [main]doc
-docs/ops/string.pod                               [main]doc
-docs/ops/sys.pod                                  [main]doc
-docs/ops/var.pod                                  [main]doc
+docs/ops/bit.pod                                  [doc]
+docs/ops/cmp.pod                                  [doc]
+docs/ops/core.pod                                 [doc]
+docs/ops/debug.pod                                [doc]
+docs/ops/dotgnu.pod                               [doc]
+docs/ops/experimental.pod                         [doc]
+docs/ops/io.pod                                   [doc]
+docs/ops/math.pod                                 [doc]
+docs/ops/object.pod                               [doc]
+docs/ops/obscure.pod                              [doc]
+docs/ops/pic.pod                                  [doc]
+docs/ops/pmc.pod                                  [doc]
+docs/ops/python.pod                               [doc]
+docs/ops/set.pod                                  [doc]
+docs/ops/stack.pod                                [doc]
+docs/ops/string.pod                               [doc]
+docs/ops/sys.pod                                  [doc]
+docs/ops/var.pod                                  [doc]
 include/parrot/config.h                           [main]include
 include/parrot/core_pmcs.h                        [main]include
 include/parrot/exec_dep.h                         [main]include
@@ -48,6 +49,7 @@
 include/parrot/vtable.h                           [main]include
 install_config.fpmc                               [main]lib
 src/install_config.o                              [main]lib
+src/install_config.obj                            [main]lib
 installable_parrot_config.exe                     [main]bin
 installable_parrot_config                         [main]bin
 installable_parrot_debugger.exe                   [main]bin
@@ -58,14 +60,15 @@
 installable_pbc_disassemble                       [main]bin
 installable_pbc_dump.exe                          [main]bin
 installable_pbc_dump                              [main]bin
-installable_pbc_info.exe                          [main]bin
-installable_pbc_info                              [main]bin
 installable_pbc_merge.exe                         [main]bin
 installable_pbc_merge                             [main]bin
 installable_pbc_to_exe.exe                        [main]bin
 installable_pbc_to_exe                            [main]bin
+installable_parrot-nqp.exe                        [main]bin
+installable_parrot-nqp                            [main]bin
 lib/Parrot/Config/Generated.pm                    [devel]lib
 libparrot.dll                                     [main]bin
+libparrot.lib                                     [main]bin
 lib/Parrot/OpLib/core.pm                          [devel]lib
 lib/Parrot/Pmc2c/PCCMETHOD_BITS.pm                [devel]lib
 lib/Parrot/PMC.pm                                 [devel]lib
@@ -94,6 +97,14 @@
 runtime/parrot/dynext/match_group.dll             [library]
 runtime/parrot/dynext/match_group.dylib           [library]
 runtime/parrot/dynext/match_group.so              [library]
+runtime/parrot/dynext/math_ops.so                 [library]
+runtime/parrot/dynext/math_ops.bundle             [library]
+runtime/parrot/dynext/math_ops.dll                [library]
+runtime/parrot/dynext/math_ops.dylib              [library]
+runtime/parrot/dynext/obscure_ops.bundle          [library]
+runtime/parrot/dynext/obscure_ops.dll             [library]
+runtime/parrot/dynext/obscure_ops.dylib           [library]
+runtime/parrot/dynext/obscure_ops.so              [library]
 runtime/parrot/dynext/rational.bundle             [library]
 runtime/parrot/dynext/rational.dll                [library]
 runtime/parrot/dynext/rational.dylib              [library]
@@ -117,8 +128,8 @@
 runtime/parrot/include/interptrace.pasm           [main]
 runtime/parrot/include/iotypes.pasm               [main]
 runtime/parrot/include/iterator.pasm              [main]
+runtime/parrot/include/libpaths.pasm              [main]
 runtime/parrot/include/longopt.pasm               [main]
-runtime/parrot/include/mmd.pasm                   [main]
 runtime/parrot/include/opengl_defines.pasm        [main]
 runtime/parrot/include/parrotlib.pbc              [main]
 runtime/parrot/include/pmctypes.pasm              [main]
@@ -134,6 +145,7 @@
 runtime/parrot/include/warnings.pasm              [main]
 runtime/parrot/library/CGI/QueryHash.pbc          [main]
 runtime/parrot/library/Config/JSON.pbc            [main]
+runtime/parrot/library/Configure/genfile.pbc      [main]
 runtime/parrot/library/config.pbc                 [main]
 runtime/parrot/library/config.pir                 [main]
 runtime/parrot/library/Crow.pbc                   [main]
@@ -142,8 +154,10 @@
 runtime/parrot/library/Data/Dumper.pbc            [main]
 runtime/parrot/library/Data/Replace.pbc           [main]
 runtime/parrot/library/Digest/MD5.pbc             [main]
+runtime/parrot/library/distutils.pbc              [main]
 runtime/parrot/library/dumper.pbc                 [main]
 runtime/parrot/library/Getopt/Obj.pbc             [main]
+runtime/parrot/library/HLL.pbc                    [main]
 runtime/parrot/library/HTTP/Daemon.pbc            [main]
 runtime/parrot/library/Iter.pbc                   [main]
 runtime/parrot/library/JSON.pbc                   [main]
@@ -153,10 +167,12 @@
 runtime/parrot/library/MIME/Base64.pbc            [main]
 runtime/parrot/library/NCI/call_toolkit_init.pbc  [main]
 runtime/parrot/library/ncurses.pbc                [main]
+runtime/parrot/library/nqp-rx.pbc                 [nqp]
 runtime/parrot/library/OpenGL_funcs.pir           [main]
 runtime/parrot/library/OpenGL_funcs.pbc           [main]
 runtime/parrot/library/OpenGL.pbc                 [main]
 runtime/parrot/library/P6object.pbc               [main]
+runtime/parrot/library/P6Regex.pbc                [main]
 runtime/parrot/library/Parrot/Capture_PIR.pbc     [main]
 runtime/parrot/library/Parrot/Coroutine.pbc       [main]
 runtime/parrot/library/Parrot/Exception.pbc       [main]
@@ -164,10 +180,10 @@
 runtime/parrot/library/parrotlib.pbc              [main]
 runtime/parrot/library/pcore.pbc                  [main]
 runtime/parrot/library/pcre.pbc                   [main]
-runtime/parrot/library/PCT/Grammar.pbc            [pct]
-runtime/parrot/library/PCT/HLLCompiler.pbc        [pct]
-runtime/parrot/library/PCT/PAST.pbc               [pct]
-runtime/parrot/library/PCT.pbc                    [pct]
+runtime/parrot/library/PCT/Grammar.pbc            [main]
+runtime/parrot/library/PCT/HLLCompiler.pbc        [main]
+runtime/parrot/library/PCT/PAST.pbc               [main]
+runtime/parrot/library/PCT.pbc                    [main]
 runtime/parrot/library/PGE/Dumper.pbc             [main]
 runtime/parrot/library/PGE/Glob.pbc               [main]
 runtime/parrot/library/PGE/Hs.pbc                 [main]
@@ -177,6 +193,7 @@
 runtime/parrot/library/PGE/Util.pbc               [main]
 runtime/parrot/library/Protoobject.pbc            [main]
 runtime/parrot/library/Range.pbc                  [main]
+runtime/parrot/library/Regex.pbc                  [main]
 runtime/parrot/library/Stream/Base.pbc            [main]
 runtime/parrot/library/Stream/Combiner.pbc        [main]
 runtime/parrot/library/Stream/Coroutine.pbc       [main]
@@ -196,6 +213,7 @@
 runtime/parrot/library/Test/Class.pbc             [main]
 runtime/parrot/library/Test/More.pbc              [main]
 runtime/parrot/library/TGE.pbc                    [tge]
+runtime/parrot/library/uuid.pbc                   [main]
 runtime/parrot/library/YAML/Dumper/Base.pmc       [main]
 runtime/parrot/library/YAML/Dumper/Default.pmc    [main]
 runtime/parrot/library/YAML/Dumper.pbc            [main]
@@ -216,24 +234,26 @@
 src/pmc/integer.dump                              [devel]src
 src/pmc/multisub.dump                             [devel]src
 src/pmc/object.dump                               [devel]src
-src/pmc/pmc_boolean.h                             [devel]include
-src/pmc/pmc_class.h                               [devel]include
-src/pmc/pmc_continuation.h                        [devel]include
-src/pmc/pmc_default.h                             [devel]include
-src/pmc/pmc_fixedintegerarray.h                   [devel]include
-src/pmc/pmc_fixedpmcarray.h                       [devel]include
-src/pmc/pmc_float.h                               [devel]include
-src/pmc/pmc_hash.h                                [devel]include
-src/pmc/pmc_integer.h                             [devel]include
-src/pmc/pmc_multisub.h                            [devel]include
-src/pmc/pmc_object.h                              [devel]include
-src/pmc/pmc_parrotlibrary.h                       [devel]include
-src/pmc/pmc_resizablepmcarray.h                   [devel]include
-src/pmc/pmc_role.h                                [devel]include
-src/pmc/pmc_scalar.h                              [devel]include
-src/pmc/pmc_string.h                              [devel]include
-src/pmc/pmc_sub.h                                 [devel]include
-src/pmc/pmc_undef.h                               [devel]include
+include/pmc/pmc_boolean.h                         [devel]include
+include/pmc/pmc_class.h                           [devel]include
+include/pmc/pmc_callcontext.h                     [devel]include
+include/pmc/pmc_continuation.h                    [devel]include
+include/pmc/pmc_context.h                         [devel]include
+include/pmc/pmc_default.h                         [devel]include
+include/pmc/pmc_fixedintegerarray.h               [devel]include
+include/pmc/pmc_fixedpmcarray.h                   [devel]include
+include/pmc/pmc_float.h                           [devel]include
+include/pmc/pmc_hash.h                            [devel]include
+include/pmc/pmc_integer.h                         [devel]include
+include/pmc/pmc_multisub.h                        [devel]include
+include/pmc/pmc_object.h                          [devel]include
+include/pmc/pmc_parrotlibrary.h                   [devel]include
+include/pmc/pmc_resizablepmcarray.h               [devel]include
+include/pmc/pmc_role.h                            [devel]include
+include/pmc/pmc_scalar.h                          [devel]include
+include/pmc/pmc_string.h                          [devel]include
+include/pmc/pmc_sub.h                             [devel]include
+include/pmc/pmc_undef.h                           [devel]include
 src/pmc/resizablepmcarray.dump                    [devel]src
 src/pmc/role.dump                                 [devel]src
 src/pmc/scalar.dump                               [devel]src

Modified: branches/orderedhash_revamp/META.yml
==============================================================================
--- branches/orderedhash_revamp/META.yml	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/META.yml	Sat Jan 23 01:49:53 2010	(r43541)
@@ -4,7 +4,7 @@
 # See http://module-build.sourceforge.net/META-spec-current.html for details.
 ---
 name: parrot
-version: 1.3.0
+version: 1.9.0
 author: parrot-dev at lists.parrot.org
 abstract: a virtual machine designed for dynamic languages
 license: artistic2

Modified: branches/orderedhash_revamp/NEWS
==============================================================================
--- branches/orderedhash_revamp/NEWS	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/NEWS	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,250 @@
 # $Id$
 
+New in 2.0.0
+- Functionality
+  + Context PMCs now support attribute-based introspection
+  + Context and CallSignature PMCs merged into CallContext
+  + .lex directive throws exceptions when used with incorrect register types
+- Compilers
+  + PIRC (new PIR compiler) built by default
+- Platforms
+  + Packaging improved for free OS distributions
+  + PPC, PPC64, and ARM now tested when running Linux
+- Performance
+  + Minor improvements to the profiling runcore
+  + Modest improvements from the CallContext PMC merge
+- New deprecations
+  + In/out parameters in STRING modification functions
+  + Void handling in NCI signatures
+  + Parameter passing opcodes order in PBC
+- Realized deprecations
+- Tests
+  + Continued migration of core tests from Perl 5 to PIR
+- Documentation
+  + Improved accuracy, removed typos
+- Tools
+  + dependency checker improved
+- Miscellaneous
+  + Deprecation cycle length changed to three months from six
+  + GC accuracy improved
+  + PMC freeze improvements; much more reliable
+  + Makefile improvements for dependency handling
+
+New in 1.9.0
+- Core
+  + Made profiling runcore output format configurable and extensible
+    options include "pprof" and "none" ("binary" and "callgrind" are planned)
+  + Added environment variables to specify profiling output type and filename
+    (PARROT_PROFILING_OUTPUT and PARROT_PROFILING_FILENAME)
+  + Began merging Freeze/Thaw and Bytecode generator/loader
+- Compilers
+  + Included latest nqp-rx compiler, with many improvements
+    - GLOBAL:: package identifier
+    - dynamic variables look in global namespace
+    - $obj."$method" syntax
+    - :p(os) and :c(ontinue) option on regexes
+    - try/CATCH/CONTROL handling
+    - support leading & on subroutine declarations
+    - allow "category:<symbol>" names (for builtin operators)
+    - simple version of smartmatch operator
+    - simple regex matches
+    - updated HLL::Compiler with new import/export methods
+- Miscellaneous
+  + Portability updates for RTEMS, and Intel architectures with GNU compilers
+  + Completed conversion of ticket tracking system from RT to Trac
+  + New draft of PDD31 for HLL export API and import implementation
+  + Several (build time, runtime) performance improvements
+  + Converted many tests to PIR, reducing test execution time
+  + Various bugfixes, code cleanups, and coding standard fixes
+
+New in 1.8.0
+- Functionality
+  + The FileHandle PMC now exposes the exit code of child process that was run as pipe.
+  + Experimental support for overriding VTABLE invoke in PIR objects was added.
+  + The method 'type' was added to the PackfileAnnotations PMC.
+  + The internals of the parrot calling conventions, PCC, were reworked.
+    All call paths now use a CallSignature object for passing arguments and return values.
+  + The new API-function  'Parrot_ext_call' was added for calling into C-land.
+  + The fixed-size allocator was improved.
+  + The files installed by 'make install-dev' are now covered by 'make install' as well.
+  + The experimental ops 'fetch' and 'vivify' were added.
+  + The -I option to the command 'parrot' now prepends items to the search path.
+  + The Context struct was substituted with auto attributes (context_auto_attrs branch).
+  + Use the osname determined in auto::arch in subsequent configuration steps (convert_OSNAME branch).
+  + Eliminated dependence on Perl 5 '%Config' in auto::format (auto_format_no_Config branch).
+  + MultiSub PMCs now stringify to the name of their first candidate,
+    instead of the number of candidates.
+  + The platform detection at the start of the configuration process was improved.
+  + The 'lineof' method on CodeString objects now precomputes line number information
+    to be more efficient on variable-width encoded strings.
+  + P6object now supports .WHO and .WHERE methods on protoobjects.
+- Compilers
+  + A shiny new self-hosting implementation of NQP has been added in ext/nqp-rx.
+    - New NQP available as nqp-rx.pbc or parrot-nqp fakecutable.
+    - NQP includes direct support for grammars and regexes, including protoregexes.
+    - NQP has a new PAST-based regex engine (intended to replace PGE).
+    - Regexes may contain code assertions, parameters, lexical declarations, and more.
+    - Double-quoted strings now interpolate scalar variables and closures.
+    - Subroutine declarations are now lexical by default.
+  + PCT
+    - PAST::Block now supports an 'nsentry' attribute.
+    - PAST::Var allows 'contextual' scope.
+    - Attribute bindings now return the bound value.
+- Platforms
+  + Fixes for the port of Parrot to RTEMS were applied. Yay, first port to a real time OS!
+  + On NetBSD, shared libs are now used.
+- Performance
+  + Use the the fixed-sized allocator in the Context and the CallSignature PMC.
+  + Many small speed improvements.
+- New deprecations
+  + MT19937, the Mersenne twisted pseudorandom number generator, is now hosted on github and 
+    will be removed from the Parrot core. (eligible in 2.1)
+  + The 'Parrot_call_*' functions for invoking a sub/method object from C are
+    deprecated. They are replaced by 'Parrot_ext_call'. (eligible in 2.1)
+  + All bitwise VTABLE functions are deprecated. (eligible in 2.1)
+  + All bitwise ops will become dynops. (eligible in 2.1)
+- Realized deprecations
+  + The slice VTABLE entry was removed.
+  + The last traces of the 'malloc' garbage collector were removed.
+  + Parrot_pcc_constants() was renamed to Parrot_pcc_get_constants().
+  + The deprecated functions from the Embedding/Extension interface were removed.
+  + The library YAML/Parser/Syck.pir was removed.
+  + The VTABLE function instantiate_str() was removed.
+  + Building of parrot_nqp was removed.
+- Tests
+  + The test coverage of the time-related ops was much improved.
+  + New testing functions in Test::More: lives_ok() and dies_ok().
+  + The Perl 5 based test scripts t/op/bitwise.t, t/op/comp.t, t/op/inf_nan.t,
+    t/op/literal.t, t/op/number.t, t/op/sprintf2.t, and t/op/00ff-dos.t were converted to PIR.
+  + The test scripts t/op/annotate.t and t/op/time.t have begun
+    to be translated from Perl 5 to PIR.
+  + In some tests the dependency on %Config from Perl 5 was eliminated.
+- Documentation
+  + The meaning of 'p' means in NCI function call signatures was clarified.
+- Tools
+  + The stub for a new language, as created by mk_language_shell.pl,
+    now relies on the PIR-based tools, which are replacing the Perl 5-based tools.
+  + The library Configure.pir was added.
+  + The library distutils.pir was added.
+- Miscellaneous
+  + The mailing list parrot-users and a corresponding google group was created,
+    http://groups.google.com/group/parrot-users.
+  + Many bugfixes, code cleanups, and coding standard fixes.
+
+New in 1.7.0
+- Functionality
+  + Parrot_capture_lex has been added to the PARROT_EXPORT API
+  + PARROT_MAX_ARGS has been increased from 8 to 16 to allow for ops that take more than 8 args
+- Performance
+  + The profiling runcore now caches metadata for improved performance
+- Maintenance and cleanup
+  + Expanded the Parrot debugger documentation
+  + Parrot debugger now uses the new Parrot STRING API
+  + Continue to port rest of internals to use the STRING API
+- Deprecations
+  + The JIT subsystem has been removed and is being written from the ground up. More
+    information can be found at https://trac.parrot.org/parrot/wiki/JITRewrite
+  + Implicit optional named parameters (eligible in 2.1)
+  + Continuation-based ExceptionHandlers (eligible in 2.1)
+  + Use of undocumented variables in class_init (eligible in 2.1)
+  + Parrot_oo_get_namespace (eligible in 2.1)
+- Bugfix
+  + Improved line number tracking in IMCC
+- Tests
+  + Converted many more Perl 5 tests to PIR
+  + Expanded test coverage of the CallSignature, Namespace, FixedPMCArray,
+    ResizeableIntegerArray and ExceptionHandler PMCs
+
+New in 1.6.0
+- Functionality
+  + Added a fixed-size structure allocator to the Garbage Collector
+  + Added a "lazy" mode to the PObj and Fixed-Size memory allocators
+  + Added a profiling runcore, which generates Callgrind-compatible output
+  + Added lexical subsystem opcodes: find_dynamic_lex, store_dynamic_lex
+  + Converted Contexts to garbage-collectable PMC structures
+  + Created a new Context API
+  + Enhanced the PMC allocator to automatically allocate ATTR structures
+- Performance
+  + Optimized opcodes to cache the current Context for subsequent lookups
+  + Reduced string comparisons in VTABLE_isa
+- Maintenance and cleanup
+  + Began proper encapsulation of STRING API
+  + Unified all PMC destruction functions
+  + Unified Continuation PMC and Parrot_cont structure
+  + Unified Sub PMC and Parrot_sub structure
+  + Removed PMC_EXT structure
+  + Removed PMC_Sync from PMC
+  + Removed UnionVal from PMC structure
+- Bugfix
+  + Fixed several stack-walking bugs in Garbage Collector code
+  + Fixed bug when copying a NULL STRING, now returns empty STRING struct
+- Tests
+  + Converted several Perl5 tests to PIR
+  + Expanded test coverage of NameSpace PMC
+- Compilers
+  + Made Parrot Compiler Toolkit available in the base install
+
+New in 1.5.0
+- Core
+  + Removed several deprecated functions and features
+  + Removed bsr, jsr, branch_cs, and ret opcodes
+  + Removed global stacks system
+  + Changed OPS file format to include explicit preamble
+  + Changed all "new 'Iterator'" instructions into 'iter' instructions
+  + Removed Configure.pl options for specifying non-working GC cores
+  + Removed unexecuting code as found by Coverity
+  + Improvements to the Parrot Debugger
+  + Added experimental fixed-size structure allocator to the GC
+  + Added experimental lazy arena allocation to the GC
+  + Refactored hashes, keys, and iterators
+  + Added "corevm" make target to build Parrot without all the supporting libraries
+  + Removed Random PMC type and added in a "rand" dynop
+  + Optimization and Improvements to the NCI thunk generator
+  + New include file libpaths.pasm
+- Compilers
+  + Multiple .local with same name and different type is now an error on IMCC.
+- Platforms
+  + Improved support for detecting Fink and Macports
+  + Updated search directories for libraries
+- Documentation
+  + "Parrot Developers Guide: PIR" released to publisher and available to purchase
+  + Improved documentation about Parrot Debugger
+  + Update PGE Documentation
+- Miscellaneous
+  + Deprecate 'PASM1' compiler object, update to warn instead of segfault
+  + Added tests
+  + Fixes to code, documentation, and standards
+
+New in 1.4.0
+- Core
+  + Key and Iterator refactor
+  + Major pbc_to_exe generated code speed improvement
+  + New "Infinite Memory" GC core for demonstration purposes
+  + gc_debug runcore and GC-related heisenbug fixes
+  + Elimination of variable expansion in parrot_config
+  + CLI arguments are processed as Unicode by default
+  + Substantial optimizations in NCI
+  + Parrot builds on Win64
+  + Hashes can use native types as keys and values
+  + Fixed installed pbc_to_exe
+  + Simplification of PMC generation code
+  + Improved GC encapsulation and API documentation
+- Documentation
+  + List of candidates for embedding API (docs/embed.pod)
+  + PIR book sent to publisher
+- Testing
+  + Several conversions of Perl test to pure PIR.
+  + C indentation coding standards test improvement
+  + Improved test coverage of example code
+- Deprecations
+  + Removal of PGE rules: <null> <fail> <sp> <lt> <gt> <dot>
+  + Removal of PGE methods: .text .item .result_object
+  + Deprecation of most dynops
++ Miscellaneous
+  + Beginnings of OpenGL::Math library; OpenGL bindings and library marked experimental
+  + Localizing and consting fixes
+  + Many memory and thread-related leaks plugged
+
 New in 1.3.0
 - Core
   + Optimized parts of the IO system

Modified: branches/orderedhash_revamp/PBC_COMPAT
==============================================================================
--- branches/orderedhash_revamp/PBC_COMPAT	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/PBC_COMPAT	Sat Jan 23 01:49:53 2010	(r43541)
@@ -27,15 +27,14 @@
 
 # please insert tab separated entries at the top of the list
 
-4.9	2009.07.16	bacek	Bump revision after merging keys_revamp branch. A lot of *Iterator PMCs were added.
-4.8	2009.05.30	Infinoid	Added Handle PMC
-4.7	2009.05.29	cotto	add cmp_pmc opcode (also, addition of setstdin and root_new in previous commits)
-4.6	2009.05.18	bacek	removed PackfileAnnotationKeys PMC
-4.5	2009.04.10	cotto	removed Ref and SharedRef PMCs
-4.4	2009.04.07	pmichaud	find_caller_lex added
-4.3	2009.03.25	jonathan	socket opcodes added
-4.2	2009.03.21	cotto	removed Bound_NCI PMC
-4.1	2009.03.17	cotto	removed Slice PMC
+5.6	2009.12.12	bacek	merge CallSignature and Context
+5.5	2010.01.01	plobsing	change prophash handling
+5.4	2009.12.02	bacek	remove CallSignatureReturns
+5.3	2009.10.23	bacek	add CallSignatureReturns
+5.2	2009.09.16	darbelo	remove pic.ops
+5.2	2009.08.06	dukeleto	remove Random PMC
+5.1	2009.08.06	cotto	remove branch_cs opcode
+5.0	2009.07.21	cotto	released 1.4.0
 4.0	2009.03.17	allison	released 1.0.0
 3.0	2007.07.23	jonathan	implementing new PBC header format
 2.0	2005.11.22	leo	changed PBC format (HLL_info)

Modified: branches/orderedhash_revamp/PLATFORMS
==============================================================================
--- branches/orderedhash_revamp/PLATFORMS	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/PLATFORMS	Sat Jan 23 01:49:53 2010	(r43541)
@@ -3,67 +3,68 @@
 Parrot was reported to compile and run tests successfully on the following
 platforms.
 See also http://www.parrot.org/smolder for recent test results.
-See also t/TESTS.STATUS.pod about the status of the test suite.
+See also t/TESTS_STATUS.pod about the status of the test suite.
 
 This list is divided into 2 sections: "Supported" (as defined by
 docs/parrot.pod) and "Extra".
 
 
 Supported platforms:
-Platform                     B8    Runloops      Feature Comp Test Inst YYYYMMDD
-                                CGoto JIT EXEC   Thr Sig
+Platform                     B8  Runloops   Feature Comp Test Inst YYYYMMDD
+                                CGoto EXEC   Thr Sig
 --------------------------------------------------------------------------------
-cygwin1.5.25-x86-gcc3.4.4     4   Y    Y    -     -   -   Y    Y     Y  20090315
-darwin8.11.1-x86-gcc4.0.1    ??   ?    N    ?     ?   ?   Y    Y*3   Y  20090420
-linux-x86-gcc4.1.2                Y    Y    ?     Y   Y   Y    Y     ?  20090419
-linux-x86-gcc4.1.3                Y    Y    ?     Y   Y   Y    Y     ?  20080414
-linux-x86-gcc4.2.3                Y    Y    ?     Y   Y   Y    Y     ?  20080715
-linux-x86-gcc4.2.4                Y    Y    ?     Y   Y   Y    Y     ?  20081023
-linux-x86-gcc4.3.2                Y    Y    ?     Y   Y   Y    Y     ?  20081030
-linux-x86-llvm-gcc-4.2            Y    Y    ?     ?   ?   Y    Y     ?  20090514
-sol10-sparc-cc_5.9           B4   Y    -    -     Y   Y   Y    Y     ?  20090419
-sol10-sparc-cc_5.9           B8   Y    -    -     Y   Y   Y    Y     ?  20090419
-sol10-sparc-gcc_4.0.2        B4   Y    -    -     Y   Y   Y    Y/1   ?  20080510
-sol10-sparc-gcc_4.0.2        B8   Y    -    -     Y   Y   Y    Y/2   ?  20080518
-win32-x86-mingw_gcc3.4.5          Y    Y    -     -   -   Y    Y     Y  20090421
-win32-x86-msvc_9.0                -    Y    -     Y   -   Y    Y     ?  20090317
+cygwin1.5.25-x86-gcc3.4.4     4   Y    -     -   -   Y    Y     Y  20090315
+darwin8.11.1-x86-gcc4.0.1    ??   Y    ?     ?   ?   Y    Y     N  20091020
+linux-x86-gcc4.1.2                Y    ?     Y   Y   Y    Y     ?  20090419
+linux-x86-gcc4.2.4                Y    ?     Y   Y   Y    Y     ?  20081023
+linux-x86-gcc4.3.2                Y    ?     Y   Y   Y    Y     ?  20081030
+linux-x86-gcc4.4.1                Y    ?     Y   Y   Y    Y     ?  20091103
+linux-x86-g++4.4.1                Y    ?     Y   Y   Y    Y     Y  20091116
+linux-x86-llvm-gcc-4.2            Y    ?     ?   ?   Y    Y     ?  20091021
+sol10-sparc-cc_5.9           B4   Y    -     Y   Y   Y    Y     ?  20090720
+sol10-sparc-cc_5.9           B8   Y    -     Y   Y   Y    Y     ?  20090720
+win32-x86-mingw_gcc3.4.5          Y    -     -   -   Y    N/1   ?  20091116
+win32-x86-msvc_9.0                -    -     Y   -   Y    Y     Y  20091215
 
 
 Extra Platforms:
 
-Platform                     B8    Runloops      Feature Comp Test Inst YYYYMMDD
-                                CGoto JIT EXEC   Thr Sig
+Platform                     B8  Runloops   Feature Comp Test Inst YYYYMMDD
+                                CGoto EXEC   Thr Sig
 --------------------------------------------------------------------------------
-aix5.3-power-gcc4.2          B8   -    -    -             Y    ?     ?  20080510
-cygwin1.7.0-x86-gcc4.3.2      4   Y    Y    -     -   -   Y    Y     Y  20090315
-dragonfly2.2.0-i386-gcc-4.1.2 4   Y    Y    -     Y   Y   Y    Y     ?  20090427
-freebsd-x86-gcc-4.2.1         4   Y    Y    Y     ?   ?   Y    Y     Y  20090415
-freebsd-amd64-gcc-4.2.1       8   Y    -    -     ?   ?   Y    Y     Y  20090419
-linux-amd64-clang-r73854      8   ?    ?    =     Y   Y   Y/4  Y/1   ?  20090622
-linux-amd64-clang-r75433      8   Y    N    ?     ?   ?   Y    Y     ?  20090712
-linux-ppc-gcc3.4.5                Y    Y    Y     ?   ?   Y    Y     ?  20080519
-linux-s390x-gcc4.1.2         B4   ?    -    -     Y   Y   Y    Y/2   ?  20080908
-linux-amd64-gcc4.1.2          8   Y    -    -     Y   Y   Y    Y     ?  20080220
-linux-amd64-gcc4.3.2          8   Y    -    -     Y   Y   Y    Y     ?  20081118
-linux-amd64-gcc4.3.3          8   Y    Y    ?     Y   Y   Y    Y     ?  20090712
-netbsd3.1-ppc-gcc-3.3.3       B   Y    Y    ?     Y   Y   Y    Y     ?  20090419
-netbsd4.0-alpha-gcc-4.1.2     8   Y    -    ?     Y   Y   Y    Y     ?  20090518
-netbsd4.0-arm-gcc-4.1.2           Y    -    ?     Y   Y   Y    Y     ?  20090518
-netbsd4.0-i386-gcc-4.1.2          Y    Y    ?     Y   Y   Y    Y     ?  20090517
-netbsd4.0-ppc-gcc-4.1.2       B   Y    Y    ?     Y   Y   Y    Y     ?  20090519
-netbsd4.0-sparc64-gcc-4.1.2  B8   Y    -    -     Y   Y   Y    Y     ?  20090519
-netbsd4.0-x86_64-gcc-4.1.2    8   Y    -    ?     Y   Y   Y    Y     ?  20090519
-netbsd5.0-i386-gcc-4.1.3          Y    Y    ?     Y   Y   Y    Y     ?  20090519
-netbsd5.0-ppc-gcc-4.1.3       B   Y    Y    ?     Y   Y   Y    Y     ?  20090517
-netbsd5.0-mipseb32-gcc-4.1.3  B   Y    -    ?     Y   Y   Y    Y     ?  20090518
-netbsd5.0-sparc-gcc-4.1.3     B   Y    -    -     Y   Y   Y    Y     ?  20090519
-netbsd5.0-sparc64-gcc-4.1.3  B8   Y    -    -     Y   Y   Y    Y/1   ?  20090519
-netbsd5.0-x86_64-gcc-4.1.3    8   Y    -    -     Y   Y   Y    Y     ?  20090419
-opensolaris-x86-gcc_4.0.3     4   Y    Y    ?     ?   ?   Y    Y/2   ?  20080325
-win32-x86-mingw_gcc4.3.0          Y    Y    -     -   -   Y    Y/88  ?  20081203
-win32-x86-msvc_6.0            4   -    Y    -     -   -   Y    Y/8   ?  20090315
-win32-x64-msvc_9.0            8   -    -    -     -   -   Y    Y/51  ?  20081203
-win32-x64-mingw_gcc3.4.5      8   Y    Y    ?     ?   ?   Y    Y     ?  20090210
+cygwin1.7.0-x86-gcc4.3.2      4   Y    -     -   -   Y    Y     Y  20090315
+dragonfly2.2.0-i386-gcc-4.1.2 4   Y    -     Y   Y   Y    Y     ?  20090427
+freebsd-x86-gcc-4.2.1         4   Y    Y     ?   ?   Y    Y     Y  20090415
+freebsd-amd64-gcc-4.2.1       8   Y    -     ?   ?   Y    Y     Y  20090720
+linux-amd64-clang-r73854      8   ?    =     Y   Y   Y/4  Y/1   ?  20090622
+linux-amd64-clang-r75433      8   Y    ?     ?   ?   Y    Y*2   ?  20090913
+linux-amd64-gcc4.3.2          8   Y    -     Y   Y   Y    Y/1   Y  20091020
+linux-amd64-gcc4.3.3          8   Y    ?     Y   Y   Y    Y     ?  20090712
+linux-amd64-gcc4.4.1          8   Y    ?     Y   Y   Y    Y     Y  20091020
+linux-amd64-g++4.4.1          8   Y    ?     Y   Y   Y    Y     Y  20091116
+linux-ppc-gcc_4.4.2               Y    Y     Y   Y   Y    Y     Y  20100118
+linux-ppc64-gcc_4.4.2             Y    Y     Y   Y   Y    Y     Y  20100118
+linux-arm-gcc_4.4.2               Y    Y     Y   Y   Y    Y     Y  20100118
+netbsd3.1-ppc-gcc-3.3.3       B   Y    ?     Y   Y   Y    Y     ?  20090419
+netbsd4.0-alpha-gcc-4.1.2     8   Y    ?     Y   Y   Y    Y     ?  20090518
+netbsd4.0-arm-gcc-4.1.2           Y    ?     Y   Y   Y    Y     ?  20090518
+netbsd4.0-i386-gcc-4.1.2          Y    ?     Y   Y   Y    Y     ?  20090517
+netbsd4.0-ppc-gcc-4.1.2       B   Y    ?     Y   Y   Y    Y     ?  20090519
+netbsd4.0-sparc64-gcc-4.1.2  B8   Y    -     Y   Y   Y    Y     ?  20090519
+netbsd4.0-x86_64-gcc-4.1.2    8   Y    ?     Y   Y   Y    Y     ?  20090519
+netbsd5.0-i386-gcc-4.1.3          Y    ?     Y   Y   Y    Y     ?  20090519
+netbsd5.0-ppc-gcc-4.1.3       B   Y    ?     Y   Y   Y    Y     ?  20090517
+netbsd5.0-mipseb32-gcc-4.1.3  B   Y    ?     Y   Y   Y    Y     ?  20090518
+netbsd5.0-sparc-gcc-4.1.3     B   Y    -     Y   Y   Y    Y     ?  20090519
+netbsd5.0-sparc64-gcc-4.1.3  B8   Y    -     Y   Y   Y    Y/1   ?  20090519
+netbsd5.0-x86_64-gcc-4.1.3    8   Y    -     Y   Y   Y    Y     ?  20090419
+opensol2009.06-x86-gcc3.4.3   4   ?    ?     ?   ?   Y    Y/2   Y  20091215
+win32-x86-mingw_gcc4.3.0          Y    -     -   -   Y    Y/88  ?  20081203
+win32-x86-msvc_6.0            4   -    -     -   -   Y    Y/8   ?  20090315
+win32-x64-msvc_9.0            8   -    -     -   -   Y    Y/17  ?  20091020
+win32-x64-mingw_gcc3.4.5      8   Y    ?     ?   ?   Y    Y     ?  20090210
+win64-amd64-msvc_9.0          8   N    N     ?   ?   Y*1  N     ?  20090720
+
 
 Legend:
 ?   ... unknown or untested
@@ -91,12 +92,9 @@
 YYYYMMDD  The date tested.
 
 Remarks:
-*1 gcc and cc defaults to 32bits on solaris, for 64bit use
-   --ccflags='-m64' --ldflags='-m64' --linkflags='-m64'
-*2 http://rt.perl.org/rt3/Ticket/Display.html?id=60926
-*3 failures in 'make examples_tests' (part of 'make fulltest')
-*4 compiles with --ccflags=-U__APPLE_CC__ --without-gmp
-   See http://lists.parrot.org/pipermail/parrot-dev/2009-June/002407.html
+*1 64-bit MSVC uses 32-bit int and long values. For 64-bit use
+   --ccflags="-GS- -MD" --intval="long long" --opcode="long long"
+*2 only builds when configured --without-gmp. See TT #1006
 
 The following configurations are also working on x86/linux (and possibly
 other platforms):

Modified: branches/orderedhash_revamp/README
==============================================================================
--- branches/orderedhash_revamp/README	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/README	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,4 +1,4 @@
-This is Parrot, version 1.3.0
+This is Parrot, version 1.9.0
 ------------------------------
 
 Parrot is Copyright (C) 2001-2009, Parrot Foundation.
@@ -14,17 +14,17 @@
 PREREQUISITES
 -------------
 
-You need a C compiler, a linker, and a make program of course. If you will be
-linking with the ICU library you have to download and install it before
-configuring Parrot.
+You need a C compiler, a linker, and a make program of course.
 
-Get it from http://site.icu-project.org/download
+If you will be linking with the ICU library you have to download and install it before
+configuring Parrot. Get it from http://site.icu-project.org/download
 
-You also need Perl 5.8.4 or newer, Storable 2.12 or newer, and Bundle::Parrot
-to run various configure and build scripts.
+You also need Perl 5.8.4 or newer, and Storable 2.12 or newer
+for running various configure and build scripts.
 
 For most of the platforms that we are supporting initially, Parrot should build
-out of the box.  PLATFORM lists our target platforms.
+out of the box. docs/parrot.pod lists the core platforms.
+PLATFORMS provides reports on the platforms on which Parrot has been built and tested. 
 
 INSTRUCTIONS
 ------------
@@ -85,6 +85,13 @@
 But please note that dynamic libs will not be found for non-standard
 locations unless you set LD_LIBRARY_PATH or similar.
 
+If you want to build high level languages on top of Parrot, you should
+also run
+
+    make install-dev
+
+to install development files which compilers need in their build process.
+
 Look at docs/parrot.pod and docs/intro.pod for where to go from here.  If you
 have any problems, see the section "How To Submit A Bug Report" in
 docs/submissions.pod.  These documents are in POD format. You can view these

Modified: branches/orderedhash_revamp/README_cygwin.pod
==============================================================================
--- branches/orderedhash_revamp/README_cygwin.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/README_cygwin.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -139,8 +139,6 @@
 
 =item Spurious stackdumps while building
 
-Building with an already installed library fails. See RT#39742
-
 Be sure that there's no other libparrot.dll.a or libparrot.a
 in the linker libpath.
 

Modified: branches/orderedhash_revamp/README_win32.pod
==============================================================================
--- branches/orderedhash_revamp/README_win32.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/README_win32.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -68,7 +68,7 @@
 Configure.pl to use it.
 
     mkdir C:\usr\lib
-    unzip icu4c-4_2-Win32-msvc9.zip -d C:\usr\lib
+    unzip icu4c-4_2_1-Win32-msvc9.zip -d C:\usr\lib
     mkdir C:\usr\lib\data
     set PATH=%PATH%;C:\usr\lib\icu\bin
     cd <parrot directory>
@@ -122,7 +122,7 @@
 
 Inno Setup is a I<free> installer for Windows programs.
 
-The latest release of Inno Setup at the time of writing is 5.2.3.
+The latest release of Inno Setup at the time of writing is 5.3.7.
 
 The HomePage is on L<http://www.jrsoftware.org/>.
 
@@ -165,10 +165,10 @@
 
 =item MinGW32 with GCC
 
-The latest release of MinGW package at the time of writing is 5.1.3,
+The latest release of MinGW package at the time of writing is 5.1.6,
 which contains gcc-3.4.5 as current release.
 It can be downloaded here:
-L<http://downloads.sourceforge.net/mingw/MinGW-5.1.3.exe>
+L<http://sourceforge.net/projects/mingw/files/>
 
 The HomePage is on L<http://www.mingw.org/>.
 

Modified: branches/orderedhash_revamp/RESPONSIBLE_PARTIES
==============================================================================
--- branches/orderedhash_revamp/RESPONSIBLE_PARTIES	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/RESPONSIBLE_PARTIES	Sat Jan 23 01:49:53 2010	(r43541)
@@ -7,8 +7,7 @@
 for.
 
 See docs/project/roles_responsibilities.pod for role definitions, and
-https://trac.parrot.org/parrot/wiki/Languages for more language
-authors/maintainers.
+https://trac.parrot.org/parrot/wiki/Languages for language authors/maintainers.
 
 
 Project Team
@@ -26,6 +25,9 @@
                                 Klaas-Jan Stol
                                 Francois Perrad
                                 Mark Glines
+                                Christoph Otto
+                                Jonathan Leto
+                                Gerd Pokorra
 
 Metacommitter                   Allison Randal
                                 Jerry Gay
@@ -49,21 +51,13 @@
                                 Julian Albo
                                 Mark Glines
                                 Vasily Chekalkin
+                                Jonathan Leto
 
 Compiler Developer              Patrick Michaud (PGE, PCT)
                                 Allison Randal (TGE)
                                 Klaas-Jan Stol (PIRC)
 
-High Level Language Developer   Patrick Michaud (Perl 6, NQP)
-                                Will Coleda (Tcl)
-                                Stephen Weeks (Cardinal (Ruby), Lolcode)
-                                Francois Perrad (Lua, Pipp (PHP))
-                                Bernhard Schmalhofer (Pipp (PHP), Eclectus (Scheme))
-                                Kevin Tew (Cardinal (Ruby))
-                                Christoph Otto (Pipp (PHP))
-
 Platform Porter                 Allison Randal (Debian, Ubuntu)
-                                Aldo Calpini (PocketPC)
                                 Francois Perrad (MinGW32)
                                 Reini Urban (cygwin)
                                 Will Coleda (MacPorts)
@@ -79,6 +73,7 @@
                                 Christoph Otto
                                 Julian Albo
                                 Mark Glines
+                                Jonthan Leto
 
 
 Contributors

Modified: branches/orderedhash_revamp/TODO
==============================================================================
--- branches/orderedhash_revamp/TODO	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/TODO	Sat Jan 23 01:49:53 2010	(r43541)
@@ -8,7 +8,3 @@
 
  https://trac.parrot.org/
 
-Note that we are still transitioning away from RT. To see what todos remain
-in our old tracking system, use:
-
- http://www.parrotcode.org/todo

Modified: branches/orderedhash_revamp/VERSION
==============================================================================
--- branches/orderedhash_revamp/VERSION	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/VERSION	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1 +1 @@
-1.3.0
+1.9.0

Added: branches/orderedhash_revamp/compilers/data_json/data_json.pir
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/compilers/data_json/data_json.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,93 @@
+# Copyright (C) 2005-2008, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+data_json - parse JSON, a lightweight data-interchange format.
+
+=head1 SYNOPSIS
+
+Given a valid JSON (JavaScript Object Notation) string, the compiler will
+return a sub that when called will produce the appropriate values.  For
+example:
+
+    .local pmc json, code, result
+    json   = compreg 'data_json'
+    code   = json.'compile'('[1,2,3]')
+    result = code()
+
+will create a PMC that C<does> C<array> containing the values 1, 2, and 3,
+and store it in the C<result>.
+
+For more information about the structure of the JSON representation, see
+the documentation at L<http://www.json.org/>.
+
+=cut
+
+.HLL 'data_json'
+
+.sub '__onload' :load
+    load_bytecode 'PGE.pbc'
+    load_bytecode 'PGE/Util.pbc'
+    load_bytecode 'TGE.pbc'
+
+    $P1 = newclass ['JSON'; 'Compiler']
+    $P2 = new $P1
+    compreg 'data_json', $P2
+
+    $P1 = new 'Hash'
+    $P1['\"'] = '"'
+    $P1['\\'] = "\\"
+    $P1['\/'] = '/'
+    $P1['\b'] = "\b"
+    $P1['\f'] = "\f"
+    $P1['\n'] = "\n"
+    $P1['\r'] = "\r"
+    $P1['\t'] = "\t"
+
+    set_root_global ['parrot'; 'data_json'], '$escapes', $P1
+.end
+
+
+.namespace ['JSON';'Compiler']
+
+.sub 'compile' :method
+    .param string json_string
+
+    .local pmc parse, match
+    parse = get_root_global ['parrot'; 'JSON'], 'value'
+
+    $P0 = get_root_global ['parrot'; 'PGE'], 'Match'
+    match = $P0.'new'(json_string)
+    match.'to'(0)
+    match = parse(match)
+    unless match goto failed
+
+    .local pmc pirgrammar, pirbuilder, pir
+    pirgrammar = new ['JSON'; 'PIR']
+    pirbuilder = pirgrammar.'apply'(match)
+    pir = pirbuilder.'get'('result')
+
+    .local pmc pirc, result
+    pirc = compreg 'PIR'
+    result = pirc(pir)
+    .return (result)
+
+  failed:
+    $P0 = new 'Exception'
+    $P0[0] = "Invalid JSON value"
+    throw $P0
+.end
+
+
+.HLL 'parrot'
+
+.include 'compilers/data_json/data_json/grammar.pir'
+.include 'compilers/data_json/data_json/pge2pir.pir'
+
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Added: branches/orderedhash_revamp/compilers/data_json/data_json/grammar.pg
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/compilers/data_json/data_json/grammar.pg	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,38 @@
+# From http://www.json.org/
+
+grammar JSON;
+
+rule object { '{' <members>?  '}' }
+rule array  { '[' ']' | '[' <elements> ']' }
+rule string { \"<char>*\" }
+
+rule  members { <string> ':' <value> [',' <string> ':' <value> ]* }
+
+rule  elements { <value> [',' <value> ]* }
+
+token value {
+  | <object>
+  | <array>
+  | <string>
+  | <number>
+  | true
+  | false
+  | null
+  | <?PGE::Util::die 'not a valid JSON value'>
+}
+
+# XXX need to add "except control char" to the final charclass here.
+token char {
+  | \\<["\\/bfnrt]>
+  | \\u<xdigit>**{4}
+  | <-[\\"]>
+}
+
+token number {
+ <.ws>
+ '-'?
+ [ <[1..9]> <[0..9]>+ | <[0..9]> ]
+ [ '.' <[0..9]>+ ]?
+ [ <[Ee]> <[+\-]>? <[0..9]>+ ]?
+ <.ws>
+}

Added: branches/orderedhash_revamp/compilers/data_json/data_json/pge2pir.tg
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/compilers/data_json/data_json/pge2pir.tg	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,210 @@
+grammar JSON::PIR is TGE::Grammar;
+
+transform result (ROOT) {
+    .local pmc pir
+    .local string result
+
+    $S0 = tree.'get'('pir', node, 'value')
+
+    pir = new 'CodeString'
+    pir.'emit'('.sub anon :anon')
+    pir.'emit'($S0)
+    result = node['ret']
+    pir.'emit'('    .return (%0)',result)
+    pir.'emit'('.end')
+
+   .return(pir)
+}
+
+transform pir (value) {
+
+    .local pmc sub_node, transform_result
+    .local pmc pir, result
+    .local string value, type
+
+    type = 'string'
+    sub_node = node[type]
+    unless null sub_node goto got_type
+
+    type = 'number'
+    sub_node = node[type]
+    unless null sub_node goto got_type
+
+    type = 'object'
+    sub_node = node[type]
+    unless null sub_node goto got_type
+
+    type = 'array'
+    sub_node = node[type]
+    unless null sub_node goto got_type
+
+    value = node
+    if value == 'true'  goto got_true
+    if value == 'false' goto got_false
+    if value == 'null'  goto got_null
+
+    .return ('') # should never reach this.
+
+  got_type:
+    pir = tree.'get'('pir', sub_node, type)
+    $S0 = sub_node['ret']
+    node['ret'] = $S0
+    .return (pir)
+
+  got_true:
+    pir = new 'CodeString'
+    result = pir.'unique'('$P')
+    $S0 = node
+    pir.'emit'("    %0 = new 'Boolean'", result)
+    pir.'emit'('    %0 = 1', result, $S0)
+    node['ret'] = result
+    .return(pir)
+
+  got_false:
+    pir = new 'CodeString'
+    result = pir.'unique'('$P')
+    $S0 = node
+    pir.'emit'("    %0 = new 'Boolean'", result)
+    pir.'emit'('    %0 = 0', result, $S0)
+    node['ret'] = result
+    .return(pir)
+
+  got_null:
+    pir = new 'CodeString'
+    result = pir.'unique'('$P')
+    $S0 = node
+    pir.'emit'('    null %0', result)
+    node['ret'] = result
+    .return(pir)
+}
+
+transform pir (object) {
+    .local pmc pir
+    pir = new 'CodeString'
+    .local string result, child_result, key_result
+    result = pir.'unique'('$P')
+    pir.'emit'("    %0 = new 'Hash'", result)
+
+    .local pmc items
+
+    items = node['members']
+    if null items goto end
+
+    items = items[0]
+
+    .local pmc keys
+    keys  = items['string']
+    items = items['value']
+
+    .local pmc it, key_iter, child, key
+    key_iter = iter keys
+    it       = iter items
+
+    # the two iters should be in lockstep as a result of the PGE grammar
+loop:
+    unless it goto end
+    child = shift it
+    $P0 = tree.'get'('pir', child, 'value')
+    $S0 = $P0
+    pir .= $S0
+    child_result = child['ret']
+
+    key   = shift key_iter
+    $P0 = tree.'get'('pir', key, 'string')
+    $S0 = $P0
+    pir .= $S0
+    key_result = key['ret']
+
+    pir.'emit'('    %0[%1] = %2', result, key_result, child_result)
+
+
+    goto loop
+end:
+    node['ret'] = result
+
+   .return (pir)
+}
+
+transform pir (array) {
+    .local pmc pir
+    pir = new 'CodeString'
+    .local string result, child_result
+    result = pir.'unique'('$P')
+    pir.'emit'("    %0 = new 'ResizablePMCArray'", result)
+
+    .local pmc items
+
+
+    items = node['elements']
+    if null items goto end
+
+    items = items['value']
+
+    .local pmc it, child
+    it = iter items
+loop:
+    unless it goto end
+    child = shift it
+    $P0 = tree.'get'('pir', child, 'value')
+    $S0 = $P0
+    pir .= $S0
+
+    child_result = child['ret']
+    pir.'emit'('    push %0, %1', result, child_result)
+    goto loop
+end:
+    node['ret'] = result
+
+   .return (pir)
+}
+
+transform pir (string) {
+    .local pmc pir, result, children, it, child
+    .local string tmp
+    tmp = ''
+    pir = new 'CodeString'
+    children = node['char']
+    if null children goto loop_end
+    it = iter children
+  loop:
+    push_eh loop_end
+      child = shift it
+    pop_eh
+    unless child goto loop_end
+    $S0 = child
+    $I0 = length $S0
+    if $I0 == 1 goto char
+    if $I0 == 2 goto escape
+  unicode:
+    $P1 = new 'String'
+    $S1 = substr $S0, 2, 4
+    $P1 = $S1
+    $I0 = $P1.'to_int'(16)
+    $S0 = chr $I0
+    goto char
+  escape:
+    $P0 = get_root_global ['parrot'; 'data_json'], '$escapes'
+    $S0 = $P0[$S0]
+  char:
+    tmp .= $S0
+    goto loop
+  loop_end:
+
+    result = pir.'unique'('$P')
+    $S1 = pir.'escape'(tmp)
+    pir.'emit'("    %0 = new 'String'", result)
+    pir.'emit'('    %0 = %1', result, $S1)
+    node['ret'] = result
+   .return(pir)
+}
+
+transform pir (number) {
+    .local pmc pir, result
+    pir = new 'CodeString'
+    result = pir.'unique'('$P')
+    $S0 = node
+    pir.'emit'("    %0 = new 'Integer'", result)
+    pir.'emit'('    %0 = %1', result, $S0)
+    node['ret'] = result
+   .return(pir)
+}

Modified: branches/orderedhash_revamp/compilers/imcc/cfg.c
==============================================================================
--- branches/orderedhash_revamp/compilers/imcc/cfg.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/imcc/cfg.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -144,56 +144,56 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-#define ASSERT_ARGS_analyse_life_block __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_analyse_life_block __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(bb) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_analyse_life_symbol __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_analyse_life_symbol __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_bb_add_edge __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_bb_add_edge __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(from) \
-    || PARROT_ASSERT_ARG(to)
-#define ASSERT_ARGS_bb_check_set_addr __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(from) \
+    , PARROT_ASSERT_ARG(to))
+#define ASSERT_ARGS_bb_check_set_addr __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(bb) \
-    || PARROT_ASSERT_ARG(label)
-#define ASSERT_ARGS_bb_findadd_edge __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(bb) \
+    , PARROT_ASSERT_ARG(label))
+#define ASSERT_ARGS_bb_findadd_edge __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(from) \
-    || PARROT_ASSERT_ARG(label)
-#define ASSERT_ARGS_bb_remove_edge __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(from) \
+    , PARROT_ASSERT_ARG(label))
+#define ASSERT_ARGS_bb_remove_edge __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(edge)
-#define ASSERT_ARGS_check_invoke_type __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(edge))
+#define ASSERT_ARGS_check_invoke_type __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(ins)
-#define ASSERT_ARGS_free_dominance_frontiers __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_free_dominators __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_free_edge __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_free_loops __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_init_basic_blocks __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_make_basic_block __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(ins))
+#define ASSERT_ARGS_free_dominance_frontiers __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_free_dominators __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_free_edge __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_free_loops __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_init_basic_blocks __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_make_basic_block __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(ins)
-#define ASSERT_ARGS_mark_loop __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(ins))
+#define ASSERT_ARGS_mark_loop __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(e)
-#define ASSERT_ARGS_propagate_need __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(e))
+#define ASSERT_ARGS_propagate_need __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(bb) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_sort_loops __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_sort_loops __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
+    , PARROT_ASSERT_ARG(unit))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -278,10 +278,9 @@
         }
     }
 
-    /* RT #48280: Now the way to check for a sub is unit->type */
     ins = unit->instructions;
 
-    if (first && ins->type == ITLABEL && (ins->symregs[0]->type & VT_PCC_SUB)) {
+    if (unit->type & IMC_PCCSUB) {
         IMCC_debug(interp, DEBUG_CFG, "pcc_sub %s nparams %d\n",
                 ins->symregs[0]->name, ins->symregs[0]->pcc_sub->nargs);
         expand_pcc_sub(interp, unit, ins);
@@ -304,7 +303,6 @@
 
         if (ins->opnum == -1 && (ins->type & ITPCCSUB)) {
             if (first) {
-                /* RT #48280: Now the way to check for a sub is unit->type */
                 if (ins->type & ITLABEL) {
                     expand_pcc_sub_ret(interp, unit, ins);
                     ins->type &= ~ITLABEL;
@@ -417,7 +415,6 @@
 
     for (i = 0; i < unit->n_basic_blocks; i++) {
         Basic_block * const bb = unit->bb_list[i];
-        Edge               *pred;
         SymReg             *addr;
 
         /* if the block can fall-through */
@@ -439,74 +436,6 @@
                 bb_add_edge(unit, bb, unit->bb_list[0]);
         }
 
-        if (STREQ(bb->end->opname, "ret")) {
-            Instruction *sub;
-            IMCC_debug(interp, DEBUG_CFG, "found ret in bb %d\n", i);
-
-            /* now go back, find labels and connect these with bsrs */
-
-            /* this doesn't work, if this is a local backward sub call
-             * the bsr isn't chained yet so the pred_list is empty
-             *
-             * s. #25948
-             */
-            if (!bb->pred_list) {
-                unsigned int j;
-
-                for (j = i; j < unit->n_basic_blocks; j++) {
-                    Basic_block * const b_bsr = unit->bb_list[j];
-
-                    if (STREQ(b_bsr->end->opname, "bsr")) {
-                        SymReg *addr = get_branch_reg(b_bsr->end);
-
-                        if (addr)
-                            bb_findadd_edge(interp, unit, b_bsr, addr);
-                    }
-                }
-            }
-            /* end #25948 */
-
-            for (pred = bb->pred_list; pred; pred = pred->next) {
-                int found = 0;
-
-                if (STREQ(pred->from->end->opname, "bsr")) {
-                    int j;
-                    {
-                        SymReg * const r = pred->from->end->symregs[0];
-                        sub              = pred->to->start;
-
-                        if ((sub->type & ITLABEL)
-                        &&   STREQ(sub->symregs[0]->name, r->name))
-                            found = 1;
-                    }
-invok:
-                    j = pred->from->index;
-
-                    if (found) {
-                        IMCC_debug(interp, DEBUG_CFG,
-                                "\tcalled from bb %d '%I'\n",
-                                j, pred->from->end);
-
-                        for (; sub && sub != bb->end; sub = sub->next) {
-                            unit->bb_list[sub->bbindex]->flag |= BB_IS_SUB;
-                        }
-
-                        bb_add_edge(unit, bb, unit->bb_list[j + 1]);
-
-                        IMCC_debug(interp, DEBUG_CFG, "\tand does saveall no\n");
-                    }
-                }
-                else if (STREQ(pred->from->end->opname, "invoke")) {
-                    found = 1;
-                    sub   = pred->to->start;
-                    goto invok;
-                }
-
-                if (!found)
-                    IMCC_debug(interp, DEBUG_CFG, "\tcalled from unknown!\n");
-            }
-        }
-
         last = bb;
     }
 
@@ -560,8 +489,6 @@
         bb_add_edge(unit, from, unit->bb_list[r->first_ins->bbindex]);
     else {
         IMCC_debug(interp, DEBUG_CFG, "register branch %I ", from->end);
-        /* RT #48282 is probably only ok, if the invoke is "near" the
-         *     set_addr ins */
         for (ins = from->end; ins; ins = ins->prev) {
             if ((ins->type & ITBRANCH)
             &&   STREQ(ins->opname, "set_addr")
@@ -1005,7 +932,7 @@
                  * path where the var is not initialized, so this might even be
                  * correct :)
                  *
-                 * RT #48286 subroutines
+                 * TT #1244: emit warning in propagate_need()
                  */
 #if 0
                 if (pred->index == 0) {
@@ -1573,10 +1500,10 @@
 void
 search_predecessors_not_in(ARGIN(const Basic_block *node), ARGMOD(Set *s))
 {
-   ASSERT_ARGS(search_predecessors_not_in)
-   Edge *edge;
+    ASSERT_ARGS(search_predecessors_not_in)
+    Edge *edge;
 
-   for (edge = node->pred_list; edge; edge = edge->pred_next) {
+    for (edge = node->pred_list; edge; edge = edge->pred_next) {
         Basic_block * const pred = edge->from;
 
         if (!set_contains(s, pred->index)) {
@@ -1584,7 +1511,7 @@
            pred->loop_depth++;
            search_predecessors_not_in(pred, s);
         }
-   }
+    }
 }
 
 /*** Utility functions ***/

Modified: branches/orderedhash_revamp/compilers/imcc/cfg.h
==============================================================================
--- branches/orderedhash_revamp/compilers/imcc/cfg.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/imcc/cfg.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -45,7 +45,6 @@
 
 
 /* Functions: */
-struct _IMC_Unit;
 
 /* HEADERIZER BEGIN: compilers/imcc/cfg.c */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
@@ -119,42 +118,42 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*s);
 
-#define ASSERT_ARGS_blocks_are_connected __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_blocks_are_connected __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(from) \
-    || PARROT_ASSERT_ARG(to)
-#define ASSERT_ARGS_build_cfg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(to))
+#define ASSERT_ARGS_build_cfg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_clear_basic_blocks __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_compute_dominance_frontiers __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_compute_dominators __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_edge_count __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_find_basic_blocks __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_clear_basic_blocks __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_compute_dominance_frontiers __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_compute_dominators __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_edge_count __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_find_basic_blocks __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_find_loops __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_find_loops __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_free_life_info __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_free_life_info __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_life_analysis __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_life_analysis __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_make_life_range __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_natural_preheader __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_make_life_range __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_natural_preheader __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(loop_info)
-#define ASSERT_ARGS_search_predecessors_not_in __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(loop_info))
+#define ASSERT_ARGS_search_predecessors_not_in __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(node) \
-    || PARROT_ASSERT_ARG(s)
+    , PARROT_ASSERT_ARG(s))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: compilers/imcc/cfg.c */
 

Modified: branches/orderedhash_revamp/compilers/imcc/debug.h
==============================================================================
--- branches/orderedhash_revamp/compilers/imcc/debug.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/imcc/debug.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -112,49 +112,49 @@
 void dump_symreg(ARGIN(const IMC_Unit *unit))
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_IMCC_debug __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_IMCC_debug __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(fmt)
-#define ASSERT_ARGS_IMCC_fatal __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(fmt))
+#define ASSERT_ARGS_IMCC_fatal __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(fmt)
-#define ASSERT_ARGS_IMCC_fatal_standalone __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(fmt))
+#define ASSERT_ARGS_IMCC_fatal_standalone __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(fmt)
-#define ASSERT_ARGS_IMCC_fataly __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(fmt)
-#define ASSERT_ARGS_IMCC_fataly_standalone __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(fmt)
-#define ASSERT_ARGS_IMCC_info __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(fmt)
-#define ASSERT_ARGS_IMCC_warning __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(fmt)
-#define ASSERT_ARGS_dump_cfg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_dump_dominance_frontiers __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_dump_dominators __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_dump_instructions __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_dump_interference_graph __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_dump_labels __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_dump_liveness_status __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_dump_liveness_status_var __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(fmt))
+#define ASSERT_ARGS_IMCC_fataly __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(fmt))
+#define ASSERT_ARGS_IMCC_fataly_standalone __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(fmt))
+#define ASSERT_ARGS_IMCC_info __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(fmt))
+#define ASSERT_ARGS_IMCC_warning __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(fmt))
+#define ASSERT_ARGS_dump_cfg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_dump_dominance_frontiers __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_dump_dominators __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_dump_instructions __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_dump_interference_graph __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_dump_labels __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_dump_liveness_status __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_dump_liveness_status_var __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_dump_loops __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_dump_symreg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(unit)
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_dump_loops __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_dump_symreg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(unit))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: compilers/imcc/debug.c */
 

Modified: branches/orderedhash_revamp/compilers/imcc/imc.c
==============================================================================
--- branches/orderedhash_revamp/compilers/imcc/imc.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/imcc/imc.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -41,10 +41,10 @@
 PARROT_MALLOC
 static IMC_Unit * imc_new_unit(IMC_Unit_Type t);
 
-#define ASSERT_ARGS_imc_free_unit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_imc_free_unit __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_imc_new_unit __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_imc_new_unit __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 

Modified: branches/orderedhash_revamp/compilers/imcc/imc.h
==============================================================================
--- branches/orderedhash_revamp/compilers/imcc/imc.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/imcc/imc.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -41,7 +41,7 @@
  * that won't collide with high level compiler generated names.  */
 #define IMCC_INTERNAL_CHAR '@'
 
-typedef struct _IMC_Unit IMC_Unit;
+typedef struct IMC_Unit IMC_Unit;
 
 #include "symreg.h"
 #include "instructions.h"
@@ -84,14 +84,14 @@
         FUNC_MODIFIES(*unit)
         FUNC_MODIFIES(*r0);
 
-#define ASSERT_ARGS_IMCC_create_itcall_label __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_IMCC_itcall_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_IMCC_create_itcall_label __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_IMCC_itcall_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub)
-#define ASSERT_ARGS_INS_LABEL __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(sub))
+#define ASSERT_ARGS_INS_LABEL __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(r0)
+    , PARROT_ASSERT_ARG(r0))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: compilers/imcc/imcc.y */
 
@@ -123,17 +123,17 @@
 IMC_Unit * imc_open_unit(PARROT_INTERP, IMC_Unit_Type t)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_imc_cleanup __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_imc_compile_all_units __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_imc_compile_unit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_imc_close_unit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_imc_open_unit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_imc_cleanup __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_imc_compile_all_units __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_imc_compile_unit __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_imc_close_unit __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_imc_open_unit __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: compilers/imcc/imc.c */
 
@@ -157,15 +157,15 @@
 void imc_reg_alloc(PARROT_INTERP, ARGIN_NULLOK(IMC_Unit *unit))
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_free_reglist __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_graph_coloring_reg_alloc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_ig_test __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(graph)
-#define ASSERT_ARGS_imc_reg_alloc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_free_reglist __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_graph_coloring_reg_alloc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_ig_test __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(graph))
+#define ASSERT_ARGS_imc_reg_alloc __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: compilers/imcc/reg_alloc.c */
 
@@ -373,77 +373,77 @@
         FUNC_MODIFIES(*unit)
         FUNC_MODIFIES(*r);
 
-#define ASSERT_ARGS_do_yylex_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_do_yylex_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(yyscanner)
-#define ASSERT_ARGS_imcc_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_imcc_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_check_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(fullname) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_imcc_compile __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s) \
-    || PARROT_ASSERT_ARG(error_message)
-#define ASSERT_ARGS_IMCC_compile_file __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_IMCC_compile_file_s __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s) \
-    || PARROT_ASSERT_ARG(error_message)
-#define ASSERT_ARGS_imcc_compile_pasm __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_imcc_compile_pasm_ex __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_IMCC_compile_pasm_s __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s) \
-    || PARROT_ASSERT_ARG(error_message)
-#define ASSERT_ARGS_imcc_compile_pir __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_imcc_compile_pir_ex __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_IMCC_compile_pir_s __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s) \
-    || PARROT_ASSERT_ARG(error_message)
-#define ASSERT_ARGS_imcc_vfprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(io) \
-    || PARROT_ASSERT_ARG(format)
-#define ASSERT_ARGS_iNEW __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(r0) \
-    || PARROT_ASSERT_ARG(type)
-#define ASSERT_ARGS_INS __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_is_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(yyscanner))
+#define ASSERT_ARGS_imcc_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_imcc_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_check_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(fullname) \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_imcc_compile __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s) \
+    , PARROT_ASSERT_ARG(error_message))
+#define ASSERT_ARGS_IMCC_compile_file __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_IMCC_compile_file_s __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s) \
+    , PARROT_ASSERT_ARG(error_message))
+#define ASSERT_ARGS_imcc_compile_pasm __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_imcc_compile_pasm_ex __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_IMCC_compile_pasm_s __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s) \
+    , PARROT_ASSERT_ARG(error_message))
+#define ASSERT_ARGS_imcc_compile_pir __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_imcc_compile_pir_ex __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_IMCC_compile_pir_s __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s) \
+    , PARROT_ASSERT_ARG(error_message))
+#define ASSERT_ARGS_imcc_vfprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(io) \
+    , PARROT_ASSERT_ARG(format))
+#define ASSERT_ARGS_iNEW __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(r0) \
+    , PARROT_ASSERT_ARG(type))
+#define ASSERT_ARGS_INS __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_is_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_op_fullname __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_op_fullname __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(dest) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(args)
-#define ASSERT_ARGS_register_compilers __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_try_find_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(r)
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(args))
+#define ASSERT_ARGS_register_compilers __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_try_find_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(r))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: compilers/imcc/parser_util.c */
 
@@ -492,24 +492,24 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-#define ASSERT_ARGS_expand_pcc_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_expand_pcc_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(ins)
-#define ASSERT_ARGS_expand_pcc_sub_call __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(ins))
+#define ASSERT_ARGS_expand_pcc_sub_call __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(ins)
-#define ASSERT_ARGS_expand_pcc_sub_ret __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(ins))
+#define ASSERT_ARGS_expand_pcc_sub_ret __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(ins)
-#define ASSERT_ARGS_get_const __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(ins))
+#define ASSERT_ARGS_get_const __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_get_pasm_reg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_get_pasm_reg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
+    , PARROT_ASSERT_ARG(name))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: compilers/imcc/pcc.c */
 
@@ -573,7 +573,6 @@
     struct code_segment_t *prev;          /* previous code segment */
     struct code_segment_t *next;          /* next code segment */
     SymHash                key_consts;    /* this seg's cached key constants */
-    int                    pic_idx;       /* next index of PIC */
 } code_segment_t;
 
 typedef struct _imcc_globals_t {
@@ -595,6 +594,7 @@
     STRING                *error_message;   /* The Error message */
 
     /* some values that were global... */
+    Namespace            *namespace_stack;
     SymReg               *cur_call;
     SymReg               *cur_obj;
     SymReg               *adv_named_id;
@@ -603,6 +603,7 @@
     char                 *heredoc_end;
     char                 *heredoc_content;
     char                 *cur_macro_name;
+    int                  is_def;
 
     struct macro_frame_t *frames;
     imcc_globals         *globals;
@@ -633,7 +634,6 @@
     int                   has_compile;
     int                   imcc_warn;
     int                   in_pod;
-    int                   in_slice;
     int                   ins_line;
     int                   keyvec;
     int                   line;                   /* current line number */

Modified: branches/orderedhash_revamp/compilers/imcc/imcc.l
==============================================================================
--- branches/orderedhash_revamp/compilers/imcc/imcc.l	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/imcc/imcc.l	Sat Jan 23 01:49:53 2010	(r43541)
@@ -60,9 +60,6 @@
     YY_BUFFER_STATE buffer;
 } macro_frame_t;
 
-/* short ranged globals for lexer state */
-int pesky_global__is_def = 0;
-
 /* static function declarations */
 static void pop_parser_state(PARROT_INTERP, ARGMOD(void *yyscanner));
 
@@ -177,8 +174,7 @@
 
 <heredoc2>{EOL} {
         /* heredocs have highest priority
-         * arrange them before all wildcard state matches
-         */
+         * arrange them before all wildcard state matches */
 
         /* Newline in the heredoc. Realloc and cat on. */
         IMCC_INFO(interp)->line++;
@@ -213,7 +209,8 @@
             yy_pop_state(yyscanner);
             yy_scan_string(IMCC_INFO(interp)->frames->heredoc_rest, yyscanner);
 
-            /* RT #42382 delete quotes, -> emit, pbc */
+            /* the EOF rule will increment the line number; decrement here */
+            IMCC_INFO(interp)->line--;
             return STRINGC;
         }
         else {
@@ -286,9 +283,8 @@
 
 
 <INITIAL,emit,macro>^"=cut"{EOL} {
-    /* this is a stand-alone =cut, but we're
-     * not in POD mode, so just ignore.
-     */
+    /* this is a stand-alone =cut, but we're not in POD mode, so ignore.  */
+    IMCC_INFO(interp)->line++;
 }
 
 <INITIAL,emit,macro>^"=" {
@@ -357,6 +353,7 @@
 ":named"        return ADV_NAMED;
 "=>"            return ADV_ARROW;
 ":invocant"     return ADV_INVOCANT;
+":call_sig"     return ADV_CALL_SIG;
 
 <emit,INITIAL>".namespace"    return NAMESPACE;
 <emit,INITIAL>".HLL"          return HLL;
@@ -494,7 +491,6 @@
             size_t len;
             YYCHOP();
 
-            /* RT #32421   if$I0 is parsed as if$ I0 */
             if (!IMCC_INFO(interp)->frames || !IMCC_INFO(interp)->frames->label)
                 IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR, "missing space?");
 
@@ -522,9 +518,10 @@
     }
 
 <emit,INITIAL>{DOT}{LETTER}{LETTERDIGIT}* {
-        char   * const macro_name = yytext + 1;
-
-        if (!expand_macro(interp, macro_name, yyscanner)) {
+        char   * const macro_name = mem_sys_strdup(yytext + 1);
+        int failed = expand_macro(interp, macro_name, yyscanner);
+        mem_sys_free(macro_name);
+        if (!failed) {
             yyless(1);
             return DOT;
         }
@@ -551,7 +548,6 @@
 <*>{STRINGCONSTANT} {
         valp->s = mem_sys_strdup(yytext);
 
-        /* RT #42382 delete quotes, -> emit, pbc */
         return STRINGC;
     }
 
@@ -640,7 +636,7 @@
     }
 
 <emit,INITIAL>{ID} {
-        if (!pesky_global__is_def) {
+        if (!IMCC_INFO(interp)->is_def) {
             SymReg *r = find_sym(interp, yytext);
 
             if (r && (r->type & (VTIDENTIFIER|VT_CONSTP))) {
@@ -664,7 +660,7 @@
         }
 
         valp->s = mem_sys_strdup(yytext);
-        return (!pesky_global__is_def && is_op(interp, valp->s) ? PARROT_OP : IDENTIFIER);
+        return (!IMCC_INFO(interp)->is_def && is_op(interp, valp->s) ? PARROT_OP : IDENTIFIER);
     }
 
 
@@ -993,7 +989,7 @@
         IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR, "Macro names must be identifiers");
 
     IMCC_INFO(interp)->cur_macro_name = valp->s;
-    start_line                        = IMCC_INFO(interp)->line++;
+    start_line                        = IMCC_INFO(interp)->line;
 
     memset(&params, 0, sizeof (params_t));
 
@@ -1062,6 +1058,9 @@
     IMCC_INFO(interp)->macro_buffer   = NULL;
     IMCC_INFO(interp)->cur_macro_name = NULL;
 
+    /* the ENDM rule doesn't set the line number */
+    IMCC_INFO(interp)->line--;
+
     return MACRO;
 }
 
@@ -1222,7 +1221,8 @@
             }
         }
 
-        IMCC_INFO(interp)->line = m->line;
+        /* let the normal EOF rules match line numbers */
+        IMCC_INFO(interp)->line = m->line - 1;
         scan_string(frame, m->expansion, yyscanner);
 
         return 1;

Modified: branches/orderedhash_revamp/compilers/imcc/imcc.y
==============================================================================
--- branches/orderedhash_revamp/compilers/imcc/imcc.y	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/imcc/imcc.y	Sat Jan 23 01:49:53 2010	(r43541)
@@ -21,6 +21,7 @@
 #define PARSER_MAIN
 #include "imc.h"
 #include "parrot/dynext.h"
+#include "pmc/pmc_callcontext.h"
 #include "pbc.h"
 #include "parser.h"
 #include "optimizer.h"
@@ -249,91 +250,91 @@
         FUNC_MODIFIES(*r)
         FUNC_MODIFIES(*name);
 
-#define ASSERT_ARGS_add_pcc_named_arg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_add_pcc_named_arg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(cur_call) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(value)
-#define ASSERT_ARGS_add_pcc_named_arg_var __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(value))
+#define ASSERT_ARGS_add_pcc_named_arg_var __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(cur_call) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(value)
-#define ASSERT_ARGS_add_pcc_named_param __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(value))
+#define ASSERT_ARGS_add_pcc_named_param __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(cur_call) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(value)
-#define ASSERT_ARGS_add_pcc_named_result __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(value))
+#define ASSERT_ARGS_add_pcc_named_result __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(cur_call) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(value)
-#define ASSERT_ARGS_add_pcc_named_return __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(value))
+#define ASSERT_ARGS_add_pcc_named_return __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(cur_call) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(value)
-#define ASSERT_ARGS_adv_named_set __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(value))
+#define ASSERT_ARGS_adv_named_set __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_adv_named_set_u __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_adv_named_set_u __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_begin_return_or_yield __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_clear_state __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_do_loadlib __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_begin_return_or_yield __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_clear_state __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_do_loadlib __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(lib)
-#define ASSERT_ARGS_func_ins __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(lib))
+#define ASSERT_ARGS_func_ins __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(lhs) \
-    || PARROT_ASSERT_ARG(op) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_iINDEXFETCH __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(lhs) \
+    , PARROT_ASSERT_ARG(op) \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_iINDEXFETCH __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(r0) \
-    || PARROT_ASSERT_ARG(r1) \
-    || PARROT_ASSERT_ARG(r2)
-#define ASSERT_ARGS_iINDEXSET __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(r0) \
+    , PARROT_ASSERT_ARG(r1) \
+    , PARROT_ASSERT_ARG(r2))
+#define ASSERT_ARGS_iINDEXSET __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(r0) \
-    || PARROT_ASSERT_ARG(r1) \
-    || PARROT_ASSERT_ARG(r2)
-#define ASSERT_ARGS_iLABEL __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(r0) \
+    , PARROT_ASSERT_ARG(r1) \
+    , PARROT_ASSERT_ARG(r2))
+#define ASSERT_ARGS_iLABEL __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(r0)
-#define ASSERT_ARGS_inv_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(op)
-#define ASSERT_ARGS_iSUBROUTINE __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(r0))
+#define ASSERT_ARGS_inv_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(op))
+#define ASSERT_ARGS_iSUBROUTINE __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_MK_I __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_MK_I __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(fmt)
-#define ASSERT_ARGS_mk_pmc_const __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(fmt))
+#define ASSERT_ARGS_mk_pmc_const __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(type) \
-    || PARROT_ASSERT_ARG(left) \
-    || PARROT_ASSERT_ARG(constant)
-#define ASSERT_ARGS_mk_pmc_const_named __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(type) \
+    , PARROT_ASSERT_ARG(left) \
+    , PARROT_ASSERT_ARG(constant))
+#define ASSERT_ARGS_mk_pmc_const_named __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(left) \
-    || PARROT_ASSERT_ARG(constant)
-#define ASSERT_ARGS_mk_sub_address_fromc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(left) \
+    , PARROT_ASSERT_ARG(constant))
+#define ASSERT_ARGS_mk_sub_address_fromc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_mk_sub_address_u __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_mk_sub_address_u __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_set_lexical __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_set_lexical __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(r) \
-    || PARROT_ASSERT_ARG(name)
+    , PARROT_ASSERT_ARG(r) \
+    , PARROT_ASSERT_ARG(name))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -451,18 +452,18 @@
     }
 
     switch (type_enum) {
-        case enum_class_Sub:
-        case enum_class_Coroutine:
-            rhs = mk_const(interp, name, 'p');
-
-            if (!ascii)
-                rhs->type |= VT_ENCODED;
-
-            rhs->usage    = U_FIXUP | U_SUBID_LOOKUP;;
-            break;
-        default:
-            rhs = mk_const(interp, name, 'P');
-            break;
+      case enum_class_Sub:
+      case enum_class_Coroutine:
+        rhs = mk_const(interp, name, 'p');
+
+        if (!ascii)
+            rhs->type |= VT_ENCODED;
+
+        rhs->usage    |= U_FIXUP | U_SUBID_LOOKUP;
+        break;
+      default:
+        rhs = mk_const(interp, name, 'P');
+        break;
     }
 
     r[1]          = rhs;
@@ -524,7 +525,7 @@
         if (!ascii)
             rhs->type |= VT_ENCODED;
 
-        rhs->usage    = U_FIXUP | U_SUBID_LOOKUP;
+        rhs->usage    |= U_FIXUP | U_SUBID_LOOKUP;
     }
     else {
         rhs = mk_const(interp, const_name, 'P');
@@ -771,10 +772,19 @@
     ASSERT_ARGS(mk_sub_address_fromc)
     /* name is a quoted sub name */
     SymReg *r;
-    char *name_copy                  = mem_sys_strdup(name + 1);
-    name_copy[strlen(name_copy) - 1] = 0;
+    char   *name_copy;
+
+    /* interpolate only if the first character is a double-quote */
+    if (*name == '"') {
+        STRING *unescaped = Parrot_str_unescape(interp, name, '"', NULL);
+        name_copy         = Parrot_str_to_cstring(interp, unescaped);
+    }
+    else {
+        name_copy = mem_sys_strdup(name);
+        name_copy[ strlen(name) - 1 ] = 0;
+    }
 
-    r = mk_sub_address(interp, name_copy);
+    r = mk_sub_address(interp, name_copy + 1);
     mem_sys_free(name_copy);
 
     return r;
@@ -880,8 +890,9 @@
             "register %s already declared as lexical %s", r->name, name->name);
 
     /* chain all names in r->reg */
-    name->reg = r->reg;
-    r->reg = name;
+    name->reg    = r->reg;
+    r->reg       = name;
+    name->usage |= U_LEXICAL;
     r->use_count++;
 }
 
@@ -1061,7 +1072,7 @@
 %token <t> HLL TK_LINE TK_FILE
 %token <t> GOTO ARG IF UNLESS PNULL SET_RETURN SET_YIELD
 %token <t> ADV_FLAT ADV_SLURPY ADV_OPTIONAL ADV_OPT_FLAG ADV_NAMED ADV_ARROW
-%token <t> NEW ADV_INVOCANT
+%token <t> NEW ADV_INVOCANT ADV_CALL_SIG
 %token <t> NAMESPACE DOT_METHOD
 %token <t> SUB SYM LOCAL LEXICAL CONST ANNOTATE
 %token <t> INC DEC GLOBAL_CONST
@@ -1209,8 +1220,8 @@
      HLL STRINGC
          {
             STRING * const hll_name = Parrot_str_unescape(interp, $2 + 1, '"', NULL);
-            CONTEXT(interp)->current_HLL =
-                Parrot_register_HLL(interp, hll_name);
+            Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp),
+                Parrot_register_HLL(interp, hll_name));
 
             IMCC_INFO(interp)->cur_namespace = NULL;
             mem_sys_free($2);
@@ -1219,28 +1230,28 @@
    ;
 
 constdef:
-     CONST { pesky_global__is_def = 1; } type IDENTIFIER '=' const
+     CONST { IMCC_INFO(interp)->is_def = 1; } type IDENTIFIER '=' const
          {
              mk_const_ident(interp, $4, $3, $6, 1);
              mem_sys_free($4);
-             pesky_global__is_def = 0;
+             IMCC_INFO(interp)->is_def = 0;
          }
    ;
 
 pmc_const:
-     CONST { pesky_global__is_def=1; } INTC var_or_i '=' any_string
+     CONST { IMCC_INFO(interp)->is_def = 1; } INTC var_or_i '=' any_string
          {
            $$ = mk_pmc_const(interp, IMCC_INFO(interp)->cur_unit, $3, $4, $6);
            mem_sys_free($6);
-           pesky_global__is_def = 0;
+           IMCC_INFO(interp)->is_def = 0;
          }
 
-     | CONST { pesky_global__is_def=1; } STRINGC var_or_i '=' any_string
+     | CONST { IMCC_INFO(interp)->is_def = 1; } STRINGC var_or_i '=' any_string
          {
            $$ = mk_pmc_const_named(interp, IMCC_INFO(interp)->cur_unit, $3, $4, $6);
            mem_sys_free($3);
            mem_sys_free($6);
-           pesky_global__is_def = 0;
+           IMCC_INFO(interp)->is_def = 0;
          }
    ;
 any_string:
@@ -1290,10 +1301,14 @@
          }
    | LEXICAL STRINGC COMMA REG
          {
-           SymReg *r = mk_pasm_reg(interp, $4);
-           SymReg *n = mk_const(interp, $2, 'S');
+           char   *name = mem_sys_strdup($2 + 1);
+           SymReg *r    = mk_pasm_reg(interp, $4);
+           SymReg *n;
+           name[strlen(name) - 1] = 0;
+           n = mk_const(interp, name, 'S');
            set_lexical(interp, r, n);
            $$ = 0;
+           mem_sys_free(name);
            mem_sys_free($2);
            mem_sys_free($4);
          }
@@ -1340,10 +1355,6 @@
 maybe_ns:
      '[' keylist ']'
         {
-            if (IMCC_INFO(interp)->in_slice)
-                IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
-                    "Slice not allowed in namespace.");
-
             $$ = $2;
         }
    | '[' ']'                   { $$ = NULL; }
@@ -1386,7 +1397,7 @@
    ;
 
 sub_param:
-   PARAM { pesky_global__is_def=1; } sub_param_type_def { $$ = $3; pesky_global__is_def=0; }
+   PARAM { IMCC_INFO(interp)->is_def = 1; } sub_param_type_def { $$ = $3; IMCC_INFO(interp)->is_def = 0; }
    ;
 
 sub_param_type_def:
@@ -1394,6 +1405,18 @@
          {
            if ($3 & VT_UNIQUE_REG)
                $$ = mk_ident_ur(interp, $2, $1);
+           else if ($3 & VT_OPT_FLAG && $1 != 'I') {
+               char *type;
+               switch ($1) {
+                    case 'N': type = "num";     break;
+                    case 'S': type = "string";  break;
+                    case 'P': type = "pmc";     break;
+                    default:  type = "strange"; break;
+               }
+
+               IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
+                   ":opt_flag parameter must be of type 'I', not '%s'", type);
+           }
            else
                $$ = mk_ident(interp, $2, $1);
            $$->type |= $3;
@@ -1669,7 +1692,7 @@
 
 pcc_result:
      RESULT target paramtype_list { $$ = $2; $$->type |= $3; }
-   | LOCAL { pesky_global__is_def=1; } type id_list_id
+   | LOCAL { IMCC_INFO(interp)->is_def = 1; } type id_list_id
          {
            IdList * const l = $4;
            SymReg *ignored;
@@ -1678,8 +1701,8 @@
            else
                ignored = mk_ident(interp, l->id, $3);
            UNUSED(ignored);
-           pesky_global__is_def=0;
-           $$=0;
+           IMCC_INFO(interp)->is_def = 0;
+           $$ = 0;
          }
    ;
 
@@ -1696,6 +1719,7 @@
    | ADV_NAMED '(' STRINGC ')'  { adv_named_set(interp, $3);   $$ = 0; mem_sys_free($3); }
    | ADV_NAMED '(' USTRINGC ')' { adv_named_set_u(interp, $3); $$ = 0; mem_sys_free($3); }
    | UNIQUE_REG                 { $$ = VT_UNIQUE_REG; }
+   | ADV_CALL_SIG               { $$ = VT_CALL_SIG; }
    ;
 
 
@@ -1900,7 +1924,7 @@
 labeled_inst:
      assignment
    | conditional_statement
-   | LOCAL { pesky_global__is_def=1; } type id_list
+   | LOCAL { IMCC_INFO(interp)->is_def = 1; } type id_list
          {
            IdList *l = $4;
            while (l) {
@@ -1914,32 +1938,50 @@
                mem_sys_free(l1->id);
                mem_sys_free(l1);
            }
-           pesky_global__is_def=0; $$=0;
+           IMCC_INFO(interp)->is_def = 0; $$ = 0;
          }
    | LEXICAL STRINGC COMMA target
          {
-           SymReg * const n = mk_const(interp, $2, 'S');
-           set_lexical(interp, $4, n); $$ = 0;
-           mem_sys_free($2);
+            if ($4->set != 'P') {
+                mem_sys_free($2);
+                IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
+                    "Cannot use %c register with .lex", $4->set);
+            }
+            else {
+               SymReg *n;
+               char   *name = mem_sys_strdup($2 + 1);
+               name[strlen(name) - 1] = 0;
+               n = mk_const(interp, name, 'S');
+               set_lexical(interp, $4, n); $$ = 0;
+               mem_sys_free($2);
+               mem_sys_free(name);
+            }
          }
    | LEXICAL USTRINGC COMMA target
          {
-           SymReg * const n = mk_const(interp, $2, 'U');
-           set_lexical(interp, $4, n); $$ = 0;
-           mem_sys_free($2);
+            if ($4->set != 'P') {
+                mem_sys_free($2);
+                IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
+                    "Cannot use %c register with .lex", $4->set);
+            }
+            else {
+               SymReg *n = mk_const(interp, $2, 'U');
+               set_lexical(interp, $4, n); $$ = 0;
+               mem_sys_free($2);
+            }
          }
-   | CONST { pesky_global__is_def=1; } type IDENTIFIER '=' const
+   | CONST { IMCC_INFO(interp)->is_def = 1; } type IDENTIFIER '=' const
          {
            mk_const_ident(interp, $4, $3, $6, 0);
-           pesky_global__is_def=0;
+           IMCC_INFO(interp)->is_def = 0;
            mem_sys_free($4);
          }
 
    | pmc_const
-   | GLOBAL_CONST { pesky_global__is_def=1; } type IDENTIFIER '=' const
+   | GLOBAL_CONST { IMCC_INFO(interp)->is_def = 1; } type IDENTIFIER '=' const
          {
            mk_const_ident(interp, $4, $3, $6, 1);
-           pesky_global__is_def=0;
+           IMCC_INFO(interp)->is_def = 0;
            mem_sys_free($4);
          }
    | TAILCALL sub_call
@@ -1998,7 +2040,7 @@
    | target '=' un_op var
             { $$ = MK_I(interp, IMCC_INFO(interp)->cur_unit, $3, 2, $1, $4);  }
    | target '=' var bin_op var
-            { $$ = MK_I(interp, IMCC_INFO(interp)->cur_unit, $4, 3, $1, $3, $5);  }
+            { $$ = MK_I(interp, IMCC_INFO(interp)->cur_unit, $4, 3, $1, $3, $5); }
    | target '=' var '[' keylist ']'
             { $$ = iINDEXFETCH(interp, IMCC_INFO(interp)->cur_unit, $1, $3, $5); }
    | target '[' keylist ']' '=' var
@@ -2081,9 +2123,7 @@
 
 op_assign:
      target assign_op var
-         {
-           $$ = MK_I(interp, IMCC_INFO(interp)->cur_unit, $2, 2, $1, $3);
-         }
+         { $$ = MK_I(interp, IMCC_INFO(interp)->cur_unit, $2, 2, $1, $3); }
    ;
 
 assign_op:
@@ -2216,8 +2256,9 @@
    ;
 
 argtype:
-     ADV_FLAT                  { $$ = VT_FLAT; }
-   | ADV_NAMED                 { $$ = VT_NAMED; }
+     ADV_FLAT                  { $$ = VT_FLAT;     }
+   | ADV_NAMED                 { $$ = VT_NAMED;    }
+   | ADV_CALL_SIG              { $$ = VT_CALL_SIG; }
 
    /* don't free $3 here; adv_named_set uses the pointer directly */
    | ADV_NAMED '(' USTRINGC ')' { adv_named_set_u(interp, $3); $$ = 0; }
@@ -2371,7 +2412,6 @@
 keylist:
          {
            IMCC_INFO(interp)->nkeys    = 0;
-           IMCC_INFO(interp)->in_slice = 0;
          }
      _keylist
          {
@@ -2384,7 +2424,6 @@
 keylist_force:
          {
            IMCC_INFO(interp)->nkeys = 0;
-           IMCC_INFO(interp)->in_slice = 0;
          }
      _keylist
          {
@@ -2406,8 +2445,6 @@
 key:
      var
          {
-           if (IMCC_INFO(interp)->in_slice)
-               $1->type |= VT_START_SLICE | VT_END_SLICE;
            $$ = $1;
          }
    ;

Modified: branches/orderedhash_revamp/compilers/imcc/imclexer.c
==============================================================================
--- branches/orderedhash_revamp/compilers/imcc/imclexer.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/imcc/imclexer.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -376,8 +376,8 @@
 	*yy_cp = '\0'; \
 	yyg->yy_c_buf_p = yy_cp;
 
-#define YY_NUM_RULES 147
-#define YY_END_OF_BUFFER 148
+#define YY_NUM_RULES 148
+#define YY_END_OF_BUFFER 149
 /* This struct is not used in this scanner,
    but its presence is necessary. */
 struct yy_trans_info
@@ -385,124 +385,125 @@
 	flex_int32_t yy_verify;
 	flex_int32_t yy_nxt;
 	};
-static yyconst flex_int16_t yy_accept[1054] =
+static yyconst flex_int16_t yy_accept[1062] =
     {   0,
         0,    0,    0,    0,    0,    0,   16,   16,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        3,    3,  148,  134,  133,   10,  133,  134,  134,   11,
-      134,  134,  134,  134,  134,  134,  114,  134,   94,  134,
-      118,  118,  134,   86,  134,   88,  132,  132,  132,  132,
-      132,  132,  132,  132,  134,  134,   14,  133,  133,  134,
-      134,  134,  134,  132,   14,  146,  141,  136,  141,  146,
-      146,  146,  146,  146,  118,  118,  146,  144,  144,  144,
-      140,  140,   14,   16,   17,   16,   16,   16,   16,   16,
-       16,   16,   16,   16,   16,   16,  147,  134,    8,    8,
-
-      134,  134,    4,    4,    4,    4,    4,    4,    4,    4,
-        4,    4,    5,  134,    9,  134,  134,  134,  134,  134,
-      118,  118,  134,  134,  134,  134,   12,  134,  134,  134,
-      134,  134,  118,  118,  134,  134,  134,  147,    1,  147,
-      147,  147,  147,  147,  118,  118,  147,  147,  147,    3,
+        3,    3,  149,  135,  134,   10,  134,  135,  135,   11,
+      135,  135,  135,  135,  135,  135,  115,  135,   95,  135,
+      119,  119,  135,   87,  135,   89,  133,  133,  133,  133,
+      133,  133,  133,  133,  135,  135,   14,  134,  134,  135,
+      135,  135,  135,  133,   14,  147,  142,  137,  142,  147,
+      147,  147,  147,  147,  119,  119,  147,  145,  145,  145,
+      141,  141,   14,   16,   17,   16,   16,   16,   16,   16,
+       16,   16,   16,   16,   16,   16,  148,  135,    8,    8,
+
+      135,  135,    4,    4,    4,    4,    4,    4,    4,    4,
+        4,    4,    5,  135,    9,  135,  135,  135,  135,  135,
+      119,  119,  135,  135,  135,  135,   12,  135,  135,  135,
+      135,  135,  119,  119,  135,  135,  135,  148,    1,  148,
+      148,  148,  148,  148,  119,  119,  148,  148,  148,    3,
         2,    3,    3,    3,    3,    3,    3,    3,    3,    3,
-        3,  133,    0,   10,   91,    0,  123,    0,  130,  130,
-      130,  130,  130,   99,   83,  102,    0,   92,   97,    0,
-      118,   95,   96,  117,  108,  116,  116,  116,  116,  116,
-      116,  116,  116,  116,  116,  116,  116,  116,  116,  116,
+        3,  134,    0,   10,   92,    0,  124,    0,  131,  131,
+      131,  131,  131,  100,   84,  103,    0,   93,   98,    0,
+      119,   96,   97,  118,  109,  117,  117,  117,  117,  117,
+      117,  117,  117,  117,  117,  117,  117,  117,  117,  117,
 
-      116,  116,  100,   98,  117,    0,    0,  122,    0,    0,
+      117,  117,  101,   99,  118,    0,    0,  123,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,   80,   87,   90,   64,   89,   81,  113,    0,  132,
-      115,  131,  132,   73,  132,  132,  132,  132,  132,  132,
-      103,   84,  104,   85,    0,  133,  116,  116,  116,  116,
-      116,  116,    0,    0,    0,    0,  141,  136,  141,    0,
-        0,    0,  145,  145,  145,  145,  144,    0,  142,  144,
-      140,  140,   16,   17,   16,   16,   16,   16,   16,   16,
+        0,    0,   81,   88,   91,   64,   90,   82,  114,    0,
+      133,  116,  132,  133,   74,  133,  133,  133,  133,  133,
+      133,  104,   85,  105,   86,    0,  134,  117,  117,  117,
+      117,  117,  117,    0,    0,    0,    0,  142,  137,  142,
+        0,    0,    0,  146,  146,  146,  146,  145,    0,  143,
+      145,  141,  141,   16,   17,   16,   16,   16,   16,   16,
        16,   16,   16,   16,   16,   16,   16,   16,   16,   16,
-       16,   16,   16,   16,    0,    0,    8,    0,    4,    4,
+       16,   16,   16,   16,   16,    0,    0,    8,    0,    4,
 
         4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
-        4,    4,    4,    4,    4,    4,    0,    9,    0,    0,
-        0,  123,    0,    0,    0,    0,  118,  117,    0,    0,
-      117,    0,    0,  122,    0,    0,    0,    0,    0,    0,
-        0,   12,    0,    0,    0,  123,    0,    0,    0,    0,
-      118,  117,    0,    0,  117,    0,    0,  122,    0,    0,
-        0,    0,    0,    0,    0,    1,    0,    0,    0,  123,
-        0,    0,    0,    0,  118,  117,    0,    0,  117,    0,
-        0,  122,    0,    0,    0,    0,    0,    0,    3,    2,
-        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        4,    4,    4,    4,    4,    4,    4,    0,    9,    0,
+        0,    0,  124,    0,    0,    0,    0,  119,  118,    0,
+        0,  118,    0,    0,  123,    0,    0,    0,    0,    0,
+        0,    0,   12,    0,    0,    0,  124,    0,    0,    0,
+        0,  119,  118,    0,    0,  118,    0,    0,  123,    0,
+        0,    0,    0,    0,    0,    0,    1,    0,    0,    0,
+      124,    0,    0,    0,    0,  119,  118,    0,    0,  118,
+        0,    0,  123,    0,    0,    0,    0,    0,    0,    3,
+        2,    3,    3,    3,    3,    3,    3,    3,    3,    3,
 
-        3,    3,    3,    3,    3,    3,    3,    3,    3,   93,
-      126,  127,  129,  128,    0,  116,  116,  116,  116,  116,
-      116,  116,  116,  116,  116,  116,  116,  116,  116,  116,
-      116,  116,  116,  116,  116,  116,  116,  116,  116,  116,
-      101,  117,  120,    0,  117,  121,  119,    0,    0,    0,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+       94,  127,  128,  130,  129,    0,  117,  117,  117,  117,
+      117,  117,  117,  117,  117,  117,  117,  117,  117,  117,
+      117,  117,  117,  117,  117,  117,  117,  117,  117,  117,
+      117,  102,  118,  121,    0,  118,  122,  120,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,  106,  105,   82,
-      112,    0,    0,  131,  132,   76,  132,   77,   78,  132,
-      132,  132,    0,  116,  116,    0,    0,  137,  143,  139,
-      145,  145,  145,  145,  145,  144,   16,   16,   16,   16,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,  107,
+      106,   83,  113,    0,    0,  132,  133,   77,  133,   78,
+       79,  133,  133,  133,    0,  117,  117,    0,    0,  138,
+      144,  140,  146,  146,  146,  146,  146,  145,   16,   16,
 
        16,   16,   16,   16,   16,   16,   16,   16,   16,   16,
-       16,    0,    0,    0,    4,    4,    4,    4,    4,    4,
-        4,    4,    4,    4,    4,    4,    0,    0,    0,  117,
-      120,    0,  117,  121,  119,    0,    0,    0,    0,    0,
-        0,    0,    0,  117,  120,    0,  117,  121,  119,    0,
-        0,    0,    0,    0,    0,    0,    0,  117,  120,    0,
-      117,  121,  119,    0,    0,    0,    0,    0,    3,    3,
+       16,   16,   16,    0,    0,    0,    4,    4,    4,    4,
+        4,    4,    4,    4,    4,    4,    4,    4,    0,    0,
+        0,  118,  121,    0,  118,  122,  120,    0,    0,    0,
+        0,    0,    0,    0,    0,  118,  121,    0,  118,  122,
+      120,    0,    0,    0,    0,    0,    0,    0,    0,  118,
+      121,    0,  118,  122,  120,    0,    0,    0,    0,    0,
         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
-        3,    3,    0,  117,   67,  116,  116,  116,  116,   24,
-      116,  116,  116,  116,  116,   21,  116,  116,  116,  116,
+        3,    3,    3,    3,    0,  118,   68,  117,  117,  117,
+      117,   24,  117,  117,  117,  117,  117,   21,  117,  117,
 
-      116,  116,  116,  116,  116,  116,  116,   23,  116,  116,
-        0,    0,    0,    0,    0,    0,   45,    0,    0,    0,
+      117,  117,  117,  117,  117,  117,  117,  117,  117,   23,
+      117,  117,    0,    0,    0,    0,    0,    0,    0,   45,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,  124,    0,    0,  107,    0,  125,    0,    0,    0,
-       72,   75,  132,  132,  132,  132,    0,  139,  145,  145,
-      145,  145,  144,  144,   16,   16,   16,   16,   16,   16,
+        0,    0,    0,    0,  125,    0,    0,  108,    0,  126,
+        0,    0,    0,   73,   76,  133,  133,  133,  133,    0,
+      140,  146,  146,  146,  146,  145,  145,   16,   16,   16,
        16,   16,   16,   16,   16,   16,   16,   16,   16,   16,
-        0,    0,    0,    0,    4,    4,    4,    4,    4,    4,
-        4,    4,    4,    4,    0,  117,    0,    0,    0,    0,
-      124,    0,    0,    0,    0,    0,  125,    0,    0,    0,
-
-        0,    0,    0,  117,    0,    0,    0,    0,  124,    0,
-        0,    0,    0,    0,  125,    0,    0,    0,    0,    0,
-        0,  117,    0,    0,    0,    0,  124,    0,    0,    0,
-        0,    0,  125,    0,    0,    0,    0,    0,    3,    3,
-        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
-        3,    3,    3,  116,  116,   27,  116,  116,   19,  116,
-      116,  116,  116,   18,  116,  116,  116,  116,  116,  116,
-      116,  116,  116,  116,  116,  116,   43,   59,    0,   40,
-        0,    0,   39,   38,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,  132,  132,  132,  132,
-
-       13,    0,  135,   19,  145,   18,  144,  144,   16,   16,
-       16,   16,   15,   16,   19,   18,    0,    0,    4,    4,
-        4,    4,   19,   18,    0,    0,   19,   18,    0,    0,
-       19,   18,    0,    0,    3,    3,    3,    3,  116,  116,
-       69,  116,  116,  116,  116,  116,  116,  116,  116,   68,
-      110,  116,  116,  116,   71,  116,  116,  116,  116,  116,
-      116,   53,    0,    0,    0,    0,   37,   63,    0,    0,
-        0,   44,    0,    0,   50,    0,    0,  132,  132,   79,
-       74,  145,  144,  144,   16,   16,    0,    0,    4,    4,
-        0,    0,    0,    0,    0,    0,    3,    3,  116,  116,
-
-      116,  116,  116,  116,  116,  116,  116,  116,  116,  116,
-      116,  116,  116,   55,  116,  116,  116,  116,    0,    0,
-        0,   36,    0,    0,    0,    0,   60,    0,   46,  132,
-      132,  138,  144,  144,   16,   16,    0,    0,    4,    4,
-        0,    0,    0,    0,    0,    0,    3,    3,  116,  116,
-      116,  116,  116,  116,  116,  116,  116,  111,  116,   58,
-      116,  116,  116,  116,   31,   22,  116,  116,  116,    0,
-        0,    0,   47,    0,    0,    0,    0,    0,    7,   16,
-        7,    4,    4,    0,    7,    0,    7,    0,    7,    3,
-        3,   20,  116,  116,  116,   26,  116,  116,  116,  116,
-
-       30,  116,  116,  116,   28,  116,  116,   57,    0,    0,
-       65,   62,   61,   42,    0,    6,    6,    6,    6,    6,
-        3,  116,  116,  116,  116,   35,  116,  116,  116,   29,
-       66,  116,   54,   41,    0,    0,   25,  116,  116,   33,
-       51,  116,  116,   56,   49,   48,  116,   34,   52,   70,
-      109,   32,    0
+       16,   16,   16,    0,    0,    0,    0,    4,    4,    4,
+        4,    4,    4,    4,    4,    4,    4,    0,  118,    0,
+        0,    0,    0,  125,    0,    0,    0,    0,    0,  126,
+
+        0,    0,    0,    0,    0,    0,  118,    0,    0,    0,
+        0,  125,    0,    0,    0,    0,    0,  126,    0,    0,
+        0,    0,    0,    0,  118,    0,    0,    0,    0,  125,
+        0,    0,    0,    0,    0,  126,    0,    0,    0,    0,
+        0,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,  117,  117,   27,  117,
+      117,   19,  117,  117,  117,  117,   18,  117,  117,  117,
+      117,  117,  117,  117,  117,  117,  117,  117,  117,   43,
+        0,   59,    0,   40,    0,    0,   39,   38,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+
+      133,  133,  133,  133,   13,    0,  136,   19,  146,   18,
+      145,  145,   16,   16,   16,   16,   15,   16,   19,   18,
+        0,    0,    4,    4,    4,    4,   19,   18,    0,    0,
+       19,   18,    0,    0,   19,   18,    0,    0,    3,    3,
+        3,    3,  117,  117,   70,  117,  117,  117,  117,  117,
+      117,  117,  117,   69,  111,  117,  117,  117,   72,  117,
+      117,  117,  117,  117,  117,   53,    0,    0,    0,    0,
+        0,   37,   63,    0,    0,    0,   44,    0,    0,   50,
+        0,    0,  133,  133,   80,   75,  146,  145,  145,   16,
+       16,    0,    0,    4,    4,    0,    0,    0,    0,    0,
+
+        0,    3,    3,  117,  117,  117,  117,  117,  117,  117,
+      117,  117,  117,  117,  117,  117,  117,  117,   55,  117,
+      117,  117,  117,    0,    0,    0,    0,   36,    0,    0,
+        0,    0,   60,    0,   46,  133,  133,  139,  145,  145,
+       16,   16,    0,    0,    4,    4,    0,    0,    0,    0,
+        0,    0,    3,    3,  117,  117,  117,  117,  117,  117,
+      117,  117,  117,  112,  117,   58,  117,  117,  117,  117,
+       31,   22,  117,  117,  117,    0,    0,    0,    0,   47,
+        0,    0,    0,    0,    0,    7,   16,    7,    4,    4,
+        0,    7,    0,    7,    0,    7,    3,    3,   20,  117,
+
+      117,  117,   26,  117,  117,  117,  117,   30,  117,  117,
+      117,   28,  117,  117,   57,   66,    0,    0,   65,   62,
+       61,   42,    0,    6,    6,    6,    6,    6,    3,  117,
+      117,  117,  117,   35,  117,  117,  117,   29,   67,  117,
+       54,   41,    0,    0,   25,  117,  117,   33,   51,  117,
+      117,   56,   49,   48,  117,   34,   52,   71,  110,   32,
+        0
     } ;
 
 static yyconst flex_int32_t yy_ec[256] =
@@ -548,281 +549,283 @@
        10,   10,   10,    1,    1
     } ;
 
-static yyconst flex_int16_t yy_base[1205] =
+static yyconst flex_int16_t yy_base[1213] =
     {   0,
-        0, 4296,   64, 4295,  129,   81,  194, 4294,  259,    0,
+        0, 4304,   64, 4303,  129,   81,  194, 4302,  259,    0,
       324,    0,   72,   77,  389,    0,  454,    0,  519,    0,
-      584,    0, 4318, 6973,   98, 6973,  106, 4292,   64, 6973,
-       83, 4291,  102, 4303,   82,  633, 6973,  640,  647,  638,
-      694,  724,  729,   48,  100,  645,  703,  741,  711,  750,
-      709,  726,  776,  777,  704,  726,  769,  734,  802,  795,
-      811,  787, 4290,  810, 4269, 6973,  806, 6973,  841,  715,
-      790, 4296,  830,  856,    0,  862, 4283,  751,  878,  844,
-      883,  907, 4262,    0, 6973, 4302,  781, 4290,  896,  900,
-      935,  896, 4256,  997, 1062, 4235, 6973,  921,  907, 1008,
-
-     4255,  641,    0,    0,  941,  963,  940, 1111,  934, 4253,
-     1173, 1238,  791,  749, 6973,  798,  927,  868, 1014, 1078,
-     1301, 1080,  942, 1363, 1428,  901, 6973,  920, 1043, 1036,
-     1149, 1092, 1491, 1164,  989, 1553, 1618,  933, 6973,  972,
-     1049, 1089, 1202, 1266, 1681, 1173, 1041, 1743, 1808,    0,
-     6973, 4273,  813, 4263, 1038, 1116, 1857, 1229, 4250, 1919,
-     1984, 1101, 1144, 6973, 6973,  851, 6973,    0,    0, 1139,
-     1209, 1254, 1260, 6973, 6973, 6973, 4261, 6973, 6973, 1273,
-     1374, 6973, 6973, 1278, 6973,    0, 4238, 4218, 4224, 1036,
-     4213, 4215,  726, 4211,  940,   59,  790,  851, 4217,  671,
-
-     4220, 4207, 4231, 6973, 1306, 1101, 1329, 6973, 1213,    0,
-     4202, 4203, 1103,  860, 1269,  831,  878, 4199,   16, 4199,
-     4192, 1289, 6973, 6973, 6973, 6973, 1169, 4227, 4226, 1101,
-     4241, 1337, 1389, 1192, 1390, 1374, 1400, 1391, 1401, 1446,
-     6973, 6973, 6973, 6973, 4187, 1255, 4192, 4192, 1288, 4202,
-     4132, 4129, 1158, 4114, 4111,  988, 1461, 6973, 1468, 4147,
-     1456,    0,    0, 4116, 4118,  974, 1003, 4160, 1464, 1444,
-     1486, 1496,    0, 6973, 1044,    0,    0, 4154, 1485, 1564,
-     1496, 4115, 4114, 1569, 1247, 1519,    0, 1503, 2031, 1213,
-     2078, 2143, 2208, 4103, 4112, 4111, 1629, 1092,    0, 1540,
-
-        0, 1529, 1635, 1658, 4110, 4109, 1675, 1270, 1581,    0,
-     1553, 2255, 1300, 2302, 2367, 2432, 1306, 6973, 1329, 1605,
-     1667, 1358, 1381, 1601, 1635, 1709, 2495, 1759, 1478, 1603,
-     1825, 1689, 1771, 1398, 1719, 2539, 1729, 2586, 2651, 2716,
-     1415, 6973, 1418, 1795, 1797, 1453, 1528, 1664, 1687, 1837,
-     2779, 1862, 1669, 1722, 1935, 1848, 1885, 1657, 1894, 2823,
-     1857, 2870, 2935, 3000, 1683, 6973, 1761, 1835, 1960, 1767,
-     1773, 1791, 1906, 1949, 3063, 1957, 1793, 1891, 2001, 2008,
-     2022, 1846, 2013, 3107, 2051, 3154, 3219, 3284,    0, 6973,
-     1299,    0,    0, 4146, 1927, 2089, 2094, 4107, 4106, 2208,
-
-     1843, 2048,    0, 1953, 3331, 1502, 3378, 3443, 3508, 2035,
-     2078, 2106, 2110, 2117, 2221,    0, 4121, 4101, 4105, 4101,
-     4097, 4104, 4097, 4088, 4092,  988, 4083, 4091,  999, 4099,
-     4083, 4089, 4090, 4082, 4094, 4074, 4073, 4088, 4080, 4081,
-     6973, 2225, 1897, 2230, 2237, 1994,    0, 4051, 4062, 4051,
-     2203, 4040, 4059, 4050, 4040, 4047, 4045, 4050, 4036, 4032,
-     4032, 4029, 4045, 4037, 4040, 1375, 4069, 6973, 6973, 4055,
-     6973, 1489, 4056, 2270, 2450, 2271, 2272, 2273, 2313, 2454,
-     2315, 2444, 4019, 4033, 4034, 4025, 4051, 6973, 2324,    0,
-        0, 4028, 4021, 4028, 4017, 2438, 2334, 4018, 3946, 2462,
-
-     1931, 2313, 2338, 2101, 3555, 1529, 3986, 1766, 3602, 3667,
-     3938, 3945, 3942, 2428, 2512, 3943, 3940, 2500, 1999, 2342,
-     2516, 2249, 3714, 2462, 3761, 3826, 2602, 2288, 2491, 2732,
-     2483, 2544, 2551, 2610, 3889, 2754, 2053, 2762, 3936, 4001,
-     2624, 2506, 2503, 2784, 2520, 2770, 2812, 2616, 4064, 2814,
-     2337, 2816, 4111, 4176, 2886, 2574, 2549, 3016, 2629, 2894,
-     2900, 2843, 4239, 3038, 2734, 3046, 4286, 4351, 2909, 3941,
-     3938, 3009, 2026, 2728, 2816, 2530, 4398, 1895, 3978, 2065,
-     4445, 4510, 2838, 3049,    0, 3935, 3938, 3936, 3928, 3944,
-     3938, 3942, 3939, 3930, 3926,    0, 3933, 3933, 3935, 3918,
-
-     3925, 3927, 3931, 3929, 3929, 3909, 3927,    0, 3916, 3915,
-     3912, 3905, 3917, 3899, 3898, 3902, 6973, 3910, 3899, 3881,
-     3870, 3882, 3874, 1139, 3880, 3866, 3867, 3873, 3866, 3878,
-     2311, 6973,    0, 3908, 6973, 2471, 6973,    0, 3893, 3908,
-     2754, 2763, 3038, 3080, 3078, 3082, 2130,    0, 3862, 3867,
-     3866, 3861, 1564, 2477, 3053, 3093, 3860, 3859, 2473,    0,
-        0, 3892, 2567,    0,    0, 4575, 3896, 4640, 3852, 2259,
-     3855, 3854, 1496, 1639, 3097, 3101, 3853, 3852, 2752,    0,
-     4705, 3890, 4770, 3846, 3170, 3178, 2764, 2804, 3135, 3314,
-     2262, 2572, 2781, 2836, 3316, 3322, 2576, 2638, 4835, 3053,
-
-     4900, 3845, 3182, 3192, 3030, 3130, 3324, 3329, 2740, 2808,
-     2914, 3040, 3331, 3406, 2825, 2888, 4965, 3140, 5030, 3844,
-     3395, 3402, 3142, 3300, 3538, 3540, 2908, 2929, 3096, 3203,
-     3546, 3548, 3018, 3103, 5095, 3180, 5160, 3783, 3292, 3320,
-     3778, 3777, 2815,    0,    0, 3810, 3041,    0,    0, 5225,
-     3814, 5290, 3770, 3760, 3765,    0, 3758, 3300,    0, 3759,
-     3773, 3754, 3769,    0, 3761, 3760, 3756, 3768, 3750, 3763,
-     3754, 3747, 3747, 3369, 3759, 3751, 6973, 6973, 3745, 6973,
-     3747, 3744, 6973, 6973, 3729, 3731, 3735, 3718, 3721, 3701,
-     3697, 3704, 3682, 3625, 3605, 3613, 3349, 3729, 3545, 3547,
-
-     6973, 3659,    0,    0, 3610,    0, 3513, 3079,    0,    0,
-     5355, 1111, 6973, 3654, 6973, 6973,  724,  926,    0,    0,
-     5420, 1408, 3121, 3205, 3166, 1041, 3302, 3312, 3316, 1054,
-     3404, 3416, 3377, 1164,    0,    0, 3379, 1266, 3599, 3592,
-        0, 3579, 3545, 3540, 3541, 3530, 3534, 3529, 3512,    0,
-     3518, 3513, 3456, 3399,    0, 3365, 3359, 3340, 3348, 3331,
-     3328,    0, 3318, 3302, 3305, 3292, 6973, 6973, 3273, 3271,
-     3157, 6973, 3151, 3107, 6973, 3095, 3058, 3613, 3614, 3573,
-     3615, 3429, 3512, 3514, 1565, 1691, 1231, 1736, 1834, 1929,
-     1546, 1668, 1738, 1912, 2402, 2418, 3389, 3390, 3020, 3483,
-
-     3012, 2999, 3005, 2969, 2972, 2881, 2871, 2866, 2817, 2807,
-     2782, 2725, 2728,    0, 2712, 2686, 2686, 2596, 2597, 2590,
-     2555, 6973, 2499, 2503, 2476, 2436, 6973, 2435, 6973, 3630,
-     3635, 3590, 3627, 3629, 1819, 2030, 1711, 1917, 2061, 2066,
-     2836, 3027, 3143, 3295, 3519, 3613, 3741, 3742, 2425, 2420,
-     2393, 2302, 2286, 2270, 2270, 2249, 2236,    0, 2219,    0,
-     2206, 2188, 2192, 2173,    0,    0, 2151, 2095, 2090, 2048,
-     2048, 1970, 6973, 1958, 1931, 1911, 1855, 2610, 1885, 2790,
-     1848, 2894, 1831, 3746, 3644, 3790, 3651, 3795, 3736, 3085,
-     1825,    0, 1776, 1727, 1660,    0, 1609, 1595, 1586, 1581,
-
-        0, 1529, 1524, 1498,    0, 1445, 1402,    0, 1365, 1338,
-     6973, 6973, 6973, 6973, 1333, 6973,    0, 3434, 3535, 3562,
-        0, 1303, 1281, 1220, 1192,    0, 1177, 1146, 1134,    0,
-        0, 1119,    0, 6973, 1097, 1074,    0,  767,  773,    0,
-      738,  662,  614,    0, 6973, 6973,  598,    0,    0,    0,
-        0,    0, 6973, 5485, 5491, 5501, 5509, 5513, 5521, 5528,
-     5539, 5550, 5561, 5572, 5579, 5590, 5601, 5612, 5623, 5634,
-     5645, 5656, 5667, 5678, 5689, 5700, 5711, 5722, 5733, 5744,
-     5755, 5766, 5777, 5788, 5794, 5804, 5810, 5816, 5821, 5829,
-     5838, 5844, 5848, 5854, 5861, 5872, 5883, 5894, 5905, 5916,
-
-     5927, 5938, 5949, 5960, 5971, 5982, 5993, 6004, 6015, 6026,
-     6037, 6048, 6059, 6070, 6081, 6092, 6103, 6114, 6120, 6125,
-     6131, 6140, 6151, 6162, 6169, 6177, 6183, 6189, 6195, 6202,
-     6213, 6224, 6235, 6246, 6257, 6264, 6275, 6286, 6297, 6308,
-     6319, 6330, 6341, 6352, 6363, 6374, 6385, 6396, 6407, 6418,
-     6429, 6440, 6451, 6462, 6473, 6484, 6495, 6506, 6517, 6523,
-     6534, 6545, 6556, 6563, 6571, 6577, 6583, 6590, 6601, 6612,
-     6623, 6634, 6645, 6652, 6663, 6674, 6685, 6696, 6707, 6718,
-     6729, 6740, 6751, 6762, 6773, 6784, 6795, 6806, 6817, 6828,
-     6839, 6850, 6861, 6872, 6883, 6894, 6905, 6911, 6919, 6925,
+      584,    0, 4326, 6980,   98, 6980,  106, 4300,   64, 6980,
+       83, 4299,  102, 4311,   82,  633, 6980,  640,  647,  638,
+      694,  724,  729,   48,  100,  645,  703,  741,  711,  769,
+      709,  743,  777,  782,  704,  710,  771,  734,  799,  789,
+      812,  777, 4298,  798, 4277, 6980,  837, 6980,  843,  715,
+      816, 4308,  857,  863,    0,  869, 4291,  726,  885,  797,
+      890,  914, 4270,    0, 6980, 4310,  810, 4300,  903,  907,
+      942,  903, 4285, 1004, 1069, 4243, 6980,  928,  914, 1015,
+
+     4263,  641,    0,    0,  854,  970,  947, 1118,  941, 4261,
+     1180, 1245,  819,  821, 6980,  830,  934,  909, 1021, 1085,
+     1308, 1087,  927, 1370, 1435,  877, 6980,  893, 1050,  940,
+     1043, 1099, 1498, 1171,  996, 1560, 1625,  952, 6980,  979,
+     1156, 1047, 1209, 1273, 1688, 1180, 1093, 1750, 1815,    0,
+     6980, 4281,  933, 4271, 1091, 1123, 1864, 1236, 4258, 1926,
+     1991, 1151, 1096, 6980, 6980,  946, 6980,    0,    0, 1156,
+     1216, 1261, 1267, 6980, 6980, 6980, 4269, 6980, 6980, 1280,
+     1381, 6980, 6980, 1285, 6980,    0, 4246, 4226, 4232, 1013,
+     4224, 4223,  721, 4219,  947,   59,  709,  856, 4225,  671,
+
+     4228, 4219, 4239, 6980, 1313, 1105, 1336, 6980, 1108,    0,
+     4210, 4220, 4210, 1113,  977, 1006,  810,  739, 4206,   16,
+     4206, 4199, 1215, 6980, 6980, 6980, 6980, 1176, 4234, 4233,
+     1330, 4248, 1397, 1398, 1381, 1446, 1455, 1447, 1457, 1456,
+     1473, 6980, 6980, 6980, 6980, 4194, 1213, 4199, 4199, 1267,
+     4209, 4139, 4136, 1214, 4121, 4118,  995, 1361, 6980, 1420,
+     4154, 1409,    0,    0, 4123, 4125, 1049, 1010, 4167, 1526,
+     1451, 1481, 1490,    0, 6980, 1032,    0,    0, 4161, 1534,
+     1571, 1576, 4122, 4121, 1633, 1254, 1588,    0, 1348, 2038,
+     1155, 2085, 2150, 2215, 4110, 4119, 4118, 1639, 1099,    0,
+
+     1311,    0, 1560, 1682, 1750, 4117, 4116, 1762, 1277, 1599,
+        0, 1502, 2262, 1296, 2309, 2374, 2439, 1337, 6980, 1345,
+     1536, 1671, 1357, 1388, 1500, 1526, 1716, 2502, 1832, 1643,
+     1663, 1844, 1677, 1783, 1405, 1726, 2546, 1736, 2593, 2658,
+     2723, 1473, 6980, 1484, 1791, 1803, 1494, 1505, 1547, 1683,
+     1892, 2786, 1942, 1673, 1729, 1964, 1853, 1901, 1522, 1856,
+     2830, 1885, 2877, 2942, 3007, 1532, 6980, 1554, 1842, 1967,
+     1608, 1641, 1797, 1944, 1956, 3070, 2008, 1808, 1866, 2031,
+     1905, 2101, 1679, 2020, 3114, 2066, 3161, 3226, 3291,    0,
+     6980, 1192,    0,    0, 4153, 1960, 2107, 2215, 4114, 4113,
+
+     2227, 1695, 2124,    0, 1934, 3338, 1582, 3385, 3450, 3515,
+     1897, 1999, 2023, 2027, 2043, 2244,    0, 4128, 4108, 4112,
+     4108, 4104, 4111, 4104, 4095, 4099, 1070, 4090, 4098, 1014,
+     4106, 4090, 4096, 4097, 4089, 4101, 4081, 4080, 4095, 4087,
+     4088, 6980, 2232, 1706, 2111, 2248, 2055,    0, 4058, 4060,
+     4068, 4057, 1727, 4046, 4065, 4056, 4046, 4053, 4051, 4056,
+     4039, 4038, 4038, 4035, 4051, 4039, 4046, 1201, 4075, 6980,
+     6980, 4061, 6980, 1681, 4062, 2277, 2457, 2278, 2279, 2280,
+     2320, 2461, 2322, 2451, 4025, 4039, 4040, 4031, 4057, 6980,
+     2331,    0,    0, 4034, 4027, 4034, 4023, 2445, 2341, 3955,
+
+     3952, 2469, 1848, 2320, 2345, 2093, 3562, 1982, 3992, 2094,
+     3609, 3674, 3944, 3951, 3948, 1647, 2519, 3949, 3946, 2507,
+     1938, 2349, 2523, 2223, 3721, 2469, 3768, 3833, 2609, 2068,
+     2272, 2739, 2482, 2551, 2558, 2617, 3896, 2506, 2344, 2761,
+     3943, 4008, 2631, 2295, 2556, 2751, 2623, 2772, 2792, 2806,
+     4071, 2795, 2513, 2814, 4118, 4183, 2825, 2479, 2579, 2893,
+     2636, 2905, 2915, 2901, 4246, 2858, 2741, 3035, 4293, 4358,
+     3029, 3947, 3944, 3007, 2006, 2565, 2758, 2474, 4405, 2099,
+     3984, 2480, 4452, 4517, 2847, 2909,    0, 3941, 3944, 3942,
+     3934, 3950, 3944, 3948, 3945, 3936, 3932,    0, 3939, 3939,
+
+     3940, 3924, 3931, 3933, 3937, 3935, 3935, 3915, 3933,    0,
+     3922, 3921, 3918, 3919, 3906, 3918, 3904, 3903, 3905, 6980,
+     3892, 3883, 3886, 3875, 3887, 3879,  861, 3885, 3871, 3872,
+     3878, 3871, 3880, 2507, 6980,    0, 3910, 6980, 2511, 6980,
+        0, 3898, 3913, 2814, 2815, 3045, 3046, 3054, 2848, 2029,
+        0, 3867, 3868, 3867, 3866, 1821, 2484, 3037, 3059, 3865,
+     3864, 2524,    0,    0, 3897, 2574,    0,    0, 4582, 3901,
+     4647, 3857, 2132, 3860, 3859,  724, 1376, 3063, 3089, 3858,
+     3857, 2904,    0, 4712, 3895, 4777, 3851, 3102, 3109, 3094,
+     3099, 3143, 3148, 2144, 2268, 3032, 3177, 3321, 3323, 2355,
+
+     2455, 4842, 3134, 4907, 3790, 3187, 3191, 3150, 3307, 3329,
+     3331, 2553, 2645, 3211, 3309, 3336, 3338, 2747, 2753, 4972,
+     3195, 5037, 3781, 3200, 3401, 3316, 3319, 3545, 3547, 2763,
+     2780, 3403, 3414, 3553, 3555, 2839, 2852, 5102, 3344, 5167,
+     3780, 3353, 3408, 3783, 3782, 2779,    0,    0, 3815, 2808,
+        0,    0, 5232, 3819, 5297, 3775, 3765, 3770,    0, 3763,
+     3057,    0, 3764, 3778, 3759, 3774,    0, 3766, 3765, 3761,
+     3773, 3755, 3768, 3759, 3752, 3752, 3307, 3763, 3761, 6980,
+     3764, 6980, 3759, 6980, 3757, 3746, 6980, 6980, 3734, 3737,
+     3739, 3716, 3715, 3707, 3701, 3713, 3693, 3702, 3684, 3626,
+
+     3552, 3736, 3554, 3737, 6980, 3669,    0,    0, 3619,    0,
+     3396, 3519,    0,    0, 5362, 1118, 6980, 3661, 6980, 6980,
+     1128,  765,    0,    0, 5427, 1480, 2929, 3037, 3014, 1171,
+     3090, 3122, 3098, 1211, 3189, 3213, 3363, 1266,    0,    0,
+     3381, 1336, 3617, 3616,    0, 3614, 3608, 3602, 3604, 3596,
+     3600, 3596, 3581,    0, 3589, 3581, 3545, 3557,    0, 3534,
+     3535, 3529, 3527, 3519, 3523,    0, 3479, 3484, 3465, 3374,
+     3356, 6980, 6980, 3331, 3326, 3301, 6980, 3292, 3281, 6980,
+     3291, 3283, 3555, 3620, 3425, 3430, 3431, 2847, 3520, 1611,
+     1698, 1299, 1618, 2512, 2595, 1193, 1553, 1622, 1743, 1841,
+
+     1919, 2425, 2754, 3259, 3161, 3149, 3138, 3136, 3081, 3083,
+     3073, 3062, 3056, 3044, 3044, 3034, 3016, 3017,    0, 3004,
+     2987, 2988, 2972, 2860, 2794, 2730, 2709, 6980, 2689, 2697,
+     2612, 2592, 6980, 2511, 6980, 3632, 3635, 3438, 3623, 3637,
+     1400, 1463, 2254, 2817, 2564, 2848, 1937, 3127, 3302, 3374,
+     3526, 3539, 3548, 3562, 2432, 2427, 2409, 2396, 2293, 2277,
+     2277, 2256, 2243,    0, 2226,    0, 2202, 2199, 2187, 2167,
+        0,    0, 2082, 2056, 2037, 2031, 1977, 1967, 1914, 6980,
+     1881, 1868, 1851, 1793, 1609, 1837, 2111, 1829, 2617, 1808,
+     3658, 3542, 3664, 3751, 3793, 3798, 2933, 1786,    0, 1727,
+
+     1707, 1695,    0, 1649, 1655, 1633, 1570,    0, 1534, 1460,
+     1444,    0, 1397, 1388,    0, 6980, 1366, 1282, 6980, 6980,
+     6980, 6980, 1280, 6980,    0, 3434, 3441, 3593,    0, 1233,
+     1218, 1201, 1158,    0, 1128, 1115, 1027,    0,    0,  907,
+        0, 6980,  898,  839,    0,  816,  767,    0,  719,  662,
+      614,    0, 6980, 6980,  598,    0,    0,    0,    0,    0,
+     6980, 5492, 5498, 5508, 5516, 5520, 5528, 5535, 5546, 5557,
+     5568, 5579, 5586, 5597, 5608, 5619, 5630, 5641, 5652, 5663,
+     5674, 5685, 5696, 5707, 5718, 5729, 5740, 5751, 5762, 5773,
+     5784, 5795, 5801, 5811, 5817, 5823, 5828, 5836, 5845, 5851,
+
+     5855, 5861, 5868, 5879, 5890, 5901, 5912, 5923, 5934, 5945,
+     5956, 5967, 5978, 5989, 6000, 6011, 6022, 6033, 6044, 6055,
+     6066, 6077, 6088, 6099, 6110, 6121, 6127, 6132, 6138, 6147,
+     6158, 6169, 6176, 6184, 6190, 6196, 6202, 6209, 6220, 6231,
+     6242, 6253, 6264, 6271, 6282, 6293, 6304, 6315, 6326, 6337,
+     6348, 6359, 6370, 6381, 6392, 6403, 6414, 6425, 6436, 6447,
+     6458, 6469, 6480, 6491, 6502, 6513, 6524, 6530, 6541, 6552,
+     6563, 6570, 6578, 6584, 6590, 6597, 6608, 6619, 6630, 6641,
+     6652, 6659, 6670, 6681, 6692, 6703, 6714, 6725, 6736, 6747,
+     6758, 6769, 6780, 6791, 6802, 6813, 6824, 6835, 6846, 6857,
 
-     6932, 6943, 6950, 6961
+     6868, 6879, 6890, 6901, 6912, 6918, 6926, 6932, 6939, 6950,
+     6957, 6968
     } ;
 
-static yyconst flex_int16_t yy_def[1205] =
+static yyconst flex_int16_t yy_def[1213] =
     {   0,
-     1053,    1,    1,    3, 1053,    5, 1053,    7, 1053,    9,
-     1053,   11,    9,    9, 1053,   15, 1053,   17, 1053,   19,
-     1053,   21, 1053, 1053, 1053, 1053, 1053, 1053, 1054, 1053,
-     1055, 1053, 1053, 1056, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1057, 1057, 1057, 1057,
-     1057, 1057, 1057, 1057, 1053, 1053, 1053, 1053, 1053, 1053,
-       39, 1053, 1053, 1057, 1053, 1053, 1053, 1053, 1053, 1054,
-     1058, 1056, 1053, 1059,   41, 1053, 1053, 1060, 1060, 1060,
-     1053, 1053, 1053, 1061, 1053, 1061, 1062, 1063, 1061, 1061,
-     1061,   91, 1061, 1064, 1064, 1061, 1053, 1053,   41, 1053,
-
-     1065, 1065, 1066, 1066, 1067, 1066, 1066, 1066,  108, 1066,
-     1068, 1068, 1054, 1069, 1053, 1069, 1070, 1071, 1069, 1069,
-     1069,  121, 1069, 1072, 1072, 1073, 1053, 1073, 1074, 1075,
-     1073, 1073, 1073,  133, 1073, 1076, 1076, 1077, 1053, 1077,
-     1078, 1079, 1077, 1077, 1077,  145, 1077, 1080, 1080, 1081,
-     1053, 1081, 1082, 1083, 1081, 1081, 1081,  157, 1081, 1084,
-     1084, 1053, 1053, 1053, 1053, 1054, 1053, 1054, 1085, 1085,
-     1085, 1085, 1085, 1053, 1053, 1053, 1086, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1087, 1087, 1087, 1087, 1087,
-     1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087,
+     1061,    1,    1,    3, 1061,    5, 1061,    7, 1061,    9,
+     1061,   11,    9,    9, 1061,   15, 1061,   17, 1061,   19,
+     1061,   21, 1061, 1061, 1061, 1061, 1061, 1061, 1062, 1061,
+     1063, 1061, 1061, 1064, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1065, 1065, 1065, 1065,
+     1065, 1065, 1065, 1065, 1061, 1061, 1061, 1061, 1061, 1061,
+       39, 1061, 1061, 1065, 1061, 1061, 1061, 1061, 1061, 1062,
+     1066, 1064, 1061, 1067,   41, 1061, 1061, 1068, 1068, 1068,
+     1061, 1061, 1061, 1069, 1061, 1069, 1070, 1071, 1069, 1069,
+     1069,   91, 1069, 1072, 1072, 1069, 1061, 1061,   41, 1061,
+
+     1073, 1073, 1074, 1074, 1075, 1074, 1074, 1074,  108, 1074,
+     1076, 1076, 1062, 1077, 1061, 1077, 1078, 1079, 1077, 1077,
+     1077,  121, 1077, 1080, 1080, 1081, 1061, 1081, 1082, 1083,
+     1081, 1081, 1081,  133, 1081, 1084, 1084, 1085, 1061, 1085,
+     1086, 1087, 1085, 1085, 1085,  145, 1085, 1088, 1088, 1089,
+     1061, 1089, 1090, 1091, 1089, 1089, 1089,  157, 1089, 1092,
+     1092, 1061, 1061, 1061, 1061, 1062, 1061, 1062, 1093, 1093,
+     1093, 1093, 1093, 1061, 1061, 1061, 1094, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1095, 1095, 1095, 1095, 1095,
+     1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095,
+
+     1095, 1095, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1096,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1097,
+     1098, 1099, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098,
+     1098, 1061, 1061, 1061, 1061, 1061, 1061, 1095, 1095, 1095,
+     1095, 1095, 1095, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1100, 1100, 1101, 1102, 1102, 1102, 1102, 1103, 1099, 1103,
+     1103, 1061, 1061, 1104, 1061, 1105, 1104, 1105, 1106, 1104,
+     1104, 1104, 1104, 1104, 1104, 1104, 1104, 1104, 1104, 1104,
+     1104, 1107, 1061, 1107, 1104, 1061, 1061, 1061, 1097, 1108,
 
-     1087, 1087, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1088,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1089, 1090,
-     1091, 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1090,
-     1053, 1053, 1053, 1053, 1053, 1053, 1087, 1087, 1087, 1087,
-     1087, 1087, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1092,
-     1092, 1093, 1094, 1094, 1094, 1094, 1095, 1091, 1095, 1095,
-     1053, 1053, 1096, 1053, 1097, 1096, 1097, 1098, 1096, 1096,
-     1096, 1096, 1096, 1096, 1096, 1096, 1096, 1096, 1096, 1096,
-     1099, 1053, 1099, 1096, 1053, 1053, 1053, 1089, 1100, 1101,
-
-     1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100,
-     1100, 1100, 1100, 1102, 1053, 1102, 1103, 1053, 1103, 1104,
-     1104, 1103, 1104, 1105, 1105, 1103, 1103, 1103, 1103, 1103,
-     1103, 1103, 1103, 1103, 1103, 1103, 1103, 1106, 1053, 1106,
-     1107, 1053, 1107, 1108, 1108, 1107, 1108, 1109, 1109, 1107,
-     1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107,
-     1107, 1110, 1053, 1110, 1111, 1053, 1111, 1112, 1112, 1111,
-     1112, 1113, 1113, 1111, 1111, 1111, 1111, 1111, 1111, 1111,
-     1111, 1111, 1111, 1111, 1111, 1114, 1053, 1114, 1115, 1053,
-     1116, 1115, 1116, 1117, 1115, 1115, 1115, 1115, 1115, 1115,
-
-     1115, 1115, 1115, 1115, 1115, 1115, 1118, 1053, 1118, 1053,
-     1119, 1119, 1119, 1119, 1053, 1120, 1120, 1120, 1120, 1120,
-     1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120,
-     1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120,
-     1053, 1053, 1053, 1053, 1053, 1053, 1121, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1122, 1123, 1053, 1053, 1053,
-     1053, 1124, 1125, 1126, 1126, 1126, 1126, 1126, 1126, 1126,
-     1126, 1126, 1053, 1120, 1120, 1053, 1127, 1053, 1127, 1128,
-     1129, 1129, 1129, 1129, 1129, 1130, 1131, 1131, 1131, 1131,
-
-     1131, 1131, 1131, 1131, 1131, 1132, 1133, 1134, 1135, 1053,
-     1131, 1053, 1053, 1136, 1137, 1137, 1137, 1137, 1137, 1137,
-     1137, 1137, 1137, 1138, 1139, 1053, 1140, 1140, 1140, 1140,
-     1140, 1140, 1140, 1140, 1140, 1141, 1142, 1143, 1144, 1053,
-     1145, 1145, 1145, 1145, 1145, 1145, 1145, 1145, 1145, 1146,
-     1147, 1148, 1149, 1053, 1150, 1150, 1150, 1150, 1150, 1150,
-     1150, 1150, 1150, 1151, 1152, 1153, 1154, 1053, 1155, 1155,
-     1155, 1155, 1155, 1155, 1155, 1155, 1155, 1156, 1157, 1158,
-     1159, 1053, 1053, 1053, 1160, 1160, 1160, 1160, 1160, 1160,
-     1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160,
-
-     1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1161, 1053, 1161, 1162, 1053, 1163, 1053, 1163, 1164, 1053,
-     1165, 1165, 1165, 1165, 1165, 1165, 1053, 1166, 1167, 1167,
-     1167, 1167, 1168, 1168, 1169, 1169, 1169, 1169, 1170, 1169,
-     1170, 1171, 1172, 1169, 1172, 1173, 1169, 1053,  668, 1169,
-     1053, 1053, 1174, 1174, 1175, 1175, 1175, 1175, 1176, 1175,
-     1177, 1175, 1053,  683, 1178, 1178, 1178, 1178, 1179, 1179,
-     1178, 1179, 1180, 1180, 1181, 1181, 1178, 1181, 1182, 1178,
-
-     1053,  701, 1183, 1183, 1183, 1183, 1184, 1184, 1183, 1184,
-     1185, 1185, 1186, 1186, 1183, 1186, 1187, 1183, 1053,  719,
-     1188, 1188, 1188, 1188, 1189, 1189, 1188, 1189, 1190, 1190,
-     1191, 1191, 1188, 1191, 1192, 1188, 1053,  737, 1193, 1193,
-     1193, 1193, 1194, 1193, 1194, 1195, 1196, 1193, 1196, 1197,
-     1193, 1053,  752, 1198, 1198, 1198, 1198, 1198, 1198, 1198,
-     1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198,
-     1198, 1198, 1198, 1198, 1198, 1198, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1199, 1199, 1199, 1199,
-
-     1053, 1053, 1200, 1200, 1200, 1200, 1201, 1201, 1202, 1202,
-     1053,  811, 1053, 1202, 1053, 1053, 1203, 1203, 1204, 1204,
-     1053,  821, 1178, 1178,  701,  701, 1183, 1183,  719,  719,
-     1188, 1188,  737,  737, 1193, 1193,  752,  752, 1198, 1198,
-     1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198,
-     1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198,
-     1198, 1198, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1199, 1199, 1199,
-     1199, 1200, 1201, 1201,  811,  811, 1203, 1203,  821,  821,
-      701,  701,  719,  719,  737,  737,  752,  752, 1198, 1198,
-
-     1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198,
-     1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1199,
-     1199, 1053, 1201, 1201,  811,  811, 1203, 1203,  821,  821,
-      701,  701,  719,  719,  737,  737,  752,  752, 1198, 1198,
-     1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198,
-     1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1202,
-     1202, 1204, 1204, 1178, 1178, 1183, 1183, 1188, 1188, 1193,
-     1193, 1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198,
-
-     1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1202, 1178, 1183, 1188,
-     1193, 1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198,
-     1198, 1198, 1198, 1053, 1053, 1053, 1198, 1198, 1198, 1198,
-     1198, 1198, 1198, 1198, 1053, 1053, 1198, 1198, 1198, 1198,
-     1198, 1198,    0, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
+     1109, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108,
+     1108, 1108, 1108, 1108, 1110, 1061, 1110, 1111, 1061, 1111,
+     1112, 1112, 1111, 1112, 1113, 1113, 1111, 1111, 1111, 1111,
+     1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1114, 1061,
+     1114, 1115, 1061, 1115, 1116, 1116, 1115, 1116, 1117, 1117,
+     1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115,
+     1115, 1115, 1118, 1061, 1118, 1119, 1061, 1119, 1120, 1120,
+     1119, 1120, 1121, 1121, 1119, 1119, 1119, 1119, 1119, 1119,
+     1119, 1119, 1119, 1119, 1119, 1119, 1122, 1061, 1122, 1123,
+     1061, 1124, 1123, 1124, 1125, 1123, 1123, 1123, 1123, 1123,
+
+     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1126, 1061, 1126,
+     1061, 1127, 1127, 1127, 1127, 1061, 1128, 1128, 1128, 1128,
+     1128, 1128, 1128, 1128, 1128, 1128, 1128, 1128, 1128, 1128,
+     1128, 1128, 1128, 1128, 1128, 1128, 1128, 1128, 1128, 1128,
+     1128, 1061, 1061, 1061, 1061, 1061, 1061, 1129, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1130, 1131, 1061,
+     1061, 1061, 1061, 1132, 1133, 1134, 1134, 1134, 1134, 1134,
+     1134, 1134, 1134, 1134, 1061, 1128, 1128, 1061, 1135, 1061,
+     1135, 1136, 1137, 1137, 1137, 1137, 1137, 1138, 1139, 1139,
+
+     1139, 1139, 1139, 1139, 1139, 1139, 1139, 1140, 1141, 1142,
+     1143, 1061, 1139, 1061, 1061, 1144, 1145, 1145, 1145, 1145,
+     1145, 1145, 1145, 1145, 1145, 1146, 1147, 1061, 1148, 1148,
+     1148, 1148, 1148, 1148, 1148, 1148, 1148, 1149, 1150, 1151,
+     1152, 1061, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153,
+     1153, 1154, 1155, 1156, 1157, 1061, 1158, 1158, 1158, 1158,
+     1158, 1158, 1158, 1158, 1158, 1159, 1160, 1161, 1162, 1061,
+     1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1164,
+     1165, 1166, 1167, 1061, 1061, 1061, 1168, 1168, 1168, 1168,
+     1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168,
+
+     1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168,
+     1168, 1168, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1169, 1061, 1169, 1170, 1061, 1171, 1061,
+     1171, 1172, 1061, 1173, 1173, 1173, 1173, 1173, 1173, 1061,
+     1174, 1175, 1175, 1175, 1175, 1176, 1176, 1177, 1177, 1177,
+     1177, 1178, 1177, 1178, 1179, 1180, 1177, 1180, 1181, 1177,
+     1061,  671, 1177, 1061, 1061, 1182, 1182, 1183, 1183, 1183,
+     1183, 1184, 1183, 1185, 1183, 1061,  686, 1186, 1186, 1186,
+     1186, 1187, 1187, 1186, 1187, 1188, 1188, 1189, 1189, 1186,
+
+     1189, 1190, 1186, 1061,  704, 1191, 1191, 1191, 1191, 1192,
+     1192, 1191, 1192, 1193, 1193, 1194, 1194, 1191, 1194, 1195,
+     1191, 1061,  722, 1196, 1196, 1196, 1196, 1197, 1197, 1196,
+     1197, 1198, 1198, 1199, 1199, 1196, 1199, 1200, 1196, 1061,
+      740, 1201, 1201, 1201, 1201, 1202, 1201, 1202, 1203, 1204,
+     1201, 1204, 1205, 1201, 1061,  755, 1206, 1206, 1206, 1206,
+     1206, 1206, 1206, 1206, 1206, 1206, 1206, 1206, 1206, 1206,
+     1206, 1206, 1206, 1206, 1206, 1206, 1206, 1206, 1206, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+
+     1207, 1207, 1207, 1207, 1061, 1061, 1208, 1208, 1208, 1208,
+     1209, 1209, 1210, 1210, 1061,  815, 1061, 1210, 1061, 1061,
+     1211, 1211, 1212, 1212, 1061,  825, 1186, 1186,  704,  704,
+     1191, 1191,  722,  722, 1196, 1196,  740,  740, 1201, 1201,
+      755,  755, 1206, 1206, 1206, 1206, 1206, 1206, 1206, 1206,
+     1206, 1206, 1206, 1206, 1206, 1206, 1206, 1206, 1206, 1206,
+     1206, 1206, 1206, 1206, 1206, 1206, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1207, 1207, 1207, 1207, 1208, 1209, 1209,  815,
+      815, 1211, 1211,  825,  825,  704,  704,  722,  722,  740,
+
+      740,  755,  755, 1206, 1206, 1206, 1206, 1206, 1206, 1206,
+     1206, 1206, 1206, 1206, 1206, 1206, 1206, 1206, 1206, 1206,
+     1206, 1206, 1206, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1207, 1207, 1061, 1209, 1209,
+      815,  815, 1211, 1211,  825,  825,  704,  704,  722,  722,
+      740,  740,  755,  755, 1206, 1206, 1206, 1206, 1206, 1206,
+     1206, 1206, 1206, 1206, 1206, 1206, 1206, 1206, 1206, 1206,
+     1206, 1206, 1206, 1206, 1206, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1210, 1210, 1212, 1212,
+     1186, 1186, 1191, 1191, 1196, 1196, 1201, 1201, 1206, 1206,
+
+     1206, 1206, 1206, 1206, 1206, 1206, 1206, 1206, 1206, 1206,
+     1206, 1206, 1206, 1206, 1206, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1210, 1186, 1191, 1196, 1201, 1206,
+     1206, 1206, 1206, 1206, 1206, 1206, 1206, 1206, 1206, 1206,
+     1206, 1061, 1061, 1061, 1206, 1206, 1206, 1206, 1206, 1206,
+     1206, 1206, 1061, 1061, 1206, 1206, 1206, 1206, 1206, 1206,
+        0, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
 
-     1053, 1053, 1053, 1053
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061
     } ;
 
-static yyconst flex_int16_t yy_nxt[7039] =
+static yyconst flex_int16_t yy_nxt[7046] =
     {   0,
        24,   25,   26,   27,   25,   28,   29,   30,   31,   32,
        33,   34,   35,   36,   37,   38,   39,   40,   41,   42,
@@ -830,14 +833,14 @@
        47,   47,   48,   47,   48,   47,   48,   48,   47,   24,
        47,   47,   47,   47,   47,   47,   47,   49,   47,   50,
        47,   47,   51,   47,   52,   47,   47,   53,   47,   54,
-       47,   47,   47,   55,   56,   58,  462,   59,   58,   24,
-      167,  222,  223,   24,   24,  463,   24,   60,  113,   60,
+       47,   47,   47,   55,   56,   58,  464,   59,   58,   24,
+      167,  223,  224,   24,   24,  465,   24,   60,  113,   60,
        61,   24,   81,  113,   82,   81,   62,   63,   24,   24,
        41,   42,   42,   42,  178,   41,   42,   42,   42,  162,
 
-      430,  162,  162,  168,  431,   83,  179,  162,  164,  162,
+      431,  162,  162,  168,  432,   83,  179,  162,  164,  162,
       162,   47,  175,   47,  163,  170,   47,  171,   47,  172,
-      173,   64,  163,   47,  224,  225,  176,   24,   24,   66,
+      173,   64,  163,   47,  225,  226,  176,   24,   24,   66,
        67,   68,   69,   67,   66,   70,   66,   71,   66,   66,
        72,   66,   73,   66,   73,   74,   66,   75,   76,   76,
        76,   66,   77,   66,   66,   78,   78,   78,   78,   78,
@@ -895,712 +898,713 @@
       160,  160,  160,  150,  160,  160,  160,  160,  160,  160,
       160,  160,  160,  160,  160,  160,  160,  160,  160,  160,
       160,  161,  160,  160,  160,  160,  160,  150,  150,  180,
-     1052,  181,  181,  181,  181,  203,  180,  182,  181,  181,
-      181,  181,  204,  268,  183,  184,  184,  184,  184,  226,
-      227,  185, 1051,  186,  186,  186,  186,  186,  187,  186,
-      186,  186,  186,  186,  186,  186,  298,  186,  188,  189,
+     1060,  181,  181,  181,  181,  203,  180,  182,  181,  181,
+      181,  181,  204,  269,  183,  184,  184,  184,  184,  227,
+      228,  185, 1059,  186,  186,  186,  186,  186,  187,  186,
+      186,  186,  186,  186,  186,  186,  299,  186,  188,  189,
       190,  186,  191,  192,  193,  186,  194,  195,  196,  197,
 
       186,  198,  186,  199,  200,  201,  186,  186,  186,  202,
-      205,  228,  181,  181,  181,  181,  437,  228,  229,  228,
-     1050,  167,  206,  207,  229,  231,  229,  208,  241,  209,
-      438,  231,  210,  231,  228,  246,  206,  246,  246,  207,
-      205,  229,  181,  181,  181,  181,  268,  209,  231,  228,
-      243,  318,  319,  207,  168,  210,  229,  208,  228,  232,
-      232,  232,  232,  231,  233,  229,  229,  242,  236,  207,
-      211,  424,  231,  268,  887,  212,  425,  237,  213,  214,
-      215,  216,  217,  218,  228,  228,  219,  276,  220,  221,
-      244,  229,  229,  224,  225, 1049,  234,  167,  231,  231,
-
-      318,  319,  235,  246,  164,  246,  246,  257,  258,  259,
-      257,  180,  245,  181,  181,  181,  181, 1048,  228,  392,
-      277,  238,  261, 1047,  261,  229,  261,  261,  211,  240,
-      168,  432,  231,  433,  239, 1053,  253,  214,  215,  254,
-      255,  218,  257,  258,  259,  257,  180,  221,  181,  181,
-      181,  181,  393,  186,  247,  238,  186,  167,  186,  229,
-      248,  249,  250,  251,  262,  252,  268,  186,  186,  186,
-      318,  325,  457,  186,  184,  184,  184,  184,  205,  322,
-      181,  181,  181,  181,  271,  258,  272,  271,  458,  270,
-      168,  207,  434,  229,  435,  208,  269,  269,  269,  269,
-
-      268,  264,  265,  342,  343,  452,  266,  207,  271,  258,
-      272,  271,  279,  453,  280,  280,  280,  280,  281,  281,
-      281,  281,  342,  343,  273,  297,  297,  297,  297,  318,
-      321,  273,  459,  322,  273,  366,  367,  460,  273,  184,
-      184,  184,  184,  299,  318,  319,  282,  177,  268,  273,
-      283,  284,  301,  280,  280,  280,  280,  273,  304,  304,
-      304,  304,  299,  285,  286,  337,  323,  295,  287,  299,
-      288,  296,  299,  289,  366,  367,  299,  285,  888,  302,
-      286,  303,  303,  303,  303,  427,  305,  299,  288,  428,
-      306,  342,  343,  429,  466,  299,  289,  273,  273,  467,
-
-      273,  273,  273,  273,  273,  273,  273,  273,  273,  273,
-      273,  273,  361,  273,  273,  494,  318,  319,  229,  292,
-      273,  273,  273,  495,  205,  268,  297,  297,  297,  297,
-      326,  594,  327,  327,  327,  327,  273,  207,  342,  349,
-      598,  208,  599,  366,  367,  342,  345,  346,  595,  346,
-      276,  366,  369,  207,  395,  370,  396,  396,  396,  396,
-      273,  273,  273,  273,  385,  273,  273,  273,  273,  273,
-      273,  273,  273,  273,  273,  273,  273,  420,  273,  273,
-      318,  319,  347,  277,  292,  273,  273,  273,  371,  421,
-      338,  366,  373,  892,  342,  343,  328,  328,  328,  328,
-
-      370,  273,  162,  362,  162,  162,  894,  293,  317,  228,
-      352,  352,  352,  352,  268,  317,  229,  163,  317,  443,
-      443, 1046,  317,  231,  329,  273,  273,  307,  330,  303,
-      303,  303,  303,  317,  397,  397,  397,  397,  353,  308,
-      309,  317,  354, 1045,  310,  410,  311,  410,  410,  312,
-      514,  342,  343,  308,  450,  451,  309,  411,  411,  411,
-      411,  291,  398,  886,  311,  350,  399,  351,  351,  351,
-      351, 1044,  312,  299,  299,  299,  299,  299,  299,  789,
-      299,  299,  299,  299,  299,  299,  299,  299,  790,  299,
-      299, 1043,  341,  469,  470,  315,  299,  299,  299,  341,
-
-      228,  365,  341, 1042,  366,  367,  341,  229,  365,  450,
-      486,  365,  299,  386,  231,  365,  896,  341,  374,  506,
-      375,  375,  375,  375,  507,  341,  365,  412,  412,  412,
-      412,  446,  446,  446,  365, 1041,  299,  299,  299,  299,
-      299,  299,  299,  299, 1040,  299,  299,  299,  299,  299,
-      299,  299,  299,  268,  299,  299,  246,  389,  246,  246,
-      315,  299,  299,  299,  389,  501,  501,  389,  366,  367,
-     1039,  389,  413,  413,  413,  413,  937,  299,  414,  414,
-      414,  414,  389,  316,  376,  376,  376,  376,  519,  519,
-      389,  184,  184,  184,  184,  466,  184,  184,  184,  184,
-
-      467,  299,  299,  318,  319,  392,  466,  415,  318,  319,
-      454,  524,  377,  468,  455,  407,  378,  331,  898,  327,
-      327,  327,  327,  415,  442,  442,  442,  442,  456,  332,
-      333,  318,  319,  427,  334,  415,  335,  428,  393,  336,
-     1038,  485,  444,  332,  444,  228,  333,  445,  445,  445,
-      445,  415,  229, 1037,  335,  474,  474,  474,  474,  231,
-      318,  319,  336,  317,  317,  318,  319,  317,  317,  317,
-      317,  317,  317,  317,  317,  317,  317,  317, 1036,  317,
-      317,  632,  228,  318,  321,  339,  317,  317,  317,  229,
-      205, 1035,  181,  181,  181,  181,  231,  228,  228,  228,
-
-      318,  319,  317,  207,  229,  229,  229,  208,  228,  228,
-     1034,  231,  231,  231,  633,  229,  229,  342,  343,  207,
-      342,  343,  231,  231,  477,  478,  317,  317,  317,  317,
-      318,  319,  317,  317,  317,  317,  317,  317,  317,  317,
-      317,  317,  317,  479,  317,  317, 1033,  475,  476,  480,
-      339,  317,  317,  317,  228,  342,  343,  481,  314,  229,
-      890,  229,  257,  258,  259,  257,  268,  317,  231,  257,
-      258,  259,  257,  340,  489,  489,  489,  489,  488,  229,
-      318,  319,  269,  269,  269,  269,  268,  271,  258,  272,
-      271,  317,  317,  342,  343,  637,  482,  271,  258,  272,
-
-      271, 1032,  496,  281,  281,  281,  281,  355,  578,  351,
-      351,  351,  351,  579,  281,  281,  281,  281,  268,  356,
-      357,  504,  504,  504,  358,  497,  359,  528,  638,  360,
-      342,  345,  502,  356,  502,  660,  357,  503,  503,  503,
-      503,  497,  299, 1031,  359,  817,  177,  304,  304,  304,
-      304,  301,  360,  341,  341,  342,  343,  341,  341,  341,
-      341,  341,  341,  341,  341,  341,  341,  341,  661,  341,
-      341,  522,  522,  522, 1030,  363,  341,  341,  341,  229,
-      284, 1029,  280,  280,  280,  280,  268,  500,  500,  500,
-      500,  941,  341,  286,  520,  338,  520,  287,  497,  521,
-
-      521,  521,  521,  318,  325,  318,  319,  318,  321,  286,
-      935,  322,  322,  807,  497,  291,  341,  341,  341,  341,
-      342,  343,  341,  341,  341,  341,  341,  341,  341,  341,
-      341,  341,  341, 1028,  341,  341, 1027,  318,  325, 1026,
-      363,  341,  341,  341,  323,  205,  322,  297,  297,  297,
-      297,  307,  529,  303,  303,  303,  303,  341,  207,  342,
-      343,  268,  208,  364,  309, 1025,  342,  349,  310,  318,
-      321,  342,  343,  322,  207,  346,  304,  304,  304,  304,
-      309,  341,  341,  366,  367,  366,  367,  515,  818,  342,
-      349,  318,  319,  518,  518,  518,  518,  379,  346,  375,
-
-      375,  375,  375,  515,  515, 1024,  323,  531,  531,  380,
-      381,  318,  319,  942,  382,  978,  383,  338,  542,  384,
-      515,  318,  319,  380,  342,  343,  381,  328,  328,  328,
-      328,  318,  319,  268,  383,  536,  936,  534,  534,  534,
-      537,  291,  384,  365,  365,  366,  367,  365,  365,  365,
-      365,  365,  365,  365,  365,  365,  365,  365,  268,  365,
-      365,  318,  319,  366,  367,  387,  365,  365,  365,  366,
-      367,  543,  664,  318,  319,  366,  369,  328,  328,  328,
-      328,  938,  365,  943,  532, 1023,  532,  362,  527,  533,
-      533,  533,  533,  366,  373,  366,  367,  342,  345,  342,
-
-      345,  346,  370,  346,  527,  665,  365,  365,  365,  365,
-      366,  367,  365,  365,  365,  365,  365,  365,  365,  365,
-      365,  365,  365,  980,  365,  365, 1022,  318,  319,  991,
-      387,  365,  365,  365,  347,  983,  347,  366,  369,  342,
-      343,  370,  556,  530,  530,  530,  530,  365,  366,  367,
-      342,  343,  981,  388,  527,  352,  352,  352,  352,  342,
-      343,  573,  573,  550,  342,  343,  545,  545,  551,  291,
-      527,  365,  365,  400,  371,  396,  396,  396,  396,  939,
-      352,  352,  352,  352,  314,  401,  402,  342,  343,  979,
-      403,  541,  404,  366,  367,  405,  342,  343,  546,  401,
-
-      546,  744,  402,  547,  547,  547,  547,  541,  366,  373,
-      404, 1015,  548,  548,  548,  443,  443,  370,  405,  389,
-      389,  979,  389,  389,  389,  389,  389,  389,  389,  389,
-      389,  389,  389,  389,  745,  389,  389,  342,  343,  268,
-      557,  408,  389,  389,  389,  397,  397,  397,  397,  501,
-      501,  366,  367,  544,  544,  544,  544,  944,  389,  366,
-      367,  362,  366,  369,  541, 1014,  370,  376,  376,  376,
-      376,  576,  576,  576,  940,  376,  376,  376,  376,  314,
-      541, 1013,  389,  389,  389,  389,  555,  389,  389,  389,
-      389,  389,  389,  389,  389,  389,  389,  389,  389,  371,
-
-      389,  389,  555,  366,  367, 1012,  408,  389,  389,  389,
-      366,  367,  446,  446,  446,  366,  367,  519,  519,  558,
-      558,  558,  558,  389,  366,  367,  559,  559, 1011,  409,
-      555,  562,  562,  562,  981,  560,  410,  560,  410,  410,
-      561,  561,  561,  561,  573,  573,  555,  389,  389,  505,
-      505,  505,  505,  366,  367,  318,  694,  564,  505,  505,
-      505,  574,  565,  574,  691,  982,  575,  575,  575,  575,
-      983,  748,  505,  505,  505,  505,  505,  505,  273,  273,
-      291,  273,  273,  273,  273,  273,  273,  273,  273,  273,
-      273,  273,  273, 1010,  273,  273,  411,  411,  411,  411,
-
-      292,  273,  273,  273,  749,  400, 1009,  396,  396,  396,
-      396,  314,  397,  397,  397,  397,  314,  273,  402,  504,
-      504,  504,  403,  569,  412,  412,  412,  412,  413,  413,
-      413,  413,  801,  802,  402,  414,  414,  414,  414,  569,
-     1008,  273,  273,  273,  273, 1007,  273,  273,  273,  508,
-      273,  273,  273,  273,  273,  273,  273,  273,  273,  273,
-      273,  273,  273,  273,  273,  273,  273,  273,  273,  509,
-      509,  509,  509,  509,  509,  509,  509,  509,  509,  509,
-      509,  509,  273,  509,  509,  509,  509,  509,  509,  509,
-      509,  509,  509,  509,  509,  509,  509,  509,  509,  509,
-
-      509,  509,  509,  509,  509,  509,  273,  273,  273,  273,
-     1006,  273,  273,  273,  273,  273,  273,  273,  273,  273,
-      273,  273,  273, 1005,  273,  273,  572,  572,  572,  572,
-      292,  273,  273,  273,  583, 1004,  583,  569, 1003,  584,
-      584,  584,  584,  442,  442,  442,  442,  273,  445,  445,
-      445,  445,  614,  569,  415,  445,  445,  445,  445, 1002,
-      615,  813,  814,  616,  318,  319,  510,  522,  522,  522,
-      415,  273,  273,  523,  523,  523,  523, 1001,  228,  228,
-      228,  228,  523,  523,  523,  229,  229,  229,  229, 1000,
-      318,  319,  231,  231,  231,  231,  523,  523,  523,  523,
-
-      523,  523,  299,  299,  299,  299,  299,  299,  999,  299,
-      299,  299,  299,  299,  299,  299,  299,  632,  299,  299,
-      998,  228,  642,  228,  315,  299,  299,  299,  229,  997,
-      229,  503,  503,  503,  503,  231,  996,  231,  687,  342,
-      712,  299,  489,  489,  489,  489,  488,  655,  709,  655,
-      633,  995,  656,  656,  656,  656,  503,  503,  503,  503,
-      521,  521,  521,  521,  645,  299,  299,  299,  299,  299,
-      299,  299,  299,  472,  299,  299,  299,  299,  299,  299,
-      299,  299,  299,  299,  299,  299,  299,  299,  299,  299,
-      299,  299,  299,  525,  525,  525,  525,  525,  525,  525,
-
-      525,  525,  525,  525,  525,  525,  299,  525,  525,  525,
-      525,  525,  525,  525,  525,  525,  525,  525,  525,  525,
-      525,  525,  525,  525,  525,  525,  525,  525,  525,  525,
-      299,  299,  299,  299,  299,  299,  299,  299,  994,  299,
-      299,  299,  299,  299,  299,  299,  299,  945,  299,  299,
-      268,  386,  228,  229,  315,  299,  299,  299,  228,  229,
-      268,  993,  228,  946,  299,  229,  231,  386,  634,  229,
-      992,  299,  231,  680,  673,  977,  231,  637,  674,  660,
-      500,  500,  500,  500,  653,  318,  319,  976,  654,  646,
-      526,  497,  229,  318,  319,  299,  299,  318,  319,  268,
-
-      643,  531,  531,  641,  644,  342,  343,  497,  342,  343,
-      638,  331,  661,  327,  327,  327,  327,  975,  518,  518,
-      518,  518,  342,  343,  333,  675,  808,  675,  334,  515,
-      676,  676,  676,  676,  521,  521,  521,  521,  545,  545,
-      333,  318,  319,  688,  974,  515,  318,  319,  576,  576,
-      576,  366,  367,  318,  319,  706,  705,  535,  535,  535,
-      535,  973,  533,  533,  533,  533,  535,  535,  535,  533,
-      533,  533,  533,  664,  318,  690,  366,  367,  318,  319,
-      535,  535,  535,  535,  535,  535,  317,  317,  318,  319,
-      317,  317,  317,  317,  317,  317,  317,  317,  317,  317,
-
-      317,  724,  317,  317,  318,  319,  665,  972,  339,  317,
-      317,  317,  318,  319,  978,  685, 1016,  685,  342,  343,
-      686,  686,  686,  686,  723,  317,  342,  343,  534,  534,
-      534,  366,  367,  971,  548,  548,  548,  703,  970,  703,
-      318,  696,  704,  704,  704,  704,  969,  559,  559,  317,
-      317,  317,  317,  318,  319,  317,  317,  538,  317,  317,
-      317,  317,  317,  317,  317,  317,  317,  317,  317,  317,
-      317,  317,  317,  317,  317,  317,  317,  539,  539,  539,
-      539,  539,  539,  539,  539,  539,  539,  539,  539,  539,
-      317,  539,  539,  539,  539,  539,  539,  539,  539,  539,
-
-      539,  539,  539,  539,  539,  539,  539,  539,  539,  539,
-      539,  539,  539,  539,  317,  317,  317,  317,  318,  319,
-      317,  317,  317,  317,  317,  317,  317,  317,  317,  317,
-      317,  968,  317,  317,  318,  319,  366,  730,  339,  317,
-      317,  317,  342,  343,  967,  727,  575,  575,  575,  575,
-      530,  530,  530,  530,  299,  317,  318,  690,  634,  966,
-      691,  527,  228,  680,  318,  696,  318,  319,  697,  229,
-      965,  228,  342,  343,  540,  964,  231,  527,  229,  317,
-      317,  342,  343,  318,  694,  231,  342,  343,  547,  547,
-      547,  547,  691,  692,  980,  355, 1017,  351,  351,  351,
-
-      351,  698,  544,  544,  544,  544,  318,  319,  357,  823,
-      342,  708,  358,  541,  342,  343,  342,  708,  342,  714,
-      709,  744,  715,  963,  357,  342,  343,  342,  343,  541,
-      547,  547,  547,  547,  575,  575,  575,  575,  318,  694,
-      984,  549,  549,  549,  549,  366,  367,  691,  962,  824,
-      549,  549,  549,  710,  745,  716,  584,  584,  584,  584,
-      961,  562,  562,  562,  549,  549,  549,  549,  549,  549,
-      341,  341,  342,  343,  341,  341,  341,  341,  341,  341,
-      341,  341,  341,  341,  341,  338,  341,  341,  366,  367,
-      342,  714,  363,  341,  341,  341,  366,  367,  982,  721,
-
-     1016,  721,  366,  367,  722,  722,  722,  722,  960,  341,
-      366,  367,  561,  561,  561,  561,  342,  712,  561,  561,
-      561,  561,  739,  959,  739,  709,  958,  740,  740,  740,
-      740,  366,  726,  341,  341,  341,  341,  342,  343,  341,
-      341,  552,  341,  341,  341,  341,  341,  341,  341,  341,
-      341,  341,  341,  341,  341,  341,  341,  341,  341,  341,
-      341,  553,  553,  553,  553,  553,  553,  553,  553,  553,
-      553,  553,  553,  553,  341,  553,  553,  553,  553,  553,
-      553,  553,  553,  553,  553,  553,  553,  553,  553,  553,
-      553,  553,  553,  553,  553,  553,  553,  553,  341,  341,
-
-      341,  341,  342,  343,  341,  341,  341,  341,  341,  341,
-      341,  341,  341,  341,  341,  957,  341,  341,  366,  367,
-      366,  367,  363,  341,  341,  341,  956,  572,  572,  572,
-      572,  985,  342,  343,  558,  558,  558,  558,  569,  341,
-      366,  726,  342,  712,  727,  555,  228,  748,  366,  732,
-      955,  709,  733,  229,  569,  318,  319,  954,  554,  538,
-      231,  555,  953,  341,  341,  366,  367,  584,  584,  584,
-      584,  656,  656,  656,  656,  827,  338,  728,  949,  379,
-      749,  375,  375,  375,  375,  734,  228,  797,  228,  990,
-      228, 1021,  381,  229,  229,  229,  382,  229,  366,  730,
-
-      231,  268,  231,  929,  231,  366,  732,  727,  381,  366,
-      367,  656,  656,  656,  656,  676,  676,  676,  676,  676,
-      676,  676,  676,  318,  319,  563,  563,  563,  563,  798,
-      799,  884,  342,  343,  563,  563,  563,  318,  690,  800,
-      928,  691,  342,  343,  366,  367,  552,  986,  563,  563,
-      563,  563,  563,  563,  365,  365,  366,  367,  365,  365,
-      365,  365,  365,  365,  365,  365,  365,  365,  365,  927,
-      365,  365,  318,  319,  692,  828,  387,  365,  365,  365,
-      318,  319,  366,  367,  342,  343,  566,  831,  686,  686,
-      686,  686,  362,  365,  342,  343,  686,  686,  686,  686,
-
-      704,  704,  704,  704,  926,  366,  730,  318,  319,  925,
-      704,  704,  704,  704,  727,  338,  891,  365,  365,  365,
-      365,  366,  367,  365,  365,  566,  365,  365,  365,  365,
-      365,  365,  365,  365,  365,  365,  365,  365,  365,  365,
-      365,  365,  365,  365,  365,  567,  567,  567,  567,  567,
-      567,  567,  567,  567,  567,  567,  567,  567,  365,  567,
-      567,  567,  567,  567,  567,  567,  567,  567,  567,  567,
-      567,  567,  567,  567,  567,  567,  567,  567,  567,  567,
-      567,  567,  365,  365,  365,  365,  366,  367,  365,  365,
-      365,  365,  365,  365,  365,  365,  365,  365,  365,  987,
-
-      365,  365,  366,  367,  342,  343,  387,  365,  365,  365,
-      740,  740,  740,  740,  342,  343,  318,  690,  318,  696,
-      691,  924,  697,  365,  318,  696,  342,  708,  697,  923,
-      709,  342,  708,  342,  714,  709,  922,  715,  740,  740,
-      740,  740,  568,  842,  362,  832,  921,  365,  365,  577,
-      577,  577,  577,  692,  920,  698,  843,  228,  577,  577,
-      577,  698,  844,  710,  229,  362,  893,  919,  710,  918,
-      716,  231,  577,  577,  577,  577,  577,  577,  389,  389,
-      917,  389,  389,  389,  389,  389,  389,  389,  389,  389,
-      389,  389,  389,  916,  389,  389,  915,  366,  367,  878,
-
-      408,  389,  389,  389,  366,  367,  366,  367,  342,  714,
-      858,  914,  715,  722,  722,  722,  722,  389,  366,  367,
-      722,  722,  722,  722,  913,  859,  386,  895,  407,  897,
-      932,  860,  932,  932,  947,  948,  318,  319,  407,  407,
-      912,  389,  389,  389,  389,  716,  389,  389,  389,  580,
-      389,  389,  389,  389,  389,  389,  389,  389,  389,  389,
-      389,  389,  389,  389,  389,  389,  389,  389,  389,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  389,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-
-      581,  581,  581,  581,  581,  581,  389,  389,  389,  389,
-      911,  389,  389,  389,  389,  389,  389,  389,  389,  389,
-      389,  389,  389,  988,  389,  389,  950,  229,  229,  229,
-      408,  389,  389,  389,  268,  268,  268,  342,  343,  951,
-      366,  726,  366,  726,  727,  952,  727,  389,  366,  732,
-      366,  732,  733,  228,  733,  228,  910,  933,  909,  934,
-      229,  908,  229,  883,  366,  367,  582,  231,  386,  231,
-      907,  389,  389,  505,  505,  505,  505,  728,  906,  728,
-      905,  228,  505,  505,  505,  734,  904,  734,  229,  903,
-      902,  932,  880,  932,  932,  231,  505,  505,  505,  505,
-
-      505,  505,  273,  273,  881,  273,  273,  273,  273,  273,
-      273,  273,  273,  273,  273,  273,  273,  989,  273,  273,
-      901,  228,  228,  228,  667,  273,  273,  273,  229,  229,
-      229,  978,  900,  979,  978,  231,  231,  231,  228,  979,
-      899,  273,  229,  228,  229,  229,  318,  319,  985,  268,
-      229,  268,  231,  342,  343,  987,  813,  231,  930,  931,
-      882,  801,  386,  877,  876,  273,  273,  273,  273,  875,
-      273,  273,  273,  273,  273,  273,  273,  273,  273,  273,
-      273,  273,  291,  273,  273,  291,  291,  291,  291,  292,
-      273,  273,  273,  291,  291,  291,  291,  291,  291,  291,
-
-      291,  291,  291,  291,  291,  291,  273,  291,  291,  291,
-      291,  291,  291,  668,  291,  291,  291,  669,  291,  291,
-      291,  291,  291,  291,  291,  291,  291,  291,  291,  291,
-      273,  273,  523,  523,  523,  523,  874,  228,  366,  367,
-      989,  523,  523,  523,  229,  990,  991,  873,  318,  319,
-      984,  231, 1018,  872,  871,  523,  523,  523,  523,  523,
-      523,  299,  299,  299,  299,  299,  299,  870,  299,  299,
-      299,  299,  299,  299,  299,  299,  869,  299,  299,  868,
-      867,  879,  866,  682,  299,  299,  299,  865,  864,  863,
-      407,  407,  342,  343,  986,  862, 1019,  366,  367,  988,
-
-      299, 1020,  861,  857,  856,  855,  854,  853,  852,  851,
-      850,  849,  848,  847,  846,  845,  841,  840,  839,  838,
-      580,  744,  836,  835,  299,  299,  299,  299,  299,  299,
-      299,  299,  834,  299,  299,  299,  299,  299,  299,  299,
-      299,  314,  299,  299,  314,  314,  314,  314,  315,  299,
-      299,  299,  314,  314,  314,  314,  314,  314,  314,  314,
-      314,  314,  314,  314,  314,  299,  314,  314,  314,  314,
-      314,  314,  683,  314,  314,  314,  684,  314,  314,  314,
-      314,  314,  314,  314,  314,  314,  314,  314,  314,  299,
-      299,  318,  319,  830,  826,  822,  472,  820,  819,  816,
-
-      815,  812,  508,  660,  810,  809,  806,  535,  535,  535,
-      535,  805,  804,  803,  472,  640,  535,  535,  535,  632,
-      796,  795,  794,  793,  792,  791,  788,  787,  786,  785,
-      535,  535,  535,  535,  535,  535,  317,  317,  318,  319,
-      317,  317,  317,  317,  317,  317,  317,  317,  317,  317,
-      317,  784,  317,  317,  783,  782,  781,  780,  700,  317,
-      317,  317,  779,  778,  777,  776,  775,  774,  773,  772,
-      771,  770,  769,  768,  767,  317,  766,  765,  764,  763,
-      762,  761,  760,  759,  758,  757,  756,  755,  754,  744,
-      742,  741,  678,  677,  672,  671,  670,  660,  658,  317,
-
-      317,  317,  317,  318,  319,  317,  317,  317,  317,  317,
-      317,  317,  317,  317,  317,  317,  338,  317,  317,  338,
-      338,  338,  338,  339,  317,  317,  317,  338,  338,  338,
-      338,  338,  338,  338,  338,  338,  338,  338,  338,  338,
-      317,  338,  338,  338,  338,  338,  338,  701,  338,  338,
-      338,  702,  338,  338,  338,  338,  338,  338,  338,  338,
-      338,  338,  338,  338,  317,  317,  342,  343,  657,  652,
-      651,  650,  649,  488,  614,  598,  594,  647,  640,  635,
-      632,  630,  549,  549,  549,  549,  629,  628,  627,  626,
-      625,  549,  549,  549,  624,  623,  622,  621,  620,  619,
-
-      618,  617,  613,  612,  611,  549,  549,  549,  549,  549,
-      549,  341,  341,  342,  343,  341,  341,  341,  341,  341,
-      341,  341,  341,  341,  341,  341,  610,  341,  341,  609,
-      608,  607,  606,  718,  341,  341,  341,  605,  604,  603,
-      602,  601,  600,  597,  596,  593,  592,  591,  590,  589,
-      341,  588,  587,  586,  585,  571,  570,  392,  517,  516,
-      513,  512,  511,  499,  498,  276,  472,  493,  492,  488,
-      460,  458,  435,  432,  341,  341,  341,  341,  342,  343,
-      341,  341,  341,  341,  341,  341,  341,  341,  341,  341,
-      341,  362,  341,  341,  362,  362,  362,  362,  363,  341,
-
-      341,  341,  362,  362,  362,  362,  362,  362,  362,  362,
-      362,  362,  362,  362,  362,  341,  362,  362,  362,  362,
-      362,  362,  719,  362,  362,  362,  720,  362,  362,  362,
-      362,  362,  362,  362,  362,  362,  362,  362,  362,  341,
-      341,  366,  367,  430,  484,  421,  483,  472,  268,  471,
-      465,  464,  461,  449,  448,  441,  440,  563,  563,  563,
-      563,  439,  436,  426,  423,  422,  563,  563,  563,  419,
-      418,  417,  167,  406,  392,  390,  313,  268,  294,  290,
-      563,  563,  563,  563,  563,  563,  365,  365,  366,  367,
-      365,  365,  365,  365,  365,  365,  365,  365,  365,  365,
+      205,  229,  181,  181,  181,  181,  438,  229,  230,  229,
+     1058,  167,  206,  207,  230,  232,  230,  208,  242,  209,
+      439,  232,  210,  232,  244,  247,  206,  247,  247,  207,
+      205,  230,  181,  181,  181,  181,  269,  209,  269,  229,
+      433,  229,  434,  207,  168,  210,  230,  208,  230,  233,
+      233,  233,  233,  232,  234,  232,  425,  243,  237,  207,
+      211,  426,  212,  821,  245,  213, 1057,  229,  214,  215,
+      216,  217,  218,  219,  230,  229,  220,  269,  221,  222,
+      229,  232,  230,  461,  238,  225,  226,  230,  462,  232,
+
+      247,  164,  247,  247,  232,  180,  229,  181,  181,  181,
+      181, 1056,  230,  230,  246,  235,  277,  893,  211,  269,
+      232,  236,  239,  319,  320,  167,  254,  215,  216,  255,
+      256,  219,  319,  320,  241,  240, 1061,  222,  258,  259,
+      260,  258,  271,  239,  258,  259,  260,  258,  262,  278,
+      262,  459,  262,  262,  186,  248,  300,  186,  168,  186,
+      177,  249,  250,  251,  252,  302,  253,  460,  186,  186,
+      186,  263, 1055,  180,  186,  181,  181,  181,  181,  343,
+      344,  184,  184,  184,  184,  205, 1054,  181,  181,  181,
+      181,  272,  259,  273,  272,  343,  344,  435,  207,  436,
+
+      230,  793,  208,  270,  270,  270,  270,  269,  265,  266,
+      794,  319,  326,  267,  207,  272,  259,  273,  272,  280,
+      323,  281,  281,  281,  281,  282,  282,  282,  282,  319,
+      320,  274,  298,  298,  298,  298,  319,  322,  274,  393,
+      323,  274,  343,  350, 1053,  274,  184,  184,  184,  184,
+      338,  347,  167,  283,  367,  368,  274,  284,  285, 1052,
+      281,  281,  281,  281,  274,  305,  305,  305,  305,  300,
+      286,  287,  394,  324,  296,  288,  300,  289,  297,  300,
+      290,  367,  368,  300,  286,  168,  303,  287,  304,  304,
+      304,  304,  428,  306,  300,  289,  429,  307,  343,  344,
+
+      430,  468,  300,  290,  274,  274,  469,  274,  274,  274,
+      274,  274,  274,  274,  274,  274,  274,  274,  274,  362,
+      274,  274,  454,  319,  320,  230,  293,  274,  274,  274,
+      455,  205,  269,  298,  298,  298,  298,  327,  277,  328,
+      328,  328,  328,  274,  207,  343,  344,  456,  208,  367,
+      374,  457,  343,  346,  421,  600,  347,  601,  371,  351,
+      207,  352,  352,  352,  352,  458,  422,  274,  274,  274,
+      274,  278,  274,  274,  274,  274,  274,  274,  274,  274,
+      274,  274,  274,  274, 1051,  274,  274,  319,  320,  348,
+      496,  293,  274,  274,  274,  367,  368,  411,  497,  411,
+
+      411,  343,  344,  329,  329,  329,  329,  396,  274,  397,
+      397,  397,  397,  596,  294,  318,  386,  353,  353,  353,
+      353,  269,  318,  444,  444,  318,  447,  447,  447,  318,
+      597,  330,  274,  274,  308,  331,  304,  304,  304,  304,
+      318,  398,  398,  398,  398,  354,  309,  310,  318,  355,
+      269,  311,  162,  312,  162,  162,  313,  516,  367,  370,
+      309,  508,  371,  310,  452,  453,  509,  163,  292,  399,
+      891,  312, 1050,  400,  412,  412,  412,  412,  892,  313,
+      300,  300,  300,  300,  300,  300, 1049,  300,  300,  300,
+      300,  300,  300,  300,  300,  372,  300,  300,  393,  342,
+
+      471,  472,  316,  300,  300,  300,  342,  635,  366,  342,
+     1048,  367,  368,  342,  247,  366,  247,  247,  366,  300,
+      339,  468,  366,  897,  342,  375,  469,  376,  376,  376,
+      376,  394,  342,  366,  413,  413,  413,  413,  947,  470,
+      636,  366,  339,  300,  300,  300,  300,  300,  300,  300,
+      300, 1047,  300,  300,  300,  300,  300,  300,  300,  300,
+      363,  300,  300,  899,  390,  452,  488,  316,  300,  300,
+      300,  390,  503,  503,  390,  367,  368, 1046,  390,  414,
+      414,  414,  414, 1045,  300,  415,  415,  415,  415,  390,
+      317,  377,  377,  377,  377,  521,  521,  390,  184,  184,
+
+      184,  184,  468,  184,  184,  184,  184,  526,  300,  300,
+      319,  320,  428,  300,  416,  387,  429,  177,  901,  378,
+      487,  269,  302,  379,  332, 1044,  328,  328,  328,  328,
+      416,  443,  443,  443,  443, 1043,  333,  334,  229,  319,
+      320,  335,  416,  336,  943,  230,  337,  319,  320,  445,
+      333,  445,  232,  334,  446,  446,  446,  446,  416,  319,
+      320,  336,  258,  259,  260,  258,  506,  506,  506,  337,
+      318,  318,  319,  320,  318,  318,  318,  318,  318,  318,
+      318,  318,  318,  318,  318,  408,  318,  318,  903,  229,
+      319,  322,  340,  318,  318,  318,  230,  205,  269,  181,
+
+      181,  181,  181,  232,  987,  229,  229,  319,  320,  318,
+      207, 1042,  230,  230,  208,  476,  476,  476,  476,  232,
+      232,  258,  259,  260,  258,  822,  207,  491,  491,  491,
+      491,  490, 1041,  318,  318,  318,  318,  319,  320,  318,
+      318,  318,  318,  318,  318,  318,  318,  318,  318,  318,
+      292,  318,  318, 1040,  229,  229,  477,  340,  318,  318,
+      318,  230,  230,  229,  229,  229,  230,  988,  232,  232,
+      230,  230,  230,  269,  318,  343,  344,  232,  232,  232,
+      341,  229,  272,  259,  273,  272,  343,  344,  230, 1039,
+      481,  272,  259,  273,  272,  232,  343,  344,  318,  318,
+
+      343,  344,  319,  326,  478,  479,  480,  343,  346,  498,
+     1038,  323,  483,  292,  356,  482,  352,  352,  352,  352,
+      524,  524,  524,  484,  343,  344,  357,  358,  319,  326,
+      315,  359,  895,  360,  367,  368,  361,  323,  319,  322,
+      357,  230,  323,  358,  270,  270,  270,  270,  269,  343,
+      350,  360,  282,  282,  282,  282,  367,  368,  347,  361,
+      342,  342,  343,  344,  342,  342,  342,  342,  342,  342,
+      342,  342,  342,  342,  342,  324,  342,  342,  305,  305,
+      305,  305,  364,  342,  342,  342, 1037,  285,  580,  281,
+      281,  281,  281,  581,  282,  282,  282,  282,  948,  342,
+
+      287,  504,  339,  504,  288,  499,  505,  505,  505,  505,
+      367,  368,  522,  985,  522, 1024,  287,  523,  523,  523,
+      523,  499, 1036,  342,  342,  342,  342,  343,  344,  342,
+      342,  342,  342,  342,  342,  342,  342,  342,  342,  342,
+      269,  342,  342,  367,  370,  319,  320,  364,  342,  342,
+      342,  502,  502,  502,  502,  205,  941,  298,  298,  298,
+      298,  292,  499,  944,  342,  319,  320,  949,  207,  269,
+      365,  363,  208,  319,  322,  343,  344,  323,  499,  319,
+      320,  367,  368, 1035,  207,  343,  350,  640,  342,  342,
+      367,  368,  530,  676,  347,  533,  533,  677,  308, 1034,
+
+      304,  304,  304,  304,  380, 1033,  376,  376,  376,  376,
+      324,  310,  531,  575,  575,  311,  381,  382,  319,  320,
+      641,  383,  544,  384,  444,  444,  385,  310,  319,  320,
+      381,  343,  344,  382,  329,  329,  329,  329,  319,  320,
+     1032,  384,  538,  942,  536,  536,  536,  539,  292,  385,
+      366,  366,  367,  368,  366,  366,  366,  366,  366,  366,
+      366,  366,  366,  366,  366, 1031,  366,  366,  305,  305,
+      305,  305,  388,  366,  366,  366,  617, 1030,  545,  517,
+      520,  520,  520,  520,  618,  319,  320,  619,  950,  366,
+      998,  517,  363,  343,  346,  517,  534,  347,  534,  367,
+
+      374,  535,  535,  535,  535,  343,  346,  517,  371,  347,
+      367,  368,  990,  366,  366,  366,  366,  367,  368,  366,
+      366,  366,  366,  366,  366,  366,  366,  366,  366,  366,
+      348,  366,  366,  988,  319,  320,  230,  388,  366,  366,
+      366,  986,  348,  269,  367,  370,  319,  320,  371, 1023,
+      329,  329,  329,  329,  366,  343,  344,  558,  343,  344,
+      389,  529,  532,  532,  532,  532,  503,  503,  367,  368,
+      811,  547,  547,  529,  550,  550,  550,  529,  366,  366,
+      401,  372,  397,  397,  397,  397,  951,  343,  344,  529,
+      387,  552,  402,  403,  343,  344,  553,  404,  411,  405,
+
+      411,  411,  406,  343,  344, 1022,  402,  367,  368,  403,
+      353,  353,  353,  353,  548,  559,  548,  405, 1021,  549,
+      549,  549,  549,  561,  561,  406,  390,  390, 1020,  390,
+      390,  390,  390,  390,  390,  390,  390,  390,  390,  390,
+      390,  991,  390,  390,  343,  344,  367,  374,  409,  390,
+      390,  390,  578,  578,  578,  371,  521,  521,  367,  368,
+      353,  353,  353,  353,  952,  390,  343,  344,  387,  367,
+      370,  543, 1019,  371,  377,  377,  377,  377,  398,  398,
+      398,  398,  546,  546,  546,  546,  339,  543,  663,  390,
+      390,  390,  390,  543,  390,  390,  390,  390,  390,  390,
+
+      390,  390,  390,  390,  390,  390,  372,  390,  390,  543,
+      367,  368, 1018,  409,  390,  390,  390,  412,  412,  412,
+      412,  664,  367,  368,  575,  575,  377,  377,  377,  377,
+      390,  805,  806,  367,  368, 1017,  410,  557,  564,  564,
+      564,  413,  413,  413,  413,  414,  414,  414,  414,  560,
+      560,  560,  560,  557,  390,  390,  507,  507,  507,  507,
+      557,  415,  415,  415,  415,  507,  507,  507,  367,  368,
+      319,  320,  566,  447,  447,  447,  557,  567, 1016,  507,
+      507,  507,  507,  507,  507,  274,  274, 1015,  274,  274,
+      274,  274,  274,  274,  274,  274,  274,  274,  274,  274,
+
+      667,  274,  274,  367,  368,  747, 1014,  293,  274,  274,
+      274,  506,  506,  506,  562,  987,  562, 1025,  690,  563,
+      563,  563,  563,  401,  274,  397,  397,  397,  397,  446,
+      446,  446,  446,  668,  817,  818,  403,  576,  748,  576,
+      404, 1013,  577,  577,  577,  577,  319,  320,  274,  274,
+      274,  274,  403,  274,  274,  274,  510,  274,  274,  274,
+      274,  274,  274,  274,  274,  274,  274,  274,  274,  274,
+      274,  274,  274,  274,  274,  274,  511,  511,  511,  511,
+      511,  511,  511,  511,  511,  511,  511,  511,  511,  274,
+      511,  511,  511,  511,  511,  511,  511,  511,  511,  511,
+
+      511,  511,  511,  511,  511,  511,  511,  511,  511,  511,
+      511,  511,  511,  274,  274,  274,  274, 1012,  274,  274,
+      274,  274,  274,  274,  274,  274,  274,  274,  274,  274,
+     1011,  274,  274,  398,  398,  398,  398,  293,  274,  274,
+      274,  524,  524,  524,  571,  574,  574,  574,  574, 1010,
+      443,  443,  443,  443,  274, 1009,  571,  585,  985,  585,
+      571,  416,  586,  586,  586,  586,  446,  446,  446,  446,
+      319,  693,  571,  512,  319,  320,  269,  416,  274,  274,
+      525,  525,  525,  525, 1008,  229,  229,  229,  229,  525,
+      525,  525,  230,  230,  230,  230, 1007,  343,  344,  232,
+
+      232,  232,  232,  525,  525,  525,  525,  525,  525,  300,
+      300,  300,  300,  300,  300, 1006,  300,  300,  300,  300,
+      300,  300,  300,  300,  691,  300,  300, 1005,  229,  645,
+      229,  316,  300,  300,  300,  230, 1004,  230,  505,  505,
+      505,  505,  232, 1003,  232,  708,  319,  697,  300,  491,
+      491,  491,  491,  490,  658,  694,  658,  319,  320,  659,
+      659,  659,  659,  505,  505,  505,  505,  523,  523,  523,
+      523,  648,  300,  300,  300,  300,  300,  300,  300,  300,
+      474,  300,  300,  300,  300,  300,  300,  300,  300,  300,
+      300,  300,  300,  300,  300,  300,  300,  300,  300,  300,
+
+      527,  527,  527,  527,  527,  527,  527,  527,  527,  527,
+      527,  527,  527,  300,  527,  527,  527,  527,  527,  527,
+      527,  527,  527,  527,  527,  527,  527,  527,  527,  527,
+      527,  527,  527,  527,  527,  527,  527,  300,  300,  300,
+      300,  300,  300,  300,  300, 1002,  300,  300,  300,  300,
+      300,  300,  300,  300, 1001,  300,  300,  319,  699,  229,
+      230,  316,  300,  300,  300,  229,  230,  269, 1000,  229,
+      953,  300,  230,  232,  408,  637,  230,  999,  300,  232,
+      683,  367,  368,  232,  319,  320,  751,  502,  502,  502,
+      502,  656,  578,  578,  578,  657,  649,  528,  499,  230,
+
+      533,  533,  300,  300,  319,  320,  269,  646,  319,  693,
+      644,  647,  694,  635,  499,  343,  715,  640,  332,  752,
+      328,  328,  328,  328,  712,  520,  520,  520,  520,  726,
+      663,  334,  678,  812,  678,  335,  517,  679,  679,  679,
+      679,  523,  523,  523,  523,  695,  636,  334,  319,  320,
+      641,  984,  517,  319,  320,  343,  344,  945,  343,  344,
+      319,  320,  315,  664,  537,  537,  537,  537,  989,  535,
+      535,  535,  535,  537,  537,  537,  535,  535,  535,  535,
+      667,  367,  368,  577,  577,  577,  577,  537,  537,  537,
+      537,  537,  537,  318,  318,  319,  320,  318,  318,  318,
+
+      318,  318,  318,  318,  318,  318,  318,  318,  709,  318,
+      318,  319,  320,  668,  315,  340,  318,  318,  318,  319,
+      320,  989,  688, 1024,  688,  343,  344,  689,  689,  689,
+      689,  727,  318,  343,  344,  536,  536,  536,  367,  368,
+      946,  547,  547,  983,  706,  315,  706,  343,  711,  707,
+      707,  707,  707,  982,  561,  561,  318,  318,  318,  318,
+      319,  320,  318,  318,  540,  318,  318,  318,  318,  318,
+      318,  318,  318,  318,  318,  318,  318,  318,  318,  318,
+      318,  318,  318,  318,  541,  541,  541,  541,  541,  541,
+      541,  541,  541,  541,  541,  541,  541,  318,  541,  541,
+
+      541,  541,  541,  541,  541,  541,  541,  541,  541,  541,
+      541,  541,  541,  541,  541,  541,  541,  541,  541,  541,
+      541,  318,  318,  318,  318,  319,  320,  318,  318,  318,
+      318,  318,  318,  318,  318,  318,  318,  318,  981,  318,
+      318,  319,  320,  367,  733,  340,  318,  318,  318,  343,
+      344,  980,  730,  343,  344,  343,  717,  532,  532,  532,
+      532,  979,  318,  319,  699,  367,  368,  700,  529,  546,
+      546,  546,  546,  978,  343,  344,  577,  577,  577,  577,
+      543,  542,  367,  729,  529,  747,  318,  318,  343,  344,
+      549,  549,  549,  549,  343,  344,  543,  343,  711,  954,
+
+      701,  712,  356,  408,  352,  352,  352,  352,  343,  344,
+      549,  549,  549,  549,  751,  358,  343,  717,  748,  359,
+      718,  986,  229,  229,  550,  550,  550,  367,  368,  230,
+      230,  358,  343,  344,  713,  977,  232,  232,  724,  269,
+      724,  367,  368,  725,  725,  725,  725,  752,  551,  551,
+      551,  551,  990,  719,  367,  735,  229,  551,  551,  551,
+      367,  729,  230,  230,  730,  586,  586,  586,  586,  269,
+      232,  551,  551,  551,  551,  551,  551,  342,  342,  343,
+      344,  342,  342,  342,  342,  342,  342,  342,  342,  342,
+      342,  342,  939,  342,  342,  367,  368,  731,  315,  364,
+
+      342,  342,  342,  367,  368,  804,  300,  367,  368,  976,
+      637,  560,  560,  560,  560,  683,  342,  367,  368,  564,
+      564,  564,  557,  563,  563,  563,  563,  586,  586,  586,
+      586,  319,  320,  563,  563,  563,  563,  997,  557, 1029,
+      342,  342,  342,  342,  343,  344,  342,  342,  554,  342,
+      342,  342,  342,  342,  342,  342,  342,  342,  342,  342,
+      342,  342,  342,  342,  342,  342,  342,  342,  555,  555,
+      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
+      555,  342,  555,  555,  555,  555,  555,  555,  555,  555,
+      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
+
+      555,  555,  555,  555,  555,  342,  342,  342,  342,  343,
+      344,  342,  342,  342,  342,  342,  342,  342,  342,  342,
+      342,  342,  975,  342,  342,  574,  574,  574,  574,  364,
+      342,  342,  342,  974,  319,  697,  571,  367,  735,  319,
+      320,  736,  742,  694,  742,  973,  342,  743,  743,  743,
+      743,  972,  571,  229,  229,  659,  659,  659,  659,  971,
+      230,  230,  229,  339,  896,  556,  970,  232,  232,  230,
+      342,  342,  367,  368,  737,  969,  232,  659,  659,  659,
+      659,  679,  679,  679,  679,  968,  380,  967,  376,  376,
+      376,  376,  343,  344,  801,  802,  319,  320,  966,  382,
+
+      846,  319,  320,  383,  319,  320,  803,  679,  679,  679,
+      679,  319,  320,  847,  965,  382,  367,  368,  964,  848,
+      689,  689,  689,  689,  343,  344,  963,  689,  689,  689,
+      689,  992,  565,  565,  565,  565,  319,  320,  962,  827,
+      540,  565,  565,  565,  828,  319,  693,  363,  898,  694,
+      319,  693,  343,  344,  694,  565,  565,  565,  565,  565,
+      565,  366,  366,  367,  368,  366,  366,  366,  366,  366,
+      366,  366,  366,  366,  366,  366,  339,  366,  366,  319,
+      697,  961,  695,  388,  366,  366,  366,  695,  694,  343,
+      344,  367,  368,  343,  344,  831,  960,  343,  344,  959,
+
+      366,  554,  367,  368,  956,  707,  707,  707,  707,  707,
+      707,  707,  707,  343,  715,  367,  368,  957,  725,  725,
+      725,  725,  712,  958,  366,  366,  366,  366,  367,  368,
+      366,  366,  568,  366,  366,  366,  366,  366,  366,  366,
+      366,  366,  366,  366,  366,  366,  366,  366,  366,  366,
+      366,  366,  569,  569,  569,  569,  569,  569,  569,  569,
+      569,  569,  569,  569,  569,  366,  569,  569,  569,  569,
+      569,  569,  569,  569,  569,  569,  569,  569,  569,  569,
+      569,  569,  569,  569,  569,  569,  569,  569,  569,  366,
+      366,  366,  366,  367,  368,  366,  366,  366,  366,  366,
+
+      366,  366,  366,  366,  366,  366,  993,  366,  366,  343,
+      344,  343,  715,  388,  366,  366,  366,  955,  367,  368,
+      712,  367,  368,  319,  699,  319,  699,  700,  935,  700,
+      366,  343,  711,  343,  711,  712,  934,  712,  343,  717,
+      343,  717,  718,  933,  718,  932,  367,  368,  862,  570,
+      568,  363,  832,  931,  366,  366,  579,  579,  579,  579,
+      701,  835,  701,  863,  836,  579,  579,  579,  713,  864,
+      713,  743,  743,  743,  743,  719,  930,  719,  994,  579,
+      579,  579,  579,  579,  579,  390,  390,  929,  390,  390,
+      390,  390,  390,  390,  390,  390,  390,  390,  390,  390,
+
+      928,  390,  390,  367,  368,  367,  733,  409,  390,  390,
+      390,  230,  387,  900,  730,  927,  367,  733,  269,  725,
+      725,  725,  725,  363,  390,  730,  743,  743,  743,  743,
+      408,  902,  938,  229,  938,  938,  319,  320,  229,  938,
+      230,  938,  938,  343,  344,  230,  888,  232,  390,  390,
+      390,  390,  232,  390,  390,  390,  582,  390,  390,  390,
+      390,  390,  390,  390,  390,  390,  390,  390,  390,  390,
+      390,  390,  390,  390,  390,  390,  583,  583,  583,  583,
+      583,  583,  583,  583,  583,  583,  583,  583,  583,  390,
+      583,  583,  583,  583,  583,  583,  583,  583,  583,  583,
+
+      583,  583,  583,  583,  583,  583,  583,  583,  583,  583,
+      583,  583,  583,  390,  390,  390,  390,  926,  390,  390,
+      390,  390,  390,  390,  390,  390,  390,  390,  390,  390,
+      995,  390,  390,  925,  230,  230,  924,  409,  390,  390,
+      390,  269,  269,  996,  319,  320,  992,  367,  729,  367,
+      729,  730,  997,  730,  390,  367,  735,  367,  735,  736,
+      229,  736,  229,  229,  923,  940,  998,  230,  922,  230,
+      230,  889,  921,  584,  232,  387,  232,  232,  390,  390,
+      507,  507,  507,  507,  731,  920,  731,  919,  387,  507,
+      507,  507,  737,  918,  737,  367,  368,  408,  917,  916,
+
+      936,  885,  883,  507,  507,  507,  507,  507,  507,  274,
+      274,  408,  274,  274,  274,  274,  274,  274,  274,  274,
+      274,  274,  274,  274,  915,  274,  274,  985,  229,  914,
+      913,  670,  274,  274,  274,  230,  985,  912,  230,  986,
+      229,  986,  232,  229,  911,  269,  910,  230,  274,  909,
+      230,  908,  230,  907,  232,  906,  905,  232,  904,  269,
+      319,  320,  991,  817, 1026,  937,  343,  344,  993,  887,
+     1027,  805,  274,  274,  274,  274,  882,  274,  274,  274,
+      274,  274,  274,  274,  274,  274,  274,  274,  274,  292,
+      274,  274,  292,  292,  292,  292,  293,  274,  274,  274,
 
-      365,  276,  365,  365,  274,  245,  256,  167,  736,  365,
-      365,  365,  245,  256,  167,  174,  165, 1053,   96,   65,
-       57, 1053, 1053, 1053, 1053,  365, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,  365,
-      365,  365,  365,  366,  367,  365,  365,  365,  365,  365,
-      365,  365,  365,  365,  365,  365,  386,  365,  365,  386,
-      386,  386,  386,  387,  365,  365,  365,  386,  386,  386,
-      386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
-      365,  386,  386,  386,  386,  386,  386,  737,  386,  386,
-
-      386,  738,  386,  386,  386,  386,  386,  386,  386,  386,
-      386,  386,  386,  386,  365,  365,  577,  577,  577,  577,
-     1053, 1053, 1053, 1053, 1053,  577,  577,  577, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,  577,
-      577,  577,  577,  577,  577,  389,  389, 1053,  389,  389,
-      389,  389,  389,  389,  389,  389,  389,  389,  389,  389,
-     1053,  389,  389, 1053, 1053, 1053, 1053,  751,  389,  389,
-      389, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053,  389, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,  389,  389,
-      389,  389, 1053,  389,  389,  389,  389,  389,  389,  389,
-      389,  389,  389,  389,  389,  407,  389,  389,  407,  407,
-      407,  407,  408,  389,  389,  389,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  389,
-      407,  407,  407,  407,  407,  407,  752,  407,  407,  407,
-      753,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  389,  389,  273,  273, 1053,  273,  273,
-      273,  273,  273,  273,  273,  273,  273,  273,  273,  273,
-     1053,  273,  273, 1053, 1053, 1053, 1053,  667,  273,  273,
-
-      273, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053,  273, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,  273,  273,
-      273,  273, 1053,  273,  273,  273,  273,  273,  273,  273,
-      273,  273,  273,  273,  273,  291,  273,  273,  291,  291,
-      291,  291,  292,  273,  273,  273,  291,  291,  291,  291,
-      291,  291,  291,  291,  291,  291,  291,  291,  291,  273,
-      291,  291,  291,  291,  291,  291,  291,  291,  291,  811,
-      291,  291,  291,  291,  291,  291,  291,  291,  291,  291,
-
-      291,  291,  291,  273,  273,  299,  299,  299,  299,  299,
-      299, 1053,  299,  299,  299,  299,  299,  299,  299,  299,
-     1053,  299,  299, 1053, 1053, 1053, 1053,  682,  299,  299,
-      299, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053,  299, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,  299,  299,
-      299,  299,  299,  299,  299,  299, 1053,  299,  299,  299,
-      299,  299,  299,  299,  299,  314,  299,  299,  314,  314,
-      314,  314,  315,  299,  299,  299,  314,  314,  314,  314,
-
-      314,  314,  314,  314,  314,  314,  314,  314,  314,  299,
-      314,  314,  314,  314,  314,  314,  314,  314,  314,  821,
-      314,  314,  314,  314,  314,  314,  314,  314,  314,  314,
-      314,  314,  314,  299,  299,  317,  317,  318,  319,  317,
-      317,  317,  317,  317,  317,  317,  317,  317,  317,  317,
-     1053,  317,  317, 1053, 1053, 1053, 1053,  700,  317,  317,
-      317, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053,  317, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,  317,  317,
-
-      317,  317,  318,  319,  317,  317,  317,  317,  317,  317,
-      317,  317,  317,  317,  317,  338,  317,  317,  338,  338,
-      338,  338,  339,  317,  317,  317,  338,  338,  338,  338,
-      338,  338,  338,  338,  338,  338,  338,  338,  338,  317,
-      338,  338,  338,  338,  338,  338,  338,  338,  338,  825,
-      338,  338,  338,  338,  338,  338,  338,  338,  338,  338,
-      338,  338,  338,  317,  317,  341,  341,  342,  343,  341,
-      341,  341,  341,  341,  341,  341,  341,  341,  341,  341,
-     1053,  341,  341, 1053, 1053, 1053, 1053,  718,  341,  341,
-      341, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-
-     1053, 1053, 1053, 1053,  341, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,  341,  341,
-      341,  341,  342,  343,  341,  341,  341,  341,  341,  341,
-      341,  341,  341,  341,  341,  362,  341,  341,  362,  362,
-      362,  362,  363,  341,  341,  341,  362,  362,  362,  362,
-      362,  362,  362,  362,  362,  362,  362,  362,  362,  341,
-      362,  362,  362,  362,  362,  362,  362,  362,  362,  829,
-      362,  362,  362,  362,  362,  362,  362,  362,  362,  362,
-      362,  362,  362,  341,  341,  365,  365,  366,  367,  365,
+      292,  292,  292,  292,  292,  292,  292,  292,  292,  292,
+      292,  292,  292,  274,  292,  292,  292,  292,  292,  292,
+      671,  292,  292,  292,  672,  292,  292,  292,  292,  292,
+      292,  292,  292,  292,  292,  292,  292,  274,  274,  525,
+      525,  525,  525,  881,  229,  229,  880,  879,  525,  525,
+      525,  230,  230,  343,  344,  994,  878,  877,  232,  232,
+      876,  875,  525,  525,  525,  525,  525,  525,  300,  300,
+      300,  300,  300,  300,  874,  300,  300,  300,  300,  300,
+      300,  300,  300,  873,  300,  300,  872,  871,  884,  870,
+      685,  300,  300,  300,  886,  367,  368,  995,  869, 1028,
+
+      367,  368,  996,  868,  867,  866,  865,  300,  861,  860,
+      859,  858,  857,  856,  855,  854,  853,  852,  851,  850,
+      849,  845,  844,  843,  842,  582,  747,  840,  839,  838,
+      834,  300,  300,  300,  300,  300,  300,  300,  300,  830,
+      300,  300,  300,  300,  300,  300,  300,  300,  315,  300,
+      300,  315,  315,  315,  315,  316,  300,  300,  300,  315,
+      315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
+      315,  315,  300,  315,  315,  315,  315,  315,  315,  686,
+      315,  315,  315,  687,  315,  315,  315,  315,  315,  315,
+      315,  315,  315,  315,  315,  315,  300,  300,  319,  320,
+
+      826,  474,  824,  823,  820,  819,  816,  510,  663,  814,
+      813,  810,  809,  808,  537,  537,  537,  537,  807,  474,
+      643,  635,  800,  537,  537,  537,  799,  798,  797,  796,
+      795,  792,  791,  790,  789,  788,  787,  537,  537,  537,
+      537,  537,  537,  318,  318,  319,  320,  318,  318,  318,
+      318,  318,  318,  318,  318,  318,  318,  318,  786,  318,
+      318,  785,  784,  783,  782,  703,  318,  318,  318,  781,
+      780,  779,  778,  777,  776,  775,  774,  773,  772,  771,
+      770,  769,  318,  768,  767,  766,  765,  764,  763,  762,
+      761,  760,  759,  758,  757,  747,  745,  744,  681,  680,
+
+      675,  674,  673,  663,  661,  660,  318,  318,  318,  318,
+      319,  320,  318,  318,  318,  318,  318,  318,  318,  318,
+      318,  318,  318,  339,  318,  318,  339,  339,  339,  339,
+      340,  318,  318,  318,  339,  339,  339,  339,  339,  339,
+      339,  339,  339,  339,  339,  339,  339,  318,  339,  339,
+      339,  339,  339,  339,  704,  339,  339,  339,  705,  339,
+      339,  339,  339,  339,  339,  339,  339,  339,  339,  339,
+      339,  318,  318,  343,  344,  655,  654,  653,  652,  490,
+      617,  600,  596,  650,  643,  638,  635,  633,  632,  551,
+      551,  551,  551,  631,  630,  629,  628,  627,  551,  551,
+
+      551,  626,  625,  624,  623,  622,  621,  620,  616,  615,
+      614,  613,  551,  551,  551,  551,  551,  551,  342,  342,
+      343,  344,  342,  342,  342,  342,  342,  342,  342,  342,
+      342,  342,  342,  612,  342,  342,  611,  610,  609,  608,
+      721,  342,  342,  342,  607,  606,  605,  604,  603,  602,
+      599,  598,  595,  594,  593,  592,  591,  342,  590,  589,
+      588,  587,  573,  572,  393,  519,  518,  515,  514,  513,
+      501,  500,  277,  474,  495,  494,  490,  462,  460,  436,
+      433,  342,  342,  342,  342,  343,  344,  342,  342,  342,
+      342,  342,  342,  342,  342,  342,  342,  342,  363,  342,
 
-      365,  365,  365,  365,  365,  365,  365,  365,  365,  365,
-     1053,  365,  365, 1053, 1053, 1053, 1053,  736,  365,  365,
-      365, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053,  365, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,  365,  365,
-      365,  365,  366,  367,  365,  365,  365,  365,  365,  365,
-      365,  365,  365,  365,  365,  386,  365,  365,  386,  386,
-      386,  386,  387,  365,  365,  365,  386,  386,  386,  386,
-      386,  386,  386,  386,  386,  386,  386,  386,  386,  365,
-
-      386,  386,  386,  386,  386,  386,  386,  386,  386,  833,
-      386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
-      386,  386,  386,  365,  365,  389,  389, 1053,  389,  389,
-      389,  389,  389,  389,  389,  389,  389,  389,  389,  389,
-     1053,  389,  389, 1053, 1053, 1053, 1053,  751,  389,  389,
-      389, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053,  389, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,  389,  389,
-      389,  389, 1053,  389,  389,  389,  389,  389,  389,  389,
-
-      389,  389,  389,  389,  389,  407,  389,  389,  407,  407,
-      407,  407,  408,  389,  389,  389,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  389,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  837,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  389,  389,  273,  273, 1053,  273,  273,
-      273,  273,  273,  273,  273,  273,  273,  273,  273,  273,
-      291,  273,  273,  291,  291,  291,  291,  292,  273,  273,
-      273,  291,  291,  291,  291,  291,  291,  291,  291,  291,
-      291,  291,  291,  291,  273,  291,  291,  291,  291,  291,
-
-      291,  291,  291,  291,  291,  885,  291,  291,  291,  291,
-      291,  291,  291,  291,  291,  291,  291,  291,  273,  273,
-      299,  299,  299,  299,  299,  299, 1053,  299,  299,  299,
-      299,  299,  299,  299,  299,  314,  299,  299,  314,  314,
-      314,  314,  315,  299,  299,  299,  314,  314,  314,  314,
-      314,  314,  314,  314,  314,  314,  314,  314,  314,  299,
-      314,  314,  314,  314,  314,  314,  314,  314,  314,  314,
-      889,  314,  314,  314,  314,  314,  314,  314,  314,  314,
-      314,  314,  314,  299,  299,  166, 1053,  166,  166,  166,
-      166,  166,  166,  166,  166,  166,  169, 1053, 1053,  169,
-
-      169,  177, 1053,  177,  177,  177,  177,  177,  177,  177,
-      177,  177,  230,  230,  230,  230,  230,  230,  230,  230,
-      260,  260,  260,  260,  263, 1053,  263, 1053,  263,  263,
-      263,  263,  267,  267,  267,  267,  267,  267,  267,  273,
-     1053,  273,  273,  273,  273,  273,  273,  273,  273,  273,
-      275, 1053,  275,  275,  275,  275,  275,  275,  275,  275,
-      275,  278, 1053,  278,  278,  278,  278,  278,  278,  278,
-      278,  278,  291, 1053,  291,  291,  291,  291,  291,  291,
-      291,  291,  291,  229,  229,  229,  229,  229,  229,  229,
-      299,  299, 1053,  299,  299,  299,  299,  299,  299,  299,
-
-      299,  300,  300,  300,  300,  300,  300,  300,  300,  300,
-      300,  300,  314,  314, 1053,  314,  314,  314,  314,  314,
-      314,  314,  314,  317,  317,  317,  317,  317,  317,  317,
-      317,  317,  317,  317,  320,  320,  320,  320,  320,  320,
-      320,  320,  320,  320,  320,  324,  324,  324,  324,  324,
-      324,  324,  324,  324,  324,  324,  338,  338,  338,  338,
-      338,  338,  338,  338,  338,  338,  338,  341,  341,  341,
-      341,  341,  341,  341,  341,  341,  341,  341,  344,  344,
-      344,  344,  344,  344,  344,  344,  344,  344,  344,  348,
-      348,  348,  348,  348,  348,  348,  348,  348,  348,  348,
-
-      362,  362,  362,  362,  362,  362,  362,  362,  362,  362,
-      362,  365,  365,  365,  365,  365,  365,  365,  365,  365,
-      365,  365,  368,  368,  368,  368,  368,  368,  368,  368,
-      368,  368,  368,  372,  372,  372,  372,  372,  372,  372,
-      372,  372,  372,  372,  386,  386,  386,  386,  386,  386,
-      386,  386,  386,  386,  386,  389, 1053,  389,  389,  389,
-      389,  389,  389,  389,  389,  389,  391, 1053,  391,  391,
-      391,  391,  391,  391,  391,  391,  391,  394, 1053,  394,
-      394,  394,  394,  394,  394,  394,  394,  394,  407, 1053,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  169,
-
-     1053, 1053,  169,  169,  177, 1053,  177,  177,  177,  177,
-      177,  177,  177,  177,  177,  416, 1053, 1053,  416,  416,
-      416,  447, 1053, 1053,  447,  229,  229,  229,  229,  229,
-      229,  229,  230,  230,  230,  230,  230,  230,  230,  230,
-      473, 1053, 1053, 1053, 1053,  473,  473,  473,  473,  487,
-      487,  487,  487,  487,  487,  490,  490,  490,  490,  491,
-     1053,  491,  491,  491,  491,  267,  267,  267,  267,  267,
-      267,  267,  273, 1053,  273,  273,  273,  273,  273,  273,
-      273,  273,  273,  275, 1053,  275,  275,  275,  275,  275,
-      275,  275,  275,  275,  278, 1053,  278,  278,  278,  278,
-
-      278,  278,  278,  278,  278,  291, 1053,  291,  291,  291,
-      291,  291,  291,  291,  291,  291,  299,  299, 1053,  299,
-      299,  299,  299,  299,  299,  299,  299,  300,  300,  300,
-      300,  300,  300,  300,  300,  300,  300,  300,  314,  314,
-     1053,  314,  314,  314,  314,  314,  314,  314,  314,  317,
-      317,  317,  317,  317,  317,  317,  317,  317,  317,  317,
-      320,  320,  320,  320,  320,  320,  320,  320,  320,  320,
-      320,  324,  324,  324,  324,  324,  324,  324,  324,  324,
-      324,  324,  338,  338,  338,  338,  338,  338,  338,  338,
-      338,  338,  338,  341,  341,  341,  341,  341,  341,  341,
-
-      341,  341,  341,  341,  344,  344,  344,  344,  344,  344,
-      344,  344,  344,  344,  344,  348,  348,  348,  348,  348,
-      348,  348,  348,  348,  348,  348,  362,  362,  362,  362,
-      362,  362,  362,  362,  362,  362,  362,  365,  365,  365,
-      365,  365,  365,  365,  365,  365,  365,  365,  368,  368,
-      368,  368,  368,  368,  368,  368,  368,  368,  368,  372,
-      372,  372,  372,  372,  372,  372,  372,  372,  372,  372,
-      386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
-      386,  389, 1053,  389,  389,  389,  389,  389,  389,  389,
-      389,  389,  391, 1053,  391,  391,  391,  391,  391,  391,
-
-      391,  391,  391,  394, 1053,  394,  394,  394,  394,  394,
-      394,  394,  394,  394,  407, 1053,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  169, 1053, 1053,  169,  169,
-      416, 1053, 1053,  416,  416,  416,  447, 1053, 1053,  447,
-      631, 1053,  631,  631,  631,  631,  631,  631,  631,  631,
-      631,  634, 1053,  634,  634,  634,  634,  634,  634,  634,
-      634,  634,  636, 1053,  636,  636,  636,  636,  636,  636,
-      636,  636,  636,  639,  639,  639,  639,  639,  639,  639,
-      230,  230,  230,  230,  230,  230,  230,  230,  487,  487,
-      487,  487,  487,  487,  648, 1053,  648,  648,  648,  648,
-
-      491, 1053,  491,  491,  491,  491,  267,  267,  267,  267,
-      267,  267,  267,  273, 1053,  273,  273,  273,  273,  273,
-      273,  273,  273,  273,  659, 1053,  659,  659,  659,  659,
-      659,  659,  659,  659,  659,  662, 1053,  662,  662,  662,
-      662,  662,  662,  662,  662,  662,  663, 1053,  663,  663,
-      663,  663,  663,  663,  663,  663,  663,  666, 1053,  666,
-      666,  666,  666,  666,  666,  666,  666,  666,  229,  229,
-      229,  229,  229,  229,  229,  299,  299, 1053,  299,  299,
-      299,  299,  299,  299,  299,  299,  679,  679,  679,  679,
-      679,  679,  679,  679,  679,  679,  679,  681,  681, 1053,
-
-      681,  681,  681,  681,  681,  681,  681,  681,  317,  317,
-      317,  317,  317,  317,  317,  317,  317,  317,  317,  689,
-      689,  689,  689,  689,  689,  689,  689,  689,  689,  689,
-      693,  693,  693,  693,  693,  693,  693,  693,  693,  693,
-      693,  695,  695,  695,  695,  695,  695,  695,  695,  695,
-      695,  695,  699,  699,  699,  699,  699,  699,  699,  699,
-      699,  699,  699,  341,  341,  341,  341,  341,  341,  341,
-      341,  341,  341,  341,  707,  707,  707,  707,  707,  707,
-      707,  707,  707,  707,  707,  711,  711,  711,  711,  711,
-      711,  711,  711,  711,  711,  711,  713,  713,  713,  713,
-
-      713,  713,  713,  713,  713,  713,  713,  717,  717,  717,
-      717,  717,  717,  717,  717,  717,  717,  717,  365,  365,
-      365,  365,  365,  365,  365,  365,  365,  365,  365,  725,
-      725,  725,  725,  725,  725,  725,  725,  725,  725,  725,
-      729,  729,  729,  729,  729,  729,  729,  729,  729,  729,
-      729,  731,  731,  731,  731,  731,  731,  731,  731,  731,
-      731,  731,  735,  735,  735,  735,  735,  735,  735,  735,
-      735,  735,  735,  389, 1053,  389,  389,  389,  389,  389,
-      389,  389,  389,  389,  743, 1053,  743,  743,  743,  743,
-      743,  743,  743,  743,  743,  746, 1053,  746,  746,  746,
-
-      746,  746,  746,  746,  746,  746,  747, 1053,  747,  747,
-      747,  747,  747,  747,  747,  747,  747,  750, 1053,  750,
-      750,  750,  750,  750,  750,  750,  750,  750,  416, 1053,
-     1053,  416,  416,  416,  631, 1053,  631,  631,  631,  631,
-      631,  631,  631,  631,  631,  634, 1053,  634,  634,  634,
-      634,  634,  634,  634,  634,  634,  636, 1053,  636,  636,
-      636,  636,  636,  636,  636,  636,  636,  639,  639,  639,
-      639,  639,  639,  639,  230,  230,  230,  230,  230,  230,
-      230,  230,  648, 1053,  648,  648,  648,  648,  491, 1053,
-      491,  491,  491,  491,  267,  267,  267,  267,  267,  267,
-
-      267,  273, 1053,  273,  273,  273,  273,  273,  273,  273,
-      273,  273,  659, 1053,  659,  659,  659,  659,  659,  659,
-      659,  659,  659,  662, 1053,  662,  662,  662,  662,  662,
-      662,  662,  662,  662,  663, 1053,  663,  663,  663,  663,
-      663,  663,  663,  663,  663,  666, 1053,  666,  666,  666,
-      666,  666,  666,  666,  666,  666,  229,  229,  229,  229,
-      229,  229,  229,  299,  299, 1053,  299,  299,  299,  299,
-      299,  299,  299,  299,  679,  679,  679,  679,  679,  679,
-      679,  679,  679,  679,  679,  681,  681, 1053,  681,  681,
-      681,  681,  681,  681,  681,  681,  317,  317,  317,  317,
-
-      317,  317,  317,  317,  317,  317,  317,  689,  689,  689,
-      689,  689,  689,  689,  689,  689,  689,  689,  693,  693,
-      693,  693,  693,  693,  693,  693,  693,  693,  693,  695,
-      695,  695,  695,  695,  695,  695,  695,  695,  695,  695,
-      699,  699,  699,  699,  699,  699,  699,  699,  699,  699,
-      699,  341,  341,  341,  341,  341,  341,  341,  341,  341,
-      341,  341,  707,  707,  707,  707,  707,  707,  707,  707,
-      707,  707,  707,  711,  711,  711,  711,  711,  711,  711,
-      711,  711,  711,  711,  713,  713,  713,  713,  713,  713,
-      713,  713,  713,  713,  713,  717,  717,  717,  717,  717,
-
-      717,  717,  717,  717,  717,  717,  365,  365,  365,  365,
-      365,  365,  365,  365,  365,  365,  365,  725,  725,  725,
-      725,  725,  725,  725,  725,  725,  725,  725,  729,  729,
-      729,  729,  729,  729,  729,  729,  729,  729,  729,  731,
-      731,  731,  731,  731,  731,  731,  731,  731,  731,  731,
-      735,  735,  735,  735,  735,  735,  735,  735,  735,  735,
-      735,  389, 1053,  389,  389,  389,  389,  389,  389,  389,
-      389,  389,  743, 1053,  743,  743,  743,  743,  743,  743,
-      743,  743,  743,  746, 1053,  746,  746,  746,  746,  746,
-      746,  746,  746,  746,  747, 1053,  747,  747,  747,  747,
-
-      747,  747,  747,  747,  747,  750, 1053,  750,  750,  750,
-      750,  750,  750,  750,  750,  750,  416, 1053, 1053,  416,
-      416,  416,  230,  230,  230,  230,  230,  230,  230,  230,
-      491, 1053,  491,  491,  491,  491,  267,  267,  267,  267,
-      267,  267,  267,  273, 1053,  273,  273,  273,  273,  273,
-      273,  273,  273,  273,  229,  229,  229,  229,  229,  229,
-      229,  299,  299, 1053,  299,  299,  299,  299,  299,  299,
-      299,  299,   23, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053
+      342,  363,  363,  363,  363,  364,  342,  342,  342,  363,
+      363,  363,  363,  363,  363,  363,  363,  363,  363,  363,
+      363,  363,  342,  363,  363,  363,  363,  363,  363,  722,
+      363,  363,  363,  723,  363,  363,  363,  363,  363,  363,
+      363,  363,  363,  363,  363,  363,  342,  342,  367,  368,
+      431,  486,  422,  485,  474,  269,  473,  467,  466,  463,
+      451,  450,  449,  442,  565,  565,  565,  565,  441,  440,
+      437,  427,  424,  565,  565,  565,  423,  420,  419,  418,
+      167,  407,  393,  391,  314,  269,  295,  565,  565,  565,
+      565,  565,  565,  366,  366,  367,  368,  366,  366,  366,
+
+      366,  366,  366,  366,  366,  366,  366,  366,  291,  366,
+      366,  277,  275,  246,  257,  739,  366,  366,  366,  167,
+      246,  257,  167,  174,  165, 1061,   96,   65,   57, 1061,
+     1061, 1061,  366, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061,  366,  366,  366,  366,
+      367,  368,  366,  366,  366,  366,  366,  366,  366,  366,
+      366,  366,  366,  387,  366,  366,  387,  387,  387,  387,
+      388,  366,  366,  366,  387,  387,  387,  387,  387,  387,
+      387,  387,  387,  387,  387,  387,  387,  366,  387,  387,
+
+      387,  387,  387,  387,  740,  387,  387,  387,  741,  387,
+      387,  387,  387,  387,  387,  387,  387,  387,  387,  387,
+      387,  366,  366,  579,  579,  579,  579, 1061, 1061, 1061,
+     1061, 1061,  579,  579,  579, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061,  579,  579,  579,  579,
+      579,  579,  390,  390, 1061,  390,  390,  390,  390,  390,
+      390,  390,  390,  390,  390,  390,  390, 1061,  390,  390,
+     1061, 1061, 1061, 1061,  754,  390,  390,  390, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061,  390, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061,  390,  390,  390,  390, 1061,
+      390,  390,  390,  390,  390,  390,  390,  390,  390,  390,
+      390,  390,  408,  390,  390,  408,  408,  408,  408,  409,
+      390,  390,  390,  408,  408,  408,  408,  408,  408,  408,
+      408,  408,  408,  408,  408,  408,  390,  408,  408,  408,
+      408,  408,  408,  755,  408,  408,  408,  756,  408,  408,
+      408,  408,  408,  408,  408,  408,  408,  408,  408,  408,
+      390,  390,  274,  274, 1061,  274,  274,  274,  274,  274,
+      274,  274,  274,  274,  274,  274,  274, 1061,  274,  274,
+
+     1061, 1061, 1061, 1061,  670,  274,  274,  274, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061,  274, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061,  274,  274,  274,  274, 1061,
+      274,  274,  274,  274,  274,  274,  274,  274,  274,  274,
+      274,  274,  292,  274,  274,  292,  292,  292,  292,  293,
+      274,  274,  274,  292,  292,  292,  292,  292,  292,  292,
+      292,  292,  292,  292,  292,  292,  274,  292,  292,  292,
+      292,  292,  292,  292,  292,  292,  815,  292,  292,  292,
+
+      292,  292,  292,  292,  292,  292,  292,  292,  292,  292,
+      274,  274,  300,  300,  300,  300,  300,  300, 1061,  300,
+      300,  300,  300,  300,  300,  300,  300, 1061,  300,  300,
+     1061, 1061, 1061, 1061,  685,  300,  300,  300, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061,  300, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061,  300,  300,  300,  300,  300,
+      300,  300,  300, 1061,  300,  300,  300,  300,  300,  300,
+      300,  300,  315,  300,  300,  315,  315,  315,  315,  316,
+
+      300,  300,  300,  315,  315,  315,  315,  315,  315,  315,
+      315,  315,  315,  315,  315,  315,  300,  315,  315,  315,
+      315,  315,  315,  315,  315,  315,  825,  315,  315,  315,
+      315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
+      300,  300,  318,  318,  319,  320,  318,  318,  318,  318,
+      318,  318,  318,  318,  318,  318,  318, 1061,  318,  318,
+     1061, 1061, 1061, 1061,  703,  318,  318,  318, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061,  318, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+
+     1061, 1061, 1061, 1061, 1061,  318,  318,  318,  318,  319,
+      320,  318,  318,  318,  318,  318,  318,  318,  318,  318,
+      318,  318,  339,  318,  318,  339,  339,  339,  339,  340,
+      318,  318,  318,  339,  339,  339,  339,  339,  339,  339,
+      339,  339,  339,  339,  339,  339,  318,  339,  339,  339,
+      339,  339,  339,  339,  339,  339,  829,  339,  339,  339,
+      339,  339,  339,  339,  339,  339,  339,  339,  339,  339,
+      318,  318,  342,  342,  343,  344,  342,  342,  342,  342,
+      342,  342,  342,  342,  342,  342,  342, 1061,  342,  342,
+     1061, 1061, 1061, 1061,  721,  342,  342,  342, 1061, 1061,
+
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061,  342, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061,  342,  342,  342,  342,  343,
+      344,  342,  342,  342,  342,  342,  342,  342,  342,  342,
+      342,  342,  363,  342,  342,  363,  363,  363,  363,  364,
+      342,  342,  342,  363,  363,  363,  363,  363,  363,  363,
+      363,  363,  363,  363,  363,  363,  342,  363,  363,  363,
+      363,  363,  363,  363,  363,  363,  833,  363,  363,  363,
+      363,  363,  363,  363,  363,  363,  363,  363,  363,  363,
+
+      342,  342,  366,  366,  367,  368,  366,  366,  366,  366,
+      366,  366,  366,  366,  366,  366,  366, 1061,  366,  366,
+     1061, 1061, 1061, 1061,  739,  366,  366,  366, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061,  366, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061,  366,  366,  366,  366,  367,
+      368,  366,  366,  366,  366,  366,  366,  366,  366,  366,
+      366,  366,  387,  366,  366,  387,  387,  387,  387,  388,
+      366,  366,  366,  387,  387,  387,  387,  387,  387,  387,
+
+      387,  387,  387,  387,  387,  387,  366,  387,  387,  387,
+      387,  387,  387,  387,  387,  387,  837,  387,  387,  387,
+      387,  387,  387,  387,  387,  387,  387,  387,  387,  387,
+      366,  366,  390,  390, 1061,  390,  390,  390,  390,  390,
+      390,  390,  390,  390,  390,  390,  390, 1061,  390,  390,
+     1061, 1061, 1061, 1061,  754,  390,  390,  390, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061,  390, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061,  390,  390,  390,  390, 1061,
+
+      390,  390,  390,  390,  390,  390,  390,  390,  390,  390,
+      390,  390,  408,  390,  390,  408,  408,  408,  408,  409,
+      390,  390,  390,  408,  408,  408,  408,  408,  408,  408,
+      408,  408,  408,  408,  408,  408,  390,  408,  408,  408,
+      408,  408,  408,  408,  408,  408,  841,  408,  408,  408,
+      408,  408,  408,  408,  408,  408,  408,  408,  408,  408,
+      390,  390,  274,  274, 1061,  274,  274,  274,  274,  274,
+      274,  274,  274,  274,  274,  274,  274,  292,  274,  274,
+      292,  292,  292,  292,  293,  274,  274,  274,  292,  292,
+      292,  292,  292,  292,  292,  292,  292,  292,  292,  292,
+
+      292,  274,  292,  292,  292,  292,  292,  292,  292,  292,
+      292,  292,  890,  292,  292,  292,  292,  292,  292,  292,
+      292,  292,  292,  292,  292,  274,  274,  300,  300,  300,
+      300,  300,  300, 1061,  300,  300,  300,  300,  300,  300,
+      300,  300,  315,  300,  300,  315,  315,  315,  315,  316,
+      300,  300,  300,  315,  315,  315,  315,  315,  315,  315,
+      315,  315,  315,  315,  315,  315,  300,  315,  315,  315,
+      315,  315,  315,  315,  315,  315,  315,  894,  315,  315,
+      315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
+      300,  300,  166, 1061,  166,  166,  166,  166,  166,  166,
+
+      166,  166,  166,  169, 1061, 1061,  169,  169,  177, 1061,
+      177,  177,  177,  177,  177,  177,  177,  177,  177,  231,
+      231,  231,  231,  231,  231,  231,  231,  261,  261,  261,
+      261,  264, 1061,  264, 1061,  264,  264,  264,  264,  268,
+      268,  268,  268,  268,  268,  268,  274, 1061,  274,  274,
+      274,  274,  274,  274,  274,  274,  274,  276, 1061,  276,
+      276,  276,  276,  276,  276,  276,  276,  276,  279, 1061,
+      279,  279,  279,  279,  279,  279,  279,  279,  279,  292,
+     1061,  292,  292,  292,  292,  292,  292,  292,  292,  292,
+      230,  230,  230,  230,  230,  230,  230,  300,  300, 1061,
+
+      300,  300,  300,  300,  300,  300,  300,  300,  301,  301,
+      301,  301,  301,  301,  301,  301,  301,  301,  301,  315,
+      315, 1061,  315,  315,  315,  315,  315,  315,  315,  315,
+      318,  318,  318,  318,  318,  318,  318,  318,  318,  318,
+      318,  321,  321,  321,  321,  321,  321,  321,  321,  321,
+      321,  321,  325,  325,  325,  325,  325,  325,  325,  325,
+      325,  325,  325,  339,  339,  339,  339,  339,  339,  339,
+      339,  339,  339,  339,  342,  342,  342,  342,  342,  342,
+      342,  342,  342,  342,  342,  345,  345,  345,  345,  345,
+      345,  345,  345,  345,  345,  345,  349,  349,  349,  349,
+
+      349,  349,  349,  349,  349,  349,  349,  363,  363,  363,
+      363,  363,  363,  363,  363,  363,  363,  363,  366,  366,
+      366,  366,  366,  366,  366,  366,  366,  366,  366,  369,
+      369,  369,  369,  369,  369,  369,  369,  369,  369,  369,
+      373,  373,  373,  373,  373,  373,  373,  373,  373,  373,
+      373,  387,  387,  387,  387,  387,  387,  387,  387,  387,
+      387,  387,  390, 1061,  390,  390,  390,  390,  390,  390,
+      390,  390,  390,  392, 1061,  392,  392,  392,  392,  392,
+      392,  392,  392,  392,  395, 1061,  395,  395,  395,  395,
+      395,  395,  395,  395,  395,  408, 1061,  408,  408,  408,
+
+      408,  408,  408,  408,  408,  408,  169, 1061, 1061,  169,
+      169,  177, 1061,  177,  177,  177,  177,  177,  177,  177,
+      177,  177,  417, 1061, 1061,  417,  417,  417,  448, 1061,
+     1061,  448,  230,  230,  230,  230,  230,  230,  230,  231,
+      231,  231,  231,  231,  231,  231,  231,  475, 1061, 1061,
+     1061, 1061,  475,  475,  475,  475,  489,  489,  489,  489,
+      489,  489,  492,  492,  492,  492,  493, 1061,  493,  493,
+      493,  493,  268,  268,  268,  268,  268,  268,  268,  274,
+     1061,  274,  274,  274,  274,  274,  274,  274,  274,  274,
+      276, 1061,  276,  276,  276,  276,  276,  276,  276,  276,
+
+      276,  279, 1061,  279,  279,  279,  279,  279,  279,  279,
+      279,  279,  292, 1061,  292,  292,  292,  292,  292,  292,
+      292,  292,  292,  300,  300, 1061,  300,  300,  300,  300,
+      300,  300,  300,  300,  301,  301,  301,  301,  301,  301,
+      301,  301,  301,  301,  301,  315,  315, 1061,  315,  315,
+      315,  315,  315,  315,  315,  315,  318,  318,  318,  318,
+      318,  318,  318,  318,  318,  318,  318,  321,  321,  321,
+      321,  321,  321,  321,  321,  321,  321,  321,  325,  325,
+      325,  325,  325,  325,  325,  325,  325,  325,  325,  339,
+      339,  339,  339,  339,  339,  339,  339,  339,  339,  339,
+
+      342,  342,  342,  342,  342,  342,  342,  342,  342,  342,
+      342,  345,  345,  345,  345,  345,  345,  345,  345,  345,
+      345,  345,  349,  349,  349,  349,  349,  349,  349,  349,
+      349,  349,  349,  363,  363,  363,  363,  363,  363,  363,
+      363,  363,  363,  363,  366,  366,  366,  366,  366,  366,
+      366,  366,  366,  366,  366,  369,  369,  369,  369,  369,
+      369,  369,  369,  369,  369,  369,  373,  373,  373,  373,
+      373,  373,  373,  373,  373,  373,  373,  387,  387,  387,
+      387,  387,  387,  387,  387,  387,  387,  387,  390, 1061,
+      390,  390,  390,  390,  390,  390,  390,  390,  390,  392,
+
+     1061,  392,  392,  392,  392,  392,  392,  392,  392,  392,
+      395, 1061,  395,  395,  395,  395,  395,  395,  395,  395,
+      395,  408, 1061,  408,  408,  408,  408,  408,  408,  408,
+      408,  408,  169, 1061, 1061,  169,  169,  417, 1061, 1061,
+      417,  417,  417,  448, 1061, 1061,  448,  634, 1061,  634,
+      634,  634,  634,  634,  634,  634,  634,  634,  637, 1061,
+      637,  637,  637,  637,  637,  637,  637,  637,  637,  639,
+     1061,  639,  639,  639,  639,  639,  639,  639,  639,  639,
+      642,  642,  642,  642,  642,  642,  642,  231,  231,  231,
+      231,  231,  231,  231,  231,  489,  489,  489,  489,  489,
+
+      489,  651, 1061,  651,  651,  651,  651,  493, 1061,  493,
+      493,  493,  493,  268,  268,  268,  268,  268,  268,  268,
+      274, 1061,  274,  274,  274,  274,  274,  274,  274,  274,
+      274,  662, 1061,  662,  662,  662,  662,  662,  662,  662,
+      662,  662,  665, 1061,  665,  665,  665,  665,  665,  665,
+      665,  665,  665,  666, 1061,  666,  666,  666,  666,  666,
+      666,  666,  666,  666,  669, 1061,  669,  669,  669,  669,
+      669,  669,  669,  669,  669,  230,  230,  230,  230,  230,
+      230,  230,  300,  300, 1061,  300,  300,  300,  300,  300,
+      300,  300,  300,  682,  682,  682,  682,  682,  682,  682,
+
+      682,  682,  682,  682,  684,  684, 1061,  684,  684,  684,
+      684,  684,  684,  684,  684,  318,  318,  318,  318,  318,
+      318,  318,  318,  318,  318,  318,  692,  692,  692,  692,
+      692,  692,  692,  692,  692,  692,  692,  696,  696,  696,
+      696,  696,  696,  696,  696,  696,  696,  696,  698,  698,
+      698,  698,  698,  698,  698,  698,  698,  698,  698,  702,
+      702,  702,  702,  702,  702,  702,  702,  702,  702,  702,
+      342,  342,  342,  342,  342,  342,  342,  342,  342,  342,
+      342,  710,  710,  710,  710,  710,  710,  710,  710,  710,
+      710,  710,  714,  714,  714,  714,  714,  714,  714,  714,
+
+      714,  714,  714,  716,  716,  716,  716,  716,  716,  716,
+      716,  716,  716,  716,  720,  720,  720,  720,  720,  720,
+      720,  720,  720,  720,  720,  366,  366,  366,  366,  366,
+      366,  366,  366,  366,  366,  366,  728,  728,  728,  728,
+      728,  728,  728,  728,  728,  728,  728,  732,  732,  732,
+      732,  732,  732,  732,  732,  732,  732,  732,  734,  734,
+      734,  734,  734,  734,  734,  734,  734,  734,  734,  738,
+      738,  738,  738,  738,  738,  738,  738,  738,  738,  738,
+      390, 1061,  390,  390,  390,  390,  390,  390,  390,  390,
+      390,  746, 1061,  746,  746,  746,  746,  746,  746,  746,
+
+      746,  746,  749, 1061,  749,  749,  749,  749,  749,  749,
+      749,  749,  749,  750, 1061,  750,  750,  750,  750,  750,
+      750,  750,  750,  750,  753, 1061,  753,  753,  753,  753,
+      753,  753,  753,  753,  753,  417, 1061, 1061,  417,  417,
+      417,  634, 1061,  634,  634,  634,  634,  634,  634,  634,
+      634,  634,  637, 1061,  637,  637,  637,  637,  637,  637,
+      637,  637,  637,  639, 1061,  639,  639,  639,  639,  639,
+      639,  639,  639,  639,  642,  642,  642,  642,  642,  642,
+      642,  231,  231,  231,  231,  231,  231,  231,  231,  651,
+     1061,  651,  651,  651,  651,  493, 1061,  493,  493,  493,
+
+      493,  268,  268,  268,  268,  268,  268,  268,  274, 1061,
+      274,  274,  274,  274,  274,  274,  274,  274,  274,  662,
+     1061,  662,  662,  662,  662,  662,  662,  662,  662,  662,
+      665, 1061,  665,  665,  665,  665,  665,  665,  665,  665,
+      665,  666, 1061,  666,  666,  666,  666,  666,  666,  666,
+      666,  666,  669, 1061,  669,  669,  669,  669,  669,  669,
+      669,  669,  669,  230,  230,  230,  230,  230,  230,  230,
+      300,  300, 1061,  300,  300,  300,  300,  300,  300,  300,
+      300,  682,  682,  682,  682,  682,  682,  682,  682,  682,
+      682,  682,  684,  684, 1061,  684,  684,  684,  684,  684,
+
+      684,  684,  684,  318,  318,  318,  318,  318,  318,  318,
+      318,  318,  318,  318,  692,  692,  692,  692,  692,  692,
+      692,  692,  692,  692,  692,  696,  696,  696,  696,  696,
+      696,  696,  696,  696,  696,  696,  698,  698,  698,  698,
+      698,  698,  698,  698,  698,  698,  698,  702,  702,  702,
+      702,  702,  702,  702,  702,  702,  702,  702,  342,  342,
+      342,  342,  342,  342,  342,  342,  342,  342,  342,  710,
+      710,  710,  710,  710,  710,  710,  710,  710,  710,  710,
+      714,  714,  714,  714,  714,  714,  714,  714,  714,  714,
+      714,  716,  716,  716,  716,  716,  716,  716,  716,  716,
+
+      716,  716,  720,  720,  720,  720,  720,  720,  720,  720,
+      720,  720,  720,  366,  366,  366,  366,  366,  366,  366,
+      366,  366,  366,  366,  728,  728,  728,  728,  728,  728,
+      728,  728,  728,  728,  728,  732,  732,  732,  732,  732,
+      732,  732,  732,  732,  732,  732,  734,  734,  734,  734,
+      734,  734,  734,  734,  734,  734,  734,  738,  738,  738,
+      738,  738,  738,  738,  738,  738,  738,  738,  390, 1061,
+      390,  390,  390,  390,  390,  390,  390,  390,  390,  746,
+     1061,  746,  746,  746,  746,  746,  746,  746,  746,  746,
+      749, 1061,  749,  749,  749,  749,  749,  749,  749,  749,
+
+      749,  750, 1061,  750,  750,  750,  750,  750,  750,  750,
+      750,  750,  753, 1061,  753,  753,  753,  753,  753,  753,
+      753,  753,  753,  417, 1061, 1061,  417,  417,  417,  231,
+      231,  231,  231,  231,  231,  231,  231,  493, 1061,  493,
+      493,  493,  493,  268,  268,  268,  268,  268,  268,  268,
+      274, 1061,  274,  274,  274,  274,  274,  274,  274,  274,
+      274,  230,  230,  230,  230,  230,  230,  230,  300,  300,
+     1061,  300,  300,  300,  300,  300,  300,  300,  300,   23,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061
     } ;
 
-static yyconst flex_int16_t yy_chk[7039] =
+static yyconst flex_int16_t yy_chk[7046] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
@@ -1608,8 +1612,8 @@
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    3,  219,    3,    3,    3,
-       29,   44,   44,    3,    3,  219,    3,    3,   13,    3,
+        1,    1,    1,    1,    1,    3,  220,    3,    3,    3,
+       29,   44,   44,    3,    3,  220,    3,    3,   13,    3,
         3,    3,    6,   14,    6,    6,    3,    3,    3,    3,
        13,   13,   13,   13,   35,   14,   14,   14,   14,   25,
 
@@ -1673,709 +1677,710 @@
        21,   21,   21,   21,   21,   21,   21,   21,   21,   21,
        21,   21,   21,   21,   21,   21,   21,   21,   21,   21,
        21,   21,   21,   21,   21,   21,   21,   21,   21,   36,
-     1047,   36,   36,   36,   36,   40,   38,   36,   38,   38,
+     1055,   36,   36,   36,   36,   40,   38,   36,   38,   38,
        38,   38,   40,  102,   38,   39,   39,   39,   39,   46,
-       46,   39, 1043,   39,   39,   39,   39,   39,   39,   39,
+       46,   39, 1051,   39,   39,   39,   39,   39,   39,   39,
        39,   39,   39,   39,   39,   39,  102,   39,   39,   39,
        39,   39,   39,   39,   39,   39,   39,   39,   39,   39,
 
        39,   39,   39,   39,   39,   39,   39,   39,   39,   39,
        41,   47,   41,   41,   41,   41,  200,   51,   47,   49,
-     1042,   70,   41,   41,   51,   47,   49,   41,   55,   41,
-      200,   51,   41,   49,   52,   58,   41,   58,   58,   41,
-       42,   52,   42,   42,   42,   42,  817,   41,   52,   48,
-       56,  114,  114,   42,   70,   41,   48,   42,   50,   48,
-       48,   48,   48,   48,   49,   50,   78,   55,   51,   42,
-       43,  193,   50,   78,  817,   43,  193,   52,   43,   43,
-       43,   43,   43,   43,   53,   54,   43,   87,   43,   43,
-       56,   53,   54,   57,   57, 1041,   50,  113,   53,   54,
-
-      116,  116,   50,   59,   59,   59,   59,   67,   67,   67,
-       67,   60,   57,   60,   60,   60,   60, 1039,   64,  153,
-       87,   53,   71, 1038,   71,   64,   71,   71,   62,   54,
-      113,  197,   64,  197,   53,   61,   62,   62,   62,   62,
-       62,   62,   69,   69,   69,   69,   73,   62,   73,   73,
-       73,   73,  153,   61,   61,   64,   61,  166,   61,   80,
-       61,   61,   61,   61,   74,   61,   80,   61,   61,   61,
-      118,  118,  216,   61,   74,   74,   74,   74,   76,  118,
-       76,   76,   76,   76,   81,   81,   81,   81,  216,   80,
-      166,   76,  198,   79,  198,   76,   79,   79,   79,   79,
-
-       79,   74,   74,  126,  126,  214,   74,   76,   82,   82,
-       82,   82,   89,  214,   89,   89,   89,   89,   90,   90,
-       90,   90,  128,  128,   92,   99,   99,   99,   99,  117,
-      117,   92,  217,  117,   92,  138,  138,  217,   92,   98,
-       98,   98,   98,  105,  123,  123,   90,  105,  818,   92,
-       90,   91,  105,   91,   91,   91,   91,   92,  107,  107,
-      107,  107,  109,   91,   91,  123,  117,   98,   91,  109,
-       91,   98,  109,   91,  140,  140,  109,   91,  818,  106,
-       91,  106,  106,  106,  106,  195,  107,  109,   91,  195,
-      107,  135,  135,  195,  256,  109,   91,   94,   94,  256,
+     1050,   70,   41,   41,   51,   47,   49,   41,   55,   41,
+      200,   51,   41,   49,   56,   58,   41,   58,   58,   41,
+       42,   78,   42,   42,   42,   42,  676,   41,   78,   48,
+      197,   52,  197,   42,   70,   41,   48,   42,   52,   48,
+       48,   48,   48,   48,   49,   52,  193,   55,   51,   42,
+       43,  193,   43,  676,   56,   43, 1049,   50,   43,   43,
+       43,   43,   43,   43,   50,   53,   43,  822,   43,   43,
+       54,   50,   53,  218,   52,   57,   57,   54,  218,   53,
+
+       59,   59,   59,   59,   54,   60,   64,   60,   60,   60,
+       60, 1047,   80,   64,   57,   50,   87,  822,   62,   80,
+       64,   50,   53,  114,  114,  113,   62,   62,   62,   62,
+       62,   62,  116,  116,   54,   53,   61,   62,   67,   67,
+       67,   67,   80,   64,   69,   69,   69,   69,   71,   87,
+       71,  217,   71,   71,   61,   61,  105,   61,  113,   61,
+      105,   61,   61,   61,   61,  105,   61,  217,   61,   61,
+       61,   74, 1046,   73,   61,   73,   73,   73,   73,  126,
+      126,   74,   74,   74,   74,   76, 1044,   76,   76,   76,
+       76,   81,   81,   81,   81,  128,  128,  198,   76,  198,
+
+       79,  627,   76,   79,   79,   79,   79,   79,   74,   74,
+      627,  118,  118,   74,   76,   82,   82,   82,   82,   89,
+      118,   89,   89,   89,   89,   90,   90,   90,   90,  123,
+      123,   92,   99,   99,   99,   99,  117,  117,   92,  153,
+      117,   92,  130,  130, 1043,   92,   98,   98,   98,   98,
+      123,  130,  166,   90,  138,  138,   92,   90,   91, 1040,
+       91,   91,   91,   91,   92,  107,  107,  107,  107,  109,
+       91,   91,  153,  117,   98,   91,  109,   91,   98,  109,
+       91,  140,  140,  109,   91,  166,  106,   91,  106,  106,
+      106,  106,  195,  107,  109,   91,  195,  107,  135,  135,
+
+      195,  257,  109,   91,   94,   94,  257,   94,   94,   94,
+       94,   94,   94,   94,   94,   94,   94,   94,   94,  135,
+       94,   94,  215,  119,  119,  268,   94,   94,   94,   94,
+      215,  100,  268,  100,  100,  100,  100,  119,  276,  119,
+      119,  119,  119,   94,  100,  131,  131,  216,  100,  142,
+      142,  216,  129,  129,  190,  430,  129,  430,  142,  131,
+      100,  131,  131,  131,  131,  216,  190,   94,   94,   95,
+       95,  276,   95,   95,   95,   95,   95,   95,   95,   95,
+       95,   95,   95,   95, 1037,   95,   95,  120,  120,  129,
+      267,   95,   95,   95,   95,  147,  147,  163,  267,  163,
+
+      163,  132,  132,  120,  120,  120,  120,  155,   95,  155,
+      155,  155,  155,  427,   95,  122,  147,  132,  132,  132,
+      132,  299,  122,  206,  206,  122,  209,  209,  209,  122,
+      427,  120,   95,   95,  108,  120,  108,  108,  108,  108,
+      122,  156,  156,  156,  156,  132,  108,  108,  122,  132,
+      821,  108,  162,  108,  162,  162,  108,  299,  141,  141,
+      108,  291,  141,  108,  214,  214,  291,  162,  816,  156,
+      816,  108, 1036,  156,  170,  170,  170,  170,  821,  108,
+      111,  111,  111,  111,  111,  111, 1035,  111,  111,  111,
+      111,  111,  111,  111,  111,  141,  111,  111,  392,  134,
+
+      228,  228,  111,  111,  111,  111,  134,  468,  146,  134,
+     1033,  143,  143,  134,  247,  146,  247,  247,  146,  111,
+      830,  223,  146,  830,  134,  143,  223,  143,  143,  143,
+      143,  392,  134,  146,  171,  171,  171,  171,  896,  223,
+      468,  146,  896,  111,  111,  112,  112,  112,  112,  112,
+      112, 1032,  112,  112,  112,  112,  112,  112,  112,  112,
+      834,  112,  112,  834,  158,  254,  254,  112,  112,  112,
+      112,  158,  286,  286,  158,  144,  144, 1031,  158,  172,
+      172,  172,  172, 1030,  112,  173,  173,  173,  173,  158,
+      112,  144,  144,  144,  144,  309,  309,  158,  180,  180,
+
+      180,  180,  314,  184,  184,  184,  184,  314,  112,  112,
+      121,  121,  250,  301,  184,  838,  250,  301,  838,  144,
+      250,  892,  301,  144,  121, 1023,  121,  121,  121,  121,
+      184,  205,  205,  205,  205, 1018,  121,  121,  231,  318,
+      318,  121,  205,  121,  892,  231,  121,  320,  320,  207,
+      121,  207,  231,  121,  207,  207,  207,  207,  205,  323,
+      323,  121,  258,  258,  258,  258,  289,  289,  289,  121,
+      124,  124,  124,  124,  124,  124,  124,  124,  124,  124,
+      124,  124,  124,  124,  124,  842,  124,  124,  842,  235,
+      324,  324,  124,  124,  124,  124,  235,  181,  677,  181,
 
-       94,   94,   94,   94,   94,   94,   94,   94,   94,   94,
-       94,   94,  135,   94,   94,  266,  119,  119,  267,   94,
-       94,   94,   94,  266,  100,  267,  100,  100,  100,  100,
-      119,  426,  119,  119,  119,  119,   94,  100,  130,  130,
-      429,  100,  429,  147,  147,  129,  129,  130,  426,  129,
-      275,  141,  141,  100,  155,  141,  155,  155,  155,  155,
-       94,   94,   95,   95,  147,   95,   95,   95,   95,   95,
-       95,   95,   95,   95,   95,   95,   95,  190,   95,   95,
-      120,  120,  129,  275,   95,   95,   95,   95,  141,  190,
-      826,  142,  142,  826,  132,  132,  120,  120,  120,  120,
-
-      142,   95,  162,  830,  162,  162,  830,   95,  122,  230,
-      132,  132,  132,  132,  298,  122,  230,  162,  122,  206,
-      206, 1036,  122,  230,  120,   95,   95,  108,  120,  108,
-      108,  108,  108,  122,  156,  156,  156,  156,  132,  108,
-      108,  122,  132, 1035,  108,  163,  108,  163,  163,  108,
-      298,  131,  131,  108,  213,  213,  108,  170,  170,  170,
-      170,  812,  156,  812,  108,  131,  156,  131,  131,  131,
-      131, 1032,  108,  111,  111,  111,  111,  111,  111,  624,
-      111,  111,  111,  111,  111,  111,  111,  111,  624,  111,
-      111, 1029,  134,  227,  227,  111,  111,  111,  111,  134,
-
-      234,  146,  134, 1028,  143,  143,  134,  234,  146,  253,
-      253,  146,  111,  834,  234,  146,  834,  134,  143,  290,
-      143,  143,  143,  143,  290,  134,  146,  171,  171,  171,
-      171,  209,  209,  209,  146, 1027,  111,  111,  112,  112,
-      112,  112,  112,  112, 1025,  112,  112,  112,  112,  112,
-      112,  112,  112,  887,  112,  112,  246,  158,  246,  246,
-      112,  112,  112,  112,  158,  285,  285,  158,  144,  144,
-     1024,  158,  172,  172,  172,  172,  887,  112,  173,  173,
-      173,  173,  158,  112,  144,  144,  144,  144,  308,  308,
-      158,  180,  180,  180,  180,  222,  184,  184,  184,  184,
-
-      222,  112,  112,  121,  121,  391,  313,  184,  317,  317,
-      215,  313,  144,  222,  215,  838,  144,  121,  838,  121,
-      121,  121,  121,  184,  205,  205,  205,  205,  215,  121,
-      121,  319,  319,  249,  121,  205,  121,  249,  391,  121,
-     1023,  249,  207,  121,  207,  232,  121,  207,  207,  207,
-      207,  205,  232, 1022,  121,  232,  232,  232,  232,  232,
-      322,  322,  121,  124,  124,  124,  124,  124,  124,  124,
-      124,  124,  124,  124,  124,  124,  124,  124, 1015,  124,
-      124,  466,  236,  323,  323,  124,  124,  124,  124,  236,
-      181, 1010,  181,  181,  181,  181,  236,  233,  235,  238,
-
-      334,  334,  124,  181,  233,  235,  238,  181,  237,  239,
-     1009,  233,  235,  238,  466,  237,  239,  341,  341,  181,
-      343,  343,  237,  239,  236,  236,  124,  124,  125,  125,
+      181,  181,  181,  235,  941,  233,  234,  335,  335,  124,
+      181, 1017,  233,  234,  181,  233,  233,  233,  233,  233,
+      234,  260,  260,  260,  260,  677,  181,  262,  262,  262,
+      262,  262, 1014,  124,  124,  125,  125,  125,  125,  125,
       125,  125,  125,  125,  125,  125,  125,  125,  125,  125,
-      125,  125,  125,  237,  125,  125, 1007,  233,  235,  238,
-      125,  125,  125,  125,  240,  346,  346,  239,  822,  270,
-      822,  240,  257,  257,  257,  257,  270,  125,  240,  259,
-      259,  259,  259,  125,  261,  261,  261,  261,  261,  269,
-      329,  329,  269,  269,  269,  269,  269,  271,  271,  271,
-      271,  125,  125,  133,  133,  472,  240,  272,  272,  272,
-
-      272, 1006,  270,  279,  279,  279,  279,  133,  406,  133,
-      133,  133,  133,  406,  281,  281,  281,  281,  673,  133,
-      133,  288,  288,  288,  133,  281,  133,  329,  472,  133,
-      347,  347,  286,  133,  286,  506,  133,  286,  286,  286,
-      286,  281,  300, 1004,  133,  673,  300,  302,  302,  302,
-      302,  300,  133,  136,  136,  136,  136,  136,  136,  136,
-      136,  136,  136,  136,  136,  136,  136,  136,  506,  136,
-      136,  311,  311,  311, 1003,  136,  136,  136,  136,  653,
-      280, 1002,  280,  280,  280,  280,  653,  284,  284,  284,
-      284,  891,  136,  280,  309,  891,  309,  280,  284,  309,
-
-      309,  309,  309,  324,  324,  330,  330,  320,  320,  280,
-      885,  320,  324,  653,  284,  885,  136,  136,  137,  137,
+      941,  125,  125, 1013,  236,  238,  234,  125,  125,  125,
+      125,  236,  238,  237,  240,  239,  271,  942,  236,  238,
+      237,  240,  239,  271,  125,  342,  342,  237,  240,  239,
+      125,  241,  272,  272,  272,  272,  344,  344,  241, 1011,
+      238,  273,  273,  273,  273,  241,  347,  347,  125,  125,
+
+      133,  133,  325,  325,  236,  237,  237,  348,  348,  271,
+     1010,  325,  240,  942,  133,  239,  133,  133,  133,  133,
+      312,  312,  312,  241,  359,  359,  133,  133,  326,  326,
+      826,  133,  826,  133,  366,  366,  133,  326,  321,  321,
+      133,  270,  321,  133,  270,  270,  270,  270,  270,  349,
+      349,  133,  280,  280,  280,  280,  368,  368,  349,  133,
+      136,  136,  136,  136,  136,  136,  136,  136,  136,  136,
+      136,  136,  136,  136,  136,  321,  136,  136,  303,  303,
+      303,  303,  136,  136,  136,  136, 1009,  281,  407,  281,
+      281,  281,  281,  407,  282,  282,  282,  282,  897,  136,
+
+      281,  287,  897,  287,  281,  282,  287,  287,  287,  287,
+      371,  371,  310,  985,  310,  985,  281,  310,  310,  310,
+      310,  282, 1007,  136,  136,  137,  137,  137,  137,  137,
       137,  137,  137,  137,  137,  137,  137,  137,  137,  137,
-      137,  137,  137, 1000,  137,  137,  999,  325,  325,  998,
-      137,  137,  137,  137,  320,  297,  325,  297,  297,  297,
-      297,  303,  330,  303,  303,  303,  303,  137,  297,  358,
-      358,  674,  297,  137,  303,  997,  348,  348,  303,  321,
-      321,  353,  353,  321,  297,  348,  304,  304,  304,  304,
-      303,  137,  137,  145,  145,  365,  365,  304,  674,  349,
-      349,  332,  332,  307,  307,  307,  307,  145,  349,  145,
-
-      145,  145,  145,  304,  307,  995,  321,  332,  332,  145,
-      145,  326,  326,  892,  145,  937,  145,  892,  353,  145,
-      307,  335,  335,  145,  354,  354,  145,  326,  326,  326,
-      326,  337,  337,  937,  145,  337,  886,  335,  335,  335,
-      337,  886,  145,  148,  148,  148,  148,  148,  148,  148,
-      148,  148,  148,  148,  148,  148,  148,  148,  888,  148,
-      148,  328,  328,  367,  367,  148,  148,  148,  148,  370,
-      370,  354,  508,  333,  333,  371,  371,  328,  328,  328,
-      328,  888,  148,  893,  333,  994,  333,  893,  328,  333,
-      333,  333,  333,  372,  372,  377,  377,  344,  344,  345,
+      893,  137,  137,  372,  372,  330,  330,  137,  137,  137,
+      137,  285,  285,  285,  285,  298,  890,  298,  298,  298,
+      298,  890,  285,  893,  137,  331,  331,  898,  298,  516,
+      137,  898,  298,  322,  322,  354,  354,  322,  285,  333,
+      333,  383,  383, 1006,  298,  350,  350,  474,  137,  137,
+      145,  145,  330,  516,  350,  333,  333,  516,  304, 1005,
+
+      304,  304,  304,  304,  145, 1004,  145,  145,  145,  145,
+      322,  304,  331,  402,  402,  304,  145,  145,  327,  327,
+      474,  145,  354,  145,  444,  444,  145,  304,  336,  336,
+      145,  355,  355,  145,  327,  327,  327,  327,  338,  338,
+     1002,  145,  338,  891,  336,  336,  336,  338,  891,  145,
+      148,  148,  148,  148,  148,  148,  148,  148,  148,  148,
+      148,  148,  148,  148,  148, 1001,  148,  148,  305,  305,
+      305,  305,  148,  148,  148,  148,  453, 1000,  355,  305,
+      308,  308,  308,  308,  453,  334,  334,  453,  899,  148,
+      998,  308,  899,  345,  345,  305,  334,  345,  334,  373,
 
-      345,  344,  372,  345,  328,  508,  148,  148,  149,  149,
+      373,  334,  334,  334,  334,  346,  346,  308,  373,  346,
+      378,  378,  990,  148,  148,  149,  149,  149,  149,  149,
       149,  149,  149,  149,  149,  149,  149,  149,  149,  149,
-      149,  149,  149,  935,  149,  149,  993,  331,  331,  991,
-      149,  149,  149,  149,  344,  983,  345,  368,  368,  350,
-      350,  368,  377,  331,  331,  331,  331,  149,  382,  382,
-      356,  356,  981,  149,  331,  350,  350,  350,  350,  361,
-      361,  401,  401,  361,  352,  352,  356,  356,  361,  935,
-      331,  149,  149,  157,  368,  157,  157,  157,  157,  889,
-      352,  352,  352,  352,  889,  157,  157,  357,  357,  979,
-      157,  352,  157,  378,  378,  157,  359,  359,  357,  157,
-
-      357,  578,  157,  357,  357,  357,  357,  352,  373,  373,
-      157,  977,  359,  359,  359,  443,  443,  373,  157,  160,
-      160,  938,  160,  160,  160,  160,  160,  160,  160,  160,
-      160,  160,  160,  160,  578,  160,  160,  355,  355,  938,
-      378,  160,  160,  160,  160,  395,  395,  395,  395,  501,
-      501,  374,  374,  355,  355,  355,  355,  894,  160,  376,
-      376,  894,  369,  369,  355,  976,  369,  374,  374,  374,
-      374,  404,  404,  404,  890,  376,  376,  376,  376,  890,
-      355,  975,  160,  160,  161,  161,  376,  161,  161,  161,
-      161,  161,  161,  161,  161,  161,  161,  161,  161,  369,
-
-      161,  161,  376,  379,  379,  974,  161,  161,  161,  161,
-      380,  380,  446,  446,  446,  383,  383,  519,  519,  379,
-      379,  379,  379,  161,  381,  381,  380,  380,  972,  161,
-      379,  383,  383,  383,  936,  381,  410,  381,  410,  410,
-      381,  381,  381,  381,  573,  573,  379,  161,  161,  289,
-      289,  289,  289,  385,  385,  537,  537,  385,  289,  289,
-      289,  402,  385,  402,  537,  939,  402,  402,  402,  402,
-      940,  580,  289,  289,  289,  289,  289,  289,  291,  291,
-      936,  291,  291,  291,  291,  291,  291,  291,  291,  291,
-      291,  291,  291,  971,  291,  291,  411,  411,  411,  411,
-
-      291,  291,  291,  291,  580,  396,  970,  396,  396,  396,
-      396,  939,  397,  397,  397,  397,  940,  291,  396,  504,
-      504,  504,  396,  397,  412,  412,  412,  412,  413,  413,
-      413,  413,  647,  647,  396,  414,  414,  414,  414,  397,
-      969,  291,  291,  292,  292,  968,  292,  292,  292,  292,
-      292,  292,  292,  292,  292,  292,  292,  292,  292,  292,
-      292,  292,  292,  292,  292,  292,  292,  292,  292,  292,
-      292,  292,  292,  292,  292,  292,  292,  292,  292,  292,
-      292,  292,  292,  292,  292,  292,  292,  292,  292,  292,
+      345,  149,  149,  988,  329,  329,  656,  149,  149,  149,
+      149,  986,  346,  656,  369,  369,  332,  332,  369,  984,
+      329,  329,  329,  329,  149,  357,  357,  378,  360,  360,
+      149,  329,  332,  332,  332,  332,  503,  503,  379,  379,
+      656,  357,  357,  332,  360,  360,  360,  329,  149,  149,
+      157,  369,  157,  157,  157,  157,  900,  362,  362,  332,
+      900,  362,  157,  157,  351,  351,  362,  157,  411,  157,
+
+      411,  411,  157,  358,  358,  983,  157,  381,  381,  157,
+      351,  351,  351,  351,  358,  379,  358,  157,  982,  358,
+      358,  358,  358,  381,  381,  157,  160,  160,  981,  160,
+      160,  160,  160,  160,  160,  160,  160,  160,  160,  160,
+      160,  947,  160,  160,  353,  353,  374,  374,  160,  160,
+      160,  160,  405,  405,  405,  374,  521,  521,  375,  375,
+      353,  353,  353,  353,  901,  160,  356,  356,  901,  370,
+      370,  353,  979,  370,  375,  375,  375,  375,  396,  396,
+      396,  396,  356,  356,  356,  356,  947,  353,  508,  160,
+      160,  161,  161,  356,  161,  161,  161,  161,  161,  161,
+
+      161,  161,  161,  161,  161,  161,  370,  161,  161,  356,
+      377,  377,  978,  161,  161,  161,  161,  412,  412,  412,
+      412,  508,  384,  384,  575,  575,  377,  377,  377,  377,
+      161,  650,  650,  380,  380,  977,  161,  377,  384,  384,
+      384,  413,  413,  413,  413,  414,  414,  414,  414,  380,
+      380,  380,  380,  377,  161,  161,  290,  290,  290,  290,
+      380,  415,  415,  415,  415,  290,  290,  290,  386,  386,
+      530,  530,  386,  447,  447,  447,  380,  386,  976,  290,
+      290,  290,  290,  290,  290,  292,  292,  975,  292,  292,
       292,  292,  292,  292,  292,  292,  292,  292,  292,  292,
 
-      292,  292,  292,  292,  292,  292,  292,  292,  293,  293,
-      967,  293,  293,  293,  293,  293,  293,  293,  293,  293,
-      293,  293,  293,  964,  293,  293,  400,  400,  400,  400,
-      293,  293,  293,  293,  415,  963,  415,  400,  962,  415,
-      415,  415,  415,  442,  442,  442,  442,  293,  444,  444,
-      444,  444,  451,  400,  442,  445,  445,  445,  445,  961,
-      451,  670,  670,  451,  691,  691,  293,  522,  522,  522,
-      442,  293,  293,  312,  312,  312,  312,  959,  474,  476,
-      477,  478,  312,  312,  312,  474,  476,  477,  478,  957,
-      528,  528,  474,  476,  477,  478,  312,  312,  312,  312,
-
-      312,  312,  314,  314,  314,  314,  314,  314,  956,  314,
-      314,  314,  314,  314,  314,  314,  314,  631,  314,  314,
-      955,  479,  477,  481,  314,  314,  314,  314,  479,  954,
-      481,  502,  502,  502,  502,  479,  953,  481,  528,  551,
-      551,  314,  489,  489,  489,  489,  489,  497,  551,  497,
-      631,  952,  497,  497,  497,  497,  503,  503,  503,  503,
-      520,  520,  520,  520,  481,  314,  314,  315,  315,  315,
-      315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
-      315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
-      315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
-
-      315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
-      315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
-      315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
-      315,  315,  316,  316,  316,  316,  316,  316,  951,  316,
-      316,  316,  316,  316,  316,  316,  316,  895,  316,  316,
-      514,  895,  482,  496,  316,  316,  316,  316,  475,  482,
-      496,  950,  480,  896,  524,  475,  482,  896,  524,  480,
-      949,  316,  475,  524,  514,  928,  480,  636,  514,  659,
-      500,  500,  500,  500,  496,  531,  531,  926,  496,  482,
-      316,  500,  654,  529,  529,  316,  316,  327,  327,  654,
-
-      480,  531,  531,  475,  480,  543,  543,  500,  542,  542,
-      636,  327,  659,  327,  327,  327,  327,  925,  518,  518,
-      518,  518,  545,  545,  327,  515,  654,  515,  327,  518,
-      515,  515,  515,  515,  521,  521,  521,  521,  545,  545,
-      327,  336,  336,  529,  924,  518,  532,  532,  576,  576,
-      576,  557,  557,  533,  533,  543,  542,  336,  336,  336,
-      336,  923,  532,  532,  532,  532,  336,  336,  336,  533,
-      533,  533,  533,  663,  692,  692,  556,  556,  697,  697,
-      336,  336,  336,  336,  336,  336,  338,  338,  338,  338,
-      338,  338,  338,  338,  338,  338,  338,  338,  338,  338,
-
-      338,  557,  338,  338,  527,  527,  663,  921,  338,  338,
-      338,  338,  534,  534,  978,  527,  978,  527,  548,  548,
-      527,  527,  527,  527,  556,  338,  541,  541,  534,  534,
-      534,  559,  559,  920,  548,  548,  548,  541,  919,  541,
-      698,  698,  541,  541,  541,  541,  918,  559,  559,  338,
-      338,  339,  339,  339,  339,  339,  339,  339,  339,  339,
-      339,  339,  339,  339,  339,  339,  339,  339,  339,  339,
-      339,  339,  339,  339,  339,  339,  339,  339,  339,  339,
-      339,  339,  339,  339,  339,  339,  339,  339,  339,  339,
-      339,  339,  339,  339,  339,  339,  339,  339,  339,  339,
+      510,  292,  292,  382,  382,  580,  974,  292,  292,  292,
+      292,  506,  506,  506,  382,  987,  382,  987,  530,  382,
+      382,  382,  382,  397,  292,  397,  397,  397,  397,  445,
+      445,  445,  445,  510,  673,  673,  397,  403,  580,  403,
+      397,  973,  403,  403,  403,  403,  694,  694,  292,  292,
+      293,  293,  397,  293,  293,  293,  293,  293,  293,  293,
+      293,  293,  293,  293,  293,  293,  293,  293,  293,  293,
+      293,  293,  293,  293,  293,  293,  293,  293,  293,  293,
+      293,  293,  293,  293,  293,  293,  293,  293,  293,  293,
+      293,  293,  293,  293,  293,  293,  293,  293,  293,  293,
+
+      293,  293,  293,  293,  293,  293,  293,  293,  293,  293,
+      293,  293,  293,  293,  293,  294,  294,  970,  294,  294,
+      294,  294,  294,  294,  294,  294,  294,  294,  294,  294,
+      969,  294,  294,  398,  398,  398,  398,  294,  294,  294,
+      294,  524,  524,  524,  398,  401,  401,  401,  401,  968,
+      443,  443,  443,  443,  294,  967,  401,  416,  943,  416,
+      398,  443,  416,  416,  416,  416,  446,  446,  446,  446,
+      695,  695,  401,  294,  531,  531,  943,  443,  294,  294,
+      313,  313,  313,  313,  965,  476,  478,  479,  480,  313,
+      313,  313,  476,  478,  479,  480,  963,  544,  544,  476,
+
+      478,  479,  480,  313,  313,  313,  313,  313,  313,  315,
+      315,  315,  315,  315,  315,  962,  315,  315,  315,  315,
+      315,  315,  315,  315,  531,  315,  315,  961,  481,  479,
+      483,  315,  315,  315,  315,  481,  960,  483,  504,  504,
+      504,  504,  481,  959,  483,  544,  539,  539,  315,  491,
+      491,  491,  491,  491,  499,  539,  499,  700,  700,  499,
+      499,  499,  499,  505,  505,  505,  505,  522,  522,  522,
+      522,  483,  315,  315,  316,  316,  316,  316,  316,  316,
+      316,  316,  316,  316,  316,  316,  316,  316,  316,  316,
+      316,  316,  316,  316,  316,  316,  316,  316,  316,  316,
+
+      316,  316,  316,  316,  316,  316,  316,  316,  316,  316,
+      316,  316,  316,  316,  316,  316,  316,  316,  316,  316,
+      316,  316,  316,  316,  316,  316,  316,  316,  316,  316,
+      316,  316,  316,  316,  316,  316,  316,  316,  316,  317,
+      317,  317,  317,  317,  317,  958,  317,  317,  317,  317,
+      317,  317,  317,  317,  957,  317,  317,  701,  701,  484,
+      498,  317,  317,  317,  317,  477,  484,  498,  956,  482,
+      902,  526,  477,  484,  902,  526,  482,  955,  317,  477,
+      526,  558,  558,  482,  533,  533,  582,  502,  502,  502,
+      502,  498,  578,  578,  578,  498,  484,  317,  502,  657,
+
+      533,  533,  317,  317,  328,  328,  657,  482,  538,  538,
+      477,  482,  538,  634,  502,  553,  553,  639,  328,  582,
+      328,  328,  328,  328,  553,  520,  520,  520,  520,  558,
+      662,  328,  517,  657,  517,  328,  520,  517,  517,  517,
+      517,  523,  523,  523,  523,  538,  634,  328,  337,  337,
+      639,  934,  520,  534,  534,  712,  712,  894,  545,  545,
+      535,  535,  894,  662,  337,  337,  337,  337,  945,  534,
+      534,  534,  534,  337,  337,  337,  535,  535,  535,  535,
+      666,  559,  559,  576,  576,  576,  576,  337,  337,  337,
+      337,  337,  337,  339,  339,  339,  339,  339,  339,  339,
+
+      339,  339,  339,  339,  339,  339,  339,  339,  545,  339,
+      339,  529,  529,  666,  945,  339,  339,  339,  339,  536,
+      536,  989,  529,  989,  529,  547,  547,  529,  529,  529,
+      529,  559,  339,  543,  543,  536,  536,  536,  561,  561,
+      895,  547,  547,  932,  543,  895,  543,  713,  713,  543,
+      543,  543,  543,  931,  561,  561,  339,  339,  340,  340,
+      340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
+      340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
+      340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
+      340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
 
-      339,  339,  339,  339,  339,  339,  339,  339,  339,  339,
-      339,  339,  339,  339,  339,  339,  340,  340,  340,  340,
       340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
-      340,  917,  340,  340,  530,  530,  565,  565,  340,  340,
-      340,  340,  709,  709,  916,  565,  574,  574,  574,  574,
-      530,  530,  530,  530,  679,  340,  536,  536,  679,  915,
-      536,  530,  641,  679,  538,  538,  687,  687,  538,  641,
-      913,  642,  546,  546,  340,  912,  641,  530,  642,  340,
-      340,  351,  351,  693,  693,  642,  544,  544,  546,  546,
-      546,  546,  693,  536,  980,  351,  980,  351,  351,  351,
-
-      351,  538,  544,  544,  544,  544,  688,  688,  351,  687,
-      710,  710,  351,  544,  547,  547,  550,  550,  552,  552,
-      550,  743,  552,  911,  351,  360,  360,  715,  715,  544,
-      547,  547,  547,  547,  575,  575,  575,  575,  694,  694,
-      941,  360,  360,  360,  360,  562,  562,  694,  910,  688,
-      360,  360,  360,  550,  743,  552,  583,  583,  583,  583,
-      909,  562,  562,  562,  360,  360,  360,  360,  360,  360,
-      362,  362,  362,  362,  362,  362,  362,  362,  362,  362,
-      362,  362,  362,  362,  362,  941,  362,  362,  555,  555,
-      716,  716,  362,  362,  362,  362,  560,  560,  982,  555,
-
-      982,  555,  561,  561,  555,  555,  555,  555,  908,  362,
-      727,  727,  560,  560,  560,  560,  711,  711,  561,  561,
-      561,  561,  569,  907,  569,  711,  906,  569,  569,  569,
-      569,  728,  728,  362,  362,  363,  363,  363,  363,  363,
-      363,  363,  363,  363,  363,  363,  363,  363,  363,  363,
-      363,  363,  363,  363,  363,  363,  363,  363,  363,  363,
-      363,  363,  363,  363,  363,  363,  363,  363,  363,  363,
-      363,  363,  363,  363,  363,  363,  363,  363,  363,  363,
-      363,  363,  363,  363,  363,  363,  363,  363,  363,  363,
+      340,  340,  340,  340,  340,  340,  340,  340,  340,  340,
+      340,  340,  340,  341,  341,  341,  341,  341,  341,  341,
+      341,  341,  341,  341,  341,  341,  341,  341,  930,  341,
+      341,  532,  532,  567,  567,  341,  341,  341,  341,  718,
+      718,  929,  567,  546,  546,  719,  719,  532,  532,  532,
+      532,  927,  341,  540,  540,  730,  730,  540,  532,  546,
+      546,  546,  546,  926,  548,  548,  577,  577,  577,  577,
+      546,  341,  731,  731,  532,  746,  341,  341,  352,  352,
+      548,  548,  548,  548,  549,  549,  546,  552,  552,  903,
+
+      540,  552,  352,  903,  352,  352,  352,  352,  550,  550,
+      549,  549,  549,  549,  750,  352,  554,  554,  746,  352,
+      554,  944,  644,  645,  550,  550,  550,  557,  557,  644,
+      645,  352,  361,  361,  552,  925,  644,  645,  557,  944,
+      557,  736,  736,  557,  557,  557,  557,  750,  361,  361,
+      361,  361,  946,  554,  737,  737,  649,  361,  361,  361,
+      566,  566,  888,  649,  566,  585,  585,  585,  585,  888,
+      649,  361,  361,  361,  361,  361,  361,  363,  363,  363,
       363,  363,  363,  363,  363,  363,  363,  363,  363,  363,
+      363,  363,  888,  363,  363,  560,  560,  566,  946,  363,
 
+      363,  363,  363,  564,  564,  649,  682,  562,  562,  924,
+      682,  560,  560,  560,  560,  682,  363,  563,  563,  564,
+      564,  564,  560,  562,  562,  562,  562,  586,  586,  586,
+      586,  827,  827,  563,  563,  563,  563,  997,  560,  997,
+      363,  363,  364,  364,  364,  364,  364,  364,  364,  364,
+      364,  364,  364,  364,  364,  364,  364,  364,  364,  364,
+      364,  364,  364,  364,  364,  364,  364,  364,  364,  364,
+      364,  364,  364,  364,  364,  364,  364,  364,  364,  364,
+      364,  364,  364,  364,  364,  364,  364,  364,  364,  364,
       364,  364,  364,  364,  364,  364,  364,  364,  364,  364,
-      364,  364,  364,  364,  364,  905,  364,  364,  558,  558,
-      733,  733,  364,  364,  364,  364,  904,  572,  572,  572,
-      572,  942,  705,  705,  558,  558,  558,  558,  572,  364,
-      564,  564,  712,  712,  564,  558,  643,  747,  566,  566,
-      903,  712,  566,  643,  572,  700,  700,  902,  364,  700,
-      643,  558,  901,  364,  364,  375,  375,  584,  584,  584,
-      584,  655,  655,  655,  655,  705,  942,  564,  899,  375,
-      747,  375,  375,  375,  375,  566,  645,  643,  644,  990,
-      646,  990,  375,  645,  808,  644,  375,  646,  729,  729,
-
-      645,  808,  644,  877,  646,  734,  734,  729,  375,  384,
-      384,  656,  656,  656,  656,  675,  675,  675,  675,  676,
-      676,  676,  676,  823,  823,  384,  384,  384,  384,  644,
-      645,  808,  706,  706,  384,  384,  384,  689,  689,  646,
-      876,  689,  718,  718,  723,  723,  718,  943,  384,  384,
-      384,  384,  384,  384,  386,  386,  386,  386,  386,  386,
-      386,  386,  386,  386,  386,  386,  386,  386,  386,  874,
-      386,  386,  685,  685,  689,  706,  386,  386,  386,  386,
-      686,  686,  736,  736,  703,  703,  736,  723,  685,  685,
-      685,  685,  943,  386,  704,  704,  686,  686,  686,  686,
-
-      703,  703,  703,  703,  873,  730,  730,  824,  824,  871,
-      704,  704,  704,  704,  730,  825,  825,  386,  386,  387,
-      387,  387,  387,  387,  387,  387,  387,  387,  387,  387,
-      387,  387,  387,  387,  387,  387,  387,  387,  387,  387,
-      387,  387,  387,  387,  387,  387,  387,  387,  387,  387,
-      387,  387,  387,  387,  387,  387,  387,  387,  387,  387,
-      387,  387,  387,  387,  387,  387,  387,  387,  387,  387,
-      387,  387,  387,  387,  387,  387,  387,  387,  387,  387,
-      387,  387,  387,  387,  388,  388,  388,  388,  388,  388,
-      388,  388,  388,  388,  388,  388,  388,  388,  388,  944,
 
-      388,  388,  724,  724,  827,  827,  388,  388,  388,  388,
-      739,  739,  739,  739,  828,  828,  690,  690,  695,  695,
-      690,  870,  695,  388,  696,  696,  707,  707,  696,  869,
-      707,  708,  708,  713,  713,  708,  866,  713,  740,  740,
-      740,  740,  388,  758,  944,  724,  865,  388,  388,  405,
-      405,  405,  405,  690,  864,  695,  758,  797,  405,  405,
-      405,  696,  758,  707,  797,  829,  829,  863,  708,  861,
-      713,  797,  405,  405,  405,  405,  405,  405,  407,  407,
-      860,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  859,  407,  407,  858,  721,  721,  797,
-
-      407,  407,  407,  407,  722,  722,  831,  831,  714,  714,
-      774,  857,  714,  721,  721,  721,  721,  407,  832,  832,
-      722,  722,  722,  722,  856,  774,  833,  833,  837,  837,
-      882,  774,  882,  882,  897,  898, 1018, 1018,  897,  898,
-      854,  407,  407,  408,  408,  714,  408,  408,  408,  408,
-      408,  408,  408,  408,  408,  408,  408,  408,  408,  408,
-      408,  408,  408,  408,  408,  408,  408,  408,  408,  408,
-      408,  408,  408,  408,  408,  408,  408,  408,  408,  408,
-      408,  408,  408,  408,  408,  408,  408,  408,  408,  408,
+      364,  364,  364,  364,  364,  364,  364,  365,  365,  365,
+      365,  365,  365,  365,  365,  365,  365,  365,  365,  365,
+      365,  365,  923,  365,  365,  574,  574,  574,  574,  365,
+      365,  365,  365,  922,  696,  696,  574,  568,  568,  828,
+      828,  568,  571,  696,  571,  921,  365,  571,  571,  571,
+      571,  920,  574,  646,  647,  658,  658,  658,  658,  918,
+      646,  647,  648,  829,  829,  365,  917,  646,  647,  648,
+      365,  365,  376,  376,  568,  916,  648,  659,  659,  659,
+      659,  678,  678,  678,  678,  915,  376,  914,  376,  376,
+      376,  376,  831,  831,  646,  647,  690,  690,  913,  376,
+
+      761,  691,  691,  376,  688,  688,  648,  679,  679,  679,
+      679,  689,  689,  761,  912,  376,  385,  385,  911,  761,
+      688,  688,  688,  688,  832,  832,  910,  689,  689,  689,
+      689,  948,  385,  385,  385,  385,  703,  703,  909,  690,
+      703,  385,  385,  385,  691,  692,  692,  833,  833,  692,
+      693,  693,  708,  708,  693,  385,  385,  385,  385,  385,
+      385,  387,  387,  387,  387,  387,  387,  387,  387,  387,
+      387,  387,  387,  387,  387,  387,  948,  387,  387,  697,
+      697,  908,  692,  387,  387,  387,  387,  693,  697,  706,
+      706,  835,  835,  707,  707,  708,  907,  721,  721,  906,
+
+      387,  721,  724,  724,  905,  706,  706,  706,  706,  707,
+      707,  707,  707,  714,  714,  836,  836,  905,  724,  724,
+      724,  724,  714,  905,  387,  387,  388,  388,  388,  388,
+      388,  388,  388,  388,  388,  388,  388,  388,  388,  388,
+      388,  388,  388,  388,  388,  388,  388,  388,  388,  388,
+      388,  388,  388,  388,  388,  388,  388,  388,  388,  388,
+      388,  388,  388,  388,  388,  388,  388,  388,  388,  388,
+      388,  388,  388,  388,  388,  388,  388,  388,  388,  388,
+      388,  388,  388,  388,  388,  388,  388,  388,  388,  388,
+      388,  389,  389,  389,  389,  389,  389,  389,  389,  389,
+
+      389,  389,  389,  389,  389,  389,  949,  389,  389,  709,
+      709,  715,  715,  389,  389,  389,  389,  904,  726,  726,
+      715,  727,  727,  698,  698,  699,  699,  698,  882,  699,
+      389,  710,  710,  711,  711,  710,  881,  711,  716,  716,
+      717,  717,  716,  879,  717,  878,  739,  739,  777,  389,
+      739,  949,  709,  876,  389,  389,  406,  406,  406,  406,
+      698,  726,  699,  777,  727,  406,  406,  406,  710,  777,
+      711,  742,  742,  742,  742,  716,  875,  717,  950,  406,
+      406,  406,  406,  406,  406,  408,  408,  874,  408,  408,
       408,  408,  408,  408,  408,  408,  408,  408,  408,  408,
 
-      408,  408,  408,  408,  408,  408,  408,  408,  409,  409,
-      853,  409,  409,  409,  409,  409,  409,  409,  409,  409,
-      409,  409,  409,  945,  409,  409,  900,  883,  807,  884,
-      409,  409,  409,  409,  883,  807,  884, 1019, 1019,  900,
-      725,  725,  726,  726,  725,  900,  726,  409,  731,  731,
-      732,  732,  731,  799,  732,  800,  852,  883,  851,  884,
-      799,  849,  800,  807, 1020, 1020,  409,  799,  945,  800,
-      848,  409,  409,  505,  505,  505,  505,  725,  847,  726,
-      846,  880,  505,  505,  505,  731,  845,  732,  880,  844,
-      843,  932,  799,  932,  932,  880,  505,  505,  505,  505,
-
-      505,  505,  509,  509,  800,  509,  509,  509,  509,  509,
-      509,  509,  509,  509,  509,  509,  509,  946,  509,  509,
-      842,  878,  879,  881,  509,  509,  509,  509,  878,  879,
-      881,  933,  840,  934,  930,  878,  879,  881,  930,  931,
-      839,  509,  933,  931,  934,  930,  985,  985,  985,  933,
-      931,  934,  930,  987,  987,  987,  814,  931,  878,  879,
-      805,  802,  946,  796,  795,  509,  509,  510,  510,  794,
-      510,  510,  510,  510,  510,  510,  510,  510,  510,  510,
-      510,  510,  510,  510,  510,  510,  510,  510,  510,  510,
-      510,  510,  510,  510,  510,  510,  510,  510,  510,  510,
-
-      510,  510,  510,  510,  510,  510,  510,  510,  510,  510,
-      510,  510,  510,  510,  510,  510,  510,  510,  510,  510,
-      510,  510,  510,  510,  510,  510,  510,  510,  510,  510,
-      510,  510,  523,  523,  523,  523,  793,  798,  989,  989,
-      989,  523,  523,  523,  798,  947,  948,  792,  984,  984,
-      984,  798,  984,  791,  790,  523,  523,  523,  523,  523,
-      523,  525,  525,  525,  525,  525,  525,  789,  525,  525,
-      525,  525,  525,  525,  525,  525,  788,  525,  525,  787,
-      786,  798,  785,  525,  525,  525,  525,  782,  781,  779,
-      947,  948,  986,  986,  986,  776,  986,  988,  988,  988,
-
-      525,  988,  775,  773,  772,  771,  770,  769,  768,  767,
-      766,  765,  763,  762,  761,  760,  757,  755,  754,  753,
-      751,  746,  742,  741,  525,  525,  526,  526,  526,  526,
-      526,  526,  738,  526,  526,  526,  526,  526,  526,  526,
-      526,  526,  526,  526,  526,  526,  526,  526,  526,  526,
-      526,  526,  526,  526,  526,  526,  526,  526,  526,  526,
-      526,  526,  526,  526,  526,  526,  526,  526,  526,  526,
-      526,  526,  526,  526,  526,  526,  526,  526,  526,  526,
-      526,  526,  526,  526,  526,  526,  526,  526,  526,  526,
-      526,  535,  535,  720,  702,  684,  682,  678,  677,  672,
-
-      671,  669,  667,  662,  658,  657,  652,  535,  535,  535,
-      535,  651,  650,  649,  640,  639,  535,  535,  535,  634,
-      630,  629,  628,  627,  626,  625,  623,  622,  621,  620,
-      535,  535,  535,  535,  535,  535,  539,  539,  539,  539,
-      539,  539,  539,  539,  539,  539,  539,  539,  539,  539,
-      539,  619,  539,  539,  618,  616,  615,  614,  539,  539,
-      539,  539,  613,  612,  611,  610,  609,  607,  606,  605,
-      604,  603,  602,  601,  600,  539,  599,  598,  597,  595,
-      594,  593,  592,  591,  590,  589,  588,  587,  586,  579,
-      571,  570,  517,  516,  513,  512,  511,  507,  499,  539,
-
-      539,  540,  540,  540,  540,  540,  540,  540,  540,  540,
-      540,  540,  540,  540,  540,  540,  540,  540,  540,  540,
-      540,  540,  540,  540,  540,  540,  540,  540,  540,  540,
-      540,  540,  540,  540,  540,  540,  540,  540,  540,  540,
-      540,  540,  540,  540,  540,  540,  540,  540,  540,  540,
-      540,  540,  540,  540,  540,  540,  540,  540,  540,  540,
-      540,  540,  540,  540,  540,  540,  549,  549,  498,  495,
-      494,  493,  492,  487,  486,  485,  484,  483,  473,  470,
-      467,  465,  549,  549,  549,  549,  464,  463,  462,  461,
-      460,  549,  549,  549,  459,  458,  457,  456,  455,  454,
-
-      453,  452,  450,  449,  448,  549,  549,  549,  549,  549,
-      549,  553,  553,  553,  553,  553,  553,  553,  553,  553,
-      553,  553,  553,  553,  553,  553,  440,  553,  553,  439,
-      438,  437,  436,  553,  553,  553,  553,  435,  434,  433,
-      432,  431,  430,  428,  427,  425,  424,  423,  422,  421,
-      553,  420,  419,  418,  417,  399,  398,  394,  306,  305,
-      296,  295,  294,  283,  282,  278,  268,  265,  264,  260,
-      255,  254,  252,  251,  553,  553,  554,  554,  554,  554,
-      554,  554,  554,  554,  554,  554,  554,  554,  554,  554,
-      554,  554,  554,  554,  554,  554,  554,  554,  554,  554,
-
-      554,  554,  554,  554,  554,  554,  554,  554,  554,  554,
-      554,  554,  554,  554,  554,  554,  554,  554,  554,  554,
-      554,  554,  554,  554,  554,  554,  554,  554,  554,  554,
-      554,  554,  554,  554,  554,  554,  554,  554,  554,  554,
-      554,  563,  563,  250,  248,  247,  245,  231,  229,  228,
-      221,  220,  218,  212,  211,  203,  202,  563,  563,  563,
-      563,  201,  199,  194,  192,  191,  563,  563,  563,  189,
-      188,  187,  177,  159,  154,  152,  110,  101,   96,   93,
-      563,  563,  563,  563,  563,  563,  567,  567,  567,  567,
-      567,  567,  567,  567,  567,  567,  567,  567,  567,  567,
-
-      567,   88,  567,  567,   86,   83,   77,   72,  567,  567,
-      567,  567,   65,   63,   34,   32,   28,   23,    8,    4,
-        2,    0,    0,    0,    0,  567,    0,    0,    0,    0,
+      871,  408,  408,  725,  725,  732,  732,  408,  408,  408,
+      408,  811,  837,  837,  732,  870,  733,  733,  811,  725,
+      725,  725,  725,  950,  408,  733,  743,  743,  743,  743,
+      841,  841,  887,  885,  887,  887, 1026, 1026,  886,  938,
+      885,  938,  938, 1027, 1027,  886,  811,  885,  408,  408,
+      409,  409,  886,  409,  409,  409,  409,  409,  409,  409,
+      409,  409,  409,  409,  409,  409,  409,  409,  409,  409,
+      409,  409,  409,  409,  409,  409,  409,  409,  409,  409,
+      409,  409,  409,  409,  409,  409,  409,  409,  409,  409,
+      409,  409,  409,  409,  409,  409,  409,  409,  409,  409,
+
+      409,  409,  409,  409,  409,  409,  409,  409,  409,  409,
+      409,  409,  409,  409,  409,  410,  410,  869,  410,  410,
+      410,  410,  410,  410,  410,  410,  410,  410,  410,  410,
+      951,  410,  410,  868,  812,  889,  867,  410,  410,  410,
+      410,  812,  889,  952,  992,  992,  992,  728,  728,  729,
+      729,  728,  953,  729,  410,  734,  734,  735,  735,  734,
+      801,  735,  803,  883,  865,  889,  954,  801,  864,  803,
+      883,  812,  863,  410,  801,  951,  803,  883,  410,  410,
+      507,  507,  507,  507,  728,  862,  729,  861,  952,  507,
+      507,  507,  734,  860,  735, 1028, 1028,  953,  858,  857,
+
+      883,  803,  801,  507,  507,  507,  507,  507,  507,  511,
+      511,  954,  511,  511,  511,  511,  511,  511,  511,  511,
+      511,  511,  511,  511,  856,  511,  511,  939,  884,  855,
+      853,  511,  511,  511,  511,  884,  936,  852,  939,  937,
+      936,  940,  884,  937,  851,  939,  850,  936,  511,  849,
+      937,  848,  940,  847,  936,  846,  844,  937,  843,  940,
+      991,  991,  991,  818,  991,  884,  993,  993,  993,  809,
+      993,  806,  511,  511,  512,  512,  800,  512,  512,  512,
+      512,  512,  512,  512,  512,  512,  512,  512,  512,  512,
+      512,  512,  512,  512,  512,  512,  512,  512,  512,  512,
+
+      512,  512,  512,  512,  512,  512,  512,  512,  512,  512,
+      512,  512,  512,  512,  512,  512,  512,  512,  512,  512,
+      512,  512,  512,  512,  512,  512,  512,  512,  512,  512,
+      512,  512,  512,  512,  512,  512,  512,  512,  512,  525,
+      525,  525,  525,  799,  802,  804,  798,  797,  525,  525,
+      525,  802,  804,  994,  994,  994,  796,  795,  802,  804,
+      794,  793,  525,  525,  525,  525,  525,  525,  527,  527,
+      527,  527,  527,  527,  792,  527,  527,  527,  527,  527,
+      527,  527,  527,  791,  527,  527,  790,  789,  802,  786,
+      527,  527,  527,  527,  804,  995,  995,  995,  785,  995,
+
+      996,  996,  996,  783,  781,  779,  778,  527,  776,  775,
+      774,  773,  772,  771,  770,  769,  768,  766,  765,  764,
+      763,  760,  758,  757,  756,  754,  749,  745,  744,  741,
+      723,  527,  527,  528,  528,  528,  528,  528,  528,  705,
+      528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
+      528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
+      528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
+      528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
+      528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
+      528,  528,  528,  528,  528,  528,  528,  528,  537,  537,
+
+      687,  685,  681,  680,  675,  674,  672,  670,  665,  661,
+      660,  655,  654,  653,  537,  537,  537,  537,  652,  643,
+      642,  637,  633,  537,  537,  537,  632,  631,  630,  629,
+      628,  626,  625,  624,  623,  622,  621,  537,  537,  537,
+      537,  537,  537,  541,  541,  541,  541,  541,  541,  541,
+      541,  541,  541,  541,  541,  541,  541,  541,  619,  541,
+      541,  618,  617,  616,  615,  541,  541,  541,  541,  614,
+      613,  612,  611,  609,  608,  607,  606,  605,  604,  603,
+      602,  601,  541,  600,  599,  597,  596,  595,  594,  593,
+      592,  591,  590,  589,  588,  581,  573,  572,  519,  518,
+
+      515,  514,  513,  509,  501,  500,  541,  541,  542,  542,
+      542,  542,  542,  542,  542,  542,  542,  542,  542,  542,
+      542,  542,  542,  542,  542,  542,  542,  542,  542,  542,
+      542,  542,  542,  542,  542,  542,  542,  542,  542,  542,
+      542,  542,  542,  542,  542,  542,  542,  542,  542,  542,
+      542,  542,  542,  542,  542,  542,  542,  542,  542,  542,
+      542,  542,  542,  542,  542,  542,  542,  542,  542,  542,
+      542,  542,  542,  551,  551,  497,  496,  495,  494,  489,
+      488,  487,  486,  485,  475,  472,  469,  467,  466,  551,
+      551,  551,  551,  465,  464,  463,  462,  461,  551,  551,
+
+      551,  460,  459,  458,  457,  456,  455,  454,  452,  451,
+      450,  449,  551,  551,  551,  551,  551,  551,  555,  555,
+      555,  555,  555,  555,  555,  555,  555,  555,  555,  555,
+      555,  555,  555,  441,  555,  555,  440,  439,  438,  437,
+      555,  555,  555,  555,  436,  435,  434,  433,  432,  431,
+      429,  428,  426,  425,  424,  423,  422,  555,  421,  420,
+      419,  418,  400,  399,  395,  307,  306,  297,  296,  295,
+      284,  283,  279,  269,  266,  265,  261,  256,  255,  253,
+      252,  555,  555,  556,  556,  556,  556,  556,  556,  556,
+      556,  556,  556,  556,  556,  556,  556,  556,  556,  556,
+
+      556,  556,  556,  556,  556,  556,  556,  556,  556,  556,
+      556,  556,  556,  556,  556,  556,  556,  556,  556,  556,
+      556,  556,  556,  556,  556,  556,  556,  556,  556,  556,
+      556,  556,  556,  556,  556,  556,  556,  556,  556,  556,
+      556,  556,  556,  556,  556,  556,  556,  556,  565,  565,
+      251,  249,  248,  246,  232,  230,  229,  222,  221,  219,
+      213,  212,  211,  203,  565,  565,  565,  565,  202,  201,
+      199,  194,  192,  565,  565,  565,  191,  189,  188,  187,
+      177,  159,  154,  152,  110,  101,   96,  565,  565,  565,
+      565,  565,  565,  569,  569,  569,  569,  569,  569,  569,
+
+      569,  569,  569,  569,  569,  569,  569,  569,   93,  569,
+      569,   88,   86,   83,   77,  569,  569,  569,  569,   72,
+       65,   63,   34,   32,   28,   23,    8,    4,    2,    0,
+        0,    0,  569,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,  567,
-      567,  568,  568,  568,  568,  568,  568,  568,  568,  568,
-      568,  568,  568,  568,  568,  568,  568,  568,  568,  568,
-      568,  568,  568,  568,  568,  568,  568,  568,  568,  568,
-      568,  568,  568,  568,  568,  568,  568,  568,  568,  568,
-      568,  568,  568,  568,  568,  568,  568,  568,  568,  568,
-
-      568,  568,  568,  568,  568,  568,  568,  568,  568,  568,
-      568,  568,  568,  568,  568,  568,  577,  577,  577,  577,
-        0,    0,    0,    0,    0,  577,  577,  577,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,  577,
-      577,  577,  577,  577,  577,  581,  581,    0,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-        0,  581,  581,    0,    0,    0,    0,  581,  581,  581,
-      581,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,  581,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,  569,  569,  570,  570,
+      570,  570,  570,  570,  570,  570,  570,  570,  570,  570,
+      570,  570,  570,  570,  570,  570,  570,  570,  570,  570,
+      570,  570,  570,  570,  570,  570,  570,  570,  570,  570,
+      570,  570,  570,  570,  570,  570,  570,  570,  570,  570,
+
+      570,  570,  570,  570,  570,  570,  570,  570,  570,  570,
+      570,  570,  570,  570,  570,  570,  570,  570,  570,  570,
+      570,  570,  570,  579,  579,  579,  579,    0,    0,    0,
+        0,    0,  579,  579,  579,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,  579,  579,  579,  579,
+      579,  579,  583,  583,    0,  583,  583,  583,  583,  583,
+      583,  583,  583,  583,  583,  583,  583,    0,  583,  583,
+        0,    0,    0,    0,  583,  583,  583,  583,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,  583,    0,    0,    0,    0,    0,    0,    0,    0,
 
-        0,    0,    0,    0,    0,    0,    0,    0,  581,  581,
-      582,  582,    0,  582,  582,  582,  582,  582,  582,  582,
-      582,  582,  582,  582,  582,  582,  582,  582,  582,  582,
-      582,  582,  582,  582,  582,  582,  582,  582,  582,  582,
-      582,  582,  582,  582,  582,  582,  582,  582,  582,  582,
-      582,  582,  582,  582,  582,  582,  582,  582,  582,  582,
-      582,  582,  582,  582,  582,  582,  582,  582,  582,  582,
-      582,  582,  582,  582,  582,  666,  666,    0,  666,  666,
-      666,  666,  666,  666,  666,  666,  666,  666,  666,  666,
-        0,  666,  666,    0,    0,    0,    0,  666,  666,  666,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,  583,  583,  584,  584,    0,
+      584,  584,  584,  584,  584,  584,  584,  584,  584,  584,
+      584,  584,  584,  584,  584,  584,  584,  584,  584,  584,
+      584,  584,  584,  584,  584,  584,  584,  584,  584,  584,
+      584,  584,  584,  584,  584,  584,  584,  584,  584,  584,
+      584,  584,  584,  584,  584,  584,  584,  584,  584,  584,
+      584,  584,  584,  584,  584,  584,  584,  584,  584,  584,
+      584,  584,  669,  669,    0,  669,  669,  669,  669,  669,
+      669,  669,  669,  669,  669,  669,  669,    0,  669,  669,
 
-      666,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,  666,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,  669,  669,  669,  669,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,  669,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,  666,  666,
-      668,  668,    0,  668,  668,  668,  668,  668,  668,  668,
-      668,  668,  668,  668,  668,  668,  668,  668,  668,  668,
-      668,  668,  668,  668,  668,  668,  668,  668,  668,  668,
-      668,  668,  668,  668,  668,  668,  668,  668,  668,  668,
-      668,  668,  668,  668,  668,  668,  668,  668,  668,  668,
-      668,  668,  668,  668,  668,  668,  668,  668,  668,  668,
-
-      668,  668,  668,  668,  668,  681,  681,  681,  681,  681,
-      681,    0,  681,  681,  681,  681,  681,  681,  681,  681,
-        0,  681,  681,    0,    0,    0,    0,  681,  681,  681,
-      681,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,  681,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,  669,  669,  671,  671,    0,
+      671,  671,  671,  671,  671,  671,  671,  671,  671,  671,
+      671,  671,  671,  671,  671,  671,  671,  671,  671,  671,
+      671,  671,  671,  671,  671,  671,  671,  671,  671,  671,
+      671,  671,  671,  671,  671,  671,  671,  671,  671,  671,
+      671,  671,  671,  671,  671,  671,  671,  671,  671,  671,
+
+      671,  671,  671,  671,  671,  671,  671,  671,  671,  671,
+      671,  671,  684,  684,  684,  684,  684,  684,    0,  684,
+      684,  684,  684,  684,  684,  684,  684,    0,  684,  684,
+        0,    0,    0,    0,  684,  684,  684,  684,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,  681,  681,
-      683,  683,  683,  683,  683,  683,    0,  683,  683,  683,
-      683,  683,  683,  683,  683,  683,  683,  683,  683,  683,
-      683,  683,  683,  683,  683,  683,  683,  683,  683,  683,
-
-      683,  683,  683,  683,  683,  683,  683,  683,  683,  683,
-      683,  683,  683,  683,  683,  683,  683,  683,  683,  683,
-      683,  683,  683,  683,  683,  683,  683,  683,  683,  683,
-      683,  683,  683,  683,  683,  699,  699,  699,  699,  699,
-      699,  699,  699,  699,  699,  699,  699,  699,  699,  699,
-        0,  699,  699,    0,    0,    0,    0,  699,  699,  699,
-      699,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,  699,    0,    0,    0,    0,    0,
+        0,  684,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,  684,  684,  686,  686,  686,
+      686,  686,  686,    0,  686,  686,  686,  686,  686,  686,
+      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
+
+      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
+      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
+      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
+      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
+      686,  686,  702,  702,  702,  702,  702,  702,  702,  702,
+      702,  702,  702,  702,  702,  702,  702,    0,  702,  702,
+        0,    0,    0,    0,  702,  702,  702,  702,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,  702,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,  699,  699,
 
-      701,  701,  701,  701,  701,  701,  701,  701,  701,  701,
-      701,  701,  701,  701,  701,  701,  701,  701,  701,  701,
-      701,  701,  701,  701,  701,  701,  701,  701,  701,  701,
-      701,  701,  701,  701,  701,  701,  701,  701,  701,  701,
-      701,  701,  701,  701,  701,  701,  701,  701,  701,  701,
-      701,  701,  701,  701,  701,  701,  701,  701,  701,  701,
-      701,  701,  701,  701,  701,  717,  717,  717,  717,  717,
-      717,  717,  717,  717,  717,  717,  717,  717,  717,  717,
-        0,  717,  717,    0,    0,    0,    0,  717,  717,  717,
-      717,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,  702,  702,  704,  704,  704,
+      704,  704,  704,  704,  704,  704,  704,  704,  704,  704,
+      704,  704,  704,  704,  704,  704,  704,  704,  704,  704,
+      704,  704,  704,  704,  704,  704,  704,  704,  704,  704,
+      704,  704,  704,  704,  704,  704,  704,  704,  704,  704,
+      704,  704,  704,  704,  704,  704,  704,  704,  704,  704,
+      704,  704,  704,  704,  704,  704,  704,  704,  704,  704,
+      704,  704,  720,  720,  720,  720,  720,  720,  720,  720,
+      720,  720,  720,  720,  720,  720,  720,    0,  720,  720,
+        0,    0,    0,    0,  720,  720,  720,  720,    0,    0,
 
-        0,    0,    0,    0,  717,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,  717,  717,
-      719,  719,  719,  719,  719,  719,  719,  719,  719,  719,
-      719,  719,  719,  719,  719,  719,  719,  719,  719,  719,
-      719,  719,  719,  719,  719,  719,  719,  719,  719,  719,
-      719,  719,  719,  719,  719,  719,  719,  719,  719,  719,
-      719,  719,  719,  719,  719,  719,  719,  719,  719,  719,
-      719,  719,  719,  719,  719,  719,  719,  719,  719,  719,
-      719,  719,  719,  719,  719,  735,  735,  735,  735,  735,
-
-      735,  735,  735,  735,  735,  735,  735,  735,  735,  735,
-        0,  735,  735,    0,    0,    0,    0,  735,  735,  735,
-      735,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,  735,    0,    0,    0,    0,    0,
+        0,  720,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,  720,  720,  722,  722,  722,
+      722,  722,  722,  722,  722,  722,  722,  722,  722,  722,
+      722,  722,  722,  722,  722,  722,  722,  722,  722,  722,
+      722,  722,  722,  722,  722,  722,  722,  722,  722,  722,
+      722,  722,  722,  722,  722,  722,  722,  722,  722,  722,
+      722,  722,  722,  722,  722,  722,  722,  722,  722,  722,
+      722,  722,  722,  722,  722,  722,  722,  722,  722,  722,
+
+      722,  722,  738,  738,  738,  738,  738,  738,  738,  738,
+      738,  738,  738,  738,  738,  738,  738,    0,  738,  738,
+        0,    0,    0,    0,  738,  738,  738,  738,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,  738,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,  735,  735,
-      737,  737,  737,  737,  737,  737,  737,  737,  737,  737,
-      737,  737,  737,  737,  737,  737,  737,  737,  737,  737,
-      737,  737,  737,  737,  737,  737,  737,  737,  737,  737,
-      737,  737,  737,  737,  737,  737,  737,  737,  737,  737,
-
-      737,  737,  737,  737,  737,  737,  737,  737,  737,  737,
-      737,  737,  737,  737,  737,  737,  737,  737,  737,  737,
-      737,  737,  737,  737,  737,  750,  750,    0,  750,  750,
-      750,  750,  750,  750,  750,  750,  750,  750,  750,  750,
-        0,  750,  750,    0,    0,    0,    0,  750,  750,  750,
-      750,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,  750,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,  738,  738,  740,  740,  740,
+      740,  740,  740,  740,  740,  740,  740,  740,  740,  740,
+      740,  740,  740,  740,  740,  740,  740,  740,  740,  740,
+      740,  740,  740,  740,  740,  740,  740,  740,  740,  740,
+
+      740,  740,  740,  740,  740,  740,  740,  740,  740,  740,
+      740,  740,  740,  740,  740,  740,  740,  740,  740,  740,
+      740,  740,  740,  740,  740,  740,  740,  740,  740,  740,
+      740,  740,  753,  753,    0,  753,  753,  753,  753,  753,
+      753,  753,  753,  753,  753,  753,  753,    0,  753,  753,
+        0,    0,    0,    0,  753,  753,  753,  753,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,  750,  750,
-      752,  752,    0,  752,  752,  752,  752,  752,  752,  752,
+        0,  753,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,  753,  753,  755,  755,    0,
 
-      752,  752,  752,  752,  752,  752,  752,  752,  752,  752,
-      752,  752,  752,  752,  752,  752,  752,  752,  752,  752,
-      752,  752,  752,  752,  752,  752,  752,  752,  752,  752,
-      752,  752,  752,  752,  752,  752,  752,  752,  752,  752,
-      752,  752,  752,  752,  752,  752,  752,  752,  752,  752,
-      752,  752,  752,  752,  752,  811,  811,    0,  811,  811,
-      811,  811,  811,  811,  811,  811,  811,  811,  811,  811,
-      811,  811,  811,  811,  811,  811,  811,  811,  811,  811,
-      811,  811,  811,  811,  811,  811,  811,  811,  811,  811,
-      811,  811,  811,  811,  811,  811,  811,  811,  811,  811,
-
-      811,  811,  811,  811,  811,  811,  811,  811,  811,  811,
-      811,  811,  811,  811,  811,  811,  811,  811,  811,  811,
-      821,  821,  821,  821,  821,  821,    0,  821,  821,  821,
-      821,  821,  821,  821,  821,  821,  821,  821,  821,  821,
-      821,  821,  821,  821,  821,  821,  821,  821,  821,  821,
-      821,  821,  821,  821,  821,  821,  821,  821,  821,  821,
-      821,  821,  821,  821,  821,  821,  821,  821,  821,  821,
-      821,  821,  821,  821,  821,  821,  821,  821,  821,  821,
-      821,  821,  821,  821,  821, 1054,    0, 1054, 1054, 1054,
-     1054, 1054, 1054, 1054, 1054, 1054, 1055,    0,    0, 1055,
-
-     1055, 1056,    0, 1056, 1056, 1056, 1056, 1056, 1056, 1056,
-     1056, 1056, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057,
-     1058, 1058, 1058, 1058, 1059,    0, 1059,    0, 1059, 1059,
-     1059, 1059, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1061,
-        0, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
-     1062,    0, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062,
-     1062, 1063,    0, 1063, 1063, 1063, 1063, 1063, 1063, 1063,
-     1063, 1063, 1064,    0, 1064, 1064, 1064, 1064, 1064, 1064,
-     1064, 1064, 1064, 1065, 1065, 1065, 1065, 1065, 1065, 1065,
-     1066, 1066,    0, 1066, 1066, 1066, 1066, 1066, 1066, 1066,
-
-     1066, 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067,
-     1067, 1067, 1068, 1068,    0, 1068, 1068, 1068, 1068, 1068,
-     1068, 1068, 1068, 1069, 1069, 1069, 1069, 1069, 1069, 1069,
-     1069, 1069, 1069, 1069, 1070, 1070, 1070, 1070, 1070, 1070,
-     1070, 1070, 1070, 1070, 1070, 1071, 1071, 1071, 1071, 1071,
-     1071, 1071, 1071, 1071, 1071, 1071, 1072, 1072, 1072, 1072,
-     1072, 1072, 1072, 1072, 1072, 1072, 1072, 1073, 1073, 1073,
-     1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1074, 1074,
-     1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1075,
-     1075, 1075, 1075, 1075, 1075, 1075, 1075, 1075, 1075, 1075,
-
-     1076, 1076, 1076, 1076, 1076, 1076, 1076, 1076, 1076, 1076,
-     1076, 1077, 1077, 1077, 1077, 1077, 1077, 1077, 1077, 1077,
-     1077, 1077, 1078, 1078, 1078, 1078, 1078, 1078, 1078, 1078,
-     1078, 1078, 1078, 1079, 1079, 1079, 1079, 1079, 1079, 1079,
-     1079, 1079, 1079, 1079, 1080, 1080, 1080, 1080, 1080, 1080,
-     1080, 1080, 1080, 1080, 1080, 1081,    0, 1081, 1081, 1081,
-     1081, 1081, 1081, 1081, 1081, 1081, 1082,    0, 1082, 1082,
-     1082, 1082, 1082, 1082, 1082, 1082, 1082, 1083,    0, 1083,
-     1083, 1083, 1083, 1083, 1083, 1083, 1083, 1083, 1084,    0,
-     1084, 1084, 1084, 1084, 1084, 1084, 1084, 1084, 1084, 1085,
-
-        0,    0, 1085, 1085, 1086,    0, 1086, 1086, 1086, 1086,
-     1086, 1086, 1086, 1086, 1086, 1087,    0,    0, 1087, 1087,
-     1087, 1088,    0,    0, 1088, 1089, 1089, 1089, 1089, 1089,
-     1089, 1089, 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1090,
-     1091,    0,    0,    0,    0, 1091, 1091, 1091, 1091, 1092,
-     1092, 1092, 1092, 1092, 1092, 1093, 1093, 1093, 1093, 1094,
-        0, 1094, 1094, 1094, 1094, 1095, 1095, 1095, 1095, 1095,
-     1095, 1095, 1096,    0, 1096, 1096, 1096, 1096, 1096, 1096,
-     1096, 1096, 1096, 1097,    0, 1097, 1097, 1097, 1097, 1097,
-     1097, 1097, 1097, 1097, 1098,    0, 1098, 1098, 1098, 1098,
-
-     1098, 1098, 1098, 1098, 1098, 1099,    0, 1099, 1099, 1099,
-     1099, 1099, 1099, 1099, 1099, 1099, 1100, 1100,    0, 1100,
-     1100, 1100, 1100, 1100, 1100, 1100, 1100, 1101, 1101, 1101,
-     1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1102, 1102,
-        0, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1103,
-     1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103, 1103,
-     1104, 1104, 1104, 1104, 1104, 1104, 1104, 1104, 1104, 1104,
-     1104, 1105, 1105, 1105, 1105, 1105, 1105, 1105, 1105, 1105,
-     1105, 1105, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106,
-     1106, 1106, 1106, 1107, 1107, 1107, 1107, 1107, 1107, 1107,
-
-     1107, 1107, 1107, 1107, 1108, 1108, 1108, 1108, 1108, 1108,
-     1108, 1108, 1108, 1108, 1108, 1109, 1109, 1109, 1109, 1109,
-     1109, 1109, 1109, 1109, 1109, 1109, 1110, 1110, 1110, 1110,
-     1110, 1110, 1110, 1110, 1110, 1110, 1110, 1111, 1111, 1111,
-     1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1112, 1112,
-     1112, 1112, 1112, 1112, 1112, 1112, 1112, 1112, 1112, 1113,
-     1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113,
+      755,  755,  755,  755,  755,  755,  755,  755,  755,  755,
+      755,  755,  755,  755,  755,  755,  755,  755,  755,  755,
+      755,  755,  755,  755,  755,  755,  755,  755,  755,  755,
+      755,  755,  755,  755,  755,  755,  755,  755,  755,  755,
+      755,  755,  755,  755,  755,  755,  755,  755,  755,  755,
+      755,  755,  755,  755,  755,  755,  755,  755,  755,  755,
+      755,  755,  815,  815,    0,  815,  815,  815,  815,  815,
+      815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
+      815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
+      815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
+
+      815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
+      815,  815,  815,  815,  815,  815,  815,  815,  815,  815,
+      815,  815,  815,  815,  815,  815,  815,  825,  825,  825,
+      825,  825,  825,    0,  825,  825,  825,  825,  825,  825,
+      825,  825,  825,  825,  825,  825,  825,  825,  825,  825,
+      825,  825,  825,  825,  825,  825,  825,  825,  825,  825,
+      825,  825,  825,  825,  825,  825,  825,  825,  825,  825,
+      825,  825,  825,  825,  825,  825,  825,  825,  825,  825,
+      825,  825,  825,  825,  825,  825,  825,  825,  825,  825,
+      825,  825, 1062,    0, 1062, 1062, 1062, 1062, 1062, 1062,
+
+     1062, 1062, 1062, 1063,    0,    0, 1063, 1063, 1064,    0,
+     1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1065,
+     1065, 1065, 1065, 1065, 1065, 1065, 1065, 1066, 1066, 1066,
+     1066, 1067,    0, 1067,    0, 1067, 1067, 1067, 1067, 1068,
+     1068, 1068, 1068, 1068, 1068, 1068, 1069,    0, 1069, 1069,
+     1069, 1069, 1069, 1069, 1069, 1069, 1069, 1070,    0, 1070,
+     1070, 1070, 1070, 1070, 1070, 1070, 1070, 1070, 1071,    0,
+     1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071, 1072,
+        0, 1072, 1072, 1072, 1072, 1072, 1072, 1072, 1072, 1072,
+     1073, 1073, 1073, 1073, 1073, 1073, 1073, 1074, 1074,    0,
+
+     1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1075, 1075,
+     1075, 1075, 1075, 1075, 1075, 1075, 1075, 1075, 1075, 1076,
+     1076,    0, 1076, 1076, 1076, 1076, 1076, 1076, 1076, 1076,
+     1077, 1077, 1077, 1077, 1077, 1077, 1077, 1077, 1077, 1077,
+     1077, 1078, 1078, 1078, 1078, 1078, 1078, 1078, 1078, 1078,
+     1078, 1078, 1079, 1079, 1079, 1079, 1079, 1079, 1079, 1079,
+     1079, 1079, 1079, 1080, 1080, 1080, 1080, 1080, 1080, 1080,
+     1080, 1080, 1080, 1080, 1081, 1081, 1081, 1081, 1081, 1081,
+     1081, 1081, 1081, 1081, 1081, 1082, 1082, 1082, 1082, 1082,
+     1082, 1082, 1082, 1082, 1082, 1082, 1083, 1083, 1083, 1083,
+
+     1083, 1083, 1083, 1083, 1083, 1083, 1083, 1084, 1084, 1084,
+     1084, 1084, 1084, 1084, 1084, 1084, 1084, 1084, 1085, 1085,
+     1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1085, 1086,
+     1086, 1086, 1086, 1086, 1086, 1086, 1086, 1086, 1086, 1086,
+     1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087,
+     1087, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088,
+     1088, 1088, 1089,    0, 1089, 1089, 1089, 1089, 1089, 1089,
+     1089, 1089, 1089, 1090,    0, 1090, 1090, 1090, 1090, 1090,
+     1090, 1090, 1090, 1090, 1091,    0, 1091, 1091, 1091, 1091,
+     1091, 1091, 1091, 1091, 1091, 1092,    0, 1092, 1092, 1092,
+
+     1092, 1092, 1092, 1092, 1092, 1092, 1093,    0,    0, 1093,
+     1093, 1094,    0, 1094, 1094, 1094, 1094, 1094, 1094, 1094,
+     1094, 1094, 1095,    0,    0, 1095, 1095, 1095, 1096,    0,
+        0, 1096, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1098,
+     1098, 1098, 1098, 1098, 1098, 1098, 1098, 1099,    0,    0,
+        0,    0, 1099, 1099, 1099, 1099, 1100, 1100, 1100, 1100,
+     1100, 1100, 1101, 1101, 1101, 1101, 1102,    0, 1102, 1102,
+     1102, 1102, 1103, 1103, 1103, 1103, 1103, 1103, 1103, 1104,
+        0, 1104, 1104, 1104, 1104, 1104, 1104, 1104, 1104, 1104,
+     1105,    0, 1105, 1105, 1105, 1105, 1105, 1105, 1105, 1105,
+
+     1105, 1106,    0, 1106, 1106, 1106, 1106, 1106, 1106, 1106,
+     1106, 1106, 1107,    0, 1107, 1107, 1107, 1107, 1107, 1107,
+     1107, 1107, 1107, 1108, 1108,    0, 1108, 1108, 1108, 1108,
+     1108, 1108, 1108, 1108, 1109, 1109, 1109, 1109, 1109, 1109,
+     1109, 1109, 1109, 1109, 1109, 1110, 1110,    0, 1110, 1110,
+     1110, 1110, 1110, 1110, 1110, 1110, 1111, 1111, 1111, 1111,
+     1111, 1111, 1111, 1111, 1111, 1111, 1111, 1112, 1112, 1112,
+     1112, 1112, 1112, 1112, 1112, 1112, 1112, 1112, 1113, 1113,
+     1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1114,
      1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114,
-     1114, 1115,    0, 1115, 1115, 1115, 1115, 1115, 1115, 1115,
-     1115, 1115, 1116,    0, 1116, 1116, 1116, 1116, 1116, 1116,
 
-     1116, 1116, 1116, 1117,    0, 1117, 1117, 1117, 1117, 1117,
-     1117, 1117, 1117, 1117, 1118,    0, 1118, 1118, 1118, 1118,
-     1118, 1118, 1118, 1118, 1118, 1119,    0,    0, 1119, 1119,
-     1120,    0,    0, 1120, 1120, 1120, 1121,    0,    0, 1121,
-     1122,    0, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122,
-     1122, 1123,    0, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
-     1123, 1123, 1124,    0, 1124, 1124, 1124, 1124, 1124, 1124,
-     1124, 1124, 1124, 1125, 1125, 1125, 1125, 1125, 1125, 1125,
-     1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1127, 1127,
-     1127, 1127, 1127, 1127, 1128,    0, 1128, 1128, 1128, 1128,
-
-     1129,    0, 1129, 1129, 1129, 1129, 1130, 1130, 1130, 1130,
-     1130, 1130, 1130, 1131,    0, 1131, 1131, 1131, 1131, 1131,
-     1131, 1131, 1131, 1131, 1132,    0, 1132, 1132, 1132, 1132,
-     1132, 1132, 1132, 1132, 1132, 1133,    0, 1133, 1133, 1133,
-     1133, 1133, 1133, 1133, 1133, 1133, 1134,    0, 1134, 1134,
-     1134, 1134, 1134, 1134, 1134, 1134, 1134, 1135,    0, 1135,
-     1135, 1135, 1135, 1135, 1135, 1135, 1135, 1135, 1136, 1136,
-     1136, 1136, 1136, 1136, 1136, 1137, 1137,    0, 1137, 1137,
-     1137, 1137, 1137, 1137, 1137, 1137, 1138, 1138, 1138, 1138,
-     1138, 1138, 1138, 1138, 1138, 1138, 1138, 1139, 1139,    0,
-
-     1139, 1139, 1139, 1139, 1139, 1139, 1139, 1139, 1140, 1140,
-     1140, 1140, 1140, 1140, 1140, 1140, 1140, 1140, 1140, 1141,
-     1141, 1141, 1141, 1141, 1141, 1141, 1141, 1141, 1141, 1141,
-     1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142,
-     1142, 1143, 1143, 1143, 1143, 1143, 1143, 1143, 1143, 1143,
-     1143, 1143, 1144, 1144, 1144, 1144, 1144, 1144, 1144, 1144,
-     1144, 1144, 1144, 1145, 1145, 1145, 1145, 1145, 1145, 1145,
-     1145, 1145, 1145, 1145, 1146, 1146, 1146, 1146, 1146, 1146,
-     1146, 1146, 1146, 1146, 1146, 1147, 1147, 1147, 1147, 1147,
-     1147, 1147, 1147, 1147, 1147, 1147, 1148, 1148, 1148, 1148,
-
-     1148, 1148, 1148, 1148, 1148, 1148, 1148, 1149, 1149, 1149,
-     1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1150, 1150,
-     1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1151,
-     1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151,
+     1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115,
+     1115, 1116, 1116, 1116, 1116, 1116, 1116, 1116, 1116, 1116,
+     1116, 1116, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117,
+     1117, 1117, 1117, 1118, 1118, 1118, 1118, 1118, 1118, 1118,
+     1118, 1118, 1118, 1118, 1119, 1119, 1119, 1119, 1119, 1119,
+     1119, 1119, 1119, 1119, 1119, 1120, 1120, 1120, 1120, 1120,
+     1120, 1120, 1120, 1120, 1120, 1120, 1121, 1121, 1121, 1121,
+     1121, 1121, 1121, 1121, 1121, 1121, 1121, 1122, 1122, 1122,
+     1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1123,    0,
+     1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1124,
+
+        0, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124,
+     1125,    0, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125,
+     1125, 1126,    0, 1126, 1126, 1126, 1126, 1126, 1126, 1126,
+     1126, 1126, 1127,    0,    0, 1127, 1127, 1128,    0,    0,
+     1128, 1128, 1128, 1129,    0,    0, 1129, 1130,    0, 1130,
+     1130, 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1131,    0,
+     1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1132,
+        0, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132,
+     1133, 1133, 1133, 1133, 1133, 1133, 1133, 1134, 1134, 1134,
+     1134, 1134, 1134, 1134, 1134, 1135, 1135, 1135, 1135, 1135,
+
+     1135, 1136,    0, 1136, 1136, 1136, 1136, 1137,    0, 1137,
+     1137, 1137, 1137, 1138, 1138, 1138, 1138, 1138, 1138, 1138,
+     1139,    0, 1139, 1139, 1139, 1139, 1139, 1139, 1139, 1139,
+     1139, 1140,    0, 1140, 1140, 1140, 1140, 1140, 1140, 1140,
+     1140, 1140, 1141,    0, 1141, 1141, 1141, 1141, 1141, 1141,
+     1141, 1141, 1141, 1142,    0, 1142, 1142, 1142, 1142, 1142,
+     1142, 1142, 1142, 1142, 1143,    0, 1143, 1143, 1143, 1143,
+     1143, 1143, 1143, 1143, 1143, 1144, 1144, 1144, 1144, 1144,
+     1144, 1144, 1145, 1145,    0, 1145, 1145, 1145, 1145, 1145,
+     1145, 1145, 1145, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+
+     1146, 1146, 1146, 1146, 1147, 1147,    0, 1147, 1147, 1147,
+     1147, 1147, 1147, 1147, 1147, 1148, 1148, 1148, 1148, 1148,
+     1148, 1148, 1148, 1148, 1148, 1148, 1149, 1149, 1149, 1149,
+     1149, 1149, 1149, 1149, 1149, 1149, 1149, 1150, 1150, 1150,
+     1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1151, 1151,
+     1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1152,
      1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152,
-     1152, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153,
-     1153, 1153, 1154, 1154, 1154, 1154, 1154, 1154, 1154, 1154,
-     1154, 1154, 1154, 1155,    0, 1155, 1155, 1155, 1155, 1155,
-     1155, 1155, 1155, 1155, 1156,    0, 1156, 1156, 1156, 1156,
-     1156, 1156, 1156, 1156, 1156, 1157,    0, 1157, 1157, 1157,
-
-     1157, 1157, 1157, 1157, 1157, 1157, 1158,    0, 1158, 1158,
-     1158, 1158, 1158, 1158, 1158, 1158, 1158, 1159,    0, 1159,
-     1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1160,    0,
-        0, 1160, 1160, 1160, 1161,    0, 1161, 1161, 1161, 1161,
-     1161, 1161, 1161, 1161, 1161, 1162,    0, 1162, 1162, 1162,
-     1162, 1162, 1162, 1162, 1162, 1162, 1163,    0, 1163, 1163,
-     1163, 1163, 1163, 1163, 1163, 1163, 1163, 1164, 1164, 1164,
-     1164, 1164, 1164, 1164, 1165, 1165, 1165, 1165, 1165, 1165,
-     1165, 1165, 1166,    0, 1166, 1166, 1166, 1166, 1167,    0,
-     1167, 1167, 1167, 1167, 1168, 1168, 1168, 1168, 1168, 1168,
-
+     1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153,
+     1153, 1154, 1154, 1154, 1154, 1154, 1154, 1154, 1154, 1154,
+     1154, 1154, 1155, 1155, 1155, 1155, 1155, 1155, 1155, 1155,
+
+     1155, 1155, 1155, 1156, 1156, 1156, 1156, 1156, 1156, 1156,
+     1156, 1156, 1156, 1156, 1157, 1157, 1157, 1157, 1157, 1157,
+     1157, 1157, 1157, 1157, 1157, 1158, 1158, 1158, 1158, 1158,
+     1158, 1158, 1158, 1158, 1158, 1158, 1159, 1159, 1159, 1159,
+     1159, 1159, 1159, 1159, 1159, 1159, 1159, 1160, 1160, 1160,
+     1160, 1160, 1160, 1160, 1160, 1160, 1160, 1160, 1161, 1161,
+     1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1162,
+     1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162,
+     1163,    0, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163,
+     1163, 1164,    0, 1164, 1164, 1164, 1164, 1164, 1164, 1164,
+
+     1164, 1164, 1165,    0, 1165, 1165, 1165, 1165, 1165, 1165,
+     1165, 1165, 1165, 1166,    0, 1166, 1166, 1166, 1166, 1166,
+     1166, 1166, 1166, 1166, 1167,    0, 1167, 1167, 1167, 1167,
+     1167, 1167, 1167, 1167, 1167, 1168,    0,    0, 1168, 1168,
      1168, 1169,    0, 1169, 1169, 1169, 1169, 1169, 1169, 1169,
      1169, 1169, 1170,    0, 1170, 1170, 1170, 1170, 1170, 1170,
      1170, 1170, 1170, 1171,    0, 1171, 1171, 1171, 1171, 1171,
-     1171, 1171, 1171, 1171, 1172,    0, 1172, 1172, 1172, 1172,
-     1172, 1172, 1172, 1172, 1172, 1173,    0, 1173, 1173, 1173,
-     1173, 1173, 1173, 1173, 1173, 1173, 1174, 1174, 1174, 1174,
-     1174, 1174, 1174, 1175, 1175,    0, 1175, 1175, 1175, 1175,
-     1175, 1175, 1175, 1175, 1176, 1176, 1176, 1176, 1176, 1176,
-     1176, 1176, 1176, 1176, 1176, 1177, 1177,    0, 1177, 1177,
-     1177, 1177, 1177, 1177, 1177, 1177, 1178, 1178, 1178, 1178,
-
-     1178, 1178, 1178, 1178, 1178, 1178, 1178, 1179, 1179, 1179,
-     1179, 1179, 1179, 1179, 1179, 1179, 1179, 1179, 1180, 1180,
-     1180, 1180, 1180, 1180, 1180, 1180, 1180, 1180, 1180, 1181,
-     1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181,
-     1182, 1182, 1182, 1182, 1182, 1182, 1182, 1182, 1182, 1182,
-     1182, 1183, 1183, 1183, 1183, 1183, 1183, 1183, 1183, 1183,
-     1183, 1183, 1184, 1184, 1184, 1184, 1184, 1184, 1184, 1184,
-     1184, 1184, 1184, 1185, 1185, 1185, 1185, 1185, 1185, 1185,
-     1185, 1185, 1185, 1185, 1186, 1186, 1186, 1186, 1186, 1186,
-     1186, 1186, 1186, 1186, 1186, 1187, 1187, 1187, 1187, 1187,
-
-     1187, 1187, 1187, 1187, 1187, 1187, 1188, 1188, 1188, 1188,
-     1188, 1188, 1188, 1188, 1188, 1188, 1188, 1189, 1189, 1189,
-     1189, 1189, 1189, 1189, 1189, 1189, 1189, 1189, 1190, 1190,
-     1190, 1190, 1190, 1190, 1190, 1190, 1190, 1190, 1190, 1191,
-     1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191,
+     1171, 1171, 1171, 1171, 1172, 1172, 1172, 1172, 1172, 1172,
+     1172, 1173, 1173, 1173, 1173, 1173, 1173, 1173, 1173, 1174,
+        0, 1174, 1174, 1174, 1174, 1175,    0, 1175, 1175, 1175,
+
+     1175, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1177,    0,
+     1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1178,
+        0, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178,
+     1179,    0, 1179, 1179, 1179, 1179, 1179, 1179, 1179, 1179,
+     1179, 1180,    0, 1180, 1180, 1180, 1180, 1180, 1180, 1180,
+     1180, 1180, 1181,    0, 1181, 1181, 1181, 1181, 1181, 1181,
+     1181, 1181, 1181, 1182, 1182, 1182, 1182, 1182, 1182, 1182,
+     1183, 1183,    0, 1183, 1183, 1183, 1183, 1183, 1183, 1183,
+     1183, 1184, 1184, 1184, 1184, 1184, 1184, 1184, 1184, 1184,
+     1184, 1184, 1185, 1185,    0, 1185, 1185, 1185, 1185, 1185,
+
+     1185, 1185, 1185, 1186, 1186, 1186, 1186, 1186, 1186, 1186,
+     1186, 1186, 1186, 1186, 1187, 1187, 1187, 1187, 1187, 1187,
+     1187, 1187, 1187, 1187, 1187, 1188, 1188, 1188, 1188, 1188,
+     1188, 1188, 1188, 1188, 1188, 1188, 1189, 1189, 1189, 1189,
+     1189, 1189, 1189, 1189, 1189, 1189, 1189, 1190, 1190, 1190,
+     1190, 1190, 1190, 1190, 1190, 1190, 1190, 1190, 1191, 1191,
+     1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1192,
      1192, 1192, 1192, 1192, 1192, 1192, 1192, 1192, 1192, 1192,
-     1192, 1193,    0, 1193, 1193, 1193, 1193, 1193, 1193, 1193,
-     1193, 1193, 1194,    0, 1194, 1194, 1194, 1194, 1194, 1194,
-     1194, 1194, 1194, 1195,    0, 1195, 1195, 1195, 1195, 1195,
-     1195, 1195, 1195, 1195, 1196,    0, 1196, 1196, 1196, 1196,
-
-     1196, 1196, 1196, 1196, 1196, 1197,    0, 1197, 1197, 1197,
-     1197, 1197, 1197, 1197, 1197, 1197, 1198,    0,    0, 1198,
-     1198, 1198, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199,
-     1200,    0, 1200, 1200, 1200, 1200, 1201, 1201, 1201, 1201,
-     1201, 1201, 1201, 1202,    0, 1202, 1202, 1202, 1202, 1202,
-     1202, 1202, 1202, 1202, 1203, 1203, 1203, 1203, 1203, 1203,
-     1203, 1204, 1204,    0, 1204, 1204, 1204, 1204, 1204, 1204,
-     1204, 1204, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053,
-     1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053
+     1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193,
+     1193, 1194, 1194, 1194, 1194, 1194, 1194, 1194, 1194, 1194,
+
+     1194, 1194, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
+     1195, 1195, 1195, 1196, 1196, 1196, 1196, 1196, 1196, 1196,
+     1196, 1196, 1196, 1196, 1197, 1197, 1197, 1197, 1197, 1197,
+     1197, 1197, 1197, 1197, 1197, 1198, 1198, 1198, 1198, 1198,
+     1198, 1198, 1198, 1198, 1198, 1198, 1199, 1199, 1199, 1199,
+     1199, 1199, 1199, 1199, 1199, 1199, 1199, 1200, 1200, 1200,
+     1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1201,    0,
+     1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1202,
+        0, 1202, 1202, 1202, 1202, 1202, 1202, 1202, 1202, 1202,
+     1203,    0, 1203, 1203, 1203, 1203, 1203, 1203, 1203, 1203,
+
+     1203, 1204,    0, 1204, 1204, 1204, 1204, 1204, 1204, 1204,
+     1204, 1204, 1205,    0, 1205, 1205, 1205, 1205, 1205, 1205,
+     1205, 1205, 1205, 1206,    0,    0, 1206, 1206, 1206, 1207,
+     1207, 1207, 1207, 1207, 1207, 1207, 1207, 1208,    0, 1208,
+     1208, 1208, 1208, 1209, 1209, 1209, 1209, 1209, 1209, 1209,
+     1210,    0, 1210, 1210, 1210, 1210, 1210, 1210, 1210, 1210,
+     1210, 1211, 1211, 1211, 1211, 1211, 1211, 1211, 1212, 1212,
+        0, 1212, 1212, 1212, 1212, 1212, 1212, 1212, 1212, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+     1061, 1061, 1061, 1061, 1061
     } ;
 
 /* The intent behind this definition is that it'll catch
@@ -2428,9 +2433,6 @@
     YY_BUFFER_STATE buffer;
 } macro_frame_t;
 
-/* short ranged globals for lexer state */
-int pesky_global__is_def = 0;
-
 /* static function declarations */
 static void pop_parser_state(PARROT_INTERP, ARGMOD(void *yyscanner));
 
@@ -2487,7 +2489,7 @@
 
 
 
-#line 2491 "compilers/imcc/imclexer.c"
+#line 2493 "compilers/imcc/imclexer.c"
 
 #define INITIAL 0
 #define emit 1
@@ -2732,7 +2734,7 @@
 	register int yy_act;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-#line 155 "compilers/imcc/imcc.l"
+#line 152 "compilers/imcc/imcc.l"
 
         /* for emacs "*/
         if (IMCC_INFO(interp)->expect_pasm == 1 && !IMCC_INFO(interp)->in_pod) {
@@ -2751,7 +2753,7 @@
             return 0;
         }
 
-#line 2755 "compilers/imcc/imclexer.c"
+#line 2757 "compilers/imcc/imclexer.c"
 
 	if ( !yyg->yy_init )
 		{
@@ -2805,13 +2807,13 @@
 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 				{
 				yy_current_state = (int) yy_def[yy_current_state];
-				if ( yy_current_state >= 1054 )
+				if ( yy_current_state >= 1062 )
 					yy_c = yy_meta[(unsigned int) yy_c];
 				}
 			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 			++yy_cp;
 			}
-		while ( yy_current_state != 1053 );
+		while ( yy_current_state != 1061 );
 		yy_cp = yyg->yy_last_accepting_cpos;
 		yy_current_state = yyg->yy_last_accepting_state;
 
@@ -2834,7 +2836,7 @@
 case 1:
 /* rule 1 can match eol */
 YY_RULE_SETUP
-#line 173 "compilers/imcc/imcc.l"
+#line 170 "compilers/imcc/imcc.l"
 {
             IMCC_INFO(interp)->frames->heredoc_rest = mem_sys_strdup(yytext);
             BEGIN(heredoc2);
@@ -2843,11 +2845,10 @@
 case 2:
 /* rule 2 can match eol */
 YY_RULE_SETUP
-#line 178 "compilers/imcc/imcc.l"
+#line 175 "compilers/imcc/imcc.l"
 {
         /* heredocs have highest priority
-         * arrange them before all wildcard state matches
-         */
+         * arrange them before all wildcard state matches */
 
         /* Newline in the heredoc. Realloc and cat on. */
         IMCC_INFO(interp)->line++;
@@ -2861,7 +2862,7 @@
 	YY_BREAK
 case 3:
 YY_RULE_SETUP
-#line 193 "compilers/imcc/imcc.l"
+#line 189 "compilers/imcc/imcc.l"
 {
         /* Are we at the end of the heredoc? */
         if (STREQ(IMCC_INFO(interp)->heredoc_end, yytext)) {
@@ -2885,7 +2886,8 @@
             yy_pop_state(yyscanner);
             yy_scan_string(IMCC_INFO(interp)->frames->heredoc_rest,yyscanner);
 
-            /* RT #42382 delete quotes, -> emit, pbc */
+            /* the EOF rule will increment the line number; decrement here */
+            IMCC_INFO(interp)->line--;
             return STRINGC;
         }
         else {
@@ -2902,7 +2904,7 @@
 case 4:
 /* rule 4 can match eol */
 YY_RULE_SETUP
-#line 230 "compilers/imcc/imcc.l"
+#line 227 "compilers/imcc/imcc.l"
 {
         yy_pop_state(yyscanner);
         yy_push_state(cmt3, yyscanner);
@@ -2915,7 +2917,7 @@
 	YY_BREAK
 case 5:
 YY_RULE_SETUP
-#line 240 "compilers/imcc/imcc.l"
+#line 237 "compilers/imcc/imcc.l"
 {
         yy_pop_state(yyscanner);
         yy_push_state(cmt4, yyscanner);
@@ -2923,17 +2925,17 @@
 	YY_BREAK
 case 6:
 YY_RULE_SETUP
-#line 245 "compilers/imcc/imcc.l"
+#line 242 "compilers/imcc/imcc.l"
 { yy_push_state(cmt2, yyscanner); }
 	YY_BREAK
 case 7:
 YY_RULE_SETUP
-#line 247 "compilers/imcc/imcc.l"
+#line 244 "compilers/imcc/imcc.l"
 { yy_push_state(cmt1, yyscanner);  }
 	YY_BREAK
 case 8:
 YY_RULE_SETUP
-#line 249 "compilers/imcc/imcc.l"
+#line 246 "compilers/imcc/imcc.l"
 {
         IMCC_INFO(interp)->line = atoi(yytext);
         yy_pop_state(yyscanner);
@@ -2944,7 +2946,7 @@
 case 9:
 /* rule 9 can match eol */
 YY_RULE_SETUP
-#line 256 "compilers/imcc/imcc.l"
+#line 253 "compilers/imcc/imcc.l"
 {
         yy_pop_state(yyscanner);
         IMCC_INFO(interp)->line++;
@@ -2953,7 +2955,7 @@
 case 10:
 /* rule 10 can match eol */
 YY_RULE_SETUP
-#line 261 "compilers/imcc/imcc.l"
+#line 258 "compilers/imcc/imcc.l"
 {
         if (IMCC_INFO(interp)->expect_pasm == 2)
             BEGIN(INITIAL);
@@ -2966,7 +2968,7 @@
 	YY_BREAK
 case 11:
 YY_RULE_SETUP
-#line 271 "compilers/imcc/imcc.l"
+#line 268 "compilers/imcc/imcc.l"
 {
         yy_push_state(cmt5, yyscanner);
     }
@@ -2974,7 +2976,7 @@
 case 12:
 /* rule 12 can match eol */
 YY_RULE_SETUP
-#line 275 "compilers/imcc/imcc.l"
+#line 272 "compilers/imcc/imcc.l"
 {
         if (IMCC_INFO(interp)->expect_pasm == 2)
             BEGIN(INITIAL);
@@ -2990,16 +2992,15 @@
 case 13:
 /* rule 13 can match eol */
 YY_RULE_SETUP
-#line 288 "compilers/imcc/imcc.l"
+#line 285 "compilers/imcc/imcc.l"
 {
-    /* this is a stand-alone =cut, but we're
-     * not in POD mode, so just ignore.
-     */
+    /* this is a stand-alone =cut, but we're not in POD mode, so ignore.  */
+    IMCC_INFO(interp)->line++;
 }
 	YY_BREAK
 case 14:
 YY_RULE_SETUP
-#line 294 "compilers/imcc/imcc.l"
+#line 290 "compilers/imcc/imcc.l"
 {
         IMCC_INFO(interp)->in_pod = 1;
         yy_push_state(pod, yyscanner);
@@ -3008,7 +3009,7 @@
 case 15:
 /* rule 15 can match eol */
 YY_RULE_SETUP
-#line 299 "compilers/imcc/imcc.l"
+#line 295 "compilers/imcc/imcc.l"
 {
         IMCC_INFO(interp)->in_pod = 0;
         yy_pop_state(yyscanner);
@@ -3017,473 +3018,478 @@
 	YY_BREAK
 case 16:
 YY_RULE_SETUP
-#line 305 "compilers/imcc/imcc.l"
+#line 301 "compilers/imcc/imcc.l"
 { /*ignore*/ }
 	YY_BREAK
 case 17:
 /* rule 17 can match eol */
 YY_RULE_SETUP
-#line 307 "compilers/imcc/imcc.l"
+#line 303 "compilers/imcc/imcc.l"
 { IMCC_INFO(interp)->line++; }
 	YY_BREAK
 case 18:
 YY_RULE_SETUP
-#line 309 "compilers/imcc/imcc.l"
+#line 305 "compilers/imcc/imcc.l"
 return TK_LINE;
 	YY_BREAK
 case 19:
 YY_RULE_SETUP
-#line 310 "compilers/imcc/imcc.l"
+#line 306 "compilers/imcc/imcc.l"
 return TK_FILE;
 	YY_BREAK
 case 20:
 YY_RULE_SETUP
-#line 311 "compilers/imcc/imcc.l"
+#line 307 "compilers/imcc/imcc.l"
 return ANNOTATE;
 	YY_BREAK
 case 21:
 YY_RULE_SETUP
-#line 312 "compilers/imcc/imcc.l"
+#line 308 "compilers/imcc/imcc.l"
 return LEXICAL;
 	YY_BREAK
 case 22:
 YY_RULE_SETUP
-#line 313 "compilers/imcc/imcc.l"
+#line 309 "compilers/imcc/imcc.l"
 return ARG;
 	YY_BREAK
 case 23:
 YY_RULE_SETUP
-#line 314 "compilers/imcc/imcc.l"
+#line 310 "compilers/imcc/imcc.l"
 return SUB;
 	YY_BREAK
 case 24:
 YY_RULE_SETUP
-#line 315 "compilers/imcc/imcc.l"
+#line 311 "compilers/imcc/imcc.l"
 return ESUB;
 	YY_BREAK
 case 25:
 YY_RULE_SETUP
-#line 316 "compilers/imcc/imcc.l"
+#line 312 "compilers/imcc/imcc.l"
 return PCC_BEGIN;
 	YY_BREAK
 case 26:
 YY_RULE_SETUP
-#line 317 "compilers/imcc/imcc.l"
+#line 313 "compilers/imcc/imcc.l"
 return PCC_END;
 	YY_BREAK
 case 27:
 YY_RULE_SETUP
-#line 318 "compilers/imcc/imcc.l"
+#line 314 "compilers/imcc/imcc.l"
 return PCC_CALL;
 	YY_BREAK
 case 28:
 YY_RULE_SETUP
-#line 319 "compilers/imcc/imcc.l"
+#line 315 "compilers/imcc/imcc.l"
 return NCI_CALL;
 	YY_BREAK
 case 29:
 YY_RULE_SETUP
-#line 320 "compilers/imcc/imcc.l"
+#line 316 "compilers/imcc/imcc.l"
 return METH_CALL;
 	YY_BREAK
 case 30:
 YY_RULE_SETUP
-#line 321 "compilers/imcc/imcc.l"
+#line 317 "compilers/imcc/imcc.l"
 return INVOCANT;
 	YY_BREAK
 case 31:
 YY_RULE_SETUP
-#line 322 "compilers/imcc/imcc.l"
+#line 318 "compilers/imcc/imcc.l"
 return PCC_SUB;
 	YY_BREAK
 case 32:
 YY_RULE_SETUP
-#line 323 "compilers/imcc/imcc.l"
+#line 319 "compilers/imcc/imcc.l"
 return PCC_BEGIN_RETURN;
 	YY_BREAK
 case 33:
 YY_RULE_SETUP
-#line 324 "compilers/imcc/imcc.l"
+#line 320 "compilers/imcc/imcc.l"
 return PCC_END_RETURN;
 	YY_BREAK
 case 34:
 YY_RULE_SETUP
-#line 325 "compilers/imcc/imcc.l"
+#line 321 "compilers/imcc/imcc.l"
 return PCC_BEGIN_YIELD;
 	YY_BREAK
 case 35:
 YY_RULE_SETUP
-#line 326 "compilers/imcc/imcc.l"
+#line 322 "compilers/imcc/imcc.l"
 return PCC_END_YIELD;
 	YY_BREAK
 case 36:
 YY_RULE_SETUP
-#line 328 "compilers/imcc/imcc.l"
+#line 324 "compilers/imcc/imcc.l"
 return METHOD;
 	YY_BREAK
 case 37:
 YY_RULE_SETUP
-#line 329 "compilers/imcc/imcc.l"
+#line 325 "compilers/imcc/imcc.l"
 return MULTI;
 	YY_BREAK
 case 38:
 YY_RULE_SETUP
-#line 330 "compilers/imcc/imcc.l"
+#line 326 "compilers/imcc/imcc.l"
 return MAIN;
 	YY_BREAK
 case 39:
 YY_RULE_SETUP
-#line 331 "compilers/imcc/imcc.l"
+#line 327 "compilers/imcc/imcc.l"
 return LOAD;
 	YY_BREAK
 case 40:
 YY_RULE_SETUP
-#line 332 "compilers/imcc/imcc.l"
+#line 328 "compilers/imcc/imcc.l"
 return INIT;
 	YY_BREAK
 case 41:
 YY_RULE_SETUP
-#line 333 "compilers/imcc/imcc.l"
+#line 329 "compilers/imcc/imcc.l"
 return IMMEDIATE;
 	YY_BREAK
 case 42:
 YY_RULE_SETUP
-#line 334 "compilers/imcc/imcc.l"
+#line 330 "compilers/imcc/imcc.l"
 return POSTCOMP;
 	YY_BREAK
 case 43:
 YY_RULE_SETUP
-#line 335 "compilers/imcc/imcc.l"
+#line 331 "compilers/imcc/imcc.l"
 return ANON;
 	YY_BREAK
 case 44:
 YY_RULE_SETUP
-#line 336 "compilers/imcc/imcc.l"
+#line 332 "compilers/imcc/imcc.l"
 return OUTER;
 	YY_BREAK
 case 45:
 YY_RULE_SETUP
-#line 337 "compilers/imcc/imcc.l"
+#line 333 "compilers/imcc/imcc.l"
 return NEED_LEX;
 	YY_BREAK
 case 46:
 YY_RULE_SETUP
-#line 338 "compilers/imcc/imcc.l"
+#line 334 "compilers/imcc/imcc.l"
 return VTABLE_METHOD;
 	YY_BREAK
 case 47:
 YY_RULE_SETUP
-#line 339 "compilers/imcc/imcc.l"
+#line 335 "compilers/imcc/imcc.l"
 return NS_ENTRY;
 	YY_BREAK
 case 48:
 YY_RULE_SETUP
-#line 340 "compilers/imcc/imcc.l"
+#line 336 "compilers/imcc/imcc.l"
 return UNIQUE_REG;
 	YY_BREAK
 case 49:
 YY_RULE_SETUP
-#line 341 "compilers/imcc/imcc.l"
+#line 337 "compilers/imcc/imcc.l"
 return SUB_INSTANCE_OF;
 	YY_BREAK
 case 50:
 YY_RULE_SETUP
-#line 342 "compilers/imcc/imcc.l"
+#line 338 "compilers/imcc/imcc.l"
 return SUBID;
 	YY_BREAK
 case 51:
 YY_RULE_SETUP
-#line 344 "compilers/imcc/imcc.l"
+#line 340 "compilers/imcc/imcc.l"
 return RESULT;
 	YY_BREAK
 case 52:
 YY_RULE_SETUP
-#line 345 "compilers/imcc/imcc.l"
+#line 341 "compilers/imcc/imcc.l"
 return GET_RESULTS;
 	YY_BREAK
 case 53:
 YY_RULE_SETUP
-#line 346 "compilers/imcc/imcc.l"
+#line 342 "compilers/imcc/imcc.l"
 return YIELDT;
 	YY_BREAK
 case 54:
 YY_RULE_SETUP
-#line 347 "compilers/imcc/imcc.l"
+#line 343 "compilers/imcc/imcc.l"
 return SET_YIELD;
 	YY_BREAK
 case 55:
 YY_RULE_SETUP
-#line 348 "compilers/imcc/imcc.l"
+#line 344 "compilers/imcc/imcc.l"
 return RETURN;
 	YY_BREAK
 case 56:
 YY_RULE_SETUP
-#line 349 "compilers/imcc/imcc.l"
+#line 345 "compilers/imcc/imcc.l"
 return SET_RETURN;
 	YY_BREAK
 case 57:
 YY_RULE_SETUP
-#line 350 "compilers/imcc/imcc.l"
+#line 346 "compilers/imcc/imcc.l"
 return TAILCALL;
 	YY_BREAK
 case 58:
 YY_RULE_SETUP
-#line 351 "compilers/imcc/imcc.l"
+#line 347 "compilers/imcc/imcc.l"
 return LOADLIB;
 	YY_BREAK
 case 59:
 YY_RULE_SETUP
-#line 353 "compilers/imcc/imcc.l"
+#line 349 "compilers/imcc/imcc.l"
 return ADV_FLAT;
 	YY_BREAK
 case 60:
 YY_RULE_SETUP
-#line 354 "compilers/imcc/imcc.l"
+#line 350 "compilers/imcc/imcc.l"
 return ADV_SLURPY;
 	YY_BREAK
 case 61:
 YY_RULE_SETUP
-#line 355 "compilers/imcc/imcc.l"
+#line 351 "compilers/imcc/imcc.l"
 return ADV_OPTIONAL;
 	YY_BREAK
 case 62:
 YY_RULE_SETUP
-#line 356 "compilers/imcc/imcc.l"
+#line 352 "compilers/imcc/imcc.l"
 return ADV_OPT_FLAG;
 	YY_BREAK
 case 63:
 YY_RULE_SETUP
-#line 357 "compilers/imcc/imcc.l"
+#line 353 "compilers/imcc/imcc.l"
 return ADV_NAMED;
 	YY_BREAK
 case 64:
 YY_RULE_SETUP
-#line 358 "compilers/imcc/imcc.l"
+#line 354 "compilers/imcc/imcc.l"
 return ADV_ARROW;
 	YY_BREAK
 case 65:
 YY_RULE_SETUP
-#line 359 "compilers/imcc/imcc.l"
+#line 355 "compilers/imcc/imcc.l"
 return ADV_INVOCANT;
 	YY_BREAK
 case 66:
 YY_RULE_SETUP
-#line 361 "compilers/imcc/imcc.l"
-return NAMESPACE;
+#line 356 "compilers/imcc/imcc.l"
+return ADV_CALL_SIG;
 	YY_BREAK
 case 67:
 YY_RULE_SETUP
-#line 362 "compilers/imcc/imcc.l"
-return HLL;
+#line 358 "compilers/imcc/imcc.l"
+return NAMESPACE;
 	YY_BREAK
 case 68:
 YY_RULE_SETUP
-#line 364 "compilers/imcc/imcc.l"
-return LOCAL;
+#line 359 "compilers/imcc/imcc.l"
+return HLL;
 	YY_BREAK
 case 69:
 YY_RULE_SETUP
-#line 365 "compilers/imcc/imcc.l"
-return CONST;
+#line 361 "compilers/imcc/imcc.l"
+return LOCAL;
 	YY_BREAK
 case 70:
 YY_RULE_SETUP
-#line 366 "compilers/imcc/imcc.l"
-return GLOBAL_CONST;
+#line 362 "compilers/imcc/imcc.l"
+return CONST;
 	YY_BREAK
 case 71:
 YY_RULE_SETUP
-#line 367 "compilers/imcc/imcc.l"
-return PARAM;
+#line 363 "compilers/imcc/imcc.l"
+return GLOBAL_CONST;
 	YY_BREAK
 case 72:
 YY_RULE_SETUP
-#line 368 "compilers/imcc/imcc.l"
-return GOTO;
+#line 364 "compilers/imcc/imcc.l"
+return PARAM;
 	YY_BREAK
 case 73:
 YY_RULE_SETUP
-#line 369 "compilers/imcc/imcc.l"
-return IF;
+#line 365 "compilers/imcc/imcc.l"
+return GOTO;
 	YY_BREAK
 case 74:
 YY_RULE_SETUP
-#line 370 "compilers/imcc/imcc.l"
-return UNLESS;
+#line 366 "compilers/imcc/imcc.l"
+return IF;
 	YY_BREAK
 case 75:
 YY_RULE_SETUP
-#line 371 "compilers/imcc/imcc.l"
-return PNULL;
+#line 367 "compilers/imcc/imcc.l"
+return UNLESS;
 	YY_BREAK
 case 76:
 YY_RULE_SETUP
-#line 372 "compilers/imcc/imcc.l"
-return INTV;
+#line 368 "compilers/imcc/imcc.l"
+return PNULL;
 	YY_BREAK
 case 77:
 YY_RULE_SETUP
-#line 373 "compilers/imcc/imcc.l"
-return FLOATV;
+#line 369 "compilers/imcc/imcc.l"
+return INTV;
 	YY_BREAK
 case 78:
 YY_RULE_SETUP
-#line 375 "compilers/imcc/imcc.l"
-return PMCV;
+#line 370 "compilers/imcc/imcc.l"
+return FLOATV;
 	YY_BREAK
 case 79:
 YY_RULE_SETUP
-#line 376 "compilers/imcc/imcc.l"
-return STRINGV;
+#line 372 "compilers/imcc/imcc.l"
+return PMCV;
 	YY_BREAK
 case 80:
 YY_RULE_SETUP
-#line 377 "compilers/imcc/imcc.l"
-return SHIFT_LEFT;
+#line 373 "compilers/imcc/imcc.l"
+return STRINGV;
 	YY_BREAK
 case 81:
 YY_RULE_SETUP
-#line 378 "compilers/imcc/imcc.l"
-return SHIFT_RIGHT;
+#line 374 "compilers/imcc/imcc.l"
+return SHIFT_LEFT;
 	YY_BREAK
 case 82:
 YY_RULE_SETUP
-#line 379 "compilers/imcc/imcc.l"
-return SHIFT_RIGHT_U;
+#line 375 "compilers/imcc/imcc.l"
+return SHIFT_RIGHT;
 	YY_BREAK
 case 83:
 YY_RULE_SETUP
-#line 380 "compilers/imcc/imcc.l"
-return LOG_AND;
+#line 376 "compilers/imcc/imcc.l"
+return SHIFT_RIGHT_U;
 	YY_BREAK
 case 84:
 YY_RULE_SETUP
-#line 381 "compilers/imcc/imcc.l"
-return LOG_OR;
+#line 377 "compilers/imcc/imcc.l"
+return LOG_AND;
 	YY_BREAK
 case 85:
 YY_RULE_SETUP
-#line 382 "compilers/imcc/imcc.l"
-return LOG_XOR;
+#line 378 "compilers/imcc/imcc.l"
+return LOG_OR;
 	YY_BREAK
 case 86:
 YY_RULE_SETUP
-#line 383 "compilers/imcc/imcc.l"
-return RELOP_LT;
+#line 379 "compilers/imcc/imcc.l"
+return LOG_XOR;
 	YY_BREAK
 case 87:
 YY_RULE_SETUP
-#line 384 "compilers/imcc/imcc.l"
-return RELOP_LTE;
+#line 380 "compilers/imcc/imcc.l"
+return RELOP_LT;
 	YY_BREAK
 case 88:
 YY_RULE_SETUP
-#line 385 "compilers/imcc/imcc.l"
-return RELOP_GT;
+#line 381 "compilers/imcc/imcc.l"
+return RELOP_LTE;
 	YY_BREAK
 case 89:
 YY_RULE_SETUP
-#line 386 "compilers/imcc/imcc.l"
-return RELOP_GTE;
+#line 382 "compilers/imcc/imcc.l"
+return RELOP_GT;
 	YY_BREAK
 case 90:
 YY_RULE_SETUP
-#line 387 "compilers/imcc/imcc.l"
-return RELOP_EQ;
+#line 383 "compilers/imcc/imcc.l"
+return RELOP_GTE;
 	YY_BREAK
 case 91:
 YY_RULE_SETUP
-#line 388 "compilers/imcc/imcc.l"
-return RELOP_NE;
+#line 384 "compilers/imcc/imcc.l"
+return RELOP_EQ;
 	YY_BREAK
 case 92:
 YY_RULE_SETUP
-#line 389 "compilers/imcc/imcc.l"
-return POW;
+#line 385 "compilers/imcc/imcc.l"
+return RELOP_NE;
 	YY_BREAK
 case 93:
 YY_RULE_SETUP
-#line 391 "compilers/imcc/imcc.l"
-return CONCAT;
+#line 386 "compilers/imcc/imcc.l"
+return POW;
 	YY_BREAK
 case 94:
 YY_RULE_SETUP
-#line 392 "compilers/imcc/imcc.l"
-return DOT;
+#line 388 "compilers/imcc/imcc.l"
+return CONCAT;
 	YY_BREAK
 case 95:
 YY_RULE_SETUP
-#line 394 "compilers/imcc/imcc.l"
-return PLUS_ASSIGN;
+#line 389 "compilers/imcc/imcc.l"
+return DOT;
 	YY_BREAK
 case 96:
 YY_RULE_SETUP
-#line 395 "compilers/imcc/imcc.l"
-return MINUS_ASSIGN;
+#line 391 "compilers/imcc/imcc.l"
+return PLUS_ASSIGN;
 	YY_BREAK
 case 97:
 YY_RULE_SETUP
-#line 396 "compilers/imcc/imcc.l"
-return MUL_ASSIGN;
+#line 392 "compilers/imcc/imcc.l"
+return MINUS_ASSIGN;
 	YY_BREAK
 case 98:
 YY_RULE_SETUP
-#line 397 "compilers/imcc/imcc.l"
-return DIV_ASSIGN;
+#line 393 "compilers/imcc/imcc.l"
+return MUL_ASSIGN;
 	YY_BREAK
 case 99:
 YY_RULE_SETUP
-#line 398 "compilers/imcc/imcc.l"
-return MOD_ASSIGN;
+#line 394 "compilers/imcc/imcc.l"
+return DIV_ASSIGN;
 	YY_BREAK
 case 100:
 YY_RULE_SETUP
-#line 399 "compilers/imcc/imcc.l"
-return FDIV;
+#line 395 "compilers/imcc/imcc.l"
+return MOD_ASSIGN;
 	YY_BREAK
 case 101:
 YY_RULE_SETUP
-#line 400 "compilers/imcc/imcc.l"
-return FDIV_ASSIGN;
+#line 396 "compilers/imcc/imcc.l"
+return FDIV;
 	YY_BREAK
 case 102:
 YY_RULE_SETUP
-#line 401 "compilers/imcc/imcc.l"
-return BAND_ASSIGN;
+#line 397 "compilers/imcc/imcc.l"
+return FDIV_ASSIGN;
 	YY_BREAK
 case 103:
 YY_RULE_SETUP
-#line 402 "compilers/imcc/imcc.l"
-return BOR_ASSIGN;
+#line 398 "compilers/imcc/imcc.l"
+return BAND_ASSIGN;
 	YY_BREAK
 case 104:
 YY_RULE_SETUP
-#line 403 "compilers/imcc/imcc.l"
-return BXOR_ASSIGN;
+#line 399 "compilers/imcc/imcc.l"
+return BOR_ASSIGN;
 	YY_BREAK
 case 105:
 YY_RULE_SETUP
-#line 404 "compilers/imcc/imcc.l"
-return SHR_ASSIGN;
+#line 400 "compilers/imcc/imcc.l"
+return BXOR_ASSIGN;
 	YY_BREAK
 case 106:
 YY_RULE_SETUP
-#line 405 "compilers/imcc/imcc.l"
-return SHL_ASSIGN;
+#line 401 "compilers/imcc/imcc.l"
+return SHR_ASSIGN;
 	YY_BREAK
 case 107:
 YY_RULE_SETUP
-#line 406 "compilers/imcc/imcc.l"
-return SHR_U_ASSIGN;
+#line 402 "compilers/imcc/imcc.l"
+return SHL_ASSIGN;
 	YY_BREAK
 case 108:
 YY_RULE_SETUP
-#line 407 "compilers/imcc/imcc.l"
-return CONCAT_ASSIGN;
+#line 403 "compilers/imcc/imcc.l"
+return SHR_U_ASSIGN;
 	YY_BREAK
 case 109:
 YY_RULE_SETUP
-#line 409 "compilers/imcc/imcc.l"
+#line 404 "compilers/imcc/imcc.l"
+return CONCAT_ASSIGN;
+	YY_BREAK
+case 110:
+YY_RULE_SETUP
+#line 406 "compilers/imcc/imcc.l"
 {
         char *macro_name   = NULL;
         int   start_cond   = YY_START;
@@ -3527,16 +3533,16 @@
         return MACRO;
     }
 	YY_BREAK
-case 110:
+case 111:
 YY_RULE_SETUP
-#line 452 "compilers/imcc/imcc.l"
+#line 449 "compilers/imcc/imcc.l"
 {
         return read_macro(valp, interp, yyscanner);
     }
 	YY_BREAK
-case 111:
+case 112:
 YY_RULE_SETUP
-#line 456 "compilers/imcc/imcc.l"
+#line 453 "compilers/imcc/imcc.l"
 {
         const int c = yylex(valp,yyscanner,interp);
 
@@ -3549,9 +3555,9 @@
         include_file(interp, yytext + 1, yyscanner);
     }
 	YY_BREAK
-case 112:
+case 113:
 YY_RULE_SETUP
-#line 468 "compilers/imcc/imcc.l"
+#line 465 "compilers/imcc/imcc.l"
 {
         if (valp) {
             char *label;
@@ -3574,9 +3580,9 @@
         return LABEL;
     }
 	YY_BREAK
-case 113:
+case 114:
 YY_RULE_SETUP
-#line 490 "compilers/imcc/imcc.l"
+#line 487 "compilers/imcc/imcc.l"
 {
 
         if (valp) {
@@ -3584,7 +3590,6 @@
             size_t len;
             YYCHOP();
 
-            /* RT #32421   if$I0 is parsed as if$ I0 */
             if (!IMCC_INFO(interp)->frames || !IMCC_INFO(interp)->frames->label)
                 IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR, "missing space?");
 
@@ -3599,14 +3604,14 @@
         return IDENTIFIER;
      }
 	YY_BREAK
-case 114:
+case 115:
 YY_RULE_SETUP
-#line 512 "compilers/imcc/imcc.l"
+#line 508 "compilers/imcc/imcc.l"
 return COMMA;
 	YY_BREAK
-case 115:
+case 116:
 YY_RULE_SETUP
-#line 514 "compilers/imcc/imcc.l"
+#line 510 "compilers/imcc/imcc.l"
 {
         /* trim last ':' */
         YYCHOP();
@@ -3617,46 +3622,47 @@
         return LABEL;
     }
 	YY_BREAK
-case 116:
+case 117:
 YY_RULE_SETUP
-#line 524 "compilers/imcc/imcc.l"
+#line 520 "compilers/imcc/imcc.l"
 {
-        char   * const macro_name = yytext + 1;
-
-        if (!expand_macro(interp, macro_name, yyscanner)) {
+        char   * const macro_name = mem_sys_strdup(yytext + 1);
+        int failed = expand_macro(interp, macro_name, yyscanner);
+        mem_sys_free(macro_name);
+        if (!failed) {
             yyless(1);
             return DOT;
         }
     }
 	YY_BREAK
-case 117:
-YY_RULE_SETUP
-#line 535 "compilers/imcc/imcc.l"
-DUP_AND_RET(valp, FLOATC);
-	YY_BREAK
 case 118:
 YY_RULE_SETUP
-#line 536 "compilers/imcc/imcc.l"
-DUP_AND_RET(valp, INTC);
+#line 532 "compilers/imcc/imcc.l"
+DUP_AND_RET(valp, FLOATC);
 	YY_BREAK
 case 119:
 YY_RULE_SETUP
-#line 537 "compilers/imcc/imcc.l"
+#line 533 "compilers/imcc/imcc.l"
 DUP_AND_RET(valp, INTC);
 	YY_BREAK
 case 120:
 YY_RULE_SETUP
-#line 538 "compilers/imcc/imcc.l"
+#line 534 "compilers/imcc/imcc.l"
 DUP_AND_RET(valp, INTC);
 	YY_BREAK
 case 121:
 YY_RULE_SETUP
-#line 539 "compilers/imcc/imcc.l"
+#line 535 "compilers/imcc/imcc.l"
 DUP_AND_RET(valp, INTC);
 	YY_BREAK
 case 122:
 YY_RULE_SETUP
-#line 541 "compilers/imcc/imcc.l"
+#line 536 "compilers/imcc/imcc.l"
+DUP_AND_RET(valp, INTC);
+	YY_BREAK
+case 123:
+YY_RULE_SETUP
+#line 538 "compilers/imcc/imcc.l"
 {
         valp->s = mem_sys_strdup(yytext);
 
@@ -3667,19 +3673,18 @@
         return STRINGC;
     }
 	YY_BREAK
-case 123:
+case 124:
 YY_RULE_SETUP
-#line 551 "compilers/imcc/imcc.l"
+#line 548 "compilers/imcc/imcc.l"
 {
         valp->s = mem_sys_strdup(yytext);
 
-        /* RT #42382 delete quotes, -> emit, pbc */
         return STRINGC;
     }
 	YY_BREAK
-case 124:
+case 125:
 YY_RULE_SETUP
-#line 558 "compilers/imcc/imcc.l"
+#line 554 "compilers/imcc/imcc.l"
 {
         macro_frame_t *frame;
 
@@ -3708,9 +3713,9 @@
         yy_push_state(heredoc1, yyscanner);
     }
 	YY_BREAK
-case 125:
+case 126:
 YY_RULE_SETUP
-#line 586 "compilers/imcc/imcc.l"
+#line 582 "compilers/imcc/imcc.l"
 {
         /* charset:"..." */
         valp->s = mem_sys_strdup(yytext);
@@ -3719,9 +3724,9 @@
         return USTRINGC;
     }
 	YY_BREAK
-case 126:
+case 127:
 YY_RULE_SETUP
-#line 594 "compilers/imcc/imcc.l"
+#line 590 "compilers/imcc/imcc.l"
 {
         if (valp) (valp)->s = yytext;
         if (IMCC_INFO(interp)->state->pasm_file)
@@ -3730,9 +3735,9 @@
         return IREG;
     }
 	YY_BREAK
-case 127:
+case 128:
 YY_RULE_SETUP
-#line 602 "compilers/imcc/imcc.l"
+#line 598 "compilers/imcc/imcc.l"
 {
         if (valp) (valp)->s = yytext;
         if (IMCC_INFO(interp)->state->pasm_file)
@@ -3741,9 +3746,9 @@
         return NREG;
     }
 	YY_BREAK
-case 128:
+case 129:
 YY_RULE_SETUP
-#line 610 "compilers/imcc/imcc.l"
+#line 606 "compilers/imcc/imcc.l"
 {
         if (valp) (valp)->s = yytext;
         if (IMCC_INFO(interp)->state->pasm_file)
@@ -3752,9 +3757,9 @@
         return SREG;
     }
 	YY_BREAK
-case 129:
+case 130:
 YY_RULE_SETUP
-#line 618 "compilers/imcc/imcc.l"
+#line 614 "compilers/imcc/imcc.l"
 {
         if (valp) (valp)->s = yytext;
         if (IMCC_INFO(interp)->state->pasm_file)
@@ -3763,17 +3768,17 @@
         return PREG;
     }
 	YY_BREAK
-case 130:
+case 131:
 YY_RULE_SETUP
-#line 626 "compilers/imcc/imcc.l"
+#line 622 "compilers/imcc/imcc.l"
 {
         IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
             "'%s' is not a valid register name", yytext);
     }
 	YY_BREAK
-case 131:
+case 132:
 YY_RULE_SETUP
-#line 631 "compilers/imcc/imcc.l"
+#line 627 "compilers/imcc/imcc.l"
 {
         if (IMCC_INFO(interp)->state->pasm_file == 0)
             IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
@@ -3785,11 +3790,11 @@
         return REG;
     }
 	YY_BREAK
-case 132:
+case 133:
 YY_RULE_SETUP
-#line 642 "compilers/imcc/imcc.l"
+#line 638 "compilers/imcc/imcc.l"
 {
-        if (!pesky_global__is_def) {
+        if (!IMCC_INFO(interp)->is_def) {
             SymReg *r = find_sym(interp, yytext);
 
             if (r && (r->type & (VTIDENTIFIER|VT_CONSTP))) {
@@ -3813,24 +3818,24 @@
         }
 
         valp->s = mem_sys_strdup(yytext);
-        return (!pesky_global__is_def && is_op(interp, valp->s) ? PARROT_OP : IDENTIFIER);
+        return (!IMCC_INFO(interp)->is_def && is_op(interp, valp->s) ? PARROT_OP : IDENTIFIER);
     }
 	YY_BREAK
-case 133:
+case 134:
 YY_RULE_SETUP
-#line 671 "compilers/imcc/imcc.l"
+#line 667 "compilers/imcc/imcc.l"
 /* skip */;
 	YY_BREAK
-case 134:
+case 135:
 YY_RULE_SETUP
-#line 673 "compilers/imcc/imcc.l"
+#line 669 "compilers/imcc/imcc.l"
 {
         /* catch all except for state macro */
         return yytext[0];
     }
 	YY_BREAK
 case YY_STATE_EOF(emit):
-#line 678 "compilers/imcc/imcc.l"
+#line 674 "compilers/imcc/imcc.l"
 {
         BEGIN(INITIAL);
 
@@ -3843,31 +3848,31 @@
     }
 	YY_BREAK
 case YY_STATE_EOF(INITIAL):
-#line 689 "compilers/imcc/imcc.l"
+#line 685 "compilers/imcc/imcc.l"
 yyterminate();
 	YY_BREAK
-case 135:
+case 136:
 YY_RULE_SETUP
-#line 691 "compilers/imcc/imcc.l"
+#line 687 "compilers/imcc/imcc.l"
 DUP_AND_RET(valp, ENDM);
 	YY_BREAK
-case 136:
-/* rule 136 can match eol */
+case 137:
+/* rule 137 can match eol */
 YY_RULE_SETUP
-#line 693 "compilers/imcc/imcc.l"
+#line 689 "compilers/imcc/imcc.l"
 {
         IMCC_INFO(interp)->line++;
         DUP_AND_RET(valp, '\n');
     }
 	YY_BREAK
-case 137:
+case 138:
 YY_RULE_SETUP
-#line 698 "compilers/imcc/imcc.l"
+#line 694 "compilers/imcc/imcc.l"
 return LABEL;
 	YY_BREAK
-case 138:
+case 139:
 YY_RULE_SETUP
-#line 700 "compilers/imcc/imcc.l"
+#line 696 "compilers/imcc/imcc.l"
 {
 
         if (yylex(valp,yyscanner,interp) != LABEL)
@@ -3892,9 +3897,9 @@
         return LABEL;
     }
 	YY_BREAK
-case 139:
+case 140:
 YY_RULE_SETUP
-#line 724 "compilers/imcc/imcc.l"
+#line 720 "compilers/imcc/imcc.l"
 {
         if (valp) {
             const size_t len = strlen(IMCC_INFO(interp)->cur_macro_name) + yyleng + 12;
@@ -3911,51 +3916,51 @@
         return IDENTIFIER;
     }
 	YY_BREAK
-case 140:
+case 141:
 YY_RULE_SETUP
-#line 740 "compilers/imcc/imcc.l"
+#line 736 "compilers/imcc/imcc.l"
 /* skip leading ws */;
 	YY_BREAK
-case 141:
+case 142:
 YY_RULE_SETUP
-#line 741 "compilers/imcc/imcc.l"
+#line 737 "compilers/imcc/imcc.l"
 DUP_AND_RET(valp, ' ');
 	YY_BREAK
-case 142:
+case 143:
 YY_RULE_SETUP
-#line 742 "compilers/imcc/imcc.l"
+#line 738 "compilers/imcc/imcc.l"
 DUP_AND_RET(valp, REG);
 	YY_BREAK
-case 143:
+case 144:
 YY_RULE_SETUP
-#line 743 "compilers/imcc/imcc.l"
+#line 739 "compilers/imcc/imcc.l"
 DUP_AND_RET(valp, REG);
 	YY_BREAK
-case 144:
+case 145:
 YY_RULE_SETUP
-#line 744 "compilers/imcc/imcc.l"
+#line 740 "compilers/imcc/imcc.l"
 DUP_AND_RET(valp, IDENTIFIER);
 	YY_BREAK
-case 145:
+case 146:
 YY_RULE_SETUP
-#line 745 "compilers/imcc/imcc.l"
+#line 741 "compilers/imcc/imcc.l"
 DUP_AND_RET(valp, MACRO);
 	YY_BREAK
-case 146:
+case 147:
 YY_RULE_SETUP
-#line 746 "compilers/imcc/imcc.l"
+#line 742 "compilers/imcc/imcc.l"
 DUP_AND_RET(valp, yytext[0]);
 	YY_BREAK
 case YY_STATE_EOF(macro):
-#line 747 "compilers/imcc/imcc.l"
+#line 743 "compilers/imcc/imcc.l"
 yyterminate();
 	YY_BREAK
-case 147:
+case 148:
 YY_RULE_SETUP
-#line 749 "compilers/imcc/imcc.l"
+#line 745 "compilers/imcc/imcc.l"
 ECHO;
 	YY_BREAK
-#line 3959 "compilers/imcc/imclexer.c"
+#line 3964 "compilers/imcc/imclexer.c"
 case YY_STATE_EOF(pod):
 case YY_STATE_EOF(cmt1):
 case YY_STATE_EOF(cmt2):
@@ -4258,7 +4263,7 @@
 		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 			{
 			yy_current_state = (int) yy_def[yy_current_state];
-			if ( yy_current_state >= 1054 )
+			if ( yy_current_state >= 1062 )
 				yy_c = yy_meta[(unsigned int) yy_c];
 			}
 		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -4287,11 +4292,11 @@
 	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 		{
 		yy_current_state = (int) yy_def[yy_current_state];
-		if ( yy_current_state >= 1054 )
+		if ( yy_current_state >= 1062 )
 			yy_c = yy_meta[(unsigned int) yy_c];
 		}
 	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-	yy_is_jam = (yy_current_state == 1053);
+	yy_is_jam = (yy_current_state == 1061);
 
 	return yy_is_jam ? 0 : yy_current_state;
 }
@@ -5157,7 +5162,7 @@
 
 #define YYTABLES_NAME "yytables"
 
-#line 749 "compilers/imcc/imcc.l"
+#line 745 "compilers/imcc/imcc.l"
 
 
 
@@ -5406,7 +5411,7 @@
         IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR, "Macro names must be identifiers");
 
     IMCC_INFO(interp)->cur_macro_name = valp->s;
-    start_line                        = IMCC_INFO(interp)->line++;
+    start_line                        = IMCC_INFO(interp)->line;
 
     memset(&params, 0, sizeof (params_t));
 
@@ -5475,6 +5480,9 @@
     IMCC_INFO(interp)->macro_buffer   = NULL;
     IMCC_INFO(interp)->cur_macro_name = NULL;
 
+    /* the ENDM rule doesn't set the line number */
+    IMCC_INFO(interp)->line--;
+
     return MACRO;
 }
 
@@ -5635,7 +5643,8 @@
             }
         }
 
-        IMCC_INFO(interp)->line = m->line;
+        /* let the normal EOF rules match line numbers */
+        IMCC_INFO(interp)->line = m->line - 1;
         scan_string(frame, m->expansion, yyscanner);
 
         return 1;

Modified: branches/orderedhash_revamp/compilers/imcc/imcparser.c
==============================================================================
--- branches/orderedhash_revamp/compilers/imcc/imcparser.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/imcc/imcparser.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -9,27 +9,26 @@
  */
 /* HEADERIZER HFILE: none */
 /* HEADERIZER STOP */
-/* A Bison parser, made by GNU Bison 2.3.  */
 
-/* Skeleton implementation for Bison's Yacc-like parsers in C
+/* A Bison parser, made by GNU Bison 2.4.1.  */
 
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+/* Skeleton implementation for Bison's Yacc-like parsers in C
+   
+      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or modify
+   
+   This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+   
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-
+   
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* As a special exception, you may create a larger work that contains
    part or all of the Bison parser skeleton and distribute that work
@@ -40,7 +39,7 @@
    special exception, which will cause the skeleton and the resulting
    Bison output files to be licensed under the GNU General Public
    License without this special exception.
-
+   
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
 
@@ -58,7 +57,7 @@
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "2.3"
+#define YYBISON_VERSION "2.4.1"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -66,261 +65,20 @@
 /* Pure parsers.  */
 #define YYPURE 1
 
-/* Using locations.  */
-#define YYLSP_NEEDED 0
-
-
+/* Push parsers.  */
+#define YYPUSH 0
 
-/* Tokens.  */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     LOW_PREC = 258,
-     PARAM = 259,
-     HLL = 260,
-     TK_LINE = 261,
-     TK_FILE = 262,
-     GOTO = 263,
-     ARG = 264,
-     IF = 265,
-     UNLESS = 266,
-     PNULL = 267,
-     SET_RETURN = 268,
-     SET_YIELD = 269,
-     ADV_FLAT = 270,
-     ADV_SLURPY = 271,
-     ADV_OPTIONAL = 272,
-     ADV_OPT_FLAG = 273,
-     ADV_NAMED = 274,
-     ADV_ARROW = 275,
-     NEW = 276,
-     ADV_INVOCANT = 277,
-     NAMESPACE = 278,
-     DOT_METHOD = 279,
-     SUB = 280,
-     SYM = 281,
-     LOCAL = 282,
-     LEXICAL = 283,
-     CONST = 284,
-     ANNOTATE = 285,
-     INC = 286,
-     DEC = 287,
-     GLOBAL_CONST = 288,
-     PLUS_ASSIGN = 289,
-     MINUS_ASSIGN = 290,
-     MUL_ASSIGN = 291,
-     DIV_ASSIGN = 292,
-     CONCAT_ASSIGN = 293,
-     BAND_ASSIGN = 294,
-     BOR_ASSIGN = 295,
-     BXOR_ASSIGN = 296,
-     FDIV = 297,
-     FDIV_ASSIGN = 298,
-     MOD_ASSIGN = 299,
-     SHR_ASSIGN = 300,
-     SHL_ASSIGN = 301,
-     SHR_U_ASSIGN = 302,
-     SHIFT_LEFT = 303,
-     SHIFT_RIGHT = 304,
-     INTV = 305,
-     FLOATV = 306,
-     STRINGV = 307,
-     PMCV = 308,
-     LOG_XOR = 309,
-     RELOP_EQ = 310,
-     RELOP_NE = 311,
-     RELOP_GT = 312,
-     RELOP_GTE = 313,
-     RELOP_LT = 314,
-     RELOP_LTE = 315,
-     RESULT = 316,
-     RETURN = 317,
-     TAILCALL = 318,
-     YIELDT = 319,
-     GET_RESULTS = 320,
-     POW = 321,
-     SHIFT_RIGHT_U = 322,
-     LOG_AND = 323,
-     LOG_OR = 324,
-     COMMA = 325,
-     ESUB = 326,
-     DOTDOT = 327,
-     PCC_BEGIN = 328,
-     PCC_END = 329,
-     PCC_CALL = 330,
-     PCC_SUB = 331,
-     PCC_BEGIN_RETURN = 332,
-     PCC_END_RETURN = 333,
-     PCC_BEGIN_YIELD = 334,
-     PCC_END_YIELD = 335,
-     NCI_CALL = 336,
-     METH_CALL = 337,
-     INVOCANT = 338,
-     MAIN = 339,
-     LOAD = 340,
-     INIT = 341,
-     IMMEDIATE = 342,
-     POSTCOMP = 343,
-     METHOD = 344,
-     ANON = 345,
-     OUTER = 346,
-     NEED_LEX = 347,
-     MULTI = 348,
-     VTABLE_METHOD = 349,
-     LOADLIB = 350,
-     SUB_INSTANCE_OF = 351,
-     SUBID = 352,
-     NS_ENTRY = 353,
-     UNIQUE_REG = 354,
-     LABEL = 355,
-     EMIT = 356,
-     EOM = 357,
-     IREG = 358,
-     NREG = 359,
-     SREG = 360,
-     PREG = 361,
-     IDENTIFIER = 362,
-     REG = 363,
-     MACRO = 364,
-     ENDM = 365,
-     STRINGC = 366,
-     INTC = 367,
-     FLOATC = 368,
-     USTRINGC = 369,
-     PARROT_OP = 370,
-     VAR = 371,
-     LINECOMMENT = 372,
-     FILECOMMENT = 373,
-     DOT = 374,
-     CONCAT = 375
-   };
-#endif
-/* Tokens.  */
-#define LOW_PREC 258
-#define PARAM 259
-#define HLL 260
-#define TK_LINE 261
-#define TK_FILE 262
-#define GOTO 263
-#define ARG 264
-#define IF 265
-#define UNLESS 266
-#define PNULL 267
-#define SET_RETURN 268
-#define SET_YIELD 269
-#define ADV_FLAT 270
-#define ADV_SLURPY 271
-#define ADV_OPTIONAL 272
-#define ADV_OPT_FLAG 273
-#define ADV_NAMED 274
-#define ADV_ARROW 275
-#define NEW 276
-#define ADV_INVOCANT 277
-#define NAMESPACE 278
-#define DOT_METHOD 279
-#define SUB 280
-#define SYM 281
-#define LOCAL 282
-#define LEXICAL 283
-#define CONST 284
-#define ANNOTATE 285
-#define INC 286
-#define DEC 287
-#define GLOBAL_CONST 288
-#define PLUS_ASSIGN 289
-#define MINUS_ASSIGN 290
-#define MUL_ASSIGN 291
-#define DIV_ASSIGN 292
-#define CONCAT_ASSIGN 293
-#define BAND_ASSIGN 294
-#define BOR_ASSIGN 295
-#define BXOR_ASSIGN 296
-#define FDIV 297
-#define FDIV_ASSIGN 298
-#define MOD_ASSIGN 299
-#define SHR_ASSIGN 300
-#define SHL_ASSIGN 301
-#define SHR_U_ASSIGN 302
-#define SHIFT_LEFT 303
-#define SHIFT_RIGHT 304
-#define INTV 305
-#define FLOATV 306
-#define STRINGV 307
-#define PMCV 308
-#define LOG_XOR 309
-#define RELOP_EQ 310
-#define RELOP_NE 311
-#define RELOP_GT 312
-#define RELOP_GTE 313
-#define RELOP_LT 314
-#define RELOP_LTE 315
-#define RESULT 316
-#define RETURN 317
-#define TAILCALL 318
-#define YIELDT 319
-#define GET_RESULTS 320
-#define POW 321
-#define SHIFT_RIGHT_U 322
-#define LOG_AND 323
-#define LOG_OR 324
-#define COMMA 325
-#define ESUB 326
-#define DOTDOT 327
-#define PCC_BEGIN 328
-#define PCC_END 329
-#define PCC_CALL 330
-#define PCC_SUB 331
-#define PCC_BEGIN_RETURN 332
-#define PCC_END_RETURN 333
-#define PCC_BEGIN_YIELD 334
-#define PCC_END_YIELD 335
-#define NCI_CALL 336
-#define METH_CALL 337
-#define INVOCANT 338
-#define MAIN 339
-#define LOAD 340
-#define INIT 341
-#define IMMEDIATE 342
-#define POSTCOMP 343
-#define METHOD 344
-#define ANON 345
-#define OUTER 346
-#define NEED_LEX 347
-#define MULTI 348
-#define VTABLE_METHOD 349
-#define LOADLIB 350
-#define SUB_INSTANCE_OF 351
-#define SUBID 352
-#define NS_ENTRY 353
-#define UNIQUE_REG 354
-#define LABEL 355
-#define EMIT 356
-#define EOM 357
-#define IREG 358
-#define NREG 359
-#define SREG 360
-#define PREG 361
-#define IDENTIFIER 362
-#define REG 363
-#define MACRO 364
-#define ENDM 365
-#define STRINGC 366
-#define INTC 367
-#define FLOATC 368
-#define USTRINGC 369
-#define PARROT_OP 370
-#define VAR 371
-#define LINECOMMENT 372
-#define FILECOMMENT 373
-#define DOT 374
-#define CONCAT 375
+/* Pull parsers.  */
+#define YYPULL 1
 
+/* Using locations.  */
+#define YYLSP_NEEDED 0
 
 
 
 /* Copy the first part of user declarations.  */
+
+/* Line 189 of yacc.c  */
 #line 1 "compilers/imcc/imcc.y"
 
 /*
@@ -345,6 +103,7 @@
 #define PARSER_MAIN
 #include "imc.h"
 #include "parrot/dynext.h"
+#include "pmc/pmc_callcontext.h"
 #include "pbc.h"
 #include "parser.h"
 #include "optimizer.h"
@@ -573,91 +332,91 @@
         FUNC_MODIFIES(*r)
         FUNC_MODIFIES(*name);
 
-#define ASSERT_ARGS_add_pcc_named_arg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_add_pcc_named_arg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(cur_call) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(value)
-#define ASSERT_ARGS_add_pcc_named_arg_var __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(value))
+#define ASSERT_ARGS_add_pcc_named_arg_var __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(cur_call) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(value)
-#define ASSERT_ARGS_add_pcc_named_param __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(value))
+#define ASSERT_ARGS_add_pcc_named_param __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(cur_call) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(value)
-#define ASSERT_ARGS_add_pcc_named_result __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(value))
+#define ASSERT_ARGS_add_pcc_named_result __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(cur_call) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(value)
-#define ASSERT_ARGS_add_pcc_named_return __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(value))
+#define ASSERT_ARGS_add_pcc_named_return __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(cur_call) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(value)
-#define ASSERT_ARGS_adv_named_set __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(value))
+#define ASSERT_ARGS_adv_named_set __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_adv_named_set_u __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_adv_named_set_u __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_begin_return_or_yield __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_clear_state __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_do_loadlib __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_begin_return_or_yield __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_clear_state __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_do_loadlib __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(lib)
-#define ASSERT_ARGS_func_ins __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(lib))
+#define ASSERT_ARGS_func_ins __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(lhs) \
-    || PARROT_ASSERT_ARG(op) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_iINDEXFETCH __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(lhs) \
+    , PARROT_ASSERT_ARG(op) \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_iINDEXFETCH __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(r0) \
-    || PARROT_ASSERT_ARG(r1) \
-    || PARROT_ASSERT_ARG(r2)
-#define ASSERT_ARGS_iINDEXSET __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(r0) \
+    , PARROT_ASSERT_ARG(r1) \
+    , PARROT_ASSERT_ARG(r2))
+#define ASSERT_ARGS_iINDEXSET __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(r0) \
-    || PARROT_ASSERT_ARG(r1) \
-    || PARROT_ASSERT_ARG(r2)
-#define ASSERT_ARGS_iLABEL __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(r0) \
+    , PARROT_ASSERT_ARG(r1) \
+    , PARROT_ASSERT_ARG(r2))
+#define ASSERT_ARGS_iLABEL __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(r0)
-#define ASSERT_ARGS_inv_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(op)
-#define ASSERT_ARGS_iSUBROUTINE __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(r0))
+#define ASSERT_ARGS_inv_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(op))
+#define ASSERT_ARGS_iSUBROUTINE __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_MK_I __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_MK_I __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(fmt)
-#define ASSERT_ARGS_mk_pmc_const __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(fmt))
+#define ASSERT_ARGS_mk_pmc_const __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(type) \
-    || PARROT_ASSERT_ARG(left) \
-    || PARROT_ASSERT_ARG(constant)
-#define ASSERT_ARGS_mk_pmc_const_named __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(type) \
+    , PARROT_ASSERT_ARG(left) \
+    , PARROT_ASSERT_ARG(constant))
+#define ASSERT_ARGS_mk_pmc_const_named __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(left) \
-    || PARROT_ASSERT_ARG(constant)
-#define ASSERT_ARGS_mk_sub_address_fromc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(left) \
+    , PARROT_ASSERT_ARG(constant))
+#define ASSERT_ARGS_mk_sub_address_fromc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_mk_sub_address_u __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_mk_sub_address_u __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_set_lexical __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_set_lexical __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(r) \
-    || PARROT_ASSERT_ARG(name)
+    , PARROT_ASSERT_ARG(r) \
+    , PARROT_ASSERT_ARG(name))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -775,18 +534,18 @@
     }
 
     switch (type_enum) {
-        case enum_class_Sub:
-        case enum_class_Coroutine:
-            rhs = mk_const(interp, name, 'p');
-
-            if (!ascii)
-                rhs->type |= VT_ENCODED;
-
-            rhs->usage    = U_FIXUP | U_SUBID_LOOKUP;;
-            break;
-        default:
-            rhs = mk_const(interp, name, 'P');
-            break;
+      case enum_class_Sub:
+      case enum_class_Coroutine:
+        rhs = mk_const(interp, name, 'p');
+
+        if (!ascii)
+            rhs->type |= VT_ENCODED;
+
+        rhs->usage    |= U_FIXUP | U_SUBID_LOOKUP;
+        break;
+      default:
+        rhs = mk_const(interp, name, 'P');
+        break;
     }
 
     r[1]          = rhs;
@@ -848,7 +607,7 @@
         if (!ascii)
             rhs->type |= VT_ENCODED;
 
-        rhs->usage    = U_FIXUP | U_SUBID_LOOKUP;
+        rhs->usage    |= U_FIXUP | U_SUBID_LOOKUP;
     }
     else {
         rhs = mk_const(interp, const_name, 'P');
@@ -1095,10 +854,19 @@
     ASSERT_ARGS(mk_sub_address_fromc)
     /* name is a quoted sub name */
     SymReg *r;
-    char *name_copy                  = mem_sys_strdup(name + 1);
-    name_copy[strlen(name_copy) - 1] = 0;
+    char   *name_copy;
+
+    /* interpolate only if the first character is a double-quote */
+    if (*name == '"') {
+        STRING *unescaped = Parrot_str_unescape(interp, name, '"', NULL);
+        name_copy         = Parrot_str_to_cstring(interp, unescaped);
+    }
+    else {
+        name_copy = mem_sys_strdup(name);
+        name_copy[ strlen(name) - 1 ] = 0;
+    }
 
-    r = mk_sub_address(interp, name_copy);
+    r = mk_sub_address(interp, name_copy + 1);
     mem_sys_free(name_copy);
 
     return r;
@@ -1204,8 +972,9 @@
             "register %s already declared as lexical %s", r->name, name->name);
 
     /* chain all names in r->reg */
-    name->reg = r->reg;
-    r->reg = name;
+    name->reg    = r->reg;
+    r->reg       = name;
+    name->usage |= U_LEXICAL;
     r->use_count++;
 }
 
@@ -1369,6 +1138,9 @@
 
 
 
+/* Line 189 of yacc.c  */
+#line 1132 "compilers/imcc/imcparser.c"
+
 /* Enabling traces.  */
 #ifndef YYDEBUG
 # define YYDEBUG 0
@@ -1387,31 +1159,287 @@
 # define YYTOKEN_TABLE 0
 #endif
 
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     LOW_PREC = 258,
+     PARAM = 259,
+     HLL = 260,
+     TK_LINE = 261,
+     TK_FILE = 262,
+     GOTO = 263,
+     ARG = 264,
+     IF = 265,
+     UNLESS = 266,
+     PNULL = 267,
+     SET_RETURN = 268,
+     SET_YIELD = 269,
+     ADV_FLAT = 270,
+     ADV_SLURPY = 271,
+     ADV_OPTIONAL = 272,
+     ADV_OPT_FLAG = 273,
+     ADV_NAMED = 274,
+     ADV_ARROW = 275,
+     NEW = 276,
+     ADV_INVOCANT = 277,
+     ADV_CALL_SIG = 278,
+     NAMESPACE = 279,
+     DOT_METHOD = 280,
+     SUB = 281,
+     SYM = 282,
+     LOCAL = 283,
+     LEXICAL = 284,
+     CONST = 285,
+     ANNOTATE = 286,
+     INC = 287,
+     DEC = 288,
+     GLOBAL_CONST = 289,
+     PLUS_ASSIGN = 290,
+     MINUS_ASSIGN = 291,
+     MUL_ASSIGN = 292,
+     DIV_ASSIGN = 293,
+     CONCAT_ASSIGN = 294,
+     BAND_ASSIGN = 295,
+     BOR_ASSIGN = 296,
+     BXOR_ASSIGN = 297,
+     FDIV = 298,
+     FDIV_ASSIGN = 299,
+     MOD_ASSIGN = 300,
+     SHR_ASSIGN = 301,
+     SHL_ASSIGN = 302,
+     SHR_U_ASSIGN = 303,
+     SHIFT_LEFT = 304,
+     SHIFT_RIGHT = 305,
+     INTV = 306,
+     FLOATV = 307,
+     STRINGV = 308,
+     PMCV = 309,
+     LOG_XOR = 310,
+     RELOP_EQ = 311,
+     RELOP_NE = 312,
+     RELOP_GT = 313,
+     RELOP_GTE = 314,
+     RELOP_LT = 315,
+     RELOP_LTE = 316,
+     RESULT = 317,
+     RETURN = 318,
+     TAILCALL = 319,
+     YIELDT = 320,
+     GET_RESULTS = 321,
+     POW = 322,
+     SHIFT_RIGHT_U = 323,
+     LOG_AND = 324,
+     LOG_OR = 325,
+     COMMA = 326,
+     ESUB = 327,
+     DOTDOT = 328,
+     PCC_BEGIN = 329,
+     PCC_END = 330,
+     PCC_CALL = 331,
+     PCC_SUB = 332,
+     PCC_BEGIN_RETURN = 333,
+     PCC_END_RETURN = 334,
+     PCC_BEGIN_YIELD = 335,
+     PCC_END_YIELD = 336,
+     NCI_CALL = 337,
+     METH_CALL = 338,
+     INVOCANT = 339,
+     MAIN = 340,
+     LOAD = 341,
+     INIT = 342,
+     IMMEDIATE = 343,
+     POSTCOMP = 344,
+     METHOD = 345,
+     ANON = 346,
+     OUTER = 347,
+     NEED_LEX = 348,
+     MULTI = 349,
+     VTABLE_METHOD = 350,
+     LOADLIB = 351,
+     SUB_INSTANCE_OF = 352,
+     SUBID = 353,
+     NS_ENTRY = 354,
+     UNIQUE_REG = 355,
+     LABEL = 356,
+     EMIT = 357,
+     EOM = 358,
+     IREG = 359,
+     NREG = 360,
+     SREG = 361,
+     PREG = 362,
+     IDENTIFIER = 363,
+     REG = 364,
+     MACRO = 365,
+     ENDM = 366,
+     STRINGC = 367,
+     INTC = 368,
+     FLOATC = 369,
+     USTRINGC = 370,
+     PARROT_OP = 371,
+     VAR = 372,
+     LINECOMMENT = 373,
+     FILECOMMENT = 374,
+     DOT = 375,
+     CONCAT = 376
+   };
+#endif
+/* Tokens.  */
+#define LOW_PREC 258
+#define PARAM 259
+#define HLL 260
+#define TK_LINE 261
+#define TK_FILE 262
+#define GOTO 263
+#define ARG 264
+#define IF 265
+#define UNLESS 266
+#define PNULL 267
+#define SET_RETURN 268
+#define SET_YIELD 269
+#define ADV_FLAT 270
+#define ADV_SLURPY 271
+#define ADV_OPTIONAL 272
+#define ADV_OPT_FLAG 273
+#define ADV_NAMED 274
+#define ADV_ARROW 275
+#define NEW 276
+#define ADV_INVOCANT 277
+#define ADV_CALL_SIG 278
+#define NAMESPACE 279
+#define DOT_METHOD 280
+#define SUB 281
+#define SYM 282
+#define LOCAL 283
+#define LEXICAL 284
+#define CONST 285
+#define ANNOTATE 286
+#define INC 287
+#define DEC 288
+#define GLOBAL_CONST 289
+#define PLUS_ASSIGN 290
+#define MINUS_ASSIGN 291
+#define MUL_ASSIGN 292
+#define DIV_ASSIGN 293
+#define CONCAT_ASSIGN 294
+#define BAND_ASSIGN 295
+#define BOR_ASSIGN 296
+#define BXOR_ASSIGN 297
+#define FDIV 298
+#define FDIV_ASSIGN 299
+#define MOD_ASSIGN 300
+#define SHR_ASSIGN 301
+#define SHL_ASSIGN 302
+#define SHR_U_ASSIGN 303
+#define SHIFT_LEFT 304
+#define SHIFT_RIGHT 305
+#define INTV 306
+#define FLOATV 307
+#define STRINGV 308
+#define PMCV 309
+#define LOG_XOR 310
+#define RELOP_EQ 311
+#define RELOP_NE 312
+#define RELOP_GT 313
+#define RELOP_GTE 314
+#define RELOP_LT 315
+#define RELOP_LTE 316
+#define RESULT 317
+#define RETURN 318
+#define TAILCALL 319
+#define YIELDT 320
+#define GET_RESULTS 321
+#define POW 322
+#define SHIFT_RIGHT_U 323
+#define LOG_AND 324
+#define LOG_OR 325
+#define COMMA 326
+#define ESUB 327
+#define DOTDOT 328
+#define PCC_BEGIN 329
+#define PCC_END 330
+#define PCC_CALL 331
+#define PCC_SUB 332
+#define PCC_BEGIN_RETURN 333
+#define PCC_END_RETURN 334
+#define PCC_BEGIN_YIELD 335
+#define PCC_END_YIELD 336
+#define NCI_CALL 337
+#define METH_CALL 338
+#define INVOCANT 339
+#define MAIN 340
+#define LOAD 341
+#define INIT 342
+#define IMMEDIATE 343
+#define POSTCOMP 344
+#define METHOD 345
+#define ANON 346
+#define OUTER 347
+#define NEED_LEX 348
+#define MULTI 349
+#define VTABLE_METHOD 350
+#define LOADLIB 351
+#define SUB_INSTANCE_OF 352
+#define SUBID 353
+#define NS_ENTRY 354
+#define UNIQUE_REG 355
+#define LABEL 356
+#define EMIT 357
+#define EOM 358
+#define IREG 359
+#define NREG 360
+#define SREG 361
+#define PREG 362
+#define IDENTIFIER 363
+#define REG 364
+#define MACRO 365
+#define ENDM 366
+#define STRINGC 367
+#define INTC 368
+#define FLOATC 369
+#define USTRINGC 370
+#define PARROT_OP 371
+#define VAR 372
+#define LINECOMMENT 373
+#define FILECOMMENT 374
+#define DOT 375
+#define CONCAT 376
+
+
+
+
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 typedef union YYSTYPE
-#line 1048 "compilers/imcc/imcc.y"
 {
+
+/* Line 214 of yacc.c  */
+#line 1059 "compilers/imcc/imcc.y"
+
     IdList * idlist;
     int t;
     char * s;
     SymReg * sr;
     Instruction *i;
-}
-/* Line 193 of yacc.c.  */
-#line 1391 "compilers/imcc/imcparser.c"
-	YYSTYPE;
+
+
+
+/* Line 214 of yacc.c  */
+#line 1420 "compilers/imcc/imcparser.c"
+} YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
 #endif
 
 
-
 /* Copy the second part of user declarations.  */
 
 
-/* Line 216 of yacc.c.  */
-#line 1404 "compilers/imcc/imcparser.c"
+/* Line 264 of yacc.c  */
+#line 1432 "compilers/imcc/imcparser.c"
 
 #ifdef short
 # undef short
@@ -1486,14 +1514,14 @@
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 static int
-YYID (int i)
+YYID (int yyi)
 #else
 static int
-YYID (i)
-    int i;
+YYID (yyi)
+    int yyi;
 #endif
 {
-  return i;
+  return yyi;
 }
 #endif
 
@@ -1574,9 +1602,9 @@
 /* A type that is properly aligned for any stack member.  */
 union yyalloc
 {
-  yytype_int16 yyss;
-  YYSTYPE yyvs;
-  };
+  yytype_int16 yyss_alloc;
+  YYSTYPE yyvs_alloc;
+};
 
 /* The size of the maximum gap between one aligned stack and the next.  */
 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
@@ -1610,12 +1638,12 @@
    elements in the stack, and YYPTR gives the new location of the
    stack.  Advance YYPTR to a properly aligned location for the next
    stack.  */
-# define YYSTACK_RELOCATE(Stack)					\
+# define YYSTACK_RELOCATE(Stack_alloc, Stack)				\
     do									\
       {									\
 	YYSIZE_T yynewbytes;						\
-	YYCOPY (&yyptr->Stack, Stack, yysize);				\
-	Stack = &yyptr->Stack;						\
+	YYCOPY (&yyptr->Stack_alloc, Stack, yysize);			\
+	Stack = &yyptr->Stack_alloc;					\
 	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
 	yyptr += yynewbytes / sizeof (*yyptr);				\
       }									\
@@ -1626,20 +1654,20 @@
 /* YYFINAL -- State number of the termination state.  */
 #define YYFINAL  31
 /* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   680
+#define YYLAST   659
 
 /* YYNTOKENS -- Number of terminals.  */
-#define YYNTOKENS  138
+#define YYNTOKENS  139
 /* YYNNTS -- Number of nonterminals.  */
 #define YYNNTS  126
 /* YYNRULES -- Number of rules.  */
-#define YYNRULES  337
+#define YYNRULES  339
 /* YYNRULES -- Number of states.  */
-#define YYNSTATES  543
+#define YYNSTATES  545
 
 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 #define YYUNDEFTOK  2
-#define YYMAXUTOK   375
+#define YYMAXUTOK   376
 
 #define YYTRANSLATE(YYX)						\
   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
@@ -1650,16 +1678,16 @@
        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        4,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,   128,     2,     2,     2,   134,   135,     2,
-     125,   126,   132,   131,     2,   130,     2,   133,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,   137,
-       2,   122,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,   129,     2,     2,     2,   135,   136,     2,
+     126,   127,   133,   132,     2,   131,     2,   134,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,   138,
+       2,   123,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,   123,     2,   124,     2,     2,     2,     2,     2,     2,
+       2,   124,     2,   125,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     127,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,   136,     2,   129,     2,     2,     2,
+     128,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,   137,     2,   130,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
@@ -1684,7 +1712,7 @@
       86,    87,    88,    89,    90,    91,    92,    93,    94,    95,
       96,    97,    98,    99,   100,   101,   102,   103,   104,   105,
      106,   107,   108,   109,   110,   111,   112,   113,   114,   115,
-     116,   117,   118,   119,   120,   121
+     116,   117,   118,   119,   120,   121,   122
 };
 
 #if YYDEBUG
@@ -1705,167 +1733,167 @@
      286,   288,   290,   292,   294,   296,   298,   300,   302,   304,
      310,   314,   318,   322,   326,   332,   338,   339,   343,   346,
      347,   351,   355,   356,   361,   362,   365,   367,   369,   371,
-     373,   378,   383,   385,   386,   392,   394,   395,   401,   402,
-     405,   409,   410,   413,   417,   421,   425,   426,   432,   434,
-     436,   437,   439,   443,   447,   453,   455,   458,   459,   462,
-     465,   467,   469,   471,   473,   474,   476,   479,   481,   483,
-     487,   490,   492,   496,   499,   500,   502,   504,   506,   507,
-     512,   517,   522,   523,   530,   532,   533,   540,   543,   546,
-     549,   552,   554,   556,   558,   560,   561,   563,   565,   567,
-     569,   571,   575,   580,   586,   593,   600,   608,   612,   613,
-     623,   625,   627,   629,   633,   635,   637,   639,   641,   643,
+     373,   378,   383,   385,   387,   388,   394,   396,   397,   403,
+     404,   407,   411,   412,   415,   419,   423,   427,   428,   434,
+     436,   438,   439,   441,   445,   449,   455,   457,   460,   461,
+     464,   467,   469,   471,   473,   475,   476,   478,   481,   483,
+     485,   489,   492,   494,   498,   501,   502,   504,   506,   508,
+     509,   514,   519,   524,   525,   532,   534,   535,   542,   545,
+     548,   551,   554,   556,   558,   560,   562,   563,   565,   567,
+     569,   571,   573,   577,   582,   588,   595,   602,   610,   614,
+     615,   625,   627,   629,   631,   635,   637,   639,   641,   643,
      645,   647,   649,   651,   653,   655,   657,   659,   661,   663,
      665,   667,   669,   671,   673,   675,   677,   679,   681,   683,
-     685,   686,   692,   696,   698,   700,   702,   704,   706,   708,
-     710,   712,   714,   716,   718,   720,   722,   727,   729,   731,
-     733,   735,   739,   743,   747,   751,   752,   758,   759,   763,
-     765,   771,   775,   779,   782,   783,   786,   788,   790,   795,
-     800,   803,   807,   813,   815,   819,   820,   822,   824,   831,
-     837,   842,   847,   854,   860,   862,   864,   866,   868,   870,
-     872,   874,   876,   878,   880,   881,   883,   887,   889,   891,
-     896,   900,   902,   904,   906,   908,   910,   912,   914,   916,
-     918,   920,   922,   923,   926,   927,   930,   932,   936,   938,
-     940,   942,   944,   946,   948,   950,   952,   954
+     685,   687,   688,   694,   698,   700,   702,   704,   706,   708,
+     710,   712,   714,   716,   718,   720,   722,   724,   729,   731,
+     733,   735,   737,   741,   745,   749,   753,   754,   760,   761,
+     765,   767,   773,   777,   781,   784,   785,   788,   790,   792,
+     794,   799,   804,   807,   811,   817,   819,   823,   824,   826,
+     828,   835,   841,   846,   851,   858,   864,   866,   868,   870,
+     872,   874,   876,   878,   880,   882,   884,   885,   887,   891,
+     893,   895,   900,   904,   906,   908,   910,   912,   914,   916,
+     918,   920,   922,   924,   926,   927,   930,   931,   934,   936,
+     940,   942,   944,   946,   948,   950,   952,   954,   956,   958
 };
 
 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
 static const yytype_int16 yyrhs[] =
 {
-     139,     0,    -1,   140,    -1,   141,    -1,   140,   141,    -1,
-     161,    -1,   146,    -1,   163,    -1,   158,    -1,   110,     4,
-      -1,   142,    -1,   143,    -1,     4,    -1,   145,     4,    -1,
-      96,   112,     4,    -1,     7,   113,    71,   112,     4,    -1,
-       8,   112,     4,    -1,    31,   112,    71,   263,    -1,     6,
-     112,    -1,    -1,    30,   147,   222,   108,   122,   263,    -1,
-      -1,    30,   149,   113,   254,   122,   151,    -1,    -1,    30,
-     150,   112,   254,   122,   151,    -1,   112,    -1,   115,    -1,
-     153,    -1,   152,   153,    -1,   211,   154,     4,    -1,   110,
-       4,    -1,   119,    -1,   118,    -1,   161,    -1,   148,    -1,
-     142,    -1,    -1,   155,   116,   157,    -1,    -1,    77,   156,
-     185,   101,    -1,    13,   255,    -1,    29,   112,    71,   109,
-      -1,    -1,   248,    -1,    -1,   102,   159,   160,   103,    -1,
-      -1,   152,    -1,    24,   162,     4,    -1,   123,   256,   124,
-      -1,   123,   124,    -1,    -1,    -1,    -1,    26,   164,   251,
-     165,   185,     4,   166,   167,   180,    72,    -1,    -1,     4,
-      -1,   167,   168,     4,    -1,    -1,     5,   169,   170,    -1,
-     222,   108,   194,    -1,    94,   125,   178,   126,    -1,    92,
-     125,   112,   126,    -1,    92,   125,   108,   126,    -1,    95,
-      -1,    95,   125,   112,   126,    -1,    90,    -1,    90,   125,
-     151,   126,    -1,    99,    -1,    99,   125,   151,   126,    -1,
-      97,   125,   112,   126,    -1,    98,    -1,    98,   125,   151,
-     126,    -1,    -1,   178,    71,   179,    -1,   179,    -1,    51,
-      -1,    52,    -1,    54,    -1,    53,    -1,   108,    -1,   112,
-      -1,   123,   256,   124,    -1,    -1,   208,    -1,    -1,    74,
-       4,   182,   189,   184,   188,   183,   191,    75,    -1,    -1,
-     213,     4,    -1,    -1,    84,   255,     4,    -1,    -1,   186,
-      -1,   187,    -1,   186,   187,    -1,    86,    -1,    87,    -1,
-      85,    -1,    88,    -1,    89,    -1,    91,    -1,    93,    -1,
-     171,    -1,   172,    -1,   173,    -1,   174,    -1,   175,    -1,
-     176,    -1,   177,    -1,    76,   255,    71,   255,     4,    -1,
-      76,   255,     4,    -1,    82,   255,     4,    -1,    83,   247,
-       4,    -1,    83,   112,     4,    -1,    83,   247,    71,   255,
-       4,    -1,    83,   112,    71,   255,     4,    -1,    -1,   189,
-     190,     4,    -1,    10,   237,    -1,    -1,   191,   192,     4,
-      -1,    62,   247,   194,    -1,    -1,    28,   193,   222,   216,
-      -1,    -1,   194,   195,    -1,    17,    -1,    18,    -1,    19,
-      -1,    20,    -1,    20,   125,   112,   126,    -1,    20,   125,
-     115,   126,    -1,   100,    -1,    -1,    78,     4,   197,   200,
-      79,    -1,   204,    -1,    -1,    80,     4,   199,   201,    81,
-      -1,    -1,   200,     4,    -1,   200,   202,     4,    -1,    -1,
-     201,     4,    -1,   201,   203,     4,    -1,    14,   255,   238,
-      -1,    15,   255,   238,    -1,    -1,   206,   125,   205,   207,
-     126,    -1,    63,    -1,    65,    -1,    -1,   237,    -1,   112,
-      21,   255,    -1,   207,    71,   237,    -1,   207,    71,   112,
-      21,   255,    -1,   210,    -1,   208,   210,    -1,    -1,   209,
-     214,    -1,   110,     4,    -1,   119,    -1,   118,    -1,   143,
-      -1,   144,    -1,    -1,   212,    -1,   212,   213,    -1,   213,
-      -1,   101,    -1,   211,   218,     4,    -1,     1,     4,    -1,
-     216,    -1,   215,    71,   216,    -1,   108,   217,    -1,    -1,
-     100,    -1,   224,    -1,   242,    -1,    -1,    28,   219,   222,
-     215,    -1,    29,   112,    71,   247,    -1,    29,   115,    71,
-     247,    -1,    -1,    30,   220,   222,   108,   122,   263,    -1,
-     148,    -1,    -1,    34,   221,   222,   108,   122,   263,    -1,
-      64,   234,    -1,     9,   253,    -1,   116,   248,    -1,    13,
-     255,    -1,   234,    -1,   181,    -1,   196,    -1,   198,    -1,
-      -1,    51,    -1,    52,    -1,    53,    -1,    54,    -1,   108,
-      -1,   247,   122,   255,    -1,   247,   122,   226,   255,    -1,
-     247,   122,   255,   227,   255,    -1,   247,   122,   255,   123,
-     256,   124,    -1,   247,   123,   256,   124,   122,   255,    -1,
-     247,   122,   127,   223,   123,   256,   124,    -1,   247,   122,
-     234,    -1,    -1,   125,   225,   241,   126,   122,   233,   125,
-     236,   126,    -1,   228,    -1,   230,    -1,   232,    -1,   247,
-     122,    13,    -1,   128,    -1,   129,    -1,   130,    -1,   130,
-      -1,   131,    -1,   132,    -1,   133,    -1,   134,    -1,    43,
-      -1,    67,    -1,   121,    -1,    56,    -1,    57,    -1,    58,
-      -1,    59,    -1,    60,    -1,    61,    -1,    49,    -1,    50,
-      -1,    68,    -1,    69,    -1,    70,    -1,    55,    -1,   135,
-      -1,   136,    -1,   129,    -1,    -1,    66,   229,   125,   241,
-     126,    -1,   247,   231,   255,    -1,    35,    -1,    36,    -1,
-      37,    -1,    38,    -1,    45,    -1,    44,    -1,    39,    -1,
-      40,    -1,    41,    -1,    42,    -1,    46,    -1,    47,    -1,
-      48,    -1,   247,   122,   116,   157,    -1,   108,    -1,   112,
-      -1,   115,    -1,   247,    -1,   247,   120,   252,    -1,   247,
-     120,   115,    -1,   247,   120,   112,    -1,   247,   120,   247,
-      -1,    -1,   233,   235,   125,   236,   126,    -1,    -1,   236,
-      71,   237,    -1,   237,    -1,   236,    71,   112,    21,   255,
-      -1,   255,    21,   255,    -1,   112,    21,   255,    -1,   255,
-     238,    -1,    -1,   238,   239,    -1,    16,    -1,    20,    -1,
-      20,   125,   115,   126,    -1,    20,   125,   112,   126,    -1,
-     247,   194,    -1,   241,    71,   240,    -1,   241,    71,   112,
-      21,   247,    -1,   240,    -1,   112,    21,   247,    -1,    -1,
-     244,    -1,   243,    -1,    12,   255,   246,   255,     9,   253,
-      -1,    12,    13,   255,     9,   253,    -1,    12,   255,   245,
-     253,    -1,    11,   255,   245,   253,    -1,    11,   255,   246,
-     255,     9,   253,    -1,    11,    13,   255,     9,   253,    -1,
-      71,    -1,     9,    -1,    56,    -1,    57,    -1,    58,    -1,
-      59,    -1,    60,    -1,    61,    -1,   117,    -1,   262,    -1,
-      -1,   249,    -1,   249,    71,   250,    -1,   250,    -1,   254,
-      -1,   247,   123,   256,   124,    -1,   123,   258,   124,    -1,
-     252,    -1,   112,    -1,   115,    -1,   108,    -1,   116,    -1,
-     108,    -1,   116,    -1,   253,    -1,   255,    -1,   247,    -1,
-     263,    -1,    -1,   257,   260,    -1,    -1,   259,   260,    -1,
-     261,    -1,   260,   137,   261,    -1,   255,    -1,   104,    -1,
-     105,    -1,   106,    -1,   107,    -1,   109,    -1,   113,    -1,
-     114,    -1,   112,    -1,   115,    -1
+     140,     0,    -1,   141,    -1,   142,    -1,   141,   142,    -1,
+     162,    -1,   147,    -1,   164,    -1,   159,    -1,   111,     4,
+      -1,   143,    -1,   144,    -1,     4,    -1,   146,     4,    -1,
+      97,   113,     4,    -1,     7,   114,    72,   113,     4,    -1,
+       8,   113,     4,    -1,    32,   113,    72,   264,    -1,     6,
+     113,    -1,    -1,    31,   148,   223,   109,   123,   264,    -1,
+      -1,    31,   150,   114,   255,   123,   152,    -1,    -1,    31,
+     151,   113,   255,   123,   152,    -1,   113,    -1,   116,    -1,
+     154,    -1,   153,   154,    -1,   212,   155,     4,    -1,   111,
+       4,    -1,   120,    -1,   119,    -1,   162,    -1,   149,    -1,
+     143,    -1,    -1,   156,   117,   158,    -1,    -1,    78,   157,
+     186,   102,    -1,    13,   256,    -1,    30,   113,    72,   110,
+      -1,    -1,   249,    -1,    -1,   103,   160,   161,   104,    -1,
+      -1,   153,    -1,    25,   163,     4,    -1,   124,   257,   125,
+      -1,   124,   125,    -1,    -1,    -1,    -1,    27,   165,   252,
+     166,   186,     4,   167,   168,   181,    73,    -1,    -1,     4,
+      -1,   168,   169,     4,    -1,    -1,     5,   170,   171,    -1,
+     223,   109,   195,    -1,    95,   126,   179,   127,    -1,    93,
+     126,   113,   127,    -1,    93,   126,   109,   127,    -1,    96,
+      -1,    96,   126,   113,   127,    -1,    91,    -1,    91,   126,
+     152,   127,    -1,   100,    -1,   100,   126,   152,   127,    -1,
+      98,   126,   113,   127,    -1,    99,    -1,    99,   126,   152,
+     127,    -1,    -1,   179,    72,   180,    -1,   180,    -1,    52,
+      -1,    53,    -1,    55,    -1,    54,    -1,   109,    -1,   113,
+      -1,   124,   257,   125,    -1,    -1,   209,    -1,    -1,    75,
+       4,   183,   190,   185,   189,   184,   192,    76,    -1,    -1,
+     214,     4,    -1,    -1,    85,   256,     4,    -1,    -1,   187,
+      -1,   188,    -1,   187,   188,    -1,    87,    -1,    88,    -1,
+      86,    -1,    89,    -1,    90,    -1,    92,    -1,    94,    -1,
+     172,    -1,   173,    -1,   174,    -1,   175,    -1,   176,    -1,
+     177,    -1,   178,    -1,    77,   256,    72,   256,     4,    -1,
+      77,   256,     4,    -1,    83,   256,     4,    -1,    84,   248,
+       4,    -1,    84,   113,     4,    -1,    84,   248,    72,   256,
+       4,    -1,    84,   113,    72,   256,     4,    -1,    -1,   190,
+     191,     4,    -1,    10,   238,    -1,    -1,   192,   193,     4,
+      -1,    63,   248,   195,    -1,    -1,    29,   194,   223,   217,
+      -1,    -1,   195,   196,    -1,    17,    -1,    18,    -1,    19,
+      -1,    20,    -1,    20,   126,   113,   127,    -1,    20,   126,
+     116,   127,    -1,   101,    -1,    24,    -1,    -1,    79,     4,
+     198,   201,    80,    -1,   205,    -1,    -1,    81,     4,   200,
+     202,    82,    -1,    -1,   201,     4,    -1,   201,   203,     4,
+      -1,    -1,   202,     4,    -1,   202,   204,     4,    -1,    14,
+     256,   239,    -1,    15,   256,   239,    -1,    -1,   207,   126,
+     206,   208,   127,    -1,    64,    -1,    66,    -1,    -1,   238,
+      -1,   113,    21,   256,    -1,   208,    72,   238,    -1,   208,
+      72,   113,    21,   256,    -1,   211,    -1,   209,   211,    -1,
+      -1,   210,   215,    -1,   111,     4,    -1,   120,    -1,   119,
+      -1,   144,    -1,   145,    -1,    -1,   213,    -1,   213,   214,
+      -1,   214,    -1,   102,    -1,   212,   219,     4,    -1,     1,
+       4,    -1,   217,    -1,   216,    72,   217,    -1,   109,   218,
+      -1,    -1,   101,    -1,   225,    -1,   243,    -1,    -1,    29,
+     220,   223,   216,    -1,    30,   113,    72,   248,    -1,    30,
+     116,    72,   248,    -1,    -1,    31,   221,   223,   109,   123,
+     264,    -1,   149,    -1,    -1,    35,   222,   223,   109,   123,
+     264,    -1,    65,   235,    -1,     9,   254,    -1,   117,   249,
+      -1,    13,   256,    -1,   235,    -1,   182,    -1,   197,    -1,
+     199,    -1,    -1,    52,    -1,    53,    -1,    54,    -1,    55,
+      -1,   109,    -1,   248,   123,   256,    -1,   248,   123,   227,
+     256,    -1,   248,   123,   256,   228,   256,    -1,   248,   123,
+     256,   124,   257,   125,    -1,   248,   124,   257,   125,   123,
+     256,    -1,   248,   123,   128,   224,   124,   257,   125,    -1,
+     248,   123,   235,    -1,    -1,   126,   226,   242,   127,   123,
+     234,   126,   237,   127,    -1,   229,    -1,   231,    -1,   233,
+      -1,   248,   123,    13,    -1,   129,    -1,   130,    -1,   131,
+      -1,   131,    -1,   132,    -1,   133,    -1,   134,    -1,   135,
+      -1,    44,    -1,    68,    -1,   122,    -1,    57,    -1,    58,
+      -1,    59,    -1,    60,    -1,    61,    -1,    62,    -1,    50,
+      -1,    51,    -1,    69,    -1,    70,    -1,    71,    -1,    56,
+      -1,   136,    -1,   137,    -1,   130,    -1,    -1,    67,   230,
+     126,   242,   127,    -1,   248,   232,   256,    -1,    36,    -1,
+      37,    -1,    38,    -1,    39,    -1,    46,    -1,    45,    -1,
+      40,    -1,    41,    -1,    42,    -1,    43,    -1,    47,    -1,
+      48,    -1,    49,    -1,   248,   123,   117,   158,    -1,   109,
+      -1,   113,    -1,   116,    -1,   248,    -1,   248,   121,   253,
+      -1,   248,   121,   116,    -1,   248,   121,   113,    -1,   248,
+     121,   248,    -1,    -1,   234,   236,   126,   237,   127,    -1,
+      -1,   237,    72,   238,    -1,   238,    -1,   237,    72,   113,
+      21,   256,    -1,   256,    21,   256,    -1,   113,    21,   256,
+      -1,   256,   239,    -1,    -1,   239,   240,    -1,    16,    -1,
+      20,    -1,    24,    -1,    20,   126,   116,   127,    -1,    20,
+     126,   113,   127,    -1,   248,   195,    -1,   242,    72,   241,
+      -1,   242,    72,   113,    21,   248,    -1,   241,    -1,   113,
+      21,   248,    -1,    -1,   245,    -1,   244,    -1,    12,   256,
+     247,   256,     9,   254,    -1,    12,    13,   256,     9,   254,
+      -1,    12,   256,   246,   254,    -1,    11,   256,   246,   254,
+      -1,    11,   256,   247,   256,     9,   254,    -1,    11,    13,
+     256,     9,   254,    -1,    72,    -1,     9,    -1,    57,    -1,
+      58,    -1,    59,    -1,    60,    -1,    61,    -1,    62,    -1,
+     118,    -1,   263,    -1,    -1,   250,    -1,   250,    72,   251,
+      -1,   251,    -1,   255,    -1,   248,   124,   257,   125,    -1,
+     124,   259,   125,    -1,   253,    -1,   113,    -1,   116,    -1,
+     109,    -1,   117,    -1,   109,    -1,   117,    -1,   254,    -1,
+     256,    -1,   248,    -1,   264,    -1,    -1,   258,   261,    -1,
+      -1,   260,   261,    -1,   262,    -1,   261,   138,   262,    -1,
+     256,    -1,   105,    -1,   106,    -1,   107,    -1,   108,    -1,
+     110,    -1,   114,    -1,   115,    -1,   113,    -1,   116,    -1
 };
 
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 static const yytype_uint16 yyrline[] =
 {
-       0,  1143,  1143,  1147,  1148,  1152,  1153,  1154,  1160,  1166,
-    1167,  1168,  1169,  1173,  1174,  1183,  1189,  1197,  1209,  1222,
-    1222,  1231,  1231,  1238,  1238,  1247,  1248,  1252,  1253,  1257,
-    1258,  1259,  1260,  1261,  1262,  1263,  1266,  1266,  1275,  1274,
-    1287,  1291,  1300,  1304,  1308,  1308,  1320,  1322,  1326,  1341,
-    1349,  1354,  1358,  1362,  1353,  1374,  1375,  1376,  1389,  1389,
-    1393,  1407,  1411,  1417,  1426,  1432,  1441,  1447,  1456,  1462,
-    1471,  1479,  1484,  1495,  1498,  1503,  1511,  1512,  1513,  1514,
-    1515,  1526,  1537,  1540,  1542,  1547,  1546,  1579,  1580,  1584,
-    1585,  1589,  1590,  1594,  1595,  1599,  1600,  1601,  1602,  1603,
-    1604,  1605,  1606,  1607,  1608,  1609,  1610,  1611,  1612,  1616,
-    1621,  1625,  1630,  1634,  1638,  1643,  1652,  1653,  1657,  1662,
-    1663,  1671,  1672,  1672,  1687,  1688,  1692,  1693,  1694,  1695,
-    1696,  1697,  1698,  1703,  1703,  1706,  1714,  1714,  1720,  1721,
-    1726,  1734,  1735,  1740,  1748,  1752,  1757,  1756,  1769,  1770,
-    1774,  1775,  1785,  1790,  1800,  1809,  1810,  1822,  1826,  1828,
-    1829,  1830,  1831,  1832,  1836,  1837,  1841,  1842,  1846,  1857,
-    1858,  1869,  1876,  1885,  1895,  1896,  1901,  1902,  1903,  1903,
-    1919,  1925,  1931,  1931,  1938,  1939,  1939,  1945,  1951,  1955,
-    1967,  1968,  1969,  1970,  1971,  1972,  1976,  1977,  1978,  1979,
-    1983,  1996,  1998,  2000,  2002,  2004,  2009,  2012,  2019,  2018,
-    2027,  2028,  2029,  2030,  2038,  2039,  2040,  2044,  2045,  2046,
-    2047,  2048,  2049,  2050,  2051,  2052,  2053,  2054,  2055,  2056,
-    2057,  2058,  2059,  2060,  2061,  2062,  2063,  2064,  2065,  2066,
-    2072,  2071,  2083,  2090,  2091,  2092,  2093,  2094,  2095,  2096,
-    2097,  2098,  2099,  2100,  2101,  2102,  2107,  2118,  2119,  2120,
-    2121,  2127,  2141,  2147,  2153,  2159,  2158,  2167,  2168,  2178,
-    2188,  2195,  2200,  2210,  2214,  2215,  2219,  2220,  2223,  2224,
-    2228,  2232,  2242,  2248,  2258,  2263,  2267,  2268,  2272,  2276,
-    2280,  2287,  2291,  2295,  2302,  2303,  2307,  2308,  2309,  2310,
-    2311,  2312,  2316,  2317,  2321,  2322,  2326,  2327,  2331,  2332,
-    2339,  2346,  2347,  2348,  2352,  2353,  2357,  2358,  2362,  2363,
-    2367,  2368,  2372,  2372,  2385,  2385,  2398,  2399,  2407,  2416,
-    2417,  2418,  2419,  2420,  2424,  2425,  2426,  2427
+       0,  1154,  1154,  1158,  1159,  1163,  1164,  1165,  1171,  1177,
+    1178,  1179,  1180,  1184,  1185,  1194,  1200,  1208,  1220,  1233,
+    1233,  1242,  1242,  1249,  1249,  1258,  1259,  1263,  1264,  1268,
+    1269,  1270,  1271,  1272,  1273,  1274,  1277,  1277,  1286,  1285,
+    1298,  1302,  1315,  1319,  1323,  1323,  1335,  1337,  1341,  1356,
+    1360,  1365,  1369,  1373,  1364,  1385,  1386,  1387,  1400,  1400,
+    1404,  1430,  1434,  1440,  1449,  1455,  1464,  1470,  1479,  1485,
+    1494,  1502,  1507,  1518,  1521,  1526,  1534,  1535,  1536,  1537,
+    1538,  1549,  1560,  1563,  1565,  1570,  1569,  1602,  1603,  1607,
+    1608,  1612,  1613,  1617,  1618,  1622,  1623,  1624,  1625,  1626,
+    1627,  1628,  1629,  1630,  1631,  1632,  1633,  1634,  1635,  1639,
+    1644,  1648,  1653,  1657,  1661,  1666,  1675,  1676,  1680,  1685,
+    1686,  1694,  1695,  1695,  1710,  1711,  1715,  1716,  1717,  1718,
+    1719,  1720,  1721,  1722,  1727,  1727,  1730,  1738,  1738,  1744,
+    1745,  1750,  1758,  1759,  1764,  1772,  1776,  1781,  1780,  1793,
+    1794,  1798,  1799,  1809,  1814,  1824,  1833,  1834,  1846,  1850,
+    1852,  1853,  1854,  1855,  1856,  1860,  1861,  1865,  1866,  1870,
+    1881,  1882,  1893,  1900,  1909,  1919,  1920,  1925,  1926,  1927,
+    1927,  1943,  1960,  1973,  1973,  1980,  1981,  1981,  1987,  1993,
+    1997,  2009,  2010,  2011,  2012,  2013,  2014,  2018,  2019,  2020,
+    2021,  2025,  2038,  2040,  2042,  2044,  2046,  2051,  2054,  2061,
+    2060,  2069,  2070,  2071,  2072,  2080,  2081,  2082,  2086,  2087,
+    2088,  2089,  2090,  2091,  2092,  2093,  2094,  2095,  2096,  2097,
+    2098,  2099,  2100,  2101,  2102,  2103,  2104,  2105,  2106,  2107,
+    2108,  2114,  2113,  2125,  2130,  2131,  2132,  2133,  2134,  2135,
+    2136,  2137,  2138,  2139,  2140,  2141,  2142,  2147,  2158,  2159,
+    2160,  2161,  2167,  2181,  2187,  2193,  2199,  2198,  2207,  2208,
+    2218,  2228,  2235,  2240,  2250,  2254,  2255,  2259,  2260,  2261,
+    2264,  2265,  2269,  2273,  2283,  2289,  2299,  2304,  2308,  2309,
+    2313,  2317,  2321,  2328,  2332,  2336,  2343,  2344,  2348,  2349,
+    2350,  2351,  2352,  2353,  2357,  2358,  2362,  2363,  2367,  2368,
+    2372,  2373,  2380,  2387,  2388,  2389,  2393,  2394,  2398,  2399,
+    2403,  2404,  2408,  2409,  2413,  2413,  2425,  2425,  2437,  2438,
+    2446,  2453,  2454,  2455,  2456,  2457,  2461,  2462,  2463,  2464
 };
 #endif
 
@@ -1878,47 +1906,48 @@
   "TK_LINE", "TK_FILE", "GOTO", "ARG", "IF", "UNLESS", "PNULL",
   "SET_RETURN", "SET_YIELD", "ADV_FLAT", "ADV_SLURPY", "ADV_OPTIONAL",
   "ADV_OPT_FLAG", "ADV_NAMED", "ADV_ARROW", "NEW", "ADV_INVOCANT",
-  "NAMESPACE", "DOT_METHOD", "SUB", "SYM", "LOCAL", "LEXICAL", "CONST",
-  "ANNOTATE", "INC", "DEC", "GLOBAL_CONST", "PLUS_ASSIGN", "MINUS_ASSIGN",
-  "MUL_ASSIGN", "DIV_ASSIGN", "CONCAT_ASSIGN", "BAND_ASSIGN", "BOR_ASSIGN",
-  "BXOR_ASSIGN", "FDIV", "FDIV_ASSIGN", "MOD_ASSIGN", "SHR_ASSIGN",
-  "SHL_ASSIGN", "SHR_U_ASSIGN", "SHIFT_LEFT", "SHIFT_RIGHT", "INTV",
-  "FLOATV", "STRINGV", "PMCV", "LOG_XOR", "RELOP_EQ", "RELOP_NE",
-  "RELOP_GT", "RELOP_GTE", "RELOP_LT", "RELOP_LTE", "RESULT", "RETURN",
-  "TAILCALL", "YIELDT", "GET_RESULTS", "POW", "SHIFT_RIGHT_U", "LOG_AND",
-  "LOG_OR", "COMMA", "ESUB", "DOTDOT", "PCC_BEGIN", "PCC_END", "PCC_CALL",
-  "PCC_SUB", "PCC_BEGIN_RETURN", "PCC_END_RETURN", "PCC_BEGIN_YIELD",
-  "PCC_END_YIELD", "NCI_CALL", "METH_CALL", "INVOCANT", "MAIN", "LOAD",
-  "INIT", "IMMEDIATE", "POSTCOMP", "METHOD", "ANON", "OUTER", "NEED_LEX",
-  "MULTI", "VTABLE_METHOD", "LOADLIB", "SUB_INSTANCE_OF", "SUBID",
-  "NS_ENTRY", "UNIQUE_REG", "LABEL", "EMIT", "EOM", "IREG", "NREG", "SREG",
-  "PREG", "IDENTIFIER", "REG", "MACRO", "ENDM", "STRINGC", "INTC",
-  "FLOATC", "USTRINGC", "PARROT_OP", "VAR", "LINECOMMENT", "FILECOMMENT",
-  "DOT", "CONCAT", "'='", "'['", "']'", "'('", "')'", "'new'", "'!'",
-  "'~'", "'-'", "'+'", "'*'", "'/'", "'%'", "'&'", "'|'", "';'", "$accept",
-  "program", "compilation_units", "compilation_unit", "pragma",
-  "location_directive", "annotate_directive", "hll_def", "constdef", "@1",
-  "pmc_const", "@2", "@3", "any_string", "pasmcode", "pasmline",
-  "pasm_inst", "@4", "@5", "pasm_args", "emit", "@6", "opt_pasmcode",
-  "class_namespace", "maybe_ns", "sub", "@7", "@8", "@9", "sub_params",
-  "sub_param", "@10", "sub_param_type_def", "multi", "outer", "vtable",
-  "method", "ns_entry_name", "instanceof", "subid", "multi_types",
-  "multi_type", "sub_body", "pcc_sub_call", "@11", "opt_label",
-  "opt_invocant", "sub_proto", "sub_proto_list", "proto", "pcc_call",
-  "pcc_args", "pcc_arg", "pcc_results", "pcc_result", "@12",
-  "paramtype_list", "paramtype", "pcc_ret", "@13", "pcc_yield", "@14",
+  "ADV_CALL_SIG", "NAMESPACE", "DOT_METHOD", "SUB", "SYM", "LOCAL",
+  "LEXICAL", "CONST", "ANNOTATE", "INC", "DEC", "GLOBAL_CONST",
+  "PLUS_ASSIGN", "MINUS_ASSIGN", "MUL_ASSIGN", "DIV_ASSIGN",
+  "CONCAT_ASSIGN", "BAND_ASSIGN", "BOR_ASSIGN", "BXOR_ASSIGN", "FDIV",
+  "FDIV_ASSIGN", "MOD_ASSIGN", "SHR_ASSIGN", "SHL_ASSIGN", "SHR_U_ASSIGN",
+  "SHIFT_LEFT", "SHIFT_RIGHT", "INTV", "FLOATV", "STRINGV", "PMCV",
+  "LOG_XOR", "RELOP_EQ", "RELOP_NE", "RELOP_GT", "RELOP_GTE", "RELOP_LT",
+  "RELOP_LTE", "RESULT", "RETURN", "TAILCALL", "YIELDT", "GET_RESULTS",
+  "POW", "SHIFT_RIGHT_U", "LOG_AND", "LOG_OR", "COMMA", "ESUB", "DOTDOT",
+  "PCC_BEGIN", "PCC_END", "PCC_CALL", "PCC_SUB", "PCC_BEGIN_RETURN",
+  "PCC_END_RETURN", "PCC_BEGIN_YIELD", "PCC_END_YIELD", "NCI_CALL",
+  "METH_CALL", "INVOCANT", "MAIN", "LOAD", "INIT", "IMMEDIATE", "POSTCOMP",
+  "METHOD", "ANON", "OUTER", "NEED_LEX", "MULTI", "VTABLE_METHOD",
+  "LOADLIB", "SUB_INSTANCE_OF", "SUBID", "NS_ENTRY", "UNIQUE_REG", "LABEL",
+  "EMIT", "EOM", "IREG", "NREG", "SREG", "PREG", "IDENTIFIER", "REG",
+  "MACRO", "ENDM", "STRINGC", "INTC", "FLOATC", "USTRINGC", "PARROT_OP",
+  "VAR", "LINECOMMENT", "FILECOMMENT", "DOT", "CONCAT", "'='", "'['",
+  "']'", "'('", "')'", "'n'", "'!'", "'~'", "'-'", "'+'", "'*'", "'/'",
+  "'%'", "'&'", "'|'", "';'", "$accept", "program", "compilation_units",
+  "compilation_unit", "pragma", "location_directive", "annotate_directive",
+  "hll_def", "constdef", "$@1", "pmc_const", "$@2", "$@3", "any_string",
+  "pasmcode", "pasmline", "pasm_inst", "$@4", "$@5", "pasm_args", "emit",
+  "$@6", "opt_pasmcode", "class_namespace", "maybe_ns", "sub", "$@7",
+  "$@8", "$@9", "sub_params", "sub_param", "$@10", "sub_param_type_def",
+  "multi", "outer", "vtable", "method", "ns_entry_name", "instanceof",
+  "subid", "multi_types", "multi_type", "sub_body", "pcc_sub_call", "@11",
+  "opt_label", "opt_invocant", "sub_proto", "sub_proto_list", "proto",
+  "pcc_call", "pcc_args", "pcc_arg", "pcc_results", "pcc_result", "$@12",
+  "paramtype_list", "paramtype", "pcc_ret", "$@13", "pcc_yield", "$@14",
   "pcc_returns", "pcc_yields", "pcc_return", "pcc_set_yield",
-  "pcc_return_many", "@15", "return_or_yield", "var_returns", "statements",
-  "helper_clear_state", "statement", "labels", "_labels", "label",
-  "instruction", "id_list", "id_list_id", "opt_unique_reg", "labeled_inst",
-  "@16", "@17", "@18", "type", "classname", "assignment", "@19", "un_op",
-  "bin_op", "get_results", "@20", "op_assign", "assign_op", "func_assign",
-  "the_sub", "sub_call", "@21", "arglist", "arg", "argtype_list",
-  "argtype", "result", "targetlist", "conditional_statement",
-  "unless_statement", "if_statement", "comma_or_goto", "relop", "target",
-  "vars", "_vars", "_var_or_i", "sub_label_op_c", "sub_label_op",
-  "label_op", "var_or_i", "var", "keylist", "@22", "keylist_force", "@23",
-  "_keylist", "key", "reg", "const", 0
+  "pcc_return_many", "$@15", "return_or_yield", "var_returns",
+  "statements", "helper_clear_state", "statement", "labels", "_labels",
+  "label", "instruction", "id_list", "id_list_id", "opt_unique_reg",
+  "labeled_inst", "$@16", "$@17", "$@18", "type", "classname",
+  "assignment", "@19", "un_op", "bin_op", "get_results", "@20",
+  "op_assign", "assign_op", "func_assign", "the_sub", "sub_call", "@21",
+  "arglist", "arg", "argtype_list", "argtype", "result", "targetlist",
+  "conditional_statement", "unless_statement", "if_statement",
+  "comma_or_goto", "relop", "target", "vars", "_vars", "_var_or_i",
+  "sub_label_op_c", "sub_label_op", "label_op", "var_or_i", "var",
+  "keylist", "$@22", "keylist_force", "$@23", "_keylist", "key", "reg",
+  "const", 0
 };
 #endif
 
@@ -1939,48 +1968,48 @@
      344,   345,   346,   347,   348,   349,   350,   351,   352,   353,
      354,   355,   356,   357,   358,   359,   360,   361,   362,   363,
      364,   365,   366,   367,   368,   369,   370,   371,   372,   373,
-     374,   375,    61,    91,    93,    40,    41,   110,    33,   126,
-      45,    43,    42,    47,    37,    38,   124,    59
+     374,   375,   376,    61,    91,    93,    40,    41,   110,    33,
+     126,    45,    43,    42,    47,    37,    38,   124,    59
 };
 # endif
 
 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
 static const yytype_uint16 yyr1[] =
 {
-       0,   138,   139,   140,   140,   141,   141,   141,   141,   141,
-     141,   141,   141,   142,   142,   143,   143,   144,   145,   147,
-     146,   149,   148,   150,   148,   151,   151,   152,   152,   153,
-     153,   153,   153,   153,   153,   153,   155,   154,   156,   154,
-     154,   154,   154,   157,   159,   158,   160,   160,   161,   162,
-     162,   164,   165,   166,   163,   167,   167,   167,   169,   168,
-     170,   171,   172,   172,   173,   173,   174,   174,   175,   175,
-     176,   177,   177,   178,   178,   178,   179,   179,   179,   179,
-     179,   179,   179,   180,   180,   182,   181,   183,   183,   184,
-     184,   185,   185,   186,   186,   187,   187,   187,   187,   187,
-     187,   187,   187,   187,   187,   187,   187,   187,   187,   188,
-     188,   188,   188,   188,   188,   188,   189,   189,   190,   191,
-     191,   192,   193,   192,   194,   194,   195,   195,   195,   195,
-     195,   195,   195,   197,   196,   196,   199,   198,   200,   200,
-     200,   201,   201,   201,   202,   203,   205,   204,   206,   206,
-     207,   207,   207,   207,   207,   208,   208,   209,   210,   210,
-     210,   210,   210,   210,   211,   211,   212,   212,   213,   214,
-     214,   215,   215,   216,   217,   217,   218,   218,   219,   218,
-     218,   218,   220,   218,   218,   221,   218,   218,   218,   218,
-     218,   218,   218,   218,   218,   218,   222,   222,   222,   222,
-     223,   224,   224,   224,   224,   224,   224,   224,   225,   224,
-     224,   224,   224,   224,   226,   226,   226,   227,   227,   227,
-     227,   227,   227,   227,   227,   227,   227,   227,   227,   227,
-     227,   227,   227,   227,   227,   227,   227,   227,   227,   227,
-     229,   228,   230,   231,   231,   231,   231,   231,   231,   231,
-     231,   231,   231,   231,   231,   231,   232,   233,   233,   233,
-     233,   233,   233,   233,   233,   235,   234,   236,   236,   236,
-     236,   236,   236,   237,   238,   238,   239,   239,   239,   239,
-     240,   241,   241,   241,   241,   241,   242,   242,   243,   243,
-     243,   244,   244,   244,   245,   245,   246,   246,   246,   246,
-     246,   246,   247,   247,   248,   248,   249,   249,   250,   250,
-     250,   251,   251,   251,   252,   252,   253,   253,   254,   254,
-     255,   255,   257,   256,   259,   258,   260,   260,   261,   262,
-     262,   262,   262,   262,   263,   263,   263,   263
+       0,   139,   140,   141,   141,   142,   142,   142,   142,   142,
+     142,   142,   142,   143,   143,   144,   144,   145,   146,   148,
+     147,   150,   149,   151,   149,   152,   152,   153,   153,   154,
+     154,   154,   154,   154,   154,   154,   156,   155,   157,   155,
+     155,   155,   155,   158,   160,   159,   161,   161,   162,   163,
+     163,   165,   166,   167,   164,   168,   168,   168,   170,   169,
+     171,   172,   173,   173,   174,   174,   175,   175,   176,   176,
+     177,   178,   178,   179,   179,   179,   180,   180,   180,   180,
+     180,   180,   180,   181,   181,   183,   182,   184,   184,   185,
+     185,   186,   186,   187,   187,   188,   188,   188,   188,   188,
+     188,   188,   188,   188,   188,   188,   188,   188,   188,   189,
+     189,   189,   189,   189,   189,   189,   190,   190,   191,   192,
+     192,   193,   194,   193,   195,   195,   196,   196,   196,   196,
+     196,   196,   196,   196,   198,   197,   197,   200,   199,   201,
+     201,   201,   202,   202,   202,   203,   204,   206,   205,   207,
+     207,   208,   208,   208,   208,   208,   209,   209,   210,   211,
+     211,   211,   211,   211,   211,   212,   212,   213,   213,   214,
+     215,   215,   216,   216,   217,   218,   218,   219,   219,   220,
+     219,   219,   219,   221,   219,   219,   222,   219,   219,   219,
+     219,   219,   219,   219,   219,   219,   219,   223,   223,   223,
+     223,   224,   225,   225,   225,   225,   225,   225,   225,   226,
+     225,   225,   225,   225,   225,   227,   227,   227,   228,   228,
+     228,   228,   228,   228,   228,   228,   228,   228,   228,   228,
+     228,   228,   228,   228,   228,   228,   228,   228,   228,   228,
+     228,   230,   229,   231,   232,   232,   232,   232,   232,   232,
+     232,   232,   232,   232,   232,   232,   232,   233,   234,   234,
+     234,   234,   234,   234,   234,   234,   236,   235,   237,   237,
+     237,   237,   237,   237,   238,   239,   239,   240,   240,   240,
+     240,   240,   241,   242,   242,   242,   242,   242,   243,   243,
+     244,   244,   244,   245,   245,   245,   246,   246,   247,   247,
+     247,   247,   247,   247,   248,   248,   249,   249,   250,   250,
+     251,   251,   251,   252,   252,   252,   253,   253,   254,   254,
+     255,   255,   256,   256,   258,   257,   260,   259,   261,   261,
+     262,   263,   263,   263,   263,   263,   264,   264,   264,   264
 };
 
 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
@@ -1999,27 +2028,27 @@
        1,     1,     1,     1,     1,     1,     1,     1,     1,     5,
        3,     3,     3,     3,     5,     5,     0,     3,     2,     0,
        3,     3,     0,     4,     0,     2,     1,     1,     1,     1,
-       4,     4,     1,     0,     5,     1,     0,     5,     0,     2,
-       3,     0,     2,     3,     3,     3,     0,     5,     1,     1,
-       0,     1,     3,     3,     5,     1,     2,     0,     2,     2,
-       1,     1,     1,     1,     0,     1,     2,     1,     1,     3,
-       2,     1,     3,     2,     0,     1,     1,     1,     0,     4,
-       4,     4,     0,     6,     1,     0,     6,     2,     2,     2,
-       2,     1,     1,     1,     1,     0,     1,     1,     1,     1,
-       1,     3,     4,     5,     6,     6,     7,     3,     0,     9,
-       1,     1,     1,     3,     1,     1,     1,     1,     1,     1,
+       4,     4,     1,     1,     0,     5,     1,     0,     5,     0,
+       2,     3,     0,     2,     3,     3,     3,     0,     5,     1,
+       1,     0,     1,     3,     3,     5,     1,     2,     0,     2,
+       2,     1,     1,     1,     1,     0,     1,     2,     1,     1,
+       3,     2,     1,     3,     2,     0,     1,     1,     1,     0,
+       4,     4,     4,     0,     6,     1,     0,     6,     2,     2,
+       2,     2,     1,     1,     1,     1,     0,     1,     1,     1,
+       1,     1,     3,     4,     5,     6,     6,     7,     3,     0,
+       9,     1,     1,     1,     3,     1,     1,     1,     1,     1,
        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       0,     5,     3,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     4,     1,     1,     1,
-       1,     3,     3,     3,     3,     0,     5,     0,     3,     1,
-       5,     3,     3,     2,     0,     2,     1,     1,     4,     4,
-       2,     3,     5,     1,     3,     0,     1,     1,     6,     5,
-       4,     4,     6,     5,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     0,     1,     3,     1,     1,     4,
-       3,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     0,     2,     0,     2,     1,     3,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1
+       1,     0,     5,     3,     1,     1,     1,     1,     1,     1,
+       1,     1,     1,     1,     1,     1,     1,     4,     1,     1,
+       1,     1,     3,     3,     3,     3,     0,     5,     0,     3,
+       1,     5,     3,     3,     2,     0,     2,     1,     1,     1,
+       4,     4,     2,     3,     5,     1,     3,     0,     1,     1,
+       6,     5,     4,     4,     6,     5,     1,     1,     1,     1,
+       1,     1,     1,     1,     1,     1,     0,     1,     3,     1,
+       1,     4,     3,     1,     1,     1,     1,     1,     1,     1,
+       1,     1,     1,     1,     0,     2,     0,     2,     1,     3,
+       1,     1,     1,     1,     1,     1,     1,     1,     1,     1
 };
 
 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
@@ -2029,59 +2058,59 @@
 {
        0,    12,     0,     0,     0,     0,    51,    19,     0,    44,
        0,     0,     2,     3,    10,    11,     0,     6,     8,     5,
-       7,    18,     0,     0,   322,     0,     0,     0,     0,   164,
+       7,    18,     0,     0,   324,     0,     0,     0,     0,   165,
        9,     1,     4,    13,     0,    16,    50,     0,     0,    48,
-     314,   312,   313,   315,    52,   311,   196,   197,   198,   199,
-       0,    14,    21,   168,     0,    32,    31,    35,    34,   164,
-      27,     0,    33,    36,   165,   167,     0,    49,   329,   330,
-     331,   332,   333,   336,   334,   335,   337,   302,   320,   328,
-     323,   326,   303,   321,    91,     0,     0,     0,    30,    28,
-      45,     0,     0,    38,     0,     0,   166,    15,     0,    97,
+     316,   314,   315,   317,    52,   313,   197,   198,   199,   200,
+       0,    14,    21,   169,     0,    32,    31,    35,    34,   165,
+      27,     0,    33,    36,   166,   168,     0,    49,   331,   332,
+     333,   334,   335,   338,   336,   337,   339,   304,   322,   330,
+     325,   328,   305,   323,    91,     0,     0,     0,    30,    28,
+      45,     0,     0,    38,     0,     0,   167,    15,     0,    97,
       95,    96,    98,    99,    66,   100,     0,   101,     0,    64,
        0,    71,    68,   102,   103,   104,   105,   106,   107,   108,
        0,    92,    93,     0,     0,     0,    40,     0,    91,    29,
-     304,   327,     0,     0,    73,     0,     0,     0,     0,    53,
-      94,    20,   316,   317,   318,     0,   319,     0,     0,     0,
-     324,    37,   320,    43,   305,   307,   308,    25,    26,     0,
-       0,     0,    76,    77,    79,    78,    80,    81,   322,     0,
+     306,   329,     0,     0,    73,     0,     0,     0,     0,    53,
+      94,    20,   318,   319,   320,     0,   321,     0,     0,     0,
+     326,    37,   322,    43,   307,   309,   310,    25,    26,     0,
+       0,     0,    76,    77,    79,    78,    80,    81,   324,     0,
       75,     0,     0,     0,     0,    55,     0,     0,    41,    39,
-       0,     0,   322,     0,    67,    63,    62,     0,     0,    61,
-      65,    70,    72,    69,    56,   157,    22,    24,   310,   325,
-       0,   306,    82,    74,    58,     0,     0,   161,   160,   162,
-     163,     0,     0,   157,     0,   155,   309,     0,     0,   159,
-      57,    54,   156,     0,   195,   158,    59,     0,     0,   170,
-       0,     0,     0,     0,   178,     0,   182,   185,   148,     0,
-     149,   240,     0,     0,     0,   257,   258,   259,   304,   208,
-     184,   192,   193,   194,   135,     0,     0,   176,   210,   211,
-     212,   265,   191,   177,   287,   286,   260,   124,    17,   188,
-       0,     0,     0,     0,   190,     0,     0,     0,     0,     0,
-     187,   260,     0,    85,   133,   136,   189,   285,   146,   169,
-       0,   243,   244,   245,   246,   249,   250,   251,   252,   248,
-     247,   253,   254,   255,     0,     0,   322,     0,    60,     0,
-     295,   296,   297,   298,   299,   300,   301,   294,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,   285,   116,
-     138,   141,     0,   283,     0,   124,   150,   267,   263,   262,
-     264,   261,   213,   336,   337,   304,     0,   214,   215,   216,
-       0,   207,   320,   201,     0,   242,   126,   127,   128,   129,
-     132,   125,     0,   291,     0,     0,   290,     0,   174,   179,
-     171,   180,   181,     0,     0,     0,    89,     0,     0,     0,
-       0,     0,   280,   336,     0,   151,   274,   336,     0,   269,
-     274,   256,   200,     0,   202,   222,   231,   232,   236,   225,
-     226,   227,   228,   229,   230,   223,   233,   234,   235,   224,
-     322,   239,   217,   218,   219,   220,   221,   237,   238,     0,
-       0,     0,   293,     0,   289,     0,   175,   173,     0,     0,
-       0,   241,     0,     0,     0,     0,   139,     0,   134,     0,
-     142,     0,   137,     0,   284,     0,   281,     0,     0,     0,
-     147,   273,     0,     0,   266,     0,   322,     0,   203,     0,
-       0,     0,   292,   288,   172,   183,   186,   118,     0,     0,
-       0,     0,    87,   117,   274,   140,   274,   143,     0,     0,
-     152,   336,   153,   276,   277,   275,   272,   336,   268,   271,
-       0,   204,   205,   130,   131,    90,     0,     0,     0,     0,
-     119,     0,   144,   145,   282,   267,     0,     0,     0,   206,
-     110,     0,   111,   113,     0,   112,     0,     0,    88,     0,
-     154,     0,     0,   270,     0,     0,     0,   122,     0,    86,
-       0,   209,   279,   278,   109,   115,   114,     0,   124,   120,
-       0,   121,   123
+       0,     0,   324,     0,    67,    63,    62,     0,     0,    61,
+      65,    70,    72,    69,    56,   158,    22,    24,   312,   327,
+       0,   308,    82,    74,    58,     0,     0,   162,   161,   163,
+     164,     0,     0,   158,     0,   156,   311,     0,     0,   160,
+      57,    54,   157,     0,   196,   159,    59,     0,     0,   171,
+       0,     0,     0,     0,   179,     0,   183,   186,   149,     0,
+     150,   241,     0,     0,     0,   258,   259,   260,   306,   209,
+     185,   193,   194,   195,   136,     0,     0,   177,   211,   212,
+     213,   266,   192,   178,   289,   288,   261,   124,    17,   189,
+       0,     0,     0,     0,   191,     0,     0,     0,     0,     0,
+     188,   261,     0,    85,   134,   137,   190,   287,   147,   170,
+       0,   244,   245,   246,   247,   250,   251,   252,   253,   249,
+     248,   254,   255,   256,     0,     0,   324,     0,    60,     0,
+     297,   298,   299,   300,   301,   302,   303,   296,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,   287,   116,
+     139,   142,     0,   285,     0,   124,   151,   268,   264,   263,
+     265,   262,   214,   338,   339,   306,     0,   215,   216,   217,
+       0,   208,   322,   202,     0,   243,   126,   127,   128,   129,
+     133,   132,   125,     0,   293,     0,     0,   292,     0,   175,
+     180,   172,   181,   182,     0,     0,     0,    89,     0,     0,
+       0,     0,     0,   282,   338,     0,   152,   275,   338,     0,
+     270,   275,   257,   201,     0,   203,   223,   232,   233,   237,
+     226,   227,   228,   229,   230,   231,   224,   234,   235,   236,
+     225,   324,   240,   218,   219,   220,   221,   222,   238,   239,
+       0,     0,     0,   295,     0,   291,     0,   176,   174,     0,
+       0,     0,   242,     0,     0,     0,     0,   140,     0,   135,
+       0,   143,     0,   138,     0,   286,     0,   283,     0,     0,
+       0,   148,   274,     0,     0,   267,     0,   324,     0,   204,
+       0,     0,     0,   294,   290,   173,   184,   187,   118,     0,
+       0,     0,     0,    87,   117,   275,   141,   275,   144,     0,
+       0,   153,   338,   154,   277,   278,   279,   276,   273,   338,
+     269,   272,     0,   205,   206,   130,   131,    90,     0,     0,
+       0,     0,   119,     0,   145,   146,   284,   268,     0,     0,
+       0,   207,   110,     0,   111,   113,     0,   112,     0,     0,
+      88,     0,   155,     0,     0,   271,     0,     0,     0,   122,
+       0,    86,     0,   210,   281,   280,   109,   115,   114,     0,
+     124,   120,     0,   121,   123
 };
 
 /* YYDEFGOTO[NTERM-NUM].  */
@@ -2091,307 +2120,301 @@
       58,    86,    87,   159,    59,    60,    94,    95,   128,   151,
       18,    29,    61,    19,    25,    20,    26,    84,   175,   195,
      211,   217,   226,   113,   114,   115,   116,   117,   118,   119,
-     169,   170,   212,   251,   329,   500,   434,   120,   121,   122,
-     472,   376,   435,   517,   530,   537,   308,   361,   252,   330,
-     253,   331,   377,   378,   439,   443,   254,   336,   255,   384,
-     213,   214,   215,    63,    64,    65,   225,   369,   370,   427,
-     256,   275,   278,   279,    50,   393,   257,   287,   350,   419,
-     258,   282,   259,   307,   260,   261,   262,   290,   388,   389,
-     451,   485,   333,   334,   263,   264,   265,   318,   319,    78,
+     169,   170,   212,   251,   329,   502,   435,   120,   121,   122,
+     473,   377,   436,   519,   532,   539,   308,   362,   252,   330,
+     253,   331,   378,   379,   440,   444,   254,   336,   255,   385,
+     213,   214,   215,    63,    64,    65,   225,   370,   371,   428,
+     256,   275,   278,   279,    50,   394,   257,   287,   350,   420,
+     258,   282,   259,   307,   260,   261,   262,   290,   389,   390,
+     452,   487,   333,   334,   263,   264,   265,   318,   319,    78,
      153,   154,   155,    44,    45,   144,   156,   146,    37,    38,
      180,   181,    80,    81,    82,    83
 };
 
 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
    STATE-NUM.  */
-#define YYPACT_NINF -418
+#define YYPACT_NINF -424
 static const yytype_int16 yypact[] =
 {
-     252,  -418,   -82,   -71,   -58,   -55,  -418,  -418,    -6,  -418,
-     112,   141,   252,  -418,  -418,  -418,   145,  -418,  -418,  -418,
-    -418,  -418,    87,   169,    68,   194,    48,   184,   200,    11,
-    -418,  -418,  -418,  -418,    94,  -418,  -418,    83,   479,  -418,
-    -418,  -418,  -418,  -418,  -418,  -418,  -418,  -418,  -418,  -418,
-     101,  -418,    98,  -418,   211,  -418,  -418,  -418,  -418,   144,
-    -418,   122,  -418,    20,   132,  -418,   235,  -418,  -418,  -418,
-    -418,  -418,  -418,  -418,  -418,  -418,  -418,  -418,  -418,  -418,
-     109,  -418,  -418,  -418,   451,   127,   137,   143,  -418,  -418,
-    -418,   479,   149,  -418,   249,   148,  -418,  -418,   479,  -418,
-    -418,  -418,  -418,  -418,   140,  -418,   146,  -418,   150,   152,
-     154,   155,   158,  -418,  -418,  -418,  -418,  -418,  -418,  -418,
-     253,   451,  -418,   173,   464,   464,  -418,   195,   451,  -418,
-     412,  -418,    54,   -41,     5,   156,   180,    54,    54,  -418,
-    -418,  -418,  -418,  -418,  -418,   171,  -418,   174,   188,   203,
-    -418,  -418,   183,  -418,   236,  -418,  -418,  -418,  -418,   189,
-     190,   191,  -418,  -418,  -418,  -418,  -418,  -418,  -418,   -46,
-    -418,   192,   202,   204,   205,   305,    54,    54,  -418,  -418,
-     197,   479,  -418,   412,  -418,  -418,  -418,   198,     5,  -418,
-    -418,  -418,  -418,  -418,  -418,    43,  -418,  -418,  -418,   109,
-     208,  -418,  -418,  -418,  -418,   217,   310,  -418,  -418,  -418,
-    -418,   316,   264,     0,    74,  -418,  -418,   184,   262,  -418,
-    -418,  -418,  -418,   333,   261,  -418,  -418,   230,   173,  -418,
-     -69,   321,   336,   479,  -418,    55,   -50,  -418,  -418,   354,
-    -418,  -418,   338,   340,   341,  -418,  -418,  -418,   412,  -418,
-    -418,  -418,  -418,  -418,  -418,   215,   342,  -418,  -418,  -418,
-    -418,  -418,  -418,  -418,  -418,  -418,   467,  -418,  -418,  -418,
-     479,    75,   479,    75,  -418,   184,   276,   280,   184,   184,
-    -418,   232,   228,  -418,  -418,  -418,  -418,   196,  -418,  -418,
-     231,  -418,  -418,  -418,  -418,  -418,  -418,  -418,  -418,  -418,
-    -418,  -418,  -418,  -418,   493,   114,  -418,   479,    -5,   346,
-    -418,  -418,  -418,  -418,  -418,  -418,  -418,  -418,   -69,   479,
-     348,   -69,   479,   250,   107,   107,   251,   255,   196,  -418,
-    -418,  -418,   339,  -418,   -45,  -418,   507,   521,  -418,  -418,
-    -418,  -418,  -418,   239,   246,   412,   266,  -418,  -418,  -418,
-     479,  -418,   -80,   431,   237,  -418,  -418,  -418,  -418,   247,
-    -418,  -418,   -69,  -418,   366,   -69,  -418,   370,   282,   309,
-    -418,  -418,  -418,   263,   265,   -35,     8,    15,    12,   107,
-     284,   270,    -5,   362,   -27,  -418,  -418,   363,    -2,  -418,
-     376,  -418,  -418,   275,  -418,  -418,  -418,  -418,  -418,  -418,
-    -418,  -418,  -418,  -418,  -418,  -418,  -418,  -418,  -418,  -418,
-    -418,  -418,  -418,  -418,  -418,  -418,  -418,  -418,  -418,   479,
-     283,    72,  -418,   -69,  -418,   -69,  -418,  -418,   250,   173,
-     173,  -418,   479,   479,    89,   398,  -418,   479,  -418,   400,
-    -418,   479,  -418,   402,  -418,   386,  -418,   354,   479,   535,
-    -418,   131,   479,   549,  -418,   479,  -418,   288,  -418,   479,
-     287,   290,  -418,  -418,  -418,  -418,  -418,  -418,   404,   479,
-     479,   563,   132,  -418,  -418,  -418,  -418,  -418,   107,   293,
-    -418,   399,  -418,  -418,   294,  -418,  -418,   401,  -418,  -418,
-     299,  -418,  -418,  -418,  -418,  -418,    17,   420,    18,    19,
-    -418,   425,   131,   131,  -418,   521,   479,    73,   479,  -418,
-    -418,   479,  -418,  -418,   479,  -418,   479,     4,  -418,    -1,
-    -418,   311,   313,  -418,   440,   442,   443,  -418,   107,  -418,
-     448,  -418,  -418,  -418,  -418,  -418,  -418,   184,  -418,  -418,
-     250,    -5,  -418
+     219,  -424,   -86,   -55,   -62,   -58,  -424,  -424,    -8,  -424,
+      82,   163,   219,  -424,  -424,  -424,   169,  -424,  -424,  -424,
+    -424,  -424,    93,   171,    58,   184,    95,   166,   188,    70,
+    -424,  -424,  -424,  -424,    90,  -424,  -424,    81,   439,  -424,
+    -424,  -424,  -424,  -424,  -424,  -424,  -424,  -424,  -424,  -424,
+     100,  -424,   109,  -424,   220,  -424,  -424,  -424,  -424,   160,
+    -424,   129,  -424,    67,   133,  -424,   232,  -424,  -424,  -424,
+    -424,  -424,  -424,  -424,  -424,  -424,  -424,  -424,  -424,  -424,
+      99,  -424,  -424,  -424,   421,   117,   131,   135,  -424,  -424,
+    -424,   439,   136,  -424,   250,   134,  -424,  -424,   439,  -424,
+    -424,  -424,  -424,  -424,   130,  -424,   132,  -424,   137,   142,
+     146,   147,   149,  -424,  -424,  -424,  -424,  -424,  -424,  -424,
+     251,   421,  -424,   115,   425,   425,  -424,   204,   421,  -424,
+     350,  -424,    48,   -19,   161,   164,   165,    48,    48,  -424,
+    -424,  -424,  -424,  -424,  -424,   159,  -424,   177,   182,   200,
+    -424,  -424,   179,  -424,   234,  -424,  -424,  -424,  -424,   180,
+     181,   183,  -424,  -424,  -424,  -424,  -424,  -424,  -424,   -64,
+    -424,   186,   190,   191,   192,   300,    48,    48,  -424,  -424,
+     196,   439,  -424,   350,  -424,  -424,  -424,   198,   161,  -424,
+    -424,  -424,  -424,  -424,  -424,    49,  -424,  -424,  -424,    99,
+     199,  -424,  -424,  -424,  -424,   213,   323,  -424,  -424,  -424,
+    -424,   324,   256,    60,     8,  -424,  -424,   166,   259,  -424,
+    -424,  -424,  -424,   328,   230,  -424,  -424,   224,   115,  -424,
+     -67,   253,   270,   439,  -424,    71,    42,  -424,  -424,   509,
+    -424,  -424,   330,   337,   338,  -424,  -424,  -424,   350,  -424,
+    -424,  -424,  -424,  -424,  -424,   223,   341,  -424,  -424,  -424,
+    -424,  -424,  -424,  -424,  -424,  -424,   405,  -424,  -424,  -424,
+     439,   229,   439,   229,  -424,   166,   278,   290,   166,   166,
+    -424,   243,   244,  -424,  -424,  -424,  -424,   523,  -424,  -424,
+     246,  -424,  -424,  -424,  -424,  -424,  -424,  -424,  -424,  -424,
+    -424,  -424,  -424,  -424,   379,    22,  -424,   439,     5,   364,
+    -424,  -424,  -424,  -424,  -424,  -424,  -424,  -424,   -67,   439,
+     365,   -67,   439,   272,   247,   247,   280,   281,   523,  -424,
+    -424,  -424,   358,  -424,   -39,  -424,   453,   467,  -424,  -424,
+    -424,  -424,  -424,   261,   265,   350,   283,  -424,  -424,  -424,
+     439,  -424,    28,   369,   268,  -424,  -424,  -424,  -424,   271,
+    -424,  -424,  -424,   -67,  -424,   385,   -67,  -424,   389,   298,
+     329,  -424,  -424,  -424,   282,   284,   -36,     0,    27,    11,
+     247,   532,   285,     5,   382,   -27,  -424,  -424,   388,   -24,
+    -424,   393,  -424,  -424,   293,  -424,  -424,  -424,  -424,  -424,
+    -424,  -424,  -424,  -424,  -424,  -424,  -424,  -424,  -424,  -424,
+    -424,  -424,  -424,  -424,  -424,  -424,  -424,  -424,  -424,  -424,
+     439,   301,    85,  -424,   -67,  -424,   -67,  -424,  -424,   272,
+     115,   115,  -424,   439,   439,   -37,   402,  -424,   439,  -424,
+     417,  -424,   439,  -424,   419,  -424,   413,  -424,   509,   439,
+     481,  -424,   162,   439,   495,  -424,   439,  -424,   310,  -424,
+     439,   309,   322,  -424,  -424,  -424,  -424,  -424,  -424,   457,
+     439,   439,   541,   133,  -424,  -424,  -424,  -424,  -424,   247,
+     336,  -424,   450,  -424,  -424,   347,  -424,  -424,  -424,   455,
+    -424,  -424,   352,  -424,  -424,  -424,  -424,  -424,    10,   475,
+      12,    26,  -424,   477,   162,   162,  -424,   467,   439,    86,
+     439,  -424,  -424,   439,  -424,  -424,   439,  -424,   439,    94,
+    -424,   -23,  -424,   355,   356,  -424,   486,   490,   494,  -424,
+     247,  -424,   514,  -424,  -424,  -424,  -424,  -424,  -424,   166,
+    -424,  -424,   272,     5,  -424
 };
 
 /* YYPGOTO[NTERM-NUM].  */
 static const yytype_int16 yypgoto[] =
 {
-    -418,  -418,  -418,   444,    14,  -167,  -418,  -418,  -418,  -418,
-     233,  -418,  -418,  -100,  -418,   395,  -418,  -418,  -418,   110,
-    -418,  -418,  -418,    23,  -418,  -418,  -418,  -418,  -418,  -418,
-    -418,  -418,  -418,  -418,  -418,  -418,  -418,  -418,  -418,  -418,
-    -418,   277,  -418,  -418,  -418,  -418,  -418,   344,  -418,   343,
-    -418,  -418,  -418,  -418,  -418,  -418,  -330,  -418,  -418,  -418,
-    -418,  -418,  -418,  -418,  -418,  -418,  -418,  -418,  -418,  -418,
-    -418,  -418,   269,   271,  -418,   -63,  -418,  -418,  -417,  -418,
-    -418,  -418,  -418,  -418,  -214,  -418,  -418,  -418,  -418,  -418,
-    -418,  -418,  -418,  -418,  -418,    28,  -205,  -418,   -28,  -327,
-    -319,  -418,    99,   165,  -418,  -418,  -418,   210,   221,  -128,
-     248,  -418,   301,  -418,   193,  -220,    77,   -38,  -162,  -418,
-    -418,  -418,   314,   424,  -418,  -119
+    -424,  -424,  -424,   510,    -1,  -161,  -424,  -424,  -424,  -424,
+     299,  -424,  -424,   -68,  -424,   465,  -424,  -424,  -424,   203,
+    -424,  -424,  -424,     3,  -424,  -424,  -424,  -424,  -424,  -424,
+    -424,  -424,  -424,  -424,  -424,  -424,  -424,  -424,  -424,  -424,
+    -424,   339,  -424,  -424,  -424,  -424,  -424,   397,  -424,   415,
+    -424,  -424,  -424,  -424,  -424,  -424,  -330,  -424,  -424,  -424,
+    -424,  -424,  -424,  -424,  -424,  -424,  -424,  -424,  -424,  -424,
+    -424,  -424,   343,   348,  -424,   -63,  -424,  -424,  -423,  -424,
+    -424,  -424,  -424,  -424,  -214,  -424,  -424,  -424,  -424,  -424,
+    -424,  -424,  -424,  -424,  -424,    89,  -226,  -424,    43,  -292,
+    -329,  -424,   170,   236,  -424,  -424,  -424,   292,   297,  -128,
+     331,  -424,   395,  -424,   286,  -219,   -47,   -38,  -164,  -424,
+    -424,  -424,   403,   478,  -424,  -116
 };
 
 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
    positive, shift that token.  If negative, reduce the rule which
    number is the opposite.  If zero, do what YYDEFACT says.
    If YYTABLE_NINF, syntax error.  */
-#define YYTABLE_NINF -261
+#define YYTABLE_NINF -262
 static const yytype_int16 yytable[] =
 {
-      79,    96,   152,   227,   141,   382,   187,     3,     4,   385,
-     269,   464,   356,   357,   358,   359,   440,     2,   432,   436,
-     200,   510,   513,   515,   -42,   188,   380,   441,   209,   437,
-      21,   205,   527,    91,   280,     5,   380,   173,   174,   142,
-     304,    52,    22,    57,   449,  -260,   209,   143,   204,    92,
-       3,     4,    62,   126,    23,   152,   162,   163,   164,   165,
-      79,   323,   -23,   -21,   326,   327,   528,   160,    24,   453,
-     453,   161,   -84,    57,   205,   223,   196,   197,  -164,   529,
-     189,   381,    62,  -164,   310,  -164,  -164,  -164,   511,   514,
-     516,   431,   433,   442,   438,   360,   266,    93,   363,   450,
-     351,   366,  -164,  -164,  -164,   467,    28,     8,  -164,   268,
-     206,   281,    53,   166,   -46,   -83,    30,   167,   207,   208,
-     152,    54,   482,   542,   454,   531,   488,   342,   168,    55,
-      56,   311,   312,   313,   314,   315,   316,  -164,  -164,  -164,
-    -164,    31,   422,    79,   354,   424,   317,   483,  -164,    33,
-       2,   484,  -164,   206,  -164,   502,    40,   503,    34,   335,
-      41,   207,   208,    42,    43,   469,   157,   276,     5,   158,
-     277,   470,   471,    35,    52,    53,   340,   352,  -164,  -164,
-    -164,  -164,  -164,  -164,   460,   521,  -164,   461,   522,  -164,
-    -164,  -164,    36,   271,   273,   274,   371,   372,    39,  -164,
-     335,   145,   147,   462,    51,   463,    66,    67,   541,    85,
-     -23,    68,    69,    70,    71,    88,    72,   152,    68,    69,
-      70,    71,   245,    72,    77,    90,   343,    74,    75,   344,
-     345,    77,   309,    53,   320,    46,    47,    48,    49,    97,
-       8,   346,   347,   348,   349,    53,    98,   -47,   457,   123,
-     124,   444,   335,   129,    54,   125,     1,   139,     2,     3,
-       4,   127,    55,    56,   130,   132,   148,   353,   171,   355,
-     230,   133,   231,   232,   233,   134,     5,   135,     6,   136,
-     137,   364,     7,   138,   367,    73,    74,    75,    76,   234,
-     235,   236,   172,   176,   490,   237,   177,   178,   386,   390,
-      68,    69,    70,    71,   179,    72,   182,   183,   332,   194,
-     465,   466,   394,    77,   219,   184,   185,   186,   190,   281,
-     220,   198,   202,   540,   238,   239,   240,   241,   191,   218,
-     192,   193,   216,   228,   270,   242,   221,   229,   267,   243,
-     288,   244,   283,   499,   284,   285,   289,   324,     8,   272,
-     504,   325,   304,   328,     9,   362,   337,   365,   368,   373,
-     379,   420,    10,   374,  -258,    68,    69,    70,    71,   245,
-      72,  -259,   421,   246,   392,   423,   247,   248,    77,   425,
-     428,   458,   426,   448,   452,   429,   249,   430,    68,    69,
-      70,    71,   447,    72,   386,   468,   445,   455,   456,   474,
-     538,    77,   473,   476,   475,   459,   477,   478,   495,   501,
-     480,   386,   491,   493,   486,   386,   494,   489,   505,   507,
-     506,   492,   508,   509,   512,    68,    69,    70,    71,   518,
-      72,   496,   497,    73,    74,    75,    76,   532,    77,   533,
-      68,    69,    70,    71,   534,    72,   535,   536,    73,    74,
-      75,    76,   539,    77,    89,   391,    32,   250,    68,    69,
-      70,    71,   245,    72,   140,   203,   246,   390,   520,   247,
-     523,    77,   149,   524,   395,   479,   525,   519,   526,   446,
-     396,   397,   222,   321,   201,   224,   398,   399,   400,   401,
-     402,   403,   404,   375,   322,   199,   286,   341,   405,   406,
-     407,   408,   291,   292,   293,   294,   295,   296,   297,   298,
-       0,   299,   300,   301,   302,   303,    68,    69,    70,    71,
-     142,    72,   131,     0,    73,    74,    75,    76,   143,    77,
-       0,     0,     0,     0,     0,   150,    99,   100,   101,   102,
-     103,   104,   105,   106,   107,   108,   109,     0,   110,   111,
-     112,     0,   409,     0,   410,     0,     0,     0,     0,     0,
-     411,   412,   413,   414,   415,   416,   417,   418,    68,    69,
-      70,    71,   142,    72,     0,     0,    73,    74,    75,    76,
-     143,    77,     0,    68,    69,    70,    71,   304,    72,   305,
-     306,    73,    74,    75,    76,     0,    77,    68,    69,    70,
-      71,    40,    72,     0,     0,   338,     0,     0,   339,    43,
-      77,    68,    69,    70,    71,     0,    72,     0,     0,   383,
-      74,    75,    76,     0,    77,    68,    69,    70,    71,     0,
-      72,     0,     0,   387,    74,    75,    76,     0,    77,    68,
-      69,    70,    71,     0,    72,     0,     0,   481,    74,    75,
-      76,     0,    77,    68,    69,    70,    71,     0,    72,     0,
-       0,   487,    74,    75,    76,     0,    77,    68,    69,    70,
-      71,     0,    72,     0,     0,   498,     0,     0,     0,     0,
-      77
+      79,    96,   152,   227,   187,   383,   465,   141,   188,   223,
+     433,   269,  -165,   280,   512,   441,   515,  -165,   200,  -165,
+    -165,  -165,   356,   357,   358,   359,   442,    21,    57,   360,
+     517,   437,    62,   381,   209,   342,   381,  -165,  -165,  -165,
+     470,   438,   142,  -165,   386,   450,   471,   472,   454,   454,
+     143,    23,   209,   126,   204,   152,     3,     4,    57,    22,
+      79,   323,    62,   189,   326,   327,    24,     3,     4,   173,
+     174,   -42,  -165,  -165,  -165,  -165,     2,   145,   147,   351,
+      91,   205,   513,  -165,   516,   434,    30,  -165,   382,  -165,
+     160,   432,   205,   443,   161,     5,   266,    92,   518,   364,
+     451,    52,   367,   455,   533,    28,   361,   439,   196,   197,
+      53,   281,   268,  -165,  -165,  -165,  -165,  -165,  -165,   544,
+     152,  -165,   -83,   529,  -165,  -165,  -165,    68,    69,    70,
+      71,   245,    72,   -84,  -165,   343,    74,    75,   344,   345,
+      77,   468,   354,    79,   423,    93,   504,   425,   505,   304,
+     346,   347,   348,   349,  -261,   -23,   -21,   530,   483,   335,
+     206,   157,   490,    31,   158,    34,     2,     8,   207,   208,
+     531,   206,    53,    33,   -46,    35,   340,   352,   484,   207,
+     208,    54,   485,    36,   276,     5,   486,   277,    39,    55,
+      56,    52,    51,   271,   273,   274,   372,   373,   461,   523,
+     335,   462,   524,    66,    40,   463,    67,   464,    41,    85,
+     543,    42,    43,   162,   163,   164,   165,   152,    46,    47,
+      48,    49,   -23,     1,    88,     2,     3,     4,    73,    74,
+      75,    76,   309,    90,   320,    53,    97,    98,   310,   230,
+     123,   231,   232,   233,     5,   124,     6,   458,   125,   127,
+       7,   130,   445,   335,   129,   139,   132,     8,   133,   234,
+     235,   236,    53,   134,   -47,   237,   270,   353,   135,   355,
+     166,    54,   136,   137,   167,   138,   148,   171,   172,    55,
+      56,   365,   176,   272,   368,   168,   311,   312,   313,   314,
+     315,   316,   178,   492,   238,   239,   240,   241,   387,   391,
+     177,   317,   179,   182,   194,   242,   183,   184,   185,   243,
+     186,   244,   395,   190,   466,   467,     8,   191,   192,   193,
+     281,   198,     9,   202,   216,   542,   218,   219,   220,   221,
+      10,   228,   229,   267,   283,    68,    69,    70,    71,   245,
+      72,   284,   285,   246,   501,   289,   247,   248,    77,   288,
+     324,   506,    68,    69,    70,    71,   249,    72,    68,    69,
+      70,    71,   325,    72,   304,    77,    73,    74,    75,    76,
+     328,    77,   337,   363,   366,    68,    69,    70,    71,   380,
+      72,   369,   459,    73,    74,    75,    76,  -259,    77,   374,
+     375,  -260,   393,   421,   424,   387,   469,   422,   426,   427,
+     475,   429,   540,   449,   477,   430,   474,   431,   448,   453,
+     503,   481,   387,   396,   456,   488,   387,   457,   491,   397,
+     398,   476,   494,   478,   460,   399,   400,   401,   402,   403,
+     404,   405,   498,   499,   479,   493,   495,   406,   407,   408,
+     409,   291,   292,   293,   294,   295,   296,   297,   298,   496,
+     299,   300,   301,   302,   303,    68,    69,    70,    71,   142,
+      72,   497,   507,    73,    74,    75,    76,   143,    77,   391,
+     522,   508,   525,   509,   150,   526,   510,   511,   527,   514,
+     528,   520,   534,   535,    68,    69,    70,    71,    40,    72,
+     536,   410,   338,   411,   537,   339,    43,    77,   538,   412,
+     413,   414,   415,   416,   417,   418,   419,    99,   100,   101,
+     102,   103,   104,   105,   106,   107,   108,   109,   541,   110,
+     111,   112,    32,   250,    89,   149,   304,   203,   305,   306,
+      68,    69,    70,    71,   142,    72,   140,   480,    73,    74,
+      75,    76,   143,    77,    68,    69,    70,    71,   392,    72,
+     521,   447,    73,    74,    75,    76,   222,    77,    68,    69,
+      70,    71,   224,    72,   376,   321,   384,    74,    75,    76,
+     322,    77,    68,    69,    70,    71,   131,    72,   201,   286,
+     388,    74,    75,    76,   199,    77,    68,    69,    70,    71,
+     341,    72,     0,     0,   482,    74,    75,    76,     0,    77,
+      68,    69,    70,    71,     0,    72,     0,     0,   489,    74,
+      75,    76,     0,    77,    68,    69,    70,    71,   245,    72,
+       0,     0,   246,     0,     0,   247,     0,    77,    68,    69,
+      70,    71,     0,    72,     0,     0,   332,    68,    69,    70,
+      71,    77,    72,     0,     0,   446,    68,    69,    70,    71,
+      77,    72,     0,     0,   500,     0,     0,     0,     0,    77
 };
 
 static const yytype_int16 yycheck[] =
 {
-      38,    64,   130,   217,   123,   335,   168,     7,     8,   336,
-     230,   428,    17,    18,    19,    20,     4,     6,    10,     4,
-     182,     4,     4,     4,     4,    71,    71,    15,   195,    14,
-     112,    31,    28,    13,   239,    24,    71,   137,   138,   108,
-     120,    30,   113,    29,    71,   125,   213,   116,     5,    29,
-       7,     8,    29,    91,   112,   183,    51,    52,    53,    54,
-      98,   275,   112,   113,   278,   279,    62,   108,   123,    71,
-      71,   112,    72,    59,    31,     1,   176,   177,     4,    75,
-     126,   126,    59,     9,     9,    11,    12,    13,    71,    71,
-      71,   126,    84,    81,    79,   100,   224,    77,   318,   126,
-     305,   321,    28,    29,    30,   432,   112,    96,    34,   228,
-     110,   239,   101,   108,   103,    72,     4,   112,   118,   119,
-     248,   110,   449,   540,   126,   126,   453,    13,   123,   118,
-     119,    56,    57,    58,    59,    60,    61,    63,    64,    65,
-      66,     0,   362,   181,   306,   365,    71,    16,    74,     4,
-       6,    20,    78,   110,    80,   474,   108,   476,    71,   287,
-     112,   118,   119,   115,   116,    76,   112,   112,    24,   115,
-     115,    82,    83,     4,    30,   101,   304,   305,   104,   105,
-     106,   107,   108,   109,   112,   112,   112,   115,   115,   115,
-     116,   117,   124,   231,   232,   233,   324,   325,     4,   125,
-     328,   124,   125,   423,     4,   425,   112,   124,   538,   108,
-     112,   104,   105,   106,   107,     4,   109,   345,   104,   105,
-     106,   107,   108,   109,   117,   103,   112,   113,   114,   115,
-     116,   117,   270,   101,   272,    51,    52,    53,    54,     4,
-      96,   127,   128,   129,   130,   101,   137,   103,   410,   122,
-     113,   379,   380,     4,   110,   112,     4,     4,     6,     7,
-       8,   112,   118,   119,   116,   125,    71,   305,   112,   307,
-       9,   125,    11,    12,    13,   125,    24,   125,    26,   125,
-     125,   319,    30,   125,   322,   112,   113,   114,   115,    28,
-      29,    30,   112,   122,   456,    34,   122,   109,   336,   337,
-     104,   105,   106,   107,   101,   109,   123,    71,   112,     4,
-     429,   430,   350,   117,     4,   126,   126,   126,   126,   447,
-       4,   124,   124,   537,    63,    64,    65,    66,   126,   112,
-     126,   126,   124,    71,    13,    74,    72,     4,   108,    78,
-     125,    80,     4,   471,     4,     4,     4,    71,    96,    13,
-     478,    71,   120,   125,   102,     9,   125,     9,   108,   108,
-      21,   124,   110,   108,   125,   104,   105,   106,   107,   108,
-     109,   125,   125,   112,   108,     9,   115,   116,   117,     9,
-      71,   419,   100,    21,    21,   122,   125,   122,   104,   105,
-     106,   107,   122,   109,   432,   433,   112,    21,   123,   437,
-     528,   117,     4,   441,     4,   122,     4,    21,     4,   472,
-     448,   449,   124,   126,   452,   453,   126,   455,   125,   125,
-      21,   459,    21,   124,     4,   104,   105,   106,   107,     4,
-     109,   469,   470,   112,   113,   114,   115,   126,   117,   126,
-     104,   105,   106,   107,     4,   109,     4,     4,   112,   113,
-     114,   115,     4,   117,    59,   345,    12,   224,   104,   105,
-     106,   107,   108,   109,   121,   188,   112,   505,   506,   115,
-     508,   117,   128,   511,    43,   447,   514,   505,   516,   380,
-      49,    50,   213,   273,   183,   214,    55,    56,    57,    58,
-      59,    60,    61,   328,   273,   181,   248,   304,    67,    68,
-      69,    70,    35,    36,    37,    38,    39,    40,    41,    42,
-      -1,    44,    45,    46,    47,    48,   104,   105,   106,   107,
-     108,   109,    98,    -1,   112,   113,   114,   115,   116,   117,
-      -1,    -1,    -1,    -1,    -1,   123,    85,    86,    87,    88,
-      89,    90,    91,    92,    93,    94,    95,    -1,    97,    98,
-      99,    -1,   121,    -1,   123,    -1,    -1,    -1,    -1,    -1,
-     129,   130,   131,   132,   133,   134,   135,   136,   104,   105,
-     106,   107,   108,   109,    -1,    -1,   112,   113,   114,   115,
-     116,   117,    -1,   104,   105,   106,   107,   120,   109,   122,
-     123,   112,   113,   114,   115,    -1,   117,   104,   105,   106,
-     107,   108,   109,    -1,    -1,   112,    -1,    -1,   115,   116,
-     117,   104,   105,   106,   107,    -1,   109,    -1,    -1,   112,
-     113,   114,   115,    -1,   117,   104,   105,   106,   107,    -1,
-     109,    -1,    -1,   112,   113,   114,   115,    -1,   117,   104,
-     105,   106,   107,    -1,   109,    -1,    -1,   112,   113,   114,
-     115,    -1,   117,   104,   105,   106,   107,    -1,   109,    -1,
-      -1,   112,   113,   114,   115,    -1,   117,   104,   105,   106,
-     107,    -1,   109,    -1,    -1,   112,    -1,    -1,    -1,    -1,
-     117
+      38,    64,   130,   217,   168,   335,   429,   123,    72,     1,
+      10,   230,     4,   239,     4,     4,     4,     9,   182,    11,
+      12,    13,    17,    18,    19,    20,    15,   113,    29,    24,
+       4,     4,    29,    72,   195,    13,    72,    29,    30,    31,
+      77,    14,   109,    35,   336,    72,    83,    84,    72,    72,
+     117,   113,   213,    91,     5,   183,     7,     8,    59,   114,
+      98,   275,    59,   127,   278,   279,   124,     7,     8,   137,
+     138,     4,    64,    65,    66,    67,     6,   124,   125,   305,
+      13,    32,    72,    75,    72,    85,     4,    79,   127,    81,
+     109,   127,    32,    82,   113,    25,   224,    30,    72,   318,
+     127,    31,   321,   127,   127,   113,   101,    80,   176,   177,
+     102,   239,   228,   105,   106,   107,   108,   109,   110,   542,
+     248,   113,    73,    29,   116,   117,   118,   105,   106,   107,
+     108,   109,   110,    73,   126,   113,   114,   115,   116,   117,
+     118,   433,   306,   181,   363,    78,   475,   366,   477,   121,
+     128,   129,   130,   131,   126,   113,   114,    63,   450,   287,
+     111,   113,   454,     0,   116,    72,     6,    97,   119,   120,
+      76,   111,   102,     4,   104,     4,   304,   305,    16,   119,
+     120,   111,    20,   125,   113,    25,    24,   116,     4,   119,
+     120,    31,     4,   231,   232,   233,   324,   325,   113,   113,
+     328,   116,   116,   113,   109,   424,   125,   426,   113,   109,
+     540,   116,   117,    52,    53,    54,    55,   345,    52,    53,
+      54,    55,   113,     4,     4,     6,     7,     8,   113,   114,
+     115,   116,   270,   104,   272,   102,     4,   138,     9,     9,
+     123,    11,    12,    13,    25,   114,    27,   411,   113,   113,
+      31,   117,   380,   381,     4,     4,   126,    97,   126,    29,
+      30,    31,   102,   126,   104,    35,    13,   305,   126,   307,
+     109,   111,   126,   126,   113,   126,    72,   113,   113,   119,
+     120,   319,   123,    13,   322,   124,    57,    58,    59,    60,
+      61,    62,   110,   457,    64,    65,    66,    67,   336,   337,
+     123,    72,   102,   124,     4,    75,    72,   127,   127,    79,
+     127,    81,   350,   127,   430,   431,    97,   127,   127,   127,
+     448,   125,   103,   125,   125,   539,   113,     4,     4,    73,
+     111,    72,     4,   109,     4,   105,   106,   107,   108,   109,
+     110,     4,     4,   113,   472,     4,   116,   117,   118,   126,
+      72,   479,   105,   106,   107,   108,   126,   110,   105,   106,
+     107,   108,    72,   110,   121,   118,   113,   114,   115,   116,
+     126,   118,   126,     9,     9,   105,   106,   107,   108,    21,
+     110,   109,   420,   113,   114,   115,   116,   126,   118,   109,
+     109,   126,   109,   125,     9,   433,   434,   126,     9,   101,
+     438,    72,   530,    21,   442,   123,     4,   123,   123,    21,
+     473,   449,   450,    44,    21,   453,   454,   124,   456,    50,
+      51,     4,   460,     4,   123,    56,    57,    58,    59,    60,
+      61,    62,   470,   471,    21,   125,   127,    68,    69,    70,
+      71,    36,    37,    38,    39,    40,    41,    42,    43,   127,
+      45,    46,    47,    48,    49,   105,   106,   107,   108,   109,
+     110,     4,   126,   113,   114,   115,   116,   117,   118,   507,
+     508,    21,   510,   126,   124,   513,    21,   125,   516,     4,
+     518,     4,   127,   127,   105,   106,   107,   108,   109,   110,
+       4,   122,   113,   124,     4,   116,   117,   118,     4,   130,
+     131,   132,   133,   134,   135,   136,   137,    86,    87,    88,
+      89,    90,    91,    92,    93,    94,    95,    96,     4,    98,
+      99,   100,    12,   224,    59,   128,   121,   188,   123,   124,
+     105,   106,   107,   108,   109,   110,   121,   448,   113,   114,
+     115,   116,   117,   118,   105,   106,   107,   108,   345,   110,
+     507,   381,   113,   114,   115,   116,   213,   118,   105,   106,
+     107,   108,   214,   110,   328,   273,   113,   114,   115,   116,
+     273,   118,   105,   106,   107,   108,    98,   110,   183,   248,
+     113,   114,   115,   116,   181,   118,   105,   106,   107,   108,
+     304,   110,    -1,    -1,   113,   114,   115,   116,    -1,   118,
+     105,   106,   107,   108,    -1,   110,    -1,    -1,   113,   114,
+     115,   116,    -1,   118,   105,   106,   107,   108,   109,   110,
+      -1,    -1,   113,    -1,    -1,   116,    -1,   118,   105,   106,
+     107,   108,    -1,   110,    -1,    -1,   113,   105,   106,   107,
+     108,   118,   110,    -1,    -1,   113,   105,   106,   107,   108,
+     118,   110,    -1,    -1,   113,    -1,    -1,    -1,    -1,   118
 };
 
 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
    symbol of state STATE-NUM.  */
 static const yytype_uint16 yystos[] =
 {
-       0,     4,     6,     7,     8,    24,    26,    30,    96,   102,
-     110,   139,   140,   141,   142,   143,   145,   146,   158,   161,
-     163,   112,   113,   112,   123,   162,   164,   147,   112,   159,
-       4,     0,   141,     4,    71,     4,   124,   256,   257,     4,
-     108,   112,   115,   116,   251,   252,    51,    52,    53,    54,
-     222,     4,    30,   101,   110,   118,   119,   142,   148,   152,
-     153,   160,   161,   211,   212,   213,   112,   124,   104,   105,
-     106,   107,   109,   112,   113,   114,   115,   117,   247,   255,
-     260,   261,   262,   263,   165,   108,   149,   150,     4,   153,
-     103,    13,    29,    77,   154,   155,   213,     4,   137,    85,
-      86,    87,    88,    89,    90,    91,    92,    93,    94,    95,
-      97,    98,    99,   171,   172,   173,   174,   175,   176,   177,
-     185,   186,   187,   122,   113,   112,   255,   112,   156,     4,
-     116,   261,   125,   125,   125,   125,   125,   125,   125,     4,
-     187,   263,   108,   116,   253,   254,   255,   254,    71,   185,
-     123,   157,   247,   248,   249,   250,   254,   112,   115,   151,
-     108,   112,    51,    52,    53,    54,   108,   112,   123,   178,
-     179,   112,   112,   151,   151,   166,   122,   122,   109,   101,
-     258,   259,   123,    71,   126,   126,   126,   256,    71,   126,
-     126,   126,   126,   126,     4,   167,   151,   151,   124,   260,
-     256,   250,   124,   179,     5,    31,   110,   118,   119,   143,
-     144,   168,   180,   208,   209,   210,   124,   169,   112,     4,
-       4,    72,   210,     1,   211,   214,   170,   222,    71,     4,
-       9,    11,    12,    13,    28,    29,    30,    34,    63,    64,
-      65,    66,    74,    78,    80,   108,   112,   115,   116,   125,
-     148,   181,   196,   198,   204,   206,   218,   224,   228,   230,
-     232,   233,   234,   242,   243,   244,   247,   108,   263,   253,
-      13,   255,    13,   255,   255,   219,   112,   115,   220,   221,
-     234,   247,   229,     4,     4,     4,   248,   225,   125,     4,
-     235,    35,    36,    37,    38,    39,    40,    41,    42,    44,
-      45,    46,    47,    48,   120,   122,   123,   231,   194,   255,
-       9,    56,    57,    58,    59,    60,    61,    71,   245,   246,
-     255,   245,   246,   222,    71,    71,   222,   222,   125,   182,
-     197,   199,   112,   240,   241,   247,   205,   125,   112,   115,
-     247,   252,    13,   112,   115,   116,   127,   128,   129,   130,
-     226,   234,   247,   255,   256,   255,    17,    18,    19,    20,
-     100,   195,     9,   253,   255,     9,   253,   255,   108,   215,
-     216,   247,   247,   108,   108,   241,   189,   200,   201,    21,
-      71,   126,   194,   112,   207,   237,   255,   112,   236,   237,
-     255,   157,   108,   223,   255,    43,    49,    50,    55,    56,
-      57,    58,    59,    60,    61,    67,    68,    69,    70,   121,
-     123,   129,   130,   131,   132,   133,   134,   135,   136,   227,
-     124,   125,   253,     9,   253,     9,   100,   217,    71,   122,
-     122,   126,    10,    84,   184,   190,     4,    14,    79,   202,
-       4,    15,    81,   203,   247,   112,   240,   122,    21,    71,
-     126,   238,    21,    71,   126,    21,   123,   256,   255,   122,
-     112,   115,   253,   253,   216,   263,   263,   237,   255,    76,
-      82,    83,   188,     4,   255,     4,   255,     4,    21,   233,
-     255,   112,   237,    16,    20,   239,   255,   112,   237,   255,
-     256,   124,   255,   126,   126,     4,   255,   255,   112,   247,
-     183,   213,   238,   238,   247,   125,    21,   125,    21,   124,
-       4,    71,     4,     4,    71,     4,    71,   191,     4,   236,
-     255,   112,   115,   255,   255,   255,   255,    28,    62,    75,
-     192,   126,   126,   126,     4,     4,     4,   193,   247,     4,
-     222,   194,   216
+       0,     4,     6,     7,     8,    25,    27,    31,    97,   103,
+     111,   140,   141,   142,   143,   144,   146,   147,   159,   162,
+     164,   113,   114,   113,   124,   163,   165,   148,   113,   160,
+       4,     0,   142,     4,    72,     4,   125,   257,   258,     4,
+     109,   113,   116,   117,   252,   253,    52,    53,    54,    55,
+     223,     4,    31,   102,   111,   119,   120,   143,   149,   153,
+     154,   161,   162,   212,   213,   214,   113,   125,   105,   106,
+     107,   108,   110,   113,   114,   115,   116,   118,   248,   256,
+     261,   262,   263,   264,   166,   109,   150,   151,     4,   154,
+     104,    13,    30,    78,   155,   156,   214,     4,   138,    86,
+      87,    88,    89,    90,    91,    92,    93,    94,    95,    96,
+      98,    99,   100,   172,   173,   174,   175,   176,   177,   178,
+     186,   187,   188,   123,   114,   113,   256,   113,   157,     4,
+     117,   262,   126,   126,   126,   126,   126,   126,   126,     4,
+     188,   264,   109,   117,   254,   255,   256,   255,    72,   186,
+     124,   158,   248,   249,   250,   251,   255,   113,   116,   152,
+     109,   113,    52,    53,    54,    55,   109,   113,   124,   179,
+     180,   113,   113,   152,   152,   167,   123,   123,   110,   102,
+     259,   260,   124,    72,   127,   127,   127,   257,    72,   127,
+     127,   127,   127,   127,     4,   168,   152,   152,   125,   261,
+     257,   251,   125,   180,     5,    32,   111,   119,   120,   144,
+     145,   169,   181,   209,   210,   211,   125,   170,   113,     4,
+       4,    73,   211,     1,   212,   215,   171,   223,    72,     4,
+       9,    11,    12,    13,    29,    30,    31,    35,    64,    65,
+      66,    67,    75,    79,    81,   109,   113,   116,   117,   126,
+     149,   182,   197,   199,   205,   207,   219,   225,   229,   231,
+     233,   234,   235,   243,   244,   245,   248,   109,   264,   254,
+      13,   256,    13,   256,   256,   220,   113,   116,   221,   222,
+     235,   248,   230,     4,     4,     4,   249,   226,   126,     4,
+     236,    36,    37,    38,    39,    40,    41,    42,    43,    45,
+      46,    47,    48,    49,   121,   123,   124,   232,   195,   256,
+       9,    57,    58,    59,    60,    61,    62,    72,   246,   247,
+     256,   246,   247,   223,    72,    72,   223,   223,   126,   183,
+     198,   200,   113,   241,   242,   248,   206,   126,   113,   116,
+     248,   253,    13,   113,   116,   117,   128,   129,   130,   131,
+     227,   235,   248,   256,   257,   256,    17,    18,    19,    20,
+      24,   101,   196,     9,   254,   256,     9,   254,   256,   109,
+     216,   217,   248,   248,   109,   109,   242,   190,   201,   202,
+      21,    72,   127,   195,   113,   208,   238,   256,   113,   237,
+     238,   256,   158,   109,   224,   256,    44,    50,    51,    56,
+      57,    58,    59,    60,    61,    62,    68,    69,    70,    71,
+     122,   124,   130,   131,   132,   133,   134,   135,   136,   137,
+     228,   125,   126,   254,     9,   254,     9,   101,   218,    72,
+     123,   123,   127,    10,    85,   185,   191,     4,    14,    80,
+     203,     4,    15,    82,   204,   248,   113,   241,   123,    21,
+      72,   127,   239,    21,    72,   127,    21,   124,   257,   256,
+     123,   113,   116,   254,   254,   217,   264,   264,   238,   256,
+      77,    83,    84,   189,     4,   256,     4,   256,     4,    21,
+     234,   256,   113,   238,    16,    20,    24,   240,   256,   113,
+     238,   256,   257,   125,   256,   127,   127,     4,   256,   256,
+     113,   248,   184,   214,   239,   239,   248,   126,    21,   126,
+      21,   125,     4,    72,     4,     4,    72,     4,    72,   192,
+       4,   237,   256,   113,   116,   256,   256,   256,   256,    29,
+      63,    76,   193,   127,   127,   127,     4,     4,     4,   194,
+     248,     4,   223,   195,   217
 };
 
 #define yyerrok		(yyerrstatus = 0)
@@ -2582,17 +2605,20 @@
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 static void
-yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
+yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
 #else
 static void
-yy_stack_print (bottom, top)
-    yytype_int16 *bottom;
-    yytype_int16 *top;
+yy_stack_print (yybottom, yytop)
+    yytype_int16 *yybottom;
+    yytype_int16 *yytop;
 #endif
 {
   YYFPRINTF (stderr, "Stack now");
-  for (; bottom <= top; ++bottom)
-    YYFPRINTF (stderr, " %d", *bottom);
+  for (; yybottom <= yytop; yybottom++)
+    {
+      int yybot = *yybottom;
+      YYFPRINTF (stderr, " %d", yybot);
+    }
   YYFPRINTF (stderr, "\n");
 }
 
@@ -2628,11 +2654,11 @@
   /* The symbols being reduced.  */
   for (yyi = 0; yyi < yynrhs; yyi++)
     {
-      fprintf (stderr, "   $%d = ", yyi + 1);
+      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
 		       &(yyvsp[(yyi + 1) - (yynrhs)])
 		       		       , yyscanner, interp);
-      fprintf (stderr, "\n");
+      YYFPRINTF (stderr, "\n");
     }
 }
 
@@ -2916,10 +2942,8 @@
 	break;
     }
 }
-
 
 /* Prevent warnings from -Wmissing-prototypes.  */
-
 #ifdef YYPARSE_PARAM
 #if defined __STDC__ || defined __cplusplus
 int yyparse (void *YYPARSE_PARAM);
@@ -2938,10 +2962,9 @@
 
 
 
-
-/*----------.
-| yyparse.  |
-`----------*/
+/*-------------------------.
+| yyparse or yypush_parse.  |
+`-------------------------*/
 
 #ifdef YYPARSE_PARAM
 #if (defined __STDC__ || defined __C99__FUNC__ \
@@ -2966,22 +2989,46 @@
 #endif
 #endif
 {
-  /* The look-ahead symbol.  */
+/* The lookahead symbol.  */
 int yychar;
 
-/* The semantic value of the look-ahead symbol.  */
+/* The semantic value of the lookahead symbol.  */
 YYSTYPE yylval;
 
-/* Number of syntax errors so far.  */
-int yynerrs;
+    /* Number of syntax errors so far.  */
+    int yynerrs;
+
+    int yystate;
+    /* Number of tokens to shift before error messages enabled.  */
+    int yyerrstatus;
+
+    /* The stacks and their tools:
+       `yyss': related to states.
+       `yyvs': related to semantic values.
+
+       Refer to the stacks thru separate pointers, to allow yyoverflow
+       to reallocate them elsewhere.  */
+
+    /* The state stack.  */
+    yytype_int16 yyssa[YYINITDEPTH];
+    yytype_int16 *yyss;
+    yytype_int16 *yyssp;
+
+    /* The semantic value stack.  */
+    YYSTYPE yyvsa[YYINITDEPTH];
+    YYSTYPE *yyvs;
+    YYSTYPE *yyvsp;
+
+    YYSIZE_T yystacksize;
 
-  int yystate;
   int yyn;
   int yyresult;
-  /* Number of tokens to shift before error messages enabled.  */
-  int yyerrstatus;
-  /* Look-ahead token as an internal (translated) token number.  */
-  int yytoken = 0;
+  /* Lookahead token as an internal (translated) token number.  */
+  int yytoken;
+  /* The variables used to return semantic value and location from the
+     action routines.  */
+  YYSTYPE yyval;
+
 #if YYERROR_VERBOSE
   /* Buffer for error messages, and its allocated size.  */
   char yymsgbuf[128];
@@ -2989,51 +3036,28 @@
   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
 #endif
 
-  /* Three stacks and their tools:
-     `yyss': related to states,
-     `yyvs': related to semantic values,
-     `yyls': related to locations.
-
-     Refer to the stacks thru separate pointers, to allow yyoverflow
-     to reallocate them elsewhere.  */
-
-  /* The state stack.  */
-  yytype_int16 yyssa[YYINITDEPTH];
-  yytype_int16 *yyss = yyssa;
-  yytype_int16 *yyssp;
-
-  /* The semantic value stack.  */
-  YYSTYPE yyvsa[YYINITDEPTH];
-  YYSTYPE *yyvs = yyvsa;
-  YYSTYPE *yyvsp;
-
-
-
 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
 
-  YYSIZE_T yystacksize = YYINITDEPTH;
-
-  /* The variables used to return semantic value and location from the
-     action routines.  */
-  YYSTYPE yyval;
-
-
   /* The number of symbols on the RHS of the reduced rule.
      Keep to zero when no symbol should be popped.  */
   int yylen = 0;
 
+  yytoken = 0;
+  yyss = yyssa;
+  yyvs = yyvsa;
+  yystacksize = YYINITDEPTH;
+
   YYDPRINTF ((stderr, "Starting parse\n"));
 
   yystate = 0;
   yyerrstatus = 0;
   yynerrs = 0;
-  yychar = YYEMPTY;		/* Cause a token to be read.  */
+  yychar = YYEMPTY; /* Cause a token to be read.  */
 
   /* Initialize stack pointers.
      Waste one element of value and location stack
      so that they stay on the same level as the state stack.
      The wasted elements are never initialized.  */
-
   yyssp = yyss;
   yyvsp = yyvs;
 
@@ -3063,7 +3087,6 @@
 	YYSTYPE *yyvs1 = yyvs;
 	yytype_int16 *yyss1 = yyss;
 
-
 	/* Each stack pointer address is followed by the size of the
 	   data in use in that stack, in bytes.  This used to be a
 	   conditional around just the two extra args, but that might
@@ -3071,7 +3094,6 @@
 	yyoverflow (YY_("memory exhausted"),
 		    &yyss1, yysize * sizeof (*yyssp),
 		    &yyvs1, yysize * sizeof (*yyvsp),
-
 		    &yystacksize);
 
 	yyss = yyss1;
@@ -3094,9 +3116,8 @@
 	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
 	if (! yyptr)
 	  goto yyexhaustedlab;
-	YYSTACK_RELOCATE (yyss);
-	YYSTACK_RELOCATE (yyvs);
-
+	YYSTACK_RELOCATE (yyss_alloc, yyss);
+	YYSTACK_RELOCATE (yyvs_alloc, yyvs);
 #  undef YYSTACK_RELOCATE
 	if (yyss1 != yyssa)
 	  YYSTACK_FREE (yyss1);
@@ -3107,7 +3128,6 @@
       yyssp = yyss + yysize - 1;
       yyvsp = yyvs + yysize - 1;
 
-
       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
 		  (unsigned long int) yystacksize));
 
@@ -3117,6 +3137,9 @@
 
   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
 
+  if (yystate == YYFINAL)
+    YYACCEPT;
+
   goto yybackup;
 
 /*-----------.
@@ -3125,16 +3148,16 @@
 yybackup:
 
   /* Do appropriate processing given the current state.  Read a
-     look-ahead token if we need one and don't already have one.  */
+     lookahead token if we need one and don't already have one.  */
 
-  /* First try to decide what to do without reference to look-ahead token.  */
+  /* First try to decide what to do without reference to lookahead token.  */
   yyn = yypact[yystate];
   if (yyn == YYPACT_NINF)
     goto yydefault;
 
-  /* Not known => get a look-ahead token if don't already have one.  */
+  /* Not known => get a lookahead token if don't already have one.  */
 
-  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
+  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
   if (yychar == YYEMPTY)
     {
       YYDPRINTF ((stderr, "Reading a token: "));
@@ -3166,20 +3189,16 @@
       goto yyreduce;
     }
 
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
   /* Count tokens shifted since error; after three, turn off error
      status.  */
   if (yyerrstatus)
     yyerrstatus--;
 
-  /* Shift the look-ahead token.  */
+  /* Shift the lookahead token.  */
   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
 
-  /* Discard the shifted token unless it is eof.  */
-  if (yychar != YYEOF)
-    yychar = YYEMPTY;
+  /* Discard the shifted token.  */
+  yychar = YYEMPTY;
 
   yystate = yyn;
   *++yyvsp = yylval;
@@ -3219,257 +3238,333 @@
   switch (yyn)
     {
         case 2:
-#line 1143 "compilers/imcc/imcc.y"
-    { if (yynerrs) YYABORT; (yyval.i) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1154 "compilers/imcc/imcc.y"
+    { if (yynerrs) YYABORT; (yyval.i) = 0; }
     break;
 
   case 5:
-#line 1152 "compilers/imcc/imcc.y"
-    { (yyval.i) = (yyvsp[(1) - (1)].i); ;}
+
+/* Line 1455 of yacc.c  */
+#line 1163 "compilers/imcc/imcc.y"
+    { (yyval.i) = (yyvsp[(1) - (1)].i); }
     break;
 
   case 6:
-#line 1153 "compilers/imcc/imcc.y"
-    { (yyval.i) = (yyvsp[(1) - (1)].i); ;}
+
+/* Line 1455 of yacc.c  */
+#line 1164 "compilers/imcc/imcc.y"
+    { (yyval.i) = (yyvsp[(1) - (1)].i); }
     break;
 
   case 7:
-#line 1155 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1166 "compilers/imcc/imcc.y"
     {
            (yyval.i) = (yyvsp[(1) - (1)].i);
            imc_close_unit(interp, IMCC_INFO(interp)->cur_unit);
            IMCC_INFO(interp)->cur_unit = 0;
-         ;}
+         }
     break;
 
   case 8:
-#line 1161 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1172 "compilers/imcc/imcc.y"
     {
            (yyval.i) = (yyvsp[(1) - (1)].i);
            imc_close_unit(interp, IMCC_INFO(interp)->cur_unit);
            IMCC_INFO(interp)->cur_unit = 0;
-         ;}
+         }
     break;
 
   case 9:
-#line 1166 "compilers/imcc/imcc.y"
-    { (yyval.i) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1177 "compilers/imcc/imcc.y"
+    { (yyval.i) = 0; }
     break;
 
   case 10:
-#line 1167 "compilers/imcc/imcc.y"
-    { (yyval.i) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1178 "compilers/imcc/imcc.y"
+    { (yyval.i) = 0; }
     break;
 
   case 11:
-#line 1168 "compilers/imcc/imcc.y"
-    { (yyval.i) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1179 "compilers/imcc/imcc.y"
+    { (yyval.i) = 0; }
     break;
 
   case 12:
-#line 1169 "compilers/imcc/imcc.y"
-    { (yyval.i) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1180 "compilers/imcc/imcc.y"
+    { (yyval.i) = 0; }
     break;
 
   case 13:
-#line 1173 "compilers/imcc/imcc.y"
-    { (yyval.i) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1184 "compilers/imcc/imcc.y"
+    { (yyval.i) = 0; }
     break;
 
   case 14:
-#line 1175 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1186 "compilers/imcc/imcc.y"
     {
            (yyval.i) = 0;
            do_loadlib(interp, (yyvsp[(2) - (3)].s));
            mem_sys_free((yyvsp[(2) - (3)].s));
-         ;}
+         }
     break;
 
   case 15:
-#line 1184 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1195 "compilers/imcc/imcc.y"
     {
            IMCC_INFO(interp)->line = atoi((yyvsp[(2) - (5)].s));
            /* set_filename() frees the STRINGC */
            set_filename(interp, (yyvsp[(4) - (5)].s));
-         ;}
+         }
     break;
 
   case 16:
-#line 1190 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1201 "compilers/imcc/imcc.y"
     {
            /* set_filename() frees the STRINGC */
            set_filename(interp, (yyvsp[(2) - (3)].s));
-         ;}
+         }
     break;
 
   case 17:
-#line 1198 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1209 "compilers/imcc/imcc.y"
     {
           /* We'll want to store an entry while emitting instructions, so just
            * store annotation like it's an instruction. */
           SymReg * const key = mk_const(interp, (yyvsp[(2) - (4)].s), 'S');
           (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, ".annotate", 2, key, (yyvsp[(4) - (4)].sr));
           mem_sys_free((yyvsp[(2) - (4)].s));
-        ;}
+        }
     break;
 
   case 18:
-#line 1210 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1221 "compilers/imcc/imcc.y"
     {
             STRING * const hll_name = Parrot_str_unescape(interp, (yyvsp[(2) - (2)].s) + 1, '"', NULL);
-            CONTEXT(interp)->current_HLL =
-                Parrot_register_HLL(interp, hll_name);
+            Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp),
+                Parrot_register_HLL(interp, hll_name));
 
             IMCC_INFO(interp)->cur_namespace = NULL;
             mem_sys_free((yyvsp[(2) - (2)].s));
             (yyval.t) = 0;
-         ;}
+         }
     break;
 
   case 19:
-#line 1222 "compilers/imcc/imcc.y"
-    { pesky_global__is_def = 1; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1233 "compilers/imcc/imcc.y"
+    { IMCC_INFO(interp)->is_def = 1; }
     break;
 
   case 20:
-#line 1223 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1234 "compilers/imcc/imcc.y"
     {
              mk_const_ident(interp, (yyvsp[(4) - (6)].s), (yyvsp[(3) - (6)].t), (yyvsp[(6) - (6)].sr), 1);
              mem_sys_free((yyvsp[(4) - (6)].s));
-             pesky_global__is_def = 0;
-         ;}
+             IMCC_INFO(interp)->is_def = 0;
+         }
     break;
 
   case 21:
-#line 1231 "compilers/imcc/imcc.y"
-    { pesky_global__is_def=1; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1242 "compilers/imcc/imcc.y"
+    { IMCC_INFO(interp)->is_def = 1; }
     break;
 
   case 22:
-#line 1232 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1243 "compilers/imcc/imcc.y"
     {
            (yyval.i) = mk_pmc_const(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (6)].s), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].s));
            mem_sys_free((yyvsp[(6) - (6)].s));
-           pesky_global__is_def = 0;
-         ;}
+           IMCC_INFO(interp)->is_def = 0;
+         }
     break;
 
   case 23:
-#line 1238 "compilers/imcc/imcc.y"
-    { pesky_global__is_def=1; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1249 "compilers/imcc/imcc.y"
+    { IMCC_INFO(interp)->is_def = 1; }
     break;
 
   case 24:
-#line 1239 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1250 "compilers/imcc/imcc.y"
     {
            (yyval.i) = mk_pmc_const_named(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (6)].s), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].s));
            mem_sys_free((yyvsp[(3) - (6)].s));
            mem_sys_free((yyvsp[(6) - (6)].s));
-           pesky_global__is_def = 0;
-         ;}
+           IMCC_INFO(interp)->is_def = 0;
+         }
     break;
 
   case 29:
-#line 1257 "compilers/imcc/imcc.y"
-    { (yyval.i) = 0;  ;}
+
+/* Line 1455 of yacc.c  */
+#line 1268 "compilers/imcc/imcc.y"
+    { (yyval.i) = 0;  }
     break;
 
   case 30:
-#line 1258 "compilers/imcc/imcc.y"
-    { (yyval.i) = 0;  ;}
+
+/* Line 1455 of yacc.c  */
+#line 1269 "compilers/imcc/imcc.y"
+    { (yyval.i) = 0;  }
     break;
 
   case 31:
-#line 1259 "compilers/imcc/imcc.y"
-    { (yyval.i) = 0;  ;}
+
+/* Line 1455 of yacc.c  */
+#line 1270 "compilers/imcc/imcc.y"
+    { (yyval.i) = 0;  }
     break;
 
   case 32:
-#line 1260 "compilers/imcc/imcc.y"
-    { (yyval.i) = 0;  ;}
+
+/* Line 1455 of yacc.c  */
+#line 1271 "compilers/imcc/imcc.y"
+    { (yyval.i) = 0;  }
     break;
 
   case 33:
-#line 1261 "compilers/imcc/imcc.y"
-    { (yyval.i) = (yyvsp[(1) - (1)].i); ;}
+
+/* Line 1455 of yacc.c  */
+#line 1272 "compilers/imcc/imcc.y"
+    { (yyval.i) = (yyvsp[(1) - (1)].i); }
     break;
 
   case 36:
-#line 1266 "compilers/imcc/imcc.y"
-    { clear_state(interp); ;}
+
+/* Line 1455 of yacc.c  */
+#line 1277 "compilers/imcc/imcc.y"
+    { clear_state(interp); }
     break;
 
   case 37:
-#line 1268 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1279 "compilers/imcc/imcc.y"
     {
            (yyval.i) = INS(interp, IMCC_INFO(interp)->cur_unit,
                     (yyvsp[(2) - (3)].s), 0, IMCC_INFO(interp)->regs,
                     IMCC_INFO(interp)->nargs, IMCC_INFO(interp) -> keyvec, 1);
             mem_sys_free((yyvsp[(2) - (3)].s));
-         ;}
+         }
     break;
 
   case 38:
-#line 1275 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1286 "compilers/imcc/imcc.y"
     {
            imc_close_unit(interp, IMCC_INFO(interp)->cur_unit);
            IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PASM);
-         ;}
+         }
     break;
 
   case 39:
-#line 1280 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1291 "compilers/imcc/imcc.y"
     {
            (yyval.i) = iSUBROUTINE(interp,
                     IMCC_INFO(interp)->cur_unit,
                     mk_sub_label(interp, (yyvsp[(4) - (4)].s)));
            IMCC_INFO(interp)->cur_call->pcc_sub->pragma = (yyvsp[(3) - (4)].t);
            mem_sys_free((yyvsp[(4) - (4)].s));
-         ;}
+         }
     break;
 
   case 40:
-#line 1288 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1299 "compilers/imcc/imcc.y"
     {
            (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "null", 1, (yyvsp[(2) - (2)].sr));
-         ;}
+         }
     break;
 
   case 41:
-#line 1292 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1303 "compilers/imcc/imcc.y"
     {
-           SymReg *r = mk_pasm_reg(interp, (yyvsp[(4) - (4)].s));
-           SymReg *n = mk_const(interp, (yyvsp[(2) - (4)].s), 'S');
+           char   *name = mem_sys_strdup((yyvsp[(2) - (4)].s) + 1);
+           SymReg *r    = mk_pasm_reg(interp, (yyvsp[(4) - (4)].s));
+           SymReg *n;
+           name[strlen(name) - 1] = 0;
+           n = mk_const(interp, name, 'S');
            set_lexical(interp, r, n);
            (yyval.i) = 0;
+           mem_sys_free(name);
            mem_sys_free((yyvsp[(2) - (4)].s));
            mem_sys_free((yyvsp[(4) - (4)].s));
-         ;}
+         }
     break;
 
   case 42:
-#line 1300 "compilers/imcc/imcc.y"
-    { (yyval.i) = 0;;}
+
+/* Line 1455 of yacc.c  */
+#line 1315 "compilers/imcc/imcc.y"
+    { (yyval.i) = 0;}
     break;
 
   case 44:
-#line 1308 "compilers/imcc/imcc.y"
-    { IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PASM); ;}
+
+/* Line 1455 of yacc.c  */
+#line 1323 "compilers/imcc/imcc.y"
+    { IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PASM); }
     break;
 
   case 45:
-#line 1311 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1326 "compilers/imcc/imcc.y"
     {
            /* if (optimizer_level & OPT_PASM)
                          imc_compile_unit(interp, IMCC_INFO(interp)->cur_unit);
                          emit_flush(interp);
            */
            (yyval.i) = 0;
-         ;}
+         }
     break;
 
   case 48:
-#line 1327 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1342 "compilers/imcc/imcc.y"
     {
            int re_open = 0;
            (yyval.i) = 0;
@@ -3480,67 +3575,81 @@
            IMCC_INFO(interp)->cur_namespace = (yyvsp[(2) - (3)].sr);
            if (re_open)
                IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PASM);
-         ;}
+         }
     break;
 
   case 49:
-#line 1342 "compilers/imcc/imcc.y"
-    {
-            if (IMCC_INFO(interp)->in_slice)
-                IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
-                    "Slice not allowed in namespace.");
 
+/* Line 1455 of yacc.c  */
+#line 1357 "compilers/imcc/imcc.y"
+    {
             (yyval.sr) = (yyvsp[(2) - (3)].sr);
-        ;}
+        }
     break;
 
   case 50:
-#line 1349 "compilers/imcc/imcc.y"
-    { (yyval.sr) = NULL; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1360 "compilers/imcc/imcc.y"
+    { (yyval.sr) = NULL; }
     break;
 
   case 51:
-#line 1354 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1365 "compilers/imcc/imcc.y"
     {
            IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PCCSUB);
-         ;}
+         }
     break;
 
   case 52:
-#line 1358 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1369 "compilers/imcc/imcc.y"
     {
            iSUBROUTINE(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (3)].sr));
-         ;}
+         }
     break;
 
   case 53:
-#line 1362 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1373 "compilers/imcc/imcc.y"
     {
           IMCC_INFO(interp)->cur_call->pcc_sub->pragma = (yyvsp[(5) - (6)].t);
           if (!IMCC_INFO(interp)->cur_unit->instructions->symregs[0]->subid) {
             IMCC_INFO(interp)->cur_unit->instructions->symregs[0]->subid = mem_sys_strdup(
             IMCC_INFO(interp)->cur_unit->instructions->symregs[0]->name);
           }
-        ;}
+        }
     break;
 
   case 54:
-#line 1370 "compilers/imcc/imcc.y"
-    { (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1381 "compilers/imcc/imcc.y"
+    { (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; }
     break;
 
   case 55:
-#line 1374 "compilers/imcc/imcc.y"
-    { (yyval.sr) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1385 "compilers/imcc/imcc.y"
+    { (yyval.sr) = 0; }
     break;
 
   case 56:
-#line 1375 "compilers/imcc/imcc.y"
-    { (yyval.sr) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1386 "compilers/imcc/imcc.y"
+    { (yyval.sr) = 0; }
     break;
 
   case 57:
-#line 1377 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1388 "compilers/imcc/imcc.y"
     {
            if (IMCC_INFO(interp)->adv_named_id) {
                  add_pcc_named_param(IMCC_INFO(interp)->cur_call,
@@ -3549,179 +3658,237 @@
            }
            else
                add_pcc_arg(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr));
-         ;}
+         }
     break;
 
   case 58:
-#line 1389 "compilers/imcc/imcc.y"
-    { pesky_global__is_def=1; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1400 "compilers/imcc/imcc.y"
+    { IMCC_INFO(interp)->is_def = 1; }
     break;
 
   case 59:
-#line 1389 "compilers/imcc/imcc.y"
-    { (yyval.sr) = (yyvsp[(3) - (3)].sr); pesky_global__is_def=0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1400 "compilers/imcc/imcc.y"
+    { (yyval.sr) = (yyvsp[(3) - (3)].sr); IMCC_INFO(interp)->is_def = 0; }
     break;
 
   case 60:
-#line 1394 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1405 "compilers/imcc/imcc.y"
     {
            if ((yyvsp[(3) - (3)].t) & VT_UNIQUE_REG)
                (yyval.sr) = mk_ident_ur(interp, (yyvsp[(2) - (3)].s), (yyvsp[(1) - (3)].t));
+           else if ((yyvsp[(3) - (3)].t) & VT_OPT_FLAG && (yyvsp[(1) - (3)].t) != 'I') {
+               char *type;
+               switch ((yyvsp[(1) - (3)].t)) {
+                    case 'N': type = "num";     break;
+                    case 'S': type = "string";  break;
+                    case 'P': type = "pmc";     break;
+                    default:  type = "strange"; break;
+               }
+
+               IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
+                   ":opt_flag parameter must be of type 'I', not '%s'", type);
+           }
            else
                (yyval.sr) = mk_ident(interp, (yyvsp[(2) - (3)].s), (yyvsp[(1) - (3)].t));
            (yyval.sr)->type |= (yyvsp[(3) - (3)].t);
            mem_sys_free((yyvsp[(2) - (3)].s));
-          ;}
+          }
     break;
 
   case 61:
-#line 1407 "compilers/imcc/imcc.y"
-    { (yyval.t) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1430 "compilers/imcc/imcc.y"
+    { (yyval.t) = 0; }
     break;
 
   case 62:
-#line 1412 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1435 "compilers/imcc/imcc.y"
     {
            (yyval.t) = 0;
            IMCC_INFO(interp)->cur_unit->outer = mk_sub_address_fromc(interp, (yyvsp[(3) - (4)].s));
            mem_sys_free((yyvsp[(3) - (4)].s));
-         ;}
+         }
     break;
 
   case 63:
-#line 1418 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1441 "compilers/imcc/imcc.y"
     {
            (yyval.t) = 0;
            IMCC_INFO(interp)->cur_unit->outer = mk_const(interp, (yyvsp[(3) - (4)].s), 'S');
            mem_sys_free((yyvsp[(3) - (4)].s));
-         ;}
+         }
     break;
 
   case 64:
-#line 1427 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1450 "compilers/imcc/imcc.y"
     {
            (yyval.t) = P_VTABLE;
            IMCC_INFO(interp)->cur_unit->vtable_name      = NULL;
            IMCC_INFO(interp)->cur_unit->is_vtable_method = 1;
-         ;}
+         }
     break;
 
   case 65:
-#line 1433 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1456 "compilers/imcc/imcc.y"
     {
            (yyval.t) = P_VTABLE;
            IMCC_INFO(interp)->cur_unit->vtable_name      = (yyvsp[(3) - (4)].s);
            IMCC_INFO(interp)->cur_unit->is_vtable_method = 1;
-         ;}
+         }
     break;
 
   case 66:
-#line 1442 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1465 "compilers/imcc/imcc.y"
     {
            (yyval.t) = P_METHOD;
            IMCC_INFO(interp)->cur_unit->method_name = NULL;
            IMCC_INFO(interp)->cur_unit->is_method   = 1;
-         ;}
+         }
     break;
 
   case 67:
-#line 1448 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1471 "compilers/imcc/imcc.y"
     {
            (yyval.t) = P_METHOD;
            IMCC_INFO(interp)->cur_unit->method_name = (yyvsp[(3) - (4)].s);
            IMCC_INFO(interp)->cur_unit->is_method   = 1;
-         ;}
+         }
     break;
 
   case 68:
-#line 1457 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1480 "compilers/imcc/imcc.y"
     {
            (yyval.t) = 0;
            IMCC_INFO(interp)->cur_unit->ns_entry_name     = NULL;
            IMCC_INFO(interp)->cur_unit->has_ns_entry_name = 1;
-         ;}
+         }
     break;
 
   case 69:
-#line 1463 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1486 "compilers/imcc/imcc.y"
     {
            (yyval.t) = 0;
            IMCC_INFO(interp)->cur_unit->ns_entry_name = (yyvsp[(3) - (4)].s);
            IMCC_INFO(interp)->cur_unit->has_ns_entry_name = 1;
-         ;}
+         }
     break;
 
   case 70:
-#line 1472 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1495 "compilers/imcc/imcc.y"
     {
            (yyval.t) = 0;
            IMCC_INFO(interp)->cur_unit->instance_of = (yyvsp[(3) - (4)].s);
-         ;}
+         }
     break;
 
   case 71:
-#line 1480 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1503 "compilers/imcc/imcc.y"
     {
            (yyval.t) = 0;
            IMCC_INFO(interp)->cur_unit->subid = NULL;
-         ;}
+         }
     break;
 
   case 72:
-#line 1485 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1508 "compilers/imcc/imcc.y"
     {
            (yyval.t) = 0;
            IMCC_INFO(interp)->cur_unit->subid = mk_const(interp, (yyvsp[(3) - (4)].s), 'S');
            IMCC_INFO(interp)->cur_unit->instructions->symregs[0]->subid = str_dup_remove_quotes((yyvsp[(3) - (4)].s));
            mem_sys_free((yyvsp[(3) - (4)].s));
-         ;}
+         }
     break;
 
   case 73:
-#line 1495 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1518 "compilers/imcc/imcc.y"
     {
            add_pcc_multi(IMCC_INFO(interp)->cur_call, NULL);
-         ;}
+         }
     break;
 
   case 74:
-#line 1499 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1522 "compilers/imcc/imcc.y"
     {
            (yyval.t) = 0;
            add_pcc_multi(IMCC_INFO(interp)->cur_call, (yyvsp[(3) - (3)].sr));
-         ;}
+         }
     break;
 
   case 75:
-#line 1504 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1527 "compilers/imcc/imcc.y"
     {
            (yyval.t) = 0;
            add_pcc_multi(IMCC_INFO(interp)->cur_call, (yyvsp[(1) - (1)].sr));
-         ;}
+         }
     break;
 
   case 76:
-#line 1511 "compilers/imcc/imcc.y"
-    { (yyval.sr) = mk_const(interp, "INTVAL",   'S'); ;}
+
+/* Line 1455 of yacc.c  */
+#line 1534 "compilers/imcc/imcc.y"
+    { (yyval.sr) = mk_const(interp, "INTVAL",   'S'); }
     break;
 
   case 77:
-#line 1512 "compilers/imcc/imcc.y"
-    { (yyval.sr) = mk_const(interp, "FLOATVAL", 'S'); ;}
+
+/* Line 1455 of yacc.c  */
+#line 1535 "compilers/imcc/imcc.y"
+    { (yyval.sr) = mk_const(interp, "FLOATVAL", 'S'); }
     break;
 
   case 78:
-#line 1513 "compilers/imcc/imcc.y"
-    { (yyval.sr) = mk_const(interp, "PMC",      'S'); ;}
+
+/* Line 1455 of yacc.c  */
+#line 1536 "compilers/imcc/imcc.y"
+    { (yyval.sr) = mk_const(interp, "PMC",      'S'); }
     break;
 
   case 79:
-#line 1514 "compilers/imcc/imcc.y"
-    { (yyval.sr) = mk_const(interp, "STRING",   'S'); ;}
+
+/* Line 1455 of yacc.c  */
+#line 1537 "compilers/imcc/imcc.y"
+    { (yyval.sr) = mk_const(interp, "STRING",   'S'); }
     break;
 
   case 80:
-#line 1516 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1539 "compilers/imcc/imcc.y"
     {
            SymReg *r;
            if (strcmp((yyvsp[(1) - (1)].s), "_") != 0)
@@ -3731,11 +3898,13 @@
            }
            mem_sys_free((yyvsp[(1) - (1)].s));
            (yyval.sr) = r;
-         ;}
+         }
     break;
 
   case 81:
-#line 1527 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1550 "compilers/imcc/imcc.y"
     {
            SymReg *r;
            if (strcmp((yyvsp[(1) - (1)].s), "_") != 0)
@@ -3745,16 +3914,20 @@
            }
            mem_sys_free((yyvsp[(1) - (1)].s));
            (yyval.sr) = r;
-         ;}
+         }
     break;
 
   case 82:
-#line 1537 "compilers/imcc/imcc.y"
-    { (yyval.sr) = (yyvsp[(2) - (3)].sr); ;}
+
+/* Line 1455 of yacc.c  */
+#line 1560 "compilers/imcc/imcc.y"
+    { (yyval.sr) = (yyvsp[(2) - (3)].sr); }
     break;
 
   case 85:
-#line 1547 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1570 "compilers/imcc/imcc.y"
     {
            char name[128];
            SymReg *r, *r1;
@@ -3777,177 +3950,237 @@
            r1 = IMCC_INFO(interp)->cur_unit->instructions->symregs[0];
            if (r1 && r1->pcc_sub)
                r1->pcc_sub->calls_a_sub |= 1;
-         ;}
+         }
     break;
 
   case 86:
-#line 1575 "compilers/imcc/imcc.y"
-    { (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1598 "compilers/imcc/imcc.y"
+    { (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; }
     break;
 
   case 87:
-#line 1579 "compilers/imcc/imcc.y"
-    { (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->label = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1602 "compilers/imcc/imcc.y"
+    { (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->label = 0; }
     break;
 
   case 88:
-#line 1580 "compilers/imcc/imcc.y"
-    { (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->label = 1; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1603 "compilers/imcc/imcc.y"
+    { (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->label = 1; }
     break;
 
   case 89:
-#line 1584 "compilers/imcc/imcc.y"
-    { (yyval.i) = NULL; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1607 "compilers/imcc/imcc.y"
+    { (yyval.i) = NULL; }
     break;
 
   case 90:
-#line 1585 "compilers/imcc/imcc.y"
-    { (yyval.i) = NULL;  IMCC_INFO(interp)->cur_call->pcc_sub->object = (yyvsp[(2) - (3)].sr); ;}
+
+/* Line 1455 of yacc.c  */
+#line 1608 "compilers/imcc/imcc.y"
+    { (yyval.i) = NULL;  IMCC_INFO(interp)->cur_call->pcc_sub->object = (yyvsp[(2) - (3)].sr); }
     break;
 
   case 91:
-#line 1589 "compilers/imcc/imcc.y"
-    { (yyval.t) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1612 "compilers/imcc/imcc.y"
+    { (yyval.t) = 0; }
     break;
 
   case 93:
-#line 1594 "compilers/imcc/imcc.y"
-    { (yyval.t) = (yyvsp[(1) - (1)].t); ;}
+
+/* Line 1455 of yacc.c  */
+#line 1617 "compilers/imcc/imcc.y"
+    { (yyval.t) = (yyvsp[(1) - (1)].t); }
     break;
 
   case 94:
-#line 1595 "compilers/imcc/imcc.y"
-    { (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); ;}
+
+/* Line 1455 of yacc.c  */
+#line 1618 "compilers/imcc/imcc.y"
+    { (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); }
     break;
 
   case 95:
-#line 1599 "compilers/imcc/imcc.y"
-    { (yyval.t) = P_LOAD; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1622 "compilers/imcc/imcc.y"
+    { (yyval.t) = P_LOAD; }
     break;
 
   case 96:
-#line 1600 "compilers/imcc/imcc.y"
-    { (yyval.t) = P_INIT; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1623 "compilers/imcc/imcc.y"
+    { (yyval.t) = P_INIT; }
     break;
 
   case 97:
-#line 1601 "compilers/imcc/imcc.y"
-    { (yyval.t) = P_MAIN; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1624 "compilers/imcc/imcc.y"
+    { (yyval.t) = P_MAIN; }
     break;
 
   case 98:
-#line 1602 "compilers/imcc/imcc.y"
-    { (yyval.t) = P_IMMEDIATE; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1625 "compilers/imcc/imcc.y"
+    { (yyval.t) = P_IMMEDIATE; }
     break;
 
   case 99:
-#line 1603 "compilers/imcc/imcc.y"
-    { (yyval.t) = P_POSTCOMP; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1626 "compilers/imcc/imcc.y"
+    { (yyval.t) = P_POSTCOMP; }
     break;
 
   case 100:
-#line 1604 "compilers/imcc/imcc.y"
-    { (yyval.t) = P_ANON; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1627 "compilers/imcc/imcc.y"
+    { (yyval.t) = P_ANON; }
     break;
 
   case 101:
-#line 1605 "compilers/imcc/imcc.y"
-    { (yyval.t) = P_NEED_LEX; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1628 "compilers/imcc/imcc.y"
+    { (yyval.t) = P_NEED_LEX; }
     break;
 
   case 109:
-#line 1617 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1640 "compilers/imcc/imcc.y"
     {
            add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (5)].sr));
            add_pcc_cc(IMCC_INFO(interp)->cur_call, (yyvsp[(4) - (5)].sr));
-         ;}
+         }
     break;
 
   case 110:
-#line 1622 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1645 "compilers/imcc/imcc.y"
     {
            add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr));
-         ;}
+         }
     break;
 
   case 111:
-#line 1626 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1649 "compilers/imcc/imcc.y"
     {
            add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr));
            IMCC_INFO(interp)->cur_call->pcc_sub->flags |= isNCI;
-         ;}
+         }
     break;
 
   case 112:
-#line 1631 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1654 "compilers/imcc/imcc.y"
     {
            add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr));
-         ;}
+         }
     break;
 
   case 113:
-#line 1635 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1658 "compilers/imcc/imcc.y"
     {
            add_pcc_sub(IMCC_INFO(interp)->cur_call, mk_const(interp, (yyvsp[(2) - (3)].s), 'S'));
-         ;}
+         }
     break;
 
   case 114:
-#line 1639 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1662 "compilers/imcc/imcc.y"
     {
            add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (5)].sr));
            add_pcc_cc(IMCC_INFO(interp)->cur_call, (yyvsp[(4) - (5)].sr));
-         ;}
+         }
     break;
 
   case 115:
-#line 1644 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1667 "compilers/imcc/imcc.y"
     {
            add_pcc_sub(IMCC_INFO(interp)->cur_call, mk_const(interp, (yyvsp[(2) - (5)].s), 'S'));
            add_pcc_cc(IMCC_INFO(interp)->cur_call, (yyvsp[(4) - (5)].sr));
-         ;}
+         }
     break;
 
   case 116:
-#line 1652 "compilers/imcc/imcc.y"
-    { (yyval.sr) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1675 "compilers/imcc/imcc.y"
+    { (yyval.sr) = 0; }
     break;
 
   case 117:
-#line 1653 "compilers/imcc/imcc.y"
-    { add_pcc_arg(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr)); ;}
+
+/* Line 1455 of yacc.c  */
+#line 1676 "compilers/imcc/imcc.y"
+    { add_pcc_arg(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr)); }
     break;
 
   case 118:
-#line 1657 "compilers/imcc/imcc.y"
-    { (yyval.sr) = (yyvsp[(2) - (2)].sr); ;}
+
+/* Line 1455 of yacc.c  */
+#line 1680 "compilers/imcc/imcc.y"
+    { (yyval.sr) = (yyvsp[(2) - (2)].sr); }
     break;
 
   case 119:
-#line 1662 "compilers/imcc/imcc.y"
-    { (yyval.sr) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1685 "compilers/imcc/imcc.y"
+    { (yyval.sr) = 0; }
     break;
 
   case 120:
-#line 1664 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1687 "compilers/imcc/imcc.y"
     {
            if ((yyvsp[(2) - (3)].sr))
                add_pcc_result(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr));
-         ;}
+         }
     break;
 
   case 121:
-#line 1671 "compilers/imcc/imcc.y"
-    { (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); ;}
+
+/* Line 1455 of yacc.c  */
+#line 1694 "compilers/imcc/imcc.y"
+    { (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); }
     break;
 
   case 122:
-#line 1672 "compilers/imcc/imcc.y"
-    { pesky_global__is_def=1; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1695 "compilers/imcc/imcc.y"
+    { IMCC_INFO(interp)->is_def = 1; }
     break;
 
   case 123:
-#line 1673 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1696 "compilers/imcc/imcc.y"
     {
            IdList * const l = (yyvsp[(4) - (4)].idlist);
            SymReg *ignored;
@@ -3956,169 +4189,232 @@
            else
                ignored = mk_ident(interp, l->id, (yyvsp[(3) - (4)].t));
            UNUSED(ignored);
-           pesky_global__is_def=0;
-           (yyval.sr)=0;
-         ;}
+           IMCC_INFO(interp)->is_def = 0;
+           (yyval.sr) = 0;
+         }
     break;
 
   case 124:
-#line 1687 "compilers/imcc/imcc.y"
-    { (yyval.t) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1710 "compilers/imcc/imcc.y"
+    { (yyval.t) = 0; }
     break;
 
   case 125:
-#line 1688 "compilers/imcc/imcc.y"
-    { (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); ;}
+
+/* Line 1455 of yacc.c  */
+#line 1711 "compilers/imcc/imcc.y"
+    { (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); }
     break;
 
   case 126:
-#line 1692 "compilers/imcc/imcc.y"
-    { (yyval.t) = VT_FLAT;   ;}
+
+/* Line 1455 of yacc.c  */
+#line 1715 "compilers/imcc/imcc.y"
+    { (yyval.t) = VT_FLAT;   }
     break;
 
   case 127:
-#line 1693 "compilers/imcc/imcc.y"
-    { (yyval.t) = VT_OPTIONAL; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1716 "compilers/imcc/imcc.y"
+    { (yyval.t) = VT_OPTIONAL; }
     break;
 
   case 128:
-#line 1694 "compilers/imcc/imcc.y"
-    { (yyval.t) = VT_OPT_FLAG; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1717 "compilers/imcc/imcc.y"
+    { (yyval.t) = VT_OPT_FLAG; }
     break;
 
   case 129:
-#line 1695 "compilers/imcc/imcc.y"
-    { (yyval.t) = VT_NAMED; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1718 "compilers/imcc/imcc.y"
+    { (yyval.t) = VT_NAMED; }
     break;
 
   case 130:
-#line 1696 "compilers/imcc/imcc.y"
-    { adv_named_set(interp, (yyvsp[(3) - (4)].s));   (yyval.t) = 0; mem_sys_free((yyvsp[(3) - (4)].s)); ;}
+
+/* Line 1455 of yacc.c  */
+#line 1719 "compilers/imcc/imcc.y"
+    { adv_named_set(interp, (yyvsp[(3) - (4)].s));   (yyval.t) = 0; mem_sys_free((yyvsp[(3) - (4)].s)); }
     break;
 
   case 131:
-#line 1697 "compilers/imcc/imcc.y"
-    { adv_named_set_u(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; mem_sys_free((yyvsp[(3) - (4)].s)); ;}
+
+/* Line 1455 of yacc.c  */
+#line 1720 "compilers/imcc/imcc.y"
+    { adv_named_set_u(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; mem_sys_free((yyvsp[(3) - (4)].s)); }
     break;
 
   case 132:
-#line 1698 "compilers/imcc/imcc.y"
-    { (yyval.t) = VT_UNIQUE_REG; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1721 "compilers/imcc/imcc.y"
+    { (yyval.t) = VT_UNIQUE_REG; }
     break;
 
   case 133:
-#line 1703 "compilers/imcc/imcc.y"
-    { begin_return_or_yield(interp, 0); ;}
+
+/* Line 1455 of yacc.c  */
+#line 1722 "compilers/imcc/imcc.y"
+    { (yyval.t) = VT_CALL_SIG; }
     break;
 
   case 134:
-#line 1705 "compilers/imcc/imcc.y"
-    { (yyval.i) = 0; IMCC_INFO(interp)->asm_state = AsmDefault; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1727 "compilers/imcc/imcc.y"
+    { begin_return_or_yield(interp, 0); }
     break;
 
   case 135:
-#line 1707 "compilers/imcc/imcc.y"
-    {
-           IMCC_INFO(interp)->asm_state = AsmDefault;
-           (yyval.i) = 0;
-         ;}
+
+/* Line 1455 of yacc.c  */
+#line 1729 "compilers/imcc/imcc.y"
+    { (yyval.i) = 0; IMCC_INFO(interp)->asm_state = AsmDefault; }
     break;
 
   case 136:
-#line 1714 "compilers/imcc/imcc.y"
-    { begin_return_or_yield(interp, 1); ;}
+
+/* Line 1455 of yacc.c  */
+#line 1731 "compilers/imcc/imcc.y"
+    {
+           IMCC_INFO(interp)->asm_state = AsmDefault;
+           (yyval.i) = 0;
+         }
     break;
 
   case 137:
-#line 1716 "compilers/imcc/imcc.y"
-    { (yyval.i) = 0; IMCC_INFO(interp)->asm_state = AsmDefault; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1738 "compilers/imcc/imcc.y"
+    { begin_return_or_yield(interp, 1); }
     break;
 
   case 138:
-#line 1720 "compilers/imcc/imcc.y"
-    { (yyval.sr) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1740 "compilers/imcc/imcc.y"
+    { (yyval.i) = 0; IMCC_INFO(interp)->asm_state = AsmDefault; }
     break;
 
   case 139:
-#line 1722 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1744 "compilers/imcc/imcc.y"
+    { (yyval.sr) = 0; }
+    break;
+
+  case 140:
+
+/* Line 1455 of yacc.c  */
+#line 1746 "compilers/imcc/imcc.y"
     {
            if ((yyvsp[(1) - (2)].sr))
                add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(1) - (2)].sr));
-         ;}
+         }
     break;
 
-  case 140:
-#line 1727 "compilers/imcc/imcc.y"
+  case 141:
+
+/* Line 1455 of yacc.c  */
+#line 1751 "compilers/imcc/imcc.y"
     {
            if ((yyvsp[(2) - (3)].sr))
                add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(2) - (3)].sr));
-         ;}
+         }
     break;
 
-  case 141:
-#line 1734 "compilers/imcc/imcc.y"
-    { (yyval.sr) = 0; ;}
+  case 142:
+
+/* Line 1455 of yacc.c  */
+#line 1758 "compilers/imcc/imcc.y"
+    { (yyval.sr) = 0; }
     break;
 
-  case 142:
-#line 1736 "compilers/imcc/imcc.y"
+  case 143:
+
+/* Line 1455 of yacc.c  */
+#line 1760 "compilers/imcc/imcc.y"
     {
            if ((yyvsp[(1) - (2)].sr))
                add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(1) - (2)].sr));
-         ;}
+         }
     break;
 
-  case 143:
-#line 1741 "compilers/imcc/imcc.y"
+  case 144:
+
+/* Line 1455 of yacc.c  */
+#line 1765 "compilers/imcc/imcc.y"
     {
            if ((yyvsp[(2) - (3)].sr))
                add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(2) - (3)].sr));
-         ;}
-    break;
-
-  case 144:
-#line 1748 "compilers/imcc/imcc.y"
-    { (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); ;}
+         }
     break;
 
   case 145:
-#line 1752 "compilers/imcc/imcc.y"
-    { (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); ;}
+
+/* Line 1455 of yacc.c  */
+#line 1772 "compilers/imcc/imcc.y"
+    { (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); }
     break;
 
   case 146:
-#line 1757 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1776 "compilers/imcc/imcc.y"
+    { (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); }
+    break;
+
+  case 147:
+
+/* Line 1455 of yacc.c  */
+#line 1781 "compilers/imcc/imcc.y"
     {
           if (IMCC_INFO(interp)->asm_state == AsmDefault)
               begin_return_or_yield(interp, (yyvsp[(1) - (2)].t));
-        ;}
+        }
     break;
 
-  case 147:
-#line 1762 "compilers/imcc/imcc.y"
+  case 148:
+
+/* Line 1455 of yacc.c  */
+#line 1786 "compilers/imcc/imcc.y"
     {
           IMCC_INFO(interp)->asm_state = AsmDefault;
           (yyval.t) = 0;
-        ;}
-    break;
-
-  case 148:
-#line 1769 "compilers/imcc/imcc.y"
-    { (yyval.t) = 0; ;}
+        }
     break;
 
   case 149:
-#line 1770 "compilers/imcc/imcc.y"
-    { (yyval.t) = 1; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1793 "compilers/imcc/imcc.y"
+    { (yyval.t) = 0; }
     break;
 
   case 150:
-#line 1774 "compilers/imcc/imcc.y"
-    { (yyval.i) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1794 "compilers/imcc/imcc.y"
+    { (yyval.t) = 1; }
     break;
 
   case 151:
-#line 1776 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1798 "compilers/imcc/imcc.y"
+    { (yyval.i) = 0; }
+    break;
+
+  case 152:
+
+/* Line 1455 of yacc.c  */
+#line 1800 "compilers/imcc/imcc.y"
     {
            if (IMCC_INFO(interp)->adv_named_id) {
                add_pcc_named_return(IMCC_INFO(interp)->sr_return,
@@ -4127,19 +4423,23 @@
            }
            else
                add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(1) - (1)].sr));
-         ;}
+         }
     break;
 
-  case 152:
-#line 1786 "compilers/imcc/imcc.y"
+  case 153:
+
+/* Line 1455 of yacc.c  */
+#line 1810 "compilers/imcc/imcc.y"
     {
             SymReg * const name = mk_const(interp, (yyvsp[(1) - (3)].s), 'S');
             add_pcc_named_return(IMCC_INFO(interp)->sr_return, name, (yyvsp[(3) - (3)].sr));
-         ;}
+         }
     break;
 
-  case 153:
-#line 1791 "compilers/imcc/imcc.y"
+  case 154:
+
+/* Line 1455 of yacc.c  */
+#line 1815 "compilers/imcc/imcc.y"
     {
            if (IMCC_INFO(interp)->adv_named_id) {
                add_pcc_named_return(IMCC_INFO(interp)->sr_return,
@@ -4148,127 +4448,165 @@
              }
              else
                  add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(3) - (3)].sr));
-         ;}
+         }
     break;
 
-  case 154:
-#line 1801 "compilers/imcc/imcc.y"
+  case 155:
+
+/* Line 1455 of yacc.c  */
+#line 1825 "compilers/imcc/imcc.y"
     {
            SymReg * const name = mk_const(interp, (yyvsp[(3) - (5)].s), 'S');
            add_pcc_named_return(IMCC_INFO(interp)->sr_return, name, (yyvsp[(5) - (5)].sr));
-         ;}
-    break;
-
-  case 157:
-#line 1822 "compilers/imcc/imcc.y"
-    { clear_state(interp); ;}
+         }
     break;
 
   case 158:
-#line 1827 "compilers/imcc/imcc.y"
-    { (yyval.i) = (yyvsp[(2) - (2)].i); ;}
+
+/* Line 1455 of yacc.c  */
+#line 1846 "compilers/imcc/imcc.y"
+    { clear_state(interp); }
     break;
 
   case 159:
-#line 1828 "compilers/imcc/imcc.y"
-    { (yyval.i) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1851 "compilers/imcc/imcc.y"
+    { (yyval.i) = (yyvsp[(2) - (2)].i); }
     break;
 
   case 160:
-#line 1829 "compilers/imcc/imcc.y"
-    { (yyval.i) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1852 "compilers/imcc/imcc.y"
+    { (yyval.i) = 0; }
     break;
 
   case 161:
-#line 1830 "compilers/imcc/imcc.y"
-    { (yyval.i) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1853 "compilers/imcc/imcc.y"
+    { (yyval.i) = 0; }
     break;
 
   case 162:
-#line 1831 "compilers/imcc/imcc.y"
-    { (yyval.i) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1854 "compilers/imcc/imcc.y"
+    { (yyval.i) = 0; }
     break;
 
   case 163:
-#line 1832 "compilers/imcc/imcc.y"
-    { (yyval.i) = (yyvsp[(1) - (1)].i); ;}
+
+/* Line 1455 of yacc.c  */
+#line 1855 "compilers/imcc/imcc.y"
+    { (yyval.i) = 0; }
     break;
 
   case 164:
-#line 1836 "compilers/imcc/imcc.y"
-    { (yyval.i) = NULL; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1856 "compilers/imcc/imcc.y"
+    { (yyval.i) = (yyvsp[(1) - (1)].i); }
     break;
 
-  case 168:
-#line 1847 "compilers/imcc/imcc.y"
+  case 165:
+
+/* Line 1455 of yacc.c  */
+#line 1860 "compilers/imcc/imcc.y"
+    { (yyval.i) = NULL; }
+    break;
+
+  case 169:
+
+/* Line 1455 of yacc.c  */
+#line 1871 "compilers/imcc/imcc.y"
     {
              Instruction * const i = iLABEL(interp, IMCC_INFO(interp)->cur_unit, mk_local_label(interp, (yyvsp[(1) - (1)].s)));
              mem_sys_free((yyvsp[(1) - (1)].s));
              (yyval.i) = i;
-         ;}
+         }
     break;
 
-  case 169:
-#line 1857 "compilers/imcc/imcc.y"
-    { (yyval.i) = (yyvsp[(2) - (3)].i); ;}
+  case 170:
+
+/* Line 1455 of yacc.c  */
+#line 1881 "compilers/imcc/imcc.y"
+    { (yyval.i) = (yyvsp[(2) - (3)].i); }
     break;
 
-  case 170:
-#line 1859 "compilers/imcc/imcc.y"
+  case 171:
+
+/* Line 1455 of yacc.c  */
+#line 1883 "compilers/imcc/imcc.y"
     {
            if (yynerrs >= PARROT_MAX_RECOVER_ERRORS) {
                IMCC_warning(interp, "Too many errors. Correct some first.\n");
                YYABORT;
            }
            yyerrok;
-         ;}
+         }
     break;
 
-  case 171:
-#line 1870 "compilers/imcc/imcc.y"
+  case 172:
+
+/* Line 1455 of yacc.c  */
+#line 1894 "compilers/imcc/imcc.y"
     {
            IdList* const l = (yyvsp[(1) - (1)].idlist);
            l->next = NULL;
            (yyval.idlist) = l;
-         ;}
+         }
     break;
 
-  case 172:
-#line 1877 "compilers/imcc/imcc.y"
+  case 173:
+
+/* Line 1455 of yacc.c  */
+#line 1901 "compilers/imcc/imcc.y"
     {
            IdList* const l = (yyvsp[(3) - (3)].idlist);
            l->next = (yyvsp[(1) - (3)].idlist);
            (yyval.idlist) = l;
-         ;}
+         }
     break;
 
-  case 173:
-#line 1886 "compilers/imcc/imcc.y"
+  case 174:
+
+/* Line 1455 of yacc.c  */
+#line 1910 "compilers/imcc/imcc.y"
     {
            IdList* const l = mem_allocate_n_zeroed_typed(1, IdList);
            l->id           = (yyvsp[(1) - (2)].s);
            l->unique_reg   = (yyvsp[(2) - (2)].t);
            (yyval.idlist) = l;
-         ;}
-    break;
-
-  case 174:
-#line 1895 "compilers/imcc/imcc.y"
-    { (yyval.t) = 0; ;}
+         }
     break;
 
   case 175:
-#line 1896 "compilers/imcc/imcc.y"
-    { (yyval.t) = 1; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1919 "compilers/imcc/imcc.y"
+    { (yyval.t) = 0; }
     break;
 
-  case 178:
-#line 1903 "compilers/imcc/imcc.y"
-    { pesky_global__is_def=1; ;}
+  case 176:
+
+/* Line 1455 of yacc.c  */
+#line 1920 "compilers/imcc/imcc.y"
+    { (yyval.t) = 1; }
     break;
 
   case 179:
-#line 1904 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1927 "compilers/imcc/imcc.y"
+    { IMCC_INFO(interp)->is_def = 1; }
+    break;
+
+  case 180:
+
+/* Line 1455 of yacc.c  */
+#line 1928 "compilers/imcc/imcc.y"
     {
            IdList *l = (yyvsp[(4) - (4)].idlist);
            while (l) {
@@ -4282,74 +4620,110 @@
                mem_sys_free(l1->id);
                mem_sys_free(l1);
            }
-           pesky_global__is_def=0; (yyval.i)=0;
-         ;}
-    break;
-
-  case 180:
-#line 1920 "compilers/imcc/imcc.y"
-    {
-           SymReg * const n = mk_const(interp, (yyvsp[(2) - (4)].s), 'S');
-           set_lexical(interp, (yyvsp[(4) - (4)].sr), n); (yyval.i) = 0;
-           mem_sys_free((yyvsp[(2) - (4)].s));
-         ;}
+           IMCC_INFO(interp)->is_def = 0; (yyval.i) = 0;
+         }
     break;
 
   case 181:
-#line 1926 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1944 "compilers/imcc/imcc.y"
     {
-           SymReg * const n = mk_const(interp, (yyvsp[(2) - (4)].s), 'U');
-           set_lexical(interp, (yyvsp[(4) - (4)].sr), n); (yyval.i) = 0;
-           mem_sys_free((yyvsp[(2) - (4)].s));
-         ;}
+            if ((yyvsp[(4) - (4)].sr)->set != 'P') {
+                mem_sys_free((yyvsp[(2) - (4)].s));
+                IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
+                    "Cannot use %c register with .lex", (yyvsp[(4) - (4)].sr)->set);
+            }
+            else {
+               SymReg *n;
+               char   *name = mem_sys_strdup((yyvsp[(2) - (4)].s) + 1);
+               name[strlen(name) - 1] = 0;
+               n = mk_const(interp, name, 'S');
+               set_lexical(interp, (yyvsp[(4) - (4)].sr), n); (yyval.i) = 0;
+               mem_sys_free((yyvsp[(2) - (4)].s));
+               mem_sys_free(name);
+            }
+         }
     break;
 
   case 182:
-#line 1931 "compilers/imcc/imcc.y"
-    { pesky_global__is_def=1; ;}
+
+/* Line 1455 of yacc.c  */
+#line 1961 "compilers/imcc/imcc.y"
+    {
+            if ((yyvsp[(4) - (4)].sr)->set != 'P') {
+                mem_sys_free((yyvsp[(2) - (4)].s));
+                IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
+                    "Cannot use %c register with .lex", (yyvsp[(4) - (4)].sr)->set);
+            }
+            else {
+               SymReg *n = mk_const(interp, (yyvsp[(2) - (4)].s), 'U');
+               set_lexical(interp, (yyvsp[(4) - (4)].sr), n); (yyval.i) = 0;
+               mem_sys_free((yyvsp[(2) - (4)].s));
+            }
+         }
     break;
 
   case 183:
-#line 1932 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 1973 "compilers/imcc/imcc.y"
+    { IMCC_INFO(interp)->is_def = 1; }
+    break;
+
+  case 184:
+
+/* Line 1455 of yacc.c  */
+#line 1974 "compilers/imcc/imcc.y"
     {
            mk_const_ident(interp, (yyvsp[(4) - (6)].s), (yyvsp[(3) - (6)].t), (yyvsp[(6) - (6)].sr), 0);
-           pesky_global__is_def=0;
+           IMCC_INFO(interp)->is_def = 0;
            mem_sys_free((yyvsp[(4) - (6)].s));
-         ;}
+         }
     break;
 
-  case 185:
-#line 1939 "compilers/imcc/imcc.y"
-    { pesky_global__is_def=1; ;}
+  case 186:
+
+/* Line 1455 of yacc.c  */
+#line 1981 "compilers/imcc/imcc.y"
+    { IMCC_INFO(interp)->is_def = 1; }
     break;
 
-  case 186:
-#line 1940 "compilers/imcc/imcc.y"
+  case 187:
+
+/* Line 1455 of yacc.c  */
+#line 1982 "compilers/imcc/imcc.y"
     {
            mk_const_ident(interp, (yyvsp[(4) - (6)].s), (yyvsp[(3) - (6)].t), (yyvsp[(6) - (6)].sr), 1);
-           pesky_global__is_def=0;
+           IMCC_INFO(interp)->is_def = 0;
            mem_sys_free((yyvsp[(4) - (6)].s));
-         ;}
+         }
     break;
 
-  case 187:
-#line 1946 "compilers/imcc/imcc.y"
+  case 188:
+
+/* Line 1455 of yacc.c  */
+#line 1988 "compilers/imcc/imcc.y"
     {
            (yyval.i) = NULL;
            IMCC_INFO(interp)->cur_call->pcc_sub->flags |= isTAIL_CALL;
            IMCC_INFO(interp)->cur_call = NULL;
-         ;}
+         }
     break;
 
-  case 188:
-#line 1952 "compilers/imcc/imcc.y"
+  case 189:
+
+/* Line 1455 of yacc.c  */
+#line 1994 "compilers/imcc/imcc.y"
     {
             (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "branch", 1, (yyvsp[(2) - (2)].sr));
-         ;}
+         }
     break;
 
-  case 189:
-#line 1956 "compilers/imcc/imcc.y"
+  case 190:
+
+/* Line 1455 of yacc.c  */
+#line 1998 "compilers/imcc/imcc.y"
     {
            (yyval.i) = INS(interp,
                     IMCC_INFO(interp)->cur_unit,
@@ -4360,51 +4734,69 @@
                     IMCC_INFO(interp)->keyvec,
                     1);
            mem_sys_free((yyvsp[(1) - (2)].s));
-         ;}
-    break;
-
-  case 190:
-#line 1967 "compilers/imcc/imcc.y"
-    { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "null", 1, (yyvsp[(2) - (2)].sr)); ;}
+         }
     break;
 
   case 191:
-#line 1968 "compilers/imcc/imcc.y"
-    { (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2009 "compilers/imcc/imcc.y"
+    { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "null", 1, (yyvsp[(2) - (2)].sr)); }
     break;
 
   case 192:
-#line 1969 "compilers/imcc/imcc.y"
-    { (yyval.i) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2010 "compilers/imcc/imcc.y"
+    { (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; }
     break;
 
-  case 195:
-#line 1972 "compilers/imcc/imcc.y"
-    { (yyval.i) = 0;;}
+  case 193:
+
+/* Line 1455 of yacc.c  */
+#line 2011 "compilers/imcc/imcc.y"
+    { (yyval.i) = 0; }
     break;
 
   case 196:
-#line 1976 "compilers/imcc/imcc.y"
-    { (yyval.t) = 'I'; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2014 "compilers/imcc/imcc.y"
+    { (yyval.i) = 0;}
     break;
 
   case 197:
-#line 1977 "compilers/imcc/imcc.y"
-    { (yyval.t) = 'N'; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2018 "compilers/imcc/imcc.y"
+    { (yyval.t) = 'I'; }
     break;
 
   case 198:
-#line 1978 "compilers/imcc/imcc.y"
-    { (yyval.t) = 'S'; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2019 "compilers/imcc/imcc.y"
+    { (yyval.t) = 'N'; }
     break;
 
   case 199:
-#line 1979 "compilers/imcc/imcc.y"
-    { (yyval.t) = 'P'; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2020 "compilers/imcc/imcc.y"
+    { (yyval.t) = 'S'; }
     break;
 
   case 200:
-#line 1984 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 2021 "compilers/imcc/imcc.y"
+    { (yyval.t) = 'P'; }
+    break;
+
+  case 201:
+
+/* Line 1455 of yacc.c  */
+#line 2026 "compilers/imcc/imcc.y"
     {
            /* there'd normally be a mem_sys_strdup() here, but the lexer already
             * copied the string, so it's safe to use directly */
@@ -4413,323 +4805,437 @@
                IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
                     "Unknown PMC type '%s'\n", (yyvsp[(1) - (1)].s));
            }
-         ;}
-    break;
-
-  case 201:
-#line 1997 "compilers/imcc/imcc.y"
-    { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "set", 2, (yyvsp[(1) - (3)].sr), (yyvsp[(3) - (3)].sr));  ;}
+         }
     break;
 
   case 202:
-#line 1999 "compilers/imcc/imcc.y"
-    { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (4)].s), 2, (yyvsp[(1) - (4)].sr), (yyvsp[(4) - (4)].sr));  ;}
+
+/* Line 1455 of yacc.c  */
+#line 2039 "compilers/imcc/imcc.y"
+    { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "set", 2, (yyvsp[(1) - (3)].sr), (yyvsp[(3) - (3)].sr));  }
     break;
 
   case 203:
-#line 2001 "compilers/imcc/imcc.y"
-    { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(4) - (5)].s), 3, (yyvsp[(1) - (5)].sr), (yyvsp[(3) - (5)].sr), (yyvsp[(5) - (5)].sr));  ;}
+
+/* Line 1455 of yacc.c  */
+#line 2041 "compilers/imcc/imcc.y"
+    { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (4)].s), 2, (yyvsp[(1) - (4)].sr), (yyvsp[(4) - (4)].sr));  }
     break;
 
   case 204:
-#line 2003 "compilers/imcc/imcc.y"
-    { (yyval.i) = iINDEXFETCH(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (6)].sr), (yyvsp[(3) - (6)].sr), (yyvsp[(5) - (6)].sr)); ;}
+
+/* Line 1455 of yacc.c  */
+#line 2043 "compilers/imcc/imcc.y"
+    { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(4) - (5)].s), 3, (yyvsp[(1) - (5)].sr), (yyvsp[(3) - (5)].sr), (yyvsp[(5) - (5)].sr)); }
     break;
 
   case 205:
-#line 2005 "compilers/imcc/imcc.y"
-    { (yyval.i) = iINDEXSET(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (6)].sr), (yyvsp[(3) - (6)].sr), (yyvsp[(6) - (6)].sr)); ;}
+
+/* Line 1455 of yacc.c  */
+#line 2045 "compilers/imcc/imcc.y"
+    { (yyval.i) = iINDEXFETCH(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (6)].sr), (yyvsp[(3) - (6)].sr), (yyvsp[(5) - (6)].sr)); }
     break;
 
   case 206:
-#line 2010 "compilers/imcc/imcc.y"
-    { (yyval.i) = iNEW(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (7)].sr), (yyvsp[(4) - (7)].s), (yyvsp[(6) - (7)].sr), 1); ;}
+
+/* Line 1455 of yacc.c  */
+#line 2047 "compilers/imcc/imcc.y"
+    { (yyval.i) = iINDEXSET(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (6)].sr), (yyvsp[(3) - (6)].sr), (yyvsp[(6) - (6)].sr)); }
     break;
 
   case 207:
-#line 2013 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 2052 "compilers/imcc/imcc.y"
+    { (yyval.i) = iNEW(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (7)].sr), (yyvsp[(4) - (7)].s), (yyvsp[(6) - (7)].sr), 1); }
+    break;
+
+  case 208:
+
+/* Line 1455 of yacc.c  */
+#line 2055 "compilers/imcc/imcc.y"
     {
            add_pcc_result((yyvsp[(3) - (3)].i)->symregs[0], (yyvsp[(1) - (3)].sr));
            IMCC_INFO(interp)->cur_call = NULL;
            (yyval.i) = 0;
-         ;}
+         }
     break;
 
-  case 208:
-#line 2019 "compilers/imcc/imcc.y"
+  case 209:
+
+/* Line 1455 of yacc.c  */
+#line 2061 "compilers/imcc/imcc.y"
     {
            (yyval.i) = IMCC_create_itcall_label(interp);
-         ;}
+         }
     break;
 
-  case 209:
-#line 2023 "compilers/imcc/imcc.y"
+  case 210:
+
+/* Line 1455 of yacc.c  */
+#line 2065 "compilers/imcc/imcc.y"
     {
            IMCC_itcall_sub(interp, (yyvsp[(6) - (9)].sr));
            IMCC_INFO(interp)->cur_call = NULL;
-         ;}
+         }
     break;
 
-  case 213:
-#line 2031 "compilers/imcc/imcc.y"
+  case 214:
+
+/* Line 1455 of yacc.c  */
+#line 2073 "compilers/imcc/imcc.y"
     {
            (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "null", 1, (yyvsp[(1) - (3)].sr));
-         ;}
-    break;
-
-  case 214:
-#line 2038 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"not"; ;}
+         }
     break;
 
   case 215:
-#line 2039 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"bnot"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2080 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"not"; }
     break;
 
   case 216:
-#line 2040 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"neg"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2081 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"bnot"; }
     break;
 
   case 217:
-#line 2044 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"sub"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2082 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"neg"; }
     break;
 
   case 218:
-#line 2045 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"add"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2086 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"sub"; }
     break;
 
   case 219:
-#line 2046 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"mul"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2087 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"add"; }
     break;
 
   case 220:
-#line 2047 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"div"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2088 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"mul"; }
     break;
 
   case 221:
-#line 2048 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"mod"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2089 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"div"; }
     break;
 
   case 222:
-#line 2049 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"fdiv"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2090 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"mod"; }
     break;
 
   case 223:
-#line 2050 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"pow"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2091 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"fdiv"; }
     break;
 
   case 224:
-#line 2051 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"concat"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2092 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"pow"; }
     break;
 
   case 225:
-#line 2052 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"iseq"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2093 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"concat"; }
     break;
 
   case 226:
-#line 2053 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"isne"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2094 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"iseq"; }
     break;
 
   case 227:
-#line 2054 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"isgt"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2095 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"isne"; }
     break;
 
   case 228:
-#line 2055 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"isge"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2096 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"isgt"; }
     break;
 
   case 229:
-#line 2056 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"islt"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2097 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"isge"; }
     break;
 
   case 230:
-#line 2057 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"isle"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2098 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"islt"; }
     break;
 
   case 231:
-#line 2058 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"shl"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2099 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"isle"; }
     break;
 
   case 232:
-#line 2059 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"shr"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2100 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"shl"; }
     break;
 
   case 233:
-#line 2060 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"lsr"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2101 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"shr"; }
     break;
 
   case 234:
-#line 2061 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"and"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2102 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"lsr"; }
     break;
 
   case 235:
-#line 2062 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"or"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2103 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"and"; }
     break;
 
   case 236:
-#line 2063 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"xor"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2104 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"or"; }
     break;
 
   case 237:
-#line 2064 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"band"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2105 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"xor"; }
     break;
 
   case 238:
-#line 2065 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"bor"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2106 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"band"; }
     break;
 
   case 239:
-#line 2066 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"bxor"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2107 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"bor"; }
     break;
 
   case 240:
-#line 2072 "compilers/imcc/imcc.y"
-    {
-           (yyval.i) = IMCC_create_itcall_label(interp);
-           (yyval.i)->type &= ~ITCALL;
-           (yyval.i)->type |= ITRESULT;
-         ;}
+
+/* Line 1455 of yacc.c  */
+#line 2108 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"bxor"; }
     break;
 
   case 241:
-#line 2077 "compilers/imcc/imcc.y"
-    {  (yyval.i) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2114 "compilers/imcc/imcc.y"
+    {
+           (yyval.i) = IMCC_create_itcall_label(interp);
+           (yyval.i)->type &= ~ITCALL;
+           (yyval.i)->type |= ITRESULT;
+         }
     break;
 
   case 242:
-#line 2084 "compilers/imcc/imcc.y"
-    {
-           (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(2) - (3)].s), 2, (yyvsp[(1) - (3)].sr), (yyvsp[(3) - (3)].sr));
-         ;}
+
+/* Line 1455 of yacc.c  */
+#line 2119 "compilers/imcc/imcc.y"
+    {  (yyval.i) = 0; }
     break;
 
   case 243:
-#line 2090 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"add"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2126 "compilers/imcc/imcc.y"
+    { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(2) - (3)].s), 2, (yyvsp[(1) - (3)].sr), (yyvsp[(3) - (3)].sr)); }
     break;
 
   case 244:
-#line 2091 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"sub"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2130 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"add"; }
     break;
 
   case 245:
-#line 2092 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"mul"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2131 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"sub"; }
     break;
 
   case 246:
-#line 2093 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"div"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2132 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"mul"; }
     break;
 
   case 247:
-#line 2094 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"mod"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2133 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"div"; }
     break;
 
   case 248:
-#line 2095 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"fdiv"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2134 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"mod"; }
     break;
 
   case 249:
-#line 2096 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"concat"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2135 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"fdiv"; }
     break;
 
   case 250:
-#line 2097 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"band"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2136 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"concat"; }
     break;
 
   case 251:
-#line 2098 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"bor"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2137 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"band"; }
     break;
 
   case 252:
-#line 2099 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"bxor"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2138 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"bor"; }
     break;
 
   case 253:
-#line 2100 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"shr"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2139 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"bxor"; }
     break;
 
   case 254:
-#line 2101 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"shl"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2140 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"shr"; }
     break;
 
   case 255:
-#line 2102 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"lsr"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2141 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"shl"; }
     break;
 
   case 256:
-#line 2108 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 2142 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"lsr"; }
+    break;
+
+  case 257:
+
+/* Line 1455 of yacc.c  */
+#line 2148 "compilers/imcc/imcc.y"
     {
         (yyval.i) = func_ins(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (4)].sr), (yyvsp[(3) - (4)].s),
                       IMCC_INFO(interp) -> regs,
                       IMCC_INFO(interp) -> nargs,
                       IMCC_INFO(interp) -> keyvec, 1);
          mem_sys_free((yyvsp[(3) - (4)].s));
-       ;}
-    break;
-
-  case 257:
-#line 2118 "compilers/imcc/imcc.y"
-    { (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s));       mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+       }
     break;
 
   case 258:
-#line 2119 "compilers/imcc/imcc.y"
-    { (yyval.sr) = mk_sub_address_fromc(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+
+/* Line 1455 of yacc.c  */
+#line 2158 "compilers/imcc/imcc.y"
+    { (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s));       mem_sys_free((yyvsp[(1) - (1)].s)); }
     break;
 
   case 259:
-#line 2120 "compilers/imcc/imcc.y"
-    { (yyval.sr) = mk_sub_address_u(interp, (yyvsp[(1) - (1)].s));     mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+
+/* Line 1455 of yacc.c  */
+#line 2159 "compilers/imcc/imcc.y"
+    { (yyval.sr) = mk_sub_address_fromc(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
     break;
 
   case 260:
-#line 2122 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 2160 "compilers/imcc/imcc.y"
+    { (yyval.sr) = mk_sub_address_u(interp, (yyvsp[(1) - (1)].s));     mem_sys_free((yyvsp[(1) - (1)].s)); }
+    break;
+
+  case 261:
+
+/* Line 1455 of yacc.c  */
+#line 2162 "compilers/imcc/imcc.y"
     {
            (yyval.sr) = (yyvsp[(1) - (1)].sr);
            if ((yyvsp[(1) - (1)].sr)->set != 'P')
                IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR, "Sub isn't a PMC");
-         ;}
+         }
     break;
 
-  case 261:
-#line 2128 "compilers/imcc/imcc.y"
+  case 262:
+
+/* Line 1455 of yacc.c  */
+#line 2168 "compilers/imcc/imcc.y"
     {
             /* disallow bareword method names; SREG name constants are fine */
             const char * const name = (yyvsp[(3) - (3)].sr)->name;
@@ -4742,52 +5248,66 @@
 
             IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr);
             (yyval.sr)                         = (yyvsp[(3) - (3)].sr);
-        ;}
+        }
     break;
 
-  case 262:
-#line 2142 "compilers/imcc/imcc.y"
+  case 263:
+
+/* Line 1455 of yacc.c  */
+#line 2182 "compilers/imcc/imcc.y"
     {
             IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr);
             (yyval.sr)                         = mk_const(interp, (yyvsp[(3) - (3)].s), 'U');
             mem_sys_free((yyvsp[(3) - (3)].s));
-         ;}
+         }
     break;
 
-  case 263:
-#line 2148 "compilers/imcc/imcc.y"
+  case 264:
+
+/* Line 1455 of yacc.c  */
+#line 2188 "compilers/imcc/imcc.y"
     {
             IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr);
             (yyval.sr)                         = mk_const(interp, (yyvsp[(3) - (3)].s), 'S');
             mem_sys_free((yyvsp[(3) - (3)].s));
-         ;}
+         }
     break;
 
-  case 264:
-#line 2153 "compilers/imcc/imcc.y"
-    { IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr); (yyval.sr) = (yyvsp[(3) - (3)].sr); ;}
+  case 265:
+
+/* Line 1455 of yacc.c  */
+#line 2193 "compilers/imcc/imcc.y"
+    { IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr); (yyval.sr) = (yyvsp[(3) - (3)].sr); }
     break;
 
-  case 265:
-#line 2159 "compilers/imcc/imcc.y"
+  case 266:
+
+/* Line 1455 of yacc.c  */
+#line 2199 "compilers/imcc/imcc.y"
     {
            (yyval.i) = IMCC_create_itcall_label(interp);
            IMCC_itcall_sub(interp, (yyvsp[(1) - (1)].sr));
-         ;}
-    break;
-
-  case 266:
-#line 2163 "compilers/imcc/imcc.y"
-    { (yyval.i) = (yyvsp[(2) - (5)].i); ;}
+         }
     break;
 
   case 267:
-#line 2167 "compilers/imcc/imcc.y"
-    { (yyval.sr) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2203 "compilers/imcc/imcc.y"
+    { (yyval.i) = (yyvsp[(2) - (5)].i); }
     break;
 
   case 268:
-#line 2169 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 2207 "compilers/imcc/imcc.y"
+    { (yyval.sr) = 0; }
+    break;
+
+  case 269:
+
+/* Line 1455 of yacc.c  */
+#line 2209 "compilers/imcc/imcc.y"
     {
            (yyval.sr) = 0;
            if (IMCC_INFO(interp)->adv_named_id) {
@@ -4796,11 +5316,13 @@
            }
            else
                add_pcc_arg(IMCC_INFO(interp)->cur_call, (yyvsp[(3) - (3)].sr));
-         ;}
+         }
     break;
 
-  case 269:
-#line 2179 "compilers/imcc/imcc.y"
+  case 270:
+
+/* Line 1455 of yacc.c  */
+#line 2219 "compilers/imcc/imcc.y"
     {
            (yyval.sr) = 0;
            if (IMCC_INFO(interp)->adv_named_id) {
@@ -4809,79 +5331,110 @@
            }
            else
                add_pcc_arg(IMCC_INFO(interp)->cur_call, (yyvsp[(1) - (1)].sr));
-         ;}
+         }
     break;
 
-  case 270:
-#line 2189 "compilers/imcc/imcc.y"
+  case 271:
+
+/* Line 1455 of yacc.c  */
+#line 2229 "compilers/imcc/imcc.y"
     {
            (yyval.sr) = 0;
            add_pcc_named_arg(IMCC_INFO(interp)->cur_call,
                 mk_const(interp, (yyvsp[(3) - (5)].s), 'S'), (yyvsp[(5) - (5)].sr));
            mem_sys_free((yyvsp[(3) - (5)].s));
-         ;}
+         }
     break;
 
-  case 271:
-#line 2196 "compilers/imcc/imcc.y"
+  case 272:
+
+/* Line 1455 of yacc.c  */
+#line 2236 "compilers/imcc/imcc.y"
     {
            (yyval.sr) = 0;
            add_pcc_named_arg_var(IMCC_INFO(interp)->cur_call, (yyvsp[(1) - (3)].sr), (yyvsp[(3) - (3)].sr));
-         ;}
+         }
     break;
 
-  case 272:
-#line 2201 "compilers/imcc/imcc.y"
+  case 273:
+
+/* Line 1455 of yacc.c  */
+#line 2241 "compilers/imcc/imcc.y"
     {
            (yyval.sr) = 0;
            add_pcc_named_arg(IMCC_INFO(interp)->cur_call,
                 mk_const(interp, (yyvsp[(1) - (3)].s), 'S'), (yyvsp[(3) - (3)].sr));
            mem_sys_free((yyvsp[(1) - (3)].s));
-         ;}
-    break;
-
-  case 273:
-#line 2210 "compilers/imcc/imcc.y"
-    { (yyval.sr) = (yyvsp[(1) - (2)].sr); (yyval.sr)->type |= (yyvsp[(2) - (2)].t); ;}
+         }
     break;
 
   case 274:
-#line 2214 "compilers/imcc/imcc.y"
-    { (yyval.t) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2250 "compilers/imcc/imcc.y"
+    { (yyval.sr) = (yyvsp[(1) - (2)].sr); (yyval.sr)->type |= (yyvsp[(2) - (2)].t); }
     break;
 
   case 275:
-#line 2215 "compilers/imcc/imcc.y"
-    { (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); ;}
+
+/* Line 1455 of yacc.c  */
+#line 2254 "compilers/imcc/imcc.y"
+    { (yyval.t) = 0; }
     break;
 
   case 276:
-#line 2219 "compilers/imcc/imcc.y"
-    { (yyval.t) = VT_FLAT; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2255 "compilers/imcc/imcc.y"
+    { (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); }
     break;
 
   case 277:
-#line 2220 "compilers/imcc/imcc.y"
-    { (yyval.t) = VT_NAMED; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2259 "compilers/imcc/imcc.y"
+    { (yyval.t) = VT_FLAT;     }
     break;
 
   case 278:
-#line 2223 "compilers/imcc/imcc.y"
-    { adv_named_set_u(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2260 "compilers/imcc/imcc.y"
+    { (yyval.t) = VT_NAMED;    }
     break;
 
   case 279:
-#line 2224 "compilers/imcc/imcc.y"
-    { adv_named_set(interp, (yyvsp[(3) - (4)].s));   (yyval.t) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2261 "compilers/imcc/imcc.y"
+    { (yyval.t) = VT_CALL_SIG; }
     break;
 
   case 280:
-#line 2228 "compilers/imcc/imcc.y"
-    { (yyval.sr) = (yyvsp[(1) - (2)].sr); (yyval.sr)->type |= (yyvsp[(2) - (2)].t); ;}
+
+/* Line 1455 of yacc.c  */
+#line 2264 "compilers/imcc/imcc.y"
+    { adv_named_set_u(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; }
     break;
 
   case 281:
-#line 2233 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 2265 "compilers/imcc/imcc.y"
+    { adv_named_set(interp, (yyvsp[(3) - (4)].s));   (yyval.t) = 0; }
+    break;
+
+  case 282:
+
+/* Line 1455 of yacc.c  */
+#line 2269 "compilers/imcc/imcc.y"
+    { (yyval.sr) = (yyvsp[(1) - (2)].sr); (yyval.sr)->type |= (yyvsp[(2) - (2)].t); }
+    break;
+
+  case 283:
+
+/* Line 1455 of yacc.c  */
+#line 2274 "compilers/imcc/imcc.y"
     {
            (yyval.sr) = 0;
            if (IMCC_INFO(interp)->adv_named_id) {
@@ -4890,20 +5443,24 @@
            }
            else
                add_pcc_result(IMCC_INFO(interp)->cur_call, (yyvsp[(3) - (3)].sr));
-         ;}
+         }
     break;
 
-  case 282:
-#line 2243 "compilers/imcc/imcc.y"
+  case 284:
+
+/* Line 1455 of yacc.c  */
+#line 2284 "compilers/imcc/imcc.y"
     {
             add_pcc_named_result(IMCC_INFO(interp)->cur_call,
             mk_const(interp, (yyvsp[(3) - (5)].s), 'S'), (yyvsp[(5) - (5)].sr));
             mem_sys_free((yyvsp[(3) - (5)].s));
-         ;}
+         }
     break;
 
-  case 283:
-#line 2249 "compilers/imcc/imcc.y"
+  case 285:
+
+/* Line 1455 of yacc.c  */
+#line 2290 "compilers/imcc/imcc.y"
     {
            (yyval.sr) = 0;
            if (IMCC_INFO(interp)->adv_named_id) {
@@ -4912,286 +5469,375 @@
            }
            else
                add_pcc_result(IMCC_INFO(interp)->cur_call, (yyvsp[(1) - (1)].sr));
-         ;}
+         }
     break;
 
-  case 284:
-#line 2259 "compilers/imcc/imcc.y"
+  case 286:
+
+/* Line 1455 of yacc.c  */
+#line 2300 "compilers/imcc/imcc.y"
     {
            add_pcc_named_result(IMCC_INFO(interp)->cur_call, mk_const(interp, (yyvsp[(1) - (3)].s), 'S'), (yyvsp[(3) - (3)].sr));
            mem_sys_free((yyvsp[(1) - (3)].s));
-         ;}
-    break;
-
-  case 285:
-#line 2263 "compilers/imcc/imcc.y"
-    { (yyval.sr) = 0; ;}
-    break;
-
-  case 286:
-#line 2267 "compilers/imcc/imcc.y"
-    { (yyval.i) = (yyvsp[(1) - (1)].i); ;}
+         }
     break;
 
   case 287:
-#line 2268 "compilers/imcc/imcc.y"
-    { (yyval.i) = (yyvsp[(1) - (1)].i); ;}
+
+/* Line 1455 of yacc.c  */
+#line 2304 "compilers/imcc/imcc.y"
+    { (yyval.sr) = 0; }
     break;
 
   case 288:
-#line 2273 "compilers/imcc/imcc.y"
-    {
-           (yyval.i) =MK_I(interp, IMCC_INFO(interp)->cur_unit, inv_op((yyvsp[(3) - (6)].s)), 3, (yyvsp[(2) - (6)].sr), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].sr));
-         ;}
+
+/* Line 1455 of yacc.c  */
+#line 2308 "compilers/imcc/imcc.y"
+    { (yyval.i) = (yyvsp[(1) - (1)].i); }
     break;
 
   case 289:
-#line 2277 "compilers/imcc/imcc.y"
-    {
-           (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "unless_null", 2, (yyvsp[(3) - (5)].sr), (yyvsp[(5) - (5)].sr));
-         ;}
+
+/* Line 1455 of yacc.c  */
+#line 2309 "compilers/imcc/imcc.y"
+    { (yyval.i) = (yyvsp[(1) - (1)].i); }
     break;
 
   case 290:
-#line 2281 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 2314 "compilers/imcc/imcc.y"
     {
-           (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "unless", 2, (yyvsp[(2) - (4)].sr), (yyvsp[(4) - (4)].sr));
-         ;}
+           (yyval.i) =MK_I(interp, IMCC_INFO(interp)->cur_unit, inv_op((yyvsp[(3) - (6)].s)), 3, (yyvsp[(2) - (6)].sr), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].sr));
+         }
     break;
 
   case 291:
-#line 2288 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 2318 "compilers/imcc/imcc.y"
     {
-           (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "if", 2, (yyvsp[(2) - (4)].sr), (yyvsp[(4) - (4)].sr));
-         ;}
+           (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "unless_null", 2, (yyvsp[(3) - (5)].sr), (yyvsp[(5) - (5)].sr));
+         }
     break;
 
   case 292:
-#line 2292 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 2322 "compilers/imcc/imcc.y"
     {
-           (yyval.i) =MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (6)].s), 3, (yyvsp[(2) - (6)].sr), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].sr));
-         ;}
+           (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "unless", 2, (yyvsp[(2) - (4)].sr), (yyvsp[(4) - (4)].sr));
+         }
     break;
 
   case 293:
-#line 2296 "compilers/imcc/imcc.y"
+
+/* Line 1455 of yacc.c  */
+#line 2329 "compilers/imcc/imcc.y"
     {
-           (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "if_null", 2, (yyvsp[(3) - (5)].sr), (yyvsp[(5) - (5)].sr));
-         ;}
+           (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "if", 2, (yyvsp[(2) - (4)].sr), (yyvsp[(4) - (4)].sr));
+         }
     break;
 
   case 294:
-#line 2302 "compilers/imcc/imcc.y"
-    { (yyval.t) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2333 "compilers/imcc/imcc.y"
+    {
+           (yyval.i) =MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (6)].s), 3, (yyvsp[(2) - (6)].sr), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].sr));
+         }
     break;
 
   case 295:
-#line 2303 "compilers/imcc/imcc.y"
-    { (yyval.t) = 0; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2337 "compilers/imcc/imcc.y"
+    {
+           (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "if_null", 2, (yyvsp[(3) - (5)].sr), (yyvsp[(5) - (5)].sr));
+         }
     break;
 
   case 296:
-#line 2307 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"eq"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2343 "compilers/imcc/imcc.y"
+    { (yyval.t) = 0; }
     break;
 
   case 297:
-#line 2308 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"ne"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2344 "compilers/imcc/imcc.y"
+    { (yyval.t) = 0; }
     break;
 
   case 298:
-#line 2309 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"gt"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2348 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"eq"; }
     break;
 
   case 299:
-#line 2310 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"ge"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2349 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"ne"; }
     break;
 
   case 300:
-#line 2311 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"lt"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2350 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"gt"; }
     break;
 
   case 301:
-#line 2312 "compilers/imcc/imcc.y"
-    { (yyval.s) = (char *)"le"; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2351 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"ge"; }
     break;
 
-  case 304:
-#line 2321 "compilers/imcc/imcc.y"
-    { (yyval.sr) = NULL; ;}
+  case 302:
+
+/* Line 1455 of yacc.c  */
+#line 2352 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"lt"; }
     break;
 
-  case 305:
-#line 2322 "compilers/imcc/imcc.y"
-    { (yyval.sr) = (yyvsp[(1) - (1)].sr); ;}
+  case 303:
+
+/* Line 1455 of yacc.c  */
+#line 2353 "compilers/imcc/imcc.y"
+    { (yyval.s) = (char *)"le"; }
     break;
 
   case 306:
-#line 2326 "compilers/imcc/imcc.y"
-    { (yyval.sr) = IMCC_INFO(interp)->regs[0]; ;}
+
+/* Line 1455 of yacc.c  */
+#line 2362 "compilers/imcc/imcc.y"
+    { (yyval.sr) = NULL; }
+    break;
+
+  case 307:
+
+/* Line 1455 of yacc.c  */
+#line 2363 "compilers/imcc/imcc.y"
+    { (yyval.sr) = (yyvsp[(1) - (1)].sr); }
     break;
 
   case 308:
-#line 2331 "compilers/imcc/imcc.y"
-    { IMCC_INFO(interp)->regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(1) - (1)].sr); ;}
+
+/* Line 1455 of yacc.c  */
+#line 2367 "compilers/imcc/imcc.y"
+    { (yyval.sr) = IMCC_INFO(interp)->regs[0]; }
     break;
 
-  case 309:
-#line 2333 "compilers/imcc/imcc.y"
+  case 310:
+
+/* Line 1455 of yacc.c  */
+#line 2372 "compilers/imcc/imcc.y"
+    { IMCC_INFO(interp)->regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(1) - (1)].sr); }
+    break;
+
+  case 311:
+
+/* Line 1455 of yacc.c  */
+#line 2374 "compilers/imcc/imcc.y"
     {
            IMCC_INFO(interp) -> regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(1) - (4)].sr);
            IMCC_INFO(interp) -> keyvec |= KEY_BIT(IMCC_INFO(interp)->nargs);
            IMCC_INFO(interp) -> regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(3) - (4)].sr);
            (yyval.sr) = (yyvsp[(1) - (4)].sr);
-         ;}
+         }
     break;
 
-  case 310:
-#line 2340 "compilers/imcc/imcc.y"
+  case 312:
+
+/* Line 1455 of yacc.c  */
+#line 2381 "compilers/imcc/imcc.y"
     {
            IMCC_INFO(interp) -> regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(2) - (3)].sr);
            (yyval.sr) = (yyvsp[(2) - (3)].sr);
-         ;}
-    break;
-
-  case 312:
-#line 2347 "compilers/imcc/imcc.y"
-    { (yyval.sr) = mk_sub_address_fromc(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
-    break;
-
-  case 313:
-#line 2348 "compilers/imcc/imcc.y"
-    { (yyval.sr) = mk_sub_address_u(interp, (yyvsp[(1) - (1)].s));  mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+         }
     break;
 
   case 314:
-#line 2352 "compilers/imcc/imcc.y"
-    { (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+
+/* Line 1455 of yacc.c  */
+#line 2388 "compilers/imcc/imcc.y"
+    { (yyval.sr) = mk_sub_address_fromc(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
     break;
 
   case 315:
-#line 2353 "compilers/imcc/imcc.y"
-    { (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+
+/* Line 1455 of yacc.c  */
+#line 2389 "compilers/imcc/imcc.y"
+    { (yyval.sr) = mk_sub_address_u(interp, (yyvsp[(1) - (1)].s));  mem_sys_free((yyvsp[(1) - (1)].s)); }
     break;
 
   case 316:
-#line 2357 "compilers/imcc/imcc.y"
-    { (yyval.sr) = mk_label_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+
+/* Line 1455 of yacc.c  */
+#line 2393 "compilers/imcc/imcc.y"
+    { (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
     break;
 
   case 317:
-#line 2358 "compilers/imcc/imcc.y"
-    { (yyval.sr) = mk_label_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+
+/* Line 1455 of yacc.c  */
+#line 2394 "compilers/imcc/imcc.y"
+    { (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
     break;
 
-  case 322:
-#line 2372 "compilers/imcc/imcc.y"
+  case 318:
+
+/* Line 1455 of yacc.c  */
+#line 2398 "compilers/imcc/imcc.y"
+    { (yyval.sr) = mk_label_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
+    break;
+
+  case 319:
+
+/* Line 1455 of yacc.c  */
+#line 2399 "compilers/imcc/imcc.y"
+    { (yyval.sr) = mk_label_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
+    break;
+
+  case 324:
+
+/* Line 1455 of yacc.c  */
+#line 2413 "compilers/imcc/imcc.y"
     {
            IMCC_INFO(interp)->nkeys    = 0;
-           IMCC_INFO(interp)->in_slice = 0;
-         ;}
+         }
     break;
 
-  case 323:
-#line 2377 "compilers/imcc/imcc.y"
+  case 325:
+
+/* Line 1455 of yacc.c  */
+#line 2417 "compilers/imcc/imcc.y"
     {
            (yyval.sr) = link_keys(interp,
                           IMCC_INFO(interp)->nkeys,
                           IMCC_INFO(interp)->keys, 0);
-         ;}
+         }
     break;
 
-  case 324:
-#line 2385 "compilers/imcc/imcc.y"
+  case 326:
+
+/* Line 1455 of yacc.c  */
+#line 2425 "compilers/imcc/imcc.y"
     {
            IMCC_INFO(interp)->nkeys = 0;
-           IMCC_INFO(interp)->in_slice = 0;
-         ;}
+         }
     break;
 
-  case 325:
-#line 2390 "compilers/imcc/imcc.y"
+  case 327:
+
+/* Line 1455 of yacc.c  */
+#line 2429 "compilers/imcc/imcc.y"
     {
            (yyval.sr) = link_keys(interp,
                           IMCC_INFO(interp)->nkeys,
                           IMCC_INFO(interp)->keys, 1);
-         ;}
+         }
     break;
 
-  case 326:
-#line 2398 "compilers/imcc/imcc.y"
-    { IMCC_INFO(interp)->keys[IMCC_INFO(interp)->nkeys++] = (yyvsp[(1) - (1)].sr); ;}
+  case 328:
+
+/* Line 1455 of yacc.c  */
+#line 2437 "compilers/imcc/imcc.y"
+    { IMCC_INFO(interp)->keys[IMCC_INFO(interp)->nkeys++] = (yyvsp[(1) - (1)].sr); }
     break;
 
-  case 327:
-#line 2400 "compilers/imcc/imcc.y"
+  case 329:
+
+/* Line 1455 of yacc.c  */
+#line 2439 "compilers/imcc/imcc.y"
     {
            IMCC_INFO(interp)->keys[IMCC_INFO(interp)->nkeys++] = (yyvsp[(3) - (3)].sr);
            (yyval.sr) = IMCC_INFO(interp)->keys[0];
-         ;}
+         }
     break;
 
-  case 328:
-#line 2408 "compilers/imcc/imcc.y"
+  case 330:
+
+/* Line 1455 of yacc.c  */
+#line 2447 "compilers/imcc/imcc.y"
     {
-           if (IMCC_INFO(interp)->in_slice)
-               (yyvsp[(1) - (1)].sr)->type |= VT_START_SLICE | VT_END_SLICE;
            (yyval.sr) = (yyvsp[(1) - (1)].sr);
-         ;}
-    break;
-
-  case 329:
-#line 2416 "compilers/imcc/imcc.y"
-    { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'I'); ;}
-    break;
-
-  case 330:
-#line 2417 "compilers/imcc/imcc.y"
-    { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'N'); ;}
+         }
     break;
 
   case 331:
-#line 2418 "compilers/imcc/imcc.y"
-    { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'S'); ;}
+
+/* Line 1455 of yacc.c  */
+#line 2453 "compilers/imcc/imcc.y"
+    { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'I'); }
     break;
 
   case 332:
-#line 2419 "compilers/imcc/imcc.y"
-    { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'P'); ;}
+
+/* Line 1455 of yacc.c  */
+#line 2454 "compilers/imcc/imcc.y"
+    { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'N'); }
     break;
 
   case 333:
-#line 2420 "compilers/imcc/imcc.y"
-    { (yyval.sr) = mk_pasm_reg(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+
+/* Line 1455 of yacc.c  */
+#line 2455 "compilers/imcc/imcc.y"
+    { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'S'); }
     break;
 
   case 334:
-#line 2424 "compilers/imcc/imcc.y"
-    { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'I'); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+
+/* Line 1455 of yacc.c  */
+#line 2456 "compilers/imcc/imcc.y"
+    { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'P'); }
     break;
 
   case 335:
-#line 2425 "compilers/imcc/imcc.y"
-    { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'N'); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+
+/* Line 1455 of yacc.c  */
+#line 2457 "compilers/imcc/imcc.y"
+    { (yyval.sr) = mk_pasm_reg(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
     break;
 
   case 336:
-#line 2426 "compilers/imcc/imcc.y"
-    { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'S'); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+
+/* Line 1455 of yacc.c  */
+#line 2461 "compilers/imcc/imcc.y"
+    { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'I'); mem_sys_free((yyvsp[(1) - (1)].s)); }
     break;
 
   case 337:
-#line 2427 "compilers/imcc/imcc.y"
-    { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'U'); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+
+/* Line 1455 of yacc.c  */
+#line 2462 "compilers/imcc/imcc.y"
+    { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'N'); mem_sys_free((yyvsp[(1) - (1)].s)); }
+    break;
+
+  case 338:
+
+/* Line 1455 of yacc.c  */
+#line 2463 "compilers/imcc/imcc.y"
+    { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'S'); mem_sys_free((yyvsp[(1) - (1)].s)); }
+    break;
+
+  case 339:
+
+/* Line 1455 of yacc.c  */
+#line 2464 "compilers/imcc/imcc.y"
+    { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'U'); mem_sys_free((yyvsp[(1) - (1)].s)); }
     break;
 
 
-/* Line 1267 of yacc.c.  */
-#line 5184 "compilers/imcc/imcparser.c"
+
+/* Line 1455 of yacc.c  */
+#line 5830 "compilers/imcc/imcparser.c"
       default: break;
     }
   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -5202,7 +5848,6 @@
 
   *++yyvsp = yyval;
 
-
   /* Now `shift' the result of the reduction.  Determine what state
      that goes to, based on the state we popped back to and the rule
      number reduced by.  */
@@ -5267,7 +5912,7 @@
 
   if (yyerrstatus == 3)
     {
-      /* If just tried and failed to reuse look-ahead token after an
+      /* If just tried and failed to reuse lookahead token after an
 	 error, discard it.  */
 
       if (yychar <= YYEOF)
@@ -5284,7 +5929,7 @@
 	}
     }
 
-  /* Else will try to reuse look-ahead token after shifting the error
+  /* Else will try to reuse lookahead token after shifting the error
      token.  */
   goto yyerrlab1;
 
@@ -5341,9 +5986,6 @@
       YY_STACK_PRINT (yyss, yyssp);
     }
 
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
   *++yyvsp = yylval;
 
 
@@ -5368,7 +6010,7 @@
   yyresult = 1;
   goto yyreturn;
 
-#ifndef yyoverflow
+#if !defined(yyoverflow) || YYERROR_VERBOSE
 /*-------------------------------------------------.
 | yyexhaustedlab -- memory exhaustion comes here.  |
 `-------------------------------------------------*/
@@ -5379,7 +6021,7 @@
 #endif
 
 yyreturn:
-  if (yychar != YYEOF && yychar != YYEMPTY)
+  if (yychar != YYEMPTY)
      yydestruct ("Cleanup: discarding lookahead",
 		 yytoken, &yylval, yyscanner, interp);
   /* Do not reclaim the symbols of the rule which action triggered
@@ -5405,7 +6047,9 @@
 }
 
 
-#line 2433 "compilers/imcc/imcc.y"
+
+/* Line 1675 of yacc.c  */
+#line 2470 "compilers/imcc/imcc.y"
 
 
 /* I need this prototype somewhere... */

Modified: branches/orderedhash_revamp/compilers/imcc/imcparser.h
==============================================================================
--- branches/orderedhash_revamp/compilers/imcc/imcparser.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/imcc/imcparser.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -9,27 +9,26 @@
  */
 /* HEADERIZER HFILE: none */
 /* HEADERIZER STOP */
-/* A Bison parser, made by GNU Bison 2.3.  */
 
-/* Skeleton interface for Bison's Yacc-like parsers in C
+/* A Bison parser, made by GNU Bison 2.4.1.  */
 
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+/* Skeleton interface for Bison's Yacc-like parsers in C
+   
+      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or modify
+   
+   This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+   
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-
+   
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* As a special exception, you may create a larger work that contains
    part or all of the Bison parser skeleton and distribute that work
@@ -40,10 +39,11 @@
    special exception, which will cause the skeleton and the resulting
    Bison output files to be licensed under the GNU General Public
    License without this special exception.
-
+   
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
 
+
 /* Tokens.  */
 #ifndef YYTOKENTYPE
 # define YYTOKENTYPE
@@ -70,104 +70,105 @@
      ADV_ARROW = 275,
      NEW = 276,
      ADV_INVOCANT = 277,
-     NAMESPACE = 278,
-     DOT_METHOD = 279,
-     SUB = 280,
-     SYM = 281,
-     LOCAL = 282,
-     LEXICAL = 283,
-     CONST = 284,
-     ANNOTATE = 285,
-     INC = 286,
-     DEC = 287,
-     GLOBAL_CONST = 288,
-     PLUS_ASSIGN = 289,
-     MINUS_ASSIGN = 290,
-     MUL_ASSIGN = 291,
-     DIV_ASSIGN = 292,
-     CONCAT_ASSIGN = 293,
-     BAND_ASSIGN = 294,
-     BOR_ASSIGN = 295,
-     BXOR_ASSIGN = 296,
-     FDIV = 297,
-     FDIV_ASSIGN = 298,
-     MOD_ASSIGN = 299,
-     SHR_ASSIGN = 300,
-     SHL_ASSIGN = 301,
-     SHR_U_ASSIGN = 302,
-     SHIFT_LEFT = 303,
-     SHIFT_RIGHT = 304,
-     INTV = 305,
-     FLOATV = 306,
-     STRINGV = 307,
-     PMCV = 308,
-     LOG_XOR = 309,
-     RELOP_EQ = 310,
-     RELOP_NE = 311,
-     RELOP_GT = 312,
-     RELOP_GTE = 313,
-     RELOP_LT = 314,
-     RELOP_LTE = 315,
-     RESULT = 316,
-     RETURN = 317,
-     TAILCALL = 318,
-     YIELDT = 319,
-     GET_RESULTS = 320,
-     POW = 321,
-     SHIFT_RIGHT_U = 322,
-     LOG_AND = 323,
-     LOG_OR = 324,
-     COMMA = 325,
-     ESUB = 326,
-     DOTDOT = 327,
-     PCC_BEGIN = 328,
-     PCC_END = 329,
-     PCC_CALL = 330,
-     PCC_SUB = 331,
-     PCC_BEGIN_RETURN = 332,
-     PCC_END_RETURN = 333,
-     PCC_BEGIN_YIELD = 334,
-     PCC_END_YIELD = 335,
-     NCI_CALL = 336,
-     METH_CALL = 337,
-     INVOCANT = 338,
-     MAIN = 339,
-     LOAD = 340,
-     INIT = 341,
-     IMMEDIATE = 342,
-     POSTCOMP = 343,
-     METHOD = 344,
-     ANON = 345,
-     OUTER = 346,
-     NEED_LEX = 347,
-     MULTI = 348,
-     VTABLE_METHOD = 349,
-     LOADLIB = 350,
-     SUB_INSTANCE_OF = 351,
-     SUBID = 352,
-     NS_ENTRY = 353,
-     UNIQUE_REG = 354,
-     LABEL = 355,
-     EMIT = 356,
-     EOM = 357,
-     IREG = 358,
-     NREG = 359,
-     SREG = 360,
-     PREG = 361,
-     IDENTIFIER = 362,
-     REG = 363,
-     MACRO = 364,
-     ENDM = 365,
-     STRINGC = 366,
-     INTC = 367,
-     FLOATC = 368,
-     USTRINGC = 369,
-     PARROT_OP = 370,
-     VAR = 371,
-     LINECOMMENT = 372,
-     FILECOMMENT = 373,
-     DOT = 374,
-     CONCAT = 375
+     ADV_CALL_SIG = 278,
+     NAMESPACE = 279,
+     DOT_METHOD = 280,
+     SUB = 281,
+     SYM = 282,
+     LOCAL = 283,
+     LEXICAL = 284,
+     CONST = 285,
+     ANNOTATE = 286,
+     INC = 287,
+     DEC = 288,
+     GLOBAL_CONST = 289,
+     PLUS_ASSIGN = 290,
+     MINUS_ASSIGN = 291,
+     MUL_ASSIGN = 292,
+     DIV_ASSIGN = 293,
+     CONCAT_ASSIGN = 294,
+     BAND_ASSIGN = 295,
+     BOR_ASSIGN = 296,
+     BXOR_ASSIGN = 297,
+     FDIV = 298,
+     FDIV_ASSIGN = 299,
+     MOD_ASSIGN = 300,
+     SHR_ASSIGN = 301,
+     SHL_ASSIGN = 302,
+     SHR_U_ASSIGN = 303,
+     SHIFT_LEFT = 304,
+     SHIFT_RIGHT = 305,
+     INTV = 306,
+     FLOATV = 307,
+     STRINGV = 308,
+     PMCV = 309,
+     LOG_XOR = 310,
+     RELOP_EQ = 311,
+     RELOP_NE = 312,
+     RELOP_GT = 313,
+     RELOP_GTE = 314,
+     RELOP_LT = 315,
+     RELOP_LTE = 316,
+     RESULT = 317,
+     RETURN = 318,
+     TAILCALL = 319,
+     YIELDT = 320,
+     GET_RESULTS = 321,
+     POW = 322,
+     SHIFT_RIGHT_U = 323,
+     LOG_AND = 324,
+     LOG_OR = 325,
+     COMMA = 326,
+     ESUB = 327,
+     DOTDOT = 328,
+     PCC_BEGIN = 329,
+     PCC_END = 330,
+     PCC_CALL = 331,
+     PCC_SUB = 332,
+     PCC_BEGIN_RETURN = 333,
+     PCC_END_RETURN = 334,
+     PCC_BEGIN_YIELD = 335,
+     PCC_END_YIELD = 336,
+     NCI_CALL = 337,
+     METH_CALL = 338,
+     INVOCANT = 339,
+     MAIN = 340,
+     LOAD = 341,
+     INIT = 342,
+     IMMEDIATE = 343,
+     POSTCOMP = 344,
+     METHOD = 345,
+     ANON = 346,
+     OUTER = 347,
+     NEED_LEX = 348,
+     MULTI = 349,
+     VTABLE_METHOD = 350,
+     LOADLIB = 351,
+     SUB_INSTANCE_OF = 352,
+     SUBID = 353,
+     NS_ENTRY = 354,
+     UNIQUE_REG = 355,
+     LABEL = 356,
+     EMIT = 357,
+     EOM = 358,
+     IREG = 359,
+     NREG = 360,
+     SREG = 361,
+     PREG = 362,
+     IDENTIFIER = 363,
+     REG = 364,
+     MACRO = 365,
+     ENDM = 366,
+     STRINGC = 367,
+     INTC = 368,
+     FLOATC = 369,
+     USTRINGC = 370,
+     PARROT_OP = 371,
+     VAR = 372,
+     LINECOMMENT = 373,
+     FILECOMMENT = 374,
+     DOT = 375,
+     CONCAT = 376
    };
 #endif
 /* Tokens.  */
@@ -191,125 +192,132 @@
 #define ADV_ARROW 275
 #define NEW 276
 #define ADV_INVOCANT 277
-#define NAMESPACE 278
-#define DOT_METHOD 279
-#define SUB 280
-#define SYM 281
-#define LOCAL 282
-#define LEXICAL 283
-#define CONST 284
-#define ANNOTATE 285
-#define INC 286
-#define DEC 287
-#define GLOBAL_CONST 288
-#define PLUS_ASSIGN 289
-#define MINUS_ASSIGN 290
-#define MUL_ASSIGN 291
-#define DIV_ASSIGN 292
-#define CONCAT_ASSIGN 293
-#define BAND_ASSIGN 294
-#define BOR_ASSIGN 295
-#define BXOR_ASSIGN 296
-#define FDIV 297
-#define FDIV_ASSIGN 298
-#define MOD_ASSIGN 299
-#define SHR_ASSIGN 300
-#define SHL_ASSIGN 301
-#define SHR_U_ASSIGN 302
-#define SHIFT_LEFT 303
-#define SHIFT_RIGHT 304
-#define INTV 305
-#define FLOATV 306
-#define STRINGV 307
-#define PMCV 308
-#define LOG_XOR 309
-#define RELOP_EQ 310
-#define RELOP_NE 311
-#define RELOP_GT 312
-#define RELOP_GTE 313
-#define RELOP_LT 314
-#define RELOP_LTE 315
-#define RESULT 316
-#define RETURN 317
-#define TAILCALL 318
-#define YIELDT 319
-#define GET_RESULTS 320
-#define POW 321
-#define SHIFT_RIGHT_U 322
-#define LOG_AND 323
-#define LOG_OR 324
-#define COMMA 325
-#define ESUB 326
-#define DOTDOT 327
-#define PCC_BEGIN 328
-#define PCC_END 329
-#define PCC_CALL 330
-#define PCC_SUB 331
-#define PCC_BEGIN_RETURN 332
-#define PCC_END_RETURN 333
-#define PCC_BEGIN_YIELD 334
-#define PCC_END_YIELD 335
-#define NCI_CALL 336
-#define METH_CALL 337
-#define INVOCANT 338
-#define MAIN 339
-#define LOAD 340
-#define INIT 341
-#define IMMEDIATE 342
-#define POSTCOMP 343
-#define METHOD 344
-#define ANON 345
-#define OUTER 346
-#define NEED_LEX 347
-#define MULTI 348
-#define VTABLE_METHOD 349
-#define LOADLIB 350
-#define SUB_INSTANCE_OF 351
-#define SUBID 352
-#define NS_ENTRY 353
-#define UNIQUE_REG 354
-#define LABEL 355
-#define EMIT 356
-#define EOM 357
-#define IREG 358
-#define NREG 359
-#define SREG 360
-#define PREG 361
-#define IDENTIFIER 362
-#define REG 363
-#define MACRO 364
-#define ENDM 365
-#define STRINGC 366
-#define INTC 367
-#define FLOATC 368
-#define USTRINGC 369
-#define PARROT_OP 370
-#define VAR 371
-#define LINECOMMENT 372
-#define FILECOMMENT 373
-#define DOT 374
-#define CONCAT 375
+#define ADV_CALL_SIG 278
+#define NAMESPACE 279
+#define DOT_METHOD 280
+#define SUB 281
+#define SYM 282
+#define LOCAL 283
+#define LEXICAL 284
+#define CONST 285
+#define ANNOTATE 286
+#define INC 287
+#define DEC 288
+#define GLOBAL_CONST 289
+#define PLUS_ASSIGN 290
+#define MINUS_ASSIGN 291
+#define MUL_ASSIGN 292
+#define DIV_ASSIGN 293
+#define CONCAT_ASSIGN 294
+#define BAND_ASSIGN 295
+#define BOR_ASSIGN 296
+#define BXOR_ASSIGN 297
+#define FDIV 298
+#define FDIV_ASSIGN 299
+#define MOD_ASSIGN 300
+#define SHR_ASSIGN 301
+#define SHL_ASSIGN 302
+#define SHR_U_ASSIGN 303
+#define SHIFT_LEFT 304
+#define SHIFT_RIGHT 305
+#define INTV 306
+#define FLOATV 307
+#define STRINGV 308
+#define PMCV 309
+#define LOG_XOR 310
+#define RELOP_EQ 311
+#define RELOP_NE 312
+#define RELOP_GT 313
+#define RELOP_GTE 314
+#define RELOP_LT 315
+#define RELOP_LTE 316
+#define RESULT 317
+#define RETURN 318
+#define TAILCALL 319
+#define YIELDT 320
+#define GET_RESULTS 321
+#define POW 322
+#define SHIFT_RIGHT_U 323
+#define LOG_AND 324
+#define LOG_OR 325
+#define COMMA 326
+#define ESUB 327
+#define DOTDOT 328
+#define PCC_BEGIN 329
+#define PCC_END 330
+#define PCC_CALL 331
+#define PCC_SUB 332
+#define PCC_BEGIN_RETURN 333
+#define PCC_END_RETURN 334
+#define PCC_BEGIN_YIELD 335
+#define PCC_END_YIELD 336
+#define NCI_CALL 337
+#define METH_CALL 338
+#define INVOCANT 339
+#define MAIN 340
+#define LOAD 341
+#define INIT 342
+#define IMMEDIATE 343
+#define POSTCOMP 344
+#define METHOD 345
+#define ANON 346
+#define OUTER 347
+#define NEED_LEX 348
+#define MULTI 349
+#define VTABLE_METHOD 350
+#define LOADLIB 351
+#define SUB_INSTANCE_OF 352
+#define SUBID 353
+#define NS_ENTRY 354
+#define UNIQUE_REG 355
+#define LABEL 356
+#define EMIT 357
+#define EOM 358
+#define IREG 359
+#define NREG 360
+#define SREG 361
+#define PREG 362
+#define IDENTIFIER 363
+#define REG 364
+#define MACRO 365
+#define ENDM 366
+#define STRINGC 367
+#define INTC 368
+#define FLOATC 369
+#define USTRINGC 370
+#define PARROT_OP 371
+#define VAR 372
+#define LINECOMMENT 373
+#define FILECOMMENT 374
+#define DOT 375
+#define CONCAT 376
 
 
 
 
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 typedef union YYSTYPE
-#line 1048 "compilers/imcc/imcc.y"
 {
+
+/* Line 1676 of yacc.c  */
+#line 1059 "compilers/imcc/imcc.y"
+
     IdList * idlist;
     int t;
     char * s;
     SymReg * sr;
     Instruction *i;
-}
-/* Line 1529 of yacc.c.  */
-#line 297 "compilers/imcc/imcparser.h"
-	YYSTYPE;
+
+
+
+/* Line 1676 of yacc.c  */
+#line 304 "compilers/imcc/imcparser.h"
+} YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
 #endif
 
 
 
+

Modified: branches/orderedhash_revamp/compilers/imcc/instructions.c
==============================================================================
--- branches/orderedhash_revamp/compilers/imcc/instructions.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/imcc/instructions.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -9,6 +9,7 @@
 #include "imc.h"
 #include "pbc.h"
 #include "optimizer.h"
+#include "pmc/pmc_callcontext.h"
 
 /*
 
@@ -53,14 +54,14 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-#define ASSERT_ARGS_e_file_close __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_e_file_emit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_e_file_close __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_e_file_emit __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ins)
-#define ASSERT_ARGS_e_file_open __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(ins))
+#define ASSERT_ARGS_e_file_open __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(param)
+    , PARROT_ASSERT_ARG(param))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -630,7 +631,7 @@
     }
 
     /* lexer is in next line already */
-    i->line = IMCC_INFO(interp)->line - 1;
+    i->line = IMCC_INFO(interp)->line;
 
     return i;
 }
@@ -746,34 +747,34 @@
     }
 
     switch (ins->opsize-1) {
-        case -1:        /* labels */
-        case 1:
-            len = Parrot_io_fprintf(interp, io, ins->format, regstr[0]);
-            break;
-        case 2:
-            len = Parrot_io_fprintf(interp, io, ins->format, regstr[0], regstr[1]);
-            break;
-        case 3:
-            len = Parrot_io_fprintf(interp, io, ins->format, regstr[0], regstr[1], regstr[2]);
-            break;
-        case 4:
-            len = Parrot_io_fprintf(interp, io, ins->format, regstr[0], regstr[1], regstr[2],
+      case -1:        /* labels */
+      case 1:
+        len = Parrot_io_fprintf(interp, io, ins->format, regstr[0]);
+        break;
+      case 2:
+        len = Parrot_io_fprintf(interp, io, ins->format, regstr[0], regstr[1]);
+        break;
+      case 3:
+        len = Parrot_io_fprintf(interp, io, ins->format, regstr[0], regstr[1], regstr[2]);
+        break;
+      case 4:
+        len = Parrot_io_fprintf(interp, io, ins->format, regstr[0], regstr[1], regstr[2],
                     regstr[3]);
-            break;
-        case 5:
-            len = Parrot_io_fprintf(interp, io, ins->format, regstr[0], regstr[1], regstr[2],
+        break;
+      case 5:
+        len = Parrot_io_fprintf(interp, io, ins->format, regstr[0], regstr[1], regstr[2],
                     regstr[3], regstr[4]);
-            break;
-        case 6:
-            len = Parrot_io_fprintf(interp, io, ins->format, regstr[0], regstr[1], regstr[2],
+        break;
+      case 6:
+        len = Parrot_io_fprintf(interp, io, ins->format, regstr[0], regstr[1], regstr[2],
                     regstr[3], regstr[4], regstr[5]);
-            break;
-        default:
-            Parrot_io_fprintf(interp, Parrot_io_STDERR(interp),
+        break;
+      default:
+        Parrot_io_fprintf(interp, Parrot_io_STDERR(interp),
                 "unhandled: opsize (%d), op %s, fmt %s\n",
                 ins->opsize, ins->opname, ins->format);
-            exit(EXIT_FAILURE);
-            break;
+        exit(EXIT_FAILURE);
+        break;
     }
 
     return len;

Modified: branches/orderedhash_revamp/compilers/imcc/instructions.h
==============================================================================
--- branches/orderedhash_revamp/compilers/imcc/instructions.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/imcc/instructions.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -75,19 +75,14 @@
 } Instruction_Flags;
 #undef INSTRUCTION_BIT
 
-
-/* Forward decl */
-struct _IMC_Unit;
-
-
 /* Functions */
 /* Globals */
 
 typedef struct _emittert {
     int (*open)(PARROT_INTERP, void *param);
-    int (*emit)(PARROT_INTERP, void *param, const struct _IMC_Unit *, const Instruction *ins);
-    int (*new_sub)(PARROT_INTERP, void *param, struct _IMC_Unit *);
-    int (*end_sub)(PARROT_INTERP, void *param, struct _IMC_Unit *);
+    int (*emit)(PARROT_INTERP, void *param, const IMC_Unit *, const Instruction *ins);
+    int (*new_sub)(PARROT_INTERP, void *param, IMC_Unit *);
+    int (*end_sub)(PARROT_INTERP, void *param, IMC_Unit *);
     int (*close)(PARROT_INTERP, void *param);
 } Emitter;
 
@@ -226,59 +221,59 @@
         FUNC_MODIFIES(*ins)
         FUNC_MODIFIES(*tmp);
 
-#define ASSERT_ARGS_emit_close __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_emit_flush __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_emit_close __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_emit_flush __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_emit_open __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS__delete_ins __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_emit_open __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS__delete_ins __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(ins)
-#define ASSERT_ARGS__mk_instruction __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(ins))
+#define ASSERT_ARGS__mk_instruction __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(op) \
-    || PARROT_ASSERT_ARG(fmt) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_delete_ins __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(ins)
-#define ASSERT_ARGS_emitb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_free_ins __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(ins)
-#define ASSERT_ARGS_get_branch_reg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(ins)
-#define ASSERT_ARGS_get_branch_regno __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(ins)
-#define ASSERT_ARGS_imcc_init_tables __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_ins_print __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(fmt) \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_delete_ins __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(ins))
+#define ASSERT_ARGS_emitb __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_free_ins __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(ins))
+#define ASSERT_ARGS_get_branch_reg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(ins))
+#define ASSERT_ARGS_get_branch_regno __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(ins))
+#define ASSERT_ARGS_imcc_init_tables __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_ins_print __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(io) \
-    || PARROT_ASSERT_ARG(ins)
-#define ASSERT_ARGS_ins_writes2 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(ins)
-#define ASSERT_ARGS_insert_ins __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(io) \
+    , PARROT_ASSERT_ARG(ins))
+#define ASSERT_ARGS_ins_writes2 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(ins))
+#define ASSERT_ARGS_insert_ins __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(tmp)
-#define ASSERT_ARGS_instruction_reads __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(tmp))
+#define ASSERT_ARGS_instruction_reads __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(ins) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_instruction_writes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_instruction_writes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(ins) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_move_ins __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_move_ins __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(ins) \
-    || PARROT_ASSERT_ARG(to)
-#define ASSERT_ARGS_prepend_ins __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(ins) \
+    , PARROT_ASSERT_ARG(to))
+#define ASSERT_ARGS_prepend_ins __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(tmp)
-#define ASSERT_ARGS_subst_ins __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(tmp))
+#define ASSERT_ARGS_subst_ins __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(ins) \
-    || PARROT_ASSERT_ARG(tmp)
+    , PARROT_ASSERT_ARG(ins) \
+    , PARROT_ASSERT_ARG(tmp))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: compilers/imcc/instructions.c */
 

Modified: branches/orderedhash_revamp/compilers/imcc/main.c
==============================================================================
--- branches/orderedhash_revamp/compilers/imcc/main.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/imcc/main.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -4,7 +4,7 @@
  * Intermediate Code Compiler for Parrot.
  *
  * Copyright (C) 2002 Melvin Smith <melvin.smith at mindspring.com>
- * Copyright (C) 2003-2009, Parrot Foundation.
+ * Copyright (C) 2003-2010, Parrot Foundation.
  */
 
 /*
@@ -33,6 +33,8 @@
 #include "parrot/embed.h"
 #include "parrot/longopt.h"
 #include "parrot/imcc.h"
+#include "parrot/runcore_api.h"
+#include "pmc/pmc_callcontext.h"
 #include "pbc.h"
 #include "parser.h"
 
@@ -98,35 +100,35 @@
         __attribute__nonnull__(1)
         FUNC_MODIFIES(*fp);
 
-#define ASSERT_ARGS_compile_to_bytecode __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_compile_to_bytecode __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sourcefile)
-#define ASSERT_ARGS_determine_input_file_type __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(sourcefile))
+#define ASSERT_ARGS_determine_input_file_type __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sourcefile)
-#define ASSERT_ARGS_determine_output_file_type __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(sourcefile))
+#define ASSERT_ARGS_determine_output_file_type __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(obj_file) \
-    || PARROT_ASSERT_ARG(output_file)
-#define ASSERT_ARGS_do_pre_process __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_help __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_help_debug __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
+    , PARROT_ASSERT_ARG(obj_file) \
+    , PARROT_ASSERT_ARG(output_file))
+#define ASSERT_ARGS_do_pre_process __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_help __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_help_debug __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
 #define ASSERT_ARGS_imcc_get_optimization_description \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(opt_desc)
-#define ASSERT_ARGS_imcc_run_pbc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(opt_desc))
+#define ASSERT_ARGS_imcc_run_pbc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(argv)
-#define ASSERT_ARGS_imcc_write_pbc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(argv))
+#define ASSERT_ARGS_imcc_write_pbc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(output_file)
-#define ASSERT_ARGS_is_all_hex_digits __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_version __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_usage __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(fp)
+    , PARROT_ASSERT_ARG(output_file))
+#define ASSERT_ARGS_is_all_hex_digits __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_Parrot_version __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_usage __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(fp))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -147,7 +149,7 @@
     ASSERT_ARGS(usage)
     fprintf(fp,
             "parrot -[acEGhprtvVwy.] [-d [FLAGS]] [-D [FLAGS]]"
-            "[-O [level]] [-o FILE] <file>\n");
+            "[-O [level]] [-R runcore] [-o FILE] <file>\n");
 }
 
 /*
@@ -219,9 +221,8 @@
     "    -L --library add path to library search\n"
     "    -X --dynext add path to dynamic extension search\n"
     "   <Run core options>\n"
-    "    -R --runcore slow|bounds|fast|jit|cgoto|cgp|cgp-jit\n"
-    "    -R --runcore switch|switch-jit|trace|exec|gcdebug\n"
-    "    -p --profile\n"
+    "    -R --runcore slow|bounds|fast|cgoto|cgp\n"
+    "    -R --runcore switch|trace|profiling|gcdebug\n"
     "    -t --trace [flags]\n"
     "   <VM options>\n"
     "    -D --parrot-debug[=HEXFLAGS]\n"
@@ -265,7 +266,7 @@
     ASSERT_ARGS(Parrot_version)
     printf("This is Parrot version " PARROT_VERSION);
     printf(" built for " PARROT_ARCHNAME ".\n");
-    printf("Copyright (C) 2001-2009, Parrot Foundation.\n\
+    printf("Copyright (C) 2001-2010, Parrot Foundation.\n\
 \n\
 This code is distributed under the terms of the Artistic License 2.0.\
 \n\
@@ -279,7 +280,6 @@
 #define SET_FLAG(flag)   Parrot_set_flag(interp, (flag))
 #define SET_DEBUG(flag)  Parrot_set_debug(interp, (flag))
 #define SET_TRACE(flag)  Parrot_set_trace(interp, (flag))
-#define SET_CORE(core)   interp->run_core |= (core)
 
 #define OPT_GC_DEBUG       128
 #define OPT_DESTROY_FLAG   129
@@ -308,7 +308,6 @@
     { 'h', 'h', (OPTION_flags)0, { "--help" } },
     { 'o', 'o', OPTION_required_FLAG, { "--output" } },
     { '\0', OPT_PBC_OUTPUT, (OPTION_flags)0, { "--output-pbc" } },
-    { 'p', 'p', (OPTION_flags)0, { "--profile" } },
     { 'r', 'r', (OPTION_flags)0, { "--run-pbc" } },
     { '\0', OPT_RUNTIME_PREFIX, (OPTION_flags)0, { "--runtime-prefix" } },
     { 't', 't', OPTION_optional_FLAG, { "--trace" } },
@@ -356,8 +355,10 @@
 const char *
 parseflags(PARROT_INTERP, int *argc, char **argv[])
 {
-    struct longopt_opt_info opt = LONGOPT_OPT_INFO_INIT;
-    int   status;
+    struct longopt_opt_info opt  = LONGOPT_OPT_INFO_INIT;
+    INTVAL                  core = 0;
+    int                     status;
+
     if (*argc == 1) {
         usage(stderr);
         exit(EXIT_SUCCESS);
@@ -368,189 +369,178 @@
     while ((status = longopt_get(interp, *argc, (const char **)*argv, options,
             &opt)) > 0) {
         switch (opt.opt_id) {
-            case 'R':
-                if (STREQ(opt.opt_arg, "slow") || STREQ(opt.opt_arg, "bounds"))
-                    SET_CORE(PARROT_SLOW_CORE);
-                else if (STREQ(opt.opt_arg, "fast") || STREQ(opt.opt_arg, "function"))
-                    SET_CORE(PARROT_FAST_CORE);
-                else if (STREQ(opt.opt_arg, "switch"))
-                    SET_CORE(PARROT_SWITCH_CORE);
-                else if (STREQ(opt.opt_arg, "cgp"))
-                    SET_CORE(PARROT_CGP_CORE);
-                else if (STREQ(opt.opt_arg, "cgoto"))
-                    SET_CORE(PARROT_CGOTO_CORE);
-                else if (STREQ(opt.opt_arg, "jit"))
-                    SET_CORE(PARROT_JIT_CORE);
-                else if (STREQ(opt.opt_arg, "cgp-jit"))
-                    SET_CORE(PARROT_CGP_JIT_CORE);
-                else if (STREQ(opt.opt_arg, "switch-jit"))
-                    SET_CORE(PARROT_SWITCH_JIT_CORE);
-                else if (STREQ(opt.opt_arg, "exec"))
-                    SET_CORE(PARROT_EXEC_CORE);
-                else if (STREQ(opt.opt_arg, "trace")) {
-                    SET_CORE(PARROT_SLOW_CORE);
-#ifdef HAVE_COMPUTED_GOTO
-                    SET_CORE(PARROT_CGP_CORE);
-#endif
-#if JIT_CAPABLE
-                    SET_CORE(PARROT_JIT_CORE);
-#endif
-                }
-                else if (STREQ(opt.opt_arg, "gcdebug"))
-                    SET_CORE(PARROT_GC_DEBUG_CORE);
-                else
-                    Parrot_ex_throw_from_c_args(interp, NULL, 1,
+          case 'R':
+            if (STREQ(opt.opt_arg, "slow") || STREQ(opt.opt_arg, "bounds"))
+                core = PARROT_SLOW_CORE;
+            else if (STREQ(opt.opt_arg, "fast") || STREQ(opt.opt_arg, "function"))
+                core = PARROT_FAST_CORE;
+            else if (STREQ(opt.opt_arg, "switch"))
+                core = PARROT_SWITCH_CORE;
+            else if (STREQ(opt.opt_arg, "cgp"))
+                core = PARROT_CGP_CORE;
+            else if (STREQ(opt.opt_arg, "cgoto"))
+                core = PARROT_CGOTO_CORE;
+            else if (STREQ(opt.opt_arg, "jit"))
+                core = PARROT_FAST_CORE;
+            else if (STREQ(opt.opt_arg, "cgp-jit"))
+                core = PARROT_CGP_CORE;
+            else if (STREQ(opt.opt_arg, "switch-jit"))
+                core = PARROT_SWITCH_CORE;
+            else if (STREQ(opt.opt_arg, "exec"))
+                core = PARROT_EXEC_CORE;
+            else if (STREQ(opt.opt_arg, "trace"))
+                core = PARROT_SLOW_CORE;
+            else if (STREQ(opt.opt_arg, "profiling"))
+                core = PARROT_PROFILING_CORE;
+            else if (STREQ(opt.opt_arg, "gcdebug"))
+                core = PARROT_GC_DEBUG_CORE;
+            else
+                Parrot_ex_throw_from_c_args(interp, NULL, 1,
                         "main: Unrecognized runcore '%s' specified."
                         "\n\nhelp: parrot -h\n", opt.opt_arg);
-                break;
-            case 'p':
-                SET_FLAG(PARROT_PROFILE_FLAG);
-                break;
-            case 't':
-                if (opt.opt_arg && is_all_hex_digits(opt.opt_arg))
-                    SET_TRACE(strtoul(opt.opt_arg, NULL, 16));
-                else
-                    SET_TRACE(PARROT_TRACE_OPS_FLAG);
-                break;
-            case 'd':
-                if (opt.opt_arg && is_all_hex_digits(opt.opt_arg)) {
-                    IMCC_INFO(interp)->debug = strtoul(opt.opt_arg, NULL, 16);
-                }
-                else {
-                    IMCC_INFO(interp)->debug++;
-                }
-                break;
-            case 'D':
-                if (opt.opt_arg && is_all_hex_digits(opt.opt_arg)) {
-                    SET_DEBUG(strtoul(opt.opt_arg, NULL, 16));
-                }
-                else
-                    SET_DEBUG(PARROT_MEM_STAT_DEBUG_FLAG);
-                break;
-            case 'w':
-                Parrot_setwarnings(interp, PARROT_WARNINGS_ALL_FLAG);
-                IMCC_INFO(interp)->imcc_warn = 1;
-                break;
-            case 'G':
-                IMCC_INFO(interp)->gc_off = 1;
-                break;
-            case '.':  /* Give Windows Parrot hackers an opportunity to
-                        * attach a debuggger. */
-                fgetc(stdin);
-                break;
-            case 'a':
-                SET_STATE_PASM_FILE(interp);
-                break;
-            case 'h':
-                help();
-                exit(EX_USAGE);
-                break;
-            case OPT_HELP_DEBUG:
-                help_debug();
-                exit(EX_USAGE);
-                break;
-            case OPT_RUNTIME_PREFIX:
-                Parrot_io_printf(interp, "%Ss\n",
+            break;
+          case 't':
+            if (opt.opt_arg && is_all_hex_digits(opt.opt_arg))
+                SET_TRACE(strtoul(opt.opt_arg, NULL, 16));
+            else
+                SET_TRACE(PARROT_TRACE_OPS_FLAG);
+            break;
+          case 'd':
+            if (opt.opt_arg && is_all_hex_digits(opt.opt_arg)) {
+                IMCC_INFO(interp)->debug = strtoul(opt.opt_arg, NULL, 16);
+            }
+            else {
+                IMCC_INFO(interp)->debug++;
+            }
+            break;
+          case 'D':
+            if (opt.opt_arg && is_all_hex_digits(opt.opt_arg)) {
+                SET_DEBUG(strtoul(opt.opt_arg, NULL, 16));
+            }
+            else
+                SET_DEBUG(PARROT_MEM_STAT_DEBUG_FLAG);
+            break;
+          case 'w':
+            Parrot_setwarnings(interp, PARROT_WARNINGS_ALL_FLAG);
+            IMCC_INFO(interp)->imcc_warn = 1;
+            break;
+          case 'G':
+            IMCC_INFO(interp)->gc_off = 1;
+            break;
+          case '.':  /* Give Windows Parrot hackers an opportunity to
+                      * attach a debuggger. */
+            fgetc(stdin);
+            break;
+          case 'a':
+            SET_STATE_PASM_FILE(interp);
+            break;
+          case 'h':
+            help();
+            exit(EX_USAGE);
+            break;
+          case OPT_HELP_DEBUG:
+            help_debug();
+            exit(EX_USAGE);
+            break;
+          case OPT_RUNTIME_PREFIX:
+            Parrot_io_printf(interp, "%Ss\n",
                     Parrot_get_runtime_path(interp));
-                exit(EXIT_SUCCESS);
-            case 'V':
-                Parrot_version(interp);
-                break;
-            case 'r':
-                if (STATE_RUN_PBC(interp))
-                    SET_STATE_RUN_FROM_FILE(interp);
-                SET_STATE_RUN_PBC(interp);
-                break;
-            case 'c':
-                SET_STATE_LOAD_PBC(interp);
-                break;
-            case 'v':
-                IMCC_INFO(interp)->verbose++;
-                break;
-            case 'y':
-                yydebug = 1;
-                break;
-            case 'E':
-                SET_STATE_PRE_PROCESS(interp);
-                break;
-            case 'o':
-                UNSET_STATE_RUN_PBC(interp);
-                interp->output_file = opt.opt_arg;
-                break;
+            exit(EXIT_SUCCESS);
+          case 'V':
+            Parrot_version(interp);
+            break;
+          case 'r':
+            if (STATE_RUN_PBC(interp))
+                SET_STATE_RUN_FROM_FILE(interp);
+            SET_STATE_RUN_PBC(interp);
+            break;
+          case 'c':
+            SET_STATE_LOAD_PBC(interp);
+            break;
+          case 'v':
+            IMCC_INFO(interp)->verbose++;
+            break;
+          case 'y':
+            yydebug = 1;
+            break;
+          case 'E':
+            SET_STATE_PRE_PROCESS(interp);
+            break;
+          case 'o':
+            UNSET_STATE_RUN_PBC(interp);
+            interp->output_file = opt.opt_arg;
+            break;
 
-            case OPT_PBC_OUTPUT:
-                UNSET_STATE_RUN_PBC(interp);
-                SET_STATE_WRITE_PBC(interp);
-                if (!interp->output_file)
-                    interp->output_file = "-";
+          case OPT_PBC_OUTPUT:
+            UNSET_STATE_RUN_PBC(interp);
+            SET_STATE_WRITE_PBC(interp);
+            if (!interp->output_file)
+                interp->output_file = "-";
+            break;
+
+          case 'O':
+            if (!opt.opt_arg) {
+                IMCC_INFO(interp)->optimizer_level |= OPT_PRE;
                 break;
-
-            case 'O':
-                if (!opt.opt_arg) {
-                    IMCC_INFO(interp)->optimizer_level |= OPT_PRE;
-                    break;
-                }
-                if (strchr(opt.opt_arg, 'p'))
-                    IMCC_INFO(interp)->optimizer_level |= OPT_PASM;
-                if (strchr(opt.opt_arg, 'c'))
-                    IMCC_INFO(interp)->optimizer_level |= OPT_SUB;
-
-                IMCC_INFO(interp)->allocator = IMCC_GRAPH_ALLOCATOR;
-                /* currently not ok due to different register allocation */
-                if (strchr(opt.opt_arg, 'j')) {
-                    SET_CORE(PARROT_JIT_CORE);
-                }
-                if (strchr(opt.opt_arg, '1')) {
-                    IMCC_INFO(interp)->optimizer_level |= OPT_PRE;
-                }
-                if (strchr(opt.opt_arg, '2')) {
-                    IMCC_INFO(interp)->optimizer_level |= (OPT_PRE | OPT_CFG);
-                }
-                if (strchr(opt.opt_arg, 't')) {
-                    SET_CORE(PARROT_SWITCH_CORE);
+            }
+            if (strchr(opt.opt_arg, 'p'))
+                IMCC_INFO(interp)->optimizer_level |= OPT_PASM;
+            if (strchr(opt.opt_arg, 'c'))
+                IMCC_INFO(interp)->optimizer_level |= OPT_SUB;
+
+            IMCC_INFO(interp)->allocator = IMCC_GRAPH_ALLOCATOR;
+            /* currently not ok due to different register allocation */
+            if (strchr(opt.opt_arg, '1')) {
+                IMCC_INFO(interp)->optimizer_level |= OPT_PRE;
+            }
+            if (strchr(opt.opt_arg, '2')) {
+                IMCC_INFO(interp)->optimizer_level |= (OPT_PRE | OPT_CFG);
+            }
+            if (strchr(opt.opt_arg, 't')) {
 #ifdef HAVE_COMPUTED_GOTO
-                    SET_CORE(PARROT_CGP_CORE);
-#endif
-#if JIT_CAPABLE
-                    SET_CORE(PARROT_JIT_CORE);
+                core = PARROT_CGP_CORE;
+#else
+                core = PARROT_SWITCH_CORE;
 #endif
-                }
-                break;
+            }
+            break;
 
-            case OPT_GC_DEBUG:
+          case OPT_GC_DEBUG:
 #if DISABLE_GC_DEBUG
-                Parrot_warn(interp, PARROT_WARNINGS_ALL_FLAG,
+            Parrot_warn(interp, PARROT_WARNINGS_ALL_FLAG,
                         "PARROT_GC_DEBUG is set but the binary was "
                         "compiled with DISABLE_GC_DEBUG.");
 #endif
-                SET_FLAG(PARROT_GC_DEBUG_FLAG);
-                break;
-            case OPT_DESTROY_FLAG:
-                SET_FLAG(PARROT_DESTROY_FLAG);
-                break;
-            case 'I':
-                Parrot_lib_add_path_from_cstring(interp, opt.opt_arg,
+            SET_FLAG(PARROT_GC_DEBUG_FLAG);
+            break;
+          case OPT_DESTROY_FLAG:
+            SET_FLAG(PARROT_DESTROY_FLAG);
+            break;
+          case 'I':
+            Parrot_lib_add_path_from_cstring(interp, opt.opt_arg,
                     PARROT_LIB_PATH_INCLUDE);
-                break;
-            case 'L':
-                Parrot_lib_add_path_from_cstring(interp, opt.opt_arg,
+            break;
+          case 'L':
+            Parrot_lib_add_path_from_cstring(interp, opt.opt_arg,
                     PARROT_LIB_PATH_LIBRARY);
-                break;
-            case 'X':
-                Parrot_lib_add_path_from_cstring(interp, opt.opt_arg,
+            break;
+          case 'X':
+            Parrot_lib_add_path_from_cstring(interp, opt.opt_arg,
                     PARROT_LIB_PATH_DYNEXT);
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, 1,
+            break;
+          default:
+            Parrot_ex_throw_from_c_args(interp, NULL, 1,
                     "main: Invalid flag '%s' used.\n\nhelp: parrot -h\n",
                     (*argv)[0]);
         }
     }
+
     if (status == -1) {
         fprintf(stderr, "%s\n", opt.opt_error);
         usage(stderr);
         exit(EX_USAGE);
     }
+
     /* reached the end of the option list and consumed all of argv */
     if (*argc == opt.opt_index) {
         if (interp->output_file) {
@@ -563,9 +553,11 @@
         usage(stderr);
         exit(EX_USAGE);
     }
+
     *argc -= opt.opt_index;
     *argv += opt.opt_index;
 
+    Parrot_set_run_core(interp, (Parrot_Run_core_t) core);
     return (*argv)[0];
 }
 
@@ -603,9 +595,6 @@
             case NAMESPACE:     printf(".namespace "); break;
             case CONST:         printf(".const "); break;
             case PARAM:         printf(".param "); break;
-            /* RT#46147: print out more information about the macro */
-            /* case MACRO:         yylex(&val, interp, yyscanner);
-                                break; */ /* swallow nl */
             case MACRO:         printf(".macro "); break;
 
             case GOTO:          printf("goto ");break;
@@ -719,10 +708,10 @@
     if (opt_level & OPT_SUB)
         opt_desc[i++] = 'c';
 
-    if (interp->run_core & PARROT_JIT_CORE)
+    if (PARROT_RUNCORE_JIT_OPS_TEST(interp->run_core))
         opt_desc[i++] = 'j';
 
-    if (interp->run_core & PARROT_SWITCH_CORE)
+    if (PARROT_RUNCORE_PREDEREF_OPS_TEST(interp->run_core))
         opt_desc[i++] = 't';
 
     opt_desc[i] = '\0';
@@ -796,6 +785,8 @@
         IMCC_info(interp, 1, "Running...\n");
 
     /* runs :init functions */
+    PackFile_fixup_subs(interp, PBC_IMMEDIATE, NULL);
+    PackFile_fixup_subs(interp, PBC_POSTCOMP, NULL);
     PackFile_fixup_subs(interp, PBC_MAIN, NULL);
 
     Parrot_runcode(interp, argc, argv);
@@ -907,16 +898,8 @@
         if (STREQ(ext, ".pbc"))
             SET_STATE_WRITE_PBC(interp);
         else if (STREQ(ext, PARROT_OBJ_EXT)) {
-#if EXEC_CAPABLE
-            SET_STATE_LOAD_PBC(interp);
-            SET_STATE_RUN_PBC(interp);
-            UNSET_STATE_WRITE_PBC(interp);
-            *obj_file = 1;
-            Parrot_set_run_core(interp, PARROT_EXEC_CORE);
-#else
             UNUSED(obj_file);
             IMCC_fatal_standalone(interp, 1, "main: can't produce object file");
-#endif
         }
     }
 }
@@ -997,7 +980,7 @@
     fclose(imc_yyin_get(yyscanner));
 
     IMCC_info(interp, 1, "%ld lines compiled.\n", IMCC_INFO(interp)->line);
-    if (per_pbc)
+    if (per_pbc && !IMCC_INFO(interp)->write_pbc)
         PackFile_fixup_subs(interp, PBC_POSTCOMP, NULL);
 }
 

Modified: branches/orderedhash_revamp/compilers/imcc/optimizer.c
==============================================================================
--- branches/orderedhash_revamp/compilers/imcc/optimizer.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/imcc/optimizer.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -73,6 +73,7 @@
 #include "imc.h"
 #include "pbc.h"
 #include "optimizer.h"
+#include "pmc/pmc_callcontext.h"
 
 /* HEADERIZER HFILE: compilers/imcc/optimizer.h */
 
@@ -151,43 +152,43 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*unit);
 
-#define ASSERT_ARGS_branch_branch __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_branch_branch __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_branch_cond_loop __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_branch_cond_loop __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_branch_cond_loop_swap __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_branch_cond_loop_swap __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(branch) \
-    || PARROT_ASSERT_ARG(start) \
-    || PARROT_ASSERT_ARG(cond)
-#define ASSERT_ARGS_branch_reorg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(branch) \
+    , PARROT_ASSERT_ARG(start) \
+    , PARROT_ASSERT_ARG(cond))
+#define ASSERT_ARGS_branch_reorg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_constant_propagation __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_constant_propagation __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_dead_code_remove __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_dead_code_remove __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_eval_ins __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_eval_ins __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(op) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_if_branch __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(op) \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_if_branch __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_strength_reduce __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_strength_reduce __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_unused_label __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_unused_label __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_used_once __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_used_once __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
+    , PARROT_ASSERT_ARG(unit))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -209,7 +210,6 @@
 
     if (IMCC_INFO(interp)->optimizer_level & OPT_PRE) {
         IMCC_info(interp, 2, "pre_optimize\n");
-        /* RT #46281 integrate all in one pass */
         changed += strength_reduce(interp, unit);
         if (!IMCC_INFO(interp)->dont_optimize)
             changed += if_branch(interp, unit);
@@ -244,7 +244,6 @@
             return 1;
         if (branch_reorg(interp, unit))
             return 1;
-        /* RT #46283 cfg / loop detection breaks e.g. in t/compiler/5_3 */
         if (unused_label(interp, unit))
             return 1;
         if (dead_code_remove(interp, unit))
@@ -695,7 +694,7 @@
                                     ins2, i);
                             old = ins2->symregs[i];
                             ins2->symregs[i] = c;
-       /* first we try subst_constants for e.g. if 10 < 5 goto next*/
+                /* first we try subst_constants for e.g. if 10 < 5 goto next*/
                             tmp = IMCC_subst_constants(interp,
                                 unit, ins2->opname, ins2->symregs, ins2->opsize,
                                 &found);
@@ -811,38 +810,38 @@
     eval[0] = opnum;
     for (i = 0; i < op_info->op_count - 1; i++) {
         switch (op_info->types[i]) {
-            case PARROT_ARG_IC:
-                PARROT_ASSERT(i && ops == (unsigned int)i);
-                /* set branch offset to zero */
-                eval[i + 1] = 0;
-                break;
-            case PARROT_ARG_I:
-            case PARROT_ARG_N:
-            case PARROT_ARG_S:
-                eval[i + 1] = i;        /* regs used are I0, I1, I2 */
-                if (ops <= 2 || i) { /* fill source regs */
-                    switch (r[i]->set) {
-                        case 'I':
-                            REG_INT(interp, i) = IMCC_int_from_reg(interp, r[i]);
-                            break;
-                        case 'N':
-                            {
-                            STRING * const s = Parrot_str_new(interp, r[i]->name, 0);
-                            REG_NUM(interp, i) = Parrot_str_to_num(interp, s);
-                            }
-                            break;
-                        case 'S':
-                            REG_STR(interp, i) = IMCC_string_from_reg(interp, r[i]);
-                            break;
-                        default:
-                            break;
+          case PARROT_ARG_IC:
+            PARROT_ASSERT(i && ops == (unsigned int)i);
+            /* set branch offset to zero */
+            eval[i + 1] = 0;
+            break;
+          case PARROT_ARG_I:
+          case PARROT_ARG_N:
+          case PARROT_ARG_S:
+            eval[i + 1] = i;        /* regs used are I0, I1, I2 */
+            if (ops <= 2 || i) { /* fill source regs */
+                switch (r[i]->set) {
+                  case 'I':
+                    REG_INT(interp, i) = IMCC_int_from_reg(interp, r[i]);
+                    break;
+                  case 'N':
+                    {
+                        STRING * const s = Parrot_str_new(interp, r[i]->name, 0);
+                        REG_NUM(interp, i) = Parrot_str_to_num(interp, s);
                     }
+                    break;
+                  case 'S':
+                    REG_STR(interp, i) = IMCC_string_from_reg(interp, r[i]);
+                    break;
+                  default:
+                    break;
                 }
-                break;
-            default:
-                IMCC_fatal(interp, 1, "eval_ins"
-                        "invalid arg #%d for op '%s' not found\n",
-                        i, op);
+            }
+            break;
+          default:
+            IMCC_fatal(interp, 1, "eval_ins"
+                    "invalid arg #%d for op '%s' not found\n",
+                    i, op);
         }
     }
 
@@ -1011,7 +1010,8 @@
      */
     branched = eval_ins(interp, op, found, r);
     if (branched == -1) {
-         /* Don't set ok (See RT #43048 for info) */
+         /* Don't set ok
+          * (See http://rt.perl.org/rt3/Ticket/Display.html?id=43048 for info) */
          return NULL;
     }
     /*
@@ -1037,27 +1037,27 @@
          */
         char b[128];
         switch (r[0]->set) {
-            case 'I':
-                snprintf(b, sizeof (b), INTVAL_FMT, REG_INT(interp, 0));
-                r[1] = mk_const(interp, b, r[0]->set);
-                break;
-            case 'N':
-                snprintf(b, sizeof (b), fmt, REG_NUM(interp, 0));
-                r[1] = mk_const(interp, b, r[0]->set);
-                break;
-            case 'S':
-            {
-                char * const name = Parrot_str_to_cstring(interp, REG_STR(interp, 0));
+          case 'I':
+            snprintf(b, sizeof (b), INTVAL_FMT, REG_INT(interp, 0));
+            r[1] = mk_const(interp, b, r[0]->set);
+            break;
+          case 'N':
+            snprintf(b, sizeof (b), fmt, REG_NUM(interp, 0));
+            r[1] = mk_const(interp, b, r[0]->set);
+            break;
+          case 'S':
+          {
+            char * const name = Parrot_str_to_cstring(interp, REG_STR(interp, 0));
 
-                r[1] = mk_const(interp, name, r[0]->set);
+            r[1] = mk_const(interp, name, r[0]->set);
 
-                snprintf(b, sizeof (b), "%p", REG_STR(interp, 0));
-                Parrot_str_free_cstring(name);
+            snprintf(b, sizeof (b), "%p", REG_STR(interp, 0));
+            Parrot_str_free_cstring(name);
 
-                break;
-            }
-            default:
-                break;
+            break;
+          }
+          default:
+            break;
         }
         tmp = INS(interp, unit, "set", "", r, 2, 0, 0);
     }
@@ -1501,14 +1501,12 @@
         }
     }
 
-    /* Unreachable instructions */
 
+    /* Unreachable instructions */
 
     for (last = unit->instructions, ins = last->next;
          last && ins;
          ins = ins->next) {
-         if (!last && !ins)
-            break;
 
         if ((last->type & IF_goto) && !(ins->type & ITLABEL) &&
             STREQ(last->opname, "branch")) {

Modified: branches/orderedhash_revamp/compilers/imcc/optimizer.h
==============================================================================
--- branches/orderedhash_revamp/compilers/imcc/optimizer.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/imcc/optimizer.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -65,29 +65,29 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*unit);
 
-#define ASSERT_ARGS_cfg_optimize __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_cfg_optimize __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_get_neg_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_get_neg_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(op) \
-    || PARROT_ASSERT_ARG(n)
-#define ASSERT_ARGS_IMCC_subst_constants __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(n))
+#define ASSERT_ARGS_IMCC_subst_constants __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(r) \
-    || PARROT_ASSERT_ARG(ok)
-#define ASSERT_ARGS_IMCC_subst_constants_umix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(r) \
+    , PARROT_ASSERT_ARG(ok))
+#define ASSERT_ARGS_IMCC_subst_constants_umix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_optimize __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_optimize __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_pre_optimize __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_pre_optimize __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
+    , PARROT_ASSERT_ARG(unit))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: compilers/imcc/optimizer.c */
 

Modified: branches/orderedhash_revamp/compilers/imcc/parser.h
==============================================================================
--- branches/orderedhash_revamp/compilers/imcc/parser.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/imcc/parser.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -14,9 +14,6 @@
 
 #include "imcparser.h"
 
-/* short ranged globals for lexer state */
-extern int pesky_global__is_def;
-
 #define KEY_BIT(argnum) (1 << (argnum))
 
 /* An opaque pointer. */

Modified: branches/orderedhash_revamp/compilers/imcc/parser_util.c
==============================================================================
--- branches/orderedhash_revamp/compilers/imcc/parser_util.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/imcc/parser_util.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -21,7 +21,8 @@
 #include "imc.h"
 #include "parrot/dynext.h"
 #include "parrot/embed.h"
-#include "../../src/pmc/pmc_sub.h"
+#include "pmc/pmc_sub.h"
+#include "pmc/pmc_callcontext.h"
 #include "pbc.h"
 #include "parser.h"
 #include "optimizer.h"
@@ -93,24 +94,24 @@
         FUNC_MODIFIES(*unit)
         FUNC_MODIFIES(*r);
 
-#define ASSERT_ARGS_change_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_change_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_imcc_compile_file __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_imcc_compile_file __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(fullname) \
-    || PARROT_ASSERT_ARG(error_message)
-#define ASSERT_ARGS_imcc_destroy_macro_values __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(value)
-#define ASSERT_ARGS_try_rev_cmp __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(fullname) \
+    , PARROT_ASSERT_ARG(error_message))
+#define ASSERT_ARGS_imcc_destroy_macro_values __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(value))
+#define ASSERT_ARGS_try_rev_cmp __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_var_arg_ins __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_var_arg_ins __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(r)
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(r))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -386,7 +387,7 @@
     int dirs = 0;
     Instruction *ins;
     op_info_t   *op_info;
-    char fullname[64], format[128];
+    char fullname[64] = "", format[128] = "";
 
     if (STREQ(name, ".annotate")) {
         ins = _mk_instruction(name, "", n, r, 0);
@@ -464,19 +465,19 @@
     /* XXX Speed up some by keep track of the end of format ourselves */
     for (i = 0; i < n; i++) {
         switch (op_info->dirs[i]) {
-            case PARROT_ARGDIR_INOUT:
-                dirs |= 1 << (16 + i);
-                /* go on */
-            case PARROT_ARGDIR_IN:
-                dirs |= 1 << i ;
-                break;
-
-            case PARROT_ARGDIR_OUT:
-                dirs |= 1 << (16 + i);
-                break;
+          case PARROT_ARGDIR_INOUT:
+            dirs |= 1 << (16 + i);
+            /* go on */
+          case PARROT_ARGDIR_IN:
+            dirs |= 1 << i ;
+            break;
+
+          case PARROT_ARGDIR_OUT:
+            dirs |= 1 << (16 + i);
+            break;
 
-            default:
-                PARROT_ASSERT(0);
+          default:
+            PARROT_ASSERT(0);
         };
 
         if (keyvec & KEY_BIT(i)) {
@@ -555,9 +556,7 @@
         ||  STREQ(name, "returncc"))
             ins->type |= IF_goto;
         else if (STREQ(fullname, "jump_i")
-             ||  STREQ(fullname, "jsr_i")
-             ||  STREQ(fullname, "branch_i")
-             ||  STREQ(fullname, "bsr_i"))
+             ||  STREQ(fullname, "branch_i"))
             IMCC_INFO(interp)->dont_optimize = 1;
     }
     else if (STREQ(name, "set") && n == 2) {
@@ -622,14 +621,14 @@
     /* imcc always compiles to interp->code
      * save old cs, make new
      */
-    char name[64];
+    STRING                *name;
     PackFile_ByteCode     *old_cs, *new_cs;
     PMC                   *sub      = NULL;
     struct _imc_info_t    *imc_info = NULL;
     struct parser_state_t *next;
     void                  *yyscanner;
-    Parrot_Context        *ignored;
-    INTVAL regs_used[4] = {3, 3, 3, 3};
+    PMC                   *ignored;
+    UINTVAL regs_used[4] = {3, 3, 3, 3};
     INTVAL eval_number;
 
     do_yylex_init(interp, &yyscanner);
@@ -655,7 +654,7 @@
     eval_number = ++eval_nr;
     UNLOCK(eval_nr_lock);
 
-    snprintf(name, sizeof (name), "EVAL_" INTVAL_FMT, eval_number);
+    name = Parrot_sprintf_c(interp, "EVAL_" INTVAL_FMT, eval_number);
     new_cs = PF_create_default_segs(interp, name, 0);
     old_cs = Parrot_switch_to_cs(interp, new_cs, 0);
 
@@ -663,7 +662,9 @@
 
     /* spit out the sourcefile */
     if (Interp_debug_TEST(interp, PARROT_EVAL_DEBUG_FLAG)) {
-        FILE * const fp = fopen(name, "w");
+        char *buf = Parrot_str_to_cstring(interp, name);
+        FILE * const fp = fopen(buf, "w");
+        Parrot_str_free_cstring(buf);
         if (fp) {
             fputs(s, fp);
             fclose(fp);
@@ -677,7 +678,7 @@
         IMCC_INFO(interp)->state->next = NULL;
 
     IMCC_INFO(interp)->state->pasm_file = pasm_file;
-    IMCC_INFO(interp)->state->file      = mem_sys_strdup(name);
+    IMCC_INFO(interp)->state->file      = Parrot_str_to_cstring(interp, name);
     IMCC_INFO(interp)->expect_pasm      = 0;
 
     compile_string(interp, s, yyscanner);
@@ -695,7 +696,7 @@
     IMCC_pop_parser_state(interp, yyscanner);
 
     if (!IMCC_INFO(interp)->error_code) {
-        Parrot_sub *sub_data;
+        Parrot_Sub_attributes *sub_data;
 
         /*
          * create sub PMC
@@ -707,7 +708,7 @@
         sub_data->seg        = new_cs;
         sub_data->start_offs = 0;
         sub_data->end_offs   = new_cs->base.size;
-        sub_data->name       = Parrot_str_new(interp, name, 0);
+        sub_data->name       = Parrot_str_copy(interp, name);
 
         *error_message = NULL;
     }
@@ -716,13 +717,14 @@
     }
 
     if (imc_info) {
+        SymReg *ns                  = IMCC_INFO(interp)->cur_namespace;
         IMCC_INFO(interp)           = imc_info->prev;
         mem_sys_free(imc_info);
         imc_info                    = IMCC_INFO(interp);
         IMCC_INFO(interp)->cur_unit = imc_info->last_unit;
 
-        if (IMCC_INFO(interp)->cur_namespace)
-            free_sym(IMCC_INFO(interp)->cur_namespace);
+        if (ns && ns != imc_info->cur_namespace)
+            free_sym(ns);
 
         IMCC_INFO(interp)->cur_namespace = imc_info->cur_namespace;
     }
@@ -869,12 +871,12 @@
     /* We need to clear the current_results from the current context. This is
      * in order to prevent any RetContinuations that get promoted to full
      * Continuations (this happens when something is the target of a :outer)
-     * trying to return values using them when invoked. (See TT#500 for the
+     * trying to return values using them when invoked. (See TT #500 for the
      * report of the bug this fixes). */
-    opcode_t *save_results = CONTEXT(interp)->current_results;
-    CONTEXT(interp)->current_results = NULL;
+    opcode_t *save_results = Parrot_pcc_get_results(interp, CURRENT_CONTEXT(interp));
+    Parrot_pcc_set_results(interp, CURRENT_CONTEXT(interp), NULL);
     sub = imcc_compile(interp, s, 0, &error_message);
-    CONTEXT(interp)->current_results = save_results;
+    Parrot_pcc_set_results(interp, CURRENT_CONTEXT(interp), save_results);
 
     if (sub)
         return sub;
@@ -906,11 +908,11 @@
     const char                *ext;
     FILE                      *fp;
     STRING                    *fs;
-    Parrot_Context            *ignored;
+    PMC                       *ignored;
 
     /* need at least 3 regs for compilation of constant math e.g.
      * add_i_ic_ic - see also IMCC_subst_constants() */
-    INTVAL regs_used[4] = {3, 3, 3, 3};
+    UINTVAL regs_used[4] = {3, 3, 3, 3};
 
     if (IMCC_INFO(interp)->last_unit) {
         /* a reentrant compile */

Modified: branches/orderedhash_revamp/compilers/imcc/pbc.c
==============================================================================
--- branches/orderedhash_revamp/compilers/imcc/pbc.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/imcc/pbc.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -6,7 +6,8 @@
 #include "imc.h"
 #include "pbc.h"
 #include "parrot/packfile.h"
-#include "../src/pmc/pmc_sub.h"
+#include "pmc/pmc_sub.h"
+#include "pmc/pmc_callcontext.h"
 
 /* HEADERIZER HFILE: compilers/imcc/pbc.h */
 
@@ -164,6 +165,13 @@
     SHIM(void *param))
         __attribute__nonnull__(1);
 
+static void init_fixedintegerarray_from_string(PARROT_INTERP,
+    ARGIN(PMC *p),
+    ARGIN(STRING *s))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
+
 static void make_new_sub(PARROT_INTERP, ARGIN(IMC_Unit *unit))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
@@ -179,15 +187,6 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-PARROT_WARN_UNUSED_RESULT
-static int old_blocks(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-PARROT_CONST_FUNCTION
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static const char * slice_deb(int bits);
-
 static void store_fixup(PARROT_INTERP,
     ARGIN(const SymReg *r),
     int pc,
@@ -209,98 +208,92 @@
         __attribute__nonnull__(2)
         __attribute__nonnull__(3);
 
-#define ASSERT_ARGS_add_1_const __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_add_1_const __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_add_const_key __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(key) \
+    , PARROT_ASSERT_ARG(s_key))
+#define ASSERT_ARGS_add_const_num __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_add_const_pmc_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_add_const_str __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_add_const_table __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_add_const_table_key __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(key))
+#define ASSERT_ARGS_add_const_table_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_build_key __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(key_reg))
+#define ASSERT_ARGS_constant_folding __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_create_lexinfo __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(sub_pmc))
+#define ASSERT_ARGS_find_global_label __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(sym) \
+    , PARROT_ASSERT_ARG(pc))
+#define ASSERT_ARGS_find_outer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_find_sub_by_subid __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(lookup) \
+    , PARROT_ASSERT_ARG(sym) \
+    , PARROT_ASSERT_ARG(pc))
+#define ASSERT_ARGS_fixup_globals __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_get_codesize __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(src_lines))
+#define ASSERT_ARGS_get_old_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ins_line))
+#define ASSERT_ARGS_imcc_globals_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_init_fixedintegerarray_from_string \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_add_const_key __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(p) \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_make_new_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(key) \
-    || PARROT_ASSERT_ARG(s_key)
-#define ASSERT_ARGS_add_const_num __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_add_const_pmc_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_add_const_str __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_add_const_table __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_add_const_table_key __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(key)
-#define ASSERT_ARGS_add_const_table_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_build_key __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(key_reg)
-#define ASSERT_ARGS_constant_folding __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_create_lexinfo __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(sub_pmc)
-#define ASSERT_ARGS_find_global_label __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(sym) \
-    || PARROT_ASSERT_ARG(pc)
-#define ASSERT_ARGS_find_outer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_find_sub_by_subid __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(lookup) \
-    || PARROT_ASSERT_ARG(sym) \
-    || PARROT_ASSERT_ARG(pc)
-#define ASSERT_ARGS_fixup_globals __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_get_codesize __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(src_lines)
-#define ASSERT_ARGS_get_old_size __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ins_line)
-#define ASSERT_ARGS_imcc_globals_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_make_new_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_make_pmc_const __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_mk_multi_sig __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_old_blocks __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_slice_deb __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_store_fixup __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_store_key_const __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(str)
-#define ASSERT_ARGS_store_sub_size __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_verify_signature __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_make_pmc_const __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ins) \
-    || PARROT_ASSERT_ARG(pc)
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_mk_multi_sig __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_store_fixup __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_store_key_const __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(str))
+#define ASSERT_ARGS_store_sub_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_verify_signature __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ins) \
+    , PARROT_ASSERT_ARG(pc))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
-#ifdef HAS_JIT
-
-PARROT_WARN_UNUSED_RESULT
-static int old_blocks(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-#endif /* HAS_JIT */
-
 /*
 
 =item C<static void imcc_globals_destroy(PARROT_INTERP, int ex, void *param)>
@@ -467,10 +460,11 @@
 
     /* we need some segments */
     if (!interp->code) {
-        PMC *self;
+        const char *n    = IMCC_INFO(interp)->state->file;
+        STRING     *name = Parrot_str_new(interp, n, strlen(n));
+        PMC        *self;
 
-        cs->seg = interp->code =
-            PF_create_default_segs(interp, IMCC_INFO(interp)->state->file, 1);
+        cs->seg = interp->code = PF_create_default_segs(interp, name, 1);
 
         /*
          * create a PMC constant holding the interpreter state
@@ -488,84 +482,6 @@
     return 0;
 }
 
-
-#ifdef HAS_JIT
-
-/*
-
-=item C<static int old_blocks(PARROT_INTERP)>
-
-Gets the size/line of bytecode in ops at this point.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-static int
-old_blocks(PARROT_INTERP)
-{
-    ASSERT_ARGS(old_blocks)
-    const  subs_t *s;
-    size_t         size = 0;
-
-    for (s = IMCC_INFO(interp)->globals->cs->subs; s; s = s->prev) {
-        size += s->n_basic_blocks;
-    }
-
-    return size;
-}
-
-
-/*
-
-=item C<opcode_t * make_jit_info(PARROT_INTERP, const IMC_Unit *unit)>
-
-Creates JIT information for this compilation unit.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-opcode_t *
-make_jit_info(PARROT_INTERP, ARGIN(const IMC_Unit *unit))
-{
-    ASSERT_ARGS(make_jit_info)
-    const size_t old  = old_blocks(interp);
-    const size_t size = unit->n_basic_blocks + old;
-
-    if (!IMCC_INFO(interp)->globals->cs->jit_info) {
-        const size_t len  = strlen(IMCC_INFO(interp)->globals->cs->seg->base.name) + 5;
-        char * const name = mem_allocate_n_typed(len, char);
-
-        snprintf(name, len, "%s_JIT",
-            IMCC_INFO(interp)->globals->cs->seg->base.name);
-
-        IMCC_INFO(interp)->globals->cs->jit_info =
-                PackFile_Segment_new_seg(interp,
-                    interp->code->base.dir, PF_UNKNOWN_SEG, name, 1);
-
-        mem_sys_free(name);
-    }
-
-    /* store current size */
-    IMCC_INFO(interp)->globals->cs->subs->n_basic_blocks = unit->n_basic_blocks;
-
-    /* offset of block start and end, 4 * registers_used */
-    IMCC_INFO(interp)->globals->cs->jit_info->data =
-        mem_realloc_n_typed(IMCC_INFO(interp)->globals->cs->jit_info->data,
-            size * 4, opcode_t);
-
-    IMCC_INFO(interp)->globals->cs->jit_info->size = size * 4;
-
-    return IMCC_INFO(interp)->globals->cs->jit_info->data + old * 4;
-}
-
-#endif /* HAS_JIT */
-
-
 /*
 
 =item C<static void make_new_sub(PARROT_INTERP, IMC_Unit *unit)>
@@ -673,7 +589,10 @@
         fixup->type |= VT_ENCODED;
 
     if (r->usage & U_SUBID_LOOKUP)
-      fixup->usage = U_SUBID_LOOKUP;
+        fixup->usage = U_SUBID_LOOKUP;
+
+    if (r->usage & U_LEXICAL)
+        fixup->usage |= U_LEXICAL;
 
     /* set_p_pc   = 2  */
     fixup->color  = pc;
@@ -867,7 +786,9 @@
                 subs_t *s1;
 
                 /* check in matching namespace */
-                if (fixup->usage & U_SUBID_LOOKUP) {
+                if (fixup->usage & U_LEXICAL)
+                    s1 = NULL;
+                else if (fixup->usage & U_SUBID_LOOKUP) {
                     subid_lookup = 1;
                     /* s1 = find_sub_by_subid(interp, fixup->name, &pc); */
                     s1 = find_sub_by_subid(interp, fixup->name, s, &pc);
@@ -997,7 +918,7 @@
 
 /*
 
-=item C<STRING * IMCC_string_from__STRINGC(PARROT_INTERP, const char *buf)>
+=item C<STRING * IMCC_string_from__STRINGC(PARROT_INTERP, char *buf)>
 
 =cut
 
@@ -1006,7 +927,7 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 STRING *
-IMCC_string_from__STRINGC(PARROT_INTERP, ARGIN(const char *buf))
+IMCC_string_from__STRINGC(PARROT_INTERP, ARGIN(char *buf))
 {
     ASSERT_ARGS(IMCC_string_from__STRINGC)
     const int ascii = (*buf == '\'' || *buf == '"');
@@ -1206,7 +1127,7 @@
                 while (n) {
                     STRING     *lex_name;
                     const int   k = n->color;
-                    Parrot_sub *sub;
+                    Parrot_Sub_attributes *sub;
                     PARROT_ASSERT(k >= 0);
 
                     lex_name = constants[k]->u.string;
@@ -1214,12 +1135,11 @@
 
                     PMC_get_sub(interp, sub_pmc, sub);
                     IMCC_debug(interp, DEBUG_PBC_CONST,
-                            "add lexical '%s' to sub name '%s'\n",
-                            n->name, (char*)sub->name->strstart);
+                            "add lexical '%s' to sub name '%Ss'\n",
+                            n->name, sub->name);
 
-                    Parrot_PCCINVOKE(interp, lex_info,
-                            string_from_literal(interp, "declare_lex_preg"),
-                            "SI->", lex_name, r->color);
+                    VTABLE_set_integer_keyed_str(interp, lex_info,
+                            lex_name, r->color);
 
                     /* next possible name */
                     n = n->reg;
@@ -1256,7 +1176,8 @@
     subs_t      *s;
     PMC         *current;
     STRING      *cur_name;
-    Parrot_sub *sub;
+    char        *cur_name_str;
+    Parrot_Sub_attributes *sub;
     size_t      len;
 
     if (!unit->outer)
@@ -1281,19 +1202,22 @@
     }
 
     /* could be eval too; check if :outer is the current sub */
-    current = CONTEXT(interp)->current_sub;
+    current = Parrot_pcc_get_sub(interp, CURRENT_CONTEXT(interp));
 
-    if (!current)
+    if (PMC_IS_NULL(current))
         IMCC_fatal(interp, 1, "Undefined :outer sub '%s'.\n",
                    unit->outer->name);
 
     PMC_get_sub(interp, current, sub);
     cur_name = sub->name;
 
-    if (cur_name->strlen == len
-    && (memcmp((char*)cur_name->strstart, unit->outer->name, len) == 0))
+    cur_name_str = Parrot_str_to_cstring(interp,  sub->name);
+    if (strlen(cur_name_str) == len
+    && (memcmp(cur_name_str, unit->outer->name, len) == 0)) {
+        Parrot_str_free_cstring(cur_name_str);
         return current;
-
+    }
+    Parrot_str_free_cstring(cur_name_str);
     return NULL;
 }
 
@@ -1321,9 +1245,9 @@
 add_const_pmc_sub(PARROT_INTERP, ARGMOD(SymReg *r), size_t offs, size_t end)
 {
     ASSERT_ARGS(add_const_pmc_sub)
-    PMC                 *ns_pmc;
-    PMC                 *sub_pmc;
-    Parrot_sub          *sub, *outer_sub;
+    PMC                   *ns_pmc;
+    PMC                   *sub_pmc;
+    Parrot_Sub_attributes *sub, *outer_sub;
 
     const int            k            = add_const_table(interp);
     PackFile_ConstTable * const ct    = interp->code->const_table;
@@ -1420,22 +1344,22 @@
 
     if (ns_const >= 0 && ns_const < ct->const_count) {
         switch (ct->constants[ns_const]->type) {
-            case PFC_KEY:
-                ns_pmc = ct->constants[ns_const]->u.key;
-                break;
-            case PFC_STRING:
-                ns_pmc = constant_pmc_new(interp, enum_class_String);
-                VTABLE_set_string_native(interp, ns_pmc, ct->constants[ns_const]->u.string);
-                break;
-            default:
-                break;
+          case PFC_KEY:
+            ns_pmc = ct->constants[ns_const]->u.key;
+            break;
+          case PFC_STRING:
+            ns_pmc = constant_pmc_new(interp, enum_class_String);
+            VTABLE_set_string_native(interp, ns_pmc, ct->constants[ns_const]->u.string);
+            break;
+          default:
+            break;
         }
     }
 
     sub->namespace_name = ns_pmc;
     sub->start_offs     = offs;
     sub->end_offs       = end;
-    sub->HLL_id         = CONTEXT(interp)->current_HLL;
+    sub->HLL_id         = Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp));
 
     for (i = 0; i < 4; ++i)
         sub->n_regs_used[i] = unit->n_regs_used[i];
@@ -1512,14 +1436,13 @@
         PMC_get_sub(interp, sub->outer_sub, outer_sub);
 
     IMCC_debug(interp, DEBUG_PBC_CONST,
-            "add_const_pmc_sub '%s' flags %x color %d (%s) "
-            "lex_info %s :outer(%s)\n",
+            "add_const_pmc_sub '%s' flags %x color %d (%Ss) "
+            "lex_info %s :outer(%Ss)\n",
             r->name, r->pcc_sub->pragma, k,
-            (char *) sub_pmc->vtable->whoami->strstart,
+            sub_pmc->vtable->whoami,
             sub->lex_info ? "yes" : "no",
-            sub->outer_sub ?
-                (char *)outer_sub->name->strstart :
-                "*none*");
+            sub->outer_sub? outer_sub->name :
+            Parrot_str_new(interp, "*none*", 0));
 
     /*
      * create entry in our fixup (=symbol) table
@@ -1583,42 +1506,6 @@
 
 /*
 
-=item C<static const char * slice_deb(int bits)>
-
-Returns debugging information for the indicated slice type.
-
-=cut
-
-*/
-
-PARROT_CONST_FUNCTION
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static const char *
-slice_deb(int bits)
-{
-    ASSERT_ARGS(slice_deb)
-    if ((bits & VT_SLICE_BITS) == (VT_START_SLICE|VT_END_SLICE))
-        return "start+end";
-
-    if ((bits & VT_SLICE_BITS) == (VT_START_ZERO|VT_END_SLICE))
-        return "..end";
-
-    if ((bits & VT_SLICE_BITS) == (VT_START_SLICE|VT_END_INF))
-        return "start..";
-
-    if (bits & VT_START_SLICE)
-        return "start";
-
-    if (bits & VT_END_SLICE)
-        return "end";
-
-    return "";
-}
-
-
-/*
-
 =item C<static opcode_t build_key(PARROT_INTERP, SymReg *key_reg)>
 
 Builds a Key PMC from the given SymReg.
@@ -1655,7 +1542,7 @@
 
     for (key_length = 0; reg ; reg = reg->nextkey, key_length++) {
         SymReg *r = reg;
-        int     var_type, slice_bits, type;
+        int     type;
 
         if ((pc - key - 2) >= KEYLEN)
             IMCC_fatal(interp, 1, "build_key:"
@@ -1667,69 +1554,63 @@
         if (r->reg)
             r = r->reg;
 
-        var_type   = type & ~VT_SLICE_BITS;
-        slice_bits = type &  VT_SLICE_BITS;
+        switch (type) {
+          case VTIDENTIFIER:       /* P[S0] */
+          case VTPASM:             /* P[S0] */
+          case VTREG:              /* P[S0] */
+            if (r->set == 'I')
+                *pc++ = PARROT_ARG_I;    /* register type */
+            else if (r->set == 'S')
+                *pc++ = PARROT_ARG_S;
+            else
+                IMCC_fatal(interp, 1, "build_key: wrong register set\n");
+
+            /* don't emit mapped regs in key parts */
+            if (r->color < 0)
+                *pc++ = -1 - r->color;
+            else
+                *pc++ = r->color;
 
-        switch (var_type) {
-            case VTIDENTIFIER:       /* P[S0] */
-            case VTPASM:             /* P[S0] */
-            case VTREG:              /* P[S0] */
-                if (r->set == 'I')
-                    *pc++ = PARROT_ARG_I | slice_bits;    /* register type */
-                else if (r->set == 'S')
-                    *pc++ = PARROT_ARG_S | slice_bits;
-                else
-                    IMCC_fatal(interp, 1, "build_key: wrong register set\n");
+            sprintf(s+strlen(s), "%c%d", r->set, (int)r->color);
 
-                /* don't emit mapped regs in key parts */
-                if (r->color < 0)
-                    *pc++ = -1 - r->color;
-                else
-                    *pc++ = r->color;
+            IMCC_debug(interp, DEBUG_PBC_CONST,
+                    " keypart reg %s %c%d\n",
+                    r->name, r->set, (int)r->color);
+            break;
+          case VT_CONSTP:
+          case VTCONST:
+          case VTCONST|VT_ENCODED:
+            switch (r->set) {
+              case 'S':                       /* P["key"] */
+                /* str constant */
+                *pc++ = PARROT_ARG_SC;
 
-                sprintf(s+strlen(s), "%c%d", r->set, (int)r->color);
+                /* constant idx */
+                *pc++ = r->color;
 
                 IMCC_debug(interp, DEBUG_PBC_CONST,
-                        " keypart reg %s %c%d slice %s\n",
-                        r->name, r->set, (int)r->color,
-                        slice_deb(slice_bits));
+                        " keypart SC %s #%d\n",
+                        r->name, r->color);
                 break;
-            case VT_CONSTP:
-            case VTCONST:
-            case VTCONST|VT_ENCODED:
-                switch (r->set) {
-                    case 'S':                       /* P["key"] */
-                        /* str constant */
-                        *pc++ = PARROT_ARG_SC | slice_bits;
-
-                        /* constant idx */
-                        *pc++ = r->color;
-
-                        IMCC_debug(interp, DEBUG_PBC_CONST,
-                                " keypart SC %s #%d slice %s\n",
-                                r->name, r->color,
-                                slice_deb(slice_bits));
-                        break;
-                    case 'I':                       /* P[;42;..] */
-                        /* int constant */
-                        *pc++ = PARROT_ARG_IC | slice_bits;
-
-                        /* value */
-                        *pc++ = r->color = atol(r->name);
-
-                        IMCC_debug(interp, DEBUG_PBC_CONST,
-                                " keypart IC %s #%d slice %s\n",
-                                r->name, r->color,
-                                slice_deb(slice_bits));
-                        break;
-                    default:
-                        IMCC_fatal(interp, 1, "build_key: unknown set\n");
-                }
-                sprintf(s+strlen(s), "%cc" INTVAL_FMT, r->set, r->color);
+              case 'I':                       /* P[;42;..] */
+                /* int constant */
+                *pc++ = PARROT_ARG_IC;
+
+                /* value */
+                *pc++ = r->color = atol(r->name);
+
+                IMCC_debug(interp, DEBUG_PBC_CONST,
+                        " keypart IC %s #%d\n",
+                        r->name, r->color);
                 break;
-            default:
-                IMCC_fatal(interp, 1, "build_key: "
-                    "unknown type 0x%x on %s\n", var_type, r->name);
+              default:
+                IMCC_fatal(interp, 1, "build_key: unknown set\n");
+            }
+            sprintf(s+strlen(s), "%cc" INTVAL_FMT, r->set, r->color);
+            break;
+          default:
+            IMCC_fatal(interp, 1, "build_key: "
+                    "unknown type 0x%x on %s\n", type, r->name);
         }
     }
 
@@ -1802,6 +1683,97 @@
     return i;
 }
 
+/*
+
+=item C<static void init_fixedintegerarray_from_string(PARROT_INTERP, PMC *p,
+STRING *s)>
+
+Initializes the passed FIA from a string representation I<"(el0, el1, ...)">.
+
+=cut
+
+*/
+
+static void
+init_fixedintegerarray_from_string(PARROT_INTERP, ARGIN(PMC *p), ARGIN(STRING *s))
+{
+    ASSERT_ARGS(init_fixedintegerarray_from_string)
+    INTVAL  n, elem, i, l;
+    char   *src, *chr, *start;
+    int     base;
+
+    if (s->encoding != Parrot_fixed_8_encoding_ptr)
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_ENCODING,
+            "unhandled string encoding in FixedIntegerArray initialization");
+
+    l = Parrot_str_byte_length(interp, s);
+
+    if (!l)
+        return;
+
+    chr = src = Parrot_str_to_cstring(interp, s);
+
+    /* "()" - no args */
+    if (l <= 2 && *src == '(') {
+        Parrot_str_free_cstring(src);
+        return;
+    }
+
+    /* count commas */
+    n = 0;
+    while (*chr) {
+        if (*chr == ',')
+            n++;
+        chr++;
+    }
+
+    /* presize the array */
+    VTABLE_set_integer_native(interp, p, n + 1);
+
+    /* parse string */
+    chr = src;
+
+    for (i = l, n = 0; i; --i, ++chr) {
+        switch (*chr) {
+          case ' ':
+            continue;
+          case '\t':
+            continue;
+          case '(':
+            continue;
+          case ')':
+            break;
+          case ',':
+            n++;
+            break;
+          default:
+            base = 10;
+            if (*chr == '0') {
+                ++chr;
+                --i;
+                if (*chr == 'b' || *chr == 'B') {
+                    base = 2;
+                    ++chr;
+                    --i;
+                }
+                else if (*chr == 'x' || *chr == 'X') {
+                    base = 16;
+                    ++chr;
+                    --i;
+                }
+            }
+            start = chr;
+            elem  = strtoul(chr, &chr, base);
+            --chr;
+            i -= (chr - start);
+            VTABLE_set_integer_keyed_int(interp, p, n, elem);
+            break;
+        }
+    }
+
+    Parrot_str_free_cstring(src);
+
+}
 
 /*
 
@@ -1833,7 +1805,26 @@
     else
         s = Parrot_str_unescape(interp, r->name, 0, NULL);
 
-    p = VTABLE_instantiate_str(interp, _class, s, PObj_constant_FLAG);
+    p  = constant_pmc_new(interp, r->pmc_type);
+
+    switch (r->pmc_type) {
+      case enum_class_Integer:
+        VTABLE_set_integer_native(interp, p, Parrot_str_to_int(interp, s));
+        break;
+      case enum_class_Float:
+        VTABLE_set_number_native(interp, p, Parrot_str_to_num(interp, s));
+        break;
+      case enum_class_String:
+        VTABLE_set_string_native(interp, p, s);
+        break;
+      case enum_class_FixedIntegerArray:
+        init_fixedintegerarray_from_string(interp, p, s);
+        break;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL,
+            EXCEPTION_INVALID_OPERATION,
+            "Can't generate PMC constant for this type.");
+    }
 
     /* append PMC constant */
     r->color = add_const_table_pmc(interp, p);
@@ -1861,34 +1852,34 @@
         return;
 
     switch (r->set) {
-        case 'I':
-            r->color = IMCC_int_from_reg(interp, r);
-            break;
-        case 'S':
-            if (r->type & VT_CONSTP)
-                r = r->reg;
-            r->color = add_const_str(interp, r);
-            break;
-        case 'N':
-            r->color = add_const_num(interp, r->name);
-            break;
-        case 'K':
-            {
+      case 'I':
+        r->color = IMCC_int_from_reg(interp, r);
+        break;
+      case 'S':
+        if (r->type & VT_CONSTP)
+            r = r->reg;
+        r->color = add_const_str(interp, r);
+        break;
+      case 'N':
+        r->color = add_const_num(interp, r->name);
+        break;
+      case 'K':
+        {
             SymReg *key = r;
 
             for (r = r->nextkey; r; r = r->nextkey)
                 if (r->type & VTCONST)
                     add_1_const(interp, r);
                 build_key(interp, key);
-            }
-            break;
-        case 'P':
-            make_pmc_const(interp, r);
-            IMCC_debug(interp, DEBUG_PBC_CONST,
+        }
+        break;
+      case 'P':
+        make_pmc_const(interp, r);
+        IMCC_debug(interp, DEBUG_PBC_CONST,
                     "PMC const %s\tcolor %d\n", r->name, r->color);
-            break;
-        default:
-            break;
+        break;
+      default:
+        break;
     }
 
     if (r)
@@ -2012,8 +2003,12 @@
 
     pragma = ins->symregs[0]->pcc_sub->pragma;
 
-    if (pragma & P_IMMEDIATE) {
-        /* clear global symbols temporarily -- RT #60000, for example */
+    if (IMCC_INFO(interp)->write_pbc && !(pragma & P_ANON))
+        return 0;
+
+    if (pragma & P_IMMEDIATE
+    && (!IMCC_INFO(interp)->write_pbc || (pragma & P_ANON))) {
+        /* clear global symbols temporarily -- TT #1324, for example */
         imcc_globals *g      = IMCC_INFO(interp)->globals;
         SymHash       ghash;
 
@@ -2150,24 +2145,14 @@
         constant_folding(interp, unit);
         store_sub_size(interp, code_size, ins_size);
 
-        /*
-         * allocate code and pic_index
-         *
-         * pic_index is half the size of the code, as one PIC-cacheable opcode
-         * is at least two opcodes wide - see below how to further decrease
-         * this storage
-         */
+        /* allocate code */
         interp->code->base.data       = (opcode_t *)
             mem_sys_realloc(interp->code->base.data, bytes);
 
         /* reallocating this removes its mmaped-ness; needs encapsulation */
         interp->code->base.pf->is_mmap_ped = 0;
 
-        interp->code->pic_index->data = (opcode_t *)
-            mem_sys_realloc(interp->code->pic_index->data, bytes / 2);
-
         interp->code->base.size       = oldsize + code_size;
-        interp->code->pic_index->size = (oldsize + code_size) / 2;
 
         IMCC_INFO(interp)->pc  = (opcode_t *)interp->code->base.data + oldsize;
         IMCC_INFO(interp)->npc = 0;
@@ -2224,17 +2209,13 @@
         /* Add annotations seg if we're missing one. */
         if (!interp->code->annotations) {
             /* Create segment. "_ANN" is added to the name */
-            const               size_t len  = strlen(interp->code->base.name) + 5;
-            char               * const name = (char *) mem_sys_allocate(len);
-            int                        add  = interp->code && interp->code->base.dir;
+            STRING *name = Parrot_sprintf_c(interp, "%Ss_ANN", interp->code->base.name);
+            int                        add  = interp->code->base.dir ? 1 : 0;
             PackFile_Directory * const dir  = add ? interp->code->base.dir :
                     &interp->initial_pf->directory;
-            strcpy(name, interp->code->base.name);
-            strcat(name, "_ANN");
             interp->code->annotations = (PackFile_Annotations *)
                     PackFile_Segment_new_seg(interp, dir,
                         PF_ANNOTATIONS_SEG, name, add);
-            mem_sys_free(name);
             interp->code->annotations->code = interp->code;
 
             /* Create initial group. */
@@ -2244,18 +2225,18 @@
 
         /* Add annotation. */
         switch (ins->symregs[1]->set) {
-            case 'I':
-                annotation_type = PF_ANNOTATION_KEY_TYPE_INT;
-                break;
-            case 'N':
-                annotation_type = PF_ANNOTATION_KEY_TYPE_NUM;
-                break;
-            case 'S':
-                annotation_type = PF_ANNOTATION_KEY_TYPE_STR;
-                break;
-            default:
-                IMCC_fatal(interp, 1, "e_pbc_emit:"
-                        "invalid type for annotation value\n");
+          case 'I':
+            annotation_type = PF_ANNOTATION_KEY_TYPE_INT;
+            break;
+          case 'N':
+            annotation_type = PF_ANNOTATION_KEY_TYPE_NUM;
+            break;
+          case 'S':
+            annotation_type = PF_ANNOTATION_KEY_TYPE_STR;
+            break;
+          default:
+            IMCC_fatal(interp, 1, "e_pbc_emit:"
+                    "invalid type for annotation value\n");
         }
         PackFile_Annotations_add_entry(interp, interp->code->annotations,
                     IMCC_INFO(interp)->pc - interp->code->base.data,
@@ -2292,21 +2273,6 @@
 
         op = (opcode_t)ins->opnum;
 
-        /* add PIC idx */
-        if (parrot_PIC_op_is_cached(op)) {
-            const size_t offs = IMCC_INFO(interp)->pc - interp->code->base.data;
-            /*
-             * for pic_idx fitting into a short, we could
-             * further reduce the size by storing shorts
-             * the relation code_size / pic_index_size could
-             * indicate the used storage
-             *
-             * drawback: if we reach 0xffff, we'd have to resize again
-             */
-            interp->code->pic_index->data[offs / 2] =
-                ++IMCC_INFO(interp)->globals->cs->pic_idx;
-        }
-
         /* Start generating the bytecode */
         *(IMCC_INFO(interp)->pc)++   = op;
 
@@ -2318,52 +2284,52 @@
 
         for (i = 0; i < op_info->op_count-1; i++) {
             switch (op_info->types[i]) {
-                case PARROT_ARG_IC:
-                    /* branch instruction */
-                    if (op_info->labels[i]) {
-                        if (last_label == 1)
-                            /* we don't have a branch with offset 1 !? */
-                            IMCC_fatal(interp, 1, "e_pbc_emit: "
+              case PARROT_ARG_IC:
+                /* branch instruction */
+                if (op_info->labels[i]) {
+                    if (last_label == 1)
+                        /* we don't have a branch with offset 1 !? */
+                        IMCC_fatal(interp, 1, "e_pbc_emit: "
                                     "no label offset found\n");
-                        *(IMCC_INFO(interp)->pc)++      = last_label;
-                        last_label = 1;
-                        break;
-                        /* else fall through */
-                    }
-                case PARROT_ARG_I:
-                case PARROT_ARG_N:
-                case PARROT_ARG_S:
-                case PARROT_ARG_P:
-                case PARROT_ARG_K:
-                case PARROT_ARG_KI:
-                case PARROT_ARG_KIC:
-                case PARROT_ARG_SC:
-                case PARROT_ARG_NC:
-                case PARROT_ARG_PC:
-                    r     = ins->symregs[i];
+                    *(IMCC_INFO(interp)->pc)++      = last_label;
+                    last_label = 1;
+                    break;
+                    /* else fall through */
+                }
+              case PARROT_ARG_I:
+              case PARROT_ARG_N:
+              case PARROT_ARG_S:
+              case PARROT_ARG_P:
+              case PARROT_ARG_K:
+              case PARROT_ARG_KI:
+              case PARROT_ARG_KIC:
+              case PARROT_ARG_SC:
+              case PARROT_ARG_NC:
+              case PARROT_ARG_PC:
+                r     = ins->symregs[i];
 
-                    if (r->type & VT_CONSTP)
-                        r = r->reg;
+                if (r->type & VT_CONSTP)
+                    r = r->reg;
 
-                    *(IMCC_INFO(interp)->pc)++ = (opcode_t) r->color;
-                    IMCC_debug(interp, DEBUG_PBC, " %d", r->color);
-                    break;
-                case PARROT_ARG_KC:
-                    r = ins->symregs[i];
-                    if (r->set == 'K') {
-                        PARROT_ASSERT(r->color >= 0);
-                        *(IMCC_INFO(interp)->pc)++ = r->color;
-                    }
-                    else {
-                        *(IMCC_INFO(interp)->pc)++ = build_key(interp, r);
-                    }
-                    IMCC_debug(interp, DEBUG_PBC, " %d",
+                *(IMCC_INFO(interp)->pc)++ = (opcode_t) r->color;
+                IMCC_debug(interp, DEBUG_PBC, " %d", r->color);
+                break;
+              case PARROT_ARG_KC:
+                r = ins->symregs[i];
+                if (r->set == 'K') {
+                    PARROT_ASSERT(r->color >= 0);
+                    *(IMCC_INFO(interp)->pc)++ = r->color;
+                }
+                else {
+                    *(IMCC_INFO(interp)->pc)++ = build_key(interp, r);
+                }
+                IMCC_debug(interp, DEBUG_PBC, " %d",
                         IMCC_INFO(interp)->pc[-1]);
-                    break;
-                default:
-                    IMCC_fatal(interp, 1, "e_pbc_emit:"
+                break;
+              default:
+                IMCC_fatal(interp, 1, "e_pbc_emit:"
                             "unknown argtype in parrot op\n");
-                    break;
+                break;
             }
         }
         if (ins->opnum == PARROT_OP_set_args_pc

Modified: branches/orderedhash_revamp/compilers/imcc/pbc.h
==============================================================================
--- branches/orderedhash_revamp/compilers/imcc/pbc.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/imcc/pbc.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -38,7 +38,7 @@
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-STRING * IMCC_string_from__STRINGC(PARROT_INTERP, ARGIN(const char *buf))
+STRING * IMCC_string_from__STRINGC(PARROT_INTERP, ARGIN(char *buf))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
@@ -48,38 +48,29 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-opcode_t * make_jit_info(PARROT_INTERP, ARGIN(const IMC_Unit *unit))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-#define ASSERT_ARGS_e_pbc_close __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_e_pbc_emit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(ins)
-#define ASSERT_ARGS_e_pbc_end_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_e_pbc_close __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_e_pbc_emit __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_e_pbc_new_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(ins))
+#define ASSERT_ARGS_e_pbc_end_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_e_pbc_open __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_IMCC_int_from_reg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_e_pbc_new_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_IMCC_string_from__STRINGC __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_e_pbc_open __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_IMCC_int_from_reg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(buf)
-#define ASSERT_ARGS_IMCC_string_from_reg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_IMCC_string_from__STRINGC __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_make_jit_info __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(buf))
+#define ASSERT_ARGS_IMCC_string_from_reg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
+    , PARROT_ASSERT_ARG(r))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: compilers/imcc/pbc.c */
 

Modified: branches/orderedhash_revamp/compilers/imcc/pcc.c
==============================================================================
--- branches/orderedhash_revamp/compilers/imcc/pcc.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/imcc/pcc.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -112,39 +112,39 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-#define ASSERT_ARGS_insert_tail_call __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_insert_tail_call __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(ins) \
-    || PARROT_ASSERT_ARG(sub)
-#define ASSERT_ARGS_insINS __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(ins) \
+    , PARROT_ASSERT_ARG(sub))
+#define ASSERT_ARGS_insINS __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(ins) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(regs)
-#define ASSERT_ARGS_move_regs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(ins) \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(regs))
+#define ASSERT_ARGS_move_regs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(ins) \
-    || PARROT_ASSERT_ARG(dest) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_pcc_get_args __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(ins) \
+    , PARROT_ASSERT_ARG(dest) \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_pcc_get_args __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(ins) \
-    || PARROT_ASSERT_ARG(op_name)
-#define ASSERT_ARGS_pcc_reg_mov __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(ins) \
+    , PARROT_ASSERT_ARG(op_name))
+#define ASSERT_ARGS_pcc_reg_mov __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(vinfo)
-#define ASSERT_ARGS_recursive_tail_call __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(vinfo))
+#define ASSERT_ARGS_recursive_tail_call __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(ins) \
-    || PARROT_ASSERT_ARG(sub)
-#define ASSERT_ARGS_unshift_self __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(ins) \
+    , PARROT_ASSERT_ARG(sub))
+#define ASSERT_ARGS_unshift_self __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(sub) \
-    || PARROT_ASSERT_ARG(obj)
+    , PARROT_ASSERT_ARG(obj))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -288,31 +288,53 @@
         regs[i + 1] = arg;
         flags       = 0;
 
-        if (arg_flags[i] & VT_FLAT)
-            flags |= PARROT_ARG_FLATTEN;
-
-        if (arg_flags[i] & VT_OPTIONAL)
-            flags |= PARROT_ARG_OPTIONAL;
-        else if (arg_flags[i] & VT_OPT_FLAG)
-            flags |= PARROT_ARG_OPT_FLAG;
-
-        if (arg_flags[i] & VT_NAMED)
-            flags |= PARROT_ARG_NAME;
-
-        /* add argument type bits */
-        if (arg->type & VTCONST)
-            flags |= PARROT_ARG_CONSTANT;
-
-        /* TODO verify if const is allowed */
-        switch (arg->set) {
-            case 'I':                               break;
-            case 'S': flags |= PARROT_ARG_STRING;   break;
-            case 'N': flags |= PARROT_ARG_FLOATVAL; break;
-            case 'K':
-            case 'P': flags |= PARROT_ARG_PMC;      break;
-            default :                               break;
+        if (arg_flags[i] & VT_CALL_SIG) {
+            if ((n > 1 || i != 0) && !(n == 2 && strcmp(args[0]->name, "self") == 0))
+                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INTERNAL_PANIC,
+                    ":call_sig must be the first and only parameter besides self");
+            if (arg_flags[i] & (VT_FLAT | VT_OPTIONAL | VT_OPT_FLAG | VT_NAMED))
+                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INTERNAL_PANIC,
+                    ":call_sig cannot be combined with any other flags");
+            if (arg->set != 'P')
+                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INTERNAL_PANIC,
+                    ":call_sig must be a PMC");
+            flags |= PARROT_ARG_CALL_SIG;
+            flags |= PARROT_ARG_PMC;
         }
+        else {
+            if (arg_flags[i] & VT_FLAT)
+                flags |= PARROT_ARG_FLATTEN;
 
+            if (arg_flags[i] & VT_OPTIONAL)
+                flags |= PARROT_ARG_OPTIONAL;
+            else if (arg_flags[i] & VT_OPT_FLAG)
+                flags |= PARROT_ARG_OPT_FLAG;
+
+            if (arg_flags[i] & VT_NAMED)
+                flags |= PARROT_ARG_NAME;
+
+            /* add argument type bits */
+            if (arg->type & VTCONST)
+                flags |= PARROT_ARG_CONSTANT;
+
+            /* TODO verify if const is allowed */
+            switch (arg->set) {
+              case 'I':
+                break;
+              case 'S':
+                flags |= PARROT_ARG_STRING;
+                break;
+              case 'N':
+                flags |= PARROT_ARG_FLOATVAL;
+                break;
+              case 'K':
+              case 'P':
+                flags |= PARROT_ARG_PMC;
+                break;
+              default :
+                break;
+            }
+        }
 
         snprintf(s, sizeof (s), "0x%.4x,", flags);
         if (bufpos+lenitem >= bufsize)
@@ -783,7 +805,7 @@
 
             /* insert set_p_pc with the sub as constant */
             the_sub->set    = 'p';
-            the_sub->usage  = U_FIXUP;
+            the_sub->usage |= U_FIXUP;
             the_sub->type  &= ~VTADDRESS;
             the_sub->type  |= VTCONST;   /* preserve VT_ENCODED */
             regs[0]         = reg;

Modified: branches/orderedhash_revamp/compilers/imcc/reg_alloc.c
==============================================================================
--- branches/orderedhash_revamp/compilers/imcc/reg_alloc.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/imcc/reg_alloc.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -166,64 +166,64 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*unit);
 
-#define ASSERT_ARGS_allocate_lexicals __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_allocate_lexicals __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_allocate_non_volatile __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_allocate_non_volatile __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_allocate_uniq __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_allocate_uniq __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_build_interference_graph __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_build_interference_graph __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_build_reglist __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_compute_du_chain __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_compute_one_du_chain __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_build_reglist __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_compute_du_chain __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_compute_one_du_chain __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(r) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_first_avail __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_ig_allocate __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_ig_find_color __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_first_avail __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_ig_allocate __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_ig_find_color __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(avail)
-#define ASSERT_ARGS_ig_get_word __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(avail))
+#define ASSERT_ARGS_ig_get_word __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(graph) \
-    || PARROT_ASSERT_ARG(bit_ofs)
-#define ASSERT_ARGS_ig_set __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(graph)
-#define ASSERT_ARGS_imc_stat_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_interferes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(bit_ofs))
+#define ASSERT_ARGS_ig_set __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(graph))
+#define ASSERT_ARGS_imc_stat_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_interferes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(r0) \
-    || PARROT_ASSERT_ARG(r1)
-#define ASSERT_ARGS_make_stat __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_map_colors __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(r0) \
+    , PARROT_ASSERT_ARG(r1))
+#define ASSERT_ARGS_make_stat __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_map_colors __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(graph) \
-    || PARROT_ASSERT_ARG(avail)
-#define ASSERT_ARGS_print_stat __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(graph) \
+    , PARROT_ASSERT_ARG(avail))
+#define ASSERT_ARGS_print_stat __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_rebuild_reglist __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_reg_sort_f __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_rebuild_reglist __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_reg_sort_f __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(a) \
-    || PARROT_ASSERT_ARG(b)
-#define ASSERT_ARGS_sort_reglist __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_try_allocate __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(b))
+#define ASSERT_ARGS_sort_reglist __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_try_allocate __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_vanilla_reg_alloc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(unit)
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_vanilla_reg_alloc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(unit))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -394,7 +394,7 @@
     rebuild_reglist(unit);
 
     /*
-     * RT #57028 - graph coloring reg allocator ignores local_branch/local_return
+     * TT #1281 - graph coloring reg allocator ignores local_branch/local_return
     if (IMCC_INFO(interp)->allocator == IMCC_VANILLA_ALLOCATOR)
     */
         vanilla_reg_alloc(interp, unit);
@@ -725,7 +725,7 @@
 
     for (i = count = unused = 0; i < unit->n_symbols; i++) {
         SymReg * const r = unit->reglist[i];
-        char *p;
+        const char *p;
         int reg_set;
 
         if (r->color == -1)

Modified: branches/orderedhash_revamp/compilers/imcc/sets.h
==============================================================================
--- branches/orderedhash_revamp/compilers/imcc/sets.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/imcc/sets.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -7,8 +7,8 @@
 #define PARROT_IMCC_SETS_H_GUARD
 
 typedef struct _Set {
-   unsigned int   length;
-   unsigned char *bmp;
+    unsigned int   length;
+    unsigned char *bmp;
 } Set;
 
 /* HEADERIZER BEGIN: compilers/imcc/sets.c */
@@ -70,32 +70,32 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-#define ASSERT_ARGS_set_add __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_set_clear __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_set_contains __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_set_copy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_set_equal __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_set_add __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_set_clear __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_set_contains __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_set_copy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_set_equal __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(s1) \
-    || PARROT_ASSERT_ARG(s2)
-#define ASSERT_ARGS_set_first_zero __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_set_free __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_set_intersec __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(s2))
+#define ASSERT_ARGS_set_first_zero __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_set_free __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_set_intersec __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(s1) \
-    || PARROT_ASSERT_ARG(s2)
-#define ASSERT_ARGS_set_intersec_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(s2))
+#define ASSERT_ARGS_set_intersec_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(s1) \
-    || PARROT_ASSERT_ARG(s2)
-#define ASSERT_ARGS_set_make __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_set_make_full __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_set_union __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(s2))
+#define ASSERT_ARGS_set_make __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_set_make_full __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_set_union __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(s1) \
-    || PARROT_ASSERT_ARG(s2)
+    , PARROT_ASSERT_ARG(s2))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: compilers/imcc/sets.c */
 

Modified: branches/orderedhash_revamp/compilers/imcc/symreg.c
==============================================================================
--- branches/orderedhash_revamp/compilers/imcc/symreg.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/imcc/symreg.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -29,10 +29,6 @@
 
 #include "imc.h"
 
-/* Globals: */
-
-static Namespace * pesky_global__namespace;
-
 /* Code: */
 
 /* HEADERIZER HFILE: compilers/imcc/symreg.h */
@@ -103,29 +99,29 @@
         __attribute__nonnull__(1)
         FUNC_MODIFIES(*hsh);
 
-#define ASSERT_ARGS__get_sym_typed __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS__get_sym_typed __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(hsh) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS__mk_fullname __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS__mk_symreg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS__mk_fullname __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS__mk_symreg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(hsh) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_add_ns __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_add_ns __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_get_sym_by_name __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_get_sym_by_name __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(hsh) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_int_overflows __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_mk_pmc_const_2 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_int_overflows __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_mk_pmc_const_2 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit) \
-    || PARROT_ASSERT_ARG(left) \
-    || PARROT_ASSERT_ARG(rhs)
-#define ASSERT_ARGS_resize_symhash __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(hsh)
+    , PARROT_ASSERT_ARG(unit) \
+    , PARROT_ASSERT_ARG(left) \
+    , PARROT_ASSERT_ARG(rhs))
+#define ASSERT_ARGS_resize_symhash __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(hsh))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -140,14 +136,14 @@
 */
 
 void
-push_namespace(SHIM_INTERP, ARGIN(const char *name))
+push_namespace(PARROT_INTERP, ARGIN(const char *name))
 {
     ASSERT_ARGS(push_namespace)
     Namespace * const ns = mem_allocate_zeroed_typed(Namespace);
 
-    ns->parent = pesky_global__namespace;
+    ns->parent = IMCC_INFO(interp)->namespace_stack;
     ns->name   = mem_sys_strdup(name);
-    pesky_global__namespace = ns;
+    IMCC_INFO(interp)->namespace_stack = ns;
 }
 
 
@@ -166,7 +162,7 @@
 pop_namespace(PARROT_INTERP, ARGIN(const char *name))
 {
     ASSERT_ARGS(pop_namespace)
-    Namespace * const ns = pesky_global__namespace;
+    Namespace * const ns = IMCC_INFO(interp)->namespace_stack;
 
     if (!ns)
         IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR, "pop() on empty namespace stack\n");
@@ -181,7 +177,7 @@
         mem_sys_free(ident);
     }
 
-    pesky_global__namespace = ns->parent;
+    IMCC_INFO(interp)->namespace_stack = ns->parent;
     mem_sys_free(ns);
 }
 
@@ -340,6 +336,7 @@
     if (t & VT_FLAT)      { strcat(buf, "VT_FLAT ");       }
     if (t & VT_OPTIONAL)  { strcat(buf, "VT_OPTIONAL ");   }
     if (t & VT_NAMED)     { strcat(buf, "VT_NAMED ");      }
+    if (t & VT_CALL_SIG)  { strcat(buf, "VT_CALL_SIG ");   }
 
     strcat(buf, "]");
 
@@ -465,7 +462,7 @@
     sub->args[n]      = arg;
     sub->arg_flags[n] = arg->type;
 
-    arg->type &= ~(VT_FLAT|VT_OPTIONAL|VT_OPT_FLAG|VT_NAMED);
+    arg->type &= ~(VT_FLAT|VT_OPTIONAL|VT_OPT_FLAG|VT_NAMED|VT_CALL_SIG);
 
     sub->nargs++;
 }
@@ -640,23 +637,22 @@
 mk_ident(PARROT_INTERP, ARGIN(const char *name), int t)
 {
     ASSERT_ARGS(mk_ident)
-    char   * const fullname = _mk_fullname(pesky_global__namespace, name);
+    char   * const fullname = _mk_fullname(IMCC_INFO(interp)->namespace_stack, name);
     SymReg *r = get_sym_by_name(&(IMCC_INFO(interp)->last_unit->hash), name);
-    if (r && r->set != t) {
-        IMCC_print_inc(interp);
-        IMCC_warning(interp, "Duplicated IDENTIFIER '%s'\n", fullname);
-    }
+    if (r && r->set != t)
+        IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
+                "syntax error, duplicated IDENTIFIER '%s'\n", fullname);
 
     r = mk_symreg(interp, fullname, t);
     r->type = VTIDENTIFIER;
 
 
-    if (pesky_global__namespace) {
+    if (IMCC_INFO(interp)->namespace_stack) {
         Identifier * const ident = mem_allocate_zeroed_typed(Identifier);
 
         ident->name        = fullname;
-        ident->next        = pesky_global__namespace->idents;
-        pesky_global__namespace->idents = ident;
+        ident->next        = IMCC_INFO(interp)->namespace_stack->idents;
+        IMCC_INFO(interp)->namespace_stack->idents = ident;
     }
     else
         mem_sys_free(fullname);
@@ -734,14 +730,14 @@
     rhs->pmc_type = left->pmc_type;
 
     switch (rhs->pmc_type) {
-        case enum_class_Sub:
-        case enum_class_Coroutine:
-            r[1]       = rhs;
-            rhs->usage = U_FIXUP;
-            INS(interp, unit, "set_p_pc", "", r, 2, 0, 1);
-            return NULL;
-        default:
-            break;
+      case enum_class_Sub:
+      case enum_class_Coroutine:
+        r[1]        = rhs;
+        rhs->usage |= U_FIXUP;
+        INS(interp, unit, "set_p_pc", "", r, 2, 0, 1);
+        return NULL;
+      default:
+        break;
     }
 
     r[1] = rhs;
@@ -829,7 +825,9 @@
         r->type |= VT_ENCODED;
     }
 
-    /* autopromote big ints to floats; fallout from RT #53908 */
+    /* autopromote big ints to floats; fallout from
+     * http://rt.perl.org/rt3/Ticket/Display.html?id=53908
+     * */
     if (t == 'I') {
         if (int_overflows(r))
             r->set = 'N';
@@ -977,10 +975,19 @@
     SymReg *r;
 
     if (uniq == U_add_all) {
+        int is_lexical = 0;
+        r = get_sym_by_name(&IMCC_INFO(interp)->ghash, name);
+
+        if (r && r->usage & U_LEXICAL)
+            is_lexical = 1;
+
         r       = mem_allocate_zeroed_typed(SymReg);
         r->type = VTADDRESS;
         r->name = mem_sys_strdup(name);
         _store_symreg(hsh, r);
+
+        if (is_lexical)
+            r->usage |= U_LEXICAL;
     }
     else {
         /* Aux var to avoid the need of const casts */
@@ -1191,7 +1198,6 @@
     SymReg *key;
     SymReg *keychain;
     int     i;
-    int     any_slice = 0;
     size_t  len       = 0;
 
     /* namespace keys are global consts - no cur_unit */
@@ -1203,7 +1209,7 @@
         IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR, "link_keys: huh? no keys\n");
 
     /* short-circuit simple key unless we've been told not to */
-    if (nargs == 1 && !force && !(keys[0]->type & VT_SLICE_BITS))
+    if (nargs == 1 && !force)
         return keys[0];
 
     /* calc len of key_str
@@ -1211,13 +1217,8 @@
      * have the slice flag set */
     for (i = 0; i < nargs; i++) {
         len += 1 + strlen(keys[i]->name);
-        if (keys[i]->type & VT_SLICE_BITS)
-            any_slice = 1;
     }
 
-    if (any_slice && !(keys[0]->type & VT_SLICE_BITS))
-        keys[0]->type |= (VT_START_SLICE|VT_END_SLICE);
-
     key_str  = (char *)mem_sys_allocate(len);
     *key_str = '\0';
 
@@ -1229,7 +1230,7 @@
             strcat(key_str, ";");
     }
 
-    if (!any_slice && ((keychain = _get_sym(h, key_str)) != NULL)) {
+    if ((keychain = _get_sym(h, key_str)) != NULL) {
         mem_sys_free(key_str);
         return keychain;
     }
@@ -1552,7 +1553,7 @@
 {
     ASSERT_ARGS(find_sym)
     if (IMCC_INFO(interp)->cur_unit)
-        return _find_sym(interp, pesky_global__namespace,
+        return _find_sym(interp, IMCC_INFO(interp)->namespace_stack,
             &IMCC_INFO(interp)->cur_unit->hash, name);
 
     return NULL;

Modified: branches/orderedhash_revamp/compilers/imcc/symreg.h
==============================================================================
--- branches/orderedhash_revamp/compilers/imcc/symreg.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/imcc/symreg.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -21,15 +21,11 @@
     VT_FLAT         = VARTYPE_BIT(8),   /* var :flat */
     VT_OPTIONAL     = VARTYPE_BIT(9),   /* var :optional */
     /* include/parrot/packfile.h */
-    VT_START_SLICE  = PF_VT_START_SLICE, /* x .. y slice range */
-    VT_END_SLICE    = PF_VT_END_SLICE,
-    VT_START_ZERO   = PF_VT_START_ZERO, /* .. y 0..start */
-    VT_END_INF      = PF_VT_END_INF,    /* x..  start..inf */
-    VT_SLICE_BITS   = PF_VT_SLICE_BITS,
     VT_ENCODED      = VARTYPE_BIT(16),  /* unicode string constant */
     VT_OPT_FLAG     = VARTYPE_BIT(17),  /* var :opt_flag */
     VT_NAMED        = VARTYPE_BIT(18),  /* var :named(name) */
-    VT_UNIQUE_REG   = VARTYPE_BIT(19)
+    VT_UNIQUE_REG   = VARTYPE_BIT(19),
+    VT_CALL_SIG     = VARTYPE_BIT(20)
 };
 #undef VARTYPE_BIT
 
@@ -108,8 +104,6 @@
     Identifier *idents;
 };
 
-struct _IMC_Unit;
-
 /* functions */
 
 /* HEADERIZER BEGIN: compilers/imcc/symreg.c */
@@ -317,7 +311,8 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-void push_namespace(SHIM_INTERP, ARGIN(const char *name))
+void push_namespace(PARROT_INTERP, ARGIN(const char *name))
+        __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
 void store_symreg(PARROT_INTERP, ARGMOD(SymReg *r))
@@ -331,110 +326,111 @@
 char * symreg_to_str(ARGIN(const SymReg *s))
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS__find_sym __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS__find_sym __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(hsh) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS__get_sym __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(hsh) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS__get_sym __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(hsh) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS__mk_address __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS__mk_address __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(hsh) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS__mk_const __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(hsh) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS__mk_const __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(hsh) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS__store_symreg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS__store_symreg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(hsh) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_add_namespace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_add_namespace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_add_pcc_arg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(unit))
+#define ASSERT_ARGS_add_pcc_arg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(r) \
-    || PARROT_ASSERT_ARG(arg)
-#define ASSERT_ARGS_add_pcc_cc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(arg))
+#define ASSERT_ARGS_add_pcc_cc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(r) \
-    || PARROT_ASSERT_ARG(arg)
-#define ASSERT_ARGS_add_pcc_multi __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_add_pcc_result __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(arg))
+#define ASSERT_ARGS_add_pcc_multi __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_add_pcc_result __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(r) \
-    || PARROT_ASSERT_ARG(arg)
-#define ASSERT_ARGS_add_pcc_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(arg))
+#define ASSERT_ARGS_add_pcc_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(r) \
-    || PARROT_ASSERT_ARG(arg)
-#define ASSERT_ARGS_clear_globals __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_clear_locals __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_clear_sym_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(hsh)
-#define ASSERT_ARGS_create_symhash __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(hash)
-#define ASSERT_ARGS_debug_dump_sym_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(hsh)
-#define ASSERT_ARGS_dup_sym __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_find_sym __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_free_sym __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_get_sym __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_hash_str __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(str)
-#define ASSERT_ARGS_link_keys __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(keys)
-#define ASSERT_ARGS_mk_const __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_mk_const_ident __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(val)
-#define ASSERT_ARGS_mk_ident __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_mk_ident_ur __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_mk_label_address __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_mk_local_label __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_mk_pasm_reg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_mk_pcc_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_mk_sub_address __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_mk_sub_label __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_mk_symreg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_mk_temp_reg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_pop_namespace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_push_namespace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_store_symreg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_symreg_to_str __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(s)
+    , PARROT_ASSERT_ARG(arg))
+#define ASSERT_ARGS_clear_globals __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_clear_locals __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_clear_sym_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(hsh))
+#define ASSERT_ARGS_create_symhash __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(hash))
+#define ASSERT_ARGS_debug_dump_sym_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(hsh))
+#define ASSERT_ARGS_dup_sym __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_find_sym __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_free_sym __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_get_sym __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_hash_str __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(str))
+#define ASSERT_ARGS_link_keys __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(keys))
+#define ASSERT_ARGS_mk_const __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_mk_const_ident __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(val))
+#define ASSERT_ARGS_mk_ident __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_mk_ident_ur __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_mk_label_address __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_mk_local_label __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_mk_pasm_reg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_mk_pcc_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_mk_sub_address __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_mk_sub_label __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_mk_symreg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_mk_temp_reg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_pop_namespace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_push_namespace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_store_symreg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_symreg_to_str __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(s))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: compilers/imcc/symreg.c */
 

Modified: branches/orderedhash_revamp/compilers/imcc/unit.h
==============================================================================
--- branches/orderedhash_revamp/compilers/imcc/unit.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/imcc/unit.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -32,7 +32,7 @@
     int used_once;
 } ;
 
-struct _IMC_Unit {
+struct IMC_Unit {
     INTVAL            type;
     Instruction      *instructions;
     Instruction      *last_ins;
@@ -52,8 +52,8 @@
     SymReg          **reglist;
     unsigned int      n_symbols;
     int               max_color;
-    struct _IMC_Unit *prev;
-    struct _IMC_Unit *next;
+    IMC_Unit         *prev;
+    IMC_Unit         *next;
 
     SymReg           *_namespace;
     int               owns_namespace;   /* should this unit free *_namespace */

Modified: branches/orderedhash_revamp/compilers/json/JSON/pge2pir.tg
==============================================================================
--- branches/orderedhash_revamp/compilers/json/JSON/pge2pir.tg	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/json/JSON/pge2pir.tg	Sat Jan 23 01:49:53 2010	(r43541)
@@ -3,7 +3,7 @@
 transform result (ROOT) {
     .local pmc pir
     .local string result
- 
+
     $S0 = tree.'get'('pir', node, 'value')
 
     pir = new 'CodeString'
@@ -14,7 +14,7 @@
     pir.'emit'('.end')
 
    .return(pir)
-} 
+}
 
 transform pir (value) {
 
@@ -25,7 +25,7 @@
     type = 'string'
     sub_node = node[type]
     unless null sub_node goto got_type
-   
+
     type = 'number'
     sub_node = node[type]
     unless null sub_node goto got_type
@@ -84,7 +84,7 @@
     .local string result, child_result, key_result
     result = pir.'unique'('$P')
     pir.'emit'("    %0 = new 'Hash'", result)
-    
+
     .local pmc items
 
     items = node['members']
@@ -96,23 +96,23 @@
     keys  = items['string']
     items = items['value']
 
-    .local pmc iter, key_iter, child, key
-    key_iter = new 'Iterator', keys
-    iter     = new 'Iterator', items
+    .local pmc it, key_iter, child, key
+    key_iter = iter keys
+    it       = iter items
 
     # the two iters should be in lockstep as a result of the PGE grammar
 loop:
-    unless iter goto end
-    child = shift iter
+    unless it goto end
+    child = shift it
     $P0 = tree.'get'('pir', child, 'value')
     $S0 = $P0
-    pir .= $S0 
+    pir .= $S0
     child_result = child['ret']
 
     key   = shift key_iter
     $P0 = tree.'get'('pir', key, 'string')
     $S0 = $P0
-    pir .= $S0 
+    pir .= $S0
     key_result = key['ret']
 
     pir.'emit'('    %0[%1] = %2', result, key_result, child_result)
@@ -122,7 +122,7 @@
 end:
     node['ret'] = result
 
-   .return (pir) 
+   .return (pir)
 }
 
 transform pir (array) {
@@ -131,7 +131,7 @@
     .local string result, child_result
     result = pir.'unique'('$P')
     pir.'emit'("    %0 = new 'ResizablePMCArray'", result)
-    
+
     .local pmc items
 
 
@@ -140,14 +140,14 @@
 
     items = items['value']
 
-    .local pmc iter, child
-    iter = new 'Iterator', items
+    .local pmc it, child
+    it = iter items
 loop:
-    unless iter goto end
-    child = shift iter
+    unless it goto end
+    child = shift it
     $P0 = tree.'get'('pir', child, 'value')
     $S0 = $P0
-    pir .= $S0 
+    pir .= $S0
 
     child_result = child['ret']
     pir.'emit'('    push %0, %1', result, child_result)
@@ -155,20 +155,20 @@
 end:
     node['ret'] = result
 
-   .return (pir) 
+   .return (pir)
 }
 
 transform pir (string) {
-    .local pmc pir, result, children, iter, child
+    .local pmc pir, result, children, it, child
     .local string tmp
     tmp = ''
     pir = new 'CodeString'
     children = node['char']
     if null children goto loop_end
-    iter = new 'Iterator', children 
+    it = iter children
   loop:
     push_eh loop_end
-      child = shift iter
+      child = shift it
     pop_eh
     unless child goto loop_end
     $S0 = child
@@ -180,7 +180,7 @@
     $S1 = substr $S0, 2, 4
     $P1 = $S1
     $I0 = $P1.'to_int'(16)
-    $S0 = chr $I0 
+    $S0 = chr $I0
     goto char
   escape:
     $P0 = get_root_global [ 'JSON' ],  '$escapes'

Modified: branches/orderedhash_revamp/compilers/ncigen/NCIGENP6.pm
==============================================================================
--- branches/orderedhash_revamp/compilers/ncigen/NCIGENP6.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/ncigen/NCIGENP6.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -4,6 +4,8 @@
 # Copyright (C) 2008, Parrot Foundation.
 
 use v6;
+class NCIGENAST::FuncDecl {
+}
 
 evalfile('./ncigen.pbc', lang => 'Parrot');
 
@@ -12,9 +14,9 @@
 
     run("gcc -x c -E $fn > $pp_fn");
     my $compiler = compreg('NCIGEN');
-    my $ast = $compiler.parse(slurp($pp_fn));
+    my $match = $compiler.parse(slurp($pp_fn));
     unlink $pp_fn;
-    $ast.item();
+    $match.ast;
 }
 
 sub compreg {

Modified: branches/orderedhash_revamp/compilers/ncigen/src/NCIPIR.pir
==============================================================================
--- branches/orderedhash_revamp/compilers/ncigen/src/NCIPIR.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/ncigen/src/NCIPIR.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -134,14 +134,14 @@
 
 .sub 'pir_children' :method
     .param pmc node
-    .local pmc code, iter
+    .local pmc code, it
     code = new 'CodeString'
-    iter = new 'Iterator', node
+    it   = iter node
   iter_loop:
-    unless iter goto iter_end
+    unless it goto iter_end
     .local string key
     .local pmc cast
-    key = shift iter
+    key = shift it
     cast = node[key]
     $P0 = self.'pir'(cast)
     code .= $P0

Modified: branches/orderedhash_revamp/compilers/ncigen/src/builtins/say.pir
==============================================================================
--- branches/orderedhash_revamp/compilers/ncigen/src/builtins/say.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/ncigen/src/builtins/say.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -11,11 +11,11 @@
 
 .sub 'say'
     .param pmc args            :slurpy
-    .local pmc iter
-    iter = new 'Iterator', args
+    .local pmc it
+    it = iter args
   iter_loop:
-    unless iter goto iter_end
-    $P0 = shift iter
+    unless it goto iter_end
+    $P0 = shift it
     print $P0
     goto iter_loop
   iter_end:
@@ -26,10 +26,12 @@
 .sub 'printf'
     .param pmc format
     .param pmc args   :slurpy
-    .local pmc iter
-    iter = new 'Iterator', args
+    .local pmc it
+    it = iter args
   iter_loop:
-    unless iter goto iter_end
+    unless it goto iter_end
+    $P0 = shift it
+    print $P0
     goto iter_loop
   iter_end:
 .end

Modified: branches/orderedhash_revamp/compilers/ncigen/src/parser/actions.pm
==============================================================================
--- branches/orderedhash_revamp/compilers/ncigen/src/parser/actions.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/ncigen/src/parser/actions.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -44,20 +44,20 @@
 }
 
 method declaration($/) {
-    my $ast := NCIGENAST::VarDecl.new( :node($/) );
+    my $ast := NCIGENAST::VarDecl.new() ;
     my $type := "";
 
-    #say("=================================================================================================");
-    #_dumper($/);
+#    say("=================================================================================================");
+#    _dumper($/);
 #    make $decls;
 #    return 1;
     my $decl_specs := $<declaration_specifiers><repeatable_declaration_specifiers>;
     if typedef($decl_specs) {
-        $ast := NCIGENAST::TypeDef.new( :node($/) );
+        $ast := NCIGENAST::TypeDef.new( );
         $type := "TypeDef";
     }
     elsif $/<init_declarator><init_declarator><declarator><direct_declarator><declarator_suffix><declarator_suffix><parameter_type_list> {
-        $ast := NCIGENAST::FuncDecl.new( :node($/) );
+        $ast := NCIGENAST::FuncDecl.new( );
         $type := "FuncDecl";
     }
 #    elsif $<declaration_specifiers><type_specifier><type> {
@@ -65,7 +65,7 @@
 #        $type := "Struct";
 #    }
     else {
-        $ast := NCIGENAST::VarDecl.new( :node($/) );
+        $ast := NCIGENAST::VarDecl.new( );
         $type := "VarDecl";
     }
     parse_decl_specs( $<declaration_specifiers><repeatable_declaration_specifiers>, $ast );
@@ -81,7 +81,7 @@
         #assert(+$<init_declarator><declarator><direct_declarator><declarator_suffix>  == 1);
         my $params := $<init_declarator><declarator><declarator><direct_declarator><declarator_suffix><parameter_type_list><parameter_type_list><parameter_list><parameter_declaration>;
         for $params {
-            my $param := NCIGENAST::Param.new( :node( $_ ) );
+            my $param := NCIGENAST::Param.new( );
 
             settype($_<declaration_specifiers><type_specifier>, $param);
             my $param_ident := $_<declarator>;
@@ -183,12 +183,12 @@
         if $struct_or_union {
             my $ident := $<struct_or_union_specifier><identifier><identifier>;
             if $ident {
-                $ident := strip_spaces($ident.text());
+                $ident := strip_spaces(~$ident);
             }
             else {
                 $ident := $<struct_or_union_specifier><identifier>;
                 if $ident {
-                    $ident := strip_spaces($ident.text());
+                    $ident := strip_spaces(~$ident);
                 }
                 else {
                     $ident := "anonymous_" ~~ $struct_or_union~~ "1";
@@ -199,10 +199,10 @@
             if $s_or_u {
                 my $su;
                 if ($struct_or_union eq "struct" ) {
-                    $su := NCIGENAST::Struct.new( :node($/) );
+                    $su := NCIGENAST::Struct.new( );
                 }
                 else {
-                    $su := NCIGENAST::Union.new( :node($/) );
+                    $su := NCIGENAST::Union.new( );
                 }
                 $su.name($ident);
                 build_struct_or_union($s_or_u, $su);
@@ -227,12 +227,12 @@
 
 sub build_struct_or_union($/, $ast) {
     for $/ {
-        my $smt := NCIGENAST::VarDecl.new( :node($_) );
+        my $smt := NCIGENAST::VarDecl.new( );
         settype( $_<specifier_qualifier_list><type_specifier>, $smt );
         for $_<struct_declarator_list> {
             my $sm := $smt.clone();
             my $declarator := $_<struct_declarator><declarator>;
-            $sm.name(strip_spaces($declarator.text()));
+            $sm.name(strip_spaces(~$declarator));
             ispointer($declarator, $sm);
             $ast.push($sm);
         }

Modified: branches/orderedhash_revamp/compilers/nqp/src/Grammar.pg
==============================================================================
--- branches/orderedhash_revamp/compilers/nqp/src/Grammar.pg	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/nqp/src/Grammar.pg	Sat Jan 23 01:49:53 2010	(r43541)
@@ -215,7 +215,7 @@
 
 rule routine_def {
     $<declarator>=['sub'|'method']
-    <ident>
+    $<name>=[<ident>[':sym<'<-[>]>+'>']?]
     '(' <signature> ')'
     <block>
     {*}
@@ -301,6 +301,7 @@
 rule package_declarator {
     $<sym>=[module|class]
     <name>
+    [ 'is' <parent=name> ]?
     [
     || ';' <statement_block> {*}                           #= statement_block
     || <block> {*}                                         #= block

Modified: branches/orderedhash_revamp/compilers/nqp/src/Grammar/Actions.pir
==============================================================================
--- branches/orderedhash_revamp/compilers/nqp/src/Grammar/Actions.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/nqp/src/Grammar/Actions.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -103,11 +103,11 @@
     past = $P0.'new'('node'=>match)
     $P1 = match['statement']
     if null $P1 goto iter_end
-    .local pmc iter
-    iter = new 'Iterator', $P1
+    .local pmc it
+    it = iter $P1
   iter_loop:
-    unless iter goto iter_end
-    $P2 = shift iter
+    unless it goto iter_end
+    $P2 = shift it
     $P2 = $P2.'ast'()
     past.'push'($P2)
     goto iter_loop
@@ -152,10 +152,12 @@
     .param pmc match
     .local pmc expr, block, past
     .local int cond
+    .local pmc jmpstack
+    jmpstack = new 'ResizableIntegerArray'
     cond = match['EXPR']
     cond -= 1
-    bsr get_expr
-    bsr get_block
+    local_branch jmpstack, get_expr
+    local_branch jmpstack, get_block
     $P2 = get_hll_global ['PAST'], 'Op'
     past = $P2.'new'(expr, block, 'pasttype'=>'if', 'node'=>match)
 
@@ -169,8 +171,8 @@
   while:
     unless cond != 0 goto end_while
     cond -= 1
-    bsr get_expr
-    bsr get_block
+    local_branch jmpstack, get_expr
+    local_branch jmpstack, get_block
     past = $P2.'new'(expr, block, past, 'pasttype'=>'if', 'node'=>match)
     goto while
 
@@ -181,12 +183,12 @@
     expr = match['EXPR']
     expr = expr[cond]
     expr = expr.'ast'()
-    ret
+    local_return jmpstack
   get_block:
     block = match['block']
     block = block[cond]
     block = block.'ast'()
-    ret
+    local_return jmpstack
   end:
     match.'!make'(past)
 .end
@@ -370,7 +372,7 @@
 
 ##    method routine_def($/) {
 ##        my $past := $($<block>);
-##        $past.name(~$<ident>);
+##        $past.name(~$<name>);
 ##        $past.node($/);
 ##        $past.blocktype('declaration');
 ##        $past.control('return_pir');
@@ -392,7 +394,7 @@
     .local pmc past
     $P0 = match['block']
     past = $P0.'ast'()
-    $S0 = match['ident']
+    $S0 = match['name']
     past.'name'($S0)
     past.'node'(match)
     past.'blocktype'('declaration')
@@ -411,11 +413,11 @@
     $P0 = $P0[0]
     if null $P0 goto param_end
     unless $P0 goto param_end
-    .local pmc iter
-    iter = new 'Iterator', $P0
+    .local pmc it
+    it = iter $P0
   param_loop:
-    unless iter goto param_end
-    $P1 = shift iter
+    unless it goto param_end
+    $P1 = shift it
     .local pmc parameter
     $P2 = $P1['parameter']
     parameter = $P2.'ast'()
@@ -517,11 +519,11 @@
     past = $P0.'ast'()
     $P1 = match['postfix']
     if null $P1 goto end
-    .local pmc iter, term
-    iter = new 'Iterator', $P1
+    .local pmc it, term
+    it = iter $P1
   iter_loop:
-    unless iter goto end
-    $P2 = shift iter
+    unless it goto end
+    $P2 = shift it
     term = past
     past = $P2.'ast'()
     past.'unshift'(term)
@@ -794,7 +796,20 @@
 ##        $past.namespace($<name><ident>);
 ##        $past.blocktype('declaration');
 ##        $past.pirflags(':init :load');
-##        if ($<sym> eq 'class') { ...code to make class... }
+##        if ($<sym> eq 'class') {
+##            my $classpast :=
+##                PAST::Op.new(
+##                    ...P6metaclass...,
+##                    ~$<name>,
+##                    :pasttype('callmethod'), :name('new_class')
+##                );
+##            if $<parent> {
+##                $classpast.push(
+##                    PAST::Val.new( ~$<parent>[0] , :named('parent') )
+##                );
+##            }
+##            $past.push($classpast);
+##        }
 ##        make $past;
 ##    }
 .sub 'package_declarator' :method
@@ -811,22 +826,22 @@
     past.'lexical'(0)
     $S0 = match['sym']
     if $S0 != 'class' goto class_done
-    .local string inline
-    inline = <<'        INLINE'
-        $P0 = get_root_global ['parrot'], 'P6metaclass'
-        $P1 = split '::', '%s'
-        push_eh subclass_done
-        $P2 = $P0.'new_class'($P1)
-      subclass_done:
-        pop_eh
-        INLINE
-    $S0 = match['name']
-    $I0 = index inline, '%s'
-    substr inline, $I0, 2, $S0
+    .local pmc classvar, classop
+    $P0 = get_hll_global ['PAST'], 'Op'
+    classvar = $P0.'new'( 'inline'=>'%r = get_root_global ["parrot"], "P6metaclass"' )
     $P0 = get_hll_global ['PAST'], 'Op'
-    $P1 = $P0.'new'('inline'=>inline, 'pasttype'=>'inline')
+    $S0 = match['name']
+    classop = $P0.'new'( classvar, $S0, 'pasttype'=>'callmethod', 'name'=>'new_class')
     $P2 = past[0]
-    $P2.'push'($P1)
+    .local pmc parent
+    parent = match['parent']
+    if null parent goto parent_done
+    $S0 = parent[0]
+    $P0 = get_hll_global ['PAST'], 'Val'
+    $P1 = $P0.'new'( 'value'=>$S0, 'named'=>'parent' )
+    classop.'push'($P1)
+  parent_done:
+    $P2.'push'(classop)
   class_done:
     match.'!make'(past)
 .end
@@ -1038,11 +1053,11 @@
     past = $P0.'new'('node'=>match, 'name'=>name, 'opattr'=>opattr)
     $P1 = match.'list'()
     if null $P1 goto iter_end
-    .local pmc iter
-    iter = new 'Iterator', $P1
+    .local pmc it
+    it = iter $P1
   iter_loop:
-    unless iter goto iter_end
-    $P2 = shift iter
+    unless it goto iter_end
+    $P2 = shift it
     $I0 = $P2.'from'()
     $I1 = $P2.'to'()
     if $I0 == $I1 goto iter_loop

Modified: branches/orderedhash_revamp/compilers/nqp/src/builtins.pir
==============================================================================
--- branches/orderedhash_revamp/compilers/nqp/src/builtins.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/nqp/src/builtins.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -13,12 +13,12 @@
 
 .sub 'print'
     .param pmc list            :slurpy
-    .local pmc iter
+    .local pmc it
 
-    iter = new 'Iterator', list
+    it = iter list
   iter_loop:
-    unless iter goto iter_end
-    $P0 = shift iter
+    unless it goto iter_end
+    $P0 = shift it
     print $P0
     goto iter_loop
   iter_end:
@@ -129,6 +129,22 @@
     .return ()
 .end
 
+=item C<eval(lang,code)>
+
+=cut
+
+.sub 'eval'
+    .param string text
+    .param string lang
+    .local pmc c, code
+    lang = downcase lang
+    load_language lang
+    c = compreg lang
+    code = c.'compile'(text)
+    $P0 = code()
+    .return ($P0)
+.end
+
 =back
 
 =cut

Added: branches/orderedhash_revamp/compilers/nqp/t/30-subclass.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/compilers/nqp/t/30-subclass.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,34 @@
+#!./parrot nqp.pbc
+
+# class inheritance
+
+plan(6);
+
+class ABC {
+    method foo() {
+        say('ok 1');
+    }
+
+    method bar() {
+        say('ok 3');
+    }
+}
+
+class XYZ is ABC {
+    method foo() {
+        say('ok 2');
+    }
+}
+
+
+my $abc := ABC.new();
+my $xyz := XYZ.new();
+
+$abc.foo();
+$xyz.foo();
+$xyz.bar();
+my $xyzhow := $xyz.HOW;
+if $xyzhow.isa($xyz, ABC) { say('ok 4') }
+if $xyzhow.isa($xyz, XYZ) { say('ok 5') }
+say( $xyzhow.isa($abc, XYZ) ?? 'not ok 6' !! 'ok 6' );
+

Modified: branches/orderedhash_revamp/compilers/pct/src/PAST/Compiler.pir
==============================================================================
--- branches/orderedhash_revamp/compilers/pct/src/PAST/Compiler.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pct/src/PAST/Compiler.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -56,33 +56,63 @@
     ##  %piropsig is a table of common opcode signatures
     .local pmc piropsig
     piropsig = new 'Hash'
-    piropsig['isa']        = 'IP~'
-    piropsig['isfalse']    = 'IP'
-    piropsig['isnull']     = 'IP'
-    piropsig['issame']     = 'IPP'
-    piropsig['istrue']     = 'IP'
     piropsig['add']        = 'PP+'
     piropsig['band']       = 'PPP'
     piropsig['bxor']       = 'PPP'
     piropsig['bnot']       = 'PP'
     piropsig['bor']        = 'PPP'
+    piropsig['can']        = 'IPs'
+    piropsig['chr']        = 'Si'
+    piropsig['clone']      = 'PP'
     piropsig['concat']     = 'PP~'
+    piropsig['copy']       = '0PP'
+    piropsig['defined']    = 'IP'
+    piropsig['die']        = 'v~'
     piropsig['div']        = 'PP+'
+    piropsig['does']       = 'IPs'
+    piropsig['downcase']   = 'Ss'
+    piropsig['elements']   = 'IP'
+    piropsig['exit']       = 'vi'
     piropsig['fdiv']       = 'PP+'
-    piropsig['find_name']  = 'P~'
+    piropsig['find_name']  = 'Ps'
+    piropsig['find_dynamic_lex'] = 'Ps'
     piropsig['getprop']    = 'P~P'
+    piropsig['index']      = 'Issi'
+    piropsig['isa']        = 'IP~'
+    piropsig['isfalse']    = 'IP'
+    piropsig['isnull']     = 'IP'
+    piropsig['issame']     = 'IPP'
+    piropsig['istrue']     = 'IP'
+    piropsig['join']       = 'SsP'
+    piropsig['length']     = 'Is'
+    piropsig['load_bytecode'] = 'vs'
+    piropsig['load_language'] = 'vs'
     piropsig['mod']        = 'PP+'
     piropsig['mul']        = 'PP+'
     piropsig['neg']        = 'PP'
     piropsig['newclosure'] = 'PP'
     piropsig['not']        = 'PP'
+    piropsig['ord']        = 'Isi'
+    piropsig['pop']        = 'PP'
+    piropsig['push']       = '0P*'
+    piropsig['repeat']     = 'Ssi'
+    piropsig['shift']      = 'PP'
     piropsig['shl']        = 'PP+'
     piropsig['shr']        = 'PP+'
+    piropsig['splice']     = 'PPii'
+    piropsig['split']      = 'Pss'
     piropsig['sub']        = 'PP+'
+    piropsig['substr']     = 'Ssiis'
     piropsig['pow']        = 'NN+'
     piropsig['print']      = 'v*'
+    piropsig['say']        = 'v*'
     piropsig['set']        = 'PP'
     piropsig['setprop']    = '0P~P'
+    piropsig['setattribute'] = '0P~P'
+    piropsig['sleep']      = 'v+'
+    piropsig['trace']      = 'vi'
+    piropsig['unshift']    = '0P*'
+    piropsig['upcase']     = 'Ss'
     set_global '%piropsig', piropsig
 
     ##  %valflags specifies when PAST::Val nodes are allowed to
@@ -104,7 +134,7 @@
     $P0.'push'(.CONTROL_OK)
     $P0.'push'(.CONTROL_BREAK)
     $P0.'push'(.CONTROL_CONTINUE)
-    $P0.'push'(.CONTROL_ERROR)
+    #$P0.'push'(.CONTROL_ERROR)
     $P0.'push'(.CONTROL_TAKE)
     $P0.'push'(.CONTROL_LEAVE)
     $P0.'push'(.CONTROL_LOOP_NEXT)
@@ -112,15 +142,12 @@
     $P0.'push'(.CONTROL_LOOP_REDO)
     controltypes['CONTROL']   = $P0
     $P0 = new 'ResizablePMCArray'
-    $P0.'push'(.CONTROL_TAKE)
-    controltypes['GATHER']   = $P0
+    $P0.'push'(.CONTROL_RETURN)
+    controltypes['RETURN']   = $P0
     $P0 = new 'ResizablePMCArray'
     $P0.'push'(.CONTROL_OK)
     controltypes['OK'] = $P0
     $P0 = new 'ResizablePMCArray'
-    $P0.'push'(.CONTROL_LEAVE)
-    controltypes['LEAVE'] = $P0
-    $P0 = new 'ResizablePMCArray'
     $P0.'push'(.CONTROL_BREAK)
     controltypes['BREAK'] = $P0
     $P0 = new 'ResizablePMCArray'
@@ -130,6 +157,12 @@
     $P0.'push'(.CONTROL_ERROR)
     controltypes['ERROR'] = $P0
     $P0 = new 'ResizablePMCArray'
+    $P0.'push'(.CONTROL_TAKE)
+    controltypes['GATHER']   = $P0
+    $P0 = new 'ResizablePMCArray'
+    $P0.'push'(.CONTROL_LEAVE)
+    controltypes['LEAVE'] = $P0
+    $P0 = new 'ResizablePMCArray'
     $P0.'push'(.CONTROL_LOOP_NEXT)
     controltypes['NEXT'] = $P0
     $P0 = new 'ResizablePMCArray'
@@ -174,7 +207,7 @@
     set_global '@?BLOCK', blockpast
   have_blockpast:
     null $P0
-    set_global '$?SUB', $P0                                # see RT#49758
+    set_global '$?SUB', $P0
     .tailcall self.'as_post'(past, 'rtype'=>'v')
 .end
 
@@ -664,7 +697,7 @@
     .local string rtype
     rtype = options['rtype']
 
-    .local pmc iter, node, ops, pops, tail, skip
+    .local pmc it, node, ops, pops, tail, skip
     $P0 = get_hll_global ['POST'], 'Ops'
     ops = $P0.'new'('node'=>node)
     $P0 = get_hll_global ['POST'], 'Ops'
@@ -675,10 +708,10 @@
     $S0 = self.'unique'('skip_handler_')
     skip = $P0.'new'('result'=>$S0)
 
-    iter = new 'Iterator', ehs
+    it = iter ehs
   handler_loop:
-    unless iter, handler_loop_done
-    node = shift iter
+    unless it, handler_loop_done
+    node = shift it
 
     .local pmc ehpir, types, label
     .local string ehreg, type
@@ -748,18 +781,33 @@
     unshift blockpast, node
 
     .local string name, pirflags, blocktype
-    .local pmc subid, ns, hll
+    .local pmc nsentry, subid, ns, hll
     name = node.'name'()
     pirflags = node.'pirflags'()
     blocktype = node.'blocktype'()
+    nsentry = node.'nsentry'()
     subid = node.'subid'()
     ns = node.'namespace'()
     hll = node.'hll'()
 
+    ##  handle nsentry attribute
+    $I0 = defined nsentry
+    unless $I0 goto nsentry_done
+    unless nsentry goto nsentry_anon
+    $S0 = self.'escape'(nsentry)
+    pirflags = concat pirflags, ' :nsentry('
+    pirflags = concat pirflags, $S0
+    pirflags = concat pirflags, ')'
+    goto nsentry_done
+  nsentry_anon:
+    pirflags = concat pirflags, ' :anon'
+  nsentry_done:
+
     ##  handle anonymous blocks
     if name goto have_name
     name = self.'unique'('_block')
     if ns goto have_name
+    if nsentry goto have_name
     pirflags = concat pirflags, ' :anon'
   have_name:
 
@@ -826,14 +874,14 @@
     ##  merge the Block's symtable with outersym
     symtable = clone symtable
   symtable_merge:
-    .local pmc iter
-    iter = new 'Iterator', outersym
+    .local pmc it
+    it = iter outersym
   symtable_merge_loop:
-    unless iter goto have_symtable
-    $S0 = shift iter
+    unless it goto have_symtable
+    $S0 = shift it
     $I0 = exists symtable[$S0]
     if $I0 goto symtable_merge_loop
-    $P0 = iter[$S0]
+    $P0 = it[$S0]
     symtable[$S0] = $P0
     goto symtable_merge_loop
   have_symtable:
@@ -893,7 +941,6 @@
     $S0 = self.'uniquereg'('P')
     bpost.'push_pirop'('getattribute', $S0, 'exception', '"payload"')
     bpost.'push_pirop'('return', $S0)
-    bpost.'push_pirop'('rethrow', 'exception')
     goto sub_done
   control_past:
     $P0 = self.'as_post'(ctrlpast, 'rtype'=>'*')
@@ -988,6 +1035,8 @@
     unless $I0 goto have_lvalue
     $P0 = node[0]
     if null $P0 goto have_lvalue
+    $I1 = exists $P0['lvalue']
+    if $I1 goto have_lvalue
     $P0.'lvalue'($I0)
   have_lvalue:
 
@@ -1029,11 +1078,19 @@
     pirop = node.'pirop'()
     ##  see if pirop is of form "pirop signature"
     $I0 = index pirop, ' '
-    if $I0 < 0 goto pirop_1
+    if $I0 < 0 goto pirop_0
     $I1 = $I0 + 1
     signature = substr pirop, $I1
     pirop = substr pirop, 0, $I0
     goto have_signature
+  pirop_0:
+    ##  see if pirop is of form "pirop__signature"
+    $I0 = index pirop, '__'
+    if $I0 < 0 goto pirop_1
+    $I1 = $I0 + 2
+    signature = substr pirop, $I1
+    pirop = substr pirop, 0, $I0
+    goto have_signature
   pirop_1:
     $P0 = get_global '%piropsig'
     signature = $P0[pirop]
@@ -1187,11 +1244,13 @@
 
     exprpost = self.'as_post'(exprpast, 'rtype'=>exprrtype)
 
+    .local pmc jmpstack
+    jmpstack = new 'ResizableIntegerArray'
     childpast = thenpast
-    bsr make_childpost
+    local_branch jmpstack, make_childpost
     thenpost = childpost
     childpast = elsepast
-    bsr make_childpost
+    local_branch jmpstack, make_childpost
     elsepost = childpost
 
     if null elsepost goto no_elsepost
@@ -1241,7 +1300,7 @@
     unless result goto ret_childpost
     childpost = self.'coerce'(childpost, result)
   ret_childpost:
-    ret
+    local_return jmpstack
 .end
 
 .sub 'unless' :method :multi(_, ['PAST';'Op'])
@@ -1499,14 +1558,14 @@
     returns = box 'ResizablePMCArray'
   have_returns:
 
-    .local pmc listpost, iter
+    .local pmc listpost, it
     listpost = self.'as_vivipost'(returns, 'rtype'=>'P')
     ops.'result'(listpost)
     ops.'push'(listpost)
-    iter = new 'Iterator', posargs
+    it = iter posargs
   iter_loop:
-    unless iter goto iter_end
-    $S0 = shift iter
+    unless it goto iter_end
+    $S0 = shift it
     ops.'push_pirop'('push', listpost, $S0)
     goto iter_loop
   iter_end:
@@ -1832,8 +1891,7 @@
 
 =item copy(PAST::Op node)
 
-Implement a 'copy' assignment (at least until we get the 'copy'
-opcode -- see RT#47828).
+Implement a 'copy' assignment (at least until we get the 'copy' opcode).
 
 =cut
 
@@ -2002,7 +2060,12 @@
     .local pmc viviself, vivipost, vivilabel
     viviself = node.'viviself'()
     vivipost = self.'as_vivipost'(viviself, 'rtype'=>'P')
-    ops.'result'(vivipost)
+    .local string result
+    result = vivipost.'result'()
+    unless result == '' goto have_result
+    result = self.'uniquereg'('P')
+  have_result:
+    ops.'result'(result)
     ops.'push'(fetchop)
     unless viviself goto vivipost_done
     $P0 = get_hll_global ['POST'], 'Label'
@@ -2028,7 +2091,8 @@
     subpost = get_global '$?SUB'
 
     ##  determine lexical, register, and parameter names
-    .local string name, named, pname, has_pname
+    .local string named, pname, has_pname
+    .local pmc name
     name = node.'name'()
     named = node.'named'()
     pname = self.'unique'('param_')
@@ -2054,13 +2118,17 @@
     goto param_done
 
   param_required:
-    .local int slurpy
+    .local int call_sig, slurpy
+    call_sig = node.'call_sig'()
     slurpy = node.'slurpy'()
-    subpost.'add_param'(pname, 'named'=>named, 'slurpy'=>slurpy)
+    subpost.'add_param'(pname, 'named'=>named, 'slurpy'=>slurpy, 'call_sig'=>call_sig)
 
   param_done:
+    $I0 = defined name
+    unless $I0 goto param_lex_done
     name = self.'escape'(name)
     ops.'push_pirop'('.lex', name, ops)
+  param_lex_done:
     .return (ops)
 .end
 
@@ -2152,6 +2220,52 @@
 .end
 
 
+.sub 'contextual' :method :multi(_, ['PAST';'Var'])
+    .param pmc node
+    .param pmc bindpost
+    # If we've requested a contextual in a block that
+    # explicitly declares the variable as a different type,
+    # treat it as that type.
+    .local string name
+    name = node.'name'()
+    $P0 = get_global '@?BLOCK'
+    $P0 = $P0[0]
+    $P0 = $P0.'symtable'()
+    unless $P0 goto contextual
+    $P0 = $P0[name]
+    if null $P0 goto contextual
+    $S0 = $P0['scope']
+    unless $S0 goto contextual
+    if $S0 == 'contextual' goto contextual
+    .tailcall self.$S0(node, bindpost)
+
+  contextual:
+    # If this is a declaration, treat it like a normal lexical
+    .local int isdecl
+    isdecl = node.'isdecl'()
+    if isdecl goto contextual_lex
+
+    name = self.'escape'(name)
+    if bindpost goto contextual_bind
+
+  contextual_post:
+    .local pmc ops, fetchop, storeop
+    $P0 = get_hll_global ['POST'], 'Ops'
+    ops = $P0.'new'('node'=>node)
+    $P0 = get_hll_global ['POST'], 'Op'
+    fetchop = $P0.'new'(ops, name, 'pirop'=>'find_dynamic_lex')
+    storeop = $P0.'new'(name, ops, 'pirop'=>'store_dynamic_lex')
+    .tailcall self.'vivify'(node, ops, fetchop, storeop)
+
+  contextual_bind:
+    $P0 = get_hll_global ['POST'], 'Op'
+    .tailcall $P0.'new'(name, bindpost, 'pirop'=>'store_dynamic_lex', 'result'=>bindpost)
+
+  contextual_lex:
+    .tailcall self.'lexical'(node, bindpost)
+.end
+
+
 .sub 'keyed' :method :multi(_, ['PAST';'Var'])
     .param pmc node
     .param pmc bindpost
@@ -2251,8 +2365,9 @@
     .tailcall self.'vivify'(node, ops, fetchop, storeop)
 
   attribute_bind:
-    $P0 = get_hll_global ['POST'], 'Op'
-    .tailcall $P0.'new'(call_on, name, bindpost, 'pirop'=>'setattribute', 'result'=>bindpost)
+    ops.'push_pirop'('setattribute', call_on, name, bindpost)
+    ops.'result'(bindpost)
+    .return (ops)
 .end
 
 
@@ -2341,7 +2456,16 @@
     .local string rtype
     rtype = options['rtype']
     $I0 = index valflags, rtype
+    if $I0 < 0 goto result_convert
+    ops.'result'(value)
+    .return (ops)
+
+  result_convert:
+    # handle int-to-num conversion here
+    if rtype != 'n' goto result_pmc
+    $I0 = index valflags, 'i'
     if $I0 < 0 goto result_pmc
+    value = concat value, '.0'
     ops.'result'(value)
     .return (ops)
 

Modified: branches/orderedhash_revamp/compilers/pct/src/PAST/Node.pir
==============================================================================
--- branches/orderedhash_revamp/compilers/pct/src/PAST/Node.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pct/src/PAST/Node.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -241,6 +241,22 @@
 .end
 
 
+=item call_sig([flag])
+
+Get/set the node's C<call_sig> attribute (for parameter variables) to C<flag>.
+A true value of C<call_sig> indicates that the parameter variable given by this
+node is to be created as a C<:call_sig> parameter. If you use this, it should be
+the only parameter.
+
+=cut
+
+.sub 'call_sig' :method
+    .param pmc value           :optional
+    .param int has_value       :opt_flag
+    .tailcall self.'attr'('call_sig', value, has_value)
+.end
+
+
 =item viviself([type])
 
 If the variable needs to be instantiated, then C<type> indicates
@@ -430,7 +446,7 @@
     .param pmc hash
 
     $P0 = split ' ', "pasttype pirop inline lvalue"
-    $P1 = new 'Iterator', $P0
+    $P1 = iter $P0
   iter_loop:
     unless $P1 goto iter_end
     $S0 = shift $P1
@@ -553,6 +569,19 @@
 .end
 
 
+=item nsentry([nsentry])
+
+Get/set the C<nsentry> for this block.
+
+=cut
+
+.sub 'nsentry' :method
+    .param pmc value           :optional
+    .param int has_value       :opt_flag
+    .tailcall self.'attr'('nsentry', value, has_value)
+.end
+
+
 =item symbol(name [, attr1 => val1, attr2 => val2, ...])
 
 If called with named arguments, sets the symbol hash corresponding
@@ -690,8 +719,8 @@
     .local pmc suffix
     suffix = get_global '$!subid_suffix'
     unless null suffix goto have_suffix
-    $I0 = time
-    $S0 = $I0
+    $N0 = time
+    $S0 = $N0
     $S0 = concat '_', $S0
     suffix = box $S0
     set_global '$!subid_suffix', suffix

Modified: branches/orderedhash_revamp/compilers/pct/src/PCT/HLLCompiler.pir
==============================================================================
--- branches/orderedhash_revamp/compilers/pct/src/PCT/HLLCompiler.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pct/src/PCT/HLLCompiler.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -32,7 +32,7 @@
     $P0 = split ' ', 'parse past post pir evalpmc'
     setattribute self, '@stages', $P0
 
-    $P0 = split ' ', 'e=s help|h target=s dumper=s trace|t=s encoding=s output|o=s combine version|v'
+    $P0 = split ' ', 'e=s help|h target=s dumper=s trace|t=s encoding=s output|o=s combine version|v stagestats'
     setattribute self, '@cmdoptions', $P0
 
     $P1 = box <<'    USAGE'
@@ -41,11 +41,11 @@
   Options:
     USAGE
 
-    .local pmc iter
-    iter = new 'Iterator', $P0
+    .local pmc it
+    it = iter $P0
   options_loop:
-    unless iter goto options_end
-    $P3  = shift iter
+    unless it goto options_end
+    $P3  = shift it
     $P1 .= "    "
     $P1 .= $P3
     $P1 .= "\n"
@@ -193,15 +193,15 @@
 .sub 'removestage' :method
     .param string stagename
 
-    .local pmc stages, iter, newstages
+    .local pmc stages, it, newstages
     stages = getattribute self, '@stages'
     newstages = new 'ResizableStringArray'
 
-    iter = new 'Iterator', stages
+    it = iter stages
   iter_loop:
-    unless iter goto iter_end
+    unless it goto iter_end
     .local pmc current
-    current = shift iter
+    current = shift it
     if current == stagename goto iter_loop
       push newstages, current
     goto iter_loop
@@ -245,14 +245,14 @@
       target = adverbs['after']
 
   positional_insert:
-    .local pmc iter, newstages
+    .local pmc it, newstages
     newstages = new 'ResizableStringArray'
 
-    iter = new 'Iterator', stages
+    it = iter stages
   iter_loop:
-    unless iter goto iter_end
+    unless it goto iter_end
     .local pmc current
-    current = shift iter
+    current = shift it
     unless current == target goto no_insert_before
       unless position == 'before' goto no_insert_before
         push newstages, stagename
@@ -289,22 +289,46 @@
     .param pmc source
     .param pmc adverbs         :slurpy :named
 
+    .local pmc compiling, options
+    compiling = new ['Hash']
+    .lex '%*COMPILING', compiling
+    compiling['%?OPTIONS'] = adverbs
+
     .local string target
     target = adverbs['target']
     target = downcase target
 
-    .local pmc stages, result, iter
+    .local int stagestats
+    stagestats = adverbs['stagestats']
+
+    .local pmc stages, result, it
     result = source
     stages = getattribute self, '@stages'
-    iter = new 'Iterator', stages
+    it = iter stages
+    if stagestats goto stagestats_loop
+
   iter_loop:
-    unless iter goto iter_end
+    unless it goto have_result
     .local string stagename
-    stagename = shift iter
+    stagename = shift it
     result = self.stagename(result, adverbs :flat :named)
     if target == stagename goto have_result
     goto iter_loop
-  iter_end:
+
+  stagestats_loop:
+    unless it goto have_result
+    stagename = shift it
+    $N0 = time
+    result = self.stagename(result, adverbs :flat :named)
+    $N1 = time
+    $N2 = $N1 - $N0
+    printerr "Stage '"
+    printerr stagename
+    printerr "': "
+    printerr $N2
+    printerr " sec\n"
+    if target == stagename goto have_result
+    goto stagestats_loop
 
   have_result:
     .return (result)
@@ -387,7 +411,11 @@
     null action
     if target == 'parse' goto have_action
     parseactions = self.'parseactions'()
-    unless parseactions goto have_action
+    $I0 = isa parseactions, ['Undef']
+    if $I0 goto have_action
+    ##  if parseactions is a protoobject, use it directly
+    $I0 = isa parseactions, 'P6protoobject'
+    if $I0 goto action_exact
     ##  if parseactions is a Class or array, make action directly from that
     $I0 = isa parseactions, 'Class'
     if $I0 goto action_make
@@ -398,6 +426,7 @@
     ##  if parseactions is not a String, use it directly.
     $I0 = isa parseactions, 'String'
     if $I0 goto action_string
+  action_exact:
     action = parseactions
     goto have_action
   action_namespace:
@@ -543,6 +572,13 @@
     .local string target
     target = adverbs['target']
     if target != '' goto end
+    .local pmc outer_ctx, outer
+    outer_ctx = adverbs['outer_ctx']
+    if null outer_ctx goto outer_done
+    outer = outer_ctx['current_sub']
+    $P1 = $P0[0]
+    $P1.'set_outer'(outer)
+  outer_done:
     $I0 = adverbs['trace']
     trace $I0
     $P0 = $P0(args :flat)
@@ -690,13 +726,13 @@
   have_files_array:
     .local string code
     code = ''
-    .local pmc iter
-    iter = new 'Iterator', files
+    .local pmc it
+    it = iter files
   iter_loop:
-    unless iter goto iter_end
+    unless it goto iter_end
     .local string iname
     .local pmc ifh
-    iname = shift iter
+    iname = shift it
     ifh = new 'FileHandle'
     unless encoding == 'utf8' goto iter_loop_1
     ifh.'encoding'(encoding)
@@ -735,14 +771,14 @@
     .local string arg0
     arg0 = shift args
     .local pmc getopts
-    getopts = new 'Getopt::Obj'
+    getopts = new ['Getopt';'Obj']
     getopts.'notOptStop'(1)
     $P0 = getattribute self, '@cmdoptions'
-    .local pmc iter
-    iter = new 'Iterator', $P0
+    .local pmc it
+    it = iter $P0
   getopts_loop:
-    unless iter goto getopts_end
-    $S0 = shift iter
+    unless it goto getopts_end
+    $S0 = shift it
     push getopts, $S0
     goto getopts_loop
   getopts_end:
@@ -783,11 +819,11 @@
     opts = self.'process_args'(args)
 
     ##   merge command-line args with defaults passed in from caller
-    .local pmc iter
-    iter = new 'Iterator', opts
+    .local pmc it
+    it = iter opts
   mergeopts_loop:
-    unless iter goto mergeopts_end
-    $S0 = shift iter
+    unless it goto mergeopts_end
+    $S0 = shift it
     $P0 = opts[$S0]
     adverbs[$S0] = $P0
     goto mergeopts_loop

Modified: branches/orderedhash_revamp/compilers/pct/src/PCT/Node.pir
==============================================================================
--- branches/orderedhash_revamp/compilers/pct/src/PCT/Node.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pct/src/PCT/Node.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -57,20 +57,20 @@
     .param pmc children        :slurpy
     .param pmc adverbs         :slurpy :named
 
-    .local pmc iter
-    iter = new 'Iterator', children
+    .local pmc it
+    it = iter children
   children_loop:
-    unless iter goto children_end
-    $P0 = shift iter
+    unless it goto children_end
+    $P0 = shift it
     push self, $P0
     goto children_loop
   children_end:
 
-    iter = new 'Iterator', adverbs
+    it = iter adverbs
   adverbs_loop:
-    unless iter goto adverbs_end
-    $S0 = shift iter
-    $P0 = iter[$S0]
+    unless it goto adverbs_end
+    $S0 = shift it
+    $P0 = it[$S0]
     $P1 = find_method self, $S0
     self.$P1($P0)
     goto adverbs_loop
@@ -180,11 +180,10 @@
 =cut
 
 .sub 'iterator' :method
-    .local pmc iter
+    .local pmc it
     $P0 = self.'list'()
-    iter = new 'Iterator', $P0
-    iter = 0
-    .return (iter)
+    it = iter $P0
+    .return (it)
 .end
 
 
@@ -205,11 +204,16 @@
     if $I0 goto node_match
     $I0 = isa node, ['PCT';'Node']
     if $I0 goto node_pct
-    $S0 = typeof node
-    $S0 = concat "Don't know how to save info from node of type ", $S0
-    die $S0
-  node_match:
+  node_misc:
+    $I0 = can node, 'orig'
+    unless $I0 goto err_unknown
+    $I0 = can node, 'from'
+    unless $I0 goto err_unknown
     .local pmc source, pos
+    source = node.'orig'()
+    pos = node.'from'()
+    goto node_done
+  node_match:
     source = getattribute node, '$.target'
     pos    = node.'from'()
     goto node_done
@@ -220,6 +224,12 @@
     self['source'] = source
     self['pos']    = pos
   done:
+    .return ()
+
+  err_unknown:
+    $S0 = typeof node
+    $S0 = concat "Don't know how to save info from node of type ", $S0
+    die $S0
 .end
 
 

Modified: branches/orderedhash_revamp/compilers/pct/src/POST/Compiler.pir
==============================================================================
--- branches/orderedhash_revamp/compilers/pct/src/POST/Compiler.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pct/src/POST/Compiler.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -82,6 +82,8 @@
     pos = cpost['pos']
     if null pos goto done_subline
     source = cpost['source']
+    $I0 = can source, 'lineof'
+    unless $I0 goto done_subline
     line = source.'lineof'(pos)
     inc line
   done_subline:
@@ -100,7 +102,7 @@
 
 .sub 'pir' :method :multi(_,_)
     .param pmc node
-    .tailcall self.'pir_children'(node)
+    self.'pir_children'(node)
 .end
 
 
@@ -133,6 +135,7 @@
     if pirop == 'call' goto pirop_call
     if pirop == 'callmethod' goto pirop_callmethod
     if pirop == 'return' goto pirop_return
+    if pirop == 'yield' goto pirop_yield
     if pirop == 'tailcall' goto pirop_tailcall
     if pirop == 'inline' goto pirop_inline
 
@@ -156,6 +159,10 @@
     fmt = "    .return (%,)"
     goto pirop_emit
 
+  pirop_yield:
+    fmt = "    .yield (%,)"
+    goto pirop_emit
+
   pirop_tailcall:
     name = shift arglist
     fmt = '    .tailcall %n(%,)'
@@ -293,11 +300,11 @@
     .local pmc paramlist
     paramlist = node['paramlist']
     if null paramlist goto paramlist_done
-    .local pmc iter
-    iter = new 'Iterator', paramlist
+    .local pmc it
+    it = iter paramlist
   param_loop:
-    unless iter goto paramlist_done
-    $P0 = shift iter
+    unless it goto paramlist_done
+    $P0 = shift it
     if null $P0 goto param_loop
     subpir .= $P0
     goto param_loop

Modified: branches/orderedhash_revamp/compilers/pct/src/POST/Node.pir
==============================================================================
--- branches/orderedhash_revamp/compilers/pct/src/POST/Node.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pct/src/POST/Node.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -31,6 +31,7 @@
     $P0[4] = "    .param pmc %0 :named(%1)"
     $P0[5] = "    .param pmc %0 :optional :named(%1)\n    .param int has_%0 :opt_flag"
     $P0[6] = "    .param pmc %0 :slurpy :named"
+    $P0[8] = "    .param pmc %0 :call_sig"
     set_hll_global ['POST';'Sub'], '%!paramfmt', $P0
     .return ()
 .end
@@ -241,11 +242,12 @@
     .param pmc pname
     .param pmc adverbs         :slurpy :named
 
-    .local int optional, slurpy
+    .local int optional, slurpy, call_sig
     .local string named
     optional = adverbs['optional']
     slurpy = adverbs['slurpy']
     named = adverbs['named']
+    call_sig = adverbs['call_sig']
 
     .local int paramseq
     paramseq = isne optional, 0
@@ -255,6 +257,9 @@
     unless named goto named_done
     paramseq += 4
   named_done:
+    unless call_sig goto call_sig_done
+    paramseq += 8
+  call_sig_done:
 
     .local pmc paramlist
     paramlist = self['paramlist']

Modified: branches/orderedhash_revamp/compilers/pge/PGE/Exp.pir
==============================================================================
--- branches/orderedhash_revamp/compilers/pge/PGE/Exp.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pge/PGE/Exp.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -443,15 +443,15 @@
     .param string label
     .param string next
 
-    .local pmc iter, exp
+    .local pmc it, exp
     code.'emit'('        %0: # concat', label)
     $P0 = self.'list'()
-    iter = new 'Iterator', $P0
-    exp = shift iter
+    it  = iter $P0
+    exp = shift it
     $S0 = code.'unique'('R')
   iter_loop:
-    unless iter goto iter_end
-    $P1 = shift iter
+    unless it goto iter_end
+    $P1 = shift it
     $S1 = code.'unique'('R')
     exp.'pir'(code, $S0, $S1)
     exp = $P1
@@ -862,7 +862,7 @@
         %L_1:
           $P0 = find_name '%0'
           unless null $P0 goto %L_2
-          say "Unable to find regex '%0'"
+          die "Unable to find regex '%0'"
         %L_2:
         CODE
 

Modified: branches/orderedhash_revamp/compilers/pge/PGE/Match.pir
==============================================================================
--- branches/orderedhash_revamp/compilers/pge/PGE/Match.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pge/PGE/Match.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -243,7 +243,7 @@
 =cut
 
 .sub 'orig' :method
-    $P0 = getattribute self, '$!target'
+    $P0 = getattribute self, '$.target'
     .return ($P0)
 .end
 
@@ -278,36 +278,6 @@
 .end
 
 
-=item C<find_key([ key1, key2, ... ])>
-
-Find the first of C<key1>, C<key2>, etc. in the current
-Match object, and return it.  Returns '' if none of
-the specified keys are found.  If no keys are specified,
-then simply return the first key found.
-
-=cut
-
-.sub 'find_key' :method
-    .param pmc keys            :slurpy
-    if null keys goto first_key
-    unless keys goto first_key
-  loop:
-    unless keys goto not_found
-    $S0 = shift keys
-    $I0 = exists self[$S0]
-    unless $I0 goto loop
-    .return ($S0)
-  first_key:
-    $P0 = self.'hash'()
-    $P1 = new 'Iterator', $P0
-    unless $P1 goto not_found
-    $S0 = shift $P1
-    .return ($S0)
-  not_found:
-    .return ('')
-.end
-
-
 =item C<_failcut(int cutvalue)>
 
 Immediately "fail" this Match object, removing any

Modified: branches/orderedhash_revamp/compilers/pge/PGE/OPTable.pir
==============================================================================
--- branches/orderedhash_revamp/compilers/pge/PGE/OPTable.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pge/PGE/OPTable.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -52,7 +52,7 @@
     .return ()
 .end
 
-=item C<syncat(string name, adverbs :slurpy :named)>
+=item C<sctable(string name, adverbs :slurpy :named)>
 
 Adds (or replaces) a syntactic category's defaults.
 
@@ -110,7 +110,7 @@
     if $I0 goto end
     tokentable[name] = token
 
-    $P0 = new 'Iterator', args
+    $P0 = iter args
   args_loop:
     unless $P0 goto args_end
     $S1 = shift $P0
@@ -239,7 +239,7 @@
     .local pmc ws
     .local string key
     .local pmc token, top, oper
-    .local pmc iter
+    .local pmc it
     .local int tokencat, topcat
     .local int circumnest
     .local pmc cstack
@@ -367,10 +367,10 @@
     if oper goto oper_found
     goto key_next
   key_array:
-    iter = new 'Iterator', token
+    it = iter token
   key_array_1:
-    unless iter goto key_next
-    token = shift iter
+    unless it goto key_next
+    token = shift it
     local_branch cstack, token_match
     if_null oper, key_array_1
     if oper goto oper_found

Modified: branches/orderedhash_revamp/compilers/pge/PGE/Perl6Regex.pir
==============================================================================
--- branches/orderedhash_revamp/compilers/pge/PGE/Perl6Regex.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pge/PGE/Perl6Regex.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -526,7 +526,7 @@
 
     ##  if it's a word character, it may be negated
     isnegated = is_cclass .CCLASS_UPPERCASE, backchar, 0
-    ##  $S0 = downcase charlist   FIXME: RT #48108
+    ##  $S0 = downcase charlist
             $I0 = ord backchar
             $S0 = chr $I0
             backchar = downcase $S0
@@ -1667,14 +1667,14 @@
     .tailcall exp1.'perl6exp'(pad)
   with_lhs:
 
-    .local pmc lexscope, savescope, iter
+    .local pmc lexscope, savescope, it
     lexscope = pad['lexscope']
     savescope = new 'Hash'
-    iter = new 'Iterator', lexscope
+    it = iter lexscope
   iter_loop:
-    unless iter goto iter_end
-    $P1 = shift iter
-    $P2 = iter[$P1]
+    unless it goto iter_end
+    $P1 = shift it
+    $P2 = it[$P1]
     savescope[$P1] = $P2
     goto iter_loop
   iter_end:

Modified: branches/orderedhash_revamp/compilers/pge/README.pod
==============================================================================
--- branches/orderedhash_revamp/compilers/pge/README.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pge/README.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -118,8 +118,7 @@
 and reduction phases before being sent to code generation to
 produce a PIR subroutine.
 
-The generated PIR code uses bsr/ret for its internal backtracking
-(optimized for tailcalls) and uses Parrot calling conventions for
+The generated PIR code uses Parrot calling conventions for
 all interfaces with external callers/callees such as subrules.
 
 PGE also uses Parrot coroutines for the matching

Modified: branches/orderedhash_revamp/compilers/pge/STATUS
==============================================================================
--- branches/orderedhash_revamp/compilers/pge/STATUS	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pge/STATUS	Sat Jan 23 01:49:53 2010	(r43541)
@@ -13,9 +13,11 @@
 * capturing and non-capturing groups
 * modifiers :i, :ignorecase, :s, :sigspace (with synonyms :w and :words)
 * enumerated character lists (<[abcdef]>, <-[a..f]>)
+* composed character classes (<+alpha-[aeiou]>)
 * character classes (., \d, \w, \s, \n, \e, \f, \r, \t, \x[hhh], \o[nnn])
 * anchors (^, $, ^^, $$, \b, \b)
 * negated character classes 
+* \c[...] and \C[...]
 * capturing subrules (<expr>)
 * non-capturing subrules  (<.expr>)
 * negated subrules (<!expr>)
@@ -34,7 +36,6 @@
 
 Perl 6 rule features to-do
 --------------------------
-* rule composition (<+alpha-[aeiou]>)
 * lookbehind according to S05 definition 
 * <cut> assertion
 * versions of <commit> and cuts that release backtracking state
@@ -42,7 +43,6 @@
 * literal assertions (<'literal'>)
 * interpolated assertions (<"literal">)
 * array and hash aliasing (@<foo>:=(...), %<foo>:=(...))
-* \c[...] and \C[...]
 * don't generate unneeded internal data structures (e.g., gpad)
 
 

Modified: branches/orderedhash_revamp/compilers/pirc/heredoc/heredocmain.c
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/heredoc/heredocmain.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/heredoc/heredocmain.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,7 +5,6 @@
 
 #include <stdio.h>
 #include "parrot/parrot.h"
-#include "../new/pirheredoc.h"
 
 /*
 

Modified: branches/orderedhash_revamp/compilers/pirc/macro/macro.l
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/macro/macro.l	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/macro/macro.l	Sat Jan 23 01:49:53 2010	(r43541)
@@ -692,6 +692,13 @@
     return 0;
 }
 
+
+int
+main(int argc, char **argv) {
+    
+    return 0;   
+}
+
 /*
 
 =back

Modified: branches/orderedhash_revamp/compilers/pirc/macro/macroparser.c
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/macro/macroparser.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/macro/macroparser.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -156,7 +156,6 @@
 
 #include "lexer.h"
 
-#include "parrot/string_funcs.h"
 #include "parrot/parrot.h"
 
 

Modified: branches/orderedhash_revamp/compilers/pirc/src/bcgen.c
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/src/bcgen.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/src/bcgen.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -8,14 +8,14 @@
 
 #include "parrot/parrot.h"
 
-#include "parrot/interpreter.h"
-#include "../../../src/pmc/pmc_sub.h"
-#include "../../../src/pmc/pmc_namespace.h"
+#include "pmc/pmc_sub.h"
+#include "pmc/pmc_namespace.h"
 
 /* #include "parrot/embed.h" */
 
 #include "bcgen.h" /* XXX future maybe parrot/bcgen.h */
 
+
 /* HEADERIZER HFILE: compilers/pirc/src/bcgen.h */
 
 /* HEADERIZER BEGIN: static */
@@ -74,25 +74,25 @@
 static int new_pbc_const(ARGIN(bytecode * const bc))
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_add_string_const_from_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_add_string_const_from_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(bc) \
-    || PARROT_ASSERT_ARG(str)
-#define ASSERT_ARGS_check_requested_constant __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(bc)
-#define ASSERT_ARGS_create_lexinfo __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(str))
+#define ASSERT_ARGS_check_requested_constant __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(bc))
+#define ASSERT_ARGS_create_lexinfo __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(bc) \
-    || PARROT_ASSERT_ARG(sub)
-#define ASSERT_ARGS_create_sub_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(bc)
-#define ASSERT_ARGS_find_outer_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(sub))
+#define ASSERT_ARGS_create_sub_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(bc))
+#define ASSERT_ARGS_find_outer_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(bc) \
-    || PARROT_ASSERT_ARG(lexer)
-#define ASSERT_ARGS_generate_multi_signature __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(bc)
-#define ASSERT_ARGS_get_namespace_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(bc)
-#define ASSERT_ARGS_new_pbc_const __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(bc)
+    , PARROT_ASSERT_ARG(lexer))
+#define ASSERT_ARGS_generate_multi_signature __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(bc))
+#define ASSERT_ARGS_get_namespace_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(bc))
+#define ASSERT_ARGS_new_pbc_const __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(bc))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -481,7 +481,8 @@
 
     /* create segments */
     PARROT_ASSERT(filename != NULL);
-    interp->code = PF_create_default_segs(interp, filename, 1);
+    interp->code = PF_create_default_segs(interp, Parrot_str_new(interp, filename,
+                                                                 strlen(filename)), 1);
 
     /* add interpreter globals to bytecode. XXX Why is this? */
     self         = VTABLE_get_pmc_keyed_int(interp, interp->iglobals, IGLOBALS_INTERPRETER);
@@ -578,7 +579,10 @@
     bc->interp->code->annotations = (PackFile_Annotations*)
                                     PackFile_Segment_new_seg(bc->interp,
                                         bc->interp->code->base.dir,
-                                        PF_ANNOTATIONS_SEG, segment_name, 1);
+                                        PF_ANNOTATIONS_SEG,
+                                        Parrot_str_new(bc->interp, segment_name,
+                                            strlen(segment_name)),
+                                        1);
 
     bc->interp->code->annotations->code = bc->interp->code;
 
@@ -820,7 +824,11 @@
                 break;
             }
             case MULTI_TYPE_KEYED: {
-                /* XXX implement this */
+                /* XXX not sure if this is correct. Reuse the emit_pbc_key infrastructure
+                   for emitting key bytecode. Need to see whether this works...
+                 */
+                int index = emit_pbc_key(bc, types[i].entry.key);
+                sig_pmc   = bc->interp->code->const_table->constants[index]->u.key;
 
                 break;
             }
@@ -836,6 +844,115 @@
     return multi_signature;
 }
 
+/*
+
+=item C<int emit_pbc_key(bytecode * const bc, key * const k)>
+
+Emit bytecode for the key C<k>. First the bytecode is
+written to a temporary buffer, which is later unpacked
+in the actual PackFile. See C<store_key_bytecode()>.
+
+=cut
+
+*/
+int
+emit_pbc_key(ARGIN(bytecode * const bc), ARGIN(key * const k))
+{
+    ASSERT_ARGS(emit_pbc_key)
+    key_entry  *iter;
+    opcode_t   *key;
+    opcode_t    keysize;    /* total size of key in bytecode */
+    opcode_t   *pc;         /* cursor to write into key array */
+    expression *operand;
+    int         index;
+
+    /* create an array of opcode_t for storing the bytecode representation
+     * of the key. Initialize the cursor (pc) to write into this buffer.
+     * The size is 2 opcode_t's for each key plus 1 opcode_t for storing the size.
+     */
+    pc  =
+    key = (opcode_t *)mem_sys_allocate((k->keylength * 2 + 1) * sizeof (opcode_t));
+
+    /* store key length in slot 0 */
+    *pc++ = k->keylength;
+
+    /* initialize iterator */
+    iter  = k->head;
+
+    while (iter) {
+        switch (iter->expr->type) {
+          case EXPR_CONSTANT: {
+            constant *c = iter->expr->expr.c;
+            switch (c->type) {
+              case INT_VAL:
+                *pc++ = PARROT_ARG_IC;
+                *pc++ = c->val.ival;
+                break;
+              case STRING_VAL:
+                *pc++ = PARROT_ARG_SC;
+                *pc++ = add_string_const(bc, c->val.sval, "ascii");
+                break;
+              case USTRING_VAL:
+                *pc++ = PARROT_ARG_SC;
+                *pc++ = add_string_const(bc, c->val.ustr->contents,
+                                                c->val.ustr->charset);
+                break;
+              default:
+                fprintf(stderr, "wrong type of key");
+                break;
+            }
+
+            break;
+          }
+          case EXPR_TARGET: {
+            target *t = iter->expr->expr.t;
+
+            switch (t->info->type) {
+              case INT_TYPE:
+                *pc++ = PARROT_ARG_I;
+                *pc++ = t->info->color;
+                break;
+              case STRING_TYPE:
+                *pc++ = PARROT_ARG_S;
+                *pc++ = t->info->color;
+                break;
+              default:
+                fprintf(stderr, "wrong type of key");
+                break;
+            }
+            break;
+          }
+          case EXPR_KEY:
+            fprintf(stderr, "Nested keys are not supported.");
+            break;
+
+          default:
+            fprintf(stderr, "unknown expression type");
+            break;
+
+        }
+
+        iter = iter->next;
+    }
+
+    /* calculate size of key in bytecode; each field has 2 INTVALs:
+     * flags/types and the register/constant index.
+     */
+    keysize = pc - key;
+/*
+    fprintf(stderr, "key: ");
+    for (index = 0; index < keysize; ++index) {
+        fprintf(stderr, "%d|", key[index]);
+    }
+*/
+    /* store the key, and emit the index at which it's stored into the code segment */
+    index = store_key_bytecode(bc, key);
+    emit_int_arg(bc, index);
+
+    return index;
+
+}
+
 
 /*
 
@@ -873,7 +990,8 @@
                 *lexiter->color);
 
 
-        Parrot_PCCINVOKE(bc->interp, lex_info, method, "SI->", lexname, *lexiter->color);
+        Parrot_pcc_invoke_method_from_c_args(bc->interp, lex_info, method, "SI->", lexname,
+                                             *lexiter->color);
 
         lexiter = lexiter->next;
     }
@@ -910,8 +1028,9 @@
 {
     ASSERT_ARGS(find_outer_sub)
     PMC          *current;
-    Parrot_sub   *sub;
+    Parrot_Sub_attributes *sub;
     STRING       *cur_name;
+    STRING       *out_name;
     size_t        len;
     global_label *outersub;
 
@@ -959,8 +1078,8 @@
     PMC_get_sub(interp, current, sub);
     cur_name = sub->name;
 
-    /* XXX can't this be a call to Parrot_str_compare() ? */
-    if (cur_name->strlen == len && (memcmp((char *)cur_name->strstart, outername, len) == 0))
+    out_name = Parrot_str_new(interp, outername, len);
+    if (Parrot_str_compare(interp, cur_name, out_name) == 0)
         return current;
 
     return NULL;
@@ -1059,58 +1178,6 @@
     return pmc_new(bc->interp, type);
 }
 
-
-#if 0
-
-/*
-
-=item C<opcode_t * make_jit_info(PARROT_INTERP, const struct _IMC_Unit *unit)>
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-opcode_t *
-make_jit_info(PARROT_INTERP, ARGIN(const struct _IMC_Unit *unit))
-{
-    ASSERT_ARGS(make_jit_info)
-    const size_t old  = old_blocks(interp);
-    const size_t size = unit->n_basic_blocks + old;
-
-    if (!IMCC_INFO(interp)->globals->cs->jit_info) {
-        const size_t len  =
-            strlen(IMCC_INFO(interp)->globals->cs->seg->base.name) + 5;
-        char * const name = mem_allocate_n_typed(len, char);
-
-        snprintf(name, len, "%s_JIT",
-            IMCC_INFO(interp)->globals->cs->seg->base.name);
-
-        IMCC_INFO(interp)->globals->cs->jit_info =
-                PackFile_Segment_new_seg(interp,
-                    interp->code->base.dir, PF_UNKNOWN_SEG, name, 1);
-
-        mem_sys_free(name);
-    }
-
-    /* store current size */
-    IMCC_INFO(interp)->globals->cs->subs->n_basic_blocks = unit->n_basic_blocks;
-
-    /* offset of block start and end, 4 * registers_used */
-    IMCC_INFO(interp)->globals->cs->jit_info->data =
-        mem_realloc_n_typed(IMCC_INFO(interp)->globals->cs->jit_info->data,
-            size * 4, opcode_t);
-
-    IMCC_INFO(interp)->globals->cs->jit_info->size = size * 4;
-
-    return IMCC_INFO(interp)->globals->cs->jit_info->data + old * 4;
-}
-
-#endif /* HAS_JIT */
-
-
-
 /*
 
 =item C<int add_sub_pmc(bytecode * const bc, sub_info * const info, int needlex,
@@ -1131,7 +1198,7 @@
 {
     ASSERT_ARGS(add_sub_pmc)
     PMC                   *sub_pmc;        /* the "Sub" pmc, or a variant, such as "Coroutine" */
-    Parrot_sub            *sub;
+    Parrot_Sub_attributes *sub;
     int                    subconst_index; /* index in const table for the sub pmc */
     int                    subname_index;
     int                    i;              /* for loop iterator */

Modified: branches/orderedhash_revamp/compilers/pirc/src/bcgen.h
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/src/bcgen.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/src/bcgen.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -9,6 +9,7 @@
 #include "parrot/parrot.h"
 #include "parrot/embed.h"
 
+#include "pircompunit.h"
 
 /* the type name is exported, but not its private bits */
 struct bytecode;
@@ -35,7 +36,7 @@
 
     union multi_union {
         char const     *ident;
-        multi_key_type *key;
+        struct key     *key;
 
     } entry;
 
@@ -50,6 +51,7 @@
  */
 typedef struct lexical {
     char const     *name;     /* name of this lexical */
+    STRING         *name1;
     int            *color;    /* register assigned to the lexical */
     struct lexical *next;
 
@@ -61,11 +63,17 @@
  */
 typedef struct sub_info {
     char const    *subname;
+    STRING        *subname1;
     char const    *methodname;
+    STRING        *methodname1;
     char const    *nsentry;
+    STRING        *nsentry1;
     char const    *subid;
+    STRING        *subid1;
     char const    *outersub;
+    STRING        *outersub1;
     char const    *instanceof;
+    STRING        *instanceof1;
     int            vtable_index;
     unsigned       regs_used[4];
     int            startoffset;
@@ -79,7 +87,7 @@
 } sub_info;
 
 struct lexer_state;
-struct _IMC_Unit;
+
 
 /* HEADERIZER BEGIN: compilers/pirc/src/bcgen.c */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
@@ -165,12 +173,6 @@
 STRING * get_string_const(ARGIN(bytecode * const bc), unsigned index)
         __attribute__nonnull__(1);
 
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-opcode_t * make_jit_info(PARROT_INTERP, ARGIN(const struct _IMC_Unit *unit))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
 PARROT_CANNOT_RETURN_NULL
 bytecode * new_bytecode(PARROT_INTERP, ARGIN(char const * const filename))
         __attribute__nonnull__(1)
@@ -186,58 +188,58 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-#define ASSERT_ARGS_add_annotation __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(bc)
-#define ASSERT_ARGS_add_key_const __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_add_annotation __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(bc))
+#define ASSERT_ARGS_add_key_const __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(bc) \
-    || PARROT_ASSERT_ARG(key)
-#define ASSERT_ARGS_add_num_const __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(bc)
-#define ASSERT_ARGS_add_pmc_const __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(key))
+#define ASSERT_ARGS_add_num_const __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(bc))
+#define ASSERT_ARGS_add_pmc_const __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(bc) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_add_string_const __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_add_string_const __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(bc) \
-    || PARROT_ASSERT_ARG(str) \
-    || PARROT_ASSERT_ARG(charset)
-#define ASSERT_ARGS_add_sub_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(str) \
+    , PARROT_ASSERT_ARG(charset))
+#define ASSERT_ARGS_add_sub_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(bc) \
-    || PARROT_ASSERT_ARG(info) \
-    || PARROT_ASSERT_ARG(lexer)
-#define ASSERT_ARGS_create_annotations_segment __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(info) \
+    , PARROT_ASSERT_ARG(lexer))
+#define ASSERT_ARGS_create_annotations_segment __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(bc) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_create_codesegment __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(bc)
-#define ASSERT_ARGS_create_debugsegment __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_create_codesegment __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(bc))
+#define ASSERT_ARGS_create_debugsegment __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(bc) \
-    || PARROT_ASSERT_ARG(file)
-#define ASSERT_ARGS_destroy_bytecode __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(bc)
-#define ASSERT_ARGS_emit_debug_info __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(bc)
-#define ASSERT_ARGS_emit_int_arg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(bc)
-#define ASSERT_ARGS_emit_opcode __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(bc)
-#define ASSERT_ARGS_get_num_const __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(bc)
-#define ASSERT_ARGS_get_pmc_const __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(bc)
-#define ASSERT_ARGS_get_string_const __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(bc)
-#define ASSERT_ARGS_make_jit_info __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(unit)
-#define ASSERT_ARGS_new_bytecode __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(file))
+#define ASSERT_ARGS_destroy_bytecode __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(bc))
+#define ASSERT_ARGS_emit_debug_info __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(bc))
+#define ASSERT_ARGS_emit_int_arg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(bc))
+#define ASSERT_ARGS_emit_opcode __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(bc))
+#define ASSERT_ARGS_emit_pbc_key __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(bc) \
+    , PARROT_ASSERT_ARG(k))
+#define ASSERT_ARGS_get_num_const __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(bc))
+#define ASSERT_ARGS_get_pmc_const __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(bc))
+#define ASSERT_ARGS_get_string_const __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(bc))
+#define ASSERT_ARGS_new_bytecode __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filename)
-#define ASSERT_ARGS_store_key_bytecode __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(filename))
+#define ASSERT_ARGS_store_key_bytecode __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(bc) \
-    || PARROT_ASSERT_ARG(key)
-#define ASSERT_ARGS_write_pbc_file __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(key))
+#define ASSERT_ARGS_write_pbc_file __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(bc) \
-    || PARROT_ASSERT_ARG(filename)
+    , PARROT_ASSERT_ARG(filename))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: compilers/pirc/src/bcgen.c */
 
@@ -283,6 +285,7 @@
 
 STRING *get_string_const(bytecode * const bc, unsigned index);
 
+int emit_pbc_key(bytecode * const bc, struct key * const k);
 
 /*
 

Modified: branches/orderedhash_revamp/compilers/pirc/src/hdocprep.c
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/src/hdocprep.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/src/hdocprep.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -685,7 +685,6 @@
 #include <stdlib.h>
 #include <stdarg.h>
 #include "parrot/parrot.h"
-#include "parrot/string_funcs.h"
 #include "parrot/embed.h"
 #include "pirheredoc.h"
 

Modified: branches/orderedhash_revamp/compilers/pirc/src/hdocprep.l
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/src/hdocprep.l	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/src/hdocprep.l	Sat Jan 23 01:49:53 2010	(r43541)
@@ -47,7 +47,6 @@
 #include <stdlib.h>
 #include <stdarg.h>
 #include "parrot/parrot.h"
-#include "parrot/string_funcs.h"
 #include "parrot/embed.h"
 #include "pirheredoc.h"
 

Modified: branches/orderedhash_revamp/compilers/pirc/src/main.c
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/src/main.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/src/main.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -15,7 +15,6 @@
 #include "pirlexer.h"
 #include "pirheredoc.h"
 #include "pirregalloc.h"
-#include "piremit.h"
 #include "pircapi.h"
 
 /* global variable to set parser in debug mode.
@@ -153,7 +152,6 @@
     /* runs :init functions */
     PackFile_fixup_subs(interp, PBC_MAIN, NULL);
 
-    /* RT#46149 no return value :-( */
     Parrot_runcode(interp, argc, argv);
 }
 

Modified: branches/orderedhash_revamp/compilers/pirc/src/pir.l
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/src/pir.l	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/src/pir.l	Sat Jan 23 01:49:53 2010	(r43541)
@@ -416,11 +416,23 @@
                     char *str = Parrot_str_to_cstring(lexer->interp, pstr);
 
                     yylval->sval = str;
+                    
+                    /* store the STRING in lexer's sval buffer; once PIRC is doing
+                    only STRINGs, it can be stored in yylval.sval. */
+                    lexer->sval = pstr;
+                    
                     return TK_STRINGC;
                   }
 
 {SQ_STRING}       { /* copy the string, remove the quotes. */
-                    yylval->sval = dupstrn(yyget_extra(yyscanner), yytext + 1, yyleng - 2);
+                    lexer_state * const lexer = yyget_extra(yyscanner);
+                    
+                    STRING *str = Parrot_str_unescape(lexer->interp, yytext + 1, '\'', "ascii");
+                    lexer->sval = str;
+                    
+                    yylval->sval = dupstrn(lexer, yytext + 1, yyleng - 2);
+
+                    
                     return TK_STRINGC;
                   }
 
@@ -507,6 +519,10 @@
 "$I"{DIGIT}+      { yylval->ival = atoi(yytext + 2); return TK_IREG; }
 
 {IDENT}":"        { /* make the label Id available in the parser. remove the ":" first. */
+                    lexer_state * const lexer = yyget_extra(yyscanner);
+                    STRING *str = Parrot_str_new(lexer->interp, yytext, yyleng - 1);
+                    lexer->sval = str;
+                    
                     yylval->sval = dupstrn(yyget_extra(yyscanner), yytext, yyleng - 1);
                     return TK_LABEL;
                   }
@@ -527,7 +543,7 @@
                     lexer_state * const lexer = yyget_extra(yyscanner);
                     constdecl   * const c = find_global_constant(lexer, yytext);
 
-                    if (c) {
+                    if (c) { /* it's  a global const */
                         switch (c->type) {
                             case INT_VAL:
                                 yylval->ival = c->val.ival;
@@ -546,7 +562,8 @@
                                 break;
                         }
                     }
-
+                    lexer->sval = Parrot_str_new(lexer->interp, yytext, yyleng);
+                    					
                     yylval->sval = dupstr(lexer, yytext);
                     return TK_IDENT;
                   }

Modified: branches/orderedhash_revamp/compilers/pirc/src/pir.y
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/src/pir.y	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/src/pir.y	Sat Jan 23 01:49:53 2010	(r43541)
@@ -250,6 +250,7 @@
     struct symbol      *symb;
     struct macro_def   *mval;
     struct macro_param *pval;
+
 }
 
 
@@ -638,7 +639,7 @@
                   | macro_statements macro_statement
                   ;
 
-macro_statement   : macro_instr "\n"
+macro_statement   : macro_instr newline
                   ;
 
 macro_instr       : macro_label_decl
@@ -707,7 +708,7 @@
                   ;
 
 sub_head          : ".sub" sub_id
-                         { new_subr(lexer, $2); }
+                         { new_subr(lexer, lexer->sval /*$2*/); }
                   ;
 
 sub_id            : identifier
@@ -1695,7 +1696,7 @@
                            { $$ = invoke(lexer, CALL_PCC, $2, $3); }
                      | ".nci_call" pmc_object
                            { $$ = invoke(lexer, CALL_NCI, $2); }
-                     | ".invocant" pmc_object "\n"
+                     | ".invocant" pmc_object newline
                        ".meth_call" method
                            { $$ = invoke(lexer, CALL_METHOD, $2, $5); }
                      ;
@@ -2199,7 +2200,7 @@
  * not allowed, so we don't have any name collisions.
  */
 pasm_init                 : opt_nl
-                                { new_subr(lexer, "@start"); }
+                                { new_subr(lexer, Parrot_str_new(lexer->interp, "@start", 6)); }
                           ;
 
 pasm_lines                : pasm_line
@@ -2207,10 +2208,10 @@
                           ;
 
 pasm_line                 : pasm_statement
-                          | namespace_decl "\n"
+                          | namespace_decl newline
                           | lex_decl                /* lex_decl rule has already a "\n" token */
-                          | location_directive "\n"
-                          | macro_definition "\n"
+                          | location_directive newline
+                          | macro_definition newline
                           | macro_expansion
                           ;
 
@@ -2233,7 +2234,7 @@
                                                               hence NULL */
                           ;
 
-pasm_instruction          : parrot_op op_args "\n"
+pasm_instruction          : parrot_op op_args newline
                                 {
 
                                   if (is_parrot_op(lexer, $1)) {

Modified: branches/orderedhash_revamp/compilers/pirc/src/pircapi.c
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/src/pircapi.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/src/pircapi.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -196,7 +196,7 @@
 
     snprintf(name, sizeof (name), "EVAL_" INTVAL_FMT, eval_number);
 
-    new_cs = PF_create_default_segs(interp, name, 0);
+    new_cs = PF_create_default_segs(interp, Parrot_str_new(interp, name, strlen(name)), 0);
     old_cs = Parrot_switch_to_cs(interp, new_cs, 0);
 
     /* create a yyscan_t object */
@@ -248,7 +248,7 @@
     /* clean up after playing */
     release_resources(lexer);
 
-       /* clean up after playing */
+    /* clean up after playing */
     yypirlex_destroy(yyscanner);
 
 

Modified: branches/orderedhash_revamp/compilers/pirc/src/pircapi.h
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/src/pircapi.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/src/pircapi.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -44,17 +44,17 @@
     SHIM(const char *filename),
     SHIM(STRING **error_message));
 
-#define ASSERT_ARGS_open_file __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_open_file __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(filename) \
-    || PARROT_ASSERT_ARG(mode)
-#define ASSERT_ARGS_parse_file __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(mode))
+#define ASSERT_ARGS_parse_file __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(infile) \
-    || PARROT_ASSERT_ARG(filename)
-#define ASSERT_ARGS_parse_string __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(infile) \
+    , PARROT_ASSERT_ARG(filename))
+#define ASSERT_ARGS_parse_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pirstring)
-#define ASSERT_ARGS_pirc_compile_file __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
+    , PARROT_ASSERT_ARG(pirstring))
+#define ASSERT_ARGS_pirc_compile_file __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: compilers/pirc/src/pircapi.c */
 

Modified: branches/orderedhash_revamp/compilers/pirc/src/pircompiler.h
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/src/pircompiler.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/src/pircompiler.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -146,6 +146,12 @@
 
     annotation               *annotations;
     unsigned                  num_annotations;
+    
+    /* XXX Temporary STRING pointer, for the conversion of all lexer code to use
+    STRINGs instead of c strings (char pointers). Cannot change yylval union yet,
+    as it's better to have duplicated functionality, then removing the old c strings 
+    stuff*/
+    STRING    *sval;
 
 } lexer_state;
 

Modified: branches/orderedhash_revamp/compilers/pirc/src/pircompunit.c
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/src/pircompunit.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/src/pircompunit.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -42,6 +42,7 @@
 #include "parrot/oplib/ops.h"
 #include "parrot/string_funcs.h"
 #include "parrot/dynext.h"
+#include "pmc/pmc_callcontext.h"
 
 
 static unsigned const prime_numbers[] = {113 /* XXX think of more primes */ };
@@ -137,15 +138,15 @@
 
         switch (multitype->type) {
             case EXPR_CONSTANT:
-                mtype->entry.ident    = multitype->expr.c->val.sval;
-                mtype->entry_type = MULTI_TYPE_IDENT;
+                mtype->entry.ident = multitype->expr.c->val.sval;
+                mtype->entry_type  = MULTI_TYPE_IDENT;
                 break;
             case EXPR_IDENT:
-                mtype->entry.ident    = multitype->expr.id;
-                mtype->entry_type = MULTI_TYPE_IDENT;
+                mtype->entry.ident = multitype->expr.id;
+                mtype->entry_type  = MULTI_TYPE_IDENT;
                 break;
             case EXPR_KEY:
-                /* mtype->u.key      = XXX todo */
+                mtype->entry.key  = multitype->expr.k;
                 mtype->entry_type = MULTI_TYPE_KEYED;
                 break;
             default:
@@ -256,7 +257,7 @@
         CURRENT_SUB(lexer)->methodname = methodname;
     else /* :method without a value defaults to the subname. */
         CURRENT_SUB(lexer)->methodname = CURRENT_SUB(lexer)->info.subname;
-    
+
     CURRENT_SUB(lexer)->info.methodname = CURRENT_SUB(lexer)->methodname;
 
     /* :methods have an automatic "self" parameter */
@@ -328,14 +329,16 @@
 
 */
 void
-new_subr(lexer_state * const lexer, char const * const subname) {
+new_subr(lexer_state * const lexer, STRING *subname) {
     subroutine *newsub       = pir_mem_allocate_zeroed_typed(lexer, subroutine);
     int         index;
 
     /* set the sub fields */
-    newsub->info.subname     = subname;
+    newsub->info.subname1    = subname;
+    newsub->info.subname     = Parrot_str_to_cstring(lexer->interp, subname);
     /* set default lexid */
-    newsub->info.subid       = subname;
+    newsub->info.subid1      = subname;
+    newsub->info.subid       = Parrot_str_to_cstring(lexer->interp, subname);
     /* take namespace of this sub of the lexer, which keeps track of that */
     newsub->name_space       = lexer->current_ns;
 
@@ -368,7 +371,7 @@
     CURRENT_SUB(lexer) = newsub;
 
     /* store the subroutine identifier as a global label */
-    store_global_label(lexer, subname);
+    store_global_label(lexer, Parrot_str_to_cstring(lexer->interp, subname));
 
     /* vanilla register allocator is reset for each sub */
     reset_register_allocator(lexer);
@@ -701,7 +704,15 @@
 target *
 set_param_alias(lexer_state * const lexer, char const * const alias) {
     PARROT_ASSERT(lexer->curtarget != NULL);
-    lexer->curtarget->alias = alias;
+
+    /* if no alias was specified, default to the target's name, if it's not a register. */
+    if (alias == NULL) {
+        if (!TEST_FLAG(lexer->curtarget->flags, TARGET_FLAG_IS_REG))
+            lexer->curtarget->alias = lexer->curtarget->info->id.name;
+    }
+    else
+        lexer->curtarget->alias = alias;
+
     SET_FLAG(lexer->curtarget->flags, TARGET_FLAG_NAMED);
     return lexer->curtarget;
 }
@@ -1970,16 +1981,28 @@
 */
 void
 set_lex_flag(lexer_state * const lexer, target * const t, char const * const name) {
-    lexical *lex = (lexical *)pir_mem_allocate(lexer, sizeof (lexical));
-    lex->name    = name;
+    lexical *lex = CURRENT_SUB(lexer)->info.lexicals;
+
+    /* check whether there is already a target marked as .lex with the specified name */
+    while (lex != NULL) {
+        if (STREQ(lex->name, name)) {
+            yypirerror(lexer->yyscanner, lexer, "lexical '%s' was already declared", name);
+            /* abort immediately */
+            return;
+        }
+        lex = lex->next;
+    }
+
+    lex        = (lexical *)pir_mem_allocate(lexer, sizeof (lexical));
+    lex->name  = name;
 
     /* get a pointer to the "color" field, so that the lexical struct knows
      * the assigned PASM register.
      */
-    lex->color   = &t->info->color;
+    lex->color = &t->info->color;
 
     /* link this lex node in the list of lexicals at the front; order doesn't matter. */
-    lex->next = CURRENT_SUB(lexer)->info.lexicals;
+    lex->next  = CURRENT_SUB(lexer)->info.lexicals;
     CURRENT_SUB(lexer)->info.lexicals = lex;
 }
 
@@ -2088,6 +2111,17 @@
 }
 
 
+/*
+
+=item C<static key_entry * new_key_entry>
+
+Constructor for a key_entry node. Memory is allocated for the node,
+and the C<expr> field is initialized to the passed in C<expr> value.
+The newly constructed node is returned.
+
+=cut
+
+*/
 static key_entry *
 new_key_entry(lexer_state * const lexer, expression * const expr) {
     key_entry *entry = pir_mem_allocate_zeroed_typed(lexer, key_entry);
@@ -2476,7 +2510,6 @@
             case PARROT_OP_end:
             case PARROT_OP_returncc:
             case PARROT_OP_yield:
-            case PARROT_OP_ret:
             case PARROT_OP_branch_ic:
             case PARROT_OP_exit_ic:
                 need_epilogue = 0;

Modified: branches/orderedhash_revamp/compilers/pirc/src/pircompunit.h
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/src/pircompunit.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/src/pircompunit.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -160,10 +160,11 @@
 
 /* represent a .const or .globalconst declaration */
 typedef struct constdecl {
-    char const   *name;
-    int           global;
-    value_type    type;
-    value         val;
+    char const   *name;         /* name of the .const/.globalconst */
+    STRING       *name1;
+    int           global;       /* flag to indicate whether it's a .globalconst or .const */
+    value_type    type;         /* selector for the value union "val" */
+    value         val;          /* the value of this .const/.globalconst */
 
 } constdecl;
 
@@ -176,10 +177,19 @@
 
 } constant;
 
-/* for representing a label operand */
+/* for representing a label operand, as used in the following example:
+  
+  if x > y goto L1
+  
+  L1 is here the label operand, and the "goto L1" part of the above statement
+  will be represented by some offset.
+
+*/
 typedef struct label {
-    int         offset;
-    char const *name;
+    int         offset;        /* the offset that is used as the operand. */
+    char const *name;          /* name of the label that is 
+                                  (perhaps conditionally) being jumped to */
+    STRING     *name1;                                  
 
 } label;
 
@@ -198,6 +208,7 @@
         struct target  *t;
         constant       *c;
         char const     *id;
+        STRING         *id1;
         struct key     *k;
         struct label   *l;
 
@@ -223,7 +234,7 @@
  * by which to pass the key.
  */
 typedef struct key {
-    key_entry *head;
+    key_entry *head;      /* pointer to the first key entry */
     int        keylength; /* number of entries */
 
 } key;
@@ -239,6 +250,7 @@
     struct syminfo *info;           /* pointer to symbol/pir_reg's information */
     target_flag     flags;          /* flags like :slurpy etc. */
     char const     *alias;          /* if this is a named parameter, this is the alias */
+    STRING         *alias1;
     struct key     *key;            /* the key of this target, i.e. $P0[$P1], $P1 is key. */
 
     struct target  *next;
@@ -256,6 +268,7 @@
     expression      *value; /* the value of this argument */
     int              flags; /* :flat or :named, if specified */
     char const      *alias; /* value of the :named flag */
+    STRING          *alias1;
 
     struct argument *next;  /* points to the next argument */
 
@@ -288,7 +301,9 @@
 typedef struct instruction {
     unsigned            offset;       /* sequence number of this instruction */
     char         const *label;        /* label of this instruction */
+    STRING             *label1;
     char         const *opname;       /* name of the instruction, such as "print" and "set" */
+    STRING             *opname1;
     expression         *operands;     /* operands like "$I0" and "42" in "set $I0, 42" */
     int                 oplabelbits;  /* bits indicating which operands are labels */
     struct op_info_t   *opinfo;       /* pointer to the op_info containing this op's meta data */
@@ -308,6 +323,7 @@
 typedef struct bucket {
     union bucket_union {
         char const          *str;
+        STRING              *pstr;
         struct symbol       *sym;
         struct local_label  *loc;
         struct global_label *glob;
@@ -338,6 +354,7 @@
 typedef struct annotation {
     opcode_t     offset;
     char const  *key;      /* key of annotation */
+    STRING      *key1;
     constant    *value;    /* value of annotation */
 
     struct annotation *next; /* next annotation; annotations are stored in a list */
@@ -391,7 +408,7 @@
 void set_sub_multi_types(struct lexer_state * const lexer, expression * const multitype);
 
 /* install a new subroutine node */
-void new_subr(struct lexer_state * const lexer, char const * const subname);
+void new_subr(struct lexer_state * const lexer, STRING *subname);
 
 void set_sub_name(struct lexer_state * const lexer, char const * const subname);
 

Modified: branches/orderedhash_revamp/compilers/pirc/src/piremit.c
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/src/piremit.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/src/piremit.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -4,6 +4,8 @@
  */
 
 #include <stdio.h>
+#include <assert.h>
+
 #include "piremit.h"
 #include "pircompunit.h"
 #include "pircompiler.h"
@@ -11,7 +13,6 @@
 #include "bcgen.h"
 
 #include "parrot/oplib/ops.h"
-#include "assert.h"
 
 /*
 
@@ -129,24 +130,24 @@
 void
 print_constant(lexer_state * const lexer, constant * const c) {
     switch (c->type) {
-        case INT_VAL:
-            fprintf(out, "%d", c->val.ival);
-            break;
-        case NUM_VAL:
-            fprintf(out, "%f", c->val.nval);
-            break;
-        case STRING_VAL:
-            fprintf(out, "\"%s\"", c->val.sval);
-            break;
-        case PMC_VAL:
-            fprintf(out, "\"%s\"", c->val.pval);
-            break;
-        case USTRING_VAL:
-            fprintf(out, "%s:\"%s\"", c->val.ustr->charset, c->val.ustr->contents);
-            break;
-        default:
-            panic(lexer, "Unknown type detected in print_constant()");
-            break;
+      case INT_VAL:
+        fprintf(out, "%d", c->val.ival);
+        break;
+      case NUM_VAL:
+        fprintf(out, "%f", c->val.nval);
+        break;
+      case STRING_VAL:
+        fprintf(out, "\"%s\"", c->val.sval);
+        break;
+      case PMC_VAL:
+        fprintf(out, "\"%s\"", c->val.pval);
+        break;
+      case USTRING_VAL:
+        fprintf(out, "%s:\"%s\"", c->val.ustr->charset, c->val.ustr->contents);
+        break;
+      default:
+        panic(lexer, "Unknown type detected in print_constant()");
+        break;
     }
 }
 
@@ -164,23 +165,23 @@
 void
 print_expr(lexer_state * const lexer, expression * const expr) {
     switch (expr->type) {
-        case EXPR_TARGET:
-            print_target(lexer, expr->expr.t);
-            break;
-        case EXPR_CONSTANT:
-            print_constant(lexer, expr->expr.c);
-            break;
-        case EXPR_IDENT:
-            fprintf(out, "%s", expr->expr.id);
-            break;
-        case EXPR_KEY:
-            print_key(lexer, expr->expr.k);
-            break;
-        case EXPR_LABEL:
-            fprintf(out, "%d", expr->expr.l->offset);
-            break;
-        default:
-            break;
+      case EXPR_TARGET:
+        print_target(lexer, expr->expr.t);
+        break;
+      case EXPR_CONSTANT:
+        print_constant(lexer, expr->expr.c);
+        break;
+      case EXPR_IDENT:
+        fprintf(out, "%s", expr->expr.id);
+        break;
+      case EXPR_KEY:
+        print_key(lexer, expr->expr.k);
+        break;
+      case EXPR_LABEL:
+        fprintf(out, "%d", expr->expr.l->offset);
+        break;
+      default:
+        break;
     }
 }
 
@@ -552,114 +553,7 @@
 
 
 
-/*
-
-=item C<static void
-emit_pbc_key(lexer_state * const lexer, key * const k)>
-
-Emit bytecode for the key C<k>. First the bytecode is
-written to a temporary buffer, which is later unpacked
-in the actual PackFile. See C<store_key_bytecode()>.
-
-
-=cut
 
-*/
-static int
-emit_pbc_key(lexer_state * const lexer, key * const k) {
-    key_entry  *iter;
-    opcode_t   *key;
-    opcode_t    keysize;    /* total size of key in bytecode */
-    opcode_t   *pc;         /* cursor to write into key array */
-    expression *operand;
-    int         index;
-
-    /* create an array of opcode_t for storing the bytecode representation
-     * of the key. Initialize the cursor (pc) to write into this buffer.
-     * The size is 2 opcode_t's for each key plus 1 opcode_t for storing the size.
-     */
-    pc  =
-    key = (opcode_t *)pir_mem_allocate(lexer, (k->keylength * 2 + 1) * sizeof (opcode_t));
-
-    /* store key length in slot 0 */
-    *pc++ = k->keylength;
-
-    /* initialize iterator */
-    iter  = k->head;
-
-    while (iter) {
-        switch (iter->expr->type) {
-            case EXPR_CONSTANT: {
-                constant *c = iter->expr->expr.c;
-                switch (c->type) {
-                    case INT_VAL:
-                        *pc++ = PARROT_ARG_IC;
-                        *pc++ = c->val.ival;
-                        break;
-                    case STRING_VAL:
-                        *pc++ = PARROT_ARG_SC;
-                        *pc++ = add_string_const(lexer->bc, c->val.sval, "ascii");
-                        break;
-                    case USTRING_VAL:
-                        *pc++ = PARROT_ARG_SC;
-                        *pc++ = add_string_const(lexer->bc, c->val.ustr->contents,
-                                                            c->val.ustr->charset);
-                        break;
-                    default:
-                        panic(lexer, "wrong type of key");
-                        break;
-                }
-
-                break;
-            }
-            case EXPR_TARGET: {
-                target *t = iter->expr->expr.t;
-
-                switch (t->info->type) {
-                    case INT_TYPE:
-                        *pc++ = PARROT_ARG_I;
-                        *pc++ = t->info->color;
-                        break;
-                    case STRING_TYPE:
-                        *pc++ = PARROT_ARG_S;
-                        *pc++ = t->info->color;
-                        break;
-                    default:
-                        panic(lexer, "wrong type of key");
-                        break;
-                }
-                break;
-            }
-            case EXPR_KEY:
-                fprintf(stderr, "Nested keys are not supported.");
-                break;
-
-            default:
-                panic(lexer, "unknown expression type");
-                break;
-
-        }
-
-        iter = iter->next;
-    }
-
-    /* calculate size of key in bytecode; each field has 2 INTVALs:
-     * flags/types and the register/constant index.
-     */
-    keysize = pc - key;
-/*
-    fprintf(stderr, "key: ");
-    for (index = 0; index < keysize; ++index) {
-        fprintf(stderr, "%d|", key[index]);
-    }
-*/
-    /* store the key, and emit the index at which it's stored into the code segment */
-    index = store_key_bytecode(lexer->bc, key);
-    emit_int_arg(lexer->bc, index);
-
-    return index;
-
-}
 
 
 /*
@@ -681,7 +575,7 @@
 
     /* if t has a key, emit that as well */
     if (t->key) {
-        emit_pbc_key(lexer, t->key);
+        emit_pbc_key(lexer->bc, t->key);
     }
 }
 
@@ -700,25 +594,25 @@
 static void
 emit_pbc_expr(lexer_state * const lexer, expression * const operand) {
     switch (operand->type) {
-        case EXPR_CONSTANT:
-            emit_pbc_const_arg(lexer, operand->expr.c);
-            break;
-        case EXPR_TARGET:
-            emit_pbc_target_arg(lexer, operand->expr.t);
-            break;
-        case EXPR_LABEL:
-            emit_pbc_label_arg(lexer, operand->expr.l);
-            break;
-        case EXPR_KEY:
-            emit_pbc_key(lexer, operand->expr.k);
-            break;
-        /*
-        case EXPR_IDENT:
-            fprintf(stderr, "expr ident\n");
-            break;
-        */
-        default:
-            break;
+      case EXPR_CONSTANT:
+        emit_pbc_const_arg(lexer, operand->expr.c);
+        break;
+      case EXPR_TARGET:
+        emit_pbc_target_arg(lexer, operand->expr.t);
+        break;
+      case EXPR_LABEL:
+        emit_pbc_label_arg(lexer, operand->expr.l);
+        break;
+      case EXPR_KEY:
+        emit_pbc_key(lexer->bc, operand->expr.k);
+        break;
+      /*
+      case EXPR_IDENT:
+        fprintf(stderr, "expr ident\n");
+        break;
+       */
+      default:
+        break;
     }
 }
 
@@ -940,22 +834,22 @@
         key = add_string_const(lexer->bc, iter->key, "ascii");
 
         switch (iter->value->type) {
-            case INT_VAL:
-                value = iter->value->val.ival;
-                break;
-            case NUM_VAL:
-                value = add_num_const(lexer->bc, iter->value->val.nval);
-                break;
-            case STRING_VAL:
-                value = add_string_const(lexer->bc, iter->value->val.sval, "ascii");
-                break;
-            case USTRING_VAL:
-                value = add_string_const(lexer->bc, iter->value->val.ustr->contents,
-                                                    iter->value->val.ustr->charset);
-                break;
-            default:
-                panic(lexer, "unknown annotation constant type");
-                return; /* panic() exits, so this never happens */
+          case INT_VAL:
+            value = iter->value->val.ival;
+            break;
+          case NUM_VAL:
+            value = add_num_const(lexer->bc, iter->value->val.nval);
+            break;
+          case STRING_VAL:
+            value = add_string_const(lexer->bc, iter->value->val.sval, "ascii");
+            break;
+          case USTRING_VAL:
+            value = add_string_const(lexer->bc, iter->value->val.ustr->contents,
+                                                iter->value->val.ustr->charset);
+            break;
+          default:
+            panic(lexer, "unknown annotation constant type");
+            return; /* panic() exits, so this never happens */
         }
 
 

Modified: branches/orderedhash_revamp/compilers/pirc/src/piremit.h
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/src/piremit.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/src/piremit.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -14,6 +14,7 @@
 void emit_pir_subs(struct lexer_state * const lexer, char const * const outfile);
 void emit_pbc(struct lexer_state * const lexer, const char *outfile);
 
+
 int emit_pbc_const(struct lexer_state * const lexer, struct constant * const pirconst);
 
 #endif /* PARROT_PIR_PIREMIT_H_GUARD */

Modified: branches/orderedhash_revamp/compilers/pirc/src/pirerr.h
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/src/pirerr.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/src/pirerr.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -28,12 +28,12 @@
         __attribute__nonnull__(2)
         __attribute__nonnull__(3);
 
-#define ASSERT_ARGS_panic __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_panic __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(lexer) \
-    || PARROT_ASSERT_ARG(message)
-#define ASSERT_ARGS_yypirerror __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(message))
+#define ASSERT_ARGS_yypirerror __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(lexer) \
-    || PARROT_ASSERT_ARG(message)
+    , PARROT_ASSERT_ARG(message))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: compilers/pirc/src/pirerr.c */
 

Modified: branches/orderedhash_revamp/compilers/pirc/src/pirlexer.c
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/src/pirlexer.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/src/pirlexer.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -64,7 +64,7 @@
 /* %endif */
 
 /* %if-c-only */
-
+    
 /* %endif */
 
 /* %if-c-only */
@@ -96,7 +96,7 @@
 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 
 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types.
+ * if you want the limit (max/min) macros for int types. 
  */
 #ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS 1
@@ -113,7 +113,7 @@
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
 typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t;
+typedef unsigned char flex_uint8_t; 
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
 #endif /* ! C99 */
@@ -159,15 +159,15 @@
 /* The "const" storage-class-modifier is valid. */
 #define YY_USE_CONST
 
-#else   /* ! __cplusplus */
+#else	/* ! __cplusplus */
 
 /* C99 requires __STDC__ to be defined as 1. */
 #if defined (__STDC__)
 
 #define YY_USE_CONST
 
-#endif  /* defined (__STDC__) */
-#endif  /* ! __cplusplus */
+#endif	/* defined (__STDC__) */
+#endif	/* ! __cplusplus */
 
 #ifdef YY_USE_CONST
 #define yyconst const
@@ -250,6 +250,11 @@
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #endif
 
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
 /* %if-not-reentrant */
 /* %endif */
 
@@ -264,7 +269,7 @@
 
     /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
      *       access to the local variable yy_act. Since yyless() is a macro, it would break
-     *       existing scanners that call yyless() from OUTSIDE yypirlex.
+     *       existing scanners that call yyless() from OUTSIDE yypirlex. 
      *       One obvious solution it to make yy_act a global. I tried that, and saw
      *       a 5% performance hit in a non-yylineno scanner, because yy_act is
      *       normally declared as a register variable-- so it is not worth it.
@@ -276,96 +281,91 @@
                     if ( yytext[yyl] == '\n' )\
                         --yylineno;\
             }while(0)
-
+    
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
-    do \
-        { \
-        /* Undo effects of setting up yytext. */ \
+	do \
+		{ \
+		/* Undo effects of setting up yytext. */ \
         int yyless_macro_arg = (n); \
         YY_LESS_LINENO(yyless_macro_arg);\
-        *yy_cp = yyg->yy_hold_char; \
-        YY_RESTORE_YY_MORE_OFFSET \
-        yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
-        YY_DO_BEFORE_ACTION; /* set up yytext again */ \
-        } \
-    while ( 0 )
+		*yy_cp = yyg->yy_hold_char; \
+		YY_RESTORE_YY_MORE_OFFSET \
+		yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+		} \
+	while ( 0 )
 
 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
 
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
-    {
+	{
 /* %if-c-only */
-    FILE *yy_input_file;
+	FILE *yy_input_file;
 /* %endif */
 
 /* %if-c++-only */
 /* %endif */
 
-    char *yy_ch_buf;        /* input buffer */
-    char *yy_buf_pos;       /* current position in input buffer */
-
-    /* Size of input buffer in bytes, not including room for EOB
-     * characters.
-     */
-    yy_size_t yy_buf_size;
-
-    /* Number of characters read into yy_ch_buf, not including EOB
-     * characters.
-     */
-    int yy_n_chars;
-
-    /* Whether we "own" the buffer - i.e., we know we created it,
-     * and can realloc() it to grow it, and should free() it to
-     * delete it.
-     */
-    int yy_is_our_buffer;
-
-    /* Whether this is an "interactive" input source; if so, and
-     * if we're using stdio for input, then we want to use getc()
-     * instead of fread(), to make sure we stop fetching input after
-     * each newline.
-     */
-    int yy_is_interactive;
+	char *yy_ch_buf;		/* input buffer */
+	char *yy_buf_pos;		/* current position in input buffer */
 
-    /* Whether we're considered to be at the beginning of a line.
-     * If so, '^' rules will be active on the next match, otherwise
-     * not.
-     */
-    int yy_at_bol;
+	/* Size of input buffer in bytes, not including room for EOB
+	 * characters.
+	 */
+	yy_size_t yy_buf_size;
+
+	/* Number of characters read into yy_ch_buf, not including EOB
+	 * characters.
+	 */
+	yy_size_t yy_n_chars;
+
+	/* Whether we "own" the buffer - i.e., we know we created it,
+	 * and can realloc() it to grow it, and should free() it to
+	 * delete it.
+	 */
+	int yy_is_our_buffer;
+
+	/* Whether this is an "interactive" input source; if so, and
+	 * if we're using stdio for input, then we want to use getc()
+	 * instead of fread(), to make sure we stop fetching input after
+	 * each newline.
+	 */
+	int yy_is_interactive;
+
+	/* Whether we're considered to be at the beginning of a line.
+	 * If so, '^' rules will be active on the next match, otherwise
+	 * not.
+	 */
+	int yy_at_bol;
 
     int yy_bs_lineno; /**< The line count. */
     int yy_bs_column; /**< The column count. */
+    
+	/* Whether to try to fill the input buffer when we reach the
+	 * end of it.
+	 */
+	int yy_fill_buffer;
 
-    /* Whether to try to fill the input buffer when we reach the
-     * end of it.
-     */
-    int yy_fill_buffer;
-
-    int yy_buffer_status;
+	int yy_buffer_status;
 
 #define YY_BUFFER_NEW 0
 #define YY_BUFFER_NORMAL 1
-    /* When an EOF's been seen but there's still some text to process
-     * then we mark the buffer as YY_EOF_PENDING, to indicate that we
-     * shouldn't try reading from the input source any more.  We might
-     * still have a bunch of tokens to match, though, because of
-     * possible backing-up.
-     *
-     * When we actually see the EOF, we change the status to "new"
-     * (via yypirrestart()), so that the user can continue scanning by
-     * just pointing yyin at a new input file.
-     */
+	/* When an EOF's been seen but there's still some text to process
+	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+	 * shouldn't try reading from the input source any more.  We might
+	 * still have a bunch of tokens to match, though, because of
+	 * possible backing-up.
+	 *
+	 * When we actually see the EOF, we change the status to "new"
+	 * (via yypirrestart()), so that the user can continue scanning by
+	 * just pointing yyin at a new input file.
+	 */
 #define YY_BUFFER_EOF_PENDING 2
 
-    };
+	};
 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
 
 /* %if-c-only Standard (non-C++) definition */
@@ -417,7 +417,7 @@
 
 YY_BUFFER_STATE yypir_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
 YY_BUFFER_STATE yypir_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE yypir_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+YY_BUFFER_STATE yypir_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
 
 /* %endif */
 
@@ -428,24 +428,24 @@
 #define yy_new_buffer yypir_create_buffer
 
 #define yy_set_interactive(is_interactive) \
-    { \
-    if ( ! YY_CURRENT_BUFFER ){ \
+	{ \
+	if ( ! YY_CURRENT_BUFFER ){ \
         yypirensure_buffer_stack (yyscanner); \
-        YY_CURRENT_BUFFER_LVALUE =    \
+		YY_CURRENT_BUFFER_LVALUE =    \
             yypir_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
-    } \
-    YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
-    }
+	} \
+	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+	}
 
 #define yy_set_bol(at_bol) \
-    { \
-    if ( ! YY_CURRENT_BUFFER ){\
+	{ \
+	if ( ! YY_CURRENT_BUFFER ){\
         yypirensure_buffer_stack (yyscanner); \
-        YY_CURRENT_BUFFER_LVALUE =    \
+		YY_CURRENT_BUFFER_LVALUE =    \
             yypir_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
-    } \
-    YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
-    }
+	} \
+	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+	}
 
 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
 
@@ -476,13 +476,13 @@
  * corresponding action - sets up yytext.
  */
 #define YY_DO_BEFORE_ACTION \
-    yyg->yytext_ptr = yy_bp; \
+	yyg->yytext_ptr = yy_bp; \
 /* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
-    yyleng = (size_t) (yy_cp - yy_bp); \
-    yyg->yy_hold_char = *yy_cp; \
-    *yy_cp = '\0'; \
+	yyleng = (size_t) (yy_cp - yy_bp); \
+	yyg->yy_hold_char = *yy_cp; \
+	*yy_cp = '\0'; \
 /* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
-    yyg->yy_c_buf_p = yy_cp;
+	yyg->yy_c_buf_p = yy_cp;
 
 /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
 #define YY_NUM_RULES 209
@@ -490,10 +490,10 @@
 /* This struct is not used in this scanner,
    but its presence is necessary. */
 struct yy_trans_info
-    {
-    flex_int32_t yy_verify;
-    flex_int32_t yy_nxt;
-    };
+	{
+	flex_int32_t yy_verify;
+	flex_int32_t yy_nxt;
+	};
 static yyconst flex_int16_t yy_accept[825] =
     {   0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
@@ -1388,16 +1388,16 @@
 /* Table of booleans, true if rule could match eol. */
 static yyconst flex_int32_t yy_rule_can_match_eol[210] =
     {   0,
-1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 1, 0, 0,     };
 
 static yyconst flex_int16_t yy_rule_linenum[209] =
@@ -1414,17 +1414,17 @@
       381,  382,  383,  384,  385,  386,  387,  388,  389,  390,
 
       392,  393,  394,  395,  396,  397,  398,  399,  401,  405,
-      422,  427,  456,  504,  505,  506,  507,  509,  514,  526,
-      554,  555,  556,  557,  558,  560,  568,  619,  632,  654,
-      659,  664,  671,  672,  687,  692,  693,  698,  699,  700,
-      702,  718,  772,  800,  805,  810,  811,  812,  813,  818,
-      829,  830,  832,  834,  845,  859,  864,  865,  866,  867,
-      869,  884,  898,  927,  952,  954,  959,  969,  974,  992,
-      998, 1005, 1038, 1040, 1045, 1081, 1082, 1083, 1085, 1086,
-     1087, 1088, 1089, 1090, 1092, 1093, 1094, 1096, 1101, 1106,
-     1107, 1110, 1144, 1149, 1152, 1153, 1154, 1155, 1157, 1162,
+      427,  439,  468,  516,  517,  518,  519,  521,  530,  542,
+      571,  572,  573,  574,  575,  577,  585,  636,  649,  671,
+      676,  681,  688,  689,  704,  709,  710,  715,  716,  717,
+      719,  735,  789,  817,  822,  827,  828,  829,  830,  835,
+      846,  847,  849,  851,  862,  876,  881,  882,  883,  884,
+      886,  901,  915,  944,  969,  971,  976,  986,  991, 1009,
+     1015, 1022, 1055, 1057, 1062, 1098, 1099, 1100, 1102, 1103,
+     1104, 1105, 1106, 1107, 1109, 1110, 1111, 1113, 1118, 1123,
+     1124, 1127, 1161, 1166, 1169, 1170, 1171, 1172, 1174, 1179,
 
-     1163, 1164, 1165, 1166, 1168, 1173, 1175, 1177
+     1180, 1181, 1182, 1183, 1185, 1190, 1192, 1194
     } ;
 
 /* The intent behind this definition is that it'll catch
@@ -1591,8 +1591,8 @@
     size_t yy_buffer_stack_max; /**< capacity of stack. */
     YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
     char yy_hold_char;
-    int yy_n_chars;
-    int yyleng_r;
+    yy_size_t yy_n_chars;
+    yy_size_t yyleng_r;
     char *yy_c_buf_p;
     int yy_init;
     int yy_start;
@@ -1625,7 +1625,7 @@
     /* This must go here because YYSTYPE and YYLTYPE are included
      * from bison output in section 1.*/
     #    define yylval yyg->yylval_r
-
+    
 int yypirlex_init (yyscan_t* scanner);
 
 int yypirlex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
@@ -1655,7 +1655,7 @@
 
 void yypirset_out  (FILE * out_str ,yyscan_t yyscanner );
 
-int yypirget_leng (yyscan_t yyscanner );
+yy_size_t yypirget_leng (yyscan_t yyscanner );
 
 char *yypirget_text (yyscan_t yyscanner );
 
@@ -1714,11 +1714,11 @@
 /* %if-c-only */
 
     static void yy_push_state (int new_state ,yyscan_t yyscanner);
-
+    
     static void yy_pop_state (yyscan_t yyscanner );
-
+    
     static int yy_top_state (yyscan_t yyscanner );
-
+    
 /* %endif */
 
 /* Amount of stuff to slurp up with each read. */
@@ -1744,33 +1744,33 @@
 #ifndef YY_INPUT
 #define YY_INPUT(buf,result,max_size) \
 /* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
-    if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
-        { \
-        int c = '*'; \
-        int n; \
-        for ( n = 0; n < max_size && \
-                 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
-            buf[n] = (char) c; \
-        if ( c == '\n' ) \
-            buf[n++] = (char) c; \
-        if ( c == EOF && ferror( yyin ) ) \
-            YY_FATAL_ERROR( "input in flex scanner failed" ); \
-        result = n; \
-        } \
-    else \
-        { \
-        errno=0; \
-        while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
-            { \
-            if( errno != EINTR) \
-                { \
-                YY_FATAL_ERROR( "input in flex scanner failed" ); \
-                break; \
-                } \
-            errno=0; \
-            clearerr(yyin); \
-            } \
-        }\
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+		{ \
+		int c = '*'; \
+		yy_size_t n; \
+		for ( n = 0; n < max_size && \
+			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+			buf[n] = (char) c; \
+		if ( c == '\n' ) \
+			buf[n++] = (char) c; \
+		if ( c == EOF && ferror( yyin ) ) \
+			YY_FATAL_ERROR( "input in flex scanner failed" ); \
+		result = n; \
+		} \
+	else \
+		{ \
+		errno=0; \
+		while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+			{ \
+			if( errno != EINTR) \
+				{ \
+				YY_FATAL_ERROR( "input in flex scanner failed" ); \
+				break; \
+				} \
+			errno=0; \
+			clearerr(yyin); \
+			} \
+		}\
 \
 /* %if-c++-only C++ definition \ */\
 /* %endif */
@@ -1843,7 +1843,7 @@
 
 /* %% [6.0] YY_RULE_SETUP definition goes here */
 #define YY_RULE_SETUP \
-    YY_USER_ACTION
+	YY_USER_ACTION
 
 /* %not-for-header */
 
@@ -1851,9 +1851,9 @@
  */
 YY_DECL
 {
-    register yy_state_type yy_current_state;
-    register char *yy_cp, *yy_bp;
-    register int yy_act;
+	register yy_state_type yy_current_state;
+	register char *yy_cp, *yy_bp;
+	register int yy_act;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
 /* %% [7.0] user's declarations go here */
@@ -1865,125 +1865,125 @@
 
     yylval = yylval_param;
 
-    if ( !yyg->yy_init )
-        {
-        yyg->yy_init = 1;
+	if ( !yyg->yy_init )
+		{
+		yyg->yy_init = 1;
 
 #ifdef YY_USER_INIT
-        YY_USER_INIT;
+		YY_USER_INIT;
 #endif
 
-        if ( ! yyg->yy_start )
-            yyg->yy_start = 1;  /* first start state */
+		if ( ! yyg->yy_start )
+			yyg->yy_start = 1;	/* first start state */
 
-        if ( ! yyin )
+		if ( ! yyin )
 /* %if-c-only */
-            yyin = stdin;
+			yyin = stdin;
 /* %endif */
 /* %if-c++-only */
 /* %endif */
 
-        if ( ! yyout )
+		if ( ! yyout )
 /* %if-c-only */
-            yyout = stdout;
+			yyout = stdout;
 /* %endif */
 /* %if-c++-only */
 /* %endif */
 
-        if ( ! YY_CURRENT_BUFFER ) {
-            yypirensure_buffer_stack (yyscanner);
-            YY_CURRENT_BUFFER_LVALUE =
-                yypir_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
-        }
+		if ( ! YY_CURRENT_BUFFER ) {
+			yypirensure_buffer_stack (yyscanner);
+			YY_CURRENT_BUFFER_LVALUE =
+				yypir_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+		}
 
-        yypir_load_buffer_state(yyscanner );
-        }
+		yypir_load_buffer_state(yyscanner );
+		}
 
-    while ( 1 )     /* loops until end-of-file is reached */
-        {
+	while ( 1 )		/* loops until end-of-file is reached */
+		{
 /* %% [8.0] yymore()-related code goes here */
-        yy_cp = yyg->yy_c_buf_p;
+		yy_cp = yyg->yy_c_buf_p;
 
-        /* Support of yytext. */
-        *yy_cp = yyg->yy_hold_char;
+		/* Support of yytext. */
+		*yy_cp = yyg->yy_hold_char;
 
-        /* yy_bp points to the position in yy_ch_buf of the start of
-         * the current run.
-         */
-        yy_bp = yy_cp;
+		/* yy_bp points to the position in yy_ch_buf of the start of
+		 * the current run.
+		 */
+		yy_bp = yy_cp;
 
 /* %% [9.0] code to set up and find next match goes here */
-        yy_current_state = yyg->yy_start;
+		yy_current_state = yyg->yy_start;
 yy_match:
-        do
-            {
-            register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
-            if ( yy_accept[yy_current_state] )
-                {
-                yyg->yy_last_accepting_state = yy_current_state;
-                yyg->yy_last_accepting_cpos = yy_cp;
-                }
-            while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-                {
-                yy_current_state = (int) yy_def[yy_current_state];
-                if ( yy_current_state >= 825 )
-                    yy_c = yy_meta[(unsigned int) yy_c];
-                }
-            yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-            ++yy_cp;
-            }
-        while ( yy_current_state != 824 );
-        yy_cp = yyg->yy_last_accepting_cpos;
-        yy_current_state = yyg->yy_last_accepting_state;
+		do
+			{
+			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+			if ( yy_accept[yy_current_state] )
+				{
+				yyg->yy_last_accepting_state = yy_current_state;
+				yyg->yy_last_accepting_cpos = yy_cp;
+				}
+			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+				{
+				yy_current_state = (int) yy_def[yy_current_state];
+				if ( yy_current_state >= 825 )
+					yy_c = yy_meta[(unsigned int) yy_c];
+				}
+			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+			++yy_cp;
+			}
+		while ( yy_current_state != 824 );
+		yy_cp = yyg->yy_last_accepting_cpos;
+		yy_current_state = yyg->yy_last_accepting_state;
 
 yy_find_action:
 /* %% [10.0] code to find the action number goes here */
-        yy_act = yy_accept[yy_current_state];
+		yy_act = yy_accept[yy_current_state];
 
-        YY_DO_BEFORE_ACTION;
+		YY_DO_BEFORE_ACTION;
 
 /* %% [11.0] code for yylineno update goes here */
 
-        if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
-            {
-            int yyl;
-            for ( yyl = 0; yyl < yyleng; ++yyl )
-                if ( yytext[yyl] == '\n' )
-
+		if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
+			{
+			int yyl;
+			for ( yyl = 0; yyl < yyleng; ++yyl )
+				if ( yytext[yyl] == '\n' )
+					   
     do{ yylineno++;
         yycolumn=0;
     }while(0)
 ;
-            }
+			}
 
-do_action:  /* This label is used only to access EOF actions. */
+do_action:	/* This label is used only to access EOF actions. */
 
 /* %% [12.0] debug code goes here */
-        if ( yy_flex_debug )
-            {
-            if ( yy_act == 0 )
-                fprintf( stderr, "--scanner backing up\n" );
-            else if ( yy_act < 209 )
-                fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
-                         (long)yy_rule_linenum[yy_act], yytext );
-            else if ( yy_act == 209 )
-                fprintf( stderr, "--accepting default rule (\"%s\")\n",
-                         yytext );
-            else if ( yy_act == 210 )
-                fprintf( stderr, "--(end of buffer or a NUL)\n" );
-            else
-                fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
-            }
+		if ( yy_flex_debug )
+			{
+			if ( yy_act == 0 )
+				fprintf( stderr, "--scanner backing up\n" );
+			else if ( yy_act < 209 )
+				fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
+				         (long)yy_rule_linenum[yy_act], yytext );
+			else if ( yy_act == 209 )
+				fprintf( stderr, "--accepting default rule (\"%s\")\n",
+				         yytext );
+			else if ( yy_act == 210 )
+				fprintf( stderr, "--(end of buffer or a NUL)\n" );
+			else
+				fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
+			}
 
-        switch ( yy_act )
-    { /* beginning of action switch */
+		switch ( yy_act )
+	{ /* beginning of action switch */
 /* %% [13.0] actions go here */
-            case 0: /* must back up */
-            /* undo the effects of YY_DO_BEFORE_ACTION */
-            *yy_cp = yyg->yy_hold_char;
-            yy_cp = yyg->yy_last_accepting_cpos;
-            yy_current_state = yyg->yy_last_accepting_state;
-            goto yy_find_action;
+			case 0: /* must back up */
+			/* undo the effects of YY_DO_BEFORE_ACTION */
+			*yy_cp = yyg->yy_hold_char;
+			yy_cp = yyg->yy_last_accepting_cpos;
+			yy_current_state = yyg->yy_last_accepting_state;
+			goto yy_find_action;
 
 case 1:
 /* rule 1 can match eol */
@@ -2010,18 +2010,18 @@
                         }
 
                       }
-    YY_BREAK
+	YY_BREAK
 case 2:
 YY_RULE_SETUP
 #line 248 "pir.l"
 { /* ignore whitespace */ }
-    YY_BREAK
+	YY_BREAK
 case 3:
 /* rule 3 can match eol */
 YY_RULE_SETUP
 #line 250 "pir.l"
 { /* ignore line comments */ }
-    YY_BREAK
+	YY_BREAK
 case 4:
 /* rule 4 can match eol */
 YY_RULE_SETUP
@@ -2047,414 +2047,414 @@
                     yylval->ival = num_newlines;
                     return TK_NL;
                   }
-    YY_BREAK
+	YY_BREAK
 case 5:
 YY_RULE_SETUP
 #line 274 "pir.l"
 { return TK_ASSIGN_USHIFT; }
-    YY_BREAK
+	YY_BREAK
 case 6:
 YY_RULE_SETUP
 #line 275 "pir.l"
 { return TK_USHIFT; }
-    YY_BREAK
+	YY_BREAK
 case 7:
 YY_RULE_SETUP
 #line 276 "pir.l"
 { return TK_ASSIGN_RSHIFT; }
-    YY_BREAK
+	YY_BREAK
 case 8:
 YY_RULE_SETUP
 #line 277 "pir.l"
 { return TK_RSHIFT; }
-    YY_BREAK
+	YY_BREAK
 case 9:
 YY_RULE_SETUP
 #line 278 "pir.l"
 { return TK_LSHIFT; }
-    YY_BREAK
+	YY_BREAK
 case 10:
 YY_RULE_SETUP
 #line 279 "pir.l"
 { return TK_ARROW; }
-    YY_BREAK
+	YY_BREAK
 case 11:
 YY_RULE_SETUP
 #line 280 "pir.l"
 { return TK_EQ; }
-    YY_BREAK
+	YY_BREAK
 case 12:
 YY_RULE_SETUP
 #line 281 "pir.l"
 { return TK_NE; }
-    YY_BREAK
+	YY_BREAK
 case 13:
 YY_RULE_SETUP
 #line 282 "pir.l"
 { return TK_LE; }
-    YY_BREAK
+	YY_BREAK
 case 14:
 YY_RULE_SETUP
 #line 283 "pir.l"
 { return TK_GE; }
-    YY_BREAK
+	YY_BREAK
 case 15:
 YY_RULE_SETUP
 #line 284 "pir.l"
 { return TK_LT; }
-    YY_BREAK
+	YY_BREAK
 case 16:
 YY_RULE_SETUP
 #line 285 "pir.l"
 { return TK_GT; }
-    YY_BREAK
+	YY_BREAK
 case 17:
 YY_RULE_SETUP
 #line 287 "pir.l"
 { return TK_FDIV; }
-    YY_BREAK
+	YY_BREAK
 case 18:
 YY_RULE_SETUP
 #line 288 "pir.l"
 { return TK_AND; }
-    YY_BREAK
+	YY_BREAK
 case 19:
 YY_RULE_SETUP
 #line 289 "pir.l"
 { return TK_OR; }
-    YY_BREAK
+	YY_BREAK
 case 20:
 YY_RULE_SETUP
 #line 290 "pir.l"
 { return TK_XOR; }
-    YY_BREAK
+	YY_BREAK
 case 21:
 YY_RULE_SETUP
 #line 292 "pir.l"
 { return '+'; }
-    YY_BREAK
+	YY_BREAK
 case 22:
 YY_RULE_SETUP
 #line 293 "pir.l"
 { return '%'; }
-    YY_BREAK
+	YY_BREAK
 case 23:
 YY_RULE_SETUP
 #line 294 "pir.l"
 { return '*'; }
-    YY_BREAK
+	YY_BREAK
 case 24:
 YY_RULE_SETUP
 #line 295 "pir.l"
 { return '/'; }
-    YY_BREAK
+	YY_BREAK
 case 25:
 YY_RULE_SETUP
 #line 296 "pir.l"
 { return '!'; }
-    YY_BREAK
+	YY_BREAK
 case 26:
 YY_RULE_SETUP
 #line 297 "pir.l"
 { return '~'; }
-    YY_BREAK
+	YY_BREAK
 case 27:
 YY_RULE_SETUP
 #line 298 "pir.l"
 { return '-'; }
-    YY_BREAK
+	YY_BREAK
 case 28:
 YY_RULE_SETUP
 #line 299 "pir.l"
 { return '('; }
-    YY_BREAK
+	YY_BREAK
 case 29:
 YY_RULE_SETUP
 #line 300 "pir.l"
 { return ')'; }
-    YY_BREAK
+	YY_BREAK
 case 30:
 YY_RULE_SETUP
 #line 301 "pir.l"
 { return ','; }
-    YY_BREAK
+	YY_BREAK
 case 31:
 YY_RULE_SETUP
 #line 302 "pir.l"
 { return '['; }
-    YY_BREAK
+	YY_BREAK
 case 32:
 YY_RULE_SETUP
 #line 303 "pir.l"
 { return ']'; }
-    YY_BREAK
+	YY_BREAK
 case 33:
 YY_RULE_SETUP
 #line 305 "pir.l"
 { /* if the dot is surrounded by whitespace, it's a concatenation operator */
                     return TK_CONC;
                   }
-    YY_BREAK
+	YY_BREAK
 case 34:
 YY_RULE_SETUP
 #line 310 "pir.l"
 { return '='; }
-    YY_BREAK
+	YY_BREAK
 case 35:
 YY_RULE_SETUP
 #line 311 "pir.l"
 { return ';'; }
-    YY_BREAK
+	YY_BREAK
 case 36:
 YY_RULE_SETUP
 #line 313 "pir.l"
 { return TK_ASSIGN_INC; }
-    YY_BREAK
+	YY_BREAK
 case 37:
 YY_RULE_SETUP
 #line 314 "pir.l"
 { return TK_ASSIGN_DEC; }
-    YY_BREAK
+	YY_BREAK
 case 38:
 YY_RULE_SETUP
 #line 315 "pir.l"
 { return TK_ASSIGN_DIV; }
-    YY_BREAK
+	YY_BREAK
 case 39:
 YY_RULE_SETUP
 #line 316 "pir.l"
 { return TK_ASSIGN_MUL; }
-    YY_BREAK
+	YY_BREAK
 case 40:
 YY_RULE_SETUP
 #line 317 "pir.l"
 { return TK_ASSIGN_MOD; }
-    YY_BREAK
+	YY_BREAK
 case 41:
 YY_RULE_SETUP
 #line 318 "pir.l"
 { return TK_ASSIGN_POW; }
-    YY_BREAK
+	YY_BREAK
 case 42:
 YY_RULE_SETUP
 #line 319 "pir.l"
 { return TK_ASSIGN_BOR; }
-    YY_BREAK
+	YY_BREAK
 case 43:
 YY_RULE_SETUP
 #line 320 "pir.l"
 { return TK_ASSIGN_BAND; }
-    YY_BREAK
+	YY_BREAK
 case 44:
 YY_RULE_SETUP
 #line 321 "pir.l"
 { return TK_ASSIGN_FDIV; }
-    YY_BREAK
+	YY_BREAK
 case 45:
 YY_RULE_SETUP
 #line 322 "pir.l"
 { return TK_ASSIGN_BNOT; }
-    YY_BREAK
+	YY_BREAK
 case 46:
 YY_RULE_SETUP
 #line 323 "pir.l"
 { return TK_ASSIGN_CONC; }
-    YY_BREAK
+	YY_BREAK
 case 47:
 YY_RULE_SETUP
 #line 325 "pir.l"
 { return TK_IF; }
-    YY_BREAK
+	YY_BREAK
 case 48:
 YY_RULE_SETUP
 #line 326 "pir.l"
 { return TK_GOTO; }
-    YY_BREAK
+	YY_BREAK
 case 49:
 YY_RULE_SETUP
 #line 327 "pir.l"
 { return TK_UNLESS; }
-    YY_BREAK
+	YY_BREAK
 case 50:
 YY_RULE_SETUP
 #line 328 "pir.l"
 { return TK_NULL; }
-    YY_BREAK
+	YY_BREAK
 case 51:
 YY_RULE_SETUP
 #line 330 "pir.l"
 { return TK_INT; }
-    YY_BREAK
+	YY_BREAK
 case 52:
 YY_RULE_SETUP
 #line 331 "pir.l"
 { return TK_NUM; }
-    YY_BREAK
+	YY_BREAK
 case 53:
 YY_RULE_SETUP
 #line 332 "pir.l"
 { return TK_PMC; }
-    YY_BREAK
+	YY_BREAK
 case 54:
 YY_RULE_SETUP
 #line 333 "pir.l"
 { return TK_STRING; }
-    YY_BREAK
+	YY_BREAK
 case 55:
 YY_RULE_SETUP
 #line 335 "pir.l"
 { return TK_ANNOTATE; }
-    YY_BREAK
+	YY_BREAK
 case 56:
 YY_RULE_SETUP
 #line 336 "pir.l"
 { return TK_SET_ARG; }
-    YY_BREAK
+	YY_BREAK
 case 57:
 YY_RULE_SETUP
 #line 337 "pir.l"
 { return TK_CONST; }
-    YY_BREAK
+	YY_BREAK
 case 58:
 YY_RULE_SETUP
 #line 338 "pir.l"
 { return TK_END; }
-    YY_BREAK
+	YY_BREAK
 case 59:
 YY_RULE_SETUP
 #line 339 "pir.l"
 { return TK_FILE; }
-    YY_BREAK
+	YY_BREAK
 case 60:
 YY_RULE_SETUP
 #line 341 "pir.l"
 { return TK_GET_RESULTS; }
-    YY_BREAK
+	YY_BREAK
 case 61:
 YY_RULE_SETUP
 #line 342 "pir.l"
 { return TK_GLOBALCONST; }
-    YY_BREAK
+	YY_BREAK
 case 62:
 YY_RULE_SETUP
 #line 343 "pir.l"
 { return TK_HLL; }
-    YY_BREAK
+	YY_BREAK
 case 63:
 YY_RULE_SETUP
 #line 344 "pir.l"
 { return TK_INVOCANT; }
-    YY_BREAK
+	YY_BREAK
 case 64:
 YY_RULE_SETUP
 #line 345 "pir.l"
 { return TK_LEX; }
-    YY_BREAK
+	YY_BREAK
 case 65:
 YY_RULE_SETUP
 #line 346 "pir.l"
 { return TK_LINE; }
-    YY_BREAK
+	YY_BREAK
 case 66:
 YY_RULE_SETUP
 #line 347 "pir.l"
 { return TK_LOADLIB; }
-    YY_BREAK
+	YY_BREAK
 case 67:
 YY_RULE_SETUP
 #line 348 "pir.l"
 { return TK_LOCAL; }
-    YY_BREAK
+	YY_BREAK
 case 68:
 YY_RULE_SETUP
 #line 350 "pir.l"
 { return TK_METH_CALL; }
-    YY_BREAK
+	YY_BREAK
 case 69:
 YY_RULE_SETUP
 #line 351 "pir.l"
 { return TK_NAMESPACE; }
-    YY_BREAK
+	YY_BREAK
 case 70:
 YY_RULE_SETUP
 #line 352 "pir.l"
 { return TK_NCI_CALL; }
-    YY_BREAK
+	YY_BREAK
 case 71:
 YY_RULE_SETUP
 #line 353 "pir.l"
 { return TK_PARAM; }
-    YY_BREAK
+	YY_BREAK
 case 72:
 YY_RULE_SETUP
 #line 354 "pir.l"
 { return TK_BEGIN_CALL; }
-    YY_BREAK
+	YY_BREAK
 case 73:
 YY_RULE_SETUP
 #line 355 "pir.l"
 { return TK_BEGIN_RETURN; }
-    YY_BREAK
+	YY_BREAK
 case 74:
 YY_RULE_SETUP
 #line 356 "pir.l"
 { return TK_BEGIN_YIELD; }
-    YY_BREAK
+	YY_BREAK
 case 75:
 YY_RULE_SETUP
 #line 357 "pir.l"
 { return TK_CALL; }
-    YY_BREAK
+	YY_BREAK
 case 76:
 YY_RULE_SETUP
 #line 358 "pir.l"
 { return TK_END_CALL; }
-    YY_BREAK
+	YY_BREAK
 case 77:
 YY_RULE_SETUP
 #line 359 "pir.l"
 { return TK_END_RETURN; }
-    YY_BREAK
+	YY_BREAK
 case 78:
 YY_RULE_SETUP
 #line 360 "pir.l"
 { return TK_END_YIELD; }
-    YY_BREAK
+	YY_BREAK
 case 79:
 YY_RULE_SETUP
 #line 361 "pir.l"
 { return TK_GET_RESULT; }
-    YY_BREAK
+	YY_BREAK
 case 80:
 YY_RULE_SETUP
 #line 362 "pir.l"
 { return TK_RETURN; }
-    YY_BREAK
+	YY_BREAK
 case 81:
 YY_RULE_SETUP
 #line 363 "pir.l"
 { return TK_SUB; }
-    YY_BREAK
+	YY_BREAK
 case 82:
 YY_RULE_SETUP
 #line 364 "pir.l"
 { return TK_YIELD; }
-    YY_BREAK
+	YY_BREAK
 case 83:
 YY_RULE_SETUP
 #line 365 "pir.l"
 { return TK_SET_RETURN; }
-    YY_BREAK
+	YY_BREAK
 case 84:
 YY_RULE_SETUP
 #line 366 "pir.l"
 { return TK_SET_YIELD; }
-    YY_BREAK
+	YY_BREAK
 case 85:
 YY_RULE_SETUP
 #line 367 "pir.l"
 { return TK_TAILCALL; }
-    YY_BREAK
+	YY_BREAK
 case 86:
 YY_RULE_SETUP
 #line 370 "pir.l"
@@ -2462,124 +2462,124 @@
                     yypirerror(yyscanner, yypirget_extra(yyscanner),
                                "cannot use '%s' outside of macro definitions", yytext);
                   }
-    YY_BREAK
+	YY_BREAK
 case 87:
 YY_RULE_SETUP
 #line 377 "pir.l"
 { return TK_FLAG_ANON; }
-    YY_BREAK
+	YY_BREAK
 case 88:
 YY_RULE_SETUP
 #line 378 "pir.l"
 { return TK_FLAG_INIT; }
-    YY_BREAK
+	YY_BREAK
 case 89:
 YY_RULE_SETUP
 #line 379 "pir.l"
 { return TK_FLAG_LOAD; }
-    YY_BREAK
+	YY_BREAK
 case 90:
 YY_RULE_SETUP
 #line 380 "pir.l"
 { return TK_FLAG_POSTCOMP; }
-    YY_BREAK
+	YY_BREAK
 case 91:
 YY_RULE_SETUP
 #line 381 "pir.l"
 { return TK_FLAG_IMMEDIATE; }
-    YY_BREAK
+	YY_BREAK
 case 92:
 YY_RULE_SETUP
 #line 382 "pir.l"
 { return TK_FLAG_MAIN; }
-    YY_BREAK
+	YY_BREAK
 case 93:
 YY_RULE_SETUP
 #line 383 "pir.l"
 { return TK_FLAG_METHOD; }
-    YY_BREAK
+	YY_BREAK
 case 94:
 YY_RULE_SETUP
 #line 384 "pir.l"
 { return TK_FLAG_LEX; }
-    YY_BREAK
+	YY_BREAK
 case 95:
 YY_RULE_SETUP
 #line 385 "pir.l"
 { return TK_FLAG_OUTER; }
-    YY_BREAK
+	YY_BREAK
 case 96:
 YY_RULE_SETUP
 #line 386 "pir.l"
 { return TK_FLAG_VTABLE; }
-    YY_BREAK
+	YY_BREAK
 case 97:
 YY_RULE_SETUP
 #line 387 "pir.l"
 { return TK_FLAG_MULTI; }
-    YY_BREAK
+	YY_BREAK
 case 98:
 YY_RULE_SETUP
 #line 388 "pir.l"
 { return TK_FLAG_SUBID; }
-    YY_BREAK
+	YY_BREAK
 case 99:
 YY_RULE_SETUP
 #line 389 "pir.l"
 { return TK_FLAG_INSTANCEOF; }
-    YY_BREAK
+	YY_BREAK
 case 100:
 YY_RULE_SETUP
 #line 390 "pir.l"
 { return TK_FLAG_NSENTRY; }
-    YY_BREAK
+	YY_BREAK
 case 101:
 YY_RULE_SETUP
 #line 392 "pir.l"
 { return TK_FLAG_UNIQUE_REG; }
-    YY_BREAK
+	YY_BREAK
 case 102:
 YY_RULE_SETUP
 #line 393 "pir.l"
 { return TK_FLAG_OPTIONAL; }
-    YY_BREAK
+	YY_BREAK
 case 103:
 YY_RULE_SETUP
 #line 394 "pir.l"
 { return TK_FLAG_OPT_FLAG; }
-    YY_BREAK
+	YY_BREAK
 case 104:
 YY_RULE_SETUP
 #line 395 "pir.l"
 { return TK_FLAG_SLURPY; }
-    YY_BREAK
+	YY_BREAK
 case 105:
 YY_RULE_SETUP
 #line 396 "pir.l"
 { return TK_FLAG_NAMED; }
-    YY_BREAK
+	YY_BREAK
 case 106:
 YY_RULE_SETUP
 #line 397 "pir.l"
 { return TK_FLAG_FLAT; }
-    YY_BREAK
+	YY_BREAK
 case 107:
 YY_RULE_SETUP
 #line 398 "pir.l"
 { return TK_FLAG_INVOCANT; }
-    YY_BREAK
+	YY_BREAK
 case 108:
 YY_RULE_SETUP
 #line 399 "pir.l"
 { return TK_FLAG_LOOKAHEAD; }
-    YY_BREAK
+	YY_BREAK
 case 109:
 YY_RULE_SETUP
 #line 401 "pir.l"
 { yypirerror(yyscanner, yypirget_extra(yyscanner),
                                "unrecognized flag: '%s'", yytext);
                   }
-    YY_BREAK
+	YY_BREAK
 case 110:
 YY_RULE_SETUP
 #line 405 "pir.l"
@@ -2597,20 +2597,32 @@
                     char *str = Parrot_str_to_cstring(lexer->interp, pstr);
 
                     yylval->sval = str;
+                    
+                    /* store the STRING in lexer's sval buffer; once PIRC is doing
+                    only STRINGs, it can be stored in yylval.sval. */
+                    lexer->sval = pstr;
+                    
                     return TK_STRINGC;
                   }
-    YY_BREAK
+	YY_BREAK
 case 111:
 YY_RULE_SETUP
-#line 422 "pir.l"
+#line 427 "pir.l"
 { /* copy the string, remove the quotes. */
-                    yylval->sval = dupstrn(yypirget_extra(yyscanner), yytext + 1, yyleng - 2);
+                    lexer_state * const lexer = yypirget_extra(yyscanner);
+                    
+                    STRING *str = Parrot_str_unescape(lexer->interp, yytext + 1, '\'', "ascii");
+                    lexer->sval = str;
+                    
+                    yylval->sval = dupstrn(lexer, yytext + 1, yyleng - 2);
+
+                    
                     return TK_STRINGC;
                   }
-    YY_BREAK
+	YY_BREAK
 case 112:
 YY_RULE_SETUP
-#line 427 "pir.l"
+#line 439 "pir.l"
 { /* XXX these double-quoted strings are not unescaped (yet) */
                     /* parse yytext, which contains the charset, a ':', and the quoted string */
                     char        *colon = strchr(yytext, ':');
@@ -2639,10 +2651,10 @@
                     yylval->ustr = ustr;
                     return TK_USTRINGC;
                   }
-    YY_BREAK
+	YY_BREAK
 case 113:
 YY_RULE_SETUP
-#line 456 "pir.l"
+#line 468 "pir.l"
 { /* XXX these double-quoted strings are not unescaped (yet) */
                     /* parse yytext, which contains the encoding, a ':', a charset,
                      * a ':', and the quoted string
@@ -2689,38 +2701,42 @@
                     return TK_USTRINGC;
 
                   }
-    YY_BREAK
+	YY_BREAK
 case 114:
 YY_RULE_SETUP
-#line 504 "pir.l"
+#line 516 "pir.l"
 { yylval->ival = atoi(yytext + 2); return TK_PREG; }
-    YY_BREAK
+	YY_BREAK
 case 115:
 YY_RULE_SETUP
-#line 505 "pir.l"
+#line 517 "pir.l"
 { yylval->ival = atoi(yytext + 2); return TK_SREG; }
-    YY_BREAK
+	YY_BREAK
 case 116:
 YY_RULE_SETUP
-#line 506 "pir.l"
+#line 518 "pir.l"
 { yylval->ival = atoi(yytext + 2); return TK_NREG; }
-    YY_BREAK
+	YY_BREAK
 case 117:
 YY_RULE_SETUP
-#line 507 "pir.l"
+#line 519 "pir.l"
 { yylval->ival = atoi(yytext + 2); return TK_IREG; }
-    YY_BREAK
+	YY_BREAK
 case 118:
 YY_RULE_SETUP
-#line 509 "pir.l"
+#line 521 "pir.l"
 { /* make the label Id available in the parser. remove the ":" first. */
+                    lexer_state * const lexer = yypirget_extra(yyscanner);
+                    STRING *str = Parrot_str_new(lexer->interp, yytext, yyleng - 1);
+                    lexer->sval = str;
+                    
                     yylval->sval = dupstrn(yypirget_extra(yyscanner), yytext, yyleng - 1);
                     return TK_LABEL;
                   }
-    YY_BREAK
+	YY_BREAK
 case 119:
 YY_RULE_SETUP
-#line 514 "pir.l"
+#line 530 "pir.l"
 { /* give a warning when using PASM registers as PIR identifiers */
                     lexer_state * const lexer = yypirget_extra(yyscanner);
 
@@ -2732,15 +2748,15 @@
                     yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                     return TK_IDENT;
                   }
-    YY_BREAK
+	YY_BREAK
 case 120:
 YY_RULE_SETUP
-#line 526 "pir.l"
+#line 542 "pir.l"
 { /* identifier; can be a global (sub or const), local or parrot op */
                     lexer_state * const lexer = yypirget_extra(yyscanner);
                     constdecl   * const c = find_global_constant(lexer, yytext);
 
-                    if (c) {
+                    if (c) { /* it's  a global const */
                         switch (c->type) {
                             case INT_VAL:
                                 yylval->ival = c->val.ival;
@@ -2759,42 +2775,43 @@
                                 break;
                         }
                     }
-
+                    lexer->sval = Parrot_str_new(lexer->interp, yytext, yyleng);
+                    					
                     yylval->sval = dupstr(lexer, yytext);
                     return TK_IDENT;
                   }
-    YY_BREAK
+	YY_BREAK
 case 121:
 YY_RULE_SETUP
-#line 554 "pir.l"
+#line 571 "pir.l"
 { yylval->dval = atof(yytext); return TK_NUMC; }
-    YY_BREAK
+	YY_BREAK
 case 122:
 YY_RULE_SETUP
-#line 555 "pir.l"
+#line 572 "pir.l"
 { yylval->ival = atoi(yytext); return TK_INTC; }
-    YY_BREAK
+	YY_BREAK
 case 123:
 YY_RULE_SETUP
-#line 556 "pir.l"
+#line 573 "pir.l"
 { yylval->ival = atoi(yytext); return TK_INTC; }
-    YY_BREAK
+	YY_BREAK
 case 124:
 YY_RULE_SETUP
-#line 557 "pir.l"
+#line 574 "pir.l"
 { yylval->ival = atoi(yytext); return TK_INTC; }
-    YY_BREAK
+	YY_BREAK
 case 125:
 YY_RULE_SETUP
-#line 558 "pir.l"
+#line 575 "pir.l"
 { yylval->ival = atoi(yytext); return TK_INTC; }
-    YY_BREAK
+	YY_BREAK
 case 126:
 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
 yyg->yy_c_buf_p = yy_cp = yy_bp + 1;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
-#line 560 "pir.l"
+#line 577 "pir.l"
 { /* Make sure the dot is followed by a character that
                      * starts a method object. $ for registers,
                      * quotes for quoted strings, and letters for identifiers.
@@ -2802,17 +2819,17 @@
                      */
                      return '.';
                   }
-    YY_BREAK
+	YY_BREAK
 case 127:
 /* rule 127 can match eol */
 YY_RULE_SETUP
-#line 568 "pir.l"
+#line 585 "pir.l"
 { yypirerror(yyscanner, yypirget_extra(yyscanner),
                     "no space allowed before a methodcall dot, "
                     "or space expected after the '.' operator");
                     return '.';
                   }
-    YY_BREAK
+	YY_BREAK
 
 
 /* SCANSTR<<EOF>> and SCANMACRO<<EOF>> must be defined before <INTIAL><<EOF>>,
@@ -2829,15 +2846,15 @@
 
 
 case YY_STATE_EOF(SCANSTR):
-#line 590 "pir.l"
+#line 607 "pir.l"
 { /* switch back from .macro_const buffer to file. */
                      lexer_state * const lexer = yypirget_extra(yyscanner);
                      yy_pop_state(yyscanner);
                      yypir_switch_to_buffer(lexer->buffer,yyscanner);
                    }
-    YY_BREAK
+	YY_BREAK
 case YY_STATE_EOF(SCANMACRO):
-#line 596 "pir.l"
+#line 613 "pir.l"
 { /* override the default <<EOF>> action; go back to normal state and
                       * switch back to the saved file.
                       */
@@ -2860,10 +2877,10 @@
                      delete_macro_table(table);
 
                    }
-    YY_BREAK
+	YY_BREAK
 case 128:
 YY_RULE_SETUP
-#line 619 "pir.l"
+#line 636 "pir.l"
 { /* when scanning a macro body, the @ marker indicates the {IDENT} must
                           * be munged.
                           */
@@ -2872,21 +2889,21 @@
                             yylval->sval              = munge_id(id, lexer);
                             return TK_IDENT;
                        }
-    YY_BREAK
+	YY_BREAK
 case YY_STATE_EOF(INITIAL):
-#line 628 "pir.l"
+#line 645 "pir.l"
 { /* end of file, stop scanning. */
                     yyterminate();
                   }
-    YY_BREAK
+	YY_BREAK
 case 129:
 YY_RULE_SETUP
-#line 632 "pir.l"
+#line 649 "pir.l"
 { /* any character not covered in the rules above is an error. */
                     yypirerror(yyscanner, yypirget_extra(yyscanner),
                                "unexpected character: '%c'", yytext[0]);
                   }
-    YY_BREAK
+	YY_BREAK
 
 
 /*****************************************************************************
@@ -2902,50 +2919,50 @@
 
 case 130:
 YY_RULE_SETUP
-#line 654 "pir.l"
+#line 671 "pir.l"
 {
                                yy_push_state(MACROCONST, yyscanner);
                                return TK_MACRO_CONST;
                              }
-    YY_BREAK
+	YY_BREAK
 case 131:
 YY_RULE_SETUP
-#line 659 "pir.l"
+#line 676 "pir.l"
 {
                                yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                                return TK_IDENT;
                              }
-    YY_BREAK
+	YY_BREAK
 case 132:
 YY_RULE_SETUP
-#line 664 "pir.l"
+#line 681 "pir.l"
 {
                                /* only these tokens can be macro constant values */
                                yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                                yy_pop_state(yyscanner);
                                return TK_MACRO_CONST_VAL;
                              }
-    YY_BREAK
+	YY_BREAK
 case 133:
 YY_RULE_SETUP
-#line 671 "pir.l"
+#line 688 "pir.l"
 { /* ignore whitespace */ }
-    YY_BREAK
+	YY_BREAK
 case 134:
 YY_RULE_SETUP
-#line 672 "pir.l"
+#line 689 "pir.l"
 {
                                yypirerror(yyscanner, yypirget_extra(yyscanner),
                                           "unknown character: '%c'", yytext[0]);
                              }
-    YY_BREAK
+	YY_BREAK
 case YY_STATE_EOF(MACROCONST):
-#line 676 "pir.l"
+#line 693 "pir.l"
 {
                                yypirerror(yyscanner, yypirget_extra(yyscanner),
                                           "read end of file during .macro_const definition");
                              }
-    YY_BREAK
+	YY_BREAK
 
 
 /**************** macro header (.macro <ident> <parameters> ) ***************/
@@ -2953,50 +2970,50 @@
 
 case 135:
 YY_RULE_SETUP
-#line 687 "pir.l"
+#line 704 "pir.l"
 { /* start a macro definition */
                                yy_push_state(MACROHEAD, yyscanner);
                                return TK_MACRO;
                              }
-    YY_BREAK
+	YY_BREAK
 case 136:
 YY_RULE_SETUP
-#line 692 "pir.l"
+#line 709 "pir.l"
 { /* ignore whitespace */ }
-    YY_BREAK
+	YY_BREAK
 case 137:
 YY_RULE_SETUP
-#line 693 "pir.l"
+#line 710 "pir.l"
 {
                                yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                                return TK_IDENT;
                              }
-    YY_BREAK
+	YY_BREAK
 case 138:
 YY_RULE_SETUP
-#line 698 "pir.l"
+#line 715 "pir.l"
 { return '('; }
-    YY_BREAK
+	YY_BREAK
 case 139:
 YY_RULE_SETUP
-#line 699 "pir.l"
+#line 716 "pir.l"
 { return ')'; }
-    YY_BREAK
+	YY_BREAK
 case 140:
 YY_RULE_SETUP
-#line 700 "pir.l"
+#line 717 "pir.l"
 { return ','; }
-    YY_BREAK
+	YY_BREAK
 case 141:
 /* rule 141 can match eol */
 YY_RULE_SETUP
-#line 702 "pir.l"
+#line 719 "pir.l"
 { /* a set of continuous newlines yields a single newline token. */
                                yy_pop_state(yyscanner); /* remove MACROHEAD state */
                                yy_push_state(MACROBODY, yyscanner); /* enter MACROBODY state */
                                return TK_NL;
                              }
-    YY_BREAK
+	YY_BREAK
 
 
 /******************************* macro expansion ***************************/
@@ -3008,7 +3025,7 @@
 
 case 142:
 YY_RULE_SETUP
-#line 718 "pir.l"
+#line 735 "pir.l"
 { /* .foo; it can be a macro, macro_local, or just $P0.foo(),
                                 * but we need to check that.
                                 */
@@ -3062,10 +3079,10 @@
                                    }
                                }
                              }
-    YY_BREAK
+	YY_BREAK
 case 143:
 YY_RULE_SETUP
-#line 772 "pir.l"
+#line 789 "pir.l"
 { /* expand a .macro_const or parameter in argument list */
                                lexer_state * const lexer = yypirget_extra(yyscanner);
                                macro_def   * const macro = find_macro(lexer->macros, yytext + 1);
@@ -3093,85 +3110,85 @@
                                else
                                    yypirerror(yyscanner, lexer, "'%s' is not a macro", yytext + 1);
                              }
-    YY_BREAK
+	YY_BREAK
 case 144:
 YY_RULE_SETUP
-#line 800 "pir.l"
+#line 817 "pir.l"
 {
                                yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                                return TK_MACRO_ARG_IDENT;
                              }
-    YY_BREAK
+	YY_BREAK
 case 145:
 YY_RULE_SETUP
-#line 805 "pir.l"
+#line 822 "pir.l"
 {
                                yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                                return TK_MACRO_ARG_OTHER;
                              }
-    YY_BREAK
+	YY_BREAK
 case 146:
 YY_RULE_SETUP
-#line 810 "pir.l"
+#line 827 "pir.l"
 { /* ignore whitespace */ }
-    YY_BREAK
+	YY_BREAK
 case 147:
 YY_RULE_SETUP
-#line 811 "pir.l"
+#line 828 "pir.l"
 { return ','; }
-    YY_BREAK
+	YY_BREAK
 case 148:
 YY_RULE_SETUP
-#line 812 "pir.l"
+#line 829 "pir.l"
 { return '('; }
-    YY_BREAK
+	YY_BREAK
 case 149:
 YY_RULE_SETUP
-#line 813 "pir.l"
+#line 830 "pir.l"
 {
                                yy_pop_state(yyscanner); /* leave MACROEXPAND state */
                                return ')';
                              }
-    YY_BREAK
+	YY_BREAK
 case 150:
 YY_RULE_SETUP
-#line 818 "pir.l"
+#line 835 "pir.l"
 {
                                yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                                return TK_MACRO_ARG_OTHER;
                              }
-    YY_BREAK
+	YY_BREAK
 case YY_STATE_EOF(STRINGEXPAND):
-#line 823 "pir.l"
+#line 840 "pir.l"
 {
                                lexer_state * const lexer = yypirget_extra(yyscanner);
                                yy_pop_state(yyscanner);
                                yypir_switch_to_buffer(lexer->buffer,yyscanner);
                              }
-    YY_BREAK
+	YY_BREAK
 case 151:
 YY_RULE_SETUP
-#line 829 "pir.l"
+#line 846 "pir.l"
 { return '{'; }
-    YY_BREAK
+	YY_BREAK
 case 152:
 YY_RULE_SETUP
-#line 830 "pir.l"
+#line 847 "pir.l"
 { return '}'; }
-    YY_BREAK
+	YY_BREAK
 case 153:
 /* rule 153 can match eol */
 YY_RULE_SETUP
-#line 832 "pir.l"
+#line 849 "pir.l"
 { yylval->sval = "\n"; return TK_NL; }
-    YY_BREAK
+	YY_BREAK
 case 154:
 YY_RULE_SETUP
-#line 834 "pir.l"
+#line 851 "pir.l"
 { yypirerror(yyscanner, yypirget_extra(yyscanner),
                                           "unknown character in macro expansion: %c", yytext[0]);
                              }
-    YY_BREAK
+	YY_BREAK
 
 
 /******************************** .macro_local *****************************/
@@ -3179,7 +3196,7 @@
 
 case 155:
 YY_RULE_SETUP
-#line 845 "pir.l"
+#line 862 "pir.l"
 { /* give a warning if the right flag is set */
                               /*
                               lexer_state * const lexer = yypirget_extra(yyscanner);
@@ -3192,38 +3209,38 @@
                               Doesn't make sense to use it.
                               */
                             }
-    YY_BREAK
+	YY_BREAK
 case 156:
 YY_RULE_SETUP
-#line 859 "pir.l"
+#line 876 "pir.l"
 {
                               yy_push_state(MACROLOCAL, yyscanner);
                               return TK_MACRO_LOCAL;
                             }
-    YY_BREAK
+	YY_BREAK
 case 157:
 YY_RULE_SETUP
-#line 864 "pir.l"
+#line 881 "pir.l"
 { return TK_INT; }
-    YY_BREAK
+	YY_BREAK
 case 158:
 YY_RULE_SETUP
-#line 865 "pir.l"
+#line 882 "pir.l"
 { return TK_PMC; }
-    YY_BREAK
+	YY_BREAK
 case 159:
 YY_RULE_SETUP
-#line 866 "pir.l"
+#line 883 "pir.l"
 { return TK_NUM; }
-    YY_BREAK
+	YY_BREAK
 case 160:
 YY_RULE_SETUP
-#line 867 "pir.l"
+#line 884 "pir.l"
 { return TK_STRING; }
-    YY_BREAK
+	YY_BREAK
 case 161:
 YY_RULE_SETUP
-#line 869 "pir.l"
+#line 886 "pir.l"
 { /* normal .macro_local */
                               lexer_state * const lexer = yypirget_extra(yyscanner);
                               /* reserve space for {IDENT}, the @ marker and the NULL char. */
@@ -3238,10 +3255,10 @@
                               declare_macro_local(CURRENT_MACRO(lexer), dupstr(lexer, yytext));
                               return TK_MACRO_LOCAL_ID;
                             }
-    YY_BREAK
+	YY_BREAK
 case 162:
 YY_RULE_SETUP
-#line 884 "pir.l"
+#line 901 "pir.l"
 { /* declare a .macro_local based on a parameter */
                               lexer_state * const lexer = yypirget_extra(yyscanner);
 
@@ -3255,10 +3272,10 @@
                               return TK_MACRO_LOCAL_ID;
 
                             }
-    YY_BREAK
+	YY_BREAK
 case 163:
 YY_RULE_SETUP
-#line 898 "pir.l"
+#line 915 "pir.l"
 { /* .$foo */
                               lexer_state * const lexer = yypirget_extra(yyscanner);
                               macro_table * const table = peek_macro_table(lexer);
@@ -3287,10 +3304,10 @@
                               }
 
                             }
-    YY_BREAK
+	YY_BREAK
 case 164:
 YY_RULE_SETUP
-#line 927 "pir.l"
+#line 944 "pir.l"
 { /* expanding a .macro_local using a macro parameter value */
                              lexer_state * const lexer     = yypirget_extra(yyscanner);
                              char  const * const paramname = dupstrn(lexer, yytext + 1, yyleng - 2);
@@ -3315,29 +3332,29 @@
 
                              return TK_IDENT;
                            }
-    YY_BREAK
+	YY_BREAK
 case 165:
 YY_RULE_SETUP
-#line 952 "pir.l"
+#line 969 "pir.l"
 { /* ignore whitespace */ }
-    YY_BREAK
+	YY_BREAK
 case 166:
 /* rule 166 can match eol */
 YY_RULE_SETUP
-#line 954 "pir.l"
+#line 971 "pir.l"
 { /* newline after .macro_local <type> <ident> line */
                               yy_pop_state(yyscanner);
                               return TK_NL;
                             }
-    YY_BREAK
+	YY_BREAK
 case 167:
 YY_RULE_SETUP
-#line 959 "pir.l"
+#line 976 "pir.l"
 { /* this state is only used for declaring .macro_locals */
                               yypirerror(yyscanner, yypirget_extra(yyscanner),
                                  "unknown character '%c' when declaring .macro_local", yytext[0]);
                             }
-    YY_BREAK
+	YY_BREAK
 
 
 /****************************** .macro_label ********************************/
@@ -3345,15 +3362,15 @@
 
 case 168:
 YY_RULE_SETUP
-#line 969 "pir.l"
+#line 986 "pir.l"
 {
                               yy_push_state(MACROLABEL, yyscanner);
                               return TK_MACRO_LABEL;
                             }
-    YY_BREAK
+	YY_BREAK
 case 169:
 YY_RULE_SETUP
-#line 974 "pir.l"
+#line 991 "pir.l"
 { /* if the "$" is there, it's a macro label using a macro
                                * parameter's value; otherwise it's a normal macro label
                                */
@@ -3370,29 +3387,29 @@
                               declare_macro_local(CURRENT_MACRO(lexer), dupstr(lexer, yytext));
                               return TK_MACRO_LABEL_ID;
                             }
-    YY_BREAK
+	YY_BREAK
 case 170:
 /* rule 170 can match eol */
 YY_RULE_SETUP
-#line 992 "pir.l"
+#line 1009 "pir.l"
 { /* the newline character after a ".macro_label $foo:" declaration */
                               yy_pop_state(yyscanner); /* leave MACROLABEL state */
                               return TK_NL;
                             }
-    YY_BREAK
+	YY_BREAK
 case 171:
 YY_RULE_SETUP
-#line 998 "pir.l"
+#line 1015 "pir.l"
 { /* scan a label when expanding a buffer; declared as .macro_label */
                               lexer_state * const lexer = yypirget_extra(yyscanner);
                               char const  * const label = dupstrn(lexer, yytext, yyleng - 2);
                               yylval->sval = munge_id(label, lexer);
                               return TK_LABEL;
                             }
-    YY_BREAK
+	YY_BREAK
 case 172:
 YY_RULE_SETUP
-#line 1005 "pir.l"
+#line 1022 "pir.l"
 { /* scan a label when expanding macro; was a macro parameter */
                              lexer_state * const lexer     = yypirget_extra(yyscanner);
                              char const  * const paramname = dupstrn(lexer, yytext + 1, yyleng - 3);
@@ -3418,7 +3435,7 @@
                              }
                              return TK_LABEL;
                            }
-    YY_BREAK
+	YY_BREAK
 
 
 /*************************** macro body scanning (storing) ****************************/
@@ -3427,31 +3444,31 @@
 case 173:
 /* rule 173 can match eol */
 YY_RULE_SETUP
-#line 1038 "pir.l"
+#line 1055 "pir.l"
 { store_macro_char(CURRENT_MACRO(yypirget_extra(yyscanner)), '\n'); }
-    YY_BREAK
+	YY_BREAK
 case 174:
 YY_RULE_SETUP
-#line 1040 "pir.l"
+#line 1057 "pir.l"
 {
                                yy_pop_state(yyscanner); /* leave MACROBODY state */
                                return TK_ENDM;
                              }
-    YY_BREAK
+	YY_BREAK
 case 175:
 YY_RULE_SETUP
-#line 1045 "pir.l"
+#line 1062 "pir.l"
 { /* store everything else */
                                store_macro_char(CURRENT_MACRO(yypirget_extra(yyscanner)), yytext[0]);
                              }
-    YY_BREAK
+	YY_BREAK
 case YY_STATE_EOF(MACROBODY):
-#line 1049 "pir.l"
+#line 1066 "pir.l"
 { /* catch run-away macro bodys */
                                yypirerror(yyscanner, yypirget_extra(yyscanner),
                                           "read end of file while reading macro body");
                              }
-    YY_BREAK
+	YY_BREAK
  /*
 {WS}"."           {
                     yypirerror(yyscanner, yypirget_extra(yyscanner),
@@ -3478,93 +3495,93 @@
 
 case 176:
 YY_RULE_SETUP
-#line 1081 "pir.l"
+#line 1098 "pir.l"
 { return ','; }
-    YY_BREAK
+	YY_BREAK
 case 177:
 YY_RULE_SETUP
-#line 1082 "pir.l"
+#line 1099 "pir.l"
 { return '['; }
-    YY_BREAK
+	YY_BREAK
 case 178:
 YY_RULE_SETUP
-#line 1083 "pir.l"
+#line 1100 "pir.l"
 { return ']'; }
-    YY_BREAK
+	YY_BREAK
 case 179:
 YY_RULE_SETUP
-#line 1085 "pir.l"
+#line 1102 "pir.l"
 { return TK_FLAG_MAIN; }
-    YY_BREAK
+	YY_BREAK
 case 180:
 YY_RULE_SETUP
-#line 1086 "pir.l"
+#line 1103 "pir.l"
 { return TK_FLAG_LOAD; }
-    YY_BREAK
+	YY_BREAK
 case 181:
 YY_RULE_SETUP
-#line 1087 "pir.l"
+#line 1104 "pir.l"
 { return TK_FLAG_INIT; }
-    YY_BREAK
+	YY_BREAK
 case 182:
 YY_RULE_SETUP
-#line 1088 "pir.l"
+#line 1105 "pir.l"
 { return TK_FLAG_ANON; }
-    YY_BREAK
+	YY_BREAK
 case 183:
 YY_RULE_SETUP
-#line 1089 "pir.l"
+#line 1106 "pir.l"
 { return TK_FLAG_POSTCOMP; }
-    YY_BREAK
+	YY_BREAK
 case 184:
 YY_RULE_SETUP
-#line 1090 "pir.l"
+#line 1107 "pir.l"
 { return TK_FLAG_IMMEDIATE; }
-    YY_BREAK
+	YY_BREAK
 case 185:
 YY_RULE_SETUP
-#line 1092 "pir.l"
+#line 1109 "pir.l"
 { return TK_PCC_SUB; }
-    YY_BREAK
+	YY_BREAK
 case 186:
 YY_RULE_SETUP
-#line 1093 "pir.l"
+#line 1110 "pir.l"
 { return TK_LEX; }
-    YY_BREAK
+	YY_BREAK
 case 187:
 YY_RULE_SETUP
-#line 1094 "pir.l"
+#line 1111 "pir.l"
 { return TK_NAMESPACE; }
-    YY_BREAK
+	YY_BREAK
 case 188:
 YY_RULE_SETUP
-#line 1096 "pir.l"
+#line 1113 "pir.l"
 {
                           yy_push_state(MACROHEAD, yyscanner);
                           return TK_MACRO;
                         }
-    YY_BREAK
+	YY_BREAK
 case 189:
 YY_RULE_SETUP
-#line 1101 "pir.l"
+#line 1118 "pir.l"
 {
                           yy_push_state(MACROCONST, yyscanner);
                           return TK_MACRO_CONST;
                         }
-    YY_BREAK
+	YY_BREAK
 case 190:
 YY_RULE_SETUP
-#line 1106 "pir.l"
+#line 1123 "pir.l"
 { return TK_LINE; }
-    YY_BREAK
+	YY_BREAK
 case 191:
 YY_RULE_SETUP
-#line 1107 "pir.l"
+#line 1124 "pir.l"
 { return TK_FILE; }
-    YY_BREAK
+	YY_BREAK
 case 192:
 YY_RULE_SETUP
-#line 1110 "pir.l"
+#line 1127 "pir.l"
 { /* macro expansion in PASM mode. */
                           lexer_state * const lexer = yypirget_extra(yyscanner);
                           macro_def   * const macro = find_macro(lexer->macros, yytext + 1);
@@ -3598,247 +3615,247 @@
                               }
                           }
                         }
-    YY_BREAK
+	YY_BREAK
 case 193:
 YY_RULE_SETUP
-#line 1144 "pir.l"
+#line 1161 "pir.l"
 { /* a label in PASM */
                           yylval->sval = dupstrn(yypirget_extra(yyscanner), yytext, yyleng - 1);
                           return TK_LABEL;
                         }
-    YY_BREAK
+	YY_BREAK
 case 194:
 YY_RULE_SETUP
-#line 1149 "pir.l"
+#line 1166 "pir.l"
 { yypirerror(yyscanner, yypirget_extra(yyscanner),
                                      "symbolic registers are not allowed in PASM mode");
                         }
-    YY_BREAK
+	YY_BREAK
 case 195:
 YY_RULE_SETUP
-#line 1152 "pir.l"
+#line 1169 "pir.l"
 { yylval->ival = atoi(yytext + 1); return TK_PREG; }
-    YY_BREAK
+	YY_BREAK
 case 196:
 YY_RULE_SETUP
-#line 1153 "pir.l"
+#line 1170 "pir.l"
 { yylval->ival = atoi(yytext + 1); return TK_NREG; }
-    YY_BREAK
+	YY_BREAK
 case 197:
 YY_RULE_SETUP
-#line 1154 "pir.l"
+#line 1171 "pir.l"
 { yylval->ival = atoi(yytext + 1); return TK_IREG; }
-    YY_BREAK
+	YY_BREAK
 case 198:
 YY_RULE_SETUP
-#line 1155 "pir.l"
+#line 1172 "pir.l"
 { yylval->ival = atoi(yytext + 1); return TK_SREG; }
-    YY_BREAK
+	YY_BREAK
 case 199:
 YY_RULE_SETUP
-#line 1157 "pir.l"
+#line 1174 "pir.l"
 { /* can be a parrot op or a label; the check is done in the parser. */
                           yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                           return TK_IDENT;
                         }
-    YY_BREAK
+	YY_BREAK
 case 200:
 YY_RULE_SETUP
-#line 1162 "pir.l"
+#line 1179 "pir.l"
 { yylval->dval = atof(yytext); return TK_NUMC; }
-    YY_BREAK
+	YY_BREAK
 case 201:
 YY_RULE_SETUP
-#line 1163 "pir.l"
+#line 1180 "pir.l"
 { yylval->ival = atoi(yytext); return TK_INTC; }
-    YY_BREAK
+	YY_BREAK
 case 202:
 YY_RULE_SETUP
-#line 1164 "pir.l"
+#line 1181 "pir.l"
 { yylval->ival = atoi(yytext); return TK_INTC; }
-    YY_BREAK
+	YY_BREAK
 case 203:
 YY_RULE_SETUP
-#line 1165 "pir.l"
+#line 1182 "pir.l"
 { yylval->ival = atoi(yytext); return TK_INTC; }
-    YY_BREAK
+	YY_BREAK
 case 204:
 YY_RULE_SETUP
-#line 1166 "pir.l"
+#line 1183 "pir.l"
 { yylval->ival = atoi(yytext); return TK_INTC; }
-    YY_BREAK
+	YY_BREAK
 case 205:
 YY_RULE_SETUP
-#line 1168 "pir.l"
+#line 1185 "pir.l"
 { /* copy the string, remove the quotes. */
                           yylval->sval = dupstrn(yypirget_extra(yyscanner), yytext + 1, yyleng - 2);
                           return TK_STRINGC;
                         }
-    YY_BREAK
+	YY_BREAK
 case 206:
 YY_RULE_SETUP
-#line 1173 "pir.l"
+#line 1190 "pir.l"
 { /* ignore whitespace */ }
-    YY_BREAK
+	YY_BREAK
 case 207:
 /* rule 207 can match eol */
 YY_RULE_SETUP
-#line 1175 "pir.l"
+#line 1192 "pir.l"
 { return TK_NL; }
-    YY_BREAK
+	YY_BREAK
 case 208:
 YY_RULE_SETUP
-#line 1177 "pir.l"
+#line 1194 "pir.l"
 { yypirerror(yyscanner, yypirget_extra(yyscanner),
                                      "unrecognized character: %c", yytext[0]);
                         }
-    YY_BREAK
+	YY_BREAK
 case YY_STATE_EOF(PASM):
-#line 1180 "pir.l"
+#line 1197 "pir.l"
 { yyterminate(); }
-    YY_BREAK
+	YY_BREAK
 case 209:
 YY_RULE_SETUP
-#line 1182 "pir.l"
+#line 1199 "pir.l"
 ECHO;
-    YY_BREAK
-#line 3706 "pirlexer.c"
+	YY_BREAK
+#line 3723 "pirlexer.c"
 case YY_STATE_EOF(MACROHEAD):
 case YY_STATE_EOF(MACROLOCAL):
 case YY_STATE_EOF(MACROLABEL):
 case YY_STATE_EOF(MACROEXPAND):
 case YY_STATE_EOF(SPECIALSTART):
-    yyterminate();
+	yyterminate();
 
-    case YY_END_OF_BUFFER:
-        {
-        /* Amount of text matched not including the EOB char. */
-        int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
-
-        /* Undo the effects of YY_DO_BEFORE_ACTION. */
-        *yy_cp = yyg->yy_hold_char;
-        YY_RESTORE_YY_MORE_OFFSET
-
-        if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
-            {
-            /* We're scanning a new file or input source.  It's
-             * possible that this happened because the user
-             * just pointed yyin at a new source and called
-             * yypirlex().  If so, then we have to assure
-             * consistency between YY_CURRENT_BUFFER and our
-             * globals.  Here is the right place to do so, because
-             * this is the first action (other than possibly a
-             * back-up) that will match for the new input source.
-             */
-            yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-            YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
-            YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
-            }
-
-        /* Note that here we test for yy_c_buf_p "<=" to the position
-         * of the first EOB in the buffer, since yy_c_buf_p will
-         * already have been incremented past the NUL character
-         * (since all states make transitions on EOB to the
-         * end-of-buffer state).  Contrast this with the test
-         * in input().
-         */
-        if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
-            { /* This was really a NUL. */
-            yy_state_type yy_next_state;
-
-            yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
-
-            yy_current_state = yy_get_previous_state( yyscanner );
-
-            /* Okay, we're now positioned to make the NUL
-             * transition.  We couldn't have
-             * yy_get_previous_state() go ahead and do it
-             * for us because it doesn't know how to deal
-             * with the possibility of jamming (and we don't
-             * want to build jamming into it because then it
-             * will run more slowly).
-             */
-
-            yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
-
-            yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-
-            if ( yy_next_state )
-                {
-                /* Consume the NUL. */
-                yy_cp = ++yyg->yy_c_buf_p;
-                yy_current_state = yy_next_state;
-                goto yy_match;
-                }
+	case YY_END_OF_BUFFER:
+		{
+		/* Amount of text matched not including the EOB char. */
+		int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
+
+		/* Undo the effects of YY_DO_BEFORE_ACTION. */
+		*yy_cp = yyg->yy_hold_char;
+		YY_RESTORE_YY_MORE_OFFSET
+
+		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+			{
+			/* We're scanning a new file or input source.  It's
+			 * possible that this happened because the user
+			 * just pointed yyin at a new source and called
+			 * yypirlex().  If so, then we have to assure
+			 * consistency between YY_CURRENT_BUFFER and our
+			 * globals.  Here is the right place to do so, because
+			 * this is the first action (other than possibly a
+			 * back-up) that will match for the new input source.
+			 */
+			yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+			YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+			}
+
+		/* Note that here we test for yy_c_buf_p "<=" to the position
+		 * of the first EOB in the buffer, since yy_c_buf_p will
+		 * already have been incremented past the NUL character
+		 * (since all states make transitions on EOB to the
+		 * end-of-buffer state).  Contrast this with the test
+		 * in input().
+		 */
+		if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
+			{ /* This was really a NUL. */
+			yy_state_type yy_next_state;
+
+			yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
+
+			yy_current_state = yy_get_previous_state( yyscanner );
+
+			/* Okay, we're now positioned to make the NUL
+			 * transition.  We couldn't have
+			 * yy_get_previous_state() go ahead and do it
+			 * for us because it doesn't know how to deal
+			 * with the possibility of jamming (and we don't
+			 * want to build jamming into it because then it
+			 * will run more slowly).
+			 */
+
+			yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
+
+			yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+
+			if ( yy_next_state )
+				{
+				/* Consume the NUL. */
+				yy_cp = ++yyg->yy_c_buf_p;
+				yy_current_state = yy_next_state;
+				goto yy_match;
+				}
 
-            else
-                {
+			else
+				{
 /* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
-                yy_cp = yyg->yy_last_accepting_cpos;
-                yy_current_state = yyg->yy_last_accepting_state;
-                goto yy_find_action;
-                }
-            }
-
-        else switch ( yy_get_next_buffer( yyscanner ) )
-            {
-            case EOB_ACT_END_OF_FILE:
-                {
-                yyg->yy_did_buffer_switch_on_eof = 0;
-
-                if ( yypirwrap(yyscanner ) )
-                    {
-                    /* Note: because we've taken care in
-                     * yy_get_next_buffer() to have set up
-                     * yytext, we can now set up
-                     * yy_c_buf_p so that if some total
-                     * hoser (like flex itself) wants to
-                     * call the scanner after we return the
-                     * YY_NULL, it'll still work - another
-                     * YY_NULL will get returned.
-                     */
-                    yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
-
-                    yy_act = YY_STATE_EOF(YY_START);
-                    goto do_action;
-                    }
-
-                else
-                    {
-                    if ( ! yyg->yy_did_buffer_switch_on_eof )
-                        YY_NEW_FILE;
-                    }
-                break;
-                }
-
-            case EOB_ACT_CONTINUE_SCAN:
-                yyg->yy_c_buf_p =
-                    yyg->yytext_ptr + yy_amount_of_matched_text;
-
-                yy_current_state = yy_get_previous_state( yyscanner );
-
-                yy_cp = yyg->yy_c_buf_p;
-                yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-                goto yy_match;
-
-            case EOB_ACT_LAST_MATCH:
-                yyg->yy_c_buf_p =
-                &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
-
-                yy_current_state = yy_get_previous_state( yyscanner );
-
-                yy_cp = yyg->yy_c_buf_p;
-                yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-                goto yy_find_action;
-            }
-        break;
-        }
-
-    default:
-        YY_FATAL_ERROR(
-            "fatal flex scanner internal error--no action found" );
-    } /* end of action switch */
-        } /* end of scanning one token */
+				yy_cp = yyg->yy_last_accepting_cpos;
+				yy_current_state = yyg->yy_last_accepting_state;
+				goto yy_find_action;
+				}
+			}
+
+		else switch ( yy_get_next_buffer( yyscanner ) )
+			{
+			case EOB_ACT_END_OF_FILE:
+				{
+				yyg->yy_did_buffer_switch_on_eof = 0;
+
+				if ( yypirwrap(yyscanner ) )
+					{
+					/* Note: because we've taken care in
+					 * yy_get_next_buffer() to have set up
+					 * yytext, we can now set up
+					 * yy_c_buf_p so that if some total
+					 * hoser (like flex itself) wants to
+					 * call the scanner after we return the
+					 * YY_NULL, it'll still work - another
+					 * YY_NULL will get returned.
+					 */
+					yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
+
+					yy_act = YY_STATE_EOF(YY_START);
+					goto do_action;
+					}
+
+				else
+					{
+					if ( ! yyg->yy_did_buffer_switch_on_eof )
+						YY_NEW_FILE;
+					}
+				break;
+				}
+
+			case EOB_ACT_CONTINUE_SCAN:
+				yyg->yy_c_buf_p =
+					yyg->yytext_ptr + yy_amount_of_matched_text;
+
+				yy_current_state = yy_get_previous_state( yyscanner );
+
+				yy_cp = yyg->yy_c_buf_p;
+				yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+				goto yy_match;
+
+			case EOB_ACT_LAST_MATCH:
+				yyg->yy_c_buf_p =
+				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
+
+				yy_current_state = yy_get_previous_state( yyscanner );
+
+				yy_cp = yyg->yy_c_buf_p;
+				yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+				goto yy_find_action;
+			}
+		break;
+		}
+
+	default:
+		YY_FATAL_ERROR(
+			"fatal flex scanner internal error--no action found" );
+	} /* end of action switch */
+		} /* end of scanning one token */
 } /* end of yypirlex */
 /* %ok-for-header */
 
@@ -3852,9 +3869,9 @@
 /* yy_get_next_buffer - try to read in a new buffer
  *
  * Returns a code representing an action:
- *  EOB_ACT_LAST_MATCH -
- *  EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- *  EOB_ACT_END_OF_FILE - end of file
+ *	EOB_ACT_LAST_MATCH -
+ *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ *	EOB_ACT_END_OF_FILE - end of file
  */
 /* %if-c-only */
 static int yy_get_next_buffer (yyscan_t yyscanner)
@@ -3863,134 +3880,134 @@
 /* %endif */
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
-    register char *source = yyg->yytext_ptr;
-    register int number_to_move, i;
-    int ret_val;
-
-    if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
-        YY_FATAL_ERROR(
-        "fatal flex scanner internal error--end of buffer missed" );
-
-    if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
-        { /* Don't try to fill the buffer, so this is an EOF. */
-        if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
-            {
-            /* We matched a single character, the EOB, so
-             * treat this as a final EOF.
-             */
-            return EOB_ACT_END_OF_FILE;
-            }
-
-        else
-            {
-            /* We matched some text prior to the EOB, first
-             * process it.
-             */
-            return EOB_ACT_LAST_MATCH;
-            }
-        }
-
-    /* Try to read more data. */
-
-    /* First move last chars to start of buffer. */
-    number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
-
-    for ( i = 0; i < number_to_move; ++i )
-        *(dest++) = *(source++);
-
-    if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
-        /* don't do the read, it's not guaranteed to return an EOF,
-         * just force an EOF
-         */
-        YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
-
-    else
-        {
-            int num_to_read =
-            YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
-
-        while ( num_to_read <= 0 )
-            { /* Not enough room in the buffer - grow it. */
-
-            /* just a shorter name for the current buffer */
-            YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
-
-            int yy_c_buf_p_offset =
-                (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
-
-            if ( b->yy_is_our_buffer )
-                {
-                int new_size = b->yy_buf_size * 2;
-
-                if ( new_size <= 0 )
-                    b->yy_buf_size += b->yy_buf_size / 8;
-                else
-                    b->yy_buf_size *= 2;
-
-                b->yy_ch_buf = (char *)
-                    /* Include room in for 2 EOB chars. */
-                    yypirrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
-                }
-            else
-                /* Can't grow it, we don't own it. */
-                b->yy_ch_buf = 0;
-
-            if ( ! b->yy_ch_buf )
-                YY_FATAL_ERROR(
-                "fatal error - scanner input buffer overflow" );
-
-            yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
-
-            num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
-                        number_to_move - 1;
-
-            }
-
-        if ( num_to_read > YY_READ_BUF_SIZE )
-            num_to_read = YY_READ_BUF_SIZE;
-
-        /* Read in more data. */
-        YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-            yyg->yy_n_chars, (size_t) num_to_read );
-
-        YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
-        }
-
-    if ( yyg->yy_n_chars == 0 )
-        {
-        if ( number_to_move == YY_MORE_ADJ )
-            {
-            ret_val = EOB_ACT_END_OF_FILE;
-            yypirrestart(yyin  ,yyscanner);
-            }
-
-        else
-            {
-            ret_val = EOB_ACT_LAST_MATCH;
-            YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
-                YY_BUFFER_EOF_PENDING;
-            }
-        }
-
-    else
-        ret_val = EOB_ACT_CONTINUE_SCAN;
-
-    if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
-        /* Extend the array by 50%, plus the number we really need. */
-        yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
-        YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yypirrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
-        if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-            YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
-    }
-
-    yyg->yy_n_chars += number_to_move;
-    YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
-    YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+	register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+	register char *source = yyg->yytext_ptr;
+	register int number_to_move, i;
+	int ret_val;
+
+	if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
+		YY_FATAL_ERROR(
+		"fatal flex scanner internal error--end of buffer missed" );
+
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+		{ /* Don't try to fill the buffer, so this is an EOF. */
+		if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
+			{
+			/* We matched a single character, the EOB, so
+			 * treat this as a final EOF.
+			 */
+			return EOB_ACT_END_OF_FILE;
+			}
+
+		else
+			{
+			/* We matched some text prior to the EOB, first
+			 * process it.
+			 */
+			return EOB_ACT_LAST_MATCH;
+			}
+		}
+
+	/* Try to read more data. */
+
+	/* First move last chars to start of buffer. */
+	number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
+
+	for ( i = 0; i < number_to_move; ++i )
+		*(dest++) = *(source++);
+
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+		/* don't do the read, it's not guaranteed to return an EOF,
+		 * just force an EOF
+		 */
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
+
+	else
+		{
+			yy_size_t num_to_read =
+			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+		while ( num_to_read <= 0 )
+			{ /* Not enough room in the buffer - grow it. */
+
+			/* just a shorter name for the current buffer */
+			YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+
+			int yy_c_buf_p_offset =
+				(int) (yyg->yy_c_buf_p - b->yy_ch_buf);
+
+			if ( b->yy_is_our_buffer )
+				{
+				yy_size_t new_size = b->yy_buf_size * 2;
+
+				if ( new_size <= 0 )
+					b->yy_buf_size += b->yy_buf_size / 8;
+				else
+					b->yy_buf_size *= 2;
+
+				b->yy_ch_buf = (char *)
+					/* Include room in for 2 EOB chars. */
+					yypirrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
+				}
+			else
+				/* Can't grow it, we don't own it. */
+				b->yy_ch_buf = 0;
+
+			if ( ! b->yy_ch_buf )
+				YY_FATAL_ERROR(
+				"fatal error - scanner input buffer overflow" );
+
+			yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+						number_to_move - 1;
+
+			}
+
+		if ( num_to_read > YY_READ_BUF_SIZE )
+			num_to_read = YY_READ_BUF_SIZE;
+
+		/* Read in more data. */
+		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+			yyg->yy_n_chars, num_to_read );
+
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+		}
+
+	if ( yyg->yy_n_chars == 0 )
+		{
+		if ( number_to_move == YY_MORE_ADJ )
+			{
+			ret_val = EOB_ACT_END_OF_FILE;
+			yypirrestart(yyin  ,yyscanner);
+			}
+
+		else
+			{
+			ret_val = EOB_ACT_LAST_MATCH;
+			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+				YY_BUFFER_EOF_PENDING;
+			}
+		}
+
+	else
+		ret_val = EOB_ACT_CONTINUE_SCAN;
+
+	if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+		/* Extend the array by 50%, plus the number we really need. */
+		yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
+		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yypirrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
+		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+	}
+
+	yyg->yy_n_chars += number_to_move;
+	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
 
-    yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+	yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
 
-    return ret_val;
+	return ret_val;
 }
 
 /* yy_get_previous_state - get the state just before the EOB char was reached */
@@ -4003,38 +4020,38 @@
 /* %if-c++-only */
 /* %endif */
 {
-    register yy_state_type yy_current_state;
-    register char *yy_cp;
+	register yy_state_type yy_current_state;
+	register char *yy_cp;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
 /* %% [15.0] code to get the start state into yy_current_state goes here */
-    yy_current_state = yyg->yy_start;
+	yy_current_state = yyg->yy_start;
 
-    for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
-        {
+	for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
+		{
 /* %% [16.0] code to find the next state goes here */
-        register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
-        if ( yy_accept[yy_current_state] )
-            {
-            yyg->yy_last_accepting_state = yy_current_state;
-            yyg->yy_last_accepting_cpos = yy_cp;
-            }
-        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-            {
-            yy_current_state = (int) yy_def[yy_current_state];
-            if ( yy_current_state >= 825 )
-                yy_c = yy_meta[(unsigned int) yy_c];
-            }
-        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-        }
+		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+		if ( yy_accept[yy_current_state] )
+			{
+			yyg->yy_last_accepting_state = yy_current_state;
+			yyg->yy_last_accepting_cpos = yy_cp;
+			}
+		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+			{
+			yy_current_state = (int) yy_def[yy_current_state];
+			if ( yy_current_state >= 825 )
+				yy_c = yy_meta[(unsigned int) yy_c];
+			}
+		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+		}
 
-    return yy_current_state;
+	return yy_current_state;
 }
 
 /* yy_try_NUL_trans - try to make a transition on the NUL character
  *
  * synopsis
- *  next_state = yy_try_NUL_trans( current_state );
+ *	next_state = yy_try_NUL_trans( current_state );
  */
 /* %if-c-only */
     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
@@ -4042,27 +4059,27 @@
 /* %if-c++-only */
 /* %endif */
 {
-    register int yy_is_jam;
+	register int yy_is_jam;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
 /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
-    register char *yy_cp = yyg->yy_c_buf_p;
+	register char *yy_cp = yyg->yy_c_buf_p;
 
-    register YY_CHAR yy_c = 1;
-    if ( yy_accept[yy_current_state] )
-        {
-        yyg->yy_last_accepting_state = yy_current_state;
-        yyg->yy_last_accepting_cpos = yy_cp;
-        }
-    while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-        {
-        yy_current_state = (int) yy_def[yy_current_state];
-        if ( yy_current_state >= 825 )
-            yy_c = yy_meta[(unsigned int) yy_c];
-        }
-    yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-    yy_is_jam = (yy_current_state == 824);
+	register YY_CHAR yy_c = 1;
+	if ( yy_accept[yy_current_state] )
+		{
+		yyg->yy_last_accepting_state = yy_current_state;
+		yyg->yy_last_accepting_cpos = yy_cp;
+		}
+	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+		{
+		yy_current_state = (int) yy_def[yy_current_state];
+		if ( yy_current_state >= 825 )
+			yy_c = yy_meta[(unsigned int) yy_c];
+		}
+	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+	yy_is_jam = (yy_current_state == 824);
 
-    return yy_is_jam ? 0 : yy_current_state;
+	return yy_is_jam ? 0 : yy_current_state;
 }
 
 /* %if-c-only */
@@ -4081,81 +4098,81 @@
 /* %if-c++-only */
 /* %endif */
 {
-    int c;
+	int c;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-    *yyg->yy_c_buf_p = yyg->yy_hold_char;
-
-    if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
-        {
-        /* yy_c_buf_p now points to the character we want to return.
-         * If this occurs *before* the EOB characters, then it's a
-         * valid NUL; if not, then we've hit the end of the buffer.
-         */
-        if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
-            /* This was really a NUL. */
-            *yyg->yy_c_buf_p = '\0';
-
-        else
-            { /* need more input */
-            int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
-            ++yyg->yy_c_buf_p;
-
-            switch ( yy_get_next_buffer( yyscanner ) )
-                {
-                case EOB_ACT_LAST_MATCH:
-                    /* This happens because yy_g_n_b()
-                     * sees that we've accumulated a
-                     * token and flags that we need to
-                     * try matching the token before
-                     * proceeding.  But for input(),
-                     * there's no matching to consider.
-                     * So convert the EOB_ACT_LAST_MATCH
-                     * to EOB_ACT_END_OF_FILE.
-                     */
-
-                    /* Reset buffer status. */
-                    yypirrestart(yyin ,yyscanner);
+	*yyg->yy_c_buf_p = yyg->yy_hold_char;
 
-                    /*FALLTHROUGH*/
+	if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+		{
+		/* yy_c_buf_p now points to the character we want to return.
+		 * If this occurs *before* the EOB characters, then it's a
+		 * valid NUL; if not, then we've hit the end of the buffer.
+		 */
+		if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
+			/* This was really a NUL. */
+			*yyg->yy_c_buf_p = '\0';
+
+		else
+			{ /* need more input */
+			yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+			++yyg->yy_c_buf_p;
+
+			switch ( yy_get_next_buffer( yyscanner ) )
+				{
+				case EOB_ACT_LAST_MATCH:
+					/* This happens because yy_g_n_b()
+					 * sees that we've accumulated a
+					 * token and flags that we need to
+					 * try matching the token before
+					 * proceeding.  But for input(),
+					 * there's no matching to consider.
+					 * So convert the EOB_ACT_LAST_MATCH
+					 * to EOB_ACT_END_OF_FILE.
+					 */
+
+					/* Reset buffer status. */
+					yypirrestart(yyin ,yyscanner);
+
+					/*FALLTHROUGH*/
+
+				case EOB_ACT_END_OF_FILE:
+					{
+					if ( yypirwrap(yyscanner ) )
+						return 0;
 
-                case EOB_ACT_END_OF_FILE:
-                    {
-                    if ( yypirwrap(yyscanner ) )
-                        return EOF;
-
-                    if ( ! yyg->yy_did_buffer_switch_on_eof )
-                        YY_NEW_FILE;
+					if ( ! yyg->yy_did_buffer_switch_on_eof )
+						YY_NEW_FILE;
 #ifdef __cplusplus
-                    return yyinput(yyscanner);
+					return yyinput(yyscanner);
 #else
-                    return input(yyscanner);
+					return input(yyscanner);
 #endif
-                    }
+					}
 
-                case EOB_ACT_CONTINUE_SCAN:
-                    yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
-                    break;
-                }
-            }
-        }
-
-    c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
-    *yyg->yy_c_buf_p = '\0';    /* preserve yytext */
-    yyg->yy_hold_char = *++yyg->yy_c_buf_p;
+				case EOB_ACT_CONTINUE_SCAN:
+					yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
+					break;
+				}
+			}
+		}
+
+	c = *(unsigned char *) yyg->yy_c_buf_p;	/* cast for 8-bit char's */
+	*yyg->yy_c_buf_p = '\0';	/* preserve yytext */
+	yyg->yy_hold_char = *++yyg->yy_c_buf_p;
 
 /* %% [19.0] update BOL and yylineno */
-    if ( c == '\n' )
-
+	if ( c == '\n' )
+		   
     do{ yylineno++;
         yycolumn=0;
     }while(0)
 ;
 
-    return c;
+	return c;
 }
 /* %if-c-only */
-#endif  /* ifndef YY_NO_INPUT */
+#endif	/* ifndef YY_NO_INPUT */
 /* %endif */
 
 /** Immediately switch to a different input stream.
@@ -4171,14 +4188,14 @@
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-    if ( ! YY_CURRENT_BUFFER ){
+	if ( ! YY_CURRENT_BUFFER ){
         yypirensure_buffer_stack (yyscanner);
-        YY_CURRENT_BUFFER_LVALUE =
+		YY_CURRENT_BUFFER_LVALUE =
             yypir_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
-    }
+	}
 
-    yypir_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
-    yypir_load_buffer_state(yyscanner );
+	yypir_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
+	yypir_load_buffer_state(yyscanner );
 }
 
 /** Switch to a different input buffer.
@@ -4193,32 +4210,32 @@
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-    /* TODO. We should be able to replace this entire function body
-     * with
-     *      yypirpop_buffer_state();
-     *      yypirpush_buffer_state(new_buffer);
+	/* TODO. We should be able to replace this entire function body
+	 * with
+	 *		yypirpop_buffer_state();
+	 *		yypirpush_buffer_state(new_buffer);
      */
-    yypirensure_buffer_stack (yyscanner);
-    if ( YY_CURRENT_BUFFER == new_buffer )
-        return;
-
-    if ( YY_CURRENT_BUFFER )
-        {
-        /* Flush out information for old buffer. */
-        *yyg->yy_c_buf_p = yyg->yy_hold_char;
-        YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
-        YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
-        }
-
-    YY_CURRENT_BUFFER_LVALUE = new_buffer;
-    yypir_load_buffer_state(yyscanner );
-
-    /* We don't actually know whether we did this switch during
-     * EOF (yypirwrap()) processing, but the only time this flag
-     * is looked at is after yypirwrap() is called, so it's safe
-     * to go ahead and always set it.
-     */
-    yyg->yy_did_buffer_switch_on_eof = 1;
+	yypirensure_buffer_stack (yyscanner);
+	if ( YY_CURRENT_BUFFER == new_buffer )
+		return;
+
+	if ( YY_CURRENT_BUFFER )
+		{
+		/* Flush out information for old buffer. */
+		*yyg->yy_c_buf_p = yyg->yy_hold_char;
+		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+		}
+
+	YY_CURRENT_BUFFER_LVALUE = new_buffer;
+	yypir_load_buffer_state(yyscanner );
+
+	/* We don't actually know whether we did this switch during
+	 * EOF (yypirwrap()) processing, but the only time this flag
+	 * is looked at is after yypirwrap() is called, so it's safe
+	 * to go ahead and always set it.
+	 */
+	yyg->yy_did_buffer_switch_on_eof = 1;
 }
 
 /* %if-c-only */
@@ -4228,10 +4245,10 @@
 /* %endif */
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-    yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
-    yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
-    yyg->yy_hold_char = *yyg->yy_c_buf_p;
+	yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+	yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+	yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+	yyg->yy_hold_char = *yyg->yy_c_buf_p;
 }
 
 /** Allocate and initialize an input buffer state.
@@ -4246,26 +4263,26 @@
 /* %if-c++-only */
 /* %endif */
 {
-    YY_BUFFER_STATE b;
-
-    b = (YY_BUFFER_STATE) yypiralloc(sizeof( struct yy_buffer_state ) ,yyscanner );
-    if ( ! b )
-        YY_FATAL_ERROR( "out of dynamic memory in yypir_create_buffer()" );
+	YY_BUFFER_STATE b;
+    
+	b = (YY_BUFFER_STATE) yypiralloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+	if ( ! b )
+		YY_FATAL_ERROR( "out of dynamic memory in yypir_create_buffer()" );
+
+	b->yy_buf_size = size;
+
+	/* yy_ch_buf has to be 2 characters longer than the size given because
+	 * we need to put in 2 end-of-buffer characters.
+	 */
+	b->yy_ch_buf = (char *) yypiralloc(b->yy_buf_size + 2 ,yyscanner );
+	if ( ! b->yy_ch_buf )
+		YY_FATAL_ERROR( "out of dynamic memory in yypir_create_buffer()" );
 
-    b->yy_buf_size = size;
+	b->yy_is_our_buffer = 1;
 
-    /* yy_ch_buf has to be 2 characters longer than the size given because
-     * we need to put in 2 end-of-buffer characters.
-     */
-    b->yy_ch_buf = (char *) yypiralloc(b->yy_buf_size + 2 ,yyscanner );
-    if ( ! b->yy_ch_buf )
-        YY_FATAL_ERROR( "out of dynamic memory in yypir_create_buffer()" );
+	yypir_init_buffer(b,file ,yyscanner);
 
-    b->yy_is_our_buffer = 1;
-
-    yypir_init_buffer(b,file ,yyscanner);
-
-    return b;
+	return b;
 }
 
 /** Destroy the buffer.
@@ -4280,16 +4297,16 @@
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-    if ( ! b )
-        return;
+	if ( ! b )
+		return;
 
-    if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
-        YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
 
-    if ( b->yy_is_our_buffer )
-        yypirfree((void *) b->yy_ch_buf ,yyscanner );
+	if ( b->yy_is_our_buffer )
+		yypirfree((void *) b->yy_ch_buf ,yyscanner );
 
-    yypirfree((void *) b ,yyscanner );
+	yypirfree((void *) b ,yyscanner );
 }
 
 /* %if-c-only */
@@ -4310,13 +4327,13 @@
 /* %endif */
 
 {
-    int oerrno = errno;
+	int oerrno = errno;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-    yypir_flush_buffer(b ,yyscanner);
+	yypir_flush_buffer(b ,yyscanner);
 
-    b->yy_input_file = file;
-    b->yy_fill_buffer = 1;
+	b->yy_input_file = file;
+	b->yy_fill_buffer = 1;
 
     /* If b is the current buffer, then yypir_init_buffer was _probably_
      * called from yypirrestart() or through yy_get_next_buffer.
@@ -4330,11 +4347,11 @@
 /* %if-c-only */
 
         b->yy_is_interactive = 0;
-
+    
 /* %endif */
 /* %if-c++-only */
 /* %endif */
-    errno = oerrno;
+	errno = oerrno;
 }
 
 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
@@ -4348,25 +4365,25 @@
 /* %endif */
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    if ( ! b )
-        return;
+	if ( ! b )
+		return;
 
-    b->yy_n_chars = 0;
+	b->yy_n_chars = 0;
 
-    /* We always need two end-of-buffer characters.  The first causes
-     * a transition to the end-of-buffer state.  The second causes
-     * a jam in that state.
-     */
-    b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
-    b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+	/* We always need two end-of-buffer characters.  The first causes
+	 * a transition to the end-of-buffer state.  The second causes
+	 * a jam in that state.
+	 */
+	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
 
-    b->yy_buf_pos = &b->yy_ch_buf[0];
+	b->yy_buf_pos = &b->yy_ch_buf[0];
 
-    b->yy_at_bol = 1;
-    b->yy_buffer_status = YY_BUFFER_NEW;
+	b->yy_at_bol = 1;
+	b->yy_buffer_status = YY_BUFFER_NEW;
 
-    if ( b == YY_CURRENT_BUFFER )
-        yypir_load_buffer_state(yyscanner );
+	if ( b == YY_CURRENT_BUFFER )
+		yypir_load_buffer_state(yyscanner );
 }
 
 /* %if-c-or-c++ */
@@ -4383,28 +4400,28 @@
 /* %endif */
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    if (new_buffer == NULL)
-        return;
+	if (new_buffer == NULL)
+		return;
 
-    yypirensure_buffer_stack(yyscanner);
+	yypirensure_buffer_stack(yyscanner);
 
-    /* This block is copied from yypir_switch_to_buffer. */
-    if ( YY_CURRENT_BUFFER )
-        {
-        /* Flush out information for old buffer. */
-        *yyg->yy_c_buf_p = yyg->yy_hold_char;
-        YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
-        YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
-        }
-
-    /* Only push if top exists. Otherwise, replace top. */
-    if (YY_CURRENT_BUFFER)
-        yyg->yy_buffer_stack_top++;
-    YY_CURRENT_BUFFER_LVALUE = new_buffer;
-
-    /* copied from yypir_switch_to_buffer. */
-    yypir_load_buffer_state(yyscanner );
-    yyg->yy_did_buffer_switch_on_eof = 1;
+	/* This block is copied from yypir_switch_to_buffer. */
+	if ( YY_CURRENT_BUFFER )
+		{
+		/* Flush out information for old buffer. */
+		*yyg->yy_c_buf_p = yyg->yy_hold_char;
+		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+		}
+
+	/* Only push if top exists. Otherwise, replace top. */
+	if (YY_CURRENT_BUFFER)
+		yyg->yy_buffer_stack_top++;
+	YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+	/* copied from yypir_switch_to_buffer. */
+	yypir_load_buffer_state(yyscanner );
+	yyg->yy_did_buffer_switch_on_eof = 1;
 }
 /* %endif */
 
@@ -4420,18 +4437,18 @@
 /* %endif */
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    if (!YY_CURRENT_BUFFER)
-        return;
+	if (!YY_CURRENT_BUFFER)
+		return;
 
-    yypir_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
-    YY_CURRENT_BUFFER_LVALUE = NULL;
-    if (yyg->yy_buffer_stack_top > 0)
-        --yyg->yy_buffer_stack_top;
-
-    if (YY_CURRENT_BUFFER) {
-        yypir_load_buffer_state(yyscanner );
-        yyg->yy_did_buffer_switch_on_eof = 1;
-    }
+	yypir_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
+	YY_CURRENT_BUFFER_LVALUE = NULL;
+	if (yyg->yy_buffer_stack_top > 0)
+		--yyg->yy_buffer_stack_top;
+
+	if (YY_CURRENT_BUFFER) {
+		yypir_load_buffer_state(yyscanner );
+		yyg->yy_did_buffer_switch_on_eof = 1;
+	}
 }
 /* %endif */
 
@@ -4445,46 +4462,46 @@
 /* %if-c++-only */
 /* %endif */
 {
-    int num_to_alloc;
+	yy_size_t num_to_alloc;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-    if (!yyg->yy_buffer_stack) {
+	if (!yyg->yy_buffer_stack) {
 
-        /* First allocation is just for 2 elements, since we don't know if this
-         * scanner will even need a stack. We use 2 instead of 1 to avoid an
-         * immediate realloc on the next call.
+		/* First allocation is just for 2 elements, since we don't know if this
+		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
+		 * immediate realloc on the next call.
          */
-        num_to_alloc = 1;
-        yyg->yy_buffer_stack = (struct yy_buffer_state**)yypiralloc
-                                (num_to_alloc * sizeof(struct yy_buffer_state*)
-                                , yyscanner);
-        if ( ! yyg->yy_buffer_stack )
-            YY_FATAL_ERROR( "out of dynamic memory in yypirensure_buffer_stack()" );
-
-        memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-
-        yyg->yy_buffer_stack_max = num_to_alloc;
-        yyg->yy_buffer_stack_top = 0;
-        return;
-    }
-
-    if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
-
-        /* Increase the buffer to prepare for a possible push. */
-        int grow_size = 8 /* arbitrary grow size */;
-
-        num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
-        yyg->yy_buffer_stack = (struct yy_buffer_state**)yypirrealloc
-                                (yyg->yy_buffer_stack,
-                                num_to_alloc * sizeof(struct yy_buffer_state*)
-                                , yyscanner);
-        if ( ! yyg->yy_buffer_stack )
-            YY_FATAL_ERROR( "out of dynamic memory in yypirensure_buffer_stack()" );
-
-        /* zero only the new slots.*/
-        memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
-        yyg->yy_buffer_stack_max = num_to_alloc;
-    }
+		num_to_alloc = 1;
+		yyg->yy_buffer_stack = (struct yy_buffer_state**)yypiralloc
+								(num_to_alloc * sizeof(struct yy_buffer_state*)
+								, yyscanner);
+		if ( ! yyg->yy_buffer_stack )
+			YY_FATAL_ERROR( "out of dynamic memory in yypirensure_buffer_stack()" );
+								  
+		memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+				
+		yyg->yy_buffer_stack_max = num_to_alloc;
+		yyg->yy_buffer_stack_top = 0;
+		return;
+	}
+
+	if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
+
+		/* Increase the buffer to prepare for a possible push. */
+		int grow_size = 8 /* arbitrary grow size */;
+
+		num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
+		yyg->yy_buffer_stack = (struct yy_buffer_state**)yypirrealloc
+								(yyg->yy_buffer_stack,
+								num_to_alloc * sizeof(struct yy_buffer_state*)
+								, yyscanner);
+		if ( ! yyg->yy_buffer_stack )
+			YY_FATAL_ERROR( "out of dynamic memory in yypirensure_buffer_stack()" );
+
+		/* zero only the new slots.*/
+		memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
+		yyg->yy_buffer_stack_max = num_to_alloc;
+	}
 }
 /* %endif */
 
@@ -4493,35 +4510,35 @@
  * @param base the character buffer
  * @param size the size in bytes of the character buffer
  * @param yyscanner The scanner object.
- * @return the newly allocated buffer state object.
+ * @return the newly allocated buffer state object. 
  */
 YY_BUFFER_STATE yypir_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
 {
-    YY_BUFFER_STATE b;
-
-    if ( size < 2 ||
-         base[size-2] != YY_END_OF_BUFFER_CHAR ||
-         base[size-1] != YY_END_OF_BUFFER_CHAR )
-        /* They forgot to leave room for the EOB's. */
-        return 0;
-
-    b = (YY_BUFFER_STATE) yypiralloc(sizeof( struct yy_buffer_state ) ,yyscanner );
-    if ( ! b )
-        YY_FATAL_ERROR( "out of dynamic memory in yypir_scan_buffer()" );
-
-    b->yy_buf_size = size - 2;  /* "- 2" to take care of EOB's */
-    b->yy_buf_pos = b->yy_ch_buf = base;
-    b->yy_is_our_buffer = 0;
-    b->yy_input_file = 0;
-    b->yy_n_chars = b->yy_buf_size;
-    b->yy_is_interactive = 0;
-    b->yy_at_bol = 1;
-    b->yy_fill_buffer = 0;
-    b->yy_buffer_status = YY_BUFFER_NEW;
+	YY_BUFFER_STATE b;
+    
+	if ( size < 2 ||
+	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
+	     base[size-1] != YY_END_OF_BUFFER_CHAR )
+		/* They forgot to leave room for the EOB's. */
+		return 0;
+
+	b = (YY_BUFFER_STATE) yypiralloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+	if ( ! b )
+		YY_FATAL_ERROR( "out of dynamic memory in yypir_scan_buffer()" );
+
+	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
+	b->yy_buf_pos = b->yy_ch_buf = base;
+	b->yy_is_our_buffer = 0;
+	b->yy_input_file = 0;
+	b->yy_n_chars = b->yy_buf_size;
+	b->yy_is_interactive = 0;
+	b->yy_at_bol = 1;
+	b->yy_fill_buffer = 0;
+	b->yy_buffer_status = YY_BUFFER_NEW;
 
-    yypir_switch_to_buffer(b ,yyscanner );
+	yypir_switch_to_buffer(b ,yyscanner );
 
-    return b;
+	return b;
 }
 /* %endif */
 
@@ -4536,8 +4553,8 @@
  */
 YY_BUFFER_STATE yypir_scan_string (yyconst char * yystr , yyscan_t yyscanner)
 {
-
-    return yypir_scan_bytes(yystr,strlen(yystr) ,yyscanner);
+    
+	return yypir_scan_bytes(yystr,strlen(yystr) ,yyscanner);
 }
 /* %endif */
 
@@ -4549,34 +4566,33 @@
  * @param yyscanner The scanner object.
  * @return the newly allocated buffer state object.
  */
-YY_BUFFER_STATE yypir_scan_bytes  (yyconst char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
+YY_BUFFER_STATE yypir_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len , yyscan_t yyscanner)
 {
-    YY_BUFFER_STATE b;
-    char *buf;
-    yy_size_t n;
-    int i;
-
-    /* Get memory for full buffer, including space for trailing EOB's. */
-    n = _yybytes_len + 2;
-    buf = (char *) yypiralloc(n ,yyscanner );
-    if ( ! buf )
-        YY_FATAL_ERROR( "out of dynamic memory in yypir_scan_bytes()" );
-
-    for ( i = 0; i < _yybytes_len; ++i )
-        buf[i] = yybytes[i];
-
-    buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
-
-    b = yypir_scan_buffer(buf,n ,yyscanner);
-    if ( ! b )
-        YY_FATAL_ERROR( "bad buffer in yypir_scan_bytes()" );
-
-    /* It's okay to grow etc. this buffer, and we should throw it
-     * away when we're done.
-     */
-    b->yy_is_our_buffer = 1;
+	YY_BUFFER_STATE b;
+	char *buf;
+	yy_size_t n, i;
+    
+	/* Get memory for full buffer, including space for trailing EOB's. */
+	n = _yybytes_len + 2;
+	buf = (char *) yypiralloc(n ,yyscanner );
+	if ( ! buf )
+		YY_FATAL_ERROR( "out of dynamic memory in yypir_scan_bytes()" );
+
+	for ( i = 0; i < _yybytes_len; ++i )
+		buf[i] = yybytes[i];
+
+	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
+
+	b = yypir_scan_buffer(buf,n ,yyscanner);
+	if ( ! b )
+		YY_FATAL_ERROR( "bad buffer in yypir_scan_bytes()" );
+
+	/* It's okay to grow etc. this buffer, and we should throw it
+	 * away when we're done.
+	 */
+	b->yy_is_our_buffer = 1;
 
-    return b;
+	return b;
 }
 /* %endif */
 
@@ -4587,26 +4603,26 @@
 /* %endif */
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    if ( yyg->yy_start_stack_ptr >= yyg->yy_start_stack_depth )
-        {
-        yy_size_t new_size;
+	if ( yyg->yy_start_stack_ptr >= yyg->yy_start_stack_depth )
+		{
+		yy_size_t new_size;
 
-        yyg->yy_start_stack_depth += YY_START_STACK_INCR;
-        new_size = yyg->yy_start_stack_depth * sizeof( int );
+		yyg->yy_start_stack_depth += YY_START_STACK_INCR;
+		new_size = yyg->yy_start_stack_depth * sizeof( int );
 
-        if ( ! yyg->yy_start_stack )
-            yyg->yy_start_stack = (int *) yypiralloc(new_size ,yyscanner );
+		if ( ! yyg->yy_start_stack )
+			yyg->yy_start_stack = (int *) yypiralloc(new_size ,yyscanner );
 
-        else
-            yyg->yy_start_stack = (int *) yypirrealloc((void *) yyg->yy_start_stack,new_size ,yyscanner );
+		else
+			yyg->yy_start_stack = (int *) yypirrealloc((void *) yyg->yy_start_stack,new_size ,yyscanner );
 
-        if ( ! yyg->yy_start_stack )
-            YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
-        }
+		if ( ! yyg->yy_start_stack )
+			YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
+		}
 
-    yyg->yy_start_stack[yyg->yy_start_stack_ptr++] = YY_START;
+	yyg->yy_start_stack[yyg->yy_start_stack_ptr++] = YY_START;
 
-    BEGIN(new_state);
+	BEGIN(new_state);
 }
 
 /* %if-c-only */
@@ -4616,10 +4632,10 @@
 /* %endif */
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    if ( --yyg->yy_start_stack_ptr < 0 )
-        YY_FATAL_ERROR( "start-condition stack underflow" );
+	if ( --yyg->yy_start_stack_ptr < 0 )
+		YY_FATAL_ERROR( "start-condition stack underflow" );
 
-    BEGIN(yyg->yy_start_stack[yyg->yy_start_stack_ptr]);
+	BEGIN(yyg->yy_start_stack[yyg->yy_start_stack_ptr]);
 }
 
 /* %if-c-only */
@@ -4629,7 +4645,7 @@
 /* %endif */
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-    return yyg->yy_start_stack[yyg->yy_start_stack_ptr - 1];
+	return yyg->yy_start_stack[yyg->yy_start_stack_ptr - 1];
 }
 
 #ifndef YY_EXIT_FAILURE
@@ -4639,8 +4655,8 @@
 /* %if-c-only */
 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
 {
-        (void) fprintf( stderr, "%s\n", msg );
-    exit( YY_EXIT_FAILURE );
+    	(void) fprintf( stderr, "%s\n", msg );
+	exit( YY_EXIT_FAILURE );
 }
 /* %endif */
 /* %if-c++-only */
@@ -4650,18 +4666,18 @@
 
 #undef yyless
 #define yyless(n) \
-    do \
-        { \
-        /* Undo effects of setting up yytext. */ \
+	do \
+		{ \
+		/* Undo effects of setting up yytext. */ \
         int yyless_macro_arg = (n); \
         YY_LESS_LINENO(yyless_macro_arg);\
-        yytext[yyleng] = yyg->yy_hold_char; \
-        yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
-        yyg->yy_hold_char = *yyg->yy_c_buf_p; \
-        *yyg->yy_c_buf_p = '\0'; \
-        yyleng = yyless_macro_arg; \
-        } \
-    while ( 0 )
+		yytext[yyleng] = yyg->yy_hold_char; \
+		yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
+		yyg->yy_hold_char = *yyg->yy_c_buf_p; \
+		*yyg->yy_c_buf_p = '\0'; \
+		yyleng = yyless_macro_arg; \
+		} \
+	while ( 0 )
 
 /* Accessor  methods (get/set functions) to struct members. */
 
@@ -4685,10 +4701,10 @@
 int yypirget_lineno  (yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
+    
         if (! YY_CURRENT_BUFFER)
             return 0;
-
+    
     return yylineno;
 }
 
@@ -4698,10 +4714,10 @@
 int yypirget_column  (yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
+    
         if (! YY_CURRENT_BUFFER)
             return 0;
-
+    
     return yycolumn;
 }
 
@@ -4726,7 +4742,7 @@
 /** Get the length of the current token.
  * @param yyscanner The scanner object.
  */
-int yypirget_leng  (yyscan_t yyscanner)
+yy_size_t yypirget_leng  (yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
     return yyleng;
@@ -4766,8 +4782,8 @@
 
         /* lineno is only valid if an input buffer exists. */
         if (! YY_CURRENT_BUFFER )
-           yy_fatal_error( "yypirset_lineno called with no buffer" , yyscanner);
-
+           yy_fatal_error( "yypirset_lineno called with no buffer" , yyscanner); 
+    
     yylineno = line_number;
 }
 
@@ -4781,8 +4797,8 @@
 
         /* column is only valid if an input buffer exists. */
         if (! YY_CURRENT_BUFFER )
-           yy_fatal_error( "yypirset_column called with no buffer" , yyscanner);
-
+           yy_fatal_error( "yypirset_column called with no buffer" , yyscanner); 
+    
     yycolumn = column_no;
 }
 
@@ -4884,20 +4900,20 @@
         errno = EINVAL;
         return 1;
     }
-
+	
     *ptr_yy_globals = (yyscan_t) yypiralloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
-
+	
     if (*ptr_yy_globals == NULL){
         errno = ENOMEM;
         return 1;
     }
-
+    
     /* By setting to 0xAA, we expose bugs in
     yy_init_globals. Leave at 0x00 for releases. */
     memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
-
+    
     yypirset_extra (yy_user_defined, *ptr_yy_globals);
-
+    
     return yy_init_globals ( *ptr_yy_globals );
 }
 
@@ -4945,15 +4961,15 @@
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
     /* Pop the buffer stack, destroying each element. */
-    while(YY_CURRENT_BUFFER){
-        yypir_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
-        YY_CURRENT_BUFFER_LVALUE = NULL;
-        yypirpop_buffer_state(yyscanner);
-    }
-
-    /* Destroy the stack itself. */
-    yypirfree(yyg->yy_buffer_stack ,yyscanner);
-    yyg->yy_buffer_stack = NULL;
+	while(YY_CURRENT_BUFFER){
+		yypir_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
+		YY_CURRENT_BUFFER_LVALUE = NULL;
+		yypirpop_buffer_state(yyscanner);
+	}
+
+	/* Destroy the stack itself. */
+	yypirfree(yyg->yy_buffer_stack ,yyscanner);
+	yyg->yy_buffer_stack = NULL;
 
     /* Destroy the start condition stack. */
         yypirfree(yyg->yy_start_stack ,yyscanner );
@@ -4979,20 +4995,20 @@
 #ifndef yytext_ptr
 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
 {
-    register int i;
-    for ( i = 0; i < n; ++i )
-        s1[i] = s2[i];
+	register int i;
+	for ( i = 0; i < n; ++i )
+		s1[i] = s2[i];
 }
 #endif
 
 #ifdef YY_NEED_STRLEN
 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
 {
-    register int n;
-    for ( n = 0; s[n]; ++n )
-        ;
+	register int n;
+	for ( n = 0; s[n]; ++n )
+		;
 
-    return n;
+	return n;
 }
 #endif
 
@@ -5003,7 +5019,7 @@
 
 /* %ok-for-header */
 
-#line 1182 "pir.l"
+#line 1199 "pir.l"
 
 
 

Modified: branches/orderedhash_revamp/compilers/pirc/src/pirlexer.h
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/src/pirlexer.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/src/pirlexer.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -62,7 +62,7 @@
 /* %endif */
 
 /* %if-c-only */
-
+    
 /* %endif */
 
 /* %if-c-only */
@@ -94,7 +94,7 @@
 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 
 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types.
+ * if you want the limit (max/min) macros for int types. 
  */
 #ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS 1
@@ -111,7 +111,7 @@
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
 typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t;
+typedef unsigned char flex_uint8_t; 
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
 #endif /* ! C99 */
@@ -157,15 +157,15 @@
 /* The "const" storage-class-modifier is valid. */
 #define YY_USE_CONST
 
-#else   /* ! __cplusplus */
+#else	/* ! __cplusplus */
 
 /* C99 requires __STDC__ to be defined as 1. */
 #if defined (__STDC__)
 
 #define YY_USE_CONST
 
-#endif  /* defined (__STDC__) */
-#endif  /* ! __cplusplus */
+#endif	/* defined (__STDC__) */
+#endif	/* ! __cplusplus */
 
 #ifdef YY_USE_CONST
 #define yyconst const
@@ -211,6 +211,11 @@
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #endif
 
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
 /* %if-not-reentrant */
 /* %endif */
 
@@ -219,65 +224,60 @@
 /* %endif */
 /* %endif */
 
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
-    {
+	{
 /* %if-c-only */
-    FILE *yy_input_file;
+	FILE *yy_input_file;
 /* %endif */
 
 /* %if-c++-only */
 /* %endif */
 
-    char *yy_ch_buf;        /* input buffer */
-    char *yy_buf_pos;       /* current position in input buffer */
+	char *yy_ch_buf;		/* input buffer */
+	char *yy_buf_pos;		/* current position in input buffer */
 
-    /* Size of input buffer in bytes, not including room for EOB
-     * characters.
-     */
-    yy_size_t yy_buf_size;
-
-    /* Number of characters read into yy_ch_buf, not including EOB
-     * characters.
-     */
-    int yy_n_chars;
-
-    /* Whether we "own" the buffer - i.e., we know we created it,
-     * and can realloc() it to grow it, and should free() it to
-     * delete it.
-     */
-    int yy_is_our_buffer;
-
-    /* Whether this is an "interactive" input source; if so, and
-     * if we're using stdio for input, then we want to use getc()
-     * instead of fread(), to make sure we stop fetching input after
-     * each newline.
-     */
-    int yy_is_interactive;
-
-    /* Whether we're considered to be at the beginning of a line.
-     * If so, '^' rules will be active on the next match, otherwise
-     * not.
-     */
-    int yy_at_bol;
+	/* Size of input buffer in bytes, not including room for EOB
+	 * characters.
+	 */
+	yy_size_t yy_buf_size;
+
+	/* Number of characters read into yy_ch_buf, not including EOB
+	 * characters.
+	 */
+	yy_size_t yy_n_chars;
+
+	/* Whether we "own" the buffer - i.e., we know we created it,
+	 * and can realloc() it to grow it, and should free() it to
+	 * delete it.
+	 */
+	int yy_is_our_buffer;
+
+	/* Whether this is an "interactive" input source; if so, and
+	 * if we're using stdio for input, then we want to use getc()
+	 * instead of fread(), to make sure we stop fetching input after
+	 * each newline.
+	 */
+	int yy_is_interactive;
+
+	/* Whether we're considered to be at the beginning of a line.
+	 * If so, '^' rules will be active on the next match, otherwise
+	 * not.
+	 */
+	int yy_at_bol;
 
     int yy_bs_lineno; /**< The line count. */
     int yy_bs_column; /**< The column count. */
+    
+	/* Whether to try to fill the input buffer when we reach the
+	 * end of it.
+	 */
+	int yy_fill_buffer;
 
-    /* Whether to try to fill the input buffer when we reach the
-     * end of it.
-     */
-    int yy_fill_buffer;
-
-    int yy_buffer_status;
+	int yy_buffer_status;
 
-    };
+	};
 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
 
 /* %if-c-only Standard (non-C++) definition */
@@ -302,7 +302,7 @@
 
 YY_BUFFER_STATE yypir_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
 YY_BUFFER_STATE yypir_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE yypir_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+YY_BUFFER_STATE yypir_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
 
 /* %endif */
 
@@ -394,7 +394,7 @@
 
 void yypirset_out  (FILE * out_str ,yyscan_t yyscanner );
 
-int yypirget_leng (yyscan_t yyscanner );
+yy_size_t yypirget_leng (yyscan_t yyscanner );
 
 char *yypirget_text (yyscan_t yyscanner );
 
@@ -501,7 +501,7 @@
 #undef YY_DECL
 #endif
 
-#line 1182 "pir.l"
+#line 1199 "pir.l"
 
 
 #line 508 "pirlexer.h"

Modified: branches/orderedhash_revamp/compilers/pirc/src/pirmacro.c
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/src/pirmacro.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/src/pirmacro.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -7,7 +7,6 @@
 #include <string.h>
 #include "pirmacro.h"
 #include "pircompiler.h"
-#include "pirmacro.h"
 #include "parrot/parrot.h"
 
 
@@ -146,7 +145,7 @@
     if (used + length >= macro->buffersize) {
         unsigned  newsize = macro->buffersize << 1;
         char     *newbuffer;
-         /* double the size (moving all bits left by 1 means doubling) */
+        /* double the size (moving all bits left by 1 means doubling) */
         newbuffer = (char *)mem_sys_allocate(sizeof (char) * macro->buffersize);
         memcpy(newbuffer, macro->body, macro->buffersize);
         mem_sys_free(macro->body);

Modified: branches/orderedhash_revamp/compilers/pirc/src/pirop.c
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/src/pirop.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/src/pirop.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -74,29 +74,29 @@
 static int
 get_signature_length(NOTNULL(expression * const e)) {
     switch (e->type) {
-        case EXPR_TARGET:
-            return 2 + ((e->expr.t->key != NULL) /* if there's a key on this target ... */
-                                                 /* ... get its length. */
-                       ? get_signature_length(e->expr.t->key->head->expr) + 1
-                       : 0);
-        case EXPR_CONSTANT:
-            return 3;    /* for _, 'k', 'c' */
-        case EXPR_IDENT:
-            return 3; /* 1 for '_', 1 for 'i', 1 for 'c' */
-        case EXPR_KEY: { /* for '_', 'k' */
-            int n;
-            /* if the key is an integer constant, then signature becomes '_kic', otherwise _kc. */
-            if (e->expr.k->head->expr->type         == EXPR_CONSTANT
-            &&  e->expr.k->head->expr->expr.c->type == INT_VAL)
-                n = 3;
-            else
-                n = 2;
-
-            return n + get_signature_length(e->expr.k->head->expr);
-        }
-        default:
-            fprintf(stderr, "wrong expression typein get_signature_length()\n");
-            break;
+      case EXPR_TARGET:
+        return 2 + ((e->expr.t->key != NULL) /* if there's a key on this target ... */
+                                             /* ... get its length. */
+                   ? get_signature_length(e->expr.t->key->head->expr) + 1
+                   : 0);
+      case EXPR_CONSTANT:
+        return 3;    /* for _, 'k', 'c' */
+      case EXPR_IDENT:
+        return 3; /* 1 for '_', 1 for 'i', 1 for 'c' */
+      case EXPR_KEY: { /* for '_', 'k' */
+        int n;
+        /* if the key is an integer constant, then signature becomes '_kic', otherwise _kc. */
+        if (e->expr.k->head->expr->type         == EXPR_CONSTANT
+         && e->expr.k->head->expr->expr.c->type == INT_VAL)
+            n = 3;
+        else
+            n = 2;
+
+        return n + get_signature_length(e->expr.k->head->expr);
+      }
+      default:
+        fprintf(stderr, "wrong expression typein get_signature_length()\n");
+        break;
     }
     return 0;
 }
@@ -125,76 +125,84 @@
 static char *
 write_signature(NOTNULL(expression * const iter), NOTNULL(char *instr_writer)) {
     switch (iter->type) {
-        case EXPR_TARGET:
-            *instr_writer++ = type_codes[iter->expr.t->info->type];
+      case EXPR_TARGET:
+        *instr_writer++ = type_codes[iter->expr.t->info->type];
 
-            if (iter->expr.t->key) {
-                *instr_writer++ = '_';
-                *instr_writer++ = 'k';
-
-                switch (iter->expr.t->key->head->expr->type) {
-                    case EXPR_TARGET:
-                        switch (iter->expr.t->key->head->expr->expr.t->info->type) {
-                            case PMC_TYPE:
-                                /* the key is a target, and its type is a PMC. In that
-                                 * case, do not print the signature; 'kp' is not valid.
-                                 */
-                                break;
-                            case STRING_TYPE: /* strings become key-constant */
-                                *instr_writer++ = 'c';
-                                break;
-                            case INT_TYPE:
-                                *instr_writer++ = 'i';
-                                break;
-                            default:
-                                break;
-                        }
-                        break;
-                    case EXPR_CONSTANT:
-                        /* integer constant key results in '_kic' signature */
-                        if (iter->expr.c->type == INT_VAL)
-                            *instr_writer++ = 'i';
-
-                        *instr_writer++ = 'c';
-                        break;
-                    default:
-                        /* XXX does this ever happen? */
-                        fprintf(stderr, "write_signature: non-constant key\n");
-                        instr_writer = write_signature(iter->expr.t->key->head->expr, instr_writer);
-                        break;
-                }
-
-            }
-            break;
-        case EXPR_CONSTANT:
-            *instr_writer++ = type_codes[iter->expr.c->type];
-            *instr_writer++ = 'c';
-            break;
-        case EXPR_IDENT: /* used for labels; these will be converted to (i)nteger (c)onstants*/
-            *instr_writer++ = 'i';
-            *instr_writer++ = 'c';
-            break;
-        case EXPR_KEY:
+        if (iter->expr.t->key) {
+            *instr_writer++ = '_';
             *instr_writer++ = 'k';
 
-            instr_writer    = write_signature(iter->expr.k->head->expr, instr_writer);
-            /*
-
-            switch (iter->expr.k->expr->type) {
-                case EXPR_CONSTANT:
-                   *instr_writer++ = 'c';
-                   break;
-                default:
-                    fprintf(stderr, "write_signature: non-constant key\n");
-                    instr_writer = write_signature(iter->expr.k->expr, instr_writer);
+            switch (iter->expr.t->key->head->expr->type) {
+              case EXPR_TARGET:
+                switch (iter->expr.t->key->head->expr->expr.t->info->type) {
+                  case PMC_TYPE:
+                    /* the key is a target, and its type is a PMC. In that
+                     * case, do not print the signature; 'kp' is not valid.
+                     */
                     break;
+                  case STRING_TYPE: /* strings become key-constant */
+                    *instr_writer++ = 'c';
+                    break;
+                  case INT_TYPE:
+                    *instr_writer++ = 'i';
+                    break;
+                  default:
+                    break;
+                }
+                break;
+              case EXPR_CONSTANT:
+                /* integer constant key results in '_kic' signature */
+                if (iter->expr.c->type == INT_VAL)
+                    *instr_writer++ = 'i';
+
+                *instr_writer++ = 'c';
+                break;
+              default:
+                /* XXX does this ever happen? */
+                fprintf(stderr, "write_signature: non-constant key\n");
+                instr_writer = write_signature(iter->expr.t->key->head->expr, instr_writer);
+                break;
             }
-            */
 
+        }
+        break;
+      case EXPR_CONSTANT:
+        *instr_writer++ = type_codes[iter->expr.c->type];
+        *instr_writer++ = 'c';
+        break;
+      case EXPR_IDENT: /* used for labels; these will be converted to (i)nteger (c)onstants*/
+        *instr_writer++ = 'i';
+        *instr_writer++ = 'c';
+        break;
+      case EXPR_KEY:
+        *instr_writer++ = 'p';
+        *instr_writer++ = 'c';
+
+        /* XXX figure out what signature is needed. I think 'pc' */
+        /*
+        else {
+            *instr_writer++ = 'k';
+        }
+        */
+        /*instr_writer    = write_signature(iter->expr.k->head->expr, instr_writer);*/
+
+        /*
+
+        switch (iter->expr.k->expr->type) {
+          case EXPR_CONSTANT:
+            *instr_writer++ = 'c';
             break;
-        default:
-            fprintf(stderr, "wrong expression type in write_signature()\n");
+          default:
+            fprintf(stderr, "write_signature: non-constant key\n");
+            instr_writer = write_signature(iter->expr.k->expr, instr_writer);
             break;
+        }
+        */
+
+        break;
+      default:
+        fprintf(stderr, "wrong expression type in write_signature()\n");
+        break;
     }
     return instr_writer;
 }

Modified: branches/orderedhash_revamp/compilers/pirc/src/pirop.h
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/src/pirop.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/src/pirop.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -16,8 +16,8 @@
 get_opinfo(ARGIN(lexer_state * const lexer))
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_get_opinfo __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(lexer)
+#define ASSERT_ARGS_get_opinfo __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(lexer))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: compilers/pirc/src/pirop.c */
 

Modified: branches/orderedhash_revamp/compilers/pirc/src/pirparser.c
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/src/pirparser.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/src/pirparser.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -585,9 +585,10 @@
     struct symbol      *symb;
     struct macro_def   *mval;
     struct macro_param *pval;
+
 }
-/* Line 187 of yacc.c.  */
-#line 591 "pirparser.c"
+/* Line 193 of yacc.c.  */
+#line 592 "pirparser.c"
 	YYSTYPE;
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
@@ -600,7 +601,7 @@
 
 
 /* Line 216 of yacc.c.  */
-#line 604 "pirparser.c"
+#line 605 "pirparser.c"
 
 #ifdef short
 # undef short
@@ -650,7 +651,7 @@
 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
 
 #ifndef YY_
-# if YYENABLE_NLS
+# if defined YYENABLE_NLS && YYENABLE_NLS
 #  if ENABLE_NLS
 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
@@ -815,7 +816,7 @@
 /* YYFINAL -- State number of the termination state.  */
 #define YYFINAL  11
 /* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   1154
+#define YYLAST   1178
 
 /* YYNTOKENS -- Number of terminals.  */
 #define YYNTOKENS  139
@@ -937,7 +938,7 @@
      147,    -1,   148,    -1,   108,    36,   114,    -1,   149,   119,
      150,   120,    34,   153,   105,    -1,   104,   297,    -1,    -1,
      151,    -1,   152,    -1,   151,   121,   152,    -1,   297,    -1,
-      -1,   154,    -1,   155,    -1,   154,   155,    -1,   156,    34,
+      -1,   154,    -1,   155,    -1,   154,   155,    -1,   156,   143,
       -1,   157,    -1,   158,    -1,   107,   109,    -1,   106,   293,
      110,    -1,     4,    45,    -1,     9,    47,    -1,    10,    45,
       -1,     3,    45,    -1,    12,   122,   163,   123,    -1,    -1,
@@ -1009,7 +1010,7 @@
       -1,   234,    -1,   243,    -1,    25,   143,   235,   238,   143,
      240,    26,   143,    -1,    -1,   236,    -1,   237,    -1,   236,
      237,    -1,    29,   266,   143,    -1,    28,   248,   239,    -1,
-      31,   250,    -1,    13,   250,    34,    14,   249,    -1,    -1,
+      31,   250,    -1,    13,   250,   143,    14,   249,    -1,    -1,
      121,   250,    -1,    -1,   241,    -1,   242,    -1,   241,   242,
       -1,    30,   254,   143,    -1,   227,    -1,   244,   143,    -1,
      251,   127,   245,    -1,   294,   127,   245,    -1,   245,    -1,
@@ -1049,60 +1050,60 @@
       73,    -1,    74,    -1,    75,    -1,    76,    -1,    79,    -1,
       77,    -1,    78,    -1,    80,    -1,    81,    -1,    69,    -1,
       70,    -1,    68,    -1,   303,   304,    -1,   142,    -1,   305,
-      -1,   304,   305,    -1,   306,    -1,   162,    34,    -1,   231,
-      -1,   160,    34,    -1,   146,    34,    -1,   190,    -1,    35,
+      -1,   304,   305,    -1,   306,    -1,   162,   143,    -1,   231,
+      -1,   160,   143,    -1,   146,   143,    -1,   190,    -1,    35,
      307,    -1,   308,   307,    -1,   310,    -1,   198,    -1,   310,
-      -1,   309,   170,    35,    -1,   117,    -1,   205,   207,    34,
+      -1,   309,   170,    35,    -1,   117,    -1,   205,   207,   143,
       -1
 };
 
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 static const yytype_uint16 yyrline[] =
 {
-       0,   562,   562,   563,   568,   574,   575,   578,   582,   583,
-     586,   587,   588,   589,   590,   591,   592,   593,   600,   601,
-     604,   608,   614,   621,   622,   625,   626,   629,   633,   634,
-     637,   638,   641,   644,   645,   648,   652,   663,   667,   669,
-     675,   679,   684,   685,   689,   691,   695,   699,   705,   709,
-     713,   714,   717,   718,   721,   723,   725,   727,   729,   731,
-     733,   735,   737,   739,   741,   743,   745,   747,   751,   756,
-     760,   764,   773,   784,   786,   788,   792,   797,   798,   811,
-     815,   820,   821,   825,   826,   827,   828,   831,   838,   845,
-     851,   852,   862,   864,   867,   868,   869,   870,   871,   872,
-     873,   874,   875,   876,   877,   878,   879,   880,   881,   882,
-     885,   892,   895,   900,   901,   906,   907,   910,   912,   920,
-     928,   929,   931,   934,   940,   941,   950,   952,   953,   954,
-     962,   966,   970,   979,   986,   992,   995,   996,   999,  1008,
-    1015,  1018,  1019,  1022,  1023,  1026,  1062,  1064,  1068,  1070,
-    1075,  1077,  1081,  1104,  1108,  1110,  1119,  1130,  1142,  1152,
-    1155,  1156,  1159,  1168,  1177,  1182,  1187,  1208,  1213,  1254,
-    1272,  1279,  1284,  1295,  1306,  1317,  1328,  1333,  1338,  1343,
-    1353,  1372,  1406,  1408,  1410,  1412,  1414,  1416,  1418,  1420,
-    1425,  1434,  1436,  1438,  1440,  1442,  1444,  1446,  1448,  1450,
-    1452,  1464,  1471,  1473,  1479,  1481,  1483,  1485,  1487,  1489,
-    1491,  1493,  1495,  1497,  1499,  1530,  1556,  1564,  1573,  1582,
-    1584,  1586,  1588,  1590,  1594,  1599,  1601,  1606,  1607,  1610,
-    1611,  1614,  1615,  1618,  1626,  1630,  1632,  1636,  1640,  1641,
-    1644,  1659,  1663,  1664,  1667,  1679,  1680,  1684,  1686,  1690,
-    1694,  1696,  1698,  1704,  1705,  1710,  1711,  1715,  1717,  1726,
-    1728,  1732,  1736,  1738,  1740,  1744,  1745,  1748,  1768,  1775,
-    1777,  1787,  1804,  1806,  1808,  1812,  1821,  1826,  1833,  1834,
-    1838,  1840,  1844,  1846,  1851,  1852,  1856,  1858,  1860,  1862,
-    1872,  1876,  1877,  1878,  1879,  1882,  1887,  1898,  1905,  1910,
-    1911,  1915,  1917,  1921,  1922,  1925,  1929,  1933,  1937,  1946,
-    1956,  1957,  1962,  1964,  1969,  1974,  1975,  1979,  1981,  1985,
-    1991,  1992,  1996,  1998,  2006,  2007,  2011,  2015,  2018,  2022,
-    2023,  2026,  2030,  2031,  2034,  2038,  2040,  2042,  2044,  2048,
-    2052,  2053,  2066,  2067,  2071,  2072,  2073,  2076,  2077,  2080,
-    2081,  2082,  2083,  2084,  2085,  2088,  2089,  2090,  2091,  2099,
-    2102,  2103,  2116,  2117,  2118,  2119,  2123,  2124,  2127,  2128,
-    2129,  2130,  2131,  2132,  2133,  2134,  2137,  2138,  2139,  2142,
-    2143,  2144,  2145,  2146,  2147,  2148,  2149,  2150,  2151,  2152,
-    2153,  2154,  2155,  2156,  2157,  2158,  2159,  2160,  2161,  2162,
-    2163,  2164,  2170,  2171,  2172,  2173,  2174,  2175,  2176,  2177,
-    2178,  2179,  2180,  2181,  2193,  2201,  2205,  2206,  2209,  2210,
-    2211,  2212,  2213,  2214,  2217,  2219,  2220,  2223,  2224,  2227,
-    2231,  2236
+       0,   563,   563,   564,   569,   575,   576,   579,   583,   584,
+     587,   588,   589,   590,   591,   592,   593,   594,   601,   602,
+     605,   609,   615,   622,   623,   626,   627,   630,   634,   635,
+     638,   639,   642,   645,   646,   649,   653,   664,   668,   670,
+     676,   680,   685,   686,   690,   692,   696,   700,   706,   710,
+     714,   715,   718,   719,   722,   724,   726,   728,   730,   732,
+     734,   736,   738,   740,   742,   744,   746,   748,   752,   757,
+     761,   765,   774,   785,   787,   789,   793,   798,   799,   812,
+     816,   821,   822,   826,   827,   828,   829,   832,   839,   846,
+     852,   853,   863,   865,   868,   869,   870,   871,   872,   873,
+     874,   875,   876,   877,   878,   879,   880,   881,   882,   883,
+     886,   893,   896,   901,   902,   907,   908,   911,   913,   921,
+     929,   930,   932,   935,   941,   942,   951,   953,   954,   955,
+     963,   967,   971,   980,   987,   993,   996,   997,  1000,  1009,
+    1016,  1019,  1020,  1023,  1024,  1027,  1063,  1065,  1069,  1071,
+    1076,  1078,  1082,  1105,  1109,  1111,  1120,  1131,  1143,  1153,
+    1156,  1157,  1160,  1169,  1178,  1183,  1188,  1209,  1214,  1255,
+    1273,  1280,  1285,  1296,  1307,  1318,  1329,  1334,  1339,  1344,
+    1354,  1373,  1407,  1409,  1411,  1413,  1415,  1417,  1419,  1421,
+    1426,  1435,  1437,  1439,  1441,  1443,  1445,  1447,  1449,  1451,
+    1453,  1465,  1472,  1474,  1480,  1482,  1484,  1486,  1488,  1490,
+    1492,  1494,  1496,  1498,  1500,  1531,  1557,  1565,  1574,  1583,
+    1585,  1587,  1589,  1591,  1595,  1600,  1602,  1607,  1608,  1611,
+    1612,  1615,  1616,  1619,  1627,  1631,  1633,  1637,  1641,  1642,
+    1645,  1660,  1664,  1665,  1668,  1680,  1681,  1685,  1687,  1691,
+    1695,  1697,  1699,  1705,  1706,  1711,  1712,  1716,  1718,  1727,
+    1729,  1733,  1737,  1739,  1741,  1745,  1746,  1749,  1769,  1776,
+    1778,  1788,  1805,  1807,  1809,  1813,  1822,  1827,  1834,  1835,
+    1839,  1841,  1845,  1847,  1852,  1853,  1857,  1859,  1861,  1863,
+    1873,  1877,  1878,  1879,  1880,  1883,  1888,  1899,  1906,  1911,
+    1912,  1916,  1918,  1922,  1923,  1926,  1930,  1934,  1938,  1947,
+    1957,  1958,  1963,  1965,  1970,  1975,  1976,  1980,  1982,  1986,
+    1992,  1993,  1997,  1999,  2007,  2008,  2012,  2016,  2019,  2023,
+    2024,  2027,  2031,  2032,  2035,  2039,  2041,  2043,  2045,  2049,
+    2053,  2054,  2067,  2068,  2072,  2073,  2074,  2077,  2078,  2081,
+    2082,  2083,  2084,  2085,  2086,  2089,  2090,  2091,  2092,  2100,
+    2103,  2104,  2117,  2118,  2119,  2120,  2124,  2125,  2128,  2129,
+    2130,  2131,  2132,  2133,  2134,  2135,  2138,  2139,  2140,  2143,
+    2144,  2145,  2146,  2147,  2148,  2149,  2150,  2151,  2152,  2153,
+    2154,  2155,  2156,  2157,  2158,  2159,  2160,  2161,  2162,  2163,
+    2164,  2165,  2171,  2172,  2173,  2174,  2175,  2176,  2177,  2178,
+    2179,  2180,  2181,  2182,  2194,  2202,  2206,  2207,  2210,  2211,
+    2212,  2213,  2214,  2215,  2218,  2220,  2221,  2224,  2225,  2228,
+    2232,  2237
 };
 #endif
 
@@ -1403,99 +1404,99 @@
 
 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
    STATE-NUM.  */
-#define YYPACT_NINF -593
+#define YYPACT_NINF -588
 static const yytype_int16 yypact[] =
 {
-     -16,    -3,    -3,    45,  -593,  -593,  -593,  -593,    20,  -593,
-      77,  -593,    43,    18,    75,   -43,    38,  -593,  1101,    76,
-       4,  -593,    93,  -593,  -593,    16,   105,   107,  -593,   699,
-    -593,    20,  -593,  -593,    38,  -593,  -593,    -3,    87,   110,
-     923,   165,    -3,  -593,  -593,  -593,  -593,  -593,  -593,  -593,
-    -593,  -593,  -593,    31,  -593,  -593,   114,  -593,  -593,  -593,
-    -593,  -593,  -593,  -593,  -593,  -593,  -593,  -593,  -593,  -593,
-    -593,  -593,    55,    49,    -3,  -593,  1101,  -593,  -593,  -593,
-    -593,  -593,  -593,    35,  -593,  -593,  -593,   889,   137,    54,
-    -593,  -593,  -593,  -593,    62,  -593,  -593,  -593,    79,  -593,
-    -593,   815,  -593,  -593,  -593,  -593,  -593,  -593,  1101,  1101,
-    1101,  -593,  -593,    34,   740,   816,  -593,   102,    53,  -593,
-    -593,     4,  -593,  -593,  -593,   109,   106,  -593,  -593,  -593,
-     113,   116,  -593,  -593,  -593,    -9,  -593,  -593,  -593,  -593,
-    -593,  -593,  -593,   699,  -593,  -593,  -593,  -593,  -593,  -593,
-     128,   129,   128,  -593,   131,  -593,  -593,   128,   128,   128,
-    -593,   125,   126,   127,  -593,  -593,  -593,    -3,  -593,  -593,
-     114,  -593,    32,  -593,    49,   222,  1101,  -593,   889,  -593,
-     213,  -593,  -593,   923,  -593,   171,  -593,  -593,  -593,  -593,
-     228,   229,   142,  -593,   253,  -593,  -593,  -593,     4,  -593,
-    -593,  -593,  -593,  -593,   112,  -593,  -593,   164,   172,  -593,
-     174,   177,  -593,  -593,  -593,  -593,  -593,  -593,  -593,   534,
-     227,  -593,  -593,   227,   186,   194,   112,  -593,   266,  -593,
-    -593,  -593,  -593,  -593,   171,  -593,   227,   165,   233,   182,
-     182,    -3,    -3,    -3,   183,   462,   261,   649,   768,   906,
-     935,   399,  1101,  -593,    98,  1054,    -3,  -593,  -593,  -593,
-    -593,  -593,  -593,  -593,  -593,  -593,  -593,  -593,  -593,    -3,
-     699,  -593,  -593,    -3,  -593,    -3,   952,  -593,  -593,  -593,
-    -593,  -593,  -593,  -593,    -3,  -593,  -593,  -593,   182,   179,
-     184,  -593,  -593,  -593,  -593,  -593,  -593,  -593,    -3,  -593,
-    -593,   843,   -59,    62,  -593,  -593,  -593,  -593,  -593,  1101,
-     206,  -593,  -593,  -593,  -593,  -593,  1101,  -593,  1101,  -593,
-    -593,  -593,   969,    -3,    -3,   298,   299,   289,    -3,    -3,
-     199,  -593,    -3,    -3,   197,   268,   205,   208,  -593,  -593,
-    -593,  -593,  -593,  -593,  -593,   203,  -593,  -593,     8,     8,
-       8,     8,     8,     8,     8,   155,    15,   232,   232,   232,
-     282,     8,   232,     8,  -593,  -593,   586,   462,  -593,  -593,
-    -593,  -593,   986,  1003,  -593,  -593,  -593,  -593,  -593,  -593,
-    -593,  -593,  -593,   682,   889,   207,   212,  -593,  -593,   -10,
-    -593,   237,   209,   284,   215,   217,  -593,  -593,  -593,  -593,
-    -593,  -593,  -593,   889,   317,   298,  -593,   889,   318,   299,
-    -593,   889,   120,   289,  -593,  -593,  -593,   234,  -593,  -593,
-     889,   399,  -593,  1054,    67,   889,  -593,  -593,  1101,  1101,
-    1101,  1101,  1101,  1101,  1101,   297,   302,   303,   304,   305,
-     307,   308,   311,  1110,     8,  1101,  1101,  1101,  -593,  -593,
-    -593,  -593,  -593,  -593,   324,   436,   841,  1101,  1101,   889,
-    1101,  -593,  -593,  -593,   182,  -593,  -593,  -593,  -593,  -593,
-    -593,  -593,  -593,   557,   650,   735,   735,    98,  -593,  -593,
-    -593,   699,  -593,  -593,  -593,  -593,   735,   309,   -19,   889,
-    -593,   889,  -593,   128,  -593,  -593,  -593,   238,   128,  -593,
-    -593,  -593,  -593,  -593,  -593,  1101,  -593,  -593,  -593,  1088,
-     889,  -593,   969,    -5,    -3,    -3,  -593,    -3,    -3,  -593,
-      -3,   816,   462,   816,    -3,  -593,    -3,  -593,  -593,  -593,
-    -593,  -593,  -593,  -593,  -593,  -593,  -593,  -593,  -593,  1101,
-    1101,  1101,  1101,  1101,  1101,  1101,  1101,  1101,  -593,  1101,
-    -593,  -593,  -593,  -593,  -593,  -593,  -593,  -593,  -593,  -593,
-    -593,  -593,  -593,  -593,  -593,  -593,  -593,  -593,  -593,  -593,
-    -593,  -593,  -593,  -593,  -593,  -593,  -593,  -593,  -593,  -593,
-    -593,  -593,  -593,  -593,  -593,  -593,  -593,  -593,  -593,  -593,
-    -593,  -593,  -593,  -593,  1071,  1020,  1037,  -593,   235,   257,
-     889,  -593,  -593,  -593,  -593,   171,  -593,  -593,  -593,  -593,
-    -593,  -593,  -593,   128,  -593,  -593,  -593,  -593,  -593,  -593,
-    -593,   325,   259,  -593,  -593,    40,  -593,  -593,  -593,  -593,
-    -593,  -593,  -593,  -593,  -593,  -593,  -593,  -593,  -593,  -593,
-    -593,  -593,  -593,  -593,  -593,   699,   699,  -593,   262,  -593,
-     367,   816,  -593,  1054,  -593,   357,    40,  -593,    54,    54,
-    -593,   586,  -593,    -3,    -3,  -593,  -593,  -593,  -593
+      70,    25,    25,    55,  -588,  -588,  -588,  -588,    44,  -588,
+      73,  -588,    22,    41,    27,     7,    57,  -588,   923,    95,
+      18,  -588,    25,  -588,  -588,    20,    25,    25,  -588,   699,
+    -588,    44,  -588,  -588,    57,  -588,  -588,    25,   106,   109,
+     816,   127,    25,  -588,  -588,  -588,  -588,  -588,  -588,  -588,
+    -588,  -588,  -588,    37,  -588,  -588,   115,  -588,  -588,  -588,
+    -588,  -588,  -588,  -588,  -588,  -588,  -588,  -588,  -588,  -588,
+    -588,  -588,    62,    32,    25,  -588,   923,  -588,  -588,  -588,
+    -588,  -588,  -588,    47,  -588,  -588,  -588,   889,    25,    50,
+    -588,  -588,  -588,  -588,    58,  -588,  -588,  -588,    72,  -588,
+    -588,   815,  -588,  -588,  -588,  -588,  -588,  -588,   923,   923,
+     923,  -588,  -588,    30,   740,   325,  -588,    82,    96,  -588,
+    -588,    18,  -588,  -588,  -588,    76,   114,  -588,  -588,  -588,
+     110,   125,  -588,  -588,  -588,    68,  -588,  -588,  -588,  -588,
+    -588,  -588,  -588,   699,  -588,  -588,  -588,  -588,  -588,  -588,
+     129,   133,   129,  -588,   135,  -588,  -588,   129,   129,   129,
+    -588,   140,   143,   144,  -588,  -588,  -588,    25,  -588,  -588,
+     115,  -588,    15,  -588,    32,   222,   923,  -588,   889,  -588,
+     228,  -588,  -588,   816,  -588,   171,  -588,  -588,  -588,  -588,
+     237,   239,   173,  -588,   279,  -588,  -588,  -588,    18,  -588,
+    -588,  -588,  -588,  -588,   117,  -588,  -588,   168,   169,  -588,
+     170,   174,  -588,  -588,  -588,  -588,  -588,  -588,  -588,   534,
+     238,  -588,  -588,   238,   182,   187,   117,  -588,    25,  -588,
+    -588,  -588,  -588,  -588,   171,  -588,   238,   127,   150,   175,
+     175,    25,    25,    25,   179,   462,   254,   649,   768,   906,
+     935,   399,   923,  -588,    40,  1071,    25,  -588,  -588,  -588,
+    -588,  -588,  -588,  -588,  -588,  -588,  -588,  -588,  -588,    25,
+     699,  -588,  -588,    25,  -588,    25,   952,  -588,  -588,  -588,
+    -588,  -588,  -588,  -588,    25,  -588,  -588,  -588,   175,   172,
+     188,  -588,  -588,  -588,  -588,  -588,  -588,  -588,    25,  -588,
+    -588,   843,     4,    58,  -588,  -588,  -588,  -588,  -588,   923,
+     191,  -588,  -588,  -588,  -588,  -588,   923,  -588,   923,  -588,
+    -588,  -588,   969,    25,    25,   283,   296,   288,    25,    25,
+     197,  -588,    25,    25,   193,   268,   205,   203,  -588,  -588,
+    -588,  -588,  -588,  -588,  -588,   199,  -588,  -588,   -21,   -21,
+     -21,   -21,   -21,   -21,   -21,   270,    -7,   204,   204,   204,
+     285,   -21,   204,   -21,  -588,  -588,  1105,   462,  -588,  -588,
+    -588,  -588,  1003,  1020,  -588,  -588,  -588,  -588,  -588,  -588,
+    -588,  -588,  -588,   682,   889,   206,   101,  -588,  -588,    -6,
+    -588,   240,   207,   277,   215,   216,  -588,  -588,  -588,  -588,
+    -588,  -588,  -588,   889,   316,   283,  -588,   889,   315,   296,
+    -588,   889,   105,   288,  -588,  -588,  -588,   234,  -588,  -588,
+     889,   399,  -588,  1071,   128,   889,  -588,  -588,   923,   923,
+     923,   923,   923,   923,   923,   297,   298,   299,   302,   303,
+     304,   305,   307,  1134,   -21,   923,   923,   923,  -588,  -588,
+    -588,  -588,  -588,  -588,   436,   841,   986,   923,   923,   889,
+     923,  -588,  -588,  -588,   175,  -588,  -588,  -588,  -588,  -588,
+    -588,  -588,  -588,   557,   650,   735,   735,    40,  -588,  -588,
+    -588,   699,  -588,  -588,  -588,  -588,   735,   318,   -10,   889,
+    -588,   889,  -588,   129,  -588,  -588,  -588,   236,   129,  -588,
+    -588,  -588,  -588,  -588,  -588,   923,  -588,  -588,  -588,  1121,
+     889,  -588,   969,     2,    25,    25,  -588,    25,    25,  -588,
+      25,   325,   462,   325,    25,  -588,    25,  -588,  -588,  -588,
+    -588,  -588,  -588,  -588,  -588,  -588,  -588,  -588,  -588,   923,
+     923,   923,   923,   923,   923,   923,   923,   923,  -588,   923,
+    -588,  -588,  -588,  -588,  -588,  -588,  -588,  -588,  -588,  -588,
+    -588,  -588,  -588,  -588,  -588,  -588,  -588,  -588,  -588,  -588,
+    -588,  -588,  -588,  -588,  -588,  -588,  -588,  -588,  -588,  -588,
+    -588,  -588,  -588,  -588,  -588,  -588,  -588,  -588,  -588,  -588,
+    -588,  -588,  -588,  -588,  1088,  1037,  1054,  -588,   235,   250,
+     889,  -588,  -588,  -588,  -588,   171,  -588,  -588,  -588,  -588,
+    -588,  -588,  -588,   129,  -588,  -588,  -588,  -588,  -588,  -588,
+    -588,    25,   251,  -588,  -588,    21,  -588,  -588,  -588,  -588,
+    -588,  -588,  -588,  -588,  -588,  -588,  -588,  -588,  -588,  -588,
+    -588,  -588,  -588,  -588,  -588,   699,   699,  -588,   253,  -588,
+     343,   325,  -588,  1071,  -588,   332,    21,  -588,    50,    50,
+    -588,  1105,  -588,    25,    25,  -588,  -588,  -588,  -588
 };
 
 /* YYPGOTO[NTERM-NUM].  */
 static const yytype_int16 yypgoto[] =
 {
-    -593,  -593,  -593,    19,    -1,  -593,   271,     9,  -593,  -593,
-    -593,  -593,  -593,   210,  -593,  -593,   161,  -593,  -593,  -593,
-    -593,    12,  -593,    13,  -593,  -593,   219,  -593,  -593,  -593,
-     211,   341,  -593,  -593,  -593,  -593,  -228,  -593,  -593,  -593,
-    -593,  -593,  -593,  -593,  -593,  -593,  -593,  -593,   145,  -593,
-    -593,  -194,   -64,  -593,  -593,   221,  -593,  -593,  -593,  -172,
-    -593,  -171,  -593,  -593,  -593,  -593,  -207,  -593,   123,  -422,
-    -593,   254,   -83,  -593,   -81,  -593,  -593,  -593,  -593,  -593,
-    -593,  -593,  -593,  -593,  -593,  -593,  -244,  -593,  -592,  -593,
-    -106,  -593,  -170,  -593,  -593,  -593,  -593,  -593,    -8,  -593,
-    -593,  -593,  -593,  -252,  -593,  -593,  -227,  -593,  -593,  -116,
-    -253,   -98,   166,  -593,  -593,  -415,  -593,   -12,  -593,  -593,
-    -593,  -593,  -220,  -593,  -593,   -99,  -593,  -257,   -96,  -593,
-    -593,  -593,  -593,    17,  -593,  -593,    22,  -593,  -593,  -149,
-    -148,  -593,  -593,  -593,  -593,  -593,  -593,    -2,  -593,  -593,
-     -80,   -27,    44,  -176,  -152,  -193,  -593,   -25,   -13,  -205,
-    -593,  -385,  -593,  -593,  -593,  -593,   395,  -593,   394,  -593,
-    -593,    51
+    -588,  -588,  -588,    42,    -1,  -588,   246,     9,  -588,  -588,
+    -588,  -588,  -588,   200,  -588,  -588,   151,  -588,  -588,  -588,
+    -588,    -2,  -588,    12,  -588,  -588,   208,  -588,  -588,  -588,
+     198,   330,  -588,  -588,  -588,  -588,  -230,  -588,  -588,  -588,
+    -588,  -588,  -588,  -588,  -588,  -588,  -588,  -588,   136,  -588,
+    -588,  -157,   -74,  -588,  -588,   210,  -588,  -588,  -588,  -155,
+    -588,  -153,  -588,  -588,  -588,  -588,  -204,  -588,   112,  -408,
+    -588,   243,   -94,  -588,   -81,  -588,  -588,  -588,  -588,  -588,
+    -588,  -588,  -588,  -588,  -588,  -588,  -244,  -588,  -587,  -588,
+    -116,  -588,  -144,  -588,  -588,  -588,  -588,  -588,   -20,  -588,
+    -588,  -588,  -588,  -264,  -588,  -588,  -227,  -588,  -588,  -128,
+    -266,   -98,   153,  -588,  -588,  -409,  -588,   -26,  -588,  -588,
+    -588,  -588,  -228,  -588,  -588,  -113,  -588,  -261,  -109,  -588,
+    -588,  -588,  -588,    -3,  -588,  -588,     1,  -588,  -588,  -149,
+    -148,  -588,  -588,  -588,  -588,  -588,  -588,    13,  -588,  -588,
+     -80,   -27,    29,  -184,  -178,  -190,  -588,   -23,   -13,  -199,
+    -588,  -405,  -588,  -588,  -588,  -588,   372,  -588,   374,  -588,
+    -588,    34
 };
 
 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
@@ -1505,55 +1506,55 @@
 #define YYTABLE_NINF -367
 static const yytype_int16 yytable[] =
 {
-       6,     6,    95,   184,    97,    70,   315,   136,   529,   187,
-     188,   189,   270,   144,   303,  -161,    98,   167,   329,    44,
-     324,    10,    46,    48,     4,   262,   301,   107,    12,    13,
-      14,     4,    15,   654,    -6,    37,   102,    38,    39,    40,
-     270,   113,   303,    13,    14,    11,    15,   263,   265,   279,
-      41,   236,   426,   262,   301,    16,    17,   171,   332,   446,
-    -275,   112,   339,   133,   654,    54,   197,    60,   365,  -275,
-     653,   310,     4,   129,    17,   263,   265,   279,    37,    56,
-      38,    39,    40,   362,   316,    60,    13,    14,    53,    15,
-     595,   596,   613,    41,   614,   161,   162,   163,   206,     1,
-       2,   600,   168,    87,   213,   429,   430,   431,   432,   433,
-     434,   505,    72,   165,   177,   178,    95,   458,    97,   460,
-      55,   289,    44,    73,    18,    46,    48,    75,    19,   427,
-      98,    20,   103,   521,   222,    76,   447,    21,    18,    77,
-     466,    78,    19,   198,   199,   200,   514,   289,   522,   289,
-     517,   523,   115,   213,   520,   104,   484,  -276,   201,   116,
-     121,   122,   123,   133,   493,   494,   195,   495,   496,   120,
-     107,   142,   214,   334,   124,   143,   481,   170,   488,   469,
-     472,    18,   455,   456,    87,    19,   459,   217,   218,   345,
-     486,   435,   436,   437,   438,   439,   440,   441,   442,   443,
-     549,  -275,   108,   109,   444,   110,   302,    61,    62,    63,
-      64,    65,    66,    67,    68,    69,   209,  -276,   223,   224,
-      87,   214,   385,   658,   659,   169,  -276,   174,   528,   173,
-     339,   256,   168,   175,   302,   317,   320,   176,   663,   333,
-     325,   326,   327,    95,   570,    97,     4,   180,   183,   361,
-     185,   363,   190,   191,   192,   340,   204,    98,   207,   256,
-     220,   557,   561,   565,   304,   305,   306,   307,   341,   289,
-     108,   109,   346,   110,   347,   215,   445,   216,   318,    79,
-      80,    81,    82,   364,   231,   289,   448,   449,   450,   451,
-     452,   453,   232,    87,   233,   311,   387,   368,   234,   312,
-     314,   322,   255,   391,   490,   392,   330,   366,   492,   493,
-     494,   367,   495,   496,   497,   498,   388,   403,   411,   407,
-     417,   421,   401,   402,   420,   422,   457,   415,   416,   423,
-     425,   418,   419,   507,   491,   511,   509,   510,   512,   515,
-     527,   539,   518,  -165,   604,   531,   540,   541,   542,   543,
-     606,   544,   545,   465,   168,   546,   645,   605,   487,   650,
-      61,    62,    63,    64,    65,    66,    67,    68,    69,   553,
-     302,   554,   555,   134,    84,    85,    86,   648,   646,   568,
-     651,   661,   660,   664,   164,   499,   205,   313,   506,   196,
-     526,   114,   331,   343,   208,   203,   597,   179,   598,   607,
-     599,   638,   641,   644,   665,   525,   622,   601,   666,   602,
-     328,   603,   530,   612,   611,   532,   533,   534,   535,   536,
-     537,   538,   516,   621,   623,   624,    99,   485,   100,     0,
-     548,   519,   550,   551,   552,    61,    62,    63,    64,    65,
+       6,     6,    95,   184,   315,    70,    97,   136,    46,   187,
+     188,   189,   324,   144,   529,   270,    98,   167,   329,    44,
+     303,    75,    48,   426,  -161,    77,    78,   107,     4,   301,
+      -6,    37,   236,    38,    39,    40,   102,   446,   654,    13,
+      14,   113,    15,   270,    10,   310,    41,   171,   303,   197,
+      60,   653,    12,    13,    14,    11,    15,   301,   316,     4,
+     365,   332,   262,   133,   263,   339,   265,    53,    60,   654,
+     595,   596,    55,   129,    37,   279,    38,    39,    40,    16,
+      17,   600,    13,    14,   112,    15,   362,   142,    54,    41,
+     262,     4,   263,    17,   265,   161,   162,   163,   206,   613,
+     427,   614,   168,   279,   213,   429,   430,   431,   432,   433,
+     434,    46,    87,   165,   447,   505,    95,   458,   521,   460,
+      97,   289,    44,  -275,   222,    48,   198,   199,   200,    56,
+      98,    72,  -275,   522,    18,     4,   523,    73,    19,    76,
+     466,   201,   514,   121,   122,   123,   517,   289,    18,   289,
+     520,   103,    19,   213,   104,    20,   484,   124,   115,  -276,
+     116,    21,    87,   133,   108,   109,   195,   110,  -276,  -276,
+     107,   143,   214,   334,   455,   456,   120,    18,   459,   481,
+      87,    19,   469,   472,   488,     1,     2,   108,   109,   345,
+     110,   177,   178,   486,  -275,   318,   173,   492,   493,   494,
+     549,   495,   496,   497,   498,   169,   302,    61,    62,    63,
+      64,    65,    66,    67,    68,    69,   209,   256,   217,   218,
+     170,   214,   385,   223,   224,   493,   494,   314,   495,   496,
+     175,   528,   168,   339,   302,   174,   570,   658,   659,   333,
+     325,   326,   327,    95,   663,   256,   176,    97,   180,   361,
+     317,   320,   183,   363,   185,   340,   204,    98,   448,   449,
+     450,   451,   452,   453,   557,   561,   565,   190,   341,   289,
+     191,   192,   346,   207,   347,   304,   305,   306,   307,    79,
+      80,    81,    82,   364,   215,   289,   220,   216,   231,   232,
+     233,   311,   312,    87,   322,   234,   387,   368,   255,   330,
+     366,   388,   403,   391,   490,   392,   435,   436,   437,   438,
+     439,   440,   441,   442,   443,   367,   407,   411,   417,   444,
+     420,   421,   401,   402,   423,   422,   425,   415,   416,   457,
+     510,   418,   419,   491,   509,   511,   507,   512,   515,   518,
+     527,   539,   540,   541,   604,   531,   542,   543,   544,   545,
+     606,   546,  -165,   465,   168,   605,   645,   661,   664,   164,
+     487,    61,    62,    63,    64,    65,    66,    67,    68,    69,
+     302,   646,   651,   660,   166,   648,   205,   313,   196,   568,
+     114,   208,   343,   331,   203,   499,   179,   598,   506,   607,
+     526,   445,   665,   525,   622,   666,   597,   328,   530,   612,
+     599,   611,   516,    99,   638,   641,   644,   601,   100,   602,
+     519,   603,   485,     0,     0,   532,   533,   534,   535,   536,
+     537,   538,     0,   621,   623,   624,     0,     0,     0,     0,
+     548,     0,   550,   551,   552,    61,    62,    63,    64,    65,
       66,    67,    68,    69,   566,   567,     0,   569,   134,    84,
-      85,    86,     0,     0,    95,     0,    97,     0,     0,     0,
-     339,     0,     0,     0,   649,     0,     0,     0,    98,     0,
+      85,    86,     0,     0,    95,     0,     0,     0,    97,     0,
+       0,     0,     0,   339,   649,     0,     0,     0,    98,     0,
        0,     0,    61,    62,    63,    64,    65,    66,    67,    68,
-      69,   558,   609,   559,   560,   134,    84,    85,    86,     0,
+      69,   553,   609,   554,   555,   134,    84,    85,    86,     0,
        0,     0,   391,     0,     0,     0,   610,     0,    61,    62,
       63,    64,    65,    66,    67,    68,    69,   253,   168,   168,
      168,   166,     0,   616,   617,     0,   618,   619,     0,   620,
@@ -1567,8 +1568,8 @@
        0,  -160,   214,  -138,  -138,  -138,  -138,  -138,  -138,  -138,
     -138,  -138,  -138,  -138,  -138,  -138,  -138,  -138,  -138,  -138,
        0,     0,     0,     0,     0,     0,     0,     0,    95,    95,
-      97,    97,    61,    62,    63,    64,    65,    66,    67,    68,
-      69,   461,    98,    98,     0,   462,     0,   463,   168,     0,
+     650,     0,    97,    97,     0,     0,     0,     0,     0,     0,
+       0,     0,    98,    98,     0,     0,     0,     0,   168,     0,
        0,     0,     0,     0,     0,    20,     0,     0,   465,     0,
       37,     0,     0,   255,     0,     0,     0,    12,    13,    14,
      236,     0,   667,   668,   237,   238,   239,   240,     0,     0,
@@ -1591,9 +1592,9 @@
      154,   155,   156,   157,   158,   159,  -366,  -366,  -366,  -366,
     -366,  -366,  -366,  -366,  -366,  -366,  -366,  -366,  -366,  -366,
      145,     0,    61,    62,    63,    64,    65,    66,    67,    68,
-      69,     0,     0,     0,   585,   166,   586,   587,   588,   589,
+      69,   105,     0,     0,   585,     0,   586,   587,   588,   589,
      590,   591,   592,   593,     0,     0,     0,    61,    62,    63,
-      64,    65,    66,    67,    68,    69,   562,  -366,   563,   564,
+      64,    65,    66,    67,    68,    69,   558,  -366,   559,   560,
      134,    84,    85,    86,     0,  -366,  -366,   146,   147,   148,
      149,   150,   151,   152,   153,   154,   155,   156,   157,   158,
      159,   369,   370,   371,   372,   373,   374,   375,   376,   377,
@@ -1601,77 +1602,79 @@
       66,    67,    68,    69,    79,    80,    81,    82,   134,    84,
       85,    86,  -229,  -229,  -229,  -229,  -229,  -229,  -229,  -229,
     -229,  -229,  -229,  -229,  -229,  -229,  -229,  -229,  -229,    61,
-      62,    63,    64,    65,    66,    67,    68,    69,   105,     0,
+      62,    63,    64,    65,    66,    67,    68,    69,     0,     0,
      383,  -230,  -230,  -230,  -230,  -230,  -230,  -230,  -230,  -230,
     -230,  -230,  -230,  -230,  -230,  -230,  -230,  -230,   348,   349,
      350,   351,   352,   353,   354,   355,   356,   357,    80,   358,
      359,   134,    84,    85,    86,    61,    62,    63,    64,    65,
       66,    67,    68,    69,   393,    80,    81,    82,   134,    84,
       85,    86,    61,    62,    63,    64,    65,    66,    67,    68,
-      69,     0,     0,   467,   468,   134,    84,    85,    86,    61,
+      69,   562,     0,   563,   564,   134,    84,    85,    86,    61,
       62,    63,    64,    65,    66,    67,    68,    69,     0,     0,
-     470,   471,   134,    84,    85,    86,    61,    62,    63,    64,
-      65,    66,    67,    68,    69,     0,     0,   639,   640,   134,
+     467,   468,   134,    84,    85,    86,    61,    62,    63,    64,
+      65,    66,    67,    68,    69,     0,     0,   470,   471,   134,
       84,    85,    86,    61,    62,    63,    64,    65,    66,    67,
-      68,    69,     0,     0,   642,   643,   134,    84,    85,    86,
-      61,    62,    63,    64,    65,    66,    67,    68,    69,   335,
-       0,     0,     0,   134,    84,    85,    86,    61,    62,    63,
-      64,    65,    66,    67,    68,    69,   637,     0,     0,     0,
+      68,    69,     0,     0,   639,   640,   134,    84,    85,    86,
+      61,    62,    63,    64,    65,    66,    67,    68,    69,     0,
+       0,   642,   643,   134,    84,    85,    86,    61,    62,    63,
+      64,    65,    66,    67,    68,    69,   335,     0,     0,     0,
      134,    84,    85,    86,    61,    62,    63,    64,    65,    66,
-      67,    68,    69,    79,    80,    81,    82,    61,    62,    63,
-      64,    65,    66,    67,    68,    69,    61,    62,    63,    64,
-      65,    66,    67,    68,   547
+      67,    68,    69,   637,     0,     0,     0,   134,    84,    85,
+      86,    61,    62,    63,    64,    65,    66,    67,    68,    69,
+     461,     0,     0,     0,   462,     0,   463,    61,    62,    63,
+      64,    65,    66,    67,    68,    69,    79,    80,    81,    82,
+      61,    62,    63,    64,    65,    66,    67,    68,   547
 };
 
 static const yytype_int16 yycheck[] =
 {
-       1,     2,    29,   152,    29,    18,   234,    87,   423,   157,
-     158,   159,   219,    94,   219,    34,    29,   115,   245,    10,
-     240,     2,    10,    10,    34,   219,   219,    40,     8,     9,
-      10,    34,    12,   625,     0,     1,    37,     3,     4,     5,
-     247,    42,   247,     9,    10,     0,    12,   219,   219,   219,
-      16,    11,    44,   247,   247,    35,    36,   121,   251,    44,
-     119,    42,   255,    76,   656,    47,    34,    16,   288,   128,
-      30,   223,    34,    74,    36,   247,   247,   247,     1,   122,
-       3,     4,     5,   276,   236,    34,     9,    10,    45,    12,
-     475,   476,    97,    16,    99,   108,   109,   110,   178,   115,
-     116,   486,   115,   122,   185,   349,   350,   351,   352,   353,
-     354,   121,    36,   114,   123,   124,   143,   361,   143,   363,
-      45,   219,   113,   119,   104,   113,   113,    34,   108,   121,
-     143,   111,    45,    13,   198,   119,   121,   117,   104,    34,
-     367,    34,   108,   111,   112,   113,   403,   245,    28,   247,
-     407,    31,   121,   234,   411,    45,   383,   122,   126,    45,
-     111,   112,   113,   176,    97,    98,   167,   100,   101,   114,
-     183,    34,   185,   254,   125,   121,   383,   124,   383,   372,
-     373,   104,   358,   359,   122,   108,   362,    45,    46,   270,
+       1,     2,    29,   152,   234,    18,    29,    87,    10,   157,
+     158,   159,   240,    94,   423,   219,    29,   115,   245,    10,
+     219,    22,    10,    44,    34,    26,    27,    40,    34,   219,
+       0,     1,    11,     3,     4,     5,    37,    44,   625,     9,
+      10,    42,    12,   247,     2,   223,    16,   121,   247,    34,
+      16,    30,     8,     9,    10,     0,    12,   247,   236,    34,
+     288,   251,   219,    76,   219,   255,   219,    45,    34,   656,
+     475,   476,    45,    74,     1,   219,     3,     4,     5,    35,
+      36,   486,     9,    10,    42,    12,   276,    88,    47,    16,
+     247,    34,   247,    36,   247,   108,   109,   110,   178,    97,
+     121,    99,   115,   247,   185,   349,   350,   351,   352,   353,
+     354,   113,   122,   114,   121,   121,   143,   361,    13,   363,
+     143,   219,   113,   119,   198,   113,   111,   112,   113,   122,
+     143,    36,   128,    28,   104,    34,    31,   119,   108,   119,
+     367,   126,   403,   111,   112,   113,   407,   245,   104,   247,
+     411,    45,   108,   234,    45,   111,   383,   125,   121,   119,
+      45,   117,   122,   176,    37,    38,   167,    40,   128,   122,
+     183,   121,   185,   254,   358,   359,   114,   104,   362,   383,
+     122,   108,   372,   373,   383,   115,   116,    37,    38,   270,
+      40,   123,   124,   383,   122,    45,   120,    96,    97,    98,
+     444,   100,   101,   102,   103,   123,   219,    36,    37,    38,
+      39,    40,    41,    42,    43,    44,    45,   219,    45,    46,
+     124,   234,   303,   106,   107,    97,    98,   228,   100,   101,
+     120,   421,   245,   423,   247,   121,   464,   645,   646,   252,
+     241,   242,   243,   270,   653,   247,   121,   270,   119,   276,
+     237,   238,   119,   276,   119,   256,    34,   270,    54,    55,
+      56,    57,    58,    59,   454,   455,   456,   127,   269,   367,
+     127,   127,   273,    45,   275,    37,    38,    39,    40,    45,
+      46,    47,    48,   284,    47,   383,     7,    48,   120,   120,
+     120,   109,   105,   122,   119,   121,   309,   298,   119,    45,
+     128,   110,    19,   316,   384,   318,    36,    37,    38,    39,
+      40,    41,    42,    43,    44,   127,    20,    29,   121,    49,
+     127,    53,   323,   324,   121,   120,   127,   328,   329,    44,
+      53,   332,   333,   127,   127,   120,    96,   121,    22,    24,
+     420,    44,    44,    44,   493,   425,    44,    44,    44,    44,
+     498,    44,    34,   366,   367,   119,   121,    14,    26,   113,
      383,    36,    37,    38,    39,    40,    41,    42,    43,    44,
-     444,   122,    37,    38,    49,    40,   219,    36,    37,    38,
-      39,    40,    41,    42,    43,    44,    45,   119,   106,   107,
-     122,   234,   303,   645,   646,   123,   128,   121,   421,   120,
-     423,   219,   245,   120,   247,   237,   238,   121,   653,   252,
-     241,   242,   243,   270,   464,   270,    34,   119,   119,   276,
-     119,   276,   127,   127,   127,   256,    34,   270,    45,   247,
-       7,   454,   455,   456,    37,    38,    39,    40,   269,   367,
-      37,    38,   273,    40,   275,    47,   121,    48,    45,    45,
-      46,    47,    48,   284,   120,   383,    54,    55,    56,    57,
-      58,    59,   120,   122,   120,   109,   309,   298,   121,   105,
-      34,   119,   119,   316,   384,   318,    45,   128,    96,    97,
-      98,   127,   100,   101,   102,   103,   110,    19,    29,    20,
-     121,    53,   323,   324,   127,   120,    44,   328,   329,   121,
-     127,   332,   333,    96,   127,   120,   127,    53,   121,    22,
-     420,    44,    24,    34,   493,   425,    44,    44,    44,    44,
-     498,    44,    44,   366,   367,    44,   121,   119,   383,    34,
-      36,    37,    38,    39,    40,    41,    42,    43,    44,    45,
-     383,    47,    48,    49,    50,    51,    52,   605,   121,   459,
-     121,    14,   120,    26,   113,   386,   176,   226,   389,   170,
-     417,    50,   247,   270,   183,   174,   477,   143,   481,   505,
-     481,   594,   595,   596,   656,   413,   522,   488,   661,   489,
-     244,   491,   424,   512,   510,   428,   429,   430,   431,   432,
-     433,   434,   405,   521,   522,   523,    31,   383,    34,    -1,
-     443,   409,   445,   446,   447,    36,    37,    38,    39,    40,
+     383,   121,   121,   120,    49,   605,   176,   226,   170,   459,
+      50,   183,   270,   247,   174,   386,   143,   481,   389,   505,
+     417,   121,   656,   413,   522,   661,   477,   244,   424,   512,
+     481,   510,   405,    31,   594,   595,   596,   488,    34,   489,
+     409,   491,   383,    -1,    -1,   428,   429,   430,   431,   432,
+     433,   434,    -1,   521,   522,   523,    -1,    -1,    -1,    -1,
+     443,    -1,   445,   446,   447,    36,    37,    38,    39,    40,
       41,    42,    43,    44,   457,   458,    -1,   460,    49,    50,
-      51,    52,    -1,    -1,   481,    -1,   481,    -1,    -1,    -1,
-     653,    -1,    -1,    -1,   613,    -1,    -1,    -1,   481,    -1,
+      51,    52,    -1,    -1,   481,    -1,    -1,    -1,   481,    -1,
+      -1,    -1,    -1,   653,   613,    -1,    -1,    -1,   481,    -1,
       -1,    -1,    36,    37,    38,    39,    40,    41,    42,    43,
       44,    45,   509,    47,    48,    49,    50,    51,    52,    -1,
       -1,    -1,   505,    -1,    -1,    -1,   509,    -1,    36,    37,
@@ -1687,8 +1690,8 @@
       -1,    34,   605,    36,    37,    38,    39,    40,    41,    42,
       43,    44,    45,    46,    47,    48,    49,    50,    51,    52,
       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   645,   646,
-     645,   646,    36,    37,    38,    39,    40,    41,    42,    43,
-      44,    45,   645,   646,    -1,    49,    -1,    51,   651,    -1,
+     621,    -1,   645,   646,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,   645,   646,    -1,    -1,    -1,    -1,   651,    -1,
       -1,    -1,    -1,    -1,    -1,   111,    -1,    -1,   661,    -1,
        1,    -1,    -1,   119,    -1,    -1,    -1,     8,     9,    10,
       11,    -1,   663,   664,    15,    16,    17,    18,    -1,    -1,
@@ -1711,7 +1714,7 @@
       90,    91,    92,    93,    94,    95,    68,    69,    70,    71,
       72,    73,    74,    75,    76,    77,    78,    79,    80,    81,
       35,    -1,    36,    37,    38,    39,    40,    41,    42,    43,
-      44,    -1,    -1,    -1,   129,    49,   131,   132,   133,   134,
+      44,    45,    -1,    -1,   129,    -1,   131,   132,   133,   134,
      135,   136,   137,   138,    -1,    -1,    -1,    36,    37,    38,
       39,    40,    41,    42,    43,    44,    45,   119,    47,    48,
       49,    50,    51,    52,    -1,   127,   128,    82,    83,    84,
@@ -1721,26 +1724,28 @@
       41,    42,    43,    44,    45,    46,    47,    48,    49,    50,
       51,    52,    36,    37,    38,    39,    40,    41,    42,    43,
       44,    45,    46,    47,    48,    49,    50,    51,    52,    36,
-      37,    38,    39,    40,    41,    42,    43,    44,    45,    -1,
+      37,    38,    39,    40,    41,    42,    43,    44,    -1,    -1,
      127,    36,    37,    38,    39,    40,    41,    42,    43,    44,
       45,    46,    47,    48,    49,    50,    51,    52,    36,    37,
       38,    39,    40,    41,    42,    43,    44,    45,    46,    47,
       48,    49,    50,    51,    52,    36,    37,    38,    39,    40,
       41,    42,    43,    44,    45,    46,    47,    48,    49,    50,
       51,    52,    36,    37,    38,    39,    40,    41,    42,    43,
-      44,    -1,    -1,    47,    48,    49,    50,    51,    52,    36,
+      44,    45,    -1,    47,    48,    49,    50,    51,    52,    36,
       37,    38,    39,    40,    41,    42,    43,    44,    -1,    -1,
       47,    48,    49,    50,    51,    52,    36,    37,    38,    39,
       40,    41,    42,    43,    44,    -1,    -1,    47,    48,    49,
       50,    51,    52,    36,    37,    38,    39,    40,    41,    42,
       43,    44,    -1,    -1,    47,    48,    49,    50,    51,    52,
-      36,    37,    38,    39,    40,    41,    42,    43,    44,    45,
-      -1,    -1,    -1,    49,    50,    51,    52,    36,    37,    38,
+      36,    37,    38,    39,    40,    41,    42,    43,    44,    -1,
+      -1,    47,    48,    49,    50,    51,    52,    36,    37,    38,
       39,    40,    41,    42,    43,    44,    45,    -1,    -1,    -1,
       49,    50,    51,    52,    36,    37,    38,    39,    40,    41,
-      42,    43,    44,    45,    46,    47,    48,    36,    37,    38,
-      39,    40,    41,    42,    43,    44,    36,    37,    38,    39,
-      40,    41,    42,    43,    44
+      42,    43,    44,    45,    -1,    -1,    -1,    49,    50,    51,
+      52,    36,    37,    38,    39,    40,    41,    42,    43,    44,
+      45,    -1,    -1,    -1,    49,    -1,    51,    36,    37,    38,
+      39,    40,    41,    42,    43,    44,    45,    46,    47,    48,
+      36,    37,    38,    39,    40,    41,    42,    43,    44
 };
 
 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
@@ -1754,14 +1759,14 @@
        5,    16,   144,   145,   146,   159,   160,   161,   162,   166,
      168,   200,   281,    45,    47,    45,   122,   143,   198,   307,
      310,    36,    37,    38,    39,    40,    41,    42,    43,    44,
-     297,   298,    36,   119,   191,    34,   119,    34,    34,    45,
+     297,   298,    36,   119,   191,   143,   119,   143,   143,    45,
       46,    47,    48,    49,    50,    51,    52,   122,   207,   208,
      210,   211,   212,   213,   250,   290,   291,   296,   297,   305,
      307,   170,   143,    45,    45,    45,   169,   297,    37,    38,
       40,   286,   142,   143,   170,   121,    45,   163,   164,   165,
      114,   111,   112,   113,   125,   192,   193,   194,   195,   143,
      150,   151,   152,   297,    49,   214,   289,   290,   294,   295,
-     296,   297,    34,   121,   213,    35,    82,    83,    84,    85,
+     296,   297,   143,   121,   213,    35,    82,    83,    84,    85,
       86,    87,    88,    89,    90,    91,    92,    93,    94,    95,
      171,   297,   297,   297,   145,   143,    49,   250,   297,   123,
      124,   191,   196,   120,   121,   120,   121,   123,   124,   210,
@@ -1778,7 +1783,7 @@
      232,   233,   234,   243,   244,   245,   246,   247,   248,   250,
      251,   257,   258,   259,   260,   268,   269,   280,   282,   283,
      285,   294,   297,   298,    37,    38,    39,    40,   179,   293,
-     293,   109,   105,   155,    34,   175,   293,   286,    45,   284,
+     293,   109,   105,   155,   143,   175,   293,   286,    45,   284,
      286,   287,   119,   261,   261,   143,   143,   143,   251,   245,
       45,   187,   294,   297,   213,    45,   252,   253,   254,   294,
      143,   143,   206,   207,   209,   213,   143,   143,    36,    37,
@@ -1812,7 +1817,7 @@
      143,   250,   248,   250,   250,   143,   143,   297,   297,   297,
      297,   297,   297,   297,   297,   297,   297,    45,   294,    47,
       48,   294,    47,    48,   294,   121,   121,   289,   175,   278,
-      34,   121,   239,    30,   227,   240,   241,   242,   208,   208,
+     143,   121,   239,    30,   227,   240,   241,   242,   208,   208,
      120,    14,   250,   254,    26,   242,   249,   143,   143
 };
 
@@ -1887,7 +1892,7 @@
    we won't break user code: when these are the locations we know.  */
 
 #ifndef YY_LOCATION_PRINT
-# if YYLTYPE_IS_TRIVIAL
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
 #  define YY_LOCATION_PRINT(File, Loc)			\
      fprintf (File, "%d.%d-%d.%d",			\
 	      (Loc).first_line, (Loc).first_column,	\
@@ -2641,27 +2646,27 @@
   switch (yyn)
     {
         case 4:
-#line 571 "pir.y"
+#line 572 "pir.y"
     { fixup_global_labels(lexer); ;}
     break;
 
   case 7:
-#line 579 "pir.y"
+#line 580 "pir.y"
     { lexer->linenr += (yyvsp[(1) - (1)].ival); ;}
     break;
 
   case 20:
-#line 605 "pir.y"
+#line 606 "pir.y"
     { new_macro_const(lexer->macros, (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].sval), yypirget_lineno(yyscanner)); ;}
     break;
 
   case 21:
-#line 611 "pir.y"
+#line 612 "pir.y"
     { /* fprintf(stderr, "macro body: [%s]\n", CURRENT_MACRO(lexer)->body);*/ ;}
     break;
 
   case 22:
-#line 615 "pir.y"
+#line 616 "pir.y"
     {
                           new_macro(lexer->macros, (yyvsp[(2) - (2)].sval), yypirget_lineno(yyscanner), TRUE,
                                     lexer->macro_size);
@@ -2669,17 +2674,17 @@
     break;
 
   case 27:
-#line 630 "pir.y"
+#line 631 "pir.y"
     { add_macro_param(CURRENT_MACRO(lexer), (yyvsp[(1) - (1)].sval)); ;}
     break;
 
   case 35:
-#line 649 "pir.y"
+#line 650 "pir.y"
     { store_macro_string(CURRENT_MACRO(lexer), "%s\n", (yyvsp[(2) - (2)].sval)); ;}
     break;
 
   case 36:
-#line 653 "pir.y"
+#line 654 "pir.y"
     {
                           store_macro_string(CURRENT_MACRO(lexer), ".local %s %s\n",
                                              pir_type_names[(yyvsp[(2) - (3)].ival)], (yyvsp[(3) - (3)].sval));
@@ -2687,142 +2692,142 @@
     break;
 
   case 37:
-#line 664 "pir.y"
+#line 665 "pir.y"
     { load_library(lexer, (yyvsp[(2) - (2)].sval)); ;}
     break;
 
   case 38:
-#line 668 "pir.y"
+#line 669 "pir.y"
     { yypirset_lineno ((yyvsp[(2) - (2)].ival), yyscanner); ;}
     break;
 
   case 39:
-#line 670 "pir.y"
+#line 671 "pir.y"
     { lexer->filename = (yyvsp[(2) - (2)].sval); ;}
     break;
 
   case 40:
-#line 676 "pir.y"
+#line 677 "pir.y"
     { set_hll(lexer, (yyvsp[(2) - (2)].sval)); ;}
     break;
 
   case 41:
-#line 680 "pir.y"
+#line 681 "pir.y"
     { set_namespace(lexer, (yyvsp[(3) - (4)].key)); ;}
     break;
 
   case 42:
-#line 684 "pir.y"
+#line 685 "pir.y"
     { (yyval.key) = NULL; ;}
     break;
 
   case 43:
-#line 686 "pir.y"
+#line 687 "pir.y"
     { (yyval.key) = (yyvsp[(1) - (1)].key); ;}
     break;
 
   case 44:
-#line 690 "pir.y"
+#line 691 "pir.y"
     { (yyval.key) = new_key(lexer, (yyvsp[(1) - (1)].expr)); ;}
     break;
 
   case 45:
-#line 692 "pir.y"
+#line 693 "pir.y"
     { (yyval.key) = add_key(lexer, (yyvsp[(1) - (3)].key), (yyvsp[(3) - (3)].expr)); ;}
     break;
 
   case 46:
-#line 696 "pir.y"
+#line 697 "pir.y"
     { (yyval.expr) = expr_from_string(lexer, (yyvsp[(1) - (1)].sval)); ;}
     break;
 
   case 48:
-#line 706 "pir.y"
+#line 707 "pir.y"
     { close_sub(lexer); ;}
     break;
 
   case 49:
-#line 710 "pir.y"
-    { new_subr(lexer, (yyvsp[(2) - (2)].sval)); ;}
+#line 711 "pir.y"
+    { new_subr(lexer, lexer->sval /*$2*/); ;}
     break;
 
   case 54:
-#line 722 "pir.y"
+#line 723 "pir.y"
     { set_sub_flag(lexer, PIRC_SUB_FLAG_ANON);;}
     break;
 
   case 55:
-#line 724 "pir.y"
+#line 725 "pir.y"
     { set_sub_flag(lexer, PIRC_SUB_FLAG_INIT); ;}
     break;
 
   case 56:
-#line 726 "pir.y"
+#line 727 "pir.y"
     { set_sub_flag(lexer, PIRC_SUB_FLAG_LOAD); ;}
     break;
 
   case 57:
-#line 728 "pir.y"
+#line 729 "pir.y"
     { set_sub_flag(lexer, PIRC_SUB_FLAG_MAIN); ;}
     break;
 
   case 58:
-#line 730 "pir.y"
+#line 731 "pir.y"
     { set_sub_flag(lexer, PIRC_SUB_FLAG_LEX); ;}
     break;
 
   case 59:
-#line 732 "pir.y"
+#line 733 "pir.y"
     { set_sub_flag(lexer, PIRC_SUB_FLAG_POSTCOMP); ;}
     break;
 
   case 60:
-#line 734 "pir.y"
+#line 735 "pir.y"
     { set_sub_flag(lexer, PIRC_SUB_FLAG_IMMEDIATE); ;}
     break;
 
   case 61:
-#line 736 "pir.y"
+#line 737 "pir.y"
     { set_sub_flag(lexer, PIRC_SUB_FLAG_MULTI); ;}
     break;
 
   case 62:
-#line 738 "pir.y"
+#line 739 "pir.y"
     { set_sub_outer(lexer, (yyvsp[(3) - (4)].sval)); ;}
     break;
 
   case 63:
-#line 740 "pir.y"
+#line 741 "pir.y"
     { set_sub_methodname(lexer, (yyvsp[(2) - (2)].sval)); ;}
     break;
 
   case 64:
-#line 742 "pir.y"
+#line 743 "pir.y"
     { set_sub_vtable(lexer, (yyvsp[(2) - (2)].sval)); ;}
     break;
 
   case 65:
-#line 744 "pir.y"
+#line 745 "pir.y"
     { set_sub_subid(lexer, (yyvsp[(2) - (2)].sval)); ;}
     break;
 
   case 66:
-#line 746 "pir.y"
+#line 747 "pir.y"
     { set_sub_instanceof(lexer, (yyvsp[(2) - (2)].sval)); ;}
     break;
 
   case 67:
-#line 748 "pir.y"
+#line 749 "pir.y"
     { set_sub_nsentry(lexer, (yyvsp[(2) - (2)].sval)); ;}
     break;
 
   case 68:
-#line 752 "pir.y"
+#line 753 "pir.y"
     { set_sub_multi_types(lexer, (yyvsp[(2) - (3)].expr)); ;}
     break;
 
   case 69:
-#line 756 "pir.y"
+#line 757 "pir.y"
     {
                           CURRENT_SUB(lexer)->info.num_multi_types = 1;
                           /* n=1 means :multi() -- without any types. */
@@ -2830,12 +2835,12 @@
     break;
 
   case 70:
-#line 761 "pir.y"
+#line 762 "pir.y"
     { (yyval.expr) = (yyvsp[(1) - (1)].expr); ;}
     break;
 
   case 71:
-#line 765 "pir.y"
+#line 766 "pir.y"
     {
                           CURRENT_SUB(lexer)->info.num_multi_types = 2;
                           /* start counting multi types; always 1 higher than actual number
@@ -2847,7 +2852,7 @@
     break;
 
   case 72:
-#line 774 "pir.y"
+#line 775 "pir.y"
     {
                           ++CURRENT_SUB(lexer)->info.num_multi_types;
                           /* link the multi types in reverse other. That's fine,
@@ -2859,32 +2864,32 @@
     break;
 
   case 73:
-#line 785 "pir.y"
+#line 786 "pir.y"
     { (yyval.expr) = expr_from_ident(lexer, (yyvsp[(1) - (1)].sval)); ;}
     break;
 
   case 74:
-#line 787 "pir.y"
+#line 788 "pir.y"
     { (yyval.expr) = expr_from_string(lexer, (yyvsp[(1) - (1)].sval)); ;}
     break;
 
   case 75:
-#line 789 "pir.y"
+#line 790 "pir.y"
     { (yyval.expr) = expr_from_key(lexer, (yyvsp[(1) - (1)].key)); ;}
     break;
 
   case 76:
-#line 793 "pir.y"
+#line 794 "pir.y"
     { generate_parameters_instr(lexer, (yyvsp[(1) - (1)].uval)); ;}
     break;
 
   case 77:
-#line 797 "pir.y"
+#line 798 "pir.y"
     { (yyval.uval) = 0; ;}
     break;
 
   case 78:
-#line 799 "pir.y"
+#line 800 "pir.y"
     {
                           /* if the :named flag was set, there's an extra
                            * constant string argument for the name. count that too.
@@ -2898,27 +2903,27 @@
     break;
 
   case 79:
-#line 812 "pir.y"
+#line 813 "pir.y"
     { (yyval.targ) = set_param_flag(lexer, (yyvsp[(2) - (4)].targ), (yyvsp[(3) - (4)].ival)); ;}
     break;
 
   case 80:
-#line 816 "pir.y"
+#line 817 "pir.y"
     { (yyval.targ) = add_param(lexer, (yyvsp[(1) - (2)].ival), (yyvsp[(2) - (2)].sval)); ;}
     break;
 
   case 81:
-#line 820 "pir.y"
+#line 821 "pir.y"
     { (yyval.ival) = 0; ;}
     break;
 
   case 82:
-#line 822 "pir.y"
+#line 823 "pir.y"
     { SET_FLAG((yyval.ival), (yyvsp[(2) - (2)].ival)); ;}
     break;
 
   case 87:
-#line 832 "pir.y"
+#line 833 "pir.y"
     {
                            (yyval.ival) = TARGET_FLAG_LOOKAHEAD;
                            set_param_alias(lexer, (yyvsp[(2) - (2)].sval));
@@ -2926,7 +2931,7 @@
     break;
 
   case 88:
-#line 839 "pir.y"
+#line 840 "pir.y"
     { (yyval.ival) = TARGET_FLAG_INVOCANT;
                            /* XXX handle multi_type */
 
@@ -2934,12 +2939,12 @@
     break;
 
   case 89:
-#line 846 "pir.y"
+#line 847 "pir.y"
     { (yyval.ival) = TARGET_FLAG_UNIQUE_REG; ;}
     break;
 
   case 91:
-#line 853 "pir.y"
+#line 854 "pir.y"
     {
                          ++lexer->stmt_counter;
                          /* increment the logical statement counter; a statement can be
@@ -2950,42 +2955,42 @@
     break;
 
   case 92:
-#line 863 "pir.y"
+#line 864 "pir.y"
     { set_label(lexer, (yyvsp[(1) - (2)].sval)); ;}
     break;
 
   case 110:
-#line 886 "pir.y"
+#line 887 "pir.y"
     { annotate(lexer, (yyvsp[(2) - (5)].sval), (yyvsp[(4) - (5)].cval)); ;}
     break;
 
   case 112:
-#line 896 "pir.y"
+#line 897 "pir.y"
     { (yyval.sval) = expand_macro(yyscanner, (yyvsp[(1) - (3)].mval), (yyvsp[(2) - (3)].pval)); ;}
     break;
 
   case 113:
-#line 900 "pir.y"
+#line 901 "pir.y"
     { (yyval.pval) = NULL; ;}
     break;
 
   case 114:
-#line 902 "pir.y"
+#line 903 "pir.y"
     { (yyval.pval) = (yyvsp[(2) - (3)].pval); ;}
     break;
 
   case 115:
-#line 906 "pir.y"
+#line 907 "pir.y"
     { (yyval.pval) = NULL; ;}
     break;
 
   case 117:
-#line 911 "pir.y"
+#line 912 "pir.y"
     { (yyval.pval) = new_macro_param((yyvsp[(1) - (1)].sval)); ;}
     break;
 
   case 118:
-#line 913 "pir.y"
+#line 914 "pir.y"
     {
                           macro_param *param = new_macro_param((yyvsp[(3) - (3)].sval));
                           param->next = (yyvsp[(1) - (3)].pval);
@@ -2994,7 +2999,7 @@
     break;
 
   case 119:
-#line 921 "pir.y"
+#line 922 "pir.y"
     {
                           symbol *sym = find_symbol(lexer, (yyvsp[(1) - (1)].sval));
                           if (sym == NULL) {
@@ -3005,22 +3010,22 @@
     break;
 
   case 121:
-#line 930 "pir.y"
+#line 931 "pir.y"
     { (yyval.sval) = expand_macro(yyscanner, (yyvsp[(1) - (2)].mval), (yyvsp[(2) - (2)].pval)); ;}
     break;
 
   case 123:
-#line 935 "pir.y"
+#line 936 "pir.y"
     { (yyval.sval) = (yyvsp[(2) - (3)].sval); ;}
     break;
 
   case 124:
-#line 940 "pir.y"
+#line 941 "pir.y"
     { (yyval.sval) = ""; ;}
     break;
 
   case 125:
-#line 942 "pir.y"
+#line 943 "pir.y"
     { /* XXX cleanup memory stuff */
                           char *newbuff = (char *)mem_sys_allocate((strlen((yyvsp[(1) - (2)].sval)) + strlen((yyvsp[(2) - (2)].sval)) + 2)
                                                                    * sizeof (char));
@@ -3030,22 +3035,22 @@
     break;
 
   case 126:
-#line 951 "pir.y"
+#line 952 "pir.y"
     { (yyval.sval) = "\n"; ;}
     break;
 
   case 129:
-#line 955 "pir.y"
+#line 956 "pir.y"
     { (yyval.sval) = expand_macro(yyscanner, (yyvsp[(1) - (2)].mval), (yyvsp[(2) - (2)].pval)); ;}
     break;
 
   case 130:
-#line 963 "pir.y"
+#line 964 "pir.y"
     { set_instr(lexer, NULL); ;}
     break;
 
   case 132:
-#line 971 "pir.y"
+#line 972 "pir.y"
     {
                            if (lexer->parse_errors > MAX_NUM_ERRORS)
                                panic(lexer, "Too many errors. Compilation aborted.\n");
@@ -3055,7 +3060,7 @@
     break;
 
   case 133:
-#line 980 "pir.y"
+#line 981 "pir.y"
     {
                            set_instrf(lexer, "null", "%T", (yyvsp[(2) - (3)].targ));
                            get_opinfo(lexer);
@@ -3063,14 +3068,14 @@
     break;
 
   case 134:
-#line 987 "pir.y"
+#line 988 "pir.y"
     {
                            generate_getresults_instr(lexer, (yyvsp[(2) - (3)].targ));
                          ;}
     break;
 
   case 138:
-#line 1000 "pir.y"
+#line 1001 "pir.y"
     { /* at this point, TK_IDENT may in fact be a symbol identifier,
                             * not an op, so don't do any checks like is_parrot_op() just yet.
                             */
@@ -3080,7 +3085,7 @@
     break;
 
   case 139:
-#line 1009 "pir.y"
+#line 1010 "pir.y"
     { /* when this rule is activated, the initial identifier must
                            * be a parrot op.
                            */
@@ -3090,7 +3095,7 @@
     break;
 
   case 145:
-#line 1027 "pir.y"
+#line 1028 "pir.y"
     {
                          /* the "instruction" that was set now appears to be
                           * an identifier; get the name, and check its type.
@@ -3127,22 +3132,22 @@
     break;
 
   case 146:
-#line 1063 "pir.y"
+#line 1064 "pir.y"
     { push_operand(lexer, (yyvsp[(1) - (1)].expr)); ;}
     break;
 
   case 147:
-#line 1065 "pir.y"
+#line 1066 "pir.y"
     { push_operand(lexer, expr_from_key(lexer, (yyvsp[(1) - (1)].key))); ;}
     break;
 
   case 148:
-#line 1069 "pir.y"
+#line 1070 "pir.y"
     { (yyval.expr) = expr_from_const(lexer, (yyvsp[(1) - (1)].cval)); ;}
     break;
 
   case 149:
-#line 1071 "pir.y"
+#line 1072 "pir.y"
     { /* this is either a LABEL or a symbol; in the latter case, the type
                             * will be filled in later. */
                            (yyval.expr) = expr_from_ident(lexer, (yyvsp[(1) - (1)].sval));
@@ -3150,17 +3155,17 @@
     break;
 
   case 150:
-#line 1076 "pir.y"
+#line 1077 "pir.y"
     { (yyval.expr) = expr_from_target(lexer, (yyvsp[(1) - (1)].targ)); ;}
     break;
 
   case 151:
-#line 1078 "pir.y"
+#line 1079 "pir.y"
     { (yyval.expr) = expr_from_target(lexer, (yyvsp[(1) - (1)].targ)); ;}
     break;
 
   case 152:
-#line 1082 "pir.y"
+#line 1083 "pir.y"
     {
                            /* if $1 is a register, just return that */
                            if (TEST_FLAG((yyvsp[(1) - (2)].targ)->flags, TARGET_FLAG_IS_REG))
@@ -3184,22 +3189,22 @@
     break;
 
   case 153:
-#line 1105 "pir.y"
+#line 1106 "pir.y"
     { (yyval.key) = (yyvsp[(2) - (3)].key); ;}
     break;
 
   case 154:
-#line 1109 "pir.y"
+#line 1110 "pir.y"
     { (yyval.key) = new_key(lexer, (yyvsp[(1) - (1)].expr)); ;}
     break;
 
   case 155:
-#line 1111 "pir.y"
+#line 1112 "pir.y"
     { (yyval.key) = add_key(lexer, (yyvsp[(1) - (3)].key), (yyvsp[(3) - (3)].expr)); ;}
     break;
 
   case 156:
-#line 1120 "pir.y"
+#line 1121 "pir.y"
     {
                           /* the instruction is already set in parrot_op rule */
                           unshift_operand(lexer, (yyvsp[(4) - (6)].expr));
@@ -3213,7 +3218,7 @@
     break;
 
   case 157:
-#line 1131 "pir.y"
+#line 1132 "pir.y"
     {
                           /* the instruction is already set in parrot_op rule */
                           unshift_operand(lexer, (yyvsp[(4) - (4)].expr));
@@ -3228,7 +3233,7 @@
     break;
 
   case 158:
-#line 1143 "pir.y"
+#line 1144 "pir.y"
     {
                           unshift_operand(lexer, expr_from_key(lexer, (yyvsp[(4) - (6)].key)));
                           unshift_operand(lexer, expr_from_target(lexer, (yyvsp[(1) - (6)].targ)));
@@ -3239,7 +3244,7 @@
     break;
 
   case 162:
-#line 1160 "pir.y"
+#line 1161 "pir.y"
     {
                           if ((yyvsp[(3) - (3)].ival) == 0)
                               set_instrf(lexer, "null", "%T", (yyvsp[(1) - (3)].targ));
@@ -3251,7 +3256,7 @@
     break;
 
   case 163:
-#line 1169 "pir.y"
+#line 1170 "pir.y"
     {
                           if ((yyvsp[(3) - (3)].dval) == 0.0)
                               set_instrf(lexer, "null", "%T", (yyvsp[(1) - (3)].targ));
@@ -3263,7 +3268,7 @@
     break;
 
   case 164:
-#line 1178 "pir.y"
+#line 1179 "pir.y"
     {
                           set_instrf(lexer, "set", "%T%C", (yyvsp[(1) - (3)].targ), (yyvsp[(3) - (3)].cval));
                           get_opinfo(lexer);
@@ -3271,7 +3276,7 @@
     break;
 
   case 165:
-#line 1183 "pir.y"
+#line 1184 "pir.y"
     {
                           set_instrf(lexer, "set", "%T%T", (yyvsp[(1) - (3)].targ), (yyvsp[(3) - (3)].targ));
                           get_opinfo(lexer);
@@ -3279,7 +3284,7 @@
     break;
 
   case 166:
-#line 1188 "pir.y"
+#line 1189 "pir.y"
     {
                           symbol *sym = find_symbol(lexer, (yyvsp[(3) - (3)].sval));
                           if (sym) {
@@ -3303,7 +3308,7 @@
     break;
 
   case 167:
-#line 1209 "pir.y"
+#line 1210 "pir.y"
     {
                           unshift_operand(lexer, expr_from_target(lexer, (yyvsp[(1) - (3)].targ)));
                           get_opinfo(lexer);
@@ -3311,7 +3316,7 @@
     break;
 
   case 168:
-#line 1214 "pir.y"
+#line 1215 "pir.y"
     {
                           /*   $P0 = foo ["bar"]    # PIR style
                            *
@@ -3355,7 +3360,7 @@
     break;
 
   case 169:
-#line 1255 "pir.y"
+#line 1256 "pir.y"
     {
                           symbol *sym = find_symbol(lexer, (yyvsp[(3) - (4)].sval));
                           target *t;
@@ -3376,7 +3381,7 @@
     break;
 
   case 170:
-#line 1273 "pir.y"
+#line 1274 "pir.y"
     {
                           target *preg = new_reg(lexer, PMC_TYPE, (yyvsp[(3) - (4)].ival));
                           set_target_key(preg, (yyvsp[(4) - (4)].key));
@@ -3386,7 +3391,7 @@
     break;
 
   case 171:
-#line 1280 "pir.y"
+#line 1281 "pir.y"
     {
                           set_instrf(lexer, opnames[(yyvsp[(2) - (3)].ival)], "%T%E", (yyvsp[(1) - (3)].targ), (yyvsp[(3) - (3)].expr));
                           get_opinfo(lexer);
@@ -3394,7 +3399,7 @@
     break;
 
   case 172:
-#line 1285 "pir.y"
+#line 1286 "pir.y"
     {
                           if ((yyvsp[(3) - (3)].ival) == 1)
                               set_instrf(lexer, "inc", "%T", (yyvsp[(1) - (3)].targ));
@@ -3408,7 +3413,7 @@
     break;
 
   case 173:
-#line 1296 "pir.y"
+#line 1297 "pir.y"
     {
                           if ((yyvsp[(3) - (3)].dval) == 1.0)
                               set_instrf(lexer, "inc", "%T", (yyvsp[(1) - (3)].targ));
@@ -3422,7 +3427,7 @@
     break;
 
   case 174:
-#line 1307 "pir.y"
+#line 1308 "pir.y"
     {
                           if ((yyvsp[(3) - (3)].ival) == 1)
                               set_instrf(lexer, "dec", "%T", (yyvsp[(1) - (3)].targ));
@@ -3436,7 +3441,7 @@
     break;
 
   case 175:
-#line 1318 "pir.y"
+#line 1319 "pir.y"
     {
                           if ((yyvsp[(3) - (3)].dval) == 1.0)
                               set_instrf(lexer, "dec", "%T", (yyvsp[(1) - (3)].targ));
@@ -3450,7 +3455,7 @@
     break;
 
   case 176:
-#line 1329 "pir.y"
+#line 1330 "pir.y"
     {
                           set_instrf(lexer, "add", "%T%T", (yyvsp[(1) - (3)].targ), (yyvsp[(3) - (3)].targ));
                           get_opinfo(lexer);
@@ -3458,7 +3463,7 @@
     break;
 
   case 177:
-#line 1334 "pir.y"
+#line 1335 "pir.y"
     {
                           set_instrf(lexer, "sub", "%T%T", (yyvsp[(1) - (3)].targ), (yyvsp[(3) - (3)].targ));
                           get_opinfo(lexer);
@@ -3466,7 +3471,7 @@
     break;
 
   case 178:
-#line 1339 "pir.y"
+#line 1340 "pir.y"
     {
                           set_instrf(lexer, (yyvsp[(3) - (4)].sval), "%T%E", (yyvsp[(1) - (4)].targ), (yyvsp[(4) - (4)].expr));
                           get_opinfo(lexer);
@@ -3474,7 +3479,7 @@
     break;
 
   case 179:
-#line 1344 "pir.y"
+#line 1345 "pir.y"
     {
                           if (targets_equal((yyvsp[(1) - (5)].targ), (yyvsp[(3) - (5)].targ))) /* $P0 = $P0 + $P1 ==> $P0 += $P1 */
                               set_instrf(lexer, opnames[(yyvsp[(4) - (5)].ival)], "%T%E", (yyvsp[(1) - (5)].targ), (yyvsp[(5) - (5)].expr));
@@ -3487,7 +3492,7 @@
     break;
 
   case 180:
-#line 1354 "pir.y"
+#line 1355 "pir.y"
     {
                           symbol *sym = find_symbol(lexer, (yyvsp[(1) - (4)].sval));
                           target *t;
@@ -3509,7 +3514,7 @@
     break;
 
   case 181:
-#line 1373 "pir.y"
+#line 1374 "pir.y"
     {
                           target *preg = new_reg(lexer, PMC_TYPE, (yyvsp[(1) - (4)].ival));
                           set_target_key(preg, (yyvsp[(2) - (4)].key));
@@ -3519,97 +3524,97 @@
     break;
 
   case 182:
-#line 1407 "pir.y"
+#line 1408 "pir.y"
     { set_instrf(lexer, opnames[(yyvsp[(2) - (3)].ival)], "%i%T", (yyvsp[(1) - (3)].ival), (yyvsp[(3) - (3)].targ)); ;}
     break;
 
   case 183:
-#line 1409 "pir.y"
+#line 1410 "pir.y"
     { set_instrf(lexer, opnames[(yyvsp[(2) - (3)].ival)], "%n%T", (yyvsp[(1) - (3)].dval), (yyvsp[(3) - (3)].targ)); ;}
     break;
 
   case 184:
-#line 1411 "pir.y"
+#line 1412 "pir.y"
     { set_instrf(lexer, opnames[(yyvsp[(2) - (3)].ival)], "%s%T", (yyvsp[(1) - (3)].sval), (yyvsp[(3) - (3)].targ)); ;}
     break;
 
   case 185:
-#line 1413 "pir.y"
+#line 1414 "pir.y"
     { set_instrf(lexer, "set", "%C", fold_s_s(yyscanner, (yyvsp[(1) - (3)].sval), (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].sval))); ;}
     break;
 
   case 186:
-#line 1415 "pir.y"
+#line 1416 "pir.y"
     { set_instrf(lexer, "set", "%C", fold_i_i(yyscanner, (yyvsp[(1) - (3)].ival), (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].ival))); ;}
     break;
 
   case 187:
-#line 1417 "pir.y"
+#line 1418 "pir.y"
     { set_instrf(lexer, "set", "%C", fold_n_n(yyscanner, (yyvsp[(1) - (3)].dval), (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].dval))); ;}
     break;
 
   case 188:
-#line 1419 "pir.y"
+#line 1420 "pir.y"
     { set_instrf(lexer, "set", "%C", fold_i_n(yyscanner, (yyvsp[(1) - (3)].ival), (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].dval))); ;}
     break;
 
   case 189:
-#line 1421 "pir.y"
+#line 1422 "pir.y"
     { set_instrf(lexer, "set", "%C", fold_n_i(yyscanner, (yyvsp[(1) - (3)].dval), (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].ival))); ;}
     break;
 
   case 190:
-#line 1426 "pir.y"
+#line 1427 "pir.y"
     { get_opinfo(lexer); ;}
     break;
 
   case 191:
-#line 1435 "pir.y"
+#line 1436 "pir.y"
     { create_if_instr(lexer, (yyvsp[(1) - (5)].ival), 1, (yyvsp[(3) - (5)].sval), (yyvsp[(5) - (5)].sval)); ;}
     break;
 
   case 192:
-#line 1437 "pir.y"
+#line 1438 "pir.y"
     { create_if_instr(lexer, (yyvsp[(1) - (5)].ival), 1, "int", (yyvsp[(5) - (5)].sval)); ;}
     break;
 
   case 193:
-#line 1439 "pir.y"
+#line 1440 "pir.y"
     { create_if_instr(lexer, (yyvsp[(1) - (5)].ival), 1, "num", (yyvsp[(5) - (5)].sval)); ;}
     break;
 
   case 194:
-#line 1441 "pir.y"
+#line 1442 "pir.y"
     { create_if_instr(lexer, (yyvsp[(1) - (5)].ival), 1, "pmc", (yyvsp[(5) - (5)].sval)); ;}
     break;
 
   case 195:
-#line 1443 "pir.y"
+#line 1444 "pir.y"
     { create_if_instr(lexer, (yyvsp[(1) - (5)].ival), 1, "string", (yyvsp[(5) - (5)].sval)); ;}
     break;
 
   case 196:
-#line 1445 "pir.y"
+#line 1446 "pir.y"
     { create_if_instr(lexer, (yyvsp[(1) - (5)].ival), 1, "if", (yyvsp[(5) - (5)].sval)); ;}
     break;
 
   case 197:
-#line 1447 "pir.y"
+#line 1448 "pir.y"
     { create_if_instr(lexer, (yyvsp[(1) - (5)].ival), 1, "unless", (yyvsp[(5) - (5)].sval)); ;}
     break;
 
   case 198:
-#line 1449 "pir.y"
+#line 1450 "pir.y"
     { create_if_instr(lexer, (yyvsp[(1) - (5)].ival), 1, "goto", (yyvsp[(5) - (5)].sval)); ;}
     break;
 
   case 199:
-#line 1451 "pir.y"
+#line 1452 "pir.y"
     { create_if_instr(lexer, (yyvsp[(1) - (5)].ival), 1, "null", (yyvsp[(5) - (5)].sval)); ;}
     break;
 
   case 200:
-#line 1453 "pir.y"
+#line 1454 "pir.y"
     {
                           int istrue = evaluate_c(lexer, (yyvsp[(2) - (4)].cval));
                           /* if "unless", invert the true-ness */
@@ -3624,7 +3629,7 @@
     break;
 
   case 201:
-#line 1465 "pir.y"
+#line 1466 "pir.y"
     {
                           set_instrf(lexer, (yyvsp[(1) - (5)].ival) ? "unless_null" : "if_null", "%T%I",
                                      new_reg(lexer, PMC_TYPE, (yyvsp[(3) - (5)].ival)), (yyvsp[(5) - (5)].sval));
@@ -3634,12 +3639,12 @@
     break;
 
   case 202:
-#line 1472 "pir.y"
+#line 1473 "pir.y"
     { create_if_instr(lexer, (yyvsp[(1) - (4)].ival), 0, (yyvsp[(2) - (4)].sval), (yyvsp[(4) - (4)].sval)); ;}
     break;
 
   case 203:
-#line 1474 "pir.y"
+#line 1475 "pir.y"
     {
                           set_instrf(lexer, (yyvsp[(1) - (4)].ival) ? "unless" : "if", "%T%I", (yyvsp[(2) - (4)].targ), (yyvsp[(4) - (4)].sval));
                           /* set a flag indicating that the 2nd operand is a label */
@@ -3648,57 +3653,57 @@
     break;
 
   case 204:
-#line 1480 "pir.y"
+#line 1481 "pir.y"
     { create_if_instr(lexer, (yyvsp[(1) - (4)].ival), 0, "int", (yyvsp[(4) - (4)].sval)); ;}
     break;
 
   case 205:
-#line 1482 "pir.y"
+#line 1483 "pir.y"
     { create_if_instr(lexer, (yyvsp[(1) - (4)].ival), 0, "num", (yyvsp[(4) - (4)].sval)); ;}
     break;
 
   case 206:
-#line 1484 "pir.y"
+#line 1485 "pir.y"
     { create_if_instr(lexer, (yyvsp[(1) - (4)].ival), 0, "pmc", (yyvsp[(4) - (4)].sval)); ;}
     break;
 
   case 207:
-#line 1486 "pir.y"
+#line 1487 "pir.y"
     { create_if_instr(lexer, (yyvsp[(1) - (4)].ival), 0, "string", (yyvsp[(4) - (4)].sval)); ;}
     break;
 
   case 208:
-#line 1488 "pir.y"
+#line 1489 "pir.y"
     { create_if_instr(lexer, (yyvsp[(1) - (4)].ival), 0, "if", (yyvsp[(4) - (4)].sval)); ;}
     break;
 
   case 209:
-#line 1490 "pir.y"
+#line 1491 "pir.y"
     { create_if_instr(lexer, (yyvsp[(1) - (4)].ival), 0, "unless", (yyvsp[(4) - (4)].sval)); ;}
     break;
 
   case 210:
-#line 1492 "pir.y"
+#line 1493 "pir.y"
     { create_if_instr(lexer, (yyvsp[(1) - (4)].ival), 0, "goto", (yyvsp[(4) - (4)].sval)); ;}
     break;
 
   case 211:
-#line 1494 "pir.y"
+#line 1495 "pir.y"
     { create_if_instr(lexer, (yyvsp[(1) - (4)].ival), 0, "goto", (yyvsp[(4) - (4)].sval)); ;}
     break;
 
   case 212:
-#line 1496 "pir.y"
+#line 1497 "pir.y"
     { create_if_instr(lexer, (yyvsp[(1) - (4)].ival), 0, "null", (yyvsp[(4) - (4)].sval)); ;}
     break;
 
   case 213:
-#line 1498 "pir.y"
+#line 1499 "pir.y"
     { create_if_instr(lexer, (yyvsp[(1) - (4)].ival), 0, "null", (yyvsp[(4) - (4)].sval)); ;}
     break;
 
   case 214:
-#line 1500 "pir.y"
+#line 1501 "pir.y"
     {
                           if ((yyvsp[(2) - (4)].ival) == COMPUTE_DURING_RUNTIME) {
                              if ((yyvsp[(1) - (4)].ival) == NEED_INVERT_OPNAME) /* "unless" */
@@ -3726,7 +3731,7 @@
     break;
 
   case 215:
-#line 1531 "pir.y"
+#line 1532 "pir.y"
     {
                           /* the instructions "gt" and "ge" are converted to "lt" and "le".
                            * if so, then the arguments must be reversed as well. "lt" and
@@ -3755,7 +3760,7 @@
     break;
 
   case 216:
-#line 1557 "pir.y"
+#line 1558 "pir.y"
     {
                           if (((yyvsp[(0) - (3)].ival) != NEED_INVERT_OPNAME) && ((yyvsp[(2) - (3)].ival) == OP_GE || (yyvsp[(2) - (3)].ival) == OP_GT))
                               set_instrf(lexer, opnames[(yyvsp[(2) - (3)].ival) + 1], "%T%i", (yyvsp[(3) - (3)].targ), (yyvsp[(1) - (3)].ival));
@@ -3766,7 +3771,7 @@
     break;
 
   case 217:
-#line 1565 "pir.y"
+#line 1566 "pir.y"
     {
                           if (((yyvsp[(0) - (3)].ival) != NEED_INVERT_OPNAME) && ((yyvsp[(2) - (3)].ival) == OP_GE || (yyvsp[(2) - (3)].ival) == OP_GT))
                               set_instrf(lexer, opnames[(yyvsp[(2) - (3)].ival) + 1], "%T%n", (yyvsp[(3) - (3)].targ), (yyvsp[(1) - (3)].dval));
@@ -3778,7 +3783,7 @@
     break;
 
   case 218:
-#line 1574 "pir.y"
+#line 1575 "pir.y"
     {
                           if (((yyvsp[(0) - (3)].ival) != NEED_INVERT_OPNAME) && ((yyvsp[(2) - (3)].ival) == OP_GE || (yyvsp[(2) - (3)].ival) == OP_GT))
                               set_instrf(lexer, opnames[(yyvsp[(2) - (3)].ival)], "%T%s", (yyvsp[(3) - (3)].targ), (yyvsp[(1) - (3)].sval));
@@ -3790,32 +3795,32 @@
     break;
 
   case 219:
-#line 1583 "pir.y"
+#line 1584 "pir.y"
     { (yyval.ival) = evaluate_i_i((yyvsp[(1) - (3)].ival), (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].ival)); ;}
     break;
 
   case 220:
-#line 1585 "pir.y"
+#line 1586 "pir.y"
     { (yyval.ival) = evaluate_i_n((yyvsp[(1) - (3)].ival), (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].dval)); ;}
     break;
 
   case 221:
-#line 1587 "pir.y"
+#line 1588 "pir.y"
     { (yyval.ival) = evaluate_n_i((yyvsp[(1) - (3)].dval), (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].ival)); ;}
     break;
 
   case 222:
-#line 1589 "pir.y"
+#line 1590 "pir.y"
     { (yyval.ival) = evaluate_n_n((yyvsp[(1) - (3)].dval), (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].dval)); ;}
     break;
 
   case 223:
-#line 1591 "pir.y"
+#line 1592 "pir.y"
     { (yyval.ival) = evaluate_s_s((yyvsp[(1) - (3)].sval), (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].sval)); ;}
     break;
 
   case 224:
-#line 1595 "pir.y"
+#line 1596 "pir.y"
     {
                           yypirerror(yyscanner, lexer, "cannot compare string to %s",
                                      (yyvsp[(3) - (3)].ival) == INT_TYPE ? "integer" : "number");
@@ -3823,37 +3828,37 @@
     break;
 
   case 225:
-#line 1600 "pir.y"
+#line 1601 "pir.y"
     { yypirerror(yyscanner, lexer, "cannot compare integer to string"); ;}
     break;
 
   case 226:
-#line 1602 "pir.y"
+#line 1603 "pir.y"
     { yypirerror(yyscanner, lexer, "cannot compare number to string"); ;}
     break;
 
   case 227:
-#line 1606 "pir.y"
+#line 1607 "pir.y"
     { (yyval.ival) = INT_TYPE; ;}
     break;
 
   case 228:
-#line 1607 "pir.y"
+#line 1608 "pir.y"
     { (yyval.ival) = NUM_TYPE; ;}
     break;
 
   case 229:
-#line 1610 "pir.y"
+#line 1611 "pir.y"
     { (yyval.ival) = DONT_INVERT_OPNAME; /* no need to invert */ ;}
     break;
 
   case 230:
-#line 1611 "pir.y"
+#line 1612 "pir.y"
     { (yyval.ival) = NEED_INVERT_OPNAME; /* yes, invert opname */ ;}
     break;
 
   case 233:
-#line 1619 "pir.y"
+#line 1620 "pir.y"
     {
                           set_instrf(lexer, "branch", "%I", (yyvsp[(2) - (3)].sval));
                           set_op_labelflag(lexer, BIT(0)); /* bit 0 means: "1 << 0" */
@@ -3862,37 +3867,37 @@
     break;
 
   case 234:
-#line 1627 "pir.y"
+#line 1628 "pir.y"
     { declare_local(lexer, (yyvsp[(2) - (4)].ival), (yyvsp[(3) - (4)].symb)); ;}
     break;
 
   case 235:
-#line 1631 "pir.y"
+#line 1632 "pir.y"
     { (yyval.symb) = (yyvsp[(1) - (1)].symb); ;}
     break;
 
   case 236:
-#line 1633 "pir.y"
+#line 1634 "pir.y"
     { (yyval.symb) = add_local((yyvsp[(1) - (3)].symb), (yyvsp[(3) - (3)].symb)); ;}
     break;
 
   case 237:
-#line 1637 "pir.y"
+#line 1638 "pir.y"
     { (yyval.symb) = new_local(lexer, (yyvsp[(1) - (2)].sval), (yyvsp[(2) - (2)].ival)); ;}
     break;
 
   case 238:
-#line 1640 "pir.y"
+#line 1641 "pir.y"
     { (yyval.ival) = 0; ;}
     break;
 
   case 239:
-#line 1641 "pir.y"
+#line 1642 "pir.y"
     { (yyval.ival) = 1; ;}
     break;
 
   case 240:
-#line 1645 "pir.y"
+#line 1646 "pir.y"
     { /* if $4 is not a register, it must be a declared symbol */
                           if (!TEST_FLAG((yyvsp[(4) - (5)].targ)->flags, TARGET_FLAG_IS_REG)) {
 
@@ -3905,12 +3910,12 @@
     break;
 
   case 241:
-#line 1660 "pir.y"
+#line 1661 "pir.y"
     { convert_inv_to_instr(lexer, (yyvsp[(1) - (1)].invo)); ;}
     break;
 
   case 244:
-#line 1672 "pir.y"
+#line 1673 "pir.y"
     { /* $4 contains an invocation object */
                               set_invocation_args(lexer, (yyvsp[(4) - (8)].invo), (yyvsp[(3) - (8)].argm));
                               (yyval.invo) = set_invocation_results(lexer, (yyvsp[(4) - (8)].invo), (yyvsp[(6) - (8)].targ));
@@ -3918,72 +3923,72 @@
     break;
 
   case 245:
-#line 1679 "pir.y"
+#line 1680 "pir.y"
     { (yyval.argm) = NULL; ;}
     break;
 
   case 246:
-#line 1681 "pir.y"
+#line 1682 "pir.y"
     { (yyval.argm) = (yyvsp[(1) - (1)].argm); ;}
     break;
 
   case 247:
-#line 1685 "pir.y"
+#line 1686 "pir.y"
     { (yyval.argm) = (yyvsp[(1) - (1)].argm); ;}
     break;
 
   case 248:
-#line 1687 "pir.y"
+#line 1688 "pir.y"
     { (yyval.argm) = add_arg((yyvsp[(1) - (2)].argm), (yyvsp[(2) - (2)].argm)); ;}
     break;
 
   case 249:
-#line 1691 "pir.y"
+#line 1692 "pir.y"
     { (yyval.argm) = (yyvsp[(2) - (3)].argm); ;}
     break;
 
   case 250:
-#line 1695 "pir.y"
+#line 1696 "pir.y"
     { (yyval.invo) = invoke(lexer, CALL_PCC, (yyvsp[(2) - (3)].targ), (yyvsp[(3) - (3)].targ)); ;}
     break;
 
   case 251:
-#line 1697 "pir.y"
+#line 1698 "pir.y"
     { (yyval.invo) = invoke(lexer, CALL_NCI, (yyvsp[(2) - (2)].targ)); ;}
     break;
 
   case 252:
-#line 1700 "pir.y"
+#line 1701 "pir.y"
     { (yyval.invo) = invoke(lexer, CALL_METHOD, (yyvsp[(2) - (5)].targ), (yyvsp[(5) - (5)].expr)); ;}
     break;
 
   case 253:
-#line 1704 "pir.y"
+#line 1705 "pir.y"
     { (yyval.targ) = NULL; ;}
     break;
 
   case 254:
-#line 1706 "pir.y"
+#line 1707 "pir.y"
     { (yyval.targ) = (yyvsp[(2) - (2)].targ); ;}
     break;
 
   case 255:
-#line 1710 "pir.y"
+#line 1711 "pir.y"
     { (yyval.targ) = NULL; ;}
     break;
 
   case 256:
-#line 1712 "pir.y"
+#line 1713 "pir.y"
     { (yyval.targ) = (yyvsp[(1) - (1)].targ); ;}
     break;
 
   case 257:
-#line 1716 "pir.y"
+#line 1717 "pir.y"
     { (yyval.targ) = (yyvsp[(1) - (1)].targ); ;}
     break;
 
   case 258:
-#line 1718 "pir.y"
+#line 1719 "pir.y"
     {
                              if ((yyvsp[(2) - (2)].targ))
                                  (yyval.targ) = add_target(lexer, (yyvsp[(1) - (2)].targ), (yyvsp[(2) - (2)].targ));
@@ -3993,32 +3998,32 @@
     break;
 
   case 259:
-#line 1727 "pir.y"
+#line 1728 "pir.y"
     { (yyval.targ) = (yyvsp[(2) - (3)].targ); ;}
     break;
 
   case 260:
-#line 1729 "pir.y"
+#line 1730 "pir.y"
     { (yyval.targ) = NULL; ;}
     break;
 
   case 262:
-#line 1737 "pir.y"
+#line 1738 "pir.y"
     { (yyval.invo) = set_invocation_results(lexer, (yyvsp[(3) - (3)].invo), (yyvsp[(1) - (3)].targ)); ;}
     break;
 
   case 263:
-#line 1739 "pir.y"
+#line 1740 "pir.y"
     { (yyval.invo) = set_invocation_results(lexer, (yyvsp[(3) - (3)].invo), (yyvsp[(1) - (3)].targ)); ;}
     break;
 
   case 264:
-#line 1741 "pir.y"
+#line 1742 "pir.y"
     {  (yyval.invo) = set_invocation_results(lexer, (yyvsp[(1) - (1)].invo), NULL); ;}
     break;
 
   case 267:
-#line 1749 "pir.y"
+#line 1750 "pir.y"
     {
                              /* if $1 is not a register, check whether the symbol was declared */
                              if (!TEST_FLAG((yyvsp[(1) - (4)].targ)->flags, TARGET_FLAG_IS_REG)) {
@@ -4039,7 +4044,7 @@
     break;
 
   case 268:
-#line 1769 "pir.y"
+#line 1770 "pir.y"
     {
                              (yyval.invo) = invoke(lexer, CALL_PCC, (yyvsp[(1) - (2)].targ), NULL);
                              set_invocation_args(lexer, (yyval.invo), (yyvsp[(2) - (2)].argm));
@@ -4047,12 +4052,12 @@
     break;
 
   case 269:
-#line 1776 "pir.y"
+#line 1777 "pir.y"
     { (yyval.targ) = (yyvsp[(1) - (1)].targ); ;}
     break;
 
   case 270:
-#line 1778 "pir.y"
+#line 1779 "pir.y"
     {
                              symbol *sym = find_symbol(lexer, (yyvsp[(1) - (1)].sval));
                              if (sym == NULL)
@@ -4063,7 +4068,7 @@
     break;
 
   case 271:
-#line 1788 "pir.y"
+#line 1789 "pir.y"
     { /* check that this identifier was declared */
                              symbol *sym = find_symbol(lexer, (yyvsp[(1) - (1)].sval));
 
@@ -4083,22 +4088,22 @@
     break;
 
   case 272:
-#line 1805 "pir.y"
+#line 1806 "pir.y"
     { (yyval.expr) = expr_from_target(lexer, new_reg(lexer, PMC_TYPE, (yyvsp[(1) - (1)].ival))); ;}
     break;
 
   case 273:
-#line 1807 "pir.y"
+#line 1808 "pir.y"
     { (yyval.expr) = expr_from_target(lexer, new_reg(lexer, STRING_TYPE, (yyvsp[(1) - (1)].ival))); ;}
     break;
 
   case 274:
-#line 1809 "pir.y"
+#line 1810 "pir.y"
     { (yyval.expr) = expr_from_const(lexer, new_const(lexer, STRING_VAL, (yyvsp[(1) - (1)].sval))); ;}
     break;
 
   case 275:
-#line 1813 "pir.y"
+#line 1814 "pir.y"
     {
                              symbol *sym = find_symbol(lexer, (yyvsp[(1) - (1)].sval));
                              if (sym == NULL)
@@ -4110,74 +4115,74 @@
     break;
 
   case 276:
-#line 1822 "pir.y"
+#line 1823 "pir.y"
     { (yyval.targ) = new_reg(lexer, PMC_TYPE, (yyvsp[(1) - (1)].ival)); ;}
     break;
 
   case 277:
-#line 1827 "pir.y"
+#line 1828 "pir.y"
     {
                              (yyval.targ) = (yyvsp[(2) - (3)].targ);
                            ;}
     break;
 
   case 278:
-#line 1833 "pir.y"
+#line 1834 "pir.y"
     { (yyval.targ) = NULL; ;}
     break;
 
   case 279:
-#line 1835 "pir.y"
+#line 1836 "pir.y"
     { (yyval.targ) = (yyvsp[(1) - (1)].targ); ;}
     break;
 
   case 280:
-#line 1839 "pir.y"
+#line 1840 "pir.y"
     { (yyval.targ) = (yyvsp[(1) - (1)].targ); ;}
     break;
 
   case 281:
-#line 1841 "pir.y"
+#line 1842 "pir.y"
     { (yyval.targ) = add_target(lexer, (yyvsp[(1) - (3)].targ), (yyvsp[(3) - (3)].targ)); ;}
     break;
 
   case 282:
-#line 1845 "pir.y"
+#line 1846 "pir.y"
     { (yyval.targ) = set_param_flag(lexer, (yyvsp[(1) - (2)].targ), (yyvsp[(2) - (2)].ival)); ;}
     break;
 
   case 283:
-#line 1847 "pir.y"
+#line 1848 "pir.y"
     { (yyval.targ) = set_param_alias(lexer, (yyvsp[(1) - (3)].sval)); ;}
     break;
 
   case 284:
-#line 1851 "pir.y"
+#line 1852 "pir.y"
     { (yyval.ival) = 0; ;}
     break;
 
   case 285:
-#line 1853 "pir.y"
+#line 1854 "pir.y"
     { SET_FLAG((yyval.ival), (yyvsp[(2) - (2)].ival)); ;}
     break;
 
   case 286:
-#line 1857 "pir.y"
+#line 1858 "pir.y"
     { (yyval.ival) = TARGET_FLAG_OPTIONAL; ;}
     break;
 
   case 287:
-#line 1859 "pir.y"
+#line 1860 "pir.y"
     { (yyval.ival) = TARGET_FLAG_OPT_FLAG; ;}
     break;
 
   case 288:
-#line 1861 "pir.y"
+#line 1862 "pir.y"
     { (yyval.ival) = TARGET_FLAG_SLURPY; ;}
     break;
 
   case 289:
-#line 1863 "pir.y"
+#line 1864 "pir.y"
     {
                              (yyval.ival) = TARGET_FLAG_NAMED;
                              set_param_alias(lexer, (yyvsp[(2) - (2)].sval));
@@ -4185,12 +4190,12 @@
     break;
 
   case 290:
-#line 1873 "pir.y"
+#line 1874 "pir.y"
     { convert_inv_to_instr(lexer, (yyvsp[(1) - (1)].invo)); ;}
     break;
 
   case 295:
-#line 1883 "pir.y"
+#line 1884 "pir.y"
     {
                               (yyval.invo) = invoke(lexer, CALL_RETURN);
                               set_invocation_args(lexer, (yyval.invo), (yyvsp[(2) - (3)].argm));
@@ -4198,7 +4203,7 @@
     break;
 
   case 296:
-#line 1888 "pir.y"
+#line 1889 "pir.y"
     { /* was the invocation a method call? then it becomes a method tail
                                * call, otherwise it's just a normal (sub) tail call.
                                */
@@ -4210,7 +4215,7 @@
     break;
 
   case 297:
-#line 1899 "pir.y"
+#line 1900 "pir.y"
     {
                               (yyval.invo) = invoke(lexer, CALL_YIELD);
                               set_invocation_args(lexer, (yyval.invo), (yyvsp[(2) - (3)].argm));
@@ -4218,47 +4223,47 @@
     break;
 
   case 298:
-#line 1906 "pir.y"
+#line 1907 "pir.y"
     { (yyval.argm) = (yyvsp[(2) - (3)].argm); ;}
     break;
 
   case 299:
-#line 1910 "pir.y"
+#line 1911 "pir.y"
     { (yyval.argm) = NULL; ;}
     break;
 
   case 300:
-#line 1912 "pir.y"
+#line 1913 "pir.y"
     { (yyval.argm) = (yyvsp[(1) - (1)].argm); ;}
     break;
 
   case 301:
-#line 1916 "pir.y"
+#line 1917 "pir.y"
     { (yyval.argm) = (yyvsp[(1) - (1)].argm); ;}
     break;
 
   case 302:
-#line 1918 "pir.y"
+#line 1919 "pir.y"
     { (yyval.argm) = add_arg((yyvsp[(1) - (3)].argm), (yyvsp[(3) - (3)].argm)); ;}
     break;
 
   case 305:
-#line 1926 "pir.y"
+#line 1927 "pir.y"
     { (yyval.argm) = set_arg_alias(lexer, (yyvsp[(1) - (3)].sval)); ;}
     break;
 
   case 306:
-#line 1930 "pir.y"
+#line 1931 "pir.y"
     { (yyval.argm) = set_arg_flag((yyval.argm), (yyvsp[(2) - (2)].ival)); ;}
     break;
 
   case 307:
-#line 1934 "pir.y"
+#line 1935 "pir.y"
     { (yyval.argm) = set_curarg(lexer, new_argument(lexer, (yyvsp[(1) - (1)].expr)));  ;}
     break;
 
   case 308:
-#line 1940 "pir.y"
+#line 1941 "pir.y"
     {
                               (yyval.invo) = invoke(lexer, CALL_RETURN);
                               set_invocation_args(lexer, (yyval.invo), (yyvsp[(3) - (5)].argm));
@@ -4266,7 +4271,7 @@
     break;
 
   case 309:
-#line 1949 "pir.y"
+#line 1950 "pir.y"
     {
                               (yyval.invo) = invoke(lexer, CALL_YIELD);
                               set_invocation_args(lexer, (yyval.invo), (yyvsp[(3) - (5)].argm));
@@ -4274,72 +4279,72 @@
     break;
 
   case 310:
-#line 1956 "pir.y"
+#line 1957 "pir.y"
     { (yyval.argm) = NULL; ;}
     break;
 
   case 311:
-#line 1958 "pir.y"
+#line 1959 "pir.y"
     { (yyval.argm) = (yyvsp[(1) - (1)].argm); ;}
     break;
 
   case 312:
-#line 1963 "pir.y"
+#line 1964 "pir.y"
     { (yyval.argm) = (yyvsp[(1) - (1)].argm); ;}
     break;
 
   case 313:
-#line 1965 "pir.y"
+#line 1966 "pir.y"
     { (yyval.argm) = add_arg((yyvsp[(1) - (2)].argm), (yyvsp[(2) - (2)].argm)); ;}
     break;
 
   case 314:
-#line 1970 "pir.y"
+#line 1971 "pir.y"
     { (yyval.argm) = (yyvsp[(2) - (3)].argm); ;}
     break;
 
   case 315:
-#line 1974 "pir.y"
+#line 1975 "pir.y"
     { (yyval.argm) = NULL; ;}
     break;
 
   case 316:
-#line 1976 "pir.y"
+#line 1977 "pir.y"
     { (yyval.argm) = (yyvsp[(1) - (1)].argm); ;}
     break;
 
   case 317:
-#line 1980 "pir.y"
+#line 1981 "pir.y"
     { (yyval.argm) = (yyvsp[(1) - (1)].argm); ;}
     break;
 
   case 318:
-#line 1982 "pir.y"
+#line 1983 "pir.y"
     { (yyval.argm) = add_arg((yyvsp[(1) - (2)].argm), (yyvsp[(2) - (2)].argm)); ;}
     break;
 
   case 319:
-#line 1986 "pir.y"
+#line 1987 "pir.y"
     { (yyval.argm) = (yyvsp[(2) - (3)].argm); ;}
     break;
 
   case 320:
-#line 1991 "pir.y"
+#line 1992 "pir.y"
     { (yyval.ival) = 0; ;}
     break;
 
   case 321:
-#line 1993 "pir.y"
+#line 1994 "pir.y"
     { SET_FLAG((yyval.ival), (yyvsp[(2) - (2)].ival)); ;}
     break;
 
   case 322:
-#line 1997 "pir.y"
+#line 1998 "pir.y"
     { (yyval.ival) = ARG_FLAG_FLAT; ;}
     break;
 
   case 323:
-#line 1999 "pir.y"
+#line 2000 "pir.y"
     {
                                (yyval.ival) = ARG_FLAG_NAMED;
                                set_arg_alias(lexer, (yyvsp[(2) - (2)].sval));
@@ -4347,62 +4352,62 @@
     break;
 
   case 324:
-#line 2006 "pir.y"
+#line 2007 "pir.y"
     { (yyval.sval) = NULL; ;}
     break;
 
   case 325:
-#line 2008 "pir.y"
+#line 2009 "pir.y"
     { (yyval.sval) = (yyvsp[(1) - (1)].sval); ;}
     break;
 
   case 326:
-#line 2012 "pir.y"
+#line 2013 "pir.y"
     { (yyval.sval) = (yyvsp[(2) - (3)].sval); ;}
     break;
 
   case 328:
-#line 2019 "pir.y"
+#line 2020 "pir.y"
     { store_global_constant(lexer, (yyvsp[(2) - (2)].cdec)); ;}
     break;
 
   case 331:
-#line 2027 "pir.y"
+#line 2028 "pir.y"
     { (yyval.cdec) = (yyvsp[(2) - (2)].cdec); ;}
     break;
 
   case 334:
-#line 2035 "pir.y"
+#line 2036 "pir.y"
     { store_global_constant(lexer, (yyvsp[(2) - (2)].cdec)); ;}
     break;
 
   case 335:
-#line 2039 "pir.y"
+#line 2040 "pir.y"
     { (yyval.cdec) = new_named_const(lexer, INT_VAL, (yyvsp[(2) - (4)].sval), (yyvsp[(4) - (4)].ival)); ;}
     break;
 
   case 336:
-#line 2041 "pir.y"
+#line 2042 "pir.y"
     { (yyval.cdec) = new_named_const(lexer, NUM_VAL, (yyvsp[(2) - (4)].sval), (yyvsp[(4) - (4)].dval)); ;}
     break;
 
   case 337:
-#line 2043 "pir.y"
+#line 2044 "pir.y"
     { (yyval.cdec) = new_named_const(lexer, STRING_VAL, (yyvsp[(2) - (4)].sval), (yyvsp[(4) - (4)].sval)); ;}
     break;
 
   case 338:
-#line 2045 "pir.y"
+#line 2046 "pir.y"
     { (yyval.cdec) = new_named_const(lexer, USTRING_VAL, (yyvsp[(2) - (4)].sval), (yyvsp[(4) - (4)].ustr)); ;}
     break;
 
   case 339:
-#line 2049 "pir.y"
+#line 2050 "pir.y"
     { (yyval.cdec) = new_pmc_const(lexer, (yyvsp[(1) - (4)].sval), (yyvsp[(2) - (4)].sval), (yyvsp[(4) - (4)].cval)); ;}
     break;
 
   case 341:
-#line 2054 "pir.y"
+#line 2055 "pir.y"
     { /* this alternative is necessary, otherwise the parser
                                * just stops when assigning an identifier to a pmc
                                * const, without an error message. That may be
@@ -4413,97 +4418,97 @@
     break;
 
   case 342:
-#line 2066 "pir.y"
+#line 2067 "pir.y"
     { (yyval.expr) = expr_from_target(lexer, (yyvsp[(1) - (1)].targ)); ;}
     break;
 
   case 343:
-#line 2067 "pir.y"
+#line 2068 "pir.y"
     { (yyval.expr) = expr_from_const(lexer, (yyvsp[(1) - (1)].cval)); ;}
     break;
 
   case 344:
-#line 2071 "pir.y"
+#line 2072 "pir.y"
     { (yyval.cval) = new_const(lexer, INT_VAL, (yyvsp[(1) - (1)].ival)); ;}
     break;
 
   case 345:
-#line 2072 "pir.y"
+#line 2073 "pir.y"
     { (yyval.cval) = new_const(lexer, NUM_VAL, (yyvsp[(1) - (1)].dval)); ;}
     break;
 
   case 346:
-#line 2073 "pir.y"
+#line 2074 "pir.y"
     { (yyval.cval) = (yyvsp[(1) - (1)].cval); ;}
     break;
 
   case 347:
-#line 2076 "pir.y"
+#line 2077 "pir.y"
     { (yyval.cval) = new_const(lexer, STRING_VAL, (yyvsp[(1) - (1)].sval)); ;}
     break;
 
   case 348:
-#line 2077 "pir.y"
+#line 2078 "pir.y"
     { (yyval.cval) = new_const(lexer, USTRING_VAL, (yyvsp[(1) - (1)].ustr)); ;}
     break;
 
   case 349:
-#line 2080 "pir.y"
+#line 2081 "pir.y"
     { (yyval.ival) = OP_NE; ;}
     break;
 
   case 350:
-#line 2081 "pir.y"
+#line 2082 "pir.y"
     { (yyval.ival) = OP_EQ; ;}
     break;
 
   case 351:
-#line 2082 "pir.y"
+#line 2083 "pir.y"
     { (yyval.ival) = OP_LT; ;}
     break;
 
   case 352:
-#line 2083 "pir.y"
+#line 2084 "pir.y"
     { (yyval.ival) = OP_LE; ;}
     break;
 
   case 353:
-#line 2084 "pir.y"
+#line 2085 "pir.y"
     { (yyval.ival) = OP_GE; ;}
     break;
 
   case 354:
-#line 2085 "pir.y"
+#line 2086 "pir.y"
     { (yyval.ival) = OP_GT; ;}
     break;
 
   case 355:
-#line 2088 "pir.y"
+#line 2089 "pir.y"
     { (yyval.ival) = INT_TYPE; ;}
     break;
 
   case 356:
-#line 2089 "pir.y"
+#line 2090 "pir.y"
     { (yyval.ival) = NUM_TYPE; ;}
     break;
 
   case 357:
-#line 2090 "pir.y"
+#line 2091 "pir.y"
     { (yyval.ival) = PMC_TYPE; ;}
     break;
 
   case 358:
-#line 2091 "pir.y"
+#line 2092 "pir.y"
     { (yyval.ival) = STRING_TYPE; ;}
     break;
 
   case 359:
-#line 2099 "pir.y"
+#line 2100 "pir.y"
     { set_curtarget(lexer, (yyvsp[(1) - (1)].targ));  ;}
     break;
 
   case 361:
-#line 2103 "pir.y"
+#line 2104 "pir.y"
     { /* a symbol must have been declared; check that at this point. */
                            symbol * sym = find_symbol(lexer, (yyvsp[(1) - (1)].sval));
                            if (sym == NULL) {
@@ -4518,277 +4523,277 @@
     break;
 
   case 362:
-#line 2116 "pir.y"
+#line 2117 "pir.y"
     { (yyval.targ) = new_reg(lexer, PMC_TYPE, (yyvsp[(1) - (1)].ival));    ;}
     break;
 
   case 363:
-#line 2117 "pir.y"
+#line 2118 "pir.y"
     { (yyval.targ) = new_reg(lexer, NUM_TYPE, (yyvsp[(1) - (1)].ival));    ;}
     break;
 
   case 364:
-#line 2118 "pir.y"
+#line 2119 "pir.y"
     { (yyval.targ) = new_reg(lexer, INT_TYPE, (yyvsp[(1) - (1)].ival));    ;}
     break;
 
   case 365:
-#line 2119 "pir.y"
+#line 2120 "pir.y"
     { (yyval.targ) = new_reg(lexer, STRING_TYPE, (yyvsp[(1) - (1)].ival)); ;}
     break;
 
   case 368:
-#line 2127 "pir.y"
+#line 2128 "pir.y"
     { (yyval.sval) = "if"; ;}
     break;
 
   case 369:
-#line 2128 "pir.y"
+#line 2129 "pir.y"
     { (yyval.sval) = "unless"; ;}
     break;
 
   case 370:
-#line 2129 "pir.y"
+#line 2130 "pir.y"
     { (yyval.sval) = "goto"; ;}
     break;
 
   case 371:
-#line 2130 "pir.y"
+#line 2131 "pir.y"
     { (yyval.sval) = "int"; ;}
     break;
 
   case 372:
-#line 2131 "pir.y"
+#line 2132 "pir.y"
     { (yyval.sval) = "num"; ;}
     break;
 
   case 373:
-#line 2132 "pir.y"
+#line 2133 "pir.y"
     { (yyval.sval) = "string"; ;}
     break;
 
   case 374:
-#line 2133 "pir.y"
+#line 2134 "pir.y"
     { (yyval.sval) = "pmc"; ;}
     break;
 
   case 375:
-#line 2134 "pir.y"
+#line 2135 "pir.y"
     { (yyval.sval) = "null"; ;}
     break;
 
   case 376:
-#line 2137 "pir.y"
+#line 2138 "pir.y"
     { (yyval.sval) = "neg"; ;}
     break;
 
   case 377:
-#line 2138 "pir.y"
+#line 2139 "pir.y"
     { (yyval.sval) = "not"; ;}
     break;
 
   case 378:
-#line 2139 "pir.y"
+#line 2140 "pir.y"
     { (yyval.sval) = "bnot"; ;}
     break;
 
   case 379:
-#line 2142 "pir.y"
+#line 2143 "pir.y"
     { (yyval.ival) = OP_ADD; ;}
     break;
 
   case 380:
-#line 2143 "pir.y"
+#line 2144 "pir.y"
     { (yyval.ival) = OP_SUB; ;}
     break;
 
   case 381:
-#line 2144 "pir.y"
+#line 2145 "pir.y"
     { (yyval.ival) = OP_DIV; ;}
     break;
 
   case 382:
-#line 2145 "pir.y"
+#line 2146 "pir.y"
     { (yyval.ival) = OP_MUL; ;}
     break;
 
   case 383:
-#line 2146 "pir.y"
+#line 2147 "pir.y"
     { (yyval.ival) = OP_MOD; ;}
     break;
 
   case 384:
-#line 2147 "pir.y"
+#line 2148 "pir.y"
     { (yyval.ival) = OP_BOR; ;}
     break;
 
   case 385:
-#line 2148 "pir.y"
+#line 2149 "pir.y"
     { (yyval.ival) = OP_BAND; ;}
     break;
 
   case 386:
-#line 2149 "pir.y"
+#line 2150 "pir.y"
     { (yyval.ival) = OP_BXOR; ;}
     break;
 
   case 387:
-#line 2150 "pir.y"
+#line 2151 "pir.y"
     { (yyval.ival) = OP_POW; ;}
     break;
 
   case 388:
-#line 2151 "pir.y"
+#line 2152 "pir.y"
     { (yyval.ival) = OP_CONCAT; ;}
     break;
 
   case 389:
-#line 2152 "pir.y"
+#line 2153 "pir.y"
     { (yyval.ival) = OP_LSR; ;}
     break;
 
   case 390:
-#line 2153 "pir.y"
+#line 2154 "pir.y"
     { (yyval.ival) = OP_SHR; ;}
     break;
 
   case 391:
-#line 2154 "pir.y"
+#line 2155 "pir.y"
     { (yyval.ival) = OP_SHL; ;}
     break;
 
   case 392:
-#line 2155 "pir.y"
+#line 2156 "pir.y"
     { (yyval.ival) = OP_OR; ;}
     break;
 
   case 393:
-#line 2156 "pir.y"
+#line 2157 "pir.y"
     { (yyval.ival) = OP_AND; ;}
     break;
 
   case 394:
-#line 2157 "pir.y"
+#line 2158 "pir.y"
     { (yyval.ival) = OP_FDIV; ;}
     break;
 
   case 395:
-#line 2158 "pir.y"
+#line 2159 "pir.y"
     { (yyval.ival) = OP_XOR; ;}
     break;
 
   case 396:
-#line 2159 "pir.y"
+#line 2160 "pir.y"
     { (yyval.ival) = OP_ISEQ; ;}
     break;
 
   case 397:
-#line 2160 "pir.y"
+#line 2161 "pir.y"
     { (yyval.ival) = OP_ISLE; ;}
     break;
 
   case 398:
-#line 2161 "pir.y"
+#line 2162 "pir.y"
     { (yyval.ival) = OP_ISLT; ;}
     break;
 
   case 399:
-#line 2162 "pir.y"
+#line 2163 "pir.y"
     { (yyval.ival) = OP_ISGE; ;}
     break;
 
   case 400:
-#line 2163 "pir.y"
+#line 2164 "pir.y"
     { (yyval.ival) = OP_ISGT; ;}
     break;
 
   case 401:
-#line 2164 "pir.y"
+#line 2165 "pir.y"
     { (yyval.ival) = OP_ISNE; ;}
     break;
 
   case 402:
-#line 2170 "pir.y"
+#line 2171 "pir.y"
     { (yyval.ival) = OP_MUL; ;}
     break;
 
   case 403:
-#line 2171 "pir.y"
+#line 2172 "pir.y"
     { (yyval.ival) = OP_MOD; ;}
     break;
 
   case 404:
-#line 2172 "pir.y"
+#line 2173 "pir.y"
     { (yyval.ival) = OP_POW; ;}
     break;
 
   case 405:
-#line 2173 "pir.y"
+#line 2174 "pir.y"
     { (yyval.ival) = OP_DIV; ;}
     break;
 
   case 406:
-#line 2174 "pir.y"
+#line 2175 "pir.y"
     { (yyval.ival) = OP_FDIV; ;}
     break;
 
   case 407:
-#line 2175 "pir.y"
+#line 2176 "pir.y"
     { (yyval.ival) = OP_BOR; ;}
     break;
 
   case 408:
-#line 2176 "pir.y"
+#line 2177 "pir.y"
     { (yyval.ival) = OP_BAND; ;}
     break;
 
   case 409:
-#line 2177 "pir.y"
+#line 2178 "pir.y"
     { (yyval.ival) = OP_BXOR; ;}
     break;
 
   case 410:
-#line 2178 "pir.y"
+#line 2179 "pir.y"
     { (yyval.ival) = OP_CONCAT; ;}
     break;
 
   case 411:
-#line 2179 "pir.y"
+#line 2180 "pir.y"
     { (yyval.ival) = OP_SHR; ;}
     break;
 
   case 412:
-#line 2180 "pir.y"
+#line 2181 "pir.y"
     { (yyval.ival) = OP_SHL; ;}
     break;
 
   case 413:
-#line 2181 "pir.y"
+#line 2182 "pir.y"
     { (yyval.ival) = OP_LSR; ;}
     break;
 
   case 415:
-#line 2202 "pir.y"
-    { new_subr(lexer, "@start"); ;}
+#line 2203 "pir.y"
+    { new_subr(lexer, Parrot_str_new(lexer->interp, "@start", 6)); ;}
     break;
 
   case 424:
-#line 2218 "pir.y"
+#line 2219 "pir.y"
     { set_label(lexer, (yyvsp[(1) - (2)].sval)); ;}
     break;
 
   case 429:
-#line 2228 "pir.y"
+#line 2229 "pir.y"
     { set_sub_name(lexer, (yyvsp[(3) - (3)].sval)); ;}
     break;
 
   case 430:
-#line 2232 "pir.y"
+#line 2233 "pir.y"
     { new_subr(lexer, NULL); ;}
     break;
 
   case 431:
-#line 2237 "pir.y"
+#line 2238 "pir.y"
     {
 
                                   if (is_parrot_op(lexer, (yyvsp[(1) - (3)].sval))) {
@@ -4803,7 +4808,7 @@
 
 
 /* Line 1267 of yacc.c.  */
-#line 4807 "pirparser.c"
+#line 4812 "pirparser.c"
       default: break;
     }
   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -5017,7 +5022,7 @@
 }
 
 
-#line 2251 "pir.y"
+#line 2252 "pir.y"
 
 
 

Modified: branches/orderedhash_revamp/compilers/pirc/src/pirparser.h
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/src/pirparser.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/src/pirparser.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -298,9 +298,10 @@
     struct symbol      *symb;
     struct macro_def   *mval;
     struct macro_param *pval;
+
 }
-/* Line 1489 of yacc.c.  */
-#line 304 "pirparser.h"
+/* Line 1529 of yacc.c.  */
+#line 305 "pirparser.h"
 	YYSTYPE;
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1

Modified: branches/orderedhash_revamp/compilers/pirc/src/pirpcc.c
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/src/pirpcc.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/src/pirpcc.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -80,20 +80,20 @@
     int flag = 0;
 
     switch (arg->value->type) {
-        case EXPR_TARGET:
-            /* copy the type of the target */
-            SET_FLAG(flag, arg->value->expr.t->info->type);
-            break;
-        case EXPR_CONSTANT:
-            /* copy the type of the constant; note that constants store a value_type,
-             * not a pir_type, so convert here.
-             */
-            SET_FLAG(flag, valuetype_pirtype_clut[arg->value->expr.c->type]);
-            /* set the flag indicating the argument is a constant literal, not a register. */
-            SET_FLAG(flag, PARROT_ARG_CONSTANT);
-            break;
-        default:
-            break;
+      case EXPR_TARGET:
+        /* copy the type of the target */
+        SET_FLAG(flag, arg->value->expr.t->info->type);
+        break;
+      case EXPR_CONSTANT:
+        /* copy the type of the constant; note that constants store a value_type,
+         * not a pir_type, so convert here.
+         */
+        SET_FLAG(flag, valuetype_pirtype_clut[arg->value->expr.c->type]);
+        /* set the flag indicating the argument is a constant literal, not a register. */
+        SET_FLAG(flag, PARROT_ARG_CONSTANT);
+        break;
+      default:
+        break;
     }
 
     /* if the argument has a :flat flag, copy that */
@@ -694,17 +694,17 @@
 
     /* check out the type of the method expression; it may be a PMC or a STRING. */
     switch (inv->method->type) {
-        case EXPR_TARGET:
-            new_sub_instr(lexer, PARROT_OP_tailcallmethod_p_p, "tailcallmethod_p_p", 0);
-            add_operands(lexer, "%T%E", inv->sub, inv->method); /* XXX test this */
-            break;
-        case EXPR_CONSTANT:
-            new_sub_instr(lexer, PARROT_OP_tailcallmethod_p_sc, "tailcallmethod_p_sc", 0);
-            add_operands(lexer, "%T%E", inv->sub, inv->method);
-            break;
-        default:
-            panic(lexer, "unknown expression type in tailcallmethod instruction");
-            break;
+      case EXPR_TARGET:
+        new_sub_instr(lexer, PARROT_OP_tailcallmethod_p_p, "tailcallmethod_p_p", 0);
+        add_operands(lexer, "%T%E", inv->sub, inv->method); /* XXX test this */
+        break;
+      case EXPR_CONSTANT:
+        new_sub_instr(lexer, PARROT_OP_tailcallmethod_p_sc, "tailcallmethod_p_sc", 0);
+        add_operands(lexer, "%T%E", inv->sub, inv->method);
+        break;
+      default:
+        panic(lexer, "unknown expression type in tailcallmethod instruction");
+        break;
     }
 }
 
@@ -725,30 +725,30 @@
 void
 convert_inv_to_instr(lexer_state * const lexer, invocation * const inv) {
     switch (inv->type) {
-        case CALL_PCC:
-            convert_pcc_call(lexer, inv);
-            break;
-        case CALL_RETURN:
-            convert_pcc_return(lexer, inv);
-            break;
-        case CALL_NCI:
-            convert_nci_call(lexer, inv);
-            break;
-        case CALL_YIELD:
-            convert_pcc_yield(lexer, inv);
-            break;
-        case CALL_TAILCALL:
-            convert_pcc_tailcall(lexer, inv);
-            break;
-        case CALL_METHOD:
-            convert_pcc_methodcall(lexer, inv);
-            break;
-        case CALL_METHOD_TAILCALL:
-            convert_pcc_methodtailcall(lexer, inv);
-            break;
-        default:
-            panic(lexer, "Unknown invocation type in convert_inv_to_instr()");
-            break;
+      case CALL_PCC:
+        convert_pcc_call(lexer, inv);
+        break;
+      case CALL_RETURN:
+        convert_pcc_return(lexer, inv);
+        break;
+      case CALL_NCI:
+        convert_nci_call(lexer, inv);
+        break;
+      case CALL_YIELD:
+        convert_pcc_yield(lexer, inv);
+        break;
+      case CALL_TAILCALL:
+        convert_pcc_tailcall(lexer, inv);
+        break;
+      case CALL_METHOD:
+        convert_pcc_methodcall(lexer, inv);
+        break;
+      case CALL_METHOD_TAILCALL:
+        convert_pcc_methodtailcall(lexer, inv);
+        break;
+      default:
+        panic(lexer, "Unknown invocation type in convert_inv_to_instr()");
+        break;
     }
 
 

Modified: branches/orderedhash_revamp/compilers/pirc/src/pirregalloc.c
==============================================================================
--- branches/orderedhash_revamp/compilers/pirc/src/pirregalloc.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/pirc/src/pirregalloc.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -379,10 +379,10 @@
          * and parrot register numbering starts at 0, substract 1 here.
          * (initializing r to 0 will make the algorithm stop working properly.)
          */
-         unsigned reg = lsr->r[type] - 1;
-         lsr->r[type]++;
-         fprintf(stderr, "get_free_reg(): non-cached: %d\n", reg);
-         return reg;
+        unsigned reg = lsr->r[type] - 1;
+        lsr->r[type]++;
+        fprintf(stderr, "get_free_reg(): non-cached: %d\n", reg);
+        return reg;
     }
 }
 

Modified: branches/orderedhash_revamp/compilers/tge/TGE.pir
==============================================================================
--- branches/orderedhash_revamp/compilers/tge/TGE.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/tge/TGE.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -113,6 +113,46 @@
 .end
 
 
+.namespace [ 'PGE';'Match' ]
+
+=over 4
+
+=item C<find_key([ key1, key2, ... ])>
+
+Find the first of C<key1>, C<key2>, etc. in the current
+Match object, and return it.  Returns '' if none of
+the specified keys are found.  If no keys are specified,
+then simply return the first key found.
+
+=back
+
+=cut
+
+.sub 'find_key' :method
+    .param pmc keys            :slurpy
+    if null keys goto first_key
+    unless keys goto first_key
+  loop:
+    unless keys goto not_found
+    $S0 = shift keys
+    $I0 = exists self[$S0]
+    unless $I0 goto loop
+    .return ($S0)
+  first_key:
+    $P0 = self.'hash'()
+    $P1 = iter $P0
+    unless $P1 goto not_found
+  next:
+    $S0 = shift $P1
+    $P2 = $P0[$S0]
+    $I0 = isa $P2, 'Capture'
+    unless $I0 goto next
+    .return ($S0)
+  not_found:
+    .return ('')
+.end
+
+
 # Local Variables:
 #   mode: pir
 #   fill-column: 100

Modified: branches/orderedhash_revamp/compilers/tge/TGE/Compiler.pir
==============================================================================
--- branches/orderedhash_revamp/compilers/tge/TGE/Compiler.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/tge/TGE/Compiler.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -89,12 +89,11 @@
 
     # Iterate over the list of statements, and generate a processed tree for
     # each statement.  Return an array of all the processed statements.
-    .local pmc iter
-    iter = new 'Iterator', node # loop over the array
-    iter = 0 # start at the beginning
+    .local pmc it
+    it = iter node # loop over the array
 loop_start:
-    unless iter goto loop_end
-    $P1 = shift iter
+    unless it goto loop_end
+    $P1 = shift it
     $P2 = tree.'get'('result', $P1, 'statement')
     push statements, $P2
     goto loop_start
@@ -111,14 +110,13 @@
     .param pmc node
     .local pmc result
 
-    .local pmc iter
+    .local pmc it
     $P0 = node.'hash'()
-    iter = new 'Iterator', $P0    # setup iterator for node
-    iter = 0
+    it  = iter $P0    # setup iterator for node
   iter_loop:
-    unless iter, iter_end         # while (entries) ...
-      shift $S1, iter           # get the key of the iterator
-      $P2 = iter[$S1]
+    unless it, iter_end         # while (entries) ...
+      shift $S1, it           # get the key of the iterator
+      $P2 = it[$S1]
 
       result = tree.'get'('result', $P2, $S1)
 
@@ -134,15 +132,14 @@
     .local pmc rule
     rule = new 'Hash'
 
-    .local pmc iter
+    .local pmc it
     $P0 = node.'hash'()
-    iter = new 'Iterator', $P0    # setup iterator for node
-    iter = 0
+    it  = iter $P0    # setup iterator for node
   iter_loop:
-    unless iter, iter_end         # while (entries) ...
+    unless it, iter_end         # while (entries) ...
       $P3 = new 'Undef'
-      shift $S1, iter           # get the key of the iterator
-      $P2 = iter[$S1]
+      shift $S1, it           # get the key of the iterator
+      $P2 = it[$S1]
 
       $P3 = tree.'get'('value', $P2, $S1)
 
@@ -169,15 +166,14 @@
     .local pmc decl
     decl = new 'Hash'
 
-    .local pmc iter
+    .local pmc it
     $P0 = node.'hash'()
-    iter = new 'Iterator', $P0    # setup iterator for node
-    iter = 0
+    it  = iter $P0    # setup iterator for node
   iter_loop:
-    unless iter, iter_end         # while (entries) ...
+    unless it, iter_end         # while (entries) ...
       $P3 = new 'Undef'
-      shift $S1, iter           # get the key of the iterator
-      $P2 = iter[$S1]
+      shift $S1, it           # get the key of the iterator
+      $P2 = it[$S1]
 
       $P3 = tree.'get'('value', $P2, $S1)
 
@@ -296,12 +292,11 @@
 
     # Construct grammar rules from the data structure of rule info
     .local pmc statement
-    .local pmc iter
-    iter = new 'Iterator', rule_data # loop over the rule info
-    iter = 0 # start at the beginning
+    .local pmc it
+    it = iter rule_data # loop over the rule info
 loop_start:
-    unless iter goto loop_end
-        statement = shift iter
+    unless it goto loop_end
+        statement = shift it
         $S0 = statement['build']
       unless $S0 == 'rule' goto grammar_build
           $S1 = self.'rule_string'(statement)

Modified: branches/orderedhash_revamp/compilers/tge/TGE/Grammar.pir
==============================================================================
--- branches/orderedhash_revamp/compilers/tge/TGE/Grammar.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/tge/TGE/Grammar.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -140,7 +140,7 @@
 
 .sub 'symbol_iter' :method
     $P1 = getattribute self, 'symbols'
-    $P2 = new 'Iterator', $P1
+    $P2 = iter $P1
 
     .return($P2)
 .end

Modified: branches/orderedhash_revamp/compilers/tge/tgc.pir
==============================================================================
--- branches/orderedhash_revamp/compilers/tge/tgc.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/compilers/tge/tgc.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -46,7 +46,7 @@
 
     # Process command line options
     .local pmc getopts
-    getopts = new "Getopt::Obj"
+    getopts = new ["Getopt";"Obj"]
     getopts."notOptStop"(1)
     push getopts, "output|o=s"
     push getopts, "help|h"

Modified: branches/orderedhash_revamp/config/auto/alignptrs.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/alignptrs.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/alignptrs.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -37,8 +37,8 @@
         $align = $conf->data->get('ptr_alignment');
         $result_str .= "configured: ";
     }
-    elsif ( $conf->data->get_p5('OSNAME') eq 'hpux'
-            && $conf->data->get_p5('ccflags') !~ /DD64/ ) {
+    elsif ( $conf->data->get('OSNAME_provisional') eq 'hpux'
+            && $conf->data->get('ccflags_provisional') !~ /DD64/ ) {
 
         # HP-UX 10.20/32 hangs in this test.
         $align = 4;

Modified: branches/orderedhash_revamp/config/auto/arch.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/arch.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/arch.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -46,7 +46,7 @@
 
     if ($verbose) {
         print "determining operating system and cpu architecture\n";
-        print "archname: <$archname>\n";
+        print "archname: $archname\n";
     }
 
     if ( !defined $osname ) {
@@ -78,9 +78,10 @@
         $osname  = 'cygwin';
     }
     elsif ( $cpuarch eq 'i86pc' and $osname eq 'solaris' ) {
-        # That's only the perl 32/64 bit setting. We can override it with
-        # -m64 / -m32 for ccflags and ldflags though.
-        $cpuarch = $archname =~ /-64int/ ? 'x86_64' : 'i386';
+        # That's only the perl value, and is the same for both i386
+        # and amd64.  Use uname -p instead to find the processor type.
+        chomp($archname = `uname -p`);
+        $cpuarch = $archname;
     }
 
     if ( $archname =~ m/powerpc/ ) {
@@ -91,13 +92,43 @@
     $cpuarch =~ s/i[456]86/i386/i;
     $cpuarch =~ s/x86_64/amd64/i;
 
-    print "osname: $osname\ncpuarch: $cpuarch\n" if $verbose;
-
     $conf->data->set(
         cpuarch  => $cpuarch,
         osname   => $osname
     );
 
+    $conf->data->set( 'platform' => $self->_get_platform( $conf ) );
+
+    _report_verbose( $conf );
+
+    return 1;
+}
+
+sub _get_platform {
+    my ($self, $conf) = @_;
+    my $platform = lc ( $conf->data->get('osname') );
+
+    $platform = "win32" if $platform =~ /^msys/;
+    $platform = "win32" if $platform =~ /^mingw/;
+    $platform =~ s/^ms//;
+
+    if ( ( split m/-/, $conf->data->get('archname'), 2 )[0] eq 'ia64' ) {
+        $platform = 'ia64';
+    }
+
+    $platform = 'generic' unless -d "config/gen/platform/$platform";
+
+    return $platform;
+}
+
+sub _report_verbose {
+    my ($conf) = @_;
+    my $verbose = $conf->options->get( 'verbose' );
+    if ( $verbose ) {
+        print "osname:   ", $conf->data->get('osname'), "\n";
+        print "cpuarch:  ", $conf->data->get('cpuarch'), "\n";
+        print "platform: ", $conf->data->get('platform'), "\n";
+    }
     return 1;
 }
 

Modified: branches/orderedhash_revamp/config/auto/byteorder/test_c.in
==============================================================================
--- branches/orderedhash_revamp/config/auto/byteorder/test_c.in	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/byteorder/test_c.in	Sat Jan 23 01:49:53 2010	(r43541)
@@ -15,6 +15,14 @@
         unsigned char b[sizeof (@iv@)/sizeof (unsigned char)];
         @iv@ w;
     } w;
+#if defined(__ARM__) || defined(__arm__)
+#  if defined(__ARMEB__)
+    printf("87654321\n");
+#  else
+    printf("1234\n");
+#  endif
+    return 0;
+#endif
     if (sizeof (w) == 4) {
         w.w = 0x04030201;
     }

Modified: branches/orderedhash_revamp/config/auto/cgoto.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/cgoto.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/cgoto.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -63,9 +63,9 @@
 # generated by config/auto/cgoto.pm
 
 $(OPS_DIR)/core_ops_cg$(O): $(GENERAL_H_FILES) $(OPS_DIR)/core_ops_cg.c \
-	$(SRC_DIR)/pmc/pmc_parrotlibrary.h
+	$(PMC_INC_DIR)/pmc/pmc_parrotlibrary.h
 $(OPS_DIR)/core_ops_cgp$(O): $(GENERAL_H_FILES) $(OPS_DIR)/core_ops_cgp.c \
-	$(SRC_DIR)/pmc/pmc_parrotlibrary.h
+	$(PMC_INC_DIR)/pmc/pmc_parrotlibrary.h
 $(SRC_DIR)/runcore/cores.c: $(INC_DIR)/oplib/core_ops_cgp.h
 
 $(INC_DIR)/oplib/core_ops_cg.h: $(OPS_DIR)/core_ops_cg.c

Modified: branches/orderedhash_revamp/config/auto/cpu.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/cpu.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/cpu.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -18,7 +18,6 @@
 
 use base qw(Parrot::Configure::Step);
 
-use Parrot::Configure::Utils qw(copy_if_diff);
 use Carp;
 
 

Deleted: branches/orderedhash_revamp/config/auto/cpu/i386/Makefile
==============================================================================
--- branches/orderedhash_revamp/config/auto/cpu/i386/Makefile	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,17 +0,0 @@
-# use gcc/as to generate some files
-# this file is not intended to be run during normal config
-# but only by developers that change the source
-
-
-all: memcpy_files
-
-memcpy_files: memcpy_mmx.c memcpy_sse.c
-
-memcpy_mmx.c: memcpy_mmx_in.c ../../../../tools/dev/as2c.pl
-	perl ../../../../tools/dev/as2c.pl memcpy_mmx_in > $@
-	rm -f memcpy_mmx_in.s memcpy_mmx_in.o
-
-memcpy_sse.c: memcpy_sse_in.c ../../../../tools/dev/as2c.pl
-	perl ../../../../tools/dev/as2c.pl memcpy_sse_in > $@
-	rm -f memcpy_sse_in.s memcpy_sse_in.o
-

Modified: branches/orderedhash_revamp/config/auto/cpu/i386/auto.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/cpu/i386/auto.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/cpu/i386/auto.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -7,10 +7,10 @@
 
 =head1 DESCRIPTION
 
-Test for MMX/SSE functionality. Creates these Config entries
+Test for cmpxchg ASM functionality. Creates these Config entries
 
  TEMP_generated => 'files ...'   for inclusion in platform.c or platform.h
- i386_has_mmx   => 1
+ i386_has_gcc_cmpxchg_c   => 1
 
 =cut
 
@@ -24,25 +24,7 @@
 
     my $verbose = $conf->options->get('verbose');
 
-    my @files = qw( memcpy_mmx.c memcpy_sse.c );
-    for my $f (@files) {
-        print " $f " if $verbose;
-        my ($suffix) = $f =~ /memcpy_(\w+)/;
-        my $path_f = "config/auto/cpu/i386/$f";
-        $conf->cc_gen($path_f);
-        eval( $conf->cc_build("-DPARROT_CONFIG_TEST") );
-        if ($@) {
-            print " $@ " if $verbose;
-        }
-        else {
-            if ( $conf->cc_run() =~ /ok/ ) {
-                _handle_cc_run_ok($conf, $suffix, $path_f, $verbose);
-            }
-        }
-        $conf->cc_clean();
-    }
-
-    @files = qw( test_gcc_cmpxchg_c.in );
+    my @files = qw( test_gcc_cmpxchg_c.in );
     for my $f (@files) {
         print " $f " if $verbose;
         my ($suffix) = $f =~ /test_(\w+)/;

Deleted: branches/orderedhash_revamp/config/auto/cpu/i386/memcpy_mmx.c
==============================================================================
--- branches/orderedhash_revamp/config/auto/cpu/i386/memcpy_mmx.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,103 +0,0 @@
-/*
- * DO NOT EDIT THIS FILE
- *
- * Generated from memcpy_mmx_in.c via memcpy_mmx_in.s
- * by '../../../../tools/dev/as2c.pl memcpy_mmx_in'
- */
-
-/*
- * GAS LISTING /home/chip/tmp/cci2hVe3.s 			page 1
- *
- *
- *    1              		.file	"memcpy_mmx_in.c"
- *    2              		.text
- *    3              		.p2align 4,,15
- *    4              	.globl Parrot_memcpy_aligned_mmx
- *
- */
-static const char Parrot_memcpy_aligned_mmx_code[] = {
-                           /* Parrot_memcpy_aligned_mmx: */
-    0x57,                       /* pushl %edi */
-    0x56,                       /* pushl %esi */
-    0x53,                       /* pushl %ebx */
-    0x83, 0xEC, 0x10,           /* subl $16, %esp */
-    0x8B, 0x44, 0x24, 0x20,     /* movl 32(%esp), %eax */
-    0x8B, 0x5C, 0x24, 0x24,     /* movl 36(%esp), %ebx */
-    0x8B, 0x54, 0x24, 0x28,     /* movl 40(%esp), %edx */
-    0xDD, 0x5C, 0x24, 0x08,     /* fstpl 8(%esp) */
-    0x89, 0xC7,                 /* mov %eax, %edi */
-    0x89, 0xDE,                 /* mov %ebx, %esi */
-    0x89, 0xD1,                 /* mov %edx, %ecx */
-    0xC1, 0xE9, 0x04,           /* shr $4, %ecx */
-                           /* 1: */
-    0x0F, 0x6F, 0x06,           /* movq 0(%esi), %mm0 */
-    0x0F, 0x6F, 0x4E, 0x08,     /* movq 8(%esi), %mm1 */
-    0x83, 0xC6, 0x10,           /* add $16, %esi */
-    0x0F, 0x7F, 0x07,           /* movq %mm0, 0(%edi) */
-    0x0F, 0x7F, 0x4F, 0x08,     /* movq %mm1, 8(%edi) */
-    0x83, 0xC7, 0x10,           /* add $16, %edi */
-    0x49,                       /* dec %ecx */
-    0x75, 0xE9,                 /* jnz 1b */
-    0x0F, 0x77,                 /* emms */
-    0xDD, 0x44, 0x24, 0x08,     /* fldl 8(%esp) */
-    0x83, 0xC4, 0x10,           /* addl $16, %esp */
-    0x5B,                       /* popl %ebx */
-    0x5E,                       /* popl %esi */
-    0x5F,                       /* popl %edi */
-    0xC3,                       /* ret */
-    0x00
-};
-
-#include <stdlib.h>
-typedef void* (*Parrot_memcpy_aligned_mmx_t)(void *dest, const void *src, size_t);
-
-#ifndef NDEBUG
-#include <assert.h>
-static void*
-Parrot_memcpy_aligned_mmx_debug(void* d, const void* s, size_t n)
-{
-    assert( (n & 0xf) == 0);
-    assert( ((unsigned long) d & 7) == 0);
-    assert( ((unsigned long) s & 7) == 0);
-    return ((Parrot_memcpy_aligned_mmx_t)Parrot_memcpy_aligned_mmx_code)(d, s, n);
-}
-
-Parrot_memcpy_aligned_mmx_t Parrot_memcpy_aligned_mmx = Parrot_memcpy_aligned_mmx_debug;
-
-#else
-Parrot_memcpy_aligned_mmx_t Parrot_memcpy_aligned_mmx =
-    (Parrot_memcpy_aligned_mmx_t) Parrot_memcpy_aligned_mmx_code;
-#endif
-
-#ifdef PARROT_CONFIG_TEST
-#include <string.h>
-#include <stdio.h>
-int main(int argc, char *argv[]) {
-    unsigned char *s, *d;
-    size_t i, n;
-
-    n = 640;	/* sizeof(reg_store) */
-
-    s = (unsigned char *)malloc(n);
-    for (i = 0; i < n; ++i)
-    s[i] = i & 0xff;
-    d = (unsigned char *)malloc(n);
-    for (i = 0; i < n; ++i)
-    d[i] = 0xff;
-    Parrot_memcpy_aligned_mmx(d, s, n);
-    for (i = 0; i < n; ++i)
-    if (d[i] != (i & 0xff)) {
-        printf("error s[%d] = %d d = %d\n", i, s[i], d[i]);
-        exit(EXIT_FAILURE);
-    }
-    puts("ok");
-    return 0;
-}
-#endif /* PARROT_CONFIG_TEST */
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/config/auto/cpu/i386/memcpy_mmx_in.c
==============================================================================
--- branches/orderedhash_revamp/config/auto/cpu/i386/memcpy_mmx_in.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,95 +0,0 @@
-/*
- * $Id$
- * Copyright (C) 2004-2006, Parrot Foundation.
- */
-
-#include <stdlib.h>
-void*
-Parrot_memcpy_aligned_mmx(void *dest, const void *src, size_t n)
-{
-    double tos;
-    /*
-     * must preserve tos - need also a version with fstpt/fldt
-     */
-    asm(
-        "fstpl %3\n\t"
-        "mov %0, %%edi\n\t"
-        "mov %1, %%esi\n\t"
-        "mov %2, %%ecx\n\t"
-        "shr $4, %%ecx\n\t"
-        "# .p2align 3\n\t"
-        "1:\n\t"
-        "movq 0(%%esi), %%mm0\n\t"
-        "movq 8(%%esi), %%mm1\n\t"
-        "add $16, %%esi\n\t"
-        "movq %%mm0, 0(%%edi)\n\t"
-        "movq %%mm1, 8(%%edi)\n\t"
-        "add $16, %%edi\n\t"
-        "dec %%ecx\n\t"
-        "jnz 1b\n\t"
-        "emms\n\t"
-        "fldl %3\n\t"
-    : /* no out */
-    : "g"(dest), "g"(src), "g"(n), "m"(tos)
-    : "%esi", "%edi", "%ecx", "memory");
-
-    return dest;
-}
-
-/*INTERFACE
-
-#include <stdlib.h>
-typedef void* (*@FUNC at _t)(void *dest, const void *src, size_t);
-
-#ifndef NDEBUG
-#  include <assert.h>
-static void*
- at FUNC@_debug(void* d, const void* s, size_t n)
-{
-    assert( (n & 0xf) == 0);
-    assert( ((unsigned long) d & 7) == 0);
-    assert( ((unsigned long) s & 7) == 0);
-    return ((@FUNC at _t)@FUNC at _code)(d, s, n);
-}
-
- at FUNC@_t @FUNC@ = @FUNC at _debug;
-
-#else
- at FUNC@_t @FUNC@ =
-    (@FUNC at _t) @FUNC at _code;
-#endif
-
-#ifdef PARROT_CONFIG_TEST
-#  include <string.h>
-#  include <stdio.h>
-int main(int argc, char *argv[]) {
-    unsigned char *s, *d;
-    size_t i, n;
-
-    n = 640; @* sizeof(reg_store) *@
-
-    s = malloc(n);
-    for (i = 0; i < n; ++i)
-        s[i] = i & 0xff;
-    d = malloc(n);
-    for (i = 0; i < n; ++i)
-        d[i] = 0xff;
-    @FUNC@(d, s, n);
-    for (i = 0; i < n; ++i) {
-        if (d[i] != (i & 0xff)) {
-            printf("error s[%d] = %d d = %d\n", i, s[i], d[i]);
-            exit(EXIT_FAILURE);
-        }
-    }
-    puts("ok");
-    return 0;
-}
-#endif @* PARROT_CONFIG_TEST *@
-INTERFACE*/
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/config/auto/cpu/i386/memcpy_sse.c
==============================================================================
--- branches/orderedhash_revamp/config/auto/cpu/i386/memcpy_sse.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,94 +0,0 @@
-/*
- * DO NOT EDIT THIS FILE
- *
- * Generated from memcpy_sse_in.c via memcpy_sse_in.s
- * by '../../../../tools/dev/as2c.pl memcpy_sse_in'
- */
-
-/*
- * GAS LISTING /home/chip/tmp/ccvNpFsi.s 			page 1
- *
- *
- *    1              		.file	"memcpy_sse_in.c"
- *    2              		.text
- *    3              		.p2align 4,,15
- *    4              	.globl Parrot_memcpy_aligned_sse
- *
- */
-static const char Parrot_memcpy_aligned_sse_code[] = {
-                           /* Parrot_memcpy_aligned_sse: */
-    0x57,                       /* pushl %edi */
-    0x56,                       /* pushl %esi */
-    0x8B, 0x44, 0x24, 0x0C,     /* movl 12(%esp), %eax */
-    0x8B, 0x4C, 0x24, 0x14,     /* mov 20(%esp), %ecx */
-    0x8B, 0x74, 0x24, 0x10,     /* mov 16(%esp), %esi */
-    0x89, 0xC7,                 /* mov %eax, %edi */
-    0xC1, 0xE9, 0x05,           /* shr $5, %ecx */
-                           /* 1: */
-    0x0F, 0x10, 0x06,           /* movups 0(%esi), %xmm0 */
-    0x0F, 0x10, 0x4E, 0x10,     /* movups 16(%esi), %xmm1 */
-    0x83, 0xC6, 0x20,           /* add $32, %esi */
-    0x0F, 0x11, 0x07,           /* movups %xmm0, 0(%edi) */
-    0x0F, 0x11, 0x4F, 0x10,     /* movups %xmm1, 16(%edi) */
-    0x83, 0xC7, 0x20,           /* add $32, %edi */
-    0x49,                       /* dec %ecx */
-    0x75, 0xE9,                 /* jnz 1b */
-    0x5E,                       /* popl %esi */
-    0x5F,                       /* popl %edi */
-    0xC3,                       /* ret */
-    0x00
-};
-
-#include <stdlib.h>
-typedef void* (*Parrot_memcpy_aligned_sse_t)(void *dest, const void *src, size_t);
-
-#ifndef NDEBUG
-#include <assert.h>
-static void*
-Parrot_memcpy_aligned_sse_debug(void* d, const void* s, size_t n)
-{
-    assert( (n & 0x1f) == 0);
-    assert( ((unsigned long) d & 7) == 0);
-    assert( ((unsigned long) s & 7) == 0);
-    return ((Parrot_memcpy_aligned_sse_t)Parrot_memcpy_aligned_sse_code)(d, s, n);
-}
-
-Parrot_memcpy_aligned_sse_t Parrot_memcpy_aligned_sse = Parrot_memcpy_aligned_sse_debug;
-
-#else
-Parrot_memcpy_aligned_sse_t Parrot_memcpy_aligned_sse =
-    (Parrot_memcpy_aligned_sse_t) Parrot_memcpy_aligned_sse_code;
-#endif
-
-#ifdef PARROT_CONFIG_TEST
-#include <string.h>
-#include <stdio.h>
-int main(int argc, char *argv[]) {
-    unsigned char *s, *d;
-    size_t i, n;
-
-    n = 640;	/* sizeof(reg_store) */
-
-    s = (unsigned char *)malloc(n);
-    for (i = 0; i < n; ++i)
-    s[i] = i & 0xff;
-    d = (unsigned char *)malloc(n);
-    for (i = 0; i < n; ++i)
-    d[i] = 0xff;
-    Parrot_memcpy_aligned_sse(d, s, n);
-    for (i = 0; i < n; ++i)
-    if (d[i] != (i & 0xff)) {
-        printf("error s[%d] = %d d = %d\n", i, s[i], d[i]);
-        exit(EXIT_FAILURE);
-    }
-    puts("ok");
-    return 0;
-}
-#endif /* PARROT_CONFIG_TEST */
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/config/auto/cpu/i386/memcpy_sse_in.c
==============================================================================
--- branches/orderedhash_revamp/config/auto/cpu/i386/memcpy_sse_in.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,85 +0,0 @@
-/*
- * $Id$
- * Copyright (C) 2004-2006, Parrot Foundation.
- */
-
-#include <stdlib.h>
-void*
-Parrot_memcpy_aligned_sse(void *dest, const void *src, size_t n)
-{
-    asm(
-        "mov %0, %%ecx\n\t"
-        "mov %1, %%esi\n\t"
-        "mov %2, %%edi\n\t"
-        "shr $5, %%ecx\n\t"
-        "#.p2align 4\n\t"
-        "1:\n\t"
-        "movups 0(%%esi), %%xmm0\n\t"
-        "movups 16(%%esi), %%xmm1\n\t"
-        "add $32, %%esi\n\t"
-        "movups %%xmm0, 0(%%edi)\n\t"
-        "movups %%xmm1, 16(%%edi)\n\t"
-        "add $32, %%edi\n\t"
-        "dec %%ecx\n\t"
-        "jnz 1b\n\t"
-
-    : : "g"(n), "g"(src), "g"(dest) : "%esi", "%edi", "%ecx");
-    return dest;
-}
-
-/*INTERFACE
-
-#include <stdlib.h>
-typedef void* (*@FUNC at _t)(void *dest, const void *src, size_t);
-
-#ifndef NDEBUG
-#  include <assert.h>
-static void*
- at FUNC@_debug(void* d, const void* s, size_t n)
-{
-    assert( (n & 0x1f) == 0);
-    assert( ((unsigned long) d & 7) == 0);
-    assert( ((unsigned long) s & 7) == 0);
-    return ((@FUNC at _t)@FUNC at _code)(d, s, n);
-}
-
- at FUNC@_t @FUNC@ = @FUNC at _debug;
-
-#else
- at FUNC@_t @FUNC@ =
-    (@FUNC at _t) @FUNC at _code;
-#endif
-
-#ifdef PARROT_CONFIG_TEST
-#  include <string.h>
-#  include <stdio.h>
-int main(int argc, char *argv[]) {
-    unsigned char *s, *d;
-    size_t i, n;
-
-    n = 640; @* sizeof(reg_store) *@
-
-    s = malloc(n);
-    for (i = 0; i < n; ++i)
-        s[i] = i & 0xff;
-    d = malloc(n);
-    for (i = 0; i < n; ++i)
-        d[i] = 0xff;
-    @FUNC@(d, s, n);
-    for (i = 0; i < n; ++i)
-        if (d[i] != (i & 0xff)) {
-            printf("error s[%d] = %d d = %d\n", i, s[i], d[i]);
-            exit(EXIT_FAILURE);
-        }
-    puts("ok");
-    return 0;
-}
-#endif @* PARROT_CONFIG_TEST *@
-INTERFACE*/
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Modified: branches/orderedhash_revamp/config/auto/crypto.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/crypto.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/crypto.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -47,7 +47,7 @@
         return 1;
     }
 
-    my $osname = $conf->data->get_p5('OSNAME');
+    my $osname = $conf->data->get('osname');
 
     my $extra_libs = $self->_select_lib( {
         conf            => $conf,
@@ -65,6 +65,7 @@
         $has_crypto = $self->_evaluate_cc_run($conf, $test, $has_crypto, $verbose);
     }
     $conf->data->set( has_crypto => $has_crypto );    # for dynpmc.in & digest.t
+    $self->set_result($has_crypto ? 'yes' : 'no');
 
     return 1;
 }

Modified: branches/orderedhash_revamp/config/auto/env/test_unsetenv_c.in
==============================================================================
--- branches/orderedhash_revamp/config/auto/env/test_unsetenv_c.in	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/env/test_unsetenv_c.in	Sat Jan 23 01:49:53 2010	(r43541)
@@ -11,7 +11,7 @@
 
 int main(int argc, char **argv)
 {
-/* we have an hand-rolled unsetenv */
+    /* we have an hand-rolled unsetenv */
 #ifndef WIN32
     unsetenv("PARROT_TEST");
 #endif

Deleted: branches/orderedhash_revamp/config/auto/fink.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/fink.pm	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,107 +0,0 @@
-# Copyright (C) 2005-2007, Parrot Foundation.
-# $Id$
-
-=head1 NAME
-
-config/auto/fink.pm - Determine Fink location on Darwin
-
-=head1 DESCRIPTION
-
-If the operating system is Darwin, this class determines whether and where
-Fink is installed.
-
-=cut
-
-package auto::fink;
-
-use strict;
-use warnings;
-
-use base qw(Parrot::Configure::Step);
-
-use Parrot::Configure::Utils ':auto';
-use Parrot::BuildUtil;
-
-
-sub _init {
-    my $self = shift;
-    my %data;
-    $data{description} = q{Determine Fink location on Darwin};
-    $data{result}      = q{};
-    # Per fink(8), this is location for Fink configuration file, presumably
-    # regardless of where Fink itself is installed.
-    $data{fink_conf}    = q{/sw/etc/fink.conf};
-    return \%data;
-}
-
-sub runstep {
-    my ( $self, $conf ) = ( shift, shift );
-    my $osname = $conf->data->get_p5( 'OSNAME' );
-    my $verbose = $conf->options->get( 'verbose' );
-    unless ($osname =~ /darwin/) {
-        print "Operating system is $osname; Fink is Darwin only\n"
-            if $verbose;
-        $self->set_result('skipped');
-        return 1;
-    }
-    # Per fink(8), this is location for Fink configuration file, presumably
-    # regardless of where Fink itself is installed.
-    my $fink_conf = $self->{fink_conf};
-    unless (-f $fink_conf) {
-        print "Fink configuration file not located\n"
-            if $verbose;
-        $self->set_result('Fink not installed');
-        return 1;
-    }
-    my $fink_conf_str = Parrot::BuildUtil::slurp_file($fink_conf);
-    my @lines = split /\n/, $fink_conf_str;
-    my $fink_base_dir;
-    while (defined (my $l = shift @lines) ) {
-        chomp $l;
-        next unless $l =~ /^Basepath:\s(.*)/;
-        $fink_base_dir = $1;
-        last;
-    }
-    unless (defined $fink_base_dir) {
-        print "Fink configuration file defective:  no 'Basepath'\n"
-            if $verbose;
-        $self->set_result('failed');
-        return;
-    }
-    my $fink_lib_dir = qq{$fink_base_dir/lib};
-    my $fink_include_dir = qq{$fink_base_dir/include};
-    my @unlocateables;
-    foreach my $dir ($fink_base_dir, $fink_lib_dir, $fink_include_dir) {
-        push @unlocateables, $dir unless (-d $dir);
-    }
-    if (@unlocateables) {
-        print "Could not locate Fink directories:  @unlocateables\n"
-            if $verbose;
-        $self->set_result('failed');
-        return;
-    }
-    else {
-        $conf->data->set(
-            fink_base_dir       => $fink_base_dir,
-            fink_lib_dir        => $fink_lib_dir,
-            fink_include_dir    => $fink_include_dir,
-        );
-        $self->set_result('Fink located');
-        return 1;
-    }
-}
-
-1;
-
-=head1 AUTHOR
-
-James E Keenan
-
-=cut
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/config/auto/format.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/format.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/format.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -15,7 +15,6 @@
 
 use strict;
 use warnings;
-use Config;  # for long double printf format
 
 use base qw(Parrot::Configure::Step);
 
@@ -75,8 +74,9 @@
         # 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;
-        if (defined($Config{'sPRIgldbl'})) {
-            $nvformat = "%.15" .  $Config{'sPRIgldbl'};
+        my $spri = $conf->data->get('sPRIgldbl_provisional');
+        if ( defined $spri ) {
+            $nvformat = "%.15" .  $spri;
             $nvformat =~ s/"//g;   # Perl 5's Config value has embedded double quotes
         }
         else {

Added: branches/orderedhash_revamp/config/auto/frames.pm
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/config/auto/frames.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,108 @@
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+config/auto/frames
+
+=head1 DESCRIPTION
+
+Determines whether the current platform is capable of building NCI call
+frames dynamically.  Use the C<--buildframes> option to override the
+default value for your CPU architecture and operating system.
+
+=cut
+
+package auto::frames;
+
+use strict;
+use warnings;
+
+use base qw(Parrot::Configure::Step);
+
+sub _init {
+    my $self = shift;
+    my %data;
+    $data{description} = q{Determine call frame building capability};
+    $data{result}      = q{};
+    return \%data;
+}
+
+sub runstep {
+    my ( $self, $conf ) = @_;
+
+    my $can_build_call_frames = _call_frames_buildable($conf);
+
+    $self->_handle_can_build_call_frames( $conf, $can_build_call_frames );
+
+    return 1;
+}
+
+sub _call_frames_buildable {
+    my $conf = shift;
+
+    my $osname  = $conf->data->get('osname');
+    my $cpuarch = $conf->data->get('cpuarch');
+    my $nvsize  = $conf->data->get('nvsize');
+    my $can_build_call_frames;
+
+    if (defined $conf->options->get('buildframes')) {
+        $can_build_call_frames = $conf->options->get('buildframes');
+    }
+    else {
+        # TT #1132
+        # Temporary disable build frames automatically.
+        #$can_build_call_frames = ($nvsize == 8 && $cpuarch eq 'i386'
+        #    && $osname ne 'darwin');
+        $can_build_call_frames = 0;
+    }
+    return $can_build_call_frames;
+}
+
+sub _handle_can_build_call_frames {
+    my ($self, $conf, $can_build_call_frames) = @_;
+    if ( $can_build_call_frames ) {
+        $conf->data->set(
+            cc_build_call_frames  => '-DCAN_BUILD_CALL_FRAMES',
+        );
+        # test for executable malloced memory
+        my $osname = $conf->data->get( 'osname' );
+        if ( -e "config/auto/frames/test_exec_${osname}_c.in" ) {
+            $conf->cc_gen("config/auto/frames/test_exec_${osname}_c.in");
+            eval { $conf->cc_build(); };
+            if ($@) {
+                $conf->data->set( has_exec_protect => 0 );
+            }
+            else {
+                my $exec_protect_test = (
+                    $conf->cc_run(0) !~ /ok/ && $conf->cc_run(1) =~ /ok/
+                );
+                if ($exec_protect_test) {
+                    $conf->data->set( has_exec_protect => 1 );
+                }
+                else {
+                    $conf->data->set( has_exec_protect => 0 );
+                }
+            }
+            $conf->cc_clean();
+        }
+        else {
+            $conf->data->set( has_exec_protect => 0 );
+        }
+        $self->set_result( 'yes' );
+    }
+    else {
+        $conf->data->set( cc_build_call_frames  => '');
+        $self->set_result( 'no' );
+    }
+    return 1;
+}
+
+1;
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Copied and modified: branches/orderedhash_revamp/config/auto/frames/test_exec_cygwin_c.in (from r40254, branches/orderedhash_revamp/config/auto/jit/test_exec_cygwin_c.in)
==============================================================================

Copied and modified: branches/orderedhash_revamp/config/auto/frames/test_exec_linux_c.in (from r40254, branches/orderedhash_revamp/config/auto/jit/test_exec_linux_c.in)
==============================================================================

Copied and modified: branches/orderedhash_revamp/config/auto/frames/test_exec_openbsd_c.in (from r40254, branches/orderedhash_revamp/config/auto/jit/test_exec_openbsd_c.in)
==============================================================================

Deleted: branches/orderedhash_revamp/config/auto/funcptr.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/funcptr.pm	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,80 +0,0 @@
-# Copyright (C) 2001-2003, Parrot Foundation.
-# $Id$
-
-=head1 NAME
-
-config/auto/funcptr.pm - Function Pointer Casts
-
-=head1 DESCRIPTION
-
-Verifies that the compiler supports function pointer casts.
-
-=cut
-
-package auto::funcptr;
-
-use strict;
-use warnings;
-
-use base qw(Parrot::Configure::Step);
-
-use Parrot::Configure::Utils ':auto';
-
-
-sub _init {
-    my $self = shift;
-    my %data;
-    $data{description} = q{Does compiler support function pointer casts};
-    $data{result}      = q{};
-    return \%data;
-}
-
-sub runstep {
-    my ( $self, $conf ) = @_;
-
-    my $jitcapable = $conf->data->get('jitcapable');
-
-    if ($jitcapable) {
-        $conf->cc_gen('config/auto/funcptr/test_c.in');
-        eval { $conf->cc_build(); };
-
-        if ( $@ || $conf->cc_run() !~ /OK/ ) {
-            _cast_void_pointers_msg();
-            exit(-1);
-        }
-        $conf->cc_clean();
-        $self->_set_positive_result($conf);
-    }
-
-    return 1;
-}
-
-sub _cast_void_pointers_msg {
-            print <<"END";
-Although it is not required by the ANSI C standard,
-Parrot requires the ability to cast from void pointers to function
-pointers for its JIT support.
-
-Your compiler does not appear to support this behavior with the
-flags you have specified.  You must adjust your settings in order
-to use the JIT code.
-
-If you wish to continue without JIT support, please re-run this script
-With the '--jitcapable=0' argument.
-END
-}
-
-sub _set_positive_result {
-    my ($self, $conf) = @_;
-    print " (yes) " if $conf->options->get('verbose');
-    $self->set_result('yes');
-}
-
-1;
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:

Deleted: branches/orderedhash_revamp/config/auto/funcptr/test_c.in
==============================================================================
--- branches/orderedhash_revamp/config/auto/funcptr/test_c.in	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,43 +0,0 @@
-/*
-Copyright (C) 2002-2009, Parrot Foundation.
-$Id$
-
-figure out if the compiler will let us do non-ansi function pointer casts.
-*/
-
-#include <stdio.h>
-
-int
-a_function(int some_number)
-{
-    if (some_number == 42) {
-        printf("OK\n");
-        return 0;
-    }
-    else {
-        printf("FAIL\n");
-        return -1;
-    }
-}
-
-typedef int (*func_t)(int);
-
-int
-main(int argc, char *argv[])
-{
-    void *voidptr;
-    func_t funcptr;
-
-    voidptr = (void *)a_function;
-    funcptr = a_function;
-    funcptr = (func_t)voidptr;
-
-    return funcptr(42);
-}
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Modified: branches/orderedhash_revamp/config/auto/gc.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/gc.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/gc.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2007, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
 =head1 NAME
@@ -7,37 +7,18 @@
 
 =head1 DESCRIPTION
 
-Checks whether the C<--gc> command-line option was passed to F<Configure.pl>
-and sets the memory allocator accordingly.
+Sets memory allocator.
 
-Eventually, C<--gc> will be able to take any of the following values:
+Currently, we have only one choice:  the memory allocator in
+F<src/gc/alloc_resources.c>.
 
-=over
+In the future, we will have a C<--gc> command-line option which will enable
+the configurer to choose among several garbage collectors.
 
-=item C<gc>
-
-The default. Use the memory allocator in F<src/resources.c>.
-
-=item C<libc>
-
-Use the C library C<malloc> along with F<src/gc/res_lea.c>.
-This doesn't currently work.  See [perl #42774].
-
-=item C<malloc>
-
-Use the malloc in F<src/malloc.c> along with F<src/gc/res_lea.c>.
-Since this uses res_lea.c, it doesn't currently work either.  See [perl #42774].
-
-=item C<malloc-trace>
-
-Use the malloc in F<src/malloc-trace.c> with tracing enabled, along
-with F<src/gc/res_lea.c>.
-Since this uses res_lea.c, it doesn't work currently either.  See [perl #42774].
+=over 4
 
 =back
 
-So, for the time being, only the default value works.
-
 =cut
 
 package auto::gc;
@@ -49,8 +30,6 @@
 
 use Parrot::Configure::Utils ':auto';
 
-
-# valid libc/malloc/malloc-trace/gc
 sub _init {
     my $self = shift;
     my %data;
@@ -62,47 +41,15 @@
 sub runstep {
     my ( $self, $conf ) = @_;
 
-    my $gc = $conf->options->get('gc');
+    my $gc = 'gc';
 
-    # default is GC in alloc_resources.c
-    $gc = 'gc' unless defined $gc;
-
-    if ( $gc =~ /^malloc(?:-trace)?$/ ) {
-        $conf->data->set(
-            TEMP_gc_c => <<"EOF",
-\$(SRC_DIR)/$gc\$(O):	\$(GENERAL_H_FILES) \$(SRC_DIR)/$gc.c
-\$(SRC_DIR)/gc/res_lea\$(O):	\$(GENERAL_H_FILES) \$(SRC_DIR)/gc/res_lea.c
-EOF
-            TEMP_gc_o => "\$(SRC_DIR)\/$gc\$(O) \$(SRC_DIR)/gc/res_lea\$(O)",
-            gc_flag   => '-DGC_IS_MALLOC',
-        );
-    }
-    elsif ( $gc eq 'libc' ) {
-        $conf->data->set(
-            TEMP_gc_c => <<"EOF",
-\$(SRC_DIR)/gc/res_lea\$(O):	\$(GENERAL_H_FILES) \$(SRC_DIR)/gc/res_lea.c
-EOF
-            TEMP_gc_o => "\$(SRC_DIR)/gc/res_lea\$(O)",
-            gc_flag   => '-DGC_IS_MALLOC',
-        );
-        # tests mallinfo after allocation of 128 bytes
-        if ( $conf->data->get('i_malloc') ) {
-            $conf->data->set( malloc_header => 'malloc.h' );
-        }
-        else {
-            $conf->data->set( malloc_header => 'stdlib.h' );
-        }
-    }
-    else {
-        $gc = 'gc';
-        $conf->data->set(
-            TEMP_gc_c => <<"EOF",
+    $conf->data->set(
+        TEMP_gc_c => <<"EOF",
 \$(SRC_DIR)/gc/alloc_resources\$(O):	\$(GENERAL_H_FILES) \$(SRC_DIR)/gc/alloc_resources.c
 EOF
-            TEMP_gc_o => "\$(SRC_DIR)/gc/alloc_resources\$(O)",
-            gc_flag   => '',
-        );
-    }
+        TEMP_gc_o => "\$(SRC_DIR)/gc/alloc_resources\$(O)",
+        gc_flag   => '',
+    );
     print(" ($gc) ") if $conf->options->get('verbose');
 
     return 1;

Modified: branches/orderedhash_revamp/config/auto/gdbm.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/gdbm.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/gdbm.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -50,7 +50,7 @@
         return 1;
     }
 
-    my $osname = $conf->data->get_p5('OSNAME');
+    my $osname = $conf->data->get('osname');
 
     my $extra_libs = $self->_select_lib( {
         conf            => $conf,
@@ -61,10 +61,6 @@
         default         => '-lgdbm',
     } );
 
-    # On OS X check the presence of the gdbm header in the standard
-    # Fink location.
-    $self->_handle_darwin_for_fink($conf, $osname, 'gdbm.h');
-
     $conf->cc_gen('config/auto/gdbm/gdbm_c.in');
     eval { $conf->cc_build( q{}, $extra_libs ); };
     my $has_gdbm = 0;
@@ -74,6 +70,7 @@
         $has_gdbm = $self->_evaluate_cc_run($test, $has_gdbm, $verbose);
     }
     $conf->data->set( has_gdbm => $has_gdbm );    # for gdbmhash.t and dynpmc.in
+    $self->set_result($has_gdbm ? 'yes' : 'no');
 
     return 1;
 }

Modified: branches/orderedhash_revamp/config/auto/gettext.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/gettext.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/gettext.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -50,7 +50,7 @@
         return 1;
     }
 
-    my $osname = $conf->data->get_p5('OSNAME');
+    my $osname = $conf->data->get('osname');
 
     my $extra_libs = $self->_select_lib( {
         conf            => $conf,
@@ -61,11 +61,6 @@
         default         => defined $conf->data->get('glibc') ? '' : '-lintl',
     } );
 
-    # On OS X check the presence of the gettext header in the standard
-    # Fink and MacPorts locations.
-    $self->_handle_darwin_for_fink($conf, $osname, 'libintl.h');
-    $self->_handle_darwin_for_macports($conf, $osname, 'libintl.h');
-
     $conf->cc_gen('config/auto/gettext/gettext_c.in');
     eval { $conf->cc_build( q{}, $extra_libs ); };
     my $has_gettext = 0;

Modified: branches/orderedhash_revamp/config/auto/gmp.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/gmp.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/gmp.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -56,7 +56,7 @@
         return 1;
     }
 
-    my $osname = $conf->data->get_p5('OSNAME');
+    my $osname = $conf->data->get('osname');
 
     my $extra_libs = $self->_select_lib( {
         conf            => $conf,
@@ -66,11 +66,6 @@
         default         => '-lgmp',
     } );
 
-    # On OS X check the presence of the gmp header in the standard
-    # Fink location.
-    $self->_handle_darwin_for_fink($conf, $osname, 'gmp.h');
-    $self->_handle_darwin_for_macports($conf, $osname, 'gmp.h');
-
     $conf->cc_gen('config/auto/gmp/gmp_c.in');
     eval { $conf->cc_build( q{}, $extra_libs); };
     my $has_gmp = 0;
@@ -81,6 +76,7 @@
     if ($has_gmp) {
         $conf->data->add( ' ', libs => $extra_libs );
     }
+    $self->set_result($has_gmp ? 'yes' : 'no');
 
     return 1;
 }

Modified: branches/orderedhash_revamp/config/auto/gmp/gmp_c.in
==============================================================================
--- branches/orderedhash_revamp/config/auto/gmp/gmp_c.in	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/gmp/gmp_c.in	Sat Jan 23 01:49:53 2010	(r43541)
@@ -17,7 +17,7 @@
     char *s; int y;
 
 #ifdef WIN32
-    /* This is a workaround for RT #50212.
+    /* This is a workaround for http://rt.perl.org/rt3/Ticket/Display.html?id=50212
      * Strawberry Perl builds GMP with SSE2 instructions, which some older classes of
      * x86 processor can't handle.  This pops up an error dialog and waits for the user
      * to click before proceeding with the rest of configure.

Modified: branches/orderedhash_revamp/config/auto/headers.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/headers.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/headers.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -73,7 +73,7 @@
 
 sub _set_from_Config {
     my $conf = shift;
-    # perl5's Configure system doesn't call this by its full name, which may
+    # Perl 5's Configure system doesn't call this by its full name, which may
     # confuse use later, particularly once we break free and start doing all
     # probing ourselves
     my %mapping = ( i_niin => "i_netinetin" );
@@ -85,7 +85,7 @@
 
 sub _list_extra_headers {
     my $conf = shift;
-    # some headers may not be probed-for by perl 5, or might not be
+    # some headers may not be probed-for by Perl 5, or might not be
     # properly reflected in %Config (i_fcntl seems to be wrong on my machine,
     # for instance).
     #
@@ -101,9 +101,19 @@
         sys/stat.h sysexit.h limits.h);
 
     # more extra_headers needed on mingw/msys; *BSD fails if they are present
-    if ( $conf->data->get_p5('OSNAME') eq "msys" ) {
+    if ( $conf->data->get('OSNAME_provisional') eq "msys" ) {
         push @extra_headers, qw(sysmman.h netdb.h);
     }
+
+    if ( $conf->data->get('OSNAME_provisional') eq "MSWin32" ) {
+        # Microsoft provides two annotations mechanisms.  __declspec, which
+        # has been around for a while, and Microsoft's standard source code
+        # annotation language (SAL), introduced with Visual C++ 8.0.  See
+        # <http://msdn2.microsoft.com/en-us/library/ms235402(VS.80).aspx>,
+        # <http://msdn2.microsoft.com/en-us/library/dabb5z75(VS.80).aspx>.
+        push @extra_headers, qw(sal.h);
+    }
+
     return @extra_headers;
 }
 

Modified: branches/orderedhash_revamp/config/auto/icu.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/icu.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/icu.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -288,6 +288,7 @@
         print "Trying $arg->{icuconfig} with '--ldflags'\n"
             if $arg->{verbose};
         $icushared = capture_output("$arg->{icuconfig} --ldflags");
+        chomp $icushared;
         print "icushared:  captured $icushared\n"
             if $arg->{verbose};
         ($icushared, $arg->{without}) =

Modified: branches/orderedhash_revamp/config/auto/jit.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/jit.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/jit.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -23,227 +23,39 @@
 use warnings;
 
 use base qw(Parrot::Configure::Step);
-use Parrot::Configure::Utils qw(copy_if_diff);
 
 sub _init {
     my $self = shift;
     my %data;
     $data{description} = q{Determine JIT capability};
     $data{result}      = q{};
-    $data{jit_is_working} = {
-        i386 => 1,
-        ppc  => 1,
-    };
-    $data{jitbase_default} = 'src/jit';   # base path for jit sources
-    # jitcpuarch_platforms:  Those which should be examined for possibility of
-    # exec capability.
-    $data{jitcpuarch_platforms} = { map { $_ => 1 } qw( i386 ppc arm ) };
-    # execcapable_oses:  Those which should have exec capability.
-    $data{execcapable_oses} = { map { $_ => 1 }
-        qw( openbsd freebsd netbsd linux darwin cygwin MSWin32 )
-    };
     return \%data;
 }
 
 sub runstep {
     my ( $self, $conf ) = @_;
 
-    my $verbose = $conf->options->get('verbose');
-    $verbose and print "\n";
+    my $osname  = $conf->data->get('osname');
+    my $cpuarch = $conf->data->get('cpuarch');
 
-    my $cpuarch     = $conf->data->get('cpuarch');
-    my $osname      = $conf->data->get('osname');
-    my $nvsize      = $conf->data->get('nvsize');
-
-    my $jitbase  = $self->{jitbase_default};   # base path for jit sources
-
-    my $corejit = "$jitbase/$cpuarch/core.jit";
-    print( qq{-e $corejit = },
-        -e $corejit ? 'yes' : 'no', "\n" )
-        if $verbose;
-
-    my $jitcapable =
-        $self->_check_jitcapability($corejit, $cpuarch, $osname, $nvsize);
-
-    my $jitarchname = "$cpuarch-$osname";
-    _handle_asm( {
-        conf        => $conf,
-        jitbase     => $jitbase,
-        cpuarch     => $cpuarch,
-        jitarchname => $jitarchname,
-    } );
-
-    # let developers override the default JIT capability
-    $jitcapable = $conf->options->get('jitcapable')
-        if defined $conf->options->get('jitcapable');
-
-    if (! $jitcapable) {
-        $conf->data->set(
-            jitarchname    => 'nojit',
-            jitcpuarch     => $cpuarch,
-            jitcpu         => $cpuarch,
-            jitosname      => $osname,
-            jitcapable     => 0,
-            execcapable    => 0,
-            cc_hasjit      => '',
-            TEMP_jit_o     => '',
-            TEMP_exec_h    => '',
-            TEMP_exec_o    => '',
-            TEMP_exec_dep  => '',
-        );
-        $self->set_result('no');
-        return 1;
-    }
-
-    my ( $jitcpuarch, $jitosname ) = split( /-/, $jitarchname );
     $conf->data->set(
-        jitarchname => $jitarchname,
-        jitcpuarch  => $jitcpuarch,
-        jitcpu      => uc($jitcpuarch),
-        jitosname   => uc($jitosname),
-        jitcapable  => 1,
-        cc_hasjit   => " -DHAS_JIT -D\U$jitcpuarch",
-        TEMP_jit_o =>
-'$(SRC_DIR)/jit$(O) $(SRC_DIR)/jit_cpu$(O) $(SRC_DIR)/jit_debug$(O) $(SRC_DIR)/jit_debug_xcoff$(O) $(SRC_DIR)/jit_defs$(O)'
+        jitarchname    => 'nojit',
+        jitcpuarch     => $cpuarch,
+        jitcpu         => $cpuarch,
+        jitosname      => $osname,
+        jitcapable     => 0,
+        execcapable    => 0,
+        cc_hasjit      => '',
+        TEMP_jit_o     => '',
+        TEMP_exec_h    => '',
+        TEMP_exec_o    => '',
+        TEMP_exec_dep  => '',
+        asmfun_o       => '',
     );
-
-    my $execcapable = $self->_first_probe_for_exec(
-        $jitcpuarch, $osname);
-    $execcapable = $conf->options->get('execcapable')
-        if defined $conf->options->get('execcapable');
-    _handle_execcapable($conf, $execcapable);
-
-    # test for executable malloced memory
-    if ( -e "config/auto/jit/test_exec_${osname}_c.in" ) {
-        print " (has_exec_protect " if $verbose;
-        $conf->cc_gen("config/auto/jit/test_exec_${osname}_c.in");
-        eval { $conf->cc_build(); };
-        if ($@) {
-            print " $@) " if $verbose;
-        }
-        else {
-            my $exec_protect_test = (
-                $conf->cc_run(0) !~ /ok/ && $conf->cc_run(1) =~ /ok/
-            );
-            _handle_exec_protect($conf, $exec_protect_test, $verbose);
-        }
-        $conf->cc_clean();
-    }
-
-    # RT #43146 use executable memory for this test if needed
-    #
-    # test for some instructions
-    if ( $jitcpuarch eq 'i386' ) {
-        $conf->cc_gen('config/auto/jit/test_c.in');
-        eval { $conf->cc_build(); };
-        unless ( $@ || $conf->cc_run() !~ /ok/ ) {
-            $conf->data->set( jit_i386 => 'fcomip' );
-        }
-        $conf->cc_clean();
-    }
-    $self->set_result('yes');
-    return 1;
-}
-
-#################### INTERNAL SUBROUTINES ####################
-
-sub _check_jitcapability {
-    my $self = shift;
-    my ($corejit, $cpuarch, $osname, $nvsize) = @_;
-    my $jitcapable = 0;
-    if ( -e $corejit ) {
-
-        # Just because there is a "$jitbase/$cpuarch/core.jit" file,
-        # doesn't mean the JIT is working on that platform.
-        # So build JIT per default only on platforms where JIT in known
-        # to work. Building JIT on other platform most likely breaks the build.
-        # Developer can always call: Configure.pl --jitcapable
-        # This was discussed in RT #43145 (which has been resolved).
-        if ( $self->{jit_is_working}->{$cpuarch} ) {
-            $jitcapable = 1;
-        }
-
-        # Can only jit double. For long double see patch in TT #352.
-        # float not yet planned.
-        if ( $nvsize != 8 ) {
-            $jitcapable = 0;
-        }
-
-        # Another exception
-        if ( $cpuarch eq 'i386' && $osname eq 'darwin' ) {
-            $jitcapable = 0;
-        }
-    }
-    return $jitcapable;
-}
-
-sub _handle_asm {
-    my $arg = shift;
-    my $sjit = "$arg->{jitbase}/$arg->{cpuarch}/$arg->{jitarchname}.s";
-    my $asm = "$arg->{jitbase}/$arg->{cpuarch}/asm.s";
-    if ( -e $sjit ) {
-        copy_if_diff( $sjit, "src/asmfun.S" );
-        $arg->{conf}->data->set( asmfun_o => 'src/asmfun$(O)' );
-    }
-    elsif ( -e $asm ) {
-        copy_if_diff( $asm, "src/asmfun.S" );
-        $arg->{conf}->data->set( asmfun_o => 'src/asmfun$(O)' );
-    }
-    else {
-        $arg->{conf}->data->set( asmfun_o => '' );
-    }
-}
-
-sub _first_probe_for_exec {
-    my $self = shift;
-    my ($jitcpuarch, $osname) = @_;
-    my $execcapable = 0;
-    if ( $self->{jitcpuarch_platforms}->{$jitcpuarch} ) {
-        $execcapable = 1;
-        unless ( $self->{execcapable_oses}->{$osname} ) {
-            $execcapable = 0;
-        }
-    }
-    return $execcapable;
-}
-
-sub _handle_execcapable {
-    my ($conf, $execcapable) = @_;
-    if ($execcapable) {
-        my $cpuarch = $conf->data->get('cpuarch');
-        $conf->data->set(
-            TEMP_exec_h =>
-'$(SRC_DIR)/jit.h $(INC_DIR)/exec.h $(SRC_DIR)/exec_dep.h $(SRC_DIR)/exec_save.h',
-            TEMP_exec_o =>
-                '$(SRC_DIR)/exec$(O) $(SRC_DIR)/exec_cpu$(O) $(SRC_DIR)/exec_dep$(O) $(SRC_DIR)/exec_save$(O)',
-            TEMP_exec_dep =>
-                "\$(SRC_DIR)/exec_dep.c : \$(SRC_DIR)/jit/$cpuarch/exec_dep.c\n"
-                . "\t\$(CP) \$(SRC_DIR)/jit/$cpuarch/exec_dep.c \$(SRC_DIR)/exec_dep.c",
-            execcapable => 1
-        );
-    }
-    else {
-        $conf->data->set(
-            TEMP_exec_h   => '',
-            TEMP_exec_o   => '',
-            TEMP_exec_dep => '',
-            execcapable   => 0,
-        );
-    }
+    $self->set_result('no');
     return 1;
 }
 
-sub _handle_exec_protect {
-    my ($conf, $exec_protect_test, $verbose) = @_;
-    if ($exec_protect_test) {
-        $conf->data->set( has_exec_protect => 1 );
-        print "yes) " if $verbose;
-    }
-    else {
-        print "no) " if $verbose;
-    }
-}
-
 1;
 
 # Local Variables:

Deleted: branches/orderedhash_revamp/config/auto/jit/test_c.in
==============================================================================
--- branches/orderedhash_revamp/config/auto/jit/test_c.in	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,53 +0,0 @@
-/*
-Copyright (C) 2002-2009, Parrot Foundation.
-$Id$
-
-test for the fcomip float instruction
-*/
-
-#include <stdio.h>
-
-/*
- * c equiv:
-  int t(int i, int j) {
-  return (double)i == (double)j;
-}
-*/
-
-/* this code leaves one op on the fp stack, but this shouldn't harm */
-
-char code[] = {
-    0x55,               /* pushl %ebp */
-    0x89, 0xE5,         /* movl %esp,%ebp */
-    0x83, 0xEC, 0x18,   /* subl $24,%esp */
-    0xDB, 0x45, 0x08,   /* fildl 8(%ebp) */
-    0xDB, 0x45, 0x0C,   /* fildl 12(%ebp)*/
-    0xDF, 0xE9,         /* fucomip */
-    0x0F, 0x94, 0xC0,   /* sete %al */
-    0x31, 0xD2,         /* xorl %edx,%edx */
-    0x88, 0xC2,         /* movb %al,%dl */
-    0x89, 0xD0,         /* movl %edx,%eax */
-    0x89, 0xEC,         /* movl %ebp,%esp */
-    0x5D,               /* popl %ebp */
-    0xC3                /* ret */
-};
-
-typedef int (*pf)(int, int);
-
-int
-main()
-{
-    pf t  = (pf) code;
-    if (t(10, 10) && !t(10, 20))
-        puts("ok");
-    else
-        return 1;
-    return 0;
-}
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/config/auto/jit/test_exec_cygwin_c.in
==============================================================================
--- branches/orderedhash_revamp/config/auto/jit/test_exec_cygwin_c.in	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,76 +0,0 @@
-/*
-Copyright (C) 2008-2009, Parrot Foundation.
-$Id$
-
-test for exec privs
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/mman.h>
-#include <limits.h>
-#include <errno.h>
-#include <malloc.h>
-#include <unistd.h>
-#include <string.h>
-#ifndef PAGE_SIZE
-#  define PAGE_SIZE getpagesize()
-#endif
-#
-
-/*
- * c equiv:
-  int t() {
-  return 1;
-}
-*/
-
-char code[] = {
-    0xB8, 0x01, 0, 0, 0,        /* movl $1, %eax */
-    0xC3                        /* ret */
-};
-
-typedef int (*pf)(void);
-
-int
-main(int argc, char *argv[])
-{
-    pf t;
-    char *p;
-    int rc;
-    int prot = PROT_READ;
-
-    if (argc != 2) {
-        fprintf(stderr, "usage: test 0 | 1\n");
-        exit(1);
-    }
-
-    if (atoi(argv[1]))
-        prot |= PROT_EXEC;
-
-    p = memalign(PAGE_SIZE, PAGE_SIZE);
-    memcpy(p, code, sizeof (code));
-
-    t  = (pf) p;
-    rc = mprotect(p, PAGE_SIZE, prot);
-
-    if (rc) {
-        fprintf(stderr, "p = %p  PAGE_SIZE = %d (0x%x)\n", p,
-            PAGE_SIZE, PAGE_SIZE);
-        perror("failure");
-    }
-
-    if (t() == 1)
-        puts("ok");
-    else
-        return 1;
-
-    return 0;
-}
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/config/auto/jit/test_exec_linux_c.in
==============================================================================
--- branches/orderedhash_revamp/config/auto/jit/test_exec_linux_c.in	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,71 +0,0 @@
-/*
-Copyright (C) 2004-2009, Parrot Foundation.
-$Id$
-
-test for exec privs
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/mman.h>
-#include <limits.h>
-#include <errno.h>
-#include <malloc.h>
-#include <unistd.h>
-#ifndef PAGE_SIZE
-#  define PAGE_SIZE getpagesize()
-#endif
-
-/*
- * c equiv:
-  int t() {
-  return 1;
-}
-*/
-
-char code[] = {
-    0xB8, 0x01, 0, 0, 0,        /* movl $1, %eax */
-    0xC3                        /* ret */
-};
-
-typedef int (*pf)(void);
-
-int
-main(int argc, char *argv[])
-{
-    pf t;
-    char *p;
-    int rc;
-    int prot = PROT_READ;
-
-    if (argc != 2) {
-        fprintf(stderr, "usage: test 0 | 1\n");
-        exit(1);
-    }
-    if (atoi(argv[1]))
-        prot |= PROT_EXEC;
-
-    p = memalign(PAGE_SIZE, sizeof (code));
-    memcpy(p, code, sizeof (code));
-    t  = (pf) p;
-    rc = mprotect(p, PAGE_SIZE, prot);
-    if (rc) {
-        fprintf(stderr, "p = %p  PAGE_SIZE = %d (0x%x)\n", p,
-            PAGE_SIZE, PAGE_SIZE);
-        perror("failure");
-    }
-
-    if (t() == 1)
-        puts("ok");
-    else
-        return 1;
-
-    return 0;
-}
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/config/auto/jit/test_exec_openbsd_c.in
==============================================================================
--- branches/orderedhash_revamp/config/auto/jit/test_exec_openbsd_c.in	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,71 +0,0 @@
-/*
-Copyright (C) 2004-2009, Parrot Foundation.
-$Id$
-
-test for exec privs
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/mman.h>
-#include <limits.h>
-#include <errno.h>
-#include <malloc.h>
-#include <unistd.h>
-#ifndef PAGE_SIZE
-#  define PAGE_SIZE sysconf(_SC_PAGESIZE)
-#endif
-
-/*
- * c equiv:
-  int t() {
-  return 1;
-}
-*/
-
-char code[] = {
-    0xB8, 0x01, 0, 0, 0,    /* movl $1, %eax */
-    0xC3                        /* ret */
-};
-
-typedef int (*pf)(void);
-
-int
-main(int argc, char *argv[])
-{
-    pf t;
-    char *p;
-    int rc;
-    int prot = PROT_READ;
-
-    if (argc != 2) {
-        fprintf(stderr, "usage: test 0 | 1\n");
-        exit(1);
-    }
-    if (atoi(argv[1]))
-        prot |= PROT_EXEC;
-
-    p = malloc(PAGE_SIZE);
-    memcpy(p, code, sizeof (code));
-    t  = (pf) p;
-    rc = mprotect(p, PAGE_SIZE, prot);
-    if (rc) {
-        fprintf(stderr, "p = %p  PAGE_SIZE = %d (0x%x)\n", p,
-            PAGE_SIZE, PAGE_SIZE);
-        perror("failure");
-    }
-
-    if (t() == 1)
-        puts("ok");
-    else
-        return 1;
-
-    return 0;
-}
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/config/auto/macports.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/macports.pm	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,104 +0,0 @@
-# Copyright (C) 2005-2007, Parrot Foundation.
-# $Id$
-
-=head1 NAME
-
-config/auto/macports.pm - Determine Macports location on Darwin
-
-=head1 DESCRIPTION
-
-If the operating system is Darwin, this class determines whether or not
-Macports is installed in the default location.
-
-B<Note:>  No provision is yet made for Macports installation in non-default
-locations.
-
-B<Note:>  This step is currently Darwin/Macports-specific because it
-consolidates code previously found in multiple configuration step classes.
-With some modification it may be suitable for application to BSD F<ports>
-programs in general, but as there was no BSD-specific code in the
-configuration step classes, that modification has not yet been made.
-
-=cut
-
-package auto::macports;
-
-use strict;
-use warnings;
-
-use File::Spec;
-use base qw(Parrot::Configure::Step);
-
-use Parrot::Configure::Utils ':auto';
-use Parrot::BuildUtil;
-
-sub _init {
-    my $self = shift;
-    my %data;
-    $data{description} = q{Determine Macports location on Darwin};
-    $data{result}      = q{};
-    my $optlocal = File::Spec->catdir( '/', 'opt', 'local' );
-    $data{ports_root} = (defined $ENV{TEST_MACPORTS})
-        ? $ENV{TEST_MACPORTS}
-        : (-d $optlocal)
-            ? $optlocal
-            : undef;
-    return \%data;
-}
-
-sub runstep {
-    my ( $self, $conf ) = ( shift, shift );
-    my $osname = $conf->data->get_p5( 'OSNAME' );
-    my $verbose = $conf->options->get( 'verbose' );
-    unless ($osname =~ /darwin/) {
-        print "Operating system is $osname; Macports is Darwin only\n"
-            if $verbose;
-        $self->set_result('skipped');
-        return 1;
-    }
-    if (! defined $self->{ports_root}) {
-        print "Could not locate Macports root directory\n"
-            if $verbose;
-        $self->set_result('no');
-        return 1;
-    }
-
-    my $ports_base_dir = $self->{ports_root};
-    my $ports_lib_dir = qq{$ports_base_dir/lib};
-    my $ports_include_dir = qq{$ports_base_dir/include};
-    my @unlocateables;
-    foreach my $dir ($ports_base_dir, $ports_lib_dir, $ports_include_dir) {
-        push @unlocateables, $dir unless (-d $dir);
-    }
-    if (@unlocateables) {
-        print "Could not locate Macports directories:  @unlocateables\n"
-            if $verbose;
-        $self->set_result('no');
-        return 1;
-    }
-    else {
-        $conf->data->set(
-            ports_base_dir       => $ports_base_dir,
-            ports_lib_dir        => $ports_lib_dir,
-            ports_include_dir    => $ports_include_dir,
-        );
-        $self->set_result('yes');
-        return 1;
-    }
-}
-
-1;
-
-=head1 AUTHOR
-
-James E Keenan, consolidating code written by Alberto SimÃes, Leopold Toetsch
-and others.
-
-=cut
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/config/auto/msvc.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/msvc.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/msvc.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -90,13 +90,6 @@
         # To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help
         # for details.
         $conf->data->add( " ", "ccflags", "-D_CRT_SECURE_NO_DEPRECATE" );
-
-        # Microsoft provides two annotations mechanisms.  __declspec, which has been
-        # around for a while, and Microsoft's standard source code annotation
-        # language (SAL), introduced with Visual C++ 8.0.
-        # See <http://msdn2.microsoft.com/en-us/library/ms235402(VS.80).aspx>,
-        # <http://msdn2.microsoft.com/en-us/library/dabb5z75(VS.80).aspx>.
-        $conf->data->set( HAS_MSVC_SAL => 1 );
     }
     return 1;
 }

Modified: branches/orderedhash_revamp/config/auto/opengl.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/opengl.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/opengl.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -10,7 +10,7 @@
 =head1 DESCRIPTION
 
 Determines whether the platform supports OpenGL, GLU and GLUT.  The optimal
-result at this time is to find OpenGL 2.1, GLU 1.3, and GLUT API version 4.
+result at this time is to find OpenGL 3.2, GLU 1.3, and GLUT API version 4.
 
 You will typically need to install the headers and libraries required for
 compiling OpenGL/GLU/GLUT applications as a separate step in addition to
@@ -85,8 +85,13 @@
 
 =head2 Windows
 
-On Windows, Parrot supports three different compiler environments, each of
-which has different requirements for OpenGL support:
+On Windows, Parrot supports four different compiler environments, each of
+which has different requirements for OpenGL support.  Generally you should not
+attempt to mix the Cygwin variants (installing some X OpenGL libs and some
+w32api OpenGL libs) as this will almost certainly result in runtime errors
+like this one:
+
+    freeglut ERROR: Function <glutDisplayFunc> called without first calling 'glutInit'.
 
 
 =head3 MSVC
@@ -112,22 +117,22 @@
 
 =head3 Cygwin/X
 
-Requires a X server and F<libglut-devel>, F<libGL-devel>, F<libGLU-devel>,
+Requires an X server and F<libglut-devel>, F<libGL-devel>, F<libGLU-devel>,
 F<freeglut> and its dependencies.
 
 This is tried first.
 
+
 =head3 Cygwin/w32api
 
-The Cygwin/w32api for native opengl support
-is only tried if F</usr/include/GL> does not exist.
+Requires the F<opengl> and F<w32api> packages.
 
-The problem is that the L<NCI|pdds/draft/pdd16_native_call.pod>
-tries the header files to create the imports and not the libraries,
-and if the F</usr/include/GL> headers are found these are used, despite
-the w32api GLUT libraries are defined.
+Cygwin/w32api for native opengl support is only tried if
+F</usr/include/GL> does not exist.  The problem is that the OpenGL header files
+are used to create the OpenGL function list, and not the libraries themselves.
+If the F</usr/include/GL> headers are found these are used, even if the w32api
+GLUT libraries are defined.
 
-F<opengl>, F<w32api>
 
 =cut
 
@@ -162,7 +167,7 @@
 
     return $self->_handle_no_opengl($conf) if $without;
 
-    my $osname = $conf->data->get_p5('OSNAME');
+    my $osname = $conf->data->get('osname');
 
     my $extra_libs = $self->_select_lib( {
             conf            => $conf,
@@ -179,12 +184,6 @@
             default         => '-lglut -lGLU -lGL',
     } );
 
-    # On OS X check the presence of the OpenGL headers in the standard
-    # Fink/macports locations.
-    # Mindlessly morphed from readline ... may need to be fixed
-    $self->_handle_darwin_for_fink    ($conf, $osname, 'GL/glut.h');
-    $self->_handle_darwin_for_macports($conf, $osname, 'GL/glut.h');
-
     $conf->cc_gen('config/auto/opengl/opengl_c.in');
     my $has_glut = 0;
     eval { $conf->cc_build( q{}, $extra_libs ) };

Modified: branches/orderedhash_revamp/config/auto/pcre.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/pcre.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/pcre.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -46,7 +46,7 @@
         return 1;
     }
 
-    my $osname = $conf->data->get_p5('OSNAME');
+    my $osname = $conf->data->get('osname');
 
     my $extra_libs = $self->_select_lib( {
         conf            => $conf,
@@ -56,11 +56,6 @@
         default         => '-lpcre',
     } );
 
-    # On OS X check the presence of the pcre headers in the standard
-    # Fink/macports locations.
-    $self->_handle_darwin_for_fink    ($conf, $osname, 'pcre.h');
-    $self->_handle_darwin_for_macports($conf, $osname, 'pcre.h');
-
     $conf->cc_gen('config/auto/pcre/pcre_c.in');
     eval { $conf->cc_build( q{}, $extra_libs ) };
     my $has_pcre = 0;

Modified: branches/orderedhash_revamp/config/auto/perldoc.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/perldoc.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/perldoc.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -36,7 +36,7 @@
 sub runstep {
     my ( $self, $conf ) = @_;
 
-    my $cmd = $conf->data->get_p5('scriptdirexp') . q{/perldoc};
+    my $cmd = $conf->data->get('scriptdirexp_provisional') . q{/perldoc};
     my ( $fh, $filename ) = tempfile( UNLINK => 1 );
     my $content = capture_output("$cmd -ud $filename perldoc") || undef;
 

Modified: branches/orderedhash_revamp/config/auto/pmc.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/pmc.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/pmc.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -77,7 +77,7 @@
         $parent_dumps .= "src/pmc/$_.dump "
             foreach reverse( ( $self->pmc_parents($pmc) ) );
         my $parent_headers = '';
-        $parent_headers .= "src/pmc/pmc_$_.h "
+        $parent_headers .= "include/pmc/pmc_$_.h "
             for $self->pmc_parents($pmc);
 
         # add dependencies that result from METHOD usage.
@@ -86,7 +86,7 @@
         if (contains_pccmethod($pmc_fname)) {
             $pccmethod_depend = 'lib/Parrot/Pmc2c/PCCMETHOD.pm';
             if ($pmc ne 'fixedintegerarray') {
-                $pccmethod_depend .= ' src/pmc/pmc_fixedintegerarray.h';
+                $pccmethod_depend .= ' include/pmc/pmc_fixedintegerarray.h';
             }
         }
         my $include_headers = get_includes($pmc_fname);
@@ -98,15 +98,16 @@
 src/pmc/$pmc.dump : vtable.dump $parent_dumps src/pmc/$pmc.pmc \$(PMC2C_FILES) $pccmethod_depend
 \t\$(PMC2CD) src/pmc/$pmc.pmc
 
-src/pmc/pmc_$pmc.h: src/pmc/$pmc.c
+\$(PMC_INC_DIR)/pmc/pmc_$pmc.h: src/pmc/$pmc.c
 
-src/pmc/$pmc\$(O): src/pmc/$pmc.str \$(NONGEN_HEADERS) \\
-    $parent_headers $include_headers src/pmc/pmc_continuation.h
+src/pmc/$pmc\$(O): include/pmc/pmc_${pmc}.h src/pmc/$pmc.str \$(NONGEN_HEADERS) \\
+    $parent_headers $include_headers include/pmc/pmc_continuation.h \\
+    include/pmc/pmc_callcontext.h include/pmc/pmc_fixedintegerarray.h
 
 END
     }
 
-    # src/pmc/$pmc\$(O): \$(NONGEN_HEADERS) $parent_headers src/pmc/pmc_$pmc.h
+    # src/pmc/$pmc\$(O): \$(NONGEN_HEADERS) $parent_headers include/pmc/pmc_$pmc.h
 
     # build list of libraries for link line in Makefile
     my $slash = $conf->data->get('slash');
@@ -172,6 +173,7 @@
         TEMP_pmc_classes_o   => $TEMP_pmc_classes_o,
         TEMP_pmc_classes_str => $TEMP_pmc_classes_str,
         TEMP_pmc_classes_pmc => $TEMP_pmc_classes_pmc,
+        pmc_inc              => 'include',
     );
 
     return 1;
@@ -271,6 +273,8 @@
           $include = "include/" . $include;
         } elsif ($include =~ m/^pmc_|\.str$/) { # local pmc header
           $include = "src/pmc/" . $include;
+        } elsif ($include =~ m/^pmc\/pmc_|\.h$/) { # local pmc header
+          $include = "include/" . $include;
         } # else it's probably a system header, don't depend on it.
         push @retval, $include;
     }

Modified: branches/orderedhash_revamp/config/auto/pod2man.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/pod2man.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/pod2man.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -34,7 +34,7 @@
 sub runstep {
     my ( $self, $conf ) = @_;
 
-    my $cmd = $conf->data->get_p5('scriptdirexp') . q{/pod2man};
+    my $cmd = $conf->data->get('scriptdirexp_provisional') . q{/pod2man};
     my $content = capture_output("$cmd docs/parrot.pod") || undef;
 
     return 1 unless defined( $self->_initial_content_check($conf, $content) );

Modified: branches/orderedhash_revamp/config/auto/readline.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/readline.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/readline.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -39,7 +39,7 @@
     my $verbose = $conf->options->get('verbose');
 
     my $cc     = $conf->data->get('cc');
-    my $osname = $conf->data->get_p5('OSNAME');
+    my $osname = $conf->data->get('osname');
 
     my $extra_libs = $self->_select_lib( {
         conf            => $conf,
@@ -49,11 +49,6 @@
         default         => '-lreadline',
     } );
 
-    # On OS X check the presence of the readline header in the standard
-    # Fink/macports locations.
-    $self->_handle_darwin_for_fink($conf, $osname, 'readline/readline.h');
-    $self->_handle_darwin_for_macports($conf, $osname, q{readline/readline.h});
-
     $conf->cc_gen('config/auto/readline/readline_c.in');
     my $has_readline = 0;
     eval { $conf->cc_build( q{}, $extra_libs ) };
@@ -82,6 +77,7 @@
         }
     }
     $conf->data->set( HAS_READLINE => $has_readline );
+    $self->set_result($has_readline ? 'yes' : 'no');
 
     return 1;
 }

Modified: branches/orderedhash_revamp/config/auto/readline/readline_c.in
==============================================================================
--- branches/orderedhash_revamp/config/auto/readline/readline_c.in	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/readline/readline_c.in	Sat Jan 23 01:49:53 2010	(r43541)
@@ -16,8 +16,8 @@
 #ifdef __cplusplus
 extern "C" {
 #endif
-char * readline(const char *);
-void * rl_get_keymap(void);
+    char * readline(const char *);
+    void * rl_get_keymap(void);
 #ifdef __cplusplus
 }
 #endif

Modified: branches/orderedhash_revamp/config/auto/signal.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/signal.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/signal.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -107,7 +107,7 @@
 EOF
     my ( $i, $name );
     $i = 0;
-    foreach $name ( split( ' ', $conf->data->get_p5('sig_name') ) ) {
+    foreach $name ( split( ' ', $conf->data->get('sig_name_provisional') ) ) {
         print {$O} ".macro_const SIG$name\t$i\n" if $i;
         $i++;
     }

Modified: branches/orderedhash_revamp/config/auto/socklen_t.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/socklen_t.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/socklen_t.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -43,7 +43,7 @@
     my $conf = shift;
     return $conf->data->get('has_socklen_t')
             ||
-           $conf->data->get_p5('d_socklen_t');
+           $conf->data->get('d_socklen_t_provisional');
 }
 
 sub _evaluate_socklen_t {

Modified: branches/orderedhash_revamp/config/auto/thread.pm
==============================================================================
--- branches/orderedhash_revamp/config/auto/thread.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/auto/thread.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -44,7 +44,7 @@
         return 1;
     }
 
-    if ($conf->data->get_p5('OSNAME') eq 'MSWin32'
+    if ($conf->data->get('osname') eq 'MSWin32'
      || $conf->data->get('i_pthread') eq 'define') {
         $conf->data->set( HAS_THREADS => 1 );
         $self->set_result('yes');

Modified: branches/orderedhash_revamp/config/gen/call_list/misc.in
==============================================================================
--- branches/orderedhash_revamp/config/gen/call_list/misc.in	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/call_list/misc.in	Sat Jan 23 01:49:53 2010	(r43541)
@@ -32,7 +32,7 @@
 v    illllllll
 v    l
 v    p
-v    pbip     # for libsyck
+v    pbip
 v    pi
 v    piiii
 v    pl
@@ -60,6 +60,17 @@
 I    JOSI
 P    JOSII
 
+# Added for TclLibrary
+t    p3
+i    pp3p
+i    pp3
+i    ppd
+i    ptii
+i    pipi
+t    ptti
+t    pti
+t    pttti
+
 # libpast
 p    Ji
 p    Jipp
@@ -380,6 +391,11 @@
 
 p    ppiii
 p    ppiiiiiii
+i    ppii
+i    ppiii
+i    ppiiii
+i    ppiiiii
+i    ppiiiiii
 i    ppt
 i    pppi
 i    pppii

Modified: branches/orderedhash_revamp/config/gen/config_h.pm
==============================================================================
--- branches/orderedhash_revamp/config/gen/config_h.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/config_h.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -50,24 +50,26 @@
         feature_file   => 1
     );
 
+    my @sorted_keys = sort $conf->data->keys();
+
     $conf->data->set( TEMP_header =>
         join "\n", map { $conf->data->get($_)
                        ? "#define PARROT_HAS_HEADER_" . uc(substr $_, 2) . " 1"
                        : "#undef  PARROT_HAS_HEADER_" . uc(substr $_, 2) }
                    grep { /^i_\w+/ }
-                   sort $conf->data->keys()
+                   @sorted_keys
     );
 
     $conf->data->set( TEMP_has_config =>
         join "\n", map { "#define PARROT_" . uc($_) . " 1" }
                    grep { /^HAS_\w+/ && $conf->data->get($_) }
-                   sort $conf->data->keys()
+                   @sorted_keys
     );
 
     $conf->data->set( TEMP_d_config =>
         join "\n", map { "#define PARROT_" . uc(substr $_, 2) . " " . $conf->data->get($_) }
                    grep { /^D_\w+/ }
-                   sort $conf->data->keys()
+                   @sorted_keys
     );
 
     $conf->data->set( TEMP_cli_define =>

Modified: branches/orderedhash_revamp/config/gen/config_h/config_h.in
==============================================================================
--- branches/orderedhash_revamp/config/gen/config_h/config_h.in	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/config_h/config_h.in	Sat Jan 23 01:49:53 2010	(r43541)
@@ -21,7 +21,7 @@
 #define PARROT_MAJOR_VERSION    @MAJOR@
 #define PARROT_MINOR_VERSION    @MINOR@
 #define PARROT_PATCH_VERSION    @PATCH@
-#define PARROT_ARCHNAME         "@jitarchname@"
+#define PARROT_ARCHNAME         "@cpuarch at -@osname@"
 #define PARROT_JIT_CAPABLE      @jitcapable@
 #define PARROT_EXEC_CAPABLE     @execcapable@
 #define PARROT_SHARE_EXT        "@share_ext@"

Modified: branches/orderedhash_revamp/config/gen/core_pmcs.pm
==============================================================================
--- branches/orderedhash_revamp/config/gen/core_pmcs.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/core_pmcs.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -116,26 +116,20 @@
     __attribute__nonnull__(1)
     __attribute__nonnull__(2);
 
-extern void Parrot_initialize_core_pmcs(PARROT_INTERP)
+extern void Parrot_initialize_core_pmcs(PARROT_INTERP, int pass)
     __attribute__nonnull__(1);
 
-void Parrot_initialize_core_pmcs(PARROT_INTERP)
+void Parrot_initialize_core_pmcs(PARROT_INTERP, int pass)
 {
-    int pass;
-    for (pass = 0; pass <= 1; ++pass) {
-        /* first the PMC with the highest enum
-         * this reduces MMD table resize action */
+    /* first the PMC with the highest enum
+     * this reduces MMD table resize action */
 END_C
 
-    print {$OUT} "        Parrot_${_}_class_init(interp, enum_class_${_}, pass);\n"
+    print {$OUT} "    Parrot_${_}_class_init(interp, enum_class_${_}, pass);\n"
         foreach ( @pmcs[ -1 .. -1 ] );
-    print {$OUT} "        Parrot_${_}_class_init(interp, enum_class_${_}, pass);\n"
+    print {$OUT} "    Parrot_${_}_class_init(interp, enum_class_${_}, pass);\n"
         foreach ( @pmcs[ 0 .. $#pmcs - 1 ] );
     print {$OUT} <<'END_C';
-        if (!pass) {
-            parrot_global_setup_2(interp);
-        }
-    }
 }
 
 static void register_pmc(PARROT_INTERP, NOTNULL(PMC *registry), int pmc_id)

Modified: branches/orderedhash_revamp/config/gen/crypto.pm
==============================================================================
--- branches/orderedhash_revamp/config/gen/crypto.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/crypto.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -28,34 +28,34 @@
     $data{result}      = q{};
     $data{digest}      = {
         MD2         => {
-            md_result => '[0-9a-f]{32}',
+            md_result => 'ab4f496bfb2a530b219ff33031fe06b0',
         },
         MD4         => {
-            md_result => '[0-9a-f]{32}',
+            md_result => 'd9130a8164549fe818874806e1c7014b',
         },
         MD5         => {
             md_result => 'f96b697d7cb7938d525a2f31aaf161d0',
         },
         RIPEMD160   => {
-            md_result => '[0-9a-f]{40}',
+            md_result => '5d0689ef49d2fae572b881b123a85ffa21595f36',
             md_inc => 'ripemd',
         },
         SHA         => {
-            md_result => '[0-9a-f]{40}',
+            md_result => 'c1b0f222d150ebb9aa36a40cafdc8bcbed830b14',,
         },
         SHA1        => {
-            md_result => '[0-9a-f]{40}',
+            md_result => 'c12252ceda8be8994d5fa0290a47231c1d16aae3',
             md_inc => 'sha',
             md_ctx => 'SHA_CTX',
             md_digest => 'SHA_DIGEST',
         },
         SHA256      => {
-            md_result => '[0-9a-f]{64}',
+            md_result => 'f7846f55cf23e14eebeab5b4e1550cad5b509e3348fbc4efa3a1413d393cb650',
             md_inc => 'sha',
             version_needed => '0.9.8a',
         },
         SHA512      => {
-            md_result => '[0-9a-f]{128}',
+            md_result => '107dbf389d9e9f71a3a95f6c055b9251bc5268c2be16d6c13492ea45b0199f3309e16455ab1e96118e8a905d5597b72038ddb372a89826046de66687bb420e7c',
             md_inc => 'sha',
             version_needed => '0.9.8a',
         },

Modified: branches/orderedhash_revamp/config/gen/crypto/digest_pmc.in
==============================================================================
--- branches/orderedhash_revamp/config/gen/crypto/digest_pmc.in	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/crypto/digest_pmc.in	Sat Jan 23 01:49:53 2010	(r43541)
@@ -22,7 +22,6 @@
 
 pmclass @TEMP_md_name@
     dynpmc
-    need_ext
     group digest_group
     lib crypto {
 
@@ -37,7 +36,7 @@
 @TEMP_md_guard@
         @TEMP_md_ctx@ *c    = mem_allocate_zeroed_typed(@TEMP_md_ctx@);
         PMC_data(SELF) = c;
-        PObj_active_destroy_SET(SELF);
+        PObj_custom_destroy_SET(SELF);
 #else
         Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ILL_INHERIT,
             "@TEMP_md_name@ is disabled");
@@ -76,7 +75,7 @@
         memcpy(c, PMC_data(SELF), sizeof (@TEMP_md_ctx@));
         PMC_data(retval) = c;
 
-        PObj_active_destroy_SET(retval);
+        PObj_custom_destroy_SET(retval);
         return retval;
 #else
         return NULL;
@@ -114,7 +113,7 @@
     METHOD void Update(STRING *buf) {
 @TEMP_md_guard@
         @TEMP_md_ctx@ *c = PMC_data_typed(SELF, @TEMP_md_ctx@ *);
-        (void)@TEMP_md_name at _Update(c, (unsigned char *)buf->strstart, buf->bufused);
+        (void)@TEMP_md_name at _Update(c, (const unsigned char *)Buffer_bufstart(buf), buf->bufused);
 #endif
     }
 

Modified: branches/orderedhash_revamp/config/gen/crypto/digest_t.in
==============================================================================
--- branches/orderedhash_revamp/config/gen/crypto/digest_t.in	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/crypto/digest_t.in	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,14 +1,7 @@
-#! perl
+#! parrot
 # Copyright (C) 2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test;
-use Parrot::Config;
-
 =head1 NAME
 
 t/dynpmc/@TEMP_md_file at .t - test the @TEMP_md_name@ PMC (part of digest_group)
@@ -23,30 +16,39 @@
 
 =cut
 
-if ( !$PConfig{has_crypto} ) {
-    plan skip_all => "No crypto library available";
-}
-elsif ( $PConfig{openssl_version} lt '@TEMP_md_skip@' ) {
-    plan skip_all => "Too old library";
-}
-else {
-    plan tests => 2;
-}
+.sub main :main
+    .include 'test_more.pir'
+    .include 'iglobals.pasm'
+    .local pmc config_hash, interp
+
+    plan(2)
+    interp = getinterp
+    config_hash = interp[.IGLOBALS_CONFIG_HASH]
+    $S0 = config_hash['has_crypto']
+    $S1 = config_hash['openssl_version']
+    unless $S0 goto no_crypto
+    if $S1 < '@TEMP_md_skip@' goto old_openssl
+
+    test_typeof()
+    test_digest()
+    .return()
+  no_crypto:
+    skip(2, 'No crypto library available')
+    .return()
+  old_openssl:
+    skip(2, 'Too old openssl library, needs at least @TEMP_md_skip@')
+.end
+
 
-pir_output_is( << 'CODE', << 'OUTPUT', '@TEMP_md_name@ typeof' );
-.sub test :main
+.sub test_typeof
     $P0 = loadlib 'digest_group'
     .local pmc md
     md = new '@TEMP_md_name@'
     $S0 = typeof md
-    say $S0
+    is($S0, '@TEMP_md_name@', '@TEMP_md_name@ typeof')
 .end
-CODE
- at TEMP_md_name@
-OUTPUT
 
-pir_output_like( << 'CODE', << 'OUTPUT', '@TEMP_md_name@ digest' );
-.sub test :main
+.sub test_digest
     $P0 = loadlib 'digest_group'
     .local pmc md
     md = new '@TEMP_md_name@'
@@ -57,24 +59,21 @@
     $P0 = split '', $S0
     new $P1, 'FixedPMCArray'
     set $P1, 1
+    $S3 = ''
   L1:
     unless $P0 goto L2
     $S1 = shift $P0
     $I1 = ord $S1
     $P1[0] = $I1
     $S2 = sprintf '%02x', $P1
-    print $S2
+    $S3 .= $S2
     goto L1
   L2:
-    print "\n"
+    is($S3, '@TEMP_md_result@', '@TEMP_md_name@ digest')
 .end
-CODE
-/^@TEMP_md_result@$/
-OUTPUT
 
 # Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
+#   mode: pir
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/config/gen/makefiles.pm
==============================================================================
--- branches/orderedhash_revamp/config/gen/makefiles.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/makefiles.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -36,6 +36,8 @@
             conditioned_lines => 1,
         },
 
+        'ext/nqp-rx/Makefile' => { SOURCE => 'config/gen/makefiles/nqp-rx.in' },
+
         'compilers/ncigen/Makefile'  =>
             { SOURCE => 'compilers/ncigen/config/makefiles/ncigen.in' },
         'compilers/nqp/Makefile'     =>
@@ -48,6 +50,8 @@
             { SOURCE => 'config/gen/makefiles/tge.in' },
         'compilers/json/Makefile'    =>
             { SOURCE => 'config/gen/makefiles/json.in' },
+        'compilers/data_json/Makefile' =>
+            { SOURCE => 'config/gen/makefiles/data_json.in' },
         'compilers/pirc/Makefile'    =>
             { SOURCE => 'config/gen/makefiles/pirc.in' },
         'src/dynpmc/Makefile'        =>

Added: branches/orderedhash_revamp/config/gen/makefiles/data_json.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/config/gen/makefiles/data_json.in	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,60 @@
+# Copyright (C) 2006-2009, Parrot Foundation.
+# $Id$
+
+PERL     := @perl@
+RM_F     := @rm_f@
+PARROT   := ../../parrot at exe@
+
+TOOL_DIR := ../..
+PGE_DIR  := ../../compilers/pge
+TGE_DIR  := ../../compilers/tge
+
+# the default target
+all: data_json.pbc
+
+# This is a listing of all targets, that are meant to be called by users
+help:
+	@echo ""
+	@echo "Following targets are available for the user:"
+	@echo ""
+	@echo "  all:               data_json.pbc"
+	@echo "                     This is the default."
+	@echo "Testing:"
+	@echo "  test:              Run the test suite."
+	@echo "  testclean:         Clean up test results and temporary files."
+	@echo ""
+	@echo "Cleaning:"
+	@echo "  clean:             Basic cleaning up."
+	@echo ""
+	@echo "Misc:"
+	@echo "  help:              Print this help message."
+	@echo ""
+
+test: all
+	cd $(TOOL_DIR) && prove -r t/compilers/json
+
+testclean:
+	$(RM_F) "../../t/compilers/json/*.pir"
+
+data_json.pbc : data_json/grammar.pbc data_json/pge2pir.pbc data_json.pir
+	$(PARROT) --output=data_json.pbc data_json.pir
+
+data_json/grammar.pbc : data_json/grammar.pir
+	$(PARROT) --output=data_json/grammar.pbc data_json/grammar.pir
+
+data_json/grammar.pir : data_json/grammar.pg
+	$(PARROT) $(TOOL_DIR)/runtime/parrot/library/PGE/Perl6Grammar.pbc --output=data_json/grammar.pir data_json/grammar.pg
+
+data_json/pge2pir.pbc : data_json/pge2pir.pir
+	$(PARROT) --output=data_json/pge2pir.pbc data_json/pge2pir.pir
+
+data_json/pge2pir.pir : data_json/pge2pir.tg
+	$(PARROT) $(TGE_DIR)/tgc.pir --output=data_json/pge2pir.pir data_json/pge2pir.tg
+
+clean : testclean
+	$(RM_F) "data_json/*.pbc" "data_json/*.pir" data_json.pbc
+
+# Local variables:
+#   mode: makefile
+# End:
+# vim: ft=make:

Modified: branches/orderedhash_revamp/config/gen/makefiles/docs.in
==============================================================================
--- branches/orderedhash_revamp/config/gen/makefiles/docs.in	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/makefiles/docs.in	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,6 +5,7 @@
 PERL    := @perl@
 CHMOD   := @chmod@
 MKPATH  := @mkpath@
+TOUCH   := @touch@
 RM_F    := @rm_f@
 RM_RF   := @rm_rf@
 PERLDOC := @perldoc@
@@ -18,7 +19,7 @@
 #
 
 # The default target
-all: doc-prep packfile-c.pod $(POD)
+all: packfile-c.pod $(POD)
 
 # This is a listing of all targets, that are meant to be called by users
 # Most of them are proxied in the root makefile parrot/Makefile
@@ -33,15 +34,18 @@
 	@echo "  html-clean:        Remove the generated HTML documentation."
 	@echo ""
 
+$(POD): doc-prep
+
 doc-prep:
 	$(MKPATH) ops
+	$(TOUCH) doc-prep
 
 packfile-c.pod: ../src/packfile.c
 #IF(new_perldoc):	$(PERLDOC) -ud packfile-c.pod ../src/packfile.c
 #ELSE:	$(PERLDOC) -u ../src/packfile.c > packfile-c.pod
 
 clean:
-	$(RM_F) packfile-c.pod $(POD)
+	$(RM_F) packfile-c.pod $(POD) doc-prep
 
 html: all
 	$(PERL) -I../lib ../tools/docs/write_docs.pl --silent --version=$(VERSION)

Modified: branches/orderedhash_revamp/config/gen/makefiles/dynoplibs.in
==============================================================================
--- branches/orderedhash_revamp/config/gen/makefiles/dynoplibs.in	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/makefiles/dynoplibs.in	Sat Jan 23 01:49:53 2010	(r43541)
@@ -26,7 +26,11 @@
 #IF(cg_flag):  obscure_ops_cg$(LOAD_EXT) \
 #IF(cg_flag):  obscure_ops_cgp$(LOAD_EXT) \
   obscure_ops$(LOAD_EXT) \
-  obscure_ops_switch$(LOAD_EXT)
+  obscure_ops_switch$(LOAD_EXT) \
+#IF(cg_flag):  math_ops_cg$(LOAD_EXT) \
+#IF(cg_flag):  math_ops_cgp$(LOAD_EXT) \
+  math_ops$(LOAD_EXT) \
+  math_ops_switch$(LOAD_EXT)
 
 CLEANUPS := \
   "*.c" \
@@ -51,6 +55,7 @@
 
 obscure_ops$(LOAD_EXT): obscure_ops$(O)
 	$(LD) @ld_out at obscure_ops$(LOAD_EXT) obscure_ops$(O) $(LINKARGS)
+#IF(win32):	if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
 
 obscure_ops$(O): obscure_ops.c
 	$(CC) -c @cc_o_out at obscure_ops$(O) $(INCLUDES) $(CFLAGS) obscure_ops.c
@@ -60,6 +65,7 @@
 
 obscure_ops_switch$(LOAD_EXT): obscure_ops_switch$(O)
 	$(LD) @ld_out at obscure_ops_switch$(LOAD_EXT) obscure_ops_switch$(O) $(LINKARGS)
+#IF(win32):	if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
 
 obscure_ops_switch$(O): obscure_ops_switch.c
 	$(CC) -c @cc_o_out at obscure_ops_switch$(O) $(INCLUDES) $(CFLAGS) obscure_ops_switch.c
@@ -69,6 +75,7 @@
 
 obscure_ops_cg$(LOAD_EXT): obscure_ops_cg$(O)
 	$(LD) @ld_out at obscure_ops_cg$(LOAD_EXT) obscure_ops_cg$(O) $(LINKARGS)
+#IF(win32):	if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
 
 obscure_ops_cg$(O): obscure_ops_cg.c
 	$(CC) -c @cc_o_out at obscure_ops_cg$(O) $(INCLUDES) $(CFLAGS) obscure_ops_cg.c
@@ -78,6 +85,7 @@
 
 obscure_ops_cgp$(LOAD_EXT): obscure_ops_cgp$(O)
 	$(LD) @ld_out at obscure_ops_cgp$(LOAD_EXT) obscure_ops_cgp$(O) $(LINKARGS)
+#IF(win32):	if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
 
 obscure_ops_cgp$(O): obscure_ops_cgp.c
 	$(CC) -c @cc_o_out at obscure_ops_cgp$(O) $(INCLUDES) $(CFLAGS) obscure_ops_cgp.c
@@ -85,6 +93,46 @@
 obscure_ops_cgp.c: obscure.ops
 	$(OPS2C) CGP --dynamic obscure.ops
 
+math_ops$(LOAD_EXT): math_ops$(O)
+	$(LD) @ld_out at math_ops$(LOAD_EXT) math_ops$(O) $(LINKARGS)
+#IF(win32):	if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
+
+math_ops$(O): math_ops.c
+	$(CC) -c @cc_o_out at math_ops$(O) $(INCLUDES) $(CFLAGS) math_ops.c
+
+math_ops.c: math.ops
+	$(OPS2C) C --dynamic math.ops
+
+math_ops_switch$(LOAD_EXT): math_ops_switch$(O)
+	$(LD) @ld_out at math_ops_switch$(LOAD_EXT) math_ops_switch$(O) $(LINKARGS)
+#IF(win32):	if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
+
+math_ops_switch$(O): math_ops_switch.c
+	$(CC) -c @cc_o_out at math_ops_switch$(O) $(INCLUDES) $(CFLAGS) math_ops_switch.c
+
+math_ops_switch.c: math.ops
+	$(OPS2C) CSwitch --dynamic math.ops
+
+math_ops_cg$(LOAD_EXT): math_ops_cg$(O)
+	$(LD) @ld_out at math_ops_cg$(LOAD_EXT) math_ops_cg$(O) $(LINKARGS)
+#IF(win32):	if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
+
+math_ops_cg$(O): math_ops_cg.c
+	$(CC) -c @cc_o_out at math_ops_cg$(O) $(INCLUDES) $(CFLAGS) math_ops_cg.c
+
+math_ops_cg.c: math.ops
+	$(OPS2C) CGoto --dynamic math.ops
+
+math_ops_cgp$(LOAD_EXT): math_ops_cgp$(O)
+	$(LD) @ld_out at math_ops_cgp$(LOAD_EXT) math_ops_cgp$(O) $(LINKARGS)
+#IF(win32):	if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
+
+math_ops_cgp$(O): math_ops_cgp.c
+	$(CC) -c @cc_o_out at math_ops_cgp$(O) $(INCLUDES) $(CFLAGS) math_ops_cgp.c
+
+math_ops_cgp.c: math.ops
+	$(OPS2C) CGP --dynamic math.ops
+
 test : all
 	cd ../.. && $(PERL) -Ilib t/harness t/dynoplibs/*.t
 

Modified: branches/orderedhash_revamp/config/gen/makefiles/dynpmc.in
==============================================================================
--- branches/orderedhash_revamp/config/gen/makefiles/dynpmc.in	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/makefiles/dynpmc.in	Sat Jan 23 01:49:53 2010	(r43541)
@@ -20,7 +20,7 @@
 BUILD_TOOLS_DIR := $(BUILD_DIR)@slash at tools@slash at build
 BUILD_LIB_DIR   := $(BUILD_DIR)@slash at blib@slash at lib
 PMC2C           := $(PERL) $(BUILD_TOOLS_DIR)@slash at pmc2c.pl
-INCLUDES        := -I$(BUILD_DIR)@slash at include -I at build_dir@@slash at src@slash at pmc
+INCLUDES        := -I$(BUILD_DIR)@slash at include -I at build_dir@@slash at include@slash at pmc
 LINKARGS        := $(LDFLAGS) $(LD_LOAD_FLAGS) $(LIBPARROT) @icu_shared@ @libs@
 
 PMC2CD := $(PERL) $(BUILD_TOOLS_DIR)/pmc2c.pl --dump
@@ -29,8 +29,7 @@
 # add your dynamic pmcs here
 PMC_TARGETS := \
   dynlexpad$(LOAD_EXT) \
-  foo$(LOAD_EXT) \
-  pair$(LOAD_EXT) \
+  foo_group$(LOAD_EXT) \
   rotest$(LOAD_EXT) \
 #IF(has_gdbm):  gdbmhash$(LOAD_EXT) \
   rational$(LOAD_EXT) \
@@ -57,6 +56,14 @@
   sha256$(O) \
   sha512$(O)
 
+PMCS_FOO := \
+  foo.pmc \
+  foo2.pmc
+
+OBJS_FOO := \
+  foo$(O) \
+  foo2$(O)
+
 #IF(win32 and cc==gcc):LIB_GDBM := -llibgdbm
 #ELSIF(win32):LIB_GDBM := libgdbm.lib
 #ELSE:LIB_GDBM := -lgdbm
@@ -92,6 +99,7 @@
 
 dynlexpad$(LOAD_EXT): dynlexpad$(O)
 	$(LD) @ld_out at dynlexpad$(LOAD_EXT) dynlexpad$(O) $(LINKARGS)
+#IF(win32):	if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
 
 dynlexpad$(O): dynlexpad.c
 	$(CC) -c @cc_o_out at dynlexpad$(O) $(INCLUDES) $(CFLAGS) dynlexpad.c
@@ -102,8 +110,15 @@
 dynlexpad.dump: dynlexpad.pmc
 	$(PMC2CD) dynlexpad.pmc
 
-foo$(LOAD_EXT): foo$(O)
-	$(LD) @ld_out at foo$(LOAD_EXT) foo$(O) $(LINKARGS)
+foo_group$(LOAD_EXT): $(OBJS_FOO) lib-foo_group$(O)
+	$(LD) @ld_out at foo_group$(LOAD_EXT) lib-foo_group$(O) $(OBJS_FOO) $(LINKARGS)
+#IF(win32):	if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
+
+lib-foo_group$(O): foo_group.c
+	$(CC) -c @cc_o_out at lib-foo_group$(O) $(INCLUDES) $(CFLAGS) foo_group.c
+
+foo_group.c: $(OBJS_FOO)
+	$(PMC2C) --library foo_group --c $(PMCS_FOO)
 
 foo$(O): foo.c
 	$(CC) -c @cc_o_out at foo$(O) $(INCLUDES) $(CFLAGS) foo.c
@@ -114,20 +129,18 @@
 foo.dump: foo.pmc
 	$(PMC2CD) foo.pmc
 
-pair$(LOAD_EXT): pair$(O)
-	$(LD) @ld_out at pair$(LOAD_EXT) pair$(O) $(LINKARGS)
-
-pair$(O): pair.c
-	$(CC) -c @cc_o_out at pair$(O) $(INCLUDES) $(CFLAGS) pair.c
+foo2$(O): foo.c foo2.c
+	$(CC) -c @cc_o_out at foo2$(O) $(INCLUDES) $(CFLAGS) foo2.c
 
-pair.c: pair.dump
-	$(PMC2CC) pair.pmc
+foo2.c: foo2.dump foo.pmc
+	$(PMC2CC) foo2.pmc
 
-pair.dump: pair.pmc
-	$(PMC2CD) pair.pmc
+foo2.dump: foo2.pmc foo.dump
+	$(PMC2CD) foo2.pmc
 
 rotest$(LOAD_EXT): rotest$(O)
 	$(LD) @ld_out at rotest$(LOAD_EXT) rotest$(O) $(LINKARGS)
+#IF(win32):	if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
 
 rotest$(O): rotest.c
 	$(CC) -c @cc_o_out at rotest$(O) $(INCLUDES) $(CFLAGS) rotest.c
@@ -140,6 +153,7 @@
 
 gdbmhash$(LOAD_EXT): gdbmhash$(O)
 	$(LD) @ld_out at gdbmhash$(LOAD_EXT) gdbmhash$(O) $(LINKARGS) $(LIB_GDBM)
+#IF(win32):	if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
 
 gdbmhash$(O): gdbmhash.c
 	$(CC) -c @cc_o_out at gdbmhash$(O) $(INCLUDES) $(CFLAGS) gdbmhash.c
@@ -152,6 +166,7 @@
 
 rational$(LOAD_EXT): rational$(O)
 	$(LD) @ld_out at rational$(LOAD_EXT) rational$(O) $(LINKARGS)
+#IF(win32):	if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
 
 rational$(O): rational.c
 	$(CC) -c @cc_o_out at rational$(O) $(INCLUDES) $(CFLAGS) rational.c
@@ -164,6 +179,7 @@
 
 digest_group$(LOAD_EXT): $(OBJS_DIGEST) lib-digest_group$(O)
 	$(LD) @ld_out at digest_group$(LOAD_EXT) lib-digest_group$(O) $(OBJS_DIGEST) $(LINKARGS) $(LIB_CRYPTO)
+#IF(win32):	if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
 
 lib-digest_group$(O): digest_group.c
 	$(CC) -c @cc_o_out at lib-digest_group$(O) $(INCLUDES) $(CFLAGS) digest_group.c
@@ -245,6 +261,7 @@
 
 subproxy$(LOAD_EXT): subproxy$(O)
 	$(LD) @ld_out at subproxy$(LOAD_EXT) subproxy$(O) $(LINKARGS)
+#IF(win32):	if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
 
 subproxy$(O): subproxy.c
 	$(CC) -c @cc_o_out at subproxy$(O) $(INCLUDES) $(CFLAGS) subproxy.c

Modified: branches/orderedhash_revamp/config/gen/makefiles/dynpmc_pl.in
==============================================================================
--- branches/orderedhash_revamp/config/gen/makefiles/dynpmc_pl.in	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/makefiles/dynpmc_pl.in	Sat Jan 23 01:49:53 2010	(r43541)
@@ -56,8 +56,6 @@
         $dynpmc_include = "-I" . $PATHQUOTE . $dynpmc_include . $PATHQUOTE . " ";
     }
 
-
-    # TT #288 - need long term solution for passing in include paths
     return
         "$CC " .
         '@cc_o_out@' . $target . " " .

Added: branches/orderedhash_revamp/config/gen/makefiles/nqp-rx.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/config/gen/makefiles/nqp-rx.in	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,63 @@
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+# Setup some commands
+PERL     := @perl@
+CP       := @cp@
+RM_F     := @rm_f@
+PARROT   := ../../parrot at exe@
+
+PARROT_LIBRARY := @build_dir@/runtime/parrot/library
+
+NQP_LIB_PBCS := Regex.pbc HLL.pbc P6Regex.pbc nqp-rx.pbc
+
+all: $(NQP_LIB_PBCS)
+	$(CP) $(NQP_LIB_PBCS) $(PARROT_LIBRARY)
+
+Regex.pbc: src/stage0/Regex-s0.pir
+	$(PARROT) $(PARROT_ARGS) -o Regex.pbc src/stage0/Regex-s0.pir
+
+HLL.pbc: src/stage0/HLL-s0.pir
+	$(PARROT) $(PARROT_ARGS) -o HLL.pbc src/stage0/HLL-s0.pir
+
+P6Regex.pbc: src/stage0/P6Regex-s0.pir
+	$(PARROT) $(PARROT_ARGS) -o P6Regex.pbc src/stage0/P6Regex-s0.pir
+
+nqp-rx.pbc: src/stage0/NQP-s0.pir
+	$(PARROT) $(PARROT_ARGS) -o nqp-rx.pbc src/stage0/NQP-s0.pir
+
+# This is a listing of all targets, that are meant to be called by users
+help:
+	@echo ""
+	@echo "Following targets are available for the user:"
+	@echo ""
+	@echo "  all:               nqp.pbc"
+	@echo "                     This is the default."
+	@echo ""
+	@echo "Cleaning:"
+	@echo "  clean:             Basic cleaning up."
+	@echo "  realclean:         Removes also files generated by 'Configure.pl'"
+	@echo "  distclean:         Removes also anything built, in theory"
+	@echo ""
+	@echo "Misc:"
+	@echo "  help:              Print this help message."
+	@echo ""
+
+# this target has nothing to do
+testclean:
+
+CLEANUPS := \
+  $(NQP_LIB_PBCS)
+
+clean:
+	$(RM_F) $(CLEANUPS)
+
+realclean: clean
+	$(RM_F) Makefile
+
+distclean: realclean
+
+# Local variables:
+#   mode: makefile
+# End:
+# vim: ft=make:

Modified: branches/orderedhash_revamp/config/gen/makefiles/pirc.in
==============================================================================
--- branches/orderedhash_revamp/config/gen/makefiles/pirc.in	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/makefiles/pirc.in	Sat Jan 23 01:49:53 2010	(r43541)
@@ -14,7 +14,7 @@
 CC            := @cc@
 O             := @o@
 EXE           := @exe@
-CC_INC        := -I../../include
+CC_INC        := -I../../include -I../../include/pmc
 C_LIBS        := @libs@
 CC_SHARED     := @cc_shared@
 CFLAGS        := $(CC_INC) @ccflags@ @cc_debug@ @ccwarn@ @cc_hasjit@ @cg_flag@ @gc_flag@ $(CC_SHARED)
@@ -23,6 +23,9 @@
 LINKFLAGS     := @linkflags@ @link_debug@ @ld_debug@
 LD            := @ld@
 LDFLAGS       := @ldflags@ @ld_debug@
+TOUCH		  := @touch@
+LEX			  := @lex@
+YACC	      := @yacc@
 
 SOURCES       := \
   src/main.c \
@@ -69,6 +72,18 @@
 	$(LINK) @ld_out@$@ \
 	    $(OBJS) \
 	    @rpath_blib@ @libparrot_linkflags@ $(C_LIBS) $(LINKFLAGS) $(LINK_DYNAMIC)
+#IF(win32):	if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1
+
+src/pir.y.flag src/pirparser.c src/pirparser.h : src/pir.y
+	cd src && $(YACC) pir.y -d -o pirparser.c
+	#$(PERL) $(BUILD_TOOLS_DIR)/fixup_gen_file.pl -noheaderizer src/pirparser.c src/pir.y
+	#$(PERL) $(BUILD_TOOLS_DIR)/fixup_gen_file.pl -noheaderizer src/pirparser.h src/pir.y
+	$(TOUCH) src/pir.y.flag src/pirparser.c src/pirparser.h
+
+src/pir.l.flag src/pirlexer.c : src/pir.l
+	cd src && $(LEX) -opirlexer.c pir.l
+	$(TOUCH) src/pir.l.flag src/pirlexer.c
+
 
 src/pirparser$(O): src/pirparser.c src/pirparser.h
 src/pirlexer$(O): src/pirlexer.c src/pirlexer.h
@@ -79,7 +94,7 @@
 src/hdocprep$(O): src/hdocprep.c src/hdocprep.l
 src/pirmacro$(O): src/pirmacro.c src/pirmacro.h
 src/pirregalloc$(O): src/pirregalloc.c src/pirregalloc.h
-src/bcgen$(O): src/bcgen.c src/bcgen.h ../../src/pmc/pmc_sub.h
+src/bcgen$(O): src/bcgen.c src/bcgen.h
 src/pirpcc$(O): src/pirpcc.c src/pirpcc.h
 src/pirerr$(O): src/pirerr.c src/pirerr.h
 src/pircapi$(O): src/pircapi.c src/pircapi.h

Modified: branches/orderedhash_revamp/config/gen/makefiles/root.in
==============================================================================
--- branches/orderedhash_revamp/config/gen/makefiles/root.in	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/makefiles/root.in	Sat Jan 23 01:49:53 2010	(r43541)
@@ -57,11 +57,14 @@
 IMCC_DIR        := compilers/imcc
 
 # directory for the (experimental) PIR code compiler
-PIRC_DIR        := compilers/pirc/src
+PIRC_DIR        := compilers/pirc
 
 # directory for header files
 INC_DIR         := @inc@
 
+# directory for PMC generated header files
+PMC_INC_DIR     := @pmc_inc@
+
 # directory for the IO subsystem
 IO_DIR          := src/io
 
@@ -103,7 +106,7 @@
 CC_INC           := @cc_inc@
 C_LIBS           := @libs@
 CC_SHARED        := @cc_shared@
-CFLAGS           := $(CC_INC) @ccflags@ @cc_debug@ @ccwarn@ @cc_hasjit@ @cg_flag@ @gc_flag@ $(CC_SHARED)
+CFLAGS           := $(CC_INC) @ccflags@ @cc_build_call_frames@ @cc_debug@ @ccwarn@ @cg_flag@ @gc_flag@ @clock_best@ $(CC_SHARED)
 LINK_DYNAMIC     := @link_dynamic@
 LINK             := @link@
 LINKFLAGS        := @linkflags@ @link_debug@ @ld_debug@
@@ -111,7 +114,7 @@
 LDFLAGS          := @ldflags@ @ld_debug@
 RECONFIGURE      := $(PERL) tools/dev/reconfigure.pl
 INNO_SETUP       := iscc
-JIT_BUILD_TOOL   := $(BUILD_TOOLS_DIR)/jit2c.pl
+TEMPDIR          := @tempdir@
 #IF(darwin):export MACOSX_DEPLOYMENT_TARGET := @osx_version@
 
 ###############################################################################
@@ -146,6 +149,7 @@
 GEN_MAKEFILES := \
     Makefile \
     docs/Makefile \
+    compilers/data_json/Makefile \
     compilers/json/Makefile \
     compilers/ncigen/Makefile \
     compilers/nqp/Makefile \
@@ -154,7 +158,9 @@
     compilers/tge/Makefile \
     editor/Makefile \
     ext/Makefile \
-    src/dynoplibs/Makefile
+    ext/nqp-rx/Makefile \
+    src/dynoplibs/Makefile \
+    src/dynpmc/Makefile
 
 GEN_CONFIGS := \
     $(INC_DIR)/config.h \
@@ -245,12 +251,9 @@
     $(SRC_DIR)/core_ops.c \
     $(SRC_DIR)/nci.c \
     $(SRC_DIR)/core_ops_switch.c \
-    $(SRC_DIR)/jit_cpu.c \
     $(SRC_DIR)/parrot_config.c \
     $(SRC_DIR)/null_config.c \
     $(SRC_DIR)/install_config.c \
-    $(SRC_DIR)/exec_cpu.c \
-    $(SRC_DIR)/jit_defs.c \
     $(SRC_DIR)/extend_vtable.c
 
 GEN_MODULES := \
@@ -260,11 +263,13 @@
     $(LIBRARY_DIR)/CGI/QueryHash.pbc \
     $(LIBRARY_DIR)/Crow.pbc \
     $(LIBRARY_DIR)/config.pbc \
+    $(LIBRARY_DIR)/Configure/genfile.pbc \
     $(LIBRARY_DIR)/Config/JSON.pbc \
     $(LIBRARY_DIR)/Data/Dumper/Base.pbc \
     $(LIBRARY_DIR)/Data/Dumper/Default.pbc \
     $(LIBRARY_DIR)/Data/Dumper.pbc \
     $(LIBRARY_DIR)/Digest/MD5.pbc \
+    $(LIBRARY_DIR)/distutils.pbc \
     $(LIBRARY_DIR)/dumper.pbc \
     $(LIBRARY_DIR)/yaml_dumper.pbc \
     $(LIBRARY_DIR)/Getopt/Obj.pbc \
@@ -315,20 +320,15 @@
     $(LIBRARY_DIR)/YAML/Dumper/Base.pbc \
     $(LIBRARY_DIR)/YAML/Dumper/Default.pbc \
     $(LIBRARY_DIR)/YAML/Dumper.pbc \
-    $(LIBRARY_DIR)/YAML/Parser/Syck.pbc \
     $(LIBRARY_DIR)/STM.pbc \
     $(LIBRARY_DIR)/libpcre.pbc \
-    $(LIBRARY_DIR)/Data/Replace.pbc \
     $(LIBRARY_DIR)/postgres.pbc
 
-# the dependencies of $(SRC_DIR)/jit_emit.h are done explicitly
-# including this file in GEN_HEADERS causes unnecessary recompile of all
 FLUID_FILES_1 := \
     $(GEN_OPSFILES) \
     $(GEN_HEADERS) \
     $(GEN_SOURCES) \
     $(GEN_MODULES) \
-    $(SRC_DIR)/jit_emit.h
 
 FLUID_FILES_2 := \
     $(GEN_LIBRARY) \
@@ -342,19 +342,6 @@
 ###############################################################################
 
 # these are private to the IMCC subsystem
-IMCC_H_FILES := \
-    $(IMCC_DIR)/imc.h \
-    $(IMCC_DIR)/cfg.h \
-    $(IMCC_DIR)/instructions.h \
-    $(IMCC_DIR)/debug.h \
-    $(IMCC_DIR)/sets.h \
-    $(IMCC_DIR)/unit.h \
-    $(IMCC_DIR)/symreg.h \
-    $(IMCC_DIR)/pbc.h \
-    $(IMCC_DIR)/optimizer.h \
-    $(IMCC_DIR)/parser.h \
-    $(IMCC_DIR)/imcparser.h
-
 IMCC_O_FILES := \
     $(IMCC_DIR)/imcparser$(O) \
     $(IMCC_DIR)/imclexer$(O) \
@@ -373,16 +360,75 @@
 
 # these are private to the PIRC subsystem
 PIRC_O_FILES := \
-    $(PIRC_DIR)/bcgen$(O) \
-    $(PIRC_DIR)/pircapi$(O) \
-    $(PIRC_DIR)/pirerr$(O) \
-    $(PIRC_DIR)/pirop$(O)
+    $(PIRC_DIR)/src/bcgen$(O) \
+    $(PIRC_DIR)/src/pircapi$(O) \
+    $(PIRC_DIR)/src/pirerr$(O) \
+    $(PIRC_DIR)/src/pirop$(O)
+
+# parrot.h and all the includes it causes to be included
+PARROT_H_HEADERS := \
+        $(INC_DIR)/parrot.h \
+        $(INC_DIR)/config.h \
+        $(INC_DIR)/settings.h \
+        $(INC_DIR)/enums.h \
+        $(INC_DIR)/platform.h \
+        $(INC_DIR)/platform_interface.h \
+        $(INC_DIR)/global_setup.h \
+        $(INC_DIR)/caches.h \
+        $(INC_DIR)/interpreter.h \
+        $(INC_DIR)/datatypes.h \
+        $(INC_DIR)/encoding.h \
+        $(INC_DIR)/charset.h \
+        $(INC_DIR)/string.h \
+        $(INC_DIR)/string_primitives.h \
+        $(INC_DIR)/hash.h \
+        $(INC_DIR)/list.h \
+        $(INC_DIR)/pmc_freeze.h \
+        $(INC_DIR)/vtable.h \
+        $(INC_DIR)/context.h \
+        $(INC_DIR)/exceptions.h \
+        $(INC_DIR)/warnings.h \
+        $(INC_DIR)/memory.h \
+        $(INC_DIR)/packfile.h \
+        $(INC_DIR)/io.h \
+        $(INC_DIR)/op.h \
+        $(INC_DIR)/pmc.h \
+        $(INC_DIR)/events.h \
+        $(INC_DIR)/gc_api.h \
+        $(INC_DIR)/string_funcs.h \
+        $(INC_DIR)/misc.h \
+        $(INC_DIR)/sub.h \
+        $(INC_DIR)/call.h \
+        $(INC_DIR)/key.h \
+        $(INC_DIR)/exit.h \
+        $(INC_DIR)/nci.h \
+        $(INC_DIR)/thread.h \
+        $(INC_DIR)/scheduler.h \
+        $(INC_DIR)/tsq.h \
+        $(INC_DIR)/longopt.h \
+        $(INC_DIR)/oo.h \
+        $(INC_DIR)/vtables.h \
+        $(INC_DIR)/multidispatch.h \
+        $(INC_DIR)/library.h \
+        $(INC_DIR)/global.h \
+        $(INC_DIR)/stat.h \
+        $(INC_DIR)/hll.h \
+        $(INC_DIR)/pbcversion.h \
+        $(INC_DIR)/pobj.h \
+        $(INC_DIR)/platform_limits.h \
+        $(INC_DIR)/has_header.h \
+        $(INC_DIR)/oplib.h \
+        $(INC_DIR)/feature.h \
+        $(INC_DIR)/debugger.h \
+        $(INC_DIR)/core_types.h \
+        $(INC_DIR)/core_pmcs.h \
+        $(INC_DIR)/compiler.h \
+        $(INC_DIR)/cclass.h \
+        $(PMC_INC_DIR)/pmc/pmc_callcontext.h
 
 # generated list of header files
 GENERAL_H_FILES   := $(NONGEN_HEADERS) $(GEN_HEADERS) @TEMP_cg_h@
 
-ALL_H_FILES       := $(GENERAL_H_FILES)
-
 CHARSET_O_FILES   := @TEMP_charset_o@
 CLASS_PMC_FILES   := @TEMP_pmc_classes_pmc@
 CLASS_O_FILES     := @TEMP_pmc_classes_o@
@@ -424,10 +470,7 @@
     $(SRC_DIR)/extend$(O) \
     $(SRC_DIR)/extend_vtable$(O) \
     $(SRC_DIR)/gc/alloc_memory$(O) \
-    $(SRC_DIR)/gc/alloc_register$(O) \
     $(SRC_DIR)/gc/api$(O) \
-    $(SRC_DIR)/gc/generational_ms$(O) \
-    $(SRC_DIR)/gc/incremental_ms$(O) \
     $(SRC_DIR)/gc/gc_ms$(O) \
     $(SRC_DIR)/gc/gc_inf$(O) \
     $(SRC_DIR)/gc/mark_sweep$(O) \
@@ -437,31 +480,33 @@
     $(SRC_DIR)/hash$(O) \
     $(SRC_DIR)/hll$(O) \
     $(SRC_DIR)/call/pcc$(O)  \
+    $(SRC_DIR)/call/args$(O)  \
     $(SRC_DIR)/interp/inter_cb$(O)  \
     $(SRC_DIR)/interp/inter_create$(O)  \
     $(SRC_DIR)/interp/inter_misc$(O)  \
     $(SRC_DIR)/call/ops$(O)  \
+    $(SRC_DIR)/call/context$(O) \
+    $(SRC_DIR)/call/context_accessors$(O) \
     $(SRC_DIR)/key$(O) \
     $(SRC_DIR)/library$(O) \
     $(SRC_DIR)/list$(O) \
     $(SRC_DIR)/longopt$(O) \
     $(SRC_DIR)/misc$(O) \
     $(SRC_DIR)/multidispatch$(O) \
+    $(SRC_DIR)/frame_builder$(O) \
     $(SRC_DIR)/nci$(O) \
     $(SRC_DIR)/oo$(O) \
     $(SRC_DIR)/packfile$(O) \
     $(SRC_DIR)/packout$(O) \
-    $(SRC_DIR)/pic_jit$(O) \
-    $(SRC_DIR)/pic$(O) \
     $(SRC_DIR)/platform$(O) \
     $(SRC_DIR)/pmc_freeze$(O) \
     $(SRC_DIR)/pmc$(O) \
     $(SRC_DIR)/runcore/main$(O)  \
     $(SRC_DIR)/runcore/cores$(O) \
+    $(SRC_DIR)/runcore/profiling$(O) \
     $(SRC_DIR)/scheduler$(O) \
     $(SRC_DIR)/spf_render$(O) \
     $(SRC_DIR)/spf_vtable$(O) \
-    $(SRC_DIR)/stacks$(O) \
     $(SRC_DIR)/string/primitives$(O) \
     $(SRC_DIR)/sub$(O) \
     $(SRC_DIR)/thread$(O) \
@@ -473,11 +518,8 @@
     \
     $(PF_DIR)/pf_items$(O) \
     \
-    @asmfun_o@ \
     @TEMP_cg_o@ \
-    @TEMP_exec_o@ \
     @TEMP_atomic_o@ \
-    @TEMP_jit_o@ \
     @TEMP_gc_o@ \
 #IF(platform_asm):    $(SRC_DIR)/platform_asm$(O) \
 
@@ -502,22 +544,22 @@
 MINIPARROT          := $(CUR_DIR)/miniparrot$(EXE)
 DIS                 := $(CUR_DIR)/pbc_disassemble$(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)
 PIRC                := $(CUR_DIR)/pirc$(EXE)
+NQP                 := $(CUR_DIR)/parrot-nqp$(EXE)
 
 # Installable executables
 INSTALLABLEPARROT   := $(CUR_DIR)/installable_parrot$(EXE)
 INSTALLABLEDIS      := $(CUR_DIR)/installable_pbc_disassemble$(EXE)
 INSTALLABLEPDUMP    := $(CUR_DIR)/installable_pbc_dump$(EXE)
-INSTALLABLEPINFO    := $(CUR_DIR)/installable_pbc_info$(EXE)
 INSTALLABLEPBCMERGE := $(CUR_DIR)/installable_pbc_merge$(EXE)
 INSTALLABLEPBCTOEXE := $(CUR_DIR)/installable_pbc_to_exe$(EXE)
 INSTALLABLEPDB      := $(CUR_DIR)/installable_parrot_debugger$(EXE)
 INSTALLABLECONFIG   := $(CUR_DIR)/installable_parrot_config$(EXE)
+INSTALLABLENQP      := $(CUR_DIR)/installable_parrot-nqp$(EXE)
 
 # Libraries
 LIBPARROT_STATIC    := @blib_dir@/@libparrot_static@
@@ -588,17 +630,9 @@
 ###############################################################################
 
 all : \
-    flags_dummy \
-    PARROT_LIBS \
-    $(PARROT) \
-    runtime/parrot/include/parrotlib.pbc \
-    runtime/parrot/include/config.fpmc \
+    corevm \
     docs \
-    $(LIBNCI_TEST_SO) \
 #IF(has_glut):    $(LIBGLUTCB_SO) \
-    $(GEN_LIBRARY) \
-    dynpmc \
-    dynoplibs \
     compilers \
     $(DIS) \
     $(PARROT_CONFIG) \
@@ -606,7 +640,18 @@
     $(PBCMERGE) \
     $(PDB) \
     $(PDUMP) \
-    $(PINFO) \
+    $(NQP)
+
+corevm : \
+    flags_dummy \
+    PARROT_LIBS \
+    $(PARROT) \
+    runtime/parrot/include/parrotlib.pbc \
+    runtime/parrot/include/config.fpmc \
+    $(LIBNCI_TEST_SO) \
+    $(GEN_LIBRARY) \
+    dynpmc \
+    dynoplibs \
 
 $(GEN_LIBRARY) : $(PARROT)
 
@@ -623,6 +668,7 @@
     $(SRC_DIR)/global_setup.str \
     $(SRC_DIR)/hll.str \
     $(SRC_DIR)/call/pcc.str \
+    $(SRC_DIR)/call/args.str \
     $(SRC_DIR)/interp/inter_cb.str \
     $(SRC_DIR)/interp/inter_create.str \
     $(SRC_DIR)/interp/inter_misc.str \
@@ -630,17 +676,20 @@
     $(SRC_DIR)/key.str \
     $(SRC_DIR)/library.str \
     $(SRC_DIR)/multidispatch.str \
+    $(SRC_DIR)/frame_builder.str \
     $(SRC_DIR)/nci.str \
     $(SRC_DIR)/packfile.str \
     $(SRC_DIR)/pmc.str \
     $(SRC_DIR)/pmc_freeze.str \
     $(SRC_DIR)/oo.str \
+    $(SRC_DIR)/runcore/cores.str \
+    $(SRC_DIR)/runcore/main.str \
+    $(SRC_DIR)/runcore/profiling.str \
     $(SRC_DIR)/scheduler.str \
     $(SRC_DIR)/spf_render.str \
     $(SRC_DIR)/spf_vtable.str \
     $(SRC_DIR)/string/api.str \
     $(SRC_DIR)/sub.str \
-    $(SRC_DIR)/stacks.str \
     \
     $(CLASS_STR_FILES)
 
@@ -677,13 +726,11 @@
 	@echo "  world:             'all' and 'parrot_utils'."
 	@echo "  installable:       same as 'world', but targets for installation"
 	@echo ""
-	@echo "  parrot_utils:      $(PDUMP), $(DIS), $(PINFO), $(PDB), $(PBCMERGE) and $(PBC_TO_EXE) $(PARROT_CONFIG)"
+	@echo "  parrot_utils:      $(PDUMP), $(DIS), $(PDB), $(PBCMERGE) and $(PBC_TO_EXE) $(PARROT_CONFIG)"
 	@echo " $(PDUMP):"
 	@echo "                     Parrot Dumper"
 	@echo " $(DIS):"
 	@echo "                     Parrot Disassembler"
-	@echo " $(PINFO):"
-	@echo "                     Information about Parrot Byte Code"
 	@echo " $(PDB):"
 	@echo "                     Parrot Debugger"
 	@echo " $(PBCMERGE):"
@@ -694,8 +741,11 @@
 	@echo "                     Provide Parrot configuration information"
 	@echo ""
 	@echo "Installation:"
-	@echo "  install:           Install under '$(PREFIX)' on Unix systems"
-	@echo "  install-dev:       Same as 'install' but also install support for development."
+	@echo "  install:           Install under '$(PREFIX)' on Unix systems."
+	@echo "  install-dev:       Same as 'install'."
+	@echo "  install-bin:       Install only files needed for Parrot runtime."
+	@echo "  install-dev-only:  Install only files needed for Parrot development."
+	@echo "  install-doc:       Install documentation files & examples."
 	@echo ""
 	@echo "Documentation:"
 	@echo "  help:              Print this help message."
@@ -781,9 +831,9 @@
 
 world : all parrot_utils
 
-parrot_utils : $(PDUMP) $(DIS) $(PINFO) $(PDB) $(PBCMERGE) $(PBC_TO_EXE) $(PARROT_CONFIG)
+parrot_utils : $(PDUMP) $(DIS) $(PDB) $(PBCMERGE) $(PBC_TO_EXE) $(PARROT_CONFIG)
 
-installable: all $(INSTALLABLEPARROT) $(INSTALLABLEPDUMP) $(INSTALLABLEDIS) $(INSTALLABLEPINFO) $(INSTALLABLEPDB) $(INSTALLABLEPBCMERGE) $(INSTALLABLEPBCTOEXE) $(INSTALLABLECONFIG)
+installable: all $(INSTALLABLEPARROT) $(INSTALLABLEPDUMP) $(INSTALLABLEDIS) $(INSTALLABLEPDB) $(INSTALLABLEPBCMERGE) $(INSTALLABLEPBCTOEXE) $(INSTALLABLECONFIG) $(INSTALLABLENQP)
 
 
 flags_dummy :
@@ -794,7 +844,6 @@
 	$(PARROT) -o $@ runtime/parrot/library/parrotlib.pir
 
 runtime/parrot/include/config.fpmc : myconfig config_lib.pasm $(MINIPARROT)
-	@echo Invoking Parrot to generate runtime/parrot/include/config.fpmc --cross your fingers
 	$(MINIPARROT) config_lib.pasm > $@
 
 $(PARROT) : $(SRC_DIR)/main$(O) $(GEN_HEADERS) $(LIBPARROT) CFLAGS \
@@ -820,6 +869,10 @@
 	$(CP) compilers/pirc/pirc$(EXE) $(PIRC)
 	$(CHMOD) 0755 $(PIRC)
 
+$(NQP) : $(PBC_TO_EXE) compilers.dummy
+	$(CP) runtime/parrot/library/nqp-rx.pbc parrot-nqp.pbc
+	$(PBC_TO_EXE) parrot-nqp.pbc
+
 $(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) \
@@ -834,9 +887,7 @@
     @rpath_lib@ $(ALL_PARROT_LIBS) $(LINKFLAGS)
 #IF(win32):	if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1
 
-$(INC_DIR)/parrot.h : $(INC_DIR)/pbcversion.h $(INC_DIR)/vtable.h
-
-$(INC_DIR)/extend.h : $(INC_DIR)/extend_vtable.h
+$(INC_DIR)/context.h : $(PMC_INC_DIR)/pmc/pmc_callcontext.h
 
 $(INC_DIR)/pbcversion.h :
 	$(PERL) $(BUILD_TOOLS_DIR)/pbcversion_h.pl > $(INC_DIR)/pbcversion.h
@@ -859,27 +910,28 @@
 	@echo "Invoking Parrot to generate install_config.fpmc"
 	$(PARROT) config_lib.pasm --install > $@
 
-$(SRC_DIR)/parrot_config$(O) : $(SRC_DIR)/parrot_config.c
+$(SRC_DIR)/parrot_config$(O) : $(PARROT_H_HEADERS)
 
-$(SRC_DIR)/install_config$(O) : $(SRC_DIR)/install_config.c
+$(SRC_DIR)/install_config$(O) : $(PARROT_H_HEADERS)
 
-$(SRC_DIR)/null_config$(O) : $(INC_DIR)/parrot.h $(SRC_DIR)/null_config.c
+$(SRC_DIR)/null_config$(O) : $(PARROT_H_HEADERS)
 
-$(SRC_DIR)/oo$(O) : $(INC_DIR)/parrot.h $(SRC_DIR)/pmc/class.c $(INC_DIR)/pbcversion.h
+$(SRC_DIR)/oo$(O) : $(PARROT_H_HEADERS) $(PMC_INC_DIR)/pmc/pmc_class.h $(PMC_INC_DIR)/pmc/pmc_object.h $(SRC_DIR)/oo.str $(INC_DIR)/oo_private.h
 
-$(SRC_DIR)/scheduler$(O) : $(INC_DIR)/parrot.h \
-                           $(SRC_DIR)/scheduler.str   \
-                           $(SRC_DIR)/pmc/scheduler.c \
-                           $(SRC_DIR)/pmc/task.c      \
-                           $(SRC_DIR)/pmc/timer.c     \
-                           $(INC_DIR)/pbcversion.h
-
-$(IO_DIR)/core$(O) : $(INC_DIR)/parrot.h $(SRC_DIR)/pmc/socket.c
-$(IO_DIR)/socket_api$(O) : $(INC_DIR)/parrot.h $(SRC_DIR)/pmc/socket.c
-$(IO_DIR)/socket_unix$(O) : $(INC_DIR)/parrot.h $(INC_DIR)/pbcversion.h   \
-                            $(SRC_DIR)/pmc/socket.c
-$(IO_DIR)/socket_win32$(O) : $(INC_DIR)/parrot.h $(INC_DIR)/pbcversion.h   \
-                            $(SRC_DIR)/pmc/socket.c
+$(SRC_DIR)/scheduler$(O) : $(PARROT_H_HEADERS) $(SRC_DIR)/scheduler.str \
+        $(PMC_INC_DIR)/pmc/pmc_scheduler.h $(PMC_INC_DIR)/pmc/pmc_task.h \
+        $(PMC_INC_DIR)/pmc/pmc_timer.h \
+        $(INC_DIR)/scheduler_private.h
+
+$(IO_DIR)/core$(O) : $(PARROT_H_HEADERS) $(IO_DIR)/io_private.h
+
+$(IO_DIR)/socket_api$(O) : $(PARROT_H_HEADERS) $(IO_DIR)/io_private.h $(IO_DIR)/api.str $(PMC_INC_DIR)/pmc/pmc_socket.h
+
+$(IO_DIR)/socket_unix$(O) : $(PARROT_H_HEADERS) $(PMC_INC_DIR)/pmc/pmc_socket.h $(IO_DIR)/io_private.h
+
+$(IO_DIR)/socket_win32$(O) : $(PARROT_H_HEADERS) \
+        $(IO_DIR)/io_private.h \
+        $(PMC_INC_DIR)/pmc/pmc_socket.h
 
 lib_deps_object : $(O_FILES)
 	$(PERL) tools/dev/lib_deps.pl object $(O_FILES)
@@ -918,14 +970,28 @@
 	$(PARROT) -o parrot_config.pbc tools/util/parrot-config.pir
 	$(PBC_TO_EXE) parrot_config.pbc --install
 
-$(INSTALLABLEPBCTOEXE) : $(PBC_TO_EXE)
+$(INSTALLABLEPBCTOEXE) : $(PBC_TO_EXE) $(SRC_DIR)/install_config$(O)
 	$(PBC_TO_EXE) pbc_to_exe.pbc --install
 
+$(INSTALLABLENQP) : runtime/parrot/library/nqp-rx.pbc $(SRC_DIR)/install_config$(O) $(PBC_TO_EXE)
+	$(CP) runtime/parrot/library/nqp-rx.pbc parrot-nqp.pbc
+	$(PBC_TO_EXE) parrot-nqp.pbc --install
+
 #
 # Parrot Debugger
 #
 
-$(SRC_DIR)/parrot_debugger$(O) : $(GENERAL_H_FILES)
+$(SRC_DIR)/parrot_debugger$(O) : $(INC_DIR)/embed.h \
+        $(INC_DIR)/runcore_api.h \
+        compilers/imcc/imc.h $(PARROT_H_HEADERS) compilers/imcc/parser.h \
+        compilers/imcc/cfg.h \
+        compilers/imcc/debug.h \
+        compilers/imcc/imcparser.h \
+        compilers/imcc/instructions.h \
+        compilers/imcc/sets.h \
+        compilers/imcc/symreg.h \
+        compilers/imcc/unit.h \
+        $(INC_DIR)/oplib/ops.h
 
 $(PDB) : $(SRC_DIR)/parrot_debugger$(O) $(SRC_DIR)/parrot_config$(O) $(LIBPARROT)
 	$(LINK) @ld_out@$@ \
@@ -945,7 +1011,7 @@
 # Parrot Disassembler
 #
 
-$(SRC_DIR)/pbc_disassemble$(O) : $(GENERAL_H_FILES)
+$(SRC_DIR)/pbc_disassemble$(O) : $(INC_DIR)/embed.h $(PARROT_H_HEADERS)
 
 $(DIS) : $(SRC_DIR)/pbc_disassemble$(O) $(LIBPARROT)
 	$(LINK) @ld_out@$@ \
@@ -953,7 +1019,8 @@
     @rpath_blib@ $(ALL_PARROT_LIBS) $(LINKFLAGS)
 #IF(win32):	if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1
 
-$(INSTALLABLEDIS) : $(SRC_DIR)/pbc_disassemble$(O) $(LIBPARROT)
+$(INSTALLABLEDIS) : $(SRC_DIR)/pbc_disassemble$(O) \
+	$(SRC_DIR)/install_config$(O) $(LIBPARROT)
 	$(LINK) @ld_out@$@ \
     $(SRC_DIR)/pbc_disassemble$(O) \
     @rpath_lib@ $(ALL_PARROT_LIBS) $(LINKFLAGS)
@@ -962,7 +1029,7 @@
 #
 # Parrot Dump
 #
-$(SRC_DIR)/packdump$(O) : $(INC_DIR)/parrot.h $(SRC_DIR)/pmc/pmc_sub.h $(SRC_DIR)/pmc/pmc_key.h
+$(SRC_DIR)/packdump$(O) : $(PARROT_H_HEADERS) $(PMC_INC_DIR)/pmc/pmc_sub.h $(PMC_INC_DIR)/pmc/pmc_key.h
 
 $(PDUMP) : $(SRC_DIR)/pbc_dump$(O) $(SRC_DIR)/packdump$(O) $(LIBPARROT)
 	$(LINK) @ld_out@$@ \
@@ -970,9 +1037,11 @@
     $(SRC_DIR)/packdump$(O) @rpath_blib@ $(ALL_PARROT_LIBS) $(LINKFLAGS)
 #IF(win32):	if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1
 
-$(SRC_DIR)/pbc_dump$(O) : $(INC_DIR)/parrot.h $(GEN_HEADERS)
+$(SRC_DIR)/pbc_dump$(O) : $(INC_DIR)/embed.h  $(INC_DIR)/oplib/ops.h \
+        $(PARROT_H_HEADERS)
 
-$(INSTALLABLEPDUMP) : $(SRC_DIR)/pbc_dump$(O) $(SRC_DIR)/packdump$(O) $(LIBPARROT)
+$(INSTALLABLEPDUMP) : $(SRC_DIR)/pbc_dump$(O) $(SRC_DIR)/packdump$(O) \
+	$(SRC_DIR)/install_config$(O) $(LIBPARROT)
 	$(LINK) @ld_out@$@ \
     $(SRC_DIR)/pbc_dump$(O) \
     $(SRC_DIR)/packdump$(O) \
@@ -980,20 +1049,6 @@
 #IF(win32):	if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1
 
 
-# pbc_info
-$(PINFO) : $(SRC_DIR)/pbc_info$(O) $(LIBPARROT)
-	$(LINK) @ld_out@$@ \
-    $(SRC_DIR)/pbc_info$(O) \
-    @rpath_blib@ $(ALL_PARROT_LIBS) $(LINKFLAGS)
-#IF(win32):	if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1
-
-$(SRC_DIR)/pbc_info$(O) : $(INC_DIR)/parrot.h $(GEN_HEADERS)
-
-$(INSTALLABLEPINFO) : $(SRC_DIR)/pbc_info$(O) $(LIBPARROT)
-	$(LINK) @ld_out@$@ \
-    $(SRC_DIR)/pbc_info$(O) \
-    @rpath_lib@ $(ALL_PARROT_LIBS) $(LINKFLAGS)
-#IF(win32):	if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1
 
 #
 # Parrot Bytecode File Merger
@@ -1020,8 +1075,6 @@
 #
 ###############################################################################
 
-$(IMCC_DIR)/main$(O) : $(IMCC_DIR)/main.c $(GENERAL_H_FILES) $(IMCC_H_FILES)
-
 $(INC_DIR)/oplib/ops.h lib/Parrot/OpLib/core.pm : $(OPS_FILES) $(BUILD_TOOLS_DIR)/ops2pm.pl \
     lib/Parrot/OpsFile.pm lib/Parrot/Op.pm $(OPS_DIR)/ops.num $(OPS_DIR)/ops.skip
 	$(PERL) $(BUILD_TOOLS_DIR)/ops2pm.pl @no_lines_flag@ $(OPS_FILES)
@@ -1061,209 +1114,595 @@
 #
 ###############################################################################
 
-$(SRC_DIR)/byteorder$(O) : $(INC_DIR)/parrot.h
-
-$(SRC_DIR)/datatypes$(O) : $(INC_DIR)/parrot.h
-
-$(SRC_DIR)/extend_vtable$(O) : $(INC_DIR)/parrot.h
+$(SRC_DIR)/byteorder$(O) : $(PARROT_H_HEADERS)
 
-$(SRC_DIR)/global_setup$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/global_setup.str
+$(SRC_DIR)/datatypes$(O) : $(PARROT_H_HEADERS)
 
-$(SRC_DIR)/global$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/global.str \
-	$(SRC_DIR)/pmc/pmc_sub.h
+$(SRC_DIR)/extend_vtable$(O) : $(PARROT_H_HEADERS) \
+        $(INC_DIR)/extend.h $(INC_DIR)/extend_vtable.h
 
-$(SRC_DIR)/pmc$(O) : $(GENERAL_H_FILES)
+$(SRC_DIR)/global_setup$(O) : $(PARROT_H_HEADERS) $(SRC_DIR)/global_setup.str
 
-$(SRC_DIR)/pmc_freeze$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/pmc_freeze.str
+$(SRC_DIR)/global$(O) : $(PARROT_H_HEADERS) $(SRC_DIR)/global.str \
+	$(PMC_INC_DIR)/pmc/pmc_sub.h
 
-$(SRC_DIR)/hash$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/pmc/pmc_key.h
+$(SRC_DIR)/pmc$(O) : $(PMC_INC_DIR)/pmc/pmc_class.h \
+	$(SRC_DIR)/pmc.str $(PARROT_H_HEADERS)
 
-$(SRC_DIR)/list$(O) : $(GENERAL_H_FILES)
+$(SRC_DIR)/pmc_freeze$(O) : $(PARROT_H_HEADERS) $(SRC_DIR)/pmc_freeze.str
 
-$(SRC_DIR)/library$(O) : $(GENERAL_H_FILES)
+$(SRC_DIR)/hash$(O) : $(PARROT_H_HEADERS) $(PMC_INC_DIR)/pmc/pmc_key.h
 
-$(SRC_DIR)/jit$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/jit_emit.h $(SRC_DIR)/pmc/pmc_sub.h $(SRC_DIR)/pmc/pmc_managedstruct.h
+$(SRC_DIR)/list$(O) : $(PARROT_H_HEADERS)
 
-$(SRC_DIR)/jit_debug$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/debug.str
-
-$(SRC_DIR)/jit_debug_xcoff$(O) : $(GENERAL_H_FILES)
-
-$(SRC_DIR)/jit_cpu$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/jit_emit.h
-
-$(SRC_DIR)/exec$(O) : $(GENERAL_H_FILES) @TEMP_exec_h@ $(SRC_DIR)/jit_emit.h
-
-$(SRC_DIR)/exec_dep$(O) : $(GENERAL_H_FILES) @TEMP_exec_h@ $(SRC_DIR)/jit_emit.h $(SRC_DIR)/pmc/managedstruct.c
-
-$(SRC_DIR)/exec_cpu$(O) : $(GENERAL_H_FILES) @TEMP_exec_h@ $(SRC_DIR)/jit_emit.h
-
-$(SRC_DIR)/jit_defs$(O) : $(GENERAL_H_FILES) @TEMP_exec_h@ $(SRC_DIR)/jit_emit.h \
-	$(SRC_DIR)/pmc/pmc_fixedintegerarray.h $(SRC_DIR)/pmc/pmc_unmanagedstruct.h $(SRC_DIR)/pmc/pmc_pointer.h
+$(SRC_DIR)/library$(O) : $(PARROT_H_HEADERS) $(SRC_DIR)/library.str \
+        $(INC_DIR)/dynext.h
 
 $(INC_DIR)/extend_vtable.h $(SRC_DIR)/extend_vtable.c $(SRC_DIR)/vtable.h : src/vtable.tbl $(BUILD_TOOLS_DIR)/vtable_extend.pl lib/Parrot/Vtable.pm
 	$(PERL) $(BUILD_TOOLS_DIR)/vtable_extend.pl
 
-$(SRC_DIR)/exec_start$(O) : $(GENERAL_H_FILES) @TEMP_exec_h@
-
-$(SRC_DIR)/exec_save$(O) : $(GENERAL_H_FILES) @TEMP_exec_h@
-
-$(SRC_DIR)/key$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/key.str $(SRC_DIR)/pmc/pmc_key.h
+$(SRC_DIR)/key$(O) : $(PARROT_H_HEADERS) $(SRC_DIR)/key.str \
+        $(PMC_INC_DIR)/pmc/pmc_key.h
 
-$(SRC_DIR)/gc/mark_sweep$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/gc/gc_private.h
+$(SRC_DIR)/gc/mark_sweep$(O) : $(PARROT_H_HEADERS) $(SRC_DIR)/gc/gc_private.h
 
-$(SRC_DIR)/gc/gc_ms$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/gc/gc_ms.c
+$(SRC_DIR)/gc/gc_ms$(O) : $(PARROT_H_HEADERS) $(SRC_DIR)/gc/gc_private.h
 
-$(SRC_DIR)/gc/gc_inf$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/gc/gc_inf.c
+$(SRC_DIR)/gc/gc_inf$(O) : $(PARROT_H_HEADERS) $(SRC_DIR)/gc/gc_private.h
 
-$(SRC_DIR)/gc/api$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/gc/gc_private.h
+$(SRC_DIR)/gc/api$(O) : $(PARROT_H_HEADERS) $(SRC_DIR)/gc/gc_private.h
 
-$(SRC_DIR)/gc/generational_ms$(O) : $(GENERAL_H_FILES)
+$(SRC_DIR)/gc/alloc_resources$(O) : $(PARROT_H_HEADERS) \
+        $(SRC_DIR)/gc/gc_private.h
 
-$(SRC_DIR)/gc/incremental_ms$(O) : $(GENERAL_H_FILES)
+$(SRC_DIR)/hll$(O) : $(PARROT_H_HEADERS) $(SRC_DIR)/hll.str $(INC_DIR)/dynext.h
 
-$(SRC_DIR)/gc/alloc_resources$(O) : $(GENERAL_H_FILES)
+$(SRC_DIR)/platform$(O) : $(PARROT_H_HEADERS)
 
-$(SRC_DIR)/gc/res_lea$(O) : $(GENERAL_H_FILES)
-
-$(SRC_DIR)/hll$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/hll.str
-
-$(SRC_DIR)/platform$(O) : $(GENERAL_H_FILES)
-
-#IF(platform_asm):$(SRC_DIR)/platform_asm$(O) : $(GENERAL_H_FILES)
+#IF(platform_asm):$(SRC_DIR)/platform_asm$(O) : $(PARROT_H_HEADERS)
 #IF(platform_asm):
-$(SRC_DIR)/core_pmcs$(O) : $(GENERAL_H_FILES)
-
-$(SRC_DIR)/runcore/trace$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/pmc/pmc_sub.h
-
-$(SRC_DIR)/debug$(O) : $(GENERAL_H_FILES) $(INC_DIR)/debugger.h \
-    $(SRC_DIR)/debug.str $(SRC_DIR)/pmc/pmc_key.h $(SRC_DIR)/pmc/pmc_continuation.h
-
-$(SRC_DIR)/sub$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/sub.str \
-	$(SRC_DIR)/pmc/pmc_sub.h $(SRC_DIR)/pmc/pmc_continuation.h
-
-$(SRC_DIR)/string/api$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/string/private_cstring.h
-
-$(SRC_DIR)/string/primitives$(O) : $(GENERAL_H_FILES)
-
-$(SRC_DIR)/longopt$(O) : $(GENERAL_H_FILES)
-
-$(SRC_DIR)/dynext$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/dynext.str \
-	$(SRC_DIR)/pmc/pmc_parrotlibrary.h
-
-$(SRC_DIR)/exceptions$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/exceptions.str \
-	$(SRC_DIR)/pmc/pmc_continuation.h
-
-$(SRC_DIR)/events$(O) : $(GENERAL_H_FILES)
-
-$(SRC_DIR)/thread$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/pmc/pmc_sub.h \
-	$(SRC_DIR)/pmc/pmc_parrotinterpreter.h
-
-$(SRC_DIR)/extend$(O) : $(GENERAL_H_FILES) $(INC_DIR)/extend.h \
-	$(SRC_DIR)/pmc/pmc_sub.h
-
-$(SRC_DIR)/runcore/main$(O) : $(SRC_DIR)/runcore/main.c $(GENERAL_H_FILES) \
-	$(SRC_DIR)/pmc/pmc_parrotlibrary.h
+$(SRC_DIR)/core_pmcs$(O) : $(PARROT_H_HEADERS)
 
-$(SRC_DIR)/call/pcc$(O) : $(SRC_DIR)/call/pcc.c $(GENERAL_H_FILES) \
-	$(SRC_DIR)/call/pcc.str $(SRC_DIR)/pmc/pmc_fixedintegerarray.h \
-	$(SRC_DIR)/pmc/pmc_key.h $(SRC_DIR)/pmc/pmc_continuation.h
+$(SRC_DIR)/runcore/trace$(O) : $(PMC_INC_DIR)/pmc/pmc_sub.h \
+        $(INC_DIR)/oplib/ops.h $(INC_DIR)/runcore_trace.h \
+        $(PARROT_H_HEADERS)
+
+$(SRC_DIR)/debug$(O) : $(INC_DIR)/embed.h $(INC_DIR)/extend.h \
+        $(PARROT_H_HEADERS) \
+        $(INC_DIR)/oplib/ops.h \
+        $(INC_DIR)/runcore_api.h $(INC_DIR)/runcore_trace.h \
+        $(SRC_DIR)/debug.str $(PMC_INC_DIR)/pmc/pmc_key.h \
+        $(PMC_INC_DIR)/pmc/pmc_continuation.h \
+        $(INC_DIR)/extend_vtable.h
+
+$(SRC_DIR)/sub$(O) : $(PARROT_H_HEADERS) $(INC_DIR)/oplib/ops.h \
+        $(SRC_DIR)/sub.str \
+	$(PMC_INC_DIR)/pmc/pmc_sub.h $(PMC_INC_DIR)/pmc/pmc_continuation.h
+
+$(SRC_DIR)/string/api$(O) : $(PARROT_H_HEADERS) $(SRC_DIR)/string/api.str \
+        $(SRC_DIR)/string/private_cstring.h
+
+$(SRC_DIR)/string/primitives$(O) : $(PARROT_H_HEADERS)
+
+$(SRC_DIR)/longopt$(O) : $(PARROT_H_HEADERS)
+
+$(SRC_DIR)/dynext$(O) : $(PARROT_H_HEADERS) $(INC_DIR)/dynext.h \
+        $(SRC_DIR)/dynext.str $(PMC_INC_DIR)/pmc/pmc_parrotlibrary.h
+
+$(SRC_DIR)/exceptions$(O) : $(PARROT_H_HEADERS) \
+        $(SRC_DIR)/exceptions.str \
+	$(PMC_INC_DIR)/pmc/pmc_continuation.h
+
+$(SRC_DIR)/events$(O) : $(PARROT_H_HEADERS) $(SRC_DIR)/events.str
+
+$(SRC_DIR)/thread$(O) : $(PARROT_H_HEADERS) $(INC_DIR)/atomic.h \
+        $(PMC_INC_DIR)/pmc/pmc_sub.h \
+	$(PMC_INC_DIR)/pmc/pmc_parrotinterpreter.h
+
+$(SRC_DIR)/extend$(O) : $(PARROT_H_HEADERS) $(INC_DIR)/extend.h \
+	$(PMC_INC_DIR)/pmc/pmc_sub.h $(INC_DIR)/extend_vtable.h
+
+$(SRC_DIR)/runcore/main$(O) : \
+	$(SRC_DIR)/runcore/main.str \
+	$(PMC_INC_DIR)/pmc/pmc_parrotlibrary.h \
+        $(INC_DIR)/dynext.h $(INC_DIR)/oplib/core_ops.h \
+        $(INC_DIR)/oplib/core_ops_switch.h $(INC_DIR)/oplib/ops.h \
+        $(PARROT_H_HEADERS) $(INC_DIR)/runcore_api.h \
+        $(INC_DIR)/runcore_profiling.h
+
+$(SRC_DIR)/runcore/profiling$(O) : $(SRC_DIR)/runcore/profiling.str \
+	$(PMC_INC_DIR)/pmc/pmc_sub.h \
+	$(PMC_INC_DIR)/pmc/pmc_namespace.h \
+        $(INC_DIR)/oplib/core_ops.h $(INC_DIR)/runcore_api.h \
+        $(INC_DIR)/runcore_profiling.h $(INC_DIR)/embed.h \
+        $(PARROT_H_HEADERS)
+
+$(SRC_DIR)/call/args$(O) : \
+        $(PARROT_H_HEADERS) $(INC_DIR)/oplib/ops.h \
+	$(SRC_DIR)/call/args.str \
+	$(PMC_INC_DIR)/pmc/pmc_key.h \
+	$(PMC_INC_DIR)/pmc/pmc_fixedintegerarray.h
+
+$(SRC_DIR)/call/context_accessors$(O): $(PARROT_H_HEADERS)
+
+$(SRC_DIR)/call/pcc$(O) : $(INC_DIR)/oplib/ops.h \
+        $(PARROT_H_HEADERS) \
+        $(INC_DIR)/runcore_api.h \
+	$(SRC_DIR)/call/pcc.str \
+	$(PMC_INC_DIR)/pmc/pmc_key.h $(PMC_INC_DIR)/pmc/pmc_continuation.h
+
+$(SRC_DIR)/call/context$(O) : $(PARROT_H_HEADERS) \
+	$(PMC_INC_DIR)/pmc/pmc_sub.h
+
+$(SRC_DIR)/interp/inter_cb$(O) : $(PARROT_H_HEADERS) \
+	$(SRC_DIR)/interp/inter_cb.str
+
+$(SRC_DIR)/interp/inter_misc$(O) : $(PARROT_H_HEADERS) \
+        $(SRC_DIR)/interp/inter_misc.str \
+	compilers/imcc/imc.h \
+	compilers/imcc/cfg.h \
+	compilers/imcc/debug.h \
+	compilers/imcc/instructions.h \
+	compilers/imcc/sets.h \
+	compilers/imcc/symreg.h \
+	compilers/imcc/unit.h \
+        $(INC_DIR)/oplib/ops.h \
+        $(INC_DIR)/runcore_api.h
+
+$(SRC_DIR)/interp/inter_create$(O) : $(PARROT_H_HEADERS) \
+	$(INC_DIR)/oplib/core_ops.h \
+        $(SRC_DIR)/interp/inter_create.str \
+	compilers/imcc/imc.h \
+	compilers/imcc/cfg.h \
+	compilers/imcc/debug.h \
+	compilers/imcc/instructions.h \
+	compilers/imcc/sets.h \
+	compilers/imcc/symreg.h \
+	compilers/imcc/unit.h \
+        $(INC_DIR)/oplib/ops.h \
+        $(INC_DIR)/runcore_api.h
+
+$(SRC_DIR)/call/ops$(O) : $(INC_DIR)/oplib/ops.h \
+	$(PARROT_H_HEADERS) $(PMC_INC_DIR)/pmc/pmc_continuation.h
+
+$(IO_DIR)/api$(O) : $(PARROT_H_HEADERS) $(IO_DIR)/io_private.h \
+        $(IO_DIR)/api.str $(PMC_INC_DIR)/pmc/pmc_filehandle.h \
+        $(PMC_INC_DIR)/pmc/pmc_stringhandle.h
+
+$(IO_DIR)/buffer$(O) : $(PARROT_H_HEADERS) $(IO_DIR)/io_private.h
+
+$(IO_DIR)/portable$(O) : $(PARROT_H_HEADERS) $(IO_DIR)/io_private.h
+
+$(IO_DIR)/unix$(O) : $(PARROT_H_HEADERS) $(IO_DIR)/io_private.h $(PMC_INC_DIR)/pmc/pmc_filehandle.h
+
+$(IO_DIR)/utf8$(O) : $(PARROT_H_HEADERS) $(IO_DIR)/io_private.h $(SRC_DIR)/string/unicode.h
+
+$(IO_DIR)/win32$(O) : $(PARROT_H_HEADERS) $(IO_DIR)/io_private.h $(PMC_INC_DIR)/pmc/pmc_filehandle.h
+
+$(SRC_DIR)/gc/alloc_memory$(O) : $(PARROT_H_HEADERS)
+
+$(SRC_DIR)/main$(O) : $(INC_DIR)/imcc.h $(PARROT_H_HEADERS) \
+        $(INC_DIR)/embed.h
+
+$(SRC_DIR)/multidispatch$(O) : \
+        $(SRC_DIR)/multidispatch.str \
+        $(INC_DIR)/oplib/ops.h $(PARROT_H_HEADERS) \
+	$(PMC_INC_DIR)/pmc/pmc_nci.h $(PMC_INC_DIR)/pmc/pmc_sub.h
+
+$(SRC_DIR)/packfile$(O) : $(SRC_DIR)/packfile.str \
+	$(PMC_INC_DIR)/pmc/pmc_sub.h $(PMC_INC_DIR)/pmc/pmc_key.h \
+        compilers/imcc/imc.h \
+	compilers/imcc/cfg.h \
+	compilers/imcc/debug.h \
+	compilers/imcc/instructions.h \
+	compilers/imcc/sets.h \
+	compilers/imcc/symreg.h \
+	compilers/imcc/unit.h \
+        $(INC_DIR)/oplib/ops.h \
+        $(INC_DIR)/embed.h $(INC_DIR)/extend.h $(INC_DIR)/extend_vtable.h \
+        $(PARROT_H_HEADERS) $(INC_DIR)/runcore_api.h
 
-$(SRC_DIR)/interp/inter_cb$(O) : $(SRC_DIR)/interp/inter_cb.c \
-	$(GENERAL_H_FILES) $(SRC_DIR)/interp/inter_cb.str
+$(PF_DIR)/pf_items$(O) : $(PARROT_H_HEADERS)
 
-$(SRC_DIR)/interp/inter_misc$(O) : $(SRC_DIR)/interp/inter_misc.c \
-	$(GENERAL_H_FILES) $(SRC_DIR)/interp/inter_misc.str
-
-$(SRC_DIR)/interp/inter_create$(O) : $(SRC_DIR)/interp/inter_create.c \
-	$(GENERAL_H_FILES) $(SRC_DIR)/interp/inter_create.str
-
-$(SRC_DIR)/call/ops$(O) : $(SRC_DIR)/call/ops.c $(GENERAL_H_FILES) \
-	$(SRC_DIR)/pmc/pmc_continuation.h
-
-$(IO_DIR)/api$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h $(IO_DIR)/api.str
-
-$(IO_DIR)/buffer$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h
-
-$(IO_DIR)/portable$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h
-
-$(IO_DIR)/unix$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h
-
-$(IO_DIR)/utf8$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h
-
-$(IO_DIR)/win32$(O) : $(GENERAL_H_FILES) $(IO_DIR)/io_private.h
-
-$(SRC_DIR)/gc/alloc_memory$(O) : $(GENERAL_H_FILES)
-
-$(SRC_DIR)/main$(O) : $(SRC_DIR)/main.c $(GENERAL_H_FILES)
-
-$(SRC_DIR)/pic$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/pmc/pmc_fixedintegerarray.h \
-	$(SRC_DIR)/pmc/pmc_continuation.h
-
-$(SRC_DIR)/pic_jit$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/pmc/pmc_sub.h
-
-$(SRC_DIR)/multidispatch$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/multidispatch.str \
-	$(SRC_DIR)/pmc/pmc_nci.h $(SRC_DIR)/pmc/pmc_sub.h
-
-$(SRC_DIR)/packfile$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/packfile.str \
-	$(SRC_DIR)/pmc/pmc_sub.h $(SRC_DIR)/pmc/pmc_key.h
-
-$(PF_DIR)/pf_items$(O) : $(GENERAL_H_FILES)
-
-$(SRC_DIR)/packout$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/pmc/pmc_key.h
+$(SRC_DIR)/packout$(O) : $(PARROT_H_HEADERS) $(PMC_INC_DIR)/pmc/pmc_key.h
 
 $(SRC_DIR)/parrot$(O) : $(GENERAL_H_FILES)
 
-$(SRC_DIR)/gc/alloc_register$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/pmc/pmc_sub.h
-
-$(SRC_DIR)/runcore/cores$(O) : $(GENERAL_H_FILES)
-
-$(SRC_DIR)/stacks$(O) : $(GENERAL_H_FILES)
-
-$(SRC_DIR)/tsq$(O) : $(GENERAL_H_FILES)
-
-$(SRC_DIR)/embed$(O) : $(GENERAL_H_FILES) $(INC_DIR)/debugger.h \
-	$(SRC_DIR)/pmc/pmc_sub.h
+$(SRC_DIR)/runcore/cores$(O) : $(SRC_DIR)/runcore/cores.str \
+	$(PMC_INC_DIR)/pmc/pmc_sub.h \
+        $(INC_DIR)/dynext.h $(INC_DIR)/embed.h $(INC_DIR)/oplib/core_ops.h \
+        $(INC_DIR)/oplib/core_ops_switch.h $(INC_DIR)/oplib/ops.h \
+        $(INC_DIR)/runcore_api.h $(INC_DIR)/runcore_trace.h \
+        $(PARROT_H_HEADERS)
+
+$(SRC_DIR)/tsq$(O) : $(PARROT_H_HEADERS)
+
+$(SRC_DIR)/embed$(O) : $(PARROT_H_HEADERS) $(INC_DIR)/embed.h \
+        $(INC_DIR)/oplib/ops.h $(INC_DIR)/runcore_api.h \
+        compilers/imcc/imc.h \
+        compilers/imcc/cfg.h \
+        compilers/imcc/debug.h \
+        compilers/imcc/instructions.h \
+        compilers/imcc/sets.h \
+        compilers/imcc/symreg.h \
+        compilers/imcc/unit.h \
+	$(PMC_INC_DIR)/pmc/pmc_sub.h
 
 $(SRC_DIR)/dataypes$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/dataypes.c
 
-$(SRC_DIR)/exit$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/exit.c
+$(SRC_DIR)/exit$(O) : $(PARROT_H_HEADERS)
 
-$(SRC_DIR)/nci$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/nci.c $(SRC_DIR)/nci.str \
-        $(SRC_DIR)/pmc/pmc_managedstruct.h \
-        $(SRC_DIR)/pmc/pmc_nci.h \
-        $(SRC_DIR)/pmc/pmc_pointer.h
+$(SRC_DIR)/nci$(O) : $(SRC_DIR)/nci.str \
+        $(INC_DIR)/oplib/ops.h $(PARROT_H_HEADERS) \
+        $(SRC_DIR)/frame_builder.h \
+        $(PMC_INC_DIR)/pmc/pmc_managedstruct.h \
+        $(PMC_INC_DIR)/pmc/pmc_nci.h \
+        $(PMC_INC_DIR)/pmc/pmc_pointer.h
+
+$(SRC_DIR)/frame_builder$(O) : $(PARROT_H_HEADERS) $(SRC_DIR)/frame_builder.h \
+        $(PMC_INC_DIR)/pmc/pmc_fixedintegerarray.h \
+        $(PMC_INC_DIR)/pmc/pmc_unmanagedstruct.h \
+        $(PMC_INC_DIR)/pmc/pmc_managedstruct.h \
+        $(INC_DIR)/oplib/ops.h
 
-$(SRC_DIR)/vtables$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/vtables.c
+$(SRC_DIR)/vtables$(O) : $(PARROT_H_HEADERS)
 
-$(SRC_DIR)/gc/system$(O) : $(GENERAL_H_FILES)  $(SRC_DIR)/gc/gc_private.h
+$(SRC_DIR)/gc/system$(O) : $(PARROT_H_HEADERS)  $(SRC_DIR)/gc/gc_private.h
+$(SRC_DIR)/gc/gc_private.h : $(INC_DIR)/settings.h
 
 $(SRC_DIR)/nci.c : $(SRC_DIR)/call_list.txt $(BUILD_TOOLS_DIR)/nativecall.pl \
-	$(SRC_DIR)/pmc/pmc_nci.h
+	$(PMC_INC_DIR)/pmc/pmc_nci.h
 	$(PERL) $(BUILD_TOOLS_DIR)/nativecall.pl $(SRC_DIR)/call_list.txt
 
-$(SRC_DIR)/warnings$(O) : $(GENERAL_H_FILES)
-
-$(SRC_DIR)/misc$(O) : $(GENERAL_H_FILES)
-
-$(SRC_DIR)/utils$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/pmc/pmc_nci.h
-
-$(SRC_DIR)/spf_render$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/spf_render.str
-
-$(SRC_DIR)/spf_vtable$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/spf_vtable.str
+$(SRC_DIR)/warnings$(O) : $(PARROT_H_HEADERS)
 
-$(SRC_DIR)/string/encoding$(O) : $(SRC_DIR)/string/encoding.c \
-	$(INC_DIR)/config.h $(GENERAL_H_FILES)
+$(SRC_DIR)/misc$(O) : $(PARROT_H_HEADERS)
 
-$(SRC_DIR)/string/charset$(O) : $(SRC_DIR)/string/charset.c $(GENERAL_H_FILES)
+$(SRC_DIR)/utils$(O) : $(PARROT_H_HEADERS) $(PMC_INC_DIR)/pmc/pmc_nci.h
 
-$(SRC_DIR)/pbc_merge$(O) : $(SRC_DIR)/pbc_merge.c $(GENERAL_H_FILES) \
-	$(SRC_DIR)/pmc/pmc_sub.h
+$(SRC_DIR)/spf_render$(O) : $(PARROT_H_HEADERS) $(SRC_DIR)/spf_render.str
 
-$(IO_DIR)/filehandle$(O) : $(INC_DIR)/parrot.h $(SRC_DIR)/pmc/pmc_filehandle.h $(SRC_DIR)/io/io_private.h
-
-$(OPS_DIR)/core_ops$(O) : $(GENERAL_H_FILES) $(OPS_DIR)/core_ops.c \
-	$(SRC_DIR)/pmc/pmc_continuation.h $(SRC_DIR)/pmc/pmc_parrotlibrary.h
-
-$(OPS_DIR)/pic.ops : $(SRC_DIR)/pmc/pmc_fixedintegerarray.h
+$(SRC_DIR)/spf_vtable$(O) : $(PARROT_H_HEADERS) $(SRC_DIR)/spf_vtable.str
+
+$(SRC_DIR)/string/encoding$(O) : $(PARROT_H_HEADERS)
+
+$(SRC_DIR)/string/charset$(O) : $(PARROT_H_HEADERS) \
+        $(SRC_DIR)/string/encoding/fixed_8.h \
+        $(SRC_DIR)/string/encoding/utf8.h \
+        $(SRC_DIR)/string/encoding/utf16.h \
+        $(SRC_DIR)/string/encoding/ucs2.h \
+        $(SRC_DIR)/string/charset/ascii.h \
+        $(SRC_DIR)/string/charset/binary.h \
+        $(SRC_DIR)/string/charset/iso-8859-1.h \
+        $(SRC_DIR)/string/charset/unicode.h
+
+$(SRC_DIR)/pbc_merge$(O) : $(INC_DIR)/embed.h \
+	$(PMC_INC_DIR)/pmc/pmc_sub.h $(INC_DIR)/oplib/ops.h $(PARROT_H_HEADERS)
+
+$(IO_DIR)/filehandle$(O) : $(PARROT_H_HEADERS) $(PMC_INC_DIR)/pmc/pmc_filehandle.h $(SRC_DIR)/io/io_private.h
+
+compilers/pirc/src/piremit$(O) : $(PARROT_H_HEADERS) \
+        compilers/pirc/src/piremit.h \
+        compilers/pirc/src/pircompunit.h \
+        compilers/pirc/src/pircompiler.h \
+        compilers/pirc/src/pirerr.h \
+        compilers/pirc/src/bcgen.h \
+        compilers/pirc/src/pirdefines.h \
+        compilers/pirc/src/pirmacro.h \
+        compilers/pirc/src/pirregalloc.h \
+        compilers/pirc/src/pirsymbol.h \
+        compilers/pirc/src/piryy.h \
+        $(INC_DIR)/embed.h \
+        $(INC_DIR)/oplib/ops.h
+
+compilers/imcc/pcc$(O) : compilers/imcc/imc.h $(PARROT_H_HEADERS) compilers/imcc/parser.h \
+  compilers/imcc/cfg.h compilers/imcc/debug.h compilers/imcc/instructions.h \
+  compilers/imcc/sets.h compilers/imcc/symreg.h compilers/imcc/unit.h \
+  $(INC_DIR)/oplib/ops.h compilers/imcc/imcparser.h
+
+compilers/imcc/instructions$(O) : compilers/imcc/imc.h $(PARROT_H_HEADERS) compilers/imcc/pbc.h \
+  compilers/imcc/optimizer.h \
+  compilers/imcc/cfg.h compilers/imcc/debug.h compilers/imcc/instructions.h \
+  compilers/imcc/sets.h compilers/imcc/symreg.h compilers/imcc/unit.h \
+  $(INC_DIR)/oplib/ops.h
+
+src/dynpmc/subproxy$(O) : $(PARROT_H_HEADERS) $(INC_DIR)/extend.h \
+  $(INC_DIR)/dynext.h $(PMC_INC_DIR)/pmc/pmc_subproxy.h \
+  $(PMC_INC_DIR)/pmc/pmc_sub.h $(PMC_INC_DIR)/pmc_default.h \
+  $(PMC_INC_DIR)/pmc/pmc_continuation.h $(PMC_INC_DIR)/pmc/pmc_callcontext.h \
+  $(PMC_INC_DIR)/pmc/pmc_default.h
+
+compilers/pirc/src/pirparser$(O) : $(PARROT_H_HEADERS) \
+        compilers/pirc/src/pircompiler.h \
+        compilers/pirc/src/pircompunit.h \
+        compilers/pirc/src/pirdefines.h \
+        compilers/pirc/src/pirparser.h \
+        compilers/pirc/src/piryy.h \
+        compilers/pirc/src/pirlexer.h \
+        compilers/pirc/src/pirerr.h \
+        compilers/pirc/src/pirop.h \
+        compilers/pirc/src/pirpcc.h \
+        compilers/pirc/src/pirmacro.h \
+        compilers/pirc/src/pirregalloc.h \
+        compilers/pirc/src/pirsymbol.h \
+        compilers/pirc/src/bcgen.h \
+        $(INC_DIR)/oplib/ops.h \
+        $(INC_DIR)/embed.h
+
+compilers/pirc/src/pirerr$(O) : $(PARROT_H_HEADERS) \
+        compilers/pirc/src/pircompiler.h \
+        compilers/pirc/src/pircompunit.h \
+        compilers/pirc/src/pirdefines.h \
+        compilers/pirc/src/pirparser.h \
+        compilers/pirc/src/piryy.h \
+        compilers/pirc/src/pirlexer.h \
+        compilers/pirc/src/pirerr.h \
+        compilers/pirc/src/pirmacro.h \
+        compilers/pirc/src/pirregalloc.h \
+        compilers/pirc/src/pirsymbol.h \
+        compilers/pirc/src/bcgen.h \
+        $(INC_DIR)/embed.h
+
+compilers/imcc/parser.h : compilers/imcc/imcparser.h
+
+compilers/imcc/pbc$(O) : $(PARROT_H_HEADERS) \
+  compilers/imcc/imc.h \
+  compilers/imcc/pbc.h \
+  $(PMC_INC_DIR)/pmc/pmc_sub.h \
+  compilers/imcc/cfg.h compilers/imcc/debug.h compilers/imcc/instructions.h \
+  compilers/imcc/sets.h compilers/imcc/symreg.h compilers/imcc/unit.h \
+  $(INC_DIR)/oplib/ops.h
+
+compilers/imcc/parser_util$(O) : compilers/imcc/imc.h $(PARROT_H_HEADERS) \
+        compilers/imcc/pbc.h \
+        compilers/imcc/parser.h \
+        compilers/imcc/optimizer.h \
+        $(INC_DIR)/dynext.h $(INC_DIR)/embed.h \
+        $(PMC_INC_DIR)/pmc/pmc_sub.h \
+  compilers/imcc/cfg.h compilers/imcc/debug.h compilers/imcc/instructions.h \
+  compilers/imcc/sets.h compilers/imcc/symreg.h compilers/imcc/unit.h \
+  $(INC_DIR)/oplib/ops.h compilers/imcc/imcparser.h
+
+compilers/pirc/src/bcgen$(O) :  \
+  compilers/pirc/src/pirsymbol.h \
+  compilers/pirc/src/pircompiler.h \
+  compilers/pirc/src/pirregalloc.h \
+  compilers/pirc/src/pircompunit.h \
+  compilers/pirc/src/pirdefines.h \
+  compilers/pirc/src/pirmacro.h \
+  compilers/pirc/src/bcgen.h \
+  $(PARROT_H_HEADERS) \
+  $(INC_DIR)/embed.h \
+  $(PMC_INC_DIR)/pmc/pmc_sub.h \
+  $(PMC_INC_DIR)/pmc/pmc_namespace.h
+
+compilers/imcc/imc$(O) :  \
+  compilers/imcc/imc.h $(PARROT_H_HEADERS) \
+  compilers/imcc/optimizer.h \
+  compilers/imcc/cfg.h compilers/imcc/debug.h compilers/imcc/instructions.h \
+  compilers/imcc/sets.h compilers/imcc/symreg.h compilers/imcc/unit.h \
+  $(INC_DIR)/oplib/ops.h
+
+compilers/pirc/src/pirregalloc$(O) : $(PARROT_H_HEADERS) \
+        compilers/pirc/src/pircompiler.h \
+        compilers/pirc/src/pircompunit.h \
+        compilers/pirc/src/pirdefines.h \
+        compilers/pirc/src/pirmacro.h \
+        compilers/pirc/src/pirregalloc.h \
+        compilers/pirc/src/pirsymbol.h \
+        compilers/pirc/src/bcgen.h \
+        $(INC_DIR)/embed.h
+
+compilers/imcc/cfg$(O) : \
+  compilers/imcc/imc.h $(PARROT_H_HEADERS) compilers/imcc/optimizer.h \
+  compilers/imcc/cfg.h compilers/imcc/debug.h compilers/imcc/instructions.h \
+  compilers/imcc/sets.h compilers/imcc/symreg.h compilers/imcc/unit.h \
+  $(INC_DIR)/oplib/ops.h
+
+compilers/imcc/debug$(O) : \
+  compilers/imcc/imc.h $(PARROT_H_HEADERS) \
+  compilers/imcc/cfg.h compilers/imcc/debug.h compilers/imcc/instructions.h  \
+  compilers/imcc/sets.h compilers/imcc/symreg.h compilers/imcc/unit.h \
+  $(INC_DIR)/oplib/ops.h
+
+compilers/imcc/imclexer$(O) : \
+  compilers/imcc/imc.h $(PARROT_H_HEADERS) compilers/imcc/parser.h \
+  compilers/imcc/cfg.h compilers/imcc/debug.h compilers/imcc/instructions.h \
+  compilers/imcc/sets.h compilers/imcc/symreg.h compilers/imcc/unit.h \
+  $(INC_DIR)/oplib/ops.h compilers/imcc/imcparser.h
+
+compilers/imcc/imcparser$(O) : \
+  compilers/imcc/imc.h $(PARROT_H_HEADERS) compilers/imcc/parser.h compilers/imcc/pbc.h \
+  compilers/imcc/optimizer.h \
+  $(INC_DIR)/dynext.h \
+  compilers/imcc/cfg.h compilers/imcc/debug.h compilers/imcc/imcparser.h \
+  compilers/imcc/instructions.h \
+  compilers/imcc/sets.h compilers/imcc/symreg.h compilers/imcc/unit.h \
+  $(INC_DIR)/oplib/ops.h
+
+compilers/imcc/main$(O) : \
+  compilers/imcc/imc.h $(PARROT_H_HEADERS) \
+  compilers/imcc/parser.h compilers/imcc/pbc.h \
+  $(INC_DIR)/embed.h  \
+  $(INC_DIR)/imcc.h $(INC_DIR)/runcore_api.h \
+  compilers/imcc/cfg.h compilers/imcc/debug.h compilers/imcc/instructions.h \
+  compilers/imcc/sets.h compilers/imcc/symreg.h compilers/imcc/unit.h \
+  $(INC_DIR)/oplib/ops.h compilers/imcc/imcparser.h
+
+compilers/imcc/optimizer$(O) : \
+  compilers/imcc/imc.h $(PARROT_H_HEADERS) \
+  compilers/imcc/pbc.h compilers/imcc/optimizer.h \
+  compilers/imcc/cfg.h compilers/imcc/debug.h compilers/imcc/instructions.h \
+  compilers/imcc/sets.h compilers/imcc/symreg.h compilers/imcc/unit.h \
+  $(INC_DIR)/oplib/ops.h
+
+compilers/imcc/reg_alloc$(O) : compilers/imcc/imc.h $(PARROT_H_HEADERS) compilers/imcc/optimizer.h \
+  compilers/imcc/cfg.h compilers/imcc/debug.h compilers/imcc/instructions.h \
+  compilers/imcc/sets.h compilers/imcc/symreg.h compilers/imcc/unit.h \
+  $(INC_DIR)/oplib/ops.h
+
+compilers/imcc/sets$(O) : compilers/imcc/imc.h $(PARROT_H_HEADERS) compilers/imcc/sets.h \
+  compilers/imcc/cfg.h compilers/imcc/debug.h compilers/imcc/instructions.h \
+  compilers/imcc/symreg.h compilers/imcc/unit.h \
+  $(INC_DIR)/oplib/ops.h
+
+compilers/imcc/symreg$(O) : compilers/imcc/imc.h $(PARROT_H_HEADERS) \
+  compilers/imcc/sets.h \
+  compilers/imcc/cfg.h compilers/imcc/debug.h compilers/imcc/instructions.h \
+  compilers/imcc/symreg.h compilers/imcc/unit.h \
+  $(INC_DIR)/oplib/ops.h
+compilers/pirc/heredoc/heredocmain$(O) : $(PARROT_H_HEADERS)
+
+compilers/pirc/macro/macrolexer$(O) : $(PARROT_H_HEADERS) \
+        compilers/pirc/macro/macro.h  \
+        compilers/pirc/macro/lexer.h  \
+        compilers/pirc/macro/macroparser.h
+
+compilers/pirc/macro/macroparser$(O) : $(PARROT_H_HEADERS) \
+        compilers/pirc/macro/macro.h  \
+        compilers/pirc/macro/lexer.h  \
+        compilers/pirc/macro/macroparser.h \
+        compilers/pirc/macro/macrolexer.h
+
+compilers/pirc/src/hdocprep$(O) : $(PARROT_H_HEADERS) \
+        $(INC_DIR)/embed.h compilers/pirc/src/pirheredoc.h
+
+compilers/pirc/src/main$(O) : \
+        $(PARROT_H_HEADERS) \
+        $(INC_DIR)/embed.h \
+        compilers/pirc/src/bcgen.h \
+        compilers/pirc/src/pirparser.h \
+        compilers/pirc/src/pircompiler.h \
+        compilers/pirc/src/pircompunit.h \
+        compilers/pirc/src/pirmacro.h \
+        compilers/pirc/src/pirdefines.h \
+        compilers/pirc/src/piremit.h \
+        compilers/pirc/src/piryy.h \
+        compilers/pirc/src/pirlexer.h \
+        compilers/pirc/src/pirheredoc.h \
+        compilers/pirc/src/pirsymbol.h \
+        compilers/pirc/src/pirregalloc.h \
+        compilers/pirc/src/pircapi.h
+
+compilers/pirc/src/pircapi$(O) : \
+        $(PARROT_H_HEADERS) \
+        compilers/pirc/src/bcgen.h \
+        compilers/pirc/src/pircompiler.h \
+        compilers/pirc/src/pirparser.h \
+        compilers/pirc/src/pircompunit.h \
+        compilers/pirc/src/pirsymbol.h \
+        compilers/pirc/src/pirregalloc.h \
+        compilers/pirc/src/pirmacro.h \
+        compilers/pirc/src/pirdefines.h \
+        compilers/pirc/src/piremit.h \
+        compilers/pirc/src/piryy.h \
+        compilers/pirc/src/pirlexer.h \
+        compilers/pirc/src/pircapi.h \
+        $(INC_DIR)/embed.h
+
+compilers/pirc/src/pircompiler$(O) : \
+        compilers/pirc/src/pircompiler.h \
+        $(PARROT_H_HEADERS) \
+        compilers/pirc/src/piryy.h \
+        compilers/pirc/src/pirmacro.h \
+        compilers/pirc/src/pirregalloc.h \
+        compilers/pirc/src/pirerr.h \
+        compilers/pirc/src/bcgen.h \
+        compilers/pirc/src/pircompunit.h \
+        compilers/pirc/src/pirsymbol.h \
+        compilers/pirc/src/pirdefines.h \
+        $(INC_DIR)/embed.h
+
+compilers/pirc/src/pircompunit$(O) : $(PARROT_H_HEADERS) \
+  compilers/pirc/src/pircompunit.h \
+  compilers/pirc/src/pircompiler.h \
+  compilers/pirc/src/pirsymbol.h \
+  compilers/pirc/src/piryy.h \
+  compilers/pirc/src/pirdefines.h \
+  compilers/pirc/src/pirregalloc.h \
+  compilers/pirc/src/pirpcc.h \
+  compilers/pirc/src/pirerr.h \
+  compilers/pirc/src/pirmacro.h \
+  compilers/pirc/src/pirop.h \
+  compilers/pirc/src/bcgen.h \
+  $(INC_DIR)/oplib/ops.h \
+  $(INC_DIR)/dynext.h \
+  $(INC_DIR)/embed.h
+
+compilers/pirc/src/pirlexer$(O) : $(PARROT_H_HEADERS) \
+  compilers/pirc/src/pirparser.h \
+  compilers/pirc/src/pirmacro.h \
+  compilers/pirc/src/pirerr.h \
+  compilers/pirc/src/pircompunit.h \
+  compilers/pirc/src/pircompiler.h \
+  compilers/pirc/src/pirsymbol.h \
+  compilers/pirc/src/piryy.h \
+  compilers/pirc/src/pirdefines.h \
+  compilers/pirc/src/pirregalloc.h \
+  compilers/pirc/src/bcgen.h \
+  $(INC_DIR)/embed.h
+
+compilers/pirc/src/pirmacro$(O) : $(PARROT_H_HEADERS) \
+  compilers/pirc/src/pirmacro.h \
+  compilers/pirc/src/pircompunit.h \
+  compilers/pirc/src/pircompiler.h \
+  compilers/pirc/src/pirsymbol.h \
+  compilers/pirc/src/pirdefines.h \
+  compilers/pirc/src/pirregalloc.h \
+  compilers/pirc/src/bcgen.h \
+  $(INC_DIR)/embed.h
+
+compilers/pirc/src/pirop$(O) : $(PARROT_H_HEADERS) \
+  compilers/pirc/src/pircompiler.h \
+  compilers/pirc/src/pircompunit.h \
+  compilers/pirc/src/pirop.h \
+  compilers/pirc/src/pirerr.h \
+  compilers/pirc/src/pirsymbol.h \
+  compilers/pirc/src/piryy.h \
+  compilers/pirc/src/pirdefines.h \
+  compilers/pirc/src/pirregalloc.h \
+  compilers/pirc/src/pirmacro.h \
+  compilers/pirc/src/bcgen.h \
+  $(INC_DIR)/embed.h
+
+compilers/pirc/src/pirpcc$(O) : $(PARROT_H_HEADERS) \
+  compilers/pirc/src/pirpcc.h \
+  compilers/pirc/src/pircompiler.h \
+  compilers/pirc/src/pirerr.h \
+  compilers/pirc/src/pircompunit.h \
+  compilers/pirc/src/pirsymbol.h \
+  compilers/pirc/src/piryy.h \
+  compilers/pirc/src/pirdefines.h \
+  compilers/pirc/src/pirregalloc.h \
+  compilers/pirc/src/pirmacro.h \
+  compilers/pirc/src/bcgen.h \
+  $(INC_DIR)/oplib/ops.h \
+  $(INC_DIR)/embed.h
+
+compilers/pirc/src/pirsymbol$(O) : $(PARROT_H_HEADERS) \
+  compilers/pirc/src/pircompiler.h \
+  compilers/pirc/src/pirsymbol.h \
+  compilers/pirc/src/piryy.h \
+  compilers/pirc/src/pirerr.h \
+  compilers/pirc/src/pircompunit.h \
+  compilers/pirc/src/pirdefines.h \
+  compilers/pirc/src/pirregalloc.h \
+  compilers/pirc/src/pirmacro.h \
+  compilers/pirc/src/bcgen.h \
+  $(INC_DIR)/embed.h
+
+src/gc/malloc_trace$(O) : src/gc/malloc.c
+
+src/packfile/pf_items$(O) : $(PARROT_H_HEADERS)
+
+src/atomic/gcc_x86$(O) : $(PARROT_H_HEADERS) $(INC_DIR)/atomic/gcc_x86.h
+
+$(OPS_DIR)/core_ops$(O) : $(OPS_DIR)/core_ops.c \
+	$(PMC_INC_DIR)/pmc/pmc_callcontext.h \
+	$(PMC_INC_DIR)/pmc/pmc_continuation.h \
+        $(PMC_INC_DIR)/pmc/pmc_parrotlibrary.h \
+        src/io/io_private.h $(INC_DIR)/dynext.h $(INC_DIR)/embed.h \
+        $(INC_DIR)/oplib/core_ops.h $(INC_DIR)/runcore_api.h
 
 # core_ops depends upon config.h so that it gets updated along with
 # updates to config.h's version numbers
@@ -1274,11 +1713,11 @@
 $(OPS_DIR)/core_ops.c : $(OPS_FILES) $(BUILD_TOOLS_DIR)/ops2c.pl \
 	lib/Parrot/OpsFile.pm lib/Parrot/Op.pm $(INC_DIR)/config.h \
 	lib/Parrot/OpLib/core.pm lib/Parrot/OpTrans/C.pm \
-	$(SRC_DIR)/pmc/pmc_continuation.h
+	$(PMC_INC_DIR)/pmc/pmc_continuation.h
 	$(PERL) $(BUILD_TOOLS_DIR)/ops2c.pl C --core @no_lines_flag@
 
 $(OPS_DIR)/core_ops_switch$(O) : $(GENERAL_H_FILES) $(OPS_DIR)/core_ops_switch.c \
-	$(SRC_DIR)/pmc/pmc_parrotlibrary.h
+	$(PMC_INC_DIR)/pmc/pmc_parrotlibrary.h
 
 $(INC_DIR)/oplib/core_ops_switch.h : $(OPS_DIR)/core_ops_switch.c
 
@@ -1304,21 +1743,6 @@
 $(INC_DIR)/vtable.h : src/vtable.tbl $(BUILD_TOOLS_DIR)/vtable_h.pl lib/Parrot/Vtable.pm
 	$(PERL) $(BUILD_TOOLS_DIR)/vtable_h.pl
 
-$(SRC_DIR)/jit_emit.h : $(SRC_DIR)/jit/@jitcpuarch@/jit_emit.h
-	$(CP) $(SRC_DIR)/jit/@jitcpuarch@/jit_emit.h $(SRC_DIR)/jit_emit.h
-$(SRC_DIR)/exec_dep.h : $(SRC_DIR)/jit/@jitcpuarch@/exec_dep.h
-	$(CP) $(SRC_DIR)/jit/@jitcpuarch@/exec_dep.h $(SRC_DIR)/exec_dep.h
-$(SRC_DIR)/jit_cpu.c : lib/Parrot/OpLib/core.pm $(SRC_DIR)/jit_emit.h \
-    $(SRC_DIR)/jit/@jitcpuarch@/core.jit $(JIT_BUILD_TOOL)
-	$(PERL) $(JIT_BUILD_TOOL) @jitcpuarch@ $(SRC_DIR)/jit_cpu.c
-$(SRC_DIR)/jit_defs.c : $(SRC_DIR)/jit/@jitcpuarch@/jit_emit.h \
-	$(SRC_DIR)/jit/@jitcpuarch@/jit_defs.c
-	$(CP) $(SRC_DIR)/jit/@jitcpuarch@/jit_defs.c $(SRC_DIR)/jit_defs.c
-$(SRC_DIR)/exec_cpu.c : lib/Parrot/OpLib/core.pm $(SRC_DIR)/jit_emit.h \
-    $(SRC_DIR)/jit/@jitcpuarch@/core.jit @TEMP_exec_h@ $(SRC_DIR)/exec_dep.h $(JIT_BUILD_TOOL)
-	$(PERL) $(JIT_BUILD_TOOL) @jitcpuarch@ $(SRC_DIR)/exec_cpu.c
- at TEMP_exec_dep@
-
 # imcc file dependencies
 #
 # The .flag files are needed because we keep some derived files in SVN,
@@ -1336,8 +1760,6 @@
 	$(LEX) -o$(IMCC_DIR)/imclexer.c $(IMCC_DIR)/imcc.l
 	$(TOUCH) $(IMCC_DIR)/imcc.l.flag $(IMCC_DIR)/imclexer.c
 
-$(IMCC_O_FILES) : $(IMCC_H_FILES) $(ALL_H_FILES)
-
 ###############################################################################
 #
 # Documentation targets:
@@ -1430,6 +1852,8 @@
 	$(MAKE) compilers/tge
 	$(MAKE) compilers/nqp
 	$(MAKE) compilers/json
+	$(MAKE) compilers/data_json
+	$(MAKE) ext/nqp-rx
 
 compilers-clean :
 	$(MAKE) compilers/pct clean
@@ -1437,8 +1861,17 @@
 	$(MAKE) compilers/tge clean
 	$(MAKE) compilers/nqp clean
 	$(MAKE) compilers/json clean
+	$(MAKE) compilers/data_json clean
 	$(MAKE) compilers/pirc clean
 
+ext-clean:
+	$(MAKE) ext/nqp-rx clean
+	$(RM_RF) runtime/parrot/library/HLL.pbc \
+  runtime/parrot/library/P6Regex.pbc \
+  runtime/parrot/library/Regex.pbc \
+  runtime/parrot/library/nqp-rx.pbc \
+  parrot-nqp*
+
 ###############################################################################
 #
 # editors targets:
@@ -1473,6 +1906,7 @@
     t/src/*.t
 TOOLS_TEST_FILES := \
     t/tools/*.t
+LIBRARY_TEST_FILES := @library_tests@
 PMC2CUTILS_DIR := t/tools/pmc2cutils
 OPS2PMUTILS_DIR := t/tools/ops2pm
 OPS2CUTILS_DIR := t/tools/ops2cutils
@@ -1499,10 +1933,6 @@
 # We probably need a complete build before running the tests.
 test_prep : all
 
-# We always want to test annotations are persisted in PBC during make test.
-test_pbc_annotation_persistence : test_prep
-	$(PERL) t/harness $(EXTRA_TEST_ARGS) -r t/op/annotate.t
-
 # Run test cases with a single call of t/harness. Users have to look at only
 # one report. The default set of tests to run is contained in t/harness,
 # make any edits there. Some tests are run in a separate harness only because
@@ -1512,7 +1942,7 @@
 test : test_core nqp_test
 
 # Test Parrot core.
-test_core: test_prep test_pbc_annotation_persistence
+test_core: test_prep
 	$(PERL) t/harness $(EXTRA_TEST_ARGS)
 
 # Test the NQP compiler
@@ -1523,13 +1953,13 @@
 smolder_test : test_prep
 	$(PERL) t/harness $(EXTRA_TEST_ARGS) --archive --send-to-smolder
 
-smolder_coretest : test_prep
+smolder_coretest : corevm
 	$(PERL) t/harness $(EXTRA_TEST_ARGS) --core-tests --archive --send-to-smolder
 
 smoke : smolder_test
 
 # "core tests" -- test basic functionality but not ancillaries
-coretest : test_prep
+coretest : corevm
 	$(PERL) t/harness $(EXTRA_TEST_ARGS) --core-tests
 
 # automake compatibility
@@ -1543,35 +1973,19 @@
 #IF(cg_flag):	testC \
 	testf \
 #IF(cg_flag):	testg \
-#IF(jitcapable):	testj \
 	testr \
 	testS \
 	src_tests \
 	run_tests \
 	perl_tests \
+	library_tests \
+	nqp_test \
 	codetest \
 	benchmark_tests \
 	manifest_tests \
 	examples_tests \
 	distro_tests
 
-fulltest_all :
-	- at make@ testb
-#IF(cg_flag):	- at make@ testC
-	- at make@ testf
-#IF(cg_flag):	- at make@ testg
-#IF(jitcapable):	- at make@ testj
-	- at make@ testr
-	- at make@ testS
-	- at make@ src_tests
-	- at make@ run_tests
-	- at make@ perl_tests
-	- at make@ codetest
-	- at make@ manifest_tests
-	- at make@ examples_tests
-	- at make@ distro_tests
-	- at make@ benchmark_tests
-
 # bounds checking, slow core
 testb : test_prep
 	$(PERL) t/harness $(EXTRA_TEST_ARGS) -b $(RUNCORE_TEST_FILES)
@@ -1588,9 +2002,13 @@
 testg : test_prep
 	$(PERL) t/harness $(EXTRA_TEST_ARGS) -g $(RUNCORE_TEST_FILES)
 
-# JIT core
+# GC Debug core
+testG : test_prep
+	$(PERL) t/harness $(EXTRA_TEST_ARGS) -G $(RUNCORE_TEST_FILES)
+
+# JIT core - target retained, but falls back to standard core
 testj : test_prep
-	$(PERL) t/harness $(EXTRA_TEST_ARGS) -j $(RUNCORE_TEST_FILES)
+	$(PERL) t/harness $(EXTRA_TEST_ARGS) $(RUNCORE_TEST_FILES)
 
 # normal core, write and run Parrot Byte Code
 testr : test_prep
@@ -1600,13 +2018,13 @@
 testS : test_prep
 	$(PERL) t/harness $(EXTRA_TEST_ARGS) -S $(RUNCORE_TEST_FILES)
 
-# Computed goto jitted core
+# Computed goto jitted core - target retained, but falls back to standard core
 testCj : test_prep
-	$(PERL) t/harness $(EXTRA_TEST_ARGS) -Cj $(RUNCORE_TEST_FILES)
+	$(PERL) t/harness $(EXTRA_TEST_ARGS) $(RUNCORE_TEST_FILES)
 
-# switched jitted core
+# switched jitted core - target retained, but falls back to standard core
 testSj : test_prep
-	$(PERL) t/harness $(EXTRA_TEST_ARGS) -Sj $(RUNCORE_TEST_FILES)
+	$(PERL) t/harness $(EXTRA_TEST_ARGS) $(RUNCORE_TEST_FILES)
 
 # test the EXEC stuff
 testexec: test_prep
@@ -1660,6 +2078,10 @@
 configure_tests :
 	$(PERL) t/harness $(CONFIGURE_TEST_FILES)
 
+# library tests - tests run by make test but not by make fulltest or make cover
+library_tests : test_prep
+	$(PERL) t/harness $(EXTRA_TEST_ARGS) $(LIBRARY_TEST_FILES)
+
 ###############################################################################
 #
 # Cleaning Targets:
@@ -1677,6 +2099,7 @@
     examples-clean \
     imcc-clean \
     compilers-clean \
+    ext-clean \
 #UNLESS(win32):    cover-clean \
     editor-clean
 	@TEMP_cg_r@
@@ -1694,16 +2117,15 @@
     $(INSTALLABLEPARROT) \
     $(INSTALLABLEDIS) \
     $(INSTALLABLEPDUMP) \
-    $(INSTALLABLEPINFO) \
     $(INSTALLABLEPBCMERGE) \
     $(INSTALLABLEPBCTOEXE) \
     $(INSTALLABLEPDB) \
     $(INSTALLABLECONFIG) \
+    $(INSTALLABLENQP) \
     pbc_to_exe.pbc pbc_to_exe.c pbc_to_exe$(O) pbc_to_exe$(EXE) \
     parrot_config$(EXE) parrot_config.c parrot_config$(O) parrot_config.pbc \
     $(IMCC_DIR)/main$(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) \
     $(DIS) $(SRC_DIR)/pbc_disassemble$(O)
@@ -1712,7 +2134,6 @@
     $(SRC_DIR)/null_config$(O) \
     $(SRC_DIR)/parrot_config$(O) \
     $(SRC_DIR)/install_config$(O) \
-    $(SRC_DIR)/exec_start$(O) \
     $(SRC_DIR)/nci_test$(O) \
     $(LIBNCI_TEST_SO) \
     $(SRC_DIR)/glut_callbacks$(O) \
@@ -1721,7 +2142,7 @@
 	$(PERL) $(BUILD_TOOLS_DIR)/c2str.pl --init
 	$(RM_F) \
     $(STR_FILES) \
-    $(SRC_DIR)/string/private_cstring.h "src/pmc/*.c" "src/pmc/pmc_*.h" \
+    $(SRC_DIR)/string/private_cstring.h "src/pmc/*.c" "include/pmc/pmc_*.h" \
     "src/pmc/*.dump" vtable.dump "*.def" "*.lib" "*.exp"
 
 archclean: dynoplibs-clean dynpmc-clean dynext-clean
@@ -1734,13 +2155,12 @@
     $(INSTALLABLEPARROT) \
     $(INSTALLABLEDIS) \
     $(INSTALLABLEPDUMP) \
-    $(INSTALLABLEPINFO) \
     $(INSTALLABLEPBCMERGE) \
     $(INSTALLABLEPDB) \
     $(INSTALLABLECONFIG) \
+    $(INSTALLABLENQP) \
     $(IMCC_DIR)/main$(O) \
     $(PDUMP) $(SRC_DIR)/pbc_dump$(O) $(SRC_DIR)/packdump$(O) \
-    $(PINFO) $(SRC_DIR)/pbc_info$(O) \
     $(PDB) $(SRC_DIR)/parrot_debugger$(O) \
     $(PBCMERGE) $(SRC_DIR)/pbc_merge$(O) \
     $(DIS) $(SRC_DIR)/pbc_disassemble$(O) \
@@ -1750,12 +2170,6 @@
     $(SRC_DIR)/null_config$(O) \
     $(SRC_DIR)/parrot_config$(O) \
     $(SRC_DIR)/install_config$(O) \
-    $(SRC_DIR)/asmfun.s \
-    $(SRC_DIR)/jit_emit.h \
-    $(SRC_DIR)/jit_cpu.c \
-    $(SRC_DIR)/exec_cpu.c \
-    $(SRC_DIR)/jit_defs.c \
-    $(SRC_DIR)/exec_start$(O) \
     install_config.fpmc \
     $(SRC_DIR)/nci_test$(O) \
     $(LIBNCI_TEST_SO) \
@@ -1812,6 +2226,7 @@
     "t/op/*.pbc" \
     "t/oo/*.pbc" \
     "t/pmc/*.pbc" \
+    "t/dynpmc/*.pbc" \
     "t/stress/*.pbc" \
     "t/tools/*.pbc"
 	$(RM_F) \
@@ -1925,7 +2340,7 @@
 
 sunlint :
 	rm -f *.ln
-	$(SUNLINT) $(CC_INC) @cc_hasjit@ "-Isrc/pmc" $(SUNLINTOPTS) $(LINTABLE_CFILES)
+	$(SUNLINT) $(CC_INC) "-Iinclude/pmc" $(SUNLINTOPTS) $(LINTABLE_CFILES)
 
 BSD_LINT_FLAGS := -a -aa -b -c -e -h -n -p -r -u -x -z -F -H -V
 
@@ -1944,7 +2359,7 @@
 
 bsdlint : $(PARROT)
 	rm -f *.ln
-	$(LINT) $(CC_INC) "-Isrc/pmc" $(BSD_LINT_FLAGS) $(BSD_LINT_EXCLUSIONS) $(LINTABLE_CFILES)
+	$(LINT) $(CC_INC) "-Iinclude/pmc" $(BSD_LINT_FLAGS) $(BSD_LINT_EXCLUSIONS) $(LINTABLE_CFILES)
 
 # For checking with splint see also http:////www.perlfoundation.org//parrot//index.cgi?splint
 # Splint: http:////splint.org
@@ -1952,7 +2367,7 @@
 
 # Temp directory for splint.  Add +keep to splintflags if you want work files
 # kept in there after completion.
-SPLINT_TMP := $(TMP)/splint
+SPLINT_TMP := $(TEMPDIR)/splint
 
 # Splint flags: http://splint.org/manual/html/appB.html
 # The dashes in the names don't make any difference to Splint, but I've
@@ -2085,7 +2500,7 @@
 
 splint-all : $(PARROT)
 	$(MKPATH) $(SPLINT_TMP)
-	$(SPLINT) $(CC_INC) @cc_hasjit@ "-Isrc/pmc" "-Icompilers/ast" $(SPLINTFLAGS) $(SPLINTFLAGS_TEST) \
+	$(SPLINT) $(CC_INC) "-Iinclude/pmc" "-Icompilers/ast" $(SPLINTFLAGS) $(SPLINTFLAGS_TEST) \
 	$(SPLINT_SOURCE) \
 	$(SPLINT) $(CC_INC) $(SPLINTFLAGS) $(SPLINTFLAGS_TEST) $(IMCC_DIR)/main.c
 
@@ -2096,7 +2511,7 @@
 
 splint : all
 	$(MKPATH) $(SPLINT_TMP)
-	$(SPLINT) $(CC_INC) @cc_hasjit@ "-Isrc/pmc" "-Icompilers/ast" $(SPLINTFLAGS) $(SPLINTFLAGS_TEST) \
+	$(SPLINT) $(CC_INC) "-Iinclude/pmc" "-Icompilers/ast" $(SPLINTFLAGS) $(SPLINTFLAGS_TEST) \
 	+partial -DNDEBUG \
 	$(SPLINT_SOURCE) \
 		| grep -v 'Source code error generation point'
@@ -2104,15 +2519,20 @@
 COVER_FLAGS := -fprofile-arcs -ftest-coverage
 COVER_DIRS := \
     $(SRC_DIR) \
+    $(SRC_DIR)/call \
     $(SRC_DIR)/dynoplibs \
     $(SRC_DIR)/dynpmc \
     $(SRC_DIR)/gc \
+    $(SRC_DIR)/interp \
     $(SRC_DIR)/ops \
     $(SRC_DIR)/packfile \
     $(SRC_DIR)/pmc \
+    $(SRC_DIR)/runcore \
     $(SRC_DIR)/string \
     $(SRC_DIR)/string/charset \
     $(SRC_DIR)/string/encoding \
+    $(BUILD_DIR) \
+    $(BUILD_DIR)/t/perl \
     $(IO_DIR) \
     $(IMCC_DIR)
 
@@ -2122,13 +2542,17 @@
 #IF(cg_flag):    cover-testC \
     cover-testf \
 #IF(cg_flag):    cover-testg \
-#IF(jitcapable):    cover-testj \
     cover-testr \
     cover-testS \
     cover-src \
+    cover-run \
     cover-perl \
+    cover-extra \
+    cover-nqp \
     cover-codingstd \
     cover-benchmark \
+    cover-manifest \
+    cover-examples \
     cover-distro
 	build_dir=$$PWD; \
     for dir in $(COVER_DIRS); \
@@ -2168,15 +2592,30 @@
 cover-src: cover.dummy
 	- at make@ src_tests
 
+cover-run: cover.dummy
+	- at make@ run_tests
+
 cover-perl: cover.dummy
 	- at make@ perl_tests
 
+cover-extra: cover.dummy
+	- at make@ library_tests
+
+cover-nqp: cover.dummy
+	- at make@ nqp_test
+
 cover-codingstd: cover.dummy
 	- at make@ codingstd_tests
 
 cover-benchmark: cover.dummy
 	- at make@ benchmark_tests
 
+cover-manifest: cover.dummy
+	- at make@ manifest_tests
+
+cover-examples: cover.dummy
+	- at make@ examples_tests
+
 cover-distro: cover.dummy
 	- at make@ distro_tests
 
@@ -2189,7 +2628,10 @@
 #
 ###############################################################################
 
-install: installable
+install: install-bin install-dev-only
+install-dev: install
+
+install-bin: installable
 	$(PERL) tools/dev/install_files.pl \
     --buildprefix=$(BUILDPREFIX) \
     --prefix=$(PREFIX) \
@@ -2202,7 +2644,7 @@
     --versiondir=$(VERSION_DIR) \
     MANIFEST MANIFEST.generated
 
-install-dev: install
+install-dev-only: installable
 	$(PERL) tools/dev/install_dev_files.pl \
     --buildprefix=$(BUILDPREFIX) \
     --prefix=$(PREFIX) \
@@ -2217,6 +2659,14 @@
     --versiondir=$(VERSION_DIR) \
     MANIFEST MANIFEST.generated
 
+install-doc:
+	$(PERL) tools/dev/install_doc_files.pl \
+    --buildprefix=$(BUILDPREFIX) \
+    --prefix=$(PREFIX) \
+    --docdir=$(DOC_DIR) \
+    --versiondir=$(VERSION_DIR) \
+    MANIFEST MANIFEST.generated
+
 ###############################################################################
 #
 # release targets
@@ -2243,17 +2693,21 @@
 #
 ###############################################################################
 
-exec : $(SRC_DIR)/exec_start$(O) $(SRC_DIR)/parrot_config$(O) $(LIBPARROT)
-	$(LINK) @ld_out@$(EXEC)$(EXE) $(EXEC)$(O) $(SRC_DIR)/exec_start$(O) $(SRC_DIR)/parrot_config$(O) @rpath_blib@ $(ALL_PARROT_LIBS) $(LINKFLAGS)
+exec : $(SRC_DIR)/parrot_config$(O) $(LIBPARROT)
+	$(LINK) @ld_out@$(EXEC)$(EXE) $(EXEC)$(O) $(SRC_DIR)/parrot_config$(O) @rpath_blib@ $(ALL_PARROT_LIBS) $(LINKFLAGS)
 
 ###### OS depend targets ##########
 
 # for use by t/pmc/nci.t
-$(LIBNCI_TEST_SO): $(SRC_DIR)/nci_test$(O)
+$(SRC_DIR)/nci_test$(O): $(PARROT_H_HEADERS)
+
+$(LIBNCI_TEST_SO): $(SRC_DIR)/nci_test$(O) $(LIBPARROT)
 	$(LD) $(LD_LOAD_FLAGS) @ncilib_link_extra@ $(LDFLAGS) \
     @ld_out@$@ $(SRC_DIR)/nci_test$(O) $(C_LIBS)
 
 # for use by runtime/parrot/library/OpenGL.pir
+$(SRC_DIR)/glut_callbacks$(O): $(GENERAL_H_FILES)
+
 $(LIBGLUTCB_SO): $(LIBPARROT) $(SRC_DIR)/glut_callbacks$(O)
 	$(LD) $(LD_LOAD_FLAGS) $(LDFLAGS) \
     @ld_out@$@ $(SRC_DIR)/glut_callbacks$(O) \
@@ -2267,7 +2721,6 @@
 	@ctags@ -e \
         --links=no --totals \
         -R --exclude=blib --exclude=.svn  \
-        --exclude=res_lea.c \
         --languages=c,perl --langmap=c:+.h,c:+.pmc,c:+.ops \
         -I NOTNULL,NULLOK,ARGIN,ARGMOD,ARGOUT,ARGINOUT,ARGIN_NULLOK,ARGOUT_NULLOK,ARGMOD_NULLOK \
         $(CUR_DIR)
@@ -2288,7 +2741,6 @@
 	@ctags@ \
     --links=no --totals \
     -R --exclude=blib --exclude=.svn  \
-    --exclude=res_lea.c \
     --languages=c,perl --langmap=c:+.h,c:+.pmc,c:+.ops \
     -I NOTNULL,NULLOK,ARGIN,ARGMOD,ARGOUT,ARGINOUT,ARGIN_NULLOK,ARGOUT_NULLOK,ARGMOD_NULLOK \
     $(CUR_DIR)

Modified: branches/orderedhash_revamp/config/gen/opengl.pm
==============================================================================
--- branches/orderedhash_revamp/config/gen/opengl.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/opengl.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -145,12 +145,14 @@
     AGLRendererInfo         => 'void*',
     AGLPbuffer              => 'void*',
     GDHandle                => 'void*',
+    IOSurfaceRef            => 'void*',
     WindowRef               => 'void*',
     HIViewRef               => 'void*',
     Style                   => 'void*',
     HANDLE                  => 'void*',
     HPBUFFERARB             => 'void*',
     HPBUFFEREXT             => 'void*',
+    HVIDEOINPUTDEVICENV     => 'void*',
     HVIDEOOUTPUTDEVICENV    => 'void*',
     HPVIDEODEV              => 'void*',
     HPGPUNV                 => 'void*',
@@ -162,6 +164,7 @@
     LPPIXELFORMATDESCRIPTOR => 'void*',
     LPVOID                  => 'void*',
     PGPU_DEVICE             => 'void*',
+    GLsync                  => 'void*',
 
     GLchar                  => 'char',
     GLcharARB               => 'char',
@@ -222,10 +225,13 @@
     GLXPbufferSGIX          => 'unsigned long',
     GLXFBConfigIDSGIX       => 'unsigned long',
     GLXVideoSourceSGIX      => 'unsigned long',
+    GLXVideoCaptureDeviceNV => 'unsigned long',
 
     int64_t                 => 'long long',
     INT64                   => 'long long',
+    GLint64                 => 'signed long long',
     GLint64EXT              => 'signed long long',
+    GLuint64                => 'unsigned long long',
     GLuint64EXT             => 'unsigned long long',
 
     FLOAT                   => 'float',
@@ -249,7 +255,7 @@
     long         => 'l',
     size_t       => 'l',
     ptrdiff_t    => 'l',
-    # Requires RT 53406
+    # Requires TT #1182
     # longlong     => 'L',
     float        => 'f',
     double       => 'd',
@@ -276,6 +282,24 @@
     'double***'  => 'p',
 );
 
+my %PCC_TYPE = (
+    c => 'I',
+    s => 'I',
+    i => 'I',
+    l => 'I',
+    f => 'N',
+    d => 'N',
+    t => 'S',
+    p => 'P',
+);
+
+my %PCC_CAST = (
+    I => '(INTVAL) ',
+    N => '(FLOATVAL) ',
+    S => '',
+    P => '',
+);
+
 my %OVERRIDE = (
     'glutInit'  => 'v3p',
 );
@@ -324,12 +348,14 @@
     'GetPixelFormat',
     'SetPixelFormat',
 
-    # Can't handle longlong until RT 53406 is done
+    # Can't handle longlong until TT #1182 is done
     'glBufferAddressRangeNV',
+    'glClientWaitSync',
     'glUniformui64NV',
     'glProgramUniformui64NV',
     'glPresentFrameKeyedNV',
     'glPresentFrameDualFillNV',
+    'glWaitSync',
     'glXSwapBuffersMscOML',
     'glXWaitForMscOML',
     'glXWaitForSbcOML',
@@ -403,6 +429,9 @@
     'GLwDrawAP.h',
     'GLwMDrawA.h',
     'GLwMDrawAP.h',
+
+    # GLFW, a replacement for GLUT
+    'glfw.h',
 );
 
 my $MACRO_FILE = 'runtime/parrot/include/opengl_defines.pasm';
@@ -432,7 +461,7 @@
 
     my @include_paths_win32 = grep /\S/ => split /;/ => ($ENV{INCLUDE} || '');
 
-    my $osname = $conf->data->get_p5('OSNAME');
+    my $osname = $conf->data->get('osname');
     if (scalar @include_paths_win32 == 0 && $osname =~ /mswin32/i) {
         my $cc = $conf->data->get('cc');
         my $path = dirname(dirname(which($cc))) . '\include';
@@ -458,6 +487,7 @@
 
 #         # Portability testing headers
 #         "$ENV{HOME}/src/gentoo3/*.h",
+#         "$ENV{HOME}/src/gentoo4/usr/include/GL/*.h",
 #         "$ENV{HOME}/src/osx/headers/GLUT/*.h",
 #         "$ENV{HOME}/src/osx/headers/OpenGL/*.h",
 #         "$ENV{HOME}/src/osx-10.4/GLUT/*.h",
@@ -550,6 +580,9 @@
             if ($F[2] =~ /^(?:[ACW])?GL[A-Z]*_\w+$/) {
                 push @macros, [$api, $F[1], $F[2]];
             }
+            if ($F[2] =~ /^\(?((?:[ACW])?GL[A-Z]*_\w+)([+-]\d+(?:\.\d*)?(?:e\d+)?)\)?$/) {
+                push @macros, [$api, $F[1], $1, $2];
+            }
             elsif (   $F[2] =~ /^0x[0-9a-fA-F]+$/
                    || $F[2] =~ /^\d+(?:\.\d*)?(?:e\d+)?$/) {
                 $defs{$api}{$F[1]} = $F[2];
@@ -562,15 +595,17 @@
     }
 
     foreach my $macro (@macros) {
-        my ($api, $define, $value) = @$macro;
+        my ($api, $define, $value, $offset) = @$macro;
         my ($val_api) = $value =~ /^((?:[ACW])?GL[A-Z]*)_/;
 
-        unless (defined ($defs{$api}{$define} = $defs{$val_api}{$value})) {
-            delete $defs{$api}{$define};
+        unless (defined $defs{$val_api}{$value}) {
             next if $non_numeric{$define};
 
-            die "'$define' is defined as '$value', but no '$value' has been defined";
+            die "'$define' is defined using '$value', but no '$value' has been defined";
         }
+
+        $defs{$api}{$define}  = $defs{$val_api}{$value};
+        $defs{$api}{$define} += $offset if defined $offset;
     }
 
     open my $macros, '>', $MACRO_FILE
@@ -628,6 +663,9 @@
             next if     /^#/;
             next if     /\btypedef\b/;
 
+            # Skip where we are explicitly told to do so
+            next if /\bFGUNUSED\b/;
+
             # Save a (space compressed) copy of the source line
             # for later error reporting
             my $orig =  $_;
@@ -636,7 +674,8 @@
 
             # Get rid of junk needed for C, but not for Parrot NCI;
             # also do general cleanup to make parsing easier
-            s/\b(?:AVAILABLE|DEPRECATED_FOR)_MAC_OS_X_VERSION_\d+_\d+_AND_LATER\b\s*//;
+            s/\b(?:AVAILABLE|DEPRECATED_(?:IN|FOR))_MAC_OS_X_VERSION_\d+_\d+_AND_LATER\b\s*//;
+            s/\bAVAILABLE_MAC_OS_X_VERSION_\d+_\d+_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_\d+_\d+\b\s*//;
             s/\b__cdecl\b\s*//;
             s/\b__stdcall\b\s*//;
             s/\b_CRTIMP\b\s*//;
@@ -921,15 +960,16 @@
 
         my $args   =  $params;
            $args   =~ s/void//;
-           $args   =~ s/(^|, )(\w+ )+/$1/g;
+           $args   =~ s/unsigned //;
+           $args   =~ s/(^|, )((?:\w+ )+)/$1$PCC_CAST{$PCC_TYPE{$NCI_TYPE{(split ' ', $2)[0]}}}/g;
            $args   =  ", $args" if $args;
         my $proto  =  $params;
            $proto  =~ s/ \w+(,|$)/$1/g;
         my $sig    =  $proto;
            $sig    =~ s/void//;
            $sig    =~ s/unsigned //;
-           $sig    =~ s/(\w)\w+\W*/$1/g;
-           $sig    =  "v$sig";
+           $sig    =~ s/(\w+)\W*/$PCC_TYPE{$NCI_TYPE{$1}}/g;
+           $sig    =  "$sig->";
 
         my $glutcb =  "glutcb${friendly}Func";
            $glutcb =~ s/ //g;
@@ -995,6 +1035,7 @@
 #define PARROT_IN_EXTENSION
 
 #include "parrot/parrot.h"
+#include "parrot/extend.h"
 #include <$glut_header>
 
 
@@ -1064,7 +1105,7 @@
     PMC           *sub   = callback_data[GLUT_CB_TIMER].sub;
 
     if (is_safe(interp, sub))
-        Parrot_runops_fromc_args_event(interp, sub, "vi", data);
+        Parrot_ext_call(interp, sub, "I->", (INTVAL) data);
 }
 
 PARROT_DYNEXT_EXPORT
@@ -1074,7 +1115,7 @@
     callback_data[GLUT_CB_TIMER].interp = interp;
     callback_data[GLUT_CB_TIMER].sub    = sub;
 
-    if (sub == PMCNULL)
+    if (PMC_IS_NULL(sub))
         glutTimerFunc(0, NULL, 0);
     else
         glutTimerFunc(milliseconds, glut_timer_func, data);
@@ -1099,7 +1140,8 @@
     PMC           *sub   = callback_data[GLUT_CB_JOYSTICK].sub;
 
     if (is_safe(interp, sub))
-        Parrot_runops_fromc_args_event(interp, sub, "viiii", buttons, xaxis, yaxis, zaxis);
+        Parrot_ext_call(interp, sub, "IIII->",
+            (INTVAL) buttons, (INTVAL) xaxis, (INTVAL) yaxis, (INTVAL) zaxis);
 }
 
 PARROT_DYNEXT_EXPORT
@@ -1109,7 +1151,7 @@
     callback_data[GLUT_CB_JOYSTICK].interp = interp;
     callback_data[GLUT_CB_JOYSTICK].sub    = sub;
 
-    if (sub == PMCNULL)
+    if (PMC_IS_NULL(sub))
         glutJoystickFunc(NULL, 0);
     else
         glutJoystickFunc(glut_joystick_func, pollinterval);
@@ -1139,7 +1181,7 @@
     PMC           *sub   = callback_data[$_->{enum}].sub;
 
     if (is_safe(interp, sub))
-        Parrot_runops_fromc_args_event(interp, sub, "$_->{sig}"$_->{args});
+        Parrot_ext_call(interp, sub, "$_->{sig}"$_->{args});
 }
 
 PARROT_DYNEXT_EXPORT
@@ -1149,7 +1191,7 @@
     callback_data[$_->{enum}].interp = interp;
     callback_data[$_->{enum}].sub    = sub;
 
-    if (sub == PMCNULL)
+    if (PMC_IS_NULL(sub))
         $_->{glut}(NULL);
     else
         $_->{glut}($_->{thunk});

Modified: branches/orderedhash_revamp/config/gen/parrot_include.pm
==============================================================================
--- branches/orderedhash_revamp/config/gen/parrot_include.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/parrot_include.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -56,6 +56,56 @@
     return \%data;
 }
 
+sub runstep {
+    my ( $self, $conf ) = @_;
+    my $verbose = $conf->options->get('verbose');
+
+    # need vtable.h now
+    system( $^X, "tools/build/vtable_h.pl" );
+
+    my @generated;
+    for my $file ( @{ $self->{source_files} }, @{ $self->{generated_files} } ) {
+        open my $fh, '<', $file or die "Can't open $file: $!\n";
+        my @directives = parse_file($file, $fh);
+        close $fh;
+        for my $d (@directives) {
+            my @defs = perform_directive($d);
+            for my $target ( @{ $d->{files} } ) {
+                $verbose and print "$target ";
+                my $gen;
+                if ( $target =~ /\.pm$/ ) {
+                    $gen = join "\n", &const_to_perl(@defs);
+                    $gen .= "\n1;";
+                }
+                else {
+                    $gen = join "\n", &const_to_parrot(@defs);
+                }
+                $conf->append_configure_log(qq{$self->{destdir}/$target});
+                my $target_tmp = "$target.tmp";
+                open my $out, '>', $target_tmp or die "Can't open $target_tmp: $!\n";
+
+                print $out <<"EOF";
+# DO NOT EDIT THIS FILE.
+#
+# This file is generated automatically from
+# $file by config/gen/parrot_include.pm
+#
+# Any changes made here will be lost.
+#
+$gen
+EOF
+                close $out or die "Can't write $target_tmp: $!\n";
+                $target =~ m[/] or $target = "$self->{destdir}/$target";
+                move_if_diff( $target_tmp, $target );
+                push @generated, $target;
+            }
+        }
+    }
+    $conf->data->set( TEMP_gen_pasm_includes => join( " \\\n    ", @generated ) );
+
+    return 1;
+}
+
 sub const_to_parrot {
     map ".macro_const $_->[0]\t$_->[1]", @_;
 }
@@ -181,56 +231,6 @@
     return @d;
 }
 
-sub runstep {
-    my ( $self, $conf ) = @_;
-    my $verbose = $conf->options->get('verbose');
-
-    # need vtable.h now
-    system( $^X, "tools/build/vtable_h.pl" );
-
-    my @generated;
-    for my $file ( @{ $self->{source_files} }, @{ $self->{generated_files} } ) {
-        open my $fh, '<', $file or die "Can't open $file: $!\n";
-        my @directives = parse_file $file, $fh;
-        close $fh;
-        for my $d (@directives) {
-            my @defs = perform_directive $d;
-            for my $target ( @{ $d->{files} } ) {
-                $verbose and print "$target ";
-                my $gen;
-                if ( $target =~ /\.pm$/ ) {
-                    $gen = join "\n", &const_to_perl(@defs);
-                    $gen .= "\n1;";
-                }
-                else {
-                    $gen = join "\n", &const_to_parrot(@defs);
-                }
-                $conf->append_configure_log(qq{$self->{destdir}/$target});
-                my $target_tmp = "$target.tmp";
-                open my $out, '>', $target_tmp or die "Can't open $target_tmp: $!\n";
-
-                print $out <<"EOF";
-# DO NOT EDIT THIS FILE.
-#
-# This file is generated automatically from
-# $file by config/gen/parrot_include.pm
-#
-# Any changes made here will be lost.
-#
-$gen
-EOF
-                close $out or die "Can't write $target_tmp: $!\n";
-                $target =~ m[/] or $target = "$self->{destdir}/$target";
-                move_if_diff( $target_tmp, $target );
-                push @generated, $target;
-            }
-        }
-    }
-    $conf->data->set( TEMP_gen_pasm_includes => join( " \\\n    ", @generated ) );
-
-    return 1;
-}
-
 1;
 
 # Local Variables:

Modified: branches/orderedhash_revamp/config/gen/platform.pm
==============================================================================
--- branches/orderedhash_revamp/config/gen/platform.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/platform.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -41,46 +41,26 @@
     my ( $self, $conf ) = @_;
 
     my $verbose     = $conf->options->get('verbose');
-    my $platform    = $self->_get_platform( $conf, $verbose );
     my $generated   = $self->_get_generated($conf, $verbose);
 
 
     # headers are merged into platform.h
-    $self->_set_headers($conf, $verbose, $platform, $generated);
+    $self->_set_headers($conf, $verbose, $generated);
 
     # implementation files are merged into platform.c
-    $self->_set_implementations($conf, $verbose, $platform, $generated);
+    $self->_set_implementations($conf, $verbose, $generated);
 
-    $self->_handle_asm($conf, $platform);
+    $self->_handle_asm($conf);
 
     # interface is the same for all platforms
     copy_if_diff( $self->{platform_interface},
         "include/parrot/platform_interface.h" );
 
-    $self->_set_limits($conf, $verbose, $platform);
+    $self->_set_limits($conf, $verbose);
 
     return 1;
 }
 
-sub _get_platform {
-    my $self = shift;
-    my ($conf, $verbose) = @_;
-    my $platform = lc ( $conf->data->get_p5('OSNAME') );
-
-    $platform = "win32" if $platform =~ /^msys/;
-    $platform = "win32" if $platform =~ /^mingw/;
-    $platform =~ s/^ms//;
-
-    if ( ( split m/-/, $conf->data->get_p5('archname'), 2 )[0] eq 'ia64' ) {
-        $platform = 'ia64';
-    }
-
-    $platform = 'generic' unless -d "config/gen/platform/$platform";
-
-    print " platform='$platform' " if $verbose;
-    return $platform;
-}
-
 sub _get_generated {
     my $self = shift;
     my ($conf, $verbose) = @_;
@@ -92,7 +72,8 @@
 
 sub _set_headers {
     my $self = shift;
-    my ($conf, $verbose, $platform, $generated) = @_;
+    my ($conf, $verbose, $generated) = @_;
+    my $platform = $conf->data->get('platform');
     my @headers = qw/
         io.h
         math.h
@@ -196,8 +177,8 @@
 }
 
 sub _set_limits {
-    my $self = shift;
-    my ($conf, $verbose, $platform) = @_;
+    my ($self, $conf) = @_;
+    my $platform = $conf->data->get('platform');
 
     my $limits = "config/gen/platform/generic/platform_limits.h";
     if ( -e "config/gen/platform/$platform/platform_limits.h" ) {
@@ -210,7 +191,8 @@
 
 sub _set_implementations {
     my $self = shift;
-    my ($conf, $verbose, $platform, $generated) = @_;
+    my ($conf, $verbose, $generated) = @_;
+    my $platform = $conf->data->get('platform');
     my @impls = qw/
         time.c
         env.c
@@ -223,6 +205,7 @@
         memexec.c
         exec.c
         misc.c
+        hires_timer.c
         /;
 
     my $plat_c = q{src/platform.c};
@@ -335,8 +318,8 @@
 }
 
 sub _handle_asm {
-    my $self = shift;
-    my ($conf, $platform) = @_;
+    my ($self, $conf) = @_;
+    my $platform = $conf->data->get('platform');
     if ( $conf->data->get('platform_asm') ) {
         my $asm_file = "config/gen/platform/$platform/asm.s";
         if ( -e $asm_file ) {

Modified: branches/orderedhash_revamp/config/gen/platform/ansi/dl.c
==============================================================================
--- branches/orderedhash_revamp/config/gen/platform/ansi/dl.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/platform/ansi/dl.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -11,7 +11,7 @@
 
 =head1 DESCRIPTION
 
-RT#48264
+Dynlib stuff.  (Currently, just placeholders.)
 
 =head2 Functions
 

Modified: branches/orderedhash_revamp/config/gen/platform/ansi/exec.c
==============================================================================
--- branches/orderedhash_revamp/config/gen/platform/ansi/exec.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/platform/ansi/exec.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -11,7 +11,7 @@
 
 =head1 DESCRIPTION
 
-RT#48264
+Functions for dealing with child processes and Execs. (Currently not implemented on this platform.)
 
 =head2 Functions
 
@@ -57,21 +57,6 @@
 
 /*
 
-=item C<void Parrot_Exec_OS_Comman(PARROT_INTERP, STRING *command)>
-
-=cut
-
-*/
-
-void
-Parrot_Exec_OS_Comman(PARROT_INTERP, STRING *command)
-{
-  Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_NOSPAWN,
-         "Exec not implemented");
-}
-
-/*
-
 =back
 
 =cut

Modified: branches/orderedhash_revamp/config/gen/platform/ansi/time.c
==============================================================================
--- branches/orderedhash_revamp/config/gen/platform/ansi/time.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/platform/ansi/time.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -11,7 +11,7 @@
 
 =head1 DESCRIPTION
 
-RT#48264
+Time-related functions.
 
 =head2 Functions
 

Added: branches/orderedhash_revamp/config/gen/platform/darwin/hires_timer.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/config/gen/platform/darwin/hires_timer.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,81 @@
+/*
+ * $Id$
+ * Copyright (C) 2009, Parrot Foundation.
+ */
+
+/*
+
+=head1 NAME
+
+config/gen/platform/generic/hires_timer.c
+
+=head1 DESCRIPTION
+
+High-resolution timer support
+
+=head2 Functions
+
+=over 4
+
+=cut
+
+*/
+
+#include <time.h>
+
+#define TIME_IN_NS(n) ((n).tv_sec * 1000*1000*1000 + (n).tv_nsec)
+
+/*
+
+=item C<UHUGEINTVAL Parrot_hires_get_time(void)>
+
+Return a high-resolution number representing how long Parrot has been running.
+
+=cut
+
+*/
+
+UHUGEINTVAL Parrot_hires_get_time(void)
+{
+    struct timespec ts;
+    struct timeval  tv;
+    gettimeofday(&tv, NULL);
+
+    ts.tv_sec = tv.tv_sec;
+    ts.tv_nsec = tv.tv_usec * 1000;
+
+    return TIME_IN_NS(ts);
+}
+
+/*
+
+=item C<UINTVAL Parrot_hires_get_tick_duration(void)>
+
+Return the number of ns that each time unit from Parrot_hires_get_time represents.
+
+=cut
+
+*/
+
+UINTVAL Parrot_hires_get_tick_duration(void)
+{
+    return (UINTVAL) 1;
+}
+
+
+
+
+/*
+
+=back
+
+=cut
+
+*/
+
+/*
+ * Local variables:
+ *   c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */

Modified: branches/orderedhash_revamp/config/gen/platform/generic/env.c
==============================================================================
--- branches/orderedhash_revamp/config/gen/platform/generic/env.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/platform/generic/env.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -33,8 +33,10 @@
 */
 
 void
-Parrot_setenv(const char *name, const char *value)
+Parrot_setenv(PARROT_INTERP, STRING *str_name, STRING *str_value)
 {
+    char *name  = Parrot_str_to_cstring(interp, str_name);
+    char *value = Parrot_str_to_cstring(interp, str_value);
 #ifdef PARROT_HAS_SETENV
     setenv(name, value, 1);
 #else
@@ -52,9 +54,9 @@
     strcpy(envs + name_len + 1, value);
 
     putenv(envs);
-
-    /* The buffer is intentionally not freed! */
 #endif
+    Parrot_str_free_cstring(name);
+    Parrot_str_free_cstring(value);
 }
 
 /*
@@ -66,13 +68,15 @@
 */
 
 void
-Parrot_unsetenv(const char *name)
+Parrot_unsetenv(PARROT_INTERP, STRING *str_name)
 {
+    char *name = Parrot_str_to_cstring(interp, str_name);
 #ifdef PARROT_HAS_UNSETENV
     unsetenv(name);
 #else
     Parrot_setenv(name, "");
 #endif
+    Parrot_str_free_cstring(name);
 }
 
 /*
@@ -84,10 +88,12 @@
 */
 
 char *
-Parrot_getenv(const char *name, int *free_it)
+Parrot_getenv(PARROT_INTERP, STRING *str_name)
 {
-    *free_it = 0;
-    return getenv(name);
+    char *name  = Parrot_str_to_cstring(interp, str_name);
+    char *value = getenv(name);
+    Parrot_str_free_cstring(name);
+    return value;
 }
 
 /*

Modified: branches/orderedhash_revamp/config/gen/platform/generic/exec.c
==============================================================================
--- branches/orderedhash_revamp/config/gen/platform/generic/exec.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/platform/generic/exec.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,6 +1,6 @@
 /*
  * $Id$
- * Copyright (C) 2004-2008, Parrot Foundation.
+ * Copyright (C) 2004-2009, Parrot Foundation.
  */
 
 /*
@@ -48,24 +48,24 @@
     /* Are we the parent or child? */
     if (child) {
         /* parent */
-        int status;
-        pid_t returnstat;
-        returnstat = waitpid(child, &status, 0);
-        UNUSED(returnstat);
+        int   status;
+        waitpid(child, &status, 0);
         return status;
     }
     else {
-        /* child. Be horribly profligate with memory, since we're
-           about to be something else */
-        int status;
-        status = execlp("sh", "sh", "-c",
-            Parrot_str_to_cstring(interp, command), (void *)NULL);
-        /* if we get here, something's horribly wrong... */
-        if (status) {
+        /* child */
+        char * const cmd    = Parrot_str_to_cstring(interp, command);
+        int          status = execlp("sh", "sh", "-c", cmd, (void *)NULL);
+
+        /* if we get here, something's horribly wrong, but free anyway... */
+        Parrot_str_free_cstring(cmd);
+
+        if (status)
             exit(status);
-        }
     }
-    return 1;    /* make gcc happy */
+
+    /* make gcc happy */
+    return 1;
 }
 
 /*
@@ -96,8 +96,7 @@
     if (child) {
         /* parent */
         int status;
-        pid_t returnstat;
-        returnstat = waitpid(child, &status, 0);
+        pid_t returnstat = waitpid(child, &status, 0);
         UNUSED(returnstat);
         return status;
     }
@@ -105,19 +104,18 @@
         /* child. Be horribly profligate with memory, since we're
            about to be something else */
         int status, i;
-        char **argv;
         STRING *s;
-        char *cmd;
+        char   *cmd;
+        char  **argv = mem_allocate_n_typed((len+1), char*);
 
-        argv = (char **)mem_sys_allocate((len+1)*sizeof (char *));
         for (i = 0; i < len; ++i) {
             s = VTABLE_get_string_keyed_int(interp, cmdargs, i);
             argv[i] = Parrot_str_to_cstring(interp, s);
         }
-        cmd = argv[0];
-        argv[i] = NULL;
 
-        status = execvp(cmd, argv);
+        cmd     = argv[0];
+        argv[i] = NULL;
+        status  = execvp(cmd, argv);
         /* if we get here, something's horribly wrong... */
         if (status) {
             exit(status);
@@ -127,28 +125,6 @@
 }
 
 /*
-
-=item C<void Parrot_Exec_OS_Command(PARROT_INTERP, STRING *command)>
-
-=cut
-
-*/
-
-void
-Parrot_Exec_OS_Command(PARROT_INTERP, STRING *command)
-{
-    /* Be horribly profligate with memory, since we're
-       about to be something else */
-    char *cmd  = Parrot_str_to_cstring(interp, command);
-    int status = execlp("sh", "sh", "-c", cmd, (void *)NULL);
-
-    /* if we get here, something's horribly wrong... */
-    if (status)
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_NOSPAWN,
-            "Exec failed, code %i", status);
-}
-
-/*
  * Local variables:
  *   c-file-style: "parrot"
  * End:

Added: branches/orderedhash_revamp/config/gen/platform/generic/hires_timer.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/config/gen/platform/generic/hires_timer.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,99 @@
+/*
+ * $Id$
+ * Copyright (C) 2009, Parrot Foundation.
+ */
+
+/*
+
+=head1 NAME
+
+config/gen/platform/generic/hires_timer.c
+
+=head1 DESCRIPTION
+
+High-resolution timer support
+
+=head2 Functions
+
+=over 4
+
+=cut
+
+*/
+
+#include "parrot/has_header.h"
+#ifdef PARROT_HAS_HEADER_UNISTD
+#  include    <unistd.h>
+#endif
+
+#include <time.h>
+
+#define TIME_IN_NS(n) ((n).tv_sec * 1000*1000*1000 + (n).tv_nsec)
+
+#ifndef CLOCK_BEST
+#  if defined(CLOCK_PROCESS_CPUTIME_ID)
+#    define CLOCK_BEST CLOCK_PROCESS_CPUTIME_ID
+#  elif defined(CLOCK_PROF)
+#    define CLOCK_BEST CLOCK_PROF
+#  else
+#    define CLOCK_BEST CLOCK_REALTIME
+#  endif
+#endif
+
+/*
+
+=item C<UHUGEINTVAL Parrot_hires_get_time(void)>
+
+Return a high-resolution number representing how long Parrot has been running.
+
+=cut
+
+*/
+
+UHUGEINTVAL Parrot_hires_get_time(void)
+{
+    struct timespec ts;
+    #if _POSIX_TIMERS
+    clock_gettime(CLOCK_BEST, &ts);
+    #else
+    struct timeval  tv;
+    gettimeofday(&tv, NULL);
+
+    ts.tv_sec = tv.tv_sec;
+    ts.tv_nsec = tv.tv_usec * 1000;
+    #endif
+    return TIME_IN_NS(ts);
+}
+
+/*
+
+=item C<UINTVAL Parrot_hires_get_tick_duration(void)>
+
+Return the number of ns that each time unit from Parrot_hires_get_time represents.
+
+=cut
+
+*/
+
+UINTVAL Parrot_hires_get_tick_duration(void)
+{
+    return (UINTVAL) 1;
+}
+
+
+
+
+/*
+
+=back
+
+=cut
+
+*/
+
+/*
+ * Local variables:
+ *   c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */

Modified: branches/orderedhash_revamp/config/gen/platform/generic/platform_limits.h
==============================================================================
--- branches/orderedhash_revamp/config/gen/platform/generic/platform_limits.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/platform/generic/platform_limits.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,6 +1,6 @@
 /*
  * $Id$
- * Copyright (C) 2008, Parrot Foundation.
+ * Copyright (C) 2009, Parrot Foundation.
  */
 
 #ifndef PARROT_PLATFORM_GENERIC_PLATFORM_LIMITS_GUARD
@@ -9,10 +9,25 @@
 /*
  * Define the values for PARROT_INTVAL_MAX and PARROT_INTVAL_MIN
  * in platforms that does no have limits.h or gives wrong values.
- * The generic versions assumes limits.h availability,
- * and does nothing.
+ * The generic versions assumes limits.h availability.
  */
 
+/* LLONG_MAX doesn't appear to be provided for some compilers of Win64, so
+   try to define them here. */
+#include "parrot/has_header.h"
+#if PARROT_HAS_HEADER_LIMITS
+#  include <limits.h>
+#endif
+
+#ifdef _MSC_VER
+#  ifndef LLONG_MAX
+#    define LLONG_MAX _I64_MAX
+#  endif
+#  ifndef LLONG_MIN
+#    define LLONG_MIN _I64_MIN
+#  endif
+#endif
+
 #endif /* PARROT_PLATFORM_GENERIC_PLATFORM_LIMITS_GUARD */
 
 /*

Modified: branches/orderedhash_revamp/config/gen/platform/generic/stat.c
==============================================================================
--- branches/orderedhash_revamp/config/gen/platform/generic/stat.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/platform/generic/stat.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -75,62 +75,62 @@
     }
 
     switch (thing) {
-        case STAT_FILESIZE:
-            result = statbuf->st_size;
-            break;
-        case STAT_ISDIR:
-            result = S_ISDIR(statbuf->st_mode);
-            break;
-        case STAT_ISREG:
-            result = S_ISREG(statbuf->st_mode);
-            break;
-        case STAT_ISDEV:
-            result = S_ISCHR(statbuf->st_mode) || S_ISBLK(statbuf->st_mode);
-            break;
-        case STAT_CREATETIME:
-            result = -1;
-            break;
-        case STAT_ACCESSTIME:
-            result = statbuf->st_atime;
-            break;
-        case STAT_MODIFYTIME:
-            result = statbuf->st_mtime;
-            break;
-        case STAT_CHANGETIME:
-            result = statbuf->st_ctime;
-            break;
-        case STAT_BACKUPTIME:
-            result = -1;
-            break;
-        case STAT_UID:
-            result = statbuf->st_uid;
-            break;
-        case STAT_GID:
-            result = statbuf->st_gid;
-            break;
-        case STAT_PLATFORM_DEV:
-            result = statbuf->st_dev;
-            break;
-        case STAT_PLATFORM_INODE:
-            result = statbuf->st_ino;
-            break;
-        case STAT_PLATFORM_MODE:
-            result = statbuf->st_mode;
-            break;
-        case STAT_PLATFORM_NLINKS:
-            result = statbuf->st_nlink;
-            break;
-        case STAT_PLATFORM_DEVTYPE:
-            result = statbuf->st_rdev;
-            break;
-        case STAT_PLATFORM_BLOCKSIZE:
-            result = statbuf->st_blksize;
-            break;
-        case STAT_PLATFORM_BLOCKS:
-            result = statbuf->st_blocks;
-            break;
-        default:
-            break;
+      case STAT_FILESIZE:
+        result = statbuf->st_size;
+        break;
+      case STAT_ISDIR:
+        result = S_ISDIR(statbuf->st_mode);
+        break;
+      case STAT_ISREG:
+        result = S_ISREG(statbuf->st_mode);
+        break;
+      case STAT_ISDEV:
+        result = S_ISCHR(statbuf->st_mode) || S_ISBLK(statbuf->st_mode);
+        break;
+      case STAT_CREATETIME:
+        result = -1;
+        break;
+      case STAT_ACCESSTIME:
+        result = statbuf->st_atime;
+        break;
+      case STAT_MODIFYTIME:
+        result = statbuf->st_mtime;
+        break;
+      case STAT_CHANGETIME:
+        result = statbuf->st_ctime;
+        break;
+      case STAT_BACKUPTIME:
+        result = -1;
+        break;
+      case STAT_UID:
+        result = statbuf->st_uid;
+        break;
+      case STAT_GID:
+        result = statbuf->st_gid;
+        break;
+      case STAT_PLATFORM_DEV:
+        result = statbuf->st_dev;
+        break;
+      case STAT_PLATFORM_INODE:
+        result = statbuf->st_ino;
+        break;
+      case STAT_PLATFORM_MODE:
+        result = statbuf->st_mode;
+        break;
+      case STAT_PLATFORM_NLINKS:
+        result = statbuf->st_nlink;
+        break;
+      case STAT_PLATFORM_DEVTYPE:
+        result = statbuf->st_rdev;
+        break;
+      case STAT_PLATFORM_BLOCKSIZE:
+        result = statbuf->st_blksize;
+        break;
+      case STAT_PLATFORM_BLOCKS:
+        result = statbuf->st_blocks;
+        break;
+      default:
+        break;
     }
 
     return result;

Modified: branches/orderedhash_revamp/config/gen/platform/netbsd/math.c
==============================================================================
--- branches/orderedhash_revamp/config/gen/platform/netbsd/math.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/platform/netbsd/math.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -22,14 +22,8 @@
 
 */
 
-/*
- * force atan2() to use IEEE behavior
- */
-
 #include <math.h>
 
-_LIB_VERSION_TYPE _LIB_VERSION = _IEEE_;
-
 #if DOUBLE_SIZE == 2 * INT_SIZE
 /*
 

Modified: branches/orderedhash_revamp/config/gen/platform/netbsd/misc.c
==============================================================================
--- branches/orderedhash_revamp/config/gen/platform/netbsd/misc.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/platform/netbsd/misc.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -26,17 +26,23 @@
 =item C<void Parrot_platform_init_code(void)>
 
 Initialize Parrot for the NetBSD platform.
-So far only turns off SIGFPE for Alpha.
+So far turns off SIGFPE for Alpha, and
+ensures IEEE floating-point semantics from
+the math library.
 
 =cut
 
 */
 
 #include <signal.h>
+#include <math.h>
 
 void
 Parrot_platform_init_code(void)
 {
+
+    _LIB_VERSION = _IEEE_;	/* force IEEE math semantics and behaviour */
+
 #if defined(__alpha__)
     signal(SIGFPE, SIG_IGN);
 #endif

Modified: branches/orderedhash_revamp/config/gen/platform/openbsd/memexec.c
==============================================================================
--- branches/orderedhash_revamp/config/gen/platform/openbsd/memexec.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/platform/openbsd/memexec.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -11,7 +11,7 @@
 
 =head1 DESCRIPTION
 
-RT#48264
+Memory protection functions.
 
 =head2 Functions
 

Modified: branches/orderedhash_revamp/config/gen/platform/platform_interface.h
==============================================================================
--- branches/orderedhash_revamp/config/gen/platform/platform_interface.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/platform/platform_interface.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -9,6 +9,7 @@
 ** platform_interface.h
 */
 #include "parrot/config.h"
+#include "parrot/interpreter.h"
 
 /*
 ** I/O:
@@ -48,26 +49,6 @@
 #  define mem_realloc_executable(a, b, c) mem_sys_realloc((a), (c))
 #endif
 
-void* Parrot_memcpy_aligned(void*, void*, size_t);
-
-#if defined(PARROT_HAS_I386_SSE)
-
-typedef void* (*Parrot_memcpy_func_t)(void *dest, const void *src, size_t);
-extern Parrot_memcpy_func_t Parrot_memcpy_aligned_sse;
-
-#  define Parrot_memcpy_aligned(d, s, l) Parrot_memcpy_aligned_sse((d), (s), (l))
-
-#elif defined(PARROT_HAS_I386_MMX)
-
-typedef void* (*Parrot_memcpy_func_t)(void *dest, const void *src, size_t);
-extern Parrot_memcpy_func_t Parrot_memcpy_aligned_mmx;
-
-#  define Parrot_memcpy_aligned(d, s, l) Parrot_memcpy_aligned_mmx((d), (s), (l))
-
-#else
-#  define Parrot_memcpy_aligned(d, s, l) mem_sys_memcopy((d), (s), (l))
-#endif
-
 /*
 ** Time
 */
@@ -84,11 +65,9 @@
  * Env
  */
 
-void Parrot_setenv(const char *name, const char *value);
-void Parrot_unsetenv(const char *name);
-/* free_it is set by the function to either 0 or 1; if set to 1,
-   the return value of the function needs to be mem_sys_free()d after use */
-char * Parrot_getenv(const char *name, int *free_it);
+void Parrot_setenv(PARROT_INTERP, STRING *name, STRING *value);
+void Parrot_unsetenv(PARROT_INTERP, STRING *name);
+char * Parrot_getenv(PARROT_INTERP, STRING *name);
 
 /*
 ** Dynamic Loading:
@@ -126,12 +105,17 @@
 
 #endif
 
+/*
+ * high-resolution timer support
+ */
+
+UHUGEINTVAL Parrot_hires_get_time(void);
+UINTVAL     Parrot_hires_get_tick_duration(void);
+
 
 struct parrot_string_t;
 INTVAL Parrot_Run_OS_Command(Interp*, struct parrot_string_t *);
-void Parrot_Exec_OS_Command(Interp*, struct parrot_string_t *);
 INTVAL Parrot_Run_OS_Command_Argv(Interp*, struct PMC *);
-void Parrot_Exec_OS_Command_Argv(Interp*, struct PMC *);
 
 #endif /* PARROT_PLATFORM_INTERFACE_H_GUARD */
 

Modified: branches/orderedhash_revamp/config/gen/platform/win32/env.c
==============================================================================
--- branches/orderedhash_revamp/config/gen/platform/win32/env.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/platform/win32/env.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -33,9 +33,9 @@
 
 /*
 
-=item C<void Parrot_setenv(const char *name, const char *value)>
+=item C<void Parrot_setenv(PARROT_INTERP, STRING *str_name, STRING *str_value)>
 
-Sets the environment variable C<name> to the value C<value>. Creates the
+Sets the environment variable C<str_name> to the value C<str_value>. Creates the
 environment variable if it does not exist, and silently overwrite a variable if
 it does exist.
 
@@ -44,8 +44,10 @@
 */
 
 void
-Parrot_setenv(const char *name, const char *value)
+Parrot_setenv(PARROT_INTERP, STRING *str_name, STRING *str_value)
 {
+    char * name  = Parrot_str_to_cstring(interp, str_name);
+    char * value = Parrot_str_to_cstring(interp, str_value);
     assert(name  != NULL);
     assert(value != NULL);
 
@@ -66,6 +68,9 @@
             strcpy(envstring + name_len, "=");
             strcpy(envstring + name_len + 1, value);
 
+            Parrot_str_free_cstring(name);
+            Parrot_str_free_cstring(value);
+
             if (_putenv(envstring) == 0) {
                 /* success */
                 mem_sys_free(envstring);
@@ -81,40 +86,37 @@
 
 /*
 
-=item C<char * Parrot_getenv(const char *name, int *free_it)>
+=item C<char * Parrot_getenv(PARROT_INTERP, STRING *str_name)>
 
-Gets the environment variable C<name>, if it exists. Returns status in
-C<free_it>. C<free_it> must be a non-null pointer to an integer to receive the
-status. Status code is 1 on success, 0 on failure. Returns the contents of the
-environment variable in a C<malloc>'d memory location that needs to be freed
-later.
+Gets the environment variable C<str_name>, if it exists. Returns the contents
+of the environment variable in a C<malloc>'d memory location that needs to be
+freed later.
 
 =cut
 
 */
 
 char *
-Parrot_getenv(ARGIN(const char *name), NOTNULL(int *free_it))
+Parrot_getenv(PARROT_INTERP, ARGIN(STRING *str_name))
 {
+    char *name       = Parrot_str_to_cstring(interp, str_name);
     const DWORD size = GetEnvironmentVariable(name, NULL, 0);
     char *buffer     = NULL;
 
     if (size == 0) {
-        *free_it = 0;
+        Parrot_str_free_cstring(name);
         return NULL;
     }
-    else {
-        *free_it = 1;
-    }
     buffer = (char *)mem_sys_allocate(size);
     GetEnvironmentVariable(name, buffer, size);
+    Parrot_str_free_cstring(name);
 
     return buffer;
 }
 
 /*
 
-=item C<void Parrot_unsetenv(const char *name)>
+=item C<void Parrot_unsetenv(PARROT_INTERP, STRING *name)>
 
 Deletes an environment variable by assigning an empty string to the specified variable.
 
@@ -123,13 +125,13 @@
 */
 
 void
-Parrot_unsetenv(const char *name)
+Parrot_unsetenv(PARROT_INTERP, STRING *name)
 {
-/* You can remove a variable from the environment by specifying an empty
-   string -- in other words, by specifying only varname=.
-       -- _putenv, _wputenv (CRT) documentation
-*/
-    Parrot_setenv(name, "");
+    /* You can remove a variable from the environment by specifying an empty
+       string -- in other words, by specifying only varname=.
+           -- _putenv, _wputenv (CRT) documentation
+    */
+    Parrot_setenv(interp, name, Parrot_str_new(interp, "", 0));
 }
 
 /*

Modified: branches/orderedhash_revamp/config/gen/platform/win32/exec.c
==============================================================================
--- branches/orderedhash_revamp/config/gen/platform/win32/exec.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/platform/win32/exec.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -43,7 +43,7 @@
     PROCESS_INFORMATION pi;
     int free_it = 0;
     char* cmd = (char *)mem_sys_allocate(command->strlen + 4);
-    char* shell = Parrot_getenv("ComSpec", &free_it);
+    char* shell = Parrot_getenv(interp, Parrot_str_new(interp, "ComSpec", strlen("ComSpec")));
     char* cmdin = Parrot_str_to_cstring(interp, command);
 
     strcpy(cmd, "/c ");
@@ -62,7 +62,6 @@
     WaitForSingleObject(pi.hProcess, INFINITE);
 
     if (!GetExitCodeProcess(pi.hProcess, &status)) {
-        /* RT#48278 njs Should call GetLastError for failure message? */
         Parrot_warn(interp, PARROT_WARNINGS_PLATFORM_FLAG,
             "Process completed: Failed to get exit code.");
     }
@@ -133,7 +132,6 @@
 
     /* Get exit code. */
     if (!GetExitCodeProcess(pi.hProcess, &status)) {
-        /* RT#48278 njs Should call GetLastError for failure message? */
         Parrot_warn(interp, PARROT_WARNINGS_PLATFORM_FLAG,
             "Process completed: Failed to get exit code.");
     }
@@ -149,94 +147,6 @@
 
 /*
 
-=item C<void Parrot_Exec_OS_Command(PARROT_INTERP, STRING *command)>
-
-Exits parrot and passes control to the specified process. Does not return. Raises an exception
-if the exec fails.
-
-=cut
-
-*/
-
-void
-Parrot_Exec_OS_Command(PARROT_INTERP, STRING *command)
-{
-    int status;
-    char *in = Parrot_str_to_cstring(interp, command);
-    char *cmd = NULL;
-    const char **argv = (const char **)mem_sys_allocate_zeroed(2 * sizeof (int));
-
-    /* Grab string, extract command and parameters. */
-    char *curPos  = in;
-    char *lastCommandStart = in;
-    char seekChar = 0;
-    int argc      = 1;
-    while (*curPos)
-    {
-        /* If we don't have a seek character and this is a quote... */
-        if (seekChar == 0 && (*curPos == '\'' || *curPos == '"'))
-        {
-            seekChar = *curPos;
-            lastCommandStart = curPos;
-        }
-
-        /* If we don't have a seek character and this is not a space... */
-        else if (seekChar == 0 && *curPos != ' ')
-        {
-            if (!seekChar)
-                seekChar = ' ';
-            lastCommandStart = curPos;
-        }
-
-        /* If we seek the seek character... */
-        else if (*curPos == seekChar || (*(curPos + 1) == 0 && seekChar == ' '))
-        {
-            /* Copy what we found to a temporary string. */
-            char *tmp;
-            int lenFound = curPos - lastCommandStart;
-            if (*(curPos + 1) == 0)
-                lenFound++;
-            tmp = (char *)mem_sys_allocate(1 + lenFound);
-            memcpy(tmp, lastCommandStart, lenFound);
-            *(tmp + lenFound) = 0;
-
-            /* Is it command or argument? */
-            if (cmd == NULL)
-            {
-                cmd   = tmp;
-                *argv = tmp;
-            }
-            else
-            {
-                /* Allocate space for another pointer in **argv. */
-                argc++;
-                argv = (const char **)mem_sys_realloc(argv, (argc + 1) * sizeof (int));
-                *(argv + (argc - 1)) = tmp;
-                *(argv + argc) = NULL;
-            }
-
-            /* Clear seek character. */
-            seekChar = 0;
-        }
-
-        /* Move to next character. */
-        curPos ++;
-    }
-
-    /* If we still have a seek char, then the input was improper. */
-    if (seekChar)
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_NOSPAWN,
-            "Exec failed, invalid command string");
-
-    /* Now do the exec. */
-    status = _execvp(cmd, argv);
-    if (status)
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_NOSPAWN,
-            "Exec failed, code %i", status);
-}
-
-/*
-
 =back
 
 =cut

Added: branches/orderedhash_revamp/config/gen/platform/win32/hires_timer.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/config/gen/platform/win32/hires_timer.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,70 @@
+/*
+ * $Id$
+ * Copyright (C) 2009, Parrot Foundation.
+ */
+
+/*
+
+=head1 NAME
+
+config/gen/platform/win32/hires_timer.c
+
+=head1 DESCRIPTION
+
+High-resolution timer support for win32
+
+=head2 Functions
+
+=over 4
+
+=item C<UHUGEINTVAL Parrot_hires_get_time(void)>
+
+Return a high-resolution number representing how long Parrot has been running.
+
+=cut
+
+*/
+
+UHUGEINTVAL Parrot_hires_get_time(void)
+{
+    LARGE_INTEGER ticks;
+    QueryPerformanceCounter(&ticks);
+    return (UHUGEINTVAL) ticks.QuadPart;
+}
+
+/*
+
+=item C<UINTVAL Parrot_hires_get_tick_duration(void)>
+
+Return the number of nanoseconds that each time unit from Parrot_hires_get_time represents.
+
+=cut
+
+*/
+
+UINTVAL Parrot_hires_get_tick_duration(void)
+{
+    LARGE_INTEGER ticks;
+    /* QueryPerformanceCounter returns ticks per second, so divide 1 billion by
+     * that to find the length of each tick */
+    QueryPerformanceFrequency(&ticks);
+    return (UINTVAL) (1000*1000*1000 / ticks.QuadPart);
+}
+
+
+
+
+/*
+
+=back
+
+=cut
+
+*/
+
+/*
+ * Local variables:
+ *   c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */

Modified: branches/orderedhash_revamp/config/gen/platform/win32/stat.c
==============================================================================
--- branches/orderedhash_revamp/config/gen/platform/win32/stat.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/platform/win32/stat.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -93,64 +93,64 @@
     }
 
     switch (thing) {
-        case STAT_FILESIZE:
-            result = statbuf->st_size;
-            break;
-        case STAT_ISDIR:
-            result = S_ISDIR(statbuf->st_mode);
-            break;
-        case STAT_ISREG:
-            result = S_ISREG(statbuf->st_mode);
-            break;
-        case STAT_ISDEV:
-            result = S_ISCHR(statbuf->st_mode) || S_ISBLK(statbuf->st_mode);
-            break;
-        case STAT_CREATETIME:
-            result = -1;
-            break;
-        case STAT_ACCESSTIME:
-            result = statbuf->st_atime;
-            break;
-        case STAT_MODIFYTIME:
-            result = statbuf->st_mtime;
-            break;
-        case STAT_CHANGETIME:
-            result = statbuf->st_ctime;
-            break;
-        case STAT_BACKUPTIME:
-            result = -1;
-            break;
-        case STAT_UID:
-            result = statbuf->st_uid;
-            break;
-        case STAT_GID:
-            result = statbuf->st_gid;
-            break;
-        case STAT_PLATFORM_DEV:
-            result = statbuf->st_dev;
-            break;
-        case STAT_PLATFORM_INODE:
-            result = statbuf->st_ino;
-            break;
-        case STAT_PLATFORM_MODE:
-            result = statbuf->st_mode;
-            break;
-        case STAT_PLATFORM_NLINKS:
-            result = statbuf->st_nlink;
-            break;
-        case STAT_PLATFORM_DEVTYPE:
-            result = statbuf->st_rdev;
-            break;
-        case STAT_PLATFORM_BLOCKSIZE:
-            Parrot_ex_throw_from_c_args(interp, NULL, 1,
+      case STAT_FILESIZE:
+        result = statbuf->st_size;
+        break;
+      case STAT_ISDIR:
+        result = S_ISDIR(statbuf->st_mode);
+        break;
+      case STAT_ISREG:
+        result = S_ISREG(statbuf->st_mode);
+        break;
+      case STAT_ISDEV:
+        result = S_ISCHR(statbuf->st_mode) || S_ISBLK(statbuf->st_mode);
+        break;
+      case STAT_CREATETIME:
+        result = -1;
+        break;
+      case STAT_ACCESSTIME:
+        result = statbuf->st_atime;
+        break;
+      case STAT_MODIFYTIME:
+        result = statbuf->st_mtime;
+        break;
+      case STAT_CHANGETIME:
+        result = statbuf->st_ctime;
+        break;
+      case STAT_BACKUPTIME:
+        result = -1;
+        break;
+      case STAT_UID:
+        result = statbuf->st_uid;
+        break;
+      case STAT_GID:
+        result = statbuf->st_gid;
+        break;
+      case STAT_PLATFORM_DEV:
+        result = statbuf->st_dev;
+        break;
+      case STAT_PLATFORM_INODE:
+        result = statbuf->st_ino;
+        break;
+      case STAT_PLATFORM_MODE:
+        result = statbuf->st_mode;
+        break;
+      case STAT_PLATFORM_NLINKS:
+        result = statbuf->st_nlink;
+        break;
+      case STAT_PLATFORM_DEVTYPE:
+        result = statbuf->st_rdev;
+        break;
+      case STAT_PLATFORM_BLOCKSIZE:
+        Parrot_ex_throw_from_c_args(interp, NULL, 1,
                     "STAT_PLATFORM_BLOCKSIZE not supported");
-            break;
-        case STAT_PLATFORM_BLOCKS:
-            Parrot_ex_throw_from_c_args(interp, NULL, 1,
+        break;
+      case STAT_PLATFORM_BLOCKS:
+        Parrot_ex_throw_from_c_args(interp, NULL, 1,
                     "STAT_PLATFORM_BLOCKS not supported");
-            break;
-        default:
-            break;
+        break;
+      default:
+        break;
     }
 
     return result;

Modified: branches/orderedhash_revamp/config/gen/platform/win32/time.c
==============================================================================
--- branches/orderedhash_revamp/config/gen/platform/win32/time.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/gen/platform/win32/time.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -37,10 +37,10 @@
 Parrot_intval_time(void)
 {
 #if defined(_MSC_VER) && _MSC_VER >= 1400
-#  if INTVAL_SIZE <= 4
-    return _time32(NULL);
+#  ifdef _WIN64
+    return (INTVAL)_time64(NULL);
 #  else
-    return _time64(NULL);
+    return _time32(NULL);
 #  endif
 #else
     return time(NULL);

Modified: branches/orderedhash_revamp/config/init/defaults.pm
==============================================================================
--- branches/orderedhash_revamp/config/init/defaults.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/init/defaults.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -20,8 +20,9 @@
 
 use Config;
 use FindBin;    # see build_dir
-use Parrot::Configure::Step;
 use Parrot::BuildUtil;
+use Parrot::Configure::Step;
+use Parrot::Harness::DefaultTests ();
 use Cwd qw(abs_path);
 use File::Spec;
 
@@ -45,7 +46,11 @@
     # the corresponding values in the Parrot::Configure object.  In
     # order to provide access to the original values from Perl 5
     # %Config, we grab those settings we need now and store them in
-    # special keys within the Parrot::Configure object.
+    # special keys within the Parrot::Configure object.  We label these keys
+    # '_provisional' to alert users that these should only be used during
+    # configuration and testing of configuration steps.  They should not be
+    # used during Parrot's build, nor should they be used in 'make test'.
+    #
     # This is a multi-stage process.
 
     # Stage 1:
@@ -53,13 +58,13 @@
         archname
         ccflags
         d_socklen_t
-        longsize
         optimize
-        sig_name
         scriptdirexp
-        use64bitint
+        sig_name
+        sPRIgldbl
+        sPRIgldbl
     | ) {
-        $conf->data->set_p5( $orig => $Config{$orig} );
+        $conf->data->set( qq|${orig}_provisional| => $Config{$orig} );
     }
 
     # Stage 2 (anticipating needs of config/auto/headers.pm):
@@ -70,7 +75,7 @@
     # Stage 3 (Along similar lines, look up values from Perl 5 special
     # variables and stash them for later lookups.  Name them according
     # to their 'use English' names as documented in 'perlvar'.)
-    $conf->data->set_p5( OSNAME => $^O );
+    $conf->data->set( OSNAME_provisional => $^O );
 
     my $ccdlflags = $Config{ccdlflags};
     $ccdlflags =~ s/\s*-Wl,-rpath,\S*//g if $conf->options->get('disable-rpath');
@@ -134,7 +139,7 @@
 
         libs => $Config{libs},
 
-        cc_inc     => "-I./include",
+        cc_inc     => "-I./include -I./include/pmc",
         cc_debug   => '-g',
         link_debug => '',
 
@@ -243,12 +248,11 @@
         # generate #line directives. These can confuse
         # debugging internals.
         no_lines_flag => $conf->options->get('no-line-directives') ? '--no-lines' : '',
+
+        tempdir => File::Spec->tmpdir,
     );
 
-    # add profiling if needed
-    # RT#41497 gcc syntax
-    # we should have this in the hints files e.g. cc_profile
-    # RT#41496 move profiling to it's own step
+    # TT #855:  Profiling options are too specific to GCC
     if ( $conf->options->get('profile') ) {
         $conf->data->set(
             cc_debug => " -pg ",
@@ -256,13 +260,16 @@
         );
     }
 
+    $conf->data->set( clock_best => "" );
+
     $conf->data->set( 'archname', $Config{archname});
+
     # adjust archname, cc and libs for e.g. --m=32
-    # RT#41499 this is maybe gcc only
-    # RT#41500 adjust lib install-path /lib64 vs. lib
     # remember corrected archname - jit.pm was using $Config('archname')
     _64_bit_adjustments($conf);
 
+    _set_default_tests($conf);
+
     return 1;
 }
 
@@ -296,6 +303,20 @@
     return 1;
 }
 
+sub _set_default_tests {
+    my $conf = shift;
+    $conf->data->set( 'runcore_tests' =>
+        ( join ' ' => @Parrot::Harness::DefaultTests::runcore_tests ) );
+    $conf->data->set( 'core_tests' =>
+        ( join ' ' => @Parrot::Harness::DefaultTests::core_tests ) );
+    $conf->data->set( 'library_tests' =>
+        ( join ' ' => @Parrot::Harness::DefaultTests::library_tests ) );
+    $conf->data->set( 'configure_tests' =>
+        ( join ' ' => @Parrot::Harness::DefaultTests::configure_tests ) );
+    $conf->data->set( 'developing_tests' =>
+        ( join ' ' => @Parrot::Harness::DefaultTests::developing_tests ) );
+}
+
 1;
 
 # Local Variables:

Modified: branches/orderedhash_revamp/config/init/hints.pm
==============================================================================
--- branches/orderedhash_revamp/config/init/hints.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/init/hints.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -36,7 +36,7 @@
 
     my $hints_used = 0;
 
-    my $osname = lc( $conf->data->get_p5('OSNAME') );
+    my $osname = lc( $conf->data->get('OSNAME_provisional') );
     $osname = 'linux' if ($osname eq 'gnukfreebsd');
     my $hints_file = catfile('config', 'init', 'hints', "$osname.pm");
     if ( -f $hints_file ) {

Modified: branches/orderedhash_revamp/config/init/hints/cygwin.pm
==============================================================================
--- branches/orderedhash_revamp/config/init/hints/cygwin.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/init/hints/cygwin.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -73,6 +73,7 @@
         $conf->data->set(cc => 'gcc-4') unless $conf->options->get('cc');
         $conf->data->set(ld => 'g++-4') unless $conf->options->get('ld');
     }
+    $conf->data->set( clock_best => '-DCLOCK_BEST=CLOCK_REALTIME' );
 }
 
 1;

Modified: branches/orderedhash_revamp/config/init/hints/darwin.pm
==============================================================================
--- branches/orderedhash_revamp/config/init/hints/darwin.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/init/hints/darwin.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,4 +1,4 @@
-# Copyright (C) 2005, Parrot Foundation.
+# Copyright (C) 2005-2009, Parrot Foundation.
 # $Id$
 
 package init::hints::darwin;
@@ -6,11 +6,18 @@
 use strict;
 use warnings;
 
+use lib qw( lib );
+use File::Spec ();
+use base qw(Parrot::Configure::Step);
+use Parrot::BuildUtil;
+
 our %defaults = (
     uname           => `uname -r`,
     sw_vers         => `sw_vers -productVersion`,
     problem_flags   => [ qw( ccflags ldflags ) ],
     architectures   => [ qw( i386 ppc64 ppc x86_64 ) ],
+    fink_conf       => q{/sw/etc/fink.conf},
+    ports_base_dir  => q{/opt/local},
 );
 
 sub runstep {
@@ -39,7 +46,22 @@
 
     my $lib_dir = $conf->data->get('build_dir') . "/blib/lib";
     $flagsref->{ldflags} .= " -L$lib_dir";
-    $flagsref->{ccflags} .= " -pipe -fno-common -Wno-long-double ";
+
+    if ($ENV{'MACOSX_DEPLOYMENT_TARGET'} eq '10.6') {
+        $flagsref->{ccflags} .= ' -pipe -fno-common ';
+    }
+    else {
+        $flagsref->{ccflags} .= ' -pipe -fno-common -Wno-long-double ';
+    }
+
+    $flagsref->{linkflags} .= " -undefined dynamic_lookup";
+
+    _probe_for_libraries($conf, $flagsref, 'fink');
+    _probe_for_libraries($conf, $flagsref, 'macports');
+
+    for my $flag ( keys %$flagsref ) {
+        $flagsref->{$flag} =~ s/^\s+//;
+    }
 
     $conf->data->set(
         darwin              => 1,
@@ -51,7 +73,7 @@
         share_ext           => '.dylib',
         load_ext            => '.bundle',
         link                => 'c++',
-        linkflags           => '-undefined dynamic_lookup',
+        linkflags           => $flagsref->{linkflags},
         ld                  => 'c++',
         ld_share_flags      => '-dynamiclib -undefined dynamic_lookup',
         ld_load_flags       => '-undefined dynamic_lookup -bundle',
@@ -86,7 +108,7 @@
 
 sub _strip_arch_flags_engine {
     my ($arches, $stored, $flagsref, $flag) = @_;
-    for my $arch ( @{ $defaults{architectures} } ) {
+    for my $arch ( @{ $arches } ) {
         $stored =~ s/-arch\s+$arch//g;
         $stored =~ s/\s+/ /g;
         $flagsref->{$flag} = $stored;
@@ -144,8 +166,139 @@
     }
 }
 
+sub _probe_for_fink {
+    my $conf = shift;
+    my $verbose = $conf->options->get( 'verbose' );
+    # Per fink(8), this is location for Fink configuration file, presumably
+    # regardless of where Fink itself is installed.
+    my $fink_conf    = $defaults{fink_conf};
+    unless (-f $fink_conf) {
+        print "Fink configuration file not located\n" if $verbose;
+        return;
+    }
+    my $fink_conf_str = Parrot::BuildUtil::slurp_file($fink_conf);
+    my @lines = split /\n/, $fink_conf_str;
+    my $fink_base_dir;
+    while (defined (my $l = shift @lines) ) {
+        chomp $l;
+        next unless $l =~ /^Basepath:\s(.*)/;
+        $fink_base_dir = $1;
+        last;
+    }
+    unless (defined $fink_base_dir) {
+        print "Fink configuration file defective:  no 'Basepath'\n"
+            if $verbose;
+        return;
+    }
+    my $fink_lib_dir = qq{$fink_base_dir/lib};
+    my $fink_include_dir = qq{$fink_base_dir/include};
+    my @unlocateables;
+    foreach my $dir ($fink_base_dir, $fink_lib_dir, $fink_include_dir) {
+        push @unlocateables, $dir unless (-d $dir);
+    }
+    if (@unlocateables) {
+        print "Could not locate Fink directories:  @unlocateables\n"
+            if $verbose;
+        return;
+    }
+    else {
+        my %addl_flags = (
+            linkflags => "-L$fink_lib_dir",
+            ldflags   => "-L$fink_lib_dir",
+            ccflags   => "-I$fink_include_dir",
+        );
+        return \%addl_flags;
+    }
+}
+
+sub _probe_for_macports {
+    my $conf = shift;
+    my $verbose = $conf->options->get( 'verbose' );
+    my $ports_base_dir = $defaults{ports_base_dir};
+    my $ports_lib_dir = qq{$ports_base_dir/lib};
+    my $ports_include_dir = qq{$ports_base_dir/include};
+    my @unlocateables;
+    foreach my $dir ($ports_base_dir, $ports_lib_dir, $ports_include_dir) {
+        push @unlocateables, $dir unless (-d $dir);
+    }
+    if (@unlocateables) {
+        print "Could not locate Macports directories:  @unlocateables\n"
+            if $verbose;
+        return;
+    }
+    else {
+        my %addl_flags = (
+            linkflags => "-L$ports_lib_dir",
+            ldflags   => "-L$ports_lib_dir",
+            ccflags   => "-I$ports_include_dir",
+        );
+        return \%addl_flags;
+    }
+}
+
+sub _probe_for_libraries {
+    my ($conf, $flagsref, $library) = @_;
+    my $no_library_option = "darwin_no_$library";
+    my $title = ucfirst(lc($library));
+    my $verbose = $conf->options->get( 'verbose' );
+    unless ($conf->options->get( $no_library_option ) ) {
+        my $addl_flags_ref;
+        if ($library eq 'fink') {
+            $addl_flags_ref = _probe_for_fink($conf);
+        }
+        if ($library eq 'macports') {
+            $addl_flags_ref = _probe_for_macports($conf);
+        }
+        my $rv = _add_to_flags( $addl_flags_ref, $flagsref, $title, $verbose );
+        return $rv;
+    }
+    return;
+}
+
+sub _add_to_flags {
+    my ( $addl_flags_ref, $flagsref, $title, $verbose ) = @_;
+    if ( defined $addl_flags_ref ) {
+        foreach my $addl ( keys %{ $addl_flags_ref } ) {
+            my %seen;
+            if ( defined $flagsref->{$addl} ) {
+                my @elements = split /\s+/, $flagsref->{$addl};
+                %seen = map {$_, 1} @elements;
+            }
+            $flagsref->{$addl} .= " $addl_flags_ref->{$addl}"
+                unless $seen{ $addl_flags_ref->{$addl} };
+        }
+        print "Probe for $title successful\n" if $verbose;
+    }
+    else {
+        print "Probe for $title unsuccessful\n" if $verbose;
+    }
+    return 1;
+}
+
 1;
 
+################### DOCUMENTATION ###################
+
+=head1 NAME
+
+init::hints::Darwin - hints for the Darwin compiler
+
+=head1 DESCRIPTION
+
+The functionality in this package is run automatically during configuration
+step F<init::hints> when run on Darwin.
+
+Among other things, this step probes for Fink and Macports libraries --
+functionality previously provided by configuration steps F<auto::fink> and
+F<auto::macports>, which have now been eliminated.
+
+Should you not want to search for either of these packages, you may specify
+the command-line options C<darwin_no_fink> and/or C<darwin_no_macports>.
+
+The functionality is tested in F<t/steps/init/hints/darwin-01.t>.
+
+=cut
+
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4

Modified: branches/orderedhash_revamp/config/init/hints/dec_osf.pm
==============================================================================
--- branches/orderedhash_revamp/config/init/hints/dec_osf.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/init/hints/dec_osf.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -11,7 +11,7 @@
 
     # Tru64
     my $ccflags = $conf->data->get('ccflags');
-    if ( $ccflags !~ /-pthread/ ) {
+    if ( $ccflags !~ /-pthread\b/ ) {
         $ccflags .= ' -pthread';
     }
     if ( $ccflags !~ /-D_REENTRANT/ ) {
@@ -24,7 +24,7 @@
     $conf->data->set( ccflags => $ccflags );
 
     my $libs = $conf->data->get('libs');
-    if ( $libs !~ /-lpthread/ ) {
+    if ( $libs !~ /-lpthread\b/ ) {
         $libs .= ' -lpthread';
     }
     $conf->data->set( libs => $libs );
@@ -37,7 +37,7 @@
     }
 
     my $linkflags = $conf->data->get('linkflags');
-    if ( $linkflags !~ /-expect_unresolved/ ) {
+    if ( $linkflags !~ /-expect_unresolved\b/ ) {
         $linkflags = "-expect_unresolved '*' -O4 -msym -std $linkflags";
         $conf->data->set( linkflags => $linkflags );
     }

Modified: branches/orderedhash_revamp/config/init/hints/dragonfly.pm
==============================================================================
--- branches/orderedhash_revamp/config/init/hints/dragonfly.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/init/hints/dragonfly.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -13,7 +13,7 @@
     my $version   = $conf->option_or_data('VERSION');
     my $libs = $conf->data->get('libs');
 
-    $libs .= ' -pthread' unless $libs =~ /pthread/;
+    $libs .= ' -pthread' unless $libs =~ /pthread\b/;
 
     $conf->data->set(
         libs  => $libs,

Modified: branches/orderedhash_revamp/config/init/hints/hpux.pm
==============================================================================
--- branches/orderedhash_revamp/config/init/hints/hpux.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/init/hints/hpux.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -10,7 +10,7 @@
     my ( $self, $conf ) = @_;
 
     my $libs = $conf->data->get('libs');
-    if ( $libs !~ /-lpthread/ ) {
+    if ( $libs !~ /-lpthread\b/ ) {
         $libs .= ' -lpthread';
     }
 

Modified: branches/orderedhash_revamp/config/init/hints/irix.pm
==============================================================================
--- branches/orderedhash_revamp/config/init/hints/irix.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/init/hints/irix.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -21,7 +21,7 @@
     $conf->data->set( ccflags => $ccflags );
 
     my $libs = $conf->data->get('libs');
-    if ( $libs !~ /-lpthread/ ) {
+    if ( $libs !~ /-lpthread\b/ ) {
         $libs .= ' -lpthread';
     }
     $conf->data->set( libs => $libs );

Modified: branches/orderedhash_revamp/config/init/hints/linux.pm
==============================================================================
--- branches/orderedhash_revamp/config/init/hints/linux.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/init/hints/linux.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -23,9 +23,12 @@
     # should find g++ in most cases
     my $link = $conf->data->get('link') || 'c++';
 
-    if ( $libs !~ /-lpthread/ ) {
+    if ( $libs !~ /-lpthread\b/ ) {
         $libs .= ' -lpthread';
     }
+    if ( $libs !~ /-lrt\b/ ) {
+        $libs .= ' -lrt';
+    }
     my $ld_share_flags = $conf->data->get('ld_share_flags');
     my $cc_shared      = $conf->data->get('cc_shared');
 
@@ -33,75 +36,11 @@
 
         # Intel C++ compiler has the same name as its C compiler
         $link = $cc;
-
-        # suppress sprintf warnings that don't apply
-        $ccflags .= ' -wd269';
-
-        # suppress remarks about floating point comparisons
-        $ccflags .= ' -wd1572';
-
-        # suppress remarks about hiding of parameter declarations
-        $ccflags .= ' -wd1599';
-
-        # suppress remarks about "argument is incompatible with corresponding
-        # format string conversion"
-        $ccflags .= ' -wd181';
-
-        # gcc is currently not looking for unused variables, so should icc
-        # for the time being (this will reduce the noise somewhat)
-        $ccflags .= ' -wd869';
-
-        # ignore "operands are evaluated in unspecified order" warning
-        $ccflags .= ' -wd981';
-
-        # ignore "external declaration in primary source file"
-        # (only done temporarily to reduce noise)
-        $ccflags .= ' -wd1419';
-
-        # ignore "function 'xxx' was declared but never referenced"
-        # (only done temporarily to reduce noise)
-        $ccflags .= ' -wd117';
-
-        # ignore "conversion from "" to "" may lose significant bits"
-        # warnings (only done temporarily to reduce noise)
-        $ccflags .= ' -wd810';
-
-        # ignore "function "" was declared but never referenced"
-        # warnings (only done temporarily to reduce noise)
-        $ccflags .= ' -wd177';
-
-        # ignore warnings springing from problems with computed goto
-        # statements.  If someone can find out how to make icc play nicely
-        # in these situations, that would be good.
-        $ccflags .= ' -wd1296';
-
-        $ccflags .= ' -Wall -Wcheck -w2';
-
-        $ccflags .= ' -Wabi';
-        $ccflags .= ' -Wcomment';
-        $ccflags .= ' -Wdeprecated';
-        $ccflags .= ' -Wmain';
-        $ccflags .= ' -Wmissing-prototypes';
-
-        #$ccflags .= ' -Wp64';
-        $ccflags .= ' -Wpointer-arith';
-        $ccflags .= ' -Wreturn-type';
-        $ccflags .= ' -Wstrict-prototypes';
-
-        #$ccflags .= ' -Wtrigraphs';
-        $ccflags .= ' -Wuninitialized';
-        $ccflags .= ' -Wunknown-pragmas';
-        $ccflags .= ' -Wunused-function';
-        $ccflags .= ' -Wunused-variable';
-
-        # enable correct floating point behavior
-        # which is *not* the default behavior. ahem.
-        $ccflags .= ' -we147';
-
         $ld_share_flags = ' -shared -g -pipe -fexceptions -fPIC';
         $cc_shared .= ' -fPIC';
 
-        $verbose and print " ccflags: $ccflags\n";
+        $ccflags = _handle_icc_ccflags($ccflags, $verbose);
+
     }
     elsif ( $cc =~ /suncc/ ) {
         $link = 'sunCC';
@@ -149,13 +88,84 @@
         libparrot_soname       => "-Wl,-soname=libparrot$share_ext.$version",
     );
 
-     if ( ( split( m/-/, $conf->data->get_p5('archname'), 2 ) )[0] eq 'ia64' ) {
+     if ( ( split( m/-/, $conf->data->get('archname_provisional'), 2 ) )[0] eq 'ia64' ) {
 
         $conf->data->set( platform_asm => 1 );
     }
     return;
 }
 
+sub _handle_icc_ccflags {
+    my ($ccflags, $verbose) = @_;
+
+    # suppress sprintf warnings that don't apply
+    $ccflags .= ' -wd269';
+
+    # suppress remarks about floating point comparisons
+    $ccflags .= ' -wd1572';
+
+    # suppress remarks about hiding of parameter declarations
+    $ccflags .= ' -wd1599';
+
+    # suppress remarks about "argument is incompatible with corresponding
+    # format string conversion"
+    $ccflags .= ' -wd181';
+
+    # gcc is currently not looking for unused variables, so should icc
+    # for the time being (this will reduce the noise somewhat)
+    $ccflags .= ' -wd869';
+
+    # ignore "operands are evaluated in unspecified order" warning
+    $ccflags .= ' -wd981';
+
+    # ignore "external declaration in primary source file"
+    # (only done temporarily to reduce noise)
+    $ccflags .= ' -wd1419';
+
+    # ignore "function 'xxx' was declared but never referenced"
+    # (only done temporarily to reduce noise)
+    $ccflags .= ' -wd117';
+
+    # ignore "conversion from "" to "" may lose significant bits"
+    # warnings (only done temporarily to reduce noise)
+    $ccflags .= ' -wd810';
+
+    # ignore "function "" was declared but never referenced"
+    # warnings (only done temporarily to reduce noise)
+    $ccflags .= ' -wd177';
+
+    # ignore warnings springing from problems with computed goto
+    # statements.  If someone can find out how to make icc play nicely
+    # in these situations, that would be good.
+    $ccflags .= ' -wd1296';
+
+    $ccflags .= ' -Wall -Wcheck -w2';
+
+    $ccflags .= ' -Wabi';
+    $ccflags .= ' -Wcomment';
+    $ccflags .= ' -Wdeprecated';
+    $ccflags .= ' -Wmain';
+    $ccflags .= ' -Wmissing-prototypes';
+
+    #$ccflags .= ' -Wp64';
+    $ccflags .= ' -Wpointer-arith';
+    $ccflags .= ' -Wreturn-type';
+    $ccflags .= ' -Wstrict-prototypes';
+
+    #$ccflags .= ' -Wtrigraphs';
+    $ccflags .= ' -Wuninitialized';
+    $ccflags .= ' -Wunknown-pragmas';
+    $ccflags .= ' -Wunused-function';
+    $ccflags .= ' -Wunused-variable';
+
+    # enable correct floating point behavior
+    # which is *not* the default behavior. ahem.
+    $ccflags .= ' -we147';
+
+    $verbose and print " ccflags: $ccflags\n";
+    return $ccflags;
+}
+
 1;
 
 # Local Variables:

Modified: branches/orderedhash_revamp/config/init/hints/mswin32.pm
==============================================================================
--- branches/orderedhash_revamp/config/init/hints/mswin32.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/init/hints/mswin32.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -45,6 +45,8 @@
         $conf->data->set( bindir => Win32::GetShortPathName($bindir) );
     }
 
+    $conf->data->set( clock_best => ' ' );
+
     if ($is_msvc) {
         my $msvcversion = $conf->data->get('msvcversion');
 
@@ -114,6 +116,8 @@
         # Unclear if it's needed both for ld and link.
         $conf->data->set( libparrot_ldflags   => "\"$build_dir\\libparrot.lib\"" );
         $conf->data->set( libparrot_linkflags   => "\"$build_dir\\libparrot.lib\"" );
+        $conf->data->set( inst_libparrot_ldflags   => "\"$bindir\\libparrot.lib\"" );
+        $conf->data->set( inst_libparrot_linkflags   => "\"$bindir\\libparrot.lib\"" );
 
         # 'link' needs to be link.exe, not cl.exe.
         # This makes 'link' and 'ld' the same.

Modified: branches/orderedhash_revamp/config/init/hints/netbsd.pm
==============================================================================
--- branches/orderedhash_revamp/config/init/hints/netbsd.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/init/hints/netbsd.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -9,17 +9,29 @@
 sub runstep {
     my ( $self, $conf ) = @_;
 
+    my $share_ext = $conf->option_or_data('share_ext');
+    my $version   = $conf->option_or_data('VERSION');
+
     my $ccflags = $conf->data->get('ccflags');
-    if ( $ccflags !~ /-pthread/ ) {
+    if ( $ccflags !~ /-pthread\b/ ) {
         $ccflags .= ' -pthread';
     }
     $conf->data->set( ccflags => $ccflags );
 
     my $libs = $conf->data->get('libs');
-    if ( $libs !~ /-lpthread/ ) {
+    if ( $libs !~ /-lpthread\b/ ) {
         $libs .= ' -lpthread';
     }
-    $conf->data->set( libs => $libs );
+    $conf->data->set(
+    libs => $libs,
+    rpath => '-Wl,-R',
+
+    has_dynamic_linking    => 1,
+    parrot_is_shared       => 1,
+    libparrot_shared       => "libparrot$share_ext.$version",
+    libparrot_shared_alias => "libparrot$share_ext",
+    libparrot_soname       => "-Wl,-soname=libparrot$share_ext.$version",
+    );
 }
 
 1;

Modified: branches/orderedhash_revamp/config/init/hints/openbsd.pm
==============================================================================
--- branches/orderedhash_revamp/config/init/hints/openbsd.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/init/hints/openbsd.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -12,13 +12,13 @@
     my $share_ext = $conf->option_or_data('share_ext');
     my $version   = $conf->option_or_data('VERSION');
     my $ccflags = $conf->data->get('ccflags');
-    if ( $ccflags !~ /-pthread/ ) {
+    if ( $ccflags !~ /-pthread\b/ ) {
         $ccflags .= ' -pthread';
     }
     $conf->data->set( ccflags => $ccflags );
 
     my $libs = $conf->data->get('libs');
-    if ( $libs !~ /-lpthread/ ) {
+    if ( $libs !~ /-lpthread\b/ ) {
         $libs .= ' -lpthread';
     }
     $conf->data->set(
@@ -33,10 +33,11 @@
         libparrot_soname       => "-Wl,-soname=libparrot$share_ext.$version",
     );
 
-    if ( ( split( m/-/, $conf->data->get_p5('archname'), 2 ) )[0] eq 'powerpc' ) {
+    if ( ( split( m/-/, $conf->data->get('archname_provisional'), 2 ) )[0] eq 'powerpc' ) {
         $conf->data->set( as => 'as -mregnames' );
     }
 
+    $conf->data->set( clock_best => '-DCLOCK_BEST=CLOCK_MONOTONIC' );
 }
 
 1;

Modified: branches/orderedhash_revamp/config/init/hints/solaris.pm
==============================================================================
--- branches/orderedhash_revamp/config/init/hints/solaris.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/init/hints/solaris.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -10,7 +10,7 @@
     my ( $self, $conf ) = @_;
 
     my $libs = $conf->data->get('libs');
-    if ( $libs !~ /-lpthread/ ) {
+    if ( $libs !~ /-lpthread\b/ ) {
         $libs .= ' -lpthread';
     }
     if ( $libs !~ /-lrt\b/ ) {
@@ -57,7 +57,6 @@
     # code for use in shared libraries.  -KPIC for Sun's compiler, -fPIC for
     # gcc.  We don't know which compiler we're using till after the
     # gccversion test.
-    # RT#43150 Should this go into the shlibs.pl Configure.pl unit instead?
     my $solaris_cc_shared_cb = sub {
         my ( $key, $gccversion ) = @_;
 

Modified: branches/orderedhash_revamp/config/init/optimize.pm
==============================================================================
--- branches/orderedhash_revamp/config/init/optimize.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/init/optimize.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -51,7 +51,7 @@
 
             # use perl5's value
             # gcc 4.1 doesn't like -mcpu=xx, i.e. it's deprecated
-            my $opts = $conf->data->get_p5('optimize');
+            my $opts = $conf->data->get('optimize_provisional');
             my $gccversion = $conf->data->get( 'gccversion' );
             my $arch_opt = 'cpu';
             if ( defined $gccversion and $gccversion > 3.3 ) {

Modified: branches/orderedhash_revamp/config/inter/charset.pm
==============================================================================
--- branches/orderedhash_revamp/config/inter/charset.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/inter/charset.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -68,7 +68,7 @@
     foreach my $charset ( split( /\s+/, $charset_list ) ) {
         $charset =~ s/\.c$//;
         $TEMP_charset_build .= <<END
-src/string/charset/$charset\$(O): src/string/charset/$charset.h src/string/charset/ascii.h src/string/charset/$charset.c \$(NONGEN_HEADERS)
+src/string/charset/$charset\$(O): src/string/charset/$charset.h src/string/charset/ascii.h src/string/charset/$charset.c src/string/charset/tables.h \$(NONGEN_HEADERS)
 
 
 END

Modified: branches/orderedhash_revamp/config/inter/encoding.pm
==============================================================================
--- branches/orderedhash_revamp/config/inter/encoding.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/inter/encoding.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -68,7 +68,7 @@
     foreach my $encoding ( split( /\s+/, $encoding_list ) ) {
         $encoding =~ s/\.c$//;
         $TEMP_encoding_build .= <<END
-src/string/encoding/$encoding\$(O): src/string/encoding/$encoding.h src/string/encoding/$encoding.c \$(NONGEN_HEADERS)
+src/string/encoding/$encoding\$(O): src/string/encoding/$encoding.h src/string/encoding/$encoding.c src/string/unicode.h \$(NONGEN_HEADERS)
 
 
 END

Modified: branches/orderedhash_revamp/config/inter/libparrot.pm
==============================================================================
--- branches/orderedhash_revamp/config/inter/libparrot.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/inter/libparrot.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -46,7 +46,6 @@
     # Parrot can't necessarily handle a pre-existing installed shared
     # libparrot.so. At this point, we don't know the actual name
     # of the shared parrot library. So we try some candidates.
-    # See RT #52288: the check for old_versions should be improved
     my @libs = ('libparrot.so');
     my @libpaths = ('/usr/local/lib', '/usr/lib', $conf->data->get('libdir'));
     if ($^O eq 'MSWin32') {
@@ -56,6 +55,9 @@
     if ($^O eq 'cygwin') {
         @libs = ('libparrot.dll.a');
     }
+    if ($^O eq 'darwin'){
+        @libs = qw/libparrot.dylib libparrot.a/;
+    }
     if (defined $ENV{LD_LIBRARY_PATH}) {
         push @libpaths, (split /:/, $ENV{LD_LIBRARY_PATH});
     }

Modified: branches/orderedhash_revamp/config/inter/make.pm
==============================================================================
--- branches/orderedhash_revamp/config/inter/make.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/inter/make.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -120,7 +120,7 @@
         # get the default value
         my $make_c = $conf->data->get('make_c');
 
-        # RT#43171 this is an ugly hack
+        # TT #1049: this is an ugly hack
         # replace the value for $(MAKE) with the actual path or we'll end up
         # with a variable that recursively refers to itself
         $make_c =~ s/\$\(MAKE\)/$prog/;

Modified: branches/orderedhash_revamp/config/inter/progs.pm
==============================================================================
--- branches/orderedhash_revamp/config/inter/progs.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/config/inter/progs.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -34,12 +34,10 @@
 sub runstep {
     my ( $self, $conf ) = @_;
 
-    my $verbose = _get_verbose($conf);
-
     my $ask = _prepare_for_interactivity($conf);
 
     my $cc;
-    ($conf, $cc) = _get_programs($conf, $verbose, $ask);
+    ($conf, $cc) = _get_programs($conf, $ask);
 
     my $debug = _get_debug($conf, $ask);
 
@@ -55,13 +53,6 @@
     return 1;
 }
 
-sub _get_verbose {
-    my $conf = shift;
-    my $verbose = $conf->options->get('verbose');
-    print "\n" if $verbose;
-    return $verbose;
-}
-
 sub _prepare_for_interactivity {
     my $conf = shift;
     my $ask = $conf->options->get('ask');
@@ -81,7 +72,7 @@
 }
 
 sub _get_programs {
-    my ($conf, $verbose, $ask) = @_;
+    my ($conf, $ask) = @_;
     # Set each variable individually so that hints files can use them as
     # triggers to help pick the correct defaults for later answers.
     my ( $cc, $cxx, $link, $ld, $ccflags, $linkflags, $ldflags, $libs, $lex, $yacc );
@@ -109,16 +100,16 @@
         if $ask;
     $conf->data->set( ccflags => $ccflags );
 
-    $verbose and print " ccflags: $ccflags\n";
+    $conf->options->get('verbose') and print "\nccflags: $ccflags\n";
 
     $linkflags = $conf->data->get('linkflags');
-    $linkflags =~ s/-libpath:\S+//g;    # RT#43174 No idea why.
+    $linkflags =~ s/-libpath:\S+//g;    # TT #854: No idea why.
     $linkflags = integrate( $linkflags, $conf->options->get('linkflags') );
     $linkflags = prompt( "And flags for your linker?", $linkflags ) if $ask;
     $conf->data->set( linkflags => $linkflags );
 
     $ldflags = $conf->data->get('ldflags');
-    $ldflags =~ s/-libpath:\S+//g;      # RT#43174 No idea why.
+    $ldflags =~ s/-libpath:\S+//g;      # TT #854: No idea why.
     $ldflags = integrate( $ldflags, $conf->options->get('ldflags') );
     $ldflags = prompt( "And your $ld flags for building shared libraries?", $ldflags )
         if $ask;
@@ -126,7 +117,7 @@
 
     $libs = $conf->data->get('libs');
     $libs = join q{ },
-        grep { $conf->data->get_p5('OSNAME') =~ /VMS|MSWin/ || !/^-l(c|gdbm(_compat)?|dbm|ndbm|db)$/ }
+        grep { $conf->data->get('OSNAME_provisional') =~ /VMS|MSWin/ || !/^-l(c|gdbm(_compat)?|dbm|ndbm|db)$/ }
         split( q{ }, $libs );
     $libs = integrate( $libs, $conf->options->get('libs') );
     $libs = prompt( "What libraries should your C compiler use?", $libs )

Modified: branches/orderedhash_revamp/docs/book/draft/appc_command_line_options.pod
==============================================================================
--- branches/orderedhash_revamp/docs/book/draft/appc_command_line_options.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/book/draft/appc_command_line_options.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -152,11 +152,6 @@
 to check various optimizations when you run Parrot with the C<-Op>
 switch.
 
-If the extension is F<.o> or equivalent, Parrot generates an object
-file from the JITed program code, which can be used to create a
-standalone executable program. This isn't available on all platforms
-yet; see F<PLATFORMS> for which platforms support this.
-
 =item -r,--run-pbc
 
 Immediately execute bytecode. This is the default unless C<-o> is
@@ -269,31 +264,14 @@
 
 Run the I<computed goto core> (CGoto).
 
-=item -R jit
-
-Run with the I<JIT core> if available.
-
 =item -R cgp
 
 Run with the I<CGoto-Prederefed> core.
 
-=item -R cgp-jit
-
-Run with the I<CGoto-Prederefed with jit> core.
-
 =item -R switch
 
 Run with the I<Switched core>.
 
-=item -R switch-jit
-
-Run with the I<Switched core with jit>.
-
-=item -R exec
-
-Run with the I<exec core>
-(uses JIT at compile time to generate native code)
-
 =item -R gcdebug
 
 Performs a full GC run before every op dispatch

Deleted: branches/orderedhash_revamp/docs/book/draft/ch04_compiler_tools.pod
==============================================================================
--- branches/orderedhash_revamp/docs/book/draft/ch04_compiler_tools.pod	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,273 +0,0 @@
-=pod
-
-=head1 Parrot Compiler Tools
-
-Z<CHP-4>
-
-The previous chapters demonstrated low-level Parrot programming in PIR.  That's
-fun, but Parrot's true power is to host programs written in high level
-languages such as Perl 6, Python, Ruby, Tcl, and PHP.
-
-Parrot's language neutrality was a conscious design decision.  Parrot and Perl
-6 hewed closely in the early days; it would have been easy for the two to
-overlap and intermingle.
-
-By keeping the two projects separate and encapsulated, the possibility arose to
-support many other dynamic languages equally well. This modular design also
-benefits designers of future languages.  Instead of having to reimplement
-low-level features such as garbage collection and dynamic data types, language
-designers and compiler implementers can leave these details of infrastructure
-to Parrot and focus on the syntax, capabilities, and libraries of their
-high-level languages instead.
-
-Parrot exposes a rich interface for these languages to use, offering several
-important features: a robust exceptions system, compilation into
-platform-independent bytecode, a clean extension and embedding interface,
-just-in-time compilation to machine code, native library interface mechanisms,
-garbage collection, support for objects and classes, and a robust concurrency
-model.  Designing a new language or implementing a new compiler for an old
-language is easier with all of these features designed, implemented, tested,
-and supported in a VM already.
-
-Language interoperability is a core goal for Parrot. Different languages are
-suited to different tasks; heated debates explode across the Internet about
-which language is right for which project.  There's rarely a perfect fit.
-Developers often settle for one particular language if only because it offers
-the fewest I<disadvantages>.  Parrot changes this game by allowing developers
-to combine multiple languages seamlessly within a single project.  Well-tested
-libraries written in one languages can interoperate with clean problem-domain
-expression in a second language, glued together by a third language which
-elegantly describes the entire system's architecture.  You can use the
-strengths of multiple language and mitigate their weaknesses.
-
-For language hosting and interoperability to work, languages developers need to
-write compilers that convert source code written in high level languages to
-bytecode.  This process is analogous to how a compiler such as GCC converts C
-or C++ into machine code -- though instead of targeting machine code for a
-specific hardware platform, compilers written in Parrot produce Parrot code
-which can run on any hardware platform that can run Parrot.
-
-Parrot includes a suite of compiler tools for every step of this conversion:
-lexical analysis, parsing, optimization, resource allocation, and code
-generation.  Instead of using traditional low-level languages -- such as the C
-produced by C<lex> and C<yacc> -- to write compilers, Parrot can use any
-language hosted on Parrot in its compiler process.  As a practical matter, the
-prevalent tool uses a subset of the Perl 6 programming language called I<Not
-Quite Perl>X<Not Quite Perl> (NQP) and an implementation of the Perl 6 Grammar
-Engine X<Perl 6 Grammar Engine> (PGE) to build compilers for Parrot.
-
-=begin notetip
-
-Yes, the Perl 6 compiler on Parrot is itself written in Perl 6.  This
-X<bootstrapping> I<bootstrapping> process is mind-boggling at first.
-
-=end notetip
-
-PGE and NQP are part of the Parrot Compiler Tools.  A<CHP-5> Chapter 5
-discusses PGE and A<CHP-6> Chapter 6 explains NQP.
-
-=head2 PCT Overview
-
-The X<Parrot Compiler Tools;PCT> Parrot Compiler Tools (PCT) enable the
-creation of high-level language compilers and runtimes.  Though the Perl 6
-development team originally created these tools to produce Rakudo (Perl 6 on
-Parrot), several other Parrot-hosted compilers use them to great effect.
-Writing a compiler using Perl 6 syntax and dynamic language tools is much
-easier than writing a compiler in C, C<lex>, and C<yacc>.
-
-PCT contains several classes that implement various parts of a compiler. HLL
-developers write language-specific subclasses to fill in the details their
-languages require.  The X<HLLCompiler> C<PCT::HLLCompiler> class specifies the
-compiler's interface and represents the object used to parse and execute code.
-The X<Parrot Compiler Tools;PCT::Grammar> C<PCT::Grammar> and X<Parrot Compiler
-Tools;PCT::Grammar::Actions> C<PCT::Grammar::Actions> classes represent the
-parser and syntax tree generators, respectively. Creating a new HLL compiler is
-as easy as subclassing these three entities with methods specific to your
-language.
-
-=head3 Grammars and Action Files
-
-A PCT-based compiler requires three basic files: the main entry point file, the
-grammar specification file, and the grammar actions file. In addition,
-compilers and the languages they implement often use large libaries of built-in
-routines to provide language-specific behaviors.
-
-=over 4
-
-=item * The main file
-
-The main file is (often) a PIR program which contains the C<:main> function
-that creates and executes the compiler object. This program instantiates a
-C<PCT::HLLCompiler> subclass, loads any necessary support libraries, and
-initializes any compiler- or languages-specific data.
-
-The main file tends to be short.  The guts of the compiler logic is in the
-grammar and actions files.  Runtime support and auxiliary functions often
-appear in other files, by convention.  This separation of concerns tends to
-make compilers easier to maintain.
-
-=item * A grammar file
-
-The high-level language's grammar appears in a F<.pg> file.  This file
-subclasses C<PCT::Grammar> class and implements all of the necessary rules --
-written using PGE -- to parse the languages.
-
-=item * An actions file
-
-Actions contains methods -- written in NQP -- on the C<PCT::Grammar:Actions>
-object which receive parse data from the grammar rules and construct an
-X<Abstract Syntax Tree;Parrot Abstract Syntax Tree;AST;PAST> Abstract Syntax
-Tree (AST).N<The Parrot version of an AST is, of course, the Parrot Abstract
-Syntax Tree, or PAST.>
-
-=back
-
-PCT's workflow is customizable, but simple.  The compiler passes the source
-code of the HLL into the grammar engine.  The grammer engine parses this code
-and returns a X<PGE;Match Object> special Match object which represents a
-parsed version of the code.  The compiler then passes this match object to the
-action methods, which convert it in stages into PAST.  The compiler finally
-converts this PAST into PIR code, which it can save to a file, convert to
-bytecode, or execute directly.
-
-=head3 C<mk_language_shell.pl>
-
-The only way creating a new language compiler could be easier is if these files
-created themselves. PCT includes a tool to do just that:
-C<mk_language_shell.pl>.  This program automatically creates a new directory in
-F<languages/> for your new language, the necessary three files, starter files
-for libraries, a F<Makefile> to automate the build process, and a basic test
-harness to demonstrate that your language works as expects.
-
-These generated files are all stubs which will require extensive editing to
-implement a full language, but they are a well-understood and working starting
-point.  With this single command you can create a working compiler.  It's up to
-you to fill the details.
-
-C<mk_language_shell.pl> prefers to run from within a working Parrot repository.
-It requires a single argument, the name of the new project to create.  There
-are no hard-and-fast rules about names, but the Parrot developers reccomend
-that Parrot-based implementations of existing languages use unique names.
-
-Consider the names of Perl 5 distributions: Active Perl and Strawberry Perl.
-Python implementations are IronPython (running on the CLR) and Jython (running
-on the JVM).  The Ruby-on-Parrot compiler isn't just "Ruby": it's Cardinal.
-The Tcl compiler on Parrot is Partcl.
-
-An entirely new language has no such constraints.
-
-From the Parrot directory, invoke C<mk_language_shell.pl> like:
-
-  $ B<cd languages/>
-  $ B<perl ../tools/build/mk_language_shell.pl <project name>>
-
-=head3 Parsing Fundamentals
-
-An important part of a compiler is the parser and lexical analyzer.  The
-lexical analyzer converts the HLL input file into individual tokens. A token
-may consist of an individual punctuation ("+"), an identifier ("myVar"), a
-keyword ("while"), or any other artifact that stands on its own as a single
-unit.  The parser attempts to match a stream of these input tokens against a
-given pattern, or grammar. The matching process orders the input tokens into an
-abstract syntax tree which the other portions of the compiler can process.
-
-X<top-down parser>
-X<bottom-up parser>
-X<parsers; top-down>
-X<parsers; bottom-up>
-Parsers come in top-down and bottom-up varieties. Top-down parsers start with a
-top-level rule which represents the entire input. It attempts to match various
-combination of subrules until it has consumed the entire input.  Bottom-down
-parsers start with individual tokens from the lexical analyzer and attempt to
-combine them together into larger and larger patterns until they produce a
-top-level token.
-
-PGE is a top-down parser, although it also contains a bottom-up I<operator
-precedence> parser to make processing token clusters such as mathematical
-expressions more efficient.
-
-=head2 Driver Programs
-
-The driver program for the new compiler must create instances of the various
-necessary classes that run the parser. It must also include the standard
-function libraries, create global variables, and handle commandline options.
-PCT provides several useful command-line options, but driver programs may need
-to override several behaviors.
-
-PCT programs can run in two ways.  An interactive mode runs one statement at a
-time in the console.  A file mode loads and runs an entire file at once.  A
-driver program may specificy information about the interactive prompt and
-environment, as well as help and error messages.
-
-=head3 C<HLLCompiler> class
-
-The C<HLLCompiler> class implements a compiler object. This object contains
-references to language-specific parser grammar and actions files, as well as
-the steps involved in the compilation process.  The stub compiler created by
-C<mk_language_shell.pl> might resemble:
-
-  .sub 'onload' :anon :load :init
-      load_bytecode 'PCT.pbc'
-      $P0 = get_hll_global ['PCT'], 'HLLCompiler'
-      $P1 = $P0.'new'()
-      $P1.'language'('MyCompiler')
-      $P1.'parsegrammar'('MyCompiler::Grammar')
-      $P1.'parseactions'('MyCompiler::Grammar::Actions')
-  .end
-
-  .sub 'main' :main
-      .param pmc args
-      $P0 = compreg 'MyCompiler'
-      $P1 = $P0.'command_line'(args)
-  .end
-
-The C<:onload> function creates the driver object as an instance of
-C<HLLCompiler>, sets the necessary options, and registers the compiler with
-Parrot. The C<:main> function drives parsing and execution begin. It calls the
-C<compreg> opcode to retrieve the registered compiler object for the language
-"MyCompiler" and invokes that compiler object using the options received from
-the commandline.
-
-The C<compreg> opcode hides some of Parrot's magic; you can use it multiple
-times in a program to compile and run different languages. You can create
-multiple instances of a compiler object for a single language (such as for
-runtime C<eval>) or you can create compiler objects for multiple languages for
-easy interoperability. The Rakudo Perl 6 C<eval> function uses this mechanism
-to allow runtime eval of code snippets in other languages:
-
-  eval("puts 'Konnichiwa'", :lang<Ruby>);
-
-=head3 C<HLLCompiler> methods
-
-The previous example showed the use of several HLLCompiler methods:
-C<language>, C<parsegrammar>, and C<parseactions>.  These three methods are the
-bare minimum interface any PCT-based compiler should provide.  The C<language>
-method takes a string argument that is the name of the compiler. The
-HLLCompiler object uses this name to register the compiler object with Parrot.
-The C<parsegrammar> method creates a reference to the grammar file that you
-write with PGE. The C<parseactions> method takes the class name of the NQP file
-used to create the AST-generator for the compiler.
-
-If your compiler needs additional features, there are several other available
-methods:
-
-=over 4
-
-=item * C<commandline_prompt>
-
-The C<commandline_prompt> method allows you to specify a custom prompt to
-display to users in interactive mode.
-
-=item * C<commandline_banner>
-
-The C<commandline_banner> method allows you to specify a banner message that
-displays at the beginning of interactive mode.
-
-=back
-
-=cut
-
-# Local variables:
-#   c-file-style: "parrot"
-# End:
-# vim: expandtab shiftwidth=4:

Deleted: branches/orderedhash_revamp/docs/book/draft/ch05_pge.pod
==============================================================================
--- branches/orderedhash_revamp/docs/book/draft/ch05_pge.pod	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,1558 +0,0 @@
-=pod
-
-=head1 Grammar Engine
-
-X<Parrot Grammar Engine>
-X<PGE (Parrot Grammar Engine)>
-The Parrot Grammar Engine (PGE) is a parser generator, one of the key
-components of the Parrot Compiler Toolkit. It reads grammar files written in
-the PGE rules format and generates parser modules written in PIR code. PGE
-rules provide the full power of I<recursive descent parsing> and I<operator
-precedence parsing>. Fortunately, you don't need to know what those terms
-mean in order to make good use of PGE. We'll introduce the necessary
-concepts as we talk about various features in this chapter.
-
-=head2 Grammars
-
-The ultimate goal of a parser is to match patterns in a source language and
-convert them to an internal data structure for later manipulations. As a
-programmer, you're probably already familiar with some of these types of
-patterns: function declarations, function calls, statements, and assignments.
-Each of these different concepts have a particular form called a I<syntax>.
-In C for example, the syntax to define a function looks something like this:
-
-  <return_type> <function_name> ( <arguments> ) { <function_body> }
-
-Things that fit this pattern, so long as all the sub-patterns use the proper
-syntax also, are valid subroutines in C. Similarly, we can use a slightly
-different pattern to create a subroutine:
-
-  sub <function_name> { <function_body> }
-
-A grammar is a collection of rules like the ones above that specify all the
-acceptable patterns in a language. Grammars group together these rules in
-much the same way that a groups together related data fields and methods
-N<In languages like Perl 6 for instance, a grammar is just a special kind
-of class and a rule is just a special kind of method.>. Each rule defines
-a pattern for matching one unit of text, and can be made up of various other
-rules which are called recursively to make a complete match.
-
-A rule can contain regular expressions to match patterns of characters:
-
-  rule id { \d+ }
-
-A rule can also contain patterns of references to other rules:
-
-  rule record { <id> <name> <phone> }
-
-A grammar contains a group of rules that work together to match the entire
-language:
-
-  grammar Contacts;
-
-  rule name { 'John' | 'Bob ' | 'Fred' }
-
-  rule id   { \d+ }
-
-  rule record { <id> <name> }
-
-  ...
-
-=head3 Rules and Tokens
-
-X<rule>
-X<token>
-There are two different kinds of rules: C<rule>, which we saw above, and
-C<token>. A C<rule> performs smart whitespace matching between the various
-pieces of the pattern. The C<record> rule given previously would match
-"6355 John" or "6355      John" but not "6355John".
-
-A C<token> matches whitespace only if you specifically request it. To get the
-same effect with a token, add the C<\s> (match a space character) and C<+>
-(match the preceding atom -- the space character, in this case -- one or more
-times) pattern to the rule:
-
-  token record { <id> \s+ <name> }
-
-=head3 The Start Rule
-
-X<top>
-X<top-down parser>
-A recursive descent parser is what's called a I<top-down parser>. It starts
-at the highest-level rule, called C<TOP>, and works its way down through
-individual rules to match an entire string or file. Real Perl 6 allows any
-name for the top-level rule, but PCT expects a rule called C<TOP>. If PCT
-was as fully-featured as Perl 6, people would use it instead! Here's an
-example of a TOP rule:
-
-  rule TOP { <record> }
-
-This rule matches a single C<record> pattern in a string or file. Once the
-parser has succeeded in matching the entire string or file passed to the
-start rule, it returns a parse tree. If it cannot match the entire input
-with the rules provided, it can either return a partial match, or it can
-throw a parse error.
-
-=head3 Testing a Grammar
-
-Let's do a small example grammar. Save this example to a file called
-F<Contacts.pg>:
-
-  grammar Contacts is PGE::Grammar;
-
-  rule  TOP    { <record> }
-  rule  record { <id> <name> }
-  token name   { 'John' | 'Bob ' | 'Fred' }
-  token id     { \d+ }
-
-Then compile the grammar:
-
-  $ B<parrot Perl6Grammar.pbc --output=Contacts.pir Contacts.pg>
-
-=for author
-
-Assume an installed Parrot for all examples?  Anyone working from the source
-tree should be able to mangle paths appropriately.
-
-=end for
-
-The path to F<parrot> and to the F<Perl6Grammar.pbc> file will vary on
-different systems. If you compiled Parrot from source, it will be:
-
-  $ B<./parrot runtime/parrot/library/PGE/Perl6Grammar.pbc \>
-        B<--output=Contacts.pir Contacts.pg>
-
-Next, create a small PIR script to run your grammar. Save it as
-F<grammar_test.pir>:
-
-=begin PIR
-
-  .sub main :main
-      load_bytecode 'PGE.pbc'        # load some required modules
-      load_bytecode 'dumper.pbc'
-      load_bytecode 'PGE/Dumper.pbc'
-
-      load_bytecode 'Contacts.pir'   # load your grammar
-
-      .local string source
-      source  = "3 John"
-
-      .local pmc top, grammar, match
-      top     = get_hll_global ['Contacts'], 'TOP'
-      grammar = get_class 'Contacts'
-      match   = top(source, 'grammar' => grammar)
-
-      _dumper(match, "match")
-  .end
-
-=end PIR
-
-Run the test script:
-
-  $ B<parrot grammar_test.pir>
-
-It will print out a text representation of the raw parse tree stored in the
-C<match> variable:
-
-  "match" => PMC 'Contacts' => "3 John" @ 0 {
-      <record> => PMC 'Contacts' => "3 John" @ 0 {
-          <id> => PMC 'Contacts' => "3" @ 0
-          <name> => PMC 'Contacts' => "John" @ 2
-      }
-  }
-
-Each node in the tree corresponds to a rule in the grammar.  The top-level
-match variable contains one child named C<record>, which contains two children
-named C<id> and C<name>.  C<id> contains the number 3, and C<name> contains the
-string "John". This is exactly what the simple grammar should have matched.
-
-=head2 Rule Syntax
-
-Every language has a set of basic components (words or parts of words) and
-syntax conventions for combining them. The "words" in rules are literal
-characters or symbols, some X<metacharacters> metacharacters (or metasymbols),
-and X<rules;escape sequences>X<escape sequences, rules> escape sequences, while
-the combining syntax includes other metacharacters, X<quantifiers, rules>
-X<rules;quantifiers> quantifiers, bracketing characters, and assertions.
-
-=head3 Metacharacters
-
-The C<.> metacharacter matches any single character, even a newline character.
-The C<^> and C<$> metacharacters are zero-width matches which represent the
-beginning and end of a string. They each have doubled alternates C<^^> and
-C<$$> that match at the beginning and end of every (newline-delimited) line
-within a string.
-
-The C<|>, C<&>, C<\>, C<#>, and C<:=> metacharacters are all syntax structure
-elements. C<|> alternates between two options. C<&> matches two patterns
-simultaneously (the patterns must be the same length). C<\> turns literal
-characters into metacharacters (producing escape sequences). C<#> starts a
-comment which proceeds until the end of the line. You can start a comment at
-any point on any line in a rule. C<:=> binds a hypothetical variable to the
-result of a subrule or grouped pattern (see L<Hypothetical Variables>).
-
-The metacharacters C<()>, C<[]>, C<{}> and C<E<lt>E<gt>> are bracketing pairs.
-Bracketing pairs must always be balanced within the rule; to use a literal
-character, escape it with a C<\>.  The C<()> and C<[]> pairs group patterns as
-a single atom. They often capture a result, mark the boundaries of an
-alternation, or mark a group of patterns with a quantifier. Parentheses C<()>
-capture, but square brackets C<[]> do not. The C<{}> brackets define a section
-of code (a closure) within a rule. These closures are always a successful
-zero-width match. The C<E<lt>...E<gt>> brackets mark assertions, which handle a
-variety of constructs including character classes and user-defined quantifiers
-(see L<Assertions>).
-
-Table 7-2 summarizes the basic metacharacters.
-
-=begin table picture Metacharacters
-
-Z<CHP-7-TABLE-2>
-
-=headrow
-
-=row
-
-=cell Symbol
-
-=cell Meaning
-
-=bodyrows
-
-=row
-
-=cell C<.>
-
-=cell Match any single character, including a newline.
-X<. (dot);. match single character (rules)>
-
-=row
-
-=cell C<^>
-
-=cell Match the beginning of a string.
-X<^ (caret);^ beginning of string (rules)>
-
-=row
-
-=cell C<$>
-
-=cell Match the end of a string.
-X<$ (dollar sign);$ end of string (rules)>
-
-=row
-
-=cell C<^^>
-
-=cell Match the beginning of a line within the string.
-X<^ (caret);^^ beginning of line (rules)>
-
-=row
-
-=cell C<$$>
-
-=cell Match the end of a line within the string.
-X<$ (dollar sign);$$ end of line (rules)>
-
-=row
-
-=cell C<|>
-
-=cell Match alternate patterns (OR).
-
-=row
-
-=cell C<&>
-
-=cell Match multiple patterns (AND).
-
-=row
-
-=cell C<\>
-
-=cell Escape a metacharacter to get a literal character, or escape a
-literal character to get a metacharacter.
-X<\ (backslash);\ escape sequences (rules)>
-X<\ (backslash);\ to escape metacharacters (rules)>
-
-=row
-
-=cell C<#>
-
-=cell Mark a comment (to the end of the line).
-
-=row
-
-=cell C<:=>
-
-=cell Bind the result of a match to a hypothetical variable.
-X<: (colon);:= (binding);in rules>
-
-=row
-
-=cell C<(...)>
-
-=cell Group patterns and capture the result.
-
-=row
-
-=cell C<[...]>
-
-=cell Group patterns without capturing.
-
-=row
-
-=cell C<{...}>
-
-=cell Execute a closure (Perl 6 code) within a rule.
-
-=row
-
-=cell C<E<lt>...E<gt>>
-
-=cell Match an assertion.
-
-=end table
-
-=head3 Escape Sequences
-
-Z<CHP-7-SECT-2.2>
-
-X<escape sequences, rules>
-X<rules;escape sequences>
-X<\ (backslash);\ escape sequences (rules)>
-
-Escape sequences are literal characters acting as metacharacters.  A preceding
-backslash (C<\>) identifies them as escapes. Some escape sequences represent
-single characters that are difficult to represent literally, such as C<\t> for
-tab, or C<\x[...]> to specify a character by its hexadecimal number.  Some
-represent limited character classes, such as C<\d> for digits or C<\w> for word
-characters. Some represent zero-width positions in a match, such as C<\b> for a
-word boundary.
-
-X<variable interpolation in rules>
-X<rules;variable interpolation>
-If you've used Perl 5 regexps, you may remember the C<\Q> escape sequence which
-treats everything until the following C<\E> sequence as literal text,
-containing no escape sequences.  Because ordinary variables now interpolate as
-literal strings by default, the C<\Q> escape sequence is rarely needed.
-
-A<CHP-7-TABLE-3>Table 7-3 shows the escape sequences for rules.
-
-=begin table picture Escape sequences
-
-Z<CHP-7-TABLE-3>
-
-=headrow
-
-=row
-
-=cell Escape
-
-=cell Meaning
-
-=bodyrows
-
-=row
-
-=cell C<\0[...]>
-
-=cell Match a character given in octal (brackets optional).
-
-=row
-
-=cell C<\b>
-
-=cell Match a word boundary.
-
-=row
-
-=cell C<\B>
-
-=cell Match when not on a word boundary.
-
-=row
-
-=cell C<\c[...]>
-
-=cell Match a named character or control character.
-
-=row
-
-=cell C<\C[...]>
-
-=cell Match any character except the bracketed named or control character.
-
-=row
-
-=cell C<\d>
-
-=cell Match a digit.
-
-=row
-
-=cell C<\D>
-
-=cell Match a non-digit.
-
-=row
-
-=cell C<\e>
-
-=cell Match an escape character.
-
-=row
-
-=cell C<\E>
-
-=cell Match anything but an escape character.
-
-=row
-
-=cell C<\f>
-
-=cell Match the form feed character.
-
-=row
-
-=cell C<\F>
-
-=cell Match anything but a form feed.
-
-=row
-
-=cell C<\n>
-
-=cell Match a (logical) newline.
-
-=row
-
-=cell C<\N>
-
-=cell Match anything but a (logical) newline.
-
-=row
-
-=cell C<\h>
-
-=cell Match horizontal whitespace.
-
-=row
-
-=cell C<\H>
-
-=cell Match anything but horizontal whitespace.
-
-=row
-
-=cell C<\L[...]>
-
-=cell Everything within the brackets is lowercase.
-
-=row
-
-=cell C<\Q[...]>
-
-=cell All metacharacters within the brackets match as literal characters.
-
-=row
-
-=cell C<\r>
-
-=cell Match a return.
-
-=row
-
-=cell C<\R>
-
-=cell Match anything but a return.
-
-=row
-
-=cell C<\s>
-
-=cell Match any whitespace character.
-
-=row
-
-=cell C<\S>
-
-=cell Match anything but whitespace.
-
-=row
-
-=cell C<\t>
-
-=cell Match a tab.
-
-=row
-
-=cell C<\T>
-
-=cell Match anything but a tab.
-
-=row
-
-=cell C<\U[...]>
-
-=cell Everything within the brackets is uppercase.
-
-=row
-
-=cell C<\v>
-
-=cell Match vertical whitespace.
-
-=row
-
-=cell C<\V>
-
-=cell Match anything but vertical whitespace.
-
-=row
-
-=cell C<\w>
-
-=cell Match a word character (Unicode alphanumeric characters plus the
-underscore C<_>).
-
-=row
-
-=cell C<\W>
-
-=cell Match anything but a word character.
-
-=row
-
-=cell C<\x[...]>
-
-=cell Match a character given in hexadecimal (brackets optional).
-
-=row
-
-=cell C<\X[...]>
-
-=cell Match anything but the character given in hexadecimal (brackets
-optional).
-
-=end table
-
-=head3 Quantifiers
-
-Z<CHP-7-SECT-2.3>
-
-Quantifiers specify the number of times an atom (a single character,
-metacharacter, escape sequence, grouped pattern, assertion, etc) will match.
-
-X<. (dot);.. (range);quantifier (rules)>
-X<. (dot);... (infinite range);quantifier (rules)>
-The numeric quantifiers use assertion syntax. A single number (C<E<lt>3E<gt>>)
-requires exactly that many matches. A numeric range quantifier
-(C<E<lt>3C<..>5E<gt>>) succeeds if the number of matches is between the minimum
-and maximum numbers, inclusive. A range with three trailing dots
-(C<E<lt>2...E<gt>>) is shorthand for C<E<lt>R<n>..InfE<gt>>; it matches as many
-times as possible.
-
-Each quantifier has a minimal alternate form -- marked with a trailing C<?> --
-which matches the shortest possible sequence first.  That is, given the string
-C<aaaaaa>, C<aE<lt>3C<..>5E<gt>> will match C<aaaaa> and C<aE<lt>3C<..>5E<gt>?>
-will match C<aaa>.
-
-A<CHP-7-TABLE-4>Table 7-4 shows the built-in
-X<quantifiers, rules> X<rules;quantifiers> quantifiers.
-
-=begin table picture Quantifiers
-
-Z<CHP-7-TABLE-4>
-
-=headrow
-
-=row
-
-=cell Maximal
-
-=cell Minimal
-
-=cell Meaning
-
-=bodyrows
-
-=row
-
-=cell C<*>
-
-=cell C<*?>
-
-=cell Match 0 or more times.
-
-=row
-
-=cell C<+>
-
-=cell C<+?>
-
-=cell Match 1 or more times.
-
-=row
-
-=cell C<?>
-
-=cell C<??>
-
-=cell Match 0 or 1 times.
-
-=row
-
-=cell C<E<lt>>R<n>C<E<gt>>
-
-=cell C<E<lt>>R<n>C<E<gt>?>
-
-=cell Match exactly R<n> times.
-
-=row
-
-=cell C<E<lt>>R<n>C<..>R<m>C<E<gt>>
-
-=cell C<E<lt>>R<n>C<..>R<m>C<E<gt>?>
-
-=cell Match at least R<n> and no more than R<m> times.
-
-=row
-
-=cell C<E<lt>>R<n>C<...E<gt>>
-
-=cell C<E<lt>>R<n>C<...E<gt>?>
-
-=cell Match at least R<n> times.
-
-=end table
-
-=head3 Assertions
-
-Z<CHP-7-SECT-2.4>
-
-X<assertions, rules>
-X<rules;assertions>
-An assertion states that some condition or state is true. The match fails when
-that assertion is false.
-
-X<variable interpolation in rules>
-X<rules;variable interpolation>
-
-Assertions match named and anonymous rules, arrays or hashes containing
-anonymous rules, and subroutines or closures that return anonymous rules.
-
-To interpolate a variable in assertion rules, enclose it in assertion
-delimiters.
-A bare scalar in a pattern
-interpolates as a literal string, while a scalar variable in assertion
-brackets interpolates as an anonymous rule. A bare array in a pattern
-matches as a series of alternate literal strings, while an array in
-assertion brackets interpolates as a series of alternate anonymous
-rules.
-
-A bare hash in a pattern matches a word (C<\w+>) if and only if that word is
-one of its keysN<The effect is similar to matching the keys as a series of
-alternates, but it prefers to match the longest possible key, instead of the
-first potential match.>, while a hash in assertion brackets also matches the
-associated value as an anonymous rule.
-
-X<fail keyword>
-A bare closure in a pattern always matches (unless it calls C<fail>), but a
-closure in assertion brackets C<E<lt>{...}E<gt>> must return an anonymous rule
-to match.
-
-An assertion with parentheses C<E<lt>(...)E<gt>> resembles a bare closure in a
-pattern in that it allows you to include Perl code within a rule.
-C<E<lt>(...)E<gt>> evaluates the return value of the closure in boolean
-context. The match succeeds or fails based on that return value.
-
-Assertions match character classes, both named and enumerated. A named rule
-character class is often more accurate than an enumerated character class. The
-common C<E<lt>[a-zA-Z]E<gt>> idiom matches ASCII alphabetic characters, but the
-more comprehensive built-in rule C<E<lt>alphaE<gt>> matches the full set of
-Unicode alphabetic characters.
-
-A<CHP-7-TABLE-5>Table 7-5 shows the syntax of assertions.
-
-=begin table picture Assertions
-
-Z<CHP-7-TABLE-5>
-
-=headrow
-
-=row
-
-=cell Syntax
-
-=cell Meaning
-
-=bodyrows
-
-=row
-
-=cell C<E<lt>...E<gt>>
-
-=cell Generic assertion delimiter.
-
-=row
-
-=cell C<E<lt>!...E<gt>>
-
-=cell Negate any assertion.
-
-=row
-
-=cell C<E<lt>>R<name>C<E<gt>>
-
-=cell Match a named rule or character class.
-
-=row
-
-=cell C<E<lt>[...]E<gt>>
-
-=cell Match an enumerated character class.
-
-=row
-
-=cell C<E<lt>-...E<gt>>
-
-=cell Complement a character class (named or enumerated).
-
-=row
-
-=cell C<E<lt>"..."E<gt>>
-
-=cell Match a literal string (interpolated at match time).
-
-=row
-
-=cell C<E<lt>'...'E<gt>>
-
-=cell Match a literal string (not interpolated).
-
-=row
-
-=cell C<E<lt>(...)E<gt>>
-
-=cell Boolean assertion. Execute a closure and match if it returns a true
-result.
-
-=row
-
-=cell C<E<lt>$scalarE<gt>>
-
-=cell Match an anonymous rule.
-
-=row
-
-=cell C<E<lt>@arrayE<gt>>
-
-=cell Match a series of anonymous rules as alternates.
-
-=row
-
-=cell C<E<lt>%hashE<gt>>
-
-=cell Match a key from the hash, then its value (as an anonymous rule).
-
-=row
-
-=cell C<E<lt>E<amp>sub()E<gt>>
-
-=cell Match an anonymous rule returned by a sub.
-
-=row
-
-=cell C<E<lt>{>R<code>C<}E<gt>>
-
-=cell Match an anonymous rule returned by a closure.
-
-=row
-
-=cell C<E<lt>.E<gt>>
-
-=cell Match any logical grapheme, including combining character sequences.
-
-=end table
-
-=head3 Modifiers
-
-Z<CHP-7-SECT-2.5>
-
-X<modifiers>
-X<: (colon);: modifier delimiter in rules>
-Modifiers alter the meaning of a pattern. The standard position for modifiers
-is at the beginning of the rule, right after the C<m>, C<s>, or C<rx>, or after
-the name in a named rule. Modifiers cannot attach to the outside of a bare
-C</.../>. For example:
-
-  m:i/marvin/ # case insensitive
-  rule names :i { marvin | ford | arthur }
-
-You may group single-character modifiers, but you must separate longer
-modifiers by colons:
-
-  m:wig/ zaphod /                        # OK
-  m:words:ignorecase:globally / zaphod / # OK
-  m:wordsignorecaseglobally / zaphod /   # Not OK
-
-Most modifiers can also appear inside the rule when attached to rule or
-grouping delimiters. Internal modifiers are lexically scoped to their enclosing
-delimiters, so can alter subpatterns:
-
-  m/:w I saw [:i zaphod] / # only 'zaphod' is case insensitive
-
-The repetition modifiers (C<:R<N>x>, C<:R<N>th>, C<:once>, C<:globally>, and
-C<:exhaustive>) and the continue modifier (C<:cont>) alter the return value of
-the rule as a whole, so you cannot use them lexically inside a rule.
-
-The C<:R<N>x> modifier matches the rule a specific number of times. If the
-modifier expects more matches than the string has, the match fails.  Its
-alternate form (C<:x(R<N>)>) can take a variable in place of the number.
-
-The C<:once> modifier on a rule only allows it to match once. The rule will not
-match again until the you call the C<.reset> method on the rule object.
-
-The C<:globally> modifier matches as many times as possible. The C<:exhaustive>
-modifier also matches as many times as possible, in as many different ways as
-possible.
-
-The C<:R<N>th> modifier preserves one result from a particular counted match.
-If the rule matches fewer times than the modifier expects, the match fails. It
-has several alternate forms. One form, C<:th(R<N>)>, takes a variable in place
-of the number. The other forms -- C<:R<N>st>, C<:R<N>nd>, and C<:R<N>rd> --
-allow you to write more naturally C<:1st>, C<:2nd>, C<:3rd>.  The other way is
-valid as well; choose whichever is most comfortable.
-
-By default, rules ignore literal whitespace within the pattern.  The C<:w>
-modifier makes rules sensitive to literal whitespace, but in an intelligent
-way. Any cluster of literal whitespace acts like an explicit C<\s+> when it
-separates two identifiers and C<\s*> everywhere else.
-
-I<No> modifiers exist to treat the matched string as a single line or multiple
-lines.  Instead, use the "beginning of string" and "end of string" or
-"beginning of line" and "end of line" metacharacters.
-
-A<CHP-7-TABLE-6>Table 7-6 lists the available modifiers.
-
-=begin table picture Modifiers
-
-Z<CHP-7-TABLE-6>
-
-=headrow
-
-=row
-
-=cell Short
-
-=cell Long
-
-=cell Meaning
-
-=bodyrows
-
-=row
-
-=cell C<:i>
-
-=cell C<:ignorecase>
-
-=cell Case-insensitive match.
-
-=row
-
-=cell C<:I>
-
-=cell
-
-=cell Case-sensitive match (on by default).
-
-=row
-
-=cell C<:c>
-
-=cell C<:cont>
-
-=cell Continue where the previous match on the string left off.
-
-=row
-
-=cell C<:w>
-
-=cell C<:words>
-
-=cell Literal whitespace in the pattern matches as C<\s+>
-or C<\s*>.
-
-=row
-
-=cell C<:W>
-
-=cell
-
-=cell Turn off intelligent whitespace matching (return to default).
-
-=row
-
-=cell
-
-=cell :R<N>C<x>/C<:x(>R<N>C<)>
-
-=cell Match the pattern R<N> times.
-
-=row
-
-=cell
-
-=cell C<:>R<N>C<th>/C<:nth(>R<N>C<)>
-
-=cell Match the R<N>th occurrence of a pattern.
-
-=row
-
-=cell
-
-=cell C<:once>
-
-=cell Match the pattern once and only once.
-
-=row
-
-=cell C<:g>
-
-=cell C<:globally>
-
-=cell Match the pattern as many times as possible without overlapping
-possibilities.
-
-=row
-
-=cell C<:e>
-
-=cell C<:exhaustive>
-
-=cell Match every possible occurrence of a pattern, including overlapping
-possibilities.
-
-=row
-
-=cell
-
-=cell C<:u0>
-
-=cell . is a byte.
-
-=row
-
-=cell
-
-=cell C<:u1>
-
-=cell . is a Unicode codepoint.
-
-=row
-
-=cell
-
-=cell C<:u2>
-
-=cell . is a Unicode grapheme.
-
-=row
-
-=cell
-
-=cell C<:u3>
-
-=cell . is language dependent.
-
-=row
-
-=cell
-
-=cell C<:p5>
-
-=cell The pattern uses Perl 5 regex syntax.
-
-=end table
-
-=head3 Built-in Rules
-
-Z<CHP-7-SECT-3>
-
-X<rules;built-in>
-PGE provides several named rules, including a complete set of X<POSIX-style
-classes> POSIX-style classes, and X<Unicode property classes> Unicode property
-classes. The list isn't fully defined yet, but A<CHP-7-TABLE-7>Table 7-7 shows
-a few you're likely to see.
-
-The C<E<lt>nullE<gt>> rule matches a zero-width string (it always matches) and
-C<E<lt>priorE<gt>> matches whatever the most recent successful rule matched.
-These replace the two behaviors of X</ (slash);// invalid null pattern>
-X<invalid null pattern //> the Perl 5 null pattern C<//>, which is no longer
-valid syntax for rules.
-
-=begin table picture Built-in rules
-
-Z<CHP-7-TABLE-7>
-
-=headrow
-
-=row
-
-=cell Rule
-
-=cell Meaning
-
-=bodyrows
-
-=row
-
-=cell C<E<lt>alphaE<gt>>
-
-=cell Match a Unicode alphabetic character.
-
-=row
-
-=cell C<E<lt>digitE<gt>>
-
-=cell Match a Unicode digit.
-
-=row
-
-=cell C<E<lt>spE<gt>>
-
-=cell Match a single space character (the same as C<\s>).
-
-=row
-
-=cell C<E<lt>wsE<gt>>
-
-=cell Match any whitespace (the same as C<\s+>).
-
-=row
-
-=cell C<E<lt>nullE<gt>>
-
-=cell Match the null string.
-
-=row
-
-=cell C<E<lt>priorE<gt>>
-
-=cell Match the same thing as the previous match.
-
-=row
-
-=cell C<E<lt>before ...E<gt>>
-
-=cell Zero-width lookahead. Assert that the current position I<precedes> a
-pattern.
-
-=row
-
-=cell C<E<lt>after ...E<gt>>
-
-=cell Zero-width lookbehind. Assert that the current position I<follows> a
-pattern.
-
-=row
-
-=cell C<E<lt>prop ...E<gt>>
-
-=cell Match any character with the named property.
-
-=row
-
-=cell C<E<lt>replace(...)E<gt>>
-
-=cell Replace everything matched so far in the rule or subrule with the
-given string (under consideration).
-
-=end table
-
-=head3 Backtracking Control
-
-Z<CHP-7-SECT-4>
-
-X<backtracking controls>
-X<fail keyword>
-Whenever part of the pattern fails to match, PGE performs backtracking --
-backing up to the previous point at which the match could succeed and trying
-again.  You can explicitly trigger backtracking by calling the C<fail> function
-within a closure. A<CHP-7-TABLE-8>Table 7-8 displays metacharacters and
-built-in rules relevant to backtracking.
-
-=for author
-
-This could use an example.
-
-=end for
-
-=begin table picture Backtracking controls
-
-Z<CHP-7-TABLE-8>
-
-=headrow
-
-=row
-
-=cell Operator
-
-=cell Meaning
-
-=bodyrows
-
-=row
-
-=cell C<:>
-
-=cell Don't retry the previous atom.  Instead, fail to the next earlier atom.
-X<: (colon);: fail to atom before last (rules)>
-X<backtracking controls;: fail to atom before last>
-
-=row
-
-=cell C<::>
-
-=cell Don't backtrack over this point. Instead fail out of the closest
-enclosing group (C<(...)>, C<[...]>, or the rule delimiters).
-X<: (colon);:: fail out of group (rules)>
-X<backtracking controls;: fail out of group>
-
-=row
-
-=cell C<:::>
-
-=cell Don't backtrack over this point.  Instead, fail out of the current rule
-or subrule.
-X<: (colon);::: fail out of rule (rules)>
-X<backtracking controls;: fail out of rule>
-
-=row
-
-=cell C<E<lt>commitE<gt>>
-
-=cell Don't backtrack over this point. Instead, fail out of the entire match
-(even from within a subrule).
-
-=row
-
-=cell C<E<lt>cutE<gt>>
-
-=cell Like C<E<lt>commitE<gt>>, but also cuts the string matched. The current
-matching position at this point becomes the new beginning of the string.
-
-=end table
-
-=head3 Calling Actions
-
-Once the parser has matched the entire input N<a source code file, or a line of
-input at the terminal in interactive mode> the parse has succeeded.  The
-generated AST is now available to the code generator for conversion into PIR.
-
-=for author
-
-Please review.  The forward declaration is awkward here, but a little bit of
-explanation might ameliorate this.
-
-=end for
-
-This AST gets built up by actions -- code snippets attached to rules and
-tokens.  To call an action, insert the C<{*}> token into the rule. When PGE
-encounters C<{*}>, it will call the associated action method with the current
-match object as an argument.
-
-The best way to demonstrate this is by example.  Sprinkle the C<persons_name>
-rule liberally with action calls:
-
- rule persons_name {
-    {*} <first_name> {*} <last_name> {*}
- }
-
-The first call to the action method contains an empty match object because the
-parser hasn't matched anything yet.  The second call contains only the first
-name of the match. The third and final call contains both the matched first and
-last name.
-
-If the match fails halfway through, PGE will still call the actions that have
-succeeded; it will not call the actions after the failure.  If you try to match
-the string "Leia", PGE will call the first two action methods.  When the rule
-tries to match the last name, it fails, and PGE will not call the third action
-method.
-
-=head3 Alternations and Keys
-
-In addition to sub-rules, groups, and quantifiers, you can also express
-either-or alternations between options. The vertical bar token (C<|>)
-distinguishes between options where only one may match:
-
- rule hero {
-    ['Luke' | 'Leia'] 'Skywalker'
- }
-
-This rule will match either "Luke Skywalker" or "Leia Skywalker" but won't
-match "Luke Leia Skywalker"N<nor anything else.>.  Given alternations and
-action methods, it's often important to distinguish which alternation matched:
-
- rule hero {
-    [
-      'Luke' {*}    #= Luke
-    | 'Leia' {*}    #= Leia
-    ]
-    'Skywalker'
- }
-
-This is the same rule, except now it passes two arguments to its action method:
-the match object and the name of the person who matched.
-
-=head3 Warning: Left Recursion
-
-If you've worked with parsers before, you may have seen this coming.  If not,
-don't fear.  Like functions in ordinary procedural or functional languages, the
-methods in the PGE parser grammar can call themselves recursively.  Consider
-some rules derived in part from the grammar for the C programming language:
-
- rule if_statement {
-    'if' <condition> '{' <statement>* '}' <else_block>?
- }
-
- rule statement {
-    <if_statement> | <expression>
- }
-
- rule else_block {
-    'else' '{' <statements>* '}'
- }
-
-An C<if_statement> can contain a list of C<statement>s, and that each statement
-may itself be an C<if_statement>.  This is I<recursion> X<Recursion>; it's one
-of the reasons PGE is a "Recursive descent" parser.
-
-Consider the more direct example of a comma-separated list of integer digits
-which form a list.  A recursive definition might be:
-
- rule list {
-     <list> ',' <digit> | <digit>
- }
-
-If there is only one digit, the second option in the alternation matches.  If
-there are multiple digits, recursion will match them through the first
-alternation.
-
-That's the intention.  The results are insidious.
-
-The recursive descent parser enters the C<list> rule. Its first option is to
-enter the list rule again, so it does.  Recursive descent is a X<depth-first
-algorithm> depth-first algorithm; PGE will continue to descend down a
-particular path until it finds a successful match or a match failure. In this
-case, it matches C<list>, then it matches C<list> again, then it matches
-C<list> again, and so on.  This rule forms an infinite loop -- a pattern called
-X<left recursion> I<left recursion>.  The problem is that the left-most item of
-the left-most alternation is itself a recursion.
-
-The rule above does not recurse infinitely when rewritten as:
-
- rule list {
-    <digit> | <list> ',' <digit>
- }
-
-... or even:
-
- rule list {
-    <digit> ',' <list> | <digit>
- }
-
-Both options ensure that the left-most item in the rule is recursive.
-
-Left recursion may be trickier.  It's not immediately obvious in this grammar:
-
- rule term {
-    <expression> '*' <term> | <digit>
- }
-
- rule expression {
-    <term> '+' <expression> | <term>
- }
-
-Even this common, limited subset of mathematical equations has the same
-problem.  To match a C<term>, the parser first tries to match an C<expression>,
-which in turn matches a C<term> and then an C<expression> ....
-
-Again, the solution is simple.  Rewrite at least one of the rules so that the
-first condition it tries to match is not itself a recursive situation.
-
-=head3 Operator Precedence Parser
-
-Recursive descent parsing can be inefficient where statements have lots of
-little tokens and many possible options to match.  For example, mathematical
-expressions are very open-ended, with many valid forms which are difficult to
-anticipate.  Consider the expression:
-
- a + b * c + d
-
-A recursive descent parser will undergo significant trial and error to parse
-this statement.  Recursive descent parsing is not ideal for these situations.
-Instead, a type of bottom-up parser called an I<operator precedence> X<Parser,
-Operator precedence> parser is much better.
-
-=for author
-
-Is this a categorization of all opps or just PGE's opp?
-
-=end for
-
-Operator precedence parsers work similarly to more versatile bottom-up parsers
-such as Lex or Yacc, but are optimized for use with expressions and equations.
-Equations have two subtypes, I<terms> and I<operators>. Operators themselves
-have several subtypes, including prefix (C<-a>), postfix (C<i++>), infix (C<x +
-y>), circumfix (C<[z]>), postcircumfix (C<a[b]>), and list (C<1, 2, 3>). Each
-operator gets its own precedence number that specifies how closely it binds to
-the terms. The previous example should parse as:
-
- a + (b * c) + d
-
-... because the C<*> operator has a higher precedence -- binding more tightly
-to its terms -- than the C<+> operator.
-
-Within a grammar, switch from the top-down recursive descent parser to the
-bottom-up operator precedence parser with an C<optable> X<Parser, optable>
-rule:
-
- rule expression is optable { ... }
-
-The C<...> ellipsis isn't an editorial shortcut, it's the Perl 6 operator to to
-define a function signature. The C<...> indicates that this is just a
-signature; the actual implementation is elsewhere.  In this case, that location
-in the definition of the optable.
-
-=head3 Protofunction Definitions
-
-X<Protofunctions>
-
-Protofunctions define operators in the optable in the same way that rules and
-tokens make up the grammar. A proto declares a rule, defined elsewhere, which
-other code may override dynamically.  In this case, PCT takes information from
-the proto declaration and fills in the details. The "dynamic overriding"
-implies that a high-level language itself itself can modify its own grammar at
-run time, by overriding the proto definitions for its operator table. Some
-languages call this process X<operator overloading> I<operator overloading>.
-
-A proto definition resembles:
-
- 'proto' <proto_name> [ 'is' <property> ] '{' '...' '}'
-
-The name of the operator, noted as C<< <proto_name> >>, contains both a
-location part and an identifier part. The location is the type of the operator,
-such as infix, postfix, prefix, circumfix, and postcircumfix. The name of the
-operator is the symbol used for the operator in any of the quotes that Perl 6
-understands:
-
- proto infix:<+>                  # a + b
- proto postfix:'--'               # i--
- proto circumfix:«<>»             # <x>
-
-The C<is> X<Parser, is> keyword defines a property of the rule. Examples
-include:
-
- is precedence(1)     # Specifies an exact precedence
- is equiv('+')        # Has the same precedence as the "+" operator
- is assoc('right')    # Right associative. May also be "left" or "list"
- is pirop('add')      # Operands are passed to the PIR operator "and"
- is subname('mySub')  # Operands are passed to the function "mySub"
- is pasttype('if')    # Operands are passed as children to an "if" PAST node in
-                      # the parse tree
- is parsed(&myRule)   # The token is parsed and identified using the rule
-                      # "myRule" from the top-down parser
-
-=for author
-
-Please review.
-
-=end for
-
-Protofunction definitions are function signatures; you can override them with
-multimethod dispatch. This means that you can write functions I<with the same
-name> as the rule to implement the behavior of the operator.  Here's a proto:
-
- rule infix:"+" { ... }
-
-... and its corresponding PIR rule:
-
-=begin PIR
-
- .sub 'infix:+'
-    .param pmc a
-    .param pmc b
-    .local pmc c
-    c = a + b
-    .return(c)
- .end
-
-=end PIR
-
-You may ask "Why have an C<is subname()> property, if you can define all
-operators as subroutines?" Using the C<is subname()> property allows PCT to
-call a subroutine of a different name then the operator.  This is a good idea
-if there is already a built-in function in the language that duplicates the
-functionality of the operator.  There is no sense in duplicating behavior.
-
-The great thing about protos being overloadable is that you can specify
-different functions to call with different signatures:
-
-=begin PIR
-
- .sub 'infix:+' :multi('Integer', 'Integer')
-    #...
- .end
-
- .sub 'infix:+' :multi('CLispRatio', 'Number')
-    #...
- .end
-
- .sub 'infix:+' :multi('Perl6Double', 'PythonInteger')
-    #...
- .end
-
-=end PIR
-
-This list can be a bit intimidating, and it's hard to imagine that it would be
-necessary to write up a new function to handle addition between every
-conceivable pair of operands. Fortunately, this is rarely the case in Parrot,
-because all these data types support common the VTABLE interface. For most data
-types Parrot already has basic arithmetic operations built in, and it's only
-necessary to override for those data types with special needs.
-
-=head3 Hypothetical Variables
-
-Z<CHP-7-SECT-5>
-
-X<variables;hypothetical>
-X<hypothetical variables>
-X<rules;captures>
-Hypothetical variables are a powerful way of building up data structures from
-within a match. Ordinary captures with C<()> store the result of the captures
-in C<$1>, C<$2>, etc. PGE stores values in these variables if the match is
-successful, but throws them away if the match fails.  The numbered capture
-variables are accessible outside the match, but only within the immediate
-surrounding lexical scope:
-
-  "Zaphod Beeblebrox" ~~ m:w/ (\w+) (\w+) /;
-
-  print $1; # prints Zaphod
-
-You can also capture into any user-defined variable with the binding operator
-C<:=> -- I<if> you have declared these variables in a lexical scope enclosing
-the rule:
-
-  my $person;
-  "Zaphod's just this guy." ~~ / ^ $person := (\w+) /;
-  print $person; # prints Zaphod
-
-You may capture repeated matches into an array:
-
-  my @words;
-  "feefifofum" ~~ / @words := (f<-[f]>+)* /;
-  # @words contains ("fee", "fi", "fo", "fum")
-
-You may capture pairs of repeated matches into a hash:
-
-  my %customers;
-  $records ~~ m:w/ %customers := [ E<lt>idE<gt> = E<lt>nameE<gt> \n]* /;
-
-If you don't need the captured value outside the rule, use a C<$?> variable
-instead. These are only directly accessible within the rule:
-
-  "Zaphod saw Zaphod" ~~ m:w/ $?name := (\w+) \w+ $?name/;
-
-A match of a named rule stores the result in a C<$?> variable with the same
-name as the rule. These variables are also accessible only within the rule:
-
-  "Zaphod saw Zaphod" ~~ m:w/ E<lt>nameE<gt> \w+ $?name /;
-
-=for author
-
-This next paragraph feels out of place; is there more?
-
-=end for
-
-When a rule matches a sequence of input tokens, PCT calls an associated method
-within NQP to convert that match into an AST node, which it inserts into the
-I<parse tree>.
-
-=head3 Basic Rules
-
-Consider the simple example rule:
-
- rule persons_name {
-    <first_name> <last_name>
- }
-
-... and two example tokens:
-
- token first_name { <alpha>+ }
- token last_name  { <alpha>+ }
-
-The special token C<< <alpha> >> is a built-in construct that only accepts
-upper case and lower case letters. The C<+> after the C<< <alpha> >> tag is a
-short way of saying "one or more". The rule will match names like C<Darth
-Vader>N<It also matches many strings that I<aren't> real names>, but won't
-match something like C<C 3P0>.
-
-This rule I<will> match C<Jar Jar Binks>, but not as you might expect: way you
-would expect: It would match the first "Jar" as C<< <first_name> >>, the second
-"Jar" as C<< <last_name> >>, and ignore "Binks"N<You should ignore the whole
-thing.>.
-
-=for author
-
-The rest seems vestigial.  An example like this should precede the rest of the
-chapter.  There are forward references, but it's a decent overview for people
-who haven't used similar systems before -- if you avoid going out in the weeds.
-
-=end for
-
-this example shows another new construct, the square brackets. Square
-brackets are ways to group things together. The star at the end means
-that we take all the things inside the brackets zero or more times.
-This is similar to the plus, except the plus matches one or more times.
-Notice, however, that the above rule always matches a comma at the end,
-so we would need to have something like:
-
- Darth Vader, Luke Skywalker,
-
-Instead of something more natural like:
-
- Darth Vader, Luke Skywalker
-
-We can modify the rule a little bit so that it always ends with a name
-instead of a comma:
-
- rule TOP {
-    [ <persons_name> ',' ]* <persons_name>
- }
-
-Now we don't need a trailing comma, but at the same time we can't match
-an empty file because it always expects to have at least one name at the
-end. If we still want to match empty files successfully, we need to make
-the whole rule optional:
-
- rule TOP {
-    [ [ <persons_name> ',' ]* <persons_name> ]?
- }
-
-We've grouped the whole rule together in another set of brackets, and
-put a "?" question mark at the end. The question mark means zero or
-one of the prior item.
-
-The symbols "*" (zero or more), "+" (one or more) and "?" are called
-I<quantifiers>, and allow an item in the rule to match a variable
-number of times. These aren't the only quantifiers, but they are the
-most common. We will talk about other quantifiers later on.
-
-=cut
-
-# Local variables:
-#   c-file-style: "parrot"
-# End:
-# vim: expandtab shiftwidth=4:

Deleted: branches/orderedhash_revamp/docs/book/draft/ch06_nqp.pod
==============================================================================
--- branches/orderedhash_revamp/docs/book/draft/ch06_nqp.pod	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,219 +0,0 @@
-=pod
-
-=head1 Grammar Actions
-
-The job of the grammar is to match input patterns from the source language.
-These patterns then need to get converted to nodes in the abstract syntax
-tree for manipulation in other stages of the compiler. We've already seen
-one example of a subroutine structure that takes a match and produces a
-tree node: Protofunctions. Protofunction signatures aren't the only way to
-apply functions to rules matched by a parser.  They are limited and are
-slightly primitive, but effective for handling operators.  There is an
-easier and more powerful way to write subroutines to convert match objects
-into parse tree nodes, using a language that's almost, but Not Quite Perl.
-
-X<NQP>
-X<Not Quite Perl>
-NQP (Not Quite Perl) is a small language which offers a limited subset of
-Perl 6's syntax and semantics. Though it originated as a bootstrapping tool
-for the Rakudo Perl 6 compiler, several other Parrot-based compilers use it
-as well.  It has become a permanent member of PCT, and therefore a permanent
-part of the Parrot code base. 
-
-NQP represents almost the smallest subset of the Perl 6 language necessary to
-implement parser transformations, plus a few syntactic convenience features
-that developers have requested. NQP's Perl 6 subset shows its Perl 5 roots,
-so existing Perl 5 programmers should find much of it familiar and should be
-able to leverage their existing skills for writing compilers.
-
-In PGE, at the time of a match the grammar we can invoke an action using the
-special <code>{*}</code> symbol. In general, these action methods are
-written in NQP, although it is possible for them to be written in PIR N<In
-fact, this is how the NQP compiler itself is written>. We won't discuss the
-PIR case here because it's uncommon and needlessly difficult. NQP is the
-standard and preferred choice for this.
-
-=head2 NQP Basics
-
-X<sigils>
-X<scalar>
-Like all flavors and versions of Perl, NQP uses special prefix symbols called
-I<sigils> to distinguish variable types. The C<$> sigil represents scalars,
-C<@> arrays, and C<%> for hashes.  A scalar is any single value which can
-interchangeably contain given a string value, an integer value, or an object
-reference. Simple NQP assignments are:
-
- $scalar := "This is a string"
- $x      := 123
- $pi     := 3.1415      # rounding
-
-X<bind operator>
-X<operators; binding>
-X<:=>
-The C<:=> I<bind> operator performs reference assignment in NQP. Reference
-assignment makes one variable into an alias for another. This means that
-the two variables are just different names for the same storage location,
-and changes to one will change both. It's important to remember that a bind
-is not a copy!
-
-NQP has hashes and arrays just like other flavors of Perl and various
-dynamic languages. NQP does not have a notion of hash and array context,
-but otherwise it works the way you would expect. Arrays have the C<@> sigil,
-and hashes have the C<%> sigil. Here are some examples:
-
-  @ary[0] := 1;
-  @ary[1] := "foo";
-  ...
-
-  %hsh{'bar'} := 2;
-  %hsh{'baz'} := "parrot";
-  ...
-
-There is also a nice shorthand way to index hashes, using angle brackets:
-
-  %hsh<bar> := "parrot";
-
-It's also possible to assign a list in I<scalar context>:
-
- $array_but_a_scalar := (1, 2, 3, 4)
-
-Or you could write a new function in PIR to create a new array from a variadic
-argument list:
-
- @my_array := create_new_array(1, 2, 3, 4)
-
-... which calls the PIR function:
-
-=begin PIR
-
- .namespace []
-
- .sub 'create_new_array'
-     .param pmc elems :slurpy
-     .return(elems)
- .end
-
-=end PIR
-
-=head3 Calling Actions From Rules
-
-=for editor
-
-Needs a link to that section.
-
-=end for
-
-As mentioned in the chapter on grammar rules, the funny little C<{*}> symbol
-calls an action. The action in question is an NQP method with the same name as
-the rule that calls it. NQP rules can have two different signatures:
-
- method name ($/)      { ... }
- method name($/, $key) { ... }
-
-Where does the key come from?  Consider this grammar:
-
- rule cavepeople {
-      'Fred'  {*}    #= Caveman
-    | 'Wilma' {*}    #= Cavewoman
-    | 'Dino'  {*}    #= Dinosaur
- }
-
-The C<cavepeople> rule demonstrates the result:
-
- method cavepeople($/, $key) {
-    if $key eq 'Caveman' {
-        say "We've found a caveman!";
-    } elsif $key eq 'Cavewoman' {
-        say "We've found a cavewoman!";
-    } elsif $key eq 'Dinosaur' {
-        say "A dinosaur isn't a caveperson at all!";
-    }
- }
-
-The key is a string that contains whatever any text following the C<#=> symbol.
-Without a C<#=> following the rule invocation, there's no C<$key> to use in the
-method.  If you attempt to use one without the other, the NQP compiler will die
-with error messages about mismatched argument/parameter numbers.
-
-=head3 The Match Object C<$/>
-
-X<match object>
-X<$/>
-The match object C<$/> it's a data structure that's all business: it's both a
-hash and an array. Because it's a special variable used pervasively in PCT, it
-has a special shortcut syntax:
-
- $/{'Match_item'}   is the same as $<Match_item>
- $/[0]              is the same as $[0]
-
-Each key in the match object's hash is the name of a matched rule.  Given a
-file containing "C<X + 5>" and a rule:
-
- rule introductions {
-    <variable> <operator> <number>
- }
-
-The resulting match object will contain the key/value pairs:
-
- "variable" => "x"
- "operator" => "+"
- "number"   => "5"
-
-When the match contains multiple values with the same name, or when rules have
-quantifiers such as C<*> or C<+>, the values in the hash may be arrays.  Given
-the input "A A A B B" and the rule:
-
- rule letters {
-    <vowel>* <consonant>*
- }
-
-The match object will contain the pairs:
-
- "vowel"     => ["A", "A", "A"]
- "consonant" => ["B", "B"]
-
-X<$( ) operator>
-
-Use the C<$( )> operator to count the number of matches in each group (by
-casting it to a scalar):
-
- $($<vowel>) == 3
-
-=head3 Inline PIR
-
-=for author
-
-Needs expansion.
-
-=end for
-
-X<{{ }}>
-X<double curly brackets>
-Sometimes NQP isn't quite flexible enough to handle transforms appropriately.
-In a PGE rule, the C<{{ }}> double curly brackets demarcate inline-PIR mode.
-PGE will execute any PIR code in those brackets. You can access C<$/> directly
-in the grammar without having to jump into NQP.
-
-=head3 PAST Nodes
-
-X<PAST>
-X<PAST nodes>
-NQP's job is to make abstract syntax trees.  These trees are all objects -- and
-as such, instances of PAST nodes.  Each PAST class represents a unique program
-construct.  These constructs are common and simple, but combine to represent
-complicated programming structures.
-
-=head3 Making Trees
-
-Every action has the ability to create a PAST node that represents that action,
-as well as any children of that node. Calling C<make> on that node adds it into
-the growing PAST tree that PCT maintains. Once the C<TOP> rule matches
-successfully and returns, PCT optimizes and converts that tree into PIR and PBC
-for execution.
-
-=cut
-
-# Local variables:
-#   c-file-style: "parrot"
-# End:
-# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/docs/book/draft/ch07_dynpmcs.pod
==============================================================================
--- branches/orderedhash_revamp/docs/book/draft/ch07_dynpmcs.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/book/draft/ch07_dynpmcs.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -88,11 +88,8 @@
 file to refer to the parent type.
 
 The C<FLAGS> are a series of flags that can be specified to determine
-how the PMC behaves and how it's constructed internally. The C<need_ext>
-flag assigns a special C<PMC_EXT> data structure to the PMC structure
-internally. C<PMC_EXT> is necessary to handle data sharing between threads
-or interpreters, storing attributes in the PMC, and a few other uses as
-well. The C<singleton> flag means that there can only be one instantiated
+how the PMC behaves and how it's constructed internally. The C<singleton>
+flag means that there can only be one instantiated
 object of this class. The C<is_ro> and C<has_ro> flags indicate that the
 PMC class is read-only or that it contains read-only data, respectively.
 The C<is_shared> flag indicates that the PMC is intended to be shared

Modified: branches/orderedhash_revamp/docs/book/draft/ch08_dynops.pod
==============================================================================
--- branches/orderedhash_revamp/docs/book/draft/ch08_dynops.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/book/draft/ch08_dynops.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -206,13 +206,6 @@
 Here, C<x> is an offset in C<size_t> units that represents how far forward
 (positive) or how far backwards (negative) to jump to.
 
-=item * POP()
-
-C<POP> pops the next opcode address off the control stack. To put an address
-onto the control stack, use the C<PUSH> keyword instead. C<PUSH> takes a single
-C<opcode_t *> argument to store, and C<POP> returns a single C<opcode_ *>
-value.
-
 =back
 
 =head2 The Opcode Compiler

Modified: branches/orderedhash_revamp/docs/book/draft/ch10_opcode_reference.pod
==============================================================================
--- branches/orderedhash_revamp/docs/book/draft/ch10_opcode_reference.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/book/draft/ch10_opcode_reference.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -215,27 +215,6 @@
 
 I<Arguments: I>
 
-=head3 branch_cs
-
-X<branch_cs opcode (PASM)>
-
-  branch_cs R<FIXUP_ENTRY>
-
-Intersegment branch to the location of the given fixup table entry.
-
-I<Arguments: S>
-
-=head3 bsr
-
-X<bsr opcode (PASM)>
-
-  bsr R<LABEL>
-
-Branch to a label, like C<branch>, but also push the current location
-onto the call stack so C<ret> can return to it.
-
-I<Arguments: I>
-
 =head3 bxor
 
 X<bxor opcode (PASM)>
@@ -2046,15 +2025,6 @@
 
 See also: C<savetop>.
 
-=head3 ret
-
-X<ret opcode (PASM)>
-
-  ret
-
-Pop a location off the top of the call stack, and go there.
-Often used with C<bsr> and C<jsr>.
-
 =head3 rethrow
 
 X<rethrow opcode (PASM)>

Modified: branches/orderedhash_revamp/docs/book/draft/ch11_directive_reference.pod
==============================================================================
--- branches/orderedhash_revamp/docs/book/draft/ch11_directive_reference.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/book/draft/ch11_directive_reference.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -41,7 +41,7 @@
 
   .emit
 
-Define a compilation unit of PASM code. Always paired with C<.eom>.
+Define a block of PASM code. Always paired with C<.eom>.
 
 =head3 .end
 
@@ -49,7 +49,7 @@
 
   .end
 
-End a compilation unit. Always paired with C<.sub>.
+End a subroutine. Always paired with C<.sub>.
 
 =head3 .endm
 
@@ -65,7 +65,7 @@
 
   .eom
 
-End a compilation unit of PASM code. Always paired with C<.emit>.
+End a block of PASM code. Always paired with C<.emit>.
 
 =head3 .flatten_arg
 
@@ -208,7 +208,7 @@
 
   .sub R<NAME>
 
-Define a compilation unit. Always paired with C<.end>. Names begin
+Define a subroutine. Always paired with C<.end>. Names begin
 with "C<_>" by convention.
 
 =head3 .sym

Added: branches/orderedhash_revamp/docs/book/pct/ch01_introduction.pod
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/docs/book/pct/ch01_introduction.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,215 @@
+=pod
+
+=head1 Introduction
+
+Parrot is a language-neutral virtual machine for dynamic languages such as
+Ruby, Python, PHP, and Perl. It hosts a powerful suite of compiler tools
+tailored to dynamic languages and a next generation regular expression engine.
+Its architecture is fundamentally different than existing virtual machines such
+as the JVM or CLR, with optimizations for dynamic languages included, a
+register-based system rather than stack-based, and the use of continuations as
+the core means of flow control.
+
+The name "Parrot" was inspired by Monty Python's Parrot sketch. As an April
+Fools' Day joke in 2001, Simon Cozens published "Programming Parrot", a
+fictional interview between Guido van Rossum and Larry Wall 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>).
+
+=head2 Parrot Resources
+
+The starting point for all things related to Parrot is the main website
+U<http://www.parrot.org/>. The site lists additional resources, well as recent
+news and information about the project and the Parrot Foundation, which holds
+the copyright over Parrot and helps guide development and the community.
+
+=head3 Documentation
+
+Parrot includes extensive documentation in the distribution. The full
+documentation for the latest release is available online at
+U<http://docs.parrot.org/>.
+
+=head3 Mailing Lists
+
+X<parrot-dev (Parrot mailing list)>
+X<mailing lists>
+
+The primary mailing list for Parrot is I<parrot-dev at lists.parrot.org>.  If
+you're interested in getting involved in development, you may also want to
+follow the I<parrot-commits> and I<parrot-tickets> lists.  Information on all
+the Parrot mailing lists and subscription forms for each is available at
+U<http://lists.parrot.org/mailman/listinfo>.
+
+The archives for I<parrot-dev> 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>.
+
+=head3 IRC
+
+X<#parrot (Parrot IRC channel)>
+X<IRC channel (#parrot)>
+
+Parrot developers and users congregate on IRC at C<#parrot> on the
+U<irc://irc.parrot.org> server. It's a good place to get real-time answers to
+questions or see how things are progressing.
+
+=head3 Issue Tracking & Wiki
+
+X<trac.parrot.org website>
+X<issue tracking (trac.parrot.org)>
+
+Parrot developers track issues with a Trac site at U<https://trac.parrot.org/>.
+Users can submit new tickets and track the status of existing tickets.  The
+site also includes a wiki used in project development, a source code browser,
+and the project roadmap.
+
+=head2 Parrot Development
+
+X<development cycles>
+
+Parrot's first release occurred in September 2001.  It reached 1.0 in March
+2009. The Parrot project makes releases on the third Tuesday of each month. Two
+releases a year E<mdash> occuring every January and July E<mdash> are
+"supported" releases intended for production use.  The other ten releases are
+development releases for language implementers and testers.
+
+Development proceeds in cycles around releases. Activity just before a release
+focuses on closing tickets, fixing bugs, reviewing documentation, and preparing
+for the release. Immediately after the release, larger changes occur, such as
+merging branches, adding large features, or removing deprecated features. This
+allows developers to ensure that changes have sufficient testing time before
+the next release.  Releases also encourage feedback as casual users and testers
+explore the newest versions.
+
+=head2 The Parrot Team
+
+Parrot developers fulfill several rules according to their skills and interests.
+
+=over 4
+
+=item Architect
+
+X<architect role>
+
+The architect has primary responsibility for setting the overall direction of
+the project, facilitating team communication, and explaining and evaluating
+architectural issues. The architect makes design decisions and documents them
+in Parrot Design Documents, and oversees design and documentation work
+delegated to other members of the team to provide a coherent vision across the
+project. The architect also works with the release managers to develop and
+maintain the release schedule. Allison Randal currently leads the Parrot
+project as architect.
+
+=item Release Managers
+
+X<release manager role>
+
+Release managers manage and produce monthly releases according to the release
+schedule. Parrot has multiple release managers who rotate the responsibility
+for each monthly release. The release managers develop and maintain the release
+schedule jointly with the project architect.
+
+=item Metacommitter
+
+X<metacommitter role>
+
+Metacommitters manage commit access to the Parrot repository. Once a
+contributor is selected for commit access, a metacommitter gives the new
+committer access to the SVN repository and the bugtracker. The architect is a
+metacommitter, but other team members also hold this role.
+
+=item Committer
+
+X<committer role>
+
+Contributors who submit numerous, high-quality patches may be considered to
+become a committer. Committers have commit access to the full Parrot
+repository, though they often specialize on particular parts of the project.
+Contributors may be considered for commit access either by being nominated by
+another committer, or by requesting it.
+
+=item Core Developer
+
+X<core developer role>
+
+Core developers develop and maintain core subsystems such as the I/O
+subsystem, the exceptions system, or the concurrency scheduler.
+
+=item Compiler Developer
+
+X<compiler developer role>
+
+Compiler developers develop and maintain one or more Parrot front-end
+compilers such as IMCC, PIRC, PGE and TGE.
+
+=item High-Level Language Developer
+
+X<HLL developer role>
+
+Developers who work on any of the high-level languages that target
+ParrotE<mdash>such as Lua, Perl, PHP, Python, Ruby, or TclE<mdash>are
+high-level language developers. The Parrot repository includes a few example
+languages. A full list of languages is available at
+U<https://trac.parrot.org/parrot/wiki/Languages>.
+
+=item Build Manager
+
+X<build manager role>
+
+Build managers maintain and extend configuration and build subsystems.
+They review smoke reports and attempt to extend platform support.
+
+=item Tester
+
+X<tester role>
+
+Testers develop, maintain, and extend the core test suite coverage and testing
+tools. Testers are also responsible for testing goals, including complete
+coverage of core components on targeted platforms.
+
+=item Patch Monsters
+
+X<patch monster role>
+
+Hackers and developers submit patches to Parrot every day, and it takes a keen
+eye and a steady hand to review and apply them all. Patch monsters check
+patches for conformance with coding standards and desirability of features,
+rework them as necessary, verify that the patches work as desired, and apply
+them.
+
+=item Cage Cleaners
+
+X<cage cleaner role>
+
+The cage cleaners ensure that development follows the project's coding
+standards, documentation is complete and accurate, all tests function properly,
+and new users have accurate and comprehensive coding examples. A special class
+of Trac tickets is available for these tasks.  Cage cleaning tasks run the
+gamut from entry-level to advanced; this is a good entry point for new users
+to work on Parrot.
+
+=item General Contributor
+
+X<contributor role>
+
+Contributors write code or documentation, report bugs, take part in email or
+online conversations, or contribute to the project in other ways. All volunteer
+contributions are appreciated.
+
+=back
+
+=head2 Licensing
+
+X<license>
+
+The Parrot foundation supports the Parrot development community and holds
+trademarks and copyrights to Parrot.  The project is available under the
+Artistic License 2.0, allowing free use in commercial and open source/free
+software contexts.
+
+=cut
+
+# Local variables:
+#   c-file-style: "parrot"
+# End:
+# vim: expandtab shiftwidth=4:

Added: branches/orderedhash_revamp/docs/book/pct/ch02_getting_started.pod
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/docs/book/pct/ch02_getting_started.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,182 @@
+=pod
+
+=head1 Getting Started
+
+Before you can use Parrot, you have to get it running on your machine.
+
+=head2 Installing Parrot
+
+The simplest way to install Parrot is to use a pre-compiled binary for your
+operating system or distribution. Packages are available for many packaging
+systems, including Debian, Ubuntu, Fedora, Mandriva, FreeBSD, Cygwin, and
+MacPorts. The Parrot website lists all known packages at
+U<http://www.parrot.org/download>. A binary installer for Windows is also
+available at U<http://parrotwin32.sourceforge.net/>.
+
+If packages aren't available on your system, download the latest supported
+release from U<http://www.parrot.org/release/supported>.
+
+You need a C compiler and a make utility to build Parrot from source code --
+usually C<gcc> and C<make>, but Parrot can build with standard compiler
+toolchains on different operating systems.  Perl 5.8 is also a prerequiste for
+configuring and building Parrot.
+
+If you have these dependencies installed, build the core virtual machine and
+compiler toolkit and run the standard test suite with the commands:
+
+  $ B<perl Configure.pl>
+  $ B<make>
+  $ B<make test>
+
+By default, Parrot installs to directories F<bin/>, C<lib/>, et cetera under
+the prefix F</usr/local>.  If you have privileges to write to these
+directories, install Parrot with:
+
+  $ B<make install>
+
+To install Parrot beneath a different prefix, use the C<--prefix> option to
+C<Configure.pl>:
+
+    $ B<perl Configure.pl --prefix=/home/me/parrot>
+
+If you intend to I<develop> -- not just I<use> -- a language on Parrot, install
+the Parrot developer tools as well:
+
+  $ B<make install-dev>
+
+=head2 Running Parrot
+
+Once you've installed Parrot, run it.  Create a test file called F<news.pasm>.
+C<.pasm> files contain Parrot Assembly Language (PASM) instructions; this is a
+low-level language native to the Parrot virtual machine.
+
+=begin PASM
+
+  say "Here is the news for Parrots."
+  end
+
+=end PASM
+
+Now run this file with:
+
+  $ B<parrot news.pasm>
+
+which will print:
+
+  Here is the news for Parrots.
+
+=head2 Running a Language on Parrot
+
+Next, try out one of Parrot's high-level languages. Create a test file
+called F<more_news.nqp>:
+
+  say "No parrots were involved in an accident on the M1 today..."
+
+Then run it as:
+
+  $ nqp more_news.nqp
+
+which will print:
+
+  No parrots were involved in an accident on the M1 today...
+
+=head2 What Next?
+
+This book describes Parrot in terms of tasks it supports.  You may pick and
+choose chapters based on your area of interest:
+
+=over 4
+
+=item Chapter 3, I<Parrot Intermediate Representation>
+
+Parrot Intermediate Representation (PIR) is a mid-level language native to the
+Parrot virtual machine s commonly used for writing extensions and tools for
+Parrot.
+
+=item Chapter 4, I<Compiler Tools>
+
+The Parrot Compiler Toolkit (PCT) provides a common infrastructure and
+utilities for implementing languages on Parrot.
+
+=item Chapter 5, I<Grammar Engine>
+
+The Parrot Grammar Engine (PGE) is a powerful regular expression engine and
+recursive descent parser. PGE is part of the compiler tools; understanding PGE
+is essential to implementing a language on Parrot.
+
+=item Chapter 6, I<Grammar Actions>
+
+NQP (Not Quite Perl) is a lightweight language loosely inspired by Perl 6. NQP
+is part of the compiler tools used for transforming a Parrot-hosted language
+into instructions for Parrot to execute.
+
+=item Chapter 7, I<Dynamic PMCs>
+
+=for author
+
+This chapter suggests the need for a chapter on core PMCs.  Alternately, this
+chapter could cover PMCs in general and dynpmcs as a special case of PMCs.
+
+=end for
+
+Parrot allows language developers to extend Parrot's core data types to suit
+the needs of advanced languages.
+
+=item Chapter 8, I<Dynamic Opcodes>
+
+=for author
+
+The same point applies for ops and dynops.
+
+=end for
+
+Parrot allows language developers to extend Parrot's core instruction set --
+again to suit the needs of advanced languages.
+
+=item Chapter 10, I<Instruction Reference>
+
+Parrot's standard instruction set provides powerful behavior for primitive
+operations, control flow, object orientation, exception handling, and more.
+
+=item Chapter 11, I<Directive Reference>
+
+Parrot supports directives used within PIR and PASM code to change the behavior
+of code and to control what happens in bytecode.
+
+=item Chapter 13, I<Operator Reference>
+
+PIR provides several higher-level operators as a convenience to programmers and
+code generators.
+
+=item Appendix A, I<Glossary>
+
+Parrot and its environment have common jargon.
+
+=item Appendix B, I<Command-Line Options>
+
+Parrot supports several flags to control execution modes, debugging, library
+loading, and more.
+
+=item Appendix C, I<Build Options>
+
+Parrot's configuration process gives administrators and developers tremendous
+control over the build system.
+
+=item Appendix D, I<Source Code>
+
+Parrot's source code is organized along logical lines -- logical, once you know
+the layout.
+
+=item Appendix E, I<Patch Submission>
+
+Parrot depends on the combined efforts of numerous volunteers.  Your
+contributions are very welcome.
+
+=back
+
+=cut
+
+# Local variables:
+#   c-file-style: "parrot"
+# End:
+# vim: expandtab shiftwidth=4:

Added: branches/orderedhash_revamp/docs/book/pct/ch03_compiler_tools.pod
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/docs/book/pct/ch03_compiler_tools.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,333 @@
+=pod
+
+=head1 Parrot Compiler Tools
+
+Z<CHP-4>
+
+Parrot is able to natively compile and execute code in two low-level
+languages, PASM and PIR. These two languages, which are very similar to
+one another, are very close to the machine and analagous to assembly
+languages from hardware processors and other virtual machines. While they
+do expose the power of the PVM in a very direct way, PASM and PIR are not
+designed to be used for writing large or maintainable programs. For these
+tasks, higher level languages such as Perl 6, Python 3, Tcl, Ruby, and PHP
+are preferred instead, and the ultimate goal of Parrot is to support these
+languages and more. The question is, how do we get programs written in these
+languages running on Parrot? The answer is PCT.
+
+PCT is a set of classes and tools that enable the easy creation of
+compilers for high level languages (HLLs) that will run on Parrot. PCT is
+itself written in PIR, and compiles HLL code down to PIR for compilation
+and execution on Parrot, but allows the compiler designer to do most work
+in a high-level dialect of the Perl 6 language. The result is a flexible,
+dynamic language that can be used for creating other flexible, dynamic
+languages.
+
+
+=head2 History
+
+The Parrot Virtual Machine was originally conceived of as the engine for
+executing the new Perl 6 language, when specifications for that were first
+starting to be drafted. However, as time went on it was decided that Parrot
+would benefit from having a clean abstraction layer between it's internals
+and the Perl 6 language syntax. This clean abstraction layer brought with it
+the side effect that Parrot could be used to host a wide variety of dynamic
+languages, not just Perl 6. And beyond just hosting them, it could
+facilitate their advancement, interaction, and code sharing.
+
+The end result is that Parrot is both powerful enough to support one of the
+most modern and powerful dynamic languages, Perl 6, but well-encapsulated
+enough to host other languages as well. Parrot would be more powerful and
+feature-full than any single language, and would provide all that power and
+all those features to any languages that wanted them.
+
+Perl 6, under the project name Rakudo N<http://www.rakudo.org>, is still one
+of the primary users of Parrot and therefore one of the primary drivers in
+its development. However, compilers for other dynamic languages such as
+Python 3, Ruby, Tcl, are under active development. Several compilers exist
+which are not being as actively developed, and many compilers exist for
+new languages and toy languages which do not exist anywhere else.
+
+=head2 Capabilities and Benefits
+
+Parrot exposes a rich interface for high level languages to use, including
+several important features: a robust exceptions system, compilation into
+platform-independent bytecode, a clean extension and embedding interface,
+just-in-time compilation to machine code, native library interface mechanisms,
+garbage collection, support for objects and classes, and a robust concurrency
+model.  Designing a new language or implementing a new compiler for an old
+language is easier with all of these features designed, implemented, tested,
+and supported in a VM already. In fact, the only tasks required of compiler
+implementers who target the Parrot platform is the creation of the parser
+and the language runtime.
+
+Parrot also has a number of other benefits for compiler writers to tap into:
+
+=over 4
+
+=item * Write Once and Share
+
+All HLLs on Parrot ultimately compile down to Parrot's platform-independent
+bytecode which Parrot can execute natively. This means at the lowest level
+Parrot supports interoperability between programs written in multiple high
+level languages. Find a library you want to use in Perl's CPAN
+N<http://www.cpan.org>? Have a web framework you want to use that's written
+in Ruby? A mathematics library that only has C bindings? Want to plug all
+of these things into a web application you are writing in PHP? Parrot
+supports this and more.
+
+=item * Native Library Support
+
+Parrot has a robust system for interfacing with external native code
+libraries, such as those commonly written in C, C++, Fortran and other
+compiled languages. Where previously every interpreter would need to
+maintain it's own bindings and interfaces to libraries, Parrot enables
+developers to write library bindings once and use them seamlessly from
+any language executing on Parrot. Want to use Tcl's Tk libraries, along with
+Python's image manipulation libraries in a program you are writing in Perl?
+Parrot supports that.
+
+=back
+
+=head2 Compilation and Hosting
+
+For language hosting and interoperability to work, languages developers need
+to write compilers that convert source code written in high level languages
+to Parrot's bytecode.  This process is analogous to how a compiler such as
+GCC converts C or C++ into machine code -- though instead of targeting
+machine code for a specific hardware platform, compilers written in Parrot
+produce Parrot code which can run on any hardware platform that can run
+Parrot.
+
+Creating a compiler for Parrot written directly in PIR is possible. Creating
+a compiler in C using the common tools lex and yacc is also possible.
+Neither of these options are really as good, as fast, or as powerful as
+writing a compiler using PCT.
+
+PCT is a suite of compiler tools that helps to abstract and automate the
+process of writing a new compiler on Parrot. Lexical analysis, parsing,
+optimization, resource allocation, and code generation are all handled
+internally by PCT and the compiler designer does not need to be concerned
+with any of it.
+
+
+=head2 PCT Overview
+
+The X<Parrot Compiler Tools;PCT> Parrot Compiler Tools (PCT) enable the
+creation of high-level language compilers and runtimes.  Though the Perl 6
+development team originally created these tools to aide in the development
+of the Rakudo Perl 6 implementation, several other Parrot-hosted compilers
+also use PCT to great effect. Writing a compiler using Perl 6 syntax and
+dynamic language tools is much easier than writing a compiler in C,
+C<lex>, and C<yacc>.
+
+PCT is broken down into three separate tools:
+
+=over 4
+
+=item * Not Quite Perl (NQP)
+
+NQP a subset of the Perl 6 language that requires no runtime library to
+execute.
+
+=item * Perl Grammar Engine (PGE)
+
+PGE is an implementation of Perl 6's powerful regular expression and grammar
+tools.
+
+=item * HLLCompiler
+
+The HLLCompiler compiler helps to manage and encapsulate the compilation
+process. An HLLCompiler object, once created, enables the user to use the
+compiler interactively from the commandline, in batch mode from code files,
+or at runtime using a runtime eval.
+
+=back
+
+=head2 Grammars and Action Files
+
+A PCT-based compiler requires three basic files: the main entry point file
+which is typically written in PIR, the grammar specification file which uses
+PGE, and the grammar actions file which is in NQP. These are just the three
+mandatory components, most languages are also going to require additional
+files for runtime libraries and other features as well.
+
+=over 4
+
+=item * The main file
+
+The main file is (often) a PIR program which contains the C<:main> function
+that creates and executes the compiler object. This program instantiates a
+C<PCT::HLLCompiler> subclass, loads any necessary support libraries, and
+initializes any compiler- or languages-specific data.
+
+The main file tends to be short.  The guts of the compiler logic is in the
+grammar and actions files.  Runtime support and auxiliary functions often
+appear in other files, by convention.  This separation of concerns tends to
+make compilers easier to maintain.
+
+=item * A grammar file
+
+The high-level language's grammar appears in a F<.pg> file.  This file
+subclasses the C<PCT::Grammar> class and implements all of the necessary
+rules -- written using PGE -- to parse the language.
+
+=item * An actions file
+
+Actions contains methods -- written in NQP -- on the C<PCT::Grammar:Actions>
+object which receive parse data from the grammar rules and construct an
+X<Abstract Syntax Tree;Parrot Abstract Syntax Tree;AST;PAST> Abstract Syntax
+Tree (AST).N<The Parrot version of an AST is, of course, the Parrot Abstract
+Syntax Tree, or PAST.>
+
+=back
+
+PCT's workflow is customizable, but simple.  The compiler passes the source
+code of the HLL into the grammar engine.  The grammer engine parses this code
+and returns a X<PGE;Match Object> special Match object which represents a
+parsed version of the code.  The compiler then passes this match object to the
+action methods, which convert it in stages into PAST.  The compiler finally
+converts this PAST into PIR code, which it can save to a file, convert to
+bytecode, or execute directly.
+
+=head3 C<mk_language_shell.pl>
+
+The only way creating a new language compiler could be easier is if these files
+created themselves. PCT includes a tool to do just that:
+C<mk_language_shell.pl>.  This program automatically creates a new directory in
+F<languages/> for your new language, the necessary three files, starter files
+for libraries, a F<Makefile> to automate the build process, and a basic test
+harness to demonstrate that your language works as expects.
+
+These generated files are all stubs which will require extensive editing to
+implement a full language, but they are a well-understood and working starting
+point.  With this single command you can create a working compiler.  It's up to
+you to fill the details.
+
+C<mk_language_shell.pl> prefers to run from within a working Parrot repository.
+It requires a single argument, the name of the new project to create.  There
+are no hard-and-fast rules about names, but the Parrot developers reccomend
+that Parrot-based implementations of existing languages use unique names.
+
+Consider the names of Perl 5 distributions: Active Perl and Strawberry Perl.
+Python implementations are IronPython (running on the CLR) and Jython (running
+on the JVM).  The Ruby-on-Parrot compiler isn't just "Ruby": it's Cardinal.
+The Tcl compiler on Parrot is Partcl.
+
+An entirely new language has no such constraints.
+
+From the Parrot directory, invoke C<mk_language_shell.pl> like:
+
+  $ B<cd languages/>
+  $ B<perl ../tools/build/mk_language_shell.pl <project name>>
+
+=head3 Parsing Fundamentals
+
+An important part of a compiler is the parser and lexical analyzer.  The
+lexical analyzer converts the HLL input file into individual tokens. A token
+may consist of an individual punctuation ("+"), an identifier ("myVar"), a
+keyword ("while"), or any other artifact that stands on its own as a single
+unit.  The parser attempts to match a stream of these input tokens against a
+given pattern, or grammar. The matching process orders the input tokens into an
+abstract syntax tree which the other portions of the compiler can process.
+
+X<top-down parser>
+X<bottom-up parser>
+X<parsers; top-down>
+X<parsers; bottom-up>
+Parsers come in top-down and bottom-up varieties. Top-down parsers start with a
+top-level rule which represents the entire input. It attempts to match various
+combination of subrules until it has consumed the entire input.  Bottom-down
+parsers start with individual tokens from the lexical analyzer and attempt to
+combine them together into larger and larger patterns until they produce a
+top-level token.
+
+PGE is a top-down parser, although it also contains a bottom-up I<operator
+precedence> parser to make processing token clusters such as mathematical
+expressions more efficient.
+
+=head2 Driver Programs
+
+The driver program for the new compiler must create instances of the various
+necessary classes that run the parser. It must also include the standard
+function libraries, create global variables, and handle commandline options.
+PCT provides several useful command-line options, but driver programs may need
+to override several behaviors.
+
+PCT programs can run in two ways.  An interactive mode runs one statement at a
+time in the console.  A file mode loads and runs an entire file at once.  A
+driver program may specificy information about the interactive prompt and
+environment, as well as help and error messages.
+
+=head3 C<HLLCompiler> class
+
+The C<HLLCompiler> class implements a compiler object. This object contains
+references to language-specific parser grammar and actions files, as well as
+the steps involved in the compilation process.  The stub compiler created by
+C<mk_language_shell.pl> might resemble:
+
+  .sub 'onload' :anon :load :init
+      load_bytecode 'PCT.pbc'
+      $P0 = get_hll_global ['PCT'], 'HLLCompiler'
+      $P1 = $P0.'new'()
+      $P1.'language'('MyCompiler')
+      $P1.'parsegrammar'('MyCompiler::Grammar')
+      $P1.'parseactions'('MyCompiler::Grammar::Actions')
+  .end
+
+  .sub 'main' :main
+      .param pmc args
+      $P0 = compreg 'MyCompiler'
+      $P1 = $P0.'command_line'(args)
+  .end
+
+The C<:onload> function creates the driver object as an instance of
+C<HLLCompiler>, sets the necessary options, and registers the compiler with
+Parrot. The C<:main> function drives parsing and execution begin. It calls the
+C<compreg> opcode to retrieve the registered compiler object for the language
+"MyCompiler" and invokes that compiler object using the options received from
+the commandline.
+
+The C<compreg> opcode hides some of Parrot's magic; you can use it multiple
+times in a program to compile and run different languages. You can create
+multiple instances of a compiler object for a single language (such as for
+runtime C<eval>) or you can create compiler objects for multiple languages for
+easy interoperability. The Rakudo Perl 6 C<eval> function uses this mechanism
+to allow runtime eval of code snippets in other languages:
+
+  eval("puts 'Konnichiwa'", :lang<Ruby>);
+
+=head3 C<HLLCompiler> methods
+
+The previous example showed the use of several HLLCompiler methods:
+C<language>, C<parsegrammar>, and C<parseactions>.  These three methods are the
+bare minimum interface any PCT-based compiler should provide.  The C<language>
+method takes a string argument that is the name of the compiler. The
+HLLCompiler object uses this name to register the compiler object with Parrot.
+The C<parsegrammar> method creates a reference to the grammar file that you
+write with PGE. The C<parseactions> method takes the class name of the NQP file
+used to create the AST-generator for the compiler.
+
+If your compiler needs additional features, there are several other available
+methods:
+
+=over 4
+
+=item * C<commandline_prompt>
+
+The C<commandline_prompt> method allows you to specify a custom prompt to
+display to users in interactive mode.
+
+=item * C<commandline_banner>
+
+The C<commandline_banner> method allows you to specify a banner message that
+displays at the beginning of interactive mode.
+
+=back
+
+=cut
+
+# Local variables:
+#   c-file-style: "parrot"
+# End:
+# vim: expandtab shiftwidth=4:

Added: branches/orderedhash_revamp/docs/book/pct/ch04_pge.pod
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/docs/book/pct/ch04_pge.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,1558 @@
+=pod
+
+=head1 Grammar Engine
+
+X<Parrot Grammar Engine>
+X<PGE (Parrot Grammar Engine)>
+The Parrot Grammar Engine (PGE) is a parser generator, one of the key
+components of the Parrot Compiler Toolkit. It reads grammar files written in
+the PGE rules format and generates parser modules written in PIR code. PGE
+rules provide the full power of I<recursive descent parsing> and I<operator
+precedence parsing>. Fortunately, you don't need to know what those terms
+mean in order to make good use of PGE. We'll introduce the necessary
+concepts as we talk about various features in this chapter.
+
+=head2 Grammars
+
+The ultimate goal of a parser is to match patterns in a source language and
+convert them to an internal data structure for later manipulations. As a
+programmer, you're probably already familiar with some of these types of
+patterns: function declarations, function calls, statements, and assignments.
+Each of these different concepts have a particular form called a I<syntax>.
+In C for example, the syntax to define a function looks something like this:
+
+  <return_type> <function_name> ( <arguments> ) { <function_body> }
+
+Things that fit this pattern, so long as all the sub-patterns use the proper
+syntax also, are valid subroutines in C. Similarly, we can use a slightly
+different pattern to create a subroutine:
+
+  sub <function_name> { <function_body> }
+
+A grammar is a collection of rules like the ones above that specify all the
+acceptable patterns in a language. Grammars group together these rules in
+much the same way that a groups together related data fields and methods
+N<In languages like Perl 6 for instance, a grammar is just a special kind
+of class and a rule is just a special kind of method.>. Each rule defines
+a pattern for matching one unit of text, and can be made up of various other
+rules which are called recursively to make a complete match.
+
+A rule can contain regular expressions to match patterns of characters:
+
+  rule id { \d+ }
+
+A rule can also contain patterns of references to other rules:
+
+  rule record { <id> <name> <phone> }
+
+A grammar contains a group of rules that work together to match the entire
+language:
+
+  grammar Contacts;
+
+  rule name { 'John' | 'Bob ' | 'Fred' }
+
+  rule id   { \d+ }
+
+  rule record { <id> <name> }
+
+  ...
+
+=head3 Rules and Tokens
+
+X<rule>
+X<token>
+There are two different kinds of rules: C<rule>, which we saw above, and
+C<token>. A C<rule> performs smart whitespace matching between the various
+pieces of the pattern. The C<record> rule given previously would match
+"6355 John" or "6355      John" but not "6355John".
+
+A C<token> matches whitespace only if you specifically request it. To get the
+same effect with a token, add the C<\s> (match a space character) and C<+>
+(match the preceding atom -- the space character, in this case -- one or more
+times) pattern to the rule:
+
+  token record { <id> \s+ <name> }
+
+=head3 The Start Rule
+
+X<top>
+X<top-down parser>
+A recursive descent parser is what's called a I<top-down parser>. It starts
+at the highest-level rule, called C<TOP>, and works its way down through
+individual rules to match an entire string or file. Real Perl 6 allows any
+name for the top-level rule, but PCT expects a rule called C<TOP>. If PCT
+was as fully-featured as Perl 6, people would use it instead! Here's an
+example of a TOP rule:
+
+  rule TOP { <record> }
+
+This rule matches a single C<record> pattern in a string or file. Once the
+parser has succeeded in matching the entire string or file passed to the
+start rule, it returns a parse tree. If it cannot match the entire input
+with the rules provided, it can either return a partial match, or it can
+throw a parse error.
+
+=head3 Testing a Grammar
+
+Let's do a small example grammar. Save this example to a file called
+F<Contacts.pg>:
+
+  grammar Contacts is PGE::Grammar;
+
+  rule  TOP    { <record> }
+  rule  record { <id> <name> }
+  token name   { 'John' | 'Bob ' | 'Fred' }
+  token id     { \d+ }
+
+Then compile the grammar:
+
+  $ B<parrot Perl6Grammar.pbc --output=Contacts.pir Contacts.pg>
+
+=for author
+
+Assume an installed Parrot for all examples?  Anyone working from the source
+tree should be able to mangle paths appropriately.
+
+=end for
+
+The path to F<parrot> and to the F<Perl6Grammar.pbc> file will vary on
+different systems. If you compiled Parrot from source, it will be:
+
+  $ B<./parrot runtime/parrot/library/PGE/Perl6Grammar.pbc \>
+        B<--output=Contacts.pir Contacts.pg>
+
+Next, create a small PIR script to run your grammar. Save it as
+F<grammar_test.pir>:
+
+=begin PIR
+
+  .sub main :main
+      load_bytecode 'PGE.pbc'        # load some required modules
+      load_bytecode 'dumper.pbc'
+      load_bytecode 'PGE/Dumper.pbc'
+
+      load_bytecode 'Contacts.pir'   # load your grammar
+
+      .local string source
+      source  = "3 John"
+
+      .local pmc top, grammar, match
+      top     = get_hll_global ['Contacts'], 'TOP'
+      grammar = get_class 'Contacts'
+      match   = top(source, 'grammar' => grammar)
+
+      _dumper(match, "match")
+  .end
+
+=end PIR
+
+Run the test script:
+
+  $ B<parrot grammar_test.pir>
+
+It will print out a text representation of the raw parse tree stored in the
+C<match> variable:
+
+  "match" => PMC 'Contacts' => "3 John" @ 0 {
+      <record> => PMC 'Contacts' => "3 John" @ 0 {
+          <id> => PMC 'Contacts' => "3" @ 0
+          <name> => PMC 'Contacts' => "John" @ 2
+      }
+  }
+
+Each node in the tree corresponds to a rule in the grammar.  The top-level
+match variable contains one child named C<record>, which contains two children
+named C<id> and C<name>.  C<id> contains the number 3, and C<name> contains the
+string "John". This is exactly what the simple grammar should have matched.
+
+=head2 Rule Syntax
+
+Every language has a set of basic components (words or parts of words) and
+syntax conventions for combining them. The "words" in rules are literal
+characters or symbols, some X<metacharacters> metacharacters (or metasymbols),
+and X<rules;escape sequences>X<escape sequences, rules> escape sequences, while
+the combining syntax includes other metacharacters, X<quantifiers, rules>
+X<rules;quantifiers> quantifiers, bracketing characters, and assertions.
+
+=head3 Metacharacters
+
+The C<.> metacharacter matches any single character, even a newline character.
+The C<^> and C<$> metacharacters are zero-width matches which represent the
+beginning and end of a string. They each have doubled alternates C<^^> and
+C<$$> that match at the beginning and end of every (newline-delimited) line
+within a string.
+
+The C<|>, C<&>, C<\>, C<#>, and C<:=> metacharacters are all syntax structure
+elements. C<|> alternates between two options. C<&> matches two patterns
+simultaneously (the patterns must be the same length). C<\> turns literal
+characters into metacharacters (producing escape sequences). C<#> starts a
+comment which proceeds until the end of the line. You can start a comment at
+any point on any line in a rule. C<:=> binds a hypothetical variable to the
+result of a subrule or grouped pattern (see L<Hypothetical Variables>).
+
+The metacharacters C<()>, C<[]>, C<{}> and C<E<lt>E<gt>> are bracketing pairs.
+Bracketing pairs must always be balanced within the rule; to use a literal
+character, escape it with a C<\>.  The C<()> and C<[]> pairs group patterns as
+a single atom. They often capture a result, mark the boundaries of an
+alternation, or mark a group of patterns with a quantifier. Parentheses C<()>
+capture, but square brackets C<[]> do not. The C<{}> brackets define a section
+of code (a closure) within a rule. These closures are always a successful
+zero-width match. The C<E<lt>...E<gt>> brackets mark assertions, which handle a
+variety of constructs including character classes and user-defined quantifiers
+(see L<Assertions>).
+
+Table 7-2 summarizes the basic metacharacters.
+
+=begin table picture Metacharacters
+
+Z<CHP-7-TABLE-2>
+
+=headrow
+
+=row
+
+=cell Symbol
+
+=cell Meaning
+
+=bodyrows
+
+=row
+
+=cell C<.>
+
+=cell Match any single character, including a newline.
+X<. (dot);. match single character (rules)>
+
+=row
+
+=cell C<^>
+
+=cell Match the beginning of a string.
+X<^ (caret);^ beginning of string (rules)>
+
+=row
+
+=cell C<$>
+
+=cell Match the end of a string.
+X<$ (dollar sign);$ end of string (rules)>
+
+=row
+
+=cell C<^^>
+
+=cell Match the beginning of a line within the string.
+X<^ (caret);^^ beginning of line (rules)>
+
+=row
+
+=cell C<$$>
+
+=cell Match the end of a line within the string.
+X<$ (dollar sign);$$ end of line (rules)>
+
+=row
+
+=cell C<|>
+
+=cell Match alternate patterns (OR).
+
+=row
+
+=cell C<&>
+
+=cell Match multiple patterns (AND).
+
+=row
+
+=cell C<\>
+
+=cell Escape a metacharacter to get a literal character, or escape a
+literal character to get a metacharacter.
+X<\ (backslash);\ escape sequences (rules)>
+X<\ (backslash);\ to escape metacharacters (rules)>
+
+=row
+
+=cell C<#>
+
+=cell Mark a comment (to the end of the line).
+
+=row
+
+=cell C<:=>
+
+=cell Bind the result of a match to a hypothetical variable.
+X<: (colon);:= (binding);in rules>
+
+=row
+
+=cell C<(...)>
+
+=cell Group patterns and capture the result.
+
+=row
+
+=cell C<[...]>
+
+=cell Group patterns without capturing.
+
+=row
+
+=cell C<{...}>
+
+=cell Execute a closure (Perl 6 code) within a rule.
+
+=row
+
+=cell C<E<lt>...E<gt>>
+
+=cell Match an assertion.
+
+=end table
+
+=head3 Escape Sequences
+
+Z<CHP-7-SECT-2.2>
+
+X<escape sequences, rules>
+X<rules;escape sequences>
+X<\ (backslash);\ escape sequences (rules)>
+
+Escape sequences are literal characters acting as metacharacters.  A preceding
+backslash (C<\>) identifies them as escapes. Some escape sequences represent
+single characters that are difficult to represent literally, such as C<\t> for
+tab, or C<\x[...]> to specify a character by its hexadecimal number.  Some
+represent limited character classes, such as C<\d> for digits or C<\w> for word
+characters. Some represent zero-width positions in a match, such as C<\b> for a
+word boundary.
+
+X<variable interpolation in rules>
+X<rules;variable interpolation>
+If you've used Perl 5 regexps, you may remember the C<\Q> escape sequence which
+treats everything until the following C<\E> sequence as literal text,
+containing no escape sequences.  Because ordinary variables now interpolate as
+literal strings by default, the C<\Q> escape sequence is rarely needed.
+
+A<CHP-7-TABLE-3>Table 7-3 shows the escape sequences for rules.
+
+=begin table picture Escape sequences
+
+Z<CHP-7-TABLE-3>
+
+=headrow
+
+=row
+
+=cell Escape
+
+=cell Meaning
+
+=bodyrows
+
+=row
+
+=cell C<\0[...]>
+
+=cell Match a character given in octal (brackets optional).
+
+=row
+
+=cell C<\b>
+
+=cell Match a word boundary.
+
+=row
+
+=cell C<\B>
+
+=cell Match when not on a word boundary.
+
+=row
+
+=cell C<\c[...]>
+
+=cell Match a named character or control character.
+
+=row
+
+=cell C<\C[...]>
+
+=cell Match any character except the bracketed named or control character.
+
+=row
+
+=cell C<\d>
+
+=cell Match a digit.
+
+=row
+
+=cell C<\D>
+
+=cell Match a non-digit.
+
+=row
+
+=cell C<\e>
+
+=cell Match an escape character.
+
+=row
+
+=cell C<\E>
+
+=cell Match anything but an escape character.
+
+=row
+
+=cell C<\f>
+
+=cell Match the form feed character.
+
+=row
+
+=cell C<\F>
+
+=cell Match anything but a form feed.
+
+=row
+
+=cell C<\n>
+
+=cell Match a (logical) newline.
+
+=row
+
+=cell C<\N>
+
+=cell Match anything but a (logical) newline.
+
+=row
+
+=cell C<\h>
+
+=cell Match horizontal whitespace.
+
+=row
+
+=cell C<\H>
+
+=cell Match anything but horizontal whitespace.
+
+=row
+
+=cell C<\L[...]>
+
+=cell Everything within the brackets is lowercase.
+
+=row
+
+=cell C<\Q[...]>
+
+=cell All metacharacters within the brackets match as literal characters.
+
+=row
+
+=cell C<\r>
+
+=cell Match a return.
+
+=row
+
+=cell C<\R>
+
+=cell Match anything but a return.
+
+=row
+
+=cell C<\s>
+
+=cell Match any whitespace character.
+
+=row
+
+=cell C<\S>
+
+=cell Match anything but whitespace.
+
+=row
+
+=cell C<\t>
+
+=cell Match a tab.
+
+=row
+
+=cell C<\T>
+
+=cell Match anything but a tab.
+
+=row
+
+=cell C<\U[...]>
+
+=cell Everything within the brackets is uppercase.
+
+=row
+
+=cell C<\v>
+
+=cell Match vertical whitespace.
+
+=row
+
+=cell C<\V>
+
+=cell Match anything but vertical whitespace.
+
+=row
+
+=cell C<\w>
+
+=cell Match a word character (Unicode alphanumeric characters plus the
+underscore C<_>).
+
+=row
+
+=cell C<\W>
+
+=cell Match anything but a word character.
+
+=row
+
+=cell C<\x[...]>
+
+=cell Match a character given in hexadecimal (brackets optional).
+
+=row
+
+=cell C<\X[...]>
+
+=cell Match anything but the character given in hexadecimal (brackets
+optional).
+
+=end table
+
+=head3 Quantifiers
+
+Z<CHP-7-SECT-2.3>
+
+Quantifiers specify the number of times an atom (a single character,
+metacharacter, escape sequence, grouped pattern, assertion, etc) will match.
+
+X<. (dot);.. (range);quantifier (rules)>
+X<. (dot);... (infinite range);quantifier (rules)>
+The numeric quantifiers use assertion syntax. A single number (C<E<lt>3E<gt>>)
+requires exactly that many matches. A numeric range quantifier
+(C<E<lt>3C<..>5E<gt>>) succeeds if the number of matches is between the minimum
+and maximum numbers, inclusive. A range with three trailing dots
+(C<E<lt>2...E<gt>>) is shorthand for C<E<lt>R<n>..InfE<gt>>; it matches as many
+times as possible.
+
+Each quantifier has a minimal alternate form -- marked with a trailing C<?> --
+which matches the shortest possible sequence first.  That is, given the string
+C<aaaaaa>, C<aE<lt>3C<..>5E<gt>> will match C<aaaaa> and C<aE<lt>3C<..>5E<gt>?>
+will match C<aaa>.
+
+A<CHP-7-TABLE-4>Table 7-4 shows the built-in
+X<quantifiers, rules> X<rules;quantifiers> quantifiers.
+
+=begin table picture Quantifiers
+
+Z<CHP-7-TABLE-4>
+
+=headrow
+
+=row
+
+=cell Maximal
+
+=cell Minimal
+
+=cell Meaning
+
+=bodyrows
+
+=row
+
+=cell C<*>
+
+=cell C<*?>
+
+=cell Match 0 or more times.
+
+=row
+
+=cell C<+>
+
+=cell C<+?>
+
+=cell Match 1 or more times.
+
+=row
+
+=cell C<?>
+
+=cell C<??>
+
+=cell Match 0 or 1 times.
+
+=row
+
+=cell C<E<lt>>R<n>C<E<gt>>
+
+=cell C<E<lt>>R<n>C<E<gt>?>
+
+=cell Match exactly R<n> times.
+
+=row
+
+=cell C<E<lt>>R<n>C<..>R<m>C<E<gt>>
+
+=cell C<E<lt>>R<n>C<..>R<m>C<E<gt>?>
+
+=cell Match at least R<n> and no more than R<m> times.
+
+=row
+
+=cell C<E<lt>>R<n>C<...E<gt>>
+
+=cell C<E<lt>>R<n>C<...E<gt>?>
+
+=cell Match at least R<n> times.
+
+=end table
+
+=head3 Assertions
+
+Z<CHP-7-SECT-2.4>
+
+X<assertions, rules>
+X<rules;assertions>
+An assertion states that some condition or state is true. The match fails when
+that assertion is false.
+
+X<variable interpolation in rules>
+X<rules;variable interpolation>
+
+Assertions match named and anonymous rules, arrays or hashes containing
+anonymous rules, and subroutines or closures that return anonymous rules.
+
+To interpolate a variable in assertion rules, enclose it in assertion
+delimiters.
+A bare scalar in a pattern
+interpolates as a literal string, while a scalar variable in assertion
+brackets interpolates as an anonymous rule. A bare array in a pattern
+matches as a series of alternate literal strings, while an array in
+assertion brackets interpolates as a series of alternate anonymous
+rules.
+
+A bare hash in a pattern matches a word (C<\w+>) if and only if that word is
+one of its keysN<The effect is similar to matching the keys as a series of
+alternates, but it prefers to match the longest possible key, instead of the
+first potential match.>, while a hash in assertion brackets also matches the
+associated value as an anonymous rule.
+
+X<fail keyword>
+A bare closure in a pattern always matches (unless it calls C<fail>), but a
+closure in assertion brackets C<E<lt>{...}E<gt>> must return an anonymous rule
+to match.
+
+An assertion with parentheses C<E<lt>(...)E<gt>> resembles a bare closure in a
+pattern in that it allows you to include Perl code within a rule.
+C<E<lt>(...)E<gt>> evaluates the return value of the closure in boolean
+context. The match succeeds or fails based on that return value.
+
+Assertions match character classes, both named and enumerated. A named rule
+character class is often more accurate than an enumerated character class. The
+common C<E<lt>[a-zA-Z]E<gt>> idiom matches ASCII alphabetic characters, but the
+more comprehensive built-in rule C<E<lt>alphaE<gt>> matches the full set of
+Unicode alphabetic characters.
+
+A<CHP-7-TABLE-5>Table 7-5 shows the syntax of assertions.
+
+=begin table picture Assertions
+
+Z<CHP-7-TABLE-5>
+
+=headrow
+
+=row
+
+=cell Syntax
+
+=cell Meaning
+
+=bodyrows
+
+=row
+
+=cell C<E<lt>...E<gt>>
+
+=cell Generic assertion delimiter.
+
+=row
+
+=cell C<E<lt>!...E<gt>>
+
+=cell Negate any assertion.
+
+=row
+
+=cell C<E<lt>>R<name>C<E<gt>>
+
+=cell Match a named rule or character class.
+
+=row
+
+=cell C<E<lt>[...]E<gt>>
+
+=cell Match an enumerated character class.
+
+=row
+
+=cell C<E<lt>-...E<gt>>
+
+=cell Complement a character class (named or enumerated).
+
+=row
+
+=cell C<E<lt>"..."E<gt>>
+
+=cell Match a literal string (interpolated at match time).
+
+=row
+
+=cell C<E<lt>'...'E<gt>>
+
+=cell Match a literal string (not interpolated).
+
+=row
+
+=cell C<E<lt>(...)E<gt>>
+
+=cell Boolean assertion. Execute a closure and match if it returns a true
+result.
+
+=row
+
+=cell C<E<lt>$scalarE<gt>>
+
+=cell Match an anonymous rule.
+
+=row
+
+=cell C<E<lt>@arrayE<gt>>
+
+=cell Match a series of anonymous rules as alternates.
+
+=row
+
+=cell C<E<lt>%hashE<gt>>
+
+=cell Match a key from the hash, then its value (as an anonymous rule).
+
+=row
+
+=cell C<E<lt>E<amp>sub()E<gt>>
+
+=cell Match an anonymous rule returned by a sub.
+
+=row
+
+=cell C<E<lt>{>R<code>C<}E<gt>>
+
+=cell Match an anonymous rule returned by a closure.
+
+=row
+
+=cell C<E<lt>.E<gt>>
+
+=cell Match any logical grapheme, including combining character sequences.
+
+=end table
+
+=head3 Modifiers
+
+Z<CHP-7-SECT-2.5>
+
+X<modifiers>
+X<: (colon);: modifier delimiter in rules>
+Modifiers alter the meaning of a pattern. The standard position for modifiers
+is at the beginning of the rule, right after the C<m>, C<s>, or C<rx>, or after
+the name in a named rule. Modifiers cannot attach to the outside of a bare
+C</.../>. For example:
+
+  m:i/marvin/ # case insensitive
+  rule names :i { marvin | ford | arthur }
+
+You may group single-character modifiers, but you must separate longer
+modifiers by colons:
+
+  m:wig/ zaphod /                        # OK
+  m:words:ignorecase:globally / zaphod / # OK
+  m:wordsignorecaseglobally / zaphod /   # Not OK
+
+Most modifiers can also appear inside the rule when attached to rule or
+grouping delimiters. Internal modifiers are lexically scoped to their enclosing
+delimiters, so can alter subpatterns:
+
+  m/:w I saw [:i zaphod] / # only 'zaphod' is case insensitive
+
+The repetition modifiers (C<:R<N>x>, C<:R<N>th>, C<:once>, C<:globally>, and
+C<:exhaustive>) and the continue modifier (C<:cont>) alter the return value of
+the rule as a whole, so you cannot use them lexically inside a rule.
+
+The C<:R<N>x> modifier matches the rule a specific number of times. If the
+modifier expects more matches than the string has, the match fails.  Its
+alternate form (C<:x(R<N>)>) can take a variable in place of the number.
+
+The C<:once> modifier on a rule only allows it to match once. The rule will not
+match again until the you call the C<.reset> method on the rule object.
+
+The C<:globally> modifier matches as many times as possible. The C<:exhaustive>
+modifier also matches as many times as possible, in as many different ways as
+possible.
+
+The C<:R<N>th> modifier preserves one result from a particular counted match.
+If the rule matches fewer times than the modifier expects, the match fails. It
+has several alternate forms. One form, C<:th(R<N>)>, takes a variable in place
+of the number. The other forms -- C<:R<N>st>, C<:R<N>nd>, and C<:R<N>rd> --
+allow you to write more naturally C<:1st>, C<:2nd>, C<:3rd>.  The other way is
+valid as well; choose whichever is most comfortable.
+
+By default, rules ignore literal whitespace within the pattern.  The C<:w>
+modifier makes rules sensitive to literal whitespace, but in an intelligent
+way. Any cluster of literal whitespace acts like an explicit C<\s+> when it
+separates two identifiers and C<\s*> everywhere else.
+
+I<No> modifiers exist to treat the matched string as a single line or multiple
+lines.  Instead, use the "beginning of string" and "end of string" or
+"beginning of line" and "end of line" metacharacters.
+
+A<CHP-7-TABLE-6>Table 7-6 lists the available modifiers.
+
+=begin table picture Modifiers
+
+Z<CHP-7-TABLE-6>
+
+=headrow
+
+=row
+
+=cell Short
+
+=cell Long
+
+=cell Meaning
+
+=bodyrows
+
+=row
+
+=cell C<:i>
+
+=cell C<:ignorecase>
+
+=cell Case-insensitive match.
+
+=row
+
+=cell C<:I>
+
+=cell
+
+=cell Case-sensitive match (on by default).
+
+=row
+
+=cell C<:c>
+
+=cell C<:cont>
+
+=cell Continue where the previous match on the string left off.
+
+=row
+
+=cell C<:w>
+
+=cell C<:words>
+
+=cell Literal whitespace in the pattern matches as C<\s+>
+or C<\s*>.
+
+=row
+
+=cell C<:W>
+
+=cell
+
+=cell Turn off intelligent whitespace matching (return to default).
+
+=row
+
+=cell
+
+=cell :R<N>C<x>/C<:x(>R<N>C<)>
+
+=cell Match the pattern R<N> times.
+
+=row
+
+=cell
+
+=cell C<:>R<N>C<th>/C<:nth(>R<N>C<)>
+
+=cell Match the R<N>th occurrence of a pattern.
+
+=row
+
+=cell
+
+=cell C<:once>
+
+=cell Match the pattern once and only once.
+
+=row
+
+=cell C<:g>
+
+=cell C<:globally>
+
+=cell Match the pattern as many times as possible without overlapping
+possibilities.
+
+=row
+
+=cell C<:e>
+
+=cell C<:exhaustive>
+
+=cell Match every possible occurrence of a pattern, including overlapping
+possibilities.
+
+=row
+
+=cell
+
+=cell C<:u0>
+
+=cell . is a byte.
+
+=row
+
+=cell
+
+=cell C<:u1>
+
+=cell . is a Unicode codepoint.
+
+=row
+
+=cell
+
+=cell C<:u2>
+
+=cell . is a Unicode grapheme.
+
+=row
+
+=cell
+
+=cell C<:u3>
+
+=cell . is language dependent.
+
+=row
+
+=cell
+
+=cell C<:p5>
+
+=cell The pattern uses Perl 5 regex syntax.
+
+=end table
+
+=head3 Built-in Rules
+
+Z<CHP-7-SECT-3>
+
+X<rules;built-in>
+PGE provides several named rules, including a complete set of X<POSIX-style
+classes> POSIX-style classes, and X<Unicode property classes> Unicode property
+classes. The list isn't fully defined yet, but A<CHP-7-TABLE-7>Table 7-7 shows
+a few you're likely to see.
+
+The C<E<lt>nullE<gt>> rule matches a zero-width string (it always matches) and
+C<E<lt>priorE<gt>> matches whatever the most recent successful rule matched.
+These replace the two behaviors of X</ (slash);// invalid null pattern>
+X<invalid null pattern //> the Perl 5 null pattern C<//>, which is no longer
+valid syntax for rules.
+
+=begin table picture Built-in rules
+
+Z<CHP-7-TABLE-7>
+
+=headrow
+
+=row
+
+=cell Rule
+
+=cell Meaning
+
+=bodyrows
+
+=row
+
+=cell C<E<lt>alphaE<gt>>
+
+=cell Match a Unicode alphabetic character.
+
+=row
+
+=cell C<E<lt>digitE<gt>>
+
+=cell Match a Unicode digit.
+
+=row
+
+=cell C<E<lt>spE<gt>>
+
+=cell Match a single space character (the same as C<\s>).
+
+=row
+
+=cell C<E<lt>wsE<gt>>
+
+=cell Match any whitespace (the same as C<\s+>).
+
+=row
+
+=cell C<E<lt>nullE<gt>>
+
+=cell Match the null string.
+
+=row
+
+=cell C<E<lt>priorE<gt>>
+
+=cell Match the same thing as the previous match.
+
+=row
+
+=cell C<E<lt>before ...E<gt>>
+
+=cell Zero-width lookahead. Assert that the current position I<precedes> a
+pattern.
+
+=row
+
+=cell C<E<lt>after ...E<gt>>
+
+=cell Zero-width lookbehind. Assert that the current position I<follows> a
+pattern.
+
+=row
+
+=cell C<E<lt>prop ...E<gt>>
+
+=cell Match any character with the named property.
+
+=row
+
+=cell C<E<lt>replace(...)E<gt>>
+
+=cell Replace everything matched so far in the rule or subrule with the
+given string (under consideration).
+
+=end table
+
+=head3 Backtracking Control
+
+Z<CHP-7-SECT-4>
+
+X<backtracking controls>
+X<fail keyword>
+Whenever part of the pattern fails to match, PGE performs backtracking --
+backing up to the previous point at which the match could succeed and trying
+again.  You can explicitly trigger backtracking by calling the C<fail> function
+within a closure. A<CHP-7-TABLE-8>Table 7-8 displays metacharacters and
+built-in rules relevant to backtracking.
+
+=for author
+
+This could use an example.
+
+=end for
+
+=begin table picture Backtracking controls
+
+Z<CHP-7-TABLE-8>
+
+=headrow
+
+=row
+
+=cell Operator
+
+=cell Meaning
+
+=bodyrows
+
+=row
+
+=cell C<:>
+
+=cell Don't retry the previous atom.  Instead, fail to the next earlier atom.
+X<: (colon);: fail to atom before last (rules)>
+X<backtracking controls;: fail to atom before last>
+
+=row
+
+=cell C<::>
+
+=cell Don't backtrack over this point. Instead fail out of the closest
+enclosing group (C<(...)>, C<[...]>, or the rule delimiters).
+X<: (colon);:: fail out of group (rules)>
+X<backtracking controls;: fail out of group>
+
+=row
+
+=cell C<:::>
+
+=cell Don't backtrack over this point.  Instead, fail out of the current rule
+or subrule.
+X<: (colon);::: fail out of rule (rules)>
+X<backtracking controls;: fail out of rule>
+
+=row
+
+=cell C<E<lt>commitE<gt>>
+
+=cell Don't backtrack over this point. Instead, fail out of the entire match
+(even from within a subrule).
+
+=row
+
+=cell C<E<lt>cutE<gt>>
+
+=cell Like C<E<lt>commitE<gt>>, but also cuts the string matched. The current
+matching position at this point becomes the new beginning of the string.
+
+=end table
+
+=head3 Calling Actions
+
+Once the parser has matched the entire input N<a source code file, or a line of
+input at the terminal in interactive mode> the parse has succeeded.  The
+generated AST is now available to the code generator for conversion into PIR.
+
+=for author
+
+Please review.  The forward declaration is awkward here, but a little bit of
+explanation might ameliorate this.
+
+=end for
+
+This AST gets built up by actions -- code snippets attached to rules and
+tokens.  To call an action, insert the C<{*}> token into the rule. When PGE
+encounters C<{*}>, it will call the associated action method with the current
+match object as an argument.
+
+The best way to demonstrate this is by example.  Sprinkle the C<persons_name>
+rule liberally with action calls:
+
+ rule persons_name {
+    {*} <first_name> {*} <last_name> {*}
+ }
+
+The first call to the action method contains an empty match object because the
+parser hasn't matched anything yet.  The second call contains only the first
+name of the match. The third and final call contains both the matched first and
+last name.
+
+If the match fails halfway through, PGE will still call the actions that have
+succeeded; it will not call the actions after the failure.  If you try to match
+the string "Leia", PGE will call the first two action methods.  When the rule
+tries to match the last name, it fails, and PGE will not call the third action
+method.
+
+=head3 Alternations and Keys
+
+In addition to sub-rules, groups, and quantifiers, you can also express
+either-or alternations between options. The vertical bar token (C<|>)
+distinguishes between options where only one may match:
+
+ rule hero {
+    ['Luke' | 'Leia'] 'Skywalker'
+ }
+
+This rule will match either "Luke Skywalker" or "Leia Skywalker" but won't
+match "Luke Leia Skywalker"N<nor anything else.>.  Given alternations and
+action methods, it's often important to distinguish which alternation matched:
+
+ rule hero {
+    [
+      'Luke' {*}    #= Luke
+    | 'Leia' {*}    #= Leia
+    ]
+    'Skywalker'
+ }
+
+This is the same rule, except now it passes two arguments to its action method:
+the match object and the name of the person who matched.
+
+=head3 Warning: Left Recursion
+
+If you've worked with parsers before, you may have seen this coming.  If not,
+don't fear.  Like functions in ordinary procedural or functional languages, the
+methods in the PGE parser grammar can call themselves recursively.  Consider
+some rules derived in part from the grammar for the C programming language:
+
+ rule if_statement {
+    'if' <condition> '{' <statement>* '}' <else_block>?
+ }
+
+ rule statement {
+    <if_statement> | <expression>
+ }
+
+ rule else_block {
+    'else' '{' <statements>* '}'
+ }
+
+An C<if_statement> can contain a list of C<statement>s, and that each statement
+may itself be an C<if_statement>.  This is I<recursion> X<Recursion>; it's one
+of the reasons PGE is a "Recursive descent" parser.
+
+Consider the more direct example of a comma-separated list of integer digits
+which form a list.  A recursive definition might be:
+
+ rule list {
+     <list> ',' <digit> | <digit>
+ }
+
+If there is only one digit, the second option in the alternation matches.  If
+there are multiple digits, recursion will match them through the first
+alternation.
+
+That's the intention.  The results are insidious.
+
+The recursive descent parser enters the C<list> rule. Its first option is to
+enter the list rule again, so it does.  Recursive descent is a X<depth-first
+algorithm> depth-first algorithm; PGE will continue to descend down a
+particular path until it finds a successful match or a match failure. In this
+case, it matches C<list>, then it matches C<list> again, then it matches
+C<list> again, and so on.  This rule forms an infinite loop -- a pattern called
+X<left recursion> I<left recursion>.  The problem is that the left-most item of
+the left-most alternation is itself a recursion.
+
+The rule above does not recurse infinitely when rewritten as:
+
+ rule list {
+    <digit> | <list> ',' <digit>
+ }
+
+... or even:
+
+ rule list {
+    <digit> ',' <list> | <digit>
+ }
+
+Both options ensure that the left-most item in the rule is recursive.
+
+Left recursion may be trickier.  It's not immediately obvious in this grammar:
+
+ rule term {
+    <expression> '*' <term> | <digit>
+ }
+
+ rule expression {
+    <term> '+' <expression> | <term>
+ }
+
+Even this common, limited subset of mathematical equations has the same
+problem.  To match a C<term>, the parser first tries to match an C<expression>,
+which in turn matches a C<term> and then an C<expression> ....
+
+Again, the solution is simple.  Rewrite at least one of the rules so that the
+first condition it tries to match is not itself a recursive situation.
+
+=head3 Operator Precedence Parser
+
+Recursive descent parsing can be inefficient where statements have lots of
+little tokens and many possible options to match.  For example, mathematical
+expressions are very open-ended, with many valid forms which are difficult to
+anticipate.  Consider the expression:
+
+ a + b * c + d
+
+A recursive descent parser will undergo significant trial and error to parse
+this statement.  Recursive descent parsing is not ideal for these situations.
+Instead, a type of bottom-up parser called an I<operator precedence> X<Parser,
+Operator precedence> parser is much better.
+
+=for author
+
+Is this a categorization of all opps or just PGE's opp?
+
+=end for
+
+Operator precedence parsers work similarly to more versatile bottom-up parsers
+such as Lex or Yacc, but are optimized for use with expressions and equations.
+Equations have two subtypes, I<terms> and I<operators>. Operators themselves
+have several subtypes, including prefix (C<-a>), postfix (C<i++>), infix (C<x +
+y>), circumfix (C<[z]>), postcircumfix (C<a[b]>), and list (C<1, 2, 3>). Each
+operator gets its own precedence number that specifies how closely it binds to
+the terms. The previous example should parse as:
+
+ a + (b * c) + d
+
+... because the C<*> operator has a higher precedence -- binding more tightly
+to its terms -- than the C<+> operator.
+
+Within a grammar, switch from the top-down recursive descent parser to the
+bottom-up operator precedence parser with an C<optable> X<Parser, optable>
+rule:
+
+ rule expression is optable { ... }
+
+The C<...> ellipsis isn't an editorial shortcut, it's the Perl 6 operator to to
+define a function signature. The C<...> indicates that this is just a
+signature; the actual implementation is elsewhere.  In this case, that location
+in the definition of the optable.
+
+=head3 Protofunction Definitions
+
+X<Protofunctions>
+
+Protofunctions define operators in the optable in the same way that rules and
+tokens make up the grammar. A proto declares a rule, defined elsewhere, which
+other code may override dynamically.  In this case, PCT takes information from
+the proto declaration and fills in the details. The "dynamic overriding"
+implies that a high-level language itself itself can modify its own grammar at
+run time, by overriding the proto definitions for its operator table. Some
+languages call this process X<operator overloading> I<operator overloading>.
+
+A proto definition resembles:
+
+ 'proto' <proto_name> [ 'is' <property> ] '{' '...' '}'
+
+The name of the operator, noted as C<< <proto_name> >>, contains both a
+location part and an identifier part. The location is the type of the operator,
+such as infix, postfix, prefix, circumfix, and postcircumfix. The name of the
+operator is the symbol used for the operator in any of the quotes that Perl 6
+understands:
+
+ proto infix:<+>                  # a + b
+ proto postfix:'--'               # i--
+ proto circumfix:«<>»             # <x>
+
+The C<is> X<Parser, is> keyword defines a property of the rule. Examples
+include:
+
+ is precedence(1)     # Specifies an exact precedence
+ is equiv('+')        # Has the same precedence as the "+" operator
+ is assoc('right')    # Right associative. May also be "left" or "list"
+ is pirop('add')      # Operands are passed to the PIR operator "and"
+ is subname('mySub')  # Operands are passed to the function "mySub"
+ is pasttype('if')    # Operands are passed as children to an "if" PAST node in
+                      # the parse tree
+ is parsed(&myRule)   # The token is parsed and identified using the rule
+                      # "myRule" from the top-down parser
+
+=for author
+
+Please review.
+
+=end for
+
+Protofunction definitions are function signatures; you can override them with
+multimethod dispatch. This means that you can write functions I<with the same
+name> as the rule to implement the behavior of the operator.  Here's a proto:
+
+ rule infix:"+" { ... }
+
+... and its corresponding PIR rule:
+
+=begin PIR
+
+ .sub 'infix:+'
+    .param pmc a
+    .param pmc b
+    .local pmc c
+    c = a + b
+    .return(c)
+ .end
+
+=end PIR
+
+You may ask "Why have an C<is subname()> property, if you can define all
+operators as subroutines?" Using the C<is subname()> property allows PCT to
+call a subroutine of a different name then the operator.  This is a good idea
+if there is already a built-in function in the language that duplicates the
+functionality of the operator.  There is no sense in duplicating behavior.
+
+The great thing about protos being overloadable is that you can specify
+different functions to call with different signatures:
+
+=begin PIR
+
+ .sub 'infix:+' :multi('Integer', 'Integer')
+    #...
+ .end
+
+ .sub 'infix:+' :multi('CLispRatio', 'Number')
+    #...
+ .end
+
+ .sub 'infix:+' :multi('Perl6Double', 'PythonInteger')
+    #...
+ .end
+
+=end PIR
+
+This list can be a bit intimidating, and it's hard to imagine that it would be
+necessary to write up a new function to handle addition between every
+conceivable pair of operands. Fortunately, this is rarely the case in Parrot,
+because all these data types support common the VTABLE interface. For most data
+types Parrot already has basic arithmetic operations built in, and it's only
+necessary to override for those data types with special needs.
+
+=head3 Hypothetical Variables
+
+Z<CHP-7-SECT-5>
+
+X<variables;hypothetical>
+X<hypothetical variables>
+X<rules;captures>
+Hypothetical variables are a powerful way of building up data structures from
+within a match. Ordinary captures with C<()> store the result of the captures
+in C<$1>, C<$2>, etc. PGE stores values in these variables if the match is
+successful, but throws them away if the match fails.  The numbered capture
+variables are accessible outside the match, but only within the immediate
+surrounding lexical scope:
+
+  "Zaphod Beeblebrox" ~~ m:w/ (\w+) (\w+) /;
+
+  print $1; # prints Zaphod
+
+You can also capture into any user-defined variable with the binding operator
+C<:=> -- I<if> you have declared these variables in a lexical scope enclosing
+the rule:
+
+  my $person;
+  "Zaphod's just this guy." ~~ / ^ $person := (\w+) /;
+  print $person; # prints Zaphod
+
+You may capture repeated matches into an array:
+
+  my @words;
+  "feefifofum" ~~ / @words := (f<-[f]>+)* /;
+  # @words contains ("fee", "fi", "fo", "fum")
+
+You may capture pairs of repeated matches into a hash:
+
+  my %customers;
+  $records ~~ m:w/ %customers := [ E<lt>idE<gt> = E<lt>nameE<gt> \n]* /;
+
+If you don't need the captured value outside the rule, use a C<$?> variable
+instead. These are only directly accessible within the rule:
+
+  "Zaphod saw Zaphod" ~~ m:w/ $?name := (\w+) \w+ $?name/;
+
+A match of a named rule stores the result in a C<$?> variable with the same
+name as the rule. These variables are also accessible only within the rule:
+
+  "Zaphod saw Zaphod" ~~ m:w/ E<lt>nameE<gt> \w+ $?name /;
+
+=for author
+
+This next paragraph feels out of place; is there more?
+
+=end for
+
+When a rule matches a sequence of input tokens, PCT calls an associated method
+within NQP to convert that match into an AST node, which it inserts into the
+I<parse tree>.
+
+=head3 Basic Rules
+
+Consider the simple example rule:
+
+ rule persons_name {
+    <first_name> <last_name>
+ }
+
+... and two example tokens:
+
+ token first_name { <alpha>+ }
+ token last_name  { <alpha>+ }
+
+The special token C<< <alpha> >> is a built-in construct that only accepts
+upper case and lower case letters. The C<+> after the C<< <alpha> >> tag is a
+short way of saying "one or more". The rule will match names like C<Darth
+Vader>N<It also matches many strings that I<aren't> real names>, but won't
+match something like C<C 3P0>.
+
+This rule I<will> match C<Jar Jar Binks>, but not as you might expect: way you
+would expect: It would match the first "Jar" as C<< <first_name> >>, the second
+"Jar" as C<< <last_name> >>, and ignore "Binks"N<You should ignore the whole
+thing.>.
+
+=for author
+
+The rest seems vestigial.  An example like this should precede the rest of the
+chapter.  There are forward references, but it's a decent overview for people
+who haven't used similar systems before -- if you avoid going out in the weeds.
+
+=end for
+
+this example shows another new construct, the square brackets. Square
+brackets are ways to group things together. The star at the end means
+that we take all the things inside the brackets zero or more times.
+This is similar to the plus, except the plus matches one or more times.
+Notice, however, that the above rule always matches a comma at the end,
+so we would need to have something like:
+
+ Darth Vader, Luke Skywalker,
+
+Instead of something more natural like:
+
+ Darth Vader, Luke Skywalker
+
+We can modify the rule a little bit so that it always ends with a name
+instead of a comma:
+
+ rule TOP {
+    [ <persons_name> ',' ]* <persons_name>
+ }
+
+Now we don't need a trailing comma, but at the same time we can't match
+an empty file because it always expects to have at least one name at the
+end. If we still want to match empty files successfully, we need to make
+the whole rule optional:
+
+ rule TOP {
+    [ [ <persons_name> ',' ]* <persons_name> ]?
+ }
+
+We've grouped the whole rule together in another set of brackets, and
+put a "?" question mark at the end. The question mark means zero or
+one of the prior item.
+
+The symbols "*" (zero or more), "+" (one or more) and "?" are called
+I<quantifiers>, and allow an item in the rule to match a variable
+number of times. These aren't the only quantifiers, but they are the
+most common. We will talk about other quantifiers later on.
+
+=cut
+
+# Local variables:
+#   c-file-style: "parrot"
+# End:
+# vim: expandtab shiftwidth=4:

Added: branches/orderedhash_revamp/docs/book/pct/ch05_nqp.pod
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/docs/book/pct/ch05_nqp.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,219 @@
+=pod
+
+=head1 Grammar Actions
+
+The job of the grammar is to match input patterns from the source language.
+These patterns then need to get converted to nodes in the abstract syntax
+tree for manipulation in other stages of the compiler. We've already seen
+one example of a subroutine structure that takes a match and produces a
+tree node: Protofunctions. Protofunction signatures aren't the only way to
+apply functions to rules matched by a parser.  They are limited and are
+slightly primitive, but effective for handling operators.  There is an
+easier and more powerful way to write subroutines to convert match objects
+into parse tree nodes, using a language that's almost, but Not Quite Perl.
+
+X<NQP>
+X<Not Quite Perl>
+NQP (Not Quite Perl) is a small language which offers a limited subset of
+Perl 6's syntax and semantics. Though it originated as a bootstrapping tool
+for the Rakudo Perl 6 compiler, several other Parrot-based compilers use it
+as well.  It has become a permanent member of PCT, and therefore a permanent
+part of the Parrot code base. 
+
+NQP represents almost the smallest subset of the Perl 6 language necessary to
+implement parser transformations, plus a few syntactic convenience features
+that developers have requested. NQP's Perl 6 subset shows its Perl 5 roots,
+so existing Perl 5 programmers should find much of it familiar and should be
+able to leverage their existing skills for writing compilers.
+
+In PGE, at the time of a match the grammar we can invoke an action using the
+special C<{*}> symbol. In general, these action methods are
+written in NQP, although it is possible for them to be written in PIR N<In
+fact, this is how the NQP compiler itself is written>. We won't discuss the
+PIR case here because it's uncommon and needlessly difficult. NQP is the
+standard and preferred choice for this.
+
+=head2 NQP Basics
+
+X<sigils>
+X<scalar>
+Like all flavors and versions of Perl, NQP uses special prefix symbols called
+I<sigils> to distinguish variable types. The C<$> sigil represents scalars,
+C<@> arrays, and C<%> for hashes.  A scalar is any single value which can
+interchangeably contain given a string value, an integer value, or an object
+reference. Simple NQP assignments are:
+
+ $scalar := "This is a string"
+ $x      := 123
+ $pi     := 3.1415      # rounding
+
+X<bind operator>
+X<operators; binding>
+X<:=>
+The C<:=> I<bind> operator performs reference assignment in NQP. Reference
+assignment makes one variable into an alias for another. This means that
+the two variables are just different names for the same storage location,
+and changes to one will change both. It's important to remember that a bind
+is not a copy!
+
+NQP has hashes and arrays just like other flavors of Perl and various
+dynamic languages. NQP does not have a notion of hash and array context,
+but otherwise it works the way you would expect. Arrays have the C<@> sigil,
+and hashes have the C<%> sigil. Here are some examples:
+
+  @ary[0] := 1;
+  @ary[1] := "foo";
+  ...
+
+  %hsh{'bar'} := 2;
+  %hsh{'baz'} := "parrot";
+  ...
+
+There is also a nice shorthand way to index hashes, using angle brackets:
+
+  %hsh<bar> := "parrot";
+
+It's also possible to assign a list in I<scalar context>:
+
+ $array_but_a_scalar := (1, 2, 3, 4)
+
+Or you could write a new function in PIR to create a new array from a variadic
+argument list:
+
+ @my_array := create_new_array(1, 2, 3, 4)
+
+... which calls the PIR function:
+
+=begin PIR
+
+ .namespace []
+
+ .sub 'create_new_array'
+     .param pmc elems :slurpy
+     .return(elems)
+ .end
+
+=end PIR
+
+=head3 Calling Actions From Rules
+
+=for editor
+
+Needs a link to that section.
+
+=end for
+
+As mentioned in the chapter on grammar rules, the funny little C<{*}> symbol
+calls an action. The action in question is an NQP method with the same name as
+the rule that calls it. NQP rules can have two different signatures:
+
+ method name ($/)      { ... }
+ method name($/, $key) { ... }
+
+Where does the key come from?  Consider this grammar:
+
+ rule cavepeople {
+      'Fred'  {*}    #= Caveman
+    | 'Wilma' {*}    #= Cavewoman
+    | 'Dino'  {*}    #= Dinosaur
+ }
+
+The C<cavepeople> rule demonstrates the result:
+
+ method cavepeople($/, $key) {
+    if $key eq 'Caveman' {
+        say "We've found a caveman!";
+    } elsif $key eq 'Cavewoman' {
+        say "We've found a cavewoman!";
+    } elsif $key eq 'Dinosaur' {
+        say "A dinosaur isn't a caveperson at all!";
+    }
+ }
+
+The key is a string that contains whatever any text following the C<#=> symbol.
+Without a C<#=> following the rule invocation, there's no C<$key> to use in the
+method.  If you attempt to use one without the other, the NQP compiler will die
+with error messages about mismatched argument/parameter numbers.
+
+=head3 The Match Object C<$/>
+
+X<match object>
+X<$/>
+The match object C<$/> it's a data structure that's all business: it's both a
+hash and an array. Because it's a special variable used pervasively in PCT, it
+has a special shortcut syntax:
+
+ $/{'Match_item'}   is the same as $<Match_item>
+ $/[0]              is the same as $[0]
+
+Each key in the match object's hash is the name of a matched rule.  Given a
+file containing "C<X + 5>" and a rule:
+
+ rule introductions {
+    <variable> <operator> <number>
+ }
+
+The resulting match object will contain the key/value pairs:
+
+ "variable" => "x"
+ "operator" => "+"
+ "number"   => "5"
+
+When the match contains multiple values with the same name, or when rules have
+quantifiers such as C<*> or C<+>, the values in the hash may be arrays.  Given
+the input "A A A B B" and the rule:
+
+ rule letters {
+    <vowel>* <consonant>*
+ }
+
+The match object will contain the pairs:
+
+ "vowel"     => ["A", "A", "A"]
+ "consonant" => ["B", "B"]
+
+X<$( ) operator>
+
+Use the C<$( )> operator to count the number of matches in each group (by
+casting it to a scalar):
+
+ $($<vowel>) == 3
+
+=head3 Inline PIR
+
+=for author
+
+Needs expansion.
+
+=end for
+
+X<{{ }}>
+X<double curly brackets>
+Sometimes NQP isn't quite flexible enough to handle transforms appropriately.
+In a PGE rule, the C<{{ }}> double curly brackets demarcate inline-PIR mode.
+PGE will execute any PIR code in those brackets. You can access C<$/> directly
+in the grammar without having to jump into NQP.
+
+=head3 PAST Nodes
+
+X<PAST>
+X<PAST nodes>
+NQP's job is to make abstract syntax trees.  These trees are all objects -- and
+as such, instances of PAST nodes.  Each PAST class represents a unique program
+construct.  These constructs are common and simple, but combine to represent
+complicated programming structures.
+
+=head3 Making Trees
+
+Every action has the ability to create a PAST node that represents that action,
+as well as any children of that node. Calling C<make> on that node adds it into
+the growing PAST tree that PCT maintains. Once the C<TOP> rule matches
+successfully and returns, PCT optimizes and converts that tree into PIR and PBC
+for execution.
+
+=cut
+
+# Local variables:
+#   c-file-style: "parrot"
+# End:
+# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/docs/book/pir/ch01_introduction.pod
==============================================================================
--- branches/orderedhash_revamp/docs/book/pir/ch01_introduction.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/book/pir/ch01_introduction.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -83,10 +83,10 @@
 X<development cycles>
 
 Parrot's first release occurred in September 2001.  The 1.0 release took place
-on March 17, 2009.  2009. The Parrot project makes releases on the third
-Tuesday of each month. Two releases a year E<mdash> occuring every January and
-July E<mdash> are "supported" releases intended for production use.  The other
-ten releases are development releases intended for language implementers and
+on March 17, 2009. The Parrot project makes releases on the third Tuesday of
+each month. Two releases a year E<mdash> occuring every January and July
+E<mdash> are "supported" releases intended for production use.  The other ten
+releases are development releases intended for language implementers and
 testers.
 
 Development proceeds in cycles around releases. Activity just before a release

Modified: branches/orderedhash_revamp/docs/book/pir/ch03_basic_syntax.pod
==============================================================================
--- branches/orderedhash_revamp/docs/book/pir/ch03_basic_syntax.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/book/pir/ch03_basic_syntax.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -176,7 +176,7 @@
 PIR also has named variables; the C<.local>
 directive declares them. As with register variables, there are four valid types:
 C<int>, C<num>, C<string>, and C<pmc>. You I<must> declare named variables; 
-otherwise they behave exactly the same as register variables.
+once declared, they behave exactly the same as register variables.
 
 =begin PIR_FRAGMENT
 
@@ -220,7 +220,7 @@
 variables (such as an array). A key is either an integer or a string; and it's
 always enclosed in square brackets (C<[> and C<]>).  You do not have to declare
 literal keys.  This code example stores the string "foo" in $P0 as element 5,
-and then retreives it.
+and then retrieves it.
 
 =begin PIR_FRAGMENT
 

Modified: branches/orderedhash_revamp/docs/book/pir/ch04_variables.pod
==============================================================================
--- branches/orderedhash_revamp/docs/book/pir/ch04_variables.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/book/pir/ch04_variables.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -131,18 +131,18 @@
 
 =head3 Floating-point operations
 
-The most common floating-point operations are C<ln>X<ln opcode> (natural
-log), C<log2>X<log2 opcode> (log base 2), C<log10>X<log10 opcode> (log
-base 10), and C<exp>X<exp opcode> (I<e>G<x>), as well as a full set of
-trigonometric opcodes such as C<sin>X<sin opcode> (sine), C<cos>X<cos
-opcode> (cosine), C<tan>X<tan opcode> (tangent), C<sec>X<sec opcode>
-(secant), C<cosh>X<cosh opcode> (hyperbolic cosine), C<tanh>X<tanh
+The most common floating-point operations are C<ln>X<ln opcode> (natural log),
+C<log2>X<log2 opcode> (log base 2), C<log10>X<log10 opcode> (log base 10), and
+C<exp>X<exp opcode> (I<e>G<x>), as well as a full set of trigonometric opcodes
+such as C<sin>X<sin opcode> (sine), C<cos>X<cos opcode> (cosine), C<tan>X<tan
+opcode> (tangent), C<sec>X<sec opcode> (secant), C<sinh>X<sinh opcode>
+(hyperbolic sine), C<cosh>X<cosh opcode> (hyperbolic cosine), C<tanh>X<tanh
 opcode> (hyperbolic tangent), C<sech>X<sech opcode> (hyperbolic secant),
 C<asin>X<asin opcode> (arc sine), C<acos>X<acos opcode> (arc cosine),
-C<atan>C<atan opcode> (arc tangent), C<asec>X<asec opcode> (arc secant),
+C<atan>X<atan opcode> (arc tangent), C<asec>X<asec opcode> (arc secant),
 C<exsec>X<exsec opcode> (exsecant), C<hav>X<hav opcode> (haversine), and
-C<vers>X<vers opcode> (versine).  All angle arguments for the
-X<trigonometric opcodes> trigonometric opcodes are in radians:
+C<vers>X<vers opcode> (versine).  All angle arguments for the X<trigonometric
+opcodes> trigonometric opcodes are in radians:
 
 =begin PIR_FRAGMENT
 
@@ -160,7 +160,7 @@
 X<logical opcodes>
 The logical opcodes evaluate the truth of their arguments.  They are most
 useful to make decisions for control flow.  Integers and numeric PMCs
-support logical are false if they're 0 and true otherwise. Strings are
+are false if they're 0 and true otherwise. Strings are
 false if they're the empty string or a single character "0", and true
 otherwise. PMCs are true when their C<get_bool>X<get_bool vtable
 function> vtable function returns a nonzero value.
@@ -188,7 +188,7 @@
 =end PIR_FRAGMENT
 
 Both C<and> and C<or> are short-circuiting ops. If they can determine what
-value to return from the first argument, they'll never evaluate the third.
+value to return from the first argument, they'll never evaluate the second.
 This is significant only for PMCs, as they might have side effects on
 evaluation.
 
@@ -403,7 +403,7 @@
 terminator must appear on its own line, must appear at the beginning of the
 line, and may not have any trailing whitespace.
 
-  $S2 = << "End_Token"
+  $S2 = <<"End_Token"
   This is a multi-line string literal. Notice that
   it doesn't use quotation marks.
   End_Token
@@ -828,7 +828,7 @@
 
 =begin PIR_FRAGMENT
 
-  $P0 = new "Array"
+  $P0 = new "ResizablePMCArray"
   push $P0, "hi"
   push $P0, 0
   push $P0, 1
@@ -1030,7 +1030,7 @@
 X<PMCs (Polymorphic Containers);scalar>
 In most of the examples shown so far, PMCs duplicate the behavior of integers,
 numbers, and strings. Parrot provides a set of PMCs for this exact purpose.
-C<Integer>, C<Number>, and C<String> are thin overlays on Parrot's low-level
+C<Integer>, C<Float>, and C<String> are thin overlays on Parrot's low-level
 integers, numbers, and strings.
 
 A previous example showed a string literal assigned to a PMC variable of type
@@ -1045,7 +1045,7 @@
   $P1 = new 'String'
   $P1 = "5 birds"
 
-  $P2 = new 'Number'
+  $P2 = new 'Float'
   $P2 = 3.14
 
 =end PIR_FRAGMENT
@@ -1068,7 +1068,7 @@
   $P1 = $S1
 
   $N2 = 3.14
-  $P2 = new 'Number'
+  $P2 = new 'Float'
   $P2 = $N2
 
 =end PIR_FRAGMENT
@@ -1082,7 +1082,7 @@
 
   $P1 = box $S1  # $P1 is a "String"
 
-  $P2 = box 3.14 # $P2 is a "Number"
+  $P2 = box 3.14 # $P2 is a "Float"
 
 =end PIR_FRAGMENT
 
@@ -1110,7 +1110,7 @@
 
 =end PIR_FRAGMENT
 
-This example creates C<Integer>X<Integer PMC>, C<Number>X<Number PMC>,
+This example creates C<Integer>X<Integer PMC>, C<Float>X<Float PMC>,
 and C<String>X<String PMC> PMCs, and shows the effect of assigning each
 one back to a low-level type.
 
@@ -1281,16 +1281,6 @@
 
 =end PIR_FRAGMENT
 
-Alternatively, you can also create an iterator by creating a new
-C<Iterator>X<Iterator PMC> PMC, passing the aggregate PMC as an
-initialization parameter to C<new>:
-
-=begin PIR_FRAGMENT
-
-  $P1 = new "Iterator", $P2
-
-=end PIR_FRAGMENT
-
 The C<shift>X<shift opcode> opcode extracts the next value from the iterator.
 
 =begin PIR_FRAGMENT
@@ -1785,7 +1775,7 @@
 
   $P1 = $P0.'find_namespace'("Duck")
 
-The C<add_namespace>C<add_namespace method> method adds a new namespace
+The C<add_namespace>X<add_namespace method> method adds a new namespace
 as a child of the namespace object:
 
   $P0.'add_namespace'($P1)

Modified: branches/orderedhash_revamp/docs/book/pir/ch05_control_structures.pod
==============================================================================
--- branches/orderedhash_revamp/docs/book/pir/ch05_control_structures.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/book/pir/ch05_control_structures.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -17,7 +17,7 @@
 X<unconditional branch>
 An unconditional branch always jumps to a specified label.  PIR has only
 one unconditional branch instruction, C<goto>. In this example, the
-first C<print> statement never runs because the C<goto> always skips
+first C<say> statement never runs because the C<goto> always skips
 over it to the label C<skip_all_that>:
 
 =begin PIR_FRAGMENT
@@ -298,7 +298,7 @@
     ...
   }
 
-where C<i> is the counter, C<i = 1> sets the start value, C<<i <= 10>> checks
+where C<i> is the counter, C<i = 1> sets the start value, C<< i <= 10 >> checks
 the stop condition, and C<i++> steps to the next iteration.  A I<for> loop in
 PIR requires one conditional branch and two unconditional branches.
 

Modified: branches/orderedhash_revamp/docs/book/pir/ch06_subroutines.pod
==============================================================================
--- branches/orderedhash_revamp/docs/book/pir/ch06_subroutines.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/book/pir/ch06_subroutines.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -76,7 +76,7 @@
 By default, Parrot stores all subroutines in the namespace currently
 active at the point of their declaration. The C<:anon>X<:anon subroutine
 modifier> modifier tells Parrot not to store the subroutine in the
-namespace. The C<:nsentry>X:nsentry subroutine modifier> modifier stores
+namespace. The C<:nsentry>X<:nsentry subroutine modifier> modifier stores
 the subroutine in the currenly active namespace with a different name.
 For example, Parrot will store this subroutine in the current namespace
 as C<bar>, not C<foo>:
@@ -188,7 +188,7 @@
 X<named parameters>
 Named parameters are an alternative to positional parameters. Instead of
 passing parameters by their position in the string, Parrot assigns
-arguments to parameters by their name.  Consequencly you may pass named
+arguments to parameters by their name.  Consequently you may pass named
 parameters in any order.  Declare named parameters with with the
 C<:named>X<:named parameter modifier> modifier.
 
@@ -390,7 +390,7 @@
 
   $ parrot args.pir foo bar baz
 
-... they will be accesible at index 1, 2, and 3 of the PMC parameter.N<Index 0
+... they will be accessible at index 1, 2, and 3 of the PMC parameter.N<Index 0
 is unused.>
 
 =begin PIR
@@ -541,7 +541,7 @@
 
 =begin PIR_FRAGMENT
 
-  $P0 = inspect $P0, "pos_required"
+  $P1 = inspect $P0, "pos_required"
 
 =end PIR_FRAGMENT
 
@@ -643,7 +643,7 @@
 
 =begin PIR_FRAGMENT
 
-      .local int foo
+      .local pmc foo
       .lex 'foo', foo
 
 =end PIR_FRAGMENT
@@ -662,7 +662,7 @@
 what it knows about lexical variables. Not all subroutines get a C<LexInfo> PMC
 by default; subroutines need to indicate to Parrot that they require a
 C<LexInfo> PMC. One way to do this is with the C<.lex> directive.  Of course,
-the C<.lex> directive only works for languages that know the names of there
+the C<.lex> directive only works for languages that know the names of their
 lexical variables at compile time. Languages where this information is not
 available can mark the subroutine with C<:lex> instead.
 

Modified: branches/orderedhash_revamp/docs/book/pir/ch09_exceptions.pod
==============================================================================
--- branches/orderedhash_revamp/docs/book/pir/ch09_exceptions.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/book/pir/ch09_exceptions.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -108,14 +108,14 @@
 
 =end PIR_FRAGMENT
 
-This example creates an exception handler C<my_handler> and then runs a a
+This example creates an exception handler C<my_handler> and then runs a
 division operation that will throw a "division by zero" exception if C<$I2> is
 0. When C<$I2> is 0, C<div> throws an exception.  The exception handler catches
 it, prints "caught an exception", and then clears itself with C<pop_eh>. When
 C<$I2> is a non-zero value, there is no exception.  The code clears the
 exception handler with C<pop_eh>, then prints "maybe printed".  The C<goto>
 skips over the code of the exception handler, as it's just a labeled unit of
-code within the subruotine.
+code within the subroutine.
 
 The exception object provides access to various attributes of the
 exception for additional information about what kind of error it was,

Modified: branches/orderedhash_revamp/docs/compiler_faq.pod
==============================================================================
--- branches/orderedhash_revamp/docs/compiler_faq.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/compiler_faq.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -96,7 +96,7 @@
 There are several ways to achieve this, depending on the location of
 the subroutine.
 
-If the sub is in the same compilation unit use a Sub constant:
+If the sub is in the same file use a Sub constant:
 
 =begin PIR_FRAGMENT
 
@@ -179,7 +179,7 @@
 =end PIR
 
 The sub C<bar> will return to the caller of C<foo>. (Warning! This fails
-in some cases. XXX Find the RT ticket and reference it here.)
+in some cases. XXX Find the Trac ticket and reference it here.)
 
 =head2 How do I generate a sub call with a variable-length parameter
 list in PIR?
@@ -780,22 +780,4 @@
 See F<config_lib.pasm> for all the keys in the config hash - or iterate over
 the config hash.
 
-=head1 Languages
-
-=head2 What files do I need to modify to add my new language compiler?
-
-Aside from the files in your new language directory, you must modify
-
-    CREDITS
-    MANIFEST
-    config/gen/languages.pm
-    config/gen/makefiles/languages.in
-
-Inside your language dir, you may consider adding the following:
-
-    LICENSE
-    MAINTAINER
-    README
-    STATUS
-
-Look to existing languages for some examples.
+=cut

Modified: branches/orderedhash_revamp/docs/configuration.pod
==============================================================================
--- branches/orderedhash_revamp/docs/configuration.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/configuration.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -26,7 +26,9 @@
 example, if you added a new user-configurable type called C<FOOVAL>, you would
 add the code used to determine its size in F<config/auto/sizes.pm>.  However,
 if you were determining what dynaloading capabilities are available, you would
-create a new step.
+create a new step.  It is strongly recommended that you file a Trac ticket in
+which you state the rationale for adding a new configuration step and sketch
+out what the code in the step would look like.
 
 =head2 Initialization Steps
 
@@ -57,9 +59,10 @@
 
 =head2 Generations
 
-Generations create files needed after configuration has completed, such as
-Makefiles and configuration headers. A step containing generations is a
-I<generation step>. Generation steps should be in the F<config/gen> folder.
+Generations create files which will be needed once configuration has
+completed, such as Makefiles and configuration headers. A step containing
+generations is a I<generation step>. Generation steps should be in the
+F<config/gen> folder.
 
 Templates for files to be generated usually have the extension F<.in>.  There
 are variable substitutes and funny macros like C<#IF> and C<#UNLESS>

Modified: branches/orderedhash_revamp/docs/debug.pod
==============================================================================
--- branches/orderedhash_revamp/docs/debug.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/debug.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -57,19 +57,6 @@
 maximizes the probability that any newborn objects will run afoul of the
 garbage collector.
 
-Within the C<--gc-debug> mode, there is another tool to help narrow down the
-problem. You can edit F<include/parrot/gc_api.h> and C<#define> the C<GC_VERBOSE> flag to
-1.  After recompiling C<parrot>, the garbage collector will perform additional
-checks. After the garbage collector has traced all objects to find which ones
-are still alive, it will scan through all of the dead objects to see if any of
-them believe they are alive (which will happen for infants, since they come
-into existence marked live.) If it finds any, it will print them out.
-You can then re-run the program with a breakpoint set on the routine that
-allocated the object (e.g. C<get_free_object> in F<src/gc/mark_sweep.c>).
-You'll probably want to make the breakpoint conditional on the object having
-the version number that was reported, because the same memory location will
-probably hold many different objects over the lifetime of the program.
-
 =head1 PIR AND PASM CODE
 
 Let's say you have written (or generated) a huge .pasm or .pir file.  It's not
@@ -80,76 +67,6 @@
 One possible tool is C<parrot_debugger>, the Parrot Debugger.
 See F<docs/debugger.pod> for details on it.
 
-=head2 stabs
-
-If you are running on a jit-capable machine, you can also try using C<gdb> by
-having the JIT compiler generate C<stabs> metadata and then stepping through
-the code with C<gdb> as if it were any other language.
-
-To use this, you'll want to use C<parrot> to generate your bytecode (.pbc
-file). It is not strictly necessary, but you'll get more information into the
-bytecode this way.
-
-Let's say your file is named C<test.pasm>. (Note: these instructions will also
-work if you use C<test.pir> everywhere C<test.pasm> occurs.)
-
-Step 1: Generate the .pbc file with extra debugging information.
-
-  shell> parrot -d -o test.pbc test.pasm
-
-Step 2: Start up C<parrot> under C<gdb>
-
-  % gdb parrot
-
-or
-
-  % emacs &
-  (in emacs) M-x gdb
-  (in emacs) type "parrot" so it says "gdb parrot"
-
-Step 3: Set a breakpoint on runops_jit
-
-  gdb> b runops_jit
-
-Step 4: Run your program under C<gdb> with JIT and debugging on
-
-  gdb> run -R jit -D4 test.pbc
-
-Step 5: C<gdb> will stop at the beginning of runops_jit. Step through the lines
-until just before the JITed code is executed (the line will be something like
-C<(jit_code)(interpreter,pc)>.
-
-  gdb> n
-  gdb> n
-  .
-  .
-  .
-
-Step 6: load in the debugging information from the symbol file that the jit
-just generated.
-
-  gdb> add-symbol-file test.o 0
-
-Step 7: Step into the JITed code
-
-  gdb> s
-
-At this point, you can step through the instructions, or print out the
-various Parrot registers. FIXME: C<gdb> will know about I0-I31,
-N0-N31, S0-S31, and P0-P31.
-
-
-WARNING: Stepping too far
-
-One thing to watch out for is that C<gdb> gets confused when attempting to step
-over certain instructions. The only ones that I have noticed having problems is
-keyed operations. With my version of C<gdb>, if I do 'n' to step over the
-instruction, C<gdb> will start running and only stop when the entire parrot
-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-dev at lists.parrot.org>).
-
 =head1 PIR CODE GENERATION
 
 The C<parrot> binary has a bunch of debugging flags for spewing out information

Modified: branches/orderedhash_revamp/docs/debugger.pod
==============================================================================
--- branches/orderedhash_revamp/docs/debugger.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/debugger.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2006, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
 =head1 NAME
@@ -20,17 +20,16 @@
 required to read this document. Some familiarity with debugging principles is
 also mandatory beyond this point.
 
+
 =head1 BUILDING parrot_debugger
 
-The debugger is not built with Parrot, but you should make it with its specific
-target:
+The debugger is built along with Parrot when you run 'make', but if you want to build 
+*only* the debugger, then you can run:
 
   make parrot_debugger
 
-(where C<make> is the same C<make> incarnation you used to build Parrot).
-
-If everything goes well, you should come up with a F<parrot_debugger>
-executable in the same directory as the Parrot program.
+Which will create a new parrot_debugger executable in the same directory as the parrot
+executable.
 
 =head1 THE DEBUGGER SHELL
 
@@ -38,8 +37,9 @@
 
   parrot_debugger file.pbc
 
-That is, F<parrot_debugger> takes exactly one argument, which is the Parrot bytecode that
-you're going to debug. F<parrot_debugger> will automatically load and disassemble the
+That is, F<parrot_debugger> takes exactly one argument, which is the Parrot file that
+you're going to debug. This file may be Parrot bytecode (*.pbc), PASM source code (*.pasm)
+or PIR (*.pir). F<parrot_debugger> will automatically load and disassemble the
 bytecode file for you.
 
 Note that you can't pass command line arguments to your program when you invoke
@@ -64,8 +64,8 @@
 Most commands can be shortened to their first letter. When available, this is
 signaled by the letter in parentheses after the command name Thus, C<help (h)>
 means that the command can be given as 'help' or just 'h'. On the other hand,
-C<load> can only be given as 'load', verbatim.  And the debugger is case
-sensitive.
+C<load> can only be given as 'load', verbatim.  Debugger commands are case
+sensitive (LOAD is not a valid command) but Parrot register names are not.
 
 A blank line always repeats the last command entered.
 
@@ -76,6 +76,21 @@
 
 =over 4
 
+=item assign
+
+Assign to a Parrot register. For example:
+
+    (pdb)    a I0 42
+
+        I0 = 42
+
+    (pdb)    a N1 3.14
+
+        N1 = 3.14
+
+The first command sets I0 to 42 and the second sets N1 to 3.14. Register names are not
+case sensitive, so you can use either i0 or I0 .
+
 =item disassemble
 
 Disassemble a loaded bytecode file. This will turn a file loaded with C<load>
@@ -235,6 +250,8 @@
 
 =item eval (e)
 
+The eval command is currently unimplemeneted.
+
 Run an instruction. The syntax is:
 
   eval INSTRUCTION
@@ -273,7 +290,7 @@
 
 =item print (p)
 
-Print the interpreter registers. The syntax is:
+Print the interpreter registers. Register names are not case sensitive. The syntax is:
 
   print VALUE
 
@@ -297,54 +314,24 @@
 
 For PMC registers, the command will print the number, the class of the PMC (in
 square brackets) and its string representation (when available). It prints
-<null pmc> for uninitialized PMC registers.
+<PMCNULL> for uninitialized PMC registers.
 
-Example:
+Examples:
 
   # prints the content of I2
   (pdb) p i2
-  Integer Registers:
   I2 =              0
 
   # prints the content of P0
   (pdb) p P0
-  PMC Registers:
   P0 = [ResizablePMCArray]
 
   # prints the content of all string registers
   (pdb) p s
-  String Registers:
-   0 =
-          Buflen  =                  4
-          Flags   =                  0
-          Bufused =                  4
-          Strlen  =                  4
-          Offset  =                  0
-          String  =       Just
-   1 =
-          Buflen  =                  8
-          Flags   =                  0
-          Bufused =                  7
-          Strlen  =                  7
-          String  =       another
-   2 =
-          Buflen  =                  8
-          Flags   =                  0
-          Bufused =                  6
-          Strlen  =                  6
-          String  =       Parrot
-   3 =
-          Buflen  =                  8
-          Flags   =                  0
-          Bufused =                  6
-          Strlen  =                  6
-          String  =       hacker
-   4 =
-   5 =
-   6 =
-   7 =
-   8 =
-   # ... and so on
+   S0 = Just
+   S1 = Another
+   S2 = Parrot
+   S3 = Hacker
 
 =item info
 
@@ -381,10 +368,10 @@
 
 =over 4
 
-=item src/pdb.c
+=item src/parrot_debugger.c
 
-This is the file that will produce the executable.  Nothing fancy here, only
-the C<main> function.
+This is the file that will produce the executable.  Nothing fancy here, it
+mostly consists of the C<main> function.
 
 =item src/debug.c
 
@@ -395,7 +382,7 @@
 
 C<Parrot_debug>, the function which launches the debugger, is implemented here.
 
-=item include/parrot/debug.h
+=item include/parrot/debugger.h
 
 This defines all the PDB structures, which hold data used by the debugger.
 

Modified: branches/orderedhash_revamp/docs/dev/events.pod
==============================================================================
--- branches/orderedhash_revamp/docs/dev/events.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/dev/events.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -82,15 +82,13 @@
 handler replaces backward branches in the opcode image with the
 B<check_events__> opcode.
 
-The JIT core doesn't handle events yet.
-
 After all events are popped off and handled, the opcode dispatch table is
 restored to its original, and the B<check_events__> reexecutes the same
 instruction again, which is now the real one and thus normal execution flow
 continues.
 
 This scheme has zero overhead in the absence of scheduled events for all cores
-except switched and JIT.
+except switched.
 
 =head1 Missing
 

Deleted: branches/orderedhash_revamp/docs/dev/jit_i386.pod
==============================================================================
--- branches/orderedhash_revamp/docs/dev/jit_i386.pod	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,298 +0,0 @@
-# Copyright (C) 2001-2006, Parrot Foundation.
-# $Id$
-
-=head1 NAME
-
-docs/dev/jit_i386.pod - Parrot JIT (i386/gcc)
-
-=head1 ABSTRACT
-
-This PDD describes the i386 gcc JIT implementation.
-
-=head1 DESCRIPTION
-
-JIT i386/gcc is a combination of unrolled assembly instructions and the
-Computed Goto Predereferenced (CGP) run loop. For branch instructions the
-function implementation in the standard core is called.
-
-Another difference of JIT/i386 is that most vtable functions are JITed
-instructions which use register mappings.
-
-For a better understanding of the control flow between these basically 3 run
-loop cores, an example shows the gory details.
-
-=head1 EXAMPLE
-
-Given the following PASM program, the righthand three columns show where  each
-opcode gets executed:
-
-        PASM                 JIT ops   Normal     CGP ops
-
-=begin PASM
-	                     # (call cgp_core)      (jmp back)
-
-	set I0, 10           # set_i_ic
-	print I0             # (call)               print_i
-	print "\n"           #                      print_sc
-	bsr inc              # (call)     bsr_ic    cpu_ret
-	end                  # (jmp) HALT           end (ret)
-	                     # end (ret)
-  inc:
-	inc I0               # inc_i
-	new P0, 'String'     # new_p_sc
-	set P0, I0           # set_p_i
-	print P0             # (call)               print_p
-	print "\n"           #                      print_sc
-	ret                  # (call)     ret       cpu_ret
-
-=end PASM
-
-=head2 Startup sequence
-
-In B<runops_jit> a prederefed copy of the opcode stream is built by
-B<init_prederef>. Then B<build_asm> generates the assembler code sequence as
-usual. This generated code (shown as B<runops_jit> in B<ddd>) is then executed.
-
-Generate minimal stack frame, save %ebx
-
-    0x812c510 <jit_func>:	push   %ebp
-    0x812c511 <jit_func+1>:	mov    %esp,%ebp
-    0x812c513 <jit_func+3>:	push   %ebx
-
-Get the program counter to %ebx
-
-    0x812c514 <jit_func+4>:	mov    0xc(%ebp),%ebx
-
-Push B<interpreter> and B<(opcode_t*) 1> and call B<cgp_core>
-
-    0x812c517 <jit_func+7>:	push   $0x8113db8
-    0x812c51c <jit_func+12>:	push   $0x1
-    0x812c521 <jit_func+17>:	mov    $0x1,%eax
-    0x812c526 <jit_func+22>:	call   0x80b5830 <cgp_core>
-
-In B<cgp_core> all callee saved registers are saved.
-
-    0x80b5830 <cgp_core>:	push   %ebp
-    0x80b5831 <cgp_core+1>:	mov    %esp,%ebp
-    0x80b5833 <cgp_core+3>:	sub    $0xdc,%esp
-    0x80b5839 <cgp_core+9>:	lea    0x8(%ebp),%eax
-    0x80b583c <cgp_core+12>:	push   %edi
-    0x80b583d <cgp_core+13>:	push   %esi
-    0x80b583e <cgp_core+14>:	push   %ebx
-
-In B<%eax> the init flag is set to B<-1>
-
-    0x80b583f <cgp_core+15>:	mov    %eax,0xfffffff
-
-The parameter B<*cur_op> (the program counter) is put into B<%esi> and ...
-
-    0x80b5842 <cgp_core+18>:	mov    0x8(%ebp),%esi
-    0x80b5845 <cgp_core+21>:	test   %esi,%esi
-    0x80b5847 <cgp_core+23>:	jne    0x80b5853 <cgp_core+35>
-    0x80b5849 <cgp_core+25>:	mov    $0x810ca60,%eax
-    0x80b584e <cgp_core+30>:	jmp    0x80bb470 <cgp_core+23616>
-
-... compared to B<1>
-
-    0x80b5853 <cgp_core+35>:	cmp    $0x1,%esi
-    0x80b5856 <cgp_core+38>:	jne    0x80b5860 <cgp_core+48>
-
-If true, the program jumps to the return address of above function call, i.e.
-it jumps back again to JIT code.
-
-    0x80b5858 <cgp_core+40>:	jmp    *0x4(%ebp)
-
-Back again in JIT code, the init flag is checked
-
-    0x812c52b <jit_func+27>:	test   %eax,%eax
-    0x812c52d <jit_func+29>:	jne    0x812c536 <jit_func+38>
-
-... and if zero, the function would be left.
-
- [   0x812c52f <jit_func+31>:	pop    %ebx          ]
- [   0x812c531 <jit_func+33>:	mov    %ebp,%esp     ]
- [   0x812c533 <jit_func+35>:	pop    %ebp          ]
- [   0x812c535 <jit_func+37>:	ret                  ]
-
-When coming from the init sequence, program flow continues by checking the
-B<resume_offset> and jumping to the desired instruction
-
-    0x812c536 <jit_func+38>:	mov    %ebx,%eax
-    0x812c538 <jit_func+40>:	sub    $0x400140c0,%eax
-    0x812c53e <jit_func+46>:	mov    $0x812c4a8,%edx
-    0x812c543 <jit_func+51>:	jmp    *(%edx,%eax,1)
-
-B<set I0, 10> and save_registers
-
-    0x812c546 <jit_func+54>:	mov    $0xa,%ebx
-    0x812c54b <jit_func+59>:	mov    %ebx,0x8113db8
-
-Now non-JITed code follows -- get the address from the prederefed op_func_table
-and call it:
-
-    0x812c551 <jit_func+65>:	mov    $0x812ac0c,%esi
-    0x812c556 <jit_func+70>:	call   *(%esi)
-
-    inline op print(in INT) {
-      printf(INTVAL_FMT, (INTVAL)$1);
-      goto NEXT();
-    }
-
-where the B<goto NEXT()> is a simple:
-
-    0x80b5b49 <cgp_core+793>:	jmp    *(%esi)
-
-    op print(in STR) {
-     ...
-      goto NEXT();
-    }
-
-As the last instruction of the non-JITed code sequence is a branch, this is not
-executed in CGP, but the opcode:
-
-    inline op cpu_ret() {
-    #ifdef __GNUC__
-    # ifdef I386
-       asm("ret")
-
-is executed. This opcode is patched into the prederefed code stream by
-Parrot_jit_normal_op at the end of a non-JITed code sequence. This returns to
-JIT code again, where the next instruction gets called as a function in the
-standard core ...
-
-    0x812c558 <jit_func+72>:	push   $0x8113db8
-    0x812c55d <jit_func+77>:	push   $0x400140dc
-    0x812c562 <jit_func+82>:	call   0x805be60 <Parrot_bsr_ic>
-    0x812c567 <jit_func+87>:	add    $0x8,%esp
-
-... and from the return result in B<%eax>, the new code position in JIT is
-calculated and gets jumped to:
-
-    0x812c56a <jit_func+90>:	sub    $0x400140c0,%eax
-    0x812c570 <jit_func+96>:	mov    $0x812c4a8,%edx
-    0x812c575 <jit_func+101>:	jmp    *(%edx,%eax,1)
-
-Now in the subroutine B<inc>:
-
-    0x812c580 <jit_func+112>:	mov    0x8113db8,%ebx
-    0x812c586 <jit_func+118>:	inc    %ebx
-
-Save register and arguments and call B<pmc_new_noinit>:
-
-    0x812c587 <jit_func+119>:	push   %edx
-    0x812c588 <jit_func+120>:	push   $0x11
-    0x812c58d <jit_func+125>:	push   $0x8113db8
-    0x812c592 <jit_func+130>:	call   0x806fc60 <pmc_new_noinit>
-
-put the PMC* into Parrot's register:
-
-    0x812c597 <jit_func+135>:	mov    %eax,0x8113fb8
-
-and prepare arguments for a VTABLE call:
-
-    0x812c59d <jit_func+141>:	push   %eax
-    0x812c59e <jit_func+142>:	push   $0x8113db8
-    0x812c5a3 <jit_func+147>:	mov    0x10(%eax),%eax
-    0x812c5a6 <jit_func+150>:	call   *0x18(%eax)
-    0x812c5a9 <jit_func+153>:	add    $0x10,%esp
-    0x812c5ac <jit_func+156>:	pop    %edx
-
-and another one:
-
-    0x812c5ae <jit_func+158>:	push   %edx
-
-Here, with the mapped register in B<%ebx>, push B<I0>, the PMC and the
-interpreter:
-
-    0x812c5af <jit_func+159>:	push   %ebx
-    0x812c5b0 <jit_func+160>:	mov    0x8113fb8,%eax
-    0x812c5b6 <jit_func+166>:	push   %eax
-    0x812c5b7 <jit_func+167>:	push   $0x8113db8
-
-and call the vtable:
-
-    0x812c5bc <jit_func+172>:	mov    0x10(%eax),%eax
-    0x812c5bf <jit_func+175>:	call   *0xdc(%eax)
-    0x812c5c5 <jit_func+181>:	add    $0xc,%esp
-    0x812c5c8 <jit_func+184>:	pop    %edx
-
-As this ends the JITed section, used registers are saved back to Parrot's
-register:
-
-    0x812c5ca <jit_func+186>:	mov    %ebx,0x8113db8
-
-and again the code in B<cgp_core> gets called:
-
-    0x812c5d0 <jit_func+192>:	mov    $0x812ac48,%esi
-    0x812c5d5 <jit_func+197>:	call   *(%esi)
-
-which after executing the B<print> returns back here in JIT, where the B<ret>
-is called:
-
-    0x812c5d7 <jit_func+199>:	push   $0x8113db8
-    0x812c5dc <jit_func+204>:	push   $0x40014118
-    0x812c5e1 <jit_func+209>:	call   0x805d5e0 <Parrot_ret>
-    0x812c5e6 <jit_func+214>:	add    $0x8,%esp
-
-From the returned PC a JIT address is calculated, which gets executed:
-
-    0x812c5e9 <jit_func+217>:	sub    $0x400140c0,%eax
-    0x812c5ef <jit_func+223>:	mov    $0x812c4a8,%edx
-    0x812c5f4 <jit_func+228>:	jmp    *(%edx,%eax,1)
-
-Now at the B<end> opcode, the CGP code for HALT() gets jumped to:
-
-    0x812c578 <jit_func+104>:	mov    $0x80b5877,%esi
-    0x812c57d <jit_func+109>:	jmp    *%esi
-
-which is:
-
-    inline op end() {
-      HALT();
-    }
-
-or, set return result:
-
-    0x80b8b6f <cgp_core+13119>:	xor    %eax,%eax
-    ...
-
-and clean up stack frame and ret:
-
-    0x80bb470 <cgp_core+23616>:	lea    0xffffff18(%ebp),%esp
-    0x80bb476 <cgp_core+23622>:	pop    %ebx
-    0x80bb477 <cgp_core+23623>:	pop    %esi
-    0x80bb478 <cgp_core+23624>:	pop    %edi
-    0x80bb479 <cgp_core+23625>:	mov    %ebp,%esp
-    0x80bb47b <cgp_core+23627>:	pop    %ebp
-    0x80bb47c <cgp_core+23628>:	ret
-
-This returns after the position where B<cgp_core> was called during the init
-sequence, but now the return value B<%eax> is zero and the..
-
-    0x812c52b <jit_func+27>:	test   %eax,%eax
-    0x812c52d <jit_func+29>:	jne    0x812c536 <jit_func+38>
-    0x812c52f <jit_func+31>:	pop    %ebx
-    0x812c531 <jit_func+33>:	mov    %ebp,%esp
-    0x812c533 <jit_func+35>:	pop    %ebp
-    0x812c535 <jit_func+37>:	ret
-
-... whole story ends here, we are back again in B<runops_jit>.
-
-So this is rather simple once it gets going.
-
-=head1 BUGS
-
-The floating point registers do not get saved to Parrot before vtable calls.
-This assumes that external routines preserve the FP stack pointer and don't use
-more the 4 floating point registers at once.
-
-=head1 AUTHOR
-
-Leopold Toetsch C<lt at toetsch.at>
-
-=head1 VERSION
-
-=head2 CURRENT
-
-14.02.2003 by Leopold Toetsch
-

Modified: branches/orderedhash_revamp/docs/dev/pmc_freeze.pod
==============================================================================
--- branches/orderedhash_revamp/docs/dev/pmc_freeze.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/dev/pmc_freeze.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -82,27 +82,10 @@
 to the desired functionality. It gets passed on to all vtable methods and
 callback functions.
 
-=head2 Working loops
-
-These are labeled B<visit_loop_*>. There are currently two schemes to handle
-the B<todo_list>.
+=head2 Working loop
 
 =over 4
 
-=item next_for_GC
-
-All PMCs that can contain other PMCs have the B<next_for_GC> pointer in the
-PMC's extended data area. The B<todo_list> gets built by appending (or        
-prepending) the current PMC to a B<mark_ptr>, which then points to the current
-PMC, forming a linked list of items.
-
-This pointer is also used during GC's B<mark()> functionality, so that
-GC has to be turned off during operations using this scheme.
-
-As the B<next_for_GC> pointer is inside the PMC, this scheme isn't thread-safe
-at low-level, because shared PMCs also would share this pointer, so that there
-can be only one operation at a time.
-
 =item todo list
 
 A B<List> called B<todo> holds items still to be worked on. This method is
@@ -118,9 +101,6 @@
 and is called thereafter from all PMCs for contained PMCs inside the B<visit>
 vtable method.
 
-There is another callback B<visit_pmc_later> which adds PMCs to the todo list
-for later processing, but doesn't do any action on these immediately.
-
 
 =head2 The visit() vtable
 
@@ -154,41 +134,6 @@
 overhead, 32-bit system assumed). Hash lookups also take a considerable
 amount of time.
 
-=item B<next_for_GC>
-
-The pointer used for the B<todo_list> handling itself can serve as a marker
-that this item was already processed. There are some issues with this though:
-Plain scalars (not being able to contain other PMCs) don't have a
-B<next_for_GC> pointer. This is an optimization reducing the size of scalars
-and increasing performance considerably.
-
-Second, the B<next_for_GC> pointers have to be cleared beforehand. GC uses
-only a nibble-sized flag area located inside the PMCs arena to manage, if a PMC
-was seen already by checking the live bit. The B<next_for_GC> pointer is just
-set and never cleared to avoid touching a PMCs memory and polluting caches when
-possible.
-
-Finally, generating a PMC's B<id> isn't as simple as just incrementing a
-counter used with the B<seen> hash approach.
-
-=item PMC B<id>s
-
-We could of course use the PMC's address as its own B<id>, since we know it is
-unique. However, this is suboptimal for thawing.  To manage duplicates during
-B<thaw> we basically need a mapping B<PMC_in_image =E<gt>
-newly_constructed_PMC>. When now the B<PMC_in_image> (the B<id>) is the
-address, we have to use a hash again, for B<thaw()> with all the negative
-impact on resources and speed.
-
-So both schemes are using small B<id> values and the seen handling inside
-B<thaw> is done via a list lookup, which is a lot faster and takes less
-resources.
-
-The B<seen> hash approach just has a counter for PMC B<id>s, the B<next_for_GC>
-approach calculates the B<id> from the address of the PMC in its arena, again
-yielding a small and unique number. The two low bits of PMC B<id>s are used as
-flags.
-
 =back
 
 =head2 The actual action
@@ -290,4 +235,3 @@
 =cut
 
 # vim: expandtab shiftwidth=2 tw=70:
-

Added: branches/orderedhash_revamp/docs/dev/profiling.pod
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/docs/dev/profiling.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,60 @@
+# Copyright (C) 2001-2005, Parrot Foundation.
+# $Id$
+
+=head1 Name
+
+docs/dev/profiling.pod - Profiling Parrot
+
+=head1 Description
+
+This file documents the use of Parrot's profiling runcore.
+
+=head2 Summary
+
+The profiling runcore is built as part of Parrot and is designed to allow
+discovery of bottlenecks in PIR code.  It is also being instrumented to support
+HLL profiling, but this support is currently limited.  Code can be run under
+the profiling runcore by passing C<-Rprofiling> or C<--runcore profiling> to
+the C<parrot> binary.  The location and format of the output file are
+determined by environment variables as documented below.  If the profiling
+runcore does not detect any relevant environment variables, it will use the
+defaults described below.
+
+=head2 Environment Variables
+
+=over 4
+
+=item C<PARROT_PROFILING_FILENAME>
+
+This determines the full name of the file where the output will be written, if
+any.  Parrot does not check if the filename exists before opening it for
+writing and will happily overwrite any existing files, including previous profiles.
+
+If no value is specified, Parrot will write to a file named C<parrot.pprof.X>,
+where X is the PID of the Parrot process.  When the profiling runcore exits, it
+will print a message announcing where the profile was written.
+
+This variable can also have the special values C<stdout> and C<stderr>.  When
+either of these values are detected (case-insensitively), Parrot will print its
+profiling output the stdout or stderr.
+
+=item C<PARROT_PROFILING_OUTPUT>
+
+This determines the type of output which will contain the profile.  Current
+options are C<pprof> and C<none>.  C<pprof> is the default and is a ascii-based
+human-readable format.  It can be post-processed into a Callgrind-compatible
+format by tools/dev/pprof2cg.pl.  C<none> writes nothing to the output file.
+It is most useful for testing and optimizing the profiling runcore itself.  It
+is expected to be of little interest to users wishing to profile PIR and HLL
+code.
+
+=item C<PARROT_PROFILING_ANNOTATIONS>
+
+This determines whether PIR annotations will be recorded as part of the
+profile.  Annotations are necessary when profiling HLL code, but will cause the
+profiling runcore to run more slowly.  By default, they are disabled.  Set this
+value to enable them.
+
+=back
+
+=cut

Modified: branches/orderedhash_revamp/docs/embed.pod
==============================================================================
--- branches/orderedhash_revamp/docs/embed.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/embed.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2008, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
 =head1 NAME
@@ -165,12 +165,6 @@
 
 =item PARROT_CGOTO_CORE
 
-=item PARROT_JIT_CORE
-
-=item PARROT_CGP_JIT_CORE
-
-=item PARROT_SWITCH_JIT_CORE
-
 =item PARROT_EXEC_CORE
 
 =item PARROT_GC_DEBUG_CORE
@@ -230,10 +224,6 @@
 The handler function should accept as arguments an interpreter, an integer
 exit code, and an argument (which can be NULL).
 
-=item C<void imcc_init(PARROT_INTERP)>
-
-Initializes the IMCC subsystem.  Required for compiling PIR.
-
 =back
 
 =head2 Loading and running bytecode
@@ -280,7 +270,7 @@
 Returns the internal type number corresponding to C<type>.  Useful for
 instantiating various Parrot data types.
 
-=item C<char *Parrot_str_to_cstring(PARROT_INTERP)>
+=item C<char *Parrot_str_to_cstring(PARROT_INTERP, const STRING *s)>
 
 XXX needs to be a formal Parrot_* API.
 Returns the C string representation of a Parrot string.
@@ -329,29 +319,25 @@
 Find and return a global called C<name> in the current namespace.  Returns
 C<PMCNULL> if not found.
 
-=item C<Parrot_PMC Parrot_find_global_n(PARROT_INTERP, Parrot_String namespace, Parrot_String name)>
+=item C<Parrot_PMC Parrot_find_global_n(PARROT_INTERP, PMC namespace, Parrot_String name)>
 
-Not documented yet.
+Search the namespace PMC C<namespace> for an object with name C<globalname>.
+Return the object, or NULL if not found.
 
 =item C<Parrot_PMC Parrot_find_global_s(PARROT_INTERP, Parrot_String namespace, Parrot_String name)>
 
 Find and return a global called C<name> in the namespace C<namespace>.  Returns
 C<PMCNULL> if not found.
 
-=item C<void Parrot_store_global_n(PARROT_INTERP, Parrot_String namespace, Parrot_String name, Parrot_PMC val)>
+=item C<void Parrot_store_global_n(PARROT_INTERP, PMC namespace, Parrot_String name, Parrot_PMC val)>
 
-Not documented yet.
+Store the PMC C<val> into the namespace PMC C<namespace> with name C<globalname>.
 
 =item C<void Parrot_store_global_s(PARROT_INTERP, Parrot_String namespace, Parrot_String name, Parrot_PMC val)>
 
 Sets the value of a global called C<name> in the namespace C<namespace>.  Does
 nothing if the global is not found.
 
-=item C<Parrot_PMC Parrot_find_global_k(PARROT_INTERP, Parrot_PMC namespace_key, Parrot_String name)>
-
-Find and return a global called C<name> in the keyed namespace C<namespace>.
-Returns C<PMCNULL> if not found.
-
 =back
 
 =head3 Lexicals
@@ -362,15 +348,21 @@
 
 =over 4
 
-=item C<void *Parrot_call_sub(PARROT_INTERP, Parrot_PMC sub, const_char *signature)>
+=item C<void Parrot_ext_call(PARROT_INTERP, Parrot_PMC sub, const_char *signature, varargs ...)>
+
+Call a Parrot subroutine using the supplied signature. Variables to be filled
+with return values are passed as references in the varargs list, after all
+arguments.
+
+=item [DEPRECATED] C<void *Parrot_call_sub(PARROT_INTERP, Parrot_PMC sub, const_char *signature)>
 
 Call a Parrot subroutine that returns a pointer using the supplied signature.
 
-=item C<Parrot_Int Parrot_call_sub_ret_int(PARROT_INTERP, Parrot_PMC sub, const_char *signature)>
+=item [DEPRECATED] C<Parrot_Int Parrot_call_sub_ret_int(PARROT_INTERP, Parrot_PMC sub, const_char *signature)>
 
 Call a Parrot subroutine that returns an integer using the supplied signature.
 
-=item C<Parrot_Float Parrot_call_sub_ret_float(PARROT_INTERP, Parrot_PMC sub, const_char *signature)>
+=item [DEPRECATED] C<Parrot_Float Parrot_call_sub_ret_float(PARROT_INTERP, Parrot_PMC sub, const_char *signature)>
 
 Call a Parrot subroutine that returns an float using the supplied signature.
 
@@ -386,7 +378,7 @@
 
 Returns the class corresponding to the supplied namespace.
 
-=item C<Parrot_PMC VTABLE_instantiate(PARROT_INTERP, Parrot_PMC the_class Parrot_PMC arg)>
+=item C<Parrot_PMC Parrot_PMC_instantiate(PARROT_INTERP, Parrot_PMC the_class, Parrot_PMC arg)>
 
 Instantiates a new object of class C<the_class>, which can be obtained from
 C<Parrot_oo_get_class()>.  Passes an optional PMC argument C<arg> to the
@@ -397,7 +389,15 @@
 
 =head3 Calling methods
 
-Not documented yet.
+=over 4
+
+=item C<void Parrot_ext_call(PARROT_INTERP, Parrot_PMC method, const_char *signature, varargs ...)>
+
+Methods are called using the same API function as calling a subroutine. The
+first argument should be the object that the method will be invoked on, and it
+should have the signature "Pi".
+
+=back
 
 =head1 COMPILING
 
@@ -515,6 +515,1340 @@
         return(0);
     }
 
+=head1 EXPORTED FUNCTIONS
+
+The Parrot embedding API is not finalized, and it will go through several
+deprecation cycles before stabilizing.  Below is the comprehensive list of
+candidates for inclusion in the Parrot embedding API.  It includes the
+following types of functions:
+
+=over 4
+
+=item * The core functions documented above
+
+=item * Functions required by macros
+
+=item * Parrot_PMC_* VTABLE wrappers
+
+=item * Miscellaneous functions whose utility outside of the core is
+uncertain.  This includes functions used by HLLs.
+
+=item * Functions that should be removed in a future deprecation cycle.  A
+good example of this is most of the internal string_* functions, which now
+have formal Parrot_str_* wrappers.
+
+=back
+
+The list may also be augmented if additional functionality is required.
+
+=over 4
+
+=item C<disable_event_checking>
+
+=item C<enable_event_checking>
+
+=item C<interpinfo>
+
+=item C<interpinfo_p>
+
+=item C<interpinfo_s>
+
+=item C<mem_allocate_n_typed>
+
+=item C<mem_allocate_n_zeroed_typed>
+
+=item C<mem_allocate_zeroed_typed>
+
+=item C<mem_sys_allocate>
+
+=item C<mem_sys_allocate_zeroed>
+
+=item C<mem_sys_free>
+
+=item C<mem_sys_realloc>
+
+=item C<mem_sys_realloc_zeroed>
+
+=item C<PackFile_Constant_pack>
+
+=item C<PackFile_ConstTable_pack>
+
+=item C<PackFile_ConstTable_pack_size>
+
+=item C<PackFile_destroy>
+
+=item C<PackFile_find_in_const>
+
+=item C<PackFile_fixup_subs>
+
+=item C<PackFile_new>
+
+=item C<PackFile_new_dummy>
+
+=item C<PackFile_pack>
+
+=item C<PackFile_pack_size>
+
+=item C<Parrot_assert>
+
+=item C<Parrot_block_GC_mark>
+
+=item C<Parrot_block_GC_sweep>
+
+=item C<Parrot_byte_index>
+
+=item C<Parrot_byte_rindex>
+
+=item C<Parrot_callback_C>
+
+=item C<Parrot_callback_D>
+
+=item C<Parrot_ext_call>
+
+=item [DEPRECATED] C<Parrot_call_method>
+
+=item [DEPRECATED] C<Parrot_call_method_ret_float>
+
+=item [DEPRECATED] C<Parrot_call_method_ret_int>
+
+=item [DEPRECATED] C<Parrot_call_sub>
+
+=item [DEPRECATED] C<Parrot_call_sub_ret_float>
+
+=item [DEPRECATED] C<Parrot_call_sub_ret_int>
+
+=item C<Parrot_char_digit_value>
+
+=item C<Parrot_charset_c_name>
+
+=item C<Parrot_charset_name>
+
+=item C<Parrot_charset_number>
+
+=item C<Parrot_charset_number_of_str>
+
+=item C<Parrot_charsets_encodings_deinit>
+
+=item C<Parrot_charsets_encodings_init>
+
+=item C<Parrot_clear_debug>
+
+=item C<Parrot_clear_flag>
+
+=item C<Parrot_clear_i>
+
+=item C<Parrot_clear_n>
+
+=item C<Parrot_clear_p>
+
+=item C<Parrot_clear_s>
+
+=item C<Parrot_clear_trace>
+
+=item C<Parrot_clone>
+
+=item C<Parrot_compile_file>
+
+=item C<Parrot_compile_string>
+
+=item C<Parrot_ComposeRole>
+
+=item C<Parrot_compreg>
+
+=item C<Parrot_ComputeMRO_C3>
+
+=item C<Parrot_confess>
+
+=item C<Parrot_context_ref_trace>
+
+=item C<Parrot_cx_add_handler>
+
+=item C<Parrot_cx_add_handler_local>
+
+=item C<Parrot_cx_broadcast_message>
+
+=item C<Parrot_cx_count_handlers_local>
+
+=item C<Parrot_cx_count_handlers_typed>
+
+=item C<Parrot_cx_delete_handler_local>
+
+=item C<Parrot_cx_delete_handler_typed>
+
+=item C<Parrot_cx_delete_suspend_for_gc>
+
+=item C<Parrot_cx_delete_task>
+
+=item C<Parrot_cx_find_handler_for_task>
+
+=item C<Parrot_cx_find_handler_local>
+
+=item C<Parrot_cx_handle_tasks>
+
+=item C<Parrot_cx_peek_task>
+
+=item C<Parrot_cx_request_suspend_for_gc>
+
+=item C<Parrot_cx_runloop_end>
+
+=item C<Parrot_cx_schedule_callback>
+
+=item C<Parrot_cx_schedule_repeat>
+
+=item C<Parrot_cx_schedule_sleep>
+
+=item C<Parrot_cx_schedule_task>
+
+=item C<Parrot_cx_schedule_timer>
+
+=item C<Parrot_cx_send_message>
+
+=item C<Parrot_default_charset>
+
+=item C<Parrot_default_encoding>
+
+=item C<Parrot_del_timer_event>
+
+=item C<Parrot_destroy>
+
+=item C<Parrot_disassemble>
+
+=item C<Parrot_do_check_events>
+
+=item C<Parrot_do_handle_events>
+
+=item C<Parrot_dump_dynamic_environment>
+
+=item C<Parrot_encoding_c_name>
+
+=item C<Parrot_encoding_name>
+
+=item C<Parrot_encoding_number>
+
+=item C<Parrot_encoding_number_of_str>
+
+=item C<Parrot_eprintf>
+
+=item C<Parrot_event_add_io_event>
+
+=item C<Parrot_ex_add_c_handler>
+
+=item C<Parrot_ex_build_exception>
+
+=item C<Parrot_exit>
+
+=item C<Parrot_ex_mark_unhandled>
+
+=item C<Parrot_ex_rethrow_from_c>
+
+=item C<Parrot_ex_rethrow_from_op>
+
+=item C<Parrot_ex_throw_from_c>
+
+=item C<Parrot_ex_throw_from_c_args>
+
+=item C<Parrot_ex_throw_from_op>
+
+=item C<Parrot_ex_throw_from_op_args>
+
+=item C<Parrot_find_charset>
+
+=item C<Parrot_find_charset_converter>
+
+=item C<Parrot_find_encoding>
+
+=item C<Parrot_find_encoding_converter>
+
+=item C<Parrot_find_global_cur>
+
+=item C<Parrot_find_global_k>
+
+=item C<Parrot_find_global_n>
+
+=item C<Parrot_find_global_op>
+
+=item C<Parrot_find_global_s>
+
+=item C<Parrot_find_language>
+
+=item C<Parrot_find_method_direct>
+
+=item C<Parrot_find_method_with_cache>
+
+=item C<Parrot_find_name_op>
+
+=item C<Parrot_float_rand>
+
+=item C<Parrot_fprintf>
+
+=item C<Parrot_free_context>
+
+=item C<Parrot_free_cstring>
+
+=item C<Parrot_freeze>
+
+=item C<Parrot_freeze_at_destruct>
+
+=item C<Parrot_full_sub_name>
+
+=item C<parrot_gc_context>
+
+=item C<Parrot_gc_gms_init>
+
+=item C<parrot_gc_gms_Parrot_gc_mark_PObj_alive>
+
+=item C<Parrot_gc_mark_PObj_alive>
+
+=item C<Parrot_get_charset>
+
+=item C<Parrot_get_ctx_HLL_namespace>
+
+=item C<Parrot_get_ctx_HLL_type>
+
+=item C<Parrot_get_datatype_enum>
+
+=item C<Parrot_get_datatype_name>
+
+=item C<Parrot_get_encoding>
+
+=item C<Parrot_get_global>
+
+=item C<Parrot_get_HLL_id>
+
+=item C<Parrot_get_HLL_name>
+
+=item C<Parrot_get_HLL_namespace>
+
+=item C<Parrot_get_HLL_type>
+
+=item C<Parrot_get_intreg>
+
+=item C<Parrot_get_namespace_autobase>
+
+=item C<Parrot_get_namespace_keyed>
+
+=item C<Parrot_get_namespace_keyed_str>
+
+=item C<Parrot_get_numreg>
+
+=item C<Parrot_get_pmcreg>
+
+=item C<Parrot_get_root_namespace>
+
+=item C<Parrot_get_runtime_path>
+
+=item C<Parrot_get_runtime_prefix>
+
+=item C<Parrot_get_strreg>
+
+=item C<Parrot_get_vtable>
+
+=item C<Parrot_get_vtable_index>
+
+=item C<Parrot_get_vtable_name>
+
+=item C<Parrot_init_events>
+
+=item C<Parrot_init_signals>
+
+=item C<Parrot_init_stacktop>
+
+=item C<Parrot_int_rand>
+
+=item C<Parrot_invalidate_method_cache>
+
+=item C<Parrot_io_accept>
+
+=item C<Parrot_io_bind>
+
+=item C<Parrot_io_close>
+
+=item C<Parrot_io_close_filehandle>
+
+=item C<Parrot_io_close_piohandle>
+
+=item C<Parrot_io_connect>
+
+=item C<Parrot_IOData_mark>
+
+=item C<Parrot_io_eof>
+
+=item C<Parrot_io_eprintf>
+
+=item C<Parrot_io_fdopen>
+
+=item C<Parrot_io_finish>
+
+=item C<Parrot_io_flush>
+
+=item C<Parrot_io_flush_filehandle>
+
+=item C<Parrot_io_fprintf>
+
+=item C<Parrot_io_get_buffer_end>
+
+=item C<Parrot_io_get_buffer_next>
+
+=item C<Parrot_io_get_buffer_start>
+
+=item C<Parrot_io_getfd>
+
+=item C<Parrot_io_get_file_position>
+
+=item C<Parrot_io_get_file_size>
+
+=item C<Parrot_io_get_flags>
+
+=item C<Parrot_io_get_last_file_position>
+
+=item C<Parrot_io_get_os_handle>
+
+=item C<Parrot_io_init>
+
+=item C<Parrot_io_is_closed>
+
+=item C<Parrot_io_is_closed_filehandle>
+
+=item C<Parrot_io_is_encoding>
+
+=item C<Parrot_io_is_tty>
+
+=item C<Parrot_io_listen>
+
+=item C<Parrot_io_make_offset>
+
+=item C<Parrot_io_new_pmc>
+
+=item C<Parrot_io_new_socket_pmc>
+
+=item C<Parrot_io_open>
+
+=item C<Parrot_io_parse_open_flags>
+
+=item C<Parrot_io_peek>
+
+=item C<Parrot_io_poll>
+
+=item C<Parrot_io_printf>
+
+=item C<Parrot_io_putps>
+
+=item C<Parrot_io_puts>
+
+=item C<Parrot_io_readline>
+
+=item C<Parrot_io_reads>
+
+=item C<Parrot_io_recv>
+
+=item C<Parrot_io_seek>
+
+=item C<Parrot_io_send>
+
+=item C<Parrot_io_set_file_position>
+
+=item C<Parrot_io_set_file_size>
+
+=item C<Parrot_io_set_flags>
+
+=item C<Parrot_io_set_os_handle>
+
+=item C<Parrot_io_socket>
+
+=item C<Parrot_io_socket_is_closed>
+
+=item C<Parrot_io_STDERR>
+
+=item C<Parrot_io_stdhandle>
+
+=item C<Parrot_io_STDIN>
+
+=item C<Parrot_io_STDOUT>
+
+=item C<Parrot_io_tell>
+
+=item C<Parrot_io_write>
+
+=item C<Parrot_is_blocked_GC_mark>
+
+=item C<Parrot_is_blocked_GC_sweep>
+
+=item C<Parrot_kill_event_loop>
+
+=item C<Parrot_lib_add_path>
+
+=item C<Parrot_lib_add_path_from_cstring>
+
+=item C<Parrot_load_bytecode>
+
+=item C<Parrot_load_charset>
+
+=item C<Parrot_load_encoding>
+
+=item C<Parrot_load_language>
+
+=item C<Parrot_load_lib>
+
+=item C<Parrot_locate_runtime_file>
+
+=item C<Parrot_locate_runtime_file_str>
+
+=item C<Parrot_make_cb>
+
+=item C<Parrot_make_default_charset>
+
+=item C<Parrot_make_default_encoding>
+
+=item C<Parrot_make_namespace_autobase>
+
+=item C<Parrot_make_namespace_keyed>
+
+=item C<Parrot_make_namespace_keyed_str>
+
+=item C<Parrot_mmd_cache_create>
+
+=item C<Parrot_mmd_cache_destroy>
+
+=item C<Parrot_mmd_cache_lookup_by_values>
+
+=item C<Parrot_mmd_cache_mark>
+
+=item C<Parrot_mmd_cache_store_by_values>
+
+=item C<Parrot_new>
+
+=item C<Parrot_new_cb_event>
+
+=item C<Parrot_new_charset>
+
+=item C<Parrot_new_encoding>
+
+=item C<Parrot_new_string>
+
+=item C<Parrot_new_suspend_for_gc_event>
+
+=item C<Parrot_new_terminate_event>
+
+=item C<Parrot_new_timer_event>
+
+=item C<Parrot_ns_get_name>
+
+=item C<Parrot_on_exit>
+
+=item C<Parrot_oo_get_class>
+
+=item C<Parrot_oo_get_class_str>
+
+=item C<Parrot_pbc_load>
+
+=item C<Parrot_pbc_read>
+
+=item C<Parrot_PMC_absolute>
+
+=item C<Parrot_PMC_add>
+
+=item C<Parrot_PMC_add_attribute>
+
+=item C<Parrot_PMC_add_float>
+
+=item C<Parrot_PMC_add_int>
+
+=item C<Parrot_PMC_add_method>
+
+=item C<Parrot_PMC_add_parent>
+
+=item C<Parrot_PMC_add_role>
+
+=item C<Parrot_PMC_add_vtable_override>
+
+=item C<Parrot_PMC_assign_pmc>
+
+=item C<Parrot_PMC_assign_string_native>
+
+=item C<Parrot_PMC_bitwise_and>
+
+=item C<Parrot_PMC_bitwise_and_int>
+
+=item C<Parrot_PMC_bitwise_ands>
+
+=item C<Parrot_PMC_bitwise_ands_str>
+
+=item C<Parrot_PMC_bitwise_lsr>
+
+=item C<Parrot_PMC_bitwise_lsr_int>
+
+=item C<Parrot_PMC_bitwise_not>
+
+=item C<Parrot_PMC_bitwise_nots>
+
+=item C<Parrot_PMC_bitwise_or>
+
+=item C<Parrot_PMC_bitwise_or_int>
+
+=item C<Parrot_PMC_bitwise_ors>
+
+=item C<Parrot_PMC_bitwise_ors_str>
+
+=item C<Parrot_PMC_bitwise_shl>
+
+=item C<Parrot_PMC_bitwise_shl_int>
+
+=item C<Parrot_PMC_bitwise_shr>
+
+=item C<Parrot_PMC_bitwise_shr_int>
+
+=item C<Parrot_PMC_bitwise_xor>
+
+=item C<Parrot_PMC_bitwise_xor_int>
+
+=item C<Parrot_PMC_bitwise_xors>
+
+=item C<Parrot_PMC_bitwise_xors_str>
+
+=item C<Parrot_PMC_can>
+
+=item C<Parrot_PMC_clone>
+
+=item C<Parrot_PMC_clone_pmc>
+
+=item C<Parrot_PMC_cmp>
+
+=item C<Parrot_PMC_cmp_num>
+
+=item C<Parrot_PMC_cmp_pmc>
+
+=item C<Parrot_PMC_cmp_string>
+
+=item C<Parrot_PMC_concatenate>
+
+=item C<Parrot_PMC_concatenate_str>
+
+=item C<Parrot_PMC_decrement>
+
+=item C<Parrot_PMC_defined>
+
+=item C<Parrot_PMC_defined_keyed>
+
+=item C<Parrot_PMC_defined_keyed_int>
+
+=item C<Parrot_PMC_defined_keyed_str>
+
+=item C<Parrot_PMC_delete_keyed>
+
+=item C<Parrot_PMC_delete_keyed_int>
+
+=item C<Parrot_PMC_delete_keyed_str>
+
+=item C<Parrot_PMC_delete_pmckey>
+
+=item C<Parrot_PMC_delprop>
+
+=item C<Parrot_PMC_destroy>
+
+=item C<Parrot_PMC_divide>
+
+=item C<Parrot_PMC_divide_float>
+
+=item C<Parrot_PMC_divide_int>
+
+=item C<Parrot_PMC_does>
+
+=item C<Parrot_PMC_does_pmc>
+
+=item C<Parrot_PMC_elements>
+
+=item C<Parrot_PMC_exists_keyed>
+
+=item C<Parrot_PMC_exists_keyed_int>
+
+=item C<Parrot_PMC_exists_keyed_str>
+
+=item C<Parrot_PMC_find_method>
+
+=item C<Parrot_PMC_floor_divide>
+
+=item C<Parrot_PMC_floor_divide_float>
+
+=item C<Parrot_PMC_floor_divide_int>
+
+=item C<Parrot_PMC_get_attr_keyed>
+
+=item C<Parrot_PMC_get_attr_str>
+
+=item C<Parrot_PMC_get_bignum>
+
+=item C<Parrot_PMC_get_bool>
+
+=item C<Parrot_PMC_get_class>
+
+=item C<Parrot_PMC_get_cstring>
+
+=item C<Parrot_PMC_get_cstring_intkey>
+
+=item C<Parrot_PMC_get_cstringn>
+
+=item C<Parrot_PMC_get_cstringn_intkey>
+
+=item C<Parrot_PMC_get_integer>
+
+=item C<Parrot_PMC_get_integer_keyed>
+
+=item C<Parrot_PMC_get_integer_keyed_int>
+
+=item C<Parrot_PMC_get_integer_keyed_str>
+
+=item C<Parrot_PMC_get_intval>
+
+=item C<Parrot_PMC_get_intval_intkey>
+
+=item C<Parrot_PMC_get_intval_pmckey>
+
+=item C<Parrot_PMC_get_iter>
+
+=item C<Parrot_PMC_get_namespace>
+
+=item C<Parrot_PMC_get_number>
+
+=item C<Parrot_PMC_get_number_keyed>
+
+=item C<Parrot_PMC_get_number_keyed_int>
+
+=item C<Parrot_PMC_get_number_keyed_str>
+
+=item C<Parrot_PMC_get_numval>
+
+=item C<Parrot_PMC_get_numval_intkey>
+
+=item C<Parrot_PMC_get_pmc>
+
+=item C<Parrot_PMC_get_pmc_intkey>
+
+=item C<Parrot_PMC_get_pmc_keyed>
+
+=item C<Parrot_PMC_get_pmc_keyed_int>
+
+=item C<Parrot_PMC_get_pmc_keyed_str>
+
+=item C<Parrot_PMC_get_pmc_strkey>
+
+=item C<Parrot_PMC_get_pointer>
+
+=item C<Parrot_PMC_get_pointer_intkey>
+
+=item C<Parrot_PMC_get_pointer_keyed>
+
+=item C<Parrot_PMC_get_pointer_keyed_int>
+
+=item C<Parrot_PMC_get_pointer_keyed_str>
+
+=item C<Parrot_PMC_getprop>
+
+=item C<Parrot_PMC_getprops>
+
+=item C<Parrot_PMC_get_repr>
+
+=item C<Parrot_PMC_get_string>
+
+=item C<Parrot_PMC_get_string_intkey>
+
+=item C<Parrot_PMC_get_string_keyed>
+
+=item C<Parrot_PMC_get_string_keyed_int>
+
+=item C<Parrot_PMC_get_string_keyed_str>
+
+=item C<Parrot_PMC_i_absolute>
+
+=item C<Parrot_PMC_i_add>
+
+=item C<Parrot_PMC_i_add_float>
+
+=item C<Parrot_PMC_i_add_int>
+
+=item C<Parrot_PMC_i_bitwise_and>
+
+=item C<Parrot_PMC_i_bitwise_and_int>
+
+=item C<Parrot_PMC_i_bitwise_ands>
+
+=item C<Parrot_PMC_i_bitwise_ands_str>
+
+=item C<Parrot_PMC_i_bitwise_lsr>
+
+=item C<Parrot_PMC_i_bitwise_lsr_int>
+
+=item C<Parrot_PMC_i_bitwise_not>
+
+=item C<Parrot_PMC_i_bitwise_nots>
+
+=item C<Parrot_PMC_i_bitwise_or>
+
+=item C<Parrot_PMC_i_bitwise_or_int>
+
+=item C<Parrot_PMC_i_bitwise_ors>
+
+=item C<Parrot_PMC_i_bitwise_ors_str>
+
+=item C<Parrot_PMC_i_bitwise_shl>
+
+=item C<Parrot_PMC_i_bitwise_shl_int>
+
+=item C<Parrot_PMC_i_bitwise_shr>
+
+=item C<Parrot_PMC_i_bitwise_shr_int>
+
+=item C<Parrot_PMC_i_bitwise_xor>
+
+=item C<Parrot_PMC_i_bitwise_xor_int>
+
+=item C<Parrot_PMC_i_bitwise_xors>
+
+=item C<Parrot_PMC_i_bitwise_xors_str>
+
+=item C<Parrot_PMC_i_concatenate>
+
+=item C<Parrot_PMC_i_concatenate_str>
+
+=item C<Parrot_PMC_i_divide>
+
+=item C<Parrot_PMC_i_divide_float>
+
+=item C<Parrot_PMC_i_divide_int>
+
+=item C<Parrot_PMC_i_floor_divide>
+
+=item C<Parrot_PMC_i_floor_divide_float>
+
+=item C<Parrot_PMC_i_floor_divide_int>
+
+=item C<Parrot_PMC_i_logical_not>
+
+=item C<Parrot_PMC_i_modulus>
+
+=item C<Parrot_PMC_i_modulus_float>
+
+=item C<Parrot_PMC_i_modulus_int>
+
+=item C<Parrot_PMC_i_multiply>
+
+=item C<Parrot_PMC_i_multiply_float>
+
+=item C<Parrot_PMC_i_multiply_int>
+
+=item C<Parrot_PMC_increment>
+
+=item C<Parrot_PMC_i_neg>
+
+=item C<Parrot_PMC_init>
+
+=item C<Parrot_PMC_init_pmc>
+
+=item C<Parrot_PMC_inspect>
+
+=item C<Parrot_PMC_inspect_str>
+
+=item C<Parrot_PMC_instantiate>
+
+=item C<Parrot_PMC_invoke>
+
+=item C<Parrot_PMC_i_pow>
+
+=item C<Parrot_PMC_i_pow_float>
+
+=item C<Parrot_PMC_i_pow_int>
+
+=item C<Parrot_PMC_i_repeat>
+
+=item C<Parrot_PMC_i_repeat_int>
+
+=item C<Parrot_PMC_isa>
+
+=item C<Parrot_PMC_isa_pmc>
+
+=item C<Parrot_PMC_is_equal>
+
+=item C<Parrot_PMC_is_equal_num>
+
+=item C<Parrot_PMC_is_equal_string>
+
+=item C<Parrot_PMC_is_same>
+
+=item C<Parrot_PMC_i_subtract>
+
+=item C<Parrot_PMC_i_subtract_float>
+
+=item C<Parrot_PMC_i_subtract_int>
+
+=item C<Parrot_PMC_logical_and>
+
+=item C<Parrot_PMC_logical_not>
+
+=item C<Parrot_PMC_logical_or>
+
+=item C<Parrot_PMC_logical_xor>
+
+=item C<Parrot_PMC_mark>
+
+=item C<Parrot_PMC_modulus>
+
+=item C<Parrot_PMC_modulus_float>
+
+=item C<Parrot_PMC_modulus_int>
+
+=item C<Parrot_PMC_morph>
+
+=item C<Parrot_PMC_multiply>
+
+=item C<Parrot_PMC_multiply_float>
+
+=item C<Parrot_PMC_multiply_int>
+
+=item C<Parrot_PMC_name>
+
+=item C<Parrot_PMC_neg>
+
+=item C<Parrot_PMC_new>
+
+=item C<Parrot_PMC_newclass>
+
+=item C<Parrot_PMC_null>
+
+=item C<Parrot_PMC_pop_float>
+
+=item C<Parrot_PMC_pop_integer>
+
+=item C<Parrot_PMC_pop_pmc>
+
+=item C<Parrot_PMC_pop_string>
+
+=item C<Parrot_PMC_pow>
+
+=item C<Parrot_PMC_pow_float>
+
+=item C<Parrot_PMC_pow_int>
+
+=item C<Parrot_PMC_push_float>
+
+=item C<Parrot_PMC_push_integer>
+
+=item C<Parrot_PMC_push_intval>
+
+=item C<Parrot_PMC_push_numval>
+
+=item C<Parrot_PMC_push_pmc>
+
+=item C<Parrot_PMC_push_pmcval>
+
+=item C<Parrot_PMC_push_string>
+
+=item C<Parrot_PMC_remove_attribute>
+
+=item C<Parrot_PMC_remove_method>
+
+=item C<Parrot_PMC_remove_parent>
+
+=item C<Parrot_PMC_remove_role>
+
+=item C<Parrot_PMC_remove_vtable_override>
+
+=item C<Parrot_PMC_repeat>
+
+=item C<Parrot_PMC_repeat_int>
+
+=item C<Parrot_PMC_set_attr_keyed>
+
+=item C<Parrot_PMC_set_attr_str>
+
+=item C<Parrot_PMC_set_bignum_int>
+
+=item C<Parrot_PMC_set_bignum_num>
+
+=item C<Parrot_PMC_set_bignum_str>
+
+=item C<Parrot_PMC_set_bool>
+
+=item C<Parrot_PMC_set_cstring>
+
+=item C<Parrot_PMC_set_cstring_intkey>
+
+=item C<Parrot_PMC_set_cstringn>
+
+=item C<Parrot_PMC_set_cstringn_intkey>
+
+=item C<Parrot_PMC_set_integer_keyed>
+
+=item C<Parrot_PMC_set_integer_keyed_int>
+
+=item C<Parrot_PMC_set_integer_keyed_str>
+
+=item C<Parrot_PMC_set_integer_native>
+
+=item C<Parrot_PMC_set_integer_same>
+
+=item C<Parrot_PMC_set_intval>
+
+=item C<Parrot_PMC_set_intval_intkey>
+
+=item C<Parrot_PMC_set_number_keyed>
+
+=item C<Parrot_PMC_set_number_keyed_int>
+
+=item C<Parrot_PMC_set_number_keyed_str>
+
+=item C<Parrot_PMC_set_number_native>
+
+=item C<Parrot_PMC_set_number_same>
+
+=item C<Parrot_PMC_set_numval>
+
+=item C<Parrot_PMC_set_numval_intkey>
+
+=item C<Parrot_PMC_set_pmc>
+
+=item C<Parrot_PMC_set_pmc_intkey>
+
+=item C<Parrot_PMC_set_pmc_keyed>
+
+=item C<Parrot_PMC_set_pmc_keyed_int>
+
+=item C<Parrot_PMC_set_pmc_keyed_str>
+
+=item C<Parrot_PMC_set_pmc_pmckey>
+
+=item C<Parrot_PMC_set_pmc_strkey>
+
+=item C<Parrot_PMC_set_pointer>
+
+=item C<Parrot_PMC_set_pointer_intkey>
+
+=item C<Parrot_PMC_set_pointer_keyed>
+
+=item C<Parrot_PMC_set_pointer_keyed_int>
+
+=item C<Parrot_PMC_set_pointer_keyed_str>
+
+=item C<Parrot_PMC_setprop>
+
+=item C<Parrot_PMC_set_string>
+
+=item C<Parrot_PMC_set_string_intkey>
+
+=item C<Parrot_PMC_set_string_keyed>
+
+=item C<Parrot_PMC_set_string_keyed_int>
+
+=item C<Parrot_PMC_set_string_keyed_str>
+
+=item C<Parrot_PMC_set_string_native>
+
+=item C<Parrot_PMC_set_string_same>
+
+=item C<Parrot_PMC_set_vtable>
+
+=item C<Parrot_PMC_share>
+
+=item C<Parrot_PMC_share_ro>
+
+=item C<Parrot_PMC_shift_float>
+
+=item C<Parrot_PMC_shift_integer>
+
+=item C<Parrot_PMC_shift_pmc>
+
+=item C<Parrot_PMC_shift_string>
+
+=item C<Parrot_PMC_splice>
+
+=item C<Parrot_PMC_substr>
+
+=item C<Parrot_PMC_substr_str>
+
+=item C<Parrot_PMC_subtract>
+
+=item C<Parrot_PMC_subtract_float>
+
+=item C<Parrot_PMC_subtract_int>
+
+=item C<Parrot_PMC_typenum>
+
+=item C<Parrot_PMC_unshift_float>
+
+=item C<Parrot_PMC_unshift_integer>
+
+=item C<Parrot_PMC_unshift_pmc>
+
+=item C<Parrot_PMC_unshift_string>
+
+=item C<Parrot_pop_context>
+
+=item C<Parrot_pop_mark>
+
+=item C<Parrot_printf>
+
+=item C<Parrot_psprintf>
+
+=item C<Parrot_push_action>
+
+=item C<Parrot_push_context>
+
+=item C<Parrot_push_mark>
+
+=item C<Parrot_range_rand>
+
+=item C<Parrot_regenerate_HLL_namespaces>
+
+=item C<Parrot_register_charset>
+
+=item C<Parrot_register_charset_converter>
+
+=item C<Parrot_register_encoding>
+
+=item C<Parrot_register_HLL>
+
+=item C<Parrot_register_HLL_lib>
+
+=item C<Parrot_register_HLL_type>
+
+=item C<Parrot_register_move>
+
+=item C<Parrot_register_pmc>
+
+=item C<Parrot_run_callback>
+
+=item C<Parrot_runcode>
+
+=item C<Parrot_run_native>
+
+=item C<Parrot_schedule_event>
+
+=item C<Parrot_schedule_interp_qentry>
+
+=item C<Parrot_secret_snprintf>
+
+=item C<Parrot_set_config_hash_internal>
+
+=item C<Parrot_set_context_threshold>
+
+=item C<Parrot_set_debug>
+
+=item C<Parrot_set_executable_name>
+
+=item C<Parrot_set_flag>
+
+=item C<Parrot_set_global>
+
+=item C<Parrot_set_intreg>
+
+=item C<Parrot_set_numreg>
+
+=item C<Parrot_set_pmcreg>
+
+=item C<Parrot_set_run_core>
+
+=item C<Parrot_set_strreg>
+
+=item C<Parrot_set_trace>
+
+=item C<Parrot_setwarnings>
+
+=item C<Parrot_shared_gc_block>
+
+=item C<Parrot_shared_gc_unblock>
+
+=item C<Parrot_sleep_on_event>
+
+=item C<Parrot_snprintf>
+
+=item C<Parrot_sprintf_c>
+
+=item C<Parrot_sprintf_s>
+
+=item C<Parrot_srand>
+
+=item C<Parrot_store_global_n>
+
+=item C<Parrot_store_global_s>
+
+=item C<Parrot_store_sub_in_namespace>
+
+=item C<Parrot_str_append>
+
+=item C<Parrot_str_bitwise_and>
+
+=item C<Parrot_str_bitwise_not>
+
+=item C<Parrot_str_bitwise_or>
+
+=item C<Parrot_str_bitwise_xor>
+
+=item C<Parrot_str_boolean>
+
+=item C<Parrot_str_byte_length>
+
+=item C<Parrot_str_change_charset>
+
+=item C<Parrot_str_change_encoding>
+
+=item C<Parrot_str_chopn>
+
+=item C<Parrot_str_chopn_inplace>
+
+=item C<Parrot_str_compare>
+
+=item C<Parrot_str_compose>
+
+=item C<Parrot_str_concat>
+
+=item C<Parrot_str_copy>
+
+=item C<Parrot_str_downcase>
+
+=item C<Parrot_str_downcase_inplace>
+
+=item C<Parrot_str_equal>
+
+=item C<Parrot_str_escape>
+
+=item C<Parrot_str_escape_truncate>
+
+=item C<Parrot_str_find_cclass>
+
+=item C<Parrot_str_find_index>
+
+=item C<Parrot_str_find_not_cclass>
+
+=item C<Parrot_str_finish>
+
+=item C<Parrot_str_format_data>
+
+=item C<Parrot_str_free_cstring>
+
+=item C<Parrot_str_from_int>
+
+=item C<Parrot_str_from_num>
+
+=item C<Parrot_str_indexed>
+
+=item C<Parrot_string_cstring>
+
+=item C<Parrot_str_init>
+
+=item C<Parrot_str_is_cclass>
+
+=item C<Parrot_str_join>
+
+=item C<Parrot_str_length>
+
+=item C<Parrot_str_new>
+
+=item C<Parrot_str_new_constant>
+
+=item C<Parrot_str_new_COW>
+
+=item C<Parrot_str_new_init>
+
+=item C<Parrot_str_new_noinit>
+
+=item C<Parrot_str_not_equal>
+
+=item C<Parrot_str_pin>
+
+=item C<Parrot_str_repeat>
+
+=item C<Parrot_str_replace>
+
+=item C<Parrot_str_resize>
+
+=item C<Parrot_str_reuse_COW>
+
+=item C<Parrot_str_set>
+
+=item C<Parrot_str_split>
+
+=item C<Parrot_str_substr>
+
+=item C<Parrot_str_titlecase>
+
+=item C<Parrot_str_titlecase_inplace>
+
+=item C<Parrot_str_to_cstring>
+
+=item C<Parrot_str_to_hashval>
+
+=item C<Parrot_str_to_int>
+
+=item C<Parrot_str_to_num>
+
+=item C<Parrot_str_unescape>
+
+=item C<Parrot_str_unpin>
+
+=item C<Parrot_str_upcase>
+
+=item C<Parrot_str_upcase_inplace>
+
+=item C<Parrot_str_write_COW>
+
+=item C<Parrot_sub_new_from_c_func>
+
+=item C<Parrot_test_debug>
+
+=item C<Parrot_test_flag>
+
+=item C<Parrot_test_trace>
+
+=item C<Parrot_thaw>
+
+=item C<Parrot_thaw_constants>
+
+=item C<Parrot_uint_rand>
+
+=item C<Parrot_unblock_GC_mark>
+
+=item C<Parrot_unblock_GC_sweep>
+
+=item C<Parrot_unregister_pmc>
+
+=item C<Parrot_vfprintf>
+
+=item C<Parrot_vsnprintf>
+
+=item C<Parrot_vsprintf_c>
+
+=item C<Parrot_vsprintf_s>
+
+=item C<Parrot_warn>
+
+=item C<PMC_is_null>
+
+=item C<pmc_new>
+
+=item C<pmc_type>
+
+=item C<PObj_custom_destroy_SET>
+
+=item C<PObj_custom_mark_SET>
+
+=item C<string_capacity>
+
+=item C<string_chr>
+
+=item C<string_make>
+
+=item C<string_make_from_charset>
+
+=item C<string_max_bytes>
+
+=item C<string_ord>
+
+=item C<string_primary_encoding_for_representation>
+
+=item C<string_rep_compatible>
+
+=item C<string_to_cstring_nullable>
+
+=back
+
 =head1 SEE ALSO
 
 F<src/main.c> and F<t/src/*.t> for Parrot's use of the embedding system.

Modified: branches/orderedhash_revamp/docs/intro.pod
==============================================================================
--- branches/orderedhash_revamp/docs/intro.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/intro.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -116,13 +116,8 @@
 
 =head2 Where to get Parrot
 
-Every month, numbered releases will appear on CPAN.  At this stage of the
-project, an awful lot is changing between releases. You can get a copy of the
-latest Parrot from the SVN repository. This is done as follows:
-
-  svn co https://svn.parrot.org/parrot/trunk parrot
-
-You can find more instructions at: L<http://www.parrot.org/download>.
+See L<http://www.parrot.org/download> for several ways to get a recent
+version of parrot.
 
 =head2 Building Parrot
 
@@ -132,15 +127,14 @@
 
   perl Configure.pl
 
-Once this is complete, run the C<make> program (sometimes called C<nmake> or
-C<dmake> or C<gmake>).  This should complete, giving you a working Parrot
-executable.
+Once this is complete, run the C<make> program C<Configure.pl> prompts you
+with. When this completes, you will have a working C<parrot> executable.
 
 Please report any problems that you encounter while building Parrot so the
-developers can fix them. You can do this by sending a message to
-C<parrotbug at parrotcode.org> containing a description of your problem. Please
-include the F<myconfig> file that was generated as part of the build process
-and any errors that you observed.
+developers can fix them. You can do this by creating a login and opening
+a new ticket at L<https://trac.parrot.org>.  Please include the F<myconfig>
+file that was generated as part of the build process and any errors that you
+observed.
 
 =head2 The Parrot test suite
 
@@ -176,7 +170,7 @@
 =begin PIR
 
   .sub main
-      print "Hello world!\n"
+      say "Hello world!"
   .end
 
 =end PIR
@@ -186,7 +180,7 @@
   parrot hello.pir
 
 As expected, this will display the text C<Hello world!> on the console,
-followed by a new line (due to the C<\n>).
+followed by a new line. 
 
 Let's take the program apart. C<.sub main> states that the instructions that
 follow make up a subroutine named C<main>, until a C<.end> is encountered. The
@@ -196,14 +190,14 @@
 
 =head2 Using registers
 
-We can modify hello.pir to first store the string C<Hello world!\n> in a
+We can modify hello.pir to first store the string C<Hello world!> in a
 register and then use that register with the print instruction.
 
 =begin PIR
 
   .sub main
-      $S0 = "Hello world!\n"
-      print $S0
+      $S0 = "Hello world!"
+      say $S0
   .end
 
 =end PIR
@@ -221,8 +215,8 @@
 
   .sub main
       .local string hello
-      hello = "Hello world!\n"
-      print hello
+      hello = "Hello world!"
+      say hello
   .end
 
 =end PIR

Deleted: branches/orderedhash_revamp/docs/jit.pod
==============================================================================
--- branches/orderedhash_revamp/docs/jit.pod	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,587 +0,0 @@
-# Copyright (C) 2001-2006, Parrot Foundation.
-# $Id$
-
-=head1 NAME
-
-docs/jit.pod - Parrot JIT Subsystem
-
-=head1 ABSTRACT
-
-This PDD describes the Parrot Just In Time compilation subsystem.
-
-=head1 DESCRIPTION
-
-The Just In Time, or JIT, subsystem converts a bytecode file to native machine
-code instructions and executes the generated instruction sequence directly.
-
-=head1 IMPLEMENTATION
-
-Currently works on B<ALPHA>, B<Arm>, B<Intel x86>, B<PPC>, and B<SPARC version
-8> processor systems, on most operating systems.  Currently only 32-bit INTVALs
-are supported.
-
-The initial step in generating native code is to invoke B<Parrot_jit_begin>,
-which generally provides architecture specific preamble code.  For each parrot
-opcode in the bytecode, either a generic or opcode specific sequence of native
-code is generated.  The F<.jit> files provide functions that generate native
-code for specific opcode functions, for a given instruction set architecture.
-If a function is not provided for a specific opcode, a generic sequence of
-native code is output which calls the interpreter C function that implements
-the opcode.  Such opcode are handled by B<Parrot_jit_normal_op>.
-
-If the opcode can cause a control flow change, as in the case of a branch or
-call opcode, an extended or modified version of this generic code is used that
-tracks changes in the bytecode program counter with changes in the hardware
-program counter.  This type of opcode is handled by B<Parrot_jit_cpcf_op>.
-
-While generating native code, certain offsets and absolute addresses may not be
-available.  This occurs with forward opcode branches, as the native code
-corresponding to the branch target has not yet been generated.  On some
-platforms, function calls are performed using program-counter relative
-addresses.  Since the location of the buffer holding the native code may move
-as code is generated (due to growing of the buffer), these relative addresses
-may only be calculated once the buffer is guaranteed to no longer move.  To
-handle these instances, the JIT subsystem uses "fixups", which record locations
-in native code where adjustments to the native code are required.
-
-=head1 FILES
-
-=over 4
-
-=item jit/${jitcpuarch}/jit_emit.h
-
-This file defines B<Parrot_jit_begin>, B<Parrot_jit_dofixup>,
-B<Parrot_jit_normal_op>, B<Parrot_jit_cpcf_op>, B<Parrot_jit_restart_op> and
-optionally B<Parrot_jit_vtable*_op>.  In addition, this file defines the macros
-and static functions used in F<.jit> files to produce binary representations of
-native instructions.
-
-For moving registers from processor to parrot and vice versa, the
-B<Parrot_jit_emit_mov*> functions have to be implemented.
-
-=item jit/${jitcpuarch}/core.jit
-
-The functions to generate native code for core parrot opcodes are specified
-here. To simplify the maintenance of these functions, they are specified in a
-format that is pre-processed by F<jit2c.pl> to produce a valid C source file,
-F<jit_cpu.c>. See L<Format of .jit Files> below.
-
-=item src/jit.h
-
-This file contains definitions of generic structures used by the JIT subsystem.
-
-The B<op_jit> array of B<jit_fn_info_t> structures, provides for each opcode, a
-pointer to the function that generates native code for the opcode, whether the
-generic B<Parrot_jit_normal_op> or B<Parrot_jit_cpcf_op> functions or an opcode
-specific function. B<Parrot_jit_restart_op> is like B<Parrot_jit_cpcf_op> with
-the addition to check for a zero program counter. The B<Parrot_jit_vtable*_op>
-functions are defined as B<Parrot_jit_normal_op> or B<Parrot_jit_cpcf_op> and
-may be implemented to do native vtable calls (s. F<jit/i386/jit_emit.h> for an
-example).
-
-The B<Parrot_jit_fixup> structure records the offset in native code where a
-fixup must be applied, the type of fixup required and the specific information
-needed to perform the parameters of the fixup.  Currently, a fixup parameter is
-either an B<opcode_t> value or a function pointer.
-
-The B<Parrot_jit_info> structure holds data used while producing and executing
-native code.  An important piece of data in this structure is the B<op_map>
-array, which maps from opcode addresses to native code addresses.
-
-=item src/jit.c
-
-B<parrot_build_asm>() is the main routine of the code generator, which loops
-over the parrot bytecode, calling the code generating routines for each opcode
-while filling in the B<op_map> array.  This array is used by the JIT subsystem
-to perform certain types of fixups on native code, as well as by the native
-code itself to convert bytecode program counters values (opcode_t *'s) to
-hardware program counter values.
-
-The bytecode is considered an array of B<opcode_t> sized elements, with
-parallel entries in B<op_map>.  B<op_map> is initially populated with the
-offsets into the native code corresponding to the opcodes in the bytecode. Once
-code generation is complete and fixups have been applied, the native code
-offsets are converted to absolute addresses.  This trades the low up-front cost
-of converting all offsets once, for the unknown cost of repeatedly converting
-these offsets while executing native code.
-
-See F<src/jit/skeleton/jit_emit.h> for details.
-
-=item tools/build/jit2c.pl
-
-Preprocesses the .jit files to produce F<jit_cpu.c>.
-
-=back
-
-=head1 Defines in jit_emit.h
-
-The architecture specific F<jit_emit.h> file communicates some defines and
-tables with F<jit.c> and F<languages/imcc/imc.c>. The structure of the file and
-the defines must therefore follow a specific syntax.
-
-=head2 Overall structure
-
-    #if JIT_EMIT
-
-    ... emit code
-
-    #else
-
-    ... defines
-    static const jit_arch_info arch_info = {
-       ... initialization of maps
-       ... and possibly private static functions
-    }
-
-    #endif
-
-See F<src/jit/skeleton/jit_emit.h> for a more detailed explanation.
-
-=head2 Defines
-
-XXX most are moved into C<jit_arch_info> now.
-
-=over 4
-
-=item INT_REGISTERS_TO_MAP
-
-This is the amount of integer registers to be mapped to processor registers.
-The corresponding B<intval_map[]> has to have exactly this amount of register
-numbers. A register with the value of zero can not be in the list.
-
-=item FLOAT_REGISTERS_TO_MAP
-
-When this is defined, it works like above for floating point registers.
-
-=item PRESERVED_INT_REGS
-
-When this is defined, it's the amount of integer registers, that are preserved
-over function calls. These preserved registers have to be first in
-B<intval_map>. When this is not defined, it is assumed that B<all> registers
-are preserved over function calls.
-
-=item PRESERVED_FLOAT_REGS
-
-Same for floating point registers.
-
-=item jit_emit_noop(pc)
-
-=item JUMP_ALIGN
-
-If these are defined, B<JUMP_ALIGN> should be a small number stating the
-desired alignment of jump targets is B<1 << JUMP_ALIGN>.  The B<jit_emit_noop>
-gets called with the unaligned B<pc> repeatedly, until the B<pc> has the
-desired alignment. So the function can either emit a one byte B<noop>
-instruction, or a B<noop> like instruction (sequence) with the desired size, to
-achieve the necessary padding.  The emitted code must not have any side
-effects.
-
-=item ALLOCATE_REGISTERS_PER_SECTION
-
-Normally F<jit.c> does register allocation per section, but there is a somewhat
-experimental feature, to allocate registers per basic block.
-
-=item MAP
-
-Jit code generated by the F<imcc> JIT optimizer used negative numbers for
-mapped registers and positive numbers for non mapped parrot registers. To use
-this feature, the definition of mapped registers can be redefined like so:
-
-    #define MAP(i) OMAP(i)
-    #undef MAP
-    #define MAP(i) (i) >= 0 ? 0 : OMAP(i)
-
-=item Parrot_jit_emit_get_base_reg_no(pc)
-
-This macro should return the register number of the register
-base pointer. 
-
-=back
-
-See F<src/jit/i386/jit_emit.h> for actual usage of these defines.
-
-=head1 Format of .jit Files
-
-Jit files are interpreted as follows:
-
-=over 4
-
-=item I<op-name> { \n I<body> \n }
-
-Where I<op-name> is the name of the Parrot opcode, and I<body> consists of C
-syntax code which may contain any of the identifiers listed in the following
-section.
-
-The closing curly brace has to be in the first column.
-
-=item Comment lines
-
-Comments are marked with a I<;> in the first column. These and empty lines are
-ignored.
-
-=item Identifiers
-
-In general, prefixing an identifier with I<&> yields an address.  The I<*>
-prefix specifies a value.  Since Parrot register values vary during code
-execution, their values can not be obtained through identifier substitution
-alone, therefore offsets are used for accessing registers.
-
-To obtain register offsets, a set of macros exists, that have C<OFFS> in
-their names:
-
-B<REG_OFFS_INT(reg_no)> ...
-
-B<ROFFS_INT(n)> ...
-
-B<INT_CONST[n]>
-
-Gets replaced by the C<INTVAL> constant specified in the I<n>th argument.
-
-B<NUM_CONST[n]>
-
-Gets replaced by the C<FLOATVAL> constant specified in the I<n>th argument.
-
-B<MAP[n]>
-
-The I<n>th integer or floating processor register, mapped in this section.
-
-Note: The register with the physical number zero can not be mapped.
-
-=begin unimp
-
-B<STRING_CONST_strstart[n]>
-
-Gets replaced by C<strstart> of the C<STRING> constant specified in the I<n>th
-argument.
-
-B<STRING_CONST_buflen[n]>
-
-Gets replaced by C<buflen> of the C<STRING> constant specified in the I<n>th
-argument.
-
-B<STRING_CONST_flags[n]>
-
-Gets replaced by C<flags> of the C<STRING> constant specified in the I<n>th
-argument.
-
-B<STRING_CONST_strlen[n]>
-
-Gets replaced by C<strlen> of the C<STRING> constant specified in the I<n>th
-argument.
-
-B<STRING_CONST_encoding[n]>
-
-Gets replaced by C<encoding> of the C<STRING> constant specified in the I<n>th
-argument.
-
-B<STRING_CONST_type[n]>
-
-Gets replaced by C<type> of the C<STRING> constant specified in the I<n>th
-argument.
-
-B<STRING_CONST_language[n]>
-
-Gets replaced by C<language> of the C<STRING> constant specified in the I<n>th
-argument.
-
-=end unimp
-
-B<NATIVECODE>
-
-Gets replaced by the current native program counter.
-
-B<*CUR_OPCODE[n]>
-
-Gets replaced by the address of the current opcode in the Parrot bytecode.
-
-B<ISRn> B<FSRn>
-
-The I<n>th integer or floating point scratch register.
-
-
-=item B<TEMPLATE> I<template-name> { \n I<body> \n }
-
-Defines a template for similar functions, e.g. all the binary ops taking three
-variable parameters.
-
-=item I<template-name> I<perl-subst> ...
-
-Take a template and do all substitutions to generate the implementation for
-this jit function.
-
-Example:
-
-    TEMPLATE Parrot_set_x_ic {
-    if (MAP[1]) {
-        jit_emit_mov_ri<_N>(NATIVECODE, MAP[1], <typ>_CONST[2]);
-    }
-    else {
-        jit_emit_mov_mi<_N>(NATIVECODE, &INT_REG[1], <typ>_CONST[2]);
-    }
-    }
-
-    Parrot_set_i_ic {
-    Parrot_set_x_ic s/<_N>/_i/ s/<typ>/*INT/
-    }
-
-    Parrot_set_n_ic {
-    Parrot_set_x_ic s/<_N>/_ni/ s/<typ>/&INT/ s/INT_R/NUM_R/
-    }
-
-The jit function B<Parrot_set_i_ic> is based on the template
-B<Parrot_set_x_ic>, the I<s/x/y/> are substitutions on the template body, to
-generate the actual function body. These substitutions are done before the
-other substitutions.
-
-s. F<jit/i386/core.jit> for more.
-
-=back
-
-=head2 Naming convention for jit_emit functions
-
-To make it easier to share F<core.jit> files between machines of similar
-architecture, the jit_emit functions B<should> follow this syntax:
-
-jit_emit_I<<op>>_I<<args>>_I<<type>>
-
-=over 4
-
-=item I<<op>>
-
-This is the operation like B<mov>, B<add> or B<bxor>. In normal cases this is
-the PASM name of the op.
-
-=item I<<args>>
-
-B<args> specify the arguments of the function in the PASM sequence B<dest>,
-B<source> ... The B<args> consist of one letter per argument:
-
-=over 4
-
-=item B<r>
-
-A mapped processor register.
-
-=item B<m>
-
-A memory operand, the address of the parrot register.
-
-=item B<i>
-
-An immediate operand, i.e. an integer constant.
-
-=back
-
-=item I<<type>>
-
-Specifies if this operation works on integer or floating point arguments. If
-all arguments are of the same type, only one type specifier is needed.
-
-=over 4
-
-=item B<i>
-
-An integer argument
-
-=item B<n>
-
-A float argument.
-
-=back
-
-Examples:
-
-=over 4
-
-=item B<jit_emit_sub_rm_i>
-
-Subtract integer at memory from integer processor register.
-
-=item B<jit_emit_mov_ri_ni>
-
-Move integer constant (immediate) to floating point register.
-
-=back
-
-=back
-
-=head1 ALPHA Notes
-
-The access to Parrot registers is done relative to C<$6>, all other memory
-access is done relative to C<$27>, to access float constants relative to C<$7>
-so you must preside the instruction with I<ldah $7,0($27)>.
-
-=head1 i386 Notes
-
-Only 32 bit INTVALs are supported. Long double FLOATVALs are ok.
-
-There are four mapped integer registers B<%edi>, B<%esi>, B<%ecx>, and B<%edx>.
-The first 2 of these are callee saved, they preserve their value around extern
-function calls.
-
-Four floating point operations the registers B<ST1> ... B<ST4> are mapped and
-considered as preserved over function calls.
-
-The register C<%ebx> holds the register frame pointer.
-
-=head1 EXAMPLE
-
-Let's see how this works:
-
-B<Parrot Assembly:>
-
- set I0,8
- set I2,I0
- print I2
- end
-
-B<Parrot Bytecode:> (only the bytecode segment is shown)
-
- +--------------------------------------+
- | 73 | 0 | 8 | 72 | 2 | 0 | 21 | 2 | 0 |
- +-|------------|------------|--------|-+
-   |            |            |        |
-   |            |            |        +----------- end (no arguments)
-   |            |            +-------------------- print_i (1 argument)
-   |            +--------------------------------- set_i_i (2 arguments)
-   +---------------------------------------------- set_i_ic (2 arguments)
-
-Please note that the opcode numbers used might have already changed.  Also
-generated assembly code might be different.
-
-B<Intel x86 assembly version of the Parrot ops:>
-
-B<Parrot_jit_begin>
-
-    0x817ddd0 <jit_func>:   push   %ebp
-    0x817ddd1 <jit_func+1>: mov    %esp,%ebp
-    0x817ddd3 <jit_func+3>: push   %ebx
-    0x817ddd4 <jit_func+4>: push   %esi
-    0x817ddd5 <jit_func+5>: push   %edi
-
-  normal function header till here, now push interpreter
-
-    0x817ddd6 <jit_func+6>: push   $0x8164420
-
-  get jit function table to %ebp and
-  jump to first instruction
-
-    0x817dddb <jit_func+11>:    mov    0xc(%ebp),%eax
-    0x817ddde <jit_func+14>:    mov    $0x81773f0,%ebp
-    0x817dde3 <jit_func+19>:    sub    $0x81774a8,%eax
-    0x817dde9 <jit_func+25>:    jmp    *%ds:0x0(%ebp,%eax,1)
-
-B<set_i_ic>
-
-    0x817ddee <jit_func+30>:    mov    $0x8,%edi
-
-B<set_i_i>
-
-    0x817ddf3 <jit_func+35>:    mov    %edi,%ebx
-
-B<Parrot_jit_save_registers>
-
-    0x817ddf5 <jit_func+37>:    mov    %edi,0x8164420
-    0x817ddfb <jit_func+43>:    mov    %ebx,0x8164428
-
-B<Parrot_jit_normal_op>
-
-    0x817de01 <jit_func+49>:    push   $0x81774c0
-    0x817de06 <jit_func+54>:    call   0x804be00 <Parrot_print_i>
-    0x817de0b <jit_func+59>:    add    $0x4,%esp
-
-B<Parrot_jit_end>
-
-    0x817de0e <jit_func+62>:    add    $0x4,%esp
-    0x817de14 <jit_func+68>:    pop    %edi
-    0x817de16 <jit_func+70>:    pop    %ebx
-    0x817de18 <jit_func+72>:    pop    %esi
-    0x817de1a <jit_func+74>:    pop    %ebp
-    0x817de1c <jit_func+76>:    ret
-
-Please note the reverse argument direction. PASM and JIT notations use
-I<dest,src,src>, while F<gdb> and the internal macros in F<jit_emit.h> have
-I<src,dest>.
-
-=head1 Debugging
-
-Above listing was generated by F<gdb>, the GNU debugger, with a little help
-from Parrot_jit_debug, which generates a symbol file in I<stabs> format, s.
-B<info stabs> for more (or less :-()
-
-The following script calls F<ddd> (the graphic debugger fronted) and attaches
-the symbol file, after it got built in F<parrot_build_asm>.
-
-    # dddp
-    # run ddd parrot with given file
-    # gdb confirmations should be off
-    parrot -o $1.pbc -d1 $1.pasm
-    echo "b runops_jit
-    r -D4 -R jit $1.pbc
-    n
-    add-symbol-file $1.o 0
-    s
-    " > .ddd
-
-    ddd --command .ddd parrot &
-
-Run this with e.g. I<dddp t/op/jit_2>, then turn on the register status,
-I<step> or I<nexti> through the source, or set break points as with any other
-language.
-
-You can examine parrot registers via the debugger or even set them and you can
-always step into external opcode and look at I<*interpreter>.
-
-The tests F<t/op/jit*.t> have some test cases for testing register allocation.
-These tests are written for a mapping of 4 processor registers. If your
-processor architecture has more mapped registers, reduce them to 4 and run
-these tests.
-
-=head2 Example for a debug session
-
-  $ cat j.pasm
-        set I0, 10
-        set N1, 1.1
-        set S2, "abc"
-        print "\n"
-        end
-  $ dddp j
-
-(ddd shows above source code and assembly (startup code snipped):
-
-    0x815de46 <jit_func+30>:    mov    $0xa,%ebx
-    0x815de4b <jit_func+35>:    fldl   0x81584c0
-    0x815de51 <jit_func+41>:    fstp   %st(2)
-    0x815de53 <jit_func+43>:    mov    %ebx,0x8158098
-    0x815de59 <jit_func+49>:    fld    %st(1)
-    0x815de5b <jit_func+51>:    fstpl  0x8158120
-    0x815de61 <jit_func+57>:    push   $0x815cd90
-    0x815de66 <jit_func+62>:    call   0x804db90 <Parrot_set_s_sc>
-    0x815de6b <jit_func+67>:    add    $0x4,%esp
-    0x815de6e <jit_func+70>:    push   $0x815cd9c
-    0x815de73 <jit_func+75>:    call   0x804bcd0 <Parrot_print_sc>
-    0x815de78 <jit_func+80>:    add    $0x4,%esp
-    0x815de7b <jit_func+83>:    add    $0x4,%esp
-    0x815de81 <jit_func+89>:    pop    %edi
-    0x815de83 <jit_func+91>:    pop    %ebx
-    0x815de85 <jit_func+93>:    pop    %esi
-    0x815de87 <jit_func+95>:    pop    %ebp
-    0x815de89 <jit_func+97>:    ret
-  (gdb) n
-  (gdb) n
-  (gdb) n
-  (gdb) p I0
-  $1 = 10
-  (gdb) p N1
-  $2 = 1.1000000000000001
-  (gdb) p *S2
-  $3 = {bufstart = 0x815ad30, buflen = 15, flags = 336128, bufused =
-  3, strstart = 0x815ad30 "abc"}
-  (gdb) p &I0
-  $4 = (INTVAL *) 0x8158098
-
-XXX (p)rinting register contents like shown above is currently not supported.
-
-=head1 SEE ALSO
-
-F<docs/dev/jit_i386.pod>, F<jit/skeleton/jit_emit.h> 

Modified: branches/orderedhash_revamp/docs/memory_internals.pod
==============================================================================
--- branches/orderedhash_revamp/docs/memory_internals.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/memory_internals.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2004, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
 =head1 NAME
@@ -51,31 +51,31 @@
 
     typedef struct Interp {
         ...
-        struct Arenas *arena_base;
+        struct Memory_Pools *mem_pools;
         ...
     } Interp;
 
 All object-like things that get allocated during the execution of parrot
-bytecode are managed from the C<arena_base> member of the interpreter
+bytecode are managed from the C<mem_pools> member of the interpreter
 structure.
 
-=head1 Arenas
+=head1 Memory Pools
 
-C<struct Arenas> holds pointers to a variety of different kinds of managed
+C<struct Memory_Pools> holds pointers to a variety of different kinds of managed
 memory. A simplification looks similar to this:
 
-    typedef struct Arenas {
-        struct Memory_Pool *memory_pool;
+    typedef struct Memory_Pools {
+        struct Var_Size_Pool *memory_pool;
         ...
-        struct Small_Object_Pool * header_pool;
-        struct Small_Object_Pool ** sized_pools;
-    } Arenas;
+        struct Fixed_Size_Pool * header_pool;
+        struct Fixed_Size_Pool ** sized_pools;
+    } Memory_Pools;
 
 C<memory_pool> and C<header_pool> are variable and fixed sized pool pointers
-respectively. These are just two examples, there are other C<Memory_Pool>s
-and C<Small_Object_Pool>s in the Parrot system. Pools of type
-C<struct Memory_Pool> are for variable-size objects, such as constant string
-buffers. Pools of type C<struct Small_Object_Pool> are for fixed-size objects
+respectively. These are just two examples, there are other C<Var_Size_Pool>s
+and C<Fixed_Size_Pool>s in the Parrot system. Pools of type
+C<struct Var_Size_Pool> are for variable-size objects, such as constant string
+buffers. Pools of type C<struct Fixed_Size_Pool> are for fixed-size objects
 such as headers or PMCs.
 
 =head1 Fixed sized items
@@ -117,18 +117,16 @@
 =head2 General structure of a buffer-like item
 
     struct parrot_object_t {
-        UnionVal cache;
         unsigned flags;
         ...
     } PObj;
 
-This does not totally reflect the current implementation, but is the spirit of
-the abstraction of current objects. The C<UnionVal cache> field is a C<union>
-that contains a variety of pointer and data configurations. The flags field
-may contain a series of flags which indicate the type, status, configuration,
-and special requirements of each item. Buffers, C<PMC>s, and C<PObj>s all
-have these basic fields in common, although they also contain a variety of
-other data fields, depending on type.
+The flags field may contain a series of flags which indicate the type, status,
+configuration, and special requirements of each item. C<Buffer>s, C<PMC>s, and
+C<PObj>s all have this basic field in common.
+
+C<PMC>s and C<Buffer>s each have an additional field which contain a pointer
+to a block of data.
 
 =head2 GC-related PObj flags
 
@@ -137,28 +135,18 @@
 flags are stored in C<PObj-E<gt>flags>, meaning that each PMC must be accessed
 during the mark run.
 
-An alternative approach is to store the GC-Flags together somewhere, such as
-in the individual arenas, as a packed array of bits. This approach, called
-cardmarking, should be indicated by defining the preprocessor variable
-C<ARENA_GC_FLAGS> to 1.
-
-{{ ARENA_GC_FLAGS (nee ARENA_DOD_FLAGS) seems to have been deprecated or
-changed without concomitant update to this document.  Someone should figure out
-what this macro used to be and whether it's still relevant.  -cotto }}
-
 F<pobj.h> provides macros to facilitate referencing individual object flags:
 C<gc_flag_SET>, C<gc_flag_CLEAR> and C<gc_flag_TEST>. They make up a portable
 way of manipulating the GC-relevant object flags.
 
 =head1 Variable sized items
 
-Variable-sized items do not exist by themselves, they are always preceded by
-a buffer structure that contains information about them. These buffer
-structures are described above, and the C<UnionVal cache> item typically
-points to the memory block that contains the data. The variable-sized data
-items are managed in two different pools: the C<memory_pool>, which contains
-a general mish-mash of data types, and the C<constant_string_pool> which
-contains immutable string buffers used by programs running on Parrot.
+Variable-sized items do not exist by themselves, they are always wrapped by
+a buffer structure that contains a pointer to the data information about them.
+The variable-sized data items are managed in two different pools: the
+C<memory_pool>, which contains a general mish-mash of data types, and the
+C<constant_string_pool> which contains immutable string buffers used by
+programs running on Parrot.
 
 Here, different memory allocation schemes jump in:
 
@@ -223,11 +211,6 @@
 once. Both allocation schemes therefore use a part of the allocated string to
 do this bookkeeping.
 
-Copying GC uses a C<Buffer_Tail> after the end of the actual variable length
-string and marks such COW strings with C<TAIL_moved> and stores the new address
-in the buffer header, so other users of this string can be updated to reuse the
-same string (RT#47764 one or all other users?).
-
 The C<malloc()>/C<free()> approach stores a refcount at C<bufstart>. During the
 mark phase all dead users increment the refcount, living users set it to an
 huge value.  When freeing the buffer, the string is only freed if the refcount
@@ -235,9 +218,9 @@
 
 =head1 Simplified Figure
 
-                             +--------+
-      +------------------<---| Arenas |<-----------+
-      |                      +--------+-->--+      |
+                         +--------------+
+      +--------------<---| Memory Pools |<---------+
+      |                  +--------------+---+      |
       |                                     |      |
       |         +------+    +-----------+   |  +=============+
       |         | S0   |<---| Registers |<--)--| Interpreter |
@@ -251,8 +234,8 @@
  +-------+  |   | Buffer 2 |    | ..String...  |<--| Block 2 |
  | .     |  |   +----------+    +--------------+   +---------+
  +-------+  |   | ...      |        ^    ^         | ...     |
- Small Obj  |   +----------+        |    |         +---------+
- Pool       +-->| Buffer N |--------+----+         Memory Pool
+Fixed Size  |   +----------+        |    |         +---------+
+   Pool     +-->| Buffer N |--------+----+        Var Size Pool
                 +----------+
                  Buffer          Memory Block
 
@@ -263,9 +246,9 @@
 
 =head1 FILES
 
-mark_sweep.[ch], src/gc/pools.c, resources.[ch], res_lea.c, src/gc/api.c,
-string.[ch], pobj.h. Other garbage collector implementations may use separate
-files as well.
+src/gc/api.c, src/gc/gc_private.h, pobj.h, mark_sweep.[ch],
+alloc_resources.[ch], string.[ch]. Other garbage collector
+implementations may use separate files as well.
 
 =head1 BUGS
 
@@ -274,10 +257,8 @@
 
 =head1 AUTHOR
 
-Leopold Tötsch C<lt at toetsch.at>
+Leopold Tötsch C<lt at toetsch.at>
 
 =head1 VERSION
 
 0.1.1 June 2008
-
-

Deleted: branches/orderedhash_revamp/docs/native_exec.pod
==============================================================================
--- branches/orderedhash_revamp/docs/native_exec.pod	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,77 +0,0 @@
-# Copyright (C) 2001-2004, Parrot Foundation.
-# $Id$
-
-=head1 NAME
-
-docs/native_exec.pod - Parrot Native Object Execution Subsystem
-
-=head1 Overview
-
-On supported platforms, Parrot can use the JIT subsystem to assemble a native
-executable binary from a Parrot program.  This method wraps the VM runtime
-engine and a precompiled Parrot program into a single binary.
-
-=head1 Generating a native executable
-
-Generating a native executable is done in three steps: building a packfile,
-assembling a native object, and then linking the native executable. 
-
-The packfile is generated in the standard way from .pir or .pasm source by IMCC.
-For a program in myprog.pasm:
-
-    ./parrot -o myprog.pbc myprog.pasm
-
-This generates the myprog.pbc packfile.  The native object is generated
-similarly:
-
-    ./parrot -o myprog.o myprog.pbc
-
-This creates a native object called myprog.o.  Assembly of the executable is
-done by the "exec" target in the root Makefile like so:
-
-    make EXEC=myprog exec
-
-This generates the "myprog" executable, which runs equivalently to
-
-    ./parrot -R jit myprog.pbc
-
-minus the time required to JIT-compile the bytecode.
-
-The "hello" target of the root Makefile demonstrates this method
-for a "Hello world" program.
-
-=head1 Details
-
-=head2 Platform support
-
-The exec subsystem is enabled if support is determined automatically by
-config/auto/jit.pl, or if the option --execcapable is explicitly specified to
-Configure.pl.  The platform must support the JIT core, and some additional
-scaffold in the exec* sources must be provided.  Implementation of such is
-beyond the scope of this document.
-
-=head2 Native object generation
-
-Native objects are generated by the "exec" run core.  This core uses the JIT
-subsystem to compile a packfile to native instructions, then serializes it to
-the platform's native object format. This object is then loaded at runtime and
-executed using the normal JIT core.
-
-Unlike the standard cores (switch, computed goto, etc.) which are activated by
-command-line switch, the exec core is invoked by IMCC when the output file
-specified by the -o option has a .o extension.  When creating a native object
-this way, IMCC requires that the input be a packfile.  This process therefore
-must be performed in two steps, building the packfile and assembling the native
-object, as demonstrated above.
-
-=head2 Executable generation
-
-A native executable is generated by linking a native object against the parrot
-library and the loader in exec_start.c.  The "exec" target in the root Makefile
-does this with the compile flags used to build parrot itself.  Alternatively it
-may be done by hand, e.g.
-
-    gcc -o myprog myprog.o src/exec_start.o blib/lib/libparrot.a
-
-Additional libraries may need to be included as appropriate for the platform.
-

Modified: branches/orderedhash_revamp/docs/parrot.pod
==============================================================================
--- branches/orderedhash_revamp/docs/parrot.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/parrot.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -7,7 +7,7 @@
 
 =head1 The Parrot Virtual Machine
 
-Parrot is a language-agnostic common bytecode format and interpreter for
+Parrot is a language-agnostic common bytecode format and an interpreter for
 dynamic languages.
 
 =head2 Documentation
@@ -81,10 +81,6 @@
 
 Describes the embedding subsystem in excruciating detail.
 
-=item F<jit.pod>
-
-A brief description of Parrot's Just-In-Time compiler.
-
 =item F<memory_internals.pod>
 
 An introduction to the Parrot GC subsystem

Modified: branches/orderedhash_revamp/docs/parrothist.pod
==============================================================================
--- branches/orderedhash_revamp/docs/parrothist.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/parrothist.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -9,13 +9,15 @@
 =head1 RELEASE MANAGERS
 
 Simon Cozens, Jeff Goff, Steve Fink, Leo Toetsch, Chip Salzenberg, Jerry Gay,
-Patrick Michaud, Will Coleda, Matt Diephouse, chromatic, Allison Randal,
+Patrick Michaud, Will "coke" Coleda, Matt Diephouse, chromatic, Allison Randal,
 Jonathan Worthington, Bob Rogers, Bernhard Schmalhofer, Andrew Whitworth,
-Francois Perrad.
+Francois Perrad, Jonathan Leto.
 
 
 =head1 THE RECORDS
 
+Starred release numbers indicate supported releases.
+
  Release     Release        Date            Release name
  Manager
  ===========================================================================
@@ -58,14 +60,14 @@
 
  Jerry       0.4.8b         2007-Jan-16     "Eponymous"
  Patrick     0.4.9          2007-Feb-22     "Socorro"
- Will        0.4.10         2007-Mar-20     "Release Formerly Known as Prince"
+ coke        0.4.10         2007-Mar-20     "Release Formerly Known as Prince"
  Matt        0.4.11         2007-Apr-17     "Tax Bird"
  chromatic   0.4.12         2007-May-15     "Of The Caribbean"
  Allison     0.4.13         2007-Jun-19     "Clifton"
  Jerry       0.4.14         2007-Jul-17     "Now, with Seat Belts!"
  Patrick     0.4.15         2007-Aug-22     "Augean Stable"
  Jerry       0.4.16         2007-Sep-18     "A Farewell to Alex"
- Will        0.4.17         2007-Oct-17     "Two for Finching"
+ coke        0.4.17         2007-Oct-17     "Two for Finching"
 
  chromatic   0.5.0          2007-Nov-20     "Caulked Snack"
  Jonathan    0.5.1          2007-Dec-18     "Hatachi"
@@ -81,16 +83,23 @@
  Bob         0.7.0          2008-Aug-19     "Severe Macaw"
  Patrick     0.7.1          2008-Sep-16     "Manu Aloha"
 
- particle    0.8.0          2008-Oct-21     "Pareto Principle"
+ Jerry       0.8.0          2008-Oct-21     "Pareto Principle"
  chromatic   0.8.1          2008-Nov-18     "Tio Richie"
  Whiteknight 0.8.2          2008-Dec-16     "Feliz Loro"
 
  chromatic   0.9.0          2009-Jan-20     "From Outer Space"
  kjs         0.9.1          2009-Feb-17     "Final Countdown"
 
- Allison     1.0.0          2009-Mar-17     "Haru Tatsu"
+ Allison     1.0.0 *        2009-Mar-17     "Haru Tatsu"
  Francois    1.1.0          2009-Apr-21     "Half-moon Conure"
  Infinoid    1.2.0          2009-May-19     "Bird Brain"
  Whiteknight 1.3.0          2009-Jun-16     "Andean Swift"
 
+ cotto       1.4.0 *        2009-Jul-21     "Mundo Cani"
+ Whiteknight 1.5.0          2009-Aug-18     "TEH PARROTZ!"
+ Jerry       1.6.0          2009-Sep-15     "half-pie"
+ dukeleto    1.7.0          2009-Oct-20     "African Grey"
+ Barney      1.8.0          2009-Nov-17     "Zygodactyly"
+ Gerd        1.9.0          2009-Dec-15     "Blue-fronted Amazon"
+
 =cut

Modified: branches/orderedhash_revamp/docs/pdds/draft/pdd06_pasm.pod
==============================================================================
--- branches/orderedhash_revamp/docs/pdds/draft/pdd06_pasm.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/pdds/draft/pdd06_pasm.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -203,20 +203,6 @@
 Branch forward or backward by the amount in register x. (X may be either Ix,
 Nx, or Px) Branch offset may also be an integer constant.
 
-=item jsr tx
-
-Jump to the location specified by register X. Push the current location onto
-the call stack for later returning.
-
-=item bsr ix
-
-Branch to the location specified by X (either register or label). Push the
-current location onto the call stack for later returning.
-
-=item ret
-
-Pop the location off the top of the stack and go there.
-
 =back
 
 =head3 Data manipulation

Modified: branches/orderedhash_revamp/docs/pdds/draft/pdd08_keys.pod
==============================================================================
--- branches/orderedhash_revamp/docs/pdds/draft/pdd08_keys.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/pdds/draft/pdd08_keys.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -65,15 +65,11 @@
         KEY_pmc_FLAG            = PObj_private3_FLAG,
         KEY_register_FLAG       = PObj_private4_FLAG,
 
-        KEY_start_slice_FLAG    = PObj_private5_FLAG,
-        KEY_end_slice_FLAG      = PObj_private6_FLAG,
-        KEY_inf_slice_FLAG      = PObj_private7_FLAG,
-
-        KEY_type_FLAGS          = KEY_integer_FLAG |
-                                  KEY_number_FLAG  |
-                                  KEY_string_FLAG |
-                                  KEY_pmc_FLAG |
-                                  KEY_register_FLAG |
+        KEY_type_FLAGS          = KEY_integer_FLAG   |
+                                  KEY_number_FLAG    |
+                                  KEY_string_FLAG    |
+                                  KEY_pmc_FLAG       |
+                                  KEY_register_FLA G |
                                   KEY_hash_iterator_FLAGS
     } KEY_flags
 

Modified: branches/orderedhash_revamp/docs/pdds/draft/pdd10_embedding.pod
==============================================================================
--- branches/orderedhash_revamp/docs/pdds/draft/pdd10_embedding.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/pdds/draft/pdd10_embedding.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -96,7 +96,7 @@
 
 =item * probably a continuation/control flow boundary
 
-=item * packfiles and compilation units probably too much information for
+=item * packfiles and subroutines probably too much information for
 either
 
 =item * do not let MMD and other implementation details escape

Modified: branches/orderedhash_revamp/docs/pdds/draft/pdd16_native_call.pod
==============================================================================
--- branches/orderedhash_revamp/docs/pdds/draft/pdd16_native_call.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/pdds/draft/pdd16_native_call.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -36,16 +36,16 @@
 
 =head3 Function signatures
 
-The following list are the valid letters in the function signatures for
-Parrot's NCI. Note that only letters and numbers are valid, and each letter
-represents a single parameter passed into the NCI. Note that the letters are
+The following list are the valid symbols in the function signatures for
+Parrot's NCI. Note that only letters and numbers are valid, and each symbol
+represents a single parameter passed into the NCI. Note that the symbols are
 case-sensitive, and must be within the base 7-bit ASCII character set.
 
 At some point punctuation may be used as modifiers on the function
 parameters, in which case each parameter may be represented by multiple
-letters.
+symbols.
 
-In I<no> case should the signature letters be separated by whitespace. This
+In I<no> case should the signature symbols be separated by whitespace. This
 restriction may be lifted in the future, but for now remains as an avenue
 for adding additional functionality.
 
@@ -56,8 +56,8 @@
 Void. As a return type it indicates that there I<is> no return type.
 
 As a parameter it indicates that there are no parameters (this use is now
-deprecated - use an empty parameter string to indicate that there are no
-parameters). Can't be mixed with other parameter types.
+deprecated (TT1410) - use an empty parameter string to indicate that there
+are no parameters). Can't be mixed with other parameter types.
 
 =item c
 
@@ -92,10 +92,12 @@
 
 =item p
 
-PMC thingie. A generic pointer, taken from or stuck into a PMC's data
-pointer.  If this is a return type, parrot will create a new UnManagedStruct
-PMC type, which is just a generic "pointer to some damn thing or other" PMC
-type which Parrot does I<no> management of.
+PMC thingie. A generic pointer, taken from a PMC by using its
+get_pointer vtable function, or NULL for a PMCNULL.
+If this is a return type and the value is NULL, PMCNULL is returned,
+otherwise parrot will create a new UnManagedStruct PMC type, which
+is just a generic "pointer to something" PMC type which Parrot does
+I<no> management of.
 
 =item 2
 

Added: branches/orderedhash_revamp/docs/pdds/draft/pdd31_hll.pod
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/docs/pdds/draft/pdd31_hll.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,309 @@
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 [DRAFT] PDD 31: HLL Compilers and Libraries
+
+=head2 Version
+
+$Revision$
+
+=head2 Abstract
+
+This PDD describes the standard compiler API and support for
+cross-library communication between high-level languages (HLLs).
+
+=head2 Description
+
+Parrot's support for HLL interoperability is primarily focused on
+enabling programs written in one language to be able to use libraries
+and code written in a different language.  At the same time, language
+implementors should not be overly restricted by a global specification.
+
+This PDD describes an API for HLL compiler objects to use to
+promote library sharing among languages.  It's intended to make it
+easy for a program to request loading of a local or foreign module,
+determine the capabilities provided by the module, and potentially
+import and integrate them into its own namespaces.  In general,
+the API treats library-level interoperability as a negotiation
+among HLL compiler objects, with each HLL compiler maintaining
+primary control over the operations performed in its HLL space.
+
+In particular, this HLL API does not attempt to prescribe how
+languages should organize their internal capabilities, PMCs,
+namespaces, methods, data structures, and the like.
+
+=head2 Implementation
+
+=head3 Compiler API
+
+This section describes the abstract API for HLL compiler objects.
+
+=head4 Locating a compiler object
+
+Generally HLL compilers are loaded via the C<load_language>
+opcode, and register themselves using the C<compreg> opcode.
+By convention, each HLL compiler should at minimum register
+itself using the name of its HLL namespace (see PDD 26),
+although a compiler can choose to register itself under other
+names as well.
+
+=head4 Methods
+
+=over 4
+
+=item C<compile>
+
+    $P0 = compiler.'compile'(source [, options :named :slurpy])
+
+Return the result of compiling C<source> according to C<options>.
+Common options include:
+
+=over 4
+
+=item target
+
+Stop the compilation process when the stage given by target
+has been reached.  Common values for target include "parse",
+"past", "pir", and "pbc".
+
+=item outer_ctx
+
+Use the supplied context as the outer (lexical) context for
+the compilation.  Some languages require this option to be
+able to look up lexical symbols in outer scopes when performing
+a dynamic compilation at runtime.
+
+=back
+
+=item C<eval>
+
+    $P0 = compiler.'eval'(source [, options :named :slurpy])
+
+Compile and evaluate (execute) the code given by C<source>
+according to C<options>.  The available options are generally
+the same as for the C<compile> method above; in particular,
+the C<outer_ctx> option can be used to specify the outer lexical
+context for the evaluated source.
+
+=item C<parse_name>
+
+    $P0 = compiler.'parse_name'(name)
+
+Parse the string C<name> using the rules specific to C<compiler>,
+and return an array of individual name elements.
+
+For example, a Java compiler would turn 'C<a.b.c>' to C<['a','b','c']>,
+while a Perl compiler would turn 'C<a::b::c>' into the same result.
+Perl's sigil rules would likely turn 'C<$a::b::c>' into C<['a','b','$c']>.
+
+=item C<load_module>
+
+    module = compiler.'load_module'(name)
+
+Locate and load the module given by C<name> using the rules for
+libraries specific to C<compiler>, and return a C<module> handle for
+the module just loaded.  The C<name> argument is typically an array
+or a string to be processed as in C<parse_name> above.  In general
+the module handle returned should be considered opaque by the
+caller, but specific HLL compilers are allowed to specify the
+nature of the handle returned (e.g., a namespace for the loaded
+module, or a specific "handle" object).
+
+=item C<get_module>
+
+    module = compiler.'get_module'(name)
+
+Similar to C<load_module> above, this method returns a handle
+to an already-loaded module given by C<name>.
+
+=item C<get_exports>
+
+    $P0 = compiler.'get_exports'(module [,name,name,...] [, 'tagset'=>tagset])
+
+Requests the exported objects given by C<name> and/or C<tagset> for
+C<module> within the given C<compiler>.  The C<module> argument
+should be a module handle as obtained by C<load_module> or
+C<get_module> above.
+
+A C<tagset> argument provides an identifier that a compiler and/or
+module can use to supply their own lists of items to be exported.
+By convention, a C<tagset> of "DEFAULT" refers to the default set
+of exported items for the module, while "ALL" returns all available
+exports.  Compilers and modules are free to define their own custom
+tagsets beyond these.
+
+Any C<name> arguments supplied generally limit the export list to
+the tagset items corresponding to the supplied names (as determined by
+the compiler invocant).  If names are provided without an explicit
+tagset, then "ALL" is assumed.  If neither names nor a tagset are
+provided, then symbols from "DEFAULT" are returned.
+
+The returned export list is a hash of hashes; each entry in the
+top level hash has a key identifying the type of exported
+object (one of C<'namespace'>, C<'sub'>, or C<'var'>) and a
+value hash containing the corresponding exported symbol names
+and objects.  This hash-of-hashes approach is intended to generally
+correspond to the "Typed Interface" section of PDD 21 ("Namespaces"),
+and allows the module's source HLL to indicate the type of exported
+object to the caller.  The hash-of-hash approach also accommodates
+languages where a single name might be used to refer to several
+objects that differ in type.  (This PDD explicitly rejects the
+notion that a HLL should be directly exporting or injecting symbols
+into a foreign HLL's namespaces.)
+
+=back
+
+=head3 HLL::Compiler class
+
+HLL::Compiler is a common base class for compiler objects
+based on the Parrot Compiler Toolkit (PCT) and NQP (Not Quite Perl)
+libraries.  It provides a default implementation of the abstract
+Compiler API above, plus some additional methods for simple symbol
+table export and import.  The default methods are intended to support
+importing and exporting symbols using standard Parrot namespace
+objects (PDD 21).  However, it's normal (and expected) that
+languages will subclass HLL::Compiler to provide language-specific
+semantics where needed.
+
+=head4 Methods
+
+=over 4
+
+=item C<language>
+
+    $S0 = compiler.'language'([name])
+
+If C<name> is provided, sets the language name of the invocant
+and registers the invocant as the compiler for C<name> via
+the C<compreg> opcode.
+
+Returns the language name of the compiler.
+
+=item C<parse_name>
+
+    $P0 = compiler.'parse_name'(name)
+
+Splits a name based on double-colons, such that "C<A::B::C>"
+becomes C<['A','B','C']>.
+
+=item C<get_module>
+
+    module = compiler.'get_module'(name)
+
+Returns a handle to the HLL namespace associated with C<name>
+(which is processed via the invocant's C<parse_name> method
+if needed).
+
+=item C<load_module>
+
+    module = compiler.'load_module'(name)
+
+Loads a module C<name> via the C<load_bytecode> opcode
+using both ".pbc" and ".pir" extensions.  Parrot's standard
+library paths for C<load_bytecode> are searched.
+
+Returns the HLL namespace associated with C<name> (which may
+be PMCNULL if loading failed or if the requested module did
+not create an associated namespace).
+
+=item C<get_exports>
+
+    $P0 = compiler.'get_exports'(module [,name,name,...] [, 'tagset'=>tagset])
+
+Implements a simple exporting interface that meets the "Compiler API"
+above.  The C<module> argument is expected to be something that
+supports a hash interface, such as NameSpace or LexPad.  (Note
+that this is what gets returned by the default C<get_module>
+and C<load_module> methods above.)  The C<module["EXPORT"]> entry
+should return another hash-like object keyed by tagset names; each
+of those tagset names then identify the exportable symbols
+associated with that tagset.
+
+With this default arrangement, it's entirely possible for a
+module to indicate its tagsets by using symbol entries in
+namespaces.  For example, a module with namespace C<['XYZ']>
+can define its default exports by binding symbols in the
+C<['XYZ';'EXPORT';'DEFAULT']> namespace.  (Modules aren't
+required to use exactly this mechanism; it's just one possibility
+of many.)
+
+If the "ALL" tagset is requested and there is no "ALL" entry
+in the C<module['EXPORT']> hash, then C<module> itself is used
+as the source of exportable symbols for this method.  This
+enables C<get_exports> to be used to obtain symbols from
+modules that do not follow the "EXPORT" convention above
+(e.g., core Parrot modules).
+
+As described in the Compiler API section above, the return value
+from C<get_exports> is a hash-of-hashes with exported namespaces
+in the C<namespace> hash, exported subroutines in the C<sub> hash,
+and all other exports in the C<var> hash.
+
+=item C<import>
+
+    compiler.'import'(target, export_hash)
+
+Import the entries from C<export_hash> (typically obtained
+via C<get_exports> above) into C<target> according to the rules
+for C<compiler>.  Any entries in C<export_hash['namespace']>
+are imported first, followed by entries in C<export_hash['sub']>,
+followed by entries in C<export_hash['var']>.
+
+Note that this method is not part of the abstract Compiler API --
+a HLL compiler is able to implement importing in any way it
+deems appropriate.  The C<HLL::Compiler> class provides this
+method as a useful default for many HLL compilers.
+
+For each exported item of C<export_hash>, import takes place by
+checking the invocant for an C<import_[type]> method and using
+that if it exists (where C<[type]> is one of "namespace", "sub",
+or "var").  These methods are used to implemented "typed imports",
+and allows the compiler object to perform any name mangling or
+other operations needed to properly import an object.
+
+If the compiler invocant doesn't define an C<import_[type]> method,
+C<import> attempts to use any C<add_[type]> method that exists on
+C<target> (e.g., for the case where C<target> is a namespace PMC
+supporting the typed interface defined by PDD 21).
+
+If neither of these methods are available, then C<import>
+simply binds the symbol using C<target>'s hash interface.
+
+=back
+
+=head3 Examples
+
+=head4 Importing a module Acme::Boom from language xyz into language abc
+
+=begin PIR_FRAGMENT
+
+    # Load the HLL library and get its compiler
+    .local pmc xyzcompiler, module, exports
+    load_language 'xyz'
+    xyzcompiler = compreg 'xyz'
+
+    # load xyz's module "Acme::Boom"
+    module = xyzcompiler.'load_module'("Acme::Boom")
+
+    # get the default exports for the module
+    # (note that 'tagset'=>'DEFAULT' is optional here
+    exports = xyzcompiler.'get_exports'(module, 'tagset'=>'DEFAULT')
+
+    # import into current namespace
+    .local pmc abccompiler
+    abccompiler = compreg 'abc'
+    $P0 = get_namespace
+    abccompiler.'import'($P0, exports)
+
+=end PIR_FRAGMENT
+
+=head2 References
+
+L<pdd21_namespaces.pod>
+
+=cut
+
+__END__
+Local Variables:
+  fill-column:78
+End:

Modified: branches/orderedhash_revamp/docs/pdds/pdd03_calling_conventions.pod
==============================================================================
--- branches/orderedhash_revamp/docs/pdds/pdd03_calling_conventions.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/pdds/pdd03_calling_conventions.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -116,12 +116,12 @@
 contents of the aggregate, rather than the aggregate itself, will be passed.
 
 If the C<NAMED> bit is also set, the aggregate will be used as a hash; its
-contents, as key/value pairs, will be passed as named parameters.  The PMC
-must implement the full hash interface.  {{ RT#45367: Limit the required
+contents, as key/value pairs, will be passed as named arguments.  The PMC
+must implement the full hash interface.  {{ TT #1288: Limit the required
 interface. }}
 
 If the C<NAMED> bit is not set, the aggregate will be used as an array; its
-contents will be passed as positional parameters.
+contents will be passed as positional arguments.
 
 The meaning of this bit is undefined when applied to integer, number, and
 string values.
@@ -174,10 +174,10 @@
 below, and those PMCs will be stored into the new aggregate.
 
 If the C<NAMED> bit is also set, the aggregate will be the HLL-specific hash
-type and the contents will be all unassigned _named_ parameters.
+type and the contents will be all unassigned _named_ arguments.
 
 If the C<NAMED> bit is not set, the aggregate will be the HLL-specific array
-type and the contents will be all unassigned positional parameters.
+type and the contents will be all unassigned positional arguments.
 
 =item 6     (unused)
 
@@ -216,7 +216,7 @@
 
 When the SLURPY bit is also set, behavior is as described above in the
 "SLURPY" section.  Otherwise, this bit may only be set on a unique string
-constant specifying the name of the next argument (or returned value).
+constant specifying the name of the next parameter (or returned value).
 
 =back
 
@@ -238,9 +238,6 @@
 null.  Excess registers explicitly marked B<OPTIONAL> are always reset,
 regardless of the error flag settings.
 
-RT#45357 - which exception?  We really could use an exception subsystem.
-Oh, wait, that's my job.  Never mind.  --Chip
-
 =head4 Ordering of named values (outgoing)
 
 Named values (arguments, or values to return) must be listed textually after

Modified: branches/orderedhash_revamp/docs/pdds/pdd07_codingstd.pod
==============================================================================
--- branches/orderedhash_revamp/docs/pdds/pdd07_codingstd.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/pdds/pdd07_codingstd.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -208,8 +208,6 @@
 to parenthesize a long return expression so that a smart editor will properly
 indent it.
 
-{{ RT#45365: Modify parrot.el so this rule is no longer required. }}
-
 =item *
 
 When assigning inside a conditional, use extra parentheses,
@@ -328,7 +326,7 @@
 
 Avoid dependency on "FIXME" and "TODO" labels: use the external bug tracking
 system.  If a bug must be fixed soon, use "XXX" B<and> put a ticket in the
-bug tracking system.  This means that each "XXX" should have an RT ticket
+bug tracking system.  This means that each "XXX" should have a Trac ticket
 number next to it.
 
 =back

Modified: branches/orderedhash_revamp/docs/pdds/pdd09_gc.pod
==============================================================================
--- branches/orderedhash_revamp/docs/pdds/pdd09_gc.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/pdds/pdd09_gc.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2008, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
 =head1 PDD 9: Garbage Collection Subsystem
@@ -49,18 +49,6 @@
 In this GC scheme, after all reachable objects are marked as live, a sweep
 through the object arenas collects all unmarked objects.
 
-=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
-(out of memory), the black objects are all changed to white, and a marking
-process runs to mark all reachable objects as live. Any unreachable objects
-are left white, and available for allocation.
-
-In some implementations, the change from black to white is made by simply
-changing the interpretation of the mark bit, for example, from 1 == black to 1
-== white.
-
 =head3 Copying collection
 
 In this scheme, live objects are copied into a new memory region. The entire
@@ -162,11 +150,11 @@
 =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
-"sweep" phase). The sweep phase is also known as the collection phase. The
-trace phase is also known as the "mark phase" and less frequently as the
-"dead object detection" phase. The use of the term "dead object detection"
-and its acronym DOD has been deprecated.
+dead (the "trace" or "mark" phase) and freeing dead objects for later reuse
+(the "sweep" phase). The sweep phase is also known as the collection phase.
+The trace phase is less frequently known as the "dead object detection" phase.
+The use of the term "dead object detection" and its acronym DOD has been
+deprecated.
 
 =head3 Initial Marking
 
@@ -291,42 +279,44 @@
 resources.  The arena structures and arena creation routines are common across
 most GC cores, and some GC cores also share mark routines.
 
-The main interpreter structure has an arena_base member, which is a pointer to
-an Arenas struct.
+The main interpreter structure has an mem_pools member, which is a pointer to
+an Memory_Pools struct.
 
-=head4 The Arenas structure
+=head4 The Memory_Pools 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,
-constant_string_pool), and six are Small_Object_Pool structures (pmc_pool,
-pmc_ext_pool, constant_pmc_pool, buffer_header_pool,
-constant_string_header_pool).
+The C<Memory_Pools> structure contains pointers to a variety of memory pools,
+each used for a specific purpose. Two are Var_Size_Pool pointers (memory_pool,
+constant_string_pool), and six are Fixed_Size_Pool structures (pmc_pool,
+constant_pmc_pool, constant_string_header_pool).
 
-The Arenas structure holds function pointers for the core defined interface of
-the currently active GC subsystem: C<init_pool>, C<do_gc_mark>,
+The C<Memory_Pools> structure holds function pointers for the core defined
+interface of the currently active GC subsystem: C<init_pool>, C<do_gc_mark>,
 C<finalize_gc_system>. It holds various accounting information for the GC
 subsystem, including how many GC runs have been completed, amount of memory
 allocated since the last run, and total memory allocated. This accounting
 information is updated by the GC system. The current block level for GC mark
-and sweep phases is stored in the Arenas structure. (See L<Blocking GC>.)
+and sweep phases is stored in the C<Memory_Pools> structure. 
+(See L<Blocking GC>.)
 
 The pointer C<void *gc_private> is reserved for use by the currently active GC
 subsystem (with freedom for variation between GC implementations).
 
-=head4 The Memory_Pool structure
+=head4 The Var_Size_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.
-
-=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
-list of free objects, and for the generational GC implementation maintains
-linked lists of white, black, and gray PMCs. It contains a pointer to a simple
-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.
+The C<Var_Size_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.
+
+=head4 The Fixed_Size_Pool structure
+
+The C<Fixed_Size_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 list of free objects, and for the generational GC 
+implementation maintains linked lists of white, black, and gray PMCs. It 
+contains a pointer to a simple C<Var_Size_Pool> (the base storage of the 
+pool). It holds function pointers for adding and retrieving free objects in
+the pool, and for allocating objects.
 
 =head3 Internal API
 
@@ -344,7 +334,7 @@
 
 Each GC core declares an initialization routine as a function pointer,
 which is installed in F<src/memory.c:mem_setup_allocator()> after
-creating C<arena_base> in the interpreter struct.
+creating C<mem_pools> in the interpreter struct.
 
 =over 4
 
@@ -353,22 +343,23 @@
 A routine to initialize the GC system named C<XXX>.
 
 The initialization code is responsible for the creation of the header pools
-and fills the function pointer slots in the interpreter's C<arena_base>
+and fills the function pointer slots in the interpreter's C<mem_pools>
 member.
 
 =back
 
-=head4 Arenas structure function pointers
+=head4 Memory_Pools structure function pointers
 
-Each GC system declares 3 function pointers, stored in the Arenas structure.
+Each GC system declares 3 function pointers, stored in the Memory_Pools 
+structure.
 
 =over 4
 
 =item C<void (*init_gc_system) (Interp *)>
 
 Initialize the GC system. Install the additional function pointers into
-the Arenas structure, and prepare any private storage to be used by
-the GC in the Arenas->gc_private field.
+the Memory_Pools structure, and prepare any private storage to be used by
+the GC in the Memory_Pools->gc_private field.
 
 =item C<void (*do_gc_mark) (Interp *, int flags)>
 
@@ -433,23 +424,23 @@
 All PMCs must be swept, and PMCs with custom destroy VTABLE methods must have
 those called.
 
-=item C<void (*init_pool) (Interp *, Small_Object_Pool *)>
+=item C<void (*init_pool) (Interp *, Fixed_Size_Pool *)>
 
-Initialize the given pool. Populates the C<Small_Object_Pool> structure with
+Initialize the given pool. Populates the C<Fixed_Size_Pool> structure with
 initial values, and sets a series of function pointers for working with the
 pool. The function pointers used with the pool are discussed next.
 
 =back
 
-=head4 Small_Object_Pool function pointers
+=head4 Fixed_Size_Pool function pointers
 
-Each GC core defines 4 function pointers stored in the C<Small_Object_Pool>
+Each GC core defines 4 function pointers stored in the C<Fixed_Size_Pool>
 structures. These function pointers are used throughout Parrot to implement
 basic behaviors for the pool.
 
 =over 4
 
-=item C<PObj * (*get_free_object) (Interp *, Small_Object_Pool*)>
+=item C<PObj * (*get_free_object) (Interp *, Fixed_Size_Pool*)>
 
 Get a free object from the pool. This function returns one free object from
 the given pool and removes that object from the pool's free list. PObject
@@ -457,20 +448,20 @@
 itself, if any. If the pool is a buffer header pool all other object memory
 is zeroed.
 
-=item C<void (*add_free_object) (Interp *, Small_Object_Pool *, PObj *);>
+=item C<void (*add_free_object) (Interp *, Fixed_Size_Pool *, PObj *);>
 
 Add a freed object to the pool's free list. This function is most often called
 internally to the GC itself to add items to the free list after a sweep, or
 when a new arena is created to add the new items to the free list. It does
 not need to be used in this way, however.
 
-=item C<void (*alloc_objects) (Interp *, Small_Object_Pool *);>
+=item C<void (*alloc_objects) (Interp *, Fixed_Size_Pool *);>
 
 Allocate a new arena of objects for the pool. Initialize the new arena and add
 all new objects to the pool's free list. Some collectors implement a growth
 factor which increases the size of each new allocated arena.
 
-=item C<void (*more_objects) (Interp *, Small_Object_Pool *);>
+=item C<void (*more_objects) (Interp *, Fixed_Size_Pool *);>
 
 Reallocation for additional objects. It has the same signature as
 C<alloc_objects>, and in some GC cores the same function pointer is used for
@@ -561,7 +552,7 @@
 
 =over 4
 
-=item PObj_active_destroy_FLAG
+=item PObj_custom_destroy_FLAG
 
 The PMC has some sort of active destructor, and will have that destructor
 called when the PMC is destroyed. The destructor is typically called from
@@ -621,6 +612,9 @@
 
 =head2 References
 
+"Uniprocessor Garbage Collection Techniques"
+http://www.cs.rice.edu/~javaplt/311/Readings/wilson92uniprocessor.pdf
+
 "A unified theory of garbage collection":
 http://portal.acm.org/citation.cfm?id=1028982
 

Modified: branches/orderedhash_revamp/docs/pdds/pdd13_bytecode.pod
==============================================================================
--- branches/orderedhash_revamp/docs/pdds/pdd13_bytecode.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/pdds/pdd13_bytecode.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2005, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
 =head1 PDD 13: Bytecode
@@ -11,95 +11,32 @@
 =head2 Version
 
 $Revision$
- 
+
 =head2 Synopsis
- 
+
 Parrot bytecode is a binary representation of instructions and data for
 execution on the virtual machine.
 
 =head2 Description
 
-=over 4
+PBC, Parrot bytecode, is the binary format used internally by the Parrot VM to
+store the data necessary to execute a compiled PIR program.  The sequence of
+instructions making up a Parrot program, a constants table, an annotations
+table and any ancillary data are stored in a PBC.  These files usually have
+the extension C<.pbc>.
+
+The PBC format is designed so that any valid PBC file can be read and executed
+by Parrot on any platform, but may be encoded more optimally for a particular
+platform.
 
-=item - The sequence of instructions making up a Parrot program, a constants
-table and debug data are all stored in a binary format called a packfile or
-PBC (Parrot Bytecode file).
-
-=item - A PBC file can be read by Parrot on any platform, but may be encoded
-more optimally for a particular platform.
-
-=item - It is possible to add arbitrary annotations to the instruction
-sequence, for example line numbers in the high level language and other debug
-data.
-
-=item - PMCs will be used to represent packfiles and packfile segments to
-provide a programming interface to them, both from Parrot programs and the
-Parrot internals.
-
-=back
+It is possible to add arbitrary annotations to the instruction sequence, for
+example line numbers in high level languages and other debug data.
 
+PMCs are be used to represent packfiles and packfile segments to provide a
+programmatic interface, both to Parrot programs and Parrot internals.
 
 =head2 Implementation
 
-=head3 Changes
-
-A number of things in this PDD differ from the older implementation,
-and few items with the more convenient PMC access are not yet implemented.
-This section details these changes from the old implementation
-and some of the reasoning behind them.
-
-
-=head4 Packfile Header
-
-The format of the packfile header has changed completely, based upon a
-proposal at
-L<http://groups.google.com/group/perl.perl6.internals/browse_thread/thread/1f1af615edec7449/ebfdbb5180a9d813?lnk=gst>
-and the requirement to have a UUID. The old INT field in the previous header
-format is used nowhere in Parrot and was removed, the parrot patch version
-number along with the major and minor was added. The opcode type is also gone
-due to non-use. The opcode type is always long.
-
-The version number now reflects the earliest version of Parrot that is capable
-of running the bytecode file, to enable cross-version compatibility that will
-be needed in the future.
-
-
-=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
-removed the id (did not seem to be used anywhere) and the second size (always
-computable by knowing the size of this header, so it appears redundant).
-
-
-=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.
-
-
-=head4 Annotations Segment
-
-This is new and replaces and builds upon the debug segment. See here for some
-on-list discussion:
-
-L<http://groups.google.com/group/perl.perl6.internals/browse_thread/thread/b0d36dafb42d96c4/4d6ad2ad2243e677?lnk=gst&rnum=2#4d6ad2ad2243e677>
-
-
-=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
-Parrot programs.
-
-Here are mailing list comments that provide one of the motivations or hints
-of the original proposal.
-
-L<http://groups.google.com/group/perl.perl6.internals/browse_thread/thread/778ea0ac4c8676f7/b249306b543b040a?lnk=gst&q=packfile+PMCs&rnum=2#b249306b543b040a>
-
-
-
 =head3 Packfiles
 
 This section of the documentation describes the format of Parrot packfiles.
@@ -308,7 +245,6 @@
   | Offset | Length | Description                                            |
   +--------+--------+--------------------------------------------------------+
   | 1      | 1      | The number of entries in the directory.                |
-  |        |        |    n                                                   |
   +--------+--------+--------------------------------------------------------+
 
 Following this are C<n> variable length entries formatted as described in the
@@ -326,8 +262,6 @@
   |        |        |    0x04 - Bytecode Segment                             |
   |        |        |    0x05 - PIR Debug Segment                            |
   |        |        |    0x06 - Annotations Segment                          |
-  |        |        |    0x07 - PIC Data Segment                             |
-  |        |        |    0x08 - Dependencies Segment                         |
   +--------+--------+--------------------------------------------------------+
   | 1      | n      | The name of the segment, as a (NULL terminated) ASCII  |
   |        |        | C string. This must be padded with trailing NULL       |
@@ -367,19 +301,13 @@
   +--------+--------+--------------------------------------------------------+
   | Offset | Length | Description                                            |
   +--------+--------+--------------------------------------------------------+
-  | 0      | 1      | A valid Parrot operation code, as specified in the     |
-  |        |        | operation codes list.                                  |
+  | 0      | 1      | A valid Parrot opcode, as specified in the opcode      |
+  |        |        | list include/parrot/oplib/ops.h.                       |
   +--------+--------+--------------------------------------------------------+
 
-Zero or more operands follow the opcode. Most instructions take a
-fixed number of operands but several of them take a variable number, with the
-first operand being used to determine the number of additional operands that
-follow. This tends to be stored as a PMC constant, meaning that decoding the
-instruction stream not only requires knowledge of the operands that each
-instruction takes but also the ability to thaw PMCs.
-
-An individual operand is always one word in length and may be of one of the
-following forms.
+Zero or more operands follow the opcode. All opcodes take a fixed number of
+operands.  An individual operand is always one word in length and may be of
+one of the following forms.
 
   +------------------+-------------------------------------------------------+
   | Operand Type     | Description                                           |
@@ -410,7 +338,6 @@
   | Offset | Length | Description                                            |
   +--------+--------+--------------------------------------------------------+
   | 2      | 1      | The number of constants in the table.                  |
-  |        |        |    n                                                   |
   +--------+--------+--------------------------------------------------------+
 
 Following this are C<n> constants, each with a single word header specifying
@@ -449,23 +376,25 @@
   +--------+--------+--------------------------------------------------------+
   | 2      | 1      | Character set; either the index of a built-in one or a |
   |        |        | dynamically loaded one whose index is in a range given |
-  |        |        | in the dependencies table.                             |
+  |        |        | in the dependencies table. Note that dynamically       |
+  |        |        | loaded character sets are not currently supported.     |
   +--------+--------+--------------------------------------------------------+
   | 3      | 1      | Encoding, either the index of a built-in one or a      |
   |        |        | dynamically loaded one whose index is in a range given |
-  |        |        | in the dependencies table.                             |
+  |        |        | in the dependencies table. Note that dynamically       |
+  |        |        | loaded encodings are not currently supported.          |
   +--------+--------+--------------------------------------------------------+
   | 4      | 1      | Length of the string data in bytes.                    |
   +--------+--------+--------------------------------------------------------+
   | 5      | n      | String data with trailing zero padding as required.    |
   +--------+--------+--------------------------------------------------------+
 
-Note: the Encoding field is not implemented yet.
+Note: The encoding field is not implemented yet and is set to 0.
 
 =item * 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
+vtable functions. Their frozen data is placed in a string, stored in the same
 format as a string constant.
 
 =item * Key Constants
@@ -478,7 +407,6 @@
   | Offset | Length | Description                                            |
   +--------+--------+--------------------------------------------------------+
   | 1      | 1      | Number of key components that follow.                  |
-  |        |        |    n                                                   |
   +--------+--------+--------------------------------------------------------+
 
 Following this are C<n> entries of two words each that specify the key's
@@ -502,8 +430,6 @@
   | 1      | 1      | Value of the key.                                      |
   +--------+--------+--------------------------------------------------------+
 
-{{ TODO: Figure out slice bits and document them here. }}
-
 =back
 
 =head4 Fixup Segment
@@ -513,8 +439,6 @@
 The number of fixup table entries, n, is given by the last field of the
 segment header.
 
-{{ TODO: I think label fixups are no longer used. Check if that is so. }}
-
 This is followed by n fixup table entries, of variable length, that take the
 following form.
 
@@ -531,7 +455,7 @@
   |        |        | length with zeroes in the 02.                          |
   +--------+--------+--------------------------------------------------------+
   | -      | 1      | This is an index into the constants table for the sub  |
-  |        |        |  PMC corresponding to the label.                       |
+  |        |        | PMC corresponding to the label.                        |
   +--------+--------+--------------------------------------------------------+
 
 
@@ -551,10 +475,10 @@
 
 =back
 
-The length of the table of line numbers mapping is given by the last field
+The length of the table of line number mappings is given by the last field
 of the segment header.
 
-Then come the table:
+Then comes the table:
 
   +--------+--------+--------------------------------------------------------+
   | Offset | Length | Description                                            |
@@ -562,7 +486,7 @@
   | 0      | 1      | Line number for the offset in the bytecode.            |
   +--------+--------+--------------------------------------------------------+
 
-Then come an opcode with n, the number of file mappings.
+Then comes an opcode with n, the number of file mappings.
 
 Then come n mappings.
 
@@ -636,7 +560,6 @@
   | Offset | Length | Description                                            |
   +--------+--------+--------------------------------------------------------+
   | 1      | 1      | Number of annotation group entries that follow.        |
-  |        |        |    n                                                   |
   +--------+--------+--------------------------------------------------------+
 
 A group entry maps an offset in the bytecode segment to an offset in the list
@@ -694,63 +617,6 @@
 required. Note that this also implies that annotations must be placed in
 the same order as the instructions.
 
-
-=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:
-
-=over 4
-
-=item - Dynamic PMC libraries (.loadlib)
-
-=item - Dynamic opcode libraries (.loadlib)
-
-=item - Dynamically loaded string encoding
-
-=item - Dynamically loaded character set
-
-=back
-
-The segment starts with the number of entries in the table.
-
-  +--------+--------+--------------------------------------------------------+
-  | Offset | Length | Description                                            |
-  +--------+--------+--------------------------------------------------------+
-  | 1      | 1      | Number of entries in the dependencies table.           |
-  |        |        |    n                                                   |
-  +--------+--------+--------------------------------------------------------+
-
-Following this are C<n> entries of variable length, taking the following
-format:
-
-  +--------+--------+--------------------------------------------------------+
-  | Offset | Length | Description                                            |
-  +--------+--------+--------------------------------------------------------+
-  | 0      | 1      | Number of entries in the dependencies table.           |
-  |        |        |    0x00 - Dynamic PMC Library                          |
-  |        |        |    0x01 - Dynamic Opcode Library                       |
-  |        |        |    0x02 - Dynamically Loaded String Encoding           |
-  |        |        |    0x03 - Dynamically Loaded Character Set             |
-  +--------+--------+--------------------------------------------------------+
-  | 1      | n      | A hint for finding and loading the resource; usually   |
-  |        |        | the name of the dynamic library, but possibly a full   |
-  |        |        | path too. Given as an ASCII NULL-terminated string,    |
-  |        |        | zero-padded to a full word.                            |
-  +--------+--------+--------------------------------------------------------+
-  | n + 1  | 1      | The lowest index for the given type of resource that   |
-  |        |        | is contained in this dependency. For example, if this  |
-  |        |        | entry was for a dynamic opcode library containing ops  |
-  |        |        | numbered 5000 through 5042, this entry would be 5000.  |
-  +--------+--------+--------------------------------------------------------+
-  | n + 2  | 1      | The highest index for the given type of resource that  |
-  |        |        | is contained in this dependency. For example, if this  |
-  |        |        | entry was for a dynamic opcode library containing ops  |
-  |        |        | numbered 5000 through 5042, this entry would be 5042.  |
-  +--------+--------+--------------------------------------------------------+
-
-
-
 =head3 Packfile PMCs
 
 A packfile can be represented in memory by Parrot as a tree of PMCs. These
@@ -764,23 +630,24 @@
 =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.
+when reading a packfile. It implements the following methods and vtable
+functions.
 
 =over 4
 
-=item * C<get_string> (v-table)
+=item * C<get_string> (vtable)
 
 Serializes this packfile data structure into a bytestream ready to be written
 to disk (that is, maps from PMCs to on-disk representation).
 
-=item * C<set_string_native> (v-table)
+=item * C<set_string_native> (vtable)
 
 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).
 
-=item * C<get_integer_keyed_str> (v-table)
+=item * C<get_integer_keyed_str> (vtable)
 
 Used to get data about fields in the header that have an integer value. Valid
 keys are:
@@ -807,7 +674,7 @@
 
 =back
 
-=item * C<get_string_keyed_str> (v-table)
+=item * C<get_string_keyed_str> (vtable)
 
 Used to get data about fields in the header that have a string value. Valid
 keys are:
@@ -818,7 +685,7 @@
 
 =back
 
-=item * C<set_integer_keyed_str> (v-table)
+=item * C<set_integer_keyed_str> (vtable)
 
 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
@@ -842,7 +709,7 @@
 Setting the uuid_type will not result in immediate re-computation of the
 UUID, but rather will only cause it to be computed using the selected
 algorithm when the packfile is serialized (by calling the C<get_string>
-v-table method). Setting an invalid uuid_type value will cause an exception
+vtable function). Setting an invalid uuid_type value will cause an exception
 to be thrown immediately.
 
 =item * C<get_directory()>
@@ -880,29 +747,29 @@
 
 =over 4
 
-=item * C<elements> (v-table)
+=item * C<elements> (vtable)
 
 Gets the number of segments listed in the directory.
 
-=item * C<get_pmc_keyed_str> (v-table)
+=item * C<get_pmc_keyed_str> (vtable)
 
 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.
 
-=item * C<set_pmc_keyed_str> (v-table)
+=item * C<set_pmc_keyed_str> (vtable)
 
 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.
 
-=item * C<delete_keyed_str> (v-table)
+=item * C<delete_keyed_str> (vtable)
 
 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.
 
-=item * C<get_iter> (v-table)
+=item * C<get_iter> (vtable)
 
 Returns iterator for existing keys.
 
@@ -928,18 +795,18 @@
 
 Returns iterator for Segment.
 
-=item * C<get_integer_keyed_int> (v-table)
+=item * C<get_integer_keyed_int> (vtable)
 
 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.
 
-=item * C<set_integer_keyed_int> (v-table)
+=item * C<set_integer_keyed_int> (vtable)
 
 Stores an integer at the specified offset into the segment. Will throw an
 exception if the segment is memory mapped.
 
-=item * C<elements> (v-table)
+=item * C<elements> (vtable)
 
 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
@@ -964,43 +831,43 @@
 
 Returns iterator for stored Constants.
 
-=item * C<elements> (v-table)
+=item * C<elements> (vtable)
 
 Gets the number of constants contained in the table.
 
-=item * C<get_number_keyed_int> (v-table)
+=item * C<get_number_keyed_int> (vtable)
 
 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.
 
-=item * C<get_string_keyed_int> (v-table)
+=item * C<get_string_keyed_int> (vtable)
 
 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.
 
-=item * C<get_pmc_keyed_int> (v-table)
+=item * C<get_pmc_keyed_int> (vtable)
 
 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.
 
-=item * C<set_number_keyed_int> (v-table)
+=item * C<set_number_keyed_int> (vtable)
 
 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.
 
-=item * C<set_string_keyed_int> (v-table)
+=item * C<set_string_keyed_int> (vtable)
 
 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.
 
-=item * C<set_pmc_keyed_int> (v-table)
+=item * C<set_pmc_keyed_int> (vtable)
 
 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
@@ -1036,20 +903,20 @@
 
 =over 4
 
-=item * C<get_iter>
+=item * C<get_iter> (vtable)
 
 Returns iterator for stored fixup entries.
 
-=item * C<elements> (v-table)
+=item * C<elements> (vtable)
 
 Gets the number of entries in the fixup table.
 
-=item * C<get_pmc_keyed_int> (v-table)
+=item * C<get_pmc_keyed_int> (vtable)
 
 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.
 
-=item * C<set_pmc_keyed_int> (v-table)
+=item * C<set_pmc_keyed_int> (vtable)
 
 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,
@@ -1064,19 +931,19 @@
 
 =over 4
 
-=item * C<get_string> (v-table)
+=item * C<get_string> (vtable)
 
 Gets the label field of the fixup entry.
 
-=item * C<set_string_native> (v-table)
+=item * C<set_string_native> (vtable)
 
 Sets the label field of the fixup entry.
 
-=item * C<get_integer> (v-table)
+=item * C<get_integer> (vtable)
 
 Gets the offset field of the fixup entry.
 
-=item * C<set_integer_native> (v-table)
+=item * C<set_integer_native> (vtable)
 
 Sets the offset field of the fixup entry.
 
@@ -1099,21 +966,21 @@
 
 =over 4
 
-=item * C<elements> (v-table)
+=item * C<elements> (vtable)
 
 Gets the number of annotations in the table.
 
-=item * C<get_iter> (v-table)
+=item * C<get_iter> (vtable)
 
 Get iterator for stored annotations.
 
-=item * C<get_pmc_keyed_int> (v-table)
+=item * C<get_pmc_keyed_int> (vtable)
 
 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.
 
-=item * C<set_pmc_keyed_int> (v-table)
+=item * C<set_pmc_keyed_int> (vtable)
 
 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
@@ -1156,29 +1023,29 @@
 
 Sets the name of the annotation.
 
-=item * C<get_integer> (v-table)
+=item * C<get_integer> (vtable)
 
-Gets the integer value of the annotation. 
+Gets the integer value of the annotation.
 
-=item * C<set_integer> (v-table)
+=item * C<set_integer> (vtable)
 
-Sets the integer value of the annotation. 
+Sets the integer value of the annotation.
 
-=item * C<get_string> (v-table)
+=item * C<get_string> (vtable)
 
-Gets the string value of the annotation. 
+Gets the string value of the annotation.
 
-=item * C<set_string> (v-table)
+=item * C<set_string> (vtable)
 
-Sets the string value of the annotation. 
+Sets the string value of the annotation.
 
-=item * C<get_number> (v-table)
+=item * C<get_number> (vtable)
 
-Gets the number value of the annotation. 
+Gets the number value of the annotation.
 
-=item * C<set_number> (v-table)
+=item * C<set_number> (vtable)
 
-Sets the number value of the annotation. 
+Sets the number value of the annotation.
 
 =back
 
@@ -1192,7 +1059,61 @@
 
 =head2 Footnotes
 
-None.
+=head3 Changes From Previous Versions
+
+A number of things in this PDD differ from the older implementation,
+and few items with the more convenient PMC access are not yet implemented.
+This section details these changes from the old implementation
+and some of the reasoning behind them.
+
+=head4 Packfile Header
+
+The format of the packfile header changed completely, based upon a
+proposal at
+L<http://groups.google.com/group/perl.perl6.internals/browse_thread/thread/1f1af615edec7449/ebfdbb5180a9d813?lnk=gst>
+and the requirement to have a UUID. The old INT field in the previous header
+format is used nowhere in Parrot and was removed, the parrot patch version
+number along with the major and minor was added. The opcode type is also gone
+due to non-use. The opcode type is always long.
+
+The version number now reflects the earliest version of Parrot that is capable
+of running the bytecode file, to enable cross-version compatibility that will
+be needed in the future.
+
+
+=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
+removed the id (did not seem to be used anywhere) and the second size (always
+computable by knowing the size of this header, so it appears redundant).
+
+
+=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.
+
+
+=head4 Annotations Segment
+
+This is new and replaces and builds upon the debug segment. See here for some
+on-list discussion:
+
+L<http://groups.google.com/group/perl.perl6.internals/browse_thread/thread/b0d36dafb42d96c4/4d6ad2ad2243e677?lnk=gst&rnum=2#4d6ad2ad2243e677>
+
+
+=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
+Parrot programs.
+
+Here are mailing list comments that provide one of the motivations or hints
+of the original proposal.
+
+L<http://groups.google.com/group/perl.perl6.internals/browse_thread/thread/778ea0ac4c8676f7/b249306b543b040a?lnk=gst&q=packfile+PMCs&rnum=2#b249306b543b040a>
 
 =head2 References
 

Modified: branches/orderedhash_revamp/docs/pdds/pdd15_objects.pod
==============================================================================
--- branches/orderedhash_revamp/docs/pdds/pdd15_objects.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/pdds/pdd15_objects.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -31,9 +31,8 @@
 Attributes are set on a class-wide basis, and all the objects of a class
 will have the same set of attributes.  Most OO languages don't allow
 attribute changes to existing classes, but Parrot's base attribute
-system does allow it. In order to safely support advanced dynamic
-features in HLLs, attributes are not accessible via fixed attribute
-offsets, but only via named lookup.
+system does allow it (only before the first object is instantiated from
+the class).
 
 =head3 Method
 
@@ -103,8 +102,12 @@
 =item - Classes are instances of a meta-class and have their own sets of
 class methods and class attributes
 
-=item - Objects may have an array of attributes. Attribute values may be
-PMCs or a low-level type.
+=item - Classes can be subclassed
+
+=item - High-level classes can subclass low-level PMCs
+
+=item - Objects have a collection (0 or more) of attributes. Attribute
+values may be PMCs or a low-level type.
 
 =item - Objects have an associated class.
 
@@ -121,20 +124,15 @@
 
 =item - Objects can set an attribute by name
 
-=item - Objects can be subclassed (note that objects may not necessarily
-be able to have their classes changed arbitrarily, but making a subclass
-and moving the object to it is allowable)
-
-=item - High-level objects can subclass low-level PMCs
-
 =back
 
 =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,
-the specific vtable functions used to perform those objecty things, and the
-supporting code provided by the interpreter engine to do the heavy lifting.
+specific vtable functions used to perform some of those objecty things, and
+the supporting code provided by the interpreter engine to do the heavy
+lifting.
 
 Parrot, in general, doesn't restrict operations on objects and classes. If a
 language has restrictions on what can be done with them, the language is
@@ -149,58 +147,60 @@
 =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
-new Class PMC, and enters the new OO class into Parrot's PMC class
-table, at which point it is indistinguishable from any other PMC class.
+the class-specific information. Instantiating a new high-level class
+creates a new Class PMC, and enters the new high-level class into
+Parrot's PMC class table, at which point it is indistinguishable from
+any other PMC class.
 
 It's important to note that 'standard' classes are Class PMC instances,
 or instances of a subclass of the Class PMC, and 'standard' objects are
 Object PMCs. It isn't necessary to create a brand new low-level PMC
-class for each OO class, and they all share the Class or Object vtable,
-respectively.
+class for each high-level class, and they all share the Class PMC
+vtable functions.
 
-An instance of the Class PMC has eleven internal attributes, which are:
+An instance of the Class PMC has eleven core internal attributes, which
+are:
 
 =over 4
 
-=item 0
+=item 1
 
 The class name
 
-=item 1
+=item 2
 
 A link to the class's associated namespace
 
-=item 2
+=item 3
 
 A "have I been instantiated since I was last modified" flag
 
-=item 3
+=item 4
 
 An array PMC of the immediate parent classes
 
-=item 4
+=item 5
 
 A cached array of all parent PMCs, in search order (this is an optional
 optimization, and can be calculated from the class's rules of inheritance,
 the list of immediate parent classes, and the parent classes' rules of
 inheritance)
 
-=item 5
+=item 6
 
 An array PMC of the composed roles (these are Role PMCs, not string names of
 roles).
 
-=item 6
+=item 7
 
 A hash PMC of the methods defined in the class or composed into the
 class
 
-=item 7
+=item 8
 
 A hash PMC of the overloaded PMC vtable entries for the class.
 
-=item 8
+=item 9
 
 The class attribute metadata hash. Keys are the attribute names and the
 values are a hash of attribute characteristics, including name, type, the
@@ -208,7 +208,7 @@
 that this only stores metadata for the attributes defined in this class,
 and not for attributes inherited from its parents.
 
-=item 9
+=item 10
 
 The full attribute lookup table. This associates attribute names with an
 index into the object's attribute storage (an array). It includes all
@@ -218,7 +218,7 @@
 attribute name. The value is an index into the per-object attribute
 store.
 
-=item 10
+=item 11
 
 The attribute cache. While the attribute lookup table defines every
 attribute, whether it is visible or not with the current method
@@ -243,46 +243,23 @@
 child class attributes override which parent class attributes.  The
 cache is only set on individual accesses to a particular attribute.
 
-(If a parent class changes its set of attributes, should that change
-appear in later instantiations of objects from child classes? If so, all
-of these classes would need to be re-constructed as a result of the
-change; note that any already instantiated objects would refer to the
-old class. NOTE: flag old classes with an "updated" status, to notify
-objects of the old class that they should rebless themselves into the
-new class next time they access the old class?)
-
 Class PMCs also have the "I am a class" flag set on them.
 
 =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.
-However, the old class object must be kept, as the old objects still
-point to it and do their method resolution and attribute lookup through
-that class object.
-
-If a class hasn't been instantiated, adding a method or attribute only
-modifies the existing class object instead of creating a new class
-object. Extending a class that has been instantiated only causes the
-creation of a new class object the first time it's extended.  After
-that, methods and attributes added to it will only modify the existing
-class object until it is instantiated again.
-
-The Namespace always points to the most current incarnation of the
-class. All the class objects that belong to a particular namespace store
-a pointer to that Namespace object. They keep that pointer even if the
-Namespace object no longer stores a pointer to them.
-
-Since any given class name may have multiple corresponding class
-objects, the class registry has a much diminished role in this
-implementation. Its only responsibility is maintaining a mapping of
-unique IDs to class objects throughout the system.  It can't be used for
-looking up classes by name, because it's possible to have multiple
-classes with the same name in the same namespace. The class registry may
-need to have names removed (since it doesn't care about names anymore).
-Low-level PMC types will also need entries in the namespace hierarchy.
-We may eventually be able to eliminate the registry of class IDs
-altogether.
+If a class hasn't been instantiated, adding a method or attribute
+modifies the existing class object. Extending a class that has been
+instantiated is not allowed.
+
+The class registry has a much diminished role in this implementation.
+Its only responsibility is maintaining a mapping of unique IDs to class
+objects throughout the system. It should not be used for looking up
+classes by name.
+
+The class registry may need to have names removed (since it doesn't care
+about names anymore). We plan to eventually eliminate the registry of
+class IDs altogether. Low-level PMC types also have entries in the
+namespace hierarchy via PMCProxy objects. 
 
 A class can be garbage collected when it has no instantiated objects
 and no Namespace object referencing it (to mark it as live). When a
@@ -334,15 +311,7 @@
 Returns the PMC for the named method. If no method of this name exists, nor
 can be constructed, returns a Null PMC.
 
-Note that for languages which support default fallback methods, such as Perl
-5's AUTOLOAD, this would be the place to return it if a normal lookup fails.
-
-Since the method list and vtable override list are stored in the class
-PMC, method finding is a lookup on the class object and not a lookup in
-the namespace. (This could be handled automatically whenever a class is
-associated with a namespace.) Just adding a sub to a namespace will not
-automatically make it a method of the class, you have to call add_method
-too.
+A class object reports on class methods, not on instance methods.
 
 =item isa(pmc *)
 
@@ -358,19 +327,19 @@
 =item can(string *)
 
 Returns true or false if the class can perform the requested method.
-(Including with an AUTOLOAD)
+(Class systems that implement default fallback methods should report
+that they 'can' perform any method.)
 
-A class object only reports on class methods, it does not report on instance
-methods.
+A class object reports on class methods, not on instance methods.
 
 =item does(class *)
 
 Returns true or false to note whether the class in question implements the
 interface passed in.
 
-A class object only reports on interfaces of the class (i.e. roles composed
-into the metaclass), while an instance object only reports on interfaces of
-the instance (i.e. roles composed into the class).
+A class object only reports on interfaces of the class (i.e. roles
+composed into the metaclass), it doesn't report on which interfaces will
+be added to an instance of that class.
 
 =item inspect()
 
@@ -399,20 +368,14 @@
 
 Remove a parent from the class.
 
-=item remove_role(string *)
-
-Remove a role from the class.
-
 =back
 
-Currently Parrot only supports mutating a class' metainformation for
-Class classes. This is a restriction which will be lifted at some point
-soon.
+Parrot only supports mutating class metainformation for Class classes.
+This restriction may be lifted at some point.
 
 =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.
+These methods are just syntactic sugar for the vtable functions.
 
 =over 4
 
@@ -429,11 +392,11 @@
 the class, and also sets the association with a namespace. With no
 argument it only returns the current value of the name attribute.
 
-=item namespace
+=item get_namespace
 
 =begin PIR_FRAGMENT
 
-    $P1 = $P2.'namespace'()
+    $P1 = $P2.'get_namespace'()
 
 =end PIR_FRAGMENT
 
@@ -462,13 +425,12 @@
 =end PIR_FRAGMENT
 
 Adds a single attribute to the class. It takes a simple string name and,
-optionally, a simple string value or key specifying a type name. (A type
-name just checks C<does>, and doesn't necessarily correspond to a class or
-role namespace.)
+optionally, a simple string value or key specifying a type name. (Types
+are not currently checked by Parrot, and only provided for
+introspection.)
 
-If the class has already been instantiated, adding a new attribute triggers
-the creation of a new class, replacing the old class. See L<Classes,
-Namespaces, and the Class Registry>.
+If the class has already been instantiated, adding a new attribute
+throws an exception.
 
 =item attributes
 
@@ -487,17 +449,11 @@
 =begin PIR_FRAGMENT
 
   $P1.'add_method'($S2, $P3)
-  $P1.'add_method'($S2, $P3, 'vtable' => 1)
 
 =end PIR_FRAGMENT
 
 Adds a method to the class. It takes a simple string name and a method
-PMC.  If the method already exists (and isn't a Multi) it will replace
-the method with the new method and throw a warning.
-
-It also takes named parameters to flag whether the method is a vtable
-override, and whether it is anonymous (no named entry as a method, only
-as a vtable).
+PMC. If the method already exists it will throw an exception.
 
 =item methods
 
@@ -512,6 +468,19 @@
 Note that the methods list includes any methods that were composed into
 the class from roles.
 
+=item add_vtable_override
+
+=begin PIR_FRAGMENT
+
+  $P1.'add_vtable_override'($S2, $P3)
+
+=end PIR_FRAGMENT
+
+Adds a vtable override to the class. It takes a simple string name and a
+sub/method PMC. If the vtable override already exists it will throw an
+exception (attempting to add the same sub/method object a second time
+will be silently ignored).
+
 =item add_parent
 
 =begin PIR_FRAGMENT
@@ -520,7 +489,8 @@
 
 =end PIR_FRAGMENT
 
-Adds a single parent to the class. It takes an instance of the Class PMC.
+Adds a single parent to the class. It takes a Class PMC argument (the
+parent to add).
 
 =item parents
 
@@ -530,7 +500,7 @@
 
 =end PIR_FRAGMENT
 
-An accessor for the parents of the class. It returns an Array of all
+An accessor for the parents of the class. It returns an array of all
 parents. The accessor is read-only.
 
 =item roles
@@ -541,7 +511,7 @@
 
 =end PIR_FRAGMENT
 
-An accessor for the roles of the class. It returns an Array of all
+An accessor for the roles of the class. It returns an array of all
 roles. The accessor is read-only.
 
 =item add_role
@@ -575,8 +545,7 @@
 =end PIR_FRAGMENT
 
 Returns true if the class name passed in as a parameter is in the inheritance
-hierarchy of the class (this is not the same as the inheritance hierarchy of
-objects instantiated from the class), false otherwise.
+hierarchy of the class, false otherwise.
 
 =item can
 
@@ -589,8 +558,6 @@
 Returns true if the class object can perform the requested method, false
 otherwise.
 
-A class object only reports on class methods, not on instance methods.
-
 =item does
 
 =begin PIR_FRAGMENT
@@ -624,22 +591,23 @@
 C<Object> PMCs are the actual objects, and hold all the per-object
 instance data.
 
-The Object PMC is an array of meta-information and attributes. The
-elements of this array are:
+An instance of the Object PMC has two core internal attributes, which
+are:
 
 =over 4
 
-=item 0
+=item 1
 
 The class PMC
 
-=item 1
+=item 2
 
-The object attribute store. This is simply an array of PMCs that
-provide the values for the attributes. It may be a resizable PMC array
-to provide lazy growth rather than allocating all needed memory for
-all attributes. We find the indexes into this array from the attribute
-cache or lookup table in the class.
+The object attribute store. This is simply an array of PMCs that provide
+the values for the attributes. It may be a resizable PMC array to
+provide lazy growth rather than allocating all needed memory for all
+attributes. The attribute cache and lookup table in the class store the
+indexes into this array, linking the attribute name and meta-information
+with the storage position. 
 
 =back
 
@@ -656,24 +624,6 @@
 information about the object, method call functionality, etc. See the
 sections below on L<Objects> and L<Vtables>.
 
-In addition to a value type, objects can have a container type. The
-container type can't be stored in the object itself, because a single
-object may live within multiple containers. So, the container type (when
-it exists) is stored in the LexPad or Namespace entry for a particular
-variable.
-
-In a static language like C#.Net:
-
-  B isa A
-  A o1 = new B();
-  B o2 = new B();
-
-  o1.x; # retrieves A's attribute
-  o2.x; # retrieves B's attribute
-
-  o1.foo(); # calls B's method
-  o2.foo(); # calls B's method
-
 =head4 Object Vtable Entries
 
 All Objects need the following vtable entries.
@@ -683,8 +633,18 @@
 =item find_method(string *)
 
 Returns the PMC for the named method. If no method of this name exists,
-nor can be constructed, returns a Null PMC. This only passes the method
-search on to the object's class.
+nor can be constructed, returns a Null PMC.
+
+Note that for languages which support default fallback methods (such as
+Perl 5's AUTOLOAD) this would be the place to return it if a normal
+lookup fails.
+
+Since the method list and vtable override list are stored in the class
+PMC, method finding is a lookup on the class object and not a lookup in
+the namespace. Just adding a sub to a namespace will not automatically
+make it a method of the class, you have to call add_method too.
+
+An instance object reports on instance methods, not on class methods.
 
 =item isa(class *)
 
@@ -694,7 +654,8 @@
 =item can(string *)
 
 Returns true or false if the object can perform the requested method.
-(Including with an AUTOLOAD)
+(Class systems that implement default fallback methods should report
+that they 'can' perform any method.)
 
 An instance object only reports on instance methods, not on class methods.
 
@@ -753,32 +714,32 @@
 
 =head3 Role PMC API
 
-An instance of the Role PMC has five attributes, which are:
+An instance of the Role PMC has five core attributes, which are:
 
 =over 4
 
-=item 0
+=item 1
 
 The role name
 
-=item 1
+=item 2
 
 A link to the role's associated namespace
 
-=item 2
+=item 3
 
 An array PMC of composed roles
 
-=item 3
+=item 4
 
 An array PMC of the methods defined in the role or composed into the
 role
 
-=item 4
+=item 5
 
-The role attribute hash. Keys are the attribute names and the values
-are a hash of attribute characteristics, including name, type, and the
-role they're associated with.
+The role attribute hash, where each key is an attribute name and the
+corresponding value is a hash of attribute characteristics, including
+name, type, and the role they're associated with.
 
 =back
 
@@ -809,10 +770,17 @@
 Returns the PMC for the named method. If no method of this name exists,
 nor can be constructed, returns a Null PMC.
 
+A role object reports on class methods (methods of the metarole), not on
+instance methods.
+
 =item can(string *)
 
 Returns true or false if the role can perform the requested method.
-(Including with an AUTOLOAD)
+(Class systems that implement default fallback methods should report
+that they 'can' perform any method.)
+
+A role object reports on class methods (methods of the metarole), not on
+instance methods.
 
 =item does(class *)
 
@@ -821,7 +789,7 @@
 
 A role object only reports on interfaces of the role (i.e. roles composed into
 the metarole), it doesn't report on which interfaces will be added to an
-object that composes the role.
+object instantiated from a class that composes the role.
 
 =item clone
 
@@ -846,17 +814,11 @@
 
 Remove a method from the role.
 
-
-=item remove_role(string *)
-
-Remove a role from the role.
-
 =back
 
 =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.
+These methods are just syntactic sugar for the vtable functions.
 
 =over 4
 
@@ -872,11 +834,11 @@
 the current value for name. When passed an argument, it sets the name of
 the role, and also sets the association with a namespace.
 
-=item namespace
+=item get_namespace
 
 =begin PIR_FRAGMENT
 
-    $P1 = $P2.'namespace'()
+    $P1 = $P2.'get_namespace'()
 
 =end PIR_FRAGMENT
 
@@ -940,17 +902,23 @@
 =begin PIR_FRAGMENT
 
   $P1.'add_method'($S2, $P3)
-  $P1.'add_method'($S2, $P3, 'vtable' => 1)
 
 =end PIR_FRAGMENT
 
 Adds a method to the role. It takes a simple string name and a method
-PMC. If the method already exists (and isn't a Multi) it will replace
-the method with the new method and throw a warning.
+PMC. If the method already exists it will throw an exception.
 
-It also takes slurpy named parameters to flag whether the method is a
-vtable override, and whether its anonymous (no named entry as a method,
-only as a vtable).
+=item add_vtable_override
+
+=begin PIR_FRAGMENT
+
+  $P1.'add_vtable_override'($S2, $P3)
+
+=end PIR_FRAGMENT
+
+Adds a vtable override to the role. It takes a simple string name and a
+sub/method PMC. If the vtable override already exists it will throw an
+exception.
 
 =item methods
 
@@ -989,9 +957,8 @@
 
 When declaring a composed class, you can optionally supply an array of
 method names that will be defined by the class to resolve a conflict in
-its roles.  This is done using the named parameter C<resolve>. This
-feature supports composition conflict resolution in languages such as
-Perl 6.
+its roles. This is done using the named parameter C<resolve>. This
+feature supports composition conflict resolution.
 
 When adding a role to a class, you can optionally supply an array of
 method names from the role to exclude from the composition process. This
@@ -1016,13 +983,6 @@
 resolving method to be able to call either of the conflicting methods
 from two composed roles.)
 
-If a method in a role is a MultiSub PMC and there is either no method of
-that name yet OR what is in the method slot with that name is also a
-MultiSub PMC, there will be no error. Instead, the multi-methods from
-the role will be added to the multi-methods of the MultiSub PMC already
-in the class. Any attempt to combine a multi with a non-multi will
-result in an error.
-
 =head3 Opcodes
 
 The following ops are provided to deal with objects. Please note that
@@ -1074,7 +1034,7 @@
 
 =end PIR_FRAGMENT
 
-Call the method specified in the attribute $S1 using $P1 as the invocant and
+Call the method specified in the string name $S1 using $P1 as the invocant and
 using the continuation passed in $P2. If you need to create a new continuation
 use C<callmethodcc>.
 
@@ -1098,11 +1058,11 @@
 
 =end PIR_FRAGMENT
 
-Call the method specified in the attribute $S1, or in the Sub object $P2,
+Call the method specified in the string name $S1, or in the Sub object $P2,
 using $P1 as the invocant for method lookup and generate a new return
 continuation.
 
-Throws a Method_Not_Found_Exception for a non-existent method.
+Throws an exception for a non-existent method.
 
 =item callmethodsupercc [hypothetical, 2.0 or later]
 
@@ -1113,11 +1073,11 @@
 
 =end PIR_FRAGMENT_TODO
 
-Call the method specified in the attribute $S1, or in the Sub object $P2,
+Call the method specified in the string name $S1, or in the Sub object $P2,
 using $P1 as the invocant for method lookup and generate a new return
 continuation.  This is a variant of C<callmethodcc> that skips over the
 current class when searching for the method, and only looks in the parent
-classes.  PIR may provide some syntactical sugar for this.
+classes.  PIR may provide some syntactic sugar for this.
 
 =item callmethodnextcc [hypothetical, 2.0 or later]
 
@@ -1128,7 +1088,7 @@
 
 =end PIR_FRAGMENT_TODO
 
-Call the method specified in the attribute $S1, or in the Sub object $P2,
+Call the method specified in the string name $S1, or in the Sub object $P2,
 using $P1 as the invocant for method lookup and generate a new return
 continuation. A variant of C<callmethodcc> that picks up an existing
 C<find_method> search where it left off for the current call. {{ Note: this
@@ -1335,29 +1295,17 @@
 
 =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
-requires a good working knowledge of the way Parrot works--generally for
-higher-level languages the language compiler or runtime will provide
-easier-to-use wrappers. These methods are all prototyped, and take a
-single fixed argument list, and return at most a single value.
+Classes can override vtable functions from PIR, allowing control over
+the low-level behavior of objects similar to PMCs defined in C. The
+vtable functions all take a single fixed argument list, and return at
+most a single value. Calling the overrides directly requires some
+knowledge of the way Parrot works, so higher-level languages will
+generally provide easier-to-use wrappers.
 
 To override a vtable function, either add the :vtable pragma to the
 declaration of the method, or pass a named parameter "vtable" into the
 C<add_method> method on a class or role.
 
-=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
-forward compatibility, generally good things. It also allows for multiple
-concurrent interoperable object systems. The major thrust is for transparent
-use of objects, though most class activity (including creation of subclasses
-and modifications of existing classes) should be transparent as well.
-
-
-
-
 =head2 Examples
 
 The following examples all assume we're working with basic Object objects
@@ -1369,7 +1317,7 @@
 
 =begin PIR_FRAGMENT
 
-   newclass $P0, "Foo"
+   $P0 = newclass "Foo"
 
 =end PIR_FRAGMENT
 
@@ -1379,9 +1327,9 @@
 
 =begin PIR_FRAGMENT
 
-   get_class $P0, "A"
-   get_class $P1, "B"
-   subclass $P2, $P0, "Foo"
+   $P0 = get_class "A"
+   $P1 = get_class "B"
+   $P2 = subclass $P0, "Foo"
    addparent $P2, $P1
 
 =end PIR_FRAGMENT
@@ -1416,25 +1364,34 @@
 Calling the method C<Xyzzy> on an object, assuming the PDD03 calling
 conventions are respected:
 
-=begin PIR_FRAGMENT_INVALID
+=begin PASM_FRAGMENT_INVALID
 
   callmethod "Xyzzy"
 
   set S0, "Xyzzy"
   callmethod
 
-=end PIR_FRAGMENT_INVALID
+=end PASM_FRAGMENT_INVALID
 
 Or, if a return continuation needs constructing:
 
-=begin PIR_FRAGMENT_INVALID
+=begin PASM_FRAGMENT_INVALID
 
   callmethodcc "Xyzzy"
 
   set S0, "Xyzzy"
   callmethodcc
 
-=end PIR_FRAGMENT_INVALID
+=end PASM_FRAGMENT_INVALID
+
+Or, calling a method in PIR, where the calling conventions are handled
+automatically.
+
+=begin PIR_FRAGMENT
+
+  $P0.'Xyzzy'($P1)
+
+=end PIR_FRAGMENT
 
 =head3 Accessing attributes from within a class
 
@@ -1442,7 +1399,7 @@
 
 =begin PIR_FRAGMENT
 
-  getattribute $P1, $P0, "Foo\x0b"
+  $P1 = getattribute $P0, "b"
 
 =end PIR_FRAGMENT
 
@@ -1474,9 +1431,9 @@
 
 =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
-this.
+Ruby: Just like Smalltalk, everything is an object.  Core Ruby classes
+(String, Array, Hash, Module, etc) might be implemented something like
+this:
 
  ParrotClass
     |

Modified: branches/orderedhash_revamp/docs/pdds/pdd17_pmc.pod
==============================================================================
--- branches/orderedhash_revamp/docs/pdds/pdd17_pmc.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/pdds/pdd17_pmc.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -44,37 +44,12 @@
 All PMCs have the form:
 
     struct PMC {
-        UnionVal cache;
         Parrot_UInt flags;
         VTABLE *vtable;
         DPOINTER *data;
-        struct PMC_EXT *pmc_ext;
-    };
-
-where C<cache> is a C<UnionVal> union:
-
-    typedef union UnionVal {
-        struct {
-            void  *_bufstart;
-            size_t _buflen;
-        } _b;
-        struct {
-            DPOINTER *_struct_val;
-            PMC      *_pmc_val;
-        } _ptrs;
-        struct _i {
-            INTVAL _int_val;
-            INTVAL _int_val2;
-        } _i;
-        FLOATVAL _num_val;
-        struct parrot_string_t * _string_val;
-    } UnionVal;
-
-C<u> holds data associated with the PMC. This can be in the form of an integer
-value, a floating-point value, a string value, or a pointer to other data.
-C<u> may be empty, since the PMC structure also provides a more general data
-pointer, but is useful for PMCs which hold only a single piece of data (e.g.
-C<PerlInts>).
+        PMC *_metadata;
+        struct _Sync *_synchronize;    # [Note: may be deprecated, see STM]
+    }
 
 C<flags> holds a set of flags associated with the PMC; these are documented
 in F<include/parrot/pobj.h>, and are generally only used within the Parrot
@@ -88,25 +63,11 @@
 C<data> holds a pointer to the core data associated with the PMC. This
 may be null.
 
-C<pmc_ext> points to an extended PMC structure. This has the form:
-
-    struct PMC_EXT {
-        PMC *_metadata;
-        struct _Sync *_synchronize; # [Note: may be deprecated, see STM]
-        PMC *_next_for_GC;
-    };
-
-C<_metadata> holds internal PMC metadata. The specification for this has not
-yet been finalized.
+C<_metadata> holds internal PMC metadata (properties). See the setprop/getprop
+ops in F<docs/ops/pmc.pod>.
 
 C<_synchronize> is for access synchronization between shared PMCs.
 
-C<_next_for_GC> determines the next PMC in the 'used' list during dead object
-detection in the GC.
-
-PMCs are not required to have a C<PMC_EXT> structure (i.e. C<pmc_ext> can be
-null).
-
 PMCs are used to implement the basic data types of the high level languages
 running on top of Parrot. For instance, a Perl 5 C<SV> will map onto one (or
 more) types of PMC, while particular Python datatypes will map onto different
@@ -123,10 +84,6 @@
 
 =over 4
 
-=item need_ext
-
-Adds the C<PMC_EXT> structure when instantiating the PMC.
-
 =item abstract
 
 The PMC cannot be instantiated. (By convention, abstract classes are given
@@ -488,14 +445,6 @@
 hash. This opcode is most often used with high-level classes, but
 low-level PMCs may instantiate an object of their own type.
 
-=item instantiate_str
-
-  PMC* instantiate_str(INTERP, PMC *self, STRING *rep, INTVAL flags)
-
-Construct a PMC initializing it from a string representation and integer
-flags. [NOTE: this has been replaced by C<instantiate>. Any
-initialization arguments can be passed in the I<init> hash.]
-
 =item inspect
 
   PMC* inspect(INTERP, PMC *self)
@@ -653,7 +602,7 @@
 
 Return the entire property hash for I<self>.
 
-=item type [deprecated: See RT #48567]
+=item type
 
   INTVAL type(INTERP, PMC *self)
 
@@ -1062,15 +1011,6 @@
 
 Delete the element indexed by a PMC, integer, or string key.
 
-=item nextkey_keyed
-
-  PMC* nextkey_keyed(INTERP, PMC *self, PMC *key, INTVAL what)
-  PMC* nextkey_keyed_int(INTERP, PMC *self, INTVAL key, INTVAL what)
-  PMC* nextkey_keyed_str(INTERP, PMC *self, STRING *key, INTVAL what)
-
-Advance to the next position while iterating through an aggregate. [NOTE: this
-feature needs review together with the Iterator PMC.]
-
 =back
 
 =head4 Math Vtable Functions
@@ -1712,11 +1652,6 @@
 to reference that PMC rather than calling the assign v-table call on the PMC
 in that register. This is not the same behaviour as the Ref PMC.
 
-=item Random
-
-A singleton PMC that generates a random number. {{ NOTE: Why do we have
-this? }}
-
 =item Exception
 
 The base class for all exceptions. Currently based on

Modified: branches/orderedhash_revamp/docs/pdds/pdd19_pir.pod
==============================================================================
--- branches/orderedhash_revamp/docs/pdds/pdd19_pir.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/pdds/pdd19_pir.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -59,7 +59,7 @@
     A42
 
 Opcode names are not reserved words in PIR, and may be used as variable names.
-For example, you can define a local variable named C<print>.  [See RT #24251]
+For example, you can define a local variable named C<print>.  
 Note that currently, by using an opcode name as a local variable name, the
 variable will I<hide> the opcode name, effectively making the opcode unusable.
 In the future this will be resolved.
@@ -397,9 +397,9 @@
 =end PIR_FRAGMENT
 
 An annotation stays in effect until the next annotation with the same key or
-the end of the current compilation unit (that is, if you use a tool such as
-C<pbc_merge> to link multiple bytecode files, then annotations will not spill
-over from one mergee's bytecode to another).
+the end of the current file (that is, if you use a tool such as C<pbc_merge>
+to link multiple bytecode files, then annotations will not spill over from one
+mergee's bytecode to another).
 
 One annotation covers many PIR instructions. If the result of compiling one
 line of HLL code is 15 lines of PIR, you only need to emit one annotation
@@ -844,7 +844,7 @@
 =end PIR_FRAGMENT
 
 Note that this only works for opcodes that have have a leading C<OUT>
-parameter. [this restriction unimplemented: RT #36283]
+parameter. [this restriction unimplemented: TT #906]
 
 =item ([<var1> [:<mod1> ...], ...]) = <var2>([<arg1> [:<mod2> ...], ...])
 

Modified: branches/orderedhash_revamp/docs/pdds/pdd22_io.pod
==============================================================================
--- branches/orderedhash_revamp/docs/pdds/pdd22_io.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/pdds/pdd22_io.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -309,7 +309,7 @@
 the only valid value to set is 'utf8' which turns on UTF-8 reading/writing
 mode for the stream. The default behavior is fixed-width 8-bit characters.
 
-=item C<get_fd> [RT #48312]
+=item C<get_fd>
 
 =begin PIR_FRAGMENT
 
@@ -1053,12 +1053,12 @@
 
 =head2 References
 
-  F<src/io/io.c>
+  F<src/io/core.c>
   F<src/ops/io.ops>
   F<include/parrot/io.h>
   F<runtime/parrot/library/Stream/*>
-  F<src/io/io_unix.c>
-  F<src/io/io_win32.c>
+  F<src/io/unix.c>
+  F<src/io/win32.c>
   Perl 5's IO::AIO
   Perl 5's POE
 

Modified: branches/orderedhash_revamp/docs/pdds/pdd28_strings.pod
==============================================================================
--- branches/orderedhash_revamp/docs/pdds/pdd28_strings.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/pdds/pdd28_strings.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -257,30 +257,29 @@
 
 Parrot's internal strings (C<STRING>s) have the following structure:
 
-  struct parrot_string_t {
-      UnionVal                      cache;
-      Parrot_UInt                   flags;
-      UINTVAL                       bufused;
-      UINTVAL                       strlen;
-      UINTVAL                       hashval;
-      const struct _encoding       *encoding;
-      const struct _charset        *charset;
-      const struct _normalization  *normalization;
-  };
+    struct parrot_string_t {
+	Parrot_UInt flags;
+	void *     _bufstart;
+	size_t     _buflen;
+	char       *strstart;
+	UINTVAL     bufused;
+	UINTVAL     strlen;
+	UINTVAL     hashval;
+	const struct _encoding *encoding;
+	const struct _charset  *charset;
+};
 
 The fields are:
 
 =over 4
 
-=item cache
+=item _bufstart
 
-A structure that holds the buffer for the string data and the size of the
-buffer in bytes.
+A pointer to the buffer for the string data.
 
-{{ NOTE: this is currently called "cache" for compatibility with PMC
-structures.  As we eliminate the cache from PMCs, we will flatten out this
-union value in the string structure to two members: a string buffer and the
-size of the buffer used. }}
+=item _buflen
+
+The size of the buffer in bytes.
 
 =item flags
 
@@ -320,13 +319,6 @@
 The charset structure specifies the character set (by index number and by
 name) and provides functions for transcoding to and from that character set.
 
-=item normalization
-
-What normalization form the string data is in, one of the four Unicode
-normalization forms or NFG. This structure stores the current normalization
-form, function pointers for composition and decomposition for the current
-normalization form, and a pointer to the grapheme table for NFG.
-
 =back
 
 {{DEPRECATION NOTE: the enum C<parrot_string_representation_t> will be removed
@@ -657,10 +649,6 @@
 
 Initialize a new String PMC.
 
-=item instantiate_str
-
-Create a new String PMC from a Parrot string argument.
-
 =item clone
 
 Clone a String PMC.

Modified: branches/orderedhash_revamp/docs/pdds/pdd30_install.pod
==============================================================================
--- branches/orderedhash_revamp/docs/pdds/pdd30_install.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/pdds/pdd30_install.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -99,12 +99,20 @@
 formatted HTML. Has subdirectories for each format of documentation:
 F<pod/>, F<html/>, etc.
 
+=item F</usr/include/parrot/E<lt>versionE<gt>/>
+
+C header files for Parrot.  
+
+=item F</usr/src/parrot/E<lt>versionE<gt>/>
+
+PMC source files needed for building dynamic PMCs.  
+
 =back
 
 =head2 Dependencies
 
-Building core Parrot depends on Perl (including perldoc, which may be a
-separate package), libgdm and libreadline.
+Building core Parrot depends on Perl (including F<perldoc>, which may be a
+separate package), F<libgdm> and F<libreadline>.
 
 Building a language depends on a series of Parrot build tools, installed in
 F</usr/lib/parrot/E<lt>version/tools>. These tools will generally not be
@@ -144,6 +152,15 @@
 converted to C<\r\n> for MSWin32 nmake. See
 L<Parrot::Configure::Compiler>.
 
+=head3 Packaging and Distribution
+
+Each language, operating system, or distribution is free to package
+modules in their own way, using their own usual build and install tools.
+The default distribution format is a tarball containing the source files
+and a cross-platform build infrastructure (the 'make' variants are a
+good choice, and can be combined with Autoconf, CMake, Perl, Python,
+etc. for more complex conditional builds).
+
 =head2 Attachments
 
 None.

Modified: branches/orderedhash_revamp/docs/pmc.pod
==============================================================================
--- branches/orderedhash_revamp/docs/pmc.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/pmc.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -30,36 +30,6 @@
 encapsulation and hidden dependencies between PMCs.  Any new code should not
 use the UnionVal, which will eventually be removed from Parrot.
 
-=head2 PMC_EXT
-
-C<PMC_EXT> is a member of the PMC struct which contains two currently used
-pointers.  PMCs which need C<PMC_EXT> should have C<need_ext> in their
-C<pmclass> declaration.  A PMC should declare C<need_ext> for either of the
-reasons listed below.
-
-Note that the C<_synchronize> member of the C<PMC_EXT> struct is obsolete and
-due to be removed.
-
-=over 4
-
-=item * The PMC needs metadata.
-
-The C<_metadata> member of C<PMC_EXT> is used to store attributes.  If your PMC
-will use attributes (not to be confused with ATTRs), your PMC should declare
-C<need_ext>.  Note that if code attempts to add an attribute to a PMC which
-doesn't have a C<PMC_EXT>, a C<PMC_EXT> with the appropriate C<_metadata> will
-be added dynamically.  In this case, C<need_ext> is a way of telling Parrot to
-take care of this when the PMC is initialized.
-
-=item * The PMC is an aggregate which holds GCable objects.
-
-If the PMC is an aggregate which can contain other GCable object, it needs to
-declare C<need_ext>.  GCable objects include other PMCs and Parrot STRINGs.
-Unlike attribute metadata, all PMCs which contain GCable objects need to
-declare C<need_ext>.
-
-=back
-
 =head2 ATTRs and C<PMC_data()>
 
 If your PMC needs to store more data than will fit into the 8 bits of the PMC
@@ -72,7 +42,7 @@
 C<PMC_data> in the PMC's C<init()> and C<init_pmc()> VTABLE functions (if used)
 and it must be destroyed in the C<destroy()> VTABLE function.  PMCs with ATTRs
 also need to indicate that they need active destruction by calling
-C<PObj_active_destroy_SET()> or C<PObj_custom_mark_destroy_SETALL()>.
+C<PObj_custom_destroy_SET()> or C<PObj_custom_mark_destroy_SETALL()>.
 
 If your PMC only needs to store a single pointer, it can use C<PMC_data> directly.
 Note that this may make maintaining your PMC difficult, should more data ever
@@ -110,10 +80,10 @@
 VTABLE function must call B<Parrot_gc_mark_PObj_alive()> on all B<PObj>s which your PMC
 contains.
 
-=item PObj_active_destroy_FLAG
+=item PObj_custom_destroy_FLAG
 
 If your PMC allocates any memory or opens any resources during its lifetime, it
-must set B<PObj_active_destroy> and implement the B<destroy()> VTABLE function to
+must set B<PObj_custom_destroy> and implement the B<destroy()> VTABLE function to
 free those resources.
 
 =item PObj_needs_early_gc_FLAG

Modified: branches/orderedhash_revamp/docs/pmc/subs.pod
==============================================================================
--- branches/orderedhash_revamp/docs/pmc/subs.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/pmc/subs.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -167,6 +167,86 @@
 PIR source or bytecode.  Note that it is possible to mark a sub with both
 B<:load> and B<:init>.
 
+=head2 Defining subs
+
+A sub is defined by a block of code starting with C<.sub> and ending with
+C<.end>. Parameters which the sub can be called with are defined by C<.param>:
+
+=begin PIR
+
+    .sub do_something
+      .param pmc a_pmc
+      .param string some_string
+      #do something
+    .end
+
+=end PIR
+
+The set of C<.param> instructions are converted to a single C<get_params>
+instruction. The compiler will decide which registers to use.
+
+=begin PIR_FRAGMENT
+    
+    get_params '(0,0)', $P0, $S0
+
+=end PIR_FRAGMENT
+
+A parameter can be declared optional with the C<:optional> command. If an
+optional parameter is followed by parameter declared C<:opt_flag>, this
+parameter will store an integer indicating whether the optional parameter
+was used.
+
+=begin PIR_FRAGMENT
+
+    .param string maybe :optional
+    .param int has_maybe :opt_flag
+    unless has_maybe goto no_maybe
+    #do something with maybe
+    no_maybe:
+    #don't use maybe
+
+=end PIR_FRAGMENT
+
+A sub can accept an arbitrary number of parameters by declaring a C<:slurpy>
+parameter.  This creates a pmc containing an array of all parameters passed to
+the sub, these can be accessed like so:
+
+=begin PIR_FRAGMENT
+
+    .param pmc all_params :slurpy
+
+    $P0 = all_params[0]
+    $S0 = all_params[1]
+
+=end PIR_FRAGMENT
+
+A slurpy parameter can also be defined after a set of positional parameters, in
+which case it will only hold any additional parameters passed.
+
+A parameter may also be declared C<:named>, giving them a string which can be
+used when calling the sub to explicitly assign a parameter, ignoring position.
+
+=begin PIR_FRAGMENT
+
+    .param int counter :named("counter")
+
+=end PIR_FRAGMENT
+
+This can be combined with C<:optional> as well as C<:opt_flag>, so that the
+parameter need only be passed when necessary.
+
+If a parameter is declared with C<:slurpy> and C<:named> (with no string), it
+creates an associative array containing all named parameters which can be
+accessed like so:
+
+=begin PIR_FRAGMENT
+
+    .param pmc all_params :slurpy :named
+    $S0 = all_params['name']
+    $I0 = all_params['counter']
+
+=end PIR_FRAGMENT
+
 =head2 Calling the sub
 
 PIR sub invocation syntax is similar to HLL syntax:
@@ -205,6 +285,16 @@
 values get the same register type coercion as sub parameters.  This is all
 described in much more detail in L<docs/pdds/pdd03_calling_conventions.pod>.
 
+Named parameters can be explicity called in one of two ways:
+
+=begin PIR_FRAGMENT
+
+    $P5 = do_something($I6 :named("counter"), $S4 :named("name"))
+    #or equivalently
+    $P5 = do_something("counter" => $I6, "name" => $S4)
+
+=end PIR_FRAGMENT
+
 To receive multiple values, put the register names in parentheses:
 
 =begin PIR_FRAGMENT
@@ -224,37 +314,36 @@
 
 =end PIR_FRAGMENT_INVALID
 
-Both of these affect only the signature provided via C<get_results>.
-
-[should also describe :flat, :slurpy, :named, ..., or at least provide a
-reference.  -- rgr, 25-May-08.]
+A C<:slurpy> value can be declared, as in parameter declarations, to catch an
+arbitrary number of return values:
 
 =begin PIR_FRAGMENT
 
-    # Call the sub in $P8, with continuation (created earlier) in $P9.
-    invoke $P8, $P9
+    ($P12, $P13 :slurpy) = do_something($P1, $S3)
 
 =end PIR_FRAGMENT
 
-=head2 Returning from a sub
+Note that the parameters stored in a C<:slurpy>, or C<:slurpy> C<:named> array
+can be used as parameters for another call using the C<:flat> declaration:
 
-PIR supports a convenient syntax for returning any number of values from a sub
-or closure:
+=begin PIR_FRAGMENT
 
+    ($P14, $P15) = do_something($P13 :flat)
 
-To test whether a value was returned, declare it C<:optional>, and follow it
-with an integer register declared C<:opt_val>:
+=end PIR_FRAGMENT
 
-=begin PIR_FRAGMENT_INVALID
+Subs may also return C<:named> values, which can be explicitly accessed similar
+to parameter declarations:
 
-    ($P10 :optional, $I10 :opt_val) = do_something($P1, $S3)
+=begin PIR_FRAGMENT
 
-=end PIR_FRAGMENT_INVALID
+    ($I11 :named("counter"), $S4 :named("name")) = do_something($P1, $S3)
 
-Both of these affect only the signature provided via C<get_results>.
+=end PIR_FRAGMENT
+
+All of these affect only the signature provided via C<get_results>.
 
-[should also describe :flat, :slurpy, :named, ..., or at least provide a
-reference.  -- rgr, 25-May-08.]
+[not sure what this is for, leaving it alone for now -aninhumer]
 
 =begin PIR_FRAGMENT
 
@@ -281,7 +370,7 @@
 
 =begin PIR_FRAGMENT
 
-    get_results '(0,0,0)', $P0, $I1, $S3
+    set_returns '(0,0,0)', $P0, $I1, $S3
     returncc	# return by calling the current continuation
 
 =end PIR_FRAGMENT
@@ -290,6 +379,9 @@
 array that describes the register types; it is replaced internally with C<[2,
 0, 1]>, which means "three arguments, of type PMC, integer, and string".
 
+All of the declarations allowed for calls to a sub can also be used with
+return values. (C<:named>, C<:flat>)
+
 Another way to return from a sub is to use tail-calling, which calls a new sub
 with the current continuation, so that the new sub returns directly to the
 caller of the old sub (i.e. without first returning to the old sub).  This

Modified: branches/orderedhash_revamp/docs/pmc2c.pod
==============================================================================
--- branches/orderedhash_revamp/docs/pmc2c.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/pmc2c.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -76,11 +76,6 @@
 Classes with this flag get 2 vtables and 2 enums, one pair with
 read/write set methods, and one with read-only set methods.
 
-=item C<need_ext>
-
-The class needs a C<PMC_EXT> structure. For instance, any class using
-C<PMC_data> will have C<need_ext>.
-
 =item C<does interface>
 
 The class 'does' the given interfaces (the collection of methods
@@ -185,11 +180,7 @@
 =item C<SUPER(a,b,c)>
 
 Calls the overridden implementation of the current method in the nearest
-superclass, using the static type of C<SELF>.
-
-=item C<DYNSUPER(a,b,c)>
-
-As above, but uses the actual dynamic type of C<SELF>.
+superclass, using the type of C<SELF>.
 
 =back
 

Modified: branches/orderedhash_revamp/docs/porting_intro.pod
==============================================================================
--- branches/orderedhash_revamp/docs/porting_intro.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/porting_intro.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -46,71 +46,6 @@
 
 =back
 
-=head1 JIT
-
-=head2 What it is
-
-Parrot contains a just-in-time compilation subsystem that compiles Parrot
-bytecode into native processor instructions just prior to execution,
-eliminating much of the overhead of bytecode interpretation.
-
-=head2 How to help
-
-Each unique processor target requires its own JIT engine.  So far, engines have
-been implemented for DEC Alpha, ARM, Intel i386, SGI MIPS, PPC, and Sun4.  If
-you know that your architecture is substantially similar to one of these,
-adding support may be possible with relatively little effort.  Implementing a
-novel JIT core from scratch is a substantial undertaking.
-
-Also note that some changes may be required based on OS as well. (e.g.:
-OS X/i386 vs. Linux/i386; OS X/i386 doesn't currently work.)
-
-=head2 References
-
-=over 4
-
-=item * F<docs/jit.pod>
-
-=item * F<src/jit/$arch/*>
-
-=item * I<make testj>
-
-=item * F<t/op/jit.t>
-
-=back
-
-=head1 Native Exec
-
-=head2 What it is
-
-Parrot's "native exec" feature allows the integration of the parrot runtime and
-a Parrot program into a single precompiled binary, reducing program start-up
-cost and negating the need to package Parrot distinctly from an application.
-It's perl2exe/PerlApp/PAR for the Parrot generation.
-
-=head2 How to help
-
-The exec feature makes use of the JIT subsystem, and requires supporting code
-with knowledge of the operating system's native object format.  This feature is
-only supported on JITable architectures (for now, just x86) running Linux,
-*BSD, or Darwin.  An interested Parrot hacker with an eligible platform can
-contribute by submitting patches which emit exec objects in the OS's native
-object format (e.g., ELF, a.out, XCOFF).
-
-=head2 References
-
-=over 4
-
-=item * F<docs/native_exec.pod>
-
-=item * F<src/exec*.c>
-
-=item * F<include/parrot/exec*.h>
-
-=item * F<config/auto/jit.pl>
-
-=back
-
 =head1 Threads
 
 =head2 What it is

Modified: branches/orderedhash_revamp/docs/project/branching_guide.pod
==============================================================================
--- branches/orderedhash_revamp/docs/project/branching_guide.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/project/branching_guide.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,7 +1,11 @@
 # Copyright (C) 2008-2009, Parrot Foundation.
 # $Id$
 
-=head1 Branching Instructions
+=head1 NAME
+
+docs/project/branching_guide.pod - Branching Instructions
+
+=head1 DESCRIPTION
 
 To minimize the disruption of feature development on language and tool
 developers, all major changes to Parrot core take place in a branch. Ideally,
@@ -35,11 +39,13 @@
 
 =head3 SVN
 
-On a regular basis (at least weekly, more often for heavy changes), synchronize
-your branch with the changes in trunk. For this you will need the revision
-number of your most recent synchronization (or the revision number of the
-initial branch creation if this is the first synchronization), and the current
-highest revision in trunk (you can get this by running C<svn update>).
+If your branch touches many source code files or is expected to be long-lived,
+you may wish to consider synchronizing your branch with changes in trunk on a
+regular basis (at least weekly, more often for heavy changes). For this you
+will need the revision number of your most recent synchronization (or the
+revision number of the initial branch creation if this is the first
+synchronization), and the current highest revision in trunk (you can get this
+by running C<svn update>).
 
 Make sure you don't have any outstanding changes in your working copy (use
 C<svn status>).

Modified: branches/orderedhash_revamp/docs/project/cage_cleaners_guide.pod
==============================================================================
--- branches/orderedhash_revamp/docs/project/cage_cleaners_guide.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/project/cage_cleaners_guide.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -7,7 +7,7 @@
 
  Fixes failing tests, makes sure coding standards are implemented,
  reviews documentation and examples. A class of tickets in the
- tracking system (RT or Trac) has been created for use by this
+ tracking system (Trac) has been created for use by this
  group. This is an entry level position, and viewed as a good way
  to get familiar with parrot internals.
 
@@ -315,7 +315,7 @@
 =head2 Remove usage of deprecated features
 
 F<DEPRECATED.pod> lists features that are deprecated but not yet removed;
-An RT ticket will document how this deprecated feature is to be replaced.
+A Trac ticket will document how this deprecated feature is to be replaced.
 Help prepare for the actual removal of the feature by replacing its usage.
 
 =head2 Clean up skipped tests
@@ -374,7 +374,6 @@
 =head1 SEE ALSO
 
 F<docs/project/roles_responsibilities.pod>, F<RESPONSIBLE_PARTIES>
-and the list of Cage items on RT:
-L<http://xrl.us/owsd> (Link to rt.perl.org)
+and the list of Cage items in Trac L<http://trac.parrot.org>.
 
 =cut

Modified: branches/orderedhash_revamp/docs/project/debian_packaging_guide.pod
==============================================================================
--- branches/orderedhash_revamp/docs/project/debian_packaging_guide.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/project/debian_packaging_guide.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -45,11 +45,6 @@
 
 =item 3.
 
-Update the debian/parrot-doc.docs file by running the script
-tools/dev/debian_docs.sh in the Parrot repository.
-
-=item 4.
-
 Update the debian/changelog file in ~/deb/parrot/parrot-<version>/. The format
 of the changelog file is strict (automatically parsed). The first line of the
 log entry gives the package version and categorization. For a new version
@@ -73,50 +68,50 @@
 
    -- Your Name <you at example.org>  Sun, 30 Dec 2007 17:21:45 +0000
 
-=item 5.
+=item 4.
 
 Update the debian/control.in file in ~/deb/parrot/parrot-<version>/. Make sure
 you are listed in "Uploaders". The "Maintainer" will always be "Debian
 Parrot Maintainers <pkg-parrot-devel at lists.alioth.debian.org>".
 
-=item 6.
+=item 5.
 
 Update the debian/copyright file in ~/deb/parrot/parrot-<version>/. Check for
 any removed files that no longer need copyright notices. Update the years in
 the Parrot Foundation copyright line if needed.
 
-=item 7.
+=item 6.
 
 Regenerate the debian/control file. From the
 ~/deb/parrot/parrot-<version>/ directory, run:
 
   $ debian/rules debian-control-stamp
 
-=item 8.
+=item 7.
 
 Install all dependencies:
 
   $ sudo /usr/lib/pbuilder/pbuilder-satisfydepends
 
-=item 9.
+=item 8.
 
 Build the packages. From ~/deb/parrot/parrot_<version>/, run:
 
   $ export DEBSIGN_KEYID="<gpg key id>"
   $ debuild
 
-=item 10.
+=item 9.
 
 Check the package for errors. From ~/deb/parrot, run:
 
   $ lintian -i parrot_<version>.changes
 
-=item 11.
+=item 10.
 
 Commit all changes made to the files in the debian/ directory to the Parrot
 repository.
 
-=item 12.
+=item 11.
 
 Upload the packages to http://alioth.debian.org. (If you don't have admin
 privileges, ask someone who does.) From any of the project pages, click on the

Modified: branches/orderedhash_revamp/docs/project/release_manager_guide.pod
==============================================================================
--- branches/orderedhash_revamp/docs/project/release_manager_guide.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/project/release_manager_guide.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -10,17 +10,27 @@
 =item 0.
 
 As soon as you become the release manager: review the goals for the release on
-the Parrot roadmap (L<https://trac.parrot.org/parrot/wiki/ParrotRoadmap>) and
+the Parrot roadmap (L<https://trac.parrot.org/parrot/roadmap>) and
 announce the tasks to the Parrot mailing list.  Make sure everyone knows what
 they've committed to accomplish in time for the release.
 
+Right after the release preceeding your release, it is a good idea to start
+tracking parrot news in NEWS. A good resource are the reports
+in the weekly #parrotsketch IRC-meeting. A reliable log of these meetings
+is available in L<http://irclog.perlgeek.de/parrotsketch/>.
+
 A couple of weeks in advance: Ask people to run C<make fulltest> and
 report (and hopefully fix!) any problems they find. Check in with
 language project leads for release blockers, to allow time to fix them.
 Also ask people to review the tickets targeted for the upcoming release
-L<https://trac.parrot.org/parrot/roadmap>. Make sure your ssh keys have
-been added to the FTP server, so you'll be able to ship the release (any
-previous release manager can help).
+L<https://trac.parrot.org/parrot/roadmap>.
+
+Make sure your ssh key have been added to the FTP server ftp-osl.osuosl.org.
+Without the key you won't be able to ship the release.
+
+Set up your account on L<http://www.parrot.org/> and ask an previous release
+manager to provide you with editor privileges if you don't already have them.
+Any previous release manager should be able to help.
 
 A couple of days in advance: announce the new release to
 parrot-dev at lists.parrot.org and to the IRC channel #parrot. Ask whether
@@ -29,22 +39,24 @@
 F<PLATFORMS>, F<RESPONSIBLE_PARTIES>, F<DEPRECATED.pod> and
 L<https://trac.parrot.org/parrot/wiki/Languages>.
 
+On the Saturday before a release you should notify other developers to stop
+committing non-release related code to trunk.  This will help avoid
+complications. They are of course free to commit to branches as much as
+they like. You might also set the topic in #parrot, announcing the 
+time when you plan on starting the release procedure. This will help
+the committers with timing their last minute commits.
+
 You might also select a name (and optionally a quote) for your release.
 For example, you could select a name from
 L<http://en.wikipedia.org/wiki/List_of_parrots>.
 
-Set up your account on L<http://www.parrot.org/> and ask an existing release
-manager to provide you with admin privileges if you don't already have them.
-
 =item 1.
 
+The day of the release has come.
 Make sure you're up to date:
 
  $ svn update
 
-You may want to ask the developer base to stop committing big changes;
-it will avoid complications.
-
 =item 2.
 
 Update files with version-specific information:
@@ -125,6 +137,9 @@
 policy. (Those changes are all included within the major version number
 increase for the supported release.)
 
+Once you've updated PBC_COMPAT, run C<tools/dev/mk_native_pbc> to update the
+pbc files used in the native pbc tests.
+
 =item h
 
 Make sure everything works:
@@ -230,7 +245,7 @@
 
 =item 10.
 
-Update the website. You will need an account with administrative rights
+Update the website. You will need an account with editor rights
 on L<http://www.parrot.org>.
 
 =over 4
@@ -270,6 +285,17 @@
 the URL for "release/developer" or "release/supported" depending on
 which type of release this is.
 
+=item f
+
+Update docs.parrot.org. Run "make html" in a release copy of parrot, and save
+the resources/ and html/ directories created in docs/.
+ssh into the parrotvm, and in the
+webroot for docs.parrot.org, expand these into a release directory (e.g.
+1.4.0). in <webroot>/parrot, there are symbolic links for latest, stable,
+and devel. Update the latest symlink to point to your new directory.
+If this is a stable release, also update the stable symlink. Do not delete
+any old copies of the docs.
+
 =back
 
 Preview the new page, and submit it.
@@ -286,7 +312,7 @@
 
 =item a
 
-Send a text email to parrot-dev, perl6-language, perl6-announce,
+Send a text email to parrot-dev, parrot-users, perl6-language, perl6-announce,
 perl5-porters, etc.  You should also include LWN.net in this mailing; email to
 C<lwn> at that domain.
 
@@ -358,16 +384,17 @@
 releases across multiple release managers. Releases are scheduled for
 the 3rd Tuesday of each month.
 
-The starred releases are Parrot's twice-yearly supported releases, see
+The starred releases are Parrot's quarterly supported releases, see
 F<docs/project/support_policy.pod>.
 
- - July 21, 2009     - 1.4* - cotto
- - August 18, 2009   - 1.5  - rgrjr
- - Sept 15, 2009     - 1.6  - particle
- - Oct 20, 2009      - 1.7  -
- - Nov 17, 2009      - 1.8  -
- - Dec 15, 2009      - 1.9  -
- - Jan 19, 2010      - 2.0* -
+The calendar of releases is available at the comp.lang.parrot google calendar,
+visible at
+L<http://www.google.com/calendar/render?cid=ldhctdamsgfg5a1cord52po9h8@group.calendar.google.com>.
+
+ - Jan 19, 2010      - 2.0* - chromatic
+ - Feb 16, 2010      - 2.1  - darbelo
+ - Mar 16, 2010      - 2.2  - cotto
+ - Apr 20, 2010      - 2.3* - gerd
 
 =cut
 

Modified: branches/orderedhash_revamp/docs/project/support_policy.pod
==============================================================================
--- branches/orderedhash_revamp/docs/project/support_policy.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/project/support_policy.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -22,11 +22,9 @@
 every month. We make two kinds of releases, "supported" releases and
 "developer" releases.
 
-The supported releases happen in January and July. The January releases
-are numbered X.0 (the first X.0 release is in March). The July releases
-are numbered X.6, following 6 months after the January release (the
-first July release is 1.4, following 4 months after 1.0).  The supported
-releases:
+The supported releases happen quarterly, with the first release in
+January, numbered X.0.0, then X.1.0, etc. The X.0, X.3, X.6, and X.9
+releases are considered supported, they:
 
 =over 4
 
@@ -66,8 +64,8 @@
 
 For example, if a feature exists in Parrot 2.0 (January 2010), and is
 not listed for deprecation in that release, the user can be confident
-that it will still exist at the next supported release, Parrot 2.6 (July
-2010).
+that it will still exist at the next supported release, Parrot 2.3
+(April 2010).
 
 After a feature is announced as deprecated, it might not appear in the
 next supported release. We sometimes delay removing deprecated features
@@ -164,10 +162,40 @@
 
 =item * bytecode changes (opcode or core PMC removals, renames)
 
-=item * PARROT_API function changes
+=item * C<PARROT_API> function changes
 
 =item * PIR or PASM syntax changes
 
 =item * API changes in the compiler tools
 
 =back
+
+Please note that these features I<do not> require deprecation notices:
+
+=over 4
+
+=item * Parrot functions I<not> marked with C<PARROT_API> or documented as part
+of the public API (listed in docs/embed.pod)
+
+=item * The layout of Parrot's internal data structures
+
+=item * Parrot internals hidden behind a public API
+
+=item * Items otherwise eligible but marked as "experimental" in F<DEPRECATED.pod>
+
+=back
+
+Note that all pointers passed to and returned from functions marked with
+C<PARROT_API> are considered opaque.  We do not guarantee backwards
+compatibility between monthly releases for the layout of these pointers;
+dereference them at your own risk.
+
+=head1 Historical Notes
+
+Before 1.0, version numbers were ad hoc. Our 1.0 release did not occur in
+January, so no 1.X releases are from the same months as their 2.X 
+counterparts. Also, the frequency of supported releases is not constant
+over the life of the project. See F<docs/parrothist.pod> for details about
+which existing releases were considered supported.
+
+=cut

Modified: branches/orderedhash_revamp/docs/project/ticket_triaging.pod
==============================================================================
--- branches/orderedhash_revamp/docs/project/ticket_triaging.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/project/ticket_triaging.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -7,7 +7,7 @@
 
 docs/project/ticket_triaging.pod - Managing Tickets
 
-=head1 ABSTRACT
+=head1 DESCRIPTION
 
 This document attempts to outline a set of best practices for dealing with
 tickets in Parrot's tracking system.  It is targeted at Parrot developers and
@@ -25,10 +25,10 @@
 sense in terms of activities in trac, but the specifics are of course different
 with the new system.
 
-We still have several hundred tickets at the old RT system, but our goal is to
-close out those tickets and (if necessary), replace them with trac tickets.
-The old system is available at L<https://rt.perl.org>.  The Parrot issues are
-in the queue I<parrot>.
+Our previous bug tracking system was RT.  In November 2009 all remaining RT
+tickets were closed, with many being reopened in Trac.  No new issues should
+be opened in RT, but the old system is available at L<https://rt.perl.org>.
+The Parrot issues are in the queue I<parrot>.
 
 =head1 TICKET HANDLING PROCEDURES
 
@@ -332,11 +332,11 @@
 
 =item Put a subsystem identifier out the front
 
-  [tcl]: commit message
+  [json]: commit message
 
-=item If related to an RT ticket, use the ticket title
+=item If related to a Trac ticket, use the ticket number
 
-  [tcl]: #37301: [BUG] 9262: env tests failing on win32
+  [json]: Resolve #731
 
 =item Add a "Courtesy of <foo>" if supplied by someone else
 
@@ -381,18 +381,6 @@
 Look at past commit messages, and L<http://cia.navi.cx/stats/project/parrot>
 for more best practices.
 
-=item OBTW
-
-There is a completely separate RT instance in which parrot tickets may
-occasionally appear. If you find one in this queue, create a new ticket in
-our RT system, add the original poster as a requestor to the new ticket, and
-remove yourself.
-
-Then, close the ticket in the original system, and include a reference to the
-new ticket's url in our system when you close the original ticket.
-
-L<https://rt.cpan.org/Dist/Display.html?Queue=parrot>
-
 =back
 
 =cut

Modified: branches/orderedhash_revamp/docs/project/ubuntu_packaging_guide.pod
==============================================================================
--- branches/orderedhash_revamp/docs/project/ubuntu_packaging_guide.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/project/ubuntu_packaging_guide.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -67,7 +67,7 @@
 
 The changelog entry for the Ubuntu release is generally:
 
-  * Resynchronize with Debian unstable.
+  * Synchronize with Debian unstable.
 
 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

Modified: branches/orderedhash_revamp/docs/resources/parrot.css
==============================================================================
--- branches/orderedhash_revamp/docs/resources/parrot.css	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/resources/parrot.css	Sat Jan 23 01:49:53 2010	(r43541)
@@ -90,8 +90,9 @@
 
 /* =item constructs no <dt><dd> just <dt>, so we fake it */
 dt {
-	padding-top: 0.5em;
-	padding-bottom: 1em;
+	margin-top: 1em;
+	margin-bottom: 0.5em;
+	font-weight: bold;
 }
 
 pre {

Modified: branches/orderedhash_revamp/docs/running.pod
==============================================================================
--- branches/orderedhash_revamp/docs/running.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/running.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -107,7 +107,7 @@
  -O  same
  -O2 optimizations with life info
  -Op rewrite I and N PASM registers most used first
- -Ot select fastest runcore (default with -O1 and -O2)
+ -Ot select fastest runcore
  -Oc turns on the optional/experimental tail call optimizations
 
 See F<docs/dev/optimizer.pod> for more information on the optimizer.  Note that
@@ -137,16 +137,17 @@
   slow, bounds  bounds checking core (default)
   cgoto         computed goto core
   cgp           computed goto-predereferenced core
-  cgp-jit       computed goto-predereferenced core with JIT
-  exec          exec core (uses JIT at compile time to generate native code)
   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')
 
+The C<jit>, C<switch-jit>, and C<cgp-jit> options are currently aliases for the
+C<fast>, C<switch>, and C<cgp> options, respectively.  We do not recommend
+their use in new code; they will continue working for existing code per our
+deprecation policy.
+
 =item -p, --profile
 
 Run with the slow core and print an execution profile.
@@ -215,17 +216,6 @@
 
 =head1 Generated files
 
-If JIT debugging is enabled (e.g. via C<--parrot-debug 04>), the
-following additional output files are generated:
-
-  F<file.stabs.s>     stabsfile for the program
-  F<file.o>           object file with debug information
-  F<EVAL_n>           source of C<compile> op number I<n>
-  F<EVAL_n.stabs.s>   stabsfile for this block
-  F<EVAL_n.o>         object file with debug information
-
-See F<docs/jit.pod> for further information.
-
 =head1 About runcores
 
 The runcore (or runloop) tells Parrot how to find the C code that implements
@@ -280,11 +270,6 @@
 addresses.  See "Predereferencing" in F<docs/glossary.pod> for a
 fuller explanation.
 
-Finally, the JIT runcore uses the "slow" core, but also creates and
-jumps to JIT-compiled native code for supported opcodes.  "cgp-jit"
-and "switched-jit" are variations that use the CGP or switched core
-but run JIT code when possible.
-
 =head1 Operation table
 
  Command Line          Action         Output

Modified: branches/orderedhash_revamp/docs/submissions.pod
==============================================================================
--- branches/orderedhash_revamp/docs/submissions.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/submissions.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -109,9 +109,9 @@
 
 =item 4
 
-Give a clear and concise Summary.
-
-Prefix it with a C<[PATCH]> identifier.
+Give a clear and concise Summary.  You do B<NOT> need to prefix the Summary
+with a C<[PATCH]> identifier.  Instead, in the lower-right corner of the
+F<newticket> page, select status C<new> in the F<Patch status> drop-down box.
 
 =item 5
 
@@ -124,7 +124,8 @@
 
 Set the Type of the ticket to "patch". Set other relevant drop-down
 menus, such as Version (the version of Parrot where you encountered the
-problem), Platform, or Severity.
+problem), Platform, or Severity.  As mentioned above, select status C<new> in
+the F<Patch status> drop-down box.
 
 =item 7
 

Modified: branches/orderedhash_revamp/docs/tests.pod
==============================================================================
--- branches/orderedhash_revamp/docs/tests.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/tests.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -18,9 +18,6 @@
 updated your code recently and tests began failing, go for a C<make
 realclean> and recompile parrot before complaining.
 
-If your architecture supports JIT, you can test parrot JIT engine using C<make
-testj>. It works just like C<make test>, but uses the JIT engine when possible.
-
 C<make languages-test> runs the test suite for most language implementations
 in the languages directory.
 

Modified: branches/orderedhash_revamp/docs/user/pir/intro.pod
==============================================================================
--- branches/orderedhash_revamp/docs/user/pir/intro.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/user/pir/intro.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -373,7 +373,7 @@
 
 Whereas the following is not:
 
-=begin PIR_INVALID
+=begin PIR
 
   .sub main
     .param int a :named("name")
@@ -381,24 +381,24 @@
     # ...
   .end
 
-=begin PIR_INVALID
+=end PIR
 
 It's also possible to use named syntax when returning values from
 subroutines. Into the C<.return> command I'll use:
 
-=begin PIR
+=begin PIR_FRAGMENT
 
   .return ( "bar" => 20, "foo" => 10)
 
-=end PIR
+=end PIR_FRAGMENT
 
 and when calling the function, I will do:
 
-=begin PIR
+=begin PIR_FRAGMENT
 
   ("foo" => $I0, "bar" => $I1) = func()
 
-=end PIR
+=end PIR_FRAGMENT
 
 And C<$I0> will yield 10, and C<$I1> will yield 20, as expected.
 
@@ -410,22 +410,22 @@
 pass it a string register or variable where you wish the characters
 read to be placed and the number of characters you wish to read:
 
-=begin PIR
+=begin PIR_FRAGMENT
 
   read $S1, 100
 
-=end PIR
+=end PIR_FRAGMENT
 
 This line will read 100 characters (or until the end of the line) and
 put the read string into C<$S1>. In case you need a number, just
 assign the string to the correct register type:
 
-=begin PIR
+=begin PIR_FRAGMENT
 
   read $S1, 100
   $I1 = $S1
 
-=end PIR
+=end PIR_FRAGMENT
 
 With the PIR syntax shown in this article you should be able to start
 writing simple programs. Next article we will look into available

Modified: branches/orderedhash_revamp/docs/user/pir/pmcs.pod
==============================================================================
--- branches/orderedhash_revamp/docs/user/pir/pmcs.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/user/pir/pmcs.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -60,7 +60,6 @@
     Iterator        iterate over aggregates such as arrays or hashes
     Array           A generic, resizable array
     Hash            A generic, resizable hash
-    Random          Obtain a random number
     String          Similar to a string register but in PMC form
     Integer         Similar to an int register but in PMC form
     Float           Similar to a num register but in PMC form
@@ -304,23 +303,7 @@
 A good place to start is the docs directory in the Parrot
 distribution (parrot/docs)
 
-=head3 Example 7: Output random numbers
-
-=begin PIR
-
-    .sub _ :main
-        $P0 = new 'Random'
-        $N0 = $P0
-        print $N0
-        print "\n"
-        $N0 = $P0
-        print $N0
-        print "\n"
-    .end
-
-=end PIR
-
-=head3 Example 8: Triggering an exception
+=head3 Example 7: Triggering an exception
 
 =begin PIR
 
@@ -332,7 +315,7 @@
 
 =end PIR
 
-=head3 Example 9: Setting a timer
+=head3 Example 8: Setting a timer
 
 =begin PIR
 

Modified: branches/orderedhash_revamp/docs/vtables.pod
==============================================================================
--- branches/orderedhash_revamp/docs/vtables.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/docs/vtables.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -211,7 +211,7 @@
 =item C<destroy>
 
 Do any data shut-down and finalization you need to do. To have this method
-called, you must set the C<Pobj_active_destroy_FLAG>.
+called, you must set the C<Pobj_custom_destroy_FLAG>.
 
 =item C<get_integer>
 

Modified: branches/orderedhash_revamp/editor/README.pod
==============================================================================
--- branches/orderedhash_revamp/editor/README.pod	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/editor/README.pod	Sat Jan 23 01:49:53 2010	(r43541)
@@ -85,11 +85,19 @@
 =head2 TAGS file
 
 There is a script here to automatically generate a TAGS file, which works with
-Vim and other editors that recognize ctags-format files. The tool "exuberant
-ctags" is required. Run
+Vim and other editors that recognize ctags-format files. Run
 
-  make tags
+  make tags-vi
 
-in the parrot root directory to build the tags file.
+for Vim-compatible tags or
+
+  make tags-emacs
+
+for Emacs-style tags.  The tool "exuberant ctags" is required for both. There
+is also the
+
+  make tags-xemacs
+
+target which will work with older XEmacs etags (21.5*).
 
 =cut

Modified: branches/orderedhash_revamp/editor/pir-mode.el
==============================================================================
--- branches/orderedhash_revamp/editor/pir-mode.el	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/editor/pir-mode.el	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 ;;; pir-mode.el --- pir-mode.el --- editing IMCC source files under Emacs
-
+;;; $Id $
 ;;; Commentary:
 
 ;; This package provides Emacs support for PIR.
@@ -153,7 +153,7 @@
     "ManagedStruct" "MultiSub" "NCI" "NameSpace" "Null"
     "OS" "Object" "OrderedHash" "PMCProxy" "ParrotClass"
     "ParrotIO" "ParrotInterpreter" "ParrotLibrary" "ParrotObject"
-    "ParrotRunningThread" "ParrotThread" "Pointer" "Random"
+    "ParrotRunningThread" "ParrotThread" "Pointer"
     "ResizableBooleanArray" "ResizableFloatArray" "ResizableIntegerArray"
     "ResizablePMCArray" "ResizableStringArray" "RetContinuation"
     "Role" "Scalar" "String" "Sub" "Super"

Modified: branches/orderedhash_revamp/examples/benchmarks/addit.pasm
==============================================================================
--- branches/orderedhash_revamp/examples/benchmarks/addit.pasm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/benchmarks/addit.pasm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -18,6 +18,7 @@
 =cut
 
 _main:
+        new P10, 'ResizableIntegerArray'
         new P5, 'ResizablePMCArray'
         push P5, 1000
         push P5, 7.100
@@ -28,7 +29,7 @@
 AGAIN:
         dec I9
         lt I9, 0, FIN
-        bsr _varargs_adder
+        local_branch P10, _varargs_adder
         branch AGAIN
 FIN:
         print N5
@@ -46,7 +47,7 @@
         branch LOOP
 DONE:
         set N5, P2
-        ret
+        local_return P10
 
 =head1 SEE ALSO
 

Modified: branches/orderedhash_revamp/examples/benchmarks/array_access.pir
==============================================================================
--- branches/orderedhash_revamp/examples/benchmarks/array_access.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/benchmarks/array_access.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -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

Added: branches/orderedhash_revamp/examples/benchmarks/fib.cs
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/examples/benchmarks/fib.cs	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,26 @@
+// (C) 2009, Parrot Foundation
+// $Id$
+
+// Fibonacci Benchmark
+
+using System;
+using System.Diagnostics;
+
+namespace str
+{
+    class MainClass
+    {
+        public static void Main (string[] args)
+        {
+            var sw = new Stopwatch(); sw.Start();
+            var n = args.Length > 0 ? Int32.Parse(args[0]) : 28;
+            var result = _fib(n);
+            sw.Stop();
+            Console.WriteLine ("fib(" + n + ") = " + result);
+            Console.WriteLine ("Elapsed: " + sw.Elapsed);
+        }
+        static int _fib (int n) {
+            return n < 2 ? n : _fib(n - 1) + _fib(n - 2);
+        }
+    }
+}

Added: branches/orderedhash_revamp/examples/benchmarks/hamming.pir
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/examples/benchmarks/hamming.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,91 @@
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+examples/benchmarks/hamming.pir - calculate hamming distance between two strings
+
+=head1 SYNOPSIS
+
+    ./parrot examples/benchmarks/hamming.pir foobar foozibar
+
+=head1 DESCRIPTION
+
+Calculate the number of characters that are different between two strings.
+Strings need not be the same length. This benchmark should be useful for
+looking into the performance of String PMC -> string conversion and function calls.
+
+=cut
+
+.sub main
+    .param pmc argv
+    .local pmc s1, s2
+    .local int argc
+    $S0  = shift argv  # get rid of filename
+    argc = argv
+
+    s1 = new 'String'
+    s2 = new 'String'
+
+    if argc == 2 goto get_args
+
+    s1 = "bbbcdebbbcdebbcdebcdbcdebbcdebebbcdebcdebbcdebbbcdebbcdebbcdebbcdebcdef"
+    s2 = "acdbcdeabcdeaeaabcdeabbcdeadeaeabcdebcdeabcdeaabcdeabcdeabcdeabcdebcdef"
+    goto get_distance
+  get_args:
+    s1 = argv[0]
+    s2 = argv[1]
+  get_distance:
+    $I0 = distance(s1,s2)
+    print $I0
+    print "\n"
+.end
+
+.sub distance
+    .param string s1
+    .param string s2
+    .local int dist
+    .local int min, max
+    dist = 0
+
+    $I0  = length s1
+    $I1  = length s2
+    min  = $I0
+    max  = $I1
+    if $I0 < $I1 goto calc_dist
+    min = $I1
+    max = $I0
+
+  calc_dist:
+    dist = max - min
+
+    .local int k
+    k = 0
+  loop:
+    $S1 = get_char(s1,k)
+    $S2 = get_char(s2,k)
+
+
+    $I4 = $S1 != $S2
+
+    dist += $I4
+    inc k
+    if  k >= min goto done
+    goto loop
+  done:
+    .return (dist)
+.end
+
+.sub get_char
+    .param string s
+    .param int k
+    $S0 = substr s, k, 1
+    .return ($S0)
+.end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
+

Added: branches/orderedhash_revamp/examples/benchmarks/hello.pir
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/examples/benchmarks/hello.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,15 @@
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+# This benchmark is written specifically so that it can be parsed by Parrots as old as 0.2.0
+# Please do not modify without checking that it works on older Parrots
+
+.sub main
+    print "hello world!\n"
+.end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Deleted: branches/orderedhash_revamp/examples/benchmarks/oo1.pasm
==============================================================================
--- branches/orderedhash_revamp/examples/benchmarks/oo1.pasm	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,74 +0,0 @@
-# Copyright (C) 2004-2009, Parrot Foundation.
-# $Id$
-
-# all timings Athlon 800, gcc 2.95.2
-
-# parrot SVN-HEAD
-# perl 5.8.0
-# python 2.3.3
-
-# perl oo1.pl                   0.8
-# python oo1.py                 1.2 (first time)
-# python oo1.py                 0.51
-
-# parrot -R cgp oo1.pasm            -g           -O3
-
-# original list fixed           4.9     (leaks mem ~ 110 M used)
-# don't clone vtable            4.4
-# Dan's vtable cache            4.3           3.8
-# list MIN_ITEMS 4->16          2.25
-# find_global hack              2.16          1.6
-# reuse exception               2.00          1.37
-# reuse regsave mem                           1.25
-# anchor P1                                   1.36
-# Dan's new object layout                     1.05
-
-# parrot -R jit oo1.pasm
-# find_global hack                            1.51
-# reuse exception                             1.30
-# reuse regsave mem                           1.23
-# anchor P1                                   1.32
-# Dan's new object layout                     1.00
-
-
-# parrot -R cgp oo1-prop.pasm
-#   invokecc                                  0.75
-#   RetCont out of loop                       0.57
-# parrot -R jit oo1-prop.pasm                     0.54
-
-.namespace [ "Foo" ]
-
-    newclass P1, "Foo"
-    addattribute P1, ".i"
-    addattribute P1, ".j"
-
-    set I10, 0
-    set I11, 100000
-loop:
-    new P3, "Foo"
-    inc I10
-    #sleep 0.0001
-    lt I10, I11, loop
-
-    new P3, "Foo"
-    getattribute P2, P3, ".i"
-    print P2
-    print "\n"
-    end
-
-.pcc_sub __init:
-.include "interpinfo.pasm"
-    interpinfo P2, .INTERPINFO_CURRENT_OBJECT
-    new P10, 'Integer'
-    set P10, 10
-    setattribute P2, ".i", P10
-    new P10, 'Integer'
-    set P10, 20
-    setattribute P2, ".j", P10
-    returncc
-
-# Local Variables:
-#   mode: pir
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4 ft=pir:

Added: branches/orderedhash_revamp/examples/benchmarks/oo1.pir
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/examples/benchmarks/oo1.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,75 @@
+# Copyright (C) 2004-2009, Parrot Foundation.
+# $Id$
+
+# all timings Athlon 800, gcc 2.95.2
+
+# parrot SVN-HEAD
+# perl 5.8.0
+# python 2.3.3
+
+# perl oo1.pl                   0.8
+# python oo1.py                 1.2 (first time)
+# python oo1.py                 0.51
+
+# parrot -R cgp oo1.pasm            -g           -O3
+
+# original list fixed           4.9     (leaks mem ~ 110 M used)
+# don't clone vtable            4.4
+# Dan's vtable cache            4.3           3.8
+# list MIN_ITEMS 4->16          2.25
+# find_global hack              2.16          1.6
+# reuse exception               2.00          1.37
+# reuse regsave mem                           1.25
+# anchor P1                                   1.36
+# Dan's new object layout                     1.05
+
+# parrot -R jit oo1.pasm
+# find_global hack                            1.51
+# reuse exception                             1.30
+# reuse regsave mem                           1.23
+# anchor P1                                   1.32
+# Dan's new object layout                     1.00
+
+
+# parrot -R cgp oo1-prop.pasm
+#   invokecc                                  0.75
+#   RetCont out of loop                       0.57
+# parrot -R jit oo1-prop.pasm                     0.54
+
+.namespace [ "Foo" ]
+.sub 'main'
+    newclass $P1, "Foo"
+    addattribute $P1, ".i"
+    addattribute $P1, ".j"
+
+    set $I10, 0
+    set $I11, 100000
+loop:
+    new $P3, "Foo"
+    inc $I10
+    #sleep 0.0001
+    if $I10 < $I11 goto loop
+
+    new $P3, "Foo"
+    getattribute $P2, $P3, ".i"
+    print $P2
+    print "\n"
+.end
+
+.sub 'init' :vtable
+.include "interpinfo.pasm"
+    interpinfo $P2, .INTERPINFO_CURRENT_OBJECT
+    new $P10, 'Integer'
+    set $P10, 10
+    setattribute $P2, ".i", $P10
+    $P10 = new 'Integer'
+    $P10 = 20
+    setattribute $P2, ".j", $P10
+    .return ()
+.end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Deleted: branches/orderedhash_revamp/examples/benchmarks/oo2.pasm
==============================================================================
--- branches/orderedhash_revamp/examples/benchmarks/oo2.pasm	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,61 +0,0 @@
-# Copyright (C) 2004-2009, Parrot Foundation.
-# $Id$
-
-# all timings Athlon 800, gcc 2.95.2
-
-# parrot SVN-HEAD
-# perl 5.8.0
-# python 2.3.3
-
-# perl oo2.pl                                 4.0
-# python oo2.py                               2.9 (first time)
-# python oo2.py                               2.4
-
-# parrot -R cgp oo2.pasm            -g           -O3
-#   with reuse regsave mem                    6.15
-# anchor P1                                   6.7
-# Dan's new object layout                     5.1
-
-# parrot -R jit oo2.pasm            -g           -O3
-#   with reuse regsave mem                    6.1
-# anchor P1                                   6.5
-# Dan's new object layout                     4.9
-
-# parrot -R cgp oo2-prop.pasm                     2.8
-# parrot -R jit oo2-prop.pasm                     2.6
-
-.namespace [ "Foo" ]
-
-    newclass P1, "Foo"
-    addattribute P1, ".i"
-    addattribute P1, ".j"
-
-    set I10, 0
-    set I11, 50000
-loop:
-    new P3, "Foo"
-    inc I10
-    lt I10, I11, loop
-
-    new P3, "Foo"
-    getattribute P2, P3, ".i"
-    print P2
-    print "\n"
-    end
-
-.pcc_sub __init:
-.include "interpinfo.pasm"
-    interpinfo P2, .INTERPINFO_CURRENT_OBJECT
-    new P10, 'Integer'
-    set P10, 10
-    setattribute P2, ".i", P10
-    new P10, 'Integer'
-    set P10, 20
-    setattribute P2, ".j", P10
-    returncc
-
-# Local Variables:
-#   mode: pir
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4 ft=pir:

Added: branches/orderedhash_revamp/examples/benchmarks/oo2.pir
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/examples/benchmarks/oo2.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,62 @@
+# Copyright (C) 2004-2009, Parrot Foundation.
+# $Id$
+
+# all timings Athlon 800, gcc 2.95.2
+
+# parrot SVN-HEAD
+# perl 5.8.0
+# python 2.3.3
+
+# perl oo2.pl                                 4.0
+# python oo2.py                               2.9 (first time)
+# python oo2.py                               2.4
+
+# parrot -R cgp oo2.pasm            -g           -O3
+#   with reuse regsave mem                    6.15
+# anchor P1                                   6.7
+# Dan's new object layout                     5.1
+
+# parrot -R jit oo2.pasm            -g           -O3
+#   with reuse regsave mem                    6.1
+# anchor P1                                   6.5
+# Dan's new object layout                     4.9
+
+# parrot -R cgp oo2-prop.pasm                     2.8
+# parrot -R jit oo2-prop.pasm                     2.6
+
+.namespace [ "Foo" ]
+.sub 'main'
+    newclass $P1, "Foo"
+    addattribute $P1, ".i"
+    addattribute $P1, ".j"
+
+    $I10 = 0
+    $I11 = 50000
+loop:
+    new $P3, "Foo"
+    inc $I10
+    if $I10 < $I11 goto loop
+
+    new $P3, "Foo"
+    getattribute $P2, $P3, ".i"
+    print $P2
+    print "\n"
+.end
+
+.sub 'init' :vtable
+.include "interpinfo.pasm"
+    interpinfo $P2, .INTERPINFO_CURRENT_OBJECT
+    $P10 = new 'Integer'
+    $P10 = 10
+    setattribute $P2, ".i", $P10
+    $P10 = new 'Integer'
+    $P10 = 20
+    setattribute $P2, ".j", $P10
+    .return ()
+.end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Deleted: branches/orderedhash_revamp/examples/benchmarks/oo3.pasm
==============================================================================
--- branches/orderedhash_revamp/examples/benchmarks/oo3.pasm	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,44 +0,0 @@
-# Copyright (C) 2004-2009, Parrot Foundation.
-# $Id$
-
-.namespace [ "Foo" ]
-
-    newclass P1, "Foo"
-    addattribute P1, ".i"
-    addattribute P1, ".j"
-
-    set I10, 0
-    set I11, 500000
-    new P3, "Foo"
-loop:
-    getattribute P2, P3, ".i"
-    new P10, 'Integer'	# x = Foo.i
-    assign P10, P2
-    getattribute P2, P3, ".j"
-    new P11, 'Integer'	# y = Foo.j
-    assign P11, P2
-    inc I10
-    lt I10, I11, loop
-
-    getattribute P2, P3, ".i"
-    print P2
-    print "\n"
-    end
-
-.pcc_sub __init:
-.include "interpinfo.pasm"
-    interpinfo P2, .INTERPINFO_CURRENT_OBJECT
-    new P10, 'Integer'
-    set P10, 10
-    setattribute P2, ".i", P10
-    inc I0
-    new P10, 'Integer'
-    set P10, 20
-    setattribute P2, ".j", P10
-    returncc
-
-# Local Variables:
-#   mode: pir
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4 ft=pir:

Added: branches/orderedhash_revamp/examples/benchmarks/oo3.pir
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/examples/benchmarks/oo3.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,45 @@
+# Copyright (C) 2004-2009, Parrot Foundation.
+# $Id$
+
+.namespace [ "Foo" ]
+.sub 'main'
+    newclass $P1, "Foo"
+    addattribute $P1, ".i"
+    addattribute $P1, ".j"
+
+    $I10 = 0
+    $I11 = 500000
+    $P3  = new "Foo"
+loop:
+    getattribute $P2, $P3, ".i"
+    $P10 = new 'Integer'	# x = Foo.i
+    assign $P10, $P2
+    getattribute $P2, $P3, ".j"
+    $P11 = new 'Integer'	# y = Foo.j
+    assign $P11, $P2
+    inc $I10
+    if $I10 < $I11 goto loop
+
+    getattribute $P2, $P3, ".i"
+    print $P2
+    print "\n"
+.end
+
+.sub init :vtable
+.include "interpinfo.pasm"
+    interpinfo $P2, .INTERPINFO_CURRENT_OBJECT
+    $P10 = new 'Integer'
+    $P10 = 10
+    setattribute $P2, ".i", $P10
+    inc $I0
+    $P10 = new 'Integer'
+    $P10 = 20
+    setattribute $P2, ".j", $P10
+    .return ()
+.end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/examples/benchmarks/oofib.pir
==============================================================================
--- branches/orderedhash_revamp/examples/benchmarks/oofib.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/benchmarks/oofib.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -7,11 +7,14 @@
     argc = argv
     .local pmc N
     N = new 'Integer'
-    N = 24
     if argc <= 1 goto noarg
     $S0 = argv[1]
     N = $S0
+    goto begin
 noarg:
+    N = 24
+begin:
+
     .local num start
     time start
 
@@ -43,41 +46,40 @@
 .namespace ["A"]
 
 .sub fib :method
-    .param pmc n
+    .param int n
     if n >= 2 goto rec
     .return (n)
 rec:
-    .local pmc n1
-    .local pmc n2
-    .local pmc r1
-    .local pmc r2
-    n1 = new 'Integer'
-    n2 = new 'Integer'
-    n1 = n - 1
-    n2 = n - 2
-    r1 = self."fibA"(n1)
-    r2 = self."fibB"(n2)
-    n = new 'Integer'
+    .local int prev
+    .local int r1
+    prev = n
+    dec prev
+    r1 = self."fibA"(prev)
+
+    dec prev
+    .local int r2
+    r2 = self."fibB"(prev)
+
     n = r1 + r2
     .return (n)
 .end
 
 .sub fibA :method
-    .param pmc n
+    .param int n
     if n >= 2 goto rec
     .return (n)
 rec:
-    .local pmc n1
-    .local pmc n2
-    .local pmc r1
-    .local pmc r2
-    n1 = new 'Integer'
-    n2 = new 'Integer'
-    n1 = n - 1
-    n2 = n - 2
-    r1 = self."fib"(n1)
-    r2 = self."fibB"(n2)
-    n = new 'Integer'
+    .local int prev
+    prev = n
+
+    dec prev
+    .local int r1
+    r1 = self."fib"(prev)
+
+    dec prev
+    .local int r2
+    r2 = self."fibB"(prev)
+
     n = r1 + r2
     .return (n)
 .end
@@ -85,21 +87,21 @@
 .namespace ["B"]
 
 .sub fibB :method
-    .param pmc n
+    .param int n
     if n >= 2 goto rec
     .return (n)
 rec:
-    .local pmc n1
-    .local pmc n2
-    .local pmc r1
-    .local pmc r2
-    n1 = new 'Integer'
-    n2 = new 'Integer'
-    n1 = n - 1
-    n2 = n - 2
-    r1 = self."fib"(n1)
-    r2 = self."fibA"(n2)
-    n = new 'Integer'
+    .local int prev
+    prev = n
+
+    dec prev
+    .local int r1
+    r1 = self."fib"(prev)
+
+    dec prev
+    .local int r2
+    r2 = self."fibA"(prev)
+
     n = r1 + r2
     .return (n)
 .end

Modified: branches/orderedhash_revamp/examples/benchmarks/overload.pir
==============================================================================
--- branches/orderedhash_revamp/examples/benchmarks/overload.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/benchmarks/overload.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -3,7 +3,6 @@
 
 .sub bench :main
 .include "pmctypes.pasm"
-.include "mmd.pasm"
    .local int i
    .local pmc r
    .local pmc a

Modified: branches/orderedhash_revamp/examples/benchmarks/primes.c
==============================================================================
--- branches/orderedhash_revamp/examples/benchmarks/primes.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/benchmarks/primes.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -39,36 +39,36 @@
 int
 main(int argc, char *argv[])
 {
-  int I1 = 1;
-  int I2 = 50000;
-  int I3;
-  int I4;
-  int I5;
-  int I6 = 0;
-  int I7;
-  printf("N primes up to ");
-  printf("%d", I2);
-  printf(" is: ");
-
- REDO:
-  I3 = 2;
-  I4 = I1 / 2;
- LOOP:
-  I5 = I1 % I3;
-  if (I5) {goto OK;}
-  goto NEXT;
- OK:
-  I3++;
-  if (I3 <= I4) {goto LOOP;}
+    int I1 = 1;
+    int I2 = 50000;
+    int I3;
+    int I4;
+    int I5;
+    int I6 = 0;
+    int I7;
+    printf("N primes up to ");
+    printf("%d", I2);
+    printf(" is: ");
+
+  REDO:
+    I3 = 2;
+    I4 = I1 / 2;
+  LOOP:
+    I5 = I1 % I3;
+    if (I5) {goto OK;}
+    goto NEXT;
+  OK:
+    I3++;
+    if (I3 <= I4) {goto LOOP;}
     I6++;
     I7 = I1;
- NEXT:
-  I1++;
-  if (I1 <= I2) {goto REDO;}
-  printf("%d\n", I6);
-  printf("last is: %d\n", I7);
+  NEXT:
+    I1++;
+    if (I1 <= I2) {goto REDO;}
+    printf("%d\n", I6);
+    printf("last is: %d\n", I7);
 
-  return 0;
+    return 0;
 }
 
 /*

Modified: branches/orderedhash_revamp/examples/benchmarks/primes.pasm
==============================================================================
--- branches/orderedhash_revamp/examples/benchmarks/primes.pasm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/benchmarks/primes.pasm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,9 +1,9 @@
-# Copyright (C) 2001-2006, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
 =head1 NAME
 
-examples/benchmarks/primes.pasm - Calculate prime numbers < 50000
+examples/benchmarks/primes.pasm - Calculate prime numbers < 5000
 
 =head1 SYNOPSIS
 
@@ -11,57 +11,64 @@
 
 =head1 DESCRIPTION
 
-Calculates all the prime numbers up to 50000 and prints out the number
+Calculates all the prime numbers up to 5000 and prints out the number
 of primes, the last one found, and the time taken.
 
 =cut
 
-# I1 holds the number we're currently checking for primality
-	new P1, 'Integer'
-	set     P1, 1
-	# I2 holds the highest number we want to check for primality
-	new P2, 'Integer'
-	set     P2, 1000
-	new P6, 'Integer'
-	set	P6, 0
-	print   "N primes up to "
-	print   P2
-	print   " is: "
-	time	N10
-	# I1 counts up to I2
-REDO:   # I3 counts from 2 up to I4 (I1/2)
-        new P3, 'Integer'
-	set     P3, 2
-        new P4, 'Integer'
-	div     P4, P1, 2
-LOOP:   # Check if I3 is a factor of I1
-        new P5, 'Integer'
-	cmod    P5, P1, P3
-	if      P5, OK
-	# We've found a factor, so it can't be a prime and
-	# we can skip right out of this loop and to the next
-	# number
-	branch  NEXT
-OK:     inc     P3
-	le      P3, P4, LOOP
-	# We haven't found a factor so it must be a prime
-	inc	P6
-	set 	P7, P1
-	# print I1
-	# print "\n"	# to get them all
-NEXT:   # Move on to the next number
-	inc     P1
-	le      P1, P2, REDO
-	time	N11
-	print	P6
-	print	"\nlast is: "
-	print   P7
-	print   "\n"
-	sub 	N11, N10
-	print 	"Elapsed time: "
-	print	N11
-	print	"\n"
-	end
+    # P1 holds the number we're currently checking for primality
+    new     P1, 'Integer'
+    set     P1, 1
+
+    # P2 holds the highest number we want to check for primality
+    new     P2, 'Integer'
+    set     P2, 5000
+
+    new     P6, 'Integer'
+    set     P6, 0
+    new     P7, 'Integer'
+
+    print   "N primes up to "
+    print   P2
+    print   " is: "
+    time    N10
+
+    # P1 counts up to P2
+    # P3 counts from 2 up to P4 (P1/2)
+    new     P3, 'Integer'
+
+REDO:
+    set     P3, 2
+    div     P4, P1, 2
+    # Check if P3 is a factor of P1
+LOOP:
+    cmod    P5, P1, P3
+    if      P5, OK
+
+    # We've found a factor, so it can't be a prime and
+    # we can skip right out of this loop and to the next number
+    branch  NEXT
+OK:
+    inc     P3
+    le      P3, P4, LOOP
+    # We haven't found a factor so it must be a prime
+    inc     P6
+    assign  P7, P1
+    # print I1
+    # print "\n"    # to get them all
+
+    # Move on to the next number
+NEXT:
+    inc     P1
+    le      P1, P2, REDO
+    time    N11
+    say     P6
+    print   "last is: "
+    say     P7
+    sub     N11, N10
+    print   "Elapsed time: "
+    say     N11
+    end
 
 =head1 SEE ALSO
 

Modified: branches/orderedhash_revamp/examples/benchmarks/primes2.c
==============================================================================
--- branches/orderedhash_revamp/examples/benchmarks/primes2.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/benchmarks/primes2.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -37,24 +37,24 @@
 int
 main(int argc, char *argv[])
 {
-        int i=0, max=500;
-        int i6 = 0;
-        int i7;
-
-        while (1) {
-                if (isprime1(i)) {
-                        i7 = i;
-                        i6++;
-                }
-                i++;
-                if (i==max){
-                        break;
-                }
+    int i=0, max=500;
+    int i6 = 0;
+    int i7;
+
+    while (1) {
+        if (isprime1(i)) {
+            i7 = i;
+            i6++;
         }
+        i++;
+        if (i==max) {
+             break;
+        }
+    }
 
-        printf("N primes calculated to %d is %d\nlast is: %d\n", max, i6, i7);
+    printf("N primes calculated to %d is %d\nlast is: %d\n", max, i6, i7);
 
-        return 0;
+    return 0;
 }
 
 /*
@@ -69,18 +69,18 @@
 
 int isprime1(int input)
 {
-        int n;
+    int n;
 
-        if (input < 1) {
-                return 0;
-        }
-        n = input - 1;
+    if (input < 1) {
+        return 0;
+    }
+    n = input - 1;
 
-        while (n > 1){
-                if (input%n == 0) return 0;
-                n--;
-        }
-        return 1;
+    while (n > 1) {
+        if (input%n == 0) return 0;
+        n--;
+    }
+    return 1;
 }
 
 /*

Added: branches/orderedhash_revamp/examples/benchmarks/rand.pir
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/examples/benchmarks/rand.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,187 @@
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+examples/benchmarks/rand.pir - rand dynop benchmark
+
+=head1 SYNOPSIS
+
+    % time ./parrot examples/benchmarks/rand.pir [count]
+
+=head1 DESCRIPTION
+
+Times the computation of C<count> (default 1e8) random numbers using
+the C<rand> dynop.
+
+=cut
+
+.loadlib 'math_ops'
+
+.sub _main
+    .param pmc argv
+
+    .local int count
+    count = 1e8
+
+    .local int argc
+    argc = argv
+    if argc <= 1 goto no_arg
+    $S0 = argv[1]
+    count = $S0
+no_arg:
+
+    count /= 8
+
+    .local num t0, t1, t2, t3, t4, t5, t6
+    .local num r_num, min_num, max_num
+    .local int r_int, min_int, max_int
+    .local int i
+
+    min_num = 1.0
+    max_num = 20.0
+    min_int = 1
+    max_int = 20
+
+    .local num tn0, tn1, tnull
+    tn0 = time
+    i = count
+  null_loop_top:
+    dec i
+    if i > 0 goto null_loop_top
+    tn1 = time
+    tnull = tn1 - tn0
+
+    t0 = time
+    i = count
+  t0_top:
+    r_num = rand
+    r_num = rand
+    r_num = rand
+    r_num = rand
+    r_num = rand
+    r_num = rand
+    r_num = rand
+    r_num = rand
+    dec i
+    if i > 0 goto t0_top
+
+    t1 = time
+    i = count
+  t1_top:
+    r_int = rand
+    r_int = rand
+    r_int = rand
+    r_int = rand
+    r_int = rand
+    r_int = rand
+    r_int = rand
+    r_int = rand
+    dec i
+    if i > 0 goto t1_top
+
+    t2 = time
+    i = count
+  t2_top:
+    r_num = rand max_num
+    r_num = rand max_num
+    r_num = rand max_num
+    r_num = rand max_num
+    r_num = rand max_num
+    r_num = rand max_num
+    r_num = rand max_num
+    r_num = rand max_num
+    dec i
+    if i > 0 goto t2_top
+
+    t3 = time
+    i = count
+  t3_top:
+    r_int = rand max_int
+    r_int = rand max_int
+    r_int = rand max_int
+    r_int = rand max_int
+    r_int = rand max_int
+    r_int = rand max_int
+    r_int = rand max_int
+    r_int = rand max_int
+    dec i
+    if i > 0 goto t3_top
+
+    t4 = time
+    i = count
+  t4_top:
+    r_num = rand min_num, max_num
+    r_num = rand min_num, max_num
+    r_num = rand min_num, max_num
+    r_num = rand min_num, max_num
+    r_num = rand min_num, max_num
+    r_num = rand min_num, max_num
+    r_num = rand min_num, max_num
+    r_num = rand min_num, max_num
+    dec i
+    if i > 0 goto t4_top
+
+    t5 = time
+    i = count
+  t5_top:
+    r_int = rand min_int, max_int
+    r_int = rand min_int, max_int
+    r_int = rand min_int, max_int
+    r_int = rand min_int, max_int
+    r_int = rand min_int, max_int
+    r_int = rand min_int, max_int
+    r_int = rand min_int, max_int
+    r_int = rand min_int, max_int
+    dec i
+    if i > 0 goto t5_top
+
+    t6 = time
+
+    report('null loop  ', tn0, tn1, 0,   count)
+
+    count *= 8
+
+    report('num        ', t0, t1, tnull, count)
+    report('int        ', t1, t2, tnull, count)
+    report('num_max    ', t2, t3, tnull, count)
+    report('int_max    ', t3, t4, tnull, count)
+    report('num_min_max', t4, t5, tnull, count)
+    report('int_min_max', t5, t6, tnull, count)
+.end
+
+.sub report
+    .param string name
+    .param num    start
+    .param num    end
+    .param num    null_time
+    .param int    count
+
+    .local num run_time
+    run_time  = end - start
+    run_time -= null_time
+    if run_time > 0 goto time_ok
+    run_time  = .000001
+  time_ok:
+
+    .local num per_second
+    .local int ps
+    per_second = count / run_time
+    ps = per_second
+
+    print name
+    print ': '
+    print ps
+    print ' per second ('
+    print count
+    print ' / '
+    print run_time
+    print " seconds)\n"
+.end
+
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/examples/benchmarks/stress.pasm
==============================================================================
--- branches/orderedhash_revamp/examples/benchmarks/stress.pasm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/benchmarks/stress.pasm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -16,10 +16,11 @@
 
 =cut
 
+        new P10, 'ResizableIntegerArray'
 	set I0, 10
 	new P0, 'ResizablePMCArray'
 
-ol:	bsr buildarray
+ol:	local_branch P10,  buildarray
 	set P0[I0], P1
 	dec I0
 #	print I0
@@ -29,7 +30,7 @@
 	set I0, 20
 	new P2, 'ResizablePMCArray'
 
-ol1:	bsr buildarray
+ol1:	local_branch P10,  buildarray
 	set P2[I0], P1
 	dec I0
 #	print I0
@@ -39,7 +40,7 @@
 	set I0, 20
 	new P3, 'ResizablePMCArray'
 
-ol2:	bsr buildarray
+ol2:	local_branch P10,  buildarray
 	set P3[I0], P1
 	dec I0
 #	print I0
@@ -63,7 +64,7 @@
 	set P1[I1], P9
 	dec I1
 	if I1, loop1
-	ret
+	local_return P10
 
 =head1 SEE ALSO
 

Modified: branches/orderedhash_revamp/examples/benchmarks/stress1.pasm
==============================================================================
--- branches/orderedhash_revamp/examples/benchmarks/stress1.pasm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/benchmarks/stress1.pasm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -19,12 +19,13 @@
 # Our master loop, I20 times
 	set I20, 10
 	time N0
+        new P10, 'ResizableIntegerArray'
 mloop:
 
 	set I0, 10
 	new P0, 'ResizablePMCArray'
 
-ol:	bsr buildarray
+ol:	local_branch P10,  buildarray
 	set P0[I0], P1
 	dec I0
 	if I0, ol
@@ -32,7 +33,7 @@
 	set I0, 20
 	new P2, 'ResizablePMCArray'
 
-ol1:	bsr buildarray
+ol1:	local_branch P10,  buildarray
 	set P2[I0], P1
 	dec I0
 	if I0, ol1
@@ -40,7 +41,7 @@
 	set I0, 20
 	new P3, 'ResizablePMCArray'
 
-ol2:	bsr buildarray
+ol2:	local_branch P10,  buildarray
 	set P3[I0], P1
 	dec I0
 	if I0, ol2
@@ -71,7 +72,7 @@
 	set P1[I1], P9
 	dec I1
 	if I1, loop1
-	ret
+	local_return P10
 
 =head1 SEE ALSO
 

Modified: branches/orderedhash_revamp/examples/benchmarks/stress2.pasm
==============================================================================
--- branches/orderedhash_revamp/examples/benchmarks/stress2.pasm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/benchmarks/stress2.pasm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -16,28 +16,32 @@
 =cut
 
     set I3, 20
-ol:	set I0, 10
-	new P0, 'ResizablePMCArray'
+    new P10, 'ResizableIntegerArray'
+ol:
+    set I0, 10
+    new P0, 'ResizablePMCArray'
+
+ol1:
+    local_branch P10, buildarray
+    set P0[I0], P1
+    dec I0
+    if I0, ol1
 
-ol1: bsr buildarray
-	set P0[I0], P1
-	dec I0
-	if I0, ol1
+    dec I3
+    if I3, ol
 
-	dec I3
-	if I3, ol
-
-	end
+    end
 
 buildarray:
-	set I1, 10000
-	new P1, 'ResizablePMCArray'
-loop1:	new P2, 'Integer'
-	set P2, I1
-	set P1[I1], P2
-	dec I1
-	if I1, loop1
-	ret
+    set I1, 10000
+    new P1, 'ResizablePMCArray'
+loop1:
+    new P2, 'Integer'
+    set P2, I1
+    set P1[I1], P2
+    dec I1
+    if I1, loop1
+    local_return P10
 
 =head1 SEE ALSO
 

Modified: branches/orderedhash_revamp/examples/benchmarks/stress3.pasm
==============================================================================
--- branches/orderedhash_revamp/examples/benchmarks/stress3.pasm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/benchmarks/stress3.pasm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -37,11 +37,12 @@
 	#lt I10, 2, noarg
 	#set I11, P5[1]
 	set I11, 0
+        new P10, 'ResizableIntegerArray'
 noarg:
 	set I0, 100
 	new P0, 'ResizablePMCArray'
 
-ol:	bsr buildarray
+ol:	local_branch P10, buildarray
 	set P0[I0], P1
 	dec I0
 	if I0, ol
@@ -81,7 +82,7 @@
 	set P1[I1], P9
 	dec I1
 	if I1, loop1
-	ret
+	local_return P10
 
 =head1 SEE ALSO
 

Added: branches/orderedhash_revamp/examples/c/pbc_info.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/examples/c/pbc_info.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,112 @@
+/*
+Copyright (C) 2001-2003, Parrot Foundation.
+$Id$
+
+=head1 NAME
+
+pbc_info - PackFile demo
+
+=head1 SYNOPSIS
+
+ pbc_info file.pbc
+
+=head1 DESCRIPTION
+
+Sample program for dumping PackFile segment names by iterating
+over the main directory.
+
+=head2 Functions
+
+=over 4
+
+=cut
+
+*/
+
+#include "parrot/parrot.h"
+#include "parrot/embed.h"
+
+/*
+
+=item C<static INTVAL iter(PARROT_INTERP, PackFile_Segment *seg, void *user_data)>
+
+This function is passed the callback to PackFile_map_segments() to print out
+the name of each segment in the directory.
+
+=cut
+
+*/
+
+static INTVAL
+iter(PARROT_INTERP, PackFile_Segment *seg, void *user_data)
+{
+    long ident = (long)user_data;
+    int length = ident;
+    printf("%*.0s%s\n", length, "", seg->name);
+    if (seg->type == PF_DIR_SEG)
+        PackFile_map_segments(interp, (PackFile_Directory*)seg,
+                iter, (void*)(ident+2));
+    return 0;
+}
+
+/*
+
+=item C<int main(int argc, char *argv[])>
+
+Reads the PBC from argv[1], adds a few extra sections, and then iterates over
+the directory using PackFile_map_segments() and iter().
+
+=cut
+
+*/
+
+int
+main(SHIM(int argc), char *argv[])
+{
+    PackFile *pf;
+    Interp *interp;
+    PackFile_Segment *seg;
+
+    interp = Parrot_new(NULL);
+
+    pf = Parrot_pbc_read(interp, argv[1], PFOPT_UTILS);
+
+    /*
+     * add some more segments
+     */
+    seg = PackFile_Segment_new_seg(interp,
+                    &pf->directory, PF_DIR_SEG, "dir2", 1);
+    seg = PackFile_Segment_new_seg(interp,
+                    (PackFile_Directory*)seg, PF_BYTEC_SEG, "code", 1);
+    seg = PackFile_Segment_new_seg(interp,
+                    &pf->directory, PF_DIR_SEG, "dir3", 1);
+
+    /*
+     * show these
+     */
+    printf("%s\n", pf->directory.base.name);
+    PackFile_map_segments(interp, &pf->directory, iter, (void*)2);
+
+    Parrot_exit(interp, 0);
+}
+
+/*
+
+=back
+
+=head1 SEE ALSO
+
+F<src/packfile.c>, F<include/parrot/packfile.h>.
+
+=cut
+
+*/
+
+
+/*
+ * Local variables:
+ *   c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
+

Modified: branches/orderedhash_revamp/examples/c/test_main.c
==============================================================================
--- branches/orderedhash_revamp/examples/c/test_main.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/c/test_main.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -131,48 +131,48 @@
         }
 
         switch (opt.opt_id) {
-        case 'b':
+          case 'b':
             setopt(PARROT_BOUNDS_FLAG);
             break;
-        case 'j':
+          case 'j':
             setopt(PARROT_JIT_FLAG);
             break;
-        case 'o':
+          case 'o':
             setopt(PARROT_EXEC_FLAG);
             break;
-        case 'p':
+          case 'p':
             setopt(PARROT_PROFILE_FLAG);
             break;
-        case 'P':
+          case 'P':
             setopt(PARROT_PREDEREF_FLAG);
             break;
-        case 'S':
+          case 'S':
             setopt(PARROT_SWITCH_FLAG);
             break;
-        case 'g':
+          case 'g':
             unsetopt(PARROT_CGOTO_FLAG);
             break;
-        case 't':
+          case 't':
             setopt(PARROT_TRACE_FLAG);
             break;
-        case 'd':
+          case 'd':
             setopt(PARROT_DEBUG_FLAG);
             break;
-        case 'h':
+          case 'h':
             usage();
             break;
-        case 'v':
+          case 'v':
             version();
             break;
-        case 'w':
+          case 'w':
             Parrot_setwarnings(interp, PARROT_WARNINGS_ALL_FLAG);
             break;
 
-        case '.':  /* Give Windows Parrot hackers an opportunity to
-                    * attach a debuggger. */
+          case '.':  /* Give Windows Parrot hackers an opportunity to
+                      * attach a debuggger. */
             fgetc(stdin);
             break;
-        case OPT_GC_DEBUG:
+          case OPT_GC_DEBUG:
 #if DISABLE_GC_DEBUG
             Parrot_warn(interp, PARROT_WARNINGS_ALL_FLAG,
                         "PARROT_GC_DEBUG is set but the binary was "
@@ -180,7 +180,7 @@
 #endif
             setopt(PARROT_GC_DEBUG_FLAG);
             break;
-        case OPT_DESTROY_FLAG:
+          case OPT_DESTROY_FLAG:
             setopt(PARROT_DESTROY_FLAG);
             break;
         }

Modified: branches/orderedhash_revamp/examples/compilers/japhc.c
==============================================================================
--- branches/orderedhash_revamp/examples/compilers/japhc.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/compilers/japhc.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -81,12 +81,12 @@
     for (start = p = string ; *string; string++) {
         if (*string == '\\' && string[1]) {
             switch (*++string) {
-                case 'n':
-                    *p++ = '\n';
-                    break;
-                default:
-                    *p++ = *string;
-                    break;
+              case 'n':
+                *p++ = '\n';
+                break;
+              default:
+                *p++ = *string;
+                break;
             }
         }
         else
@@ -191,32 +191,32 @@
     pc = cur_cs->base.data;
     for (p = program; *p; ++p) {
         switch (*p) {
-            case 'p':        /* print_sc */
-                *pc++ = interp->op_lib->op_code("print_sc", 1);
-                /* const follows */
-                ++p;
-                switch (*p) {
-                    case 'J':
-                        *pc++ = add_const_str(interp, consts, "Just ");
-                        break;
-                    case 'a':
-                        *pc++ = add_const_str(interp, consts, "another ");
-                        break;
-                    case 'P':
-                        *pc++ = add_const_str(interp, consts, "Parrot ");
-                        break;
-                    case 'H':
-                        *pc++ = add_const_str(interp, consts, "Hacker");
-                        break;
-                    case 'n':
-                        *pc++ = add_const_str(interp, consts, "\n");
-                        break;
-                }
-                break;
-            case 'e':        /* end */
-                *pc++ = interp->op_lib->op_code("invoke_p", 1);
-                *pc++ = 1;
+          case 'p':        /* print_sc */
+            *pc++ = interp->op_lib->op_code("print_sc", 1);
+            /* const follows */
+            ++p;
+            switch (*p) {
+              case 'J':
+                *pc++ = add_const_str(interp, consts, "Just ");
+                break;
+              case 'a':
+                *pc++ = add_const_str(interp, consts, "another ");
+                break;
+              case 'P':
+                *pc++ = add_const_str(interp, consts, "Parrot ");
                 break;
+              case 'H':
+                *pc++ = add_const_str(interp, consts, "Hacker");
+                break;
+              case 'n':
+                *pc++ = add_const_str(interp, consts, "\n");
+                break;
+            }
+            break;
+          case 'e':        /* end */
+            *pc++ = interp->op_lib->op_code("invoke_p", 1);
+            *pc++ = 1;
+            break;
         }
     }
     if (old_cs) {

Copied and modified: branches/orderedhash_revamp/examples/config/file/configcompiler (from r40254, branches/orderedhash_revamp/xconf/samples/yourfoobar)
==============================================================================

Copied and modified: branches/orderedhash_revamp/examples/config/file/configwithfatalstep (from r40254, branches/orderedhash_revamp/xconf/samples/testfoobar)
==============================================================================

Modified: branches/orderedhash_revamp/examples/embed/Makefile
==============================================================================
--- branches/orderedhash_revamp/examples/embed/Makefile	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/embed/Makefile	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,37 +1,39 @@
 # Copyright (C) 2009, Parrot Foundation.
 ## $Id$
 
-# To build this example in a parrot development environment:
-
-# PATH=/parrot_directory:$PATH
-# export LD_RUN_PATH=/parrot_directory/blib/lib
+# To build this example with an installed parrot:
+#
+# PATH=/parrot_install_directory/bin:$PATH
 # make
 
 # This assumes a posix environment with sh style shell.
 # May need changes with other shells or other make tools.
-# For MSVC use nmake -f Makefile.msvc
+# For MSVC use see nmake -f Makefile.msvc (may not be up-to-date)
 
 CC = $(shell parrot_config cc)
 CCFLAGS = $(shell parrot_config ccflags)
 LD = $(shell parrot_config ld)
 LD_OUT = $(shell parrot_config ld_out)
-LDFLAGS = $(shell parrot_config libparrot_ldflags)
+LINKFLAGS = $(shell parrot_config inst_libparrot_linkflags) $(shell parrot_config rpath_lib)
 O = $(shell parrot_config o)
 EXE = $(shell parrot_config exe)
-INCLUDEDIR = $(shell parrot_config prefix)/include
-CONFIG = $(shell parrot_config prefix)/src/parrot_config
 
-all: lorito$(EXE)
+VERSIONDIR = $(shell parrot_config versiondir)
+INCLUDEDIR = $(shell parrot_config includedir)$(VERSIONDIR)
+LIBDIR = $(shell parrot_config libdir)$(VERSIONDIR)
+CONFIG = $(LIBDIR)/parrot_config
+
+all: cotorra$(EXE)
 
 #-----------------------------------------------------------------------
 
-lorito$(O): lorito.c
-	$(CC) $(CCFLAGS) -c -I $(INCLUDEDIR) lorito.c
+cotorra$(O): cotorra.c
+	$(CC) $(CCFLAGS) -c -I $(INCLUDEDIR) cotorra.c
 
-lorito$(EXE): lorito$(O)
-	$(LD) $(LD_OUT)lorito$(EXE) lorito$(O) $(CONFIG)$(O) $(LDFLAGS)
+cotorra$(EXE): cotorra$(O)
+	$(LD) $(LD_OUT)cotorra$(EXE) cotorra$(O) $(CONFIG)$(O) $(LINKFLAGS)
 
 #-----------------------------------------------------------------------
 
 clean:
-	rm -f lorito$(EXE) lorito$(O)
+	rm -f cotorra$(EXE) cotorra$(O)

Modified: branches/orderedhash_revamp/examples/embed/Makefile.msvc
==============================================================================
--- branches/orderedhash_revamp/examples/embed/Makefile.msvc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/embed/Makefile.msvc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -17,17 +17,17 @@
 O 	= .obj
 EXE 	= .exe
 
-all: lorito$(EXE)
+all: cotorra$(EXE)
 
 #-----------------------------------------------------------------------
 
-lorito$(O): lorito.c
-	$(CC) $(CCFLAGS) -c -I $(INCLUDEDIR) lorito.c
+cotorra$(O): cotorra.c
+	$(CC) $(CCFLAGS) -c -I $(INCLUDEDIR) cotorra.c
 
-lorito$(EXE): lorito$(O)
-	$(LD) -out:lorito$(EXE) lorito$(O) $(LDFLAGS)
+cotorra$(EXE): cotorra$(O)
+	$(LD) -out:cotorra$(EXE) cotorra$(O) $(LDFLAGS)
 
 #-----------------------------------------------------------------------
 
 clean:
-	rm -f lorito$(EXE) lorito$(O)
+	rm -f cotorra$(EXE) cotorra$(O)

Added: branches/orderedhash_revamp/examples/embed/cotorra.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/examples/embed/cotorra.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,278 @@
+/*
+Copyright (C) 2009, Parrot Foundation.
+$Id$
+
+=head1 NAME
+
+cotorra - A parrot embedding test
+
+=head1 SYNOPSIS
+
+cotorra file.pbc
+
+=head1 DESCRIPTION
+
+A test of parrot embedding in a C program.
+
+Is a simplified form of the parrot main executable, with just a few
+options and able to run only pbc files.
+
+=cut
+
+*/
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "parrot/embed.h"
+#include "parrot/extend.h"
+
+/**********************************************************************/
+
+void fail(const char *msg);
+unsigned int getuintval(const char *s);
+Parrot_Run_core_t getruncore(const char *name);
+
+Parrot_String create_string(Parrot_Interp interp, const char *name);
+int cotorra_main(Parrot_Interp interp, int argc, char **argv);
+
+/**********************************************************************/
+
+/*
+
+=head2 Functions
+
+=over 4
+
+=cut
+
+*/
+
+/* Auxiliary generic functions */
+
+/*
+
+=item C<void fail(const char *msg)>
+
+Fatal error, print the msg to stderr and exit.
+
+=cut
+
+*/
+
+void fail(const char *msg)
+{
+    fprintf(stderr, "cotorra failed: %s\n", msg);
+    exit(EXIT_FAILURE);
+}
+
+/*
+
+=item C<unsigned int getuintval(const char *s)>
+
+Get an unsigned int value from a C string.
+Fails on invalid argument.
+
+=cut
+
+*/
+
+unsigned int getuintval(const char *s)
+{
+    char *aux;
+    unsigned long int n = strtoul(s, &aux, 0);
+    if (*aux != '\0')
+        fail("Invalid number");
+    return n;
+}
+
+struct runcoreinfo {
+    Parrot_Run_core_t id;
+    const char *name;
+};
+
+/*
+
+=item C<Parrot_Run_core_t getruncore(const char *name)>
+
+Get a runcore id from his name.
+Fails on invalid argument.
+
+=cut
+
+*/
+
+Parrot_Run_core_t getruncore(const char *name)
+{
+    static const struct runcoreinfo cores [] = {
+        { PARROT_SLOW_CORE,     "slow" },
+        { PARROT_FAST_CORE,     "fast" },
+        { PARROT_CGOTO_CORE,    "cgoto" },
+        { PARROT_GC_DEBUG_CORE, "gcdebug" },
+        { PARROT_SWITCH_CORE,   "switch" }
+    };
+    static const unsigned int n = sizeof (cores)/sizeof (struct runcoreinfo);
+    unsigned int i;
+    for (i= 0; i < n; ++i) {
+        if (strcmp(name, cores[i].name) == 0)
+            break;
+    }
+    if (i >= n)
+        fail("Invalid runcore");
+    return cores[i].id;
+}
+
+/**********************************************************************/
+
+/* Auxiliary parrot functions */
+
+/*
+
+=item C<Parrot_String create_string(Parrot_Interp interp, const char *name)>
+
+Auxiliary function to shorten Parrot String creation,
+
+=cut
+
+*/
+
+Parrot_String create_string(Parrot_Interp interp, const char *name)
+{
+    return Parrot_new_string(interp, name, strlen(name), (const char *) NULL, 0);
+}
+
+/**********************************************************************/
+
+/*
+
+=item C<int cotorra_main(Parrot_Interp interp, int argc, char **argv)>
+
+Auxiliary function to minimize the size of main.
+
+=cut
+
+*/
+
+int cotorra_main(Parrot_Interp interp, int argc, char **argv)
+{
+    char *source;
+    Parrot_PackFile pf;
+    const char *stname = NULL;
+    const char *exec = NULL;
+    int i;
+
+    /* Incompatible options are not checked yet */
+    for (i = 1; i < argc; ++i) {
+        if (strcmp(argv[i], "--trace") == 0) {
+            ++i;
+            if (i >= argc)
+                fail("Option needs argument");
+            Parrot_set_trace(interp, getuintval(argv[i]));
+        }
+        if (strcmp(argv[i], "--warnings") == 0) {
+            ++i;
+            if (i >= argc)
+                fail("Option needs argument");
+            Parrot_setwarnings(interp, getuintval(argv[i]));
+        }
+        else if (strcmp(argv[i], "-e") == 0) {
+            ++i;
+            if (i >= argc)
+                fail("Option needs argument");
+            exec = argv[i];
+        }
+        else if (strcmp(argv[i], "--start") == 0) {
+            ++i;
+            if (i >= argc)
+                fail("Option needs argument");
+            stname = argv[i];
+        }
+        else if (strcmp(argv[i], "--runcore") == 0) {
+            ++i;
+            if (i >= argc)
+                fail("Option needs argument");
+            Parrot_set_run_core(interp, getruncore(argv[i]));
+        }
+        else
+            break;
+    }
+
+    if (exec) {
+        Parrot_String compiler = create_string(interp, "PIR");
+        Parrot_String errstr;
+        Parrot_PMC code = Parrot_compile_string(interp, compiler, exec, &errstr);
+        void *discard = Parrot_call_sub(interp, code, "v");
+        return 0;
+    }
+
+    if (i >= argc)
+        fail("No file to load");
+    source = argv[i];
+
+    pf = Parrot_pbc_read(interp, source, 0);
+    if (! pf)
+        fail("Cannot load file");
+
+    Parrot_pbc_load(interp, pf);
+    Parrot_pbc_fixup_loaded(interp);
+
+    if (stname) {
+        Parrot_PMC rootns = Parrot_get_root_namespace(interp);
+        Parrot_String parrotname = create_string(interp, "parrot");
+        Parrot_PMC parrotns = Parrot_PMC_get_pmc_strkey(interp, rootns, parrotname);
+        Parrot_String name = create_string(interp, stname);
+        Parrot_PMC start = Parrot_PMC_get_pmc_strkey(interp, parrotns, name);
+        void *discard;
+        discard = Parrot_call_sub(interp, start, "v");
+    }
+    else {
+        Parrot_runcode(interp, argc - i, argv + i);
+    }
+
+    return 0;
+}
+
+/*
+
+=item C<int main(int argc, char **argv)>
+
+Main function. Create the parrot interpreter and call cotorra_main.
+
+=cut
+
+*/
+
+int main(int argc, char **argv)
+{
+    Parrot_Interp interp;
+    int r;
+
+    Parrot_set_config_hash();
+    interp = Parrot_new(NULL);
+    if (! interp)
+        fail("Cannot create parrot interpreter");
+
+    Parrot_set_executable_name(interp, create_string(interp, argv[0]));
+
+    r = cotorra_main(interp, argc, argv);
+
+    Parrot_destroy(interp);
+    return r;
+}
+
+/*
+
+=back
+
+=cut
+
+*/
+
+/*
+ * Local variables:
+ *   c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */

Deleted: branches/orderedhash_revamp/examples/embed/lorito.c
==============================================================================
--- branches/orderedhash_revamp/examples/embed/lorito.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,184 +0,0 @@
-/*
-Copyright (C) 2009, Parrot Foundation.
-$Id$
-
-A parrot embedding test
-'lorito' is 'little parrot' in spanish
-*/
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "parrot/embed.h"
-#include "parrot/extend.h"
-
-/**********************************************************************/
-
-void fail(const char *msg);
-unsigned int getuintval(const char *s);
-Parrot_Run_core_t getruncore(const char *name);
-
-Parrot_String create_string(Parrot_Interp interp, const char *name);
-int lorito_main(Parrot_Interp interp, int argc, char **argv);
-
-/**********************************************************************/
-
-/* Auxiliary generic functions */
-
-void fail(const char *msg)
-{
-    fprintf(stderr, "lorito failed: %s\n", msg);
-    exit(EXIT_FAILURE);
-}
-
-unsigned int getuintval(const char *s)
-{
-    char *aux;
-    unsigned long int n = strtoul(s, &aux, 0);
-    if (*aux != '\0')
-        fail("Invalid number");
-    return n;
-}
-
-struct runcoreinfo {
-    Parrot_Run_core_t id;
-    const char *name;
-};
-
-Parrot_Run_core_t getruncore(const char *name)
-{
-    static const struct runcoreinfo cores [] = {
-        { PARROT_SLOW_CORE,     "slow" },
-        { PARROT_FAST_CORE,     "fast" },
-        { PARROT_CGOTO_CORE,    "cgoto" },
-        { PARROT_JIT_CORE,      "jit" },
-        { PARROT_GC_DEBUG_CORE, "gcdebug" },
-        { PARROT_SWITCH_CORE,   "switch" }
-    };
-    static const unsigned int n = sizeof (cores)/sizeof (struct runcoreinfo);
-    unsigned int i;
-    for (i= 0; i < n; ++i) {
-        if (strcmp(name, cores[i].name) == 0)
-            break;
-    }
-    if (i >= n)
-        fail("Invalid runcore");
-    return cores[i].id;
-}
-
-/**********************************************************************/
-
-/* Auxiliary parrot functions */
-
-Parrot_String create_string(Parrot_Interp interp, const char *name)
-{
-    return Parrot_new_string(interp, name, strlen(name), (const char *) NULL, 0);
-}
-
-/**********************************************************************/
-
-int lorito_main(Parrot_Interp interp, int argc, char **argv)
-{
-    char *source;
-    Parrot_PackFile pf;
-    const char *stname = NULL;
-    const char *exec = NULL;
-    int i;
-
-    /* Incompatible options are not checked yet */
-    for (i = 1; i < argc; ++i) {
-        if (strcmp(argv[i], "--trace") == 0) {
-            ++i;
-            if (i >= argc)
-                fail("Option needs argument");
-            Parrot_set_trace(interp, getuintval(argv[i]));
-        }
-        if (strcmp(argv[i], "--warnings") == 0) {
-            ++i;
-            if (i >= argc)
-                fail("Option needs argument");
-            Parrot_setwarnings(interp, getuintval(argv[i]));
-        }
-        else if (strcmp(argv[i], "-e") == 0) {
-            ++i;
-            if (i >= argc)
-                fail("Option needs argument");
-            exec = argv[i];
-        }
-        else if (strcmp(argv[i], "--start") == 0) {
-            ++i;
-            if (i >= argc)
-                fail("Option needs argument");
-            stname = argv[i];
-        }
-        else if (strcmp(argv[i], "--runcore") == 0) {
-            ++i;
-            if (i >= argc)
-                fail("Option needs argument");
-            Parrot_set_run_core(interp, getruncore(argv[i]));
-        }
-        else
-            break;
-    }
-
-    if (exec) {
-        Parrot_String compiler = create_string(interp, "PIR");
-        Parrot_String errstr;
-        Parrot_PMC code = Parrot_compile_string(interp, compiler, exec, &errstr);
-        void *discard = Parrot_call_sub(interp, code, "v");
-        return 0;
-    }
-
-    if (i >= argc)
-        fail("No file to load");
-    source = argv[i];
-
-    pf = Parrot_pbc_read(interp, source, 0);
-    if (! pf)
-        fail("Cannot load file");
-
-    Parrot_pbc_load(interp, pf);
-    Parrot_pbc_fixup_loaded(interp);
-
-    if (stname) {
-        Parrot_PMC rootns = Parrot_get_root_namespace(interp);
-        Parrot_String parrotname = create_string(interp, "parrot");
-        Parrot_PMC parrotns = Parrot_PMC_get_pmc_strkey(interp, rootns, parrotname);
-        Parrot_String name = create_string(interp, stname);
-        Parrot_PMC start = Parrot_PMC_get_pmc_strkey(interp, parrotns, name);
-        void *discard;
-        discard = Parrot_call_sub(interp, start, "v");
-    }
-    else {
-        Parrot_runcode(interp, argc - i, argv + i);
-    }
-
-    return 0;
-}
-
-int main(int argc, char **argv)
-{
-    Parrot_Interp interp;
-    int r;
-
-    Parrot_set_config_hash();
-    interp = Parrot_new(NULL);
-    if (! interp)
-        fail("Cannot create parrot interpreter");
-
-    Parrot_set_executable_name(interp, create_string(interp, argv[0]));
-
-    r = lorito_main(interp, argc, argv);
-
-    Parrot_destroy(interp);
-    return r;
-}
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Modified: branches/orderedhash_revamp/examples/japh/japh3.pasm
==============================================================================
--- branches/orderedhash_revamp/examples/japh/japh3.pasm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/japh/japh3.pasm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -10,11 +10,8 @@
     substr S3, 5,  1, S2
     substr S3, 13, 1, S1
     substr S3, 20, 1, S0
-    set I3, 3
-    bsr I3
-    end
     print S3
-    ret
+    end
 
 # Local Variables:
 #   mode: pir

Modified: branches/orderedhash_revamp/examples/json/postalcodes.pir
==============================================================================
--- branches/orderedhash_revamp/examples/json/postalcodes.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/json/postalcodes.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -4,15 +4,15 @@
 
 =head1 NAME
 
-postalcodes.pir
+postalcodes.pir - Show info about a postal code
 
 =head1 SYNOPSIS
 
-    % ./parrot postalcodes.pir <postal>
+    % parrot postalcodes.pir <postal>
 
 =head1 DESCRIPTION
 
-Given a postal code (like, '06382'), print some information about various
+Given a postal code (e.g. '06382'), print some information about various
 places with that code from around the world.
 
 =cut
@@ -70,20 +70,19 @@
     $I0 = index json_result, "\r\n\r\n"
     substr json_result, 0, $I0, ""
 
-    load_bytecode 'compilers/json/JSON.pbc'
-    $P1 = compreg 'JSON'
-    $P2 = $P1(json_result)
-
-    $P3 = $P2['error']
-    unless null $P3 goto bad_code
-
-    $P2 = $P2['postalCodes']
-    .local pmc iter, code
-    iter = new 'Iterator', $P2
+    load_language 'data_json'
+    $P1 = compreg 'data_json'
+    push_eh bad_code
+    $P2 = $P1.'compile'(json_result)
+    pop_eh
+    $P3 = $P2()
+    $P4 = $P3['postalCodes']
+    .local pmc it, code
+    it = iter $P4
 
  code_loop:
     push_eh code_end
-      code = shift iter
+      code = shift it
     pop_eh
     unless code goto code_end
 
@@ -108,7 +107,7 @@
     .return()
 
 bad_code:
-    say $P3
+    say $P2
 .end
 
 # Local Variables:

Modified: branches/orderedhash_revamp/examples/json/test.pir
==============================================================================
--- branches/orderedhash_revamp/examples/json/test.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/json/test.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -3,28 +3,27 @@
 # $Id$
 
 .sub main :main
-  .param pmc argv
+   .param pmc argv
 
-  .local int argc
-  argc = elements argv
+   .local int argc
+   argc = elements argv
 
-  if argc != 2 goto bad_args
+   if argc != 2 goto bad_args
 
-  load_bytecode 'PGE.pbc'
-  load_bytecode 'PGE/Util.pbc'
-  load_bytecode 'compilers/json/JSON.pbc'
-
-  .local pmc JSON
-  JSON = compreg "JSON"
-  $S0 = argv[1]
-  $P1 = JSON($S0)
+   .local pmc    json, code, data
+   .local string text
+   load_language  'data_json'
+   json = compreg 'data_json'
+   text = argv[1]
+   code = json.'compile'(text)
+   data = code()
 
    load_bytecode 'dumper.pbc'
-   _dumper($P1, "JSON")
+   _dumper(data, 'JSON')
    end
 
   bad_args:
-   say "must specify a single arg."
+   say "Must specify a single arg."
    end
 .end
 

Deleted: branches/orderedhash_revamp/examples/languages/abc/Configure.pl
==============================================================================
--- branches/orderedhash_revamp/examples/languages/abc/Configure.pl	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,31 +0,0 @@
-# Copyright (C) 2009, Parrot Foundation.
-# $Id$
-
-use strict;
-use warnings;
-use 5.008;
-
-create_makefiles();
-
-sub create_makefiles {
-    my %makefiles = (
-        'config/makefiles/root.in' => 'Makefile',
-#        'config/makefiles/pmc.in'  => 'src/pmc/Makefile',
-#        'config/makefiles/ops.in'  => 'src/ops/Makefile',
-    );
-    my $build_tool = '../../../tools/dev/gen_makefile.pl';
-
-    foreach my $template (keys %makefiles) {
-        my $makefile = $makefiles{$template};
-        print "Creating $makefile\n";
-        system('perl', $build_tool, $template, $makefile);
-    }
-}
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
-

Modified: branches/orderedhash_revamp/examples/languages/abc/abc.pir
==============================================================================
--- branches/orderedhash_revamp/examples/languages/abc/abc.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/languages/abc/abc.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -24,20 +24,54 @@
 
 =cut
 
+.HLL 'abc'
+
+.sub '' :anon :load :init
+    load_bytecode 'PCT.pbc'
+    load_bytecode 'P6Regex.pbc'
+    load_bytecode 'nqp-rx.pbc'
+    .local pmc parrotns, hllns, exports
+    parrotns = get_root_namespace ['parrot']
+    hllns = get_hll_namespace
+    exports = split ' ', 'PAST PCT HLL NQP'
+    parrotns.'export_to'(hllns, exports)
+    .local pmc regexns
+    regexns = hllns.'make_namespace'('Regex')
+    $P0 = get_root_namespace ['parrot';'Regex';'Cursor']
+    regexns.'add_namespace'('Cursor', $P0)
+    $P0 = get_root_global ['parrot';'Regex'], 'Cursor'
+    regexns['Cursor'] = $P0
+    $P0 = get_root_namespace ['parrot';'Regex';'Match']
+    regexns.'add_namespace'('Match', $P0)
+    $P0 = get_root_global ['parrot';'Regex'], 'Match'
+    regexns['Match'] = $P0
+    $P0 = get_root_namespace ['parrot';'Regex';'P6Regex']
+    regexns.'add_namespace'('P6Regex', $P0)
+    $P0 = get_root_global ['parrot';'Regex'], 'P6Regex'
+    regexns['P6Regex'] = $P0
+.end
+
+.include 'src/gen_actions.pir'
+.include 'src/gen_grammar.pir'
+
 .namespace [ 'abc'; 'Compiler' ]
 
 .loadlib 'abc_group'
 
-.sub 'onload' :anon :load :init
-    load_bytecode 'PCT.pbc'
-
-    $P0 = get_hll_global ['PCT'], 'HLLCompiler'
-    $P1 = $P0.'new'()
-    $P1.'language'('abc')
-    $P1.'parsegrammar'('abc::Grammar')
-    $P1.'parseactions'('abc::Grammar::Actions')
+.sub '' :anon :load :init
+    .local pmc abc
+    $P0 = get_root_global ['parrot'], 'P6metaclass'
+    abc = $P0.'new_class'('abc::Compiler', 'parent'=>'HLL::Compiler')
+    abc.'language'('abc')
+    $P0 = get_hll_global ['abc'], 'Grammar'
+    abc.'parsegrammar'($P0)
+    $P0 = get_hll_global ['abc';'Grammar'], 'Actions'
+    abc.'parseactions'($P0)
 .end
 
+.namespace []
+.include 'src/builtins/all.pir'
+
 =item main(args :slurpy)  :main
 
 Start compilation by passing any command line C<args>
@@ -53,10 +87,6 @@
 .end
 
 
-.include 'src/gen_builtins.pir'
-.include 'src/gen_grammar.pir'
-.include 'src/gen_actions.pir'
-
 =back
 
 =head1 AUTHOR

Deleted: branches/orderedhash_revamp/examples/languages/abc/config/makefiles/root.in
==============================================================================
--- branches/orderedhash_revamp/examples/languages/abc/config/makefiles/root.in	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,171 +0,0 @@
-# Copyright (C) 2006-2009, Parrot Foundation.
-# $Id$
-
-## arguments we want to run parrot with
-PARROT_ARGS   :=
-
-## configuration settings
-VERSION       := @versiondir@
-BIN_DIR       := @bindir@
-LIB_DIR       := @libdir@$(VERSION)
-DOC_DIR       := @docdir@$(VERSION)
-MANDIR        := @mandir@$(VERSION)
-
-# Set up extensions
-LOAD_EXT      := @load_ext@
-O             := @o@
-
-# Various paths
-PERL6GRAMMAR  := @build_dir@/runtime/parrot/library/PGE/Perl6Grammar.pbc
-NQP           := @build_dir@/compilers/nqp/nqp.pbc
-PCT           := @build_dir@/runtime/parrot/library/PCT.pbc
-
-## Setup some commands
-MAKE          := @make_c@
-PERL          := @perl@
-CAT           := @cat@
-CHMOD         := @chmod@
-CP            := @cp@
-MKPATH        := @mkpath@
-RM_F          := @rm_f@
-RM_RF         := @rm_rf@
-POD2MAN       := pod2man
-#IF(parrot_is_shared and not(cygwin or win32)):export LD_RUN_PATH := @blib_dir@:$(LD_RUN_PATH)
-PARROT        := @build_dir@/parrot at exe@
-PBC_TO_EXE    := @build_dir@/pbc_to_exe at exe@
-#IF(darwin):
-#IF(darwin):# MACOSX_DEPLOYMENT_TARGET must be defined for OS X compilation/linking
-#IF(darwin):export MACOSX_DEPLOYMENT_TARGET := @osx_version@
-
-SOURCES := \
-  src/gen_grammar.pir \
-  src/gen_actions.pir \
-  src/gen_builtins.pir \
-  abc.pir
-
-BUILTINS_PIR := \
-  src/builtins/all.pir
-
-DOCS := README
-
-BUILD_CLEANUPS := \
-  abc.pbc \
-  "src/gen_*.pir" \
-  "*.c" \
-  "*$(O)" \
-  abc at exe@ \
-#IF(win32):  parrot-abc.exe \
-#IF(win32):  parrot-abc.iss \
-#IF(win32):  "setup-parrot-*.exe" \
-  installable_abc at exe@
-
-TEST_CLEANUPS := \
-  "t/*.pir" \
-  "t/*.out"
-
-# the default target
-build: abc.pbc
-
-all: build abc at exe@ installable
-
-abc.pbc: $(SOURCES)
-	$(PARROT) $(PARROT_ARGS) -o abc.pbc abc.pir
-
-abc at exe@: abc.pbc
-	$(PBC_TO_EXE) abc.pbc
-
-src/gen_grammar.pir: $(PERL6GRAMMAR) src/parser/grammar.pg src/parser/grammar-oper.pg
-	$(PARROT) $(PARROT_ARGS) $(PERL6GRAMMAR) \
-	    --output=src/gen_grammar.pir \
-	    src/parser/grammar.pg \
-	    src/parser/grammar-oper.pg
-
-src/gen_actions.pir: $(NQP) src/parser/actions.pm
-	$(PARROT) $(PARROT_ARGS) $(NQP) --output=src/gen_actions.pir \
-	    --target=pir src/parser/actions.pm
-
-src/gen_builtins.pir: $(BUILTINS_PIR)
-	$(CAT) $(BUILTINS_PIR) > src/gen_builtins.pir
-
-installable: installable_abc at exe@
-
-installable_abc at exe@: abc.pbc
-	$(PBC_TO_EXE) abc.pbc --install
-
-Makefile: config/makefiles/root.in
-	$(PERL) Configure.pl
-
-# This is a listing of all targets, that are meant to be called by users
-help:
-	@echo ""
-	@echo "Following targets are available for the user:"
-	@echo ""
-	@echo "  build:             abc.pbc"
-	@echo "                     This is the default."
-	@echo "  abc at exe@            Self-hosting binary not to be installed."
-	@echo "  all:               abc.pbc abc at exe@ installable"
-	@echo "  installable:       Create libs and self-hosting binaries to be installed."
-	@echo "  install:           Install the installable targets and docs."
-	@echo ""
-	@echo "Testing:"
-	@echo "  test:              Run the test suite."
-	@echo "  test-installable:  Test self-hosting targets."
-	@echo "  testclean:         Clean up test results."
-	@echo ""
-	@echo "Cleaning:"
-	@echo "  clean:             Basic cleaning up."
-	@echo "  realclean:         Removes also files generated by 'Configure.pl'"
-	@echo "  distclean:         Removes also anything built, in theory"
-	@echo ""
-	@echo "Misc:"
-	@echo "  help:              Print this help message."
-	@echo ""
-
-test: build
-	$(PERL) t/harness
-
-# basic run for missing libs
-test-installable: installable
-	echo "1" | ./installable_abc at exe@
-
-install: installable
-	$(CP) installable_abc at exe@ $(BIN_DIR)/parrot-abc at exe@
-	$(CHMOD) 0755 $(BIN_DIR)/parrot-abc at exe@
-	-$(MKPATH) $(LIB_DIR)/languages/abc
-	$(CP) abc.pbc $(LIB_DIR)/languages/abc/abc.pbc
-	-$(MKPATH) $(MANDIR)/man1
-	$(POD2MAN) abc.pir > $(MANDIR)/man1/parrot-abc.1
-	-$(MKPATH) $(DOC_DIR)/languages/abc
-	$(CP) $(DOCS) $(DOC_DIR)/languages/abc
-
-uninstall:
-	$(RM_F) $(BIN_DIR)/parrot-abc at exe@
-	$(RM_RF) $(LIB_DIR)/languages/abc
-	$(RM_F) $(MANDIR)/man1/parrot-abc.1
-	$(RM_RF) $(DOC_DIR)/languages/abc
-
-win32-inno-installer: installable
-	-$(MKPATH) man/man1
-	$(POD2MAN) abc.pir > man/man1/parrot-abc.1
-	-$(MKPATH) man/html
-	pod2html --infile abc.pir --outfile man/html/parrot-abc.html
-	$(CP) installable_abc at exe@ parrot-abc.exe
-	$(PERL) -I at build_dir@/lib @build_dir@/tools/dev/mk_inno_language.pl abc
-	iscc parrot-abc.iss
-
-testclean:
-	$(RM_F) $(TEST_CLEANUPS)
-
-clean:
-	$(RM_F) $(TEST_CLEANUPS) $(BUILD_CLEANUPS)
-
-realclean:
-	$(RM_F) $(TEST_CLEANUPS) $(BUILD_CLEANUPS) Makefile
-
-distclean: realclean
-
-# Local variables:
-#   mode: makefile
-# End:
-# vim: ft=make:
-

Added: branches/orderedhash_revamp/examples/languages/abc/setup.pir
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/examples/languages/abc/setup.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,74 @@
+#! ../../../parrot
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+setup.pir - Python distutils style
+
+=head1 DESCRIPTION
+
+No Configure step, no Makefile generated.
+
+See F<runtime/library/distutils.pir>.
+
+=head1 USAGE
+
+    $ parrot setup.pir
+    $ parrot setup.pir test
+    $ sudo parrot setup.pir install
+
+=cut
+
+.sub 'main' :main
+    .param pmc args
+    $S0 = shift args
+    load_bytecode 'distutils.pbc'
+
+    $P0 = new 'Hash'
+    $P0['name'] = 'abc'
+    $P0['abstract'] = 'a basic calculator'
+    $P0['description'] = 'This is an implementation of the basic calculator using the Parrot compiler tools.'
+    $P0['license_type'] = 'Artistic License 2.0'
+    $P0['license_uri'] = 'http://www.perlfoundation.org/artistic_license_2_0'
+    $P0['copyright_holder'] = 'Parrot Foundation'
+    $P0['checkout_uri'] = 'https://svn.parrot.org/parrot/trunk/examples/languages/abc'
+    $P0['browser_uri'] = 'http://trac.parrot.org/parrot/browser/trunk/examples/languages/abc'
+    $P0['project_uri'] = 'http://trac.parrot.org/parrot/browser/trunk/examples/languages/abc'
+
+    # build
+    $P1 = new 'Hash'
+    $P1['src/gen_grammar.pir'] = 'src/parser/grammar.nqp'
+    $P1['src/gen_actions.pir'] = 'src/parser/actions.nqp'
+    $P0['pir_nqp-rx'] = $P1
+
+    $P2 = new 'Hash'
+    $P3 = split "\n", <<'SOURCES'
+abc.pir
+src/gen_actions.pir
+src/gen_grammar.pir
+src/builtins/all.pir
+SOURCES
+    $S0 = pop $P3
+    $P2['abc.pbc'] = $P3
+    $P0['pbc_pir'] = $P2
+
+    $P4 = new 'Hash'
+    $P4['parrot-abc'] = 'abc.pbc'
+    $P0['exe_pbc'] = $P4
+    $P0['installable_pbc'] = $P4
+
+    # dist
+    $P4 = glob('t/abc_*')
+    $P0['manifest_includes'] = $P4
+    $P5 = split ' ', 'MAINTAINER README TODO'
+    $P0['doc_files'] = $P5
+
+    .tailcall setup(args :flat, $P0 :flat :named)
+.end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/examples/languages/abc/src/builtins/all.pir
==============================================================================
--- branches/orderedhash_revamp/examples/languages/abc/src/builtins/all.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/languages/abc/src/builtins/all.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -9,88 +9,34 @@
 
 .namespace []
 
-.sub 'infix:=='
-    .param pmc a
-    .param pmc b
-    $I0 = iseq a, b
-    .return ($I0)
-.end
-
-
-.sub 'infix:!='
-    .param pmc a
-    .param pmc b
-    $I0 = isne a, b
-    .return ($I0)
-.end
-
-
-.sub 'infix:<='
-    .param pmc a
-    .param pmc b
-    $I0 = isle a, b
-    .return ($I0)
-.end
-
-
-.sub 'infix:>='
-    .param pmc a
-    .param pmc b
-    $I0 = isge a, b
-    .return ($I0)
-.end
-
-
-.sub 'infix:<'
-    .param pmc a
-    .param pmc b
-    $I0 = islt a, b
-    .return ($I0)
-.end
-
-
-.sub 'infix:>'
-    .param pmc a
-    .param pmc b
-    $I0 = isgt a, b
-    .return ($I0)
-.end
-
-
-.sub 'prefix:++'
+.sub '&prefix:<++>'
     .param pmc n
     inc n
     .return (n)
 .end
 
-.sub 'prefix:--'
+.sub '&prefix:<-->'
     .param pmc n
     dec n
     .return (n)
 .end
 
-.sub 'postfix:++'
+
+.sub '&postfix:<++>'
     .param pmc n
     $P0 = clone n
     inc n
     .return ($P0)
 .end
 
-.sub 'postfix:--'
+.sub '&postfix:<-->'
     .param pmc n
     $P0 = clone n
     dec n
     .return ($P0)
 .end
 
-.sub 'infix:^'
-    .param num a
-    .param num b
-    $N0 = pow a, b
-    .return ($N0)
-.end
-
-.sub 'infix:&&'
+.sub '&infix:<&&>'
     .param pmc a
     .param pmc b
     $I0 = istrue a
@@ -99,7 +45,7 @@
     .return ($I0)
 .end
 
-.sub 'infix:||'
+.sub '&infix:<||>'
     .param pmc a
     .param pmc b
     $I0 = istrue a

Added: branches/orderedhash_revamp/examples/languages/abc/src/parser/actions.nqp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/examples/languages/abc/src/parser/actions.nqp	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,219 @@
+# Copyright (C) 2007, Parrot Foundation.
+# $Id$
+
+=begin overview
+
+abc::Grammar::Actions - ast transformations for abc
+
+This file contains the methods that are used by the parse
+grammar to build the PAST representation of an abc program.
+Each method below corresponds to a rule in F<grammar.pg>,
+and is invoked at the point where C<{*}> appears in the rule,
+with the current match object as the first argument.  If the
+line containing C<{*}> also has a C<#= key> comment, then the
+value of the comment is passed as the second argument to the
+method.
+
+Some hopefully helpful hints for reading this file:
+
+It often helps to refer to the rules in F<grammar.pg> when
+looking at the corresponding methods here.
+
+Within a method, C<< $<foo> >> refers to the named capture C<foo>
+within the C< $/ > match object.  Normally this is either another
+match object or an array of match objects.
+
+The C<make> function and C< .ast > are used to set and retrieve
+the I<result object> for a match.  Here, we use the result object
+to hold the ast representation of any given match.  So, in the
+code below, whenever you see an expression like C<< $<foo>.ast >>,
+we're really saying "the ast of C<< <foo> >>".
+
+=end overview
+
+class abc::Grammar::Actions is HLL::Actions;
+
+##  The ast of the entire program is the ast of the
+##  top-level <statement_list>.
+method TOP($/) {
+    make PAST::Block.new(
+        :blocktype('declaration'),
+        :hll('abc'),
+        $<statement_list>.ast);
+}
+
+
+##  statement_list:
+##    All of the individual statements are held in $<statement>
+##    (which is an array).  We start by creating an empty
+##    PAST::Stmts node, and then loop through all of the
+##    statements, adding the ast of each statement to the
+##    PAST::Stmts  node.
+method statement_list($/) {
+    my $past := PAST::Stmts.new( :node($/) );
+    for $<statement> {
+        $past.push( $_.ast );
+    }
+    make $past;
+}
+
+
+##  statement:
+##    In the parse grammar, we've set up $key to tell us the
+##    name of whatever subrule was matched by this statement.
+##    We can then use $key to quickly get the subrule's ast
+##    with $/{$key}.ast .
+##
+##    bc(1) expression statements also have special semantics
+##    which we handle here.  If a statement is an expression
+##    other than assignment, then the value of the expression
+##    is also assigned to the C<last> variable and the value
+##    printed with a newline.
+##    Similarly, if the statement consists of a simple string, it's
+##    displayed on the output.
+method statement:sym<expr>($/) {
+    my $past := $<EXPR>.ast;
+    if pir::typeof__sp($past) ne 'PAST::Op' && ~$past.name() ne '&infix:<=>' {
+        my $last := PAST::Var.new( :name('last'),
+                                   :scope('package'),
+                                   :lvalue(1) );
+        $past := PAST::Op.new( $last,
+                               $past,
+                               :pasttype('bind') );
+        #PAST::Var.new( :name('saynum'), :namespace([]), :scope('package')),
+        $past := PAST::Op.new( 
+                               $past,
+                               :name('saynum'),
+                               :pasttype('call') );
+    }
+    make $past;
+}
+
+
+##  if_statement:
+##    After parsing an if statement, the conditional
+##    expression will be in $<EXPR>, the "then"
+##    statement will be in $<statement>[0], and any
+##    "else" statement will be in $<statement>[1].
+##    So, we just obtain the asts of these subrule
+##    matches and set them as the children of a
+##    PAST::Op node with a pasttype of 'if'.
+method statement:sym<if>($/) {
+    my $past := PAST::Op.new( $<EXPR>.ast,
+                              $<statement>[0].ast,
+                              :pasttype('if'),
+                              :node( $/ ) );
+    if ( $<statement>[1] ) {
+        $past.push( $<statement>[1].ast );
+    }
+    make $past;
+}
+
+
+##  while_statement:
+##    This is basically the same as if_statement above, except
+##    we use a pasttype of 'while'.
+method statement:sym<while>($/) {
+    make PAST::Op.new( $<EXPR>.ast,
+                       $<statement>.ast,
+                       :pasttype('while'),
+                       :node($/) );
+}
+
+
+##  for_statement:
+##    A bc(1) for statement has the form
+##        for( expr0 ; expr1 ; expr2 ) body;
+##    We transform this into an ast structure that looks like
+##        expr0; while (expr1) { body; expr2; }
+method statement:sym<for>($/) {
+    my $past := PAST::Stmts.new( :node($/) );
+
+    #  add the initial "expr0;" node
+    $past.push( $<EXPR>[0].ast );
+
+    #  create the "{ body; expr2; }" part
+    my $body := PAST::Stmts.new( $<statement>.ast, $<EXPR>[2].ast );
+
+    #  now create the "while (expr1) { body; expr2; }" part
+    $past.push( PAST::Op.new( $<EXPR>[1].ast, $body, :pasttype('while')));
+
+    make $past;
+}
+
+
+##  compound_statement:
+##    A compound statement is just a list of statements, so we
+##    return the ast of its embedded <statement_list>.
+method statement:sym<compound>($/) {
+    make $<statement_list>.ast;
+}
+
+
+##  string:
+##    The <string_literal> subrule (inherited from PCT::Grammar)
+##    will have set its result object to the string representation
+##    of whatever literal we found.  So, we just use this as
+##    the value of a PAST::Val node.
+method statement:sym<string>($/) {
+    make PAST::Op.new(
+        $<quote_EXPR>.ast,
+        :pirop('print'));
+}
+
+
+
+
+##  float/integer:
+##    For floating point and integer constants, we simply create
+##    a PAST::Val node with the value of the constant.  But, because
+##    Parrot's Floats don't know how to properly stringify to ints,
+##    we have to use the string representation of the value
+##    and tell the compiler what type of value to return.
+method term:sym<float>($/) {
+    make PAST::Val.new( :value( ~$/ ), :returns('Float'), :node( $/ ) );
+}
+
+method term:sym<int>($/) {
+    make PAST::Val.new( :value( ~$/ ), :returns('Integer'), :node( $/ ) );
+}
+
+
+##  variable:
+##    The <variable> rule is used to match both simple
+##    variables ("a") and unary function calls ("a(0)").
+##    Once again, the $key tells us what sort of match we have.
+##
+##    If it's a simple variable, we create a PAST::Var node
+##    with the name of the variable and a scope of 'package'.
+##    The :viviself('Float') option says that this variable
+##    should be initialized as a Float if it doesn't already
+##    exist.
+##
+##    If it's a function call, we create a PAST::Op node
+##    to call the subroutine given by $<name> and passing
+##    the value of $<EXPR> as an argument.  The
+##    available subroutines are held in F<builtins.pir>.
+method term:sym<variable>($/) {
+    if ($<EXPR>) {
+        make PAST::Op.new( $<EXPR>[0].ast,
+                           :name( ~$<name> ),
+                           :pasttype('call'),
+                           :node( $/ )
+                         );
+    }
+    else {
+        make PAST::Var.new( :name( ~$<name> ),
+                            :scope('package'),
+                            :viviself('Float'),
+                            :lvalue(1),
+                            :node( $/ )
+                          );
+    }
+}
+
+method term:sym<circumfix>($/) {
+    make $<EXPR>.ast;
+}
+
+## vim: expandtab sw=4 ft=perl6

Deleted: branches/orderedhash_revamp/examples/languages/abc/src/parser/actions.pm
==============================================================================
--- branches/orderedhash_revamp/examples/languages/abc/src/parser/actions.pm	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,256 +0,0 @@
-# Copyright (C) 2007, Parrot Foundation.
-# $Id$
-
-=head1 NAME
-
-abc::Grammar::Actions - ast transformations for abc
-
-=head1 DESCRIPTION
-
-This file contains the methods that are used by the parse
-grammar to build the PAST representation of an abc program.
-Each method below corresponds to a rule in F<grammar.pg>,
-and is invoked at the point where C<{*}> appears in the rule,
-with the current match object as the first argument.  If the
-line containing C<{*}> also has a C<#= key> comment, then the
-value of the comment is passed as the second argument to the
-method.
-
-Some hopefully helpful hints for reading this file:
-
-=over 4
-
-=item
-
-It often helps to refer to the rules in F<grammar.pg> when
-looking at the corresponding methods here.
-
-=item
-
-Within a method, C<< $<foo> >> refers to the named capture C<foo>
-within the C< $/ > match object.  Normally this is either another
-match object or an array of match objects.
-
-=item
-
-The C<make> function and C< .ast > are used to set and retrieve
-the I<result object> for a match.  Here, we use the result object
-to hold the ast representation of any given match.  So, in the
-code below, whenever you see an expression like C<< $<foo>.ast >>,
-we're really saying "the ast of C<< <foo> >>".
-
-=back
-
-=cut
-
-class abc::Grammar::Actions;
-
-##  The ast of the entire program is the ast of the
-##  top-level <statement_list>.
-method TOP($/) {
-    make $<statement_list>.ast;
-}
-
-
-##  statement_list:
-##    All of the individual statements are held in $<statement>
-##    (which is an array).  We start by creating an empty
-##    PAST::Stmts node, and then loop through all of the
-##    statements, adding the ast of each statement to the
-##    PAST::Stmts  node.
-method statement_list($/) {
-    my $past := PAST::Stmts.new( :node($/) );
-    for $<statement> {
-        $past.push( $_.ast );
-    }
-    make $past;
-}
-
-
-##  statement:
-##    In the parse grammar, we've set up $key to tell us the
-##    name of whatever subrule was matched by this statement.
-##    We can then use $key to quickly get the subrule's ast
-##    with $/{$key}.ast .
-##
-##    bc(1) expression statements also have special semantics
-##    which we handle here.  If a statement is an expression
-##    other than assignment, then the value of the expression
-##    is also assigned to the C<last> variable and the value
-##    printed with a newline.
-##    Similarly, if the statement consists of a simple string, it's
-##    displayed on the output.
-method statement($/, $key) {
-    my $past := $/{$key}.ast;
-    if ($key eq 'expression' && ~$past.name() ne 'infix:=') {
-        my $last := PAST::Var.new( :name('last'),
-                                   :scope('package'),
-                                   :lvalue(1) );
-        $past := PAST::Op.new( $last,
-                               $past,
-                               :pasttype('bind') );
-        $past := PAST::Op.new( $past,
-                               :name('saynum'),
-                               :pasttype('call') );
-    }
-    if ($key eq 'string') {
-        $past := PAST::Op.new( $past, :pirop('print'));
-    }
-    make $past;
-}
-
-
-##  if_statement:
-##    After parsing an if statement, the conditional
-##    expression will be in $<expression>, the "then"
-##    statement will be in $<statement>[0], and any
-##    "else" statement will be in $<statement>[1].
-##    So, we just obtain the asts of these subrule
-##    matches and set them as the children of a
-##    PAST::Op node with a pasttype of 'if'.
-method if_statement($/) {
-    my $past := PAST::Op.new( $<expression>.ast,
-                              $<statement>[0].ast,
-                              :pasttype('if'),
-                              :node( $/ ) );
-    if ( $<statement>[1] ) {
-        $past.push( $<statement>[1].ast );
-    }
-    make $past;
-}
-
-
-##  while_statement:
-##    This is basically the same as if_statement above, except
-##    we use a pasttype of 'while'.
-method while_statement($/) {
-    make PAST::Op.new( $<expression>.ast,
-                       $<statement>.ast,
-                       :pasttype('while'),
-                       :node($/) );
-}
-
-
-##  for_statement:
-##    A bc(1) for statement has the form
-##        for( expr0 ; expr1 ; expr2 ) body;
-##    We transform this into an ast structure that looks like
-##        expr0; while (expr1) { body; expr2; }
-method for_statement($/) {
-    my $past := PAST::Stmts.new( :node($/) );
-
-    #  add the initial "expr0;" node
-    $past.push( $<expression>[0].ast );
-
-    #  create the "{ body; expr2; }" part
-    my $body := PAST::Stmts.new( $<statement>.ast, $<expression>[2].ast );
-
-    #  now create the "while (expr1) { body; expr2; }" part
-    $past.push( PAST::Op.new( $<expression>[1].ast, $body, :pasttype('while')));
-
-    make $past;
-}
-
-
-##  compound_statement:
-##    A compound statement is just a list of statements, so we
-##    return the ast of its embedded <statement_list>.
-method compound_statement($/) {
-    make $<statement_list>.ast;
-}
-
-
-##  string:
-##    The <string_literal> subrule (inherited from PCT::Grammar)
-##    will have set its result object to the string representation
-##    of whatever literal we found.  So, we just use this as
-##    the value of a PAST::Val node.
-method string($/) {
-    make PAST::Val.new( :value( ~$<string_literal> ), :node($/) );
-}
-
-
-##  expression:
-##    This is one of the more complex transformations, because
-##    our grammar is using the operator precedence parser here.
-##    As each node in the expression tree is reduced by the
-##    parser, it invokes this method with the operator node as
-##    the match object and a $key of 'reduce'.  We then build
-##    a PAST::Op node using the information provided by the
-##    operator node.  (Any traits for the node are held in $<top>.)
-##    Finally, when the entire expression is parsed, this method
-##    is invoked with the expression in $<expr> and a $key of 'end'.
-method expression($/, $key) {
-    if ($key eq 'end') {
-        make $<expr>.ast;
-    }
-    else {
-        my $past := PAST::Op.new( :name($<type>),
-                                  :pasttype($<top><pasttype>),
-                                  :pirop($<top><pirop>),
-                                  :lvalue($<top><lvalue>),
-                                  :node($/)
-                                );
-        for @($/) {
-            $past.push( $_.ast );
-        }
-        make $past;
-    }
-}
-
-
-##  term:
-##    Like 'statement' above, the $key has been set to let us know
-##    which term subrule was matched.
-method term($/, $key) {
-    make $/{$key}.ast;
-}
-
-##  float/integer:
-##    For floating point and integer constants, we simply create
-##    a PAST::Val node with the value of the constant.  But, because
-##    Parrot's Floats don't know how to properly stringify to ints,
-##    we have to use the string representation of the value
-##    and tell the compiler what type of value to return.
-method float($/) {
-    make PAST::Val.new( :value( ~$/ ), :returns('Float'), :node( $/ ) );
-}
-
-method integer($/) {
-    make PAST::Val.new( :value( ~$/ ), :returns('Integer'), :node( $/ ) );
-}
-
-
-##  variable:
-##    The <variable> rule is used to match both simple
-##    variables ("a") and unary function calls ("a(0)").
-##    Once again, the $key tells us what sort of match we have.
-##
-##    If it's a simple variable, we create a PAST::Var node
-##    with the name of the variable and a scope of 'package'.
-##    The :viviself('Float') option says that this variable
-##    should be initialized as a Float if it doesn't already
-##    exist.
-##
-##    If it's a function call, we create a PAST::Op node
-##    to call the subroutine given by $<name> and passing
-##    the value of $<expression> as an argument.  The
-##    available subroutines are held in F<builtins.pir>.
-method variable($/, $key) {
-    my $past;
-    if ($key eq 'var') {
-        $past := PAST::Var.new( :name( ~$<name> ),
-                                :scope('package'),
-                                :viviself('Float'),
-                                :node( $/ )
-                              );
-    }
-    if ($key eq 'call') {
-        $past := PAST::Op.new( $<expression>.ast,
-                               :name( ~$<name> ),
-                               :pasttype('call'),
-                               :node( $/ )
-                             );
-    }
-    make $past;
-}

Deleted: branches/orderedhash_revamp/examples/languages/abc/src/parser/grammar-oper.pg
==============================================================================
--- branches/orderedhash_revamp/examples/languages/abc/src/parser/grammar-oper.pg	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,66 +0,0 @@
-## terms
-proto 'term:'       is precedence('=')
-    is parsed(&term)
-    { ... }
-
-proto circumfix:<( )>  is equiv('term:')
-    is pirop('set')
-    { ... }
-
-## autoincrement
-proto postfix:<++>  is looser('term:')     is lvalue(1) { ... }
-proto postfix:<-->  is equiv(postfix:<++>) is lvalue(1) { ... }
-proto prefix:<++>   is equiv(postfix:<++>) is lvalue(1) { ... }
-proto prefix:<-->   is equiv(postfix:<++>) is lvalue(1) { ... }
-
-## negation
-proto prefix:<->    is looser(postfix:<++>)
-    is pirop('neg')
-    { ... }
-
-## exponentiation
-proto infix:<^>     is looser(prefix:<->)  { ... }
-
-## multiplicative
-proto infix:<*>     is looser(infix:<^>)
-    is pirop('mul')
-    { ... }
-
-proto infix:</>     is equiv(infix:<*>)
-    is pirop('div')
-    { ... }
-
-proto infix:<%>     is equiv(infix:<*>)
-    is pirop('mod')
-    { ... }
-
-## additive
-proto infix:<+>     is looser(infix:<*>)
-    is pirop('add')
-    { ... }
-
-proto infix:<->     is equiv(infix:<+>)
-    is pirop('sub')
-    { ... }
-
-## assignment
-proto infix:<=>     is looser(infix:<+>)
-    is assoc('right')
-    is pasttype('bind')
-    is lvalue(1)
-    { ... }
-
-## relational
-proto infix:<==>    is looser(infix:<=>)  is assoc('non')  { ... }
-proto infix:<!=>    is equiv(infix:<==>) { ... }
-proto infix:«<»     is equiv(infix:<==>) { ... }
-proto infix:«<=»    is equiv(infix:<==>) { ... }
-proto infix:«>»     is equiv(infix:<==>) { ... }
-proto infix:«>=»    is equiv(infix:<==>) { ... }
-
-## boolean
-proto prefix:<!>    is looser(infix:<==>) is pirop('not') { ... }
-proto infix:<&&>    is looser(prefix:<!>) is assoc('left') { ... }
-proto infix:<||>    is looser(infix:<&&>) is assoc('left') { ... }
-
-## vim: expandtab sw=4

Added: branches/orderedhash_revamp/examples/languages/abc/src/parser/grammar.nqp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/examples/languages/abc/src/parser/grammar.nqp	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,133 @@
+grammar abc::Grammar is HLL::Grammar;
+
+=begin overview
+
+The following is the grammar for abc written as a sequence of
+Perl 6 rules.  In each of the rules, the special notation {*}
+marks a point in the rule where the corresponding action in
+abc::Grammar::Actions is to be invoked (see grammar-actions.pl).
+These actions are then used to construct the ast nodes for
+the program.
+
+The #= markers at the ends of lines are used to distinguish
+among multiple {*} actions within a rule, by passing the value
+after the marker as a 'key' argument to the action method. Note
+that there must be space between the #= marker and the key.
+
+=end overview
+
+rule TOP {
+    ^ <statement_list>
+    [ $ || <panic: 'Syntax error'> ]
+}
+
+rule statement_list {
+    <statement>? [ ';' <statement>? ]*
+}
+
+proto token statement { <...> }
+    # 'break'
+    # 'continue'
+    # 'halt'
+    # 'return' [ '(' <EXPR> ')' ]?
+token statement:sym<expr> { <EXPR> }
+
+
+token statement:sym<if> {
+    <sym> :s '(' <EXPR> ')' <statement> [ 'else' <statement> ]?
+}
+
+
+token statement:sym<while> {
+    <sym> :s '(' <EXPR> ')' <statement>
+}
+
+
+token statement:sym<for> {
+    <sym> :s '(' <EXPR> ';' <EXPR> ';' <EXPR> ')' <statement>
+}
+
+
+token statement:sym<compound> {
+    :s '{' ~ '}' <statement_list>
+}
+
+
+token statement:sym<string> {
+    <.before \"> <quote_EXPR: ':q'>
+}
+
+
+## recognize terms
+
+proto token term { <...> }
+
+
+token term:sym<float> {
+    [
+    | \d+ '.' \d*
+    | '.' \d+
+    ]
+}
+
+token term:sym<int> { \d+ }
+
+token term:sym<variable> {
+    $<name>=[ <[a..z]> <[_a..z0..9]>* ]
+    [ '(' <EXPR> ')' ]?
+}
+
+token term:sym<circumfix> { '(' <.ws> <EXPR> ')' }
+
+# OPS
+
+## autoincrement
+token postfix:sym<++> { <sym> <O('%unary')> }
+token postfix:sym<--> { <sym> <O('%unary')> }
+token prefix:sym<++>  { <sym> <O('%unary')> }
+token prefix:sym<-->  { <sym> <O('%unary')> }
+
+## negation
+token prefix:sym<-> { <sym> <O('%unary, :pirop<neg>')> }
+
+## exponentiation
+token infix:sym<^> { <sym> <O('%exponentiation, :pirop<pow NN>')> }
+
+## multiplicative
+token infix:sym<*> { <sym> <O('%multiplicative, :pirop<mul>')> }
+token infix:sym</> { <sym> <O('%multiplicative, :pirop<div>')> }
+token infix:sym<%> { <sym> <O('%multiplicative, :pirop<mod>')> }
+
+## additive
+token infix:sym<+> { <sym> <O('%additive, :pirop<add>')> }
+token infix:sym<-> { <sym> <O('%additive, :pirop<sub>')> }
+
+## assignment
+token infix:sym<=> { <sym> <O('%assignment, :pasttype<bind>')> }
+
+## relational
+token infix:sym<==> { <sym> <O('%relational, :pirop<iseq INn>')> }
+token infix:sym<!=> { <sym> <O('%relational, :pirop<isne INn>')> }
+token infix:sym«<»  { <sym> <O('%relational, :pirop<islt INn>')> }
+token infix:sym«<=» { <sym> <O('%relational, :pirop<isle INn>')> }
+token infix:sym«>»  { <sym> <O('%relational, :pirop<isgt INn>')> }
+token infix:sym«>=» { <sym> <O('%relational, :pirop<isge INn>')> }
+
+## boolean
+token prefix:sym<!> { <sym> <O('%neg, :pirop<not>')> }
+token infix:sym<&&> { <sym> <O('%and')> }
+token infix:sym<||> { <sym> <O('%or')> }
+
+INIT {
+    NQP::Grammar.O(':prec<y=>, :assoc<unary>', '%unary');
+    NQP::Grammar.O(':prec<w=>, :assoc<left>',  '%exponentiation');
+    NQP::Grammar.O(':prec<u=>, :assoc<left>',  '%multiplicative');
+    NQP::Grammar.O(':prec<t=>, :assoc<left>',  '%additive');
+    NQP::Grammar.O(':prec<m=>, :assoc<right>', '%assignment');
+    NQP::Grammar.O(':prec<n=>, :assoc<non>',   '%relational');
+    NQP::Grammar.O(':prec<o=>, :assoc<unary>',  '%neg');
+    NQP::Grammar.O(':prec<p=>, :assoc<left>',  '%and');
+    NQP::Grammar.O(':prec<q=>, :assoc<left>',  '%or');
+}
+
+## vim: expandtab sw=4 ft=perl6

Deleted: branches/orderedhash_revamp/examples/languages/abc/src/parser/grammar.pg
==============================================================================
--- branches/orderedhash_revamp/examples/languages/abc/src/parser/grammar.pg	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,105 +0,0 @@
-grammar abc::Grammar is PCT::Grammar;
-
-=begin overview
-
-The following is the grammar for abc written as a sequence of
-Perl 6 rules.  In each of the rules, the special notation {*}
-marks a point in the rule where the corresponding action in
-abc::Grammar::Actions is to be invoked (see grammar-actions.pl).
-These actions are then used to construct the ast nodes for
-the program.
-
-The #= markers at the ends of lines are used to distinguish
-among multiple {*} actions within a rule, by passing the value
-after the marker as a 'key' argument to the action method. Note
-that there must be space between the #= marker and the key.
-
-=end overview
-
-rule TOP {
-    ^ <statement_list>
-    [ $ || <panic: 'Syntax error'> ]
-    {*}
-}
-
-rule statement_list {
-    <statement>? [ ';' <statement>? ]*
-    {*}
-}
-
-rule statement {
-    | <if_statement> {*}                       #= if_statement
-    | <while_statement> {*}                    #= while_statement
-    | <for_statement> {*}                      #= for_statement
-    | <compound_statement> {*}                 #= compound_statement
-    | <string> {*}                             #= string
-    # | 'break'
-    # | 'continue'
-    # | 'halt'
-    # | 'return' [ '(' <expression> ')' ]?
-    | <expression> {*}                           #= expression
-}
-
-
-rule if_statement {
-    'if' '(' <expression> ')' <statement> [ 'else' <statement> ]?
-    {*}
-}
-
-
-rule while_statement {
-    'while' '(' <expression> ')' <statement>
-    {*}
-}
-
-
-rule for_statement {
-    'for' '(' <expression> ';' <expression> ';' <expression> ')' <statement>
-    {*}
-}
-
-
-rule compound_statement {
-    '{' <statement_list> '}'
-    {*}
-}
-
-
-token string {
-    '"' <string_literal: '"'> '"'
-    {*}
-}
-
-
-## create operator precedence parser
-rule 'expression'   is optable { ... }
-
-## recognize terms
-token term {
-    | <float> {*}                                #= float
-    | <integer> {*}                              #= integer
-    | <variable> {*}                             #= variable
-}
-
-token float {
-    [
-    | \d+ '.' \d*
-    | '.' \d+
-    ]
-    {*}
-}
-
-token integer {
-    \d+
-    {*}
-}
-
-token variable {
-    $<name>=[ <[a..z]> <[_a..z0..9]>* ]
-    [ '(' <expression> ')' {*}                   #= call
-    | <.null> {*}                                #= var
-    ]
-}
-
-
-## vim: expandtab sw=4

Modified: branches/orderedhash_revamp/examples/languages/abc/t/01-tests.t
==============================================================================
--- branches/orderedhash_revamp/examples/languages/abc/t/01-tests.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/languages/abc/t/01-tests.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 #!perl
-# Copyright (C) 2001-2008, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
 use strict;
@@ -11,7 +11,7 @@
 
 =head1 NAME
 
-languages/abc/t/01-tests.t - test harness for Parrot abc
+examples/languages/abc/t/01-tests.t - test harness for Parrot abc
 
 =head1 DESCRIPTION
 
@@ -58,7 +58,7 @@
 
 =head1 SYNOPSIS
 
-$ prove languages/abc/t/01-tests.t
+$ prove examples/languages/abc/t/01-tests.t
 
 =cut
 

Deleted: branches/orderedhash_revamp/examples/languages/abc/t/harness
==============================================================================
--- branches/orderedhash_revamp/examples/languages/abc/t/harness	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,13 +0,0 @@
-#! perl
-
-# $Id$
-
-# pragmata
-use strict;
-use warnings;
-use 5.008;
-
-use lib qw( . lib ../lib ../../lib ../../../lib );
-
-use Parrot::Test::Harness language => 'abc',
-                          compiler => 'abc.pbc';

Deleted: branches/orderedhash_revamp/examples/languages/squaak/Configure.pl
==============================================================================
--- branches/orderedhash_revamp/examples/languages/squaak/Configure.pl	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,31 +0,0 @@
-# Copyright (C) 2009, Parrot Foundation.
-# $Id$
-
-use strict;
-use warnings;
-use 5.008;
-
-create_makefiles();
-
-sub create_makefiles {
-    my %makefiles = (
-        'config/makefiles/root.in' => 'Makefile',
-#        'config/makefiles/pmc.in'  => 'src/pmc/Makefile',
-#        'config/makefiles/ops.in'  => 'src/ops/Makefile',
-    );
-    my $build_tool = '../../../tools/dev/gen_makefile.pl';
-
-    foreach my $template (keys %makefiles) {
-        my $makefile = $makefiles{$template};
-        print "Creating $makefile\n";
-        system('perl', $build_tool, $template, $makefile);
-    }
-}
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
-

Deleted: branches/orderedhash_revamp/examples/languages/squaak/config/makefiles/root.in
==============================================================================
--- branches/orderedhash_revamp/examples/languages/squaak/config/makefiles/root.in	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,170 +0,0 @@
-# Copyright (C) 2008-2009, Parrot Foundation.
-## $Id$
-
-## arguments we want to run parrot with
-PARROT_ARGS   :=
-
-## configuration settings
-VERSION       := @versiondir@
-BIN_DIR       := @bindir@
-LIB_DIR       := @libdir@$(VERSION)
-DOC_DIR       := @docdir@$(VERSION)
-MANDIR        := @mandir@$(VERSION)
-
-# Set up extensions
-LOAD_EXT      := @load_ext@
-O             := @o@
-
-# Various paths
-PERL6GRAMMAR  := @build_dir@/runtime/parrot/library/PGE/Perl6Grammar.pbc
-NQP           := @build_dir@/compilers/nqp/nqp.pbc
-PCT           := @build_dir@/runtime/parrot/library/PCT.pbc
-
-## Setup some commands
-MAKE          := @make_c@
-PERL          := @perl@
-CAT           := @cat@
-CHMOD         := @chmod@
-CP            := @cp@
-MKPATH        := @mkpath@
-RM_F          := @rm_f@
-RM_RF         := @rm_rf@
-POD2MAN       := pod2man
-#IF(parrot_is_shared and not(cygwin or win32)):export LD_RUN_PATH := @blib_dir@:$(LD_RUN_PATH)
-PARROT        := @build_dir@/parrot at exe@
-PBC_TO_EXE    := @build_dir@/pbc_to_exe at exe@
-#IF(darwin):
-#IF(darwin):# MACOSX_DEPLOYMENT_TARGET must be defined for OS X compilation/linking
-#IF(darwin):export MACOSX_DEPLOYMENT_TARGET := @osx_version@
-
-
-
-SOURCES := \
-  src/gen_grammar.pir \
-  src/gen_actions.pir \
-  src/gen_builtins.pir \
-  squaak.pir
-
-BUILTINS_PIR := \
-  src/builtins/say.pir
-
-DOCS := README
-
-BUILD_CLEANUPS := \
-  squaak.pbc \
-  "src/gen_*.pir" \
-  "*.c" \
-  "*$(O)" \
-  squaak at exe@ \
-#IF(win32):  parrot-squaak.exe \
-#IF(win32):  parrot-squaak.iss \
-#IF(win32):  "setup-parrot-*.exe" \
-  installable_squaak at exe@
-
-TEST_CLEANUPS :=
-
-build: squaak.pbc
-
-all: build squaak at exe@ installable
-
-squaak.pbc: $(SOURCES)
-	$(PARROT) $(PARROT_ARGS) -o squaak.pbc squaak.pir
-
-squaak at exe@: squaak.pbc
-	$(PBC_TO_EXE) squaak.pbc
-
-src/gen_grammar.pir: $(PERL6GRAMMAR) src/parser/grammar.pg
-	$(PARROT) $(PARROT_ARGS) $(PERL6GRAMMAR) \
-	    --output=src/gen_grammar.pir \
-	    src/parser/grammar.pg
-
-src/gen_actions.pir: $(NQP) src/parser/actions.pm
-	$(PARROT) $(PARROT_ARGS) $(NQP) --output=src/gen_actions.pir \
-	    --target=pir src/parser/actions.pm
-
-src/gen_builtins.pir: $(BUILTINS_PIR)
-	$(CAT) $(BUILTINS_PIR) > src/gen_builtins.pir
-
-installable: installable_squaak at exe@
-
-installable_squaak at exe@: squaak.pbc
-	$(PBC_TO_EXE) squaak.pbc --install
-
-Makefile: config/makefiles/root.in
-	$(PERL) Configure.pl
-
-# This is a listing of all targets, that are meant to be called by users
-help:
-	@echo ""
-	@echo "Following targets are available for the user:"
-	@echo ""
-	@echo "  build:             squaak.pbc"
-	@echo "                     This is the default."
-	@echo "  squaak at exe@         Self-hosting binary not to be installed."
-	@echo "  all:               squaak.pbc squaak at exe@ installable"
-	@echo "  installable:       Create libs and self-hosting binaries to be installed."
-	@echo "  install:           Install the installable targets and docs."
-	@echo ""
-	@echo "Testing:"
-	@echo "  test:              Run the test suite."
-	@echo "  test-installable:  Test self-hosting targets."
-	@echo "  testclean:         Clean up test results."
-	@echo ""
-	@echo "Cleaning:"
-	@echo "  clean:             Basic cleaning up."
-	@echo "  realclean:         Removes also files generated by 'Configure.pl'"
-	@echo "  distclean:         Removes also anything built, in theory"
-	@echo ""
-	@echo "Misc:"
-	@echo "  help:              Print this help message."
-	@echo ""
-
-test: build
-	$(PERL) t/harness
-
-# basic run for missing libs
-test-installable: installable
-	echo "1" | ./installable_squaak at exe@
-
-install: installable
-	$(CP) installable_squaak at exe@ $(BIN_DIR)/parrot-squaak at exe@
-	$(CHMOD) 0755 $(BIN_DIR)/parrot-squaak at exe@
-	-$(MKPATH) $(LIB_DIR)/languages/squaak
-	$(CP) squaak.pbc $(LIB_DIR)/languages/squaak/squaak.pbc
-	-$(MKPATH) $(MANDIR)/man1
-	$(POD2MAN) squaak.pir > $(MANDIR)/man1/parrot-squaak.1
-	-$(MKPATH) $(DOC_DIR)/languages/squaak
-	$(CP) $(DOCS) $(DOC_DIR)/languages/squaak
-	$(CP) doc/*.pod $(DOC_DIR)/languages/squaak
-
-uninstall:
-	$(RM_F) $(BIN_DIR)/parrot-squaak at exe@
-	$(RM_RF) $(LIB_DIR)/languages/squaak
-	$(RM_F) $(MANDIR)/man1/parrot-squaak.1
-	$(RM_RF) $(DOC_DIR)/languages/squaak
-
-win32-inno-installer: installable
-	-$(MKPATH) man/man1
-	$(POD2MAN) squaak.pir > man/man1/parrot-squaak.1
-	-$(MKPATH) man/html
-	pod2html --infile squaak.pir --outfile man/html/parrot-squaak.html
-	$(CP) installable_squaak at exe@ parrot-squaak.exe
-	$(PERL) -I at build_dir@/lib @build_dir@/tools/dev/mk_inno_language.pl squaak
-	iscc parrot-squaak.iss
-
-testclean:
-	$(RM_F) $(TEST_CLEANUPS)
-
-clean:
-	$(RM_F) $(TEST_CLEANUPS) $(BUILD_CLEANUPS)
-
-realclean:
-	$(RM_F) $(TEST_CLEANUPS) $(BUILD_CLEANUPS) Makefile
-
-distclean: realclean
-
-# Local variables:
-#   mode: makefile
-# End:
-# vim: ft=make:
-

Added: branches/orderedhash_revamp/examples/languages/squaak/setup.pir
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/examples/languages/squaak/setup.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,82 @@
+#! ../../../parrot
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+setup.pir - Python distutils style
+
+=head1 DESCRIPTION
+
+No Configure step, no Makefile generated.
+
+See F<runtime/library/distutils.pir>.
+
+=head1 USAGE
+
+    $ parrot setup.pir
+    $ parrot setup.pir test
+    $ sudo parrot setup.pir install
+
+=cut
+
+.sub 'main' :main
+    .param pmc args
+    $S0 = shift args
+    load_bytecode 'distutils.pbc'
+
+    $P0 = new 'Hash'
+    $P0['name'] = 'Squaak'
+    $P0['abstract'] = 'Squaak is a case-study language'
+    $P0['description'] = 'Squaak is a case-study language'
+    $P0['license_type'] = 'Artistic License 2.0'
+    $P0['license_uri'] = 'http://www.perlfoundation.org/artistic_license_2_0'
+    $P0['copyright_holder'] = 'Parrot Foundation'
+    $P0['checkout_uri'] = 'https://svn.parrot.org/parrot/trunk/examples/languages/squaak'
+    $P0['browser_uri'] = 'http://trac.parrot.org/parrot/browser/trunk/examples/languages/squaak'
+    $P0['project_uri'] = 'http://trac.parrot.org/parrot/browser/trunk/examples/languages/squaak'
+
+    # build
+    $P1 = new 'Hash'
+    $P1['src/gen_grammar.pir'] = 'src/parser/grammar.pg'
+    $P0['pir_pge'] = $P1
+
+    $P2 = new 'Hash'
+    $P2['src/gen_actions.pir'] = 'src/parser/actions.pm'
+    $P0['pir_nqp'] = $P2
+
+    $P3 = new 'Hash'
+    $P4 = split "\n", <<'SOURCES'
+squaak.pir
+src/gen_actions.pir
+src/gen_grammar.pir
+src/builtins/say.pir
+SOURCES
+    $S0 = pop $P4
+    $P3['squaak.pbc'] = $P4
+    $P0['pbc_pir'] = $P3
+
+    $P5 = new 'Hash'
+    $P5['parrot-squaak'] = 'squaak.pbc'
+    $P0['exe_pbc'] = $P5
+    $P0['installable_pbc'] = $P5
+
+    # test
+    $S0 = get_parrot()
+    $S0 .= ' squaak.pbc'
+    $P0['prove_exec'] = $S0
+
+    # dist
+    $P6 = glob('doc/*.pod examples/*.sq')
+    $P0['manifest_includes'] = $P6
+    $P5 = split ' ', 'MAINTAINER README'
+    $P0['doc_files'] = $P5
+
+    .tailcall setup(args :flat, $P0 :flat :named)
+.end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/examples/languages/squaak/squaak.pir
==============================================================================
--- branches/orderedhash_revamp/examples/languages/squaak/squaak.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/languages/squaak/squaak.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -57,7 +57,7 @@
 .end
 
 
-.include 'src/gen_builtins.pir'
+.include 'src/builtins/say.pir'
 .include 'src/gen_grammar.pir'
 .include 'src/gen_actions.pir'
 

Modified: branches/orderedhash_revamp/examples/languages/squaak/src/builtins/say.pir
==============================================================================
--- branches/orderedhash_revamp/examples/languages/squaak/src/builtins/say.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/languages/squaak/src/builtins/say.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -12,11 +12,11 @@
 
 .sub 'print'
     .param pmc args            :slurpy
-    .local pmc iter
-    iter = new 'Iterator', args
+    .local pmc it
+    it = iter args
   iter_loop:
-    unless iter goto iter_end
-    $P0 = shift iter
+    unless it goto iter_end
+    $P0 = shift it
     print $P0
     goto iter_loop
   iter_end:

Deleted: branches/orderedhash_revamp/examples/languages/squaak/t/harness
==============================================================================
--- branches/orderedhash_revamp/examples/languages/squaak/t/harness	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,8 +0,0 @@
-#! perl
-
-# $Id$
-
-use FindBin;
-use lib qw( . lib ../lib ../../../lib );
-use Parrot::Test::Harness language => 'Squaak',
-                          exec => ['../../../parrot', 'squaak.pbc'];

Modified: branches/orderedhash_revamp/examples/library/getopt_demo.pir
==============================================================================
--- branches/orderedhash_revamp/examples/library/getopt_demo.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/library/getopt_demo.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -37,7 +37,7 @@
 
   # Specification of command line arguments.
   .local pmc getopts
-  getopts = new "Getopt::Obj"
+  getopts = new ["Getopt";"Obj"]
   # getopts."notOptStop"(1)
 
   # --version, boolean

Deleted: branches/orderedhash_revamp/examples/nci/Mysql.pir
==============================================================================
--- branches/orderedhash_revamp/examples/nci/Mysql.pir	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,573 +0,0 @@
-# Copyright (C) 2008, Parrot Foundation.
-# $Id$
-
-=head1 TITLE
-
-Mysql.pir - Test NCI with mysqlclient
-
-=head1 SYNOPSIS
-
-Object oriented module for mysql client.
-
-This module closely follow the mysql C API.
-
-This is an initial version, be careful and not expect too much.
-
-=cut
-
-.include 'datatypes.pasm'
-
-########################################################################
-
-.namespace ['Mysql']
-
-#-----------------------------------------------------------------------
-.sub initialize :load :init :anon
-
-######## Class creation
-
-    .local pmc mysqlclass
-    mysqlclass = newclass ['Mysql']
-    addattribute mysqlclass, 'mysql'
-
-    .local pmc stmtclass
-    stmtclass = newclass ['Mysql'; 'Statement']
-    addattribute stmtclass, 'stmt'
-
-    .local pmc resultclass
-    resultclass = newclass ['Mysql'; 'Result']
-    addattribute resultclass, 'mysql'
-    addattribute resultclass, 'result'
-    addattribute resultclass, 'desc'
-    addattribute resultclass, 'fields'
-
-    .local pmc rowclass
-    rowclass = newclass ['Mysql';'Row']
-    addattribute rowclass, 'data'
-
-######## Export common subs to class namespaces
-
-    .local pmc explist
-    explist = new 'ResizablePMCArray'
-    explist [0] = 'get_mysql_handle'
-    explist [1] = 'get_mysql_function'
-
-    .local pmc ns, nsresult, nsstmt
-    ns = get_namespace
-    nsresult = get_namespace ['Result']
-    ns.'export_to'(nsresult, explist)
-    nsstmt = get_namespace ['Statement']
-    ns.'export_to'(nsstmt, explist)
-.end
-
-#-----------------------------------------------------------------------
-.sub fail
-    .param string msg
-    new $P0, 'Exception'
-    new $P1, 'String'
-    set $P1, msg
-    setattribute $P0, 'message', $P1
-    throw $P0
-    # Just in case...
-    exit 1
-.end
-
-#-----------------------------------------------------------------------
-.sub get_mysql_handle
-    .local pmc clientlib
-    clientlib = get_global 'clientlib'
-    $I0 = defined clientlib
-    if $I0 goto haslib
-    clientlib = loadlib 'libmysqlclient'
-    $I0 = defined clientlib
-    if $I0 goto libloaded
-    fail('Cannot load mysql client lib')
-libloaded:
-    set_global 'clientlib', clientlib
-haslib:
-    .return(clientlib)
-.end
-
-#-----------------------------------------------------------------------
-.sub get_mysql_function
-    .param string name
-    .param string signature
-
-    .local pmc handle
-    handle = get_mysql_handle()
-    .local pmc func
-# Check if already stored
-    func = get_global name
-    $I0 = defined func
-    if $I0 goto done
-# Get from library
-    func = dlfunc handle, name, signature
-# And store for later usage
-    set_global name, func
-done:
-    .return(func)
-.end
-
-#-----------------------------------------------------------------------
-.sub get_client_info
-    .local pmc func
-    func = get_mysql_function('mysql_get_client_info', 'tv')
-    $S0 = func()
-    .return($S0)
-.end
-
-#-----------------------------------------------------------------------
-.sub 'new'
-    .local pmc mysql
-    mysql = new ['Mysql']
-    .return(mysql)
-.end
-
-#-----------------------------------------------------------------------
-.sub init :vtable
-    .local pmc mysql_init
-    mysql_init = get_mysql_function('mysql_init', 'pp')
-
-    .local pmc mysql
-    $P0 = null
-    mysql = mysql_init($P0)
-    setattribute self, 'mysql', mysql
-#    say 'Hello, Mysql'
-.end
-
-#-----------------------------------------------------------------------
-.sub error :method
-    .local pmc mysql_error
-    mysql_error = get_mysql_function('mysql_error', 'tp')
-    .local pmc mysql
-    mysql = getattribute self, 'mysql'
-    $S0 = mysql_error(mysql)
-    .return($S0)
-.end
-
-#-----------------------------------------------------------------------
-.sub connect :method
-    .param string host
-    .param string user
-    .param string pass
-    .param string database
-
-    .local pmc mysql_real_connect
-    mysql_real_connect = get_mysql_function('mysql_real_connect', 'ppttttitl')
-    .local pmc mysql
-    mysql = getattribute self, 'mysql'
-    .local pmc result
-    $S0 = null
-    result = mysql_real_connect(mysql, host, user, pass, database, 0, $S0, 0)
-    $I0 = defined result
-    if $I0 goto good
-    print 'Connection failed: '
-    $S0 = self.'error'()
-    say $S0
-    exit 0
-good:
-.end
-
-#-----------------------------------------------------------------------
-.sub escape_string :method
-    .param string from
-# This is a quick and dirty implementation for initial testing
-# Escape all chars mentioned in mysql docs, ignoring charset
-# and encoding issues.
-
-    .local string to
-    clone to, from
-
-    .local int i
-    .local string escaped
-    .local string toescape
-    escaped = '\\'
-    i = 0
-nstep1:
-    i = index to, '\', i
-    eq i, -1, step2
-    $S0 = substr to, 0, i
-    inc i
-    $S1 = substr to, i
-    inc i
-    concat $S0, escaped
-    concat to, $S0, $S1
-    goto nstep1
-step2:
-    i = 0
-    escaped = "\'"
-nstep2:
-    i = index to, "'", i
-    eq i, -1, step3
-    $S0 = substr to, 0, i
-    inc i
-    $S1 = substr to, i
-    inc i
-    concat $S0, escaped
-    concat to, $S0, $S1
-    goto nstep2
-step3:
-    i = 0
-    escaped = '\"'
-nstep3:
-    i = index to, '"', i
-    eq i, -1, step4
-    $S0 = substr to, 0, i
-    inc i
-    $S1 = substr to, i
-    inc i
-    concat $S0, escaped
-    concat to, $S0, $S1
-    goto nstep3
-step4:
-    i = 0
-    escaped = "\\n"
-    toescape = chr 10
-    print '"'
-    print toescape
-    say '"'
-nstep4:
-    i = index to, toescape, i
-    eq i, -1, step5
-    $S0 = substr to, 0, i
-    inc i
-    $S1 = substr to, i
-    inc i
-    concat $S0, escaped
-    concat to, $S0, $S1
-    goto nstep4
-step5:
-    i = 0
-    escaped = "\\r"
-    toescape = chr 13
-    print '"'
-    print toescape
-    say '"'
-nstep5:
-    i = index to, toescape, i
-    eq i, -1, step6
-    $S0 = substr to, 0, i
-    inc i
-    $S1 = substr to, i
-    inc i
-    concat $S0, escaped
-    concat to, $S0, $S1
-    goto nstep5
-step6:
-    i = 0
-    escaped = "\\0"
-    toescape = chr 0
-    print '"'
-    print toescape
-    say '"'
-nstep6:
-    i = index to, toescape, i
-    eq i, -1, step7
-    $S0 = substr to, 0, i
-    inc i
-    $S1 = substr to, i
-    inc i
-    concat $S0, escaped
-    concat to, $S0, $S1
-    goto nstep6
-step7:
-    i = 0
-    escaped = "\\Z"
-    toescape = chr 26
-    print '"'
-    print toescape
-    say '"'
-nstep7:
-    i = index to, toescape, i
-    eq i, -1, step8
-    $S0 = substr to, 0, i
-    inc i
-    $S1 = substr to, i
-    inc i
-    concat $S0, escaped
-    concat to, $S0, $S1
-    goto nstep7
-step8:
-
-    .return(to)
-.end
-
-#-----------------------------------------------------------------------
-.sub query :method
-    .param string stmt
-
-    .local pmc mysql_query
-    mysql_query = get_mysql_function('mysql_query', 'ipt')
-    .local pmc mysql
-    mysql = getattribute self, 'mysql'
-    mysql_query(mysql, stmt)
-
-    $S0 = self.'error'()
-    unless $S0 goto done
-    say $S0
-    exit 1
-done:
-.end
-
-#-----------------------------------------------------------------------
-.sub store_result :method
-    .local pmc mysql_store_result
-    mysql_store_result = get_mysql_function('mysql_store_result', 'pp')
-    .local pmc mysql
-    mysql = getattribute self, 'mysql'
-    .local pmc r
-    r = mysql_store_result(mysql)
-
-    .local pmc args
-    args = new 'Hash'
-    args ['mysql'] = mysql
-    args ['result'] = r
-
-    .local pmc res
-    res = new ['Mysql';'Result'], args
-    .return(res)
-.end
-
-#-----------------------------------------------------------------------
-.sub use_result :method
-    .local pmc mysql_use_result
-    mysql_use_result = get_mysql_function('mysql_use_result', 'pp')
-    .local pmc mysql
-    mysql = getattribute self, 'mysql'
-    .local pmc r
-    r = mysql_use_result(mysql)
-
-    .local pmc args
-    args = new 'Hash'
-    args ['mysql'] = mysql
-    args ['result'] = r
-
-    .local pmc res
-    res = new ['Mysql';'Result'], args
-    .return(res)
-.end
-
-#-----------------------------------------------------------------------
-.sub prepare :method
-    .param string stmt_str
-
-    say stmt_str
-    .local pmc mysql
-    mysql = getattribute self, 'mysql'
-    .local pmc mysql_stmt_init
-    mysql_stmt_init = get_mysql_function('mysql_stmt_init', 'pp')
-    .local pmc stmt
-    stmt = mysql_stmt_init(mysql)
-    .local pmc mysql_stmt_prepare
-    mysql_stmt_prepare = get_mysql_function('mysql_stmt_prepare', 'ipti')
-    $I0 = bytelength stmt_str
-    $I1 = mysql_stmt_prepare(stmt, stmt_str, $I0)
-
-    .local pmc args
-    args = new 'Hash'
-    args['stmt'] = stmt
-    .local pmc stmtobj
-    stmtobj = new ['Mysql';'Statement'], args
-    .return(stmtobj)
-.end
-
-########################################################################
-
-.namespace ['Mysql';'Statement']
-
-#-----------------------------------------------------------------------
-.sub param_count :method
-    .local pmc stmt
-    stmt = getattribute self, 'stmt'
-    .local pmc mysql_stmt_param_count
-    mysql_stmt_param_count = get_mysql_function('mysql_stmt_param_count', 'lp')
-    $I0 = mysql_stmt_param_count(stmt)
-    .return($I0)
-.end
-
-#-----------------------------------------------------------------------
-.sub close :method
-    .local pmc stmt
-    stmt = getattribute self, 'stmt'
-    .local pmc mysql_stmt_close
-    mysql_stmt_close = get_mysql_function('mysql_stmt_close', 'ip')
-    $I0 = mysql_stmt_close(stmt)
-    null stmt
-    setattribute self, 'stmt', stmt
-    .return($I0)
-.end
-
-########################################################################
-
-.namespace ['Mysql';'Result']
-
-#-----------------------------------------------------------------------
-.sub init_pmc :vtable
-    .param pmc mysql :named
-    .param pmc r :named
-
-#    say 'Result init'
-
-    .local pmc field_count
-    field_count = get_mysql_function('mysql_field_count', 'ip')
-    .local pmc mysql
-    mysql = getattribute self, 'mysql'
-    .local int fields
-    fields = field_count(mysql)
-
-    .local pmc desc
-    desc = new 'FixedIntegerArray'
-    $I0 = 3
-    mul $I0, fields
-    set desc, $I0
-    $I1 = 0
-    $I2 = 0
-nextcol:
-    desc [$I2] = .DATATYPE_CSTR
-    inc $I2
-    desc [$I2] = 1
-    inc $I2
-    desc [$I2] = 0
-    inc $I2
-    inc $I1
-    ne $I1, fields, nextcol
-    setattribute self, 'desc', desc
-.end
-
-#-----------------------------------------------------------------------
-.sub destroy :vtable
-    self.'free'()
-.end
-
-#-----------------------------------------------------------------------
-.sub free :method
-    .local pmc r
-    r = getattribute self, 'result'
-    $I0 = defined r
-    unless $I0 goto done
-    .local pmc free_result
-    free_result = get_mysql_function('mysql_free_result', 'vp')
-    free_result(r)
-    null r
-    setattribute self, 'result', r
-done:
-.end
-
-#-----------------------------------------------------------------------
-.sub field_count :method
-    .local pmc field_count
-    field_count = get_mysql_function('mysql_field_count', 'ip')
-    .local pmc mysql
-    mysql = getattribute self, 'mysql'
-    .local int fields
-    fields = field_count(mysql)
-    .return(fields)
-.end
-
-#-----------------------------------------------------------------------
-.sub fetch_row :method
-
-    .local pmc rowres
-    .local pmc r
-    r = getattribute self, 'result'
-    $I0 = defined r
-    unless $I0 goto nomore
-
-    .local pmc res
-    .local pmc fetch_row
-    fetch_row = get_mysql_function('mysql_fetch_row', 'pp')
-    .local pmc row
-    row = fetch_row(r)
-    $I0 = defined row
-    unless $I0 goto nomore
-
-    .local pmc desc
-    desc = getattribute self, 'desc'
-    assign row, desc
-
-    .local int fields
-    fields = desc
-    div fields, 3
-#    say fields
-    $I0 = 0
-    res = new 'FixedStringArray'
-    set res, fields
-nextcol:
-#    say $I0
-    $S0 = row [$I0]
-    res [$I0] = $S0
-    inc $I0
-    eq $I0, fields, endrow
-    goto nextcol
-endrow:
-
-    .local pmc args
-    args = new 'Hash'
-    args ['data'] = res
-    rowres = new ['Mysql';'Row'], args
-    .return(rowres)
-nomore:
-    rowres = new 'Undef'
-    .return(rowres)
-.end
-
-########################################################################
-
-.namespace ['Mysql';'Row']
-
-#-----------------------------------------------------------------------
-.sub get_integer :vtable
-    .local pmc data
-    data = getattribute self, 'data'
-    $I0 = data
-    .return($I0)
-.end
-
-.sub get_number :vtable
-    .local pmc data
-    data = getattribute self, 'data'
-    $I0 = data
-    $N0 = $I0
-    .return($N0)
-.end
-
-.sub get_string_keyed :vtable
-    .param int n
-
-    .local pmc data
-    data = getattribute self, 'data'
-    $S0 = data [n]
-    .return($S0)
-.end
-
-.sub get_pmc_keyed :vtable
-    .param int n
-
-    .local pmc data
-    data = getattribute self, 'data'
-    $S0 = data [n]
-    $P0 = new 'String'
-    $P0 = $S0
-    .return($P0)
-.end
-
-.sub get :method
-    .param int n
-
-    $P0 = self[n]
-    .return($P0)
-.end
-
-.sub elems :method
-    .local pmc data
-    data = getattribute self, 'data'
-    $I0 = data
-    .return($I0)
-.end
-
-#-----------------------------------------------------------------------
-# Local Variables:
-#   mode: pir
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/examples/nci/Xlib.pir
==============================================================================
--- branches/orderedhash_revamp/examples/nci/Xlib.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/nci/Xlib.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -63,9 +63,17 @@
 # Load library and store handler
     xlib = loadlib 'libX11'
     $I0 = defined xlib
-    unless $I0 goto cygwin
+    unless $I0 goto check2
     if xlib goto store
-cygwin:
+check2:
+    xlib = loadlib 'libX11.so'
+    unless $I0 goto check3
+    if xlib goto store
+check3:
+    xlib = loadlib 'libX11.so.6'
+    unless $I0 goto check4
+    if xlib goto store
+check4:
     xlib = loadlib 'cygX11-6'
     $I0 = defined xlib
     unless $I0 goto failed
@@ -934,6 +942,23 @@
 .end
 
 #-----------------------------------------------------------------------
+.sub ClearArea :method
+    .param int x
+    .param int y
+    .param int width
+    .param int height
+    .param int exposures
+    .local pmc xdisp
+    xdisp = self.'getdisplay'()
+    .local pmc xwin
+    xwin = getattribute self, attr_XWindow
+    .local pmc func
+    func = get_xlib_function('XClearArea', 'ippiiiii')
+    $I0 = func(xdisp, xwin, x, y, width, height, exposures)
+    .return($I0)
+.end
+
+#-----------------------------------------------------------------------
 .sub StoreName :method
     .param string name
 

Deleted: branches/orderedhash_revamp/examples/nci/mysqltest.p6
==============================================================================
--- branches/orderedhash_revamp/examples/nci/mysqltest.p6	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,71 +0,0 @@
-# Copyright (C) 2008, Parrot Foundation.
-# $Id$
-
-=begin pod
-
-=head1 TITLE
-
-mysqltest.p6 - Test NCI with mysqlclient
-
-=head1 SYNOPSIS
-
-A test for Mysql.pir module.
-
-Compile Mysql.pbc before usage.
-
-This is an initial version, be careful and not expect too much.
-
-Connection data and query are hard coded, edit the file to change.
-
-=end pod
-
-########################################################################
-use v6;
-use Mysql;
-
-say 'mysql client version: ', Mysql::get_client_info();
-
-my $mysql = Mysql::new();
-
-# host, user, password, database
-$mysql.connect('localhost', 'parrot', 'baDworD', 'parrot');
-
-$mysql.query('select * from hello;');
-
-my $r = $mysql.use_result();
-my $elems = $r.field_count();
-
-my @table_copy;
-
-my $row = $r.fetch_row();
-#my $elems = $row.elems();
-while (defined $row) {
-    my @row_copy;
-    my $i = 0;
-    while ($i < $elems) {
-        print "'", $row[$i], "'";
-	@row_copy.push($row[$i]);
-        ++$i;
-        if ($i < $elems) { print ", "; }
-    }
-    say '';
-    $row := $r.fetch_row();
-    @table_copy.push(\@row_copy);
-}
-
-say "-------Stored copy------";
-
-$r.free();
-
-for @table_copy -> $rc {
-    my $elems = $rc.elems();
-    my $i = 0;
-    while ($i < $elems) {
-        print "'", $rc[$i], "'";
-        ++$i;
-        if ($i < $elems) { print ", "; }
-    }
-    say '';
-}
-
-#End

Deleted: branches/orderedhash_revamp/examples/nci/mysqltest.pir
==============================================================================
--- branches/orderedhash_revamp/examples/nci/mysqltest.pir	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,91 +0,0 @@
-# Copyright (C) 2008, Parrot Foundation.
-# $Id$
-
-=head1 TITLE
-
-mysqltest.pir - Test NCI with mysqlclient
-
-=head1 SYNOPSIS
-
-A test for Mysql.pir module.
-
-Compile Mysql.pbc before usage.
-
-This is an initial version, be careful and not expect too much.
-
-Connection data and query are hard coded, edit the file to change.
-
-=cut
-
-########################################################################
-
-.sub main :main
-
-    load_bytecode 'Mysql.pbc'
-    .local pmc m
-    m = new ['Mysql']
-
-    .local pmc get_client_info
-
-    print 'mysql client version: '
-    get_client_info = get_global ['Mysql'], 'get_client_info'
-    $S0 = get_client_info()
-    say $S0
-# Just a test of the error method
-    $S0 = m.'error'()
-    $I0 = bytelength $S0
-    unless $I0 goto good
-    say $S0
-    exit 1
-good:
-
-    m.'connect'('localhost', 'parrot', 'baDworD', 'parrot')
-
-    m.'query'('select * from hello;')
-
-    .local pmc r
-    r = m.'use_result'()
-    .local pmc row
-    .local int n
-    n = r.'field_count'()
-nextrow:
-    row = r.'fetch_row'()
-    $I0 = defined row
-    unless $I0 goto finish
-    #n = row
-    $I0 = 0
-    print "'"
-nextcol:
-    eq $I0, n, endrow
-    $S0 = row [$I0]
-    print $S0
-    inc $I0
-    eq $I0, n, endrow
-    print "', '"
-    goto nextcol
-endrow:
-    say "'"
-    goto nextrow
-finish:
-
-    r.'free'()
-
-# Testing prepared statement
-
-    .local pmc stmt
-    stmt = m.'prepare'('select * from hello where foo = ?')
-    $I0 = stmt.'param_count'()
-    print 'Param count: '
-    say $I0
-
-    $I0 = stmt.'close'()
-    print 'Close result: '
-    say $I0
-.end
-
-#-----------------------------------------------------------------------
-# Local Variables:
-#   mode: pir
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/examples/nci/xlibtest.p6
==============================================================================
--- branches/orderedhash_revamp/examples/nci/xlibtest.p6	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/nci/xlibtest.p6	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,4 +1,4 @@
-# Copyright (C) 2008, Parrot Foundation.
+# Copyright (C) 2008-2009, Parrot Foundation.
 # $Id$
 
 use v6;
@@ -22,7 +22,7 @@
 
 =end pod
 
-use Xlib;
+use Xlib:from<parrot>;
 
 # Event types
 constant KeyPress      =  2;

Modified: branches/orderedhash_revamp/examples/opengl/shapes.pir
==============================================================================
--- branches/orderedhash_revamp/examples/opengl/shapes.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/opengl/shapes.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -24,6 +24,7 @@
 =cut
 
 
+.loadlib 'math_ops'
 .include 'datatypes.pasm'
 .include 'opengl_defines.pasm'
 
@@ -396,31 +397,26 @@
     vy = 0.135
     vz = 0.0
 
-    .local pmc random
-    .local num rand
-    random = new 'Random'
-    rand  = random
-    rand *= .1
-    x    += rand
-    rand  = random
-    rand *= .1
-    y    += rand
-    rand  = random
-    rand *= .1
-    z    += rand
-
-    rand  = random
-    rand -= .5
-    rand *= .01
-    vx   += rand
-    rand  = random
-    rand -= .5
-    rand *= .01
-    vy   += rand
-    rand  = random
-    rand -= .5
-    rand *= .01
-    vz   += rand
+    .local num random
+    random  = rand 0, 0.1
+    x      += random
+    random  = rand 0, 0.1
+    y      += random
+    random  = rand 0, 0.1
+    z      += random
+
+    random  = rand
+    random -= .5
+    random *= .01
+    vx     += random
+    random  = rand
+    random -= .5
+    random *= .01
+    vy     += random
+    random  = rand
+    random -= .5
+    random *= .01
+    vz     += random
 
     .local pmc pos
     pos = new 'FixedFloatArray'
@@ -457,12 +453,9 @@
     .local int count
     count = pfx_pos
     if count > 1000 goto update_particles
-    .local pmc random
-    .local num rand
-    random = new 'Random'
-    rand   = random
-    rand  *= 4
-    if rand > dt goto update_particles
+    .local num random
+    random = rand 0, 4
+    if random > dt goto update_particles
     new_particle(count, pfx_pos, pfx_vel)
 
     # Update all particles

Added: branches/orderedhash_revamp/examples/opengl/static-triangle-hll.pir
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/examples/opengl/static-triangle-hll.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,92 @@
+# Copyright (C) 2006-2009, Parrot Foundation.
+# $Id$
+
+=head1 TITLE
+
+static-triangle-hll.pir - Minimal OpenGL/GLUT setup and render for NCI tests
+
+=head1 SYNOPSIS
+
+    $ cd parrot-home
+    $ ./parrot examples/opengl/static-triangle-hll.pir
+
+=head1 DESCRIPTION
+
+This is a version of F<static-triangle.pir>, to examplify and test usage
+from HLLs.
+
+To quit the example, close the window using your window manager (using
+the X in the corner of the window title bar, for example), since all
+keyboard handling has been removed.
+
+=cut
+
+
+.include 'opengl_defines.pasm'
+
+.HLL 'somelanguage'
+
+.sub main :main
+    .param pmc argv
+
+    # Load OpenGL libary and a helper library for calling glutInit
+    load_bytecode 'OpenGL.pbc'
+    load_bytecode 'NCI/Utils.pbc'
+
+    # Import all OpenGL/GLU/GLUT functions to current namespace
+    # (in this example, the HLL namespace).
+    .local pmc import_gl
+    import_gl = get_root_global ['parrot';'OpenGL'], '_export_all_functions'
+    import_gl()
+
+    # Initialize GLUT
+    .local pmc call_toolkit_init
+    call_toolkit_init = get_root_global ['parrot';'NCI'; 'Utils'], 'call_toolkit_init'
+
+    .const 'Sub' glutInit = 'glutInit'
+    argv = call_toolkit_init(glutInit, argv)
+
+    # Set display mode, create GLUT window, save window handle
+    .local int mode
+    mode = .GLUT_DOUBLE | .GLUT_RGBA
+    glutInitDisplayMode(mode)
+
+    .local pmc window
+    window = new 'Integer'
+    window = glutCreateWindow('Static Triangle NCI Test')
+    set_global 'glut_window', window
+
+    # Set up GLUT callbacks
+    .const 'Sub' draw     = 'draw'
+    glutDisplayFunc (draw)
+
+    # Enter the GLUT main loop
+    glutMainLoop()
+.end
+
+.sub draw
+    .local int buffers
+    buffers = .GL_COLOR_BUFFER_BIT | .GL_DEPTH_BUFFER_BIT
+    glClear(buffers)
+
+    glBegin(.GL_TRIANGLES)
+
+    glColor3d(1,0,0)
+    glVertex3f(-1, -1, 0)
+
+    glColor3d(0, 1, 0)
+    glVertex3f(1, -1, 0)
+
+    glColor3d(0, 0, 1)
+    glVertex3f(0, 1, 0)
+
+    glEnd()
+
+    glutSwapBuffers()
+.end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/examples/pasm/fact.pasm
==============================================================================
--- branches/orderedhash_revamp/examples/pasm/fact.pasm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/pasm/fact.pasm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -27,6 +27,7 @@
 =cut
 
 main:
+    new P10, 'ResizableIntegerArray'
 	set 	I1,0
 	## P9 is used as a stack for temporaries.
 	new	P9, 'ResizableIntegerArray'
@@ -36,7 +37,7 @@
 	print	" is: "
 	new P0, 'Integer'
 	set	P0,I1
-	bsr	fact
+	local_branch P10, fact
 	print	P0
 	print	"\n"
 	inc	I1
@@ -52,13 +53,13 @@
 	push	P9,I2
 	set	I2,P0
 	dec	P0
-	bsr	fact
+	local_branch P10, fact
 	mul	P0,P0,I2
 	pop	I2,P9
-	ret
+	local_return P10
 is_one:
 	set	P0,1
-	ret
+	local_return P10
 
 # Local Variables:
 #   mode: pir

Modified: branches/orderedhash_revamp/examples/past/01-sub.pir
==============================================================================
--- branches/orderedhash_revamp/examples/past/01-sub.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/past/01-sub.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -100,11 +100,11 @@
 .sub 'say'
     .param pmc args :slurpy
     if null args goto end
-    .local pmc iter
-    iter = new 'Iterator', args
+    .local pmc it
+    it = iter args
   loop:
-    unless iter goto end
-    $P0 = shift iter
+    unless it goto end
+    $P0 = shift it
     print $P0
     goto loop
   end:

Modified: branches/orderedhash_revamp/examples/past/four_plus_one.pir
==============================================================================
--- branches/orderedhash_revamp/examples/past/four_plus_one.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/past/four_plus_one.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -116,11 +116,11 @@
 .sub 'say'
     .param pmc args :slurpy
     if null args goto end
-    .local pmc iter
-    iter = new 'Iterator', args
+    .local pmc it
+    it = iter args
   loop:
-    unless iter goto end
-    $P0 = shift iter
+    unless it goto end
+    $P0 = shift it
     print $P0
     goto loop
   end:

Deleted: branches/orderedhash_revamp/examples/pir/befunge/Configure.pl
==============================================================================
--- branches/orderedhash_revamp/examples/pir/befunge/Configure.pl	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,31 +0,0 @@
-# Copyright (C) 2009, Parrot Foundation.
-# $Id$
-
-use strict;
-use warnings;
-use 5.008;
-
-create_makefiles();
-
-sub create_makefiles {
-    my %makefiles = (
-        'config/makefiles/root.in' => 'Makefile',
-#        'config/makefiles/pmc.in'  => 'src/pmc/Makefile',
-#        'config/makefiles/ops.in'  => 'src/ops/Makefile',
-    );
-    my $build_tool = '../../../tools/dev/gen_makefile.pl';
-
-    foreach my $template (keys %makefiles) {
-        my $makefile = $makefiles{$template};
-        print "Creating $makefile\n";
-        system('perl', $build_tool, $template, $makefile);
-    }
-}
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
-

Deleted: branches/orderedhash_revamp/examples/pir/befunge/config/makefiles/root.in
==============================================================================
--- branches/orderedhash_revamp/examples/pir/befunge/config/makefiles/root.in	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,150 +0,0 @@
-# Copyright (C) 2009, Parrot Foundation.
-## $Id$
-
-## arguments we want to run parrot with
-PARROT_ARGS   :=
-
-## configuration settings
-VERSION       := @versiondir@
-BIN_DIR       := @bindir@
-LIB_DIR       := @libdir@$(VERSION)
-DOC_DIR       := @docdir@$(VERSION)
-MANDIR        := @mandir@$(VERSION)
-
-# Set up extensions
-LOAD_EXT      := @load_ext@
-O             := @o@
-
-## Setup some commands
-MAKE          := @make_c@
-PERL          := @perl@
-CAT           := @cat@
-CHMOD         := @chmod@
-CP            := @cp@
-MKPATH        := @mkpath@
-RM_F          := @rm_f@
-RM_RF         := @rm_rf@
-POD2MAN       := pod2man
-#IF(parrot_is_shared and not(cygwin or win32)):export LD_RUN_PATH := @blib_dir@:$(LD_RUN_PATH)
-PARROT        := @build_dir@/parrot at exe@
-PBC_TO_EXE    := @build_dir@/pbc_to_exe at exe@
-#IF(darwin):
-#IF(darwin):# MACOSX_DEPLOYMENT_TARGET must be defined for OS X compilation/linking
-#IF(darwin):export MACOSX_DEPLOYMENT_TARGET := @osx_version@
-
-SOURCES := \
-  befunge.pir \
-  debug.pir \
-  flow.pir \
-  io.pir \
-  load.pir \
-  maths.pir \
-  stack.pir
-
-DOCS := README
-
-BUILD_CLEANUPS := \
-  befunge.pbc \
-  "*.c" \
-  "*$(O)" \
-  befunge at exe@ \
-#IF(win32):  parrot-befunge.exe \
-#IF(win32):  parrot-befunge.iss \
-#IF(win32):  "setup-parrot-*.exe" \
-  installable_befunge at exe@
-
-TEST_CLEANUPS :=
-
-# the default target
-build: befunge.pbc
-
-all: build befunge at exe@ installable
-
-befunge.pbc: $(SOURCES)
-	$(PARROT) $(PARROT_ARGS) -o befunge.pbc befunge.pir
-
-befunge at exe@: befunge.pbc
-	$(PBC_TO_EXE) befunge.pbc
-
-installable: installable_befunge at exe@
-
-installable_befunge at exe@: befunge.pbc
-	$(PBC_TO_EXE) befunge.pbc --install
-
-Makefile: config/makefiles/root.in
-	$(PERL) Configure.pl
-
-# This is a listing of all targets, that are meant to be called by users
-help:
-	@echo ""
-	@echo "Following targets are available for the user:"
-	@echo ""
-	@echo "  build:             befunge.pbc"
-	@echo "                     This is the default."
-	@echo "  befunge at exe@        Self-hosting binary not to be installed."
-	@echo "  all:               befunge.pbc befunge at exe@ installable"
-	@echo "  installable:       Create libs and self-hosting binaries to be installed."
-	@echo "  install:           Install the installable targets and docs."
-	@echo ""
-	@echo "Testing:"
-	@echo "  test:              Run the test suite."
-	@echo "  test-installable:  Test self-hosting targets."
-	@echo "  testclean:         Clean up test results."
-	@echo ""
-	@echo "Cleaning:"
-	@echo "  clean:             Basic cleaning up."
-	@echo "  realclean:         Removes also files generated by 'Configure.pl'"
-	@echo "  distclean:         Removes also anything built, in theory"
-	@echo ""
-	@echo "Misc:"
-	@echo "  help:              Print this help message."
-	@echo ""
-
-test: build
-	$(PERL) t/harness
-
-# basic run for missing libs
-test-installable: installable
-	echo "1" | ./installable_befunge at exe@
-
-install: installable
-	$(CP) installable_befunge at exe@ $(BIN_DIR)/parrot-befunge at exe@
-	$(CHMOD) 0755 $(BIN_DIR)/parrot-befunge at exe@
-	-$(MKPATH) $(LIB_DIR)/languages/befunge
-	$(CP) befunge.pbc $(LIB_DIR)/languages/befunge/befunge.pbc
-#	-$(MKPATH) $(MANDIR)/man1
-#	$(POD2MAN) befunge.pod > $(MANDIR)/man1/parrot-befunge.1
-	-$(MKPATH) $(DOC_DIR)/languages/befunge
-	$(CP) $(DOCS) $(DOC_DIR)/languages/befunge
-
-uninstall:
-	$(RM_F) $(BIN_DIR)/parrot-befunge at exe@
-	$(RM_RF) $(LIB_DIR)/languages/befunge
-#	$(RM_F) $(MANDIR)/man1/parrot-befunge.1
-	$(RM_RF) $(DOC_DIR)/languages/befunge
-
-win32-inno-installer: installable
-#	-$(MKPATH) man/man1
-#	$(POD2MAN) befunge.pod > man/man1/parrot-befunge.1
-#	-$(MKPATH) man/html
-#	pod2html --infile befunge.pod --outfile man/html/parrot-befunge.html
-	$(CP) installable_befunge at exe@ parrot-befunge.exe
-	$(PERL) -I at build_dir@/lib @build_dir@/tools/dev/mk_inno_language.pl befunge
-	iscc parrot-befunge.iss
-
-testclean:
-	$(RM_F) $(TEST_CLEANUPS)
-
-clean:
-	$(RM_F) $(TEST_CLEANUPS) $(BUILD_CLEANUPS)
-
-realclean:
-	$(RM_F) $(TEST_CLEANUPS) $(BUILD_CLEANUPS) Makefile
-
-distclean: realclean
-
-# Local variables:
-#   mode: makefile
-# End:
-# vim: ft=make:
-

Modified: branches/orderedhash_revamp/examples/pir/befunge/flow.pir
==============================================================================
--- branches/orderedhash_revamp/examples/pir/befunge/flow.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/pir/befunge/flow.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -3,6 +3,8 @@
 
 # ** direction changing
 
+.loadlib 'math_ops'
+
 #
 # flow__go_east()
 #
@@ -69,10 +71,7 @@
 # no return value
 #
 .sub "flow__go_away"
-    $P0 = new 'Random'
-    $N0 = $P0
-    $N0 = $N0 * 4
-    $I0 = $N0
+    rand $I0, 0, 4
     $P0 = get_global "status"
     $P0["dir"] = $I0
     set_global "status", $P0

Added: branches/orderedhash_revamp/examples/pir/befunge/setup.pir
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/examples/pir/befunge/setup.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,71 @@
+#! ../../../parrot
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+setup.pir - Python distutils style
+
+=head1 DESCRIPTION
+
+No Configure step, no Makefile generated.
+
+See F<runtime/library/distutils.pir>.
+
+=head1 USAGE
+
+    $ parrot setup.pir
+    $ parrot setup.pir test
+    $ sudo parrot setup.pir install
+
+=cut
+
+.sub 'main' :main
+    .param pmc args
+    $S0 = shift args
+    load_bytecode 'distutils.pbc'
+
+    $P0 = new 'Hash'
+    $P0['name'] = 'befunge'
+    $P0['abstract'] = 'This is a Befunge interpreter written in PIR'
+    $P0['description'] = 'This is a Befunge interpreter written in PIR'
+    $P0['license_type'] = 'Artistic License 2.0'
+    $P0['license_uri'] = 'http://www.perlfoundation.org/artistic_license_2_0'
+    $P0['copyright_holder'] = 'Parrot Foundation'
+    $P0['checkout_uri'] = 'https://svn.parrot.org/parrot/trunk/examples/pir/befunge'
+    $P0['browser_uri'] = 'http://trac.parrot.org/parrot/browser/trunk/examples/pir/befunge'
+    $P0['project_uri'] = 'http://trac.parrot.org/parrot/browser/trunk/examples/pir/befunge'
+
+    # build
+    $P1 = new 'Hash'
+    $P2 = split "\n", <<'SOURCES'
+befunge.pir
+debug.pir
+flow.pir
+io.pir
+load.pir
+maths.pir
+stack.pir
+SOURCES
+    $P1['befunge.pbc'] = $P2
+    $P0['pbc_pir'] = $P1
+
+    $P3 = new 'Hash'
+    $P3['parrot-befunge'] = 'befunge.pbc'
+    $P0['exe_pbc'] = $P3
+    $P0['installable_pbc'] = $P3
+
+    # dist
+    $P4 = glob('*.bef')
+    $P0['manifest_includes'] = $P4
+    $P5 = split ' ', 'Changes MAINTAINER README'
+    $P0['doc_files'] = $P5
+
+    .tailcall setup(args :flat, $P0 :flat :named)
+.end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Deleted: branches/orderedhash_revamp/examples/pir/befunge/t/harness
==============================================================================
--- branches/orderedhash_revamp/examples/pir/befunge/t/harness	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,29 +0,0 @@
-# $Id$
-
-=head1 NAME
-
-languages/befunge/t/harness - A harness for befunge
-
-=head1 SYNOPSIS
-
-  cd languages && perl -I../lib befunge/t/harness --files
-
-  cd languages && perl -I../lib befunge/t/harness 
-
-  cd languages && perl -I../lib befunge/t/harness \
-                   befunge/t/basic.t
-
-=head1 DESCRIPTION
-
-If I'm called with a single
-argument of "--files", I just return a list of files to process.
-This list is one per line, and is relative to the languages dir.
-
-If I'm called with no args, I run the complete suite.
-
-Otherwise I run the tests that were passed on the command line.
-
-=cut
-
-use lib qw{ ../../../lib };
-use Parrot::Test::Harness language => 'befunge';

Modified: branches/orderedhash_revamp/examples/pir/life.pir
==============================================================================
--- branches/orderedhash_revamp/examples/pir/life.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/pir/life.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -27,6 +27,8 @@
 .sub 'life' :main
         .param pmc argv
         .local int max_generations
+        .local pmc jmpstack
+                   jmpstack = new 'ResizableIntegerArray'
 
 	# First the generation count
         $I15 = argv
@@ -78,7 +80,7 @@
 	concat $S15, $S12
 	concat $S15, $S13
 	concat $S15, $S14
-	bsr dump
+	local_branch jmpstack,  dump
 	set $I0, 0
 loop:	ge $I0, $I2, getout
 	inc $I0
@@ -87,9 +89,9 @@
 	printerr "."
 skip:
 
-	bsr generate
+	local_branch jmpstack,  generate
 
-	bsr dump
+	local_branch jmpstack,  dump
 	branch loop
 getout:	time $N6
 	sub $N7, $N6, $N5
@@ -246,7 +248,7 @@
 	$I2 = save_I2
 	$I1 = save_I1
 	$I0 = save_I0
-	ret
+	local_return jmpstack
 
 # $S15 has the incoming string, $S0 is scratch
 dump:
@@ -267,7 +269,7 @@
 	ge $I11, 0, printloop
 	sleep 1
 dumpend:
-	ret
+	local_return jmpstack
 
 .end
 

Added: branches/orderedhash_revamp/examples/pir/make_hello_pbc.pir
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/examples/pir/make_hello_pbc.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,98 @@
+#Copyright (C) 2009, Parrot Foundation.
+#$Id$
+# Sample creating of "Hello World" program using Packfile PMCs.
+.sub 'main'
+    .local pmc pf, pfdir, pffixup, pfbc, pfconst
+
+    # Hello World is something like
+    # .sub 'hello'
+    #    say "Hello World"
+    # .end
+    # To generate PBC we need few bits
+
+    # First thing
+    # Packfile will be created with fresh directory
+    pf = new 'Packfile'
+    pfdir = pf.'get_directory'()
+
+    # We need some constants
+    # Interpreter.
+    pfconst = new 'PackfileConstantTable'
+    $P0 = getinterp
+    pfconst[0] = $P0
+
+    # Empty FIA for handling returns from "hello"
+    $P0 = new 'FixedIntegerArray'
+    pfconst[1] = $P0
+
+    # "Hello World" string
+    pfconst[2] = "Hello World"
+
+    # "hello" is function name
+    pfconst[3] = "hello"
+
+    # "hello.pir" is our pir file which we are "compiling"
+    pfconst[4] = "hello.pir"
+
+    # We will need Sub PMC as well but will deal with it later.
+    # Add PackfileConstantTable into directory.
+    pfdir["CONSTANTS_hello.pir"] = pfconst
+
+    # Generate bytecode
+    pfbc = new 'PackfileRawSegment'
+
+    # There is our function
+    pfbc[0] = 0x1d1 # say_sc
+    pfbc[1] = 0x002 # constant id.
+
+    pfbc[2] = 0x026 # set_return_pc
+    pfbc[3] = 0x001 # id of FIA
+
+    pfbc[4] = 0x020 # returncc
+
+    # Store bytecode
+    pfdir['BYTECODE_hello.pir'] = pfbc
+
+    # Now create Sub PMC using hash of values.
+    $P0 = new 'Hash'
+    $P0['start_offs']   = 0
+    $P0['end_offs']     = 5
+    $P0['name']         = 'hello'
+    $P0['subid']        = 'hello'
+    $P0['ns_entry_name']= 'hello'
+    $P0['method']       = ''
+    $P0['HLL_id']       = 0
+
+    $P1 = new 'Sub', $P0
+    # and store it in PackfileConstantTable
+    pfconst[5] = $P1
+
+    # Dark magik. Create Fixup for Sub.
+    pffixup = new 'PackfileFixupTable'
+    # Add it to Directory now because adding FixupEntries require Directory
+    pfdir["FIXUP_hello.pir"] = pffixup
+
+    $P1 = new 'PackfileFixupEntry'
+    $P1 = 'hello'
+    $P1.'set_type'(2)
+    $P1 = 5 # offset
+    pffixup[0] = $P1
+
+    # Now pack Packfile and save it
+    $S0 = pf
+    $P1 = open "generated_hello.pbc", "w"
+    $P1.'puts'($S0)
+    close $P1
+
+    # And check it!
+    load_bytecode 'generated_hello.pbc'
+    $P1 = find_sub_not_null 'hello'
+    $P1()
+
+.end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/examples/pir/pirric.pir
==============================================================================
--- branches/orderedhash_revamp/examples/pir/pirric.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/pir/pirric.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -2452,7 +2452,7 @@
 .sub begin :method
     .local pmc text
     text = getattribute self, 'lines'
-    new $P0, 'Iterator', text
+    iter $P0, text
     set $P0, .ITERATE_FROM_START
     .return($P0)
 .end

Modified: branches/orderedhash_revamp/examples/pir/quine_ord.pir
==============================================================================
--- branches/orderedhash_revamp/examples/pir/quine_ord.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/pir/quine_ord.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -410,6 +410,7 @@
 push code_as_data, 101
 push code_as_data, 119
 push code_as_data, 32
+push code_as_data, 91
 push code_as_data, 34
 push code_as_data, 71
 push code_as_data, 101
@@ -417,12 +418,14 @@
 push code_as_data, 111
 push code_as_data, 112
 push code_as_data, 116
-push code_as_data, 58
-push code_as_data, 58
+push code_as_data, 34
+push code_as_data, 59
+push code_as_data, 34
 push code_as_data, 79
 push code_as_data, 98
 push code_as_data, 106
 push code_as_data, 34
+push code_as_data, 93
 push code_as_data, 10
 push code_as_data, 32
 push code_as_data, 32
@@ -2171,8 +2174,6 @@
 push code_as_data, 32
 push code_as_data, 105
 push code_as_data, 116
-push code_as_data, 101
-push code_as_data, 114
 push code_as_data, 10
 push code_as_data, 32
 push code_as_data, 32
@@ -2203,26 +2204,13 @@
 push code_as_data, 32
 push code_as_data, 105
 push code_as_data, 116
-push code_as_data, 101
-push code_as_data, 114
 push code_as_data, 32
 push code_as_data, 61
 push code_as_data, 32
-push code_as_data, 110
-push code_as_data, 101
-push code_as_data, 119
-push code_as_data, 32
-push code_as_data, 39
-push code_as_data, 73
+push code_as_data, 105
 push code_as_data, 116
 push code_as_data, 101
 push code_as_data, 114
-push code_as_data, 97
-push code_as_data, 116
-push code_as_data, 111
-push code_as_data, 114
-push code_as_data, 39
-push code_as_data, 44
 push code_as_data, 32
 push code_as_data, 100
 push code_as_data, 97
@@ -2235,8 +2223,6 @@
 push code_as_data, 32
 push code_as_data, 105
 push code_as_data, 116
-push code_as_data, 101
-push code_as_data, 114
 push code_as_data, 32
 push code_as_data, 61
 push code_as_data, 32
@@ -2321,8 +2307,6 @@
 push code_as_data, 32
 push code_as_data, 105
 push code_as_data, 116
-push code_as_data, 101
-push code_as_data, 114
 push code_as_data, 32
 push code_as_data, 103
 push code_as_data, 111
@@ -2395,8 +2379,6 @@
 push code_as_data, 32
 push code_as_data, 105
 push code_as_data, 116
-push code_as_data, 101
-push code_as_data, 114
 push code_as_data, 32
 push code_as_data, 32
 push code_as_data, 32
@@ -2630,8 +2612,6 @@
 push code_as_data, 32
 push code_as_data, 105
 push code_as_data, 116
-push code_as_data, 101
-push code_as_data, 114
 push code_as_data, 10
 push code_as_data, 32
 push code_as_data, 32
@@ -2639,26 +2619,13 @@
 push code_as_data, 32
 push code_as_data, 105
 push code_as_data, 116
-push code_as_data, 101
-push code_as_data, 114
 push code_as_data, 32
 push code_as_data, 61
 push code_as_data, 32
-push code_as_data, 110
-push code_as_data, 101
-push code_as_data, 119
-push code_as_data, 32
-push code_as_data, 39
-push code_as_data, 73
+push code_as_data, 105
 push code_as_data, 116
 push code_as_data, 101
 push code_as_data, 114
-push code_as_data, 97
-push code_as_data, 116
-push code_as_data, 111
-push code_as_data, 114
-push code_as_data, 39
-push code_as_data, 44
 push code_as_data, 32
 push code_as_data, 100
 push code_as_data, 97
@@ -2671,8 +2638,6 @@
 push code_as_data, 32
 push code_as_data, 105
 push code_as_data, 116
-push code_as_data, 101
-push code_as_data, 114
 push code_as_data, 32
 push code_as_data, 61
 push code_as_data, 32
@@ -2814,8 +2779,6 @@
 push code_as_data, 32
 push code_as_data, 105
 push code_as_data, 116
-push code_as_data, 101
-push code_as_data, 114
 push code_as_data, 32
 push code_as_data, 103
 push code_as_data, 111
@@ -2888,8 +2851,6 @@
 push code_as_data, 32
 push code_as_data, 105
 push code_as_data, 116
-push code_as_data, 101
-push code_as_data, 114
 push code_as_data, 32
 push code_as_data, 32
 push code_as_data, 32
@@ -3554,7 +3515,7 @@
 
     # Specification of command line arguments.
     .local pmc getopts
-    getopts = new "Getopt::Obj"
+    getopts = new ["Getopt";"Obj"]
     push getopts, "print-code-as-data"
 
     # Looking at command line
@@ -3622,14 +3583,14 @@
     .param pmc data
 
    .include "iterator.pasm"
-   .local pmc iter
+   .local pmc it
    .local int char_int
 
-   iter = new 'Iterator', data
-    iter = .ITERATE_FROM_START # reset iterator, begin at start
+   it = iter data
+    it = .ITERATE_FROM_START # reset iterator, begin at start
     ITER_LOOP:
-    unless iter goto ITER_END         # while (entries) ...
-        char_int = shift iter         # get entry
+    unless it goto ITER_END         # while (entries) ...
+        char_int = shift it         # get entry
         print 'push code_as_data, '
         print char_int
         print "\n"
@@ -3643,16 +3604,16 @@
 
    .include "iterator.pasm"
 
-   .local pmc iter
-    iter = new 'Iterator', data
-    iter = .ITERATE_FROM_START # reset iterator, begin at start
+   .local pmc it
+    it = iter data
+    it = .ITERATE_FROM_START # reset iterator, begin at start
 
    .local int    char_int
    .local string char_string
 
     ITER_LOOP:
-    unless iter goto ITER_END         # while (entries) ...
-        char_int = shift iter         # get entry
+    unless it goto ITER_END         # while (entries) ...
+        char_int = shift it         # get entry
         char_string = chr char_int
         print char_string
         goto ITER_LOOP

Modified: branches/orderedhash_revamp/examples/pir/sudoku.pir
==============================================================================
--- branches/orderedhash_revamp/examples/pir/sudoku.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/pir/sudoku.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -281,7 +281,7 @@
     # Specification of command line arguments.
     # --version, --debug, --inv=nnn, --builtin=name, --nc, --help
     .local pmc getopts
-    getopts = new "Getopt::Obj"
+    getopts = new ["Getopt";"Obj"]
     push getopts, "version"
     push getopts, "debug"
     push getopts, "pairs"
@@ -339,7 +339,7 @@
     if name goto sel_name
 
 list_names:
-    new it, 'Iterator', b
+    it = iter b
     it = .ITERATE_FROM_START
 loop:
     unless it goto fin
@@ -901,7 +901,7 @@
 .sub check_seen
     .param pmc seen
     .local pmc it
-    new it, 'Iterator', seen
+    it = iter seen
     it = .ITERATE_FROM_START
 loop:
     unless it goto ok

Modified: branches/orderedhash_revamp/examples/sdl/mandel.pir
==============================================================================
--- branches/orderedhash_revamp/examples/sdl/mandel.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/sdl/mandel.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -59,7 +59,7 @@
 .sub 'get_opts'
     .param pmc argv
     .local pmc opts, getopts
-    getopts = new 'Getopt::Obj'
+    getopts = new ['Getopt';'Obj']
     push getopts, "quit|q"
     push getopts, "threads"
     $S0 = shift argv

Modified: branches/orderedhash_revamp/examples/sdl/minesweeper/field.pir
==============================================================================
--- branches/orderedhash_revamp/examples/sdl/minesweeper/field.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/sdl/minesweeper/field.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -290,11 +290,11 @@
     .local pmc status
 
     getattribute field, self, 'field'
-    field   = new "Iterator", field
+    field   = iter field
     field   = .ITERATE_FROM_START
 
     cache   = getattribute self, 'cache'
-    cacheit = new "Iterator", cache
+    cacheit = iter cache
     cacheit = .ITERATE_FROM_START
 
     screen  = getattribute self, 'screen'
@@ -839,7 +839,7 @@
     .local pmc field
 
     field = getattribute self, 'field'
-    field = new 'Iterator', field
+    field = iter field
     field = .ITERATE_FROM_START
 LOOP:
     unless field goto WON
@@ -910,7 +910,7 @@
     mines_lcd = getattribute self, 'mines_lcd'
 
     size  = field
-    field = new 'Iterator', field
+    field = iter field
     field = .ITERATE_FROM_START
     count = new 'ResizablePMCArray'
 

Modified: branches/orderedhash_revamp/examples/sdl/tetris/board.pir
==============================================================================
--- branches/orderedhash_revamp/examples/sdl/tetris/board.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/sdl/tetris/board.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -18,6 +18,7 @@
 =cut
 
 .namespace ["Tetris::Board"]
+.loadlib 'math_ops'
 
 .sub __onload :load
     $P0 = get_class "Tetris::Board"
@@ -885,8 +886,7 @@
     $I0 = blocks
 
     # get a random block id
-    $P0 = new 'Random'
-    $N0 = $P0
+    rand $N0
     $N0 = $N0 * $I0
     id = $N0
 

Modified: branches/orderedhash_revamp/examples/shootout/knucleotide.pir
==============================================================================
--- branches/orderedhash_revamp/examples/shootout/knucleotide.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/shootout/knucleotide.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -65,13 +65,13 @@
 	$I0 = elements table
 	array = $I0
 
-	.local pmc iter
-   	iter = new 'Iterator', table
-	set iter, .ITERATE_FROM_START
+	.local pmc it
+    it = iter table
+	set it, .ITERATE_FROM_START
 	i = 0
 iter_loop_1:
-	unless iter goto iter_end_1
-	$S0 = shift iter
+	unless it goto iter_end_1
+	$S0 = shift it
 	$I0 = table[$S0]
 	$P0 = new 'FixedPMCArray'
 	$P0 = 2

Modified: branches/orderedhash_revamp/examples/shootout/random.pasm
==============================================================================
--- branches/orderedhash_revamp/examples/shootout/random.pasm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/shootout/random.pasm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -10,6 +10,7 @@
 # N2 is the argument for gen_random
 # N3 is the return from gen_random
 main:
+    new P10, 'ResizableIntegerArray'
     get_params "0", P0
     elements I0, P0
     eq I0, 2, hasargs
@@ -23,7 +24,7 @@
     unless I1, ex
     set N2, 100.0
 while_1:
-    bsr gen_random
+    local_branch P10, gen_random
     dec I1
     if I1, while_1
     new P0, 'FixedFloatArray'
@@ -45,7 +46,7 @@
     set N1, I0
     mul N3, N2, N1
     div N3, .IM
-    ret
+    local_return P10
 
 # Local Variables:
 #   mode: pir

Modified: branches/orderedhash_revamp/examples/shootout/regexdna.pir
==============================================================================
--- branches/orderedhash_revamp/examples/shootout/regexdna.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/shootout/regexdna.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -3,7 +3,7 @@
 
 .sub main :main
 	load_bytecode "PGE.pbc"
-	.local pmc p6rule_compile, rulesub, match, variants, variants_p5, iub, iter, matches, capt
+	.local pmc p6rule_compile, rulesub, match, variants, variants_p5, iub, it, matches, capt
 	.local string pattern, chunk, seq, key, replacement
 	.local int readlen, chunklen, seqlen, finallen, i, varnum, count
 	p6rule_compile = compreg "PGE::Perl6Regex"
@@ -121,12 +121,12 @@
 	#####################################################
 	# Final replace to make the sequence a p5 style regex
 	.include "iterator.pasm"
-	iter = new 'Iterator', iub
-	set iter, .ITERATE_FROM_START
+	it = iter iub
+	set it, .ITERATE_FROM_START
 	matches = new 'ResizablePMCArray'
 iter_loop:
-	unless iter goto iter_end
-	key = shift iter
+	unless it goto iter_end
+	key = shift it
 	replacement = iub[key]
 	# Ok, using a regex to match a single fixed character is probably excessive
 	# But it's what's wanted...

Modified: branches/orderedhash_revamp/examples/subs/bsr_ret.pasm
==============================================================================
--- branches/orderedhash_revamp/examples/subs/bsr_ret.pasm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/subs/bsr_ret.pasm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -20,21 +20,24 @@
 
 =cut
 
-MAIN:	print "Main\n"
-	bsr TESTSUB
-	print "Main: Return from TestSub\n"
-END:	end
+MAIN:
+    new P1, 'ResizableIntegerArray'
+    print "Main\n"
+    local_branch P1, TESTSUB
+    print "Main: Return from TestSub\n"
+END:
+    end
 
 
 TESTSUB:
-	print "TestSub\n"
-	bsr NESTSUB
-	print "TestSub: Ret from NestSub\n"
-	ret
+    print "TestSub\n"
+    local_branch P1, NESTSUB
+    print "TestSub: Ret from NestSub\n"
+    local_return P1
 
 NESTSUB:
-	print "NestSub\n"
-	ret
+    print "NestSub\n"
+    local_return P1
 
 # Local Variables:
 #   mode: pir

Deleted: branches/orderedhash_revamp/examples/subs/jsr_ret.pasm
==============================================================================
--- branches/orderedhash_revamp/examples/subs/jsr_ret.pasm	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,52 +0,0 @@
-# Copyright (C) 2001-2005, Parrot Foundation.
-# This program is free software. It is subject to the same
-# license as Parrot.
-#
-# $Id$
-
-=head1 NAME
-
-examples/subs/jsr_ret.pasm - Jumping to subroutine
-
-=head1 SYNOPSIS
-
-    % ./parrot examples/subs/jsr_ret.pasm
-
-=head1 DESCRIPTION
-
-A program to demonstrate the use of the C<jump> and of the C<jsr> opcode.
-
-=head1 SEE ALSO
-
-F<docs/ops/core.pod>
-F<docs/pdds/pdd03_calling_conventions.pod>
-
-=cut
-
-MAIN:       print "Example of the jump op.\n"
-            print "\n"
-            print "Jumping to subroutine SUB_1.\n"
-            set_addr I1, SUB_1
-            jump I1
-
-RET:        print "Returned from subroutine SUB_1.\n"
-            print "Jumping to subroutine SUB_2.\n"
-            set_addr I3, SUB_2
-            jsr I3
-            print "Returned from subroutine SUB_2.\n"
-            end
-
-SUB_1:      print "Entered subroutine SUB_1.\n"
-            set_addr I2, RET
-            print "Returning from subroutine SUB_1.\n"
-            jump I2
-
-SUB_2:      print "Entered subroutine SUB_2.\n"
-            print "Returning from subroutine SUB_2.\n"
-            ret
-
-# Local Variables:
-#   mode: pir
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/examples/tutorial/55_iterator.pir
==============================================================================
--- branches/orderedhash_revamp/examples/tutorial/55_iterator.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/examples/tutorial/55_iterator.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -17,15 +17,15 @@
 =cut
 
 .sub main :main
-    .local pmc myarray, iter
+    .local pmc myarray, it
 
     myarray = split " ", "foo bar baz boz"
 
-    iter = new ['Iterator'], myarray
+    it = iter myarray
   iter_loop:
-    unless iter goto iter_end
+    unless it goto iter_end
 
-    $P0 = shift iter
+    $P0 = shift it
     say $P0
 
     goto iter_loop

Modified: branches/orderedhash_revamp/ext/SQLite3/SQLite3.pir
==============================================================================
--- branches/orderedhash_revamp/ext/SQLite3/SQLite3.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/ext/SQLite3/SQLite3.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,7 +1,7 @@
 # Copyright (C) 2008-2009, Parrot Foundation.
 # $Id$
 
-.namespace ['SQLite']
+.namespace ['SQLite3']
 
 .const int SQLITE_OK         =   0   # Successful result
 # beginning-of-error-codes
@@ -61,6 +61,14 @@
     push sqlite_funcs, 'ipitii'
     push sqlite_funcs, 'column_name'
     push sqlite_funcs, 'tpi'
+    push sqlite_funcs, 'column_count'
+    push sqlite_funcs, 'ip'
+    push sqlite_funcs, 'column_type'
+    push sqlite_funcs, 'ipi'
+    push sqlite_funcs, 'column_int'
+    push sqlite_funcs, 'ipi'
+    push sqlite_funcs, 'column_double'
+    push sqlite_funcs, 'lpi'
     push sqlite_funcs, 'column_text'
     push sqlite_funcs, 'tpi'
 

Modified: branches/orderedhash_revamp/ext/SQLite3/gen_sqlite3.pl
==============================================================================
--- branches/orderedhash_revamp/ext/SQLite3/gen_sqlite3.pl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/ext/SQLite3/gen_sqlite3.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -17,17 +17,17 @@
 
 for (parse_ast($fn).hash().kv) -> $k,$v {
     #dump_node($v);
-    if ($v.WHAT eq "FuncDecl") {
+    if ($v.WHAT eq "NCIGENAST::FuncDecl()") {
         my @result = pir($v);
         my $cname       = @result[0];
         my $signature   = @result[1];
         my $source      = @result[2];
         my $suffix_name = @result[0];
-        my $suffix_name .= subst( /sqlite3_/, '' );
+        $suffix_name .= subst( /sqlite3_/, '' );
 
         my $pirname = %rename_table{$suffix_name} || $suffix_name;
 
-        say "    '_nci_init_symbol_'(lib, '$pirname', '$cname', '$signature') #$source";
+        say "    '_nci_init_symbol_'(lib, '$pirname', '$cname', '$signature')";
     }
 }
 print postamble();
@@ -36,7 +36,7 @@
 qq{
 ##GENERATED FILE DO NOT EDIT##
 ##GENERATED BY gen_sqlite3.pl##
-.namespace ['SQLite']
+.namespace ['SQLite3']
 
 .const int SQLITE_OK         =   0   # Successful result
 # beginning-of-error-codes

Modified: branches/orderedhash_revamp/ext/SQLite3/test.pir
==============================================================================
--- branches/orderedhash_revamp/ext/SQLite3/test.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/ext/SQLite3/test.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -3,7 +3,7 @@
 # $Id$
 
 .sub 'main'
-load_bytecode 'SQLite3'
+load_bytecode 'SQLite3.pir'
 
 $P0 = get_global [ 'SQLite' ], 'open'
 $P1 = $P0("test.db")

Added: branches/orderedhash_revamp/ext/nqp-rx/.gitignore
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/.gitignore	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,15 @@
+Makefile
+/parrot
+/parrot_install
+.*.swp
+*.c
+*.o
+Regex.pbc
+HLL.pbc
+P6Regex
+P6Regex.pbc
+nqp
+nqp.pbc
+src/gen/*.pir
+src/stage1
+src/stage2

Added: branches/orderedhash_revamp/ext/nqp-rx/CREDITS
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/CREDITS	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,24 @@
+=pod
+
+    Following in the steps of other open source projects that
+    eventually take over the world, here is the partial list
+    of people who have contributed to Rakudo and its supporting
+    works.  It is sorted by name and formatted to allow easy
+    grepping and beautification by scripts.
+    The fields are: name (N), email (E), web-address (W),
+    description (D), subversion username (U) and snail-mail
+    address (S).
+
+        Thanks,
+
+        The NQP Team
+        PS: Yes, this looks remarkably like the Linux CREDITS format
+        PPS: This file is encoded in UTF-8
+
+----------
+N: Patrick R. Michaud
+U: pmichaud
+D: Perl 6 (Rakudo Perl) lead developer, pumpking
+E: pmichaud at pobox.com
+
+=cut

Added: branches/orderedhash_revamp/ext/nqp-rx/LICENSE
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/LICENSE	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,201 @@
+		       The Artistic License 2.0
+
+	    Copyright (c) 2000-2006, The Perl Foundation.
+
+     Everyone is permitted to copy and distribute verbatim copies
+      of this license document, but changing it is not allowed.
+
+Preamble
+
+This license establishes the terms under which a given free software
+Package may be copied, modified, distributed, and/or redistributed.
+The intent is that the Copyright Holder maintains some artistic
+control over the development of that Package while still keeping the
+Package available as open source and free software.
+
+You are always permitted to make arrangements wholly outside of this
+license directly with the Copyright Holder of a given Package.  If the
+terms of this license do not permit the full use that you propose to
+make of the Package, you should contact the Copyright Holder and seek
+a different licensing arrangement.
+
+Definitions
+
+    "Copyright Holder" means the individual(s) or organization(s)
+    named in the copyright notice for the entire Package.
+
+    "Contributor" means any party that has contributed code or other
+    material to the Package, in accordance with the Copyright Holder's
+    procedures.
+
+    "You" and "your" means any person who would like to copy,
+    distribute, or modify the Package.
+
+    "Package" means the collection of files distributed by the
+    Copyright Holder, and derivatives of that collection and/or of
+    those files. A given Package may consist of either the Standard
+    Version, or a Modified Version.
+
+    "Distribute" means providing a copy of the Package or making it
+    accessible to anyone else, or in the case of a company or
+    organization, to others outside of your company or organization.
+
+    "Distributor Fee" means any fee that you charge for Distributing
+    this Package or providing support for this Package to another
+    party.  It does not mean licensing fees.
+
+    "Standard Version" refers to the Package if it has not been
+    modified, or has been modified only in ways explicitly requested
+    by the Copyright Holder.
+
+    "Modified Version" means the Package, if it has been changed, and
+    such changes were not explicitly requested by the Copyright
+    Holder.
+
+    "Original License" means this Artistic License as Distributed with
+    the Standard Version of the Package, in its current version or as
+    it may be modified by The Perl Foundation in the future.
+
+    "Source" form means the source code, documentation source, and
+    configuration files for the Package.
+
+    "Compiled" form means the compiled bytecode, object code, binary,
+    or any other form resulting from mechanical transformation or
+    translation of the Source form.
+
+
+Permission for Use and Modification Without Distribution
+
+(1)  You are permitted to use the Standard Version and create and use
+Modified Versions for any purpose without restriction, provided that
+you do not Distribute the Modified Version.
+
+
+Permissions for Redistribution of the Standard Version
+
+(2)  You may Distribute verbatim copies of the Source form of the
+Standard Version of this Package in any medium without restriction,
+either gratis or for a Distributor Fee, provided that you duplicate
+all of the original copyright notices and associated disclaimers.  At
+your discretion, such verbatim copies may or may not include a
+Compiled form of the Package.
+
+(3)  You may apply any bug fixes, portability changes, and other
+modifications made available from the Copyright Holder.  The resulting
+Package will still be considered the Standard Version, and as such
+will be subject to the Original License.
+
+
+Distribution of Modified Versions of the Package as Source
+
+(4)  You may Distribute your Modified Version as Source (either gratis
+or for a Distributor Fee, and with or without a Compiled form of the
+Modified Version) provided that you clearly document how it differs
+from the Standard Version, including, but not limited to, documenting
+any non-standard features, executables, or modules, and provided that
+you do at least ONE of the following:
+
+    (a)  make the Modified Version available to the Copyright Holder
+    of the Standard Version, under the Original License, so that the
+    Copyright Holder may include your modifications in the Standard
+    Version.
+
+    (b)  ensure that installation of your Modified Version does not
+    prevent the user installing or running the Standard Version. In
+    addition, the Modified Version must bear a name that is different
+    from the name of the Standard Version.
+
+    (c)  allow anyone who receives a copy of the Modified Version to
+    make the Source form of the Modified Version available to others
+    under
+		
+	(i)  the Original License or
+
+	(ii)  a license that permits the licensee to freely copy,
+	modify and redistribute the Modified Version using the same
+	licensing terms that apply to the copy that the licensee
+	received, and requires that the Source form of the Modified
+	Version, and of any works derived from it, be made freely
+	available in that license fees are prohibited but Distributor
+	Fees are allowed.
+
+
+Distribution of Compiled Forms of the Standard Version
+or Modified Versions without the Source
+
+(5)  You may Distribute Compiled forms of the Standard Version without
+the Source, provided that you include complete instructions on how to
+get the Source of the Standard Version.  Such instructions must be
+valid at the time of your distribution.  If these instructions, at any
+time while you are carrying out such distribution, become invalid, you
+must provide new instructions on demand or cease further distribution.
+If you provide valid instructions or cease distribution within thirty
+days after you become aware that the instructions are invalid, then
+you do not forfeit any of your rights under this license.
+
+(6)  You may Distribute a Modified Version in Compiled form without
+the Source, provided that you comply with Section 4 with respect to
+the Source of the Modified Version.
+
+
+Aggregating or Linking the Package
+
+(7)  You may aggregate the Package (either the Standard Version or
+Modified Version) with other packages and Distribute the resulting
+aggregation provided that you do not charge a licensing fee for the
+Package.  Distributor Fees are permitted, and licensing fees for other
+components in the aggregation are permitted. The terms of this license
+apply to the use and Distribution of the Standard or Modified Versions
+as included in the aggregation.
+
+(8) You are permitted to link Modified and Standard Versions with
+other works, to embed the Package in a larger work of your own, or to
+build stand-alone binary or bytecode versions of applications that
+include the Package, and Distribute the result without restriction,
+provided the result does not expose a direct interface to the Package.
+
+
+Items That are Not Considered Part of a Modified Version
+
+(9) Works (including, but not limited to, modules and scripts) that
+merely extend or make use of the Package, do not, by themselves, cause
+the Package to be a Modified Version.  In addition, such works are not
+considered parts of the Package itself, and are not subject to the
+terms of this license.
+
+
+General Provisions
+
+(10)  Any use, modification, and distribution of the Standard or
+Modified Versions is governed by this Artistic License. By using,
+modifying or distributing the Package, you accept this license. Do not
+use, modify, or distribute the Package, if you do not accept this
+license.
+
+(11)  If your Modified Version has been derived from a Modified
+Version made by someone other than you, you are nevertheless required
+to ensure that your Modified Version complies with the requirements of
+this license.
+
+(12)  This license does not grant you the right to use any trademark,
+service mark, tradename, or logo of the Copyright Holder.
+
+(13)  This license includes the non-exclusive, worldwide,
+free-of-charge patent license to make, have made, use, offer to sell,
+sell, import and otherwise transfer the Package with respect to any
+patent claims licensable by the Copyright Holder that are necessarily
+infringed by the Package. If you institute patent litigation
+(including a cross-claim or counterclaim) against any party alleging
+that the Package constitutes direct or contributory patent
+infringement, then this Artistic License to you shall terminate on the
+date that such litigation is filed.
+
+(14)  Disclaimer of Warranty:
+THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
+IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
+NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL
+LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Added: branches/orderedhash_revamp/ext/nqp-rx/README
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/README	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,97 @@
+=head1 NQP - Not Quite Perl (6)
+
+NQP is Copyright (C) 2009 by Patrick R. Michaud.  See F<LICENSE>
+for licensing details.
+
+This is "Not Quite Perl" -- a compiler for quickly generating PIR
+routines from Perl6-like code.  The key feature of NQP is that it's
+designed to be a very small compiler (as compared with, say, perl6
+or Rakudo) and is focused on being a high-level way to create
+transformers for Parrot (especially hll compilers).  In addition,
+unlike Rakudo, NQP attempts to restrict itself to generating code
+that can run in Parrot without the existence of any NQP-specific
+runtime libraries.
+
+=head2 Building from source
+
+NQP comes bundled with Parrot, so if you have a recent Parrot
+distribution you likely also have a copy of NQP.  Inside of a
+Parrot installation NQP is known as C<parrot-nqp>.
+
+To build NQP from source, you'll just need a C<make> utility
+and Perl 5.8 or newer.  To automatically obtain and build Parrot
+you may also need a subversion (svn) client.
+
+To obtain NQP directly from its repository:
+
+    $ git clone git://github.com/perl6/nqp-rx.git
+
+If you don't have git installed, you can get a tarball or zip
+of NQP from github by visiting http://github.com/perl6/nqp-rx/tree/master
+and clicking "Download".  Then unpack the tarball or zip.
+
+Once you have a copy of NQP, build it as follows:
+
+    $ cd nqp-rx
+    $ perl Configure.pl --gen-parrot
+    $ make
+
+This will create a "nqp" or "nqp.exe" executable in the
+current (nqp-rx) directory.  Programs can then be run from
+the build directory using a command like:
+
+    $ ./nqp hello.pl
+
+The C<--gen-parrot> option above tells Configure.pl to automatically
+download and build the most appropriate version of Parrot into a
+local "parrot/" subdirectory, install that Parrot into the
+"parrot_install/" subdirectory, and use that for building NQP.
+It's okay to use the C<--gen-parrot> option on later invocations
+of Configure.pl; the configure system will re-build Parrot only
+if a newer version is needed for whatever version of Rakudo you're
+working with.
+
+You can use C<--parrot-config=/path/to/parrot_config> instead
+of C<--gen-parrot> to use an already installed Parrot for building
+NQP.  This installed Parrot must include its development
+environment; typically this is done via Parrot's C<make install>
+target or by installing prebuilt C<parrot-devel> and/or C<libparrot-dev>
+packages.  The version of the already installed Parrot must satisfy a
+minimum specified by the NQP being built -- Configure.pl will
+verify this for you.  Released versions of NQP always build
+against the latest release of Parrot; checkouts of the HEAD revision
+from github often require a version of Parrot that is newer than
+the most recent Parrot monthly release.
+
+Once built, NQP's C<make install> target will install NQP
+and its libraries into the Parrot installation that was used to
+create it.  Until this step is performed, the "nqp" executable
+created by C<make> above can only be reliably run from the root of
+NQP's build directory.  After C<make install> is performed
+the executable can be run from any directory (as long as the
+Parrot installation that was used to create it remains intact).
+
+If the NQP compiler is invoked without an explicit script to
+run, it enters a small interactive mode that allows 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 Differences from previous version of NQP
+
+* Sub declarations are now lexical ("my") by default, use
+  "our sub xyz() { ... }" if you want package-scoped subroutines.
+
+* The  PIR q<...>;  construct is gone.  Use Q:PIR or pir::opcode(...)
+  instead.
+
+* The mainline code of modules is no longer tagged as ":load :init"
+  by default.  Use  INIT { ... }  for any code that you want to be
+  run automatically at startup.
+
+* Cuddled else's are no longer valid Perl 6, 'else' requires a
+  space after it.
+
+* Double-quoted strings now interpolate $-variables.
+
+

Added: branches/orderedhash_revamp/ext/nqp-rx/STATUS
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/STATUS	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,70 @@
+2009-10-09:
+
+At the moment, nqp-rx is configured to build an executable called
+"p6regex", which is a Perl 6 regular expression compiler for Parrot.
+Yes, Parrot already has a Perl 6 regular expression compiler (PGE);
+this one is different in that it will be self-hosting and based on
+PAST/POST generation.
+
+Building the system is similar to building Rakudo:
+
+    $ perl Configure.pl --gen-parrot
+    $ make
+
+This builds a "p6regex" executable, which can be used to view
+the results of compiling various regular expressions.  Like Rakudo,
+p6regex accepts --target=parse, --target=past, and --target=pir, to
+see the results of compiling various regular expressions.  For example,
+
+    $ ./p6regex --target=parse
+    > abcde*f
+
+will display the parse tree for the regular expression "abcde*f".  Similarly,
+
+    $ ./p6regex --target=pir
+    > abcde*f
+
+will display the PIR subroutine generated to match the regular
+expression "abcde*f".
+
+At the moment there's not an easy command-line tool for doing matches
+against the compiled regular expression; that should be coming soon
+as nqp-rx gets a little farther along.
+
+The test suite can be run via "make test" -- because the new regex
+engine is incomplete, we expect quite a few failures (which should
+diminish as we add new features to the project).
+
+The key files for the p6regex compiler are:
+
+    src/Regex/P6Regex/Grammar.pm     # regular expression parse grammar
+    src/Regex/P6Regex/Actions.pm     # actions to create PAST from parse
+
+
+Things that work (2009-10-15, 06h16 UTC):
+
+* bare literal strings
+* quantifiers  *, +, ?, *:, +:, ?:, *?, +?, ??, *!, +!, ?!
+* dot
+* \d, \s, \w, \n, \D, \S, \W, \N
+* brackets for grouping
+* alternation (|| works, | cheats)
+* anchors ^, ^^, $, $$, <<, >>
+* backslash-quoted punctuation
+* #-comments (mostly)
+* obsolete backslash sequences \A \Z \z \Q
+* \b, \B, \e, \E, \f, \F, \h, \H, \r, \R, \t, \T, \v, \V
+* enumerated character lists <[ab0..9]>
+* character class compositions <+foo-bar+[xyz]>
+* quantified by numeric range
+* quantified by separator
+* capturing subrules
+* capturing subpatterns
+* capture aliases
+* cut rule
+* Match objects created lazily
+* built-in methods <alpha> <digit> <xdigit> <ws> <wb> etc.
+* :ignorecase
+* :sigspace
+* :ratchet
+* single-quoted literals (without quotes)

Added: branches/orderedhash_revamp/ext/nqp-rx/src/stage0/HLL-s0.pir
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/src/stage0/HLL-s0.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,6456 @@
+# $Id$
+
+=head1 NAME
+
+HLL - Parrot HLL library
+
+=head1 DESCRIPTION
+
+This file brings together the various modules needed for HLL::Compiler
+and HLL::Grammar.
+
+=cut
+
+.sub '' :anon :load :init
+    load_bytecode 'Regex.pbc'
+.end
+
+### .include 'src/cheats/hll-compiler.pir'
+# we have to overload PCT::HLLCompiler's parse method to support P6Regex grammars
+
+
+.namespace ['HLL';'Compiler']
+
+.sub 'parse' :method
+    .param pmc source
+    .param pmc options         :slurpy :named
+
+    .local string tcode
+    tcode = options['transcode']
+    unless tcode goto transcode_done
+    .local pmc tcode_it
+    $P0 = split ' ', tcode
+    tcode_it = iter $P0
+  tcode_loop:
+    unless tcode_it goto transcode_done
+    tcode = shift tcode_it
+    push_eh tcode_enc
+    $I0 = find_charset tcode
+    $S0 = source
+    $S0 = trans_charset $S0, $I0
+    assign source, $S0
+    pop_eh
+    goto transcode_done
+  tcode_enc:
+    pop_eh
+    push_eh tcode_fail
+    $I0 = find_encoding tcode
+    $S0 = source
+    $S0 = trans_encoding $S0, $I0
+    assign source, $S0
+    pop_eh
+    goto transcode_done
+  tcode_fail:
+    pop_eh
+    goto tcode_loop
+  transcode_done:
+
+    .local pmc parsegrammar, parseactions, match
+    parsegrammar = self.'parsegrammar'()
+
+    null parseactions
+    $S0 = options['target']
+    if $S0 == 'parse' goto have_parseactions
+    parseactions = self.'parseactions'()
+  have_parseactions:
+
+    .local int rxtrace
+    rxtrace = options['parsetrace']
+    match = parsegrammar.'parse'(source, 'p'=>0, 'actions'=>parseactions, 'rxtrace'=>rxtrace)
+    unless match goto err_parsefail
+    .return (match)
+
+  err_parsefail:
+    self.'panic'('Unable to parse source')
+    .return (match)
+.end
+
+
+.sub 'pir' :method
+    .param pmc source
+    .param pmc adverbs         :slurpy :named
+
+    $P0 = compreg 'POST'
+    $S0 = $P0.'to_pir'(source, adverbs :flat :named)
+    .return ($S0)
+.end
+
+
+.sub 'parse_name' :method
+    .param string name
+
+    # split name on ::
+    .local pmc ns
+    ns = split '::', name
+
+    # move any leading sigil to the last item
+    .local string sigil
+    $S0 = ns[0]
+    sigil = substr $S0, 0, 1
+    $I0 = index '$@%&', sigil
+    if $I0 < 0 goto sigil_done
+    substr $S0, 0, 1, ''
+    ns[0] = $S0
+    $S0 = ns[-1]
+    $S0 = concat sigil, $S0
+    ns[-1] = $S0
+  sigil_done:
+
+    # remove any empty items from the list
+    .local pmc ns_it
+    ns_it = iter ns
+    ns = new ['ResizablePMCArray']
+  ns_loop:
+    unless ns_it goto ns_done
+    $S0 = shift ns_it
+    unless $S0 > '' goto ns_loop
+    push ns, $S0
+    goto ns_loop
+  ns_done:
+
+    # return the result
+    .return (ns)
+.end
+### .include 'src/cheats/hll-grammar.pir'
+# Copyright (C) 2009, The Perl Foundation.
+
+=head1 TITLE
+
+src/cheats/hll-grammar.pir -- Additional HLL::Grammar methods
+
+=head2 Methods
+
+=over 4
+
+=cut
+
+
+.include 'cclass.pasm'
+### .include 'src/Regex/constants.pir'
+.const int CURSOR_FAIL = -1
+.const int CURSOR_FAIL_GROUP = -2
+.const int CURSOR_FAIL_RULE = -3
+.const int CURSOR_FAIL_MATCH = -4
+
+.const int CURSOR_TYPE_SCAN = 1
+.const int CURSOR_TYPE_PEEK = 2
+
+.namespace ['HLL';'Grammar']
+
+.sub '' :load :init
+    .local pmc brackets
+    brackets = box unicode:"<>[](){}\xab\xbb\u0f3a\u0f3b\u0f3c\u0f3d\u169b\u169c\u2045\u2046\u207d\u207e\u208d\u208e\u2329\u232a\u2768\u2769\u276a\u276b\u276c\u276d\u276e\u276f\u2770\u2771\u2772\u2773\u2774\u2775\u27c5\u27c6\u27e6\u27e7\u27e8\u27e9\u27ea\u27eb\u2983\u2984\u2985\u2986\u2987\u2988\u2989\u298a\u298b\u298c\u298d\u298e\u298f\u2990\u2991\u2992\u2993\u2994\u2995\u2996\u2997\u2998\u29d8\u29d9\u29da\u29db\u29fc\u29fd\u3008\u3009\u300a\u300b\u300c\u300d\u300e\u300f\u3010\u3011\u3014\u3015\u3016\u3017\u3018\u3019\u301a\u301b\u301d\u301e\ufd3e\ufd3f\ufe17\ufe18\ufe35\ufe36\ufe37\ufe38\ufe39\ufe3a\ufe3b\ufe3c\ufe3d\ufe3e\ufe3f\ufe40\ufe41\ufe42\ufe43\ufe44\ufe47\ufe48\ufe59\ufe5a\ufe5b\ufe5c\ufe5d\ufe5e\uff08\uff09\uff3b\uff3d\uff5b\uff5d\uff5f\uff60\uff62\uff63"
+    set_global '$!brackets', brackets
+.end
+
+
+.namespace ['HLL';'Grammar']
+
+=item O(spec [, save])
+
+This subrule attaches operator precedence information to
+a match object (such as an operator token).  A typical
+invocation for the subrule might be:
+
+    token infix:sym<+> { <sym> <O( q{ %additive, :pirop<add> } )> }
+
+This says to add all of the attribute of the C<%additive> hash
+(described below) and a C<pirop> entry into the match object
+returned by the C<< infix:sym<+> >> token (as the C<O> named
+capture).  Note that this is a alphabetic 'O", not a digit zero.
+
+Currently the C<O> subrule accepts a string argument describing
+the hash to be stored.  (Note the C< q{ ... } > above.  Eventually
+it may be possible to omit the 'q' such that an actual (constant)
+hash constructor is passed as an argument to C<O>.
+
+The hash built via the string argument to C<O> is cached, so that
+subsequent parses of the same token re-use the hash built from
+previous parses of the token, rather than building a new hash
+on each invocation.
+
+The C<save> argument is used to build "hash" aggregates that can
+be referred to by subsequent calls to C<O>.  For example,
+
+    NQP::Grammar.O(':prec<t=>, :assoc<left>', '%additive' );
+
+specifies the values to be associated with later references to
+"%additive".  Eventually it will likely be possible to use true
+hashes from a package namespace, but this works for now.
+
+Currently the only pairs recognized have the form C< :pair >,
+C< :!pair >, and C<< :pair<strval> >>.
+
+=cut
+
+.sub 'O' :method
+    .param string spec
+    .param string save         :optional
+    .param int has_save        :opt_flag
+
+    # First, get the hash cache.  Right now we have one
+    # cache for all grammars; eventually we may need a way to
+    # separate them out by cursor type.
+    .local pmc ohash
+    ohash = get_global '%!ohash'
+    unless null ohash goto have_ohash
+    ohash = new ['Hash']
+    set_global '%!ohash', ohash
+  have_ohash:
+
+    # See if we've already created a Hash for the current
+    # specification string -- if so, use that.
+    .local pmc hash
+    hash = ohash[spec]
+    unless null hash goto hash_done
+
+    # Otherwise, we need to build a new one.
+    hash = new ['Hash']
+    .local int pos, eos
+    pos = 0
+    eos = length spec
+  spec_loop:
+    pos = find_not_cclass .CCLASS_WHITESPACE, spec, pos, eos
+    if pos >= eos goto spec_done
+    $S0 = substr spec, pos, 1
+    if $S0 == ',' goto spec_comma
+    if $S0 == ':' goto spec_pair
+
+    # If whatever we found doesn't start with a colon, treat it
+    # as a lookup of a previously saved hash to be merged in.
+    .local string lookup
+    .local int lpos
+    # Find the first whitespace or comma
+    lpos = find_cclass .CCLASS_WHITESPACE, spec, pos, eos
+    $I0 = index spec, ',', pos
+    if $I0 < 0 goto have_lookup_lpos
+    if $I0 >= lpos goto have_lookup_lpos
+    lpos = $I0
+  have_lookup_lpos:
+    $I0 = lpos - pos
+    lookup = substr spec, pos, $I0
+    .local pmc lhash, lhash_it
+    lhash = ohash[lookup]
+    if null lhash goto err_lookup
+    lhash_it = iter lhash
+  lhash_loop:
+    unless lhash_it goto lhash_done
+    $S0 = shift lhash_it
+    $P0 = lhash[$S0]
+    hash[$S0] = $P0
+    goto lhash_loop
+  lhash_done:
+    pos = lpos
+    goto spec_loop
+
+    # We just ignore commas between elements for now.
+  spec_comma:
+    inc pos
+    goto spec_loop
+
+    # If we see a colon, then we want to parse whatever
+    # comes next like a pair.
+  spec_pair:
+    # eat colon
+    inc pos
+    .local string name
+    .local pmc value
+    value = new ['Boolean']
+
+    # If the pair is of the form :!name, then reverse the value
+    # and skip the colon.
+    $S0 = substr spec, pos, 1
+    $I0 = iseq $S0, '!'
+    pos += $I0
+    $I0 = not $I0
+    value = $I0
+
+    # Get the name of the pair.
+    lpos = find_not_cclass .CCLASS_WORD, spec, pos, eos
+    $I0 = lpos - pos
+    name = substr spec, pos, $I0
+    pos = lpos
+
+    # Look for a <...> that follows.
+    $S0 = substr spec, pos, 1
+    unless $S0 == '<' goto have_value
+    inc pos
+    lpos = index spec, '>', pos
+    $I0 = lpos - pos
+    $S0 = substr spec, pos, $I0
+    value = box $S0
+    pos = lpos + 1
+  have_value:
+    # Done processing the pair, store it in the hash.
+    hash[name] = value
+    goto spec_loop
+  spec_done:
+    # Done processing the spec string, cache the hash for later.
+    ohash[spec] = hash
+  hash_done:
+
+    # If we've been called as a subrule, then build a pass-cursor
+    # to indicate success and set the hash as the subrule's match object.
+    if has_save goto save_hash
+    ($P0, $I0) = self.'!cursor_start'()
+    $P0.'!cursor_pass'($I0, '')
+    setattribute $P0, '$!match', hash
+    .return ($P0)
+
+    # save the hash under a new entry
+  save_hash:
+    ohash[save] = hash
+    .return (self)
+
+  err_lookup:
+    self.'panic'('Unknown operator precedence specification "', lookup, '"')
+.end
+
+
+=item panic([args :slurpy])
+
+Throw an exception at the current cursor location.  If the message
+doesn't end with a newline, also output the line number and offset
+of the match.
+
+=cut
+
+.sub 'panic' :method
+    .param pmc args            :slurpy
+
+    .local int pos
+    .local pmc target
+    pos = self.'pos'()
+    target = getattribute self, '$!target'
+
+    $I1 = target.'lineof'(pos)
+    inc $I1
+    push args, ' at line '
+    push args, $I1
+
+    $S0 = target
+    $S0 = substr $S0, pos, 10
+    $S0 = escape $S0
+    push args, ', near "'
+    push args, $S0
+    push args, '"'
+
+    .local string message
+    message = join '', args
+
+    die message
+.end
+
+
+=item peek_delimiters(target, pos)
+
+Return the start/stop delimiter pair based on peeking at C<target>
+position C<pos>.
+
+=cut
+
+.sub 'peek_delimiters' :method
+    .param string target
+    .param int pos
+
+    .local string brackets, start, stop
+    $P0 = get_global '$!brackets'
+    brackets = $P0
+
+    # peek at the next character
+    start = substr target, pos, 1
+    # colon and word characters aren't valid delimiters
+    if start == ':' goto err_colon_delim
+    $I0 = is_cclass .CCLASS_WORD, start, 0
+    if $I0 goto err_word_delim
+    $I0 = is_cclass .CCLASS_WHITESPACE, start, 0
+    if $I0 goto err_ws_delim
+
+    # assume stop delim is same as start, for the moment
+    stop = start
+
+    # see if we have an opener or closer
+    $I0 = index brackets, start
+    if $I0 < 0 goto bracket_end
+    # if it's a closing bracket, that's an error also
+    $I1 = $I0 % 2
+    if $I1 goto err_close
+    # it's an opener, so get the closing bracket
+    inc $I0
+    stop = substr brackets, $I0, 1
+
+    # see if the opening bracket is repeated
+    .local int len
+    len = 0
+  bracket_loop:
+    inc pos
+    inc len
+    $S0 = substr target, pos, 1
+    if $S0 == start goto bracket_loop
+    if len == 1 goto bracket_end
+    start = repeat start, len
+    stop = repeat stop, len
+  bracket_end:
+    .return (start, stop, pos)
+
+  err_colon_delim:
+    self.'panic'('Colons may not be used to delimit quoting constructs')
+  err_word_delim:
+    self.'panic'('Alphanumeric character is not allowed as a delimiter')
+  err_ws_delim:
+    self.'panic'('Whitespace character is not allowed as a delimiter')
+  err_close:
+    self.'panic'('Use of a closing delimiter for an opener is reserved')
+.end
+
+
+.sub 'quote_EXPR' :method
+    .param pmc args            :slurpy
+
+    .local pmc quotemod, true
+    .lex '%*QUOTEMOD', quotemod
+    quotemod = new ['Hash']
+
+    true = box 1
+
+
+  args_loop:
+    unless args goto args_done
+    .local string mod
+    mod = shift args
+    mod = substr mod, 1
+    quotemod[mod] = true
+    if mod == 'qq' goto opt_qq
+    if mod == 'b' goto opt_b
+    goto args_loop
+  opt_qq:
+    quotemod['s'] = true
+    quotemod['a'] = true
+    quotemod['h'] = true
+    quotemod['f'] = true
+    quotemod['c'] = true
+    quotemod['b'] = true
+  opt_b:
+    quotemod['q'] = true
+    goto args_loop
+  args_done:
+
+    .local pmc cur
+    .local string target
+    .local int pos
+
+    (cur, pos, target) = self.'!cursor_start'()
+
+    .local pmc start, stop
+    (start, stop) = self.'peek_delimiters'(target, pos)
+
+    .lex '$*QUOTE_START', start
+    .lex '$*QUOTE_STOP', stop
+
+    $P10 = cur.'quote_delimited'()
+    unless $P10 goto fail
+    cur.'!mark_push'(0, CURSOR_FAIL, 0, $P10)
+    $P10.'!cursor_names'('quote_delimited')
+    pos = $P10.'pos'()
+    cur.'!cursor_pass'(pos, 'quote_EXPR')
+  fail:
+    .return (cur)
+.end
+
+
+.sub 'quotemod_check' :method
+    .param string mod
+
+    $P0 = find_dynamic_lex '%*QUOTEMOD'
+    $P1 = $P0[mod]
+    unless null $P1 goto done
+    $P1 = new ['Undef']
+  done:
+    .return ($P1)
+.end
+
+
+.sub 'starter' :method
+    .local pmc cur
+    .local string target, start
+    .local int pos
+
+    (cur, pos, target) = self.'!cursor_start'()
+
+    $P0 = find_dynamic_lex '$*QUOTE_START'
+    if null $P0 goto fail
+    start = $P0
+
+    $I0 = length start
+    $S0 = substr target, pos, $I0
+    unless $S0 == start goto fail
+    pos += $I0
+    cur.'!cursor_pass'(pos, 'starter')
+  fail:
+    .return (cur)
+.end
+
+
+.sub 'stopper' :method
+    .local pmc cur
+    .local string target, stop
+    .local int pos
+
+    (cur, pos, target) = self.'!cursor_start'()
+
+    $P0 = find_dynamic_lex '$*QUOTE_STOP'
+    if null $P0 goto fail
+    stop = $P0
+
+    $I0 = length stop
+    $S0 = substr target, pos, $I0
+    unless $S0 == stop goto fail
+    pos += $I0
+    cur.'!cursor_pass'(pos, 'stopper')
+  fail:
+    .return (cur)
+.end
+
+
+.sub 'split_words' :method
+    .param string words
+    .local int pos, eos
+    .local pmc result
+    pos = 0
+    eos = length words
+    result = new ['ResizablePMCArray']
+  split_loop:
+    pos = find_not_cclass .CCLASS_WHITESPACE, words, pos, eos
+    unless pos < eos goto split_done
+    $I0 = find_cclass .CCLASS_WHITESPACE, words, pos, eos
+    $I1 = $I0 - pos
+    $S0 = substr words, pos, $I1
+    push result, $S0
+    pos = $I0
+    goto split_loop
+  split_done:
+    .return (result)
+.end
+
+
+=item EXPR(...)
+
+An operator precedence parser.
+
+=cut
+
+.sub 'EXPR' :method
+    .param string preclim      :optional
+    .param int has_preclim     :opt_flag
+
+    if has_preclim goto have_preclim
+    preclim = ''
+  have_preclim:
+
+    .const 'Sub' reduce = 'EXPR_reduce'
+    .local string termishrx
+    termishrx = 'termish'
+
+    .local pmc opstack, termstack
+    opstack = new ['ResizablePMCArray']
+    .lex '@opstack', opstack
+    termstack = new ['ResizablePMCArray']
+    .lex '@termstack', termstack
+
+    .local pmc here, from, pos
+    (here, pos) = self.'!cursor_start'()
+
+  term_loop:
+    here = here.termishrx()
+    unless here goto fail
+    .local pmc termish
+    termish = here.'MATCH'()
+
+    # interleave any prefix/postfix we might have found
+    .local pmc termOPER, prefixish, postfixish
+    termOPER = termish
+  termOPER_loop:
+    $I0 = exists termOPER['OPER']
+    unless $I0 goto termOPER_done
+    termOPER = termOPER['OPER']
+    goto termOPER_loop
+  termOPER_done:
+    prefixish = termOPER['prefixish']
+    postfixish = termOPER['postfixish']
+    if null prefixish goto prefix_done
+
+  prepostfix_loop:
+    unless prefixish goto prepostfix_done
+    unless postfixish goto prepostfix_done
+    .local pmc preO, postO
+    .local string preprec, postprec
+    $P0 = prefixish[0]
+    $P0 = $P0['OPER']
+    preO = $P0['O']
+    preprec = preO['prec']
+    $P0 = postfixish[-1]
+    $P0 = $P0['OPER']
+    postO = $P0['O']
+    postprec = postO['prec']
+    if postprec < preprec goto post_shift
+    if postprec > preprec goto pre_shift
+    $S0 = postO['uassoc']
+    if $S0 == 'right' goto pre_shift
+  post_shift:
+    $P0 = pop postfixish
+    push opstack, $P0
+    goto prepostfix_loop
+  pre_shift:
+    $P0 = shift prefixish
+    push opstack, $P0
+    goto prepostfix_loop
+  prepostfix_done:
+
+  prefix_loop:
+    unless prefixish goto prefix_done
+    $P0 = shift prefixish
+    push opstack, $P0
+    goto prefix_loop
+  prefix_done:
+    delete termish['prefixish']
+
+  postfix_loop:
+    if null postfixish goto postfix_done
+    unless postfixish goto postfix_done
+    $P0 = pop postfixish
+    push opstack, $P0
+    goto postfix_loop
+  postfix_done:
+    delete termish['postfixish']
+
+    $P0 = termish['term']
+    push termstack, $P0
+
+    # Now see if we can fetch an infix operator
+    .local pmc infixcur, infix
+    here = here.'ws'()
+    infixcur = here.'infixish'()
+    unless infixcur goto term_done
+    infix = infixcur.'MATCH'()
+
+    .local pmc inO
+    $P0 = infix['OPER']
+    inO = $P0['O']
+    termishrx = inO['nextterm']
+    if termishrx goto have_termishrx
+    termishrx = 'termish'
+  have_termishrx:
+
+    .local string inprec, inassoc, opprec
+    inprec = inO['prec']
+    unless inprec goto err_inprec
+    if inprec <= preclim goto term_done
+    inassoc = inO['assoc']
+
+  reduce_loop:
+    unless opstack goto reduce_done
+    $P0 = opstack[-1]
+    $P0 = $P0['OPER']
+    $P0 = $P0['O']
+    opprec = $P0['prec']
+    unless opprec > inprec goto reduce_gt_done
+    capture_lex reduce
+    self.reduce(termstack, opstack)
+    goto reduce_loop
+  reduce_gt_done:
+
+    unless opprec == inprec goto reduce_done
+    # equal precedence, use associativity to decide
+    unless inassoc == 'left' goto reduce_done
+    # left associative, reduce immediately
+    capture_lex reduce
+    self.reduce(termstack, opstack)
+  reduce_done:
+
+    push opstack, infix        # The Shift
+    here = infixcur.'ws'()
+    goto term_loop
+  term_done:
+
+  opstack_loop:
+    unless opstack goto opstack_done
+    capture_lex reduce
+    self.reduce(termstack, opstack)
+    goto opstack_loop
+  opstack_done:
+
+  expr_done:
+    .local pmc term
+    term = pop termstack
+    pos = here.'pos'()
+    here = self.'!cursor_start'()
+    setattribute here, '$!pos', pos
+    setattribute here, '$!match', term
+    here.'!reduce'('EXPR')
+  fail:
+    .return (here)
+
+  err_internal:
+    $I0 = termstack
+    here.'panic'('Internal operator parser error, @termstack == ', $I0)
+  err_inprec:
+    infixcur.'panic'('Missing infixish operator precedence')
+.end
+
+
+.sub 'EXPR_reduce' :method :anon
+    .param pmc termstack
+    .param pmc opstack
+
+    .local pmc op, opOPER, opO
+    .local string opassoc
+    op = pop opstack
+    opOPER = op['OPER']
+    opO = opOPER['O']
+    opassoc = opO['assoc']
+    if opassoc == 'unary' goto op_unary
+    if opassoc == 'list' goto op_list
+  op_infix:
+    .local pmc right, left
+    right = pop termstack
+    left = pop termstack
+    op[0] = left
+    op[1] = right
+    $S0 = opO['reducecheck']
+    unless $S0 goto op_infix_1
+    self.$S0(op)
+  op_infix_1:
+    self.'!reduce'('EXPR', 'INFIX', op)
+    goto done
+
+  op_unary:
+    .local pmc arg, afrom, ofrom
+    arg = pop termstack
+    op[0] = arg
+    afrom = arg.'from'()
+    ofrom = op.'from'()
+    if afrom < ofrom goto op_postfix
+  op_prefix:
+    self.'!reduce'('EXPR', 'PREFIX', op)
+    goto done
+  op_postfix:
+    self.'!reduce'('EXPR', 'POSTFIX', op)
+    goto done
+
+  op_list:
+    .local string sym
+    sym = opOPER['sym']
+    arg = pop termstack
+    unshift op, arg
+  op_sym_loop:
+    unless opstack goto op_sym_done
+    $P0 = opstack[-1]
+    $P0 = $P0['OPER']
+    $S0 = $P0['sym']
+    if sym != $S0 goto op_sym_done
+    arg = pop termstack
+    unshift op, arg
+    $P0 = pop opstack
+    goto op_sym_loop
+  op_sym_done:
+    arg = pop termstack
+    unshift op, arg
+    self.'!reduce'('EXPR', 'LIST', op)
+    goto done
+
+  done:
+    push termstack, op
+.end
+
+
+.sub 'ternary' :method
+    .param pmc match
+    $P0 = match[1]
+    $P1 = match['infix']
+    $P1 = $P1['EXPR']
+    match[1] = $P1
+    match[2] = $P0
+.end
+
+
+.sub 'MARKER' :method
+    .param pmc markname
+
+    .local pmc pos
+    pos = self.'pos'()
+    self.'!cursor_debug'('START MARKER name=', markname, ', pos=', pos)
+
+    .local pmc markhash
+    markhash = get_global '%!MARKHASH'
+    unless null markhash goto have_markhash
+    markhash = new ['Hash']
+    set_global '%!MARKHASH', markhash
+  have_markhash:
+    markhash[markname] = pos
+    self.'!cursor_debug'('PASS  MARKER')
+    .return (1)
+.end
+
+
+.sub 'MARKED' :method
+    .param pmc markname
+
+    self.'!cursor_debug'('START MARKED name=', markname)
+
+    .local pmc markhash
+    markhash = get_global '%!MARKHASH'
+    if null markhash goto fail
+    $P0 = markhash[markname]
+    if null $P0 goto fail
+    $P1 = self.'pos'()
+    unless $P0 == $P1 goto fail
+    self.'!cursor_debug'('PASS  MARKED')
+    .return (1)
+  fail:
+    self.'!cursor_debug'('FAIL  MARKED')
+    .return (0)
+.end
+
+
+.sub 'LANG' :method
+    .param string lang
+    .param string regex
+
+    .local pmc langhash, cur, pos
+    langhash = find_dynamic_lex '%*LANG'
+    $P0 = langhash[lang]
+    (cur, pos) = self.'!cursor_start'($P0)
+    cur.'!cursor_pos'(pos)
+
+    $S0 = concat lang, '-actions'
+    $P0 = langhash[$S0]
+    .lex '$*ACTIONS', $P0
+
+    # XXX can't use tailcall here or we lose $*ACTIONS
+    $P1 = cur.regex()
+    .return ($P1)
+.end
+
+=back
+
+=cut
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
+
+### .include 'gen/hllgrammar-grammar.pir'
+
+.namespace []
+.sub "_block11"  :anon :subid("10_1261064003.48945")
+.annotate "line", 0
+    get_hll_global $P14, ["HLL";"Grammar"], "_block13" 
+    capture_lex $P14
+.annotate "line", 5
+    get_hll_global $P14, ["HLL";"Grammar"], "_block13" 
+    capture_lex $P14
+    $P296 = $P14()
+.annotate "line", 1
+    .return ($P296)
+.end
+
+
+.namespace []
+.sub "" :load :init :subid("post94") :outer("10_1261064003.48945")
+.annotate "line", 0
+    .const 'Sub' $P12 = "10_1261064003.48945" 
+    .local pmc block
+    set block, $P12
+    $P297 = get_root_global ["parrot"], "P6metaclass"
+    $P297."new_class"("HLL::Grammar", "Regex::Cursor" :named("parent"))
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "_block13"  :subid("11_1261064003.48945") :outer("10_1261064003.48945")
+.annotate "line", 5
+    .const 'Sub' $P286 = "92_1261064003.48945" 
+    capture_lex $P286
+    .const 'Sub' $P279 = "90_1261064003.48945" 
+    capture_lex $P279
+    .const 'Sub' $P266 = "87_1261064003.48945" 
+    capture_lex $P266
+    .const 'Sub' $P261 = "85_1261064003.48945" 
+    capture_lex $P261
+    .const 'Sub' $P255 = "83_1261064003.48945" 
+    capture_lex $P255
+    .const 'Sub' $P249 = "81_1261064003.48945" 
+    capture_lex $P249
+    .const 'Sub' $P244 = "79_1261064003.48945" 
+    capture_lex $P244
+    .const 'Sub' $P239 = "77_1261064003.48945" 
+    capture_lex $P239
+    .const 'Sub' $P234 = "75_1261064003.48945" 
+    capture_lex $P234
+    .const 'Sub' $P229 = "73_1261064003.48945" 
+    capture_lex $P229
+    .const 'Sub' $P224 = "71_1261064003.48945" 
+    capture_lex $P224
+    .const 'Sub' $P219 = "69_1261064003.48945" 
+    capture_lex $P219
+    .const 'Sub' $P208 = "65_1261064003.48945" 
+    capture_lex $P208
+    .const 'Sub' $P195 = "63_1261064003.48945" 
+    capture_lex $P195
+    .const 'Sub' $P183 = "61_1261064003.48945" 
+    capture_lex $P183
+    .const 'Sub' $P176 = "59_1261064003.48945" 
+    capture_lex $P176
+    .const 'Sub' $P167 = "57_1261064003.48945" 
+    capture_lex $P167
+    .const 'Sub' $P160 = "55_1261064003.48945" 
+    capture_lex $P160
+    .const 'Sub' $P151 = "53_1261064003.48945" 
+    capture_lex $P151
+    .const 'Sub' $P144 = "51_1261064003.48945" 
+    capture_lex $P144
+    .const 'Sub' $P135 = "49_1261064003.48945" 
+    capture_lex $P135
+    .const 'Sub' $P128 = "47_1261064003.48945" 
+    capture_lex $P128
+    .const 'Sub' $P121 = "45_1261064003.48945" 
+    capture_lex $P121
+    .const 'Sub' $P111 = "43_1261064003.48945" 
+    capture_lex $P111
+    .const 'Sub' $P103 = "41_1261064003.48945" 
+    capture_lex $P103
+    .const 'Sub' $P93 = "40_1261064003.48945" 
+    capture_lex $P93
+    .const 'Sub' $P87 = "38_1261064003.48945" 
+    capture_lex $P87
+    .const 'Sub' $P82 = "36_1261064003.48945" 
+    capture_lex $P82
+    .const 'Sub' $P74 = "34_1261064003.48945" 
+    capture_lex $P74
+    .const 'Sub' $P68 = "32_1261064003.48945" 
+    capture_lex $P68
+    .const 'Sub' $P62 = "30_1261064003.48945" 
+    capture_lex $P62
+    .const 'Sub' $P56 = "28_1261064003.48945" 
+    capture_lex $P56
+    .const 'Sub' $P23 = "14_1261064003.48945" 
+    capture_lex $P23
+    .const 'Sub' $P15 = "12_1261064003.48945" 
+    capture_lex $P15
+.annotate "line", 33
+    .const 'Sub' $P286 = "92_1261064003.48945" 
+    capture_lex $P286
+.annotate "line", 5
+    .return ($P286)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "ws"  :subid("12_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 5
+    .local string rx16_tgt
+    .local int rx16_pos
+    .local int rx16_off
+    .local int rx16_eos
+    .local int rx16_rep
+    .local pmc rx16_cur
+    (rx16_cur, rx16_pos, rx16_tgt) = self."!cursor_start"()
+    rx16_cur."!cursor_debug"("START ", "ws")
+    .lex unicode:"$\x{a2}", rx16_cur
+    .local pmc match
+    .lex "$/", match
+    length rx16_eos, rx16_tgt
+    set rx16_off, 0
+    lt rx16_pos, 2, rx16_start
+    sub rx16_off, rx16_pos, 1
+    substr rx16_tgt, rx16_tgt, rx16_off
+  rx16_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan19_done
+    goto rxscan19_scan
+  rxscan19_loop:
+    ($P10) = rx16_cur."from"()
+    inc $P10
+    set rx16_pos, $P10
+    ge rx16_pos, rx16_eos, rxscan19_done
+  rxscan19_scan:
+    set_addr $I10, rxscan19_loop
+    rx16_cur."!mark_push"(0, rx16_pos, $I10)
+  rxscan19_done:
+  # rx subrule "ww" subtype=zerowidth negate=1
+    rx16_cur."!cursor_pos"(rx16_pos)
+    $P10 = rx16_cur."ww"()
+    if $P10, rx16_fail
+  # rx rxquantr20 ** 0..*
+    set_addr $I22, rxquantr20_done
+    rx16_cur."!mark_push"(0, rx16_pos, $I22)
+  rxquantr20_loop:
+  alt21_0:
+    set_addr $I10, alt21_1
+    rx16_cur."!mark_push"(0, rx16_pos, $I10)
+  # rx charclass_q s r 1..-1
+    sub $I10, rx16_pos, rx16_off
+    find_not_cclass $I11, 32, rx16_tgt, $I10, rx16_eos
+    add $I12, $I10, 1
+    lt $I11, $I12, rx16_fail
+    add rx16_pos, rx16_off, $I11
+    goto alt21_end
+  alt21_1:
+  # rx literal  "#"
+    add $I11, rx16_pos, 1
+    gt $I11, rx16_eos, rx16_fail
+    sub $I11, rx16_pos, rx16_off
+    substr $S10, rx16_tgt, $I11, 1
+    ne $S10, "#", rx16_fail
+    add rx16_pos, 1
+  # rx charclass_q N r 0..-1
+    sub $I10, rx16_pos, rx16_off
+    find_cclass $I11, 4096, rx16_tgt, $I10, rx16_eos
+    add rx16_pos, rx16_off, $I11
+  alt21_end:
+    (rx16_rep) = rx16_cur."!mark_commit"($I22)
+    rx16_cur."!mark_push"(rx16_rep, rx16_pos, $I22)
+    goto rxquantr20_loop
+  rxquantr20_done:
+  # rx pass
+    rx16_cur."!cursor_pass"(rx16_pos, "ws")
+    rx16_cur."!cursor_debug"("PASS  ", "ws", " at pos=", rx16_pos)
+    .return (rx16_cur)
+  rx16_fail:
+    (rx16_rep, rx16_pos, $I10, $P10) = rx16_cur."!mark_fail"(0)
+    lt rx16_pos, -1, rx16_done
+    eq rx16_pos, -1, rx16_fail
+    jump $I10
+  rx16_done:
+    rx16_cur."!cursor_fail"()
+    rx16_cur."!cursor_debug"("FAIL  ", "ws")
+    .return (rx16_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__ws"  :subid("13_1261064003.48945") :method
+.annotate "line", 5
+    new $P18, "ResizablePMCArray"
+    push $P18, ""
+    .return ($P18)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "termish"  :subid("14_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 5
+    .local string rx24_tgt
+    .local int rx24_pos
+    .local int rx24_off
+    .local int rx24_eos
+    .local int rx24_rep
+    .local pmc rx24_cur
+    (rx24_cur, rx24_pos, rx24_tgt) = self."!cursor_start"()
+    rx24_cur."!cursor_debug"("START ", "termish")
+    rx24_cur."!cursor_caparray"("prefixish", "postfixish")
+    .lex unicode:"$\x{a2}", rx24_cur
+    .local pmc match
+    .lex "$/", match
+    length rx24_eos, rx24_tgt
+    set rx24_off, 0
+    lt rx24_pos, 2, rx24_start
+    sub rx24_off, rx24_pos, 1
+    substr rx24_tgt, rx24_tgt, rx24_off
+  rx24_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan27_done
+    goto rxscan27_scan
+  rxscan27_loop:
+    ($P10) = rx24_cur."from"()
+    inc $P10
+    set rx24_pos, $P10
+    ge rx24_pos, rx24_eos, rxscan27_done
+  rxscan27_scan:
+    set_addr $I10, rxscan27_loop
+    rx24_cur."!mark_push"(0, rx24_pos, $I10)
+  rxscan27_done:
+.annotate "line", 8
+  # rx rxquantr28 ** 0..*
+    set_addr $I29, rxquantr28_done
+    rx24_cur."!mark_push"(0, rx24_pos, $I29)
+  rxquantr28_loop:
+  # rx subrule "prefixish" subtype=capture negate=
+    rx24_cur."!cursor_pos"(rx24_pos)
+    $P10 = rx24_cur."prefixish"()
+    unless $P10, rx24_fail
+    rx24_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("prefixish")
+    rx24_pos = $P10."pos"()
+    (rx24_rep) = rx24_cur."!mark_commit"($I29)
+    rx24_cur."!mark_push"(rx24_rep, rx24_pos, $I29)
+    goto rxquantr28_loop
+  rxquantr28_done:
+.annotate "line", 9
+  # rx subrule "term" subtype=capture negate=
+    rx24_cur."!cursor_pos"(rx24_pos)
+    $P10 = rx24_cur."term"()
+    unless $P10, rx24_fail
+    rx24_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("term")
+    rx24_pos = $P10."pos"()
+.annotate "line", 10
+  # rx rxquantr30 ** 0..*
+    set_addr $I31, rxquantr30_done
+    rx24_cur."!mark_push"(0, rx24_pos, $I31)
+  rxquantr30_loop:
+  # rx subrule "postfixish" subtype=capture negate=
+    rx24_cur."!cursor_pos"(rx24_pos)
+    $P10 = rx24_cur."postfixish"()
+    unless $P10, rx24_fail
+    rx24_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("postfixish")
+    rx24_pos = $P10."pos"()
+    (rx24_rep) = rx24_cur."!mark_commit"($I31)
+    rx24_cur."!mark_push"(rx24_rep, rx24_pos, $I31)
+    goto rxquantr30_loop
+  rxquantr30_done:
+.annotate "line", 7
+  # rx pass
+    rx24_cur."!cursor_pass"(rx24_pos, "termish")
+    rx24_cur."!cursor_debug"("PASS  ", "termish", " at pos=", rx24_pos)
+    .return (rx24_cur)
+  rx24_fail:
+.annotate "line", 5
+    (rx24_rep, rx24_pos, $I10, $P10) = rx24_cur."!mark_fail"(0)
+    lt rx24_pos, -1, rx24_done
+    eq rx24_pos, -1, rx24_fail
+    jump $I10
+  rx24_done:
+    rx24_cur."!cursor_fail"()
+    rx24_cur."!cursor_debug"("FAIL  ", "termish")
+    .return (rx24_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__termish"  :subid("15_1261064003.48945") :method
+.annotate "line", 5
+    new $P26, "ResizablePMCArray"
+    push $P26, ""
+    .return ($P26)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "term"  :subid("16_1261064003.48945") :method
+.annotate "line", 13
+    $P33 = self."!protoregex"("term")
+    .return ($P33)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__term"  :subid("17_1261064003.48945") :method
+.annotate "line", 13
+    $P35 = self."!PREFIX__!protoregex"("term")
+    .return ($P35)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "infix"  :subid("18_1261064003.48945") :method
+.annotate "line", 14
+    $P37 = self."!protoregex"("infix")
+    .return ($P37)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__infix"  :subid("19_1261064003.48945") :method
+.annotate "line", 14
+    $P39 = self."!PREFIX__!protoregex"("infix")
+    .return ($P39)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "prefix"  :subid("20_1261064003.48945") :method
+.annotate "line", 15
+    $P41 = self."!protoregex"("prefix")
+    .return ($P41)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__prefix"  :subid("21_1261064003.48945") :method
+.annotate "line", 15
+    $P43 = self."!PREFIX__!protoregex"("prefix")
+    .return ($P43)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "postfix"  :subid("22_1261064003.48945") :method
+.annotate "line", 16
+    $P45 = self."!protoregex"("postfix")
+    .return ($P45)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__postfix"  :subid("23_1261064003.48945") :method
+.annotate "line", 16
+    $P47 = self."!PREFIX__!protoregex"("postfix")
+    .return ($P47)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "circumfix"  :subid("24_1261064003.48945") :method
+.annotate "line", 17
+    $P49 = self."!protoregex"("circumfix")
+    .return ($P49)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__circumfix"  :subid("25_1261064003.48945") :method
+.annotate "line", 17
+    $P51 = self."!PREFIX__!protoregex"("circumfix")
+    .return ($P51)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "postcircumfix"  :subid("26_1261064003.48945") :method
+.annotate "line", 18
+    $P53 = self."!protoregex"("postcircumfix")
+    .return ($P53)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__postcircumfix"  :subid("27_1261064003.48945") :method
+.annotate "line", 18
+    $P55 = self."!PREFIX__!protoregex"("postcircumfix")
+    .return ($P55)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "term:sym<circumfix>"  :subid("28_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 5
+    .local string rx57_tgt
+    .local int rx57_pos
+    .local int rx57_off
+    .local int rx57_eos
+    .local int rx57_rep
+    .local pmc rx57_cur
+    (rx57_cur, rx57_pos, rx57_tgt) = self."!cursor_start"()
+    rx57_cur."!cursor_debug"("START ", "term:sym<circumfix>")
+    .lex unicode:"$\x{a2}", rx57_cur
+    .local pmc match
+    .lex "$/", match
+    length rx57_eos, rx57_tgt
+    set rx57_off, 0
+    lt rx57_pos, 2, rx57_start
+    sub rx57_off, rx57_pos, 1
+    substr rx57_tgt, rx57_tgt, rx57_off
+  rx57_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan61_done
+    goto rxscan61_scan
+  rxscan61_loop:
+    ($P10) = rx57_cur."from"()
+    inc $P10
+    set rx57_pos, $P10
+    ge rx57_pos, rx57_eos, rxscan61_done
+  rxscan61_scan:
+    set_addr $I10, rxscan61_loop
+    rx57_cur."!mark_push"(0, rx57_pos, $I10)
+  rxscan61_done:
+.annotate "line", 20
+  # rx subrule "circumfix" subtype=capture negate=
+    rx57_cur."!cursor_pos"(rx57_pos)
+    $P10 = rx57_cur."circumfix"()
+    unless $P10, rx57_fail
+    rx57_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("circumfix")
+    rx57_pos = $P10."pos"()
+  # rx pass
+    rx57_cur."!cursor_pass"(rx57_pos, "term:sym<circumfix>")
+    rx57_cur."!cursor_debug"("PASS  ", "term:sym<circumfix>", " at pos=", rx57_pos)
+    .return (rx57_cur)
+  rx57_fail:
+.annotate "line", 5
+    (rx57_rep, rx57_pos, $I10, $P10) = rx57_cur."!mark_fail"(0)
+    lt rx57_pos, -1, rx57_done
+    eq rx57_pos, -1, rx57_fail
+    jump $I10
+  rx57_done:
+    rx57_cur."!cursor_fail"()
+    rx57_cur."!cursor_debug"("FAIL  ", "term:sym<circumfix>")
+    .return (rx57_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__term:sym<circumfix>"  :subid("29_1261064003.48945") :method
+.annotate "line", 5
+    $P59 = self."!PREFIX__!subrule"("circumfix", "")
+    new $P60, "ResizablePMCArray"
+    push $P60, $P59
+    .return ($P60)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "infixish"  :subid("30_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 5
+    .local string rx63_tgt
+    .local int rx63_pos
+    .local int rx63_off
+    .local int rx63_eos
+    .local int rx63_rep
+    .local pmc rx63_cur
+    (rx63_cur, rx63_pos, rx63_tgt) = self."!cursor_start"()
+    rx63_cur."!cursor_debug"("START ", "infixish")
+    .lex unicode:"$\x{a2}", rx63_cur
+    .local pmc match
+    .lex "$/", match
+    length rx63_eos, rx63_tgt
+    set rx63_off, 0
+    lt rx63_pos, 2, rx63_start
+    sub rx63_off, rx63_pos, 1
+    substr rx63_tgt, rx63_tgt, rx63_off
+  rx63_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan67_done
+    goto rxscan67_scan
+  rxscan67_loop:
+    ($P10) = rx63_cur."from"()
+    inc $P10
+    set rx63_pos, $P10
+    ge rx63_pos, rx63_eos, rxscan67_done
+  rxscan67_scan:
+    set_addr $I10, rxscan67_loop
+    rx63_cur."!mark_push"(0, rx63_pos, $I10)
+  rxscan67_done:
+.annotate "line", 22
+  # rx subrule "infix" subtype=capture negate=
+    rx63_cur."!cursor_pos"(rx63_pos)
+    $P10 = rx63_cur."infix"()
+    unless $P10, rx63_fail
+    rx63_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("OPER=infix")
+    rx63_pos = $P10."pos"()
+  # rx pass
+    rx63_cur."!cursor_pass"(rx63_pos, "infixish")
+    rx63_cur."!cursor_debug"("PASS  ", "infixish", " at pos=", rx63_pos)
+    .return (rx63_cur)
+  rx63_fail:
+.annotate "line", 5
+    (rx63_rep, rx63_pos, $I10, $P10) = rx63_cur."!mark_fail"(0)
+    lt rx63_pos, -1, rx63_done
+    eq rx63_pos, -1, rx63_fail
+    jump $I10
+  rx63_done:
+    rx63_cur."!cursor_fail"()
+    rx63_cur."!cursor_debug"("FAIL  ", "infixish")
+    .return (rx63_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__infixish"  :subid("31_1261064003.48945") :method
+.annotate "line", 5
+    $P65 = self."!PREFIX__!subrule"("OPER=infix", "")
+    new $P66, "ResizablePMCArray"
+    push $P66, $P65
+    .return ($P66)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "prefixish"  :subid("32_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 5
+    .local string rx69_tgt
+    .local int rx69_pos
+    .local int rx69_off
+    .local int rx69_eos
+    .local int rx69_rep
+    .local pmc rx69_cur
+    (rx69_cur, rx69_pos, rx69_tgt) = self."!cursor_start"()
+    rx69_cur."!cursor_debug"("START ", "prefixish")
+    .lex unicode:"$\x{a2}", rx69_cur
+    .local pmc match
+    .lex "$/", match
+    length rx69_eos, rx69_tgt
+    set rx69_off, 0
+    lt rx69_pos, 2, rx69_start
+    sub rx69_off, rx69_pos, 1
+    substr rx69_tgt, rx69_tgt, rx69_off
+  rx69_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan73_done
+    goto rxscan73_scan
+  rxscan73_loop:
+    ($P10) = rx69_cur."from"()
+    inc $P10
+    set rx69_pos, $P10
+    ge rx69_pos, rx69_eos, rxscan73_done
+  rxscan73_scan:
+    set_addr $I10, rxscan73_loop
+    rx69_cur."!mark_push"(0, rx69_pos, $I10)
+  rxscan73_done:
+.annotate "line", 23
+  # rx subrule "prefix" subtype=capture negate=
+    rx69_cur."!cursor_pos"(rx69_pos)
+    $P10 = rx69_cur."prefix"()
+    unless $P10, rx69_fail
+    rx69_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("OPER=prefix")
+    rx69_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx69_cur."!cursor_pos"(rx69_pos)
+    $P10 = rx69_cur."ws"()
+    unless $P10, rx69_fail
+    rx69_pos = $P10."pos"()
+  # rx pass
+    rx69_cur."!cursor_pass"(rx69_pos, "prefixish")
+    rx69_cur."!cursor_debug"("PASS  ", "prefixish", " at pos=", rx69_pos)
+    .return (rx69_cur)
+  rx69_fail:
+.annotate "line", 5
+    (rx69_rep, rx69_pos, $I10, $P10) = rx69_cur."!mark_fail"(0)
+    lt rx69_pos, -1, rx69_done
+    eq rx69_pos, -1, rx69_fail
+    jump $I10
+  rx69_done:
+    rx69_cur."!cursor_fail"()
+    rx69_cur."!cursor_debug"("FAIL  ", "prefixish")
+    .return (rx69_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__prefixish"  :subid("33_1261064003.48945") :method
+.annotate "line", 5
+    $P71 = self."!PREFIX__!subrule"("OPER=prefix", "")
+    new $P72, "ResizablePMCArray"
+    push $P72, $P71
+    .return ($P72)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "postfixish"  :subid("34_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 5
+    .local string rx75_tgt
+    .local int rx75_pos
+    .local int rx75_off
+    .local int rx75_eos
+    .local int rx75_rep
+    .local pmc rx75_cur
+    (rx75_cur, rx75_pos, rx75_tgt) = self."!cursor_start"()
+    rx75_cur."!cursor_debug"("START ", "postfixish")
+    .lex unicode:"$\x{a2}", rx75_cur
+    .local pmc match
+    .lex "$/", match
+    length rx75_eos, rx75_tgt
+    set rx75_off, 0
+    lt rx75_pos, 2, rx75_start
+    sub rx75_off, rx75_pos, 1
+    substr rx75_tgt, rx75_tgt, rx75_off
+  rx75_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan80_done
+    goto rxscan80_scan
+  rxscan80_loop:
+    ($P10) = rx75_cur."from"()
+    inc $P10
+    set rx75_pos, $P10
+    ge rx75_pos, rx75_eos, rxscan80_done
+  rxscan80_scan:
+    set_addr $I10, rxscan80_loop
+    rx75_cur."!mark_push"(0, rx75_pos, $I10)
+  rxscan80_done:
+  alt81_0:
+.annotate "line", 24
+    set_addr $I10, alt81_1
+    rx75_cur."!mark_push"(0, rx75_pos, $I10)
+.annotate "line", 25
+  # rx subrule "postfix" subtype=capture negate=
+    rx75_cur."!cursor_pos"(rx75_pos)
+    $P10 = rx75_cur."postfix"()
+    unless $P10, rx75_fail
+    rx75_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("OPER=postfix")
+    rx75_pos = $P10."pos"()
+    goto alt81_end
+  alt81_1:
+.annotate "line", 26
+  # rx subrule "postcircumfix" subtype=capture negate=
+    rx75_cur."!cursor_pos"(rx75_pos)
+    $P10 = rx75_cur."postcircumfix"()
+    unless $P10, rx75_fail
+    rx75_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("OPER=postcircumfix")
+    rx75_pos = $P10."pos"()
+  alt81_end:
+.annotate "line", 24
+  # rx pass
+    rx75_cur."!cursor_pass"(rx75_pos, "postfixish")
+    rx75_cur."!cursor_debug"("PASS  ", "postfixish", " at pos=", rx75_pos)
+    .return (rx75_cur)
+  rx75_fail:
+.annotate "line", 5
+    (rx75_rep, rx75_pos, $I10, $P10) = rx75_cur."!mark_fail"(0)
+    lt rx75_pos, -1, rx75_done
+    eq rx75_pos, -1, rx75_fail
+    jump $I10
+  rx75_done:
+    rx75_cur."!cursor_fail"()
+    rx75_cur."!cursor_debug"("FAIL  ", "postfixish")
+    .return (rx75_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__postfixish"  :subid("35_1261064003.48945") :method
+.annotate "line", 5
+    $P77 = self."!PREFIX__!subrule"("OPER=postcircumfix", "")
+    $P78 = self."!PREFIX__!subrule"("OPER=postfix", "")
+    new $P79, "ResizablePMCArray"
+    push $P79, $P77
+    push $P79, $P78
+    .return ($P79)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "nullterm"  :subid("36_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 5
+    .local string rx83_tgt
+    .local int rx83_pos
+    .local int rx83_off
+    .local int rx83_eos
+    .local int rx83_rep
+    .local pmc rx83_cur
+    (rx83_cur, rx83_pos, rx83_tgt) = self."!cursor_start"()
+    rx83_cur."!cursor_debug"("START ", "nullterm")
+    .lex unicode:"$\x{a2}", rx83_cur
+    .local pmc match
+    .lex "$/", match
+    length rx83_eos, rx83_tgt
+    set rx83_off, 0
+    lt rx83_pos, 2, rx83_start
+    sub rx83_off, rx83_pos, 1
+    substr rx83_tgt, rx83_tgt, rx83_off
+  rx83_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan86_done
+    goto rxscan86_scan
+  rxscan86_loop:
+    ($P10) = rx83_cur."from"()
+    inc $P10
+    set rx83_pos, $P10
+    ge rx83_pos, rx83_eos, rxscan86_done
+  rxscan86_scan:
+    set_addr $I10, rxscan86_loop
+    rx83_cur."!mark_push"(0, rx83_pos, $I10)
+  rxscan86_done:
+.annotate "line", 29
+  # rx pass
+    rx83_cur."!cursor_pass"(rx83_pos, "nullterm")
+    rx83_cur."!cursor_debug"("PASS  ", "nullterm", " at pos=", rx83_pos)
+    .return (rx83_cur)
+  rx83_fail:
+.annotate "line", 5
+    (rx83_rep, rx83_pos, $I10, $P10) = rx83_cur."!mark_fail"(0)
+    lt rx83_pos, -1, rx83_done
+    eq rx83_pos, -1, rx83_fail
+    jump $I10
+  rx83_done:
+    rx83_cur."!cursor_fail"()
+    rx83_cur."!cursor_debug"("FAIL  ", "nullterm")
+    .return (rx83_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__nullterm"  :subid("37_1261064003.48945") :method
+.annotate "line", 5
+    new $P85, "ResizablePMCArray"
+    push $P85, ""
+    .return ($P85)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "nullterm_alt"  :subid("38_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 5
+    .local string rx88_tgt
+    .local int rx88_pos
+    .local int rx88_off
+    .local int rx88_eos
+    .local int rx88_rep
+    .local pmc rx88_cur
+    (rx88_cur, rx88_pos, rx88_tgt) = self."!cursor_start"()
+    rx88_cur."!cursor_debug"("START ", "nullterm_alt")
+    .lex unicode:"$\x{a2}", rx88_cur
+    .local pmc match
+    .lex "$/", match
+    length rx88_eos, rx88_tgt
+    set rx88_off, 0
+    lt rx88_pos, 2, rx88_start
+    sub rx88_off, rx88_pos, 1
+    substr rx88_tgt, rx88_tgt, rx88_off
+  rx88_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan92_done
+    goto rxscan92_scan
+  rxscan92_loop:
+    ($P10) = rx88_cur."from"()
+    inc $P10
+    set rx88_pos, $P10
+    ge rx88_pos, rx88_eos, rxscan92_done
+  rxscan92_scan:
+    set_addr $I10, rxscan92_loop
+    rx88_cur."!mark_push"(0, rx88_pos, $I10)
+  rxscan92_done:
+.annotate "line", 30
+  # rx subrule "nullterm" subtype=capture negate=
+    rx88_cur."!cursor_pos"(rx88_pos)
+    $P10 = rx88_cur."nullterm"()
+    unless $P10, rx88_fail
+    rx88_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("term")
+    rx88_pos = $P10."pos"()
+  # rx pass
+    rx88_cur."!cursor_pass"(rx88_pos, "nullterm_alt")
+    rx88_cur."!cursor_debug"("PASS  ", "nullterm_alt", " at pos=", rx88_pos)
+    .return (rx88_cur)
+  rx88_fail:
+.annotate "line", 5
+    (rx88_rep, rx88_pos, $I10, $P10) = rx88_cur."!mark_fail"(0)
+    lt rx88_pos, -1, rx88_done
+    eq rx88_pos, -1, rx88_fail
+    jump $I10
+  rx88_done:
+    rx88_cur."!cursor_fail"()
+    rx88_cur."!cursor_debug"("FAIL  ", "nullterm_alt")
+    .return (rx88_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__nullterm_alt"  :subid("39_1261064003.48945") :method
+.annotate "line", 5
+    $P90 = self."!PREFIX__!subrule"("term", "")
+    new $P91, "ResizablePMCArray"
+    push $P91, $P90
+    .return ($P91)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "nulltermish"  :subid("40_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 33
+    new $P95, 'ExceptionHandler'
+    set_addr $P95, control_94
+    $P95."handle_types"(58)
+    push_eh $P95
+    .lex "self", self
+    find_lex $P98, "self"
+    $P99 = $P98."termish"()
+    unless $P99, unless_97
+    set $P96, $P99
+    goto unless_97_end
+  unless_97:
+    find_lex $P100, "self"
+    $P101 = $P100."nullterm_alt"()
+    set $P96, $P101
+  unless_97_end:
+    .return ($P96)
+  control_94:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P102, exception, "payload"
+    .return ($P102)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "quote_delimited"  :subid("41_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 33
+    .local string rx104_tgt
+    .local int rx104_pos
+    .local int rx104_off
+    .local int rx104_eos
+    .local int rx104_rep
+    .local pmc rx104_cur
+    (rx104_cur, rx104_pos, rx104_tgt) = self."!cursor_start"()
+    rx104_cur."!cursor_debug"("START ", "quote_delimited")
+    rx104_cur."!cursor_caparray"("quote_atom")
+    .lex unicode:"$\x{a2}", rx104_cur
+    .local pmc match
+    .lex "$/", match
+    length rx104_eos, rx104_tgt
+    set rx104_off, 0
+    lt rx104_pos, 2, rx104_start
+    sub rx104_off, rx104_pos, 1
+    substr rx104_tgt, rx104_tgt, rx104_off
+  rx104_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan108_done
+    goto rxscan108_scan
+  rxscan108_loop:
+    ($P10) = rx104_cur."from"()
+    inc $P10
+    set rx104_pos, $P10
+    ge rx104_pos, rx104_eos, rxscan108_done
+  rxscan108_scan:
+    set_addr $I10, rxscan108_loop
+    rx104_cur."!mark_push"(0, rx104_pos, $I10)
+  rxscan108_done:
+.annotate "line", 37
+  # rx subrule "starter" subtype=capture negate=
+    rx104_cur."!cursor_pos"(rx104_pos)
+    $P10 = rx104_cur."starter"()
+    unless $P10, rx104_fail
+    rx104_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("starter")
+    rx104_pos = $P10."pos"()
+  # rx rxquantr109 ** 0..*
+    set_addr $I110, rxquantr109_done
+    rx104_cur."!mark_push"(0, rx104_pos, $I110)
+  rxquantr109_loop:
+  # rx subrule "quote_atom" subtype=capture negate=
+    rx104_cur."!cursor_pos"(rx104_pos)
+    $P10 = rx104_cur."quote_atom"()
+    unless $P10, rx104_fail
+    rx104_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("quote_atom")
+    rx104_pos = $P10."pos"()
+    (rx104_rep) = rx104_cur."!mark_commit"($I110)
+    rx104_cur."!mark_push"(rx104_rep, rx104_pos, $I110)
+    goto rxquantr109_loop
+  rxquantr109_done:
+  # rx subrule "stopper" subtype=capture negate=
+    rx104_cur."!cursor_pos"(rx104_pos)
+    $P10 = rx104_cur."stopper"()
+    unless $P10, rx104_fail
+    rx104_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("stopper")
+    rx104_pos = $P10."pos"()
+.annotate "line", 36
+  # rx pass
+    rx104_cur."!cursor_pass"(rx104_pos, "quote_delimited")
+    rx104_cur."!cursor_debug"("PASS  ", "quote_delimited", " at pos=", rx104_pos)
+    .return (rx104_cur)
+  rx104_fail:
+.annotate "line", 33
+    (rx104_rep, rx104_pos, $I10, $P10) = rx104_cur."!mark_fail"(0)
+    lt rx104_pos, -1, rx104_done
+    eq rx104_pos, -1, rx104_fail
+    jump $I10
+  rx104_done:
+    rx104_cur."!cursor_fail"()
+    rx104_cur."!cursor_debug"("FAIL  ", "quote_delimited")
+    .return (rx104_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__quote_delimited"  :subid("42_1261064003.48945") :method
+.annotate "line", 33
+    $P106 = self."!PREFIX__!subrule"("starter", "")
+    new $P107, "ResizablePMCArray"
+    push $P107, $P106
+    .return ($P107)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "quote_atom"  :subid("43_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 33
+    .local string rx112_tgt
+    .local int rx112_pos
+    .local int rx112_off
+    .local int rx112_eos
+    .local int rx112_rep
+    .local pmc rx112_cur
+    (rx112_cur, rx112_pos, rx112_tgt) = self."!cursor_start"()
+    rx112_cur."!cursor_debug"("START ", "quote_atom")
+    .lex unicode:"$\x{a2}", rx112_cur
+    .local pmc match
+    .lex "$/", match
+    length rx112_eos, rx112_tgt
+    set rx112_off, 0
+    lt rx112_pos, 2, rx112_start
+    sub rx112_off, rx112_pos, 1
+    substr rx112_tgt, rx112_tgt, rx112_off
+  rx112_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan115_done
+    goto rxscan115_scan
+  rxscan115_loop:
+    ($P10) = rx112_cur."from"()
+    inc $P10
+    set rx112_pos, $P10
+    ge rx112_pos, rx112_eos, rxscan115_done
+  rxscan115_scan:
+    set_addr $I10, rxscan115_loop
+    rx112_cur."!mark_push"(0, rx112_pos, $I10)
+  rxscan115_done:
+.annotate "line", 41
+  # rx subrule "stopper" subtype=zerowidth negate=1
+    rx112_cur."!cursor_pos"(rx112_pos)
+    $P10 = rx112_cur."stopper"()
+    if $P10, rx112_fail
+  alt116_0:
+.annotate "line", 42
+    set_addr $I10, alt116_1
+    rx112_cur."!mark_push"(0, rx112_pos, $I10)
+.annotate "line", 43
+  # rx subrule "quote_escape" subtype=capture negate=
+    rx112_cur."!cursor_pos"(rx112_pos)
+    $P10 = rx112_cur."quote_escape"()
+    unless $P10, rx112_fail
+    rx112_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("quote_escape")
+    rx112_pos = $P10."pos"()
+    goto alt116_end
+  alt116_1:
+.annotate "line", 44
+  # rx rxquantr117 ** 1..*
+    set_addr $I120, rxquantr117_done
+    rx112_cur."!mark_push"(0, -1, $I120)
+  rxquantr117_loop:
+  # rx subrule "stopper" subtype=zerowidth negate=1
+    rx112_cur."!cursor_pos"(rx112_pos)
+    $P10 = rx112_cur."stopper"()
+    if $P10, rx112_fail
+  # rx subrule "quote_escape" subtype=zerowidth negate=1
+    rx112_cur."!cursor_pos"(rx112_pos)
+    $P10 = rx112_cur."quote_escape"()
+    if $P10, rx112_fail
+  # rx charclass .
+    ge rx112_pos, rx112_eos, rx112_fail
+    inc rx112_pos
+    (rx112_rep) = rx112_cur."!mark_commit"($I120)
+    rx112_cur."!mark_push"(rx112_rep, rx112_pos, $I120)
+    goto rxquantr117_loop
+  rxquantr117_done:
+  alt116_end:
+.annotate "line", 40
+  # rx pass
+    rx112_cur."!cursor_pass"(rx112_pos, "quote_atom")
+    rx112_cur."!cursor_debug"("PASS  ", "quote_atom", " at pos=", rx112_pos)
+    .return (rx112_cur)
+  rx112_fail:
+.annotate "line", 33
+    (rx112_rep, rx112_pos, $I10, $P10) = rx112_cur."!mark_fail"(0)
+    lt rx112_pos, -1, rx112_done
+    eq rx112_pos, -1, rx112_fail
+    jump $I10
+  rx112_done:
+    rx112_cur."!cursor_fail"()
+    rx112_cur."!cursor_debug"("FAIL  ", "quote_atom")
+    .return (rx112_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__quote_atom"  :subid("44_1261064003.48945") :method
+.annotate "line", 33
+    new $P114, "ResizablePMCArray"
+    push $P114, ""
+    .return ($P114)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "decint"  :subid("45_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 33
+    .local string rx122_tgt
+    .local int rx122_pos
+    .local int rx122_off
+    .local int rx122_eos
+    .local int rx122_rep
+    .local pmc rx122_cur
+    (rx122_cur, rx122_pos, rx122_tgt) = self."!cursor_start"()
+    rx122_cur."!cursor_debug"("START ", "decint")
+    .lex unicode:"$\x{a2}", rx122_cur
+    .local pmc match
+    .lex "$/", match
+    length rx122_eos, rx122_tgt
+    set rx122_off, 0
+    lt rx122_pos, 2, rx122_start
+    sub rx122_off, rx122_pos, 1
+    substr rx122_tgt, rx122_tgt, rx122_off
+  rx122_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan125_done
+    goto rxscan125_scan
+  rxscan125_loop:
+    ($P10) = rx122_cur."from"()
+    inc $P10
+    set rx122_pos, $P10
+    ge rx122_pos, rx122_eos, rxscan125_done
+  rxscan125_scan:
+    set_addr $I10, rxscan125_loop
+    rx122_cur."!mark_push"(0, rx122_pos, $I10)
+  rxscan125_done:
+.annotate "line", 48
+  # rx rxquantr126 ** 1..*
+    set_addr $I127, rxquantr126_done
+    rx122_cur."!mark_push"(0, -1, $I127)
+  rxquantr126_loop:
+  # rx charclass_q d r 1..-1
+    sub $I10, rx122_pos, rx122_off
+    find_not_cclass $I11, 8, rx122_tgt, $I10, rx122_eos
+    add $I12, $I10, 1
+    lt $I11, $I12, rx122_fail
+    add rx122_pos, rx122_off, $I11
+    (rx122_rep) = rx122_cur."!mark_commit"($I127)
+    rx122_cur."!mark_push"(rx122_rep, rx122_pos, $I127)
+  # rx literal  "_"
+    add $I11, rx122_pos, 1
+    gt $I11, rx122_eos, rx122_fail
+    sub $I11, rx122_pos, rx122_off
+    substr $S10, rx122_tgt, $I11, 1
+    ne $S10, "_", rx122_fail
+    add rx122_pos, 1
+    goto rxquantr126_loop
+  rxquantr126_done:
+  # rx pass
+    rx122_cur."!cursor_pass"(rx122_pos, "decint")
+    rx122_cur."!cursor_debug"("PASS  ", "decint", " at pos=", rx122_pos)
+    .return (rx122_cur)
+  rx122_fail:
+.annotate "line", 33
+    (rx122_rep, rx122_pos, $I10, $P10) = rx122_cur."!mark_fail"(0)
+    lt rx122_pos, -1, rx122_done
+    eq rx122_pos, -1, rx122_fail
+    jump $I10
+  rx122_done:
+    rx122_cur."!cursor_fail"()
+    rx122_cur."!cursor_debug"("FAIL  ", "decint")
+    .return (rx122_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__decint"  :subid("46_1261064003.48945") :method
+.annotate "line", 33
+    new $P124, "ResizablePMCArray"
+    push $P124, ""
+    .return ($P124)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "hexints"  :subid("47_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 33
+    .local string rx129_tgt
+    .local int rx129_pos
+    .local int rx129_off
+    .local int rx129_eos
+    .local int rx129_rep
+    .local pmc rx129_cur
+    (rx129_cur, rx129_pos, rx129_tgt) = self."!cursor_start"()
+    rx129_cur."!cursor_debug"("START ", "hexints")
+    rx129_cur."!cursor_caparray"("decint")
+    .lex unicode:"$\x{a2}", rx129_cur
+    .local pmc match
+    .lex "$/", match
+    length rx129_eos, rx129_tgt
+    set rx129_off, 0
+    lt rx129_pos, 2, rx129_start
+    sub rx129_off, rx129_pos, 1
+    substr rx129_tgt, rx129_tgt, rx129_off
+  rx129_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan132_done
+    goto rxscan132_scan
+  rxscan132_loop:
+    ($P10) = rx129_cur."from"()
+    inc $P10
+    set rx129_pos, $P10
+    ge rx129_pos, rx129_eos, rxscan132_done
+  rxscan132_scan:
+    set_addr $I10, rxscan132_loop
+    rx129_cur."!mark_push"(0, rx129_pos, $I10)
+  rxscan132_done:
+.annotate "line", 49
+  # rx rxquantr133 ** 1..*
+    set_addr $I134, rxquantr133_done
+    rx129_cur."!mark_push"(0, -1, $I134)
+  rxquantr133_loop:
+  # rx subrule "ws" subtype=method negate=
+    rx129_cur."!cursor_pos"(rx129_pos)
+    $P10 = rx129_cur."ws"()
+    unless $P10, rx129_fail
+    rx129_pos = $P10."pos"()
+  # rx subrule "decint" subtype=capture negate=
+    rx129_cur."!cursor_pos"(rx129_pos)
+    $P10 = rx129_cur."decint"()
+    unless $P10, rx129_fail
+    rx129_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("decint")
+    rx129_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx129_cur."!cursor_pos"(rx129_pos)
+    $P10 = rx129_cur."ws"()
+    unless $P10, rx129_fail
+    rx129_pos = $P10."pos"()
+    (rx129_rep) = rx129_cur."!mark_commit"($I134)
+    rx129_cur."!mark_push"(rx129_rep, rx129_pos, $I134)
+  # rx literal  ","
+    add $I11, rx129_pos, 1
+    gt $I11, rx129_eos, rx129_fail
+    sub $I11, rx129_pos, rx129_off
+    substr $S10, rx129_tgt, $I11, 1
+    ne $S10, ",", rx129_fail
+    add rx129_pos, 1
+    goto rxquantr133_loop
+  rxquantr133_done:
+  # rx pass
+    rx129_cur."!cursor_pass"(rx129_pos, "hexints")
+    rx129_cur."!cursor_debug"("PASS  ", "hexints", " at pos=", rx129_pos)
+    .return (rx129_cur)
+  rx129_fail:
+.annotate "line", 33
+    (rx129_rep, rx129_pos, $I10, $P10) = rx129_cur."!mark_fail"(0)
+    lt rx129_pos, -1, rx129_done
+    eq rx129_pos, -1, rx129_fail
+    jump $I10
+  rx129_done:
+    rx129_cur."!cursor_fail"()
+    rx129_cur."!cursor_debug"("FAIL  ", "hexints")
+    .return (rx129_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__hexints"  :subid("48_1261064003.48945") :method
+.annotate "line", 33
+    new $P131, "ResizablePMCArray"
+    push $P131, ""
+    .return ($P131)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "hexint"  :subid("49_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 33
+    .local string rx136_tgt
+    .local int rx136_pos
+    .local int rx136_off
+    .local int rx136_eos
+    .local int rx136_rep
+    .local pmc rx136_cur
+    (rx136_cur, rx136_pos, rx136_tgt) = self."!cursor_start"()
+    rx136_cur."!cursor_debug"("START ", "hexint")
+    .lex unicode:"$\x{a2}", rx136_cur
+    .local pmc match
+    .lex "$/", match
+    length rx136_eos, rx136_tgt
+    set rx136_off, 0
+    lt rx136_pos, 2, rx136_start
+    sub rx136_off, rx136_pos, 1
+    substr rx136_tgt, rx136_tgt, rx136_off
+  rx136_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan139_done
+    goto rxscan139_scan
+  rxscan139_loop:
+    ($P10) = rx136_cur."from"()
+    inc $P10
+    set rx136_pos, $P10
+    ge rx136_pos, rx136_eos, rxscan139_done
+  rxscan139_scan:
+    set_addr $I10, rxscan139_loop
+    rx136_cur."!mark_push"(0, rx136_pos, $I10)
+  rxscan139_done:
+.annotate "line", 51
+  # rx rxquantr140 ** 1..*
+    set_addr $I143, rxquantr140_done
+    rx136_cur."!mark_push"(0, -1, $I143)
+  rxquantr140_loop:
+  # rx rxquantr141 ** 1..*
+    set_addr $I142, rxquantr141_done
+    rx136_cur."!mark_push"(0, -1, $I142)
+  rxquantr141_loop:
+  # rx enumcharlist negate=0 
+    ge rx136_pos, rx136_eos, rx136_fail
+    sub $I10, rx136_pos, rx136_off
+    substr $S10, rx136_tgt, $I10, 1
+    index $I11, "0123456789abcdefABCDEF", $S10
+    lt $I11, 0, rx136_fail
+    inc rx136_pos
+    (rx136_rep) = rx136_cur."!mark_commit"($I142)
+    rx136_cur."!mark_push"(rx136_rep, rx136_pos, $I142)
+    goto rxquantr141_loop
+  rxquantr141_done:
+    (rx136_rep) = rx136_cur."!mark_commit"($I143)
+    rx136_cur."!mark_push"(rx136_rep, rx136_pos, $I143)
+  # rx literal  "_"
+    add $I11, rx136_pos, 1
+    gt $I11, rx136_eos, rx136_fail
+    sub $I11, rx136_pos, rx136_off
+    substr $S10, rx136_tgt, $I11, 1
+    ne $S10, "_", rx136_fail
+    add rx136_pos, 1
+    goto rxquantr140_loop
+  rxquantr140_done:
+  # rx pass
+    rx136_cur."!cursor_pass"(rx136_pos, "hexint")
+    rx136_cur."!cursor_debug"("PASS  ", "hexint", " at pos=", rx136_pos)
+    .return (rx136_cur)
+  rx136_fail:
+.annotate "line", 33
+    (rx136_rep, rx136_pos, $I10, $P10) = rx136_cur."!mark_fail"(0)
+    lt rx136_pos, -1, rx136_done
+    eq rx136_pos, -1, rx136_fail
+    jump $I10
+  rx136_done:
+    rx136_cur."!cursor_fail"()
+    rx136_cur."!cursor_debug"("FAIL  ", "hexint")
+    .return (rx136_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__hexint"  :subid("50_1261064003.48945") :method
+.annotate "line", 33
+    new $P138, "ResizablePMCArray"
+    push $P138, ""
+    .return ($P138)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "hexints"  :subid("51_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 33
+    .local string rx145_tgt
+    .local int rx145_pos
+    .local int rx145_off
+    .local int rx145_eos
+    .local int rx145_rep
+    .local pmc rx145_cur
+    (rx145_cur, rx145_pos, rx145_tgt) = self."!cursor_start"()
+    rx145_cur."!cursor_debug"("START ", "hexints")
+    rx145_cur."!cursor_caparray"("hexint")
+    .lex unicode:"$\x{a2}", rx145_cur
+    .local pmc match
+    .lex "$/", match
+    length rx145_eos, rx145_tgt
+    set rx145_off, 0
+    lt rx145_pos, 2, rx145_start
+    sub rx145_off, rx145_pos, 1
+    substr rx145_tgt, rx145_tgt, rx145_off
+  rx145_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan148_done
+    goto rxscan148_scan
+  rxscan148_loop:
+    ($P10) = rx145_cur."from"()
+    inc $P10
+    set rx145_pos, $P10
+    ge rx145_pos, rx145_eos, rxscan148_done
+  rxscan148_scan:
+    set_addr $I10, rxscan148_loop
+    rx145_cur."!mark_push"(0, rx145_pos, $I10)
+  rxscan148_done:
+.annotate "line", 52
+  # rx rxquantr149 ** 1..*
+    set_addr $I150, rxquantr149_done
+    rx145_cur."!mark_push"(0, -1, $I150)
+  rxquantr149_loop:
+  # rx subrule "ws" subtype=method negate=
+    rx145_cur."!cursor_pos"(rx145_pos)
+    $P10 = rx145_cur."ws"()
+    unless $P10, rx145_fail
+    rx145_pos = $P10."pos"()
+  # rx subrule "hexint" subtype=capture negate=
+    rx145_cur."!cursor_pos"(rx145_pos)
+    $P10 = rx145_cur."hexint"()
+    unless $P10, rx145_fail
+    rx145_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("hexint")
+    rx145_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx145_cur."!cursor_pos"(rx145_pos)
+    $P10 = rx145_cur."ws"()
+    unless $P10, rx145_fail
+    rx145_pos = $P10."pos"()
+    (rx145_rep) = rx145_cur."!mark_commit"($I150)
+    rx145_cur."!mark_push"(rx145_rep, rx145_pos, $I150)
+  # rx literal  ","
+    add $I11, rx145_pos, 1
+    gt $I11, rx145_eos, rx145_fail
+    sub $I11, rx145_pos, rx145_off
+    substr $S10, rx145_tgt, $I11, 1
+    ne $S10, ",", rx145_fail
+    add rx145_pos, 1
+    goto rxquantr149_loop
+  rxquantr149_done:
+  # rx pass
+    rx145_cur."!cursor_pass"(rx145_pos, "hexints")
+    rx145_cur."!cursor_debug"("PASS  ", "hexints", " at pos=", rx145_pos)
+    .return (rx145_cur)
+  rx145_fail:
+.annotate "line", 33
+    (rx145_rep, rx145_pos, $I10, $P10) = rx145_cur."!mark_fail"(0)
+    lt rx145_pos, -1, rx145_done
+    eq rx145_pos, -1, rx145_fail
+    jump $I10
+  rx145_done:
+    rx145_cur."!cursor_fail"()
+    rx145_cur."!cursor_debug"("FAIL  ", "hexints")
+    .return (rx145_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__hexints"  :subid("52_1261064003.48945") :method
+.annotate "line", 33
+    new $P147, "ResizablePMCArray"
+    push $P147, ""
+    .return ($P147)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "octint"  :subid("53_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 33
+    .local string rx152_tgt
+    .local int rx152_pos
+    .local int rx152_off
+    .local int rx152_eos
+    .local int rx152_rep
+    .local pmc rx152_cur
+    (rx152_cur, rx152_pos, rx152_tgt) = self."!cursor_start"()
+    rx152_cur."!cursor_debug"("START ", "octint")
+    .lex unicode:"$\x{a2}", rx152_cur
+    .local pmc match
+    .lex "$/", match
+    length rx152_eos, rx152_tgt
+    set rx152_off, 0
+    lt rx152_pos, 2, rx152_start
+    sub rx152_off, rx152_pos, 1
+    substr rx152_tgt, rx152_tgt, rx152_off
+  rx152_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan155_done
+    goto rxscan155_scan
+  rxscan155_loop:
+    ($P10) = rx152_cur."from"()
+    inc $P10
+    set rx152_pos, $P10
+    ge rx152_pos, rx152_eos, rxscan155_done
+  rxscan155_scan:
+    set_addr $I10, rxscan155_loop
+    rx152_cur."!mark_push"(0, rx152_pos, $I10)
+  rxscan155_done:
+.annotate "line", 54
+  # rx rxquantr156 ** 1..*
+    set_addr $I159, rxquantr156_done
+    rx152_cur."!mark_push"(0, -1, $I159)
+  rxquantr156_loop:
+  # rx rxquantr157 ** 1..*
+    set_addr $I158, rxquantr157_done
+    rx152_cur."!mark_push"(0, -1, $I158)
+  rxquantr157_loop:
+  # rx enumcharlist negate=0 
+    ge rx152_pos, rx152_eos, rx152_fail
+    sub $I10, rx152_pos, rx152_off
+    substr $S10, rx152_tgt, $I10, 1
+    index $I11, "01234567", $S10
+    lt $I11, 0, rx152_fail
+    inc rx152_pos
+    (rx152_rep) = rx152_cur."!mark_commit"($I158)
+    rx152_cur."!mark_push"(rx152_rep, rx152_pos, $I158)
+    goto rxquantr157_loop
+  rxquantr157_done:
+    (rx152_rep) = rx152_cur."!mark_commit"($I159)
+    rx152_cur."!mark_push"(rx152_rep, rx152_pos, $I159)
+  # rx literal  "_"
+    add $I11, rx152_pos, 1
+    gt $I11, rx152_eos, rx152_fail
+    sub $I11, rx152_pos, rx152_off
+    substr $S10, rx152_tgt, $I11, 1
+    ne $S10, "_", rx152_fail
+    add rx152_pos, 1
+    goto rxquantr156_loop
+  rxquantr156_done:
+  # rx pass
+    rx152_cur."!cursor_pass"(rx152_pos, "octint")
+    rx152_cur."!cursor_debug"("PASS  ", "octint", " at pos=", rx152_pos)
+    .return (rx152_cur)
+  rx152_fail:
+.annotate "line", 33
+    (rx152_rep, rx152_pos, $I10, $P10) = rx152_cur."!mark_fail"(0)
+    lt rx152_pos, -1, rx152_done
+    eq rx152_pos, -1, rx152_fail
+    jump $I10
+  rx152_done:
+    rx152_cur."!cursor_fail"()
+    rx152_cur."!cursor_debug"("FAIL  ", "octint")
+    .return (rx152_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__octint"  :subid("54_1261064003.48945") :method
+.annotate "line", 33
+    new $P154, "ResizablePMCArray"
+    push $P154, ""
+    .return ($P154)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "octints"  :subid("55_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 33
+    .local string rx161_tgt
+    .local int rx161_pos
+    .local int rx161_off
+    .local int rx161_eos
+    .local int rx161_rep
+    .local pmc rx161_cur
+    (rx161_cur, rx161_pos, rx161_tgt) = self."!cursor_start"()
+    rx161_cur."!cursor_debug"("START ", "octints")
+    rx161_cur."!cursor_caparray"("octint")
+    .lex unicode:"$\x{a2}", rx161_cur
+    .local pmc match
+    .lex "$/", match
+    length rx161_eos, rx161_tgt
+    set rx161_off, 0
+    lt rx161_pos, 2, rx161_start
+    sub rx161_off, rx161_pos, 1
+    substr rx161_tgt, rx161_tgt, rx161_off
+  rx161_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan164_done
+    goto rxscan164_scan
+  rxscan164_loop:
+    ($P10) = rx161_cur."from"()
+    inc $P10
+    set rx161_pos, $P10
+    ge rx161_pos, rx161_eos, rxscan164_done
+  rxscan164_scan:
+    set_addr $I10, rxscan164_loop
+    rx161_cur."!mark_push"(0, rx161_pos, $I10)
+  rxscan164_done:
+.annotate "line", 55
+  # rx rxquantr165 ** 1..*
+    set_addr $I166, rxquantr165_done
+    rx161_cur."!mark_push"(0, -1, $I166)
+  rxquantr165_loop:
+  # rx subrule "ws" subtype=method negate=
+    rx161_cur."!cursor_pos"(rx161_pos)
+    $P10 = rx161_cur."ws"()
+    unless $P10, rx161_fail
+    rx161_pos = $P10."pos"()
+  # rx subrule "octint" subtype=capture negate=
+    rx161_cur."!cursor_pos"(rx161_pos)
+    $P10 = rx161_cur."octint"()
+    unless $P10, rx161_fail
+    rx161_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("octint")
+    rx161_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx161_cur."!cursor_pos"(rx161_pos)
+    $P10 = rx161_cur."ws"()
+    unless $P10, rx161_fail
+    rx161_pos = $P10."pos"()
+    (rx161_rep) = rx161_cur."!mark_commit"($I166)
+    rx161_cur."!mark_push"(rx161_rep, rx161_pos, $I166)
+  # rx literal  ","
+    add $I11, rx161_pos, 1
+    gt $I11, rx161_eos, rx161_fail
+    sub $I11, rx161_pos, rx161_off
+    substr $S10, rx161_tgt, $I11, 1
+    ne $S10, ",", rx161_fail
+    add rx161_pos, 1
+    goto rxquantr165_loop
+  rxquantr165_done:
+  # rx pass
+    rx161_cur."!cursor_pass"(rx161_pos, "octints")
+    rx161_cur."!cursor_debug"("PASS  ", "octints", " at pos=", rx161_pos)
+    .return (rx161_cur)
+  rx161_fail:
+.annotate "line", 33
+    (rx161_rep, rx161_pos, $I10, $P10) = rx161_cur."!mark_fail"(0)
+    lt rx161_pos, -1, rx161_done
+    eq rx161_pos, -1, rx161_fail
+    jump $I10
+  rx161_done:
+    rx161_cur."!cursor_fail"()
+    rx161_cur."!cursor_debug"("FAIL  ", "octints")
+    .return (rx161_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__octints"  :subid("56_1261064003.48945") :method
+.annotate "line", 33
+    new $P163, "ResizablePMCArray"
+    push $P163, ""
+    .return ($P163)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "binint"  :subid("57_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 33
+    .local string rx168_tgt
+    .local int rx168_pos
+    .local int rx168_off
+    .local int rx168_eos
+    .local int rx168_rep
+    .local pmc rx168_cur
+    (rx168_cur, rx168_pos, rx168_tgt) = self."!cursor_start"()
+    rx168_cur."!cursor_debug"("START ", "binint")
+    .lex unicode:"$\x{a2}", rx168_cur
+    .local pmc match
+    .lex "$/", match
+    length rx168_eos, rx168_tgt
+    set rx168_off, 0
+    lt rx168_pos, 2, rx168_start
+    sub rx168_off, rx168_pos, 1
+    substr rx168_tgt, rx168_tgt, rx168_off
+  rx168_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan171_done
+    goto rxscan171_scan
+  rxscan171_loop:
+    ($P10) = rx168_cur."from"()
+    inc $P10
+    set rx168_pos, $P10
+    ge rx168_pos, rx168_eos, rxscan171_done
+  rxscan171_scan:
+    set_addr $I10, rxscan171_loop
+    rx168_cur."!mark_push"(0, rx168_pos, $I10)
+  rxscan171_done:
+.annotate "line", 57
+  # rx rxquantr172 ** 1..*
+    set_addr $I175, rxquantr172_done
+    rx168_cur."!mark_push"(0, -1, $I175)
+  rxquantr172_loop:
+  # rx rxquantr173 ** 1..*
+    set_addr $I174, rxquantr173_done
+    rx168_cur."!mark_push"(0, -1, $I174)
+  rxquantr173_loop:
+  # rx enumcharlist negate=0 
+    ge rx168_pos, rx168_eos, rx168_fail
+    sub $I10, rx168_pos, rx168_off
+    substr $S10, rx168_tgt, $I10, 1
+    index $I11, "01", $S10
+    lt $I11, 0, rx168_fail
+    inc rx168_pos
+    (rx168_rep) = rx168_cur."!mark_commit"($I174)
+    rx168_cur."!mark_push"(rx168_rep, rx168_pos, $I174)
+    goto rxquantr173_loop
+  rxquantr173_done:
+    (rx168_rep) = rx168_cur."!mark_commit"($I175)
+    rx168_cur."!mark_push"(rx168_rep, rx168_pos, $I175)
+  # rx literal  "_"
+    add $I11, rx168_pos, 1
+    gt $I11, rx168_eos, rx168_fail
+    sub $I11, rx168_pos, rx168_off
+    substr $S10, rx168_tgt, $I11, 1
+    ne $S10, "_", rx168_fail
+    add rx168_pos, 1
+    goto rxquantr172_loop
+  rxquantr172_done:
+  # rx pass
+    rx168_cur."!cursor_pass"(rx168_pos, "binint")
+    rx168_cur."!cursor_debug"("PASS  ", "binint", " at pos=", rx168_pos)
+    .return (rx168_cur)
+  rx168_fail:
+.annotate "line", 33
+    (rx168_rep, rx168_pos, $I10, $P10) = rx168_cur."!mark_fail"(0)
+    lt rx168_pos, -1, rx168_done
+    eq rx168_pos, -1, rx168_fail
+    jump $I10
+  rx168_done:
+    rx168_cur."!cursor_fail"()
+    rx168_cur."!cursor_debug"("FAIL  ", "binint")
+    .return (rx168_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__binint"  :subid("58_1261064003.48945") :method
+.annotate "line", 33
+    new $P170, "ResizablePMCArray"
+    push $P170, ""
+    .return ($P170)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "binints"  :subid("59_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 33
+    .local string rx177_tgt
+    .local int rx177_pos
+    .local int rx177_off
+    .local int rx177_eos
+    .local int rx177_rep
+    .local pmc rx177_cur
+    (rx177_cur, rx177_pos, rx177_tgt) = self."!cursor_start"()
+    rx177_cur."!cursor_debug"("START ", "binints")
+    rx177_cur."!cursor_caparray"("binint")
+    .lex unicode:"$\x{a2}", rx177_cur
+    .local pmc match
+    .lex "$/", match
+    length rx177_eos, rx177_tgt
+    set rx177_off, 0
+    lt rx177_pos, 2, rx177_start
+    sub rx177_off, rx177_pos, 1
+    substr rx177_tgt, rx177_tgt, rx177_off
+  rx177_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan180_done
+    goto rxscan180_scan
+  rxscan180_loop:
+    ($P10) = rx177_cur."from"()
+    inc $P10
+    set rx177_pos, $P10
+    ge rx177_pos, rx177_eos, rxscan180_done
+  rxscan180_scan:
+    set_addr $I10, rxscan180_loop
+    rx177_cur."!mark_push"(0, rx177_pos, $I10)
+  rxscan180_done:
+.annotate "line", 58
+  # rx rxquantr181 ** 1..*
+    set_addr $I182, rxquantr181_done
+    rx177_cur."!mark_push"(0, -1, $I182)
+  rxquantr181_loop:
+  # rx subrule "ws" subtype=method negate=
+    rx177_cur."!cursor_pos"(rx177_pos)
+    $P10 = rx177_cur."ws"()
+    unless $P10, rx177_fail
+    rx177_pos = $P10."pos"()
+  # rx subrule "binint" subtype=capture negate=
+    rx177_cur."!cursor_pos"(rx177_pos)
+    $P10 = rx177_cur."binint"()
+    unless $P10, rx177_fail
+    rx177_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("binint")
+    rx177_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx177_cur."!cursor_pos"(rx177_pos)
+    $P10 = rx177_cur."ws"()
+    unless $P10, rx177_fail
+    rx177_pos = $P10."pos"()
+    (rx177_rep) = rx177_cur."!mark_commit"($I182)
+    rx177_cur."!mark_push"(rx177_rep, rx177_pos, $I182)
+  # rx literal  ","
+    add $I11, rx177_pos, 1
+    gt $I11, rx177_eos, rx177_fail
+    sub $I11, rx177_pos, rx177_off
+    substr $S10, rx177_tgt, $I11, 1
+    ne $S10, ",", rx177_fail
+    add rx177_pos, 1
+    goto rxquantr181_loop
+  rxquantr181_done:
+  # rx pass
+    rx177_cur."!cursor_pass"(rx177_pos, "binints")
+    rx177_cur."!cursor_debug"("PASS  ", "binints", " at pos=", rx177_pos)
+    .return (rx177_cur)
+  rx177_fail:
+.annotate "line", 33
+    (rx177_rep, rx177_pos, $I10, $P10) = rx177_cur."!mark_fail"(0)
+    lt rx177_pos, -1, rx177_done
+    eq rx177_pos, -1, rx177_fail
+    jump $I10
+  rx177_done:
+    rx177_cur."!cursor_fail"()
+    rx177_cur."!cursor_debug"("FAIL  ", "binints")
+    .return (rx177_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__binints"  :subid("60_1261064003.48945") :method
+.annotate "line", 33
+    new $P179, "ResizablePMCArray"
+    push $P179, ""
+    .return ($P179)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "integer"  :subid("61_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 33
+    .local string rx184_tgt
+    .local int rx184_pos
+    .local int rx184_off
+    .local int rx184_eos
+    .local int rx184_rep
+    .local pmc rx184_cur
+    (rx184_cur, rx184_pos, rx184_tgt) = self."!cursor_start"()
+    rx184_cur."!cursor_debug"("START ", "integer")
+    .lex unicode:"$\x{a2}", rx184_cur
+    .local pmc match
+    .lex "$/", match
+    length rx184_eos, rx184_tgt
+    set rx184_off, 0
+    lt rx184_pos, 2, rx184_start
+    sub rx184_off, rx184_pos, 1
+    substr rx184_tgt, rx184_tgt, rx184_off
+  rx184_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan192_done
+    goto rxscan192_scan
+  rxscan192_loop:
+    ($P10) = rx184_cur."from"()
+    inc $P10
+    set rx184_pos, $P10
+    ge rx184_pos, rx184_eos, rxscan192_done
+  rxscan192_scan:
+    set_addr $I10, rxscan192_loop
+    rx184_cur."!mark_push"(0, rx184_pos, $I10)
+  rxscan192_done:
+  alt193_0:
+.annotate "line", 61
+    set_addr $I10, alt193_1
+    rx184_cur."!mark_push"(0, rx184_pos, $I10)
+.annotate "line", 62
+  # rx literal  "0"
+    add $I11, rx184_pos, 1
+    gt $I11, rx184_eos, rx184_fail
+    sub $I11, rx184_pos, rx184_off
+    substr $S10, rx184_tgt, $I11, 1
+    ne $S10, "0", rx184_fail
+    add rx184_pos, 1
+  alt194_0:
+    set_addr $I10, alt194_1
+    rx184_cur."!mark_push"(0, rx184_pos, $I10)
+  # rx literal  "b"
+    add $I11, rx184_pos, 1
+    gt $I11, rx184_eos, rx184_fail
+    sub $I11, rx184_pos, rx184_off
+    substr $S10, rx184_tgt, $I11, 1
+    ne $S10, "b", rx184_fail
+    add rx184_pos, 1
+  # rx subrule "binint" subtype=capture negate=
+    rx184_cur."!cursor_pos"(rx184_pos)
+    $P10 = rx184_cur."binint"()
+    unless $P10, rx184_fail
+    rx184_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("VALUE=binint")
+    rx184_pos = $P10."pos"()
+    goto alt194_end
+  alt194_1:
+    set_addr $I10, alt194_2
+    rx184_cur."!mark_push"(0, rx184_pos, $I10)
+.annotate "line", 63
+  # rx literal  "o"
+    add $I11, rx184_pos, 1
+    gt $I11, rx184_eos, rx184_fail
+    sub $I11, rx184_pos, rx184_off
+    substr $S10, rx184_tgt, $I11, 1
+    ne $S10, "o", rx184_fail
+    add rx184_pos, 1
+  # rx subrule "octint" subtype=capture negate=
+    rx184_cur."!cursor_pos"(rx184_pos)
+    $P10 = rx184_cur."octint"()
+    unless $P10, rx184_fail
+    rx184_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("VALUE=octint")
+    rx184_pos = $P10."pos"()
+    goto alt194_end
+  alt194_2:
+    set_addr $I10, alt194_3
+    rx184_cur."!mark_push"(0, rx184_pos, $I10)
+.annotate "line", 64
+  # rx literal  "x"
+    add $I11, rx184_pos, 1
+    gt $I11, rx184_eos, rx184_fail
+    sub $I11, rx184_pos, rx184_off
+    substr $S10, rx184_tgt, $I11, 1
+    ne $S10, "x", rx184_fail
+    add rx184_pos, 1
+  # rx subrule "hexint" subtype=capture negate=
+    rx184_cur."!cursor_pos"(rx184_pos)
+    $P10 = rx184_cur."hexint"()
+    unless $P10, rx184_fail
+    rx184_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("VALUE=hexint")
+    rx184_pos = $P10."pos"()
+    goto alt194_end
+  alt194_3:
+.annotate "line", 65
+  # rx literal  "d"
+    add $I11, rx184_pos, 1
+    gt $I11, rx184_eos, rx184_fail
+    sub $I11, rx184_pos, rx184_off
+    substr $S10, rx184_tgt, $I11, 1
+    ne $S10, "d", rx184_fail
+    add rx184_pos, 1
+  # rx subrule "decint" subtype=capture negate=
+    rx184_cur."!cursor_pos"(rx184_pos)
+    $P10 = rx184_cur."decint"()
+    unless $P10, rx184_fail
+    rx184_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("VALUE=decint")
+    rx184_pos = $P10."pos"()
+  alt194_end:
+.annotate "line", 62
+    goto alt193_end
+  alt193_1:
+.annotate "line", 67
+  # rx subrule "decint" subtype=capture negate=
+    rx184_cur."!cursor_pos"(rx184_pos)
+    $P10 = rx184_cur."decint"()
+    unless $P10, rx184_fail
+    rx184_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("VALUE=decint")
+    rx184_pos = $P10."pos"()
+  alt193_end:
+.annotate "line", 60
+  # rx pass
+    rx184_cur."!cursor_pass"(rx184_pos, "integer")
+    rx184_cur."!cursor_debug"("PASS  ", "integer", " at pos=", rx184_pos)
+    .return (rx184_cur)
+  rx184_fail:
+.annotate "line", 33
+    (rx184_rep, rx184_pos, $I10, $P10) = rx184_cur."!mark_fail"(0)
+    lt rx184_pos, -1, rx184_done
+    eq rx184_pos, -1, rx184_fail
+    jump $I10
+  rx184_done:
+    rx184_cur."!cursor_fail"()
+    rx184_cur."!cursor_debug"("FAIL  ", "integer")
+    .return (rx184_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__integer"  :subid("62_1261064003.48945") :method
+.annotate "line", 33
+    $P186 = self."!PREFIX__!subrule"("VALUE=decint", "")
+    $P187 = self."!PREFIX__!subrule"("VALUE=decint", "0d")
+    $P188 = self."!PREFIX__!subrule"("VALUE=hexint", "0x")
+    $P189 = self."!PREFIX__!subrule"("VALUE=octint", "0o")
+    $P190 = self."!PREFIX__!subrule"("VALUE=binint", "0b")
+    new $P191, "ResizablePMCArray"
+    push $P191, $P186
+    push $P191, $P187
+    push $P191, $P188
+    push $P191, $P189
+    push $P191, $P190
+    .return ($P191)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "dec_number"  :subid("63_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 33
+    .local string rx196_tgt
+    .local int rx196_pos
+    .local int rx196_off
+    .local int rx196_eos
+    .local int rx196_rep
+    .local pmc rx196_cur
+    (rx196_cur, rx196_pos, rx196_tgt) = self."!cursor_start"()
+    rx196_cur."!cursor_debug"("START ", "dec_number")
+    rx196_cur."!cursor_caparray"("escale")
+    .lex unicode:"$\x{a2}", rx196_cur
+    .local pmc match
+    .lex "$/", match
+    length rx196_eos, rx196_tgt
+    set rx196_off, 0
+    lt rx196_pos, 2, rx196_start
+    sub rx196_off, rx196_pos, 1
+    substr rx196_tgt, rx196_tgt, rx196_off
+  rx196_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan199_done
+    goto rxscan199_scan
+  rxscan199_loop:
+    ($P10) = rx196_cur."from"()
+    inc $P10
+    set rx196_pos, $P10
+    ge rx196_pos, rx196_eos, rxscan199_done
+  rxscan199_scan:
+    set_addr $I10, rxscan199_loop
+    rx196_cur."!mark_push"(0, rx196_pos, $I10)
+  rxscan199_done:
+  alt200_0:
+.annotate "line", 71
+    set_addr $I10, alt200_1
+    rx196_cur."!mark_push"(0, rx196_pos, $I10)
+.annotate "line", 72
+  # rx subcapture "coeff"
+    set_addr $I10, rxcap_201_fail
+    rx196_cur."!mark_push"(0, rx196_pos, $I10)
+  # rx literal  "."
+    add $I11, rx196_pos, 1
+    gt $I11, rx196_eos, rx196_fail
+    sub $I11, rx196_pos, rx196_off
+    substr $S10, rx196_tgt, $I11, 1
+    ne $S10, ".", rx196_fail
+    add rx196_pos, 1
+  # rx charclass_q d r 1..-1
+    sub $I10, rx196_pos, rx196_off
+    find_not_cclass $I11, 8, rx196_tgt, $I10, rx196_eos
+    add $I12, $I10, 1
+    lt $I11, $I12, rx196_fail
+    add rx196_pos, rx196_off, $I11
+    set_addr $I10, rxcap_201_fail
+    ($I12, $I11) = rx196_cur."!mark_peek"($I10)
+    rx196_cur."!cursor_pos"($I11)
+    ($P10) = rx196_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx196_pos, "")
+    rx196_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("coeff")
+    goto rxcap_201_done
+  rxcap_201_fail:
+    goto rx196_fail
+  rxcap_201_done:
+  # rx rxquantr202 ** 0..1
+    set_addr $I203, rxquantr202_done
+    rx196_cur."!mark_push"(0, rx196_pos, $I203)
+  rxquantr202_loop:
+  # rx subrule "escale" subtype=capture negate=
+    rx196_cur."!cursor_pos"(rx196_pos)
+    $P10 = rx196_cur."escale"()
+    unless $P10, rx196_fail
+    rx196_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("escale")
+    rx196_pos = $P10."pos"()
+    (rx196_rep) = rx196_cur."!mark_commit"($I203)
+  rxquantr202_done:
+    goto alt200_end
+  alt200_1:
+    set_addr $I10, alt200_2
+    rx196_cur."!mark_push"(0, rx196_pos, $I10)
+.annotate "line", 73
+  # rx subcapture "coeff"
+    set_addr $I10, rxcap_204_fail
+    rx196_cur."!mark_push"(0, rx196_pos, $I10)
+  # rx charclass_q d r 1..-1
+    sub $I10, rx196_pos, rx196_off
+    find_not_cclass $I11, 8, rx196_tgt, $I10, rx196_eos
+    add $I12, $I10, 1
+    lt $I11, $I12, rx196_fail
+    add rx196_pos, rx196_off, $I11
+  # rx literal  "."
+    add $I11, rx196_pos, 1
+    gt $I11, rx196_eos, rx196_fail
+    sub $I11, rx196_pos, rx196_off
+    substr $S10, rx196_tgt, $I11, 1
+    ne $S10, ".", rx196_fail
+    add rx196_pos, 1
+  # rx charclass_q d r 1..-1
+    sub $I10, rx196_pos, rx196_off
+    find_not_cclass $I11, 8, rx196_tgt, $I10, rx196_eos
+    add $I12, $I10, 1
+    lt $I11, $I12, rx196_fail
+    add rx196_pos, rx196_off, $I11
+    set_addr $I10, rxcap_204_fail
+    ($I12, $I11) = rx196_cur."!mark_peek"($I10)
+    rx196_cur."!cursor_pos"($I11)
+    ($P10) = rx196_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx196_pos, "")
+    rx196_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("coeff")
+    goto rxcap_204_done
+  rxcap_204_fail:
+    goto rx196_fail
+  rxcap_204_done:
+  # rx rxquantr205 ** 0..1
+    set_addr $I206, rxquantr205_done
+    rx196_cur."!mark_push"(0, rx196_pos, $I206)
+  rxquantr205_loop:
+  # rx subrule "escale" subtype=capture negate=
+    rx196_cur."!cursor_pos"(rx196_pos)
+    $P10 = rx196_cur."escale"()
+    unless $P10, rx196_fail
+    rx196_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("escale")
+    rx196_pos = $P10."pos"()
+    (rx196_rep) = rx196_cur."!mark_commit"($I206)
+  rxquantr205_done:
+    goto alt200_end
+  alt200_2:
+.annotate "line", 74
+  # rx subcapture "coeff"
+    set_addr $I10, rxcap_207_fail
+    rx196_cur."!mark_push"(0, rx196_pos, $I10)
+  # rx charclass_q d r 1..-1
+    sub $I10, rx196_pos, rx196_off
+    find_not_cclass $I11, 8, rx196_tgt, $I10, rx196_eos
+    add $I12, $I10, 1
+    lt $I11, $I12, rx196_fail
+    add rx196_pos, rx196_off, $I11
+    set_addr $I10, rxcap_207_fail
+    ($I12, $I11) = rx196_cur."!mark_peek"($I10)
+    rx196_cur."!cursor_pos"($I11)
+    ($P10) = rx196_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx196_pos, "")
+    rx196_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("coeff")
+    goto rxcap_207_done
+  rxcap_207_fail:
+    goto rx196_fail
+  rxcap_207_done:
+  # rx subrule "escale" subtype=capture negate=
+    rx196_cur."!cursor_pos"(rx196_pos)
+    $P10 = rx196_cur."escale"()
+    unless $P10, rx196_fail
+    rx196_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("escale")
+    rx196_pos = $P10."pos"()
+  alt200_end:
+.annotate "line", 71
+  # rx pass
+    rx196_cur."!cursor_pass"(rx196_pos, "dec_number")
+    rx196_cur."!cursor_debug"("PASS  ", "dec_number", " at pos=", rx196_pos)
+    .return (rx196_cur)
+  rx196_fail:
+.annotate "line", 33
+    (rx196_rep, rx196_pos, $I10, $P10) = rx196_cur."!mark_fail"(0)
+    lt rx196_pos, -1, rx196_done
+    eq rx196_pos, -1, rx196_fail
+    jump $I10
+  rx196_done:
+    rx196_cur."!cursor_fail"()
+    rx196_cur."!cursor_debug"("FAIL  ", "dec_number")
+    .return (rx196_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__dec_number"  :subid("64_1261064003.48945") :method
+.annotate "line", 33
+    new $P198, "ResizablePMCArray"
+    push $P198, ""
+    push $P198, ""
+    push $P198, "."
+    .return ($P198)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "escale"  :subid("65_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 33
+    .local string rx209_tgt
+    .local int rx209_pos
+    .local int rx209_off
+    .local int rx209_eos
+    .local int rx209_rep
+    .local pmc rx209_cur
+    (rx209_cur, rx209_pos, rx209_tgt) = self."!cursor_start"()
+    rx209_cur."!cursor_debug"("START ", "escale")
+    .lex unicode:"$\x{a2}", rx209_cur
+    .local pmc match
+    .lex "$/", match
+    length rx209_eos, rx209_tgt
+    set rx209_off, 0
+    lt rx209_pos, 2, rx209_start
+    sub rx209_off, rx209_pos, 1
+    substr rx209_tgt, rx209_tgt, rx209_off
+  rx209_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan212_done
+    goto rxscan212_scan
+  rxscan212_loop:
+    ($P10) = rx209_cur."from"()
+    inc $P10
+    set rx209_pos, $P10
+    ge rx209_pos, rx209_eos, rxscan212_done
+  rxscan212_scan:
+    set_addr $I10, rxscan212_loop
+    rx209_cur."!mark_push"(0, rx209_pos, $I10)
+  rxscan212_done:
+.annotate "line", 77
+  # rx enumcharlist negate=0 
+    ge rx209_pos, rx209_eos, rx209_fail
+    sub $I10, rx209_pos, rx209_off
+    substr $S10, rx209_tgt, $I10, 1
+    index $I11, "Ee", $S10
+    lt $I11, 0, rx209_fail
+    inc rx209_pos
+  # rx rxquantr213 ** 0..1
+    set_addr $I214, rxquantr213_done
+    rx209_cur."!mark_push"(0, rx209_pos, $I214)
+  rxquantr213_loop:
+  # rx enumcharlist negate=0 
+    ge rx209_pos, rx209_eos, rx209_fail
+    sub $I10, rx209_pos, rx209_off
+    substr $S10, rx209_tgt, $I10, 1
+    index $I11, "+-", $S10
+    lt $I11, 0, rx209_fail
+    inc rx209_pos
+    (rx209_rep) = rx209_cur."!mark_commit"($I214)
+  rxquantr213_done:
+  # rx charclass_q d r 1..-1
+    sub $I10, rx209_pos, rx209_off
+    find_not_cclass $I11, 8, rx209_tgt, $I10, rx209_eos
+    add $I12, $I10, 1
+    lt $I11, $I12, rx209_fail
+    add rx209_pos, rx209_off, $I11
+  # rx pass
+    rx209_cur."!cursor_pass"(rx209_pos, "escale")
+    rx209_cur."!cursor_debug"("PASS  ", "escale", " at pos=", rx209_pos)
+    .return (rx209_cur)
+  rx209_fail:
+.annotate "line", 33
+    (rx209_rep, rx209_pos, $I10, $P10) = rx209_cur."!mark_fail"(0)
+    lt rx209_pos, -1, rx209_done
+    eq rx209_pos, -1, rx209_fail
+    jump $I10
+  rx209_done:
+    rx209_cur."!cursor_fail"()
+    rx209_cur."!cursor_debug"("FAIL  ", "escale")
+    .return (rx209_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__escale"  :subid("66_1261064003.48945") :method
+.annotate "line", 33
+    new $P211, "ResizablePMCArray"
+    push $P211, "e"
+    push $P211, "E"
+    .return ($P211)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "quote_escape"  :subid("67_1261064003.48945") :method
+.annotate "line", 79
+    $P216 = self."!protoregex"("quote_escape")
+    .return ($P216)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__quote_escape"  :subid("68_1261064003.48945") :method
+.annotate "line", 79
+    $P218 = self."!PREFIX__!protoregex"("quote_escape")
+    .return ($P218)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "quote_escape:sym<backslash>"  :subid("69_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 33
+    .local string rx220_tgt
+    .local int rx220_pos
+    .local int rx220_off
+    .local int rx220_eos
+    .local int rx220_rep
+    .local pmc rx220_cur
+    (rx220_cur, rx220_pos, rx220_tgt) = self."!cursor_start"()
+    rx220_cur."!cursor_debug"("START ", "quote_escape:sym<backslash>")
+    .lex unicode:"$\x{a2}", rx220_cur
+    .local pmc match
+    .lex "$/", match
+    length rx220_eos, rx220_tgt
+    set rx220_off, 0
+    lt rx220_pos, 2, rx220_start
+    sub rx220_off, rx220_pos, 1
+    substr rx220_tgt, rx220_tgt, rx220_off
+  rx220_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan223_done
+    goto rxscan223_scan
+  rxscan223_loop:
+    ($P10) = rx220_cur."from"()
+    inc $P10
+    set rx220_pos, $P10
+    ge rx220_pos, rx220_eos, rxscan223_done
+  rxscan223_scan:
+    set_addr $I10, rxscan223_loop
+    rx220_cur."!mark_push"(0, rx220_pos, $I10)
+  rxscan223_done:
+.annotate "line", 80
+  # rx literal  "\\\\"
+    add $I11, rx220_pos, 2
+    gt $I11, rx220_eos, rx220_fail
+    sub $I11, rx220_pos, rx220_off
+    substr $S10, rx220_tgt, $I11, 2
+    ne $S10, "\\\\", rx220_fail
+    add rx220_pos, 2
+  # rx subrule "quotemod_check" subtype=zerowidth negate=
+    rx220_cur."!cursor_pos"(rx220_pos)
+    $P10 = rx220_cur."quotemod_check"("q")
+    unless $P10, rx220_fail
+  # rx pass
+    rx220_cur."!cursor_pass"(rx220_pos, "quote_escape:sym<backslash>")
+    rx220_cur."!cursor_debug"("PASS  ", "quote_escape:sym<backslash>", " at pos=", rx220_pos)
+    .return (rx220_cur)
+  rx220_fail:
+.annotate "line", 33
+    (rx220_rep, rx220_pos, $I10, $P10) = rx220_cur."!mark_fail"(0)
+    lt rx220_pos, -1, rx220_done
+    eq rx220_pos, -1, rx220_fail
+    jump $I10
+  rx220_done:
+    rx220_cur."!cursor_fail"()
+    rx220_cur."!cursor_debug"("FAIL  ", "quote_escape:sym<backslash>")
+    .return (rx220_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__quote_escape:sym<backslash>"  :subid("70_1261064003.48945") :method
+.annotate "line", 33
+    new $P222, "ResizablePMCArray"
+    push $P222, "\\\\"
+    .return ($P222)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "quote_escape:sym<stopper>"  :subid("71_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 33
+    .local string rx225_tgt
+    .local int rx225_pos
+    .local int rx225_off
+    .local int rx225_eos
+    .local int rx225_rep
+    .local pmc rx225_cur
+    (rx225_cur, rx225_pos, rx225_tgt) = self."!cursor_start"()
+    rx225_cur."!cursor_debug"("START ", "quote_escape:sym<stopper>")
+    .lex unicode:"$\x{a2}", rx225_cur
+    .local pmc match
+    .lex "$/", match
+    length rx225_eos, rx225_tgt
+    set rx225_off, 0
+    lt rx225_pos, 2, rx225_start
+    sub rx225_off, rx225_pos, 1
+    substr rx225_tgt, rx225_tgt, rx225_off
+  rx225_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan228_done
+    goto rxscan228_scan
+  rxscan228_loop:
+    ($P10) = rx225_cur."from"()
+    inc $P10
+    set rx225_pos, $P10
+    ge rx225_pos, rx225_eos, rxscan228_done
+  rxscan228_scan:
+    set_addr $I10, rxscan228_loop
+    rx225_cur."!mark_push"(0, rx225_pos, $I10)
+  rxscan228_done:
+.annotate "line", 81
+  # rx literal  "\\"
+    add $I11, rx225_pos, 1
+    gt $I11, rx225_eos, rx225_fail
+    sub $I11, rx225_pos, rx225_off
+    substr $S10, rx225_tgt, $I11, 1
+    ne $S10, "\\", rx225_fail
+    add rx225_pos, 1
+  # rx subrule "quotemod_check" subtype=zerowidth negate=
+    rx225_cur."!cursor_pos"(rx225_pos)
+    $P10 = rx225_cur."quotemod_check"("q")
+    unless $P10, rx225_fail
+  # rx subrule "stopper" subtype=capture negate=
+    rx225_cur."!cursor_pos"(rx225_pos)
+    $P10 = rx225_cur."stopper"()
+    unless $P10, rx225_fail
+    rx225_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("stopper")
+    rx225_pos = $P10."pos"()
+  # rx pass
+    rx225_cur."!cursor_pass"(rx225_pos, "quote_escape:sym<stopper>")
+    rx225_cur."!cursor_debug"("PASS  ", "quote_escape:sym<stopper>", " at pos=", rx225_pos)
+    .return (rx225_cur)
+  rx225_fail:
+.annotate "line", 33
+    (rx225_rep, rx225_pos, $I10, $P10) = rx225_cur."!mark_fail"(0)
+    lt rx225_pos, -1, rx225_done
+    eq rx225_pos, -1, rx225_fail
+    jump $I10
+  rx225_done:
+    rx225_cur."!cursor_fail"()
+    rx225_cur."!cursor_debug"("FAIL  ", "quote_escape:sym<stopper>")
+    .return (rx225_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__quote_escape:sym<stopper>"  :subid("72_1261064003.48945") :method
+.annotate "line", 33
+    new $P227, "ResizablePMCArray"
+    push $P227, "\\"
+    .return ($P227)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "quote_escape:sym<bs>"  :subid("73_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 33
+    .local string rx230_tgt
+    .local int rx230_pos
+    .local int rx230_off
+    .local int rx230_eos
+    .local int rx230_rep
+    .local pmc rx230_cur
+    (rx230_cur, rx230_pos, rx230_tgt) = self."!cursor_start"()
+    rx230_cur."!cursor_debug"("START ", "quote_escape:sym<bs>")
+    .lex unicode:"$\x{a2}", rx230_cur
+    .local pmc match
+    .lex "$/", match
+    length rx230_eos, rx230_tgt
+    set rx230_off, 0
+    lt rx230_pos, 2, rx230_start
+    sub rx230_off, rx230_pos, 1
+    substr rx230_tgt, rx230_tgt, rx230_off
+  rx230_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan233_done
+    goto rxscan233_scan
+  rxscan233_loop:
+    ($P10) = rx230_cur."from"()
+    inc $P10
+    set rx230_pos, $P10
+    ge rx230_pos, rx230_eos, rxscan233_done
+  rxscan233_scan:
+    set_addr $I10, rxscan233_loop
+    rx230_cur."!mark_push"(0, rx230_pos, $I10)
+  rxscan233_done:
+.annotate "line", 83
+  # rx literal  "\\b"
+    add $I11, rx230_pos, 2
+    gt $I11, rx230_eos, rx230_fail
+    sub $I11, rx230_pos, rx230_off
+    substr $S10, rx230_tgt, $I11, 2
+    ne $S10, "\\b", rx230_fail
+    add rx230_pos, 2
+  # rx subrule "quotemod_check" subtype=zerowidth negate=
+    rx230_cur."!cursor_pos"(rx230_pos)
+    $P10 = rx230_cur."quotemod_check"("b")
+    unless $P10, rx230_fail
+  # rx pass
+    rx230_cur."!cursor_pass"(rx230_pos, "quote_escape:sym<bs>")
+    rx230_cur."!cursor_debug"("PASS  ", "quote_escape:sym<bs>", " at pos=", rx230_pos)
+    .return (rx230_cur)
+  rx230_fail:
+.annotate "line", 33
+    (rx230_rep, rx230_pos, $I10, $P10) = rx230_cur."!mark_fail"(0)
+    lt rx230_pos, -1, rx230_done
+    eq rx230_pos, -1, rx230_fail
+    jump $I10
+  rx230_done:
+    rx230_cur."!cursor_fail"()
+    rx230_cur."!cursor_debug"("FAIL  ", "quote_escape:sym<bs>")
+    .return (rx230_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__quote_escape:sym<bs>"  :subid("74_1261064003.48945") :method
+.annotate "line", 33
+    new $P232, "ResizablePMCArray"
+    push $P232, "\\b"
+    .return ($P232)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "quote_escape:sym<nl>"  :subid("75_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 33
+    .local string rx235_tgt
+    .local int rx235_pos
+    .local int rx235_off
+    .local int rx235_eos
+    .local int rx235_rep
+    .local pmc rx235_cur
+    (rx235_cur, rx235_pos, rx235_tgt) = self."!cursor_start"()
+    rx235_cur."!cursor_debug"("START ", "quote_escape:sym<nl>")
+    .lex unicode:"$\x{a2}", rx235_cur
+    .local pmc match
+    .lex "$/", match
+    length rx235_eos, rx235_tgt
+    set rx235_off, 0
+    lt rx235_pos, 2, rx235_start
+    sub rx235_off, rx235_pos, 1
+    substr rx235_tgt, rx235_tgt, rx235_off
+  rx235_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan238_done
+    goto rxscan238_scan
+  rxscan238_loop:
+    ($P10) = rx235_cur."from"()
+    inc $P10
+    set rx235_pos, $P10
+    ge rx235_pos, rx235_eos, rxscan238_done
+  rxscan238_scan:
+    set_addr $I10, rxscan238_loop
+    rx235_cur."!mark_push"(0, rx235_pos, $I10)
+  rxscan238_done:
+.annotate "line", 84
+  # rx literal  "\\n"
+    add $I11, rx235_pos, 2
+    gt $I11, rx235_eos, rx235_fail
+    sub $I11, rx235_pos, rx235_off
+    substr $S10, rx235_tgt, $I11, 2
+    ne $S10, "\\n", rx235_fail
+    add rx235_pos, 2
+  # rx subrule "quotemod_check" subtype=zerowidth negate=
+    rx235_cur."!cursor_pos"(rx235_pos)
+    $P10 = rx235_cur."quotemod_check"("b")
+    unless $P10, rx235_fail
+  # rx pass
+    rx235_cur."!cursor_pass"(rx235_pos, "quote_escape:sym<nl>")
+    rx235_cur."!cursor_debug"("PASS  ", "quote_escape:sym<nl>", " at pos=", rx235_pos)
+    .return (rx235_cur)
+  rx235_fail:
+.annotate "line", 33
+    (rx235_rep, rx235_pos, $I10, $P10) = rx235_cur."!mark_fail"(0)
+    lt rx235_pos, -1, rx235_done
+    eq rx235_pos, -1, rx235_fail
+    jump $I10
+  rx235_done:
+    rx235_cur."!cursor_fail"()
+    rx235_cur."!cursor_debug"("FAIL  ", "quote_escape:sym<nl>")
+    .return (rx235_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__quote_escape:sym<nl>"  :subid("76_1261064003.48945") :method
+.annotate "line", 33
+    new $P237, "ResizablePMCArray"
+    push $P237, "\\n"
+    .return ($P237)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "quote_escape:sym<cr>"  :subid("77_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 33
+    .local string rx240_tgt
+    .local int rx240_pos
+    .local int rx240_off
+    .local int rx240_eos
+    .local int rx240_rep
+    .local pmc rx240_cur
+    (rx240_cur, rx240_pos, rx240_tgt) = self."!cursor_start"()
+    rx240_cur."!cursor_debug"("START ", "quote_escape:sym<cr>")
+    .lex unicode:"$\x{a2}", rx240_cur
+    .local pmc match
+    .lex "$/", match
+    length rx240_eos, rx240_tgt
+    set rx240_off, 0
+    lt rx240_pos, 2, rx240_start
+    sub rx240_off, rx240_pos, 1
+    substr rx240_tgt, rx240_tgt, rx240_off
+  rx240_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan243_done
+    goto rxscan243_scan
+  rxscan243_loop:
+    ($P10) = rx240_cur."from"()
+    inc $P10
+    set rx240_pos, $P10
+    ge rx240_pos, rx240_eos, rxscan243_done
+  rxscan243_scan:
+    set_addr $I10, rxscan243_loop
+    rx240_cur."!mark_push"(0, rx240_pos, $I10)
+  rxscan243_done:
+.annotate "line", 85
+  # rx literal  "\\r"
+    add $I11, rx240_pos, 2
+    gt $I11, rx240_eos, rx240_fail
+    sub $I11, rx240_pos, rx240_off
+    substr $S10, rx240_tgt, $I11, 2
+    ne $S10, "\\r", rx240_fail
+    add rx240_pos, 2
+  # rx subrule "quotemod_check" subtype=zerowidth negate=
+    rx240_cur."!cursor_pos"(rx240_pos)
+    $P10 = rx240_cur."quotemod_check"("b")
+    unless $P10, rx240_fail
+  # rx pass
+    rx240_cur."!cursor_pass"(rx240_pos, "quote_escape:sym<cr>")
+    rx240_cur."!cursor_debug"("PASS  ", "quote_escape:sym<cr>", " at pos=", rx240_pos)
+    .return (rx240_cur)
+  rx240_fail:
+.annotate "line", 33
+    (rx240_rep, rx240_pos, $I10, $P10) = rx240_cur."!mark_fail"(0)
+    lt rx240_pos, -1, rx240_done
+    eq rx240_pos, -1, rx240_fail
+    jump $I10
+  rx240_done:
+    rx240_cur."!cursor_fail"()
+    rx240_cur."!cursor_debug"("FAIL  ", "quote_escape:sym<cr>")
+    .return (rx240_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__quote_escape:sym<cr>"  :subid("78_1261064003.48945") :method
+.annotate "line", 33
+    new $P242, "ResizablePMCArray"
+    push $P242, "\\r"
+    .return ($P242)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "quote_escape:sym<tab>"  :subid("79_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 33
+    .local string rx245_tgt
+    .local int rx245_pos
+    .local int rx245_off
+    .local int rx245_eos
+    .local int rx245_rep
+    .local pmc rx245_cur
+    (rx245_cur, rx245_pos, rx245_tgt) = self."!cursor_start"()
+    rx245_cur."!cursor_debug"("START ", "quote_escape:sym<tab>")
+    .lex unicode:"$\x{a2}", rx245_cur
+    .local pmc match
+    .lex "$/", match
+    length rx245_eos, rx245_tgt
+    set rx245_off, 0
+    lt rx245_pos, 2, rx245_start
+    sub rx245_off, rx245_pos, 1
+    substr rx245_tgt, rx245_tgt, rx245_off
+  rx245_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan248_done
+    goto rxscan248_scan
+  rxscan248_loop:
+    ($P10) = rx245_cur."from"()
+    inc $P10
+    set rx245_pos, $P10
+    ge rx245_pos, rx245_eos, rxscan248_done
+  rxscan248_scan:
+    set_addr $I10, rxscan248_loop
+    rx245_cur."!mark_push"(0, rx245_pos, $I10)
+  rxscan248_done:
+.annotate "line", 86
+  # rx literal  "\\t"
+    add $I11, rx245_pos, 2
+    gt $I11, rx245_eos, rx245_fail
+    sub $I11, rx245_pos, rx245_off
+    substr $S10, rx245_tgt, $I11, 2
+    ne $S10, "\\t", rx245_fail
+    add rx245_pos, 2
+  # rx subrule "quotemod_check" subtype=zerowidth negate=
+    rx245_cur."!cursor_pos"(rx245_pos)
+    $P10 = rx245_cur."quotemod_check"("b")
+    unless $P10, rx245_fail
+  # rx pass
+    rx245_cur."!cursor_pass"(rx245_pos, "quote_escape:sym<tab>")
+    rx245_cur."!cursor_debug"("PASS  ", "quote_escape:sym<tab>", " at pos=", rx245_pos)
+    .return (rx245_cur)
+  rx245_fail:
+.annotate "line", 33
+    (rx245_rep, rx245_pos, $I10, $P10) = rx245_cur."!mark_fail"(0)
+    lt rx245_pos, -1, rx245_done
+    eq rx245_pos, -1, rx245_fail
+    jump $I10
+  rx245_done:
+    rx245_cur."!cursor_fail"()
+    rx245_cur."!cursor_debug"("FAIL  ", "quote_escape:sym<tab>")
+    .return (rx245_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__quote_escape:sym<tab>"  :subid("80_1261064003.48945") :method
+.annotate "line", 33
+    new $P247, "ResizablePMCArray"
+    push $P247, "\\t"
+    .return ($P247)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "quote_escape:sym<hex>"  :subid("81_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 33
+    .local string rx250_tgt
+    .local int rx250_pos
+    .local int rx250_off
+    .local int rx250_eos
+    .local int rx250_rep
+    .local pmc rx250_cur
+    (rx250_cur, rx250_pos, rx250_tgt) = self."!cursor_start"()
+    rx250_cur."!cursor_debug"("START ", "quote_escape:sym<hex>")
+    .lex unicode:"$\x{a2}", rx250_cur
+    .local pmc match
+    .lex "$/", match
+    length rx250_eos, rx250_tgt
+    set rx250_off, 0
+    lt rx250_pos, 2, rx250_start
+    sub rx250_off, rx250_pos, 1
+    substr rx250_tgt, rx250_tgt, rx250_off
+  rx250_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan253_done
+    goto rxscan253_scan
+  rxscan253_loop:
+    ($P10) = rx250_cur."from"()
+    inc $P10
+    set rx250_pos, $P10
+    ge rx250_pos, rx250_eos, rxscan253_done
+  rxscan253_scan:
+    set_addr $I10, rxscan253_loop
+    rx250_cur."!mark_push"(0, rx250_pos, $I10)
+  rxscan253_done:
+.annotate "line", 88
+  # rx literal  unicode:"\\x"
+    add $I11, rx250_pos, 2
+    gt $I11, rx250_eos, rx250_fail
+    sub $I11, rx250_pos, rx250_off
+    substr $S10, rx250_tgt, $I11, 2
+    ne $S10, unicode:"\\x", rx250_fail
+    add rx250_pos, 2
+  # rx subrule "quotemod_check" subtype=zerowidth negate=
+    rx250_cur."!cursor_pos"(rx250_pos)
+    $P10 = rx250_cur."quotemod_check"("b")
+    unless $P10, rx250_fail
+  alt254_0:
+.annotate "line", 89
+    set_addr $I10, alt254_1
+    rx250_cur."!mark_push"(0, rx250_pos, $I10)
+  # rx subrule "hexint" subtype=capture negate=
+    rx250_cur."!cursor_pos"(rx250_pos)
+    $P10 = rx250_cur."hexint"()
+    unless $P10, rx250_fail
+    rx250_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("hexint")
+    rx250_pos = $P10."pos"()
+    goto alt254_end
+  alt254_1:
+  # rx literal  "["
+    add $I11, rx250_pos, 1
+    gt $I11, rx250_eos, rx250_fail
+    sub $I11, rx250_pos, rx250_off
+    substr $S10, rx250_tgt, $I11, 1
+    ne $S10, "[", rx250_fail
+    add rx250_pos, 1
+  # rx subrule "hexints" subtype=capture negate=
+    rx250_cur."!cursor_pos"(rx250_pos)
+    $P10 = rx250_cur."hexints"()
+    unless $P10, rx250_fail
+    rx250_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("hexints")
+    rx250_pos = $P10."pos"()
+  # rx literal  "]"
+    add $I11, rx250_pos, 1
+    gt $I11, rx250_eos, rx250_fail
+    sub $I11, rx250_pos, rx250_off
+    substr $S10, rx250_tgt, $I11, 1
+    ne $S10, "]", rx250_fail
+    add rx250_pos, 1
+  alt254_end:
+.annotate "line", 87
+  # rx pass
+    rx250_cur."!cursor_pass"(rx250_pos, "quote_escape:sym<hex>")
+    rx250_cur."!cursor_debug"("PASS  ", "quote_escape:sym<hex>", " at pos=", rx250_pos)
+    .return (rx250_cur)
+  rx250_fail:
+.annotate "line", 33
+    (rx250_rep, rx250_pos, $I10, $P10) = rx250_cur."!mark_fail"(0)
+    lt rx250_pos, -1, rx250_done
+    eq rx250_pos, -1, rx250_fail
+    jump $I10
+  rx250_done:
+    rx250_cur."!cursor_fail"()
+    rx250_cur."!cursor_debug"("FAIL  ", "quote_escape:sym<hex>")
+    .return (rx250_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__quote_escape:sym<hex>"  :subid("82_1261064003.48945") :method
+.annotate "line", 33
+    new $P252, "ResizablePMCArray"
+    push $P252, unicode:"\\x"
+    .return ($P252)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "quote_escape:sym<oct>"  :subid("83_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 33
+    .local string rx256_tgt
+    .local int rx256_pos
+    .local int rx256_off
+    .local int rx256_eos
+    .local int rx256_rep
+    .local pmc rx256_cur
+    (rx256_cur, rx256_pos, rx256_tgt) = self."!cursor_start"()
+    rx256_cur."!cursor_debug"("START ", "quote_escape:sym<oct>")
+    .lex unicode:"$\x{a2}", rx256_cur
+    .local pmc match
+    .lex "$/", match
+    length rx256_eos, rx256_tgt
+    set rx256_off, 0
+    lt rx256_pos, 2, rx256_start
+    sub rx256_off, rx256_pos, 1
+    substr rx256_tgt, rx256_tgt, rx256_off
+  rx256_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan259_done
+    goto rxscan259_scan
+  rxscan259_loop:
+    ($P10) = rx256_cur."from"()
+    inc $P10
+    set rx256_pos, $P10
+    ge rx256_pos, rx256_eos, rxscan259_done
+  rxscan259_scan:
+    set_addr $I10, rxscan259_loop
+    rx256_cur."!mark_push"(0, rx256_pos, $I10)
+  rxscan259_done:
+.annotate "line", 92
+  # rx literal  "\\o"
+    add $I11, rx256_pos, 2
+    gt $I11, rx256_eos, rx256_fail
+    sub $I11, rx256_pos, rx256_off
+    substr $S10, rx256_tgt, $I11, 2
+    ne $S10, "\\o", rx256_fail
+    add rx256_pos, 2
+  # rx subrule "quotemod_check" subtype=zerowidth negate=
+    rx256_cur."!cursor_pos"(rx256_pos)
+    $P10 = rx256_cur."quotemod_check"("b")
+    unless $P10, rx256_fail
+  alt260_0:
+.annotate "line", 93
+    set_addr $I10, alt260_1
+    rx256_cur."!mark_push"(0, rx256_pos, $I10)
+  # rx subrule "octint" subtype=capture negate=
+    rx256_cur."!cursor_pos"(rx256_pos)
+    $P10 = rx256_cur."octint"()
+    unless $P10, rx256_fail
+    rx256_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("octint")
+    rx256_pos = $P10."pos"()
+    goto alt260_end
+  alt260_1:
+  # rx literal  "["
+    add $I11, rx256_pos, 1
+    gt $I11, rx256_eos, rx256_fail
+    sub $I11, rx256_pos, rx256_off
+    substr $S10, rx256_tgt, $I11, 1
+    ne $S10, "[", rx256_fail
+    add rx256_pos, 1
+  # rx subrule "octints" subtype=capture negate=
+    rx256_cur."!cursor_pos"(rx256_pos)
+    $P10 = rx256_cur."octints"()
+    unless $P10, rx256_fail
+    rx256_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("octints")
+    rx256_pos = $P10."pos"()
+  # rx literal  "]"
+    add $I11, rx256_pos, 1
+    gt $I11, rx256_eos, rx256_fail
+    sub $I11, rx256_pos, rx256_off
+    substr $S10, rx256_tgt, $I11, 1
+    ne $S10, "]", rx256_fail
+    add rx256_pos, 1
+  alt260_end:
+.annotate "line", 91
+  # rx pass
+    rx256_cur."!cursor_pass"(rx256_pos, "quote_escape:sym<oct>")
+    rx256_cur."!cursor_debug"("PASS  ", "quote_escape:sym<oct>", " at pos=", rx256_pos)
+    .return (rx256_cur)
+  rx256_fail:
+.annotate "line", 33
+    (rx256_rep, rx256_pos, $I10, $P10) = rx256_cur."!mark_fail"(0)
+    lt rx256_pos, -1, rx256_done
+    eq rx256_pos, -1, rx256_fail
+    jump $I10
+  rx256_done:
+    rx256_cur."!cursor_fail"()
+    rx256_cur."!cursor_debug"("FAIL  ", "quote_escape:sym<oct>")
+    .return (rx256_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__quote_escape:sym<oct>"  :subid("84_1261064003.48945") :method
+.annotate "line", 33
+    new $P258, "ResizablePMCArray"
+    push $P258, "\\o"
+    .return ($P258)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "quote_escape:sym<chr>"  :subid("85_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 33
+    .local string rx262_tgt
+    .local int rx262_pos
+    .local int rx262_off
+    .local int rx262_eos
+    .local int rx262_rep
+    .local pmc rx262_cur
+    (rx262_cur, rx262_pos, rx262_tgt) = self."!cursor_start"()
+    rx262_cur."!cursor_debug"("START ", "quote_escape:sym<chr>")
+    .lex unicode:"$\x{a2}", rx262_cur
+    .local pmc match
+    .lex "$/", match
+    length rx262_eos, rx262_tgt
+    set rx262_off, 0
+    lt rx262_pos, 2, rx262_start
+    sub rx262_off, rx262_pos, 1
+    substr rx262_tgt, rx262_tgt, rx262_off
+  rx262_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan265_done
+    goto rxscan265_scan
+  rxscan265_loop:
+    ($P10) = rx262_cur."from"()
+    inc $P10
+    set rx262_pos, $P10
+    ge rx262_pos, rx262_eos, rxscan265_done
+  rxscan265_scan:
+    set_addr $I10, rxscan265_loop
+    rx262_cur."!mark_push"(0, rx262_pos, $I10)
+  rxscan265_done:
+.annotate "line", 95
+  # rx literal  "\\c"
+    add $I11, rx262_pos, 2
+    gt $I11, rx262_eos, rx262_fail
+    sub $I11, rx262_pos, rx262_off
+    substr $S10, rx262_tgt, $I11, 2
+    ne $S10, "\\c", rx262_fail
+    add rx262_pos, 2
+  # rx subrule "quotemod_check" subtype=zerowidth negate=
+    rx262_cur."!cursor_pos"(rx262_pos)
+    $P10 = rx262_cur."quotemod_check"("b")
+    unless $P10, rx262_fail
+  # rx subrule "charspec" subtype=capture negate=
+    rx262_cur."!cursor_pos"(rx262_pos)
+    $P10 = rx262_cur."charspec"()
+    unless $P10, rx262_fail
+    rx262_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("charspec")
+    rx262_pos = $P10."pos"()
+  # rx pass
+    rx262_cur."!cursor_pass"(rx262_pos, "quote_escape:sym<chr>")
+    rx262_cur."!cursor_debug"("PASS  ", "quote_escape:sym<chr>", " at pos=", rx262_pos)
+    .return (rx262_cur)
+  rx262_fail:
+.annotate "line", 33
+    (rx262_rep, rx262_pos, $I10, $P10) = rx262_cur."!mark_fail"(0)
+    lt rx262_pos, -1, rx262_done
+    eq rx262_pos, -1, rx262_fail
+    jump $I10
+  rx262_done:
+    rx262_cur."!cursor_fail"()
+    rx262_cur."!cursor_debug"("FAIL  ", "quote_escape:sym<chr>")
+    .return (rx262_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__quote_escape:sym<chr>"  :subid("86_1261064003.48945") :method
+.annotate "line", 33
+    new $P264, "ResizablePMCArray"
+    push $P264, "\\c"
+    .return ($P264)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "charname"  :subid("87_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 33
+    .const 'Sub' $P276 = "89_1261064003.48945" 
+    capture_lex $P276
+    .local string rx267_tgt
+    .local int rx267_pos
+    .local int rx267_off
+    .local int rx267_eos
+    .local int rx267_rep
+    .local pmc rx267_cur
+    (rx267_cur, rx267_pos, rx267_tgt) = self."!cursor_start"()
+    rx267_cur."!cursor_debug"("START ", "charname")
+    .lex unicode:"$\x{a2}", rx267_cur
+    .local pmc match
+    .lex "$/", match
+    length rx267_eos, rx267_tgt
+    set rx267_off, 0
+    lt rx267_pos, 2, rx267_start
+    sub rx267_off, rx267_pos, 1
+    substr rx267_tgt, rx267_tgt, rx267_off
+  rx267_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan271_done
+    goto rxscan271_scan
+  rxscan271_loop:
+    ($P10) = rx267_cur."from"()
+    inc $P10
+    set rx267_pos, $P10
+    ge rx267_pos, rx267_eos, rxscan271_done
+  rxscan271_scan:
+    set_addr $I10, rxscan271_loop
+    rx267_cur."!mark_push"(0, rx267_pos, $I10)
+  rxscan271_done:
+  alt272_0:
+.annotate "line", 97
+    set_addr $I10, alt272_1
+    rx267_cur."!mark_push"(0, rx267_pos, $I10)
+.annotate "line", 98
+  # rx subrule "integer" subtype=capture negate=
+    rx267_cur."!cursor_pos"(rx267_pos)
+    $P10 = rx267_cur."integer"()
+    unless $P10, rx267_fail
+    rx267_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("integer")
+    rx267_pos = $P10."pos"()
+    goto alt272_end
+  alt272_1:
+.annotate "line", 99
+  # rx enumcharlist negate=0 
+    ge rx267_pos, rx267_eos, rx267_fail
+    sub $I10, rx267_pos, rx267_off
+    substr $S10, rx267_tgt, $I10, 1
+    index $I11, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", $S10
+    lt $I11, 0, rx267_fail
+    inc rx267_pos
+  # rx rxquantf273 ** 0..*
+    set_addr $I10, rxquantf273_loop
+    rx267_cur."!mark_push"(0, rx267_pos, $I10)
+    goto rxquantf273_done
+  rxquantf273_loop:
+  # rx enumcharlist negate=1 
+    ge rx267_pos, rx267_eos, rx267_fail
+    sub $I10, rx267_pos, rx267_off
+    substr $S10, rx267_tgt, $I10, 1
+    index $I11, "],#", $S10
+    ge $I11, 0, rx267_fail
+    inc rx267_pos
+    set_addr $I10, rxquantf273_loop
+    rx267_cur."!mark_push"($I274, rx267_pos, $I10)
+  rxquantf273_done:
+  # rx enumcharlist negate=0 
+    ge rx267_pos, rx267_eos, rx267_fail
+    sub $I10, rx267_pos, rx267_off
+    substr $S10, rx267_tgt, $I10, 1
+    index $I11, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ)", $S10
+    lt $I11, 0, rx267_fail
+    inc rx267_pos
+.annotate "line", 100
+  # rx subrule "before" subtype=zerowidth negate=
+    rx267_cur."!cursor_pos"(rx267_pos)
+    .const 'Sub' $P276 = "89_1261064003.48945" 
+    capture_lex $P276
+    $P10 = rx267_cur."before"($P276)
+    unless $P10, rx267_fail
+  alt272_end:
+.annotate "line", 97
+  # rx pass
+    rx267_cur."!cursor_pass"(rx267_pos, "charname")
+    rx267_cur."!cursor_debug"("PASS  ", "charname", " at pos=", rx267_pos)
+    .return (rx267_cur)
+  rx267_fail:
+.annotate "line", 33
+    (rx267_rep, rx267_pos, $I10, $P10) = rx267_cur."!mark_fail"(0)
+    lt rx267_pos, -1, rx267_done
+    eq rx267_pos, -1, rx267_fail
+    jump $I10
+  rx267_done:
+    rx267_cur."!cursor_fail"()
+    rx267_cur."!cursor_debug"("FAIL  ", "charname")
+    .return (rx267_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__charname"  :subid("88_1261064003.48945") :method
+.annotate "line", 33
+    $P269 = self."!PREFIX__!subrule"("integer", "")
+    new $P270, "ResizablePMCArray"
+    push $P270, "Z"
+    push $P270, "Y"
+    push $P270, "X"
+    push $P270, "W"
+    push $P270, "V"
+    push $P270, "U"
+    push $P270, "T"
+    push $P270, "S"
+    push $P270, "R"
+    push $P270, "Q"
+    push $P270, "P"
+    push $P270, "O"
+    push $P270, "N"
+    push $P270, "M"
+    push $P270, "L"
+    push $P270, "K"
+    push $P270, "J"
+    push $P270, "I"
+    push $P270, "H"
+    push $P270, "G"
+    push $P270, "F"
+    push $P270, "E"
+    push $P270, "D"
+    push $P270, "C"
+    push $P270, "B"
+    push $P270, "A"
+    push $P270, "z"
+    push $P270, "y"
+    push $P270, "x"
+    push $P270, "w"
+    push $P270, "v"
+    push $P270, "u"
+    push $P270, "t"
+    push $P270, "s"
+    push $P270, "r"
+    push $P270, "q"
+    push $P270, "p"
+    push $P270, "o"
+    push $P270, "n"
+    push $P270, "m"
+    push $P270, "l"
+    push $P270, "k"
+    push $P270, "j"
+    push $P270, "i"
+    push $P270, "h"
+    push $P270, "g"
+    push $P270, "f"
+    push $P270, "e"
+    push $P270, "d"
+    push $P270, "c"
+    push $P270, "b"
+    push $P270, "a"
+    push $P270, $P269
+    .return ($P270)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "_block275"  :anon :subid("89_1261064003.48945") :method :outer("87_1261064003.48945")
+.annotate "line", 100
+    .local string rx277_tgt
+    .local int rx277_pos
+    .local int rx277_off
+    .local int rx277_eos
+    .local int rx277_rep
+    .local pmc rx277_cur
+    (rx277_cur, rx277_pos, rx277_tgt) = self."!cursor_start"()
+    rx277_cur."!cursor_debug"("START ", "")
+    .lex unicode:"$\x{a2}", rx277_cur
+    .local pmc match
+    .lex "$/", match
+    length rx277_eos, rx277_tgt
+    set rx277_off, 0
+    lt rx277_pos, 2, rx277_start
+    sub rx277_off, rx277_pos, 1
+    substr rx277_tgt, rx277_tgt, rx277_off
+  rx277_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan278_done
+    goto rxscan278_scan
+  rxscan278_loop:
+    ($P10) = rx277_cur."from"()
+    inc $P10
+    set rx277_pos, $P10
+    ge rx277_pos, rx277_eos, rxscan278_done
+  rxscan278_scan:
+    set_addr $I10, rxscan278_loop
+    rx277_cur."!mark_push"(0, rx277_pos, $I10)
+  rxscan278_done:
+  # rx charclass_q s r 0..-1
+    sub $I10, rx277_pos, rx277_off
+    find_not_cclass $I11, 32, rx277_tgt, $I10, rx277_eos
+    add rx277_pos, rx277_off, $I11
+  # rx enumcharlist negate=0 
+    ge rx277_pos, rx277_eos, rx277_fail
+    sub $I10, rx277_pos, rx277_off
+    substr $S10, rx277_tgt, $I10, 1
+    index $I11, "],#", $S10
+    lt $I11, 0, rx277_fail
+    inc rx277_pos
+  # rx pass
+    rx277_cur."!cursor_pass"(rx277_pos, "")
+    rx277_cur."!cursor_debug"("PASS  ", "", " at pos=", rx277_pos)
+    .return (rx277_cur)
+  rx277_fail:
+    (rx277_rep, rx277_pos, $I10, $P10) = rx277_cur."!mark_fail"(0)
+    lt rx277_pos, -1, rx277_done
+    eq rx277_pos, -1, rx277_fail
+    jump $I10
+  rx277_done:
+    rx277_cur."!cursor_fail"()
+    rx277_cur."!cursor_debug"("FAIL  ", "")
+    .return (rx277_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "charnames"  :subid("90_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 33
+    .local string rx280_tgt
+    .local int rx280_pos
+    .local int rx280_off
+    .local int rx280_eos
+    .local int rx280_rep
+    .local pmc rx280_cur
+    (rx280_cur, rx280_pos, rx280_tgt) = self."!cursor_start"()
+    rx280_cur."!cursor_debug"("START ", "charnames")
+    rx280_cur."!cursor_caparray"("charname")
+    .lex unicode:"$\x{a2}", rx280_cur
+    .local pmc match
+    .lex "$/", match
+    length rx280_eos, rx280_tgt
+    set rx280_off, 0
+    lt rx280_pos, 2, rx280_start
+    sub rx280_off, rx280_pos, 1
+    substr rx280_tgt, rx280_tgt, rx280_off
+  rx280_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan283_done
+    goto rxscan283_scan
+  rxscan283_loop:
+    ($P10) = rx280_cur."from"()
+    inc $P10
+    set rx280_pos, $P10
+    ge rx280_pos, rx280_eos, rxscan283_done
+  rxscan283_scan:
+    set_addr $I10, rxscan283_loop
+    rx280_cur."!mark_push"(0, rx280_pos, $I10)
+  rxscan283_done:
+.annotate "line", 102
+  # rx rxquantr284 ** 1..*
+    set_addr $I285, rxquantr284_done
+    rx280_cur."!mark_push"(0, -1, $I285)
+  rxquantr284_loop:
+  # rx subrule "ws" subtype=method negate=
+    rx280_cur."!cursor_pos"(rx280_pos)
+    $P10 = rx280_cur."ws"()
+    unless $P10, rx280_fail
+    rx280_pos = $P10."pos"()
+  # rx subrule "charname" subtype=capture negate=
+    rx280_cur."!cursor_pos"(rx280_pos)
+    $P10 = rx280_cur."charname"()
+    unless $P10, rx280_fail
+    rx280_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("charname")
+    rx280_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx280_cur."!cursor_pos"(rx280_pos)
+    $P10 = rx280_cur."ws"()
+    unless $P10, rx280_fail
+    rx280_pos = $P10."pos"()
+    (rx280_rep) = rx280_cur."!mark_commit"($I285)
+    rx280_cur."!mark_push"(rx280_rep, rx280_pos, $I285)
+  # rx literal  ","
+    add $I11, rx280_pos, 1
+    gt $I11, rx280_eos, rx280_fail
+    sub $I11, rx280_pos, rx280_off
+    substr $S10, rx280_tgt, $I11, 1
+    ne $S10, ",", rx280_fail
+    add rx280_pos, 1
+    goto rxquantr284_loop
+  rxquantr284_done:
+  # rx pass
+    rx280_cur."!cursor_pass"(rx280_pos, "charnames")
+    rx280_cur."!cursor_debug"("PASS  ", "charnames", " at pos=", rx280_pos)
+    .return (rx280_cur)
+  rx280_fail:
+.annotate "line", 33
+    (rx280_rep, rx280_pos, $I10, $P10) = rx280_cur."!mark_fail"(0)
+    lt rx280_pos, -1, rx280_done
+    eq rx280_pos, -1, rx280_fail
+    jump $I10
+  rx280_done:
+    rx280_cur."!cursor_fail"()
+    rx280_cur."!cursor_debug"("FAIL  ", "charnames")
+    .return (rx280_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__charnames"  :subid("91_1261064003.48945") :method
+.annotate "line", 33
+    new $P282, "ResizablePMCArray"
+    push $P282, ""
+    .return ($P282)
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "charspec"  :subid("92_1261064003.48945") :method :outer("11_1261064003.48945")
+.annotate "line", 33
+    .local string rx287_tgt
+    .local int rx287_pos
+    .local int rx287_off
+    .local int rx287_eos
+    .local int rx287_rep
+    .local pmc rx287_cur
+    (rx287_cur, rx287_pos, rx287_tgt) = self."!cursor_start"()
+    rx287_cur."!cursor_debug"("START ", "charspec")
+    .lex unicode:"$\x{a2}", rx287_cur
+    .local pmc match
+    .lex "$/", match
+    length rx287_eos, rx287_tgt
+    set rx287_off, 0
+    lt rx287_pos, 2, rx287_start
+    sub rx287_off, rx287_pos, 1
+    substr rx287_tgt, rx287_tgt, rx287_off
+  rx287_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan292_done
+    goto rxscan292_scan
+  rxscan292_loop:
+    ($P10) = rx287_cur."from"()
+    inc $P10
+    set rx287_pos, $P10
+    ge rx287_pos, rx287_eos, rxscan292_done
+  rxscan292_scan:
+    set_addr $I10, rxscan292_loop
+    rx287_cur."!mark_push"(0, rx287_pos, $I10)
+  rxscan292_done:
+  alt293_0:
+.annotate "line", 104
+    set_addr $I10, alt293_1
+    rx287_cur."!mark_push"(0, rx287_pos, $I10)
+.annotate "line", 105
+  # rx literal  "["
+    add $I11, rx287_pos, 1
+    gt $I11, rx287_eos, rx287_fail
+    sub $I11, rx287_pos, rx287_off
+    substr $S10, rx287_tgt, $I11, 1
+    ne $S10, "[", rx287_fail
+    add rx287_pos, 1
+  # rx subrule "charnames" subtype=capture negate=
+    rx287_cur."!cursor_pos"(rx287_pos)
+    $P10 = rx287_cur."charnames"()
+    unless $P10, rx287_fail
+    rx287_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("charnames")
+    rx287_pos = $P10."pos"()
+  # rx literal  "]"
+    add $I11, rx287_pos, 1
+    gt $I11, rx287_eos, rx287_fail
+    sub $I11, rx287_pos, rx287_off
+    substr $S10, rx287_tgt, $I11, 1
+    ne $S10, "]", rx287_fail
+    add rx287_pos, 1
+    goto alt293_end
+  alt293_1:
+    set_addr $I10, alt293_2
+    rx287_cur."!mark_push"(0, rx287_pos, $I10)
+.annotate "line", 106
+  # rx charclass_q d r 1..-1
+    sub $I10, rx287_pos, rx287_off
+    find_not_cclass $I11, 8, rx287_tgt, $I10, rx287_eos
+    add $I12, $I10, 1
+    lt $I11, $I12, rx287_fail
+    add rx287_pos, rx287_off, $I11
+  # rx rxquantr294 ** 0..*
+    set_addr $I295, rxquantr294_done
+    rx287_cur."!mark_push"(0, rx287_pos, $I295)
+  rxquantr294_loop:
+  # rx literal  "_"
+    add $I11, rx287_pos, 1
+    gt $I11, rx287_eos, rx287_fail
+    sub $I11, rx287_pos, rx287_off
+    substr $S10, rx287_tgt, $I11, 1
+    ne $S10, "_", rx287_fail
+    add rx287_pos, 1
+  # rx charclass_q d r 1..-1
+    sub $I10, rx287_pos, rx287_off
+    find_not_cclass $I11, 8, rx287_tgt, $I10, rx287_eos
+    add $I12, $I10, 1
+    lt $I11, $I12, rx287_fail
+    add rx287_pos, rx287_off, $I11
+    (rx287_rep) = rx287_cur."!mark_commit"($I295)
+    rx287_cur."!mark_push"(rx287_rep, rx287_pos, $I295)
+    goto rxquantr294_loop
+  rxquantr294_done:
+    goto alt293_end
+  alt293_2:
+    set_addr $I10, alt293_3
+    rx287_cur."!mark_push"(0, rx287_pos, $I10)
+.annotate "line", 107
+  # rx enumcharlist negate=0 
+    ge rx287_pos, rx287_eos, rx287_fail
+    sub $I10, rx287_pos, rx287_off
+    substr $S10, rx287_tgt, $I10, 1
+    index $I11, "?@ABCDEFGHIJKLMNOPQRSTUVWXYZ", $S10
+    lt $I11, 0, rx287_fail
+    inc rx287_pos
+    goto alt293_end
+  alt293_3:
+.annotate "line", 108
+  # rx subrule "panic" subtype=method negate=
+    rx287_cur."!cursor_pos"(rx287_pos)
+    $P10 = rx287_cur."panic"("Unrecognized \\c character")
+    unless $P10, rx287_fail
+    rx287_pos = $P10."pos"()
+  alt293_end:
+.annotate "line", 103
+  # rx pass
+    rx287_cur."!cursor_pass"(rx287_pos, "charspec")
+    rx287_cur."!cursor_debug"("PASS  ", "charspec", " at pos=", rx287_pos)
+    .return (rx287_cur)
+  rx287_fail:
+.annotate "line", 33
+    (rx287_rep, rx287_pos, $I10, $P10) = rx287_cur."!mark_fail"(0)
+    lt rx287_pos, -1, rx287_done
+    eq rx287_pos, -1, rx287_fail
+    jump $I10
+  rx287_done:
+    rx287_cur."!cursor_fail"()
+    rx287_cur."!cursor_debug"("FAIL  ", "charspec")
+    .return (rx287_cur)
+    .return ()
+.end
+
+
+.namespace ["HLL";"Grammar"]
+.sub "!PREFIX__charspec"  :subid("93_1261064003.48945") :method
+.annotate "line", 33
+    $P289 = self."!PREFIX__!subrule"("", "")
+    $P290 = self."!PREFIX__!subrule"("charnames", "[")
+    new $P291, "ResizablePMCArray"
+    push $P291, $P289
+    push $P291, "Z"
+    push $P291, "Y"
+    push $P291, "X"
+    push $P291, "W"
+    push $P291, "V"
+    push $P291, "U"
+    push $P291, "T"
+    push $P291, "S"
+    push $P291, "R"
+    push $P291, "Q"
+    push $P291, "P"
+    push $P291, "O"
+    push $P291, "N"
+    push $P291, "M"
+    push $P291, "L"
+    push $P291, "K"
+    push $P291, "J"
+    push $P291, "I"
+    push $P291, "H"
+    push $P291, "G"
+    push $P291, "F"
+    push $P291, "E"
+    push $P291, "D"
+    push $P291, "C"
+    push $P291, "B"
+    push $P291, "A"
+    push $P291, "@"
+    push $P291, "?"
+    push $P291, ""
+    push $P291, $P290
+    .return ($P291)
+.end
+
+### .include 'gen/hllgrammar-actions.pir'
+
+.namespace []
+.sub "_block11"  :anon :subid("10_1261064005.70696")
+.annotate "line", 0
+    get_hll_global $P14, ["HLL";"Actions"], "_block13" 
+    capture_lex $P14
+.annotate "line", 3
+    get_hll_global $P14, ["HLL";"Actions"], "_block13" 
+    capture_lex $P14
+    $P451 = $P14()
+.annotate "line", 1
+    .return ($P451)
+.end
+
+
+.namespace []
+.sub "" :load :init :subid("post41") :outer("10_1261064005.70696")
+.annotate "line", 0
+    .const 'Sub' $P12 = "10_1261064005.70696" 
+    .local pmc block
+    set block, $P12
+    $P452 = get_root_global ["parrot"], "P6metaclass"
+    $P452."new_class"("HLL::Actions")
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "_block13"  :subid("11_1261064005.70696") :outer("10_1261064005.70696")
+.annotate "line", 3
+    .const 'Sub' $P434 = "40_1261064005.70696" 
+    capture_lex $P434
+    .const 'Sub' $P417 = "39_1261064005.70696" 
+    capture_lex $P417
+    .const 'Sub' $P410 = "38_1261064005.70696" 
+    capture_lex $P410
+    .const 'Sub' $P403 = "37_1261064005.70696" 
+    capture_lex $P403
+    .const 'Sub' $P396 = "36_1261064005.70696" 
+    capture_lex $P396
+    .const 'Sub' $P389 = "35_1261064005.70696" 
+    capture_lex $P389
+    .const 'Sub' $P379 = "34_1261064005.70696" 
+    capture_lex $P379
+    .const 'Sub' $P372 = "33_1261064005.70696" 
+    capture_lex $P372
+    .const 'Sub' $P356 = "32_1261064005.70696" 
+    capture_lex $P356
+    .const 'Sub' $P281 = "30_1261064005.70696" 
+    capture_lex $P281
+    .const 'Sub' $P222 = "27_1261064005.70696" 
+    capture_lex $P222
+    .const 'Sub' $P213 = "26_1261064005.70696" 
+    capture_lex $P213
+    .const 'Sub' $P204 = "25_1261064005.70696" 
+    capture_lex $P204
+    .const 'Sub' $P195 = "24_1261064005.70696" 
+    capture_lex $P195
+    .const 'Sub' $P186 = "23_1261064005.70696" 
+    capture_lex $P186
+    .const 'Sub' $P177 = "22_1261064005.70696" 
+    capture_lex $P177
+    .const 'Sub' $P167 = "21_1261064005.70696" 
+    capture_lex $P167
+    .const 'Sub' $P157 = "20_1261064005.70696" 
+    capture_lex $P157
+    .const 'Sub' $P149 = "19_1261064005.70696" 
+    capture_lex $P149
+    .const 'Sub' $P139 = "18_1261064005.70696" 
+    capture_lex $P139
+    .const 'Sub' $P129 = "17_1261064005.70696" 
+    capture_lex $P129
+    .const 'Sub' $P28 = "14_1261064005.70696" 
+    capture_lex $P28
+    .const 'Sub' $P22 = "13_1261064005.70696" 
+    capture_lex $P22
+    .const 'Sub' $P15 = "12_1261064005.70696" 
+    capture_lex $P15
+.annotate "line", 163
+    .const 'Sub' $P434 = "40_1261064005.70696" 
+    capture_lex $P434
+.annotate "line", 3
+    .return ($P434)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "string_to_int"  :subid("12_1261064005.70696") :outer("11_1261064005.70696")
+    .param pmc param_18
+    .param pmc param_19
+.annotate "line", 3
+    new $P17, 'ExceptionHandler'
+    set_addr $P17, control_16
+    $P17."handle_types"(58)
+    push_eh $P17
+    .lex "$src", param_18
+    .lex "$base", param_19
+.annotate "line", 4
+
+        .local pmc src
+        .local string src_s
+        src = find_lex '$src'
+        src_s = src
+        .local int base, pos, eos, result
+        $P0 = find_lex '$base'
+        base = $P0
+        pos = 0
+        eos = length src_s
+        result = 0
+      str_loop:
+        unless pos < eos goto str_done
+        .local string char
+        char = substr src_s, pos, 1
+        if char == '_' goto str_next
+        .local int digitval
+        digitval = index "00112233445566778899AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz", char
+        if digitval < 0 goto err_base
+        digitval >>= 1
+        if digitval >= base goto err_base
+        result *= base
+        result += digitval
+      str_next:
+        inc pos
+        goto str_loop
+      err_base:
+	src.'panic'('Invalid radix conversion of "', char, '"')
+      str_done:
+        $P20 = box result
+    
+.annotate "line", 3
+    .return ($P20)
+  control_16:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P21, exception, "payload"
+    .return ($P21)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "ints_to_string"  :subid("13_1261064005.70696") :outer("11_1261064005.70696")
+    .param pmc param_25
+.annotate "line", 37
+    new $P24, 'ExceptionHandler'
+    set_addr $P24, control_23
+    $P24."handle_types"(58)
+    push_eh $P24
+    .lex "$ints", param_25
+.annotate "line", 38
+
+        .local string result
+        result = ''
+        .local pmc ints, ints_it
+        ints = find_lex '$ints'
+        $I0 = does ints, 'array'
+        unless $I0 goto ints_1
+        ints_it = iter ints
+      ints_loop:
+        unless ints_it goto ints_done
+        $P0 = shift ints_it
+        $I0 = $P0.'ast'()
+        $S0 = chr $I0
+        concat result, $S0
+        goto ints_loop
+      ints_1:
+        $I0 = ints.'ast'()
+        result = chr $I0
+      ints_done:
+        $P26 = box result
+    
+.annotate "line", 37
+    .return ($P26)
+  control_23:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P27, exception, "payload"
+    .return ($P27)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "EXPR"  :subid("14_1261064005.70696") :method :outer("11_1261064005.70696")
+    .param pmc param_31
+    .param pmc param_32 :optional
+    .param int has_param_32 :opt_flag
+.annotate "line", 62
+    .const 'Sub' $P111 = "16_1261064005.70696" 
+    capture_lex $P111
+    .const 'Sub' $P78 = "15_1261064005.70696" 
+    capture_lex $P78
+    new $P30, 'ExceptionHandler'
+    set_addr $P30, control_29
+    $P30."handle_types"(58)
+    push_eh $P30
+    .lex "self", self
+    .lex "$/", param_31
+    if has_param_32, optparam_42
+    new $P33, "Undef"
+    set param_32, $P33
+  optparam_42:
+    .lex "$key", param_32
+.annotate "line", 64
+    new $P34, "Undef"
+    .lex "$past", $P34
+.annotate "line", 63
+    find_lex $P36, "$key"
+    if $P36, unless_35_end
+    new $P37, "Exception"
+    set $P37['type'], 58
+    new $P38, "Integer"
+    assign $P38, 0
+    setattribute $P37, 'payload', $P38
+    throw $P37
+  unless_35_end:
+.annotate "line", 64
+    find_lex $P40, "$/"
+    $P41 = $P40."ast"()
+    set $P39, $P41
+    defined $I43, $P39
+    if $I43, default_42
+    find_lex $P44, "$/"
+    unless_null $P44, vivify_43
+    new $P44, "Hash"
+  vivify_43:
+    set $P45, $P44["OPER"]
+    unless_null $P45, vivify_44
+    new $P45, "Undef"
+  vivify_44:
+    $P46 = $P45."ast"()
+    set $P39, $P46
+  default_42:
+    store_lex "$past", $P39
+.annotate "line", 65
+    find_lex $P48, "$past"
+    if $P48, unless_47_end
+.annotate "line", 66
+    get_hll_global $P49, ["PAST"], "Op"
+    find_lex $P50, "$/"
+    $P51 = $P49."new"($P50 :named("node"))
+    store_lex "$past", $P51
+.annotate "line", 67
+    find_lex $P53, "$/"
+    unless_null $P53, vivify_45
+    new $P53, "Hash"
+  vivify_45:
+    set $P54, $P53["OPER"]
+    unless_null $P54, vivify_46
+    new $P54, "Hash"
+  vivify_46:
+    set $P55, $P54["O"]
+    unless_null $P55, vivify_47
+    new $P55, "Hash"
+  vivify_47:
+    set $P56, $P55["pasttype"]
+    unless_null $P56, vivify_48
+    new $P56, "Undef"
+  vivify_48:
+    if $P56, if_52
+.annotate "line", 68
+    find_lex $P64, "$/"
+    unless_null $P64, vivify_49
+    new $P64, "Hash"
+  vivify_49:
+    set $P65, $P64["OPER"]
+    unless_null $P65, vivify_50
+    new $P65, "Hash"
+  vivify_50:
+    set $P66, $P65["O"]
+    unless_null $P66, vivify_51
+    new $P66, "Hash"
+  vivify_51:
+    set $P67, $P66["pirop"]
+    unless_null $P67, vivify_52
+    new $P67, "Undef"
+  vivify_52:
+    unless $P67, if_63_end
+    find_lex $P68, "$past"
+    find_lex $P69, "$/"
+    unless_null $P69, vivify_53
+    new $P69, "Hash"
+  vivify_53:
+    set $P70, $P69["OPER"]
+    unless_null $P70, vivify_54
+    new $P70, "Hash"
+  vivify_54:
+    set $P71, $P70["O"]
+    unless_null $P71, vivify_55
+    new $P71, "Hash"
+  vivify_55:
+    set $P72, $P71["pirop"]
+    unless_null $P72, vivify_56
+    new $P72, "Undef"
+  vivify_56:
+    set $S73, $P72
+    $P68."pirop"($S73)
+  if_63_end:
+    goto if_52_end
+  if_52:
+.annotate "line", 67
+    find_lex $P57, "$past"
+    find_lex $P58, "$/"
+    unless_null $P58, vivify_57
+    new $P58, "Hash"
+  vivify_57:
+    set $P59, $P58["OPER"]
+    unless_null $P59, vivify_58
+    new $P59, "Hash"
+  vivify_58:
+    set $P60, $P59["O"]
+    unless_null $P60, vivify_59
+    new $P60, "Hash"
+  vivify_59:
+    set $P61, $P60["pasttype"]
+    unless_null $P61, vivify_60
+    new $P61, "Undef"
+  vivify_60:
+    set $S62, $P61
+    $P57."pasttype"($S62)
+  if_52_end:
+.annotate "line", 69
+    find_lex $P75, "$past"
+    $P76 = $P75."name"()
+    if $P76, unless_74_end
+    .const 'Sub' $P78 = "15_1261064005.70696" 
+    capture_lex $P78
+    $P78()
+  unless_74_end:
+  unless_47_end:
+.annotate "line", 80
+    find_lex $P98, "$key"
+    set $S99, $P98
+    iseq $I100, $S99, "POSTFIX"
+    if $I100, if_97
+.annotate "line", 82
+    find_lex $P106, "$/"
+    $P107 = $P106."list"()
+    defined $I108, $P107
+    unless $I108, for_undef_64
+    iter $P105, $P107
+    new $P123, 'ExceptionHandler'
+    set_addr $P123, loop122_handler
+    $P123."handle_types"(65, 67, 66)
+    push_eh $P123
+  loop122_test:
+    unless $P105, loop122_done
+    shift $P109, $P105
+  loop122_redo:
+    .const 'Sub' $P111 = "16_1261064005.70696" 
+    capture_lex $P111
+    $P111($P109)
+  loop122_next:
+    goto loop122_test
+  loop122_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P124, exception, 'type'
+    eq $P124, 65, loop122_next
+    eq $P124, 67, loop122_redo
+  loop122_done:
+    pop_eh 
+  for_undef_64:
+.annotate "line", 81
+    goto if_97_end
+  if_97:
+.annotate "line", 80
+    find_lex $P101, "$past"
+    find_lex $P102, "$/"
+    unless_null $P102, vivify_65
+    new $P102, "ResizablePMCArray"
+  vivify_65:
+    set $P103, $P102[0]
+    unless_null $P103, vivify_66
+    new $P103, "Undef"
+  vivify_66:
+    $P104 = $P103."ast"()
+    $P101."unshift"($P104)
+  if_97_end:
+.annotate "line", 84
+    find_lex $P125, "$/"
+    find_lex $P126, "$past"
+    $P127 = $P125."!make"($P126)
+.annotate "line", 62
+    .return ($P127)
+  control_29:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P128, exception, "payload"
+    .return ($P128)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "_block77"  :anon :subid("15_1261064005.70696") :outer("14_1261064005.70696")
+.annotate "line", 71
+    new $P79, "Undef"
+    .lex "$name", $P79
+.annotate "line", 70
+    find_lex $P81, "$key"
+    set $S82, $P81
+    iseq $I83, $S82, "LIST"
+    unless $I83, if_80_end
+    new $P84, "String"
+    assign $P84, "infix"
+    store_lex "$key", $P84
+  if_80_end:
+.annotate "line", 71
+
+                $P0 = find_lex '$key'
+                $S0 = $P0
+                $S0 = downcase $S0
+                $P85 = box $S0
+            
+    concat $P86, $P85, ":<"
+.annotate "line", 76
+    find_lex $P87, "$/"
+    unless_null $P87, vivify_61
+    new $P87, "Hash"
+  vivify_61:
+    set $P88, $P87["OPER"]
+    unless_null $P88, vivify_62
+    new $P88, "Hash"
+  vivify_62:
+    set $P89, $P88["sym"]
+    unless_null $P89, vivify_63
+    new $P89, "Undef"
+  vivify_63:
+    concat $P90, $P86, $P89
+    concat $P91, $P90, ">"
+    store_lex "$name", $P91
+.annotate "line", 77
+    find_lex $P92, "$past"
+    new $P93, "String"
+    assign $P93, "&"
+    find_lex $P94, "$name"
+    concat $P95, $P93, $P94
+    $P96 = $P92."name"($P95)
+.annotate "line", 69
+    .return ($P96)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "_block110"  :anon :subid("16_1261064005.70696") :outer("14_1261064005.70696")
+    .param pmc param_112
+.annotate "line", 82
+    .lex "$_", param_112
+    find_lex $P115, "$_"
+    $P116 = $P115."ast"()
+    defined $I117, $P116
+    if $I117, if_114
+    new $P113, 'Integer'
+    set $P113, $I117
+    goto if_114_end
+  if_114:
+    find_lex $P118, "$past"
+    find_lex $P119, "$_"
+    $P120 = $P119."ast"()
+    $P121 = $P118."push"($P120)
+    set $P113, $P121
+  if_114_end:
+    .return ($P113)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "term:sym<circumfix>"  :subid("17_1261064005.70696") :method :outer("11_1261064005.70696")
+    .param pmc param_132
+.annotate "line", 87
+    new $P131, 'ExceptionHandler'
+    set_addr $P131, control_130
+    $P131."handle_types"(58)
+    push_eh $P131
+    .lex "self", self
+    .lex "$/", param_132
+    find_lex $P133, "$/"
+    find_lex $P134, "$/"
+    unless_null $P134, vivify_67
+    new $P134, "Hash"
+  vivify_67:
+    set $P135, $P134["circumfix"]
+    unless_null $P135, vivify_68
+    new $P135, "Undef"
+  vivify_68:
+    $P136 = $P135."ast"()
+    $P137 = $P133."!make"($P136)
+    .return ($P137)
+  control_130:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P138, exception, "payload"
+    .return ($P138)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "termish"  :subid("18_1261064005.70696") :method :outer("11_1261064005.70696")
+    .param pmc param_142
+.annotate "line", 89
+    new $P141, 'ExceptionHandler'
+    set_addr $P141, control_140
+    $P141."handle_types"(58)
+    push_eh $P141
+    .lex "self", self
+    .lex "$/", param_142
+    find_lex $P143, "$/"
+    find_lex $P144, "$/"
+    unless_null $P144, vivify_69
+    new $P144, "Hash"
+  vivify_69:
+    set $P145, $P144["term"]
+    unless_null $P145, vivify_70
+    new $P145, "Undef"
+  vivify_70:
+    $P146 = $P145."ast"()
+    $P147 = $P143."!make"($P146)
+    .return ($P147)
+  control_140:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P148, exception, "payload"
+    .return ($P148)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "nullterm"  :subid("19_1261064005.70696") :method :outer("11_1261064005.70696")
+    .param pmc param_152
+.annotate "line", 90
+    new $P151, 'ExceptionHandler'
+    set_addr $P151, control_150
+    $P151."handle_types"(58)
+    push_eh $P151
+    .lex "self", self
+    .lex "$/", param_152
+    find_lex $P153, "$/"
+ $P154 = new ['Undef'] 
+    $P155 = $P153."!make"($P154)
+    .return ($P155)
+  control_150:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P156, exception, "payload"
+    .return ($P156)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "nullterm_alt"  :subid("20_1261064005.70696") :method :outer("11_1261064005.70696")
+    .param pmc param_160
+.annotate "line", 91
+    new $P159, 'ExceptionHandler'
+    set_addr $P159, control_158
+    $P159."handle_types"(58)
+    push_eh $P159
+    .lex "self", self
+    .lex "$/", param_160
+    find_lex $P161, "$/"
+    find_lex $P162, "$/"
+    unless_null $P162, vivify_71
+    new $P162, "Hash"
+  vivify_71:
+    set $P163, $P162["term"]
+    unless_null $P163, vivify_72
+    new $P163, "Undef"
+  vivify_72:
+    $P164 = $P163."ast"()
+    $P165 = $P161."!make"($P164)
+    .return ($P165)
+  control_158:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P166, exception, "payload"
+    .return ($P166)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "integer"  :subid("21_1261064005.70696") :method :outer("11_1261064005.70696")
+    .param pmc param_170
+.annotate "line", 93
+    new $P169, 'ExceptionHandler'
+    set_addr $P169, control_168
+    $P169."handle_types"(58)
+    push_eh $P169
+    .lex "self", self
+    .lex "$/", param_170
+    find_lex $P171, "$/"
+    find_lex $P172, "$/"
+    unless_null $P172, vivify_73
+    new $P172, "Hash"
+  vivify_73:
+    set $P173, $P172["VALUE"]
+    unless_null $P173, vivify_74
+    new $P173, "Undef"
+  vivify_74:
+    $P174 = $P173."ast"()
+    $P175 = $P171."!make"($P174)
+    .return ($P175)
+  control_168:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P176, exception, "payload"
+    .return ($P176)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "dec_number"  :subid("22_1261064005.70696") :method :outer("11_1261064005.70696")
+    .param pmc param_180
+.annotate "line", 95
+    new $P179, 'ExceptionHandler'
+    set_addr $P179, control_178
+    $P179."handle_types"(58)
+    push_eh $P179
+    .lex "self", self
+    .lex "$/", param_180
+    find_lex $P181, "$/"
+    find_lex $P182, "$/"
+    set $N183, $P182
+    $P184 = $P181."!make"($N183)
+    .return ($P184)
+  control_178:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P185, exception, "payload"
+    .return ($P185)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "decint"  :subid("23_1261064005.70696") :method :outer("11_1261064005.70696")
+    .param pmc param_189
+.annotate "line", 97
+    new $P188, 'ExceptionHandler'
+    set_addr $P188, control_187
+    $P188."handle_types"(58)
+    push_eh $P188
+    .lex "self", self
+    .lex "$/", param_189
+    find_lex $P190, "$/"
+    find_lex $P191, "$/"
+    $P192 = "string_to_int"($P191, 10)
+    $P193 = $P190."!make"($P192)
+    .return ($P193)
+  control_187:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P194, exception, "payload"
+    .return ($P194)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "hexint"  :subid("24_1261064005.70696") :method :outer("11_1261064005.70696")
+    .param pmc param_198
+.annotate "line", 98
+    new $P197, 'ExceptionHandler'
+    set_addr $P197, control_196
+    $P197."handle_types"(58)
+    push_eh $P197
+    .lex "self", self
+    .lex "$/", param_198
+    find_lex $P199, "$/"
+    find_lex $P200, "$/"
+    $P201 = "string_to_int"($P200, 16)
+    $P202 = $P199."!make"($P201)
+    .return ($P202)
+  control_196:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P203, exception, "payload"
+    .return ($P203)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "octint"  :subid("25_1261064005.70696") :method :outer("11_1261064005.70696")
+    .param pmc param_207
+.annotate "line", 99
+    new $P206, 'ExceptionHandler'
+    set_addr $P206, control_205
+    $P206."handle_types"(58)
+    push_eh $P206
+    .lex "self", self
+    .lex "$/", param_207
+    find_lex $P208, "$/"
+    find_lex $P209, "$/"
+    $P210 = "string_to_int"($P209, 8)
+    $P211 = $P208."!make"($P210)
+    .return ($P211)
+  control_205:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P212, exception, "payload"
+    .return ($P212)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "binint"  :subid("26_1261064005.70696") :method :outer("11_1261064005.70696")
+    .param pmc param_216
+.annotate "line", 100
+    new $P215, 'ExceptionHandler'
+    set_addr $P215, control_214
+    $P215."handle_types"(58)
+    push_eh $P215
+    .lex "self", self
+    .lex "$/", param_216
+    find_lex $P217, "$/"
+    find_lex $P218, "$/"
+    $P219 = "string_to_int"($P218, 2)
+    $P220 = $P217."!make"($P219)
+    .return ($P220)
+  control_214:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P221, exception, "payload"
+    .return ($P221)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "quote_EXPR"  :subid("27_1261064005.70696") :method :outer("11_1261064005.70696")
+    .param pmc param_225
+.annotate "line", 102
+    .const 'Sub' $P241 = "28_1261064005.70696" 
+    capture_lex $P241
+    new $P224, 'ExceptionHandler'
+    set_addr $P224, control_223
+    $P224."handle_types"(58)
+    push_eh $P224
+    .lex "self", self
+    .lex "$/", param_225
+.annotate "line", 103
+    new $P226, "Undef"
+    .lex "$past", $P226
+    find_lex $P227, "$/"
+    unless_null $P227, vivify_75
+    new $P227, "Hash"
+  vivify_75:
+    set $P228, $P227["quote_delimited"]
+    unless_null $P228, vivify_76
+    new $P228, "Undef"
+  vivify_76:
+    $P229 = $P228."ast"()
+    store_lex "$past", $P229
+.annotate "line", 104
+    get_hll_global $P231, ["HLL";"Grammar"], "quotemod_check"
+    find_lex $P232, "$/"
+    $P233 = $P231($P232, "w")
+    unless $P233, if_230_end
+.annotate "line", 105
+    get_hll_global $P235, ["PAST"], "Node"
+    find_lex $P236, "$past"
+    $P237 = $P235."ACCEPTS"($P236)
+    if $P237, if_234
+.annotate "line", 108
+    .const 'Sub' $P241 = "28_1261064005.70696" 
+    capture_lex $P241
+    $P241()
+    goto if_234_end
+  if_234:
+.annotate "line", 106
+    find_lex $P238, "$/"
+    $P239 = $P238."CURSOR"()
+    $P239."panic"("Can't form :w list from non-constant strings (yet)")
+  if_234_end:
+  if_230_end:
+.annotate "line", 116
+    get_hll_global $P269, ["PAST"], "Node"
+    find_lex $P270, "$past"
+    $P271 = $P269."ACCEPTS"($P270)
+    isfalse $I272, $P271
+    unless $I272, if_268_end
+.annotate "line", 117
+    get_hll_global $P273, ["PAST"], "Val"
+    find_lex $P274, "$past"
+    set $S275, $P274
+    $P276 = $P273."new"($S275 :named("value"))
+    store_lex "$past", $P276
+  if_268_end:
+.annotate "line", 119
+    find_lex $P277, "$/"
+    find_lex $P278, "$past"
+    $P279 = $P277."!make"($P278)
+.annotate "line", 102
+    .return ($P279)
+  control_223:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P280, exception, "payload"
+    .return ($P280)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "_block240"  :anon :subid("28_1261064005.70696") :outer("27_1261064005.70696")
+.annotate "line", 108
+    .const 'Sub' $P260 = "29_1261064005.70696" 
+    capture_lex $P260
+.annotate "line", 109
+    new $P242, "ResizablePMCArray"
+    .lex "@words", $P242
+    get_hll_global $P243, ["HLL";"Grammar"], "split_words"
+    find_lex $P244, "$/"
+    find_lex $P245, "$past"
+    $P246 = $P243($P244, $P245)
+    store_lex "@words", $P246
+.annotate "line", 110
+    find_lex $P249, "@words"
+    set $N250, $P249
+    isgt $I251, $N250, 1.0
+    if $I251, if_248
+    new $P247, 'Integer'
+    set $P247, $I251
+    goto if_248_end
+  if_248:
+.annotate "line", 111
+    get_hll_global $P252, ["PAST"], "Op"
+    find_lex $P253, "$/"
+    $P254 = $P252."new"("list" :named("pasttype"), $P253 :named("node"))
+    store_lex "$past", $P254
+.annotate "line", 112
+    find_lex $P256, "@words"
+    defined $I257, $P256
+    unless $I257, for_undef_77
+    iter $P255, $P256
+    new $P266, 'ExceptionHandler'
+    set_addr $P266, loop265_handler
+    $P266."handle_types"(65, 67, 66)
+    push_eh $P266
+  loop265_test:
+    unless $P255, loop265_done
+    shift $P258, $P255
+  loop265_redo:
+    .const 'Sub' $P260 = "29_1261064005.70696" 
+    capture_lex $P260
+    $P260($P258)
+  loop265_next:
+    goto loop265_test
+  loop265_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P267, exception, 'type'
+    eq $P267, 65, loop265_next
+    eq $P267, 67, loop265_redo
+  loop265_done:
+    pop_eh 
+  for_undef_77:
+.annotate "line", 110
+    set $P247, $P255
+  if_248_end:
+.annotate "line", 108
+    .return ($P247)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "_block259"  :anon :subid("29_1261064005.70696") :outer("28_1261064005.70696")
+    .param pmc param_261
+.annotate "line", 112
+    .lex "$_", param_261
+    find_lex $P262, "$past"
+    find_lex $P263, "$_"
+    $P264 = $P262."push"($P263)
+    .return ($P264)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "quote_delimited"  :subid("30_1261064005.70696") :method :outer("11_1261064005.70696")
+    .param pmc param_284
+.annotate "line", 122
+    .const 'Sub' $P296 = "31_1261064005.70696" 
+    capture_lex $P296
+    new $P283, 'ExceptionHandler'
+    set_addr $P283, control_282
+    $P283."handle_types"(58)
+    push_eh $P283
+    .lex "self", self
+    .lex "$/", param_284
+.annotate "line", 123
+    new $P285, "ResizablePMCArray"
+    .lex "@parts", $P285
+.annotate "line", 124
+    new $P286, "Undef"
+    .lex "$lastlit", $P286
+.annotate "line", 140
+    new $P287, "Undef"
+    .lex "$past", $P287
+.annotate "line", 122
+    find_lex $P288, "@parts"
+.annotate "line", 124
+    new $P289, "String"
+    assign $P289, ""
+    store_lex "$lastlit", $P289
+.annotate "line", 125
+    find_lex $P291, "$/"
+    unless_null $P291, vivify_78
+    new $P291, "Hash"
+  vivify_78:
+    set $P292, $P291["quote_atom"]
+    unless_null $P292, vivify_79
+    new $P292, "Undef"
+  vivify_79:
+    defined $I293, $P292
+    unless $I293, for_undef_80
+    iter $P290, $P292
+    new $P329, 'ExceptionHandler'
+    set_addr $P329, loop328_handler
+    $P329."handle_types"(65, 67, 66)
+    push_eh $P329
+  loop328_test:
+    unless $P290, loop328_done
+    shift $P294, $P290
+  loop328_redo:
+    .const 'Sub' $P296 = "31_1261064005.70696" 
+    capture_lex $P296
+    $P296($P294)
+  loop328_next:
+    goto loop328_test
+  loop328_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P330, exception, 'type'
+    eq $P330, 65, loop328_next
+    eq $P330, 67, loop328_redo
+  loop328_done:
+    pop_eh 
+  for_undef_80:
+.annotate "line", 139
+    find_lex $P332, "$lastlit"
+    set $S333, $P332
+    isgt $I334, $S333, ""
+    unless $I334, if_331_end
+    find_lex $P335, "@parts"
+    find_lex $P336, "$lastlit"
+    $P335."push"($P336)
+  if_331_end:
+.annotate "line", 140
+    find_lex $P339, "@parts"
+    if $P339, if_338
+    new $P342, "String"
+    assign $P342, ""
+    set $P337, $P342
+    goto if_338_end
+  if_338:
+    find_lex $P340, "@parts"
+    $P341 = $P340."shift"()
+    set $P337, $P341
+  if_338_end:
+    store_lex "$past", $P337
+.annotate "line", 141
+    new $P350, 'ExceptionHandler'
+    set_addr $P350, loop349_handler
+    $P350."handle_types"(65, 67, 66)
+    push_eh $P350
+  loop349_test:
+    find_lex $P343, "@parts"
+    unless $P343, loop349_done
+  loop349_redo:
+.annotate "line", 142
+    get_hll_global $P344, ["PAST"], "Op"
+    find_lex $P345, "$past"
+    find_lex $P346, "@parts"
+    $P347 = $P346."shift"()
+    $P348 = $P344."new"($P345, $P347, "concat" :named("pirop"))
+    store_lex "$past", $P348
+  loop349_next:
+.annotate "line", 141
+    goto loop349_test
+  loop349_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P351, exception, 'type'
+    eq $P351, 65, loop349_next
+    eq $P351, 67, loop349_redo
+  loop349_done:
+    pop_eh 
+.annotate "line", 144
+    find_lex $P352, "$/"
+    find_lex $P353, "$past"
+    $P354 = $P352."!make"($P353)
+.annotate "line", 122
+    .return ($P354)
+  control_282:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P355, exception, "payload"
+    .return ($P355)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "_block295"  :anon :subid("31_1261064005.70696") :outer("30_1261064005.70696")
+    .param pmc param_298
+.annotate "line", 126
+    new $P297, "Undef"
+    .lex "$ast", $P297
+    .lex "$_", param_298
+    find_lex $P299, "$_"
+    $P300 = $P299."ast"()
+    store_lex "$ast", $P300
+.annotate "line", 127
+    get_hll_global $P303, ["PAST"], "Node"
+    find_lex $P304, "$ast"
+    $P305 = $P303."ACCEPTS"($P304)
+    isfalse $I306, $P305
+    if $I306, if_302
+.annotate "line", 130
+    find_lex $P312, "$ast"
+    get_hll_global $P313, ["PAST"], "Val"
+    $P314 = $P312."isa"($P313)
+    if $P314, if_311
+.annotate "line", 134
+    find_lex $P320, "$lastlit"
+    set $S321, $P320
+    isgt $I322, $S321, ""
+    unless $I322, if_319_end
+    find_lex $P323, "@parts"
+    find_lex $P324, "$lastlit"
+    $P323."push"($P324)
+  if_319_end:
+.annotate "line", 135
+    find_lex $P325, "@parts"
+    find_lex $P326, "$ast"
+    $P325."push"($P326)
+.annotate "line", 136
+    new $P327, "String"
+    assign $P327, ""
+    store_lex "$lastlit", $P327
+.annotate "line", 133
+    set $P310, $P327
+.annotate "line", 130
+    goto if_311_end
+  if_311:
+.annotate "line", 131
+    find_lex $P315, "$lastlit"
+    find_lex $P316, "$ast"
+    $S317 = $P316."value"()
+    concat $P318, $P315, $S317
+    store_lex "$lastlit", $P318
+.annotate "line", 130
+    set $P310, $P318
+  if_311_end:
+    set $P301, $P310
+.annotate "line", 127
+    goto if_302_end
+  if_302:
+.annotate "line", 128
+    find_lex $P307, "$lastlit"
+    find_lex $P308, "$ast"
+    concat $P309, $P307, $P308
+    store_lex "$lastlit", $P309
+.annotate "line", 127
+    set $P301, $P309
+  if_302_end:
+.annotate "line", 125
+    .return ($P301)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "quote_atom"  :subid("32_1261064005.70696") :method :outer("11_1261064005.70696")
+    .param pmc param_359
+.annotate "line", 147
+    new $P358, 'ExceptionHandler'
+    set_addr $P358, control_357
+    $P358."handle_types"(58)
+    push_eh $P358
+    .lex "self", self
+    .lex "$/", param_359
+.annotate "line", 148
+    find_lex $P360, "$/"
+    find_lex $P363, "$/"
+    unless_null $P363, vivify_81
+    new $P363, "Hash"
+  vivify_81:
+    set $P364, $P363["quote_escape"]
+    unless_null $P364, vivify_82
+    new $P364, "Undef"
+  vivify_82:
+    if $P364, if_362
+    find_lex $P368, "$/"
+    set $S369, $P368
+    new $P361, 'String'
+    set $P361, $S369
+    goto if_362_end
+  if_362:
+    find_lex $P365, "$/"
+    unless_null $P365, vivify_83
+    new $P365, "Hash"
+  vivify_83:
+    set $P366, $P365["quote_escape"]
+    unless_null $P366, vivify_84
+    new $P366, "Undef"
+  vivify_84:
+    $P367 = $P366."ast"()
+    set $P361, $P367
+  if_362_end:
+    $P370 = $P360."!make"($P361)
+.annotate "line", 147
+    .return ($P370)
+  control_357:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P371, exception, "payload"
+    .return ($P371)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "quote_escape:sym<backslash>"  :subid("33_1261064005.70696") :method :outer("11_1261064005.70696")
+    .param pmc param_375
+.annotate "line", 151
+    new $P374, 'ExceptionHandler'
+    set_addr $P374, control_373
+    $P374."handle_types"(58)
+    push_eh $P374
+    .lex "self", self
+    .lex "$/", param_375
+    find_lex $P376, "$/"
+    $P377 = $P376."!make"("\\")
+    .return ($P377)
+  control_373:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P378, exception, "payload"
+    .return ($P378)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "quote_escape:sym<stopper>"  :subid("34_1261064005.70696") :method :outer("11_1261064005.70696")
+    .param pmc param_382
+.annotate "line", 152
+    new $P381, 'ExceptionHandler'
+    set_addr $P381, control_380
+    $P381."handle_types"(58)
+    push_eh $P381
+    .lex "self", self
+    .lex "$/", param_382
+    find_lex $P383, "$/"
+    find_lex $P384, "$/"
+    unless_null $P384, vivify_85
+    new $P384, "Hash"
+  vivify_85:
+    set $P385, $P384["stopper"]
+    unless_null $P385, vivify_86
+    new $P385, "Undef"
+  vivify_86:
+    set $S386, $P385
+    $P387 = $P383."!make"($S386)
+    .return ($P387)
+  control_380:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P388, exception, "payload"
+    .return ($P388)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "quote_escape:sym<bs>"  :subid("35_1261064005.70696") :method :outer("11_1261064005.70696")
+    .param pmc param_392
+.annotate "line", 154
+    new $P391, 'ExceptionHandler'
+    set_addr $P391, control_390
+    $P391."handle_types"(58)
+    push_eh $P391
+    .lex "self", self
+    .lex "$/", param_392
+    find_lex $P393, "$/"
+    $P394 = $P393."!make"("\b")
+    .return ($P394)
+  control_390:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P395, exception, "payload"
+    .return ($P395)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "quote_escape:sym<nl>"  :subid("36_1261064005.70696") :method :outer("11_1261064005.70696")
+    .param pmc param_399
+.annotate "line", 155
+    new $P398, 'ExceptionHandler'
+    set_addr $P398, control_397
+    $P398."handle_types"(58)
+    push_eh $P398
+    .lex "self", self
+    .lex "$/", param_399
+    find_lex $P400, "$/"
+    $P401 = $P400."!make"("\n")
+    .return ($P401)
+  control_397:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P402, exception, "payload"
+    .return ($P402)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "quote_escape:sym<cr>"  :subid("37_1261064005.70696") :method :outer("11_1261064005.70696")
+    .param pmc param_406
+.annotate "line", 156
+    new $P405, 'ExceptionHandler'
+    set_addr $P405, control_404
+    $P405."handle_types"(58)
+    push_eh $P405
+    .lex "self", self
+    .lex "$/", param_406
+    find_lex $P407, "$/"
+    $P408 = $P407."!make"("\r")
+    .return ($P408)
+  control_404:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P409, exception, "payload"
+    .return ($P409)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "quote_escape:sym<tab>"  :subid("38_1261064005.70696") :method :outer("11_1261064005.70696")
+    .param pmc param_413
+.annotate "line", 157
+    new $P412, 'ExceptionHandler'
+    set_addr $P412, control_411
+    $P412."handle_types"(58)
+    push_eh $P412
+    .lex "self", self
+    .lex "$/", param_413
+    find_lex $P414, "$/"
+    $P415 = $P414."!make"("\t")
+    .return ($P415)
+  control_411:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P416, exception, "payload"
+    .return ($P416)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "quote_escape:sym<hex>"  :subid("39_1261064005.70696") :method :outer("11_1261064005.70696")
+    .param pmc param_420
+.annotate "line", 159
+    new $P419, 'ExceptionHandler'
+    set_addr $P419, control_418
+    $P419."handle_types"(58)
+    push_eh $P419
+    .lex "self", self
+    .lex "$/", param_420
+.annotate "line", 160
+    find_lex $P421, "$/"
+    find_lex $P424, "$/"
+    unless_null $P424, vivify_87
+    new $P424, "Hash"
+  vivify_87:
+    set $P425, $P424["hexint"]
+    unless_null $P425, vivify_88
+    new $P425, "Undef"
+  vivify_88:
+    if $P425, if_423
+    find_lex $P428, "$/"
+    unless_null $P428, vivify_89
+    new $P428, "Hash"
+  vivify_89:
+    set $P429, $P428["hexints"]
+    unless_null $P429, vivify_90
+    new $P429, "Hash"
+  vivify_90:
+    set $P430, $P429["hexint"]
+    unless_null $P430, vivify_91
+    new $P430, "Undef"
+  vivify_91:
+    set $P422, $P430
+    goto if_423_end
+  if_423:
+    find_lex $P426, "$/"
+    unless_null $P426, vivify_92
+    new $P426, "Hash"
+  vivify_92:
+    set $P427, $P426["hexint"]
+    unless_null $P427, vivify_93
+    new $P427, "Undef"
+  vivify_93:
+    set $P422, $P427
+  if_423_end:
+    $P431 = "ints_to_string"($P422)
+    $P432 = $P421."!make"($P431)
+.annotate "line", 159
+    .return ($P432)
+  control_418:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P433, exception, "payload"
+    .return ($P433)
+.end
+
+
+.namespace ["HLL";"Actions"]
+.sub "quote_escape:sym<oct>"  :subid("40_1261064005.70696") :method :outer("11_1261064005.70696")
+    .param pmc param_437
+.annotate "line", 163
+    new $P436, 'ExceptionHandler'
+    set_addr $P436, control_435
+    $P436."handle_types"(58)
+    push_eh $P436
+    .lex "self", self
+    .lex "$/", param_437
+.annotate "line", 164
+    find_lex $P438, "$/"
+    find_lex $P441, "$/"
+    unless_null $P441, vivify_94
+    new $P441, "Hash"
+  vivify_94:
+    set $P442, $P441["octint"]
+    unless_null $P442, vivify_95
+    new $P442, "Undef"
+  vivify_95:
+    if $P442, if_440
+    find_lex $P445, "$/"
+    unless_null $P445, vivify_96
+    new $P445, "Hash"
+  vivify_96:
+    set $P446, $P445["octints"]
+    unless_null $P446, vivify_97
+    new $P446, "Hash"
+  vivify_97:
+    set $P447, $P446["octint"]
+    unless_null $P447, vivify_98
+    new $P447, "Undef"
+  vivify_98:
+    set $P439, $P447
+    goto if_440_end
+  if_440:
+    find_lex $P443, "$/"
+    unless_null $P443, vivify_99
+    new $P443, "Hash"
+  vivify_99:
+    set $P444, $P443["octint"]
+    unless_null $P444, vivify_100
+    new $P444, "Undef"
+  vivify_100:
+    set $P439, $P444
+  if_440_end:
+    $P448 = "ints_to_string"($P439)
+    $P449 = $P438."!make"($P448)
+.annotate "line", 163
+    .return ($P449)
+  control_435:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P450, exception, "payload"
+    .return ($P450)
+.end
+
+### .include 'gen/hllcompiler.pir'
+
+.namespace []
+.sub "_block11"  :anon :subid("10_1261064006.8204")
+.annotate "line", 0
+    get_hll_global $P14, ["HLL";"Compiler"], "_block13" 
+    capture_lex $P14
+.annotate "line", 6
+    get_hll_global $P14, ["HLL";"Compiler"], "_block13" 
+    capture_lex $P14
+    $P283 = $P14()
+.annotate "line", 1
+    .return ($P283)
+.end
+
+
+.namespace []
+.sub "" :load :init :subid("post25") :outer("10_1261064006.8204")
+.annotate "line", 0
+    .const 'Sub' $P12 = "10_1261064006.8204" 
+    .local pmc block
+    set block, $P12
+.annotate "line", 2
+    load_bytecode "PCT/HLLCompiler.pbc"
+.annotate "line", 1
+    $P284 = get_root_global ["parrot"], "P6metaclass"
+    new $P285, "ResizablePMCArray"
+    push $P285, "$!language"
+    $P284."new_class"("HLL::Compiler", "PCT::HLLCompiler" :named("parent"), $P285 :named("attr"))
+.end
+
+
+.namespace ["HLL";"Compiler"]
+.sub "_block13"  :subid("11_1261064006.8204") :outer("10_1261064006.8204")
+.annotate "line", 6
+    .const 'Sub' $P187 = "20_1261064006.8204" 
+    capture_lex $P187
+    .const 'Sub' $P152 = "18_1261064006.8204" 
+    capture_lex $P152
+    .const 'Sub' $P137 = "17_1261064006.8204" 
+    capture_lex $P137
+    .const 'Sub' $P121 = "16_1261064006.8204" 
+    capture_lex $P121
+    .const 'Sub' $P32 = "13_1261064006.8204" 
+    capture_lex $P32
+    .const 'Sub' $P15 = "12_1261064006.8204" 
+    capture_lex $P15
+.annotate "line", 14
+    .const 'Sub' $P15 = "12_1261064006.8204" 
+    capture_lex $P15
+    .lex "value_type", $P15
+.annotate "line", 10
+    find_lex $P31, "value_type"
+.annotate "line", 69
+    .const 'Sub' $P187 = "20_1261064006.8204" 
+    capture_lex $P187
+.annotate "line", 6
+    .return ($P187)
+.end
+
+
+.namespace ["HLL";"Compiler"]
+.sub "" :load :init :subid("post26") :outer("11_1261064006.8204")
+.annotate "line", 6
+    get_hll_global $P14, ["HLL";"Compiler"], "_block13" 
+    .local pmc block
+    set block, $P14
+.annotate "line", 11
+    get_hll_global $P282, ["HLL"], "Compiler"
+    $P282."language"("parrot")
+.end
+
+
+.namespace ["HLL";"Compiler"]
+.sub "value_type"  :subid("12_1261064006.8204") :outer("11_1261064006.8204")
+    .param pmc param_18
+.annotate "line", 14
+    new $P17, 'ExceptionHandler'
+    set_addr $P17, control_16
+    $P17."handle_types"(58)
+    push_eh $P17
+    .lex "$value", param_18
+.annotate "line", 15
+    find_lex $P21, "$value"
+    isa $I22, $P21, "NameSpace"
+    if $I22, if_20
+.annotate "line", 17
+    find_lex $P26, "$value"
+    isa $I27, $P26, "Sub"
+    if $I27, if_25
+    new $P29, "String"
+    assign $P29, "var"
+    set $P24, $P29
+    goto if_25_end
+  if_25:
+    new $P28, "String"
+    assign $P28, "sub"
+    set $P24, $P28
+  if_25_end:
+    set $P19, $P24
+.annotate "line", 15
+    goto if_20_end
+  if_20:
+    new $P23, "String"
+    assign $P23, "namespace"
+    set $P19, $P23
+  if_20_end:
+.annotate "line", 14
+    .return ($P19)
+  control_16:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P30, exception, "payload"
+    .return ($P30)
+.end
+
+
+.namespace ["HLL";"Compiler"]
+.sub "get_exports"  :subid("13_1261064006.8204") :method :outer("11_1261064006.8204")
+    .param pmc param_35
+    .param pmc param_38 :slurpy
+    .param pmc param_36 :optional :named("tagset")
+    .param int has_param_36 :opt_flag
+.annotate "line", 20
+    .const 'Sub' $P104 = "15_1261064006.8204" 
+    capture_lex $P104
+    .const 'Sub' $P83 = "14_1261064006.8204" 
+    capture_lex $P83
+    new $P34, 'ExceptionHandler'
+    set_addr $P34, control_33
+    $P34."handle_types"(58)
+    push_eh $P34
+    .lex "self", self
+    .lex "$module", param_35
+    if has_param_36, optparam_27
+    new $P37, "Undef"
+    set param_36, $P37
+  optparam_27:
+    .lex "$tagset", param_36
+    .lex "@symbols", param_38
+.annotate "line", 27
+    new $P39, "Hash"
+    .lex "%exports", $P39
+.annotate "line", 28
+    new $P40, "Hash"
+    .lex "%source", $P40
+.annotate "line", 22
+    find_lex $P42, "$module"
+    does $I43, $P42, "hash"
+    new $P44, 'Integer'
+    set $P44, $I43
+    isfalse $I45, $P44
+    unless $I45, if_41_end
+.annotate "line", 23
+    find_lex $P46, "self"
+    find_lex $P47, "$module"
+    $P48 = $P46."get_module"($P47)
+    store_lex "$module", $P48
+  if_41_end:
+.annotate "line", 26
+    find_lex $P50, "$tagset"
+    set $P49, $P50
+    defined $I52, $P49
+    if $I52, default_51
+    find_lex $P55, "@symbols"
+    if $P55, if_54
+    new $P57, "String"
+    assign $P57, "DEFAULT"
+    set $P53, $P57
+    goto if_54_end
+  if_54:
+    new $P56, "String"
+    assign $P56, "ALL"
+    set $P53, $P56
+  if_54_end:
+    set $P49, $P53
+  default_51:
+    store_lex "$tagset", $P49
+    find_lex $P58, "%exports"
+.annotate "line", 28
+    find_lex $P59, "$tagset"
+    set $S60, $P59
+    find_lex $P61, "$module"
+    unless_null $P61, vivify_28
+    new $P61, "Hash"
+  vivify_28:
+    set $P62, $P61["EXPORT"]
+    unless_null $P62, vivify_29
+    new $P62, "Hash"
+  vivify_29:
+    set $P63, $P62[$S60]
+    unless_null $P63, vivify_30
+    new $P63, "Undef"
+  vivify_30:
+    store_lex "%source", $P63
+.annotate "line", 29
+    find_lex $P65, "%source"
+    defined $I66, $P65
+    new $P67, 'Integer'
+    set $P67, $I66
+    isfalse $I68, $P67
+    unless $I68, if_64_end
+.annotate "line", 30
+    find_lex $P71, "$tagset"
+    set $S72, $P71
+    iseq $I73, $S72, "ALL"
+    if $I73, if_70
+    $P75 = new ["Hash"]
+    set $P69, $P75
+    goto if_70_end
+  if_70:
+    find_lex $P74, "$module"
+    set $P69, $P74
+  if_70_end:
+    store_lex "%source", $P69
+  if_64_end:
+.annotate "line", 32
+    find_lex $P77, "@symbols"
+    if $P77, if_76
+.annotate "line", 39
+    find_lex $P100, "%source"
+    defined $I101, $P100
+    unless $I101, for_undef_31
+    iter $P99, $P100
+    new $P117, 'ExceptionHandler'
+    set_addr $P117, loop116_handler
+    $P117."handle_types"(65, 67, 66)
+    push_eh $P117
+  loop116_test:
+    unless $P99, loop116_done
+    shift $P102, $P99
+  loop116_redo:
+    .const 'Sub' $P104 = "15_1261064006.8204" 
+    capture_lex $P104
+    $P104($P102)
+  loop116_next:
+    goto loop116_test
+  loop116_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P118, exception, 'type'
+    eq $P118, 65, loop116_next
+    eq $P118, 67, loop116_redo
+  loop116_done:
+    pop_eh 
+  for_undef_31:
+.annotate "line", 38
+    goto if_76_end
+  if_76:
+.annotate "line", 33
+    find_lex $P79, "@symbols"
+    defined $I80, $P79
+    unless $I80, for_undef_34
+    iter $P78, $P79
+    new $P97, 'ExceptionHandler'
+    set_addr $P97, loop96_handler
+    $P97."handle_types"(65, 67, 66)
+    push_eh $P97
+  loop96_test:
+    unless $P78, loop96_done
+    shift $P81, $P78
+  loop96_redo:
+    .const 'Sub' $P83 = "14_1261064006.8204" 
+    capture_lex $P83
+    $P83($P81)
+  loop96_next:
+    goto loop96_test
+  loop96_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P98, exception, 'type'
+    eq $P98, 65, loop96_next
+    eq $P98, 67, loop96_redo
+  loop96_done:
+    pop_eh 
+  for_undef_34:
+  if_76_end:
+.annotate "line", 32
+    find_lex $P119, "%exports"
+.annotate "line", 20
+    .return ($P119)
+  control_33:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P120, exception, "payload"
+    .return ($P120)
+.end
+
+
+.namespace ["HLL";"Compiler"]
+.sub "_block103"  :anon :subid("15_1261064006.8204") :outer("13_1261064006.8204")
+    .param pmc param_106
+.annotate "line", 40
+    new $P105, "Undef"
+    .lex "$value", $P105
+    .lex "$_", param_106
+    find_lex $P107, "$_"
+    $P108 = $P107."value"()
+    store_lex "$value", $P108
+.annotate "line", 41
+    find_lex $P109, "$value"
+    find_lex $P110, "$_"
+    $P111 = $P110."key"()
+    find_lex $P112, "$value"
+    $P113 = "value_type"($P112)
+    find_lex $P114, "%exports"
+    unless_null $P114, vivify_32
+    new $P114, "Hash"
+    store_lex "%exports", $P114
+  vivify_32:
+    set $P115, $P114[$P113]
+    unless_null $P115, vivify_33
+    new $P115, "Hash"
+    set $P114[$P113], $P115
+  vivify_33:
+    set $P115[$P111], $P109
+.annotate "line", 39
+    .return ($P109)
+.end
+
+
+.namespace ["HLL";"Compiler"]
+.sub "_block82"  :anon :subid("14_1261064006.8204") :outer("13_1261064006.8204")
+    .param pmc param_85
+.annotate "line", 34
+    new $P84, "Undef"
+    .lex "$value", $P84
+    .lex "$_", param_85
+    find_lex $P86, "$_"
+    set $S87, $P86
+    find_lex $P88, "%source"
+    unless_null $P88, vivify_35
+    new $P88, "Hash"
+  vivify_35:
+    set $P89, $P88[$S87]
+    unless_null $P89, vivify_36
+    new $P89, "Undef"
+  vivify_36:
+    store_lex "$value", $P89
+.annotate "line", 35
+    find_lex $P90, "$value"
+    find_lex $P91, "$_"
+    find_lex $P92, "$value"
+    $P93 = "value_type"($P92)
+    find_lex $P94, "%exports"
+    unless_null $P94, vivify_37
+    new $P94, "Hash"
+    store_lex "%exports", $P94
+  vivify_37:
+    set $P95, $P94[$P93]
+    unless_null $P95, vivify_38
+    new $P95, "Hash"
+    set $P94[$P93], $P95
+  vivify_38:
+    set $P95[$P91], $P90
+.annotate "line", 33
+    .return ($P90)
+.end
+
+
+.namespace ["HLL";"Compiler"]
+.sub "get_module"  :subid("16_1261064006.8204") :method :outer("11_1261064006.8204")
+    .param pmc param_124
+.annotate "line", 47
+    new $P123, 'ExceptionHandler'
+    set_addr $P123, control_122
+    $P123."handle_types"(58)
+    push_eh $P123
+    .lex "self", self
+    .lex "$name", param_124
+.annotate "line", 48
+    new $P125, "ResizablePMCArray"
+    .lex "@name", $P125
+    find_lex $P126, "self"
+    find_lex $P127, "$name"
+    $P128 = $P126."parse_name"($P127)
+    store_lex "@name", $P128
+.annotate "line", 49
+    find_lex $P129, "@name"
+    find_lex $P130, "self"
+    getattribute $P131, $P130, "$!language"
+    unless_null $P131, vivify_39
+    new $P131, "Undef"
+  vivify_39:
+    set $S132, $P131
+    downcase $S133, $S132
+    $P129."unshift"($S133)
+.annotate "line", 50
+    find_lex $P134, "@name"
+    get_root_namespace $P135, $P134
+.annotate "line", 47
+    .return ($P135)
+  control_122:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P136, exception, "payload"
+    .return ($P136)
+.end
+
+
+.namespace ["HLL";"Compiler"]
+.sub "language"  :subid("17_1261064006.8204") :method :outer("11_1261064006.8204")
+    .param pmc param_140 :optional
+    .param int has_param_140 :opt_flag
+.annotate "line", 53
+    new $P139, 'ExceptionHandler'
+    set_addr $P139, control_138
+    $P139."handle_types"(58)
+    push_eh $P139
+    .lex "self", self
+    if has_param_140, optparam_40
+    new $P141, "Undef"
+    set param_140, $P141
+  optparam_40:
+    .lex "$name", param_140
+.annotate "line", 54
+    find_lex $P143, "$name"
+    unless $P143, if_142_end
+.annotate "line", 55
+    find_lex $P144, "$name"
+    find_lex $P145, "self"
+    setattribute $P145, "$!language", $P144
+.annotate "line", 56
+    find_lex $P146, "$name"
+    set $S147, $P146
+    find_lex $P148, "self"
+    compreg $S147, $P148
+  if_142_end:
+.annotate "line", 54
+    find_lex $P149, "self"
+    getattribute $P150, $P149, "$!language"
+    unless_null $P150, vivify_41
+    new $P150, "Undef"
+  vivify_41:
+.annotate "line", 53
+    .return ($P150)
+  control_138:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P151, exception, "payload"
+    .return ($P151)
+.end
+
+
+.namespace ["HLL";"Compiler"]
+.sub "load_module"  :subid("18_1261064006.8204") :method :outer("11_1261064006.8204")
+    .param pmc param_155
+.annotate "line", 61
+    .const 'Sub' $P165 = "19_1261064006.8204" 
+    capture_lex $P165
+    new $P154, 'ExceptionHandler'
+    set_addr $P154, control_153
+    $P154."handle_types"(58)
+    push_eh $P154
+    .lex "self", self
+    .lex "$name", param_155
+.annotate "line", 62
+    new $P156, "Undef"
+    .lex "$base", $P156
+.annotate "line", 63
+    new $P157, "Undef"
+    .lex "$loaded", $P157
+.annotate "line", 62
+    find_lex $P158, "self"
+    find_lex $P159, "$name"
+    $P160 = $P158."parse_name"($P159)
+    join $S161, "/", $P160
+    new $P162, 'String'
+    set $P162, $S161
+    store_lex "$base", $P162
+.annotate "line", 63
+    new $P163, "Integer"
+    assign $P163, 0
+    store_lex "$loaded", $P163
+.annotate "line", 64
+    .const 'Sub' $P165 = "19_1261064006.8204" 
+    capture_lex $P165
+    $P165()
+.annotate "line", 65
+    find_lex $P178, "$loaded"
+    if $P178, unless_177_end
+    find_lex $P179, "$base"
+    concat $P180, $P179, ".pir"
+    set $S181, $P180
+    load_bytecode $S181
+    new $P182, "Integer"
+    assign $P182, 1
+    store_lex "$loaded", $P182
+  unless_177_end:
+.annotate "line", 66
+    find_lex $P183, "self"
+    find_lex $P184, "$name"
+    $P185 = $P183."get_module"($P184)
+.annotate "line", 61
+    .return ($P185)
+  control_153:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P186, exception, "payload"
+    .return ($P186)
+.end
+
+
+.namespace ["HLL";"Compiler"]
+.sub "_block164"  :anon :subid("19_1261064006.8204") :outer("18_1261064006.8204")
+.annotate "line", 64
+    new $P172, 'ExceptionHandler'
+    set_addr $P172, control_171
+    $P172."handle_types_except"(58, 59, 60, 61, 63, 64, 65, 66, 67)
+    push_eh $P172
+    find_lex $P166, "$base"
+    concat $P167, $P166, ".pbc"
+    set $S168, $P167
+    load_bytecode $S168
+    new $P169, "Integer"
+    assign $P169, 1
+    store_lex "$loaded", $P169
+    pop_eh 
+    goto skip_handler_170
+  control_171:
+    .local pmc exception 
+    .get_results (exception) 
+    new $P175, 'Integer'
+    set $P175, 1
+    set exception["handled"], $P175
+    set $I176, exception["handled"]
+    ne $I176, 1, nothandled_174
+  handled_173:
+    .return (exception)
+  nothandled_174:
+    rethrow exception
+  skip_handler_170:
+    .return ($P169)
+.end
+
+
+.namespace ["HLL";"Compiler"]
+.sub "import"  :subid("20_1261064006.8204") :method :outer("11_1261064006.8204")
+    .param pmc param_190
+    .param pmc param_191
+.annotate "line", 69
+    .const 'Sub' $P197 = "21_1261064006.8204" 
+    capture_lex $P197
+    new $P189, 'ExceptionHandler'
+    set_addr $P189, control_188
+    $P189."handle_types"(58)
+    push_eh $P189
+    .lex "self", self
+    .lex "$target", param_190
+    .lex "%exports", param_191
+.annotate "line", 70
+    find_lex $P193, "%exports"
+    defined $I194, $P193
+    unless $I194, for_undef_42
+    iter $P192, $P193
+    new $P279, 'ExceptionHandler'
+    set_addr $P279, loop278_handler
+    $P279."handle_types"(65, 67, 66)
+    push_eh $P279
+  loop278_test:
+    unless $P192, loop278_done
+    shift $P195, $P192
+  loop278_redo:
+    .const 'Sub' $P197 = "21_1261064006.8204" 
+    capture_lex $P197
+    $P197($P195)
+  loop278_next:
+    goto loop278_test
+  loop278_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P280, exception, 'type'
+    eq $P280, 65, loop278_next
+    eq $P280, 67, loop278_redo
+  loop278_done:
+    pop_eh 
+  for_undef_42:
+.annotate "line", 69
+    .return ($P192)
+  control_188:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P281, exception, "payload"
+    .return ($P281)
+.end
+
+
+.namespace ["HLL";"Compiler"]
+.sub "_block196"  :anon :subid("21_1261064006.8204") :outer("20_1261064006.8204")
+    .param pmc param_200
+.annotate "line", 70
+    .const 'Sub' $P267 = "24_1261064006.8204" 
+    capture_lex $P267
+    .const 'Sub' $P247 = "23_1261064006.8204" 
+    capture_lex $P247
+    .const 'Sub' $P218 = "22_1261064006.8204" 
+    capture_lex $P218
+.annotate "line", 71
+    new $P198, "Undef"
+    .lex "$type", $P198
+.annotate "line", 72
+    new $P199, "Hash"
+    .lex "%items", $P199
+    .lex "$_", param_200
+.annotate "line", 71
+    find_lex $P201, "$_"
+    $P202 = $P201."key"()
+    store_lex "$type", $P202
+.annotate "line", 72
+    find_lex $P203, "$_"
+    $P204 = $P203."value"()
+    store_lex "%items", $P204
+.annotate "line", 73
+    find_lex $P207, "self"
+    new $P208, 'String'
+    set $P208, "import_"
+    find_lex $P209, "$type"
+    concat $P210, $P208, $P209
+    set $S211, $P210
+    can $I212, $P207, $S211
+    if $I212, if_206
+.annotate "line", 76
+    find_lex $P236, "$target"
+    new $P237, 'String'
+    set $P237, "add_"
+    find_lex $P238, "$type"
+    concat $P239, $P237, $P238
+    set $S240, $P239
+    can $I241, $P236, $S240
+    if $I241, if_235
+.annotate "line", 80
+    find_lex $P263, "%items"
+    defined $I264, $P263
+    unless $I264, for_undef_43
+    iter $P262, $P263
+    new $P276, 'ExceptionHandler'
+    set_addr $P276, loop275_handler
+    $P276."handle_types"(65, 67, 66)
+    push_eh $P276
+  loop275_test:
+    unless $P262, loop275_done
+    shift $P265, $P262
+  loop275_redo:
+    .const 'Sub' $P267 = "24_1261064006.8204" 
+    capture_lex $P267
+    $P267($P265)
+  loop275_next:
+    goto loop275_test
+  loop275_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P277, exception, 'type'
+    eq $P277, 65, loop275_next
+    eq $P277, 67, loop275_redo
+  loop275_done:
+    pop_eh 
+  for_undef_43:
+.annotate "line", 79
+    set $P234, $P262
+.annotate "line", 76
+    goto if_235_end
+  if_235:
+.annotate "line", 77
+    find_lex $P243, "%items"
+    defined $I244, $P243
+    unless $I244, for_undef_45
+    iter $P242, $P243
+    new $P260, 'ExceptionHandler'
+    set_addr $P260, loop259_handler
+    $P260."handle_types"(65, 67, 66)
+    push_eh $P260
+  loop259_test:
+    unless $P242, loop259_done
+    shift $P245, $P242
+  loop259_redo:
+    .const 'Sub' $P247 = "23_1261064006.8204" 
+    capture_lex $P247
+    $P247($P245)
+  loop259_next:
+    goto loop259_test
+  loop259_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P261, exception, 'type'
+    eq $P261, 65, loop259_next
+    eq $P261, 67, loop259_redo
+  loop259_done:
+    pop_eh 
+  for_undef_45:
+.annotate "line", 76
+    set $P234, $P242
+  if_235_end:
+    set $P205, $P234
+.annotate "line", 73
+    goto if_206_end
+  if_206:
+.annotate "line", 74
+    find_lex $P214, "%items"
+    defined $I215, $P214
+    unless $I215, for_undef_46
+    iter $P213, $P214
+    new $P232, 'ExceptionHandler'
+    set_addr $P232, loop231_handler
+    $P232."handle_types"(65, 67, 66)
+    push_eh $P232
+  loop231_test:
+    unless $P213, loop231_done
+    shift $P216, $P213
+  loop231_redo:
+    .const 'Sub' $P218 = "22_1261064006.8204" 
+    capture_lex $P218
+    $P218($P216)
+  loop231_next:
+    goto loop231_test
+  loop231_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P233, exception, 'type'
+    eq $P233, 65, loop231_next
+    eq $P233, 67, loop231_redo
+  loop231_done:
+    pop_eh 
+  for_undef_46:
+.annotate "line", 73
+    set $P205, $P213
+  if_206_end:
+.annotate "line", 70
+    .return ($P205)
+.end
+
+
+.namespace ["HLL";"Compiler"]
+.sub "_block266"  :anon :subid("24_1261064006.8204") :outer("21_1261064006.8204")
+    .param pmc param_268
+.annotate "line", 80
+    .lex "$_", param_268
+    find_lex $P269, "$_"
+    $P270 = $P269."value"()
+    find_lex $P271, "$_"
+    $P272 = $P271."key"()
+    set $S273, $P272
+    find_lex $P274, "$target"
+    unless_null $P274, vivify_44
+    new $P274, "Hash"
+    store_lex "$target", $P274
+  vivify_44:
+    set $P274[$S273], $P270
+    .return ($P270)
+.end
+
+
+.namespace ["HLL";"Compiler"]
+.sub "_block246"  :anon :subid("23_1261064006.8204") :outer("21_1261064006.8204")
+    .param pmc param_248
+.annotate "line", 77
+    .lex "$_", param_248
+    find_lex $P249, "$target"
+    find_lex $P250, "$_"
+    $P251 = $P250."key"()
+    find_lex $P252, "$_"
+    $P253 = $P252."value"()
+    new $P254, 'String'
+    set $P254, "add_"
+    find_lex $P255, "$type"
+    concat $P256, $P254, $P255
+    set $S257, $P256
+    $P258 = $P249.$S257($P251, $P253)
+    .return ($P258)
+.end
+
+
+.namespace ["HLL";"Compiler"]
+.sub "_block217"  :anon :subid("22_1261064006.8204") :outer("21_1261064006.8204")
+    .param pmc param_219
+.annotate "line", 74
+    .lex "$_", param_219
+    find_lex $P220, "self"
+    find_lex $P221, "$target"
+    find_lex $P222, "$_"
+    $P223 = $P222."key"()
+    find_lex $P224, "$_"
+    $P225 = $P224."value"()
+    new $P226, 'String'
+    set $P226, "import_"
+    find_lex $P227, "$type"
+    concat $P228, $P226, $P227
+    set $S229, $P228
+    $P230 = $P220.$S229($P221, $P223, $P225)
+    .return ($P230)
+.end
+
+
+=head1 AUTHOR
+
+Patrick Michaud <pmichaud at pobox.com> is the author and maintainer.
+
+=head1 COPYRIGHT
+
+Copyright (C) 2009, The Perl Foundation.
+
+=cut
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Added: branches/orderedhash_revamp/ext/nqp-rx/src/stage0/NQP-s0.pir
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/src/stage0/NQP-s0.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,22287 @@
+# Copyright (C) 2009, The Perl Foundation.
+
+=head1 NAME
+
+NQP::Compiler - NQP compiler
+
+=head1 DESCRIPTION
+
+=cut
+
+.sub '' :anon :load :init
+    load_bytecode 'P6Regex.pbc'
+.end
+
+### .include 'gen/nqp-grammar.pir'
+
+.namespace []
+.sub "_block11"  :anon :subid("10_1261064023.05912")
+.annotate "line", 0
+    get_hll_global $P14, ["NQP";"Grammar"], "_block13" 
+    capture_lex $P14
+.annotate "line", 4
+    get_hll_global $P14, ["NQP";"Grammar"], "_block13" 
+    capture_lex $P14
+    $P1291 = $P14()
+.annotate "line", 1
+    .return ($P1291)
+.end
+
+
+.namespace []
+.sub "" :load :init :subid("post331") :outer("10_1261064023.05912")
+.annotate "line", 0
+    .const 'Sub' $P12 = "10_1261064023.05912" 
+    .local pmc block
+    set block, $P12
+    $P1292 = get_root_global ["parrot"], "P6metaclass"
+    $P1292."new_class"("NQP::Grammar", "HLL::Grammar" :named("parent"))
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "_block13"  :subid("11_1261064023.05912") :outer("10_1261064023.05912")
+.annotate "line", 4
+    get_hll_global $P1235, ["NQP";"Regex"], "_block1234" 
+    capture_lex $P1235
+    .const 'Sub' $P1221 = "317_1261064023.05912" 
+    capture_lex $P1221
+    .const 'Sub' $P1215 = "315_1261064023.05912" 
+    capture_lex $P1215
+    .const 'Sub' $P1209 = "313_1261064023.05912" 
+    capture_lex $P1209
+    .const 'Sub' $P1202 = "311_1261064023.05912" 
+    capture_lex $P1202
+    .const 'Sub' $P1195 = "309_1261064023.05912" 
+    capture_lex $P1195
+    .const 'Sub' $P1188 = "307_1261064023.05912" 
+    capture_lex $P1188
+    .const 'Sub' $P1181 = "305_1261064023.05912" 
+    capture_lex $P1181
+    .const 'Sub' $P1175 = "303_1261064023.05912" 
+    capture_lex $P1175
+    .const 'Sub' $P1168 = "301_1261064023.05912" 
+    capture_lex $P1168
+    .const 'Sub' $P1161 = "299_1261064023.05912" 
+    capture_lex $P1161
+    .const 'Sub' $P1154 = "297_1261064023.05912" 
+    capture_lex $P1154
+    .const 'Sub' $P1147 = "295_1261064023.05912" 
+    capture_lex $P1147
+    .const 'Sub' $P1140 = "293_1261064023.05912" 
+    capture_lex $P1140
+    .const 'Sub' $P1133 = "291_1261064023.05912" 
+    capture_lex $P1133
+    .const 'Sub' $P1126 = "289_1261064023.05912" 
+    capture_lex $P1126
+    .const 'Sub' $P1119 = "287_1261064023.05912" 
+    capture_lex $P1119
+    .const 'Sub' $P1112 = "285_1261064023.05912" 
+    capture_lex $P1112
+    .const 'Sub' $P1105 = "283_1261064023.05912" 
+    capture_lex $P1105
+    .const 'Sub' $P1098 = "281_1261064023.05912" 
+    capture_lex $P1098
+    .const 'Sub' $P1091 = "279_1261064023.05912" 
+    capture_lex $P1091
+    .const 'Sub' $P1084 = "277_1261064023.05912" 
+    capture_lex $P1084
+    .const 'Sub' $P1077 = "275_1261064023.05912" 
+    capture_lex $P1077
+    .const 'Sub' $P1070 = "273_1261064023.05912" 
+    capture_lex $P1070
+    .const 'Sub' $P1063 = "271_1261064023.05912" 
+    capture_lex $P1063
+    .const 'Sub' $P1056 = "269_1261064023.05912" 
+    capture_lex $P1056
+    .const 'Sub' $P1049 = "267_1261064023.05912" 
+    capture_lex $P1049
+    .const 'Sub' $P1042 = "265_1261064023.05912" 
+    capture_lex $P1042
+    .const 'Sub' $P1035 = "263_1261064023.05912" 
+    capture_lex $P1035
+    .const 'Sub' $P1028 = "261_1261064023.05912" 
+    capture_lex $P1028
+    .const 'Sub' $P1021 = "259_1261064023.05912" 
+    capture_lex $P1021
+    .const 'Sub' $P1014 = "257_1261064023.05912" 
+    capture_lex $P1014
+    .const 'Sub' $P1007 = "255_1261064023.05912" 
+    capture_lex $P1007
+    .const 'Sub' $P1000 = "253_1261064023.05912" 
+    capture_lex $P1000
+    .const 'Sub' $P993 = "251_1261064023.05912" 
+    capture_lex $P993
+    .const 'Sub' $P987 = "249_1261064023.05912" 
+    capture_lex $P987
+    .const 'Sub' $P980 = "247_1261064023.05912" 
+    capture_lex $P980
+    .const 'Sub' $P973 = "245_1261064023.05912" 
+    capture_lex $P973
+    .const 'Sub' $P966 = "243_1261064023.05912" 
+    capture_lex $P966
+    .const 'Sub' $P959 = "241_1261064023.05912" 
+    capture_lex $P959
+    .const 'Sub' $P952 = "239_1261064023.05912" 
+    capture_lex $P952
+    .const 'Sub' $P945 = "237_1261064023.05912" 
+    capture_lex $P945
+    .const 'Sub' $P938 = "235_1261064023.05912" 
+    capture_lex $P938
+    .const 'Sub' $P932 = "233_1261064023.05912" 
+    capture_lex $P932
+    .const 'Sub' $P926 = "231_1261064023.05912" 
+    capture_lex $P926
+    .const 'Sub' $P921 = "229_1261064023.05912" 
+    capture_lex $P921
+    .const 'Sub' $P915 = "227_1261064023.05912" 
+    capture_lex $P915
+    .const 'Sub' $P909 = "225_1261064023.05912" 
+    capture_lex $P909
+    .const 'Sub' $P904 = "223_1261064023.05912" 
+    capture_lex $P904
+    .const 'Sub' $P899 = "221_1261064023.05912" 
+    capture_lex $P899
+    .const 'Sub' $P892 = "219_1261064023.05912" 
+    capture_lex $P892
+    .const 'Sub' $P884 = "217_1261064023.05912" 
+    capture_lex $P884
+    .const 'Sub' $P879 = "215_1261064023.05912" 
+    capture_lex $P879
+    .const 'Sub' $P874 = "213_1261064023.05912" 
+    capture_lex $P874
+    .const 'Sub' $P869 = "211_1261064023.05912" 
+    capture_lex $P869
+    .const 'Sub' $P861 = "209_1261064023.05912" 
+    capture_lex $P861
+    .const 'Sub' $P853 = "207_1261064023.05912" 
+    capture_lex $P853
+    .const 'Sub' $P848 = "205_1261064023.05912" 
+    capture_lex $P848
+    .const 'Sub' $P843 = "203_1261064023.05912" 
+    capture_lex $P843
+    .const 'Sub' $P837 = "201_1261064023.05912" 
+    capture_lex $P837
+    .const 'Sub' $P831 = "199_1261064023.05912" 
+    capture_lex $P831
+    .const 'Sub' $P825 = "197_1261064023.05912" 
+    capture_lex $P825
+    .const 'Sub' $P819 = "195_1261064023.05912" 
+    capture_lex $P819
+    .const 'Sub' $P813 = "193_1261064023.05912" 
+    capture_lex $P813
+    .const 'Sub' $P808 = "191_1261064023.05912" 
+    capture_lex $P808
+    .const 'Sub' $P803 = "189_1261064023.05912" 
+    capture_lex $P803
+    .const 'Sub' $P790 = "185_1261064023.05912" 
+    capture_lex $P790
+    .const 'Sub' $P782 = "183_1261064023.05912" 
+    capture_lex $P782
+    .const 'Sub' $P776 = "181_1261064023.05912" 
+    capture_lex $P776
+    .const 'Sub' $P769 = "179_1261064023.05912" 
+    capture_lex $P769
+    .const 'Sub' $P763 = "177_1261064023.05912" 
+    capture_lex $P763
+    .const 'Sub' $P755 = "175_1261064023.05912" 
+    capture_lex $P755
+    .const 'Sub' $P747 = "173_1261064023.05912" 
+    capture_lex $P747
+    .const 'Sub' $P741 = "171_1261064023.05912" 
+    capture_lex $P741
+    .const 'Sub' $P735 = "169_1261064023.05912" 
+    capture_lex $P735
+    .const 'Sub' $P720 = "165_1261064023.05912" 
+    capture_lex $P720
+    .const 'Sub' $P688 = "163_1261064023.05912" 
+    capture_lex $P688
+    .const 'Sub' $P680 = "161_1261064023.05912" 
+    capture_lex $P680
+    .const 'Sub' $P674 = "159_1261064023.05912" 
+    capture_lex $P674
+    .const 'Sub' $P664 = "157_1261064023.05912" 
+    capture_lex $P664
+    .const 'Sub' $P649 = "155_1261064023.05912" 
+    capture_lex $P649
+    .const 'Sub' $P640 = "153_1261064023.05912" 
+    capture_lex $P640
+    .const 'Sub' $P621 = "151_1261064023.05912" 
+    capture_lex $P621
+    .const 'Sub' $P597 = "149_1261064023.05912" 
+    capture_lex $P597
+    .const 'Sub' $P590 = "147_1261064023.05912" 
+    capture_lex $P590
+    .const 'Sub' $P583 = "145_1261064023.05912" 
+    capture_lex $P583
+    .const 'Sub' $P573 = "141_1261064023.05912" 
+    capture_lex $P573
+    .const 'Sub' $P562 = "139_1261064023.05912" 
+    capture_lex $P562
+    .const 'Sub' $P555 = "137_1261064023.05912" 
+    capture_lex $P555
+    .const 'Sub' $P548 = "135_1261064023.05912" 
+    capture_lex $P548
+    .const 'Sub' $P541 = "133_1261064023.05912" 
+    capture_lex $P541
+    .const 'Sub' $P514 = "129_1261064023.05912" 
+    capture_lex $P514
+    .const 'Sub' $P505 = "127_1261064023.05912" 
+    capture_lex $P505
+    .const 'Sub' $P498 = "125_1261064023.05912" 
+    capture_lex $P498
+    .const 'Sub' $P489 = "121_1261064023.05912" 
+    capture_lex $P489
+    .const 'Sub' $P484 = "119_1261064023.05912" 
+    capture_lex $P484
+    .const 'Sub' $P472 = "117_1261064023.05912" 
+    capture_lex $P472
+    .const 'Sub' $P460 = "115_1261064023.05912" 
+    capture_lex $P460
+    .const 'Sub' $P452 = "113_1261064023.05912" 
+    capture_lex $P452
+    .const 'Sub' $P447 = "111_1261064023.05912" 
+    capture_lex $P447
+    .const 'Sub' $P441 = "109_1261064023.05912" 
+    capture_lex $P441
+    .const 'Sub' $P435 = "107_1261064023.05912" 
+    capture_lex $P435
+    .const 'Sub' $P429 = "105_1261064023.05912" 
+    capture_lex $P429
+    .const 'Sub' $P423 = "103_1261064023.05912" 
+    capture_lex $P423
+    .const 'Sub' $P417 = "101_1261064023.05912" 
+    capture_lex $P417
+    .const 'Sub' $P411 = "99_1261064023.05912" 
+    capture_lex $P411
+    .const 'Sub' $P405 = "97_1261064023.05912" 
+    capture_lex $P405
+    .const 'Sub' $P399 = "95_1261064023.05912" 
+    capture_lex $P399
+    .const 'Sub' $P391 = "93_1261064023.05912" 
+    capture_lex $P391
+    .const 'Sub' $P383 = "91_1261064023.05912" 
+    capture_lex $P383
+    .const 'Sub' $P371 = "87_1261064023.05912" 
+    capture_lex $P371
+    .const 'Sub' $P363 = "85_1261064023.05912" 
+    capture_lex $P363
+    .const 'Sub' $P353 = "81_1261064023.05912" 
+    capture_lex $P353
+    .const 'Sub' $P346 = "79_1261064023.05912" 
+    capture_lex $P346
+    .const 'Sub' $P339 = "77_1261064023.05912" 
+    capture_lex $P339
+    .const 'Sub' $P327 = "73_1261064023.05912" 
+    capture_lex $P327
+    .const 'Sub' $P319 = "71_1261064023.05912" 
+    capture_lex $P319
+    .const 'Sub' $P311 = "69_1261064023.05912" 
+    capture_lex $P311
+    .const 'Sub' $P291 = "67_1261064023.05912" 
+    capture_lex $P291
+    .const 'Sub' $P282 = "65_1261064023.05912" 
+    capture_lex $P282
+    .const 'Sub' $P264 = "62_1261064023.05912" 
+    capture_lex $P264
+    .const 'Sub' $P244 = "60_1261064023.05912" 
+    capture_lex $P244
+    .const 'Sub' $P235 = "56_1261064023.05912" 
+    capture_lex $P235
+    .const 'Sub' $P230 = "54_1261064023.05912" 
+    capture_lex $P230
+    .const 'Sub' $P221 = "50_1261064023.05912" 
+    capture_lex $P221
+    .const 'Sub' $P216 = "48_1261064023.05912" 
+    capture_lex $P216
+    .const 'Sub' $P208 = "46_1261064023.05912" 
+    capture_lex $P208
+    .const 'Sub' $P201 = "44_1261064023.05912" 
+    capture_lex $P201
+    .const 'Sub' $P195 = "42_1261064023.05912" 
+    capture_lex $P195
+    .const 'Sub' $P187 = "40_1261064023.05912" 
+    capture_lex $P187
+    .const 'Sub' $P181 = "38_1261064023.05912" 
+    capture_lex $P181
+    .const 'Sub' $P175 = "36_1261064023.05912" 
+    capture_lex $P175
+    .const 'Sub' $P159 = "33_1261064023.05912" 
+    capture_lex $P159
+    .const 'Sub' $P146 = "31_1261064023.05912" 
+    capture_lex $P146
+    .const 'Sub' $P139 = "29_1261064023.05912" 
+    capture_lex $P139
+    .const 'Sub' $P96 = "26_1261064023.05912" 
+    capture_lex $P96
+    .const 'Sub' $P78 = "23_1261064023.05912" 
+    capture_lex $P78
+    .const 'Sub' $P68 = "21_1261064023.05912" 
+    capture_lex $P68
+    .const 'Sub' $P54 = "19_1261064023.05912" 
+    capture_lex $P54
+    .const 'Sub' $P46 = "17_1261064023.05912" 
+    capture_lex $P46
+    .const 'Sub' $P39 = "15_1261064023.05912" 
+    capture_lex $P39
+    .const 'Sub' $P33 = "13_1261064023.05912" 
+    capture_lex $P33
+    .const 'Sub' $P15 = "12_1261064023.05912" 
+    capture_lex $P15
+.annotate "line", 527
+    get_hll_global $P1235, ["NQP";"Regex"], "_block1234" 
+    capture_lex $P1235
+    $P1274 = $P1235()
+.annotate "line", 4
+    .return ($P1274)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "" :load :init :subid("post332") :outer("11_1261064023.05912")
+.annotate "line", 4
+    get_hll_global $P14, ["NQP";"Grammar"], "_block13" 
+    .local pmc block
+    set block, $P14
+.annotate "line", 414
+    get_hll_global $P1275, ["NQP"], "Grammar"
+    $P1275."O"(":prec<y=>, :assoc<unary>", "%methodop")
+.annotate "line", 415
+    get_hll_global $P1276, ["NQP"], "Grammar"
+    $P1276."O"(":prec<x=>, :assoc<unary>", "%autoincrement")
+.annotate "line", 416
+    get_hll_global $P1277, ["NQP"], "Grammar"
+    $P1277."O"(":prec<w=>, :assoc<left>", "%exponentiation")
+.annotate "line", 417
+    get_hll_global $P1278, ["NQP"], "Grammar"
+    $P1278."O"(":prec<v=>, :assoc<unary>", "%symbolic_unary")
+.annotate "line", 418
+    get_hll_global $P1279, ["NQP"], "Grammar"
+    $P1279."O"(":prec<u=>, :assoc<left>", "%multiplicative")
+.annotate "line", 419
+    get_hll_global $P1280, ["NQP"], "Grammar"
+    $P1280."O"(":prec<t=>, :assoc<left>", "%additive")
+.annotate "line", 420
+    get_hll_global $P1281, ["NQP"], "Grammar"
+    $P1281."O"(":prec<r=>, :assoc<left>", "%concatenation")
+.annotate "line", 421
+    get_hll_global $P1282, ["NQP"], "Grammar"
+    $P1282."O"(":prec<m=>, :assoc<left>", "%relational")
+.annotate "line", 422
+    get_hll_global $P1283, ["NQP"], "Grammar"
+    $P1283."O"(":prec<l=>, :assoc<left>", "%tight_and")
+.annotate "line", 423
+    get_hll_global $P1284, ["NQP"], "Grammar"
+    $P1284."O"(":prec<k=>, :assoc<left>", "%tight_or")
+.annotate "line", 424
+    get_hll_global $P1285, ["NQP"], "Grammar"
+    $P1285."O"(":prec<j=>, :assoc<right>", "%conditional")
+.annotate "line", 425
+    get_hll_global $P1286, ["NQP"], "Grammar"
+    $P1286."O"(":prec<i=>, :assoc<right>", "%assignment")
+.annotate "line", 426
+    get_hll_global $P1287, ["NQP"], "Grammar"
+    $P1287."O"(":prec<g=>, :assoc<list>, :nextterm<nulltermish>", "%comma")
+.annotate "line", 427
+    get_hll_global $P1288, ["NQP"], "Grammar"
+    $P1288."O"(":prec<f=>, :assoc<list>", "%list_infix")
+.annotate "line", 428
+    get_hll_global $P1289, ["NQP"], "Grammar"
+    $P1289."O"(":prec<e=>, :assoc<unary>", "%list_prefix")
+.annotate "line", 413
+    $P1290 = get_root_global ["parrot"], "P6metaclass"
+    $P1290."new_class"("NQP::Regex", "Regex::P6Regex::Grammar" :named("parent"))
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "TOP"  :subid("12_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    new $P17, 'ExceptionHandler'
+    set_addr $P17, control_16
+    $P17."handle_types"(58)
+    push_eh $P17
+    .lex "self", self
+.annotate "line", 5
+    new $P18, "Hash"
+    .lex "%*LANG", $P18
+.annotate "line", 10
+    new $P19, "Undef"
+    .lex "$*SCOPE", $P19
+.annotate "line", 4
+    find_lex $P20, "%*LANG"
+    unless_null $P20, vivify_333
+    get_hll_global $P20, "%LANG"
+    unless_null $P20, vivify_334
+    die "Contextual %*LANG not found"
+  vivify_334:
+  vivify_333:
+.annotate "line", 6
+    get_hll_global $P21, ["NQP"], "Regex"
+    find_lex $P22, "%*LANG"
+    unless_null $P22, vivify_335
+    get_hll_global $P22, "%LANG"
+    unless_null $P22, vivify_336
+    die "Contextual %*LANG not found"
+  vivify_336:
+    store_lex "%*LANG", $P22
+  vivify_335:
+    set $P22["Regex"], $P21
+.annotate "line", 7
+    get_hll_global $P23, ["NQP"], "RegexActions"
+    find_lex $P24, "%*LANG"
+    unless_null $P24, vivify_337
+    get_hll_global $P24, "%LANG"
+    unless_null $P24, vivify_338
+    die "Contextual %*LANG not found"
+  vivify_338:
+    store_lex "%*LANG", $P24
+  vivify_337:
+    set $P24["Regex-actions"], $P23
+.annotate "line", 8
+    get_hll_global $P25, ["NQP"], "Grammar"
+    find_lex $P26, "%*LANG"
+    unless_null $P26, vivify_339
+    get_hll_global $P26, "%LANG"
+    unless_null $P26, vivify_340
+    die "Contextual %*LANG not found"
+  vivify_340:
+    store_lex "%*LANG", $P26
+  vivify_339:
+    set $P26["MAIN"], $P25
+.annotate "line", 9
+    get_hll_global $P27, ["NQP"], "Actions"
+    find_lex $P28, "%*LANG"
+    unless_null $P28, vivify_341
+    get_hll_global $P28, "%LANG"
+    unless_null $P28, vivify_342
+    die "Contextual %*LANG not found"
+  vivify_342:
+    store_lex "%*LANG", $P28
+  vivify_341:
+    set $P28["MAIN-actions"], $P27
+.annotate "line", 10
+    new $P29, "String"
+    assign $P29, ""
+    store_lex "$*SCOPE", $P29
+.annotate "line", 11
+    find_lex $P30, "self"
+    $P31 = $P30."comp_unit"()
+.annotate "line", 4
+    .return ($P31)
+  control_16:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P32, exception, "payload"
+    .return ($P32)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "identifier"  :subid("13_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx34_tgt
+    .local int rx34_pos
+    .local int rx34_off
+    .local int rx34_eos
+    .local int rx34_rep
+    .local pmc rx34_cur
+    (rx34_cur, rx34_pos, rx34_tgt) = self."!cursor_start"()
+    rx34_cur."!cursor_debug"("START ", "identifier")
+    .lex unicode:"$\x{a2}", rx34_cur
+    .local pmc match
+    .lex "$/", match
+    length rx34_eos, rx34_tgt
+    set rx34_off, 0
+    lt rx34_pos, 2, rx34_start
+    sub rx34_off, rx34_pos, 1
+    substr rx34_tgt, rx34_tgt, rx34_off
+  rx34_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan38_done
+    goto rxscan38_scan
+  rxscan38_loop:
+    ($P10) = rx34_cur."from"()
+    inc $P10
+    set rx34_pos, $P10
+    ge rx34_pos, rx34_eos, rxscan38_done
+  rxscan38_scan:
+    set_addr $I10, rxscan38_loop
+    rx34_cur."!mark_push"(0, rx34_pos, $I10)
+  rxscan38_done:
+.annotate "line", 16
+  # rx subrule "ident" subtype=capture negate=
+    rx34_cur."!cursor_pos"(rx34_pos)
+    $P10 = rx34_cur."ident"()
+    unless $P10, rx34_fail
+    rx34_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("ident")
+    rx34_pos = $P10."pos"()
+  # rx pass
+    rx34_cur."!cursor_pass"(rx34_pos, "identifier")
+    rx34_cur."!cursor_debug"("PASS  ", "identifier", " at pos=", rx34_pos)
+    .return (rx34_cur)
+  rx34_fail:
+.annotate "line", 4
+    (rx34_rep, rx34_pos, $I10, $P10) = rx34_cur."!mark_fail"(0)
+    lt rx34_pos, -1, rx34_done
+    eq rx34_pos, -1, rx34_fail
+    jump $I10
+  rx34_done:
+    rx34_cur."!cursor_fail"()
+    rx34_cur."!cursor_debug"("FAIL  ", "identifier")
+    .return (rx34_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__identifier"  :subid("14_1261064023.05912") :method
+.annotate "line", 4
+    $P36 = self."!PREFIX__!subrule"("ident", "")
+    new $P37, "ResizablePMCArray"
+    push $P37, $P36
+    .return ($P37)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "name"  :subid("15_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx40_tgt
+    .local int rx40_pos
+    .local int rx40_off
+    .local int rx40_eos
+    .local int rx40_rep
+    .local pmc rx40_cur
+    (rx40_cur, rx40_pos, rx40_tgt) = self."!cursor_start"()
+    rx40_cur."!cursor_debug"("START ", "name")
+    rx40_cur."!cursor_caparray"("identifier")
+    .lex unicode:"$\x{a2}", rx40_cur
+    .local pmc match
+    .lex "$/", match
+    length rx40_eos, rx40_tgt
+    set rx40_off, 0
+    lt rx40_pos, 2, rx40_start
+    sub rx40_off, rx40_pos, 1
+    substr rx40_tgt, rx40_tgt, rx40_off
+  rx40_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan43_done
+    goto rxscan43_scan
+  rxscan43_loop:
+    ($P10) = rx40_cur."from"()
+    inc $P10
+    set rx40_pos, $P10
+    ge rx40_pos, rx40_eos, rxscan43_done
+  rxscan43_scan:
+    set_addr $I10, rxscan43_loop
+    rx40_cur."!mark_push"(0, rx40_pos, $I10)
+  rxscan43_done:
+.annotate "line", 18
+  # rx rxquantr44 ** 1..*
+    set_addr $I45, rxquantr44_done
+    rx40_cur."!mark_push"(0, -1, $I45)
+  rxquantr44_loop:
+  # rx subrule "identifier" subtype=capture negate=
+    rx40_cur."!cursor_pos"(rx40_pos)
+    $P10 = rx40_cur."identifier"()
+    unless $P10, rx40_fail
+    rx40_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("identifier")
+    rx40_pos = $P10."pos"()
+    (rx40_rep) = rx40_cur."!mark_commit"($I45)
+    rx40_cur."!mark_push"(rx40_rep, rx40_pos, $I45)
+  # rx literal  "::"
+    add $I11, rx40_pos, 2
+    gt $I11, rx40_eos, rx40_fail
+    sub $I11, rx40_pos, rx40_off
+    substr $S10, rx40_tgt, $I11, 2
+    ne $S10, "::", rx40_fail
+    add rx40_pos, 2
+    goto rxquantr44_loop
+  rxquantr44_done:
+  # rx pass
+    rx40_cur."!cursor_pass"(rx40_pos, "name")
+    rx40_cur."!cursor_debug"("PASS  ", "name", " at pos=", rx40_pos)
+    .return (rx40_cur)
+  rx40_fail:
+.annotate "line", 4
+    (rx40_rep, rx40_pos, $I10, $P10) = rx40_cur."!mark_fail"(0)
+    lt rx40_pos, -1, rx40_done
+    eq rx40_pos, -1, rx40_fail
+    jump $I10
+  rx40_done:
+    rx40_cur."!cursor_fail"()
+    rx40_cur."!cursor_debug"("FAIL  ", "name")
+    .return (rx40_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__name"  :subid("16_1261064023.05912") :method
+.annotate "line", 4
+    new $P42, "ResizablePMCArray"
+    push $P42, ""
+    .return ($P42)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "deflongname"  :subid("17_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx47_tgt
+    .local int rx47_pos
+    .local int rx47_off
+    .local int rx47_eos
+    .local int rx47_rep
+    .local pmc rx47_cur
+    (rx47_cur, rx47_pos, rx47_tgt) = self."!cursor_start"()
+    rx47_cur."!cursor_debug"("START ", "deflongname")
+    rx47_cur."!cursor_caparray"("colonpair")
+    .lex unicode:"$\x{a2}", rx47_cur
+    .local pmc match
+    .lex "$/", match
+    length rx47_eos, rx47_tgt
+    set rx47_off, 0
+    lt rx47_pos, 2, rx47_start
+    sub rx47_off, rx47_pos, 1
+    substr rx47_tgt, rx47_tgt, rx47_off
+  rx47_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan51_done
+    goto rxscan51_scan
+  rxscan51_loop:
+    ($P10) = rx47_cur."from"()
+    inc $P10
+    set rx47_pos, $P10
+    ge rx47_pos, rx47_eos, rxscan51_done
+  rxscan51_scan:
+    set_addr $I10, rxscan51_loop
+    rx47_cur."!mark_push"(0, rx47_pos, $I10)
+  rxscan51_done:
+.annotate "line", 21
+  # rx subrule "identifier" subtype=capture negate=
+    rx47_cur."!cursor_pos"(rx47_pos)
+    $P10 = rx47_cur."identifier"()
+    unless $P10, rx47_fail
+    rx47_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("identifier")
+    rx47_pos = $P10."pos"()
+  # rx rxquantr52 ** 0..1
+    set_addr $I53, rxquantr52_done
+    rx47_cur."!mark_push"(0, rx47_pos, $I53)
+  rxquantr52_loop:
+  # rx subrule "colonpair" subtype=capture negate=
+    rx47_cur."!cursor_pos"(rx47_pos)
+    $P10 = rx47_cur."colonpair"()
+    unless $P10, rx47_fail
+    rx47_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("colonpair")
+    rx47_pos = $P10."pos"()
+    (rx47_rep) = rx47_cur."!mark_commit"($I53)
+  rxquantr52_done:
+.annotate "line", 20
+  # rx pass
+    rx47_cur."!cursor_pass"(rx47_pos, "deflongname")
+    rx47_cur."!cursor_debug"("PASS  ", "deflongname", " at pos=", rx47_pos)
+    .return (rx47_cur)
+  rx47_fail:
+.annotate "line", 4
+    (rx47_rep, rx47_pos, $I10, $P10) = rx47_cur."!mark_fail"(0)
+    lt rx47_pos, -1, rx47_done
+    eq rx47_pos, -1, rx47_fail
+    jump $I10
+  rx47_done:
+    rx47_cur."!cursor_fail"()
+    rx47_cur."!cursor_debug"("FAIL  ", "deflongname")
+    .return (rx47_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__deflongname"  :subid("18_1261064023.05912") :method
+.annotate "line", 4
+    $P49 = self."!PREFIX__!subrule"("identifier", "")
+    new $P50, "ResizablePMCArray"
+    push $P50, $P49
+    .return ($P50)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "ENDSTMT"  :subid("19_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx55_tgt
+    .local int rx55_pos
+    .local int rx55_off
+    .local int rx55_eos
+    .local int rx55_rep
+    .local pmc rx55_cur
+    (rx55_cur, rx55_pos, rx55_tgt) = self."!cursor_start"()
+    rx55_cur."!cursor_debug"("START ", "ENDSTMT")
+    .lex unicode:"$\x{a2}", rx55_cur
+    .local pmc match
+    .lex "$/", match
+    length rx55_eos, rx55_tgt
+    set rx55_off, 0
+    lt rx55_pos, 2, rx55_start
+    sub rx55_off, rx55_pos, 1
+    substr rx55_tgt, rx55_tgt, rx55_off
+  rx55_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan58_done
+    goto rxscan58_scan
+  rxscan58_loop:
+    ($P10) = rx55_cur."from"()
+    inc $P10
+    set rx55_pos, $P10
+    ge rx55_pos, rx55_eos, rxscan58_done
+  rxscan58_scan:
+    set_addr $I10, rxscan58_loop
+    rx55_cur."!mark_push"(0, rx55_pos, $I10)
+  rxscan58_done:
+.annotate "line", 28
+  # rx rxquantr59 ** 0..1
+    set_addr $I67, rxquantr59_done
+    rx55_cur."!mark_push"(0, rx55_pos, $I67)
+  rxquantr59_loop:
+  alt60_0:
+.annotate "line", 25
+    set_addr $I10, alt60_1
+    rx55_cur."!mark_push"(0, rx55_pos, $I10)
+.annotate "line", 26
+  # rx rxquantr61 ** 0..*
+    set_addr $I62, rxquantr61_done
+    rx55_cur."!mark_push"(0, rx55_pos, $I62)
+  rxquantr61_loop:
+  # rx enumcharlist negate=0 
+    ge rx55_pos, rx55_eos, rx55_fail
+    sub $I10, rx55_pos, rx55_off
+    substr $S10, rx55_tgt, $I10, 1
+    index $I11, unicode:"\t \x{a0}\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000", $S10
+    lt $I11, 0, rx55_fail
+    inc rx55_pos
+    (rx55_rep) = rx55_cur."!mark_commit"($I62)
+    rx55_cur."!mark_push"(rx55_rep, rx55_pos, $I62)
+    goto rxquantr61_loop
+  rxquantr61_done:
+  # rxanchor eol
+    sub $I10, rx55_pos, rx55_off
+    is_cclass $I11, 4096, rx55_tgt, $I10
+    if $I11, rxanchor63_done
+    ne rx55_pos, rx55_eos, rx55_fail
+    eq rx55_pos, 0, rxanchor63_done
+    dec $I10
+    is_cclass $I11, 4096, rx55_tgt, $I10
+    if $I11, rx55_fail
+  rxanchor63_done:
+  # rx subrule "ws" subtype=method negate=
+    rx55_cur."!cursor_pos"(rx55_pos)
+    $P10 = rx55_cur."ws"()
+    unless $P10, rx55_fail
+    rx55_pos = $P10."pos"()
+  # rx subrule "MARKER" subtype=zerowidth negate=
+    rx55_cur."!cursor_pos"(rx55_pos)
+    $P10 = rx55_cur."MARKER"("endstmt")
+    unless $P10, rx55_fail
+    goto alt60_end
+  alt60_1:
+.annotate "line", 27
+  # rx rxquantr64 ** 0..1
+    set_addr $I65, rxquantr64_done
+    rx55_cur."!mark_push"(0, rx55_pos, $I65)
+  rxquantr64_loop:
+  # rx subrule "unv" subtype=method negate=
+    rx55_cur."!cursor_pos"(rx55_pos)
+    $P10 = rx55_cur."unv"()
+    unless $P10, rx55_fail
+    rx55_pos = $P10."pos"()
+    (rx55_rep) = rx55_cur."!mark_commit"($I65)
+  rxquantr64_done:
+  # rxanchor eol
+    sub $I10, rx55_pos, rx55_off
+    is_cclass $I11, 4096, rx55_tgt, $I10
+    if $I11, rxanchor66_done
+    ne rx55_pos, rx55_eos, rx55_fail
+    eq rx55_pos, 0, rxanchor66_done
+    dec $I10
+    is_cclass $I11, 4096, rx55_tgt, $I10
+    if $I11, rx55_fail
+  rxanchor66_done:
+  # rx subrule "ws" subtype=method negate=
+    rx55_cur."!cursor_pos"(rx55_pos)
+    $P10 = rx55_cur."ws"()
+    unless $P10, rx55_fail
+    rx55_pos = $P10."pos"()
+  # rx subrule "MARKER" subtype=zerowidth negate=
+    rx55_cur."!cursor_pos"(rx55_pos)
+    $P10 = rx55_cur."MARKER"("endstmt")
+    unless $P10, rx55_fail
+  alt60_end:
+.annotate "line", 28
+    (rx55_rep) = rx55_cur."!mark_commit"($I67)
+  rxquantr59_done:
+.annotate "line", 24
+  # rx pass
+    rx55_cur."!cursor_pass"(rx55_pos, "ENDSTMT")
+    rx55_cur."!cursor_debug"("PASS  ", "ENDSTMT", " at pos=", rx55_pos)
+    .return (rx55_cur)
+  rx55_fail:
+.annotate "line", 4
+    (rx55_rep, rx55_pos, $I10, $P10) = rx55_cur."!mark_fail"(0)
+    lt rx55_pos, -1, rx55_done
+    eq rx55_pos, -1, rx55_fail
+    jump $I10
+  rx55_done:
+    rx55_cur."!cursor_fail"()
+    rx55_cur."!cursor_debug"("FAIL  ", "ENDSTMT")
+    .return (rx55_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__ENDSTMT"  :subid("20_1261064023.05912") :method
+.annotate "line", 4
+    new $P57, "ResizablePMCArray"
+    push $P57, ""
+    .return ($P57)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "ws"  :subid("21_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx69_tgt
+    .local int rx69_pos
+    .local int rx69_off
+    .local int rx69_eos
+    .local int rx69_rep
+    .local pmc rx69_cur
+    (rx69_cur, rx69_pos, rx69_tgt) = self."!cursor_start"()
+    rx69_cur."!cursor_debug"("START ", "ws")
+    .lex unicode:"$\x{a2}", rx69_cur
+    .local pmc match
+    .lex "$/", match
+    length rx69_eos, rx69_tgt
+    set rx69_off, 0
+    lt rx69_pos, 2, rx69_start
+    sub rx69_off, rx69_pos, 1
+    substr rx69_tgt, rx69_tgt, rx69_off
+  rx69_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan72_done
+    goto rxscan72_scan
+  rxscan72_loop:
+    ($P10) = rx69_cur."from"()
+    inc $P10
+    set rx69_pos, $P10
+    ge rx69_pos, rx69_eos, rxscan72_done
+  rxscan72_scan:
+    set_addr $I10, rxscan72_loop
+    rx69_cur."!mark_push"(0, rx69_pos, $I10)
+  rxscan72_done:
+  alt73_0:
+.annotate "line", 31
+    set_addr $I10, alt73_1
+    rx69_cur."!mark_push"(0, rx69_pos, $I10)
+.annotate "line", 32
+  # rx subrule "MARKED" subtype=zerowidth negate=
+    rx69_cur."!cursor_pos"(rx69_pos)
+    $P10 = rx69_cur."MARKED"("ws")
+    unless $P10, rx69_fail
+    goto alt73_end
+  alt73_1:
+.annotate "line", 33
+  # rx subrule "ww" subtype=zerowidth negate=1
+    rx69_cur."!cursor_pos"(rx69_pos)
+    $P10 = rx69_cur."ww"()
+    if $P10, rx69_fail
+.annotate "line", 37
+  # rx rxquantr74 ** 0..*
+    set_addr $I77, rxquantr74_done
+    rx69_cur."!mark_push"(0, rx69_pos, $I77)
+  rxquantr74_loop:
+  alt75_0:
+.annotate "line", 34
+    set_addr $I10, alt75_1
+    rx69_cur."!mark_push"(0, rx69_pos, $I10)
+  # rx charclass_q s r 1..-1
+    sub $I10, rx69_pos, rx69_off
+    find_not_cclass $I11, 32, rx69_tgt, $I10, rx69_eos
+    add $I12, $I10, 1
+    lt $I11, $I12, rx69_fail
+    add rx69_pos, rx69_off, $I11
+    goto alt75_end
+  alt75_1:
+    set_addr $I10, alt75_2
+    rx69_cur."!mark_push"(0, rx69_pos, $I10)
+.annotate "line", 35
+  # rx literal  "#"
+    add $I11, rx69_pos, 1
+    gt $I11, rx69_eos, rx69_fail
+    sub $I11, rx69_pos, rx69_off
+    substr $S10, rx69_tgt, $I11, 1
+    ne $S10, "#", rx69_fail
+    add rx69_pos, 1
+  # rx charclass_q N r 0..-1
+    sub $I10, rx69_pos, rx69_off
+    find_cclass $I11, 4096, rx69_tgt, $I10, rx69_eos
+    add rx69_pos, rx69_off, $I11
+    goto alt75_end
+  alt75_2:
+.annotate "line", 36
+  # rxanchor bol
+    eq rx69_pos, 0, rxanchor76_done
+    ge rx69_pos, rx69_eos, rx69_fail
+    sub $I10, rx69_pos, rx69_off
+    dec $I10
+    is_cclass $I11, 4096, rx69_tgt, $I10
+    unless $I11, rx69_fail
+  rxanchor76_done:
+  # rx subrule "pod_comment" subtype=method negate=
+    rx69_cur."!cursor_pos"(rx69_pos)
+    $P10 = rx69_cur."pod_comment"()
+    unless $P10, rx69_fail
+    rx69_pos = $P10."pos"()
+  alt75_end:
+.annotate "line", 37
+    (rx69_rep) = rx69_cur."!mark_commit"($I77)
+    rx69_cur."!mark_push"(rx69_rep, rx69_pos, $I77)
+    goto rxquantr74_loop
+  rxquantr74_done:
+.annotate "line", 38
+  # rx subrule "MARKER" subtype=zerowidth negate=
+    rx69_cur."!cursor_pos"(rx69_pos)
+    $P10 = rx69_cur."MARKER"("ws")
+    unless $P10, rx69_fail
+  alt73_end:
+.annotate "line", 31
+  # rx pass
+    rx69_cur."!cursor_pass"(rx69_pos, "ws")
+    rx69_cur."!cursor_debug"("PASS  ", "ws", " at pos=", rx69_pos)
+    .return (rx69_cur)
+  rx69_fail:
+.annotate "line", 4
+    (rx69_rep, rx69_pos, $I10, $P10) = rx69_cur."!mark_fail"(0)
+    lt rx69_pos, -1, rx69_done
+    eq rx69_pos, -1, rx69_fail
+    jump $I10
+  rx69_done:
+    rx69_cur."!cursor_fail"()
+    rx69_cur."!cursor_debug"("FAIL  ", "ws")
+    .return (rx69_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__ws"  :subid("22_1261064023.05912") :method
+.annotate "line", 4
+    new $P71, "ResizablePMCArray"
+    push $P71, ""
+    push $P71, ""
+    .return ($P71)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "unv"  :subid("23_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .const 'Sub' $P86 = "25_1261064023.05912" 
+    capture_lex $P86
+    .local string rx79_tgt
+    .local int rx79_pos
+    .local int rx79_off
+    .local int rx79_eos
+    .local int rx79_rep
+    .local pmc rx79_cur
+    (rx79_cur, rx79_pos, rx79_tgt) = self."!cursor_start"()
+    rx79_cur."!cursor_debug"("START ", "unv")
+    .lex unicode:"$\x{a2}", rx79_cur
+    .local pmc match
+    .lex "$/", match
+    length rx79_eos, rx79_tgt
+    set rx79_off, 0
+    lt rx79_pos, 2, rx79_start
+    sub rx79_off, rx79_pos, 1
+    substr rx79_tgt, rx79_tgt, rx79_off
+  rx79_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan82_done
+    goto rxscan82_scan
+  rxscan82_loop:
+    ($P10) = rx79_cur."from"()
+    inc $P10
+    set rx79_pos, $P10
+    ge rx79_pos, rx79_eos, rxscan82_done
+  rxscan82_scan:
+    set_addr $I10, rxscan82_loop
+    rx79_cur."!mark_push"(0, rx79_pos, $I10)
+  rxscan82_done:
+  alt83_0:
+.annotate "line", 43
+    set_addr $I10, alt83_1
+    rx79_cur."!mark_push"(0, rx79_pos, $I10)
+.annotate "line", 44
+  # rxanchor bol
+    eq rx79_pos, 0, rxanchor84_done
+    ge rx79_pos, rx79_eos, rx79_fail
+    sub $I10, rx79_pos, rx79_off
+    dec $I10
+    is_cclass $I11, 4096, rx79_tgt, $I10
+    unless $I11, rx79_fail
+  rxanchor84_done:
+  # rx subrule "before" subtype=zerowidth negate=
+    rx79_cur."!cursor_pos"(rx79_pos)
+    .const 'Sub' $P86 = "25_1261064023.05912" 
+    capture_lex $P86
+    $P10 = rx79_cur."before"($P86)
+    unless $P10, rx79_fail
+  # rx subrule "pod_comment" subtype=method negate=
+    rx79_cur."!cursor_pos"(rx79_pos)
+    $P10 = rx79_cur."pod_comment"()
+    unless $P10, rx79_fail
+    rx79_pos = $P10."pos"()
+    goto alt83_end
+  alt83_1:
+    set_addr $I10, alt83_2
+    rx79_cur."!mark_push"(0, rx79_pos, $I10)
+.annotate "line", 45
+  # rx rxquantr92 ** 0..*
+    set_addr $I93, rxquantr92_done
+    rx79_cur."!mark_push"(0, rx79_pos, $I93)
+  rxquantr92_loop:
+  # rx enumcharlist negate=0 
+    ge rx79_pos, rx79_eos, rx79_fail
+    sub $I10, rx79_pos, rx79_off
+    substr $S10, rx79_tgt, $I10, 1
+    index $I11, unicode:"\t \x{a0}\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000", $S10
+    lt $I11, 0, rx79_fail
+    inc rx79_pos
+    (rx79_rep) = rx79_cur."!mark_commit"($I93)
+    rx79_cur."!mark_push"(rx79_rep, rx79_pos, $I93)
+    goto rxquantr92_loop
+  rxquantr92_done:
+  # rx literal  "#"
+    add $I11, rx79_pos, 1
+    gt $I11, rx79_eos, rx79_fail
+    sub $I11, rx79_pos, rx79_off
+    substr $S10, rx79_tgt, $I11, 1
+    ne $S10, "#", rx79_fail
+    add rx79_pos, 1
+  # rx charclass_q N r 0..-1
+    sub $I10, rx79_pos, rx79_off
+    find_cclass $I11, 4096, rx79_tgt, $I10, rx79_eos
+    add rx79_pos, rx79_off, $I11
+    goto alt83_end
+  alt83_2:
+.annotate "line", 46
+  # rx rxquantr94 ** 1..*
+    set_addr $I95, rxquantr94_done
+    rx79_cur."!mark_push"(0, -1, $I95)
+  rxquantr94_loop:
+  # rx enumcharlist negate=0 
+    ge rx79_pos, rx79_eos, rx79_fail
+    sub $I10, rx79_pos, rx79_off
+    substr $S10, rx79_tgt, $I10, 1
+    index $I11, unicode:"\t \x{a0}\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000", $S10
+    lt $I11, 0, rx79_fail
+    inc rx79_pos
+    (rx79_rep) = rx79_cur."!mark_commit"($I95)
+    rx79_cur."!mark_push"(rx79_rep, rx79_pos, $I95)
+    goto rxquantr94_loop
+  rxquantr94_done:
+  alt83_end:
+.annotate "line", 41
+  # rx pass
+    rx79_cur."!cursor_pass"(rx79_pos, "unv")
+    rx79_cur."!cursor_debug"("PASS  ", "unv", " at pos=", rx79_pos)
+    .return (rx79_cur)
+  rx79_fail:
+.annotate "line", 4
+    (rx79_rep, rx79_pos, $I10, $P10) = rx79_cur."!mark_fail"(0)
+    lt rx79_pos, -1, rx79_done
+    eq rx79_pos, -1, rx79_fail
+    jump $I10
+  rx79_done:
+    rx79_cur."!cursor_fail"()
+    rx79_cur."!cursor_debug"("FAIL  ", "unv")
+    .return (rx79_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__unv"  :subid("24_1261064023.05912") :method
+.annotate "line", 4
+    new $P81, "ResizablePMCArray"
+    push $P81, ""
+    push $P81, ""
+    push $P81, ""
+    .return ($P81)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "_block85"  :anon :subid("25_1261064023.05912") :method :outer("23_1261064023.05912")
+.annotate "line", 44
+    .local string rx87_tgt
+    .local int rx87_pos
+    .local int rx87_off
+    .local int rx87_eos
+    .local int rx87_rep
+    .local pmc rx87_cur
+    (rx87_cur, rx87_pos, rx87_tgt) = self."!cursor_start"()
+    rx87_cur."!cursor_debug"("START ", "")
+    .lex unicode:"$\x{a2}", rx87_cur
+    .local pmc match
+    .lex "$/", match
+    length rx87_eos, rx87_tgt
+    set rx87_off, 0
+    lt rx87_pos, 2, rx87_start
+    sub rx87_off, rx87_pos, 1
+    substr rx87_tgt, rx87_tgt, rx87_off
+  rx87_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan88_done
+    goto rxscan88_scan
+  rxscan88_loop:
+    ($P10) = rx87_cur."from"()
+    inc $P10
+    set rx87_pos, $P10
+    ge rx87_pos, rx87_eos, rxscan88_done
+  rxscan88_scan:
+    set_addr $I10, rxscan88_loop
+    rx87_cur."!mark_push"(0, rx87_pos, $I10)
+  rxscan88_done:
+  # rx rxquantr89 ** 0..*
+    set_addr $I90, rxquantr89_done
+    rx87_cur."!mark_push"(0, rx87_pos, $I90)
+  rxquantr89_loop:
+  # rx enumcharlist negate=0 
+    ge rx87_pos, rx87_eos, rx87_fail
+    sub $I10, rx87_pos, rx87_off
+    substr $S10, rx87_tgt, $I10, 1
+    index $I11, unicode:"\t \x{a0}\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000", $S10
+    lt $I11, 0, rx87_fail
+    inc rx87_pos
+    (rx87_rep) = rx87_cur."!mark_commit"($I90)
+    rx87_cur."!mark_push"(rx87_rep, rx87_pos, $I90)
+    goto rxquantr89_loop
+  rxquantr89_done:
+  # rx literal  "="
+    add $I11, rx87_pos, 1
+    gt $I11, rx87_eos, rx87_fail
+    sub $I11, rx87_pos, rx87_off
+    substr $S10, rx87_tgt, $I11, 1
+    ne $S10, "=", rx87_fail
+    add rx87_pos, 1
+  alt91_0:
+    set_addr $I10, alt91_1
+    rx87_cur."!mark_push"(0, rx87_pos, $I10)
+  # rx charclass w
+    ge rx87_pos, rx87_eos, rx87_fail
+    sub $I10, rx87_pos, rx87_off
+    is_cclass $I11, 8192, rx87_tgt, $I10
+    unless $I11, rx87_fail
+    inc rx87_pos
+    goto alt91_end
+  alt91_1:
+  # rx literal  "\\"
+    add $I11, rx87_pos, 1
+    gt $I11, rx87_eos, rx87_fail
+    sub $I11, rx87_pos, rx87_off
+    substr $S10, rx87_tgt, $I11, 1
+    ne $S10, "\\", rx87_fail
+    add rx87_pos, 1
+  alt91_end:
+  # rx pass
+    rx87_cur."!cursor_pass"(rx87_pos, "")
+    rx87_cur."!cursor_debug"("PASS  ", "", " at pos=", rx87_pos)
+    .return (rx87_cur)
+  rx87_fail:
+    (rx87_rep, rx87_pos, $I10, $P10) = rx87_cur."!mark_fail"(0)
+    lt rx87_pos, -1, rx87_done
+    eq rx87_pos, -1, rx87_fail
+    jump $I10
+  rx87_done:
+    rx87_cur."!cursor_fail"()
+    rx87_cur."!cursor_debug"("FAIL  ", "")
+    .return (rx87_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "pod_comment"  :subid("26_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .const 'Sub' $P131 = "28_1261064023.05912" 
+    capture_lex $P131
+    .local string rx97_tgt
+    .local int rx97_pos
+    .local int rx97_off
+    .local int rx97_eos
+    .local int rx97_rep
+    .local pmc rx97_cur
+    (rx97_cur, rx97_pos, rx97_tgt) = self."!cursor_start"()
+    rx97_cur."!cursor_debug"("START ", "pod_comment")
+    .lex unicode:"$\x{a2}", rx97_cur
+    .local pmc match
+    .lex "$/", match
+    length rx97_eos, rx97_tgt
+    set rx97_off, 0
+    lt rx97_pos, 2, rx97_start
+    sub rx97_off, rx97_pos, 1
+    substr rx97_tgt, rx97_tgt, rx97_off
+  rx97_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan100_done
+    goto rxscan100_scan
+  rxscan100_loop:
+    ($P10) = rx97_cur."from"()
+    inc $P10
+    set rx97_pos, $P10
+    ge rx97_pos, rx97_eos, rxscan100_done
+  rxscan100_scan:
+    set_addr $I10, rxscan100_loop
+    rx97_cur."!mark_push"(0, rx97_pos, $I10)
+  rxscan100_done:
+.annotate "line", 51
+  # rxanchor bol
+    eq rx97_pos, 0, rxanchor101_done
+    ge rx97_pos, rx97_eos, rx97_fail
+    sub $I10, rx97_pos, rx97_off
+    dec $I10
+    is_cclass $I11, 4096, rx97_tgt, $I10
+    unless $I11, rx97_fail
+  rxanchor101_done:
+  # rx rxquantr102 ** 0..*
+    set_addr $I103, rxquantr102_done
+    rx97_cur."!mark_push"(0, rx97_pos, $I103)
+  rxquantr102_loop:
+  # rx enumcharlist negate=0 
+    ge rx97_pos, rx97_eos, rx97_fail
+    sub $I10, rx97_pos, rx97_off
+    substr $S10, rx97_tgt, $I10, 1
+    index $I11, unicode:"\t \x{a0}\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000", $S10
+    lt $I11, 0, rx97_fail
+    inc rx97_pos
+    (rx97_rep) = rx97_cur."!mark_commit"($I103)
+    rx97_cur."!mark_push"(rx97_rep, rx97_pos, $I103)
+    goto rxquantr102_loop
+  rxquantr102_done:
+  # rx literal  "="
+    add $I11, rx97_pos, 1
+    gt $I11, rx97_eos, rx97_fail
+    sub $I11, rx97_pos, rx97_off
+    substr $S10, rx97_tgt, $I11, 1
+    ne $S10, "=", rx97_fail
+    add rx97_pos, 1
+  alt104_0:
+.annotate "line", 52
+    set_addr $I10, alt104_1
+    rx97_cur."!mark_push"(0, rx97_pos, $I10)
+.annotate "line", 53
+  # rx literal  "begin"
+    add $I11, rx97_pos, 5
+    gt $I11, rx97_eos, rx97_fail
+    sub $I11, rx97_pos, rx97_off
+    substr $S10, rx97_tgt, $I11, 5
+    ne $S10, "begin", rx97_fail
+    add rx97_pos, 5
+  # rx rxquantr105 ** 1..*
+    set_addr $I106, rxquantr105_done
+    rx97_cur."!mark_push"(0, -1, $I106)
+  rxquantr105_loop:
+  # rx enumcharlist negate=0 
+    ge rx97_pos, rx97_eos, rx97_fail
+    sub $I10, rx97_pos, rx97_off
+    substr $S10, rx97_tgt, $I10, 1
+    index $I11, unicode:"\t \x{a0}\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000", $S10
+    lt $I11, 0, rx97_fail
+    inc rx97_pos
+    (rx97_rep) = rx97_cur."!mark_commit"($I106)
+    rx97_cur."!mark_push"(rx97_rep, rx97_pos, $I106)
+    goto rxquantr105_loop
+  rxquantr105_done:
+  # rx literal  "END"
+    add $I11, rx97_pos, 3
+    gt $I11, rx97_eos, rx97_fail
+    sub $I11, rx97_pos, rx97_off
+    substr $S10, rx97_tgt, $I11, 3
+    ne $S10, "END", rx97_fail
+    add rx97_pos, 3
+  # rxanchor rwb
+    le rx97_pos, 0, rx97_fail
+    sub $I10, rx97_pos, rx97_off
+    is_cclass $I11, 8192, rx97_tgt, $I10
+    if $I11, rx97_fail
+    dec $I10
+    is_cclass $I11, 8192, rx97_tgt, $I10
+    unless $I11, rx97_fail
+  alt107_0:
+.annotate "line", 54
+    set_addr $I10, alt107_1
+    rx97_cur."!mark_push"(0, rx97_pos, $I10)
+  # rx rxquantf108 ** 0..*
+    set_addr $I10, rxquantf108_loop
+    rx97_cur."!mark_push"(0, rx97_pos, $I10)
+    goto rxquantf108_done
+  rxquantf108_loop:
+  # rx charclass .
+    ge rx97_pos, rx97_eos, rx97_fail
+    inc rx97_pos
+    set_addr $I10, rxquantf108_loop
+    rx97_cur."!mark_push"($I109, rx97_pos, $I10)
+  rxquantf108_done:
+  # rx charclass nl
+    ge rx97_pos, rx97_eos, rx97_fail
+    sub $I10, rx97_pos, rx97_off
+    is_cclass $I11, 4096, rx97_tgt, $I10
+    unless $I11, rx97_fail
+    substr $S10, rx97_tgt, $I10, 2
+    iseq $I11, $S10, "\r\n"
+    add rx97_pos, $I11
+    inc rx97_pos
+  # rx literal  "=end"
+    add $I11, rx97_pos, 4
+    gt $I11, rx97_eos, rx97_fail
+    sub $I11, rx97_pos, rx97_off
+    substr $S10, rx97_tgt, $I11, 4
+    ne $S10, "=end", rx97_fail
+    add rx97_pos, 4
+  # rx rxquantr110 ** 1..*
+    set_addr $I111, rxquantr110_done
+    rx97_cur."!mark_push"(0, -1, $I111)
+  rxquantr110_loop:
+  # rx enumcharlist negate=0 
+    ge rx97_pos, rx97_eos, rx97_fail
+    sub $I10, rx97_pos, rx97_off
+    substr $S10, rx97_tgt, $I10, 1
+    index $I11, unicode:"\t \x{a0}\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000", $S10
+    lt $I11, 0, rx97_fail
+    inc rx97_pos
+    (rx97_rep) = rx97_cur."!mark_commit"($I111)
+    rx97_cur."!mark_push"(rx97_rep, rx97_pos, $I111)
+    goto rxquantr110_loop
+  rxquantr110_done:
+  # rx literal  "END"
+    add $I11, rx97_pos, 3
+    gt $I11, rx97_eos, rx97_fail
+    sub $I11, rx97_pos, rx97_off
+    substr $S10, rx97_tgt, $I11, 3
+    ne $S10, "END", rx97_fail
+    add rx97_pos, 3
+  # rxanchor rwb
+    le rx97_pos, 0, rx97_fail
+    sub $I10, rx97_pos, rx97_off
+    is_cclass $I11, 8192, rx97_tgt, $I10
+    if $I11, rx97_fail
+    dec $I10
+    is_cclass $I11, 8192, rx97_tgt, $I10
+    unless $I11, rx97_fail
+  # rx charclass_q N r 0..-1
+    sub $I10, rx97_pos, rx97_off
+    find_cclass $I11, 4096, rx97_tgt, $I10, rx97_eos
+    add rx97_pos, rx97_off, $I11
+    goto alt107_end
+  alt107_1:
+  # rx charclass_q . r 0..-1
+    sub $I10, rx97_pos, rx97_off
+    find_not_cclass $I11, 65535, rx97_tgt, $I10, rx97_eos
+    add rx97_pos, rx97_off, $I11
+  alt107_end:
+.annotate "line", 53
+    goto alt104_end
+  alt104_1:
+    set_addr $I10, alt104_2
+    rx97_cur."!mark_push"(0, rx97_pos, $I10)
+.annotate "line", 55
+  # rx literal  "begin"
+    add $I11, rx97_pos, 5
+    gt $I11, rx97_eos, rx97_fail
+    sub $I11, rx97_pos, rx97_off
+    substr $S10, rx97_tgt, $I11, 5
+    ne $S10, "begin", rx97_fail
+    add rx97_pos, 5
+  # rx rxquantr112 ** 1..*
+    set_addr $I113, rxquantr112_done
+    rx97_cur."!mark_push"(0, -1, $I113)
+  rxquantr112_loop:
+  # rx enumcharlist negate=0 
+    ge rx97_pos, rx97_eos, rx97_fail
+    sub $I10, rx97_pos, rx97_off
+    substr $S10, rx97_tgt, $I10, 1
+    index $I11, unicode:"\t \x{a0}\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000", $S10
+    lt $I11, 0, rx97_fail
+    inc rx97_pos
+    (rx97_rep) = rx97_cur."!mark_commit"($I113)
+    rx97_cur."!mark_push"(rx97_rep, rx97_pos, $I113)
+    goto rxquantr112_loop
+  rxquantr112_done:
+  # rx subrule "identifier" subtype=capture negate=
+    rx97_cur."!cursor_pos"(rx97_pos)
+    $P10 = rx97_cur."identifier"()
+    unless $P10, rx97_fail
+    rx97_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("identifier")
+    rx97_pos = $P10."pos"()
+  alt114_0:
+.annotate "line", 56
+    set_addr $I10, alt114_1
+    rx97_cur."!mark_push"(0, rx97_pos, $I10)
+.annotate "line", 57
+  # rx rxquantf115 ** 0..*
+    set_addr $I10, rxquantf115_loop
+    rx97_cur."!mark_push"(0, rx97_pos, $I10)
+    goto rxquantf115_done
+  rxquantf115_loop:
+  # rx charclass .
+    ge rx97_pos, rx97_eos, rx97_fail
+    inc rx97_pos
+    set_addr $I10, rxquantf115_loop
+    rx97_cur."!mark_push"($I116, rx97_pos, $I10)
+  rxquantf115_done:
+  # rx charclass nl
+    ge rx97_pos, rx97_eos, rx97_fail
+    sub $I10, rx97_pos, rx97_off
+    is_cclass $I11, 4096, rx97_tgt, $I10
+    unless $I11, rx97_fail
+    substr $S10, rx97_tgt, $I10, 2
+    iseq $I11, $S10, "\r\n"
+    add rx97_pos, $I11
+    inc rx97_pos
+  # rx literal  "=end"
+    add $I11, rx97_pos, 4
+    gt $I11, rx97_eos, rx97_fail
+    sub $I11, rx97_pos, rx97_off
+    substr $S10, rx97_tgt, $I11, 4
+    ne $S10, "=end", rx97_fail
+    add rx97_pos, 4
+  # rx rxquantr117 ** 1..*
+    set_addr $I118, rxquantr117_done
+    rx97_cur."!mark_push"(0, -1, $I118)
+  rxquantr117_loop:
+  # rx enumcharlist negate=0 
+    ge rx97_pos, rx97_eos, rx97_fail
+    sub $I10, rx97_pos, rx97_off
+    substr $S10, rx97_tgt, $I10, 1
+    index $I11, unicode:"\t \x{a0}\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000", $S10
+    lt $I11, 0, rx97_fail
+    inc rx97_pos
+    (rx97_rep) = rx97_cur."!mark_commit"($I118)
+    rx97_cur."!mark_push"(rx97_rep, rx97_pos, $I118)
+    goto rxquantr117_loop
+  rxquantr117_done:
+  # rx subrule "!BACKREF" subtype=method negate=
+    rx97_cur."!cursor_pos"(rx97_pos)
+    $P10 = rx97_cur."!BACKREF"("identifier")
+    unless $P10, rx97_fail
+    rx97_pos = $P10."pos"()
+  # rxanchor rwb
+    le rx97_pos, 0, rx97_fail
+    sub $I10, rx97_pos, rx97_off
+    is_cclass $I11, 8192, rx97_tgt, $I10
+    if $I11, rx97_fail
+    dec $I10
+    is_cclass $I11, 8192, rx97_tgt, $I10
+    unless $I11, rx97_fail
+  # rx charclass_q N r 0..-1
+    sub $I10, rx97_pos, rx97_off
+    find_cclass $I11, 4096, rx97_tgt, $I10, rx97_eos
+    add rx97_pos, rx97_off, $I11
+    goto alt114_end
+  alt114_1:
+.annotate "line", 58
+  # rx subrule "panic" subtype=method negate=
+    rx97_cur."!cursor_pos"(rx97_pos)
+    $P10 = rx97_cur."panic"("=begin without matching =end")
+    unless $P10, rx97_fail
+    rx97_pos = $P10."pos"()
+  alt114_end:
+.annotate "line", 55
+    goto alt104_end
+  alt104_2:
+    set_addr $I10, alt104_3
+    rx97_cur."!mark_push"(0, rx97_pos, $I10)
+.annotate "line", 60
+  # rx literal  "begin"
+    add $I11, rx97_pos, 5
+    gt $I11, rx97_eos, rx97_fail
+    sub $I11, rx97_pos, rx97_off
+    substr $S10, rx97_tgt, $I11, 5
+    ne $S10, "begin", rx97_fail
+    add rx97_pos, 5
+  # rxanchor rwb
+    le rx97_pos, 0, rx97_fail
+    sub $I10, rx97_pos, rx97_off
+    is_cclass $I11, 8192, rx97_tgt, $I10
+    if $I11, rx97_fail
+    dec $I10
+    is_cclass $I11, 8192, rx97_tgt, $I10
+    unless $I11, rx97_fail
+  # rx rxquantr120 ** 0..*
+    set_addr $I121, rxquantr120_done
+    rx97_cur."!mark_push"(0, rx97_pos, $I121)
+  rxquantr120_loop:
+  # rx enumcharlist negate=0 
+    ge rx97_pos, rx97_eos, rx97_fail
+    sub $I10, rx97_pos, rx97_off
+    substr $S10, rx97_tgt, $I10, 1
+    index $I11, unicode:"\t \x{a0}\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000", $S10
+    lt $I11, 0, rx97_fail
+    inc rx97_pos
+    (rx97_rep) = rx97_cur."!mark_commit"($I121)
+    rx97_cur."!mark_push"(rx97_rep, rx97_pos, $I121)
+    goto rxquantr120_loop
+  rxquantr120_done:
+  alt122_0:
+.annotate "line", 61
+    set_addr $I10, alt122_1
+    rx97_cur."!mark_push"(0, rx97_pos, $I10)
+  # rxanchor eol
+    sub $I10, rx97_pos, rx97_off
+    is_cclass $I11, 4096, rx97_tgt, $I10
+    if $I11, rxanchor123_done
+    ne rx97_pos, rx97_eos, rx97_fail
+    eq rx97_pos, 0, rxanchor123_done
+    dec $I10
+    is_cclass $I11, 4096, rx97_tgt, $I10
+    if $I11, rx97_fail
+  rxanchor123_done:
+    goto alt122_end
+  alt122_1:
+    set_addr $I10, alt122_2
+    rx97_cur."!mark_push"(0, rx97_pos, $I10)
+  # rx literal  "#"
+    add $I11, rx97_pos, 1
+    gt $I11, rx97_eos, rx97_fail
+    sub $I11, rx97_pos, rx97_off
+    substr $S10, rx97_tgt, $I11, 1
+    ne $S10, "#", rx97_fail
+    add rx97_pos, 1
+    goto alt122_end
+  alt122_2:
+  # rx subrule "panic" subtype=method negate=
+    rx97_cur."!cursor_pos"(rx97_pos)
+    $P10 = rx97_cur."panic"("Unrecognized token after =begin")
+    unless $P10, rx97_fail
+    rx97_pos = $P10."pos"()
+  alt122_end:
+  alt124_0:
+.annotate "line", 62
+    set_addr $I10, alt124_1
+    rx97_cur."!mark_push"(0, rx97_pos, $I10)
+.annotate "line", 63
+  # rx rxquantf125 ** 0..*
+    set_addr $I10, rxquantf125_loop
+    rx97_cur."!mark_push"(0, rx97_pos, $I10)
+    goto rxquantf125_done
+  rxquantf125_loop:
+  # rx charclass .
+    ge rx97_pos, rx97_eos, rx97_fail
+    inc rx97_pos
+    set_addr $I10, rxquantf125_loop
+    rx97_cur."!mark_push"($I126, rx97_pos, $I10)
+  rxquantf125_done:
+  # rx charclass nl
+    ge rx97_pos, rx97_eos, rx97_fail
+    sub $I10, rx97_pos, rx97_off
+    is_cclass $I11, 4096, rx97_tgt, $I10
+    unless $I11, rx97_fail
+    substr $S10, rx97_tgt, $I10, 2
+    iseq $I11, $S10, "\r\n"
+    add rx97_pos, $I11
+    inc rx97_pos
+  # rx rxquantr127 ** 0..*
+    set_addr $I128, rxquantr127_done
+    rx97_cur."!mark_push"(0, rx97_pos, $I128)
+  rxquantr127_loop:
+  # rx enumcharlist negate=0 
+    ge rx97_pos, rx97_eos, rx97_fail
+    sub $I10, rx97_pos, rx97_off
+    substr $S10, rx97_tgt, $I10, 1
+    index $I11, unicode:"\t \x{a0}\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000", $S10
+    lt $I11, 0, rx97_fail
+    inc rx97_pos
+    (rx97_rep) = rx97_cur."!mark_commit"($I128)
+    rx97_cur."!mark_push"(rx97_rep, rx97_pos, $I128)
+    goto rxquantr127_loop
+  rxquantr127_done:
+  # rx literal  "=end"
+    add $I11, rx97_pos, 4
+    gt $I11, rx97_eos, rx97_fail
+    sub $I11, rx97_pos, rx97_off
+    substr $S10, rx97_tgt, $I11, 4
+    ne $S10, "=end", rx97_fail
+    add rx97_pos, 4
+  # rxanchor rwb
+    le rx97_pos, 0, rx97_fail
+    sub $I10, rx97_pos, rx97_off
+    is_cclass $I11, 8192, rx97_tgt, $I10
+    if $I11, rx97_fail
+    dec $I10
+    is_cclass $I11, 8192, rx97_tgt, $I10
+    unless $I11, rx97_fail
+  # rx charclass_q N r 0..-1
+    sub $I10, rx97_pos, rx97_off
+    find_cclass $I11, 4096, rx97_tgt, $I10, rx97_eos
+    add rx97_pos, rx97_off, $I11
+    goto alt124_end
+  alt124_1:
+.annotate "line", 64
+  # rx subrule "panic" subtype=method negate=
+    rx97_cur."!cursor_pos"(rx97_pos)
+    $P10 = rx97_cur."panic"("=begin without matching =end")
+    unless $P10, rx97_fail
+    rx97_pos = $P10."pos"()
+  alt124_end:
+.annotate "line", 60
+    goto alt104_end
+  alt104_3:
+.annotate "line", 68
+  # rx rxquantr129 ** 0..1
+    set_addr $I137, rxquantr129_done
+    rx97_cur."!mark_push"(0, rx97_pos, $I137)
+  rxquantr129_loop:
+.annotate "line", 67
+  # rx subrule "before" subtype=zerowidth negate=
+    rx97_cur."!cursor_pos"(rx97_pos)
+    .const 'Sub' $P131 = "28_1261064023.05912" 
+    capture_lex $P131
+    $P10 = rx97_cur."before"($P131)
+    unless $P10, rx97_fail
+.annotate "line", 68
+  # rx subrule "panic" subtype=method negate=
+    rx97_cur."!cursor_pos"(rx97_pos)
+    $P10 = rx97_cur."panic"("Obsolete pod format, please use =begin/=end instead")
+    unless $P10, rx97_fail
+    rx97_pos = $P10."pos"()
+    (rx97_rep) = rx97_cur."!mark_commit"($I137)
+  rxquantr129_done:
+  alt138_0:
+.annotate "line", 69
+    set_addr $I10, alt138_1
+    rx97_cur."!mark_push"(0, rx97_pos, $I10)
+  # rx subrule "alpha" subtype=capture negate=
+    rx97_cur."!cursor_pos"(rx97_pos)
+    $P10 = rx97_cur."alpha"()
+    unless $P10, rx97_fail
+    rx97_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("alpha")
+    rx97_pos = $P10."pos"()
+    goto alt138_end
+  alt138_1:
+    set_addr $I10, alt138_2
+    rx97_cur."!mark_push"(0, rx97_pos, $I10)
+  # rx charclass s
+    ge rx97_pos, rx97_eos, rx97_fail
+    sub $I10, rx97_pos, rx97_off
+    is_cclass $I11, 32, rx97_tgt, $I10
+    unless $I11, rx97_fail
+    inc rx97_pos
+    goto alt138_end
+  alt138_2:
+  # rx subrule "panic" subtype=method negate=
+    rx97_cur."!cursor_pos"(rx97_pos)
+    $P10 = rx97_cur."panic"("Illegal pod directive")
+    unless $P10, rx97_fail
+    rx97_pos = $P10."pos"()
+  alt138_end:
+.annotate "line", 70
+  # rx charclass_q N r 0..-1
+    sub $I10, rx97_pos, rx97_off
+    find_cclass $I11, 4096, rx97_tgt, $I10, rx97_eos
+    add rx97_pos, rx97_off, $I11
+  alt104_end:
+.annotate "line", 50
+  # rx pass
+    rx97_cur."!cursor_pass"(rx97_pos, "pod_comment")
+    rx97_cur."!cursor_debug"("PASS  ", "pod_comment", " at pos=", rx97_pos)
+    .return (rx97_cur)
+  rx97_fail:
+.annotate "line", 4
+    (rx97_rep, rx97_pos, $I10, $P10) = rx97_cur."!mark_fail"(0)
+    lt rx97_pos, -1, rx97_done
+    eq rx97_pos, -1, rx97_fail
+    jump $I10
+  rx97_done:
+    rx97_cur."!cursor_fail"()
+    rx97_cur."!cursor_debug"("FAIL  ", "pod_comment")
+    .return (rx97_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__pod_comment"  :subid("27_1261064023.05912") :method
+.annotate "line", 4
+    new $P99, "ResizablePMCArray"
+    push $P99, ""
+    .return ($P99)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "_block130"  :anon :subid("28_1261064023.05912") :method :outer("26_1261064023.05912")
+.annotate "line", 67
+    .local string rx132_tgt
+    .local int rx132_pos
+    .local int rx132_off
+    .local int rx132_eos
+    .local int rx132_rep
+    .local pmc rx132_cur
+    (rx132_cur, rx132_pos, rx132_tgt) = self."!cursor_start"()
+    rx132_cur."!cursor_debug"("START ", "")
+    .lex unicode:"$\x{a2}", rx132_cur
+    .local pmc match
+    .lex "$/", match
+    length rx132_eos, rx132_tgt
+    set rx132_off, 0
+    lt rx132_pos, 2, rx132_start
+    sub rx132_off, rx132_pos, 1
+    substr rx132_tgt, rx132_tgt, rx132_off
+  rx132_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan133_done
+    goto rxscan133_scan
+  rxscan133_loop:
+    ($P10) = rx132_cur."from"()
+    inc $P10
+    set rx132_pos, $P10
+    ge rx132_pos, rx132_eos, rxscan133_done
+  rxscan133_scan:
+    set_addr $I10, rxscan133_loop
+    rx132_cur."!mark_push"(0, rx132_pos, $I10)
+  rxscan133_done:
+  # rx rxquantf134 ** 0..*
+    set_addr $I10, rxquantf134_loop
+    rx132_cur."!mark_push"(0, rx132_pos, $I10)
+    goto rxquantf134_done
+  rxquantf134_loop:
+  # rx charclass .
+    ge rx132_pos, rx132_eos, rx132_fail
+    inc rx132_pos
+    set_addr $I10, rxquantf134_loop
+    rx132_cur."!mark_push"($I135, rx132_pos, $I10)
+  rxquantf134_done:
+  # rxanchor bol
+    eq rx132_pos, 0, rxanchor136_done
+    ge rx132_pos, rx132_eos, rx132_fail
+    sub $I10, rx132_pos, rx132_off
+    dec $I10
+    is_cclass $I11, 4096, rx132_tgt, $I10
+    unless $I11, rx132_fail
+  rxanchor136_done:
+  # rx literal  "=cut"
+    add $I11, rx132_pos, 4
+    gt $I11, rx132_eos, rx132_fail
+    sub $I11, rx132_pos, rx132_off
+    substr $S10, rx132_tgt, $I11, 4
+    ne $S10, "=cut", rx132_fail
+    add rx132_pos, 4
+  # rxanchor rwb
+    le rx132_pos, 0, rx132_fail
+    sub $I10, rx132_pos, rx132_off
+    is_cclass $I11, 8192, rx132_tgt, $I10
+    if $I11, rx132_fail
+    dec $I10
+    is_cclass $I11, 8192, rx132_tgt, $I10
+    unless $I11, rx132_fail
+  # rx pass
+    rx132_cur."!cursor_pass"(rx132_pos, "")
+    rx132_cur."!cursor_debug"("PASS  ", "", " at pos=", rx132_pos)
+    .return (rx132_cur)
+  rx132_fail:
+    (rx132_rep, rx132_pos, $I10, $P10) = rx132_cur."!mark_fail"(0)
+    lt rx132_pos, -1, rx132_done
+    eq rx132_pos, -1, rx132_fail
+    jump $I10
+  rx132_done:
+    rx132_cur."!cursor_fail"()
+    rx132_cur."!cursor_debug"("FAIL  ", "")
+    .return (rx132_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "comp_unit"  :subid("29_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx140_tgt
+    .local int rx140_pos
+    .local int rx140_off
+    .local int rx140_eos
+    .local int rx140_rep
+    .local pmc rx140_cur
+    (rx140_cur, rx140_pos, rx140_tgt) = self."!cursor_start"()
+    rx140_cur."!cursor_debug"("START ", "comp_unit")
+    .lex unicode:"$\x{a2}", rx140_cur
+    .local pmc match
+    .lex "$/", match
+    length rx140_eos, rx140_tgt
+    set rx140_off, 0
+    lt rx140_pos, 2, rx140_start
+    sub rx140_off, rx140_pos, 1
+    substr rx140_tgt, rx140_tgt, rx140_off
+  rx140_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan144_done
+    goto rxscan144_scan
+  rxscan144_loop:
+    ($P10) = rx140_cur."from"()
+    inc $P10
+    set rx140_pos, $P10
+    ge rx140_pos, rx140_eos, rxscan144_done
+  rxscan144_scan:
+    set_addr $I10, rxscan144_loop
+    rx140_cur."!mark_push"(0, rx140_pos, $I10)
+  rxscan144_done:
+.annotate "line", 78
+  # rx subrule "newpad" subtype=method negate=
+    rx140_cur."!cursor_pos"(rx140_pos)
+    $P10 = rx140_cur."newpad"()
+    unless $P10, rx140_fail
+    rx140_pos = $P10."pos"()
+.annotate "line", 79
+  # rx subrule "statementlist" subtype=capture negate=
+    rx140_cur."!cursor_pos"(rx140_pos)
+    $P10 = rx140_cur."statementlist"()
+    unless $P10, rx140_fail
+    rx140_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("statementlist")
+    rx140_pos = $P10."pos"()
+  alt145_0:
+.annotate "line", 80
+    set_addr $I10, alt145_1
+    rx140_cur."!mark_push"(0, rx140_pos, $I10)
+  # rxanchor eos
+    ne rx140_pos, rx140_eos, rx140_fail
+    goto alt145_end
+  alt145_1:
+  # rx subrule "panic" subtype=method negate=
+    rx140_cur."!cursor_pos"(rx140_pos)
+    $P10 = rx140_cur."panic"("Confused")
+    unless $P10, rx140_fail
+    rx140_pos = $P10."pos"()
+  alt145_end:
+.annotate "line", 77
+  # rx pass
+    rx140_cur."!cursor_pass"(rx140_pos, "comp_unit")
+    rx140_cur."!cursor_debug"("PASS  ", "comp_unit", " at pos=", rx140_pos)
+    .return (rx140_cur)
+  rx140_fail:
+.annotate "line", 4
+    (rx140_rep, rx140_pos, $I10, $P10) = rx140_cur."!mark_fail"(0)
+    lt rx140_pos, -1, rx140_done
+    eq rx140_pos, -1, rx140_fail
+    jump $I10
+  rx140_done:
+    rx140_cur."!cursor_fail"()
+    rx140_cur."!cursor_debug"("FAIL  ", "comp_unit")
+    .return (rx140_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__comp_unit"  :subid("30_1261064023.05912") :method
+.annotate "line", 4
+    $P142 = self."!PREFIX__!subrule"("", "")
+    new $P143, "ResizablePMCArray"
+    push $P143, $P142
+    .return ($P143)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "statementlist"  :subid("31_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx147_tgt
+    .local int rx147_pos
+    .local int rx147_off
+    .local int rx147_eos
+    .local int rx147_rep
+    .local pmc rx147_cur
+    (rx147_cur, rx147_pos, rx147_tgt) = self."!cursor_start"()
+    rx147_cur."!cursor_debug"("START ", "statementlist")
+    rx147_cur."!cursor_caparray"("statement")
+    .lex unicode:"$\x{a2}", rx147_cur
+    .local pmc match
+    .lex "$/", match
+    length rx147_eos, rx147_tgt
+    set rx147_off, 0
+    lt rx147_pos, 2, rx147_start
+    sub rx147_off, rx147_pos, 1
+    substr rx147_tgt, rx147_tgt, rx147_off
+  rx147_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan150_done
+    goto rxscan150_scan
+  rxscan150_loop:
+    ($P10) = rx147_cur."from"()
+    inc $P10
+    set rx147_pos, $P10
+    ge rx147_pos, rx147_eos, rxscan150_done
+  rxscan150_scan:
+    set_addr $I10, rxscan150_loop
+    rx147_cur."!mark_push"(0, rx147_pos, $I10)
+  rxscan150_done:
+  alt151_0:
+.annotate "line", 83
+    set_addr $I10, alt151_1
+    rx147_cur."!mark_push"(0, rx147_pos, $I10)
+.annotate "line", 84
+  # rx subrule "ws" subtype=method negate=
+    rx147_cur."!cursor_pos"(rx147_pos)
+    $P10 = rx147_cur."ws"()
+    unless $P10, rx147_fail
+    rx147_pos = $P10."pos"()
+  # rxanchor eos
+    ne rx147_pos, rx147_eos, rx147_fail
+  # rx subrule "ws" subtype=method negate=
+    rx147_cur."!cursor_pos"(rx147_pos)
+    $P10 = rx147_cur."ws"()
+    unless $P10, rx147_fail
+    rx147_pos = $P10."pos"()
+    goto alt151_end
+  alt151_1:
+.annotate "line", 85
+  # rx subrule "ws" subtype=method negate=
+    rx147_cur."!cursor_pos"(rx147_pos)
+    $P10 = rx147_cur."ws"()
+    unless $P10, rx147_fail
+    rx147_pos = $P10."pos"()
+  # rx rxquantr155 ** 0..*
+    set_addr $I157, rxquantr155_done
+    rx147_cur."!mark_push"(0, rx147_pos, $I157)
+  rxquantr155_loop:
+  # rx subrule "statement" subtype=capture negate=
+    rx147_cur."!cursor_pos"(rx147_pos)
+    $P10 = rx147_cur."statement"()
+    unless $P10, rx147_fail
+    rx147_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("statement")
+    rx147_pos = $P10."pos"()
+  # rx subrule "eat_terminator" subtype=method negate=
+    rx147_cur."!cursor_pos"(rx147_pos)
+    $P10 = rx147_cur."eat_terminator"()
+    unless $P10, rx147_fail
+    rx147_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx147_cur."!cursor_pos"(rx147_pos)
+    $P10 = rx147_cur."ws"()
+    unless $P10, rx147_fail
+    rx147_pos = $P10."pos"()
+    (rx147_rep) = rx147_cur."!mark_commit"($I157)
+    rx147_cur."!mark_push"(rx147_rep, rx147_pos, $I157)
+    goto rxquantr155_loop
+  rxquantr155_done:
+  # rx subrule "ws" subtype=method negate=
+    rx147_cur."!cursor_pos"(rx147_pos)
+    $P10 = rx147_cur."ws"()
+    unless $P10, rx147_fail
+    rx147_pos = $P10."pos"()
+  alt151_end:
+.annotate "line", 83
+  # rx pass
+    rx147_cur."!cursor_pass"(rx147_pos, "statementlist")
+    rx147_cur."!cursor_debug"("PASS  ", "statementlist", " at pos=", rx147_pos)
+    .return (rx147_cur)
+  rx147_fail:
+.annotate "line", 4
+    (rx147_rep, rx147_pos, $I10, $P10) = rx147_cur."!mark_fail"(0)
+    lt rx147_pos, -1, rx147_done
+    eq rx147_pos, -1, rx147_fail
+    jump $I10
+  rx147_done:
+    rx147_cur."!cursor_fail"()
+    rx147_cur."!cursor_debug"("FAIL  ", "statementlist")
+    .return (rx147_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__statementlist"  :subid("32_1261064023.05912") :method
+.annotate "line", 4
+    new $P149, "ResizablePMCArray"
+    push $P149, ""
+    push $P149, ""
+    .return ($P149)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "statement"  :subid("33_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .const 'Sub' $P165 = "35_1261064023.05912" 
+    capture_lex $P165
+    .local string rx160_tgt
+    .local int rx160_pos
+    .local int rx160_off
+    .local int rx160_eos
+    .local int rx160_rep
+    .local pmc rx160_cur
+    (rx160_cur, rx160_pos, rx160_tgt) = self."!cursor_start"()
+    rx160_cur."!cursor_debug"("START ", "statement")
+    rx160_cur."!cursor_caparray"("statement_mod_loop", "statement_mod_cond")
+    .lex unicode:"$\x{a2}", rx160_cur
+    .local pmc match
+    .lex "$/", match
+    length rx160_eos, rx160_tgt
+    set rx160_off, 0
+    lt rx160_pos, 2, rx160_start
+    sub rx160_off, rx160_pos, 1
+    substr rx160_tgt, rx160_tgt, rx160_off
+  rx160_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan163_done
+    goto rxscan163_scan
+  rxscan163_loop:
+    ($P10) = rx160_cur."from"()
+    inc $P10
+    set rx160_pos, $P10
+    ge rx160_pos, rx160_eos, rxscan163_done
+  rxscan163_scan:
+    set_addr $I10, rxscan163_loop
+    rx160_cur."!mark_push"(0, rx160_pos, $I10)
+  rxscan163_done:
+.annotate "line", 89
+  # rx subrule "before" subtype=zerowidth negate=1
+    rx160_cur."!cursor_pos"(rx160_pos)
+    .const 'Sub' $P165 = "35_1261064023.05912" 
+    capture_lex $P165
+    $P10 = rx160_cur."before"($P165)
+    if $P10, rx160_fail
+  alt169_0:
+.annotate "line", 90
+    set_addr $I10, alt169_1
+    rx160_cur."!mark_push"(0, rx160_pos, $I10)
+.annotate "line", 91
+  # rx subrule "statement_control" subtype=capture negate=
+    rx160_cur."!cursor_pos"(rx160_pos)
+    $P10 = rx160_cur."statement_control"()
+    unless $P10, rx160_fail
+    rx160_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("statement_control")
+    rx160_pos = $P10."pos"()
+    goto alt169_end
+  alt169_1:
+.annotate "line", 92
+  # rx subrule "EXPR" subtype=capture negate=
+    rx160_cur."!cursor_pos"(rx160_pos)
+    $P10 = rx160_cur."EXPR"()
+    unless $P10, rx160_fail
+    rx160_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("EXPR")
+    rx160_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx160_cur."!cursor_pos"(rx160_pos)
+    $P10 = rx160_cur."ws"()
+    unless $P10, rx160_fail
+    rx160_pos = $P10."pos"()
+.annotate "line", 96
+  # rx rxquantr170 ** 0..1
+    set_addr $I174, rxquantr170_done
+    rx160_cur."!mark_push"(0, rx160_pos, $I174)
+  rxquantr170_loop:
+  alt171_0:
+.annotate "line", 93
+    set_addr $I10, alt171_1
+    rx160_cur."!mark_push"(0, rx160_pos, $I10)
+.annotate "line", 94
+  # rx subrule "statement_mod_cond" subtype=capture negate=
+    rx160_cur."!cursor_pos"(rx160_pos)
+    $P10 = rx160_cur."statement_mod_cond"()
+    unless $P10, rx160_fail
+    rx160_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("statement_mod_cond")
+    rx160_pos = $P10."pos"()
+  # rx rxquantr172 ** 0..1
+    set_addr $I173, rxquantr172_done
+    rx160_cur."!mark_push"(0, rx160_pos, $I173)
+  rxquantr172_loop:
+  # rx subrule "statement_mod_loop" subtype=capture negate=
+    rx160_cur."!cursor_pos"(rx160_pos)
+    $P10 = rx160_cur."statement_mod_loop"()
+    unless $P10, rx160_fail
+    rx160_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("statement_mod_loop")
+    rx160_pos = $P10."pos"()
+    (rx160_rep) = rx160_cur."!mark_commit"($I173)
+  rxquantr172_done:
+    goto alt171_end
+  alt171_1:
+.annotate "line", 95
+  # rx subrule "statement_mod_loop" subtype=capture negate=
+    rx160_cur."!cursor_pos"(rx160_pos)
+    $P10 = rx160_cur."statement_mod_loop"()
+    unless $P10, rx160_fail
+    rx160_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("statement_mod_loop")
+    rx160_pos = $P10."pos"()
+  alt171_end:
+.annotate "line", 96
+    (rx160_rep) = rx160_cur."!mark_commit"($I174)
+  rxquantr170_done:
+  alt169_end:
+.annotate "line", 88
+  # rx pass
+    rx160_cur."!cursor_pass"(rx160_pos, "statement")
+    rx160_cur."!cursor_debug"("PASS  ", "statement", " at pos=", rx160_pos)
+    .return (rx160_cur)
+  rx160_fail:
+.annotate "line", 4
+    (rx160_rep, rx160_pos, $I10, $P10) = rx160_cur."!mark_fail"(0)
+    lt rx160_pos, -1, rx160_done
+    eq rx160_pos, -1, rx160_fail
+    jump $I10
+  rx160_done:
+    rx160_cur."!cursor_fail"()
+    rx160_cur."!cursor_debug"("FAIL  ", "statement")
+    .return (rx160_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__statement"  :subid("34_1261064023.05912") :method
+.annotate "line", 4
+    new $P162, "ResizablePMCArray"
+    push $P162, ""
+    .return ($P162)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "_block164"  :anon :subid("35_1261064023.05912") :method :outer("33_1261064023.05912")
+.annotate "line", 89
+    .local string rx166_tgt
+    .local int rx166_pos
+    .local int rx166_off
+    .local int rx166_eos
+    .local int rx166_rep
+    .local pmc rx166_cur
+    (rx166_cur, rx166_pos, rx166_tgt) = self."!cursor_start"()
+    rx166_cur."!cursor_debug"("START ", "")
+    .lex unicode:"$\x{a2}", rx166_cur
+    .local pmc match
+    .lex "$/", match
+    length rx166_eos, rx166_tgt
+    set rx166_off, 0
+    lt rx166_pos, 2, rx166_start
+    sub rx166_off, rx166_pos, 1
+    substr rx166_tgt, rx166_tgt, rx166_off
+  rx166_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan167_done
+    goto rxscan167_scan
+  rxscan167_loop:
+    ($P10) = rx166_cur."from"()
+    inc $P10
+    set rx166_pos, $P10
+    ge rx166_pos, rx166_eos, rxscan167_done
+  rxscan167_scan:
+    set_addr $I10, rxscan167_loop
+    rx166_cur."!mark_push"(0, rx166_pos, $I10)
+  rxscan167_done:
+  alt168_0:
+    set_addr $I10, alt168_1
+    rx166_cur."!mark_push"(0, rx166_pos, $I10)
+  # rx enumcharlist negate=0 
+    ge rx166_pos, rx166_eos, rx166_fail
+    sub $I10, rx166_pos, rx166_off
+    substr $S10, rx166_tgt, $I10, 1
+    index $I11, "])}", $S10
+    lt $I11, 0, rx166_fail
+    inc rx166_pos
+    goto alt168_end
+  alt168_1:
+  # rxanchor eos
+    ne rx166_pos, rx166_eos, rx166_fail
+  alt168_end:
+  # rx pass
+    rx166_cur."!cursor_pass"(rx166_pos, "")
+    rx166_cur."!cursor_debug"("PASS  ", "", " at pos=", rx166_pos)
+    .return (rx166_cur)
+  rx166_fail:
+    (rx166_rep, rx166_pos, $I10, $P10) = rx166_cur."!mark_fail"(0)
+    lt rx166_pos, -1, rx166_done
+    eq rx166_pos, -1, rx166_fail
+    jump $I10
+  rx166_done:
+    rx166_cur."!cursor_fail"()
+    rx166_cur."!cursor_debug"("FAIL  ", "")
+    .return (rx166_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "eat_terminator"  :subid("36_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx176_tgt
+    .local int rx176_pos
+    .local int rx176_off
+    .local int rx176_eos
+    .local int rx176_rep
+    .local pmc rx176_cur
+    (rx176_cur, rx176_pos, rx176_tgt) = self."!cursor_start"()
+    rx176_cur."!cursor_debug"("START ", "eat_terminator")
+    .lex unicode:"$\x{a2}", rx176_cur
+    .local pmc match
+    .lex "$/", match
+    length rx176_eos, rx176_tgt
+    set rx176_off, 0
+    lt rx176_pos, 2, rx176_start
+    sub rx176_off, rx176_pos, 1
+    substr rx176_tgt, rx176_tgt, rx176_off
+  rx176_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan179_done
+    goto rxscan179_scan
+  rxscan179_loop:
+    ($P10) = rx176_cur."from"()
+    inc $P10
+    set rx176_pos, $P10
+    ge rx176_pos, rx176_eos, rxscan179_done
+  rxscan179_scan:
+    set_addr $I10, rxscan179_loop
+    rx176_cur."!mark_push"(0, rx176_pos, $I10)
+  rxscan179_done:
+  alt180_0:
+.annotate "line", 100
+    set_addr $I10, alt180_1
+    rx176_cur."!mark_push"(0, rx176_pos, $I10)
+.annotate "line", 101
+  # rx literal  ";"
+    add $I11, rx176_pos, 1
+    gt $I11, rx176_eos, rx176_fail
+    sub $I11, rx176_pos, rx176_off
+    substr $S10, rx176_tgt, $I11, 1
+    ne $S10, ";", rx176_fail
+    add rx176_pos, 1
+    goto alt180_end
+  alt180_1:
+    set_addr $I10, alt180_2
+    rx176_cur."!mark_push"(0, rx176_pos, $I10)
+.annotate "line", 102
+  # rx subrule "MARKED" subtype=zerowidth negate=
+    rx176_cur."!cursor_pos"(rx176_pos)
+    $P10 = rx176_cur."MARKED"("endstmt")
+    unless $P10, rx176_fail
+    goto alt180_end
+  alt180_2:
+    set_addr $I10, alt180_3
+    rx176_cur."!mark_push"(0, rx176_pos, $I10)
+.annotate "line", 103
+  # rx subrule "terminator" subtype=zerowidth negate=
+    rx176_cur."!cursor_pos"(rx176_pos)
+    $P10 = rx176_cur."terminator"()
+    unless $P10, rx176_fail
+    goto alt180_end
+  alt180_3:
+.annotate "line", 104
+  # rxanchor eos
+    ne rx176_pos, rx176_eos, rx176_fail
+  alt180_end:
+.annotate "line", 100
+  # rx pass
+    rx176_cur."!cursor_pass"(rx176_pos, "eat_terminator")
+    rx176_cur."!cursor_debug"("PASS  ", "eat_terminator", " at pos=", rx176_pos)
+    .return (rx176_cur)
+  rx176_fail:
+.annotate "line", 4
+    (rx176_rep, rx176_pos, $I10, $P10) = rx176_cur."!mark_fail"(0)
+    lt rx176_pos, -1, rx176_done
+    eq rx176_pos, -1, rx176_fail
+    jump $I10
+  rx176_done:
+    rx176_cur."!cursor_fail"()
+    rx176_cur."!cursor_debug"("FAIL  ", "eat_terminator")
+    .return (rx176_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__eat_terminator"  :subid("37_1261064023.05912") :method
+.annotate "line", 4
+    new $P178, "ResizablePMCArray"
+    push $P178, ""
+    push $P178, ""
+    push $P178, ""
+    push $P178, ";"
+    .return ($P178)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "xblock"  :subid("38_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx182_tgt
+    .local int rx182_pos
+    .local int rx182_off
+    .local int rx182_eos
+    .local int rx182_rep
+    .local pmc rx182_cur
+    (rx182_cur, rx182_pos, rx182_tgt) = self."!cursor_start"()
+    rx182_cur."!cursor_debug"("START ", "xblock")
+    .lex unicode:"$\x{a2}", rx182_cur
+    .local pmc match
+    .lex "$/", match
+    length rx182_eos, rx182_tgt
+    set rx182_off, 0
+    lt rx182_pos, 2, rx182_start
+    sub rx182_off, rx182_pos, 1
+    substr rx182_tgt, rx182_tgt, rx182_off
+  rx182_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan186_done
+    goto rxscan186_scan
+  rxscan186_loop:
+    ($P10) = rx182_cur."from"()
+    inc $P10
+    set rx182_pos, $P10
+    ge rx182_pos, rx182_eos, rxscan186_done
+  rxscan186_scan:
+    set_addr $I10, rxscan186_loop
+    rx182_cur."!mark_push"(0, rx182_pos, $I10)
+  rxscan186_done:
+.annotate "line", 108
+  # rx subrule "EXPR" subtype=capture negate=
+    rx182_cur."!cursor_pos"(rx182_pos)
+    $P10 = rx182_cur."EXPR"()
+    unless $P10, rx182_fail
+    rx182_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("EXPR")
+    rx182_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx182_cur."!cursor_pos"(rx182_pos)
+    $P10 = rx182_cur."ws"()
+    unless $P10, rx182_fail
+    rx182_pos = $P10."pos"()
+  # rx subrule "pblock" subtype=capture negate=
+    rx182_cur."!cursor_pos"(rx182_pos)
+    $P10 = rx182_cur."pblock"()
+    unless $P10, rx182_fail
+    rx182_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("pblock")
+    rx182_pos = $P10."pos"()
+.annotate "line", 107
+  # rx pass
+    rx182_cur."!cursor_pass"(rx182_pos, "xblock")
+    rx182_cur."!cursor_debug"("PASS  ", "xblock", " at pos=", rx182_pos)
+    .return (rx182_cur)
+  rx182_fail:
+.annotate "line", 4
+    (rx182_rep, rx182_pos, $I10, $P10) = rx182_cur."!mark_fail"(0)
+    lt rx182_pos, -1, rx182_done
+    eq rx182_pos, -1, rx182_fail
+    jump $I10
+  rx182_done:
+    rx182_cur."!cursor_fail"()
+    rx182_cur."!cursor_debug"("FAIL  ", "xblock")
+    .return (rx182_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__xblock"  :subid("39_1261064023.05912") :method
+.annotate "line", 4
+    $P184 = self."!PREFIX__!subrule"("EXPR", "")
+    new $P185, "ResizablePMCArray"
+    push $P185, $P184
+    .return ($P185)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "pblock"  :subid("40_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx188_tgt
+    .local int rx188_pos
+    .local int rx188_off
+    .local int rx188_eos
+    .local int rx188_rep
+    .local pmc rx188_cur
+    (rx188_cur, rx188_pos, rx188_tgt) = self."!cursor_start"()
+    rx188_cur."!cursor_debug"("START ", "pblock")
+    .lex unicode:"$\x{a2}", rx188_cur
+    .local pmc match
+    .lex "$/", match
+    length rx188_eos, rx188_tgt
+    set rx188_off, 0
+    lt rx188_pos, 2, rx188_start
+    sub rx188_off, rx188_pos, 1
+    substr rx188_tgt, rx188_tgt, rx188_off
+  rx188_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan193_done
+    goto rxscan193_scan
+  rxscan193_loop:
+    ($P10) = rx188_cur."from"()
+    inc $P10
+    set rx188_pos, $P10
+    ge rx188_pos, rx188_eos, rxscan193_done
+  rxscan193_scan:
+    set_addr $I10, rxscan193_loop
+    rx188_cur."!mark_push"(0, rx188_pos, $I10)
+  rxscan193_done:
+  alt194_0:
+.annotate "line", 111
+    set_addr $I10, alt194_1
+    rx188_cur."!mark_push"(0, rx188_pos, $I10)
+.annotate "line", 112
+  # rx subrule "lambda" subtype=method negate=
+    rx188_cur."!cursor_pos"(rx188_pos)
+    $P10 = rx188_cur."lambda"()
+    unless $P10, rx188_fail
+    rx188_pos = $P10."pos"()
+.annotate "line", 113
+  # rx subrule "newpad" subtype=method negate=
+    rx188_cur."!cursor_pos"(rx188_pos)
+    $P10 = rx188_cur."newpad"()
+    unless $P10, rx188_fail
+    rx188_pos = $P10."pos"()
+.annotate "line", 114
+  # rx subrule "signature" subtype=capture negate=
+    rx188_cur."!cursor_pos"(rx188_pos)
+    $P10 = rx188_cur."signature"()
+    unless $P10, rx188_fail
+    rx188_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("signature")
+    rx188_pos = $P10."pos"()
+.annotate "line", 115
+  # rx subrule "blockoid" subtype=capture negate=
+    rx188_cur."!cursor_pos"(rx188_pos)
+    $P10 = rx188_cur."blockoid"()
+    unless $P10, rx188_fail
+    rx188_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("blockoid")
+    rx188_pos = $P10."pos"()
+.annotate "line", 112
+    goto alt194_end
+  alt194_1:
+    set_addr $I10, alt194_2
+    rx188_cur."!mark_push"(0, rx188_pos, $I10)
+.annotate "line", 116
+  # rx enumcharlist negate=0 zerowidth
+    ge rx188_pos, rx188_eos, rx188_fail
+    sub $I10, rx188_pos, rx188_off
+    substr $S10, rx188_tgt, $I10, 1
+    index $I11, "{", $S10
+    lt $I11, 0, rx188_fail
+.annotate "line", 117
+  # rx subrule "newpad" subtype=method negate=
+    rx188_cur."!cursor_pos"(rx188_pos)
+    $P10 = rx188_cur."newpad"()
+    unless $P10, rx188_fail
+    rx188_pos = $P10."pos"()
+.annotate "line", 118
+  # rx subrule "blockoid" subtype=capture negate=
+    rx188_cur."!cursor_pos"(rx188_pos)
+    $P10 = rx188_cur."blockoid"()
+    unless $P10, rx188_fail
+    rx188_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("blockoid")
+    rx188_pos = $P10."pos"()
+.annotate "line", 116
+    goto alt194_end
+  alt194_2:
+.annotate "line", 119
+  # rx subrule "panic" subtype=method negate=
+    rx188_cur."!cursor_pos"(rx188_pos)
+    $P10 = rx188_cur."panic"("Missing block")
+    unless $P10, rx188_fail
+    rx188_pos = $P10."pos"()
+  alt194_end:
+.annotate "line", 111
+  # rx pass
+    rx188_cur."!cursor_pass"(rx188_pos, "pblock")
+    rx188_cur."!cursor_debug"("PASS  ", "pblock", " at pos=", rx188_pos)
+    .return (rx188_cur)
+  rx188_fail:
+.annotate "line", 4
+    (rx188_rep, rx188_pos, $I10, $P10) = rx188_cur."!mark_fail"(0)
+    lt rx188_pos, -1, rx188_done
+    eq rx188_pos, -1, rx188_fail
+    jump $I10
+  rx188_done:
+    rx188_cur."!cursor_fail"()
+    rx188_cur."!cursor_debug"("FAIL  ", "pblock")
+    .return (rx188_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__pblock"  :subid("41_1261064023.05912") :method
+.annotate "line", 4
+    $P190 = self."!PREFIX__!subrule"("", "")
+    $P191 = self."!PREFIX__!subrule"("", "")
+    new $P192, "ResizablePMCArray"
+    push $P192, $P190
+    push $P192, "{"
+    push $P192, $P191
+    .return ($P192)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "lambda"  :subid("42_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx196_tgt
+    .local int rx196_pos
+    .local int rx196_off
+    .local int rx196_eos
+    .local int rx196_rep
+    .local pmc rx196_cur
+    (rx196_cur, rx196_pos, rx196_tgt) = self."!cursor_start"()
+    rx196_cur."!cursor_debug"("START ", "lambda")
+    .lex unicode:"$\x{a2}", rx196_cur
+    .local pmc match
+    .lex "$/", match
+    length rx196_eos, rx196_tgt
+    set rx196_off, 0
+    lt rx196_pos, 2, rx196_start
+    sub rx196_off, rx196_pos, 1
+    substr rx196_tgt, rx196_tgt, rx196_off
+  rx196_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan199_done
+    goto rxscan199_scan
+  rxscan199_loop:
+    ($P10) = rx196_cur."from"()
+    inc $P10
+    set rx196_pos, $P10
+    ge rx196_pos, rx196_eos, rxscan199_done
+  rxscan199_scan:
+    set_addr $I10, rxscan199_loop
+    rx196_cur."!mark_push"(0, rx196_pos, $I10)
+  rxscan199_done:
+  alt200_0:
+.annotate "line", 122
+    set_addr $I10, alt200_1
+    rx196_cur."!mark_push"(0, rx196_pos, $I10)
+  # rx literal  "->"
+    add $I11, rx196_pos, 2
+    gt $I11, rx196_eos, rx196_fail
+    sub $I11, rx196_pos, rx196_off
+    substr $S10, rx196_tgt, $I11, 2
+    ne $S10, "->", rx196_fail
+    add rx196_pos, 2
+    goto alt200_end
+  alt200_1:
+  # rx literal  "<->"
+    add $I11, rx196_pos, 3
+    gt $I11, rx196_eos, rx196_fail
+    sub $I11, rx196_pos, rx196_off
+    substr $S10, rx196_tgt, $I11, 3
+    ne $S10, "<->", rx196_fail
+    add rx196_pos, 3
+  alt200_end:
+  # rx pass
+    rx196_cur."!cursor_pass"(rx196_pos, "lambda")
+    rx196_cur."!cursor_debug"("PASS  ", "lambda", " at pos=", rx196_pos)
+    .return (rx196_cur)
+  rx196_fail:
+.annotate "line", 4
+    (rx196_rep, rx196_pos, $I10, $P10) = rx196_cur."!mark_fail"(0)
+    lt rx196_pos, -1, rx196_done
+    eq rx196_pos, -1, rx196_fail
+    jump $I10
+  rx196_done:
+    rx196_cur."!cursor_fail"()
+    rx196_cur."!cursor_debug"("FAIL  ", "lambda")
+    .return (rx196_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__lambda"  :subid("43_1261064023.05912") :method
+.annotate "line", 4
+    new $P198, "ResizablePMCArray"
+    push $P198, "<->"
+    push $P198, "->"
+    .return ($P198)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "block"  :subid("44_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx202_tgt
+    .local int rx202_pos
+    .local int rx202_off
+    .local int rx202_eos
+    .local int rx202_rep
+    .local pmc rx202_cur
+    (rx202_cur, rx202_pos, rx202_tgt) = self."!cursor_start"()
+    rx202_cur."!cursor_debug"("START ", "block")
+    .lex unicode:"$\x{a2}", rx202_cur
+    .local pmc match
+    .lex "$/", match
+    length rx202_eos, rx202_tgt
+    set rx202_off, 0
+    lt rx202_pos, 2, rx202_start
+    sub rx202_off, rx202_pos, 1
+    substr rx202_tgt, rx202_tgt, rx202_off
+  rx202_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan206_done
+    goto rxscan206_scan
+  rxscan206_loop:
+    ($P10) = rx202_cur."from"()
+    inc $P10
+    set rx202_pos, $P10
+    ge rx202_pos, rx202_eos, rxscan206_done
+  rxscan206_scan:
+    set_addr $I10, rxscan206_loop
+    rx202_cur."!mark_push"(0, rx202_pos, $I10)
+  rxscan206_done:
+  alt207_0:
+.annotate "line", 125
+    set_addr $I10, alt207_1
+    rx202_cur."!mark_push"(0, rx202_pos, $I10)
+  # rx enumcharlist negate=0 zerowidth
+    ge rx202_pos, rx202_eos, rx202_fail
+    sub $I10, rx202_pos, rx202_off
+    substr $S10, rx202_tgt, $I10, 1
+    index $I11, "{", $S10
+    lt $I11, 0, rx202_fail
+    goto alt207_end
+  alt207_1:
+  # rx subrule "panic" subtype=method negate=
+    rx202_cur."!cursor_pos"(rx202_pos)
+    $P10 = rx202_cur."panic"("Missing block")
+    unless $P10, rx202_fail
+    rx202_pos = $P10."pos"()
+  alt207_end:
+.annotate "line", 126
+  # rx subrule "newpad" subtype=method negate=
+    rx202_cur."!cursor_pos"(rx202_pos)
+    $P10 = rx202_cur."newpad"()
+    unless $P10, rx202_fail
+    rx202_pos = $P10."pos"()
+.annotate "line", 127
+  # rx subrule "blockoid" subtype=capture negate=
+    rx202_cur."!cursor_pos"(rx202_pos)
+    $P10 = rx202_cur."blockoid"()
+    unless $P10, rx202_fail
+    rx202_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("blockoid")
+    rx202_pos = $P10."pos"()
+.annotate "line", 124
+  # rx pass
+    rx202_cur."!cursor_pass"(rx202_pos, "block")
+    rx202_cur."!cursor_debug"("PASS  ", "block", " at pos=", rx202_pos)
+    .return (rx202_cur)
+  rx202_fail:
+.annotate "line", 4
+    (rx202_rep, rx202_pos, $I10, $P10) = rx202_cur."!mark_fail"(0)
+    lt rx202_pos, -1, rx202_done
+    eq rx202_pos, -1, rx202_fail
+    jump $I10
+  rx202_done:
+    rx202_cur."!cursor_fail"()
+    rx202_cur."!cursor_debug"("FAIL  ", "block")
+    .return (rx202_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__block"  :subid("45_1261064023.05912") :method
+.annotate "line", 4
+    $P204 = self."!PREFIX__!subrule"("", "")
+    new $P205, "ResizablePMCArray"
+    push $P205, $P204
+    push $P205, "{"
+    .return ($P205)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "blockoid"  :subid("46_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx209_tgt
+    .local int rx209_pos
+    .local int rx209_off
+    .local int rx209_eos
+    .local int rx209_rep
+    .local pmc rx209_cur
+    (rx209_cur, rx209_pos, rx209_tgt) = self."!cursor_start"()
+    rx209_cur."!cursor_debug"("START ", "blockoid")
+    .lex unicode:"$\x{a2}", rx209_cur
+    .local pmc match
+    .lex "$/", match
+    length rx209_eos, rx209_tgt
+    set rx209_off, 0
+    lt rx209_pos, 2, rx209_start
+    sub rx209_off, rx209_pos, 1
+    substr rx209_tgt, rx209_tgt, rx209_off
+  rx209_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan213_done
+    goto rxscan213_scan
+  rxscan213_loop:
+    ($P10) = rx209_cur."from"()
+    inc $P10
+    set rx209_pos, $P10
+    ge rx209_pos, rx209_eos, rxscan213_done
+  rxscan213_scan:
+    set_addr $I10, rxscan213_loop
+    rx209_cur."!mark_push"(0, rx209_pos, $I10)
+  rxscan213_done:
+.annotate "line", 131
+  # rx subrule "finishpad" subtype=method negate=
+    rx209_cur."!cursor_pos"(rx209_pos)
+    $P10 = rx209_cur."finishpad"()
+    unless $P10, rx209_fail
+    rx209_pos = $P10."pos"()
+.annotate "line", 132
+  # rx literal  "{"
+    add $I11, rx209_pos, 1
+    gt $I11, rx209_eos, rx209_fail
+    sub $I11, rx209_pos, rx209_off
+    substr $S10, rx209_tgt, $I11, 1
+    ne $S10, "{", rx209_fail
+    add rx209_pos, 1
+  # rx subrule "statementlist" subtype=capture negate=
+    rx209_cur."!cursor_pos"(rx209_pos)
+    $P10 = rx209_cur."statementlist"()
+    unless $P10, rx209_fail
+    rx209_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("statementlist")
+    rx209_pos = $P10."pos"()
+  alt214_0:
+    set_addr $I10, alt214_1
+    rx209_cur."!mark_push"(0, rx209_pos, $I10)
+  # rx literal  "}"
+    add $I11, rx209_pos, 1
+    gt $I11, rx209_eos, rx209_fail
+    sub $I11, rx209_pos, rx209_off
+    substr $S10, rx209_tgt, $I11, 1
+    ne $S10, "}", rx209_fail
+    add rx209_pos, 1
+    goto alt214_end
+  alt214_1:
+  # rx subrule "FAILGOAL" subtype=method negate=
+    rx209_cur."!cursor_pos"(rx209_pos)
+    $P10 = rx209_cur."FAILGOAL"("'}'")
+    unless $P10, rx209_fail
+    rx209_pos = $P10."pos"()
+  alt214_end:
+.annotate "line", 133
+  # rx subrule "ENDSTMT" subtype=zerowidth negate=
+    rx209_cur."!cursor_pos"(rx209_pos)
+    $P10 = rx209_cur."ENDSTMT"()
+    unless $P10, rx209_fail
+.annotate "line", 130
+  # rx pass
+    rx209_cur."!cursor_pass"(rx209_pos, "blockoid")
+    rx209_cur."!cursor_debug"("PASS  ", "blockoid", " at pos=", rx209_pos)
+    .return (rx209_cur)
+  rx209_fail:
+.annotate "line", 4
+    (rx209_rep, rx209_pos, $I10, $P10) = rx209_cur."!mark_fail"(0)
+    lt rx209_pos, -1, rx209_done
+    eq rx209_pos, -1, rx209_fail
+    jump $I10
+  rx209_done:
+    rx209_cur."!cursor_fail"()
+    rx209_cur."!cursor_debug"("FAIL  ", "blockoid")
+    .return (rx209_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__blockoid"  :subid("47_1261064023.05912") :method
+.annotate "line", 4
+    $P211 = self."!PREFIX__!subrule"("", "")
+    new $P212, "ResizablePMCArray"
+    push $P212, $P211
+    .return ($P212)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "newpad"  :subid("48_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx217_tgt
+    .local int rx217_pos
+    .local int rx217_off
+    .local int rx217_eos
+    .local int rx217_rep
+    .local pmc rx217_cur
+    (rx217_cur, rx217_pos, rx217_tgt) = self."!cursor_start"()
+    rx217_cur."!cursor_debug"("START ", "newpad")
+    .lex unicode:"$\x{a2}", rx217_cur
+    .local pmc match
+    .lex "$/", match
+    length rx217_eos, rx217_tgt
+    set rx217_off, 0
+    lt rx217_pos, 2, rx217_start
+    sub rx217_off, rx217_pos, 1
+    substr rx217_tgt, rx217_tgt, rx217_off
+  rx217_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan220_done
+    goto rxscan220_scan
+  rxscan220_loop:
+    ($P10) = rx217_cur."from"()
+    inc $P10
+    set rx217_pos, $P10
+    ge rx217_pos, rx217_eos, rxscan220_done
+  rxscan220_scan:
+    set_addr $I10, rxscan220_loop
+    rx217_cur."!mark_push"(0, rx217_pos, $I10)
+  rxscan220_done:
+.annotate "line", 136
+  # rx pass
+    rx217_cur."!cursor_pass"(rx217_pos, "newpad")
+    rx217_cur."!cursor_debug"("PASS  ", "newpad", " at pos=", rx217_pos)
+    .return (rx217_cur)
+  rx217_fail:
+.annotate "line", 4
+    (rx217_rep, rx217_pos, $I10, $P10) = rx217_cur."!mark_fail"(0)
+    lt rx217_pos, -1, rx217_done
+    eq rx217_pos, -1, rx217_fail
+    jump $I10
+  rx217_done:
+    rx217_cur."!cursor_fail"()
+    rx217_cur."!cursor_debug"("FAIL  ", "newpad")
+    .return (rx217_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__newpad"  :subid("49_1261064023.05912") :method
+.annotate "line", 4
+    new $P219, "ResizablePMCArray"
+    push $P219, ""
+    .return ($P219)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "finishpad"  :subid("50_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx222_tgt
+    .local int rx222_pos
+    .local int rx222_off
+    .local int rx222_eos
+    .local int rx222_rep
+    .local pmc rx222_cur
+    (rx222_cur, rx222_pos, rx222_tgt) = self."!cursor_start"()
+    rx222_cur."!cursor_debug"("START ", "finishpad")
+    .lex unicode:"$\x{a2}", rx222_cur
+    .local pmc match
+    .lex "$/", match
+    length rx222_eos, rx222_tgt
+    set rx222_off, 0
+    lt rx222_pos, 2, rx222_start
+    sub rx222_off, rx222_pos, 1
+    substr rx222_tgt, rx222_tgt, rx222_off
+  rx222_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan225_done
+    goto rxscan225_scan
+  rxscan225_loop:
+    ($P10) = rx222_cur."from"()
+    inc $P10
+    set rx222_pos, $P10
+    ge rx222_pos, rx222_eos, rxscan225_done
+  rxscan225_scan:
+    set_addr $I10, rxscan225_loop
+    rx222_cur."!mark_push"(0, rx222_pos, $I10)
+  rxscan225_done:
+.annotate "line", 137
+  # rx pass
+    rx222_cur."!cursor_pass"(rx222_pos, "finishpad")
+    rx222_cur."!cursor_debug"("PASS  ", "finishpad", " at pos=", rx222_pos)
+    .return (rx222_cur)
+  rx222_fail:
+.annotate "line", 4
+    (rx222_rep, rx222_pos, $I10, $P10) = rx222_cur."!mark_fail"(0)
+    lt rx222_pos, -1, rx222_done
+    eq rx222_pos, -1, rx222_fail
+    jump $I10
+  rx222_done:
+    rx222_cur."!cursor_fail"()
+    rx222_cur."!cursor_debug"("FAIL  ", "finishpad")
+    .return (rx222_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__finishpad"  :subid("51_1261064023.05912") :method
+.annotate "line", 4
+    new $P224, "ResizablePMCArray"
+    push $P224, ""
+    .return ($P224)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "terminator"  :subid("52_1261064023.05912") :method
+.annotate "line", 139
+    $P227 = self."!protoregex"("terminator")
+    .return ($P227)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__terminator"  :subid("53_1261064023.05912") :method
+.annotate "line", 139
+    $P229 = self."!PREFIX__!protoregex"("terminator")
+    .return ($P229)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "terminator:sym<;>"  :subid("54_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx231_tgt
+    .local int rx231_pos
+    .local int rx231_off
+    .local int rx231_eos
+    .local int rx231_rep
+    .local pmc rx231_cur
+    (rx231_cur, rx231_pos, rx231_tgt) = self."!cursor_start"()
+    rx231_cur."!cursor_debug"("START ", "terminator:sym<;>")
+    .lex unicode:"$\x{a2}", rx231_cur
+    .local pmc match
+    .lex "$/", match
+    length rx231_eos, rx231_tgt
+    set rx231_off, 0
+    lt rx231_pos, 2, rx231_start
+    sub rx231_off, rx231_pos, 1
+    substr rx231_tgt, rx231_tgt, rx231_off
+  rx231_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan234_done
+    goto rxscan234_scan
+  rxscan234_loop:
+    ($P10) = rx231_cur."from"()
+    inc $P10
+    set rx231_pos, $P10
+    ge rx231_pos, rx231_eos, rxscan234_done
+  rxscan234_scan:
+    set_addr $I10, rxscan234_loop
+    rx231_cur."!mark_push"(0, rx231_pos, $I10)
+  rxscan234_done:
+.annotate "line", 141
+  # rx enumcharlist negate=0 zerowidth
+    ge rx231_pos, rx231_eos, rx231_fail
+    sub $I10, rx231_pos, rx231_off
+    substr $S10, rx231_tgt, $I10, 1
+    index $I11, ";", $S10
+    lt $I11, 0, rx231_fail
+  # rx pass
+    rx231_cur."!cursor_pass"(rx231_pos, "terminator:sym<;>")
+    rx231_cur."!cursor_debug"("PASS  ", "terminator:sym<;>", " at pos=", rx231_pos)
+    .return (rx231_cur)
+  rx231_fail:
+.annotate "line", 4
+    (rx231_rep, rx231_pos, $I10, $P10) = rx231_cur."!mark_fail"(0)
+    lt rx231_pos, -1, rx231_done
+    eq rx231_pos, -1, rx231_fail
+    jump $I10
+  rx231_done:
+    rx231_cur."!cursor_fail"()
+    rx231_cur."!cursor_debug"("FAIL  ", "terminator:sym<;>")
+    .return (rx231_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__terminator:sym<;>"  :subid("55_1261064023.05912") :method
+.annotate "line", 4
+    new $P233, "ResizablePMCArray"
+    push $P233, ";"
+    .return ($P233)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "terminator:sym<}>"  :subid("56_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx236_tgt
+    .local int rx236_pos
+    .local int rx236_off
+    .local int rx236_eos
+    .local int rx236_rep
+    .local pmc rx236_cur
+    (rx236_cur, rx236_pos, rx236_tgt) = self."!cursor_start"()
+    rx236_cur."!cursor_debug"("START ", "terminator:sym<}>")
+    .lex unicode:"$\x{a2}", rx236_cur
+    .local pmc match
+    .lex "$/", match
+    length rx236_eos, rx236_tgt
+    set rx236_off, 0
+    lt rx236_pos, 2, rx236_start
+    sub rx236_off, rx236_pos, 1
+    substr rx236_tgt, rx236_tgt, rx236_off
+  rx236_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan239_done
+    goto rxscan239_scan
+  rxscan239_loop:
+    ($P10) = rx236_cur."from"()
+    inc $P10
+    set rx236_pos, $P10
+    ge rx236_pos, rx236_eos, rxscan239_done
+  rxscan239_scan:
+    set_addr $I10, rxscan239_loop
+    rx236_cur."!mark_push"(0, rx236_pos, $I10)
+  rxscan239_done:
+.annotate "line", 142
+  # rx enumcharlist negate=0 zerowidth
+    ge rx236_pos, rx236_eos, rx236_fail
+    sub $I10, rx236_pos, rx236_off
+    substr $S10, rx236_tgt, $I10, 1
+    index $I11, "}", $S10
+    lt $I11, 0, rx236_fail
+  # rx pass
+    rx236_cur."!cursor_pass"(rx236_pos, "terminator:sym<}>")
+    rx236_cur."!cursor_debug"("PASS  ", "terminator:sym<}>", " at pos=", rx236_pos)
+    .return (rx236_cur)
+  rx236_fail:
+.annotate "line", 4
+    (rx236_rep, rx236_pos, $I10, $P10) = rx236_cur."!mark_fail"(0)
+    lt rx236_pos, -1, rx236_done
+    eq rx236_pos, -1, rx236_fail
+    jump $I10
+  rx236_done:
+    rx236_cur."!cursor_fail"()
+    rx236_cur."!cursor_debug"("FAIL  ", "terminator:sym<}>")
+    .return (rx236_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__terminator:sym<}>"  :subid("57_1261064023.05912") :method
+.annotate "line", 4
+    new $P238, "ResizablePMCArray"
+    push $P238, "}"
+    .return ($P238)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "statement_control"  :subid("58_1261064023.05912") :method
+.annotate "line", 146
+    $P241 = self."!protoregex"("statement_control")
+    .return ($P241)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__statement_control"  :subid("59_1261064023.05912") :method
+.annotate "line", 146
+    $P243 = self."!PREFIX__!protoregex"("statement_control")
+    .return ($P243)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "statement_control:sym<if>"  :subid("60_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx245_tgt
+    .local int rx245_pos
+    .local int rx245_off
+    .local int rx245_eos
+    .local int rx245_rep
+    .local pmc rx245_cur
+    (rx245_cur, rx245_pos, rx245_tgt) = self."!cursor_start"()
+    rx245_cur."!cursor_debug"("START ", "statement_control:sym<if>")
+    rx245_cur."!cursor_caparray"("xblock", "else")
+    .lex unicode:"$\x{a2}", rx245_cur
+    .local pmc match
+    .lex "$/", match
+    length rx245_eos, rx245_tgt
+    set rx245_off, 0
+    lt rx245_pos, 2, rx245_start
+    sub rx245_off, rx245_pos, 1
+    substr rx245_tgt, rx245_tgt, rx245_off
+  rx245_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan248_done
+    goto rxscan248_scan
+  rxscan248_loop:
+    ($P10) = rx245_cur."from"()
+    inc $P10
+    set rx245_pos, $P10
+    ge rx245_pos, rx245_eos, rxscan248_done
+  rxscan248_scan:
+    set_addr $I10, rxscan248_loop
+    rx245_cur."!mark_push"(0, rx245_pos, $I10)
+  rxscan248_done:
+.annotate "line", 149
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_249_fail
+    rx245_cur."!mark_push"(0, rx245_pos, $I10)
+  # rx literal  "if"
+    add $I11, rx245_pos, 2
+    gt $I11, rx245_eos, rx245_fail
+    sub $I11, rx245_pos, rx245_off
+    substr $S10, rx245_tgt, $I11, 2
+    ne $S10, "if", rx245_fail
+    add rx245_pos, 2
+    set_addr $I10, rxcap_249_fail
+    ($I12, $I11) = rx245_cur."!mark_peek"($I10)
+    rx245_cur."!cursor_pos"($I11)
+    ($P10) = rx245_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx245_pos, "")
+    rx245_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_249_done
+  rxcap_249_fail:
+    goto rx245_fail
+  rxcap_249_done:
+  # rx charclass s
+    ge rx245_pos, rx245_eos, rx245_fail
+    sub $I10, rx245_pos, rx245_off
+    is_cclass $I11, 32, rx245_tgt, $I10
+    unless $I11, rx245_fail
+    inc rx245_pos
+  # rx subrule "ws" subtype=method negate=
+    rx245_cur."!cursor_pos"(rx245_pos)
+    $P10 = rx245_cur."ws"()
+    unless $P10, rx245_fail
+    rx245_pos = $P10."pos"()
+.annotate "line", 150
+  # rx subrule "xblock" subtype=capture negate=
+    rx245_cur."!cursor_pos"(rx245_pos)
+    $P10 = rx245_cur."xblock"()
+    unless $P10, rx245_fail
+    rx245_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("xblock")
+    rx245_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx245_cur."!cursor_pos"(rx245_pos)
+    $P10 = rx245_cur."ws"()
+    unless $P10, rx245_fail
+    rx245_pos = $P10."pos"()
+.annotate "line", 151
+  # rx rxquantr252 ** 0..*
+    set_addr $I256, rxquantr252_done
+    rx245_cur."!mark_push"(0, rx245_pos, $I256)
+  rxquantr252_loop:
+  # rx subrule "ws" subtype=method negate=
+    rx245_cur."!cursor_pos"(rx245_pos)
+    $P10 = rx245_cur."ws"()
+    unless $P10, rx245_fail
+    rx245_pos = $P10."pos"()
+  # rx literal  "elsif"
+    add $I11, rx245_pos, 5
+    gt $I11, rx245_eos, rx245_fail
+    sub $I11, rx245_pos, rx245_off
+    substr $S10, rx245_tgt, $I11, 5
+    ne $S10, "elsif", rx245_fail
+    add rx245_pos, 5
+  # rx charclass s
+    ge rx245_pos, rx245_eos, rx245_fail
+    sub $I10, rx245_pos, rx245_off
+    is_cclass $I11, 32, rx245_tgt, $I10
+    unless $I11, rx245_fail
+    inc rx245_pos
+  # rx subrule "ws" subtype=method negate=
+    rx245_cur."!cursor_pos"(rx245_pos)
+    $P10 = rx245_cur."ws"()
+    unless $P10, rx245_fail
+    rx245_pos = $P10."pos"()
+  # rx subrule "xblock" subtype=capture negate=
+    rx245_cur."!cursor_pos"(rx245_pos)
+    $P10 = rx245_cur."xblock"()
+    unless $P10, rx245_fail
+    rx245_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("xblock")
+    rx245_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx245_cur."!cursor_pos"(rx245_pos)
+    $P10 = rx245_cur."ws"()
+    unless $P10, rx245_fail
+    rx245_pos = $P10."pos"()
+    (rx245_rep) = rx245_cur."!mark_commit"($I256)
+    rx245_cur."!mark_push"(rx245_rep, rx245_pos, $I256)
+    goto rxquantr252_loop
+  rxquantr252_done:
+  # rx subrule "ws" subtype=method negate=
+    rx245_cur."!cursor_pos"(rx245_pos)
+    $P10 = rx245_cur."ws"()
+    unless $P10, rx245_fail
+    rx245_pos = $P10."pos"()
+.annotate "line", 152
+  # rx rxquantr258 ** 0..1
+    set_addr $I262, rxquantr258_done
+    rx245_cur."!mark_push"(0, rx245_pos, $I262)
+  rxquantr258_loop:
+  # rx subrule "ws" subtype=method negate=
+    rx245_cur."!cursor_pos"(rx245_pos)
+    $P10 = rx245_cur."ws"()
+    unless $P10, rx245_fail
+    rx245_pos = $P10."pos"()
+  # rx literal  "else"
+    add $I11, rx245_pos, 4
+    gt $I11, rx245_eos, rx245_fail
+    sub $I11, rx245_pos, rx245_off
+    substr $S10, rx245_tgt, $I11, 4
+    ne $S10, "else", rx245_fail
+    add rx245_pos, 4
+  # rx charclass s
+    ge rx245_pos, rx245_eos, rx245_fail
+    sub $I10, rx245_pos, rx245_off
+    is_cclass $I11, 32, rx245_tgt, $I10
+    unless $I11, rx245_fail
+    inc rx245_pos
+  # rx subrule "ws" subtype=method negate=
+    rx245_cur."!cursor_pos"(rx245_pos)
+    $P10 = rx245_cur."ws"()
+    unless $P10, rx245_fail
+    rx245_pos = $P10."pos"()
+  # rx subrule "pblock" subtype=capture negate=
+    rx245_cur."!cursor_pos"(rx245_pos)
+    $P10 = rx245_cur."pblock"()
+    unless $P10, rx245_fail
+    rx245_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("else")
+    rx245_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx245_cur."!cursor_pos"(rx245_pos)
+    $P10 = rx245_cur."ws"()
+    unless $P10, rx245_fail
+    rx245_pos = $P10."pos"()
+    (rx245_rep) = rx245_cur."!mark_commit"($I262)
+  rxquantr258_done:
+  # rx subrule "ws" subtype=method negate=
+    rx245_cur."!cursor_pos"(rx245_pos)
+    $P10 = rx245_cur."ws"()
+    unless $P10, rx245_fail
+    rx245_pos = $P10."pos"()
+.annotate "line", 148
+  # rx pass
+    rx245_cur."!cursor_pass"(rx245_pos, "statement_control:sym<if>")
+    rx245_cur."!cursor_debug"("PASS  ", "statement_control:sym<if>", " at pos=", rx245_pos)
+    .return (rx245_cur)
+  rx245_fail:
+.annotate "line", 4
+    (rx245_rep, rx245_pos, $I10, $P10) = rx245_cur."!mark_fail"(0)
+    lt rx245_pos, -1, rx245_done
+    eq rx245_pos, -1, rx245_fail
+    jump $I10
+  rx245_done:
+    rx245_cur."!cursor_fail"()
+    rx245_cur."!cursor_debug"("FAIL  ", "statement_control:sym<if>")
+    .return (rx245_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__statement_control:sym<if>"  :subid("61_1261064023.05912") :method
+.annotate "line", 4
+    new $P247, "ResizablePMCArray"
+    push $P247, "if"
+    .return ($P247)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "statement_control:sym<unless>"  :subid("62_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .const 'Sub' $P275 = "64_1261064023.05912" 
+    capture_lex $P275
+    .local string rx265_tgt
+    .local int rx265_pos
+    .local int rx265_off
+    .local int rx265_eos
+    .local int rx265_rep
+    .local pmc rx265_cur
+    (rx265_cur, rx265_pos, rx265_tgt) = self."!cursor_start"()
+    rx265_cur."!cursor_debug"("START ", "statement_control:sym<unless>")
+    .lex unicode:"$\x{a2}", rx265_cur
+    .local pmc match
+    .lex "$/", match
+    length rx265_eos, rx265_tgt
+    set rx265_off, 0
+    lt rx265_pos, 2, rx265_start
+    sub rx265_off, rx265_pos, 1
+    substr rx265_tgt, rx265_tgt, rx265_off
+  rx265_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan268_done
+    goto rxscan268_scan
+  rxscan268_loop:
+    ($P10) = rx265_cur."from"()
+    inc $P10
+    set rx265_pos, $P10
+    ge rx265_pos, rx265_eos, rxscan268_done
+  rxscan268_scan:
+    set_addr $I10, rxscan268_loop
+    rx265_cur."!mark_push"(0, rx265_pos, $I10)
+  rxscan268_done:
+.annotate "line", 156
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_269_fail
+    rx265_cur."!mark_push"(0, rx265_pos, $I10)
+  # rx literal  "unless"
+    add $I11, rx265_pos, 6
+    gt $I11, rx265_eos, rx265_fail
+    sub $I11, rx265_pos, rx265_off
+    substr $S10, rx265_tgt, $I11, 6
+    ne $S10, "unless", rx265_fail
+    add rx265_pos, 6
+    set_addr $I10, rxcap_269_fail
+    ($I12, $I11) = rx265_cur."!mark_peek"($I10)
+    rx265_cur."!cursor_pos"($I11)
+    ($P10) = rx265_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx265_pos, "")
+    rx265_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_269_done
+  rxcap_269_fail:
+    goto rx265_fail
+  rxcap_269_done:
+  # rx charclass s
+    ge rx265_pos, rx265_eos, rx265_fail
+    sub $I10, rx265_pos, rx265_off
+    is_cclass $I11, 32, rx265_tgt, $I10
+    unless $I11, rx265_fail
+    inc rx265_pos
+  # rx subrule "ws" subtype=method negate=
+    rx265_cur."!cursor_pos"(rx265_pos)
+    $P10 = rx265_cur."ws"()
+    unless $P10, rx265_fail
+    rx265_pos = $P10."pos"()
+.annotate "line", 157
+  # rx subrule "xblock" subtype=capture negate=
+    rx265_cur."!cursor_pos"(rx265_pos)
+    $P10 = rx265_cur."xblock"()
+    unless $P10, rx265_fail
+    rx265_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("xblock")
+    rx265_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx265_cur."!cursor_pos"(rx265_pos)
+    $P10 = rx265_cur."ws"()
+    unless $P10, rx265_fail
+    rx265_pos = $P10."pos"()
+  alt272_0:
+.annotate "line", 158
+    set_addr $I10, alt272_1
+    rx265_cur."!mark_push"(0, rx265_pos, $I10)
+  # rx subrule "ws" subtype=method negate=
+    rx265_cur."!cursor_pos"(rx265_pos)
+    $P10 = rx265_cur."ws"()
+    unless $P10, rx265_fail
+    rx265_pos = $P10."pos"()
+  # rx subrule "before" subtype=zerowidth negate=1
+    rx265_cur."!cursor_pos"(rx265_pos)
+    .const 'Sub' $P275 = "64_1261064023.05912" 
+    capture_lex $P275
+    $P10 = rx265_cur."before"($P275)
+    if $P10, rx265_fail
+  # rx subrule "ws" subtype=method negate=
+    rx265_cur."!cursor_pos"(rx265_pos)
+    $P10 = rx265_cur."ws"()
+    unless $P10, rx265_fail
+    rx265_pos = $P10."pos"()
+    goto alt272_end
+  alt272_1:
+  # rx subrule "ws" subtype=method negate=
+    rx265_cur."!cursor_pos"(rx265_pos)
+    $P10 = rx265_cur."ws"()
+    unless $P10, rx265_fail
+    rx265_pos = $P10."pos"()
+  # rx subrule "panic" subtype=method negate=
+    rx265_cur."!cursor_pos"(rx265_pos)
+    $P10 = rx265_cur."panic"("unless does not take \"else\", please rewrite using \"if\"")
+    unless $P10, rx265_fail
+    rx265_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx265_cur."!cursor_pos"(rx265_pos)
+    $P10 = rx265_cur."ws"()
+    unless $P10, rx265_fail
+    rx265_pos = $P10."pos"()
+  alt272_end:
+  # rx subrule "ws" subtype=method negate=
+    rx265_cur."!cursor_pos"(rx265_pos)
+    $P10 = rx265_cur."ws"()
+    unless $P10, rx265_fail
+    rx265_pos = $P10."pos"()
+.annotate "line", 155
+  # rx pass
+    rx265_cur."!cursor_pass"(rx265_pos, "statement_control:sym<unless>")
+    rx265_cur."!cursor_debug"("PASS  ", "statement_control:sym<unless>", " at pos=", rx265_pos)
+    .return (rx265_cur)
+  rx265_fail:
+.annotate "line", 4
+    (rx265_rep, rx265_pos, $I10, $P10) = rx265_cur."!mark_fail"(0)
+    lt rx265_pos, -1, rx265_done
+    eq rx265_pos, -1, rx265_fail
+    jump $I10
+  rx265_done:
+    rx265_cur."!cursor_fail"()
+    rx265_cur."!cursor_debug"("FAIL  ", "statement_control:sym<unless>")
+    .return (rx265_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__statement_control:sym<unless>"  :subid("63_1261064023.05912") :method
+.annotate "line", 4
+    new $P267, "ResizablePMCArray"
+    push $P267, "unless"
+    .return ($P267)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "_block274"  :anon :subid("64_1261064023.05912") :method :outer("62_1261064023.05912")
+.annotate "line", 158
+    .local string rx276_tgt
+    .local int rx276_pos
+    .local int rx276_off
+    .local int rx276_eos
+    .local int rx276_rep
+    .local pmc rx276_cur
+    (rx276_cur, rx276_pos, rx276_tgt) = self."!cursor_start"()
+    rx276_cur."!cursor_debug"("START ", "")
+    .lex unicode:"$\x{a2}", rx276_cur
+    .local pmc match
+    .lex "$/", match
+    length rx276_eos, rx276_tgt
+    set rx276_off, 0
+    lt rx276_pos, 2, rx276_start
+    sub rx276_off, rx276_pos, 1
+    substr rx276_tgt, rx276_tgt, rx276_off
+  rx276_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan277_done
+    goto rxscan277_scan
+  rxscan277_loop:
+    ($P10) = rx276_cur."from"()
+    inc $P10
+    set rx276_pos, $P10
+    ge rx276_pos, rx276_eos, rxscan277_done
+  rxscan277_scan:
+    set_addr $I10, rxscan277_loop
+    rx276_cur."!mark_push"(0, rx276_pos, $I10)
+  rxscan277_done:
+  # rx literal  "else"
+    add $I11, rx276_pos, 4
+    gt $I11, rx276_eos, rx276_fail
+    sub $I11, rx276_pos, rx276_off
+    substr $S10, rx276_tgt, $I11, 4
+    ne $S10, "else", rx276_fail
+    add rx276_pos, 4
+  # rx pass
+    rx276_cur."!cursor_pass"(rx276_pos, "")
+    rx276_cur."!cursor_debug"("PASS  ", "", " at pos=", rx276_pos)
+    .return (rx276_cur)
+  rx276_fail:
+    (rx276_rep, rx276_pos, $I10, $P10) = rx276_cur."!mark_fail"(0)
+    lt rx276_pos, -1, rx276_done
+    eq rx276_pos, -1, rx276_fail
+    jump $I10
+  rx276_done:
+    rx276_cur."!cursor_fail"()
+    rx276_cur."!cursor_debug"("FAIL  ", "")
+    .return (rx276_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "statement_control:sym<while>"  :subid("65_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx283_tgt
+    .local int rx283_pos
+    .local int rx283_off
+    .local int rx283_eos
+    .local int rx283_rep
+    .local pmc rx283_cur
+    (rx283_cur, rx283_pos, rx283_tgt) = self."!cursor_start"()
+    rx283_cur."!cursor_debug"("START ", "statement_control:sym<while>")
+    .lex unicode:"$\x{a2}", rx283_cur
+    .local pmc match
+    .lex "$/", match
+    length rx283_eos, rx283_tgt
+    set rx283_off, 0
+    lt rx283_pos, 2, rx283_start
+    sub rx283_off, rx283_pos, 1
+    substr rx283_tgt, rx283_tgt, rx283_off
+  rx283_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan286_done
+    goto rxscan286_scan
+  rxscan286_loop:
+    ($P10) = rx283_cur."from"()
+    inc $P10
+    set rx283_pos, $P10
+    ge rx283_pos, rx283_eos, rxscan286_done
+  rxscan286_scan:
+    set_addr $I10, rxscan286_loop
+    rx283_cur."!mark_push"(0, rx283_pos, $I10)
+  rxscan286_done:
+.annotate "line", 162
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_288_fail
+    rx283_cur."!mark_push"(0, rx283_pos, $I10)
+  alt287_0:
+    set_addr $I10, alt287_1
+    rx283_cur."!mark_push"(0, rx283_pos, $I10)
+  # rx literal  "while"
+    add $I11, rx283_pos, 5
+    gt $I11, rx283_eos, rx283_fail
+    sub $I11, rx283_pos, rx283_off
+    substr $S10, rx283_tgt, $I11, 5
+    ne $S10, "while", rx283_fail
+    add rx283_pos, 5
+    goto alt287_end
+  alt287_1:
+  # rx literal  "until"
+    add $I11, rx283_pos, 5
+    gt $I11, rx283_eos, rx283_fail
+    sub $I11, rx283_pos, rx283_off
+    substr $S10, rx283_tgt, $I11, 5
+    ne $S10, "until", rx283_fail
+    add rx283_pos, 5
+  alt287_end:
+    set_addr $I10, rxcap_288_fail
+    ($I12, $I11) = rx283_cur."!mark_peek"($I10)
+    rx283_cur."!cursor_pos"($I11)
+    ($P10) = rx283_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx283_pos, "")
+    rx283_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_288_done
+  rxcap_288_fail:
+    goto rx283_fail
+  rxcap_288_done:
+  # rx charclass s
+    ge rx283_pos, rx283_eos, rx283_fail
+    sub $I10, rx283_pos, rx283_off
+    is_cclass $I11, 32, rx283_tgt, $I10
+    unless $I11, rx283_fail
+    inc rx283_pos
+  # rx subrule "ws" subtype=method negate=
+    rx283_cur."!cursor_pos"(rx283_pos)
+    $P10 = rx283_cur."ws"()
+    unless $P10, rx283_fail
+    rx283_pos = $P10."pos"()
+.annotate "line", 163
+  # rx subrule "xblock" subtype=capture negate=
+    rx283_cur."!cursor_pos"(rx283_pos)
+    $P10 = rx283_cur."xblock"()
+    unless $P10, rx283_fail
+    rx283_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("xblock")
+    rx283_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx283_cur."!cursor_pos"(rx283_pos)
+    $P10 = rx283_cur."ws"()
+    unless $P10, rx283_fail
+    rx283_pos = $P10."pos"()
+.annotate "line", 161
+  # rx pass
+    rx283_cur."!cursor_pass"(rx283_pos, "statement_control:sym<while>")
+    rx283_cur."!cursor_debug"("PASS  ", "statement_control:sym<while>", " at pos=", rx283_pos)
+    .return (rx283_cur)
+  rx283_fail:
+.annotate "line", 4
+    (rx283_rep, rx283_pos, $I10, $P10) = rx283_cur."!mark_fail"(0)
+    lt rx283_pos, -1, rx283_done
+    eq rx283_pos, -1, rx283_fail
+    jump $I10
+  rx283_done:
+    rx283_cur."!cursor_fail"()
+    rx283_cur."!cursor_debug"("FAIL  ", "statement_control:sym<while>")
+    .return (rx283_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__statement_control:sym<while>"  :subid("66_1261064023.05912") :method
+.annotate "line", 4
+    new $P285, "ResizablePMCArray"
+    push $P285, "until"
+    push $P285, "while"
+    .return ($P285)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "statement_control:sym<repeat>"  :subid("67_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx292_tgt
+    .local int rx292_pos
+    .local int rx292_off
+    .local int rx292_eos
+    .local int rx292_rep
+    .local pmc rx292_cur
+    (rx292_cur, rx292_pos, rx292_tgt) = self."!cursor_start"()
+    rx292_cur."!cursor_debug"("START ", "statement_control:sym<repeat>")
+    .lex unicode:"$\x{a2}", rx292_cur
+    .local pmc match
+    .lex "$/", match
+    length rx292_eos, rx292_tgt
+    set rx292_off, 0
+    lt rx292_pos, 2, rx292_start
+    sub rx292_off, rx292_pos, 1
+    substr rx292_tgt, rx292_tgt, rx292_off
+  rx292_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan295_done
+    goto rxscan295_scan
+  rxscan295_loop:
+    ($P10) = rx292_cur."from"()
+    inc $P10
+    set rx292_pos, $P10
+    ge rx292_pos, rx292_eos, rxscan295_done
+  rxscan295_scan:
+    set_addr $I10, rxscan295_loop
+    rx292_cur."!mark_push"(0, rx292_pos, $I10)
+  rxscan295_done:
+.annotate "line", 167
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_296_fail
+    rx292_cur."!mark_push"(0, rx292_pos, $I10)
+  # rx literal  "repeat"
+    add $I11, rx292_pos, 6
+    gt $I11, rx292_eos, rx292_fail
+    sub $I11, rx292_pos, rx292_off
+    substr $S10, rx292_tgt, $I11, 6
+    ne $S10, "repeat", rx292_fail
+    add rx292_pos, 6
+    set_addr $I10, rxcap_296_fail
+    ($I12, $I11) = rx292_cur."!mark_peek"($I10)
+    rx292_cur."!cursor_pos"($I11)
+    ($P10) = rx292_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx292_pos, "")
+    rx292_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_296_done
+  rxcap_296_fail:
+    goto rx292_fail
+  rxcap_296_done:
+  # rx charclass s
+    ge rx292_pos, rx292_eos, rx292_fail
+    sub $I10, rx292_pos, rx292_off
+    is_cclass $I11, 32, rx292_tgt, $I10
+    unless $I11, rx292_fail
+    inc rx292_pos
+  # rx subrule "ws" subtype=method negate=
+    rx292_cur."!cursor_pos"(rx292_pos)
+    $P10 = rx292_cur."ws"()
+    unless $P10, rx292_fail
+    rx292_pos = $P10."pos"()
+  alt298_0:
+.annotate "line", 168
+    set_addr $I10, alt298_1
+    rx292_cur."!mark_push"(0, rx292_pos, $I10)
+.annotate "line", 169
+  # rx subrule "ws" subtype=method negate=
+    rx292_cur."!cursor_pos"(rx292_pos)
+    $P10 = rx292_cur."ws"()
+    unless $P10, rx292_fail
+    rx292_pos = $P10."pos"()
+  # rx subcapture "wu"
+    set_addr $I10, rxcap_301_fail
+    rx292_cur."!mark_push"(0, rx292_pos, $I10)
+  alt300_0:
+    set_addr $I10, alt300_1
+    rx292_cur."!mark_push"(0, rx292_pos, $I10)
+  # rx literal  "while"
+    add $I11, rx292_pos, 5
+    gt $I11, rx292_eos, rx292_fail
+    sub $I11, rx292_pos, rx292_off
+    substr $S10, rx292_tgt, $I11, 5
+    ne $S10, "while", rx292_fail
+    add rx292_pos, 5
+    goto alt300_end
+  alt300_1:
+  # rx literal  "until"
+    add $I11, rx292_pos, 5
+    gt $I11, rx292_eos, rx292_fail
+    sub $I11, rx292_pos, rx292_off
+    substr $S10, rx292_tgt, $I11, 5
+    ne $S10, "until", rx292_fail
+    add rx292_pos, 5
+  alt300_end:
+    set_addr $I10, rxcap_301_fail
+    ($I12, $I11) = rx292_cur."!mark_peek"($I10)
+    rx292_cur."!cursor_pos"($I11)
+    ($P10) = rx292_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx292_pos, "")
+    rx292_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("wu")
+    goto rxcap_301_done
+  rxcap_301_fail:
+    goto rx292_fail
+  rxcap_301_done:
+  # rx charclass s
+    ge rx292_pos, rx292_eos, rx292_fail
+    sub $I10, rx292_pos, rx292_off
+    is_cclass $I11, 32, rx292_tgt, $I10
+    unless $I11, rx292_fail
+    inc rx292_pos
+  # rx subrule "ws" subtype=method negate=
+    rx292_cur."!cursor_pos"(rx292_pos)
+    $P10 = rx292_cur."ws"()
+    unless $P10, rx292_fail
+    rx292_pos = $P10."pos"()
+  # rx subrule "xblock" subtype=capture negate=
+    rx292_cur."!cursor_pos"(rx292_pos)
+    $P10 = rx292_cur."xblock"()
+    unless $P10, rx292_fail
+    rx292_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("xblock")
+    rx292_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx292_cur."!cursor_pos"(rx292_pos)
+    $P10 = rx292_cur."ws"()
+    unless $P10, rx292_fail
+    rx292_pos = $P10."pos"()
+    goto alt298_end
+  alt298_1:
+.annotate "line", 170
+  # rx subrule "ws" subtype=method negate=
+    rx292_cur."!cursor_pos"(rx292_pos)
+    $P10 = rx292_cur."ws"()
+    unless $P10, rx292_fail
+    rx292_pos = $P10."pos"()
+  # rx subrule "pblock" subtype=capture negate=
+    rx292_cur."!cursor_pos"(rx292_pos)
+    $P10 = rx292_cur."pblock"()
+    unless $P10, rx292_fail
+    rx292_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("pblock")
+    rx292_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx292_cur."!cursor_pos"(rx292_pos)
+    $P10 = rx292_cur."ws"()
+    unless $P10, rx292_fail
+    rx292_pos = $P10."pos"()
+  # rx subcapture "wu"
+    set_addr $I10, rxcap_307_fail
+    rx292_cur."!mark_push"(0, rx292_pos, $I10)
+  alt306_0:
+    set_addr $I10, alt306_1
+    rx292_cur."!mark_push"(0, rx292_pos, $I10)
+  # rx literal  "while"
+    add $I11, rx292_pos, 5
+    gt $I11, rx292_eos, rx292_fail
+    sub $I11, rx292_pos, rx292_off
+    substr $S10, rx292_tgt, $I11, 5
+    ne $S10, "while", rx292_fail
+    add rx292_pos, 5
+    goto alt306_end
+  alt306_1:
+  # rx literal  "until"
+    add $I11, rx292_pos, 5
+    gt $I11, rx292_eos, rx292_fail
+    sub $I11, rx292_pos, rx292_off
+    substr $S10, rx292_tgt, $I11, 5
+    ne $S10, "until", rx292_fail
+    add rx292_pos, 5
+  alt306_end:
+    set_addr $I10, rxcap_307_fail
+    ($I12, $I11) = rx292_cur."!mark_peek"($I10)
+    rx292_cur."!cursor_pos"($I11)
+    ($P10) = rx292_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx292_pos, "")
+    rx292_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("wu")
+    goto rxcap_307_done
+  rxcap_307_fail:
+    goto rx292_fail
+  rxcap_307_done:
+  # rx charclass s
+    ge rx292_pos, rx292_eos, rx292_fail
+    sub $I10, rx292_pos, rx292_off
+    is_cclass $I11, 32, rx292_tgt, $I10
+    unless $I11, rx292_fail
+    inc rx292_pos
+  # rx subrule "ws" subtype=method negate=
+    rx292_cur."!cursor_pos"(rx292_pos)
+    $P10 = rx292_cur."ws"()
+    unless $P10, rx292_fail
+    rx292_pos = $P10."pos"()
+  # rx subrule "EXPR" subtype=capture negate=
+    rx292_cur."!cursor_pos"(rx292_pos)
+    $P10 = rx292_cur."EXPR"()
+    unless $P10, rx292_fail
+    rx292_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("EXPR")
+    rx292_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx292_cur."!cursor_pos"(rx292_pos)
+    $P10 = rx292_cur."ws"()
+    unless $P10, rx292_fail
+    rx292_pos = $P10."pos"()
+  alt298_end:
+.annotate "line", 171
+  # rx subrule "ws" subtype=method negate=
+    rx292_cur."!cursor_pos"(rx292_pos)
+    $P10 = rx292_cur."ws"()
+    unless $P10, rx292_fail
+    rx292_pos = $P10."pos"()
+.annotate "line", 166
+  # rx pass
+    rx292_cur."!cursor_pass"(rx292_pos, "statement_control:sym<repeat>")
+    rx292_cur."!cursor_debug"("PASS  ", "statement_control:sym<repeat>", " at pos=", rx292_pos)
+    .return (rx292_cur)
+  rx292_fail:
+.annotate "line", 4
+    (rx292_rep, rx292_pos, $I10, $P10) = rx292_cur."!mark_fail"(0)
+    lt rx292_pos, -1, rx292_done
+    eq rx292_pos, -1, rx292_fail
+    jump $I10
+  rx292_done:
+    rx292_cur."!cursor_fail"()
+    rx292_cur."!cursor_debug"("FAIL  ", "statement_control:sym<repeat>")
+    .return (rx292_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__statement_control:sym<repeat>"  :subid("68_1261064023.05912") :method
+.annotate "line", 4
+    new $P294, "ResizablePMCArray"
+    push $P294, "repeat"
+    .return ($P294)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "statement_control:sym<for>"  :subid("69_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx312_tgt
+    .local int rx312_pos
+    .local int rx312_off
+    .local int rx312_eos
+    .local int rx312_rep
+    .local pmc rx312_cur
+    (rx312_cur, rx312_pos, rx312_tgt) = self."!cursor_start"()
+    rx312_cur."!cursor_debug"("START ", "statement_control:sym<for>")
+    .lex unicode:"$\x{a2}", rx312_cur
+    .local pmc match
+    .lex "$/", match
+    length rx312_eos, rx312_tgt
+    set rx312_off, 0
+    lt rx312_pos, 2, rx312_start
+    sub rx312_off, rx312_pos, 1
+    substr rx312_tgt, rx312_tgt, rx312_off
+  rx312_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan315_done
+    goto rxscan315_scan
+  rxscan315_loop:
+    ($P10) = rx312_cur."from"()
+    inc $P10
+    set rx312_pos, $P10
+    ge rx312_pos, rx312_eos, rxscan315_done
+  rxscan315_scan:
+    set_addr $I10, rxscan315_loop
+    rx312_cur."!mark_push"(0, rx312_pos, $I10)
+  rxscan315_done:
+.annotate "line", 175
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_316_fail
+    rx312_cur."!mark_push"(0, rx312_pos, $I10)
+  # rx literal  "for"
+    add $I11, rx312_pos, 3
+    gt $I11, rx312_eos, rx312_fail
+    sub $I11, rx312_pos, rx312_off
+    substr $S10, rx312_tgt, $I11, 3
+    ne $S10, "for", rx312_fail
+    add rx312_pos, 3
+    set_addr $I10, rxcap_316_fail
+    ($I12, $I11) = rx312_cur."!mark_peek"($I10)
+    rx312_cur."!cursor_pos"($I11)
+    ($P10) = rx312_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx312_pos, "")
+    rx312_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_316_done
+  rxcap_316_fail:
+    goto rx312_fail
+  rxcap_316_done:
+  # rx charclass s
+    ge rx312_pos, rx312_eos, rx312_fail
+    sub $I10, rx312_pos, rx312_off
+    is_cclass $I11, 32, rx312_tgt, $I10
+    unless $I11, rx312_fail
+    inc rx312_pos
+  # rx subrule "ws" subtype=method negate=
+    rx312_cur."!cursor_pos"(rx312_pos)
+    $P10 = rx312_cur."ws"()
+    unless $P10, rx312_fail
+    rx312_pos = $P10."pos"()
+.annotate "line", 176
+  # rx subrule "xblock" subtype=capture negate=
+    rx312_cur."!cursor_pos"(rx312_pos)
+    $P10 = rx312_cur."xblock"()
+    unless $P10, rx312_fail
+    rx312_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("xblock")
+    rx312_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx312_cur."!cursor_pos"(rx312_pos)
+    $P10 = rx312_cur."ws"()
+    unless $P10, rx312_fail
+    rx312_pos = $P10."pos"()
+.annotate "line", 174
+  # rx pass
+    rx312_cur."!cursor_pass"(rx312_pos, "statement_control:sym<for>")
+    rx312_cur."!cursor_debug"("PASS  ", "statement_control:sym<for>", " at pos=", rx312_pos)
+    .return (rx312_cur)
+  rx312_fail:
+.annotate "line", 4
+    (rx312_rep, rx312_pos, $I10, $P10) = rx312_cur."!mark_fail"(0)
+    lt rx312_pos, -1, rx312_done
+    eq rx312_pos, -1, rx312_fail
+    jump $I10
+  rx312_done:
+    rx312_cur."!cursor_fail"()
+    rx312_cur."!cursor_debug"("FAIL  ", "statement_control:sym<for>")
+    .return (rx312_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__statement_control:sym<for>"  :subid("70_1261064023.05912") :method
+.annotate "line", 4
+    new $P314, "ResizablePMCArray"
+    push $P314, "for"
+    .return ($P314)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "statement_control:sym<CATCH>"  :subid("71_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx320_tgt
+    .local int rx320_pos
+    .local int rx320_off
+    .local int rx320_eos
+    .local int rx320_rep
+    .local pmc rx320_cur
+    (rx320_cur, rx320_pos, rx320_tgt) = self."!cursor_start"()
+    rx320_cur."!cursor_debug"("START ", "statement_control:sym<CATCH>")
+    .lex unicode:"$\x{a2}", rx320_cur
+    .local pmc match
+    .lex "$/", match
+    length rx320_eos, rx320_tgt
+    set rx320_off, 0
+    lt rx320_pos, 2, rx320_start
+    sub rx320_off, rx320_pos, 1
+    substr rx320_tgt, rx320_tgt, rx320_off
+  rx320_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan323_done
+    goto rxscan323_scan
+  rxscan323_loop:
+    ($P10) = rx320_cur."from"()
+    inc $P10
+    set rx320_pos, $P10
+    ge rx320_pos, rx320_eos, rxscan323_done
+  rxscan323_scan:
+    set_addr $I10, rxscan323_loop
+    rx320_cur."!mark_push"(0, rx320_pos, $I10)
+  rxscan323_done:
+.annotate "line", 180
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_324_fail
+    rx320_cur."!mark_push"(0, rx320_pos, $I10)
+  # rx literal  "CATCH"
+    add $I11, rx320_pos, 5
+    gt $I11, rx320_eos, rx320_fail
+    sub $I11, rx320_pos, rx320_off
+    substr $S10, rx320_tgt, $I11, 5
+    ne $S10, "CATCH", rx320_fail
+    add rx320_pos, 5
+    set_addr $I10, rxcap_324_fail
+    ($I12, $I11) = rx320_cur."!mark_peek"($I10)
+    rx320_cur."!cursor_pos"($I11)
+    ($P10) = rx320_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx320_pos, "")
+    rx320_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_324_done
+  rxcap_324_fail:
+    goto rx320_fail
+  rxcap_324_done:
+  # rx charclass s
+    ge rx320_pos, rx320_eos, rx320_fail
+    sub $I10, rx320_pos, rx320_off
+    is_cclass $I11, 32, rx320_tgt, $I10
+    unless $I11, rx320_fail
+    inc rx320_pos
+  # rx subrule "ws" subtype=method negate=
+    rx320_cur."!cursor_pos"(rx320_pos)
+    $P10 = rx320_cur."ws"()
+    unless $P10, rx320_fail
+    rx320_pos = $P10."pos"()
+.annotate "line", 181
+  # rx subrule "block" subtype=capture negate=
+    rx320_cur."!cursor_pos"(rx320_pos)
+    $P10 = rx320_cur."block"()
+    unless $P10, rx320_fail
+    rx320_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("block")
+    rx320_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx320_cur."!cursor_pos"(rx320_pos)
+    $P10 = rx320_cur."ws"()
+    unless $P10, rx320_fail
+    rx320_pos = $P10."pos"()
+.annotate "line", 179
+  # rx pass
+    rx320_cur."!cursor_pass"(rx320_pos, "statement_control:sym<CATCH>")
+    rx320_cur."!cursor_debug"("PASS  ", "statement_control:sym<CATCH>", " at pos=", rx320_pos)
+    .return (rx320_cur)
+  rx320_fail:
+.annotate "line", 4
+    (rx320_rep, rx320_pos, $I10, $P10) = rx320_cur."!mark_fail"(0)
+    lt rx320_pos, -1, rx320_done
+    eq rx320_pos, -1, rx320_fail
+    jump $I10
+  rx320_done:
+    rx320_cur."!cursor_fail"()
+    rx320_cur."!cursor_debug"("FAIL  ", "statement_control:sym<CATCH>")
+    .return (rx320_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__statement_control:sym<CATCH>"  :subid("72_1261064023.05912") :method
+.annotate "line", 4
+    new $P322, "ResizablePMCArray"
+    push $P322, "CATCH"
+    .return ($P322)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "statement_control:sym<CONTROL>"  :subid("73_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx328_tgt
+    .local int rx328_pos
+    .local int rx328_off
+    .local int rx328_eos
+    .local int rx328_rep
+    .local pmc rx328_cur
+    (rx328_cur, rx328_pos, rx328_tgt) = self."!cursor_start"()
+    rx328_cur."!cursor_debug"("START ", "statement_control:sym<CONTROL>")
+    .lex unicode:"$\x{a2}", rx328_cur
+    .local pmc match
+    .lex "$/", match
+    length rx328_eos, rx328_tgt
+    set rx328_off, 0
+    lt rx328_pos, 2, rx328_start
+    sub rx328_off, rx328_pos, 1
+    substr rx328_tgt, rx328_tgt, rx328_off
+  rx328_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan331_done
+    goto rxscan331_scan
+  rxscan331_loop:
+    ($P10) = rx328_cur."from"()
+    inc $P10
+    set rx328_pos, $P10
+    ge rx328_pos, rx328_eos, rxscan331_done
+  rxscan331_scan:
+    set_addr $I10, rxscan331_loop
+    rx328_cur."!mark_push"(0, rx328_pos, $I10)
+  rxscan331_done:
+.annotate "line", 185
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_332_fail
+    rx328_cur."!mark_push"(0, rx328_pos, $I10)
+  # rx literal  "CONTROL"
+    add $I11, rx328_pos, 7
+    gt $I11, rx328_eos, rx328_fail
+    sub $I11, rx328_pos, rx328_off
+    substr $S10, rx328_tgt, $I11, 7
+    ne $S10, "CONTROL", rx328_fail
+    add rx328_pos, 7
+    set_addr $I10, rxcap_332_fail
+    ($I12, $I11) = rx328_cur."!mark_peek"($I10)
+    rx328_cur."!cursor_pos"($I11)
+    ($P10) = rx328_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx328_pos, "")
+    rx328_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_332_done
+  rxcap_332_fail:
+    goto rx328_fail
+  rxcap_332_done:
+  # rx charclass s
+    ge rx328_pos, rx328_eos, rx328_fail
+    sub $I10, rx328_pos, rx328_off
+    is_cclass $I11, 32, rx328_tgt, $I10
+    unless $I11, rx328_fail
+    inc rx328_pos
+  # rx subrule "ws" subtype=method negate=
+    rx328_cur."!cursor_pos"(rx328_pos)
+    $P10 = rx328_cur."ws"()
+    unless $P10, rx328_fail
+    rx328_pos = $P10."pos"()
+.annotate "line", 186
+  # rx subrule "block" subtype=capture negate=
+    rx328_cur."!cursor_pos"(rx328_pos)
+    $P10 = rx328_cur."block"()
+    unless $P10, rx328_fail
+    rx328_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("block")
+    rx328_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx328_cur."!cursor_pos"(rx328_pos)
+    $P10 = rx328_cur."ws"()
+    unless $P10, rx328_fail
+    rx328_pos = $P10."pos"()
+.annotate "line", 184
+  # rx pass
+    rx328_cur."!cursor_pass"(rx328_pos, "statement_control:sym<CONTROL>")
+    rx328_cur."!cursor_debug"("PASS  ", "statement_control:sym<CONTROL>", " at pos=", rx328_pos)
+    .return (rx328_cur)
+  rx328_fail:
+.annotate "line", 4
+    (rx328_rep, rx328_pos, $I10, $P10) = rx328_cur."!mark_fail"(0)
+    lt rx328_pos, -1, rx328_done
+    eq rx328_pos, -1, rx328_fail
+    jump $I10
+  rx328_done:
+    rx328_cur."!cursor_fail"()
+    rx328_cur."!cursor_debug"("FAIL  ", "statement_control:sym<CONTROL>")
+    .return (rx328_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__statement_control:sym<CONTROL>"  :subid("74_1261064023.05912") :method
+.annotate "line", 4
+    new $P330, "ResizablePMCArray"
+    push $P330, "CONTROL"
+    .return ($P330)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "statement_prefix"  :subid("75_1261064023.05912") :method
+.annotate "line", 189
+    $P336 = self."!protoregex"("statement_prefix")
+    .return ($P336)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__statement_prefix"  :subid("76_1261064023.05912") :method
+.annotate "line", 189
+    $P338 = self."!PREFIX__!protoregex"("statement_prefix")
+    .return ($P338)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "statement_prefix:sym<INIT>"  :subid("77_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx340_tgt
+    .local int rx340_pos
+    .local int rx340_off
+    .local int rx340_eos
+    .local int rx340_rep
+    .local pmc rx340_cur
+    (rx340_cur, rx340_pos, rx340_tgt) = self."!cursor_start"()
+    rx340_cur."!cursor_debug"("START ", "statement_prefix:sym<INIT>")
+    .lex unicode:"$\x{a2}", rx340_cur
+    .local pmc match
+    .lex "$/", match
+    length rx340_eos, rx340_tgt
+    set rx340_off, 0
+    lt rx340_pos, 2, rx340_start
+    sub rx340_off, rx340_pos, 1
+    substr rx340_tgt, rx340_tgt, rx340_off
+  rx340_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan344_done
+    goto rxscan344_scan
+  rxscan344_loop:
+    ($P10) = rx340_cur."from"()
+    inc $P10
+    set rx340_pos, $P10
+    ge rx340_pos, rx340_eos, rxscan344_done
+  rxscan344_scan:
+    set_addr $I10, rxscan344_loop
+    rx340_cur."!mark_push"(0, rx340_pos, $I10)
+  rxscan344_done:
+.annotate "line", 190
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_345_fail
+    rx340_cur."!mark_push"(0, rx340_pos, $I10)
+  # rx literal  "INIT"
+    add $I11, rx340_pos, 4
+    gt $I11, rx340_eos, rx340_fail
+    sub $I11, rx340_pos, rx340_off
+    substr $S10, rx340_tgt, $I11, 4
+    ne $S10, "INIT", rx340_fail
+    add rx340_pos, 4
+    set_addr $I10, rxcap_345_fail
+    ($I12, $I11) = rx340_cur."!mark_peek"($I10)
+    rx340_cur."!cursor_pos"($I11)
+    ($P10) = rx340_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx340_pos, "")
+    rx340_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_345_done
+  rxcap_345_fail:
+    goto rx340_fail
+  rxcap_345_done:
+  # rx subrule "blorst" subtype=capture negate=
+    rx340_cur."!cursor_pos"(rx340_pos)
+    $P10 = rx340_cur."blorst"()
+    unless $P10, rx340_fail
+    rx340_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("blorst")
+    rx340_pos = $P10."pos"()
+  # rx pass
+    rx340_cur."!cursor_pass"(rx340_pos, "statement_prefix:sym<INIT>")
+    rx340_cur."!cursor_debug"("PASS  ", "statement_prefix:sym<INIT>", " at pos=", rx340_pos)
+    .return (rx340_cur)
+  rx340_fail:
+.annotate "line", 4
+    (rx340_rep, rx340_pos, $I10, $P10) = rx340_cur."!mark_fail"(0)
+    lt rx340_pos, -1, rx340_done
+    eq rx340_pos, -1, rx340_fail
+    jump $I10
+  rx340_done:
+    rx340_cur."!cursor_fail"()
+    rx340_cur."!cursor_debug"("FAIL  ", "statement_prefix:sym<INIT>")
+    .return (rx340_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__statement_prefix:sym<INIT>"  :subid("78_1261064023.05912") :method
+.annotate "line", 4
+    $P342 = self."!PREFIX__!subrule"("blorst", "INIT")
+    new $P343, "ResizablePMCArray"
+    push $P343, $P342
+    .return ($P343)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "statement_prefix:sym<try>"  :subid("79_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx347_tgt
+    .local int rx347_pos
+    .local int rx347_off
+    .local int rx347_eos
+    .local int rx347_rep
+    .local pmc rx347_cur
+    (rx347_cur, rx347_pos, rx347_tgt) = self."!cursor_start"()
+    rx347_cur."!cursor_debug"("START ", "statement_prefix:sym<try>")
+    .lex unicode:"$\x{a2}", rx347_cur
+    .local pmc match
+    .lex "$/", match
+    length rx347_eos, rx347_tgt
+    set rx347_off, 0
+    lt rx347_pos, 2, rx347_start
+    sub rx347_off, rx347_pos, 1
+    substr rx347_tgt, rx347_tgt, rx347_off
+  rx347_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan351_done
+    goto rxscan351_scan
+  rxscan351_loop:
+    ($P10) = rx347_cur."from"()
+    inc $P10
+    set rx347_pos, $P10
+    ge rx347_pos, rx347_eos, rxscan351_done
+  rxscan351_scan:
+    set_addr $I10, rxscan351_loop
+    rx347_cur."!mark_push"(0, rx347_pos, $I10)
+  rxscan351_done:
+.annotate "line", 193
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_352_fail
+    rx347_cur."!mark_push"(0, rx347_pos, $I10)
+  # rx literal  "try"
+    add $I11, rx347_pos, 3
+    gt $I11, rx347_eos, rx347_fail
+    sub $I11, rx347_pos, rx347_off
+    substr $S10, rx347_tgt, $I11, 3
+    ne $S10, "try", rx347_fail
+    add rx347_pos, 3
+    set_addr $I10, rxcap_352_fail
+    ($I12, $I11) = rx347_cur."!mark_peek"($I10)
+    rx347_cur."!cursor_pos"($I11)
+    ($P10) = rx347_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx347_pos, "")
+    rx347_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_352_done
+  rxcap_352_fail:
+    goto rx347_fail
+  rxcap_352_done:
+.annotate "line", 194
+  # rx subrule "blorst" subtype=capture negate=
+    rx347_cur."!cursor_pos"(rx347_pos)
+    $P10 = rx347_cur."blorst"()
+    unless $P10, rx347_fail
+    rx347_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("blorst")
+    rx347_pos = $P10."pos"()
+.annotate "line", 192
+  # rx pass
+    rx347_cur."!cursor_pass"(rx347_pos, "statement_prefix:sym<try>")
+    rx347_cur."!cursor_debug"("PASS  ", "statement_prefix:sym<try>", " at pos=", rx347_pos)
+    .return (rx347_cur)
+  rx347_fail:
+.annotate "line", 4
+    (rx347_rep, rx347_pos, $I10, $P10) = rx347_cur."!mark_fail"(0)
+    lt rx347_pos, -1, rx347_done
+    eq rx347_pos, -1, rx347_fail
+    jump $I10
+  rx347_done:
+    rx347_cur."!cursor_fail"()
+    rx347_cur."!cursor_debug"("FAIL  ", "statement_prefix:sym<try>")
+    .return (rx347_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__statement_prefix:sym<try>"  :subid("80_1261064023.05912") :method
+.annotate "line", 4
+    $P349 = self."!PREFIX__!subrule"("blorst", "try")
+    new $P350, "ResizablePMCArray"
+    push $P350, $P349
+    .return ($P350)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "blorst"  :subid("81_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx354_tgt
+    .local int rx354_pos
+    .local int rx354_off
+    .local int rx354_eos
+    .local int rx354_rep
+    .local pmc rx354_cur
+    (rx354_cur, rx354_pos, rx354_tgt) = self."!cursor_start"()
+    rx354_cur."!cursor_debug"("START ", "blorst")
+    .lex unicode:"$\x{a2}", rx354_cur
+    .local pmc match
+    .lex "$/", match
+    length rx354_eos, rx354_tgt
+    set rx354_off, 0
+    lt rx354_pos, 2, rx354_start
+    sub rx354_off, rx354_pos, 1
+    substr rx354_tgt, rx354_tgt, rx354_off
+  rx354_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan357_done
+    goto rxscan357_scan
+  rxscan357_loop:
+    ($P10) = rx354_cur."from"()
+    inc $P10
+    set rx354_pos, $P10
+    ge rx354_pos, rx354_eos, rxscan357_done
+  rxscan357_scan:
+    set_addr $I10, rxscan357_loop
+    rx354_cur."!mark_push"(0, rx354_pos, $I10)
+  rxscan357_done:
+.annotate "line", 198
+  # rx charclass s
+    ge rx354_pos, rx354_eos, rx354_fail
+    sub $I10, rx354_pos, rx354_off
+    is_cclass $I11, 32, rx354_tgt, $I10
+    unless $I11, rx354_fail
+    inc rx354_pos
+  # rx subrule "ws" subtype=method negate=
+    rx354_cur."!cursor_pos"(rx354_pos)
+    $P10 = rx354_cur."ws"()
+    unless $P10, rx354_fail
+    rx354_pos = $P10."pos"()
+  alt358_0:
+    set_addr $I10, alt358_1
+    rx354_cur."!mark_push"(0, rx354_pos, $I10)
+  # rx enumcharlist negate=0 zerowidth
+    ge rx354_pos, rx354_eos, rx354_fail
+    sub $I10, rx354_pos, rx354_off
+    substr $S10, rx354_tgt, $I10, 1
+    index $I11, "{", $S10
+    lt $I11, 0, rx354_fail
+  # rx subrule "block" subtype=capture negate=
+    rx354_cur."!cursor_pos"(rx354_pos)
+    $P10 = rx354_cur."block"()
+    unless $P10, rx354_fail
+    rx354_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("block")
+    rx354_pos = $P10."pos"()
+    goto alt358_end
+  alt358_1:
+  # rx subrule "statement" subtype=capture negate=
+    rx354_cur."!cursor_pos"(rx354_pos)
+    $P10 = rx354_cur."statement"()
+    unless $P10, rx354_fail
+    rx354_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("statement")
+    rx354_pos = $P10."pos"()
+  alt358_end:
+.annotate "line", 197
+  # rx pass
+    rx354_cur."!cursor_pass"(rx354_pos, "blorst")
+    rx354_cur."!cursor_debug"("PASS  ", "blorst", " at pos=", rx354_pos)
+    .return (rx354_cur)
+  rx354_fail:
+.annotate "line", 4
+    (rx354_rep, rx354_pos, $I10, $P10) = rx354_cur."!mark_fail"(0)
+    lt rx354_pos, -1, rx354_done
+    eq rx354_pos, -1, rx354_fail
+    jump $I10
+  rx354_done:
+    rx354_cur."!cursor_fail"()
+    rx354_cur."!cursor_debug"("FAIL  ", "blorst")
+    .return (rx354_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__blorst"  :subid("82_1261064023.05912") :method
+.annotate "line", 4
+    new $P356, "ResizablePMCArray"
+    push $P356, ""
+    .return ($P356)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "statement_mod_cond"  :subid("83_1261064023.05912") :method
+.annotate "line", 203
+    $P360 = self."!protoregex"("statement_mod_cond")
+    .return ($P360)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__statement_mod_cond"  :subid("84_1261064023.05912") :method
+.annotate "line", 203
+    $P362 = self."!PREFIX__!protoregex"("statement_mod_cond")
+    .return ($P362)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "statement_mod_cond:sym<if>"  :subid("85_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx364_tgt
+    .local int rx364_pos
+    .local int rx364_off
+    .local int rx364_eos
+    .local int rx364_rep
+    .local pmc rx364_cur
+    (rx364_cur, rx364_pos, rx364_tgt) = self."!cursor_start"()
+    rx364_cur."!cursor_debug"("START ", "statement_mod_cond:sym<if>")
+    .lex unicode:"$\x{a2}", rx364_cur
+    .local pmc match
+    .lex "$/", match
+    length rx364_eos, rx364_tgt
+    set rx364_off, 0
+    lt rx364_pos, 2, rx364_start
+    sub rx364_off, rx364_pos, 1
+    substr rx364_tgt, rx364_tgt, rx364_off
+  rx364_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan367_done
+    goto rxscan367_scan
+  rxscan367_loop:
+    ($P10) = rx364_cur."from"()
+    inc $P10
+    set rx364_pos, $P10
+    ge rx364_pos, rx364_eos, rxscan367_done
+  rxscan367_scan:
+    set_addr $I10, rxscan367_loop
+    rx364_cur."!mark_push"(0, rx364_pos, $I10)
+  rxscan367_done:
+.annotate "line", 205
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_368_fail
+    rx364_cur."!mark_push"(0, rx364_pos, $I10)
+  # rx literal  "if"
+    add $I11, rx364_pos, 2
+    gt $I11, rx364_eos, rx364_fail
+    sub $I11, rx364_pos, rx364_off
+    substr $S10, rx364_tgt, $I11, 2
+    ne $S10, "if", rx364_fail
+    add rx364_pos, 2
+    set_addr $I10, rxcap_368_fail
+    ($I12, $I11) = rx364_cur."!mark_peek"($I10)
+    rx364_cur."!cursor_pos"($I11)
+    ($P10) = rx364_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx364_pos, "")
+    rx364_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_368_done
+  rxcap_368_fail:
+    goto rx364_fail
+  rxcap_368_done:
+  # rx subrule "ws" subtype=method negate=
+    rx364_cur."!cursor_pos"(rx364_pos)
+    $P10 = rx364_cur."ws"()
+    unless $P10, rx364_fail
+    rx364_pos = $P10."pos"()
+  # rx subrule "EXPR" subtype=capture negate=
+    rx364_cur."!cursor_pos"(rx364_pos)
+    $P10 = rx364_cur."EXPR"()
+    unless $P10, rx364_fail
+    rx364_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("cond")
+    rx364_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx364_cur."!cursor_pos"(rx364_pos)
+    $P10 = rx364_cur."ws"()
+    unless $P10, rx364_fail
+    rx364_pos = $P10."pos"()
+  # rx pass
+    rx364_cur."!cursor_pass"(rx364_pos, "statement_mod_cond:sym<if>")
+    rx364_cur."!cursor_debug"("PASS  ", "statement_mod_cond:sym<if>", " at pos=", rx364_pos)
+    .return (rx364_cur)
+  rx364_fail:
+.annotate "line", 4
+    (rx364_rep, rx364_pos, $I10, $P10) = rx364_cur."!mark_fail"(0)
+    lt rx364_pos, -1, rx364_done
+    eq rx364_pos, -1, rx364_fail
+    jump $I10
+  rx364_done:
+    rx364_cur."!cursor_fail"()
+    rx364_cur."!cursor_debug"("FAIL  ", "statement_mod_cond:sym<if>")
+    .return (rx364_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__statement_mod_cond:sym<if>"  :subid("86_1261064023.05912") :method
+.annotate "line", 4
+    new $P366, "ResizablePMCArray"
+    push $P366, "if"
+    .return ($P366)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "statement_mod_cond:sym<unless>"  :subid("87_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx372_tgt
+    .local int rx372_pos
+    .local int rx372_off
+    .local int rx372_eos
+    .local int rx372_rep
+    .local pmc rx372_cur
+    (rx372_cur, rx372_pos, rx372_tgt) = self."!cursor_start"()
+    rx372_cur."!cursor_debug"("START ", "statement_mod_cond:sym<unless>")
+    .lex unicode:"$\x{a2}", rx372_cur
+    .local pmc match
+    .lex "$/", match
+    length rx372_eos, rx372_tgt
+    set rx372_off, 0
+    lt rx372_pos, 2, rx372_start
+    sub rx372_off, rx372_pos, 1
+    substr rx372_tgt, rx372_tgt, rx372_off
+  rx372_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan375_done
+    goto rxscan375_scan
+  rxscan375_loop:
+    ($P10) = rx372_cur."from"()
+    inc $P10
+    set rx372_pos, $P10
+    ge rx372_pos, rx372_eos, rxscan375_done
+  rxscan375_scan:
+    set_addr $I10, rxscan375_loop
+    rx372_cur."!mark_push"(0, rx372_pos, $I10)
+  rxscan375_done:
+.annotate "line", 206
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_376_fail
+    rx372_cur."!mark_push"(0, rx372_pos, $I10)
+  # rx literal  "unless"
+    add $I11, rx372_pos, 6
+    gt $I11, rx372_eos, rx372_fail
+    sub $I11, rx372_pos, rx372_off
+    substr $S10, rx372_tgt, $I11, 6
+    ne $S10, "unless", rx372_fail
+    add rx372_pos, 6
+    set_addr $I10, rxcap_376_fail
+    ($I12, $I11) = rx372_cur."!mark_peek"($I10)
+    rx372_cur."!cursor_pos"($I11)
+    ($P10) = rx372_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx372_pos, "")
+    rx372_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_376_done
+  rxcap_376_fail:
+    goto rx372_fail
+  rxcap_376_done:
+  # rx subrule "ws" subtype=method negate=
+    rx372_cur."!cursor_pos"(rx372_pos)
+    $P10 = rx372_cur."ws"()
+    unless $P10, rx372_fail
+    rx372_pos = $P10."pos"()
+  # rx subrule "EXPR" subtype=capture negate=
+    rx372_cur."!cursor_pos"(rx372_pos)
+    $P10 = rx372_cur."EXPR"()
+    unless $P10, rx372_fail
+    rx372_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("cond")
+    rx372_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx372_cur."!cursor_pos"(rx372_pos)
+    $P10 = rx372_cur."ws"()
+    unless $P10, rx372_fail
+    rx372_pos = $P10."pos"()
+  # rx pass
+    rx372_cur."!cursor_pass"(rx372_pos, "statement_mod_cond:sym<unless>")
+    rx372_cur."!cursor_debug"("PASS  ", "statement_mod_cond:sym<unless>", " at pos=", rx372_pos)
+    .return (rx372_cur)
+  rx372_fail:
+.annotate "line", 4
+    (rx372_rep, rx372_pos, $I10, $P10) = rx372_cur."!mark_fail"(0)
+    lt rx372_pos, -1, rx372_done
+    eq rx372_pos, -1, rx372_fail
+    jump $I10
+  rx372_done:
+    rx372_cur."!cursor_fail"()
+    rx372_cur."!cursor_debug"("FAIL  ", "statement_mod_cond:sym<unless>")
+    .return (rx372_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__statement_mod_cond:sym<unless>"  :subid("88_1261064023.05912") :method
+.annotate "line", 4
+    new $P374, "ResizablePMCArray"
+    push $P374, "unless"
+    .return ($P374)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "statement_mod_loop"  :subid("89_1261064023.05912") :method
+.annotate "line", 208
+    $P380 = self."!protoregex"("statement_mod_loop")
+    .return ($P380)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__statement_mod_loop"  :subid("90_1261064023.05912") :method
+.annotate "line", 208
+    $P382 = self."!PREFIX__!protoregex"("statement_mod_loop")
+    .return ($P382)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "statement_mod_loop:sym<while>"  :subid("91_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx384_tgt
+    .local int rx384_pos
+    .local int rx384_off
+    .local int rx384_eos
+    .local int rx384_rep
+    .local pmc rx384_cur
+    (rx384_cur, rx384_pos, rx384_tgt) = self."!cursor_start"()
+    rx384_cur."!cursor_debug"("START ", "statement_mod_loop:sym<while>")
+    .lex unicode:"$\x{a2}", rx384_cur
+    .local pmc match
+    .lex "$/", match
+    length rx384_eos, rx384_tgt
+    set rx384_off, 0
+    lt rx384_pos, 2, rx384_start
+    sub rx384_off, rx384_pos, 1
+    substr rx384_tgt, rx384_tgt, rx384_off
+  rx384_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan387_done
+    goto rxscan387_scan
+  rxscan387_loop:
+    ($P10) = rx384_cur."from"()
+    inc $P10
+    set rx384_pos, $P10
+    ge rx384_pos, rx384_eos, rxscan387_done
+  rxscan387_scan:
+    set_addr $I10, rxscan387_loop
+    rx384_cur."!mark_push"(0, rx384_pos, $I10)
+  rxscan387_done:
+.annotate "line", 210
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_388_fail
+    rx384_cur."!mark_push"(0, rx384_pos, $I10)
+  # rx literal  "while"
+    add $I11, rx384_pos, 5
+    gt $I11, rx384_eos, rx384_fail
+    sub $I11, rx384_pos, rx384_off
+    substr $S10, rx384_tgt, $I11, 5
+    ne $S10, "while", rx384_fail
+    add rx384_pos, 5
+    set_addr $I10, rxcap_388_fail
+    ($I12, $I11) = rx384_cur."!mark_peek"($I10)
+    rx384_cur."!cursor_pos"($I11)
+    ($P10) = rx384_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx384_pos, "")
+    rx384_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_388_done
+  rxcap_388_fail:
+    goto rx384_fail
+  rxcap_388_done:
+  # rx subrule "ws" subtype=method negate=
+    rx384_cur."!cursor_pos"(rx384_pos)
+    $P10 = rx384_cur."ws"()
+    unless $P10, rx384_fail
+    rx384_pos = $P10."pos"()
+  # rx subrule "EXPR" subtype=capture negate=
+    rx384_cur."!cursor_pos"(rx384_pos)
+    $P10 = rx384_cur."EXPR"()
+    unless $P10, rx384_fail
+    rx384_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("cond")
+    rx384_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx384_cur."!cursor_pos"(rx384_pos)
+    $P10 = rx384_cur."ws"()
+    unless $P10, rx384_fail
+    rx384_pos = $P10."pos"()
+  # rx pass
+    rx384_cur."!cursor_pass"(rx384_pos, "statement_mod_loop:sym<while>")
+    rx384_cur."!cursor_debug"("PASS  ", "statement_mod_loop:sym<while>", " at pos=", rx384_pos)
+    .return (rx384_cur)
+  rx384_fail:
+.annotate "line", 4
+    (rx384_rep, rx384_pos, $I10, $P10) = rx384_cur."!mark_fail"(0)
+    lt rx384_pos, -1, rx384_done
+    eq rx384_pos, -1, rx384_fail
+    jump $I10
+  rx384_done:
+    rx384_cur."!cursor_fail"()
+    rx384_cur."!cursor_debug"("FAIL  ", "statement_mod_loop:sym<while>")
+    .return (rx384_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__statement_mod_loop:sym<while>"  :subid("92_1261064023.05912") :method
+.annotate "line", 4
+    new $P386, "ResizablePMCArray"
+    push $P386, "while"
+    .return ($P386)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "statement_mod_loop:sym<until>"  :subid("93_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx392_tgt
+    .local int rx392_pos
+    .local int rx392_off
+    .local int rx392_eos
+    .local int rx392_rep
+    .local pmc rx392_cur
+    (rx392_cur, rx392_pos, rx392_tgt) = self."!cursor_start"()
+    rx392_cur."!cursor_debug"("START ", "statement_mod_loop:sym<until>")
+    .lex unicode:"$\x{a2}", rx392_cur
+    .local pmc match
+    .lex "$/", match
+    length rx392_eos, rx392_tgt
+    set rx392_off, 0
+    lt rx392_pos, 2, rx392_start
+    sub rx392_off, rx392_pos, 1
+    substr rx392_tgt, rx392_tgt, rx392_off
+  rx392_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan395_done
+    goto rxscan395_scan
+  rxscan395_loop:
+    ($P10) = rx392_cur."from"()
+    inc $P10
+    set rx392_pos, $P10
+    ge rx392_pos, rx392_eos, rxscan395_done
+  rxscan395_scan:
+    set_addr $I10, rxscan395_loop
+    rx392_cur."!mark_push"(0, rx392_pos, $I10)
+  rxscan395_done:
+.annotate "line", 211
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_396_fail
+    rx392_cur."!mark_push"(0, rx392_pos, $I10)
+  # rx literal  "until"
+    add $I11, rx392_pos, 5
+    gt $I11, rx392_eos, rx392_fail
+    sub $I11, rx392_pos, rx392_off
+    substr $S10, rx392_tgt, $I11, 5
+    ne $S10, "until", rx392_fail
+    add rx392_pos, 5
+    set_addr $I10, rxcap_396_fail
+    ($I12, $I11) = rx392_cur."!mark_peek"($I10)
+    rx392_cur."!cursor_pos"($I11)
+    ($P10) = rx392_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx392_pos, "")
+    rx392_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_396_done
+  rxcap_396_fail:
+    goto rx392_fail
+  rxcap_396_done:
+  # rx subrule "ws" subtype=method negate=
+    rx392_cur."!cursor_pos"(rx392_pos)
+    $P10 = rx392_cur."ws"()
+    unless $P10, rx392_fail
+    rx392_pos = $P10."pos"()
+  # rx subrule "EXPR" subtype=capture negate=
+    rx392_cur."!cursor_pos"(rx392_pos)
+    $P10 = rx392_cur."EXPR"()
+    unless $P10, rx392_fail
+    rx392_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("cond")
+    rx392_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx392_cur."!cursor_pos"(rx392_pos)
+    $P10 = rx392_cur."ws"()
+    unless $P10, rx392_fail
+    rx392_pos = $P10."pos"()
+  # rx pass
+    rx392_cur."!cursor_pass"(rx392_pos, "statement_mod_loop:sym<until>")
+    rx392_cur."!cursor_debug"("PASS  ", "statement_mod_loop:sym<until>", " at pos=", rx392_pos)
+    .return (rx392_cur)
+  rx392_fail:
+.annotate "line", 4
+    (rx392_rep, rx392_pos, $I10, $P10) = rx392_cur."!mark_fail"(0)
+    lt rx392_pos, -1, rx392_done
+    eq rx392_pos, -1, rx392_fail
+    jump $I10
+  rx392_done:
+    rx392_cur."!cursor_fail"()
+    rx392_cur."!cursor_debug"("FAIL  ", "statement_mod_loop:sym<until>")
+    .return (rx392_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__statement_mod_loop:sym<until>"  :subid("94_1261064023.05912") :method
+.annotate "line", 4
+    new $P394, "ResizablePMCArray"
+    push $P394, "until"
+    .return ($P394)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "term:sym<fatarrow>"  :subid("95_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx400_tgt
+    .local int rx400_pos
+    .local int rx400_off
+    .local int rx400_eos
+    .local int rx400_rep
+    .local pmc rx400_cur
+    (rx400_cur, rx400_pos, rx400_tgt) = self."!cursor_start"()
+    rx400_cur."!cursor_debug"("START ", "term:sym<fatarrow>")
+    .lex unicode:"$\x{a2}", rx400_cur
+    .local pmc match
+    .lex "$/", match
+    length rx400_eos, rx400_tgt
+    set rx400_off, 0
+    lt rx400_pos, 2, rx400_start
+    sub rx400_off, rx400_pos, 1
+    substr rx400_tgt, rx400_tgt, rx400_off
+  rx400_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan404_done
+    goto rxscan404_scan
+  rxscan404_loop:
+    ($P10) = rx400_cur."from"()
+    inc $P10
+    set rx400_pos, $P10
+    ge rx400_pos, rx400_eos, rxscan404_done
+  rxscan404_scan:
+    set_addr $I10, rxscan404_loop
+    rx400_cur."!mark_push"(0, rx400_pos, $I10)
+  rxscan404_done:
+.annotate "line", 215
+  # rx subrule "fatarrow" subtype=capture negate=
+    rx400_cur."!cursor_pos"(rx400_pos)
+    $P10 = rx400_cur."fatarrow"()
+    unless $P10, rx400_fail
+    rx400_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("fatarrow")
+    rx400_pos = $P10."pos"()
+  # rx pass
+    rx400_cur."!cursor_pass"(rx400_pos, "term:sym<fatarrow>")
+    rx400_cur."!cursor_debug"("PASS  ", "term:sym<fatarrow>", " at pos=", rx400_pos)
+    .return (rx400_cur)
+  rx400_fail:
+.annotate "line", 4
+    (rx400_rep, rx400_pos, $I10, $P10) = rx400_cur."!mark_fail"(0)
+    lt rx400_pos, -1, rx400_done
+    eq rx400_pos, -1, rx400_fail
+    jump $I10
+  rx400_done:
+    rx400_cur."!cursor_fail"()
+    rx400_cur."!cursor_debug"("FAIL  ", "term:sym<fatarrow>")
+    .return (rx400_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__term:sym<fatarrow>"  :subid("96_1261064023.05912") :method
+.annotate "line", 4
+    $P402 = self."!PREFIX__!subrule"("fatarrow", "")
+    new $P403, "ResizablePMCArray"
+    push $P403, $P402
+    .return ($P403)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "term:sym<colonpair>"  :subid("97_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx406_tgt
+    .local int rx406_pos
+    .local int rx406_off
+    .local int rx406_eos
+    .local int rx406_rep
+    .local pmc rx406_cur
+    (rx406_cur, rx406_pos, rx406_tgt) = self."!cursor_start"()
+    rx406_cur."!cursor_debug"("START ", "term:sym<colonpair>")
+    .lex unicode:"$\x{a2}", rx406_cur
+    .local pmc match
+    .lex "$/", match
+    length rx406_eos, rx406_tgt
+    set rx406_off, 0
+    lt rx406_pos, 2, rx406_start
+    sub rx406_off, rx406_pos, 1
+    substr rx406_tgt, rx406_tgt, rx406_off
+  rx406_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan410_done
+    goto rxscan410_scan
+  rxscan410_loop:
+    ($P10) = rx406_cur."from"()
+    inc $P10
+    set rx406_pos, $P10
+    ge rx406_pos, rx406_eos, rxscan410_done
+  rxscan410_scan:
+    set_addr $I10, rxscan410_loop
+    rx406_cur."!mark_push"(0, rx406_pos, $I10)
+  rxscan410_done:
+.annotate "line", 216
+  # rx subrule "colonpair" subtype=capture negate=
+    rx406_cur."!cursor_pos"(rx406_pos)
+    $P10 = rx406_cur."colonpair"()
+    unless $P10, rx406_fail
+    rx406_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("colonpair")
+    rx406_pos = $P10."pos"()
+  # rx pass
+    rx406_cur."!cursor_pass"(rx406_pos, "term:sym<colonpair>")
+    rx406_cur."!cursor_debug"("PASS  ", "term:sym<colonpair>", " at pos=", rx406_pos)
+    .return (rx406_cur)
+  rx406_fail:
+.annotate "line", 4
+    (rx406_rep, rx406_pos, $I10, $P10) = rx406_cur."!mark_fail"(0)
+    lt rx406_pos, -1, rx406_done
+    eq rx406_pos, -1, rx406_fail
+    jump $I10
+  rx406_done:
+    rx406_cur."!cursor_fail"()
+    rx406_cur."!cursor_debug"("FAIL  ", "term:sym<colonpair>")
+    .return (rx406_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__term:sym<colonpair>"  :subid("98_1261064023.05912") :method
+.annotate "line", 4
+    $P408 = self."!PREFIX__!subrule"("colonpair", "")
+    new $P409, "ResizablePMCArray"
+    push $P409, $P408
+    .return ($P409)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "term:sym<variable>"  :subid("99_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx412_tgt
+    .local int rx412_pos
+    .local int rx412_off
+    .local int rx412_eos
+    .local int rx412_rep
+    .local pmc rx412_cur
+    (rx412_cur, rx412_pos, rx412_tgt) = self."!cursor_start"()
+    rx412_cur."!cursor_debug"("START ", "term:sym<variable>")
+    .lex unicode:"$\x{a2}", rx412_cur
+    .local pmc match
+    .lex "$/", match
+    length rx412_eos, rx412_tgt
+    set rx412_off, 0
+    lt rx412_pos, 2, rx412_start
+    sub rx412_off, rx412_pos, 1
+    substr rx412_tgt, rx412_tgt, rx412_off
+  rx412_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan416_done
+    goto rxscan416_scan
+  rxscan416_loop:
+    ($P10) = rx412_cur."from"()
+    inc $P10
+    set rx412_pos, $P10
+    ge rx412_pos, rx412_eos, rxscan416_done
+  rxscan416_scan:
+    set_addr $I10, rxscan416_loop
+    rx412_cur."!mark_push"(0, rx412_pos, $I10)
+  rxscan416_done:
+.annotate "line", 217
+  # rx subrule "variable" subtype=capture negate=
+    rx412_cur."!cursor_pos"(rx412_pos)
+    $P10 = rx412_cur."variable"()
+    unless $P10, rx412_fail
+    rx412_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("variable")
+    rx412_pos = $P10."pos"()
+  # rx pass
+    rx412_cur."!cursor_pass"(rx412_pos, "term:sym<variable>")
+    rx412_cur."!cursor_debug"("PASS  ", "term:sym<variable>", " at pos=", rx412_pos)
+    .return (rx412_cur)
+  rx412_fail:
+.annotate "line", 4
+    (rx412_rep, rx412_pos, $I10, $P10) = rx412_cur."!mark_fail"(0)
+    lt rx412_pos, -1, rx412_done
+    eq rx412_pos, -1, rx412_fail
+    jump $I10
+  rx412_done:
+    rx412_cur."!cursor_fail"()
+    rx412_cur."!cursor_debug"("FAIL  ", "term:sym<variable>")
+    .return (rx412_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__term:sym<variable>"  :subid("100_1261064023.05912") :method
+.annotate "line", 4
+    $P414 = self."!PREFIX__!subrule"("variable", "")
+    new $P415, "ResizablePMCArray"
+    push $P415, $P414
+    .return ($P415)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "term:sym<package_declarator>"  :subid("101_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx418_tgt
+    .local int rx418_pos
+    .local int rx418_off
+    .local int rx418_eos
+    .local int rx418_rep
+    .local pmc rx418_cur
+    (rx418_cur, rx418_pos, rx418_tgt) = self."!cursor_start"()
+    rx418_cur."!cursor_debug"("START ", "term:sym<package_declarator>")
+    .lex unicode:"$\x{a2}", rx418_cur
+    .local pmc match
+    .lex "$/", match
+    length rx418_eos, rx418_tgt
+    set rx418_off, 0
+    lt rx418_pos, 2, rx418_start
+    sub rx418_off, rx418_pos, 1
+    substr rx418_tgt, rx418_tgt, rx418_off
+  rx418_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan422_done
+    goto rxscan422_scan
+  rxscan422_loop:
+    ($P10) = rx418_cur."from"()
+    inc $P10
+    set rx418_pos, $P10
+    ge rx418_pos, rx418_eos, rxscan422_done
+  rxscan422_scan:
+    set_addr $I10, rxscan422_loop
+    rx418_cur."!mark_push"(0, rx418_pos, $I10)
+  rxscan422_done:
+.annotate "line", 218
+  # rx subrule "package_declarator" subtype=capture negate=
+    rx418_cur."!cursor_pos"(rx418_pos)
+    $P10 = rx418_cur."package_declarator"()
+    unless $P10, rx418_fail
+    rx418_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("package_declarator")
+    rx418_pos = $P10."pos"()
+  # rx pass
+    rx418_cur."!cursor_pass"(rx418_pos, "term:sym<package_declarator>")
+    rx418_cur."!cursor_debug"("PASS  ", "term:sym<package_declarator>", " at pos=", rx418_pos)
+    .return (rx418_cur)
+  rx418_fail:
+.annotate "line", 4
+    (rx418_rep, rx418_pos, $I10, $P10) = rx418_cur."!mark_fail"(0)
+    lt rx418_pos, -1, rx418_done
+    eq rx418_pos, -1, rx418_fail
+    jump $I10
+  rx418_done:
+    rx418_cur."!cursor_fail"()
+    rx418_cur."!cursor_debug"("FAIL  ", "term:sym<package_declarator>")
+    .return (rx418_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__term:sym<package_declarator>"  :subid("102_1261064023.05912") :method
+.annotate "line", 4
+    $P420 = self."!PREFIX__!subrule"("package_declarator", "")
+    new $P421, "ResizablePMCArray"
+    push $P421, $P420
+    .return ($P421)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "term:sym<scope_declarator>"  :subid("103_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx424_tgt
+    .local int rx424_pos
+    .local int rx424_off
+    .local int rx424_eos
+    .local int rx424_rep
+    .local pmc rx424_cur
+    (rx424_cur, rx424_pos, rx424_tgt) = self."!cursor_start"()
+    rx424_cur."!cursor_debug"("START ", "term:sym<scope_declarator>")
+    .lex unicode:"$\x{a2}", rx424_cur
+    .local pmc match
+    .lex "$/", match
+    length rx424_eos, rx424_tgt
+    set rx424_off, 0
+    lt rx424_pos, 2, rx424_start
+    sub rx424_off, rx424_pos, 1
+    substr rx424_tgt, rx424_tgt, rx424_off
+  rx424_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan428_done
+    goto rxscan428_scan
+  rxscan428_loop:
+    ($P10) = rx424_cur."from"()
+    inc $P10
+    set rx424_pos, $P10
+    ge rx424_pos, rx424_eos, rxscan428_done
+  rxscan428_scan:
+    set_addr $I10, rxscan428_loop
+    rx424_cur."!mark_push"(0, rx424_pos, $I10)
+  rxscan428_done:
+.annotate "line", 219
+  # rx subrule "scope_declarator" subtype=capture negate=
+    rx424_cur."!cursor_pos"(rx424_pos)
+    $P10 = rx424_cur."scope_declarator"()
+    unless $P10, rx424_fail
+    rx424_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("scope_declarator")
+    rx424_pos = $P10."pos"()
+  # rx pass
+    rx424_cur."!cursor_pass"(rx424_pos, "term:sym<scope_declarator>")
+    rx424_cur."!cursor_debug"("PASS  ", "term:sym<scope_declarator>", " at pos=", rx424_pos)
+    .return (rx424_cur)
+  rx424_fail:
+.annotate "line", 4
+    (rx424_rep, rx424_pos, $I10, $P10) = rx424_cur."!mark_fail"(0)
+    lt rx424_pos, -1, rx424_done
+    eq rx424_pos, -1, rx424_fail
+    jump $I10
+  rx424_done:
+    rx424_cur."!cursor_fail"()
+    rx424_cur."!cursor_debug"("FAIL  ", "term:sym<scope_declarator>")
+    .return (rx424_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__term:sym<scope_declarator>"  :subid("104_1261064023.05912") :method
+.annotate "line", 4
+    $P426 = self."!PREFIX__!subrule"("scope_declarator", "")
+    new $P427, "ResizablePMCArray"
+    push $P427, $P426
+    .return ($P427)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "term:sym<routine_declarator>"  :subid("105_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx430_tgt
+    .local int rx430_pos
+    .local int rx430_off
+    .local int rx430_eos
+    .local int rx430_rep
+    .local pmc rx430_cur
+    (rx430_cur, rx430_pos, rx430_tgt) = self."!cursor_start"()
+    rx430_cur."!cursor_debug"("START ", "term:sym<routine_declarator>")
+    .lex unicode:"$\x{a2}", rx430_cur
+    .local pmc match
+    .lex "$/", match
+    length rx430_eos, rx430_tgt
+    set rx430_off, 0
+    lt rx430_pos, 2, rx430_start
+    sub rx430_off, rx430_pos, 1
+    substr rx430_tgt, rx430_tgt, rx430_off
+  rx430_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan434_done
+    goto rxscan434_scan
+  rxscan434_loop:
+    ($P10) = rx430_cur."from"()
+    inc $P10
+    set rx430_pos, $P10
+    ge rx430_pos, rx430_eos, rxscan434_done
+  rxscan434_scan:
+    set_addr $I10, rxscan434_loop
+    rx430_cur."!mark_push"(0, rx430_pos, $I10)
+  rxscan434_done:
+.annotate "line", 220
+  # rx subrule "routine_declarator" subtype=capture negate=
+    rx430_cur."!cursor_pos"(rx430_pos)
+    $P10 = rx430_cur."routine_declarator"()
+    unless $P10, rx430_fail
+    rx430_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("routine_declarator")
+    rx430_pos = $P10."pos"()
+  # rx pass
+    rx430_cur."!cursor_pass"(rx430_pos, "term:sym<routine_declarator>")
+    rx430_cur."!cursor_debug"("PASS  ", "term:sym<routine_declarator>", " at pos=", rx430_pos)
+    .return (rx430_cur)
+  rx430_fail:
+.annotate "line", 4
+    (rx430_rep, rx430_pos, $I10, $P10) = rx430_cur."!mark_fail"(0)
+    lt rx430_pos, -1, rx430_done
+    eq rx430_pos, -1, rx430_fail
+    jump $I10
+  rx430_done:
+    rx430_cur."!cursor_fail"()
+    rx430_cur."!cursor_debug"("FAIL  ", "term:sym<routine_declarator>")
+    .return (rx430_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__term:sym<routine_declarator>"  :subid("106_1261064023.05912") :method
+.annotate "line", 4
+    $P432 = self."!PREFIX__!subrule"("routine_declarator", "")
+    new $P433, "ResizablePMCArray"
+    push $P433, $P432
+    .return ($P433)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "term:sym<regex_declarator>"  :subid("107_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx436_tgt
+    .local int rx436_pos
+    .local int rx436_off
+    .local int rx436_eos
+    .local int rx436_rep
+    .local pmc rx436_cur
+    (rx436_cur, rx436_pos, rx436_tgt) = self."!cursor_start"()
+    rx436_cur."!cursor_debug"("START ", "term:sym<regex_declarator>")
+    .lex unicode:"$\x{a2}", rx436_cur
+    .local pmc match
+    .lex "$/", match
+    length rx436_eos, rx436_tgt
+    set rx436_off, 0
+    lt rx436_pos, 2, rx436_start
+    sub rx436_off, rx436_pos, 1
+    substr rx436_tgt, rx436_tgt, rx436_off
+  rx436_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan440_done
+    goto rxscan440_scan
+  rxscan440_loop:
+    ($P10) = rx436_cur."from"()
+    inc $P10
+    set rx436_pos, $P10
+    ge rx436_pos, rx436_eos, rxscan440_done
+  rxscan440_scan:
+    set_addr $I10, rxscan440_loop
+    rx436_cur."!mark_push"(0, rx436_pos, $I10)
+  rxscan440_done:
+.annotate "line", 221
+  # rx subrule "regex_declarator" subtype=capture negate=
+    rx436_cur."!cursor_pos"(rx436_pos)
+    $P10 = rx436_cur."regex_declarator"()
+    unless $P10, rx436_fail
+    rx436_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("regex_declarator")
+    rx436_pos = $P10."pos"()
+  # rx pass
+    rx436_cur."!cursor_pass"(rx436_pos, "term:sym<regex_declarator>")
+    rx436_cur."!cursor_debug"("PASS  ", "term:sym<regex_declarator>", " at pos=", rx436_pos)
+    .return (rx436_cur)
+  rx436_fail:
+.annotate "line", 4
+    (rx436_rep, rx436_pos, $I10, $P10) = rx436_cur."!mark_fail"(0)
+    lt rx436_pos, -1, rx436_done
+    eq rx436_pos, -1, rx436_fail
+    jump $I10
+  rx436_done:
+    rx436_cur."!cursor_fail"()
+    rx436_cur."!cursor_debug"("FAIL  ", "term:sym<regex_declarator>")
+    .return (rx436_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__term:sym<regex_declarator>"  :subid("108_1261064023.05912") :method
+.annotate "line", 4
+    $P438 = self."!PREFIX__!subrule"("regex_declarator", "")
+    new $P439, "ResizablePMCArray"
+    push $P439, $P438
+    .return ($P439)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "term:sym<statement_prefix>"  :subid("109_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx442_tgt
+    .local int rx442_pos
+    .local int rx442_off
+    .local int rx442_eos
+    .local int rx442_rep
+    .local pmc rx442_cur
+    (rx442_cur, rx442_pos, rx442_tgt) = self."!cursor_start"()
+    rx442_cur."!cursor_debug"("START ", "term:sym<statement_prefix>")
+    .lex unicode:"$\x{a2}", rx442_cur
+    .local pmc match
+    .lex "$/", match
+    length rx442_eos, rx442_tgt
+    set rx442_off, 0
+    lt rx442_pos, 2, rx442_start
+    sub rx442_off, rx442_pos, 1
+    substr rx442_tgt, rx442_tgt, rx442_off
+  rx442_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan446_done
+    goto rxscan446_scan
+  rxscan446_loop:
+    ($P10) = rx442_cur."from"()
+    inc $P10
+    set rx442_pos, $P10
+    ge rx442_pos, rx442_eos, rxscan446_done
+  rxscan446_scan:
+    set_addr $I10, rxscan446_loop
+    rx442_cur."!mark_push"(0, rx442_pos, $I10)
+  rxscan446_done:
+.annotate "line", 222
+  # rx subrule "statement_prefix" subtype=capture negate=
+    rx442_cur."!cursor_pos"(rx442_pos)
+    $P10 = rx442_cur."statement_prefix"()
+    unless $P10, rx442_fail
+    rx442_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("statement_prefix")
+    rx442_pos = $P10."pos"()
+  # rx pass
+    rx442_cur."!cursor_pass"(rx442_pos, "term:sym<statement_prefix>")
+    rx442_cur."!cursor_debug"("PASS  ", "term:sym<statement_prefix>", " at pos=", rx442_pos)
+    .return (rx442_cur)
+  rx442_fail:
+.annotate "line", 4
+    (rx442_rep, rx442_pos, $I10, $P10) = rx442_cur."!mark_fail"(0)
+    lt rx442_pos, -1, rx442_done
+    eq rx442_pos, -1, rx442_fail
+    jump $I10
+  rx442_done:
+    rx442_cur."!cursor_fail"()
+    rx442_cur."!cursor_debug"("FAIL  ", "term:sym<statement_prefix>")
+    .return (rx442_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__term:sym<statement_prefix>"  :subid("110_1261064023.05912") :method
+.annotate "line", 4
+    $P444 = self."!PREFIX__!subrule"("statement_prefix", "")
+    new $P445, "ResizablePMCArray"
+    push $P445, $P444
+    .return ($P445)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "term:sym<lambda>"  :subid("111_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx448_tgt
+    .local int rx448_pos
+    .local int rx448_off
+    .local int rx448_eos
+    .local int rx448_rep
+    .local pmc rx448_cur
+    (rx448_cur, rx448_pos, rx448_tgt) = self."!cursor_start"()
+    rx448_cur."!cursor_debug"("START ", "term:sym<lambda>")
+    .lex unicode:"$\x{a2}", rx448_cur
+    .local pmc match
+    .lex "$/", match
+    length rx448_eos, rx448_tgt
+    set rx448_off, 0
+    lt rx448_pos, 2, rx448_start
+    sub rx448_off, rx448_pos, 1
+    substr rx448_tgt, rx448_tgt, rx448_off
+  rx448_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan451_done
+    goto rxscan451_scan
+  rxscan451_loop:
+    ($P10) = rx448_cur."from"()
+    inc $P10
+    set rx448_pos, $P10
+    ge rx448_pos, rx448_eos, rxscan451_done
+  rxscan451_scan:
+    set_addr $I10, rxscan451_loop
+    rx448_cur."!mark_push"(0, rx448_pos, $I10)
+  rxscan451_done:
+.annotate "line", 223
+  # rx subrule "lambda" subtype=zerowidth negate=
+    rx448_cur."!cursor_pos"(rx448_pos)
+    $P10 = rx448_cur."lambda"()
+    unless $P10, rx448_fail
+  # rx subrule "pblock" subtype=capture negate=
+    rx448_cur."!cursor_pos"(rx448_pos)
+    $P10 = rx448_cur."pblock"()
+    unless $P10, rx448_fail
+    rx448_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("pblock")
+    rx448_pos = $P10."pos"()
+  # rx pass
+    rx448_cur."!cursor_pass"(rx448_pos, "term:sym<lambda>")
+    rx448_cur."!cursor_debug"("PASS  ", "term:sym<lambda>", " at pos=", rx448_pos)
+    .return (rx448_cur)
+  rx448_fail:
+.annotate "line", 4
+    (rx448_rep, rx448_pos, $I10, $P10) = rx448_cur."!mark_fail"(0)
+    lt rx448_pos, -1, rx448_done
+    eq rx448_pos, -1, rx448_fail
+    jump $I10
+  rx448_done:
+    rx448_cur."!cursor_fail"()
+    rx448_cur."!cursor_debug"("FAIL  ", "term:sym<lambda>")
+    .return (rx448_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__term:sym<lambda>"  :subid("112_1261064023.05912") :method
+.annotate "line", 4
+    new $P450, "ResizablePMCArray"
+    push $P450, ""
+    .return ($P450)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "fatarrow"  :subid("113_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx453_tgt
+    .local int rx453_pos
+    .local int rx453_off
+    .local int rx453_eos
+    .local int rx453_rep
+    .local pmc rx453_cur
+    (rx453_cur, rx453_pos, rx453_tgt) = self."!cursor_start"()
+    rx453_cur."!cursor_debug"("START ", "fatarrow")
+    .lex unicode:"$\x{a2}", rx453_cur
+    .local pmc match
+    .lex "$/", match
+    length rx453_eos, rx453_tgt
+    set rx453_off, 0
+    lt rx453_pos, 2, rx453_start
+    sub rx453_off, rx453_pos, 1
+    substr rx453_tgt, rx453_tgt, rx453_off
+  rx453_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan457_done
+    goto rxscan457_scan
+  rxscan457_loop:
+    ($P10) = rx453_cur."from"()
+    inc $P10
+    set rx453_pos, $P10
+    ge rx453_pos, rx453_eos, rxscan457_done
+  rxscan457_scan:
+    set_addr $I10, rxscan457_loop
+    rx453_cur."!mark_push"(0, rx453_pos, $I10)
+  rxscan457_done:
+.annotate "line", 226
+  # rx subrule "identifier" subtype=capture negate=
+    rx453_cur."!cursor_pos"(rx453_pos)
+    $P10 = rx453_cur."identifier"()
+    unless $P10, rx453_fail
+    rx453_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("key")
+    rx453_pos = $P10."pos"()
+  # rx rxquantr458 ** 0..*
+    set_addr $I459, rxquantr458_done
+    rx453_cur."!mark_push"(0, rx453_pos, $I459)
+  rxquantr458_loop:
+  # rx enumcharlist negate=0 
+    ge rx453_pos, rx453_eos, rx453_fail
+    sub $I10, rx453_pos, rx453_off
+    substr $S10, rx453_tgt, $I10, 1
+    index $I11, unicode:"\t \x{a0}\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000", $S10
+    lt $I11, 0, rx453_fail
+    inc rx453_pos
+    (rx453_rep) = rx453_cur."!mark_commit"($I459)
+    rx453_cur."!mark_push"(rx453_rep, rx453_pos, $I459)
+    goto rxquantr458_loop
+  rxquantr458_done:
+  # rx literal  "=>"
+    add $I11, rx453_pos, 2
+    gt $I11, rx453_eos, rx453_fail
+    sub $I11, rx453_pos, rx453_off
+    substr $S10, rx453_tgt, $I11, 2
+    ne $S10, "=>", rx453_fail
+    add rx453_pos, 2
+  # rx subrule "ws" subtype=method negate=
+    rx453_cur."!cursor_pos"(rx453_pos)
+    $P10 = rx453_cur."ws"()
+    unless $P10, rx453_fail
+    rx453_pos = $P10."pos"()
+  # rx subrule "EXPR" subtype=capture negate=
+    rx453_cur."!cursor_pos"(rx453_pos)
+    $P10 = rx453_cur."EXPR"("i=")
+    unless $P10, rx453_fail
+    rx453_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("val")
+    rx453_pos = $P10."pos"()
+.annotate "line", 225
+  # rx pass
+    rx453_cur."!cursor_pass"(rx453_pos, "fatarrow")
+    rx453_cur."!cursor_debug"("PASS  ", "fatarrow", " at pos=", rx453_pos)
+    .return (rx453_cur)
+  rx453_fail:
+.annotate "line", 4
+    (rx453_rep, rx453_pos, $I10, $P10) = rx453_cur."!mark_fail"(0)
+    lt rx453_pos, -1, rx453_done
+    eq rx453_pos, -1, rx453_fail
+    jump $I10
+  rx453_done:
+    rx453_cur."!cursor_fail"()
+    rx453_cur."!cursor_debug"("FAIL  ", "fatarrow")
+    .return (rx453_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__fatarrow"  :subid("114_1261064023.05912") :method
+.annotate "line", 4
+    $P455 = self."!PREFIX__!subrule"("key", "")
+    new $P456, "ResizablePMCArray"
+    push $P456, $P455
+    .return ($P456)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "colonpair"  :subid("115_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx461_tgt
+    .local int rx461_pos
+    .local int rx461_off
+    .local int rx461_eos
+    .local int rx461_rep
+    .local pmc rx461_cur
+    (rx461_cur, rx461_pos, rx461_tgt) = self."!cursor_start"()
+    rx461_cur."!cursor_debug"("START ", "colonpair")
+    rx461_cur."!cursor_caparray"("circumfix")
+    .lex unicode:"$\x{a2}", rx461_cur
+    .local pmc match
+    .lex "$/", match
+    length rx461_eos, rx461_tgt
+    set rx461_off, 0
+    lt rx461_pos, 2, rx461_start
+    sub rx461_off, rx461_pos, 1
+    substr rx461_tgt, rx461_tgt, rx461_off
+  rx461_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan467_done
+    goto rxscan467_scan
+  rxscan467_loop:
+    ($P10) = rx461_cur."from"()
+    inc $P10
+    set rx461_pos, $P10
+    ge rx461_pos, rx461_eos, rxscan467_done
+  rxscan467_scan:
+    set_addr $I10, rxscan467_loop
+    rx461_cur."!mark_push"(0, rx461_pos, $I10)
+  rxscan467_done:
+.annotate "line", 230
+  # rx literal  ":"
+    add $I11, rx461_pos, 1
+    gt $I11, rx461_eos, rx461_fail
+    sub $I11, rx461_pos, rx461_off
+    substr $S10, rx461_tgt, $I11, 1
+    ne $S10, ":", rx461_fail
+    add rx461_pos, 1
+  alt468_0:
+.annotate "line", 231
+    set_addr $I10, alt468_1
+    rx461_cur."!mark_push"(0, rx461_pos, $I10)
+.annotate "line", 232
+  # rx subcapture "not"
+    set_addr $I10, rxcap_469_fail
+    rx461_cur."!mark_push"(0, rx461_pos, $I10)
+  # rx literal  "!"
+    add $I11, rx461_pos, 1
+    gt $I11, rx461_eos, rx461_fail
+    sub $I11, rx461_pos, rx461_off
+    substr $S10, rx461_tgt, $I11, 1
+    ne $S10, "!", rx461_fail
+    add rx461_pos, 1
+    set_addr $I10, rxcap_469_fail
+    ($I12, $I11) = rx461_cur."!mark_peek"($I10)
+    rx461_cur."!cursor_pos"($I11)
+    ($P10) = rx461_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx461_pos, "")
+    rx461_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("not")
+    goto rxcap_469_done
+  rxcap_469_fail:
+    goto rx461_fail
+  rxcap_469_done:
+  # rx subrule "identifier" subtype=capture negate=
+    rx461_cur."!cursor_pos"(rx461_pos)
+    $P10 = rx461_cur."identifier"()
+    unless $P10, rx461_fail
+    rx461_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("identifier")
+    rx461_pos = $P10."pos"()
+    goto alt468_end
+  alt468_1:
+    set_addr $I10, alt468_2
+    rx461_cur."!mark_push"(0, rx461_pos, $I10)
+.annotate "line", 233
+  # rx subrule "identifier" subtype=capture negate=
+    rx461_cur."!cursor_pos"(rx461_pos)
+    $P10 = rx461_cur."identifier"()
+    unless $P10, rx461_fail
+    rx461_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("identifier")
+    rx461_pos = $P10."pos"()
+  # rx rxquantr470 ** 0..1
+    set_addr $I471, rxquantr470_done
+    rx461_cur."!mark_push"(0, rx461_pos, $I471)
+  rxquantr470_loop:
+  # rx subrule "circumfix" subtype=capture negate=
+    rx461_cur."!cursor_pos"(rx461_pos)
+    $P10 = rx461_cur."circumfix"()
+    unless $P10, rx461_fail
+    rx461_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("circumfix")
+    rx461_pos = $P10."pos"()
+    (rx461_rep) = rx461_cur."!mark_commit"($I471)
+  rxquantr470_done:
+    goto alt468_end
+  alt468_2:
+.annotate "line", 234
+  # rx subrule "circumfix" subtype=capture negate=
+    rx461_cur."!cursor_pos"(rx461_pos)
+    $P10 = rx461_cur."circumfix"()
+    unless $P10, rx461_fail
+    rx461_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("circumfix")
+    rx461_pos = $P10."pos"()
+  alt468_end:
+.annotate "line", 229
+  # rx pass
+    rx461_cur."!cursor_pass"(rx461_pos, "colonpair")
+    rx461_cur."!cursor_debug"("PASS  ", "colonpair", " at pos=", rx461_pos)
+    .return (rx461_cur)
+  rx461_fail:
+.annotate "line", 4
+    (rx461_rep, rx461_pos, $I10, $P10) = rx461_cur."!mark_fail"(0)
+    lt rx461_pos, -1, rx461_done
+    eq rx461_pos, -1, rx461_fail
+    jump $I10
+  rx461_done:
+    rx461_cur."!cursor_fail"()
+    rx461_cur."!cursor_debug"("FAIL  ", "colonpair")
+    .return (rx461_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__colonpair"  :subid("116_1261064023.05912") :method
+.annotate "line", 4
+    $P463 = self."!PREFIX__!subrule"("circumfix", ":")
+    $P464 = self."!PREFIX__!subrule"("identifier", ":")
+    $P465 = self."!PREFIX__!subrule"("identifier", ":!")
+    new $P466, "ResizablePMCArray"
+    push $P466, $P463
+    push $P466, $P464
+    push $P466, $P465
+    .return ($P466)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "variable"  :subid("117_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx473_tgt
+    .local int rx473_pos
+    .local int rx473_off
+    .local int rx473_eos
+    .local int rx473_rep
+    .local pmc rx473_cur
+    (rx473_cur, rx473_pos, rx473_tgt) = self."!cursor_start"()
+    rx473_cur."!cursor_debug"("START ", "variable")
+    rx473_cur."!cursor_caparray"("twigil")
+    .lex unicode:"$\x{a2}", rx473_cur
+    .local pmc match
+    .lex "$/", match
+    length rx473_eos, rx473_tgt
+    set rx473_off, 0
+    lt rx473_pos, 2, rx473_start
+    sub rx473_off, rx473_pos, 1
+    substr rx473_tgt, rx473_tgt, rx473_off
+  rx473_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan478_done
+    goto rxscan478_scan
+  rxscan478_loop:
+    ($P10) = rx473_cur."from"()
+    inc $P10
+    set rx473_pos, $P10
+    ge rx473_pos, rx473_eos, rxscan478_done
+  rxscan478_scan:
+    set_addr $I10, rxscan478_loop
+    rx473_cur."!mark_push"(0, rx473_pos, $I10)
+  rxscan478_done:
+  alt479_0:
+.annotate "line", 238
+    set_addr $I10, alt479_1
+    rx473_cur."!mark_push"(0, rx473_pos, $I10)
+.annotate "line", 239
+  # rx subrule "sigil" subtype=capture negate=
+    rx473_cur."!cursor_pos"(rx473_pos)
+    $P10 = rx473_cur."sigil"()
+    unless $P10, rx473_fail
+    rx473_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sigil")
+    rx473_pos = $P10."pos"()
+  # rx rxquantr480 ** 0..1
+    set_addr $I481, rxquantr480_done
+    rx473_cur."!mark_push"(0, rx473_pos, $I481)
+  rxquantr480_loop:
+  # rx subrule "twigil" subtype=capture negate=
+    rx473_cur."!cursor_pos"(rx473_pos)
+    $P10 = rx473_cur."twigil"()
+    unless $P10, rx473_fail
+    rx473_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("twigil")
+    rx473_pos = $P10."pos"()
+    (rx473_rep) = rx473_cur."!mark_commit"($I481)
+  rxquantr480_done:
+  # rx subrule "name" subtype=capture negate=
+    rx473_cur."!cursor_pos"(rx473_pos)
+    $P10 = rx473_cur."name"()
+    unless $P10, rx473_fail
+    rx473_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("desigilname")
+    rx473_pos = $P10."pos"()
+    goto alt479_end
+  alt479_1:
+    set_addr $I10, alt479_2
+    rx473_cur."!mark_push"(0, rx473_pos, $I10)
+.annotate "line", 240
+  # rx subrule "sigil" subtype=capture negate=
+    rx473_cur."!cursor_pos"(rx473_pos)
+    $P10 = rx473_cur."sigil"()
+    unless $P10, rx473_fail
+    rx473_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sigil")
+    rx473_pos = $P10."pos"()
+  # rx enumcharlist negate=0 zerowidth
+    ge rx473_pos, rx473_eos, rx473_fail
+    sub $I10, rx473_pos, rx473_off
+    substr $S10, rx473_tgt, $I10, 1
+    index $I11, "<[", $S10
+    lt $I11, 0, rx473_fail
+  # rx subrule "postcircumfix" subtype=capture negate=
+    rx473_cur."!cursor_pos"(rx473_pos)
+    $P10 = rx473_cur."postcircumfix"()
+    unless $P10, rx473_fail
+    rx473_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("postcircumfix")
+    rx473_pos = $P10."pos"()
+    goto alt479_end
+  alt479_2:
+.annotate "line", 241
+  # rx subcapture "sigil"
+    set_addr $I10, rxcap_482_fail
+    rx473_cur."!mark_push"(0, rx473_pos, $I10)
+  # rx literal  "$"
+    add $I11, rx473_pos, 1
+    gt $I11, rx473_eos, rx473_fail
+    sub $I11, rx473_pos, rx473_off
+    substr $S10, rx473_tgt, $I11, 1
+    ne $S10, "$", rx473_fail
+    add rx473_pos, 1
+    set_addr $I10, rxcap_482_fail
+    ($I12, $I11) = rx473_cur."!mark_peek"($I10)
+    rx473_cur."!cursor_pos"($I11)
+    ($P10) = rx473_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx473_pos, "")
+    rx473_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sigil")
+    goto rxcap_482_done
+  rxcap_482_fail:
+    goto rx473_fail
+  rxcap_482_done:
+  # rx subcapture "desigilname"
+    set_addr $I10, rxcap_483_fail
+    rx473_cur."!mark_push"(0, rx473_pos, $I10)
+  # rx enumcharlist negate=0 
+    ge rx473_pos, rx473_eos, rx473_fail
+    sub $I10, rx473_pos, rx473_off
+    substr $S10, rx473_tgt, $I10, 1
+    index $I11, "/_!", $S10
+    lt $I11, 0, rx473_fail
+    inc rx473_pos
+    set_addr $I10, rxcap_483_fail
+    ($I12, $I11) = rx473_cur."!mark_peek"($I10)
+    rx473_cur."!cursor_pos"($I11)
+    ($P10) = rx473_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx473_pos, "")
+    rx473_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("desigilname")
+    goto rxcap_483_done
+  rxcap_483_fail:
+    goto rx473_fail
+  rxcap_483_done:
+  alt479_end:
+.annotate "line", 238
+  # rx pass
+    rx473_cur."!cursor_pass"(rx473_pos, "variable")
+    rx473_cur."!cursor_debug"("PASS  ", "variable", " at pos=", rx473_pos)
+    .return (rx473_cur)
+  rx473_fail:
+.annotate "line", 4
+    (rx473_rep, rx473_pos, $I10, $P10) = rx473_cur."!mark_fail"(0)
+    lt rx473_pos, -1, rx473_done
+    eq rx473_pos, -1, rx473_fail
+    jump $I10
+  rx473_done:
+    rx473_cur."!cursor_fail"()
+    rx473_cur."!cursor_debug"("FAIL  ", "variable")
+    .return (rx473_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__variable"  :subid("118_1261064023.05912") :method
+.annotate "line", 4
+    $P475 = self."!PREFIX__!subrule"("sigil", "")
+    $P476 = self."!PREFIX__!subrule"("sigil", "")
+    new $P477, "ResizablePMCArray"
+    push $P477, "$!"
+    push $P477, "$_"
+    push $P477, "$/"
+    push $P477, $P475
+    push $P477, $P476
+    .return ($P477)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "sigil"  :subid("119_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx485_tgt
+    .local int rx485_pos
+    .local int rx485_off
+    .local int rx485_eos
+    .local int rx485_rep
+    .local pmc rx485_cur
+    (rx485_cur, rx485_pos, rx485_tgt) = self."!cursor_start"()
+    rx485_cur."!cursor_debug"("START ", "sigil")
+    .lex unicode:"$\x{a2}", rx485_cur
+    .local pmc match
+    .lex "$/", match
+    length rx485_eos, rx485_tgt
+    set rx485_off, 0
+    lt rx485_pos, 2, rx485_start
+    sub rx485_off, rx485_pos, 1
+    substr rx485_tgt, rx485_tgt, rx485_off
+  rx485_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan488_done
+    goto rxscan488_scan
+  rxscan488_loop:
+    ($P10) = rx485_cur."from"()
+    inc $P10
+    set rx485_pos, $P10
+    ge rx485_pos, rx485_eos, rxscan488_done
+  rxscan488_scan:
+    set_addr $I10, rxscan488_loop
+    rx485_cur."!mark_push"(0, rx485_pos, $I10)
+  rxscan488_done:
+.annotate "line", 244
+  # rx enumcharlist negate=0 
+    ge rx485_pos, rx485_eos, rx485_fail
+    sub $I10, rx485_pos, rx485_off
+    substr $S10, rx485_tgt, $I10, 1
+    index $I11, "$@%&", $S10
+    lt $I11, 0, rx485_fail
+    inc rx485_pos
+  # rx pass
+    rx485_cur."!cursor_pass"(rx485_pos, "sigil")
+    rx485_cur."!cursor_debug"("PASS  ", "sigil", " at pos=", rx485_pos)
+    .return (rx485_cur)
+  rx485_fail:
+.annotate "line", 4
+    (rx485_rep, rx485_pos, $I10, $P10) = rx485_cur."!mark_fail"(0)
+    lt rx485_pos, -1, rx485_done
+    eq rx485_pos, -1, rx485_fail
+    jump $I10
+  rx485_done:
+    rx485_cur."!cursor_fail"()
+    rx485_cur."!cursor_debug"("FAIL  ", "sigil")
+    .return (rx485_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__sigil"  :subid("120_1261064023.05912") :method
+.annotate "line", 4
+    new $P487, "ResizablePMCArray"
+    push $P487, "&"
+    push $P487, "%"
+    push $P487, "@"
+    push $P487, "$"
+    .return ($P487)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "twigil"  :subid("121_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx490_tgt
+    .local int rx490_pos
+    .local int rx490_off
+    .local int rx490_eos
+    .local int rx490_rep
+    .local pmc rx490_cur
+    (rx490_cur, rx490_pos, rx490_tgt) = self."!cursor_start"()
+    rx490_cur."!cursor_debug"("START ", "twigil")
+    .lex unicode:"$\x{a2}", rx490_cur
+    .local pmc match
+    .lex "$/", match
+    length rx490_eos, rx490_tgt
+    set rx490_off, 0
+    lt rx490_pos, 2, rx490_start
+    sub rx490_off, rx490_pos, 1
+    substr rx490_tgt, rx490_tgt, rx490_off
+  rx490_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan493_done
+    goto rxscan493_scan
+  rxscan493_loop:
+    ($P10) = rx490_cur."from"()
+    inc $P10
+    set rx490_pos, $P10
+    ge rx490_pos, rx490_eos, rxscan493_done
+  rxscan493_scan:
+    set_addr $I10, rxscan493_loop
+    rx490_cur."!mark_push"(0, rx490_pos, $I10)
+  rxscan493_done:
+.annotate "line", 246
+  # rx enumcharlist negate=0 
+    ge rx490_pos, rx490_eos, rx490_fail
+    sub $I10, rx490_pos, rx490_off
+    substr $S10, rx490_tgt, $I10, 1
+    index $I11, "*!?", $S10
+    lt $I11, 0, rx490_fail
+    inc rx490_pos
+  # rx pass
+    rx490_cur."!cursor_pass"(rx490_pos, "twigil")
+    rx490_cur."!cursor_debug"("PASS  ", "twigil", " at pos=", rx490_pos)
+    .return (rx490_cur)
+  rx490_fail:
+.annotate "line", 4
+    (rx490_rep, rx490_pos, $I10, $P10) = rx490_cur."!mark_fail"(0)
+    lt rx490_pos, -1, rx490_done
+    eq rx490_pos, -1, rx490_fail
+    jump $I10
+  rx490_done:
+    rx490_cur."!cursor_fail"()
+    rx490_cur."!cursor_debug"("FAIL  ", "twigil")
+    .return (rx490_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__twigil"  :subid("122_1261064023.05912") :method
+.annotate "line", 4
+    new $P492, "ResizablePMCArray"
+    push $P492, "?"
+    push $P492, "!"
+    push $P492, "*"
+    .return ($P492)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "package_declarator"  :subid("123_1261064023.05912") :method
+.annotate "line", 248
+    $P495 = self."!protoregex"("package_declarator")
+    .return ($P495)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__package_declarator"  :subid("124_1261064023.05912") :method
+.annotate "line", 248
+    $P497 = self."!PREFIX__!protoregex"("package_declarator")
+    .return ($P497)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "package_declarator:sym<module>"  :subid("125_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx499_tgt
+    .local int rx499_pos
+    .local int rx499_off
+    .local int rx499_eos
+    .local int rx499_rep
+    .local pmc rx499_cur
+    (rx499_cur, rx499_pos, rx499_tgt) = self."!cursor_start"()
+    rx499_cur."!cursor_debug"("START ", "package_declarator:sym<module>")
+    .lex unicode:"$\x{a2}", rx499_cur
+    .local pmc match
+    .lex "$/", match
+    length rx499_eos, rx499_tgt
+    set rx499_off, 0
+    lt rx499_pos, 2, rx499_start
+    sub rx499_off, rx499_pos, 1
+    substr rx499_tgt, rx499_tgt, rx499_off
+  rx499_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan503_done
+    goto rxscan503_scan
+  rxscan503_loop:
+    ($P10) = rx499_cur."from"()
+    inc $P10
+    set rx499_pos, $P10
+    ge rx499_pos, rx499_eos, rxscan503_done
+  rxscan503_scan:
+    set_addr $I10, rxscan503_loop
+    rx499_cur."!mark_push"(0, rx499_pos, $I10)
+  rxscan503_done:
+.annotate "line", 249
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_504_fail
+    rx499_cur."!mark_push"(0, rx499_pos, $I10)
+  # rx literal  "module"
+    add $I11, rx499_pos, 6
+    gt $I11, rx499_eos, rx499_fail
+    sub $I11, rx499_pos, rx499_off
+    substr $S10, rx499_tgt, $I11, 6
+    ne $S10, "module", rx499_fail
+    add rx499_pos, 6
+    set_addr $I10, rxcap_504_fail
+    ($I12, $I11) = rx499_cur."!mark_peek"($I10)
+    rx499_cur."!cursor_pos"($I11)
+    ($P10) = rx499_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx499_pos, "")
+    rx499_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_504_done
+  rxcap_504_fail:
+    goto rx499_fail
+  rxcap_504_done:
+  # rx subrule "package_def" subtype=capture negate=
+    rx499_cur."!cursor_pos"(rx499_pos)
+    $P10 = rx499_cur."package_def"()
+    unless $P10, rx499_fail
+    rx499_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("package_def")
+    rx499_pos = $P10."pos"()
+  # rx pass
+    rx499_cur."!cursor_pass"(rx499_pos, "package_declarator:sym<module>")
+    rx499_cur."!cursor_debug"("PASS  ", "package_declarator:sym<module>", " at pos=", rx499_pos)
+    .return (rx499_cur)
+  rx499_fail:
+.annotate "line", 4
+    (rx499_rep, rx499_pos, $I10, $P10) = rx499_cur."!mark_fail"(0)
+    lt rx499_pos, -1, rx499_done
+    eq rx499_pos, -1, rx499_fail
+    jump $I10
+  rx499_done:
+    rx499_cur."!cursor_fail"()
+    rx499_cur."!cursor_debug"("FAIL  ", "package_declarator:sym<module>")
+    .return (rx499_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__package_declarator:sym<module>"  :subid("126_1261064023.05912") :method
+.annotate "line", 4
+    $P501 = self."!PREFIX__!subrule"("package_def", "module")
+    new $P502, "ResizablePMCArray"
+    push $P502, $P501
+    .return ($P502)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "package_declarator:sym<class>"  :subid("127_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx506_tgt
+    .local int rx506_pos
+    .local int rx506_off
+    .local int rx506_eos
+    .local int rx506_rep
+    .local pmc rx506_cur
+    (rx506_cur, rx506_pos, rx506_tgt) = self."!cursor_start"()
+    rx506_cur."!cursor_debug"("START ", "package_declarator:sym<class>")
+    .lex unicode:"$\x{a2}", rx506_cur
+    .local pmc match
+    .lex "$/", match
+    length rx506_eos, rx506_tgt
+    set rx506_off, 0
+    lt rx506_pos, 2, rx506_start
+    sub rx506_off, rx506_pos, 1
+    substr rx506_tgt, rx506_tgt, rx506_off
+  rx506_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan511_done
+    goto rxscan511_scan
+  rxscan511_loop:
+    ($P10) = rx506_cur."from"()
+    inc $P10
+    set rx506_pos, $P10
+    ge rx506_pos, rx506_eos, rxscan511_done
+  rxscan511_scan:
+    set_addr $I10, rxscan511_loop
+    rx506_cur."!mark_push"(0, rx506_pos, $I10)
+  rxscan511_done:
+.annotate "line", 250
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_513_fail
+    rx506_cur."!mark_push"(0, rx506_pos, $I10)
+  alt512_0:
+    set_addr $I10, alt512_1
+    rx506_cur."!mark_push"(0, rx506_pos, $I10)
+  # rx literal  "class"
+    add $I11, rx506_pos, 5
+    gt $I11, rx506_eos, rx506_fail
+    sub $I11, rx506_pos, rx506_off
+    substr $S10, rx506_tgt, $I11, 5
+    ne $S10, "class", rx506_fail
+    add rx506_pos, 5
+    goto alt512_end
+  alt512_1:
+  # rx literal  "grammar"
+    add $I11, rx506_pos, 7
+    gt $I11, rx506_eos, rx506_fail
+    sub $I11, rx506_pos, rx506_off
+    substr $S10, rx506_tgt, $I11, 7
+    ne $S10, "grammar", rx506_fail
+    add rx506_pos, 7
+  alt512_end:
+    set_addr $I10, rxcap_513_fail
+    ($I12, $I11) = rx506_cur."!mark_peek"($I10)
+    rx506_cur."!cursor_pos"($I11)
+    ($P10) = rx506_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx506_pos, "")
+    rx506_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_513_done
+  rxcap_513_fail:
+    goto rx506_fail
+  rxcap_513_done:
+  # rx subrule "package_def" subtype=capture negate=
+    rx506_cur."!cursor_pos"(rx506_pos)
+    $P10 = rx506_cur."package_def"()
+    unless $P10, rx506_fail
+    rx506_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("package_def")
+    rx506_pos = $P10."pos"()
+  # rx pass
+    rx506_cur."!cursor_pass"(rx506_pos, "package_declarator:sym<class>")
+    rx506_cur."!cursor_debug"("PASS  ", "package_declarator:sym<class>", " at pos=", rx506_pos)
+    .return (rx506_cur)
+  rx506_fail:
+.annotate "line", 4
+    (rx506_rep, rx506_pos, $I10, $P10) = rx506_cur."!mark_fail"(0)
+    lt rx506_pos, -1, rx506_done
+    eq rx506_pos, -1, rx506_fail
+    jump $I10
+  rx506_done:
+    rx506_cur."!cursor_fail"()
+    rx506_cur."!cursor_debug"("FAIL  ", "package_declarator:sym<class>")
+    .return (rx506_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__package_declarator:sym<class>"  :subid("128_1261064023.05912") :method
+.annotate "line", 4
+    $P508 = self."!PREFIX__!subrule"("package_def", "grammar")
+    $P509 = self."!PREFIX__!subrule"("package_def", "class")
+    new $P510, "ResizablePMCArray"
+    push $P510, $P508
+    push $P510, $P509
+    .return ($P510)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "package_def"  :subid("129_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx515_tgt
+    .local int rx515_pos
+    .local int rx515_off
+    .local int rx515_eos
+    .local int rx515_rep
+    .local pmc rx515_cur
+    (rx515_cur, rx515_pos, rx515_tgt) = self."!cursor_start"()
+    rx515_cur."!cursor_debug"("START ", "package_def")
+    rx515_cur."!cursor_caparray"("parent")
+    .lex unicode:"$\x{a2}", rx515_cur
+    .local pmc match
+    .lex "$/", match
+    length rx515_eos, rx515_tgt
+    set rx515_off, 0
+    lt rx515_pos, 2, rx515_start
+    sub rx515_off, rx515_pos, 1
+    substr rx515_tgt, rx515_tgt, rx515_off
+  rx515_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan518_done
+    goto rxscan518_scan
+  rxscan518_loop:
+    ($P10) = rx515_cur."from"()
+    inc $P10
+    set rx515_pos, $P10
+    ge rx515_pos, rx515_eos, rxscan518_done
+  rxscan518_scan:
+    set_addr $I10, rxscan518_loop
+    rx515_cur."!mark_push"(0, rx515_pos, $I10)
+  rxscan518_done:
+.annotate "line", 252
+  # rx subrule "ws" subtype=method negate=
+    rx515_cur."!cursor_pos"(rx515_pos)
+    $P10 = rx515_cur."ws"()
+    unless $P10, rx515_fail
+    rx515_pos = $P10."pos"()
+.annotate "line", 253
+  # rx subrule "name" subtype=capture negate=
+    rx515_cur."!cursor_pos"(rx515_pos)
+    $P10 = rx515_cur."name"()
+    unless $P10, rx515_fail
+    rx515_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("name")
+    rx515_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx515_cur."!cursor_pos"(rx515_pos)
+    $P10 = rx515_cur."ws"()
+    unless $P10, rx515_fail
+    rx515_pos = $P10."pos"()
+.annotate "line", 254
+  # rx rxquantr521 ** 0..1
+    set_addr $I525, rxquantr521_done
+    rx515_cur."!mark_push"(0, rx515_pos, $I525)
+  rxquantr521_loop:
+  # rx subrule "ws" subtype=method negate=
+    rx515_cur."!cursor_pos"(rx515_pos)
+    $P10 = rx515_cur."ws"()
+    unless $P10, rx515_fail
+    rx515_pos = $P10."pos"()
+  # rx literal  "is"
+    add $I11, rx515_pos, 2
+    gt $I11, rx515_eos, rx515_fail
+    sub $I11, rx515_pos, rx515_off
+    substr $S10, rx515_tgt, $I11, 2
+    ne $S10, "is", rx515_fail
+    add rx515_pos, 2
+  # rx subrule "ws" subtype=method negate=
+    rx515_cur."!cursor_pos"(rx515_pos)
+    $P10 = rx515_cur."ws"()
+    unless $P10, rx515_fail
+    rx515_pos = $P10."pos"()
+  # rx subrule "name" subtype=capture negate=
+    rx515_cur."!cursor_pos"(rx515_pos)
+    $P10 = rx515_cur."name"()
+    unless $P10, rx515_fail
+    rx515_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("parent")
+    rx515_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx515_cur."!cursor_pos"(rx515_pos)
+    $P10 = rx515_cur."ws"()
+    unless $P10, rx515_fail
+    rx515_pos = $P10."pos"()
+    (rx515_rep) = rx515_cur."!mark_commit"($I525)
+  rxquantr521_done:
+  # rx subrule "ws" subtype=method negate=
+    rx515_cur."!cursor_pos"(rx515_pos)
+    $P10 = rx515_cur."ws"()
+    unless $P10, rx515_fail
+    rx515_pos = $P10."pos"()
+  alt527_0:
+.annotate "line", 255
+    set_addr $I10, alt527_1
+    rx515_cur."!mark_push"(0, rx515_pos, $I10)
+.annotate "line", 256
+  # rx subrule "ws" subtype=method negate=
+    rx515_cur."!cursor_pos"(rx515_pos)
+    $P10 = rx515_cur."ws"()
+    unless $P10, rx515_fail
+    rx515_pos = $P10."pos"()
+  # rx literal  ";"
+    add $I11, rx515_pos, 1
+    gt $I11, rx515_eos, rx515_fail
+    sub $I11, rx515_pos, rx515_off
+    substr $S10, rx515_tgt, $I11, 1
+    ne $S10, ";", rx515_fail
+    add rx515_pos, 1
+  # rx subrule "ws" subtype=method negate=
+    rx515_cur."!cursor_pos"(rx515_pos)
+    $P10 = rx515_cur."ws"()
+    unless $P10, rx515_fail
+    rx515_pos = $P10."pos"()
+  # rx subrule "comp_unit" subtype=capture negate=
+    rx515_cur."!cursor_pos"(rx515_pos)
+    $P10 = rx515_cur."comp_unit"()
+    unless $P10, rx515_fail
+    rx515_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("comp_unit")
+    rx515_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx515_cur."!cursor_pos"(rx515_pos)
+    $P10 = rx515_cur."ws"()
+    unless $P10, rx515_fail
+    rx515_pos = $P10."pos"()
+    goto alt527_end
+  alt527_1:
+    set_addr $I10, alt527_2
+    rx515_cur."!mark_push"(0, rx515_pos, $I10)
+.annotate "line", 257
+  # rx subrule "ws" subtype=method negate=
+    rx515_cur."!cursor_pos"(rx515_pos)
+    $P10 = rx515_cur."ws"()
+    unless $P10, rx515_fail
+    rx515_pos = $P10."pos"()
+  # rx enumcharlist negate=0 zerowidth
+    ge rx515_pos, rx515_eos, rx515_fail
+    sub $I10, rx515_pos, rx515_off
+    substr $S10, rx515_tgt, $I10, 1
+    index $I11, "{", $S10
+    lt $I11, 0, rx515_fail
+  # rx subrule "ws" subtype=method negate=
+    rx515_cur."!cursor_pos"(rx515_pos)
+    $P10 = rx515_cur."ws"()
+    unless $P10, rx515_fail
+    rx515_pos = $P10."pos"()
+  # rx subrule "block" subtype=capture negate=
+    rx515_cur."!cursor_pos"(rx515_pos)
+    $P10 = rx515_cur."block"()
+    unless $P10, rx515_fail
+    rx515_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("block")
+    rx515_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx515_cur."!cursor_pos"(rx515_pos)
+    $P10 = rx515_cur."ws"()
+    unless $P10, rx515_fail
+    rx515_pos = $P10."pos"()
+    goto alt527_end
+  alt527_2:
+.annotate "line", 258
+  # rx subrule "ws" subtype=method negate=
+    rx515_cur."!cursor_pos"(rx515_pos)
+    $P10 = rx515_cur."ws"()
+    unless $P10, rx515_fail
+    rx515_pos = $P10."pos"()
+  # rx subrule "panic" subtype=method negate=
+    rx515_cur."!cursor_pos"(rx515_pos)
+    $P10 = rx515_cur."panic"("Malformed package declaration")
+    unless $P10, rx515_fail
+    rx515_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx515_cur."!cursor_pos"(rx515_pos)
+    $P10 = rx515_cur."ws"()
+    unless $P10, rx515_fail
+    rx515_pos = $P10."pos"()
+  alt527_end:
+.annotate "line", 259
+  # rx subrule "ws" subtype=method negate=
+    rx515_cur."!cursor_pos"(rx515_pos)
+    $P10 = rx515_cur."ws"()
+    unless $P10, rx515_fail
+    rx515_pos = $P10."pos"()
+.annotate "line", 252
+  # rx pass
+    rx515_cur."!cursor_pass"(rx515_pos, "package_def")
+    rx515_cur."!cursor_debug"("PASS  ", "package_def", " at pos=", rx515_pos)
+    .return (rx515_cur)
+  rx515_fail:
+.annotate "line", 4
+    (rx515_rep, rx515_pos, $I10, $P10) = rx515_cur."!mark_fail"(0)
+    lt rx515_pos, -1, rx515_done
+    eq rx515_pos, -1, rx515_fail
+    jump $I10
+  rx515_done:
+    rx515_cur."!cursor_fail"()
+    rx515_cur."!cursor_debug"("FAIL  ", "package_def")
+    .return (rx515_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__package_def"  :subid("130_1261064023.05912") :method
+.annotate "line", 4
+    new $P517, "ResizablePMCArray"
+    push $P517, ""
+    .return ($P517)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "scope_declarator"  :subid("131_1261064023.05912") :method
+.annotate "line", 262
+    $P538 = self."!protoregex"("scope_declarator")
+    .return ($P538)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__scope_declarator"  :subid("132_1261064023.05912") :method
+.annotate "line", 262
+    $P540 = self."!PREFIX__!protoregex"("scope_declarator")
+    .return ($P540)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "scope_declarator:sym<my>"  :subid("133_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx542_tgt
+    .local int rx542_pos
+    .local int rx542_off
+    .local int rx542_eos
+    .local int rx542_rep
+    .local pmc rx542_cur
+    (rx542_cur, rx542_pos, rx542_tgt) = self."!cursor_start"()
+    rx542_cur."!cursor_debug"("START ", "scope_declarator:sym<my>")
+    .lex unicode:"$\x{a2}", rx542_cur
+    .local pmc match
+    .lex "$/", match
+    length rx542_eos, rx542_tgt
+    set rx542_off, 0
+    lt rx542_pos, 2, rx542_start
+    sub rx542_off, rx542_pos, 1
+    substr rx542_tgt, rx542_tgt, rx542_off
+  rx542_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan546_done
+    goto rxscan546_scan
+  rxscan546_loop:
+    ($P10) = rx542_cur."from"()
+    inc $P10
+    set rx542_pos, $P10
+    ge rx542_pos, rx542_eos, rxscan546_done
+  rxscan546_scan:
+    set_addr $I10, rxscan546_loop
+    rx542_cur."!mark_push"(0, rx542_pos, $I10)
+  rxscan546_done:
+.annotate "line", 263
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_547_fail
+    rx542_cur."!mark_push"(0, rx542_pos, $I10)
+  # rx literal  "my"
+    add $I11, rx542_pos, 2
+    gt $I11, rx542_eos, rx542_fail
+    sub $I11, rx542_pos, rx542_off
+    substr $S10, rx542_tgt, $I11, 2
+    ne $S10, "my", rx542_fail
+    add rx542_pos, 2
+    set_addr $I10, rxcap_547_fail
+    ($I12, $I11) = rx542_cur."!mark_peek"($I10)
+    rx542_cur."!cursor_pos"($I11)
+    ($P10) = rx542_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx542_pos, "")
+    rx542_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_547_done
+  rxcap_547_fail:
+    goto rx542_fail
+  rxcap_547_done:
+  # rx subrule "scoped" subtype=capture negate=
+    rx542_cur."!cursor_pos"(rx542_pos)
+    $P10 = rx542_cur."scoped"("my")
+    unless $P10, rx542_fail
+    rx542_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("scoped")
+    rx542_pos = $P10."pos"()
+  # rx pass
+    rx542_cur."!cursor_pass"(rx542_pos, "scope_declarator:sym<my>")
+    rx542_cur."!cursor_debug"("PASS  ", "scope_declarator:sym<my>", " at pos=", rx542_pos)
+    .return (rx542_cur)
+  rx542_fail:
+.annotate "line", 4
+    (rx542_rep, rx542_pos, $I10, $P10) = rx542_cur."!mark_fail"(0)
+    lt rx542_pos, -1, rx542_done
+    eq rx542_pos, -1, rx542_fail
+    jump $I10
+  rx542_done:
+    rx542_cur."!cursor_fail"()
+    rx542_cur."!cursor_debug"("FAIL  ", "scope_declarator:sym<my>")
+    .return (rx542_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__scope_declarator:sym<my>"  :subid("134_1261064023.05912") :method
+.annotate "line", 4
+    $P544 = self."!PREFIX__!subrule"("scoped", "my")
+    new $P545, "ResizablePMCArray"
+    push $P545, $P544
+    .return ($P545)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "scope_declarator:sym<our>"  :subid("135_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx549_tgt
+    .local int rx549_pos
+    .local int rx549_off
+    .local int rx549_eos
+    .local int rx549_rep
+    .local pmc rx549_cur
+    (rx549_cur, rx549_pos, rx549_tgt) = self."!cursor_start"()
+    rx549_cur."!cursor_debug"("START ", "scope_declarator:sym<our>")
+    .lex unicode:"$\x{a2}", rx549_cur
+    .local pmc match
+    .lex "$/", match
+    length rx549_eos, rx549_tgt
+    set rx549_off, 0
+    lt rx549_pos, 2, rx549_start
+    sub rx549_off, rx549_pos, 1
+    substr rx549_tgt, rx549_tgt, rx549_off
+  rx549_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan553_done
+    goto rxscan553_scan
+  rxscan553_loop:
+    ($P10) = rx549_cur."from"()
+    inc $P10
+    set rx549_pos, $P10
+    ge rx549_pos, rx549_eos, rxscan553_done
+  rxscan553_scan:
+    set_addr $I10, rxscan553_loop
+    rx549_cur."!mark_push"(0, rx549_pos, $I10)
+  rxscan553_done:
+.annotate "line", 264
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_554_fail
+    rx549_cur."!mark_push"(0, rx549_pos, $I10)
+  # rx literal  "our"
+    add $I11, rx549_pos, 3
+    gt $I11, rx549_eos, rx549_fail
+    sub $I11, rx549_pos, rx549_off
+    substr $S10, rx549_tgt, $I11, 3
+    ne $S10, "our", rx549_fail
+    add rx549_pos, 3
+    set_addr $I10, rxcap_554_fail
+    ($I12, $I11) = rx549_cur."!mark_peek"($I10)
+    rx549_cur."!cursor_pos"($I11)
+    ($P10) = rx549_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx549_pos, "")
+    rx549_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_554_done
+  rxcap_554_fail:
+    goto rx549_fail
+  rxcap_554_done:
+  # rx subrule "scoped" subtype=capture negate=
+    rx549_cur."!cursor_pos"(rx549_pos)
+    $P10 = rx549_cur."scoped"("our")
+    unless $P10, rx549_fail
+    rx549_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("scoped")
+    rx549_pos = $P10."pos"()
+  # rx pass
+    rx549_cur."!cursor_pass"(rx549_pos, "scope_declarator:sym<our>")
+    rx549_cur."!cursor_debug"("PASS  ", "scope_declarator:sym<our>", " at pos=", rx549_pos)
+    .return (rx549_cur)
+  rx549_fail:
+.annotate "line", 4
+    (rx549_rep, rx549_pos, $I10, $P10) = rx549_cur."!mark_fail"(0)
+    lt rx549_pos, -1, rx549_done
+    eq rx549_pos, -1, rx549_fail
+    jump $I10
+  rx549_done:
+    rx549_cur."!cursor_fail"()
+    rx549_cur."!cursor_debug"("FAIL  ", "scope_declarator:sym<our>")
+    .return (rx549_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__scope_declarator:sym<our>"  :subid("136_1261064023.05912") :method
+.annotate "line", 4
+    $P551 = self."!PREFIX__!subrule"("scoped", "our")
+    new $P552, "ResizablePMCArray"
+    push $P552, $P551
+    .return ($P552)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "scope_declarator:sym<has>"  :subid("137_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx556_tgt
+    .local int rx556_pos
+    .local int rx556_off
+    .local int rx556_eos
+    .local int rx556_rep
+    .local pmc rx556_cur
+    (rx556_cur, rx556_pos, rx556_tgt) = self."!cursor_start"()
+    rx556_cur."!cursor_debug"("START ", "scope_declarator:sym<has>")
+    .lex unicode:"$\x{a2}", rx556_cur
+    .local pmc match
+    .lex "$/", match
+    length rx556_eos, rx556_tgt
+    set rx556_off, 0
+    lt rx556_pos, 2, rx556_start
+    sub rx556_off, rx556_pos, 1
+    substr rx556_tgt, rx556_tgt, rx556_off
+  rx556_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan560_done
+    goto rxscan560_scan
+  rxscan560_loop:
+    ($P10) = rx556_cur."from"()
+    inc $P10
+    set rx556_pos, $P10
+    ge rx556_pos, rx556_eos, rxscan560_done
+  rxscan560_scan:
+    set_addr $I10, rxscan560_loop
+    rx556_cur."!mark_push"(0, rx556_pos, $I10)
+  rxscan560_done:
+.annotate "line", 265
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_561_fail
+    rx556_cur."!mark_push"(0, rx556_pos, $I10)
+  # rx literal  "has"
+    add $I11, rx556_pos, 3
+    gt $I11, rx556_eos, rx556_fail
+    sub $I11, rx556_pos, rx556_off
+    substr $S10, rx556_tgt, $I11, 3
+    ne $S10, "has", rx556_fail
+    add rx556_pos, 3
+    set_addr $I10, rxcap_561_fail
+    ($I12, $I11) = rx556_cur."!mark_peek"($I10)
+    rx556_cur."!cursor_pos"($I11)
+    ($P10) = rx556_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx556_pos, "")
+    rx556_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_561_done
+  rxcap_561_fail:
+    goto rx556_fail
+  rxcap_561_done:
+  # rx subrule "scoped" subtype=capture negate=
+    rx556_cur."!cursor_pos"(rx556_pos)
+    $P10 = rx556_cur."scoped"("has")
+    unless $P10, rx556_fail
+    rx556_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("scoped")
+    rx556_pos = $P10."pos"()
+  # rx pass
+    rx556_cur."!cursor_pass"(rx556_pos, "scope_declarator:sym<has>")
+    rx556_cur."!cursor_debug"("PASS  ", "scope_declarator:sym<has>", " at pos=", rx556_pos)
+    .return (rx556_cur)
+  rx556_fail:
+.annotate "line", 4
+    (rx556_rep, rx556_pos, $I10, $P10) = rx556_cur."!mark_fail"(0)
+    lt rx556_pos, -1, rx556_done
+    eq rx556_pos, -1, rx556_fail
+    jump $I10
+  rx556_done:
+    rx556_cur."!cursor_fail"()
+    rx556_cur."!cursor_debug"("FAIL  ", "scope_declarator:sym<has>")
+    .return (rx556_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__scope_declarator:sym<has>"  :subid("138_1261064023.05912") :method
+.annotate "line", 4
+    $P558 = self."!PREFIX__!subrule"("scoped", "has")
+    new $P559, "ResizablePMCArray"
+    push $P559, $P558
+    .return ($P559)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "scoped"  :subid("139_1261064023.05912") :method :outer("11_1261064023.05912")
+    .param pmc param_563
+.annotate "line", 267
+    .lex "$*SCOPE", param_563
+.annotate "line", 4
+    .local string rx564_tgt
+    .local int rx564_pos
+    .local int rx564_off
+    .local int rx564_eos
+    .local int rx564_rep
+    .local pmc rx564_cur
+    (rx564_cur, rx564_pos, rx564_tgt) = self."!cursor_start"()
+    rx564_cur."!cursor_debug"("START ", "scoped")
+    .lex unicode:"$\x{a2}", rx564_cur
+    .local pmc match
+    .lex "$/", match
+    length rx564_eos, rx564_tgt
+    set rx564_off, 0
+    lt rx564_pos, 2, rx564_start
+    sub rx564_off, rx564_pos, 1
+    substr rx564_tgt, rx564_tgt, rx564_off
+  rx564_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan567_done
+    goto rxscan567_scan
+  rxscan567_loop:
+    ($P10) = rx564_cur."from"()
+    inc $P10
+    set rx564_pos, $P10
+    ge rx564_pos, rx564_eos, rxscan567_done
+  rxscan567_scan:
+    set_addr $I10, rxscan567_loop
+    rx564_cur."!mark_push"(0, rx564_pos, $I10)
+  rxscan567_done:
+  alt568_0:
+.annotate "line", 267
+    set_addr $I10, alt568_1
+    rx564_cur."!mark_push"(0, rx564_pos, $I10)
+.annotate "line", 268
+  # rx subrule "ws" subtype=method negate=
+    rx564_cur."!cursor_pos"(rx564_pos)
+    $P10 = rx564_cur."ws"()
+    unless $P10, rx564_fail
+    rx564_pos = $P10."pos"()
+  # rx subrule "variable_declarator" subtype=capture negate=
+    rx564_cur."!cursor_pos"(rx564_pos)
+    $P10 = rx564_cur."variable_declarator"()
+    unless $P10, rx564_fail
+    rx564_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("variable_declarator")
+    rx564_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx564_cur."!cursor_pos"(rx564_pos)
+    $P10 = rx564_cur."ws"()
+    unless $P10, rx564_fail
+    rx564_pos = $P10."pos"()
+    goto alt568_end
+  alt568_1:
+.annotate "line", 269
+  # rx subrule "ws" subtype=method negate=
+    rx564_cur."!cursor_pos"(rx564_pos)
+    $P10 = rx564_cur."ws"()
+    unless $P10, rx564_fail
+    rx564_pos = $P10."pos"()
+  # rx subrule "routine_declarator" subtype=capture negate=
+    rx564_cur."!cursor_pos"(rx564_pos)
+    $P10 = rx564_cur."routine_declarator"()
+    unless $P10, rx564_fail
+    rx564_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("routine_declarator")
+    rx564_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx564_cur."!cursor_pos"(rx564_pos)
+    $P10 = rx564_cur."ws"()
+    unless $P10, rx564_fail
+    rx564_pos = $P10."pos"()
+  alt568_end:
+.annotate "line", 267
+  # rx pass
+    rx564_cur."!cursor_pass"(rx564_pos, "scoped")
+    rx564_cur."!cursor_debug"("PASS  ", "scoped", " at pos=", rx564_pos)
+    .return (rx564_cur)
+  rx564_fail:
+.annotate "line", 4
+    (rx564_rep, rx564_pos, $I10, $P10) = rx564_cur."!mark_fail"(0)
+    lt rx564_pos, -1, rx564_done
+    eq rx564_pos, -1, rx564_fail
+    jump $I10
+  rx564_done:
+    rx564_cur."!cursor_fail"()
+    rx564_cur."!cursor_debug"("FAIL  ", "scoped")
+    .return (rx564_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__scoped"  :subid("140_1261064023.05912") :method
+.annotate "line", 4
+    new $P566, "ResizablePMCArray"
+    push $P566, ""
+    push $P566, ""
+    .return ($P566)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "variable_declarator"  :subid("141_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx574_tgt
+    .local int rx574_pos
+    .local int rx574_off
+    .local int rx574_eos
+    .local int rx574_rep
+    .local pmc rx574_cur
+    (rx574_cur, rx574_pos, rx574_tgt) = self."!cursor_start"()
+    rx574_cur."!cursor_debug"("START ", "variable_declarator")
+    .lex unicode:"$\x{a2}", rx574_cur
+    .local pmc match
+    .lex "$/", match
+    length rx574_eos, rx574_tgt
+    set rx574_off, 0
+    lt rx574_pos, 2, rx574_start
+    sub rx574_off, rx574_pos, 1
+    substr rx574_tgt, rx574_tgt, rx574_off
+  rx574_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan578_done
+    goto rxscan578_scan
+  rxscan578_loop:
+    ($P10) = rx574_cur."from"()
+    inc $P10
+    set rx574_pos, $P10
+    ge rx574_pos, rx574_eos, rxscan578_done
+  rxscan578_scan:
+    set_addr $I10, rxscan578_loop
+    rx574_cur."!mark_push"(0, rx574_pos, $I10)
+  rxscan578_done:
+.annotate "line", 272
+  # rx subrule "variable" subtype=capture negate=
+    rx574_cur."!cursor_pos"(rx574_pos)
+    $P10 = rx574_cur."variable"()
+    unless $P10, rx574_fail
+    rx574_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("variable")
+    rx574_pos = $P10."pos"()
+  # rx pass
+    rx574_cur."!cursor_pass"(rx574_pos, "variable_declarator")
+    rx574_cur."!cursor_debug"("PASS  ", "variable_declarator", " at pos=", rx574_pos)
+    .return (rx574_cur)
+  rx574_fail:
+.annotate "line", 4
+    (rx574_rep, rx574_pos, $I10, $P10) = rx574_cur."!mark_fail"(0)
+    lt rx574_pos, -1, rx574_done
+    eq rx574_pos, -1, rx574_fail
+    jump $I10
+  rx574_done:
+    rx574_cur."!cursor_fail"()
+    rx574_cur."!cursor_debug"("FAIL  ", "variable_declarator")
+    .return (rx574_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__variable_declarator"  :subid("142_1261064023.05912") :method
+.annotate "line", 4
+    $P576 = self."!PREFIX__!subrule"("variable", "")
+    new $P577, "ResizablePMCArray"
+    push $P577, $P576
+    .return ($P577)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "routine_declarator"  :subid("143_1261064023.05912") :method
+.annotate "line", 274
+    $P580 = self."!protoregex"("routine_declarator")
+    .return ($P580)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__routine_declarator"  :subid("144_1261064023.05912") :method
+.annotate "line", 274
+    $P582 = self."!PREFIX__!protoregex"("routine_declarator")
+    .return ($P582)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "routine_declarator:sym<sub>"  :subid("145_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx584_tgt
+    .local int rx584_pos
+    .local int rx584_off
+    .local int rx584_eos
+    .local int rx584_rep
+    .local pmc rx584_cur
+    (rx584_cur, rx584_pos, rx584_tgt) = self."!cursor_start"()
+    rx584_cur."!cursor_debug"("START ", "routine_declarator:sym<sub>")
+    .lex unicode:"$\x{a2}", rx584_cur
+    .local pmc match
+    .lex "$/", match
+    length rx584_eos, rx584_tgt
+    set rx584_off, 0
+    lt rx584_pos, 2, rx584_start
+    sub rx584_off, rx584_pos, 1
+    substr rx584_tgt, rx584_tgt, rx584_off
+  rx584_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan588_done
+    goto rxscan588_scan
+  rxscan588_loop:
+    ($P10) = rx584_cur."from"()
+    inc $P10
+    set rx584_pos, $P10
+    ge rx584_pos, rx584_eos, rxscan588_done
+  rxscan588_scan:
+    set_addr $I10, rxscan588_loop
+    rx584_cur."!mark_push"(0, rx584_pos, $I10)
+  rxscan588_done:
+.annotate "line", 275
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_589_fail
+    rx584_cur."!mark_push"(0, rx584_pos, $I10)
+  # rx literal  "sub"
+    add $I11, rx584_pos, 3
+    gt $I11, rx584_eos, rx584_fail
+    sub $I11, rx584_pos, rx584_off
+    substr $S10, rx584_tgt, $I11, 3
+    ne $S10, "sub", rx584_fail
+    add rx584_pos, 3
+    set_addr $I10, rxcap_589_fail
+    ($I12, $I11) = rx584_cur."!mark_peek"($I10)
+    rx584_cur."!cursor_pos"($I11)
+    ($P10) = rx584_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx584_pos, "")
+    rx584_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_589_done
+  rxcap_589_fail:
+    goto rx584_fail
+  rxcap_589_done:
+  # rx subrule "routine_def" subtype=capture negate=
+    rx584_cur."!cursor_pos"(rx584_pos)
+    $P10 = rx584_cur."routine_def"()
+    unless $P10, rx584_fail
+    rx584_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("routine_def")
+    rx584_pos = $P10."pos"()
+  # rx pass
+    rx584_cur."!cursor_pass"(rx584_pos, "routine_declarator:sym<sub>")
+    rx584_cur."!cursor_debug"("PASS  ", "routine_declarator:sym<sub>", " at pos=", rx584_pos)
+    .return (rx584_cur)
+  rx584_fail:
+.annotate "line", 4
+    (rx584_rep, rx584_pos, $I10, $P10) = rx584_cur."!mark_fail"(0)
+    lt rx584_pos, -1, rx584_done
+    eq rx584_pos, -1, rx584_fail
+    jump $I10
+  rx584_done:
+    rx584_cur."!cursor_fail"()
+    rx584_cur."!cursor_debug"("FAIL  ", "routine_declarator:sym<sub>")
+    .return (rx584_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__routine_declarator:sym<sub>"  :subid("146_1261064023.05912") :method
+.annotate "line", 4
+    $P586 = self."!PREFIX__!subrule"("routine_def", "sub")
+    new $P587, "ResizablePMCArray"
+    push $P587, $P586
+    .return ($P587)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "routine_declarator:sym<method>"  :subid("147_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx591_tgt
+    .local int rx591_pos
+    .local int rx591_off
+    .local int rx591_eos
+    .local int rx591_rep
+    .local pmc rx591_cur
+    (rx591_cur, rx591_pos, rx591_tgt) = self."!cursor_start"()
+    rx591_cur."!cursor_debug"("START ", "routine_declarator:sym<method>")
+    .lex unicode:"$\x{a2}", rx591_cur
+    .local pmc match
+    .lex "$/", match
+    length rx591_eos, rx591_tgt
+    set rx591_off, 0
+    lt rx591_pos, 2, rx591_start
+    sub rx591_off, rx591_pos, 1
+    substr rx591_tgt, rx591_tgt, rx591_off
+  rx591_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan595_done
+    goto rxscan595_scan
+  rxscan595_loop:
+    ($P10) = rx591_cur."from"()
+    inc $P10
+    set rx591_pos, $P10
+    ge rx591_pos, rx591_eos, rxscan595_done
+  rxscan595_scan:
+    set_addr $I10, rxscan595_loop
+    rx591_cur."!mark_push"(0, rx591_pos, $I10)
+  rxscan595_done:
+.annotate "line", 276
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_596_fail
+    rx591_cur."!mark_push"(0, rx591_pos, $I10)
+  # rx literal  "method"
+    add $I11, rx591_pos, 6
+    gt $I11, rx591_eos, rx591_fail
+    sub $I11, rx591_pos, rx591_off
+    substr $S10, rx591_tgt, $I11, 6
+    ne $S10, "method", rx591_fail
+    add rx591_pos, 6
+    set_addr $I10, rxcap_596_fail
+    ($I12, $I11) = rx591_cur."!mark_peek"($I10)
+    rx591_cur."!cursor_pos"($I11)
+    ($P10) = rx591_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx591_pos, "")
+    rx591_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_596_done
+  rxcap_596_fail:
+    goto rx591_fail
+  rxcap_596_done:
+  # rx subrule "method_def" subtype=capture negate=
+    rx591_cur."!cursor_pos"(rx591_pos)
+    $P10 = rx591_cur."method_def"()
+    unless $P10, rx591_fail
+    rx591_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("method_def")
+    rx591_pos = $P10."pos"()
+  # rx pass
+    rx591_cur."!cursor_pass"(rx591_pos, "routine_declarator:sym<method>")
+    rx591_cur."!cursor_debug"("PASS  ", "routine_declarator:sym<method>", " at pos=", rx591_pos)
+    .return (rx591_cur)
+  rx591_fail:
+.annotate "line", 4
+    (rx591_rep, rx591_pos, $I10, $P10) = rx591_cur."!mark_fail"(0)
+    lt rx591_pos, -1, rx591_done
+    eq rx591_pos, -1, rx591_fail
+    jump $I10
+  rx591_done:
+    rx591_cur."!cursor_fail"()
+    rx591_cur."!cursor_debug"("FAIL  ", "routine_declarator:sym<method>")
+    .return (rx591_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__routine_declarator:sym<method>"  :subid("148_1261064023.05912") :method
+.annotate "line", 4
+    $P593 = self."!PREFIX__!subrule"("method_def", "method")
+    new $P594, "ResizablePMCArray"
+    push $P594, $P593
+    .return ($P594)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "routine_def"  :subid("149_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx598_tgt
+    .local int rx598_pos
+    .local int rx598_off
+    .local int rx598_eos
+    .local int rx598_rep
+    .local pmc rx598_cur
+    (rx598_cur, rx598_pos, rx598_tgt) = self."!cursor_start"()
+    rx598_cur."!cursor_debug"("START ", "routine_def")
+    rx598_cur."!cursor_caparray"("sigil", "deflongname")
+    .lex unicode:"$\x{a2}", rx598_cur
+    .local pmc match
+    .lex "$/", match
+    length rx598_eos, rx598_tgt
+    set rx598_off, 0
+    lt rx598_pos, 2, rx598_start
+    sub rx598_off, rx598_pos, 1
+    substr rx598_tgt, rx598_tgt, rx598_off
+  rx598_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan601_done
+    goto rxscan601_scan
+  rxscan601_loop:
+    ($P10) = rx598_cur."from"()
+    inc $P10
+    set rx598_pos, $P10
+    ge rx598_pos, rx598_eos, rxscan601_done
+  rxscan601_scan:
+    set_addr $I10, rxscan601_loop
+    rx598_cur."!mark_push"(0, rx598_pos, $I10)
+  rxscan601_done:
+.annotate "line", 278
+  # rx subrule "ws" subtype=method negate=
+    rx598_cur."!cursor_pos"(rx598_pos)
+    $P10 = rx598_cur."ws"()
+    unless $P10, rx598_fail
+    rx598_pos = $P10."pos"()
+.annotate "line", 279
+  # rx rxquantr603 ** 0..1
+    set_addr $I609, rxquantr603_done
+    rx598_cur."!mark_push"(0, rx598_pos, $I609)
+  rxquantr603_loop:
+  # rx subrule "ws" subtype=method negate=
+    rx598_cur."!cursor_pos"(rx598_pos)
+    $P10 = rx598_cur."ws"()
+    unless $P10, rx598_fail
+    rx598_pos = $P10."pos"()
+  # rx subcapture "sigil"
+    set_addr $I10, rxcap_607_fail
+    rx598_cur."!mark_push"(0, rx598_pos, $I10)
+  # rx rxquantr605 ** 0..1
+    set_addr $I606, rxquantr605_done
+    rx598_cur."!mark_push"(0, rx598_pos, $I606)
+  rxquantr605_loop:
+  # rx literal  "&"
+    add $I11, rx598_pos, 1
+    gt $I11, rx598_eos, rx598_fail
+    sub $I11, rx598_pos, rx598_off
+    substr $S10, rx598_tgt, $I11, 1
+    ne $S10, "&", rx598_fail
+    add rx598_pos, 1
+    (rx598_rep) = rx598_cur."!mark_commit"($I606)
+  rxquantr605_done:
+    set_addr $I10, rxcap_607_fail
+    ($I12, $I11) = rx598_cur."!mark_peek"($I10)
+    rx598_cur."!cursor_pos"($I11)
+    ($P10) = rx598_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx598_pos, "")
+    rx598_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sigil")
+    goto rxcap_607_done
+  rxcap_607_fail:
+    goto rx598_fail
+  rxcap_607_done:
+  # rx subrule "deflongname" subtype=capture negate=
+    rx598_cur."!cursor_pos"(rx598_pos)
+    $P10 = rx598_cur."deflongname"()
+    unless $P10, rx598_fail
+    rx598_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("deflongname")
+    rx598_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx598_cur."!cursor_pos"(rx598_pos)
+    $P10 = rx598_cur."ws"()
+    unless $P10, rx598_fail
+    rx598_pos = $P10."pos"()
+    (rx598_rep) = rx598_cur."!mark_commit"($I609)
+  rxquantr603_done:
+  # rx subrule "ws" subtype=method negate=
+    rx598_cur."!cursor_pos"(rx598_pos)
+    $P10 = rx598_cur."ws"()
+    unless $P10, rx598_fail
+    rx598_pos = $P10."pos"()
+.annotate "line", 280
+  # rx subrule "newpad" subtype=method negate=
+    rx598_cur."!cursor_pos"(rx598_pos)
+    $P10 = rx598_cur."newpad"()
+    unless $P10, rx598_fail
+    rx598_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx598_cur."!cursor_pos"(rx598_pos)
+    $P10 = rx598_cur."ws"()
+    unless $P10, rx598_fail
+    rx598_pos = $P10."pos"()
+  alt612_0:
+.annotate "line", 281
+    set_addr $I10, alt612_1
+    rx598_cur."!mark_push"(0, rx598_pos, $I10)
+  # rx subrule "ws" subtype=method negate=
+    rx598_cur."!cursor_pos"(rx598_pos)
+    $P10 = rx598_cur."ws"()
+    unless $P10, rx598_fail
+    rx598_pos = $P10."pos"()
+  # rx literal  "("
+    add $I11, rx598_pos, 1
+    gt $I11, rx598_eos, rx598_fail
+    sub $I11, rx598_pos, rx598_off
+    substr $S10, rx598_tgt, $I11, 1
+    ne $S10, "(", rx598_fail
+    add rx598_pos, 1
+  # rx subrule "ws" subtype=method negate=
+    rx598_cur."!cursor_pos"(rx598_pos)
+    $P10 = rx598_cur."ws"()
+    unless $P10, rx598_fail
+    rx598_pos = $P10."pos"()
+  # rx subrule "signature" subtype=capture negate=
+    rx598_cur."!cursor_pos"(rx598_pos)
+    $P10 = rx598_cur."signature"()
+    unless $P10, rx598_fail
+    rx598_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("signature")
+    rx598_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx598_cur."!cursor_pos"(rx598_pos)
+    $P10 = rx598_cur."ws"()
+    unless $P10, rx598_fail
+    rx598_pos = $P10."pos"()
+  # rx literal  ")"
+    add $I11, rx598_pos, 1
+    gt $I11, rx598_eos, rx598_fail
+    sub $I11, rx598_pos, rx598_off
+    substr $S10, rx598_tgt, $I11, 1
+    ne $S10, ")", rx598_fail
+    add rx598_pos, 1
+  # rx subrule "ws" subtype=method negate=
+    rx598_cur."!cursor_pos"(rx598_pos)
+    $P10 = rx598_cur."ws"()
+    unless $P10, rx598_fail
+    rx598_pos = $P10."pos"()
+    goto alt612_end
+  alt612_1:
+.annotate "line", 282
+  # rx subrule "ws" subtype=method negate=
+    rx598_cur."!cursor_pos"(rx598_pos)
+    $P10 = rx598_cur."ws"()
+    unless $P10, rx598_fail
+    rx598_pos = $P10."pos"()
+  # rx subrule "panic" subtype=method negate=
+    rx598_cur."!cursor_pos"(rx598_pos)
+    $P10 = rx598_cur."panic"("Routine declaration requires a signature")
+    unless $P10, rx598_fail
+    rx598_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx598_cur."!cursor_pos"(rx598_pos)
+    $P10 = rx598_cur."ws"()
+    unless $P10, rx598_fail
+    rx598_pos = $P10."pos"()
+  alt612_end:
+  # rx subrule "ws" subtype=method negate=
+    rx598_cur."!cursor_pos"(rx598_pos)
+    $P10 = rx598_cur."ws"()
+    unless $P10, rx598_fail
+    rx598_pos = $P10."pos"()
+.annotate "line", 283
+  # rx subrule "blockoid" subtype=capture negate=
+    rx598_cur."!cursor_pos"(rx598_pos)
+    $P10 = rx598_cur."blockoid"()
+    unless $P10, rx598_fail
+    rx598_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("blockoid")
+    rx598_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx598_cur."!cursor_pos"(rx598_pos)
+    $P10 = rx598_cur."ws"()
+    unless $P10, rx598_fail
+    rx598_pos = $P10."pos"()
+.annotate "line", 278
+  # rx pass
+    rx598_cur."!cursor_pass"(rx598_pos, "routine_def")
+    rx598_cur."!cursor_debug"("PASS  ", "routine_def", " at pos=", rx598_pos)
+    .return (rx598_cur)
+  rx598_fail:
+.annotate "line", 4
+    (rx598_rep, rx598_pos, $I10, $P10) = rx598_cur."!mark_fail"(0)
+    lt rx598_pos, -1, rx598_done
+    eq rx598_pos, -1, rx598_fail
+    jump $I10
+  rx598_done:
+    rx598_cur."!cursor_fail"()
+    rx598_cur."!cursor_debug"("FAIL  ", "routine_def")
+    .return (rx598_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__routine_def"  :subid("150_1261064023.05912") :method
+.annotate "line", 4
+    new $P600, "ResizablePMCArray"
+    push $P600, ""
+    .return ($P600)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "method_def"  :subid("151_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx622_tgt
+    .local int rx622_pos
+    .local int rx622_off
+    .local int rx622_eos
+    .local int rx622_rep
+    .local pmc rx622_cur
+    (rx622_cur, rx622_pos, rx622_tgt) = self."!cursor_start"()
+    rx622_cur."!cursor_debug"("START ", "method_def")
+    rx622_cur."!cursor_caparray"("deflongname")
+    .lex unicode:"$\x{a2}", rx622_cur
+    .local pmc match
+    .lex "$/", match
+    length rx622_eos, rx622_tgt
+    set rx622_off, 0
+    lt rx622_pos, 2, rx622_start
+    sub rx622_off, rx622_pos, 1
+    substr rx622_tgt, rx622_tgt, rx622_off
+  rx622_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan625_done
+    goto rxscan625_scan
+  rxscan625_loop:
+    ($P10) = rx622_cur."from"()
+    inc $P10
+    set rx622_pos, $P10
+    ge rx622_pos, rx622_eos, rxscan625_done
+  rxscan625_scan:
+    set_addr $I10, rxscan625_loop
+    rx622_cur."!mark_push"(0, rx622_pos, $I10)
+  rxscan625_done:
+.annotate "line", 286
+  # rx subrule "ws" subtype=method negate=
+    rx622_cur."!cursor_pos"(rx622_pos)
+    $P10 = rx622_cur."ws"()
+    unless $P10, rx622_fail
+    rx622_pos = $P10."pos"()
+.annotate "line", 287
+  # rx rxquantr627 ** 0..1
+    set_addr $I628, rxquantr627_done
+    rx622_cur."!mark_push"(0, rx622_pos, $I628)
+  rxquantr627_loop:
+  # rx subrule "deflongname" subtype=capture negate=
+    rx622_cur."!cursor_pos"(rx622_pos)
+    $P10 = rx622_cur."deflongname"()
+    unless $P10, rx622_fail
+    rx622_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("deflongname")
+    rx622_pos = $P10."pos"()
+    (rx622_rep) = rx622_cur."!mark_commit"($I628)
+  rxquantr627_done:
+  # rx subrule "ws" subtype=method negate=
+    rx622_cur."!cursor_pos"(rx622_pos)
+    $P10 = rx622_cur."ws"()
+    unless $P10, rx622_fail
+    rx622_pos = $P10."pos"()
+.annotate "line", 288
+  # rx subrule "newpad" subtype=method negate=
+    rx622_cur."!cursor_pos"(rx622_pos)
+    $P10 = rx622_cur."newpad"()
+    unless $P10, rx622_fail
+    rx622_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx622_cur."!cursor_pos"(rx622_pos)
+    $P10 = rx622_cur."ws"()
+    unless $P10, rx622_fail
+    rx622_pos = $P10."pos"()
+  alt631_0:
+.annotate "line", 289
+    set_addr $I10, alt631_1
+    rx622_cur."!mark_push"(0, rx622_pos, $I10)
+  # rx subrule "ws" subtype=method negate=
+    rx622_cur."!cursor_pos"(rx622_pos)
+    $P10 = rx622_cur."ws"()
+    unless $P10, rx622_fail
+    rx622_pos = $P10."pos"()
+  # rx literal  "("
+    add $I11, rx622_pos, 1
+    gt $I11, rx622_eos, rx622_fail
+    sub $I11, rx622_pos, rx622_off
+    substr $S10, rx622_tgt, $I11, 1
+    ne $S10, "(", rx622_fail
+    add rx622_pos, 1
+  # rx subrule "ws" subtype=method negate=
+    rx622_cur."!cursor_pos"(rx622_pos)
+    $P10 = rx622_cur."ws"()
+    unless $P10, rx622_fail
+    rx622_pos = $P10."pos"()
+  # rx subrule "signature" subtype=capture negate=
+    rx622_cur."!cursor_pos"(rx622_pos)
+    $P10 = rx622_cur."signature"()
+    unless $P10, rx622_fail
+    rx622_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("signature")
+    rx622_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx622_cur."!cursor_pos"(rx622_pos)
+    $P10 = rx622_cur."ws"()
+    unless $P10, rx622_fail
+    rx622_pos = $P10."pos"()
+  # rx literal  ")"
+    add $I11, rx622_pos, 1
+    gt $I11, rx622_eos, rx622_fail
+    sub $I11, rx622_pos, rx622_off
+    substr $S10, rx622_tgt, $I11, 1
+    ne $S10, ")", rx622_fail
+    add rx622_pos, 1
+  # rx subrule "ws" subtype=method negate=
+    rx622_cur."!cursor_pos"(rx622_pos)
+    $P10 = rx622_cur."ws"()
+    unless $P10, rx622_fail
+    rx622_pos = $P10."pos"()
+    goto alt631_end
+  alt631_1:
+.annotate "line", 290
+  # rx subrule "ws" subtype=method negate=
+    rx622_cur."!cursor_pos"(rx622_pos)
+    $P10 = rx622_cur."ws"()
+    unless $P10, rx622_fail
+    rx622_pos = $P10."pos"()
+  # rx subrule "panic" subtype=method negate=
+    rx622_cur."!cursor_pos"(rx622_pos)
+    $P10 = rx622_cur."panic"("Routine declaration requires a signature")
+    unless $P10, rx622_fail
+    rx622_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx622_cur."!cursor_pos"(rx622_pos)
+    $P10 = rx622_cur."ws"()
+    unless $P10, rx622_fail
+    rx622_pos = $P10."pos"()
+  alt631_end:
+  # rx subrule "ws" subtype=method negate=
+    rx622_cur."!cursor_pos"(rx622_pos)
+    $P10 = rx622_cur."ws"()
+    unless $P10, rx622_fail
+    rx622_pos = $P10."pos"()
+.annotate "line", 291
+  # rx subrule "blockoid" subtype=capture negate=
+    rx622_cur."!cursor_pos"(rx622_pos)
+    $P10 = rx622_cur."blockoid"()
+    unless $P10, rx622_fail
+    rx622_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("blockoid")
+    rx622_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx622_cur."!cursor_pos"(rx622_pos)
+    $P10 = rx622_cur."ws"()
+    unless $P10, rx622_fail
+    rx622_pos = $P10."pos"()
+.annotate "line", 286
+  # rx pass
+    rx622_cur."!cursor_pass"(rx622_pos, "method_def")
+    rx622_cur."!cursor_debug"("PASS  ", "method_def", " at pos=", rx622_pos)
+    .return (rx622_cur)
+  rx622_fail:
+.annotate "line", 4
+    (rx622_rep, rx622_pos, $I10, $P10) = rx622_cur."!mark_fail"(0)
+    lt rx622_pos, -1, rx622_done
+    eq rx622_pos, -1, rx622_fail
+    jump $I10
+  rx622_done:
+    rx622_cur."!cursor_fail"()
+    rx622_cur."!cursor_debug"("FAIL  ", "method_def")
+    .return (rx622_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__method_def"  :subid("152_1261064023.05912") :method
+.annotate "line", 4
+    new $P624, "ResizablePMCArray"
+    push $P624, ""
+    .return ($P624)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "signature"  :subid("153_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx641_tgt
+    .local int rx641_pos
+    .local int rx641_off
+    .local int rx641_eos
+    .local int rx641_rep
+    .local pmc rx641_cur
+    (rx641_cur, rx641_pos, rx641_tgt) = self."!cursor_start"()
+    rx641_cur."!cursor_debug"("START ", "signature")
+    rx641_cur."!cursor_caparray"("parameter")
+    .lex unicode:"$\x{a2}", rx641_cur
+    .local pmc match
+    .lex "$/", match
+    length rx641_eos, rx641_tgt
+    set rx641_off, 0
+    lt rx641_pos, 2, rx641_start
+    sub rx641_off, rx641_pos, 1
+    substr rx641_tgt, rx641_tgt, rx641_off
+  rx641_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan644_done
+    goto rxscan644_scan
+  rxscan644_loop:
+    ($P10) = rx641_cur."from"()
+    inc $P10
+    set rx641_pos, $P10
+    ge rx641_pos, rx641_eos, rxscan644_done
+  rxscan644_scan:
+    set_addr $I10, rxscan644_loop
+    rx641_cur."!mark_push"(0, rx641_pos, $I10)
+  rxscan644_done:
+.annotate "line", 294
+  # rx rxquantr645 ** 0..1
+    set_addr $I648, rxquantr645_done
+    rx641_cur."!mark_push"(0, rx641_pos, $I648)
+  rxquantr645_loop:
+  # rx rxquantr646 ** 1..*
+    set_addr $I647, rxquantr646_done
+    rx641_cur."!mark_push"(0, -1, $I647)
+  rxquantr646_loop:
+  # rx subrule "ws" subtype=method negate=
+    rx641_cur."!cursor_pos"(rx641_pos)
+    $P10 = rx641_cur."ws"()
+    unless $P10, rx641_fail
+    rx641_pos = $P10."pos"()
+  # rx subrule "parameter" subtype=capture negate=
+    rx641_cur."!cursor_pos"(rx641_pos)
+    $P10 = rx641_cur."parameter"()
+    unless $P10, rx641_fail
+    rx641_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("parameter")
+    rx641_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx641_cur."!cursor_pos"(rx641_pos)
+    $P10 = rx641_cur."ws"()
+    unless $P10, rx641_fail
+    rx641_pos = $P10."pos"()
+    (rx641_rep) = rx641_cur."!mark_commit"($I647)
+    rx641_cur."!mark_push"(rx641_rep, rx641_pos, $I647)
+  # rx literal  ","
+    add $I11, rx641_pos, 1
+    gt $I11, rx641_eos, rx641_fail
+    sub $I11, rx641_pos, rx641_off
+    substr $S10, rx641_tgt, $I11, 1
+    ne $S10, ",", rx641_fail
+    add rx641_pos, 1
+    goto rxquantr646_loop
+  rxquantr646_done:
+    (rx641_rep) = rx641_cur."!mark_commit"($I648)
+  rxquantr645_done:
+  # rx pass
+    rx641_cur."!cursor_pass"(rx641_pos, "signature")
+    rx641_cur."!cursor_debug"("PASS  ", "signature", " at pos=", rx641_pos)
+    .return (rx641_cur)
+  rx641_fail:
+.annotate "line", 4
+    (rx641_rep, rx641_pos, $I10, $P10) = rx641_cur."!mark_fail"(0)
+    lt rx641_pos, -1, rx641_done
+    eq rx641_pos, -1, rx641_fail
+    jump $I10
+  rx641_done:
+    rx641_cur."!cursor_fail"()
+    rx641_cur."!cursor_debug"("FAIL  ", "signature")
+    .return (rx641_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__signature"  :subid("154_1261064023.05912") :method
+.annotate "line", 4
+    new $P643, "ResizablePMCArray"
+    push $P643, ""
+    .return ($P643)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "parameter"  :subid("155_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx650_tgt
+    .local int rx650_pos
+    .local int rx650_off
+    .local int rx650_eos
+    .local int rx650_rep
+    .local pmc rx650_cur
+    (rx650_cur, rx650_pos, rx650_tgt) = self."!cursor_start"()
+    rx650_cur."!cursor_debug"("START ", "parameter")
+    rx650_cur."!cursor_caparray"("default_value")
+    .lex unicode:"$\x{a2}", rx650_cur
+    .local pmc match
+    .lex "$/", match
+    length rx650_eos, rx650_tgt
+    set rx650_off, 0
+    lt rx650_pos, 2, rx650_start
+    sub rx650_off, rx650_pos, 1
+    substr rx650_tgt, rx650_tgt, rx650_off
+  rx650_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan656_done
+    goto rxscan656_scan
+  rxscan656_loop:
+    ($P10) = rx650_cur."from"()
+    inc $P10
+    set rx650_pos, $P10
+    ge rx650_pos, rx650_eos, rxscan656_done
+  rxscan656_scan:
+    set_addr $I10, rxscan656_loop
+    rx650_cur."!mark_push"(0, rx650_pos, $I10)
+  rxscan656_done:
+  alt657_0:
+.annotate "line", 297
+    set_addr $I10, alt657_1
+    rx650_cur."!mark_push"(0, rx650_pos, $I10)
+.annotate "line", 298
+  # rx subcapture "quant"
+    set_addr $I10, rxcap_658_fail
+    rx650_cur."!mark_push"(0, rx650_pos, $I10)
+  # rx literal  "*"
+    add $I11, rx650_pos, 1
+    gt $I11, rx650_eos, rx650_fail
+    sub $I11, rx650_pos, rx650_off
+    substr $S10, rx650_tgt, $I11, 1
+    ne $S10, "*", rx650_fail
+    add rx650_pos, 1
+    set_addr $I10, rxcap_658_fail
+    ($I12, $I11) = rx650_cur."!mark_peek"($I10)
+    rx650_cur."!cursor_pos"($I11)
+    ($P10) = rx650_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx650_pos, "")
+    rx650_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("quant")
+    goto rxcap_658_done
+  rxcap_658_fail:
+    goto rx650_fail
+  rxcap_658_done:
+  # rx subrule "param_var" subtype=capture negate=
+    rx650_cur."!cursor_pos"(rx650_pos)
+    $P10 = rx650_cur."param_var"()
+    unless $P10, rx650_fail
+    rx650_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("param_var")
+    rx650_pos = $P10."pos"()
+    goto alt657_end
+  alt657_1:
+  alt659_0:
+.annotate "line", 299
+    set_addr $I10, alt659_1
+    rx650_cur."!mark_push"(0, rx650_pos, $I10)
+  # rx subrule "param_var" subtype=capture negate=
+    rx650_cur."!cursor_pos"(rx650_pos)
+    $P10 = rx650_cur."param_var"()
+    unless $P10, rx650_fail
+    rx650_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("param_var")
+    rx650_pos = $P10."pos"()
+    goto alt659_end
+  alt659_1:
+  # rx subrule "named_param" subtype=capture negate=
+    rx650_cur."!cursor_pos"(rx650_pos)
+    $P10 = rx650_cur."named_param"()
+    unless $P10, rx650_fail
+    rx650_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("named_param")
+    rx650_pos = $P10."pos"()
+  alt659_end:
+  # rx subcapture "quant"
+    set_addr $I10, rxcap_661_fail
+    rx650_cur."!mark_push"(0, rx650_pos, $I10)
+  alt660_0:
+    set_addr $I10, alt660_1
+    rx650_cur."!mark_push"(0, rx650_pos, $I10)
+  # rx literal  "?"
+    add $I11, rx650_pos, 1
+    gt $I11, rx650_eos, rx650_fail
+    sub $I11, rx650_pos, rx650_off
+    substr $S10, rx650_tgt, $I11, 1
+    ne $S10, "?", rx650_fail
+    add rx650_pos, 1
+    goto alt660_end
+  alt660_1:
+    set_addr $I10, alt660_2
+    rx650_cur."!mark_push"(0, rx650_pos, $I10)
+  # rx literal  "!"
+    add $I11, rx650_pos, 1
+    gt $I11, rx650_eos, rx650_fail
+    sub $I11, rx650_pos, rx650_off
+    substr $S10, rx650_tgt, $I11, 1
+    ne $S10, "!", rx650_fail
+    add rx650_pos, 1
+    goto alt660_end
+  alt660_2:
+  alt660_end:
+    set_addr $I10, rxcap_661_fail
+    ($I12, $I11) = rx650_cur."!mark_peek"($I10)
+    rx650_cur."!cursor_pos"($I11)
+    ($P10) = rx650_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx650_pos, "")
+    rx650_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("quant")
+    goto rxcap_661_done
+  rxcap_661_fail:
+    goto rx650_fail
+  rxcap_661_done:
+  alt657_end:
+.annotate "line", 301
+  # rx rxquantr662 ** 0..1
+    set_addr $I663, rxquantr662_done
+    rx650_cur."!mark_push"(0, rx650_pos, $I663)
+  rxquantr662_loop:
+  # rx subrule "default_value" subtype=capture negate=
+    rx650_cur."!cursor_pos"(rx650_pos)
+    $P10 = rx650_cur."default_value"()
+    unless $P10, rx650_fail
+    rx650_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("default_value")
+    rx650_pos = $P10."pos"()
+    (rx650_rep) = rx650_cur."!mark_commit"($I663)
+  rxquantr662_done:
+.annotate "line", 296
+  # rx pass
+    rx650_cur."!cursor_pass"(rx650_pos, "parameter")
+    rx650_cur."!cursor_debug"("PASS  ", "parameter", " at pos=", rx650_pos)
+    .return (rx650_cur)
+  rx650_fail:
+.annotate "line", 4
+    (rx650_rep, rx650_pos, $I10, $P10) = rx650_cur."!mark_fail"(0)
+    lt rx650_pos, -1, rx650_done
+    eq rx650_pos, -1, rx650_fail
+    jump $I10
+  rx650_done:
+    rx650_cur."!cursor_fail"()
+    rx650_cur."!cursor_debug"("FAIL  ", "parameter")
+    .return (rx650_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__parameter"  :subid("156_1261064023.05912") :method
+.annotate "line", 4
+    $P652 = self."!PREFIX__!subrule"("named_param", "")
+    $P653 = self."!PREFIX__!subrule"("param_var", "")
+    $P654 = self."!PREFIX__!subrule"("param_var", "*")
+    new $P655, "ResizablePMCArray"
+    push $P655, $P652
+    push $P655, $P653
+    push $P655, $P654
+    .return ($P655)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "param_var"  :subid("157_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx665_tgt
+    .local int rx665_pos
+    .local int rx665_off
+    .local int rx665_eos
+    .local int rx665_rep
+    .local pmc rx665_cur
+    (rx665_cur, rx665_pos, rx665_tgt) = self."!cursor_start"()
+    rx665_cur."!cursor_debug"("START ", "param_var")
+    rx665_cur."!cursor_caparray"("twigil")
+    .lex unicode:"$\x{a2}", rx665_cur
+    .local pmc match
+    .lex "$/", match
+    length rx665_eos, rx665_tgt
+    set rx665_off, 0
+    lt rx665_pos, 2, rx665_start
+    sub rx665_off, rx665_pos, 1
+    substr rx665_tgt, rx665_tgt, rx665_off
+  rx665_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan669_done
+    goto rxscan669_scan
+  rxscan669_loop:
+    ($P10) = rx665_cur."from"()
+    inc $P10
+    set rx665_pos, $P10
+    ge rx665_pos, rx665_eos, rxscan669_done
+  rxscan669_scan:
+    set_addr $I10, rxscan669_loop
+    rx665_cur."!mark_push"(0, rx665_pos, $I10)
+  rxscan669_done:
+.annotate "line", 305
+  # rx subrule "sigil" subtype=capture negate=
+    rx665_cur."!cursor_pos"(rx665_pos)
+    $P10 = rx665_cur."sigil"()
+    unless $P10, rx665_fail
+    rx665_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sigil")
+    rx665_pos = $P10."pos"()
+  # rx rxquantr670 ** 0..1
+    set_addr $I671, rxquantr670_done
+    rx665_cur."!mark_push"(0, rx665_pos, $I671)
+  rxquantr670_loop:
+  # rx subrule "twigil" subtype=capture negate=
+    rx665_cur."!cursor_pos"(rx665_pos)
+    $P10 = rx665_cur."twigil"()
+    unless $P10, rx665_fail
+    rx665_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("twigil")
+    rx665_pos = $P10."pos"()
+    (rx665_rep) = rx665_cur."!mark_commit"($I671)
+  rxquantr670_done:
+  alt672_0:
+.annotate "line", 306
+    set_addr $I10, alt672_1
+    rx665_cur."!mark_push"(0, rx665_pos, $I10)
+  # rx subrule "ident" subtype=capture negate=
+    rx665_cur."!cursor_pos"(rx665_pos)
+    $P10 = rx665_cur."ident"()
+    unless $P10, rx665_fail
+    rx665_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("name")
+    rx665_pos = $P10."pos"()
+    goto alt672_end
+  alt672_1:
+  # rx subcapture "name"
+    set_addr $I10, rxcap_673_fail
+    rx665_cur."!mark_push"(0, rx665_pos, $I10)
+  # rx enumcharlist negate=0 
+    ge rx665_pos, rx665_eos, rx665_fail
+    sub $I10, rx665_pos, rx665_off
+    substr $S10, rx665_tgt, $I10, 1
+    index $I11, "/!", $S10
+    lt $I11, 0, rx665_fail
+    inc rx665_pos
+    set_addr $I10, rxcap_673_fail
+    ($I12, $I11) = rx665_cur."!mark_peek"($I10)
+    rx665_cur."!cursor_pos"($I11)
+    ($P10) = rx665_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx665_pos, "")
+    rx665_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("name")
+    goto rxcap_673_done
+  rxcap_673_fail:
+    goto rx665_fail
+  rxcap_673_done:
+  alt672_end:
+.annotate "line", 304
+  # rx pass
+    rx665_cur."!cursor_pass"(rx665_pos, "param_var")
+    rx665_cur."!cursor_debug"("PASS  ", "param_var", " at pos=", rx665_pos)
+    .return (rx665_cur)
+  rx665_fail:
+.annotate "line", 4
+    (rx665_rep, rx665_pos, $I10, $P10) = rx665_cur."!mark_fail"(0)
+    lt rx665_pos, -1, rx665_done
+    eq rx665_pos, -1, rx665_fail
+    jump $I10
+  rx665_done:
+    rx665_cur."!cursor_fail"()
+    rx665_cur."!cursor_debug"("FAIL  ", "param_var")
+    .return (rx665_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__param_var"  :subid("158_1261064023.05912") :method
+.annotate "line", 4
+    $P667 = self."!PREFIX__!subrule"("sigil", "")
+    new $P668, "ResizablePMCArray"
+    push $P668, $P667
+    .return ($P668)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "named_param"  :subid("159_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx675_tgt
+    .local int rx675_pos
+    .local int rx675_off
+    .local int rx675_eos
+    .local int rx675_rep
+    .local pmc rx675_cur
+    (rx675_cur, rx675_pos, rx675_tgt) = self."!cursor_start"()
+    rx675_cur."!cursor_debug"("START ", "named_param")
+    .lex unicode:"$\x{a2}", rx675_cur
+    .local pmc match
+    .lex "$/", match
+    length rx675_eos, rx675_tgt
+    set rx675_off, 0
+    lt rx675_pos, 2, rx675_start
+    sub rx675_off, rx675_pos, 1
+    substr rx675_tgt, rx675_tgt, rx675_off
+  rx675_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan679_done
+    goto rxscan679_scan
+  rxscan679_loop:
+    ($P10) = rx675_cur."from"()
+    inc $P10
+    set rx675_pos, $P10
+    ge rx675_pos, rx675_eos, rxscan679_done
+  rxscan679_scan:
+    set_addr $I10, rxscan679_loop
+    rx675_cur."!mark_push"(0, rx675_pos, $I10)
+  rxscan679_done:
+.annotate "line", 310
+  # rx literal  ":"
+    add $I11, rx675_pos, 1
+    gt $I11, rx675_eos, rx675_fail
+    sub $I11, rx675_pos, rx675_off
+    substr $S10, rx675_tgt, $I11, 1
+    ne $S10, ":", rx675_fail
+    add rx675_pos, 1
+  # rx subrule "param_var" subtype=capture negate=
+    rx675_cur."!cursor_pos"(rx675_pos)
+    $P10 = rx675_cur."param_var"()
+    unless $P10, rx675_fail
+    rx675_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("param_var")
+    rx675_pos = $P10."pos"()
+.annotate "line", 309
+  # rx pass
+    rx675_cur."!cursor_pass"(rx675_pos, "named_param")
+    rx675_cur."!cursor_debug"("PASS  ", "named_param", " at pos=", rx675_pos)
+    .return (rx675_cur)
+  rx675_fail:
+.annotate "line", 4
+    (rx675_rep, rx675_pos, $I10, $P10) = rx675_cur."!mark_fail"(0)
+    lt rx675_pos, -1, rx675_done
+    eq rx675_pos, -1, rx675_fail
+    jump $I10
+  rx675_done:
+    rx675_cur."!cursor_fail"()
+    rx675_cur."!cursor_debug"("FAIL  ", "named_param")
+    .return (rx675_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__named_param"  :subid("160_1261064023.05912") :method
+.annotate "line", 4
+    $P677 = self."!PREFIX__!subrule"("param_var", ":")
+    new $P678, "ResizablePMCArray"
+    push $P678, $P677
+    .return ($P678)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "default_value"  :subid("161_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx681_tgt
+    .local int rx681_pos
+    .local int rx681_off
+    .local int rx681_eos
+    .local int rx681_rep
+    .local pmc rx681_cur
+    (rx681_cur, rx681_pos, rx681_tgt) = self."!cursor_start"()
+    rx681_cur."!cursor_debug"("START ", "default_value")
+    .lex unicode:"$\x{a2}", rx681_cur
+    .local pmc match
+    .lex "$/", match
+    length rx681_eos, rx681_tgt
+    set rx681_off, 0
+    lt rx681_pos, 2, rx681_start
+    sub rx681_off, rx681_pos, 1
+    substr rx681_tgt, rx681_tgt, rx681_off
+  rx681_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan684_done
+    goto rxscan684_scan
+  rxscan684_loop:
+    ($P10) = rx681_cur."from"()
+    inc $P10
+    set rx681_pos, $P10
+    ge rx681_pos, rx681_eos, rxscan684_done
+  rxscan684_scan:
+    set_addr $I10, rxscan684_loop
+    rx681_cur."!mark_push"(0, rx681_pos, $I10)
+  rxscan684_done:
+.annotate "line", 313
+  # rx subrule "ws" subtype=method negate=
+    rx681_cur."!cursor_pos"(rx681_pos)
+    $P10 = rx681_cur."ws"()
+    unless $P10, rx681_fail
+    rx681_pos = $P10."pos"()
+  # rx literal  "="
+    add $I11, rx681_pos, 1
+    gt $I11, rx681_eos, rx681_fail
+    sub $I11, rx681_pos, rx681_off
+    substr $S10, rx681_tgt, $I11, 1
+    ne $S10, "=", rx681_fail
+    add rx681_pos, 1
+  # rx subrule "ws" subtype=method negate=
+    rx681_cur."!cursor_pos"(rx681_pos)
+    $P10 = rx681_cur."ws"()
+    unless $P10, rx681_fail
+    rx681_pos = $P10."pos"()
+  # rx subrule "EXPR" subtype=capture negate=
+    rx681_cur."!cursor_pos"(rx681_pos)
+    $P10 = rx681_cur."EXPR"("i=")
+    unless $P10, rx681_fail
+    rx681_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("EXPR")
+    rx681_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx681_cur."!cursor_pos"(rx681_pos)
+    $P10 = rx681_cur."ws"()
+    unless $P10, rx681_fail
+    rx681_pos = $P10."pos"()
+  # rx pass
+    rx681_cur."!cursor_pass"(rx681_pos, "default_value")
+    rx681_cur."!cursor_debug"("PASS  ", "default_value", " at pos=", rx681_pos)
+    .return (rx681_cur)
+  rx681_fail:
+.annotate "line", 4
+    (rx681_rep, rx681_pos, $I10, $P10) = rx681_cur."!mark_fail"(0)
+    lt rx681_pos, -1, rx681_done
+    eq rx681_pos, -1, rx681_fail
+    jump $I10
+  rx681_done:
+    rx681_cur."!cursor_fail"()
+    rx681_cur."!cursor_debug"("FAIL  ", "default_value")
+    .return (rx681_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__default_value"  :subid("162_1261064023.05912") :method
+.annotate "line", 4
+    new $P683, "ResizablePMCArray"
+    push $P683, ""
+    .return ($P683)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "regex_declarator"  :subid("163_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx689_tgt
+    .local int rx689_pos
+    .local int rx689_off
+    .local int rx689_eos
+    .local int rx689_rep
+    .local pmc rx689_cur
+    (rx689_cur, rx689_pos, rx689_tgt) = self."!cursor_start"()
+    rx689_cur."!cursor_debug"("START ", "regex_declarator")
+    rx689_cur."!cursor_caparray"("signature")
+    .lex unicode:"$\x{a2}", rx689_cur
+    .local pmc match
+    .lex "$/", match
+    length rx689_eos, rx689_tgt
+    set rx689_off, 0
+    lt rx689_pos, 2, rx689_start
+    sub rx689_off, rx689_pos, 1
+    substr rx689_tgt, rx689_tgt, rx689_off
+  rx689_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan692_done
+    goto rxscan692_scan
+  rxscan692_loop:
+    ($P10) = rx689_cur."from"()
+    inc $P10
+    set rx689_pos, $P10
+    ge rx689_pos, rx689_eos, rxscan692_done
+  rxscan692_scan:
+    set_addr $I10, rxscan692_loop
+    rx689_cur."!mark_push"(0, rx689_pos, $I10)
+  rxscan692_done:
+.annotate "line", 315
+  # rx subrule "ws" subtype=method negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."ws"()
+    unless $P10, rx689_fail
+    rx689_pos = $P10."pos"()
+  alt694_0:
+.annotate "line", 316
+    set_addr $I10, alt694_1
+    rx689_cur."!mark_push"(0, rx689_pos, $I10)
+.annotate "line", 317
+  # rx subrule "ws" subtype=method negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."ws"()
+    unless $P10, rx689_fail
+    rx689_pos = $P10."pos"()
+  # rx subcapture "proto"
+    set_addr $I10, rxcap_696_fail
+    rx689_cur."!mark_push"(0, rx689_pos, $I10)
+  # rx literal  "proto"
+    add $I11, rx689_pos, 5
+    gt $I11, rx689_eos, rx689_fail
+    sub $I11, rx689_pos, rx689_off
+    substr $S10, rx689_tgt, $I11, 5
+    ne $S10, "proto", rx689_fail
+    add rx689_pos, 5
+    set_addr $I10, rxcap_696_fail
+    ($I12, $I11) = rx689_cur."!mark_peek"($I10)
+    rx689_cur."!cursor_pos"($I11)
+    ($P10) = rx689_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx689_pos, "")
+    rx689_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("proto")
+    goto rxcap_696_done
+  rxcap_696_fail:
+    goto rx689_fail
+  rxcap_696_done:
+  # rx subrule "ws" subtype=method negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."ws"()
+    unless $P10, rx689_fail
+    rx689_pos = $P10."pos"()
+  alt698_0:
+    set_addr $I10, alt698_1
+    rx689_cur."!mark_push"(0, rx689_pos, $I10)
+  # rx literal  "regex"
+    add $I11, rx689_pos, 5
+    gt $I11, rx689_eos, rx689_fail
+    sub $I11, rx689_pos, rx689_off
+    substr $S10, rx689_tgt, $I11, 5
+    ne $S10, "regex", rx689_fail
+    add rx689_pos, 5
+    goto alt698_end
+  alt698_1:
+    set_addr $I10, alt698_2
+    rx689_cur."!mark_push"(0, rx689_pos, $I10)
+  # rx literal  "token"
+    add $I11, rx689_pos, 5
+    gt $I11, rx689_eos, rx689_fail
+    sub $I11, rx689_pos, rx689_off
+    substr $S10, rx689_tgt, $I11, 5
+    ne $S10, "token", rx689_fail
+    add rx689_pos, 5
+    goto alt698_end
+  alt698_2:
+  # rx literal  "rule"
+    add $I11, rx689_pos, 4
+    gt $I11, rx689_eos, rx689_fail
+    sub $I11, rx689_pos, rx689_off
+    substr $S10, rx689_tgt, $I11, 4
+    ne $S10, "rule", rx689_fail
+    add rx689_pos, 4
+  alt698_end:
+  # rx subrule "ws" subtype=method negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."ws"()
+    unless $P10, rx689_fail
+    rx689_pos = $P10."pos"()
+.annotate "line", 318
+  # rx subrule "deflongname" subtype=capture negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."deflongname"()
+    unless $P10, rx689_fail
+    rx689_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("deflongname")
+    rx689_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."ws"()
+    unless $P10, rx689_fail
+    rx689_pos = $P10."pos"()
+.annotate "line", 319
+  # rx literal  "{"
+    add $I11, rx689_pos, 1
+    gt $I11, rx689_eos, rx689_fail
+    sub $I11, rx689_pos, rx689_off
+    substr $S10, rx689_tgt, $I11, 1
+    ne $S10, "{", rx689_fail
+    add rx689_pos, 1
+  # rx subrule "ws" subtype=method negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."ws"()
+    unless $P10, rx689_fail
+    rx689_pos = $P10."pos"()
+  # rx literal  "<...>"
+    add $I11, rx689_pos, 5
+    gt $I11, rx689_eos, rx689_fail
+    sub $I11, rx689_pos, rx689_off
+    substr $S10, rx689_tgt, $I11, 5
+    ne $S10, "<...>", rx689_fail
+    add rx689_pos, 5
+  # rx subrule "ws" subtype=method negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."ws"()
+    unless $P10, rx689_fail
+    rx689_pos = $P10."pos"()
+  # rx literal  "}"
+    add $I11, rx689_pos, 1
+    gt $I11, rx689_eos, rx689_fail
+    sub $I11, rx689_pos, rx689_off
+    substr $S10, rx689_tgt, $I11, 1
+    ne $S10, "}", rx689_fail
+    add rx689_pos, 1
+  # rx subrule "ENDSTMT" subtype=zerowidth negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."ENDSTMT"()
+    unless $P10, rx689_fail
+  # rx subrule "ws" subtype=method negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."ws"()
+    unless $P10, rx689_fail
+    rx689_pos = $P10."pos"()
+.annotate "line", 317
+    goto alt694_end
+  alt694_1:
+.annotate "line", 320
+  # rx subrule "ws" subtype=method negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."ws"()
+    unless $P10, rx689_fail
+    rx689_pos = $P10."pos"()
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_706_fail
+    rx689_cur."!mark_push"(0, rx689_pos, $I10)
+  alt705_0:
+    set_addr $I10, alt705_1
+    rx689_cur."!mark_push"(0, rx689_pos, $I10)
+  # rx literal  "regex"
+    add $I11, rx689_pos, 5
+    gt $I11, rx689_eos, rx689_fail
+    sub $I11, rx689_pos, rx689_off
+    substr $S10, rx689_tgt, $I11, 5
+    ne $S10, "regex", rx689_fail
+    add rx689_pos, 5
+    goto alt705_end
+  alt705_1:
+    set_addr $I10, alt705_2
+    rx689_cur."!mark_push"(0, rx689_pos, $I10)
+  # rx literal  "token"
+    add $I11, rx689_pos, 5
+    gt $I11, rx689_eos, rx689_fail
+    sub $I11, rx689_pos, rx689_off
+    substr $S10, rx689_tgt, $I11, 5
+    ne $S10, "token", rx689_fail
+    add rx689_pos, 5
+    goto alt705_end
+  alt705_2:
+  # rx literal  "rule"
+    add $I11, rx689_pos, 4
+    gt $I11, rx689_eos, rx689_fail
+    sub $I11, rx689_pos, rx689_off
+    substr $S10, rx689_tgt, $I11, 4
+    ne $S10, "rule", rx689_fail
+    add rx689_pos, 4
+  alt705_end:
+    set_addr $I10, rxcap_706_fail
+    ($I12, $I11) = rx689_cur."!mark_peek"($I10)
+    rx689_cur."!cursor_pos"($I11)
+    ($P10) = rx689_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx689_pos, "")
+    rx689_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_706_done
+  rxcap_706_fail:
+    goto rx689_fail
+  rxcap_706_done:
+  # rx subrule "ws" subtype=method negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."ws"()
+    unless $P10, rx689_fail
+    rx689_pos = $P10."pos"()
+.annotate "line", 321
+  # rx subrule "deflongname" subtype=capture negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."deflongname"()
+    unless $P10, rx689_fail
+    rx689_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("deflongname")
+    rx689_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."ws"()
+    unless $P10, rx689_fail
+    rx689_pos = $P10."pos"()
+.annotate "line", 322
+  # rx subrule "newpad" subtype=method negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."newpad"()
+    unless $P10, rx689_fail
+    rx689_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."ws"()
+    unless $P10, rx689_fail
+    rx689_pos = $P10."pos"()
+.annotate "line", 323
+  # rx rxquantr710 ** 0..1
+    set_addr $I715, rxquantr710_done
+    rx689_cur."!mark_push"(0, rx689_pos, $I715)
+  rxquantr710_loop:
+  # rx subrule "ws" subtype=method negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."ws"()
+    unless $P10, rx689_fail
+    rx689_pos = $P10."pos"()
+  # rx literal  "("
+    add $I11, rx689_pos, 1
+    gt $I11, rx689_eos, rx689_fail
+    sub $I11, rx689_pos, rx689_off
+    substr $S10, rx689_tgt, $I11, 1
+    ne $S10, "(", rx689_fail
+    add rx689_pos, 1
+  # rx subrule "ws" subtype=method negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."ws"()
+    unless $P10, rx689_fail
+    rx689_pos = $P10."pos"()
+  # rx subrule "signature" subtype=capture negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."signature"()
+    unless $P10, rx689_fail
+    rx689_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("signature")
+    rx689_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."ws"()
+    unless $P10, rx689_fail
+    rx689_pos = $P10."pos"()
+  # rx literal  ")"
+    add $I11, rx689_pos, 1
+    gt $I11, rx689_eos, rx689_fail
+    sub $I11, rx689_pos, rx689_off
+    substr $S10, rx689_tgt, $I11, 1
+    ne $S10, ")", rx689_fail
+    add rx689_pos, 1
+  # rx subrule "ws" subtype=method negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."ws"()
+    unless $P10, rx689_fail
+    rx689_pos = $P10."pos"()
+    (rx689_rep) = rx689_cur."!mark_commit"($I715)
+  rxquantr710_done:
+  # rx subrule "ws" subtype=method negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."ws"()
+    unless $P10, rx689_fail
+    rx689_pos = $P10."pos"()
+.annotate "line", 324
+  # rx reduce name="regex_declarator" key="open"
+    rx689_cur."!cursor_pos"(rx689_pos)
+    rx689_cur."!reduce"("regex_declarator", "open")
+  # rx subrule "ws" subtype=method negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."ws"()
+    unless $P10, rx689_fail
+    rx689_pos = $P10."pos"()
+.annotate "line", 325
+  # rx literal  "{"
+    add $I11, rx689_pos, 1
+    gt $I11, rx689_eos, rx689_fail
+    sub $I11, rx689_pos, rx689_off
+    substr $S10, rx689_tgt, $I11, 1
+    ne $S10, "{", rx689_fail
+    add rx689_pos, 1
+  # rx subrule "LANG" subtype=capture negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."LANG"("Regex", "nibbler")
+    unless $P10, rx689_fail
+    rx689_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("p6regex")
+    rx689_pos = $P10."pos"()
+  # rx literal  "}"
+    add $I11, rx689_pos, 1
+    gt $I11, rx689_eos, rx689_fail
+    sub $I11, rx689_pos, rx689_off
+    substr $S10, rx689_tgt, $I11, 1
+    ne $S10, "}", rx689_fail
+    add rx689_pos, 1
+  # rx subrule "ENDSTMT" subtype=zerowidth negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."ENDSTMT"()
+    unless $P10, rx689_fail
+  # rx subrule "ws" subtype=method negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."ws"()
+    unless $P10, rx689_fail
+    rx689_pos = $P10."pos"()
+  alt694_end:
+.annotate "line", 326
+  # rx subrule "ws" subtype=method negate=
+    rx689_cur."!cursor_pos"(rx689_pos)
+    $P10 = rx689_cur."ws"()
+    unless $P10, rx689_fail
+    rx689_pos = $P10."pos"()
+.annotate "line", 315
+  # rx pass
+    rx689_cur."!cursor_pass"(rx689_pos, "regex_declarator")
+    rx689_cur."!cursor_debug"("PASS  ", "regex_declarator", " at pos=", rx689_pos)
+    .return (rx689_cur)
+  rx689_fail:
+.annotate "line", 4
+    (rx689_rep, rx689_pos, $I10, $P10) = rx689_cur."!mark_fail"(0)
+    lt rx689_pos, -1, rx689_done
+    eq rx689_pos, -1, rx689_fail
+    jump $I10
+  rx689_done:
+    rx689_cur."!cursor_fail"()
+    rx689_cur."!cursor_debug"("FAIL  ", "regex_declarator")
+    .return (rx689_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__regex_declarator"  :subid("164_1261064023.05912") :method
+.annotate "line", 4
+    new $P691, "ResizablePMCArray"
+    push $P691, ""
+    .return ($P691)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "dotty"  :subid("165_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx721_tgt
+    .local int rx721_pos
+    .local int rx721_off
+    .local int rx721_eos
+    .local int rx721_rep
+    .local pmc rx721_cur
+    (rx721_cur, rx721_pos, rx721_tgt) = self."!cursor_start"()
+    rx721_cur."!cursor_debug"("START ", "dotty")
+    rx721_cur."!cursor_caparray"("args")
+    .lex unicode:"$\x{a2}", rx721_cur
+    .local pmc match
+    .lex "$/", match
+    length rx721_eos, rx721_tgt
+    set rx721_off, 0
+    lt rx721_pos, 2, rx721_start
+    sub rx721_off, rx721_pos, 1
+    substr rx721_tgt, rx721_tgt, rx721_off
+  rx721_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan725_done
+    goto rxscan725_scan
+  rxscan725_loop:
+    ($P10) = rx721_cur."from"()
+    inc $P10
+    set rx721_pos, $P10
+    ge rx721_pos, rx721_eos, rxscan725_done
+  rxscan725_scan:
+    set_addr $I10, rxscan725_loop
+    rx721_cur."!mark_push"(0, rx721_pos, $I10)
+  rxscan725_done:
+.annotate "line", 330
+  # rx literal  "."
+    add $I11, rx721_pos, 1
+    gt $I11, rx721_eos, rx721_fail
+    sub $I11, rx721_pos, rx721_off
+    substr $S10, rx721_tgt, $I11, 1
+    ne $S10, ".", rx721_fail
+    add rx721_pos, 1
+  alt726_0:
+.annotate "line", 331
+    set_addr $I10, alt726_1
+    rx721_cur."!mark_push"(0, rx721_pos, $I10)
+  # rx subrule "identifier" subtype=capture negate=
+    rx721_cur."!cursor_pos"(rx721_pos)
+    $P10 = rx721_cur."identifier"()
+    unless $P10, rx721_fail
+    rx721_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("longname=identifier")
+    rx721_pos = $P10."pos"()
+    goto alt726_end
+  alt726_1:
+.annotate "line", 332
+  # rx enumcharlist negate=0 zerowidth
+    ge rx721_pos, rx721_eos, rx721_fail
+    sub $I10, rx721_pos, rx721_off
+    substr $S10, rx721_tgt, $I10, 1
+    index $I11, "'\"", $S10
+    lt $I11, 0, rx721_fail
+  # rx subrule "quote" subtype=capture negate=
+    rx721_cur."!cursor_pos"(rx721_pos)
+    $P10 = rx721_cur."quote"()
+    unless $P10, rx721_fail
+    rx721_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("quote")
+    rx721_pos = $P10."pos"()
+  alt727_0:
+.annotate "line", 333
+    set_addr $I10, alt727_1
+    rx721_cur."!mark_push"(0, rx721_pos, $I10)
+  # rx enumcharlist negate=0 zerowidth
+    ge rx721_pos, rx721_eos, rx721_fail
+    sub $I10, rx721_pos, rx721_off
+    substr $S10, rx721_tgt, $I10, 1
+    index $I11, "(", $S10
+    lt $I11, 0, rx721_fail
+    goto alt727_end
+  alt727_1:
+  # rx subrule "panic" subtype=method negate=
+    rx721_cur."!cursor_pos"(rx721_pos)
+    $P10 = rx721_cur."panic"("Quoted method name requires parenthesized arguments")
+    unless $P10, rx721_fail
+    rx721_pos = $P10."pos"()
+  alt727_end:
+  alt726_end:
+.annotate "line", 339
+  # rx rxquantr728 ** 0..1
+    set_addr $I730, rxquantr728_done
+    rx721_cur."!mark_push"(0, rx721_pos, $I730)
+  rxquantr728_loop:
+  alt729_0:
+.annotate "line", 336
+    set_addr $I10, alt729_1
+    rx721_cur."!mark_push"(0, rx721_pos, $I10)
+.annotate "line", 337
+  # rx enumcharlist negate=0 zerowidth
+    ge rx721_pos, rx721_eos, rx721_fail
+    sub $I10, rx721_pos, rx721_off
+    substr $S10, rx721_tgt, $I10, 1
+    index $I11, "(", $S10
+    lt $I11, 0, rx721_fail
+  # rx subrule "args" subtype=capture negate=
+    rx721_cur."!cursor_pos"(rx721_pos)
+    $P10 = rx721_cur."args"()
+    unless $P10, rx721_fail
+    rx721_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("args")
+    rx721_pos = $P10."pos"()
+    goto alt729_end
+  alt729_1:
+.annotate "line", 338
+  # rx literal  ":"
+    add $I11, rx721_pos, 1
+    gt $I11, rx721_eos, rx721_fail
+    sub $I11, rx721_pos, rx721_off
+    substr $S10, rx721_tgt, $I11, 1
+    ne $S10, ":", rx721_fail
+    add rx721_pos, 1
+  # rx charclass s
+    ge rx721_pos, rx721_eos, rx721_fail
+    sub $I10, rx721_pos, rx721_off
+    is_cclass $I11, 32, rx721_tgt, $I10
+    unless $I11, rx721_fail
+    inc rx721_pos
+  # rx subrule "arglist" subtype=capture negate=
+    rx721_cur."!cursor_pos"(rx721_pos)
+    $P10 = rx721_cur."arglist"()
+    unless $P10, rx721_fail
+    rx721_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("args")
+    rx721_pos = $P10."pos"()
+  alt729_end:
+.annotate "line", 339
+    (rx721_rep) = rx721_cur."!mark_commit"($I730)
+  rxquantr728_done:
+.annotate "line", 329
+  # rx pass
+    rx721_cur."!cursor_pass"(rx721_pos, "dotty")
+    rx721_cur."!cursor_debug"("PASS  ", "dotty", " at pos=", rx721_pos)
+    .return (rx721_cur)
+  rx721_fail:
+.annotate "line", 4
+    (rx721_rep, rx721_pos, $I10, $P10) = rx721_cur."!mark_fail"(0)
+    lt rx721_pos, -1, rx721_done
+    eq rx721_pos, -1, rx721_fail
+    jump $I10
+  rx721_done:
+    rx721_cur."!cursor_fail"()
+    rx721_cur."!cursor_debug"("FAIL  ", "dotty")
+    .return (rx721_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__dotty"  :subid("166_1261064023.05912") :method
+.annotate "line", 4
+    $P723 = self."!PREFIX__!subrule"("longname=identifier", ".")
+    new $P724, "ResizablePMCArray"
+    push $P724, "'"
+    push $P724, "\""
+    push $P724, $P723
+    .return ($P724)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "term"  :subid("167_1261064023.05912") :method
+.annotate "line", 343
+    $P732 = self."!protoregex"("term")
+    .return ($P732)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__term"  :subid("168_1261064023.05912") :method
+.annotate "line", 343
+    $P734 = self."!PREFIX__!protoregex"("term")
+    .return ($P734)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "term:sym<self>"  :subid("169_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx736_tgt
+    .local int rx736_pos
+    .local int rx736_off
+    .local int rx736_eos
+    .local int rx736_rep
+    .local pmc rx736_cur
+    (rx736_cur, rx736_pos, rx736_tgt) = self."!cursor_start"()
+    rx736_cur."!cursor_debug"("START ", "term:sym<self>")
+    .lex unicode:"$\x{a2}", rx736_cur
+    .local pmc match
+    .lex "$/", match
+    length rx736_eos, rx736_tgt
+    set rx736_off, 0
+    lt rx736_pos, 2, rx736_start
+    sub rx736_off, rx736_pos, 1
+    substr rx736_tgt, rx736_tgt, rx736_off
+  rx736_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan739_done
+    goto rxscan739_scan
+  rxscan739_loop:
+    ($P10) = rx736_cur."from"()
+    inc $P10
+    set rx736_pos, $P10
+    ge rx736_pos, rx736_eos, rxscan739_done
+  rxscan739_scan:
+    set_addr $I10, rxscan739_loop
+    rx736_cur."!mark_push"(0, rx736_pos, $I10)
+  rxscan739_done:
+.annotate "line", 345
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_740_fail
+    rx736_cur."!mark_push"(0, rx736_pos, $I10)
+  # rx literal  "self"
+    add $I11, rx736_pos, 4
+    gt $I11, rx736_eos, rx736_fail
+    sub $I11, rx736_pos, rx736_off
+    substr $S10, rx736_tgt, $I11, 4
+    ne $S10, "self", rx736_fail
+    add rx736_pos, 4
+    set_addr $I10, rxcap_740_fail
+    ($I12, $I11) = rx736_cur."!mark_peek"($I10)
+    rx736_cur."!cursor_pos"($I11)
+    ($P10) = rx736_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx736_pos, "")
+    rx736_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_740_done
+  rxcap_740_fail:
+    goto rx736_fail
+  rxcap_740_done:
+  # rxanchor rwb
+    le rx736_pos, 0, rx736_fail
+    sub $I10, rx736_pos, rx736_off
+    is_cclass $I11, 8192, rx736_tgt, $I10
+    if $I11, rx736_fail
+    dec $I10
+    is_cclass $I11, 8192, rx736_tgt, $I10
+    unless $I11, rx736_fail
+  # rx pass
+    rx736_cur."!cursor_pass"(rx736_pos, "term:sym<self>")
+    rx736_cur."!cursor_debug"("PASS  ", "term:sym<self>", " at pos=", rx736_pos)
+    .return (rx736_cur)
+  rx736_fail:
+.annotate "line", 4
+    (rx736_rep, rx736_pos, $I10, $P10) = rx736_cur."!mark_fail"(0)
+    lt rx736_pos, -1, rx736_done
+    eq rx736_pos, -1, rx736_fail
+    jump $I10
+  rx736_done:
+    rx736_cur."!cursor_fail"()
+    rx736_cur."!cursor_debug"("FAIL  ", "term:sym<self>")
+    .return (rx736_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__term:sym<self>"  :subid("170_1261064023.05912") :method
+.annotate "line", 4
+    new $P738, "ResizablePMCArray"
+    push $P738, "self"
+    .return ($P738)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "term:sym<identifier>"  :subid("171_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx742_tgt
+    .local int rx742_pos
+    .local int rx742_off
+    .local int rx742_eos
+    .local int rx742_rep
+    .local pmc rx742_cur
+    (rx742_cur, rx742_pos, rx742_tgt) = self."!cursor_start"()
+    rx742_cur."!cursor_debug"("START ", "term:sym<identifier>")
+    .lex unicode:"$\x{a2}", rx742_cur
+    .local pmc match
+    .lex "$/", match
+    length rx742_eos, rx742_tgt
+    set rx742_off, 0
+    lt rx742_pos, 2, rx742_start
+    sub rx742_off, rx742_pos, 1
+    substr rx742_tgt, rx742_tgt, rx742_off
+  rx742_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan746_done
+    goto rxscan746_scan
+  rxscan746_loop:
+    ($P10) = rx742_cur."from"()
+    inc $P10
+    set rx742_pos, $P10
+    ge rx742_pos, rx742_eos, rxscan746_done
+  rxscan746_scan:
+    set_addr $I10, rxscan746_loop
+    rx742_cur."!mark_push"(0, rx742_pos, $I10)
+  rxscan746_done:
+.annotate "line", 348
+  # rx subrule "identifier" subtype=capture negate=
+    rx742_cur."!cursor_pos"(rx742_pos)
+    $P10 = rx742_cur."identifier"()
+    unless $P10, rx742_fail
+    rx742_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("identifier")
+    rx742_pos = $P10."pos"()
+  # rx enumcharlist negate=0 zerowidth
+    ge rx742_pos, rx742_eos, rx742_fail
+    sub $I10, rx742_pos, rx742_off
+    substr $S10, rx742_tgt, $I10, 1
+    index $I11, "(", $S10
+    lt $I11, 0, rx742_fail
+  # rx subrule "args" subtype=capture negate=
+    rx742_cur."!cursor_pos"(rx742_pos)
+    $P10 = rx742_cur."args"()
+    unless $P10, rx742_fail
+    rx742_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("args")
+    rx742_pos = $P10."pos"()
+.annotate "line", 347
+  # rx pass
+    rx742_cur."!cursor_pass"(rx742_pos, "term:sym<identifier>")
+    rx742_cur."!cursor_debug"("PASS  ", "term:sym<identifier>", " at pos=", rx742_pos)
+    .return (rx742_cur)
+  rx742_fail:
+.annotate "line", 4
+    (rx742_rep, rx742_pos, $I10, $P10) = rx742_cur."!mark_fail"(0)
+    lt rx742_pos, -1, rx742_done
+    eq rx742_pos, -1, rx742_fail
+    jump $I10
+  rx742_done:
+    rx742_cur."!cursor_fail"()
+    rx742_cur."!cursor_debug"("FAIL  ", "term:sym<identifier>")
+    .return (rx742_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__term:sym<identifier>"  :subid("172_1261064023.05912") :method
+.annotate "line", 4
+    $P744 = self."!PREFIX__!subrule"("identifier", "")
+    new $P745, "ResizablePMCArray"
+    push $P745, $P744
+    .return ($P745)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "term:sym<name>"  :subid("173_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx748_tgt
+    .local int rx748_pos
+    .local int rx748_off
+    .local int rx748_eos
+    .local int rx748_rep
+    .local pmc rx748_cur
+    (rx748_cur, rx748_pos, rx748_tgt) = self."!cursor_start"()
+    rx748_cur."!cursor_debug"("START ", "term:sym<name>")
+    rx748_cur."!cursor_caparray"("args")
+    .lex unicode:"$\x{a2}", rx748_cur
+    .local pmc match
+    .lex "$/", match
+    length rx748_eos, rx748_tgt
+    set rx748_off, 0
+    lt rx748_pos, 2, rx748_start
+    sub rx748_off, rx748_pos, 1
+    substr rx748_tgt, rx748_tgt, rx748_off
+  rx748_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan752_done
+    goto rxscan752_scan
+  rxscan752_loop:
+    ($P10) = rx748_cur."from"()
+    inc $P10
+    set rx748_pos, $P10
+    ge rx748_pos, rx748_eos, rxscan752_done
+  rxscan752_scan:
+    set_addr $I10, rxscan752_loop
+    rx748_cur."!mark_push"(0, rx748_pos, $I10)
+  rxscan752_done:
+.annotate "line", 352
+  # rx subrule "name" subtype=capture negate=
+    rx748_cur."!cursor_pos"(rx748_pos)
+    $P10 = rx748_cur."name"()
+    unless $P10, rx748_fail
+    rx748_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("name")
+    rx748_pos = $P10."pos"()
+  # rx rxquantr753 ** 0..1
+    set_addr $I754, rxquantr753_done
+    rx748_cur."!mark_push"(0, rx748_pos, $I754)
+  rxquantr753_loop:
+  # rx subrule "args" subtype=capture negate=
+    rx748_cur."!cursor_pos"(rx748_pos)
+    $P10 = rx748_cur."args"()
+    unless $P10, rx748_fail
+    rx748_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("args")
+    rx748_pos = $P10."pos"()
+    (rx748_rep) = rx748_cur."!mark_commit"($I754)
+  rxquantr753_done:
+.annotate "line", 351
+  # rx pass
+    rx748_cur."!cursor_pass"(rx748_pos, "term:sym<name>")
+    rx748_cur."!cursor_debug"("PASS  ", "term:sym<name>", " at pos=", rx748_pos)
+    .return (rx748_cur)
+  rx748_fail:
+.annotate "line", 4
+    (rx748_rep, rx748_pos, $I10, $P10) = rx748_cur."!mark_fail"(0)
+    lt rx748_pos, -1, rx748_done
+    eq rx748_pos, -1, rx748_fail
+    jump $I10
+  rx748_done:
+    rx748_cur."!cursor_fail"()
+    rx748_cur."!cursor_debug"("FAIL  ", "term:sym<name>")
+    .return (rx748_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__term:sym<name>"  :subid("174_1261064023.05912") :method
+.annotate "line", 4
+    $P750 = self."!PREFIX__!subrule"("name", "")
+    new $P751, "ResizablePMCArray"
+    push $P751, $P750
+    .return ($P751)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "term:sym<pir::op>"  :subid("175_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx756_tgt
+    .local int rx756_pos
+    .local int rx756_off
+    .local int rx756_eos
+    .local int rx756_rep
+    .local pmc rx756_cur
+    (rx756_cur, rx756_pos, rx756_tgt) = self."!cursor_start"()
+    rx756_cur."!cursor_debug"("START ", "term:sym<pir::op>")
+    rx756_cur."!cursor_caparray"("args")
+    .lex unicode:"$\x{a2}", rx756_cur
+    .local pmc match
+    .lex "$/", match
+    length rx756_eos, rx756_tgt
+    set rx756_off, 0
+    lt rx756_pos, 2, rx756_start
+    sub rx756_off, rx756_pos, 1
+    substr rx756_tgt, rx756_tgt, rx756_off
+  rx756_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan759_done
+    goto rxscan759_scan
+  rxscan759_loop:
+    ($P10) = rx756_cur."from"()
+    inc $P10
+    set rx756_pos, $P10
+    ge rx756_pos, rx756_eos, rxscan759_done
+  rxscan759_scan:
+    set_addr $I10, rxscan759_loop
+    rx756_cur."!mark_push"(0, rx756_pos, $I10)
+  rxscan759_done:
+.annotate "line", 356
+  # rx literal  "pir::"
+    add $I11, rx756_pos, 5
+    gt $I11, rx756_eos, rx756_fail
+    sub $I11, rx756_pos, rx756_off
+    substr $S10, rx756_tgt, $I11, 5
+    ne $S10, "pir::", rx756_fail
+    add rx756_pos, 5
+  # rx subcapture "op"
+    set_addr $I10, rxcap_760_fail
+    rx756_cur."!mark_push"(0, rx756_pos, $I10)
+  # rx charclass_q w r 1..-1
+    sub $I10, rx756_pos, rx756_off
+    find_not_cclass $I11, 8192, rx756_tgt, $I10, rx756_eos
+    add $I12, $I10, 1
+    lt $I11, $I12, rx756_fail
+    add rx756_pos, rx756_off, $I11
+    set_addr $I10, rxcap_760_fail
+    ($I12, $I11) = rx756_cur."!mark_peek"($I10)
+    rx756_cur."!cursor_pos"($I11)
+    ($P10) = rx756_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx756_pos, "")
+    rx756_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("op")
+    goto rxcap_760_done
+  rxcap_760_fail:
+    goto rx756_fail
+  rxcap_760_done:
+  # rx rxquantr761 ** 0..1
+    set_addr $I762, rxquantr761_done
+    rx756_cur."!mark_push"(0, rx756_pos, $I762)
+  rxquantr761_loop:
+  # rx subrule "args" subtype=capture negate=
+    rx756_cur."!cursor_pos"(rx756_pos)
+    $P10 = rx756_cur."args"()
+    unless $P10, rx756_fail
+    rx756_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("args")
+    rx756_pos = $P10."pos"()
+    (rx756_rep) = rx756_cur."!mark_commit"($I762)
+  rxquantr761_done:
+.annotate "line", 355
+  # rx pass
+    rx756_cur."!cursor_pass"(rx756_pos, "term:sym<pir::op>")
+    rx756_cur."!cursor_debug"("PASS  ", "term:sym<pir::op>", " at pos=", rx756_pos)
+    .return (rx756_cur)
+  rx756_fail:
+.annotate "line", 4
+    (rx756_rep, rx756_pos, $I10, $P10) = rx756_cur."!mark_fail"(0)
+    lt rx756_pos, -1, rx756_done
+    eq rx756_pos, -1, rx756_fail
+    jump $I10
+  rx756_done:
+    rx756_cur."!cursor_fail"()
+    rx756_cur."!cursor_debug"("FAIL  ", "term:sym<pir::op>")
+    .return (rx756_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__term:sym<pir::op>"  :subid("176_1261064023.05912") :method
+.annotate "line", 4
+    new $P758, "ResizablePMCArray"
+    push $P758, "pir::"
+    .return ($P758)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "args"  :subid("177_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx764_tgt
+    .local int rx764_pos
+    .local int rx764_off
+    .local int rx764_eos
+    .local int rx764_rep
+    .local pmc rx764_cur
+    (rx764_cur, rx764_pos, rx764_tgt) = self."!cursor_start"()
+    rx764_cur."!cursor_debug"("START ", "args")
+    .lex unicode:"$\x{a2}", rx764_cur
+    .local pmc match
+    .lex "$/", match
+    length rx764_eos, rx764_tgt
+    set rx764_off, 0
+    lt rx764_pos, 2, rx764_start
+    sub rx764_off, rx764_pos, 1
+    substr rx764_tgt, rx764_tgt, rx764_off
+  rx764_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan768_done
+    goto rxscan768_scan
+  rxscan768_loop:
+    ($P10) = rx764_cur."from"()
+    inc $P10
+    set rx764_pos, $P10
+    ge rx764_pos, rx764_eos, rxscan768_done
+  rxscan768_scan:
+    set_addr $I10, rxscan768_loop
+    rx764_cur."!mark_push"(0, rx764_pos, $I10)
+  rxscan768_done:
+.annotate "line", 360
+  # rx literal  "("
+    add $I11, rx764_pos, 1
+    gt $I11, rx764_eos, rx764_fail
+    sub $I11, rx764_pos, rx764_off
+    substr $S10, rx764_tgt, $I11, 1
+    ne $S10, "(", rx764_fail
+    add rx764_pos, 1
+  # rx subrule "arglist" subtype=capture negate=
+    rx764_cur."!cursor_pos"(rx764_pos)
+    $P10 = rx764_cur."arglist"()
+    unless $P10, rx764_fail
+    rx764_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("arglist")
+    rx764_pos = $P10."pos"()
+  # rx literal  ")"
+    add $I11, rx764_pos, 1
+    gt $I11, rx764_eos, rx764_fail
+    sub $I11, rx764_pos, rx764_off
+    substr $S10, rx764_tgt, $I11, 1
+    ne $S10, ")", rx764_fail
+    add rx764_pos, 1
+  # rx pass
+    rx764_cur."!cursor_pass"(rx764_pos, "args")
+    rx764_cur."!cursor_debug"("PASS  ", "args", " at pos=", rx764_pos)
+    .return (rx764_cur)
+  rx764_fail:
+.annotate "line", 4
+    (rx764_rep, rx764_pos, $I10, $P10) = rx764_cur."!mark_fail"(0)
+    lt rx764_pos, -1, rx764_done
+    eq rx764_pos, -1, rx764_fail
+    jump $I10
+  rx764_done:
+    rx764_cur."!cursor_fail"()
+    rx764_cur."!cursor_debug"("FAIL  ", "args")
+    .return (rx764_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__args"  :subid("178_1261064023.05912") :method
+.annotate "line", 4
+    $P766 = self."!PREFIX__!subrule"("arglist", "(")
+    new $P767, "ResizablePMCArray"
+    push $P767, $P766
+    .return ($P767)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "arglist"  :subid("179_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx770_tgt
+    .local int rx770_pos
+    .local int rx770_off
+    .local int rx770_eos
+    .local int rx770_rep
+    .local pmc rx770_cur
+    (rx770_cur, rx770_pos, rx770_tgt) = self."!cursor_start"()
+    rx770_cur."!cursor_debug"("START ", "arglist")
+    .lex unicode:"$\x{a2}", rx770_cur
+    .local pmc match
+    .lex "$/", match
+    length rx770_eos, rx770_tgt
+    set rx770_off, 0
+    lt rx770_pos, 2, rx770_start
+    sub rx770_off, rx770_pos, 1
+    substr rx770_tgt, rx770_tgt, rx770_off
+  rx770_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan774_done
+    goto rxscan774_scan
+  rxscan774_loop:
+    ($P10) = rx770_cur."from"()
+    inc $P10
+    set rx770_pos, $P10
+    ge rx770_pos, rx770_eos, rxscan774_done
+  rxscan774_scan:
+    set_addr $I10, rxscan774_loop
+    rx770_cur."!mark_push"(0, rx770_pos, $I10)
+  rxscan774_done:
+.annotate "line", 364
+  # rx subrule "ws" subtype=method negate=
+    rx770_cur."!cursor_pos"(rx770_pos)
+    $P10 = rx770_cur."ws"()
+    unless $P10, rx770_fail
+    rx770_pos = $P10."pos"()
+  alt775_0:
+.annotate "line", 365
+    set_addr $I10, alt775_1
+    rx770_cur."!mark_push"(0, rx770_pos, $I10)
+.annotate "line", 366
+  # rx subrule "EXPR" subtype=capture negate=
+    rx770_cur."!cursor_pos"(rx770_pos)
+    $P10 = rx770_cur."EXPR"("f=")
+    unless $P10, rx770_fail
+    rx770_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("EXPR")
+    rx770_pos = $P10."pos"()
+    goto alt775_end
+  alt775_1:
+  alt775_end:
+.annotate "line", 363
+  # rx pass
+    rx770_cur."!cursor_pass"(rx770_pos, "arglist")
+    rx770_cur."!cursor_debug"("PASS  ", "arglist", " at pos=", rx770_pos)
+    .return (rx770_cur)
+  rx770_fail:
+.annotate "line", 4
+    (rx770_rep, rx770_pos, $I10, $P10) = rx770_cur."!mark_fail"(0)
+    lt rx770_pos, -1, rx770_done
+    eq rx770_pos, -1, rx770_fail
+    jump $I10
+  rx770_done:
+    rx770_cur."!cursor_fail"()
+    rx770_cur."!cursor_debug"("FAIL  ", "arglist")
+    .return (rx770_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__arglist"  :subid("180_1261064023.05912") :method
+.annotate "line", 4
+    $P772 = self."!PREFIX__!subrule"("", "")
+    new $P773, "ResizablePMCArray"
+    push $P773, $P772
+    .return ($P773)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "term:sym<value>"  :subid("181_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx777_tgt
+    .local int rx777_pos
+    .local int rx777_off
+    .local int rx777_eos
+    .local int rx777_rep
+    .local pmc rx777_cur
+    (rx777_cur, rx777_pos, rx777_tgt) = self."!cursor_start"()
+    rx777_cur."!cursor_debug"("START ", "term:sym<value>")
+    .lex unicode:"$\x{a2}", rx777_cur
+    .local pmc match
+    .lex "$/", match
+    length rx777_eos, rx777_tgt
+    set rx777_off, 0
+    lt rx777_pos, 2, rx777_start
+    sub rx777_off, rx777_pos, 1
+    substr rx777_tgt, rx777_tgt, rx777_off
+  rx777_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan781_done
+    goto rxscan781_scan
+  rxscan781_loop:
+    ($P10) = rx777_cur."from"()
+    inc $P10
+    set rx777_pos, $P10
+    ge rx777_pos, rx777_eos, rxscan781_done
+  rxscan781_scan:
+    set_addr $I10, rxscan781_loop
+    rx777_cur."!mark_push"(0, rx777_pos, $I10)
+  rxscan781_done:
+.annotate "line", 372
+  # rx subrule "value" subtype=capture negate=
+    rx777_cur."!cursor_pos"(rx777_pos)
+    $P10 = rx777_cur."value"()
+    unless $P10, rx777_fail
+    rx777_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("value")
+    rx777_pos = $P10."pos"()
+  # rx pass
+    rx777_cur."!cursor_pass"(rx777_pos, "term:sym<value>")
+    rx777_cur."!cursor_debug"("PASS  ", "term:sym<value>", " at pos=", rx777_pos)
+    .return (rx777_cur)
+  rx777_fail:
+.annotate "line", 4
+    (rx777_rep, rx777_pos, $I10, $P10) = rx777_cur."!mark_fail"(0)
+    lt rx777_pos, -1, rx777_done
+    eq rx777_pos, -1, rx777_fail
+    jump $I10
+  rx777_done:
+    rx777_cur."!cursor_fail"()
+    rx777_cur."!cursor_debug"("FAIL  ", "term:sym<value>")
+    .return (rx777_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__term:sym<value>"  :subid("182_1261064023.05912") :method
+.annotate "line", 4
+    $P779 = self."!PREFIX__!subrule"("value", "")
+    new $P780, "ResizablePMCArray"
+    push $P780, $P779
+    .return ($P780)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "value"  :subid("183_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx783_tgt
+    .local int rx783_pos
+    .local int rx783_off
+    .local int rx783_eos
+    .local int rx783_rep
+    .local pmc rx783_cur
+    (rx783_cur, rx783_pos, rx783_tgt) = self."!cursor_start"()
+    rx783_cur."!cursor_debug"("START ", "value")
+    .lex unicode:"$\x{a2}", rx783_cur
+    .local pmc match
+    .lex "$/", match
+    length rx783_eos, rx783_tgt
+    set rx783_off, 0
+    lt rx783_pos, 2, rx783_start
+    sub rx783_off, rx783_pos, 1
+    substr rx783_tgt, rx783_tgt, rx783_off
+  rx783_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan788_done
+    goto rxscan788_scan
+  rxscan788_loop:
+    ($P10) = rx783_cur."from"()
+    inc $P10
+    set rx783_pos, $P10
+    ge rx783_pos, rx783_eos, rxscan788_done
+  rxscan788_scan:
+    set_addr $I10, rxscan788_loop
+    rx783_cur."!mark_push"(0, rx783_pos, $I10)
+  rxscan788_done:
+  alt789_0:
+.annotate "line", 374
+    set_addr $I10, alt789_1
+    rx783_cur."!mark_push"(0, rx783_pos, $I10)
+.annotate "line", 375
+  # rx subrule "quote" subtype=capture negate=
+    rx783_cur."!cursor_pos"(rx783_pos)
+    $P10 = rx783_cur."quote"()
+    unless $P10, rx783_fail
+    rx783_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("quote")
+    rx783_pos = $P10."pos"()
+    goto alt789_end
+  alt789_1:
+.annotate "line", 376
+  # rx subrule "number" subtype=capture negate=
+    rx783_cur."!cursor_pos"(rx783_pos)
+    $P10 = rx783_cur."number"()
+    unless $P10, rx783_fail
+    rx783_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("number")
+    rx783_pos = $P10."pos"()
+  alt789_end:
+.annotate "line", 374
+  # rx pass
+    rx783_cur."!cursor_pass"(rx783_pos, "value")
+    rx783_cur."!cursor_debug"("PASS  ", "value", " at pos=", rx783_pos)
+    .return (rx783_cur)
+  rx783_fail:
+.annotate "line", 4
+    (rx783_rep, rx783_pos, $I10, $P10) = rx783_cur."!mark_fail"(0)
+    lt rx783_pos, -1, rx783_done
+    eq rx783_pos, -1, rx783_fail
+    jump $I10
+  rx783_done:
+    rx783_cur."!cursor_fail"()
+    rx783_cur."!cursor_debug"("FAIL  ", "value")
+    .return (rx783_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__value"  :subid("184_1261064023.05912") :method
+.annotate "line", 4
+    $P785 = self."!PREFIX__!subrule"("number", "")
+    $P786 = self."!PREFIX__!subrule"("quote", "")
+    new $P787, "ResizablePMCArray"
+    push $P787, $P785
+    push $P787, $P786
+    .return ($P787)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "number"  :subid("185_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx791_tgt
+    .local int rx791_pos
+    .local int rx791_off
+    .local int rx791_eos
+    .local int rx791_rep
+    .local pmc rx791_cur
+    (rx791_cur, rx791_pos, rx791_tgt) = self."!cursor_start"()
+    rx791_cur."!cursor_debug"("START ", "number")
+    .lex unicode:"$\x{a2}", rx791_cur
+    .local pmc match
+    .lex "$/", match
+    length rx791_eos, rx791_tgt
+    set rx791_off, 0
+    lt rx791_pos, 2, rx791_start
+    sub rx791_off, rx791_pos, 1
+    substr rx791_tgt, rx791_tgt, rx791_off
+  rx791_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan794_done
+    goto rxscan794_scan
+  rxscan794_loop:
+    ($P10) = rx791_cur."from"()
+    inc $P10
+    set rx791_pos, $P10
+    ge rx791_pos, rx791_eos, rxscan794_done
+  rxscan794_scan:
+    set_addr $I10, rxscan794_loop
+    rx791_cur."!mark_push"(0, rx791_pos, $I10)
+  rxscan794_done:
+.annotate "line", 380
+  # rx subcapture "sign"
+    set_addr $I10, rxcap_797_fail
+    rx791_cur."!mark_push"(0, rx791_pos, $I10)
+  # rx rxquantr795 ** 0..1
+    set_addr $I796, rxquantr795_done
+    rx791_cur."!mark_push"(0, rx791_pos, $I796)
+  rxquantr795_loop:
+  # rx enumcharlist negate=0 
+    ge rx791_pos, rx791_eos, rx791_fail
+    sub $I10, rx791_pos, rx791_off
+    substr $S10, rx791_tgt, $I10, 1
+    index $I11, "+-", $S10
+    lt $I11, 0, rx791_fail
+    inc rx791_pos
+    (rx791_rep) = rx791_cur."!mark_commit"($I796)
+  rxquantr795_done:
+    set_addr $I10, rxcap_797_fail
+    ($I12, $I11) = rx791_cur."!mark_peek"($I10)
+    rx791_cur."!cursor_pos"($I11)
+    ($P10) = rx791_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx791_pos, "")
+    rx791_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sign")
+    goto rxcap_797_done
+  rxcap_797_fail:
+    goto rx791_fail
+  rxcap_797_done:
+  alt798_0:
+.annotate "line", 381
+    set_addr $I10, alt798_1
+    rx791_cur."!mark_push"(0, rx791_pos, $I10)
+  # rx subrule "dec_number" subtype=capture negate=
+    rx791_cur."!cursor_pos"(rx791_pos)
+    $P10 = rx791_cur."dec_number"()
+    unless $P10, rx791_fail
+    rx791_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("dec_number")
+    rx791_pos = $P10."pos"()
+    goto alt798_end
+  alt798_1:
+  # rx subrule "integer" subtype=capture negate=
+    rx791_cur."!cursor_pos"(rx791_pos)
+    $P10 = rx791_cur."integer"()
+    unless $P10, rx791_fail
+    rx791_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("integer")
+    rx791_pos = $P10."pos"()
+  alt798_end:
+.annotate "line", 379
+  # rx pass
+    rx791_cur."!cursor_pass"(rx791_pos, "number")
+    rx791_cur."!cursor_debug"("PASS  ", "number", " at pos=", rx791_pos)
+    .return (rx791_cur)
+  rx791_fail:
+.annotate "line", 4
+    (rx791_rep, rx791_pos, $I10, $P10) = rx791_cur."!mark_fail"(0)
+    lt rx791_pos, -1, rx791_done
+    eq rx791_pos, -1, rx791_fail
+    jump $I10
+  rx791_done:
+    rx791_cur."!cursor_fail"()
+    rx791_cur."!cursor_debug"("FAIL  ", "number")
+    .return (rx791_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__number"  :subid("186_1261064023.05912") :method
+.annotate "line", 4
+    new $P793, "ResizablePMCArray"
+    push $P793, ""
+    .return ($P793)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "quote"  :subid("187_1261064023.05912") :method
+.annotate "line", 384
+    $P800 = self."!protoregex"("quote")
+    .return ($P800)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__quote"  :subid("188_1261064023.05912") :method
+.annotate "line", 384
+    $P802 = self."!PREFIX__!protoregex"("quote")
+    .return ($P802)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "quote:sym<apos>"  :subid("189_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx804_tgt
+    .local int rx804_pos
+    .local int rx804_off
+    .local int rx804_eos
+    .local int rx804_rep
+    .local pmc rx804_cur
+    (rx804_cur, rx804_pos, rx804_tgt) = self."!cursor_start"()
+    rx804_cur."!cursor_debug"("START ", "quote:sym<apos>")
+    .lex unicode:"$\x{a2}", rx804_cur
+    .local pmc match
+    .lex "$/", match
+    length rx804_eos, rx804_tgt
+    set rx804_off, 0
+    lt rx804_pos, 2, rx804_start
+    sub rx804_off, rx804_pos, 1
+    substr rx804_tgt, rx804_tgt, rx804_off
+  rx804_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan807_done
+    goto rxscan807_scan
+  rxscan807_loop:
+    ($P10) = rx804_cur."from"()
+    inc $P10
+    set rx804_pos, $P10
+    ge rx804_pos, rx804_eos, rxscan807_done
+  rxscan807_scan:
+    set_addr $I10, rxscan807_loop
+    rx804_cur."!mark_push"(0, rx804_pos, $I10)
+  rxscan807_done:
+.annotate "line", 385
+  # rx enumcharlist negate=0 zerowidth
+    ge rx804_pos, rx804_eos, rx804_fail
+    sub $I10, rx804_pos, rx804_off
+    substr $S10, rx804_tgt, $I10, 1
+    index $I11, "'", $S10
+    lt $I11, 0, rx804_fail
+  # rx subrule "quote_EXPR" subtype=capture negate=
+    rx804_cur."!cursor_pos"(rx804_pos)
+    $P10 = rx804_cur."quote_EXPR"(":q")
+    unless $P10, rx804_fail
+    rx804_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("quote_EXPR")
+    rx804_pos = $P10."pos"()
+  # rx pass
+    rx804_cur."!cursor_pass"(rx804_pos, "quote:sym<apos>")
+    rx804_cur."!cursor_debug"("PASS  ", "quote:sym<apos>", " at pos=", rx804_pos)
+    .return (rx804_cur)
+  rx804_fail:
+.annotate "line", 4
+    (rx804_rep, rx804_pos, $I10, $P10) = rx804_cur."!mark_fail"(0)
+    lt rx804_pos, -1, rx804_done
+    eq rx804_pos, -1, rx804_fail
+    jump $I10
+  rx804_done:
+    rx804_cur."!cursor_fail"()
+    rx804_cur."!cursor_debug"("FAIL  ", "quote:sym<apos>")
+    .return (rx804_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__quote:sym<apos>"  :subid("190_1261064023.05912") :method
+.annotate "line", 4
+    new $P806, "ResizablePMCArray"
+    push $P806, "'"
+    .return ($P806)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "quote:sym<dblq>"  :subid("191_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx809_tgt
+    .local int rx809_pos
+    .local int rx809_off
+    .local int rx809_eos
+    .local int rx809_rep
+    .local pmc rx809_cur
+    (rx809_cur, rx809_pos, rx809_tgt) = self."!cursor_start"()
+    rx809_cur."!cursor_debug"("START ", "quote:sym<dblq>")
+    .lex unicode:"$\x{a2}", rx809_cur
+    .local pmc match
+    .lex "$/", match
+    length rx809_eos, rx809_tgt
+    set rx809_off, 0
+    lt rx809_pos, 2, rx809_start
+    sub rx809_off, rx809_pos, 1
+    substr rx809_tgt, rx809_tgt, rx809_off
+  rx809_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan812_done
+    goto rxscan812_scan
+  rxscan812_loop:
+    ($P10) = rx809_cur."from"()
+    inc $P10
+    set rx809_pos, $P10
+    ge rx809_pos, rx809_eos, rxscan812_done
+  rxscan812_scan:
+    set_addr $I10, rxscan812_loop
+    rx809_cur."!mark_push"(0, rx809_pos, $I10)
+  rxscan812_done:
+.annotate "line", 386
+  # rx enumcharlist negate=0 zerowidth
+    ge rx809_pos, rx809_eos, rx809_fail
+    sub $I10, rx809_pos, rx809_off
+    substr $S10, rx809_tgt, $I10, 1
+    index $I11, "\"", $S10
+    lt $I11, 0, rx809_fail
+  # rx subrule "quote_EXPR" subtype=capture negate=
+    rx809_cur."!cursor_pos"(rx809_pos)
+    $P10 = rx809_cur."quote_EXPR"(":qq")
+    unless $P10, rx809_fail
+    rx809_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("quote_EXPR")
+    rx809_pos = $P10."pos"()
+  # rx pass
+    rx809_cur."!cursor_pass"(rx809_pos, "quote:sym<dblq>")
+    rx809_cur."!cursor_debug"("PASS  ", "quote:sym<dblq>", " at pos=", rx809_pos)
+    .return (rx809_cur)
+  rx809_fail:
+.annotate "line", 4
+    (rx809_rep, rx809_pos, $I10, $P10) = rx809_cur."!mark_fail"(0)
+    lt rx809_pos, -1, rx809_done
+    eq rx809_pos, -1, rx809_fail
+    jump $I10
+  rx809_done:
+    rx809_cur."!cursor_fail"()
+    rx809_cur."!cursor_debug"("FAIL  ", "quote:sym<dblq>")
+    .return (rx809_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__quote:sym<dblq>"  :subid("192_1261064023.05912") :method
+.annotate "line", 4
+    new $P811, "ResizablePMCArray"
+    push $P811, "\""
+    .return ($P811)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "quote:sym<q>"  :subid("193_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx814_tgt
+    .local int rx814_pos
+    .local int rx814_off
+    .local int rx814_eos
+    .local int rx814_rep
+    .local pmc rx814_cur
+    (rx814_cur, rx814_pos, rx814_tgt) = self."!cursor_start"()
+    rx814_cur."!cursor_debug"("START ", "quote:sym<q>")
+    .lex unicode:"$\x{a2}", rx814_cur
+    .local pmc match
+    .lex "$/", match
+    length rx814_eos, rx814_tgt
+    set rx814_off, 0
+    lt rx814_pos, 2, rx814_start
+    sub rx814_off, rx814_pos, 1
+    substr rx814_tgt, rx814_tgt, rx814_off
+  rx814_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan818_done
+    goto rxscan818_scan
+  rxscan818_loop:
+    ($P10) = rx814_cur."from"()
+    inc $P10
+    set rx814_pos, $P10
+    ge rx814_pos, rx814_eos, rxscan818_done
+  rxscan818_scan:
+    set_addr $I10, rxscan818_loop
+    rx814_cur."!mark_push"(0, rx814_pos, $I10)
+  rxscan818_done:
+.annotate "line", 387
+  # rx literal  "q"
+    add $I11, rx814_pos, 1
+    gt $I11, rx814_eos, rx814_fail
+    sub $I11, rx814_pos, rx814_off
+    substr $S10, rx814_tgt, $I11, 1
+    ne $S10, "q", rx814_fail
+    add rx814_pos, 1
+  # rx enumcharlist negate=1 zerowidth
+    ge rx814_pos, rx814_eos, rx814_fail
+    sub $I10, rx814_pos, rx814_off
+    substr $S10, rx814_tgt, $I10, 1
+    index $I11, "(", $S10
+    ge $I11, 0, rx814_fail
+  # rx subrule "ws" subtype=method negate=
+    rx814_cur."!cursor_pos"(rx814_pos)
+    $P10 = rx814_cur."ws"()
+    unless $P10, rx814_fail
+    rx814_pos = $P10."pos"()
+  # rx subrule "quote_EXPR" subtype=capture negate=
+    rx814_cur."!cursor_pos"(rx814_pos)
+    $P10 = rx814_cur."quote_EXPR"(":q")
+    unless $P10, rx814_fail
+    rx814_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("quote_EXPR")
+    rx814_pos = $P10."pos"()
+  # rx pass
+    rx814_cur."!cursor_pass"(rx814_pos, "quote:sym<q>")
+    rx814_cur."!cursor_debug"("PASS  ", "quote:sym<q>", " at pos=", rx814_pos)
+    .return (rx814_cur)
+  rx814_fail:
+.annotate "line", 4
+    (rx814_rep, rx814_pos, $I10, $P10) = rx814_cur."!mark_fail"(0)
+    lt rx814_pos, -1, rx814_done
+    eq rx814_pos, -1, rx814_fail
+    jump $I10
+  rx814_done:
+    rx814_cur."!cursor_fail"()
+    rx814_cur."!cursor_debug"("FAIL  ", "quote:sym<q>")
+    .return (rx814_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__quote:sym<q>"  :subid("194_1261064023.05912") :method
+.annotate "line", 4
+    $P816 = self."!PREFIX__!subrule"("", "q")
+    new $P817, "ResizablePMCArray"
+    push $P817, $P816
+    .return ($P817)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "quote:sym<qq>"  :subid("195_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx820_tgt
+    .local int rx820_pos
+    .local int rx820_off
+    .local int rx820_eos
+    .local int rx820_rep
+    .local pmc rx820_cur
+    (rx820_cur, rx820_pos, rx820_tgt) = self."!cursor_start"()
+    rx820_cur."!cursor_debug"("START ", "quote:sym<qq>")
+    .lex unicode:"$\x{a2}", rx820_cur
+    .local pmc match
+    .lex "$/", match
+    length rx820_eos, rx820_tgt
+    set rx820_off, 0
+    lt rx820_pos, 2, rx820_start
+    sub rx820_off, rx820_pos, 1
+    substr rx820_tgt, rx820_tgt, rx820_off
+  rx820_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan824_done
+    goto rxscan824_scan
+  rxscan824_loop:
+    ($P10) = rx820_cur."from"()
+    inc $P10
+    set rx820_pos, $P10
+    ge rx820_pos, rx820_eos, rxscan824_done
+  rxscan824_scan:
+    set_addr $I10, rxscan824_loop
+    rx820_cur."!mark_push"(0, rx820_pos, $I10)
+  rxscan824_done:
+.annotate "line", 388
+  # rx literal  "qq"
+    add $I11, rx820_pos, 2
+    gt $I11, rx820_eos, rx820_fail
+    sub $I11, rx820_pos, rx820_off
+    substr $S10, rx820_tgt, $I11, 2
+    ne $S10, "qq", rx820_fail
+    add rx820_pos, 2
+  # rx enumcharlist negate=1 zerowidth
+    ge rx820_pos, rx820_eos, rx820_fail
+    sub $I10, rx820_pos, rx820_off
+    substr $S10, rx820_tgt, $I10, 1
+    index $I11, "(", $S10
+    ge $I11, 0, rx820_fail
+  # rx subrule "ws" subtype=method negate=
+    rx820_cur."!cursor_pos"(rx820_pos)
+    $P10 = rx820_cur."ws"()
+    unless $P10, rx820_fail
+    rx820_pos = $P10."pos"()
+  # rx subrule "quote_EXPR" subtype=capture negate=
+    rx820_cur."!cursor_pos"(rx820_pos)
+    $P10 = rx820_cur."quote_EXPR"(":qq")
+    unless $P10, rx820_fail
+    rx820_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("quote_EXPR")
+    rx820_pos = $P10."pos"()
+  # rx pass
+    rx820_cur."!cursor_pass"(rx820_pos, "quote:sym<qq>")
+    rx820_cur."!cursor_debug"("PASS  ", "quote:sym<qq>", " at pos=", rx820_pos)
+    .return (rx820_cur)
+  rx820_fail:
+.annotate "line", 4
+    (rx820_rep, rx820_pos, $I10, $P10) = rx820_cur."!mark_fail"(0)
+    lt rx820_pos, -1, rx820_done
+    eq rx820_pos, -1, rx820_fail
+    jump $I10
+  rx820_done:
+    rx820_cur."!cursor_fail"()
+    rx820_cur."!cursor_debug"("FAIL  ", "quote:sym<qq>")
+    .return (rx820_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__quote:sym<qq>"  :subid("196_1261064023.05912") :method
+.annotate "line", 4
+    $P822 = self."!PREFIX__!subrule"("", "qq")
+    new $P823, "ResizablePMCArray"
+    push $P823, $P822
+    .return ($P823)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "quote:sym<Q>"  :subid("197_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx826_tgt
+    .local int rx826_pos
+    .local int rx826_off
+    .local int rx826_eos
+    .local int rx826_rep
+    .local pmc rx826_cur
+    (rx826_cur, rx826_pos, rx826_tgt) = self."!cursor_start"()
+    rx826_cur."!cursor_debug"("START ", "quote:sym<Q>")
+    .lex unicode:"$\x{a2}", rx826_cur
+    .local pmc match
+    .lex "$/", match
+    length rx826_eos, rx826_tgt
+    set rx826_off, 0
+    lt rx826_pos, 2, rx826_start
+    sub rx826_off, rx826_pos, 1
+    substr rx826_tgt, rx826_tgt, rx826_off
+  rx826_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan830_done
+    goto rxscan830_scan
+  rxscan830_loop:
+    ($P10) = rx826_cur."from"()
+    inc $P10
+    set rx826_pos, $P10
+    ge rx826_pos, rx826_eos, rxscan830_done
+  rxscan830_scan:
+    set_addr $I10, rxscan830_loop
+    rx826_cur."!mark_push"(0, rx826_pos, $I10)
+  rxscan830_done:
+.annotate "line", 389
+  # rx literal  "Q"
+    add $I11, rx826_pos, 1
+    gt $I11, rx826_eos, rx826_fail
+    sub $I11, rx826_pos, rx826_off
+    substr $S10, rx826_tgt, $I11, 1
+    ne $S10, "Q", rx826_fail
+    add rx826_pos, 1
+  # rx enumcharlist negate=1 zerowidth
+    ge rx826_pos, rx826_eos, rx826_fail
+    sub $I10, rx826_pos, rx826_off
+    substr $S10, rx826_tgt, $I10, 1
+    index $I11, "(", $S10
+    ge $I11, 0, rx826_fail
+  # rx subrule "ws" subtype=method negate=
+    rx826_cur."!cursor_pos"(rx826_pos)
+    $P10 = rx826_cur."ws"()
+    unless $P10, rx826_fail
+    rx826_pos = $P10."pos"()
+  # rx subrule "quote_EXPR" subtype=capture negate=
+    rx826_cur."!cursor_pos"(rx826_pos)
+    $P10 = rx826_cur."quote_EXPR"()
+    unless $P10, rx826_fail
+    rx826_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("quote_EXPR")
+    rx826_pos = $P10."pos"()
+  # rx pass
+    rx826_cur."!cursor_pass"(rx826_pos, "quote:sym<Q>")
+    rx826_cur."!cursor_debug"("PASS  ", "quote:sym<Q>", " at pos=", rx826_pos)
+    .return (rx826_cur)
+  rx826_fail:
+.annotate "line", 4
+    (rx826_rep, rx826_pos, $I10, $P10) = rx826_cur."!mark_fail"(0)
+    lt rx826_pos, -1, rx826_done
+    eq rx826_pos, -1, rx826_fail
+    jump $I10
+  rx826_done:
+    rx826_cur."!cursor_fail"()
+    rx826_cur."!cursor_debug"("FAIL  ", "quote:sym<Q>")
+    .return (rx826_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__quote:sym<Q>"  :subid("198_1261064023.05912") :method
+.annotate "line", 4
+    $P828 = self."!PREFIX__!subrule"("", "Q")
+    new $P829, "ResizablePMCArray"
+    push $P829, $P828
+    .return ($P829)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "quote:sym<Q:PIR>"  :subid("199_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx832_tgt
+    .local int rx832_pos
+    .local int rx832_off
+    .local int rx832_eos
+    .local int rx832_rep
+    .local pmc rx832_cur
+    (rx832_cur, rx832_pos, rx832_tgt) = self."!cursor_start"()
+    rx832_cur."!cursor_debug"("START ", "quote:sym<Q:PIR>")
+    .lex unicode:"$\x{a2}", rx832_cur
+    .local pmc match
+    .lex "$/", match
+    length rx832_eos, rx832_tgt
+    set rx832_off, 0
+    lt rx832_pos, 2, rx832_start
+    sub rx832_off, rx832_pos, 1
+    substr rx832_tgt, rx832_tgt, rx832_off
+  rx832_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan836_done
+    goto rxscan836_scan
+  rxscan836_loop:
+    ($P10) = rx832_cur."from"()
+    inc $P10
+    set rx832_pos, $P10
+    ge rx832_pos, rx832_eos, rxscan836_done
+  rxscan836_scan:
+    set_addr $I10, rxscan836_loop
+    rx832_cur."!mark_push"(0, rx832_pos, $I10)
+  rxscan836_done:
+.annotate "line", 390
+  # rx literal  "Q:PIR"
+    add $I11, rx832_pos, 5
+    gt $I11, rx832_eos, rx832_fail
+    sub $I11, rx832_pos, rx832_off
+    substr $S10, rx832_tgt, $I11, 5
+    ne $S10, "Q:PIR", rx832_fail
+    add rx832_pos, 5
+  # rx subrule "ws" subtype=method negate=
+    rx832_cur."!cursor_pos"(rx832_pos)
+    $P10 = rx832_cur."ws"()
+    unless $P10, rx832_fail
+    rx832_pos = $P10."pos"()
+  # rx subrule "quote_EXPR" subtype=capture negate=
+    rx832_cur."!cursor_pos"(rx832_pos)
+    $P10 = rx832_cur."quote_EXPR"()
+    unless $P10, rx832_fail
+    rx832_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("quote_EXPR")
+    rx832_pos = $P10."pos"()
+  # rx pass
+    rx832_cur."!cursor_pass"(rx832_pos, "quote:sym<Q:PIR>")
+    rx832_cur."!cursor_debug"("PASS  ", "quote:sym<Q:PIR>", " at pos=", rx832_pos)
+    .return (rx832_cur)
+  rx832_fail:
+.annotate "line", 4
+    (rx832_rep, rx832_pos, $I10, $P10) = rx832_cur."!mark_fail"(0)
+    lt rx832_pos, -1, rx832_done
+    eq rx832_pos, -1, rx832_fail
+    jump $I10
+  rx832_done:
+    rx832_cur."!cursor_fail"()
+    rx832_cur."!cursor_debug"("FAIL  ", "quote:sym<Q:PIR>")
+    .return (rx832_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__quote:sym<Q:PIR>"  :subid("200_1261064023.05912") :method
+.annotate "line", 4
+    $P834 = self."!PREFIX__!subrule"("", "Q:PIR")
+    new $P835, "ResizablePMCArray"
+    push $P835, $P834
+    .return ($P835)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "quote:sym</ />"  :subid("201_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx838_tgt
+    .local int rx838_pos
+    .local int rx838_off
+    .local int rx838_eos
+    .local int rx838_rep
+    .local pmc rx838_cur
+    (rx838_cur, rx838_pos, rx838_tgt) = self."!cursor_start"()
+    rx838_cur."!cursor_debug"("START ", "quote:sym</ />")
+    .lex unicode:"$\x{a2}", rx838_cur
+    .local pmc match
+    .lex "$/", match
+    length rx838_eos, rx838_tgt
+    set rx838_off, 0
+    lt rx838_pos, 2, rx838_start
+    sub rx838_off, rx838_pos, 1
+    substr rx838_tgt, rx838_tgt, rx838_off
+  rx838_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan842_done
+    goto rxscan842_scan
+  rxscan842_loop:
+    ($P10) = rx838_cur."from"()
+    inc $P10
+    set rx838_pos, $P10
+    ge rx838_pos, rx838_eos, rxscan842_done
+  rxscan842_scan:
+    set_addr $I10, rxscan842_loop
+    rx838_cur."!mark_push"(0, rx838_pos, $I10)
+  rxscan842_done:
+.annotate "line", 392
+  # rx literal  "/"
+    add $I11, rx838_pos, 1
+    gt $I11, rx838_eos, rx838_fail
+    sub $I11, rx838_pos, rx838_off
+    substr $S10, rx838_tgt, $I11, 1
+    ne $S10, "/", rx838_fail
+    add rx838_pos, 1
+.annotate "line", 393
+  # rx subrule "newpad" subtype=method negate=
+    rx838_cur."!cursor_pos"(rx838_pos)
+    $P10 = rx838_cur."newpad"()
+    unless $P10, rx838_fail
+    rx838_pos = $P10."pos"()
+.annotate "line", 394
+  # rx reduce name="quote:sym</ />" key="open"
+    rx838_cur."!cursor_pos"(rx838_pos)
+    rx838_cur."!reduce"("quote:sym</ />", "open")
+.annotate "line", 395
+  # rx subrule "LANG" subtype=capture negate=
+    rx838_cur."!cursor_pos"(rx838_pos)
+    $P10 = rx838_cur."LANG"("Regex", "nibbler")
+    unless $P10, rx838_fail
+    rx838_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("p6regex")
+    rx838_pos = $P10."pos"()
+.annotate "line", 396
+  # rx literal  "/"
+    add $I11, rx838_pos, 1
+    gt $I11, rx838_eos, rx838_fail
+    sub $I11, rx838_pos, rx838_off
+    substr $S10, rx838_tgt, $I11, 1
+    ne $S10, "/", rx838_fail
+    add rx838_pos, 1
+.annotate "line", 391
+  # rx pass
+    rx838_cur."!cursor_pass"(rx838_pos, "quote:sym</ />")
+    rx838_cur."!cursor_debug"("PASS  ", "quote:sym</ />", " at pos=", rx838_pos)
+    .return (rx838_cur)
+  rx838_fail:
+.annotate "line", 4
+    (rx838_rep, rx838_pos, $I10, $P10) = rx838_cur."!mark_fail"(0)
+    lt rx838_pos, -1, rx838_done
+    eq rx838_pos, -1, rx838_fail
+    jump $I10
+  rx838_done:
+    rx838_cur."!cursor_fail"()
+    rx838_cur."!cursor_debug"("FAIL  ", "quote:sym</ />")
+    .return (rx838_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__quote:sym</ />"  :subid("202_1261064023.05912") :method
+.annotate "line", 4
+    $P840 = self."!PREFIX__!subrule"("", "/")
+    new $P841, "ResizablePMCArray"
+    push $P841, $P840
+    .return ($P841)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "quote_escape:sym<$>"  :subid("203_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx844_tgt
+    .local int rx844_pos
+    .local int rx844_off
+    .local int rx844_eos
+    .local int rx844_rep
+    .local pmc rx844_cur
+    (rx844_cur, rx844_pos, rx844_tgt) = self."!cursor_start"()
+    rx844_cur."!cursor_debug"("START ", "quote_escape:sym<$>")
+    .lex unicode:"$\x{a2}", rx844_cur
+    .local pmc match
+    .lex "$/", match
+    length rx844_eos, rx844_tgt
+    set rx844_off, 0
+    lt rx844_pos, 2, rx844_start
+    sub rx844_off, rx844_pos, 1
+    substr rx844_tgt, rx844_tgt, rx844_off
+  rx844_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan847_done
+    goto rxscan847_scan
+  rxscan847_loop:
+    ($P10) = rx844_cur."from"()
+    inc $P10
+    set rx844_pos, $P10
+    ge rx844_pos, rx844_eos, rxscan847_done
+  rxscan847_scan:
+    set_addr $I10, rxscan847_loop
+    rx844_cur."!mark_push"(0, rx844_pos, $I10)
+  rxscan847_done:
+.annotate "line", 399
+  # rx enumcharlist negate=0 zerowidth
+    ge rx844_pos, rx844_eos, rx844_fail
+    sub $I10, rx844_pos, rx844_off
+    substr $S10, rx844_tgt, $I10, 1
+    index $I11, "$", $S10
+    lt $I11, 0, rx844_fail
+  # rx subrule "quotemod_check" subtype=zerowidth negate=
+    rx844_cur."!cursor_pos"(rx844_pos)
+    $P10 = rx844_cur."quotemod_check"("s")
+    unless $P10, rx844_fail
+  # rx subrule "variable" subtype=capture negate=
+    rx844_cur."!cursor_pos"(rx844_pos)
+    $P10 = rx844_cur."variable"()
+    unless $P10, rx844_fail
+    rx844_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("variable")
+    rx844_pos = $P10."pos"()
+  # rx pass
+    rx844_cur."!cursor_pass"(rx844_pos, "quote_escape:sym<$>")
+    rx844_cur."!cursor_debug"("PASS  ", "quote_escape:sym<$>", " at pos=", rx844_pos)
+    .return (rx844_cur)
+  rx844_fail:
+.annotate "line", 4
+    (rx844_rep, rx844_pos, $I10, $P10) = rx844_cur."!mark_fail"(0)
+    lt rx844_pos, -1, rx844_done
+    eq rx844_pos, -1, rx844_fail
+    jump $I10
+  rx844_done:
+    rx844_cur."!cursor_fail"()
+    rx844_cur."!cursor_debug"("FAIL  ", "quote_escape:sym<$>")
+    .return (rx844_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__quote_escape:sym<$>"  :subid("204_1261064023.05912") :method
+.annotate "line", 4
+    new $P846, "ResizablePMCArray"
+    push $P846, "$"
+    .return ($P846)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "quote_escape:sym<{ }>"  :subid("205_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx849_tgt
+    .local int rx849_pos
+    .local int rx849_off
+    .local int rx849_eos
+    .local int rx849_rep
+    .local pmc rx849_cur
+    (rx849_cur, rx849_pos, rx849_tgt) = self."!cursor_start"()
+    rx849_cur."!cursor_debug"("START ", "quote_escape:sym<{ }>")
+    .lex unicode:"$\x{a2}", rx849_cur
+    .local pmc match
+    .lex "$/", match
+    length rx849_eos, rx849_tgt
+    set rx849_off, 0
+    lt rx849_pos, 2, rx849_start
+    sub rx849_off, rx849_pos, 1
+    substr rx849_tgt, rx849_tgt, rx849_off
+  rx849_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan852_done
+    goto rxscan852_scan
+  rxscan852_loop:
+    ($P10) = rx849_cur."from"()
+    inc $P10
+    set rx849_pos, $P10
+    ge rx849_pos, rx849_eos, rxscan852_done
+  rxscan852_scan:
+    set_addr $I10, rxscan852_loop
+    rx849_cur."!mark_push"(0, rx849_pos, $I10)
+  rxscan852_done:
+.annotate "line", 400
+  # rx enumcharlist negate=0 zerowidth
+    ge rx849_pos, rx849_eos, rx849_fail
+    sub $I10, rx849_pos, rx849_off
+    substr $S10, rx849_tgt, $I10, 1
+    index $I11, "{", $S10
+    lt $I11, 0, rx849_fail
+  # rx subrule "quotemod_check" subtype=zerowidth negate=
+    rx849_cur."!cursor_pos"(rx849_pos)
+    $P10 = rx849_cur."quotemod_check"("c")
+    unless $P10, rx849_fail
+  # rx subrule "block" subtype=capture negate=
+    rx849_cur."!cursor_pos"(rx849_pos)
+    $P10 = rx849_cur."block"()
+    unless $P10, rx849_fail
+    rx849_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("block")
+    rx849_pos = $P10."pos"()
+  # rx pass
+    rx849_cur."!cursor_pass"(rx849_pos, "quote_escape:sym<{ }>")
+    rx849_cur."!cursor_debug"("PASS  ", "quote_escape:sym<{ }>", " at pos=", rx849_pos)
+    .return (rx849_cur)
+  rx849_fail:
+.annotate "line", 4
+    (rx849_rep, rx849_pos, $I10, $P10) = rx849_cur."!mark_fail"(0)
+    lt rx849_pos, -1, rx849_done
+    eq rx849_pos, -1, rx849_fail
+    jump $I10
+  rx849_done:
+    rx849_cur."!cursor_fail"()
+    rx849_cur."!cursor_debug"("FAIL  ", "quote_escape:sym<{ }>")
+    .return (rx849_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__quote_escape:sym<{ }>"  :subid("206_1261064023.05912") :method
+.annotate "line", 4
+    new $P851, "ResizablePMCArray"
+    push $P851, "{"
+    .return ($P851)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "circumfix:sym<( )>"  :subid("207_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx854_tgt
+    .local int rx854_pos
+    .local int rx854_off
+    .local int rx854_eos
+    .local int rx854_rep
+    .local pmc rx854_cur
+    (rx854_cur, rx854_pos, rx854_tgt) = self."!cursor_start"()
+    rx854_cur."!cursor_debug"("START ", "circumfix:sym<( )>")
+    rx854_cur."!cursor_caparray"("EXPR")
+    .lex unicode:"$\x{a2}", rx854_cur
+    .local pmc match
+    .lex "$/", match
+    length rx854_eos, rx854_tgt
+    set rx854_off, 0
+    lt rx854_pos, 2, rx854_start
+    sub rx854_off, rx854_pos, 1
+    substr rx854_tgt, rx854_tgt, rx854_off
+  rx854_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan858_done
+    goto rxscan858_scan
+  rxscan858_loop:
+    ($P10) = rx854_cur."from"()
+    inc $P10
+    set rx854_pos, $P10
+    ge rx854_pos, rx854_eos, rxscan858_done
+  rxscan858_scan:
+    set_addr $I10, rxscan858_loop
+    rx854_cur."!mark_push"(0, rx854_pos, $I10)
+  rxscan858_done:
+.annotate "line", 402
+  # rx literal  "("
+    add $I11, rx854_pos, 1
+    gt $I11, rx854_eos, rx854_fail
+    sub $I11, rx854_pos, rx854_off
+    substr $S10, rx854_tgt, $I11, 1
+    ne $S10, "(", rx854_fail
+    add rx854_pos, 1
+  # rx subrule "ws" subtype=method negate=
+    rx854_cur."!cursor_pos"(rx854_pos)
+    $P10 = rx854_cur."ws"()
+    unless $P10, rx854_fail
+    rx854_pos = $P10."pos"()
+  # rx rxquantr859 ** 0..1
+    set_addr $I860, rxquantr859_done
+    rx854_cur."!mark_push"(0, rx854_pos, $I860)
+  rxquantr859_loop:
+  # rx subrule "EXPR" subtype=capture negate=
+    rx854_cur."!cursor_pos"(rx854_pos)
+    $P10 = rx854_cur."EXPR"()
+    unless $P10, rx854_fail
+    rx854_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("EXPR")
+    rx854_pos = $P10."pos"()
+    (rx854_rep) = rx854_cur."!mark_commit"($I860)
+  rxquantr859_done:
+  # rx literal  ")"
+    add $I11, rx854_pos, 1
+    gt $I11, rx854_eos, rx854_fail
+    sub $I11, rx854_pos, rx854_off
+    substr $S10, rx854_tgt, $I11, 1
+    ne $S10, ")", rx854_fail
+    add rx854_pos, 1
+  # rx pass
+    rx854_cur."!cursor_pass"(rx854_pos, "circumfix:sym<( )>")
+    rx854_cur."!cursor_debug"("PASS  ", "circumfix:sym<( )>", " at pos=", rx854_pos)
+    .return (rx854_cur)
+  rx854_fail:
+.annotate "line", 4
+    (rx854_rep, rx854_pos, $I10, $P10) = rx854_cur."!mark_fail"(0)
+    lt rx854_pos, -1, rx854_done
+    eq rx854_pos, -1, rx854_fail
+    jump $I10
+  rx854_done:
+    rx854_cur."!cursor_fail"()
+    rx854_cur."!cursor_debug"("FAIL  ", "circumfix:sym<( )>")
+    .return (rx854_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__circumfix:sym<( )>"  :subid("208_1261064023.05912") :method
+.annotate "line", 4
+    $P856 = self."!PREFIX__!subrule"("", "(")
+    new $P857, "ResizablePMCArray"
+    push $P857, $P856
+    .return ($P857)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "circumfix:sym<[ ]>"  :subid("209_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx862_tgt
+    .local int rx862_pos
+    .local int rx862_off
+    .local int rx862_eos
+    .local int rx862_rep
+    .local pmc rx862_cur
+    (rx862_cur, rx862_pos, rx862_tgt) = self."!cursor_start"()
+    rx862_cur."!cursor_debug"("START ", "circumfix:sym<[ ]>")
+    rx862_cur."!cursor_caparray"("EXPR")
+    .lex unicode:"$\x{a2}", rx862_cur
+    .local pmc match
+    .lex "$/", match
+    length rx862_eos, rx862_tgt
+    set rx862_off, 0
+    lt rx862_pos, 2, rx862_start
+    sub rx862_off, rx862_pos, 1
+    substr rx862_tgt, rx862_tgt, rx862_off
+  rx862_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan866_done
+    goto rxscan866_scan
+  rxscan866_loop:
+    ($P10) = rx862_cur."from"()
+    inc $P10
+    set rx862_pos, $P10
+    ge rx862_pos, rx862_eos, rxscan866_done
+  rxscan866_scan:
+    set_addr $I10, rxscan866_loop
+    rx862_cur."!mark_push"(0, rx862_pos, $I10)
+  rxscan866_done:
+.annotate "line", 403
+  # rx literal  "["
+    add $I11, rx862_pos, 1
+    gt $I11, rx862_eos, rx862_fail
+    sub $I11, rx862_pos, rx862_off
+    substr $S10, rx862_tgt, $I11, 1
+    ne $S10, "[", rx862_fail
+    add rx862_pos, 1
+  # rx subrule "ws" subtype=method negate=
+    rx862_cur."!cursor_pos"(rx862_pos)
+    $P10 = rx862_cur."ws"()
+    unless $P10, rx862_fail
+    rx862_pos = $P10."pos"()
+  # rx rxquantr867 ** 0..1
+    set_addr $I868, rxquantr867_done
+    rx862_cur."!mark_push"(0, rx862_pos, $I868)
+  rxquantr867_loop:
+  # rx subrule "EXPR" subtype=capture negate=
+    rx862_cur."!cursor_pos"(rx862_pos)
+    $P10 = rx862_cur."EXPR"()
+    unless $P10, rx862_fail
+    rx862_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("EXPR")
+    rx862_pos = $P10."pos"()
+    (rx862_rep) = rx862_cur."!mark_commit"($I868)
+  rxquantr867_done:
+  # rx literal  "]"
+    add $I11, rx862_pos, 1
+    gt $I11, rx862_eos, rx862_fail
+    sub $I11, rx862_pos, rx862_off
+    substr $S10, rx862_tgt, $I11, 1
+    ne $S10, "]", rx862_fail
+    add rx862_pos, 1
+  # rx pass
+    rx862_cur."!cursor_pass"(rx862_pos, "circumfix:sym<[ ]>")
+    rx862_cur."!cursor_debug"("PASS  ", "circumfix:sym<[ ]>", " at pos=", rx862_pos)
+    .return (rx862_cur)
+  rx862_fail:
+.annotate "line", 4
+    (rx862_rep, rx862_pos, $I10, $P10) = rx862_cur."!mark_fail"(0)
+    lt rx862_pos, -1, rx862_done
+    eq rx862_pos, -1, rx862_fail
+    jump $I10
+  rx862_done:
+    rx862_cur."!cursor_fail"()
+    rx862_cur."!cursor_debug"("FAIL  ", "circumfix:sym<[ ]>")
+    .return (rx862_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__circumfix:sym<[ ]>"  :subid("210_1261064023.05912") :method
+.annotate "line", 4
+    $P864 = self."!PREFIX__!subrule"("", "[")
+    new $P865, "ResizablePMCArray"
+    push $P865, $P864
+    .return ($P865)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "circumfix:sym<ang>"  :subid("211_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx870_tgt
+    .local int rx870_pos
+    .local int rx870_off
+    .local int rx870_eos
+    .local int rx870_rep
+    .local pmc rx870_cur
+    (rx870_cur, rx870_pos, rx870_tgt) = self."!cursor_start"()
+    rx870_cur."!cursor_debug"("START ", "circumfix:sym<ang>")
+    .lex unicode:"$\x{a2}", rx870_cur
+    .local pmc match
+    .lex "$/", match
+    length rx870_eos, rx870_tgt
+    set rx870_off, 0
+    lt rx870_pos, 2, rx870_start
+    sub rx870_off, rx870_pos, 1
+    substr rx870_tgt, rx870_tgt, rx870_off
+  rx870_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan873_done
+    goto rxscan873_scan
+  rxscan873_loop:
+    ($P10) = rx870_cur."from"()
+    inc $P10
+    set rx870_pos, $P10
+    ge rx870_pos, rx870_eos, rxscan873_done
+  rxscan873_scan:
+    set_addr $I10, rxscan873_loop
+    rx870_cur."!mark_push"(0, rx870_pos, $I10)
+  rxscan873_done:
+.annotate "line", 404
+  # rx enumcharlist negate=0 zerowidth
+    ge rx870_pos, rx870_eos, rx870_fail
+    sub $I10, rx870_pos, rx870_off
+    substr $S10, rx870_tgt, $I10, 1
+    index $I11, "<", $S10
+    lt $I11, 0, rx870_fail
+  # rx subrule "quote_EXPR" subtype=capture negate=
+    rx870_cur."!cursor_pos"(rx870_pos)
+    $P10 = rx870_cur."quote_EXPR"(":q", ":w")
+    unless $P10, rx870_fail
+    rx870_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("quote_EXPR")
+    rx870_pos = $P10."pos"()
+  # rx pass
+    rx870_cur."!cursor_pass"(rx870_pos, "circumfix:sym<ang>")
+    rx870_cur."!cursor_debug"("PASS  ", "circumfix:sym<ang>", " at pos=", rx870_pos)
+    .return (rx870_cur)
+  rx870_fail:
+.annotate "line", 4
+    (rx870_rep, rx870_pos, $I10, $P10) = rx870_cur."!mark_fail"(0)
+    lt rx870_pos, -1, rx870_done
+    eq rx870_pos, -1, rx870_fail
+    jump $I10
+  rx870_done:
+    rx870_cur."!cursor_fail"()
+    rx870_cur."!cursor_debug"("FAIL  ", "circumfix:sym<ang>")
+    .return (rx870_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__circumfix:sym<ang>"  :subid("212_1261064023.05912") :method
+.annotate "line", 4
+    new $P872, "ResizablePMCArray"
+    push $P872, "<"
+    .return ($P872)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub unicode:"circumfix:sym<\x{ab} \x{bb}>"  :subid("213_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx875_tgt
+    .local int rx875_pos
+    .local int rx875_off
+    .local int rx875_eos
+    .local int rx875_rep
+    .local pmc rx875_cur
+    (rx875_cur, rx875_pos, rx875_tgt) = self."!cursor_start"()
+    rx875_cur."!cursor_debug"("START ", unicode:"circumfix:sym<\x{ab} \x{bb}>")
+    .lex unicode:"$\x{a2}", rx875_cur
+    .local pmc match
+    .lex "$/", match
+    length rx875_eos, rx875_tgt
+    set rx875_off, 0
+    lt rx875_pos, 2, rx875_start
+    sub rx875_off, rx875_pos, 1
+    substr rx875_tgt, rx875_tgt, rx875_off
+  rx875_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan878_done
+    goto rxscan878_scan
+  rxscan878_loop:
+    ($P10) = rx875_cur."from"()
+    inc $P10
+    set rx875_pos, $P10
+    ge rx875_pos, rx875_eos, rxscan878_done
+  rxscan878_scan:
+    set_addr $I10, rxscan878_loop
+    rx875_cur."!mark_push"(0, rx875_pos, $I10)
+  rxscan878_done:
+.annotate "line", 405
+  # rx enumcharlist negate=0 zerowidth
+    ge rx875_pos, rx875_eos, rx875_fail
+    sub $I10, rx875_pos, rx875_off
+    substr $S10, rx875_tgt, $I10, 1
+    index $I11, unicode:"\x{ab}", $S10
+    lt $I11, 0, rx875_fail
+  # rx subrule "quote_EXPR" subtype=capture negate=
+    rx875_cur."!cursor_pos"(rx875_pos)
+    $P10 = rx875_cur."quote_EXPR"(":qq", ":w")
+    unless $P10, rx875_fail
+    rx875_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("quote_EXPR")
+    rx875_pos = $P10."pos"()
+  # rx pass
+    rx875_cur."!cursor_pass"(rx875_pos, unicode:"circumfix:sym<\x{ab} \x{bb}>")
+    rx875_cur."!cursor_debug"("PASS  ", unicode:"circumfix:sym<\x{ab} \x{bb}>", " at pos=", rx875_pos)
+    .return (rx875_cur)
+  rx875_fail:
+.annotate "line", 4
+    (rx875_rep, rx875_pos, $I10, $P10) = rx875_cur."!mark_fail"(0)
+    lt rx875_pos, -1, rx875_done
+    eq rx875_pos, -1, rx875_fail
+    jump $I10
+  rx875_done:
+    rx875_cur."!cursor_fail"()
+    rx875_cur."!cursor_debug"("FAIL  ", unicode:"circumfix:sym<\x{ab} \x{bb}>")
+    .return (rx875_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub unicode:"!PREFIX__circumfix:sym<\x{ab} \x{bb}>"  :subid("214_1261064023.05912") :method
+.annotate "line", 4
+    new $P877, "ResizablePMCArray"
+    push $P877, unicode:"\x{ab}"
+    .return ($P877)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "circumfix:sym<{ }>"  :subid("215_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx880_tgt
+    .local int rx880_pos
+    .local int rx880_off
+    .local int rx880_eos
+    .local int rx880_rep
+    .local pmc rx880_cur
+    (rx880_cur, rx880_pos, rx880_tgt) = self."!cursor_start"()
+    rx880_cur."!cursor_debug"("START ", "circumfix:sym<{ }>")
+    .lex unicode:"$\x{a2}", rx880_cur
+    .local pmc match
+    .lex "$/", match
+    length rx880_eos, rx880_tgt
+    set rx880_off, 0
+    lt rx880_pos, 2, rx880_start
+    sub rx880_off, rx880_pos, 1
+    substr rx880_tgt, rx880_tgt, rx880_off
+  rx880_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan883_done
+    goto rxscan883_scan
+  rxscan883_loop:
+    ($P10) = rx880_cur."from"()
+    inc $P10
+    set rx880_pos, $P10
+    ge rx880_pos, rx880_eos, rxscan883_done
+  rxscan883_scan:
+    set_addr $I10, rxscan883_loop
+    rx880_cur."!mark_push"(0, rx880_pos, $I10)
+  rxscan883_done:
+.annotate "line", 406
+  # rx enumcharlist negate=0 zerowidth
+    ge rx880_pos, rx880_eos, rx880_fail
+    sub $I10, rx880_pos, rx880_off
+    substr $S10, rx880_tgt, $I10, 1
+    index $I11, "{", $S10
+    lt $I11, 0, rx880_fail
+  # rx subrule "pblock" subtype=capture negate=
+    rx880_cur."!cursor_pos"(rx880_pos)
+    $P10 = rx880_cur."pblock"()
+    unless $P10, rx880_fail
+    rx880_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("pblock")
+    rx880_pos = $P10."pos"()
+  # rx pass
+    rx880_cur."!cursor_pass"(rx880_pos, "circumfix:sym<{ }>")
+    rx880_cur."!cursor_debug"("PASS  ", "circumfix:sym<{ }>", " at pos=", rx880_pos)
+    .return (rx880_cur)
+  rx880_fail:
+.annotate "line", 4
+    (rx880_rep, rx880_pos, $I10, $P10) = rx880_cur."!mark_fail"(0)
+    lt rx880_pos, -1, rx880_done
+    eq rx880_pos, -1, rx880_fail
+    jump $I10
+  rx880_done:
+    rx880_cur."!cursor_fail"()
+    rx880_cur."!cursor_debug"("FAIL  ", "circumfix:sym<{ }>")
+    .return (rx880_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__circumfix:sym<{ }>"  :subid("216_1261064023.05912") :method
+.annotate "line", 4
+    new $P882, "ResizablePMCArray"
+    push $P882, "{"
+    .return ($P882)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "circumfix:sym<sigil>"  :subid("217_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx885_tgt
+    .local int rx885_pos
+    .local int rx885_off
+    .local int rx885_eos
+    .local int rx885_rep
+    .local pmc rx885_cur
+    (rx885_cur, rx885_pos, rx885_tgt) = self."!cursor_start"()
+    rx885_cur."!cursor_debug"("START ", "circumfix:sym<sigil>")
+    .lex unicode:"$\x{a2}", rx885_cur
+    .local pmc match
+    .lex "$/", match
+    length rx885_eos, rx885_tgt
+    set rx885_off, 0
+    lt rx885_pos, 2, rx885_start
+    sub rx885_off, rx885_pos, 1
+    substr rx885_tgt, rx885_tgt, rx885_off
+  rx885_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan889_done
+    goto rxscan889_scan
+  rxscan889_loop:
+    ($P10) = rx885_cur."from"()
+    inc $P10
+    set rx885_pos, $P10
+    ge rx885_pos, rx885_eos, rxscan889_done
+  rxscan889_scan:
+    set_addr $I10, rxscan889_loop
+    rx885_cur."!mark_push"(0, rx885_pos, $I10)
+  rxscan889_done:
+.annotate "line", 407
+  # rx subrule "sigil" subtype=capture negate=
+    rx885_cur."!cursor_pos"(rx885_pos)
+    $P10 = rx885_cur."sigil"()
+    unless $P10, rx885_fail
+    rx885_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sigil")
+    rx885_pos = $P10."pos"()
+  # rx literal  "("
+    add $I11, rx885_pos, 1
+    gt $I11, rx885_eos, rx885_fail
+    sub $I11, rx885_pos, rx885_off
+    substr $S10, rx885_tgt, $I11, 1
+    ne $S10, "(", rx885_fail
+    add rx885_pos, 1
+  # rx subrule "semilist" subtype=capture negate=
+    rx885_cur."!cursor_pos"(rx885_pos)
+    $P10 = rx885_cur."semilist"()
+    unless $P10, rx885_fail
+    rx885_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("semilist")
+    rx885_pos = $P10."pos"()
+  alt890_0:
+    set_addr $I10, alt890_1
+    rx885_cur."!mark_push"(0, rx885_pos, $I10)
+  # rx literal  ")"
+    add $I11, rx885_pos, 1
+    gt $I11, rx885_eos, rx885_fail
+    sub $I11, rx885_pos, rx885_off
+    substr $S10, rx885_tgt, $I11, 1
+    ne $S10, ")", rx885_fail
+    add rx885_pos, 1
+    goto alt890_end
+  alt890_1:
+  # rx subrule "FAILGOAL" subtype=method negate=
+    rx885_cur."!cursor_pos"(rx885_pos)
+    $P10 = rx885_cur."FAILGOAL"("')'")
+    unless $P10, rx885_fail
+    rx885_pos = $P10."pos"()
+  alt890_end:
+  # rx pass
+    rx885_cur."!cursor_pass"(rx885_pos, "circumfix:sym<sigil>")
+    rx885_cur."!cursor_debug"("PASS  ", "circumfix:sym<sigil>", " at pos=", rx885_pos)
+    .return (rx885_cur)
+  rx885_fail:
+.annotate "line", 4
+    (rx885_rep, rx885_pos, $I10, $P10) = rx885_cur."!mark_fail"(0)
+    lt rx885_pos, -1, rx885_done
+    eq rx885_pos, -1, rx885_fail
+    jump $I10
+  rx885_done:
+    rx885_cur."!cursor_fail"()
+    rx885_cur."!cursor_debug"("FAIL  ", "circumfix:sym<sigil>")
+    .return (rx885_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__circumfix:sym<sigil>"  :subid("218_1261064023.05912") :method
+.annotate "line", 4
+    $P887 = self."!PREFIX__!subrule"("sigil", "")
+    new $P888, "ResizablePMCArray"
+    push $P888, $P887
+    .return ($P888)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "semilist"  :subid("219_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 4
+    .local string rx893_tgt
+    .local int rx893_pos
+    .local int rx893_off
+    .local int rx893_eos
+    .local int rx893_rep
+    .local pmc rx893_cur
+    (rx893_cur, rx893_pos, rx893_tgt) = self."!cursor_start"()
+    rx893_cur."!cursor_debug"("START ", "semilist")
+    .lex unicode:"$\x{a2}", rx893_cur
+    .local pmc match
+    .lex "$/", match
+    length rx893_eos, rx893_tgt
+    set rx893_off, 0
+    lt rx893_pos, 2, rx893_start
+    sub rx893_off, rx893_pos, 1
+    substr rx893_tgt, rx893_tgt, rx893_off
+  rx893_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan896_done
+    goto rxscan896_scan
+  rxscan896_loop:
+    ($P10) = rx893_cur."from"()
+    inc $P10
+    set rx893_pos, $P10
+    ge rx893_pos, rx893_eos, rxscan896_done
+  rxscan896_scan:
+    set_addr $I10, rxscan896_loop
+    rx893_cur."!mark_push"(0, rx893_pos, $I10)
+  rxscan896_done:
+.annotate "line", 409
+  # rx subrule "ws" subtype=method negate=
+    rx893_cur."!cursor_pos"(rx893_pos)
+    $P10 = rx893_cur."ws"()
+    unless $P10, rx893_fail
+    rx893_pos = $P10."pos"()
+  # rx subrule "statement" subtype=capture negate=
+    rx893_cur."!cursor_pos"(rx893_pos)
+    $P10 = rx893_cur."statement"()
+    unless $P10, rx893_fail
+    rx893_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("statement")
+    rx893_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx893_cur."!cursor_pos"(rx893_pos)
+    $P10 = rx893_cur."ws"()
+    unless $P10, rx893_fail
+    rx893_pos = $P10."pos"()
+  # rx pass
+    rx893_cur."!cursor_pass"(rx893_pos, "semilist")
+    rx893_cur."!cursor_debug"("PASS  ", "semilist", " at pos=", rx893_pos)
+    .return (rx893_cur)
+  rx893_fail:
+.annotate "line", 4
+    (rx893_rep, rx893_pos, $I10, $P10) = rx893_cur."!mark_fail"(0)
+    lt rx893_pos, -1, rx893_done
+    eq rx893_pos, -1, rx893_fail
+    jump $I10
+  rx893_done:
+    rx893_cur."!cursor_fail"()
+    rx893_cur."!cursor_debug"("FAIL  ", "semilist")
+    .return (rx893_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__semilist"  :subid("220_1261064023.05912") :method
+.annotate "line", 4
+    new $P895, "ResizablePMCArray"
+    push $P895, ""
+    .return ($P895)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infixish"  :subid("221_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx900_tgt
+    .local int rx900_pos
+    .local int rx900_off
+    .local int rx900_eos
+    .local int rx900_rep
+    .local pmc rx900_cur
+    (rx900_cur, rx900_pos, rx900_tgt) = self."!cursor_start"()
+    rx900_cur."!cursor_debug"("START ", "infixish")
+    .lex unicode:"$\x{a2}", rx900_cur
+    .local pmc match
+    .lex "$/", match
+    length rx900_eos, rx900_tgt
+    set rx900_off, 0
+    lt rx900_pos, 2, rx900_start
+    sub rx900_off, rx900_pos, 1
+    substr rx900_tgt, rx900_tgt, rx900_off
+  rx900_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan903_done
+    goto rxscan903_scan
+  rxscan903_loop:
+    ($P10) = rx900_cur."from"()
+    inc $P10
+    set rx900_pos, $P10
+    ge rx900_pos, rx900_eos, rxscan903_done
+  rxscan903_scan:
+    set_addr $I10, rxscan903_loop
+    rx900_cur."!mark_push"(0, rx900_pos, $I10)
+  rxscan903_done:
+.annotate "line", 432
+  # rx subrule "infixstopper" subtype=zerowidth negate=1
+    rx900_cur."!cursor_pos"(rx900_pos)
+    $P10 = rx900_cur."infixstopper"()
+    if $P10, rx900_fail
+  # rx subrule "infix" subtype=capture negate=
+    rx900_cur."!cursor_pos"(rx900_pos)
+    $P10 = rx900_cur."infix"()
+    unless $P10, rx900_fail
+    rx900_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("OPER=infix")
+    rx900_pos = $P10."pos"()
+  # rx pass
+    rx900_cur."!cursor_pass"(rx900_pos, "infixish")
+    rx900_cur."!cursor_debug"("PASS  ", "infixish", " at pos=", rx900_pos)
+    .return (rx900_cur)
+  rx900_fail:
+.annotate "line", 413
+    (rx900_rep, rx900_pos, $I10, $P10) = rx900_cur."!mark_fail"(0)
+    lt rx900_pos, -1, rx900_done
+    eq rx900_pos, -1, rx900_fail
+    jump $I10
+  rx900_done:
+    rx900_cur."!cursor_fail"()
+    rx900_cur."!cursor_debug"("FAIL  ", "infixish")
+    .return (rx900_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infixish"  :subid("222_1261064023.05912") :method
+.annotate "line", 413
+    new $P902, "ResizablePMCArray"
+    push $P902, ""
+    .return ($P902)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infixstopper"  :subid("223_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx905_tgt
+    .local int rx905_pos
+    .local int rx905_off
+    .local int rx905_eos
+    .local int rx905_rep
+    .local pmc rx905_cur
+    (rx905_cur, rx905_pos, rx905_tgt) = self."!cursor_start"()
+    rx905_cur."!cursor_debug"("START ", "infixstopper")
+    .lex unicode:"$\x{a2}", rx905_cur
+    .local pmc match
+    .lex "$/", match
+    length rx905_eos, rx905_tgt
+    set rx905_off, 0
+    lt rx905_pos, 2, rx905_start
+    sub rx905_off, rx905_pos, 1
+    substr rx905_tgt, rx905_tgt, rx905_off
+  rx905_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan908_done
+    goto rxscan908_scan
+  rxscan908_loop:
+    ($P10) = rx905_cur."from"()
+    inc $P10
+    set rx905_pos, $P10
+    ge rx905_pos, rx905_eos, rxscan908_done
+  rxscan908_scan:
+    set_addr $I10, rxscan908_loop
+    rx905_cur."!mark_push"(0, rx905_pos, $I10)
+  rxscan908_done:
+.annotate "line", 433
+  # rx subrule "lambda" subtype=zerowidth negate=
+    rx905_cur."!cursor_pos"(rx905_pos)
+    $P10 = rx905_cur."lambda"()
+    unless $P10, rx905_fail
+  # rx pass
+    rx905_cur."!cursor_pass"(rx905_pos, "infixstopper")
+    rx905_cur."!cursor_debug"("PASS  ", "infixstopper", " at pos=", rx905_pos)
+    .return (rx905_cur)
+  rx905_fail:
+.annotate "line", 413
+    (rx905_rep, rx905_pos, $I10, $P10) = rx905_cur."!mark_fail"(0)
+    lt rx905_pos, -1, rx905_done
+    eq rx905_pos, -1, rx905_fail
+    jump $I10
+  rx905_done:
+    rx905_cur."!cursor_fail"()
+    rx905_cur."!cursor_debug"("FAIL  ", "infixstopper")
+    .return (rx905_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infixstopper"  :subid("224_1261064023.05912") :method
+.annotate "line", 413
+    new $P907, "ResizablePMCArray"
+    push $P907, ""
+    .return ($P907)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "postcircumfix:sym<[ ]>"  :subid("225_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx910_tgt
+    .local int rx910_pos
+    .local int rx910_off
+    .local int rx910_eos
+    .local int rx910_rep
+    .local pmc rx910_cur
+    (rx910_cur, rx910_pos, rx910_tgt) = self."!cursor_start"()
+    rx910_cur."!cursor_debug"("START ", "postcircumfix:sym<[ ]>")
+    .lex unicode:"$\x{a2}", rx910_cur
+    .local pmc match
+    .lex "$/", match
+    length rx910_eos, rx910_tgt
+    set rx910_off, 0
+    lt rx910_pos, 2, rx910_start
+    sub rx910_off, rx910_pos, 1
+    substr rx910_tgt, rx910_tgt, rx910_off
+  rx910_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan914_done
+    goto rxscan914_scan
+  rxscan914_loop:
+    ($P10) = rx910_cur."from"()
+    inc $P10
+    set rx910_pos, $P10
+    ge rx910_pos, rx910_eos, rxscan914_done
+  rxscan914_scan:
+    set_addr $I10, rxscan914_loop
+    rx910_cur."!mark_push"(0, rx910_pos, $I10)
+  rxscan914_done:
+.annotate "line", 436
+  # rx literal  "["
+    add $I11, rx910_pos, 1
+    gt $I11, rx910_eos, rx910_fail
+    sub $I11, rx910_pos, rx910_off
+    substr $S10, rx910_tgt, $I11, 1
+    ne $S10, "[", rx910_fail
+    add rx910_pos, 1
+  # rx subrule "ws" subtype=method negate=
+    rx910_cur."!cursor_pos"(rx910_pos)
+    $P10 = rx910_cur."ws"()
+    unless $P10, rx910_fail
+    rx910_pos = $P10."pos"()
+  # rx subrule "EXPR" subtype=capture negate=
+    rx910_cur."!cursor_pos"(rx910_pos)
+    $P10 = rx910_cur."EXPR"()
+    unless $P10, rx910_fail
+    rx910_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("EXPR")
+    rx910_pos = $P10."pos"()
+  # rx literal  "]"
+    add $I11, rx910_pos, 1
+    gt $I11, rx910_eos, rx910_fail
+    sub $I11, rx910_pos, rx910_off
+    substr $S10, rx910_tgt, $I11, 1
+    ne $S10, "]", rx910_fail
+    add rx910_pos, 1
+.annotate "line", 437
+  # rx subrule "O" subtype=capture negate=
+    rx910_cur."!cursor_pos"(rx910_pos)
+    $P10 = rx910_cur."O"("%methodop")
+    unless $P10, rx910_fail
+    rx910_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx910_pos = $P10."pos"()
+.annotate "line", 435
+  # rx pass
+    rx910_cur."!cursor_pass"(rx910_pos, "postcircumfix:sym<[ ]>")
+    rx910_cur."!cursor_debug"("PASS  ", "postcircumfix:sym<[ ]>", " at pos=", rx910_pos)
+    .return (rx910_cur)
+  rx910_fail:
+.annotate "line", 413
+    (rx910_rep, rx910_pos, $I10, $P10) = rx910_cur."!mark_fail"(0)
+    lt rx910_pos, -1, rx910_done
+    eq rx910_pos, -1, rx910_fail
+    jump $I10
+  rx910_done:
+    rx910_cur."!cursor_fail"()
+    rx910_cur."!cursor_debug"("FAIL  ", "postcircumfix:sym<[ ]>")
+    .return (rx910_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__postcircumfix:sym<[ ]>"  :subid("226_1261064023.05912") :method
+.annotate "line", 413
+    $P912 = self."!PREFIX__!subrule"("", "[")
+    new $P913, "ResizablePMCArray"
+    push $P913, $P912
+    .return ($P913)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "postcircumfix:sym<{ }>"  :subid("227_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx916_tgt
+    .local int rx916_pos
+    .local int rx916_off
+    .local int rx916_eos
+    .local int rx916_rep
+    .local pmc rx916_cur
+    (rx916_cur, rx916_pos, rx916_tgt) = self."!cursor_start"()
+    rx916_cur."!cursor_debug"("START ", "postcircumfix:sym<{ }>")
+    .lex unicode:"$\x{a2}", rx916_cur
+    .local pmc match
+    .lex "$/", match
+    length rx916_eos, rx916_tgt
+    set rx916_off, 0
+    lt rx916_pos, 2, rx916_start
+    sub rx916_off, rx916_pos, 1
+    substr rx916_tgt, rx916_tgt, rx916_off
+  rx916_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan920_done
+    goto rxscan920_scan
+  rxscan920_loop:
+    ($P10) = rx916_cur."from"()
+    inc $P10
+    set rx916_pos, $P10
+    ge rx916_pos, rx916_eos, rxscan920_done
+  rxscan920_scan:
+    set_addr $I10, rxscan920_loop
+    rx916_cur."!mark_push"(0, rx916_pos, $I10)
+  rxscan920_done:
+.annotate "line", 441
+  # rx literal  "{"
+    add $I11, rx916_pos, 1
+    gt $I11, rx916_eos, rx916_fail
+    sub $I11, rx916_pos, rx916_off
+    substr $S10, rx916_tgt, $I11, 1
+    ne $S10, "{", rx916_fail
+    add rx916_pos, 1
+  # rx subrule "ws" subtype=method negate=
+    rx916_cur."!cursor_pos"(rx916_pos)
+    $P10 = rx916_cur."ws"()
+    unless $P10, rx916_fail
+    rx916_pos = $P10."pos"()
+  # rx subrule "EXPR" subtype=capture negate=
+    rx916_cur."!cursor_pos"(rx916_pos)
+    $P10 = rx916_cur."EXPR"()
+    unless $P10, rx916_fail
+    rx916_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("EXPR")
+    rx916_pos = $P10."pos"()
+  # rx literal  "}"
+    add $I11, rx916_pos, 1
+    gt $I11, rx916_eos, rx916_fail
+    sub $I11, rx916_pos, rx916_off
+    substr $S10, rx916_tgt, $I11, 1
+    ne $S10, "}", rx916_fail
+    add rx916_pos, 1
+.annotate "line", 442
+  # rx subrule "O" subtype=capture negate=
+    rx916_cur."!cursor_pos"(rx916_pos)
+    $P10 = rx916_cur."O"("%methodop")
+    unless $P10, rx916_fail
+    rx916_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx916_pos = $P10."pos"()
+.annotate "line", 440
+  # rx pass
+    rx916_cur."!cursor_pass"(rx916_pos, "postcircumfix:sym<{ }>")
+    rx916_cur."!cursor_debug"("PASS  ", "postcircumfix:sym<{ }>", " at pos=", rx916_pos)
+    .return (rx916_cur)
+  rx916_fail:
+.annotate "line", 413
+    (rx916_rep, rx916_pos, $I10, $P10) = rx916_cur."!mark_fail"(0)
+    lt rx916_pos, -1, rx916_done
+    eq rx916_pos, -1, rx916_fail
+    jump $I10
+  rx916_done:
+    rx916_cur."!cursor_fail"()
+    rx916_cur."!cursor_debug"("FAIL  ", "postcircumfix:sym<{ }>")
+    .return (rx916_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__postcircumfix:sym<{ }>"  :subid("228_1261064023.05912") :method
+.annotate "line", 413
+    $P918 = self."!PREFIX__!subrule"("", "{")
+    new $P919, "ResizablePMCArray"
+    push $P919, $P918
+    .return ($P919)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "postcircumfix:sym<ang>"  :subid("229_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx922_tgt
+    .local int rx922_pos
+    .local int rx922_off
+    .local int rx922_eos
+    .local int rx922_rep
+    .local pmc rx922_cur
+    (rx922_cur, rx922_pos, rx922_tgt) = self."!cursor_start"()
+    rx922_cur."!cursor_debug"("START ", "postcircumfix:sym<ang>")
+    .lex unicode:"$\x{a2}", rx922_cur
+    .local pmc match
+    .lex "$/", match
+    length rx922_eos, rx922_tgt
+    set rx922_off, 0
+    lt rx922_pos, 2, rx922_start
+    sub rx922_off, rx922_pos, 1
+    substr rx922_tgt, rx922_tgt, rx922_off
+  rx922_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan925_done
+    goto rxscan925_scan
+  rxscan925_loop:
+    ($P10) = rx922_cur."from"()
+    inc $P10
+    set rx922_pos, $P10
+    ge rx922_pos, rx922_eos, rxscan925_done
+  rxscan925_scan:
+    set_addr $I10, rxscan925_loop
+    rx922_cur."!mark_push"(0, rx922_pos, $I10)
+  rxscan925_done:
+.annotate "line", 446
+  # rx enumcharlist negate=0 zerowidth
+    ge rx922_pos, rx922_eos, rx922_fail
+    sub $I10, rx922_pos, rx922_off
+    substr $S10, rx922_tgt, $I10, 1
+    index $I11, "<", $S10
+    lt $I11, 0, rx922_fail
+  # rx subrule "quote_EXPR" subtype=capture negate=
+    rx922_cur."!cursor_pos"(rx922_pos)
+    $P10 = rx922_cur."quote_EXPR"(":q")
+    unless $P10, rx922_fail
+    rx922_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("quote_EXPR")
+    rx922_pos = $P10."pos"()
+.annotate "line", 447
+  # rx subrule "O" subtype=capture negate=
+    rx922_cur."!cursor_pos"(rx922_pos)
+    $P10 = rx922_cur."O"("%methodop")
+    unless $P10, rx922_fail
+    rx922_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx922_pos = $P10."pos"()
+.annotate "line", 445
+  # rx pass
+    rx922_cur."!cursor_pass"(rx922_pos, "postcircumfix:sym<ang>")
+    rx922_cur."!cursor_debug"("PASS  ", "postcircumfix:sym<ang>", " at pos=", rx922_pos)
+    .return (rx922_cur)
+  rx922_fail:
+.annotate "line", 413
+    (rx922_rep, rx922_pos, $I10, $P10) = rx922_cur."!mark_fail"(0)
+    lt rx922_pos, -1, rx922_done
+    eq rx922_pos, -1, rx922_fail
+    jump $I10
+  rx922_done:
+    rx922_cur."!cursor_fail"()
+    rx922_cur."!cursor_debug"("FAIL  ", "postcircumfix:sym<ang>")
+    .return (rx922_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__postcircumfix:sym<ang>"  :subid("230_1261064023.05912") :method
+.annotate "line", 413
+    new $P924, "ResizablePMCArray"
+    push $P924, "<"
+    .return ($P924)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "postcircumfix:sym<( )>"  :subid("231_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx927_tgt
+    .local int rx927_pos
+    .local int rx927_off
+    .local int rx927_eos
+    .local int rx927_rep
+    .local pmc rx927_cur
+    (rx927_cur, rx927_pos, rx927_tgt) = self."!cursor_start"()
+    rx927_cur."!cursor_debug"("START ", "postcircumfix:sym<( )>")
+    .lex unicode:"$\x{a2}", rx927_cur
+    .local pmc match
+    .lex "$/", match
+    length rx927_eos, rx927_tgt
+    set rx927_off, 0
+    lt rx927_pos, 2, rx927_start
+    sub rx927_off, rx927_pos, 1
+    substr rx927_tgt, rx927_tgt, rx927_off
+  rx927_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan931_done
+    goto rxscan931_scan
+  rxscan931_loop:
+    ($P10) = rx927_cur."from"()
+    inc $P10
+    set rx927_pos, $P10
+    ge rx927_pos, rx927_eos, rxscan931_done
+  rxscan931_scan:
+    set_addr $I10, rxscan931_loop
+    rx927_cur."!mark_push"(0, rx927_pos, $I10)
+  rxscan931_done:
+.annotate "line", 451
+  # rx literal  "("
+    add $I11, rx927_pos, 1
+    gt $I11, rx927_eos, rx927_fail
+    sub $I11, rx927_pos, rx927_off
+    substr $S10, rx927_tgt, $I11, 1
+    ne $S10, "(", rx927_fail
+    add rx927_pos, 1
+  # rx subrule "ws" subtype=method negate=
+    rx927_cur."!cursor_pos"(rx927_pos)
+    $P10 = rx927_cur."ws"()
+    unless $P10, rx927_fail
+    rx927_pos = $P10."pos"()
+  # rx subrule "arglist" subtype=capture negate=
+    rx927_cur."!cursor_pos"(rx927_pos)
+    $P10 = rx927_cur."arglist"()
+    unless $P10, rx927_fail
+    rx927_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("arglist")
+    rx927_pos = $P10."pos"()
+  # rx literal  ")"
+    add $I11, rx927_pos, 1
+    gt $I11, rx927_eos, rx927_fail
+    sub $I11, rx927_pos, rx927_off
+    substr $S10, rx927_tgt, $I11, 1
+    ne $S10, ")", rx927_fail
+    add rx927_pos, 1
+.annotate "line", 452
+  # rx subrule "O" subtype=capture negate=
+    rx927_cur."!cursor_pos"(rx927_pos)
+    $P10 = rx927_cur."O"("%methodop")
+    unless $P10, rx927_fail
+    rx927_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx927_pos = $P10."pos"()
+.annotate "line", 450
+  # rx pass
+    rx927_cur."!cursor_pass"(rx927_pos, "postcircumfix:sym<( )>")
+    rx927_cur."!cursor_debug"("PASS  ", "postcircumfix:sym<( )>", " at pos=", rx927_pos)
+    .return (rx927_cur)
+  rx927_fail:
+.annotate "line", 413
+    (rx927_rep, rx927_pos, $I10, $P10) = rx927_cur."!mark_fail"(0)
+    lt rx927_pos, -1, rx927_done
+    eq rx927_pos, -1, rx927_fail
+    jump $I10
+  rx927_done:
+    rx927_cur."!cursor_fail"()
+    rx927_cur."!cursor_debug"("FAIL  ", "postcircumfix:sym<( )>")
+    .return (rx927_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__postcircumfix:sym<( )>"  :subid("232_1261064023.05912") :method
+.annotate "line", 413
+    $P929 = self."!PREFIX__!subrule"("", "(")
+    new $P930, "ResizablePMCArray"
+    push $P930, $P929
+    .return ($P930)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "postfix:sym<.>"  :subid("233_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx933_tgt
+    .local int rx933_pos
+    .local int rx933_off
+    .local int rx933_eos
+    .local int rx933_rep
+    .local pmc rx933_cur
+    (rx933_cur, rx933_pos, rx933_tgt) = self."!cursor_start"()
+    rx933_cur."!cursor_debug"("START ", "postfix:sym<.>")
+    .lex unicode:"$\x{a2}", rx933_cur
+    .local pmc match
+    .lex "$/", match
+    length rx933_eos, rx933_tgt
+    set rx933_off, 0
+    lt rx933_pos, 2, rx933_start
+    sub rx933_off, rx933_pos, 1
+    substr rx933_tgt, rx933_tgt, rx933_off
+  rx933_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan937_done
+    goto rxscan937_scan
+  rxscan937_loop:
+    ($P10) = rx933_cur."from"()
+    inc $P10
+    set rx933_pos, $P10
+    ge rx933_pos, rx933_eos, rxscan937_done
+  rxscan937_scan:
+    set_addr $I10, rxscan937_loop
+    rx933_cur."!mark_push"(0, rx933_pos, $I10)
+  rxscan937_done:
+.annotate "line", 455
+  # rx subrule "dotty" subtype=capture negate=
+    rx933_cur."!cursor_pos"(rx933_pos)
+    $P10 = rx933_cur."dotty"()
+    unless $P10, rx933_fail
+    rx933_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("dotty")
+    rx933_pos = $P10."pos"()
+  # rx subrule "O" subtype=capture negate=
+    rx933_cur."!cursor_pos"(rx933_pos)
+    $P10 = rx933_cur."O"("%methodop")
+    unless $P10, rx933_fail
+    rx933_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx933_pos = $P10."pos"()
+  # rx pass
+    rx933_cur."!cursor_pass"(rx933_pos, "postfix:sym<.>")
+    rx933_cur."!cursor_debug"("PASS  ", "postfix:sym<.>", " at pos=", rx933_pos)
+    .return (rx933_cur)
+  rx933_fail:
+.annotate "line", 413
+    (rx933_rep, rx933_pos, $I10, $P10) = rx933_cur."!mark_fail"(0)
+    lt rx933_pos, -1, rx933_done
+    eq rx933_pos, -1, rx933_fail
+    jump $I10
+  rx933_done:
+    rx933_cur."!cursor_fail"()
+    rx933_cur."!cursor_debug"("FAIL  ", "postfix:sym<.>")
+    .return (rx933_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__postfix:sym<.>"  :subid("234_1261064023.05912") :method
+.annotate "line", 413
+    $P935 = self."!PREFIX__!subrule"("dotty", "")
+    new $P936, "ResizablePMCArray"
+    push $P936, $P935
+    .return ($P936)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "prefix:sym<++>"  :subid("235_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx939_tgt
+    .local int rx939_pos
+    .local int rx939_off
+    .local int rx939_eos
+    .local int rx939_rep
+    .local pmc rx939_cur
+    (rx939_cur, rx939_pos, rx939_tgt) = self."!cursor_start"()
+    rx939_cur."!cursor_debug"("START ", "prefix:sym<++>")
+    .lex unicode:"$\x{a2}", rx939_cur
+    .local pmc match
+    .lex "$/", match
+    length rx939_eos, rx939_tgt
+    set rx939_off, 0
+    lt rx939_pos, 2, rx939_start
+    sub rx939_off, rx939_pos, 1
+    substr rx939_tgt, rx939_tgt, rx939_off
+  rx939_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan943_done
+    goto rxscan943_scan
+  rxscan943_loop:
+    ($P10) = rx939_cur."from"()
+    inc $P10
+    set rx939_pos, $P10
+    ge rx939_pos, rx939_eos, rxscan943_done
+  rxscan943_scan:
+    set_addr $I10, rxscan943_loop
+    rx939_cur."!mark_push"(0, rx939_pos, $I10)
+  rxscan943_done:
+.annotate "line", 457
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_944_fail
+    rx939_cur."!mark_push"(0, rx939_pos, $I10)
+  # rx literal  "++"
+    add $I11, rx939_pos, 2
+    gt $I11, rx939_eos, rx939_fail
+    sub $I11, rx939_pos, rx939_off
+    substr $S10, rx939_tgt, $I11, 2
+    ne $S10, "++", rx939_fail
+    add rx939_pos, 2
+    set_addr $I10, rxcap_944_fail
+    ($I12, $I11) = rx939_cur."!mark_peek"($I10)
+    rx939_cur."!cursor_pos"($I11)
+    ($P10) = rx939_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx939_pos, "")
+    rx939_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_944_done
+  rxcap_944_fail:
+    goto rx939_fail
+  rxcap_944_done:
+  # rx subrule "O" subtype=capture negate=
+    rx939_cur."!cursor_pos"(rx939_pos)
+    $P10 = rx939_cur."O"("%autoincrement, :pirop<inc>")
+    unless $P10, rx939_fail
+    rx939_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx939_pos = $P10."pos"()
+  # rx pass
+    rx939_cur."!cursor_pass"(rx939_pos, "prefix:sym<++>")
+    rx939_cur."!cursor_debug"("PASS  ", "prefix:sym<++>", " at pos=", rx939_pos)
+    .return (rx939_cur)
+  rx939_fail:
+.annotate "line", 413
+    (rx939_rep, rx939_pos, $I10, $P10) = rx939_cur."!mark_fail"(0)
+    lt rx939_pos, -1, rx939_done
+    eq rx939_pos, -1, rx939_fail
+    jump $I10
+  rx939_done:
+    rx939_cur."!cursor_fail"()
+    rx939_cur."!cursor_debug"("FAIL  ", "prefix:sym<++>")
+    .return (rx939_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__prefix:sym<++>"  :subid("236_1261064023.05912") :method
+.annotate "line", 413
+    $P941 = self."!PREFIX__!subrule"("O", "++")
+    new $P942, "ResizablePMCArray"
+    push $P942, $P941
+    .return ($P942)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "prefix:sym<-->"  :subid("237_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx946_tgt
+    .local int rx946_pos
+    .local int rx946_off
+    .local int rx946_eos
+    .local int rx946_rep
+    .local pmc rx946_cur
+    (rx946_cur, rx946_pos, rx946_tgt) = self."!cursor_start"()
+    rx946_cur."!cursor_debug"("START ", "prefix:sym<-->")
+    .lex unicode:"$\x{a2}", rx946_cur
+    .local pmc match
+    .lex "$/", match
+    length rx946_eos, rx946_tgt
+    set rx946_off, 0
+    lt rx946_pos, 2, rx946_start
+    sub rx946_off, rx946_pos, 1
+    substr rx946_tgt, rx946_tgt, rx946_off
+  rx946_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan950_done
+    goto rxscan950_scan
+  rxscan950_loop:
+    ($P10) = rx946_cur."from"()
+    inc $P10
+    set rx946_pos, $P10
+    ge rx946_pos, rx946_eos, rxscan950_done
+  rxscan950_scan:
+    set_addr $I10, rxscan950_loop
+    rx946_cur."!mark_push"(0, rx946_pos, $I10)
+  rxscan950_done:
+.annotate "line", 458
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_951_fail
+    rx946_cur."!mark_push"(0, rx946_pos, $I10)
+  # rx literal  "--"
+    add $I11, rx946_pos, 2
+    gt $I11, rx946_eos, rx946_fail
+    sub $I11, rx946_pos, rx946_off
+    substr $S10, rx946_tgt, $I11, 2
+    ne $S10, "--", rx946_fail
+    add rx946_pos, 2
+    set_addr $I10, rxcap_951_fail
+    ($I12, $I11) = rx946_cur."!mark_peek"($I10)
+    rx946_cur."!cursor_pos"($I11)
+    ($P10) = rx946_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx946_pos, "")
+    rx946_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_951_done
+  rxcap_951_fail:
+    goto rx946_fail
+  rxcap_951_done:
+  # rx subrule "O" subtype=capture negate=
+    rx946_cur."!cursor_pos"(rx946_pos)
+    $P10 = rx946_cur."O"("%autoincrement, :pirop<dec>")
+    unless $P10, rx946_fail
+    rx946_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx946_pos = $P10."pos"()
+  # rx pass
+    rx946_cur."!cursor_pass"(rx946_pos, "prefix:sym<-->")
+    rx946_cur."!cursor_debug"("PASS  ", "prefix:sym<-->", " at pos=", rx946_pos)
+    .return (rx946_cur)
+  rx946_fail:
+.annotate "line", 413
+    (rx946_rep, rx946_pos, $I10, $P10) = rx946_cur."!mark_fail"(0)
+    lt rx946_pos, -1, rx946_done
+    eq rx946_pos, -1, rx946_fail
+    jump $I10
+  rx946_done:
+    rx946_cur."!cursor_fail"()
+    rx946_cur."!cursor_debug"("FAIL  ", "prefix:sym<-->")
+    .return (rx946_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__prefix:sym<-->"  :subid("238_1261064023.05912") :method
+.annotate "line", 413
+    $P948 = self."!PREFIX__!subrule"("O", "--")
+    new $P949, "ResizablePMCArray"
+    push $P949, $P948
+    .return ($P949)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "postfix:sym<++>"  :subid("239_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx953_tgt
+    .local int rx953_pos
+    .local int rx953_off
+    .local int rx953_eos
+    .local int rx953_rep
+    .local pmc rx953_cur
+    (rx953_cur, rx953_pos, rx953_tgt) = self."!cursor_start"()
+    rx953_cur."!cursor_debug"("START ", "postfix:sym<++>")
+    .lex unicode:"$\x{a2}", rx953_cur
+    .local pmc match
+    .lex "$/", match
+    length rx953_eos, rx953_tgt
+    set rx953_off, 0
+    lt rx953_pos, 2, rx953_start
+    sub rx953_off, rx953_pos, 1
+    substr rx953_tgt, rx953_tgt, rx953_off
+  rx953_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan957_done
+    goto rxscan957_scan
+  rxscan957_loop:
+    ($P10) = rx953_cur."from"()
+    inc $P10
+    set rx953_pos, $P10
+    ge rx953_pos, rx953_eos, rxscan957_done
+  rxscan957_scan:
+    set_addr $I10, rxscan957_loop
+    rx953_cur."!mark_push"(0, rx953_pos, $I10)
+  rxscan957_done:
+.annotate "line", 461
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_958_fail
+    rx953_cur."!mark_push"(0, rx953_pos, $I10)
+  # rx literal  "++"
+    add $I11, rx953_pos, 2
+    gt $I11, rx953_eos, rx953_fail
+    sub $I11, rx953_pos, rx953_off
+    substr $S10, rx953_tgt, $I11, 2
+    ne $S10, "++", rx953_fail
+    add rx953_pos, 2
+    set_addr $I10, rxcap_958_fail
+    ($I12, $I11) = rx953_cur."!mark_peek"($I10)
+    rx953_cur."!cursor_pos"($I11)
+    ($P10) = rx953_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx953_pos, "")
+    rx953_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_958_done
+  rxcap_958_fail:
+    goto rx953_fail
+  rxcap_958_done:
+  # rx subrule "O" subtype=capture negate=
+    rx953_cur."!cursor_pos"(rx953_pos)
+    $P10 = rx953_cur."O"("%autoincrement")
+    unless $P10, rx953_fail
+    rx953_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx953_pos = $P10."pos"()
+  # rx pass
+    rx953_cur."!cursor_pass"(rx953_pos, "postfix:sym<++>")
+    rx953_cur."!cursor_debug"("PASS  ", "postfix:sym<++>", " at pos=", rx953_pos)
+    .return (rx953_cur)
+  rx953_fail:
+.annotate "line", 413
+    (rx953_rep, rx953_pos, $I10, $P10) = rx953_cur."!mark_fail"(0)
+    lt rx953_pos, -1, rx953_done
+    eq rx953_pos, -1, rx953_fail
+    jump $I10
+  rx953_done:
+    rx953_cur."!cursor_fail"()
+    rx953_cur."!cursor_debug"("FAIL  ", "postfix:sym<++>")
+    .return (rx953_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__postfix:sym<++>"  :subid("240_1261064023.05912") :method
+.annotate "line", 413
+    $P955 = self."!PREFIX__!subrule"("O", "++")
+    new $P956, "ResizablePMCArray"
+    push $P956, $P955
+    .return ($P956)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "postfix:sym<-->"  :subid("241_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx960_tgt
+    .local int rx960_pos
+    .local int rx960_off
+    .local int rx960_eos
+    .local int rx960_rep
+    .local pmc rx960_cur
+    (rx960_cur, rx960_pos, rx960_tgt) = self."!cursor_start"()
+    rx960_cur."!cursor_debug"("START ", "postfix:sym<-->")
+    .lex unicode:"$\x{a2}", rx960_cur
+    .local pmc match
+    .lex "$/", match
+    length rx960_eos, rx960_tgt
+    set rx960_off, 0
+    lt rx960_pos, 2, rx960_start
+    sub rx960_off, rx960_pos, 1
+    substr rx960_tgt, rx960_tgt, rx960_off
+  rx960_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan964_done
+    goto rxscan964_scan
+  rxscan964_loop:
+    ($P10) = rx960_cur."from"()
+    inc $P10
+    set rx960_pos, $P10
+    ge rx960_pos, rx960_eos, rxscan964_done
+  rxscan964_scan:
+    set_addr $I10, rxscan964_loop
+    rx960_cur."!mark_push"(0, rx960_pos, $I10)
+  rxscan964_done:
+.annotate "line", 462
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_965_fail
+    rx960_cur."!mark_push"(0, rx960_pos, $I10)
+  # rx literal  "--"
+    add $I11, rx960_pos, 2
+    gt $I11, rx960_eos, rx960_fail
+    sub $I11, rx960_pos, rx960_off
+    substr $S10, rx960_tgt, $I11, 2
+    ne $S10, "--", rx960_fail
+    add rx960_pos, 2
+    set_addr $I10, rxcap_965_fail
+    ($I12, $I11) = rx960_cur."!mark_peek"($I10)
+    rx960_cur."!cursor_pos"($I11)
+    ($P10) = rx960_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx960_pos, "")
+    rx960_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_965_done
+  rxcap_965_fail:
+    goto rx960_fail
+  rxcap_965_done:
+  # rx subrule "O" subtype=capture negate=
+    rx960_cur."!cursor_pos"(rx960_pos)
+    $P10 = rx960_cur."O"("%autoincrement")
+    unless $P10, rx960_fail
+    rx960_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx960_pos = $P10."pos"()
+  # rx pass
+    rx960_cur."!cursor_pass"(rx960_pos, "postfix:sym<-->")
+    rx960_cur."!cursor_debug"("PASS  ", "postfix:sym<-->", " at pos=", rx960_pos)
+    .return (rx960_cur)
+  rx960_fail:
+.annotate "line", 413
+    (rx960_rep, rx960_pos, $I10, $P10) = rx960_cur."!mark_fail"(0)
+    lt rx960_pos, -1, rx960_done
+    eq rx960_pos, -1, rx960_fail
+    jump $I10
+  rx960_done:
+    rx960_cur."!cursor_fail"()
+    rx960_cur."!cursor_debug"("FAIL  ", "postfix:sym<-->")
+    .return (rx960_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__postfix:sym<-->"  :subid("242_1261064023.05912") :method
+.annotate "line", 413
+    $P962 = self."!PREFIX__!subrule"("O", "--")
+    new $P963, "ResizablePMCArray"
+    push $P963, $P962
+    .return ($P963)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<**>"  :subid("243_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx967_tgt
+    .local int rx967_pos
+    .local int rx967_off
+    .local int rx967_eos
+    .local int rx967_rep
+    .local pmc rx967_cur
+    (rx967_cur, rx967_pos, rx967_tgt) = self."!cursor_start"()
+    rx967_cur."!cursor_debug"("START ", "infix:sym<**>")
+    .lex unicode:"$\x{a2}", rx967_cur
+    .local pmc match
+    .lex "$/", match
+    length rx967_eos, rx967_tgt
+    set rx967_off, 0
+    lt rx967_pos, 2, rx967_start
+    sub rx967_off, rx967_pos, 1
+    substr rx967_tgt, rx967_tgt, rx967_off
+  rx967_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan971_done
+    goto rxscan971_scan
+  rxscan971_loop:
+    ($P10) = rx967_cur."from"()
+    inc $P10
+    set rx967_pos, $P10
+    ge rx967_pos, rx967_eos, rxscan971_done
+  rxscan971_scan:
+    set_addr $I10, rxscan971_loop
+    rx967_cur."!mark_push"(0, rx967_pos, $I10)
+  rxscan971_done:
+.annotate "line", 464
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_972_fail
+    rx967_cur."!mark_push"(0, rx967_pos, $I10)
+  # rx literal  "**"
+    add $I11, rx967_pos, 2
+    gt $I11, rx967_eos, rx967_fail
+    sub $I11, rx967_pos, rx967_off
+    substr $S10, rx967_tgt, $I11, 2
+    ne $S10, "**", rx967_fail
+    add rx967_pos, 2
+    set_addr $I10, rxcap_972_fail
+    ($I12, $I11) = rx967_cur."!mark_peek"($I10)
+    rx967_cur."!cursor_pos"($I11)
+    ($P10) = rx967_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx967_pos, "")
+    rx967_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_972_done
+  rxcap_972_fail:
+    goto rx967_fail
+  rxcap_972_done:
+  # rx subrule "O" subtype=capture negate=
+    rx967_cur."!cursor_pos"(rx967_pos)
+    $P10 = rx967_cur."O"("%exponentiation, :pirop<pow>")
+    unless $P10, rx967_fail
+    rx967_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx967_pos = $P10."pos"()
+  # rx pass
+    rx967_cur."!cursor_pass"(rx967_pos, "infix:sym<**>")
+    rx967_cur."!cursor_debug"("PASS  ", "infix:sym<**>", " at pos=", rx967_pos)
+    .return (rx967_cur)
+  rx967_fail:
+.annotate "line", 413
+    (rx967_rep, rx967_pos, $I10, $P10) = rx967_cur."!mark_fail"(0)
+    lt rx967_pos, -1, rx967_done
+    eq rx967_pos, -1, rx967_fail
+    jump $I10
+  rx967_done:
+    rx967_cur."!cursor_fail"()
+    rx967_cur."!cursor_debug"("FAIL  ", "infix:sym<**>")
+    .return (rx967_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<**>"  :subid("244_1261064023.05912") :method
+.annotate "line", 413
+    $P969 = self."!PREFIX__!subrule"("O", "**")
+    new $P970, "ResizablePMCArray"
+    push $P970, $P969
+    .return ($P970)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "prefix:sym<+>"  :subid("245_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx974_tgt
+    .local int rx974_pos
+    .local int rx974_off
+    .local int rx974_eos
+    .local int rx974_rep
+    .local pmc rx974_cur
+    (rx974_cur, rx974_pos, rx974_tgt) = self."!cursor_start"()
+    rx974_cur."!cursor_debug"("START ", "prefix:sym<+>")
+    .lex unicode:"$\x{a2}", rx974_cur
+    .local pmc match
+    .lex "$/", match
+    length rx974_eos, rx974_tgt
+    set rx974_off, 0
+    lt rx974_pos, 2, rx974_start
+    sub rx974_off, rx974_pos, 1
+    substr rx974_tgt, rx974_tgt, rx974_off
+  rx974_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan978_done
+    goto rxscan978_scan
+  rxscan978_loop:
+    ($P10) = rx974_cur."from"()
+    inc $P10
+    set rx974_pos, $P10
+    ge rx974_pos, rx974_eos, rxscan978_done
+  rxscan978_scan:
+    set_addr $I10, rxscan978_loop
+    rx974_cur."!mark_push"(0, rx974_pos, $I10)
+  rxscan978_done:
+.annotate "line", 466
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_979_fail
+    rx974_cur."!mark_push"(0, rx974_pos, $I10)
+  # rx literal  "+"
+    add $I11, rx974_pos, 1
+    gt $I11, rx974_eos, rx974_fail
+    sub $I11, rx974_pos, rx974_off
+    substr $S10, rx974_tgt, $I11, 1
+    ne $S10, "+", rx974_fail
+    add rx974_pos, 1
+    set_addr $I10, rxcap_979_fail
+    ($I12, $I11) = rx974_cur."!mark_peek"($I10)
+    rx974_cur."!cursor_pos"($I11)
+    ($P10) = rx974_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx974_pos, "")
+    rx974_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_979_done
+  rxcap_979_fail:
+    goto rx974_fail
+  rxcap_979_done:
+  # rx subrule "O" subtype=capture negate=
+    rx974_cur."!cursor_pos"(rx974_pos)
+    $P10 = rx974_cur."O"("%symbolic_unary, :pirop<set N*>")
+    unless $P10, rx974_fail
+    rx974_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx974_pos = $P10."pos"()
+  # rx pass
+    rx974_cur."!cursor_pass"(rx974_pos, "prefix:sym<+>")
+    rx974_cur."!cursor_debug"("PASS  ", "prefix:sym<+>", " at pos=", rx974_pos)
+    .return (rx974_cur)
+  rx974_fail:
+.annotate "line", 413
+    (rx974_rep, rx974_pos, $I10, $P10) = rx974_cur."!mark_fail"(0)
+    lt rx974_pos, -1, rx974_done
+    eq rx974_pos, -1, rx974_fail
+    jump $I10
+  rx974_done:
+    rx974_cur."!cursor_fail"()
+    rx974_cur."!cursor_debug"("FAIL  ", "prefix:sym<+>")
+    .return (rx974_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__prefix:sym<+>"  :subid("246_1261064023.05912") :method
+.annotate "line", 413
+    $P976 = self."!PREFIX__!subrule"("O", "+")
+    new $P977, "ResizablePMCArray"
+    push $P977, $P976
+    .return ($P977)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "prefix:sym<~>"  :subid("247_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx981_tgt
+    .local int rx981_pos
+    .local int rx981_off
+    .local int rx981_eos
+    .local int rx981_rep
+    .local pmc rx981_cur
+    (rx981_cur, rx981_pos, rx981_tgt) = self."!cursor_start"()
+    rx981_cur."!cursor_debug"("START ", "prefix:sym<~>")
+    .lex unicode:"$\x{a2}", rx981_cur
+    .local pmc match
+    .lex "$/", match
+    length rx981_eos, rx981_tgt
+    set rx981_off, 0
+    lt rx981_pos, 2, rx981_start
+    sub rx981_off, rx981_pos, 1
+    substr rx981_tgt, rx981_tgt, rx981_off
+  rx981_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan985_done
+    goto rxscan985_scan
+  rxscan985_loop:
+    ($P10) = rx981_cur."from"()
+    inc $P10
+    set rx981_pos, $P10
+    ge rx981_pos, rx981_eos, rxscan985_done
+  rxscan985_scan:
+    set_addr $I10, rxscan985_loop
+    rx981_cur."!mark_push"(0, rx981_pos, $I10)
+  rxscan985_done:
+.annotate "line", 467
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_986_fail
+    rx981_cur."!mark_push"(0, rx981_pos, $I10)
+  # rx literal  "~"
+    add $I11, rx981_pos, 1
+    gt $I11, rx981_eos, rx981_fail
+    sub $I11, rx981_pos, rx981_off
+    substr $S10, rx981_tgt, $I11, 1
+    ne $S10, "~", rx981_fail
+    add rx981_pos, 1
+    set_addr $I10, rxcap_986_fail
+    ($I12, $I11) = rx981_cur."!mark_peek"($I10)
+    rx981_cur."!cursor_pos"($I11)
+    ($P10) = rx981_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx981_pos, "")
+    rx981_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_986_done
+  rxcap_986_fail:
+    goto rx981_fail
+  rxcap_986_done:
+  # rx subrule "O" subtype=capture negate=
+    rx981_cur."!cursor_pos"(rx981_pos)
+    $P10 = rx981_cur."O"("%symbolic_unary, :pirop<set S*>")
+    unless $P10, rx981_fail
+    rx981_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx981_pos = $P10."pos"()
+  # rx pass
+    rx981_cur."!cursor_pass"(rx981_pos, "prefix:sym<~>")
+    rx981_cur."!cursor_debug"("PASS  ", "prefix:sym<~>", " at pos=", rx981_pos)
+    .return (rx981_cur)
+  rx981_fail:
+.annotate "line", 413
+    (rx981_rep, rx981_pos, $I10, $P10) = rx981_cur."!mark_fail"(0)
+    lt rx981_pos, -1, rx981_done
+    eq rx981_pos, -1, rx981_fail
+    jump $I10
+  rx981_done:
+    rx981_cur."!cursor_fail"()
+    rx981_cur."!cursor_debug"("FAIL  ", "prefix:sym<~>")
+    .return (rx981_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__prefix:sym<~>"  :subid("248_1261064023.05912") :method
+.annotate "line", 413
+    $P983 = self."!PREFIX__!subrule"("O", "~")
+    new $P984, "ResizablePMCArray"
+    push $P984, $P983
+    .return ($P984)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "prefix:sym<->"  :subid("249_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx988_tgt
+    .local int rx988_pos
+    .local int rx988_off
+    .local int rx988_eos
+    .local int rx988_rep
+    .local pmc rx988_cur
+    (rx988_cur, rx988_pos, rx988_tgt) = self."!cursor_start"()
+    rx988_cur."!cursor_debug"("START ", "prefix:sym<->")
+    .lex unicode:"$\x{a2}", rx988_cur
+    .local pmc match
+    .lex "$/", match
+    length rx988_eos, rx988_tgt
+    set rx988_off, 0
+    lt rx988_pos, 2, rx988_start
+    sub rx988_off, rx988_pos, 1
+    substr rx988_tgt, rx988_tgt, rx988_off
+  rx988_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan991_done
+    goto rxscan991_scan
+  rxscan991_loop:
+    ($P10) = rx988_cur."from"()
+    inc $P10
+    set rx988_pos, $P10
+    ge rx988_pos, rx988_eos, rxscan991_done
+  rxscan991_scan:
+    set_addr $I10, rxscan991_loop
+    rx988_cur."!mark_push"(0, rx988_pos, $I10)
+  rxscan991_done:
+.annotate "line", 468
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_992_fail
+    rx988_cur."!mark_push"(0, rx988_pos, $I10)
+  # rx literal  "-"
+    add $I11, rx988_pos, 1
+    gt $I11, rx988_eos, rx988_fail
+    sub $I11, rx988_pos, rx988_off
+    substr $S10, rx988_tgt, $I11, 1
+    ne $S10, "-", rx988_fail
+    add rx988_pos, 1
+    set_addr $I10, rxcap_992_fail
+    ($I12, $I11) = rx988_cur."!mark_peek"($I10)
+    rx988_cur."!cursor_pos"($I11)
+    ($P10) = rx988_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx988_pos, "")
+    rx988_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_992_done
+  rxcap_992_fail:
+    goto rx988_fail
+  rxcap_992_done:
+  # rx enumcharlist negate=1 zerowidth
+    ge rx988_pos, rx988_eos, rx988_fail
+    sub $I10, rx988_pos, rx988_off
+    substr $S10, rx988_tgt, $I10, 1
+    index $I11, ">", $S10
+    ge $I11, 0, rx988_fail
+  # rx subrule "number" subtype=zerowidth negate=1
+    rx988_cur."!cursor_pos"(rx988_pos)
+    $P10 = rx988_cur."number"()
+    if $P10, rx988_fail
+  # rx subrule "O" subtype=capture negate=
+    rx988_cur."!cursor_pos"(rx988_pos)
+    $P10 = rx988_cur."O"("%symbolic_unary, :pirop<neg>")
+    unless $P10, rx988_fail
+    rx988_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx988_pos = $P10."pos"()
+  # rx pass
+    rx988_cur."!cursor_pass"(rx988_pos, "prefix:sym<->")
+    rx988_cur."!cursor_debug"("PASS  ", "prefix:sym<->", " at pos=", rx988_pos)
+    .return (rx988_cur)
+  rx988_fail:
+.annotate "line", 413
+    (rx988_rep, rx988_pos, $I10, $P10) = rx988_cur."!mark_fail"(0)
+    lt rx988_pos, -1, rx988_done
+    eq rx988_pos, -1, rx988_fail
+    jump $I10
+  rx988_done:
+    rx988_cur."!cursor_fail"()
+    rx988_cur."!cursor_debug"("FAIL  ", "prefix:sym<->")
+    .return (rx988_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__prefix:sym<->"  :subid("250_1261064023.05912") :method
+.annotate "line", 413
+    new $P990, "ResizablePMCArray"
+    push $P990, "-"
+    .return ($P990)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "prefix:sym<?>"  :subid("251_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx994_tgt
+    .local int rx994_pos
+    .local int rx994_off
+    .local int rx994_eos
+    .local int rx994_rep
+    .local pmc rx994_cur
+    (rx994_cur, rx994_pos, rx994_tgt) = self."!cursor_start"()
+    rx994_cur."!cursor_debug"("START ", "prefix:sym<?>")
+    .lex unicode:"$\x{a2}", rx994_cur
+    .local pmc match
+    .lex "$/", match
+    length rx994_eos, rx994_tgt
+    set rx994_off, 0
+    lt rx994_pos, 2, rx994_start
+    sub rx994_off, rx994_pos, 1
+    substr rx994_tgt, rx994_tgt, rx994_off
+  rx994_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan998_done
+    goto rxscan998_scan
+  rxscan998_loop:
+    ($P10) = rx994_cur."from"()
+    inc $P10
+    set rx994_pos, $P10
+    ge rx994_pos, rx994_eos, rxscan998_done
+  rxscan998_scan:
+    set_addr $I10, rxscan998_loop
+    rx994_cur."!mark_push"(0, rx994_pos, $I10)
+  rxscan998_done:
+.annotate "line", 469
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_999_fail
+    rx994_cur."!mark_push"(0, rx994_pos, $I10)
+  # rx literal  "?"
+    add $I11, rx994_pos, 1
+    gt $I11, rx994_eos, rx994_fail
+    sub $I11, rx994_pos, rx994_off
+    substr $S10, rx994_tgt, $I11, 1
+    ne $S10, "?", rx994_fail
+    add rx994_pos, 1
+    set_addr $I10, rxcap_999_fail
+    ($I12, $I11) = rx994_cur."!mark_peek"($I10)
+    rx994_cur."!cursor_pos"($I11)
+    ($P10) = rx994_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx994_pos, "")
+    rx994_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_999_done
+  rxcap_999_fail:
+    goto rx994_fail
+  rxcap_999_done:
+  # rx subrule "O" subtype=capture negate=
+    rx994_cur."!cursor_pos"(rx994_pos)
+    $P10 = rx994_cur."O"("%symbolic_unary, :pirop<istrue>")
+    unless $P10, rx994_fail
+    rx994_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx994_pos = $P10."pos"()
+  # rx pass
+    rx994_cur."!cursor_pass"(rx994_pos, "prefix:sym<?>")
+    rx994_cur."!cursor_debug"("PASS  ", "prefix:sym<?>", " at pos=", rx994_pos)
+    .return (rx994_cur)
+  rx994_fail:
+.annotate "line", 413
+    (rx994_rep, rx994_pos, $I10, $P10) = rx994_cur."!mark_fail"(0)
+    lt rx994_pos, -1, rx994_done
+    eq rx994_pos, -1, rx994_fail
+    jump $I10
+  rx994_done:
+    rx994_cur."!cursor_fail"()
+    rx994_cur."!cursor_debug"("FAIL  ", "prefix:sym<?>")
+    .return (rx994_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__prefix:sym<?>"  :subid("252_1261064023.05912") :method
+.annotate "line", 413
+    $P996 = self."!PREFIX__!subrule"("O", "?")
+    new $P997, "ResizablePMCArray"
+    push $P997, $P996
+    .return ($P997)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "prefix:sym<!>"  :subid("253_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1001_tgt
+    .local int rx1001_pos
+    .local int rx1001_off
+    .local int rx1001_eos
+    .local int rx1001_rep
+    .local pmc rx1001_cur
+    (rx1001_cur, rx1001_pos, rx1001_tgt) = self."!cursor_start"()
+    rx1001_cur."!cursor_debug"("START ", "prefix:sym<!>")
+    .lex unicode:"$\x{a2}", rx1001_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1001_eos, rx1001_tgt
+    set rx1001_off, 0
+    lt rx1001_pos, 2, rx1001_start
+    sub rx1001_off, rx1001_pos, 1
+    substr rx1001_tgt, rx1001_tgt, rx1001_off
+  rx1001_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1005_done
+    goto rxscan1005_scan
+  rxscan1005_loop:
+    ($P10) = rx1001_cur."from"()
+    inc $P10
+    set rx1001_pos, $P10
+    ge rx1001_pos, rx1001_eos, rxscan1005_done
+  rxscan1005_scan:
+    set_addr $I10, rxscan1005_loop
+    rx1001_cur."!mark_push"(0, rx1001_pos, $I10)
+  rxscan1005_done:
+.annotate "line", 470
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1006_fail
+    rx1001_cur."!mark_push"(0, rx1001_pos, $I10)
+  # rx literal  "!"
+    add $I11, rx1001_pos, 1
+    gt $I11, rx1001_eos, rx1001_fail
+    sub $I11, rx1001_pos, rx1001_off
+    substr $S10, rx1001_tgt, $I11, 1
+    ne $S10, "!", rx1001_fail
+    add rx1001_pos, 1
+    set_addr $I10, rxcap_1006_fail
+    ($I12, $I11) = rx1001_cur."!mark_peek"($I10)
+    rx1001_cur."!cursor_pos"($I11)
+    ($P10) = rx1001_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1001_pos, "")
+    rx1001_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1006_done
+  rxcap_1006_fail:
+    goto rx1001_fail
+  rxcap_1006_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1001_cur."!cursor_pos"(rx1001_pos)
+    $P10 = rx1001_cur."O"("%symbolic_unary, :pirop<isfalse>")
+    unless $P10, rx1001_fail
+    rx1001_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1001_pos = $P10."pos"()
+  # rx pass
+    rx1001_cur."!cursor_pass"(rx1001_pos, "prefix:sym<!>")
+    rx1001_cur."!cursor_debug"("PASS  ", "prefix:sym<!>", " at pos=", rx1001_pos)
+    .return (rx1001_cur)
+  rx1001_fail:
+.annotate "line", 413
+    (rx1001_rep, rx1001_pos, $I10, $P10) = rx1001_cur."!mark_fail"(0)
+    lt rx1001_pos, -1, rx1001_done
+    eq rx1001_pos, -1, rx1001_fail
+    jump $I10
+  rx1001_done:
+    rx1001_cur."!cursor_fail"()
+    rx1001_cur."!cursor_debug"("FAIL  ", "prefix:sym<!>")
+    .return (rx1001_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__prefix:sym<!>"  :subid("254_1261064023.05912") :method
+.annotate "line", 413
+    $P1003 = self."!PREFIX__!subrule"("O", "!")
+    new $P1004, "ResizablePMCArray"
+    push $P1004, $P1003
+    .return ($P1004)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "prefix:sym<|>"  :subid("255_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1008_tgt
+    .local int rx1008_pos
+    .local int rx1008_off
+    .local int rx1008_eos
+    .local int rx1008_rep
+    .local pmc rx1008_cur
+    (rx1008_cur, rx1008_pos, rx1008_tgt) = self."!cursor_start"()
+    rx1008_cur."!cursor_debug"("START ", "prefix:sym<|>")
+    .lex unicode:"$\x{a2}", rx1008_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1008_eos, rx1008_tgt
+    set rx1008_off, 0
+    lt rx1008_pos, 2, rx1008_start
+    sub rx1008_off, rx1008_pos, 1
+    substr rx1008_tgt, rx1008_tgt, rx1008_off
+  rx1008_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1012_done
+    goto rxscan1012_scan
+  rxscan1012_loop:
+    ($P10) = rx1008_cur."from"()
+    inc $P10
+    set rx1008_pos, $P10
+    ge rx1008_pos, rx1008_eos, rxscan1012_done
+  rxscan1012_scan:
+    set_addr $I10, rxscan1012_loop
+    rx1008_cur."!mark_push"(0, rx1008_pos, $I10)
+  rxscan1012_done:
+.annotate "line", 471
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1013_fail
+    rx1008_cur."!mark_push"(0, rx1008_pos, $I10)
+  # rx literal  "|"
+    add $I11, rx1008_pos, 1
+    gt $I11, rx1008_eos, rx1008_fail
+    sub $I11, rx1008_pos, rx1008_off
+    substr $S10, rx1008_tgt, $I11, 1
+    ne $S10, "|", rx1008_fail
+    add rx1008_pos, 1
+    set_addr $I10, rxcap_1013_fail
+    ($I12, $I11) = rx1008_cur."!mark_peek"($I10)
+    rx1008_cur."!cursor_pos"($I11)
+    ($P10) = rx1008_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1008_pos, "")
+    rx1008_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1013_done
+  rxcap_1013_fail:
+    goto rx1008_fail
+  rxcap_1013_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1008_cur."!cursor_pos"(rx1008_pos)
+    $P10 = rx1008_cur."O"("%symbolic_unary")
+    unless $P10, rx1008_fail
+    rx1008_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1008_pos = $P10."pos"()
+  # rx pass
+    rx1008_cur."!cursor_pass"(rx1008_pos, "prefix:sym<|>")
+    rx1008_cur."!cursor_debug"("PASS  ", "prefix:sym<|>", " at pos=", rx1008_pos)
+    .return (rx1008_cur)
+  rx1008_fail:
+.annotate "line", 413
+    (rx1008_rep, rx1008_pos, $I10, $P10) = rx1008_cur."!mark_fail"(0)
+    lt rx1008_pos, -1, rx1008_done
+    eq rx1008_pos, -1, rx1008_fail
+    jump $I10
+  rx1008_done:
+    rx1008_cur."!cursor_fail"()
+    rx1008_cur."!cursor_debug"("FAIL  ", "prefix:sym<|>")
+    .return (rx1008_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__prefix:sym<|>"  :subid("256_1261064023.05912") :method
+.annotate "line", 413
+    $P1010 = self."!PREFIX__!subrule"("O", "|")
+    new $P1011, "ResizablePMCArray"
+    push $P1011, $P1010
+    .return ($P1011)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<*>"  :subid("257_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1015_tgt
+    .local int rx1015_pos
+    .local int rx1015_off
+    .local int rx1015_eos
+    .local int rx1015_rep
+    .local pmc rx1015_cur
+    (rx1015_cur, rx1015_pos, rx1015_tgt) = self."!cursor_start"()
+    rx1015_cur."!cursor_debug"("START ", "infix:sym<*>")
+    .lex unicode:"$\x{a2}", rx1015_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1015_eos, rx1015_tgt
+    set rx1015_off, 0
+    lt rx1015_pos, 2, rx1015_start
+    sub rx1015_off, rx1015_pos, 1
+    substr rx1015_tgt, rx1015_tgt, rx1015_off
+  rx1015_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1019_done
+    goto rxscan1019_scan
+  rxscan1019_loop:
+    ($P10) = rx1015_cur."from"()
+    inc $P10
+    set rx1015_pos, $P10
+    ge rx1015_pos, rx1015_eos, rxscan1019_done
+  rxscan1019_scan:
+    set_addr $I10, rxscan1019_loop
+    rx1015_cur."!mark_push"(0, rx1015_pos, $I10)
+  rxscan1019_done:
+.annotate "line", 473
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1020_fail
+    rx1015_cur."!mark_push"(0, rx1015_pos, $I10)
+  # rx literal  "*"
+    add $I11, rx1015_pos, 1
+    gt $I11, rx1015_eos, rx1015_fail
+    sub $I11, rx1015_pos, rx1015_off
+    substr $S10, rx1015_tgt, $I11, 1
+    ne $S10, "*", rx1015_fail
+    add rx1015_pos, 1
+    set_addr $I10, rxcap_1020_fail
+    ($I12, $I11) = rx1015_cur."!mark_peek"($I10)
+    rx1015_cur."!cursor_pos"($I11)
+    ($P10) = rx1015_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1015_pos, "")
+    rx1015_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1020_done
+  rxcap_1020_fail:
+    goto rx1015_fail
+  rxcap_1020_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1015_cur."!cursor_pos"(rx1015_pos)
+    $P10 = rx1015_cur."O"("%multiplicative, :pirop<mul>")
+    unless $P10, rx1015_fail
+    rx1015_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1015_pos = $P10."pos"()
+  # rx pass
+    rx1015_cur."!cursor_pass"(rx1015_pos, "infix:sym<*>")
+    rx1015_cur."!cursor_debug"("PASS  ", "infix:sym<*>", " at pos=", rx1015_pos)
+    .return (rx1015_cur)
+  rx1015_fail:
+.annotate "line", 413
+    (rx1015_rep, rx1015_pos, $I10, $P10) = rx1015_cur."!mark_fail"(0)
+    lt rx1015_pos, -1, rx1015_done
+    eq rx1015_pos, -1, rx1015_fail
+    jump $I10
+  rx1015_done:
+    rx1015_cur."!cursor_fail"()
+    rx1015_cur."!cursor_debug"("FAIL  ", "infix:sym<*>")
+    .return (rx1015_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<*>"  :subid("258_1261064023.05912") :method
+.annotate "line", 413
+    $P1017 = self."!PREFIX__!subrule"("O", "*")
+    new $P1018, "ResizablePMCArray"
+    push $P1018, $P1017
+    .return ($P1018)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym</>"  :subid("259_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1022_tgt
+    .local int rx1022_pos
+    .local int rx1022_off
+    .local int rx1022_eos
+    .local int rx1022_rep
+    .local pmc rx1022_cur
+    (rx1022_cur, rx1022_pos, rx1022_tgt) = self."!cursor_start"()
+    rx1022_cur."!cursor_debug"("START ", "infix:sym</>")
+    .lex unicode:"$\x{a2}", rx1022_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1022_eos, rx1022_tgt
+    set rx1022_off, 0
+    lt rx1022_pos, 2, rx1022_start
+    sub rx1022_off, rx1022_pos, 1
+    substr rx1022_tgt, rx1022_tgt, rx1022_off
+  rx1022_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1026_done
+    goto rxscan1026_scan
+  rxscan1026_loop:
+    ($P10) = rx1022_cur."from"()
+    inc $P10
+    set rx1022_pos, $P10
+    ge rx1022_pos, rx1022_eos, rxscan1026_done
+  rxscan1026_scan:
+    set_addr $I10, rxscan1026_loop
+    rx1022_cur."!mark_push"(0, rx1022_pos, $I10)
+  rxscan1026_done:
+.annotate "line", 474
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1027_fail
+    rx1022_cur."!mark_push"(0, rx1022_pos, $I10)
+  # rx literal  "/"
+    add $I11, rx1022_pos, 1
+    gt $I11, rx1022_eos, rx1022_fail
+    sub $I11, rx1022_pos, rx1022_off
+    substr $S10, rx1022_tgt, $I11, 1
+    ne $S10, "/", rx1022_fail
+    add rx1022_pos, 1
+    set_addr $I10, rxcap_1027_fail
+    ($I12, $I11) = rx1022_cur."!mark_peek"($I10)
+    rx1022_cur."!cursor_pos"($I11)
+    ($P10) = rx1022_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1022_pos, "")
+    rx1022_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1027_done
+  rxcap_1027_fail:
+    goto rx1022_fail
+  rxcap_1027_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1022_cur."!cursor_pos"(rx1022_pos)
+    $P10 = rx1022_cur."O"("%multiplicative, :pirop<div>")
+    unless $P10, rx1022_fail
+    rx1022_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1022_pos = $P10."pos"()
+  # rx pass
+    rx1022_cur."!cursor_pass"(rx1022_pos, "infix:sym</>")
+    rx1022_cur."!cursor_debug"("PASS  ", "infix:sym</>", " at pos=", rx1022_pos)
+    .return (rx1022_cur)
+  rx1022_fail:
+.annotate "line", 413
+    (rx1022_rep, rx1022_pos, $I10, $P10) = rx1022_cur."!mark_fail"(0)
+    lt rx1022_pos, -1, rx1022_done
+    eq rx1022_pos, -1, rx1022_fail
+    jump $I10
+  rx1022_done:
+    rx1022_cur."!cursor_fail"()
+    rx1022_cur."!cursor_debug"("FAIL  ", "infix:sym</>")
+    .return (rx1022_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym</>"  :subid("260_1261064023.05912") :method
+.annotate "line", 413
+    $P1024 = self."!PREFIX__!subrule"("O", "/")
+    new $P1025, "ResizablePMCArray"
+    push $P1025, $P1024
+    .return ($P1025)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<%>"  :subid("261_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1029_tgt
+    .local int rx1029_pos
+    .local int rx1029_off
+    .local int rx1029_eos
+    .local int rx1029_rep
+    .local pmc rx1029_cur
+    (rx1029_cur, rx1029_pos, rx1029_tgt) = self."!cursor_start"()
+    rx1029_cur."!cursor_debug"("START ", "infix:sym<%>")
+    .lex unicode:"$\x{a2}", rx1029_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1029_eos, rx1029_tgt
+    set rx1029_off, 0
+    lt rx1029_pos, 2, rx1029_start
+    sub rx1029_off, rx1029_pos, 1
+    substr rx1029_tgt, rx1029_tgt, rx1029_off
+  rx1029_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1033_done
+    goto rxscan1033_scan
+  rxscan1033_loop:
+    ($P10) = rx1029_cur."from"()
+    inc $P10
+    set rx1029_pos, $P10
+    ge rx1029_pos, rx1029_eos, rxscan1033_done
+  rxscan1033_scan:
+    set_addr $I10, rxscan1033_loop
+    rx1029_cur."!mark_push"(0, rx1029_pos, $I10)
+  rxscan1033_done:
+.annotate "line", 475
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1034_fail
+    rx1029_cur."!mark_push"(0, rx1029_pos, $I10)
+  # rx literal  "%"
+    add $I11, rx1029_pos, 1
+    gt $I11, rx1029_eos, rx1029_fail
+    sub $I11, rx1029_pos, rx1029_off
+    substr $S10, rx1029_tgt, $I11, 1
+    ne $S10, "%", rx1029_fail
+    add rx1029_pos, 1
+    set_addr $I10, rxcap_1034_fail
+    ($I12, $I11) = rx1029_cur."!mark_peek"($I10)
+    rx1029_cur."!cursor_pos"($I11)
+    ($P10) = rx1029_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1029_pos, "")
+    rx1029_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1034_done
+  rxcap_1034_fail:
+    goto rx1029_fail
+  rxcap_1034_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1029_cur."!cursor_pos"(rx1029_pos)
+    $P10 = rx1029_cur."O"("%multiplicative, :pirop<mod>")
+    unless $P10, rx1029_fail
+    rx1029_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1029_pos = $P10."pos"()
+  # rx pass
+    rx1029_cur."!cursor_pass"(rx1029_pos, "infix:sym<%>")
+    rx1029_cur."!cursor_debug"("PASS  ", "infix:sym<%>", " at pos=", rx1029_pos)
+    .return (rx1029_cur)
+  rx1029_fail:
+.annotate "line", 413
+    (rx1029_rep, rx1029_pos, $I10, $P10) = rx1029_cur."!mark_fail"(0)
+    lt rx1029_pos, -1, rx1029_done
+    eq rx1029_pos, -1, rx1029_fail
+    jump $I10
+  rx1029_done:
+    rx1029_cur."!cursor_fail"()
+    rx1029_cur."!cursor_debug"("FAIL  ", "infix:sym<%>")
+    .return (rx1029_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<%>"  :subid("262_1261064023.05912") :method
+.annotate "line", 413
+    $P1031 = self."!PREFIX__!subrule"("O", "%")
+    new $P1032, "ResizablePMCArray"
+    push $P1032, $P1031
+    .return ($P1032)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<+>"  :subid("263_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1036_tgt
+    .local int rx1036_pos
+    .local int rx1036_off
+    .local int rx1036_eos
+    .local int rx1036_rep
+    .local pmc rx1036_cur
+    (rx1036_cur, rx1036_pos, rx1036_tgt) = self."!cursor_start"()
+    rx1036_cur."!cursor_debug"("START ", "infix:sym<+>")
+    .lex unicode:"$\x{a2}", rx1036_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1036_eos, rx1036_tgt
+    set rx1036_off, 0
+    lt rx1036_pos, 2, rx1036_start
+    sub rx1036_off, rx1036_pos, 1
+    substr rx1036_tgt, rx1036_tgt, rx1036_off
+  rx1036_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1040_done
+    goto rxscan1040_scan
+  rxscan1040_loop:
+    ($P10) = rx1036_cur."from"()
+    inc $P10
+    set rx1036_pos, $P10
+    ge rx1036_pos, rx1036_eos, rxscan1040_done
+  rxscan1040_scan:
+    set_addr $I10, rxscan1040_loop
+    rx1036_cur."!mark_push"(0, rx1036_pos, $I10)
+  rxscan1040_done:
+.annotate "line", 477
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1041_fail
+    rx1036_cur."!mark_push"(0, rx1036_pos, $I10)
+  # rx literal  "+"
+    add $I11, rx1036_pos, 1
+    gt $I11, rx1036_eos, rx1036_fail
+    sub $I11, rx1036_pos, rx1036_off
+    substr $S10, rx1036_tgt, $I11, 1
+    ne $S10, "+", rx1036_fail
+    add rx1036_pos, 1
+    set_addr $I10, rxcap_1041_fail
+    ($I12, $I11) = rx1036_cur."!mark_peek"($I10)
+    rx1036_cur."!cursor_pos"($I11)
+    ($P10) = rx1036_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1036_pos, "")
+    rx1036_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1041_done
+  rxcap_1041_fail:
+    goto rx1036_fail
+  rxcap_1041_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1036_cur."!cursor_pos"(rx1036_pos)
+    $P10 = rx1036_cur."O"("%additive, :pirop<add>")
+    unless $P10, rx1036_fail
+    rx1036_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1036_pos = $P10."pos"()
+  # rx pass
+    rx1036_cur."!cursor_pass"(rx1036_pos, "infix:sym<+>")
+    rx1036_cur."!cursor_debug"("PASS  ", "infix:sym<+>", " at pos=", rx1036_pos)
+    .return (rx1036_cur)
+  rx1036_fail:
+.annotate "line", 413
+    (rx1036_rep, rx1036_pos, $I10, $P10) = rx1036_cur."!mark_fail"(0)
+    lt rx1036_pos, -1, rx1036_done
+    eq rx1036_pos, -1, rx1036_fail
+    jump $I10
+  rx1036_done:
+    rx1036_cur."!cursor_fail"()
+    rx1036_cur."!cursor_debug"("FAIL  ", "infix:sym<+>")
+    .return (rx1036_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<+>"  :subid("264_1261064023.05912") :method
+.annotate "line", 413
+    $P1038 = self."!PREFIX__!subrule"("O", "+")
+    new $P1039, "ResizablePMCArray"
+    push $P1039, $P1038
+    .return ($P1039)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<->"  :subid("265_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1043_tgt
+    .local int rx1043_pos
+    .local int rx1043_off
+    .local int rx1043_eos
+    .local int rx1043_rep
+    .local pmc rx1043_cur
+    (rx1043_cur, rx1043_pos, rx1043_tgt) = self."!cursor_start"()
+    rx1043_cur."!cursor_debug"("START ", "infix:sym<->")
+    .lex unicode:"$\x{a2}", rx1043_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1043_eos, rx1043_tgt
+    set rx1043_off, 0
+    lt rx1043_pos, 2, rx1043_start
+    sub rx1043_off, rx1043_pos, 1
+    substr rx1043_tgt, rx1043_tgt, rx1043_off
+  rx1043_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1047_done
+    goto rxscan1047_scan
+  rxscan1047_loop:
+    ($P10) = rx1043_cur."from"()
+    inc $P10
+    set rx1043_pos, $P10
+    ge rx1043_pos, rx1043_eos, rxscan1047_done
+  rxscan1047_scan:
+    set_addr $I10, rxscan1047_loop
+    rx1043_cur."!mark_push"(0, rx1043_pos, $I10)
+  rxscan1047_done:
+.annotate "line", 478
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1048_fail
+    rx1043_cur."!mark_push"(0, rx1043_pos, $I10)
+  # rx literal  "-"
+    add $I11, rx1043_pos, 1
+    gt $I11, rx1043_eos, rx1043_fail
+    sub $I11, rx1043_pos, rx1043_off
+    substr $S10, rx1043_tgt, $I11, 1
+    ne $S10, "-", rx1043_fail
+    add rx1043_pos, 1
+    set_addr $I10, rxcap_1048_fail
+    ($I12, $I11) = rx1043_cur."!mark_peek"($I10)
+    rx1043_cur."!cursor_pos"($I11)
+    ($P10) = rx1043_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1043_pos, "")
+    rx1043_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1048_done
+  rxcap_1048_fail:
+    goto rx1043_fail
+  rxcap_1048_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1043_cur."!cursor_pos"(rx1043_pos)
+    $P10 = rx1043_cur."O"("%additive, :pirop<sub>")
+    unless $P10, rx1043_fail
+    rx1043_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1043_pos = $P10."pos"()
+  # rx pass
+    rx1043_cur."!cursor_pass"(rx1043_pos, "infix:sym<->")
+    rx1043_cur."!cursor_debug"("PASS  ", "infix:sym<->", " at pos=", rx1043_pos)
+    .return (rx1043_cur)
+  rx1043_fail:
+.annotate "line", 413
+    (rx1043_rep, rx1043_pos, $I10, $P10) = rx1043_cur."!mark_fail"(0)
+    lt rx1043_pos, -1, rx1043_done
+    eq rx1043_pos, -1, rx1043_fail
+    jump $I10
+  rx1043_done:
+    rx1043_cur."!cursor_fail"()
+    rx1043_cur."!cursor_debug"("FAIL  ", "infix:sym<->")
+    .return (rx1043_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<->"  :subid("266_1261064023.05912") :method
+.annotate "line", 413
+    $P1045 = self."!PREFIX__!subrule"("O", "-")
+    new $P1046, "ResizablePMCArray"
+    push $P1046, $P1045
+    .return ($P1046)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<~>"  :subid("267_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1050_tgt
+    .local int rx1050_pos
+    .local int rx1050_off
+    .local int rx1050_eos
+    .local int rx1050_rep
+    .local pmc rx1050_cur
+    (rx1050_cur, rx1050_pos, rx1050_tgt) = self."!cursor_start"()
+    rx1050_cur."!cursor_debug"("START ", "infix:sym<~>")
+    .lex unicode:"$\x{a2}", rx1050_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1050_eos, rx1050_tgt
+    set rx1050_off, 0
+    lt rx1050_pos, 2, rx1050_start
+    sub rx1050_off, rx1050_pos, 1
+    substr rx1050_tgt, rx1050_tgt, rx1050_off
+  rx1050_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1054_done
+    goto rxscan1054_scan
+  rxscan1054_loop:
+    ($P10) = rx1050_cur."from"()
+    inc $P10
+    set rx1050_pos, $P10
+    ge rx1050_pos, rx1050_eos, rxscan1054_done
+  rxscan1054_scan:
+    set_addr $I10, rxscan1054_loop
+    rx1050_cur."!mark_push"(0, rx1050_pos, $I10)
+  rxscan1054_done:
+.annotate "line", 480
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1055_fail
+    rx1050_cur."!mark_push"(0, rx1050_pos, $I10)
+  # rx literal  "~"
+    add $I11, rx1050_pos, 1
+    gt $I11, rx1050_eos, rx1050_fail
+    sub $I11, rx1050_pos, rx1050_off
+    substr $S10, rx1050_tgt, $I11, 1
+    ne $S10, "~", rx1050_fail
+    add rx1050_pos, 1
+    set_addr $I10, rxcap_1055_fail
+    ($I12, $I11) = rx1050_cur."!mark_peek"($I10)
+    rx1050_cur."!cursor_pos"($I11)
+    ($P10) = rx1050_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1050_pos, "")
+    rx1050_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1055_done
+  rxcap_1055_fail:
+    goto rx1050_fail
+  rxcap_1055_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1050_cur."!cursor_pos"(rx1050_pos)
+    $P10 = rx1050_cur."O"("%concatenation , :pirop<concat>")
+    unless $P10, rx1050_fail
+    rx1050_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1050_pos = $P10."pos"()
+  # rx pass
+    rx1050_cur."!cursor_pass"(rx1050_pos, "infix:sym<~>")
+    rx1050_cur."!cursor_debug"("PASS  ", "infix:sym<~>", " at pos=", rx1050_pos)
+    .return (rx1050_cur)
+  rx1050_fail:
+.annotate "line", 413
+    (rx1050_rep, rx1050_pos, $I10, $P10) = rx1050_cur."!mark_fail"(0)
+    lt rx1050_pos, -1, rx1050_done
+    eq rx1050_pos, -1, rx1050_fail
+    jump $I10
+  rx1050_done:
+    rx1050_cur."!cursor_fail"()
+    rx1050_cur."!cursor_debug"("FAIL  ", "infix:sym<~>")
+    .return (rx1050_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<~>"  :subid("268_1261064023.05912") :method
+.annotate "line", 413
+    $P1052 = self."!PREFIX__!subrule"("O", "~")
+    new $P1053, "ResizablePMCArray"
+    push $P1053, $P1052
+    .return ($P1053)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<==>"  :subid("269_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1057_tgt
+    .local int rx1057_pos
+    .local int rx1057_off
+    .local int rx1057_eos
+    .local int rx1057_rep
+    .local pmc rx1057_cur
+    (rx1057_cur, rx1057_pos, rx1057_tgt) = self."!cursor_start"()
+    rx1057_cur."!cursor_debug"("START ", "infix:sym<==>")
+    .lex unicode:"$\x{a2}", rx1057_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1057_eos, rx1057_tgt
+    set rx1057_off, 0
+    lt rx1057_pos, 2, rx1057_start
+    sub rx1057_off, rx1057_pos, 1
+    substr rx1057_tgt, rx1057_tgt, rx1057_off
+  rx1057_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1061_done
+    goto rxscan1061_scan
+  rxscan1061_loop:
+    ($P10) = rx1057_cur."from"()
+    inc $P10
+    set rx1057_pos, $P10
+    ge rx1057_pos, rx1057_eos, rxscan1061_done
+  rxscan1061_scan:
+    set_addr $I10, rxscan1061_loop
+    rx1057_cur."!mark_push"(0, rx1057_pos, $I10)
+  rxscan1061_done:
+.annotate "line", 482
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1062_fail
+    rx1057_cur."!mark_push"(0, rx1057_pos, $I10)
+  # rx literal  "=="
+    add $I11, rx1057_pos, 2
+    gt $I11, rx1057_eos, rx1057_fail
+    sub $I11, rx1057_pos, rx1057_off
+    substr $S10, rx1057_tgt, $I11, 2
+    ne $S10, "==", rx1057_fail
+    add rx1057_pos, 2
+    set_addr $I10, rxcap_1062_fail
+    ($I12, $I11) = rx1057_cur."!mark_peek"($I10)
+    rx1057_cur."!cursor_pos"($I11)
+    ($P10) = rx1057_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1057_pos, "")
+    rx1057_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1062_done
+  rxcap_1062_fail:
+    goto rx1057_fail
+  rxcap_1062_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1057_cur."!cursor_pos"(rx1057_pos)
+    $P10 = rx1057_cur."O"("%relational, :pirop<iseq INn>")
+    unless $P10, rx1057_fail
+    rx1057_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1057_pos = $P10."pos"()
+  # rx pass
+    rx1057_cur."!cursor_pass"(rx1057_pos, "infix:sym<==>")
+    rx1057_cur."!cursor_debug"("PASS  ", "infix:sym<==>", " at pos=", rx1057_pos)
+    .return (rx1057_cur)
+  rx1057_fail:
+.annotate "line", 413
+    (rx1057_rep, rx1057_pos, $I10, $P10) = rx1057_cur."!mark_fail"(0)
+    lt rx1057_pos, -1, rx1057_done
+    eq rx1057_pos, -1, rx1057_fail
+    jump $I10
+  rx1057_done:
+    rx1057_cur."!cursor_fail"()
+    rx1057_cur."!cursor_debug"("FAIL  ", "infix:sym<==>")
+    .return (rx1057_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<==>"  :subid("270_1261064023.05912") :method
+.annotate "line", 413
+    $P1059 = self."!PREFIX__!subrule"("O", "==")
+    new $P1060, "ResizablePMCArray"
+    push $P1060, $P1059
+    .return ($P1060)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<!=>"  :subid("271_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1064_tgt
+    .local int rx1064_pos
+    .local int rx1064_off
+    .local int rx1064_eos
+    .local int rx1064_rep
+    .local pmc rx1064_cur
+    (rx1064_cur, rx1064_pos, rx1064_tgt) = self."!cursor_start"()
+    rx1064_cur."!cursor_debug"("START ", "infix:sym<!=>")
+    .lex unicode:"$\x{a2}", rx1064_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1064_eos, rx1064_tgt
+    set rx1064_off, 0
+    lt rx1064_pos, 2, rx1064_start
+    sub rx1064_off, rx1064_pos, 1
+    substr rx1064_tgt, rx1064_tgt, rx1064_off
+  rx1064_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1068_done
+    goto rxscan1068_scan
+  rxscan1068_loop:
+    ($P10) = rx1064_cur."from"()
+    inc $P10
+    set rx1064_pos, $P10
+    ge rx1064_pos, rx1064_eos, rxscan1068_done
+  rxscan1068_scan:
+    set_addr $I10, rxscan1068_loop
+    rx1064_cur."!mark_push"(0, rx1064_pos, $I10)
+  rxscan1068_done:
+.annotate "line", 483
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1069_fail
+    rx1064_cur."!mark_push"(0, rx1064_pos, $I10)
+  # rx literal  "!="
+    add $I11, rx1064_pos, 2
+    gt $I11, rx1064_eos, rx1064_fail
+    sub $I11, rx1064_pos, rx1064_off
+    substr $S10, rx1064_tgt, $I11, 2
+    ne $S10, "!=", rx1064_fail
+    add rx1064_pos, 2
+    set_addr $I10, rxcap_1069_fail
+    ($I12, $I11) = rx1064_cur."!mark_peek"($I10)
+    rx1064_cur."!cursor_pos"($I11)
+    ($P10) = rx1064_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1064_pos, "")
+    rx1064_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1069_done
+  rxcap_1069_fail:
+    goto rx1064_fail
+  rxcap_1069_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1064_cur."!cursor_pos"(rx1064_pos)
+    $P10 = rx1064_cur."O"("%relational, :pirop<isne INn>")
+    unless $P10, rx1064_fail
+    rx1064_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1064_pos = $P10."pos"()
+  # rx pass
+    rx1064_cur."!cursor_pass"(rx1064_pos, "infix:sym<!=>")
+    rx1064_cur."!cursor_debug"("PASS  ", "infix:sym<!=>", " at pos=", rx1064_pos)
+    .return (rx1064_cur)
+  rx1064_fail:
+.annotate "line", 413
+    (rx1064_rep, rx1064_pos, $I10, $P10) = rx1064_cur."!mark_fail"(0)
+    lt rx1064_pos, -1, rx1064_done
+    eq rx1064_pos, -1, rx1064_fail
+    jump $I10
+  rx1064_done:
+    rx1064_cur."!cursor_fail"()
+    rx1064_cur."!cursor_debug"("FAIL  ", "infix:sym<!=>")
+    .return (rx1064_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<!=>"  :subid("272_1261064023.05912") :method
+.annotate "line", 413
+    $P1066 = self."!PREFIX__!subrule"("O", "!=")
+    new $P1067, "ResizablePMCArray"
+    push $P1067, $P1066
+    .return ($P1067)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<<=>"  :subid("273_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1071_tgt
+    .local int rx1071_pos
+    .local int rx1071_off
+    .local int rx1071_eos
+    .local int rx1071_rep
+    .local pmc rx1071_cur
+    (rx1071_cur, rx1071_pos, rx1071_tgt) = self."!cursor_start"()
+    rx1071_cur."!cursor_debug"("START ", "infix:sym<<=>")
+    .lex unicode:"$\x{a2}", rx1071_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1071_eos, rx1071_tgt
+    set rx1071_off, 0
+    lt rx1071_pos, 2, rx1071_start
+    sub rx1071_off, rx1071_pos, 1
+    substr rx1071_tgt, rx1071_tgt, rx1071_off
+  rx1071_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1075_done
+    goto rxscan1075_scan
+  rxscan1075_loop:
+    ($P10) = rx1071_cur."from"()
+    inc $P10
+    set rx1071_pos, $P10
+    ge rx1071_pos, rx1071_eos, rxscan1075_done
+  rxscan1075_scan:
+    set_addr $I10, rxscan1075_loop
+    rx1071_cur."!mark_push"(0, rx1071_pos, $I10)
+  rxscan1075_done:
+.annotate "line", 484
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1076_fail
+    rx1071_cur."!mark_push"(0, rx1071_pos, $I10)
+  # rx literal  "<="
+    add $I11, rx1071_pos, 2
+    gt $I11, rx1071_eos, rx1071_fail
+    sub $I11, rx1071_pos, rx1071_off
+    substr $S10, rx1071_tgt, $I11, 2
+    ne $S10, "<=", rx1071_fail
+    add rx1071_pos, 2
+    set_addr $I10, rxcap_1076_fail
+    ($I12, $I11) = rx1071_cur."!mark_peek"($I10)
+    rx1071_cur."!cursor_pos"($I11)
+    ($P10) = rx1071_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1071_pos, "")
+    rx1071_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1076_done
+  rxcap_1076_fail:
+    goto rx1071_fail
+  rxcap_1076_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1071_cur."!cursor_pos"(rx1071_pos)
+    $P10 = rx1071_cur."O"("%relational, :pirop<isle INn>")
+    unless $P10, rx1071_fail
+    rx1071_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1071_pos = $P10."pos"()
+  # rx pass
+    rx1071_cur."!cursor_pass"(rx1071_pos, "infix:sym<<=>")
+    rx1071_cur."!cursor_debug"("PASS  ", "infix:sym<<=>", " at pos=", rx1071_pos)
+    .return (rx1071_cur)
+  rx1071_fail:
+.annotate "line", 413
+    (rx1071_rep, rx1071_pos, $I10, $P10) = rx1071_cur."!mark_fail"(0)
+    lt rx1071_pos, -1, rx1071_done
+    eq rx1071_pos, -1, rx1071_fail
+    jump $I10
+  rx1071_done:
+    rx1071_cur."!cursor_fail"()
+    rx1071_cur."!cursor_debug"("FAIL  ", "infix:sym<<=>")
+    .return (rx1071_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<<=>"  :subid("274_1261064023.05912") :method
+.annotate "line", 413
+    $P1073 = self."!PREFIX__!subrule"("O", "<=")
+    new $P1074, "ResizablePMCArray"
+    push $P1074, $P1073
+    .return ($P1074)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<>=>"  :subid("275_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1078_tgt
+    .local int rx1078_pos
+    .local int rx1078_off
+    .local int rx1078_eos
+    .local int rx1078_rep
+    .local pmc rx1078_cur
+    (rx1078_cur, rx1078_pos, rx1078_tgt) = self."!cursor_start"()
+    rx1078_cur."!cursor_debug"("START ", "infix:sym<>=>")
+    .lex unicode:"$\x{a2}", rx1078_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1078_eos, rx1078_tgt
+    set rx1078_off, 0
+    lt rx1078_pos, 2, rx1078_start
+    sub rx1078_off, rx1078_pos, 1
+    substr rx1078_tgt, rx1078_tgt, rx1078_off
+  rx1078_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1082_done
+    goto rxscan1082_scan
+  rxscan1082_loop:
+    ($P10) = rx1078_cur."from"()
+    inc $P10
+    set rx1078_pos, $P10
+    ge rx1078_pos, rx1078_eos, rxscan1082_done
+  rxscan1082_scan:
+    set_addr $I10, rxscan1082_loop
+    rx1078_cur."!mark_push"(0, rx1078_pos, $I10)
+  rxscan1082_done:
+.annotate "line", 485
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1083_fail
+    rx1078_cur."!mark_push"(0, rx1078_pos, $I10)
+  # rx literal  ">="
+    add $I11, rx1078_pos, 2
+    gt $I11, rx1078_eos, rx1078_fail
+    sub $I11, rx1078_pos, rx1078_off
+    substr $S10, rx1078_tgt, $I11, 2
+    ne $S10, ">=", rx1078_fail
+    add rx1078_pos, 2
+    set_addr $I10, rxcap_1083_fail
+    ($I12, $I11) = rx1078_cur."!mark_peek"($I10)
+    rx1078_cur."!cursor_pos"($I11)
+    ($P10) = rx1078_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1078_pos, "")
+    rx1078_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1083_done
+  rxcap_1083_fail:
+    goto rx1078_fail
+  rxcap_1083_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1078_cur."!cursor_pos"(rx1078_pos)
+    $P10 = rx1078_cur."O"("%relational, :pirop<isge INn>")
+    unless $P10, rx1078_fail
+    rx1078_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1078_pos = $P10."pos"()
+  # rx pass
+    rx1078_cur."!cursor_pass"(rx1078_pos, "infix:sym<>=>")
+    rx1078_cur."!cursor_debug"("PASS  ", "infix:sym<>=>", " at pos=", rx1078_pos)
+    .return (rx1078_cur)
+  rx1078_fail:
+.annotate "line", 413
+    (rx1078_rep, rx1078_pos, $I10, $P10) = rx1078_cur."!mark_fail"(0)
+    lt rx1078_pos, -1, rx1078_done
+    eq rx1078_pos, -1, rx1078_fail
+    jump $I10
+  rx1078_done:
+    rx1078_cur."!cursor_fail"()
+    rx1078_cur."!cursor_debug"("FAIL  ", "infix:sym<>=>")
+    .return (rx1078_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<>=>"  :subid("276_1261064023.05912") :method
+.annotate "line", 413
+    $P1080 = self."!PREFIX__!subrule"("O", ">=")
+    new $P1081, "ResizablePMCArray"
+    push $P1081, $P1080
+    .return ($P1081)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<<>"  :subid("277_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1085_tgt
+    .local int rx1085_pos
+    .local int rx1085_off
+    .local int rx1085_eos
+    .local int rx1085_rep
+    .local pmc rx1085_cur
+    (rx1085_cur, rx1085_pos, rx1085_tgt) = self."!cursor_start"()
+    rx1085_cur."!cursor_debug"("START ", "infix:sym<<>")
+    .lex unicode:"$\x{a2}", rx1085_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1085_eos, rx1085_tgt
+    set rx1085_off, 0
+    lt rx1085_pos, 2, rx1085_start
+    sub rx1085_off, rx1085_pos, 1
+    substr rx1085_tgt, rx1085_tgt, rx1085_off
+  rx1085_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1089_done
+    goto rxscan1089_scan
+  rxscan1089_loop:
+    ($P10) = rx1085_cur."from"()
+    inc $P10
+    set rx1085_pos, $P10
+    ge rx1085_pos, rx1085_eos, rxscan1089_done
+  rxscan1089_scan:
+    set_addr $I10, rxscan1089_loop
+    rx1085_cur."!mark_push"(0, rx1085_pos, $I10)
+  rxscan1089_done:
+.annotate "line", 486
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1090_fail
+    rx1085_cur."!mark_push"(0, rx1085_pos, $I10)
+  # rx literal  "<"
+    add $I11, rx1085_pos, 1
+    gt $I11, rx1085_eos, rx1085_fail
+    sub $I11, rx1085_pos, rx1085_off
+    substr $S10, rx1085_tgt, $I11, 1
+    ne $S10, "<", rx1085_fail
+    add rx1085_pos, 1
+    set_addr $I10, rxcap_1090_fail
+    ($I12, $I11) = rx1085_cur."!mark_peek"($I10)
+    rx1085_cur."!cursor_pos"($I11)
+    ($P10) = rx1085_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1085_pos, "")
+    rx1085_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1090_done
+  rxcap_1090_fail:
+    goto rx1085_fail
+  rxcap_1090_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1085_cur."!cursor_pos"(rx1085_pos)
+    $P10 = rx1085_cur."O"("%relational, :pirop<islt INn>")
+    unless $P10, rx1085_fail
+    rx1085_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1085_pos = $P10."pos"()
+  # rx pass
+    rx1085_cur."!cursor_pass"(rx1085_pos, "infix:sym<<>")
+    rx1085_cur."!cursor_debug"("PASS  ", "infix:sym<<>", " at pos=", rx1085_pos)
+    .return (rx1085_cur)
+  rx1085_fail:
+.annotate "line", 413
+    (rx1085_rep, rx1085_pos, $I10, $P10) = rx1085_cur."!mark_fail"(0)
+    lt rx1085_pos, -1, rx1085_done
+    eq rx1085_pos, -1, rx1085_fail
+    jump $I10
+  rx1085_done:
+    rx1085_cur."!cursor_fail"()
+    rx1085_cur."!cursor_debug"("FAIL  ", "infix:sym<<>")
+    .return (rx1085_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<<>"  :subid("278_1261064023.05912") :method
+.annotate "line", 413
+    $P1087 = self."!PREFIX__!subrule"("O", "<")
+    new $P1088, "ResizablePMCArray"
+    push $P1088, $P1087
+    .return ($P1088)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<>>"  :subid("279_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1092_tgt
+    .local int rx1092_pos
+    .local int rx1092_off
+    .local int rx1092_eos
+    .local int rx1092_rep
+    .local pmc rx1092_cur
+    (rx1092_cur, rx1092_pos, rx1092_tgt) = self."!cursor_start"()
+    rx1092_cur."!cursor_debug"("START ", "infix:sym<>>")
+    .lex unicode:"$\x{a2}", rx1092_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1092_eos, rx1092_tgt
+    set rx1092_off, 0
+    lt rx1092_pos, 2, rx1092_start
+    sub rx1092_off, rx1092_pos, 1
+    substr rx1092_tgt, rx1092_tgt, rx1092_off
+  rx1092_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1096_done
+    goto rxscan1096_scan
+  rxscan1096_loop:
+    ($P10) = rx1092_cur."from"()
+    inc $P10
+    set rx1092_pos, $P10
+    ge rx1092_pos, rx1092_eos, rxscan1096_done
+  rxscan1096_scan:
+    set_addr $I10, rxscan1096_loop
+    rx1092_cur."!mark_push"(0, rx1092_pos, $I10)
+  rxscan1096_done:
+.annotate "line", 487
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1097_fail
+    rx1092_cur."!mark_push"(0, rx1092_pos, $I10)
+  # rx literal  ">"
+    add $I11, rx1092_pos, 1
+    gt $I11, rx1092_eos, rx1092_fail
+    sub $I11, rx1092_pos, rx1092_off
+    substr $S10, rx1092_tgt, $I11, 1
+    ne $S10, ">", rx1092_fail
+    add rx1092_pos, 1
+    set_addr $I10, rxcap_1097_fail
+    ($I12, $I11) = rx1092_cur."!mark_peek"($I10)
+    rx1092_cur."!cursor_pos"($I11)
+    ($P10) = rx1092_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1092_pos, "")
+    rx1092_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1097_done
+  rxcap_1097_fail:
+    goto rx1092_fail
+  rxcap_1097_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1092_cur."!cursor_pos"(rx1092_pos)
+    $P10 = rx1092_cur."O"("%relational, :pirop<isgt INn>")
+    unless $P10, rx1092_fail
+    rx1092_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1092_pos = $P10."pos"()
+  # rx pass
+    rx1092_cur."!cursor_pass"(rx1092_pos, "infix:sym<>>")
+    rx1092_cur."!cursor_debug"("PASS  ", "infix:sym<>>", " at pos=", rx1092_pos)
+    .return (rx1092_cur)
+  rx1092_fail:
+.annotate "line", 413
+    (rx1092_rep, rx1092_pos, $I10, $P10) = rx1092_cur."!mark_fail"(0)
+    lt rx1092_pos, -1, rx1092_done
+    eq rx1092_pos, -1, rx1092_fail
+    jump $I10
+  rx1092_done:
+    rx1092_cur."!cursor_fail"()
+    rx1092_cur."!cursor_debug"("FAIL  ", "infix:sym<>>")
+    .return (rx1092_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<>>"  :subid("280_1261064023.05912") :method
+.annotate "line", 413
+    $P1094 = self."!PREFIX__!subrule"("O", ">")
+    new $P1095, "ResizablePMCArray"
+    push $P1095, $P1094
+    .return ($P1095)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<eq>"  :subid("281_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1099_tgt
+    .local int rx1099_pos
+    .local int rx1099_off
+    .local int rx1099_eos
+    .local int rx1099_rep
+    .local pmc rx1099_cur
+    (rx1099_cur, rx1099_pos, rx1099_tgt) = self."!cursor_start"()
+    rx1099_cur."!cursor_debug"("START ", "infix:sym<eq>")
+    .lex unicode:"$\x{a2}", rx1099_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1099_eos, rx1099_tgt
+    set rx1099_off, 0
+    lt rx1099_pos, 2, rx1099_start
+    sub rx1099_off, rx1099_pos, 1
+    substr rx1099_tgt, rx1099_tgt, rx1099_off
+  rx1099_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1103_done
+    goto rxscan1103_scan
+  rxscan1103_loop:
+    ($P10) = rx1099_cur."from"()
+    inc $P10
+    set rx1099_pos, $P10
+    ge rx1099_pos, rx1099_eos, rxscan1103_done
+  rxscan1103_scan:
+    set_addr $I10, rxscan1103_loop
+    rx1099_cur."!mark_push"(0, rx1099_pos, $I10)
+  rxscan1103_done:
+.annotate "line", 488
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1104_fail
+    rx1099_cur."!mark_push"(0, rx1099_pos, $I10)
+  # rx literal  "eq"
+    add $I11, rx1099_pos, 2
+    gt $I11, rx1099_eos, rx1099_fail
+    sub $I11, rx1099_pos, rx1099_off
+    substr $S10, rx1099_tgt, $I11, 2
+    ne $S10, "eq", rx1099_fail
+    add rx1099_pos, 2
+    set_addr $I10, rxcap_1104_fail
+    ($I12, $I11) = rx1099_cur."!mark_peek"($I10)
+    rx1099_cur."!cursor_pos"($I11)
+    ($P10) = rx1099_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1099_pos, "")
+    rx1099_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1104_done
+  rxcap_1104_fail:
+    goto rx1099_fail
+  rxcap_1104_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1099_cur."!cursor_pos"(rx1099_pos)
+    $P10 = rx1099_cur."O"("%relational, :pirop<iseq ISs>")
+    unless $P10, rx1099_fail
+    rx1099_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1099_pos = $P10."pos"()
+  # rx pass
+    rx1099_cur."!cursor_pass"(rx1099_pos, "infix:sym<eq>")
+    rx1099_cur."!cursor_debug"("PASS  ", "infix:sym<eq>", " at pos=", rx1099_pos)
+    .return (rx1099_cur)
+  rx1099_fail:
+.annotate "line", 413
+    (rx1099_rep, rx1099_pos, $I10, $P10) = rx1099_cur."!mark_fail"(0)
+    lt rx1099_pos, -1, rx1099_done
+    eq rx1099_pos, -1, rx1099_fail
+    jump $I10
+  rx1099_done:
+    rx1099_cur."!cursor_fail"()
+    rx1099_cur."!cursor_debug"("FAIL  ", "infix:sym<eq>")
+    .return (rx1099_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<eq>"  :subid("282_1261064023.05912") :method
+.annotate "line", 413
+    $P1101 = self."!PREFIX__!subrule"("O", "eq")
+    new $P1102, "ResizablePMCArray"
+    push $P1102, $P1101
+    .return ($P1102)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<ne>"  :subid("283_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1106_tgt
+    .local int rx1106_pos
+    .local int rx1106_off
+    .local int rx1106_eos
+    .local int rx1106_rep
+    .local pmc rx1106_cur
+    (rx1106_cur, rx1106_pos, rx1106_tgt) = self."!cursor_start"()
+    rx1106_cur."!cursor_debug"("START ", "infix:sym<ne>")
+    .lex unicode:"$\x{a2}", rx1106_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1106_eos, rx1106_tgt
+    set rx1106_off, 0
+    lt rx1106_pos, 2, rx1106_start
+    sub rx1106_off, rx1106_pos, 1
+    substr rx1106_tgt, rx1106_tgt, rx1106_off
+  rx1106_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1110_done
+    goto rxscan1110_scan
+  rxscan1110_loop:
+    ($P10) = rx1106_cur."from"()
+    inc $P10
+    set rx1106_pos, $P10
+    ge rx1106_pos, rx1106_eos, rxscan1110_done
+  rxscan1110_scan:
+    set_addr $I10, rxscan1110_loop
+    rx1106_cur."!mark_push"(0, rx1106_pos, $I10)
+  rxscan1110_done:
+.annotate "line", 489
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1111_fail
+    rx1106_cur."!mark_push"(0, rx1106_pos, $I10)
+  # rx literal  "ne"
+    add $I11, rx1106_pos, 2
+    gt $I11, rx1106_eos, rx1106_fail
+    sub $I11, rx1106_pos, rx1106_off
+    substr $S10, rx1106_tgt, $I11, 2
+    ne $S10, "ne", rx1106_fail
+    add rx1106_pos, 2
+    set_addr $I10, rxcap_1111_fail
+    ($I12, $I11) = rx1106_cur."!mark_peek"($I10)
+    rx1106_cur."!cursor_pos"($I11)
+    ($P10) = rx1106_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1106_pos, "")
+    rx1106_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1111_done
+  rxcap_1111_fail:
+    goto rx1106_fail
+  rxcap_1111_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1106_cur."!cursor_pos"(rx1106_pos)
+    $P10 = rx1106_cur."O"("%relational, :pirop<isne ISs>")
+    unless $P10, rx1106_fail
+    rx1106_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1106_pos = $P10."pos"()
+  # rx pass
+    rx1106_cur."!cursor_pass"(rx1106_pos, "infix:sym<ne>")
+    rx1106_cur."!cursor_debug"("PASS  ", "infix:sym<ne>", " at pos=", rx1106_pos)
+    .return (rx1106_cur)
+  rx1106_fail:
+.annotate "line", 413
+    (rx1106_rep, rx1106_pos, $I10, $P10) = rx1106_cur."!mark_fail"(0)
+    lt rx1106_pos, -1, rx1106_done
+    eq rx1106_pos, -1, rx1106_fail
+    jump $I10
+  rx1106_done:
+    rx1106_cur."!cursor_fail"()
+    rx1106_cur."!cursor_debug"("FAIL  ", "infix:sym<ne>")
+    .return (rx1106_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<ne>"  :subid("284_1261064023.05912") :method
+.annotate "line", 413
+    $P1108 = self."!PREFIX__!subrule"("O", "ne")
+    new $P1109, "ResizablePMCArray"
+    push $P1109, $P1108
+    .return ($P1109)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<le>"  :subid("285_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1113_tgt
+    .local int rx1113_pos
+    .local int rx1113_off
+    .local int rx1113_eos
+    .local int rx1113_rep
+    .local pmc rx1113_cur
+    (rx1113_cur, rx1113_pos, rx1113_tgt) = self."!cursor_start"()
+    rx1113_cur."!cursor_debug"("START ", "infix:sym<le>")
+    .lex unicode:"$\x{a2}", rx1113_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1113_eos, rx1113_tgt
+    set rx1113_off, 0
+    lt rx1113_pos, 2, rx1113_start
+    sub rx1113_off, rx1113_pos, 1
+    substr rx1113_tgt, rx1113_tgt, rx1113_off
+  rx1113_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1117_done
+    goto rxscan1117_scan
+  rxscan1117_loop:
+    ($P10) = rx1113_cur."from"()
+    inc $P10
+    set rx1113_pos, $P10
+    ge rx1113_pos, rx1113_eos, rxscan1117_done
+  rxscan1117_scan:
+    set_addr $I10, rxscan1117_loop
+    rx1113_cur."!mark_push"(0, rx1113_pos, $I10)
+  rxscan1117_done:
+.annotate "line", 490
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1118_fail
+    rx1113_cur."!mark_push"(0, rx1113_pos, $I10)
+  # rx literal  "le"
+    add $I11, rx1113_pos, 2
+    gt $I11, rx1113_eos, rx1113_fail
+    sub $I11, rx1113_pos, rx1113_off
+    substr $S10, rx1113_tgt, $I11, 2
+    ne $S10, "le", rx1113_fail
+    add rx1113_pos, 2
+    set_addr $I10, rxcap_1118_fail
+    ($I12, $I11) = rx1113_cur."!mark_peek"($I10)
+    rx1113_cur."!cursor_pos"($I11)
+    ($P10) = rx1113_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1113_pos, "")
+    rx1113_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1118_done
+  rxcap_1118_fail:
+    goto rx1113_fail
+  rxcap_1118_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1113_cur."!cursor_pos"(rx1113_pos)
+    $P10 = rx1113_cur."O"("%relational, :pirop<isle ISs>")
+    unless $P10, rx1113_fail
+    rx1113_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1113_pos = $P10."pos"()
+  # rx pass
+    rx1113_cur."!cursor_pass"(rx1113_pos, "infix:sym<le>")
+    rx1113_cur."!cursor_debug"("PASS  ", "infix:sym<le>", " at pos=", rx1113_pos)
+    .return (rx1113_cur)
+  rx1113_fail:
+.annotate "line", 413
+    (rx1113_rep, rx1113_pos, $I10, $P10) = rx1113_cur."!mark_fail"(0)
+    lt rx1113_pos, -1, rx1113_done
+    eq rx1113_pos, -1, rx1113_fail
+    jump $I10
+  rx1113_done:
+    rx1113_cur."!cursor_fail"()
+    rx1113_cur."!cursor_debug"("FAIL  ", "infix:sym<le>")
+    .return (rx1113_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<le>"  :subid("286_1261064023.05912") :method
+.annotate "line", 413
+    $P1115 = self."!PREFIX__!subrule"("O", "le")
+    new $P1116, "ResizablePMCArray"
+    push $P1116, $P1115
+    .return ($P1116)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<ge>"  :subid("287_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1120_tgt
+    .local int rx1120_pos
+    .local int rx1120_off
+    .local int rx1120_eos
+    .local int rx1120_rep
+    .local pmc rx1120_cur
+    (rx1120_cur, rx1120_pos, rx1120_tgt) = self."!cursor_start"()
+    rx1120_cur."!cursor_debug"("START ", "infix:sym<ge>")
+    .lex unicode:"$\x{a2}", rx1120_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1120_eos, rx1120_tgt
+    set rx1120_off, 0
+    lt rx1120_pos, 2, rx1120_start
+    sub rx1120_off, rx1120_pos, 1
+    substr rx1120_tgt, rx1120_tgt, rx1120_off
+  rx1120_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1124_done
+    goto rxscan1124_scan
+  rxscan1124_loop:
+    ($P10) = rx1120_cur."from"()
+    inc $P10
+    set rx1120_pos, $P10
+    ge rx1120_pos, rx1120_eos, rxscan1124_done
+  rxscan1124_scan:
+    set_addr $I10, rxscan1124_loop
+    rx1120_cur."!mark_push"(0, rx1120_pos, $I10)
+  rxscan1124_done:
+.annotate "line", 491
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1125_fail
+    rx1120_cur."!mark_push"(0, rx1120_pos, $I10)
+  # rx literal  "ge"
+    add $I11, rx1120_pos, 2
+    gt $I11, rx1120_eos, rx1120_fail
+    sub $I11, rx1120_pos, rx1120_off
+    substr $S10, rx1120_tgt, $I11, 2
+    ne $S10, "ge", rx1120_fail
+    add rx1120_pos, 2
+    set_addr $I10, rxcap_1125_fail
+    ($I12, $I11) = rx1120_cur."!mark_peek"($I10)
+    rx1120_cur."!cursor_pos"($I11)
+    ($P10) = rx1120_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1120_pos, "")
+    rx1120_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1125_done
+  rxcap_1125_fail:
+    goto rx1120_fail
+  rxcap_1125_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1120_cur."!cursor_pos"(rx1120_pos)
+    $P10 = rx1120_cur."O"("%relational, :pirop<isge ISs>")
+    unless $P10, rx1120_fail
+    rx1120_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1120_pos = $P10."pos"()
+  # rx pass
+    rx1120_cur."!cursor_pass"(rx1120_pos, "infix:sym<ge>")
+    rx1120_cur."!cursor_debug"("PASS  ", "infix:sym<ge>", " at pos=", rx1120_pos)
+    .return (rx1120_cur)
+  rx1120_fail:
+.annotate "line", 413
+    (rx1120_rep, rx1120_pos, $I10, $P10) = rx1120_cur."!mark_fail"(0)
+    lt rx1120_pos, -1, rx1120_done
+    eq rx1120_pos, -1, rx1120_fail
+    jump $I10
+  rx1120_done:
+    rx1120_cur."!cursor_fail"()
+    rx1120_cur."!cursor_debug"("FAIL  ", "infix:sym<ge>")
+    .return (rx1120_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<ge>"  :subid("288_1261064023.05912") :method
+.annotate "line", 413
+    $P1122 = self."!PREFIX__!subrule"("O", "ge")
+    new $P1123, "ResizablePMCArray"
+    push $P1123, $P1122
+    .return ($P1123)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<lt>"  :subid("289_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1127_tgt
+    .local int rx1127_pos
+    .local int rx1127_off
+    .local int rx1127_eos
+    .local int rx1127_rep
+    .local pmc rx1127_cur
+    (rx1127_cur, rx1127_pos, rx1127_tgt) = self."!cursor_start"()
+    rx1127_cur."!cursor_debug"("START ", "infix:sym<lt>")
+    .lex unicode:"$\x{a2}", rx1127_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1127_eos, rx1127_tgt
+    set rx1127_off, 0
+    lt rx1127_pos, 2, rx1127_start
+    sub rx1127_off, rx1127_pos, 1
+    substr rx1127_tgt, rx1127_tgt, rx1127_off
+  rx1127_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1131_done
+    goto rxscan1131_scan
+  rxscan1131_loop:
+    ($P10) = rx1127_cur."from"()
+    inc $P10
+    set rx1127_pos, $P10
+    ge rx1127_pos, rx1127_eos, rxscan1131_done
+  rxscan1131_scan:
+    set_addr $I10, rxscan1131_loop
+    rx1127_cur."!mark_push"(0, rx1127_pos, $I10)
+  rxscan1131_done:
+.annotate "line", 492
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1132_fail
+    rx1127_cur."!mark_push"(0, rx1127_pos, $I10)
+  # rx literal  "lt"
+    add $I11, rx1127_pos, 2
+    gt $I11, rx1127_eos, rx1127_fail
+    sub $I11, rx1127_pos, rx1127_off
+    substr $S10, rx1127_tgt, $I11, 2
+    ne $S10, "lt", rx1127_fail
+    add rx1127_pos, 2
+    set_addr $I10, rxcap_1132_fail
+    ($I12, $I11) = rx1127_cur."!mark_peek"($I10)
+    rx1127_cur."!cursor_pos"($I11)
+    ($P10) = rx1127_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1127_pos, "")
+    rx1127_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1132_done
+  rxcap_1132_fail:
+    goto rx1127_fail
+  rxcap_1132_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1127_cur."!cursor_pos"(rx1127_pos)
+    $P10 = rx1127_cur."O"("%relational, :pirop<islt ISs>")
+    unless $P10, rx1127_fail
+    rx1127_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1127_pos = $P10."pos"()
+  # rx pass
+    rx1127_cur."!cursor_pass"(rx1127_pos, "infix:sym<lt>")
+    rx1127_cur."!cursor_debug"("PASS  ", "infix:sym<lt>", " at pos=", rx1127_pos)
+    .return (rx1127_cur)
+  rx1127_fail:
+.annotate "line", 413
+    (rx1127_rep, rx1127_pos, $I10, $P10) = rx1127_cur."!mark_fail"(0)
+    lt rx1127_pos, -1, rx1127_done
+    eq rx1127_pos, -1, rx1127_fail
+    jump $I10
+  rx1127_done:
+    rx1127_cur."!cursor_fail"()
+    rx1127_cur."!cursor_debug"("FAIL  ", "infix:sym<lt>")
+    .return (rx1127_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<lt>"  :subid("290_1261064023.05912") :method
+.annotate "line", 413
+    $P1129 = self."!PREFIX__!subrule"("O", "lt")
+    new $P1130, "ResizablePMCArray"
+    push $P1130, $P1129
+    .return ($P1130)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<gt>"  :subid("291_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1134_tgt
+    .local int rx1134_pos
+    .local int rx1134_off
+    .local int rx1134_eos
+    .local int rx1134_rep
+    .local pmc rx1134_cur
+    (rx1134_cur, rx1134_pos, rx1134_tgt) = self."!cursor_start"()
+    rx1134_cur."!cursor_debug"("START ", "infix:sym<gt>")
+    .lex unicode:"$\x{a2}", rx1134_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1134_eos, rx1134_tgt
+    set rx1134_off, 0
+    lt rx1134_pos, 2, rx1134_start
+    sub rx1134_off, rx1134_pos, 1
+    substr rx1134_tgt, rx1134_tgt, rx1134_off
+  rx1134_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1138_done
+    goto rxscan1138_scan
+  rxscan1138_loop:
+    ($P10) = rx1134_cur."from"()
+    inc $P10
+    set rx1134_pos, $P10
+    ge rx1134_pos, rx1134_eos, rxscan1138_done
+  rxscan1138_scan:
+    set_addr $I10, rxscan1138_loop
+    rx1134_cur."!mark_push"(0, rx1134_pos, $I10)
+  rxscan1138_done:
+.annotate "line", 493
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1139_fail
+    rx1134_cur."!mark_push"(0, rx1134_pos, $I10)
+  # rx literal  "gt"
+    add $I11, rx1134_pos, 2
+    gt $I11, rx1134_eos, rx1134_fail
+    sub $I11, rx1134_pos, rx1134_off
+    substr $S10, rx1134_tgt, $I11, 2
+    ne $S10, "gt", rx1134_fail
+    add rx1134_pos, 2
+    set_addr $I10, rxcap_1139_fail
+    ($I12, $I11) = rx1134_cur."!mark_peek"($I10)
+    rx1134_cur."!cursor_pos"($I11)
+    ($P10) = rx1134_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1134_pos, "")
+    rx1134_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1139_done
+  rxcap_1139_fail:
+    goto rx1134_fail
+  rxcap_1139_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1134_cur."!cursor_pos"(rx1134_pos)
+    $P10 = rx1134_cur."O"("%relational, :pirop<isgt ISs>")
+    unless $P10, rx1134_fail
+    rx1134_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1134_pos = $P10."pos"()
+  # rx pass
+    rx1134_cur."!cursor_pass"(rx1134_pos, "infix:sym<gt>")
+    rx1134_cur."!cursor_debug"("PASS  ", "infix:sym<gt>", " at pos=", rx1134_pos)
+    .return (rx1134_cur)
+  rx1134_fail:
+.annotate "line", 413
+    (rx1134_rep, rx1134_pos, $I10, $P10) = rx1134_cur."!mark_fail"(0)
+    lt rx1134_pos, -1, rx1134_done
+    eq rx1134_pos, -1, rx1134_fail
+    jump $I10
+  rx1134_done:
+    rx1134_cur."!cursor_fail"()
+    rx1134_cur."!cursor_debug"("FAIL  ", "infix:sym<gt>")
+    .return (rx1134_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<gt>"  :subid("292_1261064023.05912") :method
+.annotate "line", 413
+    $P1136 = self."!PREFIX__!subrule"("O", "gt")
+    new $P1137, "ResizablePMCArray"
+    push $P1137, $P1136
+    .return ($P1137)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<=:=>"  :subid("293_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1141_tgt
+    .local int rx1141_pos
+    .local int rx1141_off
+    .local int rx1141_eos
+    .local int rx1141_rep
+    .local pmc rx1141_cur
+    (rx1141_cur, rx1141_pos, rx1141_tgt) = self."!cursor_start"()
+    rx1141_cur."!cursor_debug"("START ", "infix:sym<=:=>")
+    .lex unicode:"$\x{a2}", rx1141_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1141_eos, rx1141_tgt
+    set rx1141_off, 0
+    lt rx1141_pos, 2, rx1141_start
+    sub rx1141_off, rx1141_pos, 1
+    substr rx1141_tgt, rx1141_tgt, rx1141_off
+  rx1141_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1145_done
+    goto rxscan1145_scan
+  rxscan1145_loop:
+    ($P10) = rx1141_cur."from"()
+    inc $P10
+    set rx1141_pos, $P10
+    ge rx1141_pos, rx1141_eos, rxscan1145_done
+  rxscan1145_scan:
+    set_addr $I10, rxscan1145_loop
+    rx1141_cur."!mark_push"(0, rx1141_pos, $I10)
+  rxscan1145_done:
+.annotate "line", 494
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1146_fail
+    rx1141_cur."!mark_push"(0, rx1141_pos, $I10)
+  # rx literal  "=:="
+    add $I11, rx1141_pos, 3
+    gt $I11, rx1141_eos, rx1141_fail
+    sub $I11, rx1141_pos, rx1141_off
+    substr $S10, rx1141_tgt, $I11, 3
+    ne $S10, "=:=", rx1141_fail
+    add rx1141_pos, 3
+    set_addr $I10, rxcap_1146_fail
+    ($I12, $I11) = rx1141_cur."!mark_peek"($I10)
+    rx1141_cur."!cursor_pos"($I11)
+    ($P10) = rx1141_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1141_pos, "")
+    rx1141_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1146_done
+  rxcap_1146_fail:
+    goto rx1141_fail
+  rxcap_1146_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1141_cur."!cursor_pos"(rx1141_pos)
+    $P10 = rx1141_cur."O"("%relational, :pirop<issame>")
+    unless $P10, rx1141_fail
+    rx1141_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1141_pos = $P10."pos"()
+  # rx pass
+    rx1141_cur."!cursor_pass"(rx1141_pos, "infix:sym<=:=>")
+    rx1141_cur."!cursor_debug"("PASS  ", "infix:sym<=:=>", " at pos=", rx1141_pos)
+    .return (rx1141_cur)
+  rx1141_fail:
+.annotate "line", 413
+    (rx1141_rep, rx1141_pos, $I10, $P10) = rx1141_cur."!mark_fail"(0)
+    lt rx1141_pos, -1, rx1141_done
+    eq rx1141_pos, -1, rx1141_fail
+    jump $I10
+  rx1141_done:
+    rx1141_cur."!cursor_fail"()
+    rx1141_cur."!cursor_debug"("FAIL  ", "infix:sym<=:=>")
+    .return (rx1141_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<=:=>"  :subid("294_1261064023.05912") :method
+.annotate "line", 413
+    $P1143 = self."!PREFIX__!subrule"("O", "=:=")
+    new $P1144, "ResizablePMCArray"
+    push $P1144, $P1143
+    .return ($P1144)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<~~>"  :subid("295_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1148_tgt
+    .local int rx1148_pos
+    .local int rx1148_off
+    .local int rx1148_eos
+    .local int rx1148_rep
+    .local pmc rx1148_cur
+    (rx1148_cur, rx1148_pos, rx1148_tgt) = self."!cursor_start"()
+    rx1148_cur."!cursor_debug"("START ", "infix:sym<~~>")
+    .lex unicode:"$\x{a2}", rx1148_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1148_eos, rx1148_tgt
+    set rx1148_off, 0
+    lt rx1148_pos, 2, rx1148_start
+    sub rx1148_off, rx1148_pos, 1
+    substr rx1148_tgt, rx1148_tgt, rx1148_off
+  rx1148_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1152_done
+    goto rxscan1152_scan
+  rxscan1152_loop:
+    ($P10) = rx1148_cur."from"()
+    inc $P10
+    set rx1148_pos, $P10
+    ge rx1148_pos, rx1148_eos, rxscan1152_done
+  rxscan1152_scan:
+    set_addr $I10, rxscan1152_loop
+    rx1148_cur."!mark_push"(0, rx1148_pos, $I10)
+  rxscan1152_done:
+.annotate "line", 495
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1153_fail
+    rx1148_cur."!mark_push"(0, rx1148_pos, $I10)
+  # rx literal  "~~"
+    add $I11, rx1148_pos, 2
+    gt $I11, rx1148_eos, rx1148_fail
+    sub $I11, rx1148_pos, rx1148_off
+    substr $S10, rx1148_tgt, $I11, 2
+    ne $S10, "~~", rx1148_fail
+    add rx1148_pos, 2
+    set_addr $I10, rxcap_1153_fail
+    ($I12, $I11) = rx1148_cur."!mark_peek"($I10)
+    rx1148_cur."!cursor_pos"($I11)
+    ($P10) = rx1148_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1148_pos, "")
+    rx1148_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1153_done
+  rxcap_1153_fail:
+    goto rx1148_fail
+  rxcap_1153_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1148_cur."!cursor_pos"(rx1148_pos)
+    $P10 = rx1148_cur."O"("%relational, :reducecheck<smartmatch>")
+    unless $P10, rx1148_fail
+    rx1148_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1148_pos = $P10."pos"()
+  # rx pass
+    rx1148_cur."!cursor_pass"(rx1148_pos, "infix:sym<~~>")
+    rx1148_cur."!cursor_debug"("PASS  ", "infix:sym<~~>", " at pos=", rx1148_pos)
+    .return (rx1148_cur)
+  rx1148_fail:
+.annotate "line", 413
+    (rx1148_rep, rx1148_pos, $I10, $P10) = rx1148_cur."!mark_fail"(0)
+    lt rx1148_pos, -1, rx1148_done
+    eq rx1148_pos, -1, rx1148_fail
+    jump $I10
+  rx1148_done:
+    rx1148_cur."!cursor_fail"()
+    rx1148_cur."!cursor_debug"("FAIL  ", "infix:sym<~~>")
+    .return (rx1148_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<~~>"  :subid("296_1261064023.05912") :method
+.annotate "line", 413
+    $P1150 = self."!PREFIX__!subrule"("O", "~~")
+    new $P1151, "ResizablePMCArray"
+    push $P1151, $P1150
+    .return ($P1151)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<&&>"  :subid("297_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1155_tgt
+    .local int rx1155_pos
+    .local int rx1155_off
+    .local int rx1155_eos
+    .local int rx1155_rep
+    .local pmc rx1155_cur
+    (rx1155_cur, rx1155_pos, rx1155_tgt) = self."!cursor_start"()
+    rx1155_cur."!cursor_debug"("START ", "infix:sym<&&>")
+    .lex unicode:"$\x{a2}", rx1155_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1155_eos, rx1155_tgt
+    set rx1155_off, 0
+    lt rx1155_pos, 2, rx1155_start
+    sub rx1155_off, rx1155_pos, 1
+    substr rx1155_tgt, rx1155_tgt, rx1155_off
+  rx1155_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1159_done
+    goto rxscan1159_scan
+  rxscan1159_loop:
+    ($P10) = rx1155_cur."from"()
+    inc $P10
+    set rx1155_pos, $P10
+    ge rx1155_pos, rx1155_eos, rxscan1159_done
+  rxscan1159_scan:
+    set_addr $I10, rxscan1159_loop
+    rx1155_cur."!mark_push"(0, rx1155_pos, $I10)
+  rxscan1159_done:
+.annotate "line", 497
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1160_fail
+    rx1155_cur."!mark_push"(0, rx1155_pos, $I10)
+  # rx literal  "&&"
+    add $I11, rx1155_pos, 2
+    gt $I11, rx1155_eos, rx1155_fail
+    sub $I11, rx1155_pos, rx1155_off
+    substr $S10, rx1155_tgt, $I11, 2
+    ne $S10, "&&", rx1155_fail
+    add rx1155_pos, 2
+    set_addr $I10, rxcap_1160_fail
+    ($I12, $I11) = rx1155_cur."!mark_peek"($I10)
+    rx1155_cur."!cursor_pos"($I11)
+    ($P10) = rx1155_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1155_pos, "")
+    rx1155_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1160_done
+  rxcap_1160_fail:
+    goto rx1155_fail
+  rxcap_1160_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1155_cur."!cursor_pos"(rx1155_pos)
+    $P10 = rx1155_cur."O"("%tight_and, :pasttype<if>")
+    unless $P10, rx1155_fail
+    rx1155_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1155_pos = $P10."pos"()
+  # rx pass
+    rx1155_cur."!cursor_pass"(rx1155_pos, "infix:sym<&&>")
+    rx1155_cur."!cursor_debug"("PASS  ", "infix:sym<&&>", " at pos=", rx1155_pos)
+    .return (rx1155_cur)
+  rx1155_fail:
+.annotate "line", 413
+    (rx1155_rep, rx1155_pos, $I10, $P10) = rx1155_cur."!mark_fail"(0)
+    lt rx1155_pos, -1, rx1155_done
+    eq rx1155_pos, -1, rx1155_fail
+    jump $I10
+  rx1155_done:
+    rx1155_cur."!cursor_fail"()
+    rx1155_cur."!cursor_debug"("FAIL  ", "infix:sym<&&>")
+    .return (rx1155_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<&&>"  :subid("298_1261064023.05912") :method
+.annotate "line", 413
+    $P1157 = self."!PREFIX__!subrule"("O", "&&")
+    new $P1158, "ResizablePMCArray"
+    push $P1158, $P1157
+    .return ($P1158)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<||>"  :subid("299_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1162_tgt
+    .local int rx1162_pos
+    .local int rx1162_off
+    .local int rx1162_eos
+    .local int rx1162_rep
+    .local pmc rx1162_cur
+    (rx1162_cur, rx1162_pos, rx1162_tgt) = self."!cursor_start"()
+    rx1162_cur."!cursor_debug"("START ", "infix:sym<||>")
+    .lex unicode:"$\x{a2}", rx1162_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1162_eos, rx1162_tgt
+    set rx1162_off, 0
+    lt rx1162_pos, 2, rx1162_start
+    sub rx1162_off, rx1162_pos, 1
+    substr rx1162_tgt, rx1162_tgt, rx1162_off
+  rx1162_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1166_done
+    goto rxscan1166_scan
+  rxscan1166_loop:
+    ($P10) = rx1162_cur."from"()
+    inc $P10
+    set rx1162_pos, $P10
+    ge rx1162_pos, rx1162_eos, rxscan1166_done
+  rxscan1166_scan:
+    set_addr $I10, rxscan1166_loop
+    rx1162_cur."!mark_push"(0, rx1162_pos, $I10)
+  rxscan1166_done:
+.annotate "line", 499
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1167_fail
+    rx1162_cur."!mark_push"(0, rx1162_pos, $I10)
+  # rx literal  "||"
+    add $I11, rx1162_pos, 2
+    gt $I11, rx1162_eos, rx1162_fail
+    sub $I11, rx1162_pos, rx1162_off
+    substr $S10, rx1162_tgt, $I11, 2
+    ne $S10, "||", rx1162_fail
+    add rx1162_pos, 2
+    set_addr $I10, rxcap_1167_fail
+    ($I12, $I11) = rx1162_cur."!mark_peek"($I10)
+    rx1162_cur."!cursor_pos"($I11)
+    ($P10) = rx1162_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1162_pos, "")
+    rx1162_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1167_done
+  rxcap_1167_fail:
+    goto rx1162_fail
+  rxcap_1167_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1162_cur."!cursor_pos"(rx1162_pos)
+    $P10 = rx1162_cur."O"("%tight_or, :pasttype<unless>")
+    unless $P10, rx1162_fail
+    rx1162_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1162_pos = $P10."pos"()
+  # rx pass
+    rx1162_cur."!cursor_pass"(rx1162_pos, "infix:sym<||>")
+    rx1162_cur."!cursor_debug"("PASS  ", "infix:sym<||>", " at pos=", rx1162_pos)
+    .return (rx1162_cur)
+  rx1162_fail:
+.annotate "line", 413
+    (rx1162_rep, rx1162_pos, $I10, $P10) = rx1162_cur."!mark_fail"(0)
+    lt rx1162_pos, -1, rx1162_done
+    eq rx1162_pos, -1, rx1162_fail
+    jump $I10
+  rx1162_done:
+    rx1162_cur."!cursor_fail"()
+    rx1162_cur."!cursor_debug"("FAIL  ", "infix:sym<||>")
+    .return (rx1162_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<||>"  :subid("300_1261064023.05912") :method
+.annotate "line", 413
+    $P1164 = self."!PREFIX__!subrule"("O", "||")
+    new $P1165, "ResizablePMCArray"
+    push $P1165, $P1164
+    .return ($P1165)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<//>"  :subid("301_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1169_tgt
+    .local int rx1169_pos
+    .local int rx1169_off
+    .local int rx1169_eos
+    .local int rx1169_rep
+    .local pmc rx1169_cur
+    (rx1169_cur, rx1169_pos, rx1169_tgt) = self."!cursor_start"()
+    rx1169_cur."!cursor_debug"("START ", "infix:sym<//>")
+    .lex unicode:"$\x{a2}", rx1169_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1169_eos, rx1169_tgt
+    set rx1169_off, 0
+    lt rx1169_pos, 2, rx1169_start
+    sub rx1169_off, rx1169_pos, 1
+    substr rx1169_tgt, rx1169_tgt, rx1169_off
+  rx1169_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1173_done
+    goto rxscan1173_scan
+  rxscan1173_loop:
+    ($P10) = rx1169_cur."from"()
+    inc $P10
+    set rx1169_pos, $P10
+    ge rx1169_pos, rx1169_eos, rxscan1173_done
+  rxscan1173_scan:
+    set_addr $I10, rxscan1173_loop
+    rx1169_cur."!mark_push"(0, rx1169_pos, $I10)
+  rxscan1173_done:
+.annotate "line", 500
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1174_fail
+    rx1169_cur."!mark_push"(0, rx1169_pos, $I10)
+  # rx literal  "//"
+    add $I11, rx1169_pos, 2
+    gt $I11, rx1169_eos, rx1169_fail
+    sub $I11, rx1169_pos, rx1169_off
+    substr $S10, rx1169_tgt, $I11, 2
+    ne $S10, "//", rx1169_fail
+    add rx1169_pos, 2
+    set_addr $I10, rxcap_1174_fail
+    ($I12, $I11) = rx1169_cur."!mark_peek"($I10)
+    rx1169_cur."!cursor_pos"($I11)
+    ($P10) = rx1169_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1169_pos, "")
+    rx1169_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1174_done
+  rxcap_1174_fail:
+    goto rx1169_fail
+  rxcap_1174_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1169_cur."!cursor_pos"(rx1169_pos)
+    $P10 = rx1169_cur."O"("%tight_or, :pasttype<def_or>")
+    unless $P10, rx1169_fail
+    rx1169_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1169_pos = $P10."pos"()
+  # rx pass
+    rx1169_cur."!cursor_pass"(rx1169_pos, "infix:sym<//>")
+    rx1169_cur."!cursor_debug"("PASS  ", "infix:sym<//>", " at pos=", rx1169_pos)
+    .return (rx1169_cur)
+  rx1169_fail:
+.annotate "line", 413
+    (rx1169_rep, rx1169_pos, $I10, $P10) = rx1169_cur."!mark_fail"(0)
+    lt rx1169_pos, -1, rx1169_done
+    eq rx1169_pos, -1, rx1169_fail
+    jump $I10
+  rx1169_done:
+    rx1169_cur."!cursor_fail"()
+    rx1169_cur."!cursor_debug"("FAIL  ", "infix:sym<//>")
+    .return (rx1169_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<//>"  :subid("302_1261064023.05912") :method
+.annotate "line", 413
+    $P1171 = self."!PREFIX__!subrule"("O", "//")
+    new $P1172, "ResizablePMCArray"
+    push $P1172, $P1171
+    .return ($P1172)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<?? !!>"  :subid("303_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1176_tgt
+    .local int rx1176_pos
+    .local int rx1176_off
+    .local int rx1176_eos
+    .local int rx1176_rep
+    .local pmc rx1176_cur
+    (rx1176_cur, rx1176_pos, rx1176_tgt) = self."!cursor_start"()
+    rx1176_cur."!cursor_debug"("START ", "infix:sym<?? !!>")
+    .lex unicode:"$\x{a2}", rx1176_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1176_eos, rx1176_tgt
+    set rx1176_off, 0
+    lt rx1176_pos, 2, rx1176_start
+    sub rx1176_off, rx1176_pos, 1
+    substr rx1176_tgt, rx1176_tgt, rx1176_off
+  rx1176_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1180_done
+    goto rxscan1180_scan
+  rxscan1180_loop:
+    ($P10) = rx1176_cur."from"()
+    inc $P10
+    set rx1176_pos, $P10
+    ge rx1176_pos, rx1176_eos, rxscan1180_done
+  rxscan1180_scan:
+    set_addr $I10, rxscan1180_loop
+    rx1176_cur."!mark_push"(0, rx1176_pos, $I10)
+  rxscan1180_done:
+.annotate "line", 503
+  # rx literal  "??"
+    add $I11, rx1176_pos, 2
+    gt $I11, rx1176_eos, rx1176_fail
+    sub $I11, rx1176_pos, rx1176_off
+    substr $S10, rx1176_tgt, $I11, 2
+    ne $S10, "??", rx1176_fail
+    add rx1176_pos, 2
+.annotate "line", 504
+  # rx subrule "ws" subtype=method negate=
+    rx1176_cur."!cursor_pos"(rx1176_pos)
+    $P10 = rx1176_cur."ws"()
+    unless $P10, rx1176_fail
+    rx1176_pos = $P10."pos"()
+.annotate "line", 505
+  # rx subrule "EXPR" subtype=capture negate=
+    rx1176_cur."!cursor_pos"(rx1176_pos)
+    $P10 = rx1176_cur."EXPR"("i=")
+    unless $P10, rx1176_fail
+    rx1176_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("EXPR")
+    rx1176_pos = $P10."pos"()
+.annotate "line", 506
+  # rx literal  "!!"
+    add $I11, rx1176_pos, 2
+    gt $I11, rx1176_eos, rx1176_fail
+    sub $I11, rx1176_pos, rx1176_off
+    substr $S10, rx1176_tgt, $I11, 2
+    ne $S10, "!!", rx1176_fail
+    add rx1176_pos, 2
+.annotate "line", 507
+  # rx subrule "O" subtype=capture negate=
+    rx1176_cur."!cursor_pos"(rx1176_pos)
+    $P10 = rx1176_cur."O"("%conditional, :reducecheck<ternary>, :pasttype<if>")
+    unless $P10, rx1176_fail
+    rx1176_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1176_pos = $P10."pos"()
+.annotate "line", 502
+  # rx pass
+    rx1176_cur."!cursor_pass"(rx1176_pos, "infix:sym<?? !!>")
+    rx1176_cur."!cursor_debug"("PASS  ", "infix:sym<?? !!>", " at pos=", rx1176_pos)
+    .return (rx1176_cur)
+  rx1176_fail:
+.annotate "line", 413
+    (rx1176_rep, rx1176_pos, $I10, $P10) = rx1176_cur."!mark_fail"(0)
+    lt rx1176_pos, -1, rx1176_done
+    eq rx1176_pos, -1, rx1176_fail
+    jump $I10
+  rx1176_done:
+    rx1176_cur."!cursor_fail"()
+    rx1176_cur."!cursor_debug"("FAIL  ", "infix:sym<?? !!>")
+    .return (rx1176_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<?? !!>"  :subid("304_1261064023.05912") :method
+.annotate "line", 413
+    $P1178 = self."!PREFIX__!subrule"("", "??")
+    new $P1179, "ResizablePMCArray"
+    push $P1179, $P1178
+    .return ($P1179)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<=>"  :subid("305_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1182_tgt
+    .local int rx1182_pos
+    .local int rx1182_off
+    .local int rx1182_eos
+    .local int rx1182_rep
+    .local pmc rx1182_cur
+    (rx1182_cur, rx1182_pos, rx1182_tgt) = self."!cursor_start"()
+    rx1182_cur."!cursor_debug"("START ", "infix:sym<=>")
+    .lex unicode:"$\x{a2}", rx1182_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1182_eos, rx1182_tgt
+    set rx1182_off, 0
+    lt rx1182_pos, 2, rx1182_start
+    sub rx1182_off, rx1182_pos, 1
+    substr rx1182_tgt, rx1182_tgt, rx1182_off
+  rx1182_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1186_done
+    goto rxscan1186_scan
+  rxscan1186_loop:
+    ($P10) = rx1182_cur."from"()
+    inc $P10
+    set rx1182_pos, $P10
+    ge rx1182_pos, rx1182_eos, rxscan1186_done
+  rxscan1186_scan:
+    set_addr $I10, rxscan1186_loop
+    rx1182_cur."!mark_push"(0, rx1182_pos, $I10)
+  rxscan1186_done:
+.annotate "line", 511
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1187_fail
+    rx1182_cur."!mark_push"(0, rx1182_pos, $I10)
+  # rx literal  "="
+    add $I11, rx1182_pos, 1
+    gt $I11, rx1182_eos, rx1182_fail
+    sub $I11, rx1182_pos, rx1182_off
+    substr $S10, rx1182_tgt, $I11, 1
+    ne $S10, "=", rx1182_fail
+    add rx1182_pos, 1
+    set_addr $I10, rxcap_1187_fail
+    ($I12, $I11) = rx1182_cur."!mark_peek"($I10)
+    rx1182_cur."!cursor_pos"($I11)
+    ($P10) = rx1182_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1182_pos, "")
+    rx1182_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1187_done
+  rxcap_1187_fail:
+    goto rx1182_fail
+  rxcap_1187_done:
+  # rx subrule "panic" subtype=method negate=
+    rx1182_cur."!cursor_pos"(rx1182_pos)
+    $P10 = rx1182_cur."panic"("Assignment (\"=\") not supported in NQP, use \":=\" instead")
+    unless $P10, rx1182_fail
+    rx1182_pos = $P10."pos"()
+.annotate "line", 510
+  # rx pass
+    rx1182_cur."!cursor_pass"(rx1182_pos, "infix:sym<=>")
+    rx1182_cur."!cursor_debug"("PASS  ", "infix:sym<=>", " at pos=", rx1182_pos)
+    .return (rx1182_cur)
+  rx1182_fail:
+.annotate "line", 413
+    (rx1182_rep, rx1182_pos, $I10, $P10) = rx1182_cur."!mark_fail"(0)
+    lt rx1182_pos, -1, rx1182_done
+    eq rx1182_pos, -1, rx1182_fail
+    jump $I10
+  rx1182_done:
+    rx1182_cur."!cursor_fail"()
+    rx1182_cur."!cursor_debug"("FAIL  ", "infix:sym<=>")
+    .return (rx1182_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<=>"  :subid("306_1261064023.05912") :method
+.annotate "line", 413
+    $P1184 = self."!PREFIX__!subrule"("", "=")
+    new $P1185, "ResizablePMCArray"
+    push $P1185, $P1184
+    .return ($P1185)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<:=>"  :subid("307_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1189_tgt
+    .local int rx1189_pos
+    .local int rx1189_off
+    .local int rx1189_eos
+    .local int rx1189_rep
+    .local pmc rx1189_cur
+    (rx1189_cur, rx1189_pos, rx1189_tgt) = self."!cursor_start"()
+    rx1189_cur."!cursor_debug"("START ", "infix:sym<:=>")
+    .lex unicode:"$\x{a2}", rx1189_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1189_eos, rx1189_tgt
+    set rx1189_off, 0
+    lt rx1189_pos, 2, rx1189_start
+    sub rx1189_off, rx1189_pos, 1
+    substr rx1189_tgt, rx1189_tgt, rx1189_off
+  rx1189_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1193_done
+    goto rxscan1193_scan
+  rxscan1193_loop:
+    ($P10) = rx1189_cur."from"()
+    inc $P10
+    set rx1189_pos, $P10
+    ge rx1189_pos, rx1189_eos, rxscan1193_done
+  rxscan1193_scan:
+    set_addr $I10, rxscan1193_loop
+    rx1189_cur."!mark_push"(0, rx1189_pos, $I10)
+  rxscan1193_done:
+.annotate "line", 513
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1194_fail
+    rx1189_cur."!mark_push"(0, rx1189_pos, $I10)
+  # rx literal  ":="
+    add $I11, rx1189_pos, 2
+    gt $I11, rx1189_eos, rx1189_fail
+    sub $I11, rx1189_pos, rx1189_off
+    substr $S10, rx1189_tgt, $I11, 2
+    ne $S10, ":=", rx1189_fail
+    add rx1189_pos, 2
+    set_addr $I10, rxcap_1194_fail
+    ($I12, $I11) = rx1189_cur."!mark_peek"($I10)
+    rx1189_cur."!cursor_pos"($I11)
+    ($P10) = rx1189_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1189_pos, "")
+    rx1189_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1194_done
+  rxcap_1194_fail:
+    goto rx1189_fail
+  rxcap_1194_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1189_cur."!cursor_pos"(rx1189_pos)
+    $P10 = rx1189_cur."O"("%assignment, :pasttype<bind>")
+    unless $P10, rx1189_fail
+    rx1189_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1189_pos = $P10."pos"()
+  # rx pass
+    rx1189_cur."!cursor_pass"(rx1189_pos, "infix:sym<:=>")
+    rx1189_cur."!cursor_debug"("PASS  ", "infix:sym<:=>", " at pos=", rx1189_pos)
+    .return (rx1189_cur)
+  rx1189_fail:
+.annotate "line", 413
+    (rx1189_rep, rx1189_pos, $I10, $P10) = rx1189_cur."!mark_fail"(0)
+    lt rx1189_pos, -1, rx1189_done
+    eq rx1189_pos, -1, rx1189_fail
+    jump $I10
+  rx1189_done:
+    rx1189_cur."!cursor_fail"()
+    rx1189_cur."!cursor_debug"("FAIL  ", "infix:sym<:=>")
+    .return (rx1189_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<:=>"  :subid("308_1261064023.05912") :method
+.annotate "line", 413
+    $P1191 = self."!PREFIX__!subrule"("O", ":=")
+    new $P1192, "ResizablePMCArray"
+    push $P1192, $P1191
+    .return ($P1192)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<::=>"  :subid("309_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1196_tgt
+    .local int rx1196_pos
+    .local int rx1196_off
+    .local int rx1196_eos
+    .local int rx1196_rep
+    .local pmc rx1196_cur
+    (rx1196_cur, rx1196_pos, rx1196_tgt) = self."!cursor_start"()
+    rx1196_cur."!cursor_debug"("START ", "infix:sym<::=>")
+    .lex unicode:"$\x{a2}", rx1196_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1196_eos, rx1196_tgt
+    set rx1196_off, 0
+    lt rx1196_pos, 2, rx1196_start
+    sub rx1196_off, rx1196_pos, 1
+    substr rx1196_tgt, rx1196_tgt, rx1196_off
+  rx1196_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1200_done
+    goto rxscan1200_scan
+  rxscan1200_loop:
+    ($P10) = rx1196_cur."from"()
+    inc $P10
+    set rx1196_pos, $P10
+    ge rx1196_pos, rx1196_eos, rxscan1200_done
+  rxscan1200_scan:
+    set_addr $I10, rxscan1200_loop
+    rx1196_cur."!mark_push"(0, rx1196_pos, $I10)
+  rxscan1200_done:
+.annotate "line", 514
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1201_fail
+    rx1196_cur."!mark_push"(0, rx1196_pos, $I10)
+  # rx literal  "::="
+    add $I11, rx1196_pos, 3
+    gt $I11, rx1196_eos, rx1196_fail
+    sub $I11, rx1196_pos, rx1196_off
+    substr $S10, rx1196_tgt, $I11, 3
+    ne $S10, "::=", rx1196_fail
+    add rx1196_pos, 3
+    set_addr $I10, rxcap_1201_fail
+    ($I12, $I11) = rx1196_cur."!mark_peek"($I10)
+    rx1196_cur."!cursor_pos"($I11)
+    ($P10) = rx1196_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1196_pos, "")
+    rx1196_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1201_done
+  rxcap_1201_fail:
+    goto rx1196_fail
+  rxcap_1201_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1196_cur."!cursor_pos"(rx1196_pos)
+    $P10 = rx1196_cur."O"("%assignment, :pasttype<bind>")
+    unless $P10, rx1196_fail
+    rx1196_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1196_pos = $P10."pos"()
+  # rx pass
+    rx1196_cur."!cursor_pass"(rx1196_pos, "infix:sym<::=>")
+    rx1196_cur."!cursor_debug"("PASS  ", "infix:sym<::=>", " at pos=", rx1196_pos)
+    .return (rx1196_cur)
+  rx1196_fail:
+.annotate "line", 413
+    (rx1196_rep, rx1196_pos, $I10, $P10) = rx1196_cur."!mark_fail"(0)
+    lt rx1196_pos, -1, rx1196_done
+    eq rx1196_pos, -1, rx1196_fail
+    jump $I10
+  rx1196_done:
+    rx1196_cur."!cursor_fail"()
+    rx1196_cur."!cursor_debug"("FAIL  ", "infix:sym<::=>")
+    .return (rx1196_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<::=>"  :subid("310_1261064023.05912") :method
+.annotate "line", 413
+    $P1198 = self."!PREFIX__!subrule"("O", "::=")
+    new $P1199, "ResizablePMCArray"
+    push $P1199, $P1198
+    .return ($P1199)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "infix:sym<,>"  :subid("311_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1203_tgt
+    .local int rx1203_pos
+    .local int rx1203_off
+    .local int rx1203_eos
+    .local int rx1203_rep
+    .local pmc rx1203_cur
+    (rx1203_cur, rx1203_pos, rx1203_tgt) = self."!cursor_start"()
+    rx1203_cur."!cursor_debug"("START ", "infix:sym<,>")
+    .lex unicode:"$\x{a2}", rx1203_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1203_eos, rx1203_tgt
+    set rx1203_off, 0
+    lt rx1203_pos, 2, rx1203_start
+    sub rx1203_off, rx1203_pos, 1
+    substr rx1203_tgt, rx1203_tgt, rx1203_off
+  rx1203_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1207_done
+    goto rxscan1207_scan
+  rxscan1207_loop:
+    ($P10) = rx1203_cur."from"()
+    inc $P10
+    set rx1203_pos, $P10
+    ge rx1203_pos, rx1203_eos, rxscan1207_done
+  rxscan1207_scan:
+    set_addr $I10, rxscan1207_loop
+    rx1203_cur."!mark_push"(0, rx1203_pos, $I10)
+  rxscan1207_done:
+.annotate "line", 516
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1208_fail
+    rx1203_cur."!mark_push"(0, rx1203_pos, $I10)
+  # rx literal  ","
+    add $I11, rx1203_pos, 1
+    gt $I11, rx1203_eos, rx1203_fail
+    sub $I11, rx1203_pos, rx1203_off
+    substr $S10, rx1203_tgt, $I11, 1
+    ne $S10, ",", rx1203_fail
+    add rx1203_pos, 1
+    set_addr $I10, rxcap_1208_fail
+    ($I12, $I11) = rx1203_cur."!mark_peek"($I10)
+    rx1203_cur."!cursor_pos"($I11)
+    ($P10) = rx1203_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1203_pos, "")
+    rx1203_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1208_done
+  rxcap_1208_fail:
+    goto rx1203_fail
+  rxcap_1208_done:
+  # rx subrule "O" subtype=capture negate=
+    rx1203_cur."!cursor_pos"(rx1203_pos)
+    $P10 = rx1203_cur."O"("%comma, :pasttype<list>")
+    unless $P10, rx1203_fail
+    rx1203_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1203_pos = $P10."pos"()
+  # rx pass
+    rx1203_cur."!cursor_pass"(rx1203_pos, "infix:sym<,>")
+    rx1203_cur."!cursor_debug"("PASS  ", "infix:sym<,>", " at pos=", rx1203_pos)
+    .return (rx1203_cur)
+  rx1203_fail:
+.annotate "line", 413
+    (rx1203_rep, rx1203_pos, $I10, $P10) = rx1203_cur."!mark_fail"(0)
+    lt rx1203_pos, -1, rx1203_done
+    eq rx1203_pos, -1, rx1203_fail
+    jump $I10
+  rx1203_done:
+    rx1203_cur."!cursor_fail"()
+    rx1203_cur."!cursor_debug"("FAIL  ", "infix:sym<,>")
+    .return (rx1203_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__infix:sym<,>"  :subid("312_1261064023.05912") :method
+.annotate "line", 413
+    $P1205 = self."!PREFIX__!subrule"("O", ",")
+    new $P1206, "ResizablePMCArray"
+    push $P1206, $P1205
+    .return ($P1206)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "prefix:sym<return>"  :subid("313_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1210_tgt
+    .local int rx1210_pos
+    .local int rx1210_off
+    .local int rx1210_eos
+    .local int rx1210_rep
+    .local pmc rx1210_cur
+    (rx1210_cur, rx1210_pos, rx1210_tgt) = self."!cursor_start"()
+    rx1210_cur."!cursor_debug"("START ", "prefix:sym<return>")
+    .lex unicode:"$\x{a2}", rx1210_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1210_eos, rx1210_tgt
+    set rx1210_off, 0
+    lt rx1210_pos, 2, rx1210_start
+    sub rx1210_off, rx1210_pos, 1
+    substr rx1210_tgt, rx1210_tgt, rx1210_off
+  rx1210_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1213_done
+    goto rxscan1213_scan
+  rxscan1213_loop:
+    ($P10) = rx1210_cur."from"()
+    inc $P10
+    set rx1210_pos, $P10
+    ge rx1210_pos, rx1210_eos, rxscan1213_done
+  rxscan1213_scan:
+    set_addr $I10, rxscan1213_loop
+    rx1210_cur."!mark_push"(0, rx1210_pos, $I10)
+  rxscan1213_done:
+.annotate "line", 518
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1214_fail
+    rx1210_cur."!mark_push"(0, rx1210_pos, $I10)
+  # rx literal  "return"
+    add $I11, rx1210_pos, 6
+    gt $I11, rx1210_eos, rx1210_fail
+    sub $I11, rx1210_pos, rx1210_off
+    substr $S10, rx1210_tgt, $I11, 6
+    ne $S10, "return", rx1210_fail
+    add rx1210_pos, 6
+    set_addr $I10, rxcap_1214_fail
+    ($I12, $I11) = rx1210_cur."!mark_peek"($I10)
+    rx1210_cur."!cursor_pos"($I11)
+    ($P10) = rx1210_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1210_pos, "")
+    rx1210_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1214_done
+  rxcap_1214_fail:
+    goto rx1210_fail
+  rxcap_1214_done:
+  # rx charclass s
+    ge rx1210_pos, rx1210_eos, rx1210_fail
+    sub $I10, rx1210_pos, rx1210_off
+    is_cclass $I11, 32, rx1210_tgt, $I10
+    unless $I11, rx1210_fail
+    inc rx1210_pos
+  # rx subrule "O" subtype=capture negate=
+    rx1210_cur."!cursor_pos"(rx1210_pos)
+    $P10 = rx1210_cur."O"("%list_prefix, :pasttype<return>")
+    unless $P10, rx1210_fail
+    rx1210_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1210_pos = $P10."pos"()
+  # rx pass
+    rx1210_cur."!cursor_pass"(rx1210_pos, "prefix:sym<return>")
+    rx1210_cur."!cursor_debug"("PASS  ", "prefix:sym<return>", " at pos=", rx1210_pos)
+    .return (rx1210_cur)
+  rx1210_fail:
+.annotate "line", 413
+    (rx1210_rep, rx1210_pos, $I10, $P10) = rx1210_cur."!mark_fail"(0)
+    lt rx1210_pos, -1, rx1210_done
+    eq rx1210_pos, -1, rx1210_fail
+    jump $I10
+  rx1210_done:
+    rx1210_cur."!cursor_fail"()
+    rx1210_cur."!cursor_debug"("FAIL  ", "prefix:sym<return>")
+    .return (rx1210_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__prefix:sym<return>"  :subid("314_1261064023.05912") :method
+.annotate "line", 413
+    new $P1212, "ResizablePMCArray"
+    push $P1212, "return"
+    .return ($P1212)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "prefix:sym<make>"  :subid("315_1261064023.05912") :method :outer("11_1261064023.05912")
+.annotate "line", 413
+    .local string rx1216_tgt
+    .local int rx1216_pos
+    .local int rx1216_off
+    .local int rx1216_eos
+    .local int rx1216_rep
+    .local pmc rx1216_cur
+    (rx1216_cur, rx1216_pos, rx1216_tgt) = self."!cursor_start"()
+    rx1216_cur."!cursor_debug"("START ", "prefix:sym<make>")
+    .lex unicode:"$\x{a2}", rx1216_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1216_eos, rx1216_tgt
+    set rx1216_off, 0
+    lt rx1216_pos, 2, rx1216_start
+    sub rx1216_off, rx1216_pos, 1
+    substr rx1216_tgt, rx1216_tgt, rx1216_off
+  rx1216_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1219_done
+    goto rxscan1219_scan
+  rxscan1219_loop:
+    ($P10) = rx1216_cur."from"()
+    inc $P10
+    set rx1216_pos, $P10
+    ge rx1216_pos, rx1216_eos, rxscan1219_done
+  rxscan1219_scan:
+    set_addr $I10, rxscan1219_loop
+    rx1216_cur."!mark_push"(0, rx1216_pos, $I10)
+  rxscan1219_done:
+.annotate "line", 519
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_1220_fail
+    rx1216_cur."!mark_push"(0, rx1216_pos, $I10)
+  # rx literal  "make"
+    add $I11, rx1216_pos, 4
+    gt $I11, rx1216_eos, rx1216_fail
+    sub $I11, rx1216_pos, rx1216_off
+    substr $S10, rx1216_tgt, $I11, 4
+    ne $S10, "make", rx1216_fail
+    add rx1216_pos, 4
+    set_addr $I10, rxcap_1220_fail
+    ($I12, $I11) = rx1216_cur."!mark_peek"($I10)
+    rx1216_cur."!cursor_pos"($I11)
+    ($P10) = rx1216_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1216_pos, "")
+    rx1216_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_1220_done
+  rxcap_1220_fail:
+    goto rx1216_fail
+  rxcap_1220_done:
+  # rx charclass s
+    ge rx1216_pos, rx1216_eos, rx1216_fail
+    sub $I10, rx1216_pos, rx1216_off
+    is_cclass $I11, 32, rx1216_tgt, $I10
+    unless $I11, rx1216_fail
+    inc rx1216_pos
+  # rx subrule "O" subtype=capture negate=
+    rx1216_cur."!cursor_pos"(rx1216_pos)
+    $P10 = rx1216_cur."O"("%list_prefix")
+    unless $P10, rx1216_fail
+    rx1216_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("O")
+    rx1216_pos = $P10."pos"()
+  # rx pass
+    rx1216_cur."!cursor_pass"(rx1216_pos, "prefix:sym<make>")
+    rx1216_cur."!cursor_debug"("PASS  ", "prefix:sym<make>", " at pos=", rx1216_pos)
+    .return (rx1216_cur)
+  rx1216_fail:
+.annotate "line", 413
+    (rx1216_rep, rx1216_pos, $I10, $P10) = rx1216_cur."!mark_fail"(0)
+    lt rx1216_pos, -1, rx1216_done
+    eq rx1216_pos, -1, rx1216_fail
+    jump $I10
+  rx1216_done:
+    rx1216_cur."!cursor_fail"()
+    rx1216_cur."!cursor_debug"("FAIL  ", "prefix:sym<make>")
+    .return (rx1216_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "!PREFIX__prefix:sym<make>"  :subid("316_1261064023.05912") :method
+.annotate "line", 413
+    new $P1218, "ResizablePMCArray"
+    push $P1218, "make"
+    .return ($P1218)
+.end
+
+
+.namespace ["NQP";"Grammar"]
+.sub "smartmatch"  :subid("317_1261064023.05912") :method :outer("11_1261064023.05912")
+    .param pmc param_1224
+.annotate "line", 521
+    new $P1223, 'ExceptionHandler'
+    set_addr $P1223, control_1222
+    $P1223."handle_types"(58)
+    push_eh $P1223
+    .lex "self", self
+    .lex "$/", param_1224
+.annotate "line", 523
+    new $P1225, "Undef"
+    .lex "$t", $P1225
+    find_lex $P1226, "$/"
+    unless_null $P1226, vivify_343
+    new $P1226, "ResizablePMCArray"
+  vivify_343:
+    set $P1227, $P1226[0]
+    unless_null $P1227, vivify_344
+    new $P1227, "Undef"
+  vivify_344:
+    store_lex "$t", $P1227
+    find_lex $P1228, "$/"
+    unless_null $P1228, vivify_345
+    new $P1228, "ResizablePMCArray"
+  vivify_345:
+    set $P1229, $P1228[1]
+    unless_null $P1229, vivify_346
+    new $P1229, "Undef"
+  vivify_346:
+    find_lex $P1230, "$/"
+    unless_null $P1230, vivify_347
+    new $P1230, "ResizablePMCArray"
+    store_lex "$/", $P1230
+  vivify_347:
+    set $P1230[0], $P1229
+    find_lex $P1231, "$t"
+    find_lex $P1232, "$/"
+    unless_null $P1232, vivify_348
+    new $P1232, "ResizablePMCArray"
+    store_lex "$/", $P1232
+  vivify_348:
+    set $P1232[1], $P1231
+.annotate "line", 521
+    .return ($P1231)
+  control_1222:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1233, exception, "payload"
+    .return ($P1233)
+.end
+
+
+.namespace ["NQP";"Regex"]
+.sub "_block1234"  :subid("318_1261064023.05912") :outer("11_1261064023.05912")
+.annotate "line", 527
+    .const 'Sub' $P1268 = "329_1261064023.05912" 
+    capture_lex $P1268
+    .const 'Sub' $P1255 = "326_1261064023.05912" 
+    capture_lex $P1255
+    .const 'Sub' $P1250 = "324_1261064023.05912" 
+    capture_lex $P1250
+    .const 'Sub' $P1245 = "322_1261064023.05912" 
+    capture_lex $P1245
+    .const 'Sub' $P1236 = "319_1261064023.05912" 
+    capture_lex $P1236
+    .const 'Sub' $P1268 = "329_1261064023.05912" 
+    capture_lex $P1268
+    .return ($P1268)
+.end
+
+
+.namespace ["NQP";"Regex"]
+.sub "metachar:sym<:my>"  :subid("319_1261064023.05912") :method :outer("318_1261064023.05912")
+.annotate "line", 527
+    .const 'Sub' $P1242 = "321_1261064023.05912" 
+    capture_lex $P1242
+    .local string rx1237_tgt
+    .local int rx1237_pos
+    .local int rx1237_off
+    .local int rx1237_eos
+    .local int rx1237_rep
+    .local pmc rx1237_cur
+    (rx1237_cur, rx1237_pos, rx1237_tgt) = self."!cursor_start"()
+    rx1237_cur."!cursor_debug"("START ", "metachar:sym<:my>")
+    .lex unicode:"$\x{a2}", rx1237_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1237_eos, rx1237_tgt
+    set rx1237_off, 0
+    lt rx1237_pos, 2, rx1237_start
+    sub rx1237_off, rx1237_pos, 1
+    substr rx1237_tgt, rx1237_tgt, rx1237_off
+  rx1237_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1240_done
+    goto rxscan1240_scan
+  rxscan1240_loop:
+    ($P10) = rx1237_cur."from"()
+    inc $P10
+    set rx1237_pos, $P10
+    ge rx1237_pos, rx1237_eos, rxscan1240_done
+  rxscan1240_scan:
+    set_addr $I10, rxscan1240_loop
+    rx1237_cur."!mark_push"(0, rx1237_pos, $I10)
+  rxscan1240_done:
+.annotate "line", 529
+  # rx literal  ":"
+    add $I11, rx1237_pos, 1
+    gt $I11, rx1237_eos, rx1237_fail
+    sub $I11, rx1237_pos, rx1237_off
+    substr $S10, rx1237_tgt, $I11, 1
+    ne $S10, ":", rx1237_fail
+    add rx1237_pos, 1
+  # rx subrule "before" subtype=zerowidth negate=
+    rx1237_cur."!cursor_pos"(rx1237_pos)
+    .const 'Sub' $P1242 = "321_1261064023.05912" 
+    capture_lex $P1242
+    $P10 = rx1237_cur."before"($P1242)
+    unless $P10, rx1237_fail
+  # rx subrule "LANG" subtype=capture negate=
+    rx1237_cur."!cursor_pos"(rx1237_pos)
+    $P10 = rx1237_cur."LANG"("MAIN", "statement")
+    unless $P10, rx1237_fail
+    rx1237_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("statement")
+    rx1237_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx1237_cur."!cursor_pos"(rx1237_pos)
+    $P10 = rx1237_cur."ws"()
+    unless $P10, rx1237_fail
+    rx1237_pos = $P10."pos"()
+  # rx literal  ";"
+    add $I11, rx1237_pos, 1
+    gt $I11, rx1237_eos, rx1237_fail
+    sub $I11, rx1237_pos, rx1237_off
+    substr $S10, rx1237_tgt, $I11, 1
+    ne $S10, ";", rx1237_fail
+    add rx1237_pos, 1
+.annotate "line", 528
+  # rx pass
+    rx1237_cur."!cursor_pass"(rx1237_pos, "metachar:sym<:my>")
+    rx1237_cur."!cursor_debug"("PASS  ", "metachar:sym<:my>", " at pos=", rx1237_pos)
+    .return (rx1237_cur)
+  rx1237_fail:
+.annotate "line", 527
+    (rx1237_rep, rx1237_pos, $I10, $P10) = rx1237_cur."!mark_fail"(0)
+    lt rx1237_pos, -1, rx1237_done
+    eq rx1237_pos, -1, rx1237_fail
+    jump $I10
+  rx1237_done:
+    rx1237_cur."!cursor_fail"()
+    rx1237_cur."!cursor_debug"("FAIL  ", "metachar:sym<:my>")
+    .return (rx1237_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Regex"]
+.sub "!PREFIX__metachar:sym<:my>"  :subid("320_1261064023.05912") :method
+.annotate "line", 527
+    new $P1239, "ResizablePMCArray"
+    push $P1239, ":"
+    .return ($P1239)
+.end
+
+
+.namespace ["NQP";"Regex"]
+.sub "_block1241"  :anon :subid("321_1261064023.05912") :method :outer("319_1261064023.05912")
+.annotate "line", 529
+    .local string rx1243_tgt
+    .local int rx1243_pos
+    .local int rx1243_off
+    .local int rx1243_eos
+    .local int rx1243_rep
+    .local pmc rx1243_cur
+    (rx1243_cur, rx1243_pos, rx1243_tgt) = self."!cursor_start"()
+    rx1243_cur."!cursor_debug"("START ", "")
+    .lex unicode:"$\x{a2}", rx1243_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1243_eos, rx1243_tgt
+    set rx1243_off, 0
+    lt rx1243_pos, 2, rx1243_start
+    sub rx1243_off, rx1243_pos, 1
+    substr rx1243_tgt, rx1243_tgt, rx1243_off
+  rx1243_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1244_done
+    goto rxscan1244_scan
+  rxscan1244_loop:
+    ($P10) = rx1243_cur."from"()
+    inc $P10
+    set rx1243_pos, $P10
+    ge rx1243_pos, rx1243_eos, rxscan1244_done
+  rxscan1244_scan:
+    set_addr $I10, rxscan1244_loop
+    rx1243_cur."!mark_push"(0, rx1243_pos, $I10)
+  rxscan1244_done:
+  # rx literal  "my"
+    add $I11, rx1243_pos, 2
+    gt $I11, rx1243_eos, rx1243_fail
+    sub $I11, rx1243_pos, rx1243_off
+    substr $S10, rx1243_tgt, $I11, 2
+    ne $S10, "my", rx1243_fail
+    add rx1243_pos, 2
+  # rx pass
+    rx1243_cur."!cursor_pass"(rx1243_pos, "")
+    rx1243_cur."!cursor_debug"("PASS  ", "", " at pos=", rx1243_pos)
+    .return (rx1243_cur)
+  rx1243_fail:
+    (rx1243_rep, rx1243_pos, $I10, $P10) = rx1243_cur."!mark_fail"(0)
+    lt rx1243_pos, -1, rx1243_done
+    eq rx1243_pos, -1, rx1243_fail
+    jump $I10
+  rx1243_done:
+    rx1243_cur."!cursor_fail"()
+    rx1243_cur."!cursor_debug"("FAIL  ", "")
+    .return (rx1243_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Regex"]
+.sub "metachar:sym<{ }>"  :subid("322_1261064023.05912") :method :outer("318_1261064023.05912")
+.annotate "line", 527
+    .local string rx1246_tgt
+    .local int rx1246_pos
+    .local int rx1246_off
+    .local int rx1246_eos
+    .local int rx1246_rep
+    .local pmc rx1246_cur
+    (rx1246_cur, rx1246_pos, rx1246_tgt) = self."!cursor_start"()
+    rx1246_cur."!cursor_debug"("START ", "metachar:sym<{ }>")
+    .lex unicode:"$\x{a2}", rx1246_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1246_eos, rx1246_tgt
+    set rx1246_off, 0
+    lt rx1246_pos, 2, rx1246_start
+    sub rx1246_off, rx1246_pos, 1
+    substr rx1246_tgt, rx1246_tgt, rx1246_off
+  rx1246_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1249_done
+    goto rxscan1249_scan
+  rxscan1249_loop:
+    ($P10) = rx1246_cur."from"()
+    inc $P10
+    set rx1246_pos, $P10
+    ge rx1246_pos, rx1246_eos, rxscan1249_done
+  rxscan1249_scan:
+    set_addr $I10, rxscan1249_loop
+    rx1246_cur."!mark_push"(0, rx1246_pos, $I10)
+  rxscan1249_done:
+.annotate "line", 533
+  # rx enumcharlist negate=0 zerowidth
+    ge rx1246_pos, rx1246_eos, rx1246_fail
+    sub $I10, rx1246_pos, rx1246_off
+    substr $S10, rx1246_tgt, $I10, 1
+    index $I11, "{", $S10
+    lt $I11, 0, rx1246_fail
+  # rx subrule "codeblock" subtype=capture negate=
+    rx1246_cur."!cursor_pos"(rx1246_pos)
+    $P10 = rx1246_cur."codeblock"()
+    unless $P10, rx1246_fail
+    rx1246_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("codeblock")
+    rx1246_pos = $P10."pos"()
+.annotate "line", 532
+  # rx pass
+    rx1246_cur."!cursor_pass"(rx1246_pos, "metachar:sym<{ }>")
+    rx1246_cur."!cursor_debug"("PASS  ", "metachar:sym<{ }>", " at pos=", rx1246_pos)
+    .return (rx1246_cur)
+  rx1246_fail:
+.annotate "line", 527
+    (rx1246_rep, rx1246_pos, $I10, $P10) = rx1246_cur."!mark_fail"(0)
+    lt rx1246_pos, -1, rx1246_done
+    eq rx1246_pos, -1, rx1246_fail
+    jump $I10
+  rx1246_done:
+    rx1246_cur."!cursor_fail"()
+    rx1246_cur."!cursor_debug"("FAIL  ", "metachar:sym<{ }>")
+    .return (rx1246_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Regex"]
+.sub "!PREFIX__metachar:sym<{ }>"  :subid("323_1261064023.05912") :method
+.annotate "line", 527
+    new $P1248, "ResizablePMCArray"
+    push $P1248, "{"
+    .return ($P1248)
+.end
+
+
+.namespace ["NQP";"Regex"]
+.sub "assertion:sym<{ }>"  :subid("324_1261064023.05912") :method :outer("318_1261064023.05912")
+.annotate "line", 527
+    .local string rx1251_tgt
+    .local int rx1251_pos
+    .local int rx1251_off
+    .local int rx1251_eos
+    .local int rx1251_rep
+    .local pmc rx1251_cur
+    (rx1251_cur, rx1251_pos, rx1251_tgt) = self."!cursor_start"()
+    rx1251_cur."!cursor_debug"("START ", "assertion:sym<{ }>")
+    .lex unicode:"$\x{a2}", rx1251_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1251_eos, rx1251_tgt
+    set rx1251_off, 0
+    lt rx1251_pos, 2, rx1251_start
+    sub rx1251_off, rx1251_pos, 1
+    substr rx1251_tgt, rx1251_tgt, rx1251_off
+  rx1251_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1254_done
+    goto rxscan1254_scan
+  rxscan1254_loop:
+    ($P10) = rx1251_cur."from"()
+    inc $P10
+    set rx1251_pos, $P10
+    ge rx1251_pos, rx1251_eos, rxscan1254_done
+  rxscan1254_scan:
+    set_addr $I10, rxscan1254_loop
+    rx1251_cur."!mark_push"(0, rx1251_pos, $I10)
+  rxscan1254_done:
+.annotate "line", 537
+  # rx enumcharlist negate=0 zerowidth
+    ge rx1251_pos, rx1251_eos, rx1251_fail
+    sub $I10, rx1251_pos, rx1251_off
+    substr $S10, rx1251_tgt, $I10, 1
+    index $I11, "{", $S10
+    lt $I11, 0, rx1251_fail
+  # rx subrule "codeblock" subtype=capture negate=
+    rx1251_cur."!cursor_pos"(rx1251_pos)
+    $P10 = rx1251_cur."codeblock"()
+    unless $P10, rx1251_fail
+    rx1251_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("codeblock")
+    rx1251_pos = $P10."pos"()
+.annotate "line", 536
+  # rx pass
+    rx1251_cur."!cursor_pass"(rx1251_pos, "assertion:sym<{ }>")
+    rx1251_cur."!cursor_debug"("PASS  ", "assertion:sym<{ }>", " at pos=", rx1251_pos)
+    .return (rx1251_cur)
+  rx1251_fail:
+.annotate "line", 527
+    (rx1251_rep, rx1251_pos, $I10, $P10) = rx1251_cur."!mark_fail"(0)
+    lt rx1251_pos, -1, rx1251_done
+    eq rx1251_pos, -1, rx1251_fail
+    jump $I10
+  rx1251_done:
+    rx1251_cur."!cursor_fail"()
+    rx1251_cur."!cursor_debug"("FAIL  ", "assertion:sym<{ }>")
+    .return (rx1251_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Regex"]
+.sub "!PREFIX__assertion:sym<{ }>"  :subid("325_1261064023.05912") :method
+.annotate "line", 527
+    new $P1253, "ResizablePMCArray"
+    push $P1253, "{"
+    .return ($P1253)
+.end
+
+
+.namespace ["NQP";"Regex"]
+.sub "assertion:sym<name>"  :subid("326_1261064023.05912") :method :outer("318_1261064023.05912")
+.annotate "line", 527
+    .const 'Sub' $P1264 = "328_1261064023.05912" 
+    capture_lex $P1264
+    .local string rx1256_tgt
+    .local int rx1256_pos
+    .local int rx1256_off
+    .local int rx1256_eos
+    .local int rx1256_rep
+    .local pmc rx1256_cur
+    (rx1256_cur, rx1256_pos, rx1256_tgt) = self."!cursor_start"()
+    rx1256_cur."!cursor_debug"("START ", "assertion:sym<name>")
+    rx1256_cur."!cursor_caparray"("arglist", "nibbler", "assertion")
+    .lex unicode:"$\x{a2}", rx1256_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1256_eos, rx1256_tgt
+    set rx1256_off, 0
+    lt rx1256_pos, 2, rx1256_start
+    sub rx1256_off, rx1256_pos, 1
+    substr rx1256_tgt, rx1256_tgt, rx1256_off
+  rx1256_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1259_done
+    goto rxscan1259_scan
+  rxscan1259_loop:
+    ($P10) = rx1256_cur."from"()
+    inc $P10
+    set rx1256_pos, $P10
+    ge rx1256_pos, rx1256_eos, rxscan1259_done
+  rxscan1259_scan:
+    set_addr $I10, rxscan1259_loop
+    rx1256_cur."!mark_push"(0, rx1256_pos, $I10)
+  rxscan1259_done:
+.annotate "line", 541
+  # rx subcapture "longname"
+    set_addr $I10, rxcap_1260_fail
+    rx1256_cur."!mark_push"(0, rx1256_pos, $I10)
+  # rx charclass_q w r 1..-1
+    sub $I10, rx1256_pos, rx1256_off
+    find_not_cclass $I11, 8192, rx1256_tgt, $I10, rx1256_eos
+    add $I12, $I10, 1
+    lt $I11, $I12, rx1256_fail
+    add rx1256_pos, rx1256_off, $I11
+    set_addr $I10, rxcap_1260_fail
+    ($I12, $I11) = rx1256_cur."!mark_peek"($I10)
+    rx1256_cur."!cursor_pos"($I11)
+    ($P10) = rx1256_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx1256_pos, "")
+    rx1256_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("longname")
+    goto rxcap_1260_done
+  rxcap_1260_fail:
+    goto rx1256_fail
+  rxcap_1260_done:
+.annotate "line", 548
+  # rx rxquantr1261 ** 0..1
+    set_addr $I1267, rxquantr1261_done
+    rx1256_cur."!mark_push"(0, rx1256_pos, $I1267)
+  rxquantr1261_loop:
+  alt1262_0:
+.annotate "line", 542
+    set_addr $I10, alt1262_1
+    rx1256_cur."!mark_push"(0, rx1256_pos, $I10)
+.annotate "line", 543
+  # rx subrule "before" subtype=zerowidth negate=
+    rx1256_cur."!cursor_pos"(rx1256_pos)
+    .const 'Sub' $P1264 = "328_1261064023.05912" 
+    capture_lex $P1264
+    $P10 = rx1256_cur."before"($P1264)
+    unless $P10, rx1256_fail
+    goto alt1262_end
+  alt1262_1:
+    set_addr $I10, alt1262_2
+    rx1256_cur."!mark_push"(0, rx1256_pos, $I10)
+.annotate "line", 544
+  # rx literal  "="
+    add $I11, rx1256_pos, 1
+    gt $I11, rx1256_eos, rx1256_fail
+    sub $I11, rx1256_pos, rx1256_off
+    substr $S10, rx1256_tgt, $I11, 1
+    ne $S10, "=", rx1256_fail
+    add rx1256_pos, 1
+  # rx subrule "assertion" subtype=capture negate=
+    rx1256_cur."!cursor_pos"(rx1256_pos)
+    $P10 = rx1256_cur."assertion"()
+    unless $P10, rx1256_fail
+    rx1256_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("assertion")
+    rx1256_pos = $P10."pos"()
+    goto alt1262_end
+  alt1262_2:
+    set_addr $I10, alt1262_3
+    rx1256_cur."!mark_push"(0, rx1256_pos, $I10)
+.annotate "line", 545
+  # rx literal  ":"
+    add $I11, rx1256_pos, 1
+    gt $I11, rx1256_eos, rx1256_fail
+    sub $I11, rx1256_pos, rx1256_off
+    substr $S10, rx1256_tgt, $I11, 1
+    ne $S10, ":", rx1256_fail
+    add rx1256_pos, 1
+  # rx subrule "arglist" subtype=capture negate=
+    rx1256_cur."!cursor_pos"(rx1256_pos)
+    $P10 = rx1256_cur."arglist"()
+    unless $P10, rx1256_fail
+    rx1256_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("arglist")
+    rx1256_pos = $P10."pos"()
+    goto alt1262_end
+  alt1262_3:
+    set_addr $I10, alt1262_4
+    rx1256_cur."!mark_push"(0, rx1256_pos, $I10)
+.annotate "line", 546
+  # rx literal  "("
+    add $I11, rx1256_pos, 1
+    gt $I11, rx1256_eos, rx1256_fail
+    sub $I11, rx1256_pos, rx1256_off
+    substr $S10, rx1256_tgt, $I11, 1
+    ne $S10, "(", rx1256_fail
+    add rx1256_pos, 1
+  # rx subrule "LANG" subtype=capture negate=
+    rx1256_cur."!cursor_pos"(rx1256_pos)
+    $P10 = rx1256_cur."LANG"("MAIN", "arglist")
+    unless $P10, rx1256_fail
+    rx1256_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("arglist")
+    rx1256_pos = $P10."pos"()
+  # rx literal  ")"
+    add $I11, rx1256_pos, 1
+    gt $I11, rx1256_eos, rx1256_fail
+    sub $I11, rx1256_pos, rx1256_off
+    substr $S10, rx1256_tgt, $I11, 1
+    ne $S10, ")", rx1256_fail
+    add rx1256_pos, 1
+    goto alt1262_end
+  alt1262_4:
+.annotate "line", 547
+  # rx subrule "normspace" subtype=method negate=
+    rx1256_cur."!cursor_pos"(rx1256_pos)
+    $P10 = rx1256_cur."normspace"()
+    unless $P10, rx1256_fail
+    rx1256_pos = $P10."pos"()
+  # rx subrule "nibbler" subtype=capture negate=
+    rx1256_cur."!cursor_pos"(rx1256_pos)
+    $P10 = rx1256_cur."nibbler"()
+    unless $P10, rx1256_fail
+    rx1256_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("nibbler")
+    rx1256_pos = $P10."pos"()
+  alt1262_end:
+.annotate "line", 548
+    (rx1256_rep) = rx1256_cur."!mark_commit"($I1267)
+  rxquantr1261_done:
+.annotate "line", 540
+  # rx pass
+    rx1256_cur."!cursor_pass"(rx1256_pos, "assertion:sym<name>")
+    rx1256_cur."!cursor_debug"("PASS  ", "assertion:sym<name>", " at pos=", rx1256_pos)
+    .return (rx1256_cur)
+  rx1256_fail:
+.annotate "line", 527
+    (rx1256_rep, rx1256_pos, $I10, $P10) = rx1256_cur."!mark_fail"(0)
+    lt rx1256_pos, -1, rx1256_done
+    eq rx1256_pos, -1, rx1256_fail
+    jump $I10
+  rx1256_done:
+    rx1256_cur."!cursor_fail"()
+    rx1256_cur."!cursor_debug"("FAIL  ", "assertion:sym<name>")
+    .return (rx1256_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Regex"]
+.sub "!PREFIX__assertion:sym<name>"  :subid("327_1261064023.05912") :method
+.annotate "line", 527
+    new $P1258, "ResizablePMCArray"
+    push $P1258, ""
+    .return ($P1258)
+.end
+
+
+.namespace ["NQP";"Regex"]
+.sub "_block1263"  :anon :subid("328_1261064023.05912") :method :outer("326_1261064023.05912")
+.annotate "line", 543
+    .local string rx1265_tgt
+    .local int rx1265_pos
+    .local int rx1265_off
+    .local int rx1265_eos
+    .local int rx1265_rep
+    .local pmc rx1265_cur
+    (rx1265_cur, rx1265_pos, rx1265_tgt) = self."!cursor_start"()
+    rx1265_cur."!cursor_debug"("START ", "")
+    .lex unicode:"$\x{a2}", rx1265_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1265_eos, rx1265_tgt
+    set rx1265_off, 0
+    lt rx1265_pos, 2, rx1265_start
+    sub rx1265_off, rx1265_pos, 1
+    substr rx1265_tgt, rx1265_tgt, rx1265_off
+  rx1265_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1266_done
+    goto rxscan1266_scan
+  rxscan1266_loop:
+    ($P10) = rx1265_cur."from"()
+    inc $P10
+    set rx1265_pos, $P10
+    ge rx1265_pos, rx1265_eos, rxscan1266_done
+  rxscan1266_scan:
+    set_addr $I10, rxscan1266_loop
+    rx1265_cur."!mark_push"(0, rx1265_pos, $I10)
+  rxscan1266_done:
+  # rx literal  ">"
+    add $I11, rx1265_pos, 1
+    gt $I11, rx1265_eos, rx1265_fail
+    sub $I11, rx1265_pos, rx1265_off
+    substr $S10, rx1265_tgt, $I11, 1
+    ne $S10, ">", rx1265_fail
+    add rx1265_pos, 1
+  # rx pass
+    rx1265_cur."!cursor_pass"(rx1265_pos, "")
+    rx1265_cur."!cursor_debug"("PASS  ", "", " at pos=", rx1265_pos)
+    .return (rx1265_cur)
+  rx1265_fail:
+    (rx1265_rep, rx1265_pos, $I10, $P10) = rx1265_cur."!mark_fail"(0)
+    lt rx1265_pos, -1, rx1265_done
+    eq rx1265_pos, -1, rx1265_fail
+    jump $I10
+  rx1265_done:
+    rx1265_cur."!cursor_fail"()
+    rx1265_cur."!cursor_debug"("FAIL  ", "")
+    .return (rx1265_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Regex"]
+.sub "codeblock"  :subid("329_1261064023.05912") :method :outer("318_1261064023.05912")
+.annotate "line", 527
+    .local string rx1269_tgt
+    .local int rx1269_pos
+    .local int rx1269_off
+    .local int rx1269_eos
+    .local int rx1269_rep
+    .local pmc rx1269_cur
+    (rx1269_cur, rx1269_pos, rx1269_tgt) = self."!cursor_start"()
+    rx1269_cur."!cursor_debug"("START ", "codeblock")
+    .lex unicode:"$\x{a2}", rx1269_cur
+    .local pmc match
+    .lex "$/", match
+    length rx1269_eos, rx1269_tgt
+    set rx1269_off, 0
+    lt rx1269_pos, 2, rx1269_start
+    sub rx1269_off, rx1269_pos, 1
+    substr rx1269_tgt, rx1269_tgt, rx1269_off
+  rx1269_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan1273_done
+    goto rxscan1273_scan
+  rxscan1273_loop:
+    ($P10) = rx1269_cur."from"()
+    inc $P10
+    set rx1269_pos, $P10
+    ge rx1269_pos, rx1269_eos, rxscan1273_done
+  rxscan1273_scan:
+    set_addr $I10, rxscan1273_loop
+    rx1269_cur."!mark_push"(0, rx1269_pos, $I10)
+  rxscan1273_done:
+.annotate "line", 553
+  # rx subrule "LANG" subtype=capture negate=
+    rx1269_cur."!cursor_pos"(rx1269_pos)
+    $P10 = rx1269_cur."LANG"("MAIN", "pblock")
+    unless $P10, rx1269_fail
+    rx1269_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("block")
+    rx1269_pos = $P10."pos"()
+.annotate "line", 552
+  # rx pass
+    rx1269_cur."!cursor_pass"(rx1269_pos, "codeblock")
+    rx1269_cur."!cursor_debug"("PASS  ", "codeblock", " at pos=", rx1269_pos)
+    .return (rx1269_cur)
+  rx1269_fail:
+.annotate "line", 527
+    (rx1269_rep, rx1269_pos, $I10, $P10) = rx1269_cur."!mark_fail"(0)
+    lt rx1269_pos, -1, rx1269_done
+    eq rx1269_pos, -1, rx1269_fail
+    jump $I10
+  rx1269_done:
+    rx1269_cur."!cursor_fail"()
+    rx1269_cur."!cursor_debug"("FAIL  ", "codeblock")
+    .return (rx1269_cur)
+    .return ()
+.end
+
+
+.namespace ["NQP";"Regex"]
+.sub "!PREFIX__codeblock"  :subid("330_1261064023.05912") :method
+.annotate "line", 527
+    $P1271 = self."!PREFIX__!subrule"("block", "")
+    new $P1272, "ResizablePMCArray"
+    push $P1272, $P1271
+    .return ($P1272)
+.end
+
+### .include 'gen/nqp-actions.pir'
+
+.namespace []
+.sub "_block11"  :anon :subid("10_1261064035.64813")
+.annotate "line", 0
+    get_hll_global $P14, ["NQP";"Actions"], "_block13" 
+    capture_lex $P14
+.annotate "line", 3
+    get_hll_global $P14, ["NQP";"Actions"], "_block13" 
+    capture_lex $P14
+    $P2165 = $P14()
+.annotate "line", 1
+    .return ($P2165)
+.end
+
+
+.namespace []
+.sub "" :load :init :subid("post126") :outer("10_1261064035.64813")
+.annotate "line", 0
+    .const 'Sub' $P12 = "10_1261064035.64813" 
+    .local pmc block
+    set block, $P12
+    $P2166 = get_root_global ["parrot"], "P6metaclass"
+    $P2166."new_class"("NQP::Actions", "HLL::Actions" :named("parent"))
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "_block13"  :subid("11_1261064035.64813") :outer("10_1261064035.64813")
+.annotate "line", 3
+    .const 'Sub' $P2161 = "125_1261064035.64813" 
+    capture_lex $P2161
+    get_hll_global $P2097, ["NQP";"RegexActions"], "_block2096" 
+    capture_lex $P2097
+    .const 'Sub' $P2086 = "119_1261064035.64813" 
+    capture_lex $P2086
+    .const 'Sub' $P2074 = "118_1261064035.64813" 
+    capture_lex $P2074
+    .const 'Sub' $P2064 = "117_1261064035.64813" 
+    capture_lex $P2064
+    .const 'Sub' $P2054 = "116_1261064035.64813" 
+    capture_lex $P2054
+    .const 'Sub' $P2044 = "115_1261064035.64813" 
+    capture_lex $P2044
+    .const 'Sub' $P2030 = "114_1261064035.64813" 
+    capture_lex $P2030
+    .const 'Sub' $P2020 = "113_1261064035.64813" 
+    capture_lex $P2020
+    .const 'Sub' $P1983 = "112_1261064035.64813" 
+    capture_lex $P1983
+    .const 'Sub' $P1969 = "111_1261064035.64813" 
+    capture_lex $P1969
+    .const 'Sub' $P1959 = "110_1261064035.64813" 
+    capture_lex $P1959
+    .const 'Sub' $P1949 = "109_1261064035.64813" 
+    capture_lex $P1949
+    .const 'Sub' $P1939 = "108_1261064035.64813" 
+    capture_lex $P1939
+    .const 'Sub' $P1929 = "107_1261064035.64813" 
+    capture_lex $P1929
+    .const 'Sub' $P1919 = "106_1261064035.64813" 
+    capture_lex $P1919
+    .const 'Sub' $P1891 = "105_1261064035.64813" 
+    capture_lex $P1891
+    .const 'Sub' $P1874 = "104_1261064035.64813" 
+    capture_lex $P1874
+    .const 'Sub' $P1864 = "103_1261064035.64813" 
+    capture_lex $P1864
+    .const 'Sub' $P1852 = "102_1261064035.64813" 
+    capture_lex $P1852
+    .const 'Sub' $P1840 = "101_1261064035.64813" 
+    capture_lex $P1840
+    .const 'Sub' $P1828 = "100_1261064035.64813" 
+    capture_lex $P1828
+    .const 'Sub' $P1818 = "99_1261064035.64813" 
+    capture_lex $P1818
+    .const 'Sub' $P1789 = "98_1261064035.64813" 
+    capture_lex $P1789
+    .const 'Sub' $P1767 = "97_1261064035.64813" 
+    capture_lex $P1767
+    .const 'Sub' $P1757 = "96_1261064035.64813" 
+    capture_lex $P1757
+    .const 'Sub' $P1747 = "95_1261064035.64813" 
+    capture_lex $P1747
+    .const 'Sub' $P1720 = "94_1261064035.64813" 
+    capture_lex $P1720
+    .const 'Sub' $P1702 = "93_1261064035.64813" 
+    capture_lex $P1702
+    .const 'Sub' $P1692 = "92_1261064035.64813" 
+    capture_lex $P1692
+    .const 'Sub' $P1608 = "89_1261064035.64813" 
+    capture_lex $P1608
+    .const 'Sub' $P1598 = "88_1261064035.64813" 
+    capture_lex $P1598
+    .const 'Sub' $P1569 = "87_1261064035.64813" 
+    capture_lex $P1569
+    .const 'Sub' $P1527 = "86_1261064035.64813" 
+    capture_lex $P1527
+    .const 'Sub' $P1511 = "85_1261064035.64813" 
+    capture_lex $P1511
+    .const 'Sub' $P1502 = "84_1261064035.64813" 
+    capture_lex $P1502
+    .const 'Sub' $P1470 = "83_1261064035.64813" 
+    capture_lex $P1470
+    .const 'Sub' $P1371 = "80_1261064035.64813" 
+    capture_lex $P1371
+    .const 'Sub' $P1354 = "79_1261064035.64813" 
+    capture_lex $P1354
+    .const 'Sub' $P1334 = "78_1261064035.64813" 
+    capture_lex $P1334
+    .const 'Sub' $P1250 = "77_1261064035.64813" 
+    capture_lex $P1250
+    .const 'Sub' $P1226 = "75_1261064035.64813" 
+    capture_lex $P1226
+    .const 'Sub' $P1192 = "73_1261064035.64813" 
+    capture_lex $P1192
+    .const 'Sub' $P1142 = "71_1261064035.64813" 
+    capture_lex $P1142
+    .const 'Sub' $P1132 = "70_1261064035.64813" 
+    capture_lex $P1132
+    .const 'Sub' $P1122 = "69_1261064035.64813" 
+    capture_lex $P1122
+    .const 'Sub' $P1051 = "67_1261064035.64813" 
+    capture_lex $P1051
+    .const 'Sub' $P1034 = "66_1261064035.64813" 
+    capture_lex $P1034
+    .const 'Sub' $P1024 = "65_1261064035.64813" 
+    capture_lex $P1024
+    .const 'Sub' $P1014 = "64_1261064035.64813" 
+    capture_lex $P1014
+    .const 'Sub' $P1004 = "63_1261064035.64813" 
+    capture_lex $P1004
+    .const 'Sub' $P980 = "62_1261064035.64813" 
+    capture_lex $P980
+    .const 'Sub' $P927 = "61_1261064035.64813" 
+    capture_lex $P927
+    .const 'Sub' $P917 = "60_1261064035.64813" 
+    capture_lex $P917
+    .const 'Sub' $P828 = "58_1261064035.64813" 
+    capture_lex $P828
+    .const 'Sub' $P802 = "57_1261064035.64813" 
+    capture_lex $P802
+    .const 'Sub' $P786 = "56_1261064035.64813" 
+    capture_lex $P786
+    .const 'Sub' $P776 = "55_1261064035.64813" 
+    capture_lex $P776
+    .const 'Sub' $P766 = "54_1261064035.64813" 
+    capture_lex $P766
+    .const 'Sub' $P756 = "53_1261064035.64813" 
+    capture_lex $P756
+    .const 'Sub' $P746 = "52_1261064035.64813" 
+    capture_lex $P746
+    .const 'Sub' $P736 = "51_1261064035.64813" 
+    capture_lex $P736
+    .const 'Sub' $P726 = "50_1261064035.64813" 
+    capture_lex $P726
+    .const 'Sub' $P716 = "49_1261064035.64813" 
+    capture_lex $P716
+    .const 'Sub' $P706 = "48_1261064035.64813" 
+    capture_lex $P706
+    .const 'Sub' $P696 = "47_1261064035.64813" 
+    capture_lex $P696
+    .const 'Sub' $P686 = "46_1261064035.64813" 
+    capture_lex $P686
+    .const 'Sub' $P676 = "45_1261064035.64813" 
+    capture_lex $P676
+    .const 'Sub' $P666 = "44_1261064035.64813" 
+    capture_lex $P666
+    .const 'Sub' $P656 = "43_1261064035.64813" 
+    capture_lex $P656
+    .const 'Sub' $P638 = "42_1261064035.64813" 
+    capture_lex $P638
+    .const 'Sub' $P603 = "41_1261064035.64813" 
+    capture_lex $P603
+    .const 'Sub' $P587 = "40_1261064035.64813" 
+    capture_lex $P587
+    .const 'Sub' $P566 = "39_1261064035.64813" 
+    capture_lex $P566
+    .const 'Sub' $P546 = "38_1261064035.64813" 
+    capture_lex $P546
+    .const 'Sub' $P533 = "37_1261064035.64813" 
+    capture_lex $P533
+    .const 'Sub' $P507 = "36_1261064035.64813" 
+    capture_lex $P507
+    .const 'Sub' $P471 = "35_1261064035.64813" 
+    capture_lex $P471
+    .const 'Sub' $P454 = "34_1261064035.64813" 
+    capture_lex $P454
+    .const 'Sub' $P440 = "33_1261064035.64813" 
+    capture_lex $P440
+    .const 'Sub' $P387 = "31_1261064035.64813" 
+    capture_lex $P387
+    .const 'Sub' $P374 = "30_1261064035.64813" 
+    capture_lex $P374
+    .const 'Sub' $P355 = "29_1261064035.64813" 
+    capture_lex $P355
+    .const 'Sub' $P345 = "28_1261064035.64813" 
+    capture_lex $P345
+    .const 'Sub' $P335 = "27_1261064035.64813" 
+    capture_lex $P335
+    .const 'Sub' $P319 = "26_1261064035.64813" 
+    capture_lex $P319
+    .const 'Sub' $P259 = "24_1261064035.64813" 
+    capture_lex $P259
+    .const 'Sub' $P210 = "22_1261064035.64813" 
+    capture_lex $P210
+    .const 'Sub' $P191 = "21_1261064035.64813" 
+    capture_lex $P191
+    .const 'Sub' $P158 = "20_1261064035.64813" 
+    capture_lex $P158
+    .const 'Sub' $P148 = "19_1261064035.64813" 
+    capture_lex $P148
+    .const 'Sub' $P94 = "18_1261064035.64813" 
+    capture_lex $P94
+    .const 'Sub' $P79 = "17_1261064035.64813" 
+    capture_lex $P79
+    .const 'Sub' $P61 = "16_1261064035.64813" 
+    capture_lex $P61
+    .const 'Sub' $P26 = "13_1261064035.64813" 
+    capture_lex $P26
+    .const 'Sub' $P16 = "12_1261064035.64813" 
+    capture_lex $P16
+    get_global $P15, "@BLOCK"
+    unless_null $P15, vivify_129
+    new $P15, "ResizablePMCArray"
+    set_global "@BLOCK", $P15
+  vivify_129:
+.annotate "line", 9
+    .const 'Sub' $P16 = "12_1261064035.64813" 
+    capture_lex $P16
+    .lex "xblock_immediate", $P16
+.annotate "line", 14
+    .const 'Sub' $P26 = "13_1261064035.64813" 
+    capture_lex $P26
+    .lex "block_immediate", $P26
+.annotate "line", 24
+    .const 'Sub' $P61 = "16_1261064035.64813" 
+    capture_lex $P61
+    .lex "sigiltype", $P61
+.annotate "line", 40
+    .const 'Sub' $P79 = "17_1261064035.64813" 
+    capture_lex $P79
+    .lex "colonpair_str", $P79
+.annotate "line", 187
+    .const 'Sub' $P94 = "18_1261064035.64813" 
+    capture_lex $P94
+    .lex "push_block_handler", $P94
+.annotate "line", 3
+    get_global $P144, "@BLOCK"
+.annotate "line", 5
+    find_lex $P145, "xblock_immediate"
+    find_lex $P146, "block_immediate"
+    find_lex $P147, "sigiltype"
+.annotate "line", 32
+    find_lex $P190, "colonpair_str"
+.annotate "line", 180
+    find_lex $P586, "push_block_handler"
+.annotate "line", 765
+    get_hll_global $P2097, ["NQP";"RegexActions"], "_block2096" 
+    capture_lex $P2097
+    $P2159 = $P2097()
+.annotate "line", 3
+    .return ($P2159)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "" :load :init :subid("post127") :outer("11_1261064035.64813")
+.annotate "line", 3
+    get_hll_global $P14, ["NQP";"Actions"], "_block13" 
+    .local pmc block
+    set block, $P14
+.annotate "line", 5
+    .const 'Sub' $P2161 = "125_1261064035.64813" 
+    capture_lex $P2161
+    $P2161()
+    $P2164 = get_root_global ["parrot"], "P6metaclass"
+    $P2164."new_class"("NQP::RegexActions", "Regex::P6Regex::Actions" :named("parent"))
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "_block2160"  :anon :subid("125_1261064035.64813") :outer("11_1261064035.64813")
+.annotate "line", 6
+    get_global $P2162, "@BLOCK"
+    unless_null $P2162, vivify_128
+    new $P2162, "ResizablePMCArray"
+    set_global "@BLOCK", $P2162
+  vivify_128:
+ $P2163 = new ['ResizablePMCArray'] 
+    set_global "@BLOCK", $P2163
+.annotate "line", 5
+    .return ($P2163)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "xblock_immediate"  :subid("12_1261064035.64813") :outer("11_1261064035.64813")
+    .param pmc param_19
+.annotate "line", 9
+    new $P18, 'ExceptionHandler'
+    set_addr $P18, control_17
+    $P18."handle_types"(58)
+    push_eh $P18
+    .lex "$xblock", param_19
+.annotate "line", 10
+    find_lex $P20, "$xblock"
+    unless_null $P20, vivify_130
+    new $P20, "ResizablePMCArray"
+  vivify_130:
+    set $P21, $P20[1]
+    unless_null $P21, vivify_131
+    new $P21, "Undef"
+  vivify_131:
+    $P22 = "block_immediate"($P21)
+    find_lex $P23, "$xblock"
+    unless_null $P23, vivify_132
+    new $P23, "ResizablePMCArray"
+    store_lex "$xblock", $P23
+  vivify_132:
+    set $P23[1], $P22
+    find_lex $P24, "$xblock"
+.annotate "line", 9
+    .return ($P24)
+  control_17:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P25, exception, "payload"
+    .return ($P25)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "block_immediate"  :subid("13_1261064035.64813") :outer("11_1261064035.64813")
+    .param pmc param_29
+.annotate "line", 14
+    .const 'Sub' $P39 = "14_1261064035.64813" 
+    capture_lex $P39
+    new $P28, 'ExceptionHandler'
+    set_addr $P28, control_27
+    $P28."handle_types"(58)
+    push_eh $P28
+    .lex "$block", param_29
+.annotate "line", 15
+    find_lex $P30, "$block"
+    $P30."blocktype"("immediate")
+.annotate "line", 16
+    find_lex $P34, "$block"
+    $P35 = $P34."symtable"()
+    unless $P35, unless_33
+    set $P32, $P35
+    goto unless_33_end
+  unless_33:
+    find_lex $P36, "$block"
+    $P37 = $P36."handlers"()
+    set $P32, $P37
+  unless_33_end:
+    if $P32, unless_31_end
+    .const 'Sub' $P39 = "14_1261064035.64813" 
+    capture_lex $P39
+    $P39()
+  unless_31_end:
+    find_lex $P59, "$block"
+.annotate "line", 14
+    .return ($P59)
+  control_27:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P60, exception, "payload"
+    .return ($P60)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "_block38"  :anon :subid("14_1261064035.64813") :outer("13_1261064035.64813")
+.annotate "line", 16
+    .const 'Sub' $P50 = "15_1261064035.64813" 
+    capture_lex $P50
+.annotate "line", 17
+    new $P40, "Undef"
+    .lex "$stmts", $P40
+    get_hll_global $P41, ["PAST"], "Stmts"
+    find_lex $P42, "$block"
+    $P43 = $P41."new"($P42 :named("node"))
+    store_lex "$stmts", $P43
+.annotate "line", 18
+    find_lex $P45, "$block"
+    $P46 = $P45."list"()
+    defined $I47, $P46
+    unless $I47, for_undef_133
+    iter $P44, $P46
+    new $P56, 'ExceptionHandler'
+    set_addr $P56, loop55_handler
+    $P56."handle_types"(65, 67, 66)
+    push_eh $P56
+  loop55_test:
+    unless $P44, loop55_done
+    shift $P48, $P44
+  loop55_redo:
+    .const 'Sub' $P50 = "15_1261064035.64813" 
+    capture_lex $P50
+    $P50($P48)
+  loop55_next:
+    goto loop55_test
+  loop55_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P57, exception, 'type'
+    eq $P57, 65, loop55_next
+    eq $P57, 67, loop55_redo
+  loop55_done:
+    pop_eh 
+  for_undef_133:
+.annotate "line", 19
+    find_lex $P58, "$stmts"
+    store_lex "$block", $P58
+.annotate "line", 16
+    .return ($P58)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "_block49"  :anon :subid("15_1261064035.64813") :outer("14_1261064035.64813")
+    .param pmc param_51
+.annotate "line", 18
+    .lex "$_", param_51
+    find_lex $P52, "$stmts"
+    find_lex $P53, "$_"
+    $P54 = $P52."push"($P53)
+    .return ($P54)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "sigiltype"  :subid("16_1261064035.64813") :outer("11_1261064035.64813")
+    .param pmc param_64
+.annotate "line", 24
+    new $P63, 'ExceptionHandler'
+    set_addr $P63, control_62
+    $P63."handle_types"(58)
+    push_eh $P63
+    .lex "$sigil", param_64
+.annotate "line", 25
+    find_lex $P67, "$sigil"
+    set $S68, $P67
+    iseq $I69, $S68, "%"
+    if $I69, if_66
+.annotate "line", 27
+    find_lex $P73, "$sigil"
+    set $S74, $P73
+    iseq $I75, $S74, "@"
+    if $I75, if_72
+    new $P77, "String"
+    assign $P77, "Undef"
+    set $P71, $P77
+    goto if_72_end
+  if_72:
+    new $P76, "String"
+    assign $P76, "ResizablePMCArray"
+    set $P71, $P76
+  if_72_end:
+    set $P65, $P71
+.annotate "line", 25
+    goto if_66_end
+  if_66:
+    new $P70, "String"
+    assign $P70, "Hash"
+    set $P65, $P70
+  if_66_end:
+.annotate "line", 24
+    .return ($P65)
+  control_62:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P78, exception, "payload"
+    .return ($P78)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "colonpair_str"  :subid("17_1261064035.64813") :outer("11_1261064035.64813")
+    .param pmc param_82
+.annotate "line", 40
+    new $P81, 'ExceptionHandler'
+    set_addr $P81, control_80
+    $P81."handle_types"(58)
+    push_eh $P81
+    .lex "$ast", param_82
+.annotate "line", 41
+    get_hll_global $P85, ["PAST"], "Op"
+    find_lex $P86, "$ast"
+    $P87 = $P85."ACCEPTS"($P86)
+    if $P87, if_84
+.annotate "line", 43
+    find_lex $P91, "$ast"
+    $P92 = $P91."value"()
+    set $P83, $P92
+.annotate "line", 41
+    goto if_84_end
+  if_84:
+.annotate "line", 42
+    find_lex $P88, "$ast"
+    $P89 = $P88."list"()
+    join $S90, " ", $P89
+    new $P83, 'String'
+    set $P83, $S90
+  if_84_end:
+.annotate "line", 40
+    .return ($P83)
+  control_80:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P93, exception, "payload"
+    .return ($P93)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "push_block_handler"  :subid("18_1261064035.64813") :outer("11_1261064035.64813")
+    .param pmc param_97
+    .param pmc param_98
+.annotate "line", 187
+    new $P96, 'ExceptionHandler'
+    set_addr $P96, control_95
+    $P96."handle_types"(58)
+    push_eh $P96
+    .lex "$/", param_97
+    .lex "$block", param_98
+.annotate "line", 188
+    get_global $P100, "@BLOCK"
+    unless_null $P100, vivify_134
+    new $P100, "ResizablePMCArray"
+  vivify_134:
+    set $P101, $P100[0]
+    unless_null $P101, vivify_135
+    new $P101, "Undef"
+  vivify_135:
+    $P102 = $P101."handlers"()
+    if $P102, unless_99_end
+.annotate "line", 189
+    get_global $P103, "@BLOCK"
+    unless_null $P103, vivify_136
+    new $P103, "ResizablePMCArray"
+  vivify_136:
+    set $P104, $P103[0]
+    unless_null $P104, vivify_137
+    new $P104, "Undef"
+  vivify_137:
+    new $P105, "ResizablePMCArray"
+    $P104."handlers"($P105)
+  unless_99_end:
+.annotate "line", 191
+    find_lex $P107, "$block"
+    $P108 = $P107."arity"()
+    if $P108, unless_106_end
+.annotate "line", 192
+    find_lex $P109, "$block"
+.annotate "line", 193
+    get_hll_global $P110, ["PAST"], "Op"
+.annotate "line", 194
+    get_hll_global $P111, ["PAST"], "Var"
+    $P112 = $P111."new"("lexical" :named("scope"), "$!" :named("name"), 1 :named("isdecl"))
+.annotate "line", 195
+    get_hll_global $P113, ["PAST"], "Var"
+    $P114 = $P113."new"("lexical" :named("scope"), "$_" :named("name"))
+    $P115 = $P110."new"($P112, $P114, "bind" :named("pasttype"))
+.annotate "line", 193
+    $P109."unshift"($P115)
+.annotate "line", 198
+    find_lex $P116, "$block"
+    get_hll_global $P117, ["PAST"], "Var"
+    $P118 = $P117."new"("$_" :named("name"), "parameter" :named("scope"))
+    $P116."unshift"($P118)
+.annotate "line", 199
+    find_lex $P119, "$block"
+    $P119."symbol"("$_", "lexical" :named("scope"))
+.annotate "line", 200
+    find_lex $P120, "$block"
+    $P120."symbol"("$!", "lexical" :named("scope"))
+.annotate "line", 201
+    find_lex $P121, "$block"
+    $P121."arity"(1)
+  unless_106_end:
+.annotate "line", 203
+    find_lex $P122, "$block"
+    $P122."blocktype"("declaration")
+.annotate "line", 204
+    get_global $P123, "@BLOCK"
+    unless_null $P123, vivify_138
+    new $P123, "ResizablePMCArray"
+  vivify_138:
+    set $P124, $P123[0]
+    unless_null $P124, vivify_139
+    new $P124, "Undef"
+  vivify_139:
+    $P125 = $P124."handlers"()
+.annotate "line", 205
+    get_hll_global $P126, ["PAST"], "Control"
+    find_lex $P127, "$/"
+.annotate "line", 207
+    get_hll_global $P128, ["PAST"], "Stmts"
+.annotate "line", 208
+    get_hll_global $P129, ["PAST"], "Op"
+    find_lex $P130, "$block"
+.annotate "line", 210
+    get_hll_global $P131, ["PAST"], "Var"
+    $P132 = $P131."new"("register" :named("scope"), "exception" :named("name"))
+    $P133 = $P129."new"($P130, $P132, "call" :named("pasttype"))
+.annotate "line", 212
+    get_hll_global $P134, ["PAST"], "Op"
+.annotate "line", 213
+    get_hll_global $P135, ["PAST"], "Var"
+.annotate "line", 214
+    get_hll_global $P136, ["PAST"], "Var"
+    $P137 = $P136."new"("register" :named("scope"), "exception" :named("name"))
+    $P138 = $P135."new"($P137, "handled", "keyed" :named("scope"))
+.annotate "line", 213
+    $P139 = $P134."new"($P138, 1, "bind" :named("pasttype"))
+.annotate "line", 212
+    $P140 = $P128."new"($P133, $P139)
+.annotate "line", 207
+    $P141 = $P126."new"($P140, $P127 :named("node"))
+.annotate "line", 205
+    $P142 = $P125."unshift"($P141)
+.annotate "line", 187
+    .return ($P142)
+  control_95:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P143, exception, "payload"
+    .return ($P143)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "TOP"  :subid("19_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_151
+.annotate "line", 30
+    new $P150, 'ExceptionHandler'
+    set_addr $P150, control_149
+    $P150."handle_types"(58)
+    push_eh $P150
+    .lex "self", self
+    .lex "$/", param_151
+    find_lex $P152, "$/"
+    find_lex $P153, "$/"
+    unless_null $P153, vivify_140
+    new $P153, "Hash"
+  vivify_140:
+    set $P154, $P153["comp_unit"]
+    unless_null $P154, vivify_141
+    new $P154, "Undef"
+  vivify_141:
+    $P155 = $P154."ast"()
+    $P156 = $P152."!make"($P155)
+    .return ($P156)
+  control_149:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P157, exception, "payload"
+    .return ($P157)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "deflongname"  :subid("20_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_161
+.annotate "line", 32
+    new $P160, 'ExceptionHandler'
+    set_addr $P160, control_159
+    $P160."handle_types"(58)
+    push_eh $P160
+    .lex "self", self
+    .lex "$/", param_161
+.annotate "line", 33
+    find_lex $P162, "$/"
+.annotate "line", 34
+    find_lex $P165, "$/"
+    unless_null $P165, vivify_142
+    new $P165, "Hash"
+  vivify_142:
+    set $P166, $P165["colonpair"]
+    unless_null $P166, vivify_143
+    new $P166, "Undef"
+  vivify_143:
+    if $P166, if_164
+.annotate "line", 36
+    find_lex $P186, "$/"
+    set $S187, $P186
+    new $P163, 'String'
+    set $P163, $S187
+.annotate "line", 34
+    goto if_164_end
+  if_164:
+    find_lex $P167, "$/"
+    unless_null $P167, vivify_144
+    new $P167, "Hash"
+  vivify_144:
+    set $P168, $P167["identifier"]
+    unless_null $P168, vivify_145
+    new $P168, "Undef"
+  vivify_145:
+    set $S169, $P168
+    new $P170, 'String'
+    set $P170, $S169
+    concat $P171, $P170, ":"
+    find_lex $P172, "$/"
+    unless_null $P172, vivify_146
+    new $P172, "Hash"
+  vivify_146:
+    set $P173, $P172["colonpair"]
+    unless_null $P173, vivify_147
+    new $P173, "ResizablePMCArray"
+  vivify_147:
+    set $P174, $P173[0]
+    unless_null $P174, vivify_148
+    new $P174, "Undef"
+  vivify_148:
+    $P175 = $P174."ast"()
+    $S176 = $P175."named"()
+    concat $P177, $P171, $S176
+    concat $P178, $P177, "<"
+.annotate "line", 35
+    find_lex $P179, "$/"
+    unless_null $P179, vivify_149
+    new $P179, "Hash"
+  vivify_149:
+    set $P180, $P179["colonpair"]
+    unless_null $P180, vivify_150
+    new $P180, "ResizablePMCArray"
+  vivify_150:
+    set $P181, $P180[0]
+    unless_null $P181, vivify_151
+    new $P181, "Undef"
+  vivify_151:
+    $P182 = $P181."ast"()
+    $S183 = "colonpair_str"($P182)
+    concat $P184, $P178, $S183
+    concat $P185, $P184, ">"
+    set $P163, $P185
+  if_164_end:
+.annotate "line", 34
+    $P188 = $P162."!make"($P163)
+.annotate "line", 32
+    .return ($P188)
+  control_159:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P189, exception, "payload"
+    .return ($P189)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "comp_unit"  :subid("21_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_194
+.annotate "line", 46
+    new $P193, 'ExceptionHandler'
+    set_addr $P193, control_192
+    $P193."handle_types"(58)
+    push_eh $P193
+    .lex "self", self
+    .lex "$/", param_194
+.annotate "line", 47
+    new $P195, "Undef"
+    .lex "$past", $P195
+.annotate "line", 48
+    new $P196, "Undef"
+    .lex "$BLOCK", $P196
+.annotate "line", 47
+    find_lex $P197, "$/"
+    unless_null $P197, vivify_152
+    new $P197, "Hash"
+  vivify_152:
+    set $P198, $P197["statementlist"]
+    unless_null $P198, vivify_153
+    new $P198, "Undef"
+  vivify_153:
+    $P199 = $P198."ast"()
+    store_lex "$past", $P199
+.annotate "line", 48
+    get_global $P200, "@BLOCK"
+    $P201 = $P200."shift"()
+    store_lex "$BLOCK", $P201
+.annotate "line", 49
+    find_lex $P202, "$BLOCK"
+    find_lex $P203, "$past"
+    $P202."push"($P203)
+.annotate "line", 50
+    find_lex $P204, "$BLOCK"
+    find_lex $P205, "$/"
+    $P204."node"($P205)
+.annotate "line", 51
+    find_lex $P206, "$/"
+    find_lex $P207, "$BLOCK"
+    $P208 = $P206."!make"($P207)
+.annotate "line", 46
+    .return ($P208)
+  control_192:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P209, exception, "payload"
+    .return ($P209)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "statementlist"  :subid("22_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_213
+.annotate "line", 54
+    .const 'Sub' $P227 = "23_1261064035.64813" 
+    capture_lex $P227
+    new $P212, 'ExceptionHandler'
+    set_addr $P212, control_211
+    $P212."handle_types"(58)
+    push_eh $P212
+    .lex "self", self
+    .lex "$/", param_213
+.annotate "line", 55
+    new $P214, "Undef"
+    .lex "$past", $P214
+    get_hll_global $P215, ["PAST"], "Stmts"
+    find_lex $P216, "$/"
+    $P217 = $P215."new"($P216 :named("node"))
+    store_lex "$past", $P217
+.annotate "line", 56
+    find_lex $P219, "$/"
+    unless_null $P219, vivify_154
+    new $P219, "Hash"
+  vivify_154:
+    set $P220, $P219["statement"]
+    unless_null $P220, vivify_155
+    new $P220, "Undef"
+  vivify_155:
+    unless $P220, if_218_end
+.annotate "line", 57
+    find_lex $P222, "$/"
+    unless_null $P222, vivify_156
+    new $P222, "Hash"
+  vivify_156:
+    set $P223, $P222["statement"]
+    unless_null $P223, vivify_157
+    new $P223, "Undef"
+  vivify_157:
+    defined $I224, $P223
+    unless $I224, for_undef_158
+    iter $P221, $P223
+    new $P253, 'ExceptionHandler'
+    set_addr $P253, loop252_handler
+    $P253."handle_types"(65, 67, 66)
+    push_eh $P253
+  loop252_test:
+    unless $P221, loop252_done
+    shift $P225, $P221
+  loop252_redo:
+    .const 'Sub' $P227 = "23_1261064035.64813" 
+    capture_lex $P227
+    $P227($P225)
+  loop252_next:
+    goto loop252_test
+  loop252_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P254, exception, 'type'
+    eq $P254, 65, loop252_next
+    eq $P254, 67, loop252_redo
+  loop252_done:
+    pop_eh 
+  for_undef_158:
+  if_218_end:
+.annotate "line", 66
+    find_lex $P255, "$/"
+    find_lex $P256, "$past"
+    $P257 = $P255."!make"($P256)
+.annotate "line", 54
+    .return ($P257)
+  control_211:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P258, exception, "payload"
+    .return ($P258)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "_block226"  :anon :subid("23_1261064035.64813") :outer("22_1261064035.64813")
+    .param pmc param_229
+.annotate "line", 58
+    new $P228, "Undef"
+    .lex "$ast", $P228
+    .lex "$_", param_229
+    find_lex $P230, "$_"
+    $P231 = $P230."ast"()
+    store_lex "$ast", $P231
+.annotate "line", 59
+    find_lex $P233, "$ast"
+    unless_null $P233, vivify_159
+    new $P233, "Hash"
+  vivify_159:
+    set $P234, $P233["sink"]
+    unless_null $P234, vivify_160
+    new $P234, "Undef"
+  vivify_160:
+    defined $I235, $P234
+    unless $I235, if_232_end
+    find_lex $P236, "$ast"
+    unless_null $P236, vivify_161
+    new $P236, "Hash"
+  vivify_161:
+    set $P237, $P236["sink"]
+    unless_null $P237, vivify_162
+    new $P237, "Undef"
+  vivify_162:
+    store_lex "$ast", $P237
+  if_232_end:
+.annotate "line", 60
+    find_lex $P241, "$ast"
+    get_hll_global $P242, ["PAST"], "Block"
+    $P243 = $P241."isa"($P242)
+    if $P243, if_240
+    set $P239, $P243
+    goto if_240_end
+  if_240:
+    find_lex $P244, "$ast"
+    $P245 = $P244."blocktype"()
+    isfalse $I246, $P245
+    new $P239, 'Integer'
+    set $P239, $I246
+  if_240_end:
+    unless $P239, if_238_end
+.annotate "line", 61
+    find_lex $P247, "$ast"
+    $P248 = "block_immediate"($P247)
+    store_lex "$ast", $P248
+  if_238_end:
+.annotate "line", 63
+    find_lex $P249, "$past"
+    find_lex $P250, "$ast"
+    $P251 = $P249."push"($P250)
+.annotate "line", 57
+    .return ($P251)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "statement"  :subid("24_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_262
+    .param pmc param_263 :optional
+    .param int has_param_263 :opt_flag
+.annotate "line", 69
+    .const 'Sub' $P271 = "25_1261064035.64813" 
+    capture_lex $P271
+    new $P261, 'ExceptionHandler'
+    set_addr $P261, control_260
+    $P261."handle_types"(58)
+    push_eh $P261
+    .lex "self", self
+    .lex "$/", param_262
+    if has_param_263, optparam_163
+    new $P264, "Undef"
+    set param_263, $P264
+  optparam_163:
+    .lex "$key", param_263
+.annotate "line", 70
+    new $P265, "Undef"
+    .lex "$past", $P265
+.annotate "line", 69
+    find_lex $P266, "$past"
+.annotate "line", 71
+    find_lex $P268, "$/"
+    unless_null $P268, vivify_164
+    new $P268, "Hash"
+  vivify_164:
+    set $P269, $P268["EXPR"]
+    unless_null $P269, vivify_165
+    new $P269, "Undef"
+  vivify_165:
+    if $P269, if_267
+.annotate "line", 82
+    find_lex $P309, "$/"
+    unless_null $P309, vivify_166
+    new $P309, "Hash"
+  vivify_166:
+    set $P310, $P309["statement_control"]
+    unless_null $P310, vivify_167
+    new $P310, "Undef"
+  vivify_167:
+    if $P310, if_308
+.annotate "line", 83
+    new $P314, "Integer"
+    assign $P314, 0
+    store_lex "$past", $P314
+    goto if_308_end
+  if_308:
+.annotate "line", 82
+    find_lex $P311, "$/"
+    unless_null $P311, vivify_168
+    new $P311, "Hash"
+  vivify_168:
+    set $P312, $P311["statement_control"]
+    unless_null $P312, vivify_169
+    new $P312, "Undef"
+  vivify_169:
+    $P313 = $P312."ast"()
+    store_lex "$past", $P313
+  if_308_end:
+    goto if_267_end
+  if_267:
+.annotate "line", 71
+    .const 'Sub' $P271 = "25_1261064035.64813" 
+    capture_lex $P271
+    $P271()
+  if_267_end:
+.annotate "line", 84
+    find_lex $P315, "$/"
+    find_lex $P316, "$past"
+    $P317 = $P315."!make"($P316)
+.annotate "line", 69
+    .return ($P317)
+  control_260:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P318, exception, "payload"
+    .return ($P318)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "_block270"  :anon :subid("25_1261064035.64813") :outer("24_1261064035.64813")
+.annotate "line", 72
+    new $P272, "Undef"
+    .lex "$mc", $P272
+.annotate "line", 73
+    new $P273, "Undef"
+    .lex "$ml", $P273
+.annotate "line", 72
+    find_lex $P274, "$/"
+    unless_null $P274, vivify_170
+    new $P274, "Hash"
+  vivify_170:
+    set $P275, $P274["statement_mod_cond"]
+    unless_null $P275, vivify_171
+    new $P275, "ResizablePMCArray"
+  vivify_171:
+    set $P276, $P275[0]
+    unless_null $P276, vivify_172
+    new $P276, "Undef"
+  vivify_172:
+    store_lex "$mc", $P276
+.annotate "line", 73
+    find_lex $P277, "$/"
+    unless_null $P277, vivify_173
+    new $P277, "Hash"
+  vivify_173:
+    set $P278, $P277["statement_mod_loop"]
+    unless_null $P278, vivify_174
+    new $P278, "ResizablePMCArray"
+  vivify_174:
+    set $P279, $P278[0]
+    unless_null $P279, vivify_175
+    new $P279, "Undef"
+  vivify_175:
+    store_lex "$ml", $P279
+.annotate "line", 74
+    find_lex $P280, "$/"
+    unless_null $P280, vivify_176
+    new $P280, "Hash"
+  vivify_176:
+    set $P281, $P280["EXPR"]
+    unless_null $P281, vivify_177
+    new $P281, "Undef"
+  vivify_177:
+    $P282 = $P281."ast"()
+    store_lex "$past", $P282
+.annotate "line", 75
+    find_lex $P284, "$mc"
+    unless $P284, if_283_end
+.annotate "line", 76
+    get_hll_global $P285, ["PAST"], "Op"
+    find_lex $P286, "$mc"
+    unless_null $P286, vivify_178
+    new $P286, "Hash"
+  vivify_178:
+    set $P287, $P286["cond"]
+    unless_null $P287, vivify_179
+    new $P287, "Undef"
+  vivify_179:
+    $P288 = $P287."ast"()
+    find_lex $P289, "$past"
+    find_lex $P290, "$mc"
+    unless_null $P290, vivify_180
+    new $P290, "Hash"
+  vivify_180:
+    set $P291, $P290["sym"]
+    unless_null $P291, vivify_181
+    new $P291, "Undef"
+  vivify_181:
+    set $S292, $P291
+    find_lex $P293, "$/"
+    $P294 = $P285."new"($P288, $P289, $S292 :named("pasttype"), $P293 :named("node"))
+    store_lex "$past", $P294
+  if_283_end:
+.annotate "line", 78
+    find_lex $P297, "$ml"
+    if $P297, if_296
+    set $P295, $P297
+    goto if_296_end
+  if_296:
+.annotate "line", 79
+    get_hll_global $P298, ["PAST"], "Op"
+    find_lex $P299, "$ml"
+    unless_null $P299, vivify_182
+    new $P299, "Hash"
+  vivify_182:
+    set $P300, $P299["cond"]
+    unless_null $P300, vivify_183
+    new $P300, "Undef"
+  vivify_183:
+    $P301 = $P300."ast"()
+    find_lex $P302, "$past"
+    find_lex $P303, "$ml"
+    unless_null $P303, vivify_184
+    new $P303, "Hash"
+  vivify_184:
+    set $P304, $P303["sym"]
+    unless_null $P304, vivify_185
+    new $P304, "Undef"
+  vivify_185:
+    set $S305, $P304
+    find_lex $P306, "$/"
+    $P307 = $P298."new"($P301, $P302, $S305 :named("pasttype"), $P306 :named("node"))
+    store_lex "$past", $P307
+.annotate "line", 78
+    set $P295, $P307
+  if_296_end:
+.annotate "line", 71
+    .return ($P295)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "xblock"  :subid("26_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_322
+.annotate "line", 87
+    new $P321, 'ExceptionHandler'
+    set_addr $P321, control_320
+    $P321."handle_types"(58)
+    push_eh $P321
+    .lex "self", self
+    .lex "$/", param_322
+.annotate "line", 88
+    find_lex $P323, "$/"
+    get_hll_global $P324, ["PAST"], "Op"
+    find_lex $P325, "$/"
+    unless_null $P325, vivify_186
+    new $P325, "Hash"
+  vivify_186:
+    set $P326, $P325["EXPR"]
+    unless_null $P326, vivify_187
+    new $P326, "Undef"
+  vivify_187:
+    $P327 = $P326."ast"()
+    find_lex $P328, "$/"
+    unless_null $P328, vivify_188
+    new $P328, "Hash"
+  vivify_188:
+    set $P329, $P328["pblock"]
+    unless_null $P329, vivify_189
+    new $P329, "Undef"
+  vivify_189:
+    $P330 = $P329."ast"()
+    find_lex $P331, "$/"
+    $P332 = $P324."new"($P327, $P330, "if" :named("pasttype"), $P331 :named("node"))
+    $P333 = $P323."!make"($P332)
+.annotate "line", 87
+    .return ($P333)
+  control_320:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P334, exception, "payload"
+    .return ($P334)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "pblock"  :subid("27_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_338
+.annotate "line", 91
+    new $P337, 'ExceptionHandler'
+    set_addr $P337, control_336
+    $P337."handle_types"(58)
+    push_eh $P337
+    .lex "self", self
+    .lex "$/", param_338
+.annotate "line", 92
+    find_lex $P339, "$/"
+    find_lex $P340, "$/"
+    unless_null $P340, vivify_190
+    new $P340, "Hash"
+  vivify_190:
+    set $P341, $P340["blockoid"]
+    unless_null $P341, vivify_191
+    new $P341, "Undef"
+  vivify_191:
+    $P342 = $P341."ast"()
+    $P343 = $P339."!make"($P342)
+.annotate "line", 91
+    .return ($P343)
+  control_336:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P344, exception, "payload"
+    .return ($P344)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "block"  :subid("28_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_348
+.annotate "line", 95
+    new $P347, 'ExceptionHandler'
+    set_addr $P347, control_346
+    $P347."handle_types"(58)
+    push_eh $P347
+    .lex "self", self
+    .lex "$/", param_348
+.annotate "line", 96
+    find_lex $P349, "$/"
+    find_lex $P350, "$/"
+    unless_null $P350, vivify_192
+    new $P350, "Hash"
+  vivify_192:
+    set $P351, $P350["blockoid"]
+    unless_null $P351, vivify_193
+    new $P351, "Undef"
+  vivify_193:
+    $P352 = $P351."ast"()
+    $P353 = $P349."!make"($P352)
+.annotate "line", 95
+    .return ($P353)
+  control_346:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P354, exception, "payload"
+    .return ($P354)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "blockoid"  :subid("29_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_358
+.annotate "line", 99
+    new $P357, 'ExceptionHandler'
+    set_addr $P357, control_356
+    $P357."handle_types"(58)
+    push_eh $P357
+    .lex "self", self
+    .lex "$/", param_358
+.annotate "line", 100
+    new $P359, "Undef"
+    .lex "$past", $P359
+.annotate "line", 101
+    new $P360, "Undef"
+    .lex "$BLOCK", $P360
+.annotate "line", 100
+    find_lex $P361, "$/"
+    unless_null $P361, vivify_194
+    new $P361, "Hash"
+  vivify_194:
+    set $P362, $P361["statementlist"]
+    unless_null $P362, vivify_195
+    new $P362, "Undef"
+  vivify_195:
+    $P363 = $P362."ast"()
+    store_lex "$past", $P363
+.annotate "line", 101
+    get_global $P364, "@BLOCK"
+    $P365 = $P364."shift"()
+    store_lex "$BLOCK", $P365
+.annotate "line", 102
+    find_lex $P366, "$BLOCK"
+    find_lex $P367, "$past"
+    $P366."push"($P367)
+.annotate "line", 103
+    find_lex $P368, "$BLOCK"
+    find_lex $P369, "$/"
+    $P368."node"($P369)
+.annotate "line", 104
+    find_lex $P370, "$/"
+    find_lex $P371, "$BLOCK"
+    $P372 = $P370."!make"($P371)
+.annotate "line", 99
+    .return ($P372)
+  control_356:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P373, exception, "payload"
+    .return ($P373)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "newpad"  :subid("30_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_377
+.annotate "line", 107
+    new $P376, 'ExceptionHandler'
+    set_addr $P376, control_375
+    $P376."handle_types"(58)
+    push_eh $P376
+    .lex "self", self
+    .lex "$/", param_377
+.annotate "line", 108
+    get_global $P378, "@BLOCK"
+    unless_null $P378, vivify_196
+    new $P378, "ResizablePMCArray"
+    set_global "@BLOCK", $P378
+  vivify_196:
+.annotate "line", 107
+    get_global $P379, "@BLOCK"
+.annotate "line", 109
+    get_global $P380, "@BLOCK"
+    get_hll_global $P381, ["PAST"], "Block"
+    get_hll_global $P382, ["PAST"], "Stmts"
+    $P383 = $P382."new"()
+    $P384 = $P381."new"($P383)
+    $P385 = $P380."unshift"($P384)
+.annotate "line", 107
+    .return ($P385)
+  control_375:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P386, exception, "payload"
+    .return ($P386)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "statement_control:sym<if>"  :subid("31_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_390
+.annotate "line", 114
+    .const 'Sub' $P418 = "32_1261064035.64813" 
+    capture_lex $P418
+    new $P389, 'ExceptionHandler'
+    set_addr $P389, control_388
+    $P389."handle_types"(58)
+    push_eh $P389
+    .lex "self", self
+    .lex "$/", param_390
+.annotate "line", 115
+    new $P391, "Undef"
+    .lex "$count", $P391
+.annotate "line", 116
+    new $P392, "Undef"
+    .lex "$past", $P392
+.annotate "line", 115
+    find_lex $P393, "$/"
+    unless_null $P393, vivify_197
+    new $P393, "Hash"
+  vivify_197:
+    set $P394, $P393["xblock"]
+    unless_null $P394, vivify_198
+    new $P394, "Undef"
+  vivify_198:
+    set $N395, $P394
+    new $P396, 'Float'
+    set $P396, $N395
+    sub $P397, $P396, 1
+    store_lex "$count", $P397
+.annotate "line", 116
+    find_lex $P398, "$count"
+    set $I399, $P398
+    find_lex $P400, "$/"
+    unless_null $P400, vivify_199
+    new $P400, "Hash"
+  vivify_199:
+    set $P401, $P400["xblock"]
+    unless_null $P401, vivify_200
+    new $P401, "ResizablePMCArray"
+  vivify_200:
+    set $P402, $P401[$I399]
+    unless_null $P402, vivify_201
+    new $P402, "Undef"
+  vivify_201:
+    $P403 = $P402."ast"()
+    $P404 = "xblock_immediate"($P403)
+    store_lex "$past", $P404
+.annotate "line", 117
+    find_lex $P406, "$/"
+    unless_null $P406, vivify_202
+    new $P406, "Hash"
+  vivify_202:
+    set $P407, $P406["else"]
+    unless_null $P407, vivify_203
+    new $P407, "Undef"
+  vivify_203:
+    unless $P407, if_405_end
+.annotate "line", 118
+    find_lex $P408, "$past"
+    find_lex $P409, "$/"
+    unless_null $P409, vivify_204
+    new $P409, "Hash"
+  vivify_204:
+    set $P410, $P409["else"]
+    unless_null $P410, vivify_205
+    new $P410, "ResizablePMCArray"
+  vivify_205:
+    set $P411, $P410[0]
+    unless_null $P411, vivify_206
+    new $P411, "Undef"
+  vivify_206:
+    $P412 = $P411."ast"()
+    $P413 = "block_immediate"($P412)
+    $P408."push"($P413)
+  if_405_end:
+.annotate "line", 121
+    new $P434, 'ExceptionHandler'
+    set_addr $P434, loop433_handler
+    $P434."handle_types"(65, 67, 66)
+    push_eh $P434
+  loop433_test:
+    find_lex $P414, "$count"
+    set $N415, $P414
+    isgt $I416, $N415, 0.0
+    unless $I416, loop433_done
+  loop433_redo:
+    .const 'Sub' $P418 = "32_1261064035.64813" 
+    capture_lex $P418
+    $P418()
+  loop433_next:
+    goto loop433_test
+  loop433_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P435, exception, 'type'
+    eq $P435, 65, loop433_next
+    eq $P435, 67, loop433_redo
+  loop433_done:
+    pop_eh 
+.annotate "line", 127
+    find_lex $P436, "$/"
+    find_lex $P437, "$past"
+    $P438 = $P436."!make"($P437)
+.annotate "line", 114
+    .return ($P438)
+  control_388:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P439, exception, "payload"
+    .return ($P439)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "_block417"  :anon :subid("32_1261064035.64813") :outer("31_1261064035.64813")
+.annotate "line", 123
+    new $P419, "Undef"
+    .lex "$else", $P419
+.annotate "line", 121
+    find_lex $P420, "$count"
+    clone $P421, $P420
+    dec $P420
+.annotate "line", 123
+    find_lex $P422, "$past"
+    store_lex "$else", $P422
+.annotate "line", 124
+    find_lex $P423, "$count"
+    set $I424, $P423
+    find_lex $P425, "$/"
+    unless_null $P425, vivify_207
+    new $P425, "Hash"
+  vivify_207:
+    set $P426, $P425["xblock"]
+    unless_null $P426, vivify_208
+    new $P426, "ResizablePMCArray"
+  vivify_208:
+    set $P427, $P426[$I424]
+    unless_null $P427, vivify_209
+    new $P427, "Undef"
+  vivify_209:
+    $P428 = $P427."ast"()
+    $P429 = "xblock_immediate"($P428)
+    store_lex "$past", $P429
+.annotate "line", 125
+    find_lex $P430, "$past"
+    find_lex $P431, "$else"
+    $P432 = $P430."push"($P431)
+.annotate "line", 121
+    .return ($P432)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "statement_control:sym<unless>"  :subid("33_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_443
+.annotate "line", 130
+    new $P442, 'ExceptionHandler'
+    set_addr $P442, control_441
+    $P442."handle_types"(58)
+    push_eh $P442
+    .lex "self", self
+    .lex "$/", param_443
+.annotate "line", 131
+    new $P444, "Undef"
+    .lex "$past", $P444
+    find_lex $P445, "$/"
+    unless_null $P445, vivify_210
+    new $P445, "Hash"
+  vivify_210:
+    set $P446, $P445["xblock"]
+    unless_null $P446, vivify_211
+    new $P446, "Undef"
+  vivify_211:
+    $P447 = $P446."ast"()
+    $P448 = "xblock_immediate"($P447)
+    store_lex "$past", $P448
+.annotate "line", 132
+    find_lex $P449, "$past"
+    $P449."pasttype"("unless")
+.annotate "line", 133
+    find_lex $P450, "$/"
+    find_lex $P451, "$past"
+    $P452 = $P450."!make"($P451)
+.annotate "line", 130
+    .return ($P452)
+  control_441:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P453, exception, "payload"
+    .return ($P453)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "statement_control:sym<while>"  :subid("34_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_457
+.annotate "line", 136
+    new $P456, 'ExceptionHandler'
+    set_addr $P456, control_455
+    $P456."handle_types"(58)
+    push_eh $P456
+    .lex "self", self
+    .lex "$/", param_457
+.annotate "line", 137
+    new $P458, "Undef"
+    .lex "$past", $P458
+    find_lex $P459, "$/"
+    unless_null $P459, vivify_212
+    new $P459, "Hash"
+  vivify_212:
+    set $P460, $P459["xblock"]
+    unless_null $P460, vivify_213
+    new $P460, "Undef"
+  vivify_213:
+    $P461 = $P460."ast"()
+    $P462 = "xblock_immediate"($P461)
+    store_lex "$past", $P462
+.annotate "line", 138
+    find_lex $P463, "$past"
+    find_lex $P464, "$/"
+    unless_null $P464, vivify_214
+    new $P464, "Hash"
+  vivify_214:
+    set $P465, $P464["sym"]
+    unless_null $P465, vivify_215
+    new $P465, "Undef"
+  vivify_215:
+    set $S466, $P465
+    $P463."pasttype"($S466)
+.annotate "line", 139
+    find_lex $P467, "$/"
+    find_lex $P468, "$past"
+    $P469 = $P467."!make"($P468)
+.annotate "line", 136
+    .return ($P469)
+  control_455:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P470, exception, "payload"
+    .return ($P470)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "statement_control:sym<repeat>"  :subid("35_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_474
+.annotate "line", 142
+    new $P473, 'ExceptionHandler'
+    set_addr $P473, control_472
+    $P473."handle_types"(58)
+    push_eh $P473
+    .lex "self", self
+    .lex "$/", param_474
+.annotate "line", 143
+    new $P475, "Undef"
+    .lex "$pasttype", $P475
+.annotate "line", 144
+    new $P476, "Undef"
+    .lex "$past", $P476
+.annotate "line", 143
+    new $P477, "String"
+    assign $P477, "repeat_"
+    find_lex $P478, "$/"
+    unless_null $P478, vivify_216
+    new $P478, "Hash"
+  vivify_216:
+    set $P479, $P478["wu"]
+    unless_null $P479, vivify_217
+    new $P479, "Undef"
+  vivify_217:
+    set $S480, $P479
+    concat $P481, $P477, $S480
+    store_lex "$pasttype", $P481
+    find_lex $P482, "$past"
+.annotate "line", 145
+    find_lex $P484, "$/"
+    unless_null $P484, vivify_218
+    new $P484, "Hash"
+  vivify_218:
+    set $P485, $P484["xblock"]
+    unless_null $P485, vivify_219
+    new $P485, "Undef"
+  vivify_219:
+    if $P485, if_483
+.annotate "line", 150
+    get_hll_global $P492, ["PAST"], "Op"
+    find_lex $P493, "$/"
+    unless_null $P493, vivify_220
+    new $P493, "Hash"
+  vivify_220:
+    set $P494, $P493["EXPR"]
+    unless_null $P494, vivify_221
+    new $P494, "Undef"
+  vivify_221:
+    $P495 = $P494."ast"()
+    find_lex $P496, "$/"
+    unless_null $P496, vivify_222
+    new $P496, "Hash"
+  vivify_222:
+    set $P497, $P496["pblock"]
+    unless_null $P497, vivify_223
+    new $P497, "Undef"
+  vivify_223:
+    $P498 = $P497."ast"()
+    $P499 = "block_immediate"($P498)
+    find_lex $P500, "$pasttype"
+    find_lex $P501, "$/"
+    $P502 = $P492."new"($P495, $P499, $P500 :named("pasttype"), $P501 :named("node"))
+    store_lex "$past", $P502
+.annotate "line", 149
+    goto if_483_end
+  if_483:
+.annotate "line", 146
+    find_lex $P486, "$/"
+    unless_null $P486, vivify_224
+    new $P486, "Hash"
+  vivify_224:
+    set $P487, $P486["xblock"]
+    unless_null $P487, vivify_225
+    new $P487, "Undef"
+  vivify_225:
+    $P488 = $P487."ast"()
+    $P489 = "xblock_immediate"($P488)
+    store_lex "$past", $P489
+.annotate "line", 147
+    find_lex $P490, "$past"
+    find_lex $P491, "$pasttype"
+    $P490."pasttype"($P491)
+  if_483_end:
+.annotate "line", 153
+    find_lex $P503, "$/"
+    find_lex $P504, "$past"
+    $P505 = $P503."!make"($P504)
+.annotate "line", 142
+    .return ($P505)
+  control_472:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P506, exception, "payload"
+    .return ($P506)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "statement_control:sym<for>"  :subid("36_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_510
+.annotate "line", 156
+    new $P509, 'ExceptionHandler'
+    set_addr $P509, control_508
+    $P509."handle_types"(58)
+    push_eh $P509
+    .lex "self", self
+    .lex "$/", param_510
+.annotate "line", 157
+    new $P511, "Undef"
+    .lex "$past", $P511
+.annotate "line", 159
+    new $P512, "Undef"
+    .lex "$block", $P512
+.annotate "line", 157
+    find_lex $P513, "$/"
+    unless_null $P513, vivify_226
+    new $P513, "Hash"
+  vivify_226:
+    set $P514, $P513["xblock"]
+    unless_null $P514, vivify_227
+    new $P514, "Undef"
+  vivify_227:
+    $P515 = $P514."ast"()
+    store_lex "$past", $P515
+.annotate "line", 158
+    find_lex $P516, "$past"
+    $P516."pasttype"("for")
+.annotate "line", 159
+    find_lex $P517, "$past"
+    unless_null $P517, vivify_228
+    new $P517, "ResizablePMCArray"
+  vivify_228:
+    set $P518, $P517[1]
+    unless_null $P518, vivify_229
+    new $P518, "Undef"
+  vivify_229:
+    store_lex "$block", $P518
+.annotate "line", 160
+    find_lex $P520, "$block"
+    $P521 = $P520."arity"()
+    if $P521, unless_519_end
+.annotate "line", 161
+    find_lex $P522, "$block"
+    unless_null $P522, vivify_230
+    new $P522, "ResizablePMCArray"
+  vivify_230:
+    set $P523, $P522[0]
+    unless_null $P523, vivify_231
+    new $P523, "Undef"
+  vivify_231:
+    get_hll_global $P524, ["PAST"], "Var"
+    $P525 = $P524."new"("$_" :named("name"), "parameter" :named("scope"))
+    $P523."push"($P525)
+.annotate "line", 162
+    find_lex $P526, "$block"
+    $P526."symbol"("$_", "lexical" :named("scope"))
+.annotate "line", 163
+    find_lex $P527, "$block"
+    $P527."arity"(1)
+  unless_519_end:
+.annotate "line", 165
+    find_lex $P528, "$block"
+    $P528."blocktype"("immediate")
+.annotate "line", 166
+    find_lex $P529, "$/"
+    find_lex $P530, "$past"
+    $P531 = $P529."!make"($P530)
+.annotate "line", 156
+    .return ($P531)
+  control_508:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P532, exception, "payload"
+    .return ($P532)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "statement_control:sym<return>"  :subid("37_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_536
+.annotate "line", 169
+    new $P535, 'ExceptionHandler'
+    set_addr $P535, control_534
+    $P535."handle_types"(58)
+    push_eh $P535
+    .lex "self", self
+    .lex "$/", param_536
+.annotate "line", 170
+    find_lex $P537, "$/"
+    get_hll_global $P538, ["PAST"], "Op"
+    find_lex $P539, "$/"
+    unless_null $P539, vivify_232
+    new $P539, "Hash"
+  vivify_232:
+    set $P540, $P539["EXPR"]
+    unless_null $P540, vivify_233
+    new $P540, "Undef"
+  vivify_233:
+    $P541 = $P540."ast"()
+    find_lex $P542, "$/"
+    $P543 = $P538."new"($P541, "return" :named("pasttype"), $P542 :named("node"))
+    $P544 = $P537."!make"($P543)
+.annotate "line", 169
+    .return ($P544)
+  control_534:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P545, exception, "payload"
+    .return ($P545)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "statement_control:sym<CATCH>"  :subid("38_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_549
+.annotate "line", 173
+    new $P548, 'ExceptionHandler'
+    set_addr $P548, control_547
+    $P548."handle_types"(58)
+    push_eh $P548
+    .lex "self", self
+    .lex "$/", param_549
+.annotate "line", 174
+    new $P550, "Undef"
+    .lex "$block", $P550
+    find_lex $P551, "$/"
+    unless_null $P551, vivify_234
+    new $P551, "Hash"
+  vivify_234:
+    set $P552, $P551["block"]
+    unless_null $P552, vivify_235
+    new $P552, "Undef"
+  vivify_235:
+    $P553 = $P552."ast"()
+    store_lex "$block", $P553
+.annotate "line", 175
+    find_lex $P554, "$/"
+    find_lex $P555, "$block"
+    "push_block_handler"($P554, $P555)
+.annotate "line", 176
+    get_global $P556, "@BLOCK"
+    unless_null $P556, vivify_236
+    new $P556, "ResizablePMCArray"
+  vivify_236:
+    set $P557, $P556[0]
+    unless_null $P557, vivify_237
+    new $P557, "Undef"
+  vivify_237:
+    $P558 = $P557."handlers"()
+    set $P559, $P558[0]
+    unless_null $P559, vivify_238
+    new $P559, "Undef"
+  vivify_238:
+    $P559."handle_types_except"("CONTROL")
+.annotate "line", 177
+    find_lex $P560, "$/"
+    get_hll_global $P561, ["PAST"], "Stmts"
+    find_lex $P562, "$/"
+    $P563 = $P561."new"($P562 :named("node"))
+    $P564 = $P560."!make"($P563)
+.annotate "line", 173
+    .return ($P564)
+  control_547:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P565, exception, "payload"
+    .return ($P565)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "statement_control:sym<CONTROL>"  :subid("39_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_569
+.annotate "line", 180
+    new $P568, 'ExceptionHandler'
+    set_addr $P568, control_567
+    $P568."handle_types"(58)
+    push_eh $P568
+    .lex "self", self
+    .lex "$/", param_569
+.annotate "line", 181
+    new $P570, "Undef"
+    .lex "$block", $P570
+    find_lex $P571, "$/"
+    unless_null $P571, vivify_239
+    new $P571, "Hash"
+  vivify_239:
+    set $P572, $P571["block"]
+    unless_null $P572, vivify_240
+    new $P572, "Undef"
+  vivify_240:
+    $P573 = $P572."ast"()
+    store_lex "$block", $P573
+.annotate "line", 182
+    find_lex $P574, "$/"
+    find_lex $P575, "$block"
+    "push_block_handler"($P574, $P575)
+.annotate "line", 183
+    get_global $P576, "@BLOCK"
+    unless_null $P576, vivify_241
+    new $P576, "ResizablePMCArray"
+  vivify_241:
+    set $P577, $P576[0]
+    unless_null $P577, vivify_242
+    new $P577, "Undef"
+  vivify_242:
+    $P578 = $P577."handlers"()
+    set $P579, $P578[0]
+    unless_null $P579, vivify_243
+    new $P579, "Undef"
+  vivify_243:
+    $P579."handle_types"("CONTROL")
+.annotate "line", 184
+    find_lex $P580, "$/"
+    get_hll_global $P581, ["PAST"], "Stmts"
+    find_lex $P582, "$/"
+    $P583 = $P581."new"($P582 :named("node"))
+    $P584 = $P580."!make"($P583)
+.annotate "line", 180
+    .return ($P584)
+  control_567:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P585, exception, "payload"
+    .return ($P585)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "statement_prefix:sym<INIT>"  :subid("40_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_590
+.annotate "line", 224
+    new $P589, 'ExceptionHandler'
+    set_addr $P589, control_588
+    $P589."handle_types"(58)
+    push_eh $P589
+    .lex "self", self
+    .lex "$/", param_590
+.annotate "line", 225
+    get_global $P591, "@BLOCK"
+    unless_null $P591, vivify_244
+    new $P591, "ResizablePMCArray"
+  vivify_244:
+    set $P592, $P591[0]
+    unless_null $P592, vivify_245
+    new $P592, "Undef"
+  vivify_245:
+    $P593 = $P592."loadinit"()
+    find_lex $P594, "$/"
+    unless_null $P594, vivify_246
+    new $P594, "Hash"
+  vivify_246:
+    set $P595, $P594["blorst"]
+    unless_null $P595, vivify_247
+    new $P595, "Undef"
+  vivify_247:
+    $P596 = $P595."ast"()
+    $P593."push"($P596)
+.annotate "line", 226
+    find_lex $P597, "$/"
+    get_hll_global $P598, ["PAST"], "Stmts"
+    find_lex $P599, "$/"
+    $P600 = $P598."new"($P599 :named("node"))
+    $P601 = $P597."!make"($P600)
+.annotate "line", 224
+    .return ($P601)
+  control_588:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P602, exception, "payload"
+    .return ($P602)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "statement_prefix:sym<try>"  :subid("41_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_606
+.annotate "line", 229
+    new $P605, 'ExceptionHandler'
+    set_addr $P605, control_604
+    $P605."handle_types"(58)
+    push_eh $P605
+    .lex "self", self
+    .lex "$/", param_606
+.annotate "line", 230
+    new $P607, "Undef"
+    .lex "$past", $P607
+    find_lex $P608, "$/"
+    unless_null $P608, vivify_248
+    new $P608, "Hash"
+  vivify_248:
+    set $P609, $P608["blorst"]
+    unless_null $P609, vivify_249
+    new $P609, "Undef"
+  vivify_249:
+    $P610 = $P609."ast"()
+    store_lex "$past", $P610
+.annotate "line", 231
+    find_lex $P612, "$past"
+    $S613 = $P612."WHAT"()
+    isne $I614, $S613, "PAST::Block()"
+    unless $I614, if_611_end
+.annotate "line", 232
+    get_hll_global $P615, ["PAST"], "Block"
+    find_lex $P616, "$past"
+    find_lex $P617, "$/"
+    $P618 = $P615."new"($P616, "immediate" :named("blocktype"), $P617 :named("node"))
+    store_lex "$past", $P618
+  if_611_end:
+.annotate "line", 234
+    find_lex $P620, "$past"
+    $P621 = $P620."handlers"()
+    if $P621, unless_619_end
+.annotate "line", 235
+    find_lex $P622, "$past"
+    get_hll_global $P623, ["PAST"], "Control"
+.annotate "line", 237
+    get_hll_global $P624, ["PAST"], "Stmts"
+.annotate "line", 238
+    get_hll_global $P625, ["PAST"], "Op"
+.annotate "line", 239
+    get_hll_global $P626, ["PAST"], "Var"
+.annotate "line", 240
+    get_hll_global $P627, ["PAST"], "Var"
+    $P628 = $P627."new"("register" :named("scope"), "exception" :named("name"))
+    $P629 = $P626."new"($P628, "handled", "keyed" :named("scope"))
+.annotate "line", 239
+    $P630 = $P625."new"($P629, 1, "bind" :named("pasttype"))
+.annotate "line", 238
+    $P631 = $P624."new"($P630)
+.annotate "line", 237
+    $P632 = $P623."new"($P631, "CONTROL" :named("handle_types_except"))
+.annotate "line", 235
+    new $P633, "ResizablePMCArray"
+    push $P633, $P632
+    $P622."handlers"($P633)
+  unless_619_end:
+.annotate "line", 249
+    find_lex $P634, "$/"
+    find_lex $P635, "$past"
+    $P636 = $P634."!make"($P635)
+.annotate "line", 229
+    .return ($P636)
+  control_604:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P637, exception, "payload"
+    .return ($P637)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "blorst"  :subid("42_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_641
+.annotate "line", 252
+    new $P640, 'ExceptionHandler'
+    set_addr $P640, control_639
+    $P640."handle_types"(58)
+    push_eh $P640
+    .lex "self", self
+    .lex "$/", param_641
+.annotate "line", 253
+    find_lex $P642, "$/"
+.annotate "line", 254
+    find_lex $P645, "$/"
+    unless_null $P645, vivify_250
+    new $P645, "Hash"
+  vivify_250:
+    set $P646, $P645["block"]
+    unless_null $P646, vivify_251
+    new $P646, "Undef"
+  vivify_251:
+    if $P646, if_644
+.annotate "line", 255
+    find_lex $P651, "$/"
+    unless_null $P651, vivify_252
+    new $P651, "Hash"
+  vivify_252:
+    set $P652, $P651["statement"]
+    unless_null $P652, vivify_253
+    new $P652, "Undef"
+  vivify_253:
+    $P653 = $P652."ast"()
+    set $P643, $P653
+.annotate "line", 254
+    goto if_644_end
+  if_644:
+    find_lex $P647, "$/"
+    unless_null $P647, vivify_254
+    new $P647, "Hash"
+  vivify_254:
+    set $P648, $P647["block"]
+    unless_null $P648, vivify_255
+    new $P648, "Undef"
+  vivify_255:
+    $P649 = $P648."ast"()
+    $P650 = "block_immediate"($P649)
+    set $P643, $P650
+  if_644_end:
+    $P654 = $P642."!make"($P643)
+.annotate "line", 252
+    .return ($P654)
+  control_639:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P655, exception, "payload"
+    .return ($P655)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "statement_mod_cond:sym<if>"  :subid("43_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_659
+.annotate "line", 260
+    new $P658, 'ExceptionHandler'
+    set_addr $P658, control_657
+    $P658."handle_types"(58)
+    push_eh $P658
+    .lex "self", self
+    .lex "$/", param_659
+    find_lex $P660, "$/"
+    find_lex $P661, "$/"
+    unless_null $P661, vivify_256
+    new $P661, "Hash"
+  vivify_256:
+    set $P662, $P661["cond"]
+    unless_null $P662, vivify_257
+    new $P662, "Undef"
+  vivify_257:
+    $P663 = $P662."ast"()
+    $P664 = $P660."!make"($P663)
+    .return ($P664)
+  control_657:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P665, exception, "payload"
+    .return ($P665)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "statement_mod_cond:sym<unless>"  :subid("44_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_669
+.annotate "line", 261
+    new $P668, 'ExceptionHandler'
+    set_addr $P668, control_667
+    $P668."handle_types"(58)
+    push_eh $P668
+    .lex "self", self
+    .lex "$/", param_669
+    find_lex $P670, "$/"
+    find_lex $P671, "$/"
+    unless_null $P671, vivify_258
+    new $P671, "Hash"
+  vivify_258:
+    set $P672, $P671["cond"]
+    unless_null $P672, vivify_259
+    new $P672, "Undef"
+  vivify_259:
+    $P673 = $P672."ast"()
+    $P674 = $P670."!make"($P673)
+    .return ($P674)
+  control_667:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P675, exception, "payload"
+    .return ($P675)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "statement_mod_loop:sym<while>"  :subid("45_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_679
+.annotate "line", 263
+    new $P678, 'ExceptionHandler'
+    set_addr $P678, control_677
+    $P678."handle_types"(58)
+    push_eh $P678
+    .lex "self", self
+    .lex "$/", param_679
+    find_lex $P680, "$/"
+    find_lex $P681, "$/"
+    unless_null $P681, vivify_260
+    new $P681, "Hash"
+  vivify_260:
+    set $P682, $P681["cond"]
+    unless_null $P682, vivify_261
+    new $P682, "Undef"
+  vivify_261:
+    $P683 = $P682."ast"()
+    $P684 = $P680."!make"($P683)
+    .return ($P684)
+  control_677:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P685, exception, "payload"
+    .return ($P685)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "statement_mod_loop:sym<until>"  :subid("46_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_689
+.annotate "line", 264
+    new $P688, 'ExceptionHandler'
+    set_addr $P688, control_687
+    $P688."handle_types"(58)
+    push_eh $P688
+    .lex "self", self
+    .lex "$/", param_689
+    find_lex $P690, "$/"
+    find_lex $P691, "$/"
+    unless_null $P691, vivify_262
+    new $P691, "Hash"
+  vivify_262:
+    set $P692, $P691["cond"]
+    unless_null $P692, vivify_263
+    new $P692, "Undef"
+  vivify_263:
+    $P693 = $P692."ast"()
+    $P694 = $P690."!make"($P693)
+    .return ($P694)
+  control_687:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P695, exception, "payload"
+    .return ($P695)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "term:sym<fatarrow>"  :subid("47_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_699
+.annotate "line", 268
+    new $P698, 'ExceptionHandler'
+    set_addr $P698, control_697
+    $P698."handle_types"(58)
+    push_eh $P698
+    .lex "self", self
+    .lex "$/", param_699
+    find_lex $P700, "$/"
+    find_lex $P701, "$/"
+    unless_null $P701, vivify_264
+    new $P701, "Hash"
+  vivify_264:
+    set $P702, $P701["fatarrow"]
+    unless_null $P702, vivify_265
+    new $P702, "Undef"
+  vivify_265:
+    $P703 = $P702."ast"()
+    $P704 = $P700."!make"($P703)
+    .return ($P704)
+  control_697:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P705, exception, "payload"
+    .return ($P705)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "term:sym<colonpair>"  :subid("48_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_709
+.annotate "line", 269
+    new $P708, 'ExceptionHandler'
+    set_addr $P708, control_707
+    $P708."handle_types"(58)
+    push_eh $P708
+    .lex "self", self
+    .lex "$/", param_709
+    find_lex $P710, "$/"
+    find_lex $P711, "$/"
+    unless_null $P711, vivify_266
+    new $P711, "Hash"
+  vivify_266:
+    set $P712, $P711["colonpair"]
+    unless_null $P712, vivify_267
+    new $P712, "Undef"
+  vivify_267:
+    $P713 = $P712."ast"()
+    $P714 = $P710."!make"($P713)
+    .return ($P714)
+  control_707:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P715, exception, "payload"
+    .return ($P715)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "term:sym<variable>"  :subid("49_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_719
+.annotate "line", 270
+    new $P718, 'ExceptionHandler'
+    set_addr $P718, control_717
+    $P718."handle_types"(58)
+    push_eh $P718
+    .lex "self", self
+    .lex "$/", param_719
+    find_lex $P720, "$/"
+    find_lex $P721, "$/"
+    unless_null $P721, vivify_268
+    new $P721, "Hash"
+  vivify_268:
+    set $P722, $P721["variable"]
+    unless_null $P722, vivify_269
+    new $P722, "Undef"
+  vivify_269:
+    $P723 = $P722."ast"()
+    $P724 = $P720."!make"($P723)
+    .return ($P724)
+  control_717:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P725, exception, "payload"
+    .return ($P725)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "term:sym<package_declarator>"  :subid("50_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_729
+.annotate "line", 271
+    new $P728, 'ExceptionHandler'
+    set_addr $P728, control_727
+    $P728."handle_types"(58)
+    push_eh $P728
+    .lex "self", self
+    .lex "$/", param_729
+    find_lex $P730, "$/"
+    find_lex $P731, "$/"
+    unless_null $P731, vivify_270
+    new $P731, "Hash"
+  vivify_270:
+    set $P732, $P731["package_declarator"]
+    unless_null $P732, vivify_271
+    new $P732, "Undef"
+  vivify_271:
+    $P733 = $P732."ast"()
+    $P734 = $P730."!make"($P733)
+    .return ($P734)
+  control_727:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P735, exception, "payload"
+    .return ($P735)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "term:sym<scope_declarator>"  :subid("51_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_739
+.annotate "line", 272
+    new $P738, 'ExceptionHandler'
+    set_addr $P738, control_737
+    $P738."handle_types"(58)
+    push_eh $P738
+    .lex "self", self
+    .lex "$/", param_739
+    find_lex $P740, "$/"
+    find_lex $P741, "$/"
+    unless_null $P741, vivify_272
+    new $P741, "Hash"
+  vivify_272:
+    set $P742, $P741["scope_declarator"]
+    unless_null $P742, vivify_273
+    new $P742, "Undef"
+  vivify_273:
+    $P743 = $P742."ast"()
+    $P744 = $P740."!make"($P743)
+    .return ($P744)
+  control_737:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P745, exception, "payload"
+    .return ($P745)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "term:sym<routine_declarator>"  :subid("52_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_749
+.annotate "line", 273
+    new $P748, 'ExceptionHandler'
+    set_addr $P748, control_747
+    $P748."handle_types"(58)
+    push_eh $P748
+    .lex "self", self
+    .lex "$/", param_749
+    find_lex $P750, "$/"
+    find_lex $P751, "$/"
+    unless_null $P751, vivify_274
+    new $P751, "Hash"
+  vivify_274:
+    set $P752, $P751["routine_declarator"]
+    unless_null $P752, vivify_275
+    new $P752, "Undef"
+  vivify_275:
+    $P753 = $P752."ast"()
+    $P754 = $P750."!make"($P753)
+    .return ($P754)
+  control_747:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P755, exception, "payload"
+    .return ($P755)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "term:sym<regex_declarator>"  :subid("53_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_759
+.annotate "line", 274
+    new $P758, 'ExceptionHandler'
+    set_addr $P758, control_757
+    $P758."handle_types"(58)
+    push_eh $P758
+    .lex "self", self
+    .lex "$/", param_759
+    find_lex $P760, "$/"
+    find_lex $P761, "$/"
+    unless_null $P761, vivify_276
+    new $P761, "Hash"
+  vivify_276:
+    set $P762, $P761["regex_declarator"]
+    unless_null $P762, vivify_277
+    new $P762, "Undef"
+  vivify_277:
+    $P763 = $P762."ast"()
+    $P764 = $P760."!make"($P763)
+    .return ($P764)
+  control_757:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P765, exception, "payload"
+    .return ($P765)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "term:sym<statement_prefix>"  :subid("54_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_769
+.annotate "line", 275
+    new $P768, 'ExceptionHandler'
+    set_addr $P768, control_767
+    $P768."handle_types"(58)
+    push_eh $P768
+    .lex "self", self
+    .lex "$/", param_769
+    find_lex $P770, "$/"
+    find_lex $P771, "$/"
+    unless_null $P771, vivify_278
+    new $P771, "Hash"
+  vivify_278:
+    set $P772, $P771["statement_prefix"]
+    unless_null $P772, vivify_279
+    new $P772, "Undef"
+  vivify_279:
+    $P773 = $P772."ast"()
+    $P774 = $P770."!make"($P773)
+    .return ($P774)
+  control_767:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P775, exception, "payload"
+    .return ($P775)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "term:sym<lambda>"  :subid("55_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_779
+.annotate "line", 276
+    new $P778, 'ExceptionHandler'
+    set_addr $P778, control_777
+    $P778."handle_types"(58)
+    push_eh $P778
+    .lex "self", self
+    .lex "$/", param_779
+    find_lex $P780, "$/"
+    find_lex $P781, "$/"
+    unless_null $P781, vivify_280
+    new $P781, "Hash"
+  vivify_280:
+    set $P782, $P781["pblock"]
+    unless_null $P782, vivify_281
+    new $P782, "Undef"
+  vivify_281:
+    $P783 = $P782."ast"()
+    $P784 = $P780."!make"($P783)
+    .return ($P784)
+  control_777:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P785, exception, "payload"
+    .return ($P785)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "fatarrow"  :subid("56_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_789
+.annotate "line", 278
+    new $P788, 'ExceptionHandler'
+    set_addr $P788, control_787
+    $P788."handle_types"(58)
+    push_eh $P788
+    .lex "self", self
+    .lex "$/", param_789
+.annotate "line", 279
+    new $P790, "Undef"
+    .lex "$past", $P790
+    find_lex $P791, "$/"
+    unless_null $P791, vivify_282
+    new $P791, "Hash"
+  vivify_282:
+    set $P792, $P791["val"]
+    unless_null $P792, vivify_283
+    new $P792, "Undef"
+  vivify_283:
+    $P793 = $P792."ast"()
+    store_lex "$past", $P793
+.annotate "line", 280
+    find_lex $P794, "$past"
+    find_lex $P795, "$/"
+    unless_null $P795, vivify_284
+    new $P795, "Hash"
+  vivify_284:
+    set $P796, $P795["key"]
+    unless_null $P796, vivify_285
+    new $P796, "Undef"
+  vivify_285:
+    $P797 = $P796."Str"()
+    $P794."named"($P797)
+.annotate "line", 281
+    find_lex $P798, "$/"
+    find_lex $P799, "$past"
+    $P800 = $P798."!make"($P799)
+.annotate "line", 278
+    .return ($P800)
+  control_787:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P801, exception, "payload"
+    .return ($P801)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "colonpair"  :subid("57_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_805
+.annotate "line", 284
+    new $P804, 'ExceptionHandler'
+    set_addr $P804, control_803
+    $P804."handle_types"(58)
+    push_eh $P804
+    .lex "self", self
+    .lex "$/", param_805
+.annotate "line", 285
+    new $P806, "Undef"
+    .lex "$past", $P806
+.annotate "line", 286
+    find_lex $P809, "$/"
+    unless_null $P809, vivify_286
+    new $P809, "Hash"
+  vivify_286:
+    set $P810, $P809["circumfix"]
+    unless_null $P810, vivify_287
+    new $P810, "Undef"
+  vivify_287:
+    if $P810, if_808
+.annotate "line", 287
+    get_hll_global $P815, ["PAST"], "Val"
+    find_lex $P816, "$/"
+    unless_null $P816, vivify_288
+    new $P816, "Hash"
+  vivify_288:
+    set $P817, $P816["not"]
+    unless_null $P817, vivify_289
+    new $P817, "Undef"
+  vivify_289:
+    isfalse $I818, $P817
+    $P819 = $P815."new"($I818 :named("value"))
+    set $P807, $P819
+.annotate "line", 286
+    goto if_808_end
+  if_808:
+    find_lex $P811, "$/"
+    unless_null $P811, vivify_290
+    new $P811, "Hash"
+  vivify_290:
+    set $P812, $P811["circumfix"]
+    unless_null $P812, vivify_291
+    new $P812, "ResizablePMCArray"
+  vivify_291:
+    set $P813, $P812[0]
+    unless_null $P813, vivify_292
+    new $P813, "Undef"
+  vivify_292:
+    $P814 = $P813."ast"()
+    set $P807, $P814
+  if_808_end:
+    store_lex "$past", $P807
+.annotate "line", 288
+    find_lex $P820, "$past"
+    find_lex $P821, "$/"
+    unless_null $P821, vivify_293
+    new $P821, "Hash"
+  vivify_293:
+    set $P822, $P821["identifier"]
+    unless_null $P822, vivify_294
+    new $P822, "Undef"
+  vivify_294:
+    set $S823, $P822
+    $P820."named"($S823)
+.annotate "line", 289
+    find_lex $P824, "$/"
+    find_lex $P825, "$past"
+    $P826 = $P824."!make"($P825)
+.annotate "line", 284
+    .return ($P826)
+  control_803:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P827, exception, "payload"
+    .return ($P827)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "variable"  :subid("58_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_831
+.annotate "line", 292
+    .const 'Sub' $P844 = "59_1261064035.64813" 
+    capture_lex $P844
+    new $P830, 'ExceptionHandler'
+    set_addr $P830, control_829
+    $P830."handle_types"(58)
+    push_eh $P830
+    .lex "self", self
+    .lex "$/", param_831
+.annotate "line", 293
+    new $P832, "Undef"
+    .lex "$past", $P832
+.annotate "line", 292
+    find_lex $P833, "$past"
+.annotate "line", 294
+    find_lex $P835, "$/"
+    unless_null $P835, vivify_295
+    new $P835, "Hash"
+  vivify_295:
+    set $P836, $P835["postcircumfix"]
+    unless_null $P836, vivify_296
+    new $P836, "Undef"
+  vivify_296:
+    if $P836, if_834
+.annotate "line", 298
+    .const 'Sub' $P844 = "59_1261064035.64813" 
+    capture_lex $P844
+    $P844()
+    goto if_834_end
+  if_834:
+.annotate "line", 295
+    find_lex $P837, "$/"
+    unless_null $P837, vivify_313
+    new $P837, "Hash"
+  vivify_313:
+    set $P838, $P837["postcircumfix"]
+    unless_null $P838, vivify_314
+    new $P838, "Undef"
+  vivify_314:
+    $P839 = $P838."ast"()
+    store_lex "$past", $P839
+.annotate "line", 296
+    find_lex $P840, "$past"
+    get_hll_global $P841, ["PAST"], "Var"
+    $P842 = $P841."new"("$/" :named("name"))
+    $P840."unshift"($P842)
+  if_834_end:
+.annotate "line", 327
+    find_lex $P913, "$/"
+    find_lex $P914, "$past"
+    $P915 = $P913."!make"($P914)
+.annotate "line", 292
+    .return ($P915)
+  control_829:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P916, exception, "payload"
+    .return ($P916)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "_block843"  :anon :subid("59_1261064035.64813") :outer("58_1261064035.64813")
+.annotate "line", 299
+    new $P845, "ResizablePMCArray"
+    .lex "@name", $P845
+    get_hll_global $P846, ["NQP"], "Compiler"
+    find_lex $P847, "$/"
+    set $S848, $P847
+    $P849 = $P846."parse_name"($S848)
+    store_lex "@name", $P849
+.annotate "line", 300
+    get_hll_global $P850, ["PAST"], "Var"
+    find_lex $P851, "@name"
+    $P852 = $P851."pop"()
+    set $S853, $P852
+    $P854 = $P850."new"($S853 :named("name"))
+    store_lex "$past", $P854
+.annotate "line", 301
+    find_lex $P856, "@name"
+    unless $P856, if_855_end
+.annotate "line", 302
+    find_lex $P858, "@name"
+    unless_null $P858, vivify_297
+    new $P858, "ResizablePMCArray"
+  vivify_297:
+    set $P859, $P858[0]
+    unless_null $P859, vivify_298
+    new $P859, "Undef"
+  vivify_298:
+    set $S860, $P859
+    iseq $I861, $S860, "GLOBAL"
+    unless $I861, if_857_end
+    find_lex $P862, "@name"
+    $P862."shift"()
+  if_857_end:
+.annotate "line", 303
+    find_lex $P863, "$past"
+    find_lex $P864, "@name"
+    $P863."namespace"($P864)
+.annotate "line", 304
+    find_lex $P865, "$past"
+    $P865."scope"("package")
+.annotate "line", 305
+    find_lex $P866, "$past"
+    find_lex $P867, "$/"
+    unless_null $P867, vivify_299
+    new $P867, "Hash"
+  vivify_299:
+    set $P868, $P867["sigil"]
+    unless_null $P868, vivify_300
+    new $P868, "Undef"
+  vivify_300:
+    $P869 = "sigiltype"($P868)
+    $P866."viviself"($P869)
+.annotate "line", 306
+    find_lex $P870, "$past"
+    $P870."lvalue"(1)
+  if_855_end:
+.annotate "line", 308
+    find_lex $P873, "$/"
+    unless_null $P873, vivify_301
+    new $P873, "Hash"
+  vivify_301:
+    set $P874, $P873["twigil"]
+    unless_null $P874, vivify_302
+    new $P874, "ResizablePMCArray"
+  vivify_302:
+    set $P875, $P874[0]
+    unless_null $P875, vivify_303
+    new $P875, "Undef"
+  vivify_303:
+    set $S876, $P875
+    iseq $I877, $S876, "*"
+    if $I877, if_872
+.annotate "line", 321
+    find_lex $P899, "$/"
+    unless_null $P899, vivify_304
+    new $P899, "Hash"
+  vivify_304:
+    set $P900, $P899["twigil"]
+    unless_null $P900, vivify_305
+    new $P900, "ResizablePMCArray"
+  vivify_305:
+    set $P901, $P900[0]
+    unless_null $P901, vivify_306
+    new $P901, "Undef"
+  vivify_306:
+    set $S902, $P901
+    iseq $I903, $S902, "!"
+    if $I903, if_898
+    new $P897, 'Integer'
+    set $P897, $I903
+    goto if_898_end
+  if_898:
+.annotate "line", 322
+    find_lex $P904, "$past"
+    get_hll_global $P905, ["PAST"], "Var"
+    $P906 = $P905."new"("self" :named("name"))
+    $P904."push"($P906)
+.annotate "line", 323
+    find_lex $P907, "$past"
+    $P907."scope"("attribute")
+.annotate "line", 324
+    find_lex $P908, "$past"
+    find_lex $P909, "$/"
+    unless_null $P909, vivify_307
+    new $P909, "Hash"
+  vivify_307:
+    set $P910, $P909["sigil"]
+    unless_null $P910, vivify_308
+    new $P910, "Undef"
+  vivify_308:
+    $P911 = "sigiltype"($P910)
+    $P912 = $P908."viviself"($P911)
+.annotate "line", 321
+    set $P897, $P912
+  if_898_end:
+    set $P871, $P897
+.annotate "line", 308
+    goto if_872_end
+  if_872:
+.annotate "line", 309
+    find_lex $P878, "$past"
+    $P878."scope"("contextual")
+.annotate "line", 310
+    find_lex $P879, "$past"
+.annotate "line", 311
+    get_hll_global $P880, ["PAST"], "Var"
+.annotate "line", 313
+    find_lex $P881, "$/"
+    unless_null $P881, vivify_309
+    new $P881, "Hash"
+  vivify_309:
+    set $P882, $P881["sigil"]
+    unless_null $P882, vivify_310
+    new $P882, "Undef"
+  vivify_310:
+    set $S883, $P882
+    new $P884, 'String'
+    set $P884, $S883
+    find_lex $P885, "$/"
+    unless_null $P885, vivify_311
+    new $P885, "Hash"
+  vivify_311:
+    set $P886, $P885["desigilname"]
+    unless_null $P886, vivify_312
+    new $P886, "Undef"
+  vivify_312:
+    concat $P887, $P884, $P886
+.annotate "line", 315
+    get_hll_global $P888, ["PAST"], "Op"
+    new $P889, "String"
+    assign $P889, "Contextual "
+    find_lex $P890, "$/"
+    set $S891, $P890
+    concat $P892, $P889, $S891
+    concat $P893, $P892, " not found"
+    $P894 = $P888."new"($P893, "die" :named("pirop"))
+    $P895 = $P880."new"("package" :named("scope"), "" :named("namespace"), $P887 :named("name"), $P894 :named("viviself"))
+.annotate "line", 311
+    $P896 = $P879."viviself"($P895)
+.annotate "line", 308
+    set $P871, $P896
+  if_872_end:
+.annotate "line", 298
+    .return ($P871)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "package_declarator:sym<module>"  :subid("60_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_920
+.annotate "line", 330
+    new $P919, 'ExceptionHandler'
+    set_addr $P919, control_918
+    $P919."handle_types"(58)
+    push_eh $P919
+    .lex "self", self
+    .lex "$/", param_920
+    find_lex $P921, "$/"
+    find_lex $P922, "$/"
+    unless_null $P922, vivify_315
+    new $P922, "Hash"
+  vivify_315:
+    set $P923, $P922["package_def"]
+    unless_null $P923, vivify_316
+    new $P923, "Undef"
+  vivify_316:
+    $P924 = $P923."ast"()
+    $P925 = $P921."!make"($P924)
+    .return ($P925)
+  control_918:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P926, exception, "payload"
+    .return ($P926)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "package_declarator:sym<class>"  :subid("61_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_930
+.annotate "line", 331
+    new $P929, 'ExceptionHandler'
+    set_addr $P929, control_928
+    $P929."handle_types"(58)
+    push_eh $P929
+    .lex "self", self
+    .lex "$/", param_930
+.annotate "line", 332
+    new $P931, "Undef"
+    .lex "$past", $P931
+.annotate "line", 333
+    new $P932, "Undef"
+    .lex "$classinit", $P932
+.annotate "line", 342
+    new $P933, "Undef"
+    .lex "$parent", $P933
+.annotate "line", 332
+    find_lex $P934, "$/"
+    unless_null $P934, vivify_317
+    new $P934, "Hash"
+  vivify_317:
+    set $P935, $P934["package_def"]
+    unless_null $P935, vivify_318
+    new $P935, "Undef"
+  vivify_318:
+    $P936 = $P935."ast"()
+    store_lex "$past", $P936
+.annotate "line", 334
+    get_hll_global $P937, ["PAST"], "Op"
+.annotate "line", 335
+    get_hll_global $P938, ["PAST"], "Op"
+    $P939 = $P938."new"("    %r = get_root_global [\"parrot\"], \"P6metaclass\"" :named("inline"))
+.annotate "line", 338
+    find_lex $P940, "$/"
+    unless_null $P940, vivify_319
+    new $P940, "Hash"
+  vivify_319:
+    set $P941, $P940["package_def"]
+    unless_null $P941, vivify_320
+    new $P941, "Hash"
+  vivify_320:
+    set $P942, $P941["name"]
+    unless_null $P942, vivify_321
+    new $P942, "Undef"
+  vivify_321:
+    set $S943, $P942
+    $P944 = $P937."new"($P939, $S943, "new_class" :named("name"), "callmethod" :named("pasttype"))
+.annotate "line", 334
+    store_lex "$classinit", $P944
+.annotate "line", 342
+    find_lex $P947, "$/"
+    unless_null $P947, vivify_322
+    new $P947, "Hash"
+  vivify_322:
+    set $P948, $P947["package_def"]
+    unless_null $P948, vivify_323
+    new $P948, "Hash"
+  vivify_323:
+    set $P949, $P948["parent"]
+    unless_null $P949, vivify_324
+    new $P949, "ResizablePMCArray"
+  vivify_324:
+    set $P950, $P949[0]
+    unless_null $P950, vivify_325
+    new $P950, "Undef"
+  vivify_325:
+    set $S951, $P950
+    unless $S951, unless_946
+    new $P945, 'String'
+    set $P945, $S951
+    goto unless_946_end
+  unless_946:
+.annotate "line", 343
+    find_lex $P954, "$/"
+    unless_null $P954, vivify_326
+    new $P954, "Hash"
+  vivify_326:
+    set $P955, $P954["sym"]
+    unless_null $P955, vivify_327
+    new $P955, "Undef"
+  vivify_327:
+    set $S956, $P955
+    iseq $I957, $S956, "grammar"
+    if $I957, if_953
+    new $P959, "String"
+    assign $P959, ""
+    set $P952, $P959
+    goto if_953_end
+  if_953:
+    new $P958, "String"
+    assign $P958, "Regex::Cursor"
+    set $P952, $P958
+  if_953_end:
+    set $P945, $P952
+  unless_946_end:
+    store_lex "$parent", $P945
+.annotate "line", 344
+    find_lex $P961, "$parent"
+    unless $P961, if_960_end
+.annotate "line", 345
+    find_lex $P962, "$classinit"
+    get_hll_global $P963, ["PAST"], "Val"
+    find_lex $P964, "$parent"
+    $P965 = $P963."new"($P964 :named("value"), "parent" :named("named"))
+    $P962."push"($P965)
+  if_960_end:
+.annotate "line", 347
+    find_lex $P967, "$past"
+    unless_null $P967, vivify_328
+    new $P967, "Hash"
+  vivify_328:
+    set $P968, $P967["attributes"]
+    unless_null $P968, vivify_329
+    new $P968, "Undef"
+  vivify_329:
+    unless $P968, if_966_end
+.annotate "line", 348
+    find_lex $P969, "$classinit"
+    find_lex $P970, "$past"
+    unless_null $P970, vivify_330
+    new $P970, "Hash"
+  vivify_330:
+    set $P971, $P970["attributes"]
+    unless_null $P971, vivify_331
+    new $P971, "Undef"
+  vivify_331:
+    $P969."push"($P971)
+  if_966_end:
+.annotate "line", 350
+    get_global $P972, "@BLOCK"
+    unless_null $P972, vivify_332
+    new $P972, "ResizablePMCArray"
+  vivify_332:
+    set $P973, $P972[0]
+    unless_null $P973, vivify_333
+    new $P973, "Undef"
+  vivify_333:
+    $P974 = $P973."loadinit"()
+    find_lex $P975, "$classinit"
+    $P974."push"($P975)
+.annotate "line", 351
+    find_lex $P976, "$/"
+    find_lex $P977, "$past"
+    $P978 = $P976."!make"($P977)
+.annotate "line", 331
+    .return ($P978)
+  control_928:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P979, exception, "payload"
+    .return ($P979)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "package_def"  :subid("62_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_983
+.annotate "line", 354
+    new $P982, 'ExceptionHandler'
+    set_addr $P982, control_981
+    $P982."handle_types"(58)
+    push_eh $P982
+    .lex "self", self
+    .lex "$/", param_983
+.annotate "line", 355
+    new $P984, "Undef"
+    .lex "$past", $P984
+    find_lex $P987, "$/"
+    unless_null $P987, vivify_334
+    new $P987, "Hash"
+  vivify_334:
+    set $P988, $P987["block"]
+    unless_null $P988, vivify_335
+    new $P988, "Undef"
+  vivify_335:
+    if $P988, if_986
+    find_lex $P992, "$/"
+    unless_null $P992, vivify_336
+    new $P992, "Hash"
+  vivify_336:
+    set $P993, $P992["comp_unit"]
+    unless_null $P993, vivify_337
+    new $P993, "Undef"
+  vivify_337:
+    $P994 = $P993."ast"()
+    set $P985, $P994
+    goto if_986_end
+  if_986:
+    find_lex $P989, "$/"
+    unless_null $P989, vivify_338
+    new $P989, "Hash"
+  vivify_338:
+    set $P990, $P989["block"]
+    unless_null $P990, vivify_339
+    new $P990, "Undef"
+  vivify_339:
+    $P991 = $P990."ast"()
+    set $P985, $P991
+  if_986_end:
+    store_lex "$past", $P985
+.annotate "line", 356
+    find_lex $P995, "$past"
+    find_lex $P996, "$/"
+    unless_null $P996, vivify_340
+    new $P996, "Hash"
+  vivify_340:
+    set $P997, $P996["name"]
+    unless_null $P997, vivify_341
+    new $P997, "Hash"
+  vivify_341:
+    set $P998, $P997["identifier"]
+    unless_null $P998, vivify_342
+    new $P998, "Undef"
+  vivify_342:
+    $P995."namespace"($P998)
+.annotate "line", 357
+    find_lex $P999, "$past"
+    $P999."blocktype"("immediate")
+.annotate "line", 358
+    find_lex $P1000, "$/"
+    find_lex $P1001, "$past"
+    $P1002 = $P1000."!make"($P1001)
+.annotate "line", 354
+    .return ($P1002)
+  control_981:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1003, exception, "payload"
+    .return ($P1003)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "scope_declarator:sym<my>"  :subid("63_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1007
+.annotate "line", 361
+    new $P1006, 'ExceptionHandler'
+    set_addr $P1006, control_1005
+    $P1006."handle_types"(58)
+    push_eh $P1006
+    .lex "self", self
+    .lex "$/", param_1007
+    find_lex $P1008, "$/"
+    find_lex $P1009, "$/"
+    unless_null $P1009, vivify_343
+    new $P1009, "Hash"
+  vivify_343:
+    set $P1010, $P1009["scoped"]
+    unless_null $P1010, vivify_344
+    new $P1010, "Undef"
+  vivify_344:
+    $P1011 = $P1010."ast"()
+    $P1012 = $P1008."!make"($P1011)
+    .return ($P1012)
+  control_1005:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1013, exception, "payload"
+    .return ($P1013)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "scope_declarator:sym<our>"  :subid("64_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1017
+.annotate "line", 362
+    new $P1016, 'ExceptionHandler'
+    set_addr $P1016, control_1015
+    $P1016."handle_types"(58)
+    push_eh $P1016
+    .lex "self", self
+    .lex "$/", param_1017
+    find_lex $P1018, "$/"
+    find_lex $P1019, "$/"
+    unless_null $P1019, vivify_345
+    new $P1019, "Hash"
+  vivify_345:
+    set $P1020, $P1019["scoped"]
+    unless_null $P1020, vivify_346
+    new $P1020, "Undef"
+  vivify_346:
+    $P1021 = $P1020."ast"()
+    $P1022 = $P1018."!make"($P1021)
+    .return ($P1022)
+  control_1015:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1023, exception, "payload"
+    .return ($P1023)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "scope_declarator:sym<has>"  :subid("65_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1027
+.annotate "line", 363
+    new $P1026, 'ExceptionHandler'
+    set_addr $P1026, control_1025
+    $P1026."handle_types"(58)
+    push_eh $P1026
+    .lex "self", self
+    .lex "$/", param_1027
+    find_lex $P1028, "$/"
+    find_lex $P1029, "$/"
+    unless_null $P1029, vivify_347
+    new $P1029, "Hash"
+  vivify_347:
+    set $P1030, $P1029["scoped"]
+    unless_null $P1030, vivify_348
+    new $P1030, "Undef"
+  vivify_348:
+    $P1031 = $P1030."ast"()
+    $P1032 = $P1028."!make"($P1031)
+    .return ($P1032)
+  control_1025:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1033, exception, "payload"
+    .return ($P1033)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "scoped"  :subid("66_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1037
+.annotate "line", 365
+    new $P1036, 'ExceptionHandler'
+    set_addr $P1036, control_1035
+    $P1036."handle_types"(58)
+    push_eh $P1036
+    .lex "self", self
+    .lex "$/", param_1037
+.annotate "line", 366
+    find_lex $P1038, "$/"
+.annotate "line", 367
+    find_lex $P1041, "$/"
+    unless_null $P1041, vivify_349
+    new $P1041, "Hash"
+  vivify_349:
+    set $P1042, $P1041["routine_declarator"]
+    unless_null $P1042, vivify_350
+    new $P1042, "Undef"
+  vivify_350:
+    if $P1042, if_1040
+.annotate "line", 368
+    find_lex $P1046, "$/"
+    unless_null $P1046, vivify_351
+    new $P1046, "Hash"
+  vivify_351:
+    set $P1047, $P1046["variable_declarator"]
+    unless_null $P1047, vivify_352
+    new $P1047, "Undef"
+  vivify_352:
+    $P1048 = $P1047."ast"()
+    set $P1039, $P1048
+.annotate "line", 367
+    goto if_1040_end
+  if_1040:
+    find_lex $P1043, "$/"
+    unless_null $P1043, vivify_353
+    new $P1043, "Hash"
+  vivify_353:
+    set $P1044, $P1043["routine_declarator"]
+    unless_null $P1044, vivify_354
+    new $P1044, "Undef"
+  vivify_354:
+    $P1045 = $P1044."ast"()
+    set $P1039, $P1045
+  if_1040_end:
+    $P1049 = $P1038."!make"($P1039)
+.annotate "line", 365
+    .return ($P1049)
+  control_1035:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1050, exception, "payload"
+    .return ($P1050)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "variable_declarator"  :subid("67_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1054
+.annotate "line", 371
+    .const 'Sub' $P1094 = "68_1261064035.64813" 
+    capture_lex $P1094
+    new $P1053, 'ExceptionHandler'
+    set_addr $P1053, control_1052
+    $P1053."handle_types"(58)
+    push_eh $P1053
+    .lex "self", self
+    .lex "$/", param_1054
+.annotate "line", 372
+    new $P1055, "Undef"
+    .lex "$past", $P1055
+.annotate "line", 373
+    new $P1056, "Undef"
+    .lex "$sigil", $P1056
+.annotate "line", 374
+    new $P1057, "Undef"
+    .lex "$name", $P1057
+.annotate "line", 375
+    new $P1058, "Undef"
+    .lex "$BLOCK", $P1058
+.annotate "line", 372
+    find_lex $P1059, "$/"
+    unless_null $P1059, vivify_355
+    new $P1059, "Hash"
+  vivify_355:
+    set $P1060, $P1059["variable"]
+    unless_null $P1060, vivify_356
+    new $P1060, "Undef"
+  vivify_356:
+    $P1061 = $P1060."ast"()
+    store_lex "$past", $P1061
+.annotate "line", 373
+    find_lex $P1062, "$/"
+    unless_null $P1062, vivify_357
+    new $P1062, "Hash"
+  vivify_357:
+    set $P1063, $P1062["variable"]
+    unless_null $P1063, vivify_358
+    new $P1063, "Hash"
+  vivify_358:
+    set $P1064, $P1063["sigil"]
+    unless_null $P1064, vivify_359
+    new $P1064, "Undef"
+  vivify_359:
+    store_lex "$sigil", $P1064
+.annotate "line", 374
+    find_lex $P1065, "$past"
+    $P1066 = $P1065."name"()
+    store_lex "$name", $P1066
+.annotate "line", 375
+    get_global $P1067, "@BLOCK"
+    unless_null $P1067, vivify_360
+    new $P1067, "ResizablePMCArray"
+  vivify_360:
+    set $P1068, $P1067[0]
+    unless_null $P1068, vivify_361
+    new $P1068, "Undef"
+  vivify_361:
+    store_lex "$BLOCK", $P1068
+.annotate "line", 376
+    find_lex $P1070, "$BLOCK"
+    find_lex $P1071, "$name"
+    $P1072 = $P1070."symbol"($P1071)
+    unless $P1072, if_1069_end
+.annotate "line", 377
+    find_lex $P1073, "$/"
+    $P1074 = $P1073."CURSOR"()
+    find_lex $P1075, "$name"
+    $P1074."panic"("Redeclaration of symbol ", $P1075)
+  if_1069_end:
+.annotate "line", 379
+    find_dynamic_lex $P1077, "$*SCOPE"
+    unless_null $P1077, vivify_362
+    get_hll_global $P1077, "$SCOPE"
+    unless_null $P1077, vivify_363
+    die "Contextual $*SCOPE not found"
+  vivify_363:
+  vivify_362:
+    set $S1078, $P1077
+    iseq $I1079, $S1078, "has"
+    if $I1079, if_1076
+.annotate "line", 388
+    .const 'Sub' $P1094 = "68_1261064035.64813" 
+    capture_lex $P1094
+    $P1094()
+    goto if_1076_end
+  if_1076:
+.annotate "line", 380
+    find_lex $P1080, "$BLOCK"
+    find_lex $P1081, "$name"
+    $P1080."symbol"($P1081, "attribute" :named("scope"))
+.annotate "line", 381
+    find_lex $P1083, "$BLOCK"
+    unless_null $P1083, vivify_368
+    new $P1083, "Hash"
+  vivify_368:
+    set $P1084, $P1083["attributes"]
+    unless_null $P1084, vivify_369
+    new $P1084, "Undef"
+  vivify_369:
+    if $P1084, unless_1082_end
+.annotate "line", 383
+    get_hll_global $P1085, ["PAST"], "Op"
+    $P1086 = $P1085."new"("list" :named("pasttype"), "attr" :named("named"))
+    find_lex $P1087, "$BLOCK"
+    unless_null $P1087, vivify_370
+    new $P1087, "Hash"
+    store_lex "$BLOCK", $P1087
+  vivify_370:
+    set $P1087["attributes"], $P1086
+  unless_1082_end:
+.annotate "line", 385
+    find_lex $P1088, "$BLOCK"
+    unless_null $P1088, vivify_371
+    new $P1088, "Hash"
+  vivify_371:
+    set $P1089, $P1088["attributes"]
+    unless_null $P1089, vivify_372
+    new $P1089, "Undef"
+  vivify_372:
+    find_lex $P1090, "$name"
+    $P1089."push"($P1090)
+.annotate "line", 386
+    get_hll_global $P1091, ["PAST"], "Stmts"
+    $P1092 = $P1091."new"()
+    store_lex "$past", $P1092
+  if_1076_end:
+.annotate "line", 396
+    find_lex $P1118, "$/"
+    find_lex $P1119, "$past"
+    $P1120 = $P1118."!make"($P1119)
+.annotate "line", 371
+    .return ($P1120)
+  control_1052:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1121, exception, "payload"
+    .return ($P1121)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "_block1093"  :anon :subid("68_1261064035.64813") :outer("67_1261064035.64813")
+.annotate "line", 389
+    new $P1095, "Undef"
+    .lex "$scope", $P1095
+.annotate "line", 390
+    new $P1096, "Undef"
+    .lex "$decl", $P1096
+.annotate "line", 389
+    find_dynamic_lex $P1099, "$*SCOPE"
+    unless_null $P1099, vivify_364
+    get_hll_global $P1099, "$SCOPE"
+    unless_null $P1099, vivify_365
+    die "Contextual $*SCOPE not found"
+  vivify_365:
+  vivify_364:
+    set $S1100, $P1099
+    iseq $I1101, $S1100, "our"
+    if $I1101, if_1098
+    new $P1103, "String"
+    assign $P1103, "lexical"
+    set $P1097, $P1103
+    goto if_1098_end
+  if_1098:
+    new $P1102, "String"
+    assign $P1102, "package"
+    set $P1097, $P1102
+  if_1098_end:
+    store_lex "$scope", $P1097
+.annotate "line", 390
+    get_hll_global $P1104, ["PAST"], "Var"
+    find_lex $P1105, "$name"
+    find_lex $P1106, "$scope"
+.annotate "line", 391
+    find_lex $P1107, "$sigil"
+    $P1108 = "sigiltype"($P1107)
+    find_lex $P1109, "$/"
+    $P1110 = $P1104."new"($P1105 :named("name"), $P1106 :named("scope"), 1 :named("isdecl"), 1 :named("lvalue"), $P1108 :named("viviself"), $P1109 :named("node"))
+.annotate "line", 390
+    store_lex "$decl", $P1110
+.annotate "line", 393
+    find_lex $P1111, "$BLOCK"
+    find_lex $P1112, "$name"
+    find_lex $P1113, "$scope"
+    $P1111."symbol"($P1112, $P1113 :named("scope"))
+.annotate "line", 394
+    find_lex $P1114, "$BLOCK"
+    unless_null $P1114, vivify_366
+    new $P1114, "ResizablePMCArray"
+  vivify_366:
+    set $P1115, $P1114[0]
+    unless_null $P1115, vivify_367
+    new $P1115, "Undef"
+  vivify_367:
+    find_lex $P1116, "$decl"
+    $P1117 = $P1115."push"($P1116)
+.annotate "line", 388
+    .return ($P1117)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "routine_declarator:sym<sub>"  :subid("69_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1125
+.annotate "line", 399
+    new $P1124, 'ExceptionHandler'
+    set_addr $P1124, control_1123
+    $P1124."handle_types"(58)
+    push_eh $P1124
+    .lex "self", self
+    .lex "$/", param_1125
+    find_lex $P1126, "$/"
+    find_lex $P1127, "$/"
+    unless_null $P1127, vivify_373
+    new $P1127, "Hash"
+  vivify_373:
+    set $P1128, $P1127["routine_def"]
+    unless_null $P1128, vivify_374
+    new $P1128, "Undef"
+  vivify_374:
+    $P1129 = $P1128."ast"()
+    $P1130 = $P1126."!make"($P1129)
+    .return ($P1130)
+  control_1123:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1131, exception, "payload"
+    .return ($P1131)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "routine_declarator:sym<method>"  :subid("70_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1135
+.annotate "line", 400
+    new $P1134, 'ExceptionHandler'
+    set_addr $P1134, control_1133
+    $P1134."handle_types"(58)
+    push_eh $P1134
+    .lex "self", self
+    .lex "$/", param_1135
+    find_lex $P1136, "$/"
+    find_lex $P1137, "$/"
+    unless_null $P1137, vivify_375
+    new $P1137, "Hash"
+  vivify_375:
+    set $P1138, $P1137["method_def"]
+    unless_null $P1138, vivify_376
+    new $P1138, "Undef"
+  vivify_376:
+    $P1139 = $P1138."ast"()
+    $P1140 = $P1136."!make"($P1139)
+    .return ($P1140)
+  control_1133:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1141, exception, "payload"
+    .return ($P1141)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "routine_def"  :subid("71_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1145
+.annotate "line", 402
+    .const 'Sub' $P1156 = "72_1261064035.64813" 
+    capture_lex $P1156
+    new $P1144, 'ExceptionHandler'
+    set_addr $P1144, control_1143
+    $P1144."handle_types"(58)
+    push_eh $P1144
+    .lex "self", self
+    .lex "$/", param_1145
+.annotate "line", 403
+    new $P1146, "Undef"
+    .lex "$past", $P1146
+    find_lex $P1147, "$/"
+    unless_null $P1147, vivify_377
+    new $P1147, "Hash"
+  vivify_377:
+    set $P1148, $P1147["blockoid"]
+    unless_null $P1148, vivify_378
+    new $P1148, "Undef"
+  vivify_378:
+    $P1149 = $P1148."ast"()
+    store_lex "$past", $P1149
+.annotate "line", 404
+    find_lex $P1150, "$past"
+    $P1150."blocktype"("declaration")
+.annotate "line", 405
+    find_lex $P1151, "$past"
+    $P1151."control"("return_pir")
+.annotate "line", 406
+    find_lex $P1153, "$/"
+    unless_null $P1153, vivify_379
+    new $P1153, "Hash"
+  vivify_379:
+    set $P1154, $P1153["deflongname"]
+    unless_null $P1154, vivify_380
+    new $P1154, "Undef"
+  vivify_380:
+    unless $P1154, if_1152_end
+    .const 'Sub' $P1156 = "72_1261064035.64813" 
+    capture_lex $P1156
+    $P1156()
+  if_1152_end:
+.annotate "line", 416
+    find_lex $P1188, "$/"
+    find_lex $P1189, "$past"
+    $P1190 = $P1188."!make"($P1189)
+.annotate "line", 402
+    .return ($P1190)
+  control_1143:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1191, exception, "payload"
+    .return ($P1191)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "_block1155"  :anon :subid("72_1261064035.64813") :outer("71_1261064035.64813")
+.annotate "line", 407
+    new $P1157, "Undef"
+    .lex "$name", $P1157
+    find_lex $P1158, "$/"
+    unless_null $P1158, vivify_381
+    new $P1158, "Hash"
+  vivify_381:
+    set $P1159, $P1158["sigil"]
+    unless_null $P1159, vivify_382
+    new $P1159, "ResizablePMCArray"
+  vivify_382:
+    set $P1160, $P1159[0]
+    unless_null $P1160, vivify_383
+    new $P1160, "Undef"
+  vivify_383:
+    set $S1161, $P1160
+    new $P1162, 'String'
+    set $P1162, $S1161
+    find_lex $P1163, "$/"
+    unless_null $P1163, vivify_384
+    new $P1163, "Hash"
+  vivify_384:
+    set $P1164, $P1163["deflongname"]
+    unless_null $P1164, vivify_385
+    new $P1164, "ResizablePMCArray"
+  vivify_385:
+    set $P1165, $P1164[0]
+    unless_null $P1165, vivify_386
+    new $P1165, "Undef"
+  vivify_386:
+    $S1166 = $P1165."ast"()
+    concat $P1167, $P1162, $S1166
+    store_lex "$name", $P1167
+.annotate "line", 408
+    find_lex $P1168, "$past"
+    find_lex $P1169, "$name"
+    $P1168."name"($P1169)
+.annotate "line", 409
+    find_dynamic_lex $P1172, "$*SCOPE"
+    unless_null $P1172, vivify_387
+    get_hll_global $P1172, "$SCOPE"
+    unless_null $P1172, vivify_388
+    die "Contextual $*SCOPE not found"
+  vivify_388:
+  vivify_387:
+    set $S1173, $P1172
+    isne $I1174, $S1173, "our"
+    if $I1174, if_1171
+    new $P1170, 'Integer'
+    set $P1170, $I1174
+    goto if_1171_end
+  if_1171:
+.annotate "line", 410
+    get_global $P1175, "@BLOCK"
+    unless_null $P1175, vivify_389
+    new $P1175, "ResizablePMCArray"
+  vivify_389:
+    set $P1176, $P1175[0]
+    unless_null $P1176, vivify_390
+    new $P1176, "ResizablePMCArray"
+  vivify_390:
+    set $P1177, $P1176[0]
+    unless_null $P1177, vivify_391
+    new $P1177, "Undef"
+  vivify_391:
+    get_hll_global $P1178, ["PAST"], "Var"
+    find_lex $P1179, "$name"
+    find_lex $P1180, "$past"
+    $P1181 = $P1178."new"($P1179 :named("name"), 1 :named("isdecl"), $P1180 :named("viviself"), "lexical" :named("scope"))
+    $P1177."push"($P1181)
+.annotate "line", 412
+    get_global $P1182, "@BLOCK"
+    unless_null $P1182, vivify_392
+    new $P1182, "ResizablePMCArray"
+  vivify_392:
+    set $P1183, $P1182[0]
+    unless_null $P1183, vivify_393
+    new $P1183, "Undef"
+  vivify_393:
+    find_lex $P1184, "$name"
+    $P1183."symbol"($P1184, "lexical" :named("scope"))
+.annotate "line", 413
+    get_hll_global $P1185, ["PAST"], "Var"
+    find_lex $P1186, "$name"
+    $P1187 = $P1185."new"($P1186 :named("name"))
+    store_lex "$past", $P1187
+.annotate "line", 409
+    set $P1170, $P1187
+  if_1171_end:
+.annotate "line", 406
+    .return ($P1170)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "method_def"  :subid("73_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1195
+.annotate "line", 420
+    .const 'Sub' $P1211 = "74_1261064035.64813" 
+    capture_lex $P1211
+    new $P1194, 'ExceptionHandler'
+    set_addr $P1194, control_1193
+    $P1194."handle_types"(58)
+    push_eh $P1194
+    .lex "self", self
+    .lex "$/", param_1195
+.annotate "line", 421
+    new $P1196, "Undef"
+    .lex "$past", $P1196
+    find_lex $P1197, "$/"
+    unless_null $P1197, vivify_394
+    new $P1197, "Hash"
+  vivify_394:
+    set $P1198, $P1197["blockoid"]
+    unless_null $P1198, vivify_395
+    new $P1198, "Undef"
+  vivify_395:
+    $P1199 = $P1198."ast"()
+    store_lex "$past", $P1199
+.annotate "line", 422
+    find_lex $P1200, "$past"
+    $P1200."blocktype"("method")
+.annotate "line", 423
+    find_lex $P1201, "$past"
+    $P1201."control"("return_pir")
+.annotate "line", 424
+    find_lex $P1202, "$past"
+    unless_null $P1202, vivify_396
+    new $P1202, "ResizablePMCArray"
+  vivify_396:
+    set $P1203, $P1202[0]
+    unless_null $P1203, vivify_397
+    new $P1203, "Undef"
+  vivify_397:
+    get_hll_global $P1204, ["PAST"], "Op"
+    $P1205 = $P1204."new"("    .lex \"self\", self" :named("inline"))
+    $P1203."unshift"($P1205)
+.annotate "line", 425
+    find_lex $P1206, "$past"
+    $P1206."symbol"("self", "lexical" :named("scope"))
+.annotate "line", 426
+    find_lex $P1208, "$/"
+    unless_null $P1208, vivify_398
+    new $P1208, "Hash"
+  vivify_398:
+    set $P1209, $P1208["deflongname"]
+    unless_null $P1209, vivify_399
+    new $P1209, "Undef"
+  vivify_399:
+    unless $P1209, if_1207_end
+    .const 'Sub' $P1211 = "74_1261064035.64813" 
+    capture_lex $P1211
+    $P1211()
+  if_1207_end:
+.annotate "line", 430
+    find_lex $P1222, "$/"
+    find_lex $P1223, "$past"
+    $P1224 = $P1222."!make"($P1223)
+.annotate "line", 420
+    .return ($P1224)
+  control_1193:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1225, exception, "payload"
+    .return ($P1225)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "_block1210"  :anon :subid("74_1261064035.64813") :outer("73_1261064035.64813")
+.annotate "line", 427
+    new $P1212, "Undef"
+    .lex "$name", $P1212
+    find_lex $P1213, "$/"
+    unless_null $P1213, vivify_400
+    new $P1213, "Hash"
+  vivify_400:
+    set $P1214, $P1213["deflongname"]
+    unless_null $P1214, vivify_401
+    new $P1214, "ResizablePMCArray"
+  vivify_401:
+    set $P1215, $P1214[0]
+    unless_null $P1215, vivify_402
+    new $P1215, "Undef"
+  vivify_402:
+    $P1216 = $P1215."ast"()
+    set $S1217, $P1216
+    new $P1218, 'String'
+    set $P1218, $S1217
+    store_lex "$name", $P1218
+.annotate "line", 428
+    find_lex $P1219, "$past"
+    find_lex $P1220, "$name"
+    $P1221 = $P1219."name"($P1220)
+.annotate "line", 426
+    .return ($P1221)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "signature"  :subid("75_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1229
+.annotate "line", 434
+    .const 'Sub' $P1240 = "76_1261064035.64813" 
+    capture_lex $P1240
+    new $P1228, 'ExceptionHandler'
+    set_addr $P1228, control_1227
+    $P1228."handle_types"(58)
+    push_eh $P1228
+    .lex "self", self
+    .lex "$/", param_1229
+.annotate "line", 435
+    new $P1230, "Undef"
+    .lex "$BLOCKINIT", $P1230
+    get_global $P1231, "@BLOCK"
+    unless_null $P1231, vivify_403
+    new $P1231, "ResizablePMCArray"
+  vivify_403:
+    set $P1232, $P1231[0]
+    unless_null $P1232, vivify_404
+    new $P1232, "ResizablePMCArray"
+  vivify_404:
+    set $P1233, $P1232[0]
+    unless_null $P1233, vivify_405
+    new $P1233, "Undef"
+  vivify_405:
+    store_lex "$BLOCKINIT", $P1233
+.annotate "line", 436
+    find_lex $P1235, "$/"
+    unless_null $P1235, vivify_406
+    new $P1235, "Hash"
+  vivify_406:
+    set $P1236, $P1235["parameter"]
+    unless_null $P1236, vivify_407
+    new $P1236, "Undef"
+  vivify_407:
+    defined $I1237, $P1236
+    unless $I1237, for_undef_408
+    iter $P1234, $P1236
+    new $P1247, 'ExceptionHandler'
+    set_addr $P1247, loop1246_handler
+    $P1247."handle_types"(65, 67, 66)
+    push_eh $P1247
+  loop1246_test:
+    unless $P1234, loop1246_done
+    shift $P1238, $P1234
+  loop1246_redo:
+    .const 'Sub' $P1240 = "76_1261064035.64813" 
+    capture_lex $P1240
+    $P1240($P1238)
+  loop1246_next:
+    goto loop1246_test
+  loop1246_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1248, exception, 'type'
+    eq $P1248, 65, loop1246_next
+    eq $P1248, 67, loop1246_redo
+  loop1246_done:
+    pop_eh 
+  for_undef_408:
+.annotate "line", 434
+    .return ($P1234)
+  control_1227:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1249, exception, "payload"
+    .return ($P1249)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "_block1239"  :anon :subid("76_1261064035.64813") :outer("75_1261064035.64813")
+    .param pmc param_1241
+.annotate "line", 436
+    .lex "$_", param_1241
+    find_lex $P1242, "$BLOCKINIT"
+    find_lex $P1243, "$_"
+    $P1244 = $P1243."ast"()
+    $P1245 = $P1242."push"($P1244)
+    .return ($P1245)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "parameter"  :subid("77_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1253
+.annotate "line", 439
+    new $P1252, 'ExceptionHandler'
+    set_addr $P1252, control_1251
+    $P1252."handle_types"(58)
+    push_eh $P1252
+    .lex "self", self
+    .lex "$/", param_1253
+.annotate "line", 440
+    new $P1254, "Undef"
+    .lex "$quant", $P1254
+.annotate "line", 441
+    new $P1255, "Undef"
+    .lex "$past", $P1255
+.annotate "line", 440
+    find_lex $P1256, "$/"
+    unless_null $P1256, vivify_409
+    new $P1256, "Hash"
+  vivify_409:
+    set $P1257, $P1256["quant"]
+    unless_null $P1257, vivify_410
+    new $P1257, "Undef"
+  vivify_410:
+    store_lex "$quant", $P1257
+    find_lex $P1258, "$past"
+.annotate "line", 442
+    find_lex $P1260, "$/"
+    unless_null $P1260, vivify_411
+    new $P1260, "Hash"
+  vivify_411:
+    set $P1261, $P1260["named_param"]
+    unless_null $P1261, vivify_412
+    new $P1261, "Undef"
+  vivify_412:
+    if $P1261, if_1259
+.annotate "line", 449
+    find_lex $P1275, "$/"
+    unless_null $P1275, vivify_413
+    new $P1275, "Hash"
+  vivify_413:
+    set $P1276, $P1275["param_var"]
+    unless_null $P1276, vivify_414
+    new $P1276, "Undef"
+  vivify_414:
+    $P1277 = $P1276."ast"()
+    store_lex "$past", $P1277
+.annotate "line", 450
+    find_lex $P1279, "$quant"
+    set $S1280, $P1279
+    iseq $I1281, $S1280, "*"
+    if $I1281, if_1278
+.annotate "line", 454
+    find_lex $P1290, "$quant"
+    set $S1291, $P1290
+    iseq $I1292, $S1291, "?"
+    unless $I1292, if_1289_end
+.annotate "line", 455
+    find_lex $P1293, "$past"
+    find_lex $P1294, "$/"
+    unless_null $P1294, vivify_415
+    new $P1294, "Hash"
+  vivify_415:
+    set $P1295, $P1294["param_var"]
+    unless_null $P1295, vivify_416
+    new $P1295, "Hash"
+  vivify_416:
+    set $P1296, $P1295["sigil"]
+    unless_null $P1296, vivify_417
+    new $P1296, "Undef"
+  vivify_417:
+    $P1297 = "sigiltype"($P1296)
+    $P1293."viviself"($P1297)
+  if_1289_end:
+.annotate "line", 454
+    goto if_1278_end
+  if_1278:
+.annotate "line", 451
+    find_lex $P1282, "$past"
+    $P1282."slurpy"(1)
+.annotate "line", 452
+    find_lex $P1283, "$past"
+    find_lex $P1284, "$/"
+    unless_null $P1284, vivify_418
+    new $P1284, "Hash"
+  vivify_418:
+    set $P1285, $P1284["param_var"]
+    unless_null $P1285, vivify_419
+    new $P1285, "Hash"
+  vivify_419:
+    set $P1286, $P1285["sigil"]
+    unless_null $P1286, vivify_420
+    new $P1286, "Undef"
+  vivify_420:
+    set $S1287, $P1286
+    iseq $I1288, $S1287, "%"
+    $P1283."named"($I1288)
+  if_1278_end:
+.annotate "line", 448
+    goto if_1259_end
+  if_1259:
+.annotate "line", 443
+    find_lex $P1262, "$/"
+    unless_null $P1262, vivify_421
+    new $P1262, "Hash"
+  vivify_421:
+    set $P1263, $P1262["named_param"]
+    unless_null $P1263, vivify_422
+    new $P1263, "Undef"
+  vivify_422:
+    $P1264 = $P1263."ast"()
+    store_lex "$past", $P1264
+.annotate "line", 444
+    find_lex $P1266, "$quant"
+    set $S1267, $P1266
+    isne $I1268, $S1267, "!"
+    unless $I1268, if_1265_end
+.annotate "line", 445
+    find_lex $P1269, "$past"
+    find_lex $P1270, "$/"
+    unless_null $P1270, vivify_423
+    new $P1270, "Hash"
+  vivify_423:
+    set $P1271, $P1270["named_param"]
+    unless_null $P1271, vivify_424
+    new $P1271, "Hash"
+  vivify_424:
+    set $P1272, $P1271["param_var"]
+    unless_null $P1272, vivify_425
+    new $P1272, "Hash"
+  vivify_425:
+    set $P1273, $P1272["sigil"]
+    unless_null $P1273, vivify_426
+    new $P1273, "Undef"
+  vivify_426:
+    $P1274 = "sigiltype"($P1273)
+    $P1269."viviself"($P1274)
+  if_1265_end:
+  if_1259_end:
+.annotate "line", 458
+    find_lex $P1299, "$/"
+    unless_null $P1299, vivify_427
+    new $P1299, "Hash"
+  vivify_427:
+    set $P1300, $P1299["default_value"]
+    unless_null $P1300, vivify_428
+    new $P1300, "Undef"
+  vivify_428:
+    unless $P1300, if_1298_end
+.annotate "line", 459
+    find_lex $P1302, "$quant"
+    set $S1303, $P1302
+    iseq $I1304, $S1303, "*"
+    unless $I1304, if_1301_end
+.annotate "line", 460
+    find_lex $P1305, "$/"
+    $P1306 = $P1305."CURSOR"()
+    $P1306."panic"("Can't put default on slurpy parameter")
+  if_1301_end:
+.annotate "line", 462
+    find_lex $P1308, "$quant"
+    set $S1309, $P1308
+    iseq $I1310, $S1309, "!"
+    unless $I1310, if_1307_end
+.annotate "line", 463
+    find_lex $P1311, "$/"
+    $P1312 = $P1311."CURSOR"()
+    $P1312."panic"("Can't put default on required parameter")
+  if_1307_end:
+.annotate "line", 465
+    find_lex $P1313, "$past"
+    find_lex $P1314, "$/"
+    unless_null $P1314, vivify_429
+    new $P1314, "Hash"
+  vivify_429:
+    set $P1315, $P1314["default_value"]
+    unless_null $P1315, vivify_430
+    new $P1315, "ResizablePMCArray"
+  vivify_430:
+    set $P1316, $P1315[0]
+    unless_null $P1316, vivify_431
+    new $P1316, "Hash"
+  vivify_431:
+    set $P1317, $P1316["EXPR"]
+    unless_null $P1317, vivify_432
+    new $P1317, "Undef"
+  vivify_432:
+    $P1318 = $P1317."ast"()
+    $P1313."viviself"($P1318)
+  if_1298_end:
+.annotate "line", 467
+    find_lex $P1320, "$past"
+    $P1321 = $P1320."viviself"()
+    if $P1321, unless_1319_end
+    get_global $P1322, "@BLOCK"
+    unless_null $P1322, vivify_433
+    new $P1322, "ResizablePMCArray"
+  vivify_433:
+    set $P1323, $P1322[0]
+    unless_null $P1323, vivify_434
+    new $P1323, "Undef"
+  vivify_434:
+    get_global $P1324, "@BLOCK"
+    unless_null $P1324, vivify_435
+    new $P1324, "ResizablePMCArray"
+  vivify_435:
+    set $P1325, $P1324[0]
+    unless_null $P1325, vivify_436
+    new $P1325, "Undef"
+  vivify_436:
+    $P1326 = $P1325."arity"()
+    set $N1327, $P1326
+    new $P1328, 'Float'
+    set $P1328, $N1327
+    add $P1329, $P1328, 1
+    $P1323."arity"($P1329)
+  unless_1319_end:
+.annotate "line", 468
+    find_lex $P1330, "$/"
+    find_lex $P1331, "$past"
+    $P1332 = $P1330."!make"($P1331)
+.annotate "line", 439
+    .return ($P1332)
+  control_1251:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1333, exception, "payload"
+    .return ($P1333)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "param_var"  :subid("78_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1337
+.annotate "line", 471
+    new $P1336, 'ExceptionHandler'
+    set_addr $P1336, control_1335
+    $P1336."handle_types"(58)
+    push_eh $P1336
+    .lex "self", self
+    .lex "$/", param_1337
+.annotate "line", 472
+    new $P1338, "Undef"
+    .lex "$name", $P1338
+.annotate "line", 473
+    new $P1339, "Undef"
+    .lex "$past", $P1339
+.annotate "line", 472
+    find_lex $P1340, "$/"
+    set $S1341, $P1340
+    new $P1342, 'String'
+    set $P1342, $S1341
+    store_lex "$name", $P1342
+.annotate "line", 473
+    get_hll_global $P1343, ["PAST"], "Var"
+    find_lex $P1344, "$name"
+    find_lex $P1345, "$/"
+    $P1346 = $P1343."new"($P1344 :named("name"), "parameter" :named("scope"), 1 :named("isdecl"), $P1345 :named("node"))
+    store_lex "$past", $P1346
+.annotate "line", 475
+    get_global $P1347, "@BLOCK"
+    unless_null $P1347, vivify_437
+    new $P1347, "ResizablePMCArray"
+  vivify_437:
+    set $P1348, $P1347[0]
+    unless_null $P1348, vivify_438
+    new $P1348, "Undef"
+  vivify_438:
+    find_lex $P1349, "$name"
+    $P1348."symbol"($P1349, "lexical" :named("scope"))
+.annotate "line", 476
+    find_lex $P1350, "$/"
+    find_lex $P1351, "$past"
+    $P1352 = $P1350."!make"($P1351)
+.annotate "line", 471
+    .return ($P1352)
+  control_1335:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1353, exception, "payload"
+    .return ($P1353)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "named_param"  :subid("79_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1357
+.annotate "line", 479
+    new $P1356, 'ExceptionHandler'
+    set_addr $P1356, control_1355
+    $P1356."handle_types"(58)
+    push_eh $P1356
+    .lex "self", self
+    .lex "$/", param_1357
+.annotate "line", 480
+    new $P1358, "Undef"
+    .lex "$past", $P1358
+    find_lex $P1359, "$/"
+    unless_null $P1359, vivify_439
+    new $P1359, "Hash"
+  vivify_439:
+    set $P1360, $P1359["param_var"]
+    unless_null $P1360, vivify_440
+    new $P1360, "Undef"
+  vivify_440:
+    $P1361 = $P1360."ast"()
+    store_lex "$past", $P1361
+.annotate "line", 481
+    find_lex $P1362, "$past"
+    find_lex $P1363, "$/"
+    unless_null $P1363, vivify_441
+    new $P1363, "Hash"
+  vivify_441:
+    set $P1364, $P1363["param_var"]
+    unless_null $P1364, vivify_442
+    new $P1364, "Hash"
+  vivify_442:
+    set $P1365, $P1364["name"]
+    unless_null $P1365, vivify_443
+    new $P1365, "Undef"
+  vivify_443:
+    set $S1366, $P1365
+    $P1362."named"($S1366)
+.annotate "line", 482
+    find_lex $P1367, "$/"
+    find_lex $P1368, "$past"
+    $P1369 = $P1367."!make"($P1368)
+.annotate "line", 479
+    .return ($P1369)
+  control_1355:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1370, exception, "payload"
+    .return ($P1370)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "regex_declarator"  :subid("80_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1374
+    .param pmc param_1375 :optional
+    .param int has_param_1375 :opt_flag
+.annotate "line", 485
+    .const 'Sub' $P1445 = "82_1261064035.64813" 
+    capture_lex $P1445
+    .const 'Sub' $P1417 = "81_1261064035.64813" 
+    capture_lex $P1417
+    new $P1373, 'ExceptionHandler'
+    set_addr $P1373, control_1372
+    $P1373."handle_types"(58)
+    push_eh $P1373
+    .lex "self", self
+    .lex "$/", param_1374
+    if has_param_1375, optparam_444
+    new $P1376, "Undef"
+    set param_1375, $P1376
+  optparam_444:
+    .lex "$key", param_1375
+.annotate "line", 486
+    new $P1377, "ResizablePMCArray"
+    .lex "@MODIFIERS", $P1377
+.annotate "line", 489
+    new $P1378, "Undef"
+    .lex "$name", $P1378
+.annotate "line", 490
+    new $P1379, "Undef"
+    .lex "$past", $P1379
+.annotate "line", 486
+
+        $P1380 = get_hll_global ['Regex';'P6Regex';'Actions'], '@MODIFIERS'
+    
+    store_lex "@MODIFIERS", $P1380
+.annotate "line", 489
+    find_lex $P1381, "$/"
+    unless_null $P1381, vivify_445
+    new $P1381, "Hash"
+  vivify_445:
+    set $P1382, $P1381["deflongname"]
+    unless_null $P1382, vivify_446
+    new $P1382, "Undef"
+  vivify_446:
+    $P1383 = $P1382."ast"()
+    set $S1384, $P1383
+    new $P1385, 'String'
+    set $P1385, $S1384
+    store_lex "$name", $P1385
+    find_lex $P1386, "$past"
+.annotate "line", 491
+    find_lex $P1388, "$/"
+    unless_null $P1388, vivify_447
+    new $P1388, "Hash"
+  vivify_447:
+    set $P1389, $P1388["proto"]
+    unless_null $P1389, vivify_448
+    new $P1389, "Undef"
+  vivify_448:
+    if $P1389, if_1387
+.annotate "line", 518
+    find_lex $P1413, "$key"
+    set $S1414, $P1413
+    iseq $I1415, $S1414, "open"
+    if $I1415, if_1412
+.annotate "line", 531
+    .const 'Sub' $P1445 = "82_1261064035.64813" 
+    capture_lex $P1445
+    $P1445()
+    goto if_1412_end
+  if_1412:
+.annotate "line", 518
+    .const 'Sub' $P1417 = "81_1261064035.64813" 
+    capture_lex $P1417
+    $P1417()
+  if_1412_end:
+    goto if_1387_end
+  if_1387:
+.annotate "line", 493
+    get_hll_global $P1390, ["PAST"], "Stmts"
+.annotate "line", 494
+    get_hll_global $P1391, ["PAST"], "Block"
+    find_lex $P1392, "$name"
+.annotate "line", 495
+    get_hll_global $P1393, ["PAST"], "Op"
+.annotate "line", 496
+    get_hll_global $P1394, ["PAST"], "Var"
+    $P1395 = $P1394."new"("self" :named("name"), "register" :named("scope"))
+    find_lex $P1396, "$name"
+    $P1397 = $P1393."new"($P1395, $P1396, "!protoregex" :named("name"), "callmethod" :named("pasttype"))
+.annotate "line", 495
+    find_lex $P1398, "$/"
+    $P1399 = $P1391."new"($P1397, $P1392 :named("name"), "method" :named("blocktype"), 0 :named("lexical"), $P1398 :named("node"))
+.annotate "line", 505
+    get_hll_global $P1400, ["PAST"], "Block"
+    new $P1401, "String"
+    assign $P1401, "!PREFIX__"
+    find_lex $P1402, "$name"
+    concat $P1403, $P1401, $P1402
+.annotate "line", 506
+    get_hll_global $P1404, ["PAST"], "Op"
+.annotate "line", 507
+    get_hll_global $P1405, ["PAST"], "Var"
+    $P1406 = $P1405."new"("self" :named("name"), "register" :named("scope"))
+    find_lex $P1407, "$name"
+    $P1408 = $P1404."new"($P1406, $P1407, "!PREFIX__!protoregex" :named("name"), "callmethod" :named("pasttype"))
+.annotate "line", 506
+    find_lex $P1409, "$/"
+    $P1410 = $P1400."new"($P1408, $P1403 :named("name"), "method" :named("blocktype"), 0 :named("lexical"), $P1409 :named("node"))
+.annotate "line", 505
+    $P1411 = $P1390."new"($P1399, $P1410)
+.annotate "line", 493
+    store_lex "$past", $P1411
+  if_1387_end:
+.annotate "line", 545
+    find_lex $P1466, "$/"
+    find_lex $P1467, "$past"
+    $P1468 = $P1466."!make"($P1467)
+.annotate "line", 485
+    .return ($P1468)
+  control_1372:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1469, exception, "payload"
+    .return ($P1469)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "_block1444"  :anon :subid("82_1261064035.64813") :outer("80_1261064035.64813")
+.annotate "line", 532
+    new $P1446, "Undef"
+    .lex "$regex", $P1446
+.annotate "line", 533
+    get_hll_global $P1447, ["Regex";"P6Regex";"Actions"], "buildsub"
+    find_lex $P1448, "$/"
+    unless_null $P1448, vivify_449
+    new $P1448, "Hash"
+  vivify_449:
+    set $P1449, $P1448["p6regex"]
+    unless_null $P1449, vivify_450
+    new $P1449, "Undef"
+  vivify_450:
+    $P1450 = $P1449."ast"()
+    get_global $P1451, "@BLOCK"
+    $P1452 = $P1451."shift"()
+    $P1453 = $P1447($P1450, $P1452)
+    store_lex "$regex", $P1453
+.annotate "line", 534
+    find_lex $P1454, "$regex"
+    find_lex $P1455, "$name"
+    $P1454."name"($P1455)
+.annotate "line", 536
+    get_hll_global $P1456, ["PAST"], "Op"
+.annotate "line", 538
+    get_hll_global $P1457, ["PAST"], "Var"
+    new $P1458, "ResizablePMCArray"
+    push $P1458, "Regex"
+    $P1459 = $P1457."new"("Method" :named("name"), $P1458 :named("namespace"), "package" :named("scope"))
+    find_lex $P1460, "$regex"
+    $P1461 = $P1456."new"($P1459, $P1460, "callmethod" :named("pasttype"), "new" :named("name"))
+.annotate "line", 536
+    store_lex "$past", $P1461
+.annotate "line", 542
+    find_lex $P1462, "$regex"
+    find_lex $P1463, "$past"
+    unless_null $P1463, vivify_451
+    new $P1463, "Hash"
+    store_lex "$past", $P1463
+  vivify_451:
+    set $P1463["sink"], $P1462
+.annotate "line", 543
+    find_lex $P1464, "@MODIFIERS"
+    $P1465 = $P1464."shift"()
+.annotate "line", 531
+    .return ($P1465)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "_block1416"  :anon :subid("81_1261064035.64813") :outer("80_1261064035.64813")
+.annotate "line", 519
+    new $P1418, "Hash"
+    .lex "%h", $P1418
+.annotate "line", 518
+    find_lex $P1419, "%h"
+.annotate "line", 520
+    find_lex $P1421, "$/"
+    unless_null $P1421, vivify_452
+    new $P1421, "Hash"
+  vivify_452:
+    set $P1422, $P1421["sym"]
+    unless_null $P1422, vivify_453
+    new $P1422, "Undef"
+  vivify_453:
+    set $S1423, $P1422
+    iseq $I1424, $S1423, "token"
+    unless $I1424, if_1420_end
+    new $P1425, "Integer"
+    assign $P1425, 1
+    find_lex $P1426, "%h"
+    unless_null $P1426, vivify_454
+    new $P1426, "Hash"
+    store_lex "%h", $P1426
+  vivify_454:
+    set $P1426["r"], $P1425
+  if_1420_end:
+.annotate "line", 521
+    find_lex $P1428, "$/"
+    unless_null $P1428, vivify_455
+    new $P1428, "Hash"
+  vivify_455:
+    set $P1429, $P1428["sym"]
+    unless_null $P1429, vivify_456
+    new $P1429, "Undef"
+  vivify_456:
+    set $S1430, $P1429
+    iseq $I1431, $S1430, "rule"
+    unless $I1431, if_1427_end
+    new $P1432, "Integer"
+    assign $P1432, 1
+    find_lex $P1433, "%h"
+    unless_null $P1433, vivify_457
+    new $P1433, "Hash"
+    store_lex "%h", $P1433
+  vivify_457:
+    set $P1433["r"], $P1432
+    new $P1434, "Integer"
+    assign $P1434, 1
+    find_lex $P1435, "%h"
+    unless_null $P1435, vivify_458
+    new $P1435, "Hash"
+    store_lex "%h", $P1435
+  vivify_458:
+    set $P1435["s"], $P1434
+  if_1427_end:
+.annotate "line", 522
+    find_lex $P1436, "@MODIFIERS"
+    find_lex $P1437, "%h"
+    $P1436."unshift"($P1437)
+.annotate "line", 523
+
+            $P0 = find_lex '$name'
+            set_hll_global ['Regex';'P6Regex';'Actions'], '$REGEXNAME', $P0
+        
+.annotate "line", 527
+    get_global $P1438, "@BLOCK"
+    unless_null $P1438, vivify_459
+    new $P1438, "ResizablePMCArray"
+  vivify_459:
+    set $P1439, $P1438[0]
+    unless_null $P1439, vivify_460
+    new $P1439, "Undef"
+  vivify_460:
+    $P1439."symbol"(unicode:"$\x{a2}", "lexical" :named("scope"))
+.annotate "line", 528
+    get_global $P1440, "@BLOCK"
+    unless_null $P1440, vivify_461
+    new $P1440, "ResizablePMCArray"
+  vivify_461:
+    set $P1441, $P1440[0]
+    unless_null $P1441, vivify_462
+    new $P1441, "Undef"
+  vivify_462:
+    $P1441."symbol"("$/", "lexical" :named("scope"))
+.annotate "line", 529
+    new $P1442, "Exception"
+    set $P1442['type'], 58
+    new $P1443, "Integer"
+    assign $P1443, 0
+    setattribute $P1442, 'payload', $P1443
+    throw $P1442
+.annotate "line", 518
+    .return ()
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "dotty"  :subid("83_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1473
+.annotate "line", 549
+    new $P1472, 'ExceptionHandler'
+    set_addr $P1472, control_1471
+    $P1472."handle_types"(58)
+    push_eh $P1472
+    .lex "self", self
+    .lex "$/", param_1473
+.annotate "line", 550
+    new $P1474, "Undef"
+    .lex "$past", $P1474
+    find_lex $P1477, "$/"
+    unless_null $P1477, vivify_463
+    new $P1477, "Hash"
+  vivify_463:
+    set $P1478, $P1477["args"]
+    unless_null $P1478, vivify_464
+    new $P1478, "Undef"
+  vivify_464:
+    if $P1478, if_1476
+    get_hll_global $P1483, ["PAST"], "Op"
+    find_lex $P1484, "$/"
+    $P1485 = $P1483."new"($P1484 :named("node"))
+    set $P1475, $P1485
+    goto if_1476_end
+  if_1476:
+    find_lex $P1479, "$/"
+    unless_null $P1479, vivify_465
+    new $P1479, "Hash"
+  vivify_465:
+    set $P1480, $P1479["args"]
+    unless_null $P1480, vivify_466
+    new $P1480, "ResizablePMCArray"
+  vivify_466:
+    set $P1481, $P1480[0]
+    unless_null $P1481, vivify_467
+    new $P1481, "Undef"
+  vivify_467:
+    $P1482 = $P1481."ast"()
+    set $P1475, $P1482
+  if_1476_end:
+    store_lex "$past", $P1475
+.annotate "line", 551
+    find_lex $P1486, "$past"
+    find_lex $P1489, "$/"
+    unless_null $P1489, vivify_468
+    new $P1489, "Hash"
+  vivify_468:
+    set $P1490, $P1489["quote"]
+    unless_null $P1490, vivify_469
+    new $P1490, "Undef"
+  vivify_469:
+    if $P1490, if_1488
+    find_lex $P1494, "$/"
+    unless_null $P1494, vivify_470
+    new $P1494, "Hash"
+  vivify_470:
+    set $P1495, $P1494["longname"]
+    unless_null $P1495, vivify_471
+    new $P1495, "Undef"
+  vivify_471:
+    set $S1496, $P1495
+    new $P1487, 'String'
+    set $P1487, $S1496
+    goto if_1488_end
+  if_1488:
+    find_lex $P1491, "$/"
+    unless_null $P1491, vivify_472
+    new $P1491, "Hash"
+  vivify_472:
+    set $P1492, $P1491["quote"]
+    unless_null $P1492, vivify_473
+    new $P1492, "Undef"
+  vivify_473:
+    $P1493 = $P1492."ast"()
+    set $P1487, $P1493
+  if_1488_end:
+    $P1486."name"($P1487)
+.annotate "line", 552
+    find_lex $P1497, "$past"
+    $P1497."pasttype"("callmethod")
+.annotate "line", 553
+    find_lex $P1498, "$/"
+    find_lex $P1499, "$past"
+    $P1500 = $P1498."!make"($P1499)
+.annotate "line", 549
+    .return ($P1500)
+  control_1471:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1501, exception, "payload"
+    .return ($P1501)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "term:sym<self>"  :subid("84_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1505
+.annotate "line", 558
+    new $P1504, 'ExceptionHandler'
+    set_addr $P1504, control_1503
+    $P1504."handle_types"(58)
+    push_eh $P1504
+    .lex "self", self
+    .lex "$/", param_1505
+.annotate "line", 559
+    find_lex $P1506, "$/"
+    get_hll_global $P1507, ["PAST"], "Var"
+    $P1508 = $P1507."new"("self" :named("name"))
+    $P1509 = $P1506."!make"($P1508)
+.annotate "line", 558
+    .return ($P1509)
+  control_1503:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1510, exception, "payload"
+    .return ($P1510)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "term:sym<identifier>"  :subid("85_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1514
+.annotate "line", 562
+    new $P1513, 'ExceptionHandler'
+    set_addr $P1513, control_1512
+    $P1513."handle_types"(58)
+    push_eh $P1513
+    .lex "self", self
+    .lex "$/", param_1514
+.annotate "line", 563
+    new $P1515, "Undef"
+    .lex "$past", $P1515
+    find_lex $P1516, "$/"
+    unless_null $P1516, vivify_474
+    new $P1516, "Hash"
+  vivify_474:
+    set $P1517, $P1516["args"]
+    unless_null $P1517, vivify_475
+    new $P1517, "Undef"
+  vivify_475:
+    $P1518 = $P1517."ast"()
+    store_lex "$past", $P1518
+.annotate "line", 564
+    find_lex $P1519, "$past"
+    find_lex $P1520, "$/"
+    unless_null $P1520, vivify_476
+    new $P1520, "Hash"
+  vivify_476:
+    set $P1521, $P1520["identifier"]
+    unless_null $P1521, vivify_477
+    new $P1521, "Undef"
+  vivify_477:
+    set $S1522, $P1521
+    $P1519."name"($S1522)
+.annotate "line", 565
+    find_lex $P1523, "$/"
+    find_lex $P1524, "$past"
+    $P1525 = $P1523."!make"($P1524)
+.annotate "line", 562
+    .return ($P1525)
+  control_1512:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1526, exception, "payload"
+    .return ($P1526)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "term:sym<name>"  :subid("86_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1530
+.annotate "line", 568
+    new $P1529, 'ExceptionHandler'
+    set_addr $P1529, control_1528
+    $P1529."handle_types"(58)
+    push_eh $P1529
+    .lex "self", self
+    .lex "$/", param_1530
+.annotate "line", 569
+    new $P1531, "ResizablePMCArray"
+    .lex "@ns", $P1531
+.annotate "line", 570
+    new $P1532, "Undef"
+    .lex "$name", $P1532
+.annotate "line", 572
+    new $P1533, "Undef"
+    .lex "$var", $P1533
+.annotate "line", 574
+    new $P1534, "Undef"
+    .lex "$past", $P1534
+.annotate "line", 569
+    find_lex $P1535, "$/"
+    unless_null $P1535, vivify_478
+    new $P1535, "Hash"
+  vivify_478:
+    set $P1536, $P1535["name"]
+    unless_null $P1536, vivify_479
+    new $P1536, "Hash"
+  vivify_479:
+    set $P1537, $P1536["identifier"]
+    unless_null $P1537, vivify_480
+    new $P1537, "Undef"
+  vivify_480:
+    clone $P1538, $P1537
+    store_lex "@ns", $P1538
+.annotate "line", 570
+    find_lex $P1539, "@ns"
+    $P1540 = $P1539."pop"()
+    store_lex "$name", $P1540
+.annotate "line", 571
+    find_lex $P1544, "@ns"
+    if $P1544, if_1543
+    set $P1542, $P1544
+    goto if_1543_end
+  if_1543:
+    find_lex $P1545, "@ns"
+    unless_null $P1545, vivify_481
+    new $P1545, "ResizablePMCArray"
+  vivify_481:
+    set $P1546, $P1545[0]
+    unless_null $P1546, vivify_482
+    new $P1546, "Undef"
+  vivify_482:
+    set $S1547, $P1546
+    iseq $I1548, $S1547, "GLOBAL"
+    new $P1542, 'Integer'
+    set $P1542, $I1548
+  if_1543_end:
+    unless $P1542, if_1541_end
+    find_lex $P1549, "@ns"
+    $P1549."shift"()
+  if_1541_end:
+.annotate "line", 573
+    get_hll_global $P1550, ["PAST"], "Var"
+    find_lex $P1551, "$name"
+    set $S1552, $P1551
+    find_lex $P1553, "@ns"
+    $P1554 = $P1550."new"($S1552 :named("name"), $P1553 :named("namespace"), "package" :named("scope"))
+    store_lex "$var", $P1554
+.annotate "line", 574
+    find_lex $P1555, "$var"
+    store_lex "$past", $P1555
+.annotate "line", 575
+    find_lex $P1557, "$/"
+    unless_null $P1557, vivify_483
+    new $P1557, "Hash"
+  vivify_483:
+    set $P1558, $P1557["args"]
+    unless_null $P1558, vivify_484
+    new $P1558, "Undef"
+  vivify_484:
+    unless $P1558, if_1556_end
+.annotate "line", 576
+    find_lex $P1559, "$/"
+    unless_null $P1559, vivify_485
+    new $P1559, "Hash"
+  vivify_485:
+    set $P1560, $P1559["args"]
+    unless_null $P1560, vivify_486
+    new $P1560, "ResizablePMCArray"
+  vivify_486:
+    set $P1561, $P1560[0]
+    unless_null $P1561, vivify_487
+    new $P1561, "Undef"
+  vivify_487:
+    $P1562 = $P1561."ast"()
+    store_lex "$past", $P1562
+.annotate "line", 577
+    find_lex $P1563, "$past"
+    find_lex $P1564, "$var"
+    $P1563."unshift"($P1564)
+  if_1556_end:
+.annotate "line", 579
+    find_lex $P1565, "$/"
+    find_lex $P1566, "$past"
+    $P1567 = $P1565."!make"($P1566)
+.annotate "line", 568
+    .return ($P1567)
+  control_1528:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1568, exception, "payload"
+    .return ($P1568)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "term:sym<pir::op>"  :subid("87_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1572
+.annotate "line", 582
+    new $P1571, 'ExceptionHandler'
+    set_addr $P1571, control_1570
+    $P1571."handle_types"(58)
+    push_eh $P1571
+    .lex "self", self
+    .lex "$/", param_1572
+.annotate "line", 583
+    new $P1573, "Undef"
+    .lex "$past", $P1573
+.annotate "line", 584
+    new $P1574, "Undef"
+    .lex "$pirop", $P1574
+.annotate "line", 583
+    find_lex $P1577, "$/"
+    unless_null $P1577, vivify_488
+    new $P1577, "Hash"
+  vivify_488:
+    set $P1578, $P1577["args"]
+    unless_null $P1578, vivify_489
+    new $P1578, "Undef"
+  vivify_489:
+    if $P1578, if_1576
+    get_hll_global $P1583, ["PAST"], "Op"
+    find_lex $P1584, "$/"
+    $P1585 = $P1583."new"($P1584 :named("node"))
+    set $P1575, $P1585
+    goto if_1576_end
+  if_1576:
+    find_lex $P1579, "$/"
+    unless_null $P1579, vivify_490
+    new $P1579, "Hash"
+  vivify_490:
+    set $P1580, $P1579["args"]
+    unless_null $P1580, vivify_491
+    new $P1580, "ResizablePMCArray"
+  vivify_491:
+    set $P1581, $P1580[0]
+    unless_null $P1581, vivify_492
+    new $P1581, "Undef"
+  vivify_492:
+    $P1582 = $P1581."ast"()
+    set $P1575, $P1582
+  if_1576_end:
+    store_lex "$past", $P1575
+.annotate "line", 584
+    find_lex $P1586, "$/"
+    unless_null $P1586, vivify_493
+    new $P1586, "Hash"
+  vivify_493:
+    set $P1587, $P1586["op"]
+    unless_null $P1587, vivify_494
+    new $P1587, "Undef"
+  vivify_494:
+    set $S1588, $P1587
+    new $P1589, 'String'
+    set $P1589, $S1588
+    store_lex "$pirop", $P1589
+.annotate "line", 585
+
+        $P0 = find_lex '$pirop'
+        $S0 = $P0
+        $P0 = split '__', $S0
+        $S0 = join ' ', $P0
+        $P1590 = box $S0
+    
+    store_lex "$pirop", $P1590
+.annotate "line", 592
+    find_lex $P1591, "$past"
+    find_lex $P1592, "$pirop"
+    $P1591."pirop"($P1592)
+.annotate "line", 593
+    find_lex $P1593, "$past"
+    $P1593."pasttype"("pirop")
+.annotate "line", 594
+    find_lex $P1594, "$/"
+    find_lex $P1595, "$past"
+    $P1596 = $P1594."!make"($P1595)
+.annotate "line", 582
+    .return ($P1596)
+  control_1570:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1597, exception, "payload"
+    .return ($P1597)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "args"  :subid("88_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1601
+.annotate "line", 597
+    new $P1600, 'ExceptionHandler'
+    set_addr $P1600, control_1599
+    $P1600."handle_types"(58)
+    push_eh $P1600
+    .lex "self", self
+    .lex "$/", param_1601
+    find_lex $P1602, "$/"
+    find_lex $P1603, "$/"
+    unless_null $P1603, vivify_495
+    new $P1603, "Hash"
+  vivify_495:
+    set $P1604, $P1603["arglist"]
+    unless_null $P1604, vivify_496
+    new $P1604, "Undef"
+  vivify_496:
+    $P1605 = $P1604."ast"()
+    $P1606 = $P1602."!make"($P1605)
+    .return ($P1606)
+  control_1599:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1607, exception, "payload"
+    .return ($P1607)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "arglist"  :subid("89_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1611
+.annotate "line", 599
+    .const 'Sub' $P1622 = "90_1261064035.64813" 
+    capture_lex $P1622
+    new $P1610, 'ExceptionHandler'
+    set_addr $P1610, control_1609
+    $P1610."handle_types"(58)
+    push_eh $P1610
+    .lex "self", self
+    .lex "$/", param_1611
+.annotate "line", 600
+    new $P1612, "Undef"
+    .lex "$past", $P1612
+.annotate "line", 608
+    new $P1613, "Undef"
+    .lex "$i", $P1613
+.annotate "line", 609
+    new $P1614, "Undef"
+    .lex "$n", $P1614
+.annotate "line", 600
+    get_hll_global $P1615, ["PAST"], "Op"
+    find_lex $P1616, "$/"
+    $P1617 = $P1615."new"("call" :named("pasttype"), $P1616 :named("node"))
+    store_lex "$past", $P1617
+.annotate "line", 601
+    find_lex $P1619, "$/"
+    unless_null $P1619, vivify_497
+    new $P1619, "Hash"
+  vivify_497:
+    set $P1620, $P1619["EXPR"]
+    unless_null $P1620, vivify_498
+    new $P1620, "Undef"
+  vivify_498:
+    unless $P1620, if_1618_end
+    .const 'Sub' $P1622 = "90_1261064035.64813" 
+    capture_lex $P1622
+    $P1622()
+  if_1618_end:
+.annotate "line", 608
+    new $P1654, "Integer"
+    assign $P1654, 0
+    store_lex "$i", $P1654
+.annotate "line", 609
+    find_lex $P1655, "$past"
+    $P1656 = $P1655."list"()
+    set $N1657, $P1656
+    new $P1658, 'Float'
+    set $P1658, $N1657
+    store_lex "$n", $P1658
+.annotate "line", 610
+    new $P1686, 'ExceptionHandler'
+    set_addr $P1686, loop1685_handler
+    $P1686."handle_types"(65, 67, 66)
+    push_eh $P1686
+  loop1685_test:
+    find_lex $P1659, "$i"
+    set $N1660, $P1659
+    find_lex $P1661, "$n"
+    set $N1662, $P1661
+    islt $I1663, $N1660, $N1662
+    unless $I1663, loop1685_done
+  loop1685_redo:
+.annotate "line", 611
+    find_lex $P1665, "$i"
+    set $I1666, $P1665
+    find_lex $P1667, "$past"
+    unless_null $P1667, vivify_502
+    new $P1667, "ResizablePMCArray"
+  vivify_502:
+    set $P1668, $P1667[$I1666]
+    unless_null $P1668, vivify_503
+    new $P1668, "Undef"
+  vivify_503:
+    $S1669 = $P1668."name"()
+    iseq $I1670, $S1669, "&prefix:<|>"
+    unless $I1670, if_1664_end
+.annotate "line", 612
+    find_lex $P1671, "$i"
+    set $I1672, $P1671
+    find_lex $P1673, "$past"
+    unless_null $P1673, vivify_504
+    new $P1673, "ResizablePMCArray"
+  vivify_504:
+    set $P1674, $P1673[$I1672]
+    unless_null $P1674, vivify_505
+    new $P1674, "ResizablePMCArray"
+  vivify_505:
+    set $P1675, $P1674[0]
+    unless_null $P1675, vivify_506
+    new $P1675, "Undef"
+  vivify_506:
+    find_lex $P1676, "$i"
+    set $I1677, $P1676
+    find_lex $P1678, "$past"
+    unless_null $P1678, vivify_507
+    new $P1678, "ResizablePMCArray"
+    store_lex "$past", $P1678
+  vivify_507:
+    set $P1678[$I1677], $P1675
+.annotate "line", 613
+    find_lex $P1679, "$i"
+    set $I1680, $P1679
+    find_lex $P1681, "$past"
+    unless_null $P1681, vivify_508
+    new $P1681, "ResizablePMCArray"
+  vivify_508:
+    set $P1682, $P1681[$I1680]
+    unless_null $P1682, vivify_509
+    new $P1682, "Undef"
+  vivify_509:
+    $P1682."flat"(1)
+  if_1664_end:
+.annotate "line", 611
+    find_lex $P1683, "$i"
+    clone $P1684, $P1683
+    inc $P1683
+  loop1685_next:
+.annotate "line", 610
+    goto loop1685_test
+  loop1685_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1687, exception, 'type'
+    eq $P1687, 65, loop1685_next
+    eq $P1687, 67, loop1685_redo
+  loop1685_done:
+    pop_eh 
+.annotate "line", 617
+    find_lex $P1688, "$/"
+    find_lex $P1689, "$past"
+    $P1690 = $P1688."!make"($P1689)
+.annotate "line", 599
+    .return ($P1690)
+  control_1609:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1691, exception, "payload"
+    .return ($P1691)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "_block1621"  :anon :subid("90_1261064035.64813") :outer("89_1261064035.64813")
+.annotate "line", 601
+    .const 'Sub' $P1643 = "91_1261064035.64813" 
+    capture_lex $P1643
+.annotate "line", 602
+    new $P1623, "Undef"
+    .lex "$expr", $P1623
+    find_lex $P1624, "$/"
+    unless_null $P1624, vivify_499
+    new $P1624, "Hash"
+  vivify_499:
+    set $P1625, $P1624["EXPR"]
+    unless_null $P1625, vivify_500
+    new $P1625, "Undef"
+  vivify_500:
+    $P1626 = $P1625."ast"()
+    store_lex "$expr", $P1626
+.annotate "line", 603
+    find_lex $P1631, "$expr"
+    $S1632 = $P1631."name"()
+    iseq $I1633, $S1632, "&infix:<,>"
+    if $I1633, if_1630
+    new $P1629, 'Integer'
+    set $P1629, $I1633
+    goto if_1630_end
+  if_1630:
+    find_lex $P1634, "$expr"
+    $P1635 = $P1634."named"()
+    isfalse $I1636, $P1635
+    new $P1629, 'Integer'
+    set $P1629, $I1636
+  if_1630_end:
+    if $P1629, if_1628
+.annotate "line", 606
+    find_lex $P1651, "$past"
+    find_lex $P1652, "$expr"
+    $P1653 = $P1651."push"($P1652)
+    set $P1627, $P1653
+.annotate "line", 603
+    goto if_1628_end
+  if_1628:
+.annotate "line", 604
+    find_lex $P1638, "$expr"
+    $P1639 = $P1638."list"()
+    defined $I1640, $P1639
+    unless $I1640, for_undef_501
+    iter $P1637, $P1639
+    new $P1649, 'ExceptionHandler'
+    set_addr $P1649, loop1648_handler
+    $P1649."handle_types"(65, 67, 66)
+    push_eh $P1649
+  loop1648_test:
+    unless $P1637, loop1648_done
+    shift $P1641, $P1637
+  loop1648_redo:
+    .const 'Sub' $P1643 = "91_1261064035.64813" 
+    capture_lex $P1643
+    $P1643($P1641)
+  loop1648_next:
+    goto loop1648_test
+  loop1648_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1650, exception, 'type'
+    eq $P1650, 65, loop1648_next
+    eq $P1650, 67, loop1648_redo
+  loop1648_done:
+    pop_eh 
+  for_undef_501:
+.annotate "line", 603
+    set $P1627, $P1637
+  if_1628_end:
+.annotate "line", 601
+    .return ($P1627)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "_block1642"  :anon :subid("91_1261064035.64813") :outer("90_1261064035.64813")
+    .param pmc param_1644
+.annotate "line", 604
+    .lex "$_", param_1644
+    find_lex $P1645, "$past"
+    find_lex $P1646, "$_"
+    $P1647 = $P1645."push"($P1646)
+    .return ($P1647)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "term:sym<value>"  :subid("92_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1695
+.annotate "line", 621
+    new $P1694, 'ExceptionHandler'
+    set_addr $P1694, control_1693
+    $P1694."handle_types"(58)
+    push_eh $P1694
+    .lex "self", self
+    .lex "$/", param_1695
+    find_lex $P1696, "$/"
+    find_lex $P1697, "$/"
+    unless_null $P1697, vivify_510
+    new $P1697, "Hash"
+  vivify_510:
+    set $P1698, $P1697["value"]
+    unless_null $P1698, vivify_511
+    new $P1698, "Undef"
+  vivify_511:
+    $P1699 = $P1698."ast"()
+    $P1700 = $P1696."!make"($P1699)
+    .return ($P1700)
+  control_1693:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1701, exception, "payload"
+    .return ($P1701)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "circumfix:sym<( )>"  :subid("93_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1705
+.annotate "line", 623
+    new $P1704, 'ExceptionHandler'
+    set_addr $P1704, control_1703
+    $P1704."handle_types"(58)
+    push_eh $P1704
+    .lex "self", self
+    .lex "$/", param_1705
+.annotate "line", 624
+    find_lex $P1706, "$/"
+.annotate "line", 625
+    find_lex $P1709, "$/"
+    unless_null $P1709, vivify_512
+    new $P1709, "Hash"
+  vivify_512:
+    set $P1710, $P1709["EXPR"]
+    unless_null $P1710, vivify_513
+    new $P1710, "Undef"
+  vivify_513:
+    if $P1710, if_1708
+.annotate "line", 626
+    get_hll_global $P1715, ["PAST"], "Op"
+    find_lex $P1716, "$/"
+    $P1717 = $P1715."new"("list" :named("pasttype"), $P1716 :named("node"))
+    set $P1707, $P1717
+.annotate "line", 625
+    goto if_1708_end
+  if_1708:
+    find_lex $P1711, "$/"
+    unless_null $P1711, vivify_514
+    new $P1711, "Hash"
+  vivify_514:
+    set $P1712, $P1711["EXPR"]
+    unless_null $P1712, vivify_515
+    new $P1712, "ResizablePMCArray"
+  vivify_515:
+    set $P1713, $P1712[0]
+    unless_null $P1713, vivify_516
+    new $P1713, "Undef"
+  vivify_516:
+    $P1714 = $P1713."ast"()
+    set $P1707, $P1714
+  if_1708_end:
+    $P1718 = $P1706."!make"($P1707)
+.annotate "line", 623
+    .return ($P1718)
+  control_1703:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1719, exception, "payload"
+    .return ($P1719)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "circumfix:sym<[ ]>"  :subid("94_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1723
+.annotate "line", 629
+    new $P1722, 'ExceptionHandler'
+    set_addr $P1722, control_1721
+    $P1722."handle_types"(58)
+    push_eh $P1722
+    .lex "self", self
+    .lex "$/", param_1723
+.annotate "line", 630
+    new $P1724, "Undef"
+    .lex "$past", $P1724
+.annotate "line", 629
+    find_lex $P1725, "$past"
+.annotate "line", 631
+    find_lex $P1727, "$/"
+    unless_null $P1727, vivify_517
+    new $P1727, "Hash"
+  vivify_517:
+    set $P1728, $P1727["EXPR"]
+    unless_null $P1728, vivify_518
+    new $P1728, "Undef"
+  vivify_518:
+    if $P1728, if_1726
+.annotate "line", 638
+    get_hll_global $P1740, ["PAST"], "Op"
+    $P1741 = $P1740."new"("list" :named("pasttype"))
+    store_lex "$past", $P1741
+.annotate "line", 637
+    goto if_1726_end
+  if_1726:
+.annotate "line", 632
+    find_lex $P1729, "$/"
+    unless_null $P1729, vivify_519
+    new $P1729, "Hash"
+  vivify_519:
+    set $P1730, $P1729["EXPR"]
+    unless_null $P1730, vivify_520
+    new $P1730, "ResizablePMCArray"
+  vivify_520:
+    set $P1731, $P1730[0]
+    unless_null $P1731, vivify_521
+    new $P1731, "Undef"
+  vivify_521:
+    $P1732 = $P1731."ast"()
+    store_lex "$past", $P1732
+.annotate "line", 633
+    find_lex $P1734, "$past"
+    $S1735 = $P1734."name"()
+    isne $I1736, $S1735, "&infix:<,>"
+    unless $I1736, if_1733_end
+.annotate "line", 634
+    get_hll_global $P1737, ["PAST"], "Op"
+    find_lex $P1738, "$past"
+    $P1739 = $P1737."new"($P1738, "list" :named("pasttype"))
+    store_lex "$past", $P1739
+  if_1733_end:
+  if_1726_end:
+.annotate "line", 640
+    find_lex $P1742, "$past"
+    $P1742."name"("&circumfix:<[ ]>")
+.annotate "line", 641
+    find_lex $P1743, "$/"
+    find_lex $P1744, "$past"
+    $P1745 = $P1743."!make"($P1744)
+.annotate "line", 629
+    .return ($P1745)
+  control_1721:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1746, exception, "payload"
+    .return ($P1746)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "circumfix:sym<ang>"  :subid("95_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1750
+.annotate "line", 644
+    new $P1749, 'ExceptionHandler'
+    set_addr $P1749, control_1748
+    $P1749."handle_types"(58)
+    push_eh $P1749
+    .lex "self", self
+    .lex "$/", param_1750
+    find_lex $P1751, "$/"
+    find_lex $P1752, "$/"
+    unless_null $P1752, vivify_522
+    new $P1752, "Hash"
+  vivify_522:
+    set $P1753, $P1752["quote_EXPR"]
+    unless_null $P1753, vivify_523
+    new $P1753, "Undef"
+  vivify_523:
+    $P1754 = $P1753."ast"()
+    $P1755 = $P1751."!make"($P1754)
+    .return ($P1755)
+  control_1748:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1756, exception, "payload"
+    .return ($P1756)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub unicode:"circumfix:sym<\x{ab} \x{bb}>"  :subid("96_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1760
+.annotate "line", 645
+    new $P1759, 'ExceptionHandler'
+    set_addr $P1759, control_1758
+    $P1759."handle_types"(58)
+    push_eh $P1759
+    .lex "self", self
+    .lex "$/", param_1760
+    find_lex $P1761, "$/"
+    find_lex $P1762, "$/"
+    unless_null $P1762, vivify_524
+    new $P1762, "Hash"
+  vivify_524:
+    set $P1763, $P1762["quote_EXPR"]
+    unless_null $P1763, vivify_525
+    new $P1763, "Undef"
+  vivify_525:
+    $P1764 = $P1763."ast"()
+    $P1765 = $P1761."!make"($P1764)
+    .return ($P1765)
+  control_1758:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1766, exception, "payload"
+    .return ($P1766)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "circumfix:sym<{ }>"  :subid("97_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1770
+.annotate "line", 647
+    new $P1769, 'ExceptionHandler'
+    set_addr $P1769, control_1768
+    $P1769."handle_types"(58)
+    push_eh $P1769
+    .lex "self", self
+    .lex "$/", param_1770
+.annotate "line", 648
+    find_lex $P1771, "$/"
+    find_lex $P1774, "$/"
+    unless_null $P1774, vivify_526
+    new $P1774, "Hash"
+  vivify_526:
+    set $P1775, $P1774["pblock"]
+    unless_null $P1775, vivify_527
+    new $P1775, "Hash"
+  vivify_527:
+    set $P1776, $P1775["blockoid"]
+    unless_null $P1776, vivify_528
+    new $P1776, "Hash"
+  vivify_528:
+    set $P1777, $P1776["statementlist"]
+    unless_null $P1777, vivify_529
+    new $P1777, "Hash"
+  vivify_529:
+    set $P1778, $P1777["statement"]
+    unless_null $P1778, vivify_530
+    new $P1778, "Undef"
+  vivify_530:
+    set $N1779, $P1778
+    isgt $I1780, $N1779, 0.0
+    if $I1780, if_1773
+.annotate "line", 650
+    get_hll_global $P1784, ["PAST"], "Op"
+    find_lex $P1785, "$/"
+    $P1786 = $P1784."new"("    %r = new [\"Hash\"]" :named("inline"), $P1785 :named("node"))
+    set $P1772, $P1786
+.annotate "line", 648
+    goto if_1773_end
+  if_1773:
+.annotate "line", 649
+    find_lex $P1781, "$/"
+    unless_null $P1781, vivify_531
+    new $P1781, "Hash"
+  vivify_531:
+    set $P1782, $P1781["pblock"]
+    unless_null $P1782, vivify_532
+    new $P1782, "Undef"
+  vivify_532:
+    $P1783 = $P1782."ast"()
+    set $P1772, $P1783
+  if_1773_end:
+    $P1787 = $P1771."!make"($P1772)
+.annotate "line", 647
+    .return ($P1787)
+  control_1768:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1788, exception, "payload"
+    .return ($P1788)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "circumfix:sym<sigil>"  :subid("98_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1792
+.annotate "line", 653
+    new $P1791, 'ExceptionHandler'
+    set_addr $P1791, control_1790
+    $P1791."handle_types"(58)
+    push_eh $P1791
+    .lex "self", self
+    .lex "$/", param_1792
+.annotate "line", 654
+    new $P1793, "Undef"
+    .lex "$name", $P1793
+    find_lex $P1796, "$/"
+    unless_null $P1796, vivify_533
+    new $P1796, "Hash"
+  vivify_533:
+    set $P1797, $P1796["sigil"]
+    unless_null $P1797, vivify_534
+    new $P1797, "Undef"
+  vivify_534:
+    set $S1798, $P1797
+    iseq $I1799, $S1798, "@"
+    if $I1799, if_1795
+.annotate "line", 655
+    find_lex $P1803, "$/"
+    unless_null $P1803, vivify_535
+    new $P1803, "Hash"
+  vivify_535:
+    set $P1804, $P1803["sigil"]
+    unless_null $P1804, vivify_536
+    new $P1804, "Undef"
+  vivify_536:
+    set $S1805, $P1804
+    iseq $I1806, $S1805, "%"
+    if $I1806, if_1802
+    new $P1808, "String"
+    assign $P1808, "item"
+    set $P1801, $P1808
+    goto if_1802_end
+  if_1802:
+    new $P1807, "String"
+    assign $P1807, "hash"
+    set $P1801, $P1807
+  if_1802_end:
+    set $P1794, $P1801
+.annotate "line", 654
+    goto if_1795_end
+  if_1795:
+    new $P1800, "String"
+    assign $P1800, "list"
+    set $P1794, $P1800
+  if_1795_end:
+    store_lex "$name", $P1794
+.annotate "line", 657
+    find_lex $P1809, "$/"
+    get_hll_global $P1810, ["PAST"], "Op"
+    find_lex $P1811, "$name"
+    find_lex $P1812, "$/"
+    unless_null $P1812, vivify_537
+    new $P1812, "Hash"
+  vivify_537:
+    set $P1813, $P1812["semilist"]
+    unless_null $P1813, vivify_538
+    new $P1813, "Undef"
+  vivify_538:
+    $P1814 = $P1813."ast"()
+    $P1815 = $P1810."new"($P1814, "callmethod" :named("pasttype"), $P1811 :named("name"))
+    $P1816 = $P1809."!make"($P1815)
+.annotate "line", 653
+    .return ($P1816)
+  control_1790:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1817, exception, "payload"
+    .return ($P1817)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "semilist"  :subid("99_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1821
+.annotate "line", 660
+    new $P1820, 'ExceptionHandler'
+    set_addr $P1820, control_1819
+    $P1820."handle_types"(58)
+    push_eh $P1820
+    .lex "self", self
+    .lex "$/", param_1821
+    find_lex $P1822, "$/"
+    find_lex $P1823, "$/"
+    unless_null $P1823, vivify_539
+    new $P1823, "Hash"
+  vivify_539:
+    set $P1824, $P1823["statement"]
+    unless_null $P1824, vivify_540
+    new $P1824, "Undef"
+  vivify_540:
+    $P1825 = $P1824."ast"()
+    $P1826 = $P1822."!make"($P1825)
+    .return ($P1826)
+  control_1819:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1827, exception, "payload"
+    .return ($P1827)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "postcircumfix:sym<[ ]>"  :subid("100_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1831
+.annotate "line", 662
+    new $P1830, 'ExceptionHandler'
+    set_addr $P1830, control_1829
+    $P1830."handle_types"(58)
+    push_eh $P1830
+    .lex "self", self
+    .lex "$/", param_1831
+.annotate "line", 663
+    find_lex $P1832, "$/"
+    get_hll_global $P1833, ["PAST"], "Var"
+    find_lex $P1834, "$/"
+    unless_null $P1834, vivify_541
+    new $P1834, "Hash"
+  vivify_541:
+    set $P1835, $P1834["EXPR"]
+    unless_null $P1835, vivify_542
+    new $P1835, "Undef"
+  vivify_542:
+    $P1836 = $P1835."ast"()
+    $P1837 = $P1833."new"($P1836, "keyed_int" :named("scope"), "Undef" :named("viviself"), "ResizablePMCArray" :named("vivibase"))
+    $P1838 = $P1832."!make"($P1837)
+.annotate "line", 662
+    .return ($P1838)
+  control_1829:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1839, exception, "payload"
+    .return ($P1839)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "postcircumfix:sym<{ }>"  :subid("101_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1843
+.annotate "line", 668
+    new $P1842, 'ExceptionHandler'
+    set_addr $P1842, control_1841
+    $P1842."handle_types"(58)
+    push_eh $P1842
+    .lex "self", self
+    .lex "$/", param_1843
+.annotate "line", 669
+    find_lex $P1844, "$/"
+    get_hll_global $P1845, ["PAST"], "Var"
+    find_lex $P1846, "$/"
+    unless_null $P1846, vivify_543
+    new $P1846, "Hash"
+  vivify_543:
+    set $P1847, $P1846["EXPR"]
+    unless_null $P1847, vivify_544
+    new $P1847, "Undef"
+  vivify_544:
+    $P1848 = $P1847."ast"()
+    $P1849 = $P1845."new"($P1848, "keyed" :named("scope"), "Undef" :named("viviself"), "Hash" :named("vivibase"))
+    $P1850 = $P1844."!make"($P1849)
+.annotate "line", 668
+    .return ($P1850)
+  control_1841:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1851, exception, "payload"
+    .return ($P1851)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "postcircumfix:sym<ang>"  :subid("102_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1855
+.annotate "line", 674
+    new $P1854, 'ExceptionHandler'
+    set_addr $P1854, control_1853
+    $P1854."handle_types"(58)
+    push_eh $P1854
+    .lex "self", self
+    .lex "$/", param_1855
+.annotate "line", 675
+    find_lex $P1856, "$/"
+    get_hll_global $P1857, ["PAST"], "Var"
+    find_lex $P1858, "$/"
+    unless_null $P1858, vivify_545
+    new $P1858, "Hash"
+  vivify_545:
+    set $P1859, $P1858["quote_EXPR"]
+    unless_null $P1859, vivify_546
+    new $P1859, "Undef"
+  vivify_546:
+    $P1860 = $P1859."ast"()
+    $P1861 = $P1857."new"($P1860, "keyed" :named("scope"), "Undef" :named("viviself"), "Hash" :named("vivibase"))
+    $P1862 = $P1856."!make"($P1861)
+.annotate "line", 674
+    .return ($P1862)
+  control_1853:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1863, exception, "payload"
+    .return ($P1863)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "postcircumfix:sym<( )>"  :subid("103_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1867
+.annotate "line", 680
+    new $P1866, 'ExceptionHandler'
+    set_addr $P1866, control_1865
+    $P1866."handle_types"(58)
+    push_eh $P1866
+    .lex "self", self
+    .lex "$/", param_1867
+.annotate "line", 681
+    find_lex $P1868, "$/"
+    find_lex $P1869, "$/"
+    unless_null $P1869, vivify_547
+    new $P1869, "Hash"
+  vivify_547:
+    set $P1870, $P1869["arglist"]
+    unless_null $P1870, vivify_548
+    new $P1870, "Undef"
+  vivify_548:
+    $P1871 = $P1870."ast"()
+    $P1872 = $P1868."!make"($P1871)
+.annotate "line", 680
+    .return ($P1872)
+  control_1865:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1873, exception, "payload"
+    .return ($P1873)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "value"  :subid("104_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1877
+.annotate "line", 684
+    new $P1876, 'ExceptionHandler'
+    set_addr $P1876, control_1875
+    $P1876."handle_types"(58)
+    push_eh $P1876
+    .lex "self", self
+    .lex "$/", param_1877
+.annotate "line", 685
+    find_lex $P1878, "$/"
+    find_lex $P1881, "$/"
+    unless_null $P1881, vivify_549
+    new $P1881, "Hash"
+  vivify_549:
+    set $P1882, $P1881["quote"]
+    unless_null $P1882, vivify_550
+    new $P1882, "Undef"
+  vivify_550:
+    if $P1882, if_1880
+    find_lex $P1886, "$/"
+    unless_null $P1886, vivify_551
+    new $P1886, "Hash"
+  vivify_551:
+    set $P1887, $P1886["number"]
+    unless_null $P1887, vivify_552
+    new $P1887, "Undef"
+  vivify_552:
+    $P1888 = $P1887."ast"()
+    set $P1879, $P1888
+    goto if_1880_end
+  if_1880:
+    find_lex $P1883, "$/"
+    unless_null $P1883, vivify_553
+    new $P1883, "Hash"
+  vivify_553:
+    set $P1884, $P1883["quote"]
+    unless_null $P1884, vivify_554
+    new $P1884, "Undef"
+  vivify_554:
+    $P1885 = $P1884."ast"()
+    set $P1879, $P1885
+  if_1880_end:
+    $P1889 = $P1878."!make"($P1879)
+.annotate "line", 684
+    .return ($P1889)
+  control_1875:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1890, exception, "payload"
+    .return ($P1890)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "number"  :subid("105_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1894
+.annotate "line", 688
+    new $P1893, 'ExceptionHandler'
+    set_addr $P1893, control_1892
+    $P1893."handle_types"(58)
+    push_eh $P1893
+    .lex "self", self
+    .lex "$/", param_1894
+.annotate "line", 689
+    new $P1895, "Undef"
+    .lex "$value", $P1895
+    find_lex $P1898, "$/"
+    unless_null $P1898, vivify_555
+    new $P1898, "Hash"
+  vivify_555:
+    set $P1899, $P1898["dec_number"]
+    unless_null $P1899, vivify_556
+    new $P1899, "Undef"
+  vivify_556:
+    if $P1899, if_1897
+    find_lex $P1903, "$/"
+    unless_null $P1903, vivify_557
+    new $P1903, "Hash"
+  vivify_557:
+    set $P1904, $P1903["integer"]
+    unless_null $P1904, vivify_558
+    new $P1904, "Undef"
+  vivify_558:
+    $P1905 = $P1904."ast"()
+    set $P1896, $P1905
+    goto if_1897_end
+  if_1897:
+    find_lex $P1900, "$/"
+    unless_null $P1900, vivify_559
+    new $P1900, "Hash"
+  vivify_559:
+    set $P1901, $P1900["dec_number"]
+    unless_null $P1901, vivify_560
+    new $P1901, "Undef"
+  vivify_560:
+    $P1902 = $P1901."ast"()
+    set $P1896, $P1902
+  if_1897_end:
+    store_lex "$value", $P1896
+.annotate "line", 690
+    find_lex $P1907, "$/"
+    unless_null $P1907, vivify_561
+    new $P1907, "Hash"
+  vivify_561:
+    set $P1908, $P1907["sign"]
+    unless_null $P1908, vivify_562
+    new $P1908, "Undef"
+  vivify_562:
+    set $S1909, $P1908
+    iseq $I1910, $S1909, "-"
+    unless $I1910, if_1906_end
+    find_lex $P1911, "$value"
+    neg $P1912, $P1911
+    store_lex "$value", $P1912
+  if_1906_end:
+.annotate "line", 691
+    find_lex $P1913, "$/"
+    get_hll_global $P1914, ["PAST"], "Val"
+    find_lex $P1915, "$value"
+    $P1916 = $P1914."new"($P1915 :named("value"))
+    $P1917 = $P1913."!make"($P1916)
+.annotate "line", 688
+    .return ($P1917)
+  control_1892:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1918, exception, "payload"
+    .return ($P1918)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "quote:sym<apos>"  :subid("106_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1922
+.annotate "line", 694
+    new $P1921, 'ExceptionHandler'
+    set_addr $P1921, control_1920
+    $P1921."handle_types"(58)
+    push_eh $P1921
+    .lex "self", self
+    .lex "$/", param_1922
+    find_lex $P1923, "$/"
+    find_lex $P1924, "$/"
+    unless_null $P1924, vivify_563
+    new $P1924, "Hash"
+  vivify_563:
+    set $P1925, $P1924["quote_EXPR"]
+    unless_null $P1925, vivify_564
+    new $P1925, "Undef"
+  vivify_564:
+    $P1926 = $P1925."ast"()
+    $P1927 = $P1923."!make"($P1926)
+    .return ($P1927)
+  control_1920:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1928, exception, "payload"
+    .return ($P1928)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "quote:sym<dblq>"  :subid("107_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1932
+.annotate "line", 695
+    new $P1931, 'ExceptionHandler'
+    set_addr $P1931, control_1930
+    $P1931."handle_types"(58)
+    push_eh $P1931
+    .lex "self", self
+    .lex "$/", param_1932
+    find_lex $P1933, "$/"
+    find_lex $P1934, "$/"
+    unless_null $P1934, vivify_565
+    new $P1934, "Hash"
+  vivify_565:
+    set $P1935, $P1934["quote_EXPR"]
+    unless_null $P1935, vivify_566
+    new $P1935, "Undef"
+  vivify_566:
+    $P1936 = $P1935."ast"()
+    $P1937 = $P1933."!make"($P1936)
+    .return ($P1937)
+  control_1930:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1938, exception, "payload"
+    .return ($P1938)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "quote:sym<qq>"  :subid("108_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1942
+.annotate "line", 696
+    new $P1941, 'ExceptionHandler'
+    set_addr $P1941, control_1940
+    $P1941."handle_types"(58)
+    push_eh $P1941
+    .lex "self", self
+    .lex "$/", param_1942
+    find_lex $P1943, "$/"
+    find_lex $P1944, "$/"
+    unless_null $P1944, vivify_567
+    new $P1944, "Hash"
+  vivify_567:
+    set $P1945, $P1944["quote_EXPR"]
+    unless_null $P1945, vivify_568
+    new $P1945, "Undef"
+  vivify_568:
+    $P1946 = $P1945."ast"()
+    $P1947 = $P1943."!make"($P1946)
+    .return ($P1947)
+  control_1940:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1948, exception, "payload"
+    .return ($P1948)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "quote:sym<q>"  :subid("109_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1952
+.annotate "line", 697
+    new $P1951, 'ExceptionHandler'
+    set_addr $P1951, control_1950
+    $P1951."handle_types"(58)
+    push_eh $P1951
+    .lex "self", self
+    .lex "$/", param_1952
+    find_lex $P1953, "$/"
+    find_lex $P1954, "$/"
+    unless_null $P1954, vivify_569
+    new $P1954, "Hash"
+  vivify_569:
+    set $P1955, $P1954["quote_EXPR"]
+    unless_null $P1955, vivify_570
+    new $P1955, "Undef"
+  vivify_570:
+    $P1956 = $P1955."ast"()
+    $P1957 = $P1953."!make"($P1956)
+    .return ($P1957)
+  control_1950:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1958, exception, "payload"
+    .return ($P1958)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "quote:sym<Q>"  :subid("110_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1962
+.annotate "line", 698
+    new $P1961, 'ExceptionHandler'
+    set_addr $P1961, control_1960
+    $P1961."handle_types"(58)
+    push_eh $P1961
+    .lex "self", self
+    .lex "$/", param_1962
+    find_lex $P1963, "$/"
+    find_lex $P1964, "$/"
+    unless_null $P1964, vivify_571
+    new $P1964, "Hash"
+  vivify_571:
+    set $P1965, $P1964["quote_EXPR"]
+    unless_null $P1965, vivify_572
+    new $P1965, "Undef"
+  vivify_572:
+    $P1966 = $P1965."ast"()
+    $P1967 = $P1963."!make"($P1966)
+    .return ($P1967)
+  control_1960:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1968, exception, "payload"
+    .return ($P1968)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "quote:sym<Q:PIR>"  :subid("111_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1972
+.annotate "line", 699
+    new $P1971, 'ExceptionHandler'
+    set_addr $P1971, control_1970
+    $P1971."handle_types"(58)
+    push_eh $P1971
+    .lex "self", self
+    .lex "$/", param_1972
+.annotate "line", 700
+    find_lex $P1973, "$/"
+    get_hll_global $P1974, ["PAST"], "Op"
+    find_lex $P1975, "$/"
+    unless_null $P1975, vivify_573
+    new $P1975, "Hash"
+  vivify_573:
+    set $P1976, $P1975["quote_EXPR"]
+    unless_null $P1976, vivify_574
+    new $P1976, "Undef"
+  vivify_574:
+    $P1977 = $P1976."ast"()
+    $P1978 = $P1977."value"()
+    find_lex $P1979, "$/"
+    $P1980 = $P1974."new"($P1978 :named("inline"), "inline" :named("pasttype"), $P1979 :named("node"))
+    $P1981 = $P1973."!make"($P1980)
+.annotate "line", 699
+    .return ($P1981)
+  control_1970:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1982, exception, "payload"
+    .return ($P1982)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "quote:sym</ />"  :subid("112_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_1986
+    .param pmc param_1987 :optional
+    .param int has_param_1987 :opt_flag
+.annotate "line", 705
+    new $P1985, 'ExceptionHandler'
+    set_addr $P1985, control_1984
+    $P1985."handle_types"(58)
+    push_eh $P1985
+    .lex "self", self
+    .lex "$/", param_1986
+    if has_param_1987, optparam_575
+    new $P1988, "Undef"
+    set param_1987, $P1988
+  optparam_575:
+    .lex "$key", param_1987
+.annotate "line", 715
+    new $P1989, "Undef"
+    .lex "$regex", $P1989
+.annotate "line", 717
+    new $P1990, "Undef"
+    .lex "$past", $P1990
+.annotate "line", 706
+    find_lex $P1992, "$key"
+    set $S1993, $P1992
+    iseq $I1994, $S1993, "open"
+    unless $I1994, if_1991_end
+.annotate "line", 707
+
+            null $P0
+            set_hll_global ['Regex';'P6Regex';'Actions'], '$REGEXNAME', $P0
+        
+.annotate "line", 711
+    get_global $P1995, "@BLOCK"
+    unless_null $P1995, vivify_576
+    new $P1995, "ResizablePMCArray"
+  vivify_576:
+    set $P1996, $P1995[0]
+    unless_null $P1996, vivify_577
+    new $P1996, "Undef"
+  vivify_577:
+    $P1996."symbol"(unicode:"$\x{a2}", "lexical" :named("scope"))
+.annotate "line", 712
+    get_global $P1997, "@BLOCK"
+    unless_null $P1997, vivify_578
+    new $P1997, "ResizablePMCArray"
+  vivify_578:
+    set $P1998, $P1997[0]
+    unless_null $P1998, vivify_579
+    new $P1998, "Undef"
+  vivify_579:
+    $P1998."symbol"("$/", "lexical" :named("scope"))
+.annotate "line", 713
+    new $P1999, "Exception"
+    set $P1999['type'], 58
+    new $P2000, "Integer"
+    assign $P2000, 0
+    setattribute $P1999, 'payload', $P2000
+    throw $P1999
+  if_1991_end:
+.annotate "line", 716
+    get_hll_global $P2001, ["Regex";"P6Regex";"Actions"], "buildsub"
+    find_lex $P2002, "$/"
+    unless_null $P2002, vivify_580
+    new $P2002, "Hash"
+  vivify_580:
+    set $P2003, $P2002["p6regex"]
+    unless_null $P2003, vivify_581
+    new $P2003, "Undef"
+  vivify_581:
+    $P2004 = $P2003."ast"()
+    get_global $P2005, "@BLOCK"
+    $P2006 = $P2005."shift"()
+    $P2007 = $P2001($P2004, $P2006)
+    store_lex "$regex", $P2007
+.annotate "line", 718
+    get_hll_global $P2008, ["PAST"], "Op"
+.annotate "line", 720
+    get_hll_global $P2009, ["PAST"], "Var"
+    new $P2010, "ResizablePMCArray"
+    push $P2010, "Regex"
+    $P2011 = $P2009."new"("Regex" :named("name"), $P2010 :named("namespace"), "package" :named("scope"))
+    find_lex $P2012, "$regex"
+    $P2013 = $P2008."new"($P2011, $P2012, "callmethod" :named("pasttype"), "new" :named("name"))
+.annotate "line", 718
+    store_lex "$past", $P2013
+.annotate "line", 724
+    find_lex $P2014, "$regex"
+    find_lex $P2015, "$past"
+    unless_null $P2015, vivify_582
+    new $P2015, "Hash"
+    store_lex "$past", $P2015
+  vivify_582:
+    set $P2015["sink"], $P2014
+.annotate "line", 725
+    find_lex $P2016, "$/"
+    find_lex $P2017, "$past"
+    $P2018 = $P2016."!make"($P2017)
+.annotate "line", 705
+    .return ($P2018)
+  control_1984:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P2019, exception, "payload"
+    .return ($P2019)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "quote_escape:sym<$>"  :subid("113_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_2023
+.annotate "line", 728
+    new $P2022, 'ExceptionHandler'
+    set_addr $P2022, control_2021
+    $P2022."handle_types"(58)
+    push_eh $P2022
+    .lex "self", self
+    .lex "$/", param_2023
+    find_lex $P2024, "$/"
+    find_lex $P2025, "$/"
+    unless_null $P2025, vivify_583
+    new $P2025, "Hash"
+  vivify_583:
+    set $P2026, $P2025["variable"]
+    unless_null $P2026, vivify_584
+    new $P2026, "Undef"
+  vivify_584:
+    $P2027 = $P2026."ast"()
+    $P2028 = $P2024."!make"($P2027)
+    .return ($P2028)
+  control_2021:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P2029, exception, "payload"
+    .return ($P2029)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "quote_escape:sym<{ }>"  :subid("114_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_2033
+.annotate "line", 729
+    new $P2032, 'ExceptionHandler'
+    set_addr $P2032, control_2031
+    $P2032."handle_types"(58)
+    push_eh $P2032
+    .lex "self", self
+    .lex "$/", param_2033
+.annotate "line", 730
+    find_lex $P2034, "$/"
+    get_hll_global $P2035, ["PAST"], "Op"
+.annotate "line", 731
+    find_lex $P2036, "$/"
+    unless_null $P2036, vivify_585
+    new $P2036, "Hash"
+  vivify_585:
+    set $P2037, $P2036["block"]
+    unless_null $P2037, vivify_586
+    new $P2037, "Undef"
+  vivify_586:
+    $P2038 = $P2037."ast"()
+    $P2039 = "block_immediate"($P2038)
+    find_lex $P2040, "$/"
+    $P2041 = $P2035."new"($P2039, "set S*" :named("pirop"), $P2040 :named("node"))
+.annotate "line", 730
+    $P2042 = $P2034."!make"($P2041)
+.annotate "line", 729
+    .return ($P2042)
+  control_2031:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P2043, exception, "payload"
+    .return ($P2043)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "postfix:sym<.>"  :subid("115_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_2047
+.annotate "line", 737
+    new $P2046, 'ExceptionHandler'
+    set_addr $P2046, control_2045
+    $P2046."handle_types"(58)
+    push_eh $P2046
+    .lex "self", self
+    .lex "$/", param_2047
+    find_lex $P2048, "$/"
+    find_lex $P2049, "$/"
+    unless_null $P2049, vivify_587
+    new $P2049, "Hash"
+  vivify_587:
+    set $P2050, $P2049["dotty"]
+    unless_null $P2050, vivify_588
+    new $P2050, "Undef"
+  vivify_588:
+    $P2051 = $P2050."ast"()
+    $P2052 = $P2048."!make"($P2051)
+    .return ($P2052)
+  control_2045:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P2053, exception, "payload"
+    .return ($P2053)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "postfix:sym<++>"  :subid("116_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_2057
+.annotate "line", 739
+    new $P2056, 'ExceptionHandler'
+    set_addr $P2056, control_2055
+    $P2056."handle_types"(58)
+    push_eh $P2056
+    .lex "self", self
+    .lex "$/", param_2057
+.annotate "line", 740
+    find_lex $P2058, "$/"
+    get_hll_global $P2059, ["PAST"], "Op"
+.annotate "line", 741
+    new $P2060, "ResizablePMCArray"
+    push $P2060, "    clone %r, %0"
+    push $P2060, "    inc %0"
+    $P2061 = $P2059."new"("postfix:<++>" :named("name"), $P2060 :named("inline"), "inline" :named("pasttype"))
+.annotate "line", 740
+    $P2062 = $P2058."!make"($P2061)
+.annotate "line", 739
+    .return ($P2062)
+  control_2055:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P2063, exception, "payload"
+    .return ($P2063)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "postfix:sym<-->"  :subid("117_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_2067
+.annotate "line", 745
+    new $P2066, 'ExceptionHandler'
+    set_addr $P2066, control_2065
+    $P2066."handle_types"(58)
+    push_eh $P2066
+    .lex "self", self
+    .lex "$/", param_2067
+.annotate "line", 746
+    find_lex $P2068, "$/"
+    get_hll_global $P2069, ["PAST"], "Op"
+.annotate "line", 747
+    new $P2070, "ResizablePMCArray"
+    push $P2070, "    clone %r, %0"
+    push $P2070, "    dec %0"
+    $P2071 = $P2069."new"("postfix:<-->" :named("name"), $P2070 :named("inline"), "inline" :named("pasttype"))
+.annotate "line", 746
+    $P2072 = $P2068."!make"($P2071)
+.annotate "line", 745
+    .return ($P2072)
+  control_2065:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P2073, exception, "payload"
+    .return ($P2073)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "prefix:sym<make>"  :subid("118_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_2077
+.annotate "line", 751
+    new $P2076, 'ExceptionHandler'
+    set_addr $P2076, control_2075
+    $P2076."handle_types"(58)
+    push_eh $P2076
+    .lex "self", self
+    .lex "$/", param_2077
+.annotate "line", 752
+    find_lex $P2078, "$/"
+    get_hll_global $P2079, ["PAST"], "Op"
+.annotate "line", 753
+    get_hll_global $P2080, ["PAST"], "Var"
+    $P2081 = $P2080."new"("$/" :named("name"), "contextual" :named("scope"))
+    find_lex $P2082, "$/"
+    $P2083 = $P2079."new"($P2081, "callmethod" :named("pasttype"), "!make" :named("name"), $P2082 :named("node"))
+.annotate "line", 752
+    $P2084 = $P2078."!make"($P2083)
+.annotate "line", 751
+    .return ($P2084)
+  control_2075:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P2085, exception, "payload"
+    .return ($P2085)
+.end
+
+
+.namespace ["NQP";"Actions"]
+.sub "infix:sym<~~>"  :subid("119_1261064035.64813") :method :outer("11_1261064035.64813")
+    .param pmc param_2089
+.annotate "line", 760
+    new $P2088, 'ExceptionHandler'
+    set_addr $P2088, control_2087
+    $P2088."handle_types"(58)
+    push_eh $P2088
+    .lex "self", self
+    .lex "$/", param_2089
+.annotate "line", 761
+    find_lex $P2090, "$/"
+    get_hll_global $P2091, ["PAST"], "Op"
+    find_lex $P2092, "$/"
+    $P2093 = $P2091."new"("callmethod" :named("pasttype"), "ACCEPTS" :named("name"), $P2092 :named("node"))
+    $P2094 = $P2090."!make"($P2093)
+.annotate "line", 760
+    .return ($P2094)
+  control_2087:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P2095, exception, "payload"
+    .return ($P2095)
+.end
+
+
+.namespace ["NQP";"RegexActions"]
+.sub "_block2096"  :subid("120_1261064035.64813") :outer("11_1261064035.64813")
+.annotate "line", 765
+    .const 'Sub' $P2132 = "124_1261064035.64813" 
+    capture_lex $P2132
+    .const 'Sub' $P2122 = "123_1261064035.64813" 
+    capture_lex $P2122
+    .const 'Sub' $P2112 = "122_1261064035.64813" 
+    capture_lex $P2112
+    .const 'Sub' $P2098 = "121_1261064035.64813" 
+    capture_lex $P2098
+.annotate "line", 776
+    .const 'Sub' $P2132 = "124_1261064035.64813" 
+    capture_lex $P2132
+.annotate "line", 765
+    .return ($P2132)
+.end
+
+
+.namespace ["NQP";"RegexActions"]
+.sub "metachar:sym<:my>"  :subid("121_1261064035.64813") :method :outer("120_1261064035.64813")
+    .param pmc param_2101
+.annotate "line", 767
+    new $P2100, 'ExceptionHandler'
+    set_addr $P2100, control_2099
+    $P2100."handle_types"(58)
+    push_eh $P2100
+    .lex "self", self
+    .lex "$/", param_2101
+.annotate "line", 768
+    new $P2102, "Undef"
+    .lex "$past", $P2102
+    find_lex $P2103, "$/"
+    unless_null $P2103, vivify_589
+    new $P2103, "Hash"
+  vivify_589:
+    set $P2104, $P2103["statement"]
+    unless_null $P2104, vivify_590
+    new $P2104, "Undef"
+  vivify_590:
+    $P2105 = $P2104."ast"()
+    store_lex "$past", $P2105
+.annotate "line", 769
+    find_lex $P2106, "$/"
+    get_hll_global $P2107, ["PAST"], "Regex"
+    find_lex $P2108, "$past"
+    $P2109 = $P2107."new"($P2108, "pastnode" :named("pasttype"))
+    $P2110 = $P2106."!make"($P2109)
+.annotate "line", 767
+    .return ($P2110)
+  control_2099:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P2111, exception, "payload"
+    .return ($P2111)
+.end
+
+
+.namespace ["NQP";"RegexActions"]
+.sub "metachar:sym<{ }>"  :subid("122_1261064035.64813") :method :outer("120_1261064035.64813")
+    .param pmc param_2115
+.annotate "line", 772
+    new $P2114, 'ExceptionHandler'
+    set_addr $P2114, control_2113
+    $P2114."handle_types"(58)
+    push_eh $P2114
+    .lex "self", self
+    .lex "$/", param_2115
+    find_lex $P2116, "$/"
+    find_lex $P2117, "$/"
+    unless_null $P2117, vivify_591
+    new $P2117, "Hash"
+  vivify_591:
+    set $P2118, $P2117["codeblock"]
+    unless_null $P2118, vivify_592
+    new $P2118, "Undef"
+  vivify_592:
+    $P2119 = $P2118."ast"()
+    $P2120 = $P2116."!make"($P2119)
+    .return ($P2120)
+  control_2113:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P2121, exception, "payload"
+    .return ($P2121)
+.end
+
+
+.namespace ["NQP";"RegexActions"]
+.sub "assertion:sym<{ }>"  :subid("123_1261064035.64813") :method :outer("120_1261064035.64813")
+    .param pmc param_2125
+.annotate "line", 774
+    new $P2124, 'ExceptionHandler'
+    set_addr $P2124, control_2123
+    $P2124."handle_types"(58)
+    push_eh $P2124
+    .lex "self", self
+    .lex "$/", param_2125
+    find_lex $P2126, "$/"
+    find_lex $P2127, "$/"
+    unless_null $P2127, vivify_593
+    new $P2127, "Hash"
+  vivify_593:
+    set $P2128, $P2127["codeblock"]
+    unless_null $P2128, vivify_594
+    new $P2128, "Undef"
+  vivify_594:
+    $P2129 = $P2128."ast"()
+    $P2130 = $P2126."!make"($P2129)
+    .return ($P2130)
+  control_2123:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P2131, exception, "payload"
+    .return ($P2131)
+.end
+
+
+.namespace ["NQP";"RegexActions"]
+.sub "codeblock"  :subid("124_1261064035.64813") :method :outer("120_1261064035.64813")
+    .param pmc param_2135
+.annotate "line", 776
+    new $P2134, 'ExceptionHandler'
+    set_addr $P2134, control_2133
+    $P2134."handle_types"(58)
+    push_eh $P2134
+    .lex "self", self
+    .lex "$/", param_2135
+.annotate "line", 777
+    new $P2136, "Undef"
+    .lex "$block", $P2136
+.annotate "line", 779
+    new $P2137, "Undef"
+    .lex "$past", $P2137
+.annotate "line", 777
+    find_lex $P2138, "$/"
+    unless_null $P2138, vivify_595
+    new $P2138, "Hash"
+  vivify_595:
+    set $P2139, $P2138["block"]
+    unless_null $P2139, vivify_596
+    new $P2139, "Undef"
+  vivify_596:
+    $P2140 = $P2139."ast"()
+    store_lex "$block", $P2140
+.annotate "line", 778
+    find_lex $P2141, "$block"
+    $P2141."blocktype"("immediate")
+.annotate "line", 780
+    get_hll_global $P2142, ["PAST"], "Regex"
+.annotate "line", 781
+    get_hll_global $P2143, ["PAST"], "Stmts"
+.annotate "line", 782
+    get_hll_global $P2144, ["PAST"], "Op"
+.annotate "line", 783
+    get_hll_global $P2145, ["PAST"], "Var"
+    $P2146 = $P2145."new"("$/" :named("name"))
+.annotate "line", 784
+    get_hll_global $P2147, ["PAST"], "Op"
+.annotate "line", 785
+    get_hll_global $P2148, ["PAST"], "Var"
+    $P2149 = $P2148."new"(unicode:"$\x{a2}" :named("name"))
+    $P2150 = $P2147."new"($P2149, "MATCH" :named("name"), "callmethod" :named("pasttype"))
+.annotate "line", 784
+    $P2151 = $P2144."new"($P2146, $P2150, "bind" :named("pasttype"))
+.annotate "line", 782
+    find_lex $P2152, "$block"
+    $P2153 = $P2143."new"($P2151, $P2152)
+.annotate "line", 781
+    $P2154 = $P2142."new"($P2153, "pastnode" :named("pasttype"))
+.annotate "line", 780
+    store_lex "$past", $P2154
+.annotate "line", 795
+    find_lex $P2155, "$/"
+    find_lex $P2156, "$past"
+    $P2157 = $P2155."!make"($P2156)
+.annotate "line", 776
+    .return ($P2157)
+  control_2133:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P2158, exception, "payload"
+    .return ($P2158)
+.end
+
+### .include 'src/cheats/nqp-builtins.pir'
+.namespace []
+
+.sub 'print'
+    .param pmc list            :slurpy
+    .local pmc list_it
+    list_it = iter list
+  list_loop:
+    unless list_it goto list_done
+    $P0 = shift list_it
+    print $P0
+    goto list_loop
+  list_done:
+    .return (1)
+.end
+
+.sub 'say'
+    .param pmc list            :slurpy
+    .tailcall 'print'(list :flat, "\n")
+.end
+
+.sub 'ok'
+    .param pmc    condition
+    .param string description :optional
+    .param int    has_desc    :opt_flag
+    if condition goto it_was_ok
+        print "not "
+  it_was_ok:
+    print "ok "
+    $P0 = get_global "$test_counter"
+    $P0 += 1
+    print $P0
+    unless has_desc goto no_description
+        print " # "
+        print description
+  no_description:
+    print "\n"
+    .return (1)
+.end
+
+.sub 'plan'
+    .param int quantity
+    print "1.."
+    print quantity
+    print "\n"
+.end
+
+.sub '' :anon :init :load
+    $P0 = box 0
+    set_global '$test_counter', $P0
+.end
+
+
+
+.namespace ['NQP';'Compiler']
+
+.sub '' :anon :load :init
+    .local pmc p6meta, nqpproto
+    p6meta = get_hll_global 'P6metaclass'
+    nqpproto = p6meta.'new_class'('NQP::Compiler', 'parent'=>'HLL::Compiler')
+    nqpproto.'language'('NQP-rx')
+    $P0 = get_hll_global ['NQP'], 'Grammar'
+    nqpproto.'parsegrammar'($P0)
+    $P0 = get_hll_global ['NQP'], 'Actions'
+    nqpproto.'parseactions'($P0)
+    $P0 = split ' ', 'e=s help|h target=s dumper=s trace|t=s encoding=s output|o=s combine version|v parsetrace'
+    setattribute nqpproto, '@cmdoptions', $P0
+.end
+
+.sub 'main' :main
+    .param pmc args_str
+
+    $P0 = compreg 'NQP-rx'
+    $P1 = $P0.'command_line'(args_str, 'encoding'=>'utf8', 'transcode'=>'ascii iso-8859-1')
+    exit 0
+.end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Added: branches/orderedhash_revamp/ext/nqp-rx/src/stage0/P6Regex-s0.pir
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/src/stage0/P6Regex-s0.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,11818 @@
+# Copyright (C) 2009, The Perl Foundation.
+# $Id$
+
+=head1 NAME
+
+Regex::P6Regex - Parser/compiler for Perl 6 regexes
+
+=head1 DESCRIPTION
+
+=cut
+
+.sub '' :anon :load :init
+    load_bytecode 'HLL.pbc'
+.end
+
+### .include 'gen/p6regex-grammar.pir'
+
+.namespace []
+.sub "_block11"  :anon :subid("10_1261064009.3328")
+.annotate "line", 0
+    get_hll_global $P14, ["Regex";"P6Regex";"Grammar"], "_block13" 
+    capture_lex $P14
+.annotate "line", 3
+    get_hll_global $P14, ["Regex";"P6Regex";"Grammar"], "_block13" 
+    capture_lex $P14
+    $P579 = $P14()
+.annotate "line", 1
+    .return ($P579)
+.end
+
+
+.namespace []
+.sub "" :load :init :subid("post158") :outer("10_1261064009.3328")
+.annotate "line", 0
+    .const 'Sub' $P12 = "10_1261064009.3328" 
+    .local pmc block
+    set block, $P12
+    $P580 = get_root_global ["parrot"], "P6metaclass"
+    $P580."new_class"("Regex::P6Regex::Grammar", "HLL::Grammar" :named("parent"))
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "_block13"  :subid("11_1261064009.3328") :outer("10_1261064009.3328")
+.annotate "line", 3
+    .const 'Sub' $P571 = "156_1261064009.3328" 
+    capture_lex $P571
+    .const 'Sub' $P563 = "154_1261064009.3328" 
+    capture_lex $P563
+    .const 'Sub' $P555 = "152_1261064009.3328" 
+    capture_lex $P555
+    .const 'Sub' $P534 = "147_1261064009.3328" 
+    capture_lex $P534
+    .const 'Sub' $P499 = "141_1261064009.3328" 
+    capture_lex $P499
+    .const 'Sub' $P487 = "138_1261064009.3328" 
+    capture_lex $P487
+    .const 'Sub' $P474 = "135_1261064009.3328" 
+    capture_lex $P474
+    .const 'Sub' $P468 = "133_1261064009.3328" 
+    capture_lex $P468
+    .const 'Sub' $P457 = "130_1261064009.3328" 
+    capture_lex $P457
+    .const 'Sub' $P446 = "127_1261064009.3328" 
+    capture_lex $P446
+    .const 'Sub' $P437 = "123_1261064009.3328" 
+    capture_lex $P437
+    .const 'Sub' $P431 = "121_1261064009.3328" 
+    capture_lex $P431
+    .const 'Sub' $P425 = "119_1261064009.3328" 
+    capture_lex $P425
+    .const 'Sub' $P419 = "117_1261064009.3328" 
+    capture_lex $P419
+    .const 'Sub' $P413 = "115_1261064009.3328" 
+    capture_lex $P413
+    .const 'Sub' $P402 = "113_1261064009.3328" 
+    capture_lex $P402
+    .const 'Sub' $P391 = "111_1261064009.3328" 
+    capture_lex $P391
+    .const 'Sub' $P383 = "109_1261064009.3328" 
+    capture_lex $P383
+    .const 'Sub' $P377 = "107_1261064009.3328" 
+    capture_lex $P377
+    .const 'Sub' $P371 = "105_1261064009.3328" 
+    capture_lex $P371
+    .const 'Sub' $P365 = "103_1261064009.3328" 
+    capture_lex $P365
+    .const 'Sub' $P359 = "101_1261064009.3328" 
+    capture_lex $P359
+    .const 'Sub' $P353 = "99_1261064009.3328" 
+    capture_lex $P353
+    .const 'Sub' $P347 = "97_1261064009.3328" 
+    capture_lex $P347
+    .const 'Sub' $P341 = "95_1261064009.3328" 
+    capture_lex $P341
+    .const 'Sub' $P335 = "93_1261064009.3328" 
+    capture_lex $P335
+    .const 'Sub' $P323 = "89_1261064009.3328" 
+    capture_lex $P323
+    .const 'Sub' $P311 = "87_1261064009.3328" 
+    capture_lex $P311
+    .const 'Sub' $P304 = "85_1261064009.3328" 
+    capture_lex $P304
+    .const 'Sub' $P287 = "83_1261064009.3328" 
+    capture_lex $P287
+    .const 'Sub' $P280 = "81_1261064009.3328" 
+    capture_lex $P280
+    .const 'Sub' $P274 = "79_1261064009.3328" 
+    capture_lex $P274
+    .const 'Sub' $P268 = "77_1261064009.3328" 
+    capture_lex $P268
+    .const 'Sub' $P261 = "75_1261064009.3328" 
+    capture_lex $P261
+    .const 'Sub' $P254 = "73_1261064009.3328" 
+    capture_lex $P254
+    .const 'Sub' $P247 = "71_1261064009.3328" 
+    capture_lex $P247
+    .const 'Sub' $P240 = "69_1261064009.3328" 
+    capture_lex $P240
+    .const 'Sub' $P234 = "67_1261064009.3328" 
+    capture_lex $P234
+    .const 'Sub' $P228 = "65_1261064009.3328" 
+    capture_lex $P228
+    .const 'Sub' $P222 = "63_1261064009.3328" 
+    capture_lex $P222
+    .const 'Sub' $P216 = "61_1261064009.3328" 
+    capture_lex $P216
+    .const 'Sub' $P210 = "59_1261064009.3328" 
+    capture_lex $P210
+    .const 'Sub' $P205 = "57_1261064009.3328" 
+    capture_lex $P205
+    .const 'Sub' $P200 = "55_1261064009.3328" 
+    capture_lex $P200
+    .const 'Sub' $P194 = "53_1261064009.3328" 
+    capture_lex $P194
+    .const 'Sub' $P188 = "51_1261064009.3328" 
+    capture_lex $P188
+    .const 'Sub' $P182 = "49_1261064009.3328" 
+    capture_lex $P182
+    .const 'Sub' $P166 = "44_1261064009.3328" 
+    capture_lex $P166
+    .const 'Sub' $P154 = "42_1261064009.3328" 
+    capture_lex $P154
+    .const 'Sub' $P147 = "40_1261064009.3328" 
+    capture_lex $P147
+    .const 'Sub' $P140 = "38_1261064009.3328" 
+    capture_lex $P140
+    .const 'Sub' $P133 = "36_1261064009.3328" 
+    capture_lex $P133
+    .const 'Sub' $P114 = "31_1261064009.3328" 
+    capture_lex $P114
+    .const 'Sub' $P101 = "28_1261064009.3328" 
+    capture_lex $P101
+    .const 'Sub' $P94 = "26_1261064009.3328" 
+    capture_lex $P94
+    .const 'Sub' $P82 = "24_1261064009.3328" 
+    capture_lex $P82
+    .const 'Sub' $P75 = "22_1261064009.3328" 
+    capture_lex $P75
+    .const 'Sub' $P63 = "20_1261064009.3328" 
+    capture_lex $P63
+    .const 'Sub' $P56 = "18_1261064009.3328" 
+    capture_lex $P56
+    .const 'Sub' $P46 = "15_1261064009.3328" 
+    capture_lex $P46
+    .const 'Sub' $P38 = "13_1261064009.3328" 
+    capture_lex $P38
+    .const 'Sub' $P15 = "12_1261064009.3328" 
+    capture_lex $P15
+    .const 'Sub' $P571 = "156_1261064009.3328" 
+    capture_lex $P571
+    .return ($P571)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "obs"  :subid("12_1261064009.3328") :method :outer("11_1261064009.3328")
+    .param pmc param_18
+    .param pmc param_19
+    .param pmc param_20 :optional
+    .param int has_param_20 :opt_flag
+.annotate "line", 3
+    new $P17, 'ExceptionHandler'
+    set_addr $P17, control_16
+    $P17."handle_types"(58)
+    push_eh $P17
+    .lex "self", self
+    .lex "$old", param_18
+    .lex "$new", param_19
+    if has_param_20, optparam_159
+    new $P21, "String"
+    assign $P21, "in Perl 6"
+    set param_20, $P21
+  optparam_159:
+    .lex "$when", param_20
+.annotate "line", 4
+    find_lex $P22, "self"
+    new $P23, "String"
+    assign $P23, "Obsolete use of "
+    find_lex $P24, "$old"
+    set $S25, $P24
+    concat $P26, $P23, $S25
+    concat $P27, $P26, ";"
+.annotate "line", 5
+    find_lex $P28, "$when"
+    set $S29, $P28
+    concat $P30, $P27, $S29
+    concat $P31, $P30, " please use "
+    find_lex $P32, "$new"
+    set $S33, $P32
+    concat $P34, $P31, $S33
+    concat $P35, $P34, " instead"
+    $P36 = $P22."panic"($P35)
+.annotate "line", 3
+    .return ($P36)
+  control_16:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P37, exception, "payload"
+    .return ($P37)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "ws"  :subid("13_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx39_tgt
+    .local int rx39_pos
+    .local int rx39_off
+    .local int rx39_eos
+    .local int rx39_rep
+    .local pmc rx39_cur
+    (rx39_cur, rx39_pos, rx39_tgt) = self."!cursor_start"()
+    rx39_cur."!cursor_debug"("START ", "ws")
+    .lex unicode:"$\x{a2}", rx39_cur
+    .local pmc match
+    .lex "$/", match
+    length rx39_eos, rx39_tgt
+    set rx39_off, 0
+    lt rx39_pos, 2, rx39_start
+    sub rx39_off, rx39_pos, 1
+    substr rx39_tgt, rx39_tgt, rx39_off
+  rx39_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan42_done
+    goto rxscan42_scan
+  rxscan42_loop:
+    ($P10) = rx39_cur."from"()
+    inc $P10
+    set rx39_pos, $P10
+    ge rx39_pos, rx39_eos, rxscan42_done
+  rxscan42_scan:
+    set_addr $I10, rxscan42_loop
+    rx39_cur."!mark_push"(0, rx39_pos, $I10)
+  rxscan42_done:
+.annotate "line", 8
+  # rx rxquantr43 ** 0..*
+    set_addr $I45, rxquantr43_done
+    rx39_cur."!mark_push"(0, rx39_pos, $I45)
+  rxquantr43_loop:
+  alt44_0:
+    set_addr $I10, alt44_1
+    rx39_cur."!mark_push"(0, rx39_pos, $I10)
+  # rx charclass_q s r 1..-1
+    sub $I10, rx39_pos, rx39_off
+    find_not_cclass $I11, 32, rx39_tgt, $I10, rx39_eos
+    add $I12, $I10, 1
+    lt $I11, $I12, rx39_fail
+    add rx39_pos, rx39_off, $I11
+    goto alt44_end
+  alt44_1:
+  # rx literal  "#"
+    add $I11, rx39_pos, 1
+    gt $I11, rx39_eos, rx39_fail
+    sub $I11, rx39_pos, rx39_off
+    substr $S10, rx39_tgt, $I11, 1
+    ne $S10, "#", rx39_fail
+    add rx39_pos, 1
+  # rx charclass_q N r 0..-1
+    sub $I10, rx39_pos, rx39_off
+    find_cclass $I11, 4096, rx39_tgt, $I10, rx39_eos
+    add rx39_pos, rx39_off, $I11
+  alt44_end:
+    (rx39_rep) = rx39_cur."!mark_commit"($I45)
+    rx39_cur."!mark_push"(rx39_rep, rx39_pos, $I45)
+    goto rxquantr43_loop
+  rxquantr43_done:
+  # rx pass
+    rx39_cur."!cursor_pass"(rx39_pos, "ws")
+    rx39_cur."!cursor_debug"("PASS  ", "ws", " at pos=", rx39_pos)
+    .return (rx39_cur)
+  rx39_fail:
+.annotate "line", 3
+    (rx39_rep, rx39_pos, $I10, $P10) = rx39_cur."!mark_fail"(0)
+    lt rx39_pos, -1, rx39_done
+    eq rx39_pos, -1, rx39_fail
+    jump $I10
+  rx39_done:
+    rx39_cur."!cursor_fail"()
+    rx39_cur."!cursor_debug"("FAIL  ", "ws")
+    .return (rx39_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__ws"  :subid("14_1261064009.3328") :method
+.annotate "line", 3
+    new $P41, "ResizablePMCArray"
+    push $P41, ""
+    .return ($P41)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "normspace"  :subid("15_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .const 'Sub' $P52 = "17_1261064009.3328" 
+    capture_lex $P52
+    .local string rx47_tgt
+    .local int rx47_pos
+    .local int rx47_off
+    .local int rx47_eos
+    .local int rx47_rep
+    .local pmc rx47_cur
+    (rx47_cur, rx47_pos, rx47_tgt) = self."!cursor_start"()
+    rx47_cur."!cursor_debug"("START ", "normspace")
+    .lex unicode:"$\x{a2}", rx47_cur
+    .local pmc match
+    .lex "$/", match
+    length rx47_eos, rx47_tgt
+    set rx47_off, 0
+    lt rx47_pos, 2, rx47_start
+    sub rx47_off, rx47_pos, 1
+    substr rx47_tgt, rx47_tgt, rx47_off
+  rx47_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan50_done
+    goto rxscan50_scan
+  rxscan50_loop:
+    ($P10) = rx47_cur."from"()
+    inc $P10
+    set rx47_pos, $P10
+    ge rx47_pos, rx47_eos, rxscan50_done
+  rxscan50_scan:
+    set_addr $I10, rxscan50_loop
+    rx47_cur."!mark_push"(0, rx47_pos, $I10)
+  rxscan50_done:
+.annotate "line", 10
+  # rx subrule "before" subtype=zerowidth negate=
+    rx47_cur."!cursor_pos"(rx47_pos)
+    .const 'Sub' $P52 = "17_1261064009.3328" 
+    capture_lex $P52
+    $P10 = rx47_cur."before"($P52)
+    unless $P10, rx47_fail
+  # rx subrule "ws" subtype=method negate=
+    rx47_cur."!cursor_pos"(rx47_pos)
+    $P10 = rx47_cur."ws"()
+    unless $P10, rx47_fail
+    rx47_pos = $P10."pos"()
+  # rx pass
+    rx47_cur."!cursor_pass"(rx47_pos, "normspace")
+    rx47_cur."!cursor_debug"("PASS  ", "normspace", " at pos=", rx47_pos)
+    .return (rx47_cur)
+  rx47_fail:
+.annotate "line", 3
+    (rx47_rep, rx47_pos, $I10, $P10) = rx47_cur."!mark_fail"(0)
+    lt rx47_pos, -1, rx47_done
+    eq rx47_pos, -1, rx47_fail
+    jump $I10
+  rx47_done:
+    rx47_cur."!cursor_fail"()
+    rx47_cur."!cursor_debug"("FAIL  ", "normspace")
+    .return (rx47_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__normspace"  :subid("16_1261064009.3328") :method
+.annotate "line", 3
+    new $P49, "ResizablePMCArray"
+    push $P49, ""
+    .return ($P49)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "_block51"  :anon :subid("17_1261064009.3328") :method :outer("15_1261064009.3328")
+.annotate "line", 10
+    .local string rx53_tgt
+    .local int rx53_pos
+    .local int rx53_off
+    .local int rx53_eos
+    .local int rx53_rep
+    .local pmc rx53_cur
+    (rx53_cur, rx53_pos, rx53_tgt) = self."!cursor_start"()
+    rx53_cur."!cursor_debug"("START ", "")
+    .lex unicode:"$\x{a2}", rx53_cur
+    .local pmc match
+    .lex "$/", match
+    length rx53_eos, rx53_tgt
+    set rx53_off, 0
+    lt rx53_pos, 2, rx53_start
+    sub rx53_off, rx53_pos, 1
+    substr rx53_tgt, rx53_tgt, rx53_off
+  rx53_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan54_done
+    goto rxscan54_scan
+  rxscan54_loop:
+    ($P10) = rx53_cur."from"()
+    inc $P10
+    set rx53_pos, $P10
+    ge rx53_pos, rx53_eos, rxscan54_done
+  rxscan54_scan:
+    set_addr $I10, rxscan54_loop
+    rx53_cur."!mark_push"(0, rx53_pos, $I10)
+  rxscan54_done:
+  alt55_0:
+    set_addr $I10, alt55_1
+    rx53_cur."!mark_push"(0, rx53_pos, $I10)
+  # rx charclass s
+    ge rx53_pos, rx53_eos, rx53_fail
+    sub $I10, rx53_pos, rx53_off
+    is_cclass $I11, 32, rx53_tgt, $I10
+    unless $I11, rx53_fail
+    inc rx53_pos
+    goto alt55_end
+  alt55_1:
+  # rx literal  "#"
+    add $I11, rx53_pos, 1
+    gt $I11, rx53_eos, rx53_fail
+    sub $I11, rx53_pos, rx53_off
+    substr $S10, rx53_tgt, $I11, 1
+    ne $S10, "#", rx53_fail
+    add rx53_pos, 1
+  alt55_end:
+  # rx pass
+    rx53_cur."!cursor_pass"(rx53_pos, "")
+    rx53_cur."!cursor_debug"("PASS  ", "", " at pos=", rx53_pos)
+    .return (rx53_cur)
+  rx53_fail:
+    (rx53_rep, rx53_pos, $I10, $P10) = rx53_cur."!mark_fail"(0)
+    lt rx53_pos, -1, rx53_done
+    eq rx53_pos, -1, rx53_fail
+    jump $I10
+  rx53_done:
+    rx53_cur."!cursor_fail"()
+    rx53_cur."!cursor_debug"("FAIL  ", "")
+    .return (rx53_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "arg"  :subid("18_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx57_tgt
+    .local int rx57_pos
+    .local int rx57_off
+    .local int rx57_eos
+    .local int rx57_rep
+    .local pmc rx57_cur
+    (rx57_cur, rx57_pos, rx57_tgt) = self."!cursor_start"()
+    rx57_cur."!cursor_debug"("START ", "arg")
+    .lex unicode:"$\x{a2}", rx57_cur
+    .local pmc match
+    .lex "$/", match
+    length rx57_eos, rx57_tgt
+    set rx57_off, 0
+    lt rx57_pos, 2, rx57_start
+    sub rx57_off, rx57_pos, 1
+    substr rx57_tgt, rx57_tgt, rx57_off
+  rx57_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan60_done
+    goto rxscan60_scan
+  rxscan60_loop:
+    ($P10) = rx57_cur."from"()
+    inc $P10
+    set rx57_pos, $P10
+    ge rx57_pos, rx57_eos, rxscan60_done
+  rxscan60_scan:
+    set_addr $I10, rxscan60_loop
+    rx57_cur."!mark_push"(0, rx57_pos, $I10)
+  rxscan60_done:
+  alt61_0:
+.annotate "line", 13
+    set_addr $I10, alt61_1
+    rx57_cur."!mark_push"(0, rx57_pos, $I10)
+.annotate "line", 14
+  # rx enumcharlist negate=0 zerowidth
+    ge rx57_pos, rx57_eos, rx57_fail
+    sub $I10, rx57_pos, rx57_off
+    substr $S10, rx57_tgt, $I10, 1
+    index $I11, "'", $S10
+    lt $I11, 0, rx57_fail
+  # rx subrule "quote_EXPR" subtype=capture negate=
+    rx57_cur."!cursor_pos"(rx57_pos)
+    $P10 = rx57_cur."quote_EXPR"(":q")
+    unless $P10, rx57_fail
+    rx57_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("quote_EXPR")
+    rx57_pos = $P10."pos"()
+    goto alt61_end
+  alt61_1:
+    set_addr $I10, alt61_2
+    rx57_cur."!mark_push"(0, rx57_pos, $I10)
+.annotate "line", 15
+  # rx enumcharlist negate=0 zerowidth
+    ge rx57_pos, rx57_eos, rx57_fail
+    sub $I10, rx57_pos, rx57_off
+    substr $S10, rx57_tgt, $I10, 1
+    index $I11, "\"", $S10
+    lt $I11, 0, rx57_fail
+  # rx subrule "quote_EXPR" subtype=capture negate=
+    rx57_cur."!cursor_pos"(rx57_pos)
+    $P10 = rx57_cur."quote_EXPR"(":qq")
+    unless $P10, rx57_fail
+    rx57_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("quote_EXPR")
+    rx57_pos = $P10."pos"()
+    goto alt61_end
+  alt61_2:
+.annotate "line", 16
+  # rx subcapture "val"
+    set_addr $I10, rxcap_62_fail
+    rx57_cur."!mark_push"(0, rx57_pos, $I10)
+  # rx charclass_q d r 1..-1
+    sub $I10, rx57_pos, rx57_off
+    find_not_cclass $I11, 8, rx57_tgt, $I10, rx57_eos
+    add $I12, $I10, 1
+    lt $I11, $I12, rx57_fail
+    add rx57_pos, rx57_off, $I11
+    set_addr $I10, rxcap_62_fail
+    ($I12, $I11) = rx57_cur."!mark_peek"($I10)
+    rx57_cur."!cursor_pos"($I11)
+    ($P10) = rx57_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx57_pos, "")
+    rx57_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("val")
+    goto rxcap_62_done
+  rxcap_62_fail:
+    goto rx57_fail
+  rxcap_62_done:
+  alt61_end:
+.annotate "line", 12
+  # rx pass
+    rx57_cur."!cursor_pass"(rx57_pos, "arg")
+    rx57_cur."!cursor_debug"("PASS  ", "arg", " at pos=", rx57_pos)
+    .return (rx57_cur)
+  rx57_fail:
+.annotate "line", 3
+    (rx57_rep, rx57_pos, $I10, $P10) = rx57_cur."!mark_fail"(0)
+    lt rx57_pos, -1, rx57_done
+    eq rx57_pos, -1, rx57_fail
+    jump $I10
+  rx57_done:
+    rx57_cur."!cursor_fail"()
+    rx57_cur."!cursor_debug"("FAIL  ", "arg")
+    .return (rx57_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__arg"  :subid("19_1261064009.3328") :method
+.annotate "line", 3
+    new $P59, "ResizablePMCArray"
+    push $P59, ""
+    push $P59, "\""
+    push $P59, "'"
+    .return ($P59)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "arglist"  :subid("20_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx64_tgt
+    .local int rx64_pos
+    .local int rx64_off
+    .local int rx64_eos
+    .local int rx64_rep
+    .local pmc rx64_cur
+    (rx64_cur, rx64_pos, rx64_tgt) = self."!cursor_start"()
+    rx64_cur."!cursor_debug"("START ", "arglist")
+    rx64_cur."!cursor_caparray"("arg")
+    .lex unicode:"$\x{a2}", rx64_cur
+    .local pmc match
+    .lex "$/", match
+    length rx64_eos, rx64_tgt
+    set rx64_off, 0
+    lt rx64_pos, 2, rx64_start
+    sub rx64_off, rx64_pos, 1
+    substr rx64_tgt, rx64_tgt, rx64_off
+  rx64_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan67_done
+    goto rxscan67_scan
+  rxscan67_loop:
+    ($P10) = rx64_cur."from"()
+    inc $P10
+    set rx64_pos, $P10
+    ge rx64_pos, rx64_eos, rxscan67_done
+  rxscan67_scan:
+    set_addr $I10, rxscan67_loop
+    rx64_cur."!mark_push"(0, rx64_pos, $I10)
+  rxscan67_done:
+.annotate "line", 20
+  # rx subrule "ws" subtype=method negate=
+    rx64_cur."!cursor_pos"(rx64_pos)
+    $P10 = rx64_cur."ws"()
+    unless $P10, rx64_fail
+    rx64_pos = $P10."pos"()
+  # rx subrule "arg" subtype=capture negate=
+    rx64_cur."!cursor_pos"(rx64_pos)
+    $P10 = rx64_cur."arg"()
+    unless $P10, rx64_fail
+    rx64_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("arg")
+    rx64_pos = $P10."pos"()
+  # rx subrule "ws" subtype=method negate=
+    rx64_cur."!cursor_pos"(rx64_pos)
+    $P10 = rx64_cur."ws"()
+    unless $P10, rx64_fail
+    rx64_pos = $P10."pos"()
+  # rx rxquantr70 ** 0..*
+    set_addr $I73, rxquantr70_done
+    rx64_cur."!mark_push"(0, rx64_pos, $I73)
+  rxquantr70_loop:
+  # rx subrule "ws" subtype=method negate=
+    rx64_cur."!cursor_pos"(rx64_pos)
+    $P10 = rx64_cur."ws"()
+    unless $P10, rx64_fail
+    rx64_pos = $P10."pos"()
+  # rx literal  ","
+    add $I11, rx64_pos, 1
+    gt $I11, rx64_eos, rx64_fail
+    sub $I11, rx64_pos, rx64_off
+    substr $S10, rx64_tgt, $I11, 1
+    ne $S10, ",", rx64_fail
+    add rx64_pos, 1
+  # rx subrule "ws" subtype=method negate=
+    rx64_cur."!cursor_pos"(rx64_pos)
+    $P10 = rx64_cur."ws"()
+    unless $P10, rx64_fail
+    rx64_pos = $P10."pos"()
+  # rx subrule "arg" subtype=capture negate=
+    rx64_cur."!cursor_pos"(rx64_pos)
+    $P10 = rx64_cur."arg"()
+    unless $P10, rx64_fail
+    rx64_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("arg")
+    rx64_pos = $P10."pos"()
+    (rx64_rep) = rx64_cur."!mark_commit"($I73)
+    rx64_cur."!mark_push"(rx64_rep, rx64_pos, $I73)
+    goto rxquantr70_loop
+  rxquantr70_done:
+  # rx subrule "ws" subtype=method negate=
+    rx64_cur."!cursor_pos"(rx64_pos)
+    $P10 = rx64_cur."ws"()
+    unless $P10, rx64_fail
+    rx64_pos = $P10."pos"()
+  # rx pass
+    rx64_cur."!cursor_pass"(rx64_pos, "arglist")
+    rx64_cur."!cursor_debug"("PASS  ", "arglist", " at pos=", rx64_pos)
+    .return (rx64_cur)
+  rx64_fail:
+.annotate "line", 3
+    (rx64_rep, rx64_pos, $I10, $P10) = rx64_cur."!mark_fail"(0)
+    lt rx64_pos, -1, rx64_done
+    eq rx64_pos, -1, rx64_fail
+    jump $I10
+  rx64_done:
+    rx64_cur."!cursor_fail"()
+    rx64_cur."!cursor_debug"("FAIL  ", "arglist")
+    .return (rx64_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__arglist"  :subid("21_1261064009.3328") :method
+.annotate "line", 3
+    new $P66, "ResizablePMCArray"
+    push $P66, ""
+    .return ($P66)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "TOP"  :subid("22_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx76_tgt
+    .local int rx76_pos
+    .local int rx76_off
+    .local int rx76_eos
+    .local int rx76_rep
+    .local pmc rx76_cur
+    (rx76_cur, rx76_pos, rx76_tgt) = self."!cursor_start"()
+    rx76_cur."!cursor_debug"("START ", "TOP")
+    .lex unicode:"$\x{a2}", rx76_cur
+    .local pmc match
+    .lex "$/", match
+    length rx76_eos, rx76_tgt
+    set rx76_off, 0
+    lt rx76_pos, 2, rx76_start
+    sub rx76_off, rx76_pos, 1
+    substr rx76_tgt, rx76_tgt, rx76_off
+  rx76_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan80_done
+    goto rxscan80_scan
+  rxscan80_loop:
+    ($P10) = rx76_cur."from"()
+    inc $P10
+    set rx76_pos, $P10
+    ge rx76_pos, rx76_eos, rxscan80_done
+  rxscan80_scan:
+    set_addr $I10, rxscan80_loop
+    rx76_cur."!mark_push"(0, rx76_pos, $I10)
+  rxscan80_done:
+.annotate "line", 23
+  # rx subrule "nibbler" subtype=capture negate=
+    rx76_cur."!cursor_pos"(rx76_pos)
+    $P10 = rx76_cur."nibbler"()
+    unless $P10, rx76_fail
+    rx76_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("nibbler")
+    rx76_pos = $P10."pos"()
+  alt81_0:
+.annotate "line", 24
+    set_addr $I10, alt81_1
+    rx76_cur."!mark_push"(0, rx76_pos, $I10)
+  # rxanchor eos
+    ne rx76_pos, rx76_eos, rx76_fail
+    goto alt81_end
+  alt81_1:
+  # rx subrule "panic" subtype=method negate=
+    rx76_cur."!cursor_pos"(rx76_pos)
+    $P10 = rx76_cur."panic"("Confused")
+    unless $P10, rx76_fail
+    rx76_pos = $P10."pos"()
+  alt81_end:
+.annotate "line", 22
+  # rx pass
+    rx76_cur."!cursor_pass"(rx76_pos, "TOP")
+    rx76_cur."!cursor_debug"("PASS  ", "TOP", " at pos=", rx76_pos)
+    .return (rx76_cur)
+  rx76_fail:
+.annotate "line", 3
+    (rx76_rep, rx76_pos, $I10, $P10) = rx76_cur."!mark_fail"(0)
+    lt rx76_pos, -1, rx76_done
+    eq rx76_pos, -1, rx76_fail
+    jump $I10
+  rx76_done:
+    rx76_cur."!cursor_fail"()
+    rx76_cur."!cursor_debug"("FAIL  ", "TOP")
+    .return (rx76_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__TOP"  :subid("23_1261064009.3328") :method
+.annotate "line", 3
+    $P78 = self."!PREFIX__!subrule"("nibbler", "")
+    new $P79, "ResizablePMCArray"
+    push $P79, $P78
+    .return ($P79)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "nibbler"  :subid("24_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx83_tgt
+    .local int rx83_pos
+    .local int rx83_off
+    .local int rx83_eos
+    .local int rx83_rep
+    .local pmc rx83_cur
+    (rx83_cur, rx83_pos, rx83_tgt) = self."!cursor_start"()
+    rx83_cur."!cursor_debug"("START ", "nibbler")
+    rx83_cur."!cursor_caparray"("termish")
+    .lex unicode:"$\x{a2}", rx83_cur
+    .local pmc match
+    .lex "$/", match
+    length rx83_eos, rx83_tgt
+    set rx83_off, 0
+    lt rx83_pos, 2, rx83_start
+    sub rx83_off, rx83_pos, 1
+    substr rx83_tgt, rx83_tgt, rx83_off
+  rx83_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan86_done
+    goto rxscan86_scan
+  rxscan86_loop:
+    ($P10) = rx83_cur."from"()
+    inc $P10
+    set rx83_pos, $P10
+    ge rx83_pos, rx83_eos, rxscan86_done
+  rxscan86_scan:
+    set_addr $I10, rxscan86_loop
+    rx83_cur."!mark_push"(0, rx83_pos, $I10)
+  rxscan86_done:
+.annotate "line", 28
+  # rx reduce name="nibbler" key="open"
+    rx83_cur."!cursor_pos"(rx83_pos)
+    rx83_cur."!reduce"("nibbler", "open")
+.annotate "line", 29
+  # rx rxquantr87 ** 0..1
+    set_addr $I89, rxquantr87_done
+    rx83_cur."!mark_push"(0, rx83_pos, $I89)
+  rxquantr87_loop:
+  # rx subrule "ws" subtype=method negate=
+    rx83_cur."!cursor_pos"(rx83_pos)
+    $P10 = rx83_cur."ws"()
+    unless $P10, rx83_fail
+    rx83_pos = $P10."pos"()
+  alt88_0:
+    set_addr $I10, alt88_1
+    rx83_cur."!mark_push"(0, rx83_pos, $I10)
+  # rx literal  "||"
+    add $I11, rx83_pos, 2
+    gt $I11, rx83_eos, rx83_fail
+    sub $I11, rx83_pos, rx83_off
+    substr $S10, rx83_tgt, $I11, 2
+    ne $S10, "||", rx83_fail
+    add rx83_pos, 2
+    goto alt88_end
+  alt88_1:
+    set_addr $I10, alt88_2
+    rx83_cur."!mark_push"(0, rx83_pos, $I10)
+  # rx literal  "|"
+    add $I11, rx83_pos, 1
+    gt $I11, rx83_eos, rx83_fail
+    sub $I11, rx83_pos, rx83_off
+    substr $S10, rx83_tgt, $I11, 1
+    ne $S10, "|", rx83_fail
+    add rx83_pos, 1
+    goto alt88_end
+  alt88_2:
+    set_addr $I10, alt88_3
+    rx83_cur."!mark_push"(0, rx83_pos, $I10)
+  # rx literal  "&&"
+    add $I11, rx83_pos, 2
+    gt $I11, rx83_eos, rx83_fail
+    sub $I11, rx83_pos, rx83_off
+    substr $S10, rx83_tgt, $I11, 2
+    ne $S10, "&&", rx83_fail
+    add rx83_pos, 2
+    goto alt88_end
+  alt88_3:
+  # rx literal  "&"
+    add $I11, rx83_pos, 1
+    gt $I11, rx83_eos, rx83_fail
+    sub $I11, rx83_pos, rx83_off
+    substr $S10, rx83_tgt, $I11, 1
+    ne $S10, "&", rx83_fail
+    add rx83_pos, 1
+  alt88_end:
+    (rx83_rep) = rx83_cur."!mark_commit"($I89)
+  rxquantr87_done:
+.annotate "line", 30
+  # rx subrule "termish" subtype=capture negate=
+    rx83_cur."!cursor_pos"(rx83_pos)
+    $P10 = rx83_cur."termish"()
+    unless $P10, rx83_fail
+    rx83_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("termish")
+    rx83_pos = $P10."pos"()
+.annotate "line", 33
+  # rx rxquantr90 ** 0..*
+    set_addr $I93, rxquantr90_done
+    rx83_cur."!mark_push"(0, rx83_pos, $I93)
+  rxquantr90_loop:
+  alt91_0:
+.annotate "line", 31
+    set_addr $I10, alt91_1
+    rx83_cur."!mark_push"(0, rx83_pos, $I10)
+  # rx literal  "||"
+    add $I11, rx83_pos, 2
+    gt $I11, rx83_eos, rx83_fail
+    sub $I11, rx83_pos, rx83_off
+    substr $S10, rx83_tgt, $I11, 2
+    ne $S10, "||", rx83_fail
+    add rx83_pos, 2
+    goto alt91_end
+  alt91_1:
+  # rx literal  "|"
+    add $I11, rx83_pos, 1
+    gt $I11, rx83_eos, rx83_fail
+    sub $I11, rx83_pos, rx83_off
+    substr $S10, rx83_tgt, $I11, 1
+    ne $S10, "|", rx83_fail
+    add rx83_pos, 1
+  alt91_end:
+  alt92_0:
+.annotate "line", 32
+    set_addr $I10, alt92_1
+    rx83_cur."!mark_push"(0, rx83_pos, $I10)
+  # rx subrule "termish" subtype=capture negate=
+    rx83_cur."!cursor_pos"(rx83_pos)
+    $P10 = rx83_cur."termish"()
+    unless $P10, rx83_fail
+    rx83_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("termish")
+    rx83_pos = $P10."pos"()
+    goto alt92_end
+  alt92_1:
+  # rx subrule "panic" subtype=method negate=
+    rx83_cur."!cursor_pos"(rx83_pos)
+    $P10 = rx83_cur."panic"("Null pattern not allowed")
+    unless $P10, rx83_fail
+    rx83_pos = $P10."pos"()
+  alt92_end:
+.annotate "line", 33
+    (rx83_rep) = rx83_cur."!mark_commit"($I93)
+    rx83_cur."!mark_push"(rx83_rep, rx83_pos, $I93)
+    goto rxquantr90_loop
+  rxquantr90_done:
+.annotate "line", 27
+  # rx pass
+    rx83_cur."!cursor_pass"(rx83_pos, "nibbler")
+    rx83_cur."!cursor_debug"("PASS  ", "nibbler", " at pos=", rx83_pos)
+    .return (rx83_cur)
+  rx83_fail:
+.annotate "line", 3
+    (rx83_rep, rx83_pos, $I10, $P10) = rx83_cur."!mark_fail"(0)
+    lt rx83_pos, -1, rx83_done
+    eq rx83_pos, -1, rx83_fail
+    jump $I10
+  rx83_done:
+    rx83_cur."!cursor_fail"()
+    rx83_cur."!cursor_debug"("FAIL  ", "nibbler")
+    .return (rx83_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__nibbler"  :subid("25_1261064009.3328") :method
+.annotate "line", 3
+    new $P85, "ResizablePMCArray"
+    push $P85, ""
+    .return ($P85)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "termish"  :subid("26_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx95_tgt
+    .local int rx95_pos
+    .local int rx95_off
+    .local int rx95_eos
+    .local int rx95_rep
+    .local pmc rx95_cur
+    (rx95_cur, rx95_pos, rx95_tgt) = self."!cursor_start"()
+    rx95_cur."!cursor_debug"("START ", "termish")
+    rx95_cur."!cursor_caparray"("noun")
+    .lex unicode:"$\x{a2}", rx95_cur
+    .local pmc match
+    .lex "$/", match
+    length rx95_eos, rx95_tgt
+    set rx95_off, 0
+    lt rx95_pos, 2, rx95_start
+    sub rx95_off, rx95_pos, 1
+    substr rx95_tgt, rx95_tgt, rx95_off
+  rx95_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan98_done
+    goto rxscan98_scan
+  rxscan98_loop:
+    ($P10) = rx95_cur."from"()
+    inc $P10
+    set rx95_pos, $P10
+    ge rx95_pos, rx95_eos, rxscan98_done
+  rxscan98_scan:
+    set_addr $I10, rxscan98_loop
+    rx95_cur."!mark_push"(0, rx95_pos, $I10)
+  rxscan98_done:
+.annotate "line", 37
+  # rx rxquantr99 ** 1..*
+    set_addr $I100, rxquantr99_done
+    rx95_cur."!mark_push"(0, -1, $I100)
+  rxquantr99_loop:
+  # rx subrule "quantified_atom" subtype=capture negate=
+    rx95_cur."!cursor_pos"(rx95_pos)
+    $P10 = rx95_cur."quantified_atom"()
+    unless $P10, rx95_fail
+    rx95_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("noun")
+    rx95_pos = $P10."pos"()
+    (rx95_rep) = rx95_cur."!mark_commit"($I100)
+    rx95_cur."!mark_push"(rx95_rep, rx95_pos, $I100)
+    goto rxquantr99_loop
+  rxquantr99_done:
+.annotate "line", 36
+  # rx pass
+    rx95_cur."!cursor_pass"(rx95_pos, "termish")
+    rx95_cur."!cursor_debug"("PASS  ", "termish", " at pos=", rx95_pos)
+    .return (rx95_cur)
+  rx95_fail:
+.annotate "line", 3
+    (rx95_rep, rx95_pos, $I10, $P10) = rx95_cur."!mark_fail"(0)
+    lt rx95_pos, -1, rx95_done
+    eq rx95_pos, -1, rx95_fail
+    jump $I10
+  rx95_done:
+    rx95_cur."!cursor_fail"()
+    rx95_cur."!cursor_debug"("FAIL  ", "termish")
+    .return (rx95_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__termish"  :subid("27_1261064009.3328") :method
+.annotate "line", 3
+    new $P97, "ResizablePMCArray"
+    push $P97, ""
+    .return ($P97)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "quantified_atom"  :subid("28_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .const 'Sub' $P110 = "30_1261064009.3328" 
+    capture_lex $P110
+    .local string rx102_tgt
+    .local int rx102_pos
+    .local int rx102_off
+    .local int rx102_eos
+    .local int rx102_rep
+    .local pmc rx102_cur
+    (rx102_cur, rx102_pos, rx102_tgt) = self."!cursor_start"()
+    rx102_cur."!cursor_debug"("START ", "quantified_atom")
+    rx102_cur."!cursor_caparray"("backmod", "quantifier")
+    .lex unicode:"$\x{a2}", rx102_cur
+    .local pmc match
+    .lex "$/", match
+    length rx102_eos, rx102_tgt
+    set rx102_off, 0
+    lt rx102_pos, 2, rx102_start
+    sub rx102_off, rx102_pos, 1
+    substr rx102_tgt, rx102_tgt, rx102_off
+  rx102_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan106_done
+    goto rxscan106_scan
+  rxscan106_loop:
+    ($P10) = rx102_cur."from"()
+    inc $P10
+    set rx102_pos, $P10
+    ge rx102_pos, rx102_eos, rxscan106_done
+  rxscan106_scan:
+    set_addr $I10, rxscan106_loop
+    rx102_cur."!mark_push"(0, rx102_pos, $I10)
+  rxscan106_done:
+.annotate "line", 41
+  # rx subrule "atom" subtype=capture negate=
+    rx102_cur."!cursor_pos"(rx102_pos)
+    $P10 = rx102_cur."atom"()
+    unless $P10, rx102_fail
+    rx102_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("atom")
+    rx102_pos = $P10."pos"()
+  # rx rxquantr107 ** 0..1
+    set_addr $I113, rxquantr107_done
+    rx102_cur."!mark_push"(0, rx102_pos, $I113)
+  rxquantr107_loop:
+  # rx subrule "ws" subtype=method negate=
+    rx102_cur."!cursor_pos"(rx102_pos)
+    $P10 = rx102_cur."ws"()
+    unless $P10, rx102_fail
+    rx102_pos = $P10."pos"()
+  alt108_0:
+    set_addr $I10, alt108_1
+    rx102_cur."!mark_push"(0, rx102_pos, $I10)
+  # rx subrule "quantifier" subtype=capture negate=
+    rx102_cur."!cursor_pos"(rx102_pos)
+    $P10 = rx102_cur."quantifier"()
+    unless $P10, rx102_fail
+    rx102_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("quantifier")
+    rx102_pos = $P10."pos"()
+    goto alt108_end
+  alt108_1:
+  # rx subrule "before" subtype=zerowidth negate=
+    rx102_cur."!cursor_pos"(rx102_pos)
+    .const 'Sub' $P110 = "30_1261064009.3328" 
+    capture_lex $P110
+    $P10 = rx102_cur."before"($P110)
+    unless $P10, rx102_fail
+  # rx subrule "backmod" subtype=capture negate=
+    rx102_cur."!cursor_pos"(rx102_pos)
+    $P10 = rx102_cur."backmod"()
+    unless $P10, rx102_fail
+    rx102_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("backmod")
+    rx102_pos = $P10."pos"()
+  # rx subrule "alpha" subtype=zerowidth negate=1
+    rx102_cur."!cursor_pos"(rx102_pos)
+    $P10 = rx102_cur."alpha"()
+    if $P10, rx102_fail
+  alt108_end:
+    (rx102_rep) = rx102_cur."!mark_commit"($I113)
+  rxquantr107_done:
+.annotate "line", 40
+  # rx pass
+    rx102_cur."!cursor_pass"(rx102_pos, "quantified_atom")
+    rx102_cur."!cursor_debug"("PASS  ", "quantified_atom", " at pos=", rx102_pos)
+    .return (rx102_cur)
+  rx102_fail:
+.annotate "line", 3
+    (rx102_rep, rx102_pos, $I10, $P10) = rx102_cur."!mark_fail"(0)
+    lt rx102_pos, -1, rx102_done
+    eq rx102_pos, -1, rx102_fail
+    jump $I10
+  rx102_done:
+    rx102_cur."!cursor_fail"()
+    rx102_cur."!cursor_debug"("FAIL  ", "quantified_atom")
+    .return (rx102_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__quantified_atom"  :subid("29_1261064009.3328") :method
+.annotate "line", 3
+    $P104 = self."!PREFIX__!subrule"("atom", "")
+    new $P105, "ResizablePMCArray"
+    push $P105, $P104
+    .return ($P105)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "_block109"  :anon :subid("30_1261064009.3328") :method :outer("28_1261064009.3328")
+.annotate "line", 41
+    .local string rx111_tgt
+    .local int rx111_pos
+    .local int rx111_off
+    .local int rx111_eos
+    .local int rx111_rep
+    .local pmc rx111_cur
+    (rx111_cur, rx111_pos, rx111_tgt) = self."!cursor_start"()
+    rx111_cur."!cursor_debug"("START ", "")
+    .lex unicode:"$\x{a2}", rx111_cur
+    .local pmc match
+    .lex "$/", match
+    length rx111_eos, rx111_tgt
+    set rx111_off, 0
+    lt rx111_pos, 2, rx111_start
+    sub rx111_off, rx111_pos, 1
+    substr rx111_tgt, rx111_tgt, rx111_off
+  rx111_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan112_done
+    goto rxscan112_scan
+  rxscan112_loop:
+    ($P10) = rx111_cur."from"()
+    inc $P10
+    set rx111_pos, $P10
+    ge rx111_pos, rx111_eos, rxscan112_done
+  rxscan112_scan:
+    set_addr $I10, rxscan112_loop
+    rx111_cur."!mark_push"(0, rx111_pos, $I10)
+  rxscan112_done:
+  # rx literal  ":"
+    add $I11, rx111_pos, 1
+    gt $I11, rx111_eos, rx111_fail
+    sub $I11, rx111_pos, rx111_off
+    substr $S10, rx111_tgt, $I11, 1
+    ne $S10, ":", rx111_fail
+    add rx111_pos, 1
+  # rx pass
+    rx111_cur."!cursor_pass"(rx111_pos, "")
+    rx111_cur."!cursor_debug"("PASS  ", "", " at pos=", rx111_pos)
+    .return (rx111_cur)
+  rx111_fail:
+    (rx111_rep, rx111_pos, $I10, $P10) = rx111_cur."!mark_fail"(0)
+    lt rx111_pos, -1, rx111_done
+    eq rx111_pos, -1, rx111_fail
+    jump $I10
+  rx111_done:
+    rx111_cur."!cursor_fail"()
+    rx111_cur."!cursor_debug"("FAIL  ", "")
+    .return (rx111_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "atom"  :subid("31_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .const 'Sub' $P125 = "33_1261064009.3328" 
+    capture_lex $P125
+    .local string rx115_tgt
+    .local int rx115_pos
+    .local int rx115_off
+    .local int rx115_eos
+    .local int rx115_rep
+    .local pmc rx115_cur
+    (rx115_cur, rx115_pos, rx115_tgt) = self."!cursor_start"()
+    rx115_cur."!cursor_debug"("START ", "atom")
+    .lex unicode:"$\x{a2}", rx115_cur
+    .local pmc match
+    .lex "$/", match
+    length rx115_eos, rx115_tgt
+    set rx115_off, 0
+    lt rx115_pos, 2, rx115_start
+    sub rx115_off, rx115_pos, 1
+    substr rx115_tgt, rx115_tgt, rx115_off
+  rx115_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan119_done
+    goto rxscan119_scan
+  rxscan119_loop:
+    ($P10) = rx115_cur."from"()
+    inc $P10
+    set rx115_pos, $P10
+    ge rx115_pos, rx115_eos, rxscan119_done
+  rxscan119_scan:
+    set_addr $I10, rxscan119_loop
+    rx115_cur."!mark_push"(0, rx115_pos, $I10)
+  rxscan119_done:
+  alt120_0:
+.annotate "line", 46
+    set_addr $I10, alt120_1
+    rx115_cur."!mark_push"(0, rx115_pos, $I10)
+.annotate "line", 47
+  # rx charclass w
+    ge rx115_pos, rx115_eos, rx115_fail
+    sub $I10, rx115_pos, rx115_off
+    is_cclass $I11, 8192, rx115_tgt, $I10
+    unless $I11, rx115_fail
+    inc rx115_pos
+  # rx rxquantr121 ** 0..1
+    set_addr $I128, rxquantr121_done
+    rx115_cur."!mark_push"(0, rx115_pos, $I128)
+  rxquantr121_loop:
+  # rx rxquantg122 ** 1..*
+    set_addr $I123, rxquantg122_done
+  rxquantg122_loop:
+  # rx charclass w
+    ge rx115_pos, rx115_eos, rx115_fail
+    sub $I10, rx115_pos, rx115_off
+    is_cclass $I11, 8192, rx115_tgt, $I10
+    unless $I11, rx115_fail
+    inc rx115_pos
+    rx115_cur."!mark_push"(rx115_rep, rx115_pos, $I123)
+    goto rxquantg122_loop
+  rxquantg122_done:
+  # rx subrule "before" subtype=zerowidth negate=
+    rx115_cur."!cursor_pos"(rx115_pos)
+    .const 'Sub' $P125 = "33_1261064009.3328" 
+    capture_lex $P125
+    $P10 = rx115_cur."before"($P125)
+    unless $P10, rx115_fail
+    (rx115_rep) = rx115_cur."!mark_commit"($I128)
+  rxquantr121_done:
+    goto alt120_end
+  alt120_1:
+.annotate "line", 48
+  # rx subrule "metachar" subtype=capture negate=
+    rx115_cur."!cursor_pos"(rx115_pos)
+    $P10 = rx115_cur."metachar"()
+    unless $P10, rx115_fail
+    rx115_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("metachar")
+    rx115_pos = $P10."pos"()
+  alt120_end:
+.annotate "line", 44
+  # rx pass
+    rx115_cur."!cursor_pass"(rx115_pos, "atom")
+    rx115_cur."!cursor_debug"("PASS  ", "atom", " at pos=", rx115_pos)
+    .return (rx115_cur)
+  rx115_fail:
+.annotate "line", 3
+    (rx115_rep, rx115_pos, $I10, $P10) = rx115_cur."!mark_fail"(0)
+    lt rx115_pos, -1, rx115_done
+    eq rx115_pos, -1, rx115_fail
+    jump $I10
+  rx115_done:
+    rx115_cur."!cursor_fail"()
+    rx115_cur."!cursor_debug"("FAIL  ", "atom")
+    .return (rx115_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__atom"  :subid("32_1261064009.3328") :method
+.annotate "line", 3
+    $P117 = self."!PREFIX__!subrule"("metachar", "")
+    new $P118, "ResizablePMCArray"
+    push $P118, $P117
+    push $P118, ""
+    .return ($P118)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "_block124"  :anon :subid("33_1261064009.3328") :method :outer("31_1261064009.3328")
+.annotate "line", 47
+    .local string rx126_tgt
+    .local int rx126_pos
+    .local int rx126_off
+    .local int rx126_eos
+    .local int rx126_rep
+    .local pmc rx126_cur
+    (rx126_cur, rx126_pos, rx126_tgt) = self."!cursor_start"()
+    rx126_cur."!cursor_debug"("START ", "")
+    .lex unicode:"$\x{a2}", rx126_cur
+    .local pmc match
+    .lex "$/", match
+    length rx126_eos, rx126_tgt
+    set rx126_off, 0
+    lt rx126_pos, 2, rx126_start
+    sub rx126_off, rx126_pos, 1
+    substr rx126_tgt, rx126_tgt, rx126_off
+  rx126_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan127_done
+    goto rxscan127_scan
+  rxscan127_loop:
+    ($P10) = rx126_cur."from"()
+    inc $P10
+    set rx126_pos, $P10
+    ge rx126_pos, rx126_eos, rxscan127_done
+  rxscan127_scan:
+    set_addr $I10, rxscan127_loop
+    rx126_cur."!mark_push"(0, rx126_pos, $I10)
+  rxscan127_done:
+  # rx charclass w
+    ge rx126_pos, rx126_eos, rx126_fail
+    sub $I10, rx126_pos, rx126_off
+    is_cclass $I11, 8192, rx126_tgt, $I10
+    unless $I11, rx126_fail
+    inc rx126_pos
+  # rx pass
+    rx126_cur."!cursor_pass"(rx126_pos, "")
+    rx126_cur."!cursor_debug"("PASS  ", "", " at pos=", rx126_pos)
+    .return (rx126_cur)
+  rx126_fail:
+    (rx126_rep, rx126_pos, $I10, $P10) = rx126_cur."!mark_fail"(0)
+    lt rx126_pos, -1, rx126_done
+    eq rx126_pos, -1, rx126_fail
+    jump $I10
+  rx126_done:
+    rx126_cur."!cursor_fail"()
+    rx126_cur."!cursor_debug"("FAIL  ", "")
+    .return (rx126_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "quantifier"  :subid("34_1261064009.3328") :method
+.annotate "line", 52
+    $P130 = self."!protoregex"("quantifier")
+    .return ($P130)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__quantifier"  :subid("35_1261064009.3328") :method
+.annotate "line", 52
+    $P132 = self."!PREFIX__!protoregex"("quantifier")
+    .return ($P132)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "quantifier:sym<*>"  :subid("36_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx134_tgt
+    .local int rx134_pos
+    .local int rx134_off
+    .local int rx134_eos
+    .local int rx134_rep
+    .local pmc rx134_cur
+    (rx134_cur, rx134_pos, rx134_tgt) = self."!cursor_start"()
+    rx134_cur."!cursor_debug"("START ", "quantifier:sym<*>")
+    .lex unicode:"$\x{a2}", rx134_cur
+    .local pmc match
+    .lex "$/", match
+    length rx134_eos, rx134_tgt
+    set rx134_off, 0
+    lt rx134_pos, 2, rx134_start
+    sub rx134_off, rx134_pos, 1
+    substr rx134_tgt, rx134_tgt, rx134_off
+  rx134_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan138_done
+    goto rxscan138_scan
+  rxscan138_loop:
+    ($P10) = rx134_cur."from"()
+    inc $P10
+    set rx134_pos, $P10
+    ge rx134_pos, rx134_eos, rxscan138_done
+  rxscan138_scan:
+    set_addr $I10, rxscan138_loop
+    rx134_cur."!mark_push"(0, rx134_pos, $I10)
+  rxscan138_done:
+.annotate "line", 53
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_139_fail
+    rx134_cur."!mark_push"(0, rx134_pos, $I10)
+  # rx literal  "*"
+    add $I11, rx134_pos, 1
+    gt $I11, rx134_eos, rx134_fail
+    sub $I11, rx134_pos, rx134_off
+    substr $S10, rx134_tgt, $I11, 1
+    ne $S10, "*", rx134_fail
+    add rx134_pos, 1
+    set_addr $I10, rxcap_139_fail
+    ($I12, $I11) = rx134_cur."!mark_peek"($I10)
+    rx134_cur."!cursor_pos"($I11)
+    ($P10) = rx134_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx134_pos, "")
+    rx134_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_139_done
+  rxcap_139_fail:
+    goto rx134_fail
+  rxcap_139_done:
+  # rx subrule "backmod" subtype=capture negate=
+    rx134_cur."!cursor_pos"(rx134_pos)
+    $P10 = rx134_cur."backmod"()
+    unless $P10, rx134_fail
+    rx134_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("backmod")
+    rx134_pos = $P10."pos"()
+  # rx pass
+    rx134_cur."!cursor_pass"(rx134_pos, "quantifier:sym<*>")
+    rx134_cur."!cursor_debug"("PASS  ", "quantifier:sym<*>", " at pos=", rx134_pos)
+    .return (rx134_cur)
+  rx134_fail:
+.annotate "line", 3
+    (rx134_rep, rx134_pos, $I10, $P10) = rx134_cur."!mark_fail"(0)
+    lt rx134_pos, -1, rx134_done
+    eq rx134_pos, -1, rx134_fail
+    jump $I10
+  rx134_done:
+    rx134_cur."!cursor_fail"()
+    rx134_cur."!cursor_debug"("FAIL  ", "quantifier:sym<*>")
+    .return (rx134_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__quantifier:sym<*>"  :subid("37_1261064009.3328") :method
+.annotate "line", 3
+    $P136 = self."!PREFIX__!subrule"("backmod", "*")
+    new $P137, "ResizablePMCArray"
+    push $P137, $P136
+    .return ($P137)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "quantifier:sym<+>"  :subid("38_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx141_tgt
+    .local int rx141_pos
+    .local int rx141_off
+    .local int rx141_eos
+    .local int rx141_rep
+    .local pmc rx141_cur
+    (rx141_cur, rx141_pos, rx141_tgt) = self."!cursor_start"()
+    rx141_cur."!cursor_debug"("START ", "quantifier:sym<+>")
+    .lex unicode:"$\x{a2}", rx141_cur
+    .local pmc match
+    .lex "$/", match
+    length rx141_eos, rx141_tgt
+    set rx141_off, 0
+    lt rx141_pos, 2, rx141_start
+    sub rx141_off, rx141_pos, 1
+    substr rx141_tgt, rx141_tgt, rx141_off
+  rx141_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan145_done
+    goto rxscan145_scan
+  rxscan145_loop:
+    ($P10) = rx141_cur."from"()
+    inc $P10
+    set rx141_pos, $P10
+    ge rx141_pos, rx141_eos, rxscan145_done
+  rxscan145_scan:
+    set_addr $I10, rxscan145_loop
+    rx141_cur."!mark_push"(0, rx141_pos, $I10)
+  rxscan145_done:
+.annotate "line", 54
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_146_fail
+    rx141_cur."!mark_push"(0, rx141_pos, $I10)
+  # rx literal  "+"
+    add $I11, rx141_pos, 1
+    gt $I11, rx141_eos, rx141_fail
+    sub $I11, rx141_pos, rx141_off
+    substr $S10, rx141_tgt, $I11, 1
+    ne $S10, "+", rx141_fail
+    add rx141_pos, 1
+    set_addr $I10, rxcap_146_fail
+    ($I12, $I11) = rx141_cur."!mark_peek"($I10)
+    rx141_cur."!cursor_pos"($I11)
+    ($P10) = rx141_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx141_pos, "")
+    rx141_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_146_done
+  rxcap_146_fail:
+    goto rx141_fail
+  rxcap_146_done:
+  # rx subrule "backmod" subtype=capture negate=
+    rx141_cur."!cursor_pos"(rx141_pos)
+    $P10 = rx141_cur."backmod"()
+    unless $P10, rx141_fail
+    rx141_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("backmod")
+    rx141_pos = $P10."pos"()
+  # rx pass
+    rx141_cur."!cursor_pass"(rx141_pos, "quantifier:sym<+>")
+    rx141_cur."!cursor_debug"("PASS  ", "quantifier:sym<+>", " at pos=", rx141_pos)
+    .return (rx141_cur)
+  rx141_fail:
+.annotate "line", 3
+    (rx141_rep, rx141_pos, $I10, $P10) = rx141_cur."!mark_fail"(0)
+    lt rx141_pos, -1, rx141_done
+    eq rx141_pos, -1, rx141_fail
+    jump $I10
+  rx141_done:
+    rx141_cur."!cursor_fail"()
+    rx141_cur."!cursor_debug"("FAIL  ", "quantifier:sym<+>")
+    .return (rx141_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__quantifier:sym<+>"  :subid("39_1261064009.3328") :method
+.annotate "line", 3
+    $P143 = self."!PREFIX__!subrule"("backmod", "+")
+    new $P144, "ResizablePMCArray"
+    push $P144, $P143
+    .return ($P144)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "quantifier:sym<?>"  :subid("40_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx148_tgt
+    .local int rx148_pos
+    .local int rx148_off
+    .local int rx148_eos
+    .local int rx148_rep
+    .local pmc rx148_cur
+    (rx148_cur, rx148_pos, rx148_tgt) = self."!cursor_start"()
+    rx148_cur."!cursor_debug"("START ", "quantifier:sym<?>")
+    .lex unicode:"$\x{a2}", rx148_cur
+    .local pmc match
+    .lex "$/", match
+    length rx148_eos, rx148_tgt
+    set rx148_off, 0
+    lt rx148_pos, 2, rx148_start
+    sub rx148_off, rx148_pos, 1
+    substr rx148_tgt, rx148_tgt, rx148_off
+  rx148_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan152_done
+    goto rxscan152_scan
+  rxscan152_loop:
+    ($P10) = rx148_cur."from"()
+    inc $P10
+    set rx148_pos, $P10
+    ge rx148_pos, rx148_eos, rxscan152_done
+  rxscan152_scan:
+    set_addr $I10, rxscan152_loop
+    rx148_cur."!mark_push"(0, rx148_pos, $I10)
+  rxscan152_done:
+.annotate "line", 55
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_153_fail
+    rx148_cur."!mark_push"(0, rx148_pos, $I10)
+  # rx literal  "?"
+    add $I11, rx148_pos, 1
+    gt $I11, rx148_eos, rx148_fail
+    sub $I11, rx148_pos, rx148_off
+    substr $S10, rx148_tgt, $I11, 1
+    ne $S10, "?", rx148_fail
+    add rx148_pos, 1
+    set_addr $I10, rxcap_153_fail
+    ($I12, $I11) = rx148_cur."!mark_peek"($I10)
+    rx148_cur."!cursor_pos"($I11)
+    ($P10) = rx148_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx148_pos, "")
+    rx148_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_153_done
+  rxcap_153_fail:
+    goto rx148_fail
+  rxcap_153_done:
+  # rx subrule "backmod" subtype=capture negate=
+    rx148_cur."!cursor_pos"(rx148_pos)
+    $P10 = rx148_cur."backmod"()
+    unless $P10, rx148_fail
+    rx148_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("backmod")
+    rx148_pos = $P10."pos"()
+  # rx pass
+    rx148_cur."!cursor_pass"(rx148_pos, "quantifier:sym<?>")
+    rx148_cur."!cursor_debug"("PASS  ", "quantifier:sym<?>", " at pos=", rx148_pos)
+    .return (rx148_cur)
+  rx148_fail:
+.annotate "line", 3
+    (rx148_rep, rx148_pos, $I10, $P10) = rx148_cur."!mark_fail"(0)
+    lt rx148_pos, -1, rx148_done
+    eq rx148_pos, -1, rx148_fail
+    jump $I10
+  rx148_done:
+    rx148_cur."!cursor_fail"()
+    rx148_cur."!cursor_debug"("FAIL  ", "quantifier:sym<?>")
+    .return (rx148_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__quantifier:sym<?>"  :subid("41_1261064009.3328") :method
+.annotate "line", 3
+    $P150 = self."!PREFIX__!subrule"("backmod", "?")
+    new $P151, "ResizablePMCArray"
+    push $P151, $P150
+    .return ($P151)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "quantifier:sym<**>"  :subid("42_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx155_tgt
+    .local int rx155_pos
+    .local int rx155_off
+    .local int rx155_eos
+    .local int rx155_rep
+    .local pmc rx155_cur
+    (rx155_cur, rx155_pos, rx155_tgt) = self."!cursor_start"()
+    rx155_cur."!cursor_debug"("START ", "quantifier:sym<**>")
+    rx155_cur."!cursor_caparray"("max")
+    .lex unicode:"$\x{a2}", rx155_cur
+    .local pmc match
+    .lex "$/", match
+    length rx155_eos, rx155_tgt
+    set rx155_off, 0
+    lt rx155_pos, 2, rx155_start
+    sub rx155_off, rx155_pos, 1
+    substr rx155_tgt, rx155_tgt, rx155_off
+  rx155_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan158_done
+    goto rxscan158_scan
+  rxscan158_loop:
+    ($P10) = rx155_cur."from"()
+    inc $P10
+    set rx155_pos, $P10
+    ge rx155_pos, rx155_eos, rxscan158_done
+  rxscan158_scan:
+    set_addr $I10, rxscan158_loop
+    rx155_cur."!mark_push"(0, rx155_pos, $I10)
+  rxscan158_done:
+.annotate "line", 57
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_159_fail
+    rx155_cur."!mark_push"(0, rx155_pos, $I10)
+  # rx literal  "**"
+    add $I11, rx155_pos, 2
+    gt $I11, rx155_eos, rx155_fail
+    sub $I11, rx155_pos, rx155_off
+    substr $S10, rx155_tgt, $I11, 2
+    ne $S10, "**", rx155_fail
+    add rx155_pos, 2
+    set_addr $I10, rxcap_159_fail
+    ($I12, $I11) = rx155_cur."!mark_peek"($I10)
+    rx155_cur."!cursor_pos"($I11)
+    ($P10) = rx155_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx155_pos, "")
+    rx155_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_159_done
+  rxcap_159_fail:
+    goto rx155_fail
+  rxcap_159_done:
+  # rx charclass_q s r 0..-1
+    sub $I10, rx155_pos, rx155_off
+    find_not_cclass $I11, 32, rx155_tgt, $I10, rx155_eos
+    add rx155_pos, rx155_off, $I11
+  # rx subrule "backmod" subtype=capture negate=
+    rx155_cur."!cursor_pos"(rx155_pos)
+    $P10 = rx155_cur."backmod"()
+    unless $P10, rx155_fail
+    rx155_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("backmod")
+    rx155_pos = $P10."pos"()
+  # rx charclass_q s r 0..-1
+    sub $I10, rx155_pos, rx155_off
+    find_not_cclass $I11, 32, rx155_tgt, $I10, rx155_eos
+    add rx155_pos, rx155_off, $I11
+  alt160_0:
+.annotate "line", 58
+    set_addr $I10, alt160_1
+    rx155_cur."!mark_push"(0, rx155_pos, $I10)
+.annotate "line", 59
+  # rx subcapture "min"
+    set_addr $I10, rxcap_161_fail
+    rx155_cur."!mark_push"(0, rx155_pos, $I10)
+  # rx charclass_q d r 1..-1
+    sub $I10, rx155_pos, rx155_off
+    find_not_cclass $I11, 8, rx155_tgt, $I10, rx155_eos
+    add $I12, $I10, 1
+    lt $I11, $I12, rx155_fail
+    add rx155_pos, rx155_off, $I11
+    set_addr $I10, rxcap_161_fail
+    ($I12, $I11) = rx155_cur."!mark_peek"($I10)
+    rx155_cur."!cursor_pos"($I11)
+    ($P10) = rx155_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx155_pos, "")
+    rx155_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("min")
+    goto rxcap_161_done
+  rxcap_161_fail:
+    goto rx155_fail
+  rxcap_161_done:
+.annotate "line", 66
+  # rx rxquantr162 ** 0..1
+    set_addr $I165, rxquantr162_done
+    rx155_cur."!mark_push"(0, rx155_pos, $I165)
+  rxquantr162_loop:
+.annotate "line", 60
+  # rx literal  ".."
+    add $I11, rx155_pos, 2
+    gt $I11, rx155_eos, rx155_fail
+    sub $I11, rx155_pos, rx155_off
+    substr $S10, rx155_tgt, $I11, 2
+    ne $S10, "..", rx155_fail
+    add rx155_pos, 2
+.annotate "line", 61
+  # rx subcapture "max"
+    set_addr $I10, rxcap_164_fail
+    rx155_cur."!mark_push"(0, rx155_pos, $I10)
+  alt163_0:
+    set_addr $I10, alt163_1
+    rx155_cur."!mark_push"(0, rx155_pos, $I10)
+.annotate "line", 62
+  # rx charclass_q d r 1..-1
+    sub $I10, rx155_pos, rx155_off
+    find_not_cclass $I11, 8, rx155_tgt, $I10, rx155_eos
+    add $I12, $I10, 1
+    lt $I11, $I12, rx155_fail
+    add rx155_pos, rx155_off, $I11
+    goto alt163_end
+  alt163_1:
+    set_addr $I10, alt163_2
+    rx155_cur."!mark_push"(0, rx155_pos, $I10)
+.annotate "line", 63
+  # rx literal  "*"
+    add $I11, rx155_pos, 1
+    gt $I11, rx155_eos, rx155_fail
+    sub $I11, rx155_pos, rx155_off
+    substr $S10, rx155_tgt, $I11, 1
+    ne $S10, "*", rx155_fail
+    add rx155_pos, 1
+    goto alt163_end
+  alt163_2:
+.annotate "line", 64
+  # rx subrule "panic" subtype=method negate=
+    rx155_cur."!cursor_pos"(rx155_pos)
+    $P10 = rx155_cur."panic"("Only integers or '*' allowed as range quantifier endpoint")
+    unless $P10, rx155_fail
+    rx155_pos = $P10."pos"()
+  alt163_end:
+.annotate "line", 61
+    set_addr $I10, rxcap_164_fail
+    ($I12, $I11) = rx155_cur."!mark_peek"($I10)
+    rx155_cur."!cursor_pos"($I11)
+    ($P10) = rx155_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx155_pos, "")
+    rx155_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("max")
+    goto rxcap_164_done
+  rxcap_164_fail:
+    goto rx155_fail
+  rxcap_164_done:
+.annotate "line", 66
+    (rx155_rep) = rx155_cur."!mark_commit"($I165)
+  rxquantr162_done:
+.annotate "line", 59
+    goto alt160_end
+  alt160_1:
+.annotate "line", 67
+  # rx subrule "quantified_atom" subtype=capture negate=
+    rx155_cur."!cursor_pos"(rx155_pos)
+    $P10 = rx155_cur."quantified_atom"()
+    unless $P10, rx155_fail
+    rx155_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("quantified_atom")
+    rx155_pos = $P10."pos"()
+  alt160_end:
+.annotate "line", 56
+  # rx pass
+    rx155_cur."!cursor_pass"(rx155_pos, "quantifier:sym<**>")
+    rx155_cur."!cursor_debug"("PASS  ", "quantifier:sym<**>", " at pos=", rx155_pos)
+    .return (rx155_cur)
+  rx155_fail:
+.annotate "line", 3
+    (rx155_rep, rx155_pos, $I10, $P10) = rx155_cur."!mark_fail"(0)
+    lt rx155_pos, -1, rx155_done
+    eq rx155_pos, -1, rx155_fail
+    jump $I10
+  rx155_done:
+    rx155_cur."!cursor_fail"()
+    rx155_cur."!cursor_debug"("FAIL  ", "quantifier:sym<**>")
+    .return (rx155_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__quantifier:sym<**>"  :subid("43_1261064009.3328") :method
+.annotate "line", 3
+    new $P157, "ResizablePMCArray"
+    push $P157, "**"
+    .return ($P157)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "backmod"  :subid("44_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .const 'Sub' $P175 = "46_1261064009.3328" 
+    capture_lex $P175
+    .local string rx167_tgt
+    .local int rx167_pos
+    .local int rx167_off
+    .local int rx167_eos
+    .local int rx167_rep
+    .local pmc rx167_cur
+    (rx167_cur, rx167_pos, rx167_tgt) = self."!cursor_start"()
+    rx167_cur."!cursor_debug"("START ", "backmod")
+    .lex unicode:"$\x{a2}", rx167_cur
+    .local pmc match
+    .lex "$/", match
+    length rx167_eos, rx167_tgt
+    set rx167_off, 0
+    lt rx167_pos, 2, rx167_start
+    sub rx167_off, rx167_pos, 1
+    substr rx167_tgt, rx167_tgt, rx167_off
+  rx167_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan170_done
+    goto rxscan170_scan
+  rxscan170_loop:
+    ($P10) = rx167_cur."from"()
+    inc $P10
+    set rx167_pos, $P10
+    ge rx167_pos, rx167_eos, rxscan170_done
+  rxscan170_scan:
+    set_addr $I10, rxscan170_loop
+    rx167_cur."!mark_push"(0, rx167_pos, $I10)
+  rxscan170_done:
+.annotate "line", 71
+  # rx rxquantr171 ** 0..1
+    set_addr $I172, rxquantr171_done
+    rx167_cur."!mark_push"(0, rx167_pos, $I172)
+  rxquantr171_loop:
+  # rx literal  ":"
+    add $I11, rx167_pos, 1
+    gt $I11, rx167_eos, rx167_fail
+    sub $I11, rx167_pos, rx167_off
+    substr $S10, rx167_tgt, $I11, 1
+    ne $S10, ":", rx167_fail
+    add rx167_pos, 1
+    (rx167_rep) = rx167_cur."!mark_commit"($I172)
+  rxquantr171_done:
+  alt173_0:
+    set_addr $I10, alt173_1
+    rx167_cur."!mark_push"(0, rx167_pos, $I10)
+  # rx literal  "?"
+    add $I11, rx167_pos, 1
+    gt $I11, rx167_eos, rx167_fail
+    sub $I11, rx167_pos, rx167_off
+    substr $S10, rx167_tgt, $I11, 1
+    ne $S10, "?", rx167_fail
+    add rx167_pos, 1
+    goto alt173_end
+  alt173_1:
+    set_addr $I10, alt173_2
+    rx167_cur."!mark_push"(0, rx167_pos, $I10)
+  # rx literal  "!"
+    add $I11, rx167_pos, 1
+    gt $I11, rx167_eos, rx167_fail
+    sub $I11, rx167_pos, rx167_off
+    substr $S10, rx167_tgt, $I11, 1
+    ne $S10, "!", rx167_fail
+    add rx167_pos, 1
+    goto alt173_end
+  alt173_2:
+  # rx subrule "before" subtype=zerowidth negate=1
+    rx167_cur."!cursor_pos"(rx167_pos)
+    .const 'Sub' $P175 = "46_1261064009.3328" 
+    capture_lex $P175
+    $P10 = rx167_cur."before"($P175)
+    if $P10, rx167_fail
+  alt173_end:
+  # rx pass
+    rx167_cur."!cursor_pass"(rx167_pos, "backmod")
+    rx167_cur."!cursor_debug"("PASS  ", "backmod", " at pos=", rx167_pos)
+    .return (rx167_cur)
+  rx167_fail:
+.annotate "line", 3
+    (rx167_rep, rx167_pos, $I10, $P10) = rx167_cur."!mark_fail"(0)
+    lt rx167_pos, -1, rx167_done
+    eq rx167_pos, -1, rx167_fail
+    jump $I10
+  rx167_done:
+    rx167_cur."!cursor_fail"()
+    rx167_cur."!cursor_debug"("FAIL  ", "backmod")
+    .return (rx167_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__backmod"  :subid("45_1261064009.3328") :method
+.annotate "line", 3
+    new $P169, "ResizablePMCArray"
+    push $P169, ""
+    .return ($P169)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "_block174"  :anon :subid("46_1261064009.3328") :method :outer("44_1261064009.3328")
+.annotate "line", 71
+    .local string rx176_tgt
+    .local int rx176_pos
+    .local int rx176_off
+    .local int rx176_eos
+    .local int rx176_rep
+    .local pmc rx176_cur
+    (rx176_cur, rx176_pos, rx176_tgt) = self."!cursor_start"()
+    rx176_cur."!cursor_debug"("START ", "")
+    .lex unicode:"$\x{a2}", rx176_cur
+    .local pmc match
+    .lex "$/", match
+    length rx176_eos, rx176_tgt
+    set rx176_off, 0
+    lt rx176_pos, 2, rx176_start
+    sub rx176_off, rx176_pos, 1
+    substr rx176_tgt, rx176_tgt, rx176_off
+  rx176_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan177_done
+    goto rxscan177_scan
+  rxscan177_loop:
+    ($P10) = rx176_cur."from"()
+    inc $P10
+    set rx176_pos, $P10
+    ge rx176_pos, rx176_eos, rxscan177_done
+  rxscan177_scan:
+    set_addr $I10, rxscan177_loop
+    rx176_cur."!mark_push"(0, rx176_pos, $I10)
+  rxscan177_done:
+  # rx literal  ":"
+    add $I11, rx176_pos, 1
+    gt $I11, rx176_eos, rx176_fail
+    sub $I11, rx176_pos, rx176_off
+    substr $S10, rx176_tgt, $I11, 1
+    ne $S10, ":", rx176_fail
+    add rx176_pos, 1
+  # rx pass
+    rx176_cur."!cursor_pass"(rx176_pos, "")
+    rx176_cur."!cursor_debug"("PASS  ", "", " at pos=", rx176_pos)
+    .return (rx176_cur)
+  rx176_fail:
+    (rx176_rep, rx176_pos, $I10, $P10) = rx176_cur."!mark_fail"(0)
+    lt rx176_pos, -1, rx176_done
+    eq rx176_pos, -1, rx176_fail
+    jump $I10
+  rx176_done:
+    rx176_cur."!cursor_fail"()
+    rx176_cur."!cursor_debug"("FAIL  ", "")
+    .return (rx176_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "metachar"  :subid("47_1261064009.3328") :method
+.annotate "line", 73
+    $P179 = self."!protoregex"("metachar")
+    .return ($P179)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__metachar"  :subid("48_1261064009.3328") :method
+.annotate "line", 73
+    $P181 = self."!PREFIX__!protoregex"("metachar")
+    .return ($P181)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "metachar:sym<ws>"  :subid("49_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx183_tgt
+    .local int rx183_pos
+    .local int rx183_off
+    .local int rx183_eos
+    .local int rx183_rep
+    .local pmc rx183_cur
+    (rx183_cur, rx183_pos, rx183_tgt) = self."!cursor_start"()
+    rx183_cur."!cursor_debug"("START ", "metachar:sym<ws>")
+    .lex unicode:"$\x{a2}", rx183_cur
+    .local pmc match
+    .lex "$/", match
+    length rx183_eos, rx183_tgt
+    set rx183_off, 0
+    lt rx183_pos, 2, rx183_start
+    sub rx183_off, rx183_pos, 1
+    substr rx183_tgt, rx183_tgt, rx183_off
+  rx183_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan187_done
+    goto rxscan187_scan
+  rxscan187_loop:
+    ($P10) = rx183_cur."from"()
+    inc $P10
+    set rx183_pos, $P10
+    ge rx183_pos, rx183_eos, rxscan187_done
+  rxscan187_scan:
+    set_addr $I10, rxscan187_loop
+    rx183_cur."!mark_push"(0, rx183_pos, $I10)
+  rxscan187_done:
+.annotate "line", 74
+  # rx subrule "normspace" subtype=method negate=
+    rx183_cur."!cursor_pos"(rx183_pos)
+    $P10 = rx183_cur."normspace"()
+    unless $P10, rx183_fail
+    rx183_pos = $P10."pos"()
+  # rx pass
+    rx183_cur."!cursor_pass"(rx183_pos, "metachar:sym<ws>")
+    rx183_cur."!cursor_debug"("PASS  ", "metachar:sym<ws>", " at pos=", rx183_pos)
+    .return (rx183_cur)
+  rx183_fail:
+.annotate "line", 3
+    (rx183_rep, rx183_pos, $I10, $P10) = rx183_cur."!mark_fail"(0)
+    lt rx183_pos, -1, rx183_done
+    eq rx183_pos, -1, rx183_fail
+    jump $I10
+  rx183_done:
+    rx183_cur."!cursor_fail"()
+    rx183_cur."!cursor_debug"("FAIL  ", "metachar:sym<ws>")
+    .return (rx183_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__metachar:sym<ws>"  :subid("50_1261064009.3328") :method
+.annotate "line", 3
+    $P185 = self."!PREFIX__!subrule"("", "")
+    new $P186, "ResizablePMCArray"
+    push $P186, $P185
+    .return ($P186)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "metachar:sym<[ ]>"  :subid("51_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx189_tgt
+    .local int rx189_pos
+    .local int rx189_off
+    .local int rx189_eos
+    .local int rx189_rep
+    .local pmc rx189_cur
+    (rx189_cur, rx189_pos, rx189_tgt) = self."!cursor_start"()
+    rx189_cur."!cursor_debug"("START ", "metachar:sym<[ ]>")
+    .lex unicode:"$\x{a2}", rx189_cur
+    .local pmc match
+    .lex "$/", match
+    length rx189_eos, rx189_tgt
+    set rx189_off, 0
+    lt rx189_pos, 2, rx189_start
+    sub rx189_off, rx189_pos, 1
+    substr rx189_tgt, rx189_tgt, rx189_off
+  rx189_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan193_done
+    goto rxscan193_scan
+  rxscan193_loop:
+    ($P10) = rx189_cur."from"()
+    inc $P10
+    set rx189_pos, $P10
+    ge rx189_pos, rx189_eos, rxscan193_done
+  rxscan193_scan:
+    set_addr $I10, rxscan193_loop
+    rx189_cur."!mark_push"(0, rx189_pos, $I10)
+  rxscan193_done:
+.annotate "line", 75
+  # rx literal  "["
+    add $I11, rx189_pos, 1
+    gt $I11, rx189_eos, rx189_fail
+    sub $I11, rx189_pos, rx189_off
+    substr $S10, rx189_tgt, $I11, 1
+    ne $S10, "[", rx189_fail
+    add rx189_pos, 1
+  # rx subrule "nibbler" subtype=capture negate=
+    rx189_cur."!cursor_pos"(rx189_pos)
+    $P10 = rx189_cur."nibbler"()
+    unless $P10, rx189_fail
+    rx189_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("nibbler")
+    rx189_pos = $P10."pos"()
+  # rx literal  "]"
+    add $I11, rx189_pos, 1
+    gt $I11, rx189_eos, rx189_fail
+    sub $I11, rx189_pos, rx189_off
+    substr $S10, rx189_tgt, $I11, 1
+    ne $S10, "]", rx189_fail
+    add rx189_pos, 1
+  # rx pass
+    rx189_cur."!cursor_pass"(rx189_pos, "metachar:sym<[ ]>")
+    rx189_cur."!cursor_debug"("PASS  ", "metachar:sym<[ ]>", " at pos=", rx189_pos)
+    .return (rx189_cur)
+  rx189_fail:
+.annotate "line", 3
+    (rx189_rep, rx189_pos, $I10, $P10) = rx189_cur."!mark_fail"(0)
+    lt rx189_pos, -1, rx189_done
+    eq rx189_pos, -1, rx189_fail
+    jump $I10
+  rx189_done:
+    rx189_cur."!cursor_fail"()
+    rx189_cur."!cursor_debug"("FAIL  ", "metachar:sym<[ ]>")
+    .return (rx189_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__metachar:sym<[ ]>"  :subid("52_1261064009.3328") :method
+.annotate "line", 3
+    $P191 = self."!PREFIX__!subrule"("nibbler", "[")
+    new $P192, "ResizablePMCArray"
+    push $P192, $P191
+    .return ($P192)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "metachar:sym<( )>"  :subid("53_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx195_tgt
+    .local int rx195_pos
+    .local int rx195_off
+    .local int rx195_eos
+    .local int rx195_rep
+    .local pmc rx195_cur
+    (rx195_cur, rx195_pos, rx195_tgt) = self."!cursor_start"()
+    rx195_cur."!cursor_debug"("START ", "metachar:sym<( )>")
+    .lex unicode:"$\x{a2}", rx195_cur
+    .local pmc match
+    .lex "$/", match
+    length rx195_eos, rx195_tgt
+    set rx195_off, 0
+    lt rx195_pos, 2, rx195_start
+    sub rx195_off, rx195_pos, 1
+    substr rx195_tgt, rx195_tgt, rx195_off
+  rx195_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan199_done
+    goto rxscan199_scan
+  rxscan199_loop:
+    ($P10) = rx195_cur."from"()
+    inc $P10
+    set rx195_pos, $P10
+    ge rx195_pos, rx195_eos, rxscan199_done
+  rxscan199_scan:
+    set_addr $I10, rxscan199_loop
+    rx195_cur."!mark_push"(0, rx195_pos, $I10)
+  rxscan199_done:
+.annotate "line", 76
+  # rx literal  "("
+    add $I11, rx195_pos, 1
+    gt $I11, rx195_eos, rx195_fail
+    sub $I11, rx195_pos, rx195_off
+    substr $S10, rx195_tgt, $I11, 1
+    ne $S10, "(", rx195_fail
+    add rx195_pos, 1
+  # rx subrule "nibbler" subtype=capture negate=
+    rx195_cur."!cursor_pos"(rx195_pos)
+    $P10 = rx195_cur."nibbler"()
+    unless $P10, rx195_fail
+    rx195_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("nibbler")
+    rx195_pos = $P10."pos"()
+  # rx literal  ")"
+    add $I11, rx195_pos, 1
+    gt $I11, rx195_eos, rx195_fail
+    sub $I11, rx195_pos, rx195_off
+    substr $S10, rx195_tgt, $I11, 1
+    ne $S10, ")", rx195_fail
+    add rx195_pos, 1
+  # rx pass
+    rx195_cur."!cursor_pass"(rx195_pos, "metachar:sym<( )>")
+    rx195_cur."!cursor_debug"("PASS  ", "metachar:sym<( )>", " at pos=", rx195_pos)
+    .return (rx195_cur)
+  rx195_fail:
+.annotate "line", 3
+    (rx195_rep, rx195_pos, $I10, $P10) = rx195_cur."!mark_fail"(0)
+    lt rx195_pos, -1, rx195_done
+    eq rx195_pos, -1, rx195_fail
+    jump $I10
+  rx195_done:
+    rx195_cur."!cursor_fail"()
+    rx195_cur."!cursor_debug"("FAIL  ", "metachar:sym<( )>")
+    .return (rx195_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__metachar:sym<( )>"  :subid("54_1261064009.3328") :method
+.annotate "line", 3
+    $P197 = self."!PREFIX__!subrule"("nibbler", "(")
+    new $P198, "ResizablePMCArray"
+    push $P198, $P197
+    .return ($P198)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "metachar:sym<'>"  :subid("55_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx201_tgt
+    .local int rx201_pos
+    .local int rx201_off
+    .local int rx201_eos
+    .local int rx201_rep
+    .local pmc rx201_cur
+    (rx201_cur, rx201_pos, rx201_tgt) = self."!cursor_start"()
+    rx201_cur."!cursor_debug"("START ", "metachar:sym<'>")
+    .lex unicode:"$\x{a2}", rx201_cur
+    .local pmc match
+    .lex "$/", match
+    length rx201_eos, rx201_tgt
+    set rx201_off, 0
+    lt rx201_pos, 2, rx201_start
+    sub rx201_off, rx201_pos, 1
+    substr rx201_tgt, rx201_tgt, rx201_off
+  rx201_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan204_done
+    goto rxscan204_scan
+  rxscan204_loop:
+    ($P10) = rx201_cur."from"()
+    inc $P10
+    set rx201_pos, $P10
+    ge rx201_pos, rx201_eos, rxscan204_done
+  rxscan204_scan:
+    set_addr $I10, rxscan204_loop
+    rx201_cur."!mark_push"(0, rx201_pos, $I10)
+  rxscan204_done:
+.annotate "line", 77
+  # rx enumcharlist negate=0 zerowidth
+    ge rx201_pos, rx201_eos, rx201_fail
+    sub $I10, rx201_pos, rx201_off
+    substr $S10, rx201_tgt, $I10, 1
+    index $I11, "'", $S10
+    lt $I11, 0, rx201_fail
+  # rx subrule "quote_EXPR" subtype=capture negate=
+    rx201_cur."!cursor_pos"(rx201_pos)
+    $P10 = rx201_cur."quote_EXPR"(":q")
+    unless $P10, rx201_fail
+    rx201_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("quote_EXPR")
+    rx201_pos = $P10."pos"()
+  # rx pass
+    rx201_cur."!cursor_pass"(rx201_pos, "metachar:sym<'>")
+    rx201_cur."!cursor_debug"("PASS  ", "metachar:sym<'>", " at pos=", rx201_pos)
+    .return (rx201_cur)
+  rx201_fail:
+.annotate "line", 3
+    (rx201_rep, rx201_pos, $I10, $P10) = rx201_cur."!mark_fail"(0)
+    lt rx201_pos, -1, rx201_done
+    eq rx201_pos, -1, rx201_fail
+    jump $I10
+  rx201_done:
+    rx201_cur."!cursor_fail"()
+    rx201_cur."!cursor_debug"("FAIL  ", "metachar:sym<'>")
+    .return (rx201_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__metachar:sym<'>"  :subid("56_1261064009.3328") :method
+.annotate "line", 3
+    new $P203, "ResizablePMCArray"
+    push $P203, "'"
+    .return ($P203)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "metachar:sym<\">"  :subid("57_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx206_tgt
+    .local int rx206_pos
+    .local int rx206_off
+    .local int rx206_eos
+    .local int rx206_rep
+    .local pmc rx206_cur
+    (rx206_cur, rx206_pos, rx206_tgt) = self."!cursor_start"()
+    rx206_cur."!cursor_debug"("START ", "metachar:sym<\">")
+    .lex unicode:"$\x{a2}", rx206_cur
+    .local pmc match
+    .lex "$/", match
+    length rx206_eos, rx206_tgt
+    set rx206_off, 0
+    lt rx206_pos, 2, rx206_start
+    sub rx206_off, rx206_pos, 1
+    substr rx206_tgt, rx206_tgt, rx206_off
+  rx206_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan209_done
+    goto rxscan209_scan
+  rxscan209_loop:
+    ($P10) = rx206_cur."from"()
+    inc $P10
+    set rx206_pos, $P10
+    ge rx206_pos, rx206_eos, rxscan209_done
+  rxscan209_scan:
+    set_addr $I10, rxscan209_loop
+    rx206_cur."!mark_push"(0, rx206_pos, $I10)
+  rxscan209_done:
+.annotate "line", 78
+  # rx enumcharlist negate=0 zerowidth
+    ge rx206_pos, rx206_eos, rx206_fail
+    sub $I10, rx206_pos, rx206_off
+    substr $S10, rx206_tgt, $I10, 1
+    index $I11, "\"", $S10
+    lt $I11, 0, rx206_fail
+  # rx subrule "quote_EXPR" subtype=capture negate=
+    rx206_cur."!cursor_pos"(rx206_pos)
+    $P10 = rx206_cur."quote_EXPR"(":qq")
+    unless $P10, rx206_fail
+    rx206_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("quote_EXPR")
+    rx206_pos = $P10."pos"()
+  # rx pass
+    rx206_cur."!cursor_pass"(rx206_pos, "metachar:sym<\">")
+    rx206_cur."!cursor_debug"("PASS  ", "metachar:sym<\">", " at pos=", rx206_pos)
+    .return (rx206_cur)
+  rx206_fail:
+.annotate "line", 3
+    (rx206_rep, rx206_pos, $I10, $P10) = rx206_cur."!mark_fail"(0)
+    lt rx206_pos, -1, rx206_done
+    eq rx206_pos, -1, rx206_fail
+    jump $I10
+  rx206_done:
+    rx206_cur."!cursor_fail"()
+    rx206_cur."!cursor_debug"("FAIL  ", "metachar:sym<\">")
+    .return (rx206_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__metachar:sym<\">"  :subid("58_1261064009.3328") :method
+.annotate "line", 3
+    new $P208, "ResizablePMCArray"
+    push $P208, "\""
+    .return ($P208)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "metachar:sym<.>"  :subid("59_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx211_tgt
+    .local int rx211_pos
+    .local int rx211_off
+    .local int rx211_eos
+    .local int rx211_rep
+    .local pmc rx211_cur
+    (rx211_cur, rx211_pos, rx211_tgt) = self."!cursor_start"()
+    rx211_cur."!cursor_debug"("START ", "metachar:sym<.>")
+    .lex unicode:"$\x{a2}", rx211_cur
+    .local pmc match
+    .lex "$/", match
+    length rx211_eos, rx211_tgt
+    set rx211_off, 0
+    lt rx211_pos, 2, rx211_start
+    sub rx211_off, rx211_pos, 1
+    substr rx211_tgt, rx211_tgt, rx211_off
+  rx211_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan214_done
+    goto rxscan214_scan
+  rxscan214_loop:
+    ($P10) = rx211_cur."from"()
+    inc $P10
+    set rx211_pos, $P10
+    ge rx211_pos, rx211_eos, rxscan214_done
+  rxscan214_scan:
+    set_addr $I10, rxscan214_loop
+    rx211_cur."!mark_push"(0, rx211_pos, $I10)
+  rxscan214_done:
+.annotate "line", 79
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_215_fail
+    rx211_cur."!mark_push"(0, rx211_pos, $I10)
+  # rx literal  "."
+    add $I11, rx211_pos, 1
+    gt $I11, rx211_eos, rx211_fail
+    sub $I11, rx211_pos, rx211_off
+    substr $S10, rx211_tgt, $I11, 1
+    ne $S10, ".", rx211_fail
+    add rx211_pos, 1
+    set_addr $I10, rxcap_215_fail
+    ($I12, $I11) = rx211_cur."!mark_peek"($I10)
+    rx211_cur."!cursor_pos"($I11)
+    ($P10) = rx211_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx211_pos, "")
+    rx211_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_215_done
+  rxcap_215_fail:
+    goto rx211_fail
+  rxcap_215_done:
+  # rx pass
+    rx211_cur."!cursor_pass"(rx211_pos, "metachar:sym<.>")
+    rx211_cur."!cursor_debug"("PASS  ", "metachar:sym<.>", " at pos=", rx211_pos)
+    .return (rx211_cur)
+  rx211_fail:
+.annotate "line", 3
+    (rx211_rep, rx211_pos, $I10, $P10) = rx211_cur."!mark_fail"(0)
+    lt rx211_pos, -1, rx211_done
+    eq rx211_pos, -1, rx211_fail
+    jump $I10
+  rx211_done:
+    rx211_cur."!cursor_fail"()
+    rx211_cur."!cursor_debug"("FAIL  ", "metachar:sym<.>")
+    .return (rx211_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__metachar:sym<.>"  :subid("60_1261064009.3328") :method
+.annotate "line", 3
+    new $P213, "ResizablePMCArray"
+    push $P213, "."
+    .return ($P213)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "metachar:sym<^>"  :subid("61_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx217_tgt
+    .local int rx217_pos
+    .local int rx217_off
+    .local int rx217_eos
+    .local int rx217_rep
+    .local pmc rx217_cur
+    (rx217_cur, rx217_pos, rx217_tgt) = self."!cursor_start"()
+    rx217_cur."!cursor_debug"("START ", "metachar:sym<^>")
+    .lex unicode:"$\x{a2}", rx217_cur
+    .local pmc match
+    .lex "$/", match
+    length rx217_eos, rx217_tgt
+    set rx217_off, 0
+    lt rx217_pos, 2, rx217_start
+    sub rx217_off, rx217_pos, 1
+    substr rx217_tgt, rx217_tgt, rx217_off
+  rx217_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan220_done
+    goto rxscan220_scan
+  rxscan220_loop:
+    ($P10) = rx217_cur."from"()
+    inc $P10
+    set rx217_pos, $P10
+    ge rx217_pos, rx217_eos, rxscan220_done
+  rxscan220_scan:
+    set_addr $I10, rxscan220_loop
+    rx217_cur."!mark_push"(0, rx217_pos, $I10)
+  rxscan220_done:
+.annotate "line", 80
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_221_fail
+    rx217_cur."!mark_push"(0, rx217_pos, $I10)
+  # rx literal  "^"
+    add $I11, rx217_pos, 1
+    gt $I11, rx217_eos, rx217_fail
+    sub $I11, rx217_pos, rx217_off
+    substr $S10, rx217_tgt, $I11, 1
+    ne $S10, "^", rx217_fail
+    add rx217_pos, 1
+    set_addr $I10, rxcap_221_fail
+    ($I12, $I11) = rx217_cur."!mark_peek"($I10)
+    rx217_cur."!cursor_pos"($I11)
+    ($P10) = rx217_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx217_pos, "")
+    rx217_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_221_done
+  rxcap_221_fail:
+    goto rx217_fail
+  rxcap_221_done:
+  # rx pass
+    rx217_cur."!cursor_pass"(rx217_pos, "metachar:sym<^>")
+    rx217_cur."!cursor_debug"("PASS  ", "metachar:sym<^>", " at pos=", rx217_pos)
+    .return (rx217_cur)
+  rx217_fail:
+.annotate "line", 3
+    (rx217_rep, rx217_pos, $I10, $P10) = rx217_cur."!mark_fail"(0)
+    lt rx217_pos, -1, rx217_done
+    eq rx217_pos, -1, rx217_fail
+    jump $I10
+  rx217_done:
+    rx217_cur."!cursor_fail"()
+    rx217_cur."!cursor_debug"("FAIL  ", "metachar:sym<^>")
+    .return (rx217_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__metachar:sym<^>"  :subid("62_1261064009.3328") :method
+.annotate "line", 3
+    new $P219, "ResizablePMCArray"
+    push $P219, "^"
+    .return ($P219)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "metachar:sym<^^>"  :subid("63_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx223_tgt
+    .local int rx223_pos
+    .local int rx223_off
+    .local int rx223_eos
+    .local int rx223_rep
+    .local pmc rx223_cur
+    (rx223_cur, rx223_pos, rx223_tgt) = self."!cursor_start"()
+    rx223_cur."!cursor_debug"("START ", "metachar:sym<^^>")
+    .lex unicode:"$\x{a2}", rx223_cur
+    .local pmc match
+    .lex "$/", match
+    length rx223_eos, rx223_tgt
+    set rx223_off, 0
+    lt rx223_pos, 2, rx223_start
+    sub rx223_off, rx223_pos, 1
+    substr rx223_tgt, rx223_tgt, rx223_off
+  rx223_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan226_done
+    goto rxscan226_scan
+  rxscan226_loop:
+    ($P10) = rx223_cur."from"()
+    inc $P10
+    set rx223_pos, $P10
+    ge rx223_pos, rx223_eos, rxscan226_done
+  rxscan226_scan:
+    set_addr $I10, rxscan226_loop
+    rx223_cur."!mark_push"(0, rx223_pos, $I10)
+  rxscan226_done:
+.annotate "line", 81
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_227_fail
+    rx223_cur."!mark_push"(0, rx223_pos, $I10)
+  # rx literal  "^^"
+    add $I11, rx223_pos, 2
+    gt $I11, rx223_eos, rx223_fail
+    sub $I11, rx223_pos, rx223_off
+    substr $S10, rx223_tgt, $I11, 2
+    ne $S10, "^^", rx223_fail
+    add rx223_pos, 2
+    set_addr $I10, rxcap_227_fail
+    ($I12, $I11) = rx223_cur."!mark_peek"($I10)
+    rx223_cur."!cursor_pos"($I11)
+    ($P10) = rx223_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx223_pos, "")
+    rx223_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_227_done
+  rxcap_227_fail:
+    goto rx223_fail
+  rxcap_227_done:
+  # rx pass
+    rx223_cur."!cursor_pass"(rx223_pos, "metachar:sym<^^>")
+    rx223_cur."!cursor_debug"("PASS  ", "metachar:sym<^^>", " at pos=", rx223_pos)
+    .return (rx223_cur)
+  rx223_fail:
+.annotate "line", 3
+    (rx223_rep, rx223_pos, $I10, $P10) = rx223_cur."!mark_fail"(0)
+    lt rx223_pos, -1, rx223_done
+    eq rx223_pos, -1, rx223_fail
+    jump $I10
+  rx223_done:
+    rx223_cur."!cursor_fail"()
+    rx223_cur."!cursor_debug"("FAIL  ", "metachar:sym<^^>")
+    .return (rx223_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__metachar:sym<^^>"  :subid("64_1261064009.3328") :method
+.annotate "line", 3
+    new $P225, "ResizablePMCArray"
+    push $P225, "^^"
+    .return ($P225)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "metachar:sym<$>"  :subid("65_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx229_tgt
+    .local int rx229_pos
+    .local int rx229_off
+    .local int rx229_eos
+    .local int rx229_rep
+    .local pmc rx229_cur
+    (rx229_cur, rx229_pos, rx229_tgt) = self."!cursor_start"()
+    rx229_cur."!cursor_debug"("START ", "metachar:sym<$>")
+    .lex unicode:"$\x{a2}", rx229_cur
+    .local pmc match
+    .lex "$/", match
+    length rx229_eos, rx229_tgt
+    set rx229_off, 0
+    lt rx229_pos, 2, rx229_start
+    sub rx229_off, rx229_pos, 1
+    substr rx229_tgt, rx229_tgt, rx229_off
+  rx229_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan232_done
+    goto rxscan232_scan
+  rxscan232_loop:
+    ($P10) = rx229_cur."from"()
+    inc $P10
+    set rx229_pos, $P10
+    ge rx229_pos, rx229_eos, rxscan232_done
+  rxscan232_scan:
+    set_addr $I10, rxscan232_loop
+    rx229_cur."!mark_push"(0, rx229_pos, $I10)
+  rxscan232_done:
+.annotate "line", 82
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_233_fail
+    rx229_cur."!mark_push"(0, rx229_pos, $I10)
+  # rx literal  "$"
+    add $I11, rx229_pos, 1
+    gt $I11, rx229_eos, rx229_fail
+    sub $I11, rx229_pos, rx229_off
+    substr $S10, rx229_tgt, $I11, 1
+    ne $S10, "$", rx229_fail
+    add rx229_pos, 1
+    set_addr $I10, rxcap_233_fail
+    ($I12, $I11) = rx229_cur."!mark_peek"($I10)
+    rx229_cur."!cursor_pos"($I11)
+    ($P10) = rx229_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx229_pos, "")
+    rx229_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_233_done
+  rxcap_233_fail:
+    goto rx229_fail
+  rxcap_233_done:
+  # rx pass
+    rx229_cur."!cursor_pass"(rx229_pos, "metachar:sym<$>")
+    rx229_cur."!cursor_debug"("PASS  ", "metachar:sym<$>", " at pos=", rx229_pos)
+    .return (rx229_cur)
+  rx229_fail:
+.annotate "line", 3
+    (rx229_rep, rx229_pos, $I10, $P10) = rx229_cur."!mark_fail"(0)
+    lt rx229_pos, -1, rx229_done
+    eq rx229_pos, -1, rx229_fail
+    jump $I10
+  rx229_done:
+    rx229_cur."!cursor_fail"()
+    rx229_cur."!cursor_debug"("FAIL  ", "metachar:sym<$>")
+    .return (rx229_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__metachar:sym<$>"  :subid("66_1261064009.3328") :method
+.annotate "line", 3
+    new $P231, "ResizablePMCArray"
+    push $P231, "$"
+    .return ($P231)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "metachar:sym<$$>"  :subid("67_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx235_tgt
+    .local int rx235_pos
+    .local int rx235_off
+    .local int rx235_eos
+    .local int rx235_rep
+    .local pmc rx235_cur
+    (rx235_cur, rx235_pos, rx235_tgt) = self."!cursor_start"()
+    rx235_cur."!cursor_debug"("START ", "metachar:sym<$$>")
+    .lex unicode:"$\x{a2}", rx235_cur
+    .local pmc match
+    .lex "$/", match
+    length rx235_eos, rx235_tgt
+    set rx235_off, 0
+    lt rx235_pos, 2, rx235_start
+    sub rx235_off, rx235_pos, 1
+    substr rx235_tgt, rx235_tgt, rx235_off
+  rx235_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan238_done
+    goto rxscan238_scan
+  rxscan238_loop:
+    ($P10) = rx235_cur."from"()
+    inc $P10
+    set rx235_pos, $P10
+    ge rx235_pos, rx235_eos, rxscan238_done
+  rxscan238_scan:
+    set_addr $I10, rxscan238_loop
+    rx235_cur."!mark_push"(0, rx235_pos, $I10)
+  rxscan238_done:
+.annotate "line", 83
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_239_fail
+    rx235_cur."!mark_push"(0, rx235_pos, $I10)
+  # rx literal  "$$"
+    add $I11, rx235_pos, 2
+    gt $I11, rx235_eos, rx235_fail
+    sub $I11, rx235_pos, rx235_off
+    substr $S10, rx235_tgt, $I11, 2
+    ne $S10, "$$", rx235_fail
+    add rx235_pos, 2
+    set_addr $I10, rxcap_239_fail
+    ($I12, $I11) = rx235_cur."!mark_peek"($I10)
+    rx235_cur."!cursor_pos"($I11)
+    ($P10) = rx235_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx235_pos, "")
+    rx235_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_239_done
+  rxcap_239_fail:
+    goto rx235_fail
+  rxcap_239_done:
+  # rx pass
+    rx235_cur."!cursor_pass"(rx235_pos, "metachar:sym<$$>")
+    rx235_cur."!cursor_debug"("PASS  ", "metachar:sym<$$>", " at pos=", rx235_pos)
+    .return (rx235_cur)
+  rx235_fail:
+.annotate "line", 3
+    (rx235_rep, rx235_pos, $I10, $P10) = rx235_cur."!mark_fail"(0)
+    lt rx235_pos, -1, rx235_done
+    eq rx235_pos, -1, rx235_fail
+    jump $I10
+  rx235_done:
+    rx235_cur."!cursor_fail"()
+    rx235_cur."!cursor_debug"("FAIL  ", "metachar:sym<$$>")
+    .return (rx235_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__metachar:sym<$$>"  :subid("68_1261064009.3328") :method
+.annotate "line", 3
+    new $P237, "ResizablePMCArray"
+    push $P237, "$$"
+    .return ($P237)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "metachar:sym<:::>"  :subid("69_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx241_tgt
+    .local int rx241_pos
+    .local int rx241_off
+    .local int rx241_eos
+    .local int rx241_rep
+    .local pmc rx241_cur
+    (rx241_cur, rx241_pos, rx241_tgt) = self."!cursor_start"()
+    rx241_cur."!cursor_debug"("START ", "metachar:sym<:::>")
+    .lex unicode:"$\x{a2}", rx241_cur
+    .local pmc match
+    .lex "$/", match
+    length rx241_eos, rx241_tgt
+    set rx241_off, 0
+    lt rx241_pos, 2, rx241_start
+    sub rx241_off, rx241_pos, 1
+    substr rx241_tgt, rx241_tgt, rx241_off
+  rx241_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan245_done
+    goto rxscan245_scan
+  rxscan245_loop:
+    ($P10) = rx241_cur."from"()
+    inc $P10
+    set rx241_pos, $P10
+    ge rx241_pos, rx241_eos, rxscan245_done
+  rxscan245_scan:
+    set_addr $I10, rxscan245_loop
+    rx241_cur."!mark_push"(0, rx241_pos, $I10)
+  rxscan245_done:
+.annotate "line", 84
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_246_fail
+    rx241_cur."!mark_push"(0, rx241_pos, $I10)
+  # rx literal  ":::"
+    add $I11, rx241_pos, 3
+    gt $I11, rx241_eos, rx241_fail
+    sub $I11, rx241_pos, rx241_off
+    substr $S10, rx241_tgt, $I11, 3
+    ne $S10, ":::", rx241_fail
+    add rx241_pos, 3
+    set_addr $I10, rxcap_246_fail
+    ($I12, $I11) = rx241_cur."!mark_peek"($I10)
+    rx241_cur."!cursor_pos"($I11)
+    ($P10) = rx241_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx241_pos, "")
+    rx241_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_246_done
+  rxcap_246_fail:
+    goto rx241_fail
+  rxcap_246_done:
+  # rx subrule "panic" subtype=method negate=
+    rx241_cur."!cursor_pos"(rx241_pos)
+    $P10 = rx241_cur."panic"("::: not yet implemented")
+    unless $P10, rx241_fail
+    rx241_pos = $P10."pos"()
+  # rx pass
+    rx241_cur."!cursor_pass"(rx241_pos, "metachar:sym<:::>")
+    rx241_cur."!cursor_debug"("PASS  ", "metachar:sym<:::>", " at pos=", rx241_pos)
+    .return (rx241_cur)
+  rx241_fail:
+.annotate "line", 3
+    (rx241_rep, rx241_pos, $I10, $P10) = rx241_cur."!mark_fail"(0)
+    lt rx241_pos, -1, rx241_done
+    eq rx241_pos, -1, rx241_fail
+    jump $I10
+  rx241_done:
+    rx241_cur."!cursor_fail"()
+    rx241_cur."!cursor_debug"("FAIL  ", "metachar:sym<:::>")
+    .return (rx241_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__metachar:sym<:::>"  :subid("70_1261064009.3328") :method
+.annotate "line", 3
+    $P243 = self."!PREFIX__!subrule"("", ":::")
+    new $P244, "ResizablePMCArray"
+    push $P244, $P243
+    .return ($P244)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "metachar:sym<::>"  :subid("71_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx248_tgt
+    .local int rx248_pos
+    .local int rx248_off
+    .local int rx248_eos
+    .local int rx248_rep
+    .local pmc rx248_cur
+    (rx248_cur, rx248_pos, rx248_tgt) = self."!cursor_start"()
+    rx248_cur."!cursor_debug"("START ", "metachar:sym<::>")
+    .lex unicode:"$\x{a2}", rx248_cur
+    .local pmc match
+    .lex "$/", match
+    length rx248_eos, rx248_tgt
+    set rx248_off, 0
+    lt rx248_pos, 2, rx248_start
+    sub rx248_off, rx248_pos, 1
+    substr rx248_tgt, rx248_tgt, rx248_off
+  rx248_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan252_done
+    goto rxscan252_scan
+  rxscan252_loop:
+    ($P10) = rx248_cur."from"()
+    inc $P10
+    set rx248_pos, $P10
+    ge rx248_pos, rx248_eos, rxscan252_done
+  rxscan252_scan:
+    set_addr $I10, rxscan252_loop
+    rx248_cur."!mark_push"(0, rx248_pos, $I10)
+  rxscan252_done:
+.annotate "line", 85
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_253_fail
+    rx248_cur."!mark_push"(0, rx248_pos, $I10)
+  # rx literal  "::"
+    add $I11, rx248_pos, 2
+    gt $I11, rx248_eos, rx248_fail
+    sub $I11, rx248_pos, rx248_off
+    substr $S10, rx248_tgt, $I11, 2
+    ne $S10, "::", rx248_fail
+    add rx248_pos, 2
+    set_addr $I10, rxcap_253_fail
+    ($I12, $I11) = rx248_cur."!mark_peek"($I10)
+    rx248_cur."!cursor_pos"($I11)
+    ($P10) = rx248_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx248_pos, "")
+    rx248_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_253_done
+  rxcap_253_fail:
+    goto rx248_fail
+  rxcap_253_done:
+  # rx subrule "panic" subtype=method negate=
+    rx248_cur."!cursor_pos"(rx248_pos)
+    $P10 = rx248_cur."panic"(":: not yet implemented")
+    unless $P10, rx248_fail
+    rx248_pos = $P10."pos"()
+  # rx pass
+    rx248_cur."!cursor_pass"(rx248_pos, "metachar:sym<::>")
+    rx248_cur."!cursor_debug"("PASS  ", "metachar:sym<::>", " at pos=", rx248_pos)
+    .return (rx248_cur)
+  rx248_fail:
+.annotate "line", 3
+    (rx248_rep, rx248_pos, $I10, $P10) = rx248_cur."!mark_fail"(0)
+    lt rx248_pos, -1, rx248_done
+    eq rx248_pos, -1, rx248_fail
+    jump $I10
+  rx248_done:
+    rx248_cur."!cursor_fail"()
+    rx248_cur."!cursor_debug"("FAIL  ", "metachar:sym<::>")
+    .return (rx248_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__metachar:sym<::>"  :subid("72_1261064009.3328") :method
+.annotate "line", 3
+    $P250 = self."!PREFIX__!subrule"("", "::")
+    new $P251, "ResizablePMCArray"
+    push $P251, $P250
+    .return ($P251)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "metachar:sym<lwb>"  :subid("73_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx255_tgt
+    .local int rx255_pos
+    .local int rx255_off
+    .local int rx255_eos
+    .local int rx255_rep
+    .local pmc rx255_cur
+    (rx255_cur, rx255_pos, rx255_tgt) = self."!cursor_start"()
+    rx255_cur."!cursor_debug"("START ", "metachar:sym<lwb>")
+    .lex unicode:"$\x{a2}", rx255_cur
+    .local pmc match
+    .lex "$/", match
+    length rx255_eos, rx255_tgt
+    set rx255_off, 0
+    lt rx255_pos, 2, rx255_start
+    sub rx255_off, rx255_pos, 1
+    substr rx255_tgt, rx255_tgt, rx255_off
+  rx255_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan258_done
+    goto rxscan258_scan
+  rxscan258_loop:
+    ($P10) = rx255_cur."from"()
+    inc $P10
+    set rx255_pos, $P10
+    ge rx255_pos, rx255_eos, rxscan258_done
+  rxscan258_scan:
+    set_addr $I10, rxscan258_loop
+    rx255_cur."!mark_push"(0, rx255_pos, $I10)
+  rxscan258_done:
+.annotate "line", 86
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_260_fail
+    rx255_cur."!mark_push"(0, rx255_pos, $I10)
+  alt259_0:
+    set_addr $I10, alt259_1
+    rx255_cur."!mark_push"(0, rx255_pos, $I10)
+  # rx literal  "<<"
+    add $I11, rx255_pos, 2
+    gt $I11, rx255_eos, rx255_fail
+    sub $I11, rx255_pos, rx255_off
+    substr $S10, rx255_tgt, $I11, 2
+    ne $S10, "<<", rx255_fail
+    add rx255_pos, 2
+    goto alt259_end
+  alt259_1:
+  # rx literal  unicode:"\x{ab}"
+    add $I11, rx255_pos, 1
+    gt $I11, rx255_eos, rx255_fail
+    sub $I11, rx255_pos, rx255_off
+    substr $S10, rx255_tgt, $I11, 1
+    ne $S10, unicode:"\x{ab}", rx255_fail
+    add rx255_pos, 1
+  alt259_end:
+    set_addr $I10, rxcap_260_fail
+    ($I12, $I11) = rx255_cur."!mark_peek"($I10)
+    rx255_cur."!cursor_pos"($I11)
+    ($P10) = rx255_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx255_pos, "")
+    rx255_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_260_done
+  rxcap_260_fail:
+    goto rx255_fail
+  rxcap_260_done:
+  # rx pass
+    rx255_cur."!cursor_pass"(rx255_pos, "metachar:sym<lwb>")
+    rx255_cur."!cursor_debug"("PASS  ", "metachar:sym<lwb>", " at pos=", rx255_pos)
+    .return (rx255_cur)
+  rx255_fail:
+.annotate "line", 3
+    (rx255_rep, rx255_pos, $I10, $P10) = rx255_cur."!mark_fail"(0)
+    lt rx255_pos, -1, rx255_done
+    eq rx255_pos, -1, rx255_fail
+    jump $I10
+  rx255_done:
+    rx255_cur."!cursor_fail"()
+    rx255_cur."!cursor_debug"("FAIL  ", "metachar:sym<lwb>")
+    .return (rx255_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__metachar:sym<lwb>"  :subid("74_1261064009.3328") :method
+.annotate "line", 3
+    new $P257, "ResizablePMCArray"
+    push $P257, unicode:"\x{ab}"
+    push $P257, "<<"
+    .return ($P257)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "metachar:sym<rwb>"  :subid("75_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx262_tgt
+    .local int rx262_pos
+    .local int rx262_off
+    .local int rx262_eos
+    .local int rx262_rep
+    .local pmc rx262_cur
+    (rx262_cur, rx262_pos, rx262_tgt) = self."!cursor_start"()
+    rx262_cur."!cursor_debug"("START ", "metachar:sym<rwb>")
+    .lex unicode:"$\x{a2}", rx262_cur
+    .local pmc match
+    .lex "$/", match
+    length rx262_eos, rx262_tgt
+    set rx262_off, 0
+    lt rx262_pos, 2, rx262_start
+    sub rx262_off, rx262_pos, 1
+    substr rx262_tgt, rx262_tgt, rx262_off
+  rx262_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan265_done
+    goto rxscan265_scan
+  rxscan265_loop:
+    ($P10) = rx262_cur."from"()
+    inc $P10
+    set rx262_pos, $P10
+    ge rx262_pos, rx262_eos, rxscan265_done
+  rxscan265_scan:
+    set_addr $I10, rxscan265_loop
+    rx262_cur."!mark_push"(0, rx262_pos, $I10)
+  rxscan265_done:
+.annotate "line", 87
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_267_fail
+    rx262_cur."!mark_push"(0, rx262_pos, $I10)
+  alt266_0:
+    set_addr $I10, alt266_1
+    rx262_cur."!mark_push"(0, rx262_pos, $I10)
+  # rx literal  ">>"
+    add $I11, rx262_pos, 2
+    gt $I11, rx262_eos, rx262_fail
+    sub $I11, rx262_pos, rx262_off
+    substr $S10, rx262_tgt, $I11, 2
+    ne $S10, ">>", rx262_fail
+    add rx262_pos, 2
+    goto alt266_end
+  alt266_1:
+  # rx literal  unicode:"\x{bb}"
+    add $I11, rx262_pos, 1
+    gt $I11, rx262_eos, rx262_fail
+    sub $I11, rx262_pos, rx262_off
+    substr $S10, rx262_tgt, $I11, 1
+    ne $S10, unicode:"\x{bb}", rx262_fail
+    add rx262_pos, 1
+  alt266_end:
+    set_addr $I10, rxcap_267_fail
+    ($I12, $I11) = rx262_cur."!mark_peek"($I10)
+    rx262_cur."!cursor_pos"($I11)
+    ($P10) = rx262_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx262_pos, "")
+    rx262_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_267_done
+  rxcap_267_fail:
+    goto rx262_fail
+  rxcap_267_done:
+  # rx pass
+    rx262_cur."!cursor_pass"(rx262_pos, "metachar:sym<rwb>")
+    rx262_cur."!cursor_debug"("PASS  ", "metachar:sym<rwb>", " at pos=", rx262_pos)
+    .return (rx262_cur)
+  rx262_fail:
+.annotate "line", 3
+    (rx262_rep, rx262_pos, $I10, $P10) = rx262_cur."!mark_fail"(0)
+    lt rx262_pos, -1, rx262_done
+    eq rx262_pos, -1, rx262_fail
+    jump $I10
+  rx262_done:
+    rx262_cur."!cursor_fail"()
+    rx262_cur."!cursor_debug"("FAIL  ", "metachar:sym<rwb>")
+    .return (rx262_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__metachar:sym<rwb>"  :subid("76_1261064009.3328") :method
+.annotate "line", 3
+    new $P264, "ResizablePMCArray"
+    push $P264, unicode:"\x{bb}"
+    push $P264, ">>"
+    .return ($P264)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "metachar:sym<bs>"  :subid("77_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx269_tgt
+    .local int rx269_pos
+    .local int rx269_off
+    .local int rx269_eos
+    .local int rx269_rep
+    .local pmc rx269_cur
+    (rx269_cur, rx269_pos, rx269_tgt) = self."!cursor_start"()
+    rx269_cur."!cursor_debug"("START ", "metachar:sym<bs>")
+    .lex unicode:"$\x{a2}", rx269_cur
+    .local pmc match
+    .lex "$/", match
+    length rx269_eos, rx269_tgt
+    set rx269_off, 0
+    lt rx269_pos, 2, rx269_start
+    sub rx269_off, rx269_pos, 1
+    substr rx269_tgt, rx269_tgt, rx269_off
+  rx269_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan273_done
+    goto rxscan273_scan
+  rxscan273_loop:
+    ($P10) = rx269_cur."from"()
+    inc $P10
+    set rx269_pos, $P10
+    ge rx269_pos, rx269_eos, rxscan273_done
+  rxscan273_scan:
+    set_addr $I10, rxscan273_loop
+    rx269_cur."!mark_push"(0, rx269_pos, $I10)
+  rxscan273_done:
+.annotate "line", 88
+  # rx literal  "\\"
+    add $I11, rx269_pos, 1
+    gt $I11, rx269_eos, rx269_fail
+    sub $I11, rx269_pos, rx269_off
+    substr $S10, rx269_tgt, $I11, 1
+    ne $S10, "\\", rx269_fail
+    add rx269_pos, 1
+  # rx subrule "backslash" subtype=capture negate=
+    rx269_cur."!cursor_pos"(rx269_pos)
+    $P10 = rx269_cur."backslash"()
+    unless $P10, rx269_fail
+    rx269_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("backslash")
+    rx269_pos = $P10."pos"()
+  # rx pass
+    rx269_cur."!cursor_pass"(rx269_pos, "metachar:sym<bs>")
+    rx269_cur."!cursor_debug"("PASS  ", "metachar:sym<bs>", " at pos=", rx269_pos)
+    .return (rx269_cur)
+  rx269_fail:
+.annotate "line", 3
+    (rx269_rep, rx269_pos, $I10, $P10) = rx269_cur."!mark_fail"(0)
+    lt rx269_pos, -1, rx269_done
+    eq rx269_pos, -1, rx269_fail
+    jump $I10
+  rx269_done:
+    rx269_cur."!cursor_fail"()
+    rx269_cur."!cursor_debug"("FAIL  ", "metachar:sym<bs>")
+    .return (rx269_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__metachar:sym<bs>"  :subid("78_1261064009.3328") :method
+.annotate "line", 3
+    $P271 = self."!PREFIX__!subrule"("backslash", "\\")
+    new $P272, "ResizablePMCArray"
+    push $P272, $P271
+    .return ($P272)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "metachar:sym<mod>"  :subid("79_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx275_tgt
+    .local int rx275_pos
+    .local int rx275_off
+    .local int rx275_eos
+    .local int rx275_rep
+    .local pmc rx275_cur
+    (rx275_cur, rx275_pos, rx275_tgt) = self."!cursor_start"()
+    rx275_cur."!cursor_debug"("START ", "metachar:sym<mod>")
+    .lex unicode:"$\x{a2}", rx275_cur
+    .local pmc match
+    .lex "$/", match
+    length rx275_eos, rx275_tgt
+    set rx275_off, 0
+    lt rx275_pos, 2, rx275_start
+    sub rx275_off, rx275_pos, 1
+    substr rx275_tgt, rx275_tgt, rx275_off
+  rx275_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan279_done
+    goto rxscan279_scan
+  rxscan279_loop:
+    ($P10) = rx275_cur."from"()
+    inc $P10
+    set rx275_pos, $P10
+    ge rx275_pos, rx275_eos, rxscan279_done
+  rxscan279_scan:
+    set_addr $I10, rxscan279_loop
+    rx275_cur."!mark_push"(0, rx275_pos, $I10)
+  rxscan279_done:
+.annotate "line", 89
+  # rx subrule "mod_internal" subtype=capture negate=
+    rx275_cur."!cursor_pos"(rx275_pos)
+    $P10 = rx275_cur."mod_internal"()
+    unless $P10, rx275_fail
+    rx275_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("mod_internal")
+    rx275_pos = $P10."pos"()
+  # rx pass
+    rx275_cur."!cursor_pass"(rx275_pos, "metachar:sym<mod>")
+    rx275_cur."!cursor_debug"("PASS  ", "metachar:sym<mod>", " at pos=", rx275_pos)
+    .return (rx275_cur)
+  rx275_fail:
+.annotate "line", 3
+    (rx275_rep, rx275_pos, $I10, $P10) = rx275_cur."!mark_fail"(0)
+    lt rx275_pos, -1, rx275_done
+    eq rx275_pos, -1, rx275_fail
+    jump $I10
+  rx275_done:
+    rx275_cur."!cursor_fail"()
+    rx275_cur."!cursor_debug"("FAIL  ", "metachar:sym<mod>")
+    .return (rx275_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__metachar:sym<mod>"  :subid("80_1261064009.3328") :method
+.annotate "line", 3
+    $P277 = self."!PREFIX__!subrule"("mod_internal", "")
+    new $P278, "ResizablePMCArray"
+    push $P278, $P277
+    .return ($P278)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "metachar:sym<~>"  :subid("81_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx281_tgt
+    .local int rx281_pos
+    .local int rx281_off
+    .local int rx281_eos
+    .local int rx281_rep
+    .local pmc rx281_cur
+    (rx281_cur, rx281_pos, rx281_tgt) = self."!cursor_start"()
+    rx281_cur."!cursor_debug"("START ", "metachar:sym<~>")
+    .lex unicode:"$\x{a2}", rx281_cur
+    .local pmc match
+    .lex "$/", match
+    length rx281_eos, rx281_tgt
+    set rx281_off, 0
+    lt rx281_pos, 2, rx281_start
+    sub rx281_off, rx281_pos, 1
+    substr rx281_tgt, rx281_tgt, rx281_off
+  rx281_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan285_done
+    goto rxscan285_scan
+  rxscan285_loop:
+    ($P10) = rx281_cur."from"()
+    inc $P10
+    set rx281_pos, $P10
+    ge rx281_pos, rx281_eos, rxscan285_done
+  rxscan285_scan:
+    set_addr $I10, rxscan285_loop
+    rx281_cur."!mark_push"(0, rx281_pos, $I10)
+  rxscan285_done:
+.annotate "line", 93
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_286_fail
+    rx281_cur."!mark_push"(0, rx281_pos, $I10)
+  # rx literal  "~"
+    add $I11, rx281_pos, 1
+    gt $I11, rx281_eos, rx281_fail
+    sub $I11, rx281_pos, rx281_off
+    substr $S10, rx281_tgt, $I11, 1
+    ne $S10, "~", rx281_fail
+    add rx281_pos, 1
+    set_addr $I10, rxcap_286_fail
+    ($I12, $I11) = rx281_cur."!mark_peek"($I10)
+    rx281_cur."!cursor_pos"($I11)
+    ($P10) = rx281_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx281_pos, "")
+    rx281_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_286_done
+  rxcap_286_fail:
+    goto rx281_fail
+  rxcap_286_done:
+.annotate "line", 94
+  # rx subrule "ws" subtype=method negate=
+    rx281_cur."!cursor_pos"(rx281_pos)
+    $P10 = rx281_cur."ws"()
+    unless $P10, rx281_fail
+    rx281_pos = $P10."pos"()
+  # rx subrule "quantified_atom" subtype=capture negate=
+    rx281_cur."!cursor_pos"(rx281_pos)
+    $P10 = rx281_cur."quantified_atom"()
+    unless $P10, rx281_fail
+    rx281_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("GOAL")
+    rx281_pos = $P10."pos"()
+.annotate "line", 95
+  # rx subrule "ws" subtype=method negate=
+    rx281_cur."!cursor_pos"(rx281_pos)
+    $P10 = rx281_cur."ws"()
+    unless $P10, rx281_fail
+    rx281_pos = $P10."pos"()
+  # rx subrule "quantified_atom" subtype=capture negate=
+    rx281_cur."!cursor_pos"(rx281_pos)
+    $P10 = rx281_cur."quantified_atom"()
+    unless $P10, rx281_fail
+    rx281_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("EXPR")
+    rx281_pos = $P10."pos"()
+.annotate "line", 92
+  # rx pass
+    rx281_cur."!cursor_pass"(rx281_pos, "metachar:sym<~>")
+    rx281_cur."!cursor_debug"("PASS  ", "metachar:sym<~>", " at pos=", rx281_pos)
+    .return (rx281_cur)
+  rx281_fail:
+.annotate "line", 3
+    (rx281_rep, rx281_pos, $I10, $P10) = rx281_cur."!mark_fail"(0)
+    lt rx281_pos, -1, rx281_done
+    eq rx281_pos, -1, rx281_fail
+    jump $I10
+  rx281_done:
+    rx281_cur."!cursor_fail"()
+    rx281_cur."!cursor_debug"("FAIL  ", "metachar:sym<~>")
+    .return (rx281_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__metachar:sym<~>"  :subid("82_1261064009.3328") :method
+.annotate "line", 3
+    $P283 = self."!PREFIX__!subrule"("", "~")
+    new $P284, "ResizablePMCArray"
+    push $P284, $P283
+    .return ($P284)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "metachar:sym<{*}>"  :subid("83_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx288_tgt
+    .local int rx288_pos
+    .local int rx288_off
+    .local int rx288_eos
+    .local int rx288_rep
+    .local pmc rx288_cur
+    (rx288_cur, rx288_pos, rx288_tgt) = self."!cursor_start"()
+    rx288_cur."!cursor_debug"("START ", "metachar:sym<{*}>")
+    rx288_cur."!cursor_caparray"("key")
+    .lex unicode:"$\x{a2}", rx288_cur
+    .local pmc match
+    .lex "$/", match
+    length rx288_eos, rx288_tgt
+    set rx288_off, 0
+    lt rx288_pos, 2, rx288_start
+    sub rx288_off, rx288_pos, 1
+    substr rx288_tgt, rx288_tgt, rx288_off
+  rx288_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan291_done
+    goto rxscan291_scan
+  rxscan291_loop:
+    ($P10) = rx288_cur."from"()
+    inc $P10
+    set rx288_pos, $P10
+    ge rx288_pos, rx288_eos, rxscan291_done
+  rxscan291_scan:
+    set_addr $I10, rxscan291_loop
+    rx288_cur."!mark_push"(0, rx288_pos, $I10)
+  rxscan291_done:
+.annotate "line", 99
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_292_fail
+    rx288_cur."!mark_push"(0, rx288_pos, $I10)
+  # rx literal  "{*}"
+    add $I11, rx288_pos, 3
+    gt $I11, rx288_eos, rx288_fail
+    sub $I11, rx288_pos, rx288_off
+    substr $S10, rx288_tgt, $I11, 3
+    ne $S10, "{*}", rx288_fail
+    add rx288_pos, 3
+    set_addr $I10, rxcap_292_fail
+    ($I12, $I11) = rx288_cur."!mark_peek"($I10)
+    rx288_cur."!cursor_pos"($I11)
+    ($P10) = rx288_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx288_pos, "")
+    rx288_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_292_done
+  rxcap_292_fail:
+    goto rx288_fail
+  rxcap_292_done:
+.annotate "line", 100
+  # rx rxquantr293 ** 0..1
+    set_addr $I303, rxquantr293_done
+    rx288_cur."!mark_push"(0, rx288_pos, $I303)
+  rxquantr293_loop:
+  # rx rxquantr294 ** 0..*
+    set_addr $I295, rxquantr294_done
+    rx288_cur."!mark_push"(0, rx288_pos, $I295)
+  rxquantr294_loop:
+  # rx enumcharlist negate=0 
+    ge rx288_pos, rx288_eos, rx288_fail
+    sub $I10, rx288_pos, rx288_off
+    substr $S10, rx288_tgt, $I10, 1
+    index $I11, unicode:"\t \x{a0}\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000", $S10
+    lt $I11, 0, rx288_fail
+    inc rx288_pos
+    (rx288_rep) = rx288_cur."!mark_commit"($I295)
+    rx288_cur."!mark_push"(rx288_rep, rx288_pos, $I295)
+    goto rxquantr294_loop
+  rxquantr294_done:
+  # rx literal  "#= "
+    add $I11, rx288_pos, 3
+    gt $I11, rx288_eos, rx288_fail
+    sub $I11, rx288_pos, rx288_off
+    substr $S10, rx288_tgt, $I11, 3
+    ne $S10, "#= ", rx288_fail
+    add rx288_pos, 3
+  # rx rxquantr296 ** 0..*
+    set_addr $I297, rxquantr296_done
+    rx288_cur."!mark_push"(0, rx288_pos, $I297)
+  rxquantr296_loop:
+  # rx enumcharlist negate=0 
+    ge rx288_pos, rx288_eos, rx288_fail
+    sub $I10, rx288_pos, rx288_off
+    substr $S10, rx288_tgt, $I10, 1
+    index $I11, unicode:"\t \x{a0}\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000", $S10
+    lt $I11, 0, rx288_fail
+    inc rx288_pos
+    (rx288_rep) = rx288_cur."!mark_commit"($I297)
+    rx288_cur."!mark_push"(rx288_rep, rx288_pos, $I297)
+    goto rxquantr296_loop
+  rxquantr296_done:
+  # rx subcapture "key"
+    set_addr $I10, rxcap_302_fail
+    rx288_cur."!mark_push"(0, rx288_pos, $I10)
+  # rx charclass_q S r 1..-1
+    sub $I10, rx288_pos, rx288_off
+    find_cclass $I11, 32, rx288_tgt, $I10, rx288_eos
+    add $I12, $I10, 1
+    lt $I11, $I12, rx288_fail
+    add rx288_pos, rx288_off, $I11
+  # rx rxquantr298 ** 0..*
+    set_addr $I301, rxquantr298_done
+    rx288_cur."!mark_push"(0, rx288_pos, $I301)
+  rxquantr298_loop:
+  # rx rxquantr299 ** 1..*
+    set_addr $I300, rxquantr299_done
+    rx288_cur."!mark_push"(0, -1, $I300)
+  rxquantr299_loop:
+  # rx enumcharlist negate=0 
+    ge rx288_pos, rx288_eos, rx288_fail
+    sub $I10, rx288_pos, rx288_off
+    substr $S10, rx288_tgt, $I10, 1
+    index $I11, unicode:"\t \x{a0}\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000", $S10
+    lt $I11, 0, rx288_fail
+    inc rx288_pos
+    (rx288_rep) = rx288_cur."!mark_commit"($I300)
+    rx288_cur."!mark_push"(rx288_rep, rx288_pos, $I300)
+    goto rxquantr299_loop
+  rxquantr299_done:
+  # rx charclass_q S r 1..-1
+    sub $I10, rx288_pos, rx288_off
+    find_cclass $I11, 32, rx288_tgt, $I10, rx288_eos
+    add $I12, $I10, 1
+    lt $I11, $I12, rx288_fail
+    add rx288_pos, rx288_off, $I11
+    (rx288_rep) = rx288_cur."!mark_commit"($I301)
+    rx288_cur."!mark_push"(rx288_rep, rx288_pos, $I301)
+    goto rxquantr298_loop
+  rxquantr298_done:
+    set_addr $I10, rxcap_302_fail
+    ($I12, $I11) = rx288_cur."!mark_peek"($I10)
+    rx288_cur."!cursor_pos"($I11)
+    ($P10) = rx288_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx288_pos, "")
+    rx288_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("key")
+    goto rxcap_302_done
+  rxcap_302_fail:
+    goto rx288_fail
+  rxcap_302_done:
+    (rx288_rep) = rx288_cur."!mark_commit"($I303)
+  rxquantr293_done:
+.annotate "line", 98
+  # rx pass
+    rx288_cur."!cursor_pass"(rx288_pos, "metachar:sym<{*}>")
+    rx288_cur."!cursor_debug"("PASS  ", "metachar:sym<{*}>", " at pos=", rx288_pos)
+    .return (rx288_cur)
+  rx288_fail:
+.annotate "line", 3
+    (rx288_rep, rx288_pos, $I10, $P10) = rx288_cur."!mark_fail"(0)
+    lt rx288_pos, -1, rx288_done
+    eq rx288_pos, -1, rx288_fail
+    jump $I10
+  rx288_done:
+    rx288_cur."!cursor_fail"()
+    rx288_cur."!cursor_debug"("FAIL  ", "metachar:sym<{*}>")
+    .return (rx288_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__metachar:sym<{*}>"  :subid("84_1261064009.3328") :method
+.annotate "line", 3
+    new $P290, "ResizablePMCArray"
+    push $P290, "{*}"
+    .return ($P290)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "metachar:sym<assert>"  :subid("85_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx305_tgt
+    .local int rx305_pos
+    .local int rx305_off
+    .local int rx305_eos
+    .local int rx305_rep
+    .local pmc rx305_cur
+    (rx305_cur, rx305_pos, rx305_tgt) = self."!cursor_start"()
+    rx305_cur."!cursor_debug"("START ", "metachar:sym<assert>")
+    .lex unicode:"$\x{a2}", rx305_cur
+    .local pmc match
+    .lex "$/", match
+    length rx305_eos, rx305_tgt
+    set rx305_off, 0
+    lt rx305_pos, 2, rx305_start
+    sub rx305_off, rx305_pos, 1
+    substr rx305_tgt, rx305_tgt, rx305_off
+  rx305_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan309_done
+    goto rxscan309_scan
+  rxscan309_loop:
+    ($P10) = rx305_cur."from"()
+    inc $P10
+    set rx305_pos, $P10
+    ge rx305_pos, rx305_eos, rxscan309_done
+  rxscan309_scan:
+    set_addr $I10, rxscan309_loop
+    rx305_cur."!mark_push"(0, rx305_pos, $I10)
+  rxscan309_done:
+.annotate "line", 103
+  # rx literal  "<"
+    add $I11, rx305_pos, 1
+    gt $I11, rx305_eos, rx305_fail
+    sub $I11, rx305_pos, rx305_off
+    substr $S10, rx305_tgt, $I11, 1
+    ne $S10, "<", rx305_fail
+    add rx305_pos, 1
+  # rx subrule "assertion" subtype=capture negate=
+    rx305_cur."!cursor_pos"(rx305_pos)
+    $P10 = rx305_cur."assertion"()
+    unless $P10, rx305_fail
+    rx305_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("assertion")
+    rx305_pos = $P10."pos"()
+  alt310_0:
+.annotate "line", 104
+    set_addr $I10, alt310_1
+    rx305_cur."!mark_push"(0, rx305_pos, $I10)
+  # rx literal  ">"
+    add $I11, rx305_pos, 1
+    gt $I11, rx305_eos, rx305_fail
+    sub $I11, rx305_pos, rx305_off
+    substr $S10, rx305_tgt, $I11, 1
+    ne $S10, ">", rx305_fail
+    add rx305_pos, 1
+    goto alt310_end
+  alt310_1:
+  # rx subrule "panic" subtype=method negate=
+    rx305_cur."!cursor_pos"(rx305_pos)
+    $P10 = rx305_cur."panic"("regex assertion not terminated by angle bracket")
+    unless $P10, rx305_fail
+    rx305_pos = $P10."pos"()
+  alt310_end:
+.annotate "line", 102
+  # rx pass
+    rx305_cur."!cursor_pass"(rx305_pos, "metachar:sym<assert>")
+    rx305_cur."!cursor_debug"("PASS  ", "metachar:sym<assert>", " at pos=", rx305_pos)
+    .return (rx305_cur)
+  rx305_fail:
+.annotate "line", 3
+    (rx305_rep, rx305_pos, $I10, $P10) = rx305_cur."!mark_fail"(0)
+    lt rx305_pos, -1, rx305_done
+    eq rx305_pos, -1, rx305_fail
+    jump $I10
+  rx305_done:
+    rx305_cur."!cursor_fail"()
+    rx305_cur."!cursor_debug"("FAIL  ", "metachar:sym<assert>")
+    .return (rx305_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__metachar:sym<assert>"  :subid("86_1261064009.3328") :method
+.annotate "line", 3
+    $P307 = self."!PREFIX__!subrule"("assertion", "<")
+    new $P308, "ResizablePMCArray"
+    push $P308, $P307
+    .return ($P308)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "metachar:sym<var>"  :subid("87_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx312_tgt
+    .local int rx312_pos
+    .local int rx312_off
+    .local int rx312_eos
+    .local int rx312_rep
+    .local pmc rx312_cur
+    (rx312_cur, rx312_pos, rx312_tgt) = self."!cursor_start"()
+    rx312_cur."!cursor_debug"("START ", "metachar:sym<var>")
+    rx312_cur."!cursor_caparray"("quantified_atom")
+    .lex unicode:"$\x{a2}", rx312_cur
+    .local pmc match
+    .lex "$/", match
+    length rx312_eos, rx312_tgt
+    set rx312_off, 0
+    lt rx312_pos, 2, rx312_start
+    sub rx312_off, rx312_pos, 1
+    substr rx312_tgt, rx312_tgt, rx312_off
+  rx312_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan315_done
+    goto rxscan315_scan
+  rxscan315_loop:
+    ($P10) = rx312_cur."from"()
+    inc $P10
+    set rx312_pos, $P10
+    ge rx312_pos, rx312_eos, rxscan315_done
+  rxscan315_scan:
+    set_addr $I10, rxscan315_loop
+    rx312_cur."!mark_push"(0, rx312_pos, $I10)
+  rxscan315_done:
+  alt316_0:
+.annotate "line", 108
+    set_addr $I10, alt316_1
+    rx312_cur."!mark_push"(0, rx312_pos, $I10)
+.annotate "line", 109
+  # rx literal  "$<"
+    add $I11, rx312_pos, 2
+    gt $I11, rx312_eos, rx312_fail
+    sub $I11, rx312_pos, rx312_off
+    substr $S10, rx312_tgt, $I11, 2
+    ne $S10, "$<", rx312_fail
+    add rx312_pos, 2
+  # rx subcapture "name"
+    set_addr $I10, rxcap_319_fail
+    rx312_cur."!mark_push"(0, rx312_pos, $I10)
+  # rx rxquantr317 ** 1..*
+    set_addr $I318, rxquantr317_done
+    rx312_cur."!mark_push"(0, -1, $I318)
+  rxquantr317_loop:
+  # rx enumcharlist negate=1 
+    ge rx312_pos, rx312_eos, rx312_fail
+    sub $I10, rx312_pos, rx312_off
+    substr $S10, rx312_tgt, $I10, 1
+    index $I11, ">", $S10
+    ge $I11, 0, rx312_fail
+    inc rx312_pos
+    (rx312_rep) = rx312_cur."!mark_commit"($I318)
+    rx312_cur."!mark_push"(rx312_rep, rx312_pos, $I318)
+    goto rxquantr317_loop
+  rxquantr317_done:
+    set_addr $I10, rxcap_319_fail
+    ($I12, $I11) = rx312_cur."!mark_peek"($I10)
+    rx312_cur."!cursor_pos"($I11)
+    ($P10) = rx312_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx312_pos, "")
+    rx312_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("name")
+    goto rxcap_319_done
+  rxcap_319_fail:
+    goto rx312_fail
+  rxcap_319_done:
+  # rx literal  ">"
+    add $I11, rx312_pos, 1
+    gt $I11, rx312_eos, rx312_fail
+    sub $I11, rx312_pos, rx312_off
+    substr $S10, rx312_tgt, $I11, 1
+    ne $S10, ">", rx312_fail
+    add rx312_pos, 1
+    goto alt316_end
+  alt316_1:
+.annotate "line", 110
+  # rx literal  "$"
+    add $I11, rx312_pos, 1
+    gt $I11, rx312_eos, rx312_fail
+    sub $I11, rx312_pos, rx312_off
+    substr $S10, rx312_tgt, $I11, 1
+    ne $S10, "$", rx312_fail
+    add rx312_pos, 1
+  # rx subcapture "pos"
+    set_addr $I10, rxcap_320_fail
+    rx312_cur."!mark_push"(0, rx312_pos, $I10)
+  # rx charclass_q d r 1..-1
+    sub $I10, rx312_pos, rx312_off
+    find_not_cclass $I11, 8, rx312_tgt, $I10, rx312_eos
+    add $I12, $I10, 1
+    lt $I11, $I12, rx312_fail
+    add rx312_pos, rx312_off, $I11
+    set_addr $I10, rxcap_320_fail
+    ($I12, $I11) = rx312_cur."!mark_peek"($I10)
+    rx312_cur."!cursor_pos"($I11)
+    ($P10) = rx312_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx312_pos, "")
+    rx312_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("pos")
+    goto rxcap_320_done
+  rxcap_320_fail:
+    goto rx312_fail
+  rxcap_320_done:
+  alt316_end:
+.annotate "line", 113
+  # rx rxquantr321 ** 0..1
+    set_addr $I322, rxquantr321_done
+    rx312_cur."!mark_push"(0, rx312_pos, $I322)
+  rxquantr321_loop:
+  # rx subrule "ws" subtype=method negate=
+    rx312_cur."!cursor_pos"(rx312_pos)
+    $P10 = rx312_cur."ws"()
+    unless $P10, rx312_fail
+    rx312_pos = $P10."pos"()
+  # rx literal  "="
+    add $I11, rx312_pos, 1
+    gt $I11, rx312_eos, rx312_fail
+    sub $I11, rx312_pos, rx312_off
+    substr $S10, rx312_tgt, $I11, 1
+    ne $S10, "=", rx312_fail
+    add rx312_pos, 1
+  # rx subrule "ws" subtype=method negate=
+    rx312_cur."!cursor_pos"(rx312_pos)
+    $P10 = rx312_cur."ws"()
+    unless $P10, rx312_fail
+    rx312_pos = $P10."pos"()
+  # rx subrule "quantified_atom" subtype=capture negate=
+    rx312_cur."!cursor_pos"(rx312_pos)
+    $P10 = rx312_cur."quantified_atom"()
+    unless $P10, rx312_fail
+    rx312_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("quantified_atom")
+    rx312_pos = $P10."pos"()
+    (rx312_rep) = rx312_cur."!mark_commit"($I322)
+  rxquantr321_done:
+.annotate "line", 107
+  # rx pass
+    rx312_cur."!cursor_pass"(rx312_pos, "metachar:sym<var>")
+    rx312_cur."!cursor_debug"("PASS  ", "metachar:sym<var>", " at pos=", rx312_pos)
+    .return (rx312_cur)
+  rx312_fail:
+.annotate "line", 3
+    (rx312_rep, rx312_pos, $I10, $P10) = rx312_cur."!mark_fail"(0)
+    lt rx312_pos, -1, rx312_done
+    eq rx312_pos, -1, rx312_fail
+    jump $I10
+  rx312_done:
+    rx312_cur."!cursor_fail"()
+    rx312_cur."!cursor_debug"("FAIL  ", "metachar:sym<var>")
+    .return (rx312_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__metachar:sym<var>"  :subid("88_1261064009.3328") :method
+.annotate "line", 3
+    new $P314, "ResizablePMCArray"
+    push $P314, "$"
+    push $P314, "$<"
+    .return ($P314)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "metachar:sym<PIR>"  :subid("89_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx324_tgt
+    .local int rx324_pos
+    .local int rx324_off
+    .local int rx324_eos
+    .local int rx324_rep
+    .local pmc rx324_cur
+    (rx324_cur, rx324_pos, rx324_tgt) = self."!cursor_start"()
+    rx324_cur."!cursor_debug"("START ", "metachar:sym<PIR>")
+    .lex unicode:"$\x{a2}", rx324_cur
+    .local pmc match
+    .lex "$/", match
+    length rx324_eos, rx324_tgt
+    set rx324_off, 0
+    lt rx324_pos, 2, rx324_start
+    sub rx324_off, rx324_pos, 1
+    substr rx324_tgt, rx324_tgt, rx324_off
+  rx324_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan327_done
+    goto rxscan327_scan
+  rxscan327_loop:
+    ($P10) = rx324_cur."from"()
+    inc $P10
+    set rx324_pos, $P10
+    ge rx324_pos, rx324_eos, rxscan327_done
+  rxscan327_scan:
+    set_addr $I10, rxscan327_loop
+    rx324_cur."!mark_push"(0, rx324_pos, $I10)
+  rxscan327_done:
+.annotate "line", 117
+  # rx literal  ":PIR{{"
+    add $I11, rx324_pos, 6
+    gt $I11, rx324_eos, rx324_fail
+    sub $I11, rx324_pos, rx324_off
+    substr $S10, rx324_tgt, $I11, 6
+    ne $S10, ":PIR{{", rx324_fail
+    add rx324_pos, 6
+  # rx subcapture "pir"
+    set_addr $I10, rxcap_330_fail
+    rx324_cur."!mark_push"(0, rx324_pos, $I10)
+  # rx rxquantf328 ** 0..*
+    set_addr $I10, rxquantf328_loop
+    rx324_cur."!mark_push"(0, rx324_pos, $I10)
+    goto rxquantf328_done
+  rxquantf328_loop:
+  # rx charclass .
+    ge rx324_pos, rx324_eos, rx324_fail
+    inc rx324_pos
+    set_addr $I10, rxquantf328_loop
+    rx324_cur."!mark_push"($I329, rx324_pos, $I10)
+  rxquantf328_done:
+    set_addr $I10, rxcap_330_fail
+    ($I12, $I11) = rx324_cur."!mark_peek"($I10)
+    rx324_cur."!cursor_pos"($I11)
+    ($P10) = rx324_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx324_pos, "")
+    rx324_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("pir")
+    goto rxcap_330_done
+  rxcap_330_fail:
+    goto rx324_fail
+  rxcap_330_done:
+  # rx literal  "}}"
+    add $I11, rx324_pos, 2
+    gt $I11, rx324_eos, rx324_fail
+    sub $I11, rx324_pos, rx324_off
+    substr $S10, rx324_tgt, $I11, 2
+    ne $S10, "}}", rx324_fail
+    add rx324_pos, 2
+.annotate "line", 116
+  # rx pass
+    rx324_cur."!cursor_pass"(rx324_pos, "metachar:sym<PIR>")
+    rx324_cur."!cursor_debug"("PASS  ", "metachar:sym<PIR>", " at pos=", rx324_pos)
+    .return (rx324_cur)
+  rx324_fail:
+.annotate "line", 3
+    (rx324_rep, rx324_pos, $I10, $P10) = rx324_cur."!mark_fail"(0)
+    lt rx324_pos, -1, rx324_done
+    eq rx324_pos, -1, rx324_fail
+    jump $I10
+  rx324_done:
+    rx324_cur."!cursor_fail"()
+    rx324_cur."!cursor_debug"("FAIL  ", "metachar:sym<PIR>")
+    .return (rx324_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__metachar:sym<PIR>"  :subid("90_1261064009.3328") :method
+.annotate "line", 3
+    new $P326, "ResizablePMCArray"
+    push $P326, ":PIR{{"
+    .return ($P326)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "backslash"  :subid("91_1261064009.3328") :method
+.annotate "line", 120
+    $P332 = self."!protoregex"("backslash")
+    .return ($P332)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__backslash"  :subid("92_1261064009.3328") :method
+.annotate "line", 120
+    $P334 = self."!PREFIX__!protoregex"("backslash")
+    .return ($P334)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "backslash:sym<w>"  :subid("93_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx336_tgt
+    .local int rx336_pos
+    .local int rx336_off
+    .local int rx336_eos
+    .local int rx336_rep
+    .local pmc rx336_cur
+    (rx336_cur, rx336_pos, rx336_tgt) = self."!cursor_start"()
+    rx336_cur."!cursor_debug"("START ", "backslash:sym<w>")
+    .lex unicode:"$\x{a2}", rx336_cur
+    .local pmc match
+    .lex "$/", match
+    length rx336_eos, rx336_tgt
+    set rx336_off, 0
+    lt rx336_pos, 2, rx336_start
+    sub rx336_off, rx336_pos, 1
+    substr rx336_tgt, rx336_tgt, rx336_off
+  rx336_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan339_done
+    goto rxscan339_scan
+  rxscan339_loop:
+    ($P10) = rx336_cur."from"()
+    inc $P10
+    set rx336_pos, $P10
+    ge rx336_pos, rx336_eos, rxscan339_done
+  rxscan339_scan:
+    set_addr $I10, rxscan339_loop
+    rx336_cur."!mark_push"(0, rx336_pos, $I10)
+  rxscan339_done:
+.annotate "line", 121
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_340_fail
+    rx336_cur."!mark_push"(0, rx336_pos, $I10)
+  # rx enumcharlist negate=0 
+    ge rx336_pos, rx336_eos, rx336_fail
+    sub $I10, rx336_pos, rx336_off
+    substr $S10, rx336_tgt, $I10, 1
+    index $I11, "dswnDSWN", $S10
+    lt $I11, 0, rx336_fail
+    inc rx336_pos
+    set_addr $I10, rxcap_340_fail
+    ($I12, $I11) = rx336_cur."!mark_peek"($I10)
+    rx336_cur."!cursor_pos"($I11)
+    ($P10) = rx336_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx336_pos, "")
+    rx336_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_340_done
+  rxcap_340_fail:
+    goto rx336_fail
+  rxcap_340_done:
+  # rx pass
+    rx336_cur."!cursor_pass"(rx336_pos, "backslash:sym<w>")
+    rx336_cur."!cursor_debug"("PASS  ", "backslash:sym<w>", " at pos=", rx336_pos)
+    .return (rx336_cur)
+  rx336_fail:
+.annotate "line", 3
+    (rx336_rep, rx336_pos, $I10, $P10) = rx336_cur."!mark_fail"(0)
+    lt rx336_pos, -1, rx336_done
+    eq rx336_pos, -1, rx336_fail
+    jump $I10
+  rx336_done:
+    rx336_cur."!cursor_fail"()
+    rx336_cur."!cursor_debug"("FAIL  ", "backslash:sym<w>")
+    .return (rx336_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__backslash:sym<w>"  :subid("94_1261064009.3328") :method
+.annotate "line", 3
+    new $P338, "ResizablePMCArray"
+    push $P338, "N"
+    push $P338, "W"
+    push $P338, "S"
+    push $P338, "D"
+    push $P338, "n"
+    push $P338, "w"
+    push $P338, "s"
+    push $P338, "d"
+    .return ($P338)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "backslash:sym<b>"  :subid("95_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx342_tgt
+    .local int rx342_pos
+    .local int rx342_off
+    .local int rx342_eos
+    .local int rx342_rep
+    .local pmc rx342_cur
+    (rx342_cur, rx342_pos, rx342_tgt) = self."!cursor_start"()
+    rx342_cur."!cursor_debug"("START ", "backslash:sym<b>")
+    .lex unicode:"$\x{a2}", rx342_cur
+    .local pmc match
+    .lex "$/", match
+    length rx342_eos, rx342_tgt
+    set rx342_off, 0
+    lt rx342_pos, 2, rx342_start
+    sub rx342_off, rx342_pos, 1
+    substr rx342_tgt, rx342_tgt, rx342_off
+  rx342_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan345_done
+    goto rxscan345_scan
+  rxscan345_loop:
+    ($P10) = rx342_cur."from"()
+    inc $P10
+    set rx342_pos, $P10
+    ge rx342_pos, rx342_eos, rxscan345_done
+  rxscan345_scan:
+    set_addr $I10, rxscan345_loop
+    rx342_cur."!mark_push"(0, rx342_pos, $I10)
+  rxscan345_done:
+.annotate "line", 122
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_346_fail
+    rx342_cur."!mark_push"(0, rx342_pos, $I10)
+  # rx enumcharlist negate=0 
+    ge rx342_pos, rx342_eos, rx342_fail
+    sub $I10, rx342_pos, rx342_off
+    substr $S10, rx342_tgt, $I10, 1
+    index $I11, "bB", $S10
+    lt $I11, 0, rx342_fail
+    inc rx342_pos
+    set_addr $I10, rxcap_346_fail
+    ($I12, $I11) = rx342_cur."!mark_peek"($I10)
+    rx342_cur."!cursor_pos"($I11)
+    ($P10) = rx342_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx342_pos, "")
+    rx342_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_346_done
+  rxcap_346_fail:
+    goto rx342_fail
+  rxcap_346_done:
+  # rx pass
+    rx342_cur."!cursor_pass"(rx342_pos, "backslash:sym<b>")
+    rx342_cur."!cursor_debug"("PASS  ", "backslash:sym<b>", " at pos=", rx342_pos)
+    .return (rx342_cur)
+  rx342_fail:
+.annotate "line", 3
+    (rx342_rep, rx342_pos, $I10, $P10) = rx342_cur."!mark_fail"(0)
+    lt rx342_pos, -1, rx342_done
+    eq rx342_pos, -1, rx342_fail
+    jump $I10
+  rx342_done:
+    rx342_cur."!cursor_fail"()
+    rx342_cur."!cursor_debug"("FAIL  ", "backslash:sym<b>")
+    .return (rx342_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__backslash:sym<b>"  :subid("96_1261064009.3328") :method
+.annotate "line", 3
+    new $P344, "ResizablePMCArray"
+    push $P344, "B"
+    push $P344, "b"
+    .return ($P344)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "backslash:sym<e>"  :subid("97_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx348_tgt
+    .local int rx348_pos
+    .local int rx348_off
+    .local int rx348_eos
+    .local int rx348_rep
+    .local pmc rx348_cur
+    (rx348_cur, rx348_pos, rx348_tgt) = self."!cursor_start"()
+    rx348_cur."!cursor_debug"("START ", "backslash:sym<e>")
+    .lex unicode:"$\x{a2}", rx348_cur
+    .local pmc match
+    .lex "$/", match
+    length rx348_eos, rx348_tgt
+    set rx348_off, 0
+    lt rx348_pos, 2, rx348_start
+    sub rx348_off, rx348_pos, 1
+    substr rx348_tgt, rx348_tgt, rx348_off
+  rx348_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan351_done
+    goto rxscan351_scan
+  rxscan351_loop:
+    ($P10) = rx348_cur."from"()
+    inc $P10
+    set rx348_pos, $P10
+    ge rx348_pos, rx348_eos, rxscan351_done
+  rxscan351_scan:
+    set_addr $I10, rxscan351_loop
+    rx348_cur."!mark_push"(0, rx348_pos, $I10)
+  rxscan351_done:
+.annotate "line", 123
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_352_fail
+    rx348_cur."!mark_push"(0, rx348_pos, $I10)
+  # rx enumcharlist negate=0 
+    ge rx348_pos, rx348_eos, rx348_fail
+    sub $I10, rx348_pos, rx348_off
+    substr $S10, rx348_tgt, $I10, 1
+    index $I11, "eE", $S10
+    lt $I11, 0, rx348_fail
+    inc rx348_pos
+    set_addr $I10, rxcap_352_fail
+    ($I12, $I11) = rx348_cur."!mark_peek"($I10)
+    rx348_cur."!cursor_pos"($I11)
+    ($P10) = rx348_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx348_pos, "")
+    rx348_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_352_done
+  rxcap_352_fail:
+    goto rx348_fail
+  rxcap_352_done:
+  # rx pass
+    rx348_cur."!cursor_pass"(rx348_pos, "backslash:sym<e>")
+    rx348_cur."!cursor_debug"("PASS  ", "backslash:sym<e>", " at pos=", rx348_pos)
+    .return (rx348_cur)
+  rx348_fail:
+.annotate "line", 3
+    (rx348_rep, rx348_pos, $I10, $P10) = rx348_cur."!mark_fail"(0)
+    lt rx348_pos, -1, rx348_done
+    eq rx348_pos, -1, rx348_fail
+    jump $I10
+  rx348_done:
+    rx348_cur."!cursor_fail"()
+    rx348_cur."!cursor_debug"("FAIL  ", "backslash:sym<e>")
+    .return (rx348_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__backslash:sym<e>"  :subid("98_1261064009.3328") :method
+.annotate "line", 3
+    new $P350, "ResizablePMCArray"
+    push $P350, "E"
+    push $P350, "e"
+    .return ($P350)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "backslash:sym<f>"  :subid("99_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx354_tgt
+    .local int rx354_pos
+    .local int rx354_off
+    .local int rx354_eos
+    .local int rx354_rep
+    .local pmc rx354_cur
+    (rx354_cur, rx354_pos, rx354_tgt) = self."!cursor_start"()
+    rx354_cur."!cursor_debug"("START ", "backslash:sym<f>")
+    .lex unicode:"$\x{a2}", rx354_cur
+    .local pmc match
+    .lex "$/", match
+    length rx354_eos, rx354_tgt
+    set rx354_off, 0
+    lt rx354_pos, 2, rx354_start
+    sub rx354_off, rx354_pos, 1
+    substr rx354_tgt, rx354_tgt, rx354_off
+  rx354_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan357_done
+    goto rxscan357_scan
+  rxscan357_loop:
+    ($P10) = rx354_cur."from"()
+    inc $P10
+    set rx354_pos, $P10
+    ge rx354_pos, rx354_eos, rxscan357_done
+  rxscan357_scan:
+    set_addr $I10, rxscan357_loop
+    rx354_cur."!mark_push"(0, rx354_pos, $I10)
+  rxscan357_done:
+.annotate "line", 124
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_358_fail
+    rx354_cur."!mark_push"(0, rx354_pos, $I10)
+  # rx enumcharlist negate=0 
+    ge rx354_pos, rx354_eos, rx354_fail
+    sub $I10, rx354_pos, rx354_off
+    substr $S10, rx354_tgt, $I10, 1
+    index $I11, "fF", $S10
+    lt $I11, 0, rx354_fail
+    inc rx354_pos
+    set_addr $I10, rxcap_358_fail
+    ($I12, $I11) = rx354_cur."!mark_peek"($I10)
+    rx354_cur."!cursor_pos"($I11)
+    ($P10) = rx354_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx354_pos, "")
+    rx354_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_358_done
+  rxcap_358_fail:
+    goto rx354_fail
+  rxcap_358_done:
+  # rx pass
+    rx354_cur."!cursor_pass"(rx354_pos, "backslash:sym<f>")
+    rx354_cur."!cursor_debug"("PASS  ", "backslash:sym<f>", " at pos=", rx354_pos)
+    .return (rx354_cur)
+  rx354_fail:
+.annotate "line", 3
+    (rx354_rep, rx354_pos, $I10, $P10) = rx354_cur."!mark_fail"(0)
+    lt rx354_pos, -1, rx354_done
+    eq rx354_pos, -1, rx354_fail
+    jump $I10
+  rx354_done:
+    rx354_cur."!cursor_fail"()
+    rx354_cur."!cursor_debug"("FAIL  ", "backslash:sym<f>")
+    .return (rx354_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__backslash:sym<f>"  :subid("100_1261064009.3328") :method
+.annotate "line", 3
+    new $P356, "ResizablePMCArray"
+    push $P356, "F"
+    push $P356, "f"
+    .return ($P356)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "backslash:sym<h>"  :subid("101_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx360_tgt
+    .local int rx360_pos
+    .local int rx360_off
+    .local int rx360_eos
+    .local int rx360_rep
+    .local pmc rx360_cur
+    (rx360_cur, rx360_pos, rx360_tgt) = self."!cursor_start"()
+    rx360_cur."!cursor_debug"("START ", "backslash:sym<h>")
+    .lex unicode:"$\x{a2}", rx360_cur
+    .local pmc match
+    .lex "$/", match
+    length rx360_eos, rx360_tgt
+    set rx360_off, 0
+    lt rx360_pos, 2, rx360_start
+    sub rx360_off, rx360_pos, 1
+    substr rx360_tgt, rx360_tgt, rx360_off
+  rx360_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan363_done
+    goto rxscan363_scan
+  rxscan363_loop:
+    ($P10) = rx360_cur."from"()
+    inc $P10
+    set rx360_pos, $P10
+    ge rx360_pos, rx360_eos, rxscan363_done
+  rxscan363_scan:
+    set_addr $I10, rxscan363_loop
+    rx360_cur."!mark_push"(0, rx360_pos, $I10)
+  rxscan363_done:
+.annotate "line", 125
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_364_fail
+    rx360_cur."!mark_push"(0, rx360_pos, $I10)
+  # rx enumcharlist negate=0 
+    ge rx360_pos, rx360_eos, rx360_fail
+    sub $I10, rx360_pos, rx360_off
+    substr $S10, rx360_tgt, $I10, 1
+    index $I11, "hH", $S10
+    lt $I11, 0, rx360_fail
+    inc rx360_pos
+    set_addr $I10, rxcap_364_fail
+    ($I12, $I11) = rx360_cur."!mark_peek"($I10)
+    rx360_cur."!cursor_pos"($I11)
+    ($P10) = rx360_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx360_pos, "")
+    rx360_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_364_done
+  rxcap_364_fail:
+    goto rx360_fail
+  rxcap_364_done:
+  # rx pass
+    rx360_cur."!cursor_pass"(rx360_pos, "backslash:sym<h>")
+    rx360_cur."!cursor_debug"("PASS  ", "backslash:sym<h>", " at pos=", rx360_pos)
+    .return (rx360_cur)
+  rx360_fail:
+.annotate "line", 3
+    (rx360_rep, rx360_pos, $I10, $P10) = rx360_cur."!mark_fail"(0)
+    lt rx360_pos, -1, rx360_done
+    eq rx360_pos, -1, rx360_fail
+    jump $I10
+  rx360_done:
+    rx360_cur."!cursor_fail"()
+    rx360_cur."!cursor_debug"("FAIL  ", "backslash:sym<h>")
+    .return (rx360_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__backslash:sym<h>"  :subid("102_1261064009.3328") :method
+.annotate "line", 3
+    new $P362, "ResizablePMCArray"
+    push $P362, "H"
+    push $P362, "h"
+    .return ($P362)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "backslash:sym<r>"  :subid("103_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx366_tgt
+    .local int rx366_pos
+    .local int rx366_off
+    .local int rx366_eos
+    .local int rx366_rep
+    .local pmc rx366_cur
+    (rx366_cur, rx366_pos, rx366_tgt) = self."!cursor_start"()
+    rx366_cur."!cursor_debug"("START ", "backslash:sym<r>")
+    .lex unicode:"$\x{a2}", rx366_cur
+    .local pmc match
+    .lex "$/", match
+    length rx366_eos, rx366_tgt
+    set rx366_off, 0
+    lt rx366_pos, 2, rx366_start
+    sub rx366_off, rx366_pos, 1
+    substr rx366_tgt, rx366_tgt, rx366_off
+  rx366_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan369_done
+    goto rxscan369_scan
+  rxscan369_loop:
+    ($P10) = rx366_cur."from"()
+    inc $P10
+    set rx366_pos, $P10
+    ge rx366_pos, rx366_eos, rxscan369_done
+  rxscan369_scan:
+    set_addr $I10, rxscan369_loop
+    rx366_cur."!mark_push"(0, rx366_pos, $I10)
+  rxscan369_done:
+.annotate "line", 126
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_370_fail
+    rx366_cur."!mark_push"(0, rx366_pos, $I10)
+  # rx enumcharlist negate=0 
+    ge rx366_pos, rx366_eos, rx366_fail
+    sub $I10, rx366_pos, rx366_off
+    substr $S10, rx366_tgt, $I10, 1
+    index $I11, "rR", $S10
+    lt $I11, 0, rx366_fail
+    inc rx366_pos
+    set_addr $I10, rxcap_370_fail
+    ($I12, $I11) = rx366_cur."!mark_peek"($I10)
+    rx366_cur."!cursor_pos"($I11)
+    ($P10) = rx366_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx366_pos, "")
+    rx366_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_370_done
+  rxcap_370_fail:
+    goto rx366_fail
+  rxcap_370_done:
+  # rx pass
+    rx366_cur."!cursor_pass"(rx366_pos, "backslash:sym<r>")
+    rx366_cur."!cursor_debug"("PASS  ", "backslash:sym<r>", " at pos=", rx366_pos)
+    .return (rx366_cur)
+  rx366_fail:
+.annotate "line", 3
+    (rx366_rep, rx366_pos, $I10, $P10) = rx366_cur."!mark_fail"(0)
+    lt rx366_pos, -1, rx366_done
+    eq rx366_pos, -1, rx366_fail
+    jump $I10
+  rx366_done:
+    rx366_cur."!cursor_fail"()
+    rx366_cur."!cursor_debug"("FAIL  ", "backslash:sym<r>")
+    .return (rx366_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__backslash:sym<r>"  :subid("104_1261064009.3328") :method
+.annotate "line", 3
+    new $P368, "ResizablePMCArray"
+    push $P368, "R"
+    push $P368, "r"
+    .return ($P368)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "backslash:sym<t>"  :subid("105_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx372_tgt
+    .local int rx372_pos
+    .local int rx372_off
+    .local int rx372_eos
+    .local int rx372_rep
+    .local pmc rx372_cur
+    (rx372_cur, rx372_pos, rx372_tgt) = self."!cursor_start"()
+    rx372_cur."!cursor_debug"("START ", "backslash:sym<t>")
+    .lex unicode:"$\x{a2}", rx372_cur
+    .local pmc match
+    .lex "$/", match
+    length rx372_eos, rx372_tgt
+    set rx372_off, 0
+    lt rx372_pos, 2, rx372_start
+    sub rx372_off, rx372_pos, 1
+    substr rx372_tgt, rx372_tgt, rx372_off
+  rx372_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan375_done
+    goto rxscan375_scan
+  rxscan375_loop:
+    ($P10) = rx372_cur."from"()
+    inc $P10
+    set rx372_pos, $P10
+    ge rx372_pos, rx372_eos, rxscan375_done
+  rxscan375_scan:
+    set_addr $I10, rxscan375_loop
+    rx372_cur."!mark_push"(0, rx372_pos, $I10)
+  rxscan375_done:
+.annotate "line", 127
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_376_fail
+    rx372_cur."!mark_push"(0, rx372_pos, $I10)
+  # rx enumcharlist negate=0 
+    ge rx372_pos, rx372_eos, rx372_fail
+    sub $I10, rx372_pos, rx372_off
+    substr $S10, rx372_tgt, $I10, 1
+    index $I11, "tT", $S10
+    lt $I11, 0, rx372_fail
+    inc rx372_pos
+    set_addr $I10, rxcap_376_fail
+    ($I12, $I11) = rx372_cur."!mark_peek"($I10)
+    rx372_cur."!cursor_pos"($I11)
+    ($P10) = rx372_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx372_pos, "")
+    rx372_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_376_done
+  rxcap_376_fail:
+    goto rx372_fail
+  rxcap_376_done:
+  # rx pass
+    rx372_cur."!cursor_pass"(rx372_pos, "backslash:sym<t>")
+    rx372_cur."!cursor_debug"("PASS  ", "backslash:sym<t>", " at pos=", rx372_pos)
+    .return (rx372_cur)
+  rx372_fail:
+.annotate "line", 3
+    (rx372_rep, rx372_pos, $I10, $P10) = rx372_cur."!mark_fail"(0)
+    lt rx372_pos, -1, rx372_done
+    eq rx372_pos, -1, rx372_fail
+    jump $I10
+  rx372_done:
+    rx372_cur."!cursor_fail"()
+    rx372_cur."!cursor_debug"("FAIL  ", "backslash:sym<t>")
+    .return (rx372_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__backslash:sym<t>"  :subid("106_1261064009.3328") :method
+.annotate "line", 3
+    new $P374, "ResizablePMCArray"
+    push $P374, "T"
+    push $P374, "t"
+    .return ($P374)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "backslash:sym<v>"  :subid("107_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx378_tgt
+    .local int rx378_pos
+    .local int rx378_off
+    .local int rx378_eos
+    .local int rx378_rep
+    .local pmc rx378_cur
+    (rx378_cur, rx378_pos, rx378_tgt) = self."!cursor_start"()
+    rx378_cur."!cursor_debug"("START ", "backslash:sym<v>")
+    .lex unicode:"$\x{a2}", rx378_cur
+    .local pmc match
+    .lex "$/", match
+    length rx378_eos, rx378_tgt
+    set rx378_off, 0
+    lt rx378_pos, 2, rx378_start
+    sub rx378_off, rx378_pos, 1
+    substr rx378_tgt, rx378_tgt, rx378_off
+  rx378_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan381_done
+    goto rxscan381_scan
+  rxscan381_loop:
+    ($P10) = rx378_cur."from"()
+    inc $P10
+    set rx378_pos, $P10
+    ge rx378_pos, rx378_eos, rxscan381_done
+  rxscan381_scan:
+    set_addr $I10, rxscan381_loop
+    rx378_cur."!mark_push"(0, rx378_pos, $I10)
+  rxscan381_done:
+.annotate "line", 128
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_382_fail
+    rx378_cur."!mark_push"(0, rx378_pos, $I10)
+  # rx enumcharlist negate=0 
+    ge rx378_pos, rx378_eos, rx378_fail
+    sub $I10, rx378_pos, rx378_off
+    substr $S10, rx378_tgt, $I10, 1
+    index $I11, "vV", $S10
+    lt $I11, 0, rx378_fail
+    inc rx378_pos
+    set_addr $I10, rxcap_382_fail
+    ($I12, $I11) = rx378_cur."!mark_peek"($I10)
+    rx378_cur."!cursor_pos"($I11)
+    ($P10) = rx378_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx378_pos, "")
+    rx378_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_382_done
+  rxcap_382_fail:
+    goto rx378_fail
+  rxcap_382_done:
+  # rx pass
+    rx378_cur."!cursor_pass"(rx378_pos, "backslash:sym<v>")
+    rx378_cur."!cursor_debug"("PASS  ", "backslash:sym<v>", " at pos=", rx378_pos)
+    .return (rx378_cur)
+  rx378_fail:
+.annotate "line", 3
+    (rx378_rep, rx378_pos, $I10, $P10) = rx378_cur."!mark_fail"(0)
+    lt rx378_pos, -1, rx378_done
+    eq rx378_pos, -1, rx378_fail
+    jump $I10
+  rx378_done:
+    rx378_cur."!cursor_fail"()
+    rx378_cur."!cursor_debug"("FAIL  ", "backslash:sym<v>")
+    .return (rx378_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__backslash:sym<v>"  :subid("108_1261064009.3328") :method
+.annotate "line", 3
+    new $P380, "ResizablePMCArray"
+    push $P380, "V"
+    push $P380, "v"
+    .return ($P380)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "backslash:sym<c>"  :subid("109_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx384_tgt
+    .local int rx384_pos
+    .local int rx384_off
+    .local int rx384_eos
+    .local int rx384_rep
+    .local pmc rx384_cur
+    (rx384_cur, rx384_pos, rx384_tgt) = self."!cursor_start"()
+    rx384_cur."!cursor_debug"("START ", "backslash:sym<c>")
+    .lex unicode:"$\x{a2}", rx384_cur
+    .local pmc match
+    .lex "$/", match
+    length rx384_eos, rx384_tgt
+    set rx384_off, 0
+    lt rx384_pos, 2, rx384_start
+    sub rx384_off, rx384_pos, 1
+    substr rx384_tgt, rx384_tgt, rx384_off
+  rx384_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan389_done
+    goto rxscan389_scan
+  rxscan389_loop:
+    ($P10) = rx384_cur."from"()
+    inc $P10
+    set rx384_pos, $P10
+    ge rx384_pos, rx384_eos, rxscan389_done
+  rxscan389_scan:
+    set_addr $I10, rxscan389_loop
+    rx384_cur."!mark_push"(0, rx384_pos, $I10)
+  rxscan389_done:
+.annotate "line", 129
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_390_fail
+    rx384_cur."!mark_push"(0, rx384_pos, $I10)
+  # rx enumcharlist negate=0 
+    ge rx384_pos, rx384_eos, rx384_fail
+    sub $I10, rx384_pos, rx384_off
+    substr $S10, rx384_tgt, $I10, 1
+    index $I11, "cC", $S10
+    lt $I11, 0, rx384_fail
+    inc rx384_pos
+    set_addr $I10, rxcap_390_fail
+    ($I12, $I11) = rx384_cur."!mark_peek"($I10)
+    rx384_cur."!cursor_pos"($I11)
+    ($P10) = rx384_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx384_pos, "")
+    rx384_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_390_done
+  rxcap_390_fail:
+    goto rx384_fail
+  rxcap_390_done:
+  # rx subrule "charspec" subtype=capture negate=
+    rx384_cur."!cursor_pos"(rx384_pos)
+    $P10 = rx384_cur."charspec"()
+    unless $P10, rx384_fail
+    rx384_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("charspec")
+    rx384_pos = $P10."pos"()
+  # rx pass
+    rx384_cur."!cursor_pass"(rx384_pos, "backslash:sym<c>")
+    rx384_cur."!cursor_debug"("PASS  ", "backslash:sym<c>", " at pos=", rx384_pos)
+    .return (rx384_cur)
+  rx384_fail:
+.annotate "line", 3
+    (rx384_rep, rx384_pos, $I10, $P10) = rx384_cur."!mark_fail"(0)
+    lt rx384_pos, -1, rx384_done
+    eq rx384_pos, -1, rx384_fail
+    jump $I10
+  rx384_done:
+    rx384_cur."!cursor_fail"()
+    rx384_cur."!cursor_debug"("FAIL  ", "backslash:sym<c>")
+    .return (rx384_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__backslash:sym<c>"  :subid("110_1261064009.3328") :method
+.annotate "line", 3
+    $P386 = self."!PREFIX__!subrule"("charspec", "C")
+    $P387 = self."!PREFIX__!subrule"("charspec", "c")
+    new $P388, "ResizablePMCArray"
+    push $P388, $P386
+    push $P388, $P387
+    .return ($P388)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "backslash:sym<o>"  :subid("111_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx392_tgt
+    .local int rx392_pos
+    .local int rx392_off
+    .local int rx392_eos
+    .local int rx392_rep
+    .local pmc rx392_cur
+    (rx392_cur, rx392_pos, rx392_tgt) = self."!cursor_start"()
+    rx392_cur."!cursor_debug"("START ", "backslash:sym<o>")
+    .lex unicode:"$\x{a2}", rx392_cur
+    .local pmc match
+    .lex "$/", match
+    length rx392_eos, rx392_tgt
+    set rx392_off, 0
+    lt rx392_pos, 2, rx392_start
+    sub rx392_off, rx392_pos, 1
+    substr rx392_tgt, rx392_tgt, rx392_off
+  rx392_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan399_done
+    goto rxscan399_scan
+  rxscan399_loop:
+    ($P10) = rx392_cur."from"()
+    inc $P10
+    set rx392_pos, $P10
+    ge rx392_pos, rx392_eos, rxscan399_done
+  rxscan399_scan:
+    set_addr $I10, rxscan399_loop
+    rx392_cur."!mark_push"(0, rx392_pos, $I10)
+  rxscan399_done:
+.annotate "line", 130
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_400_fail
+    rx392_cur."!mark_push"(0, rx392_pos, $I10)
+  # rx enumcharlist negate=0 
+    ge rx392_pos, rx392_eos, rx392_fail
+    sub $I10, rx392_pos, rx392_off
+    substr $S10, rx392_tgt, $I10, 1
+    index $I11, "oO", $S10
+    lt $I11, 0, rx392_fail
+    inc rx392_pos
+    set_addr $I10, rxcap_400_fail
+    ($I12, $I11) = rx392_cur."!mark_peek"($I10)
+    rx392_cur."!cursor_pos"($I11)
+    ($P10) = rx392_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx392_pos, "")
+    rx392_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_400_done
+  rxcap_400_fail:
+    goto rx392_fail
+  rxcap_400_done:
+  alt401_0:
+    set_addr $I10, alt401_1
+    rx392_cur."!mark_push"(0, rx392_pos, $I10)
+  # rx subrule "octint" subtype=capture negate=
+    rx392_cur."!cursor_pos"(rx392_pos)
+    $P10 = rx392_cur."octint"()
+    unless $P10, rx392_fail
+    rx392_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("octint")
+    rx392_pos = $P10."pos"()
+    goto alt401_end
+  alt401_1:
+  # rx literal  "["
+    add $I11, rx392_pos, 1
+    gt $I11, rx392_eos, rx392_fail
+    sub $I11, rx392_pos, rx392_off
+    substr $S10, rx392_tgt, $I11, 1
+    ne $S10, "[", rx392_fail
+    add rx392_pos, 1
+  # rx subrule "octints" subtype=capture negate=
+    rx392_cur."!cursor_pos"(rx392_pos)
+    $P10 = rx392_cur."octints"()
+    unless $P10, rx392_fail
+    rx392_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("octints")
+    rx392_pos = $P10."pos"()
+  # rx literal  "]"
+    add $I11, rx392_pos, 1
+    gt $I11, rx392_eos, rx392_fail
+    sub $I11, rx392_pos, rx392_off
+    substr $S10, rx392_tgt, $I11, 1
+    ne $S10, "]", rx392_fail
+    add rx392_pos, 1
+  alt401_end:
+  # rx pass
+    rx392_cur."!cursor_pass"(rx392_pos, "backslash:sym<o>")
+    rx392_cur."!cursor_debug"("PASS  ", "backslash:sym<o>", " at pos=", rx392_pos)
+    .return (rx392_cur)
+  rx392_fail:
+.annotate "line", 3
+    (rx392_rep, rx392_pos, $I10, $P10) = rx392_cur."!mark_fail"(0)
+    lt rx392_pos, -1, rx392_done
+    eq rx392_pos, -1, rx392_fail
+    jump $I10
+  rx392_done:
+    rx392_cur."!cursor_fail"()
+    rx392_cur."!cursor_debug"("FAIL  ", "backslash:sym<o>")
+    .return (rx392_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__backslash:sym<o>"  :subid("112_1261064009.3328") :method
+.annotate "line", 3
+    $P394 = self."!PREFIX__!subrule"("octints", "O[")
+    $P395 = self."!PREFIX__!subrule"("octint", "O")
+    $P396 = self."!PREFIX__!subrule"("octints", "o[")
+    $P397 = self."!PREFIX__!subrule"("octint", "o")
+    new $P398, "ResizablePMCArray"
+    push $P398, $P394
+    push $P398, $P395
+    push $P398, $P396
+    push $P398, $P397
+    .return ($P398)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "backslash:sym<x>"  :subid("113_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx403_tgt
+    .local int rx403_pos
+    .local int rx403_off
+    .local int rx403_eos
+    .local int rx403_rep
+    .local pmc rx403_cur
+    (rx403_cur, rx403_pos, rx403_tgt) = self."!cursor_start"()
+    rx403_cur."!cursor_debug"("START ", "backslash:sym<x>")
+    .lex unicode:"$\x{a2}", rx403_cur
+    .local pmc match
+    .lex "$/", match
+    length rx403_eos, rx403_tgt
+    set rx403_off, 0
+    lt rx403_pos, 2, rx403_start
+    sub rx403_off, rx403_pos, 1
+    substr rx403_tgt, rx403_tgt, rx403_off
+  rx403_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan410_done
+    goto rxscan410_scan
+  rxscan410_loop:
+    ($P10) = rx403_cur."from"()
+    inc $P10
+    set rx403_pos, $P10
+    ge rx403_pos, rx403_eos, rxscan410_done
+  rxscan410_scan:
+    set_addr $I10, rxscan410_loop
+    rx403_cur."!mark_push"(0, rx403_pos, $I10)
+  rxscan410_done:
+.annotate "line", 131
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_411_fail
+    rx403_cur."!mark_push"(0, rx403_pos, $I10)
+  # rx enumcharlist negate=0 
+    ge rx403_pos, rx403_eos, rx403_fail
+    sub $I10, rx403_pos, rx403_off
+    substr $S10, rx403_tgt, $I10, 1
+    index $I11, "xX", $S10
+    lt $I11, 0, rx403_fail
+    inc rx403_pos
+    set_addr $I10, rxcap_411_fail
+    ($I12, $I11) = rx403_cur."!mark_peek"($I10)
+    rx403_cur."!cursor_pos"($I11)
+    ($P10) = rx403_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx403_pos, "")
+    rx403_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_411_done
+  rxcap_411_fail:
+    goto rx403_fail
+  rxcap_411_done:
+  alt412_0:
+    set_addr $I10, alt412_1
+    rx403_cur."!mark_push"(0, rx403_pos, $I10)
+  # rx subrule "hexint" subtype=capture negate=
+    rx403_cur."!cursor_pos"(rx403_pos)
+    $P10 = rx403_cur."hexint"()
+    unless $P10, rx403_fail
+    rx403_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("hexint")
+    rx403_pos = $P10."pos"()
+    goto alt412_end
+  alt412_1:
+  # rx literal  "["
+    add $I11, rx403_pos, 1
+    gt $I11, rx403_eos, rx403_fail
+    sub $I11, rx403_pos, rx403_off
+    substr $S10, rx403_tgt, $I11, 1
+    ne $S10, "[", rx403_fail
+    add rx403_pos, 1
+  # rx subrule "hexints" subtype=capture negate=
+    rx403_cur."!cursor_pos"(rx403_pos)
+    $P10 = rx403_cur."hexints"()
+    unless $P10, rx403_fail
+    rx403_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("hexints")
+    rx403_pos = $P10."pos"()
+  # rx literal  "]"
+    add $I11, rx403_pos, 1
+    gt $I11, rx403_eos, rx403_fail
+    sub $I11, rx403_pos, rx403_off
+    substr $S10, rx403_tgt, $I11, 1
+    ne $S10, "]", rx403_fail
+    add rx403_pos, 1
+  alt412_end:
+  # rx pass
+    rx403_cur."!cursor_pass"(rx403_pos, "backslash:sym<x>")
+    rx403_cur."!cursor_debug"("PASS  ", "backslash:sym<x>", " at pos=", rx403_pos)
+    .return (rx403_cur)
+  rx403_fail:
+.annotate "line", 3
+    (rx403_rep, rx403_pos, $I10, $P10) = rx403_cur."!mark_fail"(0)
+    lt rx403_pos, -1, rx403_done
+    eq rx403_pos, -1, rx403_fail
+    jump $I10
+  rx403_done:
+    rx403_cur."!cursor_fail"()
+    rx403_cur."!cursor_debug"("FAIL  ", "backslash:sym<x>")
+    .return (rx403_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__backslash:sym<x>"  :subid("114_1261064009.3328") :method
+.annotate "line", 3
+    $P405 = self."!PREFIX__!subrule"("hexints", "X[")
+    $P406 = self."!PREFIX__!subrule"("hexint", "X")
+    $P407 = self."!PREFIX__!subrule"("hexints", "x[")
+    $P408 = self."!PREFIX__!subrule"("hexint", "x")
+    new $P409, "ResizablePMCArray"
+    push $P409, $P405
+    push $P409, $P406
+    push $P409, $P407
+    push $P409, $P408
+    .return ($P409)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "backslash:sym<A>"  :subid("115_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx414_tgt
+    .local int rx414_pos
+    .local int rx414_off
+    .local int rx414_eos
+    .local int rx414_rep
+    .local pmc rx414_cur
+    (rx414_cur, rx414_pos, rx414_tgt) = self."!cursor_start"()
+    rx414_cur."!cursor_debug"("START ", "backslash:sym<A>")
+    .lex unicode:"$\x{a2}", rx414_cur
+    .local pmc match
+    .lex "$/", match
+    length rx414_eos, rx414_tgt
+    set rx414_off, 0
+    lt rx414_pos, 2, rx414_start
+    sub rx414_off, rx414_pos, 1
+    substr rx414_tgt, rx414_tgt, rx414_off
+  rx414_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan418_done
+    goto rxscan418_scan
+  rxscan418_loop:
+    ($P10) = rx414_cur."from"()
+    inc $P10
+    set rx414_pos, $P10
+    ge rx414_pos, rx414_eos, rxscan418_done
+  rxscan418_scan:
+    set_addr $I10, rxscan418_loop
+    rx414_cur."!mark_push"(0, rx414_pos, $I10)
+  rxscan418_done:
+.annotate "line", 132
+  # rx literal  "A"
+    add $I11, rx414_pos, 1
+    gt $I11, rx414_eos, rx414_fail
+    sub $I11, rx414_pos, rx414_off
+    substr $S10, rx414_tgt, $I11, 1
+    ne $S10, "A", rx414_fail
+    add rx414_pos, 1
+  # rx subrule "obs" subtype=method negate=
+    rx414_cur."!cursor_pos"(rx414_pos)
+    $P10 = rx414_cur."obs"("\\A as beginning-of-string matcher", "^")
+    unless $P10, rx414_fail
+    rx414_pos = $P10."pos"()
+  # rx pass
+    rx414_cur."!cursor_pass"(rx414_pos, "backslash:sym<A>")
+    rx414_cur."!cursor_debug"("PASS  ", "backslash:sym<A>", " at pos=", rx414_pos)
+    .return (rx414_cur)
+  rx414_fail:
+.annotate "line", 3
+    (rx414_rep, rx414_pos, $I10, $P10) = rx414_cur."!mark_fail"(0)
+    lt rx414_pos, -1, rx414_done
+    eq rx414_pos, -1, rx414_fail
+    jump $I10
+  rx414_done:
+    rx414_cur."!cursor_fail"()
+    rx414_cur."!cursor_debug"("FAIL  ", "backslash:sym<A>")
+    .return (rx414_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__backslash:sym<A>"  :subid("116_1261064009.3328") :method
+.annotate "line", 3
+    $P416 = self."!PREFIX__!subrule"("", "A")
+    new $P417, "ResizablePMCArray"
+    push $P417, $P416
+    .return ($P417)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "backslash:sym<z>"  :subid("117_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx420_tgt
+    .local int rx420_pos
+    .local int rx420_off
+    .local int rx420_eos
+    .local int rx420_rep
+    .local pmc rx420_cur
+    (rx420_cur, rx420_pos, rx420_tgt) = self."!cursor_start"()
+    rx420_cur."!cursor_debug"("START ", "backslash:sym<z>")
+    .lex unicode:"$\x{a2}", rx420_cur
+    .local pmc match
+    .lex "$/", match
+    length rx420_eos, rx420_tgt
+    set rx420_off, 0
+    lt rx420_pos, 2, rx420_start
+    sub rx420_off, rx420_pos, 1
+    substr rx420_tgt, rx420_tgt, rx420_off
+  rx420_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan424_done
+    goto rxscan424_scan
+  rxscan424_loop:
+    ($P10) = rx420_cur."from"()
+    inc $P10
+    set rx420_pos, $P10
+    ge rx420_pos, rx420_eos, rxscan424_done
+  rxscan424_scan:
+    set_addr $I10, rxscan424_loop
+    rx420_cur."!mark_push"(0, rx420_pos, $I10)
+  rxscan424_done:
+.annotate "line", 133
+  # rx literal  "z"
+    add $I11, rx420_pos, 1
+    gt $I11, rx420_eos, rx420_fail
+    sub $I11, rx420_pos, rx420_off
+    substr $S10, rx420_tgt, $I11, 1
+    ne $S10, "z", rx420_fail
+    add rx420_pos, 1
+  # rx subrule "obs" subtype=method negate=
+    rx420_cur."!cursor_pos"(rx420_pos)
+    $P10 = rx420_cur."obs"("\\z as end-of-string matcher", "$")
+    unless $P10, rx420_fail
+    rx420_pos = $P10."pos"()
+  # rx pass
+    rx420_cur."!cursor_pass"(rx420_pos, "backslash:sym<z>")
+    rx420_cur."!cursor_debug"("PASS  ", "backslash:sym<z>", " at pos=", rx420_pos)
+    .return (rx420_cur)
+  rx420_fail:
+.annotate "line", 3
+    (rx420_rep, rx420_pos, $I10, $P10) = rx420_cur."!mark_fail"(0)
+    lt rx420_pos, -1, rx420_done
+    eq rx420_pos, -1, rx420_fail
+    jump $I10
+  rx420_done:
+    rx420_cur."!cursor_fail"()
+    rx420_cur."!cursor_debug"("FAIL  ", "backslash:sym<z>")
+    .return (rx420_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__backslash:sym<z>"  :subid("118_1261064009.3328") :method
+.annotate "line", 3
+    $P422 = self."!PREFIX__!subrule"("", "z")
+    new $P423, "ResizablePMCArray"
+    push $P423, $P422
+    .return ($P423)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "backslash:sym<Z>"  :subid("119_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx426_tgt
+    .local int rx426_pos
+    .local int rx426_off
+    .local int rx426_eos
+    .local int rx426_rep
+    .local pmc rx426_cur
+    (rx426_cur, rx426_pos, rx426_tgt) = self."!cursor_start"()
+    rx426_cur."!cursor_debug"("START ", "backslash:sym<Z>")
+    .lex unicode:"$\x{a2}", rx426_cur
+    .local pmc match
+    .lex "$/", match
+    length rx426_eos, rx426_tgt
+    set rx426_off, 0
+    lt rx426_pos, 2, rx426_start
+    sub rx426_off, rx426_pos, 1
+    substr rx426_tgt, rx426_tgt, rx426_off
+  rx426_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan430_done
+    goto rxscan430_scan
+  rxscan430_loop:
+    ($P10) = rx426_cur."from"()
+    inc $P10
+    set rx426_pos, $P10
+    ge rx426_pos, rx426_eos, rxscan430_done
+  rxscan430_scan:
+    set_addr $I10, rxscan430_loop
+    rx426_cur."!mark_push"(0, rx426_pos, $I10)
+  rxscan430_done:
+.annotate "line", 134
+  # rx literal  "Z"
+    add $I11, rx426_pos, 1
+    gt $I11, rx426_eos, rx426_fail
+    sub $I11, rx426_pos, rx426_off
+    substr $S10, rx426_tgt, $I11, 1
+    ne $S10, "Z", rx426_fail
+    add rx426_pos, 1
+  # rx subrule "obs" subtype=method negate=
+    rx426_cur."!cursor_pos"(rx426_pos)
+    $P10 = rx426_cur."obs"("\\Z as end-of-string matcher", "\\n?$")
+    unless $P10, rx426_fail
+    rx426_pos = $P10."pos"()
+  # rx pass
+    rx426_cur."!cursor_pass"(rx426_pos, "backslash:sym<Z>")
+    rx426_cur."!cursor_debug"("PASS  ", "backslash:sym<Z>", " at pos=", rx426_pos)
+    .return (rx426_cur)
+  rx426_fail:
+.annotate "line", 3
+    (rx426_rep, rx426_pos, $I10, $P10) = rx426_cur."!mark_fail"(0)
+    lt rx426_pos, -1, rx426_done
+    eq rx426_pos, -1, rx426_fail
+    jump $I10
+  rx426_done:
+    rx426_cur."!cursor_fail"()
+    rx426_cur."!cursor_debug"("FAIL  ", "backslash:sym<Z>")
+    .return (rx426_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__backslash:sym<Z>"  :subid("120_1261064009.3328") :method
+.annotate "line", 3
+    $P428 = self."!PREFIX__!subrule"("", "Z")
+    new $P429, "ResizablePMCArray"
+    push $P429, $P428
+    .return ($P429)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "backslash:sym<Q>"  :subid("121_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx432_tgt
+    .local int rx432_pos
+    .local int rx432_off
+    .local int rx432_eos
+    .local int rx432_rep
+    .local pmc rx432_cur
+    (rx432_cur, rx432_pos, rx432_tgt) = self."!cursor_start"()
+    rx432_cur."!cursor_debug"("START ", "backslash:sym<Q>")
+    .lex unicode:"$\x{a2}", rx432_cur
+    .local pmc match
+    .lex "$/", match
+    length rx432_eos, rx432_tgt
+    set rx432_off, 0
+    lt rx432_pos, 2, rx432_start
+    sub rx432_off, rx432_pos, 1
+    substr rx432_tgt, rx432_tgt, rx432_off
+  rx432_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan436_done
+    goto rxscan436_scan
+  rxscan436_loop:
+    ($P10) = rx432_cur."from"()
+    inc $P10
+    set rx432_pos, $P10
+    ge rx432_pos, rx432_eos, rxscan436_done
+  rxscan436_scan:
+    set_addr $I10, rxscan436_loop
+    rx432_cur."!mark_push"(0, rx432_pos, $I10)
+  rxscan436_done:
+.annotate "line", 135
+  # rx literal  "Q"
+    add $I11, rx432_pos, 1
+    gt $I11, rx432_eos, rx432_fail
+    sub $I11, rx432_pos, rx432_off
+    substr $S10, rx432_tgt, $I11, 1
+    ne $S10, "Q", rx432_fail
+    add rx432_pos, 1
+  # rx subrule "obs" subtype=method negate=
+    rx432_cur."!cursor_pos"(rx432_pos)
+    $P10 = rx432_cur."obs"("\\Q as quotemeta", "quotes or literal variable match")
+    unless $P10, rx432_fail
+    rx432_pos = $P10."pos"()
+  # rx pass
+    rx432_cur."!cursor_pass"(rx432_pos, "backslash:sym<Q>")
+    rx432_cur."!cursor_debug"("PASS  ", "backslash:sym<Q>", " at pos=", rx432_pos)
+    .return (rx432_cur)
+  rx432_fail:
+.annotate "line", 3
+    (rx432_rep, rx432_pos, $I10, $P10) = rx432_cur."!mark_fail"(0)
+    lt rx432_pos, -1, rx432_done
+    eq rx432_pos, -1, rx432_fail
+    jump $I10
+  rx432_done:
+    rx432_cur."!cursor_fail"()
+    rx432_cur."!cursor_debug"("FAIL  ", "backslash:sym<Q>")
+    .return (rx432_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__backslash:sym<Q>"  :subid("122_1261064009.3328") :method
+.annotate "line", 3
+    $P434 = self."!PREFIX__!subrule"("", "Q")
+    new $P435, "ResizablePMCArray"
+    push $P435, $P434
+    .return ($P435)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "backslash:sym<misc>"  :subid("123_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx438_tgt
+    .local int rx438_pos
+    .local int rx438_off
+    .local int rx438_eos
+    .local int rx438_rep
+    .local pmc rx438_cur
+    (rx438_cur, rx438_pos, rx438_tgt) = self."!cursor_start"()
+    rx438_cur."!cursor_debug"("START ", "backslash:sym<misc>")
+    .lex unicode:"$\x{a2}", rx438_cur
+    .local pmc match
+    .lex "$/", match
+    length rx438_eos, rx438_tgt
+    set rx438_off, 0
+    lt rx438_pos, 2, rx438_start
+    sub rx438_off, rx438_pos, 1
+    substr rx438_tgt, rx438_tgt, rx438_off
+  rx438_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan441_done
+    goto rxscan441_scan
+  rxscan441_loop:
+    ($P10) = rx438_cur."from"()
+    inc $P10
+    set rx438_pos, $P10
+    ge rx438_pos, rx438_eos, rxscan441_done
+  rxscan441_scan:
+    set_addr $I10, rxscan441_loop
+    rx438_cur."!mark_push"(0, rx438_pos, $I10)
+  rxscan441_done:
+.annotate "line", 136
+  # rx charclass W
+    ge rx438_pos, rx438_eos, rx438_fail
+    sub $I10, rx438_pos, rx438_off
+    is_cclass $I11, 8192, rx438_tgt, $I10
+    if $I11, rx438_fail
+    inc rx438_pos
+  # rx pass
+    rx438_cur."!cursor_pass"(rx438_pos, "backslash:sym<misc>")
+    rx438_cur."!cursor_debug"("PASS  ", "backslash:sym<misc>", " at pos=", rx438_pos)
+    .return (rx438_cur)
+  rx438_fail:
+.annotate "line", 3
+    (rx438_rep, rx438_pos, $I10, $P10) = rx438_cur."!mark_fail"(0)
+    lt rx438_pos, -1, rx438_done
+    eq rx438_pos, -1, rx438_fail
+    jump $I10
+  rx438_done:
+    rx438_cur."!cursor_fail"()
+    rx438_cur."!cursor_debug"("FAIL  ", "backslash:sym<misc>")
+    .return (rx438_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__backslash:sym<misc>"  :subid("124_1261064009.3328") :method
+.annotate "line", 3
+    new $P440, "ResizablePMCArray"
+    push $P440, ""
+    .return ($P440)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "assertion"  :subid("125_1261064009.3328") :method
+.annotate "line", 138
+    $P443 = self."!protoregex"("assertion")
+    .return ($P443)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__assertion"  :subid("126_1261064009.3328") :method
+.annotate "line", 138
+    $P445 = self."!PREFIX__!protoregex"("assertion")
+    .return ($P445)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "assertion:sym<?>"  :subid("127_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .const 'Sub' $P454 = "129_1261064009.3328" 
+    capture_lex $P454
+    .local string rx447_tgt
+    .local int rx447_pos
+    .local int rx447_off
+    .local int rx447_eos
+    .local int rx447_rep
+    .local pmc rx447_cur
+    (rx447_cur, rx447_pos, rx447_tgt) = self."!cursor_start"()
+    rx447_cur."!cursor_debug"("START ", "assertion:sym<?>")
+    .lex unicode:"$\x{a2}", rx447_cur
+    .local pmc match
+    .lex "$/", match
+    length rx447_eos, rx447_tgt
+    set rx447_off, 0
+    lt rx447_pos, 2, rx447_start
+    sub rx447_off, rx447_pos, 1
+    substr rx447_tgt, rx447_tgt, rx447_off
+  rx447_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan451_done
+    goto rxscan451_scan
+  rxscan451_loop:
+    ($P10) = rx447_cur."from"()
+    inc $P10
+    set rx447_pos, $P10
+    ge rx447_pos, rx447_eos, rxscan451_done
+  rxscan451_scan:
+    set_addr $I10, rxscan451_loop
+    rx447_cur."!mark_push"(0, rx447_pos, $I10)
+  rxscan451_done:
+.annotate "line", 140
+  # rx literal  "?"
+    add $I11, rx447_pos, 1
+    gt $I11, rx447_eos, rx447_fail
+    sub $I11, rx447_pos, rx447_off
+    substr $S10, rx447_tgt, $I11, 1
+    ne $S10, "?", rx447_fail
+    add rx447_pos, 1
+  alt452_0:
+    set_addr $I10, alt452_1
+    rx447_cur."!mark_push"(0, rx447_pos, $I10)
+  # rx subrule "before" subtype=zerowidth negate=
+    rx447_cur."!cursor_pos"(rx447_pos)
+    .const 'Sub' $P454 = "129_1261064009.3328" 
+    capture_lex $P454
+    $P10 = rx447_cur."before"($P454)
+    unless $P10, rx447_fail
+    goto alt452_end
+  alt452_1:
+  # rx subrule "assertion" subtype=capture negate=
+    rx447_cur."!cursor_pos"(rx447_pos)
+    $P10 = rx447_cur."assertion"()
+    unless $P10, rx447_fail
+    rx447_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("assertion")
+    rx447_pos = $P10."pos"()
+  alt452_end:
+  # rx pass
+    rx447_cur."!cursor_pass"(rx447_pos, "assertion:sym<?>")
+    rx447_cur."!cursor_debug"("PASS  ", "assertion:sym<?>", " at pos=", rx447_pos)
+    .return (rx447_cur)
+  rx447_fail:
+.annotate "line", 3
+    (rx447_rep, rx447_pos, $I10, $P10) = rx447_cur."!mark_fail"(0)
+    lt rx447_pos, -1, rx447_done
+    eq rx447_pos, -1, rx447_fail
+    jump $I10
+  rx447_done:
+    rx447_cur."!cursor_fail"()
+    rx447_cur."!cursor_debug"("FAIL  ", "assertion:sym<?>")
+    .return (rx447_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__assertion:sym<?>"  :subid("128_1261064009.3328") :method
+.annotate "line", 3
+    $P449 = self."!PREFIX__!subrule"("assertion", "?")
+    new $P450, "ResizablePMCArray"
+    push $P450, $P449
+    push $P450, "?"
+    .return ($P450)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "_block453"  :anon :subid("129_1261064009.3328") :method :outer("127_1261064009.3328")
+.annotate "line", 140
+    .local string rx455_tgt
+    .local int rx455_pos
+    .local int rx455_off
+    .local int rx455_eos
+    .local int rx455_rep
+    .local pmc rx455_cur
+    (rx455_cur, rx455_pos, rx455_tgt) = self."!cursor_start"()
+    rx455_cur."!cursor_debug"("START ", "")
+    .lex unicode:"$\x{a2}", rx455_cur
+    .local pmc match
+    .lex "$/", match
+    length rx455_eos, rx455_tgt
+    set rx455_off, 0
+    lt rx455_pos, 2, rx455_start
+    sub rx455_off, rx455_pos, 1
+    substr rx455_tgt, rx455_tgt, rx455_off
+  rx455_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan456_done
+    goto rxscan456_scan
+  rxscan456_loop:
+    ($P10) = rx455_cur."from"()
+    inc $P10
+    set rx455_pos, $P10
+    ge rx455_pos, rx455_eos, rxscan456_done
+  rxscan456_scan:
+    set_addr $I10, rxscan456_loop
+    rx455_cur."!mark_push"(0, rx455_pos, $I10)
+  rxscan456_done:
+  # rx literal  ">"
+    add $I11, rx455_pos, 1
+    gt $I11, rx455_eos, rx455_fail
+    sub $I11, rx455_pos, rx455_off
+    substr $S10, rx455_tgt, $I11, 1
+    ne $S10, ">", rx455_fail
+    add rx455_pos, 1
+  # rx pass
+    rx455_cur."!cursor_pass"(rx455_pos, "")
+    rx455_cur."!cursor_debug"("PASS  ", "", " at pos=", rx455_pos)
+    .return (rx455_cur)
+  rx455_fail:
+    (rx455_rep, rx455_pos, $I10, $P10) = rx455_cur."!mark_fail"(0)
+    lt rx455_pos, -1, rx455_done
+    eq rx455_pos, -1, rx455_fail
+    jump $I10
+  rx455_done:
+    rx455_cur."!cursor_fail"()
+    rx455_cur."!cursor_debug"("FAIL  ", "")
+    .return (rx455_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "assertion:sym<!>"  :subid("130_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .const 'Sub' $P465 = "132_1261064009.3328" 
+    capture_lex $P465
+    .local string rx458_tgt
+    .local int rx458_pos
+    .local int rx458_off
+    .local int rx458_eos
+    .local int rx458_rep
+    .local pmc rx458_cur
+    (rx458_cur, rx458_pos, rx458_tgt) = self."!cursor_start"()
+    rx458_cur."!cursor_debug"("START ", "assertion:sym<!>")
+    .lex unicode:"$\x{a2}", rx458_cur
+    .local pmc match
+    .lex "$/", match
+    length rx458_eos, rx458_tgt
+    set rx458_off, 0
+    lt rx458_pos, 2, rx458_start
+    sub rx458_off, rx458_pos, 1
+    substr rx458_tgt, rx458_tgt, rx458_off
+  rx458_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan462_done
+    goto rxscan462_scan
+  rxscan462_loop:
+    ($P10) = rx458_cur."from"()
+    inc $P10
+    set rx458_pos, $P10
+    ge rx458_pos, rx458_eos, rxscan462_done
+  rxscan462_scan:
+    set_addr $I10, rxscan462_loop
+    rx458_cur."!mark_push"(0, rx458_pos, $I10)
+  rxscan462_done:
+.annotate "line", 141
+  # rx literal  "!"
+    add $I11, rx458_pos, 1
+    gt $I11, rx458_eos, rx458_fail
+    sub $I11, rx458_pos, rx458_off
+    substr $S10, rx458_tgt, $I11, 1
+    ne $S10, "!", rx458_fail
+    add rx458_pos, 1
+  alt463_0:
+    set_addr $I10, alt463_1
+    rx458_cur."!mark_push"(0, rx458_pos, $I10)
+  # rx subrule "before" subtype=zerowidth negate=
+    rx458_cur."!cursor_pos"(rx458_pos)
+    .const 'Sub' $P465 = "132_1261064009.3328" 
+    capture_lex $P465
+    $P10 = rx458_cur."before"($P465)
+    unless $P10, rx458_fail
+    goto alt463_end
+  alt463_1:
+  # rx subrule "assertion" subtype=capture negate=
+    rx458_cur."!cursor_pos"(rx458_pos)
+    $P10 = rx458_cur."assertion"()
+    unless $P10, rx458_fail
+    rx458_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("assertion")
+    rx458_pos = $P10."pos"()
+  alt463_end:
+  # rx pass
+    rx458_cur."!cursor_pass"(rx458_pos, "assertion:sym<!>")
+    rx458_cur."!cursor_debug"("PASS  ", "assertion:sym<!>", " at pos=", rx458_pos)
+    .return (rx458_cur)
+  rx458_fail:
+.annotate "line", 3
+    (rx458_rep, rx458_pos, $I10, $P10) = rx458_cur."!mark_fail"(0)
+    lt rx458_pos, -1, rx458_done
+    eq rx458_pos, -1, rx458_fail
+    jump $I10
+  rx458_done:
+    rx458_cur."!cursor_fail"()
+    rx458_cur."!cursor_debug"("FAIL  ", "assertion:sym<!>")
+    .return (rx458_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__assertion:sym<!>"  :subid("131_1261064009.3328") :method
+.annotate "line", 3
+    $P460 = self."!PREFIX__!subrule"("assertion", "!")
+    new $P461, "ResizablePMCArray"
+    push $P461, $P460
+    push $P461, "!"
+    .return ($P461)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "_block464"  :anon :subid("132_1261064009.3328") :method :outer("130_1261064009.3328")
+.annotate "line", 141
+    .local string rx466_tgt
+    .local int rx466_pos
+    .local int rx466_off
+    .local int rx466_eos
+    .local int rx466_rep
+    .local pmc rx466_cur
+    (rx466_cur, rx466_pos, rx466_tgt) = self."!cursor_start"()
+    rx466_cur."!cursor_debug"("START ", "")
+    .lex unicode:"$\x{a2}", rx466_cur
+    .local pmc match
+    .lex "$/", match
+    length rx466_eos, rx466_tgt
+    set rx466_off, 0
+    lt rx466_pos, 2, rx466_start
+    sub rx466_off, rx466_pos, 1
+    substr rx466_tgt, rx466_tgt, rx466_off
+  rx466_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan467_done
+    goto rxscan467_scan
+  rxscan467_loop:
+    ($P10) = rx466_cur."from"()
+    inc $P10
+    set rx466_pos, $P10
+    ge rx466_pos, rx466_eos, rxscan467_done
+  rxscan467_scan:
+    set_addr $I10, rxscan467_loop
+    rx466_cur."!mark_push"(0, rx466_pos, $I10)
+  rxscan467_done:
+  # rx literal  ">"
+    add $I11, rx466_pos, 1
+    gt $I11, rx466_eos, rx466_fail
+    sub $I11, rx466_pos, rx466_off
+    substr $S10, rx466_tgt, $I11, 1
+    ne $S10, ">", rx466_fail
+    add rx466_pos, 1
+  # rx pass
+    rx466_cur."!cursor_pass"(rx466_pos, "")
+    rx466_cur."!cursor_debug"("PASS  ", "", " at pos=", rx466_pos)
+    .return (rx466_cur)
+  rx466_fail:
+    (rx466_rep, rx466_pos, $I10, $P10) = rx466_cur."!mark_fail"(0)
+    lt rx466_pos, -1, rx466_done
+    eq rx466_pos, -1, rx466_fail
+    jump $I10
+  rx466_done:
+    rx466_cur."!cursor_fail"()
+    rx466_cur."!cursor_debug"("FAIL  ", "")
+    .return (rx466_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "assertion:sym<method>"  :subid("133_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx469_tgt
+    .local int rx469_pos
+    .local int rx469_off
+    .local int rx469_eos
+    .local int rx469_rep
+    .local pmc rx469_cur
+    (rx469_cur, rx469_pos, rx469_tgt) = self."!cursor_start"()
+    rx469_cur."!cursor_debug"("START ", "assertion:sym<method>")
+    .lex unicode:"$\x{a2}", rx469_cur
+    .local pmc match
+    .lex "$/", match
+    length rx469_eos, rx469_tgt
+    set rx469_off, 0
+    lt rx469_pos, 2, rx469_start
+    sub rx469_off, rx469_pos, 1
+    substr rx469_tgt, rx469_tgt, rx469_off
+  rx469_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan473_done
+    goto rxscan473_scan
+  rxscan473_loop:
+    ($P10) = rx469_cur."from"()
+    inc $P10
+    set rx469_pos, $P10
+    ge rx469_pos, rx469_eos, rxscan473_done
+  rxscan473_scan:
+    set_addr $I10, rxscan473_loop
+    rx469_cur."!mark_push"(0, rx469_pos, $I10)
+  rxscan473_done:
+.annotate "line", 144
+  # rx literal  "."
+    add $I11, rx469_pos, 1
+    gt $I11, rx469_eos, rx469_fail
+    sub $I11, rx469_pos, rx469_off
+    substr $S10, rx469_tgt, $I11, 1
+    ne $S10, ".", rx469_fail
+    add rx469_pos, 1
+  # rx subrule "assertion" subtype=capture negate=
+    rx469_cur."!cursor_pos"(rx469_pos)
+    $P10 = rx469_cur."assertion"()
+    unless $P10, rx469_fail
+    rx469_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("assertion")
+    rx469_pos = $P10."pos"()
+.annotate "line", 143
+  # rx pass
+    rx469_cur."!cursor_pass"(rx469_pos, "assertion:sym<method>")
+    rx469_cur."!cursor_debug"("PASS  ", "assertion:sym<method>", " at pos=", rx469_pos)
+    .return (rx469_cur)
+  rx469_fail:
+.annotate "line", 3
+    (rx469_rep, rx469_pos, $I10, $P10) = rx469_cur."!mark_fail"(0)
+    lt rx469_pos, -1, rx469_done
+    eq rx469_pos, -1, rx469_fail
+    jump $I10
+  rx469_done:
+    rx469_cur."!cursor_fail"()
+    rx469_cur."!cursor_debug"("FAIL  ", "assertion:sym<method>")
+    .return (rx469_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__assertion:sym<method>"  :subid("134_1261064009.3328") :method
+.annotate "line", 3
+    $P471 = self."!PREFIX__!subrule"("assertion", ".")
+    new $P472, "ResizablePMCArray"
+    push $P472, $P471
+    .return ($P472)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "assertion:sym<name>"  :subid("135_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .const 'Sub' $P483 = "137_1261064009.3328" 
+    capture_lex $P483
+    .local string rx475_tgt
+    .local int rx475_pos
+    .local int rx475_off
+    .local int rx475_eos
+    .local int rx475_rep
+    .local pmc rx475_cur
+    (rx475_cur, rx475_pos, rx475_tgt) = self."!cursor_start"()
+    rx475_cur."!cursor_debug"("START ", "assertion:sym<name>")
+    rx475_cur."!cursor_caparray"("arglist", "nibbler", "assertion")
+    .lex unicode:"$\x{a2}", rx475_cur
+    .local pmc match
+    .lex "$/", match
+    length rx475_eos, rx475_tgt
+    set rx475_off, 0
+    lt rx475_pos, 2, rx475_start
+    sub rx475_off, rx475_pos, 1
+    substr rx475_tgt, rx475_tgt, rx475_off
+  rx475_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan478_done
+    goto rxscan478_scan
+  rxscan478_loop:
+    ($P10) = rx475_cur."from"()
+    inc $P10
+    set rx475_pos, $P10
+    ge rx475_pos, rx475_eos, rxscan478_done
+  rxscan478_scan:
+    set_addr $I10, rxscan478_loop
+    rx475_cur."!mark_push"(0, rx475_pos, $I10)
+  rxscan478_done:
+.annotate "line", 148
+  # rx subcapture "longname"
+    set_addr $I10, rxcap_479_fail
+    rx475_cur."!mark_push"(0, rx475_pos, $I10)
+  # rx charclass_q w r 1..-1
+    sub $I10, rx475_pos, rx475_off
+    find_not_cclass $I11, 8192, rx475_tgt, $I10, rx475_eos
+    add $I12, $I10, 1
+    lt $I11, $I12, rx475_fail
+    add rx475_pos, rx475_off, $I11
+    set_addr $I10, rxcap_479_fail
+    ($I12, $I11) = rx475_cur."!mark_peek"($I10)
+    rx475_cur."!cursor_pos"($I11)
+    ($P10) = rx475_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx475_pos, "")
+    rx475_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("longname")
+    goto rxcap_479_done
+  rxcap_479_fail:
+    goto rx475_fail
+  rxcap_479_done:
+.annotate "line", 155
+  # rx rxquantr480 ** 0..1
+    set_addr $I486, rxquantr480_done
+    rx475_cur."!mark_push"(0, rx475_pos, $I486)
+  rxquantr480_loop:
+  alt481_0:
+.annotate "line", 149
+    set_addr $I10, alt481_1
+    rx475_cur."!mark_push"(0, rx475_pos, $I10)
+.annotate "line", 150
+  # rx subrule "before" subtype=zerowidth negate=
+    rx475_cur."!cursor_pos"(rx475_pos)
+    .const 'Sub' $P483 = "137_1261064009.3328" 
+    capture_lex $P483
+    $P10 = rx475_cur."before"($P483)
+    unless $P10, rx475_fail
+    goto alt481_end
+  alt481_1:
+    set_addr $I10, alt481_2
+    rx475_cur."!mark_push"(0, rx475_pos, $I10)
+.annotate "line", 151
+  # rx literal  "="
+    add $I11, rx475_pos, 1
+    gt $I11, rx475_eos, rx475_fail
+    sub $I11, rx475_pos, rx475_off
+    substr $S10, rx475_tgt, $I11, 1
+    ne $S10, "=", rx475_fail
+    add rx475_pos, 1
+  # rx subrule "assertion" subtype=capture negate=
+    rx475_cur."!cursor_pos"(rx475_pos)
+    $P10 = rx475_cur."assertion"()
+    unless $P10, rx475_fail
+    rx475_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("assertion")
+    rx475_pos = $P10."pos"()
+    goto alt481_end
+  alt481_2:
+    set_addr $I10, alt481_3
+    rx475_cur."!mark_push"(0, rx475_pos, $I10)
+.annotate "line", 152
+  # rx literal  ":"
+    add $I11, rx475_pos, 1
+    gt $I11, rx475_eos, rx475_fail
+    sub $I11, rx475_pos, rx475_off
+    substr $S10, rx475_tgt, $I11, 1
+    ne $S10, ":", rx475_fail
+    add rx475_pos, 1
+  # rx subrule "arglist" subtype=capture negate=
+    rx475_cur."!cursor_pos"(rx475_pos)
+    $P10 = rx475_cur."arglist"()
+    unless $P10, rx475_fail
+    rx475_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("arglist")
+    rx475_pos = $P10."pos"()
+    goto alt481_end
+  alt481_3:
+    set_addr $I10, alt481_4
+    rx475_cur."!mark_push"(0, rx475_pos, $I10)
+.annotate "line", 153
+  # rx literal  "("
+    add $I11, rx475_pos, 1
+    gt $I11, rx475_eos, rx475_fail
+    sub $I11, rx475_pos, rx475_off
+    substr $S10, rx475_tgt, $I11, 1
+    ne $S10, "(", rx475_fail
+    add rx475_pos, 1
+  # rx subrule "arglist" subtype=capture negate=
+    rx475_cur."!cursor_pos"(rx475_pos)
+    $P10 = rx475_cur."arglist"()
+    unless $P10, rx475_fail
+    rx475_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("arglist")
+    rx475_pos = $P10."pos"()
+  # rx literal  ")"
+    add $I11, rx475_pos, 1
+    gt $I11, rx475_eos, rx475_fail
+    sub $I11, rx475_pos, rx475_off
+    substr $S10, rx475_tgt, $I11, 1
+    ne $S10, ")", rx475_fail
+    add rx475_pos, 1
+    goto alt481_end
+  alt481_4:
+.annotate "line", 154
+  # rx subrule "normspace" subtype=method negate=
+    rx475_cur."!cursor_pos"(rx475_pos)
+    $P10 = rx475_cur."normspace"()
+    unless $P10, rx475_fail
+    rx475_pos = $P10."pos"()
+  # rx subrule "nibbler" subtype=capture negate=
+    rx475_cur."!cursor_pos"(rx475_pos)
+    $P10 = rx475_cur."nibbler"()
+    unless $P10, rx475_fail
+    rx475_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("nibbler")
+    rx475_pos = $P10."pos"()
+  alt481_end:
+.annotate "line", 155
+    (rx475_rep) = rx475_cur."!mark_commit"($I486)
+  rxquantr480_done:
+.annotate "line", 147
+  # rx pass
+    rx475_cur."!cursor_pass"(rx475_pos, "assertion:sym<name>")
+    rx475_cur."!cursor_debug"("PASS  ", "assertion:sym<name>", " at pos=", rx475_pos)
+    .return (rx475_cur)
+  rx475_fail:
+.annotate "line", 3
+    (rx475_rep, rx475_pos, $I10, $P10) = rx475_cur."!mark_fail"(0)
+    lt rx475_pos, -1, rx475_done
+    eq rx475_pos, -1, rx475_fail
+    jump $I10
+  rx475_done:
+    rx475_cur."!cursor_fail"()
+    rx475_cur."!cursor_debug"("FAIL  ", "assertion:sym<name>")
+    .return (rx475_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__assertion:sym<name>"  :subid("136_1261064009.3328") :method
+.annotate "line", 3
+    new $P477, "ResizablePMCArray"
+    push $P477, ""
+    .return ($P477)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "_block482"  :anon :subid("137_1261064009.3328") :method :outer("135_1261064009.3328")
+.annotate "line", 150
+    .local string rx484_tgt
+    .local int rx484_pos
+    .local int rx484_off
+    .local int rx484_eos
+    .local int rx484_rep
+    .local pmc rx484_cur
+    (rx484_cur, rx484_pos, rx484_tgt) = self."!cursor_start"()
+    rx484_cur."!cursor_debug"("START ", "")
+    .lex unicode:"$\x{a2}", rx484_cur
+    .local pmc match
+    .lex "$/", match
+    length rx484_eos, rx484_tgt
+    set rx484_off, 0
+    lt rx484_pos, 2, rx484_start
+    sub rx484_off, rx484_pos, 1
+    substr rx484_tgt, rx484_tgt, rx484_off
+  rx484_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan485_done
+    goto rxscan485_scan
+  rxscan485_loop:
+    ($P10) = rx484_cur."from"()
+    inc $P10
+    set rx484_pos, $P10
+    ge rx484_pos, rx484_eos, rxscan485_done
+  rxscan485_scan:
+    set_addr $I10, rxscan485_loop
+    rx484_cur."!mark_push"(0, rx484_pos, $I10)
+  rxscan485_done:
+  # rx literal  ">"
+    add $I11, rx484_pos, 1
+    gt $I11, rx484_eos, rx484_fail
+    sub $I11, rx484_pos, rx484_off
+    substr $S10, rx484_tgt, $I11, 1
+    ne $S10, ">", rx484_fail
+    add rx484_pos, 1
+  # rx pass
+    rx484_cur."!cursor_pass"(rx484_pos, "")
+    rx484_cur."!cursor_debug"("PASS  ", "", " at pos=", rx484_pos)
+    .return (rx484_cur)
+  rx484_fail:
+    (rx484_rep, rx484_pos, $I10, $P10) = rx484_cur."!mark_fail"(0)
+    lt rx484_pos, -1, rx484_done
+    eq rx484_pos, -1, rx484_fail
+    jump $I10
+  rx484_done:
+    rx484_cur."!cursor_fail"()
+    rx484_cur."!cursor_debug"("FAIL  ", "")
+    .return (rx484_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "assertion:sym<[>"  :subid("138_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .const 'Sub' $P493 = "140_1261064009.3328" 
+    capture_lex $P493
+    .local string rx488_tgt
+    .local int rx488_pos
+    .local int rx488_off
+    .local int rx488_eos
+    .local int rx488_rep
+    .local pmc rx488_cur
+    (rx488_cur, rx488_pos, rx488_tgt) = self."!cursor_start"()
+    rx488_cur."!cursor_debug"("START ", "assertion:sym<[>")
+    rx488_cur."!cursor_caparray"("cclass_elem")
+    .lex unicode:"$\x{a2}", rx488_cur
+    .local pmc match
+    .lex "$/", match
+    length rx488_eos, rx488_tgt
+    set rx488_off, 0
+    lt rx488_pos, 2, rx488_start
+    sub rx488_off, rx488_pos, 1
+    substr rx488_tgt, rx488_tgt, rx488_off
+  rx488_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan491_done
+    goto rxscan491_scan
+  rxscan491_loop:
+    ($P10) = rx488_cur."from"()
+    inc $P10
+    set rx488_pos, $P10
+    ge rx488_pos, rx488_eos, rxscan491_done
+  rxscan491_scan:
+    set_addr $I10, rxscan491_loop
+    rx488_cur."!mark_push"(0, rx488_pos, $I10)
+  rxscan491_done:
+.annotate "line", 158
+  # rx subrule "before" subtype=zerowidth negate=
+    rx488_cur."!cursor_pos"(rx488_pos)
+    .const 'Sub' $P493 = "140_1261064009.3328" 
+    capture_lex $P493
+    $P10 = rx488_cur."before"($P493)
+    unless $P10, rx488_fail
+  # rx rxquantr497 ** 1..*
+    set_addr $I498, rxquantr497_done
+    rx488_cur."!mark_push"(0, -1, $I498)
+  rxquantr497_loop:
+  # rx subrule "cclass_elem" subtype=capture negate=
+    rx488_cur."!cursor_pos"(rx488_pos)
+    $P10 = rx488_cur."cclass_elem"()
+    unless $P10, rx488_fail
+    rx488_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("cclass_elem")
+    rx488_pos = $P10."pos"()
+    (rx488_rep) = rx488_cur."!mark_commit"($I498)
+    rx488_cur."!mark_push"(rx488_rep, rx488_pos, $I498)
+    goto rxquantr497_loop
+  rxquantr497_done:
+  # rx pass
+    rx488_cur."!cursor_pass"(rx488_pos, "assertion:sym<[>")
+    rx488_cur."!cursor_debug"("PASS  ", "assertion:sym<[>", " at pos=", rx488_pos)
+    .return (rx488_cur)
+  rx488_fail:
+.annotate "line", 3
+    (rx488_rep, rx488_pos, $I10, $P10) = rx488_cur."!mark_fail"(0)
+    lt rx488_pos, -1, rx488_done
+    eq rx488_pos, -1, rx488_fail
+    jump $I10
+  rx488_done:
+    rx488_cur."!cursor_fail"()
+    rx488_cur."!cursor_debug"("FAIL  ", "assertion:sym<[>")
+    .return (rx488_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__assertion:sym<[>"  :subid("139_1261064009.3328") :method
+.annotate "line", 3
+    new $P490, "ResizablePMCArray"
+    push $P490, ""
+    .return ($P490)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "_block492"  :anon :subid("140_1261064009.3328") :method :outer("138_1261064009.3328")
+.annotate "line", 158
+    .local string rx494_tgt
+    .local int rx494_pos
+    .local int rx494_off
+    .local int rx494_eos
+    .local int rx494_rep
+    .local pmc rx494_cur
+    (rx494_cur, rx494_pos, rx494_tgt) = self."!cursor_start"()
+    rx494_cur."!cursor_debug"("START ", "")
+    .lex unicode:"$\x{a2}", rx494_cur
+    .local pmc match
+    .lex "$/", match
+    length rx494_eos, rx494_tgt
+    set rx494_off, 0
+    lt rx494_pos, 2, rx494_start
+    sub rx494_off, rx494_pos, 1
+    substr rx494_tgt, rx494_tgt, rx494_off
+  rx494_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan495_done
+    goto rxscan495_scan
+  rxscan495_loop:
+    ($P10) = rx494_cur."from"()
+    inc $P10
+    set rx494_pos, $P10
+    ge rx494_pos, rx494_eos, rxscan495_done
+  rxscan495_scan:
+    set_addr $I10, rxscan495_loop
+    rx494_cur."!mark_push"(0, rx494_pos, $I10)
+  rxscan495_done:
+  alt496_0:
+    set_addr $I10, alt496_1
+    rx494_cur."!mark_push"(0, rx494_pos, $I10)
+  # rx literal  "["
+    add $I11, rx494_pos, 1
+    gt $I11, rx494_eos, rx494_fail
+    sub $I11, rx494_pos, rx494_off
+    substr $S10, rx494_tgt, $I11, 1
+    ne $S10, "[", rx494_fail
+    add rx494_pos, 1
+    goto alt496_end
+  alt496_1:
+    set_addr $I10, alt496_2
+    rx494_cur."!mark_push"(0, rx494_pos, $I10)
+  # rx literal  "+"
+    add $I11, rx494_pos, 1
+    gt $I11, rx494_eos, rx494_fail
+    sub $I11, rx494_pos, rx494_off
+    substr $S10, rx494_tgt, $I11, 1
+    ne $S10, "+", rx494_fail
+    add rx494_pos, 1
+    goto alt496_end
+  alt496_2:
+  # rx literal  "-"
+    add $I11, rx494_pos, 1
+    gt $I11, rx494_eos, rx494_fail
+    sub $I11, rx494_pos, rx494_off
+    substr $S10, rx494_tgt, $I11, 1
+    ne $S10, "-", rx494_fail
+    add rx494_pos, 1
+  alt496_end:
+  # rx pass
+    rx494_cur."!cursor_pass"(rx494_pos, "")
+    rx494_cur."!cursor_debug"("PASS  ", "", " at pos=", rx494_pos)
+    .return (rx494_cur)
+  rx494_fail:
+    (rx494_rep, rx494_pos, $I10, $P10) = rx494_cur."!mark_fail"(0)
+    lt rx494_pos, -1, rx494_done
+    eq rx494_pos, -1, rx494_fail
+    jump $I10
+  rx494_done:
+    rx494_cur."!cursor_fail"()
+    rx494_cur."!cursor_debug"("FAIL  ", "")
+    .return (rx494_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "cclass_elem"  :subid("141_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .const 'Sub' $P511 = "143_1261064009.3328" 
+    capture_lex $P511
+    .local string rx500_tgt
+    .local int rx500_pos
+    .local int rx500_off
+    .local int rx500_eos
+    .local int rx500_rep
+    .local pmc rx500_cur
+    (rx500_cur, rx500_pos, rx500_tgt) = self."!cursor_start"()
+    rx500_cur."!cursor_debug"("START ", "cclass_elem")
+    rx500_cur."!cursor_caparray"("charspec")
+    .lex unicode:"$\x{a2}", rx500_cur
+    .local pmc match
+    .lex "$/", match
+    length rx500_eos, rx500_tgt
+    set rx500_off, 0
+    lt rx500_pos, 2, rx500_start
+    sub rx500_off, rx500_pos, 1
+    substr rx500_tgt, rx500_tgt, rx500_off
+  rx500_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan503_done
+    goto rxscan503_scan
+  rxscan503_loop:
+    ($P10) = rx500_cur."from"()
+    inc $P10
+    set rx500_pos, $P10
+    ge rx500_pos, rx500_eos, rxscan503_done
+  rxscan503_scan:
+    set_addr $I10, rxscan503_loop
+    rx500_cur."!mark_push"(0, rx500_pos, $I10)
+  rxscan503_done:
+.annotate "line", 161
+  # rx subcapture "sign"
+    set_addr $I10, rxcap_505_fail
+    rx500_cur."!mark_push"(0, rx500_pos, $I10)
+  alt504_0:
+    set_addr $I10, alt504_1
+    rx500_cur."!mark_push"(0, rx500_pos, $I10)
+  # rx literal  "+"
+    add $I11, rx500_pos, 1
+    gt $I11, rx500_eos, rx500_fail
+    sub $I11, rx500_pos, rx500_off
+    substr $S10, rx500_tgt, $I11, 1
+    ne $S10, "+", rx500_fail
+    add rx500_pos, 1
+    goto alt504_end
+  alt504_1:
+    set_addr $I10, alt504_2
+    rx500_cur."!mark_push"(0, rx500_pos, $I10)
+  # rx literal  "-"
+    add $I11, rx500_pos, 1
+    gt $I11, rx500_eos, rx500_fail
+    sub $I11, rx500_pos, rx500_off
+    substr $S10, rx500_tgt, $I11, 1
+    ne $S10, "-", rx500_fail
+    add rx500_pos, 1
+    goto alt504_end
+  alt504_2:
+  alt504_end:
+    set_addr $I10, rxcap_505_fail
+    ($I12, $I11) = rx500_cur."!mark_peek"($I10)
+    rx500_cur."!cursor_pos"($I11)
+    ($P10) = rx500_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx500_pos, "")
+    rx500_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sign")
+    goto rxcap_505_done
+  rxcap_505_fail:
+    goto rx500_fail
+  rxcap_505_done:
+.annotate "line", 162
+  # rx rxquantr506 ** 0..1
+    set_addr $I507, rxquantr506_done
+    rx500_cur."!mark_push"(0, rx500_pos, $I507)
+  rxquantr506_loop:
+  # rx subrule "normspace" subtype=method negate=
+    rx500_cur."!cursor_pos"(rx500_pos)
+    $P10 = rx500_cur."normspace"()
+    unless $P10, rx500_fail
+    rx500_pos = $P10."pos"()
+    (rx500_rep) = rx500_cur."!mark_commit"($I507)
+  rxquantr506_done:
+  alt508_0:
+.annotate "line", 163
+    set_addr $I10, alt508_1
+    rx500_cur."!mark_push"(0, rx500_pos, $I10)
+.annotate "line", 164
+  # rx literal  "["
+    add $I11, rx500_pos, 1
+    gt $I11, rx500_eos, rx500_fail
+    sub $I11, rx500_pos, rx500_off
+    substr $S10, rx500_tgt, $I11, 1
+    ne $S10, "[", rx500_fail
+    add rx500_pos, 1
+.annotate "line", 167
+  # rx rxquantr509 ** 0..*
+    set_addr $I530, rxquantr509_done
+    rx500_cur."!mark_push"(0, rx500_pos, $I530)
+  rxquantr509_loop:
+.annotate "line", 164
+  # rx subrule $P511 subtype=capture negate=
+    rx500_cur."!cursor_pos"(rx500_pos)
+    .const 'Sub' $P511 = "143_1261064009.3328" 
+    capture_lex $P511
+    $P10 = rx500_cur.$P511()
+    unless $P10, rx500_fail
+    rx500_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("charspec")
+    rx500_pos = $P10."pos"()
+.annotate "line", 167
+    (rx500_rep) = rx500_cur."!mark_commit"($I530)
+    rx500_cur."!mark_push"(rx500_rep, rx500_pos, $I530)
+    goto rxquantr509_loop
+  rxquantr509_done:
+.annotate "line", 168
+  # rx charclass_q s r 0..-1
+    sub $I10, rx500_pos, rx500_off
+    find_not_cclass $I11, 32, rx500_tgt, $I10, rx500_eos
+    add rx500_pos, rx500_off, $I11
+  # rx literal  "]"
+    add $I11, rx500_pos, 1
+    gt $I11, rx500_eos, rx500_fail
+    sub $I11, rx500_pos, rx500_off
+    substr $S10, rx500_tgt, $I11, 1
+    ne $S10, "]", rx500_fail
+    add rx500_pos, 1
+.annotate "line", 164
+    goto alt508_end
+  alt508_1:
+.annotate "line", 169
+  # rx subcapture "name"
+    set_addr $I10, rxcap_531_fail
+    rx500_cur."!mark_push"(0, rx500_pos, $I10)
+  # rx charclass_q w r 1..-1
+    sub $I10, rx500_pos, rx500_off
+    find_not_cclass $I11, 8192, rx500_tgt, $I10, rx500_eos
+    add $I12, $I10, 1
+    lt $I11, $I12, rx500_fail
+    add rx500_pos, rx500_off, $I11
+    set_addr $I10, rxcap_531_fail
+    ($I12, $I11) = rx500_cur."!mark_peek"($I10)
+    rx500_cur."!cursor_pos"($I11)
+    ($P10) = rx500_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx500_pos, "")
+    rx500_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("name")
+    goto rxcap_531_done
+  rxcap_531_fail:
+    goto rx500_fail
+  rxcap_531_done:
+  alt508_end:
+.annotate "line", 171
+  # rx rxquantr532 ** 0..1
+    set_addr $I533, rxquantr532_done
+    rx500_cur."!mark_push"(0, rx500_pos, $I533)
+  rxquantr532_loop:
+  # rx subrule "normspace" subtype=method negate=
+    rx500_cur."!cursor_pos"(rx500_pos)
+    $P10 = rx500_cur."normspace"()
+    unless $P10, rx500_fail
+    rx500_pos = $P10."pos"()
+    (rx500_rep) = rx500_cur."!mark_commit"($I533)
+  rxquantr532_done:
+.annotate "line", 160
+  # rx pass
+    rx500_cur."!cursor_pass"(rx500_pos, "cclass_elem")
+    rx500_cur."!cursor_debug"("PASS  ", "cclass_elem", " at pos=", rx500_pos)
+    .return (rx500_cur)
+  rx500_fail:
+.annotate "line", 3
+    (rx500_rep, rx500_pos, $I10, $P10) = rx500_cur."!mark_fail"(0)
+    lt rx500_pos, -1, rx500_done
+    eq rx500_pos, -1, rx500_fail
+    jump $I10
+  rx500_done:
+    rx500_cur."!cursor_fail"()
+    rx500_cur."!cursor_debug"("FAIL  ", "cclass_elem")
+    .return (rx500_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__cclass_elem"  :subid("142_1261064009.3328") :method
+.annotate "line", 3
+    new $P502, "ResizablePMCArray"
+    push $P502, ""
+    push $P502, "-"
+    push $P502, "+"
+    .return ($P502)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "_block510"  :anon :subid("143_1261064009.3328") :method :outer("141_1261064009.3328")
+.annotate "line", 164
+    .const 'Sub' $P526 = "146_1261064009.3328" 
+    capture_lex $P526
+    .const 'Sub' $P521 = "145_1261064009.3328" 
+    capture_lex $P521
+    .const 'Sub' $P517 = "144_1261064009.3328" 
+    capture_lex $P517
+    .local string rx512_tgt
+    .local int rx512_pos
+    .local int rx512_off
+    .local int rx512_eos
+    .local int rx512_rep
+    .local pmc rx512_cur
+    (rx512_cur, rx512_pos, rx512_tgt) = self."!cursor_start"()
+    rx512_cur."!cursor_debug"("START ", "")
+    rx512_cur."!cursor_caparray"("1")
+    .lex unicode:"$\x{a2}", rx512_cur
+    .local pmc match
+    .lex "$/", match
+    length rx512_eos, rx512_tgt
+    set rx512_off, 0
+    lt rx512_pos, 2, rx512_start
+    sub rx512_off, rx512_pos, 1
+    substr rx512_tgt, rx512_tgt, rx512_off
+  rx512_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan513_done
+    goto rxscan513_scan
+  rxscan513_loop:
+    ($P10) = rx512_cur."from"()
+    inc $P10
+    set rx512_pos, $P10
+    ge rx512_pos, rx512_eos, rxscan513_done
+  rxscan513_scan:
+    set_addr $I10, rxscan513_loop
+    rx512_cur."!mark_push"(0, rx512_pos, $I10)
+  rxscan513_done:
+  alt514_0:
+    set_addr $I10, alt514_1
+    rx512_cur."!mark_push"(0, rx512_pos, $I10)
+.annotate "line", 165
+  # rx charclass_q s r 0..-1
+    sub $I10, rx512_pos, rx512_off
+    find_not_cclass $I11, 32, rx512_tgt, $I10, rx512_eos
+    add rx512_pos, rx512_off, $I11
+  # rx literal  "-"
+    add $I11, rx512_pos, 1
+    gt $I11, rx512_eos, rx512_fail
+    sub $I11, rx512_pos, rx512_off
+    substr $S10, rx512_tgt, $I11, 1
+    ne $S10, "-", rx512_fail
+    add rx512_pos, 1
+  # rx subrule "obs" subtype=method negate=
+    rx512_cur."!cursor_pos"(rx512_pos)
+    $P10 = rx512_cur."obs"("hyphen in enumerated character class", "..")
+    unless $P10, rx512_fail
+    rx512_pos = $P10."pos"()
+    goto alt514_end
+  alt514_1:
+.annotate "line", 166
+  # rx charclass_q s r 0..-1
+    sub $I10, rx512_pos, rx512_off
+    find_not_cclass $I11, 32, rx512_tgt, $I10, rx512_eos
+    add rx512_pos, rx512_off, $I11
+  alt515_0:
+    set_addr $I10, alt515_1
+    rx512_cur."!mark_push"(0, rx512_pos, $I10)
+  # rx literal  "\\"
+    add $I11, rx512_pos, 1
+    gt $I11, rx512_eos, rx512_fail
+    sub $I11, rx512_pos, rx512_off
+    substr $S10, rx512_tgt, $I11, 1
+    ne $S10, "\\", rx512_fail
+    add rx512_pos, 1
+  # rx subrule $P517 subtype=capture negate=
+    rx512_cur."!cursor_pos"(rx512_pos)
+    .const 'Sub' $P517 = "144_1261064009.3328" 
+    capture_lex $P517
+    $P10 = rx512_cur.$P517()
+    unless $P10, rx512_fail
+    rx512_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"(0)
+    rx512_pos = $P10."pos"()
+    goto alt515_end
+  alt515_1:
+  # rx subrule $P521 subtype=capture negate=
+    rx512_cur."!cursor_pos"(rx512_pos)
+    .const 'Sub' $P521 = "145_1261064009.3328" 
+    capture_lex $P521
+    $P10 = rx512_cur.$P521()
+    unless $P10, rx512_fail
+    rx512_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"(0)
+    rx512_pos = $P10."pos"()
+  alt515_end:
+  # rx rxquantr524 ** 0..1
+    set_addr $I529, rxquantr524_done
+    rx512_cur."!mark_push"(0, rx512_pos, $I529)
+  rxquantr524_loop:
+  # rx charclass_q s r 0..-1
+    sub $I10, rx512_pos, rx512_off
+    find_not_cclass $I11, 32, rx512_tgt, $I10, rx512_eos
+    add rx512_pos, rx512_off, $I11
+  # rx literal  ".."
+    add $I11, rx512_pos, 2
+    gt $I11, rx512_eos, rx512_fail
+    sub $I11, rx512_pos, rx512_off
+    substr $S10, rx512_tgt, $I11, 2
+    ne $S10, "..", rx512_fail
+    add rx512_pos, 2
+  # rx charclass_q s r 0..-1
+    sub $I10, rx512_pos, rx512_off
+    find_not_cclass $I11, 32, rx512_tgt, $I10, rx512_eos
+    add rx512_pos, rx512_off, $I11
+  # rx subrule $P526 subtype=capture negate=
+    rx512_cur."!cursor_pos"(rx512_pos)
+    .const 'Sub' $P526 = "146_1261064009.3328" 
+    capture_lex $P526
+    $P10 = rx512_cur.$P526()
+    unless $P10, rx512_fail
+    rx512_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("1")
+    rx512_pos = $P10."pos"()
+    (rx512_rep) = rx512_cur."!mark_commit"($I529)
+  rxquantr524_done:
+  alt514_end:
+.annotate "line", 164
+  # rx pass
+    rx512_cur."!cursor_pass"(rx512_pos, "")
+    rx512_cur."!cursor_debug"("PASS  ", "", " at pos=", rx512_pos)
+    .return (rx512_cur)
+  rx512_fail:
+    (rx512_rep, rx512_pos, $I10, $P10) = rx512_cur."!mark_fail"(0)
+    lt rx512_pos, -1, rx512_done
+    eq rx512_pos, -1, rx512_fail
+    jump $I10
+  rx512_done:
+    rx512_cur."!cursor_fail"()
+    rx512_cur."!cursor_debug"("FAIL  ", "")
+    .return (rx512_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "_block516"  :anon :subid("144_1261064009.3328") :method :outer("143_1261064009.3328")
+.annotate "line", 166
+    .local string rx518_tgt
+    .local int rx518_pos
+    .local int rx518_off
+    .local int rx518_eos
+    .local int rx518_rep
+    .local pmc rx518_cur
+    (rx518_cur, rx518_pos, rx518_tgt) = self."!cursor_start"()
+    rx518_cur."!cursor_debug"("START ", "")
+    .lex unicode:"$\x{a2}", rx518_cur
+    .local pmc match
+    .lex "$/", match
+    length rx518_eos, rx518_tgt
+    set rx518_off, 0
+    lt rx518_pos, 2, rx518_start
+    sub rx518_off, rx518_pos, 1
+    substr rx518_tgt, rx518_tgt, rx518_off
+  rx518_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan519_done
+    goto rxscan519_scan
+  rxscan519_loop:
+    ($P10) = rx518_cur."from"()
+    inc $P10
+    set rx518_pos, $P10
+    ge rx518_pos, rx518_eos, rxscan519_done
+  rxscan519_scan:
+    set_addr $I10, rxscan519_loop
+    rx518_cur."!mark_push"(0, rx518_pos, $I10)
+  rxscan519_done:
+  # rx charclass .
+    ge rx518_pos, rx518_eos, rx518_fail
+    inc rx518_pos
+  # rx pass
+    rx518_cur."!cursor_pass"(rx518_pos, "")
+    rx518_cur."!cursor_debug"("PASS  ", "", " at pos=", rx518_pos)
+    .return (rx518_cur)
+  rx518_fail:
+    (rx518_rep, rx518_pos, $I10, $P10) = rx518_cur."!mark_fail"(0)
+    lt rx518_pos, -1, rx518_done
+    eq rx518_pos, -1, rx518_fail
+    jump $I10
+  rx518_done:
+    rx518_cur."!cursor_fail"()
+    rx518_cur."!cursor_debug"("FAIL  ", "")
+    .return (rx518_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "_block520"  :anon :subid("145_1261064009.3328") :method :outer("143_1261064009.3328")
+.annotate "line", 166
+    .local string rx522_tgt
+    .local int rx522_pos
+    .local int rx522_off
+    .local int rx522_eos
+    .local int rx522_rep
+    .local pmc rx522_cur
+    (rx522_cur, rx522_pos, rx522_tgt) = self."!cursor_start"()
+    rx522_cur."!cursor_debug"("START ", "")
+    .lex unicode:"$\x{a2}", rx522_cur
+    .local pmc match
+    .lex "$/", match
+    length rx522_eos, rx522_tgt
+    set rx522_off, 0
+    lt rx522_pos, 2, rx522_start
+    sub rx522_off, rx522_pos, 1
+    substr rx522_tgt, rx522_tgt, rx522_off
+  rx522_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan523_done
+    goto rxscan523_scan
+  rxscan523_loop:
+    ($P10) = rx522_cur."from"()
+    inc $P10
+    set rx522_pos, $P10
+    ge rx522_pos, rx522_eos, rxscan523_done
+  rxscan523_scan:
+    set_addr $I10, rxscan523_loop
+    rx522_cur."!mark_push"(0, rx522_pos, $I10)
+  rxscan523_done:
+  # rx enumcharlist negate=1 
+    ge rx522_pos, rx522_eos, rx522_fail
+    sub $I10, rx522_pos, rx522_off
+    substr $S10, rx522_tgt, $I10, 1
+    index $I11, "]\\", $S10
+    ge $I11, 0, rx522_fail
+    inc rx522_pos
+  # rx pass
+    rx522_cur."!cursor_pass"(rx522_pos, "")
+    rx522_cur."!cursor_debug"("PASS  ", "", " at pos=", rx522_pos)
+    .return (rx522_cur)
+  rx522_fail:
+    (rx522_rep, rx522_pos, $I10, $P10) = rx522_cur."!mark_fail"(0)
+    lt rx522_pos, -1, rx522_done
+    eq rx522_pos, -1, rx522_fail
+    jump $I10
+  rx522_done:
+    rx522_cur."!cursor_fail"()
+    rx522_cur."!cursor_debug"("FAIL  ", "")
+    .return (rx522_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "_block525"  :anon :subid("146_1261064009.3328") :method :outer("143_1261064009.3328")
+.annotate "line", 166
+    .local string rx527_tgt
+    .local int rx527_pos
+    .local int rx527_off
+    .local int rx527_eos
+    .local int rx527_rep
+    .local pmc rx527_cur
+    (rx527_cur, rx527_pos, rx527_tgt) = self."!cursor_start"()
+    rx527_cur."!cursor_debug"("START ", "")
+    .lex unicode:"$\x{a2}", rx527_cur
+    .local pmc match
+    .lex "$/", match
+    length rx527_eos, rx527_tgt
+    set rx527_off, 0
+    lt rx527_pos, 2, rx527_start
+    sub rx527_off, rx527_pos, 1
+    substr rx527_tgt, rx527_tgt, rx527_off
+  rx527_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan528_done
+    goto rxscan528_scan
+  rxscan528_loop:
+    ($P10) = rx527_cur."from"()
+    inc $P10
+    set rx527_pos, $P10
+    ge rx527_pos, rx527_eos, rxscan528_done
+  rxscan528_scan:
+    set_addr $I10, rxscan528_loop
+    rx527_cur."!mark_push"(0, rx527_pos, $I10)
+  rxscan528_done:
+  # rx charclass .
+    ge rx527_pos, rx527_eos, rx527_fail
+    inc rx527_pos
+  # rx pass
+    rx527_cur."!cursor_pass"(rx527_pos, "")
+    rx527_cur."!cursor_debug"("PASS  ", "", " at pos=", rx527_pos)
+    .return (rx527_cur)
+  rx527_fail:
+    (rx527_rep, rx527_pos, $I10, $P10) = rx527_cur."!mark_fail"(0)
+    lt rx527_pos, -1, rx527_done
+    eq rx527_pos, -1, rx527_fail
+    jump $I10
+  rx527_done:
+    rx527_cur."!cursor_fail"()
+    rx527_cur."!cursor_debug"("FAIL  ", "")
+    .return (rx527_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "mod_internal"  :subid("147_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .const 'Sub' $P543 = "149_1261064009.3328" 
+    capture_lex $P543
+    .local string rx535_tgt
+    .local int rx535_pos
+    .local int rx535_off
+    .local int rx535_eos
+    .local int rx535_rep
+    .local pmc rx535_cur
+    (rx535_cur, rx535_pos, rx535_tgt) = self."!cursor_start"()
+    rx535_cur."!cursor_debug"("START ", "mod_internal")
+    rx535_cur."!cursor_caparray"("n")
+    .lex unicode:"$\x{a2}", rx535_cur
+    .local pmc match
+    .lex "$/", match
+    length rx535_eos, rx535_tgt
+    set rx535_off, 0
+    lt rx535_pos, 2, rx535_start
+    sub rx535_off, rx535_pos, 1
+    substr rx535_tgt, rx535_tgt, rx535_off
+  rx535_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan539_done
+    goto rxscan539_scan
+  rxscan539_loop:
+    ($P10) = rx535_cur."from"()
+    inc $P10
+    set rx535_pos, $P10
+    ge rx535_pos, rx535_eos, rxscan539_done
+  rxscan539_scan:
+    set_addr $I10, rxscan539_loop
+    rx535_cur."!mark_push"(0, rx535_pos, $I10)
+  rxscan539_done:
+  alt540_0:
+.annotate "line", 175
+    set_addr $I10, alt540_1
+    rx535_cur."!mark_push"(0, rx535_pos, $I10)
+.annotate "line", 176
+  # rx literal  ":"
+    add $I11, rx535_pos, 1
+    gt $I11, rx535_eos, rx535_fail
+    sub $I11, rx535_pos, rx535_off
+    substr $S10, rx535_tgt, $I11, 1
+    ne $S10, ":", rx535_fail
+    add rx535_pos, 1
+  # rx rxquantr541 ** 1..1
+    set_addr $I547, rxquantr541_done
+    rx535_cur."!mark_push"(0, -1, $I547)
+  rxquantr541_loop:
+  # rx subrule $P543 subtype=capture negate=
+    rx535_cur."!cursor_pos"(rx535_pos)
+    .const 'Sub' $P543 = "149_1261064009.3328" 
+    capture_lex $P543
+    $P10 = rx535_cur.$P543()
+    unless $P10, rx535_fail
+    rx535_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("n")
+    rx535_pos = $P10."pos"()
+    (rx535_rep) = rx535_cur."!mark_commit"($I547)
+  rxquantr541_done:
+  # rx subrule "mod_ident" subtype=capture negate=
+    rx535_cur."!cursor_pos"(rx535_pos)
+    $P10 = rx535_cur."mod_ident"()
+    unless $P10, rx535_fail
+    rx535_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("mod_ident")
+    rx535_pos = $P10."pos"()
+  # rxanchor rwb
+    le rx535_pos, 0, rx535_fail
+    sub $I10, rx535_pos, rx535_off
+    is_cclass $I11, 8192, rx535_tgt, $I10
+    if $I11, rx535_fail
+    dec $I10
+    is_cclass $I11, 8192, rx535_tgt, $I10
+    unless $I11, rx535_fail
+    goto alt540_end
+  alt540_1:
+.annotate "line", 177
+  # rx literal  ":"
+    add $I11, rx535_pos, 1
+    gt $I11, rx535_eos, rx535_fail
+    sub $I11, rx535_pos, rx535_off
+    substr $S10, rx535_tgt, $I11, 1
+    ne $S10, ":", rx535_fail
+    add rx535_pos, 1
+  # rx subrule "mod_ident" subtype=capture negate=
+    rx535_cur."!cursor_pos"(rx535_pos)
+    $P10 = rx535_cur."mod_ident"()
+    unless $P10, rx535_fail
+    rx535_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("mod_ident")
+    rx535_pos = $P10."pos"()
+  # rx rxquantr548 ** 0..1
+    set_addr $I550, rxquantr548_done
+    rx535_cur."!mark_push"(0, rx535_pos, $I550)
+  rxquantr548_loop:
+  # rx literal  "("
+    add $I11, rx535_pos, 1
+    gt $I11, rx535_eos, rx535_fail
+    sub $I11, rx535_pos, rx535_off
+    substr $S10, rx535_tgt, $I11, 1
+    ne $S10, "(", rx535_fail
+    add rx535_pos, 1
+  # rx subcapture "n"
+    set_addr $I10, rxcap_549_fail
+    rx535_cur."!mark_push"(0, rx535_pos, $I10)
+  # rx charclass_q d r 1..-1
+    sub $I10, rx535_pos, rx535_off
+    find_not_cclass $I11, 8, rx535_tgt, $I10, rx535_eos
+    add $I12, $I10, 1
+    lt $I11, $I12, rx535_fail
+    add rx535_pos, rx535_off, $I11
+    set_addr $I10, rxcap_549_fail
+    ($I12, $I11) = rx535_cur."!mark_peek"($I10)
+    rx535_cur."!cursor_pos"($I11)
+    ($P10) = rx535_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx535_pos, "")
+    rx535_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("n")
+    goto rxcap_549_done
+  rxcap_549_fail:
+    goto rx535_fail
+  rxcap_549_done:
+  # rx literal  ")"
+    add $I11, rx535_pos, 1
+    gt $I11, rx535_eos, rx535_fail
+    sub $I11, rx535_pos, rx535_off
+    substr $S10, rx535_tgt, $I11, 1
+    ne $S10, ")", rx535_fail
+    add rx535_pos, 1
+    (rx535_rep) = rx535_cur."!mark_commit"($I550)
+  rxquantr548_done:
+  alt540_end:
+.annotate "line", 174
+  # rx pass
+    rx535_cur."!cursor_pass"(rx535_pos, "mod_internal")
+    rx535_cur."!cursor_debug"("PASS  ", "mod_internal", " at pos=", rx535_pos)
+    .return (rx535_cur)
+  rx535_fail:
+.annotate "line", 3
+    (rx535_rep, rx535_pos, $I10, $P10) = rx535_cur."!mark_fail"(0)
+    lt rx535_pos, -1, rx535_done
+    eq rx535_pos, -1, rx535_fail
+    jump $I10
+  rx535_done:
+    rx535_cur."!cursor_fail"()
+    rx535_cur."!cursor_debug"("FAIL  ", "mod_internal")
+    .return (rx535_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__mod_internal"  :subid("148_1261064009.3328") :method
+.annotate "line", 3
+    $P537 = self."!PREFIX__!subrule"("mod_ident", ":")
+    new $P538, "ResizablePMCArray"
+    push $P538, $P537
+    push $P538, ":"
+    .return ($P538)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "_block542"  :anon :subid("149_1261064009.3328") :method :outer("147_1261064009.3328")
+.annotate "line", 176
+    .local string rx544_tgt
+    .local int rx544_pos
+    .local int rx544_off
+    .local int rx544_eos
+    .local int rx544_rep
+    .local pmc rx544_cur
+    (rx544_cur, rx544_pos, rx544_tgt) = self."!cursor_start"()
+    rx544_cur."!cursor_debug"("START ", "")
+    .lex unicode:"$\x{a2}", rx544_cur
+    .local pmc match
+    .lex "$/", match
+    length rx544_eos, rx544_tgt
+    set rx544_off, 0
+    lt rx544_pos, 2, rx544_start
+    sub rx544_off, rx544_pos, 1
+    substr rx544_tgt, rx544_tgt, rx544_off
+  rx544_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan545_done
+    goto rxscan545_scan
+  rxscan545_loop:
+    ($P10) = rx544_cur."from"()
+    inc $P10
+    set rx544_pos, $P10
+    ge rx544_pos, rx544_eos, rxscan545_done
+  rxscan545_scan:
+    set_addr $I10, rxscan545_loop
+    rx544_cur."!mark_push"(0, rx544_pos, $I10)
+  rxscan545_done:
+  alt546_0:
+    set_addr $I10, alt546_1
+    rx544_cur."!mark_push"(0, rx544_pos, $I10)
+  # rx literal  "!"
+    add $I11, rx544_pos, 1
+    gt $I11, rx544_eos, rx544_fail
+    sub $I11, rx544_pos, rx544_off
+    substr $S10, rx544_tgt, $I11, 1
+    ne $S10, "!", rx544_fail
+    add rx544_pos, 1
+    goto alt546_end
+  alt546_1:
+  # rx charclass_q d r 1..-1
+    sub $I10, rx544_pos, rx544_off
+    find_not_cclass $I11, 8, rx544_tgt, $I10, rx544_eos
+    add $I12, $I10, 1
+    lt $I11, $I12, rx544_fail
+    add rx544_pos, rx544_off, $I11
+  alt546_end:
+  # rx pass
+    rx544_cur."!cursor_pass"(rx544_pos, "")
+    rx544_cur."!cursor_debug"("PASS  ", "", " at pos=", rx544_pos)
+    .return (rx544_cur)
+  rx544_fail:
+    (rx544_rep, rx544_pos, $I10, $P10) = rx544_cur."!mark_fail"(0)
+    lt rx544_pos, -1, rx544_done
+    eq rx544_pos, -1, rx544_fail
+    jump $I10
+  rx544_done:
+    rx544_cur."!cursor_fail"()
+    rx544_cur."!cursor_debug"("FAIL  ", "")
+    .return (rx544_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "mod_ident"  :subid("150_1261064009.3328") :method
+.annotate "line", 181
+    $P552 = self."!protoregex"("mod_ident")
+    .return ($P552)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__mod_ident"  :subid("151_1261064009.3328") :method
+.annotate "line", 181
+    $P554 = self."!PREFIX__!protoregex"("mod_ident")
+    .return ($P554)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "mod_ident:sym<ignorecase>"  :subid("152_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx556_tgt
+    .local int rx556_pos
+    .local int rx556_off
+    .local int rx556_eos
+    .local int rx556_rep
+    .local pmc rx556_cur
+    (rx556_cur, rx556_pos, rx556_tgt) = self."!cursor_start"()
+    rx556_cur."!cursor_debug"("START ", "mod_ident:sym<ignorecase>")
+    .lex unicode:"$\x{a2}", rx556_cur
+    .local pmc match
+    .lex "$/", match
+    length rx556_eos, rx556_tgt
+    set rx556_off, 0
+    lt rx556_pos, 2, rx556_start
+    sub rx556_off, rx556_pos, 1
+    substr rx556_tgt, rx556_tgt, rx556_off
+  rx556_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan559_done
+    goto rxscan559_scan
+  rxscan559_loop:
+    ($P10) = rx556_cur."from"()
+    inc $P10
+    set rx556_pos, $P10
+    ge rx556_pos, rx556_eos, rxscan559_done
+  rxscan559_scan:
+    set_addr $I10, rxscan559_loop
+    rx556_cur."!mark_push"(0, rx556_pos, $I10)
+  rxscan559_done:
+.annotate "line", 182
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_560_fail
+    rx556_cur."!mark_push"(0, rx556_pos, $I10)
+  # rx literal  "i"
+    add $I11, rx556_pos, 1
+    gt $I11, rx556_eos, rx556_fail
+    sub $I11, rx556_pos, rx556_off
+    substr $S10, rx556_tgt, $I11, 1
+    ne $S10, "i", rx556_fail
+    add rx556_pos, 1
+    set_addr $I10, rxcap_560_fail
+    ($I12, $I11) = rx556_cur."!mark_peek"($I10)
+    rx556_cur."!cursor_pos"($I11)
+    ($P10) = rx556_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx556_pos, "")
+    rx556_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_560_done
+  rxcap_560_fail:
+    goto rx556_fail
+  rxcap_560_done:
+  # rx rxquantr561 ** 0..1
+    set_addr $I562, rxquantr561_done
+    rx556_cur."!mark_push"(0, rx556_pos, $I562)
+  rxquantr561_loop:
+  # rx literal  "gnorecase"
+    add $I11, rx556_pos, 9
+    gt $I11, rx556_eos, rx556_fail
+    sub $I11, rx556_pos, rx556_off
+    substr $S10, rx556_tgt, $I11, 9
+    ne $S10, "gnorecase", rx556_fail
+    add rx556_pos, 9
+    (rx556_rep) = rx556_cur."!mark_commit"($I562)
+  rxquantr561_done:
+  # rx pass
+    rx556_cur."!cursor_pass"(rx556_pos, "mod_ident:sym<ignorecase>")
+    rx556_cur."!cursor_debug"("PASS  ", "mod_ident:sym<ignorecase>", " at pos=", rx556_pos)
+    .return (rx556_cur)
+  rx556_fail:
+.annotate "line", 3
+    (rx556_rep, rx556_pos, $I10, $P10) = rx556_cur."!mark_fail"(0)
+    lt rx556_pos, -1, rx556_done
+    eq rx556_pos, -1, rx556_fail
+    jump $I10
+  rx556_done:
+    rx556_cur."!cursor_fail"()
+    rx556_cur."!cursor_debug"("FAIL  ", "mod_ident:sym<ignorecase>")
+    .return (rx556_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__mod_ident:sym<ignorecase>"  :subid("153_1261064009.3328") :method
+.annotate "line", 3
+    new $P558, "ResizablePMCArray"
+    push $P558, "i"
+    .return ($P558)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "mod_ident:sym<ratchet>"  :subid("154_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx564_tgt
+    .local int rx564_pos
+    .local int rx564_off
+    .local int rx564_eos
+    .local int rx564_rep
+    .local pmc rx564_cur
+    (rx564_cur, rx564_pos, rx564_tgt) = self."!cursor_start"()
+    rx564_cur."!cursor_debug"("START ", "mod_ident:sym<ratchet>")
+    .lex unicode:"$\x{a2}", rx564_cur
+    .local pmc match
+    .lex "$/", match
+    length rx564_eos, rx564_tgt
+    set rx564_off, 0
+    lt rx564_pos, 2, rx564_start
+    sub rx564_off, rx564_pos, 1
+    substr rx564_tgt, rx564_tgt, rx564_off
+  rx564_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan567_done
+    goto rxscan567_scan
+  rxscan567_loop:
+    ($P10) = rx564_cur."from"()
+    inc $P10
+    set rx564_pos, $P10
+    ge rx564_pos, rx564_eos, rxscan567_done
+  rxscan567_scan:
+    set_addr $I10, rxscan567_loop
+    rx564_cur."!mark_push"(0, rx564_pos, $I10)
+  rxscan567_done:
+.annotate "line", 183
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_568_fail
+    rx564_cur."!mark_push"(0, rx564_pos, $I10)
+  # rx literal  "r"
+    add $I11, rx564_pos, 1
+    gt $I11, rx564_eos, rx564_fail
+    sub $I11, rx564_pos, rx564_off
+    substr $S10, rx564_tgt, $I11, 1
+    ne $S10, "r", rx564_fail
+    add rx564_pos, 1
+    set_addr $I10, rxcap_568_fail
+    ($I12, $I11) = rx564_cur."!mark_peek"($I10)
+    rx564_cur."!cursor_pos"($I11)
+    ($P10) = rx564_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx564_pos, "")
+    rx564_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_568_done
+  rxcap_568_fail:
+    goto rx564_fail
+  rxcap_568_done:
+  # rx rxquantr569 ** 0..1
+    set_addr $I570, rxquantr569_done
+    rx564_cur."!mark_push"(0, rx564_pos, $I570)
+  rxquantr569_loop:
+  # rx literal  "atchet"
+    add $I11, rx564_pos, 6
+    gt $I11, rx564_eos, rx564_fail
+    sub $I11, rx564_pos, rx564_off
+    substr $S10, rx564_tgt, $I11, 6
+    ne $S10, "atchet", rx564_fail
+    add rx564_pos, 6
+    (rx564_rep) = rx564_cur."!mark_commit"($I570)
+  rxquantr569_done:
+  # rx pass
+    rx564_cur."!cursor_pass"(rx564_pos, "mod_ident:sym<ratchet>")
+    rx564_cur."!cursor_debug"("PASS  ", "mod_ident:sym<ratchet>", " at pos=", rx564_pos)
+    .return (rx564_cur)
+  rx564_fail:
+.annotate "line", 3
+    (rx564_rep, rx564_pos, $I10, $P10) = rx564_cur."!mark_fail"(0)
+    lt rx564_pos, -1, rx564_done
+    eq rx564_pos, -1, rx564_fail
+    jump $I10
+  rx564_done:
+    rx564_cur."!cursor_fail"()
+    rx564_cur."!cursor_debug"("FAIL  ", "mod_ident:sym<ratchet>")
+    .return (rx564_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__mod_ident:sym<ratchet>"  :subid("155_1261064009.3328") :method
+.annotate "line", 3
+    new $P566, "ResizablePMCArray"
+    push $P566, "r"
+    .return ($P566)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "mod_ident:sym<sigspace>"  :subid("156_1261064009.3328") :method :outer("11_1261064009.3328")
+.annotate "line", 3
+    .local string rx572_tgt
+    .local int rx572_pos
+    .local int rx572_off
+    .local int rx572_eos
+    .local int rx572_rep
+    .local pmc rx572_cur
+    (rx572_cur, rx572_pos, rx572_tgt) = self."!cursor_start"()
+    rx572_cur."!cursor_debug"("START ", "mod_ident:sym<sigspace>")
+    .lex unicode:"$\x{a2}", rx572_cur
+    .local pmc match
+    .lex "$/", match
+    length rx572_eos, rx572_tgt
+    set rx572_off, 0
+    lt rx572_pos, 2, rx572_start
+    sub rx572_off, rx572_pos, 1
+    substr rx572_tgt, rx572_tgt, rx572_off
+  rx572_start:
+    $I10 = self.'from'()
+    ne $I10, -1, rxscan575_done
+    goto rxscan575_scan
+  rxscan575_loop:
+    ($P10) = rx572_cur."from"()
+    inc $P10
+    set rx572_pos, $P10
+    ge rx572_pos, rx572_eos, rxscan575_done
+  rxscan575_scan:
+    set_addr $I10, rxscan575_loop
+    rx572_cur."!mark_push"(0, rx572_pos, $I10)
+  rxscan575_done:
+.annotate "line", 184
+  # rx subcapture "sym"
+    set_addr $I10, rxcap_576_fail
+    rx572_cur."!mark_push"(0, rx572_pos, $I10)
+  # rx literal  "s"
+    add $I11, rx572_pos, 1
+    gt $I11, rx572_eos, rx572_fail
+    sub $I11, rx572_pos, rx572_off
+    substr $S10, rx572_tgt, $I11, 1
+    ne $S10, "s", rx572_fail
+    add rx572_pos, 1
+    set_addr $I10, rxcap_576_fail
+    ($I12, $I11) = rx572_cur."!mark_peek"($I10)
+    rx572_cur."!cursor_pos"($I11)
+    ($P10) = rx572_cur."!cursor_start"()
+    $P10."!cursor_pass"(rx572_pos, "")
+    rx572_cur."!mark_push"(0, -1, 0, $P10)
+    $P10."!cursor_names"("sym")
+    goto rxcap_576_done
+  rxcap_576_fail:
+    goto rx572_fail
+  rxcap_576_done:
+  # rx rxquantr577 ** 0..1
+    set_addr $I578, rxquantr577_done
+    rx572_cur."!mark_push"(0, rx572_pos, $I578)
+  rxquantr577_loop:
+  # rx literal  "igspace"
+    add $I11, rx572_pos, 7
+    gt $I11, rx572_eos, rx572_fail
+    sub $I11, rx572_pos, rx572_off
+    substr $S10, rx572_tgt, $I11, 7
+    ne $S10, "igspace", rx572_fail
+    add rx572_pos, 7
+    (rx572_rep) = rx572_cur."!mark_commit"($I578)
+  rxquantr577_done:
+  # rx pass
+    rx572_cur."!cursor_pass"(rx572_pos, "mod_ident:sym<sigspace>")
+    rx572_cur."!cursor_debug"("PASS  ", "mod_ident:sym<sigspace>", " at pos=", rx572_pos)
+    .return (rx572_cur)
+  rx572_fail:
+.annotate "line", 3
+    (rx572_rep, rx572_pos, $I10, $P10) = rx572_cur."!mark_fail"(0)
+    lt rx572_pos, -1, rx572_done
+    eq rx572_pos, -1, rx572_fail
+    jump $I10
+  rx572_done:
+    rx572_cur."!cursor_fail"()
+    rx572_cur."!cursor_debug"("FAIL  ", "mod_ident:sym<sigspace>")
+    .return (rx572_cur)
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Grammar"]
+.sub "!PREFIX__mod_ident:sym<sigspace>"  :subid("157_1261064009.3328") :method
+.annotate "line", 3
+    new $P574, "ResizablePMCArray"
+    push $P574, "s"
+    .return ($P574)
+.end
+
+### .include 'gen/p6regex-actions.pir'
+
+.namespace []
+.sub "_block11"  :anon :subid("10_1261064016.27984")
+.annotate "line", 0
+    get_hll_global $P14, ["Regex";"P6Regex";"Actions"], "_block13" 
+    capture_lex $P14
+.annotate "line", 4
+    get_hll_global $P14, ["Regex";"P6Regex";"Actions"], "_block13" 
+    capture_lex $P14
+    $P1556 = $P14()
+.annotate "line", 1
+    .return ($P1556)
+.end
+
+
+.namespace []
+.sub "" :load :init :subid("post89") :outer("10_1261064016.27984")
+.annotate "line", 0
+    .const 'Sub' $P12 = "10_1261064016.27984" 
+    .local pmc block
+    set block, $P12
+    $P1557 = get_root_global ["parrot"], "P6metaclass"
+    $P1557."new_class"("Regex::P6Regex::Actions", "HLL::Actions" :named("parent"))
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "_block13"  :subid("11_1261064016.27984") :outer("10_1261064016.27984")
+.annotate "line", 4
+    .const 'Sub' $P1523 = "88_1261064016.27984" 
+    capture_lex $P1523
+    .const 'Sub' $P1454 = "84_1261064016.27984" 
+    capture_lex $P1454
+    .const 'Sub' $P1386 = "82_1261064016.27984" 
+    capture_lex $P1386
+    .const 'Sub' $P1313 = "79_1261064016.27984" 
+    capture_lex $P1313
+    .const 'Sub' $P1299 = "78_1261064016.27984" 
+    capture_lex $P1299
+    .const 'Sub' $P1275 = "77_1261064016.27984" 
+    capture_lex $P1275
+    .const 'Sub' $P1257 = "76_1261064016.27984" 
+    capture_lex $P1257
+    .const 'Sub' $P1243 = "75_1261064016.27984" 
+    capture_lex $P1243
+    .const 'Sub' $P1212 = "74_1261064016.27984" 
+    capture_lex $P1212
+    .const 'Sub' $P1181 = "73_1261064016.27984" 
+    capture_lex $P1181
+    .const 'Sub' $P1165 = "72_1261064016.27984" 
+    capture_lex $P1165
+    .const 'Sub' $P1149 = "71_1261064016.27984" 
+    capture_lex $P1149
+    .const 'Sub' $P1133 = "70_1261064016.27984" 
+    capture_lex $P1133
+    .const 'Sub' $P1117 = "69_1261064016.27984" 
+    capture_lex $P1117
+    .const 'Sub' $P1101 = "68_1261064016.27984" 
+    capture_lex $P1101
+    .const 'Sub' $P1085 = "67_1261064016.27984" 
+    capture_lex $P1085
+    .const 'Sub' $P1069 = "66_1261064016.27984" 
+    capture_lex $P1069
+    .const 'Sub' $P1045 = "65_1261064016.27984" 
+    capture_lex $P1045
+    .const 'Sub' $P1030 = "64_1261064016.27984" 
+    capture_lex $P1030
+    .const 'Sub' $P974 = "63_1261064016.27984" 
+    capture_lex $P974
+    .const 'Sub' $P953 = "62_1261064016.27984" 
+    capture_lex $P953
+    .const 'Sub' $P931 = "61_1261064016.27984" 
+    capture_lex $P931
+    .const 'Sub' $P921 = "60_1261064016.27984" 
+    capture_lex $P921
+    .const 'Sub' $P911 = "59_1261064016.27984" 
+    capture_lex $P911
+    .const 'Sub' $P901 = "58_1261064016.27984" 
+    capture_lex $P901
+    .const 'Sub' $P889 = "57_1261064016.27984" 
+    capture_lex $P889
+    .const 'Sub' $P877 = "56_1261064016.27984" 
+    capture_lex $P877
+    .const 'Sub' $P865 = "55_1261064016.27984" 
+    capture_lex $P865
+    .const 'Sub' $P853 = "54_1261064016.27984" 
+    capture_lex $P853
+    .const 'Sub' $P841 = "53_1261064016.27984" 
+    capture_lex $P841
+    .const 'Sub' $P829 = "52_1261064016.27984" 
+    capture_lex $P829
+    .const 'Sub' $P817 = "51_1261064016.27984" 
+    capture_lex $P817
+    .const 'Sub' $P805 = "50_1261064016.27984" 
+    capture_lex $P805
+    .const 'Sub' $P782 = "49_1261064016.27984" 
+    capture_lex $P782
+    .const 'Sub' $P759 = "48_1261064016.27984" 
+    capture_lex $P759
+    .const 'Sub' $P741 = "47_1261064016.27984" 
+    capture_lex $P741
+    .const 'Sub' $P731 = "46_1261064016.27984" 
+    capture_lex $P731
+    .const 'Sub' $P713 = "45_1261064016.27984" 
+    capture_lex $P713
+    .const 'Sub' $P666 = "44_1261064016.27984" 
+    capture_lex $P666
+    .const 'Sub' $P649 = "43_1261064016.27984" 
+    capture_lex $P649
+    .const 'Sub' $P634 = "42_1261064016.27984" 
+    capture_lex $P634
+    .const 'Sub' $P619 = "41_1261064016.27984" 
+    capture_lex $P619
+    .const 'Sub' $P593 = "40_1261064016.27984" 
+    capture_lex $P593
+    .const 'Sub' $P543 = "38_1261064016.27984" 
+    capture_lex $P543
+    .const 'Sub' $P475 = "36_1261064016.27984" 
+    capture_lex $P475
+    .const 'Sub' $P420 = "33_1261064016.27984" 
+    capture_lex $P420
+    .const 'Sub' $P405 = "32_1261064016.27984" 
+    capture_lex $P405
+    .const 'Sub' $P379 = "30_1261064016.27984" 
+    capture_lex $P379
+    .const 'Sub' $P362 = "29_1261064016.27984" 
+    capture_lex $P362
+    .const 'Sub' $P340 = "28_1261064016.27984" 
+    capture_lex $P340
+    .const 'Sub' $P308 = "27_1261064016.27984" 
+    capture_lex $P308
+    .const 'Sub' $P54 = "14_1261064016.27984" 
+    capture_lex $P54
+    .const 'Sub' $P21 = "13_1261064016.27984" 
+    capture_lex $P21
+    .const 'Sub' $P16 = "12_1261064016.27984" 
+    capture_lex $P16
+    get_global $P15, "@MODIFIERS"
+    unless_null $P15, vivify_90
+    new $P15, "ResizablePMCArray"
+    set_global "@MODIFIERS", $P15
+  vivify_90:
+.annotate "line", 6
+    .const 'Sub' $P16 = "12_1261064016.27984" 
+    capture_lex $P16
+    .lex "INIT", $P16
+.annotate "line", 475
+    .const 'Sub' $P21 = "13_1261064016.27984" 
+    capture_lex $P21
+    .lex "buildsub", $P21
+.annotate "line", 492
+    .const 'Sub' $P54 = "14_1261064016.27984" 
+    capture_lex $P54
+    .lex "capnames", $P54
+.annotate "line", 558
+    .const 'Sub' $P308 = "27_1261064016.27984" 
+    capture_lex $P308
+    .lex "backmod", $P308
+.annotate "line", 565
+    .const 'Sub' $P340 = "28_1261064016.27984" 
+    capture_lex $P340
+    .lex "subrule_alias", $P340
+.annotate "line", 4
+    get_global $P360, "@MODIFIERS"
+    find_lex $P361, "INIT"
+.annotate "line", 468
+    find_lex $P1552, "buildsub"
+    find_lex $P1553, "capnames"
+    find_lex $P1554, "backmod"
+    find_lex $P1555, "subrule_alias"
+.annotate "line", 4
+    .return ($P1555)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "INIT"  :subid("12_1261064016.27984") :outer("11_1261064016.27984")
+.annotate "line", 6
+    new $P18, 'ExceptionHandler'
+    set_addr $P18, control_17
+    $P18."handle_types"(58)
+    push_eh $P18
+.annotate "line", 7
+
+        $P19 = new ['ResizablePMCArray']
+        $P0 = new ['Hash']
+        push $P19, $P0
+    
+    set_global "@MODIFIERS", $P19
+.annotate "line", 6
+    .return ($P19)
+  control_17:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P20, exception, "payload"
+    .return ($P20)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "buildsub"  :subid("13_1261064016.27984") :outer("11_1261064016.27984")
+    .param pmc param_24
+    .param pmc param_25 :optional
+    .param int has_param_25 :opt_flag
+.annotate "line", 475
+    new $P23, 'ExceptionHandler'
+    set_addr $P23, control_22
+    $P23."handle_types"(58)
+    push_eh $P23
+    .lex "$rpast", param_24
+    if has_param_25, optparam_91
+    get_hll_global $P26, ["PAST"], "Block"
+    $P27 = $P26."new"()
+    set param_25, $P27
+  optparam_91:
+    .lex "$block", param_25
+.annotate "line", 476
+    new $P28, "Hash"
+    .lex "%capnames", $P28
+    find_lex $P29, "$rpast"
+    $P30 = "capnames"($P29, 0)
+    store_lex "%capnames", $P30
+.annotate "line", 477
+    new $P31, "Integer"
+    assign $P31, 0
+    find_lex $P32, "%capnames"
+    unless_null $P32, vivify_92
+    new $P32, "Hash"
+    store_lex "%capnames", $P32
+  vivify_92:
+    set $P32[""], $P31
+.annotate "line", 478
+    get_hll_global $P33, ["PAST"], "Regex"
+.annotate "line", 479
+    get_hll_global $P34, ["PAST"], "Regex"
+    $P35 = $P34."new"("scan" :named("pasttype"))
+    find_lex $P36, "$rpast"
+.annotate "line", 481
+    get_hll_global $P37, ["PAST"], "Regex"
+    $P38 = $P37."new"("pass" :named("pasttype"))
+    find_lex $P39, "%capnames"
+    $P40 = $P33."new"($P35, $P36, $P38, "concat" :named("pasttype"), $P39 :named("capnames"))
+.annotate "line", 478
+    store_lex "$rpast", $P40
+.annotate "line", 485
+    find_lex $P42, "$block"
+    $P43 = $P42."symbol"(unicode:"$\x{a2}")
+    if $P43, unless_41_end
+    find_lex $P44, "$block"
+    $P44."symbol"(unicode:"$\x{a2}", "lexical" :named("scope"))
+  unless_41_end:
+.annotate "line", 486
+    find_lex $P46, "$block"
+    $P47 = $P46."symbol"("$/")
+    if $P47, unless_45_end
+    find_lex $P48, "$block"
+    $P48."symbol"("$/", "lexical" :named("scope"))
+  unless_45_end:
+.annotate "line", 487
+    find_lex $P49, "$block"
+    find_lex $P50, "$rpast"
+    $P49."push"($P50)
+.annotate "line", 488
+    find_lex $P51, "$block"
+    $P51."blocktype"("method")
+    find_lex $P52, "$block"
+.annotate "line", 475
+    .return ($P52)
+  control_22:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P53, exception, "payload"
+    .return ($P53)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "capnames"  :subid("14_1261064016.27984") :outer("11_1261064016.27984")
+    .param pmc param_57
+    .param pmc param_58
+.annotate "line", 492
+    .const 'Sub' $P283 = "25_1261064016.27984" 
+    capture_lex $P283
+    .const 'Sub' $P220 = "22_1261064016.27984" 
+    capture_lex $P220
+    .const 'Sub' $P178 = "20_1261064016.27984" 
+    capture_lex $P178
+    .const 'Sub' $P136 = "18_1261064016.27984" 
+    capture_lex $P136
+    .const 'Sub' $P69 = "15_1261064016.27984" 
+    capture_lex $P69
+    new $P56, 'ExceptionHandler'
+    set_addr $P56, control_55
+    $P56."handle_types"(58)
+    push_eh $P56
+    .lex "$ast", param_57
+    .lex "$count", param_58
+.annotate "line", 493
+    new $P59, "Hash"
+    .lex "%capnames", $P59
+.annotate "line", 494
+    new $P60, "Undef"
+    .lex "$pasttype", $P60
+.annotate "line", 492
+    find_lex $P61, "%capnames"
+.annotate "line", 494
+    find_lex $P62, "$ast"
+    $P63 = $P62."pasttype"()
+    store_lex "$pasttype", $P63
+.annotate "line", 495
+    find_lex $P65, "$pasttype"
+    set $S66, $P65
+    iseq $I67, $S66, "alt"
+    if $I67, if_64
+.annotate "line", 508
+    find_lex $P127, "$pasttype"
+    set $S128, $P127
+    iseq $I129, $S128, "concat"
+    if $I129, if_126
+.annotate "line", 517
+    find_lex $P171, "$pasttype"
+    set $S172, $P171
+    iseq $I173, $S172, "subrule"
+    if $I173, if_170
+    new $P169, 'Integer'
+    set $P169, $I173
+    goto if_170_end
+  if_170:
+    find_lex $P174, "$ast"
+    $S175 = $P174."subtype"()
+    iseq $I176, $S175, "capture"
+    new $P169, 'Integer'
+    set $P169, $I176
+  if_170_end:
+    if $P169, if_168
+.annotate "line", 530
+    find_lex $P216, "$pasttype"
+    set $S217, $P216
+    iseq $I218, $S217, "subcapture"
+    if $I218, if_215
+.annotate "line", 547
+    find_lex $P279, "$pasttype"
+    set $S280, $P279
+    iseq $I281, $S280, "quant"
+    unless $I281, if_278_end
+    .const 'Sub' $P283 = "25_1261064016.27984" 
+    capture_lex $P283
+    $P283()
+  if_278_end:
+    goto if_215_end
+  if_215:
+.annotate "line", 530
+    .const 'Sub' $P220 = "22_1261064016.27984" 
+    capture_lex $P220
+    $P220()
+  if_215_end:
+    goto if_168_end
+  if_168:
+.annotate "line", 517
+    .const 'Sub' $P178 = "20_1261064016.27984" 
+    capture_lex $P178
+    $P178()
+  if_168_end:
+    goto if_126_end
+  if_126:
+.annotate "line", 509
+    find_lex $P131, "$ast"
+    $P132 = $P131."list"()
+    defined $I133, $P132
+    unless $I133, for_undef_113
+    iter $P130, $P132
+    new $P166, 'ExceptionHandler'
+    set_addr $P166, loop165_handler
+    $P166."handle_types"(65, 67, 66)
+    push_eh $P166
+  loop165_test:
+    unless $P130, loop165_done
+    shift $P134, $P130
+  loop165_redo:
+    .const 'Sub' $P136 = "18_1261064016.27984" 
+    capture_lex $P136
+    $P136($P134)
+  loop165_next:
+    goto loop165_test
+  loop165_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P167, exception, 'type'
+    eq $P167, 65, loop165_next
+    eq $P167, 67, loop165_redo
+  loop165_done:
+    pop_eh 
+  for_undef_113:
+  if_126_end:
+.annotate "line", 508
+    goto if_64_end
+  if_64:
+.annotate "line", 495
+    .const 'Sub' $P69 = "15_1261064016.27984" 
+    capture_lex $P69
+    $P69()
+  if_64_end:
+.annotate "line", 554
+    find_lex $P304, "$count"
+    find_lex $P305, "%capnames"
+    unless_null $P305, vivify_133
+    new $P305, "Hash"
+    store_lex "%capnames", $P305
+  vivify_133:
+    set $P305[""], $P304
+    find_lex $P306, "%capnames"
+.annotate "line", 492
+    .return ($P306)
+  control_55:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P307, exception, "payload"
+    .return ($P307)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "_block282"  :anon :subid("25_1261064016.27984") :outer("14_1261064016.27984")
+.annotate "line", 547
+    .const 'Sub' $P294 = "26_1261064016.27984" 
+    capture_lex $P294
+.annotate "line", 548
+    new $P284, "Hash"
+    .lex "%astcap", $P284
+    find_lex $P285, "$ast"
+    unless_null $P285, vivify_93
+    new $P285, "ResizablePMCArray"
+  vivify_93:
+    set $P286, $P285[0]
+    unless_null $P286, vivify_94
+    new $P286, "Undef"
+  vivify_94:
+    find_lex $P287, "$count"
+    $P288 = "capnames"($P286, $P287)
+    store_lex "%astcap", $P288
+.annotate "line", 549
+    find_lex $P290, "%astcap"
+    defined $I291, $P290
+    unless $I291, for_undef_95
+    iter $P289, $P290
+    new $P300, 'ExceptionHandler'
+    set_addr $P300, loop299_handler
+    $P300."handle_types"(65, 67, 66)
+    push_eh $P300
+  loop299_test:
+    unless $P289, loop299_done
+    shift $P292, $P289
+  loop299_redo:
+    .const 'Sub' $P294 = "26_1261064016.27984" 
+    capture_lex $P294
+    $P294($P292)
+  loop299_next:
+    goto loop299_test
+  loop299_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P301, exception, 'type'
+    eq $P301, 65, loop299_next
+    eq $P301, 67, loop299_redo
+  loop299_done:
+    pop_eh 
+  for_undef_95:
+.annotate "line", 552
+    find_lex $P302, "%astcap"
+    unless_null $P302, vivify_97
+    new $P302, "Hash"
+  vivify_97:
+    set $P303, $P302[""]
+    unless_null $P303, vivify_98
+    new $P303, "Undef"
+  vivify_98:
+    store_lex "$count", $P303
+.annotate "line", 547
+    .return ($P303)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "_block293"  :anon :subid("26_1261064016.27984") :outer("25_1261064016.27984")
+    .param pmc param_295
+.annotate "line", 549
+    .lex "$_", param_295
+.annotate "line", 550
+    new $P296, "Integer"
+    assign $P296, 2
+    find_lex $P297, "$_"
+    find_lex $P298, "%capnames"
+    unless_null $P298, vivify_96
+    new $P298, "Hash"
+    store_lex "%capnames", $P298
+  vivify_96:
+    set $P298[$P297], $P296
+.annotate "line", 549
+    .return ($P296)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "_block219"  :anon :subid("22_1261064016.27984") :outer("14_1261064016.27984")
+.annotate "line", 530
+    .const 'Sub' $P260 = "24_1261064016.27984" 
+    capture_lex $P260
+    .const 'Sub' $P232 = "23_1261064016.27984" 
+    capture_lex $P232
+.annotate "line", 531
+    new $P221, "Undef"
+    .lex "$name", $P221
+.annotate "line", 532
+    new $P222, "ResizablePMCArray"
+    .lex "@names", $P222
+.annotate "line", 541
+    new $P223, "Hash"
+    .lex "%x", $P223
+.annotate "line", 531
+    find_lex $P224, "$ast"
+    $P225 = $P224."name"()
+    store_lex "$name", $P225
+.annotate "line", 532
+
+            $P0 = find_lex '$name'
+            $S0 = $P0
+            $P226 = split '=', $S0
+        
+    store_lex "@names", $P226
+.annotate "line", 537
+    find_lex $P228, "@names"
+    defined $I229, $P228
+    unless $I229, for_undef_99
+    iter $P227, $P228
+    new $P249, 'ExceptionHandler'
+    set_addr $P249, loop248_handler
+    $P249."handle_types"(65, 67, 66)
+    push_eh $P249
+  loop248_test:
+    unless $P227, loop248_done
+    shift $P230, $P227
+  loop248_redo:
+    .const 'Sub' $P232 = "23_1261064016.27984" 
+    capture_lex $P232
+    $P232($P230)
+  loop248_next:
+    goto loop248_test
+  loop248_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P250, exception, 'type'
+    eq $P250, 65, loop248_next
+    eq $P250, 67, loop248_redo
+  loop248_done:
+    pop_eh 
+  for_undef_99:
+.annotate "line", 541
+    find_lex $P251, "$ast"
+    unless_null $P251, vivify_101
+    new $P251, "ResizablePMCArray"
+  vivify_101:
+    set $P252, $P251[0]
+    unless_null $P252, vivify_102
+    new $P252, "Undef"
+  vivify_102:
+    find_lex $P253, "$count"
+    $P254 = "capnames"($P252, $P253)
+    store_lex "%x", $P254
+.annotate "line", 542
+    find_lex $P256, "%x"
+    defined $I257, $P256
+    unless $I257, for_undef_103
+    iter $P255, $P256
+    new $P274, 'ExceptionHandler'
+    set_addr $P274, loop273_handler
+    $P274."handle_types"(65, 67, 66)
+    push_eh $P274
+  loop273_test:
+    unless $P255, loop273_done
+    shift $P258, $P255
+  loop273_redo:
+    .const 'Sub' $P260 = "24_1261064016.27984" 
+    capture_lex $P260
+    $P260($P258)
+  loop273_next:
+    goto loop273_test
+  loop273_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P275, exception, 'type'
+    eq $P275, 65, loop273_next
+    eq $P275, 67, loop273_redo
+  loop273_done:
+    pop_eh 
+  for_undef_103:
+.annotate "line", 545
+    find_lex $P276, "%x"
+    unless_null $P276, vivify_109
+    new $P276, "Hash"
+  vivify_109:
+    set $P277, $P276[""]
+    unless_null $P277, vivify_110
+    new $P277, "Undef"
+  vivify_110:
+    store_lex "$count", $P277
+.annotate "line", 530
+    .return ($P277)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "_block231"  :anon :subid("23_1261064016.27984") :outer("22_1261064016.27984")
+    .param pmc param_233
+.annotate "line", 537
+    .lex "$_", param_233
+.annotate "line", 538
+    find_lex $P237, "$_"
+    set $S238, $P237
+    iseq $I239, $S238, "0"
+    unless $I239, unless_236
+    new $P235, 'Integer'
+    set $P235, $I239
+    goto unless_236_end
+  unless_236:
+    find_lex $P240, "$_"
+    set $N241, $P240
+    isgt $I242, $N241, 0.0
+    new $P235, 'Integer'
+    set $P235, $I242
+  unless_236_end:
+    unless $P235, if_234_end
+    find_lex $P243, "$_"
+    add $P244, $P243, 1
+    store_lex "$count", $P244
+  if_234_end:
+.annotate "line", 539
+    new $P245, "Integer"
+    assign $P245, 1
+    find_lex $P246, "$_"
+    find_lex $P247, "%capnames"
+    unless_null $P247, vivify_100
+    new $P247, "Hash"
+    store_lex "%capnames", $P247
+  vivify_100:
+    set $P247[$P246], $P245
+.annotate "line", 537
+    .return ($P245)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "_block259"  :anon :subid("24_1261064016.27984") :outer("22_1261064016.27984")
+    .param pmc param_261
+.annotate "line", 542
+    .lex "$_", param_261
+.annotate "line", 543
+    find_lex $P262, "$_"
+    find_lex $P263, "%capnames"
+    unless_null $P263, vivify_104
+    new $P263, "Hash"
+  vivify_104:
+    set $P264, $P263[$P262]
+    unless_null $P264, vivify_105
+    new $P264, "Undef"
+  vivify_105:
+    set $N265, $P264
+    new $P266, 'Float'
+    set $P266, $N265
+    find_lex $P267, "$_"
+    find_lex $P268, "%x"
+    unless_null $P268, vivify_106
+    new $P268, "Hash"
+  vivify_106:
+    set $P269, $P268[$P267]
+    unless_null $P269, vivify_107
+    new $P269, "Undef"
+  vivify_107:
+    add $P270, $P266, $P269
+    find_lex $P271, "$_"
+    find_lex $P272, "%capnames"
+    unless_null $P272, vivify_108
+    new $P272, "Hash"
+    store_lex "%capnames", $P272
+  vivify_108:
+    set $P272[$P271], $P270
+.annotate "line", 542
+    .return ($P270)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "_block177"  :anon :subid("20_1261064016.27984") :outer("14_1261064016.27984")
+.annotate "line", 517
+    .const 'Sub' $P196 = "21_1261064016.27984" 
+    capture_lex $P196
+.annotate "line", 518
+    new $P179, "Undef"
+    .lex "$name", $P179
+.annotate "line", 520
+    new $P180, "ResizablePMCArray"
+    .lex "@names", $P180
+.annotate "line", 518
+    find_lex $P181, "$ast"
+    $P182 = $P181."name"()
+    store_lex "$name", $P182
+.annotate "line", 519
+    find_lex $P184, "$name"
+    set $S185, $P184
+    iseq $I186, $S185, ""
+    unless $I186, if_183_end
+    find_lex $P187, "$count"
+    store_lex "$name", $P187
+    find_lex $P188, "$ast"
+    find_lex $P189, "$name"
+    $P188."name"($P189)
+  if_183_end:
+.annotate "line", 520
+
+            $P0 = find_lex '$name'
+            $S0 = $P0
+            $P190 = split '=', $S0
+        
+    store_lex "@names", $P190
+.annotate "line", 525
+    find_lex $P192, "@names"
+    defined $I193, $P192
+    unless $I193, for_undef_111
+    iter $P191, $P192
+    new $P213, 'ExceptionHandler'
+    set_addr $P213, loop212_handler
+    $P213."handle_types"(65, 67, 66)
+    push_eh $P213
+  loop212_test:
+    unless $P191, loop212_done
+    shift $P194, $P191
+  loop212_redo:
+    .const 'Sub' $P196 = "21_1261064016.27984" 
+    capture_lex $P196
+    $P196($P194)
+  loop212_next:
+    goto loop212_test
+  loop212_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P214, exception, 'type'
+    eq $P214, 65, loop212_next
+    eq $P214, 67, loop212_redo
+  loop212_done:
+    pop_eh 
+  for_undef_111:
+.annotate "line", 517
+    .return ($P191)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "_block195"  :anon :subid("21_1261064016.27984") :outer("20_1261064016.27984")
+    .param pmc param_197
+.annotate "line", 525
+    .lex "$_", param_197
+.annotate "line", 526
+    find_lex $P201, "$_"
+    set $S202, $P201
+    iseq $I203, $S202, "0"
+    unless $I203, unless_200
+    new $P199, 'Integer'
+    set $P199, $I203
+    goto unless_200_end
+  unless_200:
+    find_lex $P204, "$_"
+    set $N205, $P204
+    isgt $I206, $N205, 0.0
+    new $P199, 'Integer'
+    set $P199, $I206
+  unless_200_end:
+    unless $P199, if_198_end
+    find_lex $P207, "$_"
+    add $P208, $P207, 1
+    store_lex "$count", $P208
+  if_198_end:
+.annotate "line", 527
+    new $P209, "Integer"
+    assign $P209, 1
+    find_lex $P210, "$_"
+    find_lex $P211, "%capnames"
+    unless_null $P211, vivify_112
+    new $P211, "Hash"
+    store_lex "%capnames", $P211
+  vivify_112:
+    set $P211[$P210], $P209
+.annotate "line", 525
+    .return ($P209)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "_block135"  :anon :subid("18_1261064016.27984") :outer("14_1261064016.27984")
+    .param pmc param_138
+.annotate "line", 509
+    .const 'Sub' $P147 = "19_1261064016.27984" 
+    capture_lex $P147
+.annotate "line", 510
+    new $P137, "Hash"
+    .lex "%x", $P137
+    .lex "$_", param_138
+    find_lex $P139, "$_"
+    find_lex $P140, "$count"
+    $P141 = "capnames"($P139, $P140)
+    store_lex "%x", $P141
+.annotate "line", 511
+    find_lex $P143, "%x"
+    defined $I144, $P143
+    unless $I144, for_undef_114
+    iter $P142, $P143
+    new $P161, 'ExceptionHandler'
+    set_addr $P161, loop160_handler
+    $P161."handle_types"(65, 67, 66)
+    push_eh $P161
+  loop160_test:
+    unless $P142, loop160_done
+    shift $P145, $P142
+  loop160_redo:
+    .const 'Sub' $P147 = "19_1261064016.27984" 
+    capture_lex $P147
+    $P147($P145)
+  loop160_next:
+    goto loop160_test
+  loop160_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P162, exception, 'type'
+    eq $P162, 65, loop160_next
+    eq $P162, 67, loop160_redo
+  loop160_done:
+    pop_eh 
+  for_undef_114:
+.annotate "line", 514
+    find_lex $P163, "%x"
+    unless_null $P163, vivify_120
+    new $P163, "Hash"
+  vivify_120:
+    set $P164, $P163[""]
+    unless_null $P164, vivify_121
+    new $P164, "Undef"
+  vivify_121:
+    store_lex "$count", $P164
+.annotate "line", 509
+    .return ($P164)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "_block146"  :anon :subid("19_1261064016.27984") :outer("18_1261064016.27984")
+    .param pmc param_148
+.annotate "line", 511
+    .lex "$_", param_148
+.annotate "line", 512
+    find_lex $P149, "$_"
+    find_lex $P150, "%capnames"
+    unless_null $P150, vivify_115
+    new $P150, "Hash"
+  vivify_115:
+    set $P151, $P150[$P149]
+    unless_null $P151, vivify_116
+    new $P151, "Undef"
+  vivify_116:
+    set $N152, $P151
+    new $P153, 'Float'
+    set $P153, $N152
+    find_lex $P154, "$_"
+    find_lex $P155, "%x"
+    unless_null $P155, vivify_117
+    new $P155, "Hash"
+  vivify_117:
+    set $P156, $P155[$P154]
+    unless_null $P156, vivify_118
+    new $P156, "Undef"
+  vivify_118:
+    add $P157, $P153, $P156
+    find_lex $P158, "$_"
+    find_lex $P159, "%capnames"
+    unless_null $P159, vivify_119
+    new $P159, "Hash"
+    store_lex "%capnames", $P159
+  vivify_119:
+    set $P159[$P158], $P157
+.annotate "line", 511
+    .return ($P157)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "_block68"  :anon :subid("15_1261064016.27984") :outer("14_1261064016.27984")
+.annotate "line", 495
+    .const 'Sub' $P78 = "16_1261064016.27984" 
+    capture_lex $P78
+.annotate "line", 496
+    new $P70, "Undef"
+    .lex "$max", $P70
+    find_lex $P71, "$count"
+    store_lex "$max", $P71
+.annotate "line", 497
+    find_lex $P73, "$ast"
+    $P74 = $P73."list"()
+    defined $I75, $P74
+    unless $I75, for_undef_122
+    iter $P72, $P74
+    new $P123, 'ExceptionHandler'
+    set_addr $P123, loop122_handler
+    $P123."handle_types"(65, 67, 66)
+    push_eh $P123
+  loop122_test:
+    unless $P72, loop122_done
+    shift $P76, $P72
+  loop122_redo:
+    .const 'Sub' $P78 = "16_1261064016.27984" 
+    capture_lex $P78
+    $P78($P76)
+  loop122_next:
+    goto loop122_test
+  loop122_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P124, exception, 'type'
+    eq $P124, 65, loop122_next
+    eq $P124, 67, loop122_redo
+  loop122_done:
+    pop_eh 
+  for_undef_122:
+.annotate "line", 506
+    find_lex $P125, "$max"
+    store_lex "$count", $P125
+.annotate "line", 495
+    .return ($P125)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "_block77"  :anon :subid("16_1261064016.27984") :outer("15_1261064016.27984")
+    .param pmc param_80
+.annotate "line", 497
+    .const 'Sub' $P89 = "17_1261064016.27984" 
+    capture_lex $P89
+.annotate "line", 498
+    new $P79, "Hash"
+    .lex "%x", $P79
+    .lex "$_", param_80
+    find_lex $P81, "$_"
+    find_lex $P82, "$count"
+    $P83 = "capnames"($P81, $P82)
+    store_lex "%x", $P83
+.annotate "line", 499
+    find_lex $P85, "%x"
+    defined $I86, $P85
+    unless $I86, for_undef_123
+    iter $P84, $P85
+    new $P110, 'ExceptionHandler'
+    set_addr $P110, loop109_handler
+    $P110."handle_types"(65, 67, 66)
+    push_eh $P110
+  loop109_test:
+    unless $P84, loop109_done
+    shift $P87, $P84
+  loop109_redo:
+    .const 'Sub' $P89 = "17_1261064016.27984" 
+    capture_lex $P89
+    $P89($P87)
+  loop109_next:
+    goto loop109_test
+  loop109_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P111, exception, 'type'
+    eq $P111, 65, loop109_next
+    eq $P111, 67, loop109_redo
+  loop109_done:
+    pop_eh 
+  for_undef_123:
+.annotate "line", 504
+    find_lex $P114, "%x"
+    unless_null $P114, vivify_129
+    new $P114, "Hash"
+  vivify_129:
+    set $P115, $P114[""]
+    unless_null $P115, vivify_130
+    new $P115, "Undef"
+  vivify_130:
+    set $N116, $P115
+    find_lex $P117, "$max"
+    set $N118, $P117
+    isgt $I119, $N116, $N118
+    if $I119, if_113
+    new $P112, 'Integer'
+    set $P112, $I119
+    goto if_113_end
+  if_113:
+    find_lex $P120, "%x"
+    unless_null $P120, vivify_131
+    new $P120, "Hash"
+  vivify_131:
+    set $P121, $P120[""]
+    unless_null $P121, vivify_132
+    new $P121, "Undef"
+  vivify_132:
+    store_lex "$max", $P121
+    set $P112, $P121
+  if_113_end:
+.annotate "line", 497
+    .return ($P112)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "_block88"  :anon :subid("17_1261064016.27984") :outer("16_1261064016.27984")
+    .param pmc param_90
+.annotate "line", 499
+    .lex "$_", param_90
+.annotate "line", 500
+    find_lex $P95, "$_"
+    find_lex $P96, "%capnames"
+    unless_null $P96, vivify_124
+    new $P96, "Hash"
+  vivify_124:
+    set $P97, $P96[$P95]
+    unless_null $P97, vivify_125
+    new $P97, "Undef"
+  vivify_125:
+    set $N98, $P97
+    islt $I99, $N98, 2.0
+    if $I99, if_94
+    new $P93, 'Integer'
+    set $P93, $I99
+    goto if_94_end
+  if_94:
+    find_lex $P100, "$_"
+    find_lex $P101, "%x"
+    unless_null $P101, vivify_126
+    new $P101, "Hash"
+  vivify_126:
+    set $P102, $P101[$P100]
+    unless_null $P102, vivify_127
+    new $P102, "Undef"
+  vivify_127:
+    set $N103, $P102
+    iseq $I104, $N103, 1.0
+    new $P93, 'Integer'
+    set $P93, $I104
+  if_94_end:
+    if $P93, if_92
+    new $P106, "Integer"
+    assign $P106, 2
+    set $P91, $P106
+    goto if_92_end
+  if_92:
+    new $P105, "Integer"
+    assign $P105, 1
+    set $P91, $P105
+  if_92_end:
+.annotate "line", 501
+    find_lex $P107, "$_"
+    find_lex $P108, "%capnames"
+    unless_null $P108, vivify_128
+    new $P108, "Hash"
+    store_lex "%capnames", $P108
+  vivify_128:
+    set $P108[$P107], $P91
+.annotate "line", 499
+    .return ($P91)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "backmod"  :subid("27_1261064016.27984") :outer("11_1261064016.27984")
+    .param pmc param_311
+    .param pmc param_312
+.annotate "line", 558
+    new $P310, 'ExceptionHandler'
+    set_addr $P310, control_309
+    $P310."handle_types"(58)
+    push_eh $P310
+    .lex "$ast", param_311
+    .lex "$backmod", param_312
+.annotate "line", 559
+    find_lex $P314, "$backmod"
+    set $S315, $P314
+    iseq $I316, $S315, ":"
+    if $I316, if_313
+.annotate "line", 560
+    find_lex $P321, "$backmod"
+    set $S322, $P321
+    iseq $I323, $S322, ":?"
+    unless $I323, unless_320
+    new $P319, 'Integer'
+    set $P319, $I323
+    goto unless_320_end
+  unless_320:
+    find_lex $P324, "$backmod"
+    set $S325, $P324
+    iseq $I326, $S325, "?"
+    new $P319, 'Integer'
+    set $P319, $I326
+  unless_320_end:
+    if $P319, if_318
+.annotate "line", 561
+    find_lex $P331, "$backmod"
+    set $S332, $P331
+    iseq $I333, $S332, ":!"
+    unless $I333, unless_330
+    new $P329, 'Integer'
+    set $P329, $I333
+    goto unless_330_end
+  unless_330:
+    find_lex $P334, "$backmod"
+    set $S335, $P334
+    iseq $I336, $S335, "!"
+    new $P329, 'Integer'
+    set $P329, $I336
+  unless_330_end:
+    unless $P329, if_328_end
+    find_lex $P337, "$ast"
+    $P337."backtrack"("g")
+  if_328_end:
+    goto if_318_end
+  if_318:
+.annotate "line", 560
+    find_lex $P327, "$ast"
+    $P327."backtrack"("f")
+  if_318_end:
+    goto if_313_end
+  if_313:
+.annotate "line", 559
+    find_lex $P317, "$ast"
+    $P317."backtrack"("r")
+  if_313_end:
+    find_lex $P338, "$ast"
+.annotate "line", 558
+    .return ($P338)
+  control_309:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P339, exception, "payload"
+    .return ($P339)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "subrule_alias"  :subid("28_1261064016.27984") :outer("11_1261064016.27984")
+    .param pmc param_343
+    .param pmc param_344
+.annotate "line", 565
+    new $P342, 'ExceptionHandler'
+    set_addr $P342, control_341
+    $P342."handle_types"(58)
+    push_eh $P342
+    .lex "$past", param_343
+    .lex "$name", param_344
+.annotate "line", 566
+    find_lex $P346, "$past"
+    $S347 = $P346."name"()
+    isgt $I348, $S347, ""
+    if $I348, if_345
+.annotate "line", 567
+    find_lex $P355, "$past"
+    find_lex $P356, "$name"
+    $P355."name"($P356)
+    goto if_345_end
+  if_345:
+.annotate "line", 566
+    find_lex $P349, "$past"
+    find_lex $P350, "$name"
+    concat $P351, $P350, "="
+    find_lex $P352, "$past"
+    $S353 = $P352."name"()
+    concat $P354, $P351, $S353
+    $P349."name"($P354)
+  if_345_end:
+.annotate "line", 568
+    find_lex $P357, "$past"
+    $P358 = $P357."subtype"("capture")
+.annotate "line", 565
+    .return ($P358)
+  control_341:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P359, exception, "payload"
+    .return ($P359)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "arg"  :subid("29_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_365
+.annotate "line", 14
+    new $P364, 'ExceptionHandler'
+    set_addr $P364, control_363
+    $P364."handle_types"(58)
+    push_eh $P364
+    .lex "self", self
+    .lex "$/", param_365
+.annotate "line", 15
+    find_lex $P366, "$/"
+    find_lex $P369, "$/"
+    unless_null $P369, vivify_134
+    new $P369, "Hash"
+  vivify_134:
+    set $P370, $P369["quote_EXPR"]
+    unless_null $P370, vivify_135
+    new $P370, "Undef"
+  vivify_135:
+    if $P370, if_368
+    find_lex $P374, "$/"
+    unless_null $P374, vivify_136
+    new $P374, "Hash"
+  vivify_136:
+    set $P375, $P374["val"]
+    unless_null $P375, vivify_137
+    new $P375, "Undef"
+  vivify_137:
+    set $N376, $P375
+    new $P367, 'Float'
+    set $P367, $N376
+    goto if_368_end
+  if_368:
+    find_lex $P371, "$/"
+    unless_null $P371, vivify_138
+    new $P371, "Hash"
+  vivify_138:
+    set $P372, $P371["quote_EXPR"]
+    unless_null $P372, vivify_139
+    new $P372, "Undef"
+  vivify_139:
+    $P373 = $P372."ast"()
+    set $P367, $P373
+  if_368_end:
+    $P377 = $P366."!make"($P367)
+.annotate "line", 14
+    .return ($P377)
+  control_363:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P378, exception, "payload"
+    .return ($P378)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "arglist"  :subid("30_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_382
+.annotate "line", 18
+    .const 'Sub' $P392 = "31_1261064016.27984" 
+    capture_lex $P392
+    new $P381, 'ExceptionHandler'
+    set_addr $P381, control_380
+    $P381."handle_types"(58)
+    push_eh $P381
+    .lex "self", self
+    .lex "$/", param_382
+.annotate "line", 19
+    new $P383, "Undef"
+    .lex "$past", $P383
+    get_hll_global $P384, ["PAST"], "Op"
+    $P385 = $P384."new"("list" :named("pasttype"))
+    store_lex "$past", $P385
+.annotate "line", 20
+    find_lex $P387, "$/"
+    unless_null $P387, vivify_140
+    new $P387, "Hash"
+  vivify_140:
+    set $P388, $P387["arg"]
+    unless_null $P388, vivify_141
+    new $P388, "Undef"
+  vivify_141:
+    defined $I389, $P388
+    unless $I389, for_undef_142
+    iter $P386, $P388
+    new $P399, 'ExceptionHandler'
+    set_addr $P399, loop398_handler
+    $P399."handle_types"(65, 67, 66)
+    push_eh $P399
+  loop398_test:
+    unless $P386, loop398_done
+    shift $P390, $P386
+  loop398_redo:
+    .const 'Sub' $P392 = "31_1261064016.27984" 
+    capture_lex $P392
+    $P392($P390)
+  loop398_next:
+    goto loop398_test
+  loop398_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P400, exception, 'type'
+    eq $P400, 65, loop398_next
+    eq $P400, 67, loop398_redo
+  loop398_done:
+    pop_eh 
+  for_undef_142:
+.annotate "line", 21
+    find_lex $P401, "$/"
+    find_lex $P402, "$past"
+    $P403 = $P401."!make"($P402)
+.annotate "line", 18
+    .return ($P403)
+  control_380:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P404, exception, "payload"
+    .return ($P404)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "_block391"  :anon :subid("31_1261064016.27984") :outer("30_1261064016.27984")
+    .param pmc param_393
+.annotate "line", 20
+    .lex "$_", param_393
+    find_lex $P394, "$past"
+    find_lex $P395, "$_"
+    $P396 = $P395."ast"()
+    $P397 = $P394."push"($P396)
+    .return ($P397)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "TOP"  :subid("32_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_408
+.annotate "line", 24
+    new $P407, 'ExceptionHandler'
+    set_addr $P407, control_406
+    $P407."handle_types"(58)
+    push_eh $P407
+    .lex "self", self
+    .lex "$/", param_408
+.annotate "line", 25
+    new $P409, "Undef"
+    .lex "$past", $P409
+    find_lex $P410, "$/"
+    unless_null $P410, vivify_143
+    new $P410, "Hash"
+  vivify_143:
+    set $P411, $P410["nibbler"]
+    unless_null $P411, vivify_144
+    new $P411, "Undef"
+  vivify_144:
+    $P412 = $P411."ast"()
+    $P413 = "buildsub"($P412)
+    store_lex "$past", $P413
+.annotate "line", 26
+    find_lex $P414, "$past"
+    find_lex $P415, "$/"
+    $P414."node"($P415)
+.annotate "line", 27
+    find_lex $P416, "$/"
+    find_lex $P417, "$past"
+    $P418 = $P416."!make"($P417)
+.annotate "line", 24
+    .return ($P418)
+  control_406:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P419, exception, "payload"
+    .return ($P419)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "nibbler"  :subid("33_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_423
+    .param pmc param_424 :optional
+    .param int has_param_424 :opt_flag
+.annotate "line", 30
+    .const 'Sub' $P458 = "35_1261064016.27984" 
+    capture_lex $P458
+    .const 'Sub' $P432 = "34_1261064016.27984" 
+    capture_lex $P432
+    new $P422, 'ExceptionHandler'
+    set_addr $P422, control_421
+    $P422."handle_types"(58)
+    push_eh $P422
+    .lex "self", self
+    .lex "$/", param_423
+    if has_param_424, optparam_145
+    new $P425, "Undef"
+    set param_424, $P425
+  optparam_145:
+    .lex "$key", param_424
+.annotate "line", 42
+    new $P426, "Undef"
+    .lex "$past", $P426
+.annotate "line", 31
+    find_lex $P428, "$key"
+    set $S429, $P428
+    iseq $I430, $S429, "open"
+    unless $I430, if_427_end
+    .const 'Sub' $P432 = "34_1261064016.27984" 
+    capture_lex $P432
+    $P432()
+  if_427_end:
+.annotate "line", 41
+    get_global $P442, "@MODIFIERS"
+    $P442."shift"()
+    find_lex $P443, "$past"
+.annotate "line", 43
+    find_lex $P445, "$/"
+    unless_null $P445, vivify_148
+    new $P445, "Hash"
+  vivify_148:
+    set $P446, $P445["termish"]
+    unless_null $P446, vivify_149
+    new $P446, "Undef"
+  vivify_149:
+    set $N447, $P446
+    isgt $I448, $N447, 1.0
+    if $I448, if_444
+.annotate "line", 50
+    find_lex $P467, "$/"
+    unless_null $P467, vivify_150
+    new $P467, "Hash"
+  vivify_150:
+    set $P468, $P467["termish"]
+    unless_null $P468, vivify_151
+    new $P468, "ResizablePMCArray"
+  vivify_151:
+    set $P469, $P468[0]
+    unless_null $P469, vivify_152
+    new $P469, "Undef"
+  vivify_152:
+    $P470 = $P469."ast"()
+    store_lex "$past", $P470
+.annotate "line", 49
+    goto if_444_end
+  if_444:
+.annotate "line", 44
+    get_hll_global $P449, ["PAST"], "Regex"
+    find_lex $P450, "$/"
+    $P451 = $P449."new"("alt" :named("pasttype"), $P450 :named("node"))
+    store_lex "$past", $P451
+.annotate "line", 45
+    find_lex $P453, "$/"
+    unless_null $P453, vivify_153
+    new $P453, "Hash"
+  vivify_153:
+    set $P454, $P453["termish"]
+    unless_null $P454, vivify_154
+    new $P454, "Undef"
+  vivify_154:
+    defined $I455, $P454
+    unless $I455, for_undef_155
+    iter $P452, $P454
+    new $P465, 'ExceptionHandler'
+    set_addr $P465, loop464_handler
+    $P465."handle_types"(65, 67, 66)
+    push_eh $P465
+  loop464_test:
+    unless $P452, loop464_done
+    shift $P456, $P452
+  loop464_redo:
+    .const 'Sub' $P458 = "35_1261064016.27984" 
+    capture_lex $P458
+    $P458($P456)
+  loop464_next:
+    goto loop464_test
+  loop464_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P466, exception, 'type'
+    eq $P466, 65, loop464_next
+    eq $P466, 67, loop464_redo
+  loop464_done:
+    pop_eh 
+  for_undef_155:
+  if_444_end:
+.annotate "line", 52
+    find_lex $P471, "$/"
+    find_lex $P472, "$past"
+    $P473 = $P471."!make"($P472)
+.annotate "line", 30
+    .return ($P473)
+  control_421:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P474, exception, "payload"
+    .return ($P474)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "_block431"  :anon :subid("34_1261064016.27984") :outer("33_1261064016.27984")
+.annotate "line", 32
+    new $P433, "Hash"
+    .lex "%old", $P433
+.annotate "line", 33
+    new $P434, "Hash"
+    .lex "%new", $P434
+.annotate "line", 32
+    get_global $P435, "@MODIFIERS"
+    unless_null $P435, vivify_146
+    new $P435, "ResizablePMCArray"
+  vivify_146:
+    set $P436, $P435[0]
+    unless_null $P436, vivify_147
+    new $P436, "Undef"
+  vivify_147:
+    store_lex "%old", $P436
+.annotate "line", 33
+
+                       $P0 = find_lex '%old'
+                       $P437 = clone $P0
+                   
+    store_lex "%new", $P437
+.annotate "line", 37
+    get_global $P438, "@MODIFIERS"
+    find_lex $P439, "%new"
+    $P438."unshift"($P439)
+.annotate "line", 38
+    new $P440, "Exception"
+    set $P440['type'], 58
+    new $P441, "Integer"
+    assign $P441, 1
+    setattribute $P440, 'payload', $P441
+    throw $P440
+.annotate "line", 31
+    .return ()
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "_block457"  :anon :subid("35_1261064016.27984") :outer("33_1261064016.27984")
+    .param pmc param_459
+.annotate "line", 45
+    .lex "$_", param_459
+.annotate "line", 46
+    find_lex $P460, "$past"
+    find_lex $P461, "$_"
+    $P462 = $P461."ast"()
+    $P463 = $P460."push"($P462)
+.annotate "line", 45
+    .return ($P463)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "termish"  :subid("36_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_478
+.annotate "line", 55
+    .const 'Sub' $P491 = "37_1261064016.27984" 
+    capture_lex $P491
+    new $P477, 'ExceptionHandler'
+    set_addr $P477, control_476
+    $P477."handle_types"(58)
+    push_eh $P477
+    .lex "self", self
+    .lex "$/", param_478
+.annotate "line", 56
+    new $P479, "Undef"
+    .lex "$past", $P479
+.annotate "line", 57
+    new $P480, "Undef"
+    .lex "$lastlit", $P480
+.annotate "line", 56
+    get_hll_global $P481, ["PAST"], "Regex"
+    find_lex $P482, "$/"
+    $P483 = $P481."new"("concat" :named("pasttype"), $P482 :named("node"))
+    store_lex "$past", $P483
+.annotate "line", 57
+    new $P484, "Integer"
+    assign $P484, 0
+    store_lex "$lastlit", $P484
+.annotate "line", 58
+    find_lex $P486, "$/"
+    unless_null $P486, vivify_156
+    new $P486, "Hash"
+  vivify_156:
+    set $P487, $P486["noun"]
+    unless_null $P487, vivify_157
+    new $P487, "Undef"
+  vivify_157:
+    defined $I488, $P487
+    unless $I488, for_undef_158
+    iter $P485, $P487
+    new $P537, 'ExceptionHandler'
+    set_addr $P537, loop536_handler
+    $P537."handle_types"(65, 67, 66)
+    push_eh $P537
+  loop536_test:
+    unless $P485, loop536_done
+    shift $P489, $P485
+  loop536_redo:
+    .const 'Sub' $P491 = "37_1261064016.27984" 
+    capture_lex $P491
+    $P491($P489)
+  loop536_next:
+    goto loop536_test
+  loop536_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P538, exception, 'type'
+    eq $P538, 65, loop536_next
+    eq $P538, 67, loop536_redo
+  loop536_done:
+    pop_eh 
+  for_undef_158:
+.annotate "line", 73
+    find_lex $P539, "$/"
+    find_lex $P540, "$past"
+    $P541 = $P539."!make"($P540)
+.annotate "line", 55
+    .return ($P541)
+  control_476:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P542, exception, "payload"
+    .return ($P542)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "_block490"  :anon :subid("37_1261064016.27984") :outer("36_1261064016.27984")
+    .param pmc param_493
+.annotate "line", 59
+    new $P492, "Undef"
+    .lex "$ast", $P492
+    .lex "$_", param_493
+    find_lex $P494, "$_"
+    $P495 = $P494."ast"()
+    store_lex "$ast", $P495
+.annotate "line", 60
+    find_lex $P498, "$ast"
+    if $P498, if_497
+    set $P496, $P498
+    goto if_497_end
+  if_497:
+.annotate "line", 61
+    find_lex $P505, "$lastlit"
+    if $P505, if_504
+    set $P503, $P505
+    goto if_504_end
+  if_504:
+    find_lex $P506, "$ast"
+    $S507 = $P506."pasttype"()
+    iseq $I508, $S507, "literal"
+    new $P503, 'Integer'
+    set $P503, $I508
+  if_504_end:
+    if $P503, if_502
+    set $P501, $P503
+    goto if_502_end
+  if_502:
+.annotate "line", 62
+    get_hll_global $P509, ["PAST"], "Node"
+    find_lex $P510, "$ast"
+    unless_null $P510, vivify_159
+    new $P510, "ResizablePMCArray"
+  vivify_159:
+    set $P511, $P510[0]
+    unless_null $P511, vivify_160
+    new $P511, "Undef"
+  vivify_160:
+    $P512 = $P509."ACCEPTS"($P511)
+    isfalse $I513, $P512
+    new $P501, 'Integer'
+    set $P501, $I513
+  if_502_end:
+    if $P501, if_500
+.annotate "line", 66
+    find_lex $P520, "$past"
+    find_lex $P521, "$ast"
+    $P520."push"($P521)
+.annotate "line", 67
+    find_lex $P526, "$ast"
+    $S527 = $P526."pasttype"()
+    iseq $I528, $S527, "literal"
+    if $I528, if_525
+    new $P524, 'Integer'
+    set $P524, $I528
+    goto if_525_end
+  if_525:
+.annotate "line", 68
+    get_hll_global $P529, ["PAST"], "Node"
+    find_lex $P530, "$ast"
+    unless_null $P530, vivify_161
+    new $P530, "ResizablePMCArray"
+  vivify_161:
+    set $P531, $P530[0]
+    unless_null $P531, vivify_162
+    new $P531, "Undef"
+  vivify_162:
+    $P532 = $P529."ACCEPTS"($P531)
+    isfalse $I533, $P532
+    new $P524, 'Integer'
+    set $P524, $I533
+  if_525_end:
+    if $P524, if_523
+    new $P535, "Integer"
+    assign $P535, 0
+    set $P522, $P535
+    goto if_523_end
+  if_523:
+    find_lex $P534, "$ast"
+    set $P522, $P534
+  if_523_end:
+.annotate "line", 69
+    store_lex "$lastlit", $P522
+.annotate "line", 65
+    set $P499, $P522
+.annotate "line", 62
+    goto if_500_end
+  if_500:
+.annotate "line", 63
+    find_lex $P514, "$lastlit"
+    unless_null $P514, vivify_163
+    new $P514, "ResizablePMCArray"
+  vivify_163:
+    set $P515, $P514[0]
+    unless_null $P515, vivify_164
+    new $P515, "Undef"
+  vivify_164:
+    find_lex $P516, "$ast"
+    unless_null $P516, vivify_165
+    new $P516, "ResizablePMCArray"
+  vivify_165:
+    set $P517, $P516[0]
+    unless_null $P517, vivify_166
+    new $P517, "Undef"
+  vivify_166:
+    concat $P518, $P515, $P517
+    find_lex $P519, "$lastlit"
+    unless_null $P519, vivify_167
+    new $P519, "ResizablePMCArray"
+    store_lex "$lastlit", $P519
+  vivify_167:
+    set $P519[0], $P518
+.annotate "line", 62
+    set $P499, $P518
+  if_500_end:
+.annotate "line", 60
+    set $P496, $P499
+  if_497_end:
+.annotate "line", 58
+    .return ($P496)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "quantified_atom"  :subid("38_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_546
+.annotate "line", 76
+    .const 'Sub' $P555 = "39_1261064016.27984" 
+    capture_lex $P555
+    new $P545, 'ExceptionHandler'
+    set_addr $P545, control_544
+    $P545."handle_types"(58)
+    push_eh $P545
+    .lex "self", self
+    .lex "$/", param_546
+.annotate "line", 77
+    new $P547, "Undef"
+    .lex "$past", $P547
+    find_lex $P548, "$/"
+    unless_null $P548, vivify_168
+    new $P548, "Hash"
+  vivify_168:
+    set $P549, $P548["atom"]
+    unless_null $P549, vivify_169
+    new $P549, "Undef"
+  vivify_169:
+    $P550 = $P549."ast"()
+    store_lex "$past", $P550
+.annotate "line", 78
+    find_lex $P552, "$/"
+    unless_null $P552, vivify_170
+    new $P552, "Hash"
+  vivify_170:
+    set $P553, $P552["quantifier"]
+    unless_null $P553, vivify_171
+    new $P553, "Undef"
+  vivify_171:
+    if $P553, if_551
+.annotate "line", 84
+    find_lex $P569, "$/"
+    unless_null $P569, vivify_172
+    new $P569, "Hash"
+  vivify_172:
+    set $P570, $P569["backmod"]
+    unless_null $P570, vivify_173
+    new $P570, "ResizablePMCArray"
+  vivify_173:
+    set $P571, $P570[0]
+    unless_null $P571, vivify_174
+    new $P571, "Undef"
+  vivify_174:
+    unless $P571, if_568_end
+    find_lex $P572, "$past"
+    find_lex $P573, "$/"
+    unless_null $P573, vivify_175
+    new $P573, "Hash"
+  vivify_175:
+    set $P574, $P573["backmod"]
+    unless_null $P574, vivify_176
+    new $P574, "ResizablePMCArray"
+  vivify_176:
+    set $P575, $P574[0]
+    unless_null $P575, vivify_177
+    new $P575, "Undef"
+  vivify_177:
+    "backmod"($P572, $P575)
+  if_568_end:
+    goto if_551_end
+  if_551:
+.annotate "line", 78
+    .const 'Sub' $P555 = "39_1261064016.27984" 
+    capture_lex $P555
+    $P555()
+  if_551_end:
+.annotate "line", 85
+    find_lex $P581, "$past"
+    if $P581, if_580
+    set $P579, $P581
+    goto if_580_end
+  if_580:
+    find_lex $P582, "$past"
+    $P583 = $P582."backtrack"()
+    isfalse $I584, $P583
+    new $P579, 'Integer'
+    set $P579, $I584
+  if_580_end:
+    if $P579, if_578
+    set $P577, $P579
+    goto if_578_end
+  if_578:
+    get_global $P585, "@MODIFIERS"
+    unless_null $P585, vivify_181
+    new $P585, "ResizablePMCArray"
+  vivify_181:
+    set $P586, $P585[0]
+    unless_null $P586, vivify_182
+    new $P586, "Hash"
+  vivify_182:
+    set $P587, $P586["r"]
+    unless_null $P587, vivify_183
+    new $P587, "Undef"
+  vivify_183:
+    set $P577, $P587
+  if_578_end:
+    unless $P577, if_576_end
+.annotate "line", 86
+    find_lex $P588, "$past"
+    $P588."backtrack"("r")
+  if_576_end:
+.annotate "line", 88
+    find_lex $P589, "$/"
+    find_lex $P590, "$past"
+    $P591 = $P589."!make"($P590)
+.annotate "line", 76
+    .return ($P591)
+  control_544:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P592, exception, "payload"
+    .return ($P592)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "_block554"  :anon :subid("39_1261064016.27984") :outer("38_1261064016.27984")
+.annotate "line", 80
+    new $P556, "Undef"
+    .lex "$qast", $P556
+.annotate "line", 79
+    find_lex $P558, "$past"
+    isfalse $I559, $P558
+    unless $I559, if_557_end
+    find_lex $P560, "$/"
+    $P560."panic"("Can't quantify zero-width atom")
+  if_557_end:
+.annotate "line", 80
+    find_lex $P561, "$/"
+    unless_null $P561, vivify_178
+    new $P561, "Hash"
+  vivify_178:
+    set $P562, $P561["quantifier"]
+    unless_null $P562, vivify_179
+    new $P562, "ResizablePMCArray"
+  vivify_179:
+    set $P563, $P562[0]
+    unless_null $P563, vivify_180
+    new $P563, "Undef"
+  vivify_180:
+    $P564 = $P563."ast"()
+    store_lex "$qast", $P564
+.annotate "line", 81
+    find_lex $P565, "$qast"
+    find_lex $P566, "$past"
+    $P565."unshift"($P566)
+.annotate "line", 82
+    find_lex $P567, "$qast"
+    store_lex "$past", $P567
+.annotate "line", 78
+    .return ($P567)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "atom"  :subid("40_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_596
+.annotate "line", 91
+    new $P595, 'ExceptionHandler'
+    set_addr $P595, control_594
+    $P595."handle_types"(58)
+    push_eh $P595
+    .lex "self", self
+    .lex "$/", param_596
+.annotate "line", 92
+    new $P597, "Undef"
+    .lex "$past", $P597
+.annotate "line", 91
+    find_lex $P598, "$past"
+.annotate "line", 93
+    find_lex $P600, "$/"
+    unless_null $P600, vivify_184
+    new $P600, "Hash"
+  vivify_184:
+    set $P601, $P600["metachar"]
+    unless_null $P601, vivify_185
+    new $P601, "Undef"
+  vivify_185:
+    if $P601, if_599
+.annotate "line", 95
+    get_hll_global $P605, ["PAST"], "Regex"
+    find_lex $P606, "$/"
+    set $S607, $P606
+    find_lex $P608, "$/"
+    $P609 = $P605."new"($S607, "literal" :named("pasttype"), $P608 :named("node"))
+    store_lex "$past", $P609
+.annotate "line", 96
+    get_global $P611, "@MODIFIERS"
+    unless_null $P611, vivify_186
+    new $P611, "ResizablePMCArray"
+  vivify_186:
+    set $P612, $P611[0]
+    unless_null $P612, vivify_187
+    new $P612, "Hash"
+  vivify_187:
+    set $P613, $P612["i"]
+    unless_null $P613, vivify_188
+    new $P613, "Undef"
+  vivify_188:
+    unless $P613, if_610_end
+    find_lex $P614, "$past"
+    $P614."subtype"("ignorecase")
+  if_610_end:
+.annotate "line", 94
+    goto if_599_end
+  if_599:
+.annotate "line", 93
+    find_lex $P602, "$/"
+    unless_null $P602, vivify_189
+    new $P602, "Hash"
+  vivify_189:
+    set $P603, $P602["metachar"]
+    unless_null $P603, vivify_190
+    new $P603, "Undef"
+  vivify_190:
+    $P604 = $P603."ast"()
+    store_lex "$past", $P604
+  if_599_end:
+.annotate "line", 98
+    find_lex $P615, "$/"
+    find_lex $P616, "$past"
+    $P617 = $P615."!make"($P616)
+.annotate "line", 91
+    .return ($P617)
+  control_594:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P618, exception, "payload"
+    .return ($P618)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "quantifier:sym<*>"  :subid("41_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_622
+.annotate "line", 101
+    new $P621, 'ExceptionHandler'
+    set_addr $P621, control_620
+    $P621."handle_types"(58)
+    push_eh $P621
+    .lex "self", self
+    .lex "$/", param_622
+.annotate "line", 102
+    new $P623, "Undef"
+    .lex "$past", $P623
+    get_hll_global $P624, ["PAST"], "Regex"
+    find_lex $P625, "$/"
+    $P626 = $P624."new"("quant" :named("pasttype"), $P625 :named("node"))
+    store_lex "$past", $P626
+.annotate "line", 103
+    find_lex $P627, "$/"
+    find_lex $P628, "$past"
+    find_lex $P629, "$/"
+    unless_null $P629, vivify_191
+    new $P629, "Hash"
+  vivify_191:
+    set $P630, $P629["backmod"]
+    unless_null $P630, vivify_192
+    new $P630, "Undef"
+  vivify_192:
+    $P631 = "backmod"($P628, $P630)
+    $P632 = $P627."!make"($P631)
+.annotate "line", 101
+    .return ($P632)
+  control_620:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P633, exception, "payload"
+    .return ($P633)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "quantifier:sym<+>"  :subid("42_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_637
+.annotate "line", 106
+    new $P636, 'ExceptionHandler'
+    set_addr $P636, control_635
+    $P636."handle_types"(58)
+    push_eh $P636
+    .lex "self", self
+    .lex "$/", param_637
+.annotate "line", 107
+    new $P638, "Undef"
+    .lex "$past", $P638
+    get_hll_global $P639, ["PAST"], "Regex"
+    find_lex $P640, "$/"
+    $P641 = $P639."new"("quant" :named("pasttype"), 1 :named("min"), $P640 :named("node"))
+    store_lex "$past", $P641
+.annotate "line", 108
+    find_lex $P642, "$/"
+    find_lex $P643, "$past"
+    find_lex $P644, "$/"
+    unless_null $P644, vivify_193
+    new $P644, "Hash"
+  vivify_193:
+    set $P645, $P644["backmod"]
+    unless_null $P645, vivify_194
+    new $P645, "Undef"
+  vivify_194:
+    $P646 = "backmod"($P643, $P645)
+    $P647 = $P642."!make"($P646)
+.annotate "line", 106
+    .return ($P647)
+  control_635:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P648, exception, "payload"
+    .return ($P648)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "quantifier:sym<?>"  :subid("43_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_652
+.annotate "line", 111
+    new $P651, 'ExceptionHandler'
+    set_addr $P651, control_650
+    $P651."handle_types"(58)
+    push_eh $P651
+    .lex "self", self
+    .lex "$/", param_652
+.annotate "line", 112
+    new $P653, "Undef"
+    .lex "$past", $P653
+    get_hll_global $P654, ["PAST"], "Regex"
+    find_lex $P655, "$/"
+    $P656 = $P654."new"("quant" :named("pasttype"), 0 :named("min"), 1 :named("max"), $P655 :named("node"))
+    store_lex "$past", $P656
+.annotate "line", 113
+    find_lex $P657, "$/"
+    find_lex $P658, "$past"
+    find_lex $P659, "$/"
+    unless_null $P659, vivify_195
+    new $P659, "Hash"
+  vivify_195:
+    set $P660, $P659["backmod"]
+    unless_null $P660, vivify_196
+    new $P660, "Undef"
+  vivify_196:
+    $P661 = "backmod"($P658, $P660)
+    $P657."!make"($P661)
+.annotate "line", 114
+    find_lex $P662, "$/"
+    find_lex $P663, "$past"
+    $P664 = $P662."!make"($P663)
+.annotate "line", 111
+    .return ($P664)
+  control_650:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P665, exception, "payload"
+    .return ($P665)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "quantifier:sym<**>"  :subid("44_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_669
+.annotate "line", 117
+    new $P668, 'ExceptionHandler'
+    set_addr $P668, control_667
+    $P668."handle_types"(58)
+    push_eh $P668
+    .lex "self", self
+    .lex "$/", param_669
+.annotate "line", 118
+    new $P670, "Undef"
+    .lex "$past", $P670
+.annotate "line", 117
+    find_lex $P671, "$past"
+.annotate "line", 119
+    find_lex $P673, "$/"
+    unless_null $P673, vivify_197
+    new $P673, "Hash"
+  vivify_197:
+    set $P674, $P673["quantified_atom"]
+    unless_null $P674, vivify_198
+    new $P674, "Undef"
+  vivify_198:
+    if $P674, if_672
+.annotate "line", 124
+    get_hll_global $P681, ["PAST"], "Regex"
+    find_lex $P682, "$/"
+    unless_null $P682, vivify_199
+    new $P682, "Hash"
+  vivify_199:
+    set $P683, $P682["min"]
+    unless_null $P683, vivify_200
+    new $P683, "Undef"
+  vivify_200:
+    set $N684, $P683
+    find_lex $P685, "$/"
+    $P686 = $P681."new"("quant" :named("pasttype"), $N684 :named("min"), $P685 :named("node"))
+    store_lex "$past", $P686
+.annotate "line", 125
+    find_lex $P688, "$/"
+    unless_null $P688, vivify_201
+    new $P688, "Hash"
+  vivify_201:
+    set $P689, $P688["max"]
+    unless_null $P689, vivify_202
+    new $P689, "Undef"
+  vivify_202:
+    isfalse $I690, $P689
+    if $I690, if_687
+.annotate "line", 126
+    find_lex $P696, "$/"
+    unless_null $P696, vivify_203
+    new $P696, "Hash"
+  vivify_203:
+    set $P697, $P696["max"]
+    unless_null $P697, vivify_204
+    new $P697, "ResizablePMCArray"
+  vivify_204:
+    set $P698, $P697[0]
+    unless_null $P698, vivify_205
+    new $P698, "Undef"
+  vivify_205:
+    set $S699, $P698
+    isne $I700, $S699, "*"
+    unless $I700, if_695_end
+    find_lex $P701, "$past"
+    find_lex $P702, "$/"
+    unless_null $P702, vivify_206
+    new $P702, "Hash"
+  vivify_206:
+    set $P703, $P702["max"]
+    unless_null $P703, vivify_207
+    new $P703, "ResizablePMCArray"
+  vivify_207:
+    set $P704, $P703[0]
+    unless_null $P704, vivify_208
+    new $P704, "Undef"
+  vivify_208:
+    set $N705, $P704
+    $P701."max"($N705)
+  if_695_end:
+    goto if_687_end
+  if_687:
+.annotate "line", 125
+    find_lex $P691, "$past"
+    find_lex $P692, "$/"
+    unless_null $P692, vivify_209
+    new $P692, "Hash"
+  vivify_209:
+    set $P693, $P692["min"]
+    unless_null $P693, vivify_210
+    new $P693, "Undef"
+  vivify_210:
+    set $N694, $P693
+    $P691."max"($N694)
+  if_687_end:
+.annotate "line", 123
+    goto if_672_end
+  if_672:
+.annotate "line", 120
+    get_hll_global $P675, ["PAST"], "Regex"
+.annotate "line", 121
+    find_lex $P676, "$/"
+    unless_null $P676, vivify_211
+    new $P676, "Hash"
+  vivify_211:
+    set $P677, $P676["quantified_atom"]
+    unless_null $P677, vivify_212
+    new $P677, "Undef"
+  vivify_212:
+    $P678 = $P677."ast"()
+    find_lex $P679, "$/"
+    $P680 = $P675."new"("quant" :named("pasttype"), 1 :named("min"), $P678 :named("sep"), $P679 :named("node"))
+.annotate "line", 120
+    store_lex "$past", $P680
+  if_672_end:
+.annotate "line", 128
+    find_lex $P706, "$/"
+    find_lex $P707, "$past"
+    find_lex $P708, "$/"
+    unless_null $P708, vivify_213
+    new $P708, "Hash"
+  vivify_213:
+    set $P709, $P708["backmod"]
+    unless_null $P709, vivify_214
+    new $P709, "Undef"
+  vivify_214:
+    $P710 = "backmod"($P707, $P709)
+    $P711 = $P706."!make"($P710)
+.annotate "line", 117
+    .return ($P711)
+  control_667:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P712, exception, "payload"
+    .return ($P712)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "metachar:sym<ws>"  :subid("45_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_716
+.annotate "line", 131
+    new $P715, 'ExceptionHandler'
+    set_addr $P715, control_714
+    $P715."handle_types"(58)
+    push_eh $P715
+    .lex "self", self
+    .lex "$/", param_716
+.annotate "line", 132
+    new $P717, "Undef"
+    .lex "$past", $P717
+.annotate "line", 133
+    get_global $P720, "@MODIFIERS"
+    unless_null $P720, vivify_215
+    new $P720, "ResizablePMCArray"
+  vivify_215:
+    set $P721, $P720[0]
+    unless_null $P721, vivify_216
+    new $P721, "Hash"
+  vivify_216:
+    set $P722, $P721["s"]
+    unless_null $P722, vivify_217
+    new $P722, "Undef"
+  vivify_217:
+    if $P722, if_719
+    new $P726, "Integer"
+    assign $P726, 0
+    set $P718, $P726
+    goto if_719_end
+  if_719:
+    get_hll_global $P723, ["PAST"], "Regex"
+    find_lex $P724, "$/"
+    $P725 = $P723."new"("ws", "subrule" :named("pasttype"), "method" :named("subtype"), $P724 :named("node"))
+    set $P718, $P725
+  if_719_end:
+    store_lex "$past", $P718
+.annotate "line", 136
+    find_lex $P727, "$/"
+    find_lex $P728, "$past"
+    $P729 = $P727."!make"($P728)
+.annotate "line", 131
+    .return ($P729)
+  control_714:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P730, exception, "payload"
+    .return ($P730)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "metachar:sym<[ ]>"  :subid("46_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_734
+.annotate "line", 140
+    new $P733, 'ExceptionHandler'
+    set_addr $P733, control_732
+    $P733."handle_types"(58)
+    push_eh $P733
+    .lex "self", self
+    .lex "$/", param_734
+.annotate "line", 141
+    find_lex $P735, "$/"
+    find_lex $P736, "$/"
+    unless_null $P736, vivify_218
+    new $P736, "Hash"
+  vivify_218:
+    set $P737, $P736["nibbler"]
+    unless_null $P737, vivify_219
+    new $P737, "Undef"
+  vivify_219:
+    $P738 = $P737."ast"()
+    $P739 = $P735."!make"($P738)
+.annotate "line", 140
+    .return ($P739)
+  control_732:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P740, exception, "payload"
+    .return ($P740)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "metachar:sym<( )>"  :subid("47_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_744
+.annotate "line", 144
+    new $P743, 'ExceptionHandler'
+    set_addr $P743, control_742
+    $P743."handle_types"(58)
+    push_eh $P743
+    .lex "self", self
+    .lex "$/", param_744
+.annotate "line", 145
+    new $P745, "Undef"
+    .lex "$subpast", $P745
+.annotate "line", 146
+    new $P746, "Undef"
+    .lex "$past", $P746
+.annotate "line", 145
+    find_lex $P747, "$/"
+    unless_null $P747, vivify_220
+    new $P747, "Hash"
+  vivify_220:
+    set $P748, $P747["nibbler"]
+    unless_null $P748, vivify_221
+    new $P748, "Undef"
+  vivify_221:
+    $P749 = $P748."ast"()
+    $P750 = "buildsub"($P749)
+    store_lex "$subpast", $P750
+.annotate "line", 146
+    get_hll_global $P751, ["PAST"], "Regex"
+    find_lex $P752, "$subpast"
+    find_lex $P753, "$/"
+    $P754 = $P751."new"($P752, "subrule" :named("pasttype"), "capture" :named("subtype"), $P753 :named("node"))
+    store_lex "$past", $P754
+.annotate "line", 148
+    find_lex $P755, "$/"
+    find_lex $P756, "$past"
+    $P757 = $P755."!make"($P756)
+.annotate "line", 144
+    .return ($P757)
+  control_742:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P758, exception, "payload"
+    .return ($P758)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "metachar:sym<'>"  :subid("48_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_762
+.annotate "line", 151
+    new $P761, 'ExceptionHandler'
+    set_addr $P761, control_760
+    $P761."handle_types"(58)
+    push_eh $P761
+    .lex "self", self
+    .lex "$/", param_762
+.annotate "line", 152
+    new $P763, "Undef"
+    .lex "$quote", $P763
+.annotate "line", 154
+    new $P764, "Undef"
+    .lex "$past", $P764
+.annotate "line", 152
+    find_lex $P765, "$/"
+    unless_null $P765, vivify_222
+    new $P765, "Hash"
+  vivify_222:
+    set $P766, $P765["quote_EXPR"]
+    unless_null $P766, vivify_223
+    new $P766, "Undef"
+  vivify_223:
+    $P767 = $P766."ast"()
+    store_lex "$quote", $P767
+.annotate "line", 153
+    get_hll_global $P769, ["PAST"], "Val"
+    find_lex $P770, "$quote"
+    $P771 = $P769."ACCEPTS"($P770)
+    unless $P771, if_768_end
+    find_lex $P772, "$quote"
+    $P773 = $P772."value"()
+    store_lex "$quote", $P773
+  if_768_end:
+.annotate "line", 154
+    get_hll_global $P774, ["PAST"], "Regex"
+    find_lex $P775, "$quote"
+    find_lex $P776, "$/"
+    $P777 = $P774."new"($P775, "literal" :named("pasttype"), $P776 :named("node"))
+    store_lex "$past", $P777
+.annotate "line", 155
+    find_lex $P778, "$/"
+    find_lex $P779, "$past"
+    $P780 = $P778."!make"($P779)
+.annotate "line", 151
+    .return ($P780)
+  control_760:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P781, exception, "payload"
+    .return ($P781)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "metachar:sym<\">"  :subid("49_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_785
+.annotate "line", 158
+    new $P784, 'ExceptionHandler'
+    set_addr $P784, control_783
+    $P784."handle_types"(58)
+    push_eh $P784
+    .lex "self", self
+    .lex "$/", param_785
+.annotate "line", 159
+    new $P786, "Undef"
+    .lex "$quote", $P786
+.annotate "line", 161
+    new $P787, "Undef"
+    .lex "$past", $P787
+.annotate "line", 159
+    find_lex $P788, "$/"
+    unless_null $P788, vivify_224
+    new $P788, "Hash"
+  vivify_224:
+    set $P789, $P788["quote_EXPR"]
+    unless_null $P789, vivify_225
+    new $P789, "Undef"
+  vivify_225:
+    $P790 = $P789."ast"()
+    store_lex "$quote", $P790
+.annotate "line", 160
+    get_hll_global $P792, ["PAST"], "Val"
+    find_lex $P793, "$quote"
+    $P794 = $P792."ACCEPTS"($P793)
+    unless $P794, if_791_end
+    find_lex $P795, "$quote"
+    $P796 = $P795."value"()
+    store_lex "$quote", $P796
+  if_791_end:
+.annotate "line", 161
+    get_hll_global $P797, ["PAST"], "Regex"
+    find_lex $P798, "$quote"
+    find_lex $P799, "$/"
+    $P800 = $P797."new"($P798, "literal" :named("pasttype"), $P799 :named("node"))
+    store_lex "$past", $P800
+.annotate "line", 162
+    find_lex $P801, "$/"
+    find_lex $P802, "$past"
+    $P803 = $P801."!make"($P802)
+.annotate "line", 158
+    .return ($P803)
+  control_783:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P804, exception, "payload"
+    .return ($P804)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "metachar:sym<.>"  :subid("50_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_808
+.annotate "line", 165
+    new $P807, 'ExceptionHandler'
+    set_addr $P807, control_806
+    $P807."handle_types"(58)
+    push_eh $P807
+    .lex "self", self
+    .lex "$/", param_808
+.annotate "line", 166
+    new $P809, "Undef"
+    .lex "$past", $P809
+    get_hll_global $P810, ["PAST"], "Regex"
+    find_lex $P811, "$/"
+    $P812 = $P810."new"("charclass" :named("pasttype"), "." :named("subtype"), $P811 :named("node"))
+    store_lex "$past", $P812
+.annotate "line", 167
+    find_lex $P813, "$/"
+    find_lex $P814, "$past"
+    $P815 = $P813."!make"($P814)
+.annotate "line", 165
+    .return ($P815)
+  control_806:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P816, exception, "payload"
+    .return ($P816)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "metachar:sym<^>"  :subid("51_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_820
+.annotate "line", 170
+    new $P819, 'ExceptionHandler'
+    set_addr $P819, control_818
+    $P819."handle_types"(58)
+    push_eh $P819
+    .lex "self", self
+    .lex "$/", param_820
+.annotate "line", 171
+    new $P821, "Undef"
+    .lex "$past", $P821
+    get_hll_global $P822, ["PAST"], "Regex"
+    find_lex $P823, "$/"
+    $P824 = $P822."new"("anchor" :named("pasttype"), "bos" :named("subtype"), $P823 :named("node"))
+    store_lex "$past", $P824
+.annotate "line", 172
+    find_lex $P825, "$/"
+    find_lex $P826, "$past"
+    $P827 = $P825."!make"($P826)
+.annotate "line", 170
+    .return ($P827)
+  control_818:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P828, exception, "payload"
+    .return ($P828)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "metachar:sym<^^>"  :subid("52_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_832
+.annotate "line", 175
+    new $P831, 'ExceptionHandler'
+    set_addr $P831, control_830
+    $P831."handle_types"(58)
+    push_eh $P831
+    .lex "self", self
+    .lex "$/", param_832
+.annotate "line", 176
+    new $P833, "Undef"
+    .lex "$past", $P833
+    get_hll_global $P834, ["PAST"], "Regex"
+    find_lex $P835, "$/"
+    $P836 = $P834."new"("anchor" :named("pasttype"), "bol" :named("subtype"), $P835 :named("node"))
+    store_lex "$past", $P836
+.annotate "line", 177
+    find_lex $P837, "$/"
+    find_lex $P838, "$past"
+    $P839 = $P837."!make"($P838)
+.annotate "line", 175
+    .return ($P839)
+  control_830:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P840, exception, "payload"
+    .return ($P840)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "metachar:sym<$>"  :subid("53_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_844
+.annotate "line", 180
+    new $P843, 'ExceptionHandler'
+    set_addr $P843, control_842
+    $P843."handle_types"(58)
+    push_eh $P843
+    .lex "self", self
+    .lex "$/", param_844
+.annotate "line", 181
+    new $P845, "Undef"
+    .lex "$past", $P845
+    get_hll_global $P846, ["PAST"], "Regex"
+    find_lex $P847, "$/"
+    $P848 = $P846."new"("anchor" :named("pasttype"), "eos" :named("subtype"), $P847 :named("node"))
+    store_lex "$past", $P848
+.annotate "line", 182
+    find_lex $P849, "$/"
+    find_lex $P850, "$past"
+    $P851 = $P849."!make"($P850)
+.annotate "line", 180
+    .return ($P851)
+  control_842:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P852, exception, "payload"
+    .return ($P852)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "metachar:sym<$$>"  :subid("54_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_856
+.annotate "line", 185
+    new $P855, 'ExceptionHandler'
+    set_addr $P855, control_854
+    $P855."handle_types"(58)
+    push_eh $P855
+    .lex "self", self
+    .lex "$/", param_856
+.annotate "line", 186
+    new $P857, "Undef"
+    .lex "$past", $P857
+    get_hll_global $P858, ["PAST"], "Regex"
+    find_lex $P859, "$/"
+    $P860 = $P858."new"("anchor" :named("pasttype"), "eol" :named("subtype"), $P859 :named("node"))
+    store_lex "$past", $P860
+.annotate "line", 187
+    find_lex $P861, "$/"
+    find_lex $P862, "$past"
+    $P863 = $P861."!make"($P862)
+.annotate "line", 185
+    .return ($P863)
+  control_854:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P864, exception, "payload"
+    .return ($P864)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "metachar:sym<:::>"  :subid("55_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_868
+.annotate "line", 190
+    new $P867, 'ExceptionHandler'
+    set_addr $P867, control_866
+    $P867."handle_types"(58)
+    push_eh $P867
+    .lex "self", self
+    .lex "$/", param_868
+.annotate "line", 191
+    new $P869, "Undef"
+    .lex "$past", $P869
+    get_hll_global $P870, ["PAST"], "Regex"
+    find_lex $P871, "$/"
+    $P872 = $P870."new"("cut" :named("pasttype"), $P871 :named("node"))
+    store_lex "$past", $P872
+.annotate "line", 192
+    find_lex $P873, "$/"
+    find_lex $P874, "$past"
+    $P875 = $P873."!make"($P874)
+.annotate "line", 190
+    .return ($P875)
+  control_866:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P876, exception, "payload"
+    .return ($P876)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "metachar:sym<lwb>"  :subid("56_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_880
+.annotate "line", 195
+    new $P879, 'ExceptionHandler'
+    set_addr $P879, control_878
+    $P879."handle_types"(58)
+    push_eh $P879
+    .lex "self", self
+    .lex "$/", param_880
+.annotate "line", 196
+    new $P881, "Undef"
+    .lex "$past", $P881
+    get_hll_global $P882, ["PAST"], "Regex"
+    find_lex $P883, "$/"
+    $P884 = $P882."new"("anchor" :named("pasttype"), "lwb" :named("subtype"), $P883 :named("node"))
+    store_lex "$past", $P884
+.annotate "line", 197
+    find_lex $P885, "$/"
+    find_lex $P886, "$past"
+    $P887 = $P885."!make"($P886)
+.annotate "line", 195
+    .return ($P887)
+  control_878:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P888, exception, "payload"
+    .return ($P888)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "metachar:sym<rwb>"  :subid("57_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_892
+.annotate "line", 200
+    new $P891, 'ExceptionHandler'
+    set_addr $P891, control_890
+    $P891."handle_types"(58)
+    push_eh $P891
+    .lex "self", self
+    .lex "$/", param_892
+.annotate "line", 201
+    new $P893, "Undef"
+    .lex "$past", $P893
+    get_hll_global $P894, ["PAST"], "Regex"
+    find_lex $P895, "$/"
+    $P896 = $P894."new"("anchor" :named("pasttype"), "rwb" :named("subtype"), $P895 :named("node"))
+    store_lex "$past", $P896
+.annotate "line", 202
+    find_lex $P897, "$/"
+    find_lex $P898, "$past"
+    $P899 = $P897."!make"($P898)
+.annotate "line", 200
+    .return ($P899)
+  control_890:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P900, exception, "payload"
+    .return ($P900)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "metachar:sym<bs>"  :subid("58_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_904
+.annotate "line", 205
+    new $P903, 'ExceptionHandler'
+    set_addr $P903, control_902
+    $P903."handle_types"(58)
+    push_eh $P903
+    .lex "self", self
+    .lex "$/", param_904
+.annotate "line", 206
+    find_lex $P905, "$/"
+    find_lex $P906, "$/"
+    unless_null $P906, vivify_226
+    new $P906, "Hash"
+  vivify_226:
+    set $P907, $P906["backslash"]
+    unless_null $P907, vivify_227
+    new $P907, "Undef"
+  vivify_227:
+    $P908 = $P907."ast"()
+    $P909 = $P905."!make"($P908)
+.annotate "line", 205
+    .return ($P909)
+  control_902:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P910, exception, "payload"
+    .return ($P910)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "metachar:sym<mod>"  :subid("59_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_914
+.annotate "line", 209
+    new $P913, 'ExceptionHandler'
+    set_addr $P913, control_912
+    $P913."handle_types"(58)
+    push_eh $P913
+    .lex "self", self
+    .lex "$/", param_914
+.annotate "line", 210
+    find_lex $P915, "$/"
+    find_lex $P916, "$/"
+    unless_null $P916, vivify_228
+    new $P916, "Hash"
+  vivify_228:
+    set $P917, $P916["mod_internal"]
+    unless_null $P917, vivify_229
+    new $P917, "Undef"
+  vivify_229:
+    $P918 = $P917."ast"()
+    $P919 = $P915."!make"($P918)
+.annotate "line", 209
+    .return ($P919)
+  control_912:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P920, exception, "payload"
+    .return ($P920)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "metachar:sym<assert>"  :subid("60_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_924
+.annotate "line", 213
+    new $P923, 'ExceptionHandler'
+    set_addr $P923, control_922
+    $P923."handle_types"(58)
+    push_eh $P923
+    .lex "self", self
+    .lex "$/", param_924
+.annotate "line", 214
+    find_lex $P925, "$/"
+    find_lex $P926, "$/"
+    unless_null $P926, vivify_230
+    new $P926, "Hash"
+  vivify_230:
+    set $P927, $P926["assertion"]
+    unless_null $P927, vivify_231
+    new $P927, "Undef"
+  vivify_231:
+    $P928 = $P927."ast"()
+    $P929 = $P925."!make"($P928)
+.annotate "line", 213
+    .return ($P929)
+  control_922:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P930, exception, "payload"
+    .return ($P930)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "metachar:sym<~>"  :subid("61_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_934
+.annotate "line", 217
+    new $P933, 'ExceptionHandler'
+    set_addr $P933, control_932
+    $P933."handle_types"(58)
+    push_eh $P933
+    .lex "self", self
+    .lex "$/", param_934
+.annotate "line", 218
+    find_lex $P935, "$/"
+    get_hll_global $P936, ["PAST"], "Regex"
+.annotate "line", 219
+    find_lex $P937, "$/"
+    unless_null $P937, vivify_232
+    new $P937, "Hash"
+  vivify_232:
+    set $P938, $P937["EXPR"]
+    unless_null $P938, vivify_233
+    new $P938, "Undef"
+  vivify_233:
+    $P939 = $P938."ast"()
+.annotate "line", 220
+    get_hll_global $P940, ["PAST"], "Regex"
+.annotate "line", 221
+    find_lex $P941, "$/"
+    unless_null $P941, vivify_234
+    new $P941, "Hash"
+  vivify_234:
+    set $P942, $P941["GOAL"]
+    unless_null $P942, vivify_235
+    new $P942, "Undef"
+  vivify_235:
+    $P943 = $P942."ast"()
+.annotate "line", 222
+    get_hll_global $P944, ["PAST"], "Regex"
+    find_lex $P945, "$/"
+    unless_null $P945, vivify_236
+    new $P945, "Hash"
+  vivify_236:
+    set $P946, $P945["GOAL"]
+    unless_null $P946, vivify_237
+    new $P946, "Undef"
+  vivify_237:
+    set $S947, $P946
+    $P948 = $P944."new"("FAILGOAL", $S947, "subrule" :named("pasttype"), "method" :named("subtype"))
+    $P949 = $P940."new"($P943, $P948, "alt" :named("pasttype"))
+.annotate "line", 220
+    $P950 = $P936."new"($P939, $P949, "concat" :named("pasttype"))
+.annotate "line", 218
+    $P951 = $P935."!make"($P950)
+.annotate "line", 217
+    .return ($P951)
+  control_932:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P952, exception, "payload"
+    .return ($P952)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "metachar:sym<{*}>"  :subid("62_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_956
+.annotate "line", 230
+    new $P955, 'ExceptionHandler'
+    set_addr $P955, control_954
+    $P955."handle_types"(58)
+    push_eh $P955
+    .lex "self", self
+    .lex "$/", param_956
+.annotate "line", 231
+    new $P957, "Undef"
+    .lex "$past", $P957
+.annotate "line", 232
+    find_lex $P960, "$/"
+    unless_null $P960, vivify_238
+    new $P960, "Hash"
+  vivify_238:
+    set $P961, $P960["key"]
+    unless_null $P961, vivify_239
+    new $P961, "Undef"
+  vivify_239:
+    if $P961, if_959
+    new $P969, "Integer"
+    assign $P969, 0
+    set $P958, $P969
+    goto if_959_end
+  if_959:
+    get_hll_global $P962, ["PAST"], "Regex"
+    find_lex $P963, "$/"
+    unless_null $P963, vivify_240
+    new $P963, "Hash"
+  vivify_240:
+    set $P964, $P963["key"]
+    unless_null $P964, vivify_241
+    new $P964, "ResizablePMCArray"
+  vivify_241:
+    set $P965, $P964[0]
+    unless_null $P965, vivify_242
+    new $P965, "Undef"
+  vivify_242:
+    set $S966, $P965
+    find_lex $P967, "$/"
+    $P968 = $P962."new"($S966, "reduce" :named("pasttype"), $P967 :named("node"))
+    set $P958, $P968
+  if_959_end:
+    store_lex "$past", $P958
+.annotate "line", 234
+    find_lex $P970, "$/"
+    find_lex $P971, "$past"
+    $P972 = $P970."!make"($P971)
+.annotate "line", 230
+    .return ($P972)
+  control_954:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P973, exception, "payload"
+    .return ($P973)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "metachar:sym<var>"  :subid("63_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_977
+.annotate "line", 237
+    new $P976, 'ExceptionHandler'
+    set_addr $P976, control_975
+    $P976."handle_types"(58)
+    push_eh $P976
+    .lex "self", self
+    .lex "$/", param_977
+.annotate "line", 238
+    new $P978, "Undef"
+    .lex "$past", $P978
+.annotate "line", 239
+    new $P979, "Undef"
+    .lex "$name", $P979
+.annotate "line", 237
+    find_lex $P980, "$past"
+.annotate "line", 239
+    find_lex $P983, "$/"
+    unless_null $P983, vivify_243
+    new $P983, "Hash"
+  vivify_243:
+    set $P984, $P983["pos"]
+    unless_null $P984, vivify_244
+    new $P984, "Undef"
+  vivify_244:
+    if $P984, if_982
+    find_lex $P988, "$/"
+    unless_null $P988, vivify_245
+    new $P988, "Hash"
+  vivify_245:
+    set $P989, $P988["name"]
+    unless_null $P989, vivify_246
+    new $P989, "Undef"
+  vivify_246:
+    set $S990, $P989
+    new $P981, 'String'
+    set $P981, $S990
+    goto if_982_end
+  if_982:
+    find_lex $P985, "$/"
+    unless_null $P985, vivify_247
+    new $P985, "Hash"
+  vivify_247:
+    set $P986, $P985["pos"]
+    unless_null $P986, vivify_248
+    new $P986, "Undef"
+  vivify_248:
+    set $N987, $P986
+    new $P981, 'Float'
+    set $P981, $N987
+  if_982_end:
+    store_lex "$name", $P981
+.annotate "line", 240
+    find_lex $P992, "$/"
+    unless_null $P992, vivify_249
+    new $P992, "Hash"
+  vivify_249:
+    set $P993, $P992["quantified_atom"]
+    unless_null $P993, vivify_250
+    new $P993, "Undef"
+  vivify_250:
+    if $P993, if_991
+.annotate "line", 251
+    get_hll_global $P1022, ["PAST"], "Regex"
+    find_lex $P1023, "$name"
+    find_lex $P1024, "$/"
+    $P1025 = $P1022."new"("!BACKREF", $P1023, "subrule" :named("pasttype"), "method" :named("subtype"), $P1024 :named("node"))
+    store_lex "$past", $P1025
+.annotate "line", 250
+    goto if_991_end
+  if_991:
+.annotate "line", 241
+    find_lex $P994, "$/"
+    unless_null $P994, vivify_251
+    new $P994, "Hash"
+  vivify_251:
+    set $P995, $P994["quantified_atom"]
+    unless_null $P995, vivify_252
+    new $P995, "ResizablePMCArray"
+  vivify_252:
+    set $P996, $P995[0]
+    unless_null $P996, vivify_253
+    new $P996, "Undef"
+  vivify_253:
+    $P997 = $P996."ast"()
+    store_lex "$past", $P997
+.annotate "line", 242
+    find_lex $P1001, "$past"
+    $S1002 = $P1001."pasttype"()
+    iseq $I1003, $S1002, "quant"
+    if $I1003, if_1000
+    new $P999, 'Integer'
+    set $P999, $I1003
+    goto if_1000_end
+  if_1000:
+    find_lex $P1004, "$past"
+    unless_null $P1004, vivify_254
+    new $P1004, "ResizablePMCArray"
+  vivify_254:
+    set $P1005, $P1004[0]
+    unless_null $P1005, vivify_255
+    new $P1005, "Undef"
+  vivify_255:
+    $S1006 = $P1005."pasttype"()
+    iseq $I1007, $S1006, "subrule"
+    new $P999, 'Integer'
+    set $P999, $I1007
+  if_1000_end:
+    if $P999, if_998
+.annotate "line", 245
+    find_lex $P1012, "$past"
+    $S1013 = $P1012."pasttype"()
+    iseq $I1014, $S1013, "subrule"
+    if $I1014, if_1011
+.annotate "line", 247
+    get_hll_global $P1017, ["PAST"], "Regex"
+    find_lex $P1018, "$past"
+    find_lex $P1019, "$name"
+    find_lex $P1020, "$/"
+    $P1021 = $P1017."new"($P1018, $P1019 :named("name"), "subcapture" :named("pasttype"), $P1020 :named("node"))
+    store_lex "$past", $P1021
+.annotate "line", 246
+    goto if_1011_end
+  if_1011:
+.annotate "line", 245
+    find_lex $P1015, "$past"
+    find_lex $P1016, "$name"
+    "subrule_alias"($P1015, $P1016)
+  if_1011_end:
+    goto if_998_end
+  if_998:
+.annotate "line", 243
+    find_lex $P1008, "$past"
+    unless_null $P1008, vivify_256
+    new $P1008, "ResizablePMCArray"
+  vivify_256:
+    set $P1009, $P1008[0]
+    unless_null $P1009, vivify_257
+    new $P1009, "Undef"
+  vivify_257:
+    find_lex $P1010, "$name"
+    "subrule_alias"($P1009, $P1010)
+  if_998_end:
+  if_991_end:
+.annotate "line", 254
+    find_lex $P1026, "$/"
+    find_lex $P1027, "$past"
+    $P1028 = $P1026."!make"($P1027)
+.annotate "line", 237
+    .return ($P1028)
+  control_975:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1029, exception, "payload"
+    .return ($P1029)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "metachar:sym<PIR>"  :subid("64_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_1033
+.annotate "line", 257
+    new $P1032, 'ExceptionHandler'
+    set_addr $P1032, control_1031
+    $P1032."handle_types"(58)
+    push_eh $P1032
+    .lex "self", self
+    .lex "$/", param_1033
+.annotate "line", 258
+    find_lex $P1034, "$/"
+    get_hll_global $P1035, ["PAST"], "Regex"
+.annotate "line", 259
+    get_hll_global $P1036, ["PAST"], "Op"
+    find_lex $P1037, "$/"
+    unless_null $P1037, vivify_258
+    new $P1037, "Hash"
+  vivify_258:
+    set $P1038, $P1037["pir"]
+    unless_null $P1038, vivify_259
+    new $P1038, "Undef"
+  vivify_259:
+    set $S1039, $P1038
+    $P1040 = $P1036."new"($S1039 :named("inline"), "inline" :named("pasttype"))
+    find_lex $P1041, "$/"
+    $P1042 = $P1035."new"($P1040, "pastnode" :named("pasttype"), $P1041 :named("node"))
+.annotate "line", 258
+    $P1043 = $P1034."!make"($P1042)
+.annotate "line", 257
+    .return ($P1043)
+  control_1031:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1044, exception, "payload"
+    .return ($P1044)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "backslash:sym<w>"  :subid("65_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_1048
+.annotate "line", 265
+    new $P1047, 'ExceptionHandler'
+    set_addr $P1047, control_1046
+    $P1047."handle_types"(58)
+    push_eh $P1047
+    .lex "self", self
+    .lex "$/", param_1048
+.annotate "line", 266
+    new $P1049, "Undef"
+    .lex "$subtype", $P1049
+.annotate "line", 267
+    new $P1050, "Undef"
+    .lex "$past", $P1050
+.annotate "line", 266
+    find_lex $P1053, "$/"
+    unless_null $P1053, vivify_260
+    new $P1053, "Hash"
+  vivify_260:
+    set $P1054, $P1053["sym"]
+    unless_null $P1054, vivify_261
+    new $P1054, "Undef"
+  vivify_261:
+    set $S1055, $P1054
+    iseq $I1056, $S1055, "n"
+    if $I1056, if_1052
+    find_lex $P1058, "$/"
+    unless_null $P1058, vivify_262
+    new $P1058, "Hash"
+  vivify_262:
+    set $P1059, $P1058["sym"]
+    unless_null $P1059, vivify_263
+    new $P1059, "Undef"
+  vivify_263:
+    set $S1060, $P1059
+    new $P1051, 'String'
+    set $P1051, $S1060
+    goto if_1052_end
+  if_1052:
+    new $P1057, "String"
+    assign $P1057, "nl"
+    set $P1051, $P1057
+  if_1052_end:
+    store_lex "$subtype", $P1051
+.annotate "line", 267
+    get_hll_global $P1061, ["PAST"], "Regex"
+    find_lex $P1062, "$subtype"
+    find_lex $P1063, "$/"
+    $P1064 = $P1061."new"("charclass" :named("pasttype"), $P1062 :named("subtype"), $P1063 :named("node"))
+    store_lex "$past", $P1064
+.annotate "line", 268
+    find_lex $P1065, "$/"
+    find_lex $P1066, "$past"
+    $P1067 = $P1065."!make"($P1066)
+.annotate "line", 265
+    .return ($P1067)
+  control_1046:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1068, exception, "payload"
+    .return ($P1068)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "backslash:sym<b>"  :subid("66_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_1072
+.annotate "line", 271
+    new $P1071, 'ExceptionHandler'
+    set_addr $P1071, control_1070
+    $P1071."handle_types"(58)
+    push_eh $P1071
+    .lex "self", self
+    .lex "$/", param_1072
+.annotate "line", 272
+    new $P1073, "Undef"
+    .lex "$past", $P1073
+    get_hll_global $P1074, ["PAST"], "Regex"
+.annotate "line", 273
+    find_lex $P1075, "$/"
+    unless_null $P1075, vivify_264
+    new $P1075, "Hash"
+  vivify_264:
+    set $P1076, $P1075["sym"]
+    unless_null $P1076, vivify_265
+    new $P1076, "Undef"
+  vivify_265:
+    set $S1077, $P1076
+    iseq $I1078, $S1077, "B"
+    find_lex $P1079, "$/"
+    $P1080 = $P1074."new"("\b", "enumcharlist" :named("pasttype"), $I1078 :named("negate"), $P1079 :named("node"))
+.annotate "line", 272
+    store_lex "$past", $P1080
+.annotate "line", 274
+    find_lex $P1081, "$/"
+    find_lex $P1082, "$past"
+    $P1083 = $P1081."!make"($P1082)
+.annotate "line", 271
+    .return ($P1083)
+  control_1070:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1084, exception, "payload"
+    .return ($P1084)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "backslash:sym<e>"  :subid("67_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_1088
+.annotate "line", 277
+    new $P1087, 'ExceptionHandler'
+    set_addr $P1087, control_1086
+    $P1087."handle_types"(58)
+    push_eh $P1087
+    .lex "self", self
+    .lex "$/", param_1088
+.annotate "line", 278
+    new $P1089, "Undef"
+    .lex "$past", $P1089
+    get_hll_global $P1090, ["PAST"], "Regex"
+.annotate "line", 279
+    find_lex $P1091, "$/"
+    unless_null $P1091, vivify_266
+    new $P1091, "Hash"
+  vivify_266:
+    set $P1092, $P1091["sym"]
+    unless_null $P1092, vivify_267
+    new $P1092, "Undef"
+  vivify_267:
+    set $S1093, $P1092
+    iseq $I1094, $S1093, "E"
+    find_lex $P1095, "$/"
+    $P1096 = $P1090."new"("\\e", "enumcharlist" :named("pasttype"), $I1094 :named("negate"), $P1095 :named("node"))
+.annotate "line", 278
+    store_lex "$past", $P1096
+.annotate "line", 280
+    find_lex $P1097, "$/"
+    find_lex $P1098, "$past"
+    $P1099 = $P1097."!make"($P1098)
+.annotate "line", 277
+    .return ($P1099)
+  control_1086:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1100, exception, "payload"
+    .return ($P1100)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "backslash:sym<f>"  :subid("68_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_1104
+.annotate "line", 283
+    new $P1103, 'ExceptionHandler'
+    set_addr $P1103, control_1102
+    $P1103."handle_types"(58)
+    push_eh $P1103
+    .lex "self", self
+    .lex "$/", param_1104
+.annotate "line", 284
+    new $P1105, "Undef"
+    .lex "$past", $P1105
+    get_hll_global $P1106, ["PAST"], "Regex"
+.annotate "line", 285
+    find_lex $P1107, "$/"
+    unless_null $P1107, vivify_268
+    new $P1107, "Hash"
+  vivify_268:
+    set $P1108, $P1107["sym"]
+    unless_null $P1108, vivify_269
+    new $P1108, "Undef"
+  vivify_269:
+    set $S1109, $P1108
+    iseq $I1110, $S1109, "F"
+    find_lex $P1111, "$/"
+    $P1112 = $P1106."new"("\\f", "enumcharlist" :named("pasttype"), $I1110 :named("negate"), $P1111 :named("node"))
+.annotate "line", 284
+    store_lex "$past", $P1112
+.annotate "line", 286
+    find_lex $P1113, "$/"
+    find_lex $P1114, "$past"
+    $P1115 = $P1113."!make"($P1114)
+.annotate "line", 283
+    .return ($P1115)
+  control_1102:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1116, exception, "payload"
+    .return ($P1116)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "backslash:sym<h>"  :subid("69_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_1120
+.annotate "line", 289
+    new $P1119, 'ExceptionHandler'
+    set_addr $P1119, control_1118
+    $P1119."handle_types"(58)
+    push_eh $P1119
+    .lex "self", self
+    .lex "$/", param_1120
+.annotate "line", 290
+    new $P1121, "Undef"
+    .lex "$past", $P1121
+    get_hll_global $P1122, ["PAST"], "Regex"
+.annotate "line", 291
+    find_lex $P1123, "$/"
+    unless_null $P1123, vivify_270
+    new $P1123, "Hash"
+  vivify_270:
+    set $P1124, $P1123["sym"]
+    unless_null $P1124, vivify_271
+    new $P1124, "Undef"
+  vivify_271:
+    set $S1125, $P1124
+    iseq $I1126, $S1125, "H"
+    find_lex $P1127, "$/"
+    $P1128 = $P1122."new"(unicode:"\t \x{a0}\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000", "enumcharlist" :named("pasttype"), $I1126 :named("negate"), $P1127 :named("node"))
+.annotate "line", 290
+    store_lex "$past", $P1128
+.annotate "line", 292
+    find_lex $P1129, "$/"
+    find_lex $P1130, "$past"
+    $P1131 = $P1129."!make"($P1130)
+.annotate "line", 289
+    .return ($P1131)
+  control_1118:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1132, exception, "payload"
+    .return ($P1132)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "backslash:sym<r>"  :subid("70_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_1136
+.annotate "line", 295
+    new $P1135, 'ExceptionHandler'
+    set_addr $P1135, control_1134
+    $P1135."handle_types"(58)
+    push_eh $P1135
+    .lex "self", self
+    .lex "$/", param_1136
+.annotate "line", 296
+    new $P1137, "Undef"
+    .lex "$past", $P1137
+    get_hll_global $P1138, ["PAST"], "Regex"
+.annotate "line", 297
+    find_lex $P1139, "$/"
+    unless_null $P1139, vivify_272
+    new $P1139, "Hash"
+  vivify_272:
+    set $P1140, $P1139["sym"]
+    unless_null $P1140, vivify_273
+    new $P1140, "Undef"
+  vivify_273:
+    set $S1141, $P1140
+    iseq $I1142, $S1141, "R"
+    find_lex $P1143, "$/"
+    $P1144 = $P1138."new"("\r", "enumcharlist" :named("pasttype"), $I1142 :named("negate"), $P1143 :named("node"))
+.annotate "line", 296
+    store_lex "$past", $P1144
+.annotate "line", 298
+    find_lex $P1145, "$/"
+    find_lex $P1146, "$past"
+    $P1147 = $P1145."!make"($P1146)
+.annotate "line", 295
+    .return ($P1147)
+  control_1134:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1148, exception, "payload"
+    .return ($P1148)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "backslash:sym<t>"  :subid("71_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_1152
+.annotate "line", 301
+    new $P1151, 'ExceptionHandler'
+    set_addr $P1151, control_1150
+    $P1151."handle_types"(58)
+    push_eh $P1151
+    .lex "self", self
+    .lex "$/", param_1152
+.annotate "line", 302
+    new $P1153, "Undef"
+    .lex "$past", $P1153
+    get_hll_global $P1154, ["PAST"], "Regex"
+.annotate "line", 303
+    find_lex $P1155, "$/"
+    unless_null $P1155, vivify_274
+    new $P1155, "Hash"
+  vivify_274:
+    set $P1156, $P1155["sym"]
+    unless_null $P1156, vivify_275
+    new $P1156, "Undef"
+  vivify_275:
+    set $S1157, $P1156
+    iseq $I1158, $S1157, "T"
+    find_lex $P1159, "$/"
+    $P1160 = $P1154."new"("\t", "enumcharlist" :named("pasttype"), $I1158 :named("negate"), $P1159 :named("node"))
+.annotate "line", 302
+    store_lex "$past", $P1160
+.annotate "line", 304
+    find_lex $P1161, "$/"
+    find_lex $P1162, "$past"
+    $P1163 = $P1161."!make"($P1162)
+.annotate "line", 301
+    .return ($P1163)
+  control_1150:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1164, exception, "payload"
+    .return ($P1164)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "backslash:sym<v>"  :subid("72_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_1168
+.annotate "line", 307
+    new $P1167, 'ExceptionHandler'
+    set_addr $P1167, control_1166
+    $P1167."handle_types"(58)
+    push_eh $P1167
+    .lex "self", self
+    .lex "$/", param_1168
+.annotate "line", 308
+    new $P1169, "Undef"
+    .lex "$past", $P1169
+    get_hll_global $P1170, ["PAST"], "Regex"
+.annotate "line", 310
+    find_lex $P1171, "$/"
+    unless_null $P1171, vivify_276
+    new $P1171, "Hash"
+  vivify_276:
+    set $P1172, $P1171["sym"]
+    unless_null $P1172, vivify_277
+    new $P1172, "Undef"
+  vivify_277:
+    set $S1173, $P1172
+    iseq $I1174, $S1173, "V"
+    find_lex $P1175, "$/"
+    $P1176 = $P1170."new"(unicode:"\n\x{b}\f\r\x{85}\u2028\u2029", "enumcharlist" :named("pasttype"), $I1174 :named("negate"), $P1175 :named("node"))
+.annotate "line", 308
+    store_lex "$past", $P1176
+.annotate "line", 311
+    find_lex $P1177, "$/"
+    find_lex $P1178, "$past"
+    $P1179 = $P1177."!make"($P1178)
+.annotate "line", 307
+    .return ($P1179)
+  control_1166:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1180, exception, "payload"
+    .return ($P1180)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "backslash:sym<o>"  :subid("73_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_1184
+.annotate "line", 314
+    new $P1183, 'ExceptionHandler'
+    set_addr $P1183, control_1182
+    $P1183."handle_types"(58)
+    push_eh $P1183
+    .lex "self", self
+    .lex "$/", param_1184
+.annotate "line", 315
+    new $P1185, "Undef"
+    .lex "$octlit", $P1185
+.annotate "line", 316
+    get_hll_global $P1186, ["HLL";"Actions"], "ints_to_string"
+    find_lex $P1189, "$/"
+    unless_null $P1189, vivify_278
+    new $P1189, "Hash"
+  vivify_278:
+    set $P1190, $P1189["octint"]
+    unless_null $P1190, vivify_279
+    new $P1190, "Undef"
+  vivify_279:
+    unless $P1190, unless_1188
+    set $P1187, $P1190
+    goto unless_1188_end
+  unless_1188:
+    find_lex $P1191, "$/"
+    unless_null $P1191, vivify_280
+    new $P1191, "Hash"
+  vivify_280:
+    set $P1192, $P1191["octints"]
+    unless_null $P1192, vivify_281
+    new $P1192, "Hash"
+  vivify_281:
+    set $P1193, $P1192["octint"]
+    unless_null $P1193, vivify_282
+    new $P1193, "Undef"
+  vivify_282:
+    set $P1187, $P1193
+  unless_1188_end:
+    $P1194 = $P1186($P1187)
+    store_lex "$octlit", $P1194
+.annotate "line", 317
+    find_lex $P1195, "$/"
+    find_lex $P1198, "$/"
+    unless_null $P1198, vivify_283
+    new $P1198, "Hash"
+  vivify_283:
+    set $P1199, $P1198["sym"]
+    unless_null $P1199, vivify_284
+    new $P1199, "Undef"
+  vivify_284:
+    set $S1200, $P1199
+    iseq $I1201, $S1200, "O"
+    if $I1201, if_1197
+.annotate "line", 320
+    get_hll_global $P1206, ["PAST"], "Regex"
+    find_lex $P1207, "$octlit"
+    find_lex $P1208, "$/"
+    $P1209 = $P1206."new"($P1207, "literal" :named("pasttype"), $P1208 :named("node"))
+    set $P1196, $P1209
+.annotate "line", 317
+    goto if_1197_end
+  if_1197:
+.annotate "line", 318
+    get_hll_global $P1202, ["PAST"], "Regex"
+    find_lex $P1203, "$octlit"
+    find_lex $P1204, "$/"
+    $P1205 = $P1202."new"($P1203, "enumcharlist" :named("pasttype"), 1 :named("negate"), $P1204 :named("node"))
+    set $P1196, $P1205
+  if_1197_end:
+    $P1210 = $P1195."!make"($P1196)
+.annotate "line", 314
+    .return ($P1210)
+  control_1182:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1211, exception, "payload"
+    .return ($P1211)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "backslash:sym<x>"  :subid("74_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_1215
+.annotate "line", 323
+    new $P1214, 'ExceptionHandler'
+    set_addr $P1214, control_1213
+    $P1214."handle_types"(58)
+    push_eh $P1214
+    .lex "self", self
+    .lex "$/", param_1215
+.annotate "line", 324
+    new $P1216, "Undef"
+    .lex "$hexlit", $P1216
+.annotate "line", 325
+    get_hll_global $P1217, ["HLL";"Actions"], "ints_to_string"
+    find_lex $P1220, "$/"
+    unless_null $P1220, vivify_285
+    new $P1220, "Hash"
+  vivify_285:
+    set $P1221, $P1220["hexint"]
+    unless_null $P1221, vivify_286
+    new $P1221, "Undef"
+  vivify_286:
+    unless $P1221, unless_1219
+    set $P1218, $P1221
+    goto unless_1219_end
+  unless_1219:
+    find_lex $P1222, "$/"
+    unless_null $P1222, vivify_287
+    new $P1222, "Hash"
+  vivify_287:
+    set $P1223, $P1222["hexints"]
+    unless_null $P1223, vivify_288
+    new $P1223, "Hash"
+  vivify_288:
+    set $P1224, $P1223["hexint"]
+    unless_null $P1224, vivify_289
+    new $P1224, "Undef"
+  vivify_289:
+    set $P1218, $P1224
+  unless_1219_end:
+    $P1225 = $P1217($P1218)
+    store_lex "$hexlit", $P1225
+.annotate "line", 326
+    find_lex $P1226, "$/"
+    find_lex $P1229, "$/"
+    unless_null $P1229, vivify_290
+    new $P1229, "Hash"
+  vivify_290:
+    set $P1230, $P1229["sym"]
+    unless_null $P1230, vivify_291
+    new $P1230, "Undef"
+  vivify_291:
+    set $S1231, $P1230
+    iseq $I1232, $S1231, "X"
+    if $I1232, if_1228
+.annotate "line", 329
+    get_hll_global $P1237, ["PAST"], "Regex"
+    find_lex $P1238, "$hexlit"
+    find_lex $P1239, "$/"
+    $P1240 = $P1237."new"($P1238, "literal" :named("pasttype"), $P1239 :named("node"))
+    set $P1227, $P1240
+.annotate "line", 326
+    goto if_1228_end
+  if_1228:
+.annotate "line", 327
+    get_hll_global $P1233, ["PAST"], "Regex"
+    find_lex $P1234, "$hexlit"
+    find_lex $P1235, "$/"
+    $P1236 = $P1233."new"($P1234, "enumcharlist" :named("pasttype"), 1 :named("negate"), $P1235 :named("node"))
+    set $P1227, $P1236
+  if_1228_end:
+    $P1241 = $P1226."!make"($P1227)
+.annotate "line", 323
+    .return ($P1241)
+  control_1213:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1242, exception, "payload"
+    .return ($P1242)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "backslash:sym<misc>"  :subid("75_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_1246
+.annotate "line", 332
+    new $P1245, 'ExceptionHandler'
+    set_addr $P1245, control_1244
+    $P1245."handle_types"(58)
+    push_eh $P1245
+    .lex "self", self
+    .lex "$/", param_1246
+.annotate "line", 333
+    new $P1247, "Undef"
+    .lex "$past", $P1247
+    get_hll_global $P1248, ["PAST"], "Regex"
+    find_lex $P1249, "$/"
+    set $S1250, $P1249
+    find_lex $P1251, "$/"
+    $P1252 = $P1248."new"($S1250, "literal" :named("pasttype"), $P1251 :named("node"))
+    store_lex "$past", $P1252
+.annotate "line", 334
+    find_lex $P1253, "$/"
+    find_lex $P1254, "$past"
+    $P1255 = $P1253."!make"($P1254)
+.annotate "line", 332
+    .return ($P1255)
+  control_1244:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1256, exception, "payload"
+    .return ($P1256)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "assertion:sym<?>"  :subid("76_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_1260
+.annotate "line", 338
+    new $P1259, 'ExceptionHandler'
+    set_addr $P1259, control_1258
+    $P1259."handle_types"(58)
+    push_eh $P1259
+    .lex "self", self
+    .lex "$/", param_1260
+.annotate "line", 339
+    new $P1261, "Undef"
+    .lex "$past", $P1261
+.annotate "line", 338
+    find_lex $P1262, "$past"
+.annotate "line", 340
+    find_lex $P1264, "$/"
+    unless_null $P1264, vivify_292
+    new $P1264, "Hash"
+  vivify_292:
+    set $P1265, $P1264["assertion"]
+    unless_null $P1265, vivify_293
+    new $P1265, "Undef"
+  vivify_293:
+    if $P1265, if_1263
+.annotate "line", 344
+    new $P1270, "Integer"
+    assign $P1270, 0
+    store_lex "$past", $P1270
+    goto if_1263_end
+  if_1263:
+.annotate "line", 341
+    find_lex $P1266, "$/"
+    unless_null $P1266, vivify_294
+    new $P1266, "Hash"
+  vivify_294:
+    set $P1267, $P1266["assertion"]
+    unless_null $P1267, vivify_295
+    new $P1267, "Undef"
+  vivify_295:
+    $P1268 = $P1267."ast"()
+    store_lex "$past", $P1268
+.annotate "line", 342
+    find_lex $P1269, "$past"
+    $P1269."subtype"("zerowidth")
+  if_1263_end:
+.annotate "line", 345
+    find_lex $P1271, "$/"
+    find_lex $P1272, "$past"
+    $P1273 = $P1271."!make"($P1272)
+.annotate "line", 338
+    .return ($P1273)
+  control_1258:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1274, exception, "payload"
+    .return ($P1274)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "assertion:sym<!>"  :subid("77_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_1278
+.annotate "line", 348
+    new $P1277, 'ExceptionHandler'
+    set_addr $P1277, control_1276
+    $P1277."handle_types"(58)
+    push_eh $P1277
+    .lex "self", self
+    .lex "$/", param_1278
+.annotate "line", 349
+    new $P1279, "Undef"
+    .lex "$past", $P1279
+.annotate "line", 348
+    find_lex $P1280, "$past"
+.annotate "line", 350
+    find_lex $P1282, "$/"
+    unless_null $P1282, vivify_296
+    new $P1282, "Hash"
+  vivify_296:
+    set $P1283, $P1282["assertion"]
+    unless_null $P1283, vivify_297
+    new $P1283, "Undef"
+  vivify_297:
+    if $P1283, if_1281
+.annotate "line", 356
+    get_hll_global $P1292, ["PAST"], "Regex"
+    find_lex $P1293, "$/"
+    $P1294 = $P1292."new"("anchor" :named("pasttype"), "fail" :named("subtype"), $P1293 :named("node"))
+    store_lex "$past", $P1294
+.annotate "line", 355
+    goto if_1281_end
+  if_1281:
+.annotate "line", 351
+    find_lex $P1284, "$/"
+    unless_null $P1284, vivify_298
+    new $P1284, "Hash"
+  vivify_298:
+    set $P1285, $P1284["assertion"]
+    unless_null $P1285, vivify_299
+    new $P1285, "Undef"
+  vivify_299:
+    $P1286 = $P1285."ast"()
+    store_lex "$past", $P1286
+.annotate "line", 352
+    find_lex $P1287, "$past"
+    find_lex $P1288, "$past"
+    $P1289 = $P1288."negate"()
+    isfalse $I1290, $P1289
+    $P1287."negate"($I1290)
+.annotate "line", 353
+    find_lex $P1291, "$past"
+    $P1291."subtype"("zerowidth")
+  if_1281_end:
+.annotate "line", 358
+    find_lex $P1295, "$/"
+    find_lex $P1296, "$past"
+    $P1297 = $P1295."!make"($P1296)
+.annotate "line", 348
+    .return ($P1297)
+  control_1276:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1298, exception, "payload"
+    .return ($P1298)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "assertion:sym<method>"  :subid("78_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_1302
+.annotate "line", 361
+    new $P1301, 'ExceptionHandler'
+    set_addr $P1301, control_1300
+    $P1301."handle_types"(58)
+    push_eh $P1301
+    .lex "self", self
+    .lex "$/", param_1302
+.annotate "line", 362
+    new $P1303, "Undef"
+    .lex "$past", $P1303
+    find_lex $P1304, "$/"
+    unless_null $P1304, vivify_300
+    new $P1304, "Hash"
+  vivify_300:
+    set $P1305, $P1304["assertion"]
+    unless_null $P1305, vivify_301
+    new $P1305, "Undef"
+  vivify_301:
+    $P1306 = $P1305."ast"()
+    store_lex "$past", $P1306
+.annotate "line", 363
+    find_lex $P1307, "$past"
+    $P1307."subtype"("method")
+.annotate "line", 364
+    find_lex $P1308, "$past"
+    $P1308."name"("")
+.annotate "line", 365
+    find_lex $P1309, "$/"
+    find_lex $P1310, "$past"
+    $P1311 = $P1309."!make"($P1310)
+.annotate "line", 361
+    .return ($P1311)
+  control_1300:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1312, exception, "payload"
+    .return ($P1312)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "assertion:sym<name>"  :subid("79_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_1316
+.annotate "line", 368
+    .const 'Sub' $P1374 = "81_1261064016.27984" 
+    capture_lex $P1374
+    .const 'Sub' $P1338 = "80_1261064016.27984" 
+    capture_lex $P1338
+    new $P1315, 'ExceptionHandler'
+    set_addr $P1315, control_1314
+    $P1315."handle_types"(58)
+    push_eh $P1315
+    .lex "self", self
+    .lex "$/", param_1316
+.annotate "line", 369
+    new $P1317, "Undef"
+    .lex "$name", $P1317
+.annotate "line", 370
+    new $P1318, "Undef"
+    .lex "$past", $P1318
+.annotate "line", 369
+    find_lex $P1319, "$/"
+    unless_null $P1319, vivify_302
+    new $P1319, "Hash"
+  vivify_302:
+    set $P1320, $P1319["longname"]
+    unless_null $P1320, vivify_303
+    new $P1320, "Undef"
+  vivify_303:
+    set $S1321, $P1320
+    new $P1322, 'String'
+    set $P1322, $S1321
+    store_lex "$name", $P1322
+    find_lex $P1323, "$past"
+.annotate "line", 371
+    find_lex $P1325, "$/"
+    unless_null $P1325, vivify_304
+    new $P1325, "Hash"
+  vivify_304:
+    set $P1326, $P1325["assertion"]
+    unless_null $P1326, vivify_305
+    new $P1326, "Undef"
+  vivify_305:
+    if $P1326, if_1324
+.annotate "line", 375
+    find_lex $P1334, "$name"
+    set $S1335, $P1334
+    iseq $I1336, $S1335, "sym"
+    if $I1336, if_1333
+.annotate "line", 391
+    get_hll_global $P1348, ["PAST"], "Regex"
+    find_lex $P1349, "$name"
+    find_lex $P1350, "$name"
+    find_lex $P1351, "$/"
+    $P1352 = $P1348."new"($P1349, $P1350 :named("name"), "subrule" :named("pasttype"), "capture" :named("subtype"), $P1351 :named("node"))
+    store_lex "$past", $P1352
+.annotate "line", 393
+    find_lex $P1354, "$/"
+    unless_null $P1354, vivify_306
+    new $P1354, "Hash"
+  vivify_306:
+    set $P1355, $P1354["nibbler"]
+    unless_null $P1355, vivify_307
+    new $P1355, "Undef"
+  vivify_307:
+    if $P1355, if_1353
+.annotate "line", 396
+    find_lex $P1363, "$/"
+    unless_null $P1363, vivify_308
+    new $P1363, "Hash"
+  vivify_308:
+    set $P1364, $P1363["arglist"]
+    unless_null $P1364, vivify_309
+    new $P1364, "Undef"
+  vivify_309:
+    unless $P1364, if_1362_end
+.annotate "line", 397
+    find_lex $P1366, "$/"
+    unless_null $P1366, vivify_310
+    new $P1366, "Hash"
+  vivify_310:
+    set $P1367, $P1366["arglist"]
+    unless_null $P1367, vivify_311
+    new $P1367, "ResizablePMCArray"
+  vivify_311:
+    set $P1368, $P1367[0]
+    unless_null $P1368, vivify_312
+    new $P1368, "Undef"
+  vivify_312:
+    $P1369 = $P1368."ast"()
+    $P1370 = $P1369."list"()
+    defined $I1371, $P1370
+    unless $I1371, for_undef_313
+    iter $P1365, $P1370
+    new $P1380, 'ExceptionHandler'
+    set_addr $P1380, loop1379_handler
+    $P1380."handle_types"(65, 67, 66)
+    push_eh $P1380
+  loop1379_test:
+    unless $P1365, loop1379_done
+    shift $P1372, $P1365
+  loop1379_redo:
+    .const 'Sub' $P1374 = "81_1261064016.27984" 
+    capture_lex $P1374
+    $P1374($P1372)
+  loop1379_next:
+    goto loop1379_test
+  loop1379_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1381, exception, 'type'
+    eq $P1381, 65, loop1379_next
+    eq $P1381, 67, loop1379_redo
+  loop1379_done:
+    pop_eh 
+  for_undef_313:
+  if_1362_end:
+.annotate "line", 396
+    goto if_1353_end
+  if_1353:
+.annotate "line", 394
+    find_lex $P1356, "$past"
+    find_lex $P1357, "$/"
+    unless_null $P1357, vivify_314
+    new $P1357, "Hash"
+  vivify_314:
+    set $P1358, $P1357["nibbler"]
+    unless_null $P1358, vivify_315
+    new $P1358, "ResizablePMCArray"
+  vivify_315:
+    set $P1359, $P1358[0]
+    unless_null $P1359, vivify_316
+    new $P1359, "Undef"
+  vivify_316:
+    $P1360 = $P1359."ast"()
+    $P1361 = "buildsub"($P1360)
+    $P1356."push"($P1361)
+  if_1353_end:
+.annotate "line", 390
+    goto if_1333_end
+  if_1333:
+.annotate "line", 375
+    .const 'Sub' $P1338 = "80_1261064016.27984" 
+    capture_lex $P1338
+    $P1338()
+  if_1333_end:
+    goto if_1324_end
+  if_1324:
+.annotate "line", 372
+    find_lex $P1327, "$/"
+    unless_null $P1327, vivify_317
+    new $P1327, "Hash"
+  vivify_317:
+    set $P1328, $P1327["assertion"]
+    unless_null $P1328, vivify_318
+    new $P1328, "ResizablePMCArray"
+  vivify_318:
+    set $P1329, $P1328[0]
+    unless_null $P1329, vivify_319
+    new $P1329, "Undef"
+  vivify_319:
+    $P1330 = $P1329."ast"()
+    store_lex "$past", $P1330
+.annotate "line", 373
+    find_lex $P1331, "$past"
+    find_lex $P1332, "$name"
+    "subrule_alias"($P1331, $P1332)
+  if_1324_end:
+.annotate "line", 400
+    find_lex $P1382, "$/"
+    find_lex $P1383, "$past"
+    $P1384 = $P1382."!make"($P1383)
+.annotate "line", 368
+    .return ($P1384)
+  control_1314:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1385, exception, "payload"
+    .return ($P1385)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "_block1373"  :anon :subid("81_1261064016.27984") :outer("79_1261064016.27984")
+    .param pmc param_1375
+.annotate "line", 397
+    .lex "$_", param_1375
+    find_lex $P1376, "$past"
+    find_lex $P1377, "$_"
+    $P1378 = $P1376."push"($P1377)
+    .return ($P1378)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "_block1337"  :anon :subid("80_1261064016.27984") :outer("79_1261064016.27984")
+.annotate "line", 376
+    new $P1339, "Undef"
+    .lex "$regexsym", $P1339
+
+            $P0 = get_global '$REGEXNAME'
+            $S0 = $P0
+            $I0 = index $S0, ':sym<'
+            add $I0, 5
+            $S0 = substr $S0, $I0
+            chopn $S0, 1
+            $P1340 = box $S0
+        
+    store_lex "$regexsym", $P1340
+.annotate "line", 385
+    get_hll_global $P1341, ["PAST"], "Regex"
+.annotate "line", 386
+    get_hll_global $P1342, ["PAST"], "Regex"
+    find_lex $P1343, "$regexsym"
+    $P1344 = $P1342."new"($P1343, "literal" :named("pasttype"))
+    find_lex $P1345, "$name"
+    find_lex $P1346, "$/"
+    $P1347 = $P1341."new"($P1344, $P1345 :named("name"), "subcapture" :named("pasttype"), $P1346 :named("node"))
+.annotate "line", 385
+    store_lex "$past", $P1347
+.annotate "line", 375
+    .return ($P1347)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "assertion:sym<[>"  :subid("82_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_1389
+.annotate "line", 403
+    .const 'Sub' $P1424 = "83_1261064016.27984" 
+    capture_lex $P1424
+    new $P1388, 'ExceptionHandler'
+    set_addr $P1388, control_1387
+    $P1388."handle_types"(58)
+    push_eh $P1388
+    .lex "self", self
+    .lex "$/", param_1389
+.annotate "line", 404
+    new $P1390, "Undef"
+    .lex "$clist", $P1390
+.annotate "line", 405
+    new $P1391, "Undef"
+    .lex "$past", $P1391
+.annotate "line", 414
+    new $P1392, "Undef"
+    .lex "$i", $P1392
+.annotate "line", 415
+    new $P1393, "Undef"
+    .lex "$n", $P1393
+.annotate "line", 404
+    find_lex $P1394, "$/"
+    unless_null $P1394, vivify_320
+    new $P1394, "Hash"
+  vivify_320:
+    set $P1395, $P1394["cclass_elem"]
+    unless_null $P1395, vivify_321
+    new $P1395, "Undef"
+  vivify_321:
+    store_lex "$clist", $P1395
+.annotate "line", 405
+    find_lex $P1396, "$clist"
+    unless_null $P1396, vivify_322
+    new $P1396, "ResizablePMCArray"
+  vivify_322:
+    set $P1397, $P1396[0]
+    unless_null $P1397, vivify_323
+    new $P1397, "Undef"
+  vivify_323:
+    $P1398 = $P1397."ast"()
+    store_lex "$past", $P1398
+.annotate "line", 406
+    find_lex $P1402, "$past"
+    $P1403 = $P1402."negate"()
+    if $P1403, if_1401
+    set $P1400, $P1403
+    goto if_1401_end
+  if_1401:
+    find_lex $P1404, "$past"
+    $S1405 = $P1404."pasttype"()
+    iseq $I1406, $S1405, "subrule"
+    new $P1400, 'Integer'
+    set $P1400, $I1406
+  if_1401_end:
+    unless $P1400, if_1399_end
+.annotate "line", 407
+    find_lex $P1407, "$past"
+    $P1407."subtype"("zerowidth")
+.annotate "line", 408
+    get_hll_global $P1408, ["PAST"], "Regex"
+    find_lex $P1409, "$past"
+.annotate "line", 410
+    get_hll_global $P1410, ["PAST"], "Regex"
+    $P1411 = $P1410."new"("charclass" :named("pasttype"), "." :named("subtype"))
+    find_lex $P1412, "$/"
+    $P1413 = $P1408."new"($P1409, $P1411, $P1412 :named("node"))
+.annotate "line", 408
+    store_lex "$past", $P1413
+  if_1399_end:
+.annotate "line", 414
+    new $P1414, "Integer"
+    assign $P1414, 1
+    store_lex "$i", $P1414
+.annotate "line", 415
+    find_lex $P1415, "$clist"
+    set $N1416, $P1415
+    new $P1417, 'Float'
+    set $P1417, $N1416
+    store_lex "$n", $P1417
+.annotate "line", 416
+    new $P1448, 'ExceptionHandler'
+    set_addr $P1448, loop1447_handler
+    $P1448."handle_types"(65, 67, 66)
+    push_eh $P1448
+  loop1447_test:
+    find_lex $P1418, "$i"
+    set $N1419, $P1418
+    find_lex $P1420, "$n"
+    set $N1421, $P1420
+    islt $I1422, $N1419, $N1421
+    unless $I1422, loop1447_done
+  loop1447_redo:
+    .const 'Sub' $P1424 = "83_1261064016.27984" 
+    capture_lex $P1424
+    $P1424()
+  loop1447_next:
+    goto loop1447_test
+  loop1447_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1449, exception, 'type'
+    eq $P1449, 65, loop1447_next
+    eq $P1449, 67, loop1447_redo
+  loop1447_done:
+    pop_eh 
+.annotate "line", 427
+    find_lex $P1450, "$/"
+    find_lex $P1451, "$past"
+    $P1452 = $P1450."!make"($P1451)
+.annotate "line", 403
+    .return ($P1452)
+  control_1387:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1453, exception, "payload"
+    .return ($P1453)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "_block1423"  :anon :subid("83_1261064016.27984") :outer("82_1261064016.27984")
+.annotate "line", 417
+    new $P1425, "Undef"
+    .lex "$ast", $P1425
+    find_lex $P1426, "$i"
+    set $I1427, $P1426
+    find_lex $P1428, "$clist"
+    unless_null $P1428, vivify_324
+    new $P1428, "ResizablePMCArray"
+  vivify_324:
+    set $P1429, $P1428[$I1427]
+    unless_null $P1429, vivify_325
+    new $P1429, "Undef"
+  vivify_325:
+    $P1430 = $P1429."ast"()
+    store_lex "$ast", $P1430
+.annotate "line", 418
+    find_lex $P1432, "$ast"
+    $P1433 = $P1432."negate"()
+    if $P1433, if_1431
+.annotate "line", 423
+    get_hll_global $P1440, ["PAST"], "Regex"
+    find_lex $P1441, "$past"
+    find_lex $P1442, "$ast"
+    find_lex $P1443, "$/"
+    $P1444 = $P1440."new"($P1441, $P1442, "alt" :named("pasttype"), $P1443 :named("node"))
+    store_lex "$past", $P1444
+.annotate "line", 422
+    goto if_1431_end
+  if_1431:
+.annotate "line", 419
+    find_lex $P1434, "$ast"
+    $P1434."subtype"("zerowidth")
+.annotate "line", 420
+    get_hll_global $P1435, ["PAST"], "Regex"
+    find_lex $P1436, "$ast"
+    find_lex $P1437, "$past"
+    find_lex $P1438, "$/"
+    $P1439 = $P1435."new"($P1436, $P1437, "concat" :named("pasttype"), $P1438 :named("node"))
+    store_lex "$past", $P1439
+  if_1431_end:
+.annotate "line", 425
+    find_lex $P1445, "$i"
+    add $P1446, $P1445, 1
+    store_lex "$i", $P1446
+.annotate "line", 416
+    .return ($P1446)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "cclass_elem"  :subid("84_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_1457
+.annotate "line", 430
+    .const 'Sub' $P1482 = "86_1261064016.27984" 
+    capture_lex $P1482
+    .const 'Sub' $P1466 = "85_1261064016.27984" 
+    capture_lex $P1466
+    new $P1456, 'ExceptionHandler'
+    set_addr $P1456, control_1455
+    $P1456."handle_types"(58)
+    push_eh $P1456
+    .lex "self", self
+    .lex "$/", param_1457
+.annotate "line", 431
+    new $P1458, "Undef"
+    .lex "$str", $P1458
+.annotate "line", 432
+    new $P1459, "Undef"
+    .lex "$past", $P1459
+.annotate "line", 431
+    new $P1460, "String"
+    assign $P1460, ""
+    store_lex "$str", $P1460
+    find_lex $P1461, "$past"
+.annotate "line", 433
+    find_lex $P1463, "$/"
+    unless_null $P1463, vivify_326
+    new $P1463, "Hash"
+  vivify_326:
+    set $P1464, $P1463["name"]
+    unless_null $P1464, vivify_327
+    new $P1464, "Undef"
+  vivify_327:
+    if $P1464, if_1462
+.annotate "line", 437
+    find_lex $P1477, "$/"
+    unless_null $P1477, vivify_328
+    new $P1477, "Hash"
+  vivify_328:
+    set $P1478, $P1477["charspec"]
+    unless_null $P1478, vivify_329
+    new $P1478, "Undef"
+  vivify_329:
+    defined $I1479, $P1478
+    unless $I1479, for_undef_330
+    iter $P1476, $P1478
+    new $P1508, 'ExceptionHandler'
+    set_addr $P1508, loop1507_handler
+    $P1508."handle_types"(65, 67, 66)
+    push_eh $P1508
+  loop1507_test:
+    unless $P1476, loop1507_done
+    shift $P1480, $P1476
+  loop1507_redo:
+    .const 'Sub' $P1482 = "86_1261064016.27984" 
+    capture_lex $P1482
+    $P1482($P1480)
+  loop1507_next:
+    goto loop1507_test
+  loop1507_handler:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1509, exception, 'type'
+    eq $P1509, 65, loop1507_next
+    eq $P1509, 67, loop1507_redo
+  loop1507_done:
+    pop_eh 
+  for_undef_330:
+.annotate "line", 462
+    get_hll_global $P1510, ["PAST"], "Regex"
+    find_lex $P1511, "$str"
+    find_lex $P1512, "$/"
+    $P1513 = $P1510."new"($P1511, "enumcharlist" :named("pasttype"), $P1512 :named("node"))
+    store_lex "$past", $P1513
+.annotate "line", 436
+    goto if_1462_end
+  if_1462:
+.annotate "line", 433
+    .const 'Sub' $P1466 = "85_1261064016.27984" 
+    capture_lex $P1466
+    $P1466()
+  if_1462_end:
+.annotate "line", 464
+    find_lex $P1514, "$past"
+    find_lex $P1515, "$/"
+    unless_null $P1515, vivify_342
+    new $P1515, "Hash"
+  vivify_342:
+    set $P1516, $P1515["sign"]
+    unless_null $P1516, vivify_343
+    new $P1516, "Undef"
+  vivify_343:
+    set $S1517, $P1516
+    iseq $I1518, $S1517, "-"
+    $P1514."negate"($I1518)
+.annotate "line", 465
+    find_lex $P1519, "$/"
+    find_lex $P1520, "$past"
+    $P1521 = $P1519."!make"($P1520)
+.annotate "line", 430
+    .return ($P1521)
+  control_1455:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1522, exception, "payload"
+    .return ($P1522)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "_block1481"  :anon :subid("86_1261064016.27984") :outer("84_1261064016.27984")
+    .param pmc param_1483
+.annotate "line", 437
+    .const 'Sub' $P1489 = "87_1261064016.27984" 
+    capture_lex $P1489
+    .lex "$_", param_1483
+.annotate "line", 438
+    find_lex $P1486, "$_"
+    unless_null $P1486, vivify_331
+    new $P1486, "ResizablePMCArray"
+  vivify_331:
+    set $P1487, $P1486[1]
+    unless_null $P1487, vivify_332
+    new $P1487, "Undef"
+  vivify_332:
+    if $P1487, if_1485
+.annotate "line", 460
+    find_lex $P1503, "$str"
+    find_lex $P1504, "$_"
+    unless_null $P1504, vivify_333
+    new $P1504, "ResizablePMCArray"
+  vivify_333:
+    set $P1505, $P1504[0]
+    unless_null $P1505, vivify_334
+    new $P1505, "Undef"
+  vivify_334:
+    concat $P1506, $P1503, $P1505
+    store_lex "$str", $P1506
+    set $P1484, $P1506
+.annotate "line", 438
+    goto if_1485_end
+  if_1485:
+    .const 'Sub' $P1489 = "87_1261064016.27984" 
+    capture_lex $P1489
+    $P1502 = $P1489()
+    set $P1484, $P1502
+  if_1485_end:
+.annotate "line", 437
+    .return ($P1484)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "_block1488"  :anon :subid("87_1261064016.27984") :outer("86_1261064016.27984")
+.annotate "line", 439
+    new $P1490, "Undef"
+    .lex "$a", $P1490
+.annotate "line", 440
+    new $P1491, "Undef"
+    .lex "$b", $P1491
+.annotate "line", 441
+    new $P1492, "Undef"
+    .lex "$c", $P1492
+.annotate "line", 439
+    find_lex $P1493, "$_"
+    unless_null $P1493, vivify_335
+    new $P1493, "ResizablePMCArray"
+  vivify_335:
+    set $P1494, $P1493[0]
+    unless_null $P1494, vivify_336
+    new $P1494, "Undef"
+  vivify_336:
+    store_lex "$a", $P1494
+.annotate "line", 440
+    find_lex $P1495, "$_"
+    unless_null $P1495, vivify_337
+    new $P1495, "ResizablePMCArray"
+  vivify_337:
+    set $P1496, $P1495[1]
+    unless_null $P1496, vivify_338
+    new $P1496, "ResizablePMCArray"
+  vivify_338:
+    set $P1497, $P1496[0]
+    unless_null $P1497, vivify_339
+    new $P1497, "Undef"
+  vivify_339:
+    store_lex "$b", $P1497
+.annotate "line", 441
+
+                             $P0 = find_lex '$a'
+                             $S0 = $P0
+                             $I0 = ord $S0
+                             $P1 = find_lex '$b'
+                             $S1 = $P1
+                             $I1 = ord $S1
+                             $S2 = ''
+                           cclass_loop:
+                             if $I0 > $I1 goto cclass_done
+                             $S0 = chr $I0
+                             $S2 .= $S0
+                             inc $I0
+                             goto cclass_loop
+                           cclass_done:
+                             $P1498 = box $S2
+                         
+    store_lex "$c", $P1498
+.annotate "line", 458
+    find_lex $P1499, "$str"
+    find_lex $P1500, "$c"
+    concat $P1501, $P1499, $P1500
+    store_lex "$str", $P1501
+.annotate "line", 438
+    .return ($P1501)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "_block1465"  :anon :subid("85_1261064016.27984") :outer("84_1261064016.27984")
+.annotate "line", 434
+    new $P1467, "Undef"
+    .lex "$name", $P1467
+    find_lex $P1468, "$/"
+    unless_null $P1468, vivify_340
+    new $P1468, "Hash"
+  vivify_340:
+    set $P1469, $P1468["name"]
+    unless_null $P1469, vivify_341
+    new $P1469, "Undef"
+  vivify_341:
+    set $S1470, $P1469
+    new $P1471, 'String'
+    set $P1471, $S1470
+    store_lex "$name", $P1471
+.annotate "line", 435
+    get_hll_global $P1472, ["PAST"], "Regex"
+    find_lex $P1473, "$name"
+    find_lex $P1474, "$/"
+    $P1475 = $P1472."new"($P1473, "subrule" :named("pasttype"), "method" :named("subtype"), $P1474 :named("node"))
+    store_lex "$past", $P1475
+.annotate "line", 433
+    .return ($P1475)
+.end
+
+
+.namespace ["Regex";"P6Regex";"Actions"]
+.sub "mod_internal"  :subid("88_1261064016.27984") :method :outer("11_1261064016.27984")
+    .param pmc param_1526
+.annotate "line", 468
+    new $P1525, 'ExceptionHandler'
+    set_addr $P1525, control_1524
+    $P1525."handle_types"(58)
+    push_eh $P1525
+    .lex "self", self
+    .lex "$/", param_1526
+.annotate "line", 469
+    new $P1527, "Hash"
+    .lex "%mods", $P1527
+.annotate "line", 470
+    new $P1528, "Undef"
+    .lex "$n", $P1528
+.annotate "line", 469
+    get_global $P1529, "@MODIFIERS"
+    unless_null $P1529, vivify_344
+    new $P1529, "ResizablePMCArray"
+  vivify_344:
+    set $P1530, $P1529[0]
+    unless_null $P1530, vivify_345
+    new $P1530, "Undef"
+  vivify_345:
+    store_lex "%mods", $P1530
+.annotate "line", 470
+    find_lex $P1533, "$/"
+    unless_null $P1533, vivify_346
+    new $P1533, "Hash"
+  vivify_346:
+    set $P1534, $P1533["n"]
+    unless_null $P1534, vivify_347
+    new $P1534, "ResizablePMCArray"
+  vivify_347:
+    set $P1535, $P1534[0]
+    unless_null $P1535, vivify_348
+    new $P1535, "Undef"
+  vivify_348:
+    set $S1536, $P1535
+    isgt $I1537, $S1536, ""
+    if $I1537, if_1532
+    new $P1542, "Integer"
+    assign $P1542, 1
+    set $P1531, $P1542
+    goto if_1532_end
+  if_1532:
+    find_lex $P1538, "$/"
+    unless_null $P1538, vivify_349
+    new $P1538, "Hash"
+  vivify_349:
+    set $P1539, $P1538["n"]
+    unless_null $P1539, vivify_350
+    new $P1539, "ResizablePMCArray"
+  vivify_350:
+    set $P1540, $P1539[0]
+    unless_null $P1540, vivify_351
+    new $P1540, "Undef"
+  vivify_351:
+    set $N1541, $P1540
+    new $P1531, 'Float'
+    set $P1531, $N1541
+  if_1532_end:
+    store_lex "$n", $P1531
+.annotate "line", 471
+    find_lex $P1543, "$n"
+    find_lex $P1544, "$/"
+    unless_null $P1544, vivify_352
+    new $P1544, "Hash"
+  vivify_352:
+    set $P1545, $P1544["mod_ident"]
+    unless_null $P1545, vivify_353
+    new $P1545, "Hash"
+  vivify_353:
+    set $P1546, $P1545["sym"]
+    unless_null $P1546, vivify_354
+    new $P1546, "Undef"
+  vivify_354:
+    set $S1547, $P1546
+    find_lex $P1548, "%mods"
+    unless_null $P1548, vivify_355
+    new $P1548, "Hash"
+    store_lex "%mods", $P1548
+  vivify_355:
+    set $P1548[$S1547], $P1543
+.annotate "line", 472
+    find_lex $P1549, "$/"
+    $P1550 = $P1549."!make"(0)
+.annotate "line", 468
+    .return ($P1550)
+  control_1524:
+    .local pmc exception 
+    .get_results (exception) 
+    getattribute $P1551, exception, "payload"
+    .return ($P1551)
+.end
+
+# .include 'src/cheats/p6regex-grammar.pir'
+
+.namespace ['Regex';'P6Regex';'Compiler']
+
+.sub '' :anon :load :init
+    .local pmc p6meta, p6regex
+    p6meta = get_hll_global 'P6metaclass'
+    p6regex = p6meta.'new_class'('Regex::P6Regex::Compiler', 'parent'=>'HLL::Compiler')
+    p6regex.'language'('Regex::P6Regex')
+    $P0 = get_hll_global ['Regex';'P6Regex'], 'Grammar'
+    p6regex.'parsegrammar'($P0)
+    $P0 = get_hll_global ['Regex';'P6Regex'], 'Actions'
+    p6regex.'parseactions'($P0)
+    $P0 = get_hll_global ['Regex';'P6Regex';'Actions'], 'INIT'
+    $P0()
+.end
+
+
+.sub 'main' :main
+    .param pmc args_str
+
+    $P0 = compreg 'Regex::P6Regex'
+    $P1 = $P0.'command_line'(args_str, 'encoding'=>'utf8', 'transcode'=>'ascii iso-8859-1')
+    exit 0
+.end
+
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Added: branches/orderedhash_revamp/ext/nqp-rx/src/stage0/Regex-s0.pir
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/src/stage0/Regex-s0.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,3379 @@
+# $Id$
+
+=head1 NAME
+
+Regex - Regex library
+
+=head1 DESCRIPTION
+
+This file brings together the various Regex modules needed for Regex.pbc .
+
+=cut
+
+### .include 'src/Regex/Cursor.pir'
+# Copyright (C) 2009, The Perl Foundation.
+# $Id$
+
+=head1 NAME
+
+Regex::Cursor - Regex Cursor nodes
+
+=head1 DESCRIPTION
+
+This file implements the Regex::Cursor class, used for managing regular
+expression control flow.  Regex::Cursor is also a base class for
+grammars.
+
+=cut
+
+.include 'cclass.pasm'
+### .include 'src/Regex/constants.pir'
+.const int CURSOR_FAIL = -1
+.const int CURSOR_FAIL_GROUP = -2
+.const int CURSOR_FAIL_RULE = -3
+.const int CURSOR_FAIL_MATCH = -4
+
+.const int CURSOR_TYPE_SCAN = 1
+.const int CURSOR_TYPE_PEEK = 2
+
+.namespace ['Regex';'Cursor']
+
+.sub '' :anon :load :init
+    load_bytecode 'P6object.pbc'
+    .local pmc p6meta
+    p6meta = new 'P6metaclass'
+    $P0 = p6meta.'new_class'('Regex::Cursor', 'attr'=>'$!target $!from $!pos $!match $!names $!debug @!bstack @!cstack @!caparray')
+    $P0 = box 0
+    set_global '$!generation', $P0
+    $P0 = new ['Boolean']
+    assign $P0, 0
+    set_global '$!FALSE', $P0
+    $P0 = new ['Boolean']
+    assign $P0, 1
+    set_global '$!TRUE', $P0
+    .return ()
+.end
+
+=head2 Methods
+
+=over 4
+
+=item MATCH()
+
+Return this cursor's current Match object, generating a new one
+for the Cursor if one hasn't been created yet.
+
+=cut
+
+.sub 'MATCH' :method
+    .local pmc match
+    match = getattribute self, '$!match'
+    if null match goto match_make
+    $P0 = get_global '$!TRUE'
+    $I0 = issame match, $P0
+    unless $I0 goto match_done
+
+    # First, create a Match object and bind it
+  match_make:
+    match = new ['Regex';'Match']
+    setattribute self, '$!match', match
+    setattribute match, '$!cursor', self
+    .local pmc target, from, to
+    target = getattribute self, '$!target'
+    setattribute match, '$!target', target
+    from = getattribute self, '$!from'
+    setattribute match, '$!from', from
+    to = getattribute self, '$!pos'
+    setattribute match, '$!to', to
+
+    # Create any arrayed subcaptures.
+    .local pmc caparray, caparray_it, caphash
+    caparray = getattribute self, '@!caparray'
+    if null caparray goto caparray_done
+    caparray_it = iter caparray
+    caphash = new ['Hash']
+  caparray_loop:
+    unless caparray_it goto caparray_done
+    .local string subname
+    .local pmc arr
+    .local int keyint
+    subname = shift caparray_it
+    arr = new ['ResizablePMCArray']
+    caphash[subname] = arr
+    keyint = is_cclass .CCLASS_NUMERIC, subname, 0
+    if keyint goto caparray_int
+    match[subname] = arr
+    goto caparray_loop
+  caparray_int:
+    $I0 = subname
+    match[$I0] = arr
+  caparray_done:
+
+    # If it's not a successful match, or if there are
+    # no saved subcursors, we're done.
+    if to < from goto match_done
+    .local pmc cstack, cstack_it
+    cstack = getattribute self, '@!cstack'
+    if null cstack goto cstack_done
+    unless cstack goto cstack_done
+    cstack_it = iter cstack
+  cstack_loop:
+    unless cstack_it goto cstack_done
+    .local pmc subcur, submatch, names
+    subcur = shift cstack_it
+    # If the subcursor isn't bound with a name, skip it
+    names = getattribute subcur, '$!names'
+    if null names goto cstack_loop
+    $I0 = isa subcur, ['Regex';'Cursor']
+    unless $I0 goto cstack_1
+    submatch = subcur.'MATCH'()
+    goto cstack_2
+  cstack_1:
+    submatch = subcur
+  cstack_2:
+    # See if we have multiple binds
+    .local pmc names_it
+    subname = names
+    names_it = get_global '$!FALSE'
+    $I0 = index subname, '='
+    if $I0 < 0 goto cstack_subname
+    names_it = split '=', subname
+  cstack_subname_loop:
+    subname = shift names_it
+  cstack_subname:
+    keyint = is_cclass .CCLASS_NUMERIC, subname, 0
+    if null caparray goto cstack_bind
+    $I0 = exists caphash[subname]
+    unless $I0 goto cstack_bind
+    if keyint goto cstack_array_int
+    $P0 = match[subname]
+    push $P0, submatch
+    goto cstack_bind_done
+  cstack_array_int:
+    $I0 = subname
+    $P0 = match[$I0]
+    push $P0, submatch
+    goto cstack_bind_done
+  cstack_bind:
+    if keyint goto cstack_bind_int
+    match[subname] = submatch
+    goto cstack_bind_done
+  cstack_bind_int:
+    $I0 = subname
+    match[$I0] = submatch
+  cstack_bind_done:
+    if names_it goto cstack_subname_loop
+    goto cstack_loop
+  cstack_done:
+
+  match_done:
+    .return (match)
+.end
+
+
+=item parse(target [, 'rule'=>regex])
+
+Parse C<target> in the current grammar starting with C<regex>.
+If C<regex> is omitted, then use the C<TOP> rule for the grammar.
+
+=cut
+
+.sub 'parse' :method
+    .param pmc target
+    .param pmc regex           :named('rule') :optional
+    .param int has_regex       :opt_flag
+    .param pmc actions         :named('actions') :optional
+    .param int rxtrace         :named('rxtrace') :optional
+    .param pmc options         :slurpy :named
+
+    if has_regex goto have_regex
+    regex = box 'TOP'
+  have_regex:
+    $I0 = isa regex, ['String']
+    unless $I0 goto regex_done
+    $S0 = regex
+    regex = find_method self, $S0
+  regex_done:
+
+    .lex '$*ACTIONS', actions
+
+    .local pmc cur, match
+    cur = self.'!cursor_init'(target, options :flat :named)
+    unless rxtrace goto rxtrace_done
+    cur.'DEBUG'()
+  rxtrace_done:
+    cur = cur.regex()
+    match = cur.'MATCH'()
+    .return (match)
+.end
+
+
+=item pos()
+
+Return the cursor's current position.
+
+=cut
+
+.sub 'pos' :method
+    $P0 = getattribute self, '$!pos'
+    .return ($P0)
+.end
+
+
+=item from()
+
+Return the cursor's from position.
+
+=cut
+
+.sub 'from' :method
+    $P0 = getattribute self, '$!from'
+    .return ($P0)
+.end
+
+=back
+
+=head2 Private methods
+
+=over 4
+
+=item !cursor_init(target)
+
+Create a new cursor for matching C<target>.
+
+=cut
+
+.sub '!cursor_init' :method
+    .param string target
+    .param int pos             :named('p') :optional
+    .param int has_pos         :opt_flag
+    .param int cont            :named('c') :optional
+    .param int has_cont        :opt_flag
+
+    .local pmc parrotclass, cur
+    $P0 = self.'HOW'()
+    parrotclass = getattribute $P0, 'parrotclass'
+    cur = new parrotclass
+
+    $P0 = new ['CodeString']
+    $P0 = target
+    setattribute cur, '$!target', $P0
+
+    if has_cont goto cursor_cont
+    $P0 = box pos
+    setattribute cur, '$!from', $P0
+    $P0 = box pos
+    setattribute cur, '$!pos', $P0
+    goto cursor_done
+  cursor_cont:
+    $P0 = box CURSOR_FAIL
+    setattribute cur, '$!from', $P0
+    $P0 = box cont
+    setattribute cur, '$!pos', $P0
+  cursor_done:
+
+    .return (cur)
+.end
+
+=item !cursor_start([lang])
+
+Create and initialize a new cursor from C<self>.  If C<lang> is
+provided, then the new cursor has the same type as lang.
+
+=cut
+
+.sub '!cursor_start' :method
+    .param pmc lang            :optional
+    .param int has_lang        :opt_flag
+
+    if has_lang goto have_lang
+    lang = self
+  have_lang:
+
+    .local pmc parrotclass, cur
+    $P0 = lang.'HOW'()
+    parrotclass = getattribute $P0, 'parrotclass'
+    cur = new parrotclass
+
+    .local pmc from, pos, target, debug
+
+    from = getattribute self, '$!pos'
+    setattribute cur, '$!from', from
+    setattribute cur, '$!pos', from
+
+    target = getattribute self, '$!target'
+    setattribute cur, '$!target', target
+    debug = getattribute self, '$!debug'
+    setattribute cur, '$!debug', debug
+
+    .return (cur, from, target)
+.end
+
+
+=item !cursor_fail(pos)
+
+Permanently fail this cursor.
+
+=cut
+
+.sub '!cursor_fail' :method
+    .local pmc pos
+    pos = box CURSOR_FAIL_RULE
+    setattribute self, '$!pos', pos
+    null $P0
+    setattribute self, '$!match', $P0
+    setattribute self, '@!bstack', $P0
+    setattribute self, '@!cstack', $P0
+.end
+
+
+=item !cursor_pass(pos, name)
+
+Set the Cursor as passing at C<pos>; calling any reduction action
+C<name> associated with the cursor.  This method simply sets
+C<$!match> to a boolean true value to indicate the regex was
+successful; the C<MATCH> method above replaces this boolean true
+with a "real" Match object when requested.
+
+=cut
+
+.sub '!cursor_pass' :method
+    .param pmc pos
+    .param string name
+
+    setattribute self, '$!pos', pos
+    .local pmc match
+    match = get_global '$!TRUE'
+    setattribute self, '$!match', match
+    unless name goto done
+    self.'!reduce'(name)
+  done:
+    .return (self)
+.end
+
+
+=item !cursor_caparray(caparray :slurpy)
+
+Set the list of subcaptures that produce arrays to C<caparray>.
+
+=cut
+
+.sub '!cursor_caparray' :method
+    .param pmc caparray        :slurpy
+    setattribute self, '@!caparray', caparray
+.end
+
+
+=item !cursor_names(names)
+
+Set the Cursor's name (for binding) to C<names>.
+
+=cut
+
+.sub '!cursor_names' :method
+    .param pmc names
+    setattribute self, '$!names', names
+.end
+
+
+=item !cursor_pos(pos)
+
+Set the cursor's position to C<pos>.
+
+=cut
+
+.sub '!cursor_pos' :method
+    .param pmc pos
+    setattribute self, '$!pos', pos
+.end
+
+
+=item !cursor_debug(args :slurpy)
+
+Log a debug message.
+
+=cut
+
+.sub '!cursor_debug' :method
+    .param pmc args            :slurpy
+    $P0 = getattribute self, '$!debug'
+    if null $P0 goto done
+    unless $P0 goto done
+    .local pmc from, pos, orig
+    .local int line
+    from = getattribute self, '$!from'
+    orig = getattribute self, '$!target'
+    line = orig.'lineof'(from)
+    inc line
+    printerr from
+    printerr '/'
+    printerr line
+    printerr ': '
+    $S0 = join '', args
+    printerr $S0
+    printerr "\n"
+  done:
+    .return (self)
+.end
+
+
+=item !mark_push(rep, pos, mark)
+
+Push a new backtracking point onto the cursor with the given
+C<rep>, C<pos>, and backtracking C<mark>.  (The C<mark> is typically
+the address of a label to branch to when backtracking occurs.)
+
+=cut
+
+.sub '!mark_push' :method
+    .param int rep
+    .param int pos
+    .param int mark
+    .param pmc subcur          :optional
+    .param int has_subcur      :opt_flag
+
+    # cptr contains the desired number of elements in the cstack
+    .local int cptr
+    cptr = 0
+
+    # Initialize bstack if needed, and set cptr to be the cstack
+    # size requested by the top frame.
+    .local pmc bstack
+    bstack = getattribute self, '@!bstack'
+    if null bstack goto bstack_new
+    unless bstack goto bstack_done
+    $I0 = elements bstack
+    dec $I0
+    cptr = bstack[$I0]
+    goto bstack_done
+  bstack_new:
+    bstack = new ['ResizableIntegerArray']
+    setattribute self, '@!bstack', bstack
+  bstack_done:
+
+    # If a new subcursor is being pushed, then save it in cstack
+    # and change cptr to include the new subcursor.  Also clear
+    # any existing match object, as we may have just changed the
+    # match state.
+    unless has_subcur goto subcur_done
+    null $P0
+    setattribute self, '$!match', $P0
+    .local pmc cstack
+    cstack = getattribute self, '@!cstack'
+    unless null cstack goto have_cstack
+    cstack = new ['ResizablePMCArray']
+    setattribute self, '@!cstack', cstack
+  have_cstack:
+    cstack[cptr] = subcur
+    inc cptr
+  subcur_done:
+
+    # Save our mark frame information.
+    push bstack, mark
+    push bstack, pos
+    push bstack, rep
+    push bstack, cptr
+.end
+
+
+=item !mark_peek(mark)
+
+Return information about the latest frame for C<mark>.
+If C<mark> is zero, return information about the latest frame.
+
+=cut
+
+.sub '!mark_peek' :method
+    .param int tomark
+
+    .local pmc bstack
+    bstack = getattribute self, '@!bstack'
+    if null bstack goto no_mark
+    unless bstack goto no_mark
+
+    .local int bptr
+    bptr = elements bstack
+
+  bptr_loop:
+    bptr = bptr - 4
+    if bptr < 0 goto no_mark
+    .local int rep, pos, mark, cptr
+    mark = bstack[bptr]
+    unless tomark goto bptr_done
+    unless mark == tomark goto bptr_loop
+  bptr_done:
+    $I0  = bptr + 1
+    pos  = bstack[$I0]
+    inc $I0
+    rep  = bstack[$I0]
+    inc $I0
+    cptr = bstack[$I0]
+    .return (rep, pos, mark, bptr, bstack, cptr)
+
+  no_mark:
+    .return (0, CURSOR_FAIL_GROUP, 0, 0, bstack, 0)
+.end
+
+
+=item !mark_fail(tomark)
+
+Remove the most recent C<mark> and backtrack the cursor to the
+point given by that mark.  If C<mark> is zero, then
+backtracks the most recent mark.  Returns the backtracked
+values of repetition count, cursor position, and mark (address).
+
+=cut
+
+.sub '!mark_fail' :method
+    .param int mark
+
+    # Get the frame information for C<mark>.
+    .local int rep, pos, mark, bptr, cptr
+    .local pmc bstack
+    (rep, pos, mark, bptr, bstack, cptr) = self.'!mark_peek'(mark)
+
+    # clear any existing Match object
+    null $P0
+    setattribute self, '$!match', $P0
+
+    .local pmc subcur
+    null subcur
+
+    # If there's no bstack, there's nothing else to do.
+    if null bstack goto done
+
+    # If there's a subcursor associated with this mark, return it.
+    unless cptr > 0 goto cstack_done
+    .local pmc cstack
+    cstack = getattribute self, '@!cstack'
+    dec cptr
+    subcur = cstack[cptr]
+    # Set the cstack to the size requested by the soon-to-be-top mark frame.
+    unless bptr > 0 goto cstack_zero
+    $I0 = bptr - 1
+    $I0 = bstack[$I0]
+    assign cstack, $I0
+    goto cstack_done
+  cstack_zero:
+    assign cstack, 0
+  cstack_done:
+
+    # Pop the current mark frame and all above it.
+    assign bstack, bptr
+
+  done:
+    .return (rep, pos, mark, subcur)
+.end
+
+
+=item !mark_commit(mark)
+
+Like C<!mark_fail> above this backtracks the cursor to C<mark>
+(releasing any intermediate marks), but preserves the current
+capture states.
+
+=cut
+
+.sub '!mark_commit' :method
+    .param int mark
+
+    # find mark
+    .local int rep, pos, mark, bptr, cptr
+    .local pmc bstack
+    (rep, pos, mark, bptr, bstack) = self.'!mark_peek'(mark)
+
+    # get current cstack size into cptr
+    if null bstack goto done
+    unless bstack goto done
+    $I0 = elements bstack
+    dec $I0
+    cptr = bstack[$I0]
+
+    # Pop the mark frame and everything above it.
+    assign bstack, bptr
+
+    # If we don't need to hold any cstack information, we're done.
+    unless cptr > 0 goto done
+
+    # If the top frame is an auto-fail frame, (re)use it to hold
+    # our needed cptr, otherwise create a new auto-fail frame to do it.
+    unless bptr > 0 goto cstack_push
+    $I0 = bptr - 3             # pos is at top-3
+    $I1 = bstack[$I0]
+    unless $I1 < 0 goto cstack_push
+    $I0 = bptr - 1             # cptr is at top-1
+    bstack[$I0] = cptr
+    goto done
+  cstack_push:
+    push bstack, 0             # mark
+    push bstack, CURSOR_FAIL   # pos
+    push bstack, 0             # rep
+    push bstack, cptr          # cptr
+
+  done:
+    .return (rep, pos, mark)
+.end
+
+
+=item !reduce(name [, key] [, match])
+
+Perform any action associated with the current regex match.
+
+=cut
+
+.sub '!reduce' :method
+    .param string name
+    .param string key          :optional
+    .param int has_key         :opt_flag
+    .param pmc match           :optional
+    .param int has_match       :opt_flag
+    .local pmc actions
+    actions = find_dynamic_lex '$*ACTIONS'
+    if null actions goto actions_done
+    $I0 = can actions, name
+    unless $I0 goto actions_done
+    if has_match goto match_done
+    match = self.'MATCH'()
+  match_done:
+    if has_key goto actions_key
+    actions.name(match)
+    goto actions_done
+  actions_key:
+    .tailcall actions.name(match, key)
+  actions_done:
+    .return ()
+.end
+
+
+=item !BACKREF(name)
+
+Match the backreference given by C<name>.
+
+=cut
+
+.sub '!BACKREF' :method
+    .param string name
+    .local pmc cur
+    .local int pos, eos
+    .local string tgt
+    (cur, pos, tgt) = self.'!cursor_start'()
+
+    # search the cursor cstack for the latest occurrence of C<name>
+    .local pmc cstack
+    cstack = getattribute self, '@!cstack'
+    if null cstack goto pass
+    .local int cstack_it
+    cstack_it = elements cstack
+  cstack_loop:
+    dec cstack_it
+    unless cstack_it >= 0 goto pass
+    .local pmc subcur
+    subcur = cstack[cstack_it]
+    $P0 = getattribute subcur, '$!names'
+    if null $P0 goto cstack_loop
+    $S0 = $P0
+    if name != $S0 goto cstack_loop
+    # we found a matching subcursor, get the literal it matched
+  cstack_done:
+    .local int litlen
+    .local string litstr
+    $I1 = subcur.'pos'()
+    $I0 = subcur.'from'()
+    litlen = $I1 - $I0
+    litstr = substr tgt, $I0, litlen
+    # now test the literal against our target
+    $S0 = substr tgt, pos, litlen
+    unless $S0 == litstr goto fail
+    pos += litlen
+  pass:
+    cur.'!cursor_pass'(pos, '')
+  fail:
+    .return (cur)
+.end
+
+
+=back
+
+=head2 Vtable functions
+
+=over 4
+
+=item get_bool
+
+=cut
+
+.sub '' :vtable('get_bool') :method
+    .local pmc match
+    match = getattribute self, '$!match'
+    if null match goto false
+    $I0 = istrue match
+    .return ($I0)
+  false:
+    .return (0)
+.end
+
+=back
+
+=head1 AUTHORS
+
+Patrick Michaud <pmichaud at pobox.com> is the author and maintainer.
+
+=cut
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
+### .include 'src/Regex/Cursor-builtins.pir'
+# Copyright (C) 2009, The Perl Foundation.
+# $Id$
+
+=head1 NAME
+
+Regex::Cursor-builtins - builtin regexes for Cursor objects
+
+=cut
+
+.include 'cclass.pasm'
+
+.namespace ['Regex';'Cursor']
+
+.sub 'before' :method
+    .param pmc regex           :optional
+    .local pmc cur
+    .local int pos
+    (cur, pos) = self.'!cursor_start'()
+    if null regex goto fail
+    $P0 = cur.regex()
+    unless $P0 goto fail
+    cur.'!cursor_pass'(pos, 'before')
+  fail:
+    .return (cur)
+.end
+
+
+.sub 'ident' :method
+    .local pmc cur
+    .local int pos, eos
+    .local string tgt
+    (cur, pos, tgt) = self.'!cursor_start'()
+    eos = length tgt
+    $S0 = substr tgt, pos, 1
+    if $S0 == '_' goto ident_1
+    $I0 = is_cclass .CCLASS_ALPHABETIC, tgt, pos
+    unless $I0 goto fail
+  ident_1:
+    pos = find_not_cclass .CCLASS_WORD, tgt, pos, eos
+    cur.'!cursor_pass'(pos, 'ident')
+  fail:
+    .return (cur)
+.end
+
+.sub 'wb' :method
+    .local pmc cur
+    .local int pos, eos
+    .local string tgt
+    (cur, pos, tgt) = self.'!cursor_start'()
+    if pos == 0 goto pass
+    eos = length tgt
+    if pos == eos goto pass
+    $I0 = pos - 1
+    $I1 = is_cclass .CCLASS_WORD, tgt, $I0
+    $I2 = is_cclass .CCLASS_WORD, tgt, pos
+    if $I1 == $I2 goto fail
+  pass:
+    cur.'!cursor_pass'(pos, 'wb')
+  fail:
+    .return (cur)
+.end
+
+.sub 'ww' :method
+    .local pmc cur
+    .local int pos, eos
+    .local string tgt
+    (cur, pos, tgt) = self.'!cursor_start'()
+    if pos == 0 goto fail
+    eos = length tgt
+    if pos == eos goto fail
+    $I0 = is_cclass .CCLASS_WORD, tgt, pos
+    unless $I0 goto fail
+    $I1 = pos - 1
+    $I0 = is_cclass .CCLASS_WORD, tgt, $I1
+    unless $I0 goto fail
+  pass:
+    cur.'!cursor_pass'(pos, 'ww')
+  fail:
+    .return (cur)
+.end
+
+.sub 'ws' :method
+    .local pmc cur
+    .local int pos, eos
+    .local string tgt
+    (cur, pos, tgt) = self.'!cursor_start'()
+    eos = length tgt
+    if pos >= eos goto pass
+    if pos == 0 goto ws_scan
+    $I0 = is_cclass .CCLASS_WORD, tgt, pos
+    unless $I0 goto ws_scan
+    $I1 = pos - 1
+    $I0 = is_cclass .CCLASS_WORD, tgt, $I1
+    if $I0 goto fail
+  ws_scan:
+    pos = find_not_cclass .CCLASS_WHITESPACE, tgt, pos, eos
+  pass:
+    cur.'!cursor_pass'(pos, 'ws')
+  fail:
+    .return (cur)
+.end
+
+.sub '!cclass' :anon
+    .param pmc self
+    .param string name
+    .param int cclass
+    .local pmc cur
+    .local int pos
+    .local string tgt
+    (cur, pos, tgt) = self.'!cursor_start'()
+    $I0 = is_cclass cclass, tgt, pos
+    unless $I0 goto fail
+    inc pos
+    cur.'!cursor_pass'(pos, name)
+  fail:
+    .return (cur)
+.end
+
+.sub 'alpha' :method
+    .local pmc cur
+    .local int pos
+    .local string tgt
+    (cur, pos, tgt) = self.'!cursor_start'()
+    $I0 = is_cclass .CCLASS_ALPHABETIC, tgt, pos
+    if $I0 goto pass
+    $S0 = substr tgt, pos, 1
+    if $S0 != '_' goto fail
+  pass:
+    inc pos
+    cur.'!cursor_pass'(pos, 'alpha')
+  fail:
+    .return (cur)
+.end
+
+.sub 'upper' :method
+    .tailcall '!cclass'(self, 'upper', .CCLASS_UPPERCASE)
+.end
+
+.sub 'lower' :method
+    .tailcall '!cclass'(self, 'lower', .CCLASS_LOWERCASE)
+.end
+
+.sub 'digit' :method
+    .tailcall '!cclass'(self, 'digit', .CCLASS_NUMERIC)
+.end
+
+.sub 'xdigit' :method
+    .tailcall '!cclass'(self, 'xdigit', .CCLASS_HEXADECIMAL)
+.end
+
+.sub 'print' :method
+    .tailcall '!cclass'(self, 'print', .CCLASS_PRINTING)
+.end
+
+.sub 'graph' :method
+    .tailcall '!cclass'(self, 'graph', .CCLASS_GRAPHICAL)
+.end
+
+.sub 'cntrl' :method
+    .tailcall '!cclass'(self, 'cntrl', .CCLASS_CONTROL)
+.end
+
+.sub 'punct' :method
+    .tailcall '!cclass'(self, 'punct', .CCLASS_PUNCTUATION)
+.end
+
+.sub 'alnum' :method
+    .tailcall '!cclass'(self, 'alnum', .CCLASS_ALPHANUMERIC)
+.end
+
+.sub 'space' :method
+    .tailcall '!cclass'(self, 'space', .CCLASS_WHITESPACE)
+.end
+
+.sub 'blank' :method
+    .tailcall '!cclass'(self, 'blank', .CCLASS_BLANK)
+.end
+
+.sub 'FAILGOAL' :method
+    .param string goal
+    .local string dba
+    $P0 = getinterp
+    $P0 = $P0['sub';1]
+    dba = $P0
+  have_dba:
+    .local string message
+    message = concat "Unable to parse ", dba
+    message .= ", couldn't find final "
+    message .= goal
+    $P0 = getattribute self, '$!target'
+    $I0 = can $P0, 'lineof'
+    unless $I0 goto have_line
+    message .= ' at line '
+    $I0 = self.'pos'()
+    $I0 = $P0.'lineof'($I0)
+    inc $I0
+    $S0 = $I0
+    message .= $S0
+  have_line:
+    die message
+.end
+
+.sub 'DEBUG' :method
+    .param pmc arg             :optional
+    .param int has_arg         :opt_flag
+
+    if has_arg goto have_arg
+    arg = get_global '$!TRUE'
+  have_arg:
+
+    setattribute self, '$!debug', arg
+    .return (1)
+.end
+
+=head1 AUTHORS
+
+Patrick Michaud <pmichaud at pobox.com> is the author and maintainer.
+
+=cut
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
+### .include 'src/Regex/Cursor-protoregex-peek.pir'
+# Copyright (C) 2009, The Perl Foundation.
+
+=head1 NAME
+
+Regex::Cursor-protoregex-peek - simple protoregex implementation
+
+=head1 DESCRIPTION
+
+=over 4
+
+=item !protoregex(name)
+
+Perform a match for protoregex C<name>.
+
+=cut
+
+.sub '!protoregex' :method
+    .param string name
+
+    .local pmc tokrx, toklen
+    (tokrx, toklen) = self.'!protoregex_tokrx'(name)
+  have_tokrx:
+
+    self.'!cursor_debug'('PROTO ', name)
+
+    # If there are no entries at all for this protoregex, we fail outright.
+    unless tokrx goto fail
+
+    # Figure out where we are in the current match.
+    .local pmc target
+    .local int pos
+    target = getattribute self, '$!target'
+    $P1 = getattribute self, '$!pos'
+    pos = $P1
+
+    # Use the character at the current match position to determine
+    # the longest possible token we could encounter at this point.
+    .local string token1, token
+    token1 = substr target, pos, 1
+    $I0 = toklen[token1]
+    token = substr target, pos, $I0
+    $S0 = escape token
+    $S1 = escape token1
+    self.'!cursor_debug'('        token1="', $S1, '", token="', $S0, '"')
+
+    # Create a hash to keep track of the methods we've already called,
+    # so that we don't end up calling it twice.
+    .local pmc mcalled
+    mcalled = new ['Hash']
+
+    # Look in the tokrx hash for any rules that are keyed with the
+    # current token.  If there aren't any, or the rules we have don't
+    # match, then shorten the token by one character and try again
+    # until we either have a match or we've run out of candidates.
+  token_loop:
+    .local pmc rx, result
+    rx = tokrx[token]
+    if null rx goto token_next
+    $I0 = isa rx, ['ResizablePMCArray']
+    if $I0 goto rx_array
+    .local int rxaddr
+    rxaddr = get_addr rx
+    $P0 = mcalled[rxaddr]
+    unless null $P0 goto token_next
+    result = self.rx()
+    mcalled[rxaddr] = mcalled
+    if result goto done
+    goto token_next
+  rx_array:
+    .local pmc rx_it
+    rx_it = iter rx
+  cand_loop:
+    unless rx_it goto cand_done
+    rx = shift rx_it
+    rxaddr = get_addr rx
+    $P0 = mcalled[rxaddr]
+    unless null $P0 goto token_next
+    result = self.rx()
+    mcalled[rxaddr] = mcalled
+    if result goto done
+    goto cand_loop
+  cand_done:
+  token_next:
+    unless token > '' goto fail
+    chopn token, 1
+    goto token_loop
+
+  done:
+    pos = result.'pos'()
+    self.'!cursor_debug'('PASS  ', name, ' at pos=', pos)
+    .return (result)
+
+  fail:
+    self.'!cursor_debug'('FAIL  ', name)
+    unless null result goto fail_1
+    result = self.'!cursor_start'()
+    result.'!cursor_fail'()
+  fail_1:
+    .return (result)
+.end
+
+
+=item !protoregex_generation()
+
+Reset the C<$!generation> flag to indicate that protoregexes
+need to be recalculated (because new protoregexes have been
+added).
+
+=cut
+
+.sub '!protoregex_generation' :method
+    $P0 = get_global '$!generation'
+    # don't change this to 'inc' -- we want to ensure new PMC
+    $P1 = add $P0, 1
+    set_global '$!generation', $P1
+    .return ($P1)
+.end
+
+=item !protoregex_tokrx(name)
+
+Return the token list for protoregex C<name>.  If the list
+doesn't already exist, or if the existing list is stale,
+create a new one and return it.
+
+=cut
+
+.sub '!protoregex_tokrx' :method
+    .param string name
+
+    .local pmc generation
+    generation = get_global '$!generation'
+
+    # Get the protoregex table for the current grammar.  If
+    # a table doesn't exist or it's out of date, generate a
+    # new one.
+    .local pmc parrotclass, prototable
+    parrotclass = typeof self
+    prototable = getprop '%!prototable', parrotclass
+    if null prototable goto make_prototable
+    $P0 = getprop '$!generation', prototable
+    $I0 = issame $P0, generation
+    if $I0 goto have_prototable
+  make_prototable:
+    prototable = self.'!protoregex_gen_table'(parrotclass)
+  have_prototable:
+
+    # Obtain the toxrk and toklen hashes for the current grammar
+    # from the protoregex table.  If they already exist, we're
+    # done, otherwise we create new ones below.
+    # yet for this table, then do that now.
+    .local pmc tokrx, toklen
+    $S0 = concat name, '.tokrx'
+    tokrx = prototable[$S0]
+    $S0 = concat name, '.toklen'
+    toklen = prototable[$S0]
+    unless null tokrx goto tokrx_done
+
+    self.'!cursor_debug'('Generating protoregex table for ', name)
+
+    .local pmc toklen, tokrx
+    toklen = new ['Hash']
+    tokrx  = new ['Hash']
+
+    # The prototable has already collected all of the names of
+    # protoregex methods as keys in C<prototable>.  First
+    # get a list of all of the methods that begin with "name:sym<".
+    .local string mprefix
+    .local int mlen
+    mprefix = concat name, ':sym<'
+    mlen   = length mprefix
+    .local pmc methodlist, proto_it
+    methodlist = new ['ResizableStringArray']
+    proto_it = iter prototable
+  proto_loop:
+    unless proto_it goto proto_done
+    .local string methodname
+    methodname = shift proto_it
+    $S0 = substr methodname, 0, mlen
+    if $S0 != mprefix goto proto_loop
+    push methodlist, methodname
+    goto proto_loop
+  proto_done:
+
+    # Now, walk through all of the methods, building the
+    # tokrx and toklen tables as we go.
+    .local pmc sorttok
+    sorttok = new ['ResizablePMCArray']
+  method_loop:
+    unless methodlist goto method_done
+    methodname = shift methodlist
+
+    # Look up the method itself.
+    .local pmc rx
+    rx = find_method self, methodname
+
+    # Now find the prefix tokens for the method; calling the
+    # method name with a !PREFIX__ prefix should return us a list
+    # of valid token prefixes.  If no such method exists, then
+    # our token prefix is a null string.
+    .local pmc tokens, tokens_it
+    $S0 = concat '!PREFIX__', methodname
+    $I0 = can self, $S0
+    unless $I0 goto method_peek_none
+    tokens = self.$S0()
+    goto method_peek_done
+  method_peek_none:
+    tokens = new ['ResizablePMCArray']
+    push tokens, ''
+  method_peek_done:
+
+    # Now loop through all of the tokens for the method, updating
+    # the longest length per initial token character and adding
+    # the token to the tokrx hash.  Entries in the tokrx hash
+    # are automatically promoted to arrays when there's more
+    # than one candidate, and any arrays created are placed into
+    # sorttok so they can have a secondary sort below.
+    .local pmc seentok
+    seentok = new ['Hash']
+  tokens_loop:
+    unless tokens goto tokens_done
+    .local string tkey, tfirst
+    $P0 = shift tokens
+    $I0 = isa $P0, ['ResizablePMCArray']
+    unless $I0 goto token_item
+    splice tokens, $P0, 0, 0
+    goto tokens_loop
+  token_item:
+    tkey = $P0
+
+    # If we've already processed this token for this rule,
+    # don't enter it twice into tokrx.
+    $I0 = exists seentok[tkey]
+    if $I0 goto tokens_loop
+    seentok[tkey] = seentok
+
+    # Keep track of longest token lengths by initial character
+    tfirst = substr tkey, 0, 1
+    $I0 = length tkey
+    $I1 = toklen[tfirst]
+    if $I0 <= $I1 goto toklen_done
+    toklen[tfirst] = $I0
+  toklen_done:
+
+    # Add the regex to the list under the token key, promoting
+    # entries to lists as appropriate.
+    .local pmc rxlist
+    rxlist = tokrx[tkey]
+    if null rxlist goto rxlist_0
+    $I0 = isa rxlist, ['ResizablePMCArray']
+    if $I0 goto rxlist_n
+  rxlist_1:
+    $I0 = issame rx, rxlist
+    if $I0 goto tokens_loop
+    $P0 = rxlist
+    rxlist = new ['ResizablePMCArray']
+    push sorttok, rxlist
+    push rxlist, $P0
+    push rxlist, rx
+    tokrx[tkey] = rxlist
+    goto tokens_loop
+  rxlist_n:
+    push rxlist, rx
+    goto tokens_loop
+  rxlist_0:
+    tokrx[tkey] = rx
+    goto tokens_loop
+  tokens_done:
+    goto method_loop
+  method_done:
+
+    # in-place sort the keys that ended up with multiple entries
+    .const 'Sub' $P99 = '!protoregex_cmp'
+  sorttok_loop:
+    unless sorttok goto sorttok_done
+    rxlist = shift sorttok
+    rxlist.'sort'($P99)
+    goto sorttok_loop
+  sorttok_done:
+
+    # It's built!  Now store the tokrx and toklen hashes in the
+    # prototable and return them to the caller.
+    $S0 = concat name, '.tokrx'
+    prototable[$S0] = tokrx
+    $S0 = concat name, '.toklen'
+    prototable[$S0] = toklen
+
+  tokrx_done:
+    .return (tokrx, toklen)
+.end
+
+.sub '!protoregex_cmp' :anon
+    .param pmc a
+    .param pmc b
+    $S0 = a
+    $I0 = length $S0
+    $S1 = b
+    $I1 = length $S1
+    $I2 = cmp $I1, $I0
+    .return ($I2)
+.end
+
+=item !protoregex_gen_table(parrotclass)
+
+Generate a new protoregex table for C<parrotclass>.  This involves
+creating a hash keyed with method names containing ':sym<' from
+C<parrotclass> and all of its superclasses.  This new hash is
+then given the current C<$!generate> property so we can avoid
+recreating it on future calls.
+
+=cut
+
+.sub '!protoregex_gen_table' :method
+    .param pmc parrotclass
+
+    .local pmc prototable
+    prototable = new ['Hash']
+    .local pmc class_it, method_it
+    $P0 = parrotclass.'inspect'('all_parents')
+    class_it = iter $P0
+  class_loop:
+    unless class_it goto class_done
+    $P0 = shift class_it
+    $P0 = $P0.'methods'()
+    method_it = iter $P0
+  method_loop:
+    unless method_it goto class_loop
+    $S0 = shift method_it
+    $I0 = index $S0, ':sym<'
+    if $I0 < 0 goto method_loop
+    prototable[$S0] = prototable
+    goto method_loop
+  class_done:
+    $P0 = get_global '$!generation'
+    setprop prototable, '$!generation', $P0
+    setprop parrotclass, '%!prototable', prototable
+    .return (prototable)
+.end
+
+
+=item !PREFIX__!protoregex(name)
+
+Return the set of initial tokens for protoregex C<name>.
+These are conveniently available as the keys of the
+tokrx hash.
+
+=cut
+
+.sub '!PREFIX__!protoregex' :method
+    .param string name
+
+    .local pmc tokrx
+    tokrx = self.'!protoregex_tokrx'(name)
+    unless tokrx goto peek_none
+
+    .local pmc results, tokrx_it
+    results = new ['ResizablePMCArray']
+    tokrx_it = iter tokrx
+  tokrx_loop:
+    unless tokrx_it goto tokrx_done
+    $S0 = shift tokrx_it
+    push results, $S0
+    goto tokrx_loop
+  tokrx_done:
+    .return (results)
+
+  peek_none:
+    .return ('')
+.end
+
+
+.sub '!PREFIX__!subrule' :method
+    .param string name
+    .param string prefix
+
+    .local string peekname
+    peekname = concat '!PREFIX__', name
+    $I0 = can self, peekname
+    unless $I0 goto subrule_none
+
+    # make sure we aren't recursing
+    .local pmc context
+    $P0 = getinterp
+    context = $P0['context';1]
+  caller_loop:
+    if null context goto caller_done
+    $P0 = getattribute context, 'current_sub'
+    $S0 = $P0
+    # stop if we find a name that doesn't begin with ! (33)
+    $I0 = ord $S0
+    if $I0 != 33 goto caller_done
+    if $S0 == peekname goto subrule_none
+    context = getattribute context, 'caller_ctx'
+    goto caller_loop
+  caller_done:
+
+    .local pmc subtokens, tokens
+    subtokens = self.peekname()
+    unless subtokens goto subrule_none
+    unless prefix goto prefix_none
+    tokens = new ['ResizablePMCArray']
+  subtokens_loop:
+    unless subtokens goto subtokens_done
+    $P0 = shift subtokens
+    $I0 = isa $P0, ['ResizablePMCArray']
+    unless $I0 goto subtokens_item
+    splice subtokens, $P0, 0, 0
+    goto subtokens_loop
+  subtokens_item:
+    $S0 = $P0
+    $S0 = concat prefix, $S0
+    push tokens, $S0
+    goto subtokens_loop
+  subtokens_done:
+    .return (tokens)
+
+  prefix_none:
+    .return (subtokens)
+
+  subrule_none:
+    .return (prefix)
+.end
+
+
+.sub 'DUMP_TOKRX' :method
+    .param string name
+
+    .local pmc tokrx
+    tokrx = self.'!protoregex_tokrx'(name)
+    _dumper(tokrx, name)
+    .return (1)
+.end
+
+=back
+
+=cut
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
+
+### .include 'src/Regex/Match.pir'
+# Copyright (C) 2009, The Perl Foundation.
+# $Id$
+
+=head1 NAME
+
+Regex::Match - Regex Match objects
+
+=head1 DESCRIPTION
+
+This file implements Match objects for the regex engine.
+
+=cut
+
+.namespace ['Regex';'Match']
+
+.sub '' :anon :load :init
+    load_bytecode 'P6object.pbc'
+    .local pmc p6meta
+    p6meta = new 'P6metaclass'
+    $P0 = p6meta.'new_class'('Regex::Match', 'parent'=>'Capture', 'attr'=>'$!cursor $!target $!from $!to $!ast')
+    .return ()
+.end
+
+=head2 Methods
+
+=over 4
+
+=item CURSOR()
+
+Returns the Cursor associated with this match object.
+
+=cut
+
+.sub 'CURSOR' :method
+    $P0 = getattribute self, '$!cursor'
+    .return ($P0)
+.end
+
+=item from()
+
+Returns the offset in the target string of the beginning of the match.
+
+=cut
+
+.sub 'from' :method
+    $P0 = getattribute self, '$!from'
+    .return ($P0)
+.end
+
+
+=item to()
+
+Returns the offset in the target string of the end of the match.
+
+=cut
+
+.sub 'to' :method
+    $P0 = getattribute self, '$!to'
+    .return ($P0)
+.end
+
+
+=item chars()
+
+Returns C<.to() - .from()>
+
+=cut
+
+.sub 'chars' :method
+    $I0 = self.'to'()
+    $I1 = self.'from'()
+    $I2 = $I0 - $I1
+    .return ($I2)
+.end
+
+
+=item orig()
+
+Return the original item that was matched against.
+
+=cut
+
+.sub 'orig' :method
+    $P0 = getattribute self, '$!target'
+    .return ($P0)
+.end
+
+
+=item Str()
+
+Returns the portion of the target corresponding to this match.
+
+=cut
+
+.sub 'Str' :method
+    $S0 = self.'orig'()
+    $I0 = self.'from'()
+    $I1 = self.'to'()
+    $I1 -= $I0
+    $S1 = substr $S0, $I0, $I1
+    .return ($S1)
+.end
+
+
+=item ast()
+
+Returns the "abstract object" for the Match; if no abstract object
+has been set then returns C<Str> above.
+
+=cut
+
+.sub 'ast' :method
+    .local pmc ast
+    ast = getattribute self, '$!ast'
+    unless null ast goto have_ast
+    ast = new ['Undef']
+    setattribute self, '$!ast', ast
+  have_ast:
+    .return (ast)
+.end
+
+=back
+
+=head2 Vtable functions
+
+=over 4
+
+=item get_bool()
+
+Returns 1 (true) if this is the result of a successful match,
+otherwise returns 0 (false).
+
+=cut
+
+.sub '' :vtable('get_bool') :method
+    $P0 = getattribute self, '$!from'
+    $P1 = getattribute self, '$!to'
+    $I0 = isge $P1, $P0
+    .return ($I0)
+.end
+
+
+=item get_integer()
+
+Returns the integer value of the matched text.
+
+=cut
+
+.sub '' :vtable('get_integer') :method
+    $I0 = self.'Str'()
+    .return ($I0)
+.end
+
+
+=item get_number()
+
+Returns the numeric value of this match
+
+=cut
+
+.sub '' :vtable('get_number') :method
+    $N0 = self.'Str'()
+    .return ($N0)
+.end
+
+
+=item get_string()
+
+Returns the string value of the match
+
+=cut
+
+.sub '' :vtable('get_string') :method
+    $S0 = self.'Str'()
+    .return ($S0)
+.end
+
+
+=item !make(obj)
+
+Set the "ast object" for the invocant.
+
+=cut
+
+.sub '!make' :method
+    .param pmc obj
+    setattribute self, '$!ast', obj
+    .return (obj)
+.end
+
+
+=back
+
+=head1 AUTHORS
+
+Patrick Michaud <pmichaud at pobox.com> is the author and maintainer.
+
+=cut
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
+### .include 'src/Regex/Method.pir'
+# Copyright (C) 2009, The Perl Foundation.
+# $Id$
+
+=head1 NAME
+
+Regex::Regex, Regex::Method - Regex subs
+
+=head1 DESCRIPTION
+
+This file implements the Regex::Method and Regex::Regex types, used as 
+containers for Regex subs that need .ACCEPTS and other regex attributes.
+
+=cut
+
+.namespace ['Regex';'Method']
+
+.sub '' :anon :load :init
+    load_bytecode 'P6object.pbc'
+    .local pmc p6meta, mproto, rproto
+    p6meta = new 'P6metaclass'
+    mproto = p6meta.'new_class'('Regex::Method', 'parent'=>'parrot;Sub')
+    rproto = p6meta.'new_class'('Regex::Regex', 'parent'=>mproto)
+.end
+
+=head2 Methods
+
+=over 4
+
+=item new(sub)
+
+Create a new Regex::Regex object from C<sub>.
+
+=cut
+
+.sub 'new' :method
+    .param pmc parrotsub
+    $P0 = self.'WHO'()
+    $P0 = new $P0
+    assign $P0, parrotsub
+    .return ($P0)
+.end
+
+
+=item ACCEPTS(target)
+
+Perform a match against target, return the result.
+
+=cut
+
+.sub 'ACCEPTS' :method
+    .param pmc target
+
+    .local pmc curproto, match
+    curproto = get_hll_global ['Regex'], 'Cursor'
+    match = curproto.'parse'(target, 'rule'=>self)
+    .return (match)
+.end
+
+.namespace ['Regex';'Regex']
+
+.sub 'ACCEPTS' :method
+    .param pmc target
+
+    .local pmc curproto, match
+    curproto = get_hll_global ['Regex'], 'Cursor'
+    match = curproto.'parse'(target, 'rule'=>self, 'c'=>0)
+    .return (match)
+.end
+
+
+=back
+
+=head1 AUTHORS
+
+Patrick Michaud <pmichaud at pobox.com> is the author and maintainer.
+
+=cut
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
+### .include 'src/Regex/Dumper.pir'
+# Copyright (C) 2005-2009, Parrot Foundation.
+# Copyright (C) 2009, The Perl Foundation.
+# $Id$
+
+=head1 TITLE
+
+Regex::Dumper - various methods for displaying Match structures
+
+=head2 C<Regex::Match> Methods
+
+=over 4
+
+=item C<__dump(PMC dumper, STR label)>
+
+This method enables Data::Dumper to work on Regex::Match objects.
+
+=cut
+
+.namespace ['Regex';'Match']
+
+.sub "__dump" :method
+    .param pmc dumper
+    .param string label
+    .local string indent, subindent
+    .local pmc it, val
+    .local string key
+    .local pmc hash, array
+    .local int hascapts
+
+    (subindent, indent) = dumper."newIndent"()
+    print "=> "
+    $S0 = self
+    dumper."genericString"("", $S0)
+    print " @ "
+    $I0 = self.'from'()
+    print $I0
+    hascapts = 0
+    hash = self.'hash'()
+    if_null hash, dump_array
+    it = iter hash
+  dump_hash_1:
+    unless it goto dump_array
+    if hascapts goto dump_hash_2
+    print " {"
+    hascapts = 1
+  dump_hash_2:
+    print "\n"
+    print subindent
+    key = shift it
+    val = hash[key]
+    print "<"
+    print key
+    print "> => "
+    dumper."dump"(label, val)
+    goto dump_hash_1
+  dump_array:
+    array = self.'list'()
+    if_null array, dump_end
+    $I1 = elements array
+    $I0 = 0
+  dump_array_1:
+    if $I0 >= $I1 goto dump_end
+    if hascapts goto dump_array_2
+    print " {"
+    hascapts = 1
+  dump_array_2:
+    print "\n"
+    print subindent
+    val = array[$I0]
+    print "["
+    print $I0
+    print "] => "
+    dumper."dump"(label, val)
+    inc $I0
+    goto dump_array_1
+  dump_end:
+    unless hascapts goto end
+    print "\n"
+    print indent
+    print "}"
+  end:
+    dumper."deleteIndent"()
+.end
+
+
+=item C<dump_str()>
+
+An alternate dump output for a Match object and all of its subcaptures.
+
+=cut
+
+.sub "dump_str" :method
+    .param string prefix       :optional           # name of match variable
+    .param int has_prefix      :opt_flag
+    .param string b1           :optional           # bracket open
+    .param int has_b1          :opt_flag
+    .param string b2           :optional           # bracket close
+    .param int has_b2          :opt_flag
+
+    .local pmc capt
+    .local int spi, spc
+    .local pmc it
+    .local string prefix1, prefix2
+    .local pmc jmpstack
+    jmpstack = new 'ResizableIntegerArray'
+
+    if has_b2 goto start
+    b2 = "]"
+    if has_b1 goto start
+    b1 = "["
+  start:
+    .local string out
+    out = concat prefix, ':'
+    unless self goto subpats
+    out .= ' <'
+    $S0 = self
+    out .= $S0
+    out .= ' @ '
+    $S0 = self.'from'()
+    out .= $S0
+    out .= '> '
+
+  subpats:
+    $I0 = self
+    $S0 = $I0
+    out .= $S0
+    out .= "\n"
+    capt = self.'list'()
+    if_null capt, subrules
+    spi = 0
+    spc = elements capt
+  subpats_1:
+    unless spi < spc goto subrules
+    prefix1 = concat prefix, b1
+    $S0 = spi
+    concat prefix1, $S0
+    concat prefix1, b2
+    $I0 = defined capt[spi]
+    unless $I0 goto subpats_2
+    $P0 = capt[spi]
+    local_branch jmpstack, dumper
+  subpats_2:
+    inc spi
+    goto subpats_1
+
+  subrules:
+    capt = self.'hash'()
+    if_null capt, end
+    it = iter capt
+  subrules_1:
+    unless it goto end
+    $S0 = shift it
+    prefix1 = concat prefix, '<'
+    concat prefix1, $S0
+    concat prefix1, ">"
+    $I0 = defined capt[$S0]
+    unless $I0 goto subrules_1
+    $P0 = capt[$S0]
+    local_branch jmpstack, dumper
+    goto subrules_1
+
+  dumper:
+    $I0 = isa $P0, ['Regex';'Match']
+    unless $I0 goto dumper_0
+    $S0 = $P0.'dump_str'(prefix1, b1, b2)
+    out .= $S0
+    local_return jmpstack
+  dumper_0:
+    $I0 = does $P0, 'array'
+    unless $I0 goto dumper_3
+    $I0 = 0
+    $I1 = elements $P0
+  dumper_1:
+    if $I0 >= $I1 goto dumper_2
+    $P1 = $P0[$I0]
+    prefix2 = concat prefix1, b1
+    $S0 = $I0
+    concat prefix2, $S0
+    concat prefix2, b2
+    $S0 = $P1.'dump_str'(prefix2, b1, b2)
+    out .= $S0
+    inc $I0
+    goto dumper_1
+  dumper_2:
+    local_return jmpstack
+  dumper_3:
+    out .= prefix1
+    out .= ': '
+    $S0 = $P0
+    out .= $S0
+    out .= "\n"
+    local_return jmpstack
+
+  end:
+    .return (out)
+.end
+
+
+=back
+
+=cut
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
+
+### .include 'src/PAST/Regex.pir'
+# $Id$
+
+=head1 NAME
+
+PAST::Regex - Regex nodes for PAST
+
+=head1 DESCRIPTION
+
+This file implements the various abstract syntax tree nodes
+for regular expressions.
+
+=over 4
+
+=cut
+
+.namespace ['PAST';'Regex']
+
+.sub '' :init :load
+    load_bytecode 'PCT/PAST.pbc'
+    .local pmc p6meta
+    p6meta = get_hll_global 'P6metaclass'
+    p6meta.'new_class'('PAST::Regex', 'parent'=>'PAST::Node')
+.end
+
+
+.sub 'backtrack' :method
+    .param pmc value           :optional
+    .param int has_value       :opt_flag
+    .tailcall self.'attr'('backtrack', value, has_value)
+.end
+
+
+.sub 'capnames' :method
+    .param pmc value           :optional
+    .param int has_value       :opt_flag
+    .tailcall self.'attr'('capnames', value, has_value)
+.end
+
+
+.sub 'negate' :method
+    .param pmc value           :optional
+    .param int has_value       :opt_flag
+    .tailcall self.'attr'('negate', value, has_value)
+.end
+
+
+.sub 'min' :method
+    .param pmc value           :optional
+    .param int has_value       :opt_flag
+    .tailcall self.'attr'('min', value, has_value)
+.end
+
+
+.sub 'max' :method
+    .param pmc value           :optional
+    .param int has_value       :opt_flag
+    .tailcall self.'attr'('max', value, has_value)
+.end
+
+
+.sub 'pasttype' :method
+    .param pmc value           :optional
+    .param int has_value       :opt_flag
+    .tailcall self.'attr'('pasttype', value, has_value)
+.end
+
+
+.sub 'sep' :method
+    .param pmc value           :optional
+    .param int has_value       :opt_flag
+    .tailcall self.'attr'('sep', value, has_value)
+.end
+
+
+.sub 'subtype' :method
+    .param pmc value           :optional
+    .param int has_value       :opt_flag
+    .tailcall self.'attr'('subtype', value, has_value)
+.end
+
+
+.sub 'zerowidth' :method
+    .param pmc value           :optional
+    .param int has_value       :opt_flag
+    .tailcall self.'attr'('zerowidth', value, has_value)
+.end
+
+
+=item prefix()
+
+Returns the prefixes associated with the regex tree rooted
+at this node.
+
+=cut
+
+.sub 'prefix' :method
+    .param string prefix
+    .param pmc tail            :slurpy
+
+    .local string pasttype
+    pasttype = self.'pasttype'()
+    if pasttype goto have_pasttype
+    pasttype = 'concat'
+  have_pasttype:
+
+    if pasttype == 'scan' goto prefix_skip
+
+    $S0 = concat 'prefix_', pasttype
+    $I0 = can self, $S0
+    unless $I0 goto prefix_done
+    .tailcall self.$S0(prefix, tail)
+
+  prefix_skip:
+    unless tail goto prefix_done
+    .local pmc head
+    head = shift tail
+    .tailcall head.'prefix'(prefix, tail :flat)
+
+  prefix_done:
+    .return (prefix)
+.end
+
+
+.sub 'prefix_alt' :method
+    .param string prefix
+    .param pmc tail
+
+    .local pmc child_it, results
+    child_it = self.'iterator'()
+    results = new ['ResizablePMCArray']
+  child_loop:
+    unless child_it goto child_done
+    $P0 = shift child_it
+    ($P1 :slurpy) = $P0.'prefix'(prefix, tail :flat)
+    splice results, $P1, 0, 0
+    goto child_loop
+  child_done:
+    .return (results :flat)
+.end
+
+
+.sub 'prefix_alt_longest' :method
+    .param string prefix
+    .param pmc tail
+    .tailcall self.'prefix_alt'(prefix, tail :flat)
+.end
+
+
+.sub 'prefix_anchor' :method
+    .param string prefix
+    .param pmc tail
+
+    unless tail goto anchor_done
+    .local pmc head
+    head = shift tail
+    .tailcall head.'prefix'(prefix, tail :flat)
+  anchor_done:
+    .return (prefix)
+.end
+
+
+.sub 'prefix_concat' :method
+    .param string prefix
+    .param pmc tail
+
+    $P0 = self.'list'()
+    splice tail, $P0, 0, 0
+    unless tail goto done
+    $P1 = shift tail
+    .tailcall $P1.'prefix'(prefix, tail :flat)
+  done:
+    .return (prefix)
+.end
+
+
+.sub 'prefix_literal' :method
+    .param string prefix
+    .param pmc tail
+
+    .local pmc lpast
+    lpast = self[0]
+    $I0 = isa lpast, ['String']
+    unless $I0 goto done
+
+    .local string subtype
+    subtype = self.'subtype'()
+    if subtype == 'ignorecase' goto done
+
+    $S0 = lpast
+    prefix = concat prefix, $S0
+    unless tail goto done
+    $P0 = shift tail
+    .tailcall $P0.'prefix'(prefix, tail :flat)
+
+  done:
+    .return (prefix)
+.end
+
+
+.sub 'prefix_enumcharlist' :method
+    .param string prefix
+    .param pmc tail
+
+    .local pmc negate
+    negate = self.'negate'()
+    .local string subtype, charlist
+    subtype = self.'subtype'()
+    charlist = self[0]
+
+    if negate goto charlist_negate
+
+    unless tail goto charlist_notail
+    if subtype == 'zerowidth' goto charlist_notail
+
+    .local pmc result, head
+    result = new ['ResizablePMCArray']
+    head = shift tail
+
+    .local int pos, eos
+    eos = length charlist
+    pos = 0
+  charlist_loop:
+    unless pos < eos goto charlist_done
+    .local string char
+    char = substr charlist, pos, 1
+    $S0 = concat prefix, char
+    ($P0 :slurpy) = head.'prefix'($S0, tail :flat)
+    splice result, $P0, 0, 0
+    inc pos
+    goto charlist_loop
+  charlist_done:
+    .return (result :flat)
+
+  charlist_notail:
+    $P0 = split '', charlist
+    .return ($P0 :flat)
+
+  charlist_negate:
+    if subtype == 'zerowidth' goto charlist_negate_0
+    unless tail goto charlist_negate_0
+    .return (prefix)
+  charlist_negate_0:
+    head = shift tail
+    .tailcall head.'prefix'(prefix, tail :flat)
+.end
+
+
+.sub 'prefix_subcapture' :method
+    .param string prefix
+    .param pmc tail
+
+    .tailcall self.'prefix_concat'(prefix, tail)
+.end
+
+.sub 'prefix_subrule' :method
+    .param string prefix
+    .param pmc tail
+
+    .local pmc name, negate, subtype
+    name = self.'name'()
+    negate = self.'negate'()
+    subtype = self.'subtype'()
+    $I0 = does name, 'string'
+    unless $I0 goto subrule_none
+    if negate goto subrule_none
+    if subtype == 'zerowidth' goto subrule_none
+
+    .local pmc selfpast, spast
+    $P99 = get_hll_global ['PAST'], 'Var'
+    selfpast = $P99.'new'( 'name'=>'self', 'scope'=>'register')
+    $P99 = get_hll_global ['PAST'], 'Op'
+    spast = $P99.'new'( selfpast, name, prefix, 'name'=>'!PREFIX__!subrule', 'pasttype'=>'callmethod')
+    .return (spast)
+
+  subrule_none:
+    .return (prefix)
+.end
+
+=back
+
+=head1 AUTHOR
+
+Patrick Michaud <pmichaud at pobox.com> is the author and maintainer.
+Please send patches and suggestions to the Parrot porters or
+Perl 6 compilers mailing lists.
+
+=head1 COPYRIGHT
+
+Copyright (C) 2009, The Perl Foundation.
+
+=cut
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
+### .include 'src/PAST/Compiler-Regex.pir'
+# $Id$
+
+=head1 NAME
+
+PAST::Compiler-Regex - Compiler for PAST::Regex nodes
+
+=head1 DESCRIPTION
+
+PAST::Compiler-Regex implements the transformations to convert
+PAST::Regex nodes into POST.  It's still a part of PAST::Compiler;
+we've separated out the regex-specific transformations here for
+better code management and debugging.
+
+=head2 Compiler methods
+
+=head3 C<PAST::Regex>
+
+=over 4
+
+=item as_post(PAST::Regex node)
+
+Return the POST representation of the regex AST rooted by C<node>.
+
+=cut
+
+.include 'cclass.pasm'
+### .include 'src/Regex/constants.pir'
+.const int CURSOR_FAIL = -1
+.const int CURSOR_FAIL_GROUP = -2
+.const int CURSOR_FAIL_RULE = -3
+.const int CURSOR_FAIL_MATCH = -4
+
+.const int CURSOR_TYPE_SCAN = 1
+.const int CURSOR_TYPE_PEEK = 2
+
+.namespace ['PAST';'Compiler']
+
+.sub 'as_post' :method :multi(_, ['PAST';'Regex'])
+    .param pmc node
+    .param pmc options         :slurpy :named
+
+    .local pmc ops
+    ops = self.'post_new'('Ops', 'node'=>node)
+
+    .local pmc reghash
+    reghash = new ['Hash']
+    .lex '$*REG', reghash
+
+    .local pmc regexname, regexname_esc
+    $P0 = get_global '@?BLOCK'
+    $P1 = $P0[0]
+    $S0 = $P1.'name'()
+    regexname = box $S0
+    regexname_esc = self.'escape'($S0)
+    .lex '$*REGEXNAME', regexname
+
+    .local string prefix, rname, rtype
+    prefix = self.'unique'('rx')
+    concat prefix, '_'
+    $P0 = split ' ', 'tgt string pos int off int eos int rep int cur pmc'
+    $P1 = iter $P0
+  iter_loop:
+    unless $P1 goto iter_done
+    rname = shift $P1
+    rtype = shift $P1
+    $S1 = concat prefix, rname
+    reghash[rname] = $S1
+    $S2 = concat '.local ', rtype
+    ops.'push_pirop'($S2, $S1)
+    goto iter_loop
+  iter_done:
+
+    .local pmc startlabel, donelabel, faillabel
+    $S0 = concat prefix, 'start'
+    startlabel = self.'post_new'('Label', 'result'=>$S0)
+    $S0 = concat prefix, 'done'
+    donelabel = self.'post_new'('Label', 'result'=>$S0)
+    $S0 = concat prefix, 'fail'
+    faillabel = self.'post_new'('Label', 'result'=>$S0)
+    reghash['fail'] = faillabel
+
+    # If capnames is available, it's a hash where each key is the
+    # name of a potential subcapture and the value is greater than 1
+    # if it's to be an array.  This builds a list of arrayed subcaptures
+    # for use by "!cursor_caparray" below.
+    .local pmc capnames, capnames_it, caparray
+    capnames = node.'capnames'()
+    caparray = box 0
+    unless capnames goto capnames_done
+    capnames_it = iter capnames
+    caparray = new ['ResizablePMCArray']
+  capnames_loop:
+    unless capnames_it goto capnames_done
+    $S0 = shift capnames_it
+    $I0 = capnames[$S0]
+    unless $I0 > 1 goto capnames_loop
+    $S0 = self.'escape'($S0)
+    push caparray, $S0
+    goto capnames_loop
+  capnames_done:
+
+    .local string cur, rep, pos, tgt, off, eos
+    (cur, rep, pos, tgt, off, eos) = self.'!rxregs'('cur rep pos tgt off eos')
+
+    unless regexname goto peek_done
+    .local pmc tpast, token, tpost
+    $P99 = get_hll_global ['PAST'], 'Op'
+    tpast = $P99.'new'( 'pasttype'=>'list', 'node'=>node )
+    (token :slurpy) = node.'prefix'('')
+  token_loop:
+    unless token goto token_done
+    $P0 = shift token
+    push tpast, $P0
+    goto token_loop
+  token_done:
+    $S0 = regexname
+    $S0 = concat '!PREFIX__', $S0
+    $P99 = get_hll_global ['PAST'], 'Block'
+    tpast = $P99.'new'(tpast, 'name'=>$S0, 'lexical'=>0, 'blocktype'=>'method')
+    tpost = self.'as_post'(tpast, 'rtype'=>'v')
+    ops.'push'(tpost)
+  peek_done:
+
+    $S0 = concat '(', cur
+    concat $S0, ', '
+    concat $S0, pos
+    concat $S0, ', '
+    concat $S0, tgt
+    concat $S0, ')'
+    ops.'push_pirop'('callmethod', '"!cursor_start"', 'self', 'result'=>$S0)
+    self.'!cursorop'(ops, '!cursor_debug', 0, '"START "', regexname_esc)
+    unless caparray goto caparray_skip
+    self.'!cursorop'(ops, '!cursor_caparray', 0, caparray :flat)
+  caparray_skip:
+
+    ops.'push_pirop'('.lex', 'unicode:"$\x{a2}"', cur)
+    ops.'push_pirop'('.local pmc', 'match')
+    ops.'push_pirop'('.lex', '"$/"', 'match')
+    ops.'push_pirop'('length', eos, tgt, 'result'=>eos)
+
+    # On Parrot, indexing into variable-width encoded strings
+    # (such as utf8) becomes much more expensive as we move
+    # farther away from the beginning of the string (via calls
+    # to utf8_skip_forward).  For regexes that are starting a match
+    # at a position other than the beginning of the string (e.g.,
+    # a subrule call), we can save a lot of useless scanning work
+    # in utf8_skip_forward by removing the first C<off = from-1>
+    # characters from the target and then performing all indexed
+    # operations on the resulting target relative to C<off>.
+
+    ops.'push_pirop'('set', off, 0)
+    ops.'push_pirop'('lt', pos, 2, startlabel)
+    ops.'push_pirop'('sub', off, pos, 1, 'result'=>off)
+    ops.'push_pirop'('substr', tgt, tgt, off, 'result'=>tgt)
+    ops.'push'(startlabel)
+
+    $P0 = self.'post_regex'(node)
+    ops.'push'($P0)
+    ops.'push'(faillabel)
+    self.'!cursorop'(ops, '!mark_fail', 4, rep, pos, '$I10', '$P10', 0)
+    ops.'push_pirop'('lt', pos, CURSOR_FAIL, donelabel)
+    ops.'push_pirop'('eq', pos, CURSOR_FAIL, faillabel)
+    ops.'push_pirop'('jump', '$I10')
+    ops.'push'(donelabel)
+    self.'!cursorop'(ops, '!cursor_fail', 0)
+    self.'!cursorop'(ops, '!cursor_debug', 0, '"FAIL  "', regexname_esc)
+    ops.'push_pirop'('return', cur)
+    .return (ops)
+.end
+
+=item !cursorop(ops, func, retelems, arg :slurpy)
+
+Helper function to push POST nodes onto C<ops> that perform C<func>
+on the regex's current cursor.  By default this ends up being a method
+call on the cursor, but some values of C<func> can result in inlined
+code to perform the equivalent operation without using the method call.
+
+The C<retelems> argument is the number of elements in C<arg> that
+represent return values from the function; any remaining elements in arg
+are passed to the function as input arguments.
+
+=cut
+
+.sub '!cursorop' :method
+    .param pmc ops
+    .param string func
+    .param int retelems
+    .param pmc args            :slurpy
+
+    if retelems < 1 goto result_done
+    .local pmc retargs
+    retargs = new ['ResizableStringArray']
+    $I0 = retelems
+  retargs_loop:
+    unless $I0 > 0 goto retargs_done
+    $S0 = shift args
+    push retargs, $S0
+    dec $I0
+    goto retargs_loop
+  retargs_done:
+    .local string result
+    result = join ', ', retargs
+    result = concat '(', result
+    concat result, ')'
+  result_done:
+
+    .local pmc cur
+    cur = self.'!rxregs'('cur')
+    $S0 = self.'escape'(func)
+    $P0 = ops.'push_pirop'('callmethod', $S0, cur, args :flat)
+    if retelems < 1 goto done
+    $P0.'result'(result)
+  done:
+    .return (ops)
+.end
+
+
+=item !rxregs(keystr)
+
+Helper function -- looks up the current regex register table
+in the dynamic scope and returns a slice based on the keys
+given in C<keystr>.
+
+=cut
+
+.sub '!rxregs' :method
+    .param string keystr
+
+    .local pmc keys, reghash, vals
+    keys = split ' ', keystr
+    reghash = find_dynamic_lex '$*REG'
+    vals = new ['ResizablePMCArray']
+  keys_loop:
+    unless keys goto keys_done
+    $S0 = shift keys
+    $P0 = reghash[$S0]
+    push vals, $P0
+    goto keys_loop
+  keys_done:
+    .return (vals :flat)
+.end
+
+
+=item post_regex(PAST::Regex node)
+
+Return the POST representation of the regex component given by C<node>.
+Normally this is handled by redispatching to a method corresponding to
+the node's "pasttype" and "backtrack" attributes.  If no "pasttype" is
+given, then "concat" is assumed.
+
+=cut
+
+.sub 'post_regex' :method :multi(_, ['PAST';'Regex'])
+    .param pmc node
+    .param string cur          :optional
+    .param int have_cur        :opt_flag
+
+    .local string pasttype
+    pasttype = node.'pasttype'()
+    if pasttype goto have_pasttype
+    pasttype = 'concat'
+  have_pasttype:
+    $P0 = find_method self, pasttype
+    $P1 = self.$P0(node)
+    unless have_cur goto done
+    $S0 = $P1.'result'()
+    if $S0 == cur goto done
+    $P1 = self.'coerce'($P1, cur)
+  done:
+    .return ($P1)
+.end
+
+
+.sub 'post_regex' :method :multi(_, _)
+    .param pmc node
+    .param string cur          :optional
+    .param int have_cur        :opt_flag
+
+    $P0 = self.'as_post'(node)
+    unless have_cur goto done
+    $P0 = self.'coerce'($P0, cur)
+  done:
+    .return ($P0)
+.end
+
+
+=item alt(PAST::Regex node)
+
+=cut
+
+.sub 'alt' :method :multi(_, ['PAST';'Regex'])
+    .param pmc node
+
+    .local pmc cur, pos
+    (cur, pos) = self.'!rxregs'('cur pos')
+
+    .local string name
+    name = self.'unique'('alt')
+    concat name, '_'
+
+    .local pmc ops, iter
+    ops = self.'post_new'('Ops', 'node'=>node, 'result'=>cur)
+    iter = node.'iterator'()
+    unless iter goto done
+
+    .local int acount
+    .local pmc alabel, endlabel
+    acount = 0
+    $S0 = acount
+    $S0 = concat name, $S0
+    alabel = self.'post_new'('Label', 'result'=>$S0)
+    $S0 = concat name, 'end'
+    endlabel = self.'post_new'('Label', 'result'=>$S0)
+
+  iter_loop:
+    ops.'push'(alabel)
+    .local pmc apast, apost
+    apast = shift iter
+    apost = self.'post_regex'(apast, cur)
+    unless iter goto iter_done
+    inc acount
+    $S0 = acount
+    $S0 = concat name, $S0
+    alabel = self.'post_new'('Label', 'result'=>$S0)
+    ops.'push_pirop'('set_addr', '$I10', alabel)
+    self.'!cursorop'(ops, '!mark_push', 0, 0, pos, '$I10')
+    ops.'push'(apost)
+    ops.'push_pirop'('goto', endlabel)
+    goto iter_loop
+  iter_done:
+    ops.'push'(apost)
+    ops.'push'(endlabel)
+  done:
+    .return (ops)
+.end
+
+
+=item alt_longest(PAST::Regex node)
+
+Same as 'alt' above, but use declarative/LTM semantics.
+(Currently we cheat and just use 'alt' above.)
+
+=cut
+
+.sub 'alt_longest' :method
+    .param pmc node
+    .tailcall self.'alt'(node)
+.end
+
+
+=item anchor(PAST::Regex node)
+
+Match various anchor points, including ^, ^^, $, $$.
+
+=cut
+
+.sub 'anchor' :method :multi(_, ['PAST';'Regex'])
+    .param pmc node
+
+    .local pmc cur, tgt, pos, off, eos, fail, ops
+    (cur, tgt, pos, off, eos, fail) = self.'!rxregs'('cur tgt pos off eos fail')
+    ops = self.'post_new'('Ops', 'node'=>node, 'result'=>cur)
+
+    .local string subtype
+    subtype = node.'subtype'()
+
+    ops.'push_pirop'('inline', subtype, 'inline'=>'  # rxanchor %0')
+
+    if subtype == 'null' goto done
+    if subtype == 'fail' goto anchor_fail
+    if subtype == 'bos' goto anchor_bos
+    if subtype == 'eos' goto anchor_eos
+    if subtype == 'lwb' goto anchor_lwb
+    if subtype == 'rwb' goto anchor_rwb
+
+    .local pmc donelabel
+    $S0 = self.'unique'('rxanchor')
+    concat $S0, '_done'
+    donelabel = self.'post_new'('Label', 'result'=>$S0)
+
+    if subtype == 'bol' goto anchor_bol
+    if subtype == 'eol' goto anchor_eol
+
+    self.'panic'('Unrecognized subtype "', subtype, '" in PAST::Regex anchor node')
+
+  anchor_fail:
+    ops.'push_pirop'('goto', fail)
+    goto done
+
+  anchor_bos:
+    ops.'push_pirop'('ne', pos, 0, fail)
+    goto done
+
+  anchor_eos:
+    ops.'push_pirop'('ne', pos, eos, fail)
+    goto done
+
+  anchor_bol:
+    ops.'push_pirop'('eq', pos, 0, donelabel)
+    ops.'push_pirop'('ge', pos, eos, fail)
+    ops.'push_pirop'('sub', '$I10', pos, off)
+    ops.'push_pirop'('dec', '$I10')
+    ops.'push_pirop'('is_cclass', '$I11', .CCLASS_NEWLINE, tgt, '$I10')
+    ops.'push_pirop'('unless', '$I11', fail)
+    ops.'push'(donelabel)
+    goto done
+
+  anchor_eol:
+    ops.'push_pirop'('sub', '$I10', pos, off)
+    ops.'push_pirop'('is_cclass', '$I11', .CCLASS_NEWLINE, tgt, '$I10')
+    ops.'push_pirop'('if', '$I11', donelabel)
+    ops.'push_pirop'('ne', pos, eos, fail)
+    ops.'push_pirop'('eq', pos, 0, donelabel)
+    ops.'push_pirop'('dec', '$I10')
+    ops.'push_pirop'('is_cclass', '$I11', .CCLASS_NEWLINE, tgt, '$I10')
+    ops.'push_pirop'('if', '$I11', fail)
+    ops.'push'(donelabel)
+    goto done
+
+  anchor_lwb:
+    ops.'push_pirop'('ge', pos, eos, fail)
+    ops.'push_pirop'('sub', '$I10', pos, off)
+    ops.'push_pirop'('is_cclass', '$I11', .CCLASS_WORD, tgt, '$I10')
+    ops.'push_pirop'('unless', '$I11', fail)
+    ops.'push_pirop'('dec', '$I10')
+    ops.'push_pirop'('is_cclass', '$I11', .CCLASS_WORD, tgt, '$I10')
+    ops.'push_pirop'('if', '$I11', fail)
+    goto done
+
+  anchor_rwb:
+    ops.'push_pirop'('le', pos, 0, fail)
+    ops.'push_pirop'('sub', '$I10', pos, off)
+    ops.'push_pirop'('is_cclass', '$I11', .CCLASS_WORD, tgt, '$I10')
+    ops.'push_pirop'('if', '$I11', fail)
+    ops.'push_pirop'('dec', '$I10')
+    ops.'push_pirop'('is_cclass', '$I11', .CCLASS_WORD, tgt, '$I10')
+    ops.'push_pirop'('unless', '$I11', fail)
+    goto done
+
+  done:
+    .return (ops)
+.end
+
+
+=item charclass(PAST::Regex node)
+
+Match something in a character class, such as \w, \d, \s, dot, etc.
+
+=cut
+
+.sub 'charclass' :method
+    .param pmc node
+
+    .local string subtype
+    .local int cclass, negate
+    (subtype, cclass, negate) = self.'!charclass_init'(node)
+
+    .local pmc cur, tgt, pos, off, eos, fail, ops
+    (cur, tgt, pos, off, eos, fail) = self.'!rxregs'('cur tgt pos off eos fail')
+    ops = self.'post_new'('Ops', 'node'=>node, 'result'=>cur)
+
+    ops.'push_pirop'('inline', subtype, 'inline'=>'  # rx charclass %0')
+    ops.'push_pirop'('ge', pos, eos, fail)
+    if cclass == .CCLASS_ANY goto charclass_done
+
+    .local pmc cctest
+    cctest = self.'??!!'(negate, 'if', 'unless')
+
+    ops.'push_pirop'('sub', '$I10', pos, off)
+    ops.'push_pirop'('is_cclass', '$I11', cclass, tgt, '$I10')
+    ops.'push_pirop'(cctest, '$I11', fail)
+    unless subtype == 'nl' goto charclass_done
+    # handle logical newline here
+    ops.'push_pirop'('substr', '$S10', tgt, '$I10', 2)
+    ops.'push_pirop'('iseq', '$I11', '$S10', '"\r\n"')
+    ops.'push_pirop'('add', pos, '$I11')
+
+  charclass_done:
+    ops.'push_pirop'('inc', pos)
+
+    .return (ops)
+.end
+
+
+=item !charclass_init(PAST::Regex node)
+
+Return the subtype, cclass value, and negation for a
+charclass C<node>.
+
+=cut
+
+.sub '!charclass_init' :method
+    .param pmc node
+
+    .local string subtype
+    .local int negate
+    subtype = node.'subtype'()
+    $S0 = downcase subtype
+    negate = isne subtype, $S0
+
+    $I0 = node.'negate'()
+    negate = xor negate, $I0
+
+    if $S0 == '.' goto cclass_dot
+    if $S0 == 'd' goto cclass_digit
+    if $S0 == 's' goto cclass_space
+    if $S0 == 'w' goto cclass_word
+    if $S0 == 'n' goto cclass_newline
+    if $S0 == 'nl' goto cclass_newline
+    self.'panic'('Unrecognized subtype "', subtype, '" in PAST::Regex charclass node')
+  cclass_dot:
+    .local int cclass
+    cclass = .CCLASS_ANY
+    goto cclass_done
+  cclass_digit:
+    cclass = .CCLASS_NUMERIC
+    goto cclass_done
+  cclass_space:
+    cclass = .CCLASS_WHITESPACE
+    goto cclass_done
+  cclass_word:
+    cclass = .CCLASS_WORD
+    goto cclass_done
+  cclass_newline:
+    cclass = .CCLASS_NEWLINE
+  cclass_done:
+    .return (subtype, cclass, negate)
+.end
+
+
+=item charclass_q(PAST::Regex node)
+
+Optimize certain quantified character class shortcuts, if it
+makes sense to do so.  If not, return a null PMC and the
+standard quantifier code will handle it.
+
+=cut
+
+.sub 'charclass_q' :method :multi(_, ['PAST';'Regex'])
+    .param pmc node
+    .param string backtrack
+    .param int min
+    .param int max
+
+    if backtrack != 'r' goto pessimistic
+
+    .local string subtype
+    .local int cclass, negate
+    (subtype, cclass, negate) = self.'!charclass_init'(node)
+
+    # positive logical newline matching is special, don't try to optimize it
+    if negate goto nl_done
+    if subtype == 'nl' goto pessimistic
+  nl_done:
+
+    .local pmc findop
+    findop = self.'??!!'(negate, 'find_cclass', 'find_not_cclass')
+
+  quant_r:
+    .local pmc cur, tgt, pos, off, eos, fail, ops
+    (cur, tgt, pos, off, eos, fail) = self.'!rxregs'('cur tgt pos off eos fail')
+    ops = self.'post_new'('Ops', 'node'=>node, 'result'=>cur)
+
+    ops.'push_pirop'('inline', subtype, backtrack, min, max, 'inline'=>'  # rx charclass_q %0 %1 %2..%3')
+    ops.'push_pirop'('sub', '$I10', pos, off)
+    ops.'push_pirop'(findop, '$I11', cclass, tgt, '$I10', eos)
+    unless min > 0 goto min_done
+    ops.'push_pirop'('add', '$I12', '$I10', min)
+    ops.'push_pirop'('lt', '$I11', '$I12', fail)
+  min_done:
+    unless max > 0 goto max_done
+    .local pmc maxlabel
+    maxlabel = self.'post_new'('Label', 'name'=>'rx_charclass_')
+    ops.'push_pirop'('add', '$I12', '$I10', max)
+    ops.'push_pirop'('le', '$I11', '$I12', maxlabel)
+    ops.'push_pirop'('set', '$I11', '$I12')
+    ops.'push'(maxlabel)
+  max_done:
+    ops.'push_pirop'('add', pos, off, '$I11')
+    .return (ops)
+
+  pessimistic:
+    null ops
+    .return (ops)
+.end
+
+
+=item concat(PAST::Regex node)
+
+Handle a concatenation of regexes.
+
+=cut
+
+.sub 'concat' :method :multi(_, ['PAST';'Regex'])
+    .param pmc node
+
+    .local pmc cur, ops, iter
+    (cur) = self.'!rxregs'('cur')
+    ops = self.'post_new'('Ops', 'node'=>node, 'result'=>cur)
+    iter = node.'iterator'()
+
+  iter_loop:
+    unless iter goto iter_done
+    .local pmc cpast, cpost
+    cpast = shift iter
+    cpost = self.'post_regex'(cpast, cur)
+    ops.'push'(cpost)
+    goto iter_loop
+  iter_done:
+
+    .return (ops)
+.end
+
+
+=item cut(PAST::Regex node)
+
+Generate POST for the cut-group and cut-rule operators.
+
+=cut
+
+.sub 'cut' :method :multi(_, ['PAST';'Regex'])
+    .param pmc node
+
+    .local pmc cur, fail, ops
+    (cur, fail) = self.'!rxregs'('cur fail')
+    ops = self.'post_new'('Ops', 'node'=>node, 'result'=>cur)
+    ops.'push_pirop'('set_addr', '$I10', fail)
+    self.'!cursorop'(ops, '!mark_commit', 0, '$I10')
+    .return (ops)
+.end
+
+
+=item enumcharlist(PAST::Regex node)
+
+Generate POST for matching a character from an enumerated
+character list.
+
+=cut
+
+.sub 'enumcharlist' :method :multi(_, ['PAST';'Regex'])
+    .param pmc node
+
+    .local pmc cur, tgt, pos, off, eos, fail, ops
+    (cur, tgt, pos, off, eos, fail) = self.'!rxregs'('cur tgt pos off eos fail')
+    ops = self.'post_new'('Ops', 'node'=>node, 'result'=>cur)
+
+    .local string charlist
+    charlist = node[0]
+    charlist = self.'escape'(charlist)
+    .local pmc  negate, testop
+    negate = node.'negate'()
+    testop = self.'??!!'(negate, 'ge', 'lt')
+    .local string subtype
+    .local int zerowidth
+    subtype = node.'subtype'()
+    zerowidth = iseq subtype, 'zerowidth'
+
+    ops.'push_pirop'('inline', negate, subtype, 'inline'=>'  # rx enumcharlist negate=%0 %1')
+
+    ops.'push_pirop'('ge', pos, eos, fail)
+    ops.'push_pirop'('sub', '$I10', pos, off)
+    ops.'push_pirop'('substr', '$S10', tgt, '$I10', 1)
+    ops.'push_pirop'('index', '$I11', charlist, '$S10')
+    ops.'push_pirop'(testop, '$I11', 0, fail)
+    if zerowidth goto skip_zero_2
+    ops.'push_pirop'('inc', pos)
+  skip_zero_2:
+    .return (ops)
+.end
+
+
+=item literal(PAST::Regex node)
+
+Generate POST for matching a literal string provided as the
+second child of this node.
+
+=cut
+
+.sub 'literal' :method :multi(_,['PAST';'Regex'])
+    .param pmc node
+
+    .local pmc cur, pos, eos, tgt, fail, off
+    (cur, pos, eos, tgt, fail, off) = self.'!rxregs'('cur pos eos tgt fail off')
+    .local pmc ops, lpast, lpost
+    ops = self.'post_new'('Ops', 'node'=>node, 'result'=>cur)
+
+    .local string subtype
+    .local int ignorecase
+    subtype = node.'subtype'()
+    ignorecase = iseq subtype, 'ignorecase'
+
+    # literal to be matched is our first child
+    .local int litconst
+    lpast = node[0]
+    litconst = isa lpast, ['String']
+    if litconst goto lpast_string
+    litconst = isa lpast, ['PAST';'Val']
+    if litconst goto lpast_val
+  lpast_expr:
+    lpost = self.'as_post'(lpast, 'rtype'=>'~')
+    unless ignorecase goto lpast_done
+    $S0 = lpost.'result'()
+    lpost.'push_pirop'('downcase', $S0, $S0)
+    goto lpast_done
+  lpast_val:
+    $S0 = lpast.'value'()
+    lpast = box $S0
+  lpast_string:
+    unless ignorecase goto lpast_const
+    $S0 = lpast
+    $S0 = downcase $S0
+    lpast = box $S0
+  lpast_const:
+    unless lpast > '' goto done
+    lpost = self.'as_post'(lpast, 'rtype'=>'~')
+  lpast_done:
+
+    $S0 = lpost.'result'()
+    ops.'push_pirop'('inline', subtype, $S0, 'inline'=>'  # rx literal %0 %1')
+    ops.'push'(lpost)
+
+    .local int litlen
+    if litconst goto litlen_const
+    litlen = '$I10'
+    ops.'push_pirop'('length', '$I10', lpost)
+    goto have_litlen
+  litlen_const:
+    $S0 = lpast
+    $I0 = length $S0
+    litlen = $I0
+  have_litlen:
+
+    # fail if there aren't enough characters left in string
+    ops.'push_pirop'('add', '$I11', pos, litlen)
+    ops.'push_pirop'('gt', '$I11', eos, fail)
+
+    # compute string to be matched and fail if mismatch
+    ops.'push_pirop'('sub', '$I11', pos, off)
+    ops.'push_pirop'('substr', '$S10', tgt, '$I11', litlen)
+    unless ignorecase goto literal_test
+    ops.'push_pirop'('downcase', '$S10', '$S10')
+  literal_test:
+    ops.'push_pirop'('ne', '$S10', lpost, fail)
+
+    # increase position by literal length and move on
+    ops.'push_pirop'('add', pos, litlen)
+  done:
+    .return (ops)
+.end
+
+
+=item 'pastnode'(PAST::Regex node)
+
+=cut
+
+.sub 'pastnode' :method :multi(_, ['PAST';'Regex'])
+    .param pmc node
+    .local pmc cur, pos, fail, ops
+    (cur, pos, fail) = self.'!rxregs'('cur pos fail')
+    ops = self.'post_new'('Ops', 'node'=>node, 'result'=>cur)
+
+    .local pmc cpast, cpost
+    cpast = node[0]
+    cpost = self.'as_post'(cpast, 'rtype'=>'P')
+
+    self.'!cursorop'(ops, '!cursor_pos', 0, pos)
+    ops.'push'(cpost)
+
+    .local pmc subtype, negate, testop
+    subtype = node.'subtype'()
+    if subtype != 'zerowidth' goto done
+    negate = node.'negate'()
+    testop = self.'??!!'(negate, 'if', 'unless')
+    ops.'push_pirop'(testop, cpost, fail)
+  done:
+    .return (ops)
+.end
+
+
+=item pass(PAST::Regex node)
+
+=cut
+
+.sub 'pass' :method :multi(_,['PAST';'Regex'])
+    .param pmc node
+
+    .local pmc cur, pos, ops
+    (cur, pos) = self.'!rxregs'('cur pos')
+    ops = self.'post_new'('Ops', 'node'=>node, 'result'=>cur)
+
+    .local string regexname
+    $P0 = find_dynamic_lex '$*REGEXNAME'
+    regexname = self.'escape'($P0)
+
+    ops.'push_pirop'('inline', 'inline'=>'  # rx pass')
+    self.'!cursorop'(ops, '!cursor_pass', 0, pos, regexname)
+    self.'!cursorop'(ops, '!cursor_debug', 0, '"PASS  "', regexname, '" at pos="', pos)
+    ops.'push_pirop'('return', cur)
+    .return (ops)
+.end
+
+
+=item reduce
+
+=cut
+
+.sub 'reduce' :method :multi(_,['PAST';'Regex'])
+    .param pmc node
+
+    .local pmc cur, pos, ops
+    (cur, pos) = self.'!rxregs'('cur pos')
+    ops = self.'post_new'('Ops', 'node'=>node, 'result'=>cur)
+
+    .local pmc cpost, posargs, namedargs
+    (cpost, posargs, namedargs) = self.'post_children'(node, 'signature'=>'v:')
+
+    .local string regexname, key
+    $P0 = find_dynamic_lex '$*REGEXNAME'
+    regexname = self.'escape'($P0)
+    key = posargs[0]
+
+    ops.'push_pirop'('inline', regexname, key, 'inline'=>'  # rx reduce name=%0 key=%1')
+    ops.'push'(cpost)
+    self.'!cursorop'(ops, '!cursor_pos', 0, pos)
+    self.'!cursorop'(ops, '!reduce', 0, regexname, posargs :flat, namedargs :flat)
+    .return (ops)
+.end
+
+
+=item quant(PAST::Regex node)
+
+=cut
+
+.sub 'quant' :method :multi(_,['PAST';'Regex'])
+    .param pmc node
+
+    .local string backtrack
+    backtrack = node.'backtrack'()
+    if backtrack goto have_backtrack
+    backtrack = 'g'
+  have_backtrack:
+
+     .local int min, max
+     min = node.'min'()
+     $P0 = node.'max'()
+     max = $P0
+     $I0 = defined $P0
+     if $I0 goto have_max
+     max = -1                          # -1 represents Inf
+   have_max:
+
+   optimize:
+     $I0 = node.'list'()
+     if $I0 != 1 goto optimize_done
+     .local pmc cpast
+     cpast = node[0]
+     $S0 = cpast.'pasttype'()
+     $S0 = concat $S0, '_q'
+     $I0 = can self, $S0
+     unless $I0 goto optimize_done
+     $P0 = self.$S0(cpast, backtrack, min, max)
+     if null $P0 goto optimize_done
+     .return ($P0)
+  optimize_done:
+
+    .local pmc cur, pos, rep, fail
+    (cur, pos, rep, fail) = self.'!rxregs'('cur pos rep fail')
+
+    .local string qname
+    .local pmc ops, q1label, q2label, btreg, cpost
+    $S0 = concat 'rxquant', backtrack
+    qname = self.'unique'($S0)
+    ops = self.'post_new'('Ops', 'node'=>node)
+    $S0 = concat qname, '_loop'
+    q1label = self.'post_new'('Label', 'result'=>$S0)
+    $S0 = concat qname, '_done'
+    q2label = self.'post_new'('Label', 'result'=>$S0)
+    cpost = self.'concat'(node)
+
+    .local pmc seppast, seppost
+    null seppost
+    seppast = node.'sep'()
+    unless seppast goto have_seppost
+    seppost = self.'post_regex'(seppast)
+  have_seppost:
+
+    $S0 = max
+    .local int needrep
+    $I0 = isgt min, 1
+    $I1 = isgt max, 1
+    needrep = or $I0, $I1
+
+    unless max < 0 goto have_s0
+    $S0 = '*'
+  have_s0:
+    ops.'push_pirop'('inline', qname, min, $S0, 'inline'=>'  # rx %0 ** %1..%2')
+
+  if backtrack == 'f' goto frugal
+
+  greedy:
+    btreg = self.'uniquereg'('I')
+    ops.'push_pirop'('set_addr', btreg, q2label)
+    .local int needmark
+    .local string peekcut
+    needmark = needrep
+    peekcut = '!mark_peek'
+    if backtrack != 'r' goto greedy_1
+    needmark = 1
+    peekcut = '!mark_commit'
+  greedy_1:
+    if min == 0 goto greedy_2
+    unless needmark goto greedy_loop
+    self.'!cursorop'(ops, '!mark_push', 0, 0, CURSOR_FAIL, btreg)
+    goto greedy_loop
+  greedy_2:
+    self.'!cursorop'(ops, '!mark_push', 0, 0, pos, btreg)
+  greedy_loop:
+    ops.'push'(q1label)
+    ops.'push'(cpost)
+    unless needmark goto greedy_3
+    self.'!cursorop'(ops, peekcut, 1, rep, btreg)
+    unless needrep goto greedy_3
+    ops.'push_pirop'('inc', rep)
+  greedy_3:
+    unless max > 1 goto greedy_4
+    ops.'push_pirop'('ge', rep, max, q2label)
+  greedy_4:
+    unless max != 1 goto greedy_5
+    self.'!cursorop'(ops, '!mark_push', 0, rep, pos, btreg)
+    if null seppost goto greedy_4a
+    ops.'push'(seppost)
+  greedy_4a:
+    ops.'push_pirop'('goto', q1label)
+  greedy_5:
+    ops.'push'(q2label)
+    unless min > 1 goto greedy_6
+    ops.'push_pirop'('lt', rep, min, fail)
+  greedy_6:
+    .return (ops)
+
+  frugal:
+    .local pmc ireg
+    ireg = self.'uniquereg'('I')
+    if min == 0 goto frugal_1
+    unless needrep goto frugal_0
+    ops.'push_pirop'('set', rep, 0)
+  frugal_0:
+    if null seppost goto frugal_2
+    .local pmc seplabel
+    $S0 = concat qname, '_sep'
+    seplabel = self.'post_new'('Label', 'result'=>$S0)
+    ops.'push_pirop'('goto', seplabel)
+    goto frugal_2
+  frugal_1:
+    ops.'push_pirop'('set_addr', '$I10', q1label)
+    self.'!cursorop'(ops, '!mark_push', 0, 0, pos, '$I10')
+    ops.'push_pirop'('goto', q2label)
+  frugal_2:
+    ops.'push'(q1label)
+    if null seppost goto frugal_2a
+    ops.'push'(seppost)
+    ops.'push'(seplabel)
+  frugal_2a:
+    unless needrep goto frugal_3
+    ops.'push_pirop'('set', ireg, rep)
+  frugal_3:
+    ops.'push'(cpost)
+    unless needrep goto frugal_4
+    ops.'push_pirop'('add', rep, ireg, 1)
+  frugal_4:
+    unless min > 1 goto frugal_5
+    ops.'push_pirop'('lt', rep, min, q1label)
+  frugal_5:
+    unless max > 1 goto frugal_6
+    ops.'push_pirop'('ge', rep, max, q2label)
+  frugal_6:
+    unless max != 1 goto frugal_7
+    ops.'push_pirop'('set_addr', '$I10', q1label)
+    self.'!cursorop'(ops, '!mark_push', 0, ireg, pos, '$I10')
+  frugal_7:
+    ops.'push'(q2label)
+    .return (ops)
+.end
+
+
+=item scan(POST::Regex)
+
+Code for initial regex scan.
+
+=cut
+
+.sub 'scan' :method :multi(_, ['PAST';'Regex'])
+    .param pmc node
+
+    .local pmc cur, pos, eos, ops
+    (cur, pos, eos) = self.'!rxregs'('cur pos eos')
+    ops = self.'post_new'('Ops', 'node'=>node, 'result'=>cur)
+    .local pmc looplabel, scanlabel, donelabel
+    $S0 = self.'unique'('rxscan')
+    $S1 = concat $S0, '_loop'
+    looplabel = self.'post_new'('Label', 'result'=>$S1)
+    $S1 = concat $S0, '_scan'
+    scanlabel = self.'post_new'('Label', 'result'=>$S1)
+    $S1 = concat $S0, '_done'
+    donelabel = self.'post_new'('Label', 'result'=>$S1)
+
+    ops.'push_pirop'('callmethod', "'from'", 'self', 'result'=>'$I10')
+    ops.'push_pirop'('ne', '$I10', CURSOR_FAIL, donelabel)
+    ops.'push_pirop'('goto', scanlabel)
+    ops.'push'(looplabel)
+    self.'!cursorop'(ops, 'from', 1, '$P10')
+    ops.'push_pirop'('inc', '$P10')
+    ops.'push_pirop'('set', pos, '$P10')
+    ops.'push_pirop'('ge', pos, eos, donelabel)
+    ops.'push'(scanlabel)
+    ops.'push_pirop'('set_addr', '$I10', looplabel)
+    self.'!cursorop'(ops, '!mark_push', 0, 0, pos, '$I10')
+    ops.'push'(donelabel)
+    .return (ops)
+.end
+
+
+=item subcapture(PAST::Regex node)
+
+Perform a subcapture (capture of a portion of a regex).
+
+=cut
+
+.sub 'subcapture' :method :multi(_, ['PAST';'Regex'])
+    .param pmc node
+
+    .local pmc cur, pos, tgt, fail
+    (cur, pos, tgt, fail) = self.'!rxregs'('cur pos tgt fail')
+    .local pmc ops, cpast, cpost
+    ops = self.'post_new'('Ops', 'node'=>node, 'result'=>cur)
+    cpast = node[0]
+    cpost = self.'post_regex'(cpast)
+
+    .local pmc name
+    $P0 = node.'name'()
+    name = self.'as_post'($P0, 'rtype'=>'*')
+
+    .local string rxname
+    rxname = self.'unique'('rxcap_')
+
+    .local pmc caplabel, donelabel
+    $S0 = concat rxname, '_fail'
+    caplabel = self.'post_new'('Label', 'result'=>$S0)
+    $S0 = concat rxname, '_done'
+    donelabel = self.'post_new'('Label', 'result'=>$S0)
+
+    ops.'push_pirop'('inline', name, 'inline'=>'  # rx subcapture %0')
+    ops.'push_pirop'('set_addr', '$I10', caplabel)
+    self.'!cursorop'(ops, '!mark_push', 0, 0, pos, '$I10')
+    ops.'push'(cpost)
+    ops.'push_pirop'('set_addr', '$I10', caplabel)
+    self.'!cursorop'(ops, '!mark_peek', 2, '$I12', '$I11', '$I10')
+    self.'!cursorop'(ops, '!cursor_pos', 0, '$I11')
+    self.'!cursorop'(ops, '!cursor_start', 1, '$P10')
+    ops.'push_pirop'('callmethod', '"!cursor_pass"', '$P10', pos, '""')
+    ops.'push'(name)
+    self.'!cursorop'(ops, '!mark_push', 0, 0, CURSOR_FAIL, 0, '$P10')
+    ops.'push_pirop'('callmethod', '"!cursor_names"', '$P10', name)
+    ops.'push_pirop'('goto', donelabel)
+    ops.'push'(caplabel)
+    ops.'push_pirop'('goto', fail)
+    ops.'push'(donelabel)
+    .return (ops)
+.end
+
+
+=item subrule(PAST::Regex node)
+
+Perform a subrule call.
+
+=cut
+
+.sub 'subrule' :method :multi(_, ['PAST';'Regex'])
+    .param pmc node
+
+    .local pmc cur, pos, fail, ops
+    (cur, pos, fail) = self.'!rxregs'('cur pos fail')
+    ops = self.'post_new'('Ops', 'node'=>node, 'result'=>cur)
+
+    .local pmc name
+    $P0 = node.'name'()
+    name = self.'as_post'($P0, 'rtype'=>'*')
+
+    .local pmc cpost, posargs, namedargs, subpost
+    (cpost, posargs, namedargs) = self.'post_children'(node, 'signature'=>'v:')
+    subpost = shift posargs
+
+    .local pmc negate
+    .local string testop
+    negate = node.'negate'()
+    testop = self.'??!!'(negate, 'if', 'unless')
+
+    .local pmc subtype
+    subtype = node.'subtype'()
+
+    ops.'push_pirop'('inline', subpost, subtype, negate, 'inline'=>"  # rx subrule %0 subtype=%1 negate=%2")
+
+    self.'!cursorop'(ops, '!cursor_pos', 0, pos)
+    ops.'push'(cpost)
+    ops.'push_pirop'('callmethod', subpost, cur, posargs :flat, namedargs :flat, 'result'=>'$P10')
+    ops.'push_pirop'(testop, '$P10', fail)
+    if subtype == 'zerowidth' goto done
+    if subtype == 'method' goto subrule_pos
+    self.'!cursorop'(ops, '!mark_push', 0, 0, CURSOR_FAIL, 0, '$P10')
+    ops.'push'(name)
+    ops.'push_pirop'('callmethod', '"!cursor_names"', '$P10', name)
+  subrule_pos:
+    ops.'push_pirop'('callmethod', '"pos"', '$P10', 'result'=>pos)
+  done:
+    .return (ops)
+.end
+
+
+=item post_new(type, args :slurpy, options :slurpy :named)
+
+Helper method to create a new POST node of C<type>.
+
+=cut
+
+.sub 'post_new' :method
+    .param string type
+    .param pmc args            :slurpy
+    .param pmc options         :slurpy :named
+
+    $P0 = get_hll_global ['POST'], type
+    .tailcall $P0.'new'(args :flat, options :flat :named)
+.end
+
+=item ??!!(test, trueval, falseval)
+
+Helper method to perform ternary operation -- returns C<trueval>
+if C<test> is true, C<falseval> otherwise.
+
+=cut
+
+.sub '??!!' :method
+    .param pmc test
+    .param pmc trueval
+    .param pmc falseval
+
+    if test goto true
+    .return (falseval)
+  true:
+    .return (trueval)
+.end
+
+
+=back
+
+=head1 AUTHOR
+
+Patrick Michaud <pmichaud at pobox.com> is the author and maintainer.
+
+=head1 COPYRIGHT
+
+Copyright (C) 2009, The Perl Foundation.
+
+=cut
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
+
+
+=head1 AUTHOR
+
+Patrick Michaud <pmichaud at pobox.com> is the author and maintainer.
+
+=head1 COPYRIGHT
+
+Copyright (C) 2009, The Perl Foundation.
+
+=cut
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/01-literals.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/01-literals.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,20 @@
+#! nqp
+
+# check literals
+
+say('1..8');
+
+print("ok ");
+print(1);
+print("\n");
+
+print('ok ');
+say(2);
+
+print("ok 3\n");
+say('ok 4');
+say("ok 5");
+say(q<ok 6>);
+say(q  <ok 7>);
+
+say("\x6f\x6b 8");

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/02-if.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/02-if.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,25 @@
+#! nqp
+
+# check control structure 'if'
+
+say('1..6');
+
+if 1 { say("ok 1 # on one line"); }
+
+say("ok 2 # statements following if are okay");
+
+if 1 {
+    say("ok 3 # multi-line if");
+}
+
+if 0 {
+    print("not ");
+}
+
+say("ok 4 # multi-line if, false condition causes block not to execute");
+
+say("ok 5 # postfix statement modifier form (true)") if 1;
+
+print("not ") if 0;
+
+say("ok 6 # postfix statement modifier form (false)");

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/03-if-else.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/03-if-else.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,132 @@
+#! nqp
+
+# check control structure 'if ... else'
+
+say('1..14');
+
+if 1 { say("ok 1 # on one line with else"); } else { say("not ok 1 # on one line with else")}
+
+say("ok 2 # statements following if with else are okay");
+
+if 1 {
+    print("ok 3");
+}
+else {
+    print("not ok 3");
+}
+say(" # multi-line if with else");
+
+if 0 {
+    print("not ok 4");
+}
+else {
+    print("ok 4");
+}
+say(" # multi-line if, else branch");
+
+if 0 {
+}
+else {
+    print("ok 5");
+}
+say(" # empty if-block");
+
+if 0 {
+    print("not ok 6");
+}
+else {
+}
+print("ok 6");
+say(" # empty else-block");
+
+if 0 {
+}
+else {
+}
+print("ok 7");
+say(" # empty if- and else-block");
+
+if 0 {
+}
+elsif 0 {
+}
+elsif 0 {
+}
+else {
+}
+print("ok 8");
+say(" # empty if-, elsif-, and else-block");
+
+if 1 {
+    print("ok 9");
+}
+elsif 0 {
+    print("not ok 9 # elsif 1");
+}
+elsif 0 {
+    print("not ok 9 # elsif 2");
+}
+else {
+    print("not ok 9 # else");
+}
+say(" # if expr true in if/elsif/elsif/else");
+
+if 0 {
+    print("not ok 10 # if");
+}
+elsif 1 {
+    print("ok 10");
+}
+elsif 0 {
+    print("not ok 10 # elsif 2");
+}
+else {
+    print("not ok 10 # else");
+}
+say(" # first elsif expr true in if/elsif/elsif/else");
+
+if 0 {
+    print("not ok 11 # if");
+}
+elsif 0 {
+    print("not ok 11 # elsif 1");
+}
+elsif 1 {
+    print("ok 11");
+}
+else {
+    print("not ok 11 # else");
+}
+say(" # second elsif expr true in if/elsif/elsif/else");
+
+if 0 {
+    print("not ok 12 # if");
+}
+elsif 1 {
+    print("ok 12");
+}
+elsif 1 {
+    print("not ok 12 # elsif 2");
+}
+else {
+    print("not ok 12 # else");
+}
+say(" # first and second elsif expr true in if/elsif/elsif/else");
+
+if 0 {
+    print("not ok 13 # if");
+}
+elsif 0 {
+    print("not ok 13 # elsif 1");
+}
+elsif 0 {
+    print("not ok 13 # elsif 2");
+}
+else {
+    print("ok 13");
+}
+say(" # else expr true in if/elsif/elsif/else");
+
+if 0 { } elsif 0 { }
+print("ok 14");
+say(" # no else block in if/elsif")

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/04-unless.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/04-unless.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,25 @@
+#! nqp
+
+# check control structure 'unless'
+
+say('1..6');
+
+unless 0 { say("ok 1 # on one line"); }
+
+say("ok 2 # statements following unless are okay");
+
+unless 0 {
+    say("ok 3 # multi-line unless");
+}
+
+unless 1 {
+    print("not ");
+}
+say("ok 4 # testing conditional");
+
+say("ok 5 # postfix statement modifier form (false)") unless 0;
+
+print("not ") unless 1;
+
+say("ok 6 # postfix statement modifier form (true)");
+

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/05-comments.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/05-comments.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,13 @@
+#! nqp
+
+# check comments
+
+say('1..2');
+
+#Comment preceding
+say("ok 1");
+
+say("ok 2"); #Comment following
+
+#say("not ok 3");
+#          say("not ok 4");

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/06-args-pos.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/06-args-pos.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,9 @@
+#!./parrot nqp.pbc
+
+# positional arguments
+
+say('1..2');
+
+say("ok ", 1);
+
+print('o', 'k', ' ', 2, "\n");

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/07-boolean.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/07-boolean.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,27 @@
+#!./parrot nqp.pbc
+
+# Testing boolean context operators, ! and ?
+
+plan(8);
+
+##Negation
+ok(!0,   'prefix negation on integer 0');
+ok(!"0", 'prefix negation on string 0');
+
+if !1 {
+    print("not");
+}
+ok(1, "negating integer 1");
+
+ok(!!1, 'double negation on 1');
+
+##Boolean context
+ok(?1,    'prefix negation on integer 1');
+ok(?"10", 'prefix negation on string 10');
+
+if ?0 {
+    print("not");
+}
+ok(1, "boolean integer 0");
+
+ok(!?!?1, 'spaghetti chaining');

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/08-blocks.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/08-blocks.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,33 @@
+#! nqp
+
+# check blocks and statement enders
+
+say('1..7');
+
+{
+    say("ok 1 # blocks are okay");
+}
+
+{
+    print("ok ");
+    say("2 # last statement in a block does not need a semi-colon")
+}
+
+
+{
+    say("ok 3 # statements can precede blocks");
+    {
+        say("ok 4 # blocks can nest");
+    }
+    say("ok 5 # statements can follow blocks");
+}
+
+
+{ print("ok ") }; { say("6 # multiple blocks on one line need a semi-colon") }
+
+{
+    print("ok ")
+}; {
+    say("7 # blocks following an end brace must be separated by a semicolon")
+}
+

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/09-var.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/09-var.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,76 @@
+#!./parrot nqp.pbc
+
+# check variables
+
+say('1..13');
+
+my $o1 := 'ok 1'; print($o1); say(" # direct binding and scoping");
+
+my $o2; $o2 := 'ok 2'; print($o2); say(" # first scope and declare, then bind");
+
+my $o3 := 'ok 3';
+my $p3 := $o3;
+print($p3); say(" # bind to another variable");
+
+my $o4 := 'ok 4';
+my $p4 := $o4;
+$o4 := 'not ok 4';
+print($p4); say(" # rebind the original, the bound one does not change");
+
+my $r1 := 'not ok 5';
+my $r2 := 'ok 5';
+my $r3;
+$r3 := $r1;
+$r3 := $r2;
+print($r3); say(' # variables can be rebound');
+
+my $b1 := 'ok 7';
+
+{
+    my $b1 := 'ok 6';
+    print($b1); say(' # my scoping works inside a block');
+}
+
+print($b1); say(' # block does not stomp on out scope');
+
+my $b2 := 'ok 8';
+
+{
+    print($b2); say(' # variables scoped outside of block persists inside the block');
+}
+
+my $b3;
+{
+    my $b4 := 'ok 9';
+    $b3 := $b4;
+}
+print($b3); say(' # variable is bound to the value, not the symbol in the block');
+
+my $b5 := '';
+{
+    my $b5 := 'not ';
+}
+print($b5);say('ok 10 # $b5, defined inside block, does not exist outside');
+
+{
+    our $m1 := 'ok 11 ';
+}
+
+our $m1;
+unless $m1 {
+    print('not ');
+}
+say('ok 11 # our variables have package scope, exists outside of block');
+
+our $m2;
+$m2 := 'ok 12';
+{
+    print($m2); say(' # our variables exist inside blocks');
+}
+
+our $m3;
+$m3 := 'not ok 13';
+{
+    $m3 := 'ok 13';
+}
+print($m3); say(' # our variables written inside block keep their values outside');

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/10-cmp.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/10-cmp.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,98 @@
+#! nqp
+
+# check comparisons
+
+say('1..19');
+
+##Integers, positive and negative
+
+if 1 == 1 { say("ok 1 # numeric equality, integers"); }
+
+unless 1 == 2 {
+    say("ok 2 # numeric equality, integers, not equal");
+}
+
+if -3 == -3 { say("ok 3 # numeric equality, negative integers"); }
+
+if 1 != 2 { say("ok 4 # numeric inequality, integers"); }
+
+unless 1 != 1 {
+    say("ok 5 # numeric inequality, equal, integers");
+}
+
+unless -2 != -2 {
+    say("ok 6 # numeric inequality, equal, negative integers");
+}
+
+##Strings
+
+if "eq" eq "eq" { say("ok 7 # string equality"); }
+
+unless "one" eq "two" {
+    say("ok 8 # string equality, not equal");
+}
+
+if "ONE" ne "TWO" { say("ok 9 # string inequality"); }
+
+unless "STRING" ne "STRING" {
+    say("ok 10 # string inequality, equal");
+}
+
+##Coerce strings into integers
+
+if "11" ne ~11 {
+    print("not ");
+}
+say("ok 11 # coerce integer 11 into string eleven");
+
+if "-12" ne ~-12 {
+    print("not ");
+}
+say("ok 12 # coerce integer -12 into string twelve");
+
+##Coerce integers into strings
+
+if 13 ne +"13" {
+    print("not ");
+}
+say("ok 13 # coerce string 13 into an integer");
+
+if -14 ne +"-14" {
+    print("not ");
+}
+say("ok 14 # coerce string -14 into an integer");
+
+##Containers
+
+if (1,2) =:= (1,2) {
+    print("not ");
+}
+say("ok 15 # container equality, unnamed arrays");
+
+my @a := (1, 2);
+
+unless @a =:= @a {
+    print("not ");
+}
+say("ok 16 # container equality, self");
+
+my @b := @a;
+
+unless @a =:= @b {
+    print("not ");
+}
+say("ok 17 # container equality, named arrays");
+
+my $x := 'foo';
+my $y := $x;
+my $z := 'foo';
+
+unless $x =:= $y {
+    print("not ");
+}
+say("ok 18 # container equality, string binding");
+
+if $x =:= $z {
+    print("not ");
+}
+say("ok 19 # container equality, string value");

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/11-sub.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/11-sub.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,76 @@
+#!./parrot nqp.pbc
+
+# check subs
+
+say('1..11');
+
+sub one ( ) {
+    say("ok 1 # sub def and call");
+}
+
+one();
+
+{
+    sub two ( ) {
+        say("ok 2 # sub def and call inside block");
+    }
+    two();
+}
+
+sub three ( ) { say("ok 3 # sub def; sub call on same line"); }; three();
+
+sub four_five ($arg1) {
+    say($arg1);
+}
+four_five('ok 4 # passed in 1 arg');
+
+{
+    four_five('ok 5 # calling sub in outer scope');
+}
+
+{
+    our sub six ( ) {
+        say("ok 6 # def in inner scope, called from outer scope");
+    }
+}
+six();
+
+sub seven () {
+    "ok 7 # return string literal from sub";
+}
+
+say(seven());
+
+sub eight () {
+    "ok 8 # bind sub return to variable";
+}
+
+my $retVal := eight();
+
+unless $retVal {
+    print("not ");
+}
+say($retVal);
+
+sub add_stomp ($first, $last) {
+    my $sum := $first + $last;
+    $first  := $last - $first;
+    $sum;
+}
+
+print("ok "); print(add_stomp(3,6)); say(" # returning the result of operating on arguments");
+
+my $five  := 5;
+my $seven := 7;
+
+add_stomp($five, $seven);
+
+if $five != 5 {
+    print("not ");
+}
+say("ok 10 # subroutines that operate on args do not affect the original arg outside the sub");
+
+sub eleven ($arg) {
+    say("ok 11 # parameter with a trailing comma");
+}
+eleven( 'dummy', );

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/12-logical.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/12-logical.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,33 @@
+#! nqp
+
+# check '||', '&&', and '//'
+
+plan(7);
+
+my $or_no_branch := 1;
+$or_no_branch || ( $or_no_branch := 0 );
+ok($or_no_branch, "logical || shortcuts, branch not taken");
+
+my $or_branch := 0;
+0 || ( $or_branch := 1 );
+ok($or_branch, "logical || shortcuts, branch taken");
+
+my $and_no_branch := 0;
+$and_no_branch && ( $and_no_branch := 1 );
+ok(!$and_no_branch, "logical && shortcuts, branch not taken");
+
+my $and_branch := 0;
+1 && ( $and_branch := 1 );
+ok($and_branch, "logicl && shortcuts, branch taken");
+
+my $err_no_branch := 1;
+$err_no_branch // ( $err_no_branch := -1 );
+ok($err_no_branch == 1, "logical // shortcuts on true, branch not taken");
+
+$err_no_branch := 0;
+$err_no_branch // ( $err_no_branch := -1 );
+ok($err_no_branch == 0, "logical // shortcuts on defined false, branch not taken");
+
+my $err_branch;
+$err_branch // ( $err_branch := 1 );
+ok($err_branch == 1, "logical // takes branch on undef");

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/13-op.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/13-op.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,48 @@
+#!./parrot nqp.pbc
+
+# checking basic operands and circumfix:( )
+
+plan(29);
+
+##Additive operators
+ok(      1+2  == 3, 'Checking addition 1+2');
+ok(     10-9  == 1, 'Checking subtraction 10-9');
+ok(   10-3+2  == 9, 'Checking compound statements 10-3+2');
+ok(  10-(3+2) == 5, 'Checking parenthesized statement 10-(3+2)');
+
+##Multiplicative operators
+ok(      6*7  == 42, 'Checking multiplication 6*7');
+ok(     36/6  ==  6, 'Checking division 36/6');
+ok(    4*3+5  == 17, 'Checking compound statements 4*3+5');
+ok(   4*(3+5) == 32, 'Checking parenthesized statements 4*(3+5)');
+ok(   12/4*3  ==  9, 'Checking compound statements 12/4*3');
+ok( 12/(4*3)  ==  1, 'Checking compound statements 12/(4*3)');
+ok(   5-3*2   == -1, 'Checking compound statements 5-3*2');
+
+##Modulo operator
+ok(      8%3  == 2, 'Checking modulo 8%3');
+ok(    8%3+2  == 4, 'Checking compound statement 8%3+2');
+ok(  8%(3+2)  == 3, 'Checking compound statement 8%(3+2)');
+
+##Concatenation operator
+ok( 'a' ~ 'b' eq 'ab', 'Checking concatenation "a" ~ "b"');
+ok(  1  ~ 'b' eq '1b', 'Checking concatenation  1  ~ "b"');
+ok( 'a' ~  2  eq 'a2', 'Checking concatenation "a" ~  2 ');
+
+##Postfix operators
+my $x := 0;
+ok( $x++ == 0 );
+ok( $x   == 1 );
+ok( $x-- == 1 );
+ok( $x   == 0 );
+
+##Relational operators
+ok( ?(1 <  2) );
+ok( !(2 <  1) );
+ok( ?(2 <= 2) );
+ok( !(3 <= 2) );
+ok( ?(2 >  1) );
+ok( !(2 >  3) );
+ok( ?(2 >= 1) );
+ok( !(2 >= 3) );
+

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/14-while.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/14-while.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,97 @@
+#!./parrot nqp.pbc
+
+# while, until statements
+
+plan(14);
+
+my $a; my $sum;
+
+$a := 1; $sum := 0;
+while $a != 10 {
+    $sum := $sum + $a;
+    $a := $a + 1;
+}
+ok($sum == 45, 'basic while loop test');
+
+$a := 1; $sum := 0;
+$sum := $sum + $a++ while $a < 10;
+ok($sum == 45, 'basic while statement modifier');
+
+$a := 1; $sum := 0;
+until $a == 10 {
+    $sum := $sum + $a;
+    $a := $a + 1;
+}
+ok($sum == 45, 'basic until loop test');
+
+$a := 1; $sum := 0;
+$sum := $sum + $a++ until $a > 9;
+ok($sum == 45, 'basic until statement modifier');
+
+$a := 1; $sum := 0;
+while $a != 1 {
+    $sum := 99;
+    $a := 1;
+}
+ok($sum == 0, 'while loop exits initial false immediately');
+
+$a := 1; $sum := 0;
+until $a == 1 {
+    $sum := 99;
+    $a := 1;
+}
+ok($sum == 0, 'until loop exits initial true immediately');
+
+$a := 1; $sum := 0;
+repeat {
+    $sum := $sum + $a;
+    $a := $a + 1;
+} while $a != 10;
+ok($sum == 45, 'basic repeat_while loop');
+
+$a := 1; $sum := 0;
+repeat {
+    $sum := $sum + $a;
+    $a := $a + 1;
+} until $a == 10;
+ok($sum == 45, 'basic repeat_until loop');
+
+$a := 1; $sum := 0;
+repeat while $a != 10 {
+    $sum := $sum + $a;
+    $a := $a + 1;
+};
+ok($sum == 45, 'basic repeat_while loop');
+
+$a := 1; $sum := 0;
+repeat until $a == 10 {
+    $sum := $sum + $a;
+    $a := $a + 1;
+};
+ok($sum == 45, 'basic repeat_until loop');
+
+$a := 1; $sum := 0;
+repeat {
+    $sum := 99;
+} while $a != 1;
+ok($sum == 99, 'repeat_while always executes at least once');
+
+$a := 1; $sum := 0;
+repeat {
+    $sum := 99;
+} until $a == 1;
+ok($sum == 99, 'repeat_until always executes at least once');
+
+$a := 1; $sum := 0;
+repeat while $a != 1 {
+    $sum := 99;
+};
+ok($sum == 99, 'repeat_while always executes at least once');
+
+$a := 1; $sum := 0;
+repeat until $a == 1 {
+    $sum := 99;
+};
+ok($sum == 99, 'repeat_until always executes at least once');
+
+

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/15-list.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/15-list.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,12 @@
+#!./parrot nqp.pbc
+
+# lists and for
+
+plan(3);
+
+my $list := (1,2,3);
+my $indexer := 0;
+
+for $list {
+    print("ok "); print($_); say(" checking loop via indices");
+}

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/16-ternary.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/16-ternary.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,23 @@
+#!./parrot nqp.pbc
+
+# the ternary ?? !! operator
+
+plan(8);
+
+ok( 1 ?? 1 !! 0 );
+ok( 0 ?? 0 !! 1 );
+
+my $a := 1 ?? 'yes' !! 'no';
+ok( $a eq 'yes' );
+
+my $b := 0 ?? 'yes' !! 'no';
+ok( $b eq 'no' );
+
+my $c := 1 ?? 'yes' !! ( $a := 'no' );
+ok( $c eq 'yes' );
+ok( $a eq 'yes' );
+
+my $d := 0 ?? ( $a := 'no' ) !! 'yes';
+ok( $d eq 'yes' );
+ok( $a eq 'yes' );
+

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/17-positional.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/17-positional.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,23 @@
+#! nqp
+
+# check positional subscripting
+
+plan(7);
+
+my @l := (1,2,3,4,5);
+
+say("ok 1 # list assignment didn't barf");
+say('ok ', at l[1], ' # numeric subscript');
+say('ok ', @l['2'], ' # string subscript');
+
+my $idx := 3;
+
+say('ok ', @l[$idx], ' # variable subscript');
+say('ok ', @l[$idx + 1], ' # expression in subscript');
+
+ at l[0] := 'ok 6 # string array element';
+say(@l[0]);
+
+ at l[10] := 'ok 7 # automatic expansion';
+say(@l[10]);
+

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/18-associative.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/18-associative.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,27 @@
+#!./parrot nqp.pbc
+
+# check hash access methods
+
+plan(7);
+
+my %h;
+
+%h<a> := 1;
+say("ok 1 # hash assignment with numeric value works");
+
+say('ok ', %h<a> + 1, ' # hash access to numeric value');
+
+%h<a> := 'ok 3';
+say(%h<a>, ' # hash access to string value');
+
+%h{1} := '4';
+say('ok ', %h{1}, ' # numeric hash access');
+
+say('ok ', %h<1> + 1, ' # numbers stringify');
+
+%h{'b'} := 'ok 6 # curly braces and single quotes work';
+say(%h{'b'});
+
+%h{"foo"} := "ok 7 # curly braces and double quotes work";
+say(%h{"foo"});
+

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/19-inline.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/19-inline.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,10 @@
+#!./parrot nqp.pbc
+
+# inline
+
+plan(2);
+
+Q:PIR { say 'ok 1' };
+my $x := Q:PIR { %r = box 'ok 2' };
+say($x);
+

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/20-return.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/20-return.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,23 @@
+#! nqp
+
+# implicit and explicit returns from subs
+
+plan(3);
+
+sub foo() { 1; }
+
+
+sub bar() {
+    return 2;
+    0;
+}
+
+sub baz() {
+    if (1) { return 3; }
+    0;
+}
+
+ok( foo() == 1 , 'last value in block' );
+ok( bar() == 2 , 'explicit return value in block');
+ok( baz() == 3 , 'explicit return from nested block');
+

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/21-contextual.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/21-contextual.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,28 @@
+#! nqp
+
+# Tests for contextual variables
+
+plan(6);
+
+sub foo() { $*VAR }
+
+{
+    my $*VAR := 'abc';
+    ok($*VAR eq 'abc', 'basic contextual declaration works');
+    ok(foo() eq 'abc', 'called subroutine sees caller $*VAR');
+
+    sub bar() { $*VAR }
+
+    ok(bar() eq 'abc', 'called subroutine sees caller $*VAR');
+
+
+
+    {
+        my $*VAR := 'def';
+        ok( $*VAR eq 'def', 'basic nested contextual works');
+        ok( foo() eq 'def', 'called subroutine sees caller $*VAR');
+        ok( bar() eq 'def', 'called subroutine sees caller not outer');
+    }
+}
+
+

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/22-optional-args.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/22-optional-args.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,30 @@
+#! nqp
+
+# test optional arguments and parameters
+
+plan(3);
+
+sub f1 ($x, $y!, $z?) {
+  $x;
+}
+say('ok ', f1(1, 2), ' # optional args ignorable');
+say('ok ', f1(2, 2, 2), ' # optional args passable');
+
+sub f2 ($x?, $y?) { 'ok 3 # only optional args'; }
+say(f2());
+
+# TODO we can't parse .defined() yet - jg
+#sub f3 ($x, $y?, $text?) {
+#  if ! $y.defined() && ! $text.defined() {
+#    say('ok 4 # unpassed optional args are undef');
+#  } else {
+#    say('ok ', $x - $y, $text);
+#  }
+#}
+#f3(2);
+#f3(8, 3, ' # optional args get passed values');
+#f3(8, :text(' # optional args specifiable by name'), :y(2));
+
+# XXX: need to be able to test that the following is illegal
+#sub f4 ($x?, $y) { $y; }
+

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/23-named-args.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/23-named-args.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,20 @@
+#! nqp
+
+# test named parameters and arguments
+
+plan(4);
+
+sub f1 ($x, :$y) { $x - $y; }
+say('ok ', f1(2, :y(1)), ' # named args passable');
+
+sub f2 ($x, :$y) { $x; }
+say('ok ', f2(2), ' # named args ignorable');
+
+sub f3 (:$x, :$y) { $x - $y; }
+say('ok ', f3(:y(2), :x(5)), ' # args reorderable');
+
+sub f4 ($w, $x, :$y, :$z) { $w + $x + $y + $z; }
+say('ok ', f4(:z(2), -3, :y(1), 4), ' # named/positional intermixable');
+
+
+# XXX: test mandatory named args are actually mandatory

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/24-module.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/24-module.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,19 @@
+#! nqp
+
+# check module
+
+plan(3);
+
+XYZ::foo('ok 1');
+XYZ::sayfoo();
+
+module XYZ {
+    our $value := 'ok 2';
+    our sub foo($x) { $value := $x; }
+    our sub sayfoo() { say($value // 'ok 1'); }
+    sayfoo();
+}
+
+XYZ::foo('ok 3');
+XYZ::sayfoo();
+

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/25-class.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/25-class.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,15 @@
+#!./parrot nqp.pbc
+
+# class
+
+plan(1);
+
+class XYZ {
+    method foo($x) {
+        say($x);
+    }
+}
+
+my $xyz := XYZ.new();
+
+$xyz.foo('ok 1');

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/26-methodops.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/26-methodops.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,30 @@
+#! nqp
+
+# method ops (just method calls for now)
+
+plan(3);
+
+class Foo {
+  method blarg() {
+    'ok 1 # method calls work';
+  }
+  method blargless() {
+    'ok 3 # argument-less method calls work'
+  }
+}
+
+class Bar {
+  method blarg() {
+    'not ok 1';
+  }
+}
+
+sub blarg() {
+  'ok 2 # regular subs aren\'t confused with methods';
+}
+
+my $foo := Foo.new();
+
+say($foo.blarg());
+say(blarg());
+say($foo.blargless);

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/27-self.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/27-self.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,28 @@
+#!./parrot nqp.pbc
+
+plan(3);
+
+class Foo {
+    method foo() { 1 };
+
+    method uno() {
+        self.foo();
+    };
+
+    method des() {
+        if 1 {
+            self.foo();
+        }
+    };
+
+    method tres($a) {
+        if 1 {
+            self.foo();
+        }
+    };
+};
+
+ok(Foo.new.uno, "Can access self within method");
+ok(Foo.new.des, "Can access self within sub-block");
+ok(Foo.new.tres(42), "Can access self within method with signature");
+

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/28-subclass.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/28-subclass.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,34 @@
+#! nqp
+
+# class inheritance
+
+plan(6);
+
+class ABC {
+    method foo() {
+        say('ok 1');
+    }
+
+    method bar() {
+        say('ok 3');
+    }
+}
+
+class XYZ is ABC {
+    method foo() {
+        say('ok 2');
+    }
+}
+
+
+my $abc := ABC.new();
+my $xyz := XYZ.new();
+
+$abc.foo();
+$xyz.foo();
+$xyz.bar();
+my $xyzhow := $xyz.HOW;
+if $xyzhow.isa($xyz, ABC) { say('ok 4') }
+if $xyzhow.isa($xyz, XYZ) { say('ok 5') }
+say( $xyzhow.isa($abc, XYZ) ?? 'not ok 6' !! 'ok 6' );
+

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/29-make.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/29-make.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,19 @@
+#! nqp
+
+# Tests for 'make' builtin.
+
+plan(2);
+
+my $/ := Regex::Match.new();
+make 'ok 1';
+say($/.ast);
+
+# check that it finds contextual $/
+our sub foo() {
+    make 'ok 2'
+}
+
+foo();
+say($/.ast);
+
+

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/30-pirop.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/30-pirop.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,11 @@
+#! nqp
+
+# Test PIR::op pseudo-functions.
+
+plan(3);
+
+say( pir::join__SsP('', ('o', 'k', ' ', 1) ) );
+
+say( 'ok ', pir::div(6,3) );
+
+say( 'ok ', pir::chr__Si(51) );

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/31-grammar.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/31-grammar.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,22 @@
+#! nqp
+
+# Test grammars and regexes
+
+plan(3);
+
+grammar ABC {
+    token TOP { ok ' ' <integer> }
+    token integer { \d+ }
+}
+
+my $match := ABC.parse('not ok');
+ok( !$match, 'parse method works on negative match');
+
+$match := ABC.parse('ok 123');
+ok( ?$match, 'parse method works on positive match');
+
+ok( $match<integer> == 123, 'captured $<integer>');
+
+
+
+

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/32-protoregex.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/32-protoregex.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,32 @@
+#! nqp
+
+# test protoregexes in grammars
+
+plan(6);
+
+grammar ABC {
+
+    token TOP { <symbols> .* }
+
+    proto token symbols { <...> }
+
+    token symbols:sym<abc>  { <sym> }
+    token symbols:sym<a>    { <sym> }
+    token symbols:sym<bang> { $<sym>=['!'] }
+    token symbols:sym<===>  { <sym> }
+}
+
+
+my $/ := ABC.parse('abcdef');
+ok( ?$/ ,           'successfully matched grammar' );
+ok( $/ eq 'abcdef', 'successful string match' );
+ok( $<symbols> eq 'abc', 'successful protoregex match');
+ok( $<symbols><sym> eq 'abc', 'correct proto candidate match' );
+
+$/ := ABC.parse('adef');
+ok( ?$/ ,           'successfully matched grammar' );
+
+$/ := ABC.parse('xxx');
+ok( !$/ ,           'successfully failed protoregex match' );
+
+

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/33-init.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/33-init.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,23 @@
+#! nqp
+
+# Test INIT blocks
+
+INIT plan(4);
+
+our $foo;
+
+ok($foo == 2, 'after second INIT block');
+
+INIT {
+    our $foo;
+    ok($foo == 0, 'first INIT');
+    $foo := 1;
+}
+
+$foo := 3;
+
+INIT ok($foo++, 'after first INIT but before mainline');
+
+ok($foo == 3, 'After everything else');
+
+

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/34-rxcodeblock.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/34-rxcodeblock.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,32 @@
+#! nqp
+
+plan(12);
+
+grammar ABC {
+    token TOP { { ok(1, 'basic code assertion'); } }
+}
+ABC.parse('abc');
+
+grammar BCD {
+    token TOP { $<bcd>=[.*] { ok( $<bcd> eq 'bcd', 'match in assertion' ); } }
+}
+BCD.parse('bcd');
+
+grammar CDE {
+    token TOP { \d+ <?{ +$/ < 255}> cde }
+}
+ok( ?CDE.parse('123cde'),  'passes assertion, match after');
+ok( !CDE.parse('1234cde'), 'fails assertion');
+ok( ?CDE.parse('0cde'),    'passes assertion, match after');
+ok( !CDE.parse('1234'),    'fails assertion');
+ok( !CDE.parse('123'),     'fails regex after passing assertion');
+
+grammar DEF {
+    token TOP { \d+ <!{ +$/ < 255 }> def }
+}
+ok( !DEF.parse('123def'),  'fails assertion');
+ok( ?DEF.parse('1234def'), 'passes assertion, text after');
+ok( !DEF.parse('0def'),    'fails assertion');
+ok( !DEF.parse('1234'),    'passes assertion, fails text after');
+ok( ?DEF.parse('999def'),  'passes assertion, text after');
+

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/35-prefix-sigil.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/35-prefix-sigil.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,18 @@
+#!./parrot nqp.pbc
+
+# prefix sigils like @(...) and %(...)
+
+plan(1);
+
+class XYZ {
+    method list() {
+        'ok ', '1';
+    }
+}
+
+my $xyz := XYZ.new();
+
+for @( $xyz ) {
+    print( $_ );
+}
+print( "\n" );

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/36-callable.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/36-callable.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,8 @@
+#!./parrot nqp.pbc
+
+# postcircumfix:<( )>
+
+plan(1);
+
+my $sub := { ok(1, 'works'); }
+$sub();

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/37-slurpy.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/37-slurpy.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,20 @@
+#!./parrot nqp.pbc
+
+# slurpy args
+
+plan(5);
+
+sub slurpy_pos(*@pos) {
+    for @pos {
+        say("ok " ~ $_);
+    }
+}
+
+slurpy_pos(1, 2, 3);
+
+sub slurpy_named(*%named) {
+    say(%named<pivo>);
+    say(%named<slanina>);
+}
+
+slurpy_named(:pivo("ok 4"), :slanina("ok 5"));

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/38-quotes.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/38-quotes.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,19 @@
+#! nqp
+
+# interpolating quotes
+
+plan(4);
+
+my $abc := 'abc';
+
+ok( "xxx$abc" eq 'xxxabc', "basic scalar interpolation" );
+
+ok( qq{xxx $abc zzz} eq 'xxx abc zzz', 'basic qq{} interpolation' );
+
+my $num := 5;
+
+ok( "xxx {3+$num} zzz" eq 'xxx 8 zzz', "basic closure interpolation" );
+
+ok( qq{xxx {3+$num} zzz} eq 'xxx 8 zzz', 'basic qq{} closure interpolation' );
+
+

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/39-pointy.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/39-pointy.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,18 @@
+#! nqp
+
+plan(6);
+
+my $count := 1;
+
+my $x := -> $a, $b { ok($a == $count++, $b); }
+
+$x(1, 'basic pointy block');
+
+my $y := -> $a, $b = 2 { ok($b == $count++, $a); }
+
+$y('pointy block with optional');
+
+$y('pointy block with optional + arg', 3);
+
+for <4 pointy4 5 pointy5 6 pointy6> -> $a, $b { ok($a == $count++, $b); }
+

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/40-lists.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/40-lists.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,46 @@
+#! nqp
+
+plan(18);
+
+my $a;
+$a := (8);
+ok( pir::typeof__SP($a) eq 'Integer', 'basic parens');
+
+$a := (8,9);
+ok( pir::typeof__SP($a) eq 'ResizablePMCArray', 'paren list');
+ok( +$a == 2, 'paren list elems' );
+
+$a := (8,);
+ok( pir::typeof__SP($a) eq 'ResizablePMCArray', 'paren comma');
+ok( +$a == 1, 'paren comma' );
+
+$a := ();
+ok( pir::typeof__SP($a) eq 'ResizablePMCArray', 'empty parens');
+ok( +$a == 0, 'paren list elems' );
+
+$a := [8];
+ok( pir::typeof__SP($a) eq 'ResizablePMCArray', 'brackets of one elem');
+ok( +$a == 1, 'brackets of one elem' );
+
+$a := [7,8,9];
+ok( pir::typeof__SP($a) eq 'ResizablePMCArray', 'brackets of 3 elems');
+ok( +$a == 3, 'brackets of 3 elems' );
+
+$a := [];
+ok( pir::typeof__SP($a) eq 'ResizablePMCArray', 'brackets of 0 elems');
+ok( +$a == 0, 'brackets of 0 elems' );
+
+$a := {};
+ok( pir::typeof__SP($a) eq 'Hash', 'empty braces');
+
+$a := { 1 };
+ok( pir::typeof__SP($a) eq 'Sub', 'non-empty braces');
+
+sub xyz(*@a) {
+    ok( + at a == 1, "brackets as single argument #1" );
+    ok( + at a[0] == 2, "brackets as single argument #2");
+    ok( @a[0][1] == 'b', "brackets as single argument #3");
+}
+
+xyz(['a', 'b']);
+

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/41-flat.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/41-flat.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,15 @@
+#!./parrot nqp.pbc
+
+# flattened arguments
+
+plan(3);
+
+sub xyz($x, $y, $z) {
+    ok( $x == 7, 'first argument');
+    ok( $y == 8, 'second argument');
+    ok( $z == 9, 'third argument');
+}
+
+my @a := [7,8,9];
+xyz(|@a);
+

Added: branches/orderedhash_revamp/ext/nqp-rx/t/nqp/42-cond-loop.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/nqp/42-cond-loop.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,40 @@
+#!./parrot nqp.pbc
+
+# combination of conditional modifier and loop modifier
+
+plan(8);
+
+my $a; my $s;
+
+
+$a := 0; $s := 0;
+$s := 5 if $a > 7 while $a++ < 9;
+ok( $s == 5 && $a == 10, 'true if + while');
+
+$a := 0; $s := 0;
+$s := 5 if $a > 17 while $a++ < 9;
+ok( $s == 0 && $a == 10, 'false if + while');
+
+$a := 0; $s := 0;
+$s := 5 if $a > 7 until $a++ > 9;
+ok( $s == 5 && $a == 11, 'true if + until');
+
+$a := 0; $s := 0;
+$s := 5 if $a > 17 until $a++ > 9;
+ok( $s == 0 && $a == 11, 'false if + until');
+
+$a := 0; $s := 0;
+$s := 5 unless $a > 0 while $a++ < 9;
+ok( $s == 0 && $a == 10, 'true unless + while');
+
+$a := 0; $s := 0;
+$s := 5 unless $a < 0 while $a++ < 9;
+ok( $s == 5 && $a == 10, 'false unless + while');
+
+$a := 0; $s := 0;
+$s := 5 if $a > 0 until $a++ > 9;
+ok( $s == 5 && $a == 11, 'true unless + until');
+
+$a := 0; $s := 0;
+$s := 5 if $a < 0 until $a++ > 9;
+ok( $s == 0 && $a == 11, 'false unless + until');

Added: branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/01-regex.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/01-regex.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,497 @@
+#! parrot
+# Copyright (C) 2001-2008, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/compilers/pge/perl6regex/01-regex.t  -- Basic Perl6Regex tests
+
+=head1 DESCRIPTION
+
+These tests are based on L<http://dev.perl.org/perl6/doc/design/syn/S05.html>.
+Individual tests are stored in the C<rx_*> files in the same directory;
+There is one test per line: each test consists of the following
+columns (separated by one *or more* tabs):
+
+=over 4
+
+=item pattern
+
+The Perl 6 regex to test.
+
+=item target
+
+The string that will be matched against the pattern. Use '' to indicate
+an empty string.
+
+=item result
+
+The expected result of the match. Either C<y> for a successful match, C<n>
+for a failed one. Otherwise the output is expected to begin and end with
+C</>.
+
+This result is used in one of two ways: If an exception is thrown by the
+match, the result must be contained in the exception's message. If the match
+succeeds, then the message must be contained in a dump of the match object.
+
+=item test id
+
+A unique test identifier. This allows us to track TODO/SKIP information in
+*this* file instead of the associated test file, which lets us easily
+share the tests across implementations of perl6's regex engine.
+
+=item description
+
+Description of the test.
+
+=back
+
+=head1 SYNOPSIS
+
+    % prove t/compilers/pge/01-regex.t
+
+=cut
+
+.const string TESTS = 'no_plan'
+
+.sub main :main
+    load_bytecode 'Test/Builder.pbc'
+    load_bytecode 'P6Regex.pbc'
+    load_bytecode 'String/Utils.pbc'
+    .include "iglobals.pasm"
+
+    # Variable declarations, initializations
+    .local pmc test       # the test harness object.
+               test = new [ 'Test'; 'Builder' ]
+
+    .local string test_dir # the directory containing tests
+                  test_dir = 't/p6regex/'
+
+    .local pmc test_files # values are test file names to run.
+               test_files = new 'ResizablePMCArray'
+
+    # populate the list of test files
+    push test_files, 'rx_basic'
+    push test_files, 'rx_metachars'
+    push test_files, 'rx_quantifiers'
+    push test_files, 'rx_backtrack'
+    push test_files, 'rx_charclass'
+    push test_files, 'rx_subrules'
+    push test_files, 'rx_lookarounds'
+    push test_files, 'rx_captures'
+    push test_files, 'rx_modifiers'
+    # push test_files, 'rx_syntax'
+    push test_files, 'rx_goal'
+
+    .local pmc interp     # a handle to our interpreter object.
+               interp = getinterp
+
+    .local pmc config
+               config = interp[.IGLOBALS_CONFIG_HASH]
+
+    .local int has_icu    # flag indicating presense of icu
+               has_icu = config['has_icu']
+
+    .local pmc file_iterator # iterate over list of files..
+               file_iterator = iter test_files
+
+    .local int test_number   # the number of the test we're running
+               test_number = 0
+
+    # these vars are in the loops below
+    .local pmc file_handle   # currently open file.
+    .local string test_file  # name of the current test file
+    .local string test_line  # one line of one test file, a single test
+    .local int ok            # is this a passing test?
+
+    # for any given test:
+    .local int skiptest       # if the test is '# skip'
+    .local int todotest       # if the test is '# todo'
+    .local string reason      # reason for todo/skip
+    .local pmc rule           # the rule
+    .local pmc match          # the match
+    .local string pattern     # the regexp
+    .local string target      # this string to match against the regex
+    .local string result      # expected result of this test. (y/n/...)
+    .local string description # user-facing description of the test.
+
+    # how many tests to run?
+    # XXX: this should be summed automatically from test_files data
+    #      until then, it's set to no plan
+    test.'plan'(TESTS)
+
+
+  outer_loop:
+    unless file_iterator goto end_outer_loop
+    .local string test_name
+                  test_name = shift file_iterator
+    # local test number in test file
+    .local int local_test_number
+               local_test_number = 0
+
+    # local line number in test file
+    .local int local_line_number
+               local_line_number = 0
+
+    # append the test directory and filename
+    test_file = test_dir . test_name
+
+    # Open the test file
+    file_handle = open test_file, 'r'
+    $S0 = typeof file_handle
+    if $S0 == 'Undef' goto bad_file
+
+  next_test:
+    skiptest = 0
+    todotest = 0
+    trace 0
+
+    # loop over the file, one at a time.
+  loop:
+    # read in the file one line at a time...
+    $I0 = file_handle.'eof'()
+    if $I0 goto end_loop
+
+    test_line = readline file_handle
+    inc local_line_number
+
+    # if this line is not a comment, try a test
+    $S0 = substr test_line, 0, 1
+    if $S0 != '#' goto parse_test
+
+  parse_comment:
+    # line is a comment, if no :pge<...> then skip comment
+    $I0 = index test_line, ':pge<'
+    if $I0 == -1 goto loop
+
+    # extract out the reason for skip or todo
+    $I0 += 5
+    $I1 = index test_line, '>', $I0
+    $I1 -= $I0
+    reason = substr test_line, $I0, $I1
+
+    # determine skip/todo
+    $P0 = split ' ', test_line
+    $S0 = $P0[1]
+    if $S0 == 'skip' goto comment_skip
+    if $S0 == 'todo' goto comment_todo
+    if $S0 == 'trace' goto comment_trace
+    goto loop
+  comment_skip:
+    skiptest = 1
+    goto loop
+  comment_todo:
+    todotest = 1
+    goto loop
+  comment_trace:
+    $I0 = reason
+    trace $I0
+    goto loop
+
+  parse_test:
+    # skip lines without tabs
+    $I0 = index test_line, "\t"
+    if $I0 == -1 goto loop
+    inc test_number
+    inc local_test_number
+
+  parse_data:
+    push_eh eh_bad_line
+    ( pattern, target, result, description ) = parse_data( test_line )
+    pop_eh
+
+    # prepend test filename and line number to description
+    description = 'build_test_desc'( description, test_name, local_line_number )
+
+    if target != "''" goto got_target
+    target = ''
+
+  got_target:
+    target = 'backslash_escape'( target )
+    result = 'backslash_escape'( result )
+
+    # Should this test be skipped?
+    unless skiptest goto not_skip
+    test.'skip'(1, reason)
+    goto next_test
+
+  not_skip:
+    push_eh thrown
+    match = 'match_perl6regex'( pattern, target )
+    pop_eh
+
+    if match goto matched
+
+    if result == 'n' goto is_ok
+    if result == 'y' goto is_nok
+    goto check_dump
+
+  matched:
+    if result == 'y' goto is_ok
+    if result == 'n' goto is_nok
+    # goto check_dump
+
+  check_dump:
+    $S1 = match.'dump_str'('mob', ' ', '')
+
+    # remove /'s
+    $S0 = substr result, 0, 1
+    if $S0 != "/" goto bad_line
+    substr result, 0, 1, ''
+    substr result, -1, 1, ''
+
+    $I0 = index $S1, result
+    if $I0 == -1 goto is_nok
+    # goto is_ok
+
+  is_ok:
+    ok = 1
+    goto emit_test
+  is_nok:
+    ok = 0
+
+  emit_test:
+    unless todotest goto not_todo
+    test.'todo'(ok, description, reason)
+    goto next_test
+  not_todo:
+    test.'ok'(ok, description)
+    goto next_test
+
+  end_loop:
+    close file_handle
+    goto outer_loop
+  end_outer_loop:
+
+    test.'finish'()
+    end
+
+  bad_file:
+    print "Unable to open '"
+    print test_file
+    print "'\n"
+
+  thrown:
+    .local pmc exception
+    .local string message
+    get_results '0', exception
+    message = exception
+    say message
+    # remove /'s
+    $S0 = substr result, 0, 1
+    if $S0 != "/" goto bad_error
+    substr result, 0, 1, ''
+    substr result, -1, 1, ''
+    $I0 = index message, result
+    if $I0 == -1 goto bad_error
+    ok = 1
+    goto emit_test
+  bad_error:
+    ok = 0
+    goto emit_test
+  bad_line:
+    $S0 = "Test not formatted properly!"
+    test.'ok'(0, $S0)
+    goto loop
+  eh_bad_line:
+    $S0 = "Test not formatted properly!"
+    test.'ok'(0, $S0)
+    goto loop
+.end
+
+
+.sub 'parse_data'
+    .param string test_line   # the data record
+
+    .local pmc rule           # the rule
+    .local pmc match          # the match
+    .local string pattern     # the regexp
+    .local string target      # this string to match against the regex
+    .local string result      # expected result of this test. (y/n/...)
+    .local string description # user-facing description of the test.
+
+    # NOTE: there can be multiple tabs between entries, so skip until
+    # we have something.
+    # remove the trailing newline from record
+    chopn test_line, 1
+
+    $P1 = split "\t", test_line
+    $I0 = elements $P1 # length of array
+    .local int tab_number
+               tab_number = 0
+  get_pattern:
+    if tab_number >= $I0 goto bad_line
+    pattern     = $P1[tab_number]
+    inc tab_number
+  get_target:
+    if tab_number >= $I0 goto bad_line
+    target      = $P1[tab_number]
+    inc tab_number
+    if target == '' goto get_target
+  get_result:
+    if tab_number >= $I0 goto bad_line
+    result      = $P1[tab_number]
+    inc tab_number
+    if result == '' goto get_result
+  get_description:
+    if tab_number >= $I0 goto bad_line
+    description = $P1[tab_number]
+    inc tab_number
+    if description == '' goto get_description
+
+  return:
+    .return ( pattern, target, result, description )
+
+  bad_line:
+      $P1 = new 'Exception'
+      $P1 = 'invalid data format'
+      throw $P1
+.end
+
+
+.sub 'build_test_desc'
+    .param string desc
+    .param string test_name
+    .param string local_test_number
+
+    $S0  = '['
+    $S0 .= test_name
+    $S0 .= ':'
+    $S0 .= local_test_number
+    $S0 .= '] '
+
+    desc = concat $S0, desc
+
+    .return (desc)
+.end
+
+
+.sub 'match_perl6regex'
+    .param string pattern
+    .param string target
+
+    .local pmc match
+
+    .local pmc p6rule     # the perl6 regex compiler
+               p6rule = compreg 'Regex::P6Regex'
+
+    .local pmc rule
+               rule = p6rule.'compile'(pattern)
+
+    unless_null rule, match_it
+    $P1 = new 'Exception'
+    $P1 = 'rule error'
+    throw $P1
+  match_it:
+    $P0 = get_hll_global ['Regex'], 'Cursor'
+    match = $P0.'parse'(target, rule, 'from'=>-1)
+
+    .return (match)
+.end
+
+
+# given a 2 digit string, convert to appropriate chr() value.
+.sub hex_chr
+    .param string hex
+
+    $S0 = substr hex, 0, 1
+    $S1 = substr hex, 1, 1
+
+    $I0 = hex_val($S0)
+    $I1 = hex_val($S1)
+
+    $I0 *=16
+    $I0 += $I1
+
+    $S2 = chr $I0
+
+    .return ($S2)
+.end
+
+
+# given a single digit hex value, return it's int value.
+.sub hex_val
+  .param string digit
+
+  $I0 = ord digit
+  if $I0 < 48 goto bad_digit
+  if $I0 > 57 goto non_numeric
+  $I0 -=48
+  .return ($I0)
+non_numeric:
+  if $I0 < 65 goto bad_digit
+  if $I0 > 70 goto not_capital
+  $I0 -= 55 # A is ascii 65, so reset to zero, add 10 for hex..
+  .return ($I0)
+not_capital:
+  if $I0 < 97 goto  bad_digit
+  if $I0 > 102 goto bad_digit
+  $I0 -= 87 # a is ascii 97, so reset to zero, add 10 for hex..
+  .return ($I0)
+
+bad_digit:
+  $P1 = new 'Exception'
+  $P1 = 'invalid hex digit'
+  throw $P1
+.end
+
+
+.sub backslash_escape
+    .param string target
+
+  target1:
+    $I0 = index target, '\n'
+    if $I0 == -1 goto target2
+    substr target, $I0, 2, "\n"
+    goto target1
+  target2:
+    $I0 = index target, '\r'
+    if $I0 == -1 goto target3
+    substr target, $I0, 2, "\r"
+    goto target2
+  target3:
+    $I0 = index target, '\e'
+    if $I0 == -1 goto target4
+    substr target, $I0, 2, "\e"
+    goto target3
+  target4:
+    $I0 = index target, '\t'
+    if $I0 == -1 goto target5
+    substr target, $I0, 2, "\t"
+    goto target4
+  target5:
+    $I0 = index target, '\f'
+    if $I0 == -1 goto target6
+    substr target, $I0, 2, "\f"
+    goto target5
+  target6:
+    # handle \xHH, hex escape.
+
+    $I0 = index target, '\x'
+    if $I0 == -1 goto target7
+
+    $I1 = $I0 + 2
+    $P0 = get_hll_global ['String';'Utils'], 'convert_digits_to_string'
+    ($S0, $I2) = $P0(target, 'x', $I1)
+    $S3 = substr target, $I1, $I2
+    $I2 += 2
+    substr target, $I0, $I2, $S0
+    goto target6
+  target7:
+    .return (target)
+.end
+
+=head1 BUGS AND LIMITATIONS
+
+Note that while our job would be easier if we could use regular expressions
+in here, but we want to avoid any dependency on the thing we're testing.
+
+Need to add in test ids, to avoid the precarious line numbering.
+
+=cut
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Added: branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_backtrack
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_backtrack	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,33 @@
+##   Backtracking control tests
+a* a			bazaar		y	control
+# todo :pge<adverbs before backtrack(?)>
+a*:a			bazaar		/:a/	basic
+a*: a			bazaar		n	basic
+^[a|b]*  aba		abbabbababba	y	control
+^[a|b]*: aba		abbabbababba	n	outside a group
+\d+:			123abc		y	cut on character class shortcut
+\d+:			abc		n	cut on character class shortcut
+[ if    not | ify ]	verify		y	control
+[ if :: not | ify ]	verify		n	inside a group
+  if :: not | ify	verify		n	the default all group
+# todo :pugs<feature>
+[ if :  not | ify ]	verify		y	simple backtrack still works
+# todo :pugs<feature>
+[ if :: not | ify ] | verify	verify	y	rule continues
+[ when     ever ] | whence	whence	y	full backtrack failure
+[ when ::: ever ] | whence	whence	n	full backtrack failure
+# todo :pugs<feature>
+ab::cd | gh::ij		xyabghij	y	group cut at top
+ab:::cd | gh:::ij	xyabghij	n	rule cut at top
+# todo :pugs<feature>
+[ab::cd | gh::ij]	xyabghij	y	group cut in group
+[ab:::cd | gh:::ij]	xyabghij	n	rule cut in group
+[ ab | abc ]: de	xyzabcde	n	no backtrack into group
+( ab | abc ): de	xyzabcde	n	no backtrack into subpattern
+# todo :pugs<feature>
+[ when <commit> ever ] | whence	whence	n	full backtrack failure
+
+:ratchet a* a		bazaar		n	ratchet modifier
+:ratchet a*! a		bazaar		y	force backtracking !
+
+## vim: noexpandtab tabstop=4 shiftwidth=4

Added: branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_basic
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_basic	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,10 @@
+##   Basic tests
+a			a		y	basic literal
+abc			abc		y	basic multichar literal
+.			a		y	basic dot
+..			abc		y	basic multidot
+a.c			a.c		y	dot in mid pattern
+b			a		n	failed literal match
+aa			a		n	failed literal match
+...			ab		n	failed dot match
+c			abc		y	scanning match

Added: branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_captures
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_captures	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,63 @@
+##   captures
+(a.)..(..)		zzzabcdefzzz	y			basic match
+(a.)..(..)		zzzabcdefzzz	/mob: <abcdef @ 3>/	basic $0
+(a.)..(..)		zzzabcdefzzz	/mob 0: <ab @ 3>/	basic $1
+(a.)..(..)		zzzabcdefzzz	/mob 1: <ef @ 7>/	basic $2
+(a(b(c))(d))		abcd		y			nested match
+(a(b(c))(d))		abcd		/mob: <abcd @ 0>/	nested match
+(a(b(c))(d))		abcd		/mob 0: <abcd @ 0>/	nested match
+(a(b(c))(d))		abcd		/mob 0 0: <bc @ 1>/	nested match
+(a(b(c))(d))		abcd		/mob 0 0 0: <c @ 2>/	nested match
+(a(b(c))(d))		abcd		/mob 0 1: <d @ 3>/	nested match
+((\w+)+)		abcd		/mob: <abcd @ 0>/	nested match
+((\w+)+)		abcd		/mob 0: <abcd @ 0>/	nested match
+((\w+)+)		abcd		/mob 0 0 0: <abcd @ 0>/	nested match
+((\w+)+)	ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz	/mob: <ABCD/	nested match
+((\w+)+)	ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz	/mob 0: <ABCD/	nested match
+((\w+)+)	ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz	/mob 0 0 0: <ABCD/	nested match
+(a) [ (bc) (d) | .* (ef) ] .* (g)	abcdefg	/mob 0: <a @ 0>/	alt subpattern before group
+(a) [ (bc) (d) | .* (ef) ] .* (g)	abcdefg	/mob 1: <bc @ 1>/	alt subpattern in group
+(a) [ (bc) (d) | .* (ef) ] .* (g)	abcdefg	/mob 2: <d @ 3>/	alt subpattern in group
+(a) [ (bc) (d) | .* (ef) ] .* (g)	abcdefg	/mob 3: <g @ 6>/	alt subpattern after group
+(a) [ (bc) (x) | .* (ef) ] .* (g)	abcdefg	/mob 1: <ef @ 4>/	2nd alt subpattern in group
+(a) [ (bc) (x) | .* (ef) ] .* (g)	abcdefg	/mob 3: <g @ 6>/	2nd alt subpattern after group
+( (.) )*				abc	/mob 0 1 0: <b @ 1>/	nested repeated captures
+[ (.) ]*				abc	/mob 0 1: <b @ 1>/	nested repeated captures
+( [.] )*				abc	/mob 0 1: <b @ 1>/	nested repeated captures
+(.) (.) $7=(.) (.) $4=(.)		abcdefg	/mob 0: <a @ 0>/	numbered aliases $1
+(.) (.) $7=(.) (.) $4=(.)		abcdefg	/mob 1: <b @ 1>/	numbered aliases $2
+(.) (.) $7=(.) (.) $4=(.)		abcdefg	/mob 7: <c @ 2>/	numbered aliases $7
+(.) (.) $7=(.) (.) $4=(.)		abcdefg	/mob 8: <d @ 3>/	numbered aliases $8
+(.) (.) $7=(.) (.) $4=(.)		abcdefg	/mob 4: <e @ 4>/	numbered aliases $4
+$1=[ (.) (.) (.) ] (.)			abcdefg	/mob 1: <abc @ 0>/	perl5 numbered captures $1
+$1=[ (.) (.) (.) ] (.)			abcdefg	/mob 2: <a @ 0>/	perl5 numbered captures $1
+$1=[ (.) (.) (.) ] (.)			abcdefg	/mob 3: <b @ 1>/	perl5 numbered captures $1
+$1=[ (.) (.) (.) ] (.)			abcdefg	/mob 4: <c @ 2>/	perl5 numbered captures $1
+$1=[ (.) (.) (.) ] (.)			abcdefg	/mob 5: <d @ 3>/	perl5 numbered captures $1
+# todo :pugs<feature>
+:s $<key>=[\w+] \= $<val>=[\S+]	 abc = 123	/mob<key>: <abc @ 1>/	named capture
+# todo :pugs<feature>
+:s $<key>=[\w+] \= $<val>=[\S+]	 abc = 123	/mob<val>: <123 @ 7>/	named capture
+# todo :pugs<feature>
+:s (\w+) $<foo>=(\w+) (\w+)		abc def ghi	/mob<foo>: <def @ 4>/	mixing named and unnamed capture
+# todo :pugs<feature>
+:s (\w+) $<foo>=(\w+) (\w+)		abc def ghi	/mob 1: <ghi @ 8>/	mixing named and unnamed capture
+# todo :pugs<feature>
+<alpha> [ \- <alpha> ]?			abc def ghi	/mob<alpha> 0: <a @ 0>/	multiple subrule captures in same scope
+# todo :pugs<feature>
+[(.)$0]+				bookkeeper	y			backreference
+# todo :pugs<feature>
+(\w+) <+ws> $0				hello hello	y			backreference at end of string
+# todo :pugs<feature>
+[(.)$0]+				bookkeeper	/mob 0 0: <o @ 1>/	backref $1
+# todo :pugs<feature>
+[(.)$0]+				bookkeeper	/mob 0 1: <k @ 3>/	backref $1
+# todo :pugs<feature>
+[(.)$0]+				bookkeeper	/mob 0 2: <e @ 5>/	backref $1
+# todo :pugs<feature>
+(.)*x					123x		/mob: <123x @ 0>/	repeated dot capture
+
+$<key>=<alpha>				12ab34		/mob<key>: <a @ 2>/	alias capture
+<key=alpha>				12ab34		/mob<key>: <a @ 2>/	alias capture
+
+## vim: noexpandtab tabstop=4 shiftwidth=4

Added: branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_charclass
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_charclass	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,82 @@
+##   Enumerated character lists
+<[c]>			abcdef		y	character class
+# todo :pugs<feature>
+<[ z ]>			abc def		n	character class ignores ws
+# todo :pugs<feature>
+<[dcb]>**3		abcdef		y	repeated character class
+^<[a]>			abcdef		y	anchored character class
+<-[e]>			abcdef		y	negated character class
+^<[a]>?			abcdef		y	anchored optional character class
+<-[e]>?			abcdef		y	negated optional character class
+<-[dcb]>**3		abcdef		n	repeated negated character class
+^<-[e]>			abcdef		y	anchored negated character class
+^<-[a]>			abcdef		n	anchored negated character class
+<[b..d]>		abcdef		y	character range
+# todo :pugs<feature>
+<[b .. d]>		c		y	character range ignores ws
+<[b..d]>		abxxef		y	character range
+<[b..d]>		axcxef		y	character range
+<[b..d]>		axxdef		y	character range
+<[b..d]>		axxxef		n	character range
+<-[b..d]>		abcdef		y	negated character range
+# todo :pugs<feature>
+<- [b..d]>		abcdef		y	negated allows ws
+<-[b..d]>		bbccdd		n	negated character range
+# todo :pge<reversed character range>
+<-[d..b]>		bbccdd		/parse error/	illegal character range
+<[-]>			ab-def		/Obsolete/	unescaped hyphen
+<[\-]>			ab-def		y	escaped hyphen
+<[\-]>			abcdef		n	escaped hyphen
+<-[\-]>			---x--		y	negated escaped hyphen
+<-[\-]>			------		n	negated escaped hyphen
+<[\-+]>			ab-def		y	escaped hyphen in range
+<[\-+]>			ab+def		y	escaped hyphen in range
+<[\-+]>			abcdef		n	escaped hyphen in range
+<[+\-]>			ab-def		y	escaped hyphen in range
+<[+\-]>			ab+def		y	escaped hyphen in range
+<[+\-]>			abcdef		n	escaped hyphen in range
+<-[\-+]>		---x--		y	negated escaped hyphen in range
+<-[\-+]>		------		n	negated escaped hyphen in range
+<-[+\-]>		---x--		y	negated escaped hyphen in range
+<-[+\-]>		------		n	negated escaped hyphen in range
+<["\\]>			\\			y	escaped backslash
+<[\]]>			]			y	escaped close bracket
+<[\]>			\\]]		/error/	unescaped backslash (or no closing brace)
+^\><[<]>		><		y	lt character class
+^<[>]>\<		><		y	gt character class
+# todo :pugs<feature>
+^<[><]>**2		><		y	gt, lt character class
+# todo :pugs<feature>
+^<[<>]>**2		><		y	lt, gt  character class
+^<-[><]>		><		n	not gt, lt character class
+^<-[<>]>		><		n	not lt, gt  character class
+'... --- ...'		... --- ...	y	literal match (\')
+'... --- ...'		...---...	n	literal match (\')
+# todo :pugs<feature>
+'ab\'>cd'		ab'>cd		y	literal match with quote
+'ab\\yz'		ab\x5cyz	y	literal match with backslash
+'ab"cd'			ab"cd		y	literal match with quote
+# todo :pugs<feature>
+'ab\\yz'		ab\x5cyz	y	literal match with backslash
+# todo :pugs<feature> :pge<feature>
+"... --- ..."		... --- ...	y	literal match (\")
+# todo :pugs<feature> :pge<feature>
+"... --- ..."		...---...	n	literal match (\")
+# todo :pugs<feature> :pge<feature>
+"ab<\">cd"		ab<">cd		y	literal match with quote
+# todo :pugs<feature> :pge<feature>
+"ab<'>cd"		ab<'>cd		y	literal match with quote
+# todo :pugs<feature> :pge<feature>
+"ab\\cd"		ab\x5ccd	y	literal match with backslash
+# todo :pugs<feature> :pge<feature>
+(ab)x"$0"		abxab		y	literal match with interpolation
+# todo :pugs<feature> :pge<feature>
+(ab)"x$0"		abxab		y	literal match with interpolation
+'?'			ab<?		y	literal match with question mark
+'<'			ab<?		y	literal match with lt
+'<?'			ab<?		y	literal match with lt and question mark
+'<?'			ab<x?		n	non-matching literal match
+<[A..Z0..9]>		abcdef		n	two enumerated ranges
+<[A..Z0..9]>		abcDef		y	two enumerated ranges
+
+## vim: noexpandtab tabstop=4 shiftwidth=4

Added: branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_goal
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_goal	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,14 @@
+##   Goal tests
+'(' ~ ')' \d+		(123)		y	basic goal syntax
+'(' ~ ')' \d+		(123		/couldn't find final/	missing goal
+'(' ~ ')' \d+		(123abc)	/couldn't find final/	stuff before goal
+'(' ~ ')' \d+		(abc)		n	can't match internal stuff
+'(' ~ ')' \d+		()		n	missing internal stuff
+['('] ~ [')'] \d+		(123)		y	goal syntax with brackets
+['('] ~ [')'] [\d+]		(123)		y	goal syntax with brackets
+['('] ~ [')'] [\d\d+]		(123)		y	goal syntax with brackets
+('(') ~ (')') (\d\d+)		(123)		y	goal syntax with parentheses
+'(' ~ <[()]> \d+		(123)		y	non-literal goal
+'(' ~ <[()]> \d+		(123(		y	non-literal goal
+'(' ~ <[()]> \d+		(123]		/Unable to parse/	failing non-literal goal
+:dba('zz') '(' ~ ')' \d+	(123		/zz/	:dba adverb

Added: branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_lookarounds
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_lookarounds	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,48 @@
+## lookarounds
+<before .d> a.		abacad		/mob: <ad @ 4>/			lookahead <before>
+<before c> ....		abacad		n				lookahead <before>
+<before> .		abcd		n				null <before>
+<!before ..b> aa	aabaaa		/mob: <aa @ 3>/			negated lookahead
+# todo :pugs<feature>
+<after a>b		ab		y				lookbehind <after>
+<after a>b		cb		n				lookbehind <after>
+<after a>b		b		n				lookbehind <after>
+# todo :pugs<feature>
+<!after c>b		ab		y				lookbehind <!after>
+<!after c>b		cb		n				lookbehind <!after>
+# todo :pugs<feature>
+<!after c>b		b		y				lookbehind <!after>
+<!after <[cd]>>b	dbcb		n				lookbehind <!after>
+# todo :pugs<feature>
+<!after <[cd]>><[ab]>	dbaacb		y				lookbehind <!after>
+<!after c|d>b		dbcb		n				lookbehind <!after>
+# todo :pugs<feature>
+<!after c|d><[ab]>	dbaacb		y				lookbehind <!after>
+# todo :pugs<feature>
+<!after cd><[ab]>	cbaccb		y				lookbehind <!after>
+# todo :pugs<feature>
+$ <after ^a>		a		y				lookbehind <after>
+# todo :pugs<feature>
+<after x+>y		axxbxxyc	y				lookbehind <after>
+<[a..z]>+		az		y				metasyntax with leading + (<+...>)
+<+[a..z]>+		az		y				metasyntax with leading + (<+...>)
+<+alpha>+		az		y				metasyntax with leading + (<+...>)
+
+<?>			''		y		null pattern (<?>)
+^ <?>		\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	y	null pattern (<?>)
+<?> $		\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	y	null pattern (<?>)
+abc <?> def	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	y	null pattern (<?>)
+x | y | <?>	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	y	null pattern (<?>)
+x | y | <?>	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	y	null pattern (<?>)
+
+abc <!> def	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	n	fail pattern <!>
+
+a[b}		\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/error/	mismatched close
+
+c <before .d>		abacad		/mob: <c @ 3>/				one character and lookahead <before>
+.* <before .d>		abacad		/mob: <abac @ 0>/			multiple characters and lookahead <before>
+.* <before .\<>		abaca<d		/mob: <abac @ 0>/			multiple characters and lookahead <before> with a '<'
+.* <before \<>		aba<ca<d		/mob: <aba<ca @ 0>/		greedy any character and lookahead <before> with a '<'
+.*? <before \<>		aba<ca<d		/mob: <aba @ 0>/		non-greedy any character and lookahead <before> with a '<'
+
+## vim: noexpandtab tabstop=4 shiftwidth=4

Added: branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_metachars
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_metachars	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,263 @@
+##   Metacharacter tests
+.			a		y	dot (.)
+.			\n		y	dot (.)
+.			''		n	dot (.)
+a\s+f			abcdef		n	whitespace (\s)
+ab\s+cdef		ab  cdef	y	whitespace (\s)
+a\S+f			abcdef		y	not whitespace (\S)
+a\S+f			ab cdef		n	not whitespace (\S)
+^ abc			abcdef		y	start and end of string (^)
+^ abc			abc\ndef	y	start and end of string (^)
+^ abc			def\nabc	n	start and end of string (^)
+def \n ^ abc		def\nabc	n	start and end of string (^)
+def $			abcdef		y	start and end of string ($)
+def $			abc\ndef	y	start and end of string ($)
+def $			def\nabc	n	start and end of string ($)
+def $ \n abc		def\nabc	n	start and end of string (^)
+abc \n $		abc\n		y	end of string ($)
+abc $			abc\n		n	end of string ($)
+<<def			abc-def		y	left word boundary, beginning of word
+<<bc			abc-def		n	left word boundary, mid-word
+c<<			abc-def		n	left word boundary, end of word
+<<abc			abc-def		y	left word boundary, BOS
+def<<			abc-def		n	left word boundary, EOS
+<<			-------		n	left word boundary, no word chars
+>>def			abc-def		n	right word boundary, beginning of word
+>>bc			abc-def		n	right word boundary, mid-word
+c>>			abc-def		y	right word boundary, end of word
+>>abc			abc-def		n	right word boundary, BOS
+def>>			abc-def		y	right word boundary, EOS
+>>			-------		n	right word boundary, no word chars
+
+c \n d			abc\ndef	y	logical newline (\n)
+# todo :pugs<feature>
+c \n d			abc\rdef	y	logical newline matches \r
+c \n+ d			abc\n\ndef	y	logical newline quantified
+a\n+f			abcdef		n	logical newline (\n)
+c \n d			abc\n\rdef	n	logical newline matches \n\r
+# todo :pugs<feature>
+c \n d			abc\r\ndef	y	logical newline matches \r\n
+b \n c			abc\ndef	n	logical newline (\n)
+\N			a		y	not logical newline (\N)
+a \N c			abc		y	not logical newline (\N)
+\N			''		n	not logical newline (\N)
+c \N d			abc\ndef	n	not logical newline (\N)
+c \N d			abc\rdef	n	not logical newline (\N)
+c \N+ d			abc\n\ndef	n	not logical newline (\N)
+a\N+f			abcdef		y	not logical newline (\N)
+c \N d			abc\n\rdef	n	not logical newline (\N)
+c \N d			abc\r\ndef	n	not logical newline (\N)
+b \N \n			abc\ndef	y	not logical newline (\N)
+\Aabc			Aabc		/Obsolete/	retired metachars (\A)
+\Aabc			abc\ndef	/Obsolete/	retired metachars (\A)
+abc\Z			abcZ		/Obsolete/	retired metachars (\Z)
+abc\Z			abc\ndef	/Obsolete/	retired metachars (\Z)
+abc\z			abcz		/Obsolete/	retired metachars (\z)
+def\z			abc\ndef	/Obsolete/	retired metachars (\z)
+abc # def		abc#def		y	comments (#)
+abc # xyz		abc#def		y	comments (#)
+abc # def \n \$		abc#def		y	comments (#)
+abc \# def		abc#def		y	comments (#)
+abc \# xyz		abc#def		n	comments (#)
+^ abc \# def $		abc#def		y	comments (#)
+^^ abc \n ^^ def	abc\ndef	y	line beginnings and endings (^^)
+# todo :pugs<feature>
+^^ abc \n ^^ def \n ^^	abc\ndef\n	n	line beginnings and endings (^^)
+^^ \n			\n		y	line beginnings and endings (^^)
+# todo :pugs<feature>
+\n ^^			\n		n	line beginnings and endings (^^)
+abc $$ \n def $$	abc\ndef	y	line beginnings and endings ($$)
+# todo :pugs<feature>
+abc $$ \n def $$ \n $$	abc\ndef\n	n	line beginnings and endings ($$)
+$$ \n			\n		y	line beginnings and endings ($$)
+# todo :pugs<feature>
+\n $$			\n		n	line beginnings and endings ($$)
+<[a..d]> | <[b..e]>	c		y	alternation (|)
+<[a..d]> | <[d..e]>	c		y	alternation (|)
+<[a..b]> | <[b..e]>	c		y	alternation (|)
+<[a..b]> | <[d..e]>	c		n	alternation (|)
+<[a..d]>+ | <[b..e]>+	bcd		y	alternation (|)
+^ [ <[a..d]>+ | <[b..e]>+ ] $	bcd		y	alternation (|)
+^ [ <[a..c]>+ | <[b..e]>+ ] $	bcd		y	alternation (|)
+^ [ <[a..d]>+ | <[c..e]>+ ] $	bcd		y	alternation (|)
+b|			bcd		/Null pattern/	alternation (|) - null right arg illegal
+|b			bcd		y	alternation (|) - null left arg ignored
+|			bcd		/Null pattern/	alternation (|) - null both args illegal
+\|			|		y	alternation (|) - literal must be escaped
+|			|		/Null pattern/	alternation (|) - literal must be escaped
+# todo :pugs<feature>
+<[a..d]> & <[b..e]>	c		y	conjunction (&)
+<[a..d]> & <[d..e]>	c		n	conjunction (&)
+<[a..b]> & <[b..e]>	c		n	conjunction (&)
+<[a..b]> & <[d..e]>	c		n	conjunction (&)
+# todo :pugs<feature>
+<[a..d]>+ & <[b..e]>+	bcd		y	conjunction (&)
+# todo :pugs<feature>
+^ [ <[a..d]>+ & <[b..e]>+ ] $	bcd		y	conjunction (&)
+# todo :pugs<feature>
+<[a..c]>+ & <[b..e]>+	bcd		y	conjunction (&)
+# todo :pugs<feature>
+<[a..d]>+ & <[c..e]>+	bcd		y	conjunction (&)
+b&			bcd		/rule error/	conjunction (&) - null right arg illegal
+&b			bcd		/rule error/	conjunction (&) - null left arg illegal
+&			bcd		/rule error/	conjunction (&) - null both args illegal
+\&			&		y	conjunction (&) - literal must be escaped
+&			&		/rule error/	conjunction (&) - literal must be escaped
+# todo :pge<leading |>
+a&|b			a&|b		/rule error/	alternation and conjunction (&|) - parse error
+a|&b			a|&b		/rule error/	alternation and conjunction (|&) - parse error
+|d|b			abc		y	leading alternation ignored
+ |d|b			abc		y	leading alternation ignored
+|d |b			abc		y	leading alternation ignored
+ | d | b		abc		y	leading alternation ignored
+# todo :pugs<feature> :pge<feature>
+ b |  | d		abc		n	null pattern invalid
+\pabc			pabc		/Obsolete/	retired metachars (\p)
+\p{InConsonant}		a		/Obsolete/	retired metachars (\p)
+\Pabc			Pabc		/Obsolete/	retired metachars (\P)
+\P{InConsonant}		a		/Obsolete/	retired metachars (\P)
+\Labc\E			LabcE		/Obsolete/	retired metachars (\L...\E)
+\LABC\E			abc		/Obsolete/	retired metachars (\L...\E)
+\Uabc\E			UabcE		/Obsolete/	retired metachars (\U...\E)
+\Uabc\E			ABC		/Obsolete/	retired metachars (\U...\E)
+\Qabc\E			QabcE		/Obsolete/	retired metachars (\Q...\E)
+\Qabc d?\E		abc d		/Obsolete/	retired metachars (\Q...\E)
+\Gabc			Gabc		/Obsolete/	retired metachars (\G)
+\1abc			1abc		/Obsolete/	retired metachars (\1)
+# todo :pugs<feature>
+^ \s+ $			\x0009\x0020\x00a0\x000a\x000b\x000c\x000d\x0085	y	0-255 whitespace (\s)
+# todo :pugs<feature>
+^ \h+ $			\x0009\x0020\x00a0	y	0-255 horizontal whitespace (\h)
+^ \V+ $			\x0009\x0020\x00a0	y	0-255 horizontal whitespace (\V)
+# todo :pugs<feature>
+^ \v+ $			\x000a\x000b\x000c\x000d\x0085	y	0-255 vertical whitespace (\v)
+^ \h+ $			\x000a\x000b\x000c\x000d\x0085	n	0-255 horizontal whitespace (\h)
+^ \v+ $			\x0009\x0020\x00a0	n	0-255 vertical whitespace (\v)
+# todo :pugs<feature>
+^ \s+ $			\x1680\x180e\x2000\x2001\x2002\x2003\x2004\x2005\x2006\x2007\x2008\x2008\x2009\x200a\x202f\x205f\x3000	y	unicode whitespace (\s)
+# todo :pugs<feature>
+^ \h+ $			\x1680\x180e\x2000\x2001\x2002\x2003\x2004\x2005\x2006\x2007\x2008\x2008\x2009\x200a\x202f\x205f\x3000	y	unicode whitespace (\h)
+^ \V+ $			\x1680\x180e\x2000\x2001\x2002\x2003\x2004\x2005\x2006\x2007\x2008\x2008\x2009\x200a\x202f\x205f\x3000	y	unicode whitespace (\V)
+^ \v+ $			\x1680\x180e\x2000\x2001\x2002\x2003\x2004\x2005\x2006\x2007\x2008\x2008\x2009\x200a\x202f\x205f\x3000	n	unicode whitespace (\v)
+c \t d			abc\tdef	y	horizontal tab (\t)
+c \t+ d			abc\t\tdef	y	horizontal tab (\t)
+a \t+ f			abcdef		n	horizontal tab (\t)
+b \t c			abc\tdef	n	horizontal tab (\t)
+\T			a		y	not horizontal tab (\T)
+a \T c			abc		y	not horizontal tab (\T)
+\T			''		n	not horizontal tab (\T)
+c \T d			abc\tdef	n	not horizontal tab (\T)
+c \T+ d			abc\t\tdef	n	not horizontal tab (\T)
+a \T+ f			abcdef		y	not horizontal tab (\T)
+c \r d			abc\rdef	y	return (\r)
+c \r+ d			abc\r\rdef	y	return (\r)
+a \r+ f			abcdef		n	return (\r)
+b \r c			abc\rdef	n	return (\r)
+\R			a		y	not return (\R)
+a \R c			abc		y	not return (\R)
+\R			''		n	not return (\R)
+c \R d			abc\rdef	n	not return (\R)
+c \R+ d			abc\r\rdef	n	not return (\R)
+a \R+ f			abcdef		y	not return (\R)
+c \f d			abc\fdef	y	formfeed (\f)
+c \f+ d			abc\f\fdef	y	formfeed (\f)
+a \f+ f			abcdef		n	formfeed (\f)
+b \f c			abc\fdef	n	formfeed (\f)
+\F			a		y	not formfeed (\F)
+a \F c			abc		y	not formfeed (\F)
+\F			''		n	not formfeed (\F)
+c \F d			abc\fdef	n	not formfeed (\F)
+c \F+ d			abc\f\fdef	n	not formfeed (\F)
+a \F+ f			abcdef		y	not formfeed (\F)
+# todo :pugs<feature>
+c \e d			abc\edef	y	escape (\e)
+# todo :pugs<feature>
+c \e+ d			abc\e\edef	y	escape (\e)
+a \e+ f			abcdef		n	escape (\e)
+b \e c			abc\edef	n	escape (\e)
+\E			a		y	not escape (\E)
+a \E c			abc		y	not escape (\E)
+\E			''		n	not escape (\E)
+# todo :pugs<feature>
+c \E d			abc\edef	n	not escape (\E)
+# todo :pugs<feature>
+c \E+ d			abc\e\edef	n	not escape (\E)
+a \E+ f			abcdef		y	not escape (\E)
+c \x0021 d		abc!def	y	hex (\x)
+c \x0021+ d		abc!!def	y	hex (\x)
+a \x0021+ f		abcdef		n	hex (\x)
+b \x0021 c		abc!def		n	hex (\x)
+c \x[0021] d		abc!def		y	hex (\x[])
+c \x[0021]+ d		abc!!def	y	hex (\x[])
+c \x[21,21] d		abc!!def	y	hex (\x[])
+c \x[21, 21] d		abc!!def	y	hex (\x[])
+c \x[ 21 , 21 ] d	abc!!def	y	hex (\x[])
+a \x[0021]+ f		abcdef		n	hex (\x[])
+b \x[0021] c		abc!def		n	hex (\x[])
+\X0021			a		y	not hex (\X)
+a \X0021 c		abc		y	not hex (\X)
+\X0021			''		n	not hex (\X)
+c \X0021 d		abc!def		n	not hex (\X)
+c \X0021+ d		abc!!def	n	not hex (\X)
+a \X0021+ f		abcdef		y	not hex (\X)
+\X[0021]		a		y	not hex (\X[])
+a \X[0021] c		abc		y	not hex (\X[])
+\X[0021]		''		n	not hex (\X[])
+c \X[0021] d		abc!def		n	not hex (\X[])
+c \X[0021]+ d		abc!!def	n	not hex (\X[])
+a \X[0021]+ f		abcdef		y	not hex (\X[])
+c \c33 d		abc!def	y	hex (\c)
+c \c33+ d		abc!!def	y	hex (\c)
+a \c33+ f		abcdef		n	hex (\c)
+b \c33 c		abc!def		n	hex (\c)
+c \c[33] d		abc!def		y	hex (\c[])
+c \c[33]+ d		abc!!def	y	hex (\c[])
+c \c[33,33] d		abc!!def	y	hex (\c[])
+c \c[ 33, 33] d		abc!!def	y	hex (\c[])
+c \c[ 33 , 33 ] d	abc!!def	y	hex (\c[])
+a \c[33]+ f		abcdef		n	hex (\c[])
+b \c[33] c		abc!def		n	hex (\c[])
+\C33			a		y	not hex (\C)
+a \C33 c		abc		y	not hex (\C)
+\C33			''		n	not hex (\C)
+c \C33 d		abc!def		n	not hex (\C)
+c \C33+ d		abc!!def	n	not hex (\C)
+a \C33+ f		abcdef		y	not hex (\C)
+\C[33]			a		y	not hex (\C[])
+a \C[33] c		abc		y	not hex (\C[])
+\C[33]			''		n	not hex (\C[])
+c \C[33] d		abc!def		n	not hex (\C[])
+c \C[33]+ d		abc!!def	n	not hex (\C[])
+a \C[33]+ f		abcdef		y	not hex (\C[])
+c \o041 d		abc!def		y	octal (\o)
+c \o41+ d		abc!!def	y	octal (\o)
+a \o41+ f		abcdef		n	octal (\o)
+b \o41 c		abc!def		n	octal (\o)
+c \o[41] d		abc!def		y	octal (\o[])
+c \o[41]+ d		abc!!def	y	octal (\o[])
+# todo :pugs<feature>
+c \o[41,41] d		abc!!def	y	octal (\o[])
+a \o[41]+ f		abcdef		n	octal (\o[])
+b \o[41] c		abc!def		n	octal (\o[])
+\O41			a		y	not octal (\O)
+a \O41 c		abc		y	not octal (\O)
+\O41			''		n	not octal (\O)
+c \O41 d		abc!def		n	not octal (\O)
+c \O41+ d		abc!!def	n	not octal (\O)
+a \O41+ f		abcdef		y	not octal (\O)
+\O[41]			a		y	not octal (\O[])
+a \O[41] c		abc		y	not octal (\O[])
+\O[41]			''		n	not octal (\O[])
+c \O[41] d		abc!def		n	not octal (\O[])
+c \O[41]+ d		abc!!def	n	not octal (\O[])
+a \O[41]+ f		abcdef		y	not octal (\O[])
+a\w+f			a=[ *f		n	word character
+a\w+f			abcdef		y	word character
+a\W+f			a&%- f		y	not word character
+a\W+f			abcdef		n	not word character
+a\d+f			abcdef		n	digit
+ab\d+cdef		ab42cdef	y	digit
+a\D+f			abcdef		y	not digit
+a\D+f			ab0cdef		n	not digit
+
+## vim: noexpandtab tabstop=4 shiftwidth=4

Added: branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_modifiers
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_modifiers	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,154 @@
+##  modifiers
+:i bcd			abcdef	y	ignorecase (:i)
+:i bcd			aBcdef	y	ignorecase (:i)
+:i bcd			abCdef	y	ignorecase (:i)
+:i bcd			abcDef	y	ignorecase (:i)
+:i bcd			abc-ef	n	ignorecase (:i)
+:ignorecase bcd		abcdef	y	ignorecase (:ignorecase)
+:ignorecase bcd		aBCDef	y	ignorecase (:ignorecase)
+:ignorecase bcd		abc-ef	n	ignorecase (:ignorecase)
+# todo :pugs<feature>
+:i(0) bcd		abcdef	y	ignorecase, repetition (:i(0))
+:i(0) bcd		abCdef	n	ignorecase, repetition (:i(0))
+# todo :pugs<feature>
+:i(1) bcd		abcdef	y	ignorecase, repetition (:i(1))
+# todo :pugs<feature>
+:i(1) bcd		abCdef	y	ignorecase, repetition (:i(1))
+:i(1) bcd		aBxDef	n	ignorecase, repetition (:i(1))
+# todo :pugs<feature>
+:0i bcd			abcdef	y	ignorecase, repetition (:0i)
+:0i bcd			abCdef	n	ignorecase, repetition (:0i)
+# todo :pugs<feature>
+:1i bcd			abcdef	y	ignorecase, repetition (:1i)
+# todo :pugs<feature>
+:1i bcd			abCdef	y	ignorecase, repetition (:1i)
+# todo :pugs<feature>
+:1i bcd			aBCDef	y	ignorecase, repetition (:1i)
+:1i bcd			aBxDef	n	ignorecase, repetition (:1i)
+ab [:i cd ] ef		abcdef	y	ignorecase, lexical (:i)
+ab [:i cd ] ef		abCdef	y	ignorecase, lexical (:i)
+ab [:i cd ] ef		abcDef	y	ignorecase, lexical (:i)
+ab [:i cd ] ef		abCDef	y	ignorecase, lexical (:i)
+ab [:i cd ] ef		aBCDef	n	ignorecase, lexical (:i)
+ab [:i cd ] ef		abCDEf	n	ignorecase, lexical (:i)
+:i ab [:i cd ] ef	abCDef	y	ignorecase, lexical (:i)
+:i ab [:i cd ] ef	AbCDeF	y	ignorecase, lexical (:i)
+:i ab [:i cd ] ef	AbcdeF	y	ignorecase, lexical (:i)
+# todo :pugs<feature>
+:i a [:i(0) b [:i(1) c [:0i d [:1i e [:i(0) f ] ] ] ] ]		AbCdEf		y	ignorecase, lexical (:i)
+# todo :pugs<feature>
+:i aa [:i(0) bb [:i(1) cc [:0i dd [:1i ee [:i(0) ff ] ] ] ] ]	AabbCcddEeff	y	ignorecase, lexical (:i)
+:i a [:i(0) b [:i(1) c [:0i d [:1i e [:i(0) f ] ] ] ] ]		AbCdEF		n	ignorecase, lexical (:i)
+:i aa [:i(0) bb [:i(1) cc [:0i dd [:1i ee [:i(0) ff ] ] ] ] ]	AabbCcddEeFf	n	ignorecase, lexical (:i)
+# todo :pugs<feature>
+:i ab [:i(0) cd ] ef	AbcdeF	y	ignorecase, lexical repetition (:i)
+# todo :pugs<feature> :pge<feature>
+:i ab [:!i cd ] ef	AbcdeF	y	ignorecase, lexical repetition (:i)
+# todo :pugs<feature>
+:i ab [:0i cd ] ef	AbcdeF	y	ignorecase, lexical repetition (:i)
+# todo :pugs<feature>
+:0i ab [:1i cd ] ef	abCDef	y	ignorecase, lexical repetition (:i)
+:0i ab [:1i cd ] ef	AbCDeF	n	ignorecase, lexical repetition (:i)
+:0i ab [:1i cd ] ef	AbcdeF	n	ignorecase, lexical repetition (:i)
+# todo :pugs<feature>
+:0i ab [:i(0) cd ] ef	abcdef	y	ignorecase, lexical repetition (:i)
+:0i ab [:1i cd ] ef	AbcdeF	n	ignorecase, lexical repetition (:i)
+# todo :pugs<feature>
+:i(1) ab [:1i cd ] ef	AbCdeF	y	ignorecase, lexical repetition (:i)
+# todo :pugs<feature>
+:i(1) ab [:i(0) cd ] ef	AbcdeF	y	ignorecase, lexical repetition (:i)
+:i(1) ab [:i(0) cd ] ef	AbcDeF	n	ignorecase, lexical repetition (:i)
+# todo :pugs<feature>
+:i(2) ab [:i(999) cd ] ef	ABCDEF	y	ignorecase, lexical repetition (:i)
+# todo :pugs<feature>
+:1i ab [:i(1) cd ] ef		ABCDEF	y	ignorecase, lexical repetition (:i)
+:0i ab [:1i cd ] ef		abcDeF	n	ignorecase, lexical repetition (:i)
+# todo :pugs<feature>
+:2i ab [:999i cd ] ef		ABCDEF	y	ignorecase, lexical repetition (:i)
+ab [:ignorecase cd ] ef		abCDef	y	ignorecase, lexical (:ignorecase)
+ab [:ignorecase cd ] ef		aBCDef	n	ignorecase, lexical (:ignorecase)
+# todo :pugs<feature>
+:1ignorecase ab [:ignorecase(1) cd ] ef	ABCDEF	y	ignorecase, lexical repetition (:ignorecase)
+# todo :pugs<feature>
+:s bcd			a bcdef		y	sigspace (:s)
+# todo :pugs<feature>
+:s bcd			a bcd ef	y	sigspace (:s)
+:s bcd			abcdef		n	sigspace (:s)
+:s bcd			abcd ef		n	sigspace (:s)
+:s bcd			ab cdef		n	sigspace (:s)
+# todo :pugs<feature>
+:s b c d		a b c d ef	y	sigspace (:s)
+# todo :pugs<feature>
+:s b c d		a b c def	y	sigspace (:s)
+:s b c d		ab c d ef	n	sigspace (:s)
+:s b c d		a bcdef		n	sigspace (:s)
+:s b c d		abcdef		n	sigspace (:s)
+# todo :pugs<feature>
+:sigspace bcd		a bcdef		y	sigspace (:sigspace)
+# todo :pugs<feature>
+:sigspace bcd		a bcd ef	y	sigspace (:sigspace)
+:sigspace bcd		abcdef		n	sigspace (:sigspace)
+# todo :pugs<feature>
+:sigspace b c d		a b c d ef	y	sigspace (:sigspace)
+# todo :pugs<feature>
+:sigspace b c d		a b c def	y	sigspace (:sigspace)
+:sigspace b c d		ab c d ef	n	sigspace (:sigspace)
+# todo :pugs<feature>
+:s(1) b c [:s(0) d e f ]	a b c def	y	sigspace, lexical repetition (:s)
+# todo :pugs<feature> :pge<feature>
+:s b c [:!s d e f ]	a b c def	y	sigspace, lexical repetition (:s)
+:s(0) b c [:s(1) d e f ]	a b c def	n	sigspace, lexical repetition (:s)
+# todo :pge<feature>
+:!s b c [:s d e f ]	a b c def	n	sigspace, lexical repetition (:s)
+:s(0) b c [:s(0) d e f ]	a b c def	n	sigspace, lexical repetition (:s)
+# todo :pge<feature>
+:!s b c [:!s d e f ]	a b c def	n	sigspace, lexical repetition (:s)
+# todo :pugs<feature>
+:s ab 				ab		y	sigspace, trailing ws
+foo\s*'-'?\s*bar		foo\t \n-\n\t bar	y	basic match
+foo\s*'-'?\s*bar		foo - bar	y	basic match
+foo\s+'-'?\s*bar		foo   bar	y	basic match \s+ \s*
+foo\s+'-'?\s*bar		foo  -bar	y	basic match \s+ \s*
+foo\s*'-'?\s+bar		foo-  bar	y	basic match \s* \s+
+foo '-'? bar			foo-bar		y	basic match \s* \s*
+foo '-'? bar			foobar		y	basic match
+foo '-'? bar			foo - bar	n	basic non-match
+# todo :pugs<feature>
+:s foo '-'? bar			foo\n \t- \t\t\nbar	y	basic ws match
+# todo :pugs<feature>
+:s foo '-'? bar			foo - bar	y	basic ws match
+# todo :pugs<feature>
+:s foo '-'? bar			foo   bar	y	basic ws match \s+ \s*
+# todo :pugs<feature>
+:s foo '-'? bar			foo  -bar	y	basic ws match \s+ \s*
+# todo :pugs<feature>
+:s foo '-'? bar			foo-  bar	y	basic ws match \s* \s+
+# todo :pugs<feature>
+:s foo '-'? bar			foo-bar		y	basic ws match \s* \s*
+:s foo '-'? bar			foobar		n	basic ws non-match
+:s()foo '-'? bar		foo - bar	n	basic ws match
+# todo :pugs<feature> :pge<feature>
+:s[]foo '-'? bar		foo - bar	y	basic ws match
+# todo :pugs<feature>
+:s<?wb>foo '-'? bar		foo - bar	y	basic ws match with boundary modifier separation
+# todo :pugs<feature>
+:s::foo '-'? bar			foo - bar	y	basic ws match with backtrack no-op modifier separation
+:s::(\w+) ':=' (\S+)		dog := spot	/mob 0: <dog @ 0>/	sigspace and capture together
+:s::(\w+) ':=' (\S+)		dog := spot	/mob 1: <spot @ 7>/	sigspace and capture together
+# todo :pugs<feature> :pge<feature>
+:perl5 \A.*? bcd\Q$\E..\z	a bcd$ef	y	perl5 syntax (:perl5)
+# todo :pugs<feature>
+:x(6) \d			123456		y	repetition (:x)
+# todo :pugs<feature>
+:x(3) \d			123456		y	repetition (:x)
+# todo :pugs<feature>
+:x(0) \d			123456		y	repetition (:x)
+# todo :pugs<feature>
+:nth(3) a \d			a1a2a3		y	nth occurance (:nth)
+# todo :pge<feature>
+:nth(4) a \d			a1a2a3		n	nth occurance (:nth)
+# todo :pge<feature>
+:nth(0) a \d			a1a2a3		n	nth occurance (:nth)
+:s^[\d+ ]* abc			11 12 13 abc	y	<?ws> before closing bracket
+
+## vim: noexpandtab tabstop=4 shiftwidth=4

Added: branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_quantifiers
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_quantifiers	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,189 @@
+##  Quantifiers
+
+xa*			xaaaay		/<xaaaa @ 0>/	star 2+
+xa*			xay		/<xa @ 0>/	star 1
+xa*			xy		/<x @ 0>/	star 0
+xa*y			xaaaay		/<xaaaay @ 0>/	star 2+
+xa*y			xay		/<xay @ 0>/	star 1
+xa*y			xy		/<xy @ 0>/	star 0
+
+xa+			xaaaay		/<xaaaa @ 0>/	plus 2+
+xa+			xay		/<xa @ 0>/	plus 1
+xa+			xy		n		plus 0
+xa+y			xaaaay		/<xaaaay @ 0>/	plus 2+
+xa+y			xay		/<xay @ 0>/	plus 1
+xa+y			xy		n		plus 0
+
+xa?			xaaaay		/<xa @ 0>/	ques 2+
+xa?			xay		/<xa @ 0>/	ques 1
+xa?			xy		/<x @ 0>/	ques 0
+xa?y			xaaaay		n		ques 2+
+xa?y			xay		/<xay @ 0>/	ques 1
+xa?y			xy		/<xy @ 0>/	ques 0
+
+xa*!			xaaaay		/<xaaaa @ 0>/	star greedy 2+
+xa*!			xay		/<xa @ 0>/	star greedy 1
+xa*!			xy		/<x @ 0>/	star greedy 0
+xa*!y			xaaaay		/<xaaaay @ 0>/	star greedy 2+
+xa*!y			xay		/<xay @ 0>/	star greedy 1
+xa*!y			xy		/<xy @ 0>/	star greedy 0
+
+xa+!			xaaaay		/<xaaaa @ 0>/	plus greedy 2+
+xa+!			xay		/<xa @ 0>/	plus greedy 1
+xa+!			xy		n		plus greedy 0
+xa+!y			xaaaay		/<xaaaay @ 0>/	plus greedy 2+
+xa+!y			xay		/<xay @ 0>/	plus greedy 1
+xa+!y			xy		n		plus greedy 0
+
+xa?!			xaaaay		/<xa @ 0>/	ques greedy 2+
+xa?!			xay		/<xa @ 0>/	ques greedy 1
+xa?!			xy		/<x @ 0>/	ques greedy 0
+xa?!y			xaaaay		n		ques greedy 2+
+xa?!y			xay		/<xay @ 0>/	ques greedy 1
+xa?!y			xy		/<xy @ 0>/	ques greedy 0
+
+xa*:!			xaaaay		/<xaaaa @ 0>/	star :greedy 2+
+xa*:!			xay		/<xa @ 0>/	star :greedy 1
+xa*:!			xy		/<x @ 0>/	star :greedy 0
+xa*:!y			xaaaay		/<xaaaay @ 0>/	star :greedy 2+
+xa*:!y			xay		/<xay @ 0>/	star :greedy 1
+xa*:!y			xy		/<xy @ 0>/	star :greedy 0
+
+xa+:!			xaaaay		/<xaaaa @ 0>/	plus :greedy 2+
+xa+:!			xay		/<xa @ 0>/	plus :greedy 1
+xa+:!			xy		n		plus :greedy 0
+xa+:!y			xaaaay		/<xaaaay @ 0>/	plus :greedy 2+
+xa+:!y			xay		/<xay @ 0>/	plus :greedy 1
+xa+:!y			xy		n		plus :greedy 0
+
+xa?:!			xaaaay		/<xa @ 0>/	ques :greedy 2+
+xa?:!			xay		/<xa @ 0>/	ques :greedy 1
+xa?:!			xy		/<x @ 0>/	ques :greedy 0
+xa?:!y			xaaaay		n		ques :greedy 2+
+xa?:!y			xay		/<xay @ 0>/	ques :greedy 1
+xa?:!y			xy		/<xy @ 0>/	ques :greedy 0
+
+xa*?			xaaaay		/<x @ 0>/	star eager 2+
+xa*?			xay		/<x @ 0>/	star eager 1
+xa*?			xy		/<x @ 0>/	star eager 0
+xa*?y			xaaaay		/<xaaaay @ 0>/	star eager 2+
+xa*?y			xay		/<xay @ 0>/	star eager 1
+xa*?y			xy		/<xy @ 0>/	star eager 0
+
+xa+?			xaaaay		/<xa @ 0>/	plus eager 2+
+xa+?			xay		/<xa @ 0>/	plus eager 1
+xa+?			xy		n		plus eager 0
+xa+?y			xaaaay		/<xaaaay @ 0>/	plus eager 2+
+xa+?y			xay		/<xay @ 0>/	plus eager 1
+xa+?y			xy		n		plus eager 0
+
+xa??			xaaaay		/<x @ 0>/	ques eager 2+
+xa??			xay		/<x @ 0>/	ques eager 1
+xa??			xy		/<x @ 0>/	ques eager 0
+xa??y			xaaaay		n		ques eager 2+
+xa??y			xay		/<xay @ 0>/	ques eager 1
+xa??y			xy		/<xy @ 0>/	ques eager 0
+
+xa*:?			xaaaay		/<x @ 0>/	star :eager 2+
+xa*:?			xay		/<x @ 0>/	star :eager 1
+xa*:?			xy		/<x @ 0>/	star :eager 0
+xa*:?y			xaaaay		/<xaaaay @ 0>/	star :eager 2+
+xa*:?y			xay		/<xay @ 0>/	star :eager 1
+xa*:?y			xy		/<xy @ 0>/	star :eager 0
+
+xa+:?			xaaaay		/<xa @ 0>/	plus :eager 2+
+xa+:?			xay		/<xa @ 0>/	plus :eager 1
+xa+:?			xy		n		plus :eager 0
+xa+:?y			xaaaay		/<xaaaay @ 0>/	plus :eager 2+
+xa+:?y			xay		/<xay @ 0>/	plus :eager 1
+xa+:?y			xy		n		plus :eager 0
+
+xa?:?			xaaaay		/<x @ 0>/	ques :eager 2+
+xa?:?			xay		/<x @ 0>/	ques :eager 1
+xa?:?			xy		/<x @ 0>/	ques :eager 0
+xa?:?y			xaaaay		n		ques :eager 2+
+xa?:?y			xay		/<xay @ 0>/	ques :eager 1
+xa?:?y			xy		/<xy @ 0>/	ques :eager 0
+
+xa*:y			xaaaay		/<xaaaay @ 0>/	star cut 2+
+xa*:y			xay		/<xay @ 0>/	star cut 1
+xa*:y			xy		/<xy @ 0>/	star cut 0
+xa*:a			xaaaay		n		star cut 2+
+xa*:a			xay		n		star cut 1
+
+xa+:y			xaaaay		/<xaaaay @ 0>/	plus cut 2+
+xa+:y			xay		/<xay @ 0>/	plus cut 1
+xa+:y			xy		n		plus cut 0
+xa+:a			xaaaay		n		plus cut 2+
+xa+:a			xay		n		plus cut 1
+
+xa?:y			xaaaay		n		ques cut 2+
+xa?:y			xay		/<xay @ 0>/	ques cut 1
+xa?:y			xy		/<xy @ 0>/	ques cut 0
+xa?:a			xaaaay		/<xaa @ 0>	ques cut 2+
+xa?:a			xay		n		ques cut 1
+
+:ratchet xa*y			xaaaay		/<xaaaay @ 0>/	star ratchet 2+
+:ratchet xa*y			xay		/<xay @ 0>/	star ratchet 1
+:ratchet xa*y			xy		/<xy @ 0>/	star ratchet 0
+:ratchet xa*a			xaaaay		n		star ratchet 2+
+:ratchet xa*a			xay		n		star ratchet 1
+
+:ratchet xa+y			xaaaay		/<xaaaay @ 0>/	plus ratchet 2+
+:ratchet xa+y			xay		/<xay @ 0>/	plus ratchet 1
+:ratchet xa+y			xy		n		plus ratchet 0
+:ratchet xa+a			xaaaay		n		plus ratchet 2+
+:ratchet xa+a			xay		n		plus ratchet 1
+
+:ratchet xa?y			xaaaay		n		ques ratchet 2+
+:ratchet xa?y			xay		/<xay @ 0>/	ques ratchet 1
+:ratchet xa?y			xy		/<xy @ 0>/	ques ratchet 0
+:ratchet xa?a			xaaaay		/<xaa @ 0>	ques ratchet 2+
+:ratchet xa?a			xay		n		ques ratchet 1
+
+:ratchet xa*!y			xaaaay		/<xaaaay @ 0>/	star ratchet greedy 2+
+:ratchet xa*!y			xay		/<xay @ 0>/	star ratchet greedy 1
+:ratchet xa*!y			xy		/<xy @ 0>/	star ratchet greedy 0
+:ratchet xa*!a			xaaaay		/<xaaaa @ 0>/	star ratchet greedy 2+
+:ratchet xa*!a			xay		/<xa @ 0>/	star ratchet greedy 1
+
+:ratchet xa+!y			xaaaay		/<xaaaay @ 0>/	plus ratchet greedy 2+
+:ratchet xa+!y			xay		/<xay @ 0>/	plus ratchet greedy 1
+:ratchet xa+!y			xy		n		plus ratchet greedy 0
+:ratchet xa+!a			xaaaay		/<xaaaa @ 0>/	plus ratchet greedy 2+
+:ratchet xa+!a			xay		n		plus ratchet greedy 1
+
+:ratchet xa?!y			xaaaay		n		ques ratchet greedy 2+
+:ratchet xa?!y			xay		/<xay @ 0>/	ques ratchet greedy 1
+:ratchet xa?!y			xy		/<xy @ 0>/	ques ratchet greedy 0
+:ratchet xa?!a			xaaaay		/<xaa @ 0>	ques ratchet greedy 2+
+:ratchet xa?!a			xay		/<xa @ 0>	ques ratchet greedy 1
+
+
+## Quantifier bare range
+.**2			a			n	only one character
+.**2			ab			y	two characters
+a**2			foobar		n	only one "a" character
+a**2			baabaa		y	two "a" characters
+a**0..4			bbbbbbb		y	no "a" characters
+a**2..4			bababab		n	not two consecutive "a" characters
+a**2..4			baabbbb		y	two "a" characters
+a**2..4			baaabbb		y	three "a" characters
+a**2..4			baaaabb		y	four "a" characters
+a**2..4			baaaaaa		y	four "a" characters
+a**2..*			baaaaaa		y	six "a" characters
+a**?2..*		baaaaaa		y	two "a" characters (non-greedy)
+a**:?2..*		baaaaaa		y	two "a" characters (non-greedy)
+a**!2..*		baaaaaa		y	six "a" characters (explicit greed)
+a**:!2..*		baaaaaa		y	six "a" characters (explicit greed)
+a**?2..4		baaabbb		y	two "a" characters (non-greedy)
+a**:?2..4		baaabbb		y	two "a" characters (non-greedy)
+a**!2..4		baaabbb		y	three "a" characters (explicit greed)
+a**:!2..4		baaabbb		y	three "a" characters (explicit greed)
+
+^[\w+] ** \,$		foo,bar,baz	y	** with a term
+^[\w+] **? \, ....$	foo,bar,baz	y	**? with a term
+^[\w+] ** [\,\s*]$	foo, bar, baz	y	** with term + ws
+:sigspace ^[\w+] ** \, $	foo, bar ,baz	y	** under :sigspace
+:sigspace ^[\w+]** \, $	foo, bar ,baz	n	** under :sigspace w/o ws
+:sigspace ^[\w+]** \, $	foo,bar,baz	y	** under :sigspace w/o ws

Added: branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_subrules
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_subrules	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,67 @@
+##  builtin subrules
+
+<ident>			2+3 ab2		/mob<ident>: <ab2 @ 4>/		capturing builtin <ident>
+<name>			ab::cd::x3::42	/mob<name>: <ab::cd::x3 @ 0>/	capturing builtin <name>
+
+<.ident>			2+3 ab2		y		non-capturing builtin <.ident>
+<.name>			ab::cd::x3::42	y	non-capturing builtin <.name>
+
+<?wb>def		abc\ndef\n-==\nghi	y	word boundary \W\w
+abc<?wb>		abc\ndef\n-==\nghi	y	word boundary \w\W
+<?wb>abc		abc\ndef\n-==\nghi	y	BOS word boundary
+ghi<?wb>		abc\ndef\n-==\nghi	y	EOS word boundary
+a<?wb>			abc\ndef\n-==\nghi	n	\w\w word boundary
+\-<?wb>			abc\ndef\n-==\nghi	n	\W\W word boundary
+<!wb>def		abc\ndef\n-==\nghi	n	nonword boundary \W\w
+abc<!wb>		abc\ndef\n-==\nghi	n	nonword boundary \w\W
+<!wb>abc		abc\ndef\n-==\nghi	n	BOS nonword boundary
+ghi<!wb>		abc\ndef\n-==\nghi	n	EOS nonword boundary
+a<!wb>			abc\ndef\n-==\nghi	y	\w\w nonword boundary
+\-<!wb>			abc\ndef\n-==\nghi	y	\W\W nonword boundary
+
+<upper>		\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob<upper>: <A @ 45>/		<upper>
+<+upper>	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob: <A @ 45>/			<+upper>
+<+upper>+	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob: <ABCDEFGHIJ @ 45>/	<+upper>+
+<lower>		\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob<lower>: <a @ 55>/		<lower>
+<+lower>	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob: <a @ 55>/			<+lower>
+<+lower>+	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob: <abcdefghij @ 55>/	<+lower>+
+<alpha>		\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob<alpha>: <_ @ 31>/		<alpha>
+<+alpha>	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob: <_ @ 31>/			<+alpha>
+<+alpha>+	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob: <_ @ 31>/	<+alpha>+
+<digit>		\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob<digit>: <0 @ 35>/		<digit>
+<+digit>	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob: <0 @ 35>/			<+digit>
+<+digit>+	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob: <0123456789 @ 35>/	<+digit>+
+<xdigit>	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob<xdigit>: <0 @ 35>/		<xdigit>
+<+xdigit>	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob: <0 @ 35>/			<+xdigit>
+<+xdigit>+	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob: <0123456789ABCDEF @ 35>/	<+xdigit>+
+<space>		\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob<space>: <\t @ 0>/		<space>
+<+space>	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob: <\t @ 0>/		<+space>
+<+space>+	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob: <\t\n\r  @ 0>/		<+space>+
+<blank>		\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob<blank>: <\t @ 0>/		<blank>
+<+blank>	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob: <\t @ 0>/			<+blank>
+<+blank>+	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob: <\t @ 0>/			<+blank>+
+<cntrl>		\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob<cntrl>: <\t @ 0>/		<cntrl>
+<+cntrl>	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob: <\t @ 0>/			<+cntrl>
+<+cntrl>+	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob: <\t\n\r @ 0>/		<+cntrl>+
+<punct>		\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob<punct>: <! @ 4>/		<punct>
+<+punct>	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob: <! @ 4>/			<+punct>
+<+punct>+	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob: <!"#$%&/		<+punct>+
+<alnum>		\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob<alnum>: <0 @ 35>/		<alnum>
+<+alnum>	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob: <0 @ 35>/	<+alnum>
+<+alnum>+	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/mob: <0123456789ABCDEFGHIJabcdefghij @ 35>/	<+alnum>+
+<+alnum+[_]>	ident_1				y	union of character classes
+<+[ab]+[\-]>+	aaa-bbb				y	enumerated character classes
+<+  [ a  b ]+[\-]>+		aaa-bbb		y	whitespace is ignored within square brackets and after the initial +
+<+[ab]+[\-]>+	-ab-				y	enumerated character classes variant
+<+[ab]+[\-]>+	----				y	enumerated character classes variant
+<+[ab]+[\-]>+	-				y	enumerated character classes variant
+<-[ab]+[cd]>+	ccdd				y	enumerated character classes variant
+^<-[ab]+[cd]>+$	caad				n	enumerated character classes variant
+<-  [ a  b ]+[cd]>+	ccdd			y	whitespace is ignored within square brackets and after the initial -
+^<-upper>dent	ident_1				y	inverted character class
+^<-upper>dent	Ident_1				n	inverted character class
+<+alpha-[Jj]>+	abc				y	character class with no j
+<+ alpha - [ Jj ]>	abc			y	character class with no j with ws
+^<+alpha-[Jj]>+$	aJc			n	character class with no j fail
+
+## vim: noexpandtab tabstop=4 shiftwidth=4

Added: branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_syntax
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ext/nqp-rx/t/p6regex/rx_syntax	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,41 @@
+##  syntax errors
+
+{{		abcdef		/Missing closing braces/	unterminated closure
+\1		abcdef		/reserved/			back references
+\x[		abcdef		/Missing close bracket/		unterminated \x[..]
+\X[		abcdef		/Missing close bracket/		unterminated \X[..]
+
+* abc		abcdef		/Quantifier follows nothing/	bare * at start
+  * abc		abcdef		/Quantifier follows nothing/	bare * after ws
+[*|a]		abcdef		/Quantifier follows nothing/	bare * after [
+[ *|a]		abcdef		/Quantifier follows nothing/	bare * after [+sp
+[a|*]		abcdef		/Quantifier follows nothing/	bare * after |
+[a| *]		abcdef		/Quantifier follows nothing/	bare * after |+sp
+
++ abc		abcdef		/Quantifier follows nothing/	bare + at start
+  + abc		abcdef		/Quantifier follows nothing/	bare + after ws
+[+|a]		abcdef		/Quantifier follows nothing/	bare + after [
+[ +|a]		abcdef		/Quantifier follows nothing/	bare + after [+sp
+[a|+]		abcdef		/Quantifier follows nothing/	bare + after |
+[a| +]		abcdef		/Quantifier follows nothing/	bare + after |+sp
+
+? abc		abcdef		/Quantifier follows nothing/	bare ? at start
+  ? abc		abcdef		/Quantifier follows nothing/	bare ? after ws
+[?|a]		abcdef		/Quantifier follows nothing/	bare ? after [
+[ ?|a]		abcdef		/Quantifier follows nothing/	bare ? after [+sp
+[a|?]		abcdef		/Quantifier follows nothing/	bare ? after |
+[a| ?]		abcdef		/Quantifier follows nothing/	bare ? after |+sp
+
+: abc		abcdef		/Quantifier follows nothing/	bare : at start
+  : abc		abcdef		/Quantifier follows nothing/	bare : after ws
+[:|a]		abcdef		/Quantifier follows nothing/	bare : after [
+[ :|a]		abcdef		/Quantifier follows nothing/	bare : after [+sp
+[a|:]		abcdef		/Quantifier follows nothing/	bare : after |
+[a| :]		abcdef		/Quantifier follows nothing/	bare : after |+sp
+
+		abcdef		/Null pattern illegal/		null pattern
+  		abcdef		/Null pattern illegal/		ws null pattern
+
+  =abc		abcdef		/LHS of alias must be lvalue/	bare : after ws
+[ =a]		abcdef		/LHS of alias must be lvalue/	bare : after [+sp
+[a| =a]		abcdef		/LHS of alias must be lvalue/	bare : after |+sp

Modified: branches/orderedhash_revamp/include/parrot/call.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/call.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/call.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -16,654 +16,567 @@
 #ifndef PARROT_INTER_CALL_H_GUARD
 #define PARROT_INTER_CALL_H_GUARD
 
-typedef enum call_state_mode {
-    /* argument fetching/putting modes */
-    CALL_STATE_SIG     = 0x100, /* runops, nci. In case we're interfacing with
-                                   C and va_lists. */
-    CALL_STATE_OP      = 0x200, /* get_, set_ ops. In case we're interfacing
-                                   with Parrot code and get the signature from
-                                   call_state_item.u.op. */
-    CALL_S_D_MASK      = 0x300, /* src/dest mask */
-
-    CALL_STATE_FLATTEN = 0x400  /* whether we are busy in a :flat argument */
-} call_state_mode;
-
-typedef struct call_state_item {
-    /* We have one call_state_item for both the caller (source,
-       arguments/returns) and the callee (destination, parameters/results). */
-    int mode;                /* this specifies:
-                             - where we get our arguments from / where we put
-                               our parameters (from C code or from set_*,get_*)
-                             - if we're in the middle of a :flat */
-
-    union {
-        struct {             /* In case the caller (or callee? FIXME) is C */
-            void       *ap;  /* a ptr to va_list */
-            const char *sig; /* C string describing the type of each argument */
-        } sig;
-
-        struct {             /* In case the caller/callee was Parrot code: */
-            opcode_t *pc;    /* array of 'indexes' for each argument:
-                               - if it's a constant, the constant number
-                               - if it's a register, the register number */
-            PMC *signature;  /* a PMC array holding a Call_bits_enum_t
-                                signature for each argument */
-        } op;
-    } u;
-
-    Parrot_Context *ctx;     /* the source or destination context */
-    INTVAL used;             /* src: whether this argument has been consumed
-                              * (or: whether the previous arg has?) */
-    INTVAL i;                /* number of args/params already processed */
-    INTVAL n;                /* number of args/params to match.
-                              * may include :slurpys and :flats */
-    INTVAL sig;              /* type of current arg/param
-                              * (counting from 1, the i'th) */
-
-    /* We might encounter a :flat. */
-    /* FIXME bgeron: is this used for :slurpys?
-     * I can't find a reference in slurpy-filling code. */
-
-    PMC   *slurp;             /* PMC in which to put the args we slurp up
-                               * or source from where to flatten */
-    INTVAL slurp_i;           /* index of :flat/:slurpy arg/param to match */
-    INTVAL slurp_n;           /* number of :flat/:slurpy args/params to match */
-} call_state_item;
-
-typedef struct call_state {
-    call_state_item src;
-    call_state_item dest;
-    UnionVal val;
-    int n_actual_args;  /* arguments incl. flatten */
-    int optionals;      /* sum of optionals */
-    int params;         /* sum of params */
-    int first_named;    /* param idx of 1st named */
-    UINTVAL named_done; /* bit mask, 1 if named was assigned */
-    STRING *name;       /* name of argument if any */
-    PMC *key;           /* to iterate a flattening hash */
-} call_state;
-
-typedef enum arg_pass_t {
-    PARROT_PASS_PARAMS          = 0x00,
-    PARROT_PASS_RESULTS         = 0x01
-} arg_pass_t;
+#include "parrot/context.h"
+
+/* Wrap the jump buffer in a struct, to make it a linked list. Jump buffers are
+ * used to resume execution at a point in the runloop where an exception
+ * handler can be run. Ultimately this information should be part of
+ * Parrot_Context, but at this point a new context isn't created for every
+ * runloop ID, so it still needs to be a separate stack for a while longer. */
+
+typedef struct parrot_runloop_t {
+    struct parrot_runloop_t *prev;          /* interpreter's runloop
+                                             * jump buffer stack */
+    opcode_t                *handler_start; /* Used in exception handling */
+
+    /* let the biggest element cross the cacheline boundary */
+    Parrot_jump_buff         resume;        /* jmp_buf */
+} parrot_runloop_t;
+
+typedef parrot_runloop_t Parrot_runloop;
+
+typedef enum {
+    CALLSIGNATURE_is_exception_FLAG      = PObj_private0_FLAG /* last element */
+} callsignature_flags_enum;
+
+#define CALLSIGNATURE_get_FLAGS(o) (PObj_get_FLAGS(o))
+#define CALLSIGNATURE_flag_TEST(flag, o) (CALLSIGNATURE_get_FLAGS(o) & CALLSIGNATURE_ ## flag ## _FLAG)
+#define CALLSIGNATURE_flag_SET(flag, o) (CALLSIGNATURE_get_FLAGS(o) |= CALLSIGNATURE_ ## flag ## _FLAG)
+#define CALLSIGNATURE_flag_CLEAR(flag, o) (CALLSIGNATURE_get_FLAGS(o) &= ~(UINTVAL)(CALLSIGNATURE_ ## flag ## _FLAG))
+
+/* Mark if the CallSignature is for an exception handler */
+#define CALLSIGNATURE_is_exception_TEST(o)  CALLSIGNATURE_flag_TEST(is_exception, (o))
+#define CALLSIGNATURE_is_exception_SET(o)   CALLSIGNATURE_flag_SET(is_exception, (o))
+#define CALLSIGNATURE_is_exception_CLEAR(o) CALLSIGNATURE_flag_CLEAR(is_exception, (o))
 
 /* HEADERIZER BEGIN: src/call/pcc.c */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
 PARROT_EXPORT
-void Parrot_convert_arg(PARROT_INTERP, ARGMOD(call_state *st))
+INTVAL Parrot_pcc_do_run_ops(PARROT_INTERP, ARGIN(PMC *sub_obj))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*st);
+        __attribute__nonnull__(2);
 
 PARROT_EXPORT
-int Parrot_fetch_arg(PARROT_INTERP, ARGMOD(call_state *st))
+void Parrot_pcc_invoke_from_sig_object(PARROT_INTERP,
+    ARGIN(PMC *sub_obj),
+    ARGIN(PMC *call_object))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
-        FUNC_MODIFIES(*st);
+        __attribute__nonnull__(3);
 
 PARROT_EXPORT
-int Parrot_fetch_arg_nci(PARROT_INTERP, ARGMOD(call_state *st))
+void Parrot_pcc_invoke_method_from_c_args(PARROT_INTERP,
+    ARGIN(PMC* pmc),
+    ARGMOD(STRING *method_name),
+    ARGIN(const char *signature),
+    ...)
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
-        FUNC_MODIFIES(*st);
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4)
+        FUNC_MODIFIES(*method_name);
 
 PARROT_EXPORT
-int Parrot_init_arg_indexes_and_sig_pmc(PARROT_INTERP,
-    ARGIN(Parrot_Context *ctx),
-    ARGIN_NULLOK(opcode_t *indexes),
-    ARGIN_NULLOK(PMC *sig_pmc),
-    ARGMOD(call_state_item *sti))
+void Parrot_pcc_invoke_sub_from_c_args(PARROT_INTERP,
+    ARGIN(PMC *sub_obj),
+    ARGIN(const char *sig),
+    ...)
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
-        __attribute__nonnull__(5)
-        FUNC_MODIFIES(*sti);
+        __attribute__nonnull__(3);
 
 PARROT_EXPORT
-void Parrot_init_arg_nci(PARROT_INTERP,
-    ARGOUT(call_state *st),
-    ARGIN(const char *sig))
+void Parrot_PCCINVOKE(PARROT_INTERP,
+    ARGIN(PMC* pmc),
+    ARGMOD(STRING *method_name),
+    ARGIN(const char *signature),
+    ...)
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         __attribute__nonnull__(3)
-        FUNC_MODIFIES(*st);
+        __attribute__nonnull__(4)
+        FUNC_MODIFIES(*method_name);
+
+#define ASSERT_ARGS_Parrot_pcc_do_run_ops __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(sub_obj))
+#define ASSERT_ARGS_Parrot_pcc_invoke_from_sig_object \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(sub_obj) \
+    , PARROT_ASSERT_ARG(call_object))
+#define ASSERT_ARGS_Parrot_pcc_invoke_method_from_c_args \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc) \
+    , PARROT_ASSERT_ARG(method_name) \
+    , PARROT_ASSERT_ARG(signature))
+#define ASSERT_ARGS_Parrot_pcc_invoke_sub_from_c_args \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(sub_obj) \
+    , PARROT_ASSERT_ARG(sig))
+#define ASSERT_ARGS_Parrot_PCCINVOKE __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc) \
+    , PARROT_ASSERT_ARG(method_name) \
+    , PARROT_ASSERT_ARG(signature))
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+/* HEADERIZER END: src/call/pcc.c */
+
+/* HEADERIZER BEGIN: src/call/ops.c */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
 PARROT_EXPORT
-int Parrot_init_arg_op(PARROT_INTERP,
-    ARGIN(Parrot_Context *ctx),
-    ARGIN_NULLOK(opcode_t *pc),
-    ARGIN(call_state_item *sti))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(4);
+void free_runloop_jump_point(PARROT_INTERP)
+        __attribute__nonnull__(1);
 
 PARROT_EXPORT
-int Parrot_init_arg_sig(PARROT_INTERP,
-    ARGIN(Parrot_Context *ctx),
-    ARGIN(const char *sig),
-    ARGIN_NULLOK(void *ap),
-    ARGMOD(call_state_item *sti))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(5)
-        FUNC_MODIFIES(*sti);
+void new_runloop_jump_point(PARROT_INTERP)
+        __attribute__nonnull__(1);
+
+void destroy_runloop_jump_points(PARROT_INTERP)
+        __attribute__nonnull__(1);
+
+void really_destroy_runloop_jump_points(
+    ARGIN_NULLOK(Parrot_runloop *jump_point));
+
+void runops(PARROT_INTERP, size_t offs)
+        __attribute__nonnull__(1);
+
+#define ASSERT_ARGS_free_runloop_jump_point __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_new_runloop_jump_point __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_destroy_runloop_jump_points __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_really_destroy_runloop_jump_points \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_runops __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/call/ops.c */
+
+/* HEADERIZER BEGIN: src/call/args.c */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
 PARROT_EXPORT
-void Parrot_init_ret_nci(PARROT_INTERP,
-    ARGOUT(call_state *st),
-    ARGIN(const char *sig))
+void Parrot_pcc_append_result(PARROT_INTERP,
+    ARGIN(PMC *sig_object),
+    ARGIN(STRING *type),
+    ARGIN(void *result))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         __attribute__nonnull__(3)
-        FUNC_MODIFIES(*st);
+        __attribute__nonnull__(4);
 
 PARROT_EXPORT
-void parrot_pass_args(PARROT_INTERP,
-    ARGMOD(Parrot_Context *src_ctx),
-    ARGMOD(Parrot_Context *dest_ctx),
-    ARGMOD_NULLOK(opcode_t *src_indexes),
-    ARGMOD_NULLOK(opcode_t *dest_indexes),
-    arg_pass_t param_or_result)
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+PMC* Parrot_pcc_build_sig_object_from_op(PARROT_INTERP,
+    ARGIN_NULLOK(PMC *signature),
+    ARGIN(PMC * const raw_sig),
+    ARGIN(opcode_t * const raw_args))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
         __attribute__nonnull__(3)
-        FUNC_MODIFIES(*src_ctx)
-        FUNC_MODIFIES(*dest_ctx)
-        FUNC_MODIFIES(*src_indexes)
-        FUNC_MODIFIES(*dest_indexes);
+        __attribute__nonnull__(4);
 
 PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 PMC* Parrot_pcc_build_sig_object_from_varargs(PARROT_INTERP,
-    ARGIN_NULLOK(PMC* obj),
+    ARGIN_NULLOK(PMC *obj),
     ARGIN(const char *sig),
     va_list args)
         __attribute__nonnull__(1)
         __attribute__nonnull__(3);
 
 PARROT_EXPORT
-void Parrot_pcc_invoke_from_sig_object(PARROT_INTERP,
-    ARGIN(PMC *sub_obj),
-    ARGIN(PMC *sig_obj))
+PARROT_WARN_UNUSED_RESULT
+PARROT_CAN_RETURN_NULL
+PMC* Parrot_pcc_build_sig_object_returns_from_op(PARROT_INTERP,
+    ARGIN_NULLOK(PMC *signature),
+    ARGIN(PMC *raw_sig),
+    ARGIN(opcode_t *raw_args))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3);
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4);
 
 PARROT_EXPORT
-void Parrot_pcc_invoke_method_from_c_args(PARROT_INTERP,
-    ARGIN(PMC* pmc),
-    ARGMOD(STRING *method_name),
+void Parrot_pcc_fill_params_from_c_args(PARROT_INTERP,
+    ARGMOD(PMC *call_object),
     ARGIN(const char *signature),
     ...)
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        FUNC_MODIFIES(*method_name);
+        FUNC_MODIFIES(*call_object);
 
 PARROT_EXPORT
-void Parrot_pcc_invoke_sub_from_c_args(PARROT_INTERP,
-    ARGIN(PMC *sub_obj),
-    ARGIN(const char *sig),
-    ...)
+void Parrot_pcc_fill_params_from_op(PARROT_INTERP,
+    ARGMOD_NULLOK(PMC *call_object),
+    ARGIN(PMC *raw_sig),
+    ARGIN(opcode_t *raw_params))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3);
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4)
+        FUNC_MODIFIES(*call_object);
 
 PARROT_EXPORT
-void Parrot_PCCINVOKE(PARROT_INTERP,
-    ARGIN(PMC* pmc),
-    ARGMOD(STRING *method_name),
+void Parrot_pcc_fill_returns_from_c_args(PARROT_INTERP,
+    ARGMOD_NULLOK(PMC *call_object),
     ARGIN(const char *signature),
     ...)
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
         __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        FUNC_MODIFIES(*method_name);
+        FUNC_MODIFIES(*call_object);
 
 PARROT_EXPORT
-void Parrot_process_args(PARROT_INTERP,
-    ARGMOD(call_state *st),
-    arg_pass_t param_or_result)
+void Parrot_pcc_fill_returns_from_continuation(PARROT_INTERP,
+    ARGMOD_NULLOK(PMC *call_object),
+    ARGIN(PMC *raw_sig),
+    ARGIN(PMC *from_call_obj))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*st);
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4)
+        FUNC_MODIFIES(*call_object);
 
 PARROT_EXPORT
-int Parrot_store_arg(SHIM_INTERP, ARGIN(const call_state *st))
-        __attribute__nonnull__(2);
-
-PARROT_CANNOT_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-opcode_t * parrot_pass_args_fromc(PARROT_INTERP,
-    ARGIN(const char *sig),
-    ARGMOD(opcode_t *dest),
-    ARGIN(Parrot_Context *old_ctxp),
-    va_list ap)
+void Parrot_pcc_fill_returns_from_op(PARROT_INTERP,
+    ARGMOD_NULLOK(PMC *call_object),
+    ARGIN(PMC *raw_sig),
+    ARGIN(opcode_t *raw_returns))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
         __attribute__nonnull__(3)
         __attribute__nonnull__(4)
-        FUNC_MODIFIES(*dest);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-void * set_retval(PARROT_INTERP, int sig_ret, ARGIN(Parrot_Context *ctx))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3);
+        FUNC_MODIFIES(*call_object);
 
-FLOATVAL set_retval_f(PARROT_INTERP,
-    int sig_ret,
-    ARGIN(Parrot_Context *ctx))
+void Parrot_pcc_merge_signature_for_tailcall(PARROT_INTERP,
+    ARGMOD_NULLOK(PMC * parent),
+    ARGMOD_NULLOK(PMC * tailcall))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(3);
-
-INTVAL set_retval_i(PARROT_INTERP, int sig_ret, ARGIN(Parrot_Context *ctx))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3);
+        FUNC_MODIFIES(* parent)
+        FUNC_MODIFIES(* tailcall);
 
 PARROT_CAN_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-PMC* set_retval_p(PARROT_INTERP, int sig_ret, ARGIN(Parrot_Context *ctx))
+void Parrot_pcc_parse_signature_string(PARROT_INTERP,
+    ARGIN(STRING *signature),
+    ARGMOD(PMC **arg_flags),
+    ARGMOD(PMC **return_flags))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(3);
-
-PARROT_CAN_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-STRING* set_retval_s(PARROT_INTERP, int sig_ret, ARGIN(Parrot_Context *ctx))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3);
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4)
+        FUNC_MODIFIES(*arg_flags)
+        FUNC_MODIFIES(*return_flags);
 
-#define ASSERT_ARGS_Parrot_convert_arg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(st)
-#define ASSERT_ARGS_Parrot_fetch_arg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(st)
-#define ASSERT_ARGS_Parrot_fetch_arg_nci __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(st)
-#define ASSERT_ARGS_Parrot_init_arg_indexes_and_sig_pmc \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ctx) \
-    || PARROT_ASSERT_ARG(sti)
-#define ASSERT_ARGS_Parrot_init_arg_nci __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_pcc_append_result __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(st) \
-    || PARROT_ASSERT_ARG(sig)
-#define ASSERT_ARGS_Parrot_init_arg_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(sig_object) \
+    , PARROT_ASSERT_ARG(type) \
+    , PARROT_ASSERT_ARG(result))
+#define ASSERT_ARGS_Parrot_pcc_build_sig_object_from_op \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ctx) \
-    || PARROT_ASSERT_ARG(sti)
-#define ASSERT_ARGS_Parrot_init_arg_sig __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ctx) \
-    || PARROT_ASSERT_ARG(sig) \
-    || PARROT_ASSERT_ARG(sti)
-#define ASSERT_ARGS_Parrot_init_ret_nci __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(st) \
-    || PARROT_ASSERT_ARG(sig)
-#define ASSERT_ARGS_parrot_pass_args __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src_ctx) \
-    || PARROT_ASSERT_ARG(dest_ctx)
+    , PARROT_ASSERT_ARG(raw_sig) \
+    , PARROT_ASSERT_ARG(raw_args))
 #define ASSERT_ARGS_Parrot_pcc_build_sig_object_from_varargs \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sig)
-#define ASSERT_ARGS_Parrot_pcc_invoke_from_sig_object \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub_obj) \
-    || PARROT_ASSERT_ARG(sig_obj)
-#define ASSERT_ARGS_Parrot_pcc_invoke_method_from_c_args \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc) \
-    || PARROT_ASSERT_ARG(method_name) \
-    || PARROT_ASSERT_ARG(signature)
-#define ASSERT_ARGS_Parrot_pcc_invoke_sub_from_c_args \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub_obj) \
-    || PARROT_ASSERT_ARG(sig)
-#define ASSERT_ARGS_Parrot_PCCINVOKE __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc) \
-    || PARROT_ASSERT_ARG(method_name) \
-    || PARROT_ASSERT_ARG(signature)
-#define ASSERT_ARGS_Parrot_process_args __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(st)
-#define ASSERT_ARGS_Parrot_store_arg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(st)
-#define ASSERT_ARGS_parrot_pass_args_fromc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sig) \
-    || PARROT_ASSERT_ARG(dest) \
-    || PARROT_ASSERT_ARG(old_ctxp)
-#define ASSERT_ARGS_set_retval __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ctx)
-#define ASSERT_ARGS_set_retval_f __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ctx)
-#define ASSERT_ARGS_set_retval_i __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ctx)
-#define ASSERT_ARGS_set_retval_p __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ctx)
-#define ASSERT_ARGS_set_retval_s __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ctx)
+    , PARROT_ASSERT_ARG(sig))
+#define ASSERT_ARGS_Parrot_pcc_build_sig_object_returns_from_op \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(raw_sig) \
+    , PARROT_ASSERT_ARG(raw_args))
+#define ASSERT_ARGS_Parrot_pcc_fill_params_from_c_args \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(call_object) \
+    , PARROT_ASSERT_ARG(signature))
+#define ASSERT_ARGS_Parrot_pcc_fill_params_from_op \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(raw_sig) \
+    , PARROT_ASSERT_ARG(raw_params))
+#define ASSERT_ARGS_Parrot_pcc_fill_returns_from_c_args \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(signature))
+#define ASSERT_ARGS_Parrot_pcc_fill_returns_from_continuation \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(raw_sig) \
+    , PARROT_ASSERT_ARG(from_call_obj))
+#define ASSERT_ARGS_Parrot_pcc_fill_returns_from_op \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(raw_sig) \
+    , PARROT_ASSERT_ARG(raw_returns))
+#define ASSERT_ARGS_Parrot_pcc_merge_signature_for_tailcall \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_pcc_parse_signature_string \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(signature) \
+    , PARROT_ASSERT_ARG(arg_flags) \
+    , PARROT_ASSERT_ARG(return_flags))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: src/call/pcc.c */
+/* HEADERIZER END: src/call/args.c */
 
-/* HEADERIZER BEGIN: src/call/ops.c */
+#define ASSERT_SIG_PMC(sig) do {\
+    PARROT_ASSERT(!PMC_IS_NULL(sig)); \
+    PARROT_ASSERT(PObj_is_PMC_TEST(sig)); \
+    PARROT_ASSERT((sig)->vtable->base_type == enum_class_FixedIntegerArray); \
+} while (0)
+
+/* XXX Remove interp from this */
+#define ADD_OP_VAR_PART(interp, seg, pc, n) do { \
+    if (*(pc) == PARROT_OP_set_args_pc || \
+            *(pc) == PARROT_OP_get_results_pc || \
+            *(pc) == PARROT_OP_get_params_pc || \
+            *(pc) == PARROT_OP_set_returns_pc) { \
+        PMC * const sig = (seg)->const_table->constants[(pc)[1]]->u.key; \
+        (n) += VTABLE_elements((interp), sig); \
+    } \
+} while (0)
+
+/* Context manipulating functions */
+
+/* HEADERIZER BEGIN: src/call/context.c */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
 PARROT_EXPORT
-void free_runloop_jump_point(PARROT_INTERP)
+void Parrot_clear_i(PARROT_INTERP)
         __attribute__nonnull__(1);
 
 PARROT_EXPORT
-void new_runloop_jump_point(PARROT_INTERP)
+void Parrot_clear_n(PARROT_INTERP)
         __attribute__nonnull__(1);
 
 PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-PARROT_CAN_RETURN_NULL
-void * Parrot_run_meth_fromc(PARROT_INTERP,
-    ARGIN(PMC *sub),
-    ARGIN_NULLOK(PMC *obj),
-    SHIM(STRING *meth))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
+void Parrot_clear_p(PARROT_INTERP)
+        __attribute__nonnull__(1);
 
 PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-PARROT_CAN_RETURN_NULL
-void* Parrot_run_meth_fromc_arglist(PARROT_INTERP,
-    ARGIN(PMC *sub),
-    ARGIN_NULLOK(PMC *obj),
-    ARGIN(STRING *meth),
-    ARGIN(const char *sig),
-    va_list args)
+void Parrot_clear_s(PARROT_INTERP)
+        __attribute__nonnull__(1);
+
+PARROT_EXPORT
+PARROT_CANNOT_RETURN_NULL
+FLOATVAL * Parrot_pcc_get_FLOATVAL_reg(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    UINTVAL idx)
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(4)
-        __attribute__nonnull__(5);
+        __attribute__nonnull__(2);
 
 PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-FLOATVAL /*@alt void@*/
-Parrot_run_meth_fromc_arglist_retf(PARROT_INTERP,
-    ARGIN(PMC *sub),
-    ARGIN_NULLOK(PMC *obj),
-    ARGIN(STRING *meth),
-    ARGIN(const char *sig),
-    va_list args)
+PARROT_CANNOT_RETURN_NULL
+INTVAL * Parrot_pcc_get_INTVAL_reg(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    UINTVAL idx)
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(4)
-        __attribute__nonnull__(5);
+        __attribute__nonnull__(2);
 
 PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-PARROT_CAN_RETURN_NULL
-INTVAL /*@alt void@*/
-Parrot_run_meth_fromc_arglist_reti(PARROT_INTERP,
-    ARGIN(PMC *sub),
-    ARGIN_NULLOK(PMC *obj),
-    ARGIN(STRING *meth),
-    ARGIN(const char *sig),
-    va_list args)
+PARROT_CANNOT_RETURN_NULL
+PMC ** Parrot_pcc_get_PMC_reg(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL idx)
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(4)
-        __attribute__nonnull__(5);
+        __attribute__nonnull__(2);
 
 PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-PARROT_CAN_RETURN_NULL
-void* Parrot_run_meth_fromc_args(PARROT_INTERP,
-    ARGIN(PMC *sub),
-    ARGIN_NULLOK(PMC *obj),
-    ARGIN(STRING *meth),
-    ARGIN(const char *sig),
-    ...)
+PARROT_CANNOT_RETURN_NULL
+Regs_ni* Parrot_pcc_get_regs_ni(PARROT_INTERP, ARGIN(PMC *ctx))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(4)
-        __attribute__nonnull__(5);
+        __attribute__nonnull__(2);
 
 PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-FLOATVAL /*@alt void@*/
-Parrot_run_meth_fromc_args_retf(PARROT_INTERP,
-    ARGIN(PMC *sub),
-    ARGIN_NULLOK(PMC *obj),
-    ARGIN(STRING *meth),
-    ARGIN(const char *sig),
-    ...)
+PARROT_CANNOT_RETURN_NULL
+Regs_ps* Parrot_pcc_get_regs_ps(PARROT_INTERP, ARGIN(PMC *ctx))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(4)
-        __attribute__nonnull__(5);
+        __attribute__nonnull__(2);
 
 PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-INTVAL /*@alt void@*/
-Parrot_run_meth_fromc_args_reti(PARROT_INTERP,
-    ARGIN(PMC *sub),
-    ARGIN_NULLOK(PMC *obj),
-    ARGIN(STRING *meth),
-    ARGIN(const char *sig),
-    ...)
+UINTVAL Parrot_pcc_get_regs_used(PARROT_INTERP, ARGIN(PMC *ctx), int type)
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(4)
-        __attribute__nonnull__(5);
+        __attribute__nonnull__(2);
 
 PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
 PARROT_CANNOT_RETURN_NULL
-Parrot_Context * Parrot_runops_fromc(PARROT_INTERP, ARGIN(PMC *sub))
+STRING ** Parrot_pcc_get_STRING_reg(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    UINTVAL idx)
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
 PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
 PARROT_CAN_RETURN_NULL
-void * Parrot_runops_fromc_arglist(PARROT_INTERP,
-    ARGIN(PMC *sub),
-    ARGIN(const char *sig),
-    va_list args)
+PMC* Parrot_pcc_get_sub(PARROT_INTERP, ARGIN(PMC *ctx))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3);
+        __attribute__nonnull__(2);
 
 PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-FLOATVAL /*@alt void@*/
-Parrot_runops_fromc_arglist_retf(PARROT_INTERP,
-    ARGIN(PMC *sub),
-    ARGIN(const char *sig),
-    va_list args)
+PARROT_CANNOT_RETURN_NULL
+void Parrot_pcc_set_regs_ni(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    ARGIN(Regs_ni *bp))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         __attribute__nonnull__(3);
 
 PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-INTVAL /*@alt void@*/
-Parrot_runops_fromc_arglist_reti(PARROT_INTERP,
-    ARGIN(PMC *sub),
-    ARGIN(const char *sig),
-    va_list args)
+PARROT_CANNOT_RETURN_NULL
+void Parrot_pcc_set_regs_ps(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    ARGIN(Regs_ps *bp_ps))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         __attribute__nonnull__(3);
 
 PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-PARROT_CAN_RETURN_NULL
-PMC * Parrot_runops_fromc_args(PARROT_INTERP,
-    ARGIN(PMC *sub),
-    ARGIN(const char *sig),
-    ...)
+void Parrot_pcc_set_regs_used(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    int type,
+    INTVAL num)
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3);
+        __attribute__nonnull__(2);
 
 PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-PARROT_CAN_RETURN_NULL
-void * Parrot_runops_fromc_args_event(PARROT_INTERP,
-    ARGIN(PMC *sub),
-    ARGIN(const char *sig),
-    ...)
+void Parrot_pcc_set_sub(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    ARGIN_NULLOK(PMC *sub))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3);
+        __attribute__nonnull__(2);
 
 PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-FLOATVAL /*@alt void@*/
-Parrot_runops_fromc_args_retf(PARROT_INTERP,
-    ARGIN(PMC *sub),
-    ARGIN(const char *sig),
-    ...)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3);
+void Parrot_pop_context(PARROT_INTERP)
+        __attribute__nonnull__(1);
 
 PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-INTVAL /*@alt void@*/
-Parrot_runops_fromc_args_reti(PARROT_INTERP,
-    ARGIN(PMC *sub),
-    ARGIN(const char *sig),
-    ...)
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+PMC * Parrot_push_context(PARROT_INTERP, ARGIN(const UINTVAL *n_regs_used))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3);
+        __attribute__nonnull__(2);
 
-void destroy_runloop_jump_points(PARROT_INTERP)
+void create_initial_context(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-void really_destroy_runloop_jump_points(
-    ARGIN_NULLOK(Parrot_runloop *jump_point));
+PARROT_CANNOT_RETURN_NULL
+PARROT_WARN_UNUSED_RESULT
+PMC * Parrot_alloc_context(PARROT_INTERP,
+    ARGIN(const UINTVAL *number_regs_used),
+    ARGIN_NULLOK(PMC *old))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
-void runops(PARROT_INTERP, size_t offs)
+PARROT_CANNOT_RETURN_NULL
+PARROT_WARN_UNUSED_RESULT
+PMC * Parrot_pcc_allocate_empty_context(PARROT_INTERP,
+    ARGIN_NULLOK(PMC *old))
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_free_runloop_jump_point __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_new_runloop_jump_point __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_run_meth_fromc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub)
-#define ASSERT_ARGS_Parrot_run_meth_fromc_arglist __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub) \
-    || PARROT_ASSERT_ARG(meth) \
-    || PARROT_ASSERT_ARG(sig)
-#define ASSERT_ARGS_Parrot_run_meth_fromc_arglist_retf \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub) \
-    || PARROT_ASSERT_ARG(meth) \
-    || PARROT_ASSERT_ARG(sig)
-#define ASSERT_ARGS_Parrot_run_meth_fromc_arglist_reti \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub) \
-    || PARROT_ASSERT_ARG(meth) \
-    || PARROT_ASSERT_ARG(sig)
-#define ASSERT_ARGS_Parrot_run_meth_fromc_args __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub) \
-    || PARROT_ASSERT_ARG(meth) \
-    || PARROT_ASSERT_ARG(sig)
-#define ASSERT_ARGS_Parrot_run_meth_fromc_args_retf \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub) \
-    || PARROT_ASSERT_ARG(meth) \
-    || PARROT_ASSERT_ARG(sig)
-#define ASSERT_ARGS_Parrot_run_meth_fromc_args_reti \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub) \
-    || PARROT_ASSERT_ARG(meth) \
-    || PARROT_ASSERT_ARG(sig)
-#define ASSERT_ARGS_Parrot_runops_fromc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub)
-#define ASSERT_ARGS_Parrot_runops_fromc_arglist __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub) \
-    || PARROT_ASSERT_ARG(sig)
-#define ASSERT_ARGS_Parrot_runops_fromc_arglist_retf \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub) \
-    || PARROT_ASSERT_ARG(sig)
-#define ASSERT_ARGS_Parrot_runops_fromc_arglist_reti \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub) \
-    || PARROT_ASSERT_ARG(sig)
-#define ASSERT_ARGS_Parrot_runops_fromc_args __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub) \
-    || PARROT_ASSERT_ARG(sig)
-#define ASSERT_ARGS_Parrot_runops_fromc_args_event \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub) \
-    || PARROT_ASSERT_ARG(sig)
-#define ASSERT_ARGS_Parrot_runops_fromc_args_retf __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub) \
-    || PARROT_ASSERT_ARG(sig)
-#define ASSERT_ARGS_Parrot_runops_fromc_args_reti __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub) \
-    || PARROT_ASSERT_ARG(sig)
-#define ASSERT_ARGS_destroy_runloop_jump_points __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_really_destroy_runloop_jump_points \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_runops __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/call/ops.c */
+void Parrot_pcc_allocate_registers(PARROT_INTERP,
+    ARGIN(PMC *pmcctx),
+    ARGIN(const UINTVAL *number_regs_used))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
 
-#define ASSERT_SIG_PMC(sig) \
-    PARROT_ASSERT(PObj_is_PMC_TEST(sig)); \
-    PARROT_ASSERT((sig)->vtable->base_type == enum_class_FixedIntegerArray)
+void Parrot_pcc_free_registers(PARROT_INTERP, ARGIN(PMC *pmcctx))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
-/* XXX Remove interp from this */
-#define ADD_OP_VAR_PART(interp, seg, pc, n) do { \
-    if (*(pc) == PARROT_OP_set_args_pc || \
-            *(pc) == PARROT_OP_get_results_pc || \
-            *(pc) == PARROT_OP_get_params_pc || \
-            *(pc) == PARROT_OP_set_returns_pc) { \
-        PMC * const sig = (seg)->const_table->constants[(pc)[1]]->u.key; \
-        (n) += VTABLE_elements((interp), sig); \
-    } \
-} while (0)
+PARROT_CANNOT_RETURN_NULL
+PMC * Parrot_pcc_init_context(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    ARGIN_NULLOK(PMC *old))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
+PARROT_CANNOT_RETURN_NULL
+PARROT_WARN_UNUSED_RESULT
+PMC * Parrot_set_new_context(PARROT_INTERP,
+    ARGIN(const UINTVAL *number_regs_used))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+#define ASSERT_ARGS_Parrot_clear_i __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_clear_n __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_clear_p __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_clear_s __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_pcc_get_FLOATVAL_reg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_INTVAL_reg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_PMC_reg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_regs_ni __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_regs_ps __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_regs_used __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_STRING_reg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_set_regs_ni __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx) \
+    , PARROT_ASSERT_ARG(bp))
+#define ASSERT_ARGS_Parrot_pcc_set_regs_ps __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx) \
+    , PARROT_ASSERT_ARG(bp_ps))
+#define ASSERT_ARGS_Parrot_pcc_set_regs_used __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_set_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pop_context __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_push_context __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(n_regs_used))
+#define ASSERT_ARGS_create_initial_context __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_alloc_context __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(number_regs_used))
+#define ASSERT_ARGS_Parrot_pcc_allocate_empty_context \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_pcc_allocate_registers __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmcctx) \
+    , PARROT_ASSERT_ARG(number_regs_used))
+#define ASSERT_ARGS_Parrot_pcc_free_registers __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmcctx))
+#define ASSERT_ARGS_Parrot_pcc_init_context __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_set_new_context __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(number_regs_used))
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+/* HEADERIZER END: src/call/context.c */
 
 #endif /* PARROT_INTER_CALL_H_GUARD */
 

Modified: branches/orderedhash_revamp/include/parrot/charset.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/charset.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/charset.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -167,39 +167,39 @@
         __attribute__nonnull__(3)
         __attribute__nonnull__(4);
 
-#define ASSERT_ARGS_Parrot_charset_c_name __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_charset_name __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_charset_number __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_charset_c_name __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_charset_name __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_charset_number __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(charsetname)
-#define ASSERT_ARGS_Parrot_charset_number_of_str __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(src)
+    , PARROT_ASSERT_ARG(charsetname))
+#define ASSERT_ARGS_Parrot_charset_number_of_str __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(src))
 #define ASSERT_ARGS_Parrot_charsets_encodings_deinit \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
 #define ASSERT_ARGS_Parrot_charsets_encodings_init \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_default_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_find_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(charsetname)
-#define ASSERT_ARGS_Parrot_find_charset_converter __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_default_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_find_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(charsetname))
+#define ASSERT_ARGS_Parrot_find_charset_converter __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(lhs) \
-    || PARROT_ASSERT_ARG(rhs)
-#define ASSERT_ARGS_Parrot_get_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_load_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(rhs))
+#define ASSERT_ARGS_Parrot_get_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_load_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(charsetname)
-#define ASSERT_ARGS_Parrot_make_default_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(charset)
-#define ASSERT_ARGS_Parrot_new_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_register_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(charsetname))
+#define ASSERT_ARGS_Parrot_make_default_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(charset))
+#define ASSERT_ARGS_Parrot_new_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_register_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(charsetname) \
-    || PARROT_ASSERT_ARG(charset)
+    , PARROT_ASSERT_ARG(charset))
 #define ASSERT_ARGS_Parrot_register_charset_converter \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(lhs) \
-    || PARROT_ASSERT_ARG(rhs) \
-    || PARROT_ASSERT_ARG(func)
+    , PARROT_ASSERT_ARG(rhs) \
+    , PARROT_ASSERT_ARG(func))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/string/charset.c */
 
@@ -244,7 +244,7 @@
 #define CHARSET_COMPARE(interp, lhs, rhs) ((const CHARSET *)(lhs)->charset)->compare((interp), (lhs), (rhs))
 #define CHARSET_INDEX(interp, source, search, offset) ((source)->charset)->index((interp), (source), (search), (offset))
 #define CHARSET_RINDEX(interp, source, search, offset) ((source)->charset)->rindex((interp), (source), (search), (offset))
-#define CHARSET_VALIDATE(interp, source, offset) ((source)->charset)->validate((interp), (source))
+#define CHARSET_VALIDATE(interp, source) ((source)->charset)->validate((interp), (source))
 #define CHARSET_IS_CCLASS(interp, flags, source, offset) ((source)->charset)->is_cclass((interp), (flags), (source), (offset))
 #define CHARSET_FIND_CCLASS(interp, flags, source, offset, count) ((source)->charset)->find_cclass((interp), (flags), (source), (offset), (count))
 #define CHARSET_FIND_NOT_CCLASS(interp, flags, source, offset, count) ((source)->charset)->find_not_cclass((interp), (flags), (source), (offset), (count))

Modified: branches/orderedhash_revamp/include/parrot/compiler.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/compiler.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/compiler.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -40,7 +40,11 @@
 #  ifdef _MSC_VER
 #    define __attribute__noreturn__         __declspec(noreturn)
 #  else
-#    define __attribute__noreturn__         __attribute__((__noreturn__))
+#    ifdef __clang__
+#      define __attribute__noreturn__         __attribute__((analyzer_noreturn))
+#    else
+#      define __attribute__noreturn__         __attribute__((__noreturn__))
+#    endif
 #  endif
 #endif
 #ifdef HASATTRIBUTE_PURE
@@ -99,14 +103,21 @@
  */
 #define UNUSED(a) /*@-noeffect*/if (0) (void)(a)/*@=noeffect*/;
 
-#ifdef PARROT_HAS_MSVC_SAL
+#ifdef PARROT_HAS_HEADER_SAL
+/*
+ * Microsoft provides two annotations mechanisms.  __declspec, which has been
+ * around for a while, and Microsoft's standard source code annotation
+ * language (SAL), introduced with Visual C++ 8.0.
+ * See <http://msdn2.microsoft.com/en-us/library/ms235402(VS.80).aspx>,
+ * <http://msdn2.microsoft.com/en-us/library/dabb5z75(VS.80).aspx>.
+ */
 #  include <sal.h>
 #  define PARROT_CAN_RETURN_NULL      /*@null@*/ __maybenull
 #  define PARROT_CANNOT_RETURN_NULL   /*@notnull@*/ __notnull
 #else
 #  define PARROT_CAN_RETURN_NULL      /*@null@*/
 #  define PARROT_CANNOT_RETURN_NULL   /*@notnull@*/
-#endif
+#endif /* PARROT_HAS_HEADER_SAL */
 
 #define PARROT_DEPRECATED           __attribute__deprecated__
 
@@ -131,7 +142,7 @@
 /* Function argument instrumentation */
 /* For explanations of the annotations, see http://www.splint.org/manual/manual.html */
 
-#ifdef PARROT_HAS_MSVC_SAL
+#ifdef PARROT_HAS_HEADER_SAL
 #  define NOTNULL(x)                  /*@notnull@*/ __notnull x
     /* The pointer passed may not be NULL */
 

Added: branches/orderedhash_revamp/include/parrot/context.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/include/parrot/context.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,704 @@
+/* context.h
+ *  Copyright (C) 2009, Parrot Foundation.
+ *  SVN Info
+ *     $Id$
+ *  Overview:
+ *     Context
+ */
+
+#ifndef PARROT_CONTEXT_H_GUARD
+#define PARROT_CONTEXT_H_GUARD
+
+#include "parrot/string.h"
+#include "parrot/compiler.h"
+
+struct PackFile_Constant;
+
+typedef union {
+    PMC         **regs_p;
+    STRING      **regs_s;
+} Regs_ps;
+
+typedef union {
+    FLOATVAL     *regs_n;
+    INTVAL       *regs_i;
+} Regs_ni;
+
+#include "pmc/pmc_callcontext.h"
+typedef struct Parrot_CallContext_attributes Parrot_Context;
+
+/*
+ * Macros to make accessing registers more convenient/readable.
+ */
+
+#ifndef NDEBUG
+
+#  define CTX_REG_NUM(p, x) (*Parrot_pcc_get_FLOATVAL_reg(interp, (p), (x)))
+#  define CTX_REG_INT(p, x) (*Parrot_pcc_get_INTVAL_reg(interp, (p), (x)))
+#  define CTX_REG_PMC(p, x) (*Parrot_pcc_get_PMC_reg(interp, (p), (x)))
+#  define CTX_REG_STR(p, x) (*Parrot_pcc_get_STRING_reg(interp, (p), (x)))
+
+#  define REG_NUM(interp, x) (*Parrot_pcc_get_FLOATVAL_reg((interp), (interp)->ctx, (x)))
+#  define REG_INT(interp, x) (*Parrot_pcc_get_INTVAL_reg((interp), (interp)->ctx, (x)))
+#  define REG_PMC(interp, x) (*Parrot_pcc_get_PMC_reg((interp), (interp)->ctx, (x)))
+#  define REG_STR(interp, x) (*Parrot_pcc_get_STRING_reg((interp), (interp)->ctx, (x)))
+
+#else /* NDEBUG */
+
+/* Manually inlined macros. Used in optimised builds */
+
+#  define __C(c) (PMC_data_typed((c), Parrot_Context*))
+
+#  define CTX_REG_NUM(p, x) (__C(p)->bp.regs_n[-1L - (x)])
+#  define CTX_REG_INT(p, x) (__C(p)->bp.regs_i[(x)])
+#  define CTX_REG_PMC(p, x) (__C(p)->bp_ps.regs_p[-1L - (x)])
+#  define CTX_REG_STR(p, x) (__C(p)->bp_ps.regs_s[(x)])
+
+#  define REG_NUM(interp, x) CTX_REG_NUM((interp)->ctx, (x))
+#  define REG_INT(interp, x) CTX_REG_INT((interp)->ctx, (x))
+#  define REG_PMC(interp, x) CTX_REG_PMC((interp)->ctx, (x))
+#  define REG_STR(interp, x) CTX_REG_STR((interp)->ctx, (x))
+
+#endif
+
+/*
+ * and a set of macros to access a register by offset, used
+ * in JIT emit prederef code
+ * The offsets are relative to interp->ctx.bp.
+ *
+ * Reg order in imcc/reg_alloc.c is "INSP"   TODO make defines
+ */
+
+#define REGNO_INT 0
+#define REGNO_NUM 1
+#define REGNO_STR 2
+#define REGNO_PMC 3
+
+#define __CTX Parrot_pcc_get_context_struct(interp, interp->ctx)
+#define _SIZEOF_INTS    (sizeof (INTVAL) * __CTX->n_regs_used[REGNO_INT])
+#define _SIZEOF_NUMS    (sizeof (FLOATVAL) * __CTX->n_regs_used[REGNO_NUM])
+#define _SIZEOF_PMCS    (sizeof (PMC*) * __CTX->n_regs_used[REGNO_PMC])
+#define _SIZEOF_STRS    (sizeof (STRING*) * __CTX->n_regs_used[REGNO_STR])
+
+#define REG_OFFS_NUM(x) (sizeof (FLOATVAL) * (-1L - (x)))
+#define REG_OFFS_INT(x) (sizeof (INTVAL) * (x))
+#define REG_OFFS_PMC(x) (_SIZEOF_INTS + sizeof (PMC*) * \
+        (__CTX->n_regs_used[REGNO_PMC] - 1L - (x)))
+#define REG_OFFS_STR(x) (sizeof (STRING*) * (x) + _SIZEOF_INTS + _SIZEOF_PMCS)
+
+
+/* Context accessors functions */
+
+/*
+ * For optimised builds we provide macros which directly poke into
+ * Parrot_Context.
+ */
+
+/* HEADERIZER BEGIN: src/call/context_accessors.c */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+
+PARROT_EXPORT
+UINTVAL Parrot_pcc_dec_recursion_depth_func(PARROT_INTERP, ARGIN(PMC *ctx))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+void Parrot_pcc_errors_off_func(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    UINTVAL flags)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+void Parrot_pcc_errors_on_func(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    UINTVAL flags)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+UINTVAL Parrot_pcc_errors_test_func(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    UINTVAL flags)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+PMC* Parrot_pcc_get_caller_ctx_func(PARROT_INTERP, ARGIN(PMC *ctx))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+PARROT_CANNOT_RETURN_NULL
+struct PackFile_Constant ** Parrot_pcc_get_constants_func(PARROT_INTERP,
+    ARGIN(PMC *ctx))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+Parrot_Context* Parrot_pcc_get_context_struct_func(PARROT_INTERP,
+    ARGIN_NULLOK(PMC *ctx))
+        __attribute__nonnull__(1);
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+PMC* Parrot_pcc_get_continuation_func(PARROT_INTERP, ARGIN(PMC *ctx))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+PMC* Parrot_pcc_get_handlers_func(PARROT_INTERP, ARGIN(PMC *ctx))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+INTVAL Parrot_pcc_get_HLL_func(PARROT_INTERP, ARGIN(PMC *ctx))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+INTVAL Parrot_pcc_get_int_constant_func(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    INTVAL idx)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+PARROT_CANNOT_RETURN_NULL
+PMC* Parrot_pcc_get_lex_pad_func(PARROT_INTERP, ARGIN(PMC *ctx))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+PMC* Parrot_pcc_get_namespace_func(PARROT_INTERP, ARGIN(PMC *ctx))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+FLOATVAL Parrot_pcc_get_num_constant_func(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    INTVAL idx)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+PMC* Parrot_pcc_get_object_func(PARROT_INTERP, ARGIN(PMC *ctx))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+PMC* Parrot_pcc_get_outer_ctx_func(PARROT_INTERP, ARGIN(PMC *ctx))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+opcode_t* Parrot_pcc_get_pc_func(PARROT_INTERP, ARGIN(PMC *ctx))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+PMC* Parrot_pcc_get_pmc_constant_func(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    INTVAL idx)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+size_t Parrot_pcc_get_pred_offset_func(PARROT_INTERP, ARGIN(PMC *ctx))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+UINTVAL Parrot_pcc_get_recursion_depth_func(PARROT_INTERP, ARGIN(PMC *ctx))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+opcode_t* Parrot_pcc_get_results_func(PARROT_INTERP, ARGIN(PMC *ctx))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+PMC* Parrot_pcc_get_results_signature_func(PARROT_INTERP, ARGIN(PMC *ctx))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+PMC* Parrot_pcc_get_signature_func(PARROT_INTERP, ARGIN(PMC *ctx))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+STRING* Parrot_pcc_get_string_constant_func(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    INTVAL idx)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+UINTVAL Parrot_pcc_inc_recursion_depth_func(PARROT_INTERP, ARGIN(PMC *ctx))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+void Parrot_pcc_set_caller_ctx_func(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    ARGIN(PMC *caller_ctx))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+void Parrot_pcc_set_constants_func(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    ARGIN_NULLOK(struct PackFile_Constant **constants))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+void Parrot_pcc_set_continuation_func(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    ARGIN_NULLOK(PMC *_continuation))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+void Parrot_pcc_set_handlers_func(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    ARGIN(PMC *handlers))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
+
+PARROT_EXPORT
+void Parrot_pcc_set_HLL_func(PARROT_INTERP, ARGIN(PMC *ctx), INTVAL hll)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+void Parrot_pcc_set_lex_pad_func(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    ARGIN(PMC *lex_pad))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
+
+PARROT_EXPORT
+void Parrot_pcc_set_namespace_func(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    ARGIN_NULLOK(PMC *_namespace))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+void Parrot_pcc_set_object_func(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    ARGIN_NULLOK(PMC *object))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+void Parrot_pcc_set_outer_ctx_func(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    ARGIN(PMC *outer_ctx))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
+
+PARROT_EXPORT
+void Parrot_pcc_set_pc_func(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    ARGIN_NULLOK(opcode_t *pc))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+void Parrot_pcc_set_pred_offset_func(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    size_t pred_offset)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+void Parrot_pcc_set_results_func(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    ARGIN_NULLOK(opcode_t *pc))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+void Parrot_pcc_set_results_signature_func(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    ARGIN_NULLOK(PMC *sig))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+void Parrot_pcc_set_signature_func(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    ARGIN_NULLOK(PMC *sig_object))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+void Parrot_pcc_trace_flags_off_func(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    UINTVAL flags)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+void Parrot_pcc_trace_flags_on_func(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    UINTVAL flags)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+UINTVAL Parrot_pcc_trace_flags_test_func(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    UINTVAL flags)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+void Parrot_pcc_warnings_off_func(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    UINTVAL flags)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+UINTVAL Parrot_pcc_warnings_on_func(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    UINTVAL flags)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+UINTVAL Parrot_pcc_warnings_test_func(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    UINTVAL flags)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+#define ASSERT_ARGS_Parrot_pcc_dec_recursion_depth_func \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_errors_off_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_errors_on_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_errors_test_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_caller_ctx_func \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_constants_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_context_struct_func \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_pcc_get_continuation_func \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_handlers_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_HLL_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_int_constant_func \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_lex_pad_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_namespace_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_num_constant_func \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_object_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_outer_ctx_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_pc_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_pmc_constant_func \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_pred_offset_func \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_recursion_depth_func \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_results_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_results_signature_func \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_signature_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_string_constant_func \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_inc_recursion_depth_func \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_set_caller_ctx_func \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx) \
+    , PARROT_ASSERT_ARG(caller_ctx))
+#define ASSERT_ARGS_Parrot_pcc_set_constants_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_set_continuation_func \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_set_handlers_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx) \
+    , PARROT_ASSERT_ARG(handlers))
+#define ASSERT_ARGS_Parrot_pcc_set_HLL_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_set_lex_pad_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx) \
+    , PARROT_ASSERT_ARG(lex_pad))
+#define ASSERT_ARGS_Parrot_pcc_set_namespace_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_set_object_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_set_outer_ctx_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx) \
+    , PARROT_ASSERT_ARG(outer_ctx))
+#define ASSERT_ARGS_Parrot_pcc_set_pc_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_set_pred_offset_func \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_set_results_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_set_results_signature_func \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_set_signature_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_trace_flags_off_func \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_trace_flags_on_func \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_trace_flags_test_func \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_warnings_off_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_warnings_on_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_warnings_test_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+/* HEADERIZER END: src/call/context_accessors.c */
+
+/* Map Context manipulating functions to functions or macros */
+#ifdef NDEBUG
+#  define Parrot_pcc_get_context_struct(i, c) (PMC_data_typed((c), Parrot_Context*))
+
+#  define Parrot_pcc_get_constants(i, c) (__C(c)->constants)
+#  define Parrot_pcc_set_constants(i, c, value) (__C(c)->constants = (value))
+
+#  define Parrot_pcc_get_continuation(i, c) (__C(c)->current_cont)
+#  define Parrot_pcc_set_continuation(i, c, value) (__C(c)->current_cont = (value))
+
+#  define Parrot_pcc_get_results(i, c) (__C(c)->current_results)
+#  define Parrot_pcc_set_results(i, c, value) (__C(c)->current_results = (value))
+
+#  define Parrot_pcc_get_caller_ctx(i, c) (__C(c)->caller_ctx)
+#  define Parrot_pcc_set_caller_ctx(i, c, value) (__C(c)->caller_ctx = (value))
+
+#  define Parrot_pcc_get_results_signature(i, c) (__C(c)->results_signature)
+#  define Parrot_pcc_set_results_signature(i, c, value) (__C(c)->results_signature = (value))
+
+#  define Parrot_pcc_get_namespace(i, c) (__C(c)->current_namespace)
+#  define Parrot_pcc_set_namespace(i, c, value) (__C(c)->current_namespace = (value))
+
+#  define Parrot_pcc_get_pred_offset(i, c) (__C(c)->pred_offset)
+#  define Parrot_pcc_set_pred_offset(i, c, value) (__C(c)->pred_offset = (value))
+
+#  define Parrot_pcc_get_pc(i, c) (__C(c)->current_pc)
+#  define Parrot_pcc_set_pc(i, c, value) (__C(c)->current_pc = (value))
+
+#  define Parrot_pcc_get_HLL(i, c) (__C(c)->current_HLL)
+#  define Parrot_pcc_set_HLL(i, c, value) (__C(c)->current_HLL = (value))
+
+#  define Parrot_pcc_get_object(i, c) (__C(c)->current_object)
+#  define Parrot_pcc_set_object(i, c, value) (__C(c)->current_object = (value))
+
+#  define Parrot_pcc_get_lex_pad(i, c) (__C(c)->lex_pad)
+#  define Parrot_pcc_set_lex_pad(i, c, value) (__C(c)->lex_pad = (value))
+
+#  define Parrot_pcc_get_handlers(i, c) (__C(c)->handlers)
+#  define Parrot_pcc_set_handlers(i, c, value) (__C(c)->handlers = (value))
+
+#  define Parrot_pcc_get_outer_ctx(i, c) (__C(c)->outer_ctx)
+#  define Parrot_pcc_set_outer_ctx(i, c, value) (__C(c)->outer_ctx = (value))
+
+#  define Parrot_pcc_get_signature(i, c) (__C(c)->current_sig)
+#  define Parrot_pcc_set_signature(i, c, value) (__C(c)->current_sig = (value))
+
+#  define Parrot_pcc_get_int_constant(i, c, idx) (__C(c)->constants[(idx)]->u.integer)
+#  define Parrot_pcc_get_num_constant(i, c, idx) (__C(c)->constants[(idx)]->u.number)
+#  define Parrot_pcc_get_string_constant(i, c, idx) (__C(c)->constants[(idx)]->u.string)
+#  define Parrot_pcc_get_pmc_constant(i, c, idx) (__C(c)->constants[(idx)]->u.key)
+
+#  define Parrot_pcc_get_recursion_depth(i, c) (__C(c)->recursion_depth)
+#  define Parrot_pcc_dec_recursion_depth(i, c) (--__C(c)->recursion_depth)
+#  define Parrot_pcc_inc_recursion_depth(i, c) (__C(c)->recursion_depth++)
+
+#  define Parrot_pcc_warnings_on(i, c, flags)   (__C(c)->warns |= (flags))
+#  define Parrot_pcc_warnings_off(i, c, flags)  (__C(c)->warns &= ~(flags))
+#  define Parrot_pcc_warnings_test(i, c, flags) (__C(c)->warns & (flags))
+
+#  define Parrot_pcc_errors_on(i, c, flags)     (__C(c)->errors |= (flags))
+#  define Parrot_pcc_errors_off(i, c, flags)    (__C(c)->errors &= ~(flags))
+#  define Parrot_pcc_errors_test(i, c, flags)   (__C(c)->errors & (flags))
+
+#  define Parrot_pcc_trace_flags_on(i, c, flags)     (__C(c)->trace_flags |= (flags))
+#  define Parrot_pcc_trace_flags_off(i, c, flags)    (__C(c)->trace_flags &= ~(flags))
+#  define Parrot_pcc_trace_flags_test(i, c, flags)   (__C(c)->trace_flags & (flags))
+
+#else
+
+#  define Parrot_pcc_get_context_struct(i, c) Parrot_pcc_get_context_struct_func((i), (c))
+
+#  define Parrot_pcc_get_constants(i, c) Parrot_pcc_get_constants_func((i), (c))
+#  define Parrot_pcc_set_constants(i, c, value) Parrot_pcc_set_constants_func((i), (c), (value))
+
+#  define Parrot_pcc_get_continuation(i, c) Parrot_pcc_get_continuation_func((i), (c))
+#  define Parrot_pcc_set_continuation(i, c, value) Parrot_pcc_set_continuation_func((i), (c), (value))
+
+#  define Parrot_pcc_get_results(i, c) Parrot_pcc_get_results_func((i), (c))
+#  define Parrot_pcc_set_results(i, c, value) Parrot_pcc_set_results_func((i), (c), (value))
+
+#  define Parrot_pcc_get_caller_ctx(i, c) Parrot_pcc_get_caller_ctx_func((i), (c))
+#  define Parrot_pcc_set_caller_ctx(i, c, value) Parrot_pcc_set_caller_ctx_func((i), (c), (value))
+
+#  define Parrot_pcc_get_results_signature(i, c) Parrot_pcc_get_results_signature_func((i), (c))
+#  define Parrot_pcc_set_results_signature(i, c, value) Parrot_pcc_set_results_signature_func((i), (c), (value))
+
+#  define Parrot_pcc_get_namespace(i, c) Parrot_pcc_get_namespace_func((i), (c))
+#  define Parrot_pcc_set_namespace(i, c, value) Parrot_pcc_set_namespace_func((i), (c), (value))
+
+#  define Parrot_pcc_get_pred_offset(i, c) Parrot_pcc_get_pred_offset_func((i), (c))
+#  define Parrot_pcc_set_pred_offset(i, c, value) Parrot_pcc_set_pred_offset_func((i), (c), (value))
+
+#  define Parrot_pcc_get_pc(i, c) Parrot_pcc_get_pc_func((i), (c))
+#  define Parrot_pcc_set_pc(i, c, value) Parrot_pcc_set_pc_func((i), (c), (value))
+
+#  define Parrot_pcc_get_HLL(i, c) Parrot_pcc_get_HLL_func((i), (c))
+#  define Parrot_pcc_set_HLL(i, c, value) Parrot_pcc_set_HLL_func((i), (c), (value))
+
+#  define Parrot_pcc_get_object(i, c) Parrot_pcc_get_object_func((i), (c))
+#  define Parrot_pcc_set_object(i, c, value) Parrot_pcc_set_object_func((i), (c), (value))
+
+#  define Parrot_pcc_get_lex_pad(i, c) Parrot_pcc_get_lex_pad_func((i), (c))
+#  define Parrot_pcc_set_lex_pad(i, c, value) Parrot_pcc_set_lex_pad_func((i), (c), (value))
+
+#  define Parrot_pcc_get_handlers(i, c) Parrot_pcc_get_handlers_func((i), (c))
+#  define Parrot_pcc_set_handlers(i, c, value) Parrot_pcc_set_handlers_func((i), (c), (value))
+
+#  define Parrot_pcc_get_outer_ctx(i, c) Parrot_pcc_get_outer_ctx_func((i), (c))
+#  define Parrot_pcc_set_outer_ctx(i, c, value) Parrot_pcc_set_outer_ctx_func((i), (c), (value))
+
+#  define Parrot_pcc_get_signature(i, c) Parrot_pcc_get_signature_func((i), (c))
+#  define Parrot_pcc_set_signature(i, c, value) Parrot_pcc_set_signature_func((i), (c), (value))
+
+#  define Parrot_pcc_get_int_constant(i, c, idx) Parrot_pcc_get_int_constant_func((i), (c), (idx))
+#  define Parrot_pcc_get_num_constant(i, c, idx) Parrot_pcc_get_num_constant_func((i), (c), (idx))
+#  define Parrot_pcc_get_string_constant(i, c, idx) Parrot_pcc_get_string_constant_func((i), (c), (idx))
+#  define Parrot_pcc_get_pmc_constant(i, c, idx) Parrot_pcc_get_pmc_constant_func((i), (c), (idx))
+
+#  define Parrot_pcc_get_recursion_depth(i, c) Parrot_pcc_get_recursion_depth_func((i), (c))
+#  define Parrot_pcc_dec_recursion_depth(i, c) Parrot_pcc_dec_recursion_depth_func((i), (c))
+#  define Parrot_pcc_inc_recursion_depth(i, c) Parrot_pcc_inc_recursion_depth_func((i), (c))
+
+#  define Parrot_pcc_warnings_on(i, c, flags) Parrot_pcc_warnings_on_func((i), (c), (flags))
+#  define Parrot_pcc_warnings_off(i, c, flags) Parrot_pcc_warnings_off_func((i), (c), (flags))
+#  define Parrot_pcc_warnings_test(i, c, flags) Parrot_pcc_warnings_test_func((i), (c), (flags))
+
+#  define Parrot_pcc_errors_on(i, c, flags) Parrot_pcc_errors_on_func((i), (c), (flags))
+#  define Parrot_pcc_errors_off(i, c, flags) Parrot_pcc_errors_off_func((i), (c), (flags))
+#  define Parrot_pcc_errors_test(i, c, flags) Parrot_pcc_errors_test_func((i), (c), (flags))
+
+#  define Parrot_pcc_trace_flags_on(i, c, flags) Parrot_pcc_trace_flags_on_func((i), (c), (flags))
+#  define Parrot_pcc_trace_flags_off(i, c, flags) Parrot_pcc_trace_flags_off_func((i), (c), (flags))
+#  define Parrot_pcc_trace_flags_test(i, c, flags) Parrot_pcc_trace_flags_test_func((i), (c), (flags))
+
+#endif /* ifndef NDEBUG */
+
+
+#endif /* PARROT_CONTEXT_H_GUARD */
+
+/*
+ * Local variables:
+ *   c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */

Modified: branches/orderedhash_revamp/include/parrot/datatypes.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/datatypes.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/datatypes.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -158,12 +158,12 @@
 STRING * Parrot_get_datatype_name(PARROT_INTERP, INTVAL type)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_floatval_divide_by_zero __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_get_datatype_enum __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_floatval_divide_by_zero __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_get_datatype_enum __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(type_name)
-#define ASSERT_ARGS_Parrot_get_datatype_name __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+    , PARROT_ASSERT_ARG(type_name))
+#define ASSERT_ARGS_Parrot_get_datatype_name __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/datatypes.c */
 

Modified: branches/orderedhash_revamp/include/parrot/debugger.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/debugger.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/debugger.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,9 +1,9 @@
 /*
- * Copyright (C) 2002-2008, Parrot Foundation.
+ * Copyright (C) 2002-2009, Parrot Foundation.
  */
 
 /*
- * debug.h
+ * debugger.h
  *
  * SVN Info
  *    $Id$
@@ -222,6 +222,10 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*file);
 
+void PDB_assign(PARROT_INTERP, ARGIN(const char *command))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
 void PDB_backtrace(PARROT_INTERP)
         __attribute__nonnull__(1);
 
@@ -356,104 +360,107 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-#define ASSERT_ARGS_Parrot_debugger_break __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_debugger_break __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(cur_opcode)
-#define ASSERT_ARGS_Parrot_debugger_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_debugger_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_debugger_load __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_debugger_start __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(cur_opcode))
+#define ASSERT_ARGS_Parrot_debugger_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_debugger_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_debugger_load __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_debugger_start __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(cur_opcode)
-#define ASSERT_ARGS_PDB_load_source __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(cur_opcode))
+#define ASSERT_ARGS_PDB_load_source __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(command)
-#define ASSERT_ARGS_PDB_script_file __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(command))
+#define ASSERT_ARGS_PDB_script_file __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(command)
-#define ASSERT_ARGS_PDB_add_label __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(command))
+#define ASSERT_ARGS_PDB_add_label __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(file) \
-    || PARROT_ASSERT_ARG(cur_opcode)
-#define ASSERT_ARGS_PDB_backtrace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_PDB_break __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_PDB_check_condition __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(condition)
-#define ASSERT_ARGS_PDB_compile __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(command)
-#define ASSERT_ARGS_PDB_cond __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(command)
-#define ASSERT_ARGS_PDB_continue __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_PDB_delete_breakpoint __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(command)
-#define ASSERT_ARGS_PDB_delete_condition __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(breakpoint)
-#define ASSERT_ARGS_PDB_disable_breakpoint __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(command)
-#define ASSERT_ARGS_PDB_disassemble __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_PDB_disassemble_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(dest) \
-    || PARROT_ASSERT_ARG(info) \
-    || PARROT_ASSERT_ARG(op)
-#define ASSERT_ARGS_PDB_enable_breakpoint __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(command)
-#define ASSERT_ARGS_PDB_escape __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(string)
-#define ASSERT_ARGS_PDB_eval __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(command)
-#define ASSERT_ARGS_PDB_find_breakpoint __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(command)
-#define ASSERT_ARGS_PDB_free_file __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_PDB_get_command __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_PDB_hasinstruction __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(c)
-#define ASSERT_ARGS_PDB_help __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(command)
-#define ASSERT_ARGS_PDB_info __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_PDB_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_PDB_list __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(command)
-#define ASSERT_ARGS_PDB_next __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_PDB_print __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(command)
-#define ASSERT_ARGS_PDB_program_end __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_PDB_run_command __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(command)
-#define ASSERT_ARGS_PDB_set_break __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_PDB_skip_breakpoint __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_PDB_trace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_PDB_unescape __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(string)
-#define ASSERT_ARGS_PDB_watchpoint __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(cur_opcode))
+#define ASSERT_ARGS_PDB_assign __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(command))
+#define ASSERT_ARGS_PDB_backtrace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_PDB_break __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_PDB_check_condition __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(condition))
+#define ASSERT_ARGS_PDB_compile __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(command))
+#define ASSERT_ARGS_PDB_cond __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(command))
+#define ASSERT_ARGS_PDB_continue __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_PDB_delete_breakpoint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(command))
+#define ASSERT_ARGS_PDB_delete_condition __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(breakpoint))
+#define ASSERT_ARGS_PDB_disable_breakpoint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(command))
+#define ASSERT_ARGS_PDB_disassemble __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_PDB_disassemble_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(dest) \
+    , PARROT_ASSERT_ARG(info) \
+    , PARROT_ASSERT_ARG(op))
+#define ASSERT_ARGS_PDB_enable_breakpoint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(command))
+#define ASSERT_ARGS_PDB_escape __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(string))
+#define ASSERT_ARGS_PDB_eval __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(command))
+#define ASSERT_ARGS_PDB_find_breakpoint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(command))
+#define ASSERT_ARGS_PDB_free_file __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_PDB_get_command __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_PDB_hasinstruction __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(c))
+#define ASSERT_ARGS_PDB_help __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(command))
+#define ASSERT_ARGS_PDB_info __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_PDB_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_PDB_list __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(command))
+#define ASSERT_ARGS_PDB_next __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_PDB_print __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(command))
+#define ASSERT_ARGS_PDB_program_end __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_PDB_run_command __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(command))
+#define ASSERT_ARGS_PDB_set_break __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_PDB_skip_breakpoint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_PDB_trace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_PDB_unescape __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(string))
+#define ASSERT_ARGS_PDB_watchpoint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(command)
+    , PARROT_ASSERT_ARG(command))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/debug.c */
 

Modified: branches/orderedhash_revamp/include/parrot/dynext.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/dynext.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/dynext.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -44,14 +44,14 @@
     SHIM(PMC *initializer))
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_Parrot_clone_lib_into __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_clone_lib_into __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(d) \
-    || PARROT_ASSERT_ARG(s) \
-    || PARROT_ASSERT_ARG(lib_pmc)
-#define ASSERT_ARGS_Parrot_init_lib __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_load_lib __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+    , PARROT_ASSERT_ARG(s) \
+    , PARROT_ASSERT_ARG(lib_pmc))
+#define ASSERT_ARGS_Parrot_init_lib __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_load_lib __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/dynext.c */
 

Modified: branches/orderedhash_revamp/include/parrot/encoding.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/encoding.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/encoding.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -157,36 +157,36 @@
 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
-#define ASSERT_ARGS_Parrot_encoding_number __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#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)
+#define ASSERT_ARGS_Parrot_encoding_number __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(encodingname)
-#define ASSERT_ARGS_Parrot_encoding_number_of_str __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_Parrot_find_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(encodingname)
+    , PARROT_ASSERT_ARG(encodingname))
+#define ASSERT_ARGS_Parrot_encoding_number_of_str __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_Parrot_find_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(encodingname))
 #define ASSERT_ARGS_Parrot_find_encoding_converter \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(lhs) \
-    || PARROT_ASSERT_ARG(rhs)
-#define ASSERT_ARGS_Parrot_get_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_load_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(lhs) \
+    , PARROT_ASSERT_ARG(rhs))
+#define ASSERT_ARGS_Parrot_get_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_load_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(encodingname)
-#define ASSERT_ARGS_Parrot_make_default_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(encoding)
-#define ASSERT_ARGS_Parrot_new_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_register_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(encodingname))
+#define ASSERT_ARGS_Parrot_make_default_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(encoding))
+#define ASSERT_ARGS_Parrot_new_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_register_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(encodingname) \
-    || PARROT_ASSERT_ARG(encoding)
-#define ASSERT_ARGS_parrot_deinit_encodings __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
+    , 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_str_internal_register_encoding_names \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+     __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/orderedhash_revamp/include/parrot/enums.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/enums.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/enums.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -45,22 +45,23 @@
 /* &gen_from_enum(call_bits.pasm lib/Parrot/Pmc2c/PCCMETHOD_BITS.pm) */
 typedef enum {
     /* 4 low bits are argument types */
-    PARROT_ARG_INTVAL           = 0x000,  /* 0 */
-    PARROT_ARG_STRING           = 0x001,  /* 1 */
-    PARROT_ARG_PMC              = 0x002,  /* 2 */
-    PARROT_ARG_FLOATVAL         = 0x003,  /* 3 */
-    PARROT_ARG_TYPE_MASK        = 0x00f,
+    PARROT_ARG_INTVAL           = 0x0000,  /* 0 */
+    PARROT_ARG_STRING           = 0x0001,  /* 1 */
+    PARROT_ARG_PMC              = 0x0002,  /* 2 */
+    PARROT_ARG_FLOATVAL         = 0x0003,  /* 3 */
+    PARROT_ARG_TYPE_MASK        = 0x000f,
     /* argument meaning and conversion bits */
-    PARROT_ARG_CONSTANT         = 0x010,  /* 16 */
+    PARROT_ARG_CONSTANT         = 0x0010,  /* 16 */
     /* bits a user has to define */
-    PARROT_ARG_FLATTEN          = 0x020,       /* .flatten_arg */
+    PARROT_ARG_FLATTEN          = 0x0020,       /* .flatten_arg */
     PARROT_ARG_SLURPY_ARRAY     = PARROT_ARG_FLATTEN,  /* i.e. foldup  */
     /* unused - 0x040 */
-    PARROT_ARG_OPTIONAL         = 0x080, /* 128 */
-    PARROT_ARG_OPT_FLAG         = 0x100, /* 256 prev optional was set */
-    PARROT_ARG_NAME             = 0x200, /* 512 this String is an arg name */
-    PARROT_ARG_LOOKAHEAD        = 0x400, /* 1024 this is a lookahead argument */
-    PARROT_ARG_INVOCANT         = 0x800  /* 2048 this PMC is an invocant */
+    PARROT_ARG_OPTIONAL         = 0x0080, /* 128 */
+    PARROT_ARG_OPT_FLAG         = 0x0100, /* 256 prev optional was set */
+    PARROT_ARG_NAME             = 0x0200, /* 512 this String is an arg name */
+    PARROT_ARG_LOOKAHEAD        = 0x0400, /* 1024 this is a lookahead argument */
+    PARROT_ARG_INVOCANT         = 0x0800,  /* 2048 this PMC is an invocant */
+    PARROT_ARG_CALL_SIG         = 0x1000
     /* more to come soon */
 
 } Call_bits_enum_t;

Modified: branches/orderedhash_revamp/include/parrot/events.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/events.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/events.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -169,42 +169,42 @@
 void Parrot_schedule_broadcast_qentry(ARGIN(struct QUEUE_ENTRY *entry))
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_Parrot_del_timer_event __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_del_timer_event __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(timer)
-#define ASSERT_ARGS_Parrot_do_check_events __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_do_handle_events __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_event_add_io_event __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_init_events __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_init_signals __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_kill_event_loop __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_new_cb_event __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(timer))
+#define ASSERT_ARGS_Parrot_do_check_events __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_do_handle_events __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_event_add_io_event __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_init_events __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_init_signals __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_kill_event_loop __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_new_cb_event __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(cbi) \
-    || PARROT_ASSERT_ARG(ext)
+    , PARROT_ASSERT_ARG(cbi) \
+    , PARROT_ASSERT_ARG(ext))
 #define ASSERT_ARGS_Parrot_new_suspend_for_gc_event \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_new_terminate_event __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_new_timer_event __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_schedule_event __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_new_terminate_event __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_new_timer_event __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_schedule_event __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ev)
-#define ASSERT_ARGS_Parrot_schedule_interp_qentry __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(ev))
+#define ASSERT_ARGS_Parrot_schedule_interp_qentry __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(entry)
-#define ASSERT_ARGS_Parrot_sleep_on_event __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+    , PARROT_ASSERT_ARG(entry))
+#define ASSERT_ARGS_Parrot_sleep_on_event __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
 #define ASSERT_ARGS_Parrot_schedule_broadcast_qentry \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(entry)
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(entry))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/events.c */
 

Modified: branches/orderedhash_revamp/include/parrot/exceptions.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/exceptions.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/exceptions.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -24,77 +24,77 @@
 
 /* &gen_from_enum(except_types.pasm) */
 typedef enum {
-        EXCEPTION_BAD_BUFFER_SIZE,
-        EXCEPTION_MISSING_ENCODING_NAME,
-        EXCEPTION_INVALID_STRING_REPRESENTATION,
-        EXCEPTION_ICU_ERROR,
-        EXCEPTION_UNIMPLEMENTED,
-
-        EXCEPTION_NULL_REG_ACCESS,
-        EXCEPTION_NO_REG_FRAMES,
-        EXCEPTION_SUBSTR_OUT_OF_STRING,
-        EXCEPTION_ORD_OUT_OF_STRING,
-        EXCEPTION_MALFORMED_UTF8,
-        EXCEPTION_MALFORMED_UTF16,
-        EXCEPTION_MALFORMED_UTF32,
-        EXCEPTION_INVALID_CHARACTER,
-        EXCEPTION_INVALID_CHARTYPE,
-        EXCEPTION_INVALID_ENCODING,
-        EXCEPTION_INVALID_CHARCLASS,
-        EXCEPTION_NEG_REPEAT,
-        EXCEPTION_NEG_SUBSTR,
-        EXCEPTION_NEG_SLEEP,
-        EXCEPTION_NEG_CHOP,
-        EXCEPTION_INVALID_OPERATION,
-        EXCEPTION_ARG_OP_NOT_HANDLED,
-        EXCEPTION_KEY_NOT_FOUND,
-        EXCEPTION_JIT_UNAVAILABLE,
-        EXCEPTION_EXEC_UNAVAILABLE,
-        EXCEPTION_INTERP_ERROR,
-        EXCEPTION_PREDEREF_LOAD_ERROR,
-        EXCEPTION_PARROT_USAGE_ERROR,
-        EXCEPTION_PIO_ERROR,
-        EXCEPTION_PARROT_POINTER_ERROR,
-        EXCEPTION_DIV_BY_ZERO,
-        EXCEPTION_PIO_NOT_IMPLEMENTED,
-        EXCEPTION_ALLOCATION_ERROR,
-        EXCEPTION_INTERNAL_PANIC,
-        EXCEPTION_OUT_OF_BOUNDS,
-        EXCEPTION_JIT_ERROR,
-        EXCEPTION_EXEC_ERROR,
-        EXCEPTION_ILL_INHERIT,
-        EXCEPTION_NO_PREV_CS,
-        EXCEPTION_NO_CLASS,
-        EXCEPTION_LEX_NOT_FOUND,
-        EXCEPTION_PAD_NOT_FOUND,
-        EXCEPTION_ATTRIB_NOT_FOUND,
-        EXCEPTION_GLOBAL_NOT_FOUND,
-        EXCEPTION_EXTERNAL_ERROR,
-        EXCEPTION_METHOD_NOT_FOUND,
-        EXCEPTION_VTABLE_NOT_FOUND,
-        EXCEPTION_WRITE_TO_CONSTCLASS,
-        EXCEPTION_NOSPAWN,
-        EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
-        EXCEPTION_ERR_OVERFLOW,
-        EXCEPTION_LOSSY_CONVERSION,
-        EXCEPTION_ROLE_COMPOSITION_METHOD_CONFLICT,
-        EXCEPTION_UNEXPECTED_NULL,
-        EXCEPTION_LIBRARY_ERROR,
-        EXCEPTION_LIBRARY_NOT_LOADED,
-        EXCEPTION_SYNTAX_ERROR,
-        EXCEPTION_MALFORMED_PACKFILE,
-
-        CONTROL_RETURN,
-        CONTROL_OK,
-        CONTROL_BREAK,
-        CONTROL_CONTINUE,
-        CONTROL_ERROR,
-        CONTROL_TAKE,
-        CONTROL_LEAVE,
-
-        CONTROL_LOOP_NEXT,
-        CONTROL_LOOP_LAST,
-        CONTROL_LOOP_REDO
+    EXCEPTION_BAD_BUFFER_SIZE,
+    EXCEPTION_MISSING_ENCODING_NAME,
+    EXCEPTION_INVALID_STRING_REPRESENTATION,
+    EXCEPTION_ICU_ERROR,
+    EXCEPTION_UNIMPLEMENTED,
+
+    EXCEPTION_NULL_REG_ACCESS,
+    EXCEPTION_NO_REG_FRAMES,
+    EXCEPTION_SUBSTR_OUT_OF_STRING,
+    EXCEPTION_ORD_OUT_OF_STRING,
+    EXCEPTION_MALFORMED_UTF8,
+    EXCEPTION_MALFORMED_UTF16,
+    EXCEPTION_MALFORMED_UTF32,
+    EXCEPTION_INVALID_CHARACTER,
+    EXCEPTION_INVALID_CHARTYPE,
+    EXCEPTION_INVALID_ENCODING,
+    EXCEPTION_INVALID_CHARCLASS,
+    EXCEPTION_NEG_REPEAT,
+    EXCEPTION_NEG_SUBSTR,
+    EXCEPTION_NEG_SLEEP,
+    EXCEPTION_NEG_CHOP,
+    EXCEPTION_INVALID_OPERATION,
+    EXCEPTION_ARG_OP_NOT_HANDLED,
+    EXCEPTION_KEY_NOT_FOUND,
+    EXCEPTION_JIT_UNAVAILABLE,
+    EXCEPTION_EXEC_UNAVAILABLE,
+    EXCEPTION_INTERP_ERROR,
+    EXCEPTION_PREDEREF_LOAD_ERROR,
+    EXCEPTION_PARROT_USAGE_ERROR,
+    EXCEPTION_PIO_ERROR,
+    EXCEPTION_PARROT_POINTER_ERROR,
+    EXCEPTION_DIV_BY_ZERO,
+    EXCEPTION_PIO_NOT_IMPLEMENTED,
+    EXCEPTION_ALLOCATION_ERROR,
+    EXCEPTION_INTERNAL_PANIC,
+    EXCEPTION_OUT_OF_BOUNDS,
+    EXCEPTION_JIT_ERROR,
+    EXCEPTION_EXEC_ERROR,
+    EXCEPTION_ILL_INHERIT,
+    EXCEPTION_NO_PREV_CS,
+    EXCEPTION_NO_CLASS,
+    EXCEPTION_LEX_NOT_FOUND,
+    EXCEPTION_PAD_NOT_FOUND,
+    EXCEPTION_ATTRIB_NOT_FOUND,
+    EXCEPTION_GLOBAL_NOT_FOUND,
+    EXCEPTION_EXTERNAL_ERROR,
+    EXCEPTION_METHOD_NOT_FOUND,
+    EXCEPTION_VTABLE_NOT_FOUND,
+    EXCEPTION_WRITE_TO_CONSTCLASS,
+    EXCEPTION_NOSPAWN,
+    EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+    EXCEPTION_ERR_OVERFLOW,
+    EXCEPTION_LOSSY_CONVERSION,
+    EXCEPTION_ROLE_COMPOSITION_METHOD_CONFLICT,
+    EXCEPTION_UNEXPECTED_NULL,
+    EXCEPTION_LIBRARY_ERROR,
+    EXCEPTION_LIBRARY_NOT_LOADED,
+    EXCEPTION_SYNTAX_ERROR,
+    EXCEPTION_MALFORMED_PACKFILE,
+
+    CONTROL_RETURN,
+    CONTROL_OK,
+    CONTROL_BREAK,
+    CONTROL_CONTINUE,
+    CONTROL_ERROR,
+    CONTROL_TAKE,
+    CONTROL_LEAVE,
+
+    CONTROL_LOOP_NEXT,
+    CONTROL_LOOP_LAST,
+    CONTROL_LOOP_REDO
 } exception_type_enum;
 
 /* &end_gen */
@@ -154,10 +154,6 @@
         __attribute__nonnull__(1);
 
 PARROT_EXPORT
-size_t Parrot_ex_calc_handler_offset(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-PARROT_EXPORT
 void Parrot_ex_mark_unhandled(PARROT_INTERP, ARGIN(PMC *exception))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
@@ -222,47 +218,45 @@
     unsigned int line);
 
 void Parrot_print_backtrace(void);
-#define ASSERT_ARGS_exit_fatal __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(format)
-#define ASSERT_ARGS_Parrot_assert __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_exit_fatal __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(format))
+#define ASSERT_ARGS_Parrot_assert __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(condition_string) \
-    || PARROT_ASSERT_ARG(file)
-#define ASSERT_ARGS_Parrot_confess __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(file))
+#define ASSERT_ARGS_Parrot_confess __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(cond) \
-    || PARROT_ASSERT_ARG(file)
-#define ASSERT_ARGS_Parrot_ex_add_c_handler __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(file))
+#define ASSERT_ARGS_Parrot_ex_add_c_handler __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(jp)
-#define ASSERT_ARGS_Parrot_ex_build_exception __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_ex_calc_handler_offset __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_ex_mark_unhandled __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(jp))
+#define ASSERT_ARGS_Parrot_ex_build_exception __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_ex_mark_unhandled __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(exception)
-#define ASSERT_ARGS_Parrot_ex_rethrow_from_c __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(exception))
+#define ASSERT_ARGS_Parrot_ex_rethrow_from_c __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(exception)
-#define ASSERT_ARGS_Parrot_ex_rethrow_from_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(exception))
+#define ASSERT_ARGS_Parrot_ex_rethrow_from_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(exception)
-#define ASSERT_ARGS_Parrot_ex_throw_from_c __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(exception))
+#define ASSERT_ARGS_Parrot_ex_throw_from_c __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(exception)
-#define ASSERT_ARGS_Parrot_ex_throw_from_c_args __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(exception))
+#define ASSERT_ARGS_Parrot_ex_throw_from_c_args __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(format)
-#define ASSERT_ARGS_Parrot_ex_throw_from_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(format))
+#define ASSERT_ARGS_Parrot_ex_throw_from_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(exception)
-#define ASSERT_ARGS_Parrot_ex_throw_from_op_args __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(exception))
+#define ASSERT_ARGS_Parrot_ex_throw_from_op_args __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(format)
-#define ASSERT_ARGS_die_from_exception __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(format))
+#define ASSERT_ARGS_die_from_exception __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(exception)
-#define ASSERT_ARGS_do_panic __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_print_backtrace __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
+    , PARROT_ASSERT_ARG(exception))
+#define ASSERT_ARGS_do_panic __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_print_backtrace __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/exceptions.c */
 

Deleted: branches/orderedhash_revamp/include/parrot/exec.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/exec.h	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,187 +0,0 @@
-/*
- * Copyright (C) 2003-2007, Parrot Foundation.
- */
-
-/*
- * exec.h
- *
- * SVN Info
- *    $Id$
- * Overview:
- *    Exec header file.
- * History:
- *      Initial version by Daniel Grunblatt on 2003.6.9
- * Notes:
- * References:
- */
-
-#ifndef PARROT_EXEC_H_GUARD
-#define PARROT_EXEC_H_GUARD
-
-#if EXEC_CAPABLE
-
-#  ifdef PARROT_EXEC_OS_OPENBSD
-#    ifdef PARROT_OPENBSD_ELF
-#      define EXEC_ELF
-#    else
-#      define EXEC_A_OUT
-#    endif
-#  endif
-#  ifdef PARROT_EXEC_OS_DARWIN
-#    define EXEC_MACH_O
-#  endif
-#  if defined(PARROT_EXEC_OS_FREEBSD) || defined(PARROT_EXEC_OS_NETBSD) || defined(PARROT_EXEC_OS_LINUX)
-#    define EXEC_ELF
-#  endif
-#  if defined(PARROT_EXEC_OS_MSWIN32) || defined(PARROT_EXEC_OS_CYGWIN)
-#    define EXEC_COFF
-#  endif
-
-#  ifdef EXEC_A_OUT
-#    define EXEC_CALLDISP jit_info->arena.start - jit_info->native_ptr - 4
-#  elif defined(EXEC_COFF)
-#    define EXEC_CALLDISP 0
-#  else
-#    define EXEC_CALLDISP 0xfffffffc
-#  endif
-
-/* Symbol types */
-#  define STYPE_UND   1     /* Undefined */
-#  define STYPE_GCC   2     /* GCC */
-#  ifdef I386
-#    define STYPE_GDATA 3   /* Global data */
-#    define STYPE_FUNC  4   /* Function */
-#  else
-#    define STYPE_GDATA 0x0F020000   /* Global data */
-#    define STYPE_FUNC  0x0F010000  /* Function */
-#  endif
-#  define STYPE_COM   5   /* Variable */
-
-/* Rellocation types */
-#  define RTYPE_DATA  1   /* Data */
-#  define RTYPE_COM   2   /* Variable */
-#  define RTYPE_FUNC  3   /* Function */
-#  define RTYPE_DATA1 4   /* 2nd. rellocation for RISC machines */
-
-typedef struct Parrot_exec_symbol_t {
-    int                                                 offset_list;
-    int                                                 type;
-    int                                                 value;
-    const char                                         *symbol;
-} Parrot_exec_symbol_t;
-
-typedef struct Parrot_exec_rellocation_t {
-    int                                                 offset;
-    short                                               symbol_number;
-    int                                                 type;
-} Parrot_exec_rellocation_t;
-
-typedef struct Parrot_exec_section_t {
-    char                                               *code;
-    size_t                                              size;
-} Parrot_exec_section_t;
-
-typedef struct Parrot_exec_objfile_t {
-    Parrot_exec_section_t                               text;
-    Parrot_exec_section_t                               data;
-    Parrot_exec_section_t                               bss;
-    int                                                *data_size;
-    int                                                 data_count;
-    Parrot_exec_rellocation_t                          *text_rellocation_table;
-    int                                                 text_rellocation_count;
-    Parrot_exec_rellocation_t                          *data_rellocation_table;
-    int                                                 data_rellocation_count;
-    Parrot_exec_symbol_t                               *symbol_table;
-    int                                                 symbol_count;
-    int                                                 symbol_list_size;
-    int                                                 bytecode_header_size;
-} Parrot_exec_objfile_t;
-
-/* HEADERIZER BEGIN: src/exec.c */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-
-PARROT_EXPORT
-void Parrot_exec_add_text_rellocation(
-    ARGIN(Parrot_exec_objfile_t *obj),
-    ARGIN(char *nptr),
-    int type,
-    ARGIN(const char *symbol),
-    int disp)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(4);
-
-PARROT_EXPORT
-void Parrot_exec_add_text_rellocation_func(
-    ARGIN(Parrot_exec_objfile_t *obj),
-    ARGIN(char *nptr),
-    ARGIN(const char *func_name))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3);
-
-PARROT_EXPORT
-PARROT_CAN_RETURN_NULL
-int * Parrot_exec_add_text_rellocation_reg(
-    ARGIN(Parrot_exec_objfile_t *obj),
-    ARGIN(char *nptr),
-    ARGIN(const char *var),
-    int offset,
-    int disp)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3);
-
-void Parrot_exec(PARROT_INTERP,
-    ARGIN(opcode_t *pc),
-    ARGIN(opcode_t *code_start),
-    ARGIN(opcode_t *code_end))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4);
-
-int Parrot_exec_add_symbol(
-    ARGMOD(Parrot_exec_objfile_t *obj),
-    ARGIN(const char *symbol),
-    int stype)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*obj);
-
-#define ASSERT_ARGS_Parrot_exec_add_text_rellocation \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(obj) \
-    || PARROT_ASSERT_ARG(nptr) \
-    || PARROT_ASSERT_ARG(symbol)
-#define ASSERT_ARGS_Parrot_exec_add_text_rellocation_func \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(obj) \
-    || PARROT_ASSERT_ARG(nptr) \
-    || PARROT_ASSERT_ARG(func_name)
-#define ASSERT_ARGS_Parrot_exec_add_text_rellocation_reg \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(obj) \
-    || PARROT_ASSERT_ARG(nptr) \
-    || PARROT_ASSERT_ARG(var)
-#define ASSERT_ARGS_Parrot_exec __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pc) \
-    || PARROT_ASSERT_ARG(code_start) \
-    || PARROT_ASSERT_ARG(code_end)
-#define ASSERT_ARGS_Parrot_exec_add_symbol __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(obj) \
-    || PARROT_ASSERT_ARG(symbol)
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: src/exec.c */
-
-#endif /* EXEC_CAPABLE */
-
-#endif /* PARROT_EXEC_H_GUARD */
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Modified: branches/orderedhash_revamp/include/parrot/exit.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/exit.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/exit.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -39,11 +39,11 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-#define ASSERT_ARGS_Parrot_exit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_on_exit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_exit __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_on_exit __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(function)
+    , PARROT_ASSERT_ARG(function))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/exit.c */
 

Modified: branches/orderedhash_revamp/include/parrot/extend.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/extend.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/extend.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -35,10 +35,15 @@
    pointer, which is on the stack and as good a thing as any to use as
    an anchor */
 #define PARROT_CALLIN_START(x) void *oldtop = (x)->lo_var_ptr; \
-                               if (!oldtop) (x)->lo_var_ptr = &oldtop;
+                               if (oldtop) {} else (x)->lo_var_ptr = &oldtop
 /* Put the stack top back, if what we cached was NULL. Otherwise we
    leave it alone and assume it's OK */
-#define PARROT_CALLIN_END(x)   if (!oldtop) (x)->lo_var_ptr = NULL;
+#define PARROT_CALLIN_END(x)   do {\
+                if (!oldtop) {\
+                    PARROT_ASSERT((x)->lo_var_ptr == &oldtop);\
+                    (x)->lo_var_ptr = NULL;\
+                }\
+            } while (0)
 
 #else
 
@@ -60,7 +65,7 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
 void * Parrot_call_method(PARROT_INTERP,
-    Parrot_PMC sub,
+    Parrot_PMC sub_pmc,
     Parrot_PMC obj,
     Parrot_String method,
     ARGIN(const char *signature),
@@ -70,7 +75,7 @@
 
 PARROT_EXPORT
 Parrot_Float Parrot_call_method_ret_float(PARROT_INTERP,
-    Parrot_PMC sub,
+    Parrot_PMC sub_pmc,
     Parrot_PMC obj,
     Parrot_String method,
     ARGIN(const char *signature),
@@ -80,7 +85,7 @@
 
 PARROT_EXPORT
 Parrot_Int Parrot_call_method_ret_int(PARROT_INTERP,
-    Parrot_PMC sub,
+    Parrot_PMC sub_pmc,
     Parrot_PMC obj,
     Parrot_String method,
     ARGIN(const char *signature),
@@ -91,7 +96,7 @@
 PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
-void* Parrot_call_sub(PARROT_INTERP,
+void * Parrot_call_sub(PARROT_INTERP,
     Parrot_PMC sub_pmc,
     ARGIN(const char *signature),
     ...)
@@ -119,6 +124,15 @@
         __attribute__nonnull__(2);
 
 PARROT_EXPORT
+void Parrot_ext_call(PARROT_INTERP,
+    ARGIN(Parrot_PMC sub_pmc),
+    ARGIN(const char *signature),
+    ...)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
+
+PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
 Parrot_Language Parrot_find_language(SHIM_INTERP, SHIM(char *language));
 
@@ -438,145 +452,149 @@
         __attribute__nonnull__(2)
         __attribute__nonnull__(3);
 
-#define ASSERT_ARGS_Parrot_call_method __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_call_method __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(signature)
-#define ASSERT_ARGS_Parrot_call_method_ret_float __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(signature))
+#define ASSERT_ARGS_Parrot_call_method_ret_float __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(signature)
-#define ASSERT_ARGS_Parrot_call_method_ret_int __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(signature))
+#define ASSERT_ARGS_Parrot_call_method_ret_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(signature)
-#define ASSERT_ARGS_Parrot_call_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(signature)
-#define ASSERT_ARGS_Parrot_call_sub_ret_float __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(signature)
-#define ASSERT_ARGS_Parrot_call_sub_ret_int __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(signature)
-#define ASSERT_ARGS_Parrot_eprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_find_language __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_fprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pio) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_free_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_get_intreg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_get_numreg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_get_pmcreg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_get_root_namespace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_get_strreg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_get_vtable __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_new_string __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_delete_pmckey __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_get_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_get_cstring_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_get_cstringn __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(signature))
+#define ASSERT_ARGS_Parrot_call_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(signature))
+#define ASSERT_ARGS_Parrot_call_sub_ret_float __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(signature))
+#define ASSERT_ARGS_Parrot_call_sub_ret_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(signature))
+#define ASSERT_ARGS_Parrot_eprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_Parrot_ext_call __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(sub_pmc) \
+    , PARROT_ASSERT_ARG(signature))
+#define ASSERT_ARGS_Parrot_find_language __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_fprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pio) \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_Parrot_free_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_get_intreg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_get_numreg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_get_pmcreg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_get_root_namespace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_get_strreg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_get_vtable __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_new_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_delete_pmckey __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_get_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_get_cstring_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_get_cstringn __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc) \
-    || PARROT_ASSERT_ARG(length)
+    , PARROT_ASSERT_ARG(pmc) \
+    , PARROT_ASSERT_ARG(length))
 #define ASSERT_ARGS_Parrot_PMC_get_cstringn_intkey \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc) \
-    || PARROT_ASSERT_ARG(length)
-#define ASSERT_ARGS_Parrot_PMC_get_intval __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_get_intval_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_get_intval_pmckey __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_get_numval __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_get_numval_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_get_pmc_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_get_pmc_strkey __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_get_pointer_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_get_string_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_new __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_newclass __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_null __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_PMC_push_intval __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_push_numval __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_push_pmcval __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_set_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_set_cstring_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_set_cstringn __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+    , PARROT_ASSERT_ARG(pmc) \
+    , PARROT_ASSERT_ARG(length))
+#define ASSERT_ARGS_Parrot_PMC_get_intval __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_get_intval_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_get_intval_pmckey __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_get_numval __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_get_numval_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_get_pmc_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_get_pmc_strkey __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_get_pointer_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_get_string_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_newclass __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_null __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_PMC_push_intval __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_push_numval __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_push_pmcval __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_set_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_set_cstring_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_set_cstringn __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
 #define ASSERT_ARGS_Parrot_PMC_set_cstringn_intkey \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_set_intval __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_set_intval_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_set_numval __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_set_numval_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_set_pmc_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_set_pmc_pmckey __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_set_pmc_strkey __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_set_pointer_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_PMC_set_string __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_set_string_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_PMC_set_vtable __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_PMC_typenum __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_printf __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_register_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_set_intreg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_set_numreg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_set_pmcreg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_set_strreg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_sub_new_from_c_func __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(func) \
-    || PARROT_ASSERT_ARG(signature)
-#define ASSERT_ARGS_Parrot_unregister_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_vfprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_set_intval __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_set_intval_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_set_numval __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_set_numval_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_set_pmc_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_set_pmc_pmckey __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_set_pmc_strkey __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_set_pointer_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_Parrot_PMC_set_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_set_string_intkey __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_PMC_set_vtable __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_PMC_typenum __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_printf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_Parrot_register_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_set_intreg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_set_numreg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_set_pmcreg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_set_strreg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_sub_new_from_c_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(func) \
+    , PARROT_ASSERT_ARG(signature))
+#define ASSERT_ARGS_Parrot_unregister_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_vfprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pio) \
-    || PARROT_ASSERT_ARG(s)
+    , PARROT_ASSERT_ARG(pio) \
+    , PARROT_ASSERT_ARG(s))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/extend.c */
 

Modified: branches/orderedhash_revamp/include/parrot/gc_api.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/gc_api.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/gc_api.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -11,10 +11,6 @@
 #ifndef PARROT_GC_API_H_GUARD
 #define PARROT_GC_API_H_GUARD
 
-/* Set this to 1 to see if unanchored objects are found in system areas.
- * Please note: these objects might be bogus */
-#define GC_VERBOSE 0
-
 #include "parrot/parrot.h"
 
 /*
@@ -43,31 +39,11 @@
     POOL_ALL    = 0x07
 } pool_iter_enum;
 
-struct Small_Object_Pool;
-struct Small_Object_Arena;
-struct Arenas;
-
-typedef int (*pool_iter_fn)(PARROT_INTERP, struct Small_Object_Pool *, int, void*);
-
-typedef struct Memory_Block {
-    size_t free;
-    size_t size;
-    struct Memory_Block *prev;
-    struct Memory_Block *next;
-    char *start;
-    char *top;
-} Memory_Block;
-
-typedef struct Memory_Pool {
-    Memory_Block *top_block;
-    void (*compact)(PARROT_INTERP, struct Memory_Pool *);
-    size_t minimum_block_size;
-    size_t total_allocated; /* total bytes allocated to this pool */
-    size_t guaranteed_reclaimable;     /* bytes that can definitely be reclaimed*/
-    size_t possibly_reclaimable;     /* bytes that can possibly be reclaimed
-                                      * (above plus COW-freed bytes) */
-    FLOATVAL reclaim_factor; /* minimum percentage we will reclaim */
-} Memory_Pool;
+struct Memory_Block;
+struct Var_Size_Pool;
+struct Fixed_Size_Pool;
+struct Fixed_Size_Arena;
+struct Memory_Pools;
 
 typedef enum {
     GC_TRACE_FULL        = 1,
@@ -75,25 +51,12 @@
     GC_TRACE_SYSTEM_ONLY = 3
 } Parrot_gc_trace_type;
 
-typedef void (*add_free_object_fn_type)(PARROT_INTERP, struct Small_Object_Pool *, void *);
-typedef void * (*get_free_object_fn_type)(PARROT_INTERP, struct Small_Object_Pool *);
-typedef void (*alloc_objects_fn_type)(PARROT_INTERP, struct Small_Object_Pool *);
-typedef void (*gc_object_fn_type)(PARROT_INTERP, struct Small_Object_Pool *, PObj *);
-
-/*
- * macros used in arena scan code to convert from object pointers
- * to arena pointers ...
- */
+typedef int (*pool_iter_fn)(PARROT_INTERP, struct Fixed_Size_Pool *, int, void*);
+typedef void (*add_free_object_fn_type)(PARROT_INTERP, struct Fixed_Size_Pool *, void *);
+typedef void * (*get_free_object_fn_type)(PARROT_INTERP, struct Fixed_Size_Pool *);
+typedef void (*alloc_objects_fn_type)(PARROT_INTERP, struct Fixed_Size_Pool *);
+typedef void (*gc_object_fn_type)(PARROT_INTERP, struct Fixed_Size_Pool *, PObj *);
 
-#if PARROT_GC_GMS
-#  define GC_HEADER_SIZE (sizeof (Gc_gms_hdr))
-#  define PObj_to_ARENA(o) PObj_to_GMSH(o)
-#  define ARENA_to_PObj(p) GMSH_to_PObj((Gc_gms_hdr*)(p))
-#else
-#  define GC_HEADER_SIZE 0
-#  define PObj_to_ARENA(o) (o)
-#  define ARENA_to_PObj(p) (p)
-#endif
 
 /* &gen_from_enum(interpinfo.pasm) prefix(INTERPINFO_) */
 
@@ -145,12 +108,23 @@
         __attribute__nonnull__(1);
 
 PARROT_EXPORT
+void Parrot_gc_mark_PMC_alive_fun(PARROT_INTERP, ARGMOD_NULLOK(PMC *obj))
+        __attribute__nonnull__(1)
+        FUNC_MODIFIES(*obj);
+
+PARROT_EXPORT
 void Parrot_gc_mark_PObj_alive(PARROT_INTERP, ARGMOD(PObj *obj))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*obj);
 
 PARROT_EXPORT
+void Parrot_gc_mark_STRING_alive_fun(PARROT_INTERP,
+    ARGMOD_NULLOK(STRING *obj))
+        __attribute__nonnull__(1)
+        FUNC_MODIFIES(*obj);
+
+PARROT_EXPORT
 unsigned int Parrot_is_blocked_GC_mark(PARROT_INTERP)
         __attribute__nonnull__(1);
 
@@ -172,11 +146,6 @@
 int Parrot_gc_active_sized_buffers(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-void Parrot_gc_add_pmc_ext(PARROT_INTERP, ARGMOD(PMC *pmc))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pmc);
-
 void Parrot_gc_add_pmc_sync(PARROT_INTERP, ARGMOD(PMC *pmc))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
@@ -189,6 +158,16 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*buffer);
 
+PARROT_CANNOT_RETURN_NULL
+void * Parrot_gc_allocate_fixed_size_storage(PARROT_INTERP, size_t size)
+        __attribute__nonnull__(1);
+
+PARROT_CANNOT_RETURN_NULL
+void * Parrot_gc_allocate_pmc_attributes(PARROT_INTERP, ARGMOD(PMC *pmc))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        FUNC_MODIFIES(*pmc);
+
 void Parrot_gc_allocate_string_storage(PARROT_INTERP,
     ARGOUT(STRING *str),
     size_t size)
@@ -196,9 +175,6 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*str);
 
-void Parrot_gc_cleanup_next_for_GC(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
 void Parrot_gc_compact_memory_pool(PARROT_INTERP)
         __attribute__nonnull__(1);
 
@@ -220,29 +196,38 @@
 void Parrot_gc_destroy_memory_pools(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-UINTVAL Parrot_gc_extended_pmcs(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
 void Parrot_gc_finalize(PARROT_INTERP)
         __attribute__nonnull__(1);
 
 void Parrot_gc_free_bufferlike_header(PARROT_INTERP,
-    ARGMOD(PObj *obj),
+    ARGMOD(Buffer *obj),
     size_t size)
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*obj);
 
-void Parrot_gc_free_pmc_ext(PARROT_INTERP, ARGMOD(PMC *p))
+void Parrot_gc_free_fixed_size_storage(PARROT_INTERP,
+    size_t size,
+    ARGMOD(void *data))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(3)
+        FUNC_MODIFIES(*data);
+
+void Parrot_gc_free_pmc_attributes(PARROT_INTERP, ARGMOD(PMC *pmc))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
-        FUNC_MODIFIES(*p);
+        FUNC_MODIFIES(*pmc);
 
 void Parrot_gc_free_pmc_header(PARROT_INTERP, ARGMOD(PMC *pmc))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*pmc);
 
+void Parrot_gc_free_pmc_sync(PARROT_INTERP, ARGMOD(PMC *p))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        FUNC_MODIFIES(*p);
+
 void Parrot_gc_free_string_header(PARROT_INTERP, ARGMOD(STRING *s))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
@@ -330,173 +315,159 @@
 int Parrot_gc_total_sized_buffers(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_Parrot_block_GC_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_block_GC_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_gc_mark_PObj_alive __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(obj)
-#define ASSERT_ARGS_Parrot_is_blocked_GC_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_is_blocked_GC_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_unblock_GC_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_unblock_GC_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_gc_active_pmcs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_block_GC_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_block_GC_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_gc_mark_PMC_alive_fun __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_gc_mark_PObj_alive __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(obj))
+#define ASSERT_ARGS_Parrot_gc_mark_STRING_alive_fun \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_is_blocked_GC_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_is_blocked_GC_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_unblock_GC_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_unblock_GC_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_gc_active_pmcs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
 #define ASSERT_ARGS_Parrot_gc_active_sized_buffers \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_gc_add_pmc_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_gc_add_pmc_sync __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_gc_add_pmc_sync __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
+    , PARROT_ASSERT_ARG(pmc))
 #define ASSERT_ARGS_Parrot_gc_allocate_buffer_storage_aligned \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(buffer)
+    , PARROT_ASSERT_ARG(buffer))
+#define ASSERT_ARGS_Parrot_gc_allocate_fixed_size_storage \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_gc_allocate_pmc_attributes \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc))
 #define ASSERT_ARGS_Parrot_gc_allocate_string_storage \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(str)
-#define ASSERT_ARGS_Parrot_gc_cleanup_next_for_GC __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_gc_compact_memory_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_gc_completely_unblock __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_gc_count_collect_runs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+    , PARROT_ASSERT_ARG(str))
+#define ASSERT_ARGS_Parrot_gc_compact_memory_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_gc_completely_unblock __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_gc_count_collect_runs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
 #define ASSERT_ARGS_Parrot_gc_count_lazy_mark_runs \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_gc_count_mark_runs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_gc_count_mark_runs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
 #define ASSERT_ARGS_Parrot_gc_destroy_header_pools \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
 #define ASSERT_ARGS_Parrot_gc_destroy_memory_pools \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_gc_extended_pmcs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_gc_finalize __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_gc_finalize __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
 #define ASSERT_ARGS_Parrot_gc_free_bufferlike_header \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(obj))
+#define ASSERT_ARGS_Parrot_gc_free_fixed_size_storage \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(data))
+#define ASSERT_ARGS_Parrot_gc_free_pmc_attributes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(obj)
-#define ASSERT_ARGS_Parrot_gc_free_pmc_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_Parrot_gc_free_pmc_header __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(p)
-#define ASSERT_ARGS_Parrot_gc_free_pmc_header __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_Parrot_gc_free_pmc_sync __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_gc_free_string_header __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(p))
+#define ASSERT_ARGS_Parrot_gc_free_string_header __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_gc_get_pmc_index __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_Parrot_gc_get_pmc_index __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
+    , PARROT_ASSERT_ARG(pmc))
 #define ASSERT_ARGS_Parrot_gc_headers_alloc_since_last_collect \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_gc_impatient_pmcs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_gc_initialize __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(stacktop)
-#define ASSERT_ARGS_Parrot_gc_mark_and_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_gc_impatient_pmcs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_gc_initialize __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(stacktop))
+#define ASSERT_ARGS_Parrot_gc_mark_and_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
 #define ASSERT_ARGS_Parrot_gc_mem_alloc_since_last_collect \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_gc_merge_header_pools __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_gc_merge_header_pools __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(dest_interp) \
-    || PARROT_ASSERT_ARG(source_interp)
+    , PARROT_ASSERT_ARG(source_interp))
 #define ASSERT_ARGS_Parrot_gc_new_bufferlike_header \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_gc_new_pmc_header __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_gc_new_string_header __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_gc_new_pmc_header __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_gc_new_string_header __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
 #define ASSERT_ARGS_Parrot_gc_pmc_needs_early_collection \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_gc_ptr_in_memory_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_Parrot_gc_ptr_in_memory_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(bufstart)
-#define ASSERT_ARGS_Parrot_gc_ptr_is_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(bufstart))
+#define ASSERT_ARGS_Parrot_gc_ptr_is_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ptr)
+    , PARROT_ASSERT_ARG(ptr))
 #define ASSERT_ARGS_Parrot_gc_reallocate_buffer_storage \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(buffer)
+    , PARROT_ASSERT_ARG(buffer))
 #define ASSERT_ARGS_Parrot_gc_reallocate_string_storage \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(str)
-#define ASSERT_ARGS_Parrot_gc_total_copied __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+    , PARROT_ASSERT_ARG(str))
+#define ASSERT_ARGS_Parrot_gc_total_copied __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
 #define ASSERT_ARGS_Parrot_gc_total_memory_allocated \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_gc_total_pmcs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_gc_total_sized_buffers __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_gc_total_pmcs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_gc_total_sized_buffers __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/gc/api.c */
 
 void Parrot_gc_inf_init(PARROT_INTERP);
 
-
-/* DEPRECATED. pobject_lives is being renamed to Parrot_gc_mark_PObj_alive.
-   this macro is provided for compatibility until version 1.4 or later when
-   it can be removed per the deprecation policy. See TT #664 for details */
-#define pobject_lives Parrot_gc_mark_PObj_alive
-
-/* write barrier */
-#if PARROT_GC_MS
-#  define GC_WRITE_BARRIER(interp, agg, old, _new) do { } while (0)
-#  define GC_WRITE_BARRIER_KEY(interp, agg, old, old_key, _new, new_key) do { } while (0)
-#endif
-
-#if PARROT_GC_GMS
-#  define GC_WRITE_BARRIER(interp, agg, old, _new) do { \
-    UINTVAL gen_agg, gen_new; \
-    if (!(_new) || PMC_IS_NULL(_new)) \
-        break; \
-    gen_agg = PObj_to_GMSH(agg)->gen->gen_no; \
-    gen_new = PObj_to_GMSH(_new)->gen->gen_no; \
-    if (gen_agg < gen_new) \
-        parrot_gc_gms_wb((interp), (agg), (old), (_new)); \
-} while (0)
-
-#  define GC_WRITE_BARRIER_KEY(interp, agg, old, old_key, _new, new_key) do { \
-    UINTVAL gen_agg, gen_new, gen_key; \
-    if (!(_new) || PMC_IS_NULL(_new)) \
-        break; \
-    gen_agg = PObj_to_GMSH(agg)->gen->gen_no; \
-    gen_new = PObj_to_GMSH(_new)->gen->gen_no; \
-    gen_key = PObj_to_GMSH(new_key)->gen->gen_no; \
-    if (gen_agg < gen_new || gen_agg < gen_key) \
-        parrot_gc_gms_wb_key((interp), (agg), (old), (old_key), (_new), (new_key)); \
-} while (0)
-
+#if defined(NDEBUG) && defined(PARROT_IN_CORE)
+#  define Parrot_gc_mark_STRING_alive(interp, obj) \
+          do if (! STRING_IS_NULL(obj)) PObj_live_SET(obj); while (0)
+#else
+#  define Parrot_gc_mark_STRING_alive(interp, obj) Parrot_gc_mark_STRING_alive_fun((interp), (obj))
 #endif
 
-#if PARROT_GC_INF
-#  define GC_WRITE_BARRIER(interp, agg, old, _new) do { } while (0)
-#  define GC_WRITE_BARRIER_KEY(interp, agg, old, old_key, _new, new_key) do { } while (0)
+#if defined(PARROT_IN_CORE)
+#  define Parrot_gc_mark_PMC_alive(interp, obj) \
+      do if (!PMC_IS_NULL(obj) && !PObj_live_TEST(obj)) Parrot_gc_mark_PMC_alive_fun((interp), (obj)); \
+      while (0)
+#else
+#  define Parrot_gc_mark_PMC_alive(interp, obj) Parrot_gc_mark_PMC_alive_fun((interp), (obj))
 #endif
 
 #endif /* PARROT_GC_API_H_GUARD */

Modified: branches/orderedhash_revamp/include/parrot/global.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/global.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/global.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -26,15 +26,6 @@
 PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
-PMC * Parrot_find_global_k(PARROT_INTERP,
-    ARGIN_NULLOK(PMC *pmc_key),
-    ARGIN(STRING *globalname))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
 PMC * Parrot_find_global_n(PARROT_INTERP,
     ARGIN_NULLOK(PMC *ns),
     ARGIN_NULLOK(STRING *globalname))
@@ -78,17 +69,12 @@
 PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
-PMC * Parrot_get_namespace_autobase(PARROT_INTERP, ARGIN_NULLOK(PMC *key))
-        __attribute__nonnull__(1);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
 PMC * Parrot_get_namespace_keyed(PARROT_INTERP,
     ARGIN(PMC *base_ns),
-    ARGIN_NULLOK(PMC *pmc_key))
+    ARGIN(PMC *pmc_key))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
 
 PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
@@ -110,9 +96,10 @@
 PARROT_CAN_RETURN_NULL
 PMC * Parrot_make_namespace_keyed(PARROT_INTERP,
     ARGIN(PMC *base_ns),
-    ARGIN_NULLOK(PMC *pmc_key))
+    ARGIN(PMC *pmc_key))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
 
 PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
@@ -157,55 +144,52 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-#define ASSERT_ARGS_Parrot_find_global_cur __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_find_global_k __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(globalname)
-#define ASSERT_ARGS_Parrot_find_global_n __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_find_global_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ns)
-#define ASSERT_ARGS_Parrot_find_global_s __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_find_name_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_Parrot_get_global __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_get_namespace_autobase __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_get_namespace_keyed __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_find_global_cur __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_find_global_n __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_find_global_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ns))
+#define ASSERT_ARGS_Parrot_find_global_s __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_find_name_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_Parrot_get_global __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_get_namespace_keyed __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(base_ns)
+    , PARROT_ASSERT_ARG(base_ns) \
+    , PARROT_ASSERT_ARG(pmc_key))
 #define ASSERT_ARGS_Parrot_get_namespace_keyed_str \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(base_ns)
+    , PARROT_ASSERT_ARG(base_ns))
 #define ASSERT_ARGS_Parrot_make_namespace_autobase \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_make_namespace_keyed __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_make_namespace_keyed __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(base_ns)
+    , PARROT_ASSERT_ARG(base_ns) \
+    , PARROT_ASSERT_ARG(pmc_key))
 #define ASSERT_ARGS_Parrot_make_namespace_keyed_str \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(base_ns) \
-    || PARROT_ASSERT_ARG(str_key)
-#define ASSERT_ARGS_Parrot_ns_get_name __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(_namespace)
-#define ASSERT_ARGS_Parrot_set_global __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_store_global_n __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_store_global_s __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_store_sub_in_namespace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(base_ns) \
+    , PARROT_ASSERT_ARG(str_key))
+#define ASSERT_ARGS_Parrot_ns_get_name __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(_namespace))
+#define ASSERT_ARGS_Parrot_set_global __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_store_global_n __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_store_global_s __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_store_sub_in_namespace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub_pmc)
+    , PARROT_ASSERT_ARG(sub_pmc))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/global.c */
 

Modified: branches/orderedhash_revamp/include/parrot/global_setup.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/global_setup.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/global_setup.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -32,18 +32,13 @@
 void init_world_once(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-void parrot_global_setup_2(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
 #define ASSERT_ARGS_Parrot_set_config_hash_internal \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(parrot_config)
-#define ASSERT_ARGS_init_world __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_init_world_once __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_parrot_global_setup_2 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(parrot_config))
+#define ASSERT_ARGS_init_world __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_init_world_once __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/global_setup.c */
 

Modified: branches/orderedhash_revamp/include/parrot/hash.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/hash.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/hash.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -28,11 +28,12 @@
 
 /*
  * hash_entry is currently unused in the hash structure
- */
+
 typedef struct _hash_entry {
     HashEntryType type;
     UnionVal val;
 } HashEntry;
+*/
 
 /* A BucketIndex is an index into the pool of available buckets. */
 typedef UINTVAL BucketIndex;
@@ -42,7 +43,7 @@
 #define HASH_ALLOC_SIZE(n) (N_BUCKETS(n) * sizeof (HashBucket) + \
                                      (n) * sizeof (HashBucket *))
 
-typedef int (*hash_comp_fn)(PARROT_INTERP, const void*const, const void*const);
+typedef int (*hash_comp_fn)(PARROT_INTERP, const void *const, const void *const);
 typedef void (*hash_mark_key_fn)(PARROT_INTERP, PObj *);
 typedef size_t (*hash_hash_key_fn)(PARROT_INTERP, ARGIN(const void *), size_t seed);
 
@@ -204,15 +205,120 @@
         __attribute__nonnull__(1);
 
 PARROT_EXPORT
-void parrot_new_pmc_hash(PARROT_INTERP, ARGOUT(PMC *container))
+PARROT_CANNOT_RETURN_NULL
+Hash * parrot_new_pointer_hash(PARROT_INTERP)
+        __attribute__nonnull__(1);
+
+PARROT_CANNOT_RETURN_NULL
+PMC* get_integer_pmc(PARROT_INTERP, INTVAL value)
+        __attribute__nonnull__(1);
+
+PARROT_CANNOT_RETURN_NULL
+PMC* get_number_pmc(PARROT_INTERP, FLOATVAL value)
+        __attribute__nonnull__(1);
+
+PARROT_CANNOT_RETURN_NULL
+PMC * get_string_pmc(PARROT_INTERP, ARGIN(STRING *value))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CAN_RETURN_NULL
+void* hash_key_from_int(PARROT_INTERP,
+    ARGIN(const Hash * const hash),
+    INTVAL key)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CAN_RETURN_NULL
+void* hash_key_from_pmc(PARROT_INTERP,
+    ARGIN(const Hash * const hash),
+    ARGIN(PMC *key))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
-        FUNC_MODIFIES(*container);
+        __attribute__nonnull__(3);
+
+PARROT_CAN_RETURN_NULL
+void* hash_key_from_string(PARROT_INTERP,
+    ARGIN(const Hash * const hash),
+    ARGIN(STRING *key))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
+
+INTVAL hash_key_to_int(PARROT_INTERP,
+    ARGIN(const Hash * const hash),
+    ARGIN_NULLOK(void *key))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
-PARROT_EXPORT
 PARROT_CANNOT_RETURN_NULL
-Hash * parrot_new_pointer_hash(PARROT_INTERP)
-        __attribute__nonnull__(1);
+PMC* hash_key_to_pmc(PARROT_INTERP,
+    ARGIN(const Hash * const hash),
+    ARGIN(void *key))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
+
+PARROT_CANNOT_RETURN_NULL
+STRING* hash_key_to_string(PARROT_INTERP,
+    ARGIN(const Hash * const hash),
+    ARGIN_NULLOK(void *key))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CAN_RETURN_NULL
+void* hash_value_from_int(PARROT_INTERP,
+    ARGIN(const Hash * const hash),
+    INTVAL value)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CAN_RETURN_NULL
+void* hash_value_from_number(PARROT_INTERP,
+    ARGIN(const Hash * const hash),
+    FLOATVAL value)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CAN_RETURN_NULL
+void* hash_value_from_pmc(PARROT_INTERP,
+    ARGIN(const Hash * const hash),
+    ARGIN_NULLOK(PMC *value))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CAN_RETURN_NULL
+void* hash_value_from_string(PARROT_INTERP,
+    ARGIN(const Hash * const hash),
+    ARGIN_NULLOK(STRING *value))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+INTVAL hash_value_to_int(PARROT_INTERP,
+    ARGIN(const Hash * const hash),
+    ARGIN_NULLOK(void *value))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+FLOATVAL hash_value_to_number(PARROT_INTERP,
+    ARGIN(const Hash * const hash),
+    ARGIN_NULLOK(void *value))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CANNOT_RETURN_NULL
+PMC* hash_value_to_pmc(PARROT_INTERP,
+    ARGIN(const Hash * const hash),
+    ARGIN_NULLOK(void *value))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CANNOT_RETURN_NULL
+STRING* hash_value_to_string(PARROT_INTERP,
+    ARGIN(const Hash * const hash),
+    ARGIN_NULLOK(void *value))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_PURE_FUNCTION
@@ -226,6 +332,20 @@
     ARGIN_NULLOK(const void *value),
     size_t seed);
 
+PARROT_WARN_UNUSED_RESULT
+PARROT_PURE_FUNCTION
+size_t key_hash_PMC(PARROT_INTERP, ARGIN(PMC *value), NULLOK(size_t seed))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_WARN_UNUSED_RESULT
+size_t key_hash_STRING(PARROT_INTERP,
+    ARGMOD(STRING *s),
+    NULLOK(size_t seed))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        FUNC_MODIFIES(*s);
+
 void parrot_chash_destroy(PARROT_INTERP, ARGMOD(Hash *hash))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
@@ -251,68 +371,149 @@
         __attribute__nonnull__(4)
         __attribute__nonnull__(5);
 
-#define ASSERT_ARGS_parrot_dump_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_parrot_hash_clone __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+PARROT_WARN_UNUSED_RESULT
+PARROT_PURE_FUNCTION
+int PMC_compare(PARROT_INTERP, ARGIN(PMC *a), ARGIN_NULLOK(PMC *b))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_PURE_FUNCTION
+int pointer_compare(SHIM_INTERP,
+    ARGIN_NULLOK(const void *a),
+    ARGIN_NULLOK(const void *b));
+
+PARROT_WARN_UNUSED_RESULT
+int STRING_compare(PARROT_INTERP,
+    ARGIN(const void *search_key),
+    ARGIN_NULLOK(const void *bucket_key))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+#define ASSERT_ARGS_parrot_dump_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_parrot_hash_clone __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(hash) \
-    || PARROT_ASSERT_ARG(dest)
-#define ASSERT_ARGS_parrot_hash_delete __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(hash) \
-    || PARROT_ASSERT_ARG(key)
-#define ASSERT_ARGS_parrot_hash_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(hash)
-#define ASSERT_ARGS_parrot_hash_exists __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(hash) \
-    || PARROT_ASSERT_ARG(key)
-#define ASSERT_ARGS_parrot_hash_get __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(hash) \
-    || PARROT_ASSERT_ARG(key)
-#define ASSERT_ARGS_parrot_hash_get_bucket __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(hash)
-#define ASSERT_ARGS_parrot_hash_get_idx __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(hash) \
-    || PARROT_ASSERT_ARG(key)
-#define ASSERT_ARGS_parrot_hash_put __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(hash)
-#define ASSERT_ARGS_parrot_hash_size __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(hash)
-#define ASSERT_ARGS_parrot_hash_visit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(hash) \
-    || PARROT_ASSERT_ARG(pinfo)
-#define ASSERT_ARGS_parrot_mark_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(hash)
-#define ASSERT_ARGS_parrot_new_cstring_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_parrot_new_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_parrot_new_intval_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_parrot_new_pmc_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(container)
-#define ASSERT_ARGS_parrot_new_pointer_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_int_compare __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_key_hash_int __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_parrot_chash_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(hash)
-#define ASSERT_ARGS_parrot_chash_destroy_values __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(hash) \
-    || PARROT_ASSERT_ARG(func)
-#define ASSERT_ARGS_parrot_create_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(hash) \
+    , PARROT_ASSERT_ARG(dest))
+#define ASSERT_ARGS_parrot_hash_delete __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(hash) \
+    , PARROT_ASSERT_ARG(key))
+#define ASSERT_ARGS_parrot_hash_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(hash))
+#define ASSERT_ARGS_parrot_hash_exists __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(hash) \
+    , PARROT_ASSERT_ARG(key))
+#define ASSERT_ARGS_parrot_hash_get __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(hash) \
+    , PARROT_ASSERT_ARG(key))
+#define ASSERT_ARGS_parrot_hash_get_bucket __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(hash))
+#define ASSERT_ARGS_parrot_hash_get_idx __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(hash) \
+    , PARROT_ASSERT_ARG(key))
+#define ASSERT_ARGS_parrot_hash_put __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(hash))
+#define ASSERT_ARGS_parrot_hash_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(hash))
+#define ASSERT_ARGS_parrot_hash_visit __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(hash) \
+    , PARROT_ASSERT_ARG(pinfo))
+#define ASSERT_ARGS_parrot_mark_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(hash))
+#define ASSERT_ARGS_parrot_new_cstring_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_parrot_new_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_parrot_new_intval_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_parrot_new_pointer_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_get_integer_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_get_number_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_get_string_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(value))
+#define ASSERT_ARGS_hash_key_from_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(hash))
+#define ASSERT_ARGS_hash_key_from_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(hash) \
+    , PARROT_ASSERT_ARG(key))
+#define ASSERT_ARGS_hash_key_from_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(hash) \
+    , PARROT_ASSERT_ARG(key))
+#define ASSERT_ARGS_hash_key_to_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(hash))
+#define ASSERT_ARGS_hash_key_to_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(hash) \
+    , PARROT_ASSERT_ARG(key))
+#define ASSERT_ARGS_hash_key_to_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(hash))
+#define ASSERT_ARGS_hash_value_from_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(hash))
+#define ASSERT_ARGS_hash_value_from_number __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(hash))
+#define ASSERT_ARGS_hash_value_from_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(hash))
+#define ASSERT_ARGS_hash_value_from_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(hash))
+#define ASSERT_ARGS_hash_value_to_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(hash))
+#define ASSERT_ARGS_hash_value_to_number __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(hash))
+#define ASSERT_ARGS_hash_value_to_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(hash))
+#define ASSERT_ARGS_hash_value_to_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(hash))
+#define ASSERT_ARGS_int_compare __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_key_hash_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_key_hash_PMC __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(value))
+#define ASSERT_ARGS_key_hash_STRING __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_parrot_chash_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(hash))
+#define ASSERT_ARGS_parrot_chash_destroy_values __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(hash) \
+    , PARROT_ASSERT_ARG(func))
+#define ASSERT_ARGS_parrot_create_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(compare) \
+    , PARROT_ASSERT_ARG(keyhash))
+#define ASSERT_ARGS_PMC_compare __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(a))
+#define ASSERT_ARGS_pointer_compare __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_STRING_compare __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(compare) \
-    || PARROT_ASSERT_ARG(keyhash)
+    , PARROT_ASSERT_ARG(search_key))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/hash.c */
 

Modified: branches/orderedhash_revamp/include/parrot/hll.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/hll.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/hll.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -77,31 +77,31 @@
 void Parrot_init_HLL(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_Parrot_get_ctx_HLL_namespace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_get_ctx_HLL_type __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_get_HLL_id __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_get_HLL_name __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_get_HLL_namespace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_get_HLL_type __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_get_ctx_HLL_namespace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_get_ctx_HLL_type __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_get_HLL_id __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_get_HLL_name __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_get_HLL_namespace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_get_HLL_type __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
 #define ASSERT_ARGS_Parrot_regenerate_HLL_namespaces \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_register_HLL __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_register_HLL __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(hll_name)
-#define ASSERT_ARGS_Parrot_register_HLL_lib __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(hll_name))
+#define ASSERT_ARGS_Parrot_register_HLL_lib __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(hll_lib)
-#define ASSERT_ARGS_Parrot_register_HLL_type __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_init_HLL __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+    , PARROT_ASSERT_ARG(hll_lib))
+#define ASSERT_ARGS_Parrot_register_HLL_type __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_init_HLL __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/hll.c */
 

Modified: branches/orderedhash_revamp/include/parrot/interpreter.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/interpreter.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/interpreter.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -67,12 +67,10 @@
     PARROT_SWITCH_CORE      = 0x02,         /*   P   = prederef   */
     PARROT_CGP_CORE         = 0x06,         /*  CP                */
     PARROT_CGOTO_CORE       = 0x04,         /*  C    = cgoto      */
-    PARROT_JIT_CORE         = 0x10,         /* J     = JIT        */
-    PARROT_CGP_JIT_CORE     = 0x16,         /* JCP                */
-    PARROT_SWITCH_JIT_CORE  = 0x12,         /* J P                */
     PARROT_EXEC_CORE        = 0x20,         /* TODO Parrot_exec_run variants */
     PARROT_GC_DEBUG_CORE    = 0x40,         /* run GC before each op */
-    PARROT_DEBUGGER_CORE    = 0x80          /* used by parrot debugger */
+    PARROT_DEBUGGER_CORE    = 0x80,         /* used by parrot debugger */
+    PARROT_PROFILING_CORE   = 0x160         /* used by parrot debugger */
 } Parrot_Run_core_t;
 /* &end_gen */
 
@@ -124,14 +122,14 @@
 #define Interp_debug_CLEAR(interp, flag) ((interp)->debug_flags &= ~(flag))
 #define Interp_debug_TEST(interp, flag)  ((interp)->debug_flags & (flag))
 
-#define Interp_trace_SET(interp, flag)   (CONTEXT(interp)->trace_flags |= (flag))
-#define Interp_trace_CLEAR(interp, flag) (CONTEXT(interp)->trace_flags &= ~(flag))
-#define Interp_trace_TEST(interp, flag)  (CONTEXT(interp)->trace_flags & (flag))
+#define Interp_trace_SET(interp, flag)   Parrot_pcc_trace_flags_on(interp, interp->ctx, (flag))
+#define Interp_trace_CLEAR(interp, flag) Parrot_pcc_trace_flags_off(interp, interp->ctx, (flag))
+#define Interp_trace_TEST(interp, flag)  Parrot_pcc_trace_flags_test(interp, interp->ctx, (flag))
 
 #define Interp_core_SET(interp, core)   ((interp)->run_core = (core))
 #define Interp_core_TEST(interp, core)  ((interp)->run_core == (core))
 
-#include "parrot/register.h"
+#include "parrot/context.h"
 #include "parrot/parrot.h"
 #include "parrot/warnings.h"
 
@@ -140,100 +138,16 @@
 
 #include "parrot/debugger.h"
 #include "parrot/multidispatch.h"
+#include "parrot/call.h"
 
 typedef struct warnings_t {
     Warnings_classes classes;
 } *Warnings;
 
-/* ProfData have these extra items in front followed by
- * one entry per op at (op + extra) */
-
-typedef enum {
-     PARROT_PROF_GC_p1,        /* pass 1 mark root set */
-     PARROT_PROF_GC_p2,        /* pass 2 mark next_for_GC */
-     PARROT_PROF_GC_cp,        /* collect PMCs */
-     PARROT_PROF_GC_cb,        /* collect buffers */
-     PARROT_PROF_GC,
-     PARROT_PROF_EXCEPTION,
-     PARROT_PROF_EXTRA
-} profile_extra_enum;
-
-/* data[op_count] is time spent for exception handling */
-typedef struct ProfData {
-    int op;
-    UINTVAL numcalls;
-    FLOATVAL time;
-} ProfData;
-
-typedef struct _RunProfile {
-    FLOATVAL starttime;
-    FLOATVAL gc_time;
-    opcode_t cur_op;
-    ProfData *data;
-} RunProfile;
-
 /* Forward declaration for imc_info_t -- the actual struct is
  * defined in imcc/imc.h */
 struct _imc_info_t;
 
-typedef union {
-    PMC         **regs_p;
-    STRING      **regs_s;
-} Regs_ps;
-
-typedef union {
-    FLOATVAL     *regs_n;
-    INTVAL       *regs_i;
-} Regs_ni;
-
-/* If CTX_LEAK_DEBUG is enabled, then turning on PARROT_CTX_DESTROY_DEBUG_FLAG
-   will print tons of detail about when Parrot_Context structures are allocated
-   and deallocated to stderr.  If CTX_LEAK_DEBUG is disabled, then all of the
-   relevant code is omitted, and PARROT_CTX_DESTROY_DEBUG_FLAG has no effect.
- */
-#define CTX_LEAK_DEBUG 1
-
-struct Parrot_Context {
-    /* common header with Interp_Context */
-    struct Parrot_Context *caller_ctx;      /* caller context */
-    Regs_ni                bp;              /* pointers to FLOATVAL & INTVAL */
-    Regs_ps                bp_ps;           /* pointers to PMC & STR */
-
-    /* end common header */
-    INTVAL                n_regs_used[4];   /* INSP in PBC points to Sub */
-    PMC                   *lex_pad;         /* LexPad PMC */
-    struct Parrot_Context *outer_ctx;       /* outer context, if a closure */
-
-    /* new call scheme and introspective variables */
-    PMC      *current_sub;           /* the Sub we are executing */
-
-    /* for now use a return continuation PMC */
-    PMC      *handlers;              /* local handlers for the context */
-    PMC      *current_cont;          /* the return continuation PMC */
-    PMC      *current_object;        /* current object if a method call */
-    PMC      *current_namespace;     /* The namespace we're currently in */
-    PMC      *results_signature;     /* non-const results signature PMC */
-    opcode_t *current_pc;            /* program counter of Sub invocation */
-    opcode_t *current_results;       /* ptr into code with get_results opcode */
-
-    /* deref the constants - we need it all the time */
-    struct PackFile_Constant **constants;
-
-    INTVAL                 current_HLL;     /* see also src/hll.c */
-    size_t                 regs_mem_size;   /* memory occupied by registers */
-    int                    ref_count;       /* how often refered to */
-    int                    gc_mark;         /* marked in gc run */
-
-    UINTVAL                warns;           /* Keeps track of what warnings
-                                             * have been activated */
-    UINTVAL                errors;          /* fatals that can be turned off */
-    UINTVAL                trace_flags;
-    UINTVAL                recursion_depth; /* Sub call recursion depth */
-
-    /* code->prederefed.code - code->base.data in opcodes
-     * to simplify conversion between code ptrs in e.g. invoke */
-    size_t pred_offset;
-};
 
 struct _Thread_data;    /* in thread.h */
 struct _Caches;         /* caches .h */
@@ -250,65 +164,39 @@
     size_t n_allocated;                 /* allocated size of it */
 } Prederef;
 
+/*
+ * Get Context from interpeter.
+ */
+#define CONTEXT(interp)         Parrot_pcc_get_context_struct((interp), (interp)->ctx)
 
 /*
- * This is an 'inlined' copy of the first 3 Context items for
- * faster access of registers mainly
- * During a context switch a 3 pointers are set
+ * Helper macros to fetch fields from context.
+ *
+ * Not considered as part of public API. Should be replaced with proper accessor
+ * functions to manipulate Context.
  */
-typedef struct Interp_Context {
-    /* common header */
-    struct Parrot_Context *state;       /* context  */
-    Regs_ni                bp;          /* pointers to FLOATVAL & INTVAL */
-    Regs_ps                bp_ps;       /* pointers to PMC & STR */
-    /* end common header */
-} Interp_Context;
-
-#define CONTEXT(interp) ((interp)->ctx.state)
-
-#define CHUNKED_CTX_MEM 0           /* no longer works, but will be reinstated
-                                     * some day; see src/register.c for details.
-                                    */
+#define CURRENT_CONTEXT(interp) ((interp)->ctx)
+
 
 typedef struct _context_mem {
-#if CHUNKED_CTX_MEM
-    char *data;                     /* ctx + register store */
-    char *free;                     /* free to allocate */
-    char *threshold;                /* continuation threshold */
-    struct _context_mem *prev;      /* previous allocated area */
-#else
     void **free_list;               /* array of free-lists, per size free slots */
     int n_free_slots;               /* amount of allocated */
-#endif
-
 } context_mem;
 
-/* Wrap the jump buffer in a struct, to make it a linked list. Jump buffers are
- * used to resume execution at a point in the runloop where an exception
- * handler can be run. Ultimately this information should be part of
- * Parrot_Context, but at this point a new context isn't created for every
- * runloop ID, so it still needs to be a separate stack for a while longer. */
-
-typedef struct parrot_runloop_t {
-    Parrot_jump_buff         resume;        /* jmp_buf */
-    struct parrot_runloop_t *prev;          /* interpreter's runloop
-                                             * jump buffer stack */
-    opcode_t                *handler_start; /* Used in exception handling */
-} parrot_runloop_t;
-
-typedef parrot_runloop_t Parrot_runloop;
-
-
 struct _handler_node_t; /* forward def - exit.h */
 
 /* The actual interpreter structure */
 struct parrot_interp_t {
-    struct Interp_Context ctx;
-    context_mem           ctx_mem;            /* ctx memory managment */
+    PMC           *ctx;                       /* current Context */
 
-    struct Arenas *arena_base;                /* Pointer to this interpreter's
+    struct Memory_Pools *mem_pools;                /* Pointer to this interpreter's
                                                * arena */
 
+    struct GC_Subsystem *gc_sys;              /*functions and data specific
+                                                  to current GC subsystem*/
+
+    PMC *gc_registry;                         /* root set of registered PMCs */
+
     PMC     *class_hash;                      /* Hash of classes */
     VTABLE **vtables;                         /* array of vtable ptrs */
     int      n_vtable_max;                    /* highest used type */
@@ -339,10 +227,9 @@
 
     UINTVAL debug_flags;                      /* debug settings */
 
-    INTVAL run_core;                          /* type of core to run the ops */
-
-    /* TODO profile per code segment or global */
-    RunProfile *profile;                      /* profile counters */
+    struct runcore_t  *run_core;              /* type of core to run the ops */
+    struct runcore_t **cores;                 /* array of known runcores */
+    UINTVAL            num_cores;             /* number of known runcores */
 
     INTVAL resume_flag;
     size_t resume_offset;
@@ -356,7 +243,7 @@
 
     PDB_t  *pdb;                              /* debug /trace system */
 
-    struct Stack_Chunk *dynamic_env;          /* current dynamic environment */
+    PMC * dynamic_env;                        /* Dynamic environment stack */
 
     void *lo_var_ptr;                         /* Pointer to memory on runops
                                                * system stack */
@@ -380,7 +267,6 @@
     /* 8:   PMC *PBC_Libs                Hash of load_bytecode cde */
     /* 9:   PMC *Executable              String PMC with name from argv[0]. */
 
-    PMC *gc_registry;                         /* root set of registered PMCs */
 
     PMC *HLL_info;                            /* HLL names and types */
     PMC *HLL_namespace;                       /* cache of HLL toplevel ns */
@@ -388,8 +274,6 @@
     PMC *root_namespace;                      /* namespace hash */
     PMC *scheduler;                           /* concurrency scheduler */
 
-    MMD_table *binop_mmd_funcs;               /* Table of MMD functions */
-    UINTVAL    n_binop_mmd_funcs;             /* MMD function count */
     MMD_Cache *op_mmd_cache;                  /* MMD cache for builtins. */
 
     struct _Caches * caches;                  /* see caches.h */
@@ -411,15 +295,6 @@
 
     UINTVAL recursion_limit;                  /* Sub call resursion limit */
 
-    UINTVAL gc_generation;                    /* GC generation number */
-
-    opcode_t *current_args;                   /* ptr into code w/ set_args op */
-    opcode_t *current_params;                 /* ... w/ get_params op */
-    opcode_t *current_returns;                /* ... w/ get_returns op */
-    PMC      *args_signature;                 /* non-const args signature PMC */
-    PMC      *params_signature;               /* non-const params sig PMC     */
-    PMC      *returns_signature;              /* non-const returns sig PMC    */
-
     /* during a call sequencer the caller fills these objects
      * inside the invoke these get moved to the context structure */
     PMC *current_cont;                        /* the return continuation PMC */
@@ -466,7 +341,7 @@
 #endif
 
 #if PARROT_CATCH_NULL
-PARROT_DATA PMC * PMCNULL;   /* Holds single Null PMC */
+PARROT_DATA PMC    *PMCNULL;    /* Holds single Null PMC */
 #else
 #  define PMCNULL         ((PMC *)NULL)
 #endif /* PARROT_CATCH_NULL */
@@ -478,7 +353,9 @@
 #  define PMC_IS_NULL(pmc) (pmc) == NULL
 #endif
 
-#define STRING_IS_NULL(s) ((s) == NULL)
+PARROT_DATA STRING *STRINGNULL; /* a single Null STRING */
+
+#define STRING_IS_NULL(s) ((s) == STRINGNULL || (s) == NULL)
 #define STRING_IS_EMPTY(s) !(int)(s)->strlen
 
 /* &gen_from_def(sysinfo.pasm) prefix(SYSINFO_) */
@@ -521,11 +398,11 @@
     SHIM(void *arg))
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_make_interpreter __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_really_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_make_interpreter __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_really_destroy __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/interp/inter_create.c */
 
@@ -533,16 +410,19 @@
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
 PARROT_EXPORT
-void Parrot_callback_C(ARGIN(char *external_data), ARGMOD(PMC *user_data))
+void Parrot_callback_C(
+    ARGIN(char *external_data),
+    ARGMOD_NULLOK(PMC *user_data))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
         FUNC_MODIFIES(*user_data);
 
 PARROT_EXPORT
-void Parrot_callback_D(ARGMOD(PMC *user_data), ARGIN(char *external_data))
+void Parrot_callback_D(
+    ARGMOD(PMC *user_data),
+    ARGMOD_NULLOK(char *external_data))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*user_data);
+        FUNC_MODIFIES(*user_data)
+        FUNC_MODIFIES(*external_data);
 
 PARROT_EXPORT
 PARROT_CANNOT_RETURN_NULL
@@ -566,21 +446,19 @@
         __attribute__nonnull__(3)
         FUNC_MODIFIES(* user_data);
 
-#define ASSERT_ARGS_Parrot_callback_C __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(external_data) \
-    || PARROT_ASSERT_ARG(user_data)
-#define ASSERT_ARGS_Parrot_callback_D __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(user_data) \
-    || PARROT_ASSERT_ARG(external_data)
-#define ASSERT_ARGS_Parrot_make_cb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_callback_C __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(external_data))
+#define ASSERT_ARGS_Parrot_callback_D __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(user_data))
+#define ASSERT_ARGS_Parrot_make_cb __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub) \
-    || PARROT_ASSERT_ARG(user_data) \
-    || PARROT_ASSERT_ARG(cb_signature)
-#define ASSERT_ARGS_Parrot_run_callback __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(sub) \
+    , PARROT_ASSERT_ARG(user_data) \
+    , PARROT_ASSERT_ARG(cb_signature))
+#define ASSERT_ARGS_Parrot_run_callback __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(user_data) \
-    || PARROT_ASSERT_ARG(external_data)
+    , PARROT_ASSERT_ARG(user_data) \
+    , PARROT_ASSERT_ARG(external_data))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/interp/inter_cb.c */
 
@@ -657,35 +535,35 @@
 STRING * sysinfo_s(PARROT_INTERP, INTVAL info_wanted)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_interpinfo __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_interpinfo_p __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_interpinfo_s __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_compile_file __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_interpinfo __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_interpinfo_p __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_interpinfo_s __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_compile_file __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(fullname) \
-    || PARROT_ASSERT_ARG(error)
-#define ASSERT_ARGS_Parrot_compreg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(fullname) \
+    , PARROT_ASSERT_ARG(error))
+#define ASSERT_ARGS_Parrot_compreg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(type) \
-    || PARROT_ASSERT_ARG(func)
-#define ASSERT_ARGS_Parrot_mark_method_writes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(type) \
+    , PARROT_ASSERT_ARG(func))
+#define ASSERT_ARGS_Parrot_mark_method_writes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_register_nci_method __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_register_nci_method __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(func) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(proto)
-#define ASSERT_ARGS_register_raw_nci_method_in_ns __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(func) \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(proto))
+#define ASSERT_ARGS_register_raw_nci_method_in_ns __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(func) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_sysinfo_i __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_sysinfo_s __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+    , PARROT_ASSERT_ARG(func) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_sysinfo_i __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_sysinfo_s __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/interp/inter_misc.c */
 
@@ -695,9 +573,7 @@
 void exec_init_prederef(PARROT_INTERP,
     void *prederef_arena);
 void prepare_for_run(PARROT_INTERP);
-void *init_jit(PARROT_INTERP, opcode_t *pc);
-PARROT_EXPORT void dynop_register(PARROT_INTERP, PMC* op_lib);
-void do_prederef(void **pc_prederef, PARROT_INTERP, int type);
+PARROT_EXPORT void dynop_register(PARROT_INTERP, PMC *op_lib);
 
 /* interpreter.pmc */
 void clone_interpreter(Parrot_Interp dest, Parrot_Interp self, INTVAL flags);
@@ -707,12 +583,6 @@
 PARROT_EXPORT void disable_event_checking(PARROT_INTERP);
 PARROT_EXPORT void enable_event_checking(PARROT_INTERP);
 
-#if CTX_LEAK_DEBUG
-#  define Parrot_context_ref(a, b) Parrot_context_ref_trace((a), (b), __FILE__, __LINE__)
-#else /* !CTX_LEAK_DEBUG */
-#  define Parrot_context_ref(a, b) (((b)->ref_count++), (b))
-#endif /* CTX_LEAK_DEBUG */
-
 #else /* !PARROT_IN_CORE */
 
 typedef void * *(*native_func_t)(PARROT_INTERP,
@@ -724,6 +594,9 @@
 #ifndef PMC_IS_NULL
 #  define PMC_IS_NULL(pmc) PMC_is_null(NULL, (pmc))
 #endif
+#ifndef STRING_IS_NULL
+#  define STRING_IS_NULL(s) ((s) == NULL || STRING_is_null(NULL, (s))
+#endif
 
 #endif   /* PARROT_INTERPRETER_H_GUARD */
 

Modified: branches/orderedhash_revamp/include/parrot/io.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/io.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/io.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -129,13 +129,13 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-#define ASSERT_ARGS_Parrot_io_finish __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_io_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_IOData_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_io_finish __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_io_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_IOData_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(piodata)
+    , PARROT_ASSERT_ARG(piodata))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/io/core.c */
 
@@ -144,9 +144,8 @@
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
 PARROT_EXPORT
-INTVAL Parrot_io_close(PARROT_INTERP, ARGMOD(PMC *pmc))
+INTVAL Parrot_io_close(PARROT_INTERP, ARGMOD_NULLOK(PMC *pmc))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
         FUNC_MODIFIES(*pmc);
 
 PARROT_EXPORT
@@ -180,9 +179,8 @@
         __attribute__nonnull__(4);
 
 PARROT_EXPORT
-void Parrot_io_flush(PARROT_INTERP, ARGMOD(PMC *pmc))
+void Parrot_io_flush(PARROT_INTERP, ARGMOD_NULLOK(PMC *pmc))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
         FUNC_MODIFIES(*pmc);
 
 PARROT_EXPORT
@@ -352,82 +350,80 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*pmc);
 
-#define ASSERT_ARGS_Parrot_io_close __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_io_close_piohandle __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_io_eof __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_io_eprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_io_fdopen __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sflags)
-#define ASSERT_ARGS_Parrot_io_flush __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_io_fprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_io_getfd __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_io_is_closed __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_io_is_tty __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_io_make_offset __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_io_new_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_io_open __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_io_peek __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc) \
-    || PARROT_ASSERT_ARG(buffer)
-#define ASSERT_ARGS_Parrot_io_printf __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_io_putps __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_io_puts __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_io_readline __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_io_reads __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_io_seek __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_io_STDERR __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_io_stdhandle __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_io_STDIN __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_io_STDOUT __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_io_tell __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_io_write __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc) \
-    || PARROT_ASSERT_ARG(buffer)
-#define ASSERT_ARGS_Parrot_io_make_offset32 __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_io_make_offset_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_io_close __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_io_close_piohandle __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_io_eof __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_Parrot_io_eprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_Parrot_io_fdopen __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(sflags))
+#define ASSERT_ARGS_Parrot_io_flush __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_io_fprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc) \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_Parrot_io_getfd __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_Parrot_io_is_closed __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_Parrot_io_is_tty __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_Parrot_io_make_offset __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_io_new_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_io_open __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_io_peek __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc) \
+    , PARROT_ASSERT_ARG(buffer))
+#define ASSERT_ARGS_Parrot_io_printf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_Parrot_io_putps __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_Parrot_io_puts __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc) \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_Parrot_io_readline __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_Parrot_io_reads __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_Parrot_io_seek __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_Parrot_io_STDERR __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_io_stdhandle __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_io_STDIN __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_io_STDOUT __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_io_tell __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_Parrot_io_write __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc) \
+    , PARROT_ASSERT_ARG(buffer))
+#define ASSERT_ARGS_Parrot_io_make_offset32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_io_make_offset_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
+    , PARROT_ASSERT_ARG(pmc))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/io/api.c */
 
@@ -502,39 +498,39 @@
         __attribute__nonnull__(3)
         FUNC_MODIFIES(*filehandle);
 
-#define ASSERT_ARGS_Parrot_io_fill_readbuf __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_io_fill_readbuf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_flush_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_flush_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_init_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_io_peek_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_init_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_io_peek_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle) \
-    || PARROT_ASSERT_ARG(buf)
-#define ASSERT_ARGS_Parrot_io_read_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(filehandle) \
+    , PARROT_ASSERT_ARG(buf))
+#define ASSERT_ARGS_Parrot_io_read_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle) \
-    || PARROT_ASSERT_ARG(buf)
-#define ASSERT_ARGS_Parrot_io_readline_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(filehandle) \
+    , PARROT_ASSERT_ARG(buf))
+#define ASSERT_ARGS_Parrot_io_readline_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle) \
-    || PARROT_ASSERT_ARG(buf)
-#define ASSERT_ARGS_Parrot_io_seek_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(filehandle) \
+    , PARROT_ASSERT_ARG(buf))
+#define ASSERT_ARGS_Parrot_io_seek_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_setbuf __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_setbuf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_setlinebuf __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_setlinebuf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_write_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_write_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle) \
-    || PARROT_ASSERT_ARG(s)
+    , PARROT_ASSERT_ARG(filehandle) \
+    , PARROT_ASSERT_ARG(s))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/io/buffer.c */
 
@@ -560,14 +556,14 @@
         FUNC_MODIFIES(*filehandle)
         FUNC_MODIFIES(*s);
 
-#define ASSERT_ARGS_Parrot_io_read_utf8 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_io_read_utf8 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle) \
-    || PARROT_ASSERT_ARG(buf)
-#define ASSERT_ARGS_Parrot_io_write_utf8 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(filehandle) \
+    , PARROT_ASSERT_ARG(buf))
+#define ASSERT_ARGS_Parrot_io_write_utf8 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle) \
-    || PARROT_ASSERT_ARG(s)
+    , PARROT_ASSERT_ARG(filehandle) \
+    , PARROT_ASSERT_ARG(s))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/io/utf8.c */
 
@@ -714,65 +710,65 @@
     ARGIN_NULLOK(unsigned char *new_start))
         __attribute__nonnull__(2);
 
-#define ASSERT_ARGS_Parrot_io_close_filehandle __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_io_close_filehandle __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_io_flush_filehandle __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_Parrot_io_flush_filehandle __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_io_get_buffer_end __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_io_get_buffer_next __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_get_buffer_start __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_get_file_position __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_get_file_size __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_get_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(filehandle)
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_Parrot_io_get_buffer_end __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_io_get_buffer_next __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_get_buffer_start __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_get_file_position __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_get_file_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_get_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(filehandle))
 #define ASSERT_ARGS_Parrot_io_get_last_file_position \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_get_os_handle __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(filehandle)
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_get_os_handle __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(filehandle))
 #define ASSERT_ARGS_Parrot_io_is_closed_filehandle \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_io_is_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_Parrot_io_is_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle) \
-    || PARROT_ASSERT_ARG(value)
-#define ASSERT_ARGS_Parrot_io_parse_open_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_io_set_file_position __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_set_file_size __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_set_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_set_os_handle __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_clear_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_get_buffer_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_get_buffer_size __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_make_string __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(buf)
-#define ASSERT_ARGS_Parrot_io_set_buffer_end __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_set_buffer_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_set_buffer_next __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_set_buffer_size __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_set_buffer_start __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(filehandle)
+    , PARROT_ASSERT_ARG(filehandle) \
+    , PARROT_ASSERT_ARG(value))
+#define ASSERT_ARGS_Parrot_io_parse_open_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_io_set_file_position __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_set_file_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_set_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_set_os_handle __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_clear_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_get_buffer_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_get_buffer_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_make_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(buf))
+#define ASSERT_ARGS_Parrot_io_set_buffer_end __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_set_buffer_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_set_buffer_next __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_set_buffer_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_set_buffer_start __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(filehandle))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/io/filehandle.c */
 
@@ -863,37 +859,37 @@
         __attribute__nonnull__(1)
         FUNC_MODIFIES(*socket);
 
-#define ASSERT_ARGS_Parrot_io_accept __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_io_accept __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_io_bind __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_Parrot_io_bind __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc) \
-    || PARROT_ASSERT_ARG(address)
-#define ASSERT_ARGS_Parrot_io_connect __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc) \
-    || PARROT_ASSERT_ARG(address)
-#define ASSERT_ARGS_Parrot_io_listen __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_io_new_socket_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_io_poll __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_io_recv __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc) \
-    || PARROT_ASSERT_ARG(buf)
-#define ASSERT_ARGS_Parrot_io_send __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc) \
-    || PARROT_ASSERT_ARG(buf)
-#define ASSERT_ARGS_Parrot_io_socket __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_io_socket_is_closed __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(socket)
+    , PARROT_ASSERT_ARG(pmc) \
+    , PARROT_ASSERT_ARG(address))
+#define ASSERT_ARGS_Parrot_io_connect __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc) \
+    , PARROT_ASSERT_ARG(address))
+#define ASSERT_ARGS_Parrot_io_listen __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_Parrot_io_new_socket_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_io_poll __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_Parrot_io_recv __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc) \
+    , PARROT_ASSERT_ARG(buf))
+#define ASSERT_ARGS_Parrot_io_send __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc) \
+    , PARROT_ASSERT_ARG(buf))
+#define ASSERT_ARGS_Parrot_io_socket __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_io_socket_is_closed __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(socket))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/io/socket_api.c */
 
@@ -952,7 +948,7 @@
 
 typedef enum {
     PIO_PROTO_TCP   = 6,
-    PIO_PROTO_UDP   = 17,
+    PIO_PROTO_UDP   = 17 /* last element */
 } Socket_Protocol;
 /* &end_gen */
 

Modified: branches/orderedhash_revamp/include/parrot/io_portable.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/io_portable.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/io_portable.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -97,42 +97,42 @@
         __attribute__nonnull__(3)
         FUNC_MODIFIES(*s);
 
-#define ASSERT_ARGS_Parrot_io_close_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_io_close_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_fdopen_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_fdopen_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_flush_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_io_getblksize_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_io_init_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_io_is_closed_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_open_pipe_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_io_open_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle) \
-    || PARROT_ASSERT_ARG(path)
-#define ASSERT_ARGS_Parrot_io_peek_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle) \
-    || PARROT_ASSERT_ARG(buf)
-#define ASSERT_ARGS_Parrot_io_read_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(buf)
-#define ASSERT_ARGS_Parrot_io_seek_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_flush_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_io_getblksize_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_io_init_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_io_is_closed_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_open_pipe_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_io_open_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(filehandle) \
+    , PARROT_ASSERT_ARG(path))
+#define ASSERT_ARGS_Parrot_io_peek_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(filehandle) \
+    , PARROT_ASSERT_ARG(buf))
+#define ASSERT_ARGS_Parrot_io_read_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(buf))
+#define ASSERT_ARGS_Parrot_io_seek_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_tell_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_tell_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_write_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_write_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle) \
-    || PARROT_ASSERT_ARG(s)
+    , PARROT_ASSERT_ARG(filehandle) \
+    , PARROT_ASSERT_ARG(s))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/io/portable.c */
 

Modified: branches/orderedhash_revamp/include/parrot/io_unix.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/io_unix.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/io_unix.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -124,52 +124,52 @@
         __attribute__nonnull__(3)
         FUNC_MODIFIES(*s);
 
-#define ASSERT_ARGS_Parrot_io_async_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_io_async_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle)
+    , PARROT_ASSERT_ARG(filehandle))
 #define ASSERT_ARGS_Parrot_io_close_piohandle_unix \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_io_close_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_io_close_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_fdopen_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_fdopen_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_flush_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_flush_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_getblksize_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_io_init_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_io_is_closed_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_open_pipe_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle) \
-    || PARROT_ASSERT_ARG(command)
-#define ASSERT_ARGS_Parrot_io_open_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(path)
-#define ASSERT_ARGS_Parrot_io_peek_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_io_pipe_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_getblksize_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_io_init_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_io_is_closed_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_open_pipe_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(filehandle) \
+    , PARROT_ASSERT_ARG(command))
+#define ASSERT_ARGS_Parrot_io_open_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(path))
+#define ASSERT_ARGS_Parrot_io_peek_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_io_pipe_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(reader) \
-    || PARROT_ASSERT_ARG(writer)
-#define ASSERT_ARGS_Parrot_io_read_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(writer))
+#define ASSERT_ARGS_Parrot_io_read_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle) \
-    || PARROT_ASSERT_ARG(buf)
-#define ASSERT_ARGS_Parrot_io_seek_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(filehandle) \
+    , PARROT_ASSERT_ARG(buf))
+#define ASSERT_ARGS_Parrot_io_seek_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_tell_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_tell_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_write_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_write_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle) \
-    || PARROT_ASSERT_ARG(s)
+    , PARROT_ASSERT_ARG(filehandle) \
+    , PARROT_ASSERT_ARG(s))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/io/unix.c */
 
@@ -246,34 +246,34 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-#define ASSERT_ARGS_Parrot_io_accept_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_io_accept_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(socket)
-#define ASSERT_ARGS_Parrot_io_bind_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(socket))
+#define ASSERT_ARGS_Parrot_io_bind_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(socket) \
-    || PARROT_ASSERT_ARG(sockaddr)
-#define ASSERT_ARGS_Parrot_io_connect_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(socket) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_Parrot_io_listen_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(socket)
-#define ASSERT_ARGS_Parrot_io_poll_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(socket)
-#define ASSERT_ARGS_Parrot_io_recv_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(socket) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_io_send_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(socket) \
+    , PARROT_ASSERT_ARG(sockaddr))
+#define ASSERT_ARGS_Parrot_io_connect_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(socket) \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_Parrot_io_listen_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(socket))
+#define ASSERT_ARGS_Parrot_io_poll_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(socket))
+#define ASSERT_ARGS_Parrot_io_recv_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(socket) \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_Parrot_io_send_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(socket) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_io_sockaddr_in __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_Parrot_io_sockaddr_in __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(addr)
-#define ASSERT_ARGS_Parrot_io_socket_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(addr))
+#define ASSERT_ARGS_Parrot_io_socket_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
+    , PARROT_ASSERT_ARG(s))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/io/socket_unix.c */
 

Modified: branches/orderedhash_revamp/include/parrot/io_win32.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/io_win32.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/io_win32.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -116,49 +116,49 @@
         __attribute__nonnull__(3);
 
 #define ASSERT_ARGS_Parrot_io_close_piohandle_win32 \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_io_close_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_fdopen_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_io_flush_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_getblksize_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_io_init_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_io_is_closed_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_open_pipe_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle) \
-    || PARROT_ASSERT_ARG(command)
-#define ASSERT_ARGS_Parrot_io_open_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle) \
-    || PARROT_ASSERT_ARG(path)
-#define ASSERT_ARGS_Parrot_io_peek_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_io_pipe_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_io_close_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_fdopen_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_io_flush_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_getblksize_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_io_init_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_io_is_closed_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_open_pipe_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(filehandle) \
+    , PARROT_ASSERT_ARG(command))
+#define ASSERT_ARGS_Parrot_io_open_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(filehandle) \
+    , PARROT_ASSERT_ARG(path))
+#define ASSERT_ARGS_Parrot_io_peek_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_io_pipe_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(reader) \
-    || PARROT_ASSERT_ARG(writer)
-#define ASSERT_ARGS_Parrot_io_read_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(writer))
+#define ASSERT_ARGS_Parrot_io_read_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle) \
-    || PARROT_ASSERT_ARG(buf)
-#define ASSERT_ARGS_Parrot_io_seek_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(filehandle) \
+    , PARROT_ASSERT_ARG(buf))
+#define ASSERT_ARGS_Parrot_io_seek_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_tell_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_tell_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle)
-#define ASSERT_ARGS_Parrot_io_write_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(filehandle))
+#define ASSERT_ARGS_Parrot_io_write_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(filehandle) \
-    || PARROT_ASSERT_ARG(s)
+    , PARROT_ASSERT_ARG(filehandle) \
+    , PARROT_ASSERT_ARG(s))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/io/win32.c */
 /* HEADERIZER BEGIN: src/io/socket_win32.c */
@@ -233,34 +233,34 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-#define ASSERT_ARGS_Parrot_io_accept_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_io_accept_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(socket)
-#define ASSERT_ARGS_Parrot_io_bind_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(socket))
+#define ASSERT_ARGS_Parrot_io_bind_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(socket) \
-    || PARROT_ASSERT_ARG(sockaddr)
-#define ASSERT_ARGS_Parrot_io_connect_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(socket) \
-    || PARROT_ASSERT_ARG(r)
-#define ASSERT_ARGS_Parrot_io_listen_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(socket)
-#define ASSERT_ARGS_Parrot_io_poll_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(socket)
-#define ASSERT_ARGS_Parrot_io_recv_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(socket) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_io_send_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(socket) \
+    , PARROT_ASSERT_ARG(sockaddr))
+#define ASSERT_ARGS_Parrot_io_connect_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(socket) \
+    , PARROT_ASSERT_ARG(r))
+#define ASSERT_ARGS_Parrot_io_listen_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(socket))
+#define ASSERT_ARGS_Parrot_io_poll_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(socket))
+#define ASSERT_ARGS_Parrot_io_recv_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(socket) \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_Parrot_io_send_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(socket) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_io_sockaddr_in __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_Parrot_io_sockaddr_in __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(addr)
-#define ASSERT_ARGS_Parrot_io_socket_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(addr))
+#define ASSERT_ARGS_Parrot_io_socket_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
+    , PARROT_ASSERT_ARG(s))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/io/socket_win32.c */
 

Modified: branches/orderedhash_revamp/include/parrot/key.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/key.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/key.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -15,30 +15,29 @@
 
 #include "parrot/parrot.h"
 
+/*
+ Type of Keys.
+ C<KEY_register_FLAG> used for indirect referencing. E.g.
+   $S0 = "foo"
+   $P1 = $P0[$S0]
+ In this case C<[$S0]> will have type C<KEY_string_FLAG | KEY_register_FLAG>
+ and store I<integer> value of string register number.
+*/
 typedef enum {
     KEY_integer_FLAG        = PObj_private0_FLAG,
     KEY_number_FLAG         = PObj_private1_FLAG,
-    KEY_hash_iterator_FLAGS = PObj_private0_FLAG | PObj_private1_FLAG,
     KEY_string_FLAG         = PObj_private2_FLAG,
     KEY_pmc_FLAG            = PObj_private3_FLAG,
     KEY_register_FLAG       = PObj_private4_FLAG,
 
-    KEY_start_slice_FLAG    = PObj_private5_FLAG,
-    KEY_end_slice_FLAG      = PObj_private6_FLAG,
-    KEY_inf_slice_FLAG      = PObj_private7_FLAG,
-
     KEY_type_FLAGS          = KEY_integer_FLAG         |
                               KEY_number_FLAG          |
                               KEY_string_FLAG          |
                               KEY_pmc_FLAG             |
-                              KEY_register_FLAG        |
-                              KEY_hash_iterator_FLAGS
+                              KEY_register_FLAG
 
 } KEY_flags;
 
-#define KEY_IS_HASH_ITERATOR(k) \
-    ((PObj_get_FLAGS((k)) & KEY_type_FLAGS) == KEY_hash_iterator_FLAGS)
-
 /* HEADERIZER BEGIN: src/key.c */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
@@ -172,63 +171,63 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-#define ASSERT_ARGS_key_append __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_key_append __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(key1) \
-    || PARROT_ASSERT_ARG(key2)
-#define ASSERT_ARGS_key_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(key)
-#define ASSERT_ARGS_key_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(key)
-#define ASSERT_ARGS_key_new __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_key_new_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_key_new_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_key_new_number __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_key_new_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(value)
-#define ASSERT_ARGS_key_new_string __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(value)
-#define ASSERT_ARGS_key_next __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(key)
-#define ASSERT_ARGS_key_number __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(key)
-#define ASSERT_ARGS_key_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(key)
-#define ASSERT_ARGS_key_set_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(key)
-#define ASSERT_ARGS_key_set_number __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(key)
-#define ASSERT_ARGS_key_set_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(key) \
-    || PARROT_ASSERT_ARG(value)
-#define ASSERT_ARGS_key_set_register __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(key)
-#define ASSERT_ARGS_key_set_string __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(key) \
-    || PARROT_ASSERT_ARG(value)
-#define ASSERT_ARGS_key_set_to_string __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_key_type __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(key)
-#define ASSERT_ARGS_key_string __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(key1) \
+    , PARROT_ASSERT_ARG(key2))
+#define ASSERT_ARGS_key_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(key))
+#define ASSERT_ARGS_key_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(key))
+#define ASSERT_ARGS_key_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_key_new_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_key_new_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_key_new_number __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_key_new_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(value))
+#define ASSERT_ARGS_key_new_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(value))
+#define ASSERT_ARGS_key_next __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(key))
+#define ASSERT_ARGS_key_number __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(key))
+#define ASSERT_ARGS_key_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(key))
+#define ASSERT_ARGS_key_set_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(key))
+#define ASSERT_ARGS_key_set_number __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(key))
+#define ASSERT_ARGS_key_set_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(key) \
+    , PARROT_ASSERT_ARG(value))
+#define ASSERT_ARGS_key_set_register __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(key))
+#define ASSERT_ARGS_key_set_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(key) \
+    , PARROT_ASSERT_ARG(value))
+#define ASSERT_ARGS_key_set_to_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_key_type __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(key))
+#define ASSERT_ARGS_key_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(key)
+    , PARROT_ASSERT_ARG(key))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/key.c */
 

Modified: branches/orderedhash_revamp/include/parrot/library.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/library.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/library.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -102,31 +102,31 @@
         FUNC_MODIFIES(*wo_ext)
         FUNC_MODIFIES(*ext);
 
-#define ASSERT_ARGS_Parrot_get_runtime_path __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_get_runtime_prefix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_lib_add_path __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_get_runtime_path __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_get_runtime_prefix __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_lib_add_path __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(path_str)
+    , PARROT_ASSERT_ARG(path_str))
 #define ASSERT_ARGS_Parrot_lib_add_path_from_cstring \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(path)
-#define ASSERT_ARGS_Parrot_locate_runtime_file __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(path))
+#define ASSERT_ARGS_Parrot_locate_runtime_file __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(file_name)
+    , PARROT_ASSERT_ARG(file_name))
 #define ASSERT_ARGS_Parrot_locate_runtime_file_str \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(file)
-#define ASSERT_ARGS_parrot_init_library_paths __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_parrot_split_path_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(file))
+#define ASSERT_ARGS_parrot_init_library_paths __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_parrot_split_path_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(in) \
-    || PARROT_ASSERT_ARG(wo_ext) \
-    || PARROT_ASSERT_ARG(ext)
+    , PARROT_ASSERT_ARG(in) \
+    , PARROT_ASSERT_ARG(wo_ext) \
+    , PARROT_ASSERT_ARG(ext))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/library.c */
 

Modified: branches/orderedhash_revamp/include/parrot/list.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/list.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/list.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -15,7 +15,7 @@
 #define PARROT_LIST_H_GUARD
 
 typedef struct List_chunk {
-    Buffer             data;        /* item store */
+    Buffer             data;        /* item store, Buffer must be first element in struct*/
     struct List_chunk *next;
     struct List_chunk *prev;
     UINTVAL            flags;       /* chunk flags */
@@ -84,7 +84,7 @@
 UINTVAL ld(UINTVAL x);
 
 PARROT_EXPORT
-void list_assign(PARROT_INTERP,
+void Parrot_pmc_array_assign(PARROT_INTERP,
     ARGMOD(List *list),
     INTVAL idx,
     ARGIN_NULLOK(void *item),
@@ -96,12 +96,12 @@
 PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-List * list_clone(PARROT_INTERP, ARGIN(const List *other))
+List * Parrot_pmc_array_clone(PARROT_INTERP, ARGIN(const List *other))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
 PARROT_EXPORT
-void list_delete(PARROT_INTERP,
+void Parrot_pmc_array_delete(PARROT_INTERP,
     ARGMOD(List *list),
     INTVAL idx,
     INTVAL n_items)
@@ -112,13 +112,16 @@
 PARROT_EXPORT
 PARROT_CAN_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
-void * list_get(PARROT_INTERP, ARGMOD(List *list), INTVAL idx, int type)
+void * Parrot_pmc_array_get(PARROT_INTERP,
+    ARGMOD(List *list),
+    INTVAL idx,
+    int type)
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*list);
 
 PARROT_EXPORT
-void list_insert(PARROT_INTERP,
+void Parrot_pmc_array_insert(PARROT_INTERP,
     ARGMOD(List *list),
     INTVAL idx,
     INTVAL n_items)
@@ -127,7 +130,7 @@
         FUNC_MODIFIES(*list);
 
 PARROT_EXPORT
-void list_mark(PARROT_INTERP, ARGMOD(List *list))
+void Parrot_pmc_array_mark(PARROT_INTERP, ARGMOD(List *list))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*list);
@@ -135,24 +138,26 @@
 PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-List * list_new(PARROT_INTERP, PARROT_DATA_TYPE type)
+List * Parrot_pmc_array_new(PARROT_INTERP, PARROT_DATA_TYPE type)
         __attribute__nonnull__(1);
 
 PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-List * list_new_init(PARROT_INTERP, PARROT_DATA_TYPE type, ARGIN(PMC *init))
+List * Parrot_pmc_array_new_init(PARROT_INTERP,
+    PARROT_DATA_TYPE type,
+    ARGIN(PMC *init))
         __attribute__nonnull__(1)
         __attribute__nonnull__(3);
 
 PARROT_EXPORT
-void list_pmc_new(PARROT_INTERP, ARGMOD(PMC *container))
+void Parrot_pmc_array_pmc_new(PARROT_INTERP, ARGMOD(PMC *container))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*container);
 
 PARROT_EXPORT
-void list_pmc_new_init(PARROT_INTERP,
+void Parrot_pmc_array_pmc_new_init(PARROT_INTERP,
     ARGMOD(PMC *container),
     ARGIN(PMC *init))
         __attribute__nonnull__(1)
@@ -162,13 +167,13 @@
 
 PARROT_EXPORT
 PARROT_CAN_RETURN_NULL
-void * list_pop(PARROT_INTERP, ARGMOD(List *list), int type)
+void * Parrot_pmc_array_pop(PARROT_INTERP, ARGMOD(List *list), int type)
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*list);
 
 PARROT_EXPORT
-void list_push(PARROT_INTERP,
+void Parrot_pmc_array_push(PARROT_INTERP,
     ARGMOD(List *list),
     ARGIN_NULLOK(void *item),
     int type)
@@ -177,20 +182,22 @@
         FUNC_MODIFIES(*list);
 
 PARROT_EXPORT
-void list_set_length(PARROT_INTERP, ARGMOD(List *list), INTVAL len)
+void Parrot_pmc_array_set_length(PARROT_INTERP,
+    ARGMOD(List *list),
+    INTVAL len)
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*list);
 
 PARROT_EXPORT
 PARROT_CAN_RETURN_NULL
-void * list_shift(PARROT_INTERP, ARGMOD(List *list), int type)
+void * Parrot_pmc_array_shift(PARROT_INTERP, ARGMOD(List *list), int type)
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*list);
 
 PARROT_EXPORT
-void list_splice(PARROT_INTERP,
+void Parrot_pmc_array_splice(PARROT_INTERP,
     ARGMOD(List *list),
     ARGMOD_NULLOK(List *value_list),
     INTVAL offset,
@@ -201,7 +208,7 @@
         FUNC_MODIFIES(*value_list);
 
 PARROT_EXPORT
-void list_unshift(PARROT_INTERP,
+void Parrot_pmc_array_unshift(PARROT_INTERP,
     ARGMOD(List *list),
     ARGIN(void *item),
     int type)
@@ -211,73 +218,75 @@
         FUNC_MODIFIES(*list);
 
 PARROT_EXPORT
-void list_visit(PARROT_INTERP, ARGIN(List *list), ARGMOD(void *pinfo))
+void Parrot_pmc_array_visit(PARROT_INTERP,
+    ARGIN(List *list),
+    ARGMOD(visit_info *info))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         __attribute__nonnull__(3)
-        FUNC_MODIFIES(*pinfo);
+        FUNC_MODIFIES(*info);
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_PURE_FUNCTION
-INTVAL list_length(SHIM_INTERP, ARGIN(const List *list))
+INTVAL Parrot_pmc_array_length(SHIM_INTERP, ARGIN(const List *list))
         __attribute__nonnull__(2);
 
-#define ASSERT_ARGS_ld __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_list_assign __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_ld __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_pmc_array_assign __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_list_clone __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(list))
+#define ASSERT_ARGS_Parrot_pmc_array_clone __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(other)
-#define ASSERT_ARGS_list_delete __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(other))
+#define ASSERT_ARGS_Parrot_pmc_array_delete __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_list_get __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(list))
+#define ASSERT_ARGS_Parrot_pmc_array_get __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_list_insert __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(list))
+#define ASSERT_ARGS_Parrot_pmc_array_insert __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_list_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(list))
+#define ASSERT_ARGS_Parrot_pmc_array_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_list_new __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_list_new_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(list))
+#define ASSERT_ARGS_Parrot_pmc_array_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_pmc_array_new_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(init)
-#define ASSERT_ARGS_list_pmc_new __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(init))
+#define ASSERT_ARGS_Parrot_pmc_array_pmc_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(container)
-#define ASSERT_ARGS_list_pmc_new_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(container))
+#define ASSERT_ARGS_Parrot_pmc_array_pmc_new_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(container) \
-    || PARROT_ASSERT_ARG(init)
-#define ASSERT_ARGS_list_pop __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(container) \
+    , PARROT_ASSERT_ARG(init))
+#define ASSERT_ARGS_Parrot_pmc_array_pop __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_list_push __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(list))
+#define ASSERT_ARGS_Parrot_pmc_array_push __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_list_set_length __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(list))
+#define ASSERT_ARGS_Parrot_pmc_array_set_length __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_list_shift __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(list))
+#define ASSERT_ARGS_Parrot_pmc_array_shift __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_list_splice __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(list))
+#define ASSERT_ARGS_Parrot_pmc_array_splice __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_list_unshift __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(list))
+#define ASSERT_ARGS_Parrot_pmc_array_unshift __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(list) \
-    || PARROT_ASSERT_ARG(item)
-#define ASSERT_ARGS_list_visit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(list) \
+    , PARROT_ASSERT_ARG(item))
+#define ASSERT_ARGS_Parrot_pmc_array_visit __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(list) \
-    || PARROT_ASSERT_ARG(pinfo)
-#define ASSERT_ARGS_list_length __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(list)
+    , PARROT_ASSERT_ARG(list) \
+    , PARROT_ASSERT_ARG(info))
+#define ASSERT_ARGS_Parrot_pmc_array_length __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(list))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/list.c */
 

Modified: branches/orderedhash_revamp/include/parrot/longopt.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/longopt.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/longopt.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -59,11 +59,11 @@
         __attribute__nonnull__(5)
         FUNC_MODIFIES(* info_buf);
 
-#define ASSERT_ARGS_longopt_get __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_longopt_get __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(argv) \
-    || PARROT_ASSERT_ARG(options) \
-    || PARROT_ASSERT_ARG(info_buf)
+    , PARROT_ASSERT_ARG(argv) \
+    , PARROT_ASSERT_ARG(options) \
+    , PARROT_ASSERT_ARG(info_buf))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/longopt.c */
 

Modified: branches/orderedhash_revamp/include/parrot/memory.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/memory.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/memory.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -117,23 +117,23 @@
     int line)
         __attribute__nonnull__(4);
 
-#define ASSERT_ARGS_mem_sys_allocate __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_mem_sys_allocate_zeroed __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_mem_sys_free __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_mem_sys_realloc __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_mem_sys_realloc_zeroed __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_mem_sys_strdup __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_mem__internal_allocate __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(file)
-#define ASSERT_ARGS_mem__internal_allocate_zeroed __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(file)
-#define ASSERT_ARGS_mem__internal_free __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(file)
-#define ASSERT_ARGS_mem__internal_realloc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(file)
-#define ASSERT_ARGS_mem__internal_realloc_zeroed __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(file)
+#define ASSERT_ARGS_mem_sys_allocate __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_mem_sys_allocate_zeroed __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_mem_sys_free __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_mem_sys_realloc __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_mem_sys_realloc_zeroed __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_mem_sys_strdup __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_mem__internal_allocate __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(file))
+#define ASSERT_ARGS_mem__internal_allocate_zeroed __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(file))
+#define ASSERT_ARGS_mem__internal_free __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(file))
+#define ASSERT_ARGS_mem__internal_realloc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(file))
+#define ASSERT_ARGS_mem__internal_realloc_zeroed __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(file))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/gc/alloc_memory.c */
 

Modified: branches/orderedhash_revamp/include/parrot/misc.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/misc.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/misc.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -101,31 +101,31 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-#define ASSERT_ARGS_Parrot_byte_index __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_byte_index __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(base) \
-    || PARROT_ASSERT_ARG(search)
-#define ASSERT_ARGS_Parrot_byte_rindex __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(search))
+#define ASSERT_ARGS_Parrot_byte_rindex __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(base) \
-    || PARROT_ASSERT_ARG(search)
-#define ASSERT_ARGS_Parrot_float_rand __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_int_rand __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_range_rand __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_register_move __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(dest_regs) \
-    || PARROT_ASSERT_ARG(src_regs) \
-    || PARROT_ASSERT_ARG(info)
-#define ASSERT_ARGS_Parrot_srand __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_uint_rand __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_floatval_mod __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_intval_mod __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_quicksort __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(data) \
-    || PARROT_ASSERT_ARG(cmp)
-#define ASSERT_ARGS_tm_to_array __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(search))
+#define ASSERT_ARGS_Parrot_float_rand __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_int_rand __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_range_rand __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_register_move __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(dest_regs) \
+    , PARROT_ASSERT_ARG(src_regs) \
+    , PARROT_ASSERT_ARG(info))
+#define ASSERT_ARGS_Parrot_srand __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_uint_rand __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_floatval_mod __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_intval_mod __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_quicksort __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(data) \
+    , PARROT_ASSERT_ARG(cmp))
+#define ASSERT_ARGS_tm_to_array __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(tm)
+    , PARROT_ASSERT_ARG(tm))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/utils.c */
 
@@ -205,33 +205,33 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-#define ASSERT_ARGS_Parrot_psprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_psprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pat) \
-    || PARROT_ASSERT_ARG(ary)
-#define ASSERT_ARGS_Parrot_secret_snprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(pat) \
+    , PARROT_ASSERT_ARG(ary))
+#define ASSERT_ARGS_Parrot_secret_snprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(buffer) \
-    || PARROT_ASSERT_ARG(format)
-#define ASSERT_ARGS_Parrot_snprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(format))
+#define ASSERT_ARGS_Parrot_snprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(targ) \
-    || PARROT_ASSERT_ARG(pat)
-#define ASSERT_ARGS_Parrot_sprintf_c __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(targ) \
+    , PARROT_ASSERT_ARG(pat))
+#define ASSERT_ARGS_Parrot_sprintf_c __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pat)
-#define ASSERT_ARGS_Parrot_sprintf_s __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(pat))
+#define ASSERT_ARGS_Parrot_sprintf_s __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pat)
-#define ASSERT_ARGS_Parrot_vsnprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(pat))
+#define ASSERT_ARGS_Parrot_vsnprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(targ) \
-    || PARROT_ASSERT_ARG(pat)
-#define ASSERT_ARGS_Parrot_vsprintf_c __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(targ) \
+    , PARROT_ASSERT_ARG(pat))
+#define ASSERT_ARGS_Parrot_vsprintf_c __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pat)
-#define ASSERT_ARGS_Parrot_vsprintf_s __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(pat))
+#define ASSERT_ARGS_Parrot_vsprintf_s __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pat)
+    , PARROT_ASSERT_ARG(pat))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/misc.c */
 
@@ -302,10 +302,10 @@
         __attribute__nonnull__(2)
         __attribute__nonnull__(3);
 
-#define ASSERT_ARGS_Parrot_sprintf_format __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_sprintf_format __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pat) \
-    || PARROT_ASSERT_ARG(obj)
+    , PARROT_ASSERT_ARG(pat) \
+    , PARROT_ASSERT_ARG(obj))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/spf_render.c */
 

Modified: branches/orderedhash_revamp/include/parrot/multidispatch.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/multidispatch.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/multidispatch.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -33,9 +33,9 @@
 typedef INTVAL (*mmd_f_i_pp)(PARROT_INTERP, PMC *, PMC *);
 
 typedef struct _MMD_init {
-        INTVAL func_nr;
-        INTVAL left, right;
-        funcptr_t func_ptr;
+    INTVAL func_nr;
+    INTVAL left, right;
+    funcptr_t func_ptr;
 } MMD_init;
 
 typedef struct _MMD_table {
@@ -45,14 +45,14 @@
 } MMD_table;
 
 typedef struct _multi_func_list {
-/* TT #646
- * This STRING ideally must be const but actually can't.
- */
-        STRING *multi_name;
-        STRING *short_sig;
-        STRING *full_sig;
-        STRING *ns_name;
-        funcptr_t func_ptr;
+    /* TT #646
+     * This STRING ideally must be const but actually can't.
+     */
+    STRING *multi_name;
+    STRING *short_sig;
+    STRING *full_sig;
+    STRING *ns_name;
+    funcptr_t func_ptr;
 } multi_func_list;
 
 #define MMD_Cache Hash
@@ -199,13 +199,6 @@
 PARROT_EXPORT
 PARROT_CAN_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
-PMC * Parrot_mmd_sort_manhattan(PARROT_INTERP, ARGIN(PMC *candidates))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-PARROT_EXPORT
-PARROT_CAN_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
 PMC * Parrot_mmd_sort_manhattan_by_sig_pmc(PARROT_INTERP,
     ARGIN(PMC *candidates),
     ARGIN(PMC *invoke_sig))
@@ -214,83 +207,80 @@
         __attribute__nonnull__(3);
 
 #define ASSERT_ARGS_Parrot_mmd_add_multi_from_c_args \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub_name) \
-    || PARROT_ASSERT_ARG(short_sig) \
-    || PARROT_ASSERT_ARG(long_sig) \
-    || PARROT_ASSERT_ARG(multi_func_ptr)
+    , PARROT_ASSERT_ARG(sub_name) \
+    , PARROT_ASSERT_ARG(short_sig) \
+    , PARROT_ASSERT_ARG(long_sig) \
+    , PARROT_ASSERT_ARG(multi_func_ptr))
 #define ASSERT_ARGS_Parrot_mmd_add_multi_from_long_sig \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub_name) \
-    || PARROT_ASSERT_ARG(long_sig) \
-    || PARROT_ASSERT_ARG(sub_obj)
+    , PARROT_ASSERT_ARG(sub_name) \
+    , PARROT_ASSERT_ARG(long_sig) \
+    , PARROT_ASSERT_ARG(sub_obj))
 #define ASSERT_ARGS_Parrot_mmd_add_multi_list_from_c_args \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(mmd_info)
+    , PARROT_ASSERT_ARG(mmd_info))
 #define ASSERT_ARGS_Parrot_mmd_build_type_tuple_from_sig_obj \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sig_obj)
-#define ASSERT_ARGS_Parrot_mmd_cache_create __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_mmd_cache_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(sig_obj))
+#define ASSERT_ARGS_Parrot_mmd_cache_create __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_mmd_cache_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(cache)
+    , PARROT_ASSERT_ARG(cache))
 #define ASSERT_ARGS_Parrot_mmd_cache_lookup_by_types \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(cache) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(types)
+    , PARROT_ASSERT_ARG(cache) \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(types))
 #define ASSERT_ARGS_Parrot_mmd_cache_lookup_by_values \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(cache) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(values)
-#define ASSERT_ARGS_Parrot_mmd_cache_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(cache) \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(values))
+#define ASSERT_ARGS_Parrot_mmd_cache_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(cache)
+    , PARROT_ASSERT_ARG(cache))
 #define ASSERT_ARGS_Parrot_mmd_cache_store_by_types \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(cache) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(types) \
-    || PARROT_ASSERT_ARG(chosen)
+    , PARROT_ASSERT_ARG(cache) \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(types) \
+    , PARROT_ASSERT_ARG(chosen))
 #define ASSERT_ARGS_Parrot_mmd_cache_store_by_values \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(cache) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(values) \
-    || PARROT_ASSERT_ARG(chosen)
+    , PARROT_ASSERT_ARG(cache) \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(values) \
+    , PARROT_ASSERT_ARG(chosen))
 #define ASSERT_ARGS_Parrot_mmd_find_multi_from_long_sig \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(long_sig)
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(long_sig))
 #define ASSERT_ARGS_Parrot_mmd_find_multi_from_sig_obj \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(invoke_sig)
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(invoke_sig))
 #define ASSERT_ARGS_Parrot_mmd_multi_dispatch_from_c_args \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(sig)
-#define ASSERT_ARGS_Parrot_mmd_sort_manhattan __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(candidates)
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(sig))
 #define ASSERT_ARGS_Parrot_mmd_sort_manhattan_by_sig_pmc \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(candidates) \
-    || PARROT_ASSERT_ARG(invoke_sig)
+    , PARROT_ASSERT_ARG(candidates) \
+    , PARROT_ASSERT_ARG(invoke_sig))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/multidispatch.c */
 

Modified: branches/orderedhash_revamp/include/parrot/oo.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/oo.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/oo.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -32,7 +32,7 @@
 #define get_attrib_num(x, y)    ((PMC **)(x))[(y)]
 #define set_attrib_num(o, x, y, z) \
     do { \
-        GC_WRITE_BARRIER(interp, (o), ((PMC **)(x))[y], (z)); \
+        Parrot_gc_write_barrier(interp, (o), ((PMC **)(x))[y], (z)); \
         ((PMC **)(x))[(y)] = (z); \
     } while (0)
 
@@ -104,24 +104,38 @@
         __attribute__nonnull__(1);
 
 PARROT_EXPORT
-PARROT_PURE_FUNCTION
 PARROT_CAN_RETURN_NULL
-const char* Parrot_MMD_method_name(SHIM_INTERP, INTVAL idx);
+PARROT_WARN_UNUSED_RESULT
+PMC * Parrot_oo_find_vtable_override(PARROT_INTERP,
+    ARGIN(PMC *classobj),
+    ARGIN(STRING *name))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
 
 PARROT_EXPORT
 PARROT_CAN_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
-PMC * Parrot_oo_get_class(PARROT_INTERP, ARGIN(PMC *key))
+PMC * Parrot_oo_find_vtable_override_for_class(PARROT_INTERP,
+    ARGIN(PMC *classobj),
+    ARGIN(STRING *name))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
 
 PARROT_EXPORT
 PARROT_CAN_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
-PMC * Parrot_oo_get_class_str(PARROT_INTERP, ARGIN(STRING *name))
+PMC * Parrot_oo_get_class(PARROT_INTERP, ARGIN(PMC *key))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+PARROT_WARN_UNUSED_RESULT
+PMC * Parrot_oo_get_class_str(PARROT_INTERP, ARGIN_NULLOK(STRING *name))
+        __attribute__nonnull__(1);
+
 void destroy_object_cache(PARROT_INTERP)
         __attribute__nonnull__(1);
 
@@ -150,32 +164,9 @@
 
 PARROT_CAN_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
-PMC * Parrot_oo_find_vtable_override(PARROT_INTERP,
-    ARGIN(PMC *classobj),
-    ARGIN(STRING *name))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3);
-
-PARROT_CAN_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-PMC * Parrot_oo_find_vtable_override_for_class(PARROT_INTERP,
-    ARGIN(PMC *classobj),
-    ARGIN(STRING *name))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3);
-
-PARROT_CAN_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
 PMC * Parrot_oo_get_namespace(SHIM_INTERP, ARGIN(const PMC *classobj))
         __attribute__nonnull__(2);
 
-PARROT_CANNOT_RETURN_NULL
-void * Parrot_oo_new_object_attrs(PARROT_INTERP, ARGIN(PMC * class_))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
 PARROT_CAN_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
 PMC * Parrot_oo_newclass_from_str(PARROT_INTERP, ARGIN(STRING *name))
@@ -190,74 +181,69 @@
         __attribute__nonnull__(2)
         __attribute__nonnull__(3);
 
-#define ASSERT_ARGS_Parrot_ComposeRole __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_ComposeRole __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(role) \
-    || PARROT_ASSERT_ARG(exclude) \
-    || PARROT_ASSERT_ARG(alias) \
-    || PARROT_ASSERT_ARG(methods_hash) \
-    || PARROT_ASSERT_ARG(roles_list)
-#define ASSERT_ARGS_Parrot_ComputeMRO_C3 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(_class)
-#define ASSERT_ARGS_Parrot_find_method_direct __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(_class) \
-    || PARROT_ASSERT_ARG(method_name)
-#define ASSERT_ARGS_Parrot_find_method_with_cache __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(_class) \
-    || PARROT_ASSERT_ARG(method_name)
-#define ASSERT_ARGS_Parrot_get_vtable_index __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(role) \
+    , PARROT_ASSERT_ARG(exclude) \
+    , PARROT_ASSERT_ARG(alias) \
+    , PARROT_ASSERT_ARG(methods_hash) \
+    , PARROT_ASSERT_ARG(roles_list))
+#define ASSERT_ARGS_Parrot_ComputeMRO_C3 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(_class))
+#define ASSERT_ARGS_Parrot_find_method_direct __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(_class) \
+    , PARROT_ASSERT_ARG(method_name))
+#define ASSERT_ARGS_Parrot_find_method_with_cache __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(_class) \
+    , PARROT_ASSERT_ARG(method_name))
+#define ASSERT_ARGS_Parrot_get_vtable_index __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_Parrot_get_vtable_name __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_Parrot_get_vtable_name __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
 #define ASSERT_ARGS_Parrot_invalidate_method_cache \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_MMD_method_name __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_oo_get_class __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(key)
-#define ASSERT_ARGS_Parrot_oo_get_class_str __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_destroy_object_cache __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_init_object_cache __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_mark_object_cache __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_oo_clone_object __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_oo_extract_methods_from_namespace \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self) \
-    || PARROT_ASSERT_ARG(ns)
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
 #define ASSERT_ARGS_Parrot_oo_find_vtable_override \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(classobj) \
-    || PARROT_ASSERT_ARG(name)
+    , PARROT_ASSERT_ARG(classobj) \
+    , PARROT_ASSERT_ARG(name))
 #define ASSERT_ARGS_Parrot_oo_find_vtable_override_for_class \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(classobj) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_Parrot_oo_get_class __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(key))
+#define ASSERT_ARGS_Parrot_oo_get_class_str __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_destroy_object_cache __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_init_object_cache __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_mark_object_cache __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_oo_clone_object __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(classobj) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_Parrot_oo_get_namespace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(classobj)
-#define ASSERT_ARGS_Parrot_oo_new_object_attrs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_Parrot_oo_extract_methods_from_namespace \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(class_)
-#define ASSERT_ARGS_Parrot_oo_newclass_from_str __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(ns))
+#define ASSERT_ARGS_Parrot_oo_get_namespace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(classobj))
+#define ASSERT_ARGS_Parrot_oo_newclass_from_str __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_Parrot_oo_register_type __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_Parrot_oo_register_type __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(_namespace)
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(_namespace))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/oo.c */
 

Modified: branches/orderedhash_revamp/include/parrot/op.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/op.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/op.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -15,7 +15,7 @@
 
 #include "parrot/config.h"
 
-#define PARROT_MAX_ARGS 8
+#define PARROT_MAX_ARGS 16
 
 typedef enum {
     PARROT_INLINE_OP,

Modified: branches/orderedhash_revamp/include/parrot/packfile.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/packfile.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/packfile.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -19,10 +19,10 @@
 #define PF_NCONST(pf)  ((pf)->const_table->const_count)
 #define PF_CONST(pf, i) ((pf)->const_table->constants[(i)])
 
-#define DIRECTORY_SEGMENT_NAME   "DIRECTORY"
-#define FIXUP_TABLE_SEGMENT_NAME "FIXUP"
-#define CONSTANT_SEGMENT_NAME    "CONSTANT"
-#define BYTE_CODE_SEGMENT_NAME   "BYTECODE"
+#define DIRECTORY_SEGMENT_NAME   Parrot_str_new_constant(interp, "DIRECTORY")
+#define FIXUP_TABLE_SEGMENT_NAME Parrot_str_new_constant(interp, "FIXUP")
+#define CONSTANT_SEGMENT_NAME    Parrot_str_new_constant(interp, "CONSTANT")
+#define BYTE_CODE_SEGMENT_NAME   Parrot_str_new_constant(interp, "BYTECODE")
 
 #define FLOATTYPE_8           0
 #define FLOATTYPE_8_NAME      "IEEE-754 8 byte double"
@@ -55,7 +55,7 @@
 /*
 ** Parrot_pbc_read() options:
 **   parrot, pbc_merge, parrot_debugger use 0
-**   pbc_dump, pbc_disassemble, pbc_info use 1 to skip the version check
+**   pbc_dump, pbc_disassemble use 1 to skip the version check
 **   pbc_dump -h requires 2
 **   The rest is for TRACE_PACKFILE debugging with switch -D in pbc_dump
 */
@@ -67,6 +67,7 @@
 #  define PFOPT_ALIGN 8
 #  define PFOPT_VALUE 16
 #endif
+#define PFOPT_PMC_FREEZE_ONLY 32
 
 #if TRACE_PACKFILE
 /* Here we pass multipe args to a macro so the args may not be bracketed here! */
@@ -133,10 +134,10 @@
 typedef struct PackFile_Constant {
     opcode_t type;
     union {
-        opcode_t integer;
-        FLOATVAL number;
-        STRING *string;
-        PMC *key;
+        opcode_t  integer;
+        FLOATVAL  number;
+        STRING   *string;
+        PMC      *key;
     } u;
 } PackFile_Constant;
 
@@ -147,7 +148,7 @@
 */
 
 typedef struct PackFile_Segment * (*PackFile_Segment_new_func_t)
-    (PARROT_INTERP, struct PackFile *, const char *, int add);
+    (PARROT_INTERP, struct PackFile *, STRING *, int add);
 
 typedef void (*PackFile_Segment_destroy_func_t)
     (PARROT_INTERP, struct PackFile_Segment *);
@@ -197,7 +198,7 @@
 
     /* directory information */
     UINTVAL             type;           /* one of above defined types */
-    char                *name;
+    STRING             *name;
     size_t              op_count;       /* external size in ops */
     size_t              file_offset;    /* offset in ops */
     /* common payload of all bytecode chunks
@@ -205,7 +206,7 @@
     opcode_t            itype;          /* internal type/version */
     opcode_t            id;             /* internal id */
     size_t              size;           /* internal oparray size */
-    opcode_t            *data;          /* oparray e.g. bytecode */
+    opcode_t           *data;           /* oparray e.g. bytecode */
 } PackFile_Segment;
 
 typedef INTVAL (*PackFile_map_segments_func_t)(PARROT_INTERP, PackFile_Segment *seg, void *user_data);
@@ -217,7 +218,6 @@
     opcode_t                  type;     /* who knows what fixups we need? */
     char                     *name;     /* name of the label */
     opcode_t                  offset;   /* location of the item */
-    PackFile_ByteCode        *seg;
 } PackFile_FixupEntry;
 
 typedef enum {
@@ -246,15 +246,6 @@
 
 /* &end_gen */
 
-enum PF_VARTYPE {                  /* s. also imcc/symreg.h */
-    PF_VT_START_SLICE = 1 << 10,   /* x .. y slice range */
-    PF_VT_END_SLICE   = 1 << 11,
-    PF_VT_START_ZERO  = 1 << 12,   /* .. y 0..start */
-    PF_VT_END_INF     = 1 << 13,   /* x..  start..inf */
-    PF_VT_SLICE_BITS  = PF_VT_START_SLICE | PF_VT_END_SLICE |
-                        PF_VT_START_ZERO | PF_VT_END_INF
-};
-
 typedef struct PackFile_ConstTable {
     PackFile_Segment           base;
     opcode_t                   const_count;
@@ -265,9 +256,6 @@
 struct PackFile_ByteCode {
     PackFile_Segment       base;
     Prederef               prederef;    /* The predereferenced code and info */
-    struct Parrot_jit_info_t     *jit_info;    /* JITs data */
-    Parrot_PIC_store      *pic_store;   /* PIC storage */
-    PackFile_Segment      *pic_index;   /* segment of indices into store */
     struct PackFile_Debug *debugs;
     PackFile_ConstTable   *const_table;
     PackFile_FixupTable   *fixups;
@@ -330,32 +318,31 @@
 
 
 typedef opcode_t (*packfile_fetch_op_t)(ARGIN(const unsigned char *));
-typedef INTVAL (*packfile_fetch_iv_t)(ARGIN(const unsigned char *));
-typedef void (*packfile_fetch_nv_t)(ARGOUT(unsigned char *), ARGIN(const unsigned char *));
+typedef INTVAL   (*packfile_fetch_iv_t)(ARGIN(const unsigned char *));
+typedef void     (*packfile_fetch_nv_t)(ARGOUT(unsigned char *), ARGIN(const unsigned char *));
 
 typedef struct PackFile {
     /* the packfile is its own directory */
     PackFile_Directory   directory;
-    PackFile_Directory   *dirp;  /* for freeing */
-    const opcode_t       *src;   /* the possible mmap()ed start of the PF */
-    size_t   size;               /* size in bytes */
-    INTVAL is_mmap_ped;          /* don't free it, munmap it at destroy */
+    PackFile_Directory  *dirp;        /* for freeing */
+    const opcode_t      *src;         /* possible mmap()ed start of the PF */
+    size_t               size;        /* size in bytes */
+    INTVAL               is_mmap_ped; /* don't free it, munmap it at destroy */
 
-    PackFile_Header     * header;
+    PackFile_Header     *header;
 
     /* directory hold all Segments */
-    /* TODO make this reallocatable */
-    PackFile_funcs      PackFuncs[PF_MAX_SEG];
+    PackFile_funcs       PackFuncs[PF_MAX_SEG];
+
+    PackFile_ByteCode   *cur_cs;   /* used during PF loading */
 
-    PackFile_ByteCode  * cur_cs;   /* used during PF loading */
+    INTVAL               options;
+    INTVAL               need_wordsize;
+    INTVAL               need_endianize;
 
-    INTVAL    options;
-    INTVAL    need_wordsize;
-    INTVAL    need_endianize;
-
-    packfile_fetch_op_t fetch_op;
-    packfile_fetch_iv_t fetch_iv;
-    packfile_fetch_nv_t fetch_nv;
+    packfile_fetch_op_t  fetch_op;
+    packfile_fetch_iv_t  fetch_iv;
+    packfile_fetch_nv_t  fetch_nv;
 } PackFile;
 
 
@@ -426,29 +413,29 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*self);
 
-#define ASSERT_ARGS_PackFile_Constant_pack __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_PackFile_Constant_pack __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(const_table) \
-    || PARROT_ASSERT_ARG(self) \
-    || PARROT_ASSERT_ARG(cursor)
-#define ASSERT_ARGS_PackFile_ConstTable_pack __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(const_table) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(cursor))
+#define ASSERT_ARGS_PackFile_ConstTable_pack __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(seg) \
-    || PARROT_ASSERT_ARG(cursor)
-#define ASSERT_ARGS_PackFile_ConstTable_pack_size __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(seg) \
+    , PARROT_ASSERT_ARG(cursor))
+#define ASSERT_ARGS_PackFile_ConstTable_pack_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(seg)
-#define ASSERT_ARGS_PackFile_find_in_const __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(seg))
+#define ASSERT_ARGS_PackFile_find_in_const __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ct) \
-    || PARROT_ASSERT_ARG(key)
-#define ASSERT_ARGS_PackFile_pack __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(ct) \
+    , PARROT_ASSERT_ARG(key))
+#define ASSERT_ARGS_PackFile_pack __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self) \
-    || PARROT_ASSERT_ARG(cursor)
-#define ASSERT_ARGS_PackFile_pack_size __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(cursor))
+#define ASSERT_ARGS_PackFile_pack_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self)
+    , PARROT_ASSERT_ARG(self))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/packout.c */
 
@@ -493,7 +480,7 @@
 PARROT_CANNOT_RETURN_NULL
 PackFile_Segment * PackFile_Annotations_new(SHIM_INTERP,
     SHIM(struct PackFile *pf),
-    SHIM(const char *name),
+    SHIM(STRING *name),
     NULLOK(int add));
 
 PARROT_EXPORT
@@ -588,7 +575,7 @@
 PARROT_CAN_RETURN_NULL
 PackFile_Segment * PackFile_find_segment(PARROT_INTERP,
     ARGIN_NULLOK(PackFile_Directory *dir),
-    ARGIN(const char *name),
+    ARGIN(STRING *name),
     int sub_dir)
         __attribute__nonnull__(1)
         __attribute__nonnull__(3);
@@ -639,16 +626,17 @@
 PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
-PackFile * PackFile_new_dummy(PARROT_INTERP, ARGIN(const char *name))
+PackFile * PackFile_new_dummy(PARROT_INTERP, ARGIN(STRING *name))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
 PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
-PackFile_Segment * PackFile_remove_segment_by_name(SHIM_INTERP,
+PackFile_Segment * PackFile_remove_segment_by_name(PARROT_INTERP,
     ARGMOD(PackFile_Directory *dir),
-    ARGIN(const char *name))
+    ARGIN(STRING *name))
+        __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         __attribute__nonnull__(3)
         FUNC_MODIFIES(*dir);
@@ -669,7 +657,7 @@
 PARROT_CANNOT_RETURN_NULL
 PackFile_Segment * PackFile_Segment_new(SHIM_INTERP,
     SHIM(PackFile *pf),
-    SHIM(const char *name),
+    SHIM(STRING *name),
     NULLOK(int add));
 
 PARROT_EXPORT
@@ -678,7 +666,7 @@
 PackFile_Segment * PackFile_Segment_new_seg(PARROT_INTERP,
     ARGMOD(PackFile_Directory *dir),
     UINTVAL type,
-    ARGIN(const char *name),
+    ARGIN(STRING *name),
     int add)
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
@@ -781,7 +769,7 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 PackFile_ByteCode * PF_create_default_segs(PARROT_INTERP,
-    ARGIN(const char *file_name),
+    ARGIN(STRING *file_name),
     int add)
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
@@ -838,153 +826,154 @@
 void Parrot_trace_eprintf(ARGIN(const char *s), ...)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_do_sub_pragmas __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_do_sub_pragmas __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_PackFile_add_segment __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_PackFile_add_segment __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(dir) \
-    || PARROT_ASSERT_ARG(seg)
+    , PARROT_ASSERT_ARG(seg))
 #define ASSERT_ARGS_PackFile_Annotations_add_entry \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self)
+    , PARROT_ASSERT_ARG(self))
 #define ASSERT_ARGS_PackFile_Annotations_add_group \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_PackFile_Annotations_new __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_PackFile_Constant_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_PackFile_Constant_new __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_PackFile_Constant_pack_size __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_PackFile_Constant_unpack __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(constt) \
-    || PARROT_ASSERT_ARG(self) \
-    || PARROT_ASSERT_ARG(cursor)
-#define ASSERT_ARGS_PackFile_Constant_unpack_key __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(constt) \
-    || PARROT_ASSERT_ARG(self) \
-    || PARROT_ASSERT_ARG(cursor)
-#define ASSERT_ARGS_PackFile_Constant_unpack_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(constt) \
-    || PARROT_ASSERT_ARG(self) \
-    || PARROT_ASSERT_ARG(cursor)
-#define ASSERT_ARGS_PackFile_ConstTable_clear __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_PackFile_ConstTable_unpack __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(seg) \
-    || PARROT_ASSERT_ARG(cursor)
-#define ASSERT_ARGS_PackFile_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_PackFile_find_fixup_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_PackFile_find_segment __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_PackFile_fixup_subs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_PackFile_FixupTable_clear __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_PackFile_FixupTable_new_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(label)
-#define ASSERT_ARGS_PackFile_funcs_register __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pf)
-#define ASSERT_ARGS_PackFile_map_segments __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(dir)
-#define ASSERT_ARGS_PackFile_new __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_PackFile_new_dummy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_PackFile_Annotations_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_PackFile_Constant_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_PackFile_Constant_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_PackFile_Constant_pack_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_PackFile_Constant_unpack __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(constt) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(cursor))
+#define ASSERT_ARGS_PackFile_Constant_unpack_key __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(constt) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(cursor))
+#define ASSERT_ARGS_PackFile_Constant_unpack_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(constt) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(cursor))
+#define ASSERT_ARGS_PackFile_ConstTable_clear __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_PackFile_ConstTable_unpack __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(seg) \
+    , PARROT_ASSERT_ARG(cursor))
+#define ASSERT_ARGS_PackFile_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_PackFile_find_fixup_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_PackFile_find_segment __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_PackFile_fixup_subs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_PackFile_FixupTable_clear __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_PackFile_FixupTable_new_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(label))
+#define ASSERT_ARGS_PackFile_funcs_register __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(pf))
+#define ASSERT_ARGS_PackFile_map_segments __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(dir))
+#define ASSERT_ARGS_PackFile_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_PackFile_new_dummy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
+    , PARROT_ASSERT_ARG(name))
 #define ASSERT_ARGS_PackFile_remove_segment_by_name \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(dir) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_PackFile_Segment_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_PackFile_Segment_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_PackFile_Segment_new __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_PackFile_Segment_new_seg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(dir) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_PackFile_Segment_pack __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self) \
-    || PARROT_ASSERT_ARG(cursor)
-#define ASSERT_ARGS_PackFile_Segment_packed_size __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_PackFile_Segment_unpack __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self) \
-    || PARROT_ASSERT_ARG(cursor)
-#define ASSERT_ARGS_PackFile_unpack __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self) \
-    || PARROT_ASSERT_ARG(packed)
-#define ASSERT_ARGS_Parrot_debug_add_mapping __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(debug) \
-    || PARROT_ASSERT_ARG(filename)
-#define ASSERT_ARGS_Parrot_debug_pc_to_filename __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(debug)
-#define ASSERT_ARGS_Parrot_destroy_constants __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_load_bytecode __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_load_language __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_new_debug_seg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(cs)
-#define ASSERT_ARGS_Parrot_switch_to_cs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(new_cs)
-#define ASSERT_ARGS_Parrot_switch_to_cs_by_nr __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_PF_create_default_segs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(file_name)
-#define ASSERT_ARGS_default_dump_header __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_mark_const_subs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_PackFile_Annotations_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(seg)
-#define ASSERT_ARGS_PackFile_Annotations_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(dir) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_PackFile_Segment_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_PackFile_Segment_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_PackFile_Segment_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_PackFile_Segment_new_seg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(dir) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_PackFile_Segment_pack __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(cursor))
+#define ASSERT_ARGS_PackFile_Segment_packed_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_PackFile_Segment_unpack __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(cursor))
+#define ASSERT_ARGS_PackFile_unpack __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(packed))
+#define ASSERT_ARGS_Parrot_debug_add_mapping __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(debug) \
+    , PARROT_ASSERT_ARG(filename))
+#define ASSERT_ARGS_Parrot_debug_pc_to_filename __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(debug))
+#define ASSERT_ARGS_Parrot_destroy_constants __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_load_bytecode __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_load_language __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_new_debug_seg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(cs))
+#define ASSERT_ARGS_Parrot_switch_to_cs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(new_cs))
+#define ASSERT_ARGS_Parrot_switch_to_cs_by_nr __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_PF_create_default_segs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(file_name))
+#define ASSERT_ARGS_default_dump_header __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_mark_const_subs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_PackFile_Annotations_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(seg))
+#define ASSERT_ARGS_PackFile_Annotations_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(seg)
-#define ASSERT_ARGS_PackFile_Annotations_lookup __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(seg))
+#define ASSERT_ARGS_PackFile_Annotations_lookup __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_PackFile_Annotations_pack __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_PackFile_Annotations_pack __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(seg) \
-    || PARROT_ASSERT_ARG(cursor)
+    , PARROT_ASSERT_ARG(seg) \
+    , PARROT_ASSERT_ARG(cursor))
 #define ASSERT_ARGS_PackFile_Annotations_packed_size \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(seg)
-#define ASSERT_ARGS_PackFile_Annotations_unpack __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(seg) \
-    || PARROT_ASSERT_ARG(cursor)
-#define ASSERT_ARGS_Parrot_trace_eprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(s)
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(seg))
+#define ASSERT_ARGS_PackFile_Annotations_unpack __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(seg) \
+    , PARROT_ASSERT_ARG(cursor))
+#define ASSERT_ARGS_Parrot_trace_eprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(s))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/packfile.c */
 
@@ -1004,12 +993,12 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-#define ASSERT_ARGS_PackFile_ConstTable_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_PackFile_ConstTable_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_PackFile_Fixup_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_PackFile_Fixup_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ft)
+    , PARROT_ASSERT_ARG(ft))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/packdump.c */
 
@@ -1120,40 +1109,40 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*cursor);
 
-#define ASSERT_ARGS_PackFile_assign_transforms __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pf)
-#define ASSERT_ARGS_PF_fetch_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_PackFile_assign_transforms __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(pf))
+#define ASSERT_ARGS_PF_fetch_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(pf) \
-    || PARROT_ASSERT_ARG(cursor)
-#define ASSERT_ARGS_PF_fetch_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(stream)
-#define ASSERT_ARGS_PF_fetch_number __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(stream)
-#define ASSERT_ARGS_PF_fetch_opcode __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(stream)
-#define ASSERT_ARGS_PF_fetch_string __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(cursor)
-#define ASSERT_ARGS_PF_size_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_PF_size_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_PF_size_number __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_PF_size_opcode __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_PF_size_string __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_PF_store_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(cursor))
+#define ASSERT_ARGS_PF_fetch_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(stream))
+#define ASSERT_ARGS_PF_fetch_number __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(stream))
+#define ASSERT_ARGS_PF_fetch_opcode __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(stream))
+#define ASSERT_ARGS_PF_fetch_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(cursor))
+#define ASSERT_ARGS_PF_size_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_PF_size_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_PF_size_number __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_PF_size_opcode __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_PF_size_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_PF_store_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(cursor) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_PF_store_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(cursor)
-#define ASSERT_ARGS_PF_store_number __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_PF_store_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(cursor))
+#define ASSERT_ARGS_PF_store_number __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(cursor) \
-    || PARROT_ASSERT_ARG(val)
-#define ASSERT_ARGS_PF_store_opcode __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(cursor)
-#define ASSERT_ARGS_PF_store_string __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(val))
+#define ASSERT_ARGS_PF_store_opcode __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(cursor))
+#define ASSERT_ARGS_PF_store_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(cursor) \
-    || PARROT_ASSERT_ARG(s)
+    , PARROT_ASSERT_ARG(s))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/packfile/pf_items.c */
 
@@ -1252,40 +1241,40 @@
 PARROT_CONST_FUNCTION
 opcode_t fetch_op_le(opcode_t w);
 
-#define ASSERT_ARGS_fetch_buf_be_12 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_fetch_buf_be_12 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(rb) \
-    || PARROT_ASSERT_ARG(b)
-#define ASSERT_ARGS_fetch_buf_be_16 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(b))
+#define ASSERT_ARGS_fetch_buf_be_16 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(rb) \
-    || PARROT_ASSERT_ARG(b)
-#define ASSERT_ARGS_fetch_buf_be_32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(b))
+#define ASSERT_ARGS_fetch_buf_be_32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(rb) \
-    || PARROT_ASSERT_ARG(b)
-#define ASSERT_ARGS_fetch_buf_be_4 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(b))
+#define ASSERT_ARGS_fetch_buf_be_4 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(rb) \
-    || PARROT_ASSERT_ARG(b)
-#define ASSERT_ARGS_fetch_buf_be_8 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(b))
+#define ASSERT_ARGS_fetch_buf_be_8 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(rb) \
-    || PARROT_ASSERT_ARG(b)
-#define ASSERT_ARGS_fetch_buf_le_12 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(b))
+#define ASSERT_ARGS_fetch_buf_le_12 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(rb) \
-    || PARROT_ASSERT_ARG(b)
-#define ASSERT_ARGS_fetch_buf_le_16 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(b))
+#define ASSERT_ARGS_fetch_buf_le_16 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(rb) \
-    || PARROT_ASSERT_ARG(b)
-#define ASSERT_ARGS_fetch_buf_le_32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(b))
+#define ASSERT_ARGS_fetch_buf_le_32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(rb) \
-    || PARROT_ASSERT_ARG(b)
-#define ASSERT_ARGS_fetch_buf_le_4 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(b))
+#define ASSERT_ARGS_fetch_buf_le_4 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(rb) \
-    || PARROT_ASSERT_ARG(b)
-#define ASSERT_ARGS_fetch_buf_le_8 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(b))
+#define ASSERT_ARGS_fetch_buf_le_8 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(rb) \
-    || PARROT_ASSERT_ARG(b)
-#define ASSERT_ARGS_fetch_iv_be __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_fetch_iv_le __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_fetch_op_be __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_fetch_op_le __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
+    , PARROT_ASSERT_ARG(b))
+#define ASSERT_ARGS_fetch_iv_be __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_fetch_iv_le __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_fetch_op_be __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_fetch_op_le __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/byteorder.c */
 

Modified: branches/orderedhash_revamp/include/parrot/parrot.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/parrot.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/parrot.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -109,11 +109,6 @@
 #define NUM_REGISTERS 32
 #define PARROT_MAGIC 0x13155a1
 
-#define OPCODE_TYPE_PERL 0x5045524c
-#define OPCODE_TYPE_PYTHON 0x5045524b
-#define OPCODE_TYPE_JAVA 4871757
-#define OPCODE_TYPE_MSNET 0x2e4e4554
-
 typedef void STRING_FUNCS;
 typedef struct parrot_interp_t Interp;
 
@@ -264,15 +259,13 @@
 #include "parrot/string.h"
 #include "parrot/string_primitives.h"
 #include "parrot/hash.h"
-#include "parrot/list.h"
 #include "parrot/pmc_freeze.h"
+#include "parrot/list.h"
 #include "parrot/vtable.h"
-#include "parrot/stacks.h"
-#include "parrot/register.h"
+#include "parrot/context.h"
 #include "parrot/exceptions.h"
 #include "parrot/warnings.h"
 #include "parrot/memory.h"
-#include "parrot/pic.h"
 #include "parrot/packfile.h"
 #include "parrot/io.h"
 #include "parrot/op.h"
@@ -296,7 +289,6 @@
 #include "parrot/library.h"
 #include "parrot/global.h"
 #include "parrot/stat.h"
-#include "parrot/slice.h"
 #include "parrot/hll.h"
 #include "parrot/pbcversion.h"
 

Deleted: branches/orderedhash_revamp/include/parrot/pic.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/pic.h	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,200 +0,0 @@
-/* pic.h
- *  Copyright (C) 2005, Parrot Foundation.
- *  SVN Info
- *     $Id$
- *  Overview:
- *     This is the api header for the pic subsystem
- *  Data Structure and Algorithms:
- *  History:
- *  Notes:
- *  References:
- */
-
-#ifndef PARROT_PIC_H_GUARD
-#define PARROT_PIC_H_GUARD
-
-/*
- * one cache slot
- *
- * if types exceed 16 bits or for general MMD function calls an
- * extended cache slot is needed with more type entries
- */
-typedef struct Parrot_pic_lru_t {
-    union {
-        INTVAL type;                    /* for MMD left << 16 | right type */
-        PMC *signature;                 /* arg passing signature */
-    } u;
-    union {
-        funcptr_t real_function;        /* the actual C code */
-        PMC *sub;                       /* or a Sub PMC */
-        PMC **pattr;                    /* attribute location */
-    } f;
-} Parrot_PIC_lru;
-
-/*
- * PIC 3 more cache slots
- */
-typedef struct Parrot_pic_t {
-    Parrot_PIC_lru lru[3];              /* PIC - three more cache entries */
-    INTVAL miss_count;                  /* how many misses */
-} Parrot_PIC;
-
-/*
- * the main used MIC one cache slot - 4 words size
- */
-typedef struct Parrot_mic_t {
-    Parrot_PIC_lru lru;                 /* MIC - one cache */
-    union {
-        STRING *method;                 /* for callmethod */
-        INTVAL func_nr;                 /* MMD function number */
-        STRING *attribute;              /* obj.attribute */
-        PMC *sig;                       /* arg passing */
-    } m;
-    Parrot_PIC *pic;                    /* more cache entries */
-} Parrot_MIC;
-
-/*
- * memory is managed by this structure hanging off a
- * PackFile_ByteCode segment
- */
-typedef struct Parrot_pic_store_t {
-    struct Parrot_pic_store_t *prev;    /* prev pic_store */
-    size_t usable;                      /* size of usable memory: */
-    Parrot_PIC *pic;                    /* from rear */
-    Parrot_MIC *mic;                    /* idx access to allocated MICs */
-    size_t n_mics;                      /* range check, debugging mainly */
-} Parrot_PIC_store;
-
-typedef int (*arg_pass_f)(PARROT_INTERP, PMC *sig,
-            char *src_base, void **src_pc, char *dest_base, void **dest_pc);
-
-/* more or less private interfaces */
-
-/* HEADERIZER BEGIN: src/pic.c */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-Parrot_MIC* parrot_PIC_alloc_mic(const PARROT_INTERP, size_t n);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-Parrot_PIC* parrot_PIC_alloc_pic(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-void parrot_PIC_alloc_store(ARGOUT(PackFile_ByteCode *cs), size_t n)
-        __attribute__nonnull__(1)
-        FUNC_MODIFIES(*cs);
-
-PARROT_WARN_UNUSED_RESULT
-int parrot_pic_check_sig(PARROT_INTERP,
-    ARGIN(PMC *sig1),
-    ARGIN(PMC *sig2),
-    ARGOUT(int *type))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        FUNC_MODIFIES(*type);
-
-void parrot_PIC_destroy(ARGMOD(PackFile_ByteCode *cs))
-        __attribute__nonnull__(1)
-        FUNC_MODIFIES(*cs);
-
-void parrot_pic_find_infix_v_pp(PARROT_INTERP,
-    ARGIN(PMC *left),
-    ARGIN(PMC *right),
-    ARGOUT(Parrot_MIC *mic),
-    ARGOUT(opcode_t *cur_opcode))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        __attribute__nonnull__(5)
-        FUNC_MODIFIES(*mic)
-        FUNC_MODIFIES(*cur_opcode);
-
-PARROT_CONST_FUNCTION
-int parrot_PIC_op_is_cached(int op_code);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-void * parrot_pic_opcode(PARROT_INTERP, INTVAL op)
-        __attribute__nonnull__(1);
-
-void parrot_PIC_prederef(PARROT_INTERP,
-    opcode_t op,
-    ARGOUT(void **pc_pred),
-    int core)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*pc_pred);
-
-#define ASSERT_ARGS_parrot_PIC_alloc_mic __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_parrot_PIC_alloc_pic __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_parrot_PIC_alloc_store __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(cs)
-#define ASSERT_ARGS_parrot_pic_check_sig __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sig1) \
-    || PARROT_ASSERT_ARG(sig2) \
-    || PARROT_ASSERT_ARG(type)
-#define ASSERT_ARGS_parrot_PIC_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(cs)
-#define ASSERT_ARGS_parrot_pic_find_infix_v_pp __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(left) \
-    || PARROT_ASSERT_ARG(right) \
-    || PARROT_ASSERT_ARG(mic) \
-    || PARROT_ASSERT_ARG(cur_opcode)
-#define ASSERT_ARGS_parrot_PIC_op_is_cached __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_parrot_pic_opcode __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_parrot_PIC_prederef __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pc_pred)
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: src/pic.c */
-
-
-/* HEADERIZER BEGIN: src/pic_jit.c */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-
-PARROT_WARN_UNUSED_RESULT
-int parrot_pic_is_safe_to_jit(PARROT_INTERP,
-    ARGIN(PMC *sub_pmc),
-    ARGIN(PMC *sig_args),
-    ARGIN(PMC *sig_results),
-    ARGOUT(int *flags))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        __attribute__nonnull__(5)
-        FUNC_MODIFIES(*flags);
-
-funcptr_t parrot_pic_JIT_sub(PARROT_INTERP, ARGIN(PMC *sub_pmc), int flags)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-#define ASSERT_ARGS_parrot_pic_is_safe_to_jit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub_pmc) \
-    || PARROT_ASSERT_ARG(sig_args) \
-    || PARROT_ASSERT_ARG(sig_results) \
-    || PARROT_ASSERT_ARG(flags)
-#define ASSERT_ARGS_parrot_pic_JIT_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub_pmc)
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: src/pic_jit.c */
-
-#endif /* PARROT_PIC_H_GUARD */
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Modified: branches/orderedhash_revamp/include/parrot/pmc.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/pmc.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/pmc.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -54,6 +54,12 @@
         __attribute__nonnull__(1);
 
 PARROT_EXPORT
+void Parrot_pmc_destroy(PARROT_INTERP, ARGMOD(PMC *pmc))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        FUNC_MODIFIES(*pmc);
+
+PARROT_EXPORT
 INTVAL PMC_is_null(SHIM_INTERP, ARGIN_NULLOK(const PMC *pmc));
 
 PARROT_EXPORT
@@ -135,54 +141,57 @@
 PMC * temporary_pmc_new(PARROT_INTERP, INTVAL base_type)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_constant_pmc_new __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_constant_pmc_new_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_constant_pmc_new_noinit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_gc_register_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_gc_unregister_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_create_mro __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_PMC_is_null __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_pmc_new __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_pmc_new_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(init)
-#define ASSERT_ARGS_pmc_new_noinit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_pmc_register __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_pmc_reuse __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_pmc_reuse_by_class __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc) \
-    || PARROT_ASSERT_ARG(class_)
-#define ASSERT_ARGS_pmc_reuse_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc) \
-    || PARROT_ASSERT_ARG(init)
-#define ASSERT_ARGS_pmc_type __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_pmc_type_p __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_get_new_vtable_index __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_temporary_pmc_free __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_temporary_pmc_new __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_constant_pmc_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_constant_pmc_new_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_constant_pmc_new_noinit __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_gc_register_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_gc_unregister_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_Parrot_create_mro __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_pmc_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_PMC_is_null __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_pmc_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_pmc_new_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(init))
+#define ASSERT_ARGS_pmc_new_noinit __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_pmc_register __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_pmc_reuse __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_pmc_reuse_by_class __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc) \
+    , PARROT_ASSERT_ARG(class_))
+#define ASSERT_ARGS_pmc_reuse_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc) \
+    , PARROT_ASSERT_ARG(init))
+#define ASSERT_ARGS_pmc_type __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_pmc_type_p __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_get_new_vtable_index __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_temporary_pmc_free __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_temporary_pmc_new __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/pmc.c */
 

Modified: branches/orderedhash_revamp/include/parrot/pmc_freeze.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/pmc_freeze.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/pmc_freeze.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -11,76 +11,137 @@
  */
 
 #ifndef PARROT_PMC_FREEZE_H_GUARD
-#define      PARROT_PMC_FREEZE_H_GUARD
+#define PARROT_PMC_FREEZE_H_GUARD
 
 struct _visit_info;
 typedef void (*visit_f)(PARROT_INTERP, ARGIN_NULLOK(PMC*), ARGIN(struct _visit_info*));
 
 typedef enum {
-    VISIT_FREEZE_NORMAL,
-    VISIT_FREEZE_AT_DESTRUCT,
-    VISIT_FREEZE_SIZE,
-    VISIT_THAW_NORMAL,
-    VISIT_THAW_CONSTANTS,
-    VISIT_CLONE,
-    VISIT_DESTRUCTION_ORDER
-} visit_enum_type;
-
-struct _image_io;
-#define IMAGE_IO struct _image_io
-typedef void (*push_integer_f)       (PARROT_INTERP, IMAGE_IO*, INTVAL);
-typedef void (*push_pmc_f)           (PARROT_INTERP, IMAGE_IO*, PMC*);
-typedef void (*push_string_f)        (PARROT_INTERP, IMAGE_IO*, STRING*);
-typedef void (*push_number_f)        (PARROT_INTERP, IMAGE_IO*, FLOATVAL);
-typedef INTVAL (*shift_integer_f)      (PARROT_INTERP, IMAGE_IO*);
-typedef PMC*    (*shift_pmc_f)          (PARROT_INTERP, IMAGE_IO*);
-typedef STRING* (*shift_string_f)       (PARROT_INTERP, IMAGE_IO*);
-typedef FLOATVAL (*shift_number_f)       (PARROT_INTERP, IMAGE_IO*);
+    VISIT_HOW_PMC_TO_VISITOR     = 0x00, /* push to visitor */
+    VISIT_HOW_VISITOR_TO_PMC     = 0x01, /* shift from visitor */
+    VISIT_HOW_PMC_TO_PMC         = 0x02, /* push to visitor; then shift from visitor */
+    VISIT_HOW_VISITOR_TO_VISITOR = 0x03, /* shift from visitor; then push to visitor */
+} visit_how_enum_t;
+
+#define VISIT_HOW_MASK 0x03
+
+typedef enum {
+    VISIT_WHAT_PMC      = 0x04,
+    VISIT_WHAT_STRING   = 0x08,
+    VISIT_WHAT_FLOATVAL = 0x10,
+    VISIT_WHAT_INTVAL   = 0x20,
+} visit_what_enum_t;
+
+#define VISIT_WHAT_MASK 0x3c
+
+/* backwards-compat defns */
+#define visit_enum_type      INTVAL
+#define VISIT_FREEZE_NORMAL  (VISIT_HOW_PMC_TO_VISITOR | VISIT_WHAT_PMC)
+#define VISIT_THAW_NORMAL    (VISIT_HOW_VISITOR_TO_PMC | VISIT_WHAT_PMC)
+#define VISIT_THAW_CONSTANTS VISIT_THAW_NORMAL
+
+struct _visit_info;
+typedef INTVAL   (*get_integer_f)   (PARROT_INTERP, struct _visit_info*);
+typedef void     (*push_integer_f)  (PARROT_INTERP, struct _visit_info*, INTVAL);
+typedef void     (*push_string_f)   (PARROT_INTERP, struct _visit_info*, STRING*);
+typedef void     (*push_number_f)   (PARROT_INTERP, struct _visit_info*, FLOATVAL);
+typedef void     (*push_pmc_f)      (PARROT_INTERP, struct _visit_info*, PMC*);
+typedef INTVAL   (*shift_integer_f) (PARROT_INTERP, struct _visit_info*);
+typedef STRING*  (*shift_string_f)  (PARROT_INTERP, struct _visit_info*);
+typedef FLOATVAL (*shift_number_f)  (PARROT_INTERP, struct _visit_info*);
+typedef PMC*     (*shift_pmc_f)     (PARROT_INTERP, struct _visit_info*);
 
 typedef struct _image_funcs {
+    get_integer_f       get_integer;
     push_integer_f      push_integer;
-    push_pmc_f          push_pmc;
     push_string_f       push_string;
     push_number_f       push_float;
+    push_pmc_f          push_pmc;
     shift_integer_f     shift_integer;
-    shift_pmc_f         shift_pmc;
     shift_string_f      shift_string;
     shift_number_f      shift_float;
+    shift_pmc_f         shift_pmc;
 } image_funcs;
 
-typedef struct _image_io {
-    STRING *image;
-    struct PackFile *pf;
-    const image_funcs *vtable;
-} image_io;
-
 typedef enum {
     EXTRA_IS_NULL,
-    EXTRA_IS_UNUSED,
     EXTRA_IS_PROP_HASH,
-    EXTRA_CLASS_EXISTS
 } extra_flags_enum;
 
 typedef struct _visit_info {
     visit_f             visit_pmc_now;
-    visit_f             visit_pmc_later;
-    visit_f             visit_action;   /* freeze, thaw ... */
+    size_t              pos;            /* current read/write position in buffer */
+    Buffer             *buffer;
+    size_t              input_length;   /* */
     INTVAL              what;
-    STRING             *image;
-    PMC                *mark_ptr;
     PMC               **thaw_ptr;       /* where to thaw a new PMC */
-    PMC                *container;      /* when thawing aggregate items */
-    INTVAL              last_type;
     PMC                *seen;           /* seen hash */
     PMC                *todo;           /* todo list */
     PMC                *id_list;        /* seen list used by thaw */
     UINTVAL             id;             /* freze ID of PMC */
-    void               *extra;          /* PMC specific */
     INTVAL              extra_flags;    /* concerning to extra */
-    PMC                *thaw_result;    /* 1st thawed */
-    IMAGE_IO           *image_io;
+    struct PackFile    *pf;
+    const image_funcs  *vtable;
+    struct _visit_info *image_io;       /* dummy backwards-compat pointer. */
 } visit_info;
 
+#define IMAGE_IO visit_info
+
+#define VISIT_PMC(interp, visit, pmc) do {\
+    const INTVAL _visit_pmc_flags = VTABLE_get_integer((interp), (visit)); \
+    if (_visit_pmc_flags & VISIT_WHAT_PMC) { \
+        switch (_visit_pmc_flags & VISIT_HOW_MASK) { \
+          case VISIT_HOW_PMC_TO_VISITOR: \
+            VTABLE_push_pmc((interp), (visit), (pmc)); \
+            break; \
+          case VISIT_HOW_VISITOR_TO_PMC: \
+            (pmc) = VTABLE_shift_pmc((interp), (visit)); \
+            break; \
+          case VISIT_HOW_PMC_TO_PMC: \
+            VTABLE_push_pmc((interp), (visit), (pmc)); \
+            (pmc) = VTABLE_shift_pmc((interp), (visit)); \
+            break; \
+          case VISIT_HOW_VISITOR_TO_VISITOR: \
+            (pmc) = VTABLE_shift_pmc((interp), (visit)); \
+            VTABLE_push_pmc((interp), (visit), (pmc)); \
+            break; \
+          default: \
+            do_panic((interp), "Bad VISIT_HOW in VISIT_PMC", __FILE__, __LINE__); \
+        } \
+    } \
+} while (0)
+
+#define VISIT_PMC_ATTR(interp, visit, self, pmclass, attr_name) do {\
+    const INTVAL _visit_pmc_attr_flags = VTABLE_get_integer((interp), (visit)); \
+    if (_visit_pmc_attr_flags & VISIT_WHAT_PMC) { \
+        PMC *_visit_pmc_attr; \
+        switch (_visit_pmc_attr_flags & VISIT_HOW_MASK) { \
+          case VISIT_HOW_PMC_TO_VISITOR: \
+            GETATTR_ ## pmclass ## _ ## attr_name((interp), (self), _visit_pmc_attr); \
+            VTABLE_push_pmc((interp), (visit), _visit_pmc_attr); \
+            break; \
+          case VISIT_HOW_VISITOR_TO_PMC: \
+            _visit_pmc_attr = VTABLE_shift_pmc((interp), (visit)); \
+            SETATTR_ ## pmclass ## _ ## attr_name((interp), (self), _visit_pmc_attr); \
+            break; \
+          case VISIT_HOW_PMC_TO_PMC: \
+            GETATTR_ ## pmclass ## _ ## attr_name((interp), (self), _visit_pmc_attr); \
+            VTABLE_push_pmc((interp), (visit), _visit_pmc_attr); \
+            _visit_pmc_attr = VTABLE_shift_pmc((interp), (visit)); \
+            SETATTR_ ## pmclass ## _ ## attr_name((interp), (self), _visit_pmc_attr); \
+            break; \
+          case VISIT_HOW_VISITOR_TO_VISITOR: \
+            _visit_pmc_attr = VTABLE_shift_pmc((interp), (visit)); \
+            SETATTR_ ## pmclass ## _ ## attr_name((interp), (self), _visit_pmc_attr); \
+            GETATTR_ ## pmclass ## _ ## attr_name((interp), (self), _visit_pmc_attr); \
+            VTABLE_push_pmc((interp), (visit), _visit_pmc_attr); \
+            break; \
+          default: \
+            do_panic((interp), "Bad VISIT_HOW in VISIT_PMC_ATTR", __FILE__, __LINE__); \
+        } \
+    } \
+} while (0)
+
 /*
  * public interfaces
  */
@@ -91,53 +152,43 @@
 PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
-PMC* Parrot_clone(PARROT_INTERP, ARGIN(PMC* pmc))
+PMC* Parrot_clone(PARROT_INTERP, ARGIN(PMC *pmc))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
 PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
-STRING* Parrot_freeze(PARROT_INTERP, ARGIN(PMC* pmc))
+STRING* Parrot_freeze(PARROT_INTERP, ARGIN(PMC *pmc))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
 PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
-STRING* Parrot_freeze_at_destruct(PARROT_INTERP, ARGIN(PMC* pmc))
+PMC* Parrot_thaw(PARROT_INTERP, ARGIN(STRING *image))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
 PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
-PMC* Parrot_thaw(PARROT_INTERP, ARGIN(STRING* image))
+PMC* Parrot_thaw_constants(PARROT_INTERP, ARGIN(STRING *image))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-PMC* Parrot_thaw_constants(PARROT_INTERP, ARGIN(STRING* image))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-#define ASSERT_ARGS_Parrot_clone __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_freeze __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_clone __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_freeze_at_destruct __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_Parrot_freeze __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_thaw __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_Parrot_thaw __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(image)
-#define ASSERT_ARGS_Parrot_thaw_constants __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(image))
+#define ASSERT_ARGS_Parrot_thaw_constants __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(image)
+    , PARROT_ASSERT_ARG(image))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/pmc_freeze.c */
 

Modified: branches/orderedhash_revamp/include/parrot/pobj.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/pobj.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/pobj.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -15,46 +15,19 @@
 
 #include "parrot/config.h"
 
-typedef union UnionVal {
-    struct _b {                                  /* One Buffer structure */
-        void *     _bufstart;
-        size_t     _buflen;
-    } _b;
-    struct _ptrs {                                  /* or two pointers, both are defines */
-        DPOINTER * _struct_val;
-        PMC *      _pmc_val;
-    } _ptrs;
-    struct _i {
-        INTVAL _int_val;                      /* or 2 intvals */
-        INTVAL _int_val2;
-    } _i;
-    FLOATVAL _num_val;                       /* or one float */
-    struct parrot_string_t * _string_val;    /* or a pointer to a string */
-} UnionVal;
-
-#define UVal_ptr(u)       (u)._ptrs._struct_val
-#define UVal_pmc(u)       (u)._ptrs._pmc_val
-#define UVal_int(u)       (u)._i._int_val
-#define UVal_int2(u)      (u)._i._int_val2
-#define UVal_num(u)       (u)._num_val
-#define UVal_str(u)       (u)._string_val
-
 /* Parrot Object - base class for all others */
 typedef struct pobj_t {
-    UnionVal u;
     Parrot_UInt flags;
-} pobj_t;
+} PObj;
 
-/* plain Buffer is the smallest Parrot Obj */
-typedef struct Buffer {
-    UnionVal    cache;
+typedef struct buffer_t {
     Parrot_UInt flags;
+    void *     _bufstart;
+    size_t     _buflen;
 } Buffer;
 
-typedef Buffer PObj;
-
-#define PObj_bufstart(pmc)    (pmc)->cache._b._bufstart
-#define PObj_buflen(pmc)      (pmc)->cache._b._buflen
+#define Buffer_bufstart(buffer)    (buffer)->_bufstart
+#define Buffer_buflen(buffer)      (buffer)->_buflen
 
 /* See src/gc/alloc_resources.c. the basic idea is that buffer memory is
    set up as follows:
@@ -65,44 +38,28 @@
                     v                 v
 
 The actual set-up is more involved because of padding.  obj->bufstart must
-be suitably aligned for any UnionVal.  (Perhaps it should be a Buffer
-there instead.)  The start of the memory region (as returned by malloc()
-is also suitably aligned for any use.  If, for example, malloc() returns
+be suitably aligned. The start of the memory region (as returned by malloc())
+is suitably aligned for any use.  If, for example, malloc() returns
 objects aligned on 8-byte boundaries, and obj->bufstart is also aligned
-on 8-byte boundaries, then there should be 4 bytes of padding.  It is
-handled differently in the two files alloc_resources.c and res_lea.c.
-In alloc_resources.c, the buffer is carved out of a larger memory pool.  In
-res_lea.c, each buffer is individually allocated.
-
-               src/gc/alloc_resources.c:       src/gc/res_lea.c:
-
-ptr from malloc ->  +------------------+      +------------------+
-                      [other blocks?]         | INTVAL ref_count |
-                    | INTVAL ref_count |      | possible padding |
-obj->bufstart   ->  +------------------+      +------------------+
-                    |     data         |      |      data        |
-                    v                  v      v                  v
+on 8-byte boundaries, then there should be 4 bytes of padding.
+
+ptr from malloc ->  +------------------+
+                      [other blocks?]  |
+                    | INTVAL ref_count |
+obj->bufstart   ->  +------------------+
+                    |     data         |
+                    v                  v
 
 */
-typedef struct Buffer_alloc_unit {
-    INTVAL ref_count;
-    UnionVal buffer[1]; /* Guarantee it's suitably aligned */
-} Buffer_alloc_unit;
 
 /* Given a pointer to the buffer, find the ref_count and the actual start of
    the allocated space. Setting ref_count is clunky because we avoid lvalue
    casts. */
-#ifdef GC_IS_MALLOC       /* see src/gc/res_lea.c */
-#  define Buffer_alloc_offset    (offsetof(Buffer_alloc_unit, buffer))
-#  define PObj_bufallocstart(b)  ((char *)PObj_bufstart(b) - Buffer_alloc_offset)
-#  define PObj_bufrefcount(b)    (((Buffer_alloc_unit *)PObj_bufallocstart(b))->ref_count)
-#  define PObj_bufrefcountptr(b) (&PObj_bufrefcount(b))
-#else                     /* see src/gc/alloc_resources.c */
-#  define Buffer_alloc_offset sizeof (INTVAL)
-#  define PObj_bufallocstart(b)  ((char *)PObj_bufstart(b) - Buffer_alloc_offset)
-#  define PObj_bufrefcount(b)    (*(INTVAL *)PObj_bufallocstart(b))
-#  define PObj_bufrefcountptr(b) ((INTVAL *)PObj_bufallocstart(b))
-#endif
+#define Buffer_alloc_offset sizeof (INTVAL)
+#define Buffer_bufallocstart(b)  ((char *)Buffer_bufstart(b) - Buffer_alloc_offset)
+#define Buffer_bufrefcount(b)    (*(INTVAL *)Buffer_bufallocstart(b))
+#define Buffer_bufrefcountptr(b) ((INTVAL *)Buffer_bufallocstart(b))
+
 
 typedef enum {
     enum_stringrep_unknown = 0,
@@ -112,8 +69,9 @@
 } parrot_string_representation_t;
 
 struct parrot_string_t {
-    UnionVal    cache;
     Parrot_UInt flags;
+    void *     _bufstart;
+    size_t     _buflen;
     char       *strstart;
     UINTVAL     bufused;
     UINTVAL     strlen;
@@ -124,57 +82,26 @@
     const struct _charset  *charset;
 };
 
+struct _Sync;   /* forward decl */
+
 /* note that cache and flags are isomorphic with Buffer and PObj */
 struct PMC {
-    UnionVal        cache;
     Parrot_UInt     flags;
     VTABLE         *vtable;
     DPOINTER       *data;
-    struct PMC_EXT *pmc_ext;
-};
 
-struct _Sync;   /* forward decl */
-
-typedef struct PMC_EXT {
     PMC *_metadata;      /* properties */
     /*
      * PMC access synchronization for shared PMCs
      * s. parrot/thread.h
      */
     struct _Sync *_synchronize;
+};
 
-    /* This flag determines the next PMC in the 'used' list during
-       dead object detection in the GC. It is a linked list, which is
-       only valid in trace_active_PMCs. Also, the linked list is
-       guaranteed to have the tail element's _next_for_GC point to itself,
-       which makes much of the logic and checks simpler. We then have to
-       check for PMC->_next_for_GC == PMC to find the end of list. */
-    PMC *_next_for_GC;
-
-    /* Yeah, the GC data should be out of
-       band, but that makes things really slow when actually marking
-       things for the GC runs. Unfortunately putting this here makes
-       marking things clear for the GC pre-run slow as well, as we need
-       to touch all the PMC structs. (Though we will for flag setting
-       anyway) We can potentially make this a pointer to the real GC
-       stuff, which'd merit an extra dereference when setting, but let
-       us memset the actual GC data in a big block
-    */
-} PMC_EXT;
-
-#ifdef NDEBUG
-#  define PMC_ext_checked(pmc)             (pmc)->pmc_ext
-#else
-#  define PMC_ext_checked(pmc)             (PARROT_ASSERT((pmc)->pmc_ext), (pmc)->pmc_ext)
-#endif /* NDEBUG */
 #define PMC_data(pmc)                   (pmc)->data
 #define PMC_data_typed(pmc, type) (type)(pmc)->data
-/* do not allow PMC_data2 as lvalue */
-#define PMC_data0(pmc)            (1 ? (pmc)->data : 0)
-#define PMC_data0_typed(pmc)      (type)(1 ? (pmc)->data : 0)
-#define PMC_metadata(pmc)     PMC_ext_checked(pmc)->_metadata
-#define PMC_next_for_GC(pmc)  PMC_ext_checked(pmc)->_next_for_GC
-#define PMC_sync(pmc)         PMC_ext_checked(pmc)->_synchronize
+#define PMC_metadata(pmc)         ((pmc)->_metadata)
+#define PMC_sync(pmc)             ((pmc)->_synchronize)
 
 #define POBJ_FLAG(n) ((UINTVAL)1 << (n))
 /* PObj flags */
@@ -199,8 +126,6 @@
     PObj_is_string_FLAG         = POBJ_FLAG(8),
     /* PObj is a PMC */
     PObj_is_PMC_FLAG            = POBJ_FLAG(9),
-    /* the PMC has a PMC_EXT structure appended */
-    PObj_is_PMC_EXT_FLAG        = POBJ_FLAG(10),
     /* the PMC is a shared PMC */
     PObj_is_PMC_shared_FLAG     = POBJ_FLAG(11), /* Same as PObj_is_shared_FLAG */
     /* PObj is otherwise shared */
@@ -233,7 +158,7 @@
     /* Mark the buffer as needing GC */
     PObj_custom_GC_FLAG         = POBJ_FLAG(21),
     /* Set if the PObj has a destroy method that must be called */
-    PObj_active_destroy_FLAG    = POBJ_FLAG(22),
+    PObj_custom_destroy_FLAG    = POBJ_FLAG(22),
     /* For debugging, report when this buffer gets moved around */
     PObj_report_FLAG            = POBJ_FLAG(23),
 
@@ -331,9 +256,8 @@
 #define PObj_special_CLEAR(flag, o) do { \
     PObj_flag_CLEAR(flag, o); \
     if ((PObj_get_FLAGS(o) & \
-                (PObj_active_destroy_FLAG | \
+                (PObj_custom_destroy_FLAG | \
                  PObj_custom_mark_FLAG | \
-                 PObj_is_PMC_EXT_FLAG | \
                  PObj_needs_early_gc_FLAG))) \
         gc_flag_SET(is_special_PMC, o); \
     else \
@@ -355,9 +279,9 @@
 #define PObj_custom_mark_CLEAR(o)   PObj_special_CLEAR(custom_mark, o)
 #define PObj_custom_mark_TEST(o)   PObj_flag_TEST(custom_mark, o)
 
-#define PObj_active_destroy_SET(o) PObj_flag_SET(active_destroy, o)
-#define PObj_active_destroy_TEST(o) PObj_flag_TEST(active_destroy, o)
-#define PObj_active_destroy_CLEAR(o) PObj_flag_CLEAR(active_destroy, o)
+#define PObj_custom_destroy_SET(o)   PObj_flag_SET(custom_destroy,   o)
+#define PObj_custom_destroy_TEST(o)  PObj_flag_TEST(custom_destroy,  o)
+#define PObj_custom_destroy_CLEAR(o) PObj_flag_CLEAR(custom_destroy, o)
 
 #define PObj_is_class_SET(o) PObj_flag_SET(is_class, o)
 #define PObj_is_class_TEST(o) PObj_flag_TEST(is_class, o)
@@ -369,9 +293,6 @@
 
 #define PObj_is_PMC_TEST(o) PObj_flag_TEST(is_PMC, o)
 
-#define PObj_is_PMC_EXT_TEST(o) PObj_flag_TEST(is_PMC_EXT, o)
-#define PObj_is_PMC_EXT_SET(o) PObj_special_SET(is_PMC_EXT, o)
-
 #define PObj_is_PMC_shared_TEST(o) PObj_flag_TEST(is_PMC_shared, o)
 #define PObj_is_PMC_shared_SET(o)  PObj_flag_SET(is_PMC_shared, o)
 #define PObj_is_PMC_shared_CLEAR(o) PObj_flag_CLEAR(is_PMC_shared, o)
@@ -402,9 +323,23 @@
 
 #define PObj_custom_mark_destroy_SETALL(o) do { \
         PObj_custom_mark_SET(o); \
-        PObj_active_destroy_SET(o); \
+        PObj_custom_destroy_SET(o); \
 } while (0)
 
+#define PObj_gc_CLEAR(o) (PObj_get_FLAGS(o) \
+    &= ~PObj_custom_destroy_FLAG \
+     | ~PObj_custom_mark_FLAG \
+     | ~PObj_live_FLAG)
+
+/*******************************************************
+ * DEPRECATED -- use PObj_custom_destroy_FOO() instead *
+ *******************************************************/
+#define PObj_active_destroy_FLAG     PObj_custom_destroy_FLAG
+#define PObj_active_destroy_SET(o)   PObj_flag_SET(custom_destroy,   o)
+#define PObj_active_destroy_TEST(o)  PObj_flag_TEST(custom_destroy,  o)
+#define PObj_active_destroy_CLEAR(o) PObj_flag_CLEAR(custom_destroy, o)
+
+
 #endif /* PARROT_POBJ_H_GUARD */
 
 /*

Deleted: branches/orderedhash_revamp/include/parrot/register.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/register.h	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,184 +0,0 @@
-/* register.h
- *  Copyright (C) 2001-2008, Parrot Foundation.
- *  SVN Info
- *     $Id$
- *  Overview:
- *     Defines the register api
- *  Data Structure and Algorithms:
- *  History:
- *  Notes:
- *  References:
- */
-
-#ifndef PARROT_REGISTER_H_GUARD
-#define PARROT_REGISTER_H_GUARD
-
-#include "parrot/string.h"
-#include "parrot/compiler.h"
-#include "parrot/stacks.h"
-
-/*
- * Macros to make accessing registers more convenient/readable.
- */
-
-#define CTX_REG_NUM(ctx, x) (ctx)->bp.regs_n[-1L-(x)]
-#define CTX_REG_INT(ctx, x) (ctx)->bp.regs_i[x]
-#define CTX_REG_PMC(ctx, x) (ctx)->bp_ps.regs_p[-1L-(x)]
-#define CTX_REG_STR(ctx, x) (ctx)->bp_ps.regs_s[x]
-
-#define REG_NUM(interp, x) CTX_REG_NUM(&(interp)->ctx, (x))
-#define REG_INT(interp, x) CTX_REG_INT(&(interp)->ctx, (x))
-#define REG_PMC(interp, x) CTX_REG_PMC(&(interp)->ctx, (x))
-#define REG_STR(interp, x) CTX_REG_STR(&(interp)->ctx, (x))
-
-/*
- * and a set of macros to access a register by offset, used
- * in JIT emit prederef code
- * The offsets are relative to interp->ctx.bp.
- *
- * Reg order in imcc/reg_alloc.c is "INSP"   TODO make defines
- */
-
-#define REGNO_INT 0
-#define REGNO_NUM 1
-#define REGNO_STR 2
-#define REGNO_PMC 3
-
-#define __CTX interp->ctx.state
-#define _SIZEOF_INTS    (sizeof (INTVAL) * __CTX->n_regs_used[REGNO_INT])
-#define _SIZEOF_NUMS    (sizeof (FLOATVAL) * __CTX->n_regs_used[REGNO_NUM])
-#define _SIZEOF_PMCS    (sizeof (PMC*) * __CTX->n_regs_used[REGNO_PMC])
-#define _SIZEOF_STRS    (sizeof (STRING*) * __CTX->n_regs_used[REGNO_STR])
-
-#define REG_OFFS_NUM(x) (sizeof (FLOATVAL) * (-1L - (x)))
-#define REG_OFFS_INT(x) (sizeof (INTVAL) * (x))
-#define REG_OFFS_PMC(x) (_SIZEOF_INTS + sizeof (PMC*) * \
-        (__CTX->n_regs_used[REGNO_PMC] - 1L - (x)))
-#define REG_OFFS_STR(x) (sizeof (STRING*) * (x) + _SIZEOF_INTS + _SIZEOF_PMCS)
-
-
-struct Stack_Chunk;
-typedef struct Parrot_Context Parrot_Context; /* parrot/interpreter.h */
-
-/* HEADERIZER BEGIN: src/gc/alloc_register.c */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-
-PARROT_EXPORT
-void Parrot_clear_i(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-PARROT_EXPORT
-void Parrot_clear_n(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-PARROT_EXPORT
-void Parrot_clear_p(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-PARROT_EXPORT
-void Parrot_clear_s(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-PARROT_EXPORT
-PARROT_CANNOT_RETURN_NULL
-Parrot_Context * Parrot_context_ref_trace(PARROT_INTERP,
-    ARGMOD(Parrot_Context *ctx),
-    ARGIN(const char *file),
-    int line)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*ctx);
-
-PARROT_EXPORT
-void Parrot_free_context(PARROT_INTERP,
-    ARGMOD(Parrot_Context *ctx),
-    int deref)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*ctx);
-
-PARROT_EXPORT
-void parrot_gc_context(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-PARROT_EXPORT
-void Parrot_pop_context(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-Parrot_Context * Parrot_push_context(PARROT_INTERP,
-    ARGIN(const INTVAL *n_regs_used))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-PARROT_EXPORT
-void Parrot_set_context_threshold(SHIM_INTERP, SHIM(Parrot_Context *ctx));
-
-void create_initial_context(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-void destroy_context(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-PARROT_CANNOT_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-Parrot_Context * Parrot_alloc_context(PARROT_INTERP,
-    ARGIN(const INTVAL *number_regs_used),
-    ARGIN_NULLOK(Parrot_Context *old))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-PARROT_CANNOT_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-Parrot_Context * Parrot_set_new_context(PARROT_INTERP,
-    ARGIN(const INTVAL *number_regs_used))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-#define ASSERT_ARGS_Parrot_clear_i __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_clear_n __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_clear_p __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_clear_s __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_context_ref_trace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ctx) \
-    || PARROT_ASSERT_ARG(file)
-#define ASSERT_ARGS_Parrot_free_context __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ctx)
-#define ASSERT_ARGS_parrot_gc_context __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_pop_context __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_push_context __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(n_regs_used)
-#define ASSERT_ARGS_Parrot_set_context_threshold __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_create_initial_context __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_destroy_context __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_alloc_context __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(number_regs_used)
-#define ASSERT_ARGS_Parrot_set_new_context __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(number_regs_used)
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: src/gc/alloc_register.c */
-
-#endif /* PARROT_REGISTER_H_GUARD */
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Modified: branches/orderedhash_revamp/include/parrot/runcore_api.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/runcore_api.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/runcore_api.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -9,11 +9,72 @@
 #ifndef PARROT_RUNCORE_API_H_GUARD
 #define PARROT_RUNCORE_API_H_GUARD
 
+struct runcore_t;
+typedef struct runcore_t Parrot_runcore_t;
+
 #include "parrot/parrot.h"
 #include "parrot/op.h"
 
 #  define DO_OP(PC, INTERP) ((PC) = (((INTERP)->op_func_table)[*(PC)])((PC), (INTERP)))
 
+typedef opcode_t * (*runcore_runops_fn_type) (PARROT_INTERP, ARGIN(Parrot_runcore_t *), ARGIN(opcode_t *pc));
+typedef       void (*runcore_destroy_fn_type)(PARROT_INTERP, ARGIN(Parrot_runcore_t *));
+typedef     void * (*runcore_prepare_fn_type)(PARROT_INTERP, ARGIN(Parrot_runcore_t *));
+
+typedef runcore_runops_fn_type  Parrot_runcore_runops_fn_t;
+typedef runcore_destroy_fn_type Parrot_runcore_destroy_fn_t;
+typedef runcore_prepare_fn_type Parrot_runcore_prepare_fn_t;
+
+struct runcore_t {
+    STRING                  *name;
+    int                      id;
+    oplib_init_f             opinit;
+    runcore_runops_fn_type   runops;
+    runcore_destroy_fn_type  destroy;
+    runcore_prepare_fn_type  prepare_run;
+    INTVAL                   flags;
+};
+
+typedef enum Parrot_runcore_flags {
+    RUNCORE_REENTRANT_FLAG    = 1 << 0,
+    RUNCORE_FUNC_TABLE_FLAG   = 1 << 1,
+    RUNCORE_EVENT_CHECK_FLAG  = 1 << 2,
+    RUNCORE_PREDEREF_OPS_FLAG = 1 << 3,
+    RUNCORE_CGOTO_OPS_FLAG    = 1 << 4,
+    RUNCORE_JIT_OPS_FLAG      = 1 << 5
+} Parrot_runcore_flags;
+
+
+#define Runcore_flag_SET(runcore, flag) \
+    ((runcore)->flags |= flag)
+#define Runcore_flag_TEST(runcore, flag) \
+    ((runcore)->flags & flag)
+
+#define PARROT_RUNCORE_FUNC_TABLE_TEST(runcore) \
+    Runcore_flag_TEST(runcore, RUNCORE_FUNC_TABLE_FLAG)
+#define PARROT_RUNCORE_FUNC_TABLE_SET(runcore) \
+    Runcore_flag_SET(runcore, RUNCORE_FUNC_TABLE_FLAG)
+
+#define PARROT_RUNCORE_EVENT_CHECK_TEST(runcore) \
+    Runcore_flag_TEST(runcore, RUNCORE_EVENT_CHECK_FLAG)
+#define PARROT_RUNCORE_EVENT_CHECK_SET(runcore) \
+    Runcore_flag_SET(runcore, RUNCORE_EVENT_CHECK_FLAG)
+
+#define PARROT_RUNCORE_PREDEREF_OPS_TEST(runcore) \
+    Runcore_flag_TEST(runcore, RUNCORE_PREDEREF_OPS_FLAG)
+#define PARROT_RUNCORE_PREDEREF_OPS_SET(runcore) \
+    Runcore_flag_SET(runcore, RUNCORE_PREDEREF_OPS_FLAG)
+
+#define PARROT_RUNCORE_CGOTO_OPS_TEST(runcore) \
+    Runcore_flag_TEST(runcore, RUNCORE_CGOTO_OPS_FLAG)
+#define PARROT_RUNCORE_CGOTO_OPS_SET(runcore) \
+    Runcore_flag_SET(runcore, RUNCORE_CGOTO_OPS_FLAG)
+
+#define PARROT_RUNCORE_JIT_OPS_TEST(runcore) \
+    Runcore_flag_TEST(runcore, RUNCORE_JIT_OPS_FLAG)
+#define PARROT_RUNCORE_JIT_OPS_SET(runcore) \
+    Runcore_flag_SET(runcore, RUNCORE_JIT_OPS_FLAG)
+
 /* HEADERIZER BEGIN: src/runcore/main.c */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
@@ -25,24 +86,33 @@
 void enable_event_checking(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-void do_prederef(ARGIN(void **pc_prederef), PARROT_INTERP, int type)
+PARROT_EXPORT
+INTVAL Parrot_runcore_register(PARROT_INTERP,
+    ARGIN(Parrot_runcore_t *coredata))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-void dynop_register(PARROT_INTERP, ARGIN(PMC *lib_pmc))
+PARROT_EXPORT
+void Parrot_runcore_switch(PARROT_INTERP, ARGIN(STRING *name))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-void exec_init_prederef(PARROT_INTERP, ARGIN(void *prederef_arena))
+void do_prederef(
+    ARGIN(void **pc_prederef),
+    PARROT_INTERP,
+    ARGIN(Parrot_runcore_t *runcore))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
+
+void dynop_register(PARROT_INTERP, ARGIN(PMC *lib_pmc))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-void * init_jit(PARROT_INTERP, SHIM(opcode_t *pc))
+void Parrot_runcore_destroy(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-void Parrot_runcore_destroy(PARROT_INTERP)
+void Parrot_runcore_init(PARROT_INTERP)
         __attribute__nonnull__(1);
 
 void Parrot_setup_event_func_ptrs(PARROT_INTERP)
@@ -54,29 +124,33 @@
 void runops_int(PARROT_INTERP, size_t offset)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_disable_event_checking __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_enable_event_checking __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_do_prederef __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pc_prederef) \
-    || PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_dynop_register __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_disable_event_checking __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_enable_event_checking __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_runcore_register __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(lib_pmc)
-#define ASSERT_ARGS_exec_init_prederef __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(coredata))
+#define ASSERT_ARGS_Parrot_runcore_switch __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(prederef_arena)
-#define ASSERT_ARGS_init_jit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_runcore_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_setup_event_func_ptrs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_prepare_for_run __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_runops_int __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_do_prederef __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(pc_prederef) \
+    , PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(runcore))
+#define ASSERT_ARGS_dynop_register __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(lib_pmc))
+#define ASSERT_ARGS_Parrot_runcore_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_runcore_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_setup_event_func_ptrs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_prepare_for_run __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_runops_int __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/runcore/main.c */
 
@@ -84,70 +158,73 @@
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
 PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-opcode_t * runops_cgoto_core(PARROT_INTERP, ARGIN(opcode_t *pc))
+PARROT_CANNOT_RETURN_NULL
+oplib_init_f get_core_op_lib_init(PARROT_INTERP,
+    ARGIN(Parrot_runcore_t *runcore))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
-opcode_t * runops_debugger_core(PARROT_INTERP, ARGIN(opcode_t *pc))
+void * init_prederef(PARROT_INTERP, ARGIN(Parrot_runcore_t *runcore))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-opcode_t * runops_fast_core(PARROT_INTERP, ARGIN(opcode_t *pc))
+void load_prederef(PARROT_INTERP, ARGIN(Parrot_runcore_t *runcore))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-opcode_t * runops_gc_debug_core(PARROT_INTERP, ARGIN(opcode_t *pc))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
+void Parrot_runcore_cgoto_init(PARROT_INTERP)
+        __attribute__nonnull__(1);
 
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-opcode_t * runops_profile_core(PARROT_INTERP, ARGIN(opcode_t *pc))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
+void Parrot_runcore_cgp_init(PARROT_INTERP)
+        __attribute__nonnull__(1);
 
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-opcode_t * runops_slow_core(PARROT_INTERP, ARGIN(opcode_t *pc))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
+void Parrot_runcore_debugger_init(PARROT_INTERP)
+        __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_runops_cgoto_core __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pc)
-#define ASSERT_ARGS_runops_debugger_core __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pc)
-#define ASSERT_ARGS_runops_fast_core __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pc)
-#define ASSERT_ARGS_runops_gc_debug_core __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+void Parrot_runcore_exec_init(PARROT_INTERP)
+        __attribute__nonnull__(1);
+
+void Parrot_runcore_fast_init(PARROT_INTERP)
+        __attribute__nonnull__(1);
+
+void Parrot_runcore_gc_debug_init(PARROT_INTERP)
+        __attribute__nonnull__(1);
+
+void Parrot_runcore_slow_init(PARROT_INTERP)
+        __attribute__nonnull__(1);
+
+void Parrot_runcore_switch_init(PARROT_INTERP)
+        __attribute__nonnull__(1);
+
+#define ASSERT_ARGS_get_core_op_lib_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pc)
-#define ASSERT_ARGS_runops_profile_core __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(runcore))
+#define ASSERT_ARGS_init_prederef __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pc)
-#define ASSERT_ARGS_runops_slow_core __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(runcore))
+#define ASSERT_ARGS_load_prederef __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pc)
+    , PARROT_ASSERT_ARG(runcore))
+#define ASSERT_ARGS_Parrot_runcore_cgoto_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_runcore_cgp_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_runcore_debugger_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_runcore_exec_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_runcore_fast_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_runcore_gc_debug_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_runcore_slow_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_runcore_switch_init __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/runcore/cores.c */
 
-opcode_t *runops_fast_core(PARROT_INTERP, opcode_t *);
-
-opcode_t *runops_cgoto_core(PARROT_INTERP, opcode_t *);
-
-opcode_t *runops_slow_core(PARROT_INTERP, opcode_t *);
-
-opcode_t *runops_profile_core(PARROT_INTERP, opcode_t *);
-
 #endif /* PARROT_RUNCORE_API_H_GUARD */
 
 

Added: branches/orderedhash_revamp/include/parrot/runcore_profiling.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/include/parrot/runcore_profiling.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,160 @@
+/* runcore_api.h
+ *  Copyright (C) 2001-2009, Parrot Foundation.
+ *  SVN Info
+ *     $Id$
+ *  Overview:
+ *     Functions and macros to dispatch opcodes.
+ */
+
+#ifndef PARROT_RUNCORE_PROFILING_H_GUARD
+#define PARROT_RUNCORE_PROFILING_H_GUARD
+
+struct         profiling_runcore_t;
+typedef struct profiling_runcore_t Parrot_profiling_runcore_t;
+
+#include "parrot/parrot.h"
+#include "parrot/op.h"
+#include "parrot/runcore_api.h"
+
+/* make a #define that will hold an INTVAL and a pointer */
+#if PTR_SIZE == INTVAL_SIZE
+#  define PPROF_DATA INTVAL
+#else
+#  define PPROF_DATA HUGEINTVAL
+#endif
+
+typedef enum Parrot_profiling_flags {
+    PROFILING_EXIT_CHECK_FLAG         = 1 << 0,
+    PROFILING_FIRST_LOOP_FLAG         = 1 << 1,
+    PROFILING_HAVE_PRINTED_CLI_FLAG   = 1 << 2,
+    PROFILING_REPORT_ANNOTATIONS_FLAG = 1 << 3
+
+} Parrot_profiling_flags;
+
+typedef enum Parrot_profiling_line {
+    PPROF_LINE_CONTEXT_SWITCH,
+    PPROF_LINE_OP,
+    PPROF_LINE_ANNOTATION,
+    PPROF_LINE_VERSION,
+    PPROF_LINE_CLI,
+    PPROF_LINE_END_OF_RUNLOOP
+} Parrot_profiling_line;
+
+typedef void (*profiling_output_fn)(ARGIN(Parrot_profiling_runcore_t*), ARGIN_NULLOK(Parrot_profiling_line));
+typedef        profiling_output_fn Parrot_profiling_output_fn;
+
+typedef enum Parrot_profiling_datatype {
+
+    /* context switch */
+    PPROF_DATA_NAMESPACE = 0,
+    PPROF_DATA_FILENAME  = 1,
+    PPROF_DATA_SUB_ADDR  = 2,
+    PPROF_DATA_CTX_ADDR  = 3,
+
+    /* op */
+    PPROF_DATA_LINE   = 0,
+    PPROF_DATA_TIME   = 1,
+    PPROF_DATA_OPNAME = 2,
+
+    /* annotation */
+    PPROF_DATA_ANNOTATION_NAME  = 0,
+    PPROF_DATA_ANNOTATION_VALUE = 1,
+
+    PPROF_DATA_VERSION = 0,
+
+    PPROF_DATA_CLI = 0,
+
+    PPROF_DATA_MAX = 3,
+} Parrot_profiling_datatype;
+
+struct profiling_runcore_t {
+    STRING                      *name;
+    int                          id;
+    oplib_init_f                 opinit;
+    Parrot_runcore_runops_fn_t   runops;
+    Parrot_runcore_destroy_fn_t  destroy;
+    Parrot_runcore_prepare_fn_t  prepare_run;
+    INTVAL                       flags;
+
+    /* end of common members */
+    Parrot_profiling_output_fn output_fn;
+    UHUGEINTVAL     runcore_start;
+    UHUGEINTVAL     op_start;
+    UHUGEINTVAL     op_finish;
+    UHUGEINTVAL     runcore_finish;
+    INTVAL          profiling_flags;
+    INTVAL          runloop_count;
+    FILE           *profile_fd;
+    STRING         *profile_filename;
+    PMC            *prev_sub;
+    Parrot_Context *prev_ctx;
+    UINTVAL         level;      /* how many nested runloops */
+    UINTVAL         time_size;  /* how big is the following array */
+    UHUGEINTVAL    *time;       /* time spent between DO_OP and start/end of a runcore */
+    Hash           *line_cache; /* hash for caching pc -> line mapping */
+    PPROF_DATA      pprof_data[PPROF_DATA_MAX+1]; /* array for storage of one line of profiling data */
+};
+
+#define Profiling_flag_SET(runcore, flag) \
+    ((runcore)->profiling_flags |= flag)
+#define Profiling_flag_TEST(runcore, flag) \
+    ((runcore)->profiling_flags & flag)
+#define Profiling_flag_CLEAR(runcore, flag) \
+    ((runcore)->profiling_flags &= ~(flag))
+
+#define Profiling_exit_check_TEST(o) \
+    Profiling_flag_TEST(o, PROFILING_EXIT_CHECK_FLAG)
+#define Profiling_exit_check_SET(o) \
+    Profiling_flag_SET(o, PROFILING_EXIT_CHECK_FLAG)
+#define Profiling_exit_check_CLEAR(o) \
+    Profiling_flag_CLEAR(o, PROFILING_EXIT_CHECK_FLAG)
+
+#define Profiling_first_loop_TEST(o) \
+    Profiling_flag_TEST(o, PROFILING_FIRST_LOOP_FLAG)
+#define Profiling_first_loop_SET(o) \
+    Profiling_flag_SET(o, PROFILING_FIRST_LOOP_FLAG)
+#define Profiling_first_loop_CLEAR(o) \
+    Profiling_flag_CLEAR(o, PROFILING_FIRST_LOOP_FLAG)
+
+#define Profiling_have_printed_cli_TEST(o) \
+    Profiling_flag_TEST(o, PROFILING_HAVE_PRINTED_CLI_FLAG)
+#define Profiling_have_printed_cli_SET(o) \
+    Profiling_flag_SET(o, PROFILING_HAVE_PRINTED_CLI_FLAG)
+#define Profiling_have_printed_cli_CLEAR(o) \
+    Profiling_flag_CLEAR(o, PROFILING_HAVE_PRINTED_CLI_FLAG)
+
+#define Profiling_report_annotations_TEST(o) \
+    Profiling_flag_TEST(o, PROFILING_REPORT_ANNOTATIONS_FLAG)
+#define Profiling_report_annotations_SET(o) \
+    Profiling_flag_SET(o, PROFILING_REPORT_ANNOTATIONS_FLAG)
+#define Profiling_report_annotations_CLEAR(o) \
+    Profiling_flag_CLEAR(o, PROFILING_REPORT_ANNOTATIONS_FLAG)
+
+/* HEADERIZER BEGIN: src/runcore/profiling.c */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+
+PARROT_CAN_RETURN_NULL
+void * destroy_profiling_core(PARROT_INTERP,
+    ARGIN(Parrot_profiling_runcore_t *runcore))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+void Parrot_runcore_profiling_init(PARROT_INTERP)
+        __attribute__nonnull__(1);
+
+#define ASSERT_ARGS_destroy_profiling_core __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(runcore))
+#define ASSERT_ARGS_Parrot_runcore_profiling_init __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/runcore/profiling.c */
+
+#endif /* PARROT_RUNCORE_PROFILING_H_GUARD */
+
+/*
+ * Local variables:
+ *   c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */

Modified: branches/orderedhash_revamp/include/parrot/runcore_trace.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/runcore_trace.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/runcore_trace.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -44,21 +44,21 @@
 void trace_pmc_dump(PARROT_INTERP, ARGIN_NULLOK(PMC *pmc))
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_debugger_or_interp __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_trace_key_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_debugger_or_interp __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_trace_key_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(key)
-#define ASSERT_ARGS_trace_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(key))
+#define ASSERT_ARGS_trace_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(code_start) \
-    || PARROT_ASSERT_ARG(code_end)
-#define ASSERT_ARGS_trace_op_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(code_start) \
+    , PARROT_ASSERT_ARG(code_end))
+#define ASSERT_ARGS_trace_op_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(code_start) \
-    || PARROT_ASSERT_ARG(pc)
-#define ASSERT_ARGS_trace_pmc_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+    , PARROT_ASSERT_ARG(code_start) \
+    , PARROT_ASSERT_ARG(pc))
+#define ASSERT_ARGS_trace_pmc_dump __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/runcore/trace.c */
 

Modified: branches/orderedhash_revamp/include/parrot/scheduler.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/scheduler.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/scheduler.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -168,88 +168,88 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-#define ASSERT_ARGS_Parrot_cx_add_handler __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_cx_add_handler __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(handler)
-#define ASSERT_ARGS_Parrot_cx_add_handler_local __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(handler))
+#define ASSERT_ARGS_Parrot_cx_add_handler_local __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(handler)
-#define ASSERT_ARGS_Parrot_cx_broadcast_message __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(handler))
+#define ASSERT_ARGS_Parrot_cx_broadcast_message __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(messagetype)
+    , PARROT_ASSERT_ARG(messagetype))
 #define ASSERT_ARGS_Parrot_cx_count_handlers_local \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(handler_type)
+    , PARROT_ASSERT_ARG(handler_type))
 #define ASSERT_ARGS_Parrot_cx_count_handlers_typed \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(handler_type)
+    , PARROT_ASSERT_ARG(handler_type))
 #define ASSERT_ARGS_Parrot_cx_delete_handler_local \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(handler_type)
+    , PARROT_ASSERT_ARG(handler_type))
 #define ASSERT_ARGS_Parrot_cx_delete_handler_typed \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(handler_type)
+    , PARROT_ASSERT_ARG(handler_type))
 #define ASSERT_ARGS_Parrot_cx_delete_suspend_for_gc \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_cx_delete_task __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_cx_delete_task __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(task)
+    , PARROT_ASSERT_ARG(task))
 #define ASSERT_ARGS_Parrot_cx_find_handler_for_task \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(task)
-#define ASSERT_ARGS_Parrot_cx_find_handler_local __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(task))
+#define ASSERT_ARGS_Parrot_cx_find_handler_local __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(task)
-#define ASSERT_ARGS_Parrot_cx_handle_tasks __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(task))
+#define ASSERT_ARGS_Parrot_cx_handle_tasks __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(scheduler)
-#define ASSERT_ARGS_Parrot_cx_peek_task __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+    , PARROT_ASSERT_ARG(scheduler))
+#define ASSERT_ARGS_Parrot_cx_peek_task __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
 #define ASSERT_ARGS_Parrot_cx_request_suspend_for_gc \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_cx_runloop_end __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_cx_schedule_callback __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(user_data) \
-    || PARROT_ASSERT_ARG(ext_data)
-#define ASSERT_ARGS_Parrot_cx_schedule_repeat __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(task)
-#define ASSERT_ARGS_Parrot_cx_schedule_sleep __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_cx_schedule_task __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(task)
-#define ASSERT_ARGS_Parrot_cx_schedule_timer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_cx_send_message __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(messagetype)
-#define ASSERT_ARGS_Parrot_cx_check_tasks __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(scheduler)
-#define ASSERT_ARGS_Parrot_cx_init_scheduler __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_cx_invoke_callback __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(callback)
-#define ASSERT_ARGS_Parrot_cx_refresh_task_list __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_cx_runloop_end __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_cx_schedule_callback __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(user_data) \
+    , PARROT_ASSERT_ARG(ext_data))
+#define ASSERT_ARGS_Parrot_cx_schedule_repeat __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(task))
+#define ASSERT_ARGS_Parrot_cx_schedule_sleep __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_cx_schedule_task __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(task))
+#define ASSERT_ARGS_Parrot_cx_schedule_timer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_cx_send_message __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(messagetype))
+#define ASSERT_ARGS_Parrot_cx_check_tasks __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(scheduler))
+#define ASSERT_ARGS_Parrot_cx_init_scheduler __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_cx_invoke_callback __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(callback))
+#define ASSERT_ARGS_Parrot_cx_refresh_task_list __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(scheduler)
-#define ASSERT_ARGS_Parrot_cx_runloop_wake __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(scheduler))
+#define ASSERT_ARGS_Parrot_cx_runloop_wake __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(scheduler)
-#define ASSERT_ARGS_Parrot_cx_timer_invoke __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(scheduler))
+#define ASSERT_ARGS_Parrot_cx_timer_invoke __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(timer)
+    , PARROT_ASSERT_ARG(timer))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/scheduler.c */
 

Modified: branches/orderedhash_revamp/include/parrot/settings.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/settings.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/settings.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -26,8 +26,7 @@
 #endif /* DISABLE_GC_DEBUG */
 
 /* Helpful internal macro for testing whether we are currently
- * debugging garbage collection and memory management. See also the
- * definition of GC_VERBOSE in include/parrot/gc_api.h. */
+ * debugging garbage collection and memory management. */
 #if DISABLE_GC_DEBUG
 #  define GC_DEBUG(interp) 0
 #else
@@ -35,42 +34,11 @@
 #endif /* DISABLE_GC_DEBUG */
 
 /*
- * GC_SUBSYSTEM selection
- * 0 ... MS  stop-the-world mark & sweep
- * 1 ... IMS incremental mark & sweep
- * 2 ... GMS generational mark & sweep
- * 3 ... INF infinite memory "collector"
- *
- * Please note that only 0 and 3 currently work (and INF doesn't really
- * "work").
+ * GC_DEFAULT_TYPE selection
+ * MS  -- stop-the-world mark & sweep
+ * INF -- infinite memory "collector"
  */
-
-#define PARROT_GC_SUBSYSTEM 0
-
-#if PARROT_GC_SUBSYSTEM == 0
-#  define PARROT_GC_MS      1
-#  define PARROT_GC_IMS     0
-#  define PARROT_GC_GMS     0
-#  define PARROT_GC_INF     0
-#endif
-#if PARROT_GC_SUBSYSTEM == 1
-#  define PARROT_GC_MS      0
-#  define PARROT_GC_IMS     1
-#  define PARROT_GC_GMS     0
-#  define PARROT_GC_INF     0
-#endif
-#if PARROT_GC_SUBSYSTEM == 2
-#  define PARROT_GC_MS      0
-#  define PARROT_GC_IMS     0
-#  define PARROT_GC_GMS     1
-#  define PARROT_GC_INF     0
-#endif
-#if PARROT_GC_SUBSYSTEM == 3
-#  define PARROT_GC_MS      0
-#  define PARROT_GC_IMS     0
-#  define PARROT_GC_GMS     0
-#  define PARROT_GC_INF     1
-#endif
+#define PARROT_GC_DEFAULT_TYPE MS
 
 /*
  * JIT/i386 can use the CGP run core for external functions instead

Deleted: branches/orderedhash_revamp/include/parrot/slice.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/slice.h	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,40 +0,0 @@
-/* slice.h
- *  Copyright (C) 2001-2008, Parrot Foundation.
- *  SVN Info
- *     $Id$
- *  Overview:
- *     This is the api header for slices.
- *  Data Structure and Algorithms:
- *  History:
- *  Notes:
- *  References:
- */
-
-#ifndef PARROT_SLICE_H_GUARD
-#define PARROT_SLICE_H_GUARD
-
-#ifdef PARROT_IN_CORE
-
-typedef struct RUnion {
-    INTVAL i;
-    STRING *s;
-} RUnion;
-
-typedef struct _parrot_range_t {
-    int type;                      /* enum_type_INTVAL or STRING */
-    RUnion start;                  /* start of this range */
-    RUnion end;                    /* end of this range */
-    RUnion step;                   /* step of this range */
-    RUnion cur;                    /* current value */
-    struct _parrot_range_t *next;  /* next in chain */
-} parrot_range_t;
-
-#endif /* PARROT_IN_CORE */
-#endif /* PARROT_SLICE_H_GUARD */
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/include/parrot/stacks.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/stacks.h	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,223 +0,0 @@
-/* stacks.h
- *  Copyright (C) 2001-2008, Parrot Foundation.
- *  SVN Info
- *     $Id$
- *  Overview:
- *     Stack handling routines for Parrot
- *  Data Structure and Algorithms:
- *  History:
- *  Notes:
- *  References: See also enums.h
- */
-
-#ifndef PARROT_STACKS_H_GUARD
-#define PARROT_STACKS_H_GUARD
-
-#include "parrot/parrot.h"
-#include "parrot/compiler.h"
-
-#define STACK_CHUNK_LIMIT 100000
-
-typedef struct Stack_Entry {
-    UnionVal entry;
-    Stack_entry_type  entry_type;
-    void (*cleanup)(PARROT_INTERP, ARGIN(struct Stack_Entry *));
-} Stack_Entry_t;
-
-typedef struct Stack_Chunk {
-    UnionVal            cache;
-    Parrot_UInt         flags;
-    const char         *name;
-    struct Stack_Chunk *prev;
-    Parrot_UInt         refcount;
-    Stack_Entry_t       data;
-} Stack_Chunk_t;
-
-#define STACK_DATAP(chunk)    &((chunk)->data)
-/* #define STACK_ITEMSIZE(chunk) PObj_buflen(chunk) */
-
-
-typedef void (*Stack_cleanup_method)(PARROT_INTERP, ARGIN(struct Stack_Entry *));
-
-#define STACK_CLEANUP_NULL ((Stack_cleanup_method)NULLfunc)
-
-/* HEADERIZER BEGIN: src/stacks.c */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-Stack_Chunk_t * cst_new_stack_chunk(PARROT_INTERP,
-    ARGIN(const Stack_Chunk_t *chunk))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-PARROT_EXPORT
-void mark_stack(PARROT_INTERP, ARGMOD(Stack_Chunk_t *chunk))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*chunk);
-
-PARROT_EXPORT
-PARROT_CANNOT_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-Stack_Chunk_t * new_stack(PARROT_INTERP, ARGIN(const char *name))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-PARROT_EXPORT
-void Parrot_dump_dynamic_environment(PARROT_INTERP,
-    ARGIN(Stack_Chunk_t *dynamic_env))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-PARROT_EXPORT
-void Parrot_pop_mark(PARROT_INTERP, INTVAL mark)
-        __attribute__nonnull__(1);
-
-PARROT_EXPORT
-void Parrot_push_action(PARROT_INTERP, ARGIN(PMC *sub))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-PARROT_EXPORT
-void Parrot_push_mark(PARROT_INTERP, INTVAL mark)
-        __attribute__nonnull__(1);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-void * pop_dest(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-PARROT_EXPORT
-PARROT_CAN_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-Stack_Entry_t * stack_entry(SHIM_INTERP,
-    ARGIN(Stack_Chunk_t *stack),
-    INTVAL depth)
-        __attribute__nonnull__(2);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-size_t stack_height(SHIM_INTERP, ARGIN(const Stack_Chunk_t *chunk))
-        __attribute__nonnull__(2);
-
-PARROT_EXPORT
-PARROT_CAN_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-void * stack_peek(PARROT_INTERP,
-    ARGIN(Stack_Chunk_t *stack_base),
-    ARGMOD_NULLOK(Stack_entry_type *type))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*type);
-
-PARROT_EXPORT
-PARROT_CAN_RETURN_NULL
-void * stack_pop(PARROT_INTERP,
-    ARGMOD(Stack_Chunk_t **stack_p),
-    ARGOUT_NULLOK(void *where),
-    Stack_entry_type type)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*stack_p)
-        FUNC_MODIFIES(*where);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-Stack_Entry_t* stack_prepare_pop(PARROT_INTERP,
-    ARGMOD(Stack_Chunk_t **stack_p))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*stack_p);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-Stack_Entry_t* stack_prepare_push(PARROT_INTERP,
-    ARGMOD(Stack_Chunk_t **stack_p))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*stack_p);
-
-PARROT_EXPORT
-void stack_push(PARROT_INTERP,
-    ARGMOD(Stack_Chunk_t **stack_p),
-    ARGIN(void *thing),
-    Stack_entry_type type,
-    NULLOK(Stack_cleanup_method cleanup))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*stack_p);
-
-PARROT_EXPORT
-void stack_system_init(SHIM_INTERP);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_PURE_FUNCTION
-Stack_entry_type get_entry_type(ARGIN(const Stack_Entry_t *entry))
-        __attribute__nonnull__(1);
-
-#define ASSERT_ARGS_cst_new_stack_chunk __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(chunk)
-#define ASSERT_ARGS_mark_stack __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(chunk)
-#define ASSERT_ARGS_new_stack __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_Parrot_dump_dynamic_environment \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(dynamic_env)
-#define ASSERT_ARGS_Parrot_pop_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_push_action __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub)
-#define ASSERT_ARGS_Parrot_push_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_pop_dest __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_stack_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(stack)
-#define ASSERT_ARGS_stack_height __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(chunk)
-#define ASSERT_ARGS_stack_peek __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(stack_base)
-#define ASSERT_ARGS_stack_pop __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(stack_p)
-#define ASSERT_ARGS_stack_prepare_pop __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(stack_p)
-#define ASSERT_ARGS_stack_prepare_push __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(stack_p)
-#define ASSERT_ARGS_stack_push __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(stack_p) \
-    || PARROT_ASSERT_ARG(thing)
-#define ASSERT_ARGS_stack_system_init __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_get_entry_type __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(entry)
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: src/stacks.c */
-
-#define ERROR_STACK_EMPTY 1
-#define ERROR_STACK_SHALLOW 1
-#define ERROR_BAD_STACK_TYPE 1
-
-#endif /* PARROT_STACKS_H_GUARD */
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Modified: branches/orderedhash_revamp/include/parrot/string_funcs.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/string_funcs.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/string_funcs.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -77,8 +77,7 @@
 
 PARROT_EXPORT
 PARROT_PURE_FUNCTION
-UINTVAL Parrot_str_byte_length(SHIM_INTERP, ARGIN(const STRING *s))
-        __attribute__nonnull__(2);
+UINTVAL Parrot_str_byte_length(SHIM_INTERP, ARGIN_NULLOK(const STRING *s));
 
 PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
@@ -146,14 +145,12 @@
 PARROT_EXPORT
 PARROT_CANNOT_RETURN_NULL
 PARROT_MALLOC
-STRING * Parrot_str_downcase(PARROT_INTERP, ARGIN(const STRING *s))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
+STRING * Parrot_str_downcase(PARROT_INTERP, ARGIN_NULLOK(const STRING *s))
+        __attribute__nonnull__(1);
 
 PARROT_EXPORT
-void Parrot_str_downcase_inplace(PARROT_INTERP, ARGMOD(STRING *s))
+void Parrot_str_downcase_inplace(PARROT_INTERP, ARGMOD_NULLOK(STRING *s))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
         FUNC_MODIFIES(*s);
 
 PARROT_EXPORT
@@ -294,6 +291,17 @@
 
 PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
+PARROT_MALLOC
+PARROT_CANNOT_RETURN_NULL
+STRING * Parrot_str_new_from_buffer(PARROT_INTERP,
+    ARGMOD(Buffer *buffer),
+    const UINTVAL len)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        FUNC_MODIFIES(*buffer);
+
+PARROT_EXPORT
+PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 STRING * Parrot_str_new_init(PARROT_INTERP,
     ARGIN_NULLOK(const char *buffer),
@@ -395,14 +403,12 @@
 PARROT_EXPORT
 PARROT_CANNOT_RETURN_NULL
 PARROT_MALLOC
-STRING * Parrot_str_titlecase(PARROT_INTERP, ARGIN(const STRING *s))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
+STRING * Parrot_str_titlecase(PARROT_INTERP, ARGIN_NULLOK(const STRING *s))
+        __attribute__nonnull__(1);
 
 PARROT_EXPORT
-void Parrot_str_titlecase_inplace(PARROT_INTERP, ARGMOD(STRING *s))
+void Parrot_str_titlecase_inplace(PARROT_INTERP, ARGMOD_NULLOK(STRING *s))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
         FUNC_MODIFIES(*s);
 
 PARROT_EXPORT
@@ -486,6 +492,9 @@
         __attribute__nonnull__(2);
 
 PARROT_EXPORT
+INTVAL STRING_is_null(SHIM_INTERP, ARGIN_NULLOK(const STRING *s));
+
+PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 STRING * string_make(PARROT_INTERP,
@@ -523,27 +532,11 @@
         __attribute__nonnull__(1);
 
 PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-const CHARSET * string_rep_compatible(SHIM_INTERP,
-    ARGIN(const STRING *a),
-    ARGIN(const STRING *b),
-    ARGOUT(const ENCODING **e))
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        FUNC_MODIFIES(*e);
-
-PARROT_EXPORT
 PARROT_MALLOC
 PARROT_CAN_RETURN_NULL
 char * string_to_cstring_nullable(SHIM_INTERP,
     ARGIN_NULLOK(const STRING *s));
 
-void Parrot_str_free(PARROT_INTERP, ARGIN(STRING *s))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 STRING * Parrot_str_from_int_base(PARROT_INTERP,
@@ -565,184 +558,176 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*tc);
 
-#define ASSERT_ARGS_Parrot_str_append __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_bitwise_and __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_bitwise_not __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_bitwise_or __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_bitwise_xor __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_boolean __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_byte_length __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_str_change_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_change_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_chopn __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_str_chopn_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_str_compare __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_compose __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_concat __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_copy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_str_downcase __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_str_downcase_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_str_equal __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_escape __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_escape_truncate __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_find_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_find_index __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s) \
-    || PARROT_ASSERT_ARG(s2)
-#define ASSERT_ARGS_Parrot_str_find_not_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_finish __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_format_data __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(format)
-#define ASSERT_ARGS_Parrot_str_free_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_str_from_int __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_from_num __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_indexed __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_str_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_is_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_str_join __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ar)
-#define ASSERT_ARGS_Parrot_str_length __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_str_new __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_new_constant __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(buffer)
-#define ASSERT_ARGS_Parrot_str_new_COW __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || 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(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 = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_pin __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_str_repeat __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_str_replace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src) \
-    || PARROT_ASSERT_ARG(rep)
-#define ASSERT_ARGS_Parrot_str_resize __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_str_append __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_bitwise_and __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_bitwise_not __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_bitwise_or __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_bitwise_xor __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_boolean __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_byte_length __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_str_change_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_change_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_chopn __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_Parrot_str_chopn_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_Parrot_str_compare __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_compose __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_concat __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_copy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_Parrot_str_downcase __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_downcase_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_equal __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_escape __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_escape_truncate __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_find_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_find_index __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s) \
+    , PARROT_ASSERT_ARG(s2))
+#define ASSERT_ARGS_Parrot_str_find_not_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_finish __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_format_data __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(format))
+#define ASSERT_ARGS_Parrot_str_free_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_str_from_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_from_num __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_indexed __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_Parrot_str_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_is_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_Parrot_str_join __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ar))
+#define ASSERT_ARGS_Parrot_str_length __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_Parrot_str_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_new_constant __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(buffer))
+#define ASSERT_ARGS_Parrot_str_new_COW __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_Parrot_str_new_from_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(buffer))
+#define ASSERT_ARGS_Parrot_str_new_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , 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 = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_pin __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_Parrot_str_repeat __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_Parrot_str_replace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(src) \
+    , PARROT_ASSERT_ARG(rep))
+#define ASSERT_ARGS_Parrot_str_resize __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_str_reuse_COW __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_Parrot_str_reuse_COW __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(s) \
-    || PARROT_ASSERT_ARG(d)
-#define ASSERT_ARGS_Parrot_str_set __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(d))
+#define ASSERT_ARGS_Parrot_str_set __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_Parrot_str_split __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_substr __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_titlecase __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_str_titlecase_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_str_to_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_to_hashval __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_to_int __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_to_num __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_str_unescape __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(cstring)
-#define ASSERT_ARGS_Parrot_str_unpin __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_str_upcase __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_upcase_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_str_write_COW __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_string_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(str)
-#define ASSERT_ARGS_string_capacity __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_string_chr __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_string_increment __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_string_make __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_string_make_from_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_string_max_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_string_ord __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_Parrot_str_split __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_substr __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_titlecase __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_titlecase_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_to_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_to_hashval __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_to_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_to_num __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_Parrot_str_unescape __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(cstring))
+#define ASSERT_ARGS_Parrot_str_unpin __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_Parrot_str_upcase __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_upcase_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_str_write_COW __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_Parrot_string_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(str))
+#define ASSERT_ARGS_string_capacity __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_string_chr __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_string_increment __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_STRING_is_null __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_string_make __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_string_make_from_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_string_max_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_string_ord __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
 #define ASSERT_ARGS_string_primary_encoding_for_representation \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_string_rep_compatible __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(a) \
-    || PARROT_ASSERT_ARG(b) \
-    || PARROT_ASSERT_ARG(e)
-#define ASSERT_ARGS_string_to_cstring_nullable __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_Parrot_str_free __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_Parrot_str_from_int_base __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_string_to_cstring_nullable __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_str_from_int_base __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(tc)
-#define ASSERT_ARGS_Parrot_str_from_uint __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(tc))
+#define ASSERT_ARGS_Parrot_str_from_uint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(tc)
+    , PARROT_ASSERT_ARG(tc))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/string/api.c */
 

Modified: branches/orderedhash_revamp/include/parrot/string_primitives.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/string_primitives.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/string_primitives.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -25,12 +25,6 @@
 PARROT_EXPORT
 PARROT_MALLOC
 PARROT_CANNOT_RETURN_NULL
-char * str_dup(ARGIN(const char *old))
-        __attribute__nonnull__(1);
-
-PARROT_EXPORT
-PARROT_MALLOC
-PARROT_CANNOT_RETURN_NULL
 char * str_dup_remove_quotes(ARGIN(const char *old))
         __attribute__nonnull__(1);
 
@@ -49,18 +43,16 @@
         FUNC_MODIFIES(*offset)
         FUNC_MODIFIES(*string);
 
-#define ASSERT_ARGS_Parrot_char_digit_value __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_str_dup __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(old)
-#define ASSERT_ARGS_str_dup_remove_quotes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(old)
-#define ASSERT_ARGS_string_set_data_directory __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_char_digit_value __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_str_dup_remove_quotes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(old))
+#define ASSERT_ARGS_string_set_data_directory __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(dir)
-#define ASSERT_ARGS_string_unescape_one __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(dir))
+#define ASSERT_ARGS_string_unescape_one __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(offset) \
-    || PARROT_ASSERT_ARG(string)
+    , PARROT_ASSERT_ARG(offset) \
+    , PARROT_ASSERT_ARG(string))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/string/primitives.c */
 

Modified: branches/orderedhash_revamp/include/parrot/sub.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/sub.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/sub.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -21,7 +21,7 @@
  * Subroutine flags
  */
 typedef enum {
-     /* runtime usage flags */
+    /* runtime usage flags */
     SUB_FLAG_CORO_FF      = PObj_private0_FLAG,
     SUB_FLAG_C_HANDLER    = PObj_private0_FLAG, /* C exceptions only */
     SUB_FLAG_TAILCALL     = PObj_private2_FLAG,
@@ -136,37 +136,6 @@
     Parrot_UInt1 named_slurpy;
 } Parrot_sub_arginfo;
 
-
-typedef struct Parrot_sub {
-    PackFile_ByteCode *seg;     /* bytecode segment */
-    size_t   start_offs;        /* sub entry in ops from seg->base.data */
-    size_t   end_offs;
-
-    INTVAL   HLL_id;             /* see src/hll.c XXX or per segment? */
-    PMC      *namespace_name;    /* where this Sub is in - this is either
-                                  * a String or a [Key] and describes
-                                  * the relative path in the NameSpace
-                                  */
-    PMC      *namespace_stash;   /* the actual hash, HLL::namespace */
-    STRING   *name;              /* name of the sub */
-    STRING   *method_name;       /* method name of the sub */
-    STRING   *ns_entry_name;     /* ns entry name of the sub */
-    STRING   *subid;             /* The ID of the sub. */
-    INTVAL   vtable_index;       /* index in Parrot_vtable_slot_names */
-    PMC      *multi_signature;   /* list of types for MMD */
-    INTVAL   n_regs_used[4];     /* INSP in PBC */
-
-    PMC      *lex_info;          /* LexInfo PMC */
-    PMC      *outer_sub;         /* :outer for closures */
-    PMC      *eval_pmc;          /* eval container / NULL */
-    Parrot_Context *ctx;         /* the context this sub is in */
-    UINTVAL  comp_flags;         /* compile time and additional flags */
-    Parrot_sub_arginfo *arg_info;/* Argument counts and flags. */
-
-    /* - end common */
-    struct Parrot_Context *outer_ctx;   /* outer context, if a closure */
-} Parrot_sub;
-
 #define PMC_get_sub(interp, pmc, sub) \
     do { \
         const INTVAL type = (pmc)->vtable->base_type; \
@@ -174,64 +143,18 @@
             type == enum_class_Coroutine || \
             type == enum_class_Eval)  \
         {\
-            GETATTR_Sub_sub((interp), (pmc), (sub)); \
+            (sub) = PARROT_SUB((pmc)); \
         } \
         else { \
-            (sub) = Parrot_get_sub_pmc_from_subclass((interp), (pmc)); \
+            (sub) = (Parrot_Sub_attributes*)Parrot_get_sub_pmc_from_subclass((interp), (pmc)); \
         } \
     } while (0)
 
-/* the first entries must match Parrot_sub, so we can cast
- * these two to the other type
- */
-typedef struct Parrot_coro {
-    PackFile_ByteCode *seg;      /* bytecode segment */
-    size_t   start_offs;         /* sub entry in ops from seg->base.data */
-    size_t   end_offs;
-
-    INTVAL   HLL_id;             /* see src/hll.c XXX or per segment? */
-    PMC      *_namespace;        /* where this Sub is in - this is either
-                                  * a String or a [Key] and describes
-                                  * the relative path in the NameSpace
-                                  */
-    PMC      *namespace_stash;   /* the actual hash, HLL::namespace */
-    STRING   *name;              /* name of the sub */
-    STRING   *method_name;       /* method name of the sub */
-    STRING   *ns_entry_name;     /* ns entry name of the sub */
-    STRING   *subid;             /* The ID of the sub. */
-    INTVAL   vtable_index;       /* index in Parrot_vtable_slot_names */
-    PMC      *multi_signature;   /* list of types for MMD */
-    INTVAL   n_regs_used[4];     /* INSP in PBC */
-
-    PMC      *lex_info;          /* LexInfo PMC */
-    PMC      *outer_sub;         /* :outer for closures */
-    PMC      *eval_pmc;          /* eval container / NULL */
-    struct Parrot_Context  *ctx; /* coroutine context */
-    UINTVAL  comp_flags;         /* compile time and additional flags */
-    Parrot_sub_arginfo arg_info; /* Argument counts and flags. */
-
-    /* - end common */
-
-    PackFile_ByteCode *caller_seg;  /* bytecode segment */
-    opcode_t *address;           /* next address to run - toggled each time */
-    struct Stack_Chunk *dynamic_state; /* next dynamic state */
-} Parrot_coro;
-
-typedef struct Parrot_cont {
-    /* continuation destination */
-    PackFile_ByteCode *seg;          /* bytecode segment */
-    opcode_t *address;               /* start of bytecode, addr to continue */
-    struct Parrot_Context *to_ctx;   /* pointer to dest context */
-    struct Stack_Chunk *dynamic_state; /* dest dynamic state */
-    /* a Continuation keeps the from_ctx alive */
-    struct Parrot_Context *from_ctx; /* sub, this cont is returning from */
-    opcode_t *current_results;       /* ptr into code with get_results opcode
-                                        full continuation only */
-    int runloop_id;                  /* id of the creating runloop. */
-    int invoked;                     /* flag when a handler has been invoked. */
-} Parrot_cont;
+typedef struct Parrot_Sub_attributes Parrot_sub;
+typedef struct Parrot_Coroutine_attributes Parrot_coro;
+typedef struct Parrot_Continuation_attributes Parrot_cont;
 
-#define PMC_cont(pmc) (PARROT_CONTINUATION(pmc)->cont)
+#define PMC_cont(pmc) PARROT_CONTINUATION(pmc)
 
 typedef struct Parrot_Context_info {
     STRING   *subname;
@@ -254,8 +177,14 @@
         __attribute__nonnull__(1);
 
 PARROT_EXPORT
+void Parrot_capture_lex(PARROT_INTERP, ARGMOD(PMC *sub_pmc))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        FUNC_MODIFIES(*sub_pmc);
+
+PARROT_EXPORT
 int Parrot_Context_get_info(PARROT_INTERP,
-    ARGIN(const Parrot_Context *ctx),
+    ARGIN(PMC *ctx),
     ARGOUT(Parrot_Context_info *info))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
@@ -265,8 +194,7 @@
 PARROT_EXPORT
 PARROT_CAN_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
-STRING* Parrot_Context_infostr(PARROT_INTERP,
-    ARGIN(const Parrot_Context *ctx))
+STRING* Parrot_Context_infostr(PARROT_INTERP, ARGIN(PMC *ctx))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
@@ -278,8 +206,7 @@
 
 PARROT_EXPORT
 PARROT_CANNOT_RETURN_NULL
-Parrot_sub * Parrot_get_sub_pmc_from_subclass(PARROT_INTERP,
-    ARGIN(PMC *subclass))
+void * Parrot_get_sub_pmc_from_subclass(PARROT_INTERP, ARGIN(PMC *subclass))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
@@ -295,115 +222,89 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*cont);
 
-void mark_context(PARROT_INTERP, ARGMOD(Parrot_Context* ctx))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(* ctx);
-
 void mark_context_start(void);
-PARROT_MALLOC
-PARROT_CANNOT_RETURN_NULL
-Parrot_sub * new_closure(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-PARROT_MALLOC
-PARROT_CANNOT_RETURN_NULL
-Parrot_cont * new_continuation(PARROT_INTERP,
-    ARGIN_NULLOK(const Parrot_cont *to))
-        __attribute__nonnull__(1);
-
-PARROT_MALLOC
-PARROT_CANNOT_RETURN_NULL
-Parrot_coro * new_coroutine(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-PARROT_MALLOC
-PARROT_CANNOT_RETURN_NULL
-Parrot_cont * new_ret_continuation(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-PARROT_MALLOC
-PARROT_CANNOT_RETURN_NULL
-Parrot_sub * new_sub(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-void Parrot_capture_lex(PARROT_INTERP, ARGMOD(PMC *sub_pmc))
+void Parrot_continuation_check(PARROT_INTERP, ARGIN(const PMC *pmc))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*sub_pmc);
+        __attribute__nonnull__(2);
 
-void Parrot_continuation_check(PARROT_INTERP,
-    ARGIN(const PMC *pmc),
-    ARGIN(const Parrot_cont *cc))
+void Parrot_continuation_rewind_environment(PARROT_INTERP, ARGIN(PMC *pmc))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3);
+        __attribute__nonnull__(2);
 
-void Parrot_continuation_rewind_environment(PARROT_INTERP,
-    SHIM(PMC *pmc),
-    ARGIN(Parrot_cont *cc))
+PARROT_CAN_RETURN_NULL
+PARROT_WARN_UNUSED_RESULT
+PMC* Parrot_find_dynamic_pad(PARROT_INTERP,
+    ARGIN(STRING *lex_name),
+    ARGIN(PMC *ctx))
         __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
         __attribute__nonnull__(3);
 
 PARROT_CAN_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
 PMC* Parrot_find_pad(PARROT_INTERP,
     ARGIN(STRING *lex_name),
-    ARGIN(const Parrot_Context *ctx))
+    ARGIN(PMC *ctx))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         __attribute__nonnull__(3);
 
-#define ASSERT_ARGS_new_ret_continuation_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_Context_get_info __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ctx) \
-    || PARROT_ASSERT_ARG(info)
-#define ASSERT_ARGS_Parrot_Context_infostr __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+PARROT_CANNOT_RETURN_NULL
+STRING * Parrot_Sub_get_filename_from_pc(PARROT_INTERP,
+    ARGIN_NULLOK(PMC *subpmc),
+    ARGIN_NULLOK(opcode_t *pc))
+        __attribute__nonnull__(1);
+
+INTVAL Parrot_Sub_get_line_from_pc(PARROT_INTERP,
+    ARGIN_NULLOK(PMC *subpmc),
+    ARGIN_NULLOK(opcode_t *pc))
+        __attribute__nonnull__(1);
+
+#define ASSERT_ARGS_new_ret_continuation_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_capture_lex __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ctx)
-#define ASSERT_ARGS_Parrot_full_sub_name __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_get_sub_pmc_from_subclass \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(sub_pmc))
+#define ASSERT_ARGS_Parrot_Context_get_info __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(subclass)
-#define ASSERT_ARGS_parrot_new_closure __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(ctx) \
+    , PARROT_ASSERT_ARG(info))
+#define ASSERT_ARGS_Parrot_Context_infostr __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub_pmc)
-#define ASSERT_ARGS_invalidate_retc_context __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_full_sub_name __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_get_sub_pmc_from_subclass \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(cont)
-#define ASSERT_ARGS_mark_context __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(subclass))
+#define ASSERT_ARGS_parrot_new_closure __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ctx)
-#define ASSERT_ARGS_mark_context_start __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_new_closure __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_new_continuation __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_new_coroutine __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_new_ret_continuation __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_new_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_capture_lex __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(sub_pmc))
+#define ASSERT_ARGS_invalidate_retc_context __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub_pmc)
-#define ASSERT_ARGS_Parrot_continuation_check __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(cont))
+#define ASSERT_ARGS_mark_context_start __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_continuation_check __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc) \
-    || PARROT_ASSERT_ARG(cc)
+    , PARROT_ASSERT_ARG(pmc))
 #define ASSERT_ARGS_Parrot_continuation_rewind_environment \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_Parrot_find_dynamic_pad __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(cc)
-#define ASSERT_ARGS_Parrot_find_pad __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(lex_name) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_find_pad __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(lex_name) \
-    || PARROT_ASSERT_ARG(ctx)
+    , PARROT_ASSERT_ARG(lex_name) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_Sub_get_filename_from_pc \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_Sub_get_line_from_pc __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/sub.c */
 

Modified: branches/orderedhash_revamp/include/parrot/thread.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/thread.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/thread.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -256,61 +256,61 @@
         __attribute__nonnull__(3)
         FUNC_MODIFIES(d);
 
-#define ASSERT_ARGS_Parrot_shared_gc_block __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_shared_gc_unblock __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_pt_add_to_interpreters __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_pt_clone_code __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_pt_clone_globals __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_pt_free_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_pt_gc_mark_root_finished __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_pt_gc_start_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_pt_gc_stop_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_pt_join_threads __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_pt_shared_fixup __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_pt_suspend_self_for_gc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_pt_thread_detach __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_pt_thread_join __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(parent)
-#define ASSERT_ARGS_pt_thread_kill __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_pt_thread_prepare_for_run __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_pt_thread_run __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(dest_interp) \
-    || PARROT_ASSERT_ARG(sub)
-#define ASSERT_ARGS_pt_thread_run_1 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(dest_interp) \
-    || PARROT_ASSERT_ARG(sub) \
-    || PARROT_ASSERT_ARG(arg)
-#define ASSERT_ARGS_pt_thread_run_2 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(dest_interp) \
-    || PARROT_ASSERT_ARG(sub) \
-    || PARROT_ASSERT_ARG(arg)
-#define ASSERT_ARGS_pt_thread_run_3 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(dest_interp) \
-    || PARROT_ASSERT_ARG(sub) \
-    || PARROT_ASSERT_ARG(arg)
-#define ASSERT_ARGS_pt_thread_wait_with __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(mutex)
-#define ASSERT_ARGS_pt_thread_yield __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_pt_transfer_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_shared_gc_block __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_shared_gc_unblock __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_pt_add_to_interpreters __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_pt_clone_code __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_pt_clone_globals __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_pt_free_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_pt_gc_mark_root_finished __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_pt_gc_start_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_pt_gc_stop_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_pt_join_threads __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_pt_shared_fixup __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_pt_suspend_self_for_gc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_pt_thread_detach __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_pt_thread_join __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(parent))
+#define ASSERT_ARGS_pt_thread_kill __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_pt_thread_prepare_for_run __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_pt_thread_run __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(dest_interp) \
+    , PARROT_ASSERT_ARG(sub))
+#define ASSERT_ARGS_pt_thread_run_1 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(dest_interp) \
+    , PARROT_ASSERT_ARG(sub) \
+    , PARROT_ASSERT_ARG(arg))
+#define ASSERT_ARGS_pt_thread_run_2 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(dest_interp) \
+    , PARROT_ASSERT_ARG(sub) \
+    , PARROT_ASSERT_ARG(arg))
+#define ASSERT_ARGS_pt_thread_run_3 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(dest_interp) \
+    , PARROT_ASSERT_ARG(sub) \
+    , PARROT_ASSERT_ARG(arg))
+#define ASSERT_ARGS_pt_thread_wait_with __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(mutex))
+#define ASSERT_ARGS_pt_thread_yield __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_pt_transfer_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(d) \
-    || PARROT_ASSERT_ARG(s) \
-    || PARROT_ASSERT_ARG(sub)
+    , PARROT_ASSERT_ARG(s) \
+    , PARROT_ASSERT_ARG(sub))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/thread.c */
 

Modified: branches/orderedhash_revamp/include/parrot/tsq.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/tsq.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/tsq.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -118,42 +118,42 @@
         __attribute__nonnull__(1)
         FUNC_MODIFIES(*queue);
 
-#define ASSERT_ARGS_insert_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_insert_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(queue) \
-    || PARROT_ASSERT_ARG(entry)
-#define ASSERT_ARGS_nosync_insert_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(entry))
+#define ASSERT_ARGS_nosync_insert_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(queue) \
-    || PARROT_ASSERT_ARG(entry)
-#define ASSERT_ARGS_nosync_pop_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(queue)
-#define ASSERT_ARGS_peek_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(queue)
-#define ASSERT_ARGS_pop_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(queue)
-#define ASSERT_ARGS_push_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(entry))
+#define ASSERT_ARGS_nosync_pop_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(queue))
+#define ASSERT_ARGS_peek_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(queue))
+#define ASSERT_ARGS_pop_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(queue))
+#define ASSERT_ARGS_push_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(queue) \
-    || PARROT_ASSERT_ARG(entry)
-#define ASSERT_ARGS_queue_broadcast __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(queue)
-#define ASSERT_ARGS_queue_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(queue)
-#define ASSERT_ARGS_queue_init __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_queue_lock __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(queue)
-#define ASSERT_ARGS_queue_signal __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(queue)
-#define ASSERT_ARGS_queue_timedwait __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(entry))
+#define ASSERT_ARGS_queue_broadcast __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(queue))
+#define ASSERT_ARGS_queue_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(queue))
+#define ASSERT_ARGS_queue_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_queue_lock __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(queue))
+#define ASSERT_ARGS_queue_signal __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(queue))
+#define ASSERT_ARGS_queue_timedwait __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(queue) \
-    || PARROT_ASSERT_ARG(abs_time)
-#define ASSERT_ARGS_queue_unlock __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(queue)
-#define ASSERT_ARGS_queue_wait __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(queue)
-#define ASSERT_ARGS_unshift_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(abs_time))
+#define ASSERT_ARGS_queue_unlock __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(queue))
+#define ASSERT_ARGS_queue_wait __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(queue))
+#define ASSERT_ARGS_unshift_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(queue) \
-    || PARROT_ASSERT_ARG(entry)
-#define ASSERT_ARGS_wait_for_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(queue)
+    , PARROT_ASSERT_ARG(entry))
+#define ASSERT_ARGS_wait_for_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(queue))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/tsq.c */
 

Modified: branches/orderedhash_revamp/include/parrot/vtables.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/vtables.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/vtables.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -32,6 +32,10 @@
         FUNC_MODIFIES(*vtable);
 
 PARROT_EXPORT
+void Parrot_initialize_core_vtables(PARROT_INTERP)
+        __attribute__nonnull__(1);
+
+PARROT_EXPORT
 PARROT_MALLOC
 PARROT_CANNOT_RETURN_NULL
 VTABLE * Parrot_new_vtable(SHIM_INTERP);
@@ -48,21 +52,24 @@
 void parrot_realloc_vtables(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_Parrot_clone_vtable __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_clone_vtable __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(base_vtable)
-#define ASSERT_ARGS_Parrot_destroy_vtable __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(base_vtable))
+#define ASSERT_ARGS_Parrot_destroy_vtable __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(vtable)
-#define ASSERT_ARGS_Parrot_new_vtable __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_mark_vtables __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_parrot_alloc_vtables __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_parrot_free_vtables __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_parrot_realloc_vtables __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+    , PARROT_ASSERT_ARG(vtable))
+#define ASSERT_ARGS_Parrot_initialize_core_vtables \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_new_vtable __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_mark_vtables __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_parrot_alloc_vtables __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_parrot_free_vtables __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_parrot_realloc_vtables __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/vtables.c */
 

Modified: branches/orderedhash_revamp/include/parrot/warnings.h
==============================================================================
--- branches/orderedhash_revamp/include/parrot/warnings.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/include/parrot/warnings.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -35,19 +35,13 @@
 
 /* &end_gen */
 
-#define PARROT_WARNINGS_on(interp, flag) do { \
-    CONTEXT((interp))->warns |= (flag); } while (0)
-#define PARROT_WARNINGS_off(interp, flag) do { \
-    CONTEXT((interp))->warns &= ~(flag); } while (0)
-#define PARROT_WARNINGS_test(interp, flag)  \
-    (CONTEXT((interp))->warns & (flag))
-
-#define PARROT_ERRORS_on(interp, flag) do { \
-    CONTEXT((interp))->errors |= (flag); } while (0)
-#define PARROT_ERRORS_off(interp, flag) do { \
-    CONTEXT((interp))->errors &= ~(flag); } while (0)
-#define PARROT_ERRORS_test(interp, flag)  \
-    (CONTEXT((interp))->errors & (flag))
+#define PARROT_WARNINGS_on(interp, flag)   Parrot_pcc_warnings_on((interp), (interp)->ctx, (flag))
+#define PARROT_WARNINGS_off(interp, flag)  Parrot_pcc_warnings_off((interp), (interp)->ctx, (flag))
+#define PARROT_WARNINGS_test(interp, flag) Parrot_pcc_warnings_test((interp), (interp)->ctx, (flag))
+
+#define PARROT_ERRORS_on(interp, flag)   Parrot_pcc_errors_on((interp), (interp)->ctx, (flag))
+#define PARROT_ERRORS_off(interp, flag)  Parrot_pcc_errors_off((interp), (interp)->ctx, (flag))
+#define PARROT_ERRORS_test(interp, flag) Parrot_pcc_errors_test((interp), (interp)->ctx, (flag))
 
 #if defined(PARROT_IN_CORE)
 
@@ -70,11 +64,11 @@
 void print_pbc_location(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_Parrot_warn __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_warn __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(message)
-#define ASSERT_ARGS_print_pbc_location __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+    , PARROT_ASSERT_ARG(message))
+#define ASSERT_ARGS_print_pbc_location __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/warnings.c */
 

Added: branches/orderedhash_revamp/include/pmc/dummy
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/include/pmc/dummy	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1 @@
+Dummy file to keep directory.

Modified: branches/orderedhash_revamp/lib/IO/CaptureOutput.pm
==============================================================================
--- branches/orderedhash_revamp/lib/IO/CaptureOutput.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/IO/CaptureOutput.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -8,6 +8,16 @@
 %EXPORT_TAGS = (all => \@EXPORT_OK);
 $VERSION = '1.06';
 
+=head1 NAME
+
+IO::CaptureOutput - capture STDOUT and STDERR from Perl code, subprocesses or XS
+
+=head1 DESCRIPTION
+
+Included from CPAN.  Thanks to David Golden for reviving this useful module.
+
+=cut
+
 sub capture (&@) { ## no critic
     my ($code, $output, $error) = @_;
     for ($output, $error) {

Modified: branches/orderedhash_revamp/lib/Parrot/Configure/Options/Conf.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Configure/Options/Conf.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Configure/Options/Conf.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -94,9 +94,8 @@
    --cgoto=0            Don't build cgoto core - recommended when short of mem
    --jitcapable         Use JIT
    --execcapable        Use JIT to emit a native executable
-   --gc=(type)          Determine the type of garbage collection
-                        type=(gc|libc|malloc|malloc-trace) default is gc
    --without-threads    Build parrot without thread support
+   --buildframes        Dynamically build NCI call frames
 
 External Library Options:
 

Modified: branches/orderedhash_revamp/lib/Parrot/Configure/Options/Conf/Shared.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Configure/Options/Conf/Shared.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Configure/Options/Conf/Shared.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -18,6 +18,8 @@
     cgoto
     configure_trace
     cxx
+    darwin_no_fink
+    darwin_no_macports
     datadir
     debugging
     define
@@ -27,7 +29,6 @@
     fatal
     fatal-step
     floatval
-    gc
     help
     icu-config
     icuheaders
@@ -37,6 +38,7 @@
     inline
     intval
     jitcapable
+    buildframes
     languages
     ld
     ldflags

Modified: branches/orderedhash_revamp/lib/Parrot/Configure/Options/Test.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Configure/Options/Test.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Configure/Options/Test.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -43,10 +43,6 @@
     for my $k (grep { ! $excluded_options{$_} } keys %{$argsref}) {
         $self->set($k, $argsref->{$k});
     }
-    my $sto = '.configure_parallel.sto';
-    if (-e $sto) {
-        unlink $sto or die "Unable to unlink $sto: $!";
-    }
     return $self;
 }
 

Modified: branches/orderedhash_revamp/lib/Parrot/Configure/Options/Test/Prepare.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Configure/Options/Test/Prepare.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Configure/Options/Test/Prepare.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -29,11 +29,12 @@
 );
 
 sub get_preconfiguration_tests {
-    return ( @framework_tests, @steps_tests );
+    return ( @framework_tests );
 };
 
 sub get_postconfiguration_tests {
     my @postconfiguration_tests = (
+        @steps_tests,
         glob("t/postconfigure/*.t"),
         glob("t/tools/pmc2cutils/*.t"),
         glob("t/tools/ops2cutils/*.t"),

Modified: branches/orderedhash_revamp/lib/Parrot/Configure/Step/List.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Configure/Step/List.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Configure/Step/List.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -20,8 +20,6 @@
     auto::gcc
     auto::glibc
     auto::backtrace
-    auto::fink
-    auto::macports
     auto::msvc
     auto::attributes
     auto::warnings
@@ -42,8 +40,8 @@
     auto::isreg
     auto::arch
     auto::jit
+    auto::frames
     auto::cpu
-    auto::funcptr
     auto::cgoto
     auto::inline
     auto::gc

Modified: branches/orderedhash_revamp/lib/Parrot/Configure/Step/Methods.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Configure/Step/Methods.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Configure/Step/Methods.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -27,72 +27,6 @@
 
 =head1 METHODS
 
-=head2 C<_handle_darwin_for_fink()>
-
-    $self->_handle_darwin_for_fink($conf, $libs, $osname, $file);
-
-Currently used in configuration step classes auto::gmp, auto::readline and
-auto::gdbm.
-
-Modifies settings for C<linkflags>, C<ldflags> and C<ccflags> in the
-Parrot::Configure object's data structure.
-
-=cut
-
-sub _handle_darwin_for_fink {
-    my ($self, $conf, $osname, $file) = @_;
-    if ( $osname =~ /darwin/ ) {
-        my $fink_lib_dir        = $conf->data->get('fink_lib_dir');
-        my $fink_include_dir    = $conf->data->get('fink_include_dir');
-        if ( (defined $fink_lib_dir) && (defined $fink_include_dir) ) {
-            if ( -f "$fink_include_dir/$file" ) {
-                my %intended = (
-                    linkflags => "-L$fink_lib_dir",
-                    ldflags   => "-L$fink_lib_dir",
-                    ccflags   => "-I$fink_include_dir",
-                );
-                _add_flags_not_yet_seen($conf, \%intended);
-            }
-        }
-    }
-    return 1;
-}
-
-=head2 C<_handle_darwin_for_macports()>
-
-    $self->_handle_darwin_for_macports($conf, $libs, $osname, $file);
-
-Currently used in configuration step classes auto::gmp, auto::readline and
-auto::opengl.
-
-Modifies settings for C<linkflags>, C<ldflags> and C<ccflags> in the
-Parrot::Configure object's data structure.
-
-Potentially expandable to cover all BSD-ports systems -- but as yet there has
-been no demand.
-
-=cut
-
-sub _handle_darwin_for_macports {
-    my ($self, $conf, $osname, $file) = @_;
-    if ( $osname =~ /darwin/ ) {
-#        my $ports_root          = $conf->data->get( 'ports_base_dir' );
-        my $ports_lib_dir       = $conf->data->get( 'ports_lib_dir' );
-        my $ports_include_dir   = $conf->data->get( 'ports_include_dir' );
-        if ( defined $ports_lib_dir && defined $ports_include_dir ) {
-            if ( -f qq{$ports_include_dir/$file} ) {
-                my %intended = (
-                    linkflags => "-L$ports_lib_dir",
-                    ldflags   => "-L$ports_lib_dir",
-                    ccflags   => "-I$ports_include_dir",
-                );
-                _add_flags_not_yet_seen($conf, \%intended);
-            }
-        }
-    }
-    return 1;
-}
-
 =head2 C<_select_lib()>
 
     $self->_select_lib( {
@@ -201,18 +135,6 @@
     return $libs;
 }
 
-sub _add_flags_not_yet_seen {
-    my ($conf, $intended) = @_;
-    foreach my $flag (keys %{ $intended }) {
-        my $flagstr = $conf->data->get($flag);
-        my @elements = split /\s+/, $flagstr;
-        my %seen = map {$_, 1} @elements;
-        $conf->data->add( ' ', $flag => $intended->{$flag} )
-            unless $seen{$intended->{$flag}};
-    }
-}
-
-
 =head1 SEE ALSO
 
 Parrot::Configure::Step.

Added: branches/orderedhash_revamp/lib/Parrot/Configure/Step/Test.pm
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/lib/Parrot/Configure/Step/Test.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,174 @@
+# Copyright (C) 2001-2009, Parrot Foundation.
+# $Id$
+
+package Parrot::Configure::Step::Test;
+
+use strict;
+use warnings;
+use lib qw( lib );
+our @ISA = qw( Parrot::Configure );
+use Parrot::Config;
+use Parrot::Configure::Data;
+
+=head1 NAME
+
+Parrot::Configure::Step::Test - Populate Parrot::Configure object with results of configuration
+
+=head1 SYNOPSIS
+
+    use Parrot::Configure::Step::Test;
+
+    $conf = Parrot::Configure::Step::Test->new;
+    $conf->include_config_results( $args );
+
+Methods below are inherited from Parrot::Configure:
+
+    $conf->add_steps( 'some_package' );
+    $serialized = $conf->pcfreeze();
+    $conf->options->set( %options );
+    $conf->runsteps();
+    $conf->replenish($serialized);
+
+=head1 DESCRIPTION
+
+This module is a close simulation of Parrot::Configure to be used for testing
+of individual configuration steps once F<Configure.pl> has run.  Its
+constructor is structured in the same way as C<Parrot::Configure::new()> --
+the Parrot::Configure constructor -- and inherits all Parrot::Configure
+methods.  It adds just one method:
+C<Parrot::Configure::Step::Test::include_config_results()>.  This method
+populates the C<data> section of the Parrot::Configure object's data structure
+with the results of Parrot configuration, I<i.e.,> C<%PConfig> from
+Parrot::Config (F<lib/Parrot/Config.pm>).
+
+=head2 Rationale
+
+I<You may skip this section on first reading.>
+
+Consider these questions:
+
+=over 4
+
+=item 1
+
+Why test a Parrot configuration step after that step has already been run by
+F<Configure.pl>?
+
+=item 2
+
+If F<Configure.pl> has completed successfully, doesn't that, in some sense,
+I<prove> that the code in the configuration step class was correct?  If so,
+why bother to test it at all?
+
+=item 3
+
+Conversely, wouldn't it make more sense to test a configuration step I<before>
+that step has been run by F<Configure.pl>?
+
+=back
+
+Parrot developers have debated these questions for years.  Between mid-2007
+and late-2009, the position reflected in our testing practices was that found
+in Question 3 above.  We included tests of the configuration steps in the set
+of I<preconfiguration tests> run when you called:
+
+    perl Configure.pl --test=configure
+
+The primary reason for taking this approach was the conviction that the
+B<building blocks> of the Parrot configuration process ought to be tested
+before that whole process is executed.
+
+It should be noted that at the point in time when this approach was
+implemented, there was B<no testing of the configuration step classes
+whatsoever>.  Previously, it was just assumed that if F<Configure.pl> completed
+successfully, the code in the various configuration step classes did not need
+more fine-grained testing.
+
+So, B<some> testing of the Parrot configuration steps was clearly an
+improvement over B<no> testing of those steps.
+
+Nonetheless, there were limits to how well we could apply standard testing
+practices to the Parrot configuration step classes.  The following factors
+delimited what we could do:
+
+=over 4
+
+=item *
+
+TK
+
+=back
+
+=head1 METHODS
+
+=head2 C<new()>
+
+Constructor, structured the same way as that of Parrot::Configure.
+
+See F<lib/Parrot/Configure.pm>.
+
+=cut
+
+my $singleton;
+
+BEGIN {
+    $singleton = {
+        steps   => [],
+        data    => Parrot::Configure::Data->new,
+        options => Parrot::Configure::Data->new,
+    };
+    bless $singleton, 'Parrot::Configure::Step::Test';
+}
+
+sub new {
+    my $class = shift;
+    return $singleton;
+}
+
+=head2 C<include_config_results()>
+
+B<Purpose:>  Populate the Parrot::Configure object with the results of Parrot
+configuration as recorded in C<%Parrot::Config::PConfig>.
+
+B<Arguments:>  One argument: Hash-reference which is the first return value of
+Parrot::Configure::Options::process_options();
+
+    ($args, $step_list_ref) = process_options( {
+        argv => [ ],
+        mode => q{configure},
+    } );
+
+    $conf = Parrot::Configure::Step::Test->new;
+
+    $conf->include_config_results( $args );
+
+B<Return Value:>  None.
+
+=cut
+
+sub include_config_results {
+    my ($conf, $args) = @_;
+    while ( my ($k, $v) = each %PConfig ) {
+        $conf->data->set( $k => $v );
+    }
+    $conf->options->set( %{$args} );
+}
+
+=head1 AUTHOR
+
+James E Keenan C<jkeenan at cpan.org>
+
+=head1 SEE ALSO
+
+L<Parrot::Configure>.
+
+=cut
+
+1;
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/lib/Parrot/Configure/Trace.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Configure/Trace.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Configure/Trace.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -88,24 +88,23 @@
 sub diff_data_c {
     my ( $self, $argsref ) = @_;
     $argsref->{verbose} = 1;
-    my $trace_ref = $self->trace_data_c($argsref);
-    my @traces = @{ $trace_ref };
+    my @traces = @{ $self->trace_data_c($argsref) };
     my @results = ();
     for (my $i = 1; $i < scalar(@traces); $i++) {
         my %prior = %{$traces[$i - 1]};
         my %this  = %{$traces[$i]};
         my ($prior_key, $prior_value)   = each %prior;
-            my ($this_key,  $this_value)    = each %this;
-            $prior_value = q{} unless defined $prior_value;
-            $this_value = q{} unless defined $this_value;
-            if ($prior_value ne $this_value) {
-                push @results, {
-                    number  => $i,
-                    name    => $this_key,
-                    before  => $prior_value,
-                    after   => $this_value,
-                };
-            }
+        my ($this_key,  $this_value)    = each %this;
+        $prior_value = q{} unless defined $prior_value;
+        $this_value  = q{} unless defined $this_value;
+        if ($prior_value ne $this_value) {
+            push @results, {
+                number  => $i,
+                name    => $this_key,
+                before  => $prior_value,
+                after   => $this_value,
+            };
+        }
     }
     return \@results;
 }
@@ -202,7 +201,7 @@
 
 To make use of Parrot::Configure::Trace's methods, first configure with the
 C<--configure_trace> option.  As configuration proceeds through what are
-currently 56 individual steps, the state of the Parrot::Configuration object
+currently 65 individual steps, the state of the Parrot::Configuration object
 is recorded in a Perl array reference.  That array ref is stored on disk via
 the Storable module in a file called F<.configure_trace.sto> found in the
 top-level of your Parrot sandbox directory.
@@ -403,7 +402,7 @@
 
 Provide a list of those configuration steps where the value of a given
 attribute in the C<{data}->{c}> part of the Parrot::Configure object changed
-from that in effect at the conclusion of the preveious configuration step.
+from that in effect at the conclusion of the previous configuration step.
 
 =item * Arguments
 
@@ -422,8 +421,8 @@
 
 =item * number
 
-Number of the configuration step where the value of the given attribute
-changed; enumeration starts at C<1>, not C<0>.
+Index position of the configuration step where the value of the given attribute
+changed.  Example:  C<init::defaults> has index position C<1>.
 
 =item * name
 

Modified: branches/orderedhash_revamp/lib/Parrot/Distribution.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Distribution.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Distribution.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -382,8 +382,6 @@
     }
 
     return @c_language_files;
-
-    # RT #50046: pir_source_files() fails to collect PIR .t files.
 }
 
 =item C<is_c_exemption()>
@@ -507,7 +505,6 @@
         compilers/nqp/
         compilers/ncigen/src/parser/actions.pm
         examples/sdl/
-        examples/languages/abc/src/parser/actions.pm
         examples/languages/squaak/src/parser/actions.pm
         lib/Digest/Perl/
         lib/File/
@@ -568,6 +565,7 @@
     # make sure we're picking up pir files (i.e. look for the shebang line)
     my @pir_files;
     for my $file ( $self->pir_source_files ) {
+        next if $self->is_pir_exemption($file);
         push @pir_files, $file
             if $self->is_pir( $file->path );
     }
@@ -575,6 +573,21 @@
     return @pir_files;
 }
 
+=item C<is_pir_exemption()>
+
+Determines if the given filename is an exemption to being in the PIR source.
+This is to exclude automatically generated PIR-language files Parrot might have.
+
+=cut
+
+{
+    sub is_pir_exemption {
+        my ( $self, $file ) = @_;
+        $file->path =~ m{/ext/};
+    }
+}
+
+
 =item C<is_pir()>
 
 Determines if the given filename is PIR source

Modified: branches/orderedhash_revamp/lib/Parrot/Docs/File.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Docs/File.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Docs/File.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -311,7 +311,7 @@
 sub is_docs_link {
     my $self = shift;
 
-    # RT#43681 - This needs more thought. I'm trying to work out which files
+    # TT #1241 - This needs more thought. I'm trying to work out which files
     # it's sensible to link directly to. Suffixes other than txt are a
     # problem (for me at least) because the browser thinks it should
     # download the file.

Modified: branches/orderedhash_revamp/lib/Parrot/Docs/Section/C.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Docs/Section/C.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Docs/Section/C.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -229,11 +229,6 @@
             $self->c_pair_item( '', 'memory' ),
             $self->c_source_item( '', 'malloc' ),
             $self->c_source_item( '', 'malloc-trace' ),
-            $self->c_item(
-                '',
-                'pairs'   => ['resources'],
-                'sources' => ['res_lea']
-            ),
             $self->c_source_item( '', 'mark_sweep' ),
         ),
         $self->new_group(

Modified: branches/orderedhash_revamp/lib/Parrot/Docs/Section/Developer.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Docs/Section/Developer.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Docs/Section/Developer.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, Parrot Foundation.
+# Copyright (C) 2004-2009, Parrot Foundation.
 # $Id$
 
 =head1 NAME
@@ -45,10 +45,8 @@
             $self->new_item( 'Bytecode Format (PBC)', 'docs/parrotbyte.pod'),
             $self->new_item( 'Bytecode Packfile API', 'docs/packfile-c.pod'),
             $self->new_item( 'Memory Internals', 'docs/memory_internals.pod'),
-            $self->new_item( 'Just In Time Compilation', 'docs/jit.pod'),
             $self->new_item( 'PMC Vtables', 'docs/vtables.pod'),
             $self->new_item( 'Embedding Parrot', 'docs/embed.pod'),
-            $self->new_item( '', 'docs/native_exec.pod' ),
             $self->new_item( '', 'docs/porting_intro.pod' ),
         ),
         $self->new_group( 'Development Notes',     '', 'docs/dev',

Modified: branches/orderedhash_revamp/lib/Parrot/Docs/Section/Parrot.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Docs/Section/Parrot.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Docs/Section/Parrot.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -60,7 +60,7 @@
             'Introduction',
             '',
             $self->new_item( 'Introduction to Parrot', 'docs/intro.pod'),
-            $self->new_item( 'Getting Started', 'docs/book/draft/ch02_getting_started.pod'),
+            $self->new_item( 'Getting Started', 'docs/book/pct/ch02_getting_started.pod'),
             $self->new_item( 'Navigating the Docs', 'docs/parrot.pod'),
             $self->new_item( 'Roles & Responsibilities', 'docs/project/roles_responsibilities.pod'),
             $self->new_item( 'Release History', 'docs/parrothist.pod'),
@@ -80,9 +80,9 @@
         $self->new_group(
             'Implementing Languages on Parrot',
             '',
-            $self->new_item( 'Parrot Compiler Tools', 'docs/book/draft/ch04_compiler_tools.pod'),
-            $self->new_item( 'Parrot Grammar Engine', 'docs/book/draft/ch05_pge.pod'),
-            $self->new_item( 'Not Quite Perl', 'docs/book/draft/ch06_nqp.pod'),
+            $self->new_item( 'Parrot Compiler Tools', 'docs/book/pct/ch03_compiler_tools.pod'),
+            $self->new_item( 'Parrot Grammar Engine', 'docs/book/pct/ch04_pge.pod'),
+            $self->new_item( 'Not Quite Perl', 'docs/book/pct/ch05_nqp.pod'),
             $self->new_item( 'Compiler FAQ', 'docs/compiler_faq.pod'),
         ),
         $self->new_group(
@@ -96,29 +96,9 @@
             Parrot::Docs::Section::Tools->new,
             $self->new_item( 'Syntax Highlighting for Vim & Emacs', 'editor/README.pod'),
         ),
-        $self->new_group(
-            'Book draft',
-            '',
-            $self->new_item( 'Chapter 1 Introduction', 'docs/book/draft/ch01_introduction.pod'),
-            $self->new_item( 'Chapter 2 Getting Started', 'docs/book/draft/ch02_getting_started.pod'),
-            $self->new_item( 'Chapter 3 Parrot Intermediate Representation', 'docs/book/draft/ch03_pir.pod'),
-            $self->new_item( 'Chapter 4 Parrot Compiler Tools', 'docs/book/draft/ch04_compiler_tools.pod'),
-            $self->new_item( 'Chapter 5 Parrot Grammar Engine', 'docs/book/draft/ch05_pge.pod'),
-            $self->new_item( 'Chapter 6 Not Quite Perl', 'docs/book/draft/ch06_nqp.pod'),
-            $self->new_item( 'Chapter 7 Dynamic C-level Objects', 'docs/book/draft/ch07_dynpmcs.pod'),
-            $self->new_item( 'Chapter 8 Dynamic Opcodes', 'docs/book/draft/ch08_dynops.pod'),
-            $self->new_item( 'Chapter 10 Instruction Reference', 'docs/book/draft/ch10_opcode_reference.pod'),
-            $self->new_item( 'Chapter 11 Directive Reference', 'docs/book/draft/ch11_directive_reference.pod'),
-            $self->new_item( 'Chapter 12 PIR Operator Reference', 'docs/book/draft/ch12_operator_reference.pod'),
-            $self->new_item( 'Appendix A Glossary', 'docs/book/draft/appa_glossary.pod'),
-            $self->new_item( 'Appendix B Patch Submission', 'docs/book/draft/appb_patch_submission.pod'),
-            $self->new_item( 'Appendix C ', 'docs/book/draft/appc_command_line_options.pod'),
-            $self->new_item( 'Appendix D ', 'docs/book/draft/appd_build_options.pod'),
-            $self->new_item( 'Appendix E ', 'docs/book/draft/appe_source_code.pod'),
-        ),
 
         $self->new_group(
-            'Book PIR',
+            'PIR Book',
             '',
             $self->new_item( 'Chapter 1 Introduction', 'docs/book/pir/ch01_introduction.pod'),
             $self->new_item( 'Chapter 2 Getting Started', 'docs/book/pir/ch02_getting_started.pod'),
@@ -131,6 +111,16 @@
             $self->new_item( 'Chapter 9 Exceptions', 'docs/book/pir/ch09_exceptions.pod'),
         ),
 
+        $self->new_group(
+            'PCT Book',
+            '',
+            $self->new_item( 'Chapter 1 Introduction', 'docs/book/pct/ch01_introduction.pod'),
+            $self->new_item( 'Chapter 2 Getting Started', 'docs/book/pct/ch02_getting_started.pod'),
+            $self->new_item( 'Chapter 3 Compiler Tools', 'docs/book/pct/ch03_compiler_tools.pod'),
+            $self->new_item( 'Chapter 4 Grammar Engine', 'docs/book/pct/ch04_pge.pod'),
+            $self->new_item( 'Chapter 5 Grammar Actions', 'docs/book/pct/ch05_nqp.pod'),
+        ),
+
 #        Parrot::Docs::Section::C->new,
 #        Parrot::Docs::Section::IMCC->new,
 #        Parrot::Docs::Section::Perl->new,

Modified: branches/orderedhash_revamp/lib/Parrot/Docs/Section/Tools.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Docs/Section/Tools.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Docs/Section/Tools.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,4 +1,4 @@
-# Copyright (C) 2006-2008, Parrot Foundation.
+# Copyright (C) 2006-2009, Parrot Foundation.
 # $Id$
 
 =head1 NAME
@@ -47,7 +47,6 @@
             $self->new_item( '', 'tools/dev/as2c.pl' ),
             $self->new_item( '', 'tools/dev/cc_flags.pl' ),
             $self->new_item( '', 'tools/build/nativecall.pl' ),
-            $self->new_item( '', 'tools/build/jit2c.pl' ),
             $self->new_item( '', 'tools/build/vtable_h.pl' ),
             $self->new_item( '', 'tools/build/vtable_extend.pl' ),
         ),

Modified: branches/orderedhash_revamp/lib/Parrot/Harness/DefaultTests.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Harness/DefaultTests.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Harness/DefaultTests.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -7,19 +7,32 @@
 
 =head1 DESCRIPTION
 
-This file exports by default a single subroutine, C<get_default_tests()>,
-which is the list of tests run by F<t/harness> by default.
-
-Upon request, this package exports five arrays holding various sets of tests:
+Upon request, this package exports six arrays holding various sets of paths to
+directories holding test files:
 
     @runcore_tests
     @core_tests
+    @library_tests
     @configure_tests
-    @standard_tests
     @developing_tests
 
-In list context, C<get_default_tests()> returns the list of default tests.  In
-scalar context it returns a reference to that list.
+Each of these arrays holds a list of paths containing wildcards which are
+expanded by the shell when provided to programs such as F<t/harness>.  The
+paths describe directories holding test files.
+
+Example:
+
+    @core_tests = qw(
+        t/run/*.t
+        t/src/*.t
+        t/perl/*.t
+    );
+
+
+In addition, Parrot::Harness::Default Tests exports B<by default> one
+subroutine:  C<get_default_tests()>.  In list context, C<get_default_tests()>
+returns a list of shell-expandable paths to the most common tests.  In scalar
+context it returns a reference to that list.
 
 =cut
 
@@ -31,17 +44,17 @@
 our (
     @runcore_tests,
     @core_tests,
+    @library_tests,
     @configure_tests,
-    @standard_tests,
     @developing_tests
 );
 use base qw( Exporter );
-our @EXPORT = qw( get_default_tests );
+our @EXPORT = qw( get_common_tests );
 our @EXPORT_OK = qw(
     @runcore_tests
     @core_tests
+    @library_tests
     @configure_tests
-    @standard_tests
     @developing_tests
 );
 
@@ -54,12 +67,6 @@
     t/native_pbc/*.t
     t/dynpmc/*.t
     t/dynoplibs/*.t
-    t/compilers/pct/*.t
-    t/compilers/pge/*.t
-    t/compilers/pge/p5regex/*.t
-    t/compilers/pge/perl6regex/*.t
-    t/compilers/tge/*.t
-    t/library/*.t
 );
 
 # core tests are run unless --runcore-tests is present.  Typically
@@ -67,52 +74,42 @@
 @core_tests = qw(
     t/run/*.t
     t/src/*.t
-    t/tools/*.t
     t/perl/*.t
-    t/stm/*.t
+);
+
+# library tests are run unless --runcore-tests or --core-tests is present.
+ at library_tests = qw(
+    t/compilers/pct/*.t
+    t/compilers/pge/*.t
+    t/compilers/pge/p5regex/*.t
+    t/compilers/pge/perl6regex/*.t
+    t/compilers/tge/*.t
+    t/library/*.t
+    t/tools/*.t
 );
 
 # configure tests are tests to be run at the beginning of 'make test';
-# standard tests are other tests run by default with no core options
-# present
 @configure_tests = qw( t/configure/*.t t/steps/*.t t/postconfigure/*.t );
- at standard_tests = qw(
-    t/compilers/json/*.t
-    t/examples/*.t
-    t/doc/*.t
-    t/distro/manifest.t
-);
-
- at developing_tests = ( 't/distro/file_metadata.t' );
-# Add in all t/codingstd except for a few skips.
-push @developing_tests, glob 't/codingstd/*.t';
-
-sub get_default_tests {
-    my ($core_tests_only, $runcore_tests_only) = @_;
-
-    # Add metadata.t and coding standards tests only if we're DEVELOPING
-
-    # Note:  As of 2008-10-21, we're no longer including @standard_tests in
-    # @default_tests -- which means they're not included in 'make test'.
-    # But, for the time being, at least, we are still making
-    # it an exportable variable.  So we'll test for it in
-    # t/pharness/01-default_tests.t.
 
-    if ( -e "DEVELOPING" ) {
-        push @standard_tests, @developing_tests;
-    }
+ at developing_tests = (
+    't/distro/file_metadata.t',
+    ( glob 't/codingstd/*.t' ),
+);
+
+sub get_common_tests {
+    my ($longopts) = @_;
 
-    # build the list of default tests
-    my @default_tests = @runcore_tests;
-    unless ($runcore_tests_only) {
-       push @default_tests, @core_tests;
-       unless ($core_tests_only) {
-           unshift @default_tests, @configure_tests;
+    my @common_tests = @runcore_tests;
+    unless ($longopts->{runcore_tests_only}) {
+       push @common_tests, @core_tests;
+       unless ($longopts->{core_tests_only}) {
+           push @common_tests, @library_tests;
+           unshift @common_tests, @configure_tests;
        }
     }
     wantarray
-        ? return @default_tests
-        : return [ @default_tests ];
+        ? return @common_tests
+        : return [ @common_tests ];
 }
 
 1;

Modified: branches/orderedhash_revamp/lib/Parrot/Harness/Options.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Harness/Options.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Harness/Options.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,4 +1,4 @@
-# Copyright (C) 2006-2008, Parrot Foundation.
+# Copyright (C) 2006-2009, Parrot Foundation.
 # $Id$
 
 =head1 NAME
@@ -7,6 +7,8 @@
 
 =head1 DESCRIPTION
 
+This package exports subroutines on request only.  The subroutines are useful
+in providing command-line options to Parrot's F<t/harness>.
 
 =cut
 
@@ -88,8 +90,9 @@
     my ($opts_ref) = @_;
 
     my %remap      = (
-        'j' => '-runcore=jit',
+        'j' => '-runcore=fast',
         'g' => '-runcore=cgoto',
+        'G' => '-runcore=gcdebug',
         'C' => '-runcore=cgp',
         'S' => '-runcore=switch',
         'b' => '-runcore=bounds',
@@ -114,12 +117,13 @@
 perl t/harness [options] [testfiles]
     -w         ... warnings on
     -g         ... run CGoto
-    -j         ... run JIT
     -C         ... run CGP
     -S         ... run Switched
     -b         ... run bounds checked
     --run-exec ... run exec core
     -f         ... run fast core
+    -j         ... run fast core
+    -r         ... run the compiled pbc
     -v         ... run parrot with -v : This is NOT the same as prove -v
                    All tests run with this option will probably fail
     -d         ... run debug

Modified: branches/orderedhash_revamp/lib/Parrot/Harness/Smoke.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Harness/Smoke.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Harness/Smoke.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -113,7 +113,7 @@
     my $report_file  = delete $test_env_data{report_file} || $SMOLDER_CONFIG{report_file};
     my $url
         =   $SMOLDER_CONFIG{server}
-          . '/app/developer_projects/process_add_report/'
+          . '/app/projects/process_add_report/'
           . $project_id;
     my $ua = LWP::UserAgent->new();
     $ua->agent( 'Parrot::Harness::Smoke' );
@@ -137,10 +137,10 @@
 
     if ($response->code == 302) {
         my ($report_id) = $response->content =~ /Reported #(\d+) added/i;
-        my $report_url = "$SMOLDER_CONFIG{server}/app/public_projects/report_details/$report_id";
+        my $report_url = "$SMOLDER_CONFIG{server}/app/projects/report_details/$report_id";
         my $project_url
             =   $SMOLDER_CONFIG{server}
-              . '/app/public_projects/smoke_reports/'
+              . '/app/projects/smoke_reports/'
               . $project_id;
         print "Test report successfully sent to Smolder at\n$report_url"
             . "\nYou can see other recent reports at\n$project_url .\n\n";
@@ -169,7 +169,7 @@
             $devel .= (" ". at mods." mods");
         }
         my $info = `svn info .`;
-        ($branch) = $info =~ m{URL: .+/parrot/(\w+)$}m;
+        ($branch) = $info =~ m{URL: .+/parrot/(?:branches/)?(\w+)$}m;
     }
     my $me = $^O eq 'MSWin32' ? $ENV{'USERNAME'}
            : $ENV{'LOGNAME'} || eval { getpwuid($<) };

Modified: branches/orderedhash_revamp/lib/Parrot/Manifest.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Manifest.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Manifest.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -22,6 +22,12 @@
     $print_str     = $mani->prepare_gitignore();
     $mani->print_gitignore($print_str) if $need_for_skip;
 
+=head1 DESCRIPTION
+
+This package exports no functions.  A Parrot::Manifest object is used in
+F<tools/dev/mk_manifest_and_skip.pl>, which in turn is the basis of C<make
+manifest_tests>.
+
 =cut
 
 package Parrot::Manifest;
@@ -223,12 +229,10 @@
         $loc =
               exists( $special->{$_} ) ? $special->{$_}
             : !m[/]                           ? '[]'
-            : m[README]                       ? '[]doc'
-            : m[^docs/user/]                  ? '[main]doc'
-            : m[^docs/ops/]                   ? '[main]doc'
-            : m[^docs/pmc/]                   ? '[main]doc'
-            : m[^docs/pct/]                   ? '[pct]doc'
+            : m[^docs/book/draft/]            ? '[]'
+            : m[^docs/]                       ? '[doc]'
             : m[^examples/]                   ? '[examples]'
+            : m[README]                       ? '[]doc'
             : m[^include/]                    ? '[main]include'
             : m[^t/]                          ? '[test]'
             : m[/t/]                          ? '[test]'
@@ -240,11 +244,9 @@
             : m[^src/pmc/.*\.pmc]             ? '[devel]src'
             : m[^src/dynpmc/.*\.pmc]          ? '[devel]src'
             : m[^runtime/parrot/library/PCT]  ? '[pct]'
-            : m[^docs/pct]                    ? '[pct]doc'
             : m[^runtime/parrot/library/PCT]  ? '[pge]'
             : m[^runtime/parrot/library/TGE]  ? '[tge]'
             : m[^runtime/parrot/library/JSON] ? '[json]'
-            : m[^docs/project]                ? '[devel]doc'
             :                                   '[]'; # default
     }
 
@@ -254,34 +256,31 @@
 # See comments for _get_manifest_entry, above
 sub _get_special {
     my %special = qw(
+        CREDITS                                         [main]doc
+        DEPRECATED.pod                                  [devel]doc
+        DONORS.pod                                      [main]doc
         LICENSE                                         [main]doc
         NEWS                                            [main]doc
         PBC_COMPAT                                      [main]doc
         PLATFORMS                                       [devel]doc
         README                                          [devel]doc
-        README.win32.pod                                [devel]doc
-        README.win32.pod                                [devel]doc
+        README_win32.pod                                [devel]doc
+        README_cygwin.pod                               [devel]doc
         RESPONSIBLE_PARTIES                             [main]doc
-        parrot-config                                   [main]bin
-        docs/faq.pod                                    [main]doc
-        docs/gettingstarted.pod                         [main]doc
-        docs/glossary.pod                               [main]doc
-        docs/intro.pod                                  [main]doc
-        docs/compiler_faq.pod                           [devel]doc
-        docs/debug.pod                                  [devel]doc
-        docs/pmc2c.pod                                  [devel]doc
-        docs/vtables.pod                                [devel]doc
+        TODO                                            [devel]doc
+        VERSION                                         [devel]
         languages/t/harness                             [test]
+        lib/File/Which.pm                               [devel]lib
+        parrot-config                                   [main]bin
         src/ops/ops.num                                 [devel]src
         src/vtable.tbl                                  [devel]src
-        VERSION                                         [devel]
         tools/build/ops2c.pl                            [devel]
         tools/build/pmc2c.pl                            [devel]
         tools/dev/mk_language_shell.pl                  [devel]
+        tools/dev/create_language.pl                    [devel]
         tools/dev/pbc_to_exe.pir                        [devel]
         tools/dev/gen_makefile.pl                       [devel]
         tools/dev/reconfigure.pl                        [devel]
-        lib/File/Which.pm                               [devel]lib
     );
 
     return \%special;

Modified: branches/orderedhash_revamp/lib/Parrot/Op.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Op.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Op.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 #! perl
-# Copyright (C) 2001-2008, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
 =head1 NAME
@@ -319,18 +319,21 @@
 
 # Called from rewrite_body() to perform the actual substitutions.
 sub _substitute {
-    my $self = shift;
-    local $_ = shift;
-    my $trans = shift;
+    my $self           = shift;
+    local $_           = shift;
+    my $trans          = shift;
+    my $preamble_only  = shift;
+
+    my $rewrote_access =
+        s/{{\@([^{]*?)}}/   $trans->access_arg($self->arg_type($1 - 1), $1, $self); /me;
 
-    s/{{\@([^{]*?)}}/   $trans->access_arg($self->arg_type($1 - 1), $1, $self); /me;
+    die "Argument access not allowed in preamble\n"
+        if $preamble_only && $rewrote_access;
 
     s/{{=0,=([^{]*?)}}/   $trans->restart_address($1) . "; {{=0}}"; /me;
     s/{{=0,\+=([^{]*?)}}/ $trans->restart_offset($1)  . "; {{=0}}"; /me;
     s/{{=0,-=([^{]*?)}}/  $trans->restart_offset(-$1) . "; {{=0}}"; /me;
 
-    s/{{=\*}}/            $trans->goto_pop();       /me;
-
     s/{{\+=([^{]*?)}}/    $trans->goto_offset($1);  /me;
     s/{{-=([^{]*?)}}/     $trans->goto_offset(-$1); /me;
     s/{{=([^*][^{]*?)}}/  $trans->goto_address($1); /me;
@@ -343,7 +346,7 @@
     return $_;
 }
 
-=item C<rewrite_body($body, $trans)>
+=item C<rewrite_body($body, $trans, [$preamble])>
 
 Performs the various macro substitutions using the specified transform,
 correctly handling nested substitions, and repeating over the whole string
@@ -355,7 +358,7 @@
 =cut
 
 sub rewrite_body {
-    my ( $self, $body, $trans ) = @_;
+    my ( $self, $body, $trans, $preamble_only ) = @_;
 
     # use vtable macros
     $body =~ s!
@@ -367,7 +370,7 @@
         !VTABLE_$1(!sgx;
 
     while (1) {
-        my $new_body = $self->_substitute( $body, $trans );
+        my $new_body = $self->_substitute( $body, $trans, !!$preamble_only );
 
         last if $body eq $new_body;
 
@@ -395,7 +398,11 @@
         return qq{PANIC(interp, "How did you do that");\n};
     }
 
-    return $self->rewrite_body( $self->full_body, $trans );
+    my $prelude = $trans->can( 'add_body_prelude' )
+                ? $trans->add_body_prelude()
+                : '';
+
+    return $self->rewrite_body( $prelude . $self->full_body, $trans );
 }
 
 =item C<size()>

Modified: branches/orderedhash_revamp/lib/Parrot/OpTrans.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/OpTrans.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/OpTrans.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -220,19 +220,6 @@
     return $self->gen_goto( $self->expr_offset(@_) );
 }
 
-=item C<goto_pop()>
-
-Transforms the C<goto POP($address)> macro in an ops file into the
-relevant C code.
-
-=cut
-
-sub goto_pop {
-    my ($self) = @_;
-
-    return $self->gen_goto( $self->expr_pop(@_) );
-}
-
 =item C<expr_offset($offset)>
 
 Implemented in subclasses to return the C code for C<OFFSET($offset)>.

Modified: branches/orderedhash_revamp/lib/Parrot/OpTrans/C.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/OpTrans/C.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/OpTrans/C.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -52,18 +52,25 @@
 sub defines {
     my $type = __PACKAGE__;
     return <<END;
+#include "pmc/pmc_callcontext.h"
+
 /* defines - $0 -> $type */
 #undef CONST
 #define REL_PC     ((size_t)(cur_opcode - (opcode_t *)interp->code->base.data))
 #define CUR_OPCODE cur_opcode
-#define IREG(i) REG_INT(interp, cur_opcode[i])
-#define NREG(i) REG_NUM(interp, cur_opcode[i])
-#define PREG(i) REG_PMC(interp, cur_opcode[i])
-#define SREG(i) REG_STR(interp, cur_opcode[i])
-#define CONST(i) CONTEXT(interp)->constants[cur_opcode[i]]
+#define IREG(i) (CUR_CTX->bp.regs_i[cur_opcode[i]])
+#define NREG(i) (CUR_CTX->bp.regs_n[-1L - cur_opcode[i]])
+#define PREG(i) (CUR_CTX->bp_ps.regs_p[-1L - cur_opcode[i]])
+#define SREG(i) (CUR_CTX->bp_ps.regs_s[cur_opcode[i]])
+#define CONST(i) Parrot_pcc_get_constants(interp, interp->ctx)[cur_opcode[i]]
 END
 }
 
+sub add_body_prelude {
+    my ($self) = @_;
+    return "    Parrot_Context const * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx);\n";
+}
+
 =item C<gen_goto($where)>
 
 Reimplements the superclass method so that C<$where> is suitably cast.
@@ -100,18 +107,6 @@
     return "cur_opcode + $offset";
 }
 
-=item C<expr_pop()>
-
-Returns the C code for C<POP()>. Called by C<goto_offset()>.
-
-=cut
-
-sub expr_pop {
-    my ($self) = @_;
-
-    return "pop_dest(interp)";
-}
-
 our %arg_maps = (
     'op' => "cur_opcode[%ld]",
 

Modified: branches/orderedhash_revamp/lib/Parrot/OpTrans/CGP.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/OpTrans/CGP.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/OpTrans/CGP.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -68,7 +68,7 @@
     return $pred_def . <<END;
 /* defines - $0 -> $type */
 #  define opcode_to_prederef(i, op)   \\
-     (opcode_t *) (op   - CONTEXT(i)->pred_offset)
+     (opcode_t *) (op   - Parrot_pcc_get_pred_offset(interp, i->ctx))
 END
 }
 
@@ -91,7 +91,7 @@
         return "if ($addr == 0)
           return 0;
    Parrot_cx_handle_tasks(interp, interp->scheduler);
-   _reg_base = (char*)interp->ctx.bp.regs_i;
+   _reg_base = (char*)Parrot_pcc_get_regs_ni(interp, CURRENT_CONTEXT(interp))->regs_i;
    goto **(void **)(cur_opcode = opcode_to_prederef(interp, $addr))";
     }
 }
@@ -107,24 +107,10 @@
     my ( $self, $offset ) = @_;
 
     # this must be a single expression, in case it's in a single-statement if
-    return "do {\nCONTEXT(interp)->current_pc = CUR_OPCODE + $offset;\n"
+    return "do {\nParrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), CUR_OPCODE + $offset);\n"
     .      "goto **(void **)(cur_opcode += $offset);\n} while (1)";
 }
 
-=item C<goto_pop()>
-
-Transforms the C<goto POP()> macro in an ops file into the relevant C
-code.
-
-=cut
-
-sub goto_pop {
-    my ($self) = @_;
-
-    return "goto **(void **)(cur_opcode = opcode_to_prederef(interp,
-        (opcode_t*)pop_dest(interp)))";
-}
-
 sub run_core_func_start {
     my $type = __PACKAGE__;
     return <<END_C;

Modified: branches/orderedhash_revamp/lib/Parrot/OpTrans/CGoto.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/OpTrans/CGoto.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/OpTrans/CGoto.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -72,7 +72,7 @@
 #define NREG(i) REG_NUM(interp, cur_opcode[i])
 #define PREG(i) REG_PMC(interp, cur_opcode[i])
 #define SREG(i) REG_STR(interp, cur_opcode[i])
-#define CONST(i) CONTEXT(interp)->constants[cur_opcode[i]]
+#define CONST(i) Parrot_pcc_get_constants(interp, interp->ctx)[cur_opcode[i]]
 END
 }
 
@@ -174,20 +174,6 @@
     return "goto *ops_addr[*(cur_opcode += $offset)]";
 }
 
-=item C<goto_pop()>
-
-Transforms the C<goto POP()> macro in an ops file into the relevant C
-code.
-
-=cut
-
-sub goto_pop {
-    my ($self) = @_;
-
-    return
-"opcode_t* pop_addr = (opcode_t*)pop_dest(interp);\ncur_opcode = pop_addr;goto *ops_addr[*(pop_addr)]";
-}
-
 my %arg_maps = (
     'op' => "cur_opcode[%ld]",
 

Modified: branches/orderedhash_revamp/lib/Parrot/OpTrans/CPrederef.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/OpTrans/CPrederef.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/OpTrans/CPrederef.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -38,7 +38,7 @@
 /* defines - $0 -> $type */
 #define REL_PC ((size_t)(cur_opcode - (opcode_t*)interp->code->prederef.code))
 #define CUR_OPCODE \\
-    ((opcode_t*)cur_opcode + CONTEXT(interp)->pred_offset)
+    ((opcode_t*)cur_opcode + Parrot_pcc_get_pred_offset(interp, CURRENT_CONTEXT(interp)))
 #define OP_AS_OFFS(o) (_reg_base + ((opcode_t*)cur_opcode)[o])
 
 END

Modified: branches/orderedhash_revamp/lib/Parrot/OpTrans/CSwitch.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/OpTrans/CSwitch.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/OpTrans/CSwitch.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -76,7 +76,7 @@
     return $pred_def . <<END;
 /* defines - $0 -> $type */
 #  define opcode_to_prederef(i, op)   (op ? \\
-     (opcode_t*) (op   - CONTEXT(i)->pred_offset) : (opcode_t*)NULL)
+     (opcode_t*) (op   - Parrot_pcc_get_pred_offset(interp, i->ctx)) : (opcode_t*)NULL)
 END
 }
 
@@ -117,20 +117,6 @@
     return "{ cur_opcode += $offset; goto SWITCH_AGAIN; }";
 }
 
-=item C<goto_pop()>
-
-Transforms the C<goto POP()> macro in an ops file into the relevant C
-code.
-
-=cut
-
-sub goto_pop {
-    my ($self) = @_;
-    return "{ opcode_t *dest = (opcode_t*)pop_dest(interp);
-              cur_opcode = opcode_to_prederef(interp, dest);
-              goto SWITCH_AGAIN; }";
-}
-
 =item C<init_func_init1($base)>
 
 Returns the C code for the init function.
@@ -168,7 +154,7 @@
 #endif
 
 SWITCH_RELOAD:
-    _reg_base = (char*)interp->ctx.bp.regs_i;
+    _reg_base = (char*)Parrot_pcc_get_regs_ni(interp, CURRENT_CONTEXT(interp))->regs_i;
     do {
 SWITCH_AGAIN:
     Parrot_cx_handle_tasks(interp, interp->scheduler);

Modified: branches/orderedhash_revamp/lib/Parrot/Ops2c/Utils.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Ops2c/Utils.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Ops2c/Utils.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -550,7 +550,8 @@
     print $fh $self->{preamble};
     print $fh <<END_C;
 #include "$self->{include}"
-#include "../pmc/pmc_parrotlibrary.h"
+#include "pmc/pmc_parrotlibrary.h"
+#include "pmc/pmc_callcontext.h"
 
 $self->{defines}
 
@@ -685,7 +686,7 @@
     __asm__ ("jmp *4(%ebp)");  /* jump to ret addr, used by JIT */
 # endif
 #endif
-    _reg_base = (char*)interp->ctx.bp.regs_i;
+    _reg_base = (char*)Parrot_pcc_get_regs_ni(interp, CURRENT_CONTEXT(interp))->regs_i;
     goto **(void **)cur_opcode;
 
 END_C

Modified: branches/orderedhash_revamp/lib/Parrot/OpsFile.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/OpsFile.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/OpsFile.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 #! perl
-# Copyright (C) 2001-2008, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
 =head1 NAME
@@ -114,10 +114,6 @@
 
 Transforms to C<PC' = X>. This is used for absolute jumps.
 
-=item C<goto POP()>
-
-Transforms to C<< PC' = <pop> >>. Pops the address off control stack.
-
 =item C<expr OFFSET(X)>
 
 Transforms to C<PC + X>. This is used to give a relative address.
@@ -239,6 +235,8 @@
 
     open my $OPS, '<', $file or die "Can't open $file, $!/$^E";
 
+    $self->version( $PConfig{VERSION} );
+
     if ( !( $file =~ s/\.ops$/.c/ ) ) {
         $file .= ".c";
     }
@@ -257,37 +255,25 @@
     my @argdirs;
     my $seen_pod;
     my $seen_op;
+    my $in_preamble;
     my $line;
     my $flags;
     my @labels;
 
     while (<$OPS>) {
-        $seen_pod = 1 if m|^=|;
+        $seen_pod    = 1 if m|^=|;
+        $in_preamble = 1 if s|^BEGIN_OPS_PREAMBLE||;
 
         unless ( $seen_op or m|^(inline\s+)?op\s+| ) {
-            if (m/^\s*VERSION\s*=\s*"(\d+\.\d+\.\d+)"\s*;\s*$/)
-            {
-                if ( exists $self->{VERSION} ) {
 
-                    #die "VERSION MULTIPLY DEFINED!";
-                }
-
-                $self->version($1);
+            if (m|^END_OPS_PREAMBLE|) {
                 $_ = '';
+                $in_preamble = 0;
             }
-            elsif (m/^\s*VERSION\s*=\s*PARROT_VERSION\s*;\s*$/) {
-                if ( exists $self->{VERSION} ) {
-
-                    #die "VERSION MULTIPLY DEFINED!";
-                }
-
-                $self->version( $PConfig{VERSION} );
-                $_ = '';
+            elsif ($in_preamble) {
+                $self->{PREAMBLE} .= $_;
             }
 
-            $self->{PREAMBLE} .= $_
-                unless $seen_pod or $count;    # Lines up to first op def.
-
             next;
         }
 
@@ -510,7 +496,6 @@
         #   goto OFFSET(X)     {{+=X}}  PC' = PC + X  Used for branches
         #   goto NEXT()        {{+=S}}  PC' = PC + S  Where S is op size
         #   goto ADDRESS(X)    {{=X}}   PC' = X       Used for absolute jumps
-        #   goto POP()         {{=*}}   PC' = <pop>   Pop address off control stack
         #   expr OFFSET(X)     {{^+X}}  PC + X        Relative address
         #   expr NEXT()        {{^+S}}  PC + S        Where S is op size
         #   expr ADDRESS(X)    {{^X}}   X             Absolute address
@@ -546,9 +531,6 @@
         $branch   ||= $body =~ s/\bgoto\s+OFFSET\((.*?)\)/{{+=$1}}/mg;
                       $body =~ s/\bexpr\s+OFFSET\((.*?)\)/{{^+$1}}/mg;
 
-        $pop      ||= $body =~ s/\bgoto\s+POP\(\)/{{=*}}/mg;
-                      $body =~ s/\bexpr\s+POP\(\)/{{^*}}/mg;
-
         $next     ||= $short_name =~ /runinterp/;
         $next     ||= $body =~ s/\bexpr\s+NEXT\(\)/{{^+$op_size}}/mg;
                       $body =~ s/\bgoto\s+NEXT\(\)/{{+=$op_size}}/mg;
@@ -564,9 +546,6 @@
             $restart = 1;
             $next    = 1;
         }
-        elsif ( $short_name eq 'branch_cs' || $short_name eq 'returncc' ) {
-            $restart = 1;    # dest may be NULL to leave run-loop
-        }
         elsif ( $body =~ s/\brestart\s+ADDRESS\((.*?)\)/{{=$1}}/mg ) {
             $next    = 0;
             $restart = 1;
@@ -589,7 +568,6 @@
         # Constants here are defined in include/parrot/op.h
         or_flag( \$jumps, "PARROT_JUMP_ADDRESS"  ) if $absolute;
         or_flag( \$jumps, "PARROT_JUMP_RELATIVE" ) if $branch;
-        or_flag( \$jumps, "PARROT_JUMP_POP"      ) if $pop;
         or_flag( \$jumps, "PARROT_JUMP_ENEXT"    ) if $next;
         or_flag( \$jumps, "PARROT_JUMP_RESTART"  ) if $restart;
 
@@ -685,13 +663,9 @@
 
         #s/goto\s+NEXT\(\)/{{+=$op_size}}/mg;   #not supported--dependent on op size
         s/goto\s+ADDRESS\((.*)\)/{{=$1}}/mg;
-        s/goto\s+POP\(\)/{{=*}}/mg;
         s/HALT\(\)/{{=0}}/mg;
 
-        # RT#43721: This ought to throw errors when attempting to rewrite $n
-        # argument accesses and other things that make no sense in the
-        # preamble.
-        $_ = Parrot::Op->rewrite_body( $_, $trans );
+        $_ = Parrot::Op->rewrite_body( $_, $trans, 'preamble' );
     }
 
     return $_;

Modified: branches/orderedhash_revamp/lib/Parrot/Pmc2c/Attribute.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Pmc2c/Attribute.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Pmc2c/Attribute.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -6,13 +6,31 @@
 use strict;
 use warnings;
 
+=head1 NAME
+
+Parrot::Pmc2c::Attribute
+
+=head1 DESCRIPTION
+
+Methods for attribute struct.  Called by
+C<Parrot::Pmc2c::Parser::find_attrs()>.
+
+=head1 METHODS
+
+=head2 C<new>
+
+Parrot::Pmc2c::Attribute constructor.
+
+=cut
+
 sub new {
     my ( $class, $self_hash ) = @_;
     my $self = {
         (
-            name      => "",
-            type      => "",
-            modifiers => [],
+            name       => "",
+            type       => "",
+            array_size => "",
+            modifiers  => [],
             %{ $self_hash || {} }
         )
     };
@@ -20,14 +38,19 @@
     bless $self, $class;
 }
 
-# getters/setters
+=head2 C<name>
+
+Getter/setter.
+
+=cut
+
 sub name {
     my ( $self, $value ) = @_;
     $self->{name}        = $value if $value;
     return $self->{name};
 }
 
-=head1 C<generate_declaration>
+=head2 C<generate_declaration>
 
 Generate and emit the C code for an attribute declaration.
 
@@ -36,14 +59,14 @@
 sub generate_declaration {
     my ( $self, $pmc ) = @_;
     my $h              = $pmc->{emitter};
-    my $decl           = '    ' . $self->{type} . ' ' . $self->{name} . ";\n";
+    my $decl           = '    ' . $self->{type} . ' ' . $self->{name} . $self->{array_size} . ";\n";
 
     $h->emit($decl);
 
     return 1;
 }
 
-=head1 C<generate_start>
+=head2 C<generate_start>
 
 Generate and emit the C code for the start of an attribute struct.
 
@@ -63,7 +86,7 @@
     return 1;
 }
 
-=head1 C<generate_end>
+=head2 C<generate_end>
 
 Generate and emit the C code for the end of an attribute struct.
 
@@ -86,7 +109,7 @@
     return 1;
 }
 
-=head1 C<generate_accessor>
+=head2 C<generate_accessor>
 
 Generate and emit the C code for an attribute get/set accessor pair.
 

Modified: branches/orderedhash_revamp/lib/Parrot/Pmc2c/Dumper.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Pmc2c/Dumper.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Pmc2c/Dumper.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -12,6 +12,18 @@
 use base 'Exporter';
 @Parrot::Pmc2c::Dumper::EXPORT_OK = 'dump_pmc';
 
+=head1 NAME
+
+Parrot::Pmc2c::Dumper
+
+=head1 DESCRIPTION
+
+Create dump file for PMCs.
+
+=head1 FUNCTIONS
+
+=head2 Public Functions
+
 =head3 C<dump_pmc()>
 
     $return_value = dump_pmc($pmc2cMain);

Modified: branches/orderedhash_revamp/lib/Parrot/Pmc2c/Method.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Pmc2c/Method.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Pmc2c/Method.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -9,6 +9,22 @@
 use constant MULTI        => 'MULTI';
 use Parrot::Pmc2c::UtilFunctions qw( args_from_parameter_list passable_args_from_parameter_list );
 
+=head1 NAME
+
+Parrot::Pmc2c::Method
+
+=head1 DESCRIPTION
+
+Functions used in transformation of PMCs to C code.
+
+=head1 METHODS
+
+=head2 C<new()>
+
+Parrot::Pmc2c::Method constructor.
+
+=cut
+
 sub new {
     my ( $class, $self_hash ) = @_;
     my $self = {
@@ -89,7 +105,7 @@
     return $self->{pmc_unused};
 }
 
-=head1 C<trans($type)>
+=head2 C<trans($type)>
 
 Used in C<signature()> to normalize argument types.
 
@@ -111,7 +127,7 @@
     return '?';
 }
 
-=head1 C<signature()>
+=head2 C<signature()>
 
 Returns the method signature for the methods $parameters
 
@@ -149,6 +165,51 @@
     return ( $return_prefix, $method_suffix, $args, $sig, $return_type_char, $null_return );
 }
 
+=head2 C<pcc_signature()>
+
+Returns a PCC-style method signature for the method's parameters, as well as
+some additional information useful in building a call to that method.
+
+=cut
+
+sub pcc_signature {
+    my ($self) = @_;
+
+    my $args             = passable_args_from_parameter_list( $self->parameters );
+    my ($types, $vars)   = args_from_parameter_list( $self->parameters );
+    my $return_type      = $self->return_type;
+    my $return_type_char = $self->trans($return_type);
+    my $sig              = join ('', map { $self->trans($_) } @{$types}) .
+                           '->';
+
+    my $result_decl    = '';
+    my $return_stmt    = '';
+
+    if ( $return_type eq 'void' ) {
+        $return_stmt = "return ($return_type) NULL;" if $return_type_char =~ /P|I|S|V/;
+        $return_stmt = 'return (FLOATVAL) 0;'        if $return_type_char =~ /N/;
+        $return_stmt = 'return;'                     if $return_type_char =~ /v/;
+    }
+    else {
+        $result_decl = "$return_type result;";
+        $args .= ', &result';
+        $sig .= $return_type_char;
+        $return_stmt = "return ($return_type) result;";
+    }
+
+    return ( $sig, $args, $result_decl, $return_stmt );
+}
+
+=head1 SEE ALSO
+
+    lib/Parrot/Pmc2c/PMC/RO.pm
+    lib/Parrot/Pmc2c/PMCEmitter.pm
+    lib/Parrot/Pmc2c/VTable.pm
+    lib/Parrot/Pmc2c/PMC.pm
+    lib/Parrot/Pmc2c/Parser.pm
+
+=cut
+
 1;
 
 # Local Variables:

Modified: branches/orderedhash_revamp/lib/Parrot/Pmc2c/MethodEmitter.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Pmc2c/MethodEmitter.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Pmc2c/MethodEmitter.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,4 +1,4 @@
-# Copyright (C) 2004-2008, Parrot Foundation.
+# Copyright (C) 2004-2009, Parrot Foundation.
 
 # $Id$
 
@@ -149,9 +149,6 @@
     'void *'   => 'b',
     'void**'   => 'B',
     'void **'  => 'B',
-
-    #"BIGNUM*" => "???" # RT#43731
-    #"BIGNUM *"=> "???" # RT#43731
 );
 
 sub proto {
@@ -163,13 +160,9 @@
 
     # type method(interp, self, parameters...)
     my $ret = $calltype{ $type or "void" };
-    $ret .= "JO" . join( '', map { $calltype{$_} or "?" } split( /,/, $parameters ) );
-
-    # RT#43733
-    # scan src/call_list.txt if the generated signature is available
-
-    # RT#43735 report errors for "?"
-    # --leo
+    $ret .= "JO" . join( '',
+        map { $calltype{$_} or die "Unknown signature type '$_'" }
+        split( /,/, $parameters ) );
 
     return $ret;
 }
@@ -189,7 +182,7 @@
     # Rewrite SELF.other_method(args...)
     $body->subst(
         qr{
-    \bSELF\b         # Macro: SELF
+      \bSELF\b       # Macro: SELF
       \.(\w+)        # other_method
       \(\s*(.*?)\)   # capture argument list
       }x,
@@ -199,7 +192,7 @@
     # Rewrite STATICSELF.other_method(args...)
     $body->subst(
         qr{
-      \bSTATICSELF\b          # Macro STATICSELF
+      \bSTATICSELF\b    # Macro STATICSELF
       \.(\w+)           # other_method
       \(\s*(.*?)\)      # capture argument list
       }x,
@@ -242,15 +235,6 @@
         die "$pmcname defines unknown vtable method '$name'\n" unless defined $super_table->{$name};
         my $supermethod = "Parrot_" . $super_table->{$name} . "_$name";
 
-        # Rewrite DYNSUPER(args)
-        $body->subst(
-            qr{
-            \bDYNSUPER\b      # Macro: DYNSUPER
-            \(\s*(.*?)\)      # capture argument list
-          }x,
-            sub { "interp->vtables[$supertype]->$name(" . full_arguments($1) . ')' }
-        );
-
         # Rewrite OtherClass.SUPER(args...)
         $body->subst(
             qr{
@@ -267,7 +251,16 @@
             \bSUPER\b         # Macro: SUPER
             \(\s*(.*?)\)      # capture argument list
           }x,
-            sub { "interp->vtables[$supertype]->$name(" . full_arguments($1) . ')' }
+            sub {
+              if ($pmc->is_dynamic($super)) {
+                return "Parrot_" . $super .
+                  "_get_vtable(interp)->$name(" . full_arguments($1) .
+                  ')';
+              }
+              else {
+                return "interp->vtables[$supertype]->$name(" . full_arguments($1) . ')';
+              }
+            }
         );
     }
 

Modified: branches/orderedhash_revamp/lib/Parrot/Pmc2c/Object.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Pmc2c/Object.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Pmc2c/Object.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -7,6 +7,16 @@
 use strict;
 use warnings;
 
+=head1 NAME
+
+Parrot::Pmc2c::Object
+
+=head1 DESCRIPTION
+
+Functions used in transformation of PMCs to C code.
+
+=head1 METHODS
+
 =over 4
 
 =item C<implements($method)>
@@ -45,111 +55,7 @@
         my $n = $self->{has_method}{$meth};
         return $self->SUPER::body( $self->{methods}[$n], $line, $out_name );
     }
-
-    my $parameters = $method->{parameters};
-    my $n          = 0;
-    my @args       = grep { $n++ & 1 ? $_ : 0 } split / /, $parameters;
-    my $arg        = '';
-    $arg = ", " . join( ' ', @args ) if @args;
-    $parameters = ", $parameters" if $parameters;
-    my $decl = $self->decl( $self->{class}, $method, 0 );
-
-    # Need to build signature and work out what return type we expect.
-    my $ret_sig  = ctype_to_sigchar( $method->{type} );
-
-    my $ret_type = $ret_sig eq 'I' ? '_reti' : '_retf';
-
-    my $sig      = $ret_sig;
-    my @types    = grep { $_ } map { my @x = split /\s+/; $x[0] }
-                        split /\s*,\s*/, $parameters;
-
-    foreach (@types) {
-        $sig .= ctype_to_sigchar($_);
-    }
-
-    # Do we have a return value?
-    my $return      = $method->{type} =~ /void/ ? ''        : 'return ';
-    my $void_return = $method->{type} =~ /void/ ? 'return;' : '';
-
-    # work out what the null return should be so that we can quieten the "no
-    # return from non-void function" warnings.
-    # unfortunately, the general case:
-    #my $null_return = "($method->{type})NULL";
-    # doesn't work with gcc (it builds and tests without even a warning with
-    # icc), so we add a workaround for the null return from a FLOATVAL
-    # function
-    my $null_return;
-    if ( $method->{type} eq 'void' ) {
-        $null_return = '';
-    }
-    elsif ( $method->{type} eq 'void*' ) {
-        $null_return = 'return NULL;';
-    }
-    elsif ( $method->{type} =~ /PMC|INTVAL|STRING|opcode_t/ ) {
-        $null_return = "return ($method->{type})NULL;";
-    }
-
-    # workaround for gcc because the general case doesn't work there
-    elsif ( $method->{type} =~ /FLOATVAL/ ) {
-        $null_return = 'return (FLOATVAL) 0;';
-    }
-    else {
-        $null_return = '';
-    }
-
-    my $l         = $self->line_directive( $line + 1, "\L$self->{class}.c" );
-    my $generated = <<EOC;
-$l
-$decl {
-    Parrot_Object_attributes * const obj    = PARROT_OBJECT(pmc);
-    Parrot_Class_attributes  * const _class = PARROT_CLASS(obj->_class);
-
-    /* Walk and search for the vtable method. */
-    const int num_classes       = VTABLE_elements(interp, _class->all_parents);
-    const int all_in_universe   = !PObj_HasAlienParents_TEST(obj->_class);
-    const int alien_parents_pos = VTABLE_elements(interp, _class->attrib_metadata);
-    int i;
-    for (i = 0; i < num_classes; i++) {
-        /* Get the class. */
-        PMC * const cur_class =
-            VTABLE_get_pmc_keyed_int(interp, _class->all_parents, i);
-
-        /* If it's from this universe or the class doesn't inherit from
-         * anything outside of it... */
-        if (all_in_universe
-        ||  VTABLE_isa(interp, cur_class, CONST_STRING_GEN(interp, "Class"))) {
-EOC
-
-    # We shouldn't allow overrides of get_pointer and friends,
-    # since it's unsafe.
-    if ( $meth !~ /get_pointer/ ) {
-        $generated .= <<EOC;
-            const ParrotClass_attributes * const class_info = PARROT_CLASS(cur_class);
-            if (VTABLE_exists_keyed_str(interp, class_info->vtable_overrides, CONST_STRING_GEN(interp, "$meth"))) {
-                /* Found it; call. */
-                PMC * const meth = VTABLE_get_pmc_keyed_str(interp,
-                    class_info->vtable_overrides, CONST_STRING_GEN(interp, "$meth"));
-                ${return}Parrot_run_meth_fromc_args$ret_type(interp, meth, pmc, CONST_STRING_GEN(interp, "$meth"), "$sig"$arg);
-                $void_return
-            }
-EOC
-    }
-
-    $generated .= <<EOC;
-        }
-        else {
-            /* Get the PMC instance and call the vtable method on that. */
-            PMC * const del_class = VTABLE_get_pmc_keyed_int(interp,
-                                        obj->attrib_store, alien_parents_pos);
-
-            ${return}VTABLE_$meth(interp, del_class$arg);
-        }
-    }
-    $null_return
-}
-EOC
-
-    return $generated;
+    die "This code is never reached";
 }
 
 sub ctype_to_sigchar {

Modified: branches/orderedhash_revamp/lib/Parrot/Pmc2c/PCCMETHOD.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Pmc2c/PCCMETHOD.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Pmc2c/PCCMETHOD.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -79,10 +79,22 @@
 our $reg_type_info = {
 
     # s is string, ss is short string, at is arg type
-    +(REGNO_INT) => { s => "INTVAL",   ss => "INT", at => PARROT_ARG_INTVAL, },
-    +(REGNO_NUM) => { s => "FLOATVAL", ss => "NUM", at => PARROT_ARG_FLOATVAL, },
-    +(REGNO_STR) => { s => "STRING*",  ss => "STR", at => PARROT_ARG_STRING, },
-    +(REGNO_PMC) => { s => "PMC*",     ss => "PMC", at => PARROT_ARG_PMC, },
+    +(REGNO_INT) => { s   => "INTVAL",
+                      ss  => "INT",
+                      pcc => 'I',
+                      at  => PARROT_ARG_INTVAL},
+    +(REGNO_NUM) => { s   => "FLOATVAL",
+                      ss  => "NUM",
+                      pcc => "N",
+                      at  => PARROT_ARG_FLOATVAL, },
+    +(REGNO_STR) => { s => "STRING*",
+                      ss => "STR",
+                      pcc => "S",
+                      at => PARROT_ARG_STRING, },
+    +(REGNO_PMC) => { s => "PMC*",
+                      ss => "PMC",
+                      pcc => "P",
+                      at => PARROT_ARG_PMC, },
 };
 
 # Perl trim function to remove whitespace from the start and end of the string
@@ -110,10 +122,10 @@
 =head3 C<parse_adverb_attributes>
 
   builds and returs an adverb hash from an adverb string such as
-  ":optional :optflag :slurpy"
+  ":optional :opt_flag :slurpy"
   {
     optional  =>1,
-    optflag   =>1,
+    opt_flag  =>1,
     slurpy    =>1,
   }
 
@@ -137,6 +149,26 @@
     croak "$_ not recognized as INTVAL, FLOATVAL, STRING, or PMC";
 }
 
+sub gen_arg_pcc_sig {
+    my ($param) = @_;
+
+    return 'Ip'
+        if exists $param->{attrs}{opt_flag};
+
+    my $sig = $reg_type_info->{ $param->{type} }->{pcc};
+    $sig   .= 'c' if  exists $param->{attrs}{constant};
+    $sig   .= 'f' if  exists $param->{attrs}{flatten};
+    $sig   .= 'i' if  exists $param->{attrs}{invocant};
+    $sig   .= 'l' if  exists $param->{attrs}{lookahead};
+    $sig   .= 'n' if (exists $param->{attrs}{name} ||
+                      exists $param->{attrs}{named});
+    $sig   .= 'o' if  exists $param->{attrs}{optional};
+    $sig   .= 'p' if  exists $param->{attrs}{opt_flag};
+    $sig   .= 's' if  exists $param->{attrs}{slurpy};
+
+    return $sig;
+}
+
 sub gen_arg_flags {
     my ($param) = @_;
 
@@ -162,14 +194,11 @@
     my $tiss = $reg_type_info->{$reg_type}{ss};    #reg_type_info short string
 
     if ( 'arg' eq $arg_type ) {
-        return "    $tis $name = CTX_REG_$tiss(_ctx, $index);\n";
+        return "$tis $name = CTX_REG_$tiss(_ctx, $index);\n";
     }
     elsif ( 'result' eq $arg_type ) {
         return "    $name = CTX_REG_$tiss(_ctx, $index);\n";
     }
-    elsif ( 'name' eq $arg_type ) {
-        return "    CTX_REG_$tiss(_ctx, $index) = CONST_STRING_GEN(interp, $name);\n";
-    }
     else {  #$arg_type eq 'param' or $arg_type eq 'return'
         return "    CTX_REG_$tiss(_ctx, $index) = $name;\n";
     }
@@ -185,15 +214,13 @@
     my ( $self, $pmc ) = @_;
     my $method_name    = $self->name;
     my $body           = $self->body;
-    my $regs_used      = [];
-    my $qty_returns    = 0;
 
-    my $signature_re   = qr{
+    my $signature_re   = qr/
       (RETURN       #method name
       \s*              #optional whitespace
       \( ([^\(]*) \)   #returns ( stuff ... )
       ;?)              #optional semicolon
-    }sx;
+    /sx;
 
     croak "return not allowed in pccmethods, use RETURN instead $body"
         if $body and $body =~ m/\breturn\b.*?;\z/s;
@@ -206,7 +233,6 @@
             last unless $matched;
         }
 
-        $qty_returns++;
         $matched =~ /$signature_re/;
         my ( $match, $returns ) = ( $1, $2 );
 
@@ -215,7 +241,7 @@
         if ($returns eq 'void') {
             $e->emit( <<"END", __FILE__, __LINE__ + 1 );
     /*BEGIN RETURN $returns */
-    goto no_return;
+    return;
     /*END RETURN $returns */
 END
             $matched->replace( $match, $e );
@@ -223,40 +249,33 @@
         }
 
         my $goto_string = "goto ${method_name}_returns;";
-        my ( $returns_n_regs_used, $returns_indexes, $returns_flags, $returns_accessors ) =
+        my ( $returns_signature, $returns_varargs ) =
             process_pccmethod_args( parse_p_args_string($returns), 'return' );
-        $returns_indexes = "0" unless $returns_indexes;
-
-        push @$regs_used, $returns_n_regs_used;
 
+        if ($returns_signature) {
         $e->emit( <<"END", __FILE__, __LINE__ + 1 );
     {
     /*BEGIN RETURN $returns */
-    /*BEGIN GENERATED ACCESSORS */
-END
-        $e->emit(<<"END");
-$returns_accessors
 END
-
-    my $returns_sig  = make_arg_pmc($returns_flags, '_return_sig');
-
         $e->emit( <<"END", __FILE__, __LINE__ + 1 );
-    /*END GENERATED ACCESSORS */
-    {
-        opcode_t _temp_return_indexes[] = { $returns_indexes };
-        _return_indexes                 = _temp_return_indexes;
-    }
-
-    _return_sig = pmc_new(interp, enum_class_FixedIntegerArray);
-$returns_sig
-    $goto_string
+    Parrot_pcc_fill_returns_from_c_args(interp, _call_object, "$returns_signature",
+            $returns_varargs);
+    return;
     /*END RETURN $returns */
     }
 END
+        }
+        else { # if ($returns_signature)
+            $e->emit( <<"END", __FILE__, __LINE__ + 1 );
+    /*BEGIN RETURN $returns */
+    return;
+    /*END RETURN $returns */
+END
+        }
+
         $matched->replace( $match, $e );
     }
 
-    return $regs_used, $qty_returns;
 }
 
 sub parse_p_args_string {
@@ -305,16 +324,20 @@
 sub process_pccmethod_args {
     my ( $linear_args, $arg_type ) = @_;
 
-    my $n_regs_used_a  = [ 0, 0, 0, 0 ];     # INT, FLOAT, STRING, PMC counts
     my $args           = [ [], [], [], [] ]; # actual INT, FLOAT, STRING, PMC
-    my $args_indexes_a = [];                 # arg index into interp context
-    my $args_flags_a   = [];                 # arg flags
-    my $args_accessors = "";
-    my $named_names    = "";
+    my $signature    = "";
+    my @vararg_list = ();
+    my $varargs    = "";
+    my $declarations    = "";
 
     for my $arg (@$linear_args) {
         my ( $named, $named_name ) = is_named($arg);
+        my $type = $arg->{type};
+        my $name = $arg->{name};
         if ($named) {
+            my $tis  = $reg_type_info->{+(REGNO_STR)}{s};     #reg_type_info string
+            my $dummy_name = "_param_name_str_". $named_name;
+            $dummy_name =~ s/"//g;
             my $argn = {
                 type => +(REGNO_STR),
                 name => $named_name,
@@ -323,22 +346,26 @@
             $arg->{named_name} = $named_name;
 
             push @{ $args->[ +(REGNO_STR) ] }, $argn;
-            $argn->{index} = $n_regs_used_a->[ +(REGNO_STR) ]++;
-            push @$args_indexes_a, $argn->{index};
-            push @$args_flags_a,   PARROT_ARG_STRING | PARROT_ARG_NAME;
-            $named_names .= gen_arg_accessor( $argn, 'name' );
-        }
-
-        push @{ $args->[ $arg->{type} ] }, $arg;
-        $arg->{index} = $n_regs_used_a->[ $arg->{type} ]++;
-        push @$args_indexes_a, $arg->{index};
-        push @$args_flags_a,   gen_arg_flags($arg);
-        $args_accessors .= gen_arg_accessor( $arg, $arg_type );
-    }
-
-    my $n_regs_used  = join( ", ",        @$n_regs_used_a );
-    my $args_indexes = join( ", ",        @$args_indexes_a );
-    return ( $n_regs_used_a, $args_indexes, $args_flags_a, $args_accessors, $named_names );
+            $signature .= 'Sn';
+            $declarations .= "$tis $dummy_name = CONST_STRING_GEN(interp, $named_name);\n";
+            push @vararg_list, "&$dummy_name";
+        }
+
+        push @{ $args->[ $type ] }, $arg;
+        $signature .= gen_arg_pcc_sig($arg);
+        if ( $arg_type eq 'arg' ) {
+            my $tis  = $reg_type_info->{$type}{"s"};     #reg_type_info string
+            $declarations .= "$tis $name;\n";
+            push @vararg_list, "&$name"
+        }
+        elsif ( $arg_type eq 'return' ) {
+            my $typenamestr = $reg_type_info->{$type}{s};
+            push @vararg_list, "($typenamestr)$name";
+        }
+    }
+
+    $varargs = join ", ", @vararg_list;
+    return ( $signature, $varargs, $declarations );
 }
 
 sub find_max_regs {
@@ -367,116 +394,51 @@
     my $e      = Parrot::Pmc2c::Emitter->new( $pmc->filename );
     my $e_post = Parrot::Pmc2c::Emitter->new( $pmc->filename );
 
-    # parse pccmethod parameters, then unshift the a PMC arg for the invocant
+    # parse pccmethod parameters, then unshift the PMC arg for the invocant
     my $linear_args = parse_p_args_string( $self->parameters );
     unshift @$linear_args,
         {
         type  => convert_type_string_to_reg_type('PMC'),
         name  => 'pmc',
-        attrs => parse_adverb_attributes(':object')
+        attrs => parse_adverb_attributes(':invocant')
         };
 
-    my ( $params_n_regs_used, $params_indexes, $params_flags, $params_accessors, $named_names ) =
+ # The invocant is already passed in the C signature, why pass it again?
+
+    my ( $params_signature, $params_varargs, $params_declarations ) =
         process_pccmethod_args( $linear_args, 'arg' );
 
-    my ( $n_regs, $qty_returns ) = rewrite_RETURNs( $self, $pmc );
+    rewrite_RETURNs( $self, $pmc );
     rewrite_pccinvoke( $self, $pmc );
-    unshift @$n_regs, $params_n_regs_used;
-    my $n_regs_used = find_max_regs($n_regs);
-
-    my $set_params  = make_arg_pmc($params_flags, '_param_sig');
 
     $e->emit( <<"END", __FILE__, __LINE__ + 1 );
-    const INTVAL _n_regs_used[]   = { $n_regs_used };
-    opcode_t _param_indexes[]     = { $params_indexes };
-    opcode_t *_return_indexes;
-    opcode_t *_current_args;
-    PMC      * const _param_sig   = pmc_new(interp, enum_class_FixedIntegerArray);
-    PMC      *_return_sig         = PMCNULL;
-
-    Parrot_Context *_caller_ctx   = CONTEXT(interp);
-    PMC * const _ret_cont         = new_ret_continuation_pmc(interp, NULL);
-    Parrot_Context *_ctx          = Parrot_push_context(interp, _n_regs_used);
-    PMC *_ccont                   = PMCNULL;
-
-$set_params
-    UNUSED(_return_indexes);
-
-    if (_caller_ctx) {
-        _ccont = _caller_ctx->current_cont;
-    }
-    else {
-        /* there is no point calling Parrot_ex_throw_from_c_args here, because
-           PDB_backtrace can't deal with a missing to_ctx either. */
-        exit_fatal(1, "No caller_ctx for continuation \%p.", _ccont);
-    }
-
-    _ctx->current_cont            = _ret_cont;
-    PMC_cont(_ret_cont)->from_ctx = _ctx;
+    PMC * const _ctx         = CURRENT_CONTEXT(interp);
+    PMC * const _ccont       = Parrot_pcc_get_continuation(interp, _ctx);
+    PMC * const _call_object = Parrot_pcc_get_signature(interp, _ctx);
 
-    _current_args                 = interp->current_args;
-    interp->current_args         = NULL;
+    Parrot_pcc_set_signature(interp, _ctx, NULL);
 
+    { /* BEGIN PARMS SCOPE */
 END
     $e->emit(<<"END");
-$named_names
-END
-    $e->emit( <<"END", __FILE__, __LINE__ + 1 );
-
-    interp->params_signature     = _param_sig;
-    parrot_pass_args(interp, _caller_ctx, _ctx, _current_args, _param_indexes,
-        PARROT_PASS_PARAMS);
-
-    if (PObj_get_FLAGS(_ccont) & SUB_FLAG_TAILCALL) {
-        PObj_get_FLAGS(_ccont) &= ~SUB_FLAG_TAILCALL;
-        --_ctx->recursion_depth;
-        _ctx->caller_ctx      = _caller_ctx->caller_ctx;
-        Parrot_free_context(interp, _caller_ctx, 1);
-        interp->current_args = NULL;
-    }
-    /* BEGIN PARMS SCOPE */
-    {
-END
-    $e->emit(<<"END");
-$params_accessors
+$params_declarations
 END
-    $e->emit( <<"END", __FILE__, __LINE__ + 1 );
-
-    /* BEGIN PMETHOD BODY */
-    {
+    if ($params_signature) {
+        $e->emit( <<"END", __FILE__, __LINE__ + 1 );
+        Parrot_pcc_fill_params_from_c_args(interp, _call_object, "$params_signature",
+            $params_varargs);
 END
-
-    my $method_returns = $self->name . "_returns:";
-    $e_post->emit( <<"END", __FILE__, __LINE__ + 1 );
-
     }
-    goto no_return;
-    /* END PMETHOD BODY */
-
+    $e->emit( <<"END", __FILE__, __LINE__ + 1 );
+    { /* BEGIN PMETHOD BODY */
 END
-    if ($qty_returns) {
-        $e_post->emit( <<"END", __FILE__, __LINE__ + 1 );
-$method_returns
-
-    if (! _caller_ctx) {
-        /* there is no point calling Parrot_ex_throw_from_c_args here, because
-           PDB_backtrace can't deal with a missing to_ctx either. */
-        exit_fatal(1, "No caller_ctx for continuation \%p.", _ccont);
-    }
 
-    interp->returns_signature = _return_sig;
-    parrot_pass_args(interp, _ctx, _caller_ctx, _return_indexes,
-        _caller_ctx->current_results, PARROT_PASS_RESULTS);
-END
-    }
     $e_post->emit( <<"END", __FILE__, __LINE__ + 1 );
 
-    /* END PARAMS SCOPE */
-    }
-    no_return:
-    PObj_live_CLEAR(_param_sig);
-    PObj_live_CLEAR(_return_sig);
-    Parrot_pop_context(interp);
+    } /* END PMETHOD BODY */
+    } /* END PARAMS SCOPE */
+  no_return:
+    return;
 END
     $self->return_type('void');
     $self->parameters('');
@@ -506,7 +468,7 @@
       =                # results equals PCCINVOKE invocation
       \s*              # optional whitespace
       )?               # results are optional
-      \b               # exclude Parrot_PCCINVOKE when lacking optional capture
+      \b               # exclude Parrot_pcc_invoke_method_from_c_args when lacking optional capture
       PCCINVOKE        # method name
       \s*              # optional whitespace
       \( ([^\(]*) \)   # parameters
@@ -542,7 +504,7 @@
         $vars .= $out_vars;
 
         my $e = Parrot::Pmc2c::Emitter->new( $pmc->filename );
-        $e->emit(qq|Parrot_PCCINVOKE($fixed_params, "$signature", $vars);\n|);
+        $e->emit(qq|Parrot_pcc_invoke_method_from_c_args($fixed_params, "$signature", $vars);\n|);
 
         $matched->replace( $match, $e );
     }
@@ -626,7 +588,7 @@
         flatten    => 'f',
         slurpy     => 's',
         optional   => 'o',
-        positional => 'p',
+        opt_flag   => 'p',
     );
 
     my @arg_names = ($name);

Modified: branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMC.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMC.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMC.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -225,9 +225,9 @@
 }
 
 sub filename {
-    my ( $self, $type ) = @_;
+    my ( $self, $type, $is_dynamic ) = @_;
     return $self->{filename} unless $type;
-    return Parrot::Pmc2c::UtilFunctions::filename( $self->{filename}, $type );
+    return Parrot::Pmc2c::UtilFunctions::filename( $self->{filename}, $type, $is_dynamic );
 }
 
 sub get_flags {

Modified: branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMC/Null.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMC/Null.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMC/Null.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,17 +1,21 @@
 # Copyright (C) 2007-2008, Parrot Foundation.
 # $Id$
 
-=head1 Parrot::Pmc2c::Null Instance Methods
-
-=over 4
-
-=cut
-
 package Parrot::Pmc2c::PMC::Null;
 use base 'Parrot::Pmc2c::PMC';
 use strict;
 use warnings;
 
+=head1 NAME
+
+Parrot::Pmc2c::PMC::Null
+
+=head1 DESCRIPTION
+
+PMC to C Instance Methods
+
+=over 4
+
 =item C<pre_method_gen($method, $line, $out_name)>
 
 Auto generates methods for the NULL PMC.
@@ -47,10 +51,10 @@
             $param =~ s/.*\b(\w+)/$1/;
             $body .= "    UNUSED($param)\n";
         }
+        my $vtname = uc $vt_method_name;
         $body .= <<"EOC";
 
-    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_NULL_REG_ACCESS,
-        "Null PMC access in $vt_method_name()");
+    null_pmc_access(interp, PARROT_VTABLE_SLOT_$vtname);
 EOC
 
         $new_default_method->body( Parrot::Pmc2c::Emitter->text($body) );

Modified: branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMC/Object.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMC/Object.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMC/Object.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -7,7 +7,17 @@
 use strict;
 use warnings;
 
-=head1 C<body($method, $line, $out_name)>
+=head1 NAME
+
+Parrot::Pmc2c::PMC::Object
+
+=head1 DESCRIPTION
+
+PMC to C Methods
+
+=head1 METHODS
+
+=head2 C<body($method, $line, $out_name)>
 
 Returns the C code for the method body.
 
@@ -34,6 +44,8 @@
 
         my ( $return_prefix, $ret_suffix, $args, $sig, $return_type_char, $null_return ) =
             $new_default_method->signature;
+        my ( $pcc_sig, $pcc_args, $pcc_result_decl, $pcc_return_stmt ) =
+            $new_default_method->pcc_signature;
         my $void_return  = $return_type_char eq 'v' ? 'return;'    : '';
         my $return       = $return_type_char eq 'v' ? ''           : $return_prefix;
         my $superargs    = $args;
@@ -53,8 +65,9 @@
 
         PMC * const meth = Parrot_oo_find_vtable_override_for_class(interp, cur_class, meth_name);
         if (!PMC_IS_NULL(meth)) {
-            ${return}Parrot_run_meth_fromc_args$ret_suffix(interp, meth, pmc, meth_name, "$sig"$args);
-            $void_return
+            $pcc_result_decl
+            Parrot_pcc_invoke_sub_from_c_args(interp, meth, "Pi$pcc_sig", pmc$pcc_args);
+            $pcc_return_stmt
         }
         /* method name is $vt_method_name */
 EOC

Modified: branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMC/ParrotClass.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMC/ParrotClass.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMC/ParrotClass.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,7 +1,15 @@
 # Copyright (C) 2007, Parrot Foundation.
 # $Id$
 
-=head1 Parrot::Pmc2c::ParrotClass Instance Methods
+=head1 NAME
+
+Parrot::Pmc2c::ParrotClass
+
+=head1 DESCRIPTION
+
+Instance Methods
+
+=head1 METHODS
 
 =over 4
 
@@ -19,6 +27,8 @@
 @dont_delegate which should fall through to the default.pmc
 implementation.
 
+=back
+
 =cut
 
 our @dont_delegate = qw(
@@ -43,7 +53,6 @@
     getprops
     is_same
     morph
-    nextkey_keyed_int
     set_integer_keyed_int
     set_number_keyed_int
     set_pmc_keyed_int

Modified: branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMC/RO.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMC/RO.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMC/RO.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,4 +1,4 @@
-# Copyright (C) 2004-2008, Parrot Foundation.
+# Copyright (C) 2004-2009, Parrot Foundation.
 
 # $Id$
 
@@ -43,11 +43,16 @@
 
     my $self = bless Parrot::Pmc2c::PMC->new(
         {
-            parents => [ $parent->name, @{ $parent->parents } ],    # prepend self to parrent
-            flags => { ( %{ $parent->get_flags } ), 'is_ro' => 1 }, # copy flags, set is_ro
-            name       => $parent->name . "_ro",                    # set pmcname
-            vtable     => $parent->vtable,                          # and alias vtable
-            parentname => $parent->name,                            # set parentname
+            # prepend self to parent
+            parents => [ $parent->name, @{ $parent->parents } ],
+            # copy flags, set is_ro
+            flags => { ( %{ $parent->get_flags } ), 'is_ro' => 1 },
+            # set pmcname
+            name       => $parent->name . "_ro",
+            # and alias vtable
+            vtable     => $parent->vtable,
+            # set parentname
+            parentname => $parent->name,
         }
     ), $classname;
 
@@ -56,7 +61,8 @@
     {
 
       # autogenerate for nonstandard types
-      # (RT#44433 is this appropriate or do we want them to each be explicitly cleared to have RO ?)
+      # (TT #1240: is this appropriate or do we want them to each be
+      # explicitly cleared to have RO ?)
         no strict 'refs';
         if ( !@{ ref($self) . '::ISA' } ) {
             @{ ref($self) . '::ISA' } = "Parrot::Pmc2c::PMC::RO";
@@ -66,15 +72,16 @@
     foreach my $vt_method ( @{ $self->vtable->methods } ) {
         my $name = $vt_method->name;
 
-        # Generate ro variant only iff we override method constantness with ":write"
+        # Generate RO variant only if we override method constantness
+        # with ":write"
         next unless $parent->{has_method}{$name}
                     && $parent->vtable_method_does_write($name)
                     && !$parent->vtable->attrs($name)->{write};
 
         # All parameters passed in are shims, because we're
         # creating an exception-thrower.
-        my @parameters = split( /\s*,\s*/, $vt_method->parameters );
-        @parameters = map { "SHIM($_)" } @parameters;
+        my @parameters = map { "SHIM($_)" }
+                         split( /\s*,\s*/, $vt_method->parameters );
 
         my $ro_method = Parrot::Pmc2c::Method->new(
             {

Modified: branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMC/default.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMC/default.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMC/default.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,7 +1,15 @@
 # Copyright (C) 2007-2008, Parrot Foundation.
 # $Id$
 
-=head1 Parrot::Pmc2c::PMC::default Instance Methods
+=head1 NAME
+
+Parrot::Pmc2c::PMC::default
+
+=head1 DESCRIPTION
+
+Instance Methods
+
+=head1 METHODS
 
 =over 4
 
@@ -17,6 +25,8 @@
 
 Always true.
 
+=back
+
 =cut
 
 sub pre_method_gen {
@@ -79,8 +89,8 @@
         $param =~ s/.*\b(\w+)/$1/;
         $body .= "    UNUSED($param)\n";
     }
-    my $vt_method_name = $method->name;
-    $body .= qq{    $stub_func(interp, pmc, "$vt_method_name");\n};
+    my $vt_method_name = uc $method->name;
+    $body .= qq{    $stub_func(interp, pmc, PARROT_VTABLE_SLOT_$vt_method_name);\n};
 
     $clone->body( Parrot::Pmc2c::Emitter->text($body));
 

Modified: branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMCEmitter.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMCEmitter.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Pmc2c/PMCEmitter.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -50,7 +50,7 @@
     $emitter->write_to_file;
 
     $emitter = $self->{emitter} =
-        Parrot::Pmc2c::Emitter->new( $self->filename(".h") );
+        Parrot::Pmc2c::Emitter->new( $self->filename(".h", $self->is_dynamic) );
 
     $self->generate_h_file;
     $emitter->write_to_file;
@@ -76,7 +76,8 @@
     $self->gen_includes;
 
     # The PCC code needs Continuation-related macros from these headers.
-    $c->emit("#include \"pmc_continuation.h\"\n");
+    $c->emit("#include \"pmc/pmc_continuation.h\"\n");
+    $c->emit("#include \"pmc/pmc_callcontext.h\"\n");
 
     $c->emit( $self->preamble );
 
@@ -90,7 +91,7 @@
         $ro->gen_methods;
     }
 
-    $c->emit("#include \"pmc_default.h\"\n");
+    $c->emit("#include \"pmc/pmc_default.h\"\n");
 
     $c->emit( $self->update_vtable_func );
     $c->emit( $self->get_vtable_func );
@@ -275,8 +276,6 @@
     "void"     => "v",
     "void*"    => "b",
     "void**"   => "B",
-
-    #"BIGNUM*" => "???" # RT#43731
 );
 
 sub proto {
@@ -292,13 +291,9 @@
     # type method(interp, self, parameters...)
     my $ret = $calltype{ $type or "void" }
         . "JO"
-        . join( '', map { $calltype{$_} or "?" } split( /,/, $parameters ) );
-
-    # RT #43733
-    # scan src/call_list.txt if the generated signature is available
-
-    # RT #43735 report errors for "?"
-    # --leo
+        . join( '',
+            map { $calltype{$_} or die "Unknown signature type '$_'" }
+            split( /,/, $parameters ) );
 
     return $ret;
 }
@@ -421,7 +416,6 @@
     my ($self) = @_;
 
     my $vtbl_flag = 0;
-    $vtbl_flag .= '|VTABLE_PMC_NEEDS_EXT'     if $self->flag('need_ext');
     $vtbl_flag .= '|VTABLE_PMC_IS_SINGLETON'  if $self->flag('singleton');
     $vtbl_flag .= '|VTABLE_IS_SHARED_FLAG'    if $self->flag('is_shared');
     $vtbl_flag .= '|VTABLE_IS_READONLY_FLAG'  if $self->flag('is_ro');
@@ -464,7 +458,8 @@
         NULL,       /* mro */
         NULL,       /* attribute_defs */
         NULL,       /* ro_variant_vtable */
-        $methlist
+        $methlist,
+	0           /* attr size */
     };
 ENDOFCODE
     return $cout;
@@ -581,14 +576,6 @@
     $cout .= "\";\n";
 
     my $const = ( $self->{flags}{dynpmc} ) ? " " : " const ";
-    if ( @$multi_funcs ) {
-        $cout .= $multi_strings . <<"EOC";
-
-   $const multi_func_list _temp_multi_func_list[] = {
-        $multi_list
-    };
-EOC
-    }
 
     my $flags = $self->vtable_flags;
     $cout .= <<"EOC";
@@ -640,6 +627,7 @@
             vt_${k}                 = Parrot_${classname}_${k}_get_vtable(interp);
             vt_${k}->base_type      = $enum_name;
             vt_${k}->flags          = $k_flags;
+
             vt_${k}->attribute_defs = attr_defs;
 
             vt_${k}->base_type           = entry;
@@ -666,12 +654,12 @@
 
         {
             /* Register this PMC as a HLL mapping */
-            const INTVAL pmc_id = Parrot_get_HLL_id( interp, CONST_STRING_GEN(interp, "$hll"));
-            if (pmc_id > 0) {
+            const INTVAL hll_id = Parrot_get_HLL_id( interp, CONST_STRING_GEN(interp, "$hll"));
+            if (hll_id > 0) {
 EOC
         foreach my $maps ( sort keys %{ $self->{flags}{maps} } ) {
             $cout .= <<"EOC";
-                Parrot_register_HLL_type( interp, pmc_id, enum_class_$maps, entry);
+                Parrot_register_HLL_type( interp, hll_id, enum_class_$maps, entry);
 EOC
         }
         $cout .= <<"EOC";
@@ -728,7 +716,11 @@
 
 
     if ( @$multi_funcs ) {
-        $cout .= <<"EOC";
+        $cout .= $multi_strings . <<"EOC";
+
+            $const multi_func_list _temp_multi_func_list[] = {
+                $multi_list
+            };
 #define N_MULTI_LIST (sizeof(_temp_multi_func_list)/sizeof(_temp_multi_func_list[0]))
             Parrot_mmd_add_multi_list_from_c_args(interp,
                 _temp_multi_func_list, N_MULTI_LIST);
@@ -761,6 +753,22 @@
     my $classname = $self->name;
     my $export = $self->is_dynamic ? 'PARROT_DYNEXT_EXPORT ' : 'PARROT_EXPORT';
 
+    # Sets the attr_size field:
+    # If the auto_attrs flag is set, use the current data,
+    # else check if this PMC has init or init_pmc vtable functions,
+    # setting it to 0 in that case, and keeping the value from the
+    # parent otherwise.
+    my $set_attr_size = '';
+    if ( @{$self->attributes} && $self->{flags}{auto_attrs} ) {
+        $set_attr_size .= "sizeof(Parrot_${classname}_attributes)";
+    }
+    else {
+        $set_attr_size .= "0" if exists($self->{has_method}{init}) ||
+                                 exists($self->{has_method}{init_pmc});
+    }
+    $set_attr_size =     "    vt->attr_size = " . $set_attr_size . ";\n"
+        if $set_attr_size ne '';
+
     my $vtable_updates = '';
     for my $name ( @{ $self->vtable->names } ) {
         if (exists $self->{has_method}{$name}) {
@@ -768,6 +776,8 @@
         }
     }
 
+    $vtable_updates .= $set_attr_size;
+
     $cout .= <<"EOC";
 
 $export
@@ -793,6 +803,8 @@
         }
     }
 
+    $vtable_updates .= $set_attr_size;
+
     $cout .= <<"EOC";
 
 $export
@@ -1095,7 +1107,7 @@
     elsif ($letter eq 'P') {
         return (
             'PPP->P',
-            'PMC *retval;',
+            'PMC *retval = PMCNULL;',
             ", &retval",
             "return retval;",
         );

Modified: branches/orderedhash_revamp/lib/Parrot/Pmc2c/Parser.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Pmc2c/Parser.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Pmc2c/Parser.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -68,8 +68,7 @@
 
     my $filebase = basename($filename);
     $filebase =~ s/\.pmc$//;
-    # Note: this can be changed to a die() after the 1.4 release. (TT #665)
-    warn("PMC filename $filebase.pmc does not match pmclass name $pmcname!\n")
+    die("PMC filename $filebase.pmc does not match pmclass name $pmcname!\n")
         unless lc($filebase) eq lc($pmcname);
     my $pmc = Parrot::Pmc2c::PMC->create($pmcname);
     $pmc->preamble( Parrot::Pmc2c::Emitter->text( $preamble, $filename, 1 ) );
@@ -146,6 +145,9 @@
           | \(\*\w*\)\(.*?\)
         )
 
+        # Array size
+        (\[\d+\])?
+
         # modifiers
         \s*
         ((?::\w+\s*)*)
@@ -159,19 +161,21 @@
     }sx;
 
     while ($pmcbody =~ s/($attr_re)//o) {
-        my ($type, $name, @modifiers, $comment);
+        my ($type, $name, $array_size, @modifiers, $comment);
         $type = $2;
         $name = $3;
-        @modifiers = split /\s/, $4;
-        $comment = $5;
+        $array_size = $4 || '';
+        @modifiers = split /\s/, $5;
+        $comment = $6;
 
         $lineno += count_newlines($1);
 
         $pmc->add_attribute(Parrot::Pmc2c::Attribute->new(
             {
-                name      => $name,
-                type      => $type,
-                modifiers => \@modifiers,
+                name       => $name,
+                type       => $type,
+                array_size => $array_size,
+                modifiers  => \@modifiers,
             }
         ));
     }

Modified: branches/orderedhash_revamp/lib/Parrot/Pmc2c/UtilFunctions.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Pmc2c/UtilFunctions.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Pmc2c/UtilFunctions.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -14,6 +14,17 @@
     passable_args_from_parameter_list
 );
 
+=head1 NAME
+
+Parrot::Pmc2c::UtilFunctions
+
+=head1 DESCRIPTION
+
+Various utility functions used in PMC to C transformations.  All functionas
+are exported on request only.
+
+=head1 SUBROUTINES
+
 =over 4
 
 =item C<passable_args_from_parameter_list( $parms )>
@@ -275,9 +286,19 @@
 }
 
 sub filename {
-    my ( $filename, $type ) = @_;
+    my ( $filename, $type, $is_dynamic ) = @_;
 
-    $filename =~ s/(\w+)\.\w+$/pmc_$1.h/ if ( $type eq ".h" );
+    $filename =~ s/\\/\//g;
+
+    # Core PMC emit header files inside include/pmc. All others in original directory
+    if ($type eq '.h') {
+        if (defined ($is_dynamic) && $is_dynamic) {
+            $filename =~ s{(\w+)\.\w+$}{pmc_$1.h};
+        }
+        else {
+            $filename =~ s{(?:.*/)?(\w+)\.\w+$}{include/pmc/pmc_$1.h};
+        }
+    }
     $filename =~ s/\.\w+$/.c/            if ( $type eq ".c" );
     $filename =~ s/\.\w+$/.dump/         if ( $type eq ".dump" );
     $filename =~ s/\.\w+$/.pmc/          if ( $type eq ".pmc" );

Modified: branches/orderedhash_revamp/lib/Parrot/Revision.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Revision.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Revision.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -83,9 +83,11 @@
     my $revision = 0;
     # code taken from pugs/util/version_h.pl rev 14410
     # modified because in xml output commit and entry revision
-    # are difficult to distinguih in a simplified parsing
+    # are difficult to distinguish in a simplified parsing
     my $nul = File::Spec->devnull;
-    local $ENV{LANG} = 'C';
+    # Avoid locale troubles with svn messages
+    local $ENV{LANG}   = 'C';
+    local $ENV{LC_ALL} = 'C';
     if ( my @svn_info = qx/svn info 2>$nul/ and $? == 0 ) {
         if ( my ($line) = grep /^Revision:/, @svn_info ) {
             ($revision) = $line =~ /(\d+)/;

Modified: branches/orderedhash_revamp/lib/Parrot/Test.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Test.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Test.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -100,6 +100,11 @@
 the output with the unexpected result is false I<and> if Parrot exits with a
 non-zero exit code.
 
+=item C<pasm_exit_code_is($code, $exit_code, $description)>
+
+Runs the PASM code and passes the test if the exit code equals $exit_code,
+fails the test otherwise.
+
 =item C<pir_output_is($code, $expected, $description)>
 
 Runs the PIR code and passes the test if a string comparison of output with the
@@ -130,6 +135,11 @@
 the unexpected result is false I<and> if Parrot exits with a non-zero exit
 code.
 
+=item C<pir_exit_code_is($code, $exit_code, $description)>
+
+Runs the PIR code and passes the test if the exit code equals $exit_code,
+fails the test otherwise.
+
 =item C<pbc_output_is($code, $expected, $description)>
 
 Runs the Parrot Bytecode and passes the test if a string comparison of output
@@ -161,6 +171,11 @@
 with the unexpected result is false I<and> if Parrot exits with a non-zero exit
 code.
 
+=item C<pbc_exit_code_is($code, $exit_code, $description)>
+
+Runs the Parrot Bytecode and passes the test if the exit code equals $exit_code,
+fails the test otherwise.
+
 =item C<pir_2_pasm_is($code, $expected, $description)>
 
 Compile the Parrot Intermediate Representation and generate Parrot Assembler Code.
@@ -249,7 +264,6 @@
 
 Generate functions that are only used by a couple of
 Parrot::Test::<lang> modules.
-See RT#43266.
 This implementation is experimental and currently only works
 for languages/pipp.
 
@@ -275,7 +289,7 @@
 require Test::Builder;
 require Test::More;
 
-our @EXPORT = qw( plan run_command skip slurp_file);
+our @EXPORT = qw( plan run_command skip slurp_file pbc_postprocess_output_like );
 
 use base qw( Exporter );
 
@@ -492,6 +506,59 @@
     }
 }
 
+=over
+
+=item "pbc_postprocess_output_like"
+
+Takes a path to binary which will post process PBC, a file to run, the extension
+of the file, one regex or an array reference of regexes,  and an optional
+diagnostic message. This function generates PBC for the input file, then post
+processes this with the binary and captures the output. The output is then
+verified to match the single or multiple regular expressions given.
+
+    my $postprocess = File::Spec->catfile( ".", "pbc_dump" );
+    my $file  = 'foo.pir';
+    my $ext   = 'pir';
+    my $check = [ qr/has a foo/, qr/and a bar/ ];
+    pbc_postprocess_output_like ( $postprocess,
+                                  $file, $ext, $check,
+                                  "checking pbc_dump"
+                                );
+
+=back
+
+=cut
+
+sub pbc_postprocess_output_like {
+    my ( $postprocess, $file, $ext, $check, $diag ) = @_;
+    my $testno   = $builder->current_test() + 1;
+    my $codefn   = "$0.$testno.$ext";
+    my $pbcfn    = "$0.$testno.pbc";
+    my $stdoutfn = "$0.$testno.stdout";
+    my $f        = IO::File->new(">$codefn");
+    my $parrot   = File::Spec->catfile( ".", $PConfig{test_prog} );
+    $f->print($file);
+    $f->close();
+    system("$parrot -o $pbcfn $codefn 2>&1");
+    system("$postprocess $pbcfn >$stdoutfn 2>&1");
+    $f = IO::File->new($stdoutfn);
+
+    my $output = join( '', <$f> );
+
+    local $Test::Builder::Level = $Test::Builder::Level + 1;
+    unlink ($codefn, $pbcfn, $stdoutfn);
+    if (ref $check eq 'ARRAY') {
+        for my $regex (@$check) {
+            Test::More::like( $output, $regex, $diag );
+            $testno++;
+        }
+    }
+    else {
+        Test::More::like( $output, $check, $diag );
+    }
+
+}
+
 # The following methods are private.  They should not be used by modules
 # inheriting from Parrot::Test.
 
@@ -526,13 +593,13 @@
     # Name of the file with test code.
     # This depends on which kind of code we are testing.
     my $code_f;
-    if ( $func =~ m/^pir_.*?output/ ) {
+    if ( $func =~ m/^pir_(exit_code|.*?output)/ ) {
         $code_f = per_test( '.pir', $test_no );
     }
-    elsif ( $func =~ m/^pasm_.*?output_/ ) {
+    elsif ( $func =~ m/^pasm_(exit_code|.*?output_)/ ) {
         $code_f = per_test( '.pasm', $test_no );
     }
-    elsif ( $func =~ m/^pbc_.*?output_/ ) {
+    elsif ( $func =~ m/^pbc_(exit_code|.*?output_)/ ) {
         $code_f = per_test( '.pbc', $test_no );
     }
     else {
@@ -631,6 +698,7 @@
     my %parrot_test_map = map {
         $_ . '_output_is'           => 'is_eq',
         $_ . '_error_output_is'     => 'is_eq',
+        $_ . '_exit_code_is'        => 'is_eq',
         $_ . '_output_isnt'         => 'isnt_eq',
         $_ . '_error_output_isnt'   => 'isnt_eq',
         $_ . '_output_like'         => 'like',
@@ -670,6 +738,18 @@
                 \$extra{todo}
                 if defined $extra{todo};
 
+            if ( $func =~ /_exit_code_is$/ ) {
+                $expected = int($expected);
+                if ($exit_code == $expected) {
+                    my $pass = $builder->$meth( $exit_code, $expected, $desc );
+                    return $pass;
+                }
+                else {
+                    $builder->ok(0);
+                    return 0;
+                }
+            }
+
             if ( $func =~ /_error_/ ) {
                 return _handle_error_output( $builder, $real_output, $expected, $desc )
                     unless $exit_code;
@@ -964,6 +1044,10 @@
                     . "$PConfig{ld_out}$exe_f "
                     . "$obj_f $cfg "
                     . "$PConfig{libparrot_linkflags} "
+            # If rpath is defined (and therefore rpath_blib), use it to get at the build libraries
+            . ( defined($PConfig{rpath_blib})
+            ? (  $PConfig{rpath_blib} . " " )
+            : "" )
                     . "$PConfig{linkflags} $PConfig{ld_debug} "
                     . "$iculibs $PConfig{libs}";
                 my $exit_code = run_command(
@@ -1039,7 +1123,7 @@
 
     my $out = $options->{'STDOUT'} || '';
     my $err = $options->{'STDERR'} || '';
-    ##  File::Temp overloads 'eq' here, so we need the quotes. RT #58840
+    ##  File::Temp overloads 'eq' here, so we need the quotes.
     if ( $out and $err and "$out" eq "$err" ) {
         $err = '&STDOUT';
     }

Deleted: branches/orderedhash_revamp/lib/Parrot/Test/Cardinal.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Test/Cardinal.pm	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,93 +0,0 @@
-# $Id$
-
-package Parrot::Test::Cardinal;
-
-# Copyright (C) 2006-2007, Parrot Foundation.
-
-use strict;
-use warnings;
-
-use File::Basename;
-
-=head1 Parrot::Test::Cardinal
-
-Provide language specific testing routines here...
-
-This is currently alarmingly similar to the generated subs in Parrot::Test.
-Perhaps someone can do a better job of delegation here.
-
-=cut
-
-sub new {
-    return bless {};
-}
-
-sub output_is {
-    my ( $self, $code, $output, $desc ) = @_;
-
-    my $count = $self->{builder}->current_test + 1;
-    $desc = 'Cardinal Test' unless $desc;
-
-    my $lang_f         = File::Spec->rel2abs( Parrot::Test::per_test( '.rb',           $count ) );
-    my $out_f          = File::Spec->rel2abs( Parrot::Test::per_test( '.out',          $count ) );
-    my $cardinal_out_f = File::Spec->rel2abs( Parrot::Test::per_test( '.cardinal.out', $count ) );
-    my $cardinal_out_debug_f =
-        File::Spec->rel2abs( Parrot::Test::per_test( '.cardinal.debug.out', $count ) );
-    my $parrotdir = dirname $self->{parrot};
-
-    Parrot::Test::write_code_to_file( $code, $lang_f );
-
-    my $args = $ENV{TEST_PROG_ARGS} || '';
-
-    my $ruby_cmd       = "ruby $lang_f";
-    my $ruby_exit_code = Parrot::Test::run_command(
-        $ruby_cmd,
-        CD     => $self->{relpath},
-        STDOUT => $out_f,
-        STDERR => $out_f
-    );
-    my $ruby_output = Parrot::Test::slurp_file($out_f);
-
-    my $cardinal_cmd       = "$self->{parrot} $args languages/cardinal/cardinal.pbc $lang_f";
-    my $cardinal_exit_code = Parrot::Test::run_command(
-        $cardinal_cmd,
-        CD     => $self->{relpath},
-        STDOUT => $cardinal_out_f,
-        STDERR => $cardinal_out_f
-    );
-    my $cardinal_output = Parrot::Test::slurp_file($cardinal_out_f);
-
-    my $pass = $self->{builder}->is_eq( $cardinal_output, $ruby_output, $desc );
-    $self->{builder}->diag("'$ruby_cmd' failed with exit code $ruby_exit_code")
-        if $ruby_exit_code and not $pass;
-    $self->{builder}->diag("'$cardinal_cmd' failed with exit code $cardinal_exit_code")
-        if $cardinal_exit_code and not $pass;
-
-    if ( not $pass ) {
-        my $cardinal_debug_cmd = "$self->{parrot} $args languages/cardinal/cardinal.pbc -d $lang_f";
-        my $cardinal_debug_exit_code = Parrot::Test::run_command(
-            $cardinal_debug_cmd,
-            CD     => $self->{relpath},
-            STDOUT => $cardinal_out_debug_f,
-            STDERR => $cardinal_out_debug_f
-        );
-        my $cardinal_debug_output = Parrot::Test::slurp_file($cardinal_out_debug_f);
-    }
-
-    unless ( $ENV{POSTMORTEM} ) {
-
-        #unlink $lang_f;
-        unlink $out_f;
-        unlink $cardinal_out_f;
-    }
-    return $pass;
-}
-
-1;
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/lib/Parrot/Test/Harness.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Test/Harness.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Test/Harness.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -55,7 +55,7 @@
 Written by chromatic with most of the intelligence stolen from the Punie
 harness and most of that probably stolen from Test::Harness
 
-Please send patches and bug reports via Parrot's RT queue or to the mailing
+Please send patches and bug reports via Parrot's Trac queue or to the mailing
 list.
 
 =cut

Modified: branches/orderedhash_revamp/lib/Parrot/Test/PIR_PGE.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Test/PIR_PGE.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Test/PIR_PGE.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -14,8 +14,10 @@
 
 Parrot::Test::PIR_PGE -- testing routines for languages/PIR
 
+=head1 DESCRIPTION
+
 This is largely a copy of Parrot::Test::Punie, which is also a copy
-of something...
+of something ...
 
 This module is named PIR_PGE, because PIR is a "reserved" name,
 for internal use only.

Deleted: branches/orderedhash_revamp/lib/Parrot/Test/Perl6.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Test/Perl6.pm	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,168 +0,0 @@
-# $Id$
-
-# Copyright (C) 2006-2007, Parrot Foundation.
-
-=head1 NAME
-
-Parrot::Test::Perl6 -- testing routines for languages/perl6
-
-=head1 SYNOPSIS
-
-    use Parrot::Test::Perl6 tests => 3;
-
-    perl6_output_is(<<'CODE', <<'OUTPUT', 'hello, world!');
-    say 'hello, world!';
-    CODE
-    hello, world!
-    OUTPUT
-
-    perl6_stderr_like($code, qr/$expected/, $desc);
-
-    perl6_stdout_isnt($code, qr/$expected/, $desc);
-
-=head1 DESCRIPTION
-
-This module provides Perl6 test functions. It has been heavily refactored
-from Parrot::Test. Hopefully,similar refactoring will be carried out in
-Parrot::Test someday soon.
-
-=cut
-
-package Parrot::Test::Perl6;
-
-use strict;
-use warnings;
-
-use File::Basename;
-use File::Spec;
-use Parrot::Config;
-
-require Exporter;
-require Parrot::Test;
-require Test::Builder;
-require Test::More;
-
-our @EXPORT = qw( plan skip );
-
-my $lang    = 'perl6';
-my $streams = {
-    output => sub { return ( STDOUT => $_[0],               STDERR => $_[0] ) },
-    stdout => sub { return ( STDOUT => $_[0],               STDERR => File::Spec->devnull ) },
-    stderr => sub { return ( STDOUT => File::Spec->devnull, STDERR => $_[0] ) },
-};
-my $tests = {
-    is   => 'is_eq',
-    like => 'like',
-    isnt => 'isnt_eq',
-};
-
-## create a map of test names and info
-my $test_map = {};
-for my $t ( keys %{$tests} ) {
-    for my $s ( keys %$streams ) {
-        $test_map->{ join( '_' => $lang, $s, $t ) } = {
-            lang   => $lang,
-            stream => { name => $s, data => $streams->{$s}, },
-            test   => { name => $t, data => $tests->{$t}, },
-        };
-    }
-}
-
-push @EXPORT => keys %{$test_map};
-
-use base qw( Parrot::Test Exporter );
-
-my $b = Test::Builder->new();
-
-my $path_to_parrot = $INC{"Parrot/Config.pm"};
-$path_to_parrot =~ s:lib/Parrot/Config.pm$::;
-$path_to_parrot = File::Spec->curdir()
-    if $path_to_parrot eq '';
-
-my $parrot = File::Spec->catfile( $path_to_parrot, 'parrot' . $PConfig{exe} );
-
-my $perl6 = File::Spec->catfile( $path_to_parrot, qw/ languages perl6 p6shell.pir /, );
-
-sub import {
-    my ( $class, $plan, @args ) = @_;
-    $b->plan( $plan, @args );
-    __PACKAGE__->export_to_level( 2, __PACKAGE__ );
-}
-
-sub set_test_info {
-    my $next_test_num = 1 + $b->current_test();
-    my $f_out         = Parrot::Test::per_test( '.out', $next_test_num );
-    my $f_code        = Parrot::Test::per_test( '.p6', $next_test_num );
-    $f_code = File::Spec->rel2abs($f_code);
-
-    return ( $next_test_num, $f_out, $f_code );
-}
-
-sub _generate_functions {
-    my ($package) = @_;
-
-    for my $func ( keys %$test_map ) {
-        no strict 'refs';
-
-        *{ $package . '::' . $func } = sub ($$;$%) {
-            my ( $code, $expected, $desc, %extra ) = @_;
-
-            Parrot::Test::convert_line_endings($code);
-
-            ## set a default description
-            $desc = sprintf '(%s line %s)' => ( caller() )[ 1, 2 ]
-                unless $desc;
-
-            my ( $test_num, $f_out, $f_code ) = set_test_info();
-
-            ## get test arguments from environment
-            my $args = $ENV{TEST_PROG_ARGS} || '';
-
-            Parrot::Test::write_code_to_file( $code, $f_code );
-
-            ## build the command and set the run options
-            my $cmd         = qq{$parrot $args $perl6 "$f_code"};
-            my $run_options = {
-                CD => '.',
-                $test_map->{$func}->{stream}->{data}->($f_out),
-            };
-
-            ## run the command and capture the exit code
-            my $exit_code = Parrot::Test::run_command( $cmd, %{$run_options}, );
-
-            ## read in the command output
-            my $actual_output = Parrot::Test::slurp_file($f_out);
-
-            ## tell Test::Builder if the test is marked as a todo-item
-            my $call_pkg = $b->exported_to() || '';
-            local *{ $call_pkg . '::TODO' } = ## no critic Variables::ProhibitConditionalDeclarations
-                \$extra{todo}
-                if defined $extra{todo};
-
-            ## run Test::Builder's test on actual vs. expected output
-            my $method = $test_map->{$func}->{test}->{data};
-            my $pass = $b->$method( $actual_output, $expected, $desc );
-
-            ## print diagnostic info if the test fails
-            $b->diag("'$cmd' failed with exit code $exit_code")
-                if $exit_code and not $pass;
-
-            unless ( $ENV{POSTMORTEM} ) {
-                unlink $f_out;
-            }
-
-            return $pass;
-        };
-    }
-}
-
-__PACKAGE__->_generate_functions();
-
-$_ ^= ~{ AUTHOR => 'particle' };
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/lib/Parrot/Test/Pod.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Test/Pod.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Test/Pod.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,25 @@
 # Copyright (C) 2009, Parrot Foundation.
 # $Id$
+
+=head1 NAME
+
+Parrot::Test::Pod - Utilities for tests which test POD
+
+=head1 SYNOPSIS
+
+    use Parrot::Test::Pod;
+
+    $self = Parrot::Test::Pod->new( {
+        argv => [ @ARGV ],
+    } );
+
+=head1 DESCRIPTION
+
+This module provides utilities for tests in the Parrot test suite which test
+the validity of documentation written in the POD format.
+
+=cut
+
 package Parrot::Test::Pod;
 use strict;
 use warnings;
@@ -45,13 +65,13 @@
                 if ($full_file =~ m{
                         t/tools/dev/searchops/samples\.pm
                         | languages/pod/test\.pod
-                        | xconf/samples/yourfoobar
+                        | examples/config/file/configcompiler
                         | t/configure/testlib/verbosefoobar
                         | t/configure/testlib/ddefectivefoobar
                         | t/configure/testlib/adefectivefoobar
                         | t/configure/testlib/cdefectivefoobar
                         | t/configure/testlib/bdefectivefoobar
-                        | xconf/samples/testfoobar
+                        | examples/config/file/configwithfatalstep
                     }x
                 ) {
                     delete $files_needing_analysis->{ $file };
@@ -93,28 +113,19 @@
     },
 );
 
-=head1 Parrot::Test::Pod
-
-Utilities for tests which test POD.
-
-=head2 Synopsis
+=head1 METHODS
 
-    use Parrot::Test::Pod;
-
-=head2 Description
+=head2 C<new()>
 
-This module provides utilities for tests in the Parrot test suite which test
-the validity of documentation written in the POD format.
+B<Purpose:>  Parrot::Test::Pod constructor.
 
-All subroutines herein are exported only on demand.
+B<Arguments:>  Hash reference holding, at a minimum, one elemente keyed by
+C<argv>, whose value is typically a reference to C<@ARGV>.
 
-=head2 Functions
+B<Return Value:>  Parrot::Test::Pod object.
 
 =cut
 
-# RT #44437 this should really be using src_dir instead of build_dir but it
-# does not exist (yet)
-
 sub new {
     my $class = shift;
     my $args = shift;
@@ -132,12 +143,10 @@
     return bless $args, $class;
 }
 
-=head3 C<identify_files_for_POD_testing()>
-
-B<Purpose:>
+=head2 C<identify_files_for_POD_testing()>
 
-Identifies files in the Parrot distribution which are likely to merit
-examination for the validity of their POD.
+B<Purpose:> Identifies files in the Parrot distribution which are likely to
+merit examination for the validity of their POD.
 
 The subroutine itself does a first pass at that process, and takes as one of
 its arguments a reference to a subroutine which does a second such pass.
@@ -148,12 +157,10 @@
         second_analysis => 'oreilly_summary_malformed',
     } );
 
-B<Return Value:>
-
-A reference to a hash where each element's key is the path to a file deemed
-needing examination for the validity of its POD.  The element's value is
-either C<1> or C<2>, depending on whether it was seen in F<MANIFEST> or
-F<MANIFEST.generated> or both.
+B<Return Value:> A reference to a hash where each element's key is the path to
+a file deemed needing examination for the validity of its POD.  The element's
+value is either C<1> or C<2>, depending on whether it was seen in F<MANIFEST>
+or F<MANIFEST.generated> or both.
 
 B<Comment:> The first time this subroutine is invoked, it creates a Storable
 file in the top-level Parrot directory called F<.pod_examinable.sto>.  That
@@ -239,11 +246,9 @@
     return [ keys %{ $files_needing_analysis } ];
 }
 
-=head3 C<oreilly_summary_malformed()>
-
-B<Purpose:>
+=head2 C<oreilly_summary_malformed()>
 
-An instance of the "second pass" type of subroutine passed to
+B<Purpose:>  An instance of the "second pass" type of subroutine passed to
 C<identify_files_for_POD_testing()> C<second_analysis> argument.
 
 In this instance, we omit:
@@ -280,14 +285,12 @@
 
 =back
 
-B<Return Value:>
-
-Reference to hash of files meriting analysis, I<i.e.,> the results of the
-first pass minus the results of the second pass.
+B<Return Value:> Reference to hash of files meriting analysis, I<i.e.,> the
+results of the first pass minus the results of the second pass.
 
 =cut
 
-=head2 Author
+=head1 AUTHOR
 
 James E Keenan, refactored from earlier code
 

Modified: branches/orderedhash_revamp/lib/Parrot/Vtable.pm
==============================================================================
--- branches/orderedhash_revamp/lib/Parrot/Vtable.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/lib/Parrot/Vtable.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2008, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
 =head1 NAME
@@ -11,9 +11,9 @@
 
 =head1 DESCRIPTION
 
-C<Parrot::Vtable> provides a collection of functions for manipulating
-PMC vtables. It is used by F<tools/build/jit2c.pl>, F<tools/build/pmc2c.pl>,
-F<tools/build/vtable_h.pl>, F<tools/dev/gen_class.pl>.
+C<Parrot::Vtable> provides a collection of functions for manipulating PMC
+vtables. It is used by F<tools/build/pmc2c.pl>, F<tools/build/vtable_h.pl>, and
+F<tools/dev/gen_class.pl>.
 
 =head2 Functions
 
@@ -169,7 +169,7 @@
     PMC    *_namespace;     /* Pointer to namespace for this class */
     INTVAL  base_type;      /* 'type' value for MMD */
     STRING *whoami;         /* Name of class this vtable is for */
-    UINTVAL flags;          /* Flags. Duh */
+    UINTVAL flags;          /* VTABLE flags (constant, is_ro, etc). */
     STRING *provides_str;   /* space-separated list of interfaces */
     Hash   *isa_hash;       /* Hash of class names */
     PMC    *pmc_class;      /* for PMCs: a PMC of that type
@@ -186,6 +186,10 @@
         $struct .= "    $entry->[1]_method_t $entry->[1];\n";
     }
 
+    $struct .= <<'EOF';
+    UINTVAL attr_size;      /* Size of the attributes struct */
+EOF
+
     $struct .= "} _vtable;\n";
 
     return $struct;
@@ -220,29 +224,24 @@
     (pmc)->vtable->$entry->[1]($args)
 EOM
     }
-    $macros .= <<'EOM';
-
+    # Slot numbers
+    $macros .= <<"EOM";
 /*
- * vtable method name defines for delegate
+ * vtable slot names
  */
-
 EOM
+    my $vtable_slot_num = 9;
     for my $entry ( @{$vtable} ) {
         my $uc_meth = uc $entry->[1];
         $macros .= <<"EOM";
-#define PARROT_VTABLE_${uc_meth}_METHNAME \"$entry->[1]\"
+#define PARROT_VTABLE_SLOT_${uc_meth} ${vtable_slot_num}
 EOM
-
+        ++$vtable_slot_num;
     }
-    $macros .= <<'EOM';
-
-EOM
 
     # finally the name mapping
     $macros .= <<'EOM';
-/*
- * vtable slot names
- */
+
 #ifdef PARROT_IN_OBJECTS_C
 
 #define PARROT_VTABLE_LOW 9
@@ -251,7 +250,7 @@
     "",   /* Pointer to namespace for this class */
     "",   /* 'type' value for MMD */
     "",   /* Name of class this vtable is for */
-    "",   /* Flags. Duh */
+    "",   /* VTABLE flags (constant, is_ro, etc). */
     "",   /* space-separated list of interfaces */
     "",   /* space-separated list of classes */
     "",   /* class */
@@ -275,48 +274,6 @@
 #define NUM_VTABLE_FUNCTIONS $num_vtable_funcs
 
 #endif /* PARROT_IN_OBJECTS_C */
-
-/* Need this for add, subtract, multiply, divide, mod, cmod, bitwise
-   (and, or, xor, lshift, rshift), concat, logical (and, or, xor),
-   repeat, eq, cmp */
-
-/* &gen_from_enum(mmd.pasm) */
-
-typedef enum {
-EOM
-    for my $entry ( @{$vtable} ) {
-        next unless ( $entry->[4] =~ /MMD_/ );
-        next if ( $entry->[4] =~ /_INT$/ );
-        next if ( $entry->[4] =~ /_STR$/ );
-        next if ( $entry->[4] =~ /_FLOAT$/ );
-        $macros .= <<"EOM";
-        $entry->[4],
-EOM
-    }
-    $macros .= <<'EOM';
-        MMD_USER_FIRST
-} parrot_mmd_func_enum;
-
-/* &end_gen */
-
-#ifdef PARROT_IN_OBJECTS_C
-static PARROT_OBSERVER const char * const Parrot_mmd_func_names[] = {
-EOM
-
-    for my $entry ( @{$vtable} ) {
-        next unless ( $entry->[4] =~ /MMD_/ );
-        next if ( $entry->[4] =~ /_INT$/ );
-        next if ( $entry->[4] =~ /_STR$/ );
-        next if ( $entry->[4] =~ /_FLOAT$/ );
-        $macros .= <<"EOM";
-        \"$entry->[1]\",
-EOM
-    }
-    $macros .= <<"EOM";
-    NULL
-};
-
-#endif /* PARROT_IN_OBJECTS_C */
 EOM
 
     $macros;

Modified: branches/orderedhash_revamp/ports/cygwin/README
==============================================================================
--- branches/orderedhash_revamp/ports/cygwin/README	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/ports/cygwin/README	Sat Jan 23 01:49:53 2010	(r43541)
@@ -732,7 +732,6 @@
  /usr/lib/parrot/1.0.0/include/iotypes.pasm
  /usr/lib/parrot/1.0.0/include/iterator.pasm
  /usr/lib/parrot/1.0.0/include/longopt.pasm
- /usr/lib/parrot/1.0.0/include/mmd.pasm
  /usr/lib/parrot/1.0.0/include/opengl_defines.pasm
  /usr/lib/parrot/1.0.0/include/parrotlib.pbc
  /usr/lib/parrot/1.0.0/include/pmctypes.pasm

Modified: branches/orderedhash_revamp/ports/debian/changelog
==============================================================================
--- branches/orderedhash_revamp/ports/debian/changelog	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/ports/debian/changelog	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,3 +1,13 @@
+parrot (1.4.0-1) unstable; urgency=low
+  * New upstream release
+  * debian/rules:
+    - New upstream configuration option --disable-rpath allows packages to
+      be built without rpath.
+  * parrot-devel.install.in
+    - Install pbc_to_exe binary and supporting library.
+
+ -- Allison Randal <allison at parrot.org>  Fri, 24 Jul 2009 23:54:07 -0700
+
 parrot (1.0.0-1) unstable; urgency=low
   * New upstream release
   * debian/control.in:

Modified: branches/orderedhash_revamp/ports/debian/parrot-devel.install.in
==============================================================================
--- branches/orderedhash_revamp/ports/debian/parrot-devel.install.in	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/ports/debian/parrot-devel.install.in	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,8 +1,8 @@
 usr/bin/parrot_debugger
 usr/bin/pbc_disassemble
 usr/bin/pbc_dump
-usr/bin/pbc_info
 usr/bin/pbc_merge
+usr/bin/pbc_to_exe
 usr/bin/parrot_config
 usr/lib/parrot/@VERSION@/tools/*
 usr/lib/parrot/@VERSION@/languages/nqp/*
@@ -20,5 +20,6 @@
 usr/lib/parrot/@VERSION@/languages/tge/*
 usr/lib/parrot/@VERSION@/library/TGE.pbc
 usr/lib/parrot/@VERSION@/VERSION
+usr/lib/parrot/@VERSION@/parrot_config.o
 usr/include/parrot/@VERSION@/pmc/*
 usr/src/parrot/@VERSION@/*

Modified: branches/orderedhash_revamp/ports/debian/rules
==============================================================================
--- branches/orderedhash_revamp/ports/debian/rules	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/ports/debian/rules	Sat Jan 23 01:49:53 2010	(r43541)
@@ -31,27 +31,27 @@
 configure: configure-stamp
 configure-stamp: debian-control-stamp
 	dh_testdir
-	perl Configure.pl --prefix=/usr
+	perl Configure.pl --prefix=/usr --disable-rpath
 	touch configure-stamp
 
 build: build-stamp
 
 build-stamp: configure-stamp 
 	dh_testdir
-	$(MAKE) installable
+	$(MAKE) installable LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}`pwd`/blib/lib
 	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" tools/util/parrot-config.pir debian/parrot_config.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
 	pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/pbc_merge.c debian/pbc_merge.1
+	pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" tools/dev/pbc_to_exe.pir debian/pbc_to_exe.1
 	touch build-stamp
 
 clean: debian-control-stamp
 	dh_testdir
 	dh_testroot
-	rm -f build-stamp configure-stamp debian-control-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/main.o installable_pbc_to_exe ext/Parrot-Embed/Makefile.PL test.c test.ldo
+	rm -f build-stamp configure-stamp debian-control-stamp debian/parrot.1 debian/parrot_config.1 debian/pbc_dump.1 debian/pbc_disassemble.1 debian/parrot-debugger.1 debian/pbc_merge.1 debian/libparrot$(SOVERSION).install src/main.o installable_pbc_to_exe ext/Parrot-Embed/Makefile.PL test.c test.ldo
 	[ ! -f Makefile ] || $(MAKE) distclean
 	dh_clean 
 
@@ -89,7 +89,7 @@
 	dh_testroot -a
 	dh_installchangelogs -a ChangeLog
 	dh_installman -pparrot-minimal debian/parrot.1
-	dh_installman -pparrot-devel debian/parrot_debugger.1 debian/pbc_disassemble.1 debian/pbc_dump.1 debian/pbc_info.1 debian/pbc_merge.1 debian/parrot_config.1
+	dh_installman -pparrot-devel debian/parrot_debugger.1 debian/pbc_disassemble.1 debian/pbc_dump.1 debian/pbc_merge.1 debian/parrot_config.1 debian/pbc_to_exe.1
 	dh_installdocs -a
 	dh_strip -a
 	dh_compress -a

Added: branches/orderedhash_revamp/ports/fedora/parrot-1.x.0.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/ports/fedora/parrot-1.x.0.patch	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,38 @@
+--- tools/dev/install_files.pl	2009-07-13 10:26:40.000000000 +0200
++++ tools/dev/install_files.pl	2009-07-13 13:37:49.000000000 +0200
+@@ -163,7 +163,7 @@
+             # libdir as it is typically done with automake installed packages.
+             # If there is a use case to make this configurable we'll add a
+             # seperate --pkgconfigdir option.
+-            $filehash->{DestDirs} = ['pkgconfig', $parrotdir];
++            $filehash->{DestDirs} = ['pkgconfig'];
+             return($filehash);
+         },
+     },
+--- config/gen/makefiles/parrot_pc.in	2009-06-06 16:33:32.000000000 +0200
++++ config/gen/makefiles/parrot_pc.in.new	2009-07-13 23:09:45.000000000 +0200
+@@ -7,4 +7,4 @@
+ Description: virtual machine to execute bytecode for interpreted languages
+ Version: @VERSION@
+ Libs: -L${libdir} -lparrot @icu_shared@ @libs@
+-Cflags: -I${includedir}
++Cflags: -I${includedir}@versiondir@
+--- lib/Parrot/Install.pm	2009-06-01 09:29:57.000000000 +0200
++++ lib/Parrot/Install.pm	2009-06-03 08:41:22.000000000 +0200
+@@ -220,6 +220,16 @@
+         else {
+             next unless -e $src;
+             next if $^O eq 'cygwin' and -e "$src.exe"; # stat works, copy not
++            if (-l $src) { 
++                # check if the system supports symbolic linking 
++                use Config; 
++                if ($Config{d_symlink} && $Config{d_readlink}) { 
++                # copy as symbolic link 
++                    symlink(readlink($src), $dest); 
++                    print "$dest\n"; 
++                    next; 
++                } 
++            } 
+             copy( $src, $dest ) or die "Error: couldn't copy $src to $dest: $!\n";
+             print "$dest\n";
+         }

Modified: branches/orderedhash_revamp/ports/fedora/parrot.spec.fedora
==============================================================================
--- branches/orderedhash_revamp/ports/fedora/parrot.spec.fedora	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/ports/fedora/parrot.spec.fedora	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,19 +1,25 @@
 Name:           parrot
-Version:        1.0.0
-Release:        6%{?dist}
+Version:        1.4.0
+Release:        9%{?dist}
 Summary:        Parrot is a virtual machine
 License:        Artistic 2.0
 Group:          Development/Libraries
 URL:            http://www.parrot.org/
 
 Source0:        ftp://ftp.parrot.org/pub/parrot/releases/stable/%{version}/parrot-%{version}.tar.gz
-# Without Patch0 %{_libdir}/libparrot.so would not be a symbolic link to
+
+Patch0:         parrot-1.x.0.patch
+# patches file:           tools/dev/install_files.pl
+# It is responsible to have no subdirectory under pkgconfig.
+#
+# patches file:           config/gen/makefiles/parrot_pc.in
+# So "pkg-config parrot --cflags" works correct
+#
+# see for upstream:       https://trac.parrot.org/parrot/ticket/509
+# patched file:           lib/Parrot/Install.pm
+# is to have the symlink:    libparrot.so  ->  libparrot.so.%{version}
+# Without this %{_libdir}/libparrot.so would not be a symbolic link to
 # %{_libdir}/libparrot.so.%{version}  
-# Symlink:  libparrot.so ->  libparrot.so.%{version}
-# See for upstream: https://trac.parrot.org/parrot/ticket/509
-# Extended for the package to have no subdirectory under pkgconfig
-Patch0:         parrot-install_files.patch
-Patch1:         parrot-1.0.0-rpath-removal.patch
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:  readline-devel
@@ -25,6 +31,7 @@
 BuildRequires:  perl(Test::Simple)
 BuildRequires:  ctags
 BuildRequires:  openssl-devel
+BuildRequires:  flex
  
 
 %package docs
@@ -32,6 +39,9 @@
 Group:          Documentation
 Requires:       perl(strict)
 Requires:       perl(warnings)
+BuildArch:      noarch
+
+#--
 
 %package devel
 Summary:        Parrot Virtual Machine development headers and libraries
@@ -39,47 +49,56 @@
 Requires:       %{name} = %{version}-%{release}
 Requires:       pkgconfig
 
+#--
+
 %package tools
 Summary:        Parrot Virtual Machine development for languages
 Group:          Development/Libraries
 Requires:       %{name} = %{version}-%{release}
 Requires:       perl(Pod::Simple)
-Requires:       perl(File::Which) = 0.05
+Requires:       perl(File::Which) >= 0.05
+Requires:       perl(Parrot::OpLib::core)
 # It is necessary to have installed the package "perl-Perl-Critic" to install
 # the parrot-tools
 Provides:       perl(Parrot::Pmc2c::MethodEmitter) = %{version}
 Provides:       perl(Parrot::Pmc2c::PCCMETHOD_BITS) = %{version}
 Provides:       perl(Parrot::Pmc2c::PMCEmitter) = %{version}
+Provides:       perl(Parrot::OpLib::core) = %{version}
+
 
 %description
 Parrot is a virtual machine designed to efficiently compile and execute
 bytecode for dynamic languages. Parrot is the target for Rakudo Perl 6,
 as well as variety of other languages.
 
+#--
+
 %description docs
 Documentation in text-, POD- and HTML-format (docs/html-subdirectory) and also
 examples about the Parrot Virtual Machine.
 
+#--
+
 %description devel
 Parrot Virtual Machine development headers and libraries.
 
+#--
+
 %description tools
 Parrot Virtual Machine development files for building languages.
 
+
 %prep
 %setup -q
 %patch0 -p0
-%patch1 -b .rpatch
 
-%{__perl} -pi -e 's,"lib/,"%{_lib}/, if (/CONST_STRING\(interp,/)' \
-    src/library.c
-%{__perl} -pi -e "s,'/usr/lib','%{_libdir}',;s,runtime/lib/,runtime/%{_lib}/," \
-    tools/dev/install_files.pl
+%{__perl} -pi -e "s,'/usr/lib','%{_libdir}'," tools/dev/install_files.pl
 
 
 cat << \EOF > %{name}-prov
 #!/bin/sh
-%{__perl_provides} $* | %{__sed} -e '/perl(A)/d' -e '/perl(B)/d' -e '/perl(DB)/d'
+%{__perl_provides} $* | %{__sed} -e '/perl(A)/d' -e '/perl(B)/d' \
+                            -e '/perl(DB)/d' -e '/perl(Parrot::OpLib::core)/d'
 EOF
 
 %global __perl_provides %{_builddir}/%{name}-%{version}/%{name}-prov
@@ -88,6 +107,13 @@
 
 %build
 %ifarch %{ix86} x86_64
+    RPM_OPT_FLAGS="$RPM_OPT_FLAGS -maccumulate-outgoing-args"
+%else
+# The PowerPC-architecture do not build with the '-maccumulate-outgoing-args'
+# option.
+    RPM_OPT_FLAGS="$RPM_OPT_FLAGS"
+%endif
+
 %{__perl} Configure.pl \
     --prefix=%{_usr} \
     --libdir=%{_libdir} \
@@ -96,18 +122,12 @@
     --mandir=%{_mandir} \
     --cc="%{__cc}" \
     --cxx=%{__cxx} \
-    --optimize="$RPM_OPT_FLAGS -maccumulate-outgoing-args" \
+    --optimize="$RPM_OPT_FLAGS" \
     --parrot_is_shared \
+    --disable-rpath \
     --lex=%{_bindir}/flex \
     --yacc=%{_bindir}/yacc \
     --libs='-lcurses -lm'
-%else
-# PowerPC, not all options work with the PowerPC-architecture, I do not test
-# which is not working   (Gerd)
-%{__perl} Configure.pl \
-    --prefix=%{_usr} \
-    --libdir=%{_libdir}
-%endif
 
 # The LDD_LIBRARY_PATH hack is needed for "miniparrot"
 # to find his parrot-library in "blib/lib" 
@@ -157,14 +177,13 @@
 find %{RPM_PAR_LIB_DIR}tools/dev -type f -name "pbc_to_exe.pir" \
     -exec %{__sed} -i -e '1 s&#! parrot&#!/usr/bin/parrot&' {} \; \
     -exec chmod 755 {} \;
-# This module is only needed for building and should not be installed (I think)
-# module "Parrot::OpLib::core"
-rm -rf %{RPM_PAR_LIB_DIR}tools/lib/Parrot/OpLib
 
 # Remove doc-files with zero-length
 find docs/html -type f -size 0 -exec rm -f {} \;
 
 # Set path for installed programs in docs package
+find examples/json -type f -name "*.pir" \
+    -exec %{__sed} -i -e '1 s&#!../../parrot&#!/usr/bin/parrot&' {} \;
 find examples -type f -name "*.pl" \
     -exec %{__sed} -i -e '1 s&#! perl&#!/usr/bin/perl&' {} \;
 find examples -wholename 'examples/pir/befunge/t/basic.t' \
@@ -189,22 +208,21 @@
 
 find examples/languages -type f -name harness \
     -exec %{__sed} -i -e '1 s&#! perl&#!/usr/bin/perl&' {} \;
-for file in docs/book/ch09_pct.pod docs/memory_internals.pod; do
+for file in docs/book/draft/ch05_pge.pod docs/memory_internals.pod; do
         %{__mv} $file timestamp
         iconv -f ISO-8859-1 -t UTF-8 -o $file timestamp
         touch -r timestamp $file
 done
 %{__rm} -f timestamp
 
-# These files *probably* aren't needed.
-rm -rf $RPM_BUILD_ROOT%{_usr}/config \
-    $RPM_BUILD_ROOT%{_includedir}/src \
-    $RPM_BUILD_ROOT%{_usr}/src 
 
 %check
+# 'make fulltest' is done by default; it take a lot of time
 export LD_LIBRARY_PATH=$( pwd )/blib/lib
-make test
-%{?_with_fulltest: make fulltest}
+FULL='full'
+%{?_without_fulltest: FULL=''}
+%{?!_without_tests: make ${FULL}test}
+
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -217,10 +235,7 @@
 %defattr(-,root,root,-)
 %doc ChangeLog CREDITS NEWS PBC_COMPAT PLATFORMS README
 %doc RESPONSIBLE_PARTIES TODO LICENSE
-%exclude %{_bindir}/parrot_config
-%exclude %{_bindir}/parrot_debugger
-%exclude %{_bindir}/pbc_*
-%{_bindir}/*
+%{_bindir}/parrot
 %{_libdir}/parrot/
 %exclude %{_libdir}/parrot/%{version}/tools
 %exclude %{_libdir}/parrot/%{version}/VERSION
@@ -241,7 +256,7 @@
 %{_bindir}/pbc_dump
 %{_includedir}/parrot
 %{_libdir}/libparrot.so
-%{_libdir}/libparrot.a
+%exclude %{_libdir}/libparrot.a
 %{_libdir}/pkgconfig/*
 
 %files tools
@@ -249,18 +264,27 @@
 # Files for building languages
 %{_libdir}/parrot/%{version}/tools/*
 %{_libdir}/parrot/%{version}/VERSION
-
+%{_usr}/src/parrot/*
 
 
 %changelog
-* Thu Apr 23 2009 Gerd Pokorra <gp at zimt.uni-siegen.de> 1.0.0-6
+* Sat Aug 1 2009 Gerd Pokorra <gp at zimt.uni-siegen.de> 1.4.0-9
+- ppc test included again
+- include the necessary module Parrot::Oplib::core
+- change the place of header files to /usr/include/parrrot/<version>
+- install the files /usr/src/parrot/*
+
+* Sat Jul 25 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.4.0-4
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
+
+* Tue Jul 21 2009 Gerd Pokorra <gp at zimt.uni-siegen.de> 1.4.0-1
+- add the new disable-rpath configure option
+
+* Wed Mar 25 2009 Gerd Pokorra <gp at zimt.uni-siegen.de> 1.0.0-6
 - add a list of changes from Lubomir Rintel
-- add patch to remove rpath
 - add filtering Provides
 - change requires for docs-subpackage
 - enable test suite
-
-* Wed Mar 25 2009 Gerd Pokorra <gp at zimt.uni-siegen.de> 1.0.0-5
 - change the group of the subpackage "-docs" to Documentation
 - put the main-documentation from the docs-package to the main package
 - LICENSE file added
@@ -271,6 +295,7 @@
 - define RPM_PAR_LIB_DIR added
 - add subpackage "tools"
 - exclude tools directory from main-package
+- added make html
 
 * Sun Mar 22 2009 Fabien Georget <fabien.georget at gmail.com> 1.0.0-4
 - add tools
@@ -279,10 +304,6 @@
 - Removed wrong prefix from pkgconfig per Christoph Wickert
 - Changed i386 to ix86 per Christoph Wickert
 
-* Sun Mar 22 2009 David Fetter <david at fetter.org> 1.0.0-2
-- Changed hard-coded path requirement to perl.
-
-
 * Tue Mar 17 2009 Allison Randal <allison at parrot.org> 1.0.0
 - updated to 1.0.0
 
@@ -291,91 +312,31 @@
 - added parrot_utils to devel
 - fixed Source0 url
 
-* Tue Jan 23 2009 Gerd Pokorra <gp at zimt.uni-siegen.de> 0.9.0
-- added make html
-- make reallyinstall => make install
-
-* Tue Jan 20 2009 chromatic <chromatic at wgz.org> 0.9.0
-- updated to 0.9.0
-
 * Tue Dec 16 2008 Whiteknight <wknight8111 at gmail.com> 0.8.2
 - updated to 0.8.2
 
-* Tue Nov 18 2008 chromatic <chromatic at parrot.org> 0.8.1
-- updated to 0.8.1
-
-* Tue Oct 21 2008 particle <particle at parrot.org> 0.8.0
-- updated to 0.8.0
-
-* Tue Sep 16 2008 pmichaud <pmichaud at pobox.com> 0.7.1
-- updated to 0.7.1
-
-* Wed Sep  3 2008 chromatic <chromatic at wgz.org> 0.7.0
-- install parrot_config (not parrot-config)
-
-* Tue Jun 17 2008 Nuno Carvalho <smash at cpan.org> 0.6.3
-- updated to 0.6.3
-
-* Tue May 20 2008 chromatic <chromatic at wgz.org>> 0.6.2
-- updated to 0.6.2
-
-* Mon Apr 28 2008 chromatic <chromatic at wgz.org> 0.6.1
-- minor fixes; tested with Fedora 7, 8, and 9-beta
-
 * Tue Mar 18 2008 Bernhard Schmalhofer <Bernhard.Schmalhofer at gmx.de> 0.6.0
 - Update to 0.5.3.
 
 * Wed Feb 20 2008 Patrick Michaud <pmichaud at pobox.com> 0.5.3
 - Update to 0.5.3.
 
-* Tue Jan 15 2008 Bob Rogers <rogers at rgrjr.dyndns.org> 0.5.2
-- Update to 0.5.2.
-
-* Tue Dec 18 2007 Jonathan Worthington <jnthn at jnthn.net> 0.5.1
-- Update to 0.5.1.
-
-* Tue Nov 20 2007 chromatic <chromatic at wgz.org> 0.5.0
-- Update to 0.5.0.
-
-* Fri May 25 2007 David Fetter <david at fetter.org> 0.4.12-1
-- Update to 0.4.12.
-
-* Wed Apr 18 2007 Steven Pritchard <steve at kspei.com> 0.4.11-1
-- Update to 0.4.11.
-
-* Wed Mar 21 2007 Steven Pritchard <steve at kspei.com> 0.4.10-1
-- Update to 0.4.10.
-
 * Sat Mar 10 2007 Steven Pritchard <steve at kspei.com> 0.4.9-1
 - Update to 0.4.9.
-- BR ncurses-devel.
+- BuildRequires ncurses-devel.
 - For some reason now I need to force -lm too.
 - Remove some files/directories that shouldn't be included.
-
-* Wed Jan 17 2007 Steven Pritchard <steve at kspei.com> 0.4.8-1
-- Attempt update to 0.4.8.
-
-* Fri Jun 30 2006 Steven Pritchard <steve at kspei.com> 0.4.5-5
 - Override lib_dir and make various substitutions to try to fix multilib.
 - Remove rpath use from Makefile.
 - Fix a pod error in src/ops/experimental.ops.
 - Enable "make test" since t/doc/pod.t won't fail now.
-
-* Wed Jun 28 2006 Steven Pritchard <steve at kspei.com> 0.4.5-4
 - Force permissions on shared libraries so rpmbuild strips them.
-
-* Wed Jun 28 2006 Steven Pritchard <steve at kspei.com> 0.4.5-3
 - Fix URL, description, summary, etc.
 - Add post/postun.
 - Move parrot-config to the devel sub-package.
 - Force permissions on the doc directories.
-
-* Tue Jun 27 2006 Steven Pritchard <steve at kspei.com> 0.4.5-2
 - Add -lcurses to get readline detection to work.
-- BR libicu-devel.
-
-* Tue Jun 27 2006 Steven Pritchard <steve at kspei.com> 0.4.5-1
-- Initial packaging attempt.
+- Add BuildRequires libicu-devel.
 
 * Tue Mar 18 2003 Steve Fink <sfink at foxglove.localdomain> 0.0.11
 - first .spec file created

Modified: branches/orderedhash_revamp/ports/macports/Portfile
==============================================================================
--- branches/orderedhash_revamp/ports/macports/Portfile	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/ports/macports/Portfile	Sat Jan 23 01:49:53 2010	(r43541)
@@ -55,7 +55,7 @@
 
         set executables {
             parrot parrot_config parrot_debugger
-            pbc_disassemble pbc_info pbc_merge pbc_to_exe pbc_dump
+            pbc_disassemble pbc_merge pbc_to_exe pbc_dump
         }
 
         foreach exe $executables { 

Modified: branches/orderedhash_revamp/ports/mandriva/parrot.spec.mandriva
==============================================================================
--- branches/orderedhash_revamp/ports/mandriva/parrot.spec.mandriva	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/ports/mandriva/parrot.spec.mandriva	Sat Jan 23 01:49:53 2010	(r43541)
@@ -158,7 +158,6 @@
 %{_bindir}/parrot_config
 %{_bindir}/parrot_debugger
 %{_bindir}/pbc_disassemble
-%{_bindir}/pbc_info
 %{_bindir}/pbc_merge
 %{_bindir}/pbc_to_exe
 %{_bindir}/pbc_dump

Modified: branches/orderedhash_revamp/ports/suse/parrot.spec.suse
==============================================================================
--- branches/orderedhash_revamp/ports/suse/parrot.spec.suse	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/ports/suse/parrot.spec.suse	Sat Jan 23 01:49:53 2010	(r43541)
@@ -134,7 +134,6 @@
 %{_bindir}/parrot_config
 %{_bindir}/parrot_debugger
 %{_bindir}/pbc_disassemble
-%{_bindir}/pbc_info
 %{_bindir}/pbc_merge
 %{_bindir}/pbc_to_exe
 %{_bindir}/pbc_dump

Modified: branches/orderedhash_revamp/ports/ubuntu/changelog
==============================================================================
--- branches/orderedhash_revamp/ports/ubuntu/changelog	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/ports/ubuntu/changelog	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,3 +1,19 @@
+parrot (1.4.0-1ubuntu1) karmic; urgency=low
+  * Synchronize with Debian unstable.
+  * Removes lpia patch, upstream fix included in new release.
+
+ -- Allison Randal <allison at parrot.org>  Sat, 25 Jul 2009 08:37:52 -0700
+
+parrot (1.4.0-1) unstable; urgency=low
+  * New upstream release
+  * debian/rules:
+    - New upstream configuration option --disable-rpath allows packages to
+      be built without rpath.
+  * parrot-devel.install.in
+    - Install pbc_to_exe binary and supporting library.
+
+ -- Allison Randal <allison at parrot.org>  Fri, 24 Jul 2009 23:54:07 -0700
+
 parrot (1.0.0-1ubuntu1) karmic; urgency=low
 
   [ Allison Randal ]

Modified: branches/orderedhash_revamp/ports/ubuntu/control.in
==============================================================================
--- branches/orderedhash_revamp/ports/ubuntu/control.in	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/ports/ubuntu/control.in	Sat Jan 23 01:49:53 2010	(r43541)
@@ -4,7 +4,7 @@
 Maintainer: Ubuntu Developers <ubuntu-devel-discuss at lists.ubuntu.com>
 XSBC-Original-Maintainer: Debian Parrot Maintainers <pkg-parrot-devel at lists.alioth.debian.org>
 Uploaders: Allison Randal <allison at parrot.org>, Nuno Carvalho <mestre.smash at gmail.com>, Patrick Michaud <pmichaud at pobox.com>
-Build-Depends: debhelper (>= 5.0.0), perl, perl-doc, libgdbm-dev, libreadline-dev, quilt
+Build-Depends: debhelper (>= 5.0.0), perl, perl-doc, libgdbm-dev, libreadline-dev
 Standards-Version: 3.8.1
 
 Package: parrot

Deleted: branches/orderedhash_revamp/ports/ubuntu/patches/01-lpia-FTBFS.path
==============================================================================
--- branches/orderedhash_revamp/ports/ubuntu/patches/01-lpia-FTBFS.path	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,12 +0,0 @@
---- parrot-1.0.0.orig/config/auto/gcc.pm
-+++ parrot-1.0.0/config/auto/gcc.pm
-@@ -96,7 +96,8 @@
-         HAS_aligned_funcptr => 1
-     );
-     $conf->data->set( HAS_aligned_funcptr => 0 )
--        if $conf->data->get_p5('OSNAME') eq 'hpux';
-+        if (  $conf->data->get_p5('OSNAME') eq 'hpux'
-+           || $conf->data->get('archname') =~ /gnulp/); # lpia arch
-     return 1;
- }
- 

Deleted: branches/orderedhash_revamp/ports/ubuntu/patches/series
==============================================================================
--- branches/orderedhash_revamp/ports/ubuntu/patches/series	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1 +0,0 @@
-01-lpia-FTBFS.path

Deleted: branches/orderedhash_revamp/ports/ubuntu/rules
==============================================================================
--- branches/orderedhash_revamp/ports/ubuntu/rules	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,107 +0,0 @@
-#!/usr/bin/make -f
-
-include /usr/share/quilt/quilt.make
-
-CFLAGS = -Wall -g
-VERSION = $(shell cat VERSION)
-SOVERSION = $(VERSION)
-
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-	CFLAGS += -O0
-else
-	CFLAGS += -O2
-endif
-
-CONTROL_FILES = \
-  debian/control.in \
-  debian/parrot.install.in \
-  debian/parrot-minimal.install.in \
-  debian/parrot-doc.install.in \
-  debian/parrot-devel.install.in \
-  debian/libparrot.install.in \
-  debian/libparrot-dev.install.in
-
-debian-control-stamp: $(CONTROL_FILES) VERSION
-	for infile in $(CONTROL_FILES); do \
-	    outfile=`echo $$infile | sed "s/\.in$$//"`; \
-	    sed -e "s/@VERSION@/$(VERSION)/g" \
-	        -e "s/@SOVERSION@/$(SOVERSION)/g" \
-	            <$$infile >$$outfile; \
-	done
-	touch $@
-
-configure: configure-stamp
-configure-stamp: debian-control-stamp $(QUILT_STAMPFN)
-	dh_testdir
-	perl Configure.pl --prefix=/usr
-	touch configure-stamp
-
-build: build-stamp
-
-build-stamp: configure-stamp 
-	dh_testdir
-	$(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" tools/util/parrot-config.pir debian/parrot_config.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
-	pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/pbc_merge.c debian/pbc_merge.1
-	touch build-stamp
-
-clean: debian-control-stamp unpatch
-	dh_testdir
-	dh_testroot
-	rm -f build-stamp configure-stamp debian-control-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/main.o installable_pbc_to_exe ext/Parrot-Embed/Makefile.PL test.c test.ldo
-	[ ! -f Makefile ] || $(MAKE) distclean
-	dh_clean 
-
-debian/libparrot$(SOVERSION).install: debian/libparrot.install VERSION
-	cp $< $@
-
-install: build debian/libparrot$(SOVERSION).install
-	dh_testdir
-	dh_testroot
-	dh_clean -k 
-	$(MAKE) install-dev DESTDIR=$(CURDIR)/debian/tmp
-	dh_installdirs
-	find $(CURDIR)/debian/tmp -type f
-	dh_install --sourcedir=$(CURDIR)/debian/tmp --list-missing
-
-
-# Build architecture-independent files here.
-binary-indep: build install
-	dh_testdir -i 
-	dh_testroot -i
-	dh_installchangelogs -i ChangeLog
-	dh_installdocs -i
-	dh_link -plibparrot-dev usr/lib/libparrot.so.$(SOVERSION) usr/lib/libparrot.so
-	dh_compress -pparrot-doc -X.pod
-	dh_compress -plibparrot-dev
-	dh_fixperms -i
-	dh_installdeb -i
-	dh_gencontrol -i
-	dh_md5sums -i
-	dh_builddeb -i
-
-# Build architecture-dependent files here.
-binary-arch: build install
-	dh_testdir -a
-	dh_testroot -a
-	dh_installchangelogs -a ChangeLog
-	dh_installman -pparrot-minimal debian/parrot.1
-	dh_installman -pparrot-devel debian/parrot_debugger.1 debian/pbc_disassemble.1 debian/pbc_dump.1 debian/pbc_info.1 debian/pbc_merge.1 debian/parrot_config.1
-	dh_installdocs -a
-	dh_strip -a
-	dh_compress -a
-	dh_fixperms -a
-	dh_makeshlibs -plibparrot$(SOVERSION)
-	dh_shlibdeps -a -Llibparrot$(SOVERSION) -l$(CURDIR)/debian/libparrot$(SOVERSION)/usr/lib
-	dh_installdeb -a
-	dh_gencontrol -a
-	dh_md5sums -a
-	dh_builddeb -a
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure

Modified: branches/orderedhash_revamp/runtime/parrot/include/fp_equality.pasm
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/include/fp_equality.pasm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/include/fp_equality.pasm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -7,7 +7,7 @@
 
 =head1 DESCRIPTION
 
-This file provides two PIR macros to determine if a pair of floating point numbers are equivalent.
+This file provides PIR macros to determine if a pair of floating point numbers are equivalent.
 The same macros are also provided for PASM.
 
 =cut
@@ -23,6 +23,18 @@
 .label $FPEQNOK:
 .endm
 
+.macro fp_eq_ok (  J, K, L )
+    set $N10, .J
+    set $N11, .K
+    sub $N12, $N11, $N10
+    abs $N12, $N12
+
+    set $I0, 0
+    gt  $N12, 0.000001, .$FPEQNOK
+    set $I0, 1
+.label $FPEQNOK:
+    ok( $I0, .L )
+.endm
 
 .macro fp_ne ( J, K, L )
     set $N10, .J

Modified: branches/orderedhash_revamp/runtime/parrot/include/hllmacros.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/include/hllmacros.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/include/hllmacros.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -149,7 +149,7 @@
 
 =cut
 
-# RT #55808 - the unlikely to conflict variable names here must be
+# TT #911 - the unlikely to conflict variable names here must be
 # replaced with the .macro_local syntax.
 .macro Foreach(name, array, code)
     .local int __Foreach__local__i

Modified: branches/orderedhash_revamp/runtime/parrot/include/test_more.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/include/test_more.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/include/test_more.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -20,7 +20,7 @@
     .local pmc exports, curr_namespace, test_namespace
     curr_namespace = get_namespace
     test_namespace = get_root_namespace [ 'parrot'; 'Test'; 'More' ]
-    exports = split ' ', 'plan diag ok nok is is_deeply like isa_ok skip isnt todo'
+    exports = split ' ', 'plan diag ok nok is is_deeply like substring isa_ok skip isnt todo throws_like lives_ok dies_ok throws_substring'
 
     test_namespace.'export_to'(curr_namespace, exports)
 

Modified: branches/orderedhash_revamp/runtime/parrot/library/Config/JSON.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/Config/JSON.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/library/Config/JSON.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -28,20 +28,20 @@
     fh = open filename, 'r'
     if fh goto slurp_file
     $P0 = new 'Exception'
-    $S0 = concat "can't open file: ", filename
+    $S0 = concat "Can't open file: ", filename
     $P0 = $S0
     throw $P0
 
   slurp_file:
     text = fh.'readall'()
 
-    # convert the text to an object and return it.
-    load_bytecode 'compilers/json/JSON.pbc'
+    # Convert the text to an object and return it.
+    .local pmc json, code, config
+    load_language  'data_json'
+    json = compreg 'data_json'
+    code = json.'compile'(text)
 
-    .local pmc JSON, config
-    JSON = compreg "JSON"
-
-    .tailcall JSON(text)
+    .tailcall code()
 .end
 
 =head2 WriteConfig(config, filename, ?:compact)

Added: branches/orderedhash_revamp/runtime/parrot/library/Configure/genfile.pir
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/runtime/parrot/library/Configure/genfile.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,427 @@
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+Configure/genfile.pir - Configure step helpers
+
+=head1 DESCRIPTION
+
+Supply C<genfile> function, which handles
+
+=over 4
+
+=item variable substitution
+
+=item slash/backslash substitution (for Windows)
+
+=item conditioned line #IF/UNLESS/ELSIF/ELSE
+
+=item with expression evaluation || OR && AND ! NOT (expr) != ==
+
+=back
+
+Pure PIR, without any dependencies.
+
+=head1 USAGE
+
+    # Retrieve the Parrot config
+    .local pmc config
+    $P0 = getinterp
+    config = $P0[.IGLOBALS_CONFIG_HASH]
+
+    # Sometime, we need extra configuration variables
+    config['foo'] = 'bar'
+
+    # Here, do the job
+    genfile('Makefile.in', 'Makefile', config)
+
+=cut
+
+.include 'sysinfo.pasm'
+
+.sub 'genfile'
+    .param string tmpl
+    .param string outfile
+    .param pmc config
+    $S0 = slurp(tmpl)
+    $S0 = conditioned_line($S0, config)
+    $S0 = interpolate_var($S0, config)
+    $S1 = sysinfo .SYSINFO_PARROT_OS
+    $S0 = replace_slash($S0, $S1)
+    spew(outfile, $S0)
+    printerr "\n\tGenerating '"
+    printerr outfile
+    printerr "'\n\n"
+.end
+
+.sub 'slurp' :anon
+    .param string filename
+    $P0 = new 'FileHandle'
+    push_eh _handler
+    $S0 = $P0.'readall'(filename)
+    pop_eh
+    .return ($S0)
+  _handler:
+    .local pmc e
+    .get_results (e)
+    $S0 = "Can't open '"
+    $S0 .= filename
+    $S0 .= "' ("
+    $S1 = err
+    $S0 .= $S1
+    $S0 .= ")\n"
+    e = $S0
+    rethrow e
+.end
+
+.sub 'spew' :anon
+    .param string filename
+    .param string content
+    $P0 = new 'FileHandle'
+    push_eh _handler
+    $P0.'open'(filename, 'w')
+    pop_eh
+    $P0.'puts'(content)
+    $P0.'close'()
+    .return ()
+  _handler:
+    .local pmc e
+    .get_results (e)
+    $S0 = "Can't open '"
+    $S0 .= filename
+    $S0 .= "' ("
+    $S1 = err
+    $S0 .= $S1
+    $S0 .= ")\n"
+    e = $S0
+    rethrow e
+.end
+
+.sub 'conditioned_line'
+    .param string content
+    .param pmc config
+    $P0 = split "\n", content
+    .local string result, line
+    .local int truth, former_truth
+    former_truth = 0
+    result = ''
+  L1:
+    unless $P0 goto L2
+    line = shift $P0
+    $I0 = index line, "#IF("
+    unless $I0 == 0 goto L10
+    $I0 = index line, "):"
+    if $I0 < 0 goto L3
+    $I1 = $I0 - 4
+    $S0 = substr line, 4, $I1
+    truth = cond_eval($S0, config)
+    former_truth = truth
+    unless truth goto L1
+    $I0 += 2
+    $S0 = substr line, $I0
+    goto L4
+  L10:
+    $I0 = index line, "#UNLESS("
+    unless $I0 == 0 goto L20
+    $I0 = index line, "):"
+    if $I0 < 0 goto L3
+    $I1 = $I0 - 8
+    $S0 = substr line, 8, $I1
+    truth = cond_eval($S0, config)
+    former_truth = not truth
+    if truth goto L1
+    $I0 += 2
+    $S0 = substr line, $I0
+    goto L4
+  L20:
+    $I0 = index line, "#ELSIF("
+    unless $I0 == 0 goto L30
+    $I0 = index line, "):"
+    if $I0 < 0 goto L3
+    if former_truth goto L1
+    $I1 = $I0 - 7
+    $S0 = substr line, 7, $I1
+    truth = cond_eval($S0, config)
+    former_truth = truth
+    unless truth goto L1
+    $I0 += 2
+    $S0 = substr line, $I0
+    goto L4
+  L30:
+    $I0 = index line, "#ELSE:"
+    unless $I0 == 0 goto L40
+    if former_truth goto L1
+    $S0 = substr line, 6
+    goto L4
+  L40:
+  L3:
+    $S0 = line
+  L4:
+    result .= $S0
+    result .= "\n"
+    goto L1
+  L2:
+    .return (result)
+.end
+
+.sub 'cond_eval'
+    .param string expr
+    .param pmc config
+    .local int pos, end
+    end = length expr
+    pos = ws(expr, 0, end)
+    .tailcall or_expr(expr, pos, end, config)
+.end
+
+.sub 'or_expr' :anon
+    .param string str
+    .param int pos
+    .param int end
+    .param pmc config
+    .local int val1, val2
+    (val1, pos) = and_expr(str, pos, end, config)
+    pos = ws(str, pos, end)
+    $I0 = index str, "||", pos
+    if $I0 == pos goto L1
+    $I0 = index str, "OR", pos
+    if $I0 == pos goto L1
+    # or_expr -> and_expr
+    .return (val1, pos)
+  L1:
+    pos = pos + 2
+    pos = ws(str, pos, end)
+    (val2, pos) = or_expr(str, pos, end, config)
+    $I0 = val1 || val2
+    # or_expr -> and_expr ( '||' | 'OR' or_expr )
+    .return ($I0, pos)
+.end
+
+.sub 'and_expr' :anon
+    .param string str
+    .param int pos
+    .param int end
+    .param pmc config
+    .local int val1, val2
+    (val1, pos) = rel_expr(str, pos, end, config)
+    pos = ws(str, pos, end)
+    $I0 = index str, "&&", pos
+    if $I0 == pos goto L1
+    $I0 = index str, "AND", pos
+    if $I0 == pos goto L2
+    # and_expr -> rel_expr
+    .return (val1, pos)
+  L1:
+    pos = pos + 2
+    goto L3
+  L2:
+    pos = pos + 3
+  L3:
+    pos = ws(str, pos, end)
+    (val2, pos) = and_expr(str, pos, end, config)
+    $I0 = val1 && val2
+    # and_expr -> rel_expr ( '&&' | 'AND' and_expr )
+    .return ($I0, pos)
+.end
+
+.sub 'rel_expr' :anon
+    .param string str
+    .param int pos
+    .param int end
+    .param pmc config
+    .local int val1, val2
+    (val1, pos) = not_expr(str, pos, end, config)
+    pos = ws(str, pos, end)
+    $I0 = index str, "==", pos
+    if $I0 == pos goto L1
+    $I0 = index str, "!=", pos
+    if $I0 == pos goto L1
+    # rel_expr -> not_expr
+    .return (val1, pos)
+  L1:
+    $S0 = substr str, pos, 2
+    pos = pos + 2
+    pos = ws(str, pos, end)
+    (val2, pos) = not_expr(str, pos, end, config)
+    unless $S0 == '==' goto L2
+    $I0 = val1 == val2
+    # rel_expr -> not_expr '==' not_expr
+    .return ($I0, pos)
+  L2:
+    $I0 = val1 != val2
+    # rel_expr -> not_expr '!=' not_expr
+    .return ($I0, pos)
+.end
+
+.sub 'not_expr' :anon
+    .param string str
+    .param int pos
+    .param int end
+    .param pmc config
+    $I0 = index str, '!', pos
+    if $I0 == pos goto L1
+    $I0 = index str, 'NOT', pos
+    if $I0 == pos goto L2
+    # not_expr -> prim_expr
+    .tailcall prim_expr(str, pos, end, config)
+  L1:
+    pos = pos + 1
+    goto L3
+  L2:
+    pos = pos + 3
+  L3:
+    pos = ws(str, pos, end)
+    .local int val
+    (val, pos) = not_expr(str, pos, end, config)
+    $I0 = not val
+    # not_expr -> ( '!' | 'NOT' ) not_expr
+    .return ($I0, pos)
+.end
+
+.sub 'prim_expr' :anon
+    .param string str
+    .param int pos
+    .param int end
+    .param pmc config
+    .local int val
+    $S0 = substr str, pos, 1
+    unless $S0 == '(' goto L1
+    inc pos
+    pos = ws(str, pos, end)
+    (val, pos) = or_expr(str, pos, end, config)
+    pos = ws(str, pos, end)
+    $S0 = substr str, pos, 1
+    if $S0 == ')' goto L2
+    error(str, pos, "')' expected")
+  L2:
+    inc pos
+    # prim_expr -> '(' or_expr ')'
+    .return (val, pos)
+  L1:
+    # prim_expr -> idf
+    .tailcall idf(str, pos, end, config)
+.end
+
+.include 'cclass.pasm'
+
+.sub 'idf' :anon
+    .param string str
+    .param int pos
+    .param int end
+    .param pmc config
+    $I1 = pos
+  L1:
+    $I0 = is_cclass .CCLASS_WORD, str, pos
+    unless $I0 goto L2
+    inc pos
+    if pos >= end goto L2
+    goto L1
+  L2:
+    $I2 = pos - $I1
+    $S0 = substr str, $I1, $I2
+    $I0 = config[$S0]
+    .return ($I0, pos)
+.end
+
+.sub 'ws' :anon
+    .param string str
+    .param int pos
+    .param int end
+  L1:
+    $I0 = is_cclass .CCLASS_WHITESPACE, str, pos
+    unless $I0 goto L2
+    inc pos
+    if pos >= end goto L2
+    goto L1
+  L2:
+    .return (pos)
+.end
+
+.sub 'error' :anon
+    .param string str
+    .param int pos
+    .param string msg
+    printerr "in '"
+    printerr str
+    printerr "' at "
+    printerr pos
+    printerr " : "
+    printerr msg
+    printerr "\n"
+.end
+
+.sub 'interpolate_var'
+    .param string content
+    .param pmc config
+    $P0 = split "\n", content
+    .local string result, line
+    result = ''
+  L1:
+    unless $P0 goto L2
+    line = shift $P0
+    $I0 = 0
+    $S0 = ''
+  L3:
+    $I1 = index line, '@', $I0
+    if $I1 < 0 goto L4
+  L8:
+    $I2 = $I1 - $I0
+    inc $I1
+    $I3 = index line, '@', $I1
+    if $I3 < 0 goto L4
+    $S1 = substr line, $I0, $I2
+    $S0 .= $S1
+    $I4 = $I3 - $I1
+    $S1 = substr line, $I1, $I4
+    $I7 = exists config[$S1]
+    unless $I7 goto L5
+    $S2 = config[$S1]
+    $S0 .= $S2
+    goto L6
+  L5:
+    $I8 = $I3 + 1
+    $I9 = index line, '@', $I8
+    if $I9 < 0 goto L7
+    $I0 = $I1 - 1
+    $I1 = $I3
+    goto L8
+  L7:
+    printerr "\tunknown config: "
+    printerr $S1
+    printerr "\n"
+  L6:
+    $I0 = $I3 + 1
+    goto L3
+  L4:
+    $S1 = substr line, $I0
+    $S0 .= $S1
+    result .= $S0
+    result .= "\n"
+    goto L1
+  L2:
+    .return (result)
+.end
+
+.sub 'replace_slash'
+    .param string str
+    .param string OS
+    unless OS == 'MSWin32' goto L1
+    $P0 = split "/", str
+    str = join "\\", $P0
+    $P0 = split "\\\\", str
+    str = join "/", $P0
+    $P0 = split "\\*", str
+    str = join "\\\\*", $P0
+    .return (str)
+  L1:
+    $P0 = split "//", str
+    str = join "/", $P0
+    .return (str)
+.end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
+

Modified: branches/orderedhash_revamp/runtime/parrot/library/Crow.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/Crow.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/library/Crow.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -12,7 +12,7 @@
     load_bytecode 'Getopt/Obj.pbc'
 
     .local pmc getopts
-    getopts = new 'Getopt::Obj'
+    getopts = new ['Getopt';'Obj']
     getopts.'notOptStop'(1)
 
     getopts = push 'help|h'
@@ -110,16 +110,16 @@
     .param string template
     .param pmc    data
 
-    .local pmc    iter
-    iter = new 'Iterator', data
+    .local pmc    it
+    it = iter data
 
     .local string symbol, value
 
   it_loop:
-    unless iter goto it_done
-    $P0 = shift iter
+    unless it goto it_done
+    $P0 = shift it
     symbol = 'get_symbol'($P0)
-    value  = iter[$P0]
+    value  = it[$P0]
       repl_loop:
         $I0 = index template, symbol
         if -1 == $I0 goto repl_done

Modified: branches/orderedhash_revamp/runtime/parrot/library/Curses.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/Curses.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/library/Curses.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,6 +1,12 @@
 # Copyright (C) 2004-2009, Parrot Foundation.
 # $Id$
 
+.macro export_dl_func(lib, name, sig)
+    .local pmc edlftmp
+    dlfunc edlftmp, .lib, .name, .sig
+    set_global .name, edlftmp
+.endm
+
 .namespace ['Curses']
 .sub __ncurses_init :load
 
@@ -125,6 +131,29 @@
 dlfunc $P2, $P1, 'data_behind', 'lp'
 set_global 'data_behind', $P2
 
+loadlib $P1, 'libpanel'
+if $P1 goto has_panel_lib
+loadlib $P1, 'cygpanel-8'
+if $P1 goto has_panel_lib
+goto no_panel_lib
+has_panel_lib:
+.export_dl_func($P1, 'new_panel', 'pp')
+.export_dl_func($P1, 'bottom_panel', 'ip')
+.export_dl_func($P1, 'top_panel', 'ip')
+.export_dl_func($P1, 'show_panel', 'ip')
+.export_dl_func($P1, 'update_panels', 'v')
+.export_dl_func($P1, 'hide_panel', 'ip')
+.export_dl_func($P1, 'panel_window', 'pp')
+.export_dl_func($P1, 'replace_panel', 'ipp')
+.export_dl_func($P1, 'move_panel', 'ipii')
+.export_dl_func($P1, 'panel_hidden', 'ip')
+.export_dl_func($P1, 'panel_above', 'pp')
+.export_dl_func($P1, 'panel_below', 'pp')
+.export_dl_func($P1, 'set_panel_userptr', 'ipp')
+.export_dl_func($P1, 'panel_userptr', 'vp')
+.export_dl_func($P1, 'del_panel', 'ip')
+no_panel_lib:
+
 loadlib $P1, 'libncurses'
 if $P1 goto has_lib1
 loadlib $P1, 'cygncurses-8'
@@ -658,6 +687,8 @@
 set_global 'mcprint', $P2
 dlfunc $P2, $P1, 'has_key', 'ii'
 set_global 'has_key', $P2
+.export_dl_func($P1, 'getmaxx', 'ip')
+.export_dl_func($P1, 'getmaxy', 'ip')
 
 .begin_return
 .end_return

Modified: branches/orderedhash_revamp/runtime/parrot/library/Data/Dumper/Default.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/Data/Dumper/Default.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/library/Data/Dumper/Default.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -110,7 +110,7 @@
     .param pmc hash
     .local string indent
     .local string subindent
-    .local pmc iter
+    .local pmc it
     .local string key
     .local pmc val
     .local pmc keys
@@ -124,13 +124,12 @@
     print " {"
 
     new keys, "ResizablePMCArray"
-    new iter, "Iterator", hash
-    set iter, 0
+    it = iter hash
 
 iter_loop:
-    unless iter, iter_end
+    unless it, iter_end
 
-    shift key, iter
+    shift key, it
     push keys, key
     branch iter_loop
 
@@ -422,11 +421,24 @@
     .local string subindent, indent
     (subindent, indent) = dumper.'newIndent'()
 
-    .local pmc hash, iter
+    # Sort hash keys before dump to preseve order
+    # Use RPA instead of RSA because RSA doesn't have 'sort' method
+    .local pmc hash, it, keys
     hash = self.'hash'()
-    iter = new 'Iterator', hash
+    keys = new ['ResizablePMCArray']
+    it = iter hash
+  dump_hash_keys_loop:
+    unless it goto dump_hash_keys_end
+    .local string key
+    key = shift it
+    push keys, key
+    goto dump_hash_keys_loop
+  dump_hash_keys_end:
+    keys.'sort'()
+
+    it = iter keys
   dump_hash_loop:
-    unless iter goto dump_hash_end
+    unless it goto dump_hash_end
     if hasstuff goto dump_hash_1
     print " {"
     hasstuff = 1
@@ -435,7 +447,7 @@
     print subindent
     .local string key
     .local pmc val
-    key = shift iter
+    key = shift it
     val = hash[key]
     print "<"
     print key

Deleted: branches/orderedhash_revamp/runtime/parrot/library/Data/Replace.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/Data/Replace.pir	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,234 +0,0 @@
-# $Id$
-
-=head1 TITLE
-
-Data::Replace - data replacing implemented in PIR
-
-=head1 SYNOPSIS
-
-    ...
-
-    load_bytecode "Data/Replace.pbc"
-
-    .local pmc replace
-
-    replace = get_hll_global ['Data::Replace'], 'replace'
-
-    replace( array, old, new )
-
-    ...
-
-
-=head1 DESCRIPTION
-
-Replaces every occurrence of a specified PMC with another PMC
-in a nested, possible self-referential data structure.
-
-=head1 FUNCTIONS
-
-This library provides the following function:
-
-=over 4
-
-=cut
-
-.namespace ["Data::Replace"]
-
-=item replace( where, old, new )
-
-Replaces every "old" with "new" inside the aggregate "where".
-
-=cut
-
-.sub replace
-    .param pmc where
-    .param pmc oldVal
-    .param pmc newVal
-    .local pmc cache
-
-    new cache, 'ResizablePMCArray'
-    __do_replace( where, oldVal, newVal, cache )
-.end
-
-
-.sub __in_cache
-    .param pmc val
-    .param pmc cache
-    .local int i
-    .local pmc temp
-
-    set i, cache
-LOOP:
-    dec i
-    if i < 0 goto END
-    temp = cache[i]
-    eq_addr val, temp, IS
-    branch LOOP
-END:
-    .begin_return
-    .set_return 0
-    .end_return
-IS:
-    .begin_return
-    .set_return 1
-    .end_return
-.end
-
-.sub __do_replace
-    .param pmc where
-    .param pmc oldVal
-    .param pmc newVal
-    .param pmc cache
-    .local pmc temp
-    .local string name
-
-    if_null where, END
-
-    # call __replace if the PMC supports it
-    can $I0, where, "__replace"
-    unless $I0 goto CANT_REPLACE
-    where."__replace"( oldVal, newVal, cache )
-    branch REPLACE_PROPS
-CANT_REPLACE:
-
-    # find a Data::Replace method with the name of the type to replace
-    typeof name, where
-    .include 'errors.pasm'
-    errorsoff .PARROT_ERRORS_GLOBALS_FLAG
-    temp = get_hll_global ['"Data::Replace'], name
-    errorson .PARROT_ERRORS_GLOBALS_FLAG
-    # invoke it if found
-    $I0 = defined temp
-    unless $I0 goto REPLACE_PROPS
-    temp( where, oldVal, newVal, cache )
-
-REPLACE_PROPS:
-    prophash temp, where
-    set $I0, temp
-    if $I0 == 0 goto END
-    __do_replace( temp, oldVal, newVal, cache )
-END:
-.end
-
-.sub __onload :load
-    $P0 = get_hll_global ['Data::Replace'], 'ResizablePMCArray'
-    set_hll_global ['Data::Replace'], 'PMCArray', $P0
-    set_hll_global ['Data::Replace'], 'StringArray', $P0
-.end
-
-.sub ResizablePMCArray
-    .param pmc where
-    .param pmc oldVal
-    .param pmc newVal
-    .param pmc cache
-    .local int i
-    .local pmc val
-
-    set i, where
-LOOP:
-    dec i
-    if i < 0 goto END
-
-    val = where[i]
-
-    ne_addr val, oldVal, SKIP
-    where[i] = newVal
-SKIP:
-    $I0 = __in_cache( val, cache )
-    if $I0 goto LOOP
-
-    push cache, val
-    __do_replace( val, oldVal, newVal, cache )
-    branch LOOP
-END:
-    .begin_return
-    .end_return
-.end
-
-.sub Hash :method
-    .param pmc where
-    .param pmc oldVal
-    .param pmc newVal
-    .param pmc cache
-    .local pmc iter
-    .local string key
-    .local pmc val
-
-    new iter, 'Iterator', where
-    set iter, 0
-
-LOOP:
-    unless iter, END
-
-    shift key, iter
-
-    val = where[key]
-
-    ne_addr val, oldVal, SKIP
-    where[key] = newVal
-SKIP:
-    $I0 = __in_cache( val, cache )
-    if $I0 goto LOOP
-
-    push cache, val
-    __do_replace( val, oldVal, newVal, cache )
-    branch LOOP
-
-END:
-    .begin_return
-    .end_return
-.end
-
-.sub Hash :method
-    .param pmc where
-    .param pmc oldVal
-    .param pmc newVal
-    .param pmc cache
-    .local pmc iter
-    .local string key
-    .local pmc val
-
-    new iter, 'Iterator', where
-    set iter, 0
-
-LOOP:
-    unless iter, END
-
-    shift key, iter
-
-    val = where[key]
-
-    ne_addr val, oldVal, SKIP
-    where[key] = newVal
-SKIP:
-    $I0 = __in_cache( val, cache )
-    if $I0 goto LOOP
-
-    push cache, val
-    __do_replace( val, oldVal, newVal, cache )
-    branch LOOP
-
-END:
-    .begin_return
-    .end_return
-.end
-
-=back
-
-=head1 AUTHOR
-
-Jens Rieks E<lt>parrot at jensbeimsurfen dot deE<gt> is the author
-and maintainer.
-Please send patches and suggestions to the Perl 6 Internals mailing list.
-
-=head1 COPYRIGHT
-
-Copyright (C) 2004-2008, Parrot Foundation.
-
-=cut
-
-# Local Variables:
-#   mode: pir
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/runtime/parrot/library/Getopt/Obj.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/Getopt/Obj.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/library/Getopt/Obj.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -13,7 +13,7 @@
     prog_name = shift argv
     load_bytecode "Getopt/Obj.pbc"
     .local pmc getopts
-    getopts = new "Getopt::Obj"
+    getopts = new ['Getopt';'Obj']
     getopts."notOptStop"(1)
 
      # these two are identical, with the exception of the call to name
@@ -70,7 +70,7 @@
 =cut
 
 .sub __load :anon :load
-    .local pmc obj, spec
+    .local pmc obj, spec, pns, ns
     obj = newclass "Getopt::Obj"
     addattribute obj, "Specs"
     addattribute obj, "notOptStop"
@@ -81,6 +81,14 @@
     addattribute spec, "short"
     addattribute spec, "type"
     addattribute spec, "optarg"
+
+    ns = get_hll_namespace ["Getopt::Obj"]
+    $P0 = get_hll_namespace
+    pns = $P0.'make_namespace'('Getopt')
+    pns.'add_namespace'('Obj', ns)
+    ns = get_hll_namespace ["Getopt::Obj::Spec"]
+    pns = get_hll_namespace ['Getopt';'Obj']
+    pns.'add_namespace'('Spec', ns)
 .end
 
 =back
@@ -467,8 +475,6 @@
 
 =cut
 
-# RT #56782 should the name really ever be passed?
-
 .sub "getNameForKey" :method
     .param string key
 

Modified: branches/orderedhash_revamp/runtime/parrot/library/JSON.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/JSON.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/library/JSON.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -262,14 +262,13 @@
 
   .local pmc keys
   keys = new 'ResizablePMCArray'
-  .local pmc iter
-  iter = new 'Iterator', thing
-  iter = 0
+  .local pmc it
+  it = iter thing
   .local string key
 
 iter_loop:
-  unless iter, done_iter
-  shift key, iter
+  unless it, done_iter
+  shift key, it
   push keys, key
   goto iter_loop
 

Deleted: branches/orderedhash_revamp/runtime/parrot/library/NCI/call_toolkit_init.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/NCI/call_toolkit_init.pir	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,124 +0,0 @@
-# Copyright (C) 2008-2009, Parrot Foundation.
-# $Id$
-
-=head1 TITLE
-
-call_toolkit_init.pir - PIR code to call toolkits that alter argv
-
-=head1 SYNOPSIS
-
-    .sub main :main
-        .param pmc argv
-
-        # Load this library and the NCI wrapper for the toolkit
-	load_bytecode 'NCI/call_toolkit_init.pbc'
-	load_bytecode 'FooTK.pbc'
-
-	# Find Subs for toolkit's init function, and this helper routine
-        .local pmc fooInit, call_toolkit_init
-	fooInit           = get_global ['FooTK'], 'fooInit'
-	call_toolkit_init = get_global ['NCI'],   'call_toolkit_init'
-
-	# Call toolkit's init function, overwriting argv with mangled copy
-	argv = call_toolkit_init(fooInit, argv)
-
-	# Alternately, you can save both the original argv and mangled copy
-	.local pmc mangled_argv
-	mangled_argv = call_toolkit_init(fooInit, argv)
-
-        # ...
-    .end
-
-=head1 DESCRIPTION
-
-Calling an NCI toolkit init function that expects to parse and mangle
-argv is a relatively grotty bit of code that no one should have to write
-twice.  Hence this library, which provides just one routine:
-
-=over 4
-
-=item new_argv = call_toolkit_init(pmc init_func, pmc orig_argv)
-
-Call an NCI void function with params C<(&argc, argv)> (and thus having
-Parrot signature C<'v3p'>).  This is a very common signature for toolkit
-(AKA framework) init functions that want to filter out command line
-options that the toolkit itself should process.  Since it is expected
-that the init call will remove some arguments, C<call_toolkit_init>
-returns an updated argv.  C<orig_argv> is never changed; the NCI call is
-performed using a copy.
-
-=back
-
-=cut
-
-
-.namespace ['NCI']
-
-.include 'datatypes.pasm'
-
-
-.sub call_toolkit_init
-    .param pmc init_func
-    .param pmc orig_argv
-
-    # Calculate argc
-    .local int count
-    .local pmc argc
-    count = orig_argv
-    argc  = new 'Integer'
-    argc  = count
-
-    # Declare structure of a raw C string array with proper element count
-    .local pmc argv_decl
-    argv_decl = new 'ResizablePMCArray'
-    push argv_decl, .DATATYPE_CSTR
-    push argv_decl, count
-    push argv_decl, 0
-    # XXX: This is unportably wrong; it assumes sizeof(INT) = sizeof(PTR)
-    push argv_decl, .DATATYPE_INT
-    push argv_decl, 0
-    push argv_decl, 0
-
-    # Create C string array from struct declaration and Parrot string array
-    .local pmc argv
-    .local int i
-    argv = new 'ManagedStruct', argv_decl
-    i = 0
-  argv_loop:
-    unless i < count goto add_null
-    # It seems like this should be possible in one op
-    $S0 = orig_argv[i]
-    argv[0;i] = $S0
-    inc i
-    goto argv_loop
-  add_null:
-    # XXX: This is unportably wrong; it assumes sizeof(INT) = sizeof(PTR)
-    argv[1] = 0
-
-    # Call the NCI framework init function
-    init_func(argc, argv)
-
-    # Build a new_argv array to match the init function's return
-    .local int new_count
-    .local pmc new_argv
-    new_count = argc
-    new_argv  = new 'ResizableStringArray'
-    i = 0
-  new_argv_loop:
-    unless i < new_count goto done
-    $S0 = argv[0;i]
-    push new_argv, $S0
-    inc i
-    goto new_argv_loop
-
-    # Finally, return the new (and adjusted) argv
-  done:
-    .return (new_argv)
-.end
-
-
-# Local Variables:
-#   mode: pir
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/runtime/parrot/library/OpenGL.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/OpenGL.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/library/OpenGL.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -19,7 +19,7 @@
 
     # Load OpenGL libary and a helper library for calling glutInit
     load_bytecode 'OpenGL.pbc'
-    load_bytecode 'NCI/call_toolkit_init.pbc'
+    load_bytecode 'NCI/Utils.pbc'
 
     # Import all OpenGL/GLU/GLUT functions
     .local pmc import_gl
@@ -28,7 +28,7 @@
 
     # Initialize GLUT
     .local pmc call_toolkit_init
-    call_toolkit_init = get_global ['NCI'], 'call_toolkit_init'
+    call_toolkit_init = get_global ['NCI';'Utils'], 'call_toolkit_init'
 
     .const 'Sub' glutInit = 'glutInit'
     argv = call_toolkit_init(glutInit, argv)

Modified: branches/orderedhash_revamp/runtime/parrot/library/P6object.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/P6object.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/library/P6object.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -115,6 +115,33 @@
 .end
 
 
+=item WHERE()
+
+Return the memory address for the invocant.
+
+=cut
+
+.sub 'WHERE' :method
+    $I0 = get_addr self
+    .return ($I0)
+.end
+
+
+=item WHO()
+
+Return the package for the object.
+
+=cut
+
+.sub 'WHO' :method
+    $P0 = typeof self
+    $P0 = getprop 'metaclass', $P0
+    $P0 = getattribute $P0, 'parrotclass'
+    $P0 = $P0.'get_namespace'()
+    .return ($P0)
+.end
+
+
 =item PROTOOVERRIDES()
 
 Return a list of methods to be overridden in protoobjects
@@ -227,32 +254,45 @@
     .local pmc parrotclassns, mroiter, methods, methoditer
     parrotclassns = parrotclass.'get_namespace'()
     $P0 = parentclass.'inspect'('all_parents')
-    mroiter = new 'Iterator', $P0
+    mroiter = iter $P0
   mro_loop:
     unless mroiter goto mro_end
     $P0 = shift mroiter
     methods = $P0.'methods'()
-    methoditer = new 'Iterator', methods
+    methoditer = iter methods
   method_loop:
     unless methoditer goto mro_loop
-    $S0 = shift methoditer
-    $P0 = parrotclassns[$S0]
+    .local string methodname
+    .local pmc methodpmc
+    methodname = shift methoditer
+    methodpmc = methods[methodname]
+    # don't add NCI methods (they don't work)
+    $I0 = isa methodpmc, 'NCI'
+    if $I0 goto method_loop
+    # if there's no existing entry, add method directly
+    $P0 = parrotclassns[methodname]
     if null $P0 goto add_method
-    $I0 = isa $P0, 'MultiSub'
+    # if existing entry isn't a MultiSub, skip it
+    $I0 = isa $P0, ['MultiSub']
     unless $I0 goto method_loop
-  add_method:
-    $P0 = methods[$S0]
-    $I0 = isa $P0, 'NCI'
-    if $I0 goto method_loop
     push_eh err
-    parrotclassns.'add_sub'($S0, $P0)
-    pop_eh
+    parrotclassns.'add_sub'(methodname, methodpmc)
   err:
+    pop_eh
+    goto method_loop
+  add_method:
+    parrotclassns[methodname] = methodpmc
     goto method_loop
   mro_end:
 
   end:
 .end
+.sub 'add_parent' :method :multi(_,P6metaclass,_)
+    .param pmc obj
+    .param pmc parentclass
+    $P0 = getattribute obj, 'parrotclass'
+    self.'add_parent'($P0, parentclass)
+.end
 
 
 =item add_method(name, method, [, 'to'=>parrotclass])
@@ -346,7 +386,8 @@
 .end
 
 
-=item register(parrotclass [, 'name'=>name] [, 'protoobject'=>proto] [, 'parent'=>parentclass] [, 'hll'=>hll])
+=item register(parrotclass [, 'name'=>name] [, 'protoobject'=>proto]
+               [, 'parent'=>parentclass] [, 'hll'=>hll] [, 'how'=>how)
 
 Sets objects of type C<parrotclass> to use C<protoobject>,
 and verifies that C<parrotclass> has P6object methods defined
@@ -359,6 +400,9 @@
 to map to a class name that already exists in Parrot (e.g., 'Hash'
 or 'Object').
 
+The C<how> parameter allows you to specify an already-existing metaclass
+instance to be used for this class rather than creating a new one.
+
 =cut
 
 .sub 'register' :method
@@ -400,11 +444,11 @@
     $S0 = parentclass
     parentclass = split ' ', $S0
   parent_array:
-    .local pmc iter, item
-    iter = new 'Iterator', parentclass
+    .local pmc it, item
+    it = iter parentclass
   parent_loop:
-    unless iter goto parent_done
-    item = shift iter
+    unless it goto parent_done
+    item = shift it
     $S0 = item
     $P0 = split ';', $S0
     $I0 = elements $P0
@@ -423,7 +467,10 @@
     self.'add_parent'(item, 'to'=>parrotclass)
     goto parent_loop
   parent_done:
+    $I0 = isa parrotclass, 'P6object'
+    if $I0 goto isa_p6object_already
     self.'add_parent'('P6object', 'to'=>parrotclass)
+  isa_p6object_already:
 
     ##  determine parrotclass' canonical p6-name
     .local string name
@@ -441,16 +488,20 @@
     ns = split '::', name
   have_ns:
 
-    ##  get the metaclass (how) from :protoobject, or create one
+    ##  get the metaclass (how) from :how, or :protoobject, or create one
     .local pmc how
+    how = options['how']
+    unless null how goto have_how
     $P0 = options['protoobject']
     if null $P0 goto make_how
     how = $P0.'HOW'()
-    goto have_how
+    goto how_setup
   make_how:
     ##  create a metaclass for parrotclass
-    how = new 'P6metaclass'
+    $P0 = typeof self
+    how = new $P0
     setattribute how, 'parrotclass', parrotclass
+  have_how:
 
     ##  create an anonymous class for the protoobject
     .local pmc protoclass, protoobject
@@ -469,10 +520,10 @@
     methodname = shift protooverrides
     unless methodname goto override_loop
     $P0 = parrotclass.'inspect'('all_parents')
-    iter = new 'Iterator', $P0
+    it = iter $P0
   method_loop:
-    unless iter goto method_end
-    $P0 = shift iter
+    unless it goto method_end
+    $P0 = shift it
     $P0 = $P0.'methods'()
     $P0 = $P0[methodname]
     if null $P0 goto method_loop
@@ -506,7 +557,7 @@
     push ns, 'EXPORT'
     push ns, 'ALL'
     set_root_global ns, $S0, protoobject
-    goto have_how
+    goto how_setup
 
     ##  anonymous classes have empty strings for shortname and longname
   anonymous_class:
@@ -515,7 +566,7 @@
     setattribute how, 'longname', longname
     setattribute how, 'shortname', shortname
 
-  have_how:
+  how_setup:
     ##  attach the metaclass object to the parrotclass
     setprop parrotclass, 'metaclass', how
 
@@ -576,7 +627,7 @@
     goto have_parrotclass
   have_parrotclass:
 
-    .local pmc attrlist, iter
+    .local pmc attrlist, it
     attrlist = options['attr']
     if null attrlist goto attr_done
     $I0 = does attrlist, 'array'
@@ -584,10 +635,10 @@
     $S0 = attrlist
     attrlist = split ' ', $S0
   have_attrlist:
-    iter = new 'Iterator', attrlist
+    it = iter attrlist
   iter_loop:
-    unless iter goto iter_end
-    $S0 = shift iter
+    unless it goto iter_end
+    $S0 = shift it
     unless $S0 goto iter_loop
     addattribute parrotclass, $S0
     goto iter_loop
@@ -751,21 +802,26 @@
     $P0 = self.'HOW'()
     parrotclass = $P0.'get_parrotclass'(self)
 
+    # Perl6Object (legacy) and Mu accept anything.
     $S0 = parrotclass
     if $S0 == 'Perl6Object' goto accept_anyway
+    if $S0 == 'Mu' goto accept_anyway
 
-    $I0 = isa topic, 'Junction'
-    if $I0 goto normal_check
-
-    if $S0 == 'Any' goto accept_anyway
-
-  normal_check:
+    # Otherwise, just try a normal check.
     $I0 = can topic, 'HOW'
     unless $I0 goto end
     topicwhat = topic.'WHAT'()
     $I0 = isa topicwhat, parrotclass
     if $I0 goto end
     $I0 = does topic, parrotclass
+    if $I0 goto end
+
+    # If this fails, and we want Any, and it's something form outside
+    # of the Perl 6 world, we'd best just accept it.
+    unless $S0 == 'Any' goto end
+    $I0 = isa topicwhat, 'Perl6Object'
+    unless $I0 goto accept_anyway
+    $I0 = 0
     goto end
 
   accept_anyway:
@@ -795,4 +851,3 @@
 #   fill-column: 100
 # End:
 # vim: expandtab shiftwidth=4 ft=pir:
-

Modified: branches/orderedhash_revamp/runtime/parrot/library/PGE/Dumper.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/PGE/Dumper.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/library/PGE/Dumper.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -26,7 +26,7 @@
     .param pmc dumper
     .param string label
     .local string indent, subindent
-    .local pmc iter, val
+    .local pmc it, val
     .local string key
     .local pmc hash, array
     .local int hascapts
@@ -41,16 +41,16 @@
     hascapts = 0
     hash = self.'hash'()
     if_null hash, dump_array
-    iter = new 'Iterator', hash
+    it = iter hash
   dump_hash_1:
-    unless iter goto dump_array
+    unless it goto dump_array
     if hascapts goto dump_hash_2
     print " {"
     hascapts = 1
   dump_hash_2:
     print "\n"
     print subindent
-    key = shift iter
+    key = shift it
     val = hash[key]
     print "<"
     print key
@@ -102,8 +102,10 @@
 
     .local pmc capt
     .local int spi, spc
-    .local pmc iter
+    .local pmc it
     .local string prefix1, prefix2
+    .local pmc jmpstack
+    jmpstack = new 'ResizableIntegerArray'
 
     if has_b2 goto start
     b2 = "]"
@@ -139,7 +141,7 @@
     $I0 = defined capt[spi]
     unless $I0 goto subpats_2
     $P0 = capt[spi]
-    bsr dumper
+    local_branch jmpstack, dumper
   subpats_2:
     inc spi
     goto subpats_1
@@ -147,17 +149,17 @@
   subrules:
     capt = self.'hash'()
     if_null capt, end
-    iter = new 'Iterator', capt
+    it = iter capt
   subrules_1:
-    unless iter goto end
-    $S0 = shift iter
+    unless it goto end
+    $S0 = shift it
     prefix1 = concat prefix, '<'
     concat prefix1, $S0
     concat prefix1, ">"
     $I0 = defined capt[$S0]
     unless $I0 goto subrules_1
     $P0 = capt[$S0]
-    bsr dumper
+    local_branch jmpstack, dumper
     goto subrules_1
 
   dumper:
@@ -165,7 +167,7 @@
     unless $I0 goto dumper_0
     $S0 = $P0.'dump_str'(prefix1, b1, b2)
     out .= $S0
-    ret
+    local_return jmpstack
   dumper_0:
     $I0 = does $P0, 'array'
     unless $I0 goto dumper_3
@@ -183,14 +185,14 @@
     inc $I0
     goto dumper_1
   dumper_2:
-    ret
+    local_return jmpstack
   dumper_3:
     out .= prefix1
     out .= ': '
     $S0 = $P0
     out .= $S0
     out .= "\n"
-    ret
+    local_return jmpstack
 
   end:
     .return (out)
@@ -462,7 +464,7 @@
     .param pmc dumper
     .param string label
     .local string indent, subindent
-    .local pmc iter, val
+    .local pmc it, val
     .local string key
     .local pmc hash, array
 
@@ -470,12 +472,12 @@
     print " {"
     hash = self
     if_null hash, dump_rest
-    iter = new 'Iterator', hash
+    it = iter hash
   dump_hash:
-    unless iter goto dump_rest
+    unless it goto dump_rest
     print "\n"
     print subindent
-    key = shift iter
+    key = shift it
     val = hash[key]
     print "<"
     print key

Modified: branches/orderedhash_revamp/runtime/parrot/library/PGE/Glob.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/PGE/Glob.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/library/PGE/Glob.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -7,7 +7,8 @@
 
 =head1 DESCRIPTION
 
-A parser for shell-stype glob notation.
+A parser for shell-stype glob notation. See C<Tcl::Glob> for a
+slightly different glob syntax.
 
 =head2 Functions
 

Modified: branches/orderedhash_revamp/runtime/parrot/library/PGE/Hs.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/PGE/Hs.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/library/PGE/Hs.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -164,7 +164,9 @@
     .local int ari, arc
     .local int tmpi, cond
     .local string tmps, key
-    .local pmc capt, iter, subelm, elm
+    .local pmc capt, it, subelm, elm
+    .local pmc jmpstack
+    jmpstack = new 'ResizableIntegerArray'
 
     out = ""
 
@@ -192,7 +194,7 @@
     cond = defined capt[spi]
     unless cond goto subpats_fail
     elm = capt[spi]
-    bsr dumper
+    local_branch jmpstack, dumper
     inc spi
     goto subpats_loop
   subpats_fail:
@@ -204,11 +206,10 @@
     out .= "] ["
     capt = self.'hash'()
     if_null capt, end
-    iter = new 'Iterator', capt
-    iter = 0
-    unless iter goto end
+    it = iter capt
+    unless it goto end
   subrules_body:
-    key = shift iter
+    key = shift it
     cond = defined capt[key]
     unless cond goto subrules_fail
     elm = capt[key]
@@ -216,15 +217,15 @@
     tmps = escape key
     out .= tmps
     out .= '", '
-    bsr dumper
+    local_branch jmpstack, dumper
     out .= ")"
-    unless iter goto end
+    unless it goto end
     out .= ", "
     goto subrules_body
   subrules_fail:
     out .= PGE_FAIL
-    key = shift iter
-    unless iter goto end
+    key = shift it
+    unless it goto end
     goto subrules_body
 
   dumper:
@@ -234,20 +235,20 @@
     unless $I0 goto dumper_string
     tmps = elm."dump_hs"()
     out .= tmps
-    ret
+    local_return jmpstack
   dumper_string:
     $S0 = elm
     tmps = escape $S0
     out .= 'PGE_String "'
     out .= tmps
     out .= '"'
-    ret
+    local_return jmpstack
   dumper_fail:
     out .= PGE_FAIL
-    ret
+    local_return jmpstack
   dumper_done:
     out .= "]"
-    ret
+    local_return jmpstack
   dumper_array:
     ari = 0
     arc = elements elm

Modified: branches/orderedhash_revamp/runtime/parrot/library/PGE/Perl6Grammar.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/PGE/Perl6Grammar.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/library/PGE/Perl6Grammar.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -103,6 +103,7 @@
       | '<' (<-[>]>*:) '>'
       | \xc2\xab (.*?) \xc2\xbb
       | \xab (<-[\xbb]>*:) \xbb
+      | ( 'sym<' <-[>]>*: '>' )
       | (\S+)
       ]
       END_ARG_RULE
@@ -169,15 +170,15 @@
     goto stmt_loop
   stmt_end:
 
-    .local pmc initpir, rulepir, iter, ns
+    .local pmc initpir, rulepir, it, ns
     .local string namespace
     initpir = new 'CodeString'
     rulepir = new 'CodeString'
-    iter = new 'Iterator', nstable
+    it = iter nstable
   iter_loop:
-    unless iter goto iter_end
-    namespace = shift iter
-    ns = iter[namespace]
+    unless it goto iter_end
+    namespace = shift it
+    ns  = it[namespace]
     $P0 = ns['rule']
     rulepir .= $P0
     if namespace == 'PGE::Grammar' goto ns_optable
@@ -353,15 +354,15 @@
     optable = $P0['optable']
 
     ##   build the list of traits
-    .local pmc iter
+    .local pmc it
     .local string traitlist
     $P0 = stmt[0]
-    iter = new 'Iterator', $P0
+    it = iter $P0
     traitlist = ''
   trait_loop:
-    unless iter goto trait_end
+    unless it goto trait_end
     .local pmc t
-    t = shift iter
+    t = shift it
     .local string trait, arg
     trait = t['trait']
     $P0 = t['arg']

Modified: branches/orderedhash_revamp/runtime/parrot/library/PGE/Text.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/PGE/Text.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/library/PGE/Text.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -50,7 +50,6 @@
     .local int balanced                            # in balanced match
     .local pmc stack                               # lookket backtracking
 
-    stack = new 'ResizableStringArray'
     $P0 = get_hll_global ['PGE'], 'Match'
     (mob, pos, target) = $P0.'new'(tgt)
     from = pos
@@ -88,6 +87,7 @@
     if $I0 < 0 goto end                            # no leading delim fails
     lookket = ''
     balanced = 1
+    stack = new 'ResizableStringArray'
   next:
     $S0 = substr target, pos, 1                    # check current pos
     if $S0 == '' goto fail                         # end of string -> fail

Modified: branches/orderedhash_revamp/runtime/parrot/library/PGE/Util.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/PGE/Util.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/library/PGE/Util.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -39,13 +39,13 @@
     .param pmc mob                                 # match object
     .param pmc list            :slurpy             # message arguments
 
-    .local pmc iter
+    .local pmc it
     .local string message
     message = ''
-    iter = new 'Iterator', list
+    it = iter list
   iter_loop:
-    unless iter goto iter_end
-    $S0 = shift iter
+    unless it goto iter_end
+    $S0 = shift it
     message .= $S0
     goto iter_loop
   iter_end:
@@ -100,13 +100,13 @@
     .param pmc mob                                 # match object
     .param pmc list            :slurpy             # message arguments
 
-    .local pmc iter
+    .local pmc it
     .local string message
     message = ''
-    iter = new 'Iterator', list
+    it = iter list
   iter_loop:
-    unless iter goto iter_end
-    $S0 = shift iter
+    unless it goto iter_end
+    $S0 = shift it
     message .= $S0
     goto iter_loop
   iter_end:

Modified: branches/orderedhash_revamp/runtime/parrot/library/Protoobject.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/Protoobject.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/library/Protoobject.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -120,11 +120,11 @@
     subc = subclass baseclass, name
 
     unless attrs goto done_attrs
-    .local pmc iter
-    iter = new 'Iterator', attrs
+    .local pmc it
+    it = iter attrs
   iter_loop:
-    unless iter goto done_attrs
-    $S0 = shift iter
+    unless it goto done_attrs
+    $S0 = shift it
     addattribute subc, $S0
     goto iter_loop
   done_attrs:

Modified: branches/orderedhash_revamp/runtime/parrot/library/Range.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/Range.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/library/Range.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -49,9 +49,6 @@
   addattribute $P1, 'exhausted'
 .end
 
-# RT#42430
-# :method is only specified here so we can get 'self'
-
 =head1 :vtable
 
 =head2 init
@@ -175,9 +172,6 @@
   .return (from)
 .end
 
-# RT#42430
-# :method is only specified on the shift_* vtables for self.
-
 # Wrappers for the shift_pmc vtable - rely on autoboxing.
 .sub 'shift_integer' :vtable :method
   $P0 = shift self
@@ -226,9 +220,6 @@
   .return (to)
 .end
 
-# RT#42430
-# :method is only specified on the shift_* vtables for self.
-
 # Wrappers for the shift_pmc vtable - rely on autoboxing.
 .sub 'pop_integer' :vtable :method
   $P0 = pop self

Modified: branches/orderedhash_revamp/runtime/parrot/library/SDL/StopWatch.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/SDL/StopWatch.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/library/SDL/StopWatch.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -282,8 +282,7 @@
     $I0 = array
     if $I0 == 0 goto DISABLE
 
-    array = new 'Iterator', array
-    array = .ITERATE_FROM_START
+    array = iter array
 LOOP:
     unless array goto END
     $P0 = shift array

Added: branches/orderedhash_revamp/runtime/parrot/library/SQLite3.pir
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/runtime/parrot/library/SQLite3.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,135 @@
+# Copyright (C) 2008-2009, Parrot Foundation.
+# $Id$
+
+.namespace ['SQLite3']
+
+.const int SQLITE_OK         =   0   # Successful result
+# beginning-of-error-codes
+.const int SQLITE_ERROR      =   1   # SQL error or missing database
+.const int SQLITE_INTERNAL   =   2   # Internal logic error in SQLite
+.const int SQLITE_PERM       =   3   # Access permission denied
+.const int SQLITE_ABORT      =   4   # Callback routine requested an abort
+.const int SQLITE_BUSY       =   5   # The database file is locked
+.const int SQLITE_LOCKED     =   6   # A table in the database is locked
+.const int SQLITE_NOMEM      =   7   # A malloc() failed
+.const int SQLITE_READONLY   =   8   # Attempt to write a readonly database
+.const int SQLITE_INTERRUPT  =   9   # Operation terminated by sqlite3_interrupt()
+.const int SQLITE_IOERR      =  10   # Some kind of disk I/O error occurred
+.const int SQLITE_CORRUPT    =  11   # The database disk image is malformed
+.const int SQLITE_NOTFOUND   =  12   # NOT USED. Table or record not found
+.const int SQLITE_FULL       =  13   # Insertion failed because database is full
+.const int SQLITE_CANTOPEN   =  14   # Unable to open the database file
+.const int SQLITE_PROTOCOL   =  15   # NOT USED. Database lock protocol error
+.const int SQLITE_EMPTY      =  16   # Database is empty
+.const int SQLITE_SCHEMA     =  17   # The database schema changed
+.const int SQLITE_TOOBIG     =  18   # String or BLOB exceeds size limit
+.const int SQLITE_CONSTRAINT =  19   # Abort due to constraint violation
+.const int SQLITE_MISMATCH   =  20   # Data type mismatch
+.const int SQLITE_MISUSE     =  21   # Library used incorrectly
+.const int SQLITE_NOLFS      =  22   # Uses OS features not supported on host
+.const int SQLITE_AUTH       =  23   # Authorization denied
+.const int SQLITE_FORMAT     =  24   # Auxiliary database format error
+.const int SQLITE_RANGE      =  25   # 2nd parameter to sqlite3_bind out of range
+.const int SQLITE_NOTADB     =  26   # File opened that is not a database file
+.const int SQLITE_ROW        =  100  # sqlite3_step() has another row ready
+.const int SQLITE_DONE       =  101  # sqlite3_step() has finished executing
+
+.sub '_sqlite_init' :load
+    .local pmc libname
+    .local pmc function
+    .local pmc sqlite_funcs
+
+    libname = loadlib 'libsqlite3'
+    set_global '_sqlite3', libname
+
+    sqlite_funcs = new 'ResizableStringArray'
+    push sqlite_funcs, 'step'
+    push sqlite_funcs, 'ip'
+    push sqlite_funcs, 'finalize'
+    push sqlite_funcs, 'ip'
+    push sqlite_funcs, 'close'
+    push sqlite_funcs, 'ip'
+    push sqlite_funcs, 'errmsg'
+    push sqlite_funcs, 'tp'
+    push sqlite_funcs, 'errcode'
+    push sqlite_funcs, 'ip'
+    push sqlite_funcs, 'bind_int'
+    push sqlite_funcs, 'ipii'
+    push sqlite_funcs, 'bind_double'
+    push sqlite_funcs, 'ipid'
+    push sqlite_funcs, 'bind_text'
+    push sqlite_funcs, 'ipitii'
+    push sqlite_funcs, 'column_name'
+    push sqlite_funcs, 'tpi'
+    push sqlite_funcs, 'column_count'
+    push sqlite_funcs, 'ip'
+    push sqlite_funcs, 'column_type'
+    push sqlite_funcs, 'ipi'
+    push sqlite_funcs, 'column_int'
+    push sqlite_funcs, 'ipi'
+    push sqlite_funcs, 'column_double'
+    push sqlite_funcs, 'lpi'
+    push sqlite_funcs, 'column_text'
+    push sqlite_funcs, 'tpi'
+
+    function  = dlfunc libname, 'sqlite3_open', 'itV'
+    set_global 'open_raw', function
+
+    function  = dlfunc libname, 'sqlite3_prepare_v2', 'iptiVp'
+    set_global 'prepare_raw', function
+
+    .local pmc list_iter
+    list_iter = iter sqlite_funcs
+    .local string func_name, signature
+    .local pmc    function
+
+  list_loop:
+    unless list_iter goto done
+    func_name = shift list_iter
+    signature = shift list_iter
+    $S0 = concat 'sqlite3_', func_name
+    function  = dlfunc libname, $S0, signature
+    set_global func_name, function
+    goto list_loop
+
+  done:
+
+.end
+
+.sub 'open'
+  .param string connectstr
+  .local pmc dbhandle
+  .local pmc open_raw
+  .local int rc
+
+  open_raw = get_global 'open_raw'
+  dbhandle = new 'Pointer'
+  rc = open_raw(connectstr, dbhandle)
+
+  .return(dbhandle)
+.end
+
+.sub 'prepare'
+  .param pmc dbhandle
+  .param string psstr
+  .local int psstrlen
+  .local pmc pshandle
+  .local pmc dummy
+  .local pmc prepare_raw
+  .local int rc
+
+  prepare_raw = get_global 'prepare_raw'
+
+  pshandle = new 'Pointer'
+  dummy = new 'Pointer'
+  psstrlen = length psstr
+  rc = prepare_raw(dbhandle, psstr, psstrlen, pshandle, dummy)
+
+  .return(pshandle)
+.end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/runtime/parrot/library/Stream/Combiner.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/Stream/Combiner.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/library/Stream/Combiner.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -118,8 +118,7 @@
     if i == 0 goto NOT_CONNECTED
 
     # create an iterator for the sources
-    new sources, 'Iterator', sources
-    set sources, .ITERATE_FROM_START
+    sources = iter sources
 
 LOOP:
     # stream is connected if no sources are left
@@ -162,8 +161,7 @@
     if i == 0 goto END_OF_STREAM
 
     # create an iterator for the sources
-    new sources, 'Iterator', sources
-    set sources, .ITERATE_FROM_START
+    sources = iter sources
 
     # create the string array
     new args, 'ResizableStringArray'

Modified: branches/orderedhash_revamp/runtime/parrot/library/Tcl/Glob.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/Tcl/Glob.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/library/Tcl/Glob.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -7,7 +7,33 @@
 
 =head1 DESCRIPTION
 
-A parser for Tcl-stype glob notation.
+A PGE-based parser for glob notation. See C<PGE::Glob> for a slightly
+different glob syntax.
+
+The following special characters are supported
+
+=over 4
+
+=item C<?>
+
+Matches any single character
+
+=item C<*>
+
+Matches any number of any characters, including no characters.
+
+=item C<[chars]>
+
+Matches any character in the given set. Sets are either a sequence of explicit
+characters, or a range specified with a dash, e.g. [aeiou] matches lower
+case ASCII vowels, while [a-z] matches any lowercase ASCII letter.
+
+=item C<\x>
+
+Match a literal character, e.g. \* matches the literal C<*>, avoiding its
+special meaning.
+
+=back
 
 =head2 Functions
 
@@ -376,6 +402,9 @@
 This is basically a cut and paste of PGE::Glob. There should probably be
 much less code duplication here.
 
+While originally implemented based on Tcl's C<[string match]> globbing
+syntax, this code is useful enough to be part of parrot's core.
+
 =head1 AUTHOR
 
 PGE::Glob was originally authored by Jonathan Scott Duff (duff at pobox.com),

Modified: branches/orderedhash_revamp/runtime/parrot/library/Test/Class.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/Test/Class.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/library/Test/Class.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -258,13 +258,13 @@
     .local pmc attribute
     attribute = getattribute self, name
 
-    .local pmc iter
-    iter = new 'Iterator', attribute
+    .local pmc it
+    it = iter attribute
 
     .local string meth_name
   iter_loop:
-    unless iter goto loop_end
-    meth_name = shift iter
+    unless it goto loop_end
+    meth_name = shift it
     self.meth_name()
     goto iter_loop
   loop_end:
@@ -276,14 +276,14 @@
     .local pmc tests
     tests = getattribute self, 'tests'
 
-    .local pmc iter
-    iter = new 'Iterator', tests
+    .local pmc it
+    it = iter tests
 
     .local string meth_name
   iter_loop:
-    unless iter goto loop_end
+    unless it goto loop_end
     self.'loop_over_methods'( 'setup' )
-    meth_name = shift iter
+    meth_name = shift it
     self.meth_name()
     self.'loop_over_methods'( 'teardown' )
     goto iter_loop

Modified: branches/orderedhash_revamp/runtime/parrot/library/Test/More.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/Test/More.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/library/Test/More.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -13,7 +13,7 @@
     .local pmc exports, curr_namespace, test_namespace
     curr_namespace = get_namespace
     test_namespace = get_namespace [ 'Test'; 'More' ]
-    exports        = split ' ', 'plan diag ok nok is is_deeply like isa_ok skip isnt todo'
+    exports        = split ' ', 'plan diag ok nok is is_deeply like isa_ok skip isnt todo throws_like lives_ok dies_ok'
 
     test_namespace.'export_to'(curr_namespace, exports)
 
@@ -92,19 +92,20 @@
 
 =item C<ok( passed, description )>
 
-Records a test as pass or fail depending on the truth of the integer C<passed>,
+Records a test as pass or fail depending on the truth of the PMC C<passed>,
 recording it with the optional test description in C<description>.
 
 =cut
 
 .sub ok
-    .param int    passed
+    .param pmc    passed
     .param string description     :optional
 
     .local pmc test
     get_hll_global test, [ 'Test'; 'More' ], '_test'
 
-    test.'ok'( passed, description )
+    $I0 = istrue passed
+    test.'ok'( $I0, description )
 .end
 
 =item C<nok( passed, description )>
@@ -115,14 +116,14 @@
 =cut
 
 .sub nok
-    .param int passed
+    .param pmc passed
     .param string description :optional
 
     .local pmc test
     get_hll_global test, [ 'Test'; 'More' ], '_test'
 
     .local int reverse_passed
-    reverse_passed = not passed
+    reverse_passed = isfalse passed
 
     test.'ok'( reverse_passed, description )
 .end
@@ -140,12 +141,17 @@
 If there is a mismatch, the current implementation takes the type of C<left> as
 the proper type for the comparison, converting any numeric arguments to floats.
 Note that there is a hard-coded precision check to avoid certain rounding
-errors.  It's not entirely robust, but it's not completely awful either.
+errors.
 
-Patches very welcome.  Multi-dispatch is a bit tricky here.
+=item C<is( left, right, description, precision )>
 
-This probably doesn't handle all of the comparisons you want, but it's easy to
-add more.
+For C<Float> only, an optional 4th parameter is allowed, a numeric precision.
+If specified, then the floats are only compared within the tolerance of the
+precision: e.g.:
+
+ is(123.456, 123.457, 'close enough?', 1e-2)
+
+will pass.
 
 =cut
 
@@ -178,31 +184,28 @@
   done:
 .end
 
-.sub is :multi(PMC, Float)
-    .param pmc left
-    .param pmc right
-    .param pmc description :optional
-    .param int have_desc   :opt_flag
-    .param pmc precision   :optional
-    .param int have_prec   :opt_flag
+.sub is :multi(_, Float)
+    .param num    left
+    .param num    right
+    .param string description :optional
+    .param int    have_desc   :opt_flag
+    .param num    precision   :optional
+    .param int    have_prec   :opt_flag
 
     .local pmc test
     get_hll_global test, [ 'Test'; 'More' ], '_test'
 
-    .local num l, r
-    .local int pass
-    l    = left
-    r    = right
-    pass = iseq l, r
+    if have_prec goto check_precision
 
-    if     pass      goto report
-    unless have_prec goto report
+    .local int pass
+    pass = iseq left, right
+    goto report
 
-    .local num diff, prec_num
-    prec_num = precision
-    diff     = l - r
-    diff     = abs diff
-    pass     = isle diff, prec_num
+  check_precision:
+    .local num diff
+    diff = left - right
+    diff = abs diff
+    pass = isle diff, precision
 
   report:
     test.'ok'( pass, description )
@@ -215,7 +218,7 @@
     l_string    = left
     r_string    = right
 
-    diagnostic = _make_diagnostic( l_string, r_string )
+    diagnostic = _make_diagnostic( left, right )
     test.'diag'( diagnostic )
   done:
 .end
@@ -518,9 +521,32 @@
 
     .local string left_value
     .local string right_value
-    right_value = pop position
-    left_value  = pop position
+    .local pmc left, right
+
+    right = pop position
+    left  = pop position
+
+ check_right_null:
+    .local int rnull
+    rnull = isnull right
+    unless rnull goto set_right
+    right_value = 'nonexistent'
+    goto check_left_null
+
+ set_right:
+    right_value = right
+
+ check_left_null:
+    .local int lnull
+    lnull = isnull left
+    unless lnull goto set_left
+    left_value = 'undef'
+    goto create_diag
 
+ set_left:
+    left_value = left
+
+ create_diag:
     .local string nested_path
     nested_path = join '][', position
 
@@ -577,8 +603,8 @@
     .local pmc r_iter
     .local int count
 
-    l_iter = new 'Iterator', l_array
-    r_iter = new 'Iterator', r_array
+    l_iter = iter l_array
+    r_iter = iter r_array
     l_iter = 0
     r_iter = 0
     count  = 0
@@ -641,7 +667,7 @@
     .local pmc l_iter
     .local int count
 
-    l_iter = new 'Iterator', l_hash
+    l_iter = iter l_hash
     l_iter = 0
     count  = 0
 
@@ -814,6 +840,231 @@
     .return( equal )
 .end
 
+=item C<dies_ok( codestring, description )>
+
+Takes PIR code in C<codestring> and an optional message in C<description>.
+Passes a test if the PIR code throws any exception, fails a test otherwise.
+
+=cut
+
+.sub dies_ok
+    .param string target
+    .param string description :optional
+
+    .local pmc test
+    get_hll_global test, [ 'Test'; 'More' ], '_test'
+
+    .local pmc comp
+    .local pmc compfun
+    .local pmc compiler
+    compiler = compreg 'PIR'
+
+    .local pmc eh
+    eh = new 'ExceptionHandler'
+    set_addr eh, handler            # set handler label for exceptions
+    push_eh eh
+
+    compfun = compiler(target)
+    compfun()                       # eval the target code
+
+    pop_eh
+
+    # if it doesn't throw an exception fail
+    test.'ok'( 0, description )
+    test.'diag'('no error thrown')
+
+    goto done
+
+  handler:
+    .local pmc ex
+    .local string error_msg
+    .local string diagnostic
+
+    .get_results (ex)
+    pop_eh
+    error_msg = ex
+    test.'ok'( 1, description )
+
+  done:
+
+.end
+
+=item C<lives_ok( codestring, description )>
+
+Takes PIR code in C<codestring> and an optional message in C<description>.
+Passes a test if the PIR does not throw any exception, fails a test otherwise.
+
+=cut
+
+.sub lives_ok
+    .param string target
+    .param string description :optional
+
+    .local pmc test
+    get_hll_global test, [ 'Test'; 'More' ], '_test'
+
+    .local pmc comp
+    .local pmc compfun
+    .local pmc compiler
+    compiler = compreg 'PIR'
+
+    .local pmc eh
+    eh = new 'ExceptionHandler'
+    set_addr eh, handler            # set handler label for exceptions
+    push_eh eh
+
+    compfun = compiler(target)
+    compfun()                       # eval the target code
+
+    pop_eh
+
+    # if it doesn't throw an exception pass
+    test.'ok'( 1, description )
+
+    goto done
+
+  handler:
+    .local pmc ex
+    .local string error_msg
+    .local string diagnostic
+
+    .get_results (ex)
+    pop_eh
+    error_msg = ex
+    test.'ok'( 0, description )
+    test.'diag'(error_msg)
+
+  done:
+
+.end
+
+=item C<throws_like( codestring, pattern, description )>
+
+Takes PIR code in C<codestring> and a PGE pattern to match in C<pattern>, as
+well as an optional message in C<description>. Passes a test if the PIR throws
+an exception that matches the pattern, fails the test otherwise.
+
+=cut
+
+.sub throws_like
+    .param string target
+    .param string pattern
+    .param string description :optional
+
+    .local pmc test
+    get_hll_global test, [ 'Test'; 'More' ], '_test'
+
+    .local pmc comp
+    .local pmc compfun
+    .local pmc compiler
+    compiler = compreg 'PIR'
+
+    .local pmc eh
+    eh = new 'ExceptionHandler'
+    set_addr eh, handler            # set handler label for exceptions
+    push_eh eh
+
+    compfun = compiler(target)
+    compfun()                       # eval the target code
+
+    pop_eh
+
+    # if it doesn't throw an exception, fail
+    test.'ok'( 0, description )
+    test.'diag'( 'no error thrown' )
+
+    goto done
+
+  handler:
+    .local pmc ex
+    .local string error_msg
+    .get_results (ex)
+    pop_eh
+    error_msg = ex
+    like(error_msg, pattern, description)
+
+  done:
+.end
+
+=item C<throws_substring( codestring, text, description )>
+
+Takes PIR code in C<codestring> and a string to match in C<text>, as
+well as an optional message in C<description>. Passes a test if the PIR throws
+an exception that matches the pattern, fails the test otherwise.
+
+=cut
+
+.sub throws_substring
+    .param string target
+    .param string text
+    .param string description :optional
+
+    .local pmc test
+    get_hll_global test, [ 'Test'; 'More' ], '_test'
+
+    .local pmc comp
+    .local pmc compfun
+    .local pmc compiler
+    compiler = compreg 'PIR'
+
+    .local pmc eh
+    eh = new 'ExceptionHandler'
+    set_addr eh, handler            # set handler label for exceptions
+    push_eh eh
+
+    compfun = compiler(target)
+    compfun()                       # eval the target code
+
+    pop_eh
+
+    # if it doesn't throw an exception, fail
+    test.'ok'( 0, description )
+    test.'diag'( 'no error thrown' )
+
+    goto done
+
+  handler:
+    .local pmc ex
+    .local string error_msg
+    .get_results (ex)
+    pop_eh
+    error_msg = ex
+    substring(error_msg, text, description)
+
+  done:
+.end
+
+=item C<substring( target, text, description )>
+
+Similar to is, but using the index opcode to compare the string passed as
+C<text> to the string passed as C<target>.  It passes if C<text> is a substring
+of C<target> and fails otherwise.  This will report the results with the
+optional test description in C<description>.
+
+=cut
+
+.sub substring
+    .param string target
+    .param string text
+    .param string description :optional
+
+    .local pmc test
+    .local string diagnostic
+    get_hll_global test, [ 'Test'; 'More' ], '_test'
+    $I0 = index target, text
+    $I0 = isne $I0, -1
+    test.'ok'( $I0, description )
+    if $I0 goto done
+    diagnostic = "substring failed: '"
+    diagnostic .= target
+    diagnostic .= "' does not contain '"
+    diagnostic .= text
+    diagnostic .= "'"
+    test.'diag'(diagnostic)
+  done:
+.end
+
+
 =item C<like( target, pattern, description )>
 
 Similar to is, but using the Parrot Grammar Engine to compare the string
@@ -854,7 +1105,11 @@
   match_success:
     goto pass_it
   match_fail:
-    diagnostic = "match failed"
+    diagnostic = "match failed: target '"
+    diagnostic .= target
+    diagnostic .= "' does not match pattern '"
+    diagnostic .= pattern
+    diagnostic .= "'"
     goto report
   rule_fail:
     diagnostic = "rule error"
@@ -995,7 +1250,7 @@
 
 =head1 COPYRIGHT
 
-Copyright (C) 2005-2008, Parrot Foundation.
+Copyright (C) 2005-2009, Parrot Foundation.
 
 =cut
 

Modified: branches/orderedhash_revamp/runtime/parrot/library/YAML/Dumper/Default.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/YAML/Dumper/Default.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/library/YAML/Dumper/Default.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -120,7 +120,7 @@
 .sub genericHash :method
     .param string name
     .param pmc hash
-    .local pmc iter
+    .local pmc it
     .local string key
     .local pmc val
     .local pmc keys
@@ -133,13 +133,12 @@
     print " {"
 
     new keys, "ResizablePMCArray"
-    new iter, "Iterator", hash
-    set iter, 0
+    it = iter hash
 
   iter_loop:
-    unless iter, iter_end
+    unless it, iter_end
 
-    shift key, iter
+    shift key, it
     push keys, key
     branch iter_loop
 

Deleted: branches/orderedhash_revamp/runtime/parrot/library/YAML/Parser/Syck.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/YAML/Parser/Syck.pir	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,228 +0,0 @@
-# Copyright (C) 2005-2008, Parrot Foundation.
-# $Id$
-
-=head1 NAME
-
-YAML/Parser/Syck.pir - Interface to libsyck
-
-=head1 SYNOPSIS
-
-This won't work yet with a standard libsyck, as libsyck needs to be
-aware of Parrot.
-
-=head1 DESCRIPTION
-
-Ask libsyck to do some work.
-Uses the native call interface.
-Needs synchronous callbacks.
-
-=head1 METHODS
-
-=cut
-
-=head2 load
-
-Parses a YAML string and returns a data structure.
-
-=cut
-
-.include "datatypes.pasm"
-
-.sub load
-    .param string yaml_string
-
-    # prepare user data
-    .local pmc user_data
-    user_data = new 'String'
-
-    .local string library_name
-    library_name = 'libsyck'
-    .local pmc libsyck
-    libsyck = loadlib library_name
-    unless libsyck goto NOT_LOADED
-
-    .local int is_defined
-
-    # getting a handle on a YAML parser
-    .local pmc syck_new_parser
-    syck_new_parser = dlfunc libsyck, "syck_new_parser", "p"
-    .local pmc parser
-    ( parser ) = syck_new_parser( )
-    is_defined = defined parser
-    unless is_defined goto NOT_DEFINED
-
-    # A Sub that can be given to the library
-    # this callback function will eventually by called by the library
-    .const 'Sub' yaml_handler = "_yaml_handler"
-    .local pmc yaml_handler_wrapped
-    yaml_handler_wrapped = new_callback yaml_handler, user_data, "vUp"	# Z in pdd16
-
-    .local pmc synchronous
-    synchronous = new 'Integer'
-    synchronous = 1
-    setprop user_data, "_synchronous", synchronous
-
-    # call syck_parser_handler
-    .local pmc syck_parser_handler
-    syck_parser_handler = dlfunc libsyck, "syck_parser_handler", "vpp"
-    syck_parser_handler( parser, yaml_handler_wrapped )
-
-    # tell about the user_data
-    .local pmc syck_parser_bonus
-    syck_parser_bonus = dlfunc libsyck, "syck_parser_bonus", "vpP"
-    syck_parser_bonus( parser, user_data )
-
-    # tell about the string
-    .local pmc syck_parser_str, read
-    read = new 'UnManagedStruct'
-    pin yaml_string
-    syck_parser_str = dlfunc libsyck, "syck_parser_str", "vpbip"
-    .local int yaml_string_len
-    yaml_string_len = length yaml_string
-    syck_parser_str( parser, yaml_string, yaml_string_len, read )
-
-    # call syck_parse
-    .local pmc syck_parse
-    .local int sym_id
-    syck_parse = dlfunc libsyck, "syck_parse", "ip"
-    ( sym_id ) = syck_parse( parser )
-
-    # cleaning up a handle on a YAML parser
-    .local pmc syck_free_parser
-    syck_free_parser = dlfunc libsyck, "syck_free_parser", "vp"
-    syck_free_parser( parser )
-
-NOT_DEFINED:
-NOT_LOADED:
-    .return( user_data )
-.end
-
-
-.sub _yaml_handler
-    .param pmc user_data
-    .param pmc external_data
-
-    # struct _syck_node {
-    #     /* Symbol table ID */
-    #     SYMID id;
-    #     /* Underlying kind */
-    #     enum syck_kind_tag kind;
-    #     /* Fully qualified tag-uri for type */
-    #     char *type_id;
-    #     /* Anchor name */
-    #     char *anchor;
-    #     union {
-    #         /* Storage for map data */
-    #         struct SyckMap {
-    #             SYMID *keys;
-    #             SYMID *values;
-    #             long capa;
-    #             long idx;
-    #         } *pairs;
-    #         /* Storage for sequence data */
-    #         struct SyckSeq {
-    #             SYMID *items;
-    #             long capa;
-    #             long idx;
-    #         } *list;
-    #         /* Storage for string data */
-    #         struct SyckStr {
-    #             enum scalar_style style;
-    #             char *ptr;
-    #             long len;
-    #         } *str;
-    #     } data;
-    #     /* Shortcut node */
-    #     void *shortcut;
-    # };
-
-
-    # external_data is an UnManagedStruct PMC containing node info
-    .local pmc external_data_decl, data_str_decl, data_str
-    external_data_decl = new 'ResizablePMCArray'
-    data_str_decl      = new 'ResizablePMCArray'
-
-    # id
-    push external_data_decl, .DATATYPE_INT
-    push external_data_decl, 0
-    push external_data_decl, 0
-    # kind
-    push external_data_decl, .DATATYPE_INT
-    push external_data_decl, 0
-    push external_data_decl, 0
-    # type_id
-    push external_data_decl, .DATATYPE_CSTR
-    push external_data_decl, 0
-    push external_data_decl, 0
-    # anchor
-    push external_data_decl, .DATATYPE_CSTR
-    push external_data_decl, 0
-    push external_data_decl, 0
-
-    # style
-    push data_str_decl, .DATATYPE_INT
-    push data_str_decl, 0
-    push data_str_decl, 0
-    # ptr
-    push data_str_decl, .DATATYPE_CSTR
-    push data_str_decl, 0
-    push data_str_decl, 0
-    # len
-    push data_str_decl, .DATATYPE_INT
-    push data_str_decl, 0
-    push data_str_decl, 0
-    data_str = new 'UnManagedStruct', data_str_decl
-
-    push  external_data_decl, .DATATYPE_STRUCT_PTR
-    $P9 = external_data_decl[-1]
-    setprop $P9, "_struct", data_str
-    push external_data_decl, 0
-    push external_data_decl, 0
-
-    assign external_data, external_data_decl
-
-    .local int id, kind, data_str_len
-    .local string type_id, anchor, data_str_ptr
-    .local string cloned
-    id      = external_data[0]
-    kind    = external_data[1]
-    #    type_id = external_data[2]     # This might be NULL
-    #    anchor = external_data[3]      # This might be NULL
-    data_str_len = external_data[4;2]
-
-    # For now just save all the strings
-    unless kind == 2 goto IGNORE_NON_STRING
-        data_str_ptr = external_data[4;1]
-        concat user_data, user_data, data_str_ptr
-        concat user_data, user_data, "\n"
-IGNORE_NON_STRING:
-
-    # debug output
-    print user_data
-    print "\n"
-
-    .return()
-.end
-
-=head1 TODO
-
-Do some object stuff.
-Be nice and put stuff into a namespace.
-Provide a patch for libsyck.
-
-=head1 AUTHOR
-
-Bernhard Schmalhofer - <Bernhard.Schmalhofer at gmx.de>
-
-=head1 SEE ALSO
-
-  YAML::Parser::Syck.pm
-  yaml.kwiki.org
-
-=cut
-
-# Local Variables:
-#   mode: pir
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4 ft=pir:

Added: branches/orderedhash_revamp/runtime/parrot/library/distutils.pir
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/runtime/parrot/library/distutils.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,4925 @@
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+distutils - Parrot Distribution Utilities
+
+=head2 DESCRIPTION
+
+This module is greatly inspired by Python Distribution Utilities
+(L<http://docs.python.org/distutils/>).
+
+Its goal is to make Parrot modules and extensions easily available
+to a wider audience with very little overhead for build/release/install mechanics.
+
+All the rules needed (dynops, dynpmc, pbc_to_exe, nqp, ...) are coded in this module distutils.
+A module author just must write a script C<setup.pir> (or C<setup.nqp> in future).
+
+A setup script can be as simple as this:
+
+    pir::load_bytecode('distutils.pir');
+    setup( @steps,
+        ... many key/values here ...
+    );
+
+Distutils could work with Plumage (L<https://trac.parrot.org/parrot/wiki/ModuleEcosystem>).
+Plumage handles setup.pir commands.
+
+Distutils could generate a skeleton of Plumage metadata.
+
+=head3 Commands / Steps / Targets
+
+The default are :
+
+=over 4
+
+=item build
+
+Build the library. (it is the default command)
+
+=item test
+
+Run the test suite.
+
+=item install
+
+Install the library.
+
+=item uninstall
+
+Uninstall the library.
+
+=item clean
+
+Basic cleaning up.
+
+=item update
+
+Update from the repository.
+
+=item plumage
+
+Output a skeleton for Plumage
+
+=item sdist, sdist_gztar, sdist_bztar, sdist_zip, sdist_rpm, manifest
+
+Create a source distribution or a source RPM package
+
+=item bdist, bdist_rpm, bdist_wininst, spec, control, ebuild
+
+Create a binary RPM package or Windows Installer.
+
+=item help
+
+Print a help message.
+
+=back
+
+The behaviour is driven by the data supplied to the function C<setup>.
+So, below each step is described with the list of key/values handled.
+
+An API allows to write customized step :
+C<register_step>, C<register_step_before>, C<register_step_after>, C<run_step>.
+
+Customized step could reuse Configuration Helpers & OS Utilities.
+
+=head3 Invocations
+
+Typical invocations are:
+
+    $ parrot setup.pir
+    $ parrot setup.pir test
+    $ sudo parrot setup.pir install
+
+=head2 PERL DEPENDENCIES
+
+=over 4
+
+=item prove (in step 'test')
+
+core module Test-Harness
+
+=item prove --archive (in step 'smoke')
+
+module TAP-Harness-Archive
+
+=item pod2html
+
+core module Pod-Html
+
+=item chmod (in step 'install')
+
+core module ExtUtils::Command, see TT #1322
+
+=back
+
+=head2 PARROT DEPENDENCIES
+
+=over 4
+
+=item glob (in step 'manifest' & 'sdist')
+
+PGE::Glob
+
+Limitation: currently, OS.'readdir' is dummy with MSVC.
+
+=back
+
+=head2 SYSTEM DEPENDENCIES
+
+=over 4
+
+=item smoke
+
+curl
+
+=item sdist_gztar
+
+Some coreutils : tar, gzip
+
+=item sdist_bztar
+
+bzip2
+
+=item sdist_zip
+
+zip
+
+=item spec, sdist_rpm, bdist_rpm
+
+rpmbuild
+
+=item bdist_wininst
+
+Inno Setup
+
+=back
+
+=head2 EXAMPLES
+
+L<http://github.com/fperrad/parrot-MT19937/blob/master/setup.pir>
+
+L<http://github.com/fperrad/markdown/blob/master/setup.pir>
+
+L<http://github.com/fperrad/xml/blob/master/setup.pir>
+
+L<http://github.com/fperrad/wmlscript/blob/master/setup.pir>
+
+L<http://github.com/fperrad/lua-batteries/blob/master/setup.pir>
+
+L<https://trac.parrot.org/languages/browser/bf/trunk/setup.pir>
+
+L<https://trac.parrot.org/languages/browser/chitchat/trunk/setup.pir>
+
+L<https://trac.parrot.org/languages/browser/forth/trunk/setup.pir>
+
+L<https://trac.parrot.org/languages/browser/lolcode/trunk/setup.pir>
+
+L<https://trac.parrot.org/languages/browser/pheme/trunk/setup.pir>
+
+L<http://github.com/leto/kea/blob/master/setup.pir>
+
+L<http://github.com/vadrer/tcl-bridge/blob/master/setup.pir>
+
+L<http://github.com/tene/gil/blob/master/setup.pir>
+
+L<http://github.com/tene/steme/blob/master/setup.pir>
+
+L<http://github.com/TiMBuS/fun/blob/master/setup.pir>
+
+L<http://code.google.com/p/decnum-dynpmcs/source/browse/trunk/setup.pir>
+
+L<http://github.com/Whiteknight/parrot-linear-algebra/blob/master/setup.pir>
+
+L<http://bitbucket.org/riffraff/shakespeare-parrot/src/tip/setup.pir>
+
+=cut
+
+.sub '__onload' :load :init :anon
+    $P0 = new 'Hash'
+    set_global '%step', $P0
+
+    .const 'Sub' _build_dynpmc = '_build_dynpmc'
+    register_step('build', _build_dynpmc)
+    .const 'Sub' _build_dynops = '_build_dynops'
+    register_step_after('build', _build_dynops)
+    .const 'Sub' _build_pir_pge = '_build_pir_pge'
+    register_step_after('build', _build_pir_pge)
+    .const 'Sub' _build_pir_tge = '_build_pir_tge'
+    register_step_after('build', _build_pir_tge)
+    .const 'Sub' _build_pir_nqp = '_build_pir_nqp'
+    register_step_after('build', _build_pir_nqp)
+    .const 'Sub' _build_pir_nqp_rx = '_build_pir_nqp_rx'
+    register_step_after('build', _build_pir_nqp_rx)
+    .const 'Sub' _build_pbc_pir = '_build_pbc_pir'
+    register_step_after('build', _build_pbc_pir)
+    .const 'Sub' _build_pbc_pbc = '_build_pbc_pbc'
+    register_step_after('build', _build_pbc_pbc)
+    .const 'Sub' _build_exe_pbc = '_build_exe_pbc'
+    register_step_after('build', _build_exe_pbc)
+    .const 'Sub' _build_installable_pbc = '_build_installable_pbc'
+    register_step_after('build', _build_installable_pbc)
+    .const 'Sub' _build_html_pod = '_build_html_pod'
+    register_step_after('build', _build_html_pod)
+
+    .const 'Sub' _clean_dynpmc = '_clean_dynpmc'
+    register_step('clean', _clean_dynpmc)
+    .const 'Sub' _clean_dynops = '_clean_dynops'
+    register_step_after('clean', _clean_dynops)
+    .const 'Sub' _clean_pir_pge = '_clean_pir_pge'
+    register_step_after('clean', _clean_pir_pge)
+    .const 'Sub' _clean_pir_tge = '_clean_pir_tge'
+    register_step_after('clean', _clean_pir_tge)
+    .const 'Sub' _clean_pir_nqp = '_clean_pir_nqp'
+    register_step_after('clean', _clean_pir_nqp)
+    .const 'Sub' _clean_pir_nqp_rx = '_clean_pir_nqp_rx'
+    register_step_after('clean', _clean_pir_nqp_rx)
+    .const 'Sub' _clean_pbc_pir = '_clean_pbc_pir'
+    register_step_after('clean', _clean_pbc_pir)
+    .const 'Sub' _clean_pbc_pbc = '_clean_pbc_pbc'
+    register_step_after('clean', _clean_pbc_pbc)
+    .const 'Sub' _clean_exe_pbc = '_clean_exe_pbc'
+    register_step_after('clean', _clean_exe_pbc)
+    .const 'Sub' _clean_installable_pbc = '_clean_installable_pbc'
+    register_step_after('clean', _clean_installable_pbc)
+    .const 'Sub' _clean_html_pod = '_clean_html_pod'
+    register_step_after('clean', _clean_html_pod)
+    .const 'Sub' _clean_gztar = '_clean_gztar'
+    register_step_after('clean', _clean_gztar)
+    .const 'Sub' _clean_bztar = '_clean_bztar'
+    register_step_after('clean', _clean_bztar)
+    .const 'Sub' _clean_zip = '_clean_zip'
+    register_step_after('clean', _clean_zip)
+    .const 'Sub' _clean_smoke = '_clean_smoke'
+    register_step_after('clean', _clean_smoke)
+
+    .const 'Sub' _update = '_update'
+    register_step('update', _update)
+    .const 'Sub' _patch = '_patch'
+    register_step('patch', _patch)
+
+    .const 'Sub' _install = '_install'
+    register_step('install', _install)
+
+    .const 'Sub' _test = '_test'
+    register_step('test', _test)
+
+    .const 'Sub' _smoke = '_smoke'
+    register_step('smoke', _smoke)
+
+    .const 'Sub' _uninstall = '_uninstall'
+    register_step('uninstall', _uninstall)
+
+    .const 'Sub' _usage = '_usage'
+    register_step('usage', _usage)
+    register_step('help', _usage)
+
+    .const 'Sub' _plumage = '_plumage'
+    register_step('plumage', _plumage)
+
+    .const 'Sub' _sdist = '_sdist'
+    register_step('sdist', _sdist)
+    .const 'Sub' _sdist_gztar = '_sdist_gztar'
+    register_step('sdist_gztar', _sdist_gztar)
+    .const 'Sub' _sdist_bztar = '_sdist_bztar'
+    register_step('sdist_bztar', _sdist_bztar)
+    .const 'Sub' _sdist_zip = '_sdist_zip'
+    register_step('sdist_zip', _sdist_zip)
+    .const 'Sub' _manifest = '_manifest'
+    register_step('manifest', _manifest)
+    .const 'Sub' _sdist_rpm = '_sdist_rpm'
+    register_step('sdist_rpm', _sdist_rpm)
+    .const 'Sub' _spec_rpm = '_spec_rpm'
+    register_step('spec', _spec_rpm)
+    .const 'Sub' _control_deb = '_control_deb'
+    register_step('control', _control_deb)
+    .const 'Sub' _ebuild_gentoo = '_ebuild_gentoo'
+    register_step('ebuild', _ebuild_gentoo)
+
+    .const 'Sub' _bdist = '_bdist'
+    register_step('bdist', _bdist)
+    .const 'Sub' _bdist_rpm = '_bdist_rpm'
+    register_step('bdist_rpm', _bdist_rpm)
+
+    $P0 = get_config()
+    $S0 = $P0['osname']
+    unless $S0 == 'MSWin32' goto L1
+    .const 'Sub' _bdist_wininst = '_bdist_wininst'
+    register_step('bdist_wininst', _bdist_wininst)
+    .const 'Sub' _clean_wininst = '_clean_wininst'
+    register_step_after('clean', _clean_wininst)
+  L1:
+.end
+
+=head2 Functions
+
+=over 4
+
+=item setup
+
+Entry point.
+
+=cut
+
+.sub 'setup'
+    .param pmc args :slurpy
+    .param pmc kv :slurpy :named
+    .local pmc steps
+    steps = new 'ResizableStringArray'
+    $P0 = iter args
+  L1:
+    unless $P0 goto L2
+    $S0 = shift $P0
+    $S1 = substr $S0, 0, 2
+    unless $S1 == '--' goto L3
+    $S1 = substr $S0, 2
+    $S2 = shift $P0
+    print $S1
+    print "="
+    say $S2
+    kv[$S1] = $S2
+    goto L1
+  L3:
+    push steps, $S0
+    goto L1
+  L2:
+
+    push_eh _handler
+    $P0 = iter steps
+    if $P0 goto L11
+    # default step
+    run_step('build', 'build' :named('__target__'), kv :flat :named)
+    goto L12
+  L11:
+    unless $P0 goto L12
+    $S0 = shift $P0
+    $I0 = run_step($S0, $S0 :named('__target__'), kv :flat :named)
+    if $I0 goto L11
+    print "unknown target : "
+    say $S0
+    run_step('usage')
+  L12:
+    pop_eh
+    end
+  _handler:
+    .local pmc ex
+    .get_results (ex)
+    rethrow ex
+.end
+
+=item run_step
+
+Call a step by its name.
+
+=cut
+
+.sub 'run_step'
+    .param string name
+    .param pmc kv :slurpy :named
+    $P0 = get_global '%step'
+    $I0 = exists $P0[name]
+    if $I0 goto L1
+    .return (0)
+  L1:
+    $P1 = $P0[name]
+    $P2 = iter $P1
+  L2:
+    unless $P2 goto L3
+    $P3 = shift $P2
+    $P3(kv :flat :named)
+    goto L2
+  L3:
+    .return (1)
+.end
+
+=item register_step
+
+Register a step by its name
+
+=cut
+
+.sub 'register_step'
+    .param string name
+    .param pmc step
+    $P0 = get_global '%step'
+    $P1 = new 'ResizablePMCArray'
+    unshift $P1, step
+    $P0[name] = $P1
+.end
+
+=item register_step_after
+
+Append a step
+
+=cut
+
+.sub 'register_step_after'
+    .param string name
+    .param pmc step
+    $P0 = get_global '%step'
+    $P1 = $P0[name]
+    push $P1, step
+.end
+
+=item register_step_before
+
+Insert a step
+
+=cut
+
+.sub 'register_step_before'
+    .param string name
+    .param pmc step
+    $P0 = get_global '%step'
+    $P1 = $P0[name]
+    unshift $P1, step
+.end
+
+=back
+
+=head2 Steps
+
+=head3 Step usage
+
+Display a helpful message
+
+=over 4
+
+=item usage
+
+Overload the default message
+
+=back
+
+=cut
+
+.sub '_usage' :anon
+    .param pmc kv :slurpy :named
+    .local string msg
+    msg = <<'USAGE'
+usage: parrot setup.pir [target|--key value]*
+
+    Default targets are :
+
+        build:          Build the library.
+
+        test:           Run the test suite.
+
+        install:        Install the library.
+
+        uninstall:      Uninstall the library.
+
+        clean:          Basic cleaning up.
+
+        update:         Update from the repository.
+
+        plumage:        Output a skeleton for Plumage
+
+        sdist:          Create a source distribution
+
+        bdist:          Create a binary distribution
+
+        help:           Print this help message.
+USAGE
+    $S0 = get_value('usage', msg :named('default'), kv :flat :named)
+    say $S0
+.end
+
+=head3 Step build
+
+=over 4
+
+=item pbc_pir
+
+hash
+
+the key is the PBC pathname
+
+the value is an array of pathname or a single pathname
+
+the first item of the array is the PIR source
+
+the others items of the array are just the dependencies
+
+=cut
+
+.sub '_build_pbc_pir' :anon
+    .param pmc kv :slurpy :named
+    $I0 = exists kv['pbc_pir']
+    unless $I0 goto L1
+    $P0 = kv['pbc_pir']
+    build_pbc_pir($P0)
+  L1:
+.end
+
+.sub 'build_pbc_pir'
+    .param pmc hash
+    $P0 = iter hash
+  L1:
+    unless $P0 goto L2
+    .local string pbc, src
+    pbc = shift $P0
+    .local pmc depends
+    depends = hash[pbc]
+    $I0 = does depends, 'array'
+    unless $I0 goto L3
+    $I0 = newer(pbc, depends)
+    if $I0 goto L1
+    src = shift depends
+    goto L4
+  L3:
+    src = depends
+    $I0 = newer(pbc, src)
+    if $I0 goto L1
+  L4:
+    .local string cmd
+    cmd = get_parrot()
+    cmd .= " -o "
+    cmd .= pbc
+    cmd .= " "
+    cmd .= src
+    system(cmd, 1 :named('verbose'))
+    goto L1
+  L2:
+.end
+
+=item pir_pge
+
+hash
+
+the key is the PIR pathname
+
+the value is an array of PGE pathname or a single PGE pathname
+
+=item pir_pge_flags
+
+=cut
+
+.sub '_build_pir_pge' :anon
+    .param pmc kv :slurpy :named
+    $I0 = exists kv['pir_pge']
+    unless $I0 goto L1
+    $P0 = kv['pir_pge']
+    $S0 = get_value('pir_pge_flags', '' :named('default'), kv :flat :named)
+    build_pir_pge($P0, $S0)
+  L1:
+.end
+
+.sub 'build_pir_pge'
+    .param pmc hash
+    .param string flags
+    $P0 = iter hash
+  L1:
+    unless $P0 goto L2
+    .local string pir, src
+    pir = shift $P0
+    .local pmc srcs
+    srcs = hash[pir]
+    $I0 = does srcs, 'array'
+    unless $I0 goto L3
+    $I0 = newer(pir, srcs)
+    if $I0 goto L1
+    src = join ' ', srcs
+    goto L4
+  L3:
+    src = srcs
+    $I0 = newer(pir, src)
+    if $I0 goto L1
+  L4:
+    .local string cmd
+    cmd = get_parrot()
+    cmd .= " "
+    $S0 = get_library('PGE/Perl6Grammar.pbc')
+    cmd .= $S0
+    cmd .= " --output="
+    cmd .= pir
+    cmd .= " "
+    cmd .= flags
+    cmd .= " "
+    cmd .= src
+    system(cmd, 1 :named('verbose'))
+    goto L1
+  L2:
+.end
+
+=item pir_tge
+
+hash
+
+the key is the PIR pathname
+
+the value is the TGE pathname
+
+=cut
+
+.sub '_build_pir_tge' :anon
+    .param pmc kv :slurpy :named
+    $I0 = exists kv['pir_tge']
+    unless $I0 goto L1
+    $P0 = kv['pir_tge']
+    build_pir_tge($P0)
+  L1:
+.end
+
+.sub 'build_pir_tge'
+    .param pmc hash
+    $P0 = iter hash
+  L1:
+    unless $P0 goto L2
+    .local string pir, tge
+    pir = shift $P0
+    tge = hash[pir]
+    $I0 = newer(pir, tge)
+    if $I0 goto L1
+    .local string cmd
+    cmd = get_parrot()
+    cmd .= " "
+    $S0 = get_compiler('tge/tgc.pir')
+    cmd .= $S0
+    cmd .= " --output="
+    cmd .= pir
+    cmd .= " "
+    cmd .= tge
+    system(cmd, 1 :named('verbose'))
+    goto L1
+  L2:
+.end
+
+=item pir_nqp
+
+hash
+
+the key is the PIR pathname
+
+the value is the NQP pathname
+
+=item pir_nqp_flags
+
+=cut
+
+.sub '_build_pir_nqp' :anon
+    .param pmc kv :slurpy :named
+    $I0 = exists kv['pir_nqp']
+    unless $I0 goto L1
+    $P0 = kv['pir_nqp']
+    $S0 = get_value('pir_nqp_flags', '' :named('default'), kv :flat :named)
+    build_pir_nqp($P0, $S0)
+  L1:
+.end
+
+.sub 'build_pir_nqp'
+    .param pmc hash
+    .param string flags
+    $P0 = iter hash
+  L1:
+    unless $P0 goto L2
+    .local string pir, nqp
+    pir = shift $P0
+    nqp = hash[pir]
+    $I0 = newer(pir, nqp)
+    if $I0 goto L1
+    .local string cmd
+    cmd = get_parrot()
+    cmd .= " "
+    $S0 = get_compiler('nqp/nqp.pbc')
+    cmd .= $S0
+    cmd .= " --target=pir --output="
+    cmd .= pir
+    cmd .= " "
+    cmd .= flags
+    cmd .= " "
+    cmd .= nqp
+    system(cmd, 1 :named('verbose'))
+    goto L1
+  L2:
+.end
+
+=item pir_nqp-rx
+
+hash
+
+the key is the PIR pathname
+
+the value is the NQP pathname
+
+=cut
+
+.sub '_build_pir_nqp_rx' :anon
+    .param pmc kv :slurpy :named
+    $I0 = exists kv['pir_nqp-rx']
+    unless $I0 goto L1
+    $P0 = kv['pir_nqp-rx']
+    build_pir_nqp_rx($P0)
+  L1:
+.end
+
+.sub 'build_pir_nqp_rx'
+    .param pmc hash
+    $P0 = iter hash
+  L1:
+    unless $P0 goto L2
+    .local string pir, nqp
+    pir = shift $P0
+    nqp = hash[pir]
+    $I0 = newer(pir, nqp)
+    if $I0 goto L1
+    .local string cmd
+    cmd = get_nqp()
+    cmd .= " --target=pir --output="
+    cmd .= pir
+    cmd .= " "
+    cmd .= nqp
+    system(cmd, 1 :named('verbose'))
+    goto L1
+  L2:
+.end
+
+=item pbc_pbc
+
+hash
+
+the key is the PBC pathname
+
+the value is an array of PBC pathname
+
+=cut
+
+.sub '_build_pbc_pbc' :anon
+    .param pmc kv :slurpy :named
+    $I0 = exists kv['pbc_pbc']
+    unless $I0 goto L1
+    $P0 = kv['pbc_pbc']
+    build_pbc_pbc($P0)
+  L1:
+.end
+
+.sub 'build_pbc_pbc'
+    .param pmc hash
+    $P0 = iter hash
+  L1:
+    unless $P0 goto L2
+    .local string pbc, src
+    pbc = shift $P0
+    .local pmc srcs
+    srcs = hash[pbc]
+    $I0 = newer(pbc, srcs)
+    if $I0 goto L1
+    src = join ' ', srcs
+    .local string cmd
+    cmd = get_executable('pbc_merge')
+    cmd .= " -o "
+    cmd .= pbc
+    cmd .= " "
+    cmd .= src
+    system(cmd, 1 :named('verbose'))
+    goto L1
+  L2:
+.end
+
+=item exe_pbc
+
+hash
+
+the key is the executable pathname
+
+the value is the PBC pathname
+
+=cut
+
+.sub '_build_exe_pbc' :anon
+    .param pmc kv :slurpy :named
+    $I0 = exists kv['exe_pbc']
+    unless $I0 goto L1
+    $P0 = kv['exe_pbc']
+    build_exe_pbc($P0)
+  L1:
+.end
+
+.sub 'build_exe_pbc'
+    .param pmc hash
+    .local string exe
+    exe = get_exe()
+    $P0 = iter hash
+  L1:
+    unless $P0 goto L2
+    .local string bin, pbc
+    bin = shift $P0
+    pbc = hash[bin]
+    $I0 = length pbc
+    $I0 -= 4
+    $S0 = substr pbc, 0, $I0
+    $S1 = $S0 . exe
+    $I0 = newer($S1, pbc)
+    if $I0 goto L1
+    .local string cmd
+    cmd = get_executable('pbc_to_exe')
+    cmd .= " "
+    cmd .= pbc
+    system(cmd, 1 :named('verbose'))
+    goto L1
+  L2:
+.end
+
+=item installable_pbc
+
+hash
+
+the key is the executable pathname
+
+the value is the PBC pathname
+
+=cut
+
+.sub '_build_installable_pbc' :anon
+    .param pmc kv :slurpy :named
+    $I0 = exists kv['installable_pbc']
+    unless $I0 goto L1
+    $P0 = kv['installable_pbc']
+    build_installable_pbc($P0)
+  L1:
+.end
+
+.sub 'build_installable_pbc'
+    .param pmc hash
+    .local string exe
+    exe = get_exe()
+    .local int has_strip
+    has_strip = _has_strip()
+    $P0 = iter hash
+  L1:
+    unless $P0 goto L2
+    .local string bin, pbc
+    bin = shift $P0
+    pbc = hash[bin]
+    $I0 = length pbc
+    $I0 -= 4
+    $S0 = substr pbc, 0, $I0
+    $S1 = "installable_" . $S0
+    $S1 .= exe
+    $I0 = newer($S1, pbc)
+    if $I0 goto L1
+    .local string cmd
+    cmd = get_executable('pbc_to_exe')
+    cmd .= " "
+    cmd .= pbc
+    cmd .= " --install"
+    system(cmd, 1 :named('verbose'))
+    unless has_strip goto L1
+    cmd = "strip " . $S1
+    system(cmd, 1 :named('verbose'))
+    goto L1
+  L2:
+.end
+
+.sub '_has_strip' :anon
+    .param string cflags        :optional
+    .param int has_cflags       :opt_flag
+    .local pmc config
+    config = get_config()
+    $S0 = config['gccversion']
+    unless $S0 goto L1
+    unless has_cflags goto L2
+    $I0 = index cflags, '-g'
+    unless $I0 < 0 goto L1
+  L2:
+    $S0 = config['cflags']
+    $I0 = index $S0, '-g'
+    unless $I0 < 0 goto L1
+    .return (1)
+  L1:
+    .return (0)
+.end
+
+=item dynops
+
+hash
+
+the key is the name
+
+the value is the OPS pathname
+
+=item dynops_cflags
+
+=item dynops_ldflags
+
+=cut
+
+.sub '_build_dynops' :anon
+    .param pmc kv :slurpy :named
+    $I0 = exists kv['dynops']
+    unless $I0 goto L1
+    .local string cflags, ldflags
+    cflags = get_value('dynops_cflags', '' :named('default'), kv :flat :named)
+    ldflags = get_value('dynops_ldflags', '' :named('default'), kv :flat :named)
+    $P0 = kv['dynops']
+    build_dynops($P0, cflags, ldflags)
+  L1:
+.end
+
+.sub 'build_dynops'
+    .param pmc hash
+    .param string cflags
+    .param string ldflags
+    mkpath('dynext', 1 :named('verbose'))
+    .local pmc cores
+    cores = get_cores()
+    .local string load_ext
+    load_ext = get_load_ext()
+    $P0 = iter hash
+  L1:
+    unless $P0 goto L2
+    .local string ops, src
+    ops = shift $P0
+    src = hash[ops]
+    $P1 = iter cores
+  L3:
+    unless $P1 goto L4
+    .local string core, suffix
+    core = shift $P1
+    suffix = cores[core]
+    $S0 = _mk_path_dynops(ops, suffix, load_ext)
+    $I0 = newer($S0, src)
+    if $I0 goto L3
+    __build_dynops(src, ops, core, suffix, cflags, ldflags)
+    goto L3
+  L4:
+    goto L1
+  L2:
+.end
+
+.sub '__build_dynops' :anon
+    .param string src
+    .param string ops
+    .param string core
+    .param string suffix
+    .param string cflags
+    .param string ldflags
+    .local pmc config
+    config = get_config()
+    .local string cmd
+    cmd = config['perl']
+    cmd .= " "
+    $S0 = get_tool('build/ops2c.pl')
+    cmd .= $S0
+    cmd .= " "
+    cmd .= core
+    cmd .= " --dynamic "
+    cmd .= src
+    system(cmd, 1 :named('verbose'))
+
+    $S0 = config['o']
+    $S1 = _mk_path_gen_dynops(src, ops, suffix, $S0)
+    $S2 = _mk_path_gen_dynops(src, ops, suffix, '.c')
+    __compile_cc($S1, $S2, cflags)
+
+    .local string dynext
+    $S0 = config['load_ext']
+    dynext = _mk_path_dynops(ops, suffix, $S0)
+    cmd = config['ld']
+    cmd .= " "
+    $S0 = config['ld_out']
+    cmd .= $S0
+    cmd .= dynext
+    cmd .= " "
+    $S0 = config['o']
+    $S0 = _mk_path_gen_dynops(src, ops, suffix, $S0)
+    cmd .= $S0
+    cmd .= " "
+    $S0 = get_ldflags()
+    cmd .= $S0
+    cmd .= " "
+    $S0 = config['ld_load_flags']
+    cmd .= $S0
+    cmd .= " "
+    $I0 = config['parrot_is_shared']
+    unless $I0 goto L1
+    $S0 = config['inst_libparrot_ldflags']
+    cmd .= $S0
+    cmd .= " "
+  L1:
+    cmd .= ldflags
+    system(cmd, 1 :named('verbose'))
+
+    $I0 = _has_strip(cflags)
+    unless $I0 goto L2
+    cmd = "strip " . dynext
+    system(cmd, 1 :named('verbose'))
+  L2:
+.end
+
+.sub '__compile_cc'
+    .param string obj
+    .param string src
+    .param string cflags
+    .local pmc config
+    config = get_config()
+    .local string cmd
+    cmd = config['cc']
+    cmd .= " -c "
+    $S0 = config['cc_o_out']
+    cmd .= $S0
+    cmd .= " "
+    cmd .= obj
+    cmd .= " -I"
+    $S0 = get_incdir()
+    cmd .= $S0
+    cmd .= " -I"
+    cmd .= $S0
+    cmd .= "/pmc -I"
+    $S0 = cwd()
+    cmd .= $S0
+    cmd .= " "
+    $S0 = get_cflags()
+    cmd .= $S0
+    cmd .= " "
+    cmd .= cflags
+    cmd .= " "
+    cmd .= src
+    system(cmd, 1 :named('verbose'))
+.end
+
+.sub '_mk_path_dynops' :anon
+    .param string ops
+    .param string suffix
+    .param string load_ext
+    $S0 = "dynext/" . ops
+    $S0 .= suffix
+    $S0 .= load_ext
+    .return ($S0)
+.end
+
+.sub '_mk_path_gen_dynops' :anon
+    .param string src
+    .param string ops
+    .param string suffix
+    .param string ext
+    $S0 = dirname(src)
+    $S0 .= "/"
+    $S0 .= ops
+    $S0 .= suffix
+    $S0 .= ext
+    .return ($S0)
+.end
+
+.sub 'get_cores'
+    $P0 = new 'Hash'
+    $P0['C'] = ''
+#    $P0['CGP'] = '_cgp'
+#    $P0['CGoto'] = '_cg'
+    $P0['CSwitch'] = '_switch'
+    .return ($P0)
+.end
+
+=item dynpmc
+
+hash
+
+the key is the group name
+
+the value is an array of PMC pathname
+
+=item dynpmc_cflags
+
+=item dynpmc_ldflags
+
+=cut
+
+.sub '_build_dynpmc' :anon
+    .param pmc kv :slurpy :named
+    $I0 = exists kv['dynpmc']
+    unless $I0 goto L1
+    .local string cflags, ldflags
+    cflags = get_value('dynpmc_cflags', '' :named('default'), kv :flat :named)
+    ldflags = get_value('dynpmc_ldflags', '' :named('default'), kv :flat :named)
+    $P0 = kv['dynpmc']
+    build_dynpmc($P0, cflags, ldflags)
+  L1:
+.end
+
+.sub 'build_dynpmc'
+    .param pmc hash
+    .param string cflags
+    .param string ldflags
+    mkpath('dynext', 1 :named('verbose'))
+    .local string load_ext, obj
+    load_ext = get_load_ext()
+    obj = get_obj()
+    $P0 = iter hash
+  L1:
+    unless $P0 goto L2
+    .local string group
+    group = shift $P0
+    .local pmc srcs
+    srcs = hash[group]
+    $P1 = iter srcs
+  L3:
+    unless $P1 goto L4
+    .local string src
+    src = shift $P1
+    $S0 = _mk_path_gen_dynpmc(src, obj)
+    $I0 = newer($S0, src)
+    if $I0 goto L3
+    __build_dynpmc(src, cflags)
+    goto L3
+  L4:
+    if group == '' goto L1
+    $S0 = _mk_path_dynpmc(group, load_ext)
+    $I0 = newer($S0, srcs)
+    if $I0 goto L1
+    __build_dynpmc_group(srcs, group, cflags, ldflags)
+    goto L1
+  L2:
+.end
+
+.sub '__build_dynpmc' :anon
+    .param string src
+    .param string cflags
+    .local pmc config
+    config = get_config()
+    .local string pmc2c
+    pmc2c = config['perl']
+    pmc2c .= " "
+    $S0 = get_tool('build/pmc2c.pl')
+    pmc2c .= $S0
+    .local string pmc2c_includes
+    pmc2c_includes = "--include "
+    $S0 = get_srcdir()
+    pmc2c_includes .= $S0
+    pmc2c_includes .= " --include "
+    pmc2c_includes .= $S0
+    pmc2c_includes .= "/pmc"
+    .local string current_dir
+    current_dir = cwd()
+    $S0 = dirname(src)
+    chdir($S0)
+
+    .local string cmd
+    cmd = clone pmc2c
+    cmd .= " --dump "
+    cmd .= pmc2c_includes
+    cmd .= " "
+#    cmd .= src
+    $S0 = basename(src)
+    cmd .= $S0
+    system(cmd, 1 :named('verbose'))
+
+    cmd = clone pmc2c
+    cmd .= " --c "
+    cmd .= pmc2c_includes
+    cmd .= " "
+#    cmd .= src
+    $S0 = basename(src)
+    cmd .= $S0
+    system(cmd, 1 :named('verbose'))
+
+    chdir(current_dir)
+
+    $S0 = config['o']
+    $S1 = _mk_path_gen_dynpmc(src, $S0)
+    $S2 = _mk_path_gen_dynpmc(src, '.c')
+    __compile_cc($S1, $S2, cflags)
+.end
+
+.sub '__build_dynpmc_group' :anon
+    .param pmc srcs
+    .param string group
+    .param string cflags
+    .param string ldflags
+    .local pmc config
+    config = get_config()
+    .local string src, obj
+    src = srcs[0]
+    obj = config['o']
+    .local string current_dir
+    current_dir = cwd()
+    $S0 = dirname(src)
+    chdir($S0)
+
+    .local string cmd
+    cmd = config['perl']
+    cmd .= " "
+    $S0 = get_tool('build/pmc2c.pl')
+    cmd .= $S0
+    cmd .= " --library "
+#    $S0 = dirname(src)
+#    cmd .= $S0
+#    cmd .= "/"
+    cmd .= group
+    cmd .= " --c "
+#    $S0 = join " ", srcs
+#    cmd .= $S0
+    $P0 = iter srcs
+  L1:
+    unless $P0 goto L2
+    src = shift $P0
+    $S0 = basename(src)
+    cmd .= $S0
+    cmd .= " "
+    goto L1
+  L2:
+    system(cmd, 1 :named('verbose'))
+
+    chdir(current_dir)
+
+    $S1 = _mk_path_gen_dynpmc_group(src, group, obj)
+    $S2 = _mk_path_gen_dynpmc_group(src, group, '.c')
+    __compile_cc($S1, $S2, cflags)
+
+    .local string dynext
+    $S0 = config['load_ext']
+    dynext = _mk_path_dynpmc(group, $S0)
+    cmd = config['ld']
+    cmd .= " "
+    $S0 = config['ld_out']
+    cmd .= $S0
+    cmd .= dynext
+    cmd .= " "
+    $S0 = _mk_path_gen_dynpmc_group(src, group, obj)
+    cmd .= $S0
+    cmd .= " "
+    $P0 = iter srcs
+  L3:
+    unless $P0 goto L4
+    src = shift $P0
+    $S0 = _mk_path_gen_dynpmc(src, obj)
+    cmd .= $S0
+    cmd .= " "
+    goto L3
+  L4:
+    $S0 = get_ldflags()
+    cmd .= $S0
+    cmd .= " "
+    $S0 = config['ld_load_flags']
+    cmd .= $S0
+    cmd .= " "
+    $I0 = config['parrot_is_shared']
+    unless $I0 goto L5
+    $S0 = config['inst_libparrot_ldflags']
+    cmd .= $S0
+    cmd .= " "
+  L5:
+    cmd .= ldflags
+    system(cmd, 1 :named('verbose'))
+
+    $I0 = _has_strip(cflags)
+    unless $I0 goto L6
+    cmd = "strip " . dynext
+    system(cmd, 1 :named('verbose'))
+  L6:
+.end
+
+.sub '_mk_path_dynpmc' :anon
+    .param string group
+    .param string load_ext
+    $S0 = "dynext/" . group
+    $S0 .= load_ext
+    .return ($S0)
+.end
+
+.sub '_mk_path_gen_dynpmc' :anon
+    .param string src
+    .param string ext
+    $I0 = length src
+    $I0 -= 4
+    $S0 = substr src, 0, $I0
+    $S0 .= ext
+    unless ext == '.h' goto L1
+    $S1 = dirname($S0)
+    $S2 = basename($S0)
+    $S0 = $S1 . "/pmc_"
+    $S0 .= $S2
+  L1:
+    .return ($S0)
+.end
+
+.sub '_mk_path_gen_dynpmc_group' :anon
+    .param string src
+    .param string group
+    .param string ext
+    $S0 = dirname(src)
+    $S0 .= "/"
+    $S0 .= group
+    $S0 .= ext
+    .return ($S0)
+.end
+
+=item html_pod
+
+hash
+
+the key is the HTML pathname
+
+the value is the POD pathname
+
+=cut
+
+.sub '_build_html_pod' :anon
+    .param pmc kv :slurpy :named
+    $I0 = exists kv['html_pod']
+    unless $I0 goto L1
+    $P0 = kv['html_pod']
+    build_html_pod($P0)
+  L1:
+.end
+
+.sub 'build_html_pod'
+    .param pmc hash
+    $P0 = iter hash
+  L1:
+    unless $P0 goto L2
+    .local string html, pod
+    html = shift $P0
+    pod = hash[html]
+    $I0 = newer(html, pod)
+    if $I0 goto L1
+    .local string cmd
+    cmd = "pod2html --infile "
+    cmd .= pod
+    cmd .= " --outfile "
+    cmd .= html
+    system(cmd, 1 :named('verbose'))
+    unlink("pod2htmd.tmp")
+    unlink("pod2htmi.tmp")
+    goto L1
+  L2:
+.end
+
+=back
+
+=head3 Step clean
+
+=over 4
+
+=item pbc_pir
+
+=cut
+
+.sub '_clean_pbc_pir' :anon
+    .param pmc kv :slurpy :named
+    $I0 = exists kv['pbc_pir']
+    unless $I0 goto L1
+    $P0 = kv['pbc_pir']
+    clean_key($P0)
+  L1:
+.end
+
+.sub 'clean_key'
+    .param pmc hash
+    $P0 = iter hash
+  L1:
+     unless $P0 goto L2
+     $S0 = shift $P0
+     unlink($S0, 1 :named('verbose'))
+     goto L1
+  L2:
+.end
+
+=item pir_pge
+
+=cut
+
+.sub '_clean_pir_pge' :anon
+    .param pmc kv :slurpy :named
+    $I0 = exists kv['pir_pge']
+    unless $I0 goto L1
+    $P0 = kv['pir_pge']
+    clean_key($P0)
+  L1:
+.end
+
+=item pir_tge
+
+=cut
+
+.sub '_clean_pir_tge' :anon
+    .param pmc kv :slurpy :named
+    $I0 = exists kv['pir_tge']
+    unless $I0 goto L1
+    $P0 = kv['pir_tge']
+    clean_key($P0)
+  L1:
+.end
+
+=item pir_nqp
+
+=cut
+
+.sub '_clean_pir_nqp' :anon
+    .param pmc kv :slurpy :named
+    $I0 = exists kv['pir_nqp']
+    unless $I0 goto L1
+    $P0 = kv['pir_nqp']
+    clean_key($P0)
+  L1:
+.end
+
+=item pir_nqp-rx
+
+=cut
+
+.sub '_clean_pir_nqp_rx' :anon
+    .param pmc kv :slurpy :named
+    $I0 = exists kv['pir_nqp-rx']
+    unless $I0 goto L1
+    $P0 = kv['pir_nqp-rx']
+    clean_key($P0)
+  L1:
+.end
+
+=item pbc_pbc
+
+=cut
+
+.sub '_clean_pbc_pbc' :anon
+    .param pmc kv :slurpy :named
+    $I0 = exists kv['pbc_pbc']
+    unless $I0 goto L1
+    $P0 = kv['pbc_pbc']
+    clean_key($P0)
+  L1:
+.end
+
+=item exe_pbc
+
+=cut
+
+.sub '_clean_exe_pbc' :anon
+    .param pmc kv :slurpy :named
+    $I0 = exists kv['exe_pbc']
+    unless $I0 goto L1
+    $P0 = kv['exe_pbc']
+    clean_exe_pbc($P0)
+  L1:
+.end
+
+.sub 'clean_exe_pbc'
+    .param pmc hash
+    .local string bin, exe, obj, pbc
+    exe = get_exe()
+    obj = get_obj()
+    $P0 = iter hash
+  L1:
+    unless $P0 goto L2
+    bin = shift $P0
+    pbc = hash[bin]
+    $I0 = length pbc
+    $I0 -= 4
+    $S0 = substr pbc, 0, $I0
+    $S1 = $S0 . exe
+    unlink($S1, 1 :named('verbose'))
+    $S1 = $S0 . '.c'
+    unlink($S1, 1 :named('verbose'))
+    $S1 = $S0 . obj
+    unlink($S1, 1 :named('verbose'))
+    goto L1
+  L2:
+.end
+
+=item installable_pbc
+
+=cut
+
+.sub '_clean_installable_pbc' :anon
+    .param pmc kv :slurpy :named
+    $I0 = exists kv['installable_pbc']
+    unless $I0 goto L1
+    $P0 = kv['installable_pbc']
+    clean_installable_pbc($P0)
+  L1:
+.end
+
+.sub 'clean_installable_pbc'
+    .param pmc hash
+    .local string bin, exe, obj, pbc
+    exe = get_exe()
+    obj = get_obj()
+    $P0 = iter hash
+  L1:
+    unless $P0 goto L2
+    bin = shift $P0
+    pbc = hash[bin]
+    $I0 = length pbc
+    $I0 -= 4
+    $S0 = substr pbc, 0, $I0
+    $S1 = 'installable_' . $S0
+    $S1 .= exe
+    unlink($S1, 1 :named('verbose'))
+    $S1 = $S0 . '.c'
+    unlink($S1, 1 :named('verbose'))
+    $S1 = $S0 . obj
+    unlink($S1, 1 :named('verbose'))
+    goto L1
+  L2:
+.end
+
+=item dynops
+
+=cut
+
+.sub '_clean_dynops' :anon
+    .param pmc kv :slurpy :named
+    $I0 = exists kv['dynops']
+    unless $I0 goto L1
+    $P0 = kv['dynops']
+    clean_dynops($P0)
+  L1:
+.end
+
+.sub 'clean_dynops'
+    .param pmc hash
+    .local pmc cores
+    cores = get_cores()
+    .local string load_ext, obj
+    load_ext = get_load_ext()
+    obj = get_obj()
+    $P0 = iter hash
+  L1:
+    unless $P0 goto L2
+    .local string ops, src
+    ops = shift $P0
+    src = hash[ops]
+    $P1 = iter cores
+  L3:
+    unless $P1 goto L4
+    .local string core, suffix
+    core = shift $P1
+    suffix = cores[core]
+    $S0 = _mk_path_dynops(ops, suffix, load_ext)
+    unlink($S0, 1 :named('verbose'))
+    $S0 = _mk_path_gen_dynops(src, ops, suffix, '.c')
+    unlink($S0, 1 :named('verbose'))
+    $S0 = _mk_path_gen_dynops(src, ops, suffix, '.h')
+    unlink($S0, 1 :named('verbose'))
+    $S0 = _mk_path_gen_dynops(src, ops, suffix, obj)
+    unlink($S0, 1 :named('verbose'))
+    goto L3
+  L4:
+    goto L1
+  L2:
+.end
+
+=item dynpmc
+
+=cut
+
+.sub '_clean_dynpmc' :anon
+    .param pmc kv :slurpy :named
+    $I0 = exists kv['dynpmc']
+    unless $I0 goto L1
+    $P0 = kv['dynpmc']
+    clean_dynpmc($P0)
+  L1:
+.end
+
+.sub 'clean_dynpmc'
+    .param pmc hash
+    .local string load_ext, obj
+    load_ext = get_load_ext()
+    obj = get_obj()
+    $P0 = iter hash
+  L1:
+    unless $P0 goto L2
+    .local string group
+    group = shift $P0
+    .local pmc srcs
+    srcs = hash[group]
+    $S0 = _mk_path_dynpmc(group, load_ext)
+    unlink($S0, 1 :named('verbose'))
+    $P1 = iter srcs
+  L3:
+    unless $P1 goto L4
+    .local string src
+    src = shift $P1
+    $S0 = _mk_path_gen_dynpmc(src, '.c')
+    unlink($S0, 1 :named('verbose'))
+    $S0 = _mk_path_gen_dynpmc(src, '.h')
+    unlink($S0, 1 :named('verbose'))
+    $S0 = _mk_path_gen_dynpmc(src, '.dump')
+    unlink($S0, 1 :named('verbose'))
+    $S0 = _mk_path_gen_dynpmc(src, obj)
+    unlink($S0, 1 :named('verbose'))
+    goto L3
+  L4:
+    src = srcs[0]
+    $S0 = _mk_path_gen_dynpmc_group(src, group, '.c')
+    unlink($S0, 1 :named('verbose'))
+    $S0 = _mk_path_gen_dynpmc_group(src, group, '.h')
+    unlink($S0, 1 :named('verbose'))
+    $S0 = _mk_path_gen_dynpmc_group(src, group, obj)
+    unlink($S0, 1 :named('verbose'))
+    goto L1
+  L2:
+.end
+
+=item html_pod
+
+=cut
+
+.sub '_clean_html_pod' :anon
+    .param pmc kv :slurpy :named
+    $I0 = exists kv['html_pod']
+    unless $I0 goto L1
+    $P0 = kv['html_pod']
+    clean_key($P0)
+  L1:
+.end
+
+=back
+
+=head3 Step update
+
+The following Version Control System are handled :
+
+=over 4
+
+=cut
+
+.sub '_update' :anon
+    .param pmc kv :slurpy :named
+    $S0 = get_vcs()
+    unless $S0 == 'cvs' goto L1
+    .tailcall _update_cvs(kv :flat :named)
+  L1:
+    unless $S0 == 'git' goto L2
+    .tailcall _update_git(kv :flat :named)
+  L2:
+    unless $S0 == 'hg' goto L3
+    .tailcall _update_hg(kv :flat :named)
+  L3:
+    unless $S0 == 'svn' goto L4
+    .tailcall _update_svn(kv :flat :named)
+  L4:
+    die "Don't known how to update."
+.end
+
+=item CVS
+
+=cut
+
+.sub '_update_cvs' :anon
+    .param pmc kv :slurpy :named
+    system('cvs update', 1 :named('verbose'))
+.end
+
+=item Git
+
+=cut
+
+.sub '_update_git' :anon
+    .param pmc kv :slurpy :named
+    system('git pull', 1 :named('verbose'))
+.end
+
+=item Mercurial
+
+=cut
+
+.sub '_update_hg' :anon
+    .param pmc kv :slurpy :named
+    system('hg pull --update', 1 :named('verbose'))
+.end
+
+=item SVN
+
+=cut
+
+.sub '_update_svn' :anon
+    .param pmc kv :slurpy :named
+    system('svn update', 1 :named('verbose'))
+.end
+
+=back
+
+=head3 Step patch
+
+The following Version Control System are handled :
+
+=over 4
+
+=cut
+
+.sub '_patch' :anon
+    .param pmc kv :slurpy :named
+    $S0 = get_vcs()
+    unless $S0 == 'cvs' goto L1
+    .tailcall _patch_cvs(kv :flat :named)
+  L1:
+    unless $S0 == 'git' goto L2
+    .tailcall _patch_git(kv :flat :named)
+  L2:
+    unless $S0 == 'hg' goto L3
+    .tailcall _patch_hg(kv :flat :named)
+  L3:
+    unless $S0 == 'svn' goto L4
+    .tailcall _patch_svn(kv :flat :named)
+  L4:
+    die "Don't known how to create a patch."
+.end
+
+=item CVS
+
+=cut
+
+.sub '_patch_cvs' :anon
+    .param pmc kv :slurpy :named
+    system('cvs diff', 1 :named('verbose'))
+.end
+
+=item Git
+
+=cut
+
+.sub '_patch_git' :anon
+    .param pmc kv :slurpy :named
+    system('git diff', 1 :named('verbose'))
+.end
+
+=item Mercurial
+
+=cut
+
+.sub '_patch_hg' :anon
+    .param pmc kv :slurpy :named
+    system('hg diff', 1 :named('verbose'))
+.end
+
+=item SVN
+
+=cut
+
+.sub '_patch_svn' :anon
+    .param pmc kv :slurpy :named
+    system('svn diff', 1 :named('verbose'))
+.end
+
+=back
+
+=head3 Step test
+
+If t/harness exists, run : t/harness
+
+Else run : prove t/*.t
+
+=cut
+
+.sub '_test' :anon
+    .param pmc kv :slurpy :named
+    run_step('build', kv :flat :named)
+    $I0 = file_exists('t/harness')
+    unless $I0 goto L1
+    .tailcall _test_harness(kv :flat :named)
+  L1:
+    .tailcall _test_prove(kv :flat :named)
+.end
+
+=over 4
+
+=item harness_exec
+
+the default value is with perl
+
+=item harness_files
+
+the default value is "t/*.t"
+
+=cut
+
+.sub '_test_harness' :anon
+    .param pmc kv :slurpy :named
+    .local string cmd
+    $I0 = exists kv['harness_exec']
+    unless $I0 goto L1
+    cmd = kv['harness_exec']
+    goto L2
+  L1:
+    cmd = "perl -I"
+    $S0 = get_libdir()
+    cmd .= $S0
+    cmd .= "/tools/lib"
+  L2:
+    cmd .= " t/harness "
+    $S0 = get_value('harness_files', "t/*.t" :named('default'), kv :flat :named)
+    cmd .= $S0
+    system(cmd, 1 :named('verbose'))
+.end
+
+=item prove_exec
+
+option --exec of prove
+
+=item prove_files
+
+the default value is "t/*.t"
+
+=back
+
+=cut
+
+.sub '_test_prove' :anon
+    .param pmc kv :slurpy :named
+    .local string cmd
+    cmd = "prove"
+    $S0 = get_executable('parrot-tapir')
+    $I0 = file_exists($S0)
+    unless $I0 goto L0
+    cmd = $S0
+  L0:
+    $I0 = exists kv['prove_exec']
+    unless $I0 goto L1
+    cmd .= " --exec="
+    $S0 = kv['prove_exec']
+    $I0 = index $S0, ' '
+    if $I0 < 0 goto L2
+    cmd .= "\""
+  L2:
+    cmd .= $S0
+    if $I0 < 0 goto L1
+    cmd .= "\""
+  L1:
+    cmd .= " "
+    $S0 = get_value('prove_files', "t/*.t" :named('default'), kv :flat :named)
+    cmd .= $S0
+    system(cmd, 1 :named('verbose'))
+.end
+
+=head3 Step smoke
+
+Unless t/harness exists, run : prove --archive t/*.t
+
+=cut
+
+.sub '_smoke' :anon
+    .param pmc kv :slurpy :named
+    run_step('build', kv :flat :named)
+    $I0 = file_exists('t/harness')
+    if $I0 goto L1
+    .tailcall _smoke_prove(kv :flat :named)
+  L1:
+    die "Don't known how to smoke with t/harness."
+.end
+
+.sub '_clean_smoke' :anon
+    .param pmc kv :slurpy :named
+    $S0 = get_value('prove_archive', "report.tar.gz" :named('default'), kv :flat :named)
+    unlink($S0, 1 :named('verbose'))
+    unlink('meta.yml', 1 :named('verbose'))
+.end
+
+=over 4
+
+=item prove_exec
+
+option --exec of prove
+
+=item prove_files
+
+the default value is "t/*.t"
+
+=item prove_archive
+
+option --archive of prove
+
+the default value is report.tar.gz
+
+=item smolder_url
+
+a string
+
+=item smolder_tags
+
+a string
+
+=item smolder_comments
+
+a string
+
+=item smolder_extra_properties
+
+a hash
+
+=back
+
+=cut
+
+.sub '_smoke_prove' :anon
+    .param pmc kv :slurpy :named
+    .local string cmd
+    cmd = "prove"
+    $I0 = exists kv['prove_exec']
+    unless $I0 goto L1
+    cmd .= " --exec="
+    $S0 = kv['prove_exec']
+    $I0 = index $S0, ' '
+    if $I0 < 0 goto L2
+    cmd .= "\""
+  L2:
+    cmd .= $S0
+    if $I0 < 0 goto L1
+    cmd .= "\""
+  L1:
+    cmd .= " "
+    $S0 = get_value('prove_files', "t/*.t" :named('default'), kv :flat :named)
+    cmd .= $S0
+    cmd .= " --archive="
+    .local string archive
+    archive = get_value('prove_archive', "report.tar.gz" :named('default'), kv :flat :named)
+    cmd .= archive
+    system(cmd, 1 :named('verbose'), 1 :named('ignore_error'))
+
+    $I0 = exists kv['smolder_extra_properties']
+    unless $I0 goto L4
+    system('perl -MExtUtils::Command -e rm_rf tmp')
+    cmd = "mkdir tmp && cd tmp && tar xzf ../"
+    cmd .= archive
+    system(cmd, 1 :named('verbose'))
+
+    $P0 = kv['smolder_extra_properties']
+    $S0 = mk_extra_properties($P0)
+    say "append extra properties"
+    append('tmp/meta.yml', $S0)
+
+    unlink(archive)
+    cmd = "cd tmp && tar czf ../"
+    cmd .= archive
+    cmd .= " *"
+    system(cmd, 1 :named('verbose'))
+    system('perl -MExtUtils::Command -e rm_rf tmp')
+  L4:
+
+    $I0 = exists kv['smolder_url']
+    unless $I0 goto L5
+    .local pmc config
+    config = get_config()
+    cmd = "curl -F architecture="
+    $S0 = config['cpuarch']
+    cmd .= $S0
+    cmd .= " -F platform="
+    $S0 = config['osname']
+    cmd .= $S0
+    cmd .= " -F revision="
+    $S0 = config['revision']
+    cmd .= $S0
+    $I0 = exists kv['smolder_tags']
+    unless $I0 goto L6
+    cmd .= " -F tags=\""
+    $S0 = kv['smolder_tags']
+    cmd .= $S0
+    cmd .= "\""
+  L6:
+    $I0 = exists kv['smolder_comments']
+    unless $I0 goto L7
+    cmd .= " -F comments=\""
+    $S0 = kv['smolder_comments']
+    cmd .= $S0
+    cmd .= "\""
+  L7:
+    cmd .= " -F report_file=@"
+    cmd .= archive
+    cmd .= " "
+    $S0 = kv['smolder_url']
+    cmd .= $S0
+    system(cmd, 1 :named('verbose'))
+  L5:
+.end
+
+.sub 'mk_extra_properties' :anon
+    .param pmc hash
+    $S0 = "extra_properties:\n"
+    $P0 = iter hash
+  L1:
+    unless $P0 goto L2
+    .local string key, value
+    key = shift $P0
+    value = hash[key]
+    if value == '' goto L1
+    $S0 .= "  "
+    $S0 .= key
+    $S0 .= ": "
+    $S0 .= value
+    $S0 .= "\n"
+    goto L1
+  L2:
+    .return ($S0)
+.end
+
+=head3 Step install
+
+=over 4
+
+=item inst_bin ???
+
+array of pathname or a single pathname
+
+=item inst_dynext ???
+
+array of pathname or a single pathname
+
+=item inst_inc
+
+array of pathname or a single pathname
+
+=item inst_lang
+
+array of pathname or a single pathname
+
+=item inst_lib
+
+array of pathname or a single pathname
+
+=item installable_pbc
+
+=item dynops
+
+=item dynpmc
+
+=item root
+
+=cut
+
+.sub '_install' :anon
+    .param pmc kv :slurpy :named
+    .local string root
+    root = get_value('root', '' :named('default'), kv :flat :named)
+
+    $P0 = get_install_files(kv :flat :named)
+    $P1 = iter $P0
+  L1:
+    unless $P1 goto L2
+    $S0 = shift $P1
+    $S1 = $P0[$S0]
+    $S2 = root . $S0
+    install($S1, $S2, 1 :named('verbose'))
+    goto L1
+  L2:
+
+    $P0 = get_install_xfiles(kv :flat :named)
+    $P1 = iter $P0
+  L3:
+    unless $P1 goto L4
+    $S0 = shift $P1
+    $S1 = $P0[$S0]
+    $S2 = root . $S0
+    install($S1, $S2, 1 :named('exe'), 1 :named('verbose'))
+    goto L3
+  L4:
+.end
+
+.sub 'get_install_files' :anon
+    .param pmc kv :slurpy :named
+    .local pmc files
+    files = new 'Hash'
+    $I0 = exists kv['inst_bin']
+    unless $I0 goto L1
+    $P0 = kv['inst_bin']
+    get_install_bin(files, $P0)
+  L1:
+    $I0 = exists kv['inst_dynext']
+    unless $I0 goto L2
+    $P0 = kv['inst_dynext']
+    get_install_lib(files, "dynext", $P0)
+  L2:
+    $I0 = exists kv['inst_inc']
+    unless $I0 goto L3
+    $P0 = kv['inst_inc']
+    get_install_lib(files, "include", $P0)
+  L3:
+    $I0 = exists kv['inst_lang']
+    unless $I0 goto L4
+    $P0 = kv['inst_lang']
+    get_install_lib(files, "languages", $P0)
+  L4:
+    $I0 = exists kv['inst_lib']
+    unless $I0 goto L5
+    $P0 = kv['inst_lib']
+    get_install_lib(files, "library", $P0)
+  L5:
+    .return (files)
+.end
+
+.sub 'get_install_bin' :anon
+    .param pmc files
+    .param pmc array
+    $S1 = get_bindir()
+    $S1 .= "/"
+    $I0 = does array, 'array'
+    if $I0 goto L1
+    $S0 = array
+    $S2 = $S1 . $S0
+    files[$S2] = $S0
+    goto L2
+  L1:
+    $P0 = iter array
+  L3:
+    unless $P0 goto L2
+    $S0 = shift $P0
+    $S2 = $S1 . $S0
+    files[$S2] = $S0
+    goto L3
+  L2:
+.end
+
+.sub 'get_install_lib' :anon
+    .param pmc files
+    .param string dirname
+    .param pmc array
+    $S1 = get_libdir()
+    $S1 .= "/"
+    $S1 .= dirname
+    $S1 .= "/"
+    $I0 = does array, 'array'
+    if $I0 goto L1
+    $S0 = array
+    $S2 = $S1 . $S0
+    files[$S2] = $S0
+    goto L2
+  L1:
+    $P0 = iter array
+  L3:
+    unless $P0 goto L2
+    $S0 = shift $P0
+    $S2 = $S1 . $S0
+    files[$S2] = $S0
+    goto L3
+  L2:
+.end
+
+.sub 'get_install_xfiles' :anon
+    .param pmc kv :slurpy :named
+    .local pmc files
+    files = new 'Hash'
+    $I0 = exists kv['installable_pbc']
+    unless $I0 goto L1
+    $P0 = kv['installable_pbc']
+    get_install_installable_pbc(files, $P0)
+  L1:
+    $I0 = exists kv['dynops']
+    unless $I0 goto L2
+    $P0 = kv['dynops']
+    get_install_dynops(files, $P0)
+  L2:
+    $I0 = exists kv['dynpmc']
+    unless $I0 goto L3
+    $P0 = kv['dynpmc']
+    get_install_dynpmc(files, $P0)
+  L3:
+    .return (files)
+.end
+
+.sub 'get_install_installable_pbc' :anon
+    .param pmc files
+    .param pmc hash
+    .local string bin, bindir, pbc, exe
+    bindir = get_bindir()
+    exe = get_exe()
+    $P0 = iter hash
+  L1:
+    unless $P0 goto L2
+    bin = shift $P0
+    pbc = hash[bin]
+    $I0 = length pbc
+    $I0 -= 4
+    $S0 = substr pbc, 0, $I0
+    $S1 = 'installable_' . $S0
+    $S1 .= exe
+    $S2 = bindir . '/'
+    $S2 .= bin
+    $S2 .= exe
+    files[$S2] = $S1
+    goto L1
+  L2:
+.end
+
+.sub 'get_install_dynops' :anon
+    .param pmc files
+    .param pmc hash
+    .local string libdir, load_ext, ops, suffix
+    libdir = get_libdir()
+    load_ext = get_load_ext()
+    .local pmc cores
+    cores = get_cores()
+    $P0 = iter hash
+  L1:
+    unless $P0 goto L2
+    ops = shift $P0
+    $P1 = iter cores
+  L3:
+    unless $P1 goto L4
+    $S0 = shift $P1
+    suffix = cores[$S0]
+    $S1 = _mk_path_dynops(ops, suffix, load_ext)
+    $S2 = libdir . "/"
+    $S2 .= $S1
+    files[$S2] = $S1
+    goto L3
+  L4:
+    goto L1
+  L2:
+.end
+
+.sub 'get_install_dynpmc' :anon
+    .param pmc files
+    .param pmc hash
+    .local string libdir, load_ext
+    libdir = get_libdir()
+    load_ext = get_load_ext()
+    $P0 = iter hash
+  L1:
+    unless $P0 goto L2
+    $S0 = shift $P0
+    $S1 = _mk_path_dynpmc($S0, load_ext)
+    $S2 = libdir . "/"
+    $S2 .= $S1
+    files[$S2] = $S1
+    goto L1
+  L2:
+.end
+
+=back
+
+=head3 Step uninstall
+
+Same options as install.
+
+=cut
+
+.sub '_uninstall' :anon
+    .param pmc kv :slurpy :named
+    .local string root
+    root = get_value('root', '' :named('default'), kv :flat :named)
+
+    $P0 = get_install_files(kv :flat :named)
+    $P1 = iter $P0
+  L1:
+    unless $P1 goto L2
+    $S0 = shift $P1
+    $S0 = root . $S0
+    unlink($S0, 1 :named('verbose'))
+    goto L1
+  L2:
+
+    $P0 = get_install_xfiles(kv :flat :named)
+    $P1 = iter $P0
+  L3:
+    unless $P1 goto L4
+    $S0 = shift $P1
+    $S0 = root . $S0
+    unlink($S0, 1 :named('verbose'))
+    goto L3
+  L4:
+.end
+
+=head3 Step plumage
+
+=over 4
+
+=item name
+
+=item abstract
+
+=item authority
+
+=item version
+
+=item license_type
+
+=item license_uri
+
+=item copyright_holder
+
+=item packager
+
+=item description
+
+=item keywords
+
+=item checkout_uri
+
+=item browser_uri
+
+=item project_uri
+
+=back
+
+=cut
+
+.sub '_plumage' :anon
+    .param pmc kv :slurpy :named
+    $S0 = get_plumage(kv :flat :named)
+    $S1 = mk_plumage(kv :flat :named)
+    $I0 = file_exists($S0)
+    unless $I0 goto L1
+    $S0 = kv['__target__']
+    unless $S0 == 'plumage' goto L2
+    print $S1
+    goto L2
+  L1:
+    $S2 = dirname($S0)
+    mkpath($S2, 1 :named('verbose'))
+    spew($S0, $S1, 1 :named('verbose'))
+  L2:
+.end
+
+.sub 'get_plumage' :anon
+    .param pmc kv :slurpy :named
+    $S0 = get_name(kv :flat :named)
+    $S0 .= '.json'
+    $S0 = 'ports/plumage/' . $S0
+    .return ($S0)
+.end
+
+.sub 'mk_plumage' :anon
+    .param pmc kv :slurpy :named
+
+    .local string name
+    name = get_name(kv :flat :named)
+
+    .local string abstract
+    $S0 = get_value('abstract', kv :flat :named)
+    abstract = _json_escape($S0)
+
+    .local string authority
+    authority = get_value('authority', kv :flat :named)
+
+    .local string version
+    version = get_version(kv :flat :named)
+
+    .local string license_type
+    license_type = get_value('license_type', kv :flat :named)
+
+    .local string license_uri
+    license_uri = get_value('license_uri', kv :flat :named)
+
+    .local string copyright_holder
+    $S0 = get_value('copyright_holder', kv :flat :named)
+    copyright_holder = _json_escape($S0)
+
+    .local string packager
+    $S0 = get_value('packager', "distutils" :named('default'), kv :flat :named)
+    packager = _json_escape($S0)
+
+    .local string description
+    $S0 = get_value('description', kv :flat :named)
+    description = _json_escape($S0)
+
+    .local string keywords
+    keywords = ''
+    $I0 = exists kv['keywords']
+    unless $I0 goto L10
+    $P1 = kv['keywords']
+    $S1 = join "\", \"", $P1
+    keywords = "\"" . $S1
+    keywords .= "\""
+  L10:
+
+    .local string vcs
+    vcs = get_vcs()
+
+    .local string checkout_uri
+    checkout_uri = get_value('checkout_uri', kv :flat :named)
+
+    .local string browser_uri
+    browser_uri = get_value('browser_uri', kv :flat :named)
+
+    .local string project_uri
+    project_uri =get_value('project_uri', kv :flat :named)
+
+    $P0 = new 'FixedStringArray'
+    set $P0, 16
+    $P0[0] = name
+    $P0[1] = abstract
+    $P0[2] = authority
+    $P0[3] = version
+    $P0[4] = license_type
+    $P0[5] = license_uri
+    $P0[6] = copyright_holder
+    $P0[7] = packager
+    $P0[8] = keywords
+    $P0[9] = description
+    $P0[10] = name
+    $P0[11] = vcs
+    $P0[12] = vcs
+    $P0[13] = checkout_uri
+    $P0[14] = browser_uri
+    $P0[15] = project_uri
+
+    $S0 = <<'TEMPLATE'
+{
+    "meta-spec"    : {
+        "version"  : 1,
+        "uri"      : "https://trac.parrot.org/parrot/wiki/ModuleEcosystem"
+    },
+    "general"      : {
+        "name"     : "%s",
+        "abstract" : "%s",
+        "authority": "%s",
+        "version"  : "%s",
+        "license"  : {
+            "type" : "%s",
+            "uri"  : "%s"
+        },
+        "copyright_holder" : "%s",
+        "generated_by"     : "%s",
+        "keywords"         : [%s],
+        "description"      : "%s"
+    },
+    "instructions" : {
+        "fetch"    : {
+            "type" : "repository"
+        },
+        "update"   : {
+            "type" : "parrot_setup"
+        },
+        "build"    : {
+            "type" : "parrot_setup"
+        },
+        "test"     : {
+            "type" : "parrot_setup"
+        },
+        "smoke"    : {
+            "type" : "parrot_setup"
+        },
+        "install"  : {
+            "type" : "parrot_setup"
+        },
+        "uninstall": {
+            "type" : "parrot_setup"
+        },
+        "clean"    : {
+            "type" : "parrot_setup"
+        }
+    },
+    "dependency-info"  : {
+        "provides"     : ["%s"],
+        "requires"     : {
+            "fetch"    : ["%s"],
+            "build"    : [],
+            "test"     : ["perl5"],
+            "install"  : [],
+            "runtime"  : []
+        }
+    },
+    "resources"            : {
+        "repository"       : {
+             "type"        : "%s",
+             "checkout_uri": "%s",
+             "browser_uri" : "%s",
+             "project_uri" : "%s"
+        }
+    }
+}
+TEMPLATE
+    $S0 = sprintf $S0, $P0
+    .return ($S0)
+.end
+
+.sub '_json_escape' :anon
+    .param string str
+    $P0 = split '"', str
+    str = join '\"', $P0
+    $P0 = split "\n", str
+    str = join "\\n", $P0
+    .return (str)
+.end
+
+=head3 Step manifest
+
+=over 4
+
+=item manifest_includes
+
+array of pathname or a single pathname
+
+=item manifest_excludes
+
+array of pathname or a single pathname
+
+=item doc_files
+
+array of pathname or a single pathname
+
+=item pbc_pir, pir_pge, pir_tge, pir_nqp, pir_nqp-rx, pbc_pbc, exe_pbc,
+installable_pbc, dynops, dynpmc, html_pod
+
+=item inst_bin, inst_dynext, inst_inc, inst_lang, inst_lib
+
+=item harness_files, prove_files
+
+=back
+
+=cut
+
+.sub '_manifest' :anon
+    .param pmc kv :slurpy :named
+
+    $S0 = ''
+    $I0 = file_exists('MANIFEST')
+    unless $I0 goto L1
+    $S0 = slurp('MANIFEST')
+  L1:
+
+    $S1 = mk_manifest(kv :flat :named)
+    unless $S0 != $S1 goto L2
+    spew('MANIFEST', $S1, 1 :named('verbose'))
+  L2:
+.end
+
+.sub 'mk_manifest' :anon
+    .param pmc kv :slurpy :named
+    .local pmc needed, generated
+    needed = new 'Hash'
+    generated = new 'Hash'
+
+    $P0 = split ' ', 'pbc_pir pir_pge pir_tge pir_nqp pir_nqp-rx pbc_pbc exe_pbc installable_pbc dynops dynpmc html_pod'
+  L1:
+    unless $P0 goto L2
+    $S0 = shift $P0
+    $I0 = exists kv[$S0]
+    unless $I0 goto L1
+    $P1 = kv[$S0]
+    _manifest_add_hash(needed, generated, $P1)
+    goto L1
+  L2:
+
+    $P0 = split ' ', 'inst_bin inst_dynext inst_inc inst_lang inst_lib doc_files'
+  L3:
+    unless $P0 goto L4
+    $S0 = shift $P0
+    $I0 = exists kv[$S0]
+    unless $I0 goto L3
+    $P1 = kv[$S0]
+    _manifest_add_array(needed, $P1)
+    goto L3
+  L4:
+
+    $P0 = split ' ', 'harness_files prove_files'
+    $I1 = 0
+  L5:
+    unless $P0 goto L6
+    $S0 = shift $P0
+    $I0 = exists kv[$S0]
+    unless $I0 goto L5
+    $I1 = 1
+    $S1 = kv[$S0]
+    _manifest_add_glob(needed, $S1)
+    goto L5
+  L6:
+    if $I1 goto L7
+    _manifest_add_glob(needed, 't/*.t')
+  L7:
+
+    $P0 = split ' ', 'setup.pir setup.nqp t/harness'
+  L8:
+    unless $P0 goto L9
+    $S0 = shift $P0
+    $I0 = file_exists($S0)
+    unless $I0 goto L8
+    needed[$S0] = 1
+    goto L8
+  L9:
+
+    $S0 = get_license_file()
+    if $S0 == '' goto L10
+    needed[$S0] = 1
+  L10:
+
+    $P0 = iter generated
+  L11:
+    unless $P0 goto L12
+    $S0 = shift $P0
+    delete needed[$S0]
+    goto L11
+  L12:
+
+    $I0 = exists kv['manifest_includes']
+    unless $I0 goto L13
+    $P1 = kv['manifest_includes']
+    _manifest_add_array(needed, $P1)
+  L13:
+
+    $I0 = exists kv['manifest_excludes']
+    unless $I0 goto L14
+    $P1 = kv['manifest_excludes']
+    _manifest_del_array(needed, $P1)
+  L14:
+
+    $P1 = iter needed
+    $I0 = elements $P1
+    inc $I0
+    $P0 = new 'FixedPMCArray'
+    # currently, FixedStringArray hasn't the method sort.
+    # see TT #1356
+    set $P0, $I0
+    $I0 = 0
+    $P0[$I0] = 'MANIFEST'
+  L21:
+    unless $P1 goto L22
+    $S0 = shift $P1
+    inc $I0
+    $P0[$I0] = $S0
+    goto L21
+  L22:
+
+    $P0.'sort'()
+    $S0 = join "\n", $P0
+    $S0 .= "\n"
+    .return ($S0)
+.end
+
+.sub '_manifest_add_hash' :anon
+    .param pmc needed
+    .param pmc generated
+    .param pmc hash
+    $P0 = iter hash
+  L1:
+    unless $P0 goto L2
+    .local string key
+    key = shift $P0
+    generated[key] = 1
+    .local pmc depends
+    depends = $P0[key]
+    $I0 = does depends, 'array'
+    unless $I0 goto L3
+    $P1 = iter depends
+  L4:
+    unless $P1 goto L1
+    $S0 = shift $P1
+    if $S0 == '' goto L4
+    needed[$S0] = 1
+    goto L4
+  L3:
+    $S0 = depends
+    needed[$S0] = 1
+    goto L1
+  L2:
+.end
+
+.sub '_manifest_add_array' :anon
+    .param pmc needed
+    .param pmc array
+    $I0 = does array, 'array'
+    unless $I0 goto L1
+    $P0 = iter array
+  L2:
+    unless $P0 goto L3
+    $S0 = shift $P0
+    needed[$S0] = 1
+    goto L2
+  L1:
+    $S0 = array
+    needed[$S0] = 1
+  L3:
+.end
+
+.sub '_manifest_del_array' :anon
+    .param pmc needed
+    .param pmc array
+    $I0 = does array, 'array'
+    unless $I0 goto L1
+    $P0 = iter array
+  L2:
+    unless $P0 goto L3
+    $S0 = shift $P0
+    delete needed[$S0]
+    goto L2
+  L1:
+    $S0 = array
+    delete needed[$S0]
+  L3:
+.end
+
+.sub '_manifest_add_glob' :anon
+    .param pmc needed
+    .param string str
+    $P0 = glob(str)
+  L1:
+    unless $P0 goto L2
+    $S0 = shift $P0
+    needed[$S0] = 1
+    goto L1
+  L2:
+.end
+
+=head3 Step sdist
+
+On Windows calls sdist_zip, otherwise sdist_gztar
+
+=cut
+
+.sub '_sdist' :anon
+    .param pmc kv :slurpy :named
+    $P0 = get_config()
+    $S0 = $P0['osname']
+    unless $S0 == 'MSWin32' goto L1
+    .tailcall run_step('sdist_zip', kv :flat :named)
+  L1:
+    .tailcall run_step('sdist_gztar', kv :flat :named)
+.end
+
+=head3 Step sdist_gztar
+
+=cut
+
+.sub '_sdist_gztar' :anon
+    .param pmc kv :slurpy :named
+    run_step('manifest', kv :flat :named)
+
+    $S0 = slurp('MANIFEST')
+    $P0 = split "\n", $S0
+    $S0 = pop $P0
+    $S0 = get_tarname('.tar.gz', kv :flat :named)
+    $I0 = newer($S0, $P0)
+    if $I0 goto L1
+    $S0 = get_tarname('', kv :flat :named)
+    copy_sdist($S0, $P0)
+
+    .local string cmd
+    cmd = 'tar -cvf ' . $S0
+    cmd .= '.tar '
+    cmd .= $S0
+    system(cmd, 1 :named('verbose'))
+
+    rmtree($S0)
+
+    cmd = 'gzip --best ' . $S0
+    cmd .= '.tar'
+    system(cmd, 1 :named('verbose'))
+  L1:
+.end
+
+.sub '_clean_gztar' :anon
+    .param pmc kv :slurpy :named
+
+    $S0 = get_tarname('.tar.gz', kv :flat :named)
+    unlink($S0, 1 :named('verbose'))
+    unlink('MANIFEST', 1 :named('verbose'))
+.end
+
+.sub 'copy_sdist' :anon
+    .param string dirname
+    .param pmc files
+    mkdir(dirname)
+    $S1 = dirname . "/"
+    $P0 = iter files
+  L1:
+    unless $P0 goto L2
+    $S0 = shift $P0
+    $S2 = $S1 . $S0
+    install($S0, $S2)
+    goto L1
+  L2:
+.end
+
+.sub 'get_tarname' :anon
+    .param string ext
+    .param pmc kv :slurpy :named
+
+    $S0 = 'parrot-'
+    $S1 = get_name(kv :flat :named)
+    $S0 .= $S1
+    $S0 .= '-'
+    $S1 = get_version(kv :flat :named)
+    $S0 .= $S1
+    $S0 .= ext
+    .return ($S0)
+.end
+
+=head3 Step sdist_bztar
+
+=cut
+
+.sub '_sdist_bztar' :anon
+    .param pmc kv :slurpy :named
+    run_step('manifest', kv :flat :named)
+
+    $S0 = slurp('MANIFEST')
+    $P0 = split "\n", $S0
+    $S0 = pop $P0
+    $S0 = get_tarname('.tar.bz2', kv :flat :named)
+    $I0 = newer($S0, $P0)
+    if $I0 goto L1
+    $S0 = get_tarname('', kv :flat :named)
+    copy_sdist($S0, $P0)
+
+    .local string cmd
+    cmd = 'tar -cvf ' . $S0
+    cmd .= '.tar '
+    cmd .= $S0
+    system(cmd, 1 :named('verbose'))
+
+    rmtree($S0)
+
+    cmd = 'bzip2 ' . $S0
+    cmd .= '.tar'
+    system(cmd, 1 :named('verbose'))
+  L1:
+.end
+
+.sub '_clean_bztar' :anon
+    .param pmc kv :slurpy :named
+
+    $S0 = get_tarname('.tar.bz2', kv :flat :named)
+    unlink($S0, 1 :named('verbose'))
+    unlink('MANIFEST', 1 :named('verbose'))
+.end
+
+=head3 Step sdist_zip
+
+=cut
+
+.sub '_sdist_zip' :anon
+    .param pmc kv :slurpy :named
+    run_step('manifest', kv :flat :named)
+
+    $S0 = slurp('MANIFEST')
+    $P0 = split "\n", $S0
+    $S0 = pop $P0
+    $S0 = get_tarname('.zip', kv :flat :named)
+    $I0 = newer($S0, $P0)
+    if $I0 goto L1
+    .local string cmd
+    $S0 = get_tarname('', kv :flat :named)
+    copy_sdist($S0, $P0)
+
+    cmd = 'zip -9 -r '
+    cmd .= $S0
+    cmd .= '.zip '
+    cmd .= $S0
+    system(cmd, 1 :named('verbose'))
+
+    rmtree($S0)
+  L1:
+.end
+
+.sub '_clean_zip' :anon
+    .param pmc kv :slurpy :named
+
+    $S0 = get_tarname('.zip', kv :flat :named)
+    unlink($S0, 1 :named('verbose'))
+    unlink('MANIFEST', 1 :named('verbose'))
+.end
+
+=head3 Step sdist_rpm
+
+=cut
+
+.sub '_sdist_rpm' :anon
+    .param pmc kv :slurpy :named
+    run_step('sdist_gztar', kv :flat :named)
+
+    .local string rpm_base
+    rpm_base = get_value('rpm_base', 'rpm' :named('default'), kv :flat :named)
+
+    $S1 = get_tarname('.tar.gz', kv :flat :named)
+    $S2 = rpm_base . "/SOURCES/"
+    $S2 .= $S1
+    install($S1, $S2, 1 :named('verbose'))
+
+    run_step('spec', kv :flat :named)
+
+    .local string cmd
+    cmd = "rpmbuild --define '_topdir "
+    $S0 = cwd()
+    cmd .= $S0
+    cmd .= "/"
+    cmd .= rpm_base
+    cmd .= "' -bs -v "
+    $S0 = get_spec(kv :flat :named)
+    cmd .= $S0
+    system(cmd, 1 :named('verbose'))
+.end
+
+=head3 Step bdist
+
+On Windows calls bdist_wininst, otherwise bdist_rpm
+
+=cut
+
+.sub '_bdist' :anon
+    .param pmc kv :slurpy :named
+    $P0 = get_config()
+    $S0 = $P0['osname']
+    unless $S0 == 'MSWin32' goto L1
+    .tailcall run_step('bdist_wininst', kv :flat :named)
+  L1:
+    .tailcall run_step('bdist_rpm', kv :flat :named)
+.end
+
+=head3 Step spec
+
+=over 4
+
+=item rpm_base
+
+the default value is ports/rpm
+
+=item name
+
+=item version
+
+=item release
+
+=item abstract
+
+=item license_type
+
+=item project_uri
+
+=item description
+
+=item packager
+
+=item doc_files
+
+=item installable_pbc, dynops, dynpmc
+
+=item inst_bin, inst_dynext, inst_inc, inst_lang, inst_lib
+
+=back
+
+=cut
+
+.sub '_spec_rpm' :anon
+    .param pmc kv :slurpy :named
+    $S0 = get_spec(kv :flat :named)
+    $S1 = mk_spec(kv :flat :named)
+    $I0 = file_exists($S0)
+    unless $I0 goto L1
+    $S0 = kv['__target__']
+    unless $S0 == 'spec' goto L2
+    print $S1
+    goto L2
+  L1:
+    $S2 = dirname($S0)
+    mkpath($S2, 1 :named('verbose'))
+    spew($S0, $S1, 1 :named('verbose'))
+    .local string cmd
+    $S2 = dirname($S2)
+    cmd = "rpmbuild --define '_topdir " . $S2
+    cmd .= "' --nobuild "
+    cmd .= $S0
+    system(cmd, 1 :named('verbose'), 1 :named('ignore_error'))
+  L2:
+.end
+
+.sub 'get_spec' :anon
+    .param pmc kv :slurpy :named
+    $S0 = get_value('rpm_base', 'rpm' :named('default'), kv :flat :named)
+    $S0 .= "/SPECS/parrot-"
+    $S1 = get_name(kv :flat :named)
+    $S0 .= $S1
+    $S0 .= '.spec'
+    .return ($S0)
+.end
+
+.sub 'mk_spec' :anon
+    .param pmc kv :slurpy :named
+
+    .local pmc config
+    config = get_config()
+
+    .local string parrot_version
+    $S1 = config['VERSION']
+    $S2 = config['DEVEL']
+    parrot_version = $S1 . $S2
+
+    .local string name
+    name = get_name(kv :flat :named)
+
+    .local string version
+    version = get_version(kv :flat :named)
+
+    .local string release
+    release = get_value('release', '1' :named('default'), kv :flat :named)
+
+    .local string abstract
+    abstract = get_value('abstract', kv :flat :named)
+
+    .local string license_type
+    license_type = get_value('license_type', kv :flat :named)
+
+    .local string project_uri
+    project_uri =get_value('project_uri', kv :flat :named)
+
+    .local string tarball
+    tarball = get_tarname('.tar.gz', kv :flat :named)
+
+    .local string description
+    description = get_value('description', kv :flat :named)
+
+    .local string packager
+    packager = get_value('packager', "you <you at you.org>" :named('default'), kv :flat :named)
+
+    $P0 = new 'FixedStringArray'
+    set $P0, 9
+    $P0[0] = parrot_version
+    $P0[1] = name
+    $P0[2] = version
+    $P0[3] = release
+    $P0[4] = abstract
+    $P0[5] = license_type
+    $P0[6] = project_uri
+    $P0[7] = tarball
+    $P0[8] = description
+
+    $S0 = <<'TEMPLATE'
+%%define parrot_version %s
+
+Name:           parrot-%s
+Version:        %s
+Release:        %s
+Summary:        %s
+License:        %s
+Group:          Development/Libraries
+URL:            %s
+Source0:        %s
+BuildRoot:      %%{_tmppath}/%%{name}-%%{version}-%%{release}
+#BuildRequires:  parrot           = %%parrot_version
+#BuildRequires:  parrot-devel     = %%parrot_version
+
+%%description
+%s
+
+%%prep
+%%setup -n %%{name}-%%{version}
+
+%%build
+parrot setup.pir
+
+%%install
+rm -rf $RPM_BUILD_ROOT
+parrot setup.pir --root $RPM_BUILD_ROOT install
+
+%%check
+parrot setup.pir test
+
+%%clean
+rm -rf $RPM_BUILD_ROOT
+
+%%files
+%%defattr(-,root,root,-)
+TEMPLATE
+    .local string spec
+    spec = sprintf $S0, $P0
+
+    $S0 = mk_deb_docs(kv :flat :named)
+    if $S0 == '' goto L1
+    spec .= "%doc "
+    $P1 = split "\n", $S0
+    $S0 = pop $P1
+    $S0 = join "\n%doc ", $P1
+    spec .= $S0
+    spec .= "\n"
+  L1:
+
+    $S0 = mk_deb_install(kv :flat :named)
+    $P1 = split parrot_version, $S0
+    $S0 = join "%{parrot_version}", $P1
+    spec .= $S0
+
+    spec .= "\n%changelog\n* "
+    $I0 = time
+    $S0 = localtime $I0
+    $I0 = length $S0
+    dec $I0
+    $S0 = substr $S0, 0, $I0
+    $S1 = substr $S0, 0, 11
+    spec .= $S1
+    $S1 = substr $S0, 20
+    spec .= $S1
+    spec .= " "
+    spec .= packager
+    spec .= "\n- created by distutils\n"
+    .return (spec)
+.end
+
+=head3 Step bdist_rpm
+
+=cut
+
+.sub '_bdist_rpm' :anon
+    .param pmc kv :slurpy :named
+    run_step('sdist_gztar', kv :flat :named)
+
+    .local string rpm_base
+    rpm_base = get_value('rpm_base', 'rpm' :named('default'), kv :flat :named)
+
+    $S1 = get_tarname('.tar.gz', kv :flat :named)
+    $S2 = rpm_base . "/SOURCES/"
+    $S2 .= $S1
+    install($S1, $S2, 1 :named('verbose'))
+
+    run_step('spec', kv :flat :named)
+
+    .local string cmd
+    cmd = "rpmbuild --define '_topdir "
+    $S0 = cwd()
+    cmd .= $S0
+    cmd .= "/"
+    cmd .= rpm_base
+    cmd .= "' -bb -v "
+    $S0 = get_spec(kv :flat :named)
+    cmd .= $S0
+    system(cmd, 1 :named('verbose'))
+.end
+
+=head3 Step control
+
+See L<http://www.debian.org/doc/maint-guide/>.
+
+=over 4
+
+=item control_dir
+
+the default value is ports/debian
+
+=item name
+
+=item packager
+
+=item project_uri
+
+=item abstract
+
+=item description
+
+=item release
+
+=item copyright_holder
+
+=item doc_files
+
+=item installable_pbc, dynops, dynpmc
+
+=item inst_bin, inst_dynext, inst_inc, inst_lang, inst_lib
+
+=back
+
+=cut
+
+.sub '_control_deb' :anon
+    .param pmc kv :slurpy :named
+
+    $S0 = get_deb('control', kv :flat :named)
+    $S1 = dirname($S0)
+    mkpath($S1, 1 :named('verbose'))
+    $S1 = mk_deb_control(kv :flat :named)
+    $I0 = file_exists($S0)
+    unless $I0 goto L1
+    $S0 = kv['__target__']
+    unless $S0 == 'control' goto L2
+    print $S1
+    goto L3
+  L1:
+    spew($S0, $S1, 1 :named('verbose'))
+  L2:
+
+    $S0 = get_deb('changelog', kv :flat :named)
+    $I0 = file_exists($S0)
+    if $I0 goto L4
+    $S1 = mk_deb_changelog(kv :flat :named)
+    spew($S0, $S1, 1 :named('verbose'))
+  L4:
+
+    $S0 = get_deb('copyright', kv :flat :named)
+    $I0 = file_exists($S0)
+    if $I0 goto L5
+    $S1 = mk_deb_copyright(kv :flat :named)
+    spew($S0, $S1, 1 :named('verbose'))
+  L5:
+
+    $S0 = get_deb('rules', kv :flat :named)
+    $S1 = mk_deb_rules(kv :flat :named)
+    spew($S0, $S1, 1 :named('verbose'))
+
+    $S0 = get_deb_ext('.docs', kv :flat :named)
+    $S1 = mk_deb_docs(kv :flat :named)
+    spew($S0, $S1, 1 :named('verbose'))
+
+    $S0 = get_deb_ext('.install', kv :flat :named)
+    $S1 = mk_deb_install(kv :flat :named)
+    spew($S0, $S1, 1 :named('verbose'))
+  L3:
+.end
+
+.sub 'get_deb' :anon
+    .param string filename
+    .param pmc kv :slurpy :named
+    $S0 = get_value('control_dir', 'ports/debian' :named('default'), kv :flat :named)
+    $S0 .= "/"
+    $S0 .= filename
+    .return ($S0)
+.end
+
+.sub 'get_deb_ext' :anon
+    .param string ext
+    .param pmc kv :slurpy :named
+    $S0 = get_value('control_dir', 'ports/debian' :named('default'), kv :flat :named)
+    $S0 .= "/parrot-"
+    $S1 = get_name(kv :flat :named)
+    $S0 .= $S1
+    $S0 .= ext
+    .return ($S0)
+.end
+
+.sub 'mk_deb_control' :anon
+    .param pmc kv :slurpy :named
+
+    .local pmc config
+    config = get_config()
+
+    .local string parrot_version
+    $S1 = config['VERSION']
+    $S2 = config['DEVEL']
+    parrot_version = $S1 . $S2
+
+    .local string name
+    name = get_name(kv :flat :named)
+
+    .local string packager
+    packager = get_value('packager', "you <you at you.org>" :named('default'), kv :flat :named)
+
+    .local string project_uri
+    project_uri =get_value('project_uri', kv :flat :named)
+
+    .local string abstract
+    abstract = get_value('abstract', kv :flat :named)
+
+    .local string description
+    $S0 = get_value('description', kv :flat :named)
+    $P0 = split "\n", $S0
+    description = join "\n ", $P0
+
+    $P0 = new 'FixedStringArray'
+    set $P0, 8
+    $P0[0] = name
+    $P0[1] = packager
+    $P0[2] = parrot_version
+    $P0[3] = project_uri
+    $P0[4] = name
+    $P0[5] = parrot_version
+    $P0[6] = abstract
+    $P0[7] = description
+
+    $S0 = <<'TEMPLATE'
+Source: parrot-%s
+Section: interpreters
+Priority: optional
+Maintainer: %s
+Build-Depends: debhelper (>= 7), parrot-devel (= %s)
+Standards-Version: 3.8.3
+Homepage: %s
+
+Package: parrot-%s
+Architecture: any
+Depends: parrot-minimal (= %s)
+Description: %s
+ %s
+TEMPLATE
+    $S0 = sprintf $S0, $P0
+    .return ($S0)
+.end
+
+.sub 'mk_deb_changelog' :anon
+    .param pmc kv :slurpy :named
+
+    .local string name
+    name = get_name(kv :flat :named)
+
+    .local string version
+    version = get_version(kv :flat :named)
+
+    .local string release
+    release = get_value('release', '1' :named('default'), kv :flat :named)
+
+    .local string packager
+    packager = get_value('packager', "you <you at you.org>" :named('default'), kv :flat :named)
+
+    .local string timestamp
+    timestamp = get_timestamp()
+
+    $P0 = new 'FixedStringArray'
+    set $P0, 5
+    $P0[0] = name
+    $P0[1] = version
+    $P0[2] = release
+    $P0[3] = packager
+    $P0[4] = timestamp
+
+    $S0 = <<'TEMPLATE'
+parrot-%s (%s-%s) unstable; urgency=low
+
+  * Created by distutils.
+
+ -- %s  %s
+TEMPLATE
+    $S0 = sprintf $S0, $P0
+    .return ($S0)
+.end
+
+.sub 'mk_deb_copyright' :anon
+    .param pmc kv :slurpy :named
+
+    .local string packager
+    packager = get_value('packager', "you <you at you.org>" :named('default'), kv :flat :named)
+
+    .local string timestamp
+    timestamp = get_timestamp()
+
+    .local string project_uri
+    project_uri =get_value('project_uri', kv :flat :named)
+
+    .local string copyright_holder
+    copyright_holder = get_value('copyright_holder', kv :flat :named)
+
+    .local string license
+    license = ''
+    $S0 = get_license_file()
+    if $S0 == '' goto L1
+    $S0 = slurp($S0)
+    $P0 = split "\n", $S0
+    license = join "\n    ", $P0
+  L1:
+
+    $P0 = new 'FixedStringArray'
+    set $P0, 5
+    $P0[0] = packager
+    $P0[1] = timestamp
+    $P0[2] = project_uri
+    $P0[3] = copyright_holder
+    $P0[4] = license
+
+    $S0 = <<'TEMPLATE'
+This package was debianized by %s on
+%s.
+
+It was downloaded from %s
+
+Copyright for the code is held by: %s
+
+License:
+
+    %s
+TEMPLATE
+    $S0 = sprintf $S0, $P0
+    .return ($S0)
+.end
+
+.sub 'mk_deb_rules' :anon
+    .param pmc kv :slurpy :named
+
+    $S0 = <<'TEMPLATE'
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	touch configure-stamp
+
+build: build-stamp
+build-stamp: configure-stamp
+	dh_testdir
+	parrot setup.pir build
+	touch $@
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+	parrot setup.pir clean
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_prep
+	dh_installdirs
+	parrot setup.pir --root $(CURDIR)/debian/tmp install
+	dh_install --sourcedir=$(CURDIR)/debian/tmp --list-missing
+
+# Build architecture-independent files here.
+binary-indep: install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs
+	dh_installdocs
+	dh_installexamples
+	dh_installman
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
+
+TEMPLATE
+    .return ($S0)
+.end
+
+.sub 'mk_deb_docs' :anon
+    .param pmc kv :slurpy :named
+    $S0 = ''
+    $I0 = exists kv['doc_files']
+    unless $I0 goto L1
+    $P0 = kv['doc_files']
+    $I0 = does $P0, 'array'
+    if $I0 goto L2
+    $S0 = $P0
+    goto L1
+  L2:
+    $S0 = join "\n", $P0
+  L1:
+    $S0 .= "\n"
+    .return ($S0)
+.end
+
+.sub 'mk_deb_install' :anon
+    .param pmc kv :slurpy :named
+    $P0 = new 'ResizablePMCArray'
+    # currently, ResizableStringArray hasn't the method sort.
+    # see TT #1356
+    $P1 = get_install_files(kv :flat :named)
+    $P2 = iter $P1
+  L1:
+    unless $P2 goto L2
+    $S0 = shift $P2
+    push $P0, $S0
+    goto L1
+  L2:
+    $P1 = get_install_xfiles(kv :flat :named)
+    $P2 = iter $P1
+  L3:
+    unless $P2 goto L4
+    $S0 = shift $P2
+    push $P0, $S0
+    goto L3
+  L4:
+    $P0.'sort'()
+    $S0 = join "\n", $P0
+    $S0 .= "\n"
+    .return ($S0)
+.end
+
+.sub 'get_timestamp' :anon
+    $P0 = open 'date --rfc-2822', 'rp'
+    $S0 = $P0.'readline'()
+    $P0.'close'()
+    $S0 = chopn $S0, 1
+    .return ($S0)
+.end
+
+=head3 Step ebuild
+
+See L<http://devmanual.gentoo.org/>.
+
+=over 4
+
+=item description
+
+=item project_uri
+
+=item license_type
+
+=item doc_files
+
+=back
+
+=cut
+
+.sub '_ebuild_gentoo' :anon
+    .param pmc kv :slurpy :named
+    $S0 = get_ebuild(kv :flat :named)
+    $S1 = mk_ebuild(kv :flat :named)
+    $I0 = file_exists($S0)
+    unless $I0 goto L1
+    $S0 = kv['__target__']
+    unless $S0 == 'ebuild' goto L2
+    print $S1
+    goto L2
+  L1:
+    $S2 = dirname($S0)
+    mkpath($S2, 1 :named('verbose'))
+    spew($S0, $S1, 1 :named('verbose'))
+  L2:
+.end
+
+.sub 'get_ebuild' :anon
+    .param pmc kv :slurpy :named
+    $S0 = "ports/gentoo/parrot-"
+    $S1 = get_name(kv :flat :named)
+    $S0 .= $S1
+    $S0 .= "-"
+    $S1 = get_version(kv :flat :named)
+    $S0 .= $S1
+    $S0 .= '.ebuild'
+    .return ($S0)
+.end
+
+.sub 'mk_ebuild' :anon
+    .param pmc kv :slurpy :named
+
+    .local string description
+    $S0 = get_value('description', kv :flat :named)
+    description = _json_escape($S0)
+
+    .local string project_uri
+    project_uri =get_value('project_uri', kv :flat :named)
+
+    .local string license_type
+    license_type = get_value('license_type', kv :flat :named)
+
+    .local string doc
+    doc = ''
+    $I0 = exists kv['doc_files']
+    unless $I0 goto L1
+    doc = "    dodoc "
+    $P0 = kv['doc_files']
+    $I0 = does $P0, 'array'
+    if $I0 goto L2
+    $S0 = $P0
+    goto L3
+  L2:
+    $S0 = join " ", $P0
+  L3:
+    doc .= $S0
+    doc .= " || die"
+  L1:
+
+    $P0 = new 'FixedStringArray'
+    set $P0, 4
+    $P0[0] = description
+    $P0[1] = project_uri
+    $P0[2] = license_type
+    $P0[3] = doc
+
+    $S0 = <<'TEMPLATE'
+
+DESCRIPTION="%s"
+HOMEPAGE="%s"
+SRC_URI="./${P}.tar.gz"
+
+LICENSE="%s"
+SLOT="0"
+KEYWORDS="~arch"
+IUSE=""
+
+#DEPEND=""
+#RDEPEND=""
+
+src_compile() {
+    parrot setup.pir build || die "build failed"
+}
+
+src_install() {
+    parrot setup.pir --root ${D} install || die "install failed"
+%s
+}
+
+src_test() {
+    parrot setup.pir test || die "test failed"
+}
+TEMPLATE
+    $S0 = sprintf $S0, $P0
+    .return ($S0)
+.end
+
+=head3 Step bdist_wininst
+
+Build an installer with Inno Setup.
+See L<http://www.jrsoftware.org/>.
+
+=over 4
+
+=item name
+
+=item version
+
+=item copyright_holder
+
+=item project_uri
+
+=item installable_pbc, dynops, dynpmc
+
+=item inst_bin, inst_dynext, inst_inc, inst_lang, inst_lib
+
+=item doc_files
+
+=back
+
+=cut
+
+.sub '_bdist_wininst' :anon
+    .param pmc kv :slurpy :named
+    run_step('build', kv :flat :named)
+
+    $I0 = exists kv['installable_pbc']
+    unless $I0 goto L1
+    $P0 = kv['installable_pbc']
+    .local string exe, bin, pbc
+    exe = get_exe()
+    $P1 = iter $P0
+  L2:
+    unless $P1 goto L1
+    bin = shift $P1
+    pbc = $P0[bin]
+    $I0 = length pbc
+    $I0 -= 4
+    $S0 = substr pbc, 0, $I0
+    $S1 = 'installable_' . $S0
+    $S1 .= exe
+    $S2 = bin . exe
+    $I0 = newer($S2, $S1)
+    if $I0 goto L2
+    cp($S1, $S2, 1 :named('verbose'))
+    goto L2
+  L1:
+
+    $S0 = mk_inno_script(kv :flat :named)
+    spew('inno.iss', $S0)
+
+    system("iscc inno.iss", 1 :named('verbose'))
+.end
+
+.sub 'mk_inno_script' :anon
+    .param pmc kv :slurpy :named
+    .local pmc config
+    config = get_config()
+
+    .local string prefix
+    prefix = config['prefix']
+
+    .local string parrot_version
+    $S1 = config['VERSION']
+    $S2 = config['DEVEL']
+    parrot_version = $S1 . $S2
+
+    .local string name
+    name = get_Name(kv :flat :named)
+
+    .local string version
+    version = get_version(kv :flat :named)
+
+    .local string copyright_holder
+    copyright_holder = get_value('copyright_holder', kv :flat :named)
+
+    .local string project_uri
+    project_uri =get_value('project_uri', kv :flat :named)
+
+    .local string license
+    license = "; no LicenseFile"
+    $S0 = get_license_file()
+    if $S0 == '' goto L3
+    license = "LicenseFile=" . $S0
+  L3:
+
+    .local string setupname
+    setupname = get_setupname('', kv :flat :named)
+
+    $P0 = new 'FixedStringArray'
+    set $P0, 9
+    $P0[0] = name
+    $P0[1] = parrot_version
+    $P0[2] = name
+    $P0[3] = version
+    $P0[4] = copyright_holder
+    $P0[5] = project_uri
+    $P0[6] = prefix
+    $P0[7] = license
+    $P0[8] = setupname
+
+    $S0 = <<'TEMPLATE'
+; generated by distutils.pir for the Inno Setup Script Compiler.
+
+[Setup]
+AppName=Parrot-%s
+AppVerName=Parrot-%s-%s-%s
+AppPublisher=%s
+AppPublisherURL=%s
+DefaultDirName={sd}%s
+DefaultGroupName=Parrot
+AllowNoIcons=yes
+%s
+OutputDir=.\\
+OutputBaseFilename=%s
+Compression=lzma
+SolidCompression=yes
+Uninstallable=no
+
+[Files]
+TEMPLATE
+    .local string script
+    script = sprintf $S0, $P0
+
+    $I0 = exists kv['dynops']
+    if $I0 goto L21
+    $I0 = exists kv['dynpmc']
+    if $I0 goto L21
+    goto L22
+  L21:
+    script .= "Source: \".\\dynext\\*.dll\"; DestDir: \"{app}\\lib\\parrot\\dynext\"; Flags:\n"
+  L22:
+
+    $I0 = exists kv['installable_pbc']
+    unless $I0 goto L23
+    $P1 = kv['installable_pbc']
+    $P2 = iter $P1
+  L24:
+    unless $P2 goto L23
+    $S0 = shift $P2
+    script .= "Source: \".\\"
+    script .= $S0
+    script .= ".exe\"; DestDir: \"{app}\\bin\"; Flags:\n"
+    goto L24
+  L23:
+
+    $P1 = get_install_files(kv :flat :named)
+    $P2 = iter $P1
+  L31:
+    unless $P2 goto L32
+    $S0 = shift $P2
+    $S1 = $P1[$S0]
+    $S0 = _mk_inno_line($S1, $S0)
+    script .= $S0
+    goto L31
+  L32:
+
+    $I0 = exists kv['doc_files']
+    unless $I0 goto L41
+    name = get_name(kv :flat :named)
+    $P1 = kv['doc_files']
+    $I0 = does $P1, 'array'
+    if $I0 goto L42
+    $S0 = $P1
+    $S0 = _mk_inno_line_doc($S0, name)
+    script .= $S0
+    goto L41
+  L42:
+    $P2 = iter $P1
+  L43:
+    unless $P2 goto L41
+    $S0 = shift $P2
+    $S0 = _mk_inno_line_doc($S0, name)
+    script .= $S0
+    goto L43
+  L41:
+
+    script .= "\n"
+    .return (script)
+.end
+
+.sub '_mk_inno_line' :anon
+    .param string src
+    .param string dest
+    .local string line
+    line = "Source: \".\\"
+    $S0 = _escape_path_win32(src)
+    line .= $S0
+    line .= "\"; DestDir: \"{app}\\"
+    $S0 = dirname(dest)
+    $I0 = index $S0, '/', 1
+    inc $I0
+    $S0 = substr $S0, $I0
+    $S0 = _escape_path_win32($S0)
+    line .= $S0
+    line .= "\"; Flags:\n"
+    .return (line)
+.end
+
+.sub '_mk_inno_line_doc' :anon
+    .param string src
+    .param string dest
+    .local string line
+    line = "Source: \".\\"
+    $S0 = _escape_path_win32(src)
+    line .= $S0
+    line .= "\"; DestDir: \"{app}\\share\\doc\\parrot\\"
+    $S0 = dest
+    line .= $S0
+    line .= "\"; Flags:\n"
+    .return (line)
+.end
+
+.sub '_escape_path_win32' :anon
+    .param string path
+    $P0 = split "/", path
+    $S0 = join "\\", $P0
+    .return ($S0)
+.end
+
+.sub 'get_setupname' :anon
+    .param string ext
+    .param pmc kv :slurpy :named
+    .local pmc config
+    config = get_config()
+
+    $S0 = 'setup-parrot-'
+    $S1 = config['VERSION']
+    $S0 .= $S1
+    $S1 = config['DEVEL']
+    $S0 .= $S1
+    $S0 .= '-'
+    $S1 = get_name(kv :flat :named)
+    $S0 .= $S1
+    $S0 .= '-'
+    $S1 = get_version(kv :flat :named)
+    $S0 .= $S1
+    $S0 .= ext
+    .return ($S0)
+.end
+
+.sub '_clean_wininst' :anon
+    .param pmc kv :slurpy :named
+
+    $I0 = exists kv['installable_pbc']
+    unless $I0 goto L1
+    $P0 = kv['installable_pbc']
+    .local string exe, bin
+    exe = get_exe()
+    $P1 = iter $P0
+  L2:
+    unless $P1 goto L1
+    bin = shift $P1
+    $S0 = bin . exe
+    unlink($S0, 1 :named('verbose'))
+    goto L2
+  L1:
+
+    unlink('inno.iss', 1 :named('verbose'))
+    $S0 = get_setupname('.exe', kv :flat :named)
+    unlink($S0, 1 :named('verbose'))
+.end
+
+=head2 Configuration Helpers
+
+=over 4
+
+=item get_config
+
+Return the whole config
+
+=cut
+
+.include 'iglobals.pasm'
+
+.sub 'get_config'
+    $P0 = getinterp
+    $P1 = $P0[.IGLOBALS_CONFIG_HASH]
+    .return ($P1)
+.end
+
+=item get_bindir
+
+=cut
+
+.sub 'get_bindir'
+    $P0 = get_config()
+    $S0 = $P0['bindir']
+    .return ($S0)
+.end
+
+=item get_cflags
+
+=cut
+
+.sub 'get_cflags'
+    $P0 = get_config()
+    .local string flags
+    flags = $P0['ccflags']
+    flags .= " "
+    $S0 = $P0['cc_shared']
+    flags .= $S0
+    flags .= " "
+    $S0 = $P0['cc_debug']
+    flags .= $S0
+    flags .= " "
+    $S0 = $P0['ccwarn']
+    flags .= $S0
+    flags .= " "
+    $S0 = $P0['cc_hasjit']
+    flags .= $S0
+    flags .= " "
+    $S0 = $P0['cg_flag']
+    flags .= $S0
+    .return (flags)
+.end
+
+=item get_compiler
+
+=cut
+
+.sub 'get_compiler'
+    .param string name
+    $P0 = get_config()
+    $I0 = $P0['installed']
+    unless $I0 goto L1
+    $S0 = $P0['libdir']
+    $S1 = $P0['versiondir']
+    $S0 .= $S1
+    $S0 .= '/languages/'
+    goto L2
+  L1:
+    $S0 = $P0['prefix']
+    $S0 .= '/compilers/'
+  L2:
+    $S0 .= name
+    .return ($S0)
+.end
+
+=item get_exe
+
+=cut
+
+.sub 'get_exe'
+    $P0 = get_config()
+    $S0 = $P0['exe']
+    .return ($S0)
+.end
+
+=item get_executable
+
+=cut
+
+.sub 'get_executable'
+    .param string name
+    $P0 = get_config()
+    $I0 = $P0['installed']
+    unless $I0 goto L1
+    $S0 = $P0['bindir']
+    goto L2
+  L1:
+    $S0 = $P0['prefix']
+  L2:
+    $S0 .= '/'
+    $S0 .= name
+    $S1 = $P0['exe']
+    $S0 .= $S1
+    .return ($S0)
+.end
+
+=item get_incdir
+
+=cut
+
+.sub 'get_incdir'
+    $P0 = get_config()
+    $S0 = $P0['includedir']
+    $S1 = $P0['versiondir']
+    $S0 .= $S1
+    .return ($S0)
+.end
+
+=item get_libdir
+
+=cut
+
+.sub 'get_libdir'
+    $P0 = get_config()
+    $S0 = $P0['libdir']
+    $S1 = $P0['versiondir']
+    $S0 .= $S1
+    .return ($S0)
+.end
+
+=item get_library
+
+=cut
+
+.sub 'get_library'
+    .param string name
+    $P0 = get_config()
+    $I0 = $P0['installed']
+    unless $I0 goto L1
+    $S0 = $P0['libdir']
+    $S1 = $P0['versiondir']
+    $S0 .= $S1
+    $S0 .= '/library/'
+    goto L2
+  L1:
+    $S0 = $P0['prefix']
+    $S0 .= '/runtime/parrot/library/'
+  L2:
+    $S0 .= name
+    .return ($S0)
+.end
+
+=item get_ldflags
+
+=cut
+
+.sub 'get_ldflags'
+    $P0 = get_config()
+    .local string flags
+    flags = $P0['ldflags']
+    flags .= " "
+    $S0 = $P0['ld_debug']
+    flags .= $S0
+    flags .= " "
+    $S0 = $P0['rpath_blib']
+    flags .= $S0
+    flags .= " "
+    $S0 = $P0['linkflags']
+    flags .= $S0
+    .return (flags)
+.end
+
+=item get_load_ext
+
+=cut
+
+.sub 'get_load_ext'
+    $P0 = get_config()
+    $S0 = $P0['load_ext']
+    .return ($S0)
+.end
+
+=item get_obj
+
+=cut
+
+.sub 'get_obj'
+    $P0 = get_config()
+    $S0 = $P0['o']
+    .return ($S0)
+.end
+
+=item get_parrot
+
+=cut
+
+.sub 'get_parrot'
+    .tailcall get_executable('parrot')
+.end
+
+=item get_nqp
+
+=cut
+
+.sub 'get_nqp'
+    .tailcall get_executable('parrot-nqp')
+.end
+
+=item get_srcdir
+
+=cut
+
+.sub 'get_srcdir'
+    $P0 = get_config()
+    $S0 = $P0['srcdir']
+    $S1 = $P0['versiondir']
+    $S0 .= $S1
+    .return ($S0)
+.end
+
+=item get_tool
+
+=cut
+
+.sub 'get_tool'
+    .param string name
+    $P0 = get_config()
+    $I0 = $P0['installed']
+    unless $I0 goto L1
+    $S0 = $P0['libdir']
+    $S1 = $P0['versiondir']
+    $S0 .= $S1
+    goto L2
+  L1:
+    $S0 = $P0['prefix']
+  L2:
+    $S0 .= '/tools/'
+    $S0 .= name
+    .return ($S0)
+.end
+
+=item get_vcs
+
+=cut
+
+.sub 'get_vcs'
+    .local string vcs
+    vcs = 'VCS'
+    $I0 = file_exists('CVS')
+    unless $I0 goto L1
+    vcs = 'cvs'
+    goto L9
+  L1:
+    $I0 = file_exists('.git')
+    unless $I0 goto L2
+    vcs = 'git'
+    goto L9
+  L2:
+    $I0 = file_exists('.hg')
+    unless $I0 goto L3
+    vcs = 'hg'
+    goto L9
+  L3:
+    $I0 = file_exists('.svn')
+    unless $I0 goto L4
+    vcs = 'svn'
+    goto L9
+  L4:
+  L9:
+    .return (vcs)
+.end
+
+=item get_license_file
+
+=cut
+
+.sub 'get_license_file'
+    $P0 = split ' ', "LICENSE COPYING COPYRIGHT"
+  L1:
+    unless $P0 goto L2
+    $S0 = shift $P0
+    $I0 = file_exists($S0)
+    unless $I0 goto L1
+    .return ($S0)
+  L2:
+    .return ('')
+.end
+
+=item get_Name
+
+=cut
+
+.sub 'get_Name'
+    .param string name          :named('name') :optional
+    .param int has_name         :opt_flag
+    .param pmc extra            :slurpy :named
+    unless has_name goto L1
+    .return (name)
+  L1:
+    $S0 = cwd()
+    $S0 = basename($S0)
+    .return ($S0)
+.end
+
+=item get_name
+
+=cut
+
+.sub 'get_name'
+    .param string name          :named('name') :optional
+    .param int has_name         :opt_flag
+    .param pmc extra            :slurpy :named
+    unless has_name goto L1
+    $S0 = downcase name
+    .return ($S0)
+  L1:
+    $S0 = cwd()
+    $S0 = basename($S0)
+    $S0 = downcase $S0
+    .return ($S0)
+.end
+
+=item get_version
+
+=cut
+
+.sub 'get_version'
+    .param pmc kv :slurpy :named
+    .tailcall get_value('version', 'HEAD' :named('default'), kv :flat :named)
+.end
+
+=item get_value
+
+=cut
+
+.sub 'get_value'
+    .param string key
+    .param string default       :named('default') :optional
+    .param int has_default      :opt_flag
+    .param pmc kv :slurpy :named
+    $I0 = exists kv[key]
+    unless $I0 goto L1
+    $S0 = kv[key]
+    .return ($S0)
+  L1:
+    unless has_default goto L2
+    .return (default)
+  L2:
+    $S0 = upcase key
+    .return ($S0)
+.end
+
+=item probe_include
+
+=cut
+
+.sub 'probe_include'
+    .param string include
+    .param int verbose          :named('verbose') :optional
+    .param string cflags        :named('cflags') :optional
+    .param int has_cflags       :opt_flag
+
+    $S0 = <<'SOURCE_C'
+#include <%s>
+#include <stdio.h>
+
+int
+main(int argc, char* argv[])
+{
+    printf("%s OK\n");
+    return 0;
+}
+SOURCE_C
+    $P0 = new 'FixedStringArray'
+    set $P0, 2
+    $P0[0] = include
+    $P0[1] = include
+    $S0 = sprintf $S0, $P0
+    spew('probe.c', $S0)
+
+    .local string probe
+    $S0 = get_exe()
+    probe = "probe" . $S0
+    .local pmc config
+    config = get_config()
+    .local string cmd
+    cmd = config['cc']
+    cmd .= " "
+    $S0 = get_cflags()
+    cmd .= $S0
+    unless has_cflags goto L1
+    cmd .= " "
+    cmd .= cflags
+  L1:
+    cmd .= " probe.c -o "
+    cmd .= probe
+    system(cmd, verbose :named('verbose'), 1 :named('ignore_error'))
+
+    cmd = "./" . probe
+    $I0 = system(cmd, verbose :named('verbose'), 1 :named('ignore_error'))
+
+    unlink('probe.c', verbose :named('verbose'))
+    unlink(probe, verbose :named('verbose'))
+    .return ($I0)
+.end
+
+=back
+
+=head2 OS Utilities
+
+=over 4
+
+=item system
+
+=cut
+
+.sub 'system'
+    .param string cmd
+    .param int verbose          :named('verbose') :optional
+    .param int has_verbose      :opt_flag
+    .param int ignore_error     :named('ignore_error') :optional
+    .param int has_ignore_error :opt_flag
+    unless has_verbose goto L1
+    unless verbose goto L1
+    say cmd
+  L1:
+    $I0 = spawnw cmd
+    unless $I0 goto L2
+    unless has_ignore_error goto L3
+    if ignore_error goto L2
+  L3:
+    $S0 = "exit status: "
+    $S1 = $I0
+    $S0 .= $S1
+    $S0 .= "\ncommand: "
+    $S0 .= cmd
+    $S0 .= "\n"
+    die $S0
+  L2:
+    .return ($I0)
+.end
+
+.include 'stat.pasm'
+
+.sub 'file_exists'
+    .param string filename
+    $I0 = stat filename, .STAT_EXISTS
+    .return ($I0)
+.end
+
+=item newer
+
+=cut
+
+.sub 'newer' :multi(string, pmc)
+    .param string target
+    .param pmc depends
+    $I0 = does depends, 'array'
+    if $I0 goto L0
+    $S0 = depends
+    .tailcall newer(target, $S0)
+  L0:
+    $I0 = stat target, .STAT_EXISTS
+    if $I0 goto L1
+    .return (0)
+  L1:
+    $I0 = stat target, .STAT_MODIFYTIME
+    $P0 = iter depends
+  L2:
+    unless $P0 goto L3
+    $S0 = shift $P0
+    if $S0 == '' goto L2
+    $I1 = stat $S0, .STAT_MODIFYTIME
+    if $I1 < $I0 goto L2
+    .return (0)
+  L3:
+    .return (1)
+.end
+
+.sub 'newer' :multi(string, string)
+    .param string target
+    .param string depend
+    $I0 = stat target, .STAT_EXISTS
+    if $I0 goto L1
+    .return (0)
+  L1:
+    $I1 = stat target, .STAT_MODIFYTIME
+    $I2 = stat depend, .STAT_MODIFYTIME
+    $I0 = $I1 > $I2
+    .return ($I0)
+.end
+
+=item mkpath
+
+=cut
+
+.sub 'mkpath'
+    .param string pathname
+    .param int verbose          :named('verbose') :optional
+    $I1 = 1
+  L1:
+    $I1 = index pathname, '/', $I1
+    if $I1 < 0 goto L2
+    $S0 = substr pathname, 0, $I1
+    inc $I1
+    $I0 = stat $S0, .STAT_EXISTS
+    if $I0 goto L1
+    mkdir($S0, verbose :named('verbose'))
+    goto L1
+  L2:
+    $I0 = stat pathname, .STAT_EXISTS
+    if $I0 goto L3
+    mkdir(pathname, verbose :named('verbose'))
+  L3:
+.end
+
+=item mkdir
+
+=cut
+
+.sub 'mkdir'
+    .param string dirname
+    .param int verbose          :named('verbose') :optional
+    .param int has_verbose      :opt_flag
+    unless has_verbose goto L1
+    unless verbose goto L1
+    print "mkdir "
+    say dirname
+  L1:
+    $P0 = new 'OS'
+    $I1 = 0o775
+    push_eh _handler
+    $P0.'mkdir'(dirname, $I1)
+    pop_eh
+    .return ()
+  _handler:
+    .local pmc e
+    .get_results (e)
+    $S0 = "Can't mkdir '"
+    $S0 .= dirname
+    $S0 .= "' ("
+    $S1 = err
+    $S0 .= $S1
+    $S0 .= ")\n"
+    e = $S0
+    rethrow e
+.end
+
+=item install
+
+=cut
+
+.sub 'install'
+    .param string src
+    .param string dst
+    .param int exe              :named('exe') :optional
+    .param int has_exe          :opt_flag
+    .param int verbose          :named('verbose') :optional
+    # mkpath
+    $I1 = 1
+  L1:
+    $I1 = index dst, '/', $I1
+    if $I1 < 0 goto L2
+    $S0 = substr dst, 0, $I1
+    inc $I1
+    $I0 = stat $S0, .STAT_EXISTS
+    if $I0 goto L1
+    mkdir($S0, verbose :named('verbose'))
+    goto L1
+  L2:
+    $I0 = newer(dst, src)
+    if $I0 goto L3
+    cp(src, dst, verbose :named('verbose'))
+    unless has_exe goto L3
+    unless exe goto L3
+    $P0 = getinterp
+    $P0 = $P0[.IGLOBALS_CONFIG_HASH]
+    $I0 = $P0['cygwin']
+    if $I0 goto L4
+    $I0 = $P0['hpux']
+    if $I0 goto L4
+    goto L3
+  L4:
+    chmod(dst, 0o755, verbose :named('verbose'))
+  L3:
+.end
+
+=item cp
+
+=cut
+
+.sub 'cp'
+    .param string src
+    .param string dst
+    .param int verbose          :named('verbose') :optional
+    .param int has_verbose      :opt_flag
+    unless has_verbose goto L1
+    unless verbose goto L1
+    print "cp "
+    print src
+    print " "
+    say dst
+  L1:
+    $P0 = new 'FileHandle'
+    push_eh _handler1
+    $S0 = $P0.'readall'(src)
+    pop_eh
+    push_eh _handler2
+    $P0.'open'(dst, 'w')
+    pop_eh
+    $P0.'puts'($S0)
+    $P0.'close'()
+    .return ()
+  _handler1:
+    .local pmc e
+    .get_results (e)
+    $S0 = "Can't open '"
+    $S0 .= src
+    $S0 .= "' ("
+    $S1 = err
+    $S0 .= $S1
+    $S0 .= ")\n"
+    e = $S0
+    rethrow e
+  _handler2:
+    .local pmc e
+    .get_results (e)
+    $S0 = "Can't open '"
+    $S0 .= dst
+    $S0 .= "' ("
+    $S1 = err
+    $S0 .= $S1
+    $S0 .= ")\n"
+    e = $S0
+    rethrow e
+.end
+
+=item chmod
+
+=cut
+
+.sub 'chmod'
+    .param string filename
+    .param int mode
+    .param int verbose          :named('verbose') :optional
+    # see TT #1322
+    $P0 = get_config()
+    .local string cmd
+    cmd = $P0['perl']
+    cmd .= " -MExtUtils::Command -e ExtUtils::Command::chmod "
+    $P1 = new 'FixedIntegerArray'
+    set $P1, 1
+    $P1[0] = mode
+    $S0 = sprintf '0%o', $P1
+    cmd .= $S0
+    cmd .= " "
+    cmd .= filename
+    system(cmd, verbose :named('verbose'))
+.end
+
+=item unlink
+
+=cut
+
+.sub 'unlink' :multi(string)
+    .param string filename
+    .param int verbose          :named('verbose') :optional
+    .param int has_verbose      :opt_flag
+    $I0 = stat filename, .STAT_EXISTS
+    unless $I0 goto L1
+    $I0 = stat filename, .STAT_ISREG
+    unless $I0 goto L1
+    unless has_verbose goto L2
+    unless verbose goto L2
+    print "unlink "
+    say filename
+  L2:
+    new $P0, 'OS'
+    push_eh _handler
+    $P0.'rm'(filename)
+    pop_eh
+  L1:
+    .return ()
+  _handler:
+    .local pmc e
+    .get_results (e)
+    $S0 = "Can't remove '"
+    $S0 .= filename
+    $S0 .= "' ("
+    $S1 = err
+    $S0 .= $S1
+    $S0 .= ")\n"
+    e = $S0
+    rethrow e
+.end
+
+.sub 'unlink' :multi(pmc)
+    .param pmc list
+    .param int verbose          :named('verbose') :optional
+    $I0 = does list, 'array'
+    if $I0 goto L1
+    $S0 = list
+    unlink($S0, verbose :named('verbose'))
+    goto L2
+  L1:
+    $P0 = iter list
+  L3:
+    unless $P0 goto L2
+    $S0 = shift $P0
+    unlink($S0, verbose :named('verbose'))
+    goto L3
+  L2:
+.end
+
+=item rmtree
+
+=cut
+
+.sub 'rmtree'
+    .param string path
+    .param int verbose          :named('verbose') :optional
+    .param int has_verbose      :opt_flag
+    $I0 = stat path, .STAT_EXISTS
+    unless $I0 goto L1
+    $I0 = stat path, .STAT_ISDIR
+    unless $I0 goto L1
+    unless has_verbose goto L2
+    unless verbose goto L2
+    print "rmtree "
+    say path
+  L2:
+    new $P0, 'OS'
+    $P1 = $P0.'readdir'(path)
+    push_eh _handler
+  L3:
+    unless $P1 goto L4
+    $S0 = shift $P1
+    if $S0 == '.' goto L3
+    if $S0 == '..' goto L3
+    $S1 = path . '/'
+    $S1 .= $S0
+    $I0 = stat $S1, .STAT_ISDIR
+    unless $I0 goto L5
+    rmtree($S1)
+    goto L3
+  L5:
+    $P0.'rm'($S1)
+    goto L3
+  L4:
+    push_eh _handler
+    $S1 = path
+    $P0.'rm'($S1)
+    pop_eh
+  L1:
+    .return ()
+  _handler:
+    .local pmc e
+    .get_results (e)
+    $S0 = "Can't remove '"
+    $S0 .= $S1
+    $S0 .= "' ("
+    $S1 = err
+    $S0 .= $S1
+    $S0 .= ")\n"
+    e = $S0
+    rethrow e
+.end
+
+=item basename
+
+=cut
+
+.sub 'basename'
+    .param string path
+    $I0 = 0
+  L1:
+    $I1 = index path, '/', $I0
+    if $I1 < 0 goto L2
+    $I0 = $I1 + 1
+    goto L1
+  L2:
+    $S0 = substr path, $I0
+    .return ($S0)
+.end
+
+=item dirname
+
+=cut
+
+.sub 'dirname'
+    .param string path
+    unless path goto L3
+    $I0 = 0
+  L1:
+    $I1 = index path, '/', $I0
+    if $I1 < 0 goto L2
+    $I0 = $I1 + 1
+    goto L1
+  L2:
+    dec $I0
+    unless $I0 > 0 goto L3
+    $S0 = substr path, 0, $I0
+    .return ($S0)
+  L3:
+    .return ('.')
+.end
+
+=item cwd
+
+=cut
+
+.sub 'cwd'
+    new $P0, 'OS'
+    $S0 = $P0.'cwd'()
+    $P0 = split "\\", $S0
+    $S0 = join "/", $P0
+    .return ($S0)
+.end
+
+=item chdir
+
+=cut
+
+.sub 'chdir'
+    .param string dirname
+    .param int verbose          :named('verbose') :optional
+    .param int has_verbose      :opt_flag
+    unless has_verbose goto L1
+    unless verbose goto L1
+    print "cd "
+    say dirname
+  L1:
+    new $P0, 'OS'
+    push_eh _handler
+    $P0.'chdir'(dirname)
+    pop_eh
+    .return ()
+  _handler:
+    .local pmc e
+    .get_results (e)
+    $S0 = "Can't chdir '"
+    $S0 .= dirname
+    $S0 .= "' ("
+    $S1 = err
+    $S0 .= $S1
+    $S0 .= ")\n"
+    e = $S0
+    rethrow e
+.end
+
+=item chomp
+
+=cut
+
+.include 'cclass.pasm'
+
+.sub 'chomp'
+    .param string str
+    $I0 = index str, "\r"
+    if $I0 < 0 goto L1
+    str = substr str, 0, $I0
+  L1:
+    $I1 = index str, "\n"
+    if $I1 < 0 goto L2
+    str = substr str, 0, $I1
+  L2:
+    .return (str)
+.end
+
+=item glob
+
+=cut
+
+.sub 'glob'
+    .param string patterns
+    $P0 = new 'ResizableStringArray'
+    $P1 = split ' ', patterns
+  L1:
+    unless $P1 goto L2
+    .local string pattern
+    pattern = shift $P1
+    $I0 = index pattern, '*'
+    unless $I0 < 0 goto L3
+    $I0 = index pattern, '?'
+    unless $I0 < 0 goto L3
+    $I0 = index pattern, '['
+    unless $I0 < 0 goto L3
+    $I0 = stat pattern, .STAT_EXISTS
+    unless $I0 goto L1
+    push $P0, pattern
+    goto L1
+  L3:
+    .local pmc matcher
+    load_bytecode 'PGE/Glob.pbc'
+    $P2 = compreg 'PGE::Glob'
+    matcher = $P2.'compile'(pattern)
+    $S0 = dirname(pattern)
+    $P3 = glob($S0)
+    $P4 = new 'OS'
+  L4:
+    unless $P3 goto L1
+    .local string dir
+    dir = shift $P3
+    $I0 = stat dir, .STAT_ISDIR
+    unless $I0 goto L4
+    $S0 = basename(dir)
+    $P5 = $P4.'readdir'(dir)
+  L5:
+    unless $P5 goto L4
+    $S0 = shift $P5
+    if $S0 == '.' goto L5
+    if $S0 == '..' goto L5
+    if dir == '.' goto L6
+    $S1 = dir . '/'
+    $S0 = $S1 . $S0
+  L6:
+    $P6 = matcher($S0)
+    unless $P6 goto L5
+    push $P0, $S0
+    goto L5
+  L2:
+    .return ($P0)
+.end
+
+=item getenv
+
+=cut
+
+.sub 'getenv'
+    .param string name
+    new $P0, 'Env'
+    $S0 = $P0[name]
+    .return ($S0)
+.end
+
+=item setenv
+
+=cut
+
+.sub 'setenv'
+    .param string name
+    .param string value
+    .param int verbose          :named('verbose') :optional
+    .param int has_verbose      :opt_flag
+    unless has_verbose goto L1
+    unless verbose goto L1
+    print "setenv "
+    print name
+    print " = "
+    say value
+  L1:
+    new $P0, 'Env'
+    $P0[name] = value
+.end
+
+=item slurp
+
+=cut
+
+.sub 'slurp'
+    .param string filename
+    $P0 = new 'FileHandle'
+    push_eh _handler
+    $S0 = $P0.'readall'(filename)
+    pop_eh
+    .return ($S0)
+  _handler:
+    .local pmc e
+    .get_results (e)
+    $S0 = "Can't open '"
+    $S0 .= filename
+    $S0 .= "' ("
+    $S1 = err
+    $S0 .= $S1
+    $S0 .= ")\n"
+    e = $S0
+    rethrow e
+.end
+
+=item spew
+
+=cut
+
+.sub 'spew'
+    .param string filename
+    .param string content
+    .param int verbose          :named('verbose') :optional
+    .param int has_verbose      :opt_flag
+    unless has_verbose goto L1
+    unless verbose goto L1
+    print "creat "
+    say filename
+  L1:
+    $P0 = new 'FileHandle'
+    push_eh _handler
+    $P0.'open'(filename, 'w')
+    pop_eh
+    $P0.'puts'(content)
+    $P0.'close'()
+    .return ()
+  _handler:
+    .local pmc e
+    .get_results (e)
+    $S0 = "Can't open '"
+    $S0 .= filename
+    $S0 .= "' ("
+    $S1 = err
+    $S0 .= $S1
+    $S0 .= ")\n"
+    e = $S0
+    rethrow e
+.end
+
+=item append
+
+=cut
+
+.sub 'append'
+    .param string filename
+    .param string content
+    .param int verbose          :named('verbose') :optional
+    .param int has_verbose      :opt_flag
+    unless has_verbose goto L1
+    unless verbose goto L1
+    print "append "
+    say filename
+  L1:
+    $P0 = new 'FileHandle'
+    push_eh _handler
+    $P0.'open'(filename, 'a')
+    pop_eh
+    $P0.'puts'(content)
+    $P0.'close'()
+    .return ()
+  _handler:
+    .local pmc e
+    .get_results (e)
+    $S0 = "Can't open '"
+    $S0 .= filename
+    $S0 .= "' ("
+    $S1 = err
+    $S0 .= $S1
+    $S0 .= ")\n"
+    e = $S0
+    rethrow e
+.end
+
+=back
+
+=head1 AUTHOR
+
+Francois Perrad
+
+=cut
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/runtime/parrot/library/parrotlib.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/parrotlib.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/library/parrotlib.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -165,16 +165,15 @@
     .param string name
     .param pmc array
     .local string ret
-    .local pmc iter
+    .local pmc it
 
-    iter = new 'Iterator', array
-    iter = 0 #ITERATE_FROM_START
+    it = iter array
 
 NEXT:
     null ret
-    unless iter goto END
+    unless it goto END
 
-    $P0 = shift iter
+    $P0 = shift it
     ret = $P0( name )
     if_null ret, NEXT
 END:

Modified: branches/orderedhash_revamp/runtime/parrot/library/pcre.pir
==============================================================================
--- branches/orderedhash_revamp/runtime/parrot/library/pcre.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/runtime/parrot/library/pcre.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -59,9 +59,24 @@
     if 'cygwin'  == osname goto LIB_CYGWIN
 
 LIB_DEFAULT:
+# Plain name
     loadlib libpcre, 'libpcre'
     loaded = defined libpcre
     if loaded goto LIB_LOADED
+# Shared object name
+    loadlib libpcre, 'libpcre.so'
+    loaded = defined libpcre
+    if loaded goto LIB_LOADED
+# soname of recent versions
+    loadlib libpcre, 'libpcre.so.3'
+    loaded = defined libpcre
+    if loaded goto LIB_LOADED
+
+    # See TT #578
+    loadlib libpcre, 'libpcre.so.0'
+    loaded = defined libpcre
+    if loaded goto LIB_LOADED
+
     branch LIB_FAILED
 
 LIB_WIN32:

Modified: branches/orderedhash_revamp/src/byteorder.c
==============================================================================
--- branches/orderedhash_revamp/src/byteorder.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/byteorder.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -26,7 +26,6 @@
 */
 
 #include "parrot/parrot.h"
-#include "parrot/packfile.h"
 
 /* HEADERIZER HFILE: include/parrot/packfile.h */
 

Added: branches/orderedhash_revamp/src/call/args.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/src/call/args.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,3221 @@
+/*
+Copyright (C) 2001-2009, Parrot Foundation.
+$Id$
+
+=head1 NAME
+
+src/call/args.c
+
+=head1 DESCRIPTION
+
+B<Arguments and Returns>: Functions in this file handle argument/return value
+passing to and from subroutines following the Parrot Calling Conventions.
+
+=head1 FUNCTIONS
+
+=over 4
+
+=cut
+
+*/
+
+#include "parrot/parrot.h"
+#include "parrot/oplib/ops.h"
+#include "args.str"
+#include "pmc/pmc_key.h"
+#include "pmc/pmc_fixedintegerarray.h"
+
+/* HEADERIZER HFILE: include/parrot/call.h */
+
+/*
+Set of functions used in generic versions of fill_params and fill_returns.
+*/
+typedef INTVAL*   (*intval_ptr_func_t)(PARROT_INTERP, void *arg_info, INTVAL index);
+typedef FLOATVAL* (*numval_ptr_func_t)(PARROT_INTERP, void *arg_info, INTVAL index);
+typedef STRING**  (*string_ptr_func_t)(PARROT_INTERP, void *arg_info, INTVAL index);
+typedef PMC**     (*pmc_ptr_func_t)   (PARROT_INTERP, void *arg_info, INTVAL index);
+
+typedef INTVAL    (*intval_func_t)(PARROT_INTERP, void *arg_info, INTVAL index);
+typedef FLOATVAL  (*numval_func_t)(PARROT_INTERP, void *arg_info, INTVAL index);
+typedef STRING*   (*string_func_t)(PARROT_INTERP, void *arg_info, INTVAL index);
+typedef PMC*      (*pmc_func_t)   (PARROT_INTERP, void *arg_info, INTVAL index);
+
+typedef struct pcc_set_funcs {
+    intval_ptr_func_t   intval;
+    numval_ptr_func_t   numval;
+    string_ptr_func_t   string;
+    pmc_ptr_func_t      pmc;
+
+    intval_func_t   intval_constant;
+    numval_func_t   numval_constant;
+    string_func_t   string_constant;
+    pmc_func_t      pmc_constant;
+} pcc_set_funcs;
+
+typedef struct pcc_get_funcs {
+    intval_func_t   intval;
+    numval_func_t   numval;
+    string_func_t   string;
+    pmc_func_t      pmc;
+
+    intval_func_t   intval_constant;
+    numval_func_t   numval_constant;
+    string_func_t   string_constant;
+    pmc_func_t      pmc_constant;
+} pcc_get_funcs;
+
+/* HEADERIZER BEGIN: static */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+
+static void assign_default_param_value(PARROT_INTERP,
+    INTVAL param_index,
+    INTVAL param_flags,
+    ARGIN(void *arg_info),
+    ARGIN(struct pcc_set_funcs *accessor))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(4)
+        __attribute__nonnull__(5);
+
+static void assign_default_result_value(PARROT_INTERP,
+    ARGMOD(PMC *results),
+    INTVAL index,
+    INTVAL result_flags)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        FUNC_MODIFIES(*results);
+
+PARROT_CAN_RETURN_NULL
+static PMC* clone_key_arg(PARROT_INTERP, ARGIN(PMC *key))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+static void csr_fill_integer(PARROT_INTERP,
+    ARGIN(PMC *self),
+    INTVAL key,
+    INTVAL value)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+static void csr_fill_number(PARROT_INTERP,
+    ARGIN(PMC *self),
+    INTVAL key,
+    FLOATVAL value)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+static void csr_fill_pmc(PARROT_INTERP,
+    ARGIN(PMC *self),
+    INTVAL key,
+    ARGIN_NULLOK(PMC *value))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+static void csr_fill_string(PARROT_INTERP,
+    ARGIN(PMC *self),
+    INTVAL key,
+    ARGIN_NULLOK(STRING *value))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CANNOT_RETURN_NULL
+static void* csr_get_pointer_keyed_int(PARROT_INTERP,
+    ARGIN(PMC *self),
+    INTVAL key)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CANNOT_RETURN_NULL
+static STRING* csr_get_string_keyed_int(PARROT_INTERP,
+    ARGIN(PMC *self),
+    INTVAL key)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+static void csr_push_pointer(PARROT_INTERP,
+    ARGIN(PMC *self),
+    ARGIN_NULLOK(void *value),
+    INTVAL type)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CANNOT_RETURN_NULL
+static void** csr_reallocate_return_values(PARROT_INTERP,
+    ARGIN(PMC *self),
+    INTVAL size)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+static INTVAL csr_returns_count(PARROT_INTERP, ARGIN(PMC *self))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CANNOT_RETURN_NULL
+static void dissect_aggregate_arg(PARROT_INTERP,
+    ARGMOD(PMC *call_object),
+    ARGIN(PMC *aggregate))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        FUNC_MODIFIES(*call_object);
+
+static void extract_named_arg_from_op(PARROT_INTERP,
+    ARGMOD(PMC *call_object),
+    ARGIN(STRING *name),
+    ARGIN(PMC * const raw_sig),
+    ARGIN(opcode_t * const raw_args),
+    INTVAL arg_index)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4)
+        __attribute__nonnull__(5)
+        FUNC_MODIFIES(*call_object);
+
+static void fill_params(PARROT_INTERP,
+    ARGMOD_NULLOK(PMC *call_object),
+    ARGIN(PMC *raw_sig),
+    ARGIN(void *arg_info),
+    ARGIN(struct pcc_set_funcs *accessor))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4)
+        __attribute__nonnull__(5)
+        FUNC_MODIFIES(*call_object);
+
+static void fill_results(PARROT_INTERP,
+    ARGMOD_NULLOK(PMC *call_object),
+    ARGIN(PMC *raw_sig),
+    ARGIN(void *return_info),
+    ARGIN(struct pcc_get_funcs *accessor))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4)
+        __attribute__nonnull__(5)
+        FUNC_MODIFIES(*call_object);
+
+PARROT_CANNOT_RETURN_NULL
+static INTVAL intval_arg_from_c_args(PARROT_INTERP,
+    ARGIN(va_list *args),
+    SHIM(INTVAL param_index))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CANNOT_RETURN_NULL
+static INTVAL intval_arg_from_continuation(PARROT_INTERP,
+    ARGIN(PMC *cs),
+    INTVAL arg_index)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CANNOT_RETURN_NULL
+static INTVAL intval_arg_from_op(PARROT_INTERP,
+    ARGIN(opcode_t *raw_args),
+    INTVAL arg_index)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+static INTVAL intval_constant_from_op(PARROT_INTERP,
+    ARGIN(opcode_t *raw_params),
+    INTVAL param_index)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+static INTVAL intval_constant_from_varargs(PARROT_INTERP,
+    ARGIN(void *data),
+    INTVAL index)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CANNOT_RETURN_NULL
+static INTVAL* intval_param_from_c_args(PARROT_INTERP,
+    ARGIN(va_list *args),
+    SHIM(INTVAL param_index))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CANNOT_RETURN_NULL
+static INTVAL* intval_param_from_op(PARROT_INTERP,
+    ARGIN(opcode_t *raw_params),
+    INTVAL param_index)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CANNOT_RETURN_NULL
+static FLOATVAL numval_arg_from_c_args(PARROT_INTERP,
+    ARGIN(va_list *args),
+    SHIM(INTVAL param_index))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CANNOT_RETURN_NULL
+static FLOATVAL numval_arg_from_continuation(PARROT_INTERP,
+    ARGIN(PMC *cs),
+    INTVAL arg_index)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CANNOT_RETURN_NULL
+static FLOATVAL numval_arg_from_op(PARROT_INTERP,
+    ARGIN(opcode_t *raw_args),
+    INTVAL arg_index)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+static FLOATVAL numval_constant_from_op(PARROT_INTERP,
+    ARGIN(opcode_t *raw_params),
+    INTVAL param_index)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+static FLOATVAL numval_constant_from_varargs(PARROT_INTERP,
+    ARGIN(void *data),
+    INTVAL index)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CANNOT_RETURN_NULL
+static FLOATVAL* numval_param_from_c_args(PARROT_INTERP,
+    ARGIN(va_list *args),
+    SHIM(INTVAL param_index))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CANNOT_RETURN_NULL
+static FLOATVAL* numval_param_from_op(PARROT_INTERP,
+    ARGIN(opcode_t *raw_params),
+    INTVAL param_index)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CAN_RETURN_NULL
+static void parse_signature_string(PARROT_INTERP,
+    ARGIN(const char *signature),
+    ARGMOD(PMC **arg_flags),
+    ARGMOD(PMC **return_flags))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4)
+        FUNC_MODIFIES(*arg_flags)
+        FUNC_MODIFIES(*return_flags);
+
+PARROT_CANNOT_RETURN_NULL
+static PMC* pmc_arg_from_c_args(PARROT_INTERP,
+    ARGIN(va_list *args),
+    SHIM(INTVAL param_index))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CANNOT_RETURN_NULL
+static PMC* pmc_arg_from_continuation(PARROT_INTERP,
+    ARGIN(PMC *cs),
+    INTVAL arg_index)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CANNOT_RETURN_NULL
+static PMC* pmc_arg_from_op(PARROT_INTERP,
+    ARGIN(opcode_t *raw_args),
+    INTVAL arg_index)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CAN_RETURN_NULL
+static PMC* pmc_constant_from_op(PARROT_INTERP,
+    ARGIN(opcode_t *raw_params),
+    INTVAL param_index)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CAN_RETURN_NULL
+static PMC* pmc_constant_from_varargs(PARROT_INTERP,
+    ARGIN(void *data),
+    INTVAL index)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CANNOT_RETURN_NULL
+static PMC** pmc_param_from_c_args(PARROT_INTERP,
+    ARGIN(va_list *args),
+    SHIM(INTVAL param_index))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CANNOT_RETURN_NULL
+static PMC** pmc_param_from_op(PARROT_INTERP,
+    ARGIN(opcode_t *raw_params),
+    INTVAL param_index)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CANNOT_RETURN_NULL
+static STRING* string_arg_from_c_args(PARROT_INTERP,
+    ARGIN(va_list *args),
+    SHIM(INTVAL param_index))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CANNOT_RETURN_NULL
+static STRING* string_arg_from_continuation(PARROT_INTERP,
+    ARGIN(PMC *cs),
+    INTVAL arg_index)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CANNOT_RETURN_NULL
+static STRING* string_arg_from_op(PARROT_INTERP,
+    ARGIN(opcode_t *raw_args),
+    INTVAL arg_index)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CAN_RETURN_NULL
+static STRING* string_constant_from_op(PARROT_INTERP,
+    ARGIN(opcode_t *raw_params),
+    INTVAL param_index)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CAN_RETURN_NULL
+static STRING* string_constant_from_varargs(PARROT_INTERP,
+    ARGIN(void *data),
+    INTVAL index)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CANNOT_RETURN_NULL
+static STRING** string_param_from_c_args(PARROT_INTERP,
+    ARGIN(va_list *args),
+    SHIM(INTVAL param_index))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_CANNOT_RETURN_NULL
+static STRING** string_param_from_op(PARROT_INTERP,
+    ARGIN(opcode_t *raw_params),
+    INTVAL param_index)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+#define ASSERT_ARGS_assign_default_param_value __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(arg_info) \
+    , PARROT_ASSERT_ARG(accessor))
+#define ASSERT_ARGS_assign_default_result_value __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(results))
+#define ASSERT_ARGS_clone_key_arg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(key))
+#define ASSERT_ARGS_csr_fill_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_csr_fill_number __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_csr_fill_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_csr_fill_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_csr_get_pointer_keyed_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_csr_get_string_keyed_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_csr_push_pointer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_csr_reallocate_return_values __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_csr_returns_count __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_dissect_aggregate_arg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(call_object) \
+    , PARROT_ASSERT_ARG(aggregate))
+#define ASSERT_ARGS_extract_named_arg_from_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(call_object) \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(raw_sig) \
+    , PARROT_ASSERT_ARG(raw_args))
+#define ASSERT_ARGS_fill_params __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(raw_sig) \
+    , PARROT_ASSERT_ARG(arg_info) \
+    , PARROT_ASSERT_ARG(accessor))
+#define ASSERT_ARGS_fill_results __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(raw_sig) \
+    , PARROT_ASSERT_ARG(return_info) \
+    , PARROT_ASSERT_ARG(accessor))
+#define ASSERT_ARGS_intval_arg_from_c_args __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(args))
+#define ASSERT_ARGS_intval_arg_from_continuation __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(cs))
+#define ASSERT_ARGS_intval_arg_from_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(raw_args))
+#define ASSERT_ARGS_intval_constant_from_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(raw_params))
+#define ASSERT_ARGS_intval_constant_from_varargs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(data))
+#define ASSERT_ARGS_intval_param_from_c_args __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(args))
+#define ASSERT_ARGS_intval_param_from_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(raw_params))
+#define ASSERT_ARGS_numval_arg_from_c_args __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(args))
+#define ASSERT_ARGS_numval_arg_from_continuation __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(cs))
+#define ASSERT_ARGS_numval_arg_from_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(raw_args))
+#define ASSERT_ARGS_numval_constant_from_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(raw_params))
+#define ASSERT_ARGS_numval_constant_from_varargs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(data))
+#define ASSERT_ARGS_numval_param_from_c_args __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(args))
+#define ASSERT_ARGS_numval_param_from_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(raw_params))
+#define ASSERT_ARGS_parse_signature_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(signature) \
+    , PARROT_ASSERT_ARG(arg_flags) \
+    , PARROT_ASSERT_ARG(return_flags))
+#define ASSERT_ARGS_pmc_arg_from_c_args __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(args))
+#define ASSERT_ARGS_pmc_arg_from_continuation __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(cs))
+#define ASSERT_ARGS_pmc_arg_from_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(raw_args))
+#define ASSERT_ARGS_pmc_constant_from_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(raw_params))
+#define ASSERT_ARGS_pmc_constant_from_varargs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(data))
+#define ASSERT_ARGS_pmc_param_from_c_args __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(args))
+#define ASSERT_ARGS_pmc_param_from_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(raw_params))
+#define ASSERT_ARGS_string_arg_from_c_args __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(args))
+#define ASSERT_ARGS_string_arg_from_continuation __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(cs))
+#define ASSERT_ARGS_string_arg_from_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(raw_args))
+#define ASSERT_ARGS_string_constant_from_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(raw_params))
+#define ASSERT_ARGS_string_constant_from_varargs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(data))
+#define ASSERT_ARGS_string_param_from_c_args __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(args))
+#define ASSERT_ARGS_string_param_from_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(raw_params))
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+/* HEADERIZER END: static */
+
+/*
+
+=item C<PMC* Parrot_pcc_build_sig_object_from_op(PARROT_INTERP, PMC *signature,
+PMC * const raw_sig, opcode_t * const raw_args)>
+
+Take a raw signature and argument list from a set_args opcode and
+convert it to a CallContext PMC.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+PMC*
+Parrot_pcc_build_sig_object_from_op(PARROT_INTERP, ARGIN_NULLOK(PMC *signature),
+        ARGIN(PMC * const raw_sig), ARGIN(opcode_t * const raw_args))
+{
+    ASSERT_ARGS(Parrot_pcc_build_sig_object_from_op)
+    PMC            *call_object;
+    PMC            *ctx        = CURRENT_CONTEXT(interp);
+    INTVAL         *int_array;
+    INTVAL          arg_count;
+    INTVAL          arg_index;
+
+    if (PMC_IS_NULL(signature))
+        call_object = pmc_new(interp, enum_class_CallContext);
+    else
+        call_object = signature;
+
+    /* this macro is much, much faster than the VTABLE STRING comparisons */
+    SETATTR_CallContext_arg_flags(interp, call_object, raw_sig);
+    GETATTR_FixedIntegerArray_size(interp, raw_sig, arg_count);
+    GETATTR_FixedIntegerArray_int_array(interp, raw_sig, int_array);
+
+    for (arg_index = 0; arg_index < arg_count; arg_index++) {
+        INTVAL arg_flags = int_array[arg_index];
+
+        const INTVAL constant  = PARROT_ARG_CONSTANT_ISSET(arg_flags);
+        const INTVAL raw_index = raw_args[arg_index + 2];
+
+        switch (PARROT_ARG_TYPE_MASK_MASK(arg_flags)) {
+          case PARROT_ARG_INTVAL:
+            if (constant)
+                VTABLE_push_integer(interp, call_object, raw_index);
+            else {
+                const INTVAL int_value = CTX_REG_INT(ctx, raw_index);
+                VTABLE_push_integer(interp, call_object, int_value);
+            }
+            break;
+          case PARROT_ARG_FLOATVAL:
+            if (constant)
+                VTABLE_push_float(interp, call_object,
+                            Parrot_pcc_get_num_constant(interp, ctx, raw_index));
+            else {
+                const FLOATVAL float_value = CTX_REG_NUM(ctx, raw_index);
+                VTABLE_push_float(interp, call_object, float_value);
+            }
+            break;
+          case PARROT_ARG_STRING:
+            {
+                STRING *string_value;
+                if (constant)
+                    /* ensure that callees don't modify constant caller strings */
+                    string_value = Parrot_str_new_COW(interp,
+                            Parrot_pcc_get_string_constant(interp, ctx, raw_index));
+                else
+                    string_value = CTX_REG_STR(ctx, raw_index);
+
+                if (arg_flags & PARROT_ARG_NAME) {
+                    arg_index++;
+                    if (!PMC_IS_NULL(call_object)
+                         && VTABLE_exists_keyed_str(interp, call_object, string_value)) {
+                        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                                "duplicate named argument in call");
+
+                    }
+                    extract_named_arg_from_op(interp, call_object, string_value,
+                            raw_sig, raw_args, arg_index);
+                }
+                else
+                    VTABLE_push_string(interp, call_object, string_value);
+
+                break;
+            }
+          case PARROT_ARG_PMC:
+            {
+                PMC *pmc_value;
+                if (constant)
+                    pmc_value = Parrot_pcc_get_pmc_constant(interp, ctx, raw_index);
+                else
+                    pmc_value = CTX_REG_PMC(ctx, raw_index);
+
+                if (arg_flags & PARROT_ARG_FLATTEN) {
+                    dissect_aggregate_arg(interp, call_object, pmc_value);
+                }
+                else {
+                    VTABLE_push_pmc(interp, call_object, clone_key_arg(interp, pmc_value));
+                }
+
+                break;
+            }
+          default:
+            break;
+        }
+
+    }
+
+    return call_object;
+}
+
+/*
+
+=item C<static void extract_named_arg_from_op(PARROT_INTERP, PMC *call_object,
+STRING *name, PMC * const raw_sig, opcode_t * const raw_args, INTVAL arg_index)>
+
+Pulls in the next argument from a set_args opcode, and sets it as the
+value of a named argument in the CallContext PMC.
+
+=cut
+
+*/
+
+static void
+extract_named_arg_from_op(PARROT_INTERP, ARGMOD(PMC *call_object), ARGIN(STRING *name),
+        ARGIN(PMC * const raw_sig), ARGIN(opcode_t * const raw_args),
+        INTVAL arg_index)
+{
+    ASSERT_ARGS(extract_named_arg_from_op)
+    PMC   *ctx       = CURRENT_CONTEXT(interp);
+    INTVAL arg_flags = VTABLE_get_integer_keyed_int(interp,
+                    raw_sig, arg_index);
+
+    const INTVAL constant  = PARROT_ARG_CONSTANT_ISSET(arg_flags);
+    const INTVAL raw_index = raw_args[arg_index + 2];
+
+    switch (PARROT_ARG_TYPE_MASK_MASK(arg_flags)) {
+      case PARROT_ARG_INTVAL:
+        if (constant)
+            VTABLE_set_integer_keyed_str(interp, call_object, name, raw_index);
+        else
+            VTABLE_set_integer_keyed_str(interp, call_object, name,
+                        CTX_REG_INT(ctx, raw_index));
+        break;
+      case PARROT_ARG_FLOATVAL:
+        if (constant)
+            VTABLE_set_number_keyed_str(interp, call_object, name,
+                        Parrot_pcc_get_num_constant(interp, ctx, raw_index));
+        else
+            VTABLE_set_number_keyed_str(interp, call_object, name,
+                        CTX_REG_NUM(ctx, raw_index));
+        break;
+      case PARROT_ARG_STRING:
+        if (constant)
+            /* ensure that callees don't modify constant caller strings */
+            VTABLE_set_string_keyed_str(interp, call_object, name,
+                        Parrot_str_new_COW(interp,
+                                Parrot_pcc_get_string_constant(interp, ctx, raw_index)));
+        else
+            VTABLE_set_string_keyed_str(interp, call_object, name,
+                        CTX_REG_STR(ctx, raw_index));
+        break;
+      case PARROT_ARG_PMC:
+        if (constant)
+            VTABLE_set_pmc_keyed_str(interp, call_object, name,
+                        Parrot_pcc_get_pmc_constant(interp, ctx, raw_index));
+        else
+                VTABLE_set_pmc_keyed_str(interp, call_object, name,
+                        CTX_REG_PMC(ctx, raw_index));
+        break;
+      default:
+        break;
+    }
+}
+
+/*
+
+=item C<static void dissect_aggregate_arg(PARROT_INTERP, PMC *call_object, PMC
+*aggregate)>
+
+Takes an aggregate PMC and splits it up into individual arguments,
+adding each one to the CallContext PMC. If the aggregate is an array,
+its elements are added as positional arguments. If the aggregate is a
+hash, its key/value pairs are added as named arguments.
+
+=cut
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+static void
+dissect_aggregate_arg(PARROT_INTERP, ARGMOD(PMC *call_object), ARGIN(PMC *aggregate))
+{
+    ASSERT_ARGS(dissect_aggregate_arg)
+    if (VTABLE_does(interp, aggregate, CONST_STRING(interp, "array"))) {
+        INTVAL elements = VTABLE_elements(interp, aggregate);
+        INTVAL index;
+        for (index = 0; index < elements; index++) {
+            VTABLE_push_pmc(interp, call_object,
+                    VTABLE_get_pmc_keyed_int(interp, aggregate, index));
+        }
+    }
+    else if (VTABLE_does(interp, aggregate, CONST_STRING(interp, "hash"))) {
+        INTVAL elements = VTABLE_elements(interp, aggregate);
+        INTVAL index;
+        PMC *key = pmc_new(interp, enum_class_Key);
+        VTABLE_set_integer_native(interp, key, 0);
+        SETATTR_Key_next_key(interp, key, (PMC *)INITBucketIndex);
+
+        /* Low-level hash iteration. */
+        for (index = 0; index < elements; index++) {
+            if (!PMC_IS_NULL(key)) {
+                STRING *name = (STRING *)parrot_hash_get_idx(interp,
+                                (Hash *)VTABLE_get_pointer(interp, aggregate), key);
+                PARROT_ASSERT(name);
+                VTABLE_set_pmc_keyed_str(interp, call_object, name,
+                    VTABLE_get_pmc_keyed_str(interp, aggregate, name));
+            }
+        }
+    }
+    else {
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                "flattened parameters must be a hash or array");
+    }
+}
+
+/*
+
+=item C<PMC* Parrot_pcc_build_sig_object_returns_from_op(PARROT_INTERP, PMC
+*signature, PMC *raw_sig, opcode_t *raw_args)>
+
+Take a raw signature and argument list from a set_results opcode and
+convert it to a CallContext PMC. Uses an existing CallContext PMC if
+one was already created for set_args. Otherwise, creates a new one.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_WARN_UNUSED_RESULT
+PARROT_CAN_RETURN_NULL
+PMC*
+Parrot_pcc_build_sig_object_returns_from_op(PARROT_INTERP, ARGIN_NULLOK(PMC *signature),
+        ARGIN(PMC *raw_sig), ARGIN(opcode_t *raw_args))
+{
+    ASSERT_ARGS(Parrot_pcc_build_sig_object_returns_from_op)
+    PMC            *call_object;
+    INTVAL         *int_array;
+    PMC            *ctx         = CURRENT_CONTEXT(interp);
+    INTVAL          returns_pos = 0;
+    INTVAL          arg_index;
+    INTVAL          arg_count;
+
+    if (PMC_IS_NULL(signature))
+        call_object = pmc_new(interp, enum_class_CallContext);
+    /* A hack to support 'get_results' as the way of fetching the
+     * exception object inside an exception handler. The first argument
+     * in the call object is the exception, stick it directly into the
+     * destination register. */
+    else if (CALLSIGNATURE_is_exception_TEST(signature)) {
+        const INTVAL raw_index = raw_args[2];
+        CTX_REG_PMC(ctx, raw_index) =
+                VTABLE_get_pmc_keyed_int(interp, signature, 0);
+        return NULL;
+    }
+    else
+        call_object = signature;
+
+    /* a little encapsulation violation for great speed */
+    SETATTR_CallContext_return_flags(interp, call_object, raw_sig);
+
+    GETATTR_FixedIntegerArray_size(interp, raw_sig, arg_count);
+    GETATTR_FixedIntegerArray_int_array(interp, raw_sig, int_array);
+
+    for (arg_index = 0; arg_index < arg_count; arg_index++) {
+        STRING * const signature = CONST_STRING(interp, "signature");
+        const INTVAL arg_flags = int_array[arg_index];
+        const INTVAL raw_index = raw_args[arg_index + 2];
+
+        /* Returns store a pointer to the register, so they can pass
+         * the result back to the caller. */
+        switch (PARROT_ARG_TYPE_MASK_MASK(arg_flags)) {
+          case PARROT_ARG_INTVAL:
+            csr_push_pointer(interp, call_object, &(CTX_REG_INT(ctx, raw_index)),
+                        PARROT_ARG_INTVAL);
+            break;
+          case PARROT_ARG_FLOATVAL:
+            csr_push_pointer(interp, call_object, &(CTX_REG_NUM(ctx, raw_index)),
+                        PARROT_ARG_FLOATVAL);
+            break;
+          case PARROT_ARG_STRING:
+            if (arg_flags & PARROT_ARG_NAME) {
+                STRING * string_val = arg_flags & PARROT_ARG_CONSTANT
+                                    ? Parrot_pcc_get_string_constant(interp, ctx, raw_index)
+                                    : CTX_REG_STR(ctx, raw_index);
+                csr_push_pointer(interp, call_object, string_val, PARROT_ARG_STRING);
+            }
+            else {
+                csr_push_pointer(interp, call_object,
+                            &(CTX_REG_STR(ctx, raw_index)), PARROT_ARG_STRING);
+            }
+            break;
+          case PARROT_ARG_PMC:
+            csr_push_pointer(interp, call_object, &(CTX_REG_PMC(ctx, raw_index)),
+                        PARROT_ARG_PMC);
+            break;
+          default:
+            break;
+        }
+
+    }
+
+    return call_object;
+}
+
+/*
+
+=item C<PMC* Parrot_pcc_build_sig_object_from_varargs(PARROT_INTERP, PMC *obj,
+const char *sig, va_list args)>
+
+Converts a varargs list into a CallContext PMC. The CallContext stores the
+original short signature string and an array of integer types to pass on to the
+multiple dispatch search.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+PMC*
+Parrot_pcc_build_sig_object_from_varargs(PARROT_INTERP, ARGIN_NULLOK(PMC *obj),
+        ARGIN(const char *sig), va_list args)
+{
+    ASSERT_ARGS(Parrot_pcc_build_sig_object_from_varargs)
+    PMC         *type_tuple         = PMCNULL;
+    PMC         *arg_flags     = PMCNULL;
+    PMC         *return_flags  = PMCNULL;
+    PMC         * const call_object = pmc_new(interp, enum_class_CallContext);
+    const INTVAL sig_len            = strlen(sig);
+    INTVAL       in_return_sig      = 0;
+    INTVAL       i;
+    int          append_pi          = 1;
+
+    if (!sig_len)
+        return call_object;
+
+    parse_signature_string(interp, sig, &arg_flags, &return_flags);
+    VTABLE_set_attr_str(interp, call_object, CONST_STRING(interp, "arg_flags"), arg_flags);
+    VTABLE_set_attr_str(interp, call_object, CONST_STRING(interp, "return_flags"), return_flags);
+
+    /* Process the varargs list */
+    for (i = 0; i < sig_len; ++i) {
+        const INTVAL type = sig[i];
+
+        if (in_return_sig) {
+            STRING * const signature = CONST_STRING(interp, "signature");
+            /* Returns store the original passed-in pointer so they can pass
+             * the result back to the caller. */
+            switch (type) {
+              case 'I':
+                csr_push_pointer(interp, call_object,
+                            (void *)va_arg(args, INTVAL *), PARROT_ARG_INTVAL);
+                break;
+              case 'N':
+                csr_push_pointer(interp, call_object,
+                            (void *)va_arg(args, FLOATVAL *), PARROT_ARG_FLOATVAL);
+                break;
+              case 'S':
+                csr_push_pointer(interp, call_object,
+                            (void *)va_arg(args, STRING **), PARROT_ARG_STRING);
+                break;
+              case 'P':
+                csr_push_pointer(interp, call_object,
+                            (void *)va_arg(args, PMC **), PARROT_ARG_PMC);
+                break;
+              default:
+                Parrot_ex_throw_from_c_args(interp, NULL,
+                        EXCEPTION_INVALID_OPERATION,
+                        "Dispatch: invalid argument type %c!", type);
+             }
+        }
+        else {
+            /* Regular arguments just set the value */
+            switch (type) {
+              case 'I':
+                VTABLE_push_integer(interp, call_object, va_arg(args, INTVAL));
+                break;
+              case 'N':
+                VTABLE_push_float(interp, call_object, va_arg(args, FLOATVAL));
+                break;
+              case 'S':
+                VTABLE_push_string(interp, call_object, va_arg(args, STRING *));
+                break;
+              case 'P':
+                {
+                    INTVAL type_lookahead = sig[i+1];
+                    PMC * const pmc_arg = va_arg(args, PMC *);
+                    if (type_lookahead == 'f') {
+                         dissect_aggregate_arg(interp, call_object, pmc_arg);
+                        i++; /* skip 'f' */
+                    }
+                    else {
+                        VTABLE_push_pmc(interp, call_object, clone_key_arg(interp, pmc_arg));
+                        if (type_lookahead == 'i') {
+                            if (i != 0)
+                                Parrot_ex_throw_from_c_args(interp, NULL,
+                                    EXCEPTION_INVALID_OPERATION,
+                                    "Dispatch: only the first argument can be an invocant");
+                            i++; /* skip 'i' */
+                            append_pi = 0; /* Don't append Pi in front of signature */
+                        }
+                    }
+                    break;
+                }
+              case '-':
+                i++; /* skip '>' */
+                in_return_sig = 1;
+                break;
+              default:
+                Parrot_ex_throw_from_c_args(interp, NULL,
+                        EXCEPTION_INVALID_OPERATION,
+                        "Dispatch: invalid argument type %c!", type);
+            }
+        }
+    }
+
+    /* Check if we have an invocant, and add it to the front of the arguments iff needed */
+    if (!PMC_IS_NULL(obj) && append_pi) {
+        VTABLE_unshift_pmc(interp, call_object, obj);
+    }
+
+    return call_object;
+}
+
+/*
+
+=item C<static void fill_params(PARROT_INTERP, PMC *call_object, PMC *raw_sig,
+void *arg_info, struct pcc_set_funcs *accessor)>
+
+Gets args for the current function call and puts them into position.
+First it gets the positional non-slurpy parameters, then the positional
+slurpy parameters, then the named parameters, and finally the named
+slurpy parameters.
+
+=cut
+
+*/
+
+static void
+fill_params(PARROT_INTERP, ARGMOD_NULLOK(PMC *call_object),
+        ARGIN(PMC *raw_sig), ARGIN(void *arg_info), ARGIN(struct pcc_set_funcs *accessor))
+{
+    ASSERT_ARGS(fill_params)
+    PMC    *named_used_list = PMCNULL;
+    INTVAL *raw_params;
+    INTVAL  param_count     = VTABLE_elements(interp, raw_sig);
+    INTVAL  param_index     = 0;
+    INTVAL  arg_index       = 0;
+    INTVAL  named_count     = 0;
+    INTVAL  err_check       = 0;
+    INTVAL  positional_args;
+
+    /* Check if we should be throwing errors. This is configured separately
+     * for parameters and return values. */
+    if (PARROT_ERRORS_test(interp, PARROT_ERRORS_PARAM_COUNT_FLAG))
+        err_check = 1;
+
+    /* A null call object is fine if there are no arguments and no returns. */
+    if (PMC_IS_NULL(call_object)) {
+        if (param_count > 0 && err_check)
+            Parrot_ex_throw_from_c_args(interp, NULL,
+                EXCEPTION_INVALID_OPERATION,
+                "too few arguments: 0 passed, %d expected", param_count);
+
+        return;
+    }
+
+    GETATTR_FixedIntegerArray_int_array(interp, raw_sig, raw_params);
+
+    /* EXPERIMENTAL! This block adds provisional :call_sig param support on the
+       callee side only. Does not add :call_sig arg support on the caller side.
+       This is not the final form of the algorithm, but should provide the
+       tools that HLL designers need in the interim. */
+    if (param_count == 1) {
+        const INTVAL first_flag = raw_params[0];
+
+        if (first_flag & PARROT_ARG_CALL_SIG) {
+            *accessor->pmc(interp, arg_info, 0) = call_object;
+            return;
+        }
+    }
+    else if (param_count == 2) {
+        const INTVAL second_flag = raw_params[1];
+        if (second_flag & PARROT_ARG_CALL_SIG)
+            *accessor->pmc(interp, arg_info, 1) = call_object;
+    }
+
+    /* First iterate over positional args and positional parameters. */
+    arg_index = 0;
+    param_index = 0;
+    positional_args = VTABLE_elements(interp, call_object);
+    while (1) {
+        INTVAL param_flags;
+
+        /* Check if we've used up all the parameters. */
+        if (param_index >= param_count) {
+            if (arg_index >= positional_args) {
+                /* We've used up all the arguments and parameters, we're done. */
+                break;
+            }
+            else if (err_check) {
+                /* We've used up all the parameters, but have extra positional
+                 * args left over. */
+                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                        "too many positional arguments: %d passed, %d expected",
+                        positional_args, param_index);
+            }
+            return;
+        }
+
+        param_flags = raw_params[param_index];
+
+        /* If it's a call_sig, we're done. */
+        if (param_flags & PARROT_ARG_CALL_SIG)
+            return;
+
+        /* If the parameter is slurpy, collect all remaining positional
+         * arguments into an array.*/
+        if (param_flags & PARROT_ARG_SLURPY_ARRAY) {
+            PMC *collect_positional;
+
+            /* Can't handle named slurpy here, go on to named argument handling. */
+            if (param_flags & PARROT_ARG_NAME)
+                break;
+
+            if (named_count > 0)
+                Parrot_ex_throw_from_c_args(interp, NULL,
+                        EXCEPTION_INVALID_OPERATION,
+                        "named parameters must follow all positional parameters");
+
+            collect_positional = pmc_new(interp,
+                    Parrot_get_ctx_HLL_type(interp, enum_class_ResizablePMCArray));
+            for (; arg_index < positional_args; arg_index++) {
+                VTABLE_push_pmc(interp, collect_positional,
+                        VTABLE_get_pmc_keyed_int(interp, call_object, arg_index));
+            }
+            *accessor->pmc(interp, arg_info, param_index) = collect_positional;
+            param_index++;
+            break; /* Terminate the positional arg loop. */
+        }
+
+        /* We have a positional argument, fill the parameter with it. */
+        if (arg_index < positional_args) {
+
+            /* Fill a named parameter with a positional argument. */
+            if (param_flags & PARROT_ARG_NAME) {
+                STRING *param_name;
+                if (!(param_flags & PARROT_ARG_STRING))
+                    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                            "named parameters must have a name specified");
+                param_name = PARROT_ARG_CONSTANT_ISSET(param_flags)
+                                   ? accessor->string_constant(interp, arg_info, param_index)
+                                   : *accessor->string(interp, arg_info, param_index);
+                named_count++;
+                param_index++;
+                if (param_index >= param_count)
+                    continue;
+
+                param_flags = raw_params[param_index];
+
+                /* Mark the name as used, cannot be filled again. */
+                if (PMC_IS_NULL(named_used_list)) /* Only created if needed. */
+                    named_used_list = pmc_new(interp, enum_class_Hash);
+
+                VTABLE_set_integer_keyed_str(interp, named_used_list, param_name, 1);
+            }
+            else if (named_count > 0) {
+                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                        "named parameters must follow all positional parameters");
+            }
+
+            /* Check for :lookahead parameter goes here. */
+
+            /* Go ahead and fill the parameter with a positional argument. */
+            switch (PARROT_ARG_TYPE_MASK_MASK(param_flags)) {
+              case PARROT_ARG_INTVAL:
+                *accessor->intval(interp, arg_info, param_index) =
+                            VTABLE_get_integer_keyed_int(interp, call_object, arg_index);
+                break;
+              case PARROT_ARG_FLOATVAL:
+                *accessor->numval(interp, arg_info, param_index) =
+                            VTABLE_get_number_keyed_int(interp, call_object, arg_index);
+                break;
+              case PARROT_ARG_STRING:
+                *accessor->string(interp, arg_info, param_index) =
+                            VTABLE_get_string_keyed_int(interp, call_object, arg_index);
+                break;
+              case PARROT_ARG_PMC:
+                *accessor->pmc(interp, arg_info, param_index) =
+                            VTABLE_get_pmc_keyed_int(interp, call_object, arg_index);
+                break;
+              default:
+                Parrot_ex_throw_from_c_args(interp, NULL,
+                            EXCEPTION_INVALID_OPERATION, "invalid parameter type");
+                break;
+            }
+
+            /* Mark the option flag for the filled parameter. */
+            if (param_flags & PARROT_ARG_OPTIONAL) {
+                INTVAL next_param_flags;
+
+                if (param_index + 1 < param_count) {
+                    next_param_flags = raw_params[param_index + 1];
+
+                    if (next_param_flags & PARROT_ARG_OPT_FLAG) {
+                        param_index++;
+                        *accessor->intval(interp, arg_info, param_index) = 1;
+                    }
+                }
+            }
+        }
+        /* We have no more positional arguments, fill the optional parameter
+         * with a default value. */
+        else if (param_flags & PARROT_ARG_OPTIONAL) {
+            INTVAL next_param_flags;
+
+            /* We don't handle optional named params here, handle them in the
+             * next loop. */
+            if (param_flags & PARROT_ARG_NAME)
+                break;
+
+            assign_default_param_value(interp, param_index, param_flags,
+                    arg_info, accessor);
+
+            /* Mark the option flag for the parameter to FALSE, it was filled
+             * with a default value. */
+            if (param_index + 1 < param_count) {
+                next_param_flags = raw_params[param_index + 1];
+
+                if (next_param_flags & PARROT_ARG_OPT_FLAG) {
+                    param_index++;
+                    *accessor->intval(interp, arg_info, param_index) = 0;
+                }
+            }
+        }
+        /* We don't have an argument for the parameter, and it's not optional,
+         * so it's an error. */
+        else {
+            /* We don't handle named params here, go to the next loop. */
+            if (param_flags & PARROT_ARG_NAME)
+                break;
+
+            if (err_check)
+                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                        "too few positional arguments: %d passed, %d (or more) expected",
+                        positional_args, param_index + 1);
+        }
+
+        /* Go on to next argument and parameter. */
+        arg_index++;
+        param_index++;
+    }
+
+    /* Now iterate over the named arguments and parameters. */
+    while (1) {
+        STRING *param_name    = NULL;
+        INTVAL param_flags;
+
+        /* Check if we've used up all the parameters. We'll check for leftover
+         * named args after the loop. */
+        if (param_index >= param_count)
+            break;
+
+        param_flags = raw_params[param_index];
+
+        /* All remaining parameters must be named. */
+        if (!(param_flags & PARROT_ARG_NAME)) {
+            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                    "named parameters must follow all positional parameters");
+        }
+
+        if (arg_index < positional_args) {
+            PMC *arg_sig;
+
+            GETATTR_CallContext_arg_flags(interp, call_object, arg_sig);
+
+            /* We've used up all the positional parameters, but have extra
+             * positional args left over. */
+            if (VTABLE_get_integer_keyed_int(interp, arg_sig, arg_index) & PARROT_ARG_NAME) {
+                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                        "named arguments must follow all positional arguments");
+            }
+            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                    "too many positional arguments: %d passed, %d expected",
+                    positional_args, param_index);
+        }
+
+        /* Collected ("slurpy") named parameter */
+        if (param_flags & PARROT_ARG_SLURPY_ARRAY) {
+            PMC * const collect_named = pmc_new(interp,
+                    Parrot_get_ctx_HLL_type(interp, enum_class_Hash));
+            PMC *named_arg_list = VTABLE_get_attr_str(interp, call_object, CONST_STRING(interp, "named"));
+            if (!PMC_IS_NULL(named_arg_list)) {
+                INTVAL named_arg_count = VTABLE_elements(interp, named_arg_list);
+                INTVAL named_arg_index;
+
+                /* Named argument iteration. */
+                for (named_arg_index = 0; named_arg_index < named_arg_count; named_arg_index++) {
+                    STRING *name = VTABLE_get_string_keyed_int(interp,
+                            named_arg_list, named_arg_index);
+
+                    if ((PMC_IS_NULL(named_used_list)) ||
+                            !VTABLE_exists_keyed_str(interp, named_used_list, name)) {
+                        VTABLE_set_pmc_keyed_str(interp, collect_named, name,
+                                VTABLE_get_pmc_keyed_str(interp, call_object, name));
+                        /* Mark the name as used, cannot be filled again. */
+                        if (PMC_IS_NULL(named_used_list)) /* Only created if needed. */
+                            named_used_list = pmc_new(interp, enum_class_Hash);
+                        VTABLE_set_integer_keyed_str(interp, named_used_list, name, 1);
+                        named_count++;
+                    }
+                }
+            }
+
+            *accessor->pmc(interp, arg_info, param_index) = collect_named;
+            break; /* End of named parameters. */
+        }
+
+        /* Store the name. */
+       if (!(param_flags & PARROT_ARG_STRING))
+            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                    "named parameters must have a name specified");
+        param_name = PARROT_ARG_CONSTANT_ISSET(param_flags)
+                               ? accessor->string_constant(interp, arg_info, param_index)
+                               : *accessor->string(interp, arg_info, param_index);
+
+        if (!STRING_IS_NULL(param_name)) {
+            /* The next parameter is the actual value. */
+            param_index++;
+            if (param_index >= param_count)
+                continue;
+
+            param_flags = raw_params[param_index];
+
+            if (VTABLE_exists_keyed_str(interp, call_object, param_name)) {
+
+                /* Mark the name as used, cannot be filled again. */
+                if (PMC_IS_NULL(named_used_list)) /* Only created if needed. */
+                    named_used_list = pmc_new(interp, enum_class_Hash);
+                VTABLE_set_integer_keyed_str(interp, named_used_list, param_name, 1);
+                named_count++;
+
+                /* Fill the named parameter. */
+                switch (PARROT_ARG_TYPE_MASK_MASK(param_flags)) {
+                  case PARROT_ARG_INTVAL:
+                    *accessor->intval(interp, arg_info, param_index) =
+                                VTABLE_get_integer_keyed_str(interp, call_object, param_name);
+                    break;
+                  case PARROT_ARG_FLOATVAL:
+                    *accessor->numval(interp, arg_info, param_index) =
+                                VTABLE_get_number_keyed_str(interp, call_object, param_name);
+                    break;
+                  case PARROT_ARG_STRING:
+                    *accessor->string(interp, arg_info, param_index) =
+                                VTABLE_get_string_keyed_str(interp, call_object, param_name);
+                    break;
+                  case PARROT_ARG_PMC:
+                    *accessor->pmc(interp, arg_info, param_index) =
+                                VTABLE_get_pmc_keyed_str(interp, call_object, param_name);
+                    break;
+                  default:
+                    Parrot_ex_throw_from_c_args(interp, NULL,
+                                EXCEPTION_INVALID_OPERATION, "invalid parameter type");
+                    break;
+                }
+
+                /* Mark the option flag for the filled parameter. */
+                if (param_flags & PARROT_ARG_OPTIONAL) {
+                    INTVAL next_param_flags;
+
+                    if (param_index + 1 < param_count) {
+                        next_param_flags = raw_params[param_index + 1];
+
+                        if (next_param_flags & PARROT_ARG_OPT_FLAG) {
+                            param_index++;
+                            *accessor->intval(interp, arg_info, param_index) = 1;
+                        }
+                    }
+                }
+            }
+            else if (param_flags & PARROT_ARG_OPTIONAL) {
+                INTVAL next_param_flags;
+
+                assign_default_param_value(interp, param_index, param_flags,
+                        arg_info, accessor);
+
+                /* Mark the option flag for the parameter to FALSE, it was filled
+                 * with a default value. */
+                if (param_index + 1 < param_count) {
+                    next_param_flags = raw_params[param_index + 1];
+
+                    if (next_param_flags & PARROT_ARG_OPT_FLAG) {
+                        param_index++;
+                        *accessor->intval(interp, arg_info, param_index) = 0;
+                    }
+                }
+            }
+            /* We don't have an argument for the parameter, and it's not optional,
+             * so it's an error. */
+            else {
+                if (err_check)
+                    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                            "too few named arguments: no argument for required parameter '%S'",
+                            param_name);
+            }
+        }
+
+        param_index++;
+    }
+
+    /* Double check that all named arguments were assigned to parameters. */
+    if (err_check) {
+        PMC  *named_arg_list;
+        Hash *h;
+        /* Early exit to avoid vtable call */
+        GETATTR_CallContext_hash(interp, call_object, h);
+        if (!h || !h->entries)
+            return;
+
+        named_arg_list = VTABLE_get_attr_str(interp, call_object, CONST_STRING(interp, "named"));
+        if (!PMC_IS_NULL(named_arg_list)) {
+            INTVAL named_arg_count = VTABLE_elements(interp, named_arg_list);
+            if (PMC_IS_NULL(named_used_list))
+                return;
+                /* The 'return' above is a temporary hack to duplicate an old bug,
+                 * and will be replaced by the exception below at the next
+                 * deprecation point, see TT #1103
+
+                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                        "too many named arguments: %d passed, 0 used",
+                        named_arg_count);
+                 */
+            if (named_arg_count > named_count) {
+                /* At this point we know we have named arguments that weren't
+                 * assigned to parameters. We're going to throw an exception
+                 * anyway, so spend a little extra effort to tell the user *which*
+                 * named argument is extra. */
+                INTVAL named_arg_index;
+
+                /* Named argument iteration. */
+                for (named_arg_index = 0; named_arg_index < named_arg_count; named_arg_index++) {
+                    STRING *name = VTABLE_get_string_keyed_int(interp,
+                            named_arg_list, named_arg_index);
+
+                    if (!VTABLE_exists_keyed_str(interp, named_used_list, name)) {
+                        Parrot_ex_throw_from_c_args(interp, NULL,
+                                EXCEPTION_INVALID_OPERATION,
+                                "too many named arguments: '%S' not used",
+                                name);
+                    }
+                }
+            }
+        }
+    }
+}
+
+/*
+
+=item C<static void assign_default_param_value(PARROT_INTERP, INTVAL
+param_index, INTVAL param_flags, void *arg_info, struct pcc_set_funcs
+*accessor)>
+
+Assign an appropriate default value to the parameter depending on its type
+
+=cut
+
+*/
+
+static void
+assign_default_param_value(PARROT_INTERP, INTVAL param_index, INTVAL param_flags,
+        ARGIN(void *arg_info), ARGIN(struct pcc_set_funcs *accessor))
+{
+    ASSERT_ARGS(assign_default_param_value)
+    switch (PARROT_ARG_TYPE_MASK_MASK(param_flags)) {
+      case PARROT_ARG_INTVAL:
+        *accessor->intval(interp, arg_info, param_index) = 0;
+        break;
+      case PARROT_ARG_FLOATVAL:
+        *accessor->numval(interp, arg_info, param_index) = 0.0;
+        break;
+      case PARROT_ARG_STRING:
+        *accessor->string(interp, arg_info, param_index) = NULL;
+        break;
+      case PARROT_ARG_PMC:
+        *accessor->pmc(interp, arg_info, param_index) = PMCNULL;
+        break;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL,
+                    EXCEPTION_INVALID_OPERATION, "invalid parameter type");
+        break;
+    }
+}
+
+/*
+
+=item C<static void assign_default_result_value(PARROT_INTERP, PMC *results,
+INTVAL index, INTVAL result_flags)>
+
+Assign an appropriate default value to the result depending on its type
+
+=cut
+
+*/
+
+static void
+assign_default_result_value(PARROT_INTERP, ARGMOD(PMC *results), INTVAL index, INTVAL result_flags)
+{
+    ASSERT_ARGS(assign_default_result_value)
+    switch (PARROT_ARG_TYPE_MASK_MASK(result_flags)) {
+      case PARROT_ARG_INTVAL:
+        csr_fill_integer(interp, results, index, 0);
+        break;
+      case PARROT_ARG_FLOATVAL:
+        csr_fill_number(interp, results, index, 0.0);
+        break;
+      case PARROT_ARG_STRING:
+        csr_fill_string(interp, results, index, NULL);
+        break;
+      case PARROT_ARG_PMC:
+        csr_fill_pmc(interp, results, index, PMCNULL);
+        break;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL,
+                    EXCEPTION_INVALID_OPERATION, "invalid parameter type");
+        break;
+    }
+}
+
+/*
+
+=item C<void Parrot_pcc_fill_params_from_op(PARROT_INTERP, PMC *call_object, PMC
+*raw_sig, opcode_t *raw_params)>
+
+Gets args for the current function call and puts them into position.
+First it gets the positional non-slurpy parameters, then the positional
+slurpy parameters, then the named parameters, and finally the named
+slurpy parameters.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_pcc_fill_params_from_op(PARROT_INTERP, ARGMOD_NULLOK(PMC *call_object),
+        ARGIN(PMC *raw_sig), ARGIN(opcode_t *raw_params))
+{
+    ASSERT_ARGS(Parrot_pcc_fill_params_from_op)
+
+    static pcc_set_funcs function_pointers = {
+        (intval_ptr_func_t)intval_param_from_op,
+        (numval_ptr_func_t)numval_param_from_op,
+        (string_ptr_func_t)string_param_from_op,
+        (pmc_ptr_func_t)pmc_param_from_op,
+
+        (intval_func_t)intval_constant_from_op,
+        (numval_func_t)numval_constant_from_op,
+        (string_func_t)string_constant_from_op,
+        (pmc_func_t)pmc_constant_from_op,
+    };
+
+    fill_params(interp, call_object, raw_sig, raw_params, &function_pointers);
+}
+
+/*
+
+=item C<void Parrot_pcc_fill_params_from_c_args(PARROT_INTERP, PMC *call_object,
+const char *signature, ...)>
+
+Gets args for the current function call and puts them into position.
+First it gets the positional non-slurpy parameters, then the positional
+slurpy parameters, then the named parameters, and finally the named
+slurpy parameters.
+
+The signature is a string in the format used for
+C<Parrot_pcc_invoke_from_sig_object>, but with no return arguments. The
+parameters are passed in as a list of references to the destination
+variables.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_pcc_fill_params_from_c_args(PARROT_INTERP, ARGMOD(PMC *call_object),
+        ARGIN(const char *signature), ...)
+{
+    ASSERT_ARGS(Parrot_pcc_fill_params_from_c_args)
+    va_list args;
+    PMC    *raw_sig  = PMCNULL;
+    PMC    *invalid_sig = PMCNULL;
+    static pcc_set_funcs function_pointers = {
+        (intval_ptr_func_t)intval_param_from_c_args,
+        (numval_ptr_func_t)numval_param_from_c_args,
+        (string_ptr_func_t)string_param_from_c_args,
+        (pmc_ptr_func_t)pmc_param_from_c_args,
+
+        (intval_func_t)intval_constant_from_varargs,
+        (numval_func_t)numval_constant_from_varargs,
+        (string_func_t)string_constant_from_varargs,
+        (pmc_func_t)pmc_constant_from_varargs,
+    };
+
+    parse_signature_string(interp, signature, &raw_sig, &invalid_sig);
+    if (!PMC_IS_NULL(invalid_sig))
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                "returns should not be included in the parameter list");
+
+    va_start(args, signature);
+    fill_params(interp, call_object, raw_sig, &args, &function_pointers);
+    va_end(args);
+}
+
+/*
+
+=item C<static void fill_results(PARROT_INTERP, PMC *call_object, PMC *raw_sig,
+void *return_info, struct pcc_get_funcs *accessor)>
+
+Gets return values for the current return and puts them into position.
+First it gets the positional non-slurpy returns, then the positional
+slurpy returns, then the named returns, and finally the named
+slurpy returns.
+
+=cut
+
+*/
+
+static void
+fill_results(PARROT_INTERP, ARGMOD_NULLOK(PMC *call_object),
+        ARGIN(PMC *raw_sig), ARGIN(void *return_info), ARGIN(struct pcc_get_funcs *accessor))
+{
+    ASSERT_ARGS(fill_results)
+    INTVAL *return_array;
+    INTVAL *result_array;
+    PMC    *result_sig         = NULL;
+    PMC    *ctx                = CURRENT_CONTEXT(interp);
+    PMC    *named_used_list    = PMCNULL;
+    PMC    *named_return_list  = PMCNULL;
+    INTVAL  return_index       = 0;
+    INTVAL  return_subindex    = 0;
+    INTVAL  result_index       = 0;
+    INTVAL  positional_index   = 0;
+    INTVAL  named_count        = 0;
+    INTVAL  err_check          = 0;
+    INTVAL  positional_returns = 0; /* initialized by a loop later */
+    INTVAL  i                  = 0; /* used by the initialization loop */
+    INTVAL  return_count;
+    INTVAL  result_count;
+
+    /* Check if we should be throwing errors. This is configured separately
+     * for parameters and return values. */
+    if (PARROT_ERRORS_test(interp, PARROT_ERRORS_RESULT_COUNT_FLAG))
+        err_check = 1;
+
+    GETATTR_FixedIntegerArray_size(interp, raw_sig, return_count);
+
+    /* A null call object is fine if there are no returns and no results. */
+    if (PMC_IS_NULL(call_object)) {
+        /* If the return_count is 0, then there are no return values waiting to
+         * fill the results, so no error. */
+        if (return_count > 0 && (err_check))
+            Parrot_ex_throw_from_c_args(interp, NULL,
+                EXCEPTION_INVALID_OPERATION,
+                "too few returns: 0 passed, %d expected", return_count);
+
+        return;
+    }
+
+    GETATTR_CallContext_return_flags(interp, call_object, result_sig);
+
+    result_count = csr_returns_count(interp, call_object);
+    PARROT_ASSERT((result_count == 0) || !PMC_IS_NULL(result_sig));
+
+    GETATTR_FixedIntegerArray_int_array(interp, raw_sig, return_array);
+    if (!PMC_IS_NULL(result_sig))
+        GETATTR_FixedIntegerArray_int_array(interp, result_sig, result_array);
+
+    /* the call obj doesn't have the returns as positionals.
+     * instead count number of returns before first named return */
+    for (i = 0; i < return_count; i++) {
+        INTVAL flags = return_array[i];
+        if (flags & PARROT_ARG_NAME)
+            break;
+
+        positional_returns++;
+    }
+
+    /*
+    Parrot_io_eprintf(interp,
+     "return_count: %d\nresult_count: %d\npositional_returns: %d\nraw_sig: %S\nresult_sig: %S\n",
+         return_count, result_count, positional_returns, VTABLE_get_repr(interp, raw_sig),
+         VTABLE_get_repr(interp, result_sig));
+    */
+
+    while (1) {
+        INTVAL result_flags;
+
+        /* Check if we've used up all the results. */
+        if (result_index >= result_count) {
+            if (return_index >= return_count) {
+                /* We've used up all returns and results, we're
+                 * done with the whole process. */
+                return;
+            }
+            else if (err_check) {
+                /* We've used up all the results, but have extra positional
+                 * returns left over. */
+                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                        "too many positional returns: %d passed, %d expected",
+                        return_index, result_count);
+            }
+            return;
+        }
+
+        result_flags = result_array[result_index];
+
+        /* If the result is slurpy, collect all remaining positional
+         * returns into an array.*/
+        if (result_flags & PARROT_ARG_SLURPY_ARRAY) {
+            PMC *collect_positional;
+
+            /* Can't handle named slurpy here, go on to named return handling. */
+            if (result_flags & PARROT_ARG_NAME)
+                break;
+
+            if (named_count > 0)
+                Parrot_ex_throw_from_c_args(interp, NULL,
+                        EXCEPTION_INVALID_OPERATION,
+                        "named results must follow all positional results");
+
+            collect_positional = pmc_new(interp,
+                    Parrot_get_ctx_HLL_type(interp, enum_class_ResizablePMCArray));
+
+            /* Iterate over all positional returns in the list. */
+            while (1) {
+                INTVAL constant;
+                INTVAL return_flags;
+                if (return_index >= return_count)
+                    break; /* no more returns */
+
+                return_flags = return_array[return_index];
+
+                if (return_flags & PARROT_ARG_NAME)
+                    break; /* stop at named returns */
+
+                constant = PARROT_ARG_CONSTANT_ISSET(return_flags);
+                switch (PARROT_ARG_TYPE_MASK_MASK(return_flags)) {
+                  case PARROT_ARG_INTVAL:
+                    VTABLE_push_integer(interp, collect_positional, constant?
+                                accessor->intval_constant(interp, return_info, return_index)
+                                :accessor->intval(interp, return_info, return_index));
+                    break;
+                  case PARROT_ARG_FLOATVAL:
+                    VTABLE_push_float(interp, collect_positional, constant?
+                                accessor->numval_constant(interp, return_info, return_index)
+                                :accessor->numval(interp, return_info, return_index));
+                    break;
+                  case PARROT_ARG_STRING:
+                    VTABLE_push_string(interp, collect_positional, constant?
+                                accessor->string_constant(interp, return_info, return_index)
+                                :accessor->string(interp, return_info, return_index));
+                    break;
+                  case PARROT_ARG_PMC:
+                    {
+                        PMC *return_item = (constant)
+                                         ? accessor->pmc_constant(interp, return_info, return_index)
+                                         : accessor->pmc(interp, return_info, return_index);
+                        if (return_flags & PARROT_ARG_FLATTEN) {
+                            INTVAL flat_pos;
+                            INTVAL flat_elems;
+                            if (!VTABLE_does(interp, return_item, CONST_STRING(interp, "array"))) {
+                                Parrot_ex_throw_from_c_args(interp, NULL,
+                                                            EXCEPTION_INVALID_OPERATION,
+                                                            "flattened return on a non-array");
+                            }
+                            flat_elems = VTABLE_elements(interp, return_item);
+                            for (flat_pos = 0; flat_pos < flat_elems; flat_pos++) {
+                                /* fetch an item out of the aggregate */
+                                VTABLE_push_pmc(interp, collect_positional,
+                                        VTABLE_get_pmc_keyed_int(interp, return_item, flat_pos));
+                            }
+                        }
+                        else
+                            VTABLE_push_pmc(interp, collect_positional, return_item);
+                        break;
+                    }
+                  default:
+                    Parrot_ex_throw_from_c_args(interp, NULL,
+                                EXCEPTION_INVALID_OPERATION, "invalid return type");
+                    break;
+                }
+                return_index++;
+            }
+            csr_fill_pmc(interp, call_object, result_index, collect_positional);
+            result_index++;
+            break; /* Terminate the positional return loop. */
+        }
+
+        /* We have a positional return, fill the result with it. */
+        if (return_index < positional_returns) {
+            INTVAL return_flags = return_array[return_index];
+            INTVAL constant     = PARROT_ARG_CONSTANT_ISSET(return_flags);
+
+            /* Fill a named result with a positional return. */
+            if (result_flags & PARROT_ARG_NAME) {
+                STRING *result_name;
+                if (!(result_flags & PARROT_ARG_STRING))
+                    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                            "named results must have a name specified 1683");
+                result_name = csr_get_string_keyed_int(interp, call_object, result_index);
+                named_count++;
+                result_index++;
+                if (result_index >= result_count)
+                    continue;
+                result_flags = result_array[result_index];
+
+                /* Mark the name as used, cannot be filled again. */
+                if (PMC_IS_NULL(named_used_list)) /* Only created if needed. */
+                    named_used_list = pmc_new(interp,
+                            Parrot_get_ctx_HLL_type(interp, enum_class_Hash));
+                VTABLE_set_integer_keyed_str(interp, named_used_list, result_name, 1);
+            }
+            else if (named_count > 0) {
+                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                        "named results must follow all positional results");
+            }
+
+            /* Check for :lookahead result goes here. */
+
+            /* Go ahead and fill the result with a positional return. */
+            switch (PARROT_ARG_TYPE_MASK_MASK(return_flags)) {
+              case PARROT_ARG_INTVAL:
+                if (constant)
+                    csr_fill_integer(interp, call_object, result_index,
+                            accessor->intval_constant(interp, return_info, return_index));
+                else
+                    csr_fill_integer(interp, call_object, result_index,
+                            accessor->intval(interp, return_info, return_index));
+                break;
+              case PARROT_ARG_FLOATVAL:
+                if (constant)
+                    csr_fill_number(interp, call_object, result_index,
+                            accessor->numval_constant(interp, return_info, return_index));
+                else
+                    csr_fill_number(interp, call_object, result_index,
+                            accessor->numval(interp, return_info, return_index));
+                break;
+              case PARROT_ARG_STRING:
+                if (constant)
+                    csr_fill_string(interp, call_object, result_index,
+                            accessor->string_constant(interp, return_info, return_index));
+                else
+                        csr_fill_string(interp, call_object, result_index,
+                            accessor->string(interp, return_info, return_index));
+                break;
+              case PARROT_ARG_PMC:
+                {
+                    PMC *return_item = (constant)
+                                     ? accessor->pmc_constant(interp, return_info, return_index)
+                                     : accessor->pmc(interp, return_info, return_index);
+                    if (return_flags & PARROT_ARG_FLATTEN) {
+                        INTVAL flat_elems;
+                        if (!VTABLE_does(interp, return_item, CONST_STRING(interp, "array"))) {
+                            Parrot_ex_throw_from_c_args(interp, NULL,
+                                                            EXCEPTION_INVALID_OPERATION,
+                                                            "flattened return on a non-array");
+                        }
+                        flat_elems = VTABLE_elements(interp, return_item);
+                        if (flat_elems == 0) {
+                            /* Skip empty aggregate */
+                            break;
+                        }
+                        if (return_subindex < flat_elems) {
+                            /* fetch an item out of the aggregate */
+                            return_item = VTABLE_get_pmc_keyed_int(interp, return_item,
+                                                                       return_subindex);
+                            return_subindex++;
+                        }
+                        if (return_subindex >= flat_elems) {
+                            return_subindex = 0; /* reset */
+                        }
+                        else {
+                            return_index--; /* we want to stay on the same item */
+                        }
+                    }
+                    csr_fill_pmc(interp, call_object, result_index, return_item);
+                    break;
+                }
+              default:
+                Parrot_ex_throw_from_c_args(interp, NULL,
+                            EXCEPTION_INVALID_OPERATION, "invalid return type");
+                break;
+            }
+
+            /* Mark the option flag for the filled result. */
+            if (result_flags & PARROT_ARG_OPTIONAL) {
+                INTVAL next_result_flags;
+
+                if (result_index + 1 < result_count) {
+                    next_result_flags = result_array[result_index + 1];
+                    if (next_result_flags & PARROT_ARG_OPT_FLAG) {
+                        result_index++;
+                        csr_fill_integer(interp, call_object, result_index, 1);
+                    }
+                }
+            }
+        }
+        /* We have no more positional returns, fill the optional result
+         * with a default value. */
+        else if (result_flags & PARROT_ARG_OPTIONAL) {
+            INTVAL next_result_flags;
+
+            /* We don't handle optional named results here, handle them in the
+             * next loop. */
+            if (result_flags & PARROT_ARG_NAME)
+                break;
+
+            assign_default_result_value(interp, call_object, result_index, result_flags);
+
+            /* Mark the option flag for the result to FALSE, it was filled
+             * with a default value. */
+            if (result_index + 1 < result_count) {
+                next_result_flags = result_array[result_index + 1];
+                if (next_result_flags & PARROT_ARG_OPT_FLAG) {
+                    result_index++;
+                    csr_fill_integer(interp, call_object, result_index, 0);
+                }
+            }
+        }
+        /* We don't have an return for the result, and it's not optional,
+         * so it's an error. */
+        else {
+            /* We don't handle named results here, go to the next loop. */
+            if (result_flags & PARROT_ARG_NAME)
+                break;
+
+            if (err_check)
+                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                        "too few positional returns: %d passed, %d (or more) expected",
+                        positional_returns, result_index + 1);
+        }
+
+        /* Go on to next return and result. */
+        return_index++;
+        result_index++;
+    }
+
+    for (; return_index < return_count; return_index++) {
+        STRING *return_name;
+        INTVAL  return_flags;
+        INTVAL  constant;
+
+        return_flags = return_array[return_index];
+
+        /* All remaining returns must be named. */
+        if (!(return_flags & PARROT_ARG_NAME))
+            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                    "named returns must follow all positional returns");
+
+        if (!(return_flags & PARROT_ARG_STRING))
+            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                    "named results must have a name specified 1836");
+
+        return_name = PARROT_ARG_CONSTANT_ISSET(return_flags)
+                           ? accessor->string_constant(interp, return_info, return_index)
+                           : accessor->string(interp, return_info, return_index);
+        named_count++;
+        return_index++;
+        if (result_index >= result_count)
+            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                    "named returns must have a value");
+
+        return_flags = return_array[return_index];
+
+        if (PMC_IS_NULL(named_return_list)) /* Only created if needed. */
+            named_return_list = pmc_new(interp,
+                    Parrot_get_ctx_HLL_type(interp, enum_class_Hash));
+
+        if (VTABLE_exists_keyed_str(interp, named_return_list, return_name))
+            continue;
+
+        constant = PARROT_ARG_CONSTANT_ISSET(return_flags);
+        switch (PARROT_ARG_TYPE_MASK_MASK(return_flags)) {
+          case PARROT_ARG_INTVAL:
+            VTABLE_set_integer_keyed_str(interp, named_return_list, return_name,
+                        constant
+                        ? accessor->intval_constant(interp, return_info, return_index)
+                        : accessor->intval(interp, return_info, return_index));
+            break;
+          case PARROT_ARG_FLOATVAL:
+            VTABLE_set_number_keyed_str(interp, named_return_list, return_name,
+                        constant
+                        ? accessor->numval_constant(interp, return_info, return_index)
+                        : accessor->numval(interp, return_info, return_index));
+            break;
+          case PARROT_ARG_STRING:
+            VTABLE_set_string_keyed_str(interp, named_return_list, return_name,
+                        constant
+                        ? accessor->string_constant(interp, return_info, return_index)
+                        : accessor->string(interp, return_info, return_index));
+            break;
+          case PARROT_ARG_PMC:
+            if (0) {
+                PMC *return_item = (constant)
+                                 ? accessor->pmc_constant(interp, return_info, return_index)
+                                 : accessor->pmc(interp, return_info, return_index);
+                if (return_flags & PARROT_ARG_FLATTEN) {
+                    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                                                "named flattened returns not yet implemented");
+                }
+                VTABLE_set_pmc_keyed_str(interp, named_return_list, return_name, return_item);
+                break;
+            }
+          default:
+            Parrot_ex_throw_from_c_args(interp, NULL,
+                        EXCEPTION_INVALID_OPERATION, "invalid return type");
+            break;
+        }
+    }
+
+    /* Now iterate over the named results, filling them from the
+     * temporary hash of named returns. */
+    while (1) {
+        STRING *result_name    = NULL;
+        INTVAL result_flags;
+
+        /* Check if we've used up all the results. We'll check for leftover
+         * named returns after the loop. */
+        if (result_index >= result_count)
+            break;
+
+        result_flags = result_array[result_index];
+
+        /* All remaining results must be named. */
+        if (!(result_flags & PARROT_ARG_NAME))
+            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                    "named results must follow all positional results");
+
+        /* Collected ("slurpy") named result */
+        if (result_flags & PARROT_ARG_SLURPY_ARRAY) {
+            if (PMC_IS_NULL(named_return_list))
+                named_return_list = pmc_new(interp,
+                        Parrot_get_ctx_HLL_type(interp, enum_class_Hash));
+
+            csr_fill_pmc(interp, call_object, result_index, named_return_list);
+            break; /* End of named results. */
+        }
+
+        /* Store the name. */
+        if (!(result_flags & PARROT_ARG_STRING))
+            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                    "named results must have a name specified 1926");
+        result_name = csr_get_string_keyed_int(interp, call_object, result_index);
+
+        if (!STRING_IS_NULL(result_name)) {
+            /* The next result is the actual value. */
+            result_index++;
+            if (result_index >= result_count)
+                continue;
+            result_flags = result_array[result_index];
+
+            if (VTABLE_exists_keyed_str(interp, named_return_list, result_name)) {
+
+                named_count++;
+
+                /* Fill the named result. */
+                switch (PARROT_ARG_TYPE_MASK_MASK(result_flags)) {
+                  case PARROT_ARG_INTVAL:
+                    csr_fill_integer(interp, call_object, result_index,
+                            VTABLE_get_integer_keyed_str(interp, named_return_list, result_name));
+                    break;
+                  case PARROT_ARG_FLOATVAL:
+                    csr_fill_number(interp, call_object, result_index,
+                            VTABLE_get_number_keyed_str(interp, named_return_list, result_name));
+                    break;
+                  case PARROT_ARG_STRING:
+                    csr_fill_string(interp, call_object, result_index,
+                            VTABLE_get_string_keyed_str(interp, named_return_list, result_name));
+                    break;
+                  case PARROT_ARG_PMC:
+                    csr_fill_pmc(interp, call_object, result_index,
+                            VTABLE_get_pmc_keyed_str(interp, named_return_list, result_name));
+                    break;
+                  default:
+                    Parrot_ex_throw_from_c_args(interp, NULL,
+                                EXCEPTION_INVALID_OPERATION, "invalid result type");
+                    break;
+                }
+                VTABLE_delete_keyed_str(interp, named_return_list, result_name);
+
+                /* Mark the option flag for the filled result. */
+                if (result_flags & PARROT_ARG_OPTIONAL) {
+                    INTVAL next_result_flags;
+
+                    if (result_index + 1 < result_count) {
+                        next_result_flags = return_array[result_index + 1];
+                        if (next_result_flags & PARROT_ARG_OPT_FLAG) {
+                            result_index++;
+                            csr_fill_integer(interp, call_object, result_index, 1);
+                        }
+                    }
+                }
+            }
+            else if (result_flags & PARROT_ARG_OPTIONAL) {
+                INTVAL next_result_flags;
+
+                assign_default_result_value(interp, call_object, result_index, result_flags);
+
+                /* Mark the option flag for the result to FALSE, it was filled
+                 * with a default value. */
+                if (result_index + 1 < result_count) {
+                    next_result_flags = result_array[result_index + 1];
+                    if (next_result_flags & PARROT_ARG_OPT_FLAG) {
+                        result_index++;
+                        csr_fill_integer(interp, call_object, result_index, 1);
+                    }
+                }
+            }
+            /* We don't have a return for the result, and it's not optional,
+             * so it's an error. */
+            else {
+                if (err_check)
+                    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                            "too few named returns: no return for required result '%S'",
+                            result_name);
+            }
+        }
+
+        result_index++;
+    }
+
+    /* Double check that all named returns were assigned to results. */
+    if (err_check) {
+        if (!PMC_IS_NULL(named_return_list)) {
+            INTVAL named_return_count = VTABLE_elements(interp, named_return_list);
+            if (named_return_count > 0)
+                    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                            "too many named returns: %d passed, %d used",
+                            named_return_count + named_count, named_count);
+        }
+    }
+
+}
+
+/*
+
+=item C<void Parrot_pcc_fill_returns_from_op(PARROT_INTERP, PMC *call_object,
+PMC *raw_sig, opcode_t *raw_returns)>
+
+Sets return values for the current function call. First it sets the
+positional returns, then the named returns.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_pcc_fill_returns_from_op(PARROT_INTERP, ARGMOD_NULLOK(PMC *call_object),
+        ARGIN(PMC *raw_sig), ARGIN(opcode_t *raw_returns))
+{
+    ASSERT_ARGS(Parrot_pcc_fill_returns_from_op)
+    INTVAL raw_return_count     = VTABLE_elements(interp, raw_sig);
+    INTVAL err_check      = 0;
+    static pcc_get_funcs function_pointers = {
+        (intval_func_t)intval_arg_from_op,
+        (numval_func_t)numval_arg_from_op,
+        (string_func_t)string_arg_from_op,
+        (pmc_func_t)pmc_arg_from_op,
+
+        (intval_func_t)intval_constant_from_op,
+        (numval_func_t)numval_constant_from_op,
+        (string_func_t)string_constant_from_op,
+        (pmc_func_t)pmc_constant_from_op,
+    };
+
+
+    /* Check if we should be throwing errors. This is configured separately
+     * for parameters and return values. */
+    if (PARROT_ERRORS_test(interp, PARROT_ERRORS_RESULT_COUNT_FLAG))
+            err_check = 1;
+
+    /* A null call object is fine if there are no arguments and no returns. */
+    if (PMC_IS_NULL(call_object)) {
+        if (raw_return_count > 0) {
+            if (err_check)
+                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                        "too many return values: %d passed, 0 expected",
+                        raw_return_count);
+        }
+        return;
+    }
+
+    fill_results(interp, call_object, raw_sig, raw_returns, &function_pointers);
+
+    return;
+}
+/*
+
+=item C<void Parrot_pcc_fill_returns_from_continuation(PARROT_INTERP, PMC
+*call_object, PMC *raw_sig, PMC *from_call_obj)>
+
+Evil function.  Fill results from arguments passed to a continuation.
+Only works for positional arguments.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_pcc_fill_returns_from_continuation(PARROT_INTERP, ARGMOD_NULLOK(PMC *call_object),
+        ARGIN(PMC *raw_sig), ARGIN(PMC *from_call_obj))
+{
+    ASSERT_ARGS(Parrot_pcc_fill_returns_from_continuation)
+    INTVAL raw_return_count     = VTABLE_elements(interp, raw_sig);
+    INTVAL err_check      = 0;
+    static pcc_get_funcs function_pointers = {
+        (intval_func_t)intval_arg_from_continuation,
+        (numval_func_t)numval_arg_from_continuation,
+        (string_func_t)string_arg_from_continuation,
+        (pmc_func_t)pmc_arg_from_continuation,
+
+        (intval_func_t)intval_arg_from_continuation,
+        (numval_func_t)numval_arg_from_continuation,
+        (string_func_t)string_arg_from_continuation,
+        (pmc_func_t)pmc_arg_from_continuation,
+    };
+
+
+    /* Check if we should be throwing errors. This is configured separately
+     * for parameters and return values. */
+    if (PARROT_ERRORS_test(interp, PARROT_ERRORS_RESULT_COUNT_FLAG))
+            err_check = 1;
+
+    /* A null call object is fine if there are no arguments and no returns. */
+    if (PMC_IS_NULL(call_object)) {
+        if (raw_return_count > 0) {
+            if (err_check)
+                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                        "too many return values: %d passed, 0 expected",
+                        raw_return_count);
+        }
+        return;
+    }
+
+    fill_results(interp, call_object, raw_sig, from_call_obj, &function_pointers);
+
+    return;
+}
+
+/*
+
+=item C<void Parrot_pcc_fill_returns_from_c_args(PARROT_INTERP, PMC
+*call_object, const char *signature, ...)>
+
+Sets return values for the current function call. First it sets the
+positional returns, then the named returns.
+
+The signature is a string in the format used for
+C<Parrot_pcc_invoke_from_sig_object>, but with only return arguments.
+The parameters are passed in as a list of INTVAL, FLOATVAL, STRING *, or
+PMC * variables.
+
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_pcc_fill_returns_from_c_args(PARROT_INTERP, ARGMOD_NULLOK(PMC *call_object),
+        ARGIN(const char *signature), ...)
+{
+    ASSERT_ARGS(Parrot_pcc_fill_returns_from_c_args)
+    va_list args;
+    INTVAL raw_return_count = 0;
+    INTVAL err_check        = 0;
+    PMC    *raw_sig         = PMCNULL;
+    PMC    *invalid_sig     = PMCNULL;
+
+    static pcc_get_funcs function_pointers = {
+        (intval_func_t)intval_arg_from_c_args,
+        (numval_func_t)numval_arg_from_c_args,
+        (string_func_t)string_arg_from_c_args,
+        (pmc_func_t)pmc_arg_from_c_args,
+
+        (intval_func_t)intval_constant_from_varargs,
+        (numval_func_t)numval_constant_from_varargs,
+        (string_func_t)string_constant_from_varargs,
+        (pmc_func_t)pmc_constant_from_varargs,
+    };
+
+    parse_signature_string(interp, signature, &raw_sig, &invalid_sig);
+    if (!PMC_IS_NULL(invalid_sig))
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                "parameters should not be included in the return signature");
+
+    raw_return_count = VTABLE_elements(interp, raw_sig);
+
+    /* Check if we should be throwing errors. This is configured separately
+     * for parameters and return values. */
+    if (PARROT_ERRORS_test(interp, PARROT_ERRORS_RESULT_COUNT_FLAG))
+            err_check = 1;
+
+    /* A null call object is fine if there are no arguments and no returns. */
+    if (PMC_IS_NULL(call_object)) {
+        if (raw_return_count > 0)
+            if (err_check)
+                Parrot_ex_throw_from_c_args(interp, NULL,
+                    EXCEPTION_INVALID_OPERATION,
+                    "too many return values: %d passed, 0 expected",
+                    raw_return_count);
+        return;
+    }
+
+    va_start(args, signature);
+    fill_results(interp, call_object, raw_sig, &args, &function_pointers);
+    va_end(args);
+}
+
+/*
+
+=item C<static void parse_signature_string(PARROT_INTERP, const char *signature,
+PMC **arg_flags, PMC **return_flags)>
+
+Parses a signature string and creates call and return signature integer
+arrays. The two integer arrays should be passed in as references to a
+PMC.
+
+=cut
+
+*/
+
+PARROT_CAN_RETURN_NULL
+static void
+parse_signature_string(PARROT_INTERP, ARGIN(const char *signature),
+        ARGMOD(PMC **arg_flags), ARGMOD(PMC **return_flags))
+{
+    ASSERT_ARGS(parse_signature_string)
+    PMC *current_array;
+    const char *x;
+    INTVAL flags = 0;
+    INTVAL set = 0;
+
+    if (PMC_IS_NULL(*arg_flags))
+        *arg_flags = pmc_new(interp, enum_class_ResizableIntegerArray);
+    current_array = *arg_flags;
+
+    for (x = signature; *x != '\0'; x++) {
+
+        /* detect -> separator */
+        if (*x == '-') {
+            /* skip '>' */
+            x++;
+
+            /* Starting a new argument, so store the previous argument,
+             * if there was one. */
+            if (set) {
+                VTABLE_push_integer(interp, current_array, flags);
+                set = 0;
+            }
+
+            /* Switch to the return argument flags. */
+            if (PMC_IS_NULL(*return_flags))
+                *return_flags = pmc_new(interp, enum_class_ResizableIntegerArray);
+            current_array = *return_flags;
+        }
+        /* parse arg type */
+        else if (isupper((unsigned char)*x)) {
+            /* Starting a new argument, so store the previous argument,
+             * if there was one. */
+            if (set) {
+                VTABLE_push_integer(interp, current_array, flags);
+                set = 0;
+            }
+
+            switch (*x) {
+                case 'I': flags = PARROT_ARG_INTVAL;   set++; break;
+                case 'N': flags = PARROT_ARG_FLOATVAL; set++; break;
+                case 'S': flags = PARROT_ARG_STRING;   set++; break;
+                case 'P': flags = PARROT_ARG_PMC;      set++; break;
+                default:
+                    Parrot_ex_throw_from_c_args(interp, NULL,
+                        EXCEPTION_INVALID_OPERATION,
+                        "invalid signature string element %c!", *x);
+            }
+
+        }
+        /* parse arg adverbs */
+        else if (islower((unsigned char)*x)) {
+            switch (*x) {
+                case 'c': flags |= PARROT_ARG_CONSTANT;     break;
+                case 'f': flags |= PARROT_ARG_FLATTEN;      break;
+                case 'i': flags |= PARROT_ARG_INVOCANT;     break;
+                case 'l': flags |= PARROT_ARG_LOOKAHEAD;    break;
+                case 'n': flags |= PARROT_ARG_NAME;         break;
+                case 'o': flags |= PARROT_ARG_OPTIONAL;     break;
+                case 'p': flags |= PARROT_ARG_OPT_FLAG;     break;
+                case 's': flags |= PARROT_ARG_SLURPY_ARRAY; break;
+                default:
+                    Parrot_ex_throw_from_c_args(interp, NULL,
+                        EXCEPTION_INVALID_OPERATION,
+                        "invalid signature string element %c!", *x);
+            }
+        }
+    }
+
+    /* Store the final argument, if there was one. */
+    if (set)
+        VTABLE_push_integer(interp, current_array, flags);
+}
+
+/*
+
+=item C<void Parrot_pcc_parse_signature_string(PARROT_INTERP, STRING *signature,
+PMC **arg_flags, PMC **return_flags)>
+
+Parses a signature string and creates call and return signature integer
+arrays. The two integer arrays should be passed in as references to a
+PMC.
+
+=cut
+
+*/
+
+PARROT_CAN_RETURN_NULL
+void
+Parrot_pcc_parse_signature_string(PARROT_INTERP, ARGIN(STRING *signature),
+        ARGMOD(PMC **arg_flags), ARGMOD(PMC **return_flags))
+{
+    ASSERT_ARGS(Parrot_pcc_parse_signature_string)
+    char *s        = Parrot_str_to_cstring(interp, signature);
+    *arg_flags    = PMCNULL;
+    *return_flags = PMCNULL;
+    parse_signature_string(interp, s, arg_flags, return_flags);
+    Parrot_str_free_cstring(s);
+}
+
+/*
+
+=item C<void Parrot_pcc_merge_signature_for_tailcall(PARROT_INTERP, PMC *
+parent, PMC * tailcall)>
+
+merge in signatures for tailcall
+
+=cut
+
+*/
+
+void
+Parrot_pcc_merge_signature_for_tailcall(PARROT_INTERP,
+        ARGMOD_NULLOK(PMC * parent), ARGMOD_NULLOK(PMC * tailcall))
+{
+    ASSERT_ARGS(Parrot_pcc_merge_signature_for_tailcall)
+    if (PMC_IS_NULL(parent) || PMC_IS_NULL(tailcall) || (parent == tailcall))
+        return;
+    else {
+        /* Broke encapuslation. Direct poking into CallContext is much faster */
+        void ** returns_values;
+        void ** tailcall_returns_values;
+        INTVAL  returns_size;
+        PMC * return_flags;
+
+        GETATTR_CallContext_returns_size(interp, parent, returns_size);
+        GETATTR_CallContext_returns_values(interp, parent, returns_values);
+
+        /* Resize tailcall.returns_values to new size */
+        tailcall_returns_values = csr_reallocate_return_values(interp, tailcall, returns_size);
+
+        /* And copy values over it */
+        mem_copy_n_typed(tailcall_returns_values, returns_values, returns_size, void**);
+
+        /* Store raw signature */
+        GETATTR_CallContext_return_flags(interp, parent, return_flags);
+        SETATTR_CallContext_return_flags(interp, tailcall, return_flags);
+
+    }
+}
+
+/*
+
+Get the appropriate argument value from the continuation
+
+=item C<static INTVAL intval_arg_from_continuation(PARROT_INTERP, PMC *cs,
+INTVAL arg_index)>
+
+=item C<static FLOATVAL numval_arg_from_continuation(PARROT_INTERP, PMC *cs,
+INTVAL arg_index)>
+
+=item C<static STRING* string_arg_from_continuation(PARROT_INTERP, PMC *cs,
+INTVAL arg_index)>
+
+=item C<static PMC* pmc_arg_from_continuation(PARROT_INTERP, PMC *cs, INTVAL
+arg_index)>
+
+Get the appropriate argument value from the op.
+
+=item C<static INTVAL intval_arg_from_op(PARROT_INTERP, opcode_t *raw_args,
+INTVAL arg_index)>
+
+=item C<static FLOATVAL numval_arg_from_op(PARROT_INTERP, opcode_t *raw_args,
+INTVAL arg_index)>
+
+=item C<static STRING* string_arg_from_op(PARROT_INTERP, opcode_t *raw_args,
+INTVAL arg_index)>
+
+=item C<static PMC* pmc_arg_from_op(PARROT_INTERP, opcode_t *raw_args, INTVAL
+arg_index)>
+
+Get the appropriate parameter value from the op (these are pointers, so the
+argument value can be stored into them.)
+
+=item C<static INTVAL* intval_param_from_op(PARROT_INTERP, opcode_t *raw_params,
+INTVAL param_index)>
+
+=item C<static FLOATVAL* numval_param_from_op(PARROT_INTERP, opcode_t
+*raw_params, INTVAL param_index)>
+
+=item C<static STRING** string_param_from_op(PARROT_INTERP, opcode_t
+*raw_params, INTVAL param_index)>
+
+=item C<static PMC** pmc_param_from_op(PARROT_INTERP, opcode_t *raw_params,
+INTVAL param_index)>
+
+=item C<static INTVAL intval_constant_from_op(PARROT_INTERP, opcode_t
+*raw_params, INTVAL param_index)>
+
+=item C<static FLOATVAL numval_constant_from_op(PARROT_INTERP, opcode_t
+*raw_params, INTVAL param_index)>
+
+=item C<static STRING* string_constant_from_op(PARROT_INTERP, opcode_t
+*raw_params, INTVAL param_index)>
+
+=item C<static PMC* pmc_constant_from_op(PARROT_INTERP, opcode_t *raw_params,
+INTVAL param_index)>
+
+Get the appropriate argument value from varargs.
+
+=item C<static INTVAL intval_arg_from_c_args(PARROT_INTERP, va_list *args,
+INTVAL param_index)>
+
+=item C<static FLOATVAL numval_arg_from_c_args(PARROT_INTERP, va_list *args,
+INTVAL param_index)>
+
+=item C<static STRING* string_arg_from_c_args(PARROT_INTERP, va_list *args,
+INTVAL param_index)>
+
+=item C<static PMC* pmc_arg_from_c_args(PARROT_INTERP, va_list *args, INTVAL
+param_index)>
+
+Get the appropriate parameter value from varargs (these are pointers, so they
+can be set with the argument value).
+
+=item C<static INTVAL* intval_param_from_c_args(PARROT_INTERP, va_list *args,
+INTVAL param_index)>
+
+=item C<static FLOATVAL* numval_param_from_c_args(PARROT_INTERP, va_list *args,
+INTVAL param_index)>
+
+=item C<static STRING** string_param_from_c_args(PARROT_INTERP, va_list *args,
+INTVAL param_index)>
+
+=item C<static PMC** pmc_param_from_c_args(PARROT_INTERP, va_list *args, INTVAL
+param_index)>
+
+Parrot constants cannot be passed from varargs, so these functions are dummies
+that throw exceptions.
+
+=item C<static INTVAL intval_constant_from_varargs(PARROT_INTERP, void *data,
+INTVAL index)>
+
+=item C<static FLOATVAL numval_constant_from_varargs(PARROT_INTERP, void *data,
+INTVAL index)>
+
+=item C<static STRING* string_constant_from_varargs(PARROT_INTERP, void *data,
+INTVAL index)>
+
+=item C<static PMC* pmc_constant_from_varargs(PARROT_INTERP, void *data, INTVAL
+index)>
+
+ - More specific comments can be added later
+
+=cut
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+static INTVAL
+intval_arg_from_continuation(PARROT_INTERP, ARGIN(PMC *cs), INTVAL arg_index)
+{
+    ASSERT_ARGS(intval_arg_from_continuation)
+    const INTVAL ret      = VTABLE_get_integer_keyed_int(interp, cs, arg_index);
+    return ret;
+}
+
+PARROT_CANNOT_RETURN_NULL
+static FLOATVAL
+numval_arg_from_continuation(PARROT_INTERP, ARGIN(PMC *cs), INTVAL arg_index)
+{
+    ASSERT_ARGS(numval_arg_from_continuation)
+    const FLOATVAL ret      = VTABLE_get_number_keyed_int(interp, cs, arg_index);
+    return ret;
+}
+
+PARROT_CANNOT_RETURN_NULL
+static STRING*
+string_arg_from_continuation(PARROT_INTERP, ARGIN(PMC *cs), INTVAL arg_index)
+{
+    ASSERT_ARGS(string_arg_from_continuation)
+    STRING *ret      = VTABLE_get_string_keyed_int(interp, cs, arg_index);
+    return ret;
+}
+
+PARROT_CANNOT_RETURN_NULL
+static PMC*
+pmc_arg_from_continuation(PARROT_INTERP, ARGIN(PMC *cs), INTVAL arg_index)
+{
+    ASSERT_ARGS(pmc_arg_from_continuation)
+    PMC *ret      = VTABLE_get_pmc_keyed_int(interp, cs, arg_index);
+    return ret;
+}
+
+PARROT_CANNOT_RETURN_NULL
+static INTVAL
+intval_arg_from_op(PARROT_INTERP, ARGIN(opcode_t *raw_args), INTVAL arg_index)
+{
+    ASSERT_ARGS(intval_arg_from_op)
+    const INTVAL raw_index      = raw_args[arg_index + 2];
+    return REG_INT(interp, raw_index);
+}
+
+PARROT_CANNOT_RETURN_NULL
+static FLOATVAL
+numval_arg_from_op(PARROT_INTERP, ARGIN(opcode_t *raw_args), INTVAL arg_index)
+{
+    ASSERT_ARGS(numval_arg_from_op)
+    const INTVAL raw_index      = raw_args[arg_index + 2];
+    return REG_NUM(interp, raw_index);
+}
+
+PARROT_CANNOT_RETURN_NULL
+static STRING*
+string_arg_from_op(PARROT_INTERP, ARGIN(opcode_t *raw_args), INTVAL arg_index)
+{
+    ASSERT_ARGS(string_arg_from_op)
+    const INTVAL raw_index      = raw_args[arg_index + 2];
+    return REG_STR(interp, raw_index);
+}
+
+PARROT_CANNOT_RETURN_NULL
+static PMC*
+pmc_arg_from_op(PARROT_INTERP, ARGIN(opcode_t *raw_args), INTVAL arg_index)
+{
+    ASSERT_ARGS(pmc_arg_from_op)
+    const INTVAL raw_index      = raw_args[arg_index + 2];
+    return REG_PMC(interp, raw_index);
+}
+
+PARROT_CANNOT_RETURN_NULL
+static INTVAL*
+intval_param_from_op(PARROT_INTERP, ARGIN(opcode_t *raw_params), INTVAL param_index)
+{
+    ASSERT_ARGS(intval_param_from_op)
+    const INTVAL raw_index      = raw_params[param_index + 2];
+    return &REG_INT(interp, raw_index);
+}
+
+PARROT_CANNOT_RETURN_NULL
+static FLOATVAL*
+numval_param_from_op(PARROT_INTERP, ARGIN(opcode_t *raw_params), INTVAL param_index)
+{
+    ASSERT_ARGS(numval_param_from_op)
+    const INTVAL raw_index      = raw_params[param_index + 2];
+    return &REG_NUM(interp, raw_index);
+}
+
+PARROT_CANNOT_RETURN_NULL
+static STRING**
+string_param_from_op(PARROT_INTERP, ARGIN(opcode_t *raw_params), INTVAL param_index)
+{
+    ASSERT_ARGS(string_param_from_op)
+    const INTVAL raw_index      = raw_params[param_index + 2];
+    return &REG_STR(interp, raw_index);
+}
+
+PARROT_CANNOT_RETURN_NULL
+static PMC**
+pmc_param_from_op(PARROT_INTERP, ARGIN(opcode_t *raw_params), INTVAL param_index)
+{
+    ASSERT_ARGS(pmc_param_from_op)
+    const INTVAL raw_index      = raw_params[param_index + 2];
+    return &REG_PMC(interp, raw_index);
+}
+
+static INTVAL
+intval_constant_from_op(PARROT_INTERP, ARGIN(opcode_t *raw_params), INTVAL param_index)
+{
+    ASSERT_ARGS(intval_constant_from_op)
+    const INTVAL raw_index      = raw_params[param_index + 2];
+    return raw_index;
+}
+
+static FLOATVAL
+numval_constant_from_op(PARROT_INTERP, ARGIN(opcode_t *raw_params), INTVAL param_index)
+{
+    ASSERT_ARGS(numval_constant_from_op)
+    const INTVAL raw_index      = raw_params[param_index + 2];
+    return Parrot_pcc_get_num_constant(interp, CURRENT_CONTEXT(interp), raw_index);
+}
+
+PARROT_CAN_RETURN_NULL
+static STRING*
+string_constant_from_op(PARROT_INTERP, ARGIN(opcode_t *raw_params), INTVAL param_index)
+{
+    ASSERT_ARGS(string_constant_from_op)
+    const INTVAL raw_index      = raw_params[param_index + 2];
+    return Parrot_pcc_get_string_constant(interp, CURRENT_CONTEXT(interp), raw_index);
+}
+
+PARROT_CAN_RETURN_NULL
+static PMC*
+pmc_constant_from_op(PARROT_INTERP, ARGIN(opcode_t *raw_params), INTVAL param_index)
+{
+    ASSERT_ARGS(pmc_constant_from_op)
+    const INTVAL raw_index      = raw_params[param_index + 2];
+    return Parrot_pcc_get_pmc_constant(interp, CURRENT_CONTEXT(interp), raw_index);
+}
+
+PARROT_CANNOT_RETURN_NULL
+static INTVAL
+intval_arg_from_c_args(PARROT_INTERP, ARGIN(va_list *args), SHIM(INTVAL param_index))
+{
+    ASSERT_ARGS(intval_arg_from_c_args)
+    return va_arg(*args, INTVAL);
+}
+
+PARROT_CANNOT_RETURN_NULL
+static FLOATVAL
+numval_arg_from_c_args(PARROT_INTERP, ARGIN(va_list *args), SHIM(INTVAL param_index))
+{
+    ASSERT_ARGS(numval_arg_from_c_args)
+    return va_arg(*args, FLOATVAL);
+}
+
+PARROT_CANNOT_RETURN_NULL
+static STRING*
+string_arg_from_c_args(PARROT_INTERP, ARGIN(va_list *args), SHIM(INTVAL param_index))
+{
+    ASSERT_ARGS(string_arg_from_c_args)
+    return va_arg(*args, STRING*);
+}
+
+PARROT_CANNOT_RETURN_NULL
+static PMC*
+pmc_arg_from_c_args(PARROT_INTERP, ARGIN(va_list *args), SHIM(INTVAL param_index))
+{
+    ASSERT_ARGS(pmc_arg_from_c_args)
+    return va_arg(*args, PMC*);
+}
+
+PARROT_CANNOT_RETURN_NULL
+static INTVAL*
+intval_param_from_c_args(PARROT_INTERP, ARGIN(va_list *args), SHIM(INTVAL param_index))
+{
+    ASSERT_ARGS(intval_param_from_c_args)
+    return va_arg(*args, INTVAL*);
+}
+
+PARROT_CANNOT_RETURN_NULL
+static FLOATVAL*
+numval_param_from_c_args(PARROT_INTERP, ARGIN(va_list *args), SHIM(INTVAL param_index))
+{
+    ASSERT_ARGS(numval_param_from_c_args)
+    return va_arg(*args, FLOATVAL*);
+}
+
+PARROT_CANNOT_RETURN_NULL
+static STRING**
+string_param_from_c_args(PARROT_INTERP, ARGIN(va_list *args), SHIM(INTVAL param_index))
+{
+    ASSERT_ARGS(string_param_from_c_args)
+    return va_arg(*args, STRING**);
+}
+
+PARROT_CANNOT_RETURN_NULL
+static PMC**
+pmc_param_from_c_args(PARROT_INTERP, ARGIN(va_list *args), SHIM(INTVAL param_index))
+{
+    ASSERT_ARGS(pmc_param_from_c_args)
+    return va_arg(*args, PMC**);
+}
+
+static INTVAL
+intval_constant_from_varargs(PARROT_INTERP, ARGIN(void *data), INTVAL index)
+{
+    ASSERT_ARGS(intval_constant_from_varargs)
+    PARROT_ASSERT(!"Wrong call");
+    return 0;
+}
+
+static FLOATVAL
+numval_constant_from_varargs(PARROT_INTERP, ARGIN(void *data), INTVAL index)
+{
+    ASSERT_ARGS(numval_constant_from_varargs)
+    PARROT_ASSERT(!"Wrong call");
+    return 0.0;
+}
+
+PARROT_CAN_RETURN_NULL
+static STRING*
+string_constant_from_varargs(PARROT_INTERP, ARGIN(void *data), INTVAL index)
+{
+    ASSERT_ARGS(string_constant_from_varargs)
+    PARROT_ASSERT(!"Wrong call");
+    return NULL;
+}
+
+PARROT_CAN_RETURN_NULL
+static PMC*
+pmc_constant_from_varargs(PARROT_INTERP, ARGIN(void *data), INTVAL index)
+{
+    ASSERT_ARGS(pmc_constant_from_varargs)
+    PARROT_ASSERT(!"Wrong call");
+    return PMCNULL;
+}
+
+/*
+
+=item C<static PMC* clone_key_arg(PARROT_INTERP, PMC *key)>
+
+Replaces any src registers by their values (done inside clone).  This needs a
+test for tailcalls too, but I think there is no syntax to pass a key to a
+tailcalled function or method.
+
+=cut
+
+*/
+
+PARROT_CAN_RETURN_NULL
+static PMC*
+clone_key_arg(PARROT_INTERP, ARGIN(PMC *key))
+{
+    ASSERT_ARGS(clone_key_arg)
+    PMC *t;
+
+    if (PMC_IS_NULL(key))
+        return key;
+
+    if (key->vtable->base_type != enum_class_Key)
+        return key;
+
+    for (t = key; t; t=key_next(interp, t)) {
+        /* register keys have to be cloned */
+        if (PObj_get_FLAGS(key) & KEY_register_FLAG) {
+            return VTABLE_clone(interp, key);
+        }
+    }
+
+    return key;
+}
+
+/*
+
+VTABLE functions from CallContextReturns. TODO Rename them appropriately.
+
+*/
+
+/* mask off lower two bits (1 + 2 = 3) for pointer tags */
+#define TAG_BITS 3
+#define UNTAG_CELL(c) INTVAL2PTR(void *, (PTR2INTVAL(c)) & ~TAG_BITS)
+#define CELL_TYPE_MASK(c) (PTR2INTVAL(c)) & TAG_BITS
+
+/*
+
+=item C<static void** csr_reallocate_return_values(PARROT_INTERP, PMC *self,
+INTVAL size)>
+
+Resizes the array to C<size> elements.
+
+=cut
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+static void**
+csr_reallocate_return_values(PARROT_INTERP, ARGIN(PMC *self), INTVAL size)
+{
+    ASSERT_ARGS(csr_reallocate_return_values)
+    void    **values = NULL;
+    INTVAL    resize_threshold;
+
+    GETATTR_CallContext_returns_values(interp, self, values);
+    GETATTR_CallContext_returns_resize_threshold(interp, self, resize_threshold);
+
+    /* Empty. Allocate 8 elements (arbitary number) */
+    if (!values) {
+        /* It's slightly wrong. We have to allocate directly from system allocator
+         * when initial size is greater than 8. But it's never happen. So, put
+         * assert here to be sure */
+        PARROT_ASSERT(size < 8);
+        values = (void **)Parrot_gc_allocate_fixed_size_storage(interp,
+                                 8 * sizeof (void *));
+
+        SETATTR_CallContext_returns_values(interp, self, values);
+        SETATTR_CallContext_returns_size(interp, self, size);
+        SETATTR_CallContext_returns_resize_threshold(interp, self, 8);
+    }
+    else if (size <= resize_threshold) {
+        SETATTR_CallContext_returns_size(interp, self, size);
+    }
+    else {
+        void   *old_values;
+        INTVAL  cur = resize_threshold;
+
+        /* Switch to system allocator */
+        if (cur == 8) {
+            old_values = values;
+            values     = mem_allocate_n_typed(8, void *);
+            memcpy(values, old_values, 8 * sizeof (void *));
+            Parrot_gc_free_fixed_size_storage(interp,
+                8 * sizeof (void *), old_values);
+        }
+
+        if (cur < 8192)
+            cur = size < 2 * cur ? 2 * cur : size;
+        else {
+            INTVAL needed = size - cur;
+            cur          += needed + 4096;
+            cur          &= ~0xfff;
+        }
+
+        mem_realloc_n_typed(values, cur, void *);
+
+        SETATTR_CallContext_returns_values(interp, self, values);
+        SETATTR_CallContext_returns_size(interp, self, size);
+        SETATTR_CallContext_returns_resize_threshold(interp, self, cur);
+    }
+
+    return values;
+}
+
+/*
+
+=item C<static INTVAL csr_returns_count(PARROT_INTERP, PMC *self)>
+
+Returns the number of returns values.
+
+=cut
+
+*/
+
+static INTVAL
+csr_returns_count(PARROT_INTERP, ARGIN(PMC *self))
+{
+    ASSERT_ARGS(csr_returns_count)
+    INTVAL size;
+    GETATTR_CallContext_returns_size(interp, self, size);
+    return size;
+}
+
+/*
+
+=item C<static void csr_push_pointer(PARROT_INTERP, PMC *self, void *value,
+INTVAL type)>
+
+Push pointer to results.  The pointer should point to a storage
+location for a return value -- it must be a pointer to an INTVAL, FLOATVAL,
+PMC, or STRING storage location. C<type> is type of pointer.
+
+TODO Rephrase doc. It's weird.
+
+=cut
+
+*/
+
+static void
+csr_push_pointer(PARROT_INTERP, ARGIN(PMC *self), ARGIN_NULLOK(void *value), INTVAL type)
+{
+    ASSERT_ARGS(csr_push_pointer)
+    void   **values;
+    INTVAL   size;
+
+    PARROT_ASSERT((type >= 0 && type < 4) || !"Wrong pointer type");
+
+    GETATTR_CallContext_returns_size(interp, self, size);
+    values = csr_reallocate_return_values(interp, self, size + 1);
+
+    /* Tag pointer */
+    values[size] = INTVAL2PTR(void *, PTR2INTVAL(value) | type);
+}
+
+
+/*
+
+=item C<static void csr_fill_integer(PARROT_INTERP, PMC *self, INTVAL key,
+INTVAL value)>
+
+=item C<static void csr_fill_number(PARROT_INTERP, PMC *self, INTVAL key,
+FLOATVAL value)>
+
+=item C<static void csr_fill_string(PARROT_INTERP, PMC *self, INTVAL key, STRING
+*value)>
+
+=item C<static void csr_fill_pmc(PARROT_INTERP, PMC *self, INTVAL key, PMC
+*value)>
+
+Sets the value of the element at index C<key> to C<value>, casting if
+necessary.
+
+=cut
+
+*/
+
+static void
+csr_fill_integer(PARROT_INTERP, ARGIN(PMC *self), INTVAL key, INTVAL value)
+{
+    ASSERT_ARGS(csr_fill_integer)
+    void *cell = csr_get_pointer_keyed_int(interp, self, key);
+    void *ptr  = UNTAG_CELL(cell);
+
+    switch ((Call_bits_enum_t)CELL_TYPE_MASK(cell)) {
+      case PARROT_ARG_INTVAL:
+        *(INTVAL *)ptr = value;
+        break;
+      case PARROT_ARG_FLOATVAL:
+        *(FLOATVAL *)ptr = value;
+        break;
+      case PARROT_ARG_STRING:
+        *(STRING **)ptr = Parrot_str_from_int(interp, value);
+        break;
+      case PARROT_ARG_PMC:
+        *(PMC **)ptr = get_integer_pmc(interp, value);
+        break;
+      default:
+        PARROT_ASSERT(!"Impossible type");
+    }
+}
+
+static void
+csr_fill_number(PARROT_INTERP, ARGIN(PMC *self), INTVAL key, FLOATVAL value)
+{
+    ASSERT_ARGS(csr_fill_number)
+    void *cell = csr_get_pointer_keyed_int(interp, self, key);
+    void *ptr  = UNTAG_CELL(cell);
+
+    switch ((Call_bits_enum_t)CELL_TYPE_MASK(cell)) {
+      case PARROT_ARG_INTVAL:
+        *(INTVAL *)ptr = value;
+        break;
+      case PARROT_ARG_FLOATVAL:
+        *(FLOATVAL *)ptr = value;
+        break;
+      case PARROT_ARG_STRING:
+        *(STRING **)ptr = Parrot_str_from_num(interp, value);
+        break;
+      case PARROT_ARG_PMC:
+        *(PMC **)ptr = get_number_pmc(interp, value);
+        break;
+      default:
+        PARROT_ASSERT(!"Impossible type");
+    }
+}
+
+static void
+csr_fill_string(PARROT_INTERP, ARGIN(PMC *self), INTVAL key, ARGIN_NULLOK(STRING *value))
+{
+    ASSERT_ARGS(csr_fill_string)
+    void *cell = csr_get_pointer_keyed_int(interp, self, key);
+    void *ptr  = UNTAG_CELL(cell);
+
+    switch ((Call_bits_enum_t)CELL_TYPE_MASK(cell)) {
+      case PARROT_ARG_INTVAL:
+        *(INTVAL *)ptr = Parrot_str_to_int(interp, value);
+        break;
+      case PARROT_ARG_FLOATVAL:
+        *(FLOATVAL *)ptr = Parrot_str_to_num(interp, value);
+        break;
+      case PARROT_ARG_STRING:
+        *(STRING **)ptr = value;
+        break;
+      case PARROT_ARG_PMC:
+        *(PMC **)ptr = STRING_IS_NULL(value) ?
+                PMCNULL :
+                get_string_pmc(interp, value);
+        break;
+      default:
+        PARROT_ASSERT(!"Impossible type");
+    }
+}
+
+static void
+csr_fill_pmc(PARROT_INTERP, ARGIN(PMC *self), INTVAL key, ARGIN_NULLOK(PMC *value))
+{
+    ASSERT_ARGS(csr_fill_pmc)
+    void *cell = csr_get_pointer_keyed_int(interp, self, key);
+    void *ptr  = UNTAG_CELL(cell);
+
+    switch ((Call_bits_enum_t)CELL_TYPE_MASK(cell)) {
+      case PARROT_ARG_INTVAL:
+        *(INTVAL *)ptr = VTABLE_get_integer(interp, value);
+        break;
+      case PARROT_ARG_FLOATVAL:
+        *(FLOATVAL *)ptr = VTABLE_get_number(interp, value);
+        break;
+      case PARROT_ARG_STRING:
+        *(STRING **)ptr = VTABLE_get_string(interp, value);
+        break;
+      case PARROT_ARG_PMC:
+        *(PMC **)ptr = value;
+        break;
+      default:
+        PARROT_ASSERT(!"Impossible type");
+    }
+}
+
+/*
+
+=item C<static STRING* csr_get_string_keyed_int(PARROT_INTERP, PMC *self, INTVAL
+key)>
+
+Gets raw pointer for result.
+
+=cut
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+static STRING*
+csr_get_string_keyed_int(PARROT_INTERP, ARGIN(PMC *self), INTVAL key)
+{
+    ASSERT_ARGS(csr_get_string_keyed_int)
+    void *cell  = csr_get_pointer_keyed_int(interp, self, key);
+    void *ptr   = UNTAG_CELL(cell);
+    return (STRING *)ptr;
+}
+
+
+/*
+
+=item C<static void* csr_get_pointer_keyed_int(PARROT_INTERP, PMC *self, INTVAL
+key)>
+
+Gets raw pointer for result.
+
+=cut
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+static void*
+csr_get_pointer_keyed_int(PARROT_INTERP, ARGIN(PMC *self), INTVAL key)
+{
+    ASSERT_ARGS(csr_get_pointer_keyed_int)
+    void   **values;
+    INTVAL   size;
+
+    GETATTR_CallContext_returns_size(interp, self, size);
+    PARROT_ASSERT((key < size) || !"Wrong index");
+
+    GETATTR_CallContext_returns_values(interp, self, values);
+    return values[key];
+}
+
+/*
+
+=item C<void Parrot_pcc_append_result(PARROT_INTERP, PMC *sig_object, STRING
+*type, void *result)>
+
+Helper function between old and new style PCC to append return pointer to signature.
+
+To be removed with deprecated functions.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_pcc_append_result(PARROT_INTERP, ARGIN(PMC *sig_object), ARGIN(STRING *type),
+        ARGIN(void *result))
+{
+    ASSERT_ARGS(Parrot_pcc_append_result)
+    STRING *full_sig;
+    PMC    *return_flags;
+    INTVAL  return_flags_size;
+    INTVAL  int_type;
+
+    Parrot_String return_flags_name = Parrot_str_new_constant(interp, "return_flags");
+    Parrot_String sig_name          = Parrot_str_new_constant(interp, "signature");
+
+    full_sig = VTABLE_get_string(interp, sig_object);
+    /* Append ->[T] */
+    Parrot_str_concat(interp, full_sig, Parrot_str_new_constant(interp, "->"), 0);
+    Parrot_str_concat(interp, full_sig, type, 0);
+
+    /* Update returns_flag */
+    return_flags = VTABLE_get_attr_str(interp, sig_object, return_flags_name);
+    if (PMC_IS_NULL(return_flags)) {
+        /* Create return_flags for single element */
+        return_flags = pmc_new(interp, enum_class_FixedIntegerArray);
+        return_flags_size = 0;
+        VTABLE_set_integer_native(interp, return_flags, 1);
+        VTABLE_set_attr_str(interp, sig_object, return_flags_name, return_flags);
+    }
+    else {
+        /* Extend return_flags by one element */
+        return_flags_size = VTABLE_elements(interp, return_flags);
+        VTABLE_set_integer_native(interp, return_flags, return_flags_size + 1);
+    }
+    switch (Parrot_str_indexed(interp, type, 0)) {
+      case 'I':
+        VTABLE_set_integer_keyed_int(interp, return_flags, return_flags_size,
+                    PARROT_ARG_INTVAL);
+        int_type = PARROT_ARG_INTVAL;
+        break;
+      case 'N':
+        VTABLE_set_integer_keyed_int(interp, return_flags, return_flags_size,
+                    PARROT_ARG_FLOATVAL);
+        int_type = PARROT_ARG_FLOATVAL;
+        break;
+      case 'S':
+        VTABLE_set_integer_keyed_int(interp, return_flags, return_flags_size,
+                    PARROT_ARG_STRING);
+        int_type = PARROT_ARG_STRING;
+        break;
+      case 'P':
+        VTABLE_set_integer_keyed_int(interp, return_flags, return_flags_size,
+                    PARROT_ARG_PMC);
+        int_type = PARROT_ARG_PMC;
+        break;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL,
+                EXCEPTION_INVALID_OPERATION,
+                "invalid signature string element!");
+    }
+
+    csr_push_pointer(interp, sig_object, result, int_type);
+}
+
+/*
+
+=back
+
+=head1 SEE ALSO
+
+F<include/parrot/call.h>, F<src/call/ops.c>, F<src/call/pcc.c>.
+
+=cut
+
+*/
+
+/*
+ * Local variables:
+ *   c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */

Added: branches/orderedhash_revamp/src/call/context.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/src/call/context.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,945 @@
+/*
+Copyright (C) 2009, Parrot Foundation.
+$Id$
+
+=head1 NAME
+
+src/context.c
+
+=head1 DESCRIPTION
+
+Parrot_Context functions.
+
+=cut
+
+*/
+
+#include "parrot/parrot.h"
+#include "parrot/call.h"
+#include "pmc/pmc_sub.h"
+#include "pmc/pmc_callcontext.h"
+
+/*
+
+=head2 Context and register frame layout
+
+    +----------++----+------+------------+----+
+    | context  || N  |  I   |   P        |  S +
+    +----------++----+------+------------+----+
+    ^          ^     ^                   ^
+    |          |     ctx.bp              ctx.bp_ps
+    ctx.state  opt
+               padding
+
+Registers are addressed as usual via the register base pointer ctx.bp.
+
+The macro CONTEXT() hides these details
+
+=cut
+
+*/
+
+#define ALIGNED_CTX_SIZE (((sizeof (Parrot_Context) + NUMVAL_SIZE - 1) \
+        / NUMVAL_SIZE) * NUMVAL_SIZE)
+
+/*
+
+=head2 Allocation Size
+
+Round register allocation size up to the nearest multiple of 8. A granularity
+of 8 is arbitrary, it could have been some bigger power of 2. A "slot" is an
+index into the free_list array. Each slot in free_list has a linked list of
+pointers to already allocated contexts available for (re)use.  The slot where
+an available context is stored corresponds to the size of the context.
+
+=cut
+
+*/
+
+#define SLOT_CHUNK_SIZE 8
+
+#define ROUND_ALLOC_SIZE(size) ((((size) + SLOT_CHUNK_SIZE - 1) \
+        / SLOT_CHUNK_SIZE) * SLOT_CHUNK_SIZE)
+#define CALCULATE_SLOT_NUM(size) ((size) / SLOT_CHUNK_SIZE)
+
+
+/* HEADERIZER HFILE: include/parrot/call.h */
+
+/* HEADERIZER BEGIN: static */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+
+static void allocate_registers(PARROT_INTERP,
+    ARGIN(PMC *pmcctx),
+    ARGIN(const UINTVAL *number_regs_used))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
+
+static size_t calculate_registers_size(SHIM_INTERP,
+    ARGIN(const UINTVAL *number_regs_used))
+        __attribute__nonnull__(2);
+
+static void clear_regs(PARROT_INTERP, ARGMOD(PMC *pmcctx))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        FUNC_MODIFIES(*pmcctx);
+
+PARROT_INLINE
+PARROT_CANNOT_RETURN_NULL
+static Parrot_Context * get_context_struct_fast(PARROT_INTERP,
+    ARGIN(PMC *ctx))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+static void init_context(PARROT_INTERP,
+    ARGMOD(PMC *pmcctx),
+    ARGIN_NULLOK(PMC *pmcold))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        FUNC_MODIFIES(*pmcctx);
+
+static size_t Parrot_pcc_calculate_registers_size(PARROT_INTERP,
+    ARGIN(const UINTVAL *number_regs_used))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+#define ASSERT_ARGS_allocate_registers __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmcctx) \
+    , PARROT_ASSERT_ARG(number_regs_used))
+#define ASSERT_ARGS_calculate_registers_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(number_regs_used))
+#define ASSERT_ARGS_clear_regs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmcctx))
+#define ASSERT_ARGS_get_context_struct_fast __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_init_context __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmcctx))
+#define ASSERT_ARGS_Parrot_pcc_calculate_registers_size \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(number_regs_used))
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+/* HEADERIZER END: static */
+
+
+/*
+
+=head2 Context API Functions
+
+=over 4
+
+=item C<PMC* Parrot_pcc_get_sub(PARROT_INTERP, PMC *ctx)>
+
+Get Sub executed inside Context.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+PMC*
+Parrot_pcc_get_sub(PARROT_INTERP, ARGIN(PMC *ctx))
+{
+    ASSERT_ARGS(Parrot_pcc_get_sub)
+    Parrot_Context const *c = get_context_struct_fast(interp, ctx);
+    return c->current_sub;
+}
+
+
+/*
+
+=item C<void Parrot_pcc_set_sub(PARROT_INTERP, PMC *ctx, PMC *sub)>
+
+Set Sub executed inside Context.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_pcc_set_sub(PARROT_INTERP, ARGIN(PMC *ctx), ARGIN_NULLOK(PMC *sub))
+{
+    ASSERT_ARGS(Parrot_pcc_set_sub)
+    Parrot_Context *c = get_context_struct_fast(interp, ctx);
+    c->current_sub    = sub;
+
+    if (sub && !PMC_IS_NULL(sub)) {
+        Parrot_Sub_attributes *subattr;
+
+        PMC_get_sub(interp, sub, subattr);
+
+        c->current_pc        = subattr->seg->base.data + subattr->start_offs;
+        c->current_HLL       = subattr->HLL_id;
+        c->current_namespace = subattr->namespace_stash;
+    }
+}
+
+
+/*
+
+=back
+
+=head2 Context and Register Allocation Functions
+
+=over 4
+
+=item C<void create_initial_context(PARROT_INTERP)>
+
+Creates the interpreter's initial context.
+
+=cut
+
+*/
+
+void
+create_initial_context(PARROT_INTERP)
+{
+    ASSERT_ARGS(create_initial_context)
+    static UINTVAL   num_regs[] = {32, 32, 32, 32};
+    PMC *ignored;
+
+    /* Create some initial free_list slots. */
+
+#define INITIAL_FREE_SLOTS 8
+    /* For now create context with 32 regs each. Some src tests (and maybe
+     * other extenders) assume the presence of these registers */
+    ignored = Parrot_set_new_context(interp, num_regs);
+    UNUSED(ignored);
+}
+
+/*
+
+=item C<static Parrot_Context * get_context_struct_fast(PARROT_INTERP, PMC
+*ctx)>
+
+Fetches Parrot_Context from Context PMC.  This is a static, inlineable function
+so it only works within this file.  It also only works if you *know* that ctx
+is a valid PMC, so be careful.  This is an encapsulation-breaking optimization
+that improves performance measurably.  Use responsibly.  Never export this
+function.
+
+=cut
+
+*/
+
+
+PARROT_INLINE
+PARROT_CANNOT_RETURN_NULL
+static Parrot_Context *
+get_context_struct_fast(PARROT_INTERP, ARGIN(PMC *ctx))
+{
+    ASSERT_ARGS(get_context_struct_fast)
+
+    /* temporarily violate encapsulation; big speedup here */
+    return PMC_data_typed(ctx, Parrot_Context *);
+}
+
+/*
+
+=item C<static void clear_regs(PARROT_INTERP, PMC *pmcctx)>
+
+Clears all registers in a context.  PMC and STRING registers contain PMCNULL
+and NULL, respectively.  Integer and float registers contain negative flag
+values, for debugging purposes.
+
+=cut
+
+*/
+
+static void
+clear_regs(PARROT_INTERP, ARGMOD(PMC *pmcctx))
+{
+    ASSERT_ARGS(clear_regs)
+    UINTVAL i;
+    Parrot_Context *ctx = get_context_struct_fast(interp, pmcctx);
+
+    /* NULL out registers - P/S have to be NULL for GC
+     *
+     * if the architecture has 0x := NULL and 0.0 we could memset too
+     */
+
+    for (i = 0; i < ctx->n_regs_used[REGNO_PMC]; i++) {
+        ctx->bp_ps.regs_p[-1L - i] = PMCNULL;
+    }
+
+    for (i = 0; i < ctx->n_regs_used[REGNO_STR]; i++) {
+        ctx->bp_ps.regs_s[i] = NULL;
+    }
+
+    if (Interp_debug_TEST(interp, PARROT_REG_DEBUG_FLAG)) {
+        /* depending on -D40, set int and num to identifiable garbage values */
+        for (i = 0; i < ctx->n_regs_used[REGNO_INT]; i++) {
+            ctx->bp.regs_i[i] = -999;
+        }
+
+        for (i = 0; i < ctx->n_regs_used[REGNO_NUM]; i++) {
+            ctx->bp.regs_n[-1L - i] = -99.9;
+        }
+    }
+}
+
+
+/*
+
+=item C<static void init_context(PARROT_INTERP, PMC *pmcctx, PMC *pmcold)>
+
+Initializes a freshly allocated or recycled context.
+
+=cut
+
+*/
+
+static void
+init_context(PARROT_INTERP, ARGMOD(PMC *pmcctx), ARGIN_NULLOK(PMC *pmcold))
+{
+    ASSERT_ARGS(init_context)
+    Parrot_Context *ctx    = get_context_struct_fast(interp, pmcctx);
+
+    /* pmcold may be null */
+    Parrot_Context *old    = PMC_IS_NULL(pmcold)
+                           ? NULL
+                           : get_context_struct_fast(interp, pmcold);
+
+    PARROT_ASSERT(!PMC_IS_NULL(pmcctx) || !"Can't initialise Null CallContext");
+
+    /*
+     * FIXME Invoking corotine shouldn't initialise context. So just
+     * check ctx->current_sub. If it's not null return from here
+     */
+    if (!PMC_IS_NULL(ctx->current_sub))
+        return;
+
+    ctx->current_results   = NULL;
+    ctx->results_signature = NULL;
+    ctx->lex_pad           = PMCNULL;
+    ctx->outer_ctx         = NULL;
+    ctx->current_cont      = NULL;
+    ctx->current_object    = NULL;
+    ctx->handlers          = PMCNULL;
+    ctx->caller_ctx        = NULL;
+    ctx->pred_offset       = 0;
+    ctx->current_sig       = PMCNULL;
+    ctx->current_sub       = PMCNULL;
+
+    if (old) {
+        /* some items should better be COW copied */
+        ctx->constants         = old->constants;
+        ctx->warns             = old->warns;
+        ctx->errors            = old->errors;
+        ctx->trace_flags       = old->trace_flags;
+        ctx->pred_offset       = old->pred_offset;
+        ctx->current_HLL       = old->current_HLL;
+        ctx->current_namespace = old->current_namespace;
+        /* end COW */
+        ctx->recursion_depth   = old->recursion_depth;
+        ctx->caller_ctx        = pmcold;
+    }
+    else {
+        ctx->constants         = NULL;
+        ctx->warns             = 0;
+        ctx->errors            = 0;
+        ctx->trace_flags       = 0;
+        ctx->pred_offset       = 0;
+        ctx->current_HLL       = 0;
+        ctx->current_namespace = PMCNULL;
+        ctx->recursion_depth   = 0;
+    }
+
+    /* other stuff is set inside Sub.invoke */
+    clear_regs(interp, pmcctx);
+}
+
+
+/*
+
+=item C<PMC * Parrot_push_context(PARROT_INTERP, const UINTVAL *n_regs_used)>
+
+Creates and sets the current context to a new context, remembering the old
+context in C<caller_ctx>.  Suitable to use with C<Parrot_pop_context>.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+PMC *
+Parrot_push_context(PARROT_INTERP, ARGIN(const UINTVAL *n_regs_used))
+{
+    ASSERT_ARGS(Parrot_push_context)
+    PMC * const old = CURRENT_CONTEXT(interp);
+    PMC * const ctx = Parrot_set_new_context(interp, n_regs_used);
+
+    /* doesn't change */
+    Parrot_pcc_set_sub(interp, ctx, Parrot_pcc_get_sub(interp, old));
+
+    /* copy more ? */
+    return ctx;
+}
+
+
+/*
+
+=item C<void Parrot_pop_context(PARROT_INTERP)>
+
+Frees the context created with C<Parrot_push_context> and restores the previous
+context (the caller context).
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_pop_context(PARROT_INTERP)
+{
+    ASSERT_ARGS(Parrot_pop_context)
+    PMC * const ctx = CURRENT_CONTEXT(interp);
+    PMC * const old = Parrot_pcc_get_caller_ctx(interp, ctx);
+
+    /* restore old, set cached interpreter base pointers */
+    CURRENT_CONTEXT(interp) = old;
+}
+
+/*
+
+=item C<static size_t calculate_registers_size(PARROT_INTERP, const UINTVAL
+*number_regs_used)>
+
+Calculate memory size required for registers.
+
+=cut
+
+*/
+static size_t
+calculate_registers_size(SHIM_INTERP, ARGIN(const UINTVAL *number_regs_used))
+{
+    ASSERT_ARGS(calculate_registers_size)
+
+    return ROUND_ALLOC_SIZE(
+            sizeof (INTVAL)   * number_regs_used[REGNO_INT] +
+            sizeof (FLOATVAL) * number_regs_used[REGNO_NUM] +
+            sizeof (STRING *) * number_regs_used[REGNO_STR] +
+            sizeof (PMC *)    * number_regs_used[REGNO_PMC]);
+}
+
+
+/*
+
+=item C<static size_t Parrot_pcc_calculate_registers_size(PARROT_INTERP, const
+UINTVAL *number_regs_used)>
+
+Calculate size of Context.
+
+=cut
+
+*/
+
+static size_t
+Parrot_pcc_calculate_registers_size(PARROT_INTERP, ARGIN(const UINTVAL *number_regs_used))
+{
+    ASSERT_ARGS(Parrot_pcc_calculate_registers_size)
+    return calculate_registers_size(interp, number_regs_used);
+}
+
+/*
+
+=item C<static void allocate_registers(PARROT_INTERP, PMC *pmcctx, const UINTVAL
+*number_regs_used)>
+
+Allocate registers inside Context.
+
+=cut
+
+*/
+static void
+allocate_registers(PARROT_INTERP, ARGIN(PMC *pmcctx), ARGIN(const UINTVAL *number_regs_used))
+{
+    ASSERT_ARGS(allocate_registers)
+    Parrot_CallContext_attributes *ctx = PARROT_CALLCONTEXT(pmcctx);
+
+    const size_t size_i = sizeof (INTVAL)   * number_regs_used[REGNO_INT];
+    const size_t size_n = sizeof (FLOATVAL) * number_regs_used[REGNO_NUM];
+    const size_t size_s = sizeof (STRING *) * number_regs_used[REGNO_STR];
+    const size_t size_p = sizeof (PMC *)    * number_regs_used[REGNO_PMC];
+
+    const size_t size_nip      = size_n + size_i + size_p;
+    const size_t all_regs_size = size_n + size_i + size_p + size_s;
+    const size_t reg_alloc     = ROUND_ALLOC_SIZE(all_regs_size);
+
+    /* don't allocate any storage if there are no registers */
+    ctx->registers = reg_alloc
+        ? (Parrot_Context *)Parrot_gc_allocate_fixed_size_storage(interp, reg_alloc)
+        : NULL;
+
+    ctx->n_regs_used[REGNO_INT] = number_regs_used[REGNO_INT];
+    ctx->n_regs_used[REGNO_NUM] = number_regs_used[REGNO_NUM];
+    ctx->n_regs_used[REGNO_STR] = number_regs_used[REGNO_STR];
+    ctx->n_regs_used[REGNO_PMC] = number_regs_used[REGNO_PMC];
+
+    /* ctx.bp points to I0, which has Nx on the left */
+    ctx->bp.regs_i = (INTVAL *)((char *)ctx->registers + size_n);
+
+    /* ctx.bp_ps points to S0, which has Px on the left */
+    ctx->bp_ps.regs_s = (STRING **)((char *)ctx->registers + size_nip);
+
+    clear_regs(interp, pmcctx);
+}
+
+
+/*
+
+=item C<void Parrot_pcc_allocate_registers(PARROT_INTERP, PMC *pmcctx, const
+UINTVAL *number_regs_used)>
+
+Allocate registers in Context.
+
+=cut
+
+*/
+
+void
+Parrot_pcc_allocate_registers(PARROT_INTERP, ARGIN(PMC *pmcctx),
+        ARGIN(const UINTVAL *number_regs_used))
+{
+    ASSERT_ARGS(Parrot_pcc_allocate_registers)
+    allocate_registers(interp, pmcctx, number_regs_used);
+}
+
+
+/*
+
+=item C<void Parrot_pcc_free_registers(PARROT_INTERP, PMC *pmcctx)>
+
+Free memory allocated for registers in Context.
+
+=cut
+
+*/
+
+void
+Parrot_pcc_free_registers(PARROT_INTERP, ARGIN(PMC *pmcctx))
+{
+    ASSERT_ARGS(Parrot_pcc_free_registers)
+    Parrot_CallContext_attributes * const ctx = PARROT_CALLCONTEXT(pmcctx);
+    size_t reg_size;
+
+    if (!ctx)
+        return;
+
+    reg_size = Parrot_pcc_calculate_registers_size(interp, ctx->n_regs_used);
+    if (!reg_size)
+        return;
+
+    /* Free registers */
+    Parrot_gc_free_fixed_size_storage(interp, reg_size, ctx->registers);
+
+}
+
+
+/*
+
+=item C<PMC * Parrot_alloc_context(PARROT_INTERP, const UINTVAL
+*number_regs_used, PMC *old)>
+
+Allocates and returns a new context.  Does not set this new context as the
+current context. Note that the register usage C<n_regs_used> is copied.  Use
+the init flag to indicate whether you want to initialize the new context
+(setting its default values and clearing its registers).
+
+TODO: Remove this function!
+
+=cut
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+PARROT_WARN_UNUSED_RESULT
+PMC *
+Parrot_alloc_context(PARROT_INTERP, ARGIN(const UINTVAL *number_regs_used),
+    ARGIN_NULLOK(PMC *old))
+{
+    ASSERT_ARGS(Parrot_alloc_context)
+    PMC            *pmcctx = pmc_new(interp, enum_class_CallContext);
+
+    allocate_registers(interp, pmcctx, number_regs_used);
+    init_context(interp, pmcctx, old);
+
+    return pmcctx;
+}
+
+
+/*
+
+=item C<PMC * Parrot_pcc_allocate_empty_context(PARROT_INTERP, PMC *old)>
+
+Allocates and returns a new context.  Does not set this new context as the
+current context.
+
+=cut
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+PARROT_WARN_UNUSED_RESULT
+PMC *
+Parrot_pcc_allocate_empty_context(PARROT_INTERP, ARGIN_NULLOK(PMC *old))
+{
+    ASSERT_ARGS(Parrot_pcc_allocate_empty_context)
+    PMC            *pmcctx = pmc_new(interp, enum_class_CallContext);
+
+    init_context(interp, pmcctx, old);
+
+    return pmcctx;
+}
+
+/*
+
+=item C<PMC * Parrot_pcc_init_context(PARROT_INTERP, PMC *ctx, PMC *old)>
+
+Initialise new context from old.
+
+=cut
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+PMC *
+Parrot_pcc_init_context(PARROT_INTERP, ARGIN(PMC *ctx), ARGIN_NULLOK(PMC *old))
+{
+    ASSERT_ARGS(Parrot_pcc_init_context)
+
+    init_context(interp, ctx, old);
+
+    return ctx;
+}
+
+/*
+
+=item C<PMC * Parrot_set_new_context(PARROT_INTERP, const UINTVAL
+*number_regs_used)>
+
+Allocates and returns a new context as the current context.  Note that the
+register usage C<n_regs_used> is copied.
+
+=cut
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+PARROT_WARN_UNUSED_RESULT
+PMC *
+Parrot_set_new_context(PARROT_INTERP, ARGIN(const UINTVAL *number_regs_used))
+{
+    ASSERT_ARGS(Parrot_set_new_context)
+    PMC *old = CURRENT_CONTEXT(interp);
+    PMC *ctx = Parrot_alloc_context(interp, number_regs_used, old);
+
+    CURRENT_CONTEXT(interp) = ctx;
+
+    return ctx;
+}
+
+
+/*
+
+=back
+
+=head2 Register Stack Functions
+
+=over 4
+
+=cut
+
+=item C<void Parrot_clear_i(PARROT_INTERP)>
+
+Sets all integer registers in the current context to 0.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_clear_i(PARROT_INTERP)
+{
+    ASSERT_ARGS(Parrot_clear_i)
+    UINTVAL i;
+    for (i = 0; i < Parrot_pcc_get_regs_used(interp, CURRENT_CONTEXT(interp), REGNO_INT); ++i)
+        REG_INT(interp, i) = 0;
+}
+
+
+/*
+
+=item C<void Parrot_clear_s(PARROT_INTERP)>
+
+Sets all STRING registers in the current context to NULL.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_clear_s(PARROT_INTERP)
+{
+    ASSERT_ARGS(Parrot_clear_s)
+    UINTVAL i;
+    for (i = 0; i < Parrot_pcc_get_regs_used(interp, CURRENT_CONTEXT(interp), REGNO_STR); ++i)
+        REG_STR(interp, i) = NULL;
+}
+
+
+/*
+
+=item C<void Parrot_clear_p(PARROT_INTERP)>
+
+Sets all PMC registers in the current context to NULL.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_clear_p(PARROT_INTERP)
+{
+    ASSERT_ARGS(Parrot_clear_p)
+    UINTVAL i;
+    for (i = 0; i < Parrot_pcc_get_regs_used(interp, CURRENT_CONTEXT(interp), REGNO_PMC); ++i)
+        REG_PMC(interp, i) = PMCNULL;
+}
+
+
+/*
+
+=item C<void Parrot_clear_n(PARROT_INTERP)>
+
+Sets all number registers in the current context to 0.0.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_clear_n(PARROT_INTERP)
+{
+    ASSERT_ARGS(Parrot_clear_n)
+    UINTVAL i;
+    for (i = 0; i < Parrot_pcc_get_regs_used(interp, CURRENT_CONTEXT(interp), REGNO_NUM); ++i)
+        REG_NUM(interp, i) = 0.0;
+}
+
+/*
+
+=item C<INTVAL * Parrot_pcc_get_INTVAL_reg(PARROT_INTERP, PMC *ctx, UINTVAL
+idx)>
+
+Get pointer to INTVAL register.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_CANNOT_RETURN_NULL
+INTVAL *
+Parrot_pcc_get_INTVAL_reg(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL idx)
+{
+    ASSERT_ARGS(Parrot_pcc_get_INTVAL_reg)
+    PARROT_ASSERT(Parrot_pcc_get_regs_used(interp, ctx, REGNO_INT) > idx);
+    return &(get_context_struct_fast(interp, ctx)->bp.regs_i[idx]);
+}
+
+/*
+
+=item C<FLOATVAL * Parrot_pcc_get_FLOATVAL_reg(PARROT_INTERP, PMC *ctx, UINTVAL
+idx)>
+
+Get pointer to FLOATVAL register.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_CANNOT_RETURN_NULL
+FLOATVAL *
+Parrot_pcc_get_FLOATVAL_reg(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL idx)
+{
+    ASSERT_ARGS(Parrot_pcc_get_FLOATVAL_reg)
+    PARROT_ASSERT(Parrot_pcc_get_regs_used(interp, ctx, REGNO_NUM) > idx);
+    return &(get_context_struct_fast(interp, ctx)->bp.regs_n[-1L - idx]);
+}
+
+/*
+
+=item C<STRING ** Parrot_pcc_get_STRING_reg(PARROT_INTERP, PMC *ctx, UINTVAL
+idx)>
+
+Get pointer to STRING register.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_CANNOT_RETURN_NULL
+STRING **
+Parrot_pcc_get_STRING_reg(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL idx)
+{
+    ASSERT_ARGS(Parrot_pcc_get_STRING_reg)
+    PARROT_ASSERT(Parrot_pcc_get_regs_used(interp, ctx, REGNO_STR) > idx);
+    return &(get_context_struct_fast(interp, ctx)->bp_ps.regs_s[idx]);
+}
+
+/*
+
+=item C<PMC ** Parrot_pcc_get_PMC_reg(PARROT_INTERP, PMC *ctx, UINTVAL idx)>
+
+Get pointer to PMC register.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_CANNOT_RETURN_NULL
+PMC **
+Parrot_pcc_get_PMC_reg(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL idx)
+{
+    ASSERT_ARGS(Parrot_pcc_get_PMC_reg)
+    PARROT_ASSERT(Parrot_pcc_get_regs_used(interp, ctx, REGNO_PMC) > idx);
+    return &(get_context_struct_fast(interp, ctx)->bp_ps.regs_p[-1L - idx]);
+}
+
+/*
+
+=item C<UINTVAL Parrot_pcc_get_regs_used(PARROT_INTERP, PMC *ctx, int type)>
+
+Return number of used registers of particular type.
+
+=cut
+
+*/
+PARROT_EXPORT
+UINTVAL
+Parrot_pcc_get_regs_used(PARROT_INTERP, ARGIN(PMC *ctx), int type)
+{
+    ASSERT_ARGS(Parrot_pcc_get_regs_used)
+    return get_context_struct_fast(interp, ctx)->n_regs_used[type];
+}
+
+/*
+
+=item C<void Parrot_pcc_set_regs_used(PARROT_INTERP, PMC *ctx, int type, INTVAL
+num)>
+
+Set number of used registers of particular type.
+
+=cut
+
+*/
+PARROT_EXPORT
+void
+Parrot_pcc_set_regs_used(PARROT_INTERP, ARGIN(PMC *ctx), int type, INTVAL num)
+{
+    ASSERT_ARGS(Parrot_pcc_set_regs_used)
+    get_context_struct_fast(interp, ctx)->n_regs_used[type] = num;
+}
+
+/*
+
+=item C<Regs_ni* Parrot_pcc_get_regs_ni(PARROT_INTERP, PMC *ctx)>
+
+Get pointer to FLOANFAL and INTVAL registers.
+
+=cut
+
+*/
+PARROT_EXPORT
+PARROT_CANNOT_RETURN_NULL
+Regs_ni*
+Parrot_pcc_get_regs_ni(PARROT_INTERP, ARGIN(PMC *ctx))
+{
+    ASSERT_ARGS(Parrot_pcc_get_regs_ni)
+    return &(get_context_struct_fast(interp, ctx)->bp);
+}
+
+/*
+
+=item C<void Parrot_pcc_set_regs_ni(PARROT_INTERP, PMC *ctx, Regs_ni *bp)>
+
+Copy Regs_ni into Context.
+
+=cut
+
+*/
+PARROT_EXPORT
+PARROT_CANNOT_RETURN_NULL
+void
+Parrot_pcc_set_regs_ni(PARROT_INTERP, ARGIN(PMC *ctx), ARGIN(Regs_ni *bp))
+{
+    ASSERT_ARGS(Parrot_pcc_set_regs_ni)
+    get_context_struct_fast(interp, ctx)->bp = *bp;
+}
+
+/*
+
+=item C<Regs_ps* Parrot_pcc_get_regs_ps(PARROT_INTERP, PMC *ctx)>
+
+Get pointer to PMC and STRING registers.
+
+=cut
+
+*/
+PARROT_EXPORT
+PARROT_CANNOT_RETURN_NULL
+Regs_ps*
+Parrot_pcc_get_regs_ps(PARROT_INTERP, ARGIN(PMC *ctx))
+{
+    ASSERT_ARGS(Parrot_pcc_get_regs_ps)
+    return &(get_context_struct_fast(interp, ctx)->bp_ps);
+}
+
+/*
+
+=item C<void Parrot_pcc_set_regs_ps(PARROT_INTERP, PMC *ctx, Regs_ps *bp_ps)>
+
+Copy Regs_ps into Context.
+
+=cut
+
+*/
+PARROT_EXPORT
+PARROT_CANNOT_RETURN_NULL
+void
+Parrot_pcc_set_regs_ps(PARROT_INTERP, ARGIN(PMC *ctx), ARGIN(Regs_ps *bp_ps))
+{
+    ASSERT_ARGS(Parrot_pcc_set_regs_ps)
+    get_context_struct_fast(interp, ctx)->bp_ps = *bp_ps;
+}
+
+
+/*
+
+=back
+
+*/
+
+
+/*
+ * Local variables:
+ *   c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */

Added: branches/orderedhash_revamp/src/call/context_accessors.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/src/call/context_accessors.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,854 @@
+/*
+Copyright (C) 2009, Parrot Foundation.
+$Id$
+
+=head1 NAME
+
+src/context.c
+
+=head1 DESCRIPTION
+
+Parrot_Context functions.
+
+=cut
+
+*/
+
+#include "parrot/parrot.h"
+
+/* HEADERIZER HFILE: include/parrot/context.h */
+
+/* HEADERIZER BEGIN: static */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+
+PARROT_INLINE
+PARROT_CANNOT_RETURN_NULL
+static Parrot_Context * get_context_struct_fast(PARROT_INTERP,
+    ARGIN(PMC *ctx))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+#define ASSERT_ARGS_get_context_struct_fast __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ctx))
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+/* HEADERIZER END: static */
+
+/*
+
+=head2 Context API Functions
+
+=over 4
+
+=item C<Parrot_Context* Parrot_pcc_get_context_struct_func(PARROT_INTERP, PMC
+*ctx)>
+
+Fetch Parrot_Context from Context PMC.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+Parrot_Context*
+Parrot_pcc_get_context_struct_func(PARROT_INTERP, ARGIN_NULLOK(PMC *ctx))
+{
+    ASSERT_ARGS(Parrot_pcc_get_context_struct_func)
+
+    if (PMC_IS_NULL(ctx))
+        return NULL;
+
+    return get_context_struct_fast(interp, ctx);
+}
+
+/*
+
+=item C<struct PackFile_Constant ** Parrot_pcc_get_constants_func(PARROT_INTERP,
+PMC *ctx)>
+
+=item C<void Parrot_pcc_set_constants_func(PARROT_INTERP, PMC *ctx, struct
+PackFile_Constant **constants)>
+
+Get/set constants from context.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_CANNOT_RETURN_NULL
+struct PackFile_Constant **
+Parrot_pcc_get_constants_func(PARROT_INTERP, ARGIN(PMC *ctx))
+{
+    ASSERT_ARGS(Parrot_pcc_get_constants_func)
+    return get_context_struct_fast(interp, ctx)->constants;
+}
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+void
+Parrot_pcc_set_constants_func(PARROT_INTERP, ARGIN(PMC *ctx),
+        ARGIN_NULLOK(struct PackFile_Constant **constants))
+{
+    ASSERT_ARGS(Parrot_pcc_set_constants_func)
+    Parrot_Context * c = get_context_struct_fast(interp, ctx);
+    c->constants = constants;
+}
+
+/*
+
+=item C<UINTVAL Parrot_pcc_get_recursion_depth_func(PARROT_INTERP, PMC *ctx)>
+
+Get recursion depth from context.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+UINTVAL
+Parrot_pcc_get_recursion_depth_func(PARROT_INTERP, ARGIN(PMC *ctx))
+{
+    ASSERT_ARGS(Parrot_pcc_get_recursion_depth_func)
+    Parrot_Context const *c = get_context_struct_fast(interp, ctx);
+    return c->recursion_depth;
+}
+
+/*
+
+=item C<UINTVAL Parrot_pcc_inc_recursion_depth_func(PARROT_INTERP, PMC *ctx)>
+
+Increase recursion depth. Returns previous recursion_depth value.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+UINTVAL
+Parrot_pcc_inc_recursion_depth_func(PARROT_INTERP, ARGIN(PMC *ctx))
+{
+    ASSERT_ARGS(Parrot_pcc_inc_recursion_depth_func)
+    Parrot_Context *c = get_context_struct_fast(interp, ctx);
+    return c->recursion_depth++;
+}
+
+/*
+
+=item C<UINTVAL Parrot_pcc_dec_recursion_depth_func(PARROT_INTERP, PMC *ctx)>
+
+Decrease recursion depth. Returns new recursion_depth value.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+UINTVAL
+Parrot_pcc_dec_recursion_depth_func(PARROT_INTERP, ARGIN(PMC *ctx))
+{
+    ASSERT_ARGS(Parrot_pcc_dec_recursion_depth_func)
+    Parrot_Context *c = get_context_struct_fast(interp, ctx);
+    return --c->recursion_depth;
+}
+
+/*
+
+=item C<PMC* Parrot_pcc_get_caller_ctx_func(PARROT_INTERP, PMC *ctx)>
+
+=item C<void Parrot_pcc_set_caller_ctx_func(PARROT_INTERP, PMC *ctx, PMC
+*caller_ctx)>
+
+Get/set caller Context.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+PMC*
+Parrot_pcc_get_caller_ctx_func(PARROT_INTERP, ARGIN(PMC *ctx))
+{
+    ASSERT_ARGS(Parrot_pcc_get_caller_ctx_func)
+    Parrot_Context const *c = get_context_struct_fast(interp, ctx);
+    return c->caller_ctx;
+}
+
+PARROT_EXPORT
+void
+Parrot_pcc_set_caller_ctx_func(PARROT_INTERP, ARGIN(PMC *ctx), ARGIN(PMC *caller_ctx))
+{
+    ASSERT_ARGS(Parrot_pcc_set_caller_ctx_func)
+    Parrot_Context *c = get_context_struct_fast(interp, ctx);
+    c->caller_ctx = caller_ctx;
+}
+
+/*
+
+=item C<PMC* Parrot_pcc_get_outer_ctx_func(PARROT_INTERP, PMC *ctx)>
+
+=item C<void Parrot_pcc_set_outer_ctx_func(PARROT_INTERP, PMC *ctx, PMC
+*outer_ctx)>
+
+Get/set outer Context.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+PMC*
+Parrot_pcc_get_outer_ctx_func(PARROT_INTERP, ARGIN(PMC *ctx))
+{
+    ASSERT_ARGS(Parrot_pcc_get_outer_ctx_func)
+    Parrot_Context const *c = get_context_struct_fast(interp, ctx);
+    return c->outer_ctx;
+}
+
+PARROT_EXPORT
+void
+Parrot_pcc_set_outer_ctx_func(PARROT_INTERP, ARGIN(PMC *ctx), ARGIN(PMC *outer_ctx))
+{
+    ASSERT_ARGS(Parrot_pcc_set_outer_ctx_func)
+    Parrot_Context *c = get_context_struct_fast(interp, ctx);
+    c->outer_ctx = outer_ctx;
+}
+
+/*
+
+=item C<PMC* Parrot_pcc_get_lex_pad_func(PARROT_INTERP, PMC *ctx)>
+
+=item C<void Parrot_pcc_set_lex_pad_func(PARROT_INTERP, PMC *ctx, PMC *lex_pad)>
+
+Get/set LexPad.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_CANNOT_RETURN_NULL
+PMC*
+Parrot_pcc_get_lex_pad_func(PARROT_INTERP, ARGIN(PMC *ctx))
+{
+    ASSERT_ARGS(Parrot_pcc_get_lex_pad_func)
+    Parrot_Context const *c = get_context_struct_fast(interp, ctx);
+    return c->lex_pad;
+}
+
+PARROT_EXPORT
+void
+Parrot_pcc_set_lex_pad_func(PARROT_INTERP, ARGIN(PMC *ctx), ARGIN(PMC *lex_pad))
+{
+    ASSERT_ARGS(Parrot_pcc_set_lex_pad_func)
+    Parrot_Context *c = get_context_struct_fast(interp, ctx);
+    c->lex_pad = lex_pad;
+}
+
+/*
+
+=item C<PMC* Parrot_pcc_get_namespace_func(PARROT_INTERP, PMC *ctx)>
+
+=item C<void Parrot_pcc_set_namespace_func(PARROT_INTERP, PMC *ctx, PMC
+*_namespace)>
+
+Get/set namespace of Context.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+PMC*
+Parrot_pcc_get_namespace_func(PARROT_INTERP, ARGIN(PMC *ctx))
+{
+    ASSERT_ARGS(Parrot_pcc_get_namespace_func)
+    Parrot_Context const *c = get_context_struct_fast(interp, ctx);
+    return c->current_namespace;
+}
+
+PARROT_EXPORT
+void
+Parrot_pcc_set_namespace_func(PARROT_INTERP, ARGIN(PMC *ctx), ARGIN_NULLOK(PMC *_namespace))
+{
+    ASSERT_ARGS(Parrot_pcc_set_namespace_func)
+    Parrot_Context *c = get_context_struct_fast(interp, ctx);
+    c->current_namespace = _namespace;
+}
+
+/*
+
+=item C<INTVAL Parrot_pcc_get_HLL_func(PARROT_INTERP, PMC *ctx)>
+
+=item C<void Parrot_pcc_set_HLL_func(PARROT_INTERP, PMC *ctx, INTVAL hll)>
+
+Get/set HLL of Context.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+INTVAL
+Parrot_pcc_get_HLL_func(PARROT_INTERP, ARGIN(PMC *ctx))
+{
+    ASSERT_ARGS(Parrot_pcc_get_HLL_func)
+    Parrot_Context const *c = get_context_struct_fast(interp, ctx);
+    return c->current_HLL;
+}
+
+PARROT_EXPORT
+void
+Parrot_pcc_set_HLL_func(PARROT_INTERP, ARGIN(PMC *ctx), INTVAL hll)
+{
+    ASSERT_ARGS(Parrot_pcc_set_HLL_func)
+    Parrot_Context *c = get_context_struct_fast(interp, ctx);
+    c->current_HLL = hll;
+}
+
+/*
+
+=item C<PMC* Parrot_pcc_get_handlers_func(PARROT_INTERP, PMC *ctx)>
+
+=item C<void Parrot_pcc_set_handlers_func(PARROT_INTERP, PMC *ctx, PMC
+*handlers)>
+
+Get/set scheduler handlers.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+PMC*
+Parrot_pcc_get_handlers_func(PARROT_INTERP, ARGIN(PMC *ctx))
+{
+    ASSERT_ARGS(Parrot_pcc_get_handlers_func)
+    Parrot_Context const *c = get_context_struct_fast(interp, ctx);
+    return c->handlers;
+}
+
+
+PARROT_EXPORT
+void
+Parrot_pcc_set_handlers_func(PARROT_INTERP, ARGIN(PMC *ctx), ARGIN(PMC *handlers))
+{
+    ASSERT_ARGS(Parrot_pcc_set_handlers_func)
+    Parrot_Context *c = get_context_struct_fast(interp, ctx);
+    c->handlers = handlers;
+}
+
+/*
+
+=item C<PMC* Parrot_pcc_get_continuation_func(PARROT_INTERP, PMC *ctx)>
+
+=item C<void Parrot_pcc_set_continuation_func(PARROT_INTERP, PMC *ctx, PMC
+*_continuation)>
+
+Get/set continuation of Context.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+PMC*
+Parrot_pcc_get_continuation_func(PARROT_INTERP, ARGIN(PMC *ctx))
+{
+    ASSERT_ARGS(Parrot_pcc_get_continuation_func)
+    Parrot_Context const *c = get_context_struct_fast(interp, ctx);
+    return c->current_cont;
+}
+
+PARROT_EXPORT
+void
+Parrot_pcc_set_continuation_func(PARROT_INTERP, ARGIN(PMC *ctx), ARGIN_NULLOK(PMC *_continuation))
+{
+    ASSERT_ARGS(Parrot_pcc_set_continuation_func)
+    Parrot_Context *c = get_context_struct_fast(interp, ctx);
+    c->current_cont = _continuation;
+}
+
+/*
+
+=item C<PMC* Parrot_pcc_get_signature_func(PARROT_INTERP, PMC *ctx)>
+
+=item C<void Parrot_pcc_set_signature_func(PARROT_INTERP, PMC *ctx, PMC
+*sig_object)>
+
+Get/set call signature object of Context (in sub/method call).
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+PMC*
+Parrot_pcc_get_signature_func(PARROT_INTERP, ARGIN(PMC *ctx))
+{
+    ASSERT_ARGS(Parrot_pcc_get_signature_func)
+    Parrot_Context const *c = get_context_struct_fast(interp, ctx);
+    return c->current_sig;
+}
+
+PARROT_EXPORT
+void
+Parrot_pcc_set_signature_func(PARROT_INTERP, ARGIN(PMC *ctx), ARGIN_NULLOK(PMC *sig_object))
+{
+    ASSERT_ARGS(Parrot_pcc_set_signature_func)
+    Parrot_Context *c = get_context_struct_fast(interp, ctx);
+    c->current_sig = sig_object;
+}
+
+/*
+
+=item C<PMC* Parrot_pcc_get_object_func(PARROT_INTERP, PMC *ctx)>
+
+=item C<void Parrot_pcc_set_object_func(PARROT_INTERP, PMC *ctx, PMC *object)>
+
+Get object of Context (in method call).
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+PMC*
+Parrot_pcc_get_object_func(PARROT_INTERP, ARGIN(PMC *ctx))
+{
+    ASSERT_ARGS(Parrot_pcc_get_object_func)
+    Parrot_Context const *c = get_context_struct_fast(interp, ctx);
+    return c->current_object;
+}
+
+PARROT_EXPORT
+void
+Parrot_pcc_set_object_func(PARROT_INTERP, ARGIN(PMC *ctx), ARGIN_NULLOK(PMC *object))
+{
+    ASSERT_ARGS(Parrot_pcc_set_object_func)
+    Parrot_Context *c = get_context_struct_fast(interp, ctx);
+    c->current_object = object;
+}
+
+/*
+
+=item C<opcode_t* Parrot_pcc_get_pc_func(PARROT_INTERP, PMC *ctx)>
+
+=item C<void Parrot_pcc_set_pc_func(PARROT_INTERP, PMC *ctx, opcode_t *pc)>
+
+Get/set program counter of Sub invocation.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+opcode_t*
+Parrot_pcc_get_pc_func(PARROT_INTERP, ARGIN(PMC *ctx))
+{
+    ASSERT_ARGS(Parrot_pcc_get_pc_func)
+    Parrot_Context const *c = get_context_struct_fast(interp, ctx);
+    return c->current_pc;
+}
+
+PARROT_EXPORT
+void
+Parrot_pcc_set_pc_func(PARROT_INTERP, ARGIN(PMC *ctx), ARGIN_NULLOK(opcode_t *pc))
+{
+    ASSERT_ARGS(Parrot_pcc_set_pc_func)
+    Parrot_Context *c = get_context_struct_fast(interp, ctx);
+    c->current_pc = pc;
+}
+
+/*
+
+=item C<opcode_t* Parrot_pcc_get_results_func(PARROT_INTERP, PMC *ctx)>
+
+=item C<void Parrot_pcc_set_results_func(PARROT_INTERP, PMC *ctx, opcode_t *pc)>
+
+Get/set ptr into code with get_results opcode.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+opcode_t*
+Parrot_pcc_get_results_func(PARROT_INTERP, ARGIN(PMC *ctx))
+{
+    ASSERT_ARGS(Parrot_pcc_get_results_func)
+    Parrot_Context const *c = get_context_struct_fast(interp, ctx);
+    return c->current_results;
+}
+
+PARROT_EXPORT
+void
+Parrot_pcc_set_results_func(PARROT_INTERP, ARGIN(PMC *ctx), ARGIN_NULLOK(opcode_t *pc))
+{
+    ASSERT_ARGS(Parrot_pcc_set_results_func)
+    Parrot_Context *c = get_context_struct_fast(interp, ctx);
+    c->current_results = pc;
+}
+
+/*
+
+=item C<PMC* Parrot_pcc_get_results_signature_func(PARROT_INTERP, PMC *ctx)>
+
+=item C<void Parrot_pcc_set_results_signature_func(PARROT_INTERP, PMC *ctx, PMC
+*sig)>
+
+Get/set ptr into code with get_results opcode.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+PMC*
+Parrot_pcc_get_results_signature_func(PARROT_INTERP, ARGIN(PMC *ctx))
+{
+    ASSERT_ARGS(Parrot_pcc_get_results_signature_func)
+    Parrot_Context const *c = get_context_struct_fast(interp, ctx);
+    return c->results_signature;
+}
+
+PARROT_EXPORT
+void
+Parrot_pcc_set_results_signature_func(PARROT_INTERP, ARGIN(PMC *ctx), ARGIN_NULLOK(PMC *sig))
+{
+    ASSERT_ARGS(Parrot_pcc_set_results_signature_func)
+    Parrot_Context *c = get_context_struct_fast(interp, ctx);
+    PARROT_ASSERT(PMC_IS_NULL(sig) || PObj_is_PMC_TEST(sig));
+    c->results_signature = sig;
+}
+
+
+/*
+
+=item C<size_t Parrot_pcc_get_pred_offset_func(PARROT_INTERP, PMC *ctx)>
+
+=item C<void Parrot_pcc_set_pred_offset_func(PARROT_INTERP, PMC *ctx, size_t
+pred_offset)>
+
+Get/set pred_offset
+
+=cut
+
+*/
+
+PARROT_EXPORT
+size_t
+Parrot_pcc_get_pred_offset_func(PARROT_INTERP, ARGIN(PMC *ctx))
+{
+    ASSERT_ARGS(Parrot_pcc_get_pred_offset_func)
+    Parrot_Context const *c = get_context_struct_fast(interp, ctx);
+    return c->pred_offset;
+}
+
+PARROT_EXPORT
+void
+Parrot_pcc_set_pred_offset_func(PARROT_INTERP, ARGIN(PMC *ctx), size_t pred_offset)
+{
+    ASSERT_ARGS(Parrot_pcc_set_pred_offset_func)
+    Parrot_Context *c = get_context_struct_fast(interp, ctx);
+    c->pred_offset = pred_offset;
+}
+
+
+/*
+
+=item C<UINTVAL Parrot_pcc_warnings_on_func(PARROT_INTERP, PMC *ctx, UINTVAL
+flags)>
+
+Set warnings flags.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+UINTVAL
+Parrot_pcc_warnings_on_func(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
+{
+    ASSERT_ARGS(Parrot_pcc_warnings_on_func)
+    Parrot_Context *c = get_context_struct_fast(interp, ctx);
+    c->warns |= flags;
+    return c->warns;
+}
+
+
+/*
+
+=item C<void Parrot_pcc_warnings_off_func(PARROT_INTERP, PMC *ctx, UINTVAL
+flags)>
+
+Clear warnings flags.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_pcc_warnings_off_func(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
+{
+    ASSERT_ARGS(Parrot_pcc_warnings_off_func)
+    Parrot_Context *c = get_context_struct_fast(interp, ctx);
+    c->warns &= ~flags;
+}
+
+
+/*
+
+=item C<UINTVAL Parrot_pcc_warnings_test_func(PARROT_INTERP, PMC *ctx, UINTVAL
+flags)>
+
+Test warnings flags.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+UINTVAL
+Parrot_pcc_warnings_test_func(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
+{
+    ASSERT_ARGS(Parrot_pcc_warnings_test_func)
+    Parrot_Context *c = get_context_struct_fast(interp, ctx);
+    return c->warns & flags;
+}
+
+/*
+
+=item C<void Parrot_pcc_errors_on_func(PARROT_INTERP, PMC *ctx, UINTVAL flags)>
+
+Set errors flags.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_pcc_errors_on_func(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
+{
+    ASSERT_ARGS(Parrot_pcc_errors_on_func)
+    Parrot_Context *c = get_context_struct_fast(interp, ctx);
+    c->errors |= flags;
+}
+
+
+/*
+
+=item C<void Parrot_pcc_errors_off_func(PARROT_INTERP, PMC *ctx, UINTVAL flags)>
+
+Clear errors flags.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_pcc_errors_off_func(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
+{
+    ASSERT_ARGS(Parrot_pcc_errors_off_func)
+    Parrot_Context *c = get_context_struct_fast(interp, ctx);
+    c->errors &= ~flags;
+}
+
+/*
+
+=item C<UINTVAL Parrot_pcc_errors_test_func(PARROT_INTERP, PMC *ctx, UINTVAL
+flags)>
+
+Test errors flags.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+UINTVAL
+Parrot_pcc_errors_test_func(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
+{
+    ASSERT_ARGS(Parrot_pcc_errors_test_func)
+    Parrot_Context *c = get_context_struct_fast(interp, ctx);
+    return c->errors & flags;
+}
+
+/*
+
+=item C<void Parrot_pcc_trace_flags_on_func(PARROT_INTERP, PMC *ctx, UINTVAL
+flags)>
+
+Set trace flags.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_pcc_trace_flags_on_func(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
+{
+    ASSERT_ARGS(Parrot_pcc_trace_flags_on_func)
+    Parrot_Context *c = get_context_struct_fast(interp, ctx);
+    c->trace_flags |= flags;
+}
+
+
+/*
+
+=item C<void Parrot_pcc_trace_flags_off_func(PARROT_INTERP, PMC *ctx, UINTVAL
+flags)>
+
+Clear trace flags.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_pcc_trace_flags_off_func(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
+{
+    ASSERT_ARGS(Parrot_pcc_trace_flags_off_func)
+    Parrot_Context *c = get_context_struct_fast(interp, ctx);
+    c->trace_flags &= ~flags;
+}
+
+/*
+
+=item C<UINTVAL Parrot_pcc_trace_flags_test_func(PARROT_INTERP, PMC *ctx,
+UINTVAL flags)>
+
+Test trace flags.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+UINTVAL
+Parrot_pcc_trace_flags_test_func(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
+{
+    ASSERT_ARGS(Parrot_pcc_trace_flags_test_func)
+    Parrot_Context *c = get_context_struct_fast(interp, ctx);
+    return c->trace_flags & flags;
+}
+
+
+/*
+
+=item C<INTVAL Parrot_pcc_get_int_constant_func(PARROT_INTERP, PMC *ctx, INTVAL
+idx)>
+
+=item C<FLOATVAL Parrot_pcc_get_num_constant_func(PARROT_INTERP, PMC *ctx,
+INTVAL idx)>
+
+=item C<STRING* Parrot_pcc_get_string_constant_func(PARROT_INTERP, PMC *ctx,
+INTVAL idx)>
+
+=item C<PMC* Parrot_pcc_get_pmc_constant_func(PARROT_INTERP, PMC *ctx, INTVAL
+idx)>
+
+Get typed constant from context.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+INTVAL
+Parrot_pcc_get_int_constant_func(PARROT_INTERP, ARGIN(PMC *ctx), INTVAL idx)
+{
+    ASSERT_ARGS(Parrot_pcc_get_int_constant_func)
+    Parrot_Context const * c = get_context_struct_fast(interp, ctx);
+    return c->constants[idx]->u.integer;
+}
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+FLOATVAL
+Parrot_pcc_get_num_constant_func(PARROT_INTERP, ARGIN(PMC *ctx), INTVAL idx)
+{
+    ASSERT_ARGS(Parrot_pcc_get_num_constant_func)
+    Parrot_Context const * c = get_context_struct_fast(interp, ctx);
+    return c->constants[idx]->u.number;
+}
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+STRING*
+Parrot_pcc_get_string_constant_func(PARROT_INTERP, ARGIN(PMC *ctx), INTVAL idx)
+{
+    ASSERT_ARGS(Parrot_pcc_get_string_constant_func)
+    Parrot_Context const * c = get_context_struct_fast(interp, ctx);
+    return c->constants[idx]->u.string;
+}
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+PMC*
+Parrot_pcc_get_pmc_constant_func(PARROT_INTERP, ARGIN(PMC *ctx), INTVAL idx)
+{
+    ASSERT_ARGS(Parrot_pcc_get_pmc_constant_func)
+    Parrot_Context const * c = get_context_struct_fast(interp, ctx);
+    return c->constants[idx]->u.key;
+}
+
+
+
+/*
+
+=item C<static Parrot_Context * get_context_struct_fast(PARROT_INTERP, PMC
+*ctx)>
+
+Fetches Parrot_Context from Context PMC.  This is a static, inlineable function
+so it only works within this file.  It also only works if you *know* that ctx
+is a valid PMC, so be careful.  This is an encapsulation-breaking optimization
+that improves performance measurably.  Use responsibly.  Never export this
+function.
+
+=cut
+
+*/
+
+
+PARROT_INLINE
+PARROT_CANNOT_RETURN_NULL
+static Parrot_Context *
+get_context_struct_fast(PARROT_INTERP, ARGIN(PMC *ctx))
+{
+    ASSERT_ARGS(get_context_struct_fast)
+
+    /* temporarily violate encapsulation; big speedup here */
+    return PMC_data_typed(ctx, Parrot_Context *);
+}
+
+/*
+
+=back
+
+*/
+
+
+/*
+ * Local variables:
+ *   c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */

Modified: branches/orderedhash_revamp/src/call/ops.c
==============================================================================
--- branches/orderedhash_revamp/src/call/ops.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/call/ops.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -2,13 +2,15 @@
 Copyright (C) 2001-2009, Parrot Foundation.
 $Id$
 
-=head1 Calling Ops
+=head1 NAME
 
-=head1 Description
+src/call/ops.c
 
-Various functions that call the run loop.
+=head1 DESCRIPTION
 
-=head2 Functions
+B<Calling Ops>:  Various functions that call the run loop.
+
+=head1 FUNCTIONS
 
 =over 4
 
@@ -19,32 +21,10 @@
 
 #include "parrot/parrot.h"
 #include "parrot/oplib/ops.h"
-#include "../pmc/pmc_continuation.h"
+#include "pmc/pmc_continuation.h"
 
 /* HEADERIZER HFILE: include/parrot/call.h */
 
-/* HEADERIZER BEGIN: static */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static Parrot_Context * runops_args(PARROT_INTERP,
-    ARGIN(PMC *sub),
-    ARGIN_NULLOK(PMC *obj),
-    SHIM(STRING *meth),
-    ARGIN(const char *sig),
-    va_list ap)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(5);
-
-#define ASSERT_ARGS_runops_args __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub) \
-    || PARROT_ASSERT_ARG(sig)
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: static */
-
 #define STACKED_EXCEPTIONS 1
 #define RUNLOOP_TRACE      0
 
@@ -88,31 +68,31 @@
 #endif
     {
         new_runloop_jump_point(interp);
-    reenter:
+  reenter:
         interp->current_runloop->handler_start = NULL;
         switch (setjmp(interp->current_runloop->resume)) {
-            case 1:
-                /* an exception was handled */
-                if (STACKED_EXCEPTIONS)
-                    free_runloop_jump_point(interp);
+          case 1:
+            /* an exception was handled */
+            if (STACKED_EXCEPTIONS)
+                free_runloop_jump_point(interp);
 
-                interp->current_runloop_level = our_runloop_level - 1;
-                interp->current_runloop_id    = old_runloop_id;
+            interp->current_runloop_level = our_runloop_level - 1;
+            interp->current_runloop_id    = old_runloop_id;
 
 #if RUNLOOP_TRACE
-                fprintf(stderr, "[handled exception; back to loop %d, level %d]\n",
+            fprintf(stderr, "[handled exception; back to loop %d, level %d]\n",
                         interp->current_runloop_id, interp->current_runloop_level);
 #endif
-                return;
-            case 2:
-                /* Reenter the runloop from a exception thrown from C
-                 * with a pir handler */
-                PARROT_ASSERT(interp->current_runloop->handler_start);
-                offset = interp->current_runloop->handler_start - interp->code->base.data;
-                /* Prevent incorrect reuse */
-                goto reenter;
-            default:
-                break;
+            return;
+          case 2:
+            /* Reenter the runloop from a exception thrown from C
+             * with a pir handler */
+            PARROT_ASSERT(interp->current_runloop->handler_start);
+            offset = interp->current_runloop->handler_start - interp->code->base.data;
+            /* Prevent incorrect reuse */
+            goto reenter;
+          default:
+            break;
         }
     }
 
@@ -132,597 +112,6 @@
     interp->current_runloop_id    = old_runloop_id;
 }
 
-/*
-
-=item C<Parrot_Context * Parrot_runops_fromc(PARROT_INTERP, PMC *sub)>
-
-Runs the Parrot ops, called from C code. The function arguments are
-already setup according to Parrot calling conventions, the C<sub> argument
-is an invocable C<Sub> PMC.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-PARROT_CANNOT_RETURN_NULL
-Parrot_Context *
-Parrot_runops_fromc(PARROT_INTERP, ARGIN(PMC *sub))
-{
-    ASSERT_ARGS(Parrot_runops_fromc)
-    opcode_t offset, *dest;
-    Parrot_Context *ctx;
-
-    /* we need one return continuation with a NULL offset */
-    PMC * const ret_c    = new_ret_continuation_pmc(interp, NULL);
-    interp->current_cont = ret_c;
-#if defined GC_VERBOSE && GC_VERBOSE
-    PObj_report_SET(ret_c);     /* s. also src/gc/api.c */
-#endif
-    /* invoke the sub, which places the context of the sub in the
-     * interpreter, and switches code segments if needed
-     * Passing a dummy true destination copies registers
-     */
-    dest = VTABLE_invoke(interp, sub, (void*) 1);
-    if (!dest)
-        Parrot_ex_throw_from_c_args(interp, NULL, 1,
-            "Subroutine returned a NULL address");
-
-    ctx    = CONTEXT(interp);
-    offset = dest - interp->code->base.data;
-    runops(interp, offset);
-    return ctx;
-}
-
-
-/*
-
-=item C<static Parrot_Context * runops_args(PARROT_INTERP, PMC *sub, PMC *obj,
-STRING *meth, const char *sig, va_list ap)>
-
-Calls the PMC subroutine C<sub> with optional name C<meth>. If PMC object
-C<obj> is provided, the call is treated as a method call on that object.
-The function has a function signature C<sig> and a variadic argument list
-C<ap>.
-
-Signatures are similar to NCI:
-
-    v ... void return
-    I ... INTVAL (not Interpreter)
-    N ... NUMVAL
-    S ... STRING*
-    P ... PMC*
-
-TODO: Update this list of possible signature elements.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static Parrot_Context *
-runops_args(PARROT_INTERP, ARGIN(PMC *sub), ARGIN_NULLOK(PMC *obj),
-        SHIM(STRING *meth), ARGIN(const char *sig), va_list ap)
-{
-    ASSERT_ARGS(runops_args)
-    opcode_t offset, *dest;
-    Parrot_Context *ctx;
-
-    char new_sig[10];
-    const char *sig_p;
-    Parrot_Context * const old_ctx = CONTEXT(interp);
-
-    interp->current_cont   = new_ret_continuation_pmc(interp, NULL);
-    interp->current_object = obj;
-    dest                   = VTABLE_invoke(interp, sub, NULL);
-
-    if (!dest)
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PARROT_USAGE_ERROR,
-            "Subroutine returned a NULL address");
-
-    /* The following code assumes that an empty signature is not valid,
-     * check that condition and throws in that case.
-     */
-    if (sig[0] == '\0')
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PARROT_USAGE_ERROR,
-                "Invalid empty signature");
-
-    if (PMC_IS_NULL(obj)) {
-        /* skip over the return type */
-        sig_p = sig + 1;
-    }
-    else if (sig[1] == 'O') {
-        /* skip over the return type */
-        sig_p = sig + 1;
-    }
-    else  {
-        const size_t len = strlen(sig);
-        if (len > 8)
-            Parrot_ex_throw_from_c_args(interp, NULL, 1,
-                "too many arguments in runops_args");
-
-        new_sig[0] = 'O';
-        /* -1 from the end, +1 for the nul at the end */
-        memcpy(new_sig+1, sig+1, len);
-        sig_p = new_sig;
-    }
-
-    if (*sig_p && (dest[0]     == PARROT_OP_get_params_pc
-    || (sub->vtable->base_type == enum_class_ExceptionHandler
-    &&  PMC_cont(sub)->current_results))) {
-        dest = parrot_pass_args_fromc(interp, sig_p, dest, old_ctx, ap);
-    }
-
-    /*
-     * main is now started with runops_args_fromc too
-     * PASM subs usually don't have get_params
-     * XXX we could check, if we are running main
-     else
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-            "no get_params in sub");
-     */
-
-    ctx    = Parrot_context_ref(interp, CONTEXT(interp));
-    offset = dest - interp->code->base.data;
-    runops(interp, offset);
-    return ctx;
-}
-
-
-/*
-
-=item C<void * Parrot_run_meth_fromc(PARROT_INTERP, PMC *sub, PMC *obj, STRING
-*meth)>
-
-Run a method sub from C. The function arguments are
-already setup according to Parrot calling conventions, the C<sub> argument
-is an invocable C<Sub> PMC.
-
-If a PMC return value is registered it is returned.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-PARROT_CAN_RETURN_NULL
-void *
-Parrot_run_meth_fromc(PARROT_INTERP, ARGIN(PMC *sub), ARGIN_NULLOK(PMC *obj), SHIM(STRING *meth))
-{
-    ASSERT_ARGS(Parrot_run_meth_fromc)
-    Parrot_Context *ctx;
-    opcode_t offset, *dest;
-
-    interp->current_cont   = new_ret_continuation_pmc(interp, NULL);
-    interp->current_object = obj;
-    dest                   = VTABLE_invoke(interp, sub, (void *)1);
-
-    if (!dest)
-        Parrot_ex_throw_from_c_args(interp, NULL, 1,
-            "Subroutine returned a NULL address");
-
-    ctx    = CONTEXT(interp);
-    offset = dest - interp->code->base.data;
-    runops(interp, offset);
-    return set_retval(interp, 0, ctx);
-}
-
-/*
-
-=item C<PMC * Parrot_runops_fromc_args(PARROT_INTERP, PMC *sub, const char *sig,
-...)>
-
-Run parrot ops, called from C code, function arguments are passed as
-C<va_args> according to the signature. The C<sub> argument is an
-invocable C<Sub> PMC.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-PARROT_CAN_RETURN_NULL
-PMC *
-Parrot_runops_fromc_args(PARROT_INTERP, ARGIN(PMC *sub), ARGIN(const char *sig), ...)
-{
-    ASSERT_ARGS(Parrot_runops_fromc_args)
-    va_list args;
-    Parrot_Context *ctx;
-    PMC *retval;
-
-    va_start(args, sig);
-    ctx = runops_args(interp, sub, PMCNULL, NULL, sig, args);
-    va_end(args);
-    retval = (PMC *)set_retval(interp, *sig, ctx);
-    Parrot_free_context(interp, ctx, 1);
-    return retval;
-}
-
-/*
-
-=item C<void * Parrot_runops_fromc_args_event(PARROT_INTERP, PMC *sub, const
-char *sig, ...)>
-
-Run code from within event handlers. This variant deals with some reentrency
-issues. It also should do sanity checks, if e.g. the handler subroutine
-didn't return properly.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-PARROT_CAN_RETURN_NULL
-void *
-Parrot_runops_fromc_args_event(PARROT_INTERP, ARGIN(PMC *sub),
-        ARGIN(const char *sig), ...)
-{
-    ASSERT_ARGS(Parrot_runops_fromc_args_event)
-    va_list args;
-    Parrot_Context *ctx;
-    void *retval;
-    /*
-     * running code from event handlers isn't fully reentrant due to
-     * these interpreter variables - mainly related to calls
-     */
-    opcode_t * const cargs   = interp->current_args;
-    opcode_t * const params  = interp->current_params;
-    opcode_t * const returns = interp->current_returns;
-    PMC *      const cont    = interp->current_cont;
-    /* what else ? */
-
-    va_start(args, sig);
-    ctx = runops_args(interp, sub, PMCNULL, NULL, sig, args);
-    va_end(args);
-    retval = set_retval(interp, *sig, ctx);
-    Parrot_free_context(interp, ctx, 1);
-
-    interp->current_args     = cargs;
-    interp->current_params   = params;
-    interp->current_returns  = returns;
-    interp->current_cont     = cont;
-    return retval;
-}
-
-/*
-
-=item C<INTVAL Parrot_runops_fromc_args_reti(PARROT_INTERP, PMC *sub, const char
-*sig, ...)>
-
-Called from C code, runs a Parrot subroutine C<sub>. The subroutine has
-function signature C<sig> and a C variadic argument list. Returns an
-C<INTVAL>.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-INTVAL
-Parrot_runops_fromc_args_reti(PARROT_INTERP, ARGIN(PMC *sub),
-        ARGIN(const char *sig), ...)
-{
-    ASSERT_ARGS(Parrot_runops_fromc_args_reti)
-    va_list args;
-    Parrot_Context *ctx;
-    INTVAL retval;
-
-    va_start(args, sig);
-    ctx = runops_args(interp, sub, PMCNULL, NULL, sig, args);
-    va_end(args);
-    retval = set_retval_i(interp, *sig, ctx);
-    Parrot_free_context(interp, ctx, 1);
-    return retval;
-}
-
-/*
-
-=item C<FLOATVAL Parrot_runops_fromc_args_retf(PARROT_INTERP, PMC *sub, const
-char *sig, ...)>
-
-Called from C code, runs a Parrot subroutine C<sub>. The subroutine has
-function signature C<sig> and a C variadic argument list. Returns a
-C<FLOATVAL>.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-FLOATVAL
-Parrot_runops_fromc_args_retf(PARROT_INTERP, ARGIN(PMC *sub),
-        ARGIN(const char *sig), ...)
-{
-    ASSERT_ARGS(Parrot_runops_fromc_args_retf)
-    va_list args;
-    Parrot_Context *ctx;
-    FLOATVAL retval;
-
-    va_start(args, sig);
-    ctx = runops_args(interp, sub, PMCNULL, NULL, sig, args);
-    va_end(args);
-    retval = set_retval_f(interp, *sig, ctx);
-    Parrot_free_context(interp, ctx, 1);
-    return retval;
-}
-
-/*
-
-=item C<void* Parrot_run_meth_fromc_args(PARROT_INTERP, PMC *sub, PMC *obj,
-STRING *meth, const char *sig, ...)>
-
-Called from C code, runs a Parrot subroutine C<sub> as a method on object
-C<obj>. The subroutine has function signature C<sig> and a C variadic argument
-list.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-PARROT_CAN_RETURN_NULL
-void*
-Parrot_run_meth_fromc_args(PARROT_INTERP, ARGIN(PMC *sub), ARGIN_NULLOK(PMC *obj),
-        ARGIN(STRING *meth), ARGIN(const char *sig), ...)
-{
-    ASSERT_ARGS(Parrot_run_meth_fromc_args)
-    va_list args;
-    Parrot_Context *ctx;
-    void* retval;
-
-    va_start(args, sig);
-    ctx = runops_args(interp, sub, obj, meth, sig, args);
-    va_end(args);
-    retval = set_retval(interp, *sig, ctx);
-    Parrot_free_context(interp, ctx, 1);
-    return retval;
-}
-
-/*
-
-=item C<INTVAL Parrot_run_meth_fromc_args_reti(PARROT_INTERP, PMC *sub, PMC
-*obj, STRING *meth, const char *sig, ...)>
-
-Called from C code, runs a Parrot subroutine C<sub> as a method on object
-C<obj>. The subroutine has function signature C<sig> and a C variadic argument
-list. Returns an C<INTVAL>.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-INTVAL
-Parrot_run_meth_fromc_args_reti(PARROT_INTERP, ARGIN(PMC *sub), ARGIN_NULLOK(PMC *obj),
-        ARGIN(STRING *meth), ARGIN(const char *sig), ...)
-{
-    ASSERT_ARGS(Parrot_run_meth_fromc_args_reti)
-    va_list args;
-    Parrot_Context *ctx;
-    INTVAL retval;
-
-    va_start(args, sig);
-    ctx = runops_args(interp, sub, obj, meth, sig, args);
-    va_end(args);
-    retval = set_retval_i(interp, *sig, ctx);
-    Parrot_free_context(interp, ctx, 1);
-    return retval;
-}
-
-/*
-
-=item C<FLOATVAL Parrot_run_meth_fromc_args_retf(PARROT_INTERP, PMC *sub, PMC
-*obj, STRING *meth, const char *sig, ...)>
-
-Called from C code, runs a Parrot subroutine C<sub> as a method on object
-C<obj>. The subroutine has function signature C<sig> and a C variadic argument
-list C<args>. Returns a C<FLOATVAL>.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-FLOATVAL
-Parrot_run_meth_fromc_args_retf(PARROT_INTERP, ARGIN(PMC *sub), ARGIN_NULLOK(PMC *obj),
-        ARGIN(STRING *meth), ARGIN(const char *sig), ...)
-{
-    ASSERT_ARGS(Parrot_run_meth_fromc_args_retf)
-    va_list args;
-    Parrot_Context *ctx;
-    FLOATVAL retval;
-
-    va_start(args, sig);
-    ctx = runops_args(interp, sub, obj, meth, sig, args);
-    va_end(args);
-    retval = set_retval_f(interp, *sig, ctx);
-    Parrot_free_context(interp, ctx, 1);
-    return retval;
-}
-
-/*
-
-=item C<void * Parrot_runops_fromc_arglist(PARROT_INTERP, PMC *sub, const char
-*sig, va_list args)>
-
-Called from C code, runs a Parrot subroutine C<sub>.
-The subroutine has function signature C<sig> and a C C<va_list>
-argument list C<args>.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-PARROT_CAN_RETURN_NULL
-void *
-Parrot_runops_fromc_arglist(PARROT_INTERP, ARGIN(PMC *sub),
-        ARGIN(const char *sig), va_list args)
-{
-    ASSERT_ARGS(Parrot_runops_fromc_arglist)
-    void* retval;
-    Parrot_Context * const ctx = runops_args(interp, sub, PMCNULL, NULL, sig, args);
-
-    retval = set_retval(interp, *sig, ctx);
-    Parrot_free_context(interp, ctx, 1);
-    return retval;
-}
-
-/*
-
-=item C<INTVAL Parrot_runops_fromc_arglist_reti(PARROT_INTERP, PMC *sub, const
-char *sig, va_list args)>
-
-Called from C code, runs a Parrot subroutine C<sub>.
-The subroutine has function signature C<sig> and a C C<va_list>
-argument list C<args>. Returns an C<INTVAL>.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-INTVAL
-Parrot_runops_fromc_arglist_reti(PARROT_INTERP, ARGIN(PMC *sub),
-        ARGIN(const char *sig), va_list args)
-{
-    ASSERT_ARGS(Parrot_runops_fromc_arglist_reti)
-    INTVAL retval;
-    Parrot_Context * const ctx = runops_args(interp, sub, PMCNULL, NULL, sig, args);
-
-    retval = set_retval_i(interp, *sig, ctx);
-    Parrot_free_context(interp, ctx, 1);
-    return retval;
-}
-
-/*
-
-=item C<FLOATVAL Parrot_runops_fromc_arglist_retf(PARROT_INTERP, PMC *sub, const
-char *sig, va_list args)>
-
-Called from C code, runs a Parrot subroutine C<sub>.
-The subroutine has function signature C<sig> and a C C<va_list>
-argument list C<args>. Returns an C<FLOATVAL>.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-FLOATVAL
-Parrot_runops_fromc_arglist_retf(PARROT_INTERP, ARGIN(PMC *sub),
-        ARGIN(const char *sig), va_list args)
-{
-    ASSERT_ARGS(Parrot_runops_fromc_arglist_retf)
-    FLOATVAL retval;
-    Parrot_Context * const ctx = runops_args(interp, sub, PMCNULL, NULL, sig, args);
-
-    retval = set_retval_f(interp, *sig, ctx);
-    Parrot_free_context(interp, ctx, 1);
-    return retval;
-}
-
-/*
-
-=item C<void* Parrot_run_meth_fromc_arglist(PARROT_INTERP, PMC *sub, PMC *obj,
-STRING *meth, const char *sig, va_list args)>
-
-Calls the subroutine C<sub> as a method on object C<obj>. The method to be
-called is named C<meth>, has the function signature C<sig> and arguments
-C<args>. C<args> is a C variadic argument list created with C<va_start>.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-PARROT_CAN_RETURN_NULL
-void*
-Parrot_run_meth_fromc_arglist(PARROT_INTERP, ARGIN(PMC *sub), ARGIN_NULLOK(PMC *obj),
-        ARGIN(STRING *meth), ARGIN(const char *sig), va_list args)
-{
-    ASSERT_ARGS(Parrot_run_meth_fromc_arglist)
-    Parrot_Context *ctx;
-    void* retval;
-
-    ctx = runops_args(interp, sub, obj, meth, sig, args);
-    retval = set_retval(interp, *sig, ctx);
-    Parrot_free_context(interp, ctx, 1);
-    return retval;
-}
-
-/*
-
-=item C<INTVAL Parrot_run_meth_fromc_arglist_reti(PARROT_INTERP, PMC *sub, PMC
-*obj, STRING *meth, const char *sig, va_list args)>
-
-Calls the subroutine C<sub> as a method on object C<obj>. The method to be
-called is named C<meth>, has the function signature C<sig> and arguments
-C<args>. C<args> is a C variadic argument list created with C<va_start>.
-Returns an C<INTVAL>.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-PARROT_CAN_RETURN_NULL
-INTVAL
-Parrot_run_meth_fromc_arglist_reti(PARROT_INTERP, ARGIN(PMC *sub), ARGIN_NULLOK(PMC *obj),
-        ARGIN(STRING *meth), ARGIN(const char *sig), va_list args)
-{
-    ASSERT_ARGS(Parrot_run_meth_fromc_arglist_reti)
-    INTVAL retval;
-    Parrot_Context * const ctx = runops_args(interp, sub, obj, meth, sig, args);
-
-    retval = set_retval_i(interp, *sig, ctx);
-    Parrot_free_context(interp, ctx, 1);
-    return retval;
-}
-
-/*
-
-=item C<FLOATVAL Parrot_run_meth_fromc_arglist_retf(PARROT_INTERP, PMC *sub, PMC
-*obj, STRING *meth, const char *sig, va_list args)>
-
-Calls the subroutine C<sub> as a method on object C<obj>. The method to be
-called is named C<meth>, has the function signature C<sig> and arguments
-C<args>. C<args> is a C variadic argument list created with C<va_start>.
-Returns a C<FLOATVAL>.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_IGNORABLE_RESULT
-FLOATVAL
-Parrot_run_meth_fromc_arglist_retf(PARROT_INTERP, ARGIN(PMC *sub), ARGIN_NULLOK(PMC *obj),
-        ARGIN(STRING *meth), ARGIN(const char *sig), va_list args)
-{
-    ASSERT_ARGS(Parrot_run_meth_fromc_arglist_retf)
-    FLOATVAL retval;
-    Parrot_Context * const ctx = runops_args(interp, sub, obj, meth, sig, args);
-
-    retval = set_retval_f(interp, *sig, ctx);
-    Parrot_free_context(interp, ctx, 1);
-    return retval;
-}
 
 /*
 

Modified: branches/orderedhash_revamp/src/call/pcc.c
==============================================================================
--- branches/orderedhash_revamp/src/call/pcc.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/call/pcc.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -2,2627 +2,48 @@
 Copyright (C) 2001-2009, Parrot Foundation.
 $Id$
 
-=head1 Parrot Calling Conventions
+=head1 NAME
 
-=head1 Description
+src/call/pcc.c
 
-Functions in this file handle argument/return value passing to and from
-subroutines.
+=head1 DESCRIPTION
 
-=head2 Functions
+B<Parrot Calling Conventions>:  Functions in this file handle argument/return
+value passing to and from subroutines.
 
-=over 4
-
-=cut
-
-*/
-
-#include "parrot/parrot.h"
-#include "parrot/oplib/ops.h"
-#include "pcc.str"
-#include "../pmc/pmc_key.h"
-#include "../pmc/pmc_continuation.h"
-
-/* HEADERIZER HFILE: include/parrot/call.h */
-
-/* HEADERIZER BEGIN: static */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-
-static void check_for_opt_flag(PARROT_INTERP,
-    ARGMOD(call_state *st),
-    int has_arg)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*st);
-
-static void check_named(PARROT_INTERP, ARGMOD(call_state *st))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*st);
-
-static void clone_key_arg(PARROT_INTERP, ARGMOD(call_state *st))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*st);
-
-static void commit_last_arg(PARROT_INTERP,
-    int index,
-    int cur,
-    ARGMOD(opcode_t *n_regs_used),
-    int seen_arrow,
-    ARGIN(PMC * const *sigs),
-    ARGMOD(opcode_t **indexes),
-    ARGMOD(Parrot_Context *ctx),
-    ARGIN_NULLOK(PMC *pmc),
-    ARGIN(va_list *list))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(4)
-        __attribute__nonnull__(6)
-        __attribute__nonnull__(7)
-        __attribute__nonnull__(8)
-        __attribute__nonnull__(10)
-        FUNC_MODIFIES(*n_regs_used)
-        FUNC_MODIFIES(*indexes)
-        FUNC_MODIFIES(*ctx);
-
-static void commit_last_arg_sig_object(PARROT_INTERP,
-    int index,
-    int cur,
-    ARGMOD(opcode_t *n_regs_used),
-    int seen_arrow,
-    ARGIN(PMC * const *sigs),
-    ARGMOD(opcode_t **indexes),
-    ARGMOD(Parrot_Context *ctx),
-    ARGIN(PMC *sig_obj))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(4)
-        __attribute__nonnull__(6)
-        __attribute__nonnull__(7)
-        __attribute__nonnull__(8)
-        __attribute__nonnull__(9)
-        FUNC_MODIFIES(*n_regs_used)
-        FUNC_MODIFIES(*indexes)
-        FUNC_MODIFIES(*ctx);
-
-static void convert_arg_from_int(PARROT_INTERP, ARGMOD(call_state *st))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*st);
-
-static void convert_arg_from_num(PARROT_INTERP, ARGMOD(call_state *st))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*st);
-
-static void convert_arg_from_pmc(PARROT_INTERP, ARGMOD(call_state *st))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*st);
-
-static void convert_arg_from_str(PARROT_INTERP, ARGMOD(call_state *st))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*st);
-
-PARROT_CANNOT_RETURN_NULL
-static Parrot_Context * count_signature_elements(PARROT_INTERP,
-    ARGIN(const char *signature),
-    ARGMOD(PMC *args_sig),
-    ARGMOD(PMC *results_sig),
-    int flag)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        FUNC_MODIFIES(*args_sig)
-        FUNC_MODIFIES(*results_sig);
-
-static int fetch_arg_op(PARROT_INTERP, ARGMOD(call_state *st))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*st);
-
-static int fetch_arg_sig(PARROT_INTERP, ARGMOD(call_state *st))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*st);
-
-static void init_call_stats(ARGMOD(call_state *st))
-        __attribute__nonnull__(1)
-        FUNC_MODIFIES(*st);
-
-static void init_first_dest_named(PARROT_INTERP, ARGMOD(call_state *st))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*st);
-
-static int locate_named_named(PARROT_INTERP, ARGMOD(call_state *st))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*st);
-
-static void next_arg_sig(PARROT_INTERP, ARGMOD(call_state_item *sti))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*sti);
-
-static void null_val(int sig, ARGMOD(call_state *st))
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*st);
-
-PARROT_CAN_RETURN_NULL
-static const char * set_context_sig_params(PARROT_INTERP,
-    ARGIN(const char *signature),
-    ARGMOD(INTVAL *n_regs_used),
-    ARGMOD(PMC **sigs),
-    ARGMOD(opcode_t **indexes),
-    ARGMOD(Parrot_Context *ctx),
-    ARGMOD(PMC *sig_obj))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        __attribute__nonnull__(5)
-        __attribute__nonnull__(6)
-        __attribute__nonnull__(7)
-        FUNC_MODIFIES(*n_regs_used)
-        FUNC_MODIFIES(*sigs)
-        FUNC_MODIFIES(*indexes)
-        FUNC_MODIFIES(*ctx)
-        FUNC_MODIFIES(*sig_obj);
-
-static void set_context_sig_returns(PARROT_INTERP,
-    ARGMOD(Parrot_Context *ctx),
-    ARGMOD(opcode_t **indexes),
-    ARGIN_NULLOK(const char *ret_x),
-    ARGMOD(PMC *result_list))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(5)
-        FUNC_MODIFIES(*ctx)
-        FUNC_MODIFIES(*indexes)
-        FUNC_MODIFIES(*result_list);
-
-static void set_context_sig_returns_varargs(PARROT_INTERP,
-    ARGMOD(Parrot_Context *ctx),
-    ARGMOD(opcode_t **indexes),
-    ARGIN(const char *ret_x),
-    va_list returns)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        FUNC_MODIFIES(*ctx)
-        FUNC_MODIFIES(*indexes);
-
-static int set_retval_util(PARROT_INTERP,
-    ARGIN(const char *sig),
-    ARGIN(Parrot_Context *ctx),
-    ARGMOD(call_state *st))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        FUNC_MODIFIES(*st);
-
-static void start_flatten(PARROT_INTERP,
-    ARGMOD(call_state *st),
-    ARGIN(PMC *p_arg))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*st);
-
-static void store_arg(ARGIN(const call_state *st), INTVAL idx)
-        __attribute__nonnull__(1);
-
-static void too_few(PARROT_INTERP,
-    ARGIN(const call_state *st),
-    ARGIN(const char *action))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3);
-
-static void too_many(PARROT_INTERP,
-    ARGIN(const call_state *st),
-    ARGIN(const char *action))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3);
-
-#define ASSERT_ARGS_check_for_opt_flag __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(st)
-#define ASSERT_ARGS_check_named __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(st)
-#define ASSERT_ARGS_clone_key_arg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(st)
-#define ASSERT_ARGS_commit_last_arg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(n_regs_used) \
-    || PARROT_ASSERT_ARG(sigs) \
-    || PARROT_ASSERT_ARG(indexes) \
-    || PARROT_ASSERT_ARG(ctx) \
-    || PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_commit_last_arg_sig_object __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(n_regs_used) \
-    || PARROT_ASSERT_ARG(sigs) \
-    || PARROT_ASSERT_ARG(indexes) \
-    || PARROT_ASSERT_ARG(ctx) \
-    || PARROT_ASSERT_ARG(sig_obj)
-#define ASSERT_ARGS_convert_arg_from_int __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(st)
-#define ASSERT_ARGS_convert_arg_from_num __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(st)
-#define ASSERT_ARGS_convert_arg_from_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(st)
-#define ASSERT_ARGS_convert_arg_from_str __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(st)
-#define ASSERT_ARGS_count_signature_elements __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(signature) \
-    || PARROT_ASSERT_ARG(args_sig) \
-    || PARROT_ASSERT_ARG(results_sig)
-#define ASSERT_ARGS_fetch_arg_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(st)
-#define ASSERT_ARGS_fetch_arg_sig __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(st)
-#define ASSERT_ARGS_init_call_stats __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(st)
-#define ASSERT_ARGS_init_first_dest_named __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(st)
-#define ASSERT_ARGS_locate_named_named __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(st)
-#define ASSERT_ARGS_next_arg_sig __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sti)
-#define ASSERT_ARGS_null_val __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(st)
-#define ASSERT_ARGS_set_context_sig_params __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(signature) \
-    || PARROT_ASSERT_ARG(n_regs_used) \
-    || PARROT_ASSERT_ARG(sigs) \
-    || PARROT_ASSERT_ARG(indexes) \
-    || PARROT_ASSERT_ARG(ctx) \
-    || PARROT_ASSERT_ARG(sig_obj)
-#define ASSERT_ARGS_set_context_sig_returns __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ctx) \
-    || PARROT_ASSERT_ARG(indexes) \
-    || PARROT_ASSERT_ARG(result_list)
-#define ASSERT_ARGS_set_context_sig_returns_varargs \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ctx) \
-    || PARROT_ASSERT_ARG(indexes) \
-    || PARROT_ASSERT_ARG(ret_x)
-#define ASSERT_ARGS_set_retval_util __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sig) \
-    || PARROT_ASSERT_ARG(ctx) \
-    || PARROT_ASSERT_ARG(st)
-#define ASSERT_ARGS_start_flatten __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(st) \
-    || PARROT_ASSERT_ARG(p_arg)
-#define ASSERT_ARGS_store_arg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(st)
-#define ASSERT_ARGS_too_few __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(st) \
-    || PARROT_ASSERT_ARG(action)
-#define ASSERT_ARGS_too_many __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(st) \
-    || PARROT_ASSERT_ARG(action)
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: static */
-
-
-/* Make sure we don't conflict with any other MAX() macros defined elsewhere */
-#define PARROT_MAX(a, b) (((a)) > (b) ? (a) : (b))
-
-#define SAVE_OFF_REGS(orig, next, save) \
-        (save).bp = (orig).bp;\
-        (save).bp_ps = (orig).bp_ps;\
-        (orig).bp = (next).bp;\
-        (orig).bp_ps = (next).bp_ps;
-
-#define RESTORE_REGS(orig, save) \
-        (orig).bp = (save).bp;\
-        (orig).bp_ps = (save).bp_ps;
-
-/*
-
-=item C<PMC* Parrot_pcc_build_sig_object_from_varargs(PARROT_INTERP, PMC* obj,
-const char *sig, va_list args)>
-
-Take a varargs list, and convert it into a CallSignature PMC. The CallSignature
-stores the original short signature string, and an array of integer types to
-pass on to the multiple dispatch search.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-PMC*
-Parrot_pcc_build_sig_object_from_varargs(PARROT_INTERP, ARGIN_NULLOK(PMC* obj),
-        ARGIN(const char *sig), va_list args)
-{
-    ASSERT_ARGS(Parrot_pcc_build_sig_object_from_varargs)
-    PMC         *type_tuple         = PMCNULL;
-    PMC         *returns            = PMCNULL;
-    PMC         * const call_object = pmc_new(interp, enum_class_CallSignature);
-    STRING      *string_sig         = Parrot_str_new_constant(interp, sig);
-    const INTVAL sig_len            = Parrot_str_byte_length(interp, string_sig);
-    INTVAL       in_return_sig = 0;
-    INTVAL       i;
-
-    if (!sig_len)
-        return call_object;
-
-    VTABLE_set_string_native(interp, call_object, string_sig);
-
-    /* Process the varargs list */
-    for (i = 0; i < sig_len; ++i) {
-        const INTVAL type = Parrot_str_indexed(interp, string_sig, i);
-
-        /* Only create the returns array if it's needed */
-        if (in_return_sig && PMC_IS_NULL(returns)) {
-            returns = pmc_new(interp, enum_class_ResizablePMCArray);
-            VTABLE_set_attr_str(interp, call_object, CONST_STRING(interp, "results"), returns);
-        }
-
-        if (in_return_sig) {
-            STRING * const signature = CONST_STRING(interp, "signature");
-            /* Returns store the original passed-in pointer, so they can pass
-             * the result back to the caller. */
-            PMC * const val_pointer = pmc_new(interp, enum_class_CPointer);
-            VTABLE_push_pmc(interp, returns, val_pointer);
-
-            switch (type) {
-                case 'I':
-                    VTABLE_set_pointer(interp, val_pointer, (void *)va_arg(args, INTVAL *));
-                    VTABLE_set_string_keyed_str(interp, val_pointer, signature, CONST_STRING(interp, "I"));
-                    break;
-                case 'N':
-                    VTABLE_set_pointer(interp, val_pointer, (void *)va_arg(args, FLOATVAL *));
-                    VTABLE_set_string_keyed_str(interp, val_pointer, signature, CONST_STRING(interp, "N"));
-                    break;
-                case 'S':
-                    VTABLE_set_pointer(interp, val_pointer, (void *)va_arg(args, STRING **));
-                    VTABLE_set_string_keyed_str(interp, val_pointer, signature, CONST_STRING(interp, "S"));
-                    break;
-                case 'P':
-                    VTABLE_set_pointer(interp, val_pointer, (void *)va_arg(args, PMC **));
-                    VTABLE_set_string_keyed_str(interp, val_pointer, signature, CONST_STRING(interp, "P"));
-                    break;
-                default:
-                    Parrot_ex_throw_from_c_args(interp, NULL,
-                        EXCEPTION_INVALID_OPERATION,
-                        "Multiple Dispatch: invalid argument type %c!", type);
-             }
-        }
-        else {
-            /* Regular arguments just set the value */
-            switch (type) {
-                case 'I':
-                    VTABLE_push_integer(interp, call_object, va_arg(args, INTVAL));
-                    break;
-                case 'N':
-                    VTABLE_push_float(interp, call_object, va_arg(args, FLOATVAL));
-                    break;
-                case 'S':
-                    VTABLE_push_string(interp, call_object, va_arg(args, STRING *));
-                    break;
-                case 'P':
-                {
-                    PMC * const pmc_arg = va_arg(args, PMC *);
-                    VTABLE_push_pmc(interp, call_object, pmc_arg);
-                    break;
-                }
-                case '-':
-                    i++; /* skip '>' */
-                    in_return_sig = 1;
-                    break;
-                default:
-                    Parrot_ex_throw_from_c_args(interp, NULL,
-                        EXCEPTION_INVALID_OPERATION,
-                        "Multiple Dispatch: invalid argument type %c!", type);
-            }
-        }
-    }
-
-    /* Check if we have an invocant, and add it to the front of the arguments */
-    if (!PMC_IS_NULL(obj)) {
-        string_sig = Parrot_str_concat(interp, CONST_STRING(interp, "Pi"), string_sig, 0);
-        VTABLE_set_string_native(interp, call_object, string_sig);
-        VTABLE_unshift_pmc(interp, call_object, obj);
-    }
-
-    /* Build a type_tuple for multiple dispatch */
-    type_tuple = Parrot_mmd_build_type_tuple_from_sig_obj(interp, call_object);
-    VTABLE_set_pmc(interp, call_object, type_tuple);
-
-    return call_object;
-}
-
-/*
-
-=item C<void Parrot_init_arg_nci(PARROT_INTERP, call_state *st, const char
-*sig)>
-
-Initializes the argument passing state C<call_state> for the given NCI
-signature.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-Parrot_init_arg_nci(PARROT_INTERP, ARGOUT(call_state *st),
-    ARGIN(const char *sig))
-{
-    ASSERT_ARGS(Parrot_init_arg_nci)
-    init_call_stats(st);
-
-    if (PMC_IS_NULL(interp->args_signature))
-        Parrot_init_arg_op(interp, CONTEXT(interp), interp->current_args,
-                           &st->src);
-    else
-        Parrot_init_arg_indexes_and_sig_pmc(interp, CONTEXT(interp),
-            interp->current_args, interp->args_signature, &st->src);
-
-    Parrot_init_arg_sig(interp, CONTEXT(interp), sig, NULL, &st->dest);
-}
-
-
-/*
-
-=item C<void Parrot_init_ret_nci(PARROT_INTERP, call_state *st, const char
-*sig)>
-
-Initializes the return value, passing state C<call_state> for the given NCI
-signature.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-Parrot_init_ret_nci(PARROT_INTERP, ARGOUT(call_state *st), ARGIN(const char *sig))
-{
-    ASSERT_ARGS(Parrot_init_ret_nci)
-    Parrot_Context *ctx                 = CONTEXT(interp);
-    PMC            * const current_cont = ctx->current_cont;
-
-    /* if this NCI call was a taicall, return results to caller's get_results
-     * this also means that we pass the caller's register base pointer */
-    if (SUB_FLAG_TAILCALL_ISSET(current_cont))
-        ctx = PMC_cont(current_cont)->to_ctx;
-
-    /* TODO simplify all */
-    Parrot_init_arg_sig(interp, CONTEXT(interp), sig, NULL, &st->src);
-
-    /* Non-constant signatures are stored in ctx->results_signature instead of
-     * in the constants table. */
-    if (ctx->results_signature)
-        Parrot_init_arg_indexes_and_sig_pmc(interp, ctx,
-                ctx->current_results, ctx->results_signature, &st->dest);
-    else
-        Parrot_init_arg_op(interp, ctx, ctx->current_results, &st->dest);
-
-}
-
-
-/*
-
-=item C<int Parrot_init_arg_indexes_and_sig_pmc(PARROT_INTERP, Parrot_Context
-*ctx, opcode_t *indexes, PMC *sig_pmc, call_state_item *sti)>
-
-Initializes argument transfer with given context registers, register indexes,
-and a signature PMC.
-
-All C<Parrot_init_arg*> functions can be used for either source or destination,
-by passing either C<&st.src> or C<&st.dest> of a C<call_state> structure.
-
-These functions return 0 if no arguments are present, or 1 on success.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-int
-Parrot_init_arg_indexes_and_sig_pmc(PARROT_INTERP, ARGIN(Parrot_Context *ctx),
-        ARGIN_NULLOK(opcode_t *indexes), ARGIN_NULLOK(PMC *sig_pmc),
-        ARGMOD(call_state_item *sti))
-{
-    ASSERT_ARGS(Parrot_init_arg_indexes_and_sig_pmc)
-    if (!sig_pmc && indexes) {
-        ++indexes;
-        sig_pmc = ctx->constants[*indexes]->u.key;
-        ASSERT_SIG_PMC(sig_pmc);
-        ++indexes;
-    }
-
-    sti->used  = 1;
-    sti->i     = 0;
-    sti->n     = 0;
-    sti->mode  = CALL_STATE_OP;
-    sti->ctx   = ctx;
-    sti->sig   = 0;
-    sti->slurp = NULL;
-
-    if (indexes) {
-        ASSERT_SIG_PMC(sig_pmc);
-        sti->u.op.signature = sig_pmc;
-        sti->u.op.pc        = indexes;
-        sti->n              = VTABLE_elements(interp, sig_pmc);
-
-        /* initialize sti->sig */
-        if (sti->n)
-            next_arg_sig(interp, sti);
-    }
-
-    return sti->n > 0;
-}
-
-
-/*
-
-=item C<int Parrot_init_arg_op(PARROT_INTERP, Parrot_Context *ctx, opcode_t *pc,
-call_state_item *sti)>
-
-Initializes argument transfer with given context registers and opcode location
-of a C<get_*> or C<set_*> argument opcode.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-int
-Parrot_init_arg_op(PARROT_INTERP, ARGIN(Parrot_Context *ctx),
-    ARGIN_NULLOK(opcode_t *pc), ARGIN(call_state_item *sti))
-{
-    ASSERT_ARGS(Parrot_init_arg_op)
-    PMC *sig_pmc = PMCNULL;
-
-    if (pc) {
-        ++pc;
-        sig_pmc = ctx->constants[*pc]->u.key;
-        ASSERT_SIG_PMC(sig_pmc);
-        ++pc;
-    }
-
-    return Parrot_init_arg_indexes_and_sig_pmc(interp, ctx, pc, sig_pmc, sti);
-}
-
-
-/*
-
-=item C<int Parrot_init_arg_sig(PARROT_INTERP, Parrot_Context *ctx, const char
-*sig, void *ap, call_state_item *sti)>
-
-Initializes argument transfer with given code segment (holding the
-const_table), registers, function signature, and arguments.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-int
-Parrot_init_arg_sig(PARROT_INTERP, ARGIN(Parrot_Context *ctx),
-    ARGIN(const char *sig), ARGIN_NULLOK(void *ap),
-    ARGMOD(call_state_item *sti))
-{
-    ASSERT_ARGS(Parrot_init_arg_sig)
-    sti->used = 1;
-    sti->i    = 0;
-    sti->n    = 0;
-    sti->mode = CALL_STATE_SIG;
-    sti->ctx  = ctx;
-    sti->sig  = 0;
-
-    if (*sig) {
-        sti->u.sig.sig = sig;
-        sti->u.sig.ap  = ap;
-        sti->n         = strlen(sig);
-
-        /* initialize st->sig */
-        if (sti->n)
-            next_arg_sig(interp, sti);
-    }
-
-    return sti->n > 0;
-}
-
-
-/*
-
-=item C<static void start_flatten(PARROT_INTERP, call_state *st, PMC *p_arg)>
-
-Marks the source state as flattening with the passed PMC being flattened and
-fetches the first arg from the flattened set.
-
-=cut
-
-*/
-
-static void
-start_flatten(PARROT_INTERP, ARGMOD(call_state *st), ARGIN(PMC *p_arg))
-{
-    ASSERT_ARGS(start_flatten)
-    if (PARROT_ARG_NAME_ISSET(st->src.sig)) {
-
-        /* src ought to be an hash */
-        if (!VTABLE_does(interp, p_arg, CONST_STRING(interp, "hash")))
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-                "argument doesn't hash");
-
-        /* create key needed to iterate the hash */
-        st->key              = pmc_new(interp, enum_class_Key);
-        VTABLE_set_integer_native(interp, st->key, 0);
-        SETATTR_Key_next_key(interp, st->key, (PMC *)INITBucketIndex);
-    }
-    else {
-        /* src ought to be an array */
-        if (!VTABLE_does(interp, p_arg, CONST_STRING(interp, "array")))
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-                    "argument doesn't array");
-    }
-
-    st->src.mode   |= CALL_STATE_FLATTEN;
-    st->src.slurp   = p_arg;
-    st->src.slurp_i = 0;
-    st->src.slurp_n = VTABLE_elements(interp, p_arg);
-
-    /* the -1 is because the :flat PMC itself doesn't count. */
-    st->n_actual_args += st->src.slurp_n - 1;
-}
-
-
-/*
-
-=item C<static void next_arg_sig(PARROT_INTERP, call_state_item *sti)>
-
-Moves the call state to the next argument in the signature, calculating which
-type of argument/parameter to get next.  The index gets increased elsewhere.
-
-=cut
-
-*/
-
-static void
-next_arg_sig(PARROT_INTERP, ARGMOD(call_state_item *sti))
-{
-    ASSERT_ARGS(next_arg_sig)
-    switch (sti->mode & CALL_S_D_MASK) {
-        case CALL_STATE_OP:
-            sti->sig = VTABLE_get_integer_keyed_int(interp,
-                    sti->u.op.signature, sti->i);
-            break;
-        case CALL_STATE_SIG:
-            switch (sti->u.sig.sig[sti->i]) {
-                case 'I':
-                    sti->sig = PARROT_ARG_INTVAL; break;
-                case 'N':
-                    sti->sig = PARROT_ARG_FLOATVAL; break;
-                case 'S':
-                    sti->sig = PARROT_ARG_STRING; break;
-                case 'O':
-                case 'P':
-                    sti->sig = PARROT_ARG_PMC; break;
-                case '@':
-                    sti->sig = PARROT_ARG_PMC | PARROT_ARG_SLURPY_ARRAY; break;
-                case 'F':
-                    sti->sig = PARROT_ARG_PMC | PARROT_ARG_FLATTEN; break;
-                default:
-                    break;
-            }
-            break;
-        default:
-            break;
-    }
-}
-
-
-/*
-
-=item C<static int fetch_arg_sig(PARROT_INTERP, call_state *st)>
-
-Fetches the next argument from the signature in the given call state.
-
-=cut
-
-*/
-
-static int
-fetch_arg_sig(PARROT_INTERP, ARGMOD(call_state *st))
-{
-    ASSERT_ARGS(fetch_arg_sig)
-    va_list * const ap = (va_list *)(st->src.u.sig.ap);
-
-    switch (st->src.sig & PARROT_ARG_TYPE_MASK) {
-        case PARROT_ARG_INTVAL:
-            UVal_int(st->val) = va_arg(*ap, INTVAL);
-            break;
-        case PARROT_ARG_STRING:
-            UVal_str(st->val) = va_arg(*ap, STRING *);
-            break;
-        case PARROT_ARG_FLOATVAL:
-            UVal_num(st->val) = va_arg(*ap, FLOATVAL);
-            break;
-        case PARROT_ARG_PMC:
-            if (st->src.u.sig.sig[st->src.i] == 'O')
-                UVal_pmc(st->val) = CONTEXT(interp)->current_object;
-            else {
-                UVal_pmc(st->val) = va_arg(*ap, PMC *);
-            }
-
-            if (st->src.sig & PARROT_ARG_FLATTEN) {
-                int retval;
-                start_flatten(interp, st, UVal_pmc(st->val));
-
-                /* if the :flat arg is empty, just go to the next arg */
-                if (!st->src.slurp_n) {
-                    st->src.mode &= ~CALL_STATE_FLATTEN;
-                    st->src.i++;
-                }
-
-                st->src.used = 1;
-                retval       = Parrot_fetch_arg(interp, st);
-
-                return retval;
-            }
-            break;
-        default:
-            break;
-    }
-
-    st->src.i++;
-    return 1;
-}
-
-
-/*
-
-=item C<static int fetch_arg_op(PARROT_INTERP, call_state *st)>
-
-Fetches an argument from the appropriate context.
-
-=cut
-
-*/
-
-static int
-fetch_arg_op(PARROT_INTERP, ARGMOD(call_state *st))
-{
-    ASSERT_ARGS(fetch_arg_op)
-    const int    constant = PARROT_ARG_CONSTANT_ISSET(st->src.sig);
-    const INTVAL idx      = st->src.u.op.pc[st->src.i];
-
-    switch (PARROT_ARG_TYPE_MASK_MASK(st->src.sig)) {
-        case PARROT_ARG_INTVAL:
-            UVal_int(st->val) = constant ? idx : CTX_REG_INT(st->src.ctx, idx);
-            break;
-        case PARROT_ARG_STRING:
-        {
-            /* ensure that callees don't modify constant caller strings */
-            if (constant)
-                UVal_str(st->val) = Parrot_str_new_COW(interp,
-                                        st->src.ctx->constants[idx]->u.string);
-            else
-                UVal_str(st->val) = CTX_REG_STR(st->src.ctx, idx);
-
-            break;
-        }
-        case PARROT_ARG_FLOATVAL:
-            UVal_num(st->val) = constant ? st->src.ctx->constants[idx]->u.number
-                                         : CTX_REG_NUM(st->src.ctx, idx);
-            break;
-        case PARROT_ARG_PMC:
-            UVal_pmc(st->val) = constant ? st->src.ctx->constants[idx]->u.key
-                                         : CTX_REG_PMC(st->src.ctx, idx);
-
-            if (st->src.sig & PARROT_ARG_FLATTEN) {
-                int retval;
-                start_flatten(interp, st, UVal_pmc(st->val));
-
-                /* if the :flat arg is empty, just go to the next arg */
-                if (!st->src.slurp_n) {
-                    st->src.mode &= ~CALL_STATE_FLATTEN;
-                    st->src.i++;
-                }
-
-                st->src.used = 1;
-                retval       = Parrot_fetch_arg(interp, st);
-
-                return retval;
-            }
-            break;
-        default:
-            break;
-    }
-
-    st->src.i++;
-    return 1;
-}
-
-
-/*
-
-=item C<int Parrot_fetch_arg(PARROT_INTERP, call_state *st)>
-
-Fetches an argument from the current call state object. Retrieves the
-next argument in the parameter list, or the next argument in a flattened
-array, if given. If the parameter is a named object, fetches both the
-name and the value.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-int
-Parrot_fetch_arg(PARROT_INTERP, ARGMOD(call_state *st))
-{
-    ASSERT_ARGS(Parrot_fetch_arg)
-    if (!st->src.used)
-        return 1;
-
-    if (st->src.i >= st->src.n)
-        return 0;
-
-    st->src.used = 0;
-
-    next_arg_sig(interp, &st->src);
-
-    /* check if we're supposed to continue a :flat argument */
-    if (st->src.mode & CALL_STATE_FLATTEN) {
-        PARROT_ASSERT(st->src.slurp_i < st->src.slurp_n);
-        if (!PMC_IS_NULL(st->key)) {
-            st->src.slurp_i++;
-            st->name = (STRING *)parrot_hash_get_idx(interp,
-                            (Hash *)VTABLE_get_pointer(interp, st->src.slurp),
-                            st->key);
-            PARROT_ASSERT(st->name);
-            UVal_pmc(st->val) = VTABLE_get_pmc_keyed_str(interp,
-                st->src.slurp, st->name);
-        }
-        else {
-            UVal_pmc(st->val) = VTABLE_get_pmc_keyed_int(interp,
-                st->src.slurp, st->src.slurp_i++);
-        }
-
-        st->src.sig       = PARROT_ARG_PMC;
-
-        /* done with flattening */
-        if (st->src.slurp_i == st->src.slurp_n) {
-            st->src.mode &= ~CALL_STATE_FLATTEN;
-
-            st->key = PMCNULL;
-            st->src.i++;
-        }
-
-        return 1;
-    }
-
-    /* If we're at a named arg, store the name and then get the next arg, which
-     * is the actual value of the named arg. */
-    if ((st->src.sig & PARROT_ARG_NAME)
-    && !(st->src.sig & PARROT_ARG_FLATTEN)) {
-        fetch_arg_op(interp, st);
-        st->name = UVal_str(st->val);
-        next_arg_sig(interp, &st->src);
-    }
-
-    switch (st->src.mode & CALL_S_D_MASK) {
-        case CALL_STATE_OP:
-            return fetch_arg_op(interp, st);
-        case CALL_STATE_SIG:
-            return fetch_arg_sig(interp, st);
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, 1, "invalid call state mode");
-    }
-}
-
-
-/*
-
-=item C<int Parrot_fetch_arg_nci(PARROT_INTERP, call_state *st)>
-
-Fetches the next argument from the call state and converts it to the proper
-data type for the call signature. If the next argument is a slurpy array,
-all the remaining arguments are slurped together into a ResizablePMCArray
-PMC which is then set as the PMC value of the call_state object.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-int
-Parrot_fetch_arg_nci(PARROT_INTERP, ARGMOD(call_state *st))
-{
-    ASSERT_ARGS(Parrot_fetch_arg_nci)
-    next_arg_sig(interp, &st->dest);
-
-    if (st->dest.sig & PARROT_ARG_SLURPY_ARRAY) {
-        PMC * const slurped = pmc_new(interp,
-                Parrot_get_ctx_HLL_type(interp, enum_class_ResizablePMCArray));
-
-        PARROT_ASSERT((st->dest.sig & PARROT_ARG_TYPE_MASK) == PARROT_ARG_PMC);
-
-        while (Parrot_fetch_arg(interp, st)) {
-            st->src.used = 1;
-            Parrot_convert_arg(interp, st);
-            VTABLE_push_pmc(interp, slurped, UVal_pmc(st->val));
-        }
-
-        UVal_pmc(st->val) = slurped;
-    }
-    else {
-        Parrot_fetch_arg(interp, st);
-        st->src.used = 1;
-        Parrot_convert_arg(interp, st);
-    }
-
-    st->dest.i++;
-    return 1;
-}
-
-/*
-
-=item C<static void convert_arg_from_int(PARROT_INTERP, call_state *st)>
-
-Autoboxes an int into the expected container type.
-
-=cut
-
-*/
-
-static void
-convert_arg_from_int(PARROT_INTERP, ARGMOD(call_state *st))
-{
-    ASSERT_ARGS(convert_arg_from_int)
-    switch (st->dest.sig & PARROT_ARG_TYPE_MASK) {
-        case PARROT_ARG_FLOATVAL:
-            UVal_num(st->val) = (FLOATVAL)UVal_int(st->val);
-            break;
-        case PARROT_ARG_STRING:
-            UVal_str(st->val) = Parrot_str_from_int(interp, UVal_int(st->val));
-            break;
-        case PARROT_ARG_PMC:
-            {
-            PMC * const d = pmc_new(interp,
-                Parrot_get_ctx_HLL_type(interp, enum_class_Integer));
-
-            VTABLE_set_integer_native(interp, d, UVal_int(st->val));
-            UVal_pmc(st->val) = d;
-            }
-            break;
-        default:
-            break;
-    }
-}
-
-/*
-
-=item C<static void convert_arg_from_num(PARROT_INTERP, call_state *st)>
-
-Autoboxes a num into the expected container type.
-
-=cut
-
-*/
-
-static void
-convert_arg_from_num(PARROT_INTERP, ARGMOD(call_state *st))
-{
-    ASSERT_ARGS(convert_arg_from_num)
-    switch (st->dest.sig & PARROT_ARG_TYPE_MASK) {
-        case PARROT_ARG_INTVAL:
-            UVal_int(st->val) = (INTVAL)UVal_num(st->val);
-            break;
-        case PARROT_ARG_STRING:
-            UVal_str(st->val) = Parrot_str_from_num(interp, UVal_num(st->val));
-            break;
-        case PARROT_ARG_PMC:
-            {
-            PMC * const d = pmc_new(interp,
-                Parrot_get_ctx_HLL_type(interp, enum_class_Float));
-
-            VTABLE_set_number_native(interp, d, UVal_num(st->val));
-            UVal_pmc(st->val) = d;
-            }
-            break;
-        default:
-            break;
-    }
-}
-
-
-/*
-
-=item C<static void convert_arg_from_str(PARROT_INTERP, call_state *st)>
-
-Autoboxes a string primitive to the expected container type.
-
-=cut
-
-*/
-
-static void
-convert_arg_from_str(PARROT_INTERP, ARGMOD(call_state *st))
-{
-    ASSERT_ARGS(convert_arg_from_str)
-    switch (st->dest.sig & PARROT_ARG_TYPE_MASK) {
-        case PARROT_ARG_INTVAL:
-            UVal_int(st->val) = Parrot_str_to_int(interp, UVal_str(st->val));
-            break;
-        case PARROT_ARG_FLOATVAL:
-            UVal_num(st->val) = Parrot_str_to_num(interp, UVal_str(st->val));
-            break;
-        case PARROT_ARG_PMC:
-            {
-            PMC * const d = pmc_new(interp,
-                Parrot_get_ctx_HLL_type(interp, enum_class_String));
-
-            VTABLE_set_string_native(interp, d, UVal_str(st->val));
-            UVal_pmc(st->val) = d;
-            }
-            break;
-        default:
-            break;
-    }
-}
-
-/*
-
-=item C<static void convert_arg_from_pmc(PARROT_INTERP, call_state *st)>
-
-Unboxes a PMC to the expected primitive type.
-
-=cut
-
-*/
-
-static void
-convert_arg_from_pmc(PARROT_INTERP, ARGMOD(call_state *st))
-{
-    ASSERT_ARGS(convert_arg_from_pmc)
-    switch (st->dest.sig & PARROT_ARG_TYPE_MASK) {
-        case PARROT_ARG_INTVAL:
-            UVal_int(st->val) = VTABLE_get_integer(interp, UVal_pmc(st->val));
-            break;
-        case PARROT_ARG_FLOATVAL:
-            UVal_num(st->val) = VTABLE_get_number(interp, UVal_pmc(st->val));
-            break;
-        case PARROT_ARG_STRING:
-            UVal_str(st->val) = VTABLE_get_string(interp, UVal_pmc(st->val));
-            break;
-        default:
-            break;
-    }
-}
-
-
-/*
-
-=item C<static void check_for_opt_flag(PARROT_INTERP, call_state *st, int
-has_arg)>
-
-Processes the next argument, if it has the optional flag set.
-Otherwise moves on.
-
-=cut
-
-*/
-
-static void
-check_for_opt_flag(PARROT_INTERP, ARGMOD(call_state *st), int has_arg)
-{
-    ASSERT_ARGS(check_for_opt_flag)
-    INTVAL idx;
-    call_state_item * const dest = &st->dest;
-
-    ++st->optionals;
-
-    /* look at the next arg */
-    dest->i++;
-    if (dest->i >= dest->n)
-        return;
-
-    next_arg_sig(interp, dest);
-
-    /* if this isn't an :opt_flag argument, we need to reset things
-     * and go to the next argument */
-    if (!(st->dest.sig & PARROT_ARG_OPT_FLAG)) {
-        dest->i--;
-        return;
-    }
-
-    /* we're at an :opt_flag argument, so actually store something */
-    idx = st->dest.u.op.pc[st->dest.i];
-
-    --st->params;
-    PARROT_ASSERT(idx >= 0);
-    CTX_REG_INT(st->dest.ctx, idx) = has_arg;
-}
-
-
-/*
-
-=item C<static void clone_key_arg(PARROT_INTERP, call_state *st)>
-
-Replaces any src registers by their values (done inside clone).  This needs a
-test for tailcalls too, but I think there is no syntax to pass a key to a
-tailcalled function or method.
-
-=cut
-
-*/
-
-static void
-clone_key_arg(PARROT_INTERP, ARGMOD(call_state *st))
-{
-    ASSERT_ARGS(clone_key_arg)
-    PMC *key = UVal_pmc(st->val);
-
-    if (!key)
-        return;
-
-    if (key->vtable->base_type != enum_class_Key)
-        return;
-
-    for (; key; key = VTABLE_shift_pmc(interp, key)) {
-        /* register keys have to be cloned */
-        if (PObj_get_FLAGS(key) & KEY_register_FLAG) {
-            Parrot_Context temp_ctx;
-
-            /* clone sets key values according to refered register items */
-            SAVE_OFF_REGS(interp->ctx, (*(st->src.ctx)), temp_ctx)
-            UVal_pmc(st->val) = VTABLE_clone(interp, key);
-            RESTORE_REGS(interp->ctx, temp_ctx)
-            return;
-        }
-    }
-}
-
-
-/*
-
-=item C<static void init_first_dest_named(PARROT_INTERP, call_state *st)>
-
-Initializes dest calling state for the first named arg.
-
-=cut
-
-*/
-
-static void
-init_first_dest_named(PARROT_INTERP, ARGMOD(call_state *st))
-{
-    ASSERT_ARGS(init_first_dest_named)
-    int i, n_named;
-
-    if (st->dest.mode & CALL_STATE_SIG)
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-            "Can't call C function with named arguments");
-
-    st->first_named = st->dest.i;
-    n_named         = 0;
-
-    /* 1) if we were slurpying positional args, we are done, turn it off
-     * 2) set destination named args bit */
-    st->dest.slurp = NULL;
-
-    /* 1) count named args, make sure there is less than 32/64
-     * 2) create slurpy hash if needed */
-    for (i = st->dest.i; i < st->dest.n; ++i) {
-        const INTVAL sig = VTABLE_get_integer_keyed_int(interp,
-                st->dest.u.op.signature, i);
-
-        /* skip the arg name, only count the actual args of the named args */
-        if (!(sig & PARROT_ARG_NAME))
-            continue;
-
-        /* slurpy named args, create slurpy hash */
-        else if (sig & PARROT_ARG_SLURPY_ARRAY) {
-            int idx;
-
-            /* Create PMC for slurpy mode and register it; we must do this
-             * otherwise it may get collected. */
-            st->dest.slurp = pmc_new(interp,
-                Parrot_get_ctx_HLL_type(interp, enum_class_Hash));
-
-            /* pass the slurpy hash */
-            idx = st->dest.u.op.pc[i];
-            CTX_REG_PMC(st->dest.ctx, idx) = st->dest.slurp;
-        }
-        /* must be the actual arg of a named arg, count it */
-        else
-            n_named++;
-    }
-
-    /* only 32/64 named args allowed;
-     * uses UINTVAL as a bitfield to detect duplicates */
-    if (n_named >= (int)(sizeof (UINTVAL) * 8))
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-            "Too many named arguments");
-
-    st->named_done = 0;
-}
-
-
-/*
-
-=item C<static int locate_named_named(PARROT_INTERP, call_state *st)>
-
-Locates a destination argument name, returning 0 if not found.
-
-=cut
-
-*/
-
-static int
-locate_named_named(PARROT_INTERP, ARGMOD(call_state *st))
-{
-    ASSERT_ARGS(locate_named_named)
-    int i;
-    int n_named = -1;
-
-    for (i = st->first_named; i < st->dest.n; ++i) {
-        int idx;
-        STRING *param;
-
-        st->dest.sig = VTABLE_get_integer_keyed_int(interp,
-                st->dest.u.op.signature, i);
-        if (!(st->dest.sig & PARROT_ARG_NAME))
-            continue;
-
-        if (st->dest.sig & PARROT_ARG_SLURPY_ARRAY)
-            return 1;
-
-        n_named++;
-        idx   = st->dest.u.op.pc[i];
-        param = PARROT_ARG_CONSTANT_ISSET(st->dest.sig)
-                ? st->dest.ctx->constants[idx]->u.string
-                : CTX_REG_STR(st->dest.ctx, idx);
-
-        if (st->name == param || Parrot_str_equal(interp, st->name, param)) {
-            ++i;
-            st->dest.sig = VTABLE_get_integer_keyed_int(interp,
-                    st->dest.u.op.signature, i);
-            st->dest.i   = i;
-
-            /* if bit is set we have a duplicate */
-            if (st->named_done & (1 << n_named))
-                Parrot_ex_throw_from_c_args(interp, NULL,
-                    EXCEPTION_INVALID_OPERATION,
-                    "duplicate named argument - '%Ss' not expected", param);
-
-            st->named_done |= 1 << n_named;
-            return 1;
-        }
-    }
-
-    return 0;
-}
-
-
-/*
-
-=item C<static void store_arg(const call_state *st, INTVAL idx)>
-
-Stores the next argument in the destination register appropriately.
-
-=cut
-
-*/
-
-static void
-store_arg(ARGIN(const call_state *st), INTVAL idx)
-{
-    ASSERT_ARGS(store_arg)
-    switch (st->dest.sig & PARROT_ARG_TYPE_MASK) {
-        case PARROT_ARG_INTVAL:
-            CTX_REG_INT(st->dest.ctx, idx) = UVal_int(st->val);
-            break;
-        case PARROT_ARG_FLOATVAL:
-            CTX_REG_NUM(st->dest.ctx, idx) = UVal_num(st->val);
-            break;
-        case PARROT_ARG_STRING:
-            CTX_REG_STR(st->dest.ctx, idx) = UVal_str(st->val);
-            break;
-        case PARROT_ARG_PMC:
-            CTX_REG_PMC(st->dest.ctx, idx) = UVal_pmc(st->val);
-            break;
-        default:
-            break;
-    }
-}
-
-
-/*
-
-=item C<int Parrot_store_arg(PARROT_INTERP, const call_state *st)>
-
-Stores the next function argument into the appropriate destination register.
-Calls C<store_arg> to do most of the work. Returns 0 if an attempt is made
-to store more values then there are in the signature. Returns 1 otherwise.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-int
-Parrot_store_arg(SHIM_INTERP, ARGIN(const call_state *st))
-{
-    ASSERT_ARGS(Parrot_store_arg)
-    INTVAL idx;
-    if (st->dest.i >= st->dest.n)
-        return 0;
-
-    PARROT_ASSERT(st->dest.mode & CALL_STATE_OP);
-    idx = st->dest.u.op.pc[st->dest.i];
-    PARROT_ASSERT(idx >= 0);
-    store_arg(st, idx);
-
-    return 1;
-}
-
-
-/*
-
-=item C<static void too_few(PARROT_INTERP, const call_state *st, const char
-*action)>
-
-Throws an exception if there are too few arguments passed.
-
-=cut
-
-*/
-
-static void
-too_few(PARROT_INTERP, ARGIN(const call_state *st), ARGIN(const char *action))
-{
-    ASSERT_ARGS(too_few)
-    const int max_expected_args = st->params;
-    const int min_expected_args = max_expected_args - st->optionals;
-
-    if (st->n_actual_args < min_expected_args) {
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-            "too few arguments passed (%d) - %s%d %s%s expected",
-            st->n_actual_args,
-            (min_expected_args < max_expected_args ? "at least " : ""),
-            min_expected_args, action,
-            (min_expected_args == 1 ? "" : "s"));
-    }
-}
-
-
-/*
-
-=item C<static void too_many(PARROT_INTERP, const call_state *st, const char
-*action)>
-
-Throws an exception if there are too many arguments passed.
-
-=cut
-
-*/
-
-static void
-too_many(PARROT_INTERP, ARGIN(const call_state *st), ARGIN(const char *action))
-{
-    ASSERT_ARGS(too_many)
-    const int max_expected_args = st->params;
-    const int min_expected_args = max_expected_args - st->optionals;
-
-    if (st->n_actual_args > max_expected_args) {
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-            "too many arguments passed (%d) - %s%d %s%s expected",
-            st->n_actual_args,
-            (min_expected_args < max_expected_args ? "at most " : ""),
-            max_expected_args, action,
-            (max_expected_args == 1 ? "" : "s"));
-    }
-}
-
-
-/*
-
-=item C<static void null_val(int sig, call_state *st)>
-
-Adds a null value to the appropriate register.
-
-=cut
-
-*/
-
-static void
-null_val(int sig, ARGMOD(call_state *st))
-{
-    ASSERT_ARGS(null_val)
-    switch (sig & PARROT_ARG_TYPE_MASK) {
-        case PARROT_ARG_INTVAL:   UVal_int(st->val) = 0;       break;
-        case PARROT_ARG_FLOATVAL: UVal_num(st->val) = 0.0;     break;
-        case PARROT_ARG_STRING:   UVal_str(st->val) = NULL;    break;
-        case PARROT_ARG_PMC:      UVal_pmc(st->val) = PMCNULL; break;
-        default:
-            break;
-    }
-}
-
-
-/*
-
-=item C<static void check_named(PARROT_INTERP, call_state *st)>
-
-Makes sure that all required named args are set and that all optional
-args and flags are set to null and false if not present.
-
-A named arg takes the form of
-
-    STRING* name, [INPS] actual_arg,
-
-or
-
-    STRING* name, [INPS] actual_arg, int opt_arg_flag
-
-=cut
-
-*/
-
-static void
-check_named(PARROT_INTERP, ARGMOD(call_state *st))
-{
-    ASSERT_ARGS(check_named)
-    int i;
-    int n_named = -1;
-
-    for (i = st->first_named; i < st->dest.n; ++i) {
-        /* verify that a name exists */
-        const INTVAL sig = st->dest.sig =
-            VTABLE_get_integer_keyed_int(interp, st->dest.u.op.signature, i);
-        if (sig & PARROT_ARG_NAME) {
-            INTVAL arg_sig;
-            int last_name_pos;
-
-            /* if slurpy then no errors, return */
-            if (sig & PARROT_ARG_SLURPY_ARRAY)
-                return;
-
-            n_named++;
-            last_name_pos = i;
-
-            /* move on to the actual arg */
-            i++;
-
-            /* verify that an actual arg exists */
-            arg_sig = st->dest.sig = VTABLE_get_integer_keyed_int(interp,
-                    st->dest.u.op.signature, i);
-            PARROT_ASSERT(!(arg_sig & PARROT_ARG_NAME));
-
-            /* if this named arg is already filled, continue */
-            if (st->named_done & (1 << n_named)) {
-                if (i + 1 < st->dest.n) {
-                    arg_sig = st->dest.sig = VTABLE_get_integer_keyed_int(interp,
-                            st->dest.u.op.signature, i + 1);
-
-                    /* skip associated opt flag arg as well */
-                    if (arg_sig & PARROT_ARG_OPT_FLAG)
-                        i++;
-                }
-
-                continue;
-            }
-            else if (arg_sig & PARROT_ARG_OPTIONAL) {
-                INTVAL idx;
-                null_val(arg_sig, st);
-                idx = st->dest.u.op.pc[i];
-                store_arg(st, idx);
-
-                /* Don't walk off the end of the array */
-                if (i+1 >= st->dest.n)
-                    continue;
-                arg_sig = st->dest.sig = VTABLE_get_integer_keyed_int(interp,
-                        st->dest.u.op.signature, i+1);
-                if (arg_sig & PARROT_ARG_OPT_FLAG) {
-                    i++;
-                    idx = st->dest.u.op.pc[i];
-                    CTX_REG_INT(st->dest.ctx, idx) = 0;
-                }
-                continue;
-            }
-            else {
-                const   INTVAL idx   = st->dest.u.op.pc[last_name_pos];
-                STRING * const param = PARROT_ARG_CONSTANT_ISSET(sig)
-                    ? st->dest.ctx->constants[idx]->u.string
-                    : CTX_REG_STR(st->dest.ctx, idx);
-
-                Parrot_ex_throw_from_c_args(interp, NULL,
-                    EXCEPTION_INVALID_OPERATION,
-                    "too few arguments passed"
-                    " - missing required named arg '%Ss'", param);
-            }
-        }
-        else
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-                "invalid arg type in named portion of args");
-    }
-}
-
-
-/*
-
-=item C<static void init_call_stats(call_state *st)>
-
-Sets the default values of the passed C<call_state>.
-
-=cut
-
-*/
-
-static void
-init_call_stats(ARGMOD(call_state *st))
-{
-    ASSERT_ARGS(init_call_stats)
-    /* initial guess, adjusted for :flat args */
-    st->n_actual_args = st->src.n;
-
-    st->optionals     = 0;
-    st->params        = st->dest.n;
-    st->name          = NULL;
-    st->key           = PMCNULL;
-    st->first_named   = -1;
-}
-
-
-/*
-
-=item C<void Parrot_process_args(PARROT_INTERP, call_state *st, arg_pass_t
-param_or_result)>
-
-Gets args for the current function call and puts them into position.
-First it gets the positional non-slurpy parameters, then the positional
-slurpy parameters, and finally the named parameters.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-Parrot_process_args(PARROT_INTERP, ARGMOD(call_state *st), arg_pass_t param_or_result)
-{
-    ASSERT_ARGS(Parrot_process_args)
-    int n_named;
-    int err_check = 1;
-    call_state_item *src, *dest;
-
-    const char * const action = (param_or_result == PARROT_PASS_RESULTS)
-        ? "result" : "param";
-
-    /* Check if we should be throwing errors. This can be configured separately
-     * for parameters and return values. */
-    if (param_or_result == PARROT_PASS_RESULTS) {
-        if (!PARROT_ERRORS_test(interp, PARROT_ERRORS_RESULT_COUNT_FLAG))
-            err_check = 0;
-    }
-    else if (!PARROT_ERRORS_test(interp, PARROT_ERRORS_PARAM_COUNT_FLAG))
-            err_check = 0;
-
-    init_call_stats(st);
-
-    src  = &st->src;
-    dest = &st->dest;
-
-    /* 1st: Positional non-:slurpy */
-    for (; dest->i < dest->n; dest->i++) {
-        INTVAL idx;
-        int has_arg;
-
-        /* check if the next dest arg is :slurpy */
-        next_arg_sig(interp, dest);
-        if (dest->sig & PARROT_ARG_SLURPY_ARRAY)
-            break;
-
-        /* Check if there is another argument. We need to store the value to
-         * handle :opt_flag, which needs to know if there was a preceding
-         * argument. */
-        has_arg = Parrot_fetch_arg(interp, st);
-
-        /* if the src arg is named, we're done here */
-        if (st->name) {
-            /* but first, take care of any :optional arguments */
-
-            /*
-             * Workaround for several argument passing problems
-             * RT #54860 and others
-             * Save current value while setting the optional
-             */
-            const UnionVal old_value = st->val;
-
-            while (dest->sig & PARROT_ARG_OPTIONAL) {
-                null_val(st->dest.sig, st);
-
-                /* actually store the argument */
-                idx = st->dest.u.op.pc[st->dest.i];
-                PARROT_ASSERT(idx >= 0);
-                store_arg(st, idx);
-
-                check_for_opt_flag(interp, st, 0);
-
-                /* next dest arg */
-                dest->i++;
-                next_arg_sig(interp, dest);
-            }
-
-            /* Restore value */
-            st->val = old_value;
-
-            break;
-        }
-
-        /* if the dest is a named argument, we need to fill it as a positional
-         * since no named arguments have been given. so skip the name. */
-        if (dest->sig & PARROT_ARG_NAME) {
-            if (!has_arg)
-                break;
-            dest->i++;
-            next_arg_sig(interp, dest);
-        }
-
-        /* if there *is* an arg, convert it */
-        if (has_arg) {
-            src->used = 1;
-            Parrot_convert_arg(interp, st);
-        }
-
-        /* if this is an optional argument, null it */
-        else if (dest->sig & PARROT_ARG_OPTIONAL)
-            null_val(st->dest.sig, st);
-
-        /* there's no argument - throw an exception (if we're in to that) */
-        else if (err_check)
-            too_few(interp, st, action);
-
-        /* otherwise, we're done */
-        else
-            return;
-
-        /* actually store the argument */
-        idx = st->dest.u.op.pc[st->dest.i];
-        PARROT_ASSERT(idx >= 0);
-        store_arg(st, idx);
-
-        /* if we're at an :optional argument, check for an :opt_flag */
-        if (dest->sig & PARROT_ARG_OPTIONAL)
-            check_for_opt_flag(interp, st, has_arg);
-    }
-
-    /* 2nd: Positional :slurpy */
-    if (dest->sig & PARROT_ARG_SLURPY_ARRAY && !(dest->sig & PARROT_ARG_NAME)) {
-        PMC * const  array = pmc_new(interp,
-                Parrot_get_ctx_HLL_type(interp, enum_class_ResizablePMCArray));
-        const INTVAL idx   = st->dest.u.op.pc[dest->i];
-
-        PARROT_ASSERT(idx >= 0);
-
-        /* Must register this PMC or it may get collected when only the struct
-         * references it. */
-        CTX_REG_PMC(st->dest.ctx, idx) = array;
-
-        while (Parrot_fetch_arg(interp, st)) {
-            /* if the src arg is named, we're done here */
-            if (st->name)
-                break;
-
-            src->used = 1;
-
-            /* we have to convert to a PMC so we can put it in the PMC array */
-            dest->sig |= PARROT_ARG_PMC;
-            Parrot_convert_arg(interp, st);
-
-            VTABLE_push_pmc(interp, array, UVal_pmc(st->val));
-        }
-
-        dest->i++;
-    }
-
-    /* is there another argument? if we're throwing errors, that's an error */
-    if (err_check && Parrot_fetch_arg(interp, st)
-    && !st->name  && !(dest->sig & PARROT_ARG_NAME))
-        too_many(interp, st, action);
-
-    /* are we at the end? */
-    if (dest->i == dest->n)
-        return;
-
-    /* 3rd: :named */
-    init_first_dest_named(interp, st);
-    n_named = 0;
-
-    while (Parrot_fetch_arg(interp, st)) {
-        src->used = 1;
-
-        if (!st->name)
-            Parrot_ex_throw_from_c_args(interp, NULL, 0,
-               "positional inside named args at position %i",
-               st->src.i - n_named);
-
-        if (!locate_named_named(interp, st))
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-                "too many named arguments - '%Ss' not expected", st->name);
-
-        n_named++;
-
-        /* if the dest arg is :named :slurpy */
-        if (dest->sig & PARROT_ARG_SLURPY_ARRAY) {
-            /* Convert to a PMC to store in the hash */
-            dest->sig |= PARROT_ARG_PMC;
-            Parrot_convert_arg(interp, st);
-            VTABLE_set_pmc_keyed_str(interp, dest->slurp, st->name, UVal_pmc(st->val));
-        }
-        else {
-            Parrot_convert_arg(interp, st);
-            Parrot_store_arg(interp, st);
-
-            /* if we're at an :optional argument, check for an :opt_flag */
-            if (dest->sig & PARROT_ARG_OPTIONAL)
-                check_for_opt_flag(interp, st, 1);
-        }
-
-        /* otherwise this doesn't get reset and we can't catch positional args
-         * inside of named args */
-        st->name = NULL;
-    }
-
-    check_named(interp, st);
-}
-
-
-/*
-
-=item C<void Parrot_convert_arg(PARROT_INTERP, call_state *st)>
-
-Converts a source argument to the expected destination type.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-Parrot_convert_arg(PARROT_INTERP, ARGMOD(call_state *st))
-{
-    ASSERT_ARGS(Parrot_convert_arg)
-    /* register key args have to be cloned */
-    if ((st->src.sig & PARROT_ARG_TYPE_MASK) == PARROT_ARG_PMC)
-        clone_key_arg(interp, st);
-
-    /* if types are already equivalent, no need to convert */
-    if (PARROT_ARG_TYPE(st->dest.sig) == PARROT_ARG_TYPE(st->src.sig))
-        return;
-
-    /* convert */
-    switch (st->src.sig & PARROT_ARG_TYPE_MASK) {
-        case PARROT_ARG_INTVAL:   convert_arg_from_int(interp, st); break;
-        case PARROT_ARG_FLOATVAL: convert_arg_from_num(interp, st); break;
-        case PARROT_ARG_STRING:   convert_arg_from_str(interp, st); break;
-        case PARROT_ARG_PMC:      convert_arg_from_pmc(interp, st); break;
-        default:
-            break;
-    }
-}
-
-
-/*
-
-=item C<void parrot_pass_args(PARROT_INTERP, Parrot_Context *src_ctx,
-Parrot_Context *dest_ctx, opcode_t *src_indexes, opcode_t *dest_indexes,
-arg_pass_t param_or_result)>
-
-Main argument passing routine.
-
-Prelims: code segments aren't yet switched, so the current constants are still
-that of the caller.  The destination context is already created and set,
-C<src_ctx> point to the caller's context. C<dst_seg> has the constants of the
-destination.
-
-C<what> is either C<PARROT_OP_get_params_pc> or C<PARROT_OP_get_results_pc>.
-With the former arguments are passed from the caller into a subroutine, the
-latter handles return values and yields.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-parrot_pass_args(PARROT_INTERP,
-        ARGMOD(Parrot_Context *src_ctx), ARGMOD(Parrot_Context *dest_ctx),
-        ARGMOD_NULLOK(opcode_t *src_indexes), ARGMOD_NULLOK(opcode_t *dest_indexes),
-        arg_pass_t param_or_result)
-{
-    ASSERT_ARGS(parrot_pass_args)
-    call_state st;
-    PMC *src_signature, *dest_signature;
-
-    if (param_or_result == PARROT_PASS_PARAMS) {
-        src_signature            = interp->args_signature;
-        dest_signature           = interp->params_signature;
-        interp->args_signature   = NULL;
-        interp->params_signature = NULL;
-    }
-    else /* (param_or_result == PARROT_PASS_RESULTS) */ {
-        src_signature               = interp->returns_signature;
-        dest_signature              = dest_ctx->results_signature;
-        interp->returns_signature   = NULL;
-        dest_ctx->results_signature = NULL;
-    }
-
-    Parrot_init_arg_indexes_and_sig_pmc(interp, src_ctx, src_indexes,
-        src_signature, &st.src);
-
-    Parrot_init_arg_indexes_and_sig_pmc(interp, dest_ctx, dest_indexes,
-        dest_signature, &st.dest);
-
-    Parrot_process_args(interp, &st, param_or_result);
-
-    /* If we created a slurpy, we had to GC register it so it did not get
-     * collected during arg processing; we'll now unregister it. */
-}
-
-
-/*
-
-=item C<opcode_t * parrot_pass_args_fromc(PARROT_INTERP, const char *sig,
-opcode_t *dest, Parrot_Context *old_ctxp, va_list ap)>
-
-Passes arguments from C code with given signature to a Parrot Sub.
-Prerequisites are like above.
-
-=cut
-
-*/
-
-PARROT_CANNOT_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-opcode_t *
-parrot_pass_args_fromc(PARROT_INTERP, ARGIN(const char *sig),
-        ARGMOD(opcode_t *dest), ARGIN(Parrot_Context *old_ctxp), va_list ap)
-{
-    ASSERT_ARGS(parrot_pass_args_fromc)
-    call_state st;
-
-    Parrot_init_arg_op(interp, CONTEXT(interp), dest, &st.dest);
-    Parrot_init_arg_sig(interp, old_ctxp, sig, PARROT_VA_TO_VAPTR(ap), &st.src);
-    Parrot_process_args(interp, &st, PARROT_PASS_PARAMS);
-    return dest + st.dest.n + 2;
-}
-
-
-/*
-
-=item C<static int set_retval_util(PARROT_INTERP, const char *sig,
-Parrot_Context *ctx, call_state *st)>
-
-Adds the current return parameter to the current context, and fetches
-the next return parameter from the call state object.
-
-=cut
-
-*/
-
-static int
-set_retval_util(PARROT_INTERP, ARGIN(const char *sig),
-    ARGIN(Parrot_Context *ctx), ARGMOD(call_state *st))
-{
-    ASSERT_ARGS(set_retval_util)
-    opcode_t * const src_pc = interp->current_returns;
-    int              todo   = Parrot_init_arg_op(interp, ctx, src_pc, &st->src);
-
-    interp->current_returns = NULL;
-
-    if (todo) {
-        todo = Parrot_init_arg_sig(interp, CONTEXT(interp), sig, NULL,
-            &st->dest);
-
-        if (todo) {
-            Parrot_fetch_arg(interp, st);
-            Parrot_convert_arg(interp, st);
-            return 1;
-        }
-    }
-
-    return 0;
-}
-
-
-/*
-
-=item C<void * set_retval(PARROT_INTERP, int sig_ret, Parrot_Context *ctx)>
-
-Handles void and pointer (PMC *, STRING *) return values.  Returns a PMC,
-STRING, or NULL pointer as appropriate.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-void *
-set_retval(PARROT_INTERP, int sig_ret, ARGIN(Parrot_Context *ctx))
-{
-    ASSERT_ARGS(set_retval)
-    call_state st;
-
-    if (!sig_ret || sig_ret == 'v')
-        return NULL;
-
-    switch (sig_ret) {
-        case 'S':
-            if (set_retval_util(interp, "S", ctx, &st))
-                return UVal_str(st.val);
-        case 'P':
-            if (set_retval_util(interp, "P", ctx, &st)) {
-                PMC *retval = UVal_pmc(st.val);
-                return (void *)retval;
-            }
-        default:
-            return NULL;
-    }
-}
-
-
-/*
-
-=item C<INTVAL set_retval_i(PARROT_INTERP, int sig_ret, Parrot_Context *ctx)>
-
-Handles an INTVAL return value, returning its value if present and 0 otherwise.
-
-=cut
-
-*/
-
-INTVAL
-set_retval_i(PARROT_INTERP, int sig_ret, ARGIN(Parrot_Context *ctx))
-{
-    ASSERT_ARGS(set_retval_i)
-    call_state st;
-
-    if (sig_ret != 'I')
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-            "return signature not 'I'");
-
-    if (set_retval_util(interp, "I", ctx, &st))
-        return UVal_int(st.val);
-
-    return 0;
-}
-
-
-/*
-
-=item C<FLOATVAL set_retval_f(PARROT_INTERP, int sig_ret, Parrot_Context *ctx)>
-
-Handles a FLOATVAL return value, returning its value if present and 0.0
-otherwise.
-
-=cut
-
-*/
-
-FLOATVAL
-set_retval_f(PARROT_INTERP, int sig_ret, ARGIN(Parrot_Context *ctx))
-{
-    ASSERT_ARGS(set_retval_f)
-    call_state st;
-
-    if (sig_ret != 'N')
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-            "return signature not 'N'");
-
-    if (set_retval_util(interp, "N", ctx, &st))
-        return UVal_num(st.val);
-
-    return 0.0;
-}
-
-
-/*
-
-=item C<STRING* set_retval_s(PARROT_INTERP, int sig_ret, Parrot_Context *ctx)>
-
-Handles a STRING return value, returning its pointer if present and NULL
-otherwise.
-
-=cut
-
-*/
-
-PARROT_CAN_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-STRING*
-set_retval_s(PARROT_INTERP, int sig_ret, ARGIN(Parrot_Context *ctx))
-{
-    ASSERT_ARGS(set_retval_s)
-    call_state st;
-
-    if (sig_ret != 'S')
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-            "return signature not 'S'");
-
-    if (set_retval_util(interp, "S", ctx, &st))
-        return UVal_str(st.val);
-
-    return NULL;
-}
-
-
-/*
-
-=item C<PMC* set_retval_p(PARROT_INTERP, int sig_ret, Parrot_Context *ctx)>
-
-Handles a PMC return value, returning the PMC pointer if present and NULL
-otherwise.
-
-=cut
-
-*/
-
-PARROT_CAN_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-PMC*
-set_retval_p(PARROT_INTERP, int sig_ret, ARGIN(Parrot_Context *ctx))
-{
-    ASSERT_ARGS(set_retval_p)
-    call_state st;
-
-    if (sig_ret != 'P')
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-            "return signature not 'P'");
-
-    if (set_retval_util(interp, "P", ctx, &st))
-        return UVal_pmc(st.val);
-
-    return NULL;
-}
-
-
-/*
-
-=item C<static void commit_last_arg(PARROT_INTERP, int index, int cur, opcode_t
-*n_regs_used, int seen_arrow, PMC * const *sigs, opcode_t **indexes,
-Parrot_Context *ctx, PMC *pmc, va_list *list)>
-
-Called by C<Parrot_PCCINVOKE> when it reaches the end of each arg in the arg
-signature.  See C<Parrot_PCCINVOKE> for signature syntax.
-
-=cut
-
-*/
-
-static void
-commit_last_arg(PARROT_INTERP, int index, int cur,
-    ARGMOD(opcode_t *n_regs_used), int seen_arrow, ARGIN(PMC * const *sigs),
-    ARGMOD(opcode_t **indexes), ARGMOD(Parrot_Context *ctx),
-    ARGIN_NULLOK(PMC *pmc), ARGIN(va_list *list))
-{
-    ASSERT_ARGS(commit_last_arg)
-    int reg_offset = 0;
-
-    /* invocant already commited, just return */
-    if (seen_arrow == 0 && index == 0 && pmc)
-        return;
-
-    /* calculate arg's register offset */
-    switch (cur & PARROT_ARG_TYPE_MASK) { /* calc reg offset */
-        case PARROT_ARG_INTVAL:
-            reg_offset = n_regs_used[seen_arrow * 4 + REGNO_INT]++; break;
-        case PARROT_ARG_FLOATVAL:
-            reg_offset = n_regs_used[seen_arrow * 4 + REGNO_NUM]++; break;
-        case PARROT_ARG_STRING:
-            reg_offset = n_regs_used[seen_arrow * 4 + REGNO_STR]++; break;
-        case PARROT_ARG_PMC :
-            reg_offset = n_regs_used[seen_arrow * 4 + REGNO_PMC]++; break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-                "Parrot_PCCINVOKE: invalid reg type");
-    }
-
-    /* set the register offset into the index int[] */
-    indexes[seen_arrow][index] = reg_offset;
-
-    /* set the PARROT_ARG_FLAGS into the signature FIA */
-    VTABLE_set_integer_keyed_int(interp, sigs[seen_arrow], index, cur);
-
-    /* perform the arg accessor function, assigning the arg to its
-     * corresponding register */
-    if (!seen_arrow) {
-        switch (cur & PARROT_ARG_TYPE_MASK) {
-            case PARROT_ARG_INTVAL:
-                CTX_REG_INT(ctx, reg_offset) = va_arg(*list, INTVAL);   break;
-            case PARROT_ARG_FLOATVAL:
-                CTX_REG_NUM(ctx, reg_offset) = va_arg(*list, FLOATVAL); break;
-            case PARROT_ARG_STRING:
-                CTX_REG_STR(ctx, reg_offset) = va_arg(*list, STRING *); break;
-            case PARROT_ARG_PMC:
-                CTX_REG_PMC(ctx, reg_offset) = va_arg(*list, PMC *);    break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL,
-                    EXCEPTION_INVALID_OPERATION,
-                    "Parrot_PCCINVOKE: invalid reg type");
-        }
-    }
-}
-
-/*
-
-=item C<static Parrot_Context * count_signature_elements(PARROT_INTERP, const
-char *signature, PMC *args_sig, PMC *results_sig, int flag)>
-
-Counts the number of each type of register in a signature object. Returns
-the total number of parameter arguments, the total number of result
-arguments, and the number of each type needed for register allocation.
-Adds the necessary registers to a new context and returns the context.
-
-=cut
-
-*/
-
-PARROT_CANNOT_RETURN_NULL
-static Parrot_Context *
-count_signature_elements(PARROT_INTERP, ARGIN(const char *signature),
-    ARGMOD(PMC *args_sig), ARGMOD(PMC *results_sig), int flag)
-{
-    ASSERT_ARGS(count_signature_elements)
-    const char  *x;
-    unsigned int seen_arrow  = 0;
-
-    /*Count of number of each type of arg and result, INSP->INSP */
-    int          max_regs[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
-
-    /* variables from PCCINVOKE impl in PCCMETHOD.pm */
-    /* args INSP, returns INSP */
-    INTVAL n_regs_used[]     = { 0, 0, 0, 0, 0, 0, 0, 0 };
-
-    /* # of args, # of results */
-    int arg_ret_cnt[2]       = { 0, 0 };
-
-    /* Increment these values if we are not calling from a CallSignature
-       PMC */
-    if (flag) {
-        arg_ret_cnt[seen_arrow]++;
-        max_regs[REGNO_PMC]++;
-    }
-
-    /* Loop through the signature string to count the number of each
-       type of object required. We need to know so we can allocate
-       an appropriate number of registers for it. */
-    for (x = signature; *x != '\0'; x++) {
-        switch (*x) {
-            case '-':
-                /* detect -> separator */
-                seen_arrow = 1;
-                ++x;
-                if (*x != '>')
-                    Parrot_ex_throw_from_c_args(interp, NULL,
-                        EXCEPTION_INVALID_OPERATION,
-                        "PCCINVOKE: invalid signature separator %c!",
-                        *x);
-                break;
-            case 'I':
-                arg_ret_cnt[seen_arrow]++;
-                max_regs[seen_arrow * 4 + REGNO_INT]++;
-                break;
-            case 'N':
-                arg_ret_cnt[seen_arrow]++;
-                max_regs[seen_arrow * 4 + REGNO_NUM]++;
-                break;
-            case 'S':
-                arg_ret_cnt[seen_arrow]++;
-                max_regs[seen_arrow * 4 + REGNO_STR]++;
-                break;
-            case 'P':
-                arg_ret_cnt[seen_arrow]++;
-                {
-                    /* Lookahead to see if PMC is marked as invocant */
-                    if (*(++x) == 'i') {
-                        max_regs[REGNO_PMC]++;
-                    }
-                    else {
-                        x--; /* Undo lookahead */
-                        max_regs[seen_arrow * 4 + REGNO_PMC]++;
-                    }
-                }
-                break;
-            case 'f':
-            case 'n':
-            case 's':
-            case 'o':
-            case 'p':
-            /* case 'l': */ /* lookahead parameter */
-            case 'i':
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL,
-                    EXCEPTION_INVALID_OPERATION,
-                    "Parrot_PCCINVOKE: invalid reg type %c!", *x);
-        }
-    }
-
-    /* calculate max reg types needed for both args and results */
-    n_regs_used[0] = PARROT_MAX(max_regs[0], max_regs[4]);
-    n_regs_used[1] = PARROT_MAX(max_regs[1], max_regs[5]);
-    n_regs_used[2] = PARROT_MAX(max_regs[2], max_regs[6]);
-    n_regs_used[3] = PARROT_MAX(max_regs[3], max_regs[7]);
-
-    /* initialize arg and return sig FIAs with collected info */
-    if (arg_ret_cnt[0] > 0)
-        VTABLE_set_integer_native(interp, args_sig, arg_ret_cnt[0]);
-
-    if (arg_ret_cnt[1] > 0)
-        VTABLE_set_integer_native(interp, results_sig, arg_ret_cnt[1]);
-
-    return Parrot_push_context(interp, n_regs_used);
-}
-
-/*
-
-=item C<static void commit_last_arg_sig_object(PARROT_INTERP, int index, int
-cur, opcode_t *n_regs_used, int seen_arrow, PMC * const *sigs, opcode_t
-**indexes, Parrot_Context *ctx, PMC *sig_obj)>
-
-Called by Parrot_pcc_invoke_from_sig_object when it reaches the end of each
-arg in the arg signature.  See C<Parrot_pcc_invoke_from_sig_object> for
-signature syntax.
-
-=cut
-
-*/
-
-static void
-commit_last_arg_sig_object(PARROT_INTERP, int index, int cur,
-    ARGMOD(opcode_t *n_regs_used), int seen_arrow, ARGIN(PMC * const *sigs),
-    ARGMOD(opcode_t **indexes), ARGMOD(Parrot_Context *ctx),
-    ARGIN(PMC *sig_obj))
-{
-    ASSERT_ARGS(commit_last_arg_sig_object)
-    int reg_offset = 0;
-
-    /* calculate arg's register offset */
-    switch (cur & PARROT_ARG_TYPE_MASK) { /* calc reg offset */
-        case PARROT_ARG_INTVAL:
-            reg_offset = n_regs_used[seen_arrow * 4 + REGNO_INT]++; break;
-        case PARROT_ARG_FLOATVAL:
-            reg_offset = n_regs_used[seen_arrow * 4 + REGNO_NUM]++; break;
-        case PARROT_ARG_STRING:
-            reg_offset = n_regs_used[seen_arrow * 4 + REGNO_STR]++; break;
-        case PARROT_ARG_PMC :
-            if (cur & PARROT_ARG_INVOCANT) {
-                if (seen_arrow == 0 && index == 0) {
-                    n_regs_used[REGNO_PMC]++;
-                    reg_offset = 0;
-                }
-                else {
-                    Parrot_ex_throw_from_c_args(interp, NULL,
-                            EXCEPTION_INVALID_OPERATION,
-                            "Parrot_pcc_invoke: Only the first parameter can be an invocant %d, %d",
-                            seen_arrow, index);
-                }
-            }
-            else {
-                reg_offset = n_regs_used[seen_arrow * 4 + REGNO_PMC]++;
-            }
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-                "Parrot_PCCINVOKE: invalid reg type");
-    }
-
-    /* set the register offset into the index int[] */
-    indexes[seen_arrow][index] = reg_offset;
-
-    /* set the PARROT_ARG_FLAGS into the signature FIA */
-    VTABLE_set_integer_keyed_int(interp, sigs[seen_arrow], index, cur);
-
-    /* perform the arg accessor function, assigning the arg to its
-     * corresponding register */
-    if (!seen_arrow) {
-        switch (cur & PARROT_ARG_TYPE_MASK) {
-            case PARROT_ARG_INTVAL:
-                CTX_REG_INT(ctx, reg_offset) = VTABLE_get_integer_keyed_int(interp, sig_obj, index);
-                break;
-            case PARROT_ARG_FLOATVAL:
-                CTX_REG_NUM(ctx, reg_offset) = VTABLE_get_number_keyed_int(interp, sig_obj, index);
-                break;
-            case PARROT_ARG_STRING:
-                CTX_REG_STR(ctx, reg_offset) = VTABLE_get_string_keyed_int(interp, sig_obj, index);
-                break;
-            case PARROT_ARG_PMC:
-                CTX_REG_PMC(ctx, reg_offset) = VTABLE_get_pmc_keyed_int(interp, sig_obj, index);
-                if (cur & PARROT_ARG_INVOCANT) {
-                    interp->current_object = CTX_REG_PMC(ctx, reg_offset);
-                }
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL,
-                    EXCEPTION_INVALID_OPERATION,
-                    "Parrot_pcc_invoke_from_sig_object: invalid reg type");
-        }
-    }
-}
-
-/*
-
-=item C<static void set_context_sig_returns(PARROT_INTERP, Parrot_Context *ctx,
-opcode_t **indexes, const char *ret_x, PMC *result_list)>
-
-Sets the subroutine return arguments in the context C<ctx>. Takes a C string
-for the return signature C<ret_x> and a list of return parameters C<result_list>.
+=head1 FUNCTIONS
 
-=cut
-
-*/
-
-static void
-set_context_sig_returns(PARROT_INTERP,
-    ARGMOD(Parrot_Context *ctx), ARGMOD(opcode_t **indexes),
-    ARGIN_NULLOK(const char *ret_x), ARGMOD(PMC *result_list))
-{
-    ASSERT_ARGS(set_context_sig_returns)
-    const char   *x;
-    STRING       * const empty_string = CONST_STRING(interp, "");
-    unsigned int  index        = 0;
-    unsigned int  seen_arrow   = 1;
-
-    /* result_accessors perform the arg accessor function,
-     * assigning the corresponding registers to the result variables */
-    for (x = ret_x; x && *x; x++) {
-        PMC * const result_item = VTABLE_get_pmc_keyed_int(interp, result_list, index);
-        if (isupper((unsigned char)*x)) {
-            switch (*x) {
-                case 'I':
-                    {
-                    VTABLE_set_integer_native(interp, result_item,
-                            CTX_REG_INT(ctx, indexes[seen_arrow][index]));
-                    }
-                    break;
-                case 'N':
-                    {
-                    VTABLE_set_number_native(interp, result_item,
-                            CTX_REG_NUM(ctx, indexes[seen_arrow][index]));
-                    }
-                    break;
-                case 'S':
-                    {
-                    VTABLE_set_string_native(interp, result_item,
-                            CTX_REG_STR(ctx, indexes[seen_arrow][index]));
-                    }
-                    break;
-                case 'P':
-                    {
-                    VTABLE_set_pmc(interp, result_item,
-                            CTX_REG_PMC(ctx, indexes[seen_arrow][index]));
-                    }
-                    break;
-                default:
-                    Parrot_ex_throw_from_c_args(interp, NULL,
-                        EXCEPTION_INVALID_OPERATION,
-                        "Parrot_pcc_invoke_from_sig_object: invalid reg type %c!", *x);
-            }
-
-            /* invalidate the CPointer's pointers so that GC doesn't try to
-             * mark stack values -- RT #59880*/
-            VTABLE_set_string_keyed_str(interp, result_item,
-                empty_string, empty_string);
-        }
-    }
-
-    Parrot_pop_context(interp);
-}
-
-/*
-
-=item C<static void set_context_sig_returns_varargs(PARROT_INTERP,
-Parrot_Context *ctx, opcode_t **indexes, const char *ret_x, va_list returns)>
-
-Sets the subroutine return arguments in the context C<ctx>. Takes a C string
-for the return signature C<ret_x> and a varargs list of return parameters C<returns>.
-
-To unify this function with C<set_context_sig_returns>, C<Parrot_PCCINVOKE>
-needs to be changed to convert the va_list of input arguments into a signature
-object, and the results list from that object needs to be passed to this
-function instead of the va_list itself.
+=over 4
 
 =cut
 
 */
 
-static void
-set_context_sig_returns_varargs(PARROT_INTERP, ARGMOD(Parrot_Context *ctx),
-    ARGMOD(opcode_t **indexes), ARGIN(const char *ret_x), va_list returns)
-{
-    ASSERT_ARGS(set_context_sig_returns_varargs)
-    unsigned int index = 0;
-    unsigned int seen_arrow = 1;
-    const char *x;
-
-    /* result_accessors perform the arg accessor function,
-     * assigning the corresponding registers to the result variables */
-    for (x = ret_x; x && *x; x++) {
-        if (isupper((unsigned char)*x)) {
-            switch (*x) {
-                case 'I':
-                    {
-                    INTVAL * const tmpINTVAL = va_arg(returns, INTVAL*);
-                    *tmpINTVAL = CTX_REG_INT(ctx, indexes[seen_arrow][index]);
-                    }
-                    break;
-                case 'N':
-                    {
-                    FLOATVAL * const tmpFLOATVAL = va_arg(returns, FLOATVAL*);
-                    *tmpFLOATVAL = CTX_REG_NUM(ctx, indexes[seen_arrow][index]);
-                    }
-                    break;
-                case 'S':
-                    {
-                    STRING ** const tmpSTRING = va_arg(returns, STRING**);
-                    *tmpSTRING = CTX_REG_STR(ctx, indexes[seen_arrow][index]);
-                    }
-                    break;
-                case 'P':
-                    {
-                    PMC ** const tmpPMC = va_arg(returns, PMC**);
-                    *tmpPMC = CTX_REG_PMC(ctx, indexes[seen_arrow][index]);
-                    }
-                    break;
-                default:
-                    Parrot_ex_throw_from_c_args(interp, NULL,
-                        EXCEPTION_INVALID_OPERATION,
-                        "Parrot_PCCINVOKE: invalid reg type %c!", *x);
-            }
-        }
-    }
-    Parrot_pop_context(interp);
-}
+#include "parrot/parrot.h"
+#include "parrot/runcore_api.h"
+#include "parrot/oplib/ops.h"
+#include "pcc.str"
+#include "pmc/pmc_key.h"
+#include "pmc/pmc_continuation.h"
 
-/*
+/* HEADERIZER HFILE: include/parrot/call.h */
 
-=item C<static const char * set_context_sig_params(PARROT_INTERP, const char
-*signature, INTVAL *n_regs_used, PMC **sigs, opcode_t **indexes, Parrot_Context
-*ctx, PMC *sig_obj)>
-
-Sets the subroutine arguments in the C<ctx> context, according to the
-signature string C<signature>. Currently this function is only called
-from C<Parrot_pcc_invoke_from_sig_object>, but eventually when
-things are unified enough it should be called from C<Parrot_PCCINVOKE>
-as well. The only difference currently between the two implementations
-are the calls to C<commit_last_arg_sig_object> and C<commit_last_arg>.
+/* HEADERIZER BEGIN: static */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
-=cut
+static int do_run_ops(PARROT_INTERP, ARGIN(PMC *sub_obj))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
-*/
+#define ASSERT_ARGS_do_run_ops __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(sub_obj))
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+/* HEADERIZER END: static */
 
-PARROT_CAN_RETURN_NULL
-static const char *
-set_context_sig_params(PARROT_INTERP, ARGIN(const char *signature),
-    ARGMOD(INTVAL *n_regs_used), ARGMOD(PMC **sigs),
-    ARGMOD(opcode_t **indexes), ARGMOD(Parrot_Context *ctx),
-    ARGMOD(PMC *sig_obj))
-{
-    ASSERT_ARGS(set_context_sig_params)
-    /* second loop through signature to build all index and arg_flag
-     * loop also assigns args(up to the ->) to registers */
-    int index      = -1;
-    int seen_arrow =  0;
-    int cur        =  0;
-    const char *ret_x = 0;
-    const char *x;
-
-    for (x = signature; *x != '\0'; x++) {
-        /* detect -> separator */
-        if (*x == '-') {
-
-            /* skip '>' */
-            x++;
-
-            /* allows us to jump directly to the result signature portion
-             * during results assignment */
-            ret_x = x;
-
-            /* save off pointer to results */
-            ret_x++;
-
-            if (index >= 0)
-                commit_last_arg_sig_object(interp, index, cur, n_regs_used,
-                    seen_arrow, sigs, indexes, ctx, sig_obj);
-
-            /* reset parsing state so we can now handle results */
-            seen_arrow =  1;
-            index      = -1;
-
-            /* reset n_regs_used for reuse during result index allocation */
-            n_regs_used[0] = 0;
-            n_regs_used[1] = 0;
-            n_regs_used[2] = 0;
-            n_regs_used[3] = 0;
-        }
-        /* parse arg type */
-        else if (isupper((unsigned char)*x)) {
-            if (index >= 0)
-                commit_last_arg_sig_object(interp, index, cur, n_regs_used, seen_arrow,
-                    sigs, indexes, ctx, sig_obj);
-
-            index++;
-
-            switch (*x) {
-                case 'I': cur = PARROT_ARG_INTVAL;   break;
-                case 'N': cur = PARROT_ARG_FLOATVAL; break;
-                case 'S': cur = PARROT_ARG_STRING;   break;
-                case 'P': cur = PARROT_ARG_PMC;      break;
-                default:
-                  Parrot_ex_throw_from_c_args(interp, NULL,
-                    EXCEPTION_INVALID_OPERATION,
-                    "Parrot_pcc_invoke_from_sig_object: invalid reg type %c!", *x);
-            }
-
-        }
-        /* parse arg adverbs */
-        else if (islower((unsigned char)*x)) {
-            switch (*x) {
-                case 'n': cur |= PARROT_ARG_NAME;         break;
-                case 'f': cur |= PARROT_ARG_FLATTEN;      break;
-                case 's': cur |= PARROT_ARG_SLURPY_ARRAY; break;
-                case 'o': cur |= PARROT_ARG_OPTIONAL;     break;
-                case 'p': cur |= PARROT_ARG_OPT_FLAG;     break;
-                case 'l': cur |= PARROT_ARG_LOOKAHEAD;    break;
-                case 'i': cur |= PARROT_ARG_INVOCANT;     break;
-                default:
-                    Parrot_ex_throw_from_c_args(interp, NULL,
-                        EXCEPTION_INVALID_OPERATION,
-                        "Parrot_pcc_invoke_from_sig_object: invalid adverb type %c!", *x);
-            }
-        }
-    }
 
-    if (index >= 0)
-        commit_last_arg_sig_object(interp, index, cur, n_regs_used, seen_arrow, sigs,
-            indexes, ctx, sig_obj);
-
-    interp->current_args   = indexes[0];
-    interp->args_signature = sigs[0];
-    ctx->current_results   = indexes[1];
-    ctx->results_signature = sigs[1];
-    return ret_x;
-}
+/* Make sure we don't conflict with any other MAX() macros defined elsewhere */
+#define PARROT_MAX(a, b) (((a)) > (b) ? (a) : (b))
 
 /*
 
@@ -2643,20 +64,25 @@
         ARGIN(const char *sig), ...)
 {
     ASSERT_ARGS(Parrot_pcc_invoke_sub_from_c_args)
-    PMC *sig_obj;
+    PMC    *sig_obj;
     va_list args;
+
     va_start(args, sig);
-    sig_obj = Parrot_pcc_build_sig_object_from_varargs(interp, PMCNULL, sig, args);
+    sig_obj = Parrot_pcc_build_sig_object_from_varargs(interp, PMCNULL,
+         sig, args);
     va_end(args);
 
     Parrot_pcc_invoke_from_sig_object(interp, sub_obj, sig_obj);
 }
 
+
 /*
 
 =item C<void Parrot_PCCINVOKE(PARROT_INTERP, PMC* pmc, STRING *method_name,
 const char *signature, ...)>
 
+DEPRECATED. See TT #443. Use Parrot_pcc_invoke_method_from_c_args instead.
+
 C<pmc> is the invocant.
 
 C<method_name> is the same C<method_name> used in the C<find_method>
@@ -2716,168 +142,22 @@
         ARGIN(const char *signature), ...)
 {
     ASSERT_ARGS(Parrot_PCCINVOKE)
-#define PCC_ARG_MAX 1024
-    /* variables from PCCINVOKE impl in PCCMETHOD.pm */
-    /* args INSP, returns INSP */
-    INTVAL n_regs_used[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
-
-    /* Each of these is 8K. Do we want 16K on the stack? */
-    opcode_t arg_indexes[PCC_ARG_MAX];
-    opcode_t result_indexes[PCC_ARG_MAX];
-
-    PMC * const args_sig    = pmc_new(interp, enum_class_FixedIntegerArray);
-    PMC * const results_sig = pmc_new(interp, enum_class_FixedIntegerArray);
-    PMC * const ret_cont    = new_ret_continuation_pmc(interp, NULL);
-
-    Parrot_Context *ctx;              /* The newly created context */
-    PMC              *pccinvoke_meth;
-
-    opcode_t         *save_current_args;
-    PMC              *save_args_signature;
-    PMC              *save_current_object;
-
-    /* temporary state vars for building PCC index and PCC signature arrays. */
-
-    /* arg_indexes, result_indexes */
-    opcode_t   *indexes[2];
-
-    /* args_sig, results_sig */
-    PMC        *sigs[2];
-
-    int         seen_arrow = 0;
-
-    const char *x;
-    const char *ret_x = NULL;
-    int         index = -1;
-    int         cur   =  0;
-
-    va_list list;
-    va_start(list, signature);
-
-    indexes[0] = arg_indexes;
-    indexes[1] = result_indexes;
-    sigs[0]    = args_sig;
-    sigs[1]    = results_sig;
-
-    /* account for passing invocant in-band */
-    if (!pmc)
-        Parrot_ex_throw_from_c_args(interp, NULL, 1,
-            "NULL PMC passed into Parrot_PCCINVOKE");
-
-    ctx = count_signature_elements(interp, signature, args_sig, results_sig, 1);
-
-    /* second loop through signature to build all index and arg_flag
-     * loop also assigns args(up to the ->) to registers */
-
-    /* account for passing invocant in-band */
-    indexes[0][0] = 0;
-
-    VTABLE_set_integer_keyed_int(interp, sigs[0], 0, PARROT_ARG_PMC);
-    CTX_REG_PMC(ctx, 0) = pmc;
-
-    n_regs_used[REGNO_PMC]++;
-    index = 0;
-
-    for (x = signature; *x != '\0'; x++) {
-        /* detect -> separator */
-        if (*x == '-') {
-
-            /* skip '>' */
-            x++;
-
-            /* allows us to jump directly to the result signature portion
-             * during results assignment */
-            ret_x = x;
-
-            /* save off pointer to results */
-            ret_x++;
-
-            if (index >= 0)
-                commit_last_arg(interp, index, cur, n_regs_used, seen_arrow,
-                    sigs, indexes, ctx, pmc, &list);
-
-            /* reset parsing state so we can now handle results */
-            seen_arrow =  1;
-            index      = -1;
-
-            /* reset n_regs_used for reuse during result index allocation */
-            n_regs_used[0] = 0;
-            n_regs_used[1] = 0;
-            n_regs_used[2] = 0;
-            n_regs_used[3] = 0;
-        }
-        /* parse arg type */
-        else if (isupper((unsigned char)*x)) {
-            if (index >= 0)
-                commit_last_arg(interp, index, cur, n_regs_used, seen_arrow,
-                    sigs, indexes, ctx, pmc, &list);
-
-            index++;
-
-            switch (*x) {
-                case 'I': cur = PARROT_ARG_INTVAL;   break;
-                case 'N': cur = PARROT_ARG_FLOATVAL; break;
-                case 'S': cur = PARROT_ARG_STRING;   break;
-                case 'P': cur = PARROT_ARG_PMC;      break;
-                default:
-                  Parrot_ex_throw_from_c_args(interp, NULL,
-                    EXCEPTION_INVALID_OPERATION,
-                    "Parrot_PCCINVOKE: invalid reg type %c!", *x);
-            }
-
-        }
-        /* parse arg adverbs */
-        else if (islower((unsigned char)*x)) {
-            switch (*x) {
-                case 'n': cur |= PARROT_ARG_NAME;         break;
-                case 'f': cur |= PARROT_ARG_FLATTEN;      break;
-                case 's': cur |= PARROT_ARG_SLURPY_ARRAY; break;
-                case 'o': cur |= PARROT_ARG_OPTIONAL;     break;
-                case 'p': cur |= PARROT_ARG_OPT_FLAG;     break;
-                /* case 'l': cur |= PARROT_ARG_LOOKAHEAD;    break; */
-                default:
-                    Parrot_ex_throw_from_c_args(interp, NULL,
-                        EXCEPTION_INVALID_OPERATION,
-                        "Parrot_PCCINVOKE: invalid adverb type %c!", *x);
-            }
-        }
-    }
-
-    if (index >= 0)
-        commit_last_arg(interp, index, cur, n_regs_used, seen_arrow, sigs,
-            indexes, ctx, pmc, &list);
-
-    /* code from PCCINVOKE impl in PCCMETHOD.pm */
-    save_current_args      = interp->current_args;
-    save_args_signature    = interp->args_signature;
-    save_current_object    = interp->current_object;
-
-    interp->current_args   = arg_indexes;
-    interp->args_signature = args_sig;
-    ctx->current_results   = result_indexes;
-    ctx->results_signature = results_sig;
-
-    /* arg_accessors assigned in loop above */
+    PMC *sig_obj;
+    PMC *sub_obj;
+    va_list args;
+    va_start(args, signature);
+    sig_obj = Parrot_pcc_build_sig_object_from_varargs(interp, pmc, signature, args);
+    va_end(args);
 
-    interp->current_object       = pmc;
-    interp->current_cont         = NEED_CONTINUATION;
-    ctx->current_cont            = ret_cont;
-    PMC_cont(ret_cont)->from_ctx = Parrot_context_ref(interp, ctx);
-    pccinvoke_meth               = VTABLE_find_method(interp, pmc, method_name);
-
-    if (PMC_IS_NULL(pccinvoke_meth))
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_METHOD_NOT_FOUND,
-            "Method '%Ss' not found", method_name);
-    else
-        VTABLE_invoke(interp, pccinvoke_meth, NULL);
+    /* Find the subroutine object as a named method on pmc */
+    sub_obj = VTABLE_find_method(interp, pmc, method_name);
+    if (PMC_IS_NULL(sub_obj))
+         Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_METHOD_NOT_FOUND,
+             "Method '%Ss' not found", method_name);
 
-    set_context_sig_returns_varargs(interp, ctx, indexes, ret_x, list);
-    PObj_live_CLEAR(args_sig);
-    PObj_live_CLEAR(results_sig);
-    interp->current_args   = save_current_args;
-    interp->args_signature = save_args_signature;
-    interp->current_object = save_current_object;
-    va_end(list);
+    /* Invoke the subroutine object with the given CallSignature object */
+    interp->current_object = pmc;
+    Parrot_pcc_invoke_from_sig_object(interp, sub_obj, sig_obj);
 }
 
 /*
@@ -2885,13 +165,12 @@
 =item C<void Parrot_pcc_invoke_method_from_c_args(PARROT_INTERP, PMC* pmc,
 STRING *method_name, const char *signature, ...)>
 
-Makes a method call given the name of the method and the arguments as a
-C variadic argument list. C<pmc> is the invocant, C<method_name> is the
-string name of the method, C<signature> is a C string describing the
-signature of the invocation, according to the Parrot calling
-conventions.  The variadic argument list contains the input arguments
-followed by the output results in the same order that they appear in the
-function signature.
+Makes a method call given the name of the method and the arguments as a C
+variadic argument list. C<pmc> is the invocant, C<method_name> is the string
+name of the method, C<signature> is a C string describing the signature of the
+invocation, according to the Parrot calling conventions.  The variadic argument
+list contains the input arguments followed by the output results in the same
+order that they appear in the function signature.
 
 =cut
 
@@ -2904,29 +183,96 @@
         ARGIN(const char *signature), ...)
 {
     ASSERT_ARGS(Parrot_pcc_invoke_method_from_c_args)
-    PMC *sig_obj;
-    PMC *sub_obj;
+    PMC    *sig_obj;
+    PMC    *sub_obj;
     va_list args;
+
     va_start(args, signature);
-    sig_obj = Parrot_pcc_build_sig_object_from_varargs(interp, pmc, signature, args);
+    sig_obj = Parrot_pcc_build_sig_object_from_varargs(interp, pmc,
+                 signature, args);
     va_end(args);
 
     /* Find the subroutine object as a named method on pmc */
     sub_obj = VTABLE_find_method(interp, pmc, method_name);
+
     if (PMC_IS_NULL(sub_obj))
          Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_METHOD_NOT_FOUND,
              "Method '%Ss' not found", method_name);
 
     /* Invoke the subroutine object with the given CallSignature object */
+    interp->current_object = pmc;
     Parrot_pcc_invoke_from_sig_object(interp, sub_obj, sig_obj);
-    gc_unregister_pmc(interp, sig_obj);
+}
+
+/*
+
+=item C<static int is_invokable(PARROT_INTERP, PMC *sub_obj)>
+
+Check if the PMC is a Sub or does invokable. Helper for do_run_ops.
+
+=cut
+
+*/
+
+PARROT_INLINE
+static int
+is_invokable(PARROT_INTERP, ARGIN(PMC*sub_obj)) /* HEADERIZER SKIP */
+{
+    if (VTABLE_isa(interp, sub_obj, CONST_STRING(interp, "Sub")))
+        return 1;
+    else
+        return VTABLE_does(interp, sub_obj, CONST_STRING(interp, "invokable"));
+}
+
+/*
+
+=item C<static int do_run_ops(PARROT_INTERP, PMC *sub_obj)>
+
+Check should we run ops.
+
+PIR Subs need runops to run their opcodes. Methods and NCI subs don't.
+
+=cut
+
+*/
+
+static int
+do_run_ops(PARROT_INTERP, ARGIN(PMC *sub_obj))
+{
+    ASSERT_ARGS(do_run_ops)
+    if (!PMC_IS_NULL(interp->current_object))
+        return 0;
+
+    if (sub_obj->vtable->base_type < enum_class_core_max)
+        return sub_obj->vtable->base_type == enum_class_Sub
+            || sub_obj->vtable->base_type == enum_class_MultiSub
+            || sub_obj->vtable->base_type == enum_class_Eval;
+    else
+        return is_invokable(interp, sub_obj);
+}
+
+/*
+
+=item C<INTVAL Parrot_pcc_do_run_ops(PARROT_INTERP, PMC *sub_obj)>
+
+Check if current object require running ops. Used in tailcall for updating
+RetContinuation.
+
+=cut
 
+*/
+PARROT_EXPORT
+INTVAL
+Parrot_pcc_do_run_ops(PARROT_INTERP, ARGIN(PMC *sub_obj))
+{
+    ASSERT_ARGS(Parrot_pcc_do_run_ops)
+    return do_run_ops(interp, sub_obj);
 }
 
 /*
 
 =item C<void Parrot_pcc_invoke_from_sig_object(PARROT_INTERP, PMC *sub_obj, PMC
-*sig_obj)>
+*call_object)>
 
 Follows the same conventions as C<Parrot_PCCINVOKE>, but the subroutine object
 to invoke is passed as an argument rather than looked up by name, and the
@@ -2939,107 +285,39 @@
 PARROT_EXPORT
 void
 Parrot_pcc_invoke_from_sig_object(PARROT_INTERP, ARGIN(PMC *sub_obj),
-        ARGIN(PMC *sig_obj))
+        ARGIN(PMC *call_object))
 {
     ASSERT_ARGS(Parrot_pcc_invoke_from_sig_object)
-#define PCC_ARG_MAX 1024
-    /* variables from PCCINVOKE impl in PCCMETHOD.pm */
-    /* args INSP, returns INSP */
-    INTVAL n_regs_used[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
-
-    /* Each of these is 8K. Do we want 16K on the stack? */
-    opcode_t arg_indexes[PCC_ARG_MAX];
-    opcode_t result_indexes[PCC_ARG_MAX];
-
-    /* create the signature string, and the various PMCs that are needed to
-       store all the parameters and parameter counts. */
-    char * const signature  = Parrot_str_to_cstring(interp, VTABLE_get_string(interp, sig_obj));
-    PMC * const args_sig    = temporary_pmc_new(interp, enum_class_FixedIntegerArray);
-    PMC * const results_sig = temporary_pmc_new(interp, enum_class_FixedIntegerArray);
-    PMC * const ret_cont    = new_ret_continuation_pmc(interp, NULL);
-    PMC * const result_list = VTABLE_get_attr_str(interp, sig_obj, CONST_STRING(interp, "returns"));
-
-    Parrot_Context *ctx;
-    opcode_t         *dest;
-    opcode_t         *save_current_args;
-    PMC              *save_args_signature;
-    PMC              *save_current_object;
-
-    /* temporary state vars for building PCC index and PCC signature arrays. */
-
-    /* arg_indexes, result_indexes */
-    opcode_t *indexes[2];
-
-    /* args_sig, results_sig */
-    PMC *sigs[2];
-
-    const char *ret_x  = NULL;
-
-    indexes[0] = arg_indexes;
-    indexes[1] = result_indexes;
-    sigs[0]    = args_sig;
-    sigs[1]    = results_sig;
-
-    /* Count the number of objects of each type that need to be allocated by
-       the caller to perform this function call */
-    ctx = count_signature_elements(interp, signature, args_sig, results_sig, 0);
-
-    /* code from PCCINVOKE impl in PCCMETHOD.pm */
-    /* Save the current values of the interpreter arguments so that additional
-       child sub calls don't kill our call stack. */
-    save_current_args      = interp->current_args;
-    save_args_signature    = interp->args_signature;
-    save_current_object    = interp->current_object;
-
-    /* Set the function input parameters in the context structure, and return
-     * the offset in the signature where the return params start. */
-    ret_x = set_context_sig_params(interp, signature, n_regs_used,
-                                   sigs, indexes, ctx, sig_obj);
-
-    /* Set up the context object for the function invokation */
-    if (strncmp(signature, "Pi", 2) == 0) {
-        interp->current_object = VTABLE_get_pmc_keyed_int(interp, sig_obj, 0);
-    }
-    else {
-        interp->current_object       = PMCNULL;
-    }
+
+    opcode_t    *dest;
+    UINTVAL      n_regs_used[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+    PMC         *ctx  = Parrot_push_context(interp, n_regs_used);
+    PMC * const  ret_cont = new_ret_continuation_pmc(interp, NULL);
+
+    Parrot_pcc_set_signature(interp, ctx, call_object);
+    Parrot_pcc_set_continuation(interp, ctx, ret_cont);
     interp->current_cont         = NEED_CONTINUATION;
-    ctx->current_cont            = ret_cont;
-    PMC_cont(ret_cont)->from_ctx = Parrot_context_ref(interp, ctx);
+    PARROT_CONTINUATION(ret_cont)->from_ctx = ctx;
 
     /* Invoke the function */
     dest = VTABLE_invoke(interp, sub_obj, NULL);
 
     /* PIR Subs need runops to run their opcodes. Methods and NCI subs
      * don't. */
-    if (sub_obj->vtable->base_type == enum_class_Sub
-            && PMC_IS_NULL(interp->current_object)) {
-        const INTVAL old_core = interp->run_core;
+    if (do_run_ops(interp, sub_obj)) {
+        Parrot_runcore_t *old_core = interp->run_core;
         const opcode_t offset = dest - interp->code->base.data;
 
-        /* can't re-enter the runloop from here with PIC cores: RT #60048 */
-        if (interp->run_core == PARROT_CGP_CORE
-        ||  interp->run_core == PARROT_SWITCH_CORE)
-            interp->run_core = PARROT_SLOW_CORE;
+        if (PARROT_RUNCORE_PREDEREF_OPS_TEST(interp->run_core))
+            Parrot_runcore_switch(interp, CONST_STRING(interp, "slow"));
 
         runops(interp, offset);
-        interp->run_core = old_core;
+        Interp_core_SET(interp, old_core);
     }
-
-    /* Set the return values from the subroutine's context into the
-       caller's context */
-    set_context_sig_returns(interp, ctx, indexes, ret_x, result_list);
-
-    temporary_pmc_free(interp, args_sig);
-    temporary_pmc_free(interp, results_sig);
-
-    interp->current_args   = save_current_args;
-    interp->args_signature = save_args_signature;
-    interp->current_object = save_current_object;
-    Parrot_str_free_cstring(signature);
+    Parrot_pcc_set_signature(interp, ctx, NULL);
+    Parrot_pop_context(interp);
 }
 
-
 /*
 
 =back

Modified: branches/orderedhash_revamp/src/debug.c
==============================================================================
--- branches/orderedhash_revamp/src/debug.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/debug.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -32,6 +32,7 @@
 #include "parrot/runcore_trace.h"
 #include "debug.str"
 #include "pmc/pmc_continuation.h"
+#include "pmc/pmc_callcontext.h"
 
 /* Hand switched debugger tracing
  * Set to 1 to enable tracing to stderr
@@ -48,6 +49,11 @@
 /* Length of command line buffers */
 #define DEBUG_CMD_BUFFER_LENGTH 255
 
+/* Easier register access */
+#define IREG(i) REG_INT(interp, (i))
+#define NREG(i) REG_NUM(interp, (i))
+#define SREG(i) REG_STR(interp, (i))
+#define PREG(i) REG_PMC(interp, (i))
 
 typedef struct DebuggerCmd DebuggerCmd;
 typedef struct DebuggerCmdList DebuggerCmdList;
@@ -75,20 +81,17 @@
 static void debugger_cmdline(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-static void dump_string(PARROT_INTERP, ARGIN_NULLOK(const STRING *s))
-        __attribute__nonnull__(1);
-
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 PARROT_OBSERVER
-static const char* GDB_P(PARROT_INTERP, ARGIN(const char *s))
+static STRING * GDB_P(PARROT_INTERP, ARGIN(const char *s))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 PARROT_OBSERVER
-static const char* GDB_print_reg(PARROT_INTERP, int t, int n)
+static STRING * GDB_print_reg(PARROT_INTERP, int t, int n)
         __attribute__nonnull__(1);
 
 PARROT_WARN_UNUSED_RESULT
@@ -112,6 +115,11 @@
 PARROT_WARN_UNUSED_RESULT
 static const char * nextarg(ARGIN_NULLOK(const char *command));
 
+static void no_such_register(PARROT_INTERP,
+    char register_type,
+    UINTVAL register_num)
+        __attribute__nonnull__(1);
+
 PARROT_CANNOT_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
 static const char * parse_int(ARGIN(const char *str), ARGOUT(int *intP))
@@ -148,46 +156,46 @@
 static const char * skip_whitespace(ARGIN(const char *cmd))
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_chop_newline __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(buf)
-#define ASSERT_ARGS_close_script_file __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_condition_regtype __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(cmd)
-#define ASSERT_ARGS_current_breakpoint __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pdb)
-#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 = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_GDB_P __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_chop_newline __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(buf))
+#define ASSERT_ARGS_close_script_file __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_condition_regtype __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(cmd))
+#define ASSERT_ARGS_current_breakpoint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(pdb))
+#define ASSERT_ARGS_debugger_cmdline __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_GDB_P __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_GDB_print_reg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_get_cmd __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_get_uint __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(cmd)
-#define ASSERT_ARGS_get_ulong __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(cmd)
-#define ASSERT_ARGS_list_breakpoints __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pdb)
-#define ASSERT_ARGS_nextarg __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_parse_int __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_GDB_print_reg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_get_cmd __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_get_uint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(cmd))
+#define ASSERT_ARGS_get_ulong __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(cmd))
+#define ASSERT_ARGS_list_breakpoints __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(pdb))
+#define ASSERT_ARGS_nextarg __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_no_such_register __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_parse_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(str) \
-    || PARROT_ASSERT_ARG(intP)
-#define ASSERT_ARGS_parse_key __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(intP))
+#define ASSERT_ARGS_parse_key __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(str) \
-    || PARROT_ASSERT_ARG(keyP)
-#define ASSERT_ARGS_parse_string __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(str) \
+    , PARROT_ASSERT_ARG(keyP))
+#define ASSERT_ARGS_parse_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(str) \
-    || PARROT_ASSERT_ARG(strP)
-#define ASSERT_ARGS_skip_command __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(str)
-#define ASSERT_ARGS_skip_whitespace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(cmd)
+    , PARROT_ASSERT_ARG(str) \
+    , PARROT_ASSERT_ARG(strP))
+#define ASSERT_ARGS_skip_command __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(str))
+#define ASSERT_ARGS_skip_whitespace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(cmd))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -202,11 +210,18 @@
     if (*skip_whitespace(cmd) == '\0')
         return 1;
     else {
-        Parrot_eprintf(pdb->debugger, "Spurious arg\n");
+        Parrot_io_eprintf(pdb->debugger, "Spurious arg\n");
         return 0;
     }
 }
 
+static void dbg_assign(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
+{
+    TRACEDEB_MSG("dbg_assign");
+
+    PDB_assign(pdb->debugee, cmd);
+}
+
 static void dbg_break(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
 {
     TRACEDEB_MSG("dbg_break");
@@ -395,6 +410,14 @@
 };
 
 static const DebuggerCmd
+    cmd_assign = {
+        & dbg_assign,
+        "assign to a register",
+"Assign a value to a register. For example:\n\
+    a I0 42\n\
+    a N1 3.14\n\
+The first command sets I0 to 42 and the second sets N1 to 3.14."
+    },
     cmd_break = {
         & dbg_break,
         "add a breakpoint",
@@ -549,6 +572,7 @@
 };
 
 DebuggerCmdList DebCmdList [] = {
+    { "assign",      'a',  &cmd_assign },
     { "break",       '\0', &cmd_break },
     { "continue",    '\0', &cmd_continue },
     { "delete",      'd',  &cmd_delete },
@@ -709,8 +733,8 @@
 chop_newline(ARGMOD(char * buf))
 {
     ASSERT_ARGS(chop_newline)
-    size_t l;
-    l = strlen(buf);
+    const size_t l = strlen(buf);
+
     if (l > 0 && buf [l - 1] == '\n')
         buf [l - 1] = '\0';
 }
@@ -1106,9 +1130,6 @@
 When you re run/continue the program being debugged it will pay no attention to
 the debug ops.
 
-RT #42377: clone the interpreter to allow people to play into the
-debugger and then continue the normal execution of the program.
-
 =cut
 
 */
@@ -1141,9 +1162,6 @@
         /*PDB_set_break(interp, NULL);*/
 
         debugger_cmdline(interp);
-
-        /* RT #42378 this is not ok */
-        /* exit(EXIT_SUCCESS); */
     }
     else {
         interp->pdb->cur_opcode = (opcode_t *)cur_opcode + 1;
@@ -1218,7 +1236,7 @@
        } while (*ptr == '\0' || *ptr == '#');
 
         if (pdb->state & PDB_ECHO)
-            Parrot_eprintf(pdb->debugger, "[%lu %s]\n", pdb->script_line, buf);
+            Parrot_io_eprintf(pdb->debugger, "[%lu %s]\n", pdb->script_line, buf);
 
 #if TRACE_DEBUGGER
         fprintf(stderr, "(script) %s\n", buf);
@@ -1252,11 +1270,11 @@
         STRING *s= Parrot_str_new(interpdeb, NULL, 0);
         PMC *tmp_stdin = Parrot_io_stdhandle(interpdeb, 0, NULL);
 
-        Parrot_PCCINVOKE(interpdeb,
+        Parrot_pcc_invoke_method_from_c_args(interpdeb,
             tmp_stdin, readline,
             "S->S", prompt, & s);
         {
-        char * aux = Parrot_str_to_cstring(interpdeb, s);
+        char * const aux = Parrot_str_to_cstring(interpdeb, s);
         strcpy(c, aux);
         Parrot_str_free_cstring(aux);
         }
@@ -1354,9 +1372,6 @@
             if (pdb->script_file)
                 Parrot_io_eprintf(pdb->debugger, " in line %lu", pdb->script_line);
             Parrot_io_eprintf(pdb->debugger, ".  Try \"help\".");
-#if TRACE_DEBUGGER
-            fprintf(stderr, " (parse_command result: %li)", c);
-#endif
             close_script_file(interp);
             return 1;
         }
@@ -1379,7 +1394,6 @@
 PDB_next(PARROT_INTERP, ARGIN_NULLOK(const char *command))
 {
     ASSERT_ARGS(PDB_next)
-    unsigned long  n;
     PDB_t  * const pdb = interp->pdb;
     Interp *debugee;
 
@@ -1390,7 +1404,7 @@
         PDB_init(interp, command);
 
     /* Get the number of operations to execute if any */
-    n = get_ulong(& command, 1);
+    pdb->tracing = get_ulong(& command, 1);
 
     /* Erase the stopped flag */
     pdb->state &= ~PDB_STOPPED;
@@ -1407,9 +1421,6 @@
 
     /* If program ended */
 
-    /*
-     * RT #46119 this doesn't handle resume opcodes
-     */
     if (!pdb->cur_opcode)
         (void)PDB_program_end(interp);
     #endif
@@ -1418,12 +1429,12 @@
 
     new_runloop_jump_point(debugee);
     if (setjmp(debugee->current_runloop->resume)) {
-        Parrot_eprintf(pdb->debugger, "Unhandled exception while tracing\n");
+        Parrot_io_eprintf(pdb->debugger, "Unhandled exception while tracing\n");
         pdb->state |= PDB_STOPPED;
         return;
     }
-    pdb->tracing = n;
-    pdb->debugee->run_core = PARROT_DEBUGGER_CORE;
+
+    Parrot_runcore_switch(pdb->debugee, CONST_STRING(interp, "debugger"));
 
     TRACEDEB_MSG("PDB_next finished");
 }
@@ -1442,7 +1453,6 @@
 PDB_trace(PARROT_INTERP, ARGIN_NULLOK(const char *command))
 {
     ASSERT_ARGS(PDB_trace)
-    unsigned long  n;
     PDB_t *  const pdb = interp->pdb;
     Interp        *debugee;
 
@@ -1454,8 +1464,8 @@
         PDB_init(interp, command);
     */
 
-    /* ge the number of ops to run, if specified */
-    n = get_ulong(& command, 1);
+    /* get the number of ops to run, if specified */
+    pdb->tracing = get_ulong(& command, 1);
 
     /* clear the PDB_STOPPED flag, we'll be running n ops now */
     pdb->state &= ~PDB_STOPPED;
@@ -1464,13 +1474,13 @@
     /* execute n ops */
     new_runloop_jump_point(debugee);
     if (setjmp(debugee->current_runloop->resume)) {
-        Parrot_eprintf(pdb->debugger, "Unhandled exception while tracing\n");
+        Parrot_io_eprintf(pdb->debugger, "Unhandled exception while tracing\n");
         pdb->state |= PDB_STOPPED;
         return;
     }
-    pdb->tracing = n;
-    pdb->debugee->run_core = PARROT_DEBUGGER_CORE;
+
     pdb->state |= PDB_TRACING;
+    Parrot_runcore_switch(pdb->debugee, CONST_STRING(interp, "debugger"));
 
     /* Clear the following when done some testing */
 
@@ -1499,20 +1509,20 @@
 {
     ASSERT_ARGS(condition_regtype)
     switch (*cmd) {
-        case 'i':
-        case 'I':
-            return PDB_cond_int;
-        case 'n':
-        case 'N':
-            return PDB_cond_num;
-        case 's':
-        case 'S':
-            return PDB_cond_str;
-        case 'p':
-        case 'P':
-            return PDB_cond_pmc;
-        default:
-            return 0;
+      case 'i':
+      case 'I':
+        return PDB_cond_int;
+      case 'n':
+      case 'N':
+        return PDB_cond_num;
+      case 's':
+      case 'S':
+        return PDB_cond_str;
+      case 'p':
+      case 'P':
+        return PDB_cond_pmc;
+      default:
+        return 0;
     }
 }
 
@@ -1565,40 +1575,41 @@
     /* Now the condition */
     command = skip_whitespace(command);
     switch (*command) {
-        case '>':
-            if (*(command + 1) == '=')
-                cond_type = PDB_cond_ge;
-            else
-                cond_type = PDB_cond_gt;
-            break;
-        case '<':
-            if (*(command + 1) == '=')
-                cond_type = PDB_cond_le;
-            else
-                cond_type = PDB_cond_lt;
-            break;
-        case '=':
-            if (*(command + 1) == '=')
-                cond_type = PDB_cond_eq;
-            else
-                goto INV_COND;
-            break;
-        case '!':
-            if (*(command + 1) == '=')
-                cond_type = PDB_cond_ne;
-            else
-                goto INV_COND;
-            break;
-        case '\0':
-            if (cond_argleft != PDB_cond_str && cond_argleft != PDB_cond_pmc) {
-                Parrot_io_eprintf(interp->pdb->debugger, "Invalid null condition\n");
-                return NULL;
-            }
-            cond_type = PDB_cond_notnull;
-            break;
-        default:
-INV_COND:   Parrot_io_eprintf(interp->pdb->debugger, "Invalid condition\n");
+      case '>':
+        if (*(command + 1) == '=')
+            cond_type = PDB_cond_ge;
+        else
+            cond_type = PDB_cond_gt;
+        break;
+      case '<':
+        if (*(command + 1) == '=')
+            cond_type = PDB_cond_le;
+        else
+            cond_type = PDB_cond_lt;
+        break;
+      case '=':
+        if (*(command + 1) == '=')
+            cond_type = PDB_cond_eq;
+        else
+            goto INV_COND;
+        break;
+      case '!':
+        if (*(command + 1) == '=')
+            cond_type = PDB_cond_ne;
+        else
+            goto INV_COND;
+        break;
+      case '\0':
+        if (cond_argleft != PDB_cond_str && cond_argleft != PDB_cond_pmc) {
+            Parrot_io_eprintf(interp->pdb->debugger, "Invalid null condition\n");
             return NULL;
+        }
+        cond_type = PDB_cond_notnull;
+        break;
+      default:
+  INV_COND:
+        Parrot_io_eprintf(interp->pdb->debugger, "Invalid condition\n");
+        return NULL;
     }
 
     /* if there's an '=', skip it */
@@ -1676,7 +1687,7 @@
             condition->type |= PDB_cond_const;
         }
         else if (condition->type & PDB_cond_pmc) {
-            /* RT #46123 Need to figure out what to do in this case.
+            /* TT #1259: Need to figure out what to do in this case.
              * For the time being, we just bail. */
             Parrot_io_eprintf(interp->pdb->debugger, "Can't compare PMC with constant\n");
             mem_sys_free(condition);
@@ -1711,8 +1722,8 @@
     /* Add it to the head of the list */
     if (pdb->watchpoint)
         condition->next = pdb->watchpoint;
-
     pdb->watchpoint = condition;
+    fprintf(stderr, "Adding watchpoint\n");
 }
 
 /*
@@ -1740,10 +1751,18 @@
 
     TRACEDEB_MSG("PDB_set_break");
 
-
     /* If there is a source file use line number, else opcode position */
 
+
     if (pdb->file) {
+        TRACEDEB_MSG("PDB_set_break file");
+
+        if (!pdb->file->size) {
+            Parrot_io_eprintf(pdb->debugger,
+                "Can't set a breakpoint in empty file\n");
+            return;
+        }
+
         /* If no line number was specified, set it at the current line */
         if (ln != 0) {
             unsigned long i;
@@ -1765,6 +1784,7 @@
             /* Get the line to set it */
             line = pdb->file->line;
 
+            TRACEDEB_MSG("PDB_set_break reading ops");
             while (line->opcode != pdb->cur_opcode) {
                 line = line->next;
                 if (!line) {
@@ -1787,9 +1807,11 @@
         breakpos = line->opcode;
     }
     else {
+        TRACEDEB_MSG("PDB_set_break no file");
         breakpos = interp->code->base.data + ln;
     }
 
+    TRACEDEB_MSG("PDB_set_break allocate breakpoint");
     /* Allocate the new break point */
     newbreak = mem_allocate_zeroed_typed(PDB_breakpoint_t);
 
@@ -1927,11 +1949,12 @@
     */
 
     #if 0
-    pdb->tracing = 0;
-    pdb->debugee->run_core = PARROT_DEBUGGER_CORE;
+    pdb->tracing           = 0;
+    Parrot_runcore_switch(pdb->debugee, CONST_STRING(interp, "debugger"));
+
     new_internal_exception(pdb->debugee);
     if (setjmp(pdb->debugee->exceptions->destination)) {
-        Parrot_eprintf(pdb->debugee, "Unhandled exception while debugging: %Ss\n",
+        Parrot_io_eprintf(pdb->debugee, "Unhandled exception while debugging: %Ss\n",
             pdb->debugee->exceptions->msg);
         pdb->state |= PDB_STOPPED;
         return;
@@ -2047,10 +2070,14 @@
 {
     ASSERT_ARGS(PDB_delete_breakpoint)
     PDB_breakpoint_t * const breakpoint = PDB_find_breakpoint(interp, command);
+    const PDB_line_t *line;
+    long bp_id;
 
     if (breakpoint) {
-        const PDB_line_t *line = interp->pdb->file->line;
+        if (!interp->pdb->file)
+            Parrot_ex_throw_from_c_args(interp, NULL, 0, "No file loaded");
 
+        line = interp->pdb->file->line;
         while (line->opcode != breakpoint->pc)
             line = line->next;
 
@@ -2075,9 +2102,11 @@
         else {
             interp->pdb->breakpoint = NULL;
         }
-
+        bp_id = breakpoint->id;
         /* Kill the breakpoint */
         mem_sys_free(breakpoint);
+
+        Parrot_io_eprintf(interp->pdb->debugger, "Breakpoint %li deleted\n", bp_id);
     }
 }
 
@@ -2176,7 +2205,7 @@
 PDB_check_condition(PARROT_INTERP, ARGIN(const PDB_condition_t *condition))
 {
     ASSERT_ARGS(PDB_check_condition)
-    Parrot_Context *ctx = CONTEXT(interp);
+    PMC *ctx = CURRENT_CONTEXT(interp);
 
     TRACEDEB_MSG("PDB_check_condition");
 
@@ -2184,7 +2213,7 @@
 
     if (condition->type & PDB_cond_int) {
         INTVAL   i,  j;
-        if (condition->reg >= ctx->n_regs_used[REGNO_INT])
+        if (condition->reg >= Parrot_pcc_get_regs_used(interp, ctx, REGNO_INT))
             return 0;
         i = CTX_REG_INT(ctx, condition->reg);
 
@@ -2206,7 +2235,7 @@
     else if (condition->type & PDB_cond_num) {
         FLOATVAL k,  l;
 
-        if (condition->reg >= ctx->n_regs_used[REGNO_NUM])
+        if (condition->reg >= Parrot_pcc_get_regs_used(interp, ctx, REGNO_NUM))
             return 0;
         k = CTX_REG_NUM(ctx, condition->reg);
 
@@ -2228,7 +2257,7 @@
     else if (condition->type & PDB_cond_str) {
         STRING  *m, *n;
 
-        if (condition->reg >= ctx->n_regs_used[REGNO_STR])
+        if (condition->reg >= Parrot_pcc_get_regs_used(interp, ctx, REGNO_STR))
             return 0;
         m = CTX_REG_STR(ctx, condition->reg);
 
@@ -2259,7 +2288,7 @@
     else if (condition->type & PDB_cond_pmc) {
         PMC *m;
 
-        if (condition->reg >= ctx->n_regs_used[REGNO_PMC])
+        if (condition->reg >= Parrot_pcc_get_regs_used(interp, ctx, REGNO_PMC))
             return 0;
         m = CTX_REG_PMC(ctx, condition->reg);
 
@@ -2399,37 +2428,37 @@
 
     for (; string < end; string++) {
         switch (*string) {
-            case '\0':
-                *(fill++) = '\\';
-                *(fill++) = '0';
-                break;
-            case '\n':
-                *(fill++) = '\\';
-                *(fill++) = 'n';
-                break;
-            case '\r':
-                *(fill++) = '\\';
-                *(fill++) = 'r';
-                break;
-            case '\t':
-                *(fill++) = '\\';
-                *(fill++) = 't';
-                break;
-            case '\a':
-                *(fill++) = '\\';
-                *(fill++) = 'a';
-                break;
-            case '\\':
-                *(fill++) = '\\';
-                *(fill++) = '\\';
-                break;
-            case '"':
-                *(fill++) = '\\';
-                *(fill++) = '"';
-                break;
-            default:
-                *(fill++) = *string;
-                break;
+          case '\0':
+            *(fill++) = '\\';
+            *(fill++) = '0';
+            break;
+          case '\n':
+            *(fill++) = '\\';
+            *(fill++) = 'n';
+            break;
+          case '\r':
+            *(fill++) = '\\';
+            *(fill++) = 'r';
+            break;
+          case '\t':
+            *(fill++) = '\\';
+            *(fill++) = 't';
+            break;
+          case '\a':
+            *(fill++) = '\\';
+            *(fill++) = 'a';
+            break;
+          case '\\':
+            *(fill++) = '\\';
+            *(fill++) = '\\';
+            break;
+          case '"':
+            *(fill++) = '\\';
+            *(fill++) = '"';
+            break;
+          default:
+            *(fill++) = *string;
+            break;
         }
     }
 
@@ -2462,23 +2491,23 @@
             int i;
 
             switch (string[1]) {
-                case 'n':
-                    *string = '\n';
-                    break;
-                case 'r':
-                    *string = '\r';
-                    break;
-                case 't':
-                    *string = '\t';
-                    break;
-                case 'a':
-                    *string = '\a';
-                    break;
-                case '\\':
-                    *string = '\\';
-                    break;
-                default:
-                    continue;
+              case 'n':
+                *string = '\n';
+                break;
+              case 'r':
+                *string = '\r';
+                break;
+              case 't':
+                *string = '\t';
+                break;
+              case 'a':
+                *string = '\a';
+                break;
+              case '\\':
+                *string = '\\';
+                break;
+              default:
+                continue;
             }
 
             fill = string;
@@ -2536,19 +2565,19 @@
         PARROT_ASSERT(size + 2 < space);
 
         switch (info->types[j - 1]) {
-        case PARROT_ARG_I:
+          case PARROT_ARG_I:
             dest[size++] = 'I';
             goto INTEGER;
-        case PARROT_ARG_N:
+          case PARROT_ARG_N:
             dest[size++] = 'N';
             goto INTEGER;
-        case PARROT_ARG_S:
+          case PARROT_ARG_S:
             dest[size++] = 'S';
             goto INTEGER;
-        case PARROT_ARG_P:
+          case PARROT_ARG_P:
             dest[size++] = 'P';
             goto INTEGER;
-        case PARROT_ARG_IC:
+          case PARROT_ARG_IC:
             /* If the opcode jumps and this is the last argument,
                that means this is a label */
             if ((j == info->op_count - 1) &&
@@ -2578,137 +2607,128 @@
 
             size += sprintf(&dest[size], INTVAL_FMT, i);
 
-            /* If this is a constant dispatch arg to an "infix" op, then show
-               the corresponding symbolic op name. */
-            if (j == 1 && info->types[j - 1] == PARROT_ARG_IC
-                && (STREQ(info->name, "infix") || STREQ(info->name, "n_infix"))) {
-                PARROT_ASSERT(size + 20 < space);
-
-                size += sprintf(&dest[size], " [%s]",
-                        /* [kludge: the "2+" skips the leading underscores.  --
-                           rgr, 6-May-07.] */
-                        2 + Parrot_MMD_method_name(interp, op[j]));
-            }
             break;
-        case PARROT_ARG_NC:
+          case PARROT_ARG_NC:
             {
-            /* Convert the float to a string */
-            const FLOATVAL f = interp->code->const_table->constants[op[j]]->u.number;
-            Parrot_snprintf(interp, buf, sizeof (buf), FLOATVAL_FMT, f);
-            strcpy(&dest[size], buf);
-            size += strlen(buf);
+                /* Convert the float to a string */
+                const FLOATVAL f = interp->code->const_table->constants[op[j]]->u.number;
+                Parrot_snprintf(interp, buf, sizeof (buf), FLOATVAL_FMT, f);
+                strcpy(&dest[size], buf);
+                size += strlen(buf);
             }
             break;
-        case PARROT_ARG_SC:
+          case PARROT_ARG_SC:
             dest[size++] = '"';
             if (interp->code->const_table->constants[op[j]]-> u.string->strlen) {
+                char * const unescaped =
+                    Parrot_str_to_cstring(interp, interp->code->
+                           const_table->constants[op[j]]->u.string);
                 char * const escaped =
-                    PDB_escape(interp->code->const_table->
-                           constants[op[j]]->u.string->strstart,
-                           interp->code->const_table->
+                    PDB_escape(unescaped, interp->code->const_table->
                            constants[op[j]]->u.string->strlen);
                 if (escaped) {
                     strcpy(&dest[size], escaped);
                     size += strlen(escaped);
                     mem_sys_free(escaped);
                 }
+                Parrot_str_free_cstring(unescaped);
             }
             dest[size++] = '"';
             break;
-        case PARROT_ARG_PC:
+          case PARROT_ARG_PC:
             Parrot_snprintf(interp, buf, sizeof (buf), "PMC_CONST(%d)", op[j]);
             strcpy(&dest[size], buf);
             size += strlen(buf);
             break;
-        case PARROT_ARG_K:
+          case PARROT_ARG_K:
             dest[size - 1] = '[';
             Parrot_snprintf(interp, buf, sizeof (buf), "P" INTVAL_FMT, op[j]);
             strcpy(&dest[size], buf);
             size += strlen(buf);
             dest[size++] = ']';
             break;
-        case PARROT_ARG_KC:
+          case PARROT_ARG_KC:
             {
-            PMC * k      = interp->code->const_table->constants[op[j]]->u.key;
-            dest[size - 1] = '[';
-            while (k) {
-                switch (PObj_get_FLAGS(k)) {
-                case 0:
-                    break;
-                case KEY_integer_FLAG:
-                    Parrot_snprintf(interp, buf, sizeof (buf),
+                PMC * k = interp->code->const_table->constants[op[j]]->u.key;
+                dest[size - 1] = '[';
+                while (k) {
+                    switch (PObj_get_FLAGS(k)) {
+                      case 0:
+                        break;
+                      case KEY_integer_FLAG:
+                        Parrot_snprintf(interp, buf, sizeof (buf),
                                     INTVAL_FMT, VTABLE_get_integer(interp, k));
-                    strcpy(&dest[size], buf);
-                    size += strlen(buf);
-                    break;
-                case KEY_number_FLAG:
-                    Parrot_snprintf(interp, buf, sizeof (buf),
+                        strcpy(&dest[size], buf);
+                        size += strlen(buf);
+                        break;
+                      case KEY_number_FLAG:
+                        Parrot_snprintf(interp, buf, sizeof (buf),
                                     FLOATVAL_FMT, VTABLE_get_number(interp, k));
-                    strcpy(&dest[size], buf);
-                    size += strlen(buf);
-                    break;
-                case KEY_string_FLAG:
-                    dest[size++] = '"';
-                    {
-                        char * const temp = Parrot_str_to_cstring(interp,
-                                VTABLE_get_string(interp, k));
-                        strcpy(&dest[size], temp);
-                        Parrot_str_free_cstring(temp);
-                    }
-                    size += Parrot_str_byte_length(interp,
-                            VTABLE_get_string(interp, (k)));
-                    dest[size++] = '"';
-                    break;
-                case KEY_integer_FLAG|KEY_register_FLAG:
-                    Parrot_snprintf(interp, buf, sizeof (buf),
+                        strcpy(&dest[size], buf);
+                        size += strlen(buf);
+                        break;
+                      case KEY_string_FLAG:
+                        dest[size++] = '"';
+                        {
+                            char * const temp = Parrot_str_to_cstring(interp,
+                                    VTABLE_get_string(interp, k));
+                            strcpy(&dest[size], temp);
+                            Parrot_str_free_cstring(temp);
+                        }
+                        size += Parrot_str_byte_length(interp,
+                                VTABLE_get_string(interp, (k)));
+                        dest[size++] = '"';
+                        break;
+                      case KEY_integer_FLAG|KEY_register_FLAG:
+                        Parrot_snprintf(interp, buf, sizeof (buf),
                                     "I" INTVAL_FMT, VTABLE_get_integer(interp, k));
-                    strcpy(&dest[size], buf);
-                    size += strlen(buf);
-                    break;
-                case KEY_number_FLAG|KEY_register_FLAG:
-                    Parrot_snprintf(interp, buf, sizeof (buf),
+                        strcpy(&dest[size], buf);
+                        size += strlen(buf);
+                        break;
+                      case KEY_number_FLAG|KEY_register_FLAG:
+                        Parrot_snprintf(interp, buf, sizeof (buf),
                                     "N" INTVAL_FMT, VTABLE_get_integer(interp, k));
-                    strcpy(&dest[size], buf);
-                    size += strlen(buf);
-                    break;
-                case KEY_string_FLAG|KEY_register_FLAG:
-                    Parrot_snprintf(interp, buf, sizeof (buf),
+                        strcpy(&dest[size], buf);
+                        size += strlen(buf);
+                        break;
+                      case KEY_string_FLAG|KEY_register_FLAG:
+                        Parrot_snprintf(interp, buf, sizeof (buf),
                                     "S" INTVAL_FMT, VTABLE_get_integer(interp, k));
-                    strcpy(&dest[size], buf);
-                    size += strlen(buf);
-                    break;
-                case KEY_pmc_FLAG|KEY_register_FLAG:
-                    Parrot_snprintf(interp, buf, sizeof (buf),
+                        strcpy(&dest[size], buf);
+                        size += strlen(buf);
+                        break;
+                      case KEY_pmc_FLAG|KEY_register_FLAG:
+                        Parrot_snprintf(interp, buf, sizeof (buf),
                                     "P" INTVAL_FMT, VTABLE_get_integer(interp, k));
-                    strcpy(&dest[size], buf);
-                    size += strlen(buf);
-                    break;
-                default:
-                    dest[size++] = '?';
-                    break;
+                        strcpy(&dest[size], buf);
+                        size += strlen(buf);
+                        break;
+                      default:
+                        dest[size++] = '?';
+                        break;
+                    }
+                    GETATTR_Key_next_key(interp, k, k);
+                    if (k)
+                        dest[size++] = ';';
                 }
-                GETATTR_Key_next_key(interp, k, k);
-                if (k)
-                    dest[size++] = ';';
-            }
-            dest[size++] = ']';
+                dest[size++] = ']';
             }
             break;
-        case PARROT_ARG_KI:
+          case PARROT_ARG_KI:
             dest[size - 1] = '[';
             Parrot_snprintf(interp, buf, sizeof (buf), "I" INTVAL_FMT, op[j]);
             strcpy(&dest[size], buf);
             size += strlen(buf);
             dest[size++] = ']';
             break;
-        case PARROT_ARG_KIC:
+          case PARROT_ARG_KIC:
             dest[size - 1] = '[';
             Parrot_snprintf(interp, buf, sizeof (buf), INTVAL_FMT, op[j]);
             strcpy(&dest[size], buf);
             size += strlen(buf);
             dest[size++] = ']';
             break;
-        default:
+          default:
             Parrot_ex_throw_from_c_args(interp, NULL, 1, "Unknown opcode type");
         }
 
@@ -3090,7 +3110,7 @@
 
                 /* don't walk off the end of the program into neverland */
                 if (pc >= interp->code->base.data + interp->code->base.size)
-                    return;
+                    break;
             }
 
             newline->number      = pline->number + 1;
@@ -3116,17 +3136,6 @@
 
 Return true if the line has an instruction.
 
-RT #46129:
-
-=over 4
-
-=item * This should take the line, get an instruction, get the opcode for
-that instruction and check that is the correct one.
-
-=item * Decide what to do with macros if anything.
-
-=back
-
 =cut
 
 */
@@ -3147,7 +3156,7 @@
             h = 1;
         }
         else if (*c == ':') {
-            /* this is a label. RT #46137 right? */
+            /* probably a label */
             h = 0;
         }
 
@@ -3159,6 +3168,96 @@
 
 /*
 
+=item C<static void no_such_register(PARROT_INTERP, char register_type, UINTVAL
+register_num)>
+
+Auxiliar error message function.
+
+=cut
+
+*/
+
+static void
+no_such_register(PARROT_INTERP, char register_type, UINTVAL register_num)
+{
+    ASSERT_ARGS(no_such_register)
+
+    Parrot_io_eprintf(interp, "%c%u = no such register\n",
+        register_type, register_num);
+}
+
+/*
+
+=item C<void PDB_assign(PARROT_INTERP, const char *command)>
+
+Assign to registers.
+
+=cut
+
+*/
+
+void
+PDB_assign(PARROT_INTERP, ARGIN(const char *command))
+{
+    ASSERT_ARGS(PDB_assign)
+    UINTVAL register_num;
+    char reg_type_id;
+    int reg_type;
+    PDB_t *pdb       = interp->pdb;
+    Interp *debugger = pdb ? pdb->debugger : interp;
+    Interp *debugee  = pdb ? pdb->debugee : interp;
+
+    /* smallest valid commad length is 4, i.e. "I0 1" */
+    if (strlen(command) < 4) {
+        Parrot_io_eprintf(debugger, "Must give a register number and value to assign\n");
+        return;
+    }
+    reg_type_id = (unsigned char) toupper((unsigned char) command[0]);
+    command++;
+    register_num = get_ulong(&command, 0);
+
+    switch (reg_type_id) {
+      case 'I':
+        reg_type = REGNO_INT;
+        break;
+      case 'N':
+        reg_type = REGNO_NUM;
+        break;
+      case 'S':
+        reg_type = REGNO_STR;
+        break;
+      case 'P':
+        reg_type = REGNO_PMC;
+        Parrot_io_eprintf(debugger, "Assigning to PMCs is not currently supported\n");
+        return;
+      default:
+        Parrot_io_eprintf(debugger, "Invalid register type %c\n", reg_type_id);
+        return;
+    }
+    if (register_num >= Parrot_pcc_get_regs_used(debugee,
+                                CURRENT_CONTEXT(debugee), reg_type)) {
+        no_such_register(debugger, reg_type_id, register_num);
+        return;
+    }
+    switch (reg_type) {
+      case REGNO_INT:
+        IREG(register_num) = get_ulong(&command, 0);
+        break;
+      case REGNO_NUM:
+        NREG(register_num) = atof(command);
+        break;
+      case REGNO_STR:
+        SREG(register_num) = Parrot_str_new(debugee, command, strlen(command));
+        break;
+      default:
+        ; /* Must never come here */
+    }
+    Parrot_io_eprintf(debugger, "\n  %c%u = ", reg_type_id, register_num);
+    Parrot_io_eprintf(debugger, "%Ss\n", GDB_print_reg(debugee, reg_type, register_num));
+}
+
+/*
+
 =item C<void PDB_list(PARROT_INTERP, const char *command)>
 
 Show lines from the source code file.
@@ -3240,11 +3339,13 @@
 PDB_eval(PARROT_INTERP, ARGIN(const char *command))
 {
     ASSERT_ARGS(PDB_eval)
-    /* This code is almost certainly wrong. The Parrot debugger needs love. */
-    opcode_t *run = PDB_compile(interp, command);
 
-    if (run)
-        DO_OP(run, interp);
+    PDB_t         *pdb = interp->pdb;
+    Interp *warninterp = (interp->pdb && interp->pdb->debugger) ?
+        interp->pdb->debugger : interp;
+    TRACEDEB_MSG("PDB_eval");
+    UNUSED(command);
+    Parrot_io_eprintf(warninterp, "The eval command is currently unimplemeneted\n");
 }
 
 /*
@@ -3267,48 +3368,11 @@
 PDB_compile(PARROT_INTERP, ARGIN(const char *command))
 {
     ASSERT_ARGS(PDB_compile)
-    STRING     *buf;
-    const char *end      = "\nend\n";
-    STRING     *key      = CONST_STRING(interp, "PASM");
-    PMC *compreg_hash    = VTABLE_get_pmc_keyed_int(interp,
-            interp->iglobals, IGLOBALS_COMPREG_HASH);
-    PMC        *compiler = VTABLE_get_pmc_keyed_str(interp, compreg_hash, key);
-
-    if (!VTABLE_defined(interp, compiler)) {
-        fprintf(stderr, "Couldn't find PASM compiler");
-        return NULL;
-    }
-
-    buf = Parrot_sprintf_c(interp, "%s%s", command, end);
 
-    return VTABLE_invoke(interp, compiler, buf);
-}
-
-/*
-
-=item C<static void dump_string(PARROT_INTERP, const STRING *s)>
-
-Dumps the buflen, flags, bufused, strlen, and offset associated with a string
-and the string itself.
-
-=cut
-
-*/
-
-static void
-dump_string(PARROT_INTERP, ARGIN_NULLOK(const STRING *s))
-{
-    ASSERT_ARGS(dump_string)
-    if (!s)
-        return;
-
-    Parrot_io_eprintf(interp, "\tBuflen  =\t%12ld\n", PObj_buflen(s));
-    Parrot_io_eprintf(interp, "\tFlags   =\t%12ld\n", PObj_get_FLAGS(s));
-    Parrot_io_eprintf(interp, "\tBufused =\t%12ld\n", s->bufused);
-    Parrot_io_eprintf(interp, "\tStrlen  =\t%12ld\n", s->strlen);
-    Parrot_io_eprintf(interp, "\tOffset  =\t%12ld\n",
-                    (char*) s->strstart - (char*) PObj_bufstart(s));
-    Parrot_io_eprintf(interp, "\tString  =\t%S\n", s);
+    UNUSED(command);
+    Parrot_ex_throw_from_c_args(interp, NULL,
+        EXCEPTION_UNIMPLEMENTED,
+        "PDB_compile ('PASM1' compiler) has been deprecated");
 }
 
 /*
@@ -3325,8 +3389,10 @@
 PDB_print(PARROT_INTERP, ARGIN(const char *command))
 {
     ASSERT_ARGS(PDB_print)
-    const char * const s = GDB_P(interp->pdb->debugee, command);
-    Parrot_io_eprintf(interp, "%s\n", s);
+    const STRING *s = GDB_P(interp->pdb->debugee, command);
+
+    TRACEDEB_MSG("PDB_print");
+    Parrot_io_eprintf(interp, "%Ss\n", s);
 }
 
 
@@ -3438,10 +3504,11 @@
     STRING           *str;
     PMC              *old       = PMCNULL;
     int               rec_level = 0;
+    int               limit_count = 0;
 
     /* information about the current sub */
-    PMC              *sub = interpinfo_p(interp, CURRENT_SUB);
-    Parrot_Context   *ctx = CONTEXT(interp);
+    PMC *sub = interpinfo_p(interp, CURRENT_SUB);
+    PMC *ctx = CURRENT_CONTEXT(interp);
 
     if (!PMC_IS_NULL(sub)) {
         str = Parrot_Context_infostr(interp, ctx);
@@ -3449,7 +3516,7 @@
             Parrot_io_eprintf(interp, "%Ss", str);
             if (interp->code->annotations) {
                 PMC *annot = PackFile_Annotations_lookup(interp, interp->code->annotations,
-                        ctx->current_pc - interp->code->base.data + 1, NULL);
+                        Parrot_pcc_get_pc(interp, ctx) - interp->code->base.data + 1, NULL);
                 if (!PMC_IS_NULL(annot)) {
                     PMC *pfile = VTABLE_get_pmc_keyed_str(interp, annot,
                             Parrot_str_new_constant(interp, "file"));
@@ -3468,28 +3535,40 @@
 
     /* backtrace: follow the continuation chain */
     while (1) {
-        Parrot_cont *sub_cont;
-        sub = ctx->current_cont;
+        Parrot_Continuation_attributes *sub_cont;
 
-        if (!sub)
+        /* Limit the levels dumped, no segfault on infinite recursion */
+        if (++limit_count > RECURSION_LIMIT)
             break;
 
-        sub_cont = PMC_cont(sub);
+        sub = Parrot_pcc_get_continuation(interp, ctx);
+
+        if (PMC_IS_NULL(sub))
+            break;
+
+
+        sub_cont = PARROT_CONTINUATION(sub);
 
         if (!sub_cont)
             break;
 
-        str = Parrot_Context_infostr(interp, sub_cont->to_ctx);
+
+        str = Parrot_Context_infostr(interp, Parrot_pcc_get_caller_ctx(interp, ctx));
+
 
         if (!str)
             break;
 
+
         /* recursion detection */
-        if (!PMC_IS_NULL(old) && PMC_cont(old) &&
-            PMC_cont(old)->to_ctx->current_pc ==
-            PMC_cont(sub)->to_ctx->current_pc &&
-            PMC_cont(old)->to_ctx->current_sub ==
-            PMC_cont(sub)->to_ctx->current_sub) {
+        if (ctx == sub_cont->to_ctx) {
+            ++rec_level;
+        }
+        else if (!PMC_IS_NULL(old) && PMC_cont(old) &&
+            Parrot_pcc_get_pc(interp, PMC_cont(old)->to_ctx) ==
+            Parrot_pcc_get_pc(interp, PMC_cont(sub)->to_ctx) &&
+            Parrot_pcc_get_sub(interp, PMC_cont(old)->to_ctx) ==
+            Parrot_pcc_get_sub(interp, PMC_cont(sub)->to_ctx)) {
                 ++rec_level;
         }
         else if (rec_level != 0) {
@@ -3499,10 +3578,13 @@
 
         /* print the context description */
         if (rec_level == 0) {
+            PackFile_ByteCode *seg = sub_cont->seg;
             Parrot_io_eprintf(interp, "%Ss", str);
-            if (interp->code->annotations) {
-                PMC *annot = PackFile_Annotations_lookup(interp, interp->code->annotations,
-                        sub_cont->to_ctx->current_pc - interp->code->base.data + 1, NULL);
+            if (seg->annotations) {
+                PMC *annot = PackFile_Annotations_lookup(interp, seg->annotations,
+                        Parrot_pcc_get_pc(interp, sub_cont->to_ctx) - seg->base.data,
+                        NULL);
+
                 if (!PMC_IS_NULL(annot)) {
                     PMC *pfile = VTABLE_get_pmc_keyed_str(interp, annot,
                             Parrot_str_new_constant(interp, "file"));
@@ -3519,7 +3601,7 @@
         }
 
         /* get the next Continuation */
-        ctx = PMC_cont(sub)->to_ctx;
+        ctx = Parrot_pcc_get_caller_ctx(interp, ctx);
         old = sub;
 
         if (!ctx)
@@ -3540,7 +3622,7 @@
 
 /*
 
-=item C<static const char* GDB_print_reg(PARROT_INTERP, int t, int n)>
+=item C<static STRING * GDB_print_reg(PARROT_INTERP, int t, int n)>
 
 Used by GDB_P to convert register values for display.  Takes register
 type and number as arguments.
@@ -3555,33 +3637,41 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 PARROT_OBSERVER
-static const char*
+static STRING *
 GDB_print_reg(PARROT_INTERP, int t, int n)
 {
     ASSERT_ARGS(GDB_print_reg)
+    char * string;
 
-    if (n >= 0 && n < CONTEXT(interp)->n_regs_used[t]) {
+    if (n >= 0 && (UINTVAL)n < Parrot_pcc_get_regs_used(interp, CURRENT_CONTEXT(interp), t)) {
         switch (t) {
-            case REGNO_INT:
-                return Parrot_str_from_int(interp, REG_INT(interp, n))->strstart;
-            case REGNO_NUM:
-                return Parrot_str_from_num(interp, REG_NUM(interp, n))->strstart;
-            case REGNO_STR:
-                return REG_STR(interp, n)->strstart;
-            case REGNO_PMC:
-                /* prints directly */
-                trace_pmc_dump(interp, REG_PMC(interp, n));
-                return "";
-            default:
-                break;
+          case REGNO_INT:
+            return Parrot_str_from_int(interp, IREG(n));
+          case REGNO_NUM:
+            return Parrot_str_from_num(interp, NREG(n));
+          case REGNO_STR:
+            /* This hack is needed because we occasionally are told
+               that we have string registers when we actually don't */
+            string = (char *) SREG(n);
+
+            if (string == '\0')
+                return Parrot_str_new(interp, "", 0);
+            else
+                return SREG(n);
+          case REGNO_PMC:
+            /* prints directly */
+            trace_pmc_dump(interp, PREG(n));
+            return Parrot_str_new(interp, "", 0);
+          default:
+            break;
         }
     }
-    return "no such reg";
+    return Parrot_str_new(interp, "no such register", 0);
 }
 
 /*
 
-=item C<static const char* GDB_P(PARROT_INTERP, const char *s)>
+=item C<static STRING * GDB_P(PARROT_INTERP, const char *s)>
 
 Used by PDB_print to print register values.  Takes a pointer to the
 register name(s).
@@ -3595,43 +3685,45 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 PARROT_OBSERVER
-static const char*
+static STRING *
 GDB_P(PARROT_INTERP, ARGIN(const char *s))
 {
     ASSERT_ARGS(GDB_P)
     int t;
     char reg_type;
 
+    TRACEDEB_MSG("GDB_P");
     /* Skip leading whitespace. */
     while (isspace((unsigned char)*s))
         s++;
 
     reg_type = (unsigned char) toupper((unsigned char)*s);
+
     switch (reg_type) {
         case 'I': t = REGNO_INT; break;
         case 'N': t = REGNO_NUM; break;
         case 'S': t = REGNO_STR; break;
         case 'P': t = REGNO_PMC; break;
-        default: return "Need a register.";
+        default: return Parrot_str_new(interp, "Need a register.", 0);
     }
     if (! s[1]) {
         /* Print all registers of this type. */
-        const int max_reg = CONTEXT(interp)->n_regs_used[t];
+        const int max_reg = Parrot_pcc_get_regs_used(interp, CURRENT_CONTEXT(interp), t);
         int n;
 
         for (n = 0; n < max_reg; n++) {
             /* this must be done in two chunks because PMC's print directly. */
             Parrot_io_eprintf(interp, "\n  %c%d = ", reg_type, n);
-            Parrot_io_eprintf(interp, "%s", GDB_print_reg(interp, t, n));
+            Parrot_io_eprintf(interp, "%Ss", GDB_print_reg(interp, t, n));
         }
-        return "";
+        return Parrot_str_new(interp, "", 0);
     }
     else if (s[1] && isdigit((unsigned char)s[1])) {
         const int n = atoi(s + 1);
         return GDB_print_reg(interp, t, n);
     }
     else
-        return "no such reg";
+        return Parrot_str_new(interp, "no such register", 0);
 
 }
 
@@ -3641,7 +3733,7 @@
 
 =head1 SEE ALSO
 
-F<include/parrot/debugger.h>, F<src/pdb.c> and F<ops/debug.ops>.
+F<include/parrot/debugger.h>, F<src/parrot_debugger.c> and F<ops/debug.ops>.
 
 =head1 HISTORY
 

Modified: branches/orderedhash_revamp/src/dynext.c
==============================================================================
--- branches/orderedhash_revamp/src/dynext.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/dynext.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -22,6 +22,7 @@
 #include "parrot/dynext.h"
 #include "dynext.str"
 #include "pmc/pmc_parrotlibrary.h"
+#include "pmc/pmc_callcontext.h"
 
 /* HEADERIZER HFILE: include/parrot/dynext.h */
 
@@ -99,37 +100,37 @@
         __attribute__nonnull__(3)
         __attribute__nonnull__(4);
 
-#define ASSERT_ARGS_clone_string_into __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_clone_string_into __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(d) \
-    || PARROT_ASSERT_ARG(s) \
-    || PARROT_ASSERT_ARG(value)
-#define ASSERT_ARGS_dlopen_string __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(s) \
+    , PARROT_ASSERT_ARG(value))
+#define ASSERT_ARGS_dlopen_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(path)
-#define ASSERT_ARGS_get_path __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(path))
+#define ASSERT_ARGS_get_path __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(handle) \
-    || PARROT_ASSERT_ARG(wo_ext)
-#define ASSERT_ARGS_is_loaded __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(handle) \
+    , PARROT_ASSERT_ARG(wo_ext))
+#define ASSERT_ARGS_is_loaded __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(path)
-#define ASSERT_ARGS_make_string_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(path))
+#define ASSERT_ARGS_make_string_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(string)
-#define ASSERT_ARGS_run_init_lib __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(string))
+#define ASSERT_ARGS_run_init_lib __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(handle) \
-    || PARROT_ASSERT_ARG(wo_ext)
-#define ASSERT_ARGS_set_cstring_prop __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(handle) \
+    , PARROT_ASSERT_ARG(wo_ext))
+#define ASSERT_ARGS_set_cstring_prop __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(lib_pmc) \
-    || PARROT_ASSERT_ARG(what) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_store_lib_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(lib_pmc) \
+    , PARROT_ASSERT_ARG(what) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_store_lib_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(lib_pmc) \
-    || PARROT_ASSERT_ARG(path) \
-    || PARROT_ASSERT_ARG(type)
+    , PARROT_ASSERT_ARG(lib_pmc) \
+    , PARROT_ASSERT_ARG(path) \
+    , PARROT_ASSERT_ARG(type))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -232,8 +233,8 @@
 {
     ASSERT_ARGS(dlopen_string)
 
-    char *pathstr = Parrot_str_to_cstring(interp, path);
-    void *handle = Parrot_dlopen(pathstr);
+    char * const pathstr = Parrot_str_to_cstring(interp, path);
+    void *       handle  = Parrot_dlopen(pathstr);
     Parrot_str_free_cstring(pathstr);
     return handle;
 }
@@ -428,6 +429,13 @@
     void (*init_func)(PARROT_INTERP, PMC *);
     PMC *lib_pmc;
 
+    UINTVAL regs_used[]     = { 2, 2, 2, 2 }; /* Arbitrary values */
+    const int parrot_hll_id = 0;
+    PMC * context = Parrot_push_context(interp, regs_used);
+    Parrot_pcc_set_HLL(interp, context, parrot_hll_id);
+    Parrot_pcc_set_namespace(interp, context,
+            Parrot_get_HLL_namespace(interp, parrot_hll_id));
+
     /*
      * work around gcc 3.3.3 and other problem with dynpmcs
      * something during library loading doesn't stand a GC run
@@ -475,6 +483,8 @@
     /* UNLOCK */
     Parrot_unblock_GC_mark(interp);
 
+    Parrot_pop_context(interp);
+
     return lib_pmc;
 }
 
@@ -522,9 +532,9 @@
 make_string_pmc(PARROT_INTERP, ARGIN(STRING *string))
 {
     ASSERT_ARGS(make_string_pmc)
-    PMC * const ret = VTABLE_instantiate_str(interp,
-        interp->vtables[enum_class_String]->pmc_class,
-        string, PObj_constant_FLAG);
+    PMC * const ret = constant_pmc_new(interp, enum_class_String);
+    VTABLE_set_string_native(interp, ret, string);
+
     return ret;
 }
 
@@ -555,7 +565,7 @@
         VTABLE_getprop(s, lib_pmc, filename));
     STRING * const lib_name = clone_string_into(d, s,
         VTABLE_getprop(s, lib_pmc, libname));
-    void * const handle = PMC_data(lib_pmc);
+    void * const handle = VTABLE_get_pointer(s, lib_pmc);
     STRING * const type =
         VTABLE_get_string(s, VTABLE_getprop(s, lib_pmc, type_str));
 

Added: branches/orderedhash_revamp/src/dynoplibs/math.ops
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/src/dynoplibs/math.ops	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,129 @@
+/*
+ * $Id$
+** math.ops
+*/
+
+BEGIN_OPS_PREAMBLE
+
+#include <math.h>
+
+END_OPS_PREAMBLE
+
+=head1 NAME
+
+math.ops - Mathematical Opcodes
+
+=cut
+
+=head1 DESCRIPTION
+
+Parrot's library of mathematical ops.
+
+To use this library of ops, add this directive to your PIR:
+
+ .loadlib 'math_ops'
+
+=cut
+
+=over
+
+=item B<rand>(out NUM)
+
+Set $1 to a random floating point number between 0 and 1, inclusive.
+
+=cut
+
+inline op rand(out NUM) {
+    $1 = Parrot_float_rand(0);
+}
+
+=item B<rand>(out INT)
+
+Set $1 to a random integer between C<[-2^31, 2^31)> .
+
+=cut
+
+inline op rand(out INT) {
+    $1 = Parrot_int_rand(0);
+}
+
+=item B<rand>(out NUM, in NUM)
+
+Set $1 to a random floating point number between 0 and and $2, inclusive.
+
+=cut
+
+inline op rand(out NUM, in NUM) {
+    $1 = $2 * Parrot_float_rand(0);
+}
+
+=item B<rand>(out INT, in INT)
+
+Set $1 to a integer between 0 and and $2, inclusive.
+
+=cut
+
+inline op rand(out INT, in INT) {
+    $1 = Parrot_range_rand(0, $2, 0);
+}
+
+=item B<rand>(out NUM, in NUM, in NUM)
+
+Set $1 to a random floating point number between $2 and and $3, inclusive.
+
+=cut
+
+inline op rand(out NUM, in NUM, in NUM) {
+    $1 = $2 + ($3 - $2) * Parrot_float_rand(0);
+}
+
+=item B<srand>(in NUM)
+
+Set the random number seed to $1. $1 is casted to an INTVAL.
+
+=cut
+
+inline op srand(in NUM) {
+    Parrot_srand((INTVAL)$1);
+}
+
+=item B<srand>(in INT)
+
+Set the random number seed to $1.
+
+=cut
+
+inline op srand(in INT) {
+    Parrot_srand((INTVAL)$1);
+}
+
+=item B<rand>(out INT, in INT, in INT)
+
+Set $1 to a integer between $2 and and $3, inclusive.
+
+=cut
+
+inline op rand(out INT, in INT, in INT) {
+    $1 = Parrot_range_rand($2, $3, 0);
+}
+
+=back
+
+=head1 COPYRIGHT
+
+Copyright (C) 2001-2009, Parrot Foundation.
+
+=head1 LICENSE
+
+This program is free software. It is subject to the same license
+as the Parrot interpreter itself.
+
+=cut
+
+
+/*
+ * Local variables:
+ *   c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */

Modified: branches/orderedhash_revamp/src/dynoplibs/obscure.ops
==============================================================================
--- branches/orderedhash_revamp/src/dynoplibs/obscure.ops	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/dynoplibs/obscure.ops	Sat Jan 23 01:49:53 2010	(r43541)
@@ -3,19 +3,22 @@
 ** obscure.ops
 */
 
+BEGIN_OPS_PREAMBLE
+
 #include <math.h>
 
-VERSION = PARROT_VERSION;
+END_OPS_PREAMBLE
 
 =head1 NAME
 
-obscure.ops - Obscure Mathmatical Opcodes
+obscure.ops - Obscure Mathematical Opcodes
 
 =cut
 
 =head1 DESCRIPTION
 
-Parrot's library of obscure ops.
+Parrot's library of obscure mathematical ops. These turn common
+trig expressions into a single op.
 
 To use this library of ops, add this directive to your PIR:
 
@@ -48,7 +51,7 @@
 =cut
 
 inline op covers(out NUM, in NUM) :advanced_math {
-  $1 = 1.0 - sin($2);
+    $1 = 1.0 - sin($2);
 }
 
 
@@ -62,7 +65,7 @@
 
 
 inline op exsec(out NUM, in NUM) :advanced_math {
-  $1 = (1.0 / cos($2)) - 1.0;
+    $1 = (1.0 / cos($2)) - 1.0;
 }
 
 
@@ -75,7 +78,7 @@
 =cut
 
 inline op hav(out NUM, in NUM) {
-  $1 = 0.5 * (1.0 - cos($2));
+    $1 = 0.5 * (1.0 - cos($2));
 }
 
 
@@ -88,7 +91,7 @@
 =cut
 
 inline op vers(out NUM, in NUM) :advanced_math {
-  $1 = 1.0 - cos($2);
+    $1 = 1.0 - cos($2);
 }
 
 
@@ -101,7 +104,7 @@
 
 =head1 COPYRIGHT
 
-Copyright (C) 2001-2008, Parrot Foundation.
+Copyright (C) 2001-2009, Parrot Foundation.
 
 =head1 LICENSE
 

Modified: branches/orderedhash_revamp/src/dynpmc/dynlexpad.pmc
==============================================================================
--- branches/orderedhash_revamp/src/dynpmc/dynlexpad.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/dynpmc/dynlexpad.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -19,7 +19,7 @@
 
 */
 
-pmclass DynLexPad dynpmc provides lexpad need_ext {
+pmclass DynLexPad dynpmc provides lexpad auto_attrs {
     ATTR Hash *hash;
     ATTR PMC  *init; /* the PMC used to initialize this DynLexPad */
 
@@ -42,8 +42,7 @@
         Hash *hash;
 
         Parrot_DynLexPad_attributes *attrs =
-            mem_allocate_zeroed_typed(Parrot_DynLexPad_attributes);
-        PMC_data(SELF) = attrs;
+            (Parrot_DynLexPad_attributes *) PMC_data(SELF);
 
         if (VTABLE_elements(interp, lexinfo)) {
             attrs->init = pmc_new_init(interp, enum_class_LexPad, lexinfo);
@@ -175,9 +174,9 @@
 
 /*
 
-=item C<METHOD PMC* get_lexinfo()>
+=item C<void destroy()>
 
-Return the LexInfo PMC, if any or a Null PMC.
+Destroy DynLexPad.
 
 =cut
 
@@ -188,7 +187,6 @@
             parrot_hash_destroy(interp, PARROT_DYNLEXPAD(SELF)->hash);
             PARROT_DYNLEXPAD(SELF)->hash = NULL;
         }
-        mem_sys_free(PMC_data(SELF));
     }
 /*
 
@@ -202,8 +200,7 @@
 
     VTABLE void mark() {
         PMC *std_pad = PARROT_DYNLEXPAD(SELF)->init;
-        if (std_pad)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)std_pad);
+        Parrot_gc_mark_PMC_alive(INTERP, std_pad);
         if (PARROT_DYNLEXPAD(SELF)->hash)
             parrot_mark_hash(interp, PARROT_DYNLEXPAD(SELF)->hash);
     }

Modified: branches/orderedhash_revamp/src/dynpmc/foo.pmc
==============================================================================
--- branches/orderedhash_revamp/src/dynpmc/foo.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/dynpmc/foo.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -8,7 +8,7 @@
  * proper inheritance - for testing only
  */
 
-pmclass Foo dynpmc provides scalar extends Integer {
+pmclass Foo dynpmc group foo_group provides scalar extends Integer auto_attrs {
 
     VTABLE INTVAL get_integer() {
         return 42;

Added: branches/orderedhash_revamp/src/dynpmc/foo2.pmc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/src/dynpmc/foo2.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,25 @@
+/*
+ * $Id$
+ * Copyright (C) 2009, Parrot Foundation.
+ */
+
+/*
+ * Sample Foo2 class used to verify dynamic loading and
+ * proper inheritance - for testing only
+ */
+
+pmclass Foo2 dynpmc group foo_group provides scalar extends Foo auto_attrs {
+
+    VTABLE INTVAL get_integer() {
+        INTVAL i = SUPER();
+        return i + 1;
+    }
+}
+
+
+/*
+ * Local variables:
+ *   c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */

Modified: branches/orderedhash_revamp/src/dynpmc/gdbmhash.pmc
==============================================================================
--- branches/orderedhash_revamp/src/dynpmc/gdbmhash.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/dynpmc/gdbmhash.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -92,13 +92,11 @@
 */
 
     VTABLE void class_init() {
-        if (pass) {
 #ifdef WIN32
-            /* RT #46393: What if libgdbm.so cannot be loaded */
-            /* Parrot_load_lib(interp, slib, NULL); */
-            STRING *slib = CONST_STRING(interp, "gdbm3");
+        /* TT #1252:  What if libgdbm.so cannot be loaded */
+        /* Parrot_load_lib(interp, slib, NULL); */
+        STRING *slib = CONST_STRING(interp, "gdbm3");
 #endif
-        }
     }
 
     VTABLE void init() {
@@ -107,13 +105,14 @@
 
         attrs->db_handle = mem_allocate_zeroed_typed(GDBM_FH);
         PMC_data(SELF)   = attrs;
-        PObj_active_destroy_SET(SELF);
+        PObj_custom_destroy_SET(SELF);
     }
 
     VTABLE void destroy() {
         mem_sys_free(
                 ((Parrot_GDBMHash_attributes *)PMC_data(SELF))->db_handle);
         mem_sys_free(PMC_data(SELF));
+        PMC_data(SELF) = NULL;
     }
 
     VTABLE void* get_pointer() {
@@ -215,13 +214,16 @@
         if (!dbf) return;
         keystr = make_hash_key(interp, key);
 
-        key_gdbm.dsize = keystr->strlen;
-        key_gdbm.dptr  = keystr->strstart;
-        val_gdbm.dsize = value->strlen;
-        val_gdbm.dptr  = value->strstart;
+        key_gdbm.dptr  = Parrot_str_to_cstring(interp, keystr);
+        key_gdbm.dsize = strlen(key_gdbm.dptr);
+        val_gdbm.dptr  = Parrot_str_to_cstring(interp, value);
+        val_gdbm.dsize = strlen(val_gdbm.dptr);
 
         gdbm_store(dbf, key_gdbm, val_gdbm, GDBM_REPLACE);
 
+        Parrot_str_free_cstring(key_gdbm.dptr);
+        Parrot_str_free_cstring(val_gdbm.dptr);
+
         return;
     }
 
@@ -248,11 +250,12 @@
 
         keystr         = make_hash_key(interp, key);
 
-        key_gdbm.dsize = keystr->strlen;
-        key_gdbm.dptr  = keystr->strstart;
+        key_gdbm.dptr  = Parrot_str_to_cstring(interp, keystr);
+        key_gdbm.dsize = strlen(key_gdbm.dptr);
         val_gdbm       = gdbm_fetch(dbf, key_gdbm);
 
         val = Parrot_str_new(interp, val_gdbm.dptr, val_gdbm.dsize);
+        Parrot_str_free_cstring(key_gdbm.dptr);
         free(val_gdbm.dptr);
 
         return val;
@@ -346,15 +349,19 @@
         STRING* keystr;
         GDBM_FILE dbf = PMC_dbfh(SELF);
         datum key_gdbm;
+        INTVAL ret;
 
         if (!key) return 0;
         if (!dbf) return 0;
         keystr = make_hash_key(interp, key);
 
-        key_gdbm.dsize = keystr->strlen;
-        key_gdbm.dptr  = keystr->strstart;
+        key_gdbm.dptr  = Parrot_str_to_cstring(interp, keystr);
+        key_gdbm.dsize = strlen(key_gdbm.dptr);
 
-        return gdbm_exists(dbf, key_gdbm);
+        ret = gdbm_exists(dbf, key_gdbm);
+        Parrot_str_free_cstring(key_gdbm.dptr);
+
+        return ret;
     }
 
 /*
@@ -376,13 +383,15 @@
         if (!dbf) return;
         keystr = make_hash_key(interp, key);
 
-        key_gdbm.dsize = keystr->strlen;
-        key_gdbm.dptr  = keystr->strstart;
+        key_gdbm.dptr  = Parrot_str_to_cstring(interp, keystr);
+        key_gdbm.dsize = strlen(key_gdbm.dptr);
 
         if (gdbm_exists(dbf, key_gdbm)) {
            gdbm_delete(dbf, key_gdbm);
         }
 
+        Parrot_str_free_cstring(key_gdbm.dptr);
+
         return;
     }
 }

Deleted: branches/orderedhash_revamp/src/dynpmc/pair.pmc
==============================================================================
--- branches/orderedhash_revamp/src/dynpmc/pair.pmc	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,355 +0,0 @@
-/*
-Copyright (C) 2005-2009, Parrot 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)
-            Parrot_gc_mark_PObj_alive(INTERP, (PObj *)pair->key);
-
-        if (pair->value)
-            Parrot_gc_mark_PObj_alive(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
-
-*/
-
-    VTABLE 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);
-        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/orderedhash_revamp/src/dynpmc/rational.pmc
==============================================================================
--- branches/orderedhash_revamp/src/dynpmc/rational.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/dynpmc/rational.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -269,7 +269,7 @@
         PMC_data(SELF)     = attrs;
         PMC_rational(SELF) = (RATIONAL *)malloc(sizeof (RATIONAL));
         mpq_init(RT(SELF));
-        PObj_active_destroy_SET(SELF);
+        PObj_custom_destroy_SET(SELF);
       #endif
     }
 
@@ -302,6 +302,7 @@
         mpq_clear(RT(SELF));
         mem_sys_free(RT(SELF));
         mem_sys_free(PMC_data(SELF));
+        PMC_data(SELF) = NULL;
       #else
         RAISE_EXCEPTION
       #endif

Modified: branches/orderedhash_revamp/src/dynpmc/rotest.pmc
==============================================================================
--- branches/orderedhash_revamp/src/dynpmc/rotest.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/dynpmc/rotest.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -8,7 +8,7 @@
  * generation.  For testing only.
  */
 
-pmclass ROTest dynpmc provides scalar extends Integer {
+pmclass ROTest dynpmc provides scalar extends Integer auto_attrs {
     VTABLE void set_integer_native(INTVAL value) :read {
     }
     VTABLE INTVAL get_integer() :write {

Modified: branches/orderedhash_revamp/src/dynpmc/subproxy.pmc
==============================================================================
--- branches/orderedhash_revamp/src/dynpmc/subproxy.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/dynpmc/subproxy.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,6 +1,6 @@
 /*
  * $Id$
- * Copyright (C) 2003-2008, Parrot Foundation.
+ * Copyright (C) 2003-2009, Parrot Foundation.
  */
 
 /*
@@ -14,7 +14,7 @@
  */
 #define enum_class_SubProxy -1
 
-pmclass SubProxy dynpmc need_ext extends Sub {
+pmclass SubProxy dynpmc extends Sub auto_attrs {
 
     VTABLE void init() {
         SUPER();
@@ -31,7 +31,7 @@
             PMC         *key = PMC_data_typed(SELF, PMC *);
             STRING      *file;
             PMC         *rsub_pmc, *sub_pmc;
-            Parrot_sub  *rsub,     *my_sub;
+            Parrot_Sub_attributes  *rsub,     *my_sub;
 
             if (!key)
                 Parrot_ex_throw_from_c_args(interp, NULL, 1, "SubProxy: no key");

Modified: branches/orderedhash_revamp/src/embed.c
==============================================================================
--- branches/orderedhash_revamp/src/embed.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/embed.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -22,6 +22,8 @@
 #include "parrot/embed.h"
 #include "parrot/oplib/ops.h"
 #include "pmc/pmc_sub.h"
+#include "pmc/pmc_callcontext.h"
+#include "parrot/runcore_api.h"
 
 #include "../compilers/imcc/imc.h"
 
@@ -30,9 +32,6 @@
 /* HEADERIZER BEGIN: static */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
-static FLOATVAL calibrate(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
 PARROT_CANNOT_RETURN_NULL
 PARROT_OBSERVER
 static const char * op_name(PARROT_INTERP, int k)
@@ -44,13 +43,6 @@
 static void print_debug(PARROT_INTERP, SHIM(int status), SHIM(void *p))
         __attribute__nonnull__(1);
 
-static void print_profile(PARROT_INTERP, SHIM(int status), SHIM(void *p))
-        __attribute__nonnull__(1);
-
-static int prof_sort_f(ARGIN(const void *a), ARGIN(const void *b))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
 PARROT_CANNOT_RETURN_NULL
 static PMC* set_current_sub(PARROT_INTERP)
         __attribute__nonnull__(1);
@@ -60,24 +52,17 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(3);
 
-#define ASSERT_ARGS_calibrate __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_op_name __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_print_constant_table __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_print_debug __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_print_profile __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_prof_sort_f __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(a) \
-    || PARROT_ASSERT_ARG(b)
-#define ASSERT_ARGS_set_current_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_setup_argv __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_op_name __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_print_constant_table __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_print_debug __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_set_current_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_setup_argv __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(argv)
+    , PARROT_ASSERT_ARG(argv))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -96,13 +81,6 @@
 
 */
 
-#ifdef JIT_CAPABLE
-#  if EXEC_CAPABLE
-#    include "parrot/exec.h"
-#  endif /* EXEC_CAPABLE */
-#  include "jit.h"
-#endif
-
 PARROT_EXPORT
 PARROT_CANNOT_RETURN_NULL
 Parrot_Interp
@@ -165,12 +143,12 @@
 
     Interp_flags_SET(interp, flag);
     switch (flag) {
-        case PARROT_BOUNDS_FLAG:
-        case PARROT_PROFILE_FLAG:
-            Interp_core_SET(interp, PARROT_SLOW_CORE);
-            break;
-        default:
-            break;
+      case PARROT_BOUNDS_FLAG:
+      case PARROT_PROFILE_FLAG:
+        Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "slow"));
+        break;
+      default:
+        break;
     }
 }
 
@@ -229,8 +207,8 @@
 void
 Parrot_set_trace(PARROT_INTERP, UINTVAL flag)
 {
-    CONTEXT(interp)->trace_flags |= flag;
-    Interp_core_SET(interp, PARROT_SLOW_CORE);
+    Parrot_pcc_trace_flags_on(interp, interp->ctx, flag);
+    Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "slow"));
 }
 
 
@@ -284,7 +262,7 @@
 void
 Parrot_clear_trace(PARROT_INTERP, UINTVAL flag)
 {
-    CONTEXT(interp)->trace_flags &= ~flag;
+    Parrot_pcc_trace_flags_off(interp, interp->ctx, flag);
 }
 
 
@@ -338,7 +316,7 @@
 UINTVAL
 Parrot_test_trace(PARROT_INTERP, UINTVAL flag)
 {
-    return CONTEXT(interp)->trace_flags & flag;
+    return Parrot_pcc_trace_flags_test(interp, interp->ctx, flag);
 }
 
 
@@ -356,7 +334,38 @@
 void
 Parrot_set_run_core(PARROT_INTERP, Parrot_Run_core_t core)
 {
-    Interp_core_SET(interp, core);
+    switch (core) {
+      case PARROT_SLOW_CORE:
+        Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "slow"));
+        break;
+      case PARROT_FAST_CORE:
+        Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "fast"));
+        break;
+      case PARROT_SWITCH_CORE:
+        Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "switch"));
+        break;
+      case PARROT_CGP_CORE:
+        Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "cgp"));
+        break;
+      case PARROT_CGOTO_CORE:
+        Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "cgoto"));
+        break;
+      case PARROT_EXEC_CORE:
+        Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "exec"));
+        break;
+      case PARROT_GC_DEBUG_CORE:
+        Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "gc_debug"));
+        break;
+      case PARROT_DEBUGGER_CORE:
+        Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "debugger"));
+        break;
+      case PARROT_PROFILING_CORE:
+        Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "profiling"));
+        break;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+                "Invalid runcore requested\n");
+    }
 }
 
 
@@ -482,6 +491,7 @@
             Parrot_io_eprintf(interp,
              "Parrot VM: Problem reading packfile from PIO:  code %d.\n",
                         ferror(io));
+            fclose(io);
             mem_sys_free(program_code);
             return NULL;
         }
@@ -555,16 +565,13 @@
     if (!(pf->options & PFOPT_HEADERONLY))
         do_sub_pragmas(interp, pf->cur_cs, PBC_PBC, NULL);
 
-    /* JITting and/or prederefing the sub/the bytecode is done
-     * in switch_to_cs before actual usage of the segment */
+    /* Prederefing the sub/the bytecode is done in switch_to_cs before
+     * actual usage of the segment */
 
 #ifdef PARROT_HAS_HEADER_SYSMMAN
     /* the man page states that it's ok to close a mmaped file */
     if (fd >= 0)
         close(fd);
-#else
-    /* RT #46155 Parrot_exec uses this
-    mem_sys_free(program_code); */
 #endif
 
     return pf;
@@ -659,33 +666,6 @@
 
 /*
 
-=item C<static int prof_sort_f(const void *a, const void *b)>
-
-Sort function for profile data, by time.
-
-=cut
-
-*/
-
-static int
-prof_sort_f(ARGIN(const void *a), ARGIN(const void *b))
-{
-    ASSERT_ARGS(prof_sort_f)
-    const FLOATVAL timea = ((const ProfData *)a)->time;
-    const FLOATVAL timeb = ((const ProfData *)b)->time;
-
-    if (timea < timeb)
-        return 1;
-
-    if (timea > timeb)
-        return -1;
-
-    return 0;
-}
-
-
-/*
-
 =item C<static const char * op_name(PARROT_INTERP, int k)>
 
 Returns the name of the opcode.
@@ -700,140 +680,7 @@
 op_name(PARROT_INTERP, int k)
 {
     ASSERT_ARGS(op_name)
-    switch (k) {
-        case PARROT_PROF_GC_p1:
-            return "GC_mark_root";
-        case PARROT_PROF_GC_p2:
-            return "GC_mark_next";
-        case PARROT_PROF_GC_cp:
-            return "GC_collect_PMC";
-        case PARROT_PROF_GC_cb:
-            return "GC_collect_buffers";
-        case PARROT_PROF_GC:
-            return "GC";
-        case PARROT_PROF_EXCEPTION:
-            return "EXCEPTION";
-        default:
-            break;
-    }
-
-    return interp->op_info_table[k - PARROT_PROF_EXTRA].full_name;
-}
-
-
-/*
-
-=item C<static FLOATVAL calibrate(PARROT_INTERP)>
-
-With this calibration, reported times of C<parrot -p> almost match those
-measured with time C<parrot -R bounds>.
-
-=cut
-
-*/
-
-static FLOATVAL
-calibrate(PARROT_INTERP)
-{
-    ASSERT_ARGS(calibrate)
-    opcode_t code[] = { 1 };      /* noop */
-    opcode_t *pc    = code;
-    const size_t   count  = 1000000;
-    size_t   n      = count;
-    const FLOATVAL start  = Parrot_floatval_time();
-    FLOATVAL now    = start;
-
-    /* op timing isn't free; it requires at least one time fetch per op */
-    for (; n; --n) {
-        pc = (interp->op_func_table[*code])(pc, interp);
-        now = Parrot_floatval_time();
-    }
-
-    return (now - start) / (FLOATVAL) count;
-}
-
-
-/*
-
-=item C<static void print_profile(PARROT_INTERP, int status, void *p)>
-
-Prints out a profile listing.
-
-=cut
-
-*/
-
-static void
-print_profile(PARROT_INTERP, SHIM(int status), SHIM(void *p))
-{
-    ASSERT_ARGS(print_profile)
-    RunProfile * const profile = interp->profile;
-
-    if (profile) {
-        UINTVAL        j;
-        int            k, jit;
-        UINTVAL        op_count   = 0;
-        UINTVAL        call_count = 0;
-        FLOATVAL       sum_time   = 0.0;
-        const FLOATVAL empty      = calibrate(interp);
-
-        Parrot_io_printf(interp,
-                   "Calibration: overhead = %.6f ms/op\n", 1000.0 * empty);
-
-        Parrot_io_printf(interp,
-                   " Code J Name                         "
-                   "Calls  Total/s       Avg/ms\n");
-
-        for (j = 0; j < interp->op_count + PARROT_PROF_EXTRA; j++) {
-            const UINTVAL n     = profile->data[j].numcalls;
-            profile->data[j].op = j;
-
-            if (j >= PARROT_PROF_EXTRA) {
-                profile->data[j].time -= empty * n;
-
-                /* faster than noop */
-                if (profile->data[j].time < 0.0)
-                    profile->data[j].time = 0.0;
-            }
-        }
-
-        qsort(profile->data, interp->op_count + PARROT_PROF_EXTRA,
-                sizeof (ProfData), prof_sort_f);
-
-        for (j = 0; j < interp->op_count + PARROT_PROF_EXTRA; j++) {
-            const UINTVAL n = profile->data[j].numcalls;
-
-            if (n > 0) {
-                const FLOATVAL t = profile->data[j].time;
-
-                op_count++;
-                call_count += n;
-                sum_time   += t;
-
-                k   = profile->data[j].op;
-                jit = '-';
-#if JIT_CAPABLE
-                if (k >= PARROT_PROF_EXTRA &&
-                    op_jit[k - PARROT_PROF_EXTRA].extcall != 1)
-                    jit = 'j';
-#endif
-                Parrot_io_printf(interp, " %4d %c %-25s %8vu  %10vf  %10.6vf\n",
-                        k - PARROT_PROF_EXTRA,
-                        jit,
-                        op_name(interp, k),
-                        n,
-                        t,
-                        (FLOATVAL)(t * 1000.0 / (FLOATVAL)n));
-            }
-        }
-
-        Parrot_io_printf(interp, " %4vu - %-25s %8vu  %10vf  %10.6vf\n",
-                op_count,
-                "-",
-                call_count,
-                sum_time,
-                (FLOATVAL)(sum_time * 1000.0 / (FLOATVAL)call_count));
-    }
+    return interp->op_info_table[k].full_name;
 }
 
 
@@ -879,7 +726,7 @@
 set_current_sub(PARROT_INTERP)
 {
     ASSERT_ARGS(set_current_sub)
-    Parrot_sub *sub_pmc_sub;
+    Parrot_Sub_attributes *sub_pmc_sub;
     PMC        *sub_pmc;
 
     PackFile_ByteCode   * const cur_cs = interp->code;
@@ -897,15 +744,15 @@
         if (ft->fixups[i]->type == enum_fixup_sub) {
             const opcode_t ci      = ft->fixups[i]->offset;
             PMC           *sub_pmc = ct->constants[ci]->u.key;
-            Parrot_sub    *sub;
+            Parrot_Sub_attributes *sub;
 
             PMC_get_sub(interp, sub_pmc, sub);
             if (sub->seg == cur_cs) {
                 const size_t offs = sub->start_offs;
 
                 if (offs == interp->resume_offset) {
-                    CONTEXT(interp)->current_sub = sub_pmc;
-                    CONTEXT(interp)->current_HLL = sub->HLL_id;
+                    Parrot_pcc_set_sub(interp, CURRENT_CONTEXT(interp), sub_pmc);
+                    Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp), sub->HLL_id);
                     return sub_pmc;
                 }
 
@@ -919,7 +766,7 @@
     sub_pmc                      = pmc_new(interp, enum_class_Sub);
     PMC_get_sub(interp, sub_pmc, sub_pmc_sub);
     sub_pmc_sub->start_offs      = 0;
-    CONTEXT(interp)->current_sub = sub_pmc;
+    Parrot_pcc_set_sub(interp, CURRENT_CONTEXT(interp), sub_pmc);
 
     return sub_pmc;
 }
@@ -941,10 +788,6 @@
 {
     PMC *userargv, *main_sub;
 
-    if (Interp_debug_TEST(interp, PARROT_START_DEBUG_FLAG))
-        Parrot_io_eprintf(interp,
-                "*** Parrot VM: Setting stack top. ***\n");
-
     /* Debugging mode nonsense. */
     if (Interp_debug_TEST(interp, PARROT_START_DEBUG_FLAG)) {
         if (Interp_flags_TEST(interp, PARROT_BOUNDS_FLAG)) {
@@ -955,70 +798,31 @@
         if (Interp_trace_TEST(interp, PARROT_TRACE_OPS_FLAG))
             Parrot_io_eprintf(interp, "*** Parrot VM: Tracing enabled. ***\n");
 
-        Parrot_io_eprintf(interp, "*** Parrot VM: ");
-
-        switch (interp->run_core) {
-            case PARROT_SLOW_CORE:
-                Parrot_io_eprintf(interp, "Slow core");
-                break;
-            case PARROT_FAST_CORE:
-                Parrot_io_eprintf(interp, "Fast core");
-                break;
-            case PARROT_SWITCH_CORE:
-            case PARROT_SWITCH_JIT_CORE:
-                Parrot_io_eprintf(interp, "Switch core");
-                break;
-            case PARROT_CGP_CORE:
-            case PARROT_CGP_JIT_CORE:
-                Parrot_io_eprintf(interp, "CGP core");
-                break;
-            case PARROT_CGOTO_CORE:
-                Parrot_io_eprintf(interp, "CGoto core");
-                break;
-            case PARROT_JIT_CORE:
-                Parrot_io_eprintf(interp, "JIT core");
-                break;
-            case PARROT_EXEC_CORE:
-                Parrot_io_eprintf(interp, "EXEC core");
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, 1,
-                     "Unknown run core");
-        }
-
-        Parrot_io_eprintf(interp, " ***\n");
+        Parrot_io_eprintf(interp, "*** Parrot VM: %Ss core ***\n",
+                interp->run_core->name);
     }
 
     /* Set up @ARGS (or whatever this language calls it) in userargv. */
     userargv = setup_argv(interp, argc, argv);
 
-#if EXEC_CAPABLE
-
-    /* s. runops_exec interpreter.c */
-    if (Interp_core_TEST(interp, PARROT_EXEC_CORE))
-        Parrot_exec_run = 1;
-
-#endif
-
     /*
      * If any profile information was gathered, print it out
      * before exiting, then print debug infos if turned on.
      */
     Parrot_on_exit(interp, print_debug,   NULL);
-    Parrot_on_exit(interp, print_profile, NULL);
 
     /* Let's kick the tires and light the fires--call interpreter.c:runops. */
-    main_sub = CONTEXT(interp)->current_sub;
+    main_sub = Parrot_pcc_get_sub(interp, CURRENT_CONTEXT(interp));
 
     /* if no sub was marked being :main, we create a dummy sub with offset 0 */
 
     if (!main_sub)
         main_sub = set_current_sub(interp);
 
-    CONTEXT(interp)->current_sub = NULL;
-    CONTEXT(interp)->constants   = interp->code->const_table->constants;
+    Parrot_pcc_set_sub(interp, CURRENT_CONTEXT(interp), NULL);
+    Parrot_pcc_set_constants(interp, interp->ctx, interp->code->const_table->constants);
 
-    Parrot_runops_fromc_args(interp, main_sub, "vP", userargv);
+    Parrot_pcc_invoke_sub_from_c_args(interp, main_sub, "P->", userargv);
 }
 
 
@@ -1087,31 +891,33 @@
         const PackFile_Constant * const c = interp->code->const_table->constants[i];
 
         switch (c->type) {
-            case PFC_NUMBER:
-                Parrot_io_printf(interp, "PMC_CONST(%d): %f\n", i, c->u.number);
-                break;
-            case PFC_STRING:
-                Parrot_io_printf(interp, "PMC_CONST(%d): %S\n", i, c->u.string);
-                break;
-            case PFC_KEY:
-                Parrot_io_printf(interp, "PMC_CONST(%d): ", i);
-                /* XXX */
-                /* Parrot_print_p(interp, c->u.key); */
-                Parrot_io_printf(interp, "(PMC constant)");
-                Parrot_io_printf(interp, "\n");
-                break;
-            case PFC_PMC: {
+          case PFC_NUMBER:
+            Parrot_io_printf(interp, "PMC_CONST(%d): %f\n", i, c->u.number);
+            break;
+          case PFC_STRING:
+            Parrot_io_printf(interp, "PMC_CONST(%d): %S\n", i, c->u.string);
+            break;
+          case PFC_KEY:
+            Parrot_io_printf(interp, "PMC_CONST(%d): ", i);
+            /* XXX */
+            /* Parrot_print_p(interp, c->u.key); */
+            Parrot_io_printf(interp, "(PMC constant)");
+            Parrot_io_printf(interp, "\n");
+            break;
+          case PFC_PMC:
+            {
                 Parrot_io_printf(interp, "PMC_CONST(%d): ", i);
 
                 switch (c->u.key->vtable->base_type) {
                     /* each PBC file has a ParrotInterpreter, but it can't
                      * stringify by itself */
-                    case enum_class_ParrotInterpreter:
-                        Parrot_io_printf(interp, "'ParrotInterpreter'");
-                        break;
+                  case enum_class_ParrotInterpreter:
+                    Parrot_io_printf(interp, "'ParrotInterpreter'");
+                    break;
 
                     /* FixedIntegerArrays used for signatures, handy to print */
-                    case enum_class_FixedIntegerArray: {
+                  case enum_class_FixedIntegerArray:
+                    {
                         INTVAL n = VTABLE_elements(interp, c->u.key);
                         INTVAL i;
                         Parrot_io_printf(interp, "[");
@@ -1125,32 +931,32 @@
                         Parrot_io_printf(interp, "]");
                         break;
                     }
-                    case enum_class_NameSpace:
-                    case enum_class_String:
-                    case enum_class_Key:
-                    case enum_class_ResizableStringArray:
-                        {
-                            /*Parrot_print_p(interp, c->u.key);*/
-                            STRING * const s = VTABLE_get_string(interp, c->u.key);
-                            if (s)
-                                Parrot_io_printf(interp, "%Ss", s);
-                            break;
-                        }
-                    case enum_class_Sub:
-                        Parrot_io_printf(interp, "%S", VTABLE_get_string(interp, c->u.key));
-                        break;
-                    default:
-                        Parrot_io_printf(interp, "(PMC constant)");
+                  case enum_class_NameSpace:
+                  case enum_class_String:
+                  case enum_class_Key:
+                  case enum_class_ResizableStringArray:
+                    {
+                        /*Parrot_print_p(interp, c->u.key);*/
+                        STRING * const s = VTABLE_get_string(interp, c->u.key);
+                        if (s)
+                            Parrot_io_printf(interp, "%Ss", s);
                         break;
+                    }
+                  case enum_class_Sub:
+                    Parrot_io_printf(interp, "%S", VTABLE_get_string(interp, c->u.key));
+                    break;
+                  default:
+                    Parrot_io_printf(interp, "(PMC constant)");
+                    break;
                 }
 
                 Parrot_io_printf(interp, "\n");
                 break;
             }
-            default:
-                Parrot_io_printf(interp, "wrong constant type in constant table!\n");
-                /* XXX throw an exception? Is it worth the trouble? */
-                break;
+          default:
+            Parrot_io_printf(interp, "wrong constant type in constant table!\n");
+            /* XXX throw an exception? Is it worth the trouble? */
+            break;
         }
     }
 
@@ -1276,7 +1082,8 @@
     program_code[1] = 0; /* end */
 
     pf->cur_cs = (PackFile_ByteCode *)
-        (pf->PackFuncs[PF_BYTEC_SEG].new_seg)(interp, pf, "code", 1);
+        (pf->PackFuncs[PF_BYTEC_SEG].new_seg)(interp, pf,
+                Parrot_str_new_constant(interp, "code"), 1);
     pf->cur_cs->base.data = program_code;
     pf->cur_cs->base.size = 2;
 
@@ -1285,7 +1092,7 @@
     run_native = func;
 
     if (interp->code && interp->code->const_table)
-        CONTEXT(interp)->constants = interp->code->const_table->constants;
+        Parrot_pcc_set_constants(interp, interp->ctx, interp->code->const_table->constants);
 
     runops(interp, interp->resume_offset);
 }
@@ -1311,7 +1118,8 @@
      * before compiling a string */
 
     if (!interp->initial_pf) {
-        PackFile * const pf = PackFile_new_dummy(interp, "compile_string");
+        PackFile * const pf = PackFile_new_dummy(interp,
+                Parrot_str_new_constant(interp, "compile_string"));
         /* Assumption: there is no valid reason to fail to create it.
          * If the assumption changes, replace the assertion with a
          * runtime check */

Modified: branches/orderedhash_revamp/src/events.c
==============================================================================
--- branches/orderedhash_revamp/src/events.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/events.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -103,38 +103,38 @@
     ARGIN_NULLOK(opcode_t *next))
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_do_event __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_do_event __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(event)
-#define ASSERT_ARGS_dup_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(entry)
-#define ASSERT_ARGS_dup_entry_interval __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(entry)
-#define ASSERT_ARGS_event_thread __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(data)
-#define ASSERT_ARGS_event_to_exception __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(event))
+#define ASSERT_ARGS_dup_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(entry))
+#define ASSERT_ARGS_dup_entry_interval __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(entry))
+#define ASSERT_ARGS_event_thread __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(data))
+#define ASSERT_ARGS_event_to_exception __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(event)
-#define ASSERT_ARGS_init_events_all __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_init_events_first __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_io_thread __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_io_thread_ready_rd __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(ios)
-#define ASSERT_ARGS_Parrot_sigaction __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(handler)
-#define ASSERT_ARGS_Parrot_unblock_signal __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_process_events __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(event_q)
-#define ASSERT_ARGS_schedule_signal_event __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_sig_handler __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_stop_io_thread __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_store_io_event __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(event))
+#define ASSERT_ARGS_init_events_all __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_init_events_first __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_io_thread __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_io_thread_ready_rd __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(ios))
+#define ASSERT_ARGS_Parrot_sigaction __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(handler))
+#define ASSERT_ARGS_Parrot_unblock_signal __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_process_events __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(event_q))
+#define ASSERT_ARGS_schedule_signal_event __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_sig_handler __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_stop_io_thread __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_store_io_event __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(ios) \
-    || PARROT_ASSERT_ARG(ev)
-#define ASSERT_ARGS_wait_for_wakeup __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+    , PARROT_ASSERT_ARG(ev))
+#define ASSERT_ARGS_wait_for_wakeup __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: static */
 
@@ -244,14 +244,14 @@
 {
     ASSERT_ARGS(sig_handler)
     switch (signum) {
-        case SIGINT:
-            sig_int = 1;
-            break;
-        case SIGHUP:
-            sig_hup = 1;
-            break;
-        default:
-            break;
+      case SIGINT:
+        sig_int = 1;
+        break;
+      case SIGHUP:
+        sig_hup = 1;
+        break;
+      default:
+        break;
     }
 }
 
@@ -477,21 +477,21 @@
     ev->interp  = interp;
     entry->data = ev;
     switch (ev->type) {
-        case EVENT_TYPE_TIMER:
-        case EVENT_TYPE_SLEEP:
-            entry->type = QUEUE_ENTRY_TYPE_TIMED_EVENT;
-            insert_entry(event_queue, entry);
-            break;
-        case EVENT_TYPE_CALL_BACK:
-        case EVENT_TYPE_SIGNAL:
-        case EVENT_TYPE_IO:
-            entry->type = QUEUE_ENTRY_TYPE_EVENT;
-            unshift_entry(event_queue, entry);
-            break;
-        default:
-            entry->type = QUEUE_ENTRY_TYPE_EVENT;
-            push_entry(event_queue, entry);
-            break;
+      case EVENT_TYPE_TIMER:
+      case EVENT_TYPE_SLEEP:
+        entry->type = QUEUE_ENTRY_TYPE_TIMED_EVENT;
+        insert_entry(event_queue, entry);
+        break;
+      case EVENT_TYPE_CALL_BACK:
+      case EVENT_TYPE_SIGNAL:
+      case EVENT_TYPE_IO:
+        entry->type = QUEUE_ENTRY_TYPE_EVENT;
+        unshift_entry(event_queue, entry);
+        break;
+      default:
+        entry->type = QUEUE_ENTRY_TYPE_EVENT;
+        push_entry(event_queue, entry);
+        break;
     }
 }
 
@@ -722,13 +722,13 @@
      * in front or at the end of the queue
      */
     switch (event->type) {
-        case EVENT_TYPE_CALL_BACK:
-        case EVENT_TYPE_SIGNAL:
-            unshift_entry(interp->task_queue, entry);
-            break;
-        default:
-            push_entry(interp->task_queue, entry);
-            break;
+      case EVENT_TYPE_CALL_BACK:
+      case EVENT_TYPE_SIGNAL:
+        unshift_entry(interp->task_queue, entry);
+        break;
+      default:
+        push_entry(interp->task_queue, entry);
+        break;
     }
 }
 
@@ -749,52 +749,52 @@
     parrot_event * const event = (parrot_event *)entry->data;
 
     switch (event->type) {
-        case EVENT_TYPE_SIGNAL:
-            edebug((stderr, "broadcast signal\n"));
-            /*
-             * we don't have special signal handlers in usercode yet
-             * e.g.:
-             * install handler like exception handler *and*
-             * set a interpreter flag, that a handler exists
-             * we then could examine that flag (after LOCKing it)
-             * and dispatch the exception to all interpreters that
-             * handle it
-             * Finally, we send the first (main) interpreter that signal
-             *
-             * For now just send to all.
-             *
-             */
-            switch (event->u.signal) {
-                case SIGHUP:
-                case SIGINT:
-                    {
-                    if (n_interpreters) {
-                        size_t i;
-                        LOCK(interpreter_array_mutex);
-                        for (i = 1; i < n_interpreters; ++i) {
-                            Interp *interp;
-                            edebug((stderr, "deliver SIGINT to %d\n", i));
-                            interp = interpreter_array[i];
-                            if (interp)
-                                Parrot_schedule_interp_qentry(interp,
+      case EVENT_TYPE_SIGNAL:
+        edebug((stderr, "broadcast signal\n"));
+        /*
+         * we don't have special signal handlers in usercode yet
+         * e.g.:
+         * install handler like exception handler *and*
+         * set a interpreter flag, that a handler exists
+         * we then could examine that flag (after LOCKing it)
+         * and dispatch the exception to all interpreters that
+         * handle it
+         * Finally, we send the first (main) interpreter that signal
+         *
+         * For now just send to all.
+         *
+         */
+        switch (event->u.signal) {
+          case SIGHUP:
+          case SIGINT:
+            {
+                if (n_interpreters) {
+                    size_t i;
+                    LOCK(interpreter_array_mutex);
+                    for (i = 1; i < n_interpreters; ++i) {
+                        Interp *interp;
+                        edebug((stderr, "deliver SIGINT to %d\n", i));
+                        interp = interpreter_array[i];
+                        if (interp)
+                            Parrot_schedule_interp_qentry(interp,
                                         dup_entry(entry));
-                        }
-                        UNLOCK(interpreter_array_mutex);
                     }
-                    Parrot_schedule_interp_qentry(interpreter_array[0], entry);
-                    edebug((stderr, "deliver SIGINT to 0\n"));
-                    }
-                    break;
-                default:
-                    mem_sys_free(entry);
-                    mem_sys_free(event);
+                    UNLOCK(interpreter_array_mutex);
+                }
+                Parrot_schedule_interp_qentry(interpreter_array[0], entry);
+                edebug((stderr, "deliver SIGINT to 0\n"));
             }
             break;
-        default:
+          default:
             mem_sys_free(entry);
             mem_sys_free(event);
-            exit_fatal(1, "Unknown event to broadcast");
-            break;
+        }
+        break;
+      default:
+        mem_sys_free(entry);
+        mem_sys_free(event);
+        exit_fatal(1, "Unknown event to broadcast");
+        break;
     }
 }
 
@@ -919,83 +919,82 @@
         const int retval = select(n_highest, &rfds, &wfds, NULL, NULL);
 
         switch (retval) {
-            case -1:
-                if (errno == EINTR) {
-                    edebug((stderr, "select EINTR\n"));
-                    if (sig_int) {
-                        edebug((stderr, "int arrived\n"));
-                        sig_int = 0;
-                        /*
-                         * signal the event thread
-                         */
-                        schedule_signal_event(SIGINT);
-                    }
-                    if (sig_hup) {
-                        edebug((stderr, "int arrived\n"));
-                        sig_hup = 0;
+          case -1:
+            if (errno == EINTR) {
+                edebug((stderr, "select EINTR\n"));
+                if (sig_int) {
+                    edebug((stderr, "int arrived\n"));
+                    sig_int = 0;
+                    /*
+                     * signal the event thread
+                     */
+                    schedule_signal_event(SIGINT);
+                }
+                if (sig_hup) {
+                    edebug((stderr, "int arrived\n"));
+                    sig_hup = 0;
+                    /*
+                     * signal the event thread
+                     */
+                    schedule_signal_event(SIGHUP);
+                }
+
+            }
+            break;
+          case 0:     /* timeout - can't happen */
+            break;
+          default:
+            edebug((stderr, "IO ready\n"));
+            for (i = 0; i < n_highest; ++i) {
+                if (FD_ISSET(i, &rfds)) {
+                    if (i == PIPE_READ_FD) {
+                        io_thread_msg buf;
                         /*
-                         * signal the event thread
+                         * a command arrived
                          */
-                        schedule_signal_event(SIGHUP);
-                    }
-
-                }
-                break;
-            case 0:     /* timeout - can't happen */
-                break;
-            default:
-                edebug((stderr, "IO ready\n"));
-                for (i = 0; i < n_highest; ++i) {
-                    if (FD_ISSET(i, &rfds)) {
-                        if (i == PIPE_READ_FD) {
-                            io_thread_msg buf;
-                            /*
-                             * a command arrived
-                             */
-                            edebug((stderr, "msg arrived\n"));
-                            if (read(PIPE_READ_FD, &buf, sizeof (buf)) != sizeof (buf))
-                                exit_fatal(1,
-                                        "read error from msg pipe");
-                            switch (buf.command) {
-                                case IO_THR_MSG_TERMINATE:
-                                    running = 0;
-                                    break;
-                                case IO_THR_MSG_ADD_SELECT_RD:
-                                    {
-                                        PMC * const pio = buf.ev->u.io_event.pio;
-                                        const int fd = Parrot_io_getfd(buf.ev->interp, pio);
-                                        if (FD_ISSET(fd, &act_rfds)) {
-                                            mem_sys_free(buf.ev);
-                                            break;
-                                        }
-                                        FD_SET(fd, &act_rfds);
-                                        if (fd >= n_highest)
-                                            n_highest = fd + 1;
-                                        store_io_event(&ios, buf.ev);
-                                    }
-                                    break;
-                                    /* TODO */
-                                default:
-                                    exit_fatal(1,
-                                            "unhandled msg in pipe");
+                        edebug((stderr, "msg arrived\n"));
+                        if (read(PIPE_READ_FD, &buf, sizeof (buf)) != sizeof (buf))
+                            exit_fatal(1,
+                                    "read error from msg pipe");
+                        switch (buf.command) {
+                          case IO_THR_MSG_TERMINATE:
+                            running = 0;
+                            break;
+                          case IO_THR_MSG_ADD_SELECT_RD:
+                            {
+                                PMC * const pio = buf.ev->u.io_event.pio;
+                                const int fd = Parrot_io_getfd(buf.ev->interp, pio);
+                                if (FD_ISSET(fd, &act_rfds)) {
+                                    mem_sys_free(buf.ev);
                                     break;
+                                }
+                                FD_SET(fd, &act_rfds);
+                                if (fd >= n_highest)
+                                    n_highest = fd + 1;
+                                store_io_event(&ios, buf.ev);
                             }
-
-                        }
-                        else {
-                            /*
-                             * one of the io_event fds is ready
-                             * remove from active set, as we don't
-                             * want to fire again during io_handler
-                             * invocation
-                             */
-                            FD_CLR(i, &act_rfds);
-                            io_thread_ready_rd(&ios, i);
+                            break;
+                          default:
+                            /* TODO */
+                            exit_fatal(1, "unhandled msg in pipe");
+                            break;
                         }
+
+                    }
+                    else {
+                        /*
+                         * one of the io_event fds is ready
+                         * remove from active set, as we don't
+                         * want to fire again during io_handler
+                         * invocation
+                         */
+                        FD_CLR(i, &act_rfds);
+                        io_thread_ready_rd(&ios, i);
                     }
                 }
-                /* TODO check fds */
-                break;
+            }
+            /* TODO check fds */
+            break;
         }
     }
     edebug((stderr, "IO thread terminated\n"));
@@ -1155,37 +1154,37 @@
         parrot_event *event = NULL;
 
         switch (entry->type) {
-            case QUEUE_ENTRY_TYPE_EVENT:
-                entry = nosync_pop_entry(event_q);
-                event = (parrot_event *)entry->data;
-                break;
+          case QUEUE_ENTRY_TYPE_EVENT:
+            entry = nosync_pop_entry(event_q);
+            event = (parrot_event *)entry->data;
+            break;
+
+          case QUEUE_ENTRY_TYPE_TIMED_EVENT:
+            event = (parrot_event *)entry->data;
+            now   = Parrot_floatval_time();
 
-            case QUEUE_ENTRY_TYPE_TIMED_EVENT:
-                event = (parrot_event *)entry->data;
-                now   = Parrot_floatval_time();
-
-                /*
-                 * if the timer_event isn't due yet, ignore the event
-                 * (we were signalled on insert of the event)
-                 * wait until we get at it again when time has elapsed
-                 */
-                if (now < event->u.timer_event.abs_time)
-                    return 1;
-                entry = nosync_pop_entry(event_q);
-
-                /* if event is repeated dup and reinsert it */
-
-                if (event->u.timer_event.interval) {
-                    if (event->u.timer_event.repeat) {
-                        if (event->u.timer_event.repeat != -1)
-                            event->u.timer_event.repeat--;
-                        nosync_insert_entry(event_q,
+            /*
+             * if the timer_event isn't due yet, ignore the event
+             * (we were signalled on insert of the event)
+             * wait until we get at it again when time has elapsed
+             */
+            if (now < event->u.timer_event.abs_time)
+                return 1;
+            entry = nosync_pop_entry(event_q);
+
+            /* if event is repeated dup and reinsert it */
+
+            if (event->u.timer_event.interval) {
+                if (event->u.timer_event.repeat) {
+                    if (event->u.timer_event.repeat != -1)
+                        event->u.timer_event.repeat--;
+                    nosync_insert_entry(event_q,
                                 dup_entry_interval(entry, now));
-                    }
                 }
-                break;
-            default:
-                exit_fatal(1, "Unknown queue entry");
+            }
+            break;
+          default:
+            exit_fatal(1, "Unknown queue entry");
         }
         PARROT_ASSERT(event);
         if (event->type == EVENT_TYPE_NONE) {
@@ -1418,24 +1417,24 @@
     const int exit_code = -event->u.signal;
 
     switch (event->u.signal) {
-        case SIGINT:
-        case SIGHUP:
-            /*
-             * SIGINT is silent, if no exception handler is
-             * installed: set severity to EXCEPT_exit
-             */
-            {
-                STRING * const message = CONST_STRING(interp, "Caught signal.");
-                PMC           *exception = Parrot_ex_build_exception(interp,
+      case SIGINT:
+      case SIGHUP:
+        /*
+         * SIGINT is silent, if no exception handler is
+         * installed: set severity to EXCEPT_exit
+         */
+        {
+            STRING * const message = CONST_STRING(interp, "Caught signal.");
+            PMC           *exception = Parrot_ex_build_exception(interp,
                                         EXCEPT_exit, exit_code, message);
 
-                Parrot_ex_throw_from_c(interp, exception);
-            }
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, exit_code,
+            Parrot_ex_throw_from_c(interp, exception);
+        }
+        break;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, exit_code,
                     "Caught signal.");
-            break;
+        break;
     }
 }
 
@@ -1460,43 +1459,43 @@
     ASSERT_ARGS(do_event)
     edebug((stderr, "do_event %s\n", et(event)));
     switch (event->type) {
-        case EVENT_TYPE_TERMINATE:
-            next = NULL;        /* this will terminate the run loop */
-            break;
-        case EVENT_TYPE_SIGNAL:
-            interp->sleeping = 0;
-            /* generate exception */
-            event_to_exception(interp, event);
-            /* not reached - will longjmp */
-            break;
-        case EVENT_TYPE_TIMER:
-            /* run ops, save registers */
-            Parrot_runops_fromc_args_event(interp,
-                    event->u.timer_event.sub, "v");
-            break;
-        case EVENT_TYPE_CALL_BACK:
-            edebug((stderr, "starting user cb\n"));
-            Parrot_run_callback(interp, event->u.call_back.cbi,
+      case EVENT_TYPE_TERMINATE:
+        next = NULL;        /* this will terminate the run loop */
+        break;
+      case EVENT_TYPE_SIGNAL:
+        interp->sleeping = 0;
+        /* generate exception */
+        event_to_exception(interp, event);
+        /* not reached - will longjmp */
+        break;
+      case EVENT_TYPE_TIMER:
+        /* run ops, save registers */
+        Parrot_pcc_invoke_sub_from_c_args(interp,
+                    event->u.timer_event.sub, "->");
+        break;
+      case EVENT_TYPE_CALL_BACK:
+        edebug((stderr, "starting user cb\n"));
+        Parrot_run_callback(interp, event->u.call_back.cbi,
                     event->u.call_back.external_data);
-            break;
-        case EVENT_TYPE_IO:
-            edebug((stderr, "starting io handler\n"));
-            Parrot_runops_fromc_args_event(interp,
+        break;
+      case EVENT_TYPE_IO:
+        edebug((stderr, "starting io handler\n"));
+        Parrot_pcc_invoke_sub_from_c_args(interp,
                     event->u.io_event.handler,
-                    "vPP",
+                    "PP->",
                     event->u.io_event.pio,
                     event->u.io_event.user_data);
-            break;
-        case EVENT_TYPE_SLEEP:
-            interp->sleeping = 0;
-            break;
-        case EVENT_TYPE_SUSPEND_FOR_GC:
-            edebug((stderr, "suspend for gc\n"));
-            pt_suspend_self_for_gc(interp);
-            break;
-        default:
-            fprintf(stderr, "Unhandled event type %d\n", (int)event->type);
-            break;
+        break;
+      case EVENT_TYPE_SLEEP:
+        interp->sleeping = 0;
+        break;
+      case EVENT_TYPE_SUSPEND_FOR_GC:
+        edebug((stderr, "suspend for gc\n"));
+        pt_suspend_self_for_gc(interp);
+        break;
+      default:
+        fprintf(stderr, "Unhandled event type %d\n", (int)event->type);
+        break;
     }
     mem_sys_free(event);
     return next;

Modified: branches/orderedhash_revamp/src/exceptions.c
==============================================================================
--- branches/orderedhash_revamp/src/exceptions.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/exceptions.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -19,8 +19,6 @@
 */
 
 #include "parrot/parrot.h"
-#include "parrot/call.h"
-#include "parrot/exceptions.h"
 #include "exceptions.str"
 #include "pmc/pmc_continuation.h"
 
@@ -38,24 +36,16 @@
         __attribute__nonnull__(3);
 
 PARROT_CAN_RETURN_NULL
-static opcode_t * pass_exception_args(PARROT_INTERP,
-    ARGIN(const char *sig),
-    ARGIN(opcode_t *dest),
-    ARGIN(Parrot_Context * old_ctx),
-    ...)
+static void setup_exception_args(PARROT_INTERP, ARGIN(const char *sig), ...)
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4);
+        __attribute__nonnull__(2);
 
-#define ASSERT_ARGS_build_exception_from_args __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_build_exception_from_args __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(format)
-#define ASSERT_ARGS_pass_exception_args __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(format))
+#define ASSERT_ARGS_setup_exception_args __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sig) \
-    || PARROT_ASSERT_ARG(dest) \
-    || PARROT_ASSERT_ARG(old_ctx)
+    , PARROT_ASSERT_ARG(sig))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -107,9 +97,16 @@
     INTVAL         exit_status = 1;
     const INTVAL   severity    = VTABLE_get_integer_keyed_str(interp, exception, CONST_STRING(interp, "severity"));
 
+    /* In some cases we have a fatal exception before the IO system
+     * is completely initialized. Do some attempt to output the
+     * message to stderr, to help diagnosing. */
+    int use_perr = !PMC_IS_NULL(Parrot_io_STDERR(interp));
+
     /* flush interpreter output to get things printed in order */
-    Parrot_io_flush(interp, Parrot_io_STDOUT(interp));
-    Parrot_io_flush(interp, Parrot_io_STDERR(interp));
+    if (!PMC_IS_NULL(Parrot_io_STDOUT(interp)))
+        Parrot_io_flush(interp, Parrot_io_STDOUT(interp));
+    if (use_perr)
+        Parrot_io_flush(interp, Parrot_io_STDERR(interp));
 
     if (interp->pdb) {
         Interp * interpdeb = interp->pdb->debugger;
@@ -120,7 +117,14 @@
     }
 
     if (Parrot_str_not_equal(interp, message, CONST_STRING(interp, ""))) {
-        Parrot_io_eprintf(interp, "%S\n", message);
+        if (use_perr)
+            Parrot_io_eprintf(interp, "%S\n", message);
+        else {
+            char * const msg = Parrot_str_to_cstring(interp, message);
+            fflush(stderr);
+            fprintf(stderr, "\n%s\n", msg);
+            Parrot_str_free_cstring(msg);
+        }
 
         /* caution against output swap (with PDB_backtrace) */
         fflush(stderr);
@@ -141,7 +145,7 @@
      * returning NULL from here returns resume address NULL to the
      * runloop, which will terminate the thread function finally
      *
-     * RT #45917 this check should better be in Parrot_exit
+     * TT #1287 this check should better be in Parrot_exit
      */
 
     /* no exception handler, but this is not the main thread */
@@ -226,20 +230,7 @@
     }
 
     address    = VTABLE_invoke(interp, handler, dest);
-
-    /* XXX This is an obvious hack. We need to identify here whether this is
-       an ExceptionHandler proper or a PIR-defined subclass. This conditional
-       monstrosity attempts to check whether this is an object of a PIR-defined
-       subclass. When we have garbage-collectable PMCs, we shouldn't need to do
-       this nonsense. See TT#154 for details */
-    if (handler->vtable->base_type == enum_class_Object) {
-        /* Don't know what to do here to make sure the exception parameter gets
-           passed properly. */
-    }
-    /* Set up the continuation context of the handler in the interpreter. */
-    else if (PMC_cont(handler)->current_results)
-        address = pass_exception_args(interp, "P", address,
-                CONTEXT(interp), exception);
+    setup_exception_args(interp, "P", exception);
 
     if (PObj_get_FLAGS(handler) & SUB_FLAG_C_HANDLER) {
         /* it's a C exception handler */
@@ -253,30 +244,29 @@
 
 /*
 
-=item C<static opcode_t * pass_exception_args(PARROT_INTERP, const char *sig,
-opcode_t *dest, Parrot_Context * old_ctx, ...)>
+=item C<static void setup_exception_args(PARROT_INTERP, const char *sig, ...)>
 
-Passes arguments to the exception handler routine. These are retrieved with
-the .get_results() directive in PIR code.
+Sets up arguments to the exception handler invocation.
 
 =cut
 
 */
 
 PARROT_CAN_RETURN_NULL
-static opcode_t *
-pass_exception_args(PARROT_INTERP, ARGIN(const char *sig),
-        ARGIN(opcode_t *dest), ARGIN(Parrot_Context * old_ctx), ...)
-{
-    ASSERT_ARGS(pass_exception_args)
-    va_list   ap;
-    opcode_t *next;
-
-    va_start(ap, old_ctx);
-    next = parrot_pass_args_fromc(interp, sig, dest, old_ctx, ap);
-    va_end(ap);
+static void
+setup_exception_args(PARROT_INTERP, ARGIN(const char *sig), ...)
+{
+    ASSERT_ARGS(setup_exception_args)
+    va_list  args;
+    PMC     *sig_obj;
+
+    va_start(args, sig);
+    sig_obj = Parrot_pcc_build_sig_object_from_varargs(interp, PMCNULL, sig, args);
+    va_end(args);
+
+    CALLSIGNATURE_is_exception_SET(sig_obj);
 
-    return next;
+    Parrot_pcc_set_signature(interp, CURRENT_CONTEXT(interp), sig_obj);
 }
 
 /*
@@ -342,7 +332,6 @@
     ASSERT_ARGS(Parrot_ex_throw_from_c)
 
     Parrot_runloop    *return_point = interp->current_runloop;
-    RunProfile * const profile      = interp->profile;
     opcode_t *address;
     PMC        * const handler      =
                              Parrot_cx_find_handler_local(interp, exception);
@@ -350,17 +339,6 @@
     if (PMC_IS_NULL(handler))
         die_from_exception(interp, exception);
 
-    /* If profiling, remember end time of lastop and generate entry for
-     * exception. */
-    if (profile && Interp_flags_TEST(interp, PARROT_PROFILE_FLAG)) {
-        const FLOATVAL now = Parrot_floatval_time();
-
-        profile->data[profile->cur_op].time += now - profile->starttime;
-        profile->cur_op                      = PARROT_PROF_EXCEPTION;
-        profile->starttime                   = now;
-        profile->data[PARROT_PROF_EXCEPTION].numcalls++;
-    }
-
     if (Interp_debug_TEST(interp, PARROT_BACKTRACE_DEBUG_FLAG)) {
         STRING * const exit_code = CONST_STRING(interp, "exit_code");
         STRING * const msg       = VTABLE_get_string(interp, exception);
@@ -374,8 +352,10 @@
     }
 
     /* Note the thrower.
-     * XXX TT#596 - pass in current context instead when we have context PMCs. */
-    VTABLE_set_attr_str(interp, exception, CONST_STRING(interp, "thrower"), CONTEXT(interp)->current_cont);
+     * XXX TT #596 - pass in current context instead when we have context PMCs. */
+    /* Don't split line. It will break CONST_STRING handling */
+    VTABLE_set_attr_str(interp, exception, CONST_STRING(interp, "thrower"), Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp)));
+
 
     /* it's a C exception handler */
     if (PObj_get_FLAGS(handler) & SUB_FLAG_C_HANDLER) {
@@ -386,9 +366,7 @@
 
     /* Run the handler. */
     address = VTABLE_invoke(interp, handler, NULL);
-    if (PMC_cont(handler)->current_results)
-        address = pass_exception_args(interp, "P", address,
-                CONTEXT(interp), exception);
+    setup_exception_args(interp, "P", exception);
     PARROT_ASSERT(return_point->handler_start == NULL);
     return_point->handler_start = address;
     longjmp(return_point->resume, 2);
@@ -513,6 +491,8 @@
 
 Mark an exception as unhandled, as part of rethrowing it.
 
+=back
+
 =cut
 
 */
@@ -527,40 +507,6 @@
 
 /*
 
-=item C<size_t Parrot_ex_calc_handler_offset(PARROT_INTERP)>
-
-Retrieve an exception from the concurrency scheduler, prepare a call to the
-handler, and return the offset to the handler so it can become the next op in
-the runloop.
-
-TT #546: This function appears to be unused.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-size_t
-Parrot_ex_calc_handler_offset(PARROT_INTERP)
-{
-    ASSERT_ARGS(Parrot_ex_calc_handler_offset)
-    PMC * const exception = VTABLE_pop_pmc(interp, interp->scheduler);
-
-    /* now fill rest of exception, locate handler and get
-     * destination of handler */
-    opcode_t * const handler_address = Parrot_ex_throw_from_op(interp, exception, NULL);
-
-    if (handler_address == NULL)
-        PANIC(interp, "Unable to calculate opcode address for exception handler");
-
-    /* return the *offset* of the handler */
-    return handler_address - interp->code->base.data;
-}
-
-/*
-
-=back
-
 =head2 Error Functions
 
 =over 4

Deleted: branches/orderedhash_revamp/src/exec.c
==============================================================================
--- branches/orderedhash_revamp/src/exec.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,417 +0,0 @@
-/*
-Copyright (C) 2001-2009, Parrot Foundation.
-$Id$
-
-=head1 NAME
-
-src/exec.c - Generate an object file
-
-=head1 DESCRIPTION
-
-=head2 Functions
-
-=over 4
-
-=cut
-
-*/
-
-#include <parrot/parrot.h>
-#ifdef HAVE_COMPUTED_GOTO
-#  include <parrot/oplib/core_ops_cgp.h>
-#endif /* HAVE_COMPUTED_GOTO */
-#include "parrot/exec.h"
-#include "jit.h"
-#define JIT_EMIT 1
-#include "jit_emit.h"
-#include "exec_dep.h"
-#include "exec_save.h"
-#include "parrot/compiler.h"
-
-/* HEADERIZER HFILE: include/parrot/exec.h */
-
-/* HEADERIZER BEGIN: static */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-
-static void add_data_member(
-    ARGMOD(Parrot_exec_objfile_t *obj),
-    ARGIN_NULLOK(const void *src),
-    size_t len)
-        __attribute__nonnull__(1)
-        FUNC_MODIFIES(*obj);
-
-static void exec_init(ARGIN(Parrot_exec_objfile_t *obj))
-        __attribute__nonnull__(1);
-
-static int symbol_list_find(
-    ARGIN(const Parrot_exec_objfile_t *obj),
-    ARGIN(const char *symbol))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-#define ASSERT_ARGS_add_data_member __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(obj)
-#define ASSERT_ARGS_exec_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(obj)
-#define ASSERT_ARGS_symbol_list_find __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(obj) \
-    || PARROT_ASSERT_ARG(symbol)
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: static */
-
-/*
- * Parrot_exec_run must be 0 while the program runs.
- * It will be set to 2 inside eval (s. eval.pmc)
- * to switch to runops_jit (s. interpreter.c:runops_exec()).
- * Must be 1 while starting the compiled code to have Parrot_new()
- * return the address of the global interpreter (s. interpreter.c)
- * and PackFile_ConstTable_unpack use the global const_table (s. packfile.c).
- * Must also be 1 while generating the executable.
- */
-
-int Parrot_exec_run = 0;
-
-/*
-
-=item C<void Parrot_exec(PARROT_INTERP, opcode_t *pc, opcode_t *code_start,
-opcode_t *code_end)>
-
-Call the jit to get the program code. Adds the members of the data
-section. And emits the executable.
-
-=cut
-
-*/
-
-void
-Parrot_exec(PARROT_INTERP, ARGIN(opcode_t *pc),
-        ARGIN(opcode_t *code_start), ARGIN(opcode_t *code_end))
-{
-    ASSERT_ARGS(Parrot_exec)
-#ifdef JIT_CGP
-    int i, j *k;
-#endif
-    const char *output;
-    long bhs;
-    Parrot_jit_info_t *jit_info;
-
-    Parrot_exec_objfile_t * const obj =
-        mem_allocate_zeroed_typed(Parrot_exec_objfile_t);
-    exec_init(obj);
-    obj->bytecode_header_size =
-        (interp->code->base.file_offset + 4) * sizeof (opcode_t);
-    jit_info = parrot_build_asm(interp, code_start, code_end,
-            obj, JIT_CODE_FILE);
-
-    /* TODO Go zero the calls to jited opcodes. */
-    /* Place the program code in the data section. */
-    /* program_code */
-    add_data_member(obj, interp->code->base.pf->src,
-            interp->code->base.pf->size);
-    /* opcode_map */
-    add_data_member(obj, jit_info->arena.op_map, (jit_info->arena.map_size+1) *
-        sizeof (opcode_t *));
-    /* const_table */
-    add_data_member(obj, NULL, interp->code->const_table->const_count *
-        sizeof (PackFile_Constant));
-#ifdef JIT_CGP
-    /* prederef_code */
-    j = (int)cgp_core;
-    j = (int)((op_func_t*)interp->op_lib->op_func_table)[2] - j;
-    k = (int *)interp->code->prederef.code;
-    for (i = 0; i < (int)interp->code->base.size; i++) {
-        if (k[i] != j)
-            k[i] = 0;
-    }
-    add_data_member(obj, interp->code->prederef.code,
-        interp->code->base.size * sizeof (void *));
-#endif /* JIT_CGP */
-    /* bytecode_offset */
-    bhs = obj->bytecode_header_size / sizeof (opcode_t);
-    add_data_member(obj, &bhs, 4);
-
-    obj->text.code = jit_info->arena.start;
-    obj->text.size = jit_info->arena.size;
-
-    /* PAD */
-    obj->text.size += (4 - obj->text.size % 4);
-    obj->data.size += (4 - obj->data.size % 4);
-    offset_fixup(obj);
-    output = interp->output_file ?
-        interp->output_file : "exec_output.o";
-    Parrot_exec_save(interp, obj, output);
-}
-
-/*
-
-=item C<static void add_data_member(Parrot_exec_objfile_t *obj, const void *src,
-size_t len)>
-
-Adds a member to the data section, storing the size of it at
-C<< obj->data_size[N] >>.
-
-=cut
-
-*/
-
-static void
-add_data_member(ARGMOD(Parrot_exec_objfile_t *obj),
-        ARGIN_NULLOK(const void *src), size_t len)
-{
-    ASSERT_ARGS(add_data_member)
-    char *cp;
-
-    if (obj->data.size == 0) {
-        obj->data.code = (char *)mem_sys_allocate(len);
-        obj->data_size = (int *)mem_sys_allocate(sizeof (int));
-    }
-    else {
-        int *nds;
-        obj->data.code = (char *)mem_sys_realloc(obj->data.code,
-                                                 obj->data.size + len);
-        nds = (int *)mem_sys_realloc(obj->data_size, (obj->data_count + 2) *
-            sizeof (int));
-        obj->data_size = nds;
-    }
-
-    cp = obj->data.code + obj->data.size;
-    if (src)
-        memcpy(cp, src, len);
-    else
-        memset(cp, 0, len);
-    obj->data_size[obj->data_count++] = len;
-    obj->data.size += len;
-}
-
-/*
-
-=item C<static void exec_init(Parrot_exec_objfile_t *obj)>
-
-Initialize the obj structure.
-
-=cut
-
-*/
-
-static void
-exec_init(ARGIN(Parrot_exec_objfile_t *obj))
-{
-    ASSERT_ARGS(exec_init)
-    obj->text_rellocation_table = (Parrot_exec_rellocation_t *)
-        mem_sys_allocate_zeroed(sizeof (Parrot_exec_rellocation_t));
-    obj->data_rellocation_table = (Parrot_exec_rellocation_t *)
-        mem_sys_allocate_zeroed(sizeof (Parrot_exec_rellocation_t));
-    obj->symbol_table = (Parrot_exec_symbol_t *)
-        mem_sys_allocate_zeroed(sizeof (Parrot_exec_symbol_t));
-    /* size of table */
-#ifdef PARROT_I386
-    obj->symbol_list_size = 4;
-#else
-    obj->symbol_list_size = 0;
-#endif
-#ifdef EXEC_ELF
-    obj->symbol_list_size = 0;
-#endif
-    Parrot_exec_add_symbol(obj, "program_code", STYPE_GDATA);
-    Parrot_exec_add_symbol(obj, "opcode_map", STYPE_GDATA);
-    Parrot_exec_add_symbol(obj, "const_table", STYPE_GDATA);
-#ifdef JIT_CGP
-    Parrot_exec_add_symbol(obj, "exec_prederef_code", STYPE_GDATA);
-#endif /* JIT_CGP */
-    Parrot_exec_add_symbol(obj, "bytecode_offset", STYPE_GDATA);
-    Parrot_exec_add_symbol(obj, "run_compiled", STYPE_FUNC);
-}
-
-/*
-
-=item C<int Parrot_exec_add_symbol(Parrot_exec_objfile_t *obj, const char
-*symbol, int stype)>
-
-Adds a symbol to the object file.
-
-=cut
-
-*/
-
-int
-Parrot_exec_add_symbol(ARGMOD(Parrot_exec_objfile_t *obj),
-        ARGIN(const char *symbol), int stype)
-{
-    ASSERT_ARGS(Parrot_exec_add_symbol)
-
-    int symbol_number = symbol_list_find(obj, symbol);
-    if (symbol_number == -1) {
-        Parrot_exec_symbol_t *new_symbol;
-
-        symbol_number = obj->symbol_count;
-        new_symbol = (Parrot_exec_symbol_t *)mem_sys_realloc(obj->symbol_table,
-            (size_t)(obj->symbol_count + 1) * sizeof (Parrot_exec_symbol_t));
-        obj->symbol_table = new_symbol;
-
-        new_symbol              = &obj->symbol_table[obj->symbol_count++];
-        new_symbol->offset_list = obj->symbol_list_size;
-        new_symbol->symbol      = symbol;
-        obj->symbol_list_size  += strlen(symbol);
-#if defined(EXEC_A_OUT) || defined(EXEC_COFF)
-        /* for the trailing "_" */
-        obj->symbol_list_size++;
-#endif
-        if (stype != STYPE_GCC)
-            obj->symbol_list_size++;
-        if (stype == STYPE_COM) {
-            new_symbol->type = STYPE_COM;
-            new_symbol->value = sizeof (Interp);
-        }
-        else {
-            new_symbol->type = stype;
-            new_symbol->value = 0;
-        }
-    }
-    return symbol_number;
-}
-
-/*
-
-=item C<int * Parrot_exec_add_text_rellocation_reg(Parrot_exec_objfile_t *obj,
-char *nptr, const char *var, int offset, int disp)>
-
-Adds a register's text rellocation to the object file.  Wrapper
-around C<Parrot_exec_add_text_rellocation>.
-
-Returns pointer to offset.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_CAN_RETURN_NULL
-int *
-Parrot_exec_add_text_rellocation_reg(ARGIN(Parrot_exec_objfile_t *obj),
-        ARGIN(char *nptr), ARGIN(const char *var), int offset, int disp)
-{
-    ASSERT_ARGS(Parrot_exec_add_text_rellocation_reg)
-    Parrot_exec_add_text_rellocation(obj, nptr, RTYPE_COM, var, disp);
-    return (int *)offset;
-}
-
-/*
-
-=item C<void Parrot_exec_add_text_rellocation_func(Parrot_exec_objfile_t *obj,
-char *nptr, const char *func_name)>
-
-Adds a function's text rellocation to the object file.  Wrapper
-around C<Parrot_exec_add_text_rellocation>.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-Parrot_exec_add_text_rellocation_func(ARGIN(Parrot_exec_objfile_t *obj),
-        ARGIN(char *nptr), ARGIN(const char *func_name))
-{
-    ASSERT_ARGS(Parrot_exec_add_text_rellocation_func)
-    Parrot_exec_add_text_rellocation(obj, nptr, RTYPE_FUNC, func_name, 1);
-}
-
-/*
-
-=item C<void Parrot_exec_add_text_rellocation(Parrot_exec_objfile_t *obj, char
-*nptr, int type, const char *symbol, int disp)>
-
-Adds a text rellocation to the object file.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-Parrot_exec_add_text_rellocation(ARGIN(Parrot_exec_objfile_t *obj), ARGIN(char *nptr),
-    int type, ARGIN(const char *symbol), int disp)
-{
-    ASSERT_ARGS(Parrot_exec_add_text_rellocation)
-    int symbol_number;
-    char *addr;
-    Parrot_exec_rellocation_t * new_relloc = (Parrot_exec_rellocation_t *)
-        mem_sys_realloc(obj->text_rellocation_table,
-            (size_t)(obj->text_rellocation_count + 1) *
-            sizeof (Parrot_exec_rellocation_t));
-
-    obj->text_rellocation_table = new_relloc;
-    new_relloc = &obj->text_rellocation_table[obj->text_rellocation_count++];
-
-    switch (type) {
-        case RTYPE_FUNC:
-            symbol_number = Parrot_exec_add_symbol(obj, symbol, STYPE_UND);
-            break;
-        case RTYPE_COM:
-            symbol_number = Parrot_exec_add_symbol(obj, symbol, STYPE_COM);
-            break;
-        case RTYPE_DATA:
-        case RTYPE_DATA1:
-            symbol_number = Parrot_exec_add_symbol(obj, symbol, STYPE_GDATA);
-            break;
-        default:
-            symbol_number = 0;
-            break;
-    }
-
-    addr = nptr + disp;
-    new_relloc->offset        = (int)(addr - obj->text.code);
-    new_relloc->symbol_number = symbol_number;
-    new_relloc->type          = type;
-}
-
-/*
-
-=item C<static int symbol_list_find(const Parrot_exec_objfile_t *obj, const char
-*symbol)>
-
-Returns the index of C<symbol> in the symbol list. Returns -1 if it is
-not in the list.
-
-Used by C<Parrot_exec_add_symbol()>.
-
-=cut
-
-*/
-
-static int
-symbol_list_find(ARGIN(const Parrot_exec_objfile_t *obj), ARGIN(const char *symbol))
-{
-    ASSERT_ARGS(symbol_list_find)
-    int i;
-
-    for (i = 0; i < obj->symbol_count; i++)
-        if (STREQ(symbol, obj->symbol_table[i].symbol))
-            return i;
-    return -1;
-}
-
-/*
-
-=back
-
-=head1 SEE ALSO
-
-F<include/parrot/exec.h>, F<src/exec_cpu.c>, F<src/exec_save.h>
-and F<src/exec_start.c>.
-
-=head1 HISTORY
-
-Initial version by Daniel Grunblatt on 2003.6.9.
-
-=cut
-
-*/
-
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/exec_save.c
==============================================================================
--- branches/orderedhash_revamp/src/exec_save.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,844 +0,0 @@
-/*
-Copyright (C) 2001-2008, Parrot Foundation.
-$Id$
-
-=head1 NAME
-
-src/exec_save.c - Save object file in native format
-
-=head1 DESCRIPTION
-
-Save the C<Parrot_exec_objfile_t> to the native format.
-
-=head2 Functions
-
-=over 4
-
-=cut
-
-*/
-
-/* HEADERIZER HFILE: none */
-/* HEADERIZER STOP */
-
-#include <parrot/parrot.h>
-#include "parrot/exec.h"
-#include "exec_save.h"
-
-static void save_zero(FILE *fp);
-static void save_int(FILE *fp, int i);
-static void save_short(FILE *fp, short s);
-static void save_struct(FILE *fp, void *sp, size_t size);
-
-#ifdef EXEC_A_OUT
-
-#  include <a.out.h>
-#  include <link.h>
-
-/*
-
-=item C<void
-Parrot_exec_save(PARROT_INTERP, Parrot_exec_objfile_t *obj, const char *file)>
-
-Save the C<Parrot_exec_objfile_t> to C<file>.
-
-=cut
-
-*/
-
-void
-Parrot_exec_save(PARROT_INTERP, Parrot_exec_objfile_t *obj, const char *file)
-{
-    FILE * const fp = fopen(file, "w");
-    int    i;
-    struct exec header;
-    struct relocation_info rellocation;
-    struct nlist symlst;
-
-
-    header.a_midmag = 0x07018600;
-    header.a_text = obj->text.size;
-    header.a_data = obj->data.size;
-    header.a_bss = obj->bss.size;
-    header.a_syms = obj->symbol_count * sizeof (struct nlist);
-    header.a_entry = 0;
-    header.a_trsize = obj->text_rellocation_count
-        * sizeof (struct relocation_info);
-    header.a_drsize = obj->data_rellocation_count
-        * sizeof (struct relocation_info);
-    save_struct(fp, &header, sizeof (struct exec));
-    /* Text */
-    for (i = 0; i < obj->text.size; i++)
-        fprintf(fp, "%c", obj->text.code[i]);
-    /* Data */
-    for (i = 0; i < obj->data.size; i++)
-        fprintf(fp, "%c", obj->data.code[i]);
-    /* Text rellocations */
-    for (i = obj->text_rellocation_count - 1; i >= 0; i--) {
-        memset(&rellocation, 0, sizeof (struct relocation_info));
-        rellocation.r_address   = obj->text_rellocation_table[i].offset;
-        rellocation.r_symbolnum = obj->text_rellocation_table[i].symbol_number;
-        switch (obj->text_rellocation_table[i].type) {
-            case RTYPE_FUNC:
-                rellocation.r_pcrel = 1;
-                rellocation.r_length = 2;
-                rellocation.r_extern = 1;
-                break;
-            case RTYPE_COM:
-            case RTYPE_DATA:
-                rellocation.r_length = 2;
-                rellocation.r_extern = 1;
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXEC_ERROR,
-                    "Unknown text rellocation type: %d\n",
-                    obj->text_rellocation_table[i].type);
-                break;
-        }
-        save_struct(fp, &rellocation, sizeof (struct relocation_info));
-    }
-    /* Symbol table */
-    for (i = 0; i < obj->symbol_count; i++) {
-        memset(&symlst, 0, sizeof (struct nlist));
-        symlst.n_un.n_strx = obj->symbol_table[i].offset_list;
-        switch (obj->symbol_table[i].type) {
-            case STYPE_FUNC:
-                symlst.n_type = N_EXT | N_TEXT;
-                symlst.n_other = AUX_FUNC;
-                break;
-            case STYPE_GDATA:
-                symlst.n_type = N_EXT | N_DATA;
-                symlst.n_other = AUX_OBJECT;
-                symlst.n_value = obj->symbol_table[i].value;
-                break;
-            case STYPE_COM:
-                symlst.n_type = N_EXT;
-                symlst.n_value = obj->symbol_table[i].value;
-                break;
-            case STYPE_UND:
-                symlst.n_type = N_EXT;
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXEC_ERROR,
-                    "Unknown symbol type: %d\n", obj->symbol_table[i].type);
-                break;
-        }
-        save_struct(fp, &symlst, sizeof (struct nlist));
-    }
-    /* String table size */
-    save_int(fp, obj->symbol_list_size);
-    /* String table */
-    for (i = 0; i < obj->symbol_count; i++) {
-        if (obj->symbol_table[i].type != STYPE_GCC)
-            fprintf(fp, "_%s", obj->symbol_table[i].symbol);
-        else
-            fprintf(fp, "%s", obj->symbol_table[i].symbol);
-        save_zero(fp);
-    }
-    fclose(fp);
-}
-
-#endif /* EXEC_A_OUT */
-
-#ifdef EXEC_ELF
-
-#  ifdef PARROT_EXEC_OS_OPENBSD
-#    define R_386_32 1
-#    define R_386_PC32 2
-#    include <elf_abi.h>
-#  else
-#    include <elf.h>
-#  endif
-
-#  if defined(PARROT_PPC)
-#    if !defined(R_PPC_ADDR16_HI) && !defined(R_PPC_ADDR16_LO) && \
-         defined(R_PPC_16_HI) && defined(R_PPC_16_LO)
-#      define	R_PPC_ADDR16_HI	R_PPC_16_HI
-#      define	R_PPC_ADDR16_LO	R_PPC_16_LO
-#    endif
-     /*
-      * NetBSD/powerpc 3.x and OpenBSD/powerpc doesn't define these constants,
-      * but instead has them as enums, so add some workarounds for those.
-      */
-#    if !defined(R_PPC_ADDR16_HI) && !defined(R_PPC_ADDR16_LO) && \
-         (defined(__NetBSD__) || defined(__OpenBSD__))
-#      define	R_PPC_ADDR16_HI RELOC_16_HI
-#      define	R_PPC_ADDR16_LO RELOC_16_LO
-#    endif
-#    if !defined(R_PPC_REL24) && (defined(__NetBSD__) || defined(__OpenBSD__))
-#      define	R_PPC_REL24	RELOC_REL24
-#    endif
-#  endif /* PARROT_PPC */
-
-/* Add a section to the file
- *
- * n = Name
- * t = Type
- * f = Flags
- * s = Size
- * l = Link
- * i = Info
- * a = Align
- * e = Entry size
- */
-#  define sh_add(n, t, f, s, l, i, a, e) { \
-    memset(&sechdr, 0, sizeof (Elf32_Shdr)); \
-    sechdr.sh_name = shste - shst; \
-    shste += sprintf(shste, "%s", (n)); \
-    shste++; \
-    sechdr.sh_type      = (t); \
-    sechdr.sh_flags     = (f); \
-    sechdr.sh_addr      = 0; \
-    sechdr.sh_offset    = current_offset; \
-    sechdr.sh_size      = (s); \
-    sechdr.sh_link      = (l); \
-    sechdr.sh_info      = (i); \
-    sechdr.sh_addralign = (a); \
-    sechdr.sh_entsize   = (e); \
-    save_struct(fp, &sechdr, sizeof (Elf32_Shdr)); \
-    current_offset += (s); \
-    if ((s) % 4) \
-      current_offset += (4 - (s) % 4); \
-   }
-
-/* Sizeof the section header string table */
-#  define SHSTRTABSIZE  0x48
-/* Previously defined symbols (zero, text, data, bss) */
-#  define PDFS          4
-/* Number of sections */
-#  define NSECTIONS     8
-
-void
-Parrot_exec_save(PARROT_INTERP, Parrot_exec_objfile_t *obj, const char *file)
-{
-    FILE      *fp = fopen(file, "w");
-    char      *shste;
-    char       shst[SHSTRTABSIZE];
-
-    Elf32_Ehdr header;
-    Elf32_Shdr sechdr;
-    Elf32_Rel  rellocation;
-    Elf32_Rela rel_addend;
-    Elf32_Sym  symlst;
-    Elf32_Off  current_offset;
-    int        i;
-
-    memset(&header, 0, sizeof (Elf32_Ehdr));
-    header.e_ident[0]  = ELFMAG0;
-    header.e_ident[1]  = ELFMAG1;
-    header.e_ident[2]  = ELFMAG2;
-    header.e_ident[3]  = ELFMAG3;
-    header.e_ident[4]  = ELFCLASS32;
-#  if PARROT_BIGENDIAN
-    header.e_ident[5]  = ELFDATA2MSB;
-#  else /* PARROT_BIGENDIAN */
-    header.e_ident[5]  = ELFDATA2LSB;
-#  endif /* PARROT_BIGENDIAN */
-    header.e_ident[6]  = EV_CURRENT;
-#  ifdef PARROT_EXEC_OS_FREEBSD
-    header.e_ident[7]  = ELFOSABI_FREEBSD;
-#  endif
-#  ifdef PARROT_EXEC_OS_NETBSD
-    header.e_ident[7]  = ELFOSABI_NETBSD;
-#  endif
-#  if defined(PARROT_EXEC_OS_LINUX) && defined(ELFOSABI_LINUX) && \
-     !defined(PARROT_PPC) && !defined(PARROT_ARM)
-    header.e_ident[7]  = ELFOSABI_LINUX;
-#  endif
-
-    header.e_type      = ET_REL;
-#  ifdef PARROT_I386
-    header.e_machine   = EM_386;
-#  endif
-#  ifdef PARROT_PPC
-    header.e_machine   = EM_PPC;
-#  endif
-#  ifdef PARROT_ARM
-    header.e_ident[7]  = ELFOSABI_ARM;
-    header.e_machine   = EM_ARM;
-#  endif
-    header.e_version   = EV_CURRENT;
-    header.e_entry     = 0;
-    header.e_phoff     = 0;
-    header.e_shoff     = sizeof (Elf32_Ehdr);
-    header.e_flags     = 0;
-    header.e_ehsize    = sizeof (Elf32_Ehdr);
-    header.e_phentsize = 0;
-    header.e_phnum     = 0;
-    header.e_shentsize = sizeof (Elf32_Shdr);
-    header.e_shnum     = NSECTIONS;
-    header.e_shstrndx  = 1;
-
-    save_struct(fp, &header, sizeof (Elf32_Ehdr));
-
-    current_offset = sizeof (Elf32_Ehdr) + NSECTIONS * sizeof (Elf32_Shdr);
-
-    /* Sections */
-    memset(&shst, 0, SHSTRTABSIZE);
-    shste = shst + 1;
-
-    /* NULL */
-    memset(&sechdr, 0, sizeof (Elf32_Shdr));
-    save_struct(fp, &sechdr, sizeof (Elf32_Shdr));
-
-    /* Section Header String Table */
-    sh_add(".shstrtab", SHT_STRTAB, 0, SHSTRTABSIZE, 0, 0, 1, 0);
-
-    /* Text */
-    sh_add(".text", SHT_PROGBITS, SHF_ALLOC | SHF_EXECINSTR, obj->text.size,
-        0, 0, 4, 0);
-
-    /* Data */
-    sh_add(".data", SHT_PROGBITS, SHF_WRITE | SHF_ALLOC, obj->data.size,
-        0, 0, 4, 0);
-
-    /* Bss */
-    sh_add(".bss", SHT_NOBITS, SHF_WRITE | SHF_ALLOC, obj->bss.size,
-        0, 0, 4, 0);
-    /*
-     * Text rellocation records.
-     * Link must be the symtab section header index.
-     * Info is the text section header index.
-     */
-#  if defined(PARROT_I386) || defined(PARROT_ARM)
-    sh_add(".rel.text", SHT_REL, 0, obj->text_rellocation_count *
-        sizeof (Elf32_Rel), 6, 2, 4, sizeof (Elf32_Rel));
-#  endif
-    /*
-     * PPC requires rellocation structures with addends.
-     */
-#  ifdef PARROT_PPC
-    sh_add(".rela.text", SHT_RELA, 0, obj->text_rellocation_count *
-        sizeof (Elf32_Rela), 6, 2, 4, sizeof (Elf32_Rela));
-#  endif
-    /*
-     * Symbol table.
-     * Link is the strtab section header index.
-     * Info is the index of the first symbol in the symbol table.
-     */
-    sh_add(".symtab", SHT_SYMTAB, 0, (obj->symbol_count + PDFS) *
-        sizeof (Elf32_Sym), 7, PDFS - 1, 4, sizeof (Elf32_Sym));
-    /* String Table */
-    obj->symbol_list_size += 1; /* Trailing \0 */
-    sh_add(".strtab", SHT_STRTAB, 0, obj->symbol_list_size, 0, 0, 1, 0);
-
-    /* Section header string table */
-    save_struct(fp, &shst, SHSTRTABSIZE);
-    save_struct(fp, obj->text.code, obj->text.size); /* Text */
-    save_struct(fp, obj->data.code, obj->data.size); /* Data */
-    /* Text rellocations */
-    for (i = 0; i < obj->text_rellocation_count; i++) {
-#  ifdef PARROT_I386
-        memset(&rellocation, 0, sizeof (Elf32_Rel));
-
-        rellocation.r_offset = obj->text_rellocation_table[i].offset;
-        switch (obj->text_rellocation_table[i].type) {
-            case RTYPE_FUNC:
-                rellocation.r_info =
-                    ELF32_R_INFO(
-                        obj->text_rellocation_table[i].symbol_number + PDFS,
-                            R_386_PC32);
-                break;
-            case RTYPE_DATA:
-            case RTYPE_COM:
-                rellocation.r_info =
-                    ELF32_R_INFO(
-                        obj->text_rellocation_table[i].symbol_number + PDFS,
-                            R_386_32);
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXEC_ERROR,
-                    "Unknown text rellocation type: %d\n",
-                    obj->text_rellocation_table[i].type);
-                break;
-        }
-        save_struct(fp, &rellocation, sizeof (Elf32_Rel));
-#  endif
-#  ifdef PARROT_PPC
-        memset(&rel_addend, 0, sizeof (Elf32_Rela));
-        rel_addend.r_offset = obj->text_rellocation_table[i].offset;
-        switch (obj->text_rellocation_table[i].type) {
-            case RTYPE_FUNC:
-                rel_addend.r_info =
-                    ELF32_R_INFO(
-                        obj->text_rellocation_table[i].symbol_number + PDFS,
-                            R_PPC_REL24);
-                break;
-            case RTYPE_DATA:
-            case RTYPE_COM:
-                rel_addend.r_info =
-                    ELF32_R_INFO(
-                        obj->text_rellocation_table[i].symbol_number + PDFS,
-                            R_PPC_ADDR16_HI);
-                rel_addend.r_addend = *((short *)
-                    (&obj->text.code[obj->text_rellocation_table[i].offset]))
-                        << 16;
-                rel_addend.r_addend += *((short *)
-                    (&obj->text.code[
-                        obj->text_rellocation_table[i].offset + 4]));
-                break;
-            case RTYPE_DATA1:
-                rel_addend.r_info =
-                    ELF32_R_INFO(
-                        obj->text_rellocation_table[i].symbol_number + PDFS,
-                            R_PPC_ADDR16_LO);
-                rel_addend.r_addend = *((short *)
-                    (&obj->text.code[obj->text_rellocation_table[i].offset]));
-                rel_addend.r_addend += *((short *)
-                    (&obj->text.code[
-                        obj->text_rellocation_table[i].offset - 4])) << 16;
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXEC_ERROR,
-                    "Unknown text rellocation type: %d\n",
-                    obj->text_rellocation_table[i].type);
-                break;
-        }
-        save_struct(fp, &rel_addend, sizeof (Elf32_Rela));
-#  endif
-#  ifdef PARROT_ARM
-        memset(&rellocation, 0, sizeof (Elf32_Rel));
-        rellocation.r_offset = obj->text_rellocation_table[i].offset;
-        switch (obj->text_rellocation_table[i].type) {
-            case RTYPE_FUNC:
-                rellocation.r_info =
-                    ELF32_R_INFO(
-                        obj->text_rellocation_table[i].symbol_number + PDFS,
-                            R_ARM_ABS32);
-                break;
-            case RTYPE_DATA:
-                rellocation.r_info =
-                    ELF32_R_INFO(
-                        obj->text_rellocation_table[i].symbol_number + PDFS,
-                            R_ARM_ABS32);
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXEC_ERROR,
-                    "Unknown text rellocation type: %d\n",
-                    obj->text_rellocation_table[i].type);
-                break;
-        }
-        save_struct(fp, &rellocation, sizeof (Elf32_Rel));
-#  endif
-    }
-    /* Symbol table */
-    /* zero */
-    memset(&symlst, 0, sizeof (Elf32_Sym));
-    save_struct(fp, &symlst, sizeof (Elf32_Sym));
-
-    /* Text */
-    memset(&symlst, 0, sizeof (Elf32_Sym));
-    symlst.st_info = ELF32_ST_INFO(STB_LOCAL, STT_SECTION);
-    symlst.st_shndx = 2;
-    save_struct(fp, &symlst, sizeof (Elf32_Sym));
-
-    /* Data */
-    memset(&symlst, 0, sizeof (Elf32_Sym));
-    symlst.st_info = ELF32_ST_INFO(STB_LOCAL, STT_SECTION);
-    symlst.st_shndx = 3;
-    save_struct(fp, &symlst, sizeof (Elf32_Sym));
-
-    /* Bss */
-    memset(&symlst, 0, sizeof (Elf32_Sym));
-    symlst.st_info = ELF32_ST_INFO(STB_LOCAL, STT_SECTION);
-    symlst.st_shndx = 4;
-    save_struct(fp, &symlst, sizeof (Elf32_Sym));
-
-    for (i = 0; i < obj->symbol_count; i++) {
-        memset(&symlst, 0, sizeof (Elf32_Sym));
-        symlst.st_name = obj->symbol_table[i].offset_list + 1;
-        switch (obj->symbol_table[i].type) {
-            case STYPE_FUNC:
-                symlst.st_info = ELF32_ST_INFO(STB_GLOBAL, STT_FUNC);
-                symlst.st_size = obj->text.size;
-                symlst.st_shndx = 2; /* text */
-                break;
-            case STYPE_GDATA:
-                symlst.st_value = obj->symbol_table[i].value;
-                symlst.st_size = obj->data_size[i];
-                symlst.st_info = ELF32_ST_INFO(STB_GLOBAL, STT_OBJECT);
-                symlst.st_shndx = 3; /* data */
-                break;
-            case STYPE_COM:
-                symlst.st_value = obj->symbol_table[i].value;
-                /* symlst.st_size = obj->data_size[i]; XXX daniel why? */
-                symlst.st_info = ELF32_ST_INFO(STB_GLOBAL, STT_OBJECT);
-                symlst.st_shndx = SHN_COMMON;
-                break;
-            case STYPE_UND:
-                symlst.st_info = ELF32_ST_INFO(STB_GLOBAL, STT_NOTYPE);
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXEC_ERROR,
-                    "Unknown symbol type: %d\n", obj->symbol_table[i].type);
-                break;
-        }
-        save_struct(fp, &symlst, sizeof (Elf32_Sym));
-    }
-    /* String table */
-    save_zero(fp);
-    for (i = 0; i < obj->symbol_count; i++) {
-        fprintf(fp, "%s", obj->symbol_table[i].symbol);
-        save_zero(fp);
-    }
-    /* PAD */
-    for (i = 0; i < (4 - obj->symbol_list_size % 4); i++)
-        save_zero(fp);
-    fclose(fp);
-}
-
-#endif /* EXEC_ELF */
-
-#ifdef EXEC_MACH_O
-
-void
-Parrot_exec_save(PARROT_INTERP, Parrot_exec_objfile_t *obj, const char *file)
-{
-    FILE  *fp = fopen(file, "w");
-    size_t i;
-
-    fprintf(fp, "\xFE\xED\xFA\xCE"); /* Header for Darwin */
-    save_int(fp, 0x12);
-    save_int(fp, 0);
-    save_int(fp, 0x1);
-    save_int(fp, 0x3);
-    save_int(fp, 0x128);
-    save_int(fp, 0);
-    save_int(fp, 0x1);
-    save_int(fp, 0xC0);
-    for (i = 0; i < 5; i++)
-        save_int(fp, 0);
-    /* Sizeof text + data */
-    save_int(fp, obj->text.size + obj->data.size);
-    /* Offset of text */
-    save_int(fp, 0x144);
-    save_int(fp, obj->text.size + obj->data.size);
-    save_int(fp, 0x7);
-    save_int(fp, 0x7);
-    save_int(fp, 0x2);
-    save_int(fp, 0);
-    fprintf(fp, "__text");
-    for (i = 0; i < 10; i++)
-        save_zero(fp);
-    fprintf(fp, "__TEXT");
-    for (i = 0; i < 10; i++)
-        save_zero(fp);
-    save_int(fp, 0);
-    /* Sizeof text */
-    save_int(fp, obj->text.size);
-    save_int(fp, 0x144);
-    save_int(fp, 0x2);
-    /* Offset of rellocation table. */
-    save_int(fp, 0x144 + obj->text.size + obj->data.size);
-    save_int(fp, obj->text_rellocation_count);
-    save_int(fp, 0x80000400);
-    save_int(fp, 0);
-    save_int(fp, 0);
-    fprintf(fp, "__data");
-    for (i = 0; i < 10; i++)
-        save_zero(fp);
-    fprintf(fp, "__DATA");
-    for (i = 0; i < 10; i++)
-        save_zero(fp);
-    /* Data VMA */
-    save_int(fp, obj->text.size);
-    /* Data size */
-    save_int(fp, obj->data.size);
-    /* Data file offset */
-    save_int(fp, 0x144 + obj->text.size);
-    save_int(fp, 0x2);
-    for (i = 0; i < 5; i++)
-        save_int(fp, 0);
-    save_int(fp, 0x2);
-    /*    save_int(fp, obj->symbol_count * 0xc); */
-    save_int(fp, 0x18);
-    /* Offset of stabs */
-    save_int(fp, 0x144 +
-        obj->text.size + obj->data.size + obj->text_rellocation_count * 0x8);
-    /* Number of stabs (symbol table) */
-    save_int(fp, obj->symbol_count);
-    /* Offset of symbol list */
-    save_int(fp, 0x144 + obj->text.size + obj->data.size +
-        obj->text_rellocation_count * 0x8 + obj->symbol_count * 0xc);
-    /* Sizeof symbol list */
-    save_int(fp, obj->symbol_list_size);
-    save_int(fp, 0xB);
-    save_int(fp, 0x50);
-    for (i = 0; i < 3; i++)
-        save_int(fp, 0);
-    save_int(fp, obj->symbol_count);
-    save_int(fp, obj->symbol_count);
-    for (i = 0; i < 13; i++)
-        save_int(fp, 0);
-
-    /* Text */
-    for (i = 0; i < obj->text.size; i++)
-        fprintf(fp, "%c", obj->text.code[i]);
-    /* Data */
-    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);
-        save_short(fp, obj->text_rellocation_table[i].type);
-    }
-    /* Symbol table */
-    for (i = 0; i < obj->symbol_count; i++) {
-        save_int(fp, obj->symbol_table[i].offset_list);
-        save_int(fp, obj->symbol_table[i].type);
-        save_int(fp, obj->symbol_table[i].value);
-    }
-    /* Symbol list */
-    for (i = 0; i < obj->symbol_count; i++) {
-        if (obj->symbol_table[i].type != STYPE_GCC)
-            fprintf(fp, "_%s", obj->symbol_table[i].symbol);
-        else
-            fprintf(fp, "%s", obj->symbol_table[i].symbol);
-        save_zero(fp);
-    }
-    fclose(fp);
-}
-
-#endif /* EXEC_MACH_O */
-
-#ifdef EXEC_COFF
-
-/* File offsets */
-#  define TEXT_CODE  0x14 + (3 * 0x28)
-#  define DATA_CODE  TEXT_CODE + obj->text.size
-#  define TEXT_RELOC DATA_CODE + obj->data.size
-#  define DATA_RELOC TEXT_RELOC + (obj->text_rellocation_count * 0xA)
-#  define SYMTAB     DATA_RELOC + (obj->data_rellocation_count * 0xA)
-
-void
-Parrot_exec_save(PARROT_INTERP, Parrot_exec_objfile_t *obj, const char *file)
-{
-    FILE *fp;
-    int i;
-    size_t j;
-
-    fp = fopen(file, "wb");
-
-    save_short(fp, 0x14C); /* i386 */
-    save_short(fp, 3);     /* Number of sections */
-    save_int(fp, Parrot_intval_time());
-    save_int(fp, SYMTAB);
-    save_int(fp, obj->symbol_count);
-    save_short(fp, 0);
-    save_short(fp, 0x104); /* 32 bit LE, no line numbers */
-
-    fwrite(".text\0\0\0", 8, 1, fp);
-    save_int(fp, 0);
-    save_int(fp, 0);
-    save_int(fp, obj->text.size);
-    save_int(fp, TEXT_CODE);
-    save_int(fp, TEXT_RELOC);
-    save_int(fp, 0);
-    save_short(fp, (short)obj->text_rellocation_count);
-    save_short(fp, 0);
-    save_int(fp, 0x20);
-
-    fwrite(".data\0\0\0", 8, 1, fp);
-    save_int(fp, 0);
-    save_int(fp, 0);
-    save_int(fp, obj->data.size);
-    save_int(fp, DATA_CODE);
-    save_int(fp, DATA_RELOC);
-    save_int(fp, 0);
-    save_short(fp, (short)obj->data_rellocation_count);
-    save_short(fp, 0);
-    save_int(fp, 0x40);
-
-    fwrite(".bss\0\0\0\0", 8, 1, fp);
-    save_int(fp, 0);
-    save_int(fp, 0);
-    save_int(fp, obj->bss.size);
-    save_int(fp, 0);
-    save_int(fp, 0);
-    save_int(fp, 0);
-    save_short(fp, 0);
-    save_short(fp, 0);
-    save_int(fp, 0x80);
-
-    /* Text */
-    for (j = 0; j < obj->text.size; j++)
-        fprintf(fp, "%c", obj->text.code[j]);
-    /* Data */
-    for (j = 0; j < obj->data.size; j++)
-        fprintf(fp, "%c", obj->data.code[j]);
-    /* Text rellocations */
-    for (i = 0; i < obj->text_rellocation_count; i++) {
-        save_int(fp, obj->text_rellocation_table[i].offset);
-        save_int(fp, obj->text_rellocation_table[i].symbol_number);
-        switch (obj->text_rellocation_table[i].type) {
-            case RTYPE_FUNC:
-                save_short(fp, 0x14);
-                break;
-            case RTYPE_COM:
-            case RTYPE_DATA:
-                save_short(fp, 0x06);
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXEC_ERROR,
-                    "Unknown text rellocation type: %d\n",
-                    obj->text_rellocation_table[i].type);
-                break;
-        }
-    }
-    /* Symbol table */
-    for (i = 0; i < obj->symbol_count; i++) {
-        save_int(fp, 0);
-        save_int(fp, obj->symbol_table[i].offset_list);
-        save_int(fp, obj->symbol_table[i].value);
-        switch (obj->symbol_table[i].type) {
-            case STYPE_FUNC:
-                save_short(fp, 1); /* .text */
-                save_short(fp, 0x20);
-                break;
-            case STYPE_GDATA:
-                save_short(fp, 2); /* .data */
-                save_short(fp, 0);
-                break;
-            case STYPE_COM:
-                save_short(fp, 0);
-                save_short(fp, 0);
-                break;
-            case STYPE_UND:
-                save_short(fp, 0);
-                save_short(fp, 0x20);
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXEC_ERROR,
-                    "Unknown symbol type: %d\n", obj->symbol_table[i].type);
-                break;
-        }
-        putc(2, fp); /* "extern" class */
-        putc(0, fp);
-    }
-    /* Symbol list */
-    save_int(fp, obj->symbol_list_size);
-    for (i = 0; i < obj->symbol_count; i++) {
-        if (obj->symbol_table[i].type != STYPE_GCC)
-            fprintf(fp, "_%s", obj->symbol_table[i].symbol);
-        else
-            fprintf(fp, "%s", obj->symbol_table[i].symbol);
-        save_zero(fp);
-    }
-    fclose(fp);
-}
-
-#endif /* EXEC_COFF */
-
-/*
-
-=item C<static void save_struct(FILE *fp, void *sp, size_t size)>
-
-Writes the C<struct> C<sp> to the file.
-
-=cut
-
-*/
-
-static void
-save_struct(FILE *fp, void *sp, size_t size)
-{
-    unsigned int i;
-
-    for (i = 0; i < size; i++)
-        fprintf(fp, "%c", ((char *)sp)[i]);
-}
-
-/*
-
-=item C<static void save_zero(FILE *fp)>
-
-Writes 0 to the file.
-
-=cut
-
-*/
-
-static void
-save_zero(FILE *fp)
-{
-    fprintf(fp, "%c", 0);
-}
-
-#if PARROT_BIGENDIAN
-
-/*
-
-=item C<static void save_int(FILE *fp, int i)>
-
-Writes C<i> to the file.
-
-=cut
-
-*/
-
-static void
-save_int(FILE *fp, int i)
-{
-    fprintf(fp, "%c%c%c%c", (char)(i >> 24), (char)(i >> 16),
-                            (char)(i >> 8), (char)i);
-}
-
-/*
-
-=item C<static void save_short(FILE *fp, short s)>
-
-Writes C<s> to the file.
-
-=cut
-
-*/
-
-static void
-save_short(FILE *fp, short s)
-{
-    fprintf(fp, "%c%c", (char)(s >> 8), (char)s);
-}
-
-#else /* PARROT_BIGENDIAN */
-
-static void
-save_short(FILE *fp, short s)
-{
-    fprintf(fp, "%c%c", (char)s, (char)(s >> 8));
-}
-
-static void
-save_int(FILE *fp, int i)
-{
-    fprintf(fp, "%c%c%c%c", (char)i, (char)(i >> 8),
-                            (char)(i >> 16), (char)(i >> 24));
-}
-
-#endif /* PARROT_BIGENDIAN */
-
-/*
-
-=back
-
-=head1 SEE ALSO
-
-F<include/parrot/exec.h>, F<src/exec_save.h>, F<src/exec.c>
-and F<src/exec_start.c>.
-
-=head1 HISTORY
-
-Initial version by Daniel Grunblatt on 2003.6.9.
-
-=cut
-
-*/
-
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/exec_save.h
==============================================================================
--- branches/orderedhash_revamp/src/exec_save.h	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2003-2007, Parrot Foundation.
- */
-
-/*
- * exec.h
- *
- * SVN Info
- *    $Id$
- * Overview:
- *    Exec header file.
- * History:
- *      Initial version by Daniel Grunblatt on 2003.6.9
- * Notes:
- * References:
- */
-
-#ifndef PARROT_EXEC_SAVE_H_GUARD
-#define PARROT_EXEC_SAVE_H_GUARD
-
-void Parrot_exec_save(PARROT_INTERP, Parrot_exec_objfile_t *obj, const char *file);
-
-#endif /* PARROT_EXEC_SAVE_H_GUARD */
-
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/exec_start.c
==============================================================================
--- branches/orderedhash_revamp/src/exec_start.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,135 +0,0 @@
-/*
-Copyright (C) 2001-2006, Parrot Foundation.
-$Id$
-
-=head1 NAME
-
-src/exec_start.c - Call compiled code
-
-=head1 SYNOPSIS
-
-I<What goes here?>
-
-=head1 DESCRIPTION
-
-Exec is a tool for using the JIT at compile time to generate native
-executables.
-
-=head2 Functions
-
-=over 4
-
-=cut
-
-*/
-
-#include "parrot/parrot.h"
-#include "parrot/string.h"
-#include "parrot/exec.h"
-#include "jit.h"
-#define JIT_EMIT 1
-#include "jit_emit.h"
-#include "parrot/embed.h"
-
-opcode_t* run_compiled(PARROT_INTERP,
-    opcode_t *cur_opcode, opcode_t *code_start);
-
-/*
-
-=item C<int main(int argc, char * argv[])>
-
-The run-loop.
-
-=cut
-
-*/
-
-int
-main(int argc, char * argv[])
-{
-    /* long *             opp; */
-    Interp *           interp;
-    PackFile *  pf;
-    opcode_t *         code_start;
-    extern char *      program_code;
-    /* extern long        opcode_map; */
-    /* extern int         bytecode_offset; */
-#if defined(JIT_CGP)
-    extern void *      exec_prederef_code;
-#endif
-    /* extern int        Parrot_exec_run; */
-    /* extern PackFile_Constant *exec_const_table; */
-    /* extern PackFile_Constant const_table; */
-    extern Interp interpre;
-
-    /* s. exec.c */
-    /* Parrot_exec_run = 1; */
-    /* s. packfile.c (PackFile_ConstTable_unpack()) */
-    /* exec_const_table = &const_table; */
-    interp = Parrot_new(NULL);
-    if (!interp) {
-        return 1;
-    }
-
-    /* run_native = run_compiled; */
-    /* TODO make also a shared variant of PackFile_new */
-    pf = PackFile_new(interp, 0);
-
-    if (!PackFile_unpack(interp, pf, (opcode_t *)(&program_code),
-        sizeof (&program_code)))
-    {
-        printf("Can't unpack.\n");
-        return 1;
-    }
-    Parrot_pbc_load(interp, pf);
-    PackFile_fixup_subs(interp, PBC_PBC, NULL);
-
-    /* opcode_map has the offset of each opcode in the compiled code
-     * this modifies it to be address of the opcode.
-     */
-    /*
-    opp = &opcode_map;
-    for (i = 0; i < (int)interpre.code->base.size; i++) {
-        opp[i] += (long)run_compiled;
-    }
-    */
-
-#if defined(JIT_CGP)
-    exec_init_prederef(interp, &exec_prederef_code);
-#endif
-    /* Parrot_set_run_core(interp, PARROT_EXEC_CORE);
-    interp->code->base.data =
-        (opcode_t *)&((&program_code)[bytecode_offset]);
-    Parrot_exec_run = 0; */
-    Parrot_runcode(interp, argc, argv);
-    /*
-        run_compiled(interp,
-            (opcode_t *)&((&program_code)[bytecode_offset]));
-     */
-    Parrot_exit(interp, 0);
-}
-
-/*
-
-=back
-
-=head1 SEE ALSO
-
-F<include/parrot/exec.h>, F<src/exec_save.h>, F<src/exec.c>
-and F<compilers/imcc/main.c>.
-
-=head1 HISTORY
-
-Initial version by Daniel Grunblatt on 2003.6.9
-
-=cut
-
-*/
-
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Modified: branches/orderedhash_revamp/src/exit.c
==============================================================================
--- branches/orderedhash_revamp/src/exit.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/exit.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -41,8 +41,6 @@
 Parrot_on_exit(PARROT_INTERP, NOTNULL(exit_handler_f function), ARGIN_NULLOK(void *arg))
 {
     ASSERT_ARGS(Parrot_on_exit)
-    /* RT#46403  we might want locking around the list access.   I'm sure this
-     * will be the least of the threading issues. */
 
     handler_node_t * const new_node = mem_allocate_typed(handler_node_t);
 
@@ -72,7 +70,8 @@
     /* we are well "below" the runloop now, where lo_var_ptr
      * is set usually - exit handlers may run some resource-hungry
      * stuff like printing profile stats - a GC run would kill
-     * resources - RT#46405 reset stacktop or better disable GC
+     * resources
+     * http://rt.perl.org/rt3/Ticket/Display.html?id=46405 (resolved)
      */
     /*
      * we don't allow new exit_handlers being installed inside exit handlers

Modified: branches/orderedhash_revamp/src/extend.c
==============================================================================
--- branches/orderedhash_revamp/src/extend.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/extend.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -61,6 +61,7 @@
 #include "parrot/parrot.h"
 #include "parrot/extend.h"
 #include "pmc/pmc_sub.h"
+#include "pmc/pmc_callcontext.h"
 
 /* HEADERIZER HFILE: include/parrot/extend.h */
 
@@ -1010,7 +1011,54 @@
 
 /*
 
-=item C<void* Parrot_call_sub(PARROT_INTERP, Parrot_PMC sub_pmc, const char
+=item C<void Parrot_ext_call(PARROT_INTERP, Parrot_PMC sub_pmc, const char
+*signature, ...)>
+
+Call a Parrot subroutine or method with the given function signature. The
+function signature holds one type character for each argument or return, these
+are:
+
+    I ... Parrot_Int
+    N ... Parrot_Float
+    S ... Parrot_String
+    P ... Parrot_PMC
+
+Returns come after the arguments, separated by an arrow, so "PN->S" takes a PMC
+and a float as arguments and returns a string.
+
+Pass the variables for the arguments and returns in the same order as the
+signature, with returns as reference to the variable (so it can be modified).
+
+    Parrot_ext_call(interp, sub, "P->S", pmc_arg, &string_result);
+
+To call a method, pass the object for the method as the first argument, and
+mark it in the signature as "Pi" ("i" stands for "invocant").
+
+    Parrot_ext_call(interp, sub, "PiP->S", object_arg, pmc_arg, &string_result);
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_ext_call(PARROT_INTERP, ARGIN(Parrot_PMC sub_pmc),
+                 ARGIN(const char *signature), ...)
+{
+    ASSERT_ARGS(Parrot_ext_call)
+    va_list args;
+    PMC  *sig_object;
+
+    va_start(args, signature);
+    sig_object = Parrot_pcc_build_sig_object_from_varargs(interp, PMCNULL, signature, args);
+    va_end(args);
+
+    Parrot_pcc_invoke_from_sig_object(interp, sub_pmc, sig_object);
+}
+
+/*
+
+=item C<void * Parrot_call_sub(PARROT_INTERP, Parrot_PMC sub_pmc, const char
 *signature, ...)>
 
 Call a parrot subroutine with the given function signature. The first char in
@@ -1033,27 +1081,57 @@
 PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
-void*
+void *
 Parrot_call_sub(PARROT_INTERP, Parrot_PMC sub_pmc,
                  ARGIN(const char *signature), ...)
 {
     ASSERT_ARGS(Parrot_call_sub)
-    va_list     ap;
-    void       *result;
+    va_list     args;
+    PMC        *sig_object;
     Parrot_sub *sub;
+    void       *result     = NULL;
+    const char *arg_sig    = signature;
+    char        return_sig = signature[0];
+
+    arg_sig++;
+    va_start(args, signature);
+    sig_object = Parrot_pcc_build_sig_object_from_varargs(interp, PMCNULL,
+        arg_sig, args);
+    va_end(args);
 
-    PARROT_CALLIN_START(interp);
+    /* Add the return argument onto the call signature object (a bit
+     * hackish, added for backward compatibility in deprecated API function,
+     * see TT #1145). */
+    switch (return_sig) {
+        case 'v':
+        {
+            Parrot_String full_sig = VTABLE_get_string(interp, sig_object);
+            Parrot_str_concat(interp, full_sig,
+                    Parrot_str_new_constant(interp, "->"), 0);
+            break;
+        }
+        case 'V':
+        case 'P':
+        {
+            Parrot_pcc_append_result(interp, sig_object, Parrot_str_new_constant(interp, "P"),
+                    &result);
+            break;
+        }
+        default:
+            Parrot_ex_throw_from_c_args(interp, NULL,
+                EXCEPTION_INVALID_OPERATION,
+                "Dispatch: invalid return type %c!", return_sig);
+    }
 
-    va_start(ap, signature);
     PMC_get_sub(interp, sub_pmc, sub);
-    CONTEXT(interp)->constants = sub->seg->const_table->constants;
-    result = Parrot_runops_fromc_arglist(interp, sub_pmc, signature, ap);
-    va_end(ap);
+    Parrot_pcc_set_constants(interp, CURRENT_CONTEXT(interp),
+        sub->seg->const_table->constants);
+    Parrot_pcc_invoke_from_sig_object(interp, sub_pmc, sig_object);
 
-    PARROT_CALLIN_END(interp);
     return result;
 }
 
+
 /*
 
 =item C<Parrot_Int Parrot_call_sub_ret_int(PARROT_INTERP, Parrot_PMC sub_pmc,
@@ -1071,19 +1149,24 @@
                  ARGIN(const char *signature), ...)
 {
     ASSERT_ARGS(Parrot_call_sub_ret_int)
-    va_list     ap;
+    va_list     args;
+    PMC        *sig_object;
     Parrot_Int  result;
+    char        return_sig  = signature[0];
+    const char *arg_sig     = signature;
     Parrot_sub *sub;
 
-    PARROT_CALLIN_START(interp);
+    arg_sig++;
+    va_start(args, signature);
+    sig_object = Parrot_pcc_build_sig_object_from_varargs(interp, PMCNULL, arg_sig, args);
+    va_end(args);
 
-    va_start(ap, signature);
-    PMC_get_sub(interp, sub_pmc, sub);
-    CONTEXT(interp)->constants = sub->seg->const_table->constants;
-    result = Parrot_runops_fromc_arglist_reti(interp, sub_pmc, signature, ap);
-    va_end(ap);
+    /* Add the return argument onto the call signature object (a bit
+     * hackish, added for backward compatibility in deprecated API function,
+     * see TT #1145). */
+    Parrot_pcc_append_result(interp, sig_object, Parrot_str_new_constant(interp, "I"), &result);
+    Parrot_pcc_invoke_from_sig_object(interp, sub_pmc, sig_object);
 
-    PARROT_CALLIN_END(interp);
     return result;
 }
 
@@ -1104,26 +1187,33 @@
                  ARGIN(const char *signature), ...)
 {
     ASSERT_ARGS(Parrot_call_sub_ret_float)
-    va_list       ap;
-    Parrot_Float  result;
-    Parrot_sub   *sub;
-
-    PARROT_CALLIN_START(interp);
+    va_list         args;
+    PMC            *sig_object;
+    Parrot_Float    result;
+    char            return_sig  = signature[0];
+    const char     *arg_sig     = signature;
+    Parrot_sub     *sub;
+
+    arg_sig++;
+    va_start(args, signature);
+    sig_object = Parrot_pcc_build_sig_object_from_varargs(interp, PMCNULL, arg_sig, args);
+    va_end(args);
 
-    va_start(ap, signature);
+    /* Add the return argument onto the call signature object (a bit
+     * hackish, added for backward compatibility in deprecated API function,
+     * see TT #1145). */
+    Parrot_pcc_append_result(interp, sig_object, Parrot_str_new_constant(interp, "N"), &result);
     PMC_get_sub(interp, sub_pmc, sub);
-    CONTEXT(interp)->constants = sub->seg->const_table->constants;
-    result = Parrot_runops_fromc_arglist_retf(interp, sub_pmc, signature, ap);
-    va_end(ap);
+    Parrot_pcc_set_constants(interp, CURRENT_CONTEXT(interp), sub->seg->const_table->constants);
+    Parrot_pcc_invoke_from_sig_object(interp, sub_pmc, sig_object);
 
-    PARROT_CALLIN_END(interp);
     return result;
 }
 
 /*
 
-=item C<void * Parrot_call_method(PARROT_INTERP, Parrot_PMC sub, Parrot_PMC obj,
-Parrot_String method, const char *signature, ...)>
+=item C<void * Parrot_call_method(PARROT_INTERP, Parrot_PMC sub_pmc, Parrot_PMC
+obj, Parrot_String method, const char *signature, ...)>
 
 Call the parrot subroutine C<sub> as a method on PMC object C<obj>. The method
 should have the name C<method> as a Parrot_string, and should have a function
@@ -1138,25 +1228,59 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
 void *
-Parrot_call_method(PARROT_INTERP, Parrot_PMC sub, Parrot_PMC obj,
+Parrot_call_method(PARROT_INTERP, Parrot_PMC sub_pmc, Parrot_PMC obj,
                         Parrot_String method, ARGIN(const char *signature), ...)
 {
     ASSERT_ARGS(Parrot_call_method)
-    void    *result;
-    va_list ap;
+    va_list args;
+    PMC  *sig_object;
+    void *result = NULL;
+    char  return_sig = signature[0];
+    char *arg_sig = (char*)malloc(strlen(signature)+2);
+    Parrot_sub *sub;
+    arg_sig[0] = 'P';
+    arg_sig[1] = 'i';
+    arg_sig[2] = 0;
+    strcat(arg_sig, signature);
+
+    va_start(args, signature);
+    sig_object = Parrot_pcc_build_sig_object_from_varargs(interp, obj, arg_sig, args);
+    va_end(args);
+    free(arg_sig);
+
+    /* Add the return argument onto the call signature object (a bit
+     * hackish, added for backward compatibility in deprecated API function,
+     * see TT #1145). */
+    switch (return_sig) {
+        case 'v':
+        {
+            Parrot_String full_sig = VTABLE_get_string(interp, sig_object);
+            Parrot_str_concat(interp, full_sig,
+                    Parrot_str_new_constant(interp, "->"), 0);
+            break;
+        }
+        case 'V':
+        case 'P':
+        {
+            Parrot_pcc_append_result(interp, sig_object, Parrot_str_new_constant(interp, "P"),
+                    &result);
+            break;
+        }
+        default:
+            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                        "Dispatch: invalid return type %c!", return_sig);
+    }
+
+    PMC_get_sub(interp, sub_pmc, sub);
+    Parrot_pcc_set_constants(interp, CURRENT_CONTEXT(interp), sub->seg->const_table->constants);
+    Parrot_pcc_invoke_from_sig_object(interp, sub_pmc, sig_object);
 
-    PARROT_CALLIN_START(interp);
-    va_start(ap, signature);
-    result = Parrot_run_meth_fromc_arglist(interp, sub,
-            obj, method, signature, ap);
-    va_end(ap);
-    PARROT_CALLIN_END(interp);
     return result;
 }
 
 /*
 
-=item C<Parrot_Int Parrot_call_method_ret_int(PARROT_INTERP, Parrot_PMC sub,
+=item C<Parrot_Int Parrot_call_method_ret_int(PARROT_INTERP, Parrot_PMC sub_pmc,
 Parrot_PMC obj, Parrot_String method, const char *signature, ...)>
 
 Call the parrot subroutine C<sub> as a method on PMC object C<obj>. The method
@@ -1170,26 +1294,38 @@
 
 PARROT_EXPORT
 Parrot_Int
-Parrot_call_method_ret_int(PARROT_INTERP, Parrot_PMC sub,
+Parrot_call_method_ret_int(PARROT_INTERP, Parrot_PMC sub_pmc,
         Parrot_PMC obj, Parrot_String method, ARGIN(const char *signature), ...)
 {
     ASSERT_ARGS(Parrot_call_method_ret_int)
-    Parrot_Int result;
-    va_list    ap;
+    va_list args;
+    PMC  *sig_object;
+    Parrot_Int result = 0;
+    char  return_sig = signature[0];
+    char *arg_sig = (char*)malloc(strlen(signature)+2);
+    Parrot_sub *sub;
+    arg_sig[0] = 'P';
+    arg_sig[1] = 'i';
+    arg_sig[2] = 0;
+    strcat(arg_sig, signature);
+
+    va_start(args, signature);
+    sig_object = Parrot_pcc_build_sig_object_from_varargs(interp, obj, arg_sig, args);
+    va_end(args);
+    free(arg_sig);
+
+    Parrot_pcc_append_result(interp, sig_object, Parrot_str_new_constant(interp, "I"), &result);
+    PMC_get_sub(interp, sub_pmc, sub);
+    Parrot_pcc_set_constants(interp, CURRENT_CONTEXT(interp), sub->seg->const_table->constants);
+    Parrot_pcc_invoke_from_sig_object(interp, sub_pmc, sig_object);
 
-    PARROT_CALLIN_START(interp);
-    va_start(ap, signature);
-    result = Parrot_run_meth_fromc_arglist_reti(interp, sub,
-            obj, method, signature, ap);
-    va_end(ap);
-    PARROT_CALLIN_END(interp);
     return result;
 }
 
 /*
 
-=item C<Parrot_Float Parrot_call_method_ret_float(PARROT_INTERP, Parrot_PMC sub,
-Parrot_PMC obj, Parrot_String method, const char *signature, ...)>
+=item C<Parrot_Float Parrot_call_method_ret_float(PARROT_INTERP, Parrot_PMC
+sub_pmc, Parrot_PMC obj, Parrot_String method, const char *signature, ...)>
 
 Call a parrot method for the given object.
 
@@ -1199,19 +1335,31 @@
 
 PARROT_EXPORT
 Parrot_Float
-Parrot_call_method_ret_float(PARROT_INTERP, Parrot_PMC sub,
+Parrot_call_method_ret_float(PARROT_INTERP, Parrot_PMC sub_pmc,
         Parrot_PMC obj, Parrot_String method, ARGIN(const char *signature), ...)
 {
     ASSERT_ARGS(Parrot_call_method_ret_float)
-    Parrot_Float result;
-    va_list      ap;
+    va_list args;
+    PMC  *sig_object;
+    Parrot_Float result = 0.0;
+    char  return_sig = signature[0];
+    char *arg_sig = (char*)malloc(strlen(signature)+2);
+    Parrot_sub *sub;
+    arg_sig[0] = 'P';
+    arg_sig[1] = 'i';
+    arg_sig[2] = 0;
+    strcat(arg_sig, signature);
+
+    va_start(args, signature);
+    sig_object = Parrot_pcc_build_sig_object_from_varargs(interp, obj, arg_sig, args);
+    va_end(args);
+    free(arg_sig);
+
+    Parrot_pcc_append_result(interp, sig_object, Parrot_str_new_constant(interp, "N"), &result);
+    PMC_get_sub(interp, sub_pmc, sub);
+    Parrot_pcc_set_constants(interp, CURRENT_CONTEXT(interp), sub->seg->const_table->constants);
+    Parrot_pcc_invoke_from_sig_object(interp, sub_pmc, sig_object);
 
-    PARROT_CALLIN_START(interp);
-    va_start(ap, signature);
-    result = Parrot_run_meth_fromc_arglist_retf(interp, sub,
-            obj, method, signature, ap);
-    va_end(ap);
-    PARROT_CALLIN_END(interp);
     return result;
 }
 

Added: branches/orderedhash_revamp/src/frame_builder.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/src/frame_builder.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,631 @@
+/*
+Copyright (C) 2008-2009, Parrot Foundation.
+$Id$
+
+=head1 NAME
+
+src/frame_builder.c
+
+=head1 DESCRIPTION
+
+Functions for the ManagedStruct PMC and others.
+
+=head1 FUNCTIONS
+
+=cut
+
+*/
+
+/* HEADERIZER HFILE: none */
+/* HEADERIZER STOP */
+
+#include "parrot/parrot.h"
+#include "pmc/pmc_fixedintegerarray.h"
+#include "pmc/pmc_unmanagedstruct.h"
+#include "pmc/pmc_managedstruct.h"
+#include "frame_builder.h"
+
+/*
+
+=over 4
+
+=item C<void Parrot_jit_free_buffer(PARROT_INTERP, void *ptr, void *priv)>
+
+This is a callback to implement the proper freeing semantics.  It is called by
+the ManagedStruct PMC as it is garbage collected.
+
+=cut
+
+*/
+
+void
+Parrot_jit_free_buffer(PARROT_INTERP, void *ptr, void *priv)
+{
+    const struct jit_buffer_private_data * const jit = (struct jit_buffer_private_data*)priv;
+    mem_free_executable(ptr, jit->size);
+    free(priv);
+}
+
+/*
+
+=item C<PMC *Parrot_jit_clone_buffer(PARROT_INTERP, PMC *pmc, void *priv)>
+
+This is a callback to implement the proper cloning semantics for jit buffers.
+It is called by the ManagedStruct PMC's clone() function.
+
+=back
+
+=cut
+
+*/
+
+PMC *
+Parrot_jit_clone_buffer(PARROT_INTERP, PMC *pmc, void *priv)
+{
+    PMC * const rv = pmc_new(interp, pmc->vtable->base_type);
+
+    VTABLE_init(interp, rv);
+    /* copy the attributes */
+    {
+        void (*tmpfreefunc)(PARROT_INTERP, void*, void*);
+        GETATTR_ManagedStruct_custom_free_func(interp, pmc, tmpfreefunc);
+        SETATTR_ManagedStruct_custom_free_func(interp, rv , tmpfreefunc);
+    }
+    {
+        PMC* (*tmpclonefunc)(PARROT_INTERP, PMC*, void*);
+        GETATTR_ManagedStruct_custom_clone_func(interp, pmc, tmpclonefunc);
+        SETATTR_ManagedStruct_custom_clone_func(interp, rv , tmpclonefunc);
+    }
+
+    {
+        void *freepriv, *clonepriv;
+        GETATTR_ManagedStruct_custom_free_priv(interp , pmc, freepriv);
+        GETATTR_ManagedStruct_custom_clone_priv(interp, pmc, clonepriv);
+        if (freepriv) {
+            void *tmp = mem_sys_allocate(sizeof (struct jit_buffer_private_data));
+            memcpy(tmp, freepriv, sizeof (struct jit_buffer_private_data));
+            SETATTR_ManagedStruct_custom_free_priv(interp, rv , tmp);
+            if (clonepriv == freepriv) {
+                /* clonepriv is a copy of freepriv, make it a copy in the clone too. */
+                SETATTR_ManagedStruct_custom_clone_priv(interp, rv , tmp);
+                clonepriv = NULL; /* disable the clonepriv copying below */
+            }
+        }
+        if (clonepriv) {
+            void *tmp = mem_sys_allocate(sizeof (struct jit_buffer_private_data));
+            memcpy(tmp, clonepriv, sizeof (struct jit_buffer_private_data));
+            SETATTR_ManagedStruct_custom_clone_priv(interp, rv , tmp);
+        }
+    }
+
+    /* copy the execmem buffer */
+    if (PARROT_MANAGEDSTRUCT(pmc)->ptr) {
+        struct jit_buffer_private_data *jit = (struct jit_buffer_private_data*)priv;
+        void *ptr = PARROT_MANAGEDSTRUCT(pmc)->ptr;
+        void *newptr = mem_alloc_executable(jit->size);
+        if (!newptr)
+            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_JIT_ERROR,
+                    "Cannot allocate executable memory");
+        memcpy(newptr, ptr, jit->size);
+        PARROT_MANAGEDSTRUCT(rv)->ptr = newptr;
+    }
+
+    return rv;
+}
+
+
+int
+emit_is8bit(long disp)
+{
+    return disp >= -128 && disp <= 127;
+}
+
+char *
+emit_disp8_32(char *pc, int disp)
+{
+    if (emit_is8bit(disp)) {
+        *(pc++) = (char)disp;
+        return pc;
+    }
+    else {
+        *(long *)pc = disp;
+        return pc + 4;
+    }
+}
+
+void
+emit_sib(PARROT_INTERP, char *pc, int scale, int i, int base)
+{
+    int scale_byte;
+
+    switch (scale) {
+      case 1:
+        scale_byte = emit_Scale_1;
+        break;
+      case 2:
+        scale_byte = emit_Scale_2;
+        break;
+      case 4:
+        scale_byte = emit_Scale_4;
+        break;
+      case 8:
+        scale_byte = emit_Scale_8;
+        break;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_JIT_ERROR,
+                "Invalid scale factor %d\n", scale);
+        return;
+    }
+
+    *pc = (char)(scale_byte | (i == emit_None ? emit_Index_None : emit_reg_Index(i)) |
+            emit_reg_Base(base));
+}
+
+char *
+emit_r_X(PARROT_INTERP, char *pc, int reg_opcode, int base, int i, int scale, long disp)
+{
+    if (i && !scale)
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_JIT_ERROR,
+            "emit_r_X passed invalid scale+index combo\n");
+
+    if (base == emit_EBP) {
+    /* modrm disp */
+        if (i == emit_None) {
+            *(pc++) = (char)((emit_is8bit(disp) ? emit_Mod_b01 : emit_Mod_b10)
+                    | reg_opcode | emit_reg_rm(emit_EBP));
+            return emit_disp8_32(pc, disp);
+        }
+        /* modrm sib disp */
+        else {
+            *(pc++) = (char)((emit_is8bit(disp) ? emit_Mod_b01 : emit_Mod_b10)
+                    | reg_opcode | emit_b100);
+            emit_sib(interp, pc++, scale, i, base);
+            return emit_disp8_32(pc, disp);
+        }
+    }
+
+    /* modrm sib disp */
+    if (base == emit_ESP) {
+        *(pc++) = (char)((emit_is8bit(disp) ? emit_Mod_b01 : emit_Mod_b10)
+                | reg_opcode | emit_rm_b100);
+        emit_sib(interp, pc++, scale, i, emit_ESP);
+        return emit_disp8_32(pc, disp);
+    }
+
+    /* modrm disp32 */
+    if (!base && !(i && scale)) {
+        *(pc++) = (char)(emit_Mod_b00 | reg_opcode | emit_rm_b101);
+        *(long *)pc = disp;
+        return pc + 4;
+    }
+
+    /* Ok, everything should be more regular here */
+    *(pc++) = (char)((disp == 0 ? emit_Mod_b00 :
+              (emit_is8bit(disp) ?
+               emit_Mod_b01 : emit_Mod_b10)) |
+               reg_opcode |
+               (!base || (scale && i) ? emit_rm_b100 : emit_reg_rm(base)));
+
+    if (!base || (scale && i)) {
+        emit_sib(interp, pc++, scale, i, base);
+    }
+    if (disp)
+        pc = emit_disp8_32(pc, disp);
+
+    return pc;
+}
+
+char *
+emit_shift_i_r(PARROT_INTERP, char *pc, int opcode, int imm, int reg)
+{
+    if (opcode == emit_b000 && imm < 0) {
+        opcode = emit_b001;     /* -rol => 32 + ror */
+        imm = -imm;
+    }
+
+    if (imm == 0) {
+        /* noop */
+    }
+    else if (imm == 1) {
+        *(pc++) = (char) 0xd1;
+        *(pc++) = (char) emit_alu_X_r(opcode,  reg);
+    }
+    else if (imm > 1 && imm < 33) {
+        *(pc++) = (char) 0xc1;
+        *(pc++) = (char) emit_alu_X_r(opcode,  reg);
+        *(pc++) = (char)imm;
+    }
+    else {
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_JIT_ERROR,
+            "emit_shift_i_r passed invalid shift\n");
+    }
+
+    return pc;
+}
+
+char *
+emit_popl_r(char *pc, int reg)
+{
+    *(pc++) = (char)(0x58 | (reg - 1));
+    return pc;
+}
+
+unsigned char *lastpc;
+
+size_t
+calc_signature_needs(const char *sig, int *strings)
+{
+    size_t stack_size = 0;
+    while (*sig) {
+        switch (*sig) {
+          case 't':
+            (*strings)++;
+            stack_size +=4;
+            break;
+          case 'd':
+            stack_size +=8;
+            break;
+          default:
+            stack_size +=4;
+            break;
+        }
+        sig++;
+    }
+    return stack_size;
+
+}
+
+/*
+ * The function generated here is called as func(interp, nci_info)
+ * interp   ...  8(%ebp)
+ * nci_info ... 12(%ebp)
+ *
+ * The generate function for a specific signature looks quite similar to
+ * an optimized compile of src/nci.c:pcf_x_yy(). In case of any troubles
+ * just compare the disassembly.
+ *
+ * If a non-NULL sizeptr is passed, the integer it points to will be written
+ * with the size of the allocated execmem buffer.
+ */
+
+void *
+Parrot_jit_build_call_func(PARROT_INTERP, PMC *pmc_nci, STRING *signature, int *sizeptr)
+{
+    char     *pc;
+    char     *execmem;
+    int       i                    = 0;
+    int       arg_count            = 0;
+    int       string_buffer_count  = 0;
+    const int ST_SIZE_OF           = 124;
+    const int JIT_ALLOC_SIZE       = 1024;
+
+    char      *signature_str      = Parrot_str_to_cstring(interp, signature);
+    /* skip over the result */
+    char      *sig                = signature_str + 1;
+    size_t     stack_space_needed = calc_signature_needs(sig,
+                                        &string_buffer_count);
+
+    int base_offset        = 0;
+    int strings_offset     = base_offset - (sizeof (char *) * string_buffer_count);
+    int st_offset          = strings_offset - ST_SIZE_OF;
+    int args_offset        = st_offset - stack_space_needed;
+    int temp_calls_offset  = args_offset - 16;
+    int total_stack_needed = -temp_calls_offset;
+
+    /*
+     * ESP
+     * 0-15, 16 bytes for utility calls
+     * stack_space_needed for actual NCI call
+     * st
+     * STRINGS -> char * holding space
+     * EBP
+     */
+
+    /* this ought to be enough - the caller of this function
+     * should free the function pointer returned here
+     */
+    pc = execmem = (char *)mem_alloc_executable(JIT_ALLOC_SIZE);
+    if (! pc)
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_JIT_ERROR,
+                "Cannot allocate executable memory");
+
+
+    /* this generated jit function will be called as (INTERP (EBP 8), func_ptr
+    * (ESP 12), args signature (ESP 16)) */
+
+    /* make stack frame, preserve %ebx */
+    jit_emit_stack_frame_enter(pc);
+
+    emitm_subl_i_r(pc, total_stack_needed, emit_ESP);
+
+    /* Parrot_init_arg_nci(interp, &st, "S"); */
+    /* args signature "S" */
+    emitm_movl_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, 16);
+    emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 8);
+
+    /*&st*/
+    emitm_lea_m_r(interp,  pc, emit_EAX, emit_EBP, 0, 1, st_offset);
+    emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4);
+
+    /*interpreter*/
+    emitm_movl_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, 8);
+    emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 0);
+
+    /* XXX FIXME (TT #1325) This whole function require major rework */
+    /* if (sig && *sig) */
+    /*   emitm_call_cfunc(pc, Parrot_init_arg_nci); */
+
+    while (*sig) {
+        emitm_movl_i_m(pc, arg_count, emit_EBP, 0, 1, temp_calls_offset + 8);
+
+        switch (*sig) {
+          case '0':    /* null ptr or such - doesn't consume a reg */
+            jit_emit_bxor_rr_i(interp, pc, emit_EAX, emit_EAX);
+            emitm_movl_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
+            break;
+          case 'f':
+            /* FIXME (TT #1325) emitm_call_cfunc(pc, get_nci_N); */
+            emitm_fstps(interp, pc, emit_EBP, 0, 1, args_offset);
+            break;
+          case 'N':
+          case 'd':
+            /* FIXME (TT #1325) emitm_call_cfunc(pc, get_nci_N); */
+            emitm_fstpl(interp, pc, emit_EBP, 0, 1, args_offset);
+            args_offset += 4;
+            break;
+          case 'I':   /* INTVAL */
+          case 'l':   /* long */
+          case 'i':   /* int */
+            /* FIXME (TT #1325) emitm_call_cfunc(pc, get_nci_I); */
+            emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
+            break;
+          case 't':   /* string, pass a cstring */
+            /* FIXME (TT #1325) emitm_call_cfunc(pc, get_nci_S); */
+            emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4);
+            emitm_call_cfunc(pc, string_to_cstring_nullable);
+
+            emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
+            /* save off temporary allocation address */
+            emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, strings_offset);
+            strings_offset += 4;
+
+            /* reset ESP(4) */
+            emitm_lea_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, st_offset);
+            emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4);
+            break;
+          case 's':   /* short: movswl intreg_o(base), %eax */
+            /* FIXME (TT #1325) emitm_call_cfunc(pc, get_nci_I); */
+            emitm_movswl_r_r(pc, emit_EAX, emit_EAX);
+            emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
+            break;
+          case 'c':   /* char: movsbl intreg_o(base), %eax */
+            /* emitm_call_cfunc(pc, get_nci_I); */
+            emitm_movsbl_r_r(pc, emit_EAX, emit_EAX);
+            emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
+            break;
+          case 'J':   /* interpreter */
+            emitm_movl_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, 8);
+            emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
+            arg_count--;
+            break;
+          case 'p':   /* push pmc->data */
+            /* FIXME (TT #1325) emitm_call_cfunc(pc, get_nci_p); */
+            emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
+            break;
+          case 'O':   /* push PMC * object in P2 */
+          case 'P':   /* push PMC * */
+          case '@':
+            /* FIXME (TT #1325) emitm_call_cfunc(pc, get_nci_P); */
+            emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
+            break;
+          case 'v':
+            break;
+          case 'b':   /* buffer (void*) pass Buffer_bufstart(SReg) */
+            /* FIXME (TT #1325) emitm_call_cfunc(pc, get_nci_S); */
+            emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1,
+                               (size_t) &Buffer_bufstart((STRING *) NULL));
+            emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
+            break;
+          case 'B':   /* buffer (void**) pass &Buffer_bufstart(SReg) */
+            /* FIXME (TT #1325) emitm_call_cfunc(pc, get_nci_S); */
+            emitm_lea_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1,
+                              (size_t) &Buffer_bufstart((STRING *) NULL));
+            emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
+            break;
+          case 'S':
+            /* FIXME (TT #1325) emitm_call_cfunc(pc, get_nci_S); */
+            emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
+            break;
+
+
+            /* I have no idea how to handle these */
+          case '2':
+          case '3':
+          case '4':
+          case 'V':
+            mem_free_executable(execmem, JIT_ALLOC_SIZE);
+            Parrot_str_free_cstring(signature_str);
+            return NULL;
+            break;
+          default:
+            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_JIT_ERROR,
+                    "Unknown arg Signature %c\n", *sig);
+            /*
+             * oops unknown signature:
+             * cleanup and try nci.c
+             */
+            mem_free_executable(execmem, JIT_ALLOC_SIZE);
+            Parrot_str_free_cstring(signature_str);
+            return NULL;
+        }
+        args_offset +=4;
+        arg_count++;
+        sig++;
+    }
+
+    /* prepare to call VTABLE_get_pointer, set up args */
+    /* interpreter - movl 8(%ebp), %eax */
+    emitm_movl_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, 8);
+    emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 0);
+
+    /* pmc - movl 12(%ebp), %eax */
+    emitm_movl_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, 12);
+    emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4);
+
+    /* get the get_pointer() pointer from the pmc's vtable */
+    emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, offsetof(PMC, vtable));
+    emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, offsetof(VTABLE, get_pointer));
+
+    /* call get_pointer(), result goes into eax */
+    emitm_callr(pc, emit_EAX);
+    emitm_addl_i_r(pc, 16, emit_ESP);
+
+    /* call the resulting function pointer */
+    emitm_callr(pc, emit_EAX);
+    emitm_subl_i_r(pc, 16, emit_ESP);
+
+    /* SAVE OFF EAX */
+    emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 8);
+
+    /*&st*/
+    emitm_lea_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, st_offset);
+    emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4);
+
+    /*interpreter*/
+    emitm_movl_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, 8);
+    emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 0);
+
+    /* RESTORE BACK EAX */
+    emitm_movl_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 8);
+
+    /* now place return value in registers */
+    /* first in signature is the return value */
+    sig = signature_str; /* the result */
+    switch (*sig) {
+      /* I have no idea how to handle these */
+      case '2':
+      case '3':
+      case '4':
+        /* get integer from pointer - untested */
+        emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, 0);
+        if (*sig == 2)      /* short */
+            emitm_movswl_r_r(pc, emit_EAX, emit_EAX);
+        /* XXX FIXME (TT #1325) emitm_call_cfunc(pc, set_nci_I);*/
+        break;
+      case 'f':
+      case 'd':
+        jit_emit_fstore_mb_n(interp, pc, emit_EBP, temp_calls_offset + 8);
+        /* XXX FIXME (TT #1325) emitm_call_cfunc(pc, set_nci_N); */
+        /* pop num from st(0) and mov to reg */
+        break;
+      case 's':
+        /* movswl %ax, %eax */
+        emitm_movswl_r_r(pc, emit_EAX, emit_EAX);
+        emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 8);
+        /* XXX FIXME (TT #1325) emitm_call_cfunc(pc, set_nci_I); */
+        break;
+      case 'c':
+        /* movsbl %al, %eax */
+        emitm_movsbl_r_r(pc, emit_EAX, emit_EAX);
+        emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 8);
+        /* XXX FIXME (TT #1325) emitm_call_cfunc(pc, set_nci_I); */
+        break;
+      case 'I':   /* INTVAL */
+      case 'l':
+      case 'i':
+        emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 8);
+        /* XXX FIXME (TT #1325) emitm_call_cfunc(pc, set_nci_I); */
+        break;
+      case 'v': /* void - do nothing */
+        break;
+      case 'P':
+        emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 8);
+        /* XXX FIXME (TT #1325) emitm_call_cfunc(pc, set_nci_P); */
+        break;
+      case 'p':   /* make a new unmanaged struct */
+        /* save return value on stack */
+
+        /* save pointer p */
+        emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 12);
+
+        /* make new pmc */
+        emitm_movl_i_m(pc, enum_class_UnManagedStruct, emit_EBP, 0, 1, temp_calls_offset + 4);
+        emitm_call_cfunc(pc, pmc_new);
+
+        /* restore pointer p to EDX */
+        emitm_movl_m_r(interp, pc, emit_EDX, emit_EBP, 0, 1, temp_calls_offset + 12);
+
+        /* copy UnManagedStruct to stack for set_nci_P call */
+        emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 8);
+
+        /* eax = PMC, get return value into edx */
+        /* mov data(%eax), %eax
+           mov %edx, ptr(%eax) */
+        emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, offsetof(struct PMC, data));
+        emitm_movl_r_m(interp, pc, emit_EDX, emit_EAX, 0, 1,
+                           offsetof(struct Parrot_UnManagedStruct_attributes, ptr));
+
+        /* reset EBP(4) */
+        emitm_lea_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, st_offset);
+        emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4);
+
+        /* XXX FIXME (TT #1325) emitm_call_cfunc(pc, set_nci_P); */
+        break;
+      case 'S':
+        emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 8);
+        /* XXX FIXME (TT #1325) emitm_call_cfunc(pc, set_nci_S); */
+        break;
+      case 't':   /* string */
+        /* EAX is char* */
+        emitm_movl_i_m(pc, 0, emit_EBP, 0, 1, temp_calls_offset + 8); /* len */
+
+        /* overwrites address of st in EBP(4) */
+        emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4);
+
+        emitm_call_cfunc(pc, Parrot_str_new);
+
+        emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 8);
+
+        /* reset EBP(4) */
+        emitm_lea_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, st_offset);
+        emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4);
+
+        /* XXX FIXME (TT #1325) emitm_call_cfunc(pc, set_nci_S); */
+        break;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_JIT_ERROR,
+                "Unknown return Signature %c\n", *sig);
+        /*
+         * oops unknown signature:
+         * cleanup and try nci.c
+         */
+        Parrot_str_free_cstring(signature_str);
+        mem_free_executable(execmem, JIT_ALLOC_SIZE);
+        return NULL;
+    }
+
+    /* free temporary strings */
+    strings_offset = st_offset + ST_SIZE_OF;
+    for (i=0; i<string_buffer_count; i++) {
+        emitm_movl_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, strings_offset);
+        emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 0);
+        emitm_call_cfunc(pc, Parrot_str_free_cstring);
+        strings_offset += 4;
+    }
+
+    jit_emit_stack_frame_leave(pc);
+    emitm_ret(pc);
+    PARROT_ASSERT(pc - execmem <= JIT_ALLOC_SIZE);
+
+    if (sizeptr)
+        *sizeptr = JIT_ALLOC_SIZE;
+    Parrot_str_free_cstring(signature_str);
+    return (void *)D2FPTR(execmem);
+}
+
+/*
+ * Local variables:
+ *   c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */

Added: branches/orderedhash_revamp/src/frame_builder.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/src/frame_builder.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,1368 @@
+/*
+ * Copyright (C) 2002-2009, Parrot Foundation.
+ */
+
+/*
+ * frame_builder.h
+ *
+ * i386
+ *
+ * $Id$
+ */
+
+#ifndef PARROT_I386_JIT_EMIT_H_GUARD
+#define PARROT_I386_JIT_EMIT_H_GUARD
+
+#if defined(__cplusplus)
+#  define EXTERN extern "C"
+#else
+#  define EXTERN
+#endif
+
+#include <assert.h>
+#include "parrot/parrot.h"
+#include "parrot/hash.h"
+#include "parrot/oplib/ops.h"
+
+/*
+ * NCI interface
+ */
+void *
+Parrot_jit_build_call_func(Interp *, PMC *, STRING *, int *);
+
+/* custom pmc callback functions */
+void
+Parrot_jit_free_buffer(PARROT_INTERP, void *ptr, void *priv);
+
+PMC*
+Parrot_jit_clone_buffer(PARROT_INTERP, PMC *pmc, void *priv);
+
+struct jit_buffer_private_data {
+    int size;
+};
+
+/* Scale factor values */
+#define emit_Scale(scale) ((scale) << 6)
+#define emit_Scale_1 emit_Scale(0)
+#define emit_Scale_2 emit_Scale(1)
+#define emit_Scale_4 emit_Scale(2)
+#define emit_Scale_8 emit_Scale(3)
+
+/* ESIB byte */
+#define emit_reg_Index(x) (((x)-1) << 3)
+#define emit_reg_Base(x) ((x)-1)
+#define emit_Index_None ((emit_b100) << 3)
+
+/*
+ * helper funcs - get argument n
+ */
+
+/*
+ * if we have a delegated method like typeof_i_p, that returns an INTVAL
+ * and that is all in a sequence of JITted opcodes, and when these INTVAL
+ * is MAPped, we got a problem. So the EXT_CALL flag is disabled - mapped
+ * registers are saved/restored around vtable calls.
+ */
+#define  JIT_VTABLE_OPS 1
+
+/* EXEC_SHARED generates code to be used with libparrot.so
+ * It grabs the real address of cgp_core from the gcc generated code
+ * x/1i cgp_code
+ *     jmp *0xXXXX
+ * x/1wx 0xXXXX
+ *     real address of cpg_core
+ * s. exec_emit_end
+ * XXX This should be a command line option.
+ */
+#undef EXEC_SHARED
+
+extern UINTVAL ld(UINTVAL);
+
+#define NEG_MINUS_ZERO
+/* #define NEG_ZERO_SUB */
+
+/* Register codes */
+#define emit_None 0
+
+/* These are + 1 the real values */
+#define emit_EAX 1
+#define emit_ECX 2
+#define emit_EDX 3
+#define emit_EBX 4
+#define emit_ESP 5
+#define emit_EBP 6
+#define emit_ESI 7
+#define emit_EDI 8
+
+/* Scratch register. */
+
+#define ISR1 emit_EAX
+#define FSR1 0
+
+#define emit_b00 0
+#define emit_b01 1
+#define emit_b10 2
+#define emit_b11 3
+
+#define emit_b000 0
+#define emit_b001 1
+#define emit_b010 2
+#define emit_b011 3
+#define emit_b100 4
+#define emit_b101 5
+#define emit_b110 6
+#define emit_b111 7
+
+/* Mod R/M byte */
+#define emit_reg(x) ((x) << 3)
+#define emit_Mod(Mod) ((Mod) << 6)
+#define emit_reg_rm(x) ((x)-1)
+
+/* Mod values for Mod R/M Byte */
+#define emit_Mod_b00 emit_Mod(emit_b00)
+#define emit_Mod_b01 emit_Mod(emit_b01)
+#define emit_Mod_b10 emit_Mod(emit_b10)
+
+/* special R/M values */
+#define emit_rm_b101 emit_b101
+#define emit_rm_b100 emit_b100
+
+#define emit_r_m(interp, pc, reg1, b, i, s, d) \
+    emit_r_X((interp), (pc), emit_reg((reg1)-1), (b), (i), (s), (d))
+
+#define emit_alu_X_r(X, reg) ((emit_b11 << 6) | ((X) << 3) | ((reg) - 1))
+
+#define emit_alu_r_r(reg1, reg2) emit_alu_X_r(((reg1) - 1), (reg2))
+
+int emit_is8bit(long disp);
+
+char * emit_disp8_32(char *pc, int disp);
+
+void emit_sib(PARROT_INTERP, char *pc, int scale, int i, int base);
+
+char * emit_r_X(PARROT_INTERP, char *pc, int reg_opcode, int base, int i,
+    int scale, long disp);
+
+char * emit_shift_i_r(PARROT_INTERP, char *pc, int opcode, int imm, int reg);
+
+char * emit_shift_i_m(PARROT_INTERP, char *pc, int opcode, int imm,
+               int base, int i, int scale, long disp);
+
+char * emit_shift_r_r(PARROT_INTERP, char *pc, int opcode, int reg1, int reg2);
+
+char * emit_shift_r_m(PARROT_INTERP, char *pc, int opcode, int reg,
+               int base, int i, int scale, long disp);
+
+/* CDQ - need this to do multiply */
+#define emitm_cdq(pc) *((pc)++) = (char) 0x99
+
+/* RET */
+#define emitm_ret(pc) *((pc)++) = (char) 0xc3
+
+/* NOP */
+#define emit_nop(pc) *((pc)++) = (char) 0x90
+
+/* PUSHes */
+
+#define emitm_pushl_r(pc, reg) \
+    *((pc)++) = (char) 0x50 | ((reg) - 1)
+
+#define emitm_pushl_i(pc, imm) { \
+    *((pc)++) = (char) 0x68; \
+    *(long *)(pc) = (long)(imm); \
+    (pc) += 4; }
+
+#define emitm_pushl_m(pc, mem) { \
+       *((pc)++) = (char) 0xff; \
+       *((pc)++) = (char) 0x35; \
+       *(long *)(pc) = (long)(mem); \
+       (pc) += 4; }
+
+char * emit_pushl_m(PARROT_INTERP, char *pc, int base, int i, int scale,
+    long disp);
+
+/* POPs */
+
+char * emit_popl_r(char *pc, int reg);
+
+#  define emitm_popl_r(pc, reg) \
+    (pc) = emit_popl_r((pc), (reg))
+
+char * emit_popl_m(PARROT_INTERP, char *pc, int base, int i, int scale,
+    long disp);
+
+/* MOVes */
+
+char * emit_movb_r_r(char *pc, int reg1, int reg2);
+
+#  define jit_emit_mov_rr_i(pc, reg2, reg1) if ((reg1) != (reg2)) { \
+    *((pc)++) = (char) 0x89; \
+    *((pc)++) = (char) emit_alu_r_r((reg1), (reg2)); }
+
+#  define jit_emit_mov_ri_i(interp, pc, reg, imm) { \
+    *((pc)++) = (char)(0xb8 | ((reg) - 1)); \
+    *(long *)(pc) = (long)(imm); (pc) += 4; }
+
+#  define emitm_movX_Y_Z(interp, op, pc, reg1, b, i, s, d) { \
+    *((pc)++) = (char) (op); \
+    (pc) = emit_r_m((interp), (pc), (reg1), (b), (i), (s), (long)(d)); }
+
+#  define emitm_movb_r_m(interp, pc, reg1, b, i, s, d) \
+    emitm_movX_Y_Z((interp), 0x88, (pc), (reg1), (b), (i), (s), (d))
+
+#  define emitm_movl_r_m(interp, pc, reg1, b, i, s, d) \
+    emitm_movX_Y_Z((interp), 0x89, (pc), (reg1), (b), (i), (s), (d))
+
+/* move byte/word with sign extension */
+#  define emitm_movsbl_r_m(interp, pc, reg1, b, i, s, d) { \
+    *((pc)++) = (char) 0x0f; \
+    emitm_movX_Y_Z((interp), 0xBE, (pc), (reg1), (b), (i), (s), (d)); \
+}
+
+#  define emitm_movswl_r_m(interp, pc, reg1, b, i, s, d) { \
+    *((pc)++) = (char) 0x0f; \
+    emitm_movX_Y_Z((interp), 0xBF, (pc), (reg1), (b), (i), (s), (d)); \
+}
+
+#  define emitm_movsbl_r_r(pc, reg1, reg2) { \
+    *((pc)++) = (char) 0x0f; \
+    *((pc)++) = (char) 0xbe; \
+    *((pc)++) = (char) emit_alu_r_r((reg1), (reg2)); \
+}
+
+#  define emitm_movswl_r_r(pc, reg1, reg2) { \
+    *((pc)++) = (char) 0x0f; \
+    *((pc)++) = (char) 0xbf; \
+    *((pc)++) = (char) emit_alu_r_r((reg1), (reg2)); \
+}
+
+#  define emitm_movb_m_r(interp, pc, reg1, b, i, s, d) \
+    emitm_movX_Y_Z((interp), 0x8a, (pc), (reg1), (b), (i), (s), (d))
+
+#  define emitm_movl_m_r(interp, pc, reg1, b, i, s, d) \
+    emitm_movX_Y_Z((interp), 0x8b, (pc), (reg1), (b), (i), (s), (d))
+
+#  define emitm_lea_m_r(interp, pc, reg1, b, i, s, d) \
+    emitm_movX_Y_Z((interp), 0x8d, (pc), (reg1), (b), (i), (s), (d))
+
+char * emit_movb_i_m(PARROT_INTERP, char *pc, char imm, int base, int i,
+    int scale, long disp);
+
+#  define emitm_movl_i_m(pc, imm, b, i, s, d) { \
+    *((pc)++) = (char) 0xc7; \
+    (pc) = emit_r_X((interp), (pc), emit_reg(emit_b000), (b), (i), (s), (long)(d)); \
+    *(long *)(pc) = (long)(imm); (pc) += 4; }
+
+/* Various ALU formats */
+
+#  define emitm_alul_r_r(pc, op, reg1, reg2) { \
+    *((pc)++) = (char) (op); *((pc)++) = (char) emit_alu_r_r((reg1), (reg2)); }
+
+#  define emitm_alub_i_r(pc, op1, op2, imm, reg) { \
+    *((pc)++) = (char) (op1); *((pc)++) = (char) emit_alu_X_r((op2), (reg)); *((pc)++) = (char)(imm); }
+
+#  define emitm_alul_i_r(pc, op1, op2, imm, reg) { \
+    *((pc)++) = (char) (op1); \
+    *((pc)++) = (char) emit_alu_X_r((op2), (reg)); \
+    *(long *)((pc)) = (long)(imm); (pc) += 4; }
+
+#  define emitm_alul_i_m(pc, op1, op2, imm, b, i, s, d) { \
+    *((pc)++) = (char) (op1); \
+    (pc) = emit_r_X((interp), (pc), emit_reg(op2), (b), (i), (s), (d)); \
+    *(long *)(pc) = (long)(imm); (pc) += 4; }
+
+#  define emitm_alul_r_m(pc, op, reg, b, i, s, d) { \
+    *((pc)++) = (char) (op); \
+    (pc) = emit_r_X((interp), (pc), emit_reg((reg)-1), (b), (i), (s), (long)(d)); }
+
+/* ADDs */
+
+#  define emitm_addb_r_r(pc, reg1, reg2) \
+    emitm_alul_r_r((pc), 0x00, (reg1), (reg2))
+
+#  define emitm_addb_i_r(pc, imm, reg) \
+    emitm_alub_i_r((pc), 0x83, emit_b000, (imm), (reg))
+
+#  define jit_emit_add_rr_i(interp, pc, reg1, reg2) \
+    emitm_alul_r_r((pc), 0x01, (reg2), (reg1))
+
+#  define jit_emit_add_ri_i(interp, pc, reg, imm)   \
+    emitm_alul_i_r((pc), 0x81, emit_b000, (imm), (reg))
+
+#  define emitm_addl_i_r(pc, imm, reg)   \
+    emitm_alul_i_r((pc), 0x81, emit_b000, (imm), (reg))
+
+#  define emitm_addl_i_m(pc, imm, b, i, s, d) \
+    emitm_alul_i_m((pc), 0x81, emit_b000, (imm), (b), (i), (s), (d))
+
+#  define emitm_addl_r_m(pc, reg, b, i, s, d) \
+    emitm_alul_r_m((pc), 0x01, (reg), (b), (i), (s), (d))
+
+#  define emitm_addl_m_r(pc, reg, b, i, s, d) \
+    emitm_alul_r_m((pc), 0x03, (reg), (b), (i), (s), (d))
+
+/* SUBs */
+
+#  define jit_emit_sub_rr_i(interp, pc, reg1, reg2) \
+    emitm_alul_r_r((pc), 0x29, (reg2), (reg1))
+
+#  define emitm_subl_i_r(pc, imm, reg) \
+    emitm_alul_i_r((pc), 0x81, emit_b101, (imm), (reg))
+
+#  define jit_emit_sub_ri_i(interp, pc, r, i) emitm_subl_i_r((pc), (i), (r))
+
+#  define emitm_subl_r_m(pc, reg, b, i, s, d) \
+    emitm_alul_r_m((pc), 0x29, (reg), (b), (i), (s), (d))
+
+#  define emitm_subl_m_r(pc, reg, b, i, s, d) \
+    emitm_alul_r_m((pc), 0x2b, (reg), (b), (i), (s), (d))
+
+#  define emitm_subl_i_m(pc, imm, b, i, s, d) \
+    emitm_alul_i_m((pc), 0x81, emit_b101, (imm), (b), (i), (s), (d))
+
+/* These are used by both signed and unsigned EDIV, but only unsigned MUL */
+#  define emitm_alu_imp_r(pc, op, reg) { \
+    *((pc)++) = (char) 0xf7; \
+    *((pc)++) = (char) emit_alu_X_r((op), (reg)); }
+
+#  define emitm_alu_imp_m(pc, op, b, i, s, d) { \
+    *((pc)++) = (char) 0xf7; \
+    (pc) = emit_r_X((interp), (pc), emit_reg(op), (b), (i), (s), (d)); }
+
+/* Unsigned MUL and EDIV */
+/* EAX implicit destination in multiply and divide */
+
+#  define emitm_umull_r(pc, reg2) emitm_alu_imp_r((pc), emit_b100, (reg2))
+
+#  define emitm_udivl_r(pc, reg2) emitm_alu_imp_r((pc), emit_b110, (reg2))
+
+#  define emitm_umull_m(pc, b, i, s, d) \
+    emitm_alu_imp_m((pc), emit_b100, (b), (i), (s), (d))
+
+#  define emitm_udivl_m(pc, b, i, s, d) \
+    emitm_alu_imp_m((pc), emit_b110, (b), (i), (s), (d))
+
+/* Signed MUL and EDIV */
+
+#  define emitm_sdivl_r(pc, reg2) emitm_alu_imp_r((pc), emit_b111, (reg2))
+
+#  define emitm_sdivl_m(pc, b, i, s, d) \
+    emitm_alu_imp_m((pc), emit_b111, (b), (i), (s), (d))
+
+#  define jit_emit_cdq(pc) *(pc)++ = 0x99
+
+/* TEST for zero */
+#  define jit_emit_test_r_i(pc, reg1) emitm_alul_r_r((pc), 0x85, (reg1), (reg1))
+
+#  define emitm_smull_r(pc, reg2) emitm_alu_imp_r((pc), emit_b101, (reg2))
+
+#  define jit_emit_mul_rr_i(interp, pc, reg1, reg2) { \
+    *(pc)++ = 0xf; \
+    emitm_alul_r_r((pc), 0xaf, (reg1), (reg2)); }
+
+#  define emitm_smull_r_m(pc, reg1, b, i, s, d) { \
+    *(pc)++ = 0xf; \
+    emitm_alul_r_m((pc), 0xaf, (reg1), (b), (i), (s), (d)); }
+
+char * opt_mul(PARROT_INTERP, char *pc, int dest, INTVAL imm, int src);
+
+#  define jit_emit_mul_rir_i(pc, dest, imm, src) \
+       (pc) = opt_mul(interp, (pc), (dest), (imm), (src))
+
+
+#  define jit_emit_mul_ri_i(pc, r, imm) jit_emit_mul_rir_i((pc), (r), (imm), (r))
+
+#  define jit_emit_mul_RIM_ii(pc, reg, imm, ofs) \
+    emitm_alul_r_m((pc), 0x69, (reg), emit_EBX, emit_None, 1, (ofs)); \
+    *(long *)(pc) = (long)(imm); \
+    (pc) += 4;
+
+/* NEG */
+
+#  define jit_emit_neg_r_i(pc, reg) emitm_alu_imp_r((pc), emit_b011, (reg))
+
+#  define emitm_negl_m(pc, b, i, s, d) \
+    emitm_alu_imp_m((pc), emit_b011, (b), (i), (s), (d))
+
+/* AND */
+
+#  define emit_andl_r_r(pc, reg1, reg2) emitm_alul_r_r((pc), 0x21, (reg1), (reg2))
+#  define jit_emit_band_rr_i(interp, pc, r1, r2) emit_andl_r_r((pc), (r2), (r1))
+
+#  define jit_emit_band_ri_i(interp, pc, reg, imm)  \
+    emitm_alul_i_r((pc), 0x81, emit_b100, (imm), (reg))
+
+#  define emitm_andl_r_m(pc, reg, b, i, s, d) \
+    emitm_alul_r_m((pc), 0x21, (reg), (b), (i), (s), (d))
+
+#  define emitm_andl_m_r(pc, reg, b, i, s, d) \
+    emitm_alul_r_m((pc), 0x23, (reg), (b), (i), (s), (d))
+
+#  define emitm_andl_i_m(pc, imm, b, i, s, d) \
+    emitm_alul_i_m((pc), 0x81, emit_b100, (imm), (b), (i), (s), (d))
+
+/* TEST op */
+#  define jit_emit_test_rr_i(pc, r1, r2) emitm_alul_r_r((pc), 0x85, (r1), (r2))
+
+#  define jit_emit_test_ri_i(pc, r, im)  \
+           emitm_alul_i_r((pc), 0xF7, emit_b000, (im), (r))
+
+#  define jit_emit_test_RM_i(pc, r, offs)  \
+           emitm_alul_r_m((pc), 0x85, (r), emit_EBX, 0, 1, (offs))
+
+/* OR */
+
+#  define jit_emit_bor_rr_i(interp, pc, reg1, reg2) emitm_alul_r_r((pc), 0x9, (reg2), (reg1))
+
+#  define jit_emit_bor_ri_i(interp, pc, reg, imm) \
+    emitm_alul_i_r((pc), 0x81, emit_b001, (imm), (reg))
+
+#  define emitm_orl_r_m(pc, reg, b, i, s, d) \
+    emitm_alul_r_m((pc), 0x09, (reg), (b), (i), (s), (d))
+
+#  define emitm_orl_m_r(pc, reg, b, i, s, d) \
+    emitm_alul_r_m((pc), 0x0b, (reg), (b), (i), (s), (d))
+
+#  define emitm_orl_i_m(pc, imm, b, i, s, d) \
+    emitm_alul_i_m((pc), 0x81, emit_b001, (imm), (b), (i), (s), (d))
+
+/* XOR */
+
+#  define jit_emit_bxor_rr_i(interp, pc, reg1, reg2) \
+    emitm_alul_r_r((pc), 0x31, (reg2), (reg1))
+
+#  define jit_emit_bxor_ri_i(intepr, pc, reg, imm) \
+    emitm_alul_i_r((pc), 0x81, emit_b110, (imm), (reg))
+
+#  define emitm_xorl_r_m(pc, reg, b, i, s, d) \
+    emitm_alul_r_m((pc), 0x31, (reg), (b), (i), (s), (d))
+
+#  define emitm_xorl_m_r(pc, reg, b, i, s, d) \
+    emitm_alul_r_m((pc), 0x33, (reg), (b), (i), (s), (d))
+
+#  define emitm_xorl_i_m(pc, imm, b, i, s, d) \
+    emitm_alul_i_m((pc), 0x81, emit_b110, (imm), (b), (i), (s), (d))
+
+/* NOT */
+
+#  define jit_emit_not_r_i(pc, reg) emitm_alu_imp_r((pc), emit_b010, (reg))
+#  define emitm_notl_m(pc, b, i, s, d) \
+    emitm_alu_imp_m((pc), emit_b010, (b), (i), (s), (d))
+
+#  define jit_emit_not_M_i(interp, pc, offs) emitm_notl_m((pc), emit_EBX, 0, 1, (offs))
+
+/* XCHG */
+#  define jit_emit_xchg_rr_i(interp, pc, r1, r2) { \
+    if ((r1) != (r2)) { \
+    *((pc)++) = (char) 0x87; \
+    *((pc)++) = (char) emit_alu_r_r((r1), (r2)); \
+    } \
+}
+
+#  define jit_emit_xchg_rm_i(pc, r, m) { \
+    emitm_alul_r_m((pc), 0x87, (r), emit_None, emit_None, emit_None, (m)) \
+}
+#  define jit_emit_xchg_RM_i(interp, pc, r, offs) { \
+    emitm_alul_r_m((pc), 0x87, (r), emit_EBX, emit_None, 1, (offs)) \
+}
+#  define jit_emit_xchg_MR_i(interp, pc, offs, r) jit_emit_xchg_RM_i((interp), (pc), (r), (offs))
+
+/* SHL */
+
+#  define jit_emit_shl_ri_i(interp, pc, reg, imm) \
+    { (pc) = emit_shift_i_r((interp), (pc), emit_b100, (imm), (reg)); }
+
+#  define emitm_shll_i_m(pc, imm, b, i, s, d) \
+    { (pc) = emit_shift_i_m((pc), emit_b100, (imm), (b), (i), (s), (d)); }
+
+#  define emitm_shll_r_r(interp, pc, reg1, reg2) \
+    { (pc) = emit_shift_r_r((interp), (pc), emit_b100, (reg1), (reg2)); }
+
+#  define emitm_shll_r_m(pc, reg, b, i, s, d) \
+    { (pc) = emit_shift_r_m((pc), emit_b100, (reg), (b), (i), (s), (d)); }
+
+/* SHR */
+
+#  define jit_emit_lsr_ri_i(interp, pc, reg, imm) \
+    { (pc) = emit_shift_i_r((interp), (pc), emit_b101, (imm), (reg)); }
+
+#  define emitm_shrl_i_m(pc, imm, b, i, s, d) \
+    { (pc) = emit_shift_i_m((pc), emit_b101, (imm), (b), (i), (s), (d)); }
+
+#  define emitm_shrl_r_r(interp, pc, reg1, reg2) \
+    { (pc) = emit_shift_r_r((interp), (pc), emit_b101, (reg1), (reg2)); }
+
+#  define emitm_shrl_r_m(pc, reg, b, i, s, d) \
+    { (pc) = emit_shift_r_m((pc), emit_b101, (reg), (b), (i), (s), (d)); }
+
+/* SAL */
+
+#  define emitm_sall_i_r(interp, pc, imm, reg) \
+    { (pc) = emit_shift_i_r((interp), (pc), emit_b100, (imm), (reg)); }
+
+#  define emitm_sall_i_m(pc, imm, b, i, s, d) \
+    { (pc) = emit_shift_i_m((pc), emit_b100, (imm), (b), (i), (s), (d)); }
+
+#  define emitm_sall_r_r(interp, pc, reg1, reg2) \
+    { (pc) = emit_shift_r_r((interp), (pc), emit_b100, (reg1), (reg2)); }
+
+#  define emitm_sall_r_m(pc, reg, b, i, s, d) \
+    { (pc) = emit_shift_r_m((pc), emit_b100, (reg), (b), (i), (s), (d)); }
+
+/* SAR */
+
+#  define jit_emit_shr_ri_i(interp, pc, reg, imm) \
+    { (pc) = emit_shift_i_r((interp), (pc), emit_b111, (imm), (reg)); }
+
+
+#  define emitm_sarl_i_m(pc, imm, b, i, s, d) \
+    { (pc) = emit_shift_i_m((pc), emit_b111, (imm), (b), (i), (s), (d)); }
+
+#  define emitm_sarl_r_r(interp, pc, reg1, reg2) \
+    { (pc) = emit_shift_r_r((interp), (pc), emit_b111, (reg1), (reg2)); }
+
+#  define emitm_sarl_r_m(pc, reg, b, i, s, d) \
+    { (pc) = emit_shift_r_m((pc), emit_b111, (reg), (b), (i), (s), (d)); }
+
+/* rotate */
+
+#  define jit_emit_rol_ri_i(interp, pc, reg, imm) \
+    { (pc) = emit_shift_i_r((interp), (pc), emit_b000, (imm), (reg)); }
+
+#  define jit_emit_ror_ri_i(interp, pc, reg, imm) \
+    { (pc) = emit_shift_i_r((interp), (pc), emit_b001, (imm), (reg)); }
+
+/* interface, shift r1 by r2 bits */
+
+#  define jit_emit_shl_rr_i(interp, pc, r1, r2) \
+    (pc) = opt_shift_rr((interp), jit_info, (r1), (r2), emit_b100)
+
+#  define jit_emit_shl_RM_i(interp, pc, r1, offs)  \
+    (pc) = opt_shift_rm((interp), jit_info, (r1), (offs), emit_b100)
+
+/* shr seems to be the arithmetic shift */
+#  define jit_emit_shr_rr_i(interp, pc, r1, r2)  \
+    (pc) = opt_shift_rr((interp), jit_info, (r1), (r2), emit_b111)
+
+#  define jit_emit_shr_RM_i(interp, pc, r1, offs)  \
+    (pc) = opt_shift_rm((interp), jit_info, (r1), (offs), emit_b111)
+
+#  define jit_emit_lsr_rr_i(interp, pc, r1, r2)  \
+    (pc) = opt_shift_rr((interp), jit_info, (r1), (r2), emit_b101)
+
+#  define jit_emit_lsr_RM_i(interp, pc, r1, offs)  \
+    (pc) = opt_shift_rm((interp), jit_info, (r1), (offs), emit_b101)
+
+/* MOV (reg), reg */
+#  define emit_movm_r_r(pc, src, dest) \
+    *((pc)++) = (char) 0x8b; \
+    *((pc)++) = (char) (src) | (dest) << 3
+
+/* MOV X(reg), reg */
+#  define emit_movb_i_r_r(pc, imm, src, dest) \
+    *((pc)++) = (char)(0x8b); \
+    *((p)c++) = (char)(0x40 | ((src) - 1) | ((dest) - 1) << 3); \
+    *((pc)++) = (imm)
+
+/* INC / DEC */
+#  define jit_emit_inc_r_i(pc, reg) *((pc)++) = (char)(0x40 | ((reg) - 1))
+#  define jit_emit_dec_r_i(pc, reg) *((pc)++) = (char)(0x48 | ((reg) - 1))
+
+/* Floating point ops */
+
+#  define emitm_floatop 0xd8  /* 11011000 */
+#  define jit_emit_dec_fsp(pc) { *((pc)++) = (char) 0xD9; *((pc)++) = (char) 0xF6; }
+#  define jit_emit_inc_fsp(pc) { *((pc)++) = (char) 0xD9; *((pc)++) = (char) 0xF7; }
+
+#  define emitm_fl_2(interp, pc, mf, opa, opb, b, i, s, d) { \
+    *((pc)++) = (char)(emitm_floatop | ((mf) << 1) | (opa)); \
+    (pc) = emit_r_X((interp), (pc), emit_reg(opb), (b), (i), (s), (long)(d)); }
+
+#  define emitm_fl_3(pc, d_p_opa, opb_r, sti) { \
+    *((pc)++) = (char)(emitm_floatop | (d_p_opa)); \
+    *((pc)++) = (char)(0xc0 | ((opb_r) << 3) | (sti)); }
+
+#  define emitm_fl_4(pc, op) { \
+    *((pc)++) = (char)(emitm_floatop | emit_b001); \
+    *((pc)++) = (char)(0xe0 | (op)); }
+
+/* Integer loads and stores */
+#  define emitm_fildl(interp, pc, b, i, s, d) \
+    emitm_fl_2((interp), (pc), emit_b01, 1, emit_b000, (b), (i), (s), (d))
+
+#  define emitm_fistpl(interp, pc, b, i, s, d) \
+    emitm_fl_2((interp), (pc), emit_b01, 1, emit_b011, (b), (i), (s), (d))
+
+#  define emitm_fistl(interp, pc, b, i, s, d) \
+    emitm_fl_2((interp), (pc), emit_b01, 1, emit_b010, (b), (i), (s), (d))
+
+/* long long integer load/store */
+#  define emitm_fildll(interp, pc, b, i, s, d) \
+    emitm_fl_2((interp), (pc), emit_b11, 1, emit_b101, (b), (i), (s), (d))
+
+#  define emitm_fistpll(interp, pc, b, i, s, d) \
+    emitm_fl_2((interp), (pc), emit_b11, 1, emit_b111, (b), (i), (s), (d))
+
+/* Double loads and stores */
+#  define emitm_fldl(interp, pc, b, i, s, d) \
+    emitm_fl_2((interp), (pc), emit_b10, 1, emit_b000, (b), (i), (s), (d))
+
+#  define emitm_fstpl(interp, pc, b, i, s, d) \
+    emitm_fl_2((interp), (pc), emit_b10, 1, emit_b011, (b), (i), (s), (d))
+
+#  define emitm_fstl(interp, pc, b, i, s, d) \
+    emitm_fl_2((interp), (pc), emit_b10, 1, emit_b010, (b), (i), (s), (d))
+
+/* long double load / store */
+#  define emitm_fldt(interp, pc, b, i, s, d) \
+    emitm_fl_2((interp), (pc), emit_b01, 1, emit_b101, (b), (i), (s), (d))
+
+#  define emitm_fstpt(interp, pc, b, i, s, d) \
+    emitm_fl_2((interp), (pc), emit_b01, 1, emit_b111, (b), (i), (s), (d))
+
+/* short float load / store */
+#  define emitm_flds(interp, pc, b, i, s, d) \
+    emitm_fl_2((interp), (pc), emit_b00, 1, emit_b000, (b), (i), (s), (d))
+
+#  define emitm_fstps(interp, pc, b, i, s, d) \
+    emitm_fl_2((interp), (pc), emit_b00, 1, emit_b010, (b), (i), (s), (d))
+
+#if NUMVAL_SIZE == 8
+
+#  define jit_emit_fload_m_n(interp, pc, address) \
+      emitm_fldl((interp), (pc), emit_None, emit_None, emit_None, (address))
+
+#  define jit_emit_fload_mb_n(interp, pc, base, offs) \
+      emitm_fldl((interp), (pc), (base), emit_None, 1, (offs))
+
+#  define jit_emit_fstore_m_n(interp, pc, address) \
+      emitm_fstpl((interp), (pc), emit_None, emit_None, emit_None, (address))
+
+#  define jit_emit_fstore_mb_n(interp, pc, base, offs) \
+      emitm_fstpl((interp), (pc), (base), emit_None, 1, (offs))
+
+#  define jit_emit_fst_mb_n(interp, pc, base, offs) \
+      emitm_fstl((interp), (pc), (base), emit_None, 1, (offs))
+
+#else /* NUMVAL_SIZE */
+
+#  define jit_emit_fload_m_n(interp, pc, address) \
+      emitm_fldt((interp), (pc), emit_None, emit_None, emit_None, (address))
+
+#  define jit_emit_fload_mb_n(interp, pc, base, offs) \
+      emitm_fldt((interp), (pc), (base), emit_None, 1, (offs))
+
+#  define jit_emit_fstore_m_n(pc, address) \
+      emitm_fstpt((interp), (pc), emit_None, emit_None, emit_None, (address))
+
+#  define jit_emit_fstore_mb_n(interp, pc, base, offs) \
+      emitm_fstpt((interp), (pc), (base), emit_None, 1, (offs))
+
+#  define jit_emit_fst_mb_n(interp, pc, base, offs) \
+      emitm_fstt((interp), (pc), (base), emit_None, 1, (offs))
+
+#endif /* NUMVAL_SIZE */
+
+#if INTVAL_SIZE == 4
+
+#  define jit_emit_fload_m_i(interp, pc, address) \
+      emitm_fildl((interp), (pc), emit_None, emit_None, emit_None, (address))
+#  define jit_emit_fload_mb_i(interp, pc, offs) \
+      emitm_fildl((interp), (pc), emit_EBX, emit_None, 1, (offs))
+#  define jit_emit_fstore_m_i(pc, m) \
+      emitm_fistpl((pc), emit_None, emit_None, emit_None, (m))
+
+#else /* INTVAL_SIZE */
+
+#  define jit_emit_fload_m_i(interp, pc, address) \
+      emitm_fildll((interp), (pc), emit_None, emit_None, emit_None, (address))
+#  define jit_emit_fload_mb_i(interp, pc, offs) \
+      emitm_fildll((interp), (pc), emit_EBX, emit_None, 1, (offs))
+#  define jit_emit_fstore_m_i(pc, m) \
+      emitm_fistpll((pc), emit_None, emit_None, emit_None, (m))
+
+#endif /* INTVAL_SIZE */
+
+/* 0xD8 ops */
+#  define emitm_fadd(pc, sti) emitm_fl_3((pc), emit_b000, emit_b000, (sti))
+#  define emitm_fmul(pc, sti) emitm_fl_3((pc), emit_b000, emit_b001, (sti))
+#  define emitm_fsub(pc, sti) emitm_fl_3((pc), emit_b000, emit_b100, (sti))
+#  define emitm_fdiv(pc, sti) emitm_fl_3((pc), emit_b000, emit_b110, (sti))
+
+/* 0xD9 ops */
+#  define emitm_fldz(pc)  { *((pc)++) = (char) 0xd9; *((pc)++) = (char) 0xee; }
+#  define emitm_fld1(pc)  { *((pc)++) = (char) 0xd9; *((pc)++) = (char) 0xe8; }
+#  define emitm_fsqrt(pc) { *((pc)++) = (char) 0xd9; *((pc)++) = (char) 0xfa; }
+#  define emitm_fsin(pc)  { *((pc)++) = (char) 0xd9; *((pc)++) = (char) 0xfe; }
+#  define emitm_fcos(pc)  { *((pc)++) = (char) 0xd9; *((pc)++) = (char) 0xff; }
+#  define emitm_fxam(pc)  { *((pc)++) = (char) 0xd9; *((pc)++) = (char) 0xe5; }
+
+/* FXCH ST, ST(i) , optimize 2 consecutive fxch with same reg */
+#  define emitm_fxch(pc, sti) { \
+    emitm_fl_3((pc), emit_b001, emit_b001, (sti)); \
+}
+
+/* FLD ST, ST(i), optimized FSTP(N+1);FLD(N) => FST(N+1)  */
+extern unsigned char *lastpc;
+#  define emitm_fld(pc, sti) do { \
+     if ((unsigned char *)(pc) == (lastpc + 2) && \
+       (int)(*lastpc) == (int)0xDD && \
+       (int)lastpc[1] == (int)(0xD8+(sti)+1)) \
+       lastpc[1] = 0xD0+(sti)+1; \
+     else \
+       emitm_fl_3((pc), emit_b001, emit_b000, (sti)); \
+  } while (0)
+
+/* 0xDA, 0xDB ops */
+/* FCMOV*, FCOMI PPRO */
+
+/* 0xDC like 0xD8 with reversed operands */
+#  define emitm_faddr(pc, sti) emitm_fl_3((pc), emit_b100, emit_b000, (sti))
+#  define emitm_fmulr(pc, sti) emitm_fl_3((pc), emit_b100, emit_b001, (sti))
+#  define emitm_fsubr(pc, sti) emitm_fl_3((pc), emit_b100, emit_b100, (sti))
+
+/* 0xDD ops */
+/* FFree ST(i) */
+#  define emitm_ffree(pc, sti) emitm_fl_3((pc), emit_b101, emit_b000, (sti))
+
+/* FST ST(i) = ST */
+#  define emitm_fst(pc, sti) emitm_fl_3((pc), emit_b101, emit_b010, (sti))
+
+/* FSTP ST(i) = ST, POP */
+#  define emitm_fstp(pc, sti) { \
+    lastpc = (unsigned char*) (pc); \
+    emitm_fl_3((pc), emit_b101, emit_b011, (sti)); \
+}
+
+/* FUCOM ST(i) <=> ST  unordered compares */
+#  define emitm_fucom(pc, sti) emitm_fl_3((pc), emit_b101, emit_b100, (sti))
+
+/* FUCOMP ST(i) <=> ST, POP */
+#  define emitm_fucomp(pc, sti) emitm_fl_3((pc), emit_b101, emit_b101, (sti))
+
+/* 0xDE ops */
+/* FADDP Add ST(i) = ST + ST(i); POP  */
+#  define emitm_faddp(pc, sti) emitm_fl_3((pc), emit_b110, emit_b000, (sti))
+
+/* FMULP Mul ST(i) = ST * ST(i); POP  */
+#  define emitm_fmulp(pc, sti) emitm_fl_3((pc), emit_b110, emit_b001, (sti))
+
+/* FSUB ST = ST - ST(i) */
+
+/* FSUBRP SubR ST(i) = ST - ST(i); POP  */
+#  define emitm_fsubrp(pc, sti) emitm_fl_3((pc), emit_b110, emit_b100, (sti))
+
+/* FSUBP Sub ST(i) = ST(i) - ST; POP  */
+#  define emitm_fsubp(pc, sti) emitm_fl_3((pc), emit_b110, emit_b101, (sti))
+
+/* FDIVRP DivR ST(i) = ST(i) / ST(0); POP  */
+#  define emitm_fdivrp(pc, sti) emitm_fl_3((pc), emit_b110, emit_b110, (sti))
+
+/* FDIVP Div ST(i) = ST(0) / ST(i); POP ST(0) */
+#  define emitm_fdivp(pc, sti) emitm_fl_3((pc), emit_b110, emit_b111, (sti))
+
+/* 0xDF OPS: FCOMIP, FUCOMIP PPRO */
+
+/* Negate - called change sign */
+#  define emitm_fchs(pc) emitm_fl_4((pc), 0)
+
+/* ABS - ST(0) = ABS(ST(0)) */
+#  define emitm_fabs(pc) emitm_fl_4((pc), 1)
+
+/* Comparisons */
+
+#  define emitm_fcom(pc, sti) emitm_fl_3((pc), emit_b000, emit_b010, (sti))
+
+#  define emitm_fcomp(pc, sti) emitm_fl_3((pc), emit_b000, emit_b011, (sti))
+
+#ifdef PARROT_HAS_JIT_FCOMIP
+#  define emitm_fcomip(pc, sti) emitm_fl_3((pc), emit_b111, emit_b110, (sti))
+#  define emitm_fcomi(pc, sti) emitm_fl_3((pc), emit_b011, emit_b110, (sti))
+#else
+#  define emitm_fcomip(pc, sti) do { \
+      emitm_fcomp((pc), (sti)); \
+      emitm_fstw(pc); \
+      emitm_sahf(pc); \
+    } while (0)
+#  define emitm_fcomi(pc, sti) do { \
+      emitm_fcom((pc), (sti)); \
+      emitm_fstw(pc); \
+      emitm_sahf(pc); \
+    } while (0)
+#endif
+
+#  define emitm_fcompp(pc) { *((pc)++) = (char) 0xde; *((pc)++) = (char) 0xd9; }
+
+#  define emitm_fcom_m(interp, pc, b, i, s, d) \
+    emitm_fl_2((interp), (pc), emit_b10, 0, emit_b010, (b), (i), (s), (d))
+
+#  define emitm_fcomp_m(interp, pc, b, i, s, d) \
+    emitm_fl_2((interp), (pc), emit_b10, 0, emit_b011, (b), (i), (s), (d))
+
+/* ST -= real64 */
+#  define emitm_fsub_m(interp, pc, b, i, s, d) \
+    emitm_fl_2((interp), (pc), emit_b10, 0, emit_b100, (b), (i), (s), (d))
+
+/* ST -= int32_mem */
+#  define emitm_fisub_m(interp, pc, b, i, s, d) \
+    emitm_fl_2((interp), (pc), emit_b01, 0, emit_b100, (b), (i), (s), (d))
+
+#  define emitm_fadd_m(interp, pc, b, i, s, d) \
+    emitm_fl_2((interp), (pc), emit_b10, 0, emit_b000, (b), (i), (s), (d))
+
+/* ST += int32_mem */
+#  define emitm_fiadd_m(interp, pc, b, i, s, d) \
+    emitm_fl_2((interp), (pc), emit_b01, 0, emit_b000, (b), (i), (s), (d))
+
+/* ST *= real64 */
+#  define emitm_fmul_m(interp, pc, b, i, s, d) \
+    emitm_fl_2((interp), (pc), emit_b10, 0, emit_b001, (b), (i), (s), (d))
+
+/* ST *= int32_mem */
+#  define emitm_fimul_m(interp, pc, b, i, s, d) \
+    emitm_fl_2((interp), (pc), emit_b01, 0, emit_b001, (b), (i), (s), (d))
+
+/* ST /= real64 */
+#  define emitm_fdiv_m(interp, pc, b, i, s, d) \
+    emitm_fl_2((interp), (pc), emit_b10, 0, emit_b110, (b), (i), (s), (d))
+
+/* ST /= int32_mem */
+#  define emitm_fidiv_m(interp, pc, b, i, s, d) \
+    emitm_fl_2((interp), (pc), emit_b01, 0, emit_b110, (b), (i), (s), (d))
+
+/* Ops Needed to support loading EFLAGs for conditional branches */
+#  define emitm_fstw(pc) emitm_fl_3((pc), emit_b111, emit_b100, emit_b000)
+
+#  define emitm_sahf(pc) *((pc)++) = (char) 0x9e
+
+/* misc float */
+#  define emitm_ftst(pc) { *(pc)++ = 0xd9; *(pc)++ = 0xE4; }
+#  define emitm_fprem(pc) { *(pc)++ = 0xd9; *(pc)++ = 0xF8; }
+#  define emitm_fprem1(pc) { *(pc)++ = 0xd9; *(pc)++ = 0xF5; }
+
+#  define emitm_fldcw(interp, pc, mem) \
+    emitm_fl_2((interp), (pc), emit_b00, 1, emit_b101, 0, 0, 0, (mem))
+
+#if defined(NEG_MINUS_ZERO)
+#  define jit_emit_neg_r_n(pc, r) { \
+       if (r) { \
+         emitm_fld((pc), (r)); \
+       } \
+       emitm_fchs(pc); \
+       if (r) { \
+         emitm_fstp((pc), ((r)+1)); \
+       } \
+     }
+
+#  define jit_emit_neg_M_n(interp, pc, mem) { \
+       jit_emit_fload_mb_n((interp), (pc), emit_EBX, (mem)); \
+       emitm_fchs(pc); \
+       jit_emit_fstore_mb_n((interp), (pc), emit_EBX, (mem)); \
+     }
+
+#elif defined(NEG_ZERO_SUB)
+
+#  define jit_emit_neg_r_n(pc, r) { \
+       emitm_fldz(pc); \
+       emitm_fsubrp((pc), ((r)+1)); \
+     }
+
+#  define jit_emit_neg_M_n(interp, pc, mem) { \
+       jit_emit_fload_mb_n((interp), (pc), emit_EBX, (mem)); \
+       emitm_fldz(pc); \
+       emitm_fsubrp((pc), 1); \
+       jit_emit_fstore_mb_n((interp), (pc), emit_EBX, (mem)); \
+     }
+#else
+
+#  define jit_emit_neg_r_n(pc, r) { \
+       if (r) { \
+         emitm_fld((pc), (r)); \
+       } \
+       emitm_ftst(pc); \
+       emitm_fstw(pc); \
+       emitm_sahf(pc); \
+       emitm_jxs((pc), emitm_jz, 2); \
+       emitm_fchs(pc); \
+       if (r) { \
+         emitm_fstp((pc), ((r)+1)); \
+       } \
+     }
+
+#  define jit_emit_neg_M_n(interp, pc, mem) { \
+       jit_emit_fload_mb_n((interp), (pc), emit_EBX, (mem)); \
+       emitm_ftst(pc); \
+       emitm_fstw(pc); \
+       emitm_sahf(pc); \
+       emitm_jxs((pc), emitm_jz, 2); \
+       emitm_fchs(pc); \
+       jit_emit_fstore_mb_n((interp), (pc), emit_EBX, (mem)); \
+     }
+#endif
+
+#  define jit_emit_sin_r_n(pc, r) \
+     if (r) { \
+       emitm_fld((pc), (r)); \
+     } \
+     emitm_fsin(pc); \
+     if (r) { \
+       emitm_fstp((pc), ((r)+1)); \
+     }
+
+#  define jit_emit_cos_r_n(pc, r) \
+     if (r) { \
+       emitm_fld((pc), (r)); \
+     } \
+     emitm_fcos(pc); \
+     if (r) { \
+       emitm_fstp((pc), ((r)+1)); \
+     }
+
+#  define jit_emit_sqrt_r_n(pc, r) \
+     if (r) { \
+       emitm_fld((pc), (r)); \
+     } \
+     emitm_fsqrt(pc); \
+     if (r) { \
+       emitm_fstp((pc), ((r)+1)); \
+     }
+
+#  define jit_emit_abs_r_n(pc, r) { \
+     if (r) { \
+       emitm_fld((pc), (r)); \
+     } \
+     emitm_fabs(pc); \
+     if (r) { \
+       emitm_fstp((pc), ((r)+1)); \
+     } \
+   }
+
+#  define jit_emit_abs_r_i(pc, r) { \
+     jit_emit_test_r_i((pc), (r)); \
+     emitm_jxs((pc), emitm_jns, 3); \
+     jit_emit_not_r_i((pc), (r)); \
+     jit_emit_inc_r_i((pc), (r)); \
+   }
+
+#  define jit_emit_abs_m_n(interp, pc, mem) { \
+     jit_emit_fload_m_n((interp), (pc), (mem)); \
+     emitm_fabs(pc); \
+     jit_emit_fstore_m_n((pc), (mem)); \
+   }
+
+/* Integer comparisons */
+#  define jit_emit_cmp_rr(pc, reg1, reg2) \
+    emitm_alul_r_r((pc), 0x39, (reg2), (reg1))
+#  define jit_emit_cmp_rr_i(pc, r1, r2) jit_emit_cmp_rr((pc), (r1), (r2))
+
+#  define emitm_cmpl_r_m(pc, reg, b, i, s, d) \
+    emitm_alul_r_m((pc), 0x3b, (reg), (b), (i), (s), (d))
+
+#  define emitm_cmpl_m_r(pc, reg, b, i, s, d) \
+    emitm_alul_r_m((pc), 0x39, (reg), (b), (i), (s), (d))
+
+#  define jit_emit_cmp_ri_i(interp, pc, reg, imm) \
+    emitm_alul_i_r((pc), 0x81, emit_b111, (imm), (reg))
+
+/* Unconditional Jump/Call */
+
+#  define emitm_call_cfunc(pc, func) emitm_calll((pc), (char *)(func) - (pc) - 4)
+
+#  define emitm_calll(pc, disp) { \
+    *((pc)++) = (char) 0xe8; \
+    *(long *)(pc) = (disp); (pc) += 4; }
+
+#  define emitm_callr(pc, reg) { \
+    *((pc)++) = (char) 0xff; \
+    *((pc)++) = (char) 0xd0 | ((reg) - 1); }
+
+#  define emitm_callm(pc, b, i, s, d) { \
+       *((pc)++) = (char) 0xff; \
+       (pc) = emit_r_X((interp), (pc), emit_reg(emit_b010), (b), (i), (s), (d)); }
+
+#  define emitm_jumps(pc, disp) { \
+    *((pc)++) = (char) 0xeb; \
+    *((pc)++) = (disp); }
+
+#  define emitm_jumpl(pc, disp) { \
+    *((pc)++) = (char) 0xe9; \
+    *(long *)(pc) = (disp); (pc) += 4; }
+
+#  define emitm_jumpr(pc, reg) { \
+    *((pc)++) = (char) 0xff; \
+    *((pc)++) = (char)(0xe0 | ((reg) - 1)); }
+
+#  define emitm_jumpm(pc, b, i, s, d) { \
+       *((pc)++) = (char) 0xff; \
+       (pc) = emit_r_X((interp), (pc), emit_reg(emit_b100), (b), (i), (s), (d)); }
+
+/* Conditional jumps */
+
+/* Short jump - 8 bit disp */
+#  define emitm_jxs(pc, code, disp) { \
+    *((pc)++) = (char)(0x70 | (code)); \
+    *((pc)++) = (char)(disp); }
+
+/* Long jump - 32 bit disp */
+#  define emitm_jxl(pc, code, disp) { \
+    *((pc)++) = (char) 0x0f; \
+    *((pc)++) = (char)(0x80 | (code));  \
+    *(long *)(pc) = (disp); (pc) += 4; }
+
+#  define emitm_jo   0
+#  define emitm_jno  1
+#  define emitm_jb   2
+#  define emitm_jnb  3
+#  define emitm_jz   4
+#  define emitm_je emitm_jz
+#  define emitm_jnz  5
+#  define emitm_jne emitm_jnz
+#  define emitm_jbe  6
+#  define emitm_ja   7
+#  define emitm_js   8
+#  define emitm_jns  9
+#  define emitm_jp  10
+#  define emitm_jnp 11
+#  define emitm_jl  12
+#  define emitm_jnl 13
+#  define emitm_jle 14
+#  define emitm_jg  15
+
+/* set byte conditional */
+#  define jit_emit_setcc_r(pc, cc, r) \
+    *(pc)++ = 0x0f; \
+    *(pc)++ = 0x90 + (cc); \
+    *(pc)++ = (char) emit_alu_X_r(0, (r))
+
+/*
+ * core.jit interface
+ *
+ * The new offset based versions have uppercase RM or MR inside
+ * That's probably only during transition time
+ */
+
+#  define jit_emit_mov_mi_i(pc, dest, immediate) \
+    emitm_movl_i_m((pc), (immediate), emit_None, emit_None, emit_None, (dest))
+
+#  define jit_emit_mov_MI_i(interp, pc, offs, immediate) \
+    emitm_movl_i_m((pc), (immediate), emit_EBX, emit_None, 1, (offs))
+
+#  define jit_emit_mov_rm_i(interp, pc, reg, address) \
+    emitm_movl_m_r((interp), (pc), (reg), emit_None, emit_None, emit_None, (address))
+
+#  define jit_emit_mov_RM_i(interp, pc, reg, offs) \
+    emitm_movl_m_r((interp), (pc), (reg), emit_EBX, emit_None, 1, (offs))
+
+#  define jit_emit_mov_mr_i(interp, pc, address, reg) \
+    emitm_movl_r_m((interp), (pc), (reg), emit_None, emit_None, emit_None, (address))
+
+#  define jit_emit_mov_MR_i(interp, pc, offs, reg) \
+    emitm_movl_r_m((interp), (pc), (reg), emit_EBX, emit_None, 1, (offs))
+
+#  define jit_emit_mul_RM_i(interp, pc, reg, offs) \
+    emitm_smull_r_m((pc), (reg), emit_EBX, emit_None, 1, (offs))
+
+#  define jit_emit_sub_RM_i(interp, pc, reg, offs) \
+    emitm_subl_m_r((pc), (reg), emit_EBX, emit_None, 1, (offs))
+
+#  define jit_emit_sub_MR_i(interp, pc, offs, reg) \
+    emitm_subl_r_m((pc), (reg), emit_EBX, emit_None, 1, (offs))
+
+#  define jit_emit_sub_MI_i(pc, offs, imm) \
+    emitm_subl_i_m((pc), (imm), emit_EBX, emit_None, 1, (offs))
+
+#  define jit_emit_add_RM_i(interp, pc, reg, offs) \
+    emitm_addl_m_r((pc), (reg), emit_EBX, emit_None, 1, (offs))
+
+#  define jit_emit_add_MR_i(interp, pc, offs, reg) \
+    emitm_addl_r_m((pc), (reg), emit_EBX, emit_None, 1, (offs))
+
+#  define jit_emit_add_MI_i(pc, offs, imm) \
+    emitm_addl_i_m((pc), (imm), emit_EBX, emit_None, 1, (offs))
+
+#  define jit_emit_cmp_rm_i(pc, reg, address) \
+    emitm_cmpl_r_m((pc), (reg), emit_None, emit_None, emit_None, (address))
+
+#  define jit_emit_cmp_RM_i(interp, pc, reg, offs) \
+    emitm_cmpl_r_m((pc), (reg), emit_EBX, emit_None, 1, (offs))
+
+#  define jit_emit_cmp_MR_i(interp, pc, offs, reg) \
+    emitm_cmpl_m_r((pc), (reg), emit_EBX, emit_None, 1, (offs))
+
+/* high level routines, behave like real 2 register FP */
+
+/* mapped float registers numbers are ST(1)-ST(4).
+ * scratch register is ST(0)
+ */
+
+/* ST(i) <- numvar */
+#  define jit_emit_mov_RM_n(interp, pc, r, d) { \
+    jit_emit_fload_mb_n((interp), (pc), emit_EBX, (d)); \
+    emitm_fstp((pc), ((r)+1)); \
+}
+
+/* ST(i) <= NUM_CONST */
+#  define jit_emit_mov_ri_n(interp, pc, r, i) { \
+    jit_emit_fload_m_n((interp), (pc), (i)); \
+    emitm_fstp((pc), ((r)+1)); \
+}
+
+/* ST(i) <= &INT_CONST */
+#  define jit_emit_mov_ri_ni(interp, pc, r, i) { \
+    jit_emit_fload_m_i((interp), (pc), (i)); \
+    emitm_fstp((pc), ((r)+1)); \
+}
+
+/* ST(i) <= INT_REG */
+#  define jit_emit_mov_RM_ni(interp, pc, r, i) { \
+    jit_emit_fload_mb_i((interp), (pc), (i)); \
+    emitm_fstp((pc), ((r)+1)); \
+}
+
+/* NUM_REG(i) <= &INT_CONST
+ * the int const i is loaded from the code memory
+ */
+#  define jit_emit_mov_MI_ni(interp, pc, offs, i) { \
+    jit_emit_fload_m_i((interp), (pc), (i)); \
+    jit_emit_fstore_mb_n((interp), (pc), emit_EBX, (offs)); \
+}
+
+/* INT_REG <= ST(i) */
+#  define jit_emit_mov_mr_in(pc, mem, r) { \
+    emitm_fld((pc), (r)); \
+    jit_emit_fstore_m_i((pc), (mem)); \
+}
+
+/* numvar <- ST(i) */
+#  define jit_emit_mov_mr_n(pc, d, r) { \
+    emitm_fld((pc), (r)); \
+    jit_emit_fstore_m_n((pc), (d)); \
+}
+
+#  define jit_emit_mov_MR_n(interp, pc, d, r) { \
+    if (r) { \
+        emitm_fld((pc), (r)); \
+        jit_emit_fstore_mb_n((interp), (pc), emit_EBX, (d)); \
+    } \
+    else { \
+        jit_emit_fst_mb_n((interp), (pc), emit_EBX, (d)); \
+    } \
+}
+
+/* ST(r1) <= ST(r2) */
+#  define jit_emit_mov_rr_n(pc, r1, r2) { \
+    if ((r1) != (r2)) { \
+      if (r2) { \
+        emitm_fld((pc), (r2)); \
+        emitm_fstp((pc), ((r1)+1)); \
+      } \
+      else { \
+        emitm_fst((pc), (r1)); \
+      } \
+    } \
+}
+
+/* ST(r1) xchg ST(r2) */
+#  define jit_emit_xchg_rr_n(interp, pc, r1, r2) { \
+    if ((r1) != (r2)) { \
+      emitm_fld((pc), (r1)); \
+      emitm_fld((pc), ((r2)+1)); \
+      emitm_fstp((pc), ((r1)+2)); \
+      emitm_fstp((pc), ((r2)+1)); \
+    } \
+}
+
+#  define jit_emit_xchg_RM_n(interp, pc, r, offs) { \
+    emitm_fld((pc), (r)); \
+    jit_emit_fload_mb_n((interp), (pc), emit_EBX, (offs)); \
+    emitm_fstp((pc), ((r)+2)); \
+    jit_emit_fstore_mb_n((interp), (pc), emit_EBX, (offs)); \
+}
+
+#  define jit_emit_xchg_MR_n(interp, pc, offs, r) { \
+    emitm_fld((pc), (r)); \
+    jit_emit_fload_mb_n((interp), (pc), emit_EBX, (offs)); \
+    emitm_fstp((pc), ((r)+2)); \
+    jit_emit_fstore_mb_n((interp), (pc), emit_EBX, (offs)); \
+}
+
+#  define jit_emit_finit(pc) { *((pc)++) = (char) 0xdb; *((pc)++) = (char) 0xe3; }
+
+/* ST(i) op= MEM */
+
+#  define jit_emit_xxx_rm_n(interp, op, pc, r, m) { \
+    jit_emit_fload_m_n((interp), (pc), (m)); \
+    emitm_f ## op ## p((pc), ((r)+1)); \
+}
+
+#  define jit_emit_xxx_RM_n(interp, op, pc, r, offs) { \
+    jit_emit_fload_mb_n((interp), (pc), emit_EBX, (offs)); \
+    emitm_f ## op ## p((pc), ((r)+1)); \
+}
+
+/*
+ * float ops in two flavors: abs memory for constants, offsets for regs
+ */
+
+#  define jit_emit_add_ri_n(interp, pc, r, m) jit_emit_xxx_rm_n((interp), add, (pc), (r), (m))
+#  define jit_emit_sub_ri_n(interp, pc, r, m) jit_emit_xxx_rm_n((interp), sub, (pc), (r), (m))
+#  define jit_emit_mul_ri_n(interp, pc, r, m) jit_emit_xxx_rm_n((interp), mul, (pc), (r), (m))
+
+#  define jit_emit_add_RM_n(interp, pc, r, o) jit_emit_xxx_RM_n((interp), add, (pc), (r), (o))
+#  define jit_emit_sub_RM_n(interp, pc, r, o) jit_emit_xxx_RM_n((interp), sub, (pc), (r), (o))
+#  define jit_emit_mul_RM_n(interp, pc, r, o) jit_emit_xxx_RM_n((interp), mul, (pc), (r), (o))
+
+/* ST(r1) += ST(r2) */
+/* r1 == 0:  ST(0) <- ST(0) + ST(i)
+ * r2 == 0:  ST(i) <- ST(0) + ST(i)
+ */
+#  define jit_emit_add_rr_n(interp, pc, r1, r2) do { \
+        if (!(r1)) { \
+          emitm_fadd((pc), (r2)); \
+        }  \
+        else if (!(r2)) { \
+          emitm_faddr((pc), (r1)); \
+        }  \
+        else { \
+            emitm_fld((pc), (r2)); \
+            emitm_faddp((pc), ((r1)+1)); \
+        } \
+    } \
+    while (0)
+/*
+ * ST(r) += INT_REG
+ */
+#  define jit_emit_add_RM_ni(pc, r, offs) { \
+    emitm_fld((pc), (r)); \
+    emitm_fiadd_m((pc), emit_EBX, 0, 1, (offs)); \
+    emitm_fstp((pc), ((r)+1)); \
+}
+
+/* ST(r1) -= ST(r2) */
+/* r1 == 0:  ST(0) <- ST(0) - ST(i)
+ * r2 == 0:  ST(i) <- ST(i) - ST(0)
+ */
+#  define jit_emit_sub_rr_n(interp, pc, r1, r2) do { \
+        if (!(r1)) { \
+          emitm_fsub((pc), (r2)); \
+        }  \
+        else if (!(r2)) { \
+          emitm_fsubr((pc), (r1)); \
+        }  \
+        else { \
+            emitm_fld((pc), (r2)); \
+            emitm_fsubp((pc), ((r1)+1)); \
+        } \
+    } \
+    while (0)
+
+/*
+ * ST(r) -= INT_REG
+ */
+#  define jit_emit_sub_RM_ni(pc, r, offs) { \
+    emitm_fld((pc), (r)); \
+    emitm_fisub_m((pc), emit_EBX, 0, 1, (offs)); \
+    emitm_fstp((pc), ((r)+1)); \
+}
+
+#  define jit_emit_inc_r_n(pc, r) { \
+    emitm_fld1(pc); \
+    emitm_faddp((pc), ((r)+1)); \
+}
+
+#  define jit_emit_dec_r_n(pc, r) { \
+    emitm_fld1(pc); \
+    emitm_fsubp((pc), ((r)+1)); \
+}
+
+/* ST(r1) *= ST(r2) */
+/* r1 == 0:  ST(0) <- ST(0) * ST(i)
+ * r2 == 0:  ST(i) <- ST(0) * ST(i)
+ */
+#  define jit_emit_mul_rr_n(interp, pc, r1, r2) do { \
+        if (!(r1)) { \
+          emitm_fmul((pc), (r2)); \
+        }  \
+        else if (!(r2)) { \
+          emitm_fmulr((pc), (r1)); \
+        }  \
+        else { \
+            emitm_fld((pc), (r2)); \
+            emitm_fmulp((pc), ((r1)+1)); \
+        } \
+    } \
+    while (0)
+
+/*
+ * ST(r) *= INT_REG
+ */
+#  define jit_emit_mul_RM_ni(pc, r, offs) { \
+    emitm_fld((pc), (r)); \
+    emitm_fimul_m((pc), emit_EBX, 0, 1, (offs)); \
+    emitm_fstp((pc), ((r)+1)); \
+}
+
+/*
+ * ST(r) /= INT_REG
+ */
+#  define jit_emit_div_RM_ni(pc, r, offs) { \
+    emitm_fld((pc), (r)); \
+    emitm_fidiv_m((pc), emit_EBX, 0, 1, (offs)); \
+    emitm_fstp((pc), ((r)+1)); \
+}
+
+/* test r for zero */
+#  define jit_emit_test_r_n(pc, r) { \
+    if (r) { \
+      emitm_fxch((pc), (r)); \
+    } \
+    emitm_fxam(pc); \
+    emitm_fstw(pc); \
+    emitm_sahf(pc); \
+    if (r) { \
+      emitm_fxch((pc), (r)); \
+    } \
+}
+
+enum { JIT_X86BRANCH, JIT_X86JUMP, JIT_X86CALL };
+
+#  define jit_emit_stack_frame_enter(pc) do { \
+    emitm_pushl_r((pc), emit_EBP); \
+    jit_emit_mov_rr_i((pc), emit_EBP, emit_ESP); \
+} while (0)
+
+#  define jit_emit_stack_frame_leave(pc) do { \
+    jit_emit_mov_rr_i((pc), emit_ESP, emit_EBP); \
+    emitm_popl_r((pc), emit_EBP); \
+} while (0)
+
+#  define jit_emit_end(pc) { \
+       jit_emit_add_ri_i((interp), (pc), emit_ESP, 4); \
+       emitm_popl_r((pc), emit_EDI); \
+       emitm_popl_r((pc), emit_ESI); \
+       emitm_popl_r((pc), emit_EBX); \
+       emitm_popl_r((pc), emit_EBP); \
+       emitm_ret(pc); \
+     }
+
+size_t calc_signature_needs(const char *sig, int *strings);
+
+void * Parrot_jit_build_call_func(PARROT_INTERP, PMC *pmc_nci,
+    STRING *signature, int *sizeptr);
+
+/*
+ * register usage
+ * %edi, %esi ... mapped, preserved
+ * %edx, %ecx ... mapped, not preserved
+ * %ebx       ... base pointer for register access, preserved
+ * %eax       ... scratch, return value register
+ */
+
+#endif /* PARROT_I386_JIT_EMIT_H_GUARD */
+
+/*
+ * Local variables:
+ *   c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */

Modified: branches/orderedhash_revamp/src/gc/alloc_memory.c
==============================================================================
--- branches/orderedhash_revamp/src/gc/alloc_memory.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/gc/alloc_memory.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -24,6 +24,15 @@
 #include "parrot/parrot.h"
 #include "parrot/memory.h"
 
+PARROT_DOES_NOT_RETURN
+static void failed_allocation(unsigned int line, unsigned long size) /* HEADERIZER SKIP */
+{
+    fprintf(stderr, "Failed allocation of %lu bytes\n", size);
+    do_panic(NULL, "Out of mem", __FILE__, line);
+}
+
+#define PANIC_OUT_OF_MEM(size) failed_allocation(__LINE__, (size))
+
 /* HEADERIZER HFILE: include/parrot/memory.h */
 
 /*
@@ -49,7 +58,7 @@
     fprintf(stderr, "Allocated %i at %p\n", size, ptr);
 #endif
     if (!ptr)
-        PANIC(NULL, "Out of mem");
+        PANIC_OUT_OF_MEM(size);
     return ptr;
 }
 
@@ -80,7 +89,7 @@
     UNUSED(line);
 #endif
     if (!ptr)
-        PANIC(NULL, "Out of mem");
+        PANIC_OUT_OF_MEM(size);
     return ptr;
 }
 
@@ -107,7 +116,7 @@
     fprintf(stderr, "Allocated %i at %p\n", size, ptr);
 #endif
     if (!ptr)
-        PANIC(NULL, "Out of mem");
+        PANIC_OUT_OF_MEM(size);
     return ptr;
 }
 
@@ -139,7 +148,7 @@
     UNUSED(line);
 #endif
     if (!ptr)
-        PANIC(NULL, "Out of mem");
+        PANIC_OUT_OF_MEM(size);
     return ptr;
 }
 
@@ -174,7 +183,7 @@
     fprintf(stderr, "Allocated %i at %p\n", size, ptr);
 #endif
     if (!ptr)
-         PANIC(NULL, "Out of mem");
+        PANIC_OUT_OF_MEM(size);
     return ptr;
 }
 
@@ -207,7 +216,7 @@
     fprintf(stderr, "Allocated %i at %p\n", size, ptr);
 #endif
     if (!ptr)
-         PANIC(NULL, "Out of mem");
+        PANIC_OUT_OF_MEM(size);
 
     if (size > old_size)
         memset((char*)ptr + old_size, 0, size - old_size);
@@ -247,7 +256,7 @@
     UNUSED(line);
 #endif
     if (!ptr)
-        PANIC(NULL, "Out of mem");
+        PANIC_OUT_OF_MEM(size);
     return ptr;
 }
 
@@ -285,7 +294,7 @@
     UNUSED(line);
 #  endif
     if (!ptr)
-        PANIC(NULL, "Out of mem");
+        PANIC_OUT_OF_MEM(size);
     if (size > old_size)
         memset((char*)ptr + old_size, 0, size - old_size);
 

Deleted: branches/orderedhash_revamp/src/gc/alloc_register.c
==============================================================================
--- branches/orderedhash_revamp/src/gc/alloc_register.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,814 +0,0 @@
-/*
-Copyright (C) 2001-2009, Parrot Foundation.
-$Id$
-
-=head1 NAME
-
-src/gc/register.c - Register handling routines
-
-=head1 DESCRIPTION
-
-Parrot has 4 register sets, one for each of its basic types. The number of
-registers in each set varies depending on the use counts of the subroutine and
-is determined by the PASM/PIR compiler in the register allocation pass
-(F<imcc/reg_alloc.c>).
-
-=cut
-
-*/
-
-#include "parrot/parrot.h"
-#include "parrot/register.h"
-#include "../pmc/pmc_sub.h"
-
-
-/* set CTX_LEAK_DEBUG_FULL to 1 for enhanced context debugging.
- * When set (1) freed contexts are "poisoned" so that any dangling
- * references produce segfaults, and (2) contexts are not recycled
- * so that later allocations don't suddenly restore a dangling
- * reference to a "working" condition.
- */
-#define CTX_LEAK_DEBUG_FULL 0
-
-
-
-/* HEADERIZER HFILE: include/parrot/register.h */
-
-/* HEADERIZER BEGIN: static */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-
-static void clear_regs(PARROT_INTERP, ARGMOD(Parrot_Context *ctx))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*ctx);
-
-static void init_context(PARROT_INTERP,
-    ARGMOD(Parrot_Context *ctx),
-    ARGIN_NULLOK(const Parrot_Context *old))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*ctx);
-
-#define ASSERT_ARGS_clear_regs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ctx)
-#define ASSERT_ARGS_init_context __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ctx)
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: static */
-
-
-/*
-=head2 Context and register frame layout
-
-    +----------++----+------+------------+----+
-    | context  || N  |  I   |   P        |  S +
-    +----------++----+------+------------+----+
-    ^          ^     ^                   ^
-    |          |     ctx.bp              ctx.bp_ps
-    ctx.state  opt
-               padding
-
-Registers are addressed as usual via the register base pointer ctx.bp.
-
-The macro CONTEXT() hides these details
-
-=cut
-
-*/
-
-/*
-=head2 Context and register frame allocation
-
-There are two allocation strategies: chunked memory and malloced with a free
-list.
-
- CHUNKED_CTX_MEM = 1
-
-C<ctx_mem.data> is a pointer to an allocated chunk of memory.  The pointer
-C<ctx_mem.free> holds the next usable location. With (full) continuations the
-C<ctx_mem.free> pointer can't be moved below the C<ctx_mem.threshold>, which is
-the highest context pointer of all active continuations.
-
-[the code for this is incomplete; it had suffered some bit-rot and was
-getting in the way of maintaining the other case.  -- rgr, 4-Feb-06.]
-
-RT #46177 GC has to lower this threshold when collecting continuations.
-
- CHUNKED_CTX_MEM = 0
-
-Context/register memory is malloced. C<ctx_mem.free> is used as a free list of
-reusable items.
-
-=cut
-
-*/
-
-#define CTX_ALLOC_SIZE 0x20000
-
-#define ALIGNED_CTX_SIZE (((sizeof (Parrot_Context) + NUMVAL_SIZE - 1) \
-        / NUMVAL_SIZE) * NUMVAL_SIZE)
-
-/*
-
-=pod
-
-Round register allocation size up to the nearest multiple of 8. A granularity
-of 8 is arbitrary, it could have been some bigger power of 2. A "slot" is an
-index into the free_list array. Each slot in free_list has a linked list of
-pointers to already allocated contexts available for (re)use.  The slot where
-an available context is stored corresponds to the size of the context.
-
-=cut
-
-*/
-
-#define SLOT_CHUNK_SIZE 8
-
-#define ROUND_ALLOC_SIZE(size) ((((size) + SLOT_CHUNK_SIZE - 1) \
-        / SLOT_CHUNK_SIZE) * SLOT_CHUNK_SIZE)
-#define CALCULATE_SLOT_NUM(size) ((size) / SLOT_CHUNK_SIZE)
-
-#if CHUNKED_CTX_MEM
- #  error "Non-working code removed."
-#endif
-
-/*
-
-=head2 Context and Register Allocation Functions
-
-=over 4
-
-=cut
-
-*/
-
-/*
-
-=item C<void destroy_context(PARROT_INTERP)>
-
-Frees allocated context memory.
-
-=cut
-
-*/
-
-void
-destroy_context(PARROT_INTERP)
-{
-    ASSERT_ARGS(destroy_context)
-    Parrot_Context *context = CONTEXT(interp);
-    int             slot;
-
-    while (context) {
-        Parrot_Context * const prev = context->caller_ctx;
-
-        /* always collect the parentmost context in the parentmost interp*/
-        if (!prev && !interp->parent_interpreter)
-            context->ref_count = 1;
-
-        Parrot_free_context(interp, context, 1);
-
-        context = prev;
-    }
-
-    /* clear freed contexts */
-    for (slot = 0; slot < interp->ctx_mem.n_free_slots; ++slot) {
-        void *ptr = interp->ctx_mem.free_list[slot];
-        while (ptr) {
-            void * const next = *(void **) ptr;
-            mem_sys_free(ptr);
-            ptr = next;
-        }
-        interp->ctx_mem.free_list[slot] = NULL;
-    }
-    mem_sys_free(interp->ctx_mem.free_list);
-}
-
-
-/*
-
-=item C<void create_initial_context(PARROT_INTERP)>
-
-Creates the interpreter's initial context.
-
-=cut
-
-*/
-
-void
-create_initial_context(PARROT_INTERP)
-{
-    ASSERT_ARGS(create_initial_context)
-    static INTVAL   num_regs[] = {32, 32, 32, 32};
-    Parrot_Context *ignored;
-
-    /* Create some initial free_list slots. */
-
-#define INITIAL_FREE_SLOTS 8
-    interp->ctx_mem.n_free_slots = INITIAL_FREE_SLOTS;
-    interp->ctx_mem.free_list    = mem_allocate_n_zeroed_typed(INITIAL_FREE_SLOTS, void *);
-
-    /* For now create context with 32 regs each. Some src tests (and maybe
-     * other extenders) assume the presence of these registers */
-    ignored = Parrot_set_new_context(interp, num_regs);
-    UNUSED(ignored);
-}
-
-
-/*
-
-=item C<void parrot_gc_context(PARROT_INTERP)>
-
-Cleans up dead context memory; called by the garbage collector.  This only
-applies in the chunked context memory scheme.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-parrot_gc_context(PARROT_INTERP)
-{
-    ASSERT_ARGS(parrot_gc_context)
-#if CHUNKED_CTX_MEM
-    Parrot_Context ctx;
-    ASSERT_ARGS(parrot_gc_context)
-
-    if (!interp->ctx_mem.threshold)
-        return;
-    LVALUE_CAST(char *, ctx.bp) = interp->ctx_mem.threshold
-                                - sizeof (parrot_regs_t);
-#else
-    UNUSED(interp);
-#endif
-}
-
-
-/*
-
-=item C<static void clear_regs(PARROT_INTERP, Parrot_Context *ctx)>
-
-Clears all registers in a context.  PMC and STRING registers contain PMCNULL
-and NULL, respectively.  Integer and float registers contain negative flag
-values, for debugging purposes.
-
-=cut
-
-*/
-
-static void
-clear_regs(PARROT_INTERP, ARGMOD(Parrot_Context *ctx))
-{
-    ASSERT_ARGS(clear_regs)
-    int i;
-
-    /* NULL out registers - P/S have to be NULL for GC
-     *
-     * if the architecture has 0x := NULL and 0.0 we could memset too
-     */
-
-    for (i = 0; i < ctx->n_regs_used[REGNO_PMC]; i++) {
-        CTX_REG_PMC(ctx, i) = PMCNULL;
-    }
-
-    for (i = 0; i < ctx->n_regs_used[REGNO_STR]; i++) {
-        CTX_REG_STR(ctx, i) = NULL;
-    }
-
-    if (Interp_debug_TEST(interp, PARROT_REG_DEBUG_FLAG)) {
-        /* depending on -D40 we set int and num to be identifiable garbage values */
-        for (i = 0; i < ctx->n_regs_used[REGNO_INT]; i++) {
-            CTX_REG_INT(ctx, i) = -999;
-        }
-        for (i = 0; i < ctx->n_regs_used[REGNO_NUM]; i++) {
-            CTX_REG_NUM(ctx, i) = -99.9;
-        }
-    }
-}
-
-
-/*
-
-=item C<static void init_context(PARROT_INTERP, Parrot_Context *ctx, const
-Parrot_Context *old)>
-
-Initializes a freshly allocated or recycled context.
-
-=cut
-
-*/
-
-static void
-init_context(PARROT_INTERP, ARGMOD(Parrot_Context *ctx),
-        ARGIN_NULLOK(const Parrot_Context *old))
-{
-    ASSERT_ARGS(init_context)
-    ctx->ref_count         = 0;
-    ctx->gc_mark           = 0;
-    ctx->current_results   = NULL;
-    ctx->results_signature = NULL;
-    ctx->lex_pad           = PMCNULL;
-    ctx->outer_ctx         = NULL;
-    ctx->current_cont      = NULL;
-    ctx->current_object    = NULL;
-    ctx->handlers          = PMCNULL;
-    ctx->caller_ctx        = NULL;
-
-    if (old) {
-        /* some items should better be COW copied */
-        ctx->constants         = old->constants;
-        ctx->warns             = old->warns;
-        ctx->errors            = old->errors;
-        ctx->trace_flags       = old->trace_flags;
-        ctx->pred_offset       = old->pred_offset;
-        ctx->current_HLL       = old->current_HLL;
-        ctx->current_namespace = old->current_namespace;
-        /* end COW */
-        ctx->recursion_depth   = old->recursion_depth;
-    }
-    else {
-        ctx->constants         = NULL;
-        ctx->warns             = 0;
-        ctx->errors            = 0;
-        ctx->trace_flags       = 0;
-        ctx->pred_offset       = 0;
-        ctx->current_HLL       = 0;
-        ctx->current_namespace = PMCNULL;
-        ctx->recursion_depth   = 0;
-    }
-
-    /* other stuff is set inside Sub.invoke */
-    clear_regs(interp, ctx);
-}
-
-
-/*
-
-=item C<Parrot_Context * Parrot_push_context(PARROT_INTERP, const INTVAL
-*n_regs_used)>
-
-Creates and sets the current context to a new context, remembering the old
-context in C<caller_ctx>.  Suitable to use with C<Parrot_pop_context>.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-Parrot_Context *
-Parrot_push_context(PARROT_INTERP, ARGIN(const INTVAL *n_regs_used))
-{
-    ASSERT_ARGS(Parrot_push_context)
-    Parrot_Context * const old = CONTEXT(interp);
-    Parrot_Context * const ctx = Parrot_set_new_context(interp, n_regs_used);
-
-    ctx->caller_ctx  = old;
-
-    /* doesn't change */
-    ctx->current_sub = old->current_sub;
-
-    /* copy more ? */
-    return ctx;
-}
-
-
-/*
-
-=item C<void Parrot_pop_context(PARROT_INTERP)>
-
-Frees the context created with C<Parrot_push_context> and restores the previous
-context (the caller context).
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-Parrot_pop_context(PARROT_INTERP)
-{
-    ASSERT_ARGS(Parrot_pop_context)
-    Parrot_Context * const ctx = CONTEXT(interp);
-    Parrot_Context * const old = ctx->caller_ctx;
-
-#if CTX_LEAK_DEBUG
-    if (ctx->ref_count > 0 &&
-            Interp_debug_TEST(interp, PARROT_CTX_DESTROY_DEBUG_FLAG)) {
-        fprintf(stderr, "[force recycle of context %p (%d refs)]\n",
-            (void *)ctx, ctx->ref_count);
-    }
-#endif
-    ctx->ref_count = 0;
-    Parrot_free_context(interp, ctx, 0);
-
-    /* restore old, set cached interpreter base pointers */
-    CONTEXT(interp)      = old;
-    interp->ctx.bp       = old->bp;
-    interp->ctx.bp_ps    = old->bp_ps;
-}
-
-
-/*
-
-=item C<Parrot_Context * Parrot_alloc_context(PARROT_INTERP, const INTVAL
-*number_regs_used, Parrot_Context *old)>
-
-Allocates and returns a new context.  Does not set this new context as the
-current context. Note that the register usage C<n_regs_used> is copied.  Use
-the init flag to indicate whether you want to initialize the new context
-(setting its default values and clearing its registers).
-
-=cut
-
-*/
-
-PARROT_CANNOT_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-Parrot_Context *
-Parrot_alloc_context(PARROT_INTERP, ARGIN(const INTVAL *number_regs_used),
-    ARGIN_NULLOK(Parrot_Context *old))
-{
-    ASSERT_ARGS(Parrot_alloc_context)
-    Parrot_Context *ctx;
-    void *p;
-
-    const size_t size_i = sizeof (INTVAL)   * number_regs_used[REGNO_INT];
-    const size_t size_n = sizeof (FLOATVAL) * number_regs_used[REGNO_NUM];
-    const size_t size_s = sizeof (STRING *) * number_regs_used[REGNO_STR];
-    const size_t size_p = sizeof (PMC *)    * number_regs_used[REGNO_PMC];
-
-    const size_t size_nip      = size_n + size_i + size_p;
-    const size_t all_regs_size = size_n + size_i + size_p + size_s;
-    const size_t reg_alloc     = ROUND_ALLOC_SIZE(all_regs_size);
-    const int    slot          = CALCULATE_SLOT_NUM(reg_alloc);
-
-    /*
-     * If slot is beyond the end of the allocated list, extend the list to
-     * allocate more slots.
-     */
-    if (slot >= interp->ctx_mem.n_free_slots) {
-        const int extend_size = slot + 1;
-        int i;
-
-        mem_realloc_n_typed(interp->ctx_mem.free_list, extend_size, void *);
-        for (i = interp->ctx_mem.n_free_slots; i < extend_size; ++i)
-            interp->ctx_mem.free_list[i] = NULL;
-        interp->ctx_mem.n_free_slots = extend_size;
-    }
-
-    /*
-     * The free_list contains a linked list of pointers for each size (slot
-     * index). Pop off an available context of the desired size from free_list.
-     * If no contexts of the desired size are available, allocate a new one.
-     */
-    ctx = (Parrot_Context *)interp->ctx_mem.free_list[slot];
-
-    if (ctx) {
-        /*
-         * Store the next pointer from the linked list for this size (slot
-         * index) in free_list. On "*(void **) ctx", C won't dereference a void
-         * * pointer (untyped), so type cast ctx to void ** (a dereference-able
-         * type) then dereference it to get a void *. Store the dereferenced
-         * value (the next pointer in the linked list) in free_list.
-         */
-        interp->ctx_mem.free_list[slot] = *(void **)ctx;
-    }
-    else {
-        const size_t to_alloc = reg_alloc + ALIGNED_CTX_SIZE;
-        ctx                   = (Parrot_Context *)mem_sys_allocate(to_alloc);
-    }
-
-    ctx->n_regs_used[REGNO_INT] = number_regs_used[REGNO_INT];
-    ctx->n_regs_used[REGNO_NUM] = number_regs_used[REGNO_NUM];
-    ctx->n_regs_used[REGNO_STR] = number_regs_used[REGNO_STR];
-    ctx->n_regs_used[REGNO_PMC] = number_regs_used[REGNO_PMC];
-
-#if CTX_LEAK_DEBUG
-    if (Interp_debug_TEST(interp, PARROT_CTX_DESTROY_DEBUG_FLAG)) {
-        fprintf(stderr, "[alloc ctx %p]\n", ctx);
-    }
-#endif
-
-    ctx->regs_mem_size = reg_alloc;
-
-    /* regs start past the context */
-    p   = (void *) ((char *)ctx + ALIGNED_CTX_SIZE);
-
-    /* ctx.bp points to I0, which has Nx on the left */
-    ctx->bp.regs_i = (INTVAL *)((char *)p + size_n);
-
-    /* ctx.bp_ps points to S0, which has Px on the left */
-    ctx->bp_ps.regs_s = (STRING **)((char *)p + size_nip);
-
-    init_context(interp, ctx, old);
-
-    return ctx;
-}
-
-
-/*
-
-=item C<Parrot_Context * Parrot_set_new_context(PARROT_INTERP, const INTVAL
-*number_regs_used)>
-
-Allocates and returns a new context as the current context.  Note that the
-register usage C<n_regs_used> is copied.
-
-=cut
-
-*/
-
-PARROT_CANNOT_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-Parrot_Context *
-Parrot_set_new_context(PARROT_INTERP, ARGIN(const INTVAL *number_regs_used))
-{
-    ASSERT_ARGS(Parrot_set_new_context)
-    Parrot_Context *old = CONTEXT(interp);
-    Parrot_Context *ctx = Parrot_alloc_context(interp, number_regs_used, old);
-
-    CONTEXT(interp)          = ctx;
-    interp->ctx.bp.regs_i    = ctx->bp.regs_i;
-    interp->ctx.bp_ps.regs_s = ctx->bp_ps.regs_s;
-
-    return ctx;
-}
-
-
-/*
-
-=item C<void Parrot_free_context(PARROT_INTERP, Parrot_Context *ctx, int deref)>
-
-Frees the context if its reference count is zero.  If C<deref>
-is true, then reduce the reference count prior to determining
-if the context should be freed.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-Parrot_free_context(PARROT_INTERP, ARGMOD(Parrot_Context *ctx), int deref)
-{
-    ASSERT_ARGS(Parrot_free_context)
-    /*
-     * The context structure has a reference count, initially 0.
-     * This field is incremented when something outside of the normal
-     * calling chain (such as a continuation or outer scope) wants to
-     * preserve the context.  The field is decremented when
-     * Parrot_free_context is called with the C<deref> flag set true.
-     * To trace context handling and check for leaks,
-     * (a) disable NDEBUG, (b) enable CTX_LEAK_DEBUG in interpreter.h,
-     * and (c) execute "debug 0x80" in a (preferably small) test case.
-     *
-     */
-    if (deref) {
-#if CTX_LEAK_DEBUG
-        if (Interp_debug_TEST(interp, PARROT_CTX_DESTROY_DEBUG_FLAG)) {
-            fprintf(stderr, "[reference to context %p released]\n", (void*)ctx);
-        }
-#endif
-        ctx->ref_count--;
-    }
-
-    if (ctx->ref_count <= 0) {
-        void *ptr;
-        int slot;
-
-#ifndef NDEBUG
-        if (Interp_debug_TEST(interp, PARROT_CTX_DESTROY_DEBUG_FLAG)
-            && ctx->current_sub) {
-            /* can't probably Parrot_io_eprintf here */
-            Parrot_sub *doomed;
-            PMC_get_sub(interp, ctx->current_sub, doomed);
-
-            if (doomed) {
-                fprintf(stderr, "[free  ctx %p of sub '%s']\n",
-                        (void *)ctx,
-                        (doomed->name == (void*)0xdeadbeef
-                        ? "???"
-                        : (char*)doomed->name->strstart));
-            }
-            else {
-                Parrot_ex_throw_from_c_args(interp, NULL, 1,
-                        "NULL doomed sub detected in Parrot_free_context");
-            }
-        }
-#endif
-
-        if (ctx->outer_ctx)
-            Parrot_free_context(interp, ctx->outer_ctx, 1);
-
-        ctx->n_regs_used[REGNO_INT] = 0;
-        ctx->n_regs_used[REGNO_NUM] = 0;
-        ctx->n_regs_used[REGNO_STR] = 0;
-        ctx->n_regs_used[REGNO_PMC] = 0;
-
-#if CTX_LEAK_DEBUG_FULL
-        /* for debugging, poison the freed context in case anything
-         * tries to use it later. */
-        ctx->current_results   = (opcode_t *)0xbeefcafe;
-        ctx->results_signature = (PMC *)0xbeefcafe;
-        ctx->lex_pad           = (PMC *)0xbeefcafe;
-        ctx->outer_ctx         = (Parrot_Context *)0xbeefcafe;
-        ctx->current_cont      = (PMC *)0xbeefcafe;
-        ctx->current_object    = (PMC *)0xbeefcafe;
-        ctx->current_HLL       = -1;
-        ctx->handlers          = (PMC *)0xbeefcafe;
-        ctx->constants         = (struct PackFile_Constant **)0xbeefcafe;
-        ctx->current_namespace = (PMC *)0xbeefcafe;
-#endif
-
-        /* don't put the same context on the free list multiple times; we don't
-         * have the re-use versus multiple ref count semantics right yet */
-        if (ctx->ref_count < 0)
-            return;
-
-        /* force the reference count negative to indicate a dead context
-         * so mark_context (src/sub.c) can report it */
-        ctx->ref_count--;
-
-        ptr             = ctx;
-        slot            = CALCULATE_SLOT_NUM(ctx->regs_mem_size);
-
-#if CTX_LEAK_DEBUG_FULL
-        slot = 0;
-#endif
-
-        PARROT_ASSERT(slot < interp->ctx_mem.n_free_slots);
-        *(void **)ptr                   = interp->ctx_mem.free_list[slot];
-        interp->ctx_mem.free_list[slot] = ptr;
-    }
-}
-
-
-/*
-
-=item C<Parrot_Context * Parrot_context_ref_trace(PARROT_INTERP, Parrot_Context
-*ctx, const char *file, int line)>
-
-Helper function to trace references when CTX_LEAK_DEBUG is set.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_CANNOT_RETURN_NULL
-Parrot_Context *
-Parrot_context_ref_trace(PARROT_INTERP, ARGMOD(Parrot_Context *ctx),
-        ARGIN(const char *file), int line)
-{
-    ASSERT_ARGS(Parrot_context_ref_trace)
-    if (Interp_debug_TEST(interp, PARROT_CTX_DESTROY_DEBUG_FLAG)) {
-        const char *name = "unknown";
-        Parrot_sub *sub;
-
-        PMC_get_sub(interp, ctx->current_sub, sub);
-        if (ctx->current_sub)
-            name = (char *)(sub->name->strstart);
-
-        fprintf(stderr, "[reference to context %p ('%s') taken at %s:%d]\n",
-                (void *)ctx, name, file, line);
-    }
-
-    ctx->ref_count++;
-    return ctx;
-}
-
-
-/*
-
-=item C<void Parrot_set_context_threshold(PARROT_INTERP, Parrot_Context *ctx)>
-
-Marks the context as possible threshold.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-Parrot_set_context_threshold(SHIM_INTERP, SHIM(Parrot_Context *ctx))
-{
-    ASSERT_ARGS(Parrot_set_context_threshold)
-    /* nothing to do */
-}
-
-/*
-
-=back
-
-=head2 Register Stack Functions
-
-=over 4
-
-=cut
-
-=item C<void Parrot_clear_i(PARROT_INTERP)>
-
-Sets all integer registers in the current context to 0.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-Parrot_clear_i(PARROT_INTERP)
-{
-    ASSERT_ARGS(Parrot_clear_i)
-    int i;
-    for (i = 0; i < CONTEXT(interp)->n_regs_used[REGNO_INT]; ++i)
-        REG_INT(interp, i) = 0;
-}
-
-
-/*
-
-=item C<void Parrot_clear_s(PARROT_INTERP)>
-
-Sets all STRING registers in the current context to NULL.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-Parrot_clear_s(PARROT_INTERP)
-{
-    ASSERT_ARGS(Parrot_clear_s)
-    int i;
-    for (i = 0; i < CONTEXT(interp)->n_regs_used[REGNO_STR]; ++i)
-        REG_STR(interp, i) = NULL;
-}
-
-
-/*
-
-=item C<void Parrot_clear_p(PARROT_INTERP)>
-
-Sets all PMC registers in the current context to NULL.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-Parrot_clear_p(PARROT_INTERP)
-{
-    ASSERT_ARGS(Parrot_clear_p)
-    int i;
-    for (i = 0; i < CONTEXT(interp)->n_regs_used[REGNO_PMC]; ++i)
-        REG_PMC(interp, i) = PMCNULL;
-}
-
-
-/*
-
-=item C<void Parrot_clear_n(PARROT_INTERP)>
-
-Sets all number registers in the current context to 0.0.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-Parrot_clear_n(PARROT_INTERP)
-{
-    ASSERT_ARGS(Parrot_clear_n)
-    int i;
-    for (i = 0; i < CONTEXT(interp)->n_regs_used[REGNO_NUM]; ++i)
-        REG_NUM(interp, i) = 0.0;
-}
-
-
-/*
-
-=back
-
-=head1 SEE ALSO
-
-F<include/parrot/register.h> and F<src/stacks.c>.
-
-=cut
-
-*/
-
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Modified: branches/orderedhash_revamp/src/gc/alloc_resources.c
==============================================================================
--- branches/orderedhash_revamp/src/gc/alloc_resources.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/gc/alloc_resources.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -32,7 +32,7 @@
 
 #define POOL_SIZE 65536 * 2
 
-typedef void (*compact_f) (Interp *, Memory_Pool *);
+typedef void (*compact_f) (Interp *, Variable_Size_Pool *);
 
 /* HEADERIZER HFILE: src/gc/gc_private.h */
 
@@ -41,7 +41,7 @@
 
 static void alloc_new_block(PARROT_INTERP,
     size_t size,
-    ARGMOD(Memory_Pool *pool),
+    ARGMOD(Variable_Size_Pool *pool),
     ARGIN(const char *why))
         __attribute__nonnull__(1)
         __attribute__nonnull__(3)
@@ -54,35 +54,52 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-static void debug_print_buf(PARROT_INTERP, ARGIN(const PObj *b))
+static void check_fixed_size_obj_pool(ARGMOD(Fixed_Size_Pool * pool))
+        __attribute__nonnull__(1)
+        FUNC_MODIFIES(* pool);
+
+static void check_memory_system(PARROT_INTERP)
+        __attribute__nonnull__(1);
+
+static void check_var_size_obj_pool(ARGMOD(Variable_Size_Pool *pool))
+        __attribute__nonnull__(1)
+        FUNC_MODIFIES(*pool);
+
+static void debug_print_buf(PARROT_INTERP, ARGIN(const Buffer *b))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
 PARROT_MALLOC
 PARROT_CANNOT_RETURN_NULL
-static Memory_Pool * new_memory_pool(
+static Variable_Size_Pool * new_memory_pool(
     size_t min_block,
     NULLOK(compact_f compact));
 
-#define ASSERT_ARGS_alloc_new_block __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_alloc_new_block __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool) \
-    || PARROT_ASSERT_ARG(why)
-#define ASSERT_ARGS_buffer_location __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(pool) \
+    , PARROT_ASSERT_ARG(why))
+#define ASSERT_ARGS_buffer_location __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(b)
-#define ASSERT_ARGS_debug_print_buf __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(b))
+#define ASSERT_ARGS_check_fixed_size_obj_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(pool))
+#define ASSERT_ARGS_check_memory_system __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_check_var_size_obj_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(pool))
+#define ASSERT_ARGS_debug_print_buf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(b)
-#define ASSERT_ARGS_new_memory_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
+    , PARROT_ASSERT_ARG(b))
+#define ASSERT_ARGS_new_memory_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
 
 /*
 
-=item C<static void alloc_new_block(PARROT_INTERP, size_t size, Memory_Pool
-*pool, const char *why)>
+=item C<static void alloc_new_block(PARROT_INTERP, size_t size,
+Variable_Size_Pool *pool, const char *why)>
 
 Allocate a new memory block. We allocate either the requested size or the
 default size, whichever is larger. Add the new block to the given memory
@@ -93,7 +110,7 @@
 */
 
 static void
-alloc_new_block(PARROT_INTERP, size_t size, ARGMOD(Memory_Pool *pool),
+alloc_new_block(PARROT_INTERP, size_t size, ARGMOD(Variable_Size_Pool *pool),
         ARGIN(const char *why))
 {
     ASSERT_ARGS(alloc_new_block)
@@ -126,7 +143,7 @@
     new_block->top   = new_block->start;
 
     /* Note that we've allocated it */
-    interp->arena_base->memory_allocated += alloc_size;
+    interp->mem_pools->memory_allocated += alloc_size;
 
     /* If this is for a public pool, add it to the list */
     new_block->prev = pool->top_block;
@@ -141,7 +158,8 @@
 
 /*
 
-=item C<void * mem_allocate(PARROT_INTERP, size_t size, Memory_Pool *pool)>
+=item C<void * mem_allocate(PARROT_INTERP, size_t size, Variable_Size_Pool
+*pool)>
 
 Allocates memory for headers.
 
@@ -179,7 +197,7 @@
 PARROT_MALLOC
 PARROT_CANNOT_RETURN_NULL
 void *
-mem_allocate(PARROT_INTERP, size_t size, ARGMOD(Memory_Pool *pool))
+mem_allocate(PARROT_INTERP, size_t size, ARGMOD(Variable_Size_Pool *pool))
 {
     ASSERT_ARGS(mem_allocate)
     void *return_val;
@@ -196,20 +214,20 @@
          * TODO pass required allocation size to the GC system,
          *      so that collection can be skipped if needed
          */
-        if (!interp->arena_base->gc_mark_block_level
-        &&   interp->arena_base->mem_allocs_since_last_collect) {
+        if (!interp->mem_pools->gc_mark_block_level
+        &&   interp->mem_pools->mem_allocs_since_last_collect) {
             Parrot_gc_mark_and_sweep(interp, GC_trace_stack_FLAG);
-#if !PARROT_GC_IMS && !PARROT_GC_INF
-            /* Compact the pool if allowed and worthwhile */
-            if (pool->compact) {
-                /* don't bother reclaiming if it's just chicken feed */
-                if ((pool->possibly_reclaimable * pool->reclaim_factor +
-                            pool->guaranteed_reclaimable) > size) {
-                    (*pool->compact) (interp, pool);
-                }
 
+            if (interp->gc_sys->sys_type != INF) {
+                /* Compact the pool if allowed and worthwhile */
+                if (pool->compact) {
+                    /* don't bother reclaiming if it's only a small amount */
+                    if ((pool->possibly_reclaimable * pool->reclaim_factor +
+                         pool->guaranteed_reclaimable) > size) {
+                        (*pool->compact) (interp, pool);
+                    }
+                }
             }
-#endif
         }
         if (pool->top_block->free < size) {
             if (pool->minimum_block_size < 65536 * 16)
@@ -222,7 +240,7 @@
              */
             alloc_new_block(interp, size, pool, "compact failed");
 
-            interp->arena_base->mem_allocs_since_last_collect++;
+            interp->mem_pools->mem_allocs_since_last_collect++;
 
             if (pool->top_block->free < size) {
                 fprintf(stderr, "out of mem\n");
@@ -277,7 +295,7 @@
 
 /*
 
-=item C<static void debug_print_buf(PARROT_INTERP, const PObj *b)>
+=item C<static void debug_print_buf(PARROT_INTERP, const Buffer *b)>
 
 Prints a debug statement with information about the given PObj C<b>.
 =cut
@@ -285,11 +303,11 @@
 */
 
 static void
-debug_print_buf(PARROT_INTERP, ARGIN(const PObj *b))
+debug_print_buf(PARROT_INTERP, ARGIN(const Buffer *b))
 {
     ASSERT_ARGS(debug_print_buf)
     fprintf(stderr, "found %p, len %d, flags 0x%08x at %s\n",
-            b, (int)PObj_buflen(b), (uint)PObj_get_FLAGS(b),
+            b, (int)Buffer_buflen(b), (uint)PObj_get_FLAGS(b),
             buffer_location(interp, b));
 }
 #endif
@@ -302,7 +320,7 @@
 
 =over 4
 
-=item C<void compact_pool(PARROT_INTERP, Memory_Pool *pool)>
+=item C<void compact_pool(PARROT_INTERP, Variable_Size_Pool *pool)>
 
 Compact the string buffer pool. Does not perform a GC scan, or mark items
 as being alive in any way.
@@ -312,7 +330,7 @@
 */
 
 void
-compact_pool(PARROT_INTERP, ARGMOD(Memory_Pool *pool))
+compact_pool(PARROT_INTERP, ARGMOD(Variable_Size_Pool *pool))
 {
     ASSERT_ARGS(compact_pool)
     INTVAL        j;
@@ -321,22 +339,19 @@
     Memory_Block *new_block;     /* A pointer to our working block */
     char         *cur_spot;      /* Where we're currently copying to */
 
-    Small_Object_Arena *cur_buffer_arena;
-    Arenas * const      arena_base = interp->arena_base;
+    Fixed_Size_Arena *cur_buffer_arena;
+    Memory_Pools * const      mem_pools = interp->mem_pools;
 
     /* Bail if we're blocked */
-    if (arena_base->gc_sweep_block_level)
+    if (mem_pools->gc_sweep_block_level)
         return;
 
-    ++arena_base->gc_sweep_block_level;
-
-    if (interp->profile)
-        Parrot_gc_profile_start(interp);
+    ++mem_pools->gc_sweep_block_level;
 
     /* We're collecting */
-    arena_base->mem_allocs_since_last_collect    = 0;
-    arena_base->header_allocs_since_last_collect = 0;
-    arena_base->gc_collect_runs++;
+    mem_pools->mem_allocs_since_last_collect    = 0;
+    mem_pools->header_allocs_since_last_collect = 0;
+    mem_pools->gc_collect_runs++;
 
     /* total - reclaimable == currently used. Add a minimum block to the
      * current amount, so we can avoid having to allocate it in the future. */
@@ -388,8 +403,8 @@
     cur_spot  = new_block->start;
 
     /* Run through all the Buffer header pools and copy */
-    for (j = (INTVAL)arena_base->num_sized - 1; j >= 0; --j) {
-        Small_Object_Pool * const header_pool = arena_base->sized_header_pools[j];
+    for (j = (INTVAL)mem_pools->num_sized - 1; j >= 0; --j) {
+        Fixed_Size_Pool * const header_pool = mem_pools->sized_header_pools[j];
         UINTVAL       object_size;
 
         if (!header_pool)
@@ -400,28 +415,29 @@
         for (cur_buffer_arena = header_pool->last_Arena;
                 cur_buffer_arena;
                 cur_buffer_arena = cur_buffer_arena->prev) {
-            Buffer *b = (Buffer *)ARENA_to_PObj(cur_buffer_arena->start_objects);
+            Buffer *b = (Buffer *) cur_buffer_arena->start_objects;
             UINTVAL i;
+            const size_t objects_end = cur_buffer_arena->used;
 
-            for (i = cur_buffer_arena->used; i; --i) {
+            for (i = objects_end; i; --i) {
                 INTVAL *ref_count = NULL;
 
                 /* ! (on_free_list | constant | external | sysmem) */
-                if (PObj_buflen(b) && PObj_is_movable_TESTALL(b)) {
+                if (Buffer_buflen(b) && PObj_is_movable_TESTALL(b)) {
                     ptrdiff_t offset = 0;
 #if RESOURCE_DEBUG
-                    if (PObj_buflen(b) >= RESOURCE_DEBUG_SIZE)
+                    if (Buffer_buflen(b) >= RESOURCE_DEBUG_SIZE)
                         debug_print_buf(interp, b);
 #endif
 
                     /* we can't perform the math all the time, because
                      * strstart might be in unallocated memory */
                     if (PObj_is_COWable_TEST(b)) {
-                        ref_count = PObj_bufrefcountptr(b);
+                        ref_count = Buffer_bufrefcountptr(b);
 
                         if (PObj_is_string_TEST(b)) {
                             offset = (ptrdiff_t)((STRING *)b)->strstart -
-                                (ptrdiff_t)PObj_bufstart(b);
+                                (ptrdiff_t)Buffer_bufstart(b);
                         }
                     }
 
@@ -429,7 +445,8 @@
                     if (PObj_COW_TEST(b) &&
                         (ref_count && *ref_count & Buffer_moved_FLAG)) {
                         /* Find out who else references our data */
-                        Buffer * const hdr = *(Buffer **)(PObj_bufstart(b));
+                        Buffer * const hdr = *((Buffer **)Buffer_bufstart(b));
+
 
                         PARROT_ASSERT(PObj_is_COWable_TEST(b));
 
@@ -438,13 +455,13 @@
 
                         /* TODO incr ref_count, after fixing string too
                          * Now make sure we point to where the other guy does */
-                        PObj_bufstart(b) = PObj_bufstart(hdr);
+                        Buffer_bufstart(b) = Buffer_bufstart(hdr);
 
                         /* And if we're a string, update strstart */
                         /* Somewhat of a hack, but if we get per-pool
                          * collections, it should help ease the pain */
                         if (PObj_is_string_TEST(b)) {
-                            ((STRING *)b)->strstart = (char *)PObj_bufstart(b) +
+                            ((STRING *)b)->strstart = (char *)Buffer_bufstart(b) +
                                     offset;
                         }
                     }
@@ -457,14 +474,14 @@
                         }
 
                         /* Copy our memory to the new pool */
-                        memcpy(cur_spot, PObj_bufstart(b), PObj_buflen(b));
+                        memcpy(cur_spot, Buffer_bufstart(b), Buffer_buflen(b));
 
                         /* If we're COW */
                         if (PObj_COW_TEST(b)) {
                             PARROT_ASSERT(PObj_is_COWable_TEST(b));
 
                             /* Let the old buffer know how to find us */
-                            *(Buffer **)(PObj_bufstart(b)) = b;
+                            *((Buffer **)Buffer_bufstart(b)) = b;
 
                             /* No guarantees that our data is still COW, so
                              * assume not, and let the above code fix-up */
@@ -477,14 +494,14 @@
                                 *ref_count |= Buffer_moved_FLAG;
                         }
 
-                        PObj_bufstart(b) = cur_spot;
+                        Buffer_bufstart(b) = cur_spot;
 
                         if (PObj_is_string_TEST(b)) {
-                            ((STRING *)b)->strstart = (char *)PObj_bufstart(b) +
+                            ((STRING *)b)->strstart = (char *)Buffer_bufstart(b) +
                                     offset;
                         }
 
-                        cur_spot += PObj_buflen(b);
+                        cur_spot += Buffer_buflen(b);
                     }
                 }
                 b = (Buffer *)((char *)b + object_size);
@@ -502,7 +519,7 @@
     /* How much is free. That's the total size minus the amount we used */
     new_block->free = new_block->size - (new_block->top - new_block->start);
 
-    arena_base->memory_collected += (new_block->top - new_block->start);
+    mem_pools->memory_collected += (new_block->top - new_block->start);
 
     /* Now we're done. We're already on the pool's free list, so let us be the
      * only one on the free list and free the rest */
@@ -515,7 +532,7 @@
             Memory_Block * const next_block = cur_block->prev;
 
             /* Note that we don't have it any more */
-            arena_base->memory_allocated -= cur_block->size;
+            mem_pools->memory_allocated -= cur_block->size;
 
             /* We know the pool body and pool header are a single chunk, so
              * this is enough to get rid of 'em both */
@@ -531,10 +548,7 @@
     pool->guaranteed_reclaimable = 0;
     pool->possibly_reclaimable   = 0;
 
-    if (interp->profile)
-        Parrot_gc_profile_end(interp, PARROT_PROF_GC);
-
-    --arena_base->gc_sweep_block_level;
+    --mem_pools->gc_sweep_block_level;
 }
 
 /*
@@ -623,10 +637,10 @@
 
 =over 4
 
-=item C<static Memory_Pool * new_memory_pool(size_t min_block, compact_f
+=item C<static Variable_Size_Pool * new_memory_pool(size_t min_block, compact_f
 compact)>
 
-Allocate a new C<Memory_Pool> structures, and set some initial values.
+Allocate a new C<Variable_Size_Pool> structures, and set some initial values.
 return a pointer to the new pool.
 
 =cut
@@ -635,11 +649,11 @@
 
 PARROT_MALLOC
 PARROT_CANNOT_RETURN_NULL
-static Memory_Pool *
+static Variable_Size_Pool *
 new_memory_pool(size_t min_block, NULLOK(compact_f compact))
 {
     ASSERT_ARGS(new_memory_pool)
-    Memory_Pool * const pool = mem_internal_allocate_typed(Memory_Pool);
+    Variable_Size_Pool * const pool = mem_internal_allocate_typed(Variable_Size_Pool);
 
     pool->top_block              = NULL;
     pool->compact                = compact;
@@ -654,9 +668,9 @@
 
 /*
 
-=item C<void initialize_memory_pools(PARROT_INTERP)>
+=item C<void initialize_var_size_pools(PARROT_INTERP)>
 
-Initialize the managed memory pools. Parrot maintains two C<Memory_Pool>
+Initialize the managed memory pools. Parrot maintains two C<Variable_Size_Pool>
 structures, the general memory pool and the constant string pool. Create
 and initialize both pool structures, and allocate initial blocks of memory
 for both.
@@ -666,24 +680,23 @@
 */
 
 void
-initialize_memory_pools(PARROT_INTERP)
+initialize_var_size_pools(PARROT_INTERP)
 {
-    ASSERT_ARGS(initialize_memory_pools)
-    Arenas * const arena_base = interp->arena_base;
+    ASSERT_ARGS(initialize_var_size_pools)
+    Memory_Pools * const mem_pools = interp->mem_pools;
 
-    arena_base->memory_pool   = new_memory_pool(POOL_SIZE, &compact_pool);
-    alloc_new_block(interp, POOL_SIZE, arena_base->memory_pool, "init");
+    mem_pools->memory_pool   = new_memory_pool(POOL_SIZE, &compact_pool);
+    alloc_new_block(interp, POOL_SIZE, mem_pools->memory_pool, "init");
 
     /* Constant strings - not compacted */
-    arena_base->constant_string_pool = new_memory_pool(POOL_SIZE, NULL);
-
-    alloc_new_block(interp, POOL_SIZE, arena_base->constant_string_pool, "init");
+    mem_pools->constant_string_pool = new_memory_pool(POOL_SIZE, NULL);
+    alloc_new_block(interp, POOL_SIZE, mem_pools->constant_string_pool, "init");
 }
 
 
 /*
 
-=item C<void merge_pools(Memory_Pool *dest, Memory_Pool *source)>
+=item C<void merge_pools(Variable_Size_Pool *dest, Variable_Size_Pool *source)>
 
 Merge two memory pools together. Do this by moving all memory blocks
 from the C<*source> pool into the C<*dest> pool. The C<source> pool
@@ -694,7 +707,7 @@
 */
 
 void
-merge_pools(ARGMOD(Memory_Pool *dest), ARGMOD(Memory_Pool *source))
+merge_pools(ARGMOD(Variable_Size_Pool *dest), ARGMOD(Variable_Size_Pool *source))
 {
     ASSERT_ARGS(merge_pools)
     Memory_Block *cur_block;
@@ -704,9 +717,8 @@
     while (cur_block) {
         Memory_Block * const next_block = cur_block->prev;
 
-        if (cur_block->free == cur_block->size) {
+        if (cur_block->free == cur_block->size)
             mem_internal_free(cur_block);
-        }
         else {
             cur_block->next        = NULL;
             cur_block->prev        = dest->top_block;
@@ -718,7 +730,7 @@
     }
 
     dest->guaranteed_reclaimable += source->guaranteed_reclaimable;
-    dest->possibly_reclaimable   += dest->possibly_reclaimable;
+    dest->possibly_reclaimable   += source->possibly_reclaimable;
 
     source->top_block              = NULL;
     source->total_allocated        = 0;
@@ -728,6 +740,205 @@
 
 /*
 
+=item C<static void check_memory_system(PARROT_INTERP)>
+
+Checks the memory system of parrot on any corruptions, including
+the string system.
+
+=cut
+
+*/
+
+static void
+check_memory_system(PARROT_INTERP)
+{
+    ASSERT_ARGS(check_memory_system)
+    size_t i;
+    Memory_Pools * const mem_pools = interp->mem_pools;
+
+    check_var_size_obj_pool(mem_pools->memory_pool);
+    check_var_size_obj_pool(mem_pools->constant_string_pool);
+    check_fixed_size_obj_pool(mem_pools->pmc_pool);
+    check_fixed_size_obj_pool(mem_pools->constant_pmc_pool);
+    check_fixed_size_obj_pool(mem_pools->string_header_pool);
+    check_fixed_size_obj_pool(mem_pools->constant_string_header_pool);
+
+    for (i = 0; i < mem_pools->num_sized; i++) {
+        Fixed_Size_Pool * pool = mem_pools->sized_header_pools[i];
+        if (pool != NULL && pool != mem_pools->string_header_pool)
+            check_fixed_size_obj_pool(pool);
+    }
+}
+
+/*
+
+=item C<static void check_fixed_size_obj_pool(Fixed_Size_Pool * pool)>
+
+Checks a small object pool, if it contains buffer it checks the buffers also.
+
+=cut
+
+*/
+
+static void
+check_fixed_size_obj_pool(ARGMOD(Fixed_Size_Pool * pool))
+{
+    ASSERT_ARGS(check_fixed_size_obj_pool)
+    size_t total_objects;
+    size_t last_free_list_count;
+    Fixed_Size_Arena * arena_walker;
+    size_t free_objects;
+    PObj * object;
+    size_t i;
+    size_t count;
+    GC_MS_PObj_Wrapper * pobj_walker;
+
+    count = 10000000; /*detect unendless loop just use big enough number*/
+
+    total_objects = pool->total_objects;
+    last_free_list_count = 1;
+    free_objects = 0;
+
+    arena_walker = pool->last_Arena;
+    while (arena_walker != NULL) {
+        total_objects -= arena_walker->total_objects;
+        object = (PObj*)arena_walker->start_objects;
+        for (i = 0; i < arena_walker->total_objects; ++i) {
+            if (PObj_on_free_list_TEST(object)) {
+                ++free_objects;
+                pobj_walker = (GC_MS_PObj_Wrapper*)object;
+                if (pobj_walker->next_ptr == NULL)
+                    /* should happen only once at the end */
+                    --last_free_list_count;
+                else {
+                    /* next item on free list should also be flaged as free item */
+                    pobj_walker = (GC_MS_PObj_Wrapper*)pobj_walker->next_ptr;
+                    PARROT_ASSERT(PObj_on_free_list_TEST((PObj*)pobj_walker));
+                }
+            }
+            else if (pool->mem_pool != NULL) {
+                /*then it means we are a buffer*/
+                check_buffer_ptr((Buffer*)object, pool->mem_pool);
+            }
+            object = (PObj*)((char *)object + pool->object_size);
+            PARROT_ASSERT(--count);
+        }
+        /*check the list*/
+        if (arena_walker->prev != NULL)
+            PARROT_ASSERT(arena_walker->prev->next == arena_walker);
+        arena_walker = arena_walker->prev;
+        PARROT_ASSERT(--count);
+    }
+
+    count = 10000000;
+
+    PARROT_ASSERT(free_objects == pool->num_free_objects);
+
+    pobj_walker = (GC_MS_PObj_Wrapper*)pool->free_list;
+    while (pobj_walker != NULL) {
+        PARROT_ASSERT(pool->start_arena_memory <= (size_t)pobj_walker);
+        PARROT_ASSERT(pool->end_arena_memory > (size_t)pobj_walker);
+        PARROT_ASSERT(PObj_on_free_list_TEST((PObj*)pobj_walker));
+        --free_objects;
+        pobj_walker = (GC_MS_PObj_Wrapper*)pobj_walker->next_ptr;
+        PARROT_ASSERT(--count);
+    }
+
+    PARROT_ASSERT(total_objects == 0);
+    PARROT_ASSERT(last_free_list_count == 0 || pool->num_free_objects == 0);
+    PARROT_ASSERT(free_objects == 0);
+}
+
+/*
+
+=item C<static void check_var_size_obj_pool(Variable_Size_Pool *pool)>
+
+Checks a memory pool, containing buffer data
+
+=cut
+
+*/
+
+static void
+check_var_size_obj_pool(ARGMOD(Variable_Size_Pool *pool))
+{
+    ASSERT_ARGS(check_var_size_obj_pool)
+    size_t count;
+    Memory_Block * block_walker;
+    count = 10000000; /*detect unendless loop just use big enough number*/
+
+    block_walker = (Memory_Block *)pool->top_block;
+    while (block_walker != NULL) {
+        PARROT_ASSERT(block_walker->start == (char *)block_walker +
+            sizeof (Memory_Block));
+        PARROT_ASSERT((size_t)(block_walker->top -
+            block_walker->start) == block_walker->size - block_walker->free);
+
+        /*check the list*/
+        if (block_walker->prev != NULL)
+            PARROT_ASSERT(block_walker->prev->next == block_walker);
+        block_walker = block_walker->prev;
+        PARROT_ASSERT(--count);
+    }
+}
+
+/*
+
+=item C<void check_buffer_ptr(Buffer * pobj, Variable_Size_Pool * pool)>
+
+Checks wether the buffer is within the bounds of the memory pool
+
+=cut
+
+*/
+
+void
+check_buffer_ptr(ARGMOD(Buffer * pobj), ARGMOD(Variable_Size_Pool * pool))
+{
+    ASSERT_ARGS(check_buffer_ptr)
+    Memory_Block * cur_block = pool->top_block;
+    char * bufstart;
+
+    bufstart = (char*)Buffer_bufstart(pobj);
+
+    if (bufstart == NULL && Buffer_buflen(pobj) == 0)
+        return;
+
+    if (PObj_external_TEST(pobj) || PObj_sysmem_TEST(pobj)) {
+        /*buffer does not come from the memory pool*/
+        if (PObj_is_string_TEST(pobj)) {
+            PARROT_ASSERT(((STRING *) pobj)->strstart >=
+                (char *) Buffer_bufstart(pobj));
+            PARROT_ASSERT(((STRING *) pobj)->strstart +
+                ((STRING *) pobj)->strlen <=
+                (char *) Buffer_bufstart(pobj) + Buffer_buflen(pobj));
+        }
+        return;
+    }
+
+    if (PObj_is_COWable_TEST(pobj))
+        bufstart -= sizeof (void*);
+
+    while (cur_block) {
+        if ((char *)bufstart >= cur_block->start &&
+            (char *)Buffer_bufstart(pobj) +
+            Buffer_buflen(pobj) < cur_block->start + cur_block->size) {
+            if (PObj_is_string_TEST(pobj)) {
+                PARROT_ASSERT(((STRING *)pobj)->strstart >=
+                    (char *)Buffer_bufstart(pobj));
+                PARROT_ASSERT(((STRING *)pobj)->strstart +
+                    ((STRING *)pobj)->strlen <= (char *)Buffer_bufstart(pobj) +
+                    Buffer_buflen(pobj));
+            }
+            return;
+        }
+        cur_block = cur_block->prev;
+    }
+    PARROT_ASSERT(0);
+}
+
+/*
+
 =back
 
 =head1 SEE ALSO

Modified: branches/orderedhash_revamp/src/gc/api.c
==============================================================================
--- branches/orderedhash_revamp/src/gc/api.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/gc/api.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -45,19 +45,20 @@
 =item F<src/gc/alloc_resources.c>
 
 This file implements handling logic for strings and arbitrary-sized memory
-buffers. String storage is managed by special Memory_Pool structures, and use
+buffers. String storage is managed by special Variable_Size_Pool structures, and use
 a separate compacting garbage collector to keep track of them.
 
-=item F<src/gc/gc_ims.c>
+=item F<src/gc/incremental_ms.c>
 
-=item F<src/gc/gc_gms.c>
+=item F<src/gc/generational_ms.c>
 
 =item F<src/gc/gc_ms.c>
 
 These files are the individual GC cores which implement the primary tracing
-and sweeping logic. gc_ms.c is the mark&sweep collector core which is used in
-Parrot by default. gc_gms.c is an experimental and incomplete generational core.
-gc_ims.c is an experimental and incomplete incremental collector core.
+and sweeping logic. gc_ms.c is the mark & sweep collector core which is used in
+Parrot by default. generational_ms.c is an experimental and incomplete
+generational core.  incremental_ms.c is an experimental and incomplete
+incremental collector core.
 
 =item F<src/gc/mark_sweep.c>
 
@@ -70,13 +71,11 @@
 This file implements logic for tracing processor registers and the system stack.
 Here there be dragons.
 
-=item F<src/gc/res_lea.c>
-
 =item F<src/gc/malloc.c>
 
 =item F<src/gc/malloc_trace.c>
 
-These three files implement various unused features, including a custom malloc
+These two files implement various unused features, including a custom malloc
 implementation, and malloc wrappers for various purposes. These are unused.
 
 =back
@@ -100,29 +99,35 @@
 /* HEADERIZER BEGIN: static */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
-static void cleanup_next_for_GC_pool(ARGIN(Small_Object_Pool *pool))
-        __attribute__nonnull__(1);
-
 static void fix_pmc_syncs(
     ARGMOD(Interp *dest_interp),
-    ARGIN(Small_Object_Pool *pool))
+    ARGIN(Fixed_Size_Pool *pool))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*dest_interp);
 
-static void free_pool(ARGMOD(Small_Object_Pool *pool))
+static void free_pool(ARGMOD(Fixed_Size_Pool *pool))
         __attribute__nonnull__(1)
         FUNC_MODIFIES(*pool);
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-static void * get_free_buffer(PARROT_INTERP, ARGIN(Small_Object_Pool *pool))
+static void * get_free_buffer(PARROT_INTERP, ARGIN(Fixed_Size_Pool *pool))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
+static void Parrot_gc_free_attributes_from_pool(PARROT_INTERP,
+    ARGMOD(PMC_Attribute_Pool *pool),
+    ARGMOD(void *data))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        FUNC_MODIFIES(*pool)
+        FUNC_MODIFIES(*data);
+
 static void Parrot_gc_merge_buffer_pools(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *dest),
-    ARGMOD(Small_Object_Pool *source))
+    ARGMOD(Fixed_Size_Pool *dest),
+    ARGMOD(Fixed_Size_Pool *source))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         __attribute__nonnull__(3)
@@ -130,7 +135,7 @@
         FUNC_MODIFIES(*source);
 
 static int sweep_cb_buf(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool),
+    ARGMOD(Fixed_Size_Pool *pool),
     SHIM(int flag),
     ARGIN(void *arg))
         __attribute__nonnull__(1)
@@ -139,34 +144,37 @@
         FUNC_MODIFIES(*pool);
 
 static int sweep_cb_pmc(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool),
+    ARGMOD(Fixed_Size_Pool *pool),
     SHIM(int flag),
     SHIM(void *arg))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*pool);
 
-#define ASSERT_ARGS_cleanup_next_for_GC_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_fix_pmc_syncs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_fix_pmc_syncs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(dest_interp) \
-    || PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_free_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_get_free_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(pool))
+#define ASSERT_ARGS_free_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(pool))
+#define ASSERT_ARGS_get_free_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pool))
+#define ASSERT_ARGS_Parrot_gc_free_attributes_from_pool \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_Parrot_gc_merge_buffer_pools __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(pool) \
+    , PARROT_ASSERT_ARG(data))
+#define ASSERT_ARGS_Parrot_gc_merge_buffer_pools __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(dest) \
-    || PARROT_ASSERT_ARG(source)
-#define ASSERT_ARGS_sweep_cb_buf __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(dest) \
+    , PARROT_ASSERT_ARG(source))
+#define ASSERT_ARGS_sweep_cb_buf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool) \
-    || PARROT_ASSERT_ARG(arg)
-#define ASSERT_ARGS_sweep_cb_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(pool) \
+    , PARROT_ASSERT_ARG(arg))
+#define ASSERT_ARGS_sweep_cb_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool)
+    , PARROT_ASSERT_ARG(pool))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -195,28 +203,13 @@
 {
     ASSERT_ARGS(Parrot_gc_mark_PObj_alive)
     /* TODO: Have each core register a ->pobject_lives function pointer in the
-       Arenas struct, and call that pointer directly instead of having a messy
+       Memory_Pools struct, and call that pointer directly instead of having a messy
        set of #if preparser conditions. */
-#if PARROT_GC_GMS
-    do {
-        if (!PObj_live_TEST(obj) && \
-                PObj_to_GMSH(obj)->gen->gen_no >= interp->gc_generation) \
-            parrot_gc_gms_Parrot_gc_mark_PObj_alive(interp, obj); \
-    } while (0);
-#else /* not PARROT_GC_GMS */
 
     /* if object is live or on free list return */
     if (PObj_is_live_or_free_TESTALL(obj))
         return;
 
-#  if ! DISABLE_GC_DEBUG
-#    if GC_VERBOSE
-    if (CONSERVATIVE_POINTER_CHASING)
-        fprintf(stderr, "GC Warning! Unanchored %s %p found in system areas \n",
-                PObj_is_PMC_TEST(obj) ? "PMC" : "Buffer", obj);
-
-#    endif
-#  endif
     /* mark it live */
     PObj_live_SET(obj);
 
@@ -228,19 +221,75 @@
         if (PObj_is_special_PMC_TEST(obj))
             mark_special(interp, p);
 
-#  ifndef NDEBUG
-        else if (p->pmc_ext && PMC_metadata(p))
-            fprintf(stderr, "GC: error obj %p (%s) has properties\n",
-                    (void *)p, (char*)p->vtable->whoami->strstart);
-#  endif
-    }
-#  if GC_VERBOSE
-    /* buffer GC_DEBUG stuff */
-    if (GC_DEBUG(interp) && PObj_report_TEST(obj))
-        fprintf(stderr, "GC: buffer %p pointing to %p marked live\n",
-                obj, PObj_bufstart((Buffer *)obj));
-#  endif
-#endif  /* PARROT_GC_GMS */
+        else if (PMC_metadata(p))
+            Parrot_gc_mark_PMC_alive(interp, PMC_metadata(p));
+    }
+}
+
+/*
+
+=item C<void Parrot_gc_mark_PMC_alive_fun(PARROT_INTERP, PMC *obj)>
+
+A type safe wrapper of Parrot_gc_mark_PObj_alive for PMC.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_gc_mark_PMC_alive_fun(PARROT_INTERP, ARGMOD_NULLOK(PMC *obj))
+{
+    ASSERT_ARGS(Parrot_gc_mark_PMC_alive_fun)
+    if (!PMC_IS_NULL(obj)) {
+        PARROT_ASSERT(PObj_is_PMC_TEST(obj));
+
+        if (PObj_is_live_or_free_TESTALL(obj))
+            return;
+
+        /* mark it live */
+        PObj_live_SET(obj);
+
+        /* if object is a PMC and contains buffers or PMCs, then attach the PMC
+         * to the chained mark list. */
+        if (PObj_is_special_PMC_TEST(obj)) {
+            if (PObj_is_PMC_shared_TEST(obj)) {
+                Parrot_Interp i = PMC_sync(obj)->owner;
+
+                if (!i->mem_pools->gc_mark_ptr)
+                    i->mem_pools->gc_mark_ptr = obj;
+            }
+
+            if (PObj_custom_mark_TEST(obj))
+                VTABLE_mark(interp, obj);
+        }
+
+        if (PMC_metadata(obj))
+            Parrot_gc_mark_PMC_alive(interp, PMC_metadata(obj));
+    }
+}
+
+/*
+
+=item C<void Parrot_gc_mark_STRING_alive_fun(PARROT_INTERP, STRING *obj)>
+
+A type safe wrapper of Parrot_gc_mark_PObj_alive for STRING.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_gc_mark_STRING_alive_fun(PARROT_INTERP, ARGMOD_NULLOK(STRING *obj))
+{
+    ASSERT_ARGS(Parrot_gc_mark_STRING_alive_fun)
+    if (!STRING_IS_NULL(obj)) {
+        PARROT_ASSERT(PObj_is_string_TEST(obj));
+
+        /* mark it live */
+        PObj_live_SET(obj);
+    }
 }
 
 /*
@@ -262,26 +311,40 @@
 Parrot_gc_initialize(PARROT_INTERP, ARGIN(void *stacktop))
 {
     ASSERT_ARGS(Parrot_gc_initialize)
-    interp->arena_base = mem_allocate_zeroed_typed(Arenas);
-    interp->arena_base->sized_header_pools = NULL;
 
-    interp->lo_var_ptr = stacktop;
+    interp->mem_pools = mem_allocate_zeroed_typed(Memory_Pools);
+    interp->gc_sys    = mem_allocate_zeroed_typed(GC_Subsystem);
+
+    interp->mem_pools->num_sized          = 0;
+    interp->mem_pools->num_attribs        = 0;
+    interp->mem_pools->attrib_pools       = NULL;
+    interp->mem_pools->sized_header_pools = NULL;
+
+    interp->lo_var_ptr                    = stacktop;
 
-#if PARROT_GC_MS
-    Parrot_gc_ms_init(interp);
-#endif
-#if PARROT_GC_IMS
-    Parrot_gc_ims_init(interp);
-#endif
-#if PARROT_GC_GMS
-    Parrot_gc_gms_init(interp);
-#endif
-#if PARROT_GC_INF
-    Parrot_gc_inf_init(interp);
-#endif
 
-    initialize_memory_pools(interp);
-    initialize_header_pools(interp);
+    /*TODO: add ability to specify GC core at command line w/ --gc= */
+    if (0) /*If they chose sys_type with the --gc command line switch,*/
+        ; /* set sys_type to value they gave */
+    else
+        interp->gc_sys->sys_type = PARROT_GC_DEFAULT_TYPE;
+
+    /*Call appropriate initialization function for GC subsystem*/
+    switch (interp->gc_sys->sys_type) {
+      case MS:
+        Parrot_gc_ms_init(interp);
+        break;
+      case INF:
+        Parrot_gc_inf_init(interp);
+        break;
+      default:
+        /*die horribly because of invalid GC core specified*/
+        break;
+    }
+
+    initialize_var_size_pools(interp);
+    initialize_fixed_size_pools(interp);
+    Parrot_gc_initialize_fixed_size_pools(interp, GC_NUM_INITIAL_FIXED_SIZE_POOLS);
 }
 
 /*
@@ -299,8 +362,8 @@
 Parrot_gc_finalize(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_gc_finalize)
-    if (interp->arena_base->finalize_gc_system)
-        interp->arena_base->finalize_gc_system(interp);
+    if (interp->gc_sys->finalize_gc_system)
+        interp->gc_sys->finalize_gc_system(interp);
 }
 
 
@@ -322,26 +385,17 @@
 Parrot_gc_new_pmc_header(PARROT_INTERP, UINTVAL flags)
 {
     ASSERT_ARGS(Parrot_gc_new_pmc_header)
-    Small_Object_Pool * const pool = flags & PObj_constant_FLAG
-            ? interp->arena_base->constant_pmc_pool
-            : interp->arena_base->pmc_pool;
+    Fixed_Size_Pool * const pool = flags & PObj_constant_FLAG
+            ? interp->mem_pools->constant_pmc_pool
+            : interp->mem_pools->pmc_pool;
     PMC * const pmc = (PMC *)pool->get_free_object(interp, pool);
 
     if (!pmc)
         Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ALLOCATION_ERROR,
             "Parrot VM: PMC allocation failed!\n");
 
-    /* clear flags, set is_PMC_FLAG */
-    if (flags & PObj_is_PMC_EXT_FLAG) {
-        Small_Object_Pool * const pool = interp->arena_base->pmc_ext_pool;
-        flags |= PObj_is_special_PMC_FLAG;
-        pmc->pmc_ext = (PMC_EXT *)pool->get_free_object(interp, pool);
-
-        if (flags & PObj_is_PMC_shared_FLAG)
-            Parrot_gc_add_pmc_sync(interp, pmc);
-    }
-    else
-        pmc->pmc_ext = NULL;
+    if (flags & PObj_is_PMC_shared_FLAG)
+        Parrot_gc_add_pmc_sync(interp, pmc);
 
     PObj_get_FLAGS(pmc) = PObj_is_PMC_FLAG|flags;
     pmc->vtable         = NULL;
@@ -364,14 +418,10 @@
 Parrot_gc_free_pmc_header(PARROT_INTERP, ARGMOD(PMC *pmc))
 {
     ASSERT_ARGS(Parrot_gc_free_pmc_header)
-    Small_Object_Pool * const pool = (PObj_constant_TEST(pmc)) ?
-        interp->arena_base->constant_pmc_pool : interp->arena_base->pmc_pool;
-
-    if (PObj_active_destroy_TEST(pmc))
-        VTABLE_destroy(interp, pmc);
+    Fixed_Size_Pool * const pool = (PObj_constant_TEST(pmc)) ?
+        interp->mem_pools->constant_pmc_pool : interp->mem_pools->pmc_pool;
 
-    if (PObj_is_PMC_EXT_TEST(pmc))
-        Parrot_gc_free_pmc_ext(interp, pmc);
+    Parrot_pmc_destroy(interp, pmc);
 
     PObj_flags_SETTO((PObj *)pmc, PObj_on_free_list_FLAG);
     pool->add_free_object(interp, pool, (PObj *)pmc);
@@ -380,71 +430,24 @@
 
 /*
 
-=item C<void Parrot_gc_add_pmc_ext(PARROT_INTERP, PMC *pmc)>
+=item C<void Parrot_gc_free_pmc_sync(PARROT_INTERP, PMC *p)>
 
-Obtains a new C<PMC_EXT> structure, and attaches it to the given C<PMC>.
-Sets the necessary flags associated with the PMC_EXT structure. Ensures
-that the PMC_EXT structure is marked as "alive" by the GC.
+Frees the PMC_sync field of the PMC, if one exists.
 
 =cut
 
 */
 
 void
-Parrot_gc_add_pmc_ext(PARROT_INTERP, ARGMOD(PMC *pmc))
+Parrot_gc_free_pmc_sync(PARROT_INTERP, ARGMOD(PMC *p))
 {
-    ASSERT_ARGS(Parrot_gc_add_pmc_ext)
-    Small_Object_Pool * const pool = interp->arena_base->pmc_ext_pool;
-    if (!pmc->pmc_ext)
-        pmc->pmc_ext = (PMC_EXT *)pool->get_free_object(interp, pool);
-    if (!pmc->pmc_ext)
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ALLOCATION_ERROR,
-            "Parrot VM: PMC_EXT allocation failed!\n");
-    PObj_is_PMC_EXT_SET(pmc);
-    PObj_is_special_PMC_SET(pmc);
-
-#ifdef PARROT_GC_IMS
-    /*
-     * preserve DDD color: a simple PMC  live = black
-     *                     an aggregate  live = grey
-     * set'em black
-     */
-    if (PObj_live_TEST(pmc))
-        PObj_get_FLAGS(pmc) |= PObj_custom_GC_FLAG;
-#endif
-
-    PMC_next_for_GC(pmc) = PMCNULL;
-}
-
-/*
-
-=item C<void Parrot_gc_free_pmc_ext(PARROT_INTERP, PMC *p)>
-
-Frees the C<PMC_EXT> structure attached to a PMC, if it exists.
-
-=cut
-
-*/
-
-void
-Parrot_gc_free_pmc_ext(PARROT_INTERP, ARGMOD(PMC *p))
-{
-    ASSERT_ARGS(Parrot_gc_free_pmc_ext)
-    /* if the PMC has a PMC_EXT structure, return it to the pool/arena */
-    Arenas            * const arena_base = interp->arena_base;
-    Small_Object_Pool * const ext_pool   = arena_base->pmc_ext_pool;
-
-    if (!p->pmc_ext)
-        return;
+    ASSERT_ARGS(Parrot_gc_free_pmc_sync)
 
     if (PObj_is_PMC_shared_TEST(p) && PMC_sync(p)) {
         MUTEX_DESTROY(PMC_sync(p)->pmc_lock);
         mem_internal_free(PMC_sync(p));
         PMC_sync(p) = NULL;
     }
-    ext_pool->add_free_object(interp, ext_pool, p->pmc_ext);
-    ext_pool->num_free_objects++;
-    p->pmc_ext = NULL;
 }
 
 /*
@@ -463,12 +466,13 @@
 Parrot_gc_add_pmc_sync(PARROT_INTERP, ARGMOD(PMC *pmc))
 {
     ASSERT_ARGS(Parrot_gc_add_pmc_sync)
-    if (!PObj_is_PMC_EXT_TEST(pmc))
-        Parrot_gc_add_pmc_ext(interp, pmc);
+
+    /* This mutex already exists, leave it alone. */
     if (PMC_sync(pmc))
-        /* This mutex already exists, leave it alone. */
         return;
+
     PMC_sync(pmc) = mem_allocate_typed(Sync);
+
     if (!PMC_sync(pmc))
         Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ALLOCATION_ERROR,
             "Parrot VM: PMC Sync allocation failed!\n");
@@ -496,10 +500,11 @@
 Parrot_gc_new_string_header(PARROT_INTERP, UINTVAL flags)
 {
     ASSERT_ARGS(Parrot_gc_new_string_header)
+
     STRING * const string = (STRING *)get_free_buffer(interp,
         (flags & PObj_constant_FLAG)
-            ? interp->arena_base->constant_string_header_pool
-            : interp->arena_base->string_header_pool);
+            ? interp->mem_pools->constant_string_header_pool
+            : interp->mem_pools->string_header_pool);
     if (!string)
         Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ALLOCATION_ERROR,
             "Parrot VM: STRING allocation failed!\n");
@@ -526,7 +531,7 @@
 {
     ASSERT_ARGS(Parrot_gc_free_string_header)
     if (!PObj_constant_TEST(s)) {
-        Small_Object_Pool * const pool = interp->arena_base->string_header_pool;
+        Fixed_Size_Pool * const pool = interp->mem_pools->string_header_pool;
         pool->add_free_object(interp, pool, s);
     }
 }
@@ -538,8 +543,7 @@
 Returns a new buffer-like header from the appropriate sized pool.
 A "bufferlike object" is an object that is considered to be isomorphic to the
 PObj, so it will participate in normal GC. At the moment these are only used
-to create ListChunk objects in src/list.c and Stack_Chunk objects in
-src/stacks.c.
+to create ListChunk objects in src/list.c.
 
 =cut
 
@@ -551,14 +555,15 @@
 Parrot_gc_new_bufferlike_header(PARROT_INTERP, size_t size)
 {
     ASSERT_ARGS(Parrot_gc_new_bufferlike_header)
-    Small_Object_Pool * const pool = get_bufferlike_pool(interp, size);
+
+    Fixed_Size_Pool * const pool = get_bufferlike_pool(interp, size);
 
     return get_free_buffer(interp, pool);
 }
 
 /*
 
-=item C<static void * get_free_buffer(PARROT_INTERP, Small_Object_Pool *pool)>
+=item C<static void * get_free_buffer(PARROT_INTERP, Fixed_Size_Pool *pool)>
 
 Gets a free object or buffer from the given C<pool> and returns it.  If the
 object is larger then a standard C<PObj> structure, all additional memory is
@@ -571,25 +576,15 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 static void *
-get_free_buffer(PARROT_INTERP, ARGIN(Small_Object_Pool *pool))
+get_free_buffer(PARROT_INTERP, ARGIN(Fixed_Size_Pool *pool))
 {
     ASSERT_ARGS(get_free_buffer)
-    PObj * const buffer = (PObj *)pool->get_free_object(interp, pool);
-
-    /* don't mess around with flags */
-    PObj_bufstart(buffer) = NULL;
-    PObj_buflen(buffer)   = 0;
-
-    if (pool->object_size - GC_HEADER_SIZE > sizeof (PObj))
-        memset(buffer + 1, 0,
-                pool->object_size - sizeof (PObj) - GC_HEADER_SIZE);
-
-    return buffer;
+    return pool->get_free_object(interp, pool);
 }
 
 /*
 
-=item C<void Parrot_gc_free_bufferlike_header(PARROT_INTERP, PObj *obj, size_t
+=item C<void Parrot_gc_free_bufferlike_header(PARROT_INTERP, Buffer *obj, size_t
 size)>
 
 Free a bufferlike header that is not being used, so that Parrot can recycle
@@ -600,11 +595,11 @@
 */
 
 void
-Parrot_gc_free_bufferlike_header(PARROT_INTERP, ARGMOD(PObj *obj),
+Parrot_gc_free_bufferlike_header(PARROT_INTERP, ARGMOD(Buffer *obj),
     size_t size)
 {
     ASSERT_ARGS(Parrot_gc_free_bufferlike_header)
-    Small_Object_Pool * const pool = get_bufferlike_pool(interp, size);
+    Fixed_Size_Pool * const pool = get_bufferlike_pool(interp, size);
     pool->add_free_object(interp, pool, obj);
 }
 
@@ -629,16 +624,16 @@
     size_t new_size;
     char *mem;
 
-    PObj_buflen(buffer) = 0;
-    PObj_bufstart(buffer) = NULL;
+    Buffer_buflen(buffer) = 0;
+    Buffer_bufstart(buffer) = NULL;
     new_size = aligned_size(buffer, size);
     mem = (char *)mem_allocate(interp, new_size,
-        interp->arena_base->memory_pool);
+        interp->mem_pools->memory_pool);
     mem = aligned_mem(buffer, mem);
-    PObj_bufstart(buffer) = mem;
+    Buffer_bufstart(buffer) = mem;
     if (PObj_is_COWable_TEST(buffer))
         new_size -= sizeof (void*);
-    PObj_buflen(buffer) = new_size;
+    Buffer_buflen(buffer) = new_size;
 }
 
 /*
@@ -663,13 +658,13 @@
     ASSERT_ARGS(Parrot_gc_reallocate_buffer_storage)
     size_t copysize;
     char  *mem;
-    Memory_Pool * const pool = interp->arena_base->memory_pool;
+    Variable_Size_Pool * const pool = interp->mem_pools->memory_pool;
     size_t new_size, needed, old_size;
 
     /*
      * we don't shrink buffers
      */
-    if (newsize <= PObj_buflen(buffer))
+    if (newsize <= Buffer_buflen(buffer))
         return;
 
     /*
@@ -681,37 +676,38 @@
      * The normal case is therefore always to allocate a new block
      */
     new_size = aligned_size(buffer, newsize);
-    old_size = aligned_size(buffer, PObj_buflen(buffer));
+    old_size = aligned_size(buffer, Buffer_buflen(buffer));
     needed   = new_size - old_size;
 
     if ((pool->top_block->free >= needed)
-    &&  (pool->top_block->top  == (char *)PObj_bufstart(buffer) + old_size)) {
+    &&  (pool->top_block->top  == (char *)Buffer_bufstart(buffer) + old_size)) {
         pool->top_block->free -= needed;
         pool->top_block->top  += needed;
-        PObj_buflen(buffer) = newsize;
+        Buffer_buflen(buffer) = newsize;
         return;
     }
 
-    copysize = PObj_buflen(buffer);
+    copysize = Buffer_buflen(buffer);
 
     if (!PObj_COW_TEST(buffer))
         pool->guaranteed_reclaimable += copysize;
+    else
+        pool->possibly_reclaimable   += copysize;
 
-    pool->possibly_reclaimable += copysize;
-    mem                         = (char *)mem_allocate(interp, new_size, pool);
-    mem                         = aligned_mem(buffer, mem);
+    mem = (char *)mem_allocate(interp, new_size, pool);
+    mem = aligned_mem(buffer, mem);
 
     /* We shouldn't ever have a 0 from size, but we do. If we can track down
      * those bugs, this can be removed which would make things cheaper */
     if (copysize)
-        memcpy(mem, PObj_bufstart(buffer), copysize);
+        memcpy(mem, Buffer_bufstart(buffer), copysize);
 
-    PObj_bufstart(buffer) = mem;
+    Buffer_bufstart(buffer) = mem;
 
     if (PObj_is_COWable_TEST(buffer))
         new_size -= sizeof (void *);
 
-    PObj_buflen(buffer) = new_size;
+    Buffer_buflen(buffer) = new_size;
 }
 
 /*
@@ -734,29 +730,25 @@
 {
     ASSERT_ARGS(Parrot_gc_allocate_string_storage)
     size_t       new_size;
-    Memory_Pool *pool;
+    Variable_Size_Pool *pool;
     char        *mem;
 
-    PObj_buflen(str)   = 0;
-    PObj_bufstart(str) = NULL;
+    Buffer_buflen(str)   = 0;
+    Buffer_bufstart(str) = NULL;
 
-    /* there's no sense in allocating zero memory, when the overhead of
-     * allocating a string is one pointer; this can fill the pools in an
-     * uncompactable way.  See RT #42320.
-     */
     if (size == 0)
         return;
 
     pool     = PObj_constant_TEST(str)
-                ? interp->arena_base->constant_string_pool
-                : interp->arena_base->memory_pool;
+                ? interp->mem_pools->constant_string_pool
+                : interp->mem_pools->memory_pool;
 
     new_size = aligned_string_size(size);
     mem      = (char *)mem_allocate(interp, new_size, pool);
     mem     += sizeof (void*);
 
-    PObj_bufstart(str) = str->strstart = mem;
-    PObj_buflen(str)   = new_size - sizeof (void*);
+    Buffer_bufstart(str) = str->strstart = mem;
+    Buffer_buflen(str)   = new_size - sizeof (void*);
 }
 
 /*
@@ -781,13 +773,13 @@
     char *mem, *oldmem;
     size_t new_size, needed, old_size;
 
-    Memory_Pool * const pool =
+    Variable_Size_Pool * const pool =
         PObj_constant_TEST(str)
-            ? interp->arena_base->constant_string_pool
-            : interp->arena_base->memory_pool;
+            ? interp->mem_pools->constant_string_pool
+            : interp->mem_pools->memory_pool;
 
     /* if the requested size is smaller then buflen, we are done */
-    if (newsize <= PObj_buflen(str))
+    if (newsize <= Buffer_buflen(str))
         return;
 
     /*
@@ -796,14 +788,14 @@
      * - if there is enough size, we can just move the pool's top pointer
      */
     new_size = aligned_string_size(newsize);
-    old_size = aligned_string_size(PObj_buflen(str));
+    old_size = aligned_string_size(Buffer_buflen(str));
     needed   = new_size - old_size;
 
     if (pool->top_block->free >= needed
-    &&  pool->top_block->top  == (char *)PObj_bufstart(str) + old_size) {
+    &&  pool->top_block->top  == (char *)Buffer_bufstart(str) + old_size) {
         pool->top_block->free -= needed;
         pool->top_block->top  += needed;
-        PObj_buflen(str) = new_size - sizeof (void*);
+        Buffer_buflen(str) = new_size - sizeof (void*);
         return;
     }
 
@@ -813,18 +805,18 @@
     copysize = str->bufused;
 
     if (!PObj_COW_TEST(str))
-        pool->guaranteed_reclaimable += PObj_buflen(str);
-
-    pool->possibly_reclaimable += PObj_buflen(str);
+        pool->guaranteed_reclaimable += Buffer_buflen(str);
+    else
+        pool->possibly_reclaimable   += Buffer_buflen(str);
 
     mem = (char *)mem_allocate(interp, new_size, pool);
     mem += sizeof (void *);
 
     /* copy mem from strstart, *not* bufstart */
     oldmem             = str->strstart;
-    PObj_bufstart(str) = (void *)mem;
+    Buffer_bufstart(str) = (void *)mem;
     str->strstart      = mem;
-    PObj_buflen(str)   = new_size - sizeof (void*);
+    Buffer_buflen(str)   = new_size - sizeof (void*);
 
     /* We shouldn't ever have a 0 from size, but we do. If we can track down
      * those bugs, this can be removed which would make things cheaper */
@@ -847,8 +839,7 @@
 Parrot_gc_mark_and_sweep(PARROT_INTERP, UINTVAL flags)
 {
     ASSERT_ARGS(Parrot_gc_mark_and_sweep)
-    interp->arena_base->do_gc_mark(interp, flags);
-    parrot_gc_context(interp);
+    interp->gc_sys->do_gc_mark(interp, flags);
 }
 
 /*
@@ -867,7 +858,7 @@
 Parrot_gc_compact_memory_pool(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_gc_compact_memory_pool)
-    compact_pool(interp, interp->arena_base->memory_pool);
+    compact_pool(interp, interp->mem_pools->memory_pool);
 }
 
 /*
@@ -888,8 +879,8 @@
 {
     ASSERT_ARGS(Parrot_gc_merge_header_pools)
 
-    Arenas * const dest_arena   = dest_interp->arena_base;
-    Arenas * const source_arena = source_interp->arena_base;
+    Memory_Pools * const dest_arena   = dest_interp->mem_pools;
+    Memory_Pools * const source_arena = source_interp->mem_pools;
     UINTVAL        i;
 
     /* heavily borrowed from forall_header_pools */
@@ -905,16 +896,13 @@
             dest_arena->constant_string_header_pool,
             source_arena->constant_string_header_pool);
 
-    Parrot_gc_merge_buffer_pools(dest_interp,
-            dest_arena->pmc_ext_pool, source_arena->pmc_ext_pool);
-
     for (i = 0; i < source_arena->num_sized; ++i) {
         if (!source_arena->sized_header_pools[i])
             continue;
 
         if (i >= dest_arena->num_sized
         || !dest_arena->sized_header_pools[i]) {
-            Small_Object_Pool *ignored = get_bufferlike_pool(dest_interp,
+            Fixed_Size_Pool *ignored = get_bufferlike_pool(dest_interp,
                     i * sizeof (void *));
             UNUSED(ignored);
             PARROT_ASSERT(dest_arena->sized_header_pools[i]);
@@ -928,8 +916,8 @@
 
 /*
 
-=item C<static void Parrot_gc_merge_buffer_pools(PARROT_INTERP,
-Small_Object_Pool *dest, Small_Object_Pool *source)>
+=item C<static void Parrot_gc_merge_buffer_pools(PARROT_INTERP, Fixed_Size_Pool
+*dest, Fixed_Size_Pool *source)>
 
 Merge pool C<source> into pool C<dest>. Combines the free lists directly,
 moves all arenas to the new pool, and remove the old pool. To merge, the
@@ -942,11 +930,11 @@
 
 static void
 Parrot_gc_merge_buffer_pools(PARROT_INTERP,
-        ARGMOD(Small_Object_Pool *dest), ARGMOD(Small_Object_Pool *source))
+        ARGMOD(Fixed_Size_Pool *dest), ARGMOD(Fixed_Size_Pool *source))
 {
     ASSERT_ARGS(Parrot_gc_merge_buffer_pools)
-    Small_Object_Arena  *cur_arena;
-    void               **free_list_end;
+    Fixed_Size_Arena  *cur_arena;
+    GC_MS_PObj_Wrapper  *free_list_end;
 
     PARROT_ASSERT(dest->object_size == source->object_size);
     PARROT_ASSERT((dest->name == NULL && source->name == NULL)
@@ -956,19 +944,23 @@
 
     /* append new free_list to old */
     /* XXX this won't work with, e.g., gc_gms */
-    free_list_end  = &dest->free_list;
+    free_list_end = dest->free_list;
 
-    while (*free_list_end)
-        free_list_end = (void **)*free_list_end;
+    if (free_list_end == NULL)
+        dest->free_list = source->free_list;
+    else {
+        while (free_list_end->next_ptr)
+            free_list_end = free_list_end->next_ptr;
 
-    *free_list_end = source->free_list;
+        free_list_end->next_ptr = source->free_list;
+    }
 
     /* now append source arenas */
     cur_arena = source->last_Arena;
 
     while (cur_arena) {
         size_t                     total_objects;
-        Small_Object_Arena * const next_arena = cur_arena->prev;
+        Fixed_Size_Arena * const next_arena = cur_arena->prev;
 
         cur_arena->next = cur_arena->prev = NULL;
 
@@ -992,7 +984,7 @@
 
 /*
 
-=item C<static void fix_pmc_syncs(Interp *dest_interp, Small_Object_Pool *pool)>
+=item C<static void fix_pmc_syncs(Interp *dest_interp, Fixed_Size_Pool *pool)>
 
 Walks through the given arena, looking for all live and shared PMCs,
 transferring their sync values to the destination interpreter.
@@ -1002,14 +994,14 @@
 */
 
 static void
-fix_pmc_syncs(ARGMOD(Interp *dest_interp), ARGIN(Small_Object_Pool *pool))
+fix_pmc_syncs(ARGMOD(Interp *dest_interp), ARGIN(Fixed_Size_Pool *pool))
 {
     ASSERT_ARGS(fix_pmc_syncs)
-    Small_Object_Arena *cur_arena;
+    Fixed_Size_Arena *cur_arena;
     const UINTVAL       object_size = pool->object_size;
 
     for (cur_arena = pool->last_Arena; cur_arena; cur_arena = cur_arena->prev) {
-        PMC   *p = (PMC *)((char*)cur_arena->start_objects + GC_HEADER_SIZE);
+        PMC   *p = (PMC *)((char*)cur_arena->start_objects);
         size_t i;
 
         for (i = 0; i < cur_arena->used; i++) {
@@ -1036,7 +1028,7 @@
 Performs a garbage collection sweep on all pools, then frees them.  Calls
 C<header_pools_iterate_callback> to loop over all the pools, passing
 C<sweep_cb_pmc> and C<sweep_cb_buf> callback routines. Frees the array of sized
-header pointers in the C<Arenas> structure too.
+header pointers in the C<Memory_Pools> structure too.
 
 =cut
 
@@ -1053,11 +1045,7 @@
      * COW refcount is done, in 2. refcounting
      * in 3rd freeing
      */
-#ifdef GC_IS_MALLOC
-    const INTVAL start = 0;
-#else
     const INTVAL start = 2;
-#endif
 
     header_pools_iterate_callback(interp, POOL_PMC, NULL, sweep_cb_pmc);
     header_pools_iterate_callback(interp, POOL_PMC | POOL_CONST, NULL,
@@ -1068,17 +1056,38 @@
                 (void *)pass, sweep_cb_buf);
     }
 
-    free_pool(interp->arena_base->pmc_ext_pool);
-    interp->arena_base->pmc_ext_pool = NULL;
+    mem_internal_free(interp->mem_pools->sized_header_pools);
 
-    mem_internal_free(interp->arena_base->sized_header_pools);
-    interp->arena_base->sized_header_pools = NULL;
+    if (interp->mem_pools->attrib_pools) {
+        unsigned int i;
+        for (i = 0; i < interp->mem_pools->num_attribs; i++) {
+            PMC_Attribute_Pool  *pool  = interp->mem_pools->attrib_pools[i];
+            PMC_Attribute_Arena *arena;
+
+            if (!pool)
+                continue;
+
+            arena = pool->top_arena;
+
+            while (arena) {
+                PMC_Attribute_Arena *next = arena->next;
+                mem_internal_free(arena);
+                arena = next;
+            }
+            mem_internal_free(pool);
+        }
+
+        mem_internal_free(interp->mem_pools->attrib_pools);
+    }
+
+    interp->mem_pools->attrib_pools       = NULL;
+    interp->mem_pools->sized_header_pools = NULL;
 }
 
 /*
 
-=item C<static int sweep_cb_pmc(PARROT_INTERP, Small_Object_Pool *pool, int
-flag, void *arg)>
+=item C<static int sweep_cb_pmc(PARROT_INTERP, Fixed_Size_Pool *pool, int flag,
+void *arg)>
 
 Performs a garbage collection sweep of the given pmc pool, then frees it. Calls
 C<Parrot_gc_sweep_pool> to perform the sweep, and C<free_pool> to free the pool and
@@ -1089,9 +1098,10 @@
 */
 
 static int
-sweep_cb_pmc(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool),
+sweep_cb_pmc(PARROT_INTERP, ARGMOD(Fixed_Size_Pool *pool),
         SHIM(int flag), SHIM(void *arg))
 {
+    ASSERT_ARGS(sweep_cb_pmc)
     Parrot_gc_sweep_pool(interp, pool);
     free_pool(pool);
     return 0;
@@ -1099,8 +1109,8 @@
 
 /*
 
-=item C<static int sweep_cb_buf(PARROT_INTERP, Small_Object_Pool *pool, int
-flag, void *arg)>
+=item C<static int sweep_cb_buf(PARROT_INTERP, Fixed_Size_Pool *pool, int flag,
+void *arg)>
 
 Performs a final garbage collection sweep, then frees the pool. Calls
 C<Parrot_gc_sweep_pool> to perform the sweep, and C<free_pool> to free the pool and
@@ -1111,31 +1121,20 @@
 */
 
 static int
-sweep_cb_buf(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool), SHIM(int flag),
+sweep_cb_buf(PARROT_INTERP, ARGMOD(Fixed_Size_Pool *pool), SHIM(int flag),
         ARGIN(void *arg))
 {
-#ifdef GC_IS_MALLOC
-    const int pass = (int)(INTVAL)arg;
-
-    if (pass == 0)
-        clear_cow(interp, pool, 1);
-    else if (pass == 1)
-        used_cow(interp, pool, 1);
-    else
-#endif
-
-    {
-        UNUSED(arg);
-        Parrot_gc_sweep_pool(interp, pool);
-        free_pool(pool);
-    }
+    ASSERT_ARGS(sweep_cb_buf)
+    UNUSED(arg);
+    Parrot_gc_sweep_pool(interp, pool);
+    free_pool(pool);
 
     return 0;
 }
 
 /*
 
-=item C<static void free_pool(Small_Object_Pool *pool)>
+=item C<static void free_pool(Fixed_Size_Pool *pool)>
 
 Frees a pool and all of its arenas. Loops through the list of arenas backwards
 and returns each to the memory manager. Then, frees the pool structure itself.
@@ -1145,13 +1144,13 @@
 */
 
 static void
-free_pool(ARGMOD(Small_Object_Pool *pool))
+free_pool(ARGMOD(Fixed_Size_Pool *pool))
 {
     ASSERT_ARGS(free_pool)
-    Small_Object_Arena *cur_arena;
+    Fixed_Size_Arena *cur_arena;
 
     for (cur_arena = pool->last_Arena; cur_arena;) {
-        Small_Object_Arena * const next = cur_arena->prev;
+        Fixed_Size_Arena * const next = cur_arena->prev;
         mem_internal_free(cur_arena->start_objects);
         mem_internal_free(cur_arena);
         cur_arena = next;
@@ -1179,9 +1178,9 @@
     int i;
 
     for (i = 0; i < 2; i++) {
-        Memory_Pool * const pool = i ?
-                interp->arena_base->constant_string_pool :
-                interp->arena_base->memory_pool;
+        Variable_Size_Pool * const pool = i ?
+                interp->mem_pools->constant_string_pool :
+                interp->mem_pools->memory_pool;
         Memory_Block *cur_block;
 
         cur_block = pool->top_block;
@@ -1212,7 +1211,7 @@
 Parrot_gc_ptr_in_memory_pool(PARROT_INTERP, ARGIN(void *bufstart))
 {
     ASSERT_ARGS(Parrot_gc_ptr_in_memory_pool)
-    Memory_Pool * const pool = interp->arena_base->memory_pool;
+    Variable_Size_Pool * const pool = interp->mem_pools->memory_pool;
     Memory_Block * cur_block = pool->top_block;
 
     while (cur_block) {
@@ -1240,8 +1239,8 @@
 Parrot_gc_ptr_is_pmc(PARROT_INTERP, ARGIN(void *ptr))
 {
     ASSERT_ARGS(Parrot_gc_ptr_is_pmc)
-    return contained_in_pool(interp->arena_base->pmc_pool, ptr) ||
-           contained_in_pool(interp->arena_base->constant_pmc_pool, ptr);
+        return contained_in_pool(interp, interp->mem_pools->pmc_pool, ptr) ||
+        contained_in_pool(interp, interp->mem_pools->constant_pmc_pool, ptr);
 }
 
 /*
@@ -1260,11 +1259,10 @@
 {
     ASSERT_ARGS(Parrot_gc_get_pmc_index)
     UINTVAL id = 1;     /* first PMC in first arena */
-    Small_Object_Arena *arena;
-    Small_Object_Pool *pool;
+    Fixed_Size_Arena *arena;
+    Fixed_Size_Pool *pool;
 
-    pmc = (PMC*)PObj_to_ARENA(pmc);
-    pool = interp->arena_base->pmc_pool;
+    pool = interp->mem_pools->pmc_pool;
     for (arena = pool->last_Arena; arena; arena = arena->prev) {
         const ptrdiff_t ptr_diff = (ptrdiff_t)pmc - (ptrdiff_t)arena->start_objects;
         if (ptr_diff >= 0 && ptr_diff <
@@ -1276,7 +1274,7 @@
         id += arena->total_objects;
     }
 
-    pool = interp->arena_base->constant_pmc_pool;
+    pool = interp->mem_pools->constant_pmc_pool;
     for (arena = pool->last_Arena; arena; arena = arena->prev) {
         const ptrdiff_t ptr_diff = (ptrdiff_t)pmc - (ptrdiff_t)arena->start_objects;
         if (ptr_diff >= 0 && ptr_diff <
@@ -1293,55 +1291,6 @@
 
 /*
 
-=item C<void Parrot_gc_cleanup_next_for_GC(PARROT_INTERP)>
-
-Cleans up the C<next_for_GC> pointers. Sets all of them in the PMC and Constant
-PMC pools to NULL.
-
-=cut
-
-*/
-
-void
-Parrot_gc_cleanup_next_for_GC(PARROT_INTERP)
-{
-    ASSERT_ARGS(Parrot_gc_cleanup_next_for_GC)
-    cleanup_next_for_GC_pool(interp->arena_base->pmc_pool);
-    cleanup_next_for_GC_pool(interp->arena_base->constant_pmc_pool);
-}
-
-/*
-
-=item C<static void cleanup_next_for_GC_pool(Small_Object_Pool *pool)>
-
-Sets all the C<next_for_GC> pointers to C<NULL>.
-
-=cut
-
-*/
-
-static void
-cleanup_next_for_GC_pool(ARGIN(Small_Object_Pool *pool))
-{
-    ASSERT_ARGS(cleanup_next_for_GC_pool)
-    Small_Object_Arena *arena;
-
-    for (arena = pool->last_Arena; arena; arena = arena->prev) {
-        PMC *p = (PMC *)arena->start_objects;
-        UINTVAL i;
-
-        for (i = 0; i < arena->used; i++) {
-            if (!PObj_on_free_list_TEST(p)) {
-                if (p->pmc_ext)
-                    PMC_next_for_GC(p) = PMCNULL;
-            }
-            p++;
-        }
-    }
-}
-
-/*
-
 =item C<int Parrot_gc_active_sized_buffers(PARROT_INTERP)>
 
 Returns the number of actively used sized buffers.
@@ -1355,10 +1304,10 @@
 {
     ASSERT_ARGS(Parrot_gc_active_sized_buffers)
     int j, ret = 0;
-    const Arenas * const arena_base = interp->arena_base;
-    for (j = 0; j < (INTVAL)arena_base->num_sized; j++) {
-        Small_Object_Pool * const header_pool =
-            arena_base->sized_header_pools[j];
+    const Memory_Pools * const mem_pools = interp->mem_pools;
+    for (j = 0; j < (INTVAL)mem_pools->num_sized; j++) {
+        Fixed_Size_Pool * const header_pool =
+            mem_pools->sized_header_pools[j];
         if (header_pool)
             ret += header_pool->total_objects -
                 header_pool->num_free_objects;
@@ -1381,10 +1330,10 @@
 {
     ASSERT_ARGS(Parrot_gc_total_sized_buffers)
     int j, ret = 0;
-    const Arenas * const arena_base = interp->arena_base;
-    for (j = 0; j < (INTVAL)arena_base->num_sized; j++) {
-        Small_Object_Pool * const header_pool =
-            arena_base->sized_header_pools[j];
+    const Memory_Pools * const mem_pools = interp->mem_pools;
+    for (j = 0; j < (INTVAL)mem_pools->num_sized; j++) {
+        Fixed_Size_Pool * const header_pool =
+            mem_pools->sized_header_pools[j];
         if (header_pool)
             ret += header_pool->total_objects;
     }
@@ -1405,9 +1354,9 @@
 Parrot_gc_active_pmcs(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_gc_active_pmcs)
-    const Arenas * const arena_base = interp->arena_base;
-    return arena_base->pmc_pool->total_objects -
-           arena_base->pmc_pool->num_free_objects;
+    const Memory_Pools * const mem_pools = interp->mem_pools;
+    return mem_pools->pmc_pool->total_objects -
+           mem_pools->pmc_pool->num_free_objects;
 }
 
 /*
@@ -1424,8 +1373,8 @@
 Parrot_gc_total_pmcs(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_gc_total_pmcs)
-    const Arenas * const arena_base = interp->arena_base;
-    return arena_base->pmc_pool->total_objects;
+    const Memory_Pools * const mem_pools = interp->mem_pools;
+    return mem_pools->pmc_pool->total_objects;
 }
 
 /*
@@ -1460,84 +1409,70 @@
 
 Returns the number of PMCs that are marked as needing timely destruction.
 
-=item C<UINTVAL Parrot_gc_extended_pmcs(PARROT_INTERP)>
-
-Returns the number of extended PMCs.
-
-=cut
-
 */
 
 size_t
 Parrot_gc_count_mark_runs(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_gc_count_mark_runs)
-    const Arenas * const arena_base = interp->arena_base;
-    return arena_base->gc_mark_runs;
+    const Memory_Pools * const mem_pools = interp->mem_pools;
+    return mem_pools->gc_mark_runs;
 }
 
 size_t
 Parrot_gc_count_collect_runs(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_gc_count_collect_runs)
-    const Arenas * const arena_base = interp->arena_base;
-    return arena_base->gc_collect_runs;
+    const Memory_Pools * const mem_pools = interp->mem_pools;
+    return mem_pools->gc_collect_runs;
 }
 
 size_t
 Parrot_gc_count_lazy_mark_runs(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_gc_count_lazy_mark_runs)
-    const Arenas * const arena_base = interp->arena_base;
-    return arena_base->gc_lazy_mark_runs;;
+    const Memory_Pools * const mem_pools = interp->mem_pools;
+    return mem_pools->gc_lazy_mark_runs;;
 }
 
 size_t
 Parrot_gc_total_memory_allocated(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_gc_total_memory_allocated)
-    const Arenas * const arena_base = interp->arena_base;
-    return arena_base->memory_allocated;
+    const Memory_Pools * const mem_pools = interp->mem_pools;
+    return mem_pools->memory_allocated;
 }
 
 size_t
 Parrot_gc_headers_alloc_since_last_collect(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_gc_headers_alloc_since_last_collect)
-    const Arenas * const arena_base = interp->arena_base;
-    return arena_base->header_allocs_since_last_collect;
+    const Memory_Pools * const mem_pools = interp->mem_pools;
+    return mem_pools->header_allocs_since_last_collect;
 }
 
 size_t
 Parrot_gc_mem_alloc_since_last_collect(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_gc_mem_alloc_since_last_collect)
-    const Arenas * const arena_base = interp->arena_base;
-    return arena_base->mem_allocs_since_last_collect;
+    const Memory_Pools * const mem_pools = interp->mem_pools;
+    return mem_pools->mem_allocs_since_last_collect;
 }
 
 UINTVAL
 Parrot_gc_total_copied(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_gc_total_copied)
-    const Arenas * const arena_base = interp->arena_base;
-    return arena_base->memory_collected;
+    const Memory_Pools * const mem_pools = interp->mem_pools;
+    return mem_pools->memory_collected;
 }
 
 UINTVAL
 Parrot_gc_impatient_pmcs(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_gc_impatient_pmcs)
-    const Arenas * const arena_base = interp->arena_base;
-    return arena_base->num_early_gc_PMCs;
-}
-
-UINTVAL
-Parrot_gc_extended_pmcs(PARROT_INTERP)
-{
-    ASSERT_ARGS(Parrot_gc_extended_pmcs)
-    const Arenas * const arena_base = interp->arena_base;
-    return arena_base->num_extended_PMCs;
+    const Memory_Pools * const mem_pools = interp->mem_pools;
+    return mem_pools->num_early_gc_PMCs;
 }
 
 /*
@@ -1580,7 +1515,7 @@
 Parrot_block_GC_mark(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_block_GC_mark)
-    interp->arena_base->gc_mark_block_level++;
+    interp->mem_pools->gc_mark_block_level++;
     Parrot_shared_gc_block(interp);
 }
 
@@ -1589,8 +1524,8 @@
 Parrot_unblock_GC_mark(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_unblock_GC_mark)
-    if (interp->arena_base->gc_mark_block_level) {
-        interp->arena_base->gc_mark_block_level--;
+    if (interp->mem_pools->gc_mark_block_level) {
+        interp->mem_pools->gc_mark_block_level--;
         Parrot_shared_gc_unblock(interp);
     }
 }
@@ -1600,7 +1535,7 @@
 Parrot_block_GC_sweep(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_block_GC_sweep)
-    interp->arena_base->gc_sweep_block_level++;
+    interp->mem_pools->gc_sweep_block_level++;
 }
 
 PARROT_EXPORT
@@ -1608,8 +1543,8 @@
 Parrot_unblock_GC_sweep(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_unblock_GC_sweep)
-    if (interp->arena_base->gc_sweep_block_level)
-        interp->arena_base->gc_sweep_block_level--;
+    if (interp->mem_pools->gc_sweep_block_level)
+        interp->mem_pools->gc_sweep_block_level--;
 }
 
 PARROT_EXPORT
@@ -1617,7 +1552,7 @@
 Parrot_is_blocked_GC_mark(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_is_blocked_GC_mark)
-    return interp->arena_base->gc_mark_block_level;
+    return interp->mem_pools->gc_mark_block_level;
 }
 
 PARROT_EXPORT
@@ -1625,15 +1560,15 @@
 Parrot_is_blocked_GC_sweep(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_is_blocked_GC_sweep)
-    return interp->arena_base->gc_sweep_block_level;
+    return interp->mem_pools->gc_sweep_block_level;
 }
 
 void
 Parrot_gc_completely_unblock(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_gc_completely_unblock)
-    interp->arena_base->gc_mark_block_level  = 0;
-    interp->arena_base->gc_sweep_block_level = 0;
+    interp->mem_pools->gc_mark_block_level  = 0;
+    interp->mem_pools->gc_sweep_block_level = 0;
 }
 
 /*
@@ -1651,7 +1586,144 @@
 {
     ASSERT_ARGS(Parrot_gc_pmc_needs_early_collection)
     PObj_needs_early_gc_SET(pmc);
-    ++interp->arena_base->num_early_gc_PMCs;
+    ++interp->mem_pools->num_early_gc_PMCs;
+}
+
+
+/*
+
+=item C<void * Parrot_gc_allocate_pmc_attributes(PARROT_INTERP, PMC *pmc)>
+
+Allocates a new attribute structure for a PMC if it has the auto_attrs flag
+set.
+
+=cut
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+void *
+Parrot_gc_allocate_pmc_attributes(PARROT_INTERP, ARGMOD(PMC *pmc))
+{
+    ASSERT_ARGS(Parrot_gc_allocate_pmc_attributes)
+    const size_t attr_size = pmc->vtable->attr_size;
+#if GC_USE_FIXED_SIZE_ALLOCATOR
+    PMC_Attribute_Pool * const pool = Parrot_gc_get_attribute_pool(interp,
+        attr_size);
+    void * const attrs = Parrot_gc_get_attributes_from_pool(interp, pool);
+    memset(attrs, 0, attr_size);
+    PMC_data(pmc) = attrs;
+    return attrs;
+#else
+    void * const data =  mem_sys_allocate_zeroed(attr_size);
+    PMC_data(pmc) = data;
+    return data;
+#endif
+}
+
+/*
+
+=item C<void Parrot_gc_free_pmc_attributes(PARROT_INTERP, PMC *pmc)>
+
+Deallocates an attibutes structure from a PMC if it has the auto_attrs
+flag set.
+
+*/
+
+void
+Parrot_gc_free_pmc_attributes(PARROT_INTERP, ARGMOD(PMC *pmc))
+{
+    ASSERT_ARGS(Parrot_gc_free_pmc_attributes)
+    void * const data = PMC_data(pmc);
+
+    if (data) {
+
+#if GC_USE_FIXED_SIZE_ALLOCATOR
+        const size_t attr_size = pmc->vtable->attr_size;
+        const size_t item_size = attr_size < sizeof (void *) ? sizeof (void *) : attr_size;
+        PMC_Attribute_Pool ** const pools = interp->mem_pools->attrib_pools;
+        const size_t idx = item_size - sizeof (void *);
+        Parrot_gc_free_attributes_from_pool(interp, pools[idx], data);
+#else
+        mem_sys_free(PMC_data(pmc));
+        PMC_data(pmc) = NULL;
+#endif
+    }
+}
+
+/*
+
+=item C<void * Parrot_gc_allocate_fixed_size_storage(PARROT_INTERP, size_t
+size)>
+
+Allocates a fixed-size chunk of memory for use. This memory is not manually
+managed and needs to be freed with C<Parrot_gc_free_fixed_size_storage>
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+void *
+Parrot_gc_allocate_fixed_size_storage(PARROT_INTERP, size_t size)
+{
+    ASSERT_ARGS(Parrot_gc_allocate_fixed_size_storage)
+    PMC_Attribute_Pool *pool = NULL;
+    const size_t idx = (size < sizeof (void *)) ? 0 : (size - sizeof (void *));
+
+    /* get the pool directly, if possible, for great speed */
+    if (interp->mem_pools->num_attribs > idx)
+        pool = interp->mem_pools->attrib_pools[idx];
+
+    /* otherwise create it */
+    if (!pool)
+        pool = Parrot_gc_get_attribute_pool(interp, size);
+
+    return Parrot_gc_get_attributes_from_pool(interp, pool);
+}
+
+/*
+
+=item C<void Parrot_gc_free_fixed_size_storage(PARROT_INTERP, size_t size, void
+*data)>
+
+Manually deallocates fixed size storage allocated with
+C<Parrot_gc_allocate_fixed_size_storage>
+
+*/
+
+void
+Parrot_gc_free_fixed_size_storage(PARROT_INTERP, size_t size, ARGMOD(void *data))
+{
+    ASSERT_ARGS(Parrot_gc_free_fixed_size_storage)
+
+    const size_t item_size = size < sizeof (void *) ? sizeof (void *) : size;
+    const size_t idx   = size - sizeof (void *);
+    PMC_Attribute_Pool ** const pools = interp->mem_pools->attrib_pools;
+    Parrot_gc_free_attributes_from_pool(interp, pools[idx], data);
+}
+
+
+/*
+
+=item C<static void Parrot_gc_free_attributes_from_pool(PARROT_INTERP,
+PMC_Attribute_Pool *pool, void *data)>
+
+Frees a fixed-size data item back to the pool for later reallocation.  Private
+to this file.
+
+*/
+
+static void
+Parrot_gc_free_attributes_from_pool(PARROT_INTERP,
+    ARGMOD(PMC_Attribute_Pool *pool),
+    ARGMOD(void *data))
+{
+    ASSERT_ARGS(Parrot_gc_free_attributes_from_pool)
+    PMC_Attribute_Free_List * const item = (PMC_Attribute_Free_List *)data;
+
+    item->next      = pool->free_list;
+    pool->free_list = item;
+
+    pool->num_free_objects++;
 }
 
 /*
@@ -1660,7 +1732,7 @@
 
 =head1 SEE ALSO
 
-F<include/parrot/gc_api.h>, F<src/cpu_dep.c> and F<docs/pdds/pdd09_gc.pod>.
+F<include/parrot/gc_api.h>, F<src/gc/system.c> and F<docs/pdds/pdd09_gc.pod>.
 
 =head1 HISTORY
 

Modified: branches/orderedhash_revamp/src/gc/gc_inf.c
==============================================================================
--- branches/orderedhash_revamp/src/gc/gc_inf.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/gc/gc_inf.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -38,45 +38,44 @@
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
 static void gc_inf_add_free_object(SHIM_INTERP,
-    ARGMOD(Small_Object_Pool *pool),
+    ARGMOD(Fixed_Size_Pool *pool),
     ARGIN(void *to_add))
         __attribute__nonnull__(2)
         __attribute__nonnull__(3)
         FUNC_MODIFIES(*pool);
 
-static void gc_inf_alloc_objects(SHIM_INTERP,
-    ARGMOD(Small_Object_Pool *pool))
+static void gc_inf_alloc_objects(SHIM_INTERP, ARGMOD(Fixed_Size_Pool *pool))
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*pool);
 
 PARROT_CANNOT_RETURN_NULL
 static void * gc_inf_get_free_object(SHIM_INTERP,
-    ARGMOD(Small_Object_Pool *pool))
+    ARGMOD(Fixed_Size_Pool *pool))
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*pool);
 
 static void gc_inf_mark_and_sweep(SHIM_INTERP, UINTVAL flags);
 static void gc_inf_more_traceable_objects(SHIM_INTERP,
-    ARGMOD(Small_Object_Pool *pool))
+    ARGMOD(Fixed_Size_Pool *pool))
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*pool);
 
-static void gc_inf_pool_init(SHIM_INTERP, ARGMOD(Small_Object_Pool *pool))
+static void gc_inf_pool_init(SHIM_INTERP, ARGMOD(Fixed_Size_Pool *pool))
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*pool);
 
-#define ASSERT_ARGS_gc_inf_add_free_object __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_gc_inf_add_free_object __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(pool) \
-    || PARROT_ASSERT_ARG(to_add)
-#define ASSERT_ARGS_gc_inf_alloc_objects __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_gc_inf_get_free_object __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_gc_inf_mark_and_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_gc_inf_more_traceable_objects __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_gc_inf_pool_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pool)
+    , PARROT_ASSERT_ARG(to_add))
+#define ASSERT_ARGS_gc_inf_alloc_objects __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(pool))
+#define ASSERT_ARGS_gc_inf_get_free_object __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(pool))
+#define ASSERT_ARGS_gc_inf_mark_and_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_gc_inf_more_traceable_objects __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(pool))
+#define ASSERT_ARGS_gc_inf_pool_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(pool))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -112,8 +111,8 @@
 
 /*
 
-=item C<static void gc_inf_add_free_object(PARROT_INTERP, Small_Object_Pool
-*pool, void *to_add)>
+=item C<static void gc_inf_add_free_object(PARROT_INTERP, Fixed_Size_Pool *pool,
+void *to_add)>
 
 Manually frees a chunk of memory. Normally this would return the memory
 to the free list of the pool, but in this case we just return it to the
@@ -128,7 +127,7 @@
 */
 
 static void
-gc_inf_add_free_object(SHIM_INTERP, ARGMOD(Small_Object_Pool *pool),
+gc_inf_add_free_object(SHIM_INTERP, ARGMOD(Fixed_Size_Pool *pool),
     ARGIN(void *to_add))
 {
     ASSERT_ARGS(gc_inf_add_free_object)
@@ -138,7 +137,7 @@
 
 /*
 
-=item C<static void * gc_inf_get_free_object(PARROT_INTERP, Small_Object_Pool
+=item C<static void * gc_inf_get_free_object(PARROT_INTERP, Fixed_Size_Pool
 *pool)>
 
 Gets a new object from the pool. Each pool specifies an object size in
@@ -161,7 +160,7 @@
 
 PARROT_CANNOT_RETURN_NULL
 static void *
-gc_inf_get_free_object(SHIM_INTERP, ARGMOD(Small_Object_Pool *pool))
+gc_inf_get_free_object(SHIM_INTERP, ARGMOD(Fixed_Size_Pool *pool))
 {
     ASSERT_ARGS(gc_inf_get_free_object)
     return calloc(pool->object_size, 1);
@@ -169,8 +168,7 @@
 
 /*
 
-=item C<static void gc_inf_alloc_objects(PARROT_INTERP, Small_Object_Pool
-*pool)>
+=item C<static void gc_inf_alloc_objects(PARROT_INTERP, Fixed_Size_Pool *pool)>
 
 Allocates a new arena of objects from the system. This function is only
 really used internally by the core, the API functions don't need to call
@@ -184,7 +182,7 @@
 */
 
 static void
-gc_inf_alloc_objects(SHIM_INTERP, ARGMOD(Small_Object_Pool *pool))
+gc_inf_alloc_objects(SHIM_INTERP, ARGMOD(Fixed_Size_Pool *pool))
 {
     ASSERT_ARGS(gc_inf_alloc_objects)
     UNUSED(pool);
@@ -192,8 +190,8 @@
 
 /*
 
-=item C<static void gc_inf_more_traceable_objects(PARROT_INTERP,
-Small_Object_Pool *pool)>
+=item C<static void gc_inf_more_traceable_objects(PARROT_INTERP, Fixed_Size_Pool
+*pool)>
 
 Would normally try to find new traceable objects by first running a GC sweep
 and then allocating a new arena from the system. Neither of these are
@@ -208,7 +206,7 @@
 */
 
 static void
-gc_inf_more_traceable_objects(SHIM_INTERP, ARGMOD(Small_Object_Pool *pool))
+gc_inf_more_traceable_objects(SHIM_INTERP, ARGMOD(Fixed_Size_Pool *pool))
 {
     ASSERT_ARGS(gc_inf_more_traceable_objects)
     UNUSED(pool);
@@ -216,15 +214,14 @@
 
 /*
 
-=item C<static void gc_inf_pool_init(PARROT_INTERP, Small_Object_Pool *pool)>
+=item C<static void gc_inf_pool_init(PARROT_INTERP, Fixed_Size_Pool *pool)>
 
 Initializes the function pointers in a new pool. When a new pool is created
 we assign several function pointers to it for managing memory in the pool.
 In this way we can treat different pools differently if they have special
-management needs. In general all PObj-like pools are treated one way, and
-other pools (such as the pmc_ext pool) are treated differently.
+management needs. In general all PObj-like pools are treated the same.
 
-This function is mostly called from the function C<initialize_header_pools>
+This function is mostly called from the function C<initialize_fixed_size_pools>
 in F<src/gc/mark_sweep.c> at Parrot startup.
 
 =cut
@@ -232,7 +229,7 @@
 */
 
 static void
-gc_inf_pool_init(SHIM_INTERP, ARGMOD(Small_Object_Pool *pool))
+gc_inf_pool_init(SHIM_INTERP, ARGMOD(Fixed_Size_Pool *pool))
 {
     ASSERT_ARGS(gc_inf_pool_init)
     pool->add_free_object = gc_inf_add_free_object;
@@ -246,7 +243,7 @@
 =item C<void Parrot_gc_inf_init(PARROT_INTERP)>
 
 Initializes the infinite memory collector. Installs the necessary function
-pointers into the Arenas structure. The two most important are the
+pointers into the Memory_Pools structure. The two most important are the
 C<mark_and_sweep> and C<pool_init> functions. C<finalize_gc_system> function
 will be called at Parrot exit and will shut down the GC system if things
 need to be flushed/closed/deactivated/freed/etc. It can be set to NULL if no
@@ -260,11 +257,10 @@
 Parrot_gc_inf_init(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_gc_inf_init)
-    Arenas * const arena_base     = interp->arena_base;
 
-    arena_base->do_gc_mark         = gc_inf_mark_and_sweep;
-    arena_base->finalize_gc_system = NULL;
-    arena_base->init_pool          = gc_inf_pool_init;
+    interp->gc_sys->do_gc_mark         = gc_inf_mark_and_sweep;
+    interp->gc_sys->finalize_gc_system = NULL;
+    interp->gc_sys->init_pool          = gc_inf_pool_init;
 }
 
 

Deleted: branches/orderedhash_revamp/src/gc/gc_malloc.c
==============================================================================
--- branches/orderedhash_revamp/src/gc/gc_malloc.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,188 +0,0 @@
-/*
-Copyright (C) 2001-2009, Parrot Foundation.
-$Id$
-
-=head1 NAME
-
-src/gc/gc_malloc.c - a malloc()/free()-based garbage collector.
-
-=head1 DESCRIPTION
-
-Handles garbage collection with malloc()/free().  Note that this doesn't
-currently work; this file just collects all of the #GC_MALLOC functions in one
-convenient place.
-
-=head2 Functions
-
-=over 4
-
-=cut
-
-*/
-
-#include "parrot/parrot.h"
-
-/* HEADERIZER HFILE: include/parrot/gc_api.h */
-
-/* HEADERIZER BEGIN: static */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-
-static void clear_cow(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool),
-    int cleanup)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pool);
-
-static int sweep_cb(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool),
-    int flag,
-    ARGMOD(void *arg))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(4)
-        FUNC_MODIFIES(*pool)
-        FUNC_MODIFIES(*arg);
-
-static void used_cow(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool),
-    int cleanup)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pool);
-
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: static */
-
-#ifdef GC_IS_MALLOC
-
-/*
-
-=item C<static int sweep_cb(PARROT_INTERP, Small_Object_Pool *pool, int flag, void *arg)>
-
-Sweeps the given pool for the MS collector. This function also ends
-the profiling timer, if profiling is enabled. Returns the total number
-of objects freed.
-
-=cut
-
-*/
-
-static int
-sweep_cb(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool), int flag,
-    ARGMOD(void *arg))
-{
-    int * const total_free = (int *) arg;
-
-    if (flag & POOL_BUFFER)
-        used_cow(interp, pool, 0);
-
-    Parrot_gc_sweep_pool(interp, pool);
-
-    if (flag & POOL_BUFFER)
-        clear_cow(interp, pool, 0);
-
-    if (interp->profile && (flag & POOL_PMC))
-        Parrot_gc_profile_end(interp, PARROT_PROF_GC_cp);
-
-    *total_free += pool->num_free_objects;
-
-    return 0;
-}
-
-
-/*
-
-=item C<static void clear_cow(PARROT_INTERP, Small_Object_Pool *pool, int cleanup)>
-
-Clears the COW ref count.
-
-=cut
-
-*/
-
-static void
-clear_cow(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool), int cleanup)
-{
-    const UINTVAL object_size = pool->object_size;
-    Small_Object_Arena *cur_arena;
-
-    /* clear refcount for COWable objects. */
-    for (cur_arena = pool->last_Arena;
-            NULL != cur_arena; cur_arena = cur_arena->prev) {
-        UINTVAL i;
-        Buffer *b = cur_arena->start_objects;
-
-        for (i = 0; i < cur_arena->used; i++) {
-            if (!PObj_on_free_list_TEST(b)) {
-                if (cleanup) {
-                    /* clear COWed external FLAG */
-                    PObj_external_CLEAR(b);
-
-                    /* if cleanup (Parrot_destroy) constants are dead too */
-                    PObj_constant_CLEAR(b);
-                    PObj_live_CLEAR(b);
-                }
-
-                if (PObj_COW_TEST(b) && PObj_bufstart(b) &&
-                        !PObj_external_TEST(b)) {
-                    INTVAL * const refcount = PObj_bufrefcountptr(b);
-                    *refcount               = 0;
-                }
-            }
-
-            b = (Buffer *)((char *)b + object_size);
-        }
-    }
-}
-
-
-/*
-
-=item C<static void used_cow(PARROT_INTERP, Small_Object_Pool *pool, int cleanup)>
-
-Finds other users of COW's C<bufstart>.
-
-=cut
-
-*/
-
-static void
-used_cow(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool), int cleanup)
-{
-    const UINTVAL object_size = pool->object_size;
-    Small_Object_Arena *cur_arena;
-
-    for (cur_arena = pool->last_Arena;
-            NULL != cur_arena; cur_arena = cur_arena->prev) {
-        const Buffer *b = cur_arena->start_objects;
-        UINTVAL i;
-
-        for (i = 0; i < cur_arena->used; i++) {
-            if (!PObj_on_free_list_TEST(b) &&
-                    PObj_COW_TEST(b) &&
-                    PObj_bufstart(b) &&
-                   !PObj_external_TEST(b)) {
-
-                INTVAL * const refcount = PObj_bufrefcountptr(b);
-
-                /* mark users of this bufstart by incrementing refcount */
-                if (PObj_live_TEST(b))
-                    *refcount = 1 << 29;        /* ~infinite usage */
-                else
-                    (*refcount)++;      /* dead usage */
-            }
-
-            b = (Buffer *)((char *)b + object_size);
-        }
-    }
-}
-
-#endif /* GC_IS_MALLOC */
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Modified: branches/orderedhash_revamp/src/gc/gc_ms.c
==============================================================================
--- branches/orderedhash_revamp/src/gc/gc_ms.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/gc/gc_ms.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -23,41 +23,27 @@
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
 static void gc_ms_add_free_object(SHIM_INTERP,
-    ARGMOD(Small_Object_Pool *pool),
-    ARGIN(void *to_add))
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*pool);
-
-static void gc_ms_add_free_pmc_ext(SHIM_INTERP,
-    ARGMOD(Small_Object_Pool *pool),
+    ARGMOD(Fixed_Size_Pool *pool),
     ARGIN(void *to_add))
         __attribute__nonnull__(2)
         __attribute__nonnull__(3)
         FUNC_MODIFIES(*pool);
 
 static void gc_ms_alloc_objects(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool))
+    ARGMOD(Fixed_Size_Pool *pool))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*pool);
 
-static void gc_ms_finalize(PARROT_INTERP, ARGIN(Arenas * const arena_base))
+static void gc_ms_finalize(PARROT_INTERP,
+    ARGIN(Memory_Pools * const mem_pools))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
 PARROT_CANNOT_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
 static void * gc_ms_get_free_object(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pool);
-
-PARROT_CANNOT_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-static void * gc_ms_get_free_pmc_ext(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool))
+    ARGMOD(Fixed_Size_Pool *pool))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*pool);
@@ -66,17 +52,17 @@
         __attribute__nonnull__(1);
 
 static void gc_ms_more_traceable_objects(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool))
+    ARGMOD(Fixed_Size_Pool *pool))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*pool);
 
-static void gc_ms_pool_init(SHIM_INTERP, ARGMOD(Small_Object_Pool *pool))
+static void gc_ms_pool_init(SHIM_INTERP, ARGMOD(Fixed_Size_Pool *pool))
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*pool);
 
 static int gc_ms_sweep_cb(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool),
+    ARGMOD(Fixed_Size_Pool *pool),
     int flag,
     ARGMOD(void *arg))
         __attribute__nonnull__(1)
@@ -89,50 +75,34 @@
     Parrot_gc_trace_type trace)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_gc_ms_add_free_object __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pool) \
-    || PARROT_ASSERT_ARG(to_add)
-#define ASSERT_ARGS_gc_ms_add_free_pmc_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_gc_ms_add_free_object __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(pool) \
-    || PARROT_ASSERT_ARG(to_add)
-#define ASSERT_ARGS_gc_ms_alloc_objects __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(to_add))
+#define ASSERT_ARGS_gc_ms_alloc_objects __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_gc_ms_finalize __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(pool))
+#define ASSERT_ARGS_gc_ms_finalize __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(arena_base)
-#define ASSERT_ARGS_gc_ms_get_free_object __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(mem_pools))
+#define ASSERT_ARGS_gc_ms_get_free_object __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_gc_ms_get_free_pmc_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(pool))
+#define ASSERT_ARGS_gc_ms_mark_and_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_gc_ms_more_traceable_objects __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_gc_ms_mark_and_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_gc_ms_more_traceable_objects __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(pool))
+#define ASSERT_ARGS_gc_ms_pool_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(pool))
+#define ASSERT_ARGS_gc_ms_sweep_cb __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_gc_ms_pool_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_gc_ms_sweep_cb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool) \
-    || PARROT_ASSERT_ARG(arg)
-#define ASSERT_ARGS_gc_ms_trace_active_PMCs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+    , PARROT_ASSERT_ARG(pool) \
+    , PARROT_ASSERT_ARG(arg))
+#define ASSERT_ARGS_gc_ms_trace_active_PMCs __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: static */
 
-/* the percent of used Arena items at which to trace next time through */
-#define GC_DEBUG_REPLENISH_LEVEL_FACTOR        0.0
-#define GC_DEBUG_UNITS_PER_ALLOC_GROWTH_FACTOR 1
-#define REPLENISH_LEVEL_FACTOR                 0.3
-
-/* this factor is totally arbitrary, but gives good timings for stress.pasm */
-#define UNITS_PER_ALLOC_GROWTH_FACTOR          1.75
-
-#define POOL_MAX_BYTES                         65536 * 128
-
 /*
 
 =head2 Primary MS Functions
@@ -154,11 +124,11 @@
 Parrot_gc_ms_init(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_gc_ms_init)
-    Arenas * const arena_base     = interp->arena_base;
 
-    arena_base->do_gc_mark         = gc_ms_mark_and_sweep;
-    arena_base->finalize_gc_system = NULL;
-    arena_base->init_pool          = gc_ms_pool_init;
+    interp->gc_sys->do_gc_mark         = gc_ms_mark_and_sweep;
+    interp->gc_sys->finalize_gc_system = NULL;
+    interp->gc_sys->init_pool          = gc_ms_pool_init;
+
 }
 
 /*
@@ -175,25 +145,25 @@
 gc_ms_mark_and_sweep(PARROT_INTERP, UINTVAL flags)
 {
     ASSERT_ARGS(gc_ms_mark_and_sweep)
-    Arenas * const arena_base = interp->arena_base;
+    Memory_Pools * const mem_pools = interp->mem_pools;
     int total_free = 0;
 
-    if (arena_base->gc_mark_block_level)
+    if (mem_pools->gc_mark_block_level)
         return;
 
     if (interp->pdb && interp->pdb->debugger) {
         /* The debugger could have performed a mark. Make sure everything is
            marked dead here, so that when we sweep it all gets collected */
-        Parrot_gc_clear_live_bits(interp, arena_base->pmc_pool);
+        Parrot_gc_clear_live_bits(interp, mem_pools->pmc_pool);
     }
 
     if (flags & GC_finish_FLAG) {
-        gc_ms_finalize(interp, arena_base);
+        gc_ms_finalize(interp, mem_pools);
         return;
     }
 
-    ++arena_base->gc_mark_block_level;
-    arena_base->lazy_gc = flags & GC_lazy_FLAG;
+    ++mem_pools->gc_mark_block_level;
+    mem_pools->lazy_gc = flags & GC_lazy_FLAG;
 
     /* tell the threading system that we're doing GC mark */
     pt_gc_start_mark(interp);
@@ -207,37 +177,34 @@
     if (gc_ms_trace_active_PMCs(interp, (flags & GC_trace_stack_FLAG)
         ? GC_TRACE_FULL : GC_TRACE_ROOT_ONLY)) {
 
-        arena_base->gc_trace_ptr = NULL;
-        arena_base->gc_mark_ptr  = NULL;
+        mem_pools->gc_trace_ptr = NULL;
+        mem_pools->gc_mark_ptr  = NULL;
 
         /* We've done the mark, now do the sweep. Pass the sweep callback
            function to the PMC pool and all the sized pools. */
         header_pools_iterate_callback(interp, POOL_BUFFER | POOL_PMC,
             (void*)&total_free, gc_ms_sweep_cb);
 
-        if (interp->profile)
-            Parrot_gc_profile_end(interp, PARROT_PROF_GC_cb);
     }
     else {
-        ++arena_base->gc_lazy_mark_runs;
+        ++mem_pools->gc_lazy_mark_runs;
 
-        Parrot_gc_clear_live_bits(interp, arena_base->pmc_pool);
-        if (interp->profile)
-            Parrot_gc_profile_end(interp, PARROT_PROF_GC_p2);
+        Parrot_gc_clear_live_bits(interp, mem_pools->pmc_pool);
     }
 
     pt_gc_stop_mark(interp);
 
     /* Note it */
-    arena_base->gc_mark_runs++;
-    --arena_base->gc_mark_block_level;
+    mem_pools->gc_mark_runs++;
+    --mem_pools->gc_mark_block_level;
 
     return;
 }
 
 /*
 
-=item C<static void gc_ms_finalize(PARROT_INTERP, Arenas * const arena_base)>
+=item C<static void gc_ms_finalize(PARROT_INTERP, Memory_Pools * const
+mem_pools)>
 
 Perform the finalization run, freeing all PMCs.
 
@@ -246,23 +213,23 @@
 */
 
 static void
-gc_ms_finalize(PARROT_INTERP, ARGIN(Arenas * const arena_base))
+gc_ms_finalize(PARROT_INTERP, ARGIN(Memory_Pools * const mem_pools))
 {
     ASSERT_ARGS(gc_ms_finalize)
-    Parrot_gc_clear_live_bits(interp, arena_base->pmc_pool);
-    Parrot_gc_clear_live_bits(interp, arena_base->constant_pmc_pool);
+    Parrot_gc_clear_live_bits(interp, mem_pools->pmc_pool);
+    Parrot_gc_clear_live_bits(interp, mem_pools->constant_pmc_pool);
 
     /* keep the scheduler and its kids alive for Task-like PMCs to destroy
      * themselves; run a sweep to collect them */
     if (interp->scheduler) {
-        Parrot_gc_mark_PObj_alive(interp, (PObj *)interp->scheduler);
+        Parrot_gc_mark_PMC_alive(interp, interp->scheduler);
         VTABLE_mark(interp, interp->scheduler);
-        Parrot_gc_sweep_pool(interp, interp->arena_base->pmc_pool);
+        Parrot_gc_sweep_pool(interp, interp->mem_pools->pmc_pool);
     }
 
     /* now sweep everything that's left */
-    Parrot_gc_sweep_pool(interp, interp->arena_base->pmc_pool);
-    Parrot_gc_sweep_pool(interp, interp->arena_base->constant_pmc_pool);
+    Parrot_gc_sweep_pool(interp, interp->mem_pools->pmc_pool);
+    Parrot_gc_sweep_pool(interp, interp->mem_pools->constant_pmc_pool);
 }
 
 
@@ -283,17 +250,19 @@
 gc_ms_trace_active_PMCs(PARROT_INTERP, Parrot_gc_trace_type trace)
 {
     ASSERT_ARGS(gc_ms_trace_active_PMCs)
+
     if (!Parrot_gc_trace_root(interp, trace))
         return 0;
 
-    /* Okay, we've marked the whole root set, and should have a good-sized
-     * list of things to look at. Run through it */
-    return Parrot_gc_trace_children(interp, (size_t) -1);
+    pt_gc_mark_root_finished(interp);
+    interp->mem_pools->gc_trace_ptr  = NULL;
+    return 1;
+
 }
 
 /*
 
-=item C<static int gc_ms_sweep_cb(PARROT_INTERP, Small_Object_Pool *pool, int
+=item C<static int gc_ms_sweep_cb(PARROT_INTERP, Fixed_Size_Pool *pool, int
 flag, void *arg)>
 
 Sweeps the given pool for the MS collector. This function also ends
@@ -305,7 +274,7 @@
 */
 
 static int
-gc_ms_sweep_cb(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool), int flag,
+gc_ms_sweep_cb(PARROT_INTERP, ARGMOD(Fixed_Size_Pool *pool), int flag,
     ARGMOD(void *arg))
 {
     ASSERT_ARGS(gc_ms_sweep_cb)
@@ -313,9 +282,6 @@
 
     Parrot_gc_sweep_pool(interp, pool);
 
-    if (interp->profile && (flag & POOL_PMC))
-        Parrot_gc_profile_end(interp, PARROT_PROF_GC_cp);
-
     *total_free += pool->num_free_objects;
 
     return 0;
@@ -329,7 +295,7 @@
 
 =over 4
 
-=item C<static void gc_ms_pool_init(PARROT_INTERP, Small_Object_Pool *pool)>
+=item C<static void gc_ms_pool_init(PARROT_INTERP, Fixed_Size_Pool *pool)>
 
 Initialize a memory pool for the MS garbage collector system. Sets the
 function pointers necessary to perform basic operations on a pool, such
@@ -340,7 +306,7 @@
 */
 
 static void
-gc_ms_pool_init(SHIM_INTERP, ARGMOD(Small_Object_Pool *pool))
+gc_ms_pool_init(SHIM_INTERP, ARGMOD(Fixed_Size_Pool *pool))
 {
     ASSERT_ARGS(gc_ms_pool_init)
     pool->add_free_object = gc_ms_add_free_object;
@@ -351,8 +317,8 @@
 
 /*
 
-=item C<static void gc_ms_more_traceable_objects(PARROT_INTERP,
-Small_Object_Pool *pool)>
+=item C<static void gc_ms_more_traceable_objects(PARROT_INTERP, Fixed_Size_Pool
+*pool)>
 
 We're out of traceable objects. First we try a GC run to free some up. If
 that doesn't work, allocate a new arena.
@@ -362,13 +328,14 @@
 */
 
 static void
-gc_ms_more_traceable_objects(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool))
+gc_ms_more_traceable_objects(PARROT_INTERP, ARGMOD(Fixed_Size_Pool *pool))
 {
     ASSERT_ARGS(gc_ms_more_traceable_objects)
+
     if (pool->skip)
         pool->skip = 0;
     else {
-        Small_Object_Arena * const arena = pool->last_Arena;
+        Fixed_Size_Arena * const arena = pool->last_Arena;
         if (arena
         &&  arena->used == arena->total_objects)
                 Parrot_gc_mark_and_sweep(interp, GC_trace_stack_FLAG);
@@ -376,15 +343,20 @@
 
     /* requires that num_free_objects be updated in Parrot_gc_mark_and_sweep.
        If gc is disabled, then we must check the free list directly. */
-    if (!pool->free_list
-    ||   pool->num_free_objects < pool->replenish_level)
+#if GC_USE_LAZY_ALLOCATOR
+    if ((!pool->free_list || pool->num_free_objects < pool->replenish_level)
+        && !pool->newfree)
         (*pool->alloc_objects) (interp, pool);
+#else
+    if (!pool->free_list || pool->num_free_objects < pool->replenish_level)
+    (*pool->alloc_objects) (interp, pool);
+#endif
 }
 
 /*
 
-=item C<static void gc_ms_add_free_object(PARROT_INTERP, Small_Object_Pool
-*pool, void *to_add)>
+=item C<static void gc_ms_add_free_object(PARROT_INTERP, Fixed_Size_Pool *pool,
+void *to_add)>
 
 Add an unused object back to the pool's free list for later reuse. Set
 the PObj flags to indicate that the item is free.
@@ -394,21 +366,21 @@
 */
 
 static void
-gc_ms_add_free_object(SHIM_INTERP, ARGMOD(Small_Object_Pool *pool),
+gc_ms_add_free_object(SHIM_INTERP, ARGMOD(Fixed_Size_Pool *pool),
     ARGIN(void *to_add))
 {
     ASSERT_ARGS(gc_ms_add_free_object)
-    PObj *object           = (PObj *)to_add;
+    GC_MS_PObj_Wrapper *object = (GC_MS_PObj_Wrapper *)to_add;
 
     PObj_flags_SETTO(object, PObj_on_free_list_FLAG);
 
-    ((GC_MS_PObj_Wrapper*)object)->next_ptr = (PObj *)pool->free_list;
-    pool->free_list        = object;
+    object->next_ptr = pool->free_list;
+    pool->free_list  = object;
 }
 
 /*
 
-=item C<static void * gc_ms_get_free_object(PARROT_INTERP, Small_Object_Pool
+=item C<static void * gc_ms_get_free_object(PARROT_INTERP, Fixed_Size_Pool
 *pool)>
 
 Free object allocator for the MS garbage collector system. If there are no
@@ -423,12 +395,34 @@
 PARROT_CANNOT_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
 static void *
-gc_ms_get_free_object(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool))
+gc_ms_get_free_object(PARROT_INTERP, ARGMOD(Fixed_Size_Pool *pool))
 {
     ASSERT_ARGS(gc_ms_get_free_object)
     PObj *ptr;
     PObj *free_list = (PObj *)pool->free_list;
 
+#if GC_USE_LAZY_ALLOCATOR
+    if (!free_list && !pool->newfree) {
+        (*pool->more_objects)(interp, pool);
+        free_list = (PObj *)pool->free_list;
+    }
+
+    if (free_list) {
+        ptr             = free_list;
+        pool->free_list = ((GC_MS_PObj_Wrapper *)ptr)->next_ptr;
+    }
+    else {
+        Fixed_Size_Arena * const arena = pool->last_Arena;
+        ptr           = (PObj *)pool->newfree;
+        pool->newfree = (void *)((char *)pool->newfree + pool->object_size);
+        arena->used++;
+
+        if (pool->newfree >= pool->newlast)
+            pool->newfree = NULL;
+
+        PARROT_ASSERT(ptr < (PObj *)pool->newlast);
+    }
+#else
     /* if we don't have any objects */
     if (!free_list) {
         (*pool->more_objects)(interp, pool);
@@ -437,17 +431,20 @@
 
     ptr             = free_list;
     pool->free_list = ((GC_MS_PObj_Wrapper*)ptr)->next_ptr;
+#endif
 
-    PObj_flags_SETTO(ptr, 0);
+    /* PObj_flags_SETTO(ptr, 0); */
+    memset(ptr, 0, pool->object_size);
 
     --pool->num_free_objects;
 
     return ptr;
 }
 
+
 /*
 
-=item C<static void gc_ms_alloc_objects(PARROT_INTERP, Small_Object_Pool *pool)>
+=item C<static void gc_ms_alloc_objects(PARROT_INTERP, Fixed_Size_Pool *pool)>
 
 New arena allocator function for the MS garbage collector system. Allocates
 and initializes a new memory arena in the given pool. Adds all the new
@@ -458,12 +455,13 @@
 */
 
 static void
-gc_ms_alloc_objects(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool))
+gc_ms_alloc_objects(PARROT_INTERP, ARGMOD(Fixed_Size_Pool *pool))
 {
     ASSERT_ARGS(gc_ms_alloc_objects)
     /* Setup memory for the new objects */
-    Small_Object_Arena * const new_arena =
-        mem_internal_allocate_typed(Small_Object_Arena);
+
+    Fixed_Size_Arena * const new_arena =
+        mem_internal_allocate_typed(Fixed_Size_Arena);
 
     const size_t size = pool->object_size * pool->objects_per_alloc;
     size_t alloc_size;
@@ -473,6 +471,8 @@
 
     Parrot_append_arena_in_pool(interp, pool, new_arena, size);
 
+    PARROT_ASSERT(pool->last_Arena);
+
     Parrot_add_to_free_list(interp, pool, new_arena);
 
     /* Allocate more next time */
@@ -500,93 +500,6 @@
 
 =back
 
-=head2 MS PMC_EXT Pool functions
-
-=over 4
-
-=item C<void gc_ms_pmc_ext_pool_init(Small_Object_Pool *pool)>
-
-Initialize the PMC_EXT pool functions. This is done separately from other
-pools.
-
-=cut
-
-*/
-
-void
-gc_ms_pmc_ext_pool_init(ARGMOD(Small_Object_Pool *pool))
-{
-    ASSERT_ARGS(gc_ms_pmc_ext_pool_init)
-    pool->add_free_object = gc_ms_add_free_pmc_ext;
-    pool->get_free_object = gc_ms_get_free_pmc_ext;
-    pool->alloc_objects   = gc_ms_alloc_objects;
-    pool->more_objects    = gc_ms_alloc_objects;
-}
-
-
-/*
-
-=item C<static void gc_ms_add_free_pmc_ext(PARROT_INTERP, Small_Object_Pool
-*pool, void *to_add)>
-
-Add a freed PMC_EXT structure to the free list in the PMC_EXT pool. Objects
-on the free list can be reused later.
-
-=cut
-
-*/
-
-static void
-gc_ms_add_free_pmc_ext(SHIM_INTERP, ARGMOD(Small_Object_Pool *pool), ARGIN(void *to_add))
-{
-    ASSERT_ARGS(gc_ms_add_free_pmc_ext)
-    PMC_EXT * const object = (PMC_EXT *)to_add;
-    object->_metadata      = NULL;
-
-    /* yes, this cast is a hack for now, but a pointer is a pointer */
-    object->_next_for_GC   = (PMC *)pool->free_list;
-    pool->free_list        = object;
-}
-
-/*
-
-=item C<static void * gc_ms_get_free_pmc_ext(PARROT_INTERP, Small_Object_Pool
-*pool)>
-
-Get a new PMC_EXT structure from the free pool and return it.
-
-=cut
-
-*/
-
-PARROT_CANNOT_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-static void *
-gc_ms_get_free_pmc_ext(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool))
-{
-    ASSERT_ARGS(gc_ms_get_free_pmc_ext)
-    PMC_EXT *ptr;
-    PMC_EXT *free_list = (PMC_EXT *)pool->free_list;
-
-    /* if we don't have any objects */
-    if (!free_list) {
-        (*pool->more_objects)(interp, pool);
-        free_list = (PMC_EXT *)pool->free_list;
-    }
-
-    ptr               = free_list;
-    pool->free_list   = ptr->_next_for_GC;
-    ptr->_next_for_GC = NULL;
-
-    --pool->num_free_objects;
-
-    return ptr;
-}
-
-/*
-
-=back
-
 =cut
 
 */

Modified: branches/orderedhash_revamp/src/gc/gc_private.h
==============================================================================
--- branches/orderedhash_revamp/src/gc/gc_private.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/gc/gc_private.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -36,6 +36,39 @@
 
 #endif /* __ia64__ */
 
+/* the percent of used Arena items at which to trace next time through */
+#define GC_DEBUG_REPLENISH_LEVEL_FACTOR        0.0
+#define GC_DEBUG_UNITS_PER_ALLOC_GROWTH_FACTOR 1
+#define REPLENISH_LEVEL_FACTOR                 0.5
+
+/* this factor is totally arbitrary, but gives good timings for stress.pasm */
+#define UNITS_PER_ALLOC_GROWTH_FACTOR          1.75
+
+#define POOL_MAX_BYTES                         65536 * 128
+
+#define PMC_HEADERS_PER_ALLOC     4096 * 10 / sizeof (PMC)
+#define BUFFER_HEADERS_PER_ALLOC  4096      / sizeof (Buffer)
+#define STRING_HEADERS_PER_ALLOC  4096 * 20 / sizeof (STRING)
+
+#define CONSTANT_PMC_HEADERS_PER_ALLOC 4096 / sizeof (PMC)
+#define GET_SIZED_POOL_IDX(x) ((x) / sizeof (void *))
+#define GC_NUM_INITIAL_FIXED_SIZE_POOLS 128
+
+
+/* these values are used for the attribute allocator */
+#define GC_ATTRIB_POOLS_HEADROOM 8
+#define GC_FIXED_SIZE_POOL_SIZE 4096
+
+/* Use the lazy allocator. Since it amortizes arena allocation costs, turn
+   this on at the same time that you increase the size of allocated arenas.
+   increase *_HEADERS_PER_ALLOC and GC_FIXED_SIZE_POOL_SIZE to be large
+   enough to satisfy most startup costs. */
+#define GC_USE_LAZY_ALLOCATOR 1
+
+/* Set to 1 if we want to use the fixed-size allocator. Set to 0 if we want
+   to allocate these things using mem_sys_allocate instead */
+#define GC_USE_FIXED_SIZE_ALLOCATOR 1
+
 /* We're using this here to add an additional pointer to a PObj without
    having to actually add an entire pointer to every PObj-alike structure
    in Parrot. Astute observers may notice that if the PObj is comprised of
@@ -43,134 +76,148 @@
    larger then sizeof(PObj), thus creating overflow. However PObjs are never
    used by themselves, things like PMCs and STRINGs are cast to PObj in the
    GC, so we should have plenty of space. */
-typedef union GC_MS_PObj_Wrapper {
-    PObj obj;
-    PObj *next_ptr;
+typedef struct GC_MS_PObj_Wrapper {
+    size_t flags;
+    struct GC_MS_PObj_Wrapper * next_ptr;
 } GC_MS_PObj_Wrapper;
 
-typedef struct Small_Object_Arena {
+
+typedef enum _gc_sys_type_enum {
+    MS,  /*mark and sweep*/
+    INF /*infinite memory core*/
+} gc_sys_type_enum;
+
+typedef struct GC_Subsystem {
+    /* Which GC subsystem are we using? See PARROT_GC_DEFAULT_TYPE in
+     * include/parrot/settings.h for possible values */
+    gc_sys_type_enum sys_type;
+
+    /** Function hooks that each subsystem MUST provide */
+    void (*do_gc_mark)(PARROT_INTERP, UINTVAL flags);
+    void (*finalize_gc_system) (PARROT_INTERP);
+    void (*init_pool)(PARROT_INTERP, struct Fixed_Size_Pool *);
+
+    /*Function hooks that GC systems can CHOOSE to provide if they need them
+     *These will be called via the GC API functions Parrot_gc_func_name
+     *e.g. read barrier && write barrier hooks can go here later ...*/
+
+    /* Holds system-specific data structures
+     * unused right now, but this is where it should go if we need them ...
+      union {
+      } gc_private;
+     */
+} GC_Subsystem;
+
+typedef struct Memory_Block {
+    size_t free;
+    size_t size;
+    struct Memory_Block *prev;
+    struct Memory_Block *next;
+    char *start;
+    char *top;
+} Memory_Block;
+
+typedef struct Variable_Size_Pool {
+    Memory_Block *top_block;
+    void (*compact)(PARROT_INTERP, struct Variable_Size_Pool *);
+    size_t minimum_block_size;
+    size_t total_allocated; /* total bytes allocated to this pool */
+    size_t guaranteed_reclaimable;     /* bytes that can definitely be reclaimed*/
+    size_t possibly_reclaimable;     /* bytes that can possibly be reclaimed
+                                      * (above plus COW-freed bytes) */
+    FLOATVAL reclaim_factor; /* minimum percentage we will reclaim */
+} Variable_Size_Pool;
+
+typedef struct Fixed_Size_Arena {
     size_t                     used;
     size_t                     total_objects;
-    struct Small_Object_Arena *prev;
-    struct Small_Object_Arena *next;
+    struct Fixed_Size_Arena *prev;
+    struct Fixed_Size_Arena *next;
     void                      *start_objects;
-} Small_Object_Arena;
+} Fixed_Size_Arena;
 
-#if PARROT_GC_GMS
-/*
- * all objects have this header in front of the actual
- * object pointer. The prev/next pointers chain all existing
- * objects for one pool (sizeclass) together.
- *
- * XXX this could lead to unaligned FLOATVALs in the adjacent PMC
- *     if that's true either insert a dummy or reorder PMC members
- *     ??? How is that possible?
- */
-typedef struct _gc_gms_hdr {
-    struct _gc_gms_hdr *prev;
-    struct _gc_gms_hdr *next;
-    struct _gc_gms_gen *gen;
-    void *gc_dummy_align;       /* see above */
-} Gc_gms_hdr;
-
-#  define PObj_to_GMSH(o) (((Gc_gms_hdr*)(o))-1)
-#  define GMSH_to_PObj(p) ((PObj*) ((p)+1))
-
-/* the structure uses 2 ptrs itself */
-#  define GC_GMS_STORE_SIZE (64-2)
-
-typedef struct _gc_gms_hdr_store {
-    struct _gc_gms_hdr_store *next;
-    Gc_gms_hdr **ptr;                           /* insert location */
-    Gc_gms_hdr * (store[GC_GMS_STORE_SIZE]);    /* array of hdr pointers */
-} Gc_gms_hdr_store;
-
-typedef struct _gc_gms_hdr_list {
-    Gc_gms_hdr_store *first;
-    Gc_gms_hdr_store *last;
-} Gc_gms_hdr_list;
-
-
-/*
- * all objects belong to one generation
- */
-typedef struct _gc_gms_gen {
-    UINTVAL gen_no;                     /* generation number */
-    UINTVAL timely_destruct_obj_sofar;  /* sum up to this generation */
-    UINTVAL black_color;                /* live color of this generation */
-    struct _gc_gms_hdr *first;          /* first header in this generation */
-    struct _gc_gms_hdr *last;           /* last header in this generation */
-    struct _gc_gms_hdr *fin;            /* need destruction/finalization */
-    struct Small_Object_Pool *pool;     /* where this generation belongs to */
-    Gc_gms_hdr_list igp;                /* IGPs for this generation */
-    UINTVAL n_possibly_dead;            /* overwritten count */
-    UINTVAL n_objects;                  /* live objects count */
-    struct _gc_gms_gen *prev;
-    struct _gc_gms_gen *next;
-} Gc_gms_gen;
+typedef struct PMC_Attribute_Free_List {
+    struct PMC_Attribute_Free_List * next;
+} PMC_Attribute_Free_List;
+
+typedef struct PMC_Attribute_Arena {
+    struct PMC_Attribute_Arena * next;
+    struct PMC_Attribute_Arena * prev;
+} PMC_Attribute_Arena;
 
-#endif /* PARROT_GC_GMS */
+typedef struct PMC_Attribute_Pool {
+    size_t attr_size;
+    size_t total_objects;
+    size_t objects_per_alloc;
+    size_t num_free_objects;
+    PMC_Attribute_Free_List * free_list;
+    PMC_Attribute_Arena     * top_arena;
+#if GC_USE_LAZY_ALLOCATOR
+    PMC_Attribute_Free_List * newfree;
+    PMC_Attribute_Free_List * newlast;
+#endif
+} PMC_Attribute_Pool;
 
 /* Tracked resource pool */
-typedef struct Small_Object_Pool {
-    Small_Object_Arena *last_Arena;
-    /* Size in bytes of an individual pool item. This size may include
-     * a GC-system specific GC header.
-     * See the macros below.
-     */
+typedef struct Fixed_Size_Pool {
+
+    struct Variable_Size_Pool *mem_pool;
+   /* Size in bytes of an individual pool item. This size may include
+    * a GC-system specific GC header. */
     size_t object_size;
-    size_t objects_per_alloc;
-    size_t total_objects;
+
+    size_t start_arena_memory;
+    size_t end_arena_memory;
+
+    Fixed_Size_Arena *last_Arena;
+    GC_MS_PObj_Wrapper * free_list;
     size_t num_free_objects;    /* number of resources in the free pool */
+    size_t total_objects;
+
+    PARROT_OBSERVER const char *name;
+
+    size_t objects_per_alloc;
+
     int skip;
     size_t replenish_level;
-    void *free_list;
-    /* adds a free object to the pool's free list  */
-    add_free_object_fn_type     add_free_object;
-    get_free_object_fn_type     get_free_object;
-    alloc_objects_fn_type       alloc_objects;
+
+    add_free_object_fn_type     add_free_object; /* adds a free object to
+                                                    the pool's free list  */
+    get_free_object_fn_type     get_free_object; /* gets and removes a free
+                                                    object from the pool's
+                                                    free list */
+    alloc_objects_fn_type       alloc_objects;  /* allocates more objects */
     alloc_objects_fn_type       more_objects;
     gc_object_fn_type           gc_object;
-    /* gets and removes a free object from the pool's free list */
-    /* allocates more objects */
-    struct Memory_Pool *mem_pool;
-    size_t start_arena_memory;
-    size_t end_arena_memory;
-    PARROT_OBSERVER const char *name;
-#if PARROT_GC_GMS
-    struct _gc_gms_hdr marker;          /* limit of list */
-    struct _gc_gms_hdr *black;          /* alive */
-    struct _gc_gms_hdr *black_fin;      /* alive, needs destruction */
-    struct _gc_gms_hdr *gray;           /* to be scanned */
-    struct _gc_gms_hdr *white;          /* unprocessed */
-    struct _gc_gms_hdr *white_fin;      /* unprocesse, needs destruction */
-
-    struct _gc_gms_gen *first_gen;      /* linked list of generations */
-    struct _gc_gms_gen *last_gen;
 
+    /* Contains GC system-specific data structures ... unused at the moment,
+     * but this is where it should go when we need it ...
+    union {
+    } gc_private;
+    */
+
+#if GC_USE_LAZY_ALLOCATOR
+    void *newfree;
+    void *newlast;
 #endif
-} Small_Object_Pool;
 
-typedef struct Arenas {
-    Memory_Pool *memory_pool;
-    Memory_Pool *constant_string_pool;
-    struct Small_Object_Pool *string_header_pool;
-    struct Small_Object_Pool *pmc_pool;
-    struct Small_Object_Pool *pmc_ext_pool;
-    struct Small_Object_Pool *constant_pmc_pool;
-    struct Small_Object_Pool *buffer_header_pool;
-    struct Small_Object_Pool *constant_string_header_pool;
-    struct Small_Object_Pool **sized_header_pools;
+} Fixed_Size_Pool;
+
+typedef struct Memory_Pools {
+    Variable_Size_Pool *memory_pool;
+    Variable_Size_Pool *constant_string_pool;
+    struct Fixed_Size_Pool *string_header_pool;
+    struct Fixed_Size_Pool *pmc_pool;
+    struct Fixed_Size_Pool *constant_pmc_pool;
+    struct Fixed_Size_Pool *constant_string_header_pool;
+    struct Fixed_Size_Pool **sized_header_pools;
     size_t num_sized;
-    /*
-     * function slots that each subsystem must provide
-     */
-    void (*do_gc_mark)(PARROT_INTERP, UINTVAL flags);
-    void (*finalize_gc_system) (PARROT_INTERP);
-    void (*init_pool)(PARROT_INTERP, struct Small_Object_Pool *);
-    /*
-     * statistics for GC
-     */
+
+    PMC_Attribute_Pool **attrib_pools;
+    size_t num_attribs;
+
+
+    /** statistics for GC **/
     size_t  gc_mark_runs;       /* Number of times we've done a mark run*/
     size_t  gc_lazy_mark_runs;  /* Number of successful lazy mark runs */
     size_t  gc_collect_runs;    /* Number of times we've done a memory
@@ -193,7 +240,6 @@
                                      during collection */
     UINTVAL num_early_gc_PMCs;    /* how many PMCs want immediate destruction */
     UINTVAL num_early_PMCs_seen;  /* how many such PMCs has GC seen */
-    UINTVAL num_extended_PMCs;    /* active PMCs having pmc_ext */
     PMC* gc_mark_start;           /* first PMC marked during a GC run */
     PMC* gc_mark_ptr;             /* last PMC marked during a GC run */
     PMC* gc_trace_ptr;            /* last PMC trace_children was called on */
@@ -210,7 +256,7 @@
      * private data for the GC subsystem
      */
     void *  gc_private;           /* gc subsystem data */
-} Arenas;
+} Memory_Pools;
 
 
 /* HEADERIZER BEGIN: src/gc/system.c */
@@ -219,103 +265,25 @@
 void trace_system_areas(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_trace_system_areas __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_trace_system_areas __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/gc/system.c */
 
-/* HEADERIZER BEGIN: src/gc/generational_ms.c */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-
-PARROT_EXPORT
-void Parrot_gc_gms_init(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-PARROT_EXPORT
-void parrot_gc_gms_Parrot_gc_mark_PObj_alive(PARROT_INTERP,
-    ARGMOD(PObj *obj))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*obj);
-
-void parrot_gc_gms_wb(PARROT_INTERP,
-    ARGIN(PMC *agg),
-    ARGIN(void *old),
-    ARGIN(void *_new))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4);
-
-void parrot_gc_gms_wb_key(PARROT_INTERP,
-    ARGIN(PMC *agg),
-    ARGIN(void *old),
-    ARGIN(void *old_key),
-    ARGIN(void *_new),
-    ARGIN(void *new_key))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        __attribute__nonnull__(5)
-        __attribute__nonnull__(6);
-
-#define ASSERT_ARGS_Parrot_gc_gms_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_parrot_gc_gms_Parrot_gc_mark_PObj_alive \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(obj)
-#define ASSERT_ARGS_parrot_gc_gms_wb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(agg) \
-    || PARROT_ASSERT_ARG(old) \
-    || PARROT_ASSERT_ARG(_new)
-#define ASSERT_ARGS_parrot_gc_gms_wb_key __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(agg) \
-    || PARROT_ASSERT_ARG(old) \
-    || PARROT_ASSERT_ARG(old_key) \
-    || PARROT_ASSERT_ARG(_new) \
-    || PARROT_ASSERT_ARG(new_key)
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: src/gc/generational_ms.c */
-
-/* HEADERIZER BEGIN: src/gc/incremental_ms.c */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-
-void Parrot_gc_ims_init(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-void Parrot_gc_ims_wb(PARROT_INTERP, ARGMOD(PMC *agg), ARGMOD(PMC *_new))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*agg)
-        FUNC_MODIFIES(*_new);
-
-#define ASSERT_ARGS_Parrot_gc_ims_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_gc_ims_wb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(agg) \
-    || PARROT_ASSERT_ARG(_new)
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: src/gc/incremental_ms.c */
-
 /* HEADERIZER BEGIN: src/gc/mark_sweep.c */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
 PARROT_WARN_UNUSED_RESULT
-INTVAL contained_in_pool(
-    ARGIN(const Small_Object_Pool *pool),
+INTVAL contained_in_pool(PARROT_INTERP,
+    ARGIN(const Fixed_Size_Pool *pool),
     ARGIN(const void *ptr))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-Small_Object_Pool * get_bufferlike_pool(PARROT_INTERP, size_t buffer_size)
+Fixed_Size_Pool * get_bufferlike_pool(PARROT_INTERP, size_t buffer_size)
         __attribute__nonnull__(1);
 
 PARROT_IGNORABLE_RESULT
@@ -327,7 +295,7 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(4);
 
-void initialize_header_pools(PARROT_INTERP)
+void initialize_fixed_size_pools(PARROT_INTERP)
         __attribute__nonnull__(1);
 
 void mark_special(PARROT_INTERP, ARGIN(PMC *obj))
@@ -335,8 +303,8 @@
         __attribute__nonnull__(2);
 
 void Parrot_add_to_free_list(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool),
-    ARGMOD(Small_Object_Arena *arena))
+    ARGMOD(Fixed_Size_Pool *pool),
+    ARGMOD(Fixed_Size_Arena *arena))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         __attribute__nonnull__(3)
@@ -344,8 +312,8 @@
         FUNC_MODIFIES(*arena);
 
 void Parrot_append_arena_in_pool(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool),
-    ARGMOD(Small_Object_Arena *new_arena),
+    ARGMOD(Fixed_Size_Pool *pool),
+    ARGMOD(Fixed_Size_Arena *new_arena),
     size_t size)
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
@@ -354,67 +322,78 @@
         FUNC_MODIFIES(*new_arena);
 
 void Parrot_gc_clear_live_bits(PARROT_INTERP,
-    ARGIN(const Small_Object_Pool *pool))
+    ARGIN(const Fixed_Size_Pool *pool))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-void Parrot_gc_profile_end(PARROT_INTERP, int what)
+PARROT_CANNOT_RETURN_NULL
+PMC_Attribute_Pool * Parrot_gc_get_attribute_pool(PARROT_INTERP,
+    size_t attrib_size)
         __attribute__nonnull__(1);
 
-void Parrot_gc_profile_start(PARROT_INTERP)
+PARROT_CANNOT_RETURN_NULL
+void * Parrot_gc_get_attributes_from_pool(PARROT_INTERP,
+    ARGMOD(PMC_Attribute_Pool * pool))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        FUNC_MODIFIES(* pool);
+
+void Parrot_gc_initialize_fixed_size_pools(PARROT_INTERP,
+    size_t init_num_pools)
         __attribute__nonnull__(1);
 
 void Parrot_gc_run_init(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-void Parrot_gc_sweep_pool(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool))
+void Parrot_gc_sweep_pool(PARROT_INTERP, ARGMOD(Fixed_Size_Pool *pool))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*pool);
 
-int Parrot_gc_trace_children(PARROT_INTERP, size_t how_many)
-        __attribute__nonnull__(1);
-
 int Parrot_gc_trace_root(PARROT_INTERP, Parrot_gc_trace_type trace)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_contained_in_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pool) \
-    || PARROT_ASSERT_ARG(ptr)
-#define ASSERT_ARGS_get_bufferlike_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_header_pools_iterate_callback __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(func)
-#define ASSERT_ARGS_initialize_header_pools __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_mark_special __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(obj)
-#define ASSERT_ARGS_Parrot_add_to_free_list __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool) \
-    || PARROT_ASSERT_ARG(arena)
-#define ASSERT_ARGS_Parrot_append_arena_in_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool) \
-    || PARROT_ASSERT_ARG(new_arena)
-#define ASSERT_ARGS_Parrot_gc_clear_live_bits __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_contained_in_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_Parrot_gc_profile_end __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_gc_profile_start __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_gc_run_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_gc_sweep_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_Parrot_gc_trace_children __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_gc_trace_root __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+    , PARROT_ASSERT_ARG(pool) \
+    , PARROT_ASSERT_ARG(ptr))
+#define ASSERT_ARGS_get_bufferlike_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_header_pools_iterate_callback __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(func))
+#define ASSERT_ARGS_initialize_fixed_size_pools __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_mark_special __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(obj))
+#define ASSERT_ARGS_Parrot_add_to_free_list __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pool) \
+    , PARROT_ASSERT_ARG(arena))
+#define ASSERT_ARGS_Parrot_append_arena_in_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pool) \
+    , PARROT_ASSERT_ARG(new_arena))
+#define ASSERT_ARGS_Parrot_gc_clear_live_bits __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pool))
+#define ASSERT_ARGS_Parrot_gc_get_attribute_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_gc_get_attributes_from_pool \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pool))
+#define ASSERT_ARGS_Parrot_gc_initialize_fixed_size_pools \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_gc_run_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_gc_sweep_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pool))
+#define ASSERT_ARGS_Parrot_gc_trace_root __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/gc/mark_sweep.c */
 
@@ -423,7 +402,7 @@
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-Small_Object_Pool * get_bufferlike_pool(PARROT_INTERP, size_t buffer_size)
+Fixed_Size_Pool * get_bufferlike_pool(PARROT_INTERP, size_t buffer_size)
         __attribute__nonnull__(1);
 
 PARROT_IGNORABLE_RESULT
@@ -435,16 +414,9 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(4);
 
-void initialize_header_pools(PARROT_INTERP)
+void initialize_fixed_size_pools(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_get_bufferlike_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_header_pools_iterate_callback __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(func)
-#define ASSERT_ARGS_initialize_header_pools __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/gc/pools.c */
 
@@ -466,139 +438,71 @@
 PARROT_WARN_UNUSED_RESULT
 size_t aligned_string_size(size_t len);
 
-void compact_pool(PARROT_INTERP, ARGMOD(Memory_Pool *pool))
+void check_buffer_ptr(
+    ARGMOD(Buffer * pobj),
+    ARGMOD(Variable_Size_Pool * pool))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        FUNC_MODIFIES(* pobj)
+        FUNC_MODIFIES(* pool);
+
+void compact_pool(PARROT_INTERP, ARGMOD(Variable_Size_Pool *pool))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*pool);
 
-void initialize_memory_pools(PARROT_INTERP)
+void initialize_var_size_pools(PARROT_INTERP)
         __attribute__nonnull__(1);
 
 PARROT_MALLOC
 PARROT_CANNOT_RETURN_NULL
-void * mem_allocate(PARROT_INTERP, size_t size, ARGMOD(Memory_Pool *pool))
+void * mem_allocate(PARROT_INTERP,
+    size_t size,
+    ARGMOD(Variable_Size_Pool *pool))
         __attribute__nonnull__(1)
         __attribute__nonnull__(3)
         FUNC_MODIFIES(*pool);
 
-void merge_pools(ARGMOD(Memory_Pool *dest), ARGMOD(Memory_Pool *source))
+void merge_pools(
+    ARGMOD(Variable_Size_Pool *dest),
+    ARGMOD(Variable_Size_Pool *source))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*dest)
         FUNC_MODIFIES(*source);
 
-#define ASSERT_ARGS_aligned_mem __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_aligned_mem __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(buffer) \
-    || PARROT_ASSERT_ARG(mem)
-#define ASSERT_ARGS_aligned_size __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(buffer)
-#define ASSERT_ARGS_aligned_string_size __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_compact_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_initialize_memory_pools __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_mem_allocate __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(mem))
+#define ASSERT_ARGS_aligned_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(buffer))
+#define ASSERT_ARGS_aligned_string_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_check_buffer_ptr __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(pobj) \
+    , PARROT_ASSERT_ARG(pool))
+#define ASSERT_ARGS_compact_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pool))
+#define ASSERT_ARGS_initialize_var_size_pools __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_mem_allocate __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_merge_pools __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(pool))
+#define ASSERT_ARGS_merge_pools __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(dest) \
-    || PARROT_ASSERT_ARG(source)
+    , PARROT_ASSERT_ARG(source))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/gc/alloc_resources.c */
 
 /* GC subsystem init functions */
-/* HEADERIZER BEGIN: src/gc/generational_ms.c */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-
-PARROT_EXPORT
-void Parrot_gc_gms_init(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-PARROT_EXPORT
-void parrot_gc_gms_Parrot_gc_mark_PObj_alive(PARROT_INTERP, ARGMOD(PObj *obj))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*obj);
-
-void parrot_gc_gms_wb(PARROT_INTERP,
-    ARGIN(PMC *agg),
-    ARGIN(void *old),
-    ARGIN(void *_new))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4);
-
-void parrot_gc_gms_wb_key(PARROT_INTERP,
-    ARGIN(PMC *agg),
-    ARGIN(void *old),
-    ARGIN(void *old_key),
-    ARGIN(void *_new),
-    ARGIN(void *new_key))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        __attribute__nonnull__(5)
-        __attribute__nonnull__(6);
-
-#define ASSERT_ARGS_Parrot_gc_gms_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_parrot_gc_gms_Parrot_gc_mark_PObj_alive __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(obj)
-#define ASSERT_ARGS_parrot_gc_gms_wb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(agg) \
-    || PARROT_ASSERT_ARG(old) \
-    || PARROT_ASSERT_ARG(_new)
-#define ASSERT_ARGS_parrot_gc_gms_wb_key __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(agg) \
-    || PARROT_ASSERT_ARG(old) \
-    || PARROT_ASSERT_ARG(old_key) \
-    || PARROT_ASSERT_ARG(_new) \
-    || PARROT_ASSERT_ARG(new_key)
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: src/gc/generational_ms.c */
-
-/* HEADERIZER BEGIN: src/gc/incremental_ms.c */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-
-void Parrot_gc_ims_init(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-void Parrot_gc_ims_wb(PARROT_INTERP, ARGMOD(PMC *agg), ARGMOD(PMC *_new))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*agg)
-        FUNC_MODIFIES(*_new);
-
-#define ASSERT_ARGS_Parrot_gc_ims_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_gc_ims_wb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(agg) \
-    || PARROT_ASSERT_ARG(_new)
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: src/gc/incremental_ms.c */
-
 /* HEADERIZER BEGIN: src/gc/gc_ms.c */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
-void gc_ms_pmc_ext_pool_init(ARGMOD(Small_Object_Pool *pool))
-        __attribute__nonnull__(1)
-        FUNC_MODIFIES(*pool);
-
 void Parrot_gc_ms_init(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_gc_ms_pmc_ext_pool_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_Parrot_gc_ms_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_gc_ms_init __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/gc/gc_ms.c */
 
@@ -608,8 +512,8 @@
 void Parrot_gc_inf_init(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_Parrot_gc_inf_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_gc_inf_init __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/gc/gc_inf.c */
 

Deleted: branches/orderedhash_revamp/src/gc/generational_ms.c
==============================================================================
--- branches/orderedhash_revamp/src/gc/generational_ms.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,1982 +0,0 @@
-/*
-Copyright (C) 2001-2009, Parrot Foundation.
-$Id$
-
-=head1 NAME
-
-src/gc/generational_ms.c - Generational mark and sweep garbage collection
-
-=head1 OVERVIEW
-
-The following comments describe a generational garbage collection
-scheme for Parrot.
-
-Keywords:
-
- - non-copying, mark & sweep
- - generational
- - implicit reclamation, treadmill
-
-=head1 DESCRIPTION
-
-A plain mark & sweep collector performs work depending on the amount
-of all allocated objects. The advantage of a generational GC is
-achieved by not processing all objects. This is based on the weak
-generational hypothesis, which states that young objects are likely to
-die early. Old objects, which have survived a few GC cycles tend to be
-long-lived.
-
-The terms young and old objects imply that there is some ordering in
-object creation time and the ordering is also followed by object
-references.
-
-Specifically object references have to follow the marking direction.
-In pure functional programming languages this can be a very simple
-scheme:
-
-        +------------+    object references
-        v            |
-   old   .... young .... youngest
-                            |
-                   <--------  scan direction
-
-If (simplified) the only reference-like operation of the interpreter
-is:
-
-   cons = (car, cdr)
-
-and the object references "car" and "cdr" are created prior to the
-"aggregate" "cons", all object references point always to older
-objects.  By scanning from the youngest to the oldest objects, all
-non-marked objects can be reclaimed immediately. And the scan can be
-aborted at any time after some processing, creating a generational GC
-in a trivial way.
-
-But the programming languages we are serving are working basically the
-other direction, when it comes to object history:
-
-  @a[$i] = $n
-
-A reference operation like this needs first an aggregate and then the
-contents of it. So the scan direction is from old objects to younger
-ones.  In such a scheme it's a bit more complicated to skip parts of
-the objects.
-
-To take advantage of not processing all the objects, these are divided
-into generations, e.g.:
-
-   old               young := nursery
-   generation 0      generation 1
-
-A mark phase now processes the root set and only objects from the
-young generation. When all objects are either referenced by the root
-set or only by the young generation, the algorithm is correct and
-complete.
-
-But there is of course the possibilty that a young object is
-stored into an aggregate of an older generation. This case is tracked
-by the write barrier, which remembers all such operations in the IGP
-(inter generational pointer) list. When now generation 1 is marked,
-the IGP list can be considered as an extension to the root set, so
-that again all live objects of the young generation are detected.
-
-
-=head2 Structures
-
-=over 4
-
-=item C<typedef struct _gc_gms_gen Gc_gms_gen>
-
-Describes the state of one generation for one pool.
-
-=item C<typedef struct _gc_gms_hdr Gc_gms_hdr>
-
-This header is in front of all Parrot objects. It forms a doubly-linked
-list of all objects in one pool and points to its generation.
-
-=item PObj_to_GMSH(o)
-
-=item GMSH_to_PObj(p)
-
-These two macros convert from and to headers and objects.
-
-=item C<typedef struct _gc_gms_hdr_list Gc_gms_hdr_list>
-
-A chained list of headers used e.g. for the IGP list.
-
-=back
-
-=cut
-
-*/
-
-#include "parrot/parrot.h"
-#include "parrot/gc_api.h"
-
-#if PARROT_GC_GMS
-
-typedef struct Gc_gms_private {
-    UINTVAL current_gen_no;             /* the nursery generation number */
-} Gc_gms_private;
-
-/* HEADERIZER HFILE: src/gc/gc_private.h */
-
-/* HEADERIZER BEGIN: static */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-
-static int end_cycle_cb(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool),
-    int flag,
-    SHIM(void *arg))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pool);
-
-static void gc_gms_add_free_object(PARROT_INTERP,
-    SHIM(Small_Object_Pool *pool),
-    SHIM(PObj *to_add))
-        __attribute__nonnull__(1);
-
-static void gc_gms_alloc_objects(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pool);
-
-static void gc_gms_chain_objects(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool),
-    ARGIN(Small_Object_Arena *new_arena),
-    size_t real_size)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*pool);
-
-static void gc_gms_clear_hdr_list(PARROT_INTERP, ARGMOD(Gc_gms_hdr_list *l))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*l);
-
-static void gc_gms_clear_igp(PARROT_INTERP, ARGIN(Gc_gms_gen *gen))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-PARROT_MALLOC
-PARROT_CANNOT_RETURN_NULL
-static Gc_gms_gen * gc_gms_create_gen(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool),
-    size_t gen_no)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pool);
-
-static void gc_gms_end_cycle(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static Gc_gms_gen * gc_gms_find_gen(PARROT_INTERP,
-    ARGIN(const Gc_gms_hdr *h),
-    UINTVAL gen_no)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static PObj * gc_gms_get_free_object(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pool);
-
-static void gc_gms_init_gen(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pool);
-
-static void gc_gms_init_mark(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-static void gc_gms_merge_gen(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool),
-    int flag,
-    SHIM(Gc_gms_plan *plan))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pool);
-
-static void gc_gms_more_objects(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pool);
-
-static void gc_gms_pool_init(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pool);
-
-static void gc_gms_promote(PARROT_INTERP,
-    ARGIN(Gc_gms_hdr *h),
-    UINTVAL gen_no)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static void gc_gms_set_gen(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-static void gc_gms_setto_black(PARROT_INTERP,
-    ARGMOD(Gc_gms_hdr *h),
-    int priority)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*h);
-
-static void gc_gms_setto_gray(PARROT_INTERP,
-    ARGIN(Gc_gms_hdr *h),
-    int priority)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static void gc_gms_store_hdr_list(PARROT_INTERP,
-    ARGMOD(Gc_gms_hdr_list *l),
-    ARGIN(Gc_gms_hdr *h))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*l);
-
-static void gc_gms_store_igp(PARROT_INTERP, ARGIN(Gc_gms_hdr *h))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static void gc_gms_sweep(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-static int gc_gms_trace_children(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-static int gc_gms_trace_root(PARROT_INTERP, int trace_stack)
-        __attribute__nonnull__(1);
-
-static void gc_gms_use_gen(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool),
-    int flag,
-    ARGIN(const Gc_gms_plan *plan))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(4)
-        FUNC_MODIFIES(*pool);
-
-static void gms_debug_verify(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool),
-    ARGIN(const char *action))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*pool);
-
-static int init_mark_cb(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool),
-    int flag,
-    ARGIN(void *arg))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(4)
-        FUNC_MODIFIES(*pool);
-
-static void parrot_gc_gms_deinit(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-static void parrot_gc_gms_run(PARROT_INTERP, UINTVAL flags)
-        __attribute__nonnull__(1);
-
-PARROT_WARN_UNUSED_RESULT
-static int set_gen_cb(PARROT_INTERP,
-    ARGIN(Small_Object_Pool *pool),
-    int flag,
-    ARGIN(void *arg))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(4);
-
-static int sweep_cb_buf(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool),
-    int flag,
-    SHIM(void *arg))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pool);
-
-static int sweep_cb_pmc(PARROT_INTERP,
-    ARGIN(Small_Object_Pool *pool),
-    int flag,
-    SHIM(void *arg))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static int trace_children_cb(PARROT_INTERP,
-    ARGIN(Small_Object_Pool *pool),
-    int flag,
-    SHIM(void *arg))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static int trace_igp_cb(PARROT_INTERP,
-    ARGIN(Small_Object_Pool *pool),
-    int flag,
-    SHIM(void *arg))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-#define ASSERT_ARGS_end_cycle_cb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_gc_gms_add_free_object __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_gc_gms_alloc_objects __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_gc_gms_chain_objects __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool) \
-    || PARROT_ASSERT_ARG(new_arena)
-#define ASSERT_ARGS_gc_gms_clear_hdr_list __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(l)
-#define ASSERT_ARGS_gc_gms_clear_igp __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(gen)
-#define ASSERT_ARGS_gc_gms_create_gen __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_gc_gms_end_cycle __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_gc_gms_find_gen __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(h)
-#define ASSERT_ARGS_gc_gms_get_free_object __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_gc_gms_init_gen __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_gc_gms_init_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_gc_gms_merge_gen __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_gc_gms_more_objects __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_gc_gms_pool_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_gc_gms_promote __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(h)
-#define ASSERT_ARGS_gc_gms_set_gen __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_gc_gms_setto_black __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(h)
-#define ASSERT_ARGS_gc_gms_setto_gray __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(h)
-#define ASSERT_ARGS_gc_gms_store_hdr_list __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(l) \
-    || PARROT_ASSERT_ARG(h)
-#define ASSERT_ARGS_gc_gms_store_igp __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(h)
-#define ASSERT_ARGS_gc_gms_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_gc_gms_trace_children __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_gc_gms_trace_root __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_gc_gms_use_gen __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool) \
-    || PARROT_ASSERT_ARG(plan)
-#define ASSERT_ARGS_gms_debug_verify __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool) \
-    || PARROT_ASSERT_ARG(action)
-#define ASSERT_ARGS_init_mark_cb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool) \
-    || PARROT_ASSERT_ARG(arg)
-#define ASSERT_ARGS_parrot_gc_gms_deinit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_parrot_gc_gms_run __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_set_gen_cb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool) \
-    || PARROT_ASSERT_ARG(arg)
-#define ASSERT_ARGS_sweep_cb_buf __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_sweep_cb_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_trace_children_cb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_trace_igp_cb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool)
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: static */
-
-
-/*
-
-=pod
-
- * XXX
-
-Main problem TODO 1):
-
- [ PCont ]       ... continuation object in old generation
-    |
-    v
- [ Stack chunk ] --> [ e.g. P register frame ]  ... new generation
-
-By pushing a new stack chunk onto the (old) existing stack frame,
-we'd need a WRITE_BARRIER that promotes the stack chunk to the old
-generation of the continuation.
-This would also need an IGP entry for the stack chunk buffer. But -
-as buffers aren't really containers in Parrot - this isn't possible.
-
-To get that right, the code needs better support by the running
-interpreter.
- - never promote continuations (and stacks) in the current stack frame
-   to an old generation
- - create scope_enter / scope_exit opcodes
-
-A scope_enter happens on a subroutine call *and' with new_pad /
-push_pad opcodes. Each lexical scope must have its distinct register
-frame, else timely destruction can't work.
-If the frame needs active destruction, the old frame should be
-converted to the (new-1) generation, the inner frame is the nursery.
-On scope exit the newest (nursery) generation is collected and the
-current generation number is reset back to (new-1).
-
-If the scope_enter doesn't indicate timely destruction, generation
-promoting should be done only, if object statistics indicate the
-presence of a fair amount of live objects.
-
-TODO 2) in lazy sweep
-If timely destruction didn't find (all) eager objects, go back to
-older generations, until all these objects have been seen.
-
-TODO 3) interpreter startup
-After all internal structures are created, promote interpreter state
-into initial first old generation by running one GC cycle before
-program execution begins (or just treat all objects as being alive).
-
-=cut
-
-*/
-
-/*
- * call code to verify chain of pointers after each change
- * this is very expensive, but should be used during development
- */
-#  define GC_GMS_DEBUG 0
-
-#  define UNITS_PER_ALLOC_GROWTH_FACTOR 1.75
-#  define POOL_MAX_BYTES 65536*128
-
-/*
-
-=head2 Initialization functions
-
-=over 4
-
-=item C<static void parrot_gc_gms_deinit(PARROT_INTERP)>
-
-Free used resources.
-
-=cut
-
-*/
-
-static void
-parrot_gc_gms_deinit(PARROT_INTERP)
-{
-    ASSERT_ARGS(parrot_gc_gms_deinit)
-    Arenas * const arena_base = interp->arena_base;
-
-    /*
-     * TODO free generations
-     */
-    mem_sys_free(arena_base->gc_private);
-    arena_base->gc_private = NULL;
-}
-
-/*
-
-=item C<static void gc_gms_pool_init(PARROT_INTERP, Small_Object_Pool *pool)>
-
-Initialize pool variables. This function must set the pool function pointers
-for C<add_free_object>, C<get_free_object>, C<alloc_objects>, and
-C<more_objects>.
-
-=cut
-
-*/
-
-static void
-gc_gms_pool_init(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool))
-{
-    ASSERT_ARGS(gc_gms_pool_init)
-    pool->add_free_object = gc_gms_add_free_object;
-    pool->get_free_object = gc_gms_get_free_object;
-    pool->alloc_objects   = gc_gms_alloc_objects;
-    pool->more_objects    = gc_gms_more_objects;
-
-    /* initialize generations */
-    gc_gms_init_gen(interp, pool);
-    pool->white = pool->white_fin = pool->free_list = &pool->marker;
-
-    pool->object_size += sizeof (Gc_gms_hdr);
-}
-
-/*
-
-=item C<void Parrot_gc_gms_init(PARROT_INTERP)>
-
-Initialize the state structures of the gc system. Called immediately before
-creation of memory pools.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-Parrot_gc_gms_init(PARROT_INTERP)
-{
-    ASSERT_ARGS(Parrot_gc_gms_init)
-    Arenas * const arena_base = interp->arena_base;
-
-    arena_base->gc_private = mem_sys_allocate_zeroed(sizeof (Gc_gms_private));
-
-    /*
-     * set function hooks according to pdd09
-     */
-    arena_base->do_gc_mark         = parrot_gc_gms_run;
-    arena_base->finalize_gc_system = parrot_gc_gms_deinit;
-    arena_base->init_pool          = gc_gms_pool_init;
-
-}
-
-/*
-
-=back
-
-=head2 Interface functions
-
-=over 4
-
-=item C<static void gc_gms_add_free_object(PARROT_INTERP, Small_Object_Pool
-*pool, PObj *to_add)>
-
-Unused. White (dead) objects are added in a bunch to the free_list.
-
-=cut
-
-*/
-
-static void
-gc_gms_add_free_object(PARROT_INTERP, SHIM(Small_Object_Pool *pool),
-        SHIM(PObj *to_add))
-{
-    ASSERT_ARGS(gc_gms_add_free_object)
-    Parrot_ex_throw_from_c_args(interp, NULL, 1, "gms abuse");
-}
-
-
-/*
-
-=item C<static void gc_gms_chain_objects(PARROT_INTERP, Small_Object_Pool *pool,
-Small_Object_Arena *new_arena, size_t real_size)>
-
-TODO: interfere active_destroy and put these items into a
-separate white area, so that a sweep has just to run through these
-objects
-
-Header chain layout:
-- all objects are chained together forming a circular list
-- pool->marker is the "anchor" of the circle (shown twice below)
-
- 1) object allocation
-
- 1a) one bunch of allocated objects was consumed: the free ptr did
-     hit the marker
-
- +===+---+---+---+---+---+===+
- I M I w | w | w | w | w I M I
- +   +---+---+---+---+---+   +
-       ^                   ^
-       |                   |
-       white               free == marker
-
- All these pointer ranges include the first element, but not the last one.
-
-  [white ... free_list)   is the list of all whites
-
- 1b) after allocating another bunch of objects
-
- +===+---+---+---+---+---+---+---+---+---+---+===+
- I M I w | w | w | w | w | f | f | f | f | f I M I
- +   +---+---+---+---+---+---+---+---+---+---+   +
-       ^                   ^                   ^
-       |                   |                   |
-       white               free                marker
-
-=cut
-
-*/
-
-static void
-gc_gms_chain_objects(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool),
-        ARGIN(Small_Object_Arena *new_arena), size_t real_size)
-{
-    ASSERT_ARGS(gc_gms_chain_objects)
-    Gc_gms_hdr *next, *prev;
-    size_t i, n;
-
-    Gc_gms_hdr *p = new_arena->start_objects;
-    Gc_gms_hdr * const marker = &pool->marker;
-
-    PARROT_ASSERT(pool->free_list == marker);
-
-    /* update pool statistics */
-    n = new_arena->total_objects;
-    pool->total_objects += n;
-    pool->num_free_objects += n;
-    new_arena->used = n;
-    /* initially all is pointing to marker */
-    if (pool->white == marker) {
-        /* set origin of first allocation */
-        marker->next = p;
-        p->prev = marker;
-        pool->white = pool->white_fin = p;
-        prev = marker;
-    }
-    else
-        prev = marker->prev;
-    /* chain objects together by inserting to the left of marker */
-
-    /* point to end of last object */
-    p = (void*) ((char*) p + real_size * n);
-    next = marker;
-    for (i = 0; i < n; ++i) {
-        p = (void*) ((char *)p - real_size);
-        p->next = next;
-        next->prev = p;
-#  ifndef NDEBUG
-        p->gen = (void *)0xdeadbeef;
-#  endif
-        next = p;
-    }
-    PARROT_ASSERT(p == new_arena->start_objects);
-    p->prev = prev;
-    prev->next = p;
-    pool->free_list = p;
-    PARROT_ASSERT(p != marker);
-}
-
-/*
-
-=item C<static void gc_gms_alloc_objects(PARROT_INTERP, Small_Object_Pool
-*pool)>
-
-Allocate new objects for the given pool.
-
-=cut
-
-*/
-
-static void
-gc_gms_alloc_objects(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool))
-{
-    ASSERT_ARGS(gc_gms_alloc_objects)
-    const size_t real_size = pool->object_size;
-    Small_Object_Arena * const new_arena = mem_internal_allocate(sizeof (Small_Object_Arena));
-    const size_t size = real_size * pool->objects_per_alloc;
-
-    new_arena->start_objects = mem_internal_allocate(size);
-    /* insert arena in list */
-    Parrot_append_arena_in_pool(interp, pool, new_arena, size);
-    /* create chain of objects, set free pointer */
-    gc_gms_chain_objects(interp, pool, new_arena, real_size);
-
-    /* allocate more next time */
-    pool->objects_per_alloc = (UINTVAL) pool->objects_per_alloc *
-        UNITS_PER_ALLOC_GROWTH_FACTOR;
-    size = real_size * pool->objects_per_alloc;
-    if (size > POOL_MAX_BYTES) {
-        pool->objects_per_alloc = POOL_MAX_BYTES / real_size;
-    }
-}
-
-/*
-
-=item C<static void gc_gms_more_objects(PARROT_INTERP, Small_Object_Pool *pool)>
-
-Run a GC cycle or allocate new objects for the given pool.
-
-=cut
-
-*/
-
-static void
-gc_gms_more_objects(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool))
-{
-    ASSERT_ARGS(gc_gms_more_objects)
-    if (pool->skip)
-        pool->skip = 0;
-    else if (pool->last_Arena) {
-        Parrot_gc_mark_and_sweep(interp, GC_trace_stack_FLAG);
-        if (pool->num_free_objects <= pool->replenish_level)
-            pool->skip = 1;
-    }
-
-    if (pool->free_list == &pool->marker) {
-        (*pool->alloc_objects) (interp, pool);
-    }
-}
-
-/*
-
-=item C<static PObj * gc_gms_get_free_object(PARROT_INTERP, Small_Object_Pool
-*pool)>
-
-Get a new object off the free_list in the given pool.
-
-2) object consumption
-   the free ptr moves towards the marker
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static PObj *
-gc_gms_get_free_object(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool))
-{
-    ASSERT_ARGS(gc_gms_get_free_object)
-    PObj *ptr;
-    Gc_gms_hdr *hdr;
-
-    hdr = pool->free_list;
-    if (hdr == &pool->marker)
-        (pool->more_objects)(interp, pool);
-
-    hdr = pool->free_list;
-    pool->free_list = hdr->next;
-    hdr->gen = pool->last_gen;
-    ptr = GMSH_to_PObj(hdr);
-    PObj_flags_SETTO((PObj*) ptr, 0);
-    return ptr;
-}
-
-/*
-
-=back
-
-=head2 Generation handling functions
-
-overall header chain layout
-
-           gen 0         gen 1      ...    gen N
-  marker [first last) [first last)  ...   [first last)  marker
-
-The last (youngest) generation N holds these (pool) pointers:
-
-  [ black ... gray )          during marking
-  [ gray ... white )          during marking
-  [ white ... free_list )     allocated items
-  [ free_list ... marker )    free items
-
-The black, white, and generation ranges have additionally (TODO)
-*fin variants, which refer to PMCs that need destruction/finalization.
-These are always in front of the ranges to be processed first.
-
-=over 4
-
-=item C<static Gc_gms_gen * gc_gms_create_gen(PARROT_INTERP, Small_Object_Pool
-*pool, size_t gen_no)>
-
-Create a generation structure for the given generation number.
-
-=cut
-
-*/
-
-PARROT_MALLOC
-PARROT_CANNOT_RETURN_NULL
-static Gc_gms_gen *
-gc_gms_create_gen(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool), size_t gen_no)
-{
-    ASSERT_ARGS(gc_gms_create_gen)
-    Gc_gms_gen * const gen = mem_sys_allocate(sizeof (*gen));
-
-    gen->gen_no = gen_no;
-    gen->pool = pool;
-    gen->timely_destruct_obj_sofar = 0;
-    gen->black_color = b_PObj_live_FLAG;
-    gen->prev = NULL;
-    gen->next = NULL;
-    gen->first = gen->last = gen->fin = &pool->marker;
-    gen->igp.first = NULL;
-    gen->igp.last = NULL;
-
-    return gen;
-}
-
-/*
-
-=item C<static void gc_gms_init_gen(PARROT_INTERP, Small_Object_Pool *pool)>
-
-Initalize the generation system by creating the first two generations.
-
-=cut
-
-*/
-
-static void
-gc_gms_init_gen(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool))
-{
-    ASSERT_ARGS(gc_gms_init_gen)
-    Gc_gms_private *gmsp;
-    /*
-     * Generations are numbered beginning at zero
-     * 0 ... oldest
-     * 1 ... next oldest
-     *
-     * If a constant hash PMC refers to non-constant header buffers or
-     * items, these items can be placed in the constant generation 0
-     * XXX: OTOH this would work only for this GC subsystem.
-     */
-    pool->first_gen = gc_gms_create_gen(interp, pool, 0);
-    pool->last_gen = pool->first_gen;
-    gmsp = interp->arena_base->gc_private;
-    gmsp->current_gen_no = 0;
-}
-
-/*
-
-=item C<static Gc_gms_gen * gc_gms_find_gen(PARROT_INTERP, const Gc_gms_hdr *h,
-UINTVAL gen_no)>
-
-Finds the generation associated with the given header and generation number.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static Gc_gms_gen *
-gc_gms_find_gen(PARROT_INTERP, ARGIN(const Gc_gms_hdr *h), UINTVAL gen_no)
-{
-    ASSERT_ARGS(gc_gms_find_gen)
-    Gc_gms_gen *gen;
-    const Small_Object_Pool * const pool = h->gen->pool;
-
-    PARROT_ASSERT(pool);
-
-    for (gen = pool->first_gen; gen; gen = gen->next) {
-        if (gen_no == gen->gen_no)
-            return gen;
-        if (gen->gen_no > gen_no) {
-            gen = NULL;
-            break;
-        }
-    }
-    /* we could create generations lazily - not all object sizes
-     * might exist in every generation
-     *
-     * TODO insert generation
-     */
-    Parrot_ex_throw_from_c_args(interp, NULL, 1,
-        "generation %d not found for hdr %p", gen_no, h);
-}
-
-/*
-
-=item C<static void gc_gms_promote(PARROT_INTERP, Gc_gms_hdr *h, UINTVAL
-gen_no)>
-
-Promote the header to the specified generation.
-
-=cut
-
-*/
-
-static void
-gc_gms_promote(PARROT_INTERP, ARGIN(Gc_gms_hdr *h), UINTVAL gen_no)
-{
-    ASSERT_ARGS(gc_gms_promote)
-    Gc_gms_gen *gen;
-    Gc_gms_hdr *prev, *next;
-    Small_Object_Pool * const pool = h->gen->pool;
-
-    /* unsnap from current generation */
-    prev = h->prev;
-    next = h->next;
-    if (h == pool->white) {
-        pool->white = next;
-    }
-    prev->next = next;
-    next->prev = prev;
-
-    /* locate generation pointer */
-    gen = gc_gms_find_gen(interp, h, gen_no);
-    PARROT_ASSERT(gen->last);
-    PARROT_ASSERT(gen->first);
-
-    /* TODO if it needs destroy put it in front */
-    next = gen->last;
-    if (h == next)
-        next = gen->last = h->next;
-    prev = next->prev;
-    if (gen->first == &pool->marker)
-        gen->first = h;
-    h->prev = prev;
-    h->next = next;
-    prev->next = h;
-    next->prev = h;
-#  if GC_GMS_DEBUG
-    gms_debug_verify(interp, pool, "promote");
-#  endif
-}
-
-/*
-
-=item C<static void gc_gms_store_hdr_list(PARROT_INTERP, Gc_gms_hdr_list *l,
-Gc_gms_hdr *h)>
-
-Store the header into the header list.
-
-=cut
-
-*/
-
-static void
-gc_gms_store_hdr_list(PARROT_INTERP, ARGMOD(Gc_gms_hdr_list *l), ARGIN(Gc_gms_hdr *h))
-{
-    ASSERT_ARGS(gc_gms_store_hdr_list)
-    Gc_gms_hdr_store * const s = l->last;
-
-    /* if it's not created or if it's full allocate new store */
-    if (!s || s->ptr == &s->store[GC_GMS_STORE_SIZE]) {
-        s = mem_sys_allocate(sizeof (Gc_gms_hdr_store));
-        s->ptr = &s->store[0];
-        s->next = NULL;
-        /* chain new store to old one */
-        if (l->first) {
-            PARROT_ASSERT(l->last);
-            l->last->next = s;
-        }
-        else {
-            l->first = s;
-        }
-        l->last = s;
-    }
-    *(s->ptr)++ = h;
-}
-
-/*
-
-=item C<static void gc_gms_clear_hdr_list(PARROT_INTERP, Gc_gms_hdr_list *l)>
-
-Clear the header list and free it's memory to the OS.
-
-=cut
-
-*/
-
-static void
-gc_gms_clear_hdr_list(PARROT_INTERP, ARGMOD(Gc_gms_hdr_list *l))
-{
-    ASSERT_ARGS(gc_gms_clear_hdr_list)
-    Gc_gms_hdr_store *s, *next;
-
-    for (s = l->first; s; s = next) {
-        next = s->next;
-        mem_sys_free(s);
-    }
-    l->first = l->last = NULL;
-}
-
-/*
-
-=item C<static void gc_gms_store_igp(PARROT_INTERP, Gc_gms_hdr *h)>
-
-Add the header to the inter-generational pointer list of it's generation.
-
-=cut
-
-*/
-
-static void
-gc_gms_store_igp(PARROT_INTERP, ARGIN(Gc_gms_hdr *h))
-{
-    ASSERT_ARGS(gc_gms_store_igp)
-    Gc_gms_gen * const gen = h->gen;
-    Gc_gms_hdr_list * const igp = &gen->igp;
-
-    gc_gms_store_hdr_list(interp, igp, h);
-}
-
-/*
-
-=item C<static void gc_gms_clear_igp(PARROT_INTERP, Gc_gms_gen *gen)>
-
-Clear the inter-generational pointer list of the given generation.
-
-=cut
-
-*/
-
-static void
-gc_gms_clear_igp(PARROT_INTERP, ARGIN(Gc_gms_gen *gen))
-{
-    ASSERT_ARGS(gc_gms_clear_igp)
-    Gc_gms_hdr_list * const igp = &gen->igp;
-
-    gc_gms_clear_hdr_list(interp, igp);
-}
-
-/*
-
-=item C<void parrot_gc_gms_wb(PARROT_INTERP, PMC *agg, void *old, void *_new)>
-
-Called by the write barrier. The aggregate belongs to an older generation
-then the I<new> value written into it. Put the header of the new value
-onto the IGP list for the current generation, if it contains pointers
-to other items, and promote it to the old generation.
-
-=cut
-
-*/
-
-void
-parrot_gc_gms_wb(PARROT_INTERP, ARGIN(PMC *agg), ARGIN(void *old),
-    ARGIN(void *_new))
-{
-    ASSERT_ARGS(parrot_gc_gms_wb)
-    Gc_gms_hdr * const nh = PObj_to_GMSH(_new);
-    Gc_gms_hdr * const ah = PObj_to_GMSH(agg);
-
-    /* if this may be an aggregate store it in IGP list, thus making
-     * it a possible root for this generation
-     */
-    if (PObj_is_PMC_TEST((PObj *)_new) && ((PMC *)_new)->pmc_ext)
-        gc_gms_store_igp(interp, nh);
-
-    /* promote RHS to old generation of aggregate */
-    gc_gms_promote(interp, nh, ah->gen->gen_no);
-
-    /*
-     * TODO check old - its overwritten, increment overwrite count,
-     * if it's an aggregate all contents *may* be dead now, so
-     * increment overwrite count by elements
-     */
-}
-
-/*
-
-=item C<void parrot_gc_gms_wb_key(PARROT_INTERP, PMC *agg, void *old, void
-*old_key, void *_new, void *new_key)>
-
-=cut
-
-*/
-
-void
-parrot_gc_gms_wb_key(PARROT_INTERP, ARGIN(PMC *agg), ARGIN(void *old),
-    ARGIN(void *old_key), ARGIN(void *_new), ARGIN(void *new_key))
-{
-    ASSERT_ARGS(parrot_gc_gms_wb_key)
-    Gc_gms_hdr *nh, *ah;
-
-    /* handle hash values */
-    parrot_gc_gms_wb(interp, agg, old, _new);
-
-    /* if hash keys are PObj* then promote new key too */
-
-    /* TODO: check if key is a PObj */
-
-    nh = PObj_to_GMSH(new_key);
-    ah = PObj_to_GMSH(agg);
-
-    /* promote new key to old generation of aggregate */
-    gc_gms_promote(interp, nh, ah->gen->gen_no);
-}
-
-typedef struct Gc_gms_plan {
-    int merge_gen;
-    int gen_no;
-} Gc_gms_plan;
-
-/*
-
-=item C<static void gc_gms_merge_gen(PARROT_INTERP, Small_Object_Pool *pool, int
-flag, Gc_gms_plan *plan)>
-
-Merge black pointers to the previous generation, and update the free list.
-
-=cut
-
-*/
-
-static void
-gc_gms_merge_gen(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool),
-        int flag, SHIM(Gc_gms_plan *plan))
-{
-    ASSERT_ARGS(gc_gms_merge_gen)
-    Gc_gms_hdr *h;
-
-    /* run through the blacks and set their generation pointer
-     * to the previous generation
-     */
-    Gc_gms_gen * const gen = pool->last_gen;
-    Gc_gms_gen * const prev = gen->prev;
-
-    for (h = pool->black; h != pool->free_list; h = h->next) {
-        h->gen = prev;
-        /* TODO update statistics */
-        /* TODO merge hdrs that need finalization */
-    }
-    prev->last = pool->free_list;
-    /*
-     * clear IGP for gen
-     */
-    gc_gms_clear_igp(interp, gen);
-}
-
-/*
-
-=item C<static void gc_gms_use_gen(PARROT_INTERP, Small_Object_Pool *pool, int
-flag, const Gc_gms_plan *plan)>
-
-Specify what generation to use by default.
-
-=cut
-
-*/
-
-static void
-gc_gms_use_gen(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool),
-        int flag, ARGIN(const Gc_gms_plan *plan))
-{
-    ASSERT_ARGS(gc_gms_use_gen)
-    Gc_gms_gen *gen, *prev;
-    UINTVAL next_gen;
-
-    /* set hdr pointers in last generation */
-    gen        = pool->last_gen;
-    gen->first = pool->black;
-    gen->fin   = pool->black_fin;
-    gen->last  = pool->free_list;
-
-    /* create and append a new generation */
-    next_gen       = plan->gen_no + 1;
-    gen            = gc_gms_create_gen(interp, pool, next_gen);
-    prev           = pool->last_gen;
-    pool->last_gen = gen;
-    prev->next     = gen;
-    gen->prev      = prev;
-
-    /* set generation in interpreter */
-    interp->gc_generation = next_gen;
-}
-
-/*
-
-=item C<static int set_gen_cb(PARROT_INTERP, Small_Object_Pool *pool, int flag,
-void *arg)>
-
-Set the generation to use, merging if necessary.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-static int
-set_gen_cb(PARROT_INTERP, ARGIN(Small_Object_Pool *pool), int flag, ARGIN(void *arg))
-{
-    ASSERT_ARGS(set_gen_cb)
-    Gc_gms_plan * const plan = (Gc_gms_plan *)arg;
-
-    if (plan->merge_gen)
-        gc_gms_merge_gen(interp, pool, flag, plan);
-    else
-        gc_gms_use_gen(interp, pool, flag, plan);
-    return 0;
-}
-
-/*
-
-=item C<static void gc_gms_set_gen(PARROT_INTERP)>
-
-Setup the generations, deciding what to do based on the plan and moving
-headers around as necessary.
-
-=cut
-
-*/
-
-static void
-gc_gms_set_gen(PARROT_INTERP)
-{
-    ASSERT_ARGS(gc_gms_set_gen)
-    Gc_gms_plan plan;
-    Gc_gms_private *gmsp;
-    /*
-     * there are these basic plans
-     * 1) Use the black as the next old generation
-     * 2) Merge the blacks to the existing older generation
-     *    The plan to use depends on the interpreter, specifically, if
-     *    we are doing a lazy run, entering a new scope, or what not.
-     * 3) If we are leaving a scope (denoted by a lazy GC run
-     *    and we had created one or more generations in this scope
-     *    go back by resetting the generation number to the outer
-     *    scope's generation
-     * 4) Check the overwrite count of older generations. If there is
-     *    a significant percentage of possibly dead objects, scan
-     *    older generations too.
-     *
-     * TODO only 1 and 2 done for now
-     *      3) and 4) need to reset live flags of the previous generation(s)
-     *      or better use the per-generation black_color for marking
-     */
-    gmsp = interp->arena_base->gc_private;
-    plan.merge_gen = 0;
-    plan.gen_no = gmsp->current_gen_no;
-    if (gmsp->current_gen_no > 0)
-        plan.merge_gen = 1;
-    else
-        gmsp->current_gen_no = 1;
-    header_pools_iterate_callback(interp, POOL_ALL, &plan, set_gen_cb);
-}
-
-/*
-
-=back
-
-=head2 Marking functions
-
-Header chain layout
-
-Init: gray := black := white
-
- 3) marking the root set
-
- 3a) the white 'h' is to be set to gray to be scanned for children
-
- +---+---+---+---+---+---+->      +---+->
- | b | b | g | g | g | w          | h |
- +---+---+---+---+---+---+      <-+---+
-   ^       ^           ^
-   |       |           |
-   black   gray        white
-
- 3b) DFS if 'h' needs timely destruction
-
- +---+---+---+---+---+---+---+->
- | b | b | h | g | g | g | w
- +---+---+---+---+---+---+---+
-   ^       ^               ^
-   |       |               |
-   black   gray            white
-
-
- 3c) BFS in the normal case
-
- +---+---+---+---+---+---+---+->
- | b | b | g | g | g | h | w
- +---+---+---+---+---+---+---+
-   ^       ^               ^
-   |       |               |
-   black   gray            white
-
- 3d) the white is a scalar and immediately blackened
-
-
- +---+---+---+---+---+---+---+->
- | b | b | h | g | g | g | w
- +---+---+---+---+---+---+---+
-   ^           ^           ^
-   |           |           |
-   black       gray        white
-
- 3e) blacken the gray 'h' during trace_children
-
- +---+---+---+---+---+---+---+->
- | b | b | h | g | g | g | w
- +---+---+---+---+---+---+---+
-   ^       ^               ^
-   |       |               |
-   black   gray            white
-
-
- +---+---+---+---+---+---+---+->
- | b | b | h | g | g | g | w
- +---+---+---+---+---+---+---+
-   ^           ^           ^
-   |           |           |
-   black       gray        white
-
-=over 4
-
-=cut
-
-*/
-
-/*
-
-=item C<static void gc_gms_setto_gray(PARROT_INTERP, Gc_gms_hdr *h, int
-priority)>
-
-Set the white header C<h> to gray.
-
-=cut
-
-*/
-
-static void
-gc_gms_setto_gray(PARROT_INTERP, ARGIN(Gc_gms_hdr *h), int priority)
-{
-    ASSERT_ARGS(gc_gms_setto_gray)
-    Small_Object_Pool * const pool = h->gen->pool;
-    /*
-     * TODO high_priority like in src/gc/api.c
-     */
-    /*
-     * if the white is adjacent to gray, move pointer
-     */
-    if (pool->white == h && (!priority || pool->white == pool->gray))
-        pool->white = h->next;
-    else {
-        Gc_gms_hdr *next, *prev;
-
-        prev = h->prev;
-        next = h->next;
-        if (h == pool->white)
-            pool->white = next;
-        prev->next = next;
-        next->prev = prev;
-
-        if (priority) {
-            /* insert at gray */
-            next = pool->gray;       /* DFS */
-            pool->gray = h;
-        }
-        else {
-            /* insert before white */
-            next = pool->white;                  /* BFS */
-        }
-        prev = next->prev;
-        h->next = next;
-        h->prev = prev;
-        next->prev = h;
-        prev->next = h;
-
-        /* if there wasn't any gray or black before */
-        if (pool->gray == pool->white) {
-            pool->gray = h;
-            if (pool->black == pool->white) {
-                pool->black = h;
-            }
-        }
-    }
-    PARROT_ASSERT(h != pool->white);
-    /* verify all these pointer moves */
-#  if GC_GMS_DEBUG
-    gms_debug_verify(interp, pool, "to_gray");
-#  endif
-}
-
-/*
-
-=item C<static void gc_gms_setto_black(PARROT_INTERP, Gc_gms_hdr *h, int
-priority)>
-
-Set the white header C<h> to black.
-
-=cut
-
-*/
-
-static void
-gc_gms_setto_black(PARROT_INTERP, ARGMOD(Gc_gms_hdr *h), int priority)
-{
-    ASSERT_ARGS(gc_gms_setto_black)
-    Small_Object_Pool * const pool = h->gen->pool;
-
-    /*
-     * TODO high_priority like src/gc/api.c
-     * TODO if h needs destructions insert in front of chain
-     */
-    /*
-     * if the white is adjacent to black, move pointer
-     */
-    if (pool->black == h) {
-        PARROT_ASSERT(pool->gray == h);
-        PARROT_ASSERT(pool->white == h);
-        pool->white = h->next;
-        pool->gray = h->next;
-    }
-    else {
-        Gc_gms_hdr *next, *prev;
-
-        prev = h->prev;
-        next = h->next;
-        if (h == pool->white) {
-            pool->white = next;
-            if (h == pool->gray)
-                pool->gray = next;
-        }
-        prev->next = next;
-        next->prev = prev;
-
-        /* insert before gray */
-        next = pool->gray;
-        prev = next->prev;
-        h->next = next;
-        h->prev = prev;
-        next->prev = h;
-        prev->next = h;
-        if (pool->black == pool->gray) {
-            pool->black = h;
-        }
-    }
-    PARROT_ASSERT(h != pool->white);
-    PARROT_ASSERT(h != pool->gray);
-#  if GC_GMS_DEBUG
-    gms_debug_verify(interp, pool, "to_black");
-#  endif
-}
-
-/*
-
-=item C<void parrot_gc_gms_Parrot_gc_mark_PObj_alive(PARROT_INTERP, PObj *obj)>
-
-Set the object live - called by the Parrot_gc_mark_PObj_alive macro
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-parrot_gc_gms_Parrot_gc_mark_PObj_alive(PARROT_INTERP, ARGMOD(PObj *obj))
-{
-    ASSERT_ARGS(parrot_gc_gms_Parrot_gc_mark_PObj_alive)
-    Gc_gms_hdr *h;
-    int priority;
-
-    PObj_live_SET(obj);
-    priority =  PObj_needs_early_gc_TEST(obj);
-    if (priority)
-        ++interp->arena_base->num_early_PMCs_seen;
-    h = PObj_to_GMSH(obj);
-    /* unsnap it from white, put it into gray or black */
-    if (PObj_is_PMC_TEST(obj) && ((PMC*)obj)->pmc_ext)
-        gc_gms_setto_gray(interp, h, priority);
-    else
-        gc_gms_setto_black(interp, h, priority);
-}
-
-/*
-
-=item C<static int init_mark_cb(PARROT_INTERP, Small_Object_Pool *pool, int
-flag, void *arg)>
-
-Initialization callback, initialize all the pointers.
-
-=cut
-
-*/
-
-static int
-init_mark_cb(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool), int flag, ARGIN(void *arg))
-{
-    ASSERT_ARGS(init_mark_cb)
-    pool->gray = pool->black = pool->black_fin = pool->white;
-#  if GC_GMS_DEBUG
-    gms_debug_verify(interp, pool, "init_mark");
-#  endif
-    return 0;
-}
-
-/*
-
-=item C<static void gc_gms_init_mark(PARROT_INTERP)>
-
-Initialize the mark phase of GC.
-
-=cut
-
-*/
-
-static void
-gc_gms_init_mark(PARROT_INTERP)
-{
-    ASSERT_ARGS(gc_gms_init_mark)
-    Arenas * const arena_base = interp->arena_base;
-
-    arena_base->gc_trace_ptr        = NULL;
-    arena_base->gc_mark_start       = NULL;
-    arena_base->num_early_PMCs_seen = 0;
-    arena_base->num_extended_PMCs   = 0;
-
-    header_pools_iterate_callback(interp, POOL_ALL, 0, init_mark_cb);
-}
-
-/*
-
-=item C<static int trace_igp_cb(PARROT_INTERP, Small_Object_Pool *pool, int
-flag, void *arg)>
-
-Trace through the IGP of the pool to find alive items that are pointing
-to items in other generations.
-
-=cut
-
-*/
-
-static int
-trace_igp_cb(PARROT_INTERP, ARGIN(Small_Object_Pool *pool), int flag, SHIM(void *arg))
-{
-    ASSERT_ARGS(trace_igp_cb)
-    Gc_gms_hdr_store *s;
-    Gc_gms_gen * const gen = pool->last_gen;
-    Gc_gms_hdr_list * const igp = &gen->igp;
-
-    for (s = igp->first; s; s = s->next) {
-        const Gc_gms_hdr **p;
-        for (p = s->store; p < s->ptr; ++p) {
-            Gc_gms_hdr * const h = *p;
-            Parrot_gc_mark_PObj_alive(interp, GMSH_to_PObj(h));
-        }
-    }
-    return 0;
-}
-
-/*
-
-=item C<static int gc_gms_trace_root(PARROT_INTERP, int trace_stack)>
-
-Trace the root set. If C<trace_stack> is true, trace system areas.
-
-=cut
-
-*/
-
-static int
-gc_gms_trace_root(PARROT_INTERP, int trace_stack)
-{
-    ASSERT_ARGS(gc_gms_trace_root)
-    const int ret = Parrot_gc_trace_root(interp, trace_stack);
-
-    if (ret == 0)
-        return 0;
-    header_pools_iterate_callback(interp, POOL_ALL, 0, trace_igp_cb);
-    return ret;
-}
-
-/*
-
-=item C<static int trace_children_cb(PARROT_INTERP, Small_Object_Pool *pool, int
-flag, void *arg)>
-
-Trace through child objects
-
-=cut
-
-*/
-
-static int
-trace_children_cb(PARROT_INTERP, ARGIN(Small_Object_Pool *pool), int flag, SHIM(void *arg))
-{
-    ASSERT_ARGS(trace_children_cb)
-    Arenas * const arena_base = interp->arena_base;
-    const int lazy_gc = arena_base->lazy_gc;
-    Gc_gms_hdr *h;
-
-    for (h = pool->gray; h != pool->white;) {
-        PMC * const current = (PMC*)GMSH_to_PObj(h);
-        UINTVAL bits;
-
-        if (lazy_gc && arena_base->num_early_PMCs_seen >=
-                arena_base->num_early_gc_PMCs) {
-            return 1;
-        }
-        /* TODO propagate flag in Parrot_gc_mark_PObj_alive */
-        arena_base->gc_trace_ptr = current;
-        if (!PObj_needs_early_gc_TEST(current))
-            PObj_high_priority_gc_CLEAR(current);
-
-        /* mark children */
-        if (PObj_custom_mark_TEST(current)) {
-            VTABLE_mark(interp, current);
-        }
-        if (h != pool->gray) {
-            /* if a gray was inserted DFS, it is next */
-            h = pool->gray;
-        }
-        else {
-            h = h->next;
-            pool->gray = h;
-        }
-    }
-    return 0;
-}
-
-/*
-
-=item C<static int gc_gms_trace_children(PARROT_INTERP)>
-
-Traverse gray objects: mark and blacken. Returns 0 if the trace was aborted
-lazily.
-
-=cut
-
-*/
-
-static int
-gc_gms_trace_children(PARROT_INTERP)
-{
-    ASSERT_ARGS(gc_gms_trace_children)
-    return !header_pools_iterate_callback(interp, POOL_PMC, 0,
-            trace_children_cb);
-}
-
-/*
-
-=item C<static int sweep_cb_pmc(PARROT_INTERP, Small_Object_Pool *pool, int
-flag, void *arg)>
-
-move everything from white up to the free_list to the free_list
-scan for active destroy objects
-TODO put these in front of the pool at pool->white_fin
-
-=cut
-
-*/
-
-static int
-sweep_cb_pmc(PARROT_INTERP, ARGIN(Small_Object_Pool *pool), int flag, SHIM(void *arg))
-{
-    ASSERT_ARGS(sweep_cb_pmc)
-    Gc_gms_hdr *h;
-    Arenas * const arena_base = interp->arena_base;
-
-    /* TODO object stats */
-
-    for (h = pool->white; h != pool->free_list; h = h->next) {
-        PMC * const obj = (PMC*)GMSH_to_PObj(h);
-        if (PObj_needs_early_gc_TEST(obj))
-            --arena_base->num_early_gc_PMCs;
-        if (PObj_active_destroy_TEST(obj))
-            VTABLE_destroy(interp, (PMC *)obj);
-        if (PObj_is_PMC_EXT_TEST(obj) && obj->pmc_ext) {
-            /* if the PMC has a PMC_EXT structure,
-             * return it to the pool
-             */
-            Small_Object_Pool * const ext_pool = arena_base->pmc_ext_pool;
-            ext_pool->add_free_object(interp, ext_pool, obj->pmc_ext);
-        }
-
-    }
-    pool->free_list = pool->white;
-    return 0;
-}
-
-/*
-
-=item C<static int sweep_cb_buf(PARROT_INTERP, Small_Object_Pool *pool, int
-flag, void *arg)>
-
-Sweep the buffer pool, freeing things that are dead.
-
-=cut
-
-*/
-
-static int
-sweep_cb_buf(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool), int flag, SHIM(void *arg))
-{
-    ASSERT_ARGS(sweep_cb_buf)
-    Gc_gms_hdr *h;
-
-    /* TODO object stats */
-
-    for (h = pool->white; h != pool->free_list; h = h->next) {
-        PObj * const obj = GMSH_to_PObj(h);
-        /*
-         * this is ugly, we still have to sweep all buffers
-         */
-        if (PObj_sysmem_TEST(obj) && PObj_bufstart(obj)) {
-            /* has sysmem allocated, e.g. Parrot_str_pin */
-            mem_sys_free(PObj_bufstart(obj));
-            PObj_bufstart(obj) = NULL;
-            PObj_buflen(obj) = 0;
-        }
-        else {
-#  ifdef GC_IS_MALLOC
-            /* free allocated space at (int*)bufstart - 1,
-             * but not if it is used COW or external
-             */
-            if (PObj_bufstart(obj) &&
-                    !PObj_is_external_or_free_TESTALL(obj)) {
-                if (PObj_COW_TEST(obj)) {
-                    INTVAL *refcount = PObj_bufrefcountptr(obj);
-
-                    if (!--(*refcount))
-                        free(refcount); /* the actual bufstart */
-                }
-                else
-                    free(PObj_bufrefcountptr(obj));
-            }
-#  else
-            /*
-             * XXX Jarkko did report that on irix pool->mem_pool
-             *     was NULL, which really shouldn't happen
-             */
-            if (pool->mem_pool) {
-                if (!PObj_COW_TEST(obj)) {
-                    ((Memory_Pool *)
-                     pool->mem_pool)->guaranteed_reclaimable +=
-                        PObj_buflen(obj);
-                }
-                ((Memory_Pool *)
-                 pool->mem_pool)->possibly_reclaimable +=
-                    PObj_buflen(obj);
-            }
-#  endif
-            PObj_buflen(obj) = 0;
-        }
-    }
-    pool->free_list = pool->white;
-    return 0;
-}
-
-/*
-
-=item C<static void gc_gms_sweep(PARROT_INTERP)>
-
-Free unused resources, put white objects onto free_list.
-
-=cut
-
-*/
-
-static void
-gc_gms_sweep(PARROT_INTERP)
-{
-    ASSERT_ARGS(gc_gms_sweep)
-    header_pools_iterate_callback(interp, POOL_PMC, 0, sweep_cb_pmc);
-    header_pools_iterate_callback(interp, POOL_BUFFER, 0, sweep_cb_buf);
-}
-
-/*
-
-=item C<static int end_cycle_cb(PARROT_INTERP, Small_Object_Pool *pool, int
-flag, void *arg)>
-
-Reset the pointers in the pool at the end of the cycle.
-
-=cut
-
-*/
-
-static int
-end_cycle_cb(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool), int flag, SHIM(void *arg))
-{
-    ASSERT_ARGS(end_cycle_cb)
-    Gc_gms_hdr *h;
-    /*
-     * clear live flags
-     * TODO just swap black and white
-     */
-    if (!pool->black || pool->black == &pool->marker)
-        return 0;
-    for (h = pool->black; h != pool->white; h = h->next)
-        PObj_live_CLEAR(GMSH_to_PObj(h));
-    pool->black = pool->black_fin = pool->gray = pool->white;
-    return 0;
-}
-
-/*
-
-=item C<static void gc_gms_end_cycle(PARROT_INTERP)>
-
-End the cycle, resetting pointers in all pools.
-
-=cut
-
-*/
-
-static void
-gc_gms_end_cycle(PARROT_INTERP)
-{
-    ASSERT_ARGS(gc_gms_end_cycle)
-    header_pools_iterate_callback(interp, POOL_ALL, 0, end_cycle_cb);
-}
-
-/*
-
-=back
-
-=head2 Interface function main entry
-
-=over 4
-
-=item C<static void parrot_gc_gms_run(PARROT_INTERP, UINTVAL flags)>
-
-Interface to C<Parrot_gc_mark_and_sweep>. C<flags> is one of:
-
-  GC_lazy_FLAG   ... timely destruction
-  GC_finish_FLAG ... run a final sweep to destruct objects at
-                      interpreter shutdown
-
-=cut
-
-*/
-
-static void
-parrot_gc_gms_run(PARROT_INTERP, UINTVAL flags)
-{
-    ASSERT_ARGS(parrot_gc_gms_run)
-    Arenas * const arena_base = interp->arena_base;
-    Gc_gms_private *g_gms;
-
-    if (arena_base->gc_mark_block_level) {
-        return;
-    }
-    ++arena_base->gc_mark_block_level;
-    g_gms = arena_base->gc_private;
-    if (flags & GC_finish_FLAG) {
-        Small_Object_Pool * const pool = arena_base->pmc_pool;
-
-        pool->white = pool->marker.next;
-        /* XXX need to sweep over objects that have finalizers only */
-        header_pools_iterate_callback(interp, POOL_PMC, 0, sweep_cb_pmc);
-        gc_gms_end_cycle(interp);
-        --arena_base->gc_mark_block_level;
-        return;
-    }
-
-    /* normal or lazy mark run */
-    arena_base->gc_mark_runs++;
-    arena_base->lazy_gc = (flags & GC_lazy_FLAG);
-    gc_gms_init_mark(interp);
-    if (gc_gms_trace_root(interp, !arena_base->lazy_gc) &&
-            gc_gms_trace_children(interp)) {
-        gc_gms_sweep(interp);
-        gc_gms_set_gen(interp);
-    }
-    else {
-        /*
-         * successful lazy mark run
-         */
-        ++arena_base->gc_lazy_mark_runs;
-    }
-    gc_gms_end_cycle(interp);
-    --arena_base->gc_mark_block_level;
-}
-
-/*
-
-=item C<static void gms_debug_verify(PARROT_INTERP, Small_Object_Pool *pool,
-const char *action)>
-
-Debug function, check that everything is right.
-
-=cut
-
-*/
-
-#  if GC_GMS_DEBUG
-static void
-gms_debug_verify(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool), ARGIN(const char *action))
-{
-    ASSERT_ARGS(gms_debug_verify)
-    Gc_gms_hdr *h;
-    int bf, gf, wf, ff;
-    size_t i;
-
-    const size_t n = pool->total_objects;
-
-    bf = gf = wf = ff = 0;
-
-
-    for (i = 0, h = &pool->marker; i <= n + 10; ++i) {
-        if (i && h == &pool->marker)
-            break;
-        if (h == pool->black)
-            bf++;
-        if (h == pool->gray)
-            gf++;
-        if (h == pool->white)
-            wf++;
-        if (h == pool->free_list)
-            ff++;
-        h = h->next;
-    }
-    if (i != n + 1)
-        fprintf(stderr, "gms_verify %s: chain corrupt %u objs %u total\n",
-                action, i, n);
-    if (bf != 1)
-        fprintf(stderr, "gms_verify %s: found %u blacks\n", action, bf);
-    if (gf != 1)
-        fprintf(stderr, "gms_verify %s: found %u grays\n", action, gf);
-    if (wf != 1)
-        fprintf(stderr, "gms_verify %s: found %u whites\n", action, wf);
-    if (ff != 1)
-        fprintf(stderr, "gms_verify %s: found %u frees\n", action, ff);
-}
-
-
-#  endif  /* GC_GMS_DEBUG */
-
-#endif  /* PARROT_GC_GMS */
-
-/*
-
-=back
-
-=head1 SEE ALSO
-
-F<src/gc/api.c>, F<include/parrot/gc_api.h>, F<include/parrot/pobj.h>,
-F<src/gc/incremental_ms.c>
-
-=head1 HISTORY
-
-Initial version by leo (2005.01.12 - 2005.01.30)
-
-=cut
-
-*/
-
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/gc/incremental_ms.c
==============================================================================
--- branches/orderedhash_revamp/src/gc/incremental_ms.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,1163 +0,0 @@
-/*
-Copyright (C) 2001-2009, Parrot Foundation.
-$Id$
-
-=head1 NAME
-
-src/gc/incremental_ms.c - Incremental mark and sweep garbage collection
-
-=head1 DESCRIPTION
-
-The following comments describe a new garbage collection scheme for
-Parrot.
-
-The scheme of this algorithm is described in the literature with these
-keywords:
-
- - non-copying, mark & sweep
- - incremental
- - realtime
- - incremental update with write barrier
-
-Further we might try this optimization
-
- - treadmill optimization or
- - implict reclamation
-
-=head1 Drawbacks of the current mark and sweep collector.
-
- * can take arbitrary time to complete (1s for 1 Meg objects)
- * can't be used in multi-threaded Parrot
- * works fast for plain (non-aggregate) objects but suffers badly
-   for nested aggregates or HLL objects
- * the sweep phase takes time proportional to the allocated storage
-
-=head1 INCREMENTAL GARBAGE COLLECTION
-
-=head2 Terms
-
-=over 4
-
-=item object
-
-An item like a buffer header or a PMC which is managed by Parrot's
-dynamic memory system.
-
-=item aggregate
-
-An object that possibly holds references to other objects. For example
-an array, hash, or reference PMC.
-
-=item tri-color marking
-
-All objects have one of three colors: white, grey, or black.
-
-At the beginning of a GC mark run all objects are white (not yet visited).
-During marking objects are greyed (visited - found alive), but their
-contents isn't yet scanned. A fully scanned grey object gets finally
-colored black. It will not again be rescanned in this run.
-
-Only aggregates can be grey, non-containers are blackened immediately.
-
-Objects on the free-list are sometimes denoted having the color off-white
-or ecru.
-
-=item GC
-
-In Parrot tree the copying garbage collector that recycles string and
-buffer memory. Configure.pl has a switch to use a malloc library instead,
-which makes string and buffer memory non-moving.
-
-=item collector
-
-The reclamation system.
-
-=item mutator
-
-The normal operation of the program which may or may not change the
-collectors view of objects.
-
-=item incremental
-
-Garbage collection and normal program operation is interleaved. This
-guarantees short and bounded pause times. Garbage collection doesn't
-significantly interrupt program execution, collector and mutator are
-running pseudo-parallel.
-
-=item root set
-
-All structures in the interpreter that might point to objects. E.g.
-stacks, globals, and of course the registers. All objects the
-interpreter works with, are directly or indirectly reachable starting
-from the root set.
-
-=item the tri-color invariant
-
-At no time a black object may reference a white one directly. Actually
-this is the strong incarnation of the invariant - all paths from black
-objects to white objects lead over at least one grey object.
-
-The weak tri-color invariant is: there is at least one such path to a
-white object, so that it's reachable.
-
-The strong invariant is the basic idea of mark and sweep too. But as the
-mutator isn't running during mark phase, the invariant is never violated.
-
-Due to this invariant, after the root set has been marked and when all
-greyed objects are marked (blackened), the white objects have to be
-dead.
-
-=item paint it black
-
-Or, which color do new objects have?
-
-Actually this should be tunable. Or it depends. If objects are born
-white and die immediately, they get collected in the same GC cycle. OTOH
-when these objects are stored into an existing (black) array, we have to
-do more work to keep the tri-color invariant valid.
-
-Anyway, when allocating new objects white, the collector must run more
-often or must do more work per increment to make the algorithm stop
-somewhen.
-
-=item write barrier
-
-To keep the tri-color invariant valid all pointer stores into black
-objects have to be tracked. If a white object would be stored into a
-black array, and this object isn't refered to by another object it would
-get collected. The write barrier greys the white object, so that it get
-scanned later or alternatively greys the aggregate for a rescan. The latter
-can be better, if a sequence of such stores would happen.
-
-=back
-
-=head2 Data structure overview
-
-The incremental mark and sweep collector has an additional structure in
-the arena_base that keeps track of the collector's state. Pool and arena
-structures are unchanged. Only the allocation of new arena blocks is done
-much more fine grained in e.g. 8K blocks.
-
-=head2 Implicit reclamation (optional)
-
-=over 4
-
-=item from-space
-
-The graph of all objects found live during the last collection.
-
-=item to-space
-
-The work area of the collector. During marking live objects are "moved"
-from the from-space into the to-space. This is the same as the text_for_GC
-list used in src/gc/api.c. The to-space is initially empty. During marking
-it gets greyed and finally all reachable objects are black.
-
-=item free-list
-
-New objects are allocated from the free-list. The free-list is adjacent
-to the to-space. Allocating a new objects thus means, moving the free
-pointer one word forward and paint the new object black.
-
-=back
-
-All objects get two additional pointers (forward, backward) and are
-arranged like in this scheme:
-
-
-    <-- allocation direction         marking -->
-            |                          |
-  [w] <--> [w] <--> [b] <--> [b] <--> [g] <--> [g] <--> [w] <-> [w]
-
-            ^        ^                 ^                 ^
-            |        |                 |                 |
-   free-list-ptr     to-space          scan-pointer      from-space
-
-Objects get "moved" during collection by rearranging the doubly-linked
-object pointers. At the end of a mark run (when the last grey object is
-blackened), the from-space and the free-list are merged serving
-as the new free-list of the next GC cycle. This operation is just a few
-pointer manipulations that replaces the sweep phase of a mark and sweep
-collector.
-
-=head2 Phases of operation
-
-=over 4
-
-=item a) initialization
-
-After interpreter creation the GC system is initialized by marking
-parts of the root set (globals, internal structures).
-
-=item b) program operation
-
-For each bunch of allocated objects (A) the collector does k.A work, for
-some constant k > 1. As new objects are allocated black the number of
-whites is reduced steadily. This means that the throttle factor k could
-be less then one too, but this could highly increase average memory usage.
-
-To keep the memory usage limited k > 1 must hold.
-
-=item c) near the end of a mark phase
-
-The rest of the root set is scanned, i.e. the registers. By deferring
-scanning of registers all temporaries that might have exist somewhen
-just stay unscanned - they will be collected in this mark phase, if
-we allocate new objects white or in the next mark phase.
-
-=item d) finishing a mark phase
-
-The current sweep of the whole arena is done, or with implicit reclamation:
-
-Garbage gets appended to the free-list by merging the unscanned
-from-space with the free-list, these objects are all considered white.
-All other items are in the to-space and are black. These objects
-constitute the from-space of the new collection cycle.
-
-Now he meaning of the black bit is reversed effectively setting the new
-from-space to white.
-
-The next mark phase is initialized in one step a) and the new cycle starts.
-
-Alternatively the mutator could run and allocate objects for some time,
-without starting the collector again, if there are plenty of free objects on
-all free-lists.
-
-=item e) collect buffer memory
-
-Finally, we might trigger a collect run on string and buffer memory if
-there is an impending shortage of resources. While the copying compactor
-is rather independent of the collector that cleans object headers, it's
-more efficient to collect buffer memory when the live information is
-accurate. This avoids copying of dead buffer memory.
-
-=back
-
-=head2 Comparison with our current mark and sweep collector
-
-  MS  ... mark and sweep (stop-the-world)
-  IMS ... incremental mark and sweep
-  IMIR .. incremental mark implicit reclamation
-
-                       MS                 IMS               IMIR
-  ------------------------------------------------------------------------
-  operation            stop-the-world     incremental       incremental
-  time per mark phase  unbounded          bounded           bounded
-  size overhead        1 word             1 word            2 words
-  time overhead        O(2*live + dead)   O(2*live + dead)  O(live)   2)
-
-Notes:
-
-  2) it should be possible to mark containers at once by using the
-     information of the from-space pointers and tracking changes
-     to the aggregate.
-
-=head2 Implementation details and unsorted remarks
-
-=over 4
-
-=item the object graph
-
-The MS and IMS scheme use the next_for_GC pointer for keeping track of
-references. This interferes with the freeze functionality, which can use
-the same pointer to keep track of visited objects.
-
-IMIR has a dedicated pointer pair to build the object graph.
-
-=item Greying objects
-
-Greying objects is done depth-first. This has much better cache locality
-then visiting an object again much later. In the picture above this means
-that grey objects are inserted at the left end of the mark chain immediately
-to the right of the object that gets blackened.
-
-=item big aggregates
-
-Greying has to be done in increments. Big aggregates can't have a mark
-vtable that could run arbitrarily long. This means that the GC system
-must know the layout of arrays, hashes, and objects. This is currently
-true for arrays and objects but not for hashes. But the latter need some
-refactoring of internals anyway.
-
-To avoid visiting all aggregate elements, it could be better to track
-the graph of old aggregates by using a write barrier for all writes into
-the array. This would basically create a generational collector. The old
-generation (the aggregate) isn't scanned. But changes to this "old
-generation" are tracked and reflected in the collectors graph of
-objects.
-
-=item timely destruction
-
-The interpreter arena has a count of currently active objects that need
-timely destruction. When during scope exit an high priority sweep is
-triggered, we have basically two cases:
-
-1) all of these objects were already seen in this mark phase - the scope
-exit can continue.
-
-2) Not all objects were seen - they might be alive or not. This means
-that the mark phase must run to the end to decide, if these objects are
-alive (or again until all are found alive).
-
-To increase performance its likely that we need some additional
-information that keeps track of the location of such objects and just
-try to mark paths to objects that need timely destruction.
-
-=item concurrent or parallel collection
-
-As the described algorithm is already incremental its well-suited for
-parallel collection in a multi-threaded Parrot. The work of greying
-objects can be done in parallel by atomically handling a bunch of
-objects to another thread. After doing some increments of marking, these
-objects then get returned to the shared to-space. The parallel
-collection is finished when the last object is blackened and all threads
-have reached the thread barrier rendezvous point. (Please note the very
-different meaning of barrier here).
-
-But also a single-threaded Parrot can vastly take advantage by running
-increments of the collection during waiting for I/O completion or during
-a sleep opcode.
-
-=back
-
-=head1 FUNCTIONS
-
-=over 4
-
-=cut
-
-*/
-
-#include "parrot/parrot.h"
-#include "parrot/gc_api.h"
-#include "gc_private.h"
-
-/* HEADERIZER HFILE: src/gc/gc_private.h */
-
-/* HEADERIZER BEGIN: static */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-
-static int collect_cb(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool),
-    SHIM(int flag),
-    ARGIN(void *arg))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(4)
-        FUNC_MODIFIES(*pool);
-
-static void gc_ims_add_free_object(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool),
-    ARGOUT(void *to_add))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*pool)
-        FUNC_MODIFIES(*to_add);
-
-static void gc_ims_alloc_objects(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pool);
-
-PARROT_CANNOT_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-static void * gc_ims_get_free_object(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pool);
-
-static void gc_ims_pool_init(SHIM_INTERP, ARGMOD(Small_Object_Pool *pool))
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*pool);
-
-static int parrot_gc_ims_collect(PARROT_INTERP, int check_only)
-        __attribute__nonnull__(1);
-
-static void parrot_gc_ims_deinit(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-static void parrot_gc_ims_mark(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-static void parrot_gc_ims_reinit(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-static void parrot_gc_ims_run(PARROT_INTERP, UINTVAL flags)
-        __attribute__nonnull__(1);
-
-static void parrot_gc_ims_run_increment(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-static void parrot_gc_ims_sweep(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-static int sweep_cb(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool),
-    int flag,
-    ARGIN(void *arg))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(4)
-        FUNC_MODIFIES(*pool);
-
-#define ASSERT_ARGS_collect_cb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool) \
-    || PARROT_ASSERT_ARG(arg)
-#define ASSERT_ARGS_gc_ims_add_free_object __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool) \
-    || PARROT_ASSERT_ARG(to_add)
-#define ASSERT_ARGS_gc_ims_alloc_objects __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_gc_ims_get_free_object __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_gc_ims_pool_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_parrot_gc_ims_collect __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_parrot_gc_ims_deinit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_parrot_gc_ims_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_parrot_gc_ims_reinit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_parrot_gc_ims_run __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_parrot_gc_ims_run_increment __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_parrot_gc_ims_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_sweep_cb __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pool) \
-    || PARROT_ASSERT_ARG(arg)
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: static */
-
-
-/* size of one arena */
-#define ALLOCATION_BLOCK_SIZE 8192
-
-/*
- * each ALLOCATIONS_INIT allocations of any object an incremental
- * step is triggered
- */
-#define ALLOCATIONS_INIT      1024*4
-
-/* a mark step does allocations * throttle work */
-#define THROTTLE              1.3
-
-/*
- * if we have at the end total * refill free objects
- * we just do nothing
- */
-#define REFILL_FACTOR         0.5
-
-/*
- * we run the copying collector, if memory pool statistics indicate
- * that this amount of the total size could be freed
- *
- * This factor also depends on the allocation color of buffer headers,
- * which is set to black now. So we are always one mark phase behind
- * and the statistics are rather wrong.
- */
-#define MEM_POOL_RECLAIM      0.2
-
-#if 0
-#  define IMS_DEBUG(x) fprintf (x)
-#else
-#  define IMS_DEBUG(x)
-#endif
-
-typedef enum {          /* these states have to be in execution order */
-    GC_IMS_INITIAL,     /* memory subsystem setup */
-    GC_IMS_STARTING,    /* wait for gc_block_level to clear */
-    GC_IMS_RE_INIT,     /* start of normal operation - mark root */
-    GC_IMS_MARKING,     /* mark children */
-    GC_IMS_START_SWEEP, /* mark finished, start sweep buffers */
-    GC_IMS_SWEEP,       /* sweep buffers */
-    GC_IMS_COLLECT,     /* collect buffer memory */
-    GC_IMS_FINISHED,    /* update statistics */
-    GC_IMS_CONSUMING,   /* when we have plenty of free objects */
-    GC_IMS_DEAD         /* gc is already shutdown */
-
-} gc_ims_state_enum;
-
-typedef struct Gc_ims_private {
-    gc_ims_state_enum   state;
-    size_t      allocations;    /* get_free_object count */
-    size_t      alloc_trigger;  /* after this number of allocations a gc
-                                   increment is triggered */
-    double      throttle;       /* throttle * allocations per increment work */
-    size_t      increments;     /* increment count */
-    int         lazy;           /* timely destruction run */
-    size_t      n_objects;      /* live count of prev run */
-    size_t      n_extended_PMCs;/* PMCs found during mark_special */
-} Gc_ims_private;
-
-
-/*
-
-=item C<static void gc_ims_add_free_object(PARROT_INTERP, Small_Object_Pool
-*pool, void *to_add)>
-
-Add object C<to_add> to the free_list in the given pool.
-C<pool->num_free_objects> has to be updated by the caller.
-
-=cut
-
-*/
-
-static void
-gc_ims_add_free_object(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool), ARGOUT(void *to_add))
-{
-    ASSERT_ARGS(gc_ims_add_free_object)
-    *(void **)to_add = pool->free_list;
-    pool->free_list  = to_add;
-#if DISABLE_GC_DEBUG
-    UNUSED(interp);
-#else
-    if (GC_DEBUG(interp)  && pool == interp->arena_base->pmc_pool) {
-        PMC * const p = (PMC *)to_add;
-        p->vtable     = interp->vtables[enum_class_Null];
-    }
-#endif
-}
-
-/*
-
-=item C<static void * gc_ims_get_free_object(PARROT_INTERP, Small_Object_Pool
-*pool)>
-
-Get a new object off the free_list in the given pool.
-
-=cut
-
-*/
-
-PARROT_CANNOT_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-static void *
-gc_ims_get_free_object(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool))
-{
-    ASSERT_ARGS(gc_ims_get_free_object)
-    PObj *ptr;
-    Arenas * const arena_base    = interp->arena_base;
-    Gc_ims_private * const g_ims = (Gc_ims_private *)arena_base->gc_private;
-
-    if (++g_ims->allocations >= g_ims->alloc_trigger) {
-        g_ims->allocations = 0;
-        parrot_gc_ims_run_increment(interp);
-    }
-
-    /* if we don't have any objects */
-    if (!pool->free_list)
-        (*pool->alloc_objects) (interp, pool);
-
-    ptr             = (PObj *)pool->free_list;
-    pool->free_list = *(void **)ptr;
-
-    /*
-     * buffers are born black, PMCs not yet?
-     * XXX this does not solve the problem of storing keys in hashes
-     *     in the next mark phase (if the key isn't marked elsewhere ?)
-     */
-    PObj_flags_SETTO(ptr, pool == arena_base->pmc_pool ? 0 : PObj_live_FLAG);
-    --pool->num_free_objects;
-    return (void *)ptr;
-}
-
-
-/*
-
-=item C<static void gc_ims_alloc_objects(PARROT_INTERP, Small_Object_Pool
-*pool)>
-
-Allocate new objects for the given pool.
-
-=cut
-
-*/
-
-static void
-gc_ims_alloc_objects(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool))
-{
-    ASSERT_ARGS(gc_ims_alloc_objects)
-    Small_Object_Arena *new_arena;
-    size_t size;
-
-    pool->objects_per_alloc  = ALLOCATION_BLOCK_SIZE / pool->object_size;
-
-    /* Setup memory for the new objects */
-    new_arena                = mem_allocate_typed(Small_Object_Arena);
-    size                     = ALLOCATION_BLOCK_SIZE;
-    new_arena->start_objects = mem_sys_allocate(size);
-
-    Parrot_append_arena_in_pool(interp, pool, new_arena, size);
-
-    Parrot_add_to_free_list(interp, pool, new_arena);
-}
-
-
-/*
-
-=item C<static void gc_ims_pool_init(PARROT_INTERP, Small_Object_Pool *pool)>
-
-Initializes a pool by setting the appropriate function pointers to add, get,
-and allocate objects.
-
-=cut
-
-*/
-
-static void
-gc_ims_pool_init(SHIM_INTERP, ARGMOD(Small_Object_Pool *pool))
-{
-    ASSERT_ARGS(gc_ims_pool_init)
-    pool->add_free_object = gc_ims_add_free_object;
-    pool->get_free_object = gc_ims_get_free_object;
-    pool->alloc_objects   = gc_ims_alloc_objects;
-    pool->more_objects    = pool->alloc_objects;
-}
-
-
-/*
-
-=item C<static void parrot_gc_ims_deinit(PARROT_INTERP)>
-
-Shuts down this GC system.
-
-=cut
-
-*/
-
-static void
-parrot_gc_ims_deinit(PARROT_INTERP)
-{
-    ASSERT_ARGS(parrot_gc_ims_deinit)
-    Arenas * const arena_base = interp->arena_base;
-
-    mem_sys_free(arena_base->gc_private);
-    arena_base->gc_private = NULL;
-}
-
-
-/*
-
-=item C<void Parrot_gc_ims_init(PARROT_INTERP)>
-
-Initialize the state structures of the gc system. Called immediately before
-creation of memory pools. This function must set the function pointers
-for C<add_free_object_fn>, C<get_free_object_fn>, C<alloc_objects_fn>, and
-C<more_objects_fn>.
-
-=cut
-
-*/
-
-void
-Parrot_gc_ims_init(PARROT_INTERP)
-{
-    ASSERT_ARGS(Parrot_gc_ims_init)
-    Arenas * const arena_base = interp->arena_base;
-    arena_base->gc_private    = mem_allocate_zeroed_typed(Gc_ims_private);
-
-    /* set function hooks according to pdd09 */
-
-    arena_base->do_gc_mark         = parrot_gc_ims_run;
-    arena_base->finalize_gc_system = parrot_gc_ims_deinit;
-    arena_base->init_pool          = gc_ims_pool_init;
-
-    /* run init state */
-    parrot_gc_ims_run_increment(interp);
-}
-
-
-/*
-
-=item C<static void parrot_gc_ims_reinit(PARROT_INTERP)>
-
-Reinitialize the collector for the next collection cycle.
-
-=cut
-
-*/
-
-static void
-parrot_gc_ims_reinit(PARROT_INTERP)
-{
-    ASSERT_ARGS(parrot_gc_ims_reinit)
-    Gc_ims_private *g_ims;
-    Arenas * const  arena_base = interp->arena_base;
-
-    arena_base->lazy_gc = 0;
-    Parrot_gc_run_init(interp);
-
-    /*
-     * trace root set w/o system areas
-     * TODO also skip volatile roots
-     */
-    Parrot_gc_trace_root(interp, GC_TRACE_ROOT_ONLY);
-
-    g_ims        = (Gc_ims_private *)arena_base->gc_private;
-    g_ims->state = GC_IMS_MARKING;
-
-}
-
-
-/*
-
-=item C<static void parrot_gc_ims_mark(PARROT_INTERP)>
-
-Mark a bunch of children.
-
-The work depends on item counts with and without a next_for_GC field.
-The former are marked immediately, only the latter need real work here.
-
-=cut
-
-*/
-
-static void
-parrot_gc_ims_mark(PARROT_INTERP)
-{
-    ASSERT_ARGS(parrot_gc_ims_mark)
-    size_t todo;
-    double work_factor;
-    PMC   *next;
-
-    Arenas * const arena_base    = (Arenas *)interp->arena_base;
-    Gc_ims_private * const g_ims = (Gc_ims_private *)arena_base->gc_private;
-
-    /* use statistics from the previous run */
-    if (g_ims->n_objects)
-        work_factor = (double)g_ims->n_extended_PMCs / g_ims->n_objects;
-    else
-        work_factor = 1.0;
-
-    todo = (size_t)(g_ims->alloc_trigger * g_ims->throttle * work_factor);
-
-    PARROT_ASSERT(arena_base->lazy_gc == 0);
-    Parrot_gc_trace_children(interp, todo);
-
-    /* check if we are finished with marking -- the end is self-referential */
-    next = arena_base->gc_mark_start;
-
-    if (next == PMC_next_for_GC(next))
-        g_ims->state = GC_IMS_START_SWEEP;
-}
-
-
-/*
-
-=item C<static int sweep_cb(PARROT_INTERP, Small_Object_Pool *pool, int flag,
-void *arg)>
-
-Callback to sweep a header pool (see header_pools_iterate_callback).
-
-=cut
-
-*/
-
-static int
-sweep_cb(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool), int flag, ARGIN(void *arg))
-{
-    ASSERT_ARGS(sweep_cb)
-    int * const n_obj = (int *)arg;
-
-    Parrot_gc_sweep_pool(interp, pool);
-
-    if (interp->profile && (flag & POOL_PMC))
-        Parrot_gc_profile_end(interp, PARROT_PROF_GC_cp);
-
-    *n_obj += pool->total_objects - pool->num_free_objects;
-
-    return 0;
-}
-
-
-/*
-
-=item C<static void parrot_gc_ims_sweep(PARROT_INTERP)>
-
-Free unused objects in all header pools.
-
-TODO split work per pool.
-
-=cut
-
-*/
-
-static void
-parrot_gc_ims_sweep(PARROT_INTERP)
-{
-    ASSERT_ARGS(parrot_gc_ims_sweep)
-    Arenas * const  arena_base = interp->arena_base;
-    Gc_ims_private *g_ims      = (Gc_ims_private *)arena_base->gc_private;
-    size_t          n_objects;
-    int             ignored;
-
-    IMS_DEBUG((stderr, "\nSWEEP\n"));
-
-    /*
-     * as we are now gonna kill objects, make sure that we
-     * have traced the current stack
-     * except for a lazy run, which is invoked from the run loop
-     */
-
-    /* TODO mark volatile roots */
-    Parrot_gc_trace_root(interp, g_ims->lazy ? GC_TRACE_ROOT_ONLY
-                                             : GC_TRACE_FULL);
-
-    /* mark (again) rest of children */
-    Parrot_gc_trace_children(interp, (size_t) -1);
-
-    /* now sweep all */
-    n_objects = 0;
-    ignored   = header_pools_iterate_callback(interp, POOL_BUFFER | POOL_PMC,
-            (void*)&n_objects, sweep_cb);
-    UNUSED(ignored);
-
-    if (interp->profile)
-        Parrot_gc_profile_end(interp, PARROT_PROF_GC_cb);
-
-    g_ims->state           = GC_IMS_COLLECT;
-    g_ims->n_objects       = n_objects;
-    g_ims->n_extended_PMCs = arena_base->num_extended_PMCs;
-}
-
-
-/*
-
-=item C<static int collect_cb(PARROT_INTERP, Small_Object_Pool *pool, int flag,
-void *arg)>
-
-Callback to collect a header pool (see header_pools_iterate_callback).
-
-=cut
-
-*/
-
-#if !defined(GC_IS_MALLOC) || !GC_IS_MALLOC
-
-static int
-collect_cb(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool), SHIM(int flag), ARGIN(void *arg))
-{
-    ASSERT_ARGS(collect_cb)
-    const int           check_only = (int)(INTVAL)arg;
-    Memory_Pool * const mem_pool   = pool->mem_pool;
-
-    /* check if there is an associated memory pool */
-    if (!mem_pool)
-        return 0;
-
-    /* and if the memory pool supports compaction */
-    if (!mem_pool->compact)
-        return 0;
-
-    /*
-     * several header pools can share one memory pool
-     * if that pool is already compacted, the following is zero
-     */
-    if (!mem_pool->guaranteed_reclaimable)
-        return 0;
-
-    /* check used size */
-    if ((mem_pool->possibly_reclaimable * mem_pool->reclaim_factor +
-                mem_pool->guaranteed_reclaimable) >=
-            mem_pool->total_allocated * MEM_POOL_RECLAIM) {
-        IMS_DEBUG((stderr, "COMPACT\n"));
-        if (check_only)
-            return 1;
-        mem_pool->compact(interp, mem_pool);
-    }
-
-    return 0;
-}
-
-#endif
-
-
-/*
-
-=item C<static int parrot_gc_ims_collect(PARROT_INTERP, int check_only)>
-
-Run the copying collector in memory pools, if it could yield some free memory.
-
-=cut
-
-*/
-
-static int
-parrot_gc_ims_collect(PARROT_INTERP, int check_only)
-{
-    ASSERT_ARGS(parrot_gc_ims_collect)
-#if defined(GC_IS_MALLOC) && GC_IS_MALLOC
-    UNUSED(interp);
-    UNUSED(check_only);
-#else
-    Arenas * const  arena_base = interp->arena_base;
-    Gc_ims_private *g_ims;
-    int             ret;
-
-    if (!check_only && interp->profile)
-        Parrot_gc_profile_start(interp);
-
-    g_ims = (Gc_ims_private *)arena_base->gc_private;
-
-    ret   = header_pools_iterate_callback(interp, POOL_BUFFER,
-            (void *)(long)check_only, collect_cb);
-
-    if (ret)
-        return ret;
-
-    if (check_only)
-        return 0;
-
-    if (interp->profile)
-        Parrot_gc_profile_end(interp, PARROT_PROF_GC);
-
-    g_ims->state = GC_IMS_FINISHED;
-#endif
-    return 0;
-}
-
-
-/*
-
-=item C<static void parrot_gc_ims_run_increment(PARROT_INTERP)>
-
-Run one increment of collection. This function is triggered by object
-allocation.
-
-=cut
-
-*/
-
-static void
-parrot_gc_ims_run_increment(PARROT_INTERP)
-{
-    ASSERT_ARGS(parrot_gc_ims_run_increment)
-    Arenas * const arena_base    = interp->arena_base;
-    Gc_ims_private * const g_ims = (Gc_ims_private *)arena_base->gc_private;
-
-    if (arena_base->gc_mark_block_level || g_ims->state == GC_IMS_DEAD)
-        return;
-
-    ++g_ims->increments;
-    IMS_DEBUG((stderr, "state = %d => ", g_ims->state));
-
-    switch (g_ims->state) {
-        case GC_IMS_INITIAL:
-            g_ims->state         = GC_IMS_STARTING;
-            g_ims->alloc_trigger = ALLOCATIONS_INIT;
-            g_ims->throttle      = THROTTLE;
-            break;
-        case GC_IMS_STARTING:
-            /*  fall through and start */
-            /* FALLTHRU */
-        case GC_IMS_RE_INIT:
-            parrot_gc_ims_reinit(interp);
-            break;
-
-        case GC_IMS_MARKING:
-            parrot_gc_ims_mark(interp);
-            break;
-
-        case GC_IMS_START_SWEEP:
-            g_ims->state = GC_IMS_SWEEP;
-            /* fall through */
-        case GC_IMS_SWEEP:
-            parrot_gc_ims_sweep(interp);
-            /* fall through */
-        case GC_IMS_COLLECT:
-            (void)parrot_gc_ims_collect(interp, 0);
-            break;
-        case GC_IMS_FINISHED:
-            ++arena_base->gc_mark_runs;
-            g_ims->state = GC_IMS_CONSUMING;
-            /* fall through */
-        case GC_IMS_CONSUMING:
-            /*
-             * This currently looks only at PMCs and string_headers.
-             * There shouldn't be other pools that could run out of
-             * headers independent of PMCs
-             */
-            if (arena_base->pmc_pool->num_free_objects <
-                    arena_base->pmc_pool->total_objects * REFILL_FACTOR) {
-                g_ims->state = GC_IMS_STARTING;
-            }
-            else if (arena_base->string_header_pool->num_free_objects <
-                    arena_base->string_header_pool->total_objects *
-                    REFILL_FACTOR) {
-                g_ims->state = GC_IMS_STARTING;
-            }
-            break;
-        default:
-            PANIC(interp, "Unknown state in gc_ims");
-    }
-
-    IMS_DEBUG((stderr, "%d\n", g_ims->state));
-}
-
-
-/*
-
-=item C<static void parrot_gc_ims_run(PARROT_INTERP, UINTVAL flags)>
-
-Interface to C<Parrot_gc_mark_and_sweep>. C<flags> is one of:
-
-  GC_lazy_FLAG   ... timely destruction
-  GC_finish_FLAG ... run until live bits are clear
-
-=cut
-
-*/
-
-static void
-parrot_gc_ims_run(PARROT_INTERP, UINTVAL flags)
-{
-    ASSERT_ARGS(parrot_gc_ims_run)
-    int                    lazy;
-    Arenas * const         arena_base = interp->arena_base;
-    Gc_ims_private * const g_ims      = (Gc_ims_private *)arena_base->gc_private;
-
-    if (arena_base->gc_mark_block_level || g_ims->state == GC_IMS_DEAD)
-        return;
-
-    if (flags & GC_finish_FLAG) {
-        /*
-         * called from really_destroy. This interpreter is gonna die.
-         * The destruction includes a sweep over PMCs, so that
-         * destructors/finalizers are called.
-         *
-         * Be sure live bits are clear.
-         */
-        if (g_ims->state >= GC_IMS_RE_INIT || g_ims->state < GC_IMS_FINISHED)
-            Parrot_gc_clear_live_bits(interp, arena_base->pmc_pool);
-
-        Parrot_gc_sweep_pool(interp, interp->arena_base->pmc_pool);
-        g_ims->state = GC_IMS_DEAD;
-
-        return;
-    }
-
-    /* make the test happy that checks the count ;) */
-    arena_base->gc_mark_runs++;
-
-    lazy = flags & GC_lazy_FLAG;
-
-    if (!lazy) {
-        /* run a full cycle
-         * TODO if we are called from mem_allocate() in src/resources.c:
-         *   * pass needed size
-         *   * test   examples/benchmarks/gc_header_new.pasm
-         */
-        if (!parrot_gc_ims_collect(interp, 1)) {
-            parrot_gc_ims_run_increment(interp);
-            return;
-        }
-
-        if (g_ims->state >= GC_IMS_FINISHED)
-            g_ims->state = GC_IMS_STARTING;
-
-        while (1) {
-            parrot_gc_ims_run_increment(interp);
-            if (g_ims->state > GC_IMS_COLLECT)
-                break;
-        }
-
-        return;
-    }
-
-    /* lazy GC handling */
-    IMS_DEBUG((stderr, "\nLAZY state = %d\n", g_ims->state));
-    g_ims->lazy = lazy;
-
-    if (g_ims->state >= GC_IMS_COLLECT) {
-        /* we are beyond sweep, timely destruction is done */
-        if (arena_base->num_early_PMCs_seen >= arena_base->num_early_gc_PMCs)
-            return;
-
-        /* when not all seen, start a fresh cycle */
-        g_ims->state = GC_IMS_RE_INIT;
-
-        /* run init, which clears lazy seen counter */
-        parrot_gc_ims_run_increment(interp);
-    }
-
-    /*
-     *  run through all steps until we see enough PMCs that need timely
-     *  destruction or we finished sweeping
-     */
-    while (arena_base->num_early_PMCs_seen < arena_base->num_early_gc_PMCs) {
-        parrot_gc_ims_run_increment(interp);
-        if (g_ims->state >= GC_IMS_COLLECT)
-            break;
-    }
-
-    /* if we stopped early, the lazy run was successful */
-    if (g_ims->state < GC_IMS_COLLECT)
-        ++arena_base->gc_lazy_mark_runs;
-
-    g_ims->lazy = 0;
-}
-
-
-/*
-
-=item C<void Parrot_gc_ims_wb(PARROT_INTERP, PMC *agg, PMC *_new)>
-
-Write barrier called by the GC_WRITE_BARRIER macro. Always when storing
-a white object into a black aggregate, either the object must
-be greyed or the aggregate must be rescanned -- so grey it.
-
-=cut
-
-*/
-
-#define GC_IMS_GREY_NEW 1
-
-void
-Parrot_gc_ims_wb(PARROT_INTERP, ARGMOD(PMC *agg), ARGMOD(PMC *_new))
-{
-    ASSERT_ARGS(Parrot_gc_ims_wb)
-#if GC_IMS_GREY_NEW
-    IMS_DEBUG((stderr, "%d agg %p mark %p\n",
-                ((Gc_ims_private *)interp->arena_base->
-                gc_private)->state, agg, _new));
-    Parrot_gc_mark_PObj_alive(interp, (PObj*)_new);
-#else
-    PObj_get_FLAGS(agg) &= ~ (PObj_live_FLAG|PObj_custom_GC_FLAG);
-    Parrot_gc_mark_PObj_alive(interp, (PObj*)agg);
-#endif
-}
-
-/*
-
-=back
-
-=head1 SEE ALSO
-
-F<src/gc/api.c>, F<include/parrot/gc_api.h>, F<include/parrot/pobj.h>,
-
-=head1 HISTORY
-
-Initial version by leo (2004.08.12 - 2004.08.15)
-
-=cut
-
-*/
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Modified: branches/orderedhash_revamp/src/gc/malloc_trace.c
==============================================================================
--- branches/orderedhash_revamp/src/gc/malloc_trace.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/gc/malloc_trace.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -17,8 +17,6 @@
 #  include <asm/signal.h>
 #endif
 
-#include "malloc-trace.h"
-
 #define ACTION_BUF_SIZE 1024
 #define TIMESTAMP_FREQ  50
 #define LOG_NAME "/tmp/mtrace"
@@ -40,7 +38,7 @@
 
 =head1 DESCRIPTION
 
-RT#48264
+TT #292
 
 =head2 Functions
 

Modified: branches/orderedhash_revamp/src/gc/mark_sweep.c
==============================================================================
--- branches/orderedhash_revamp/src/gc/mark_sweep.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/gc/mark_sweep.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -32,21 +32,21 @@
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
 static void free_buffer(SHIM_INTERP,
-    ARGMOD(Small_Object_Pool *pool),
-    ARGMOD(PObj *b))
+    ARGMOD(Fixed_Size_Pool *pool),
+    ARGMOD(Buffer *b))
         __attribute__nonnull__(2)
         __attribute__nonnull__(3)
         FUNC_MODIFIES(*pool)
         FUNC_MODIFIES(*b);
 
 static void free_buffer_malloc(SHIM_INTERP,
-    SHIM(Small_Object_Pool *pool),
-    ARGMOD(PObj *b))
+    SHIM(Fixed_Size_Pool *pool),
+    ARGMOD(Buffer *b))
         __attribute__nonnull__(3)
         FUNC_MODIFIES(*b);
 
 static void free_pmc_in_pool(PARROT_INTERP,
-    SHIM(Small_Object_Pool *pool),
+    SHIM(Fixed_Size_Pool *pool),
     ARGMOD(PObj *p))
         __attribute__nonnull__(1)
         __attribute__nonnull__(3)
@@ -54,48 +54,58 @@
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-static Small_Object_Pool * new_buffer_pool(PARROT_INTERP)
+static Fixed_Size_Pool * new_bufferlike_pool(PARROT_INTERP,
+    size_t actual_buffer_size)
         __attribute__nonnull__(1);
 
+PARROT_MALLOC
+PARROT_CANNOT_RETURN_NULL
+static Fixed_Size_Pool * new_fixed_size_obj_pool(
+    size_t object_size,
+    size_t objects_per_alloc);
+
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-static Small_Object_Pool * new_bufferlike_pool(PARROT_INTERP,
-    size_t actual_buffer_size)
+static Fixed_Size_Pool * new_pmc_pool(PARROT_INTERP)
         __attribute__nonnull__(1);
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-static Small_Object_Pool * new_pmc_pool(PARROT_INTERP)
+static Fixed_Size_Pool * new_string_pool(PARROT_INTERP, INTVAL constant)
         __attribute__nonnull__(1);
 
-PARROT_MALLOC
-PARROT_CANNOT_RETURN_NULL
-static Small_Object_Pool * new_small_object_pool(
-    size_t object_size,
-    size_t objects_per_alloc);
+static void Parrot_gc_allocate_new_attributes_arena(PARROT_INTERP,
+    ARGMOD(PMC_Attribute_Pool *pool))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        FUNC_MODIFIES(*pool);
 
-PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-static Small_Object_Pool * new_string_pool(PARROT_INTERP, INTVAL constant)
+static PMC_Attribute_Pool * Parrot_gc_create_attrib_pool(PARROT_INTERP,
+    size_t attrib_idx)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_free_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_free_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(pool) \
-    || PARROT_ASSERT_ARG(b)
-#define ASSERT_ARGS_free_buffer_malloc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(b)
-#define ASSERT_ARGS_free_pmc_in_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(b))
+#define ASSERT_ARGS_free_buffer_malloc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(b))
+#define ASSERT_ARGS_free_pmc_in_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(p))
+#define ASSERT_ARGS_new_bufferlike_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_new_fixed_size_obj_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_new_pmc_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_new_string_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_gc_allocate_new_attributes_arena \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(p)
-#define ASSERT_ARGS_new_buffer_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_new_bufferlike_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_new_pmc_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_new_small_object_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_new_string_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+    , PARROT_ASSERT_ARG(pool))
+#define ASSERT_ARGS_Parrot_gc_create_attrib_pool __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: static */
 
@@ -107,7 +117,7 @@
 =item C<void Parrot_gc_run_init(PARROT_INTERP)>
 
 Prepares the collector for a mark & sweep GC run. Initializes the various
-fields in the Arenas structure that need to be zeroed out prior to the
+fields in the Memory_Pools structure that need to be zeroed out prior to the
 mark phase.
 
 =cut
@@ -118,12 +128,11 @@
 Parrot_gc_run_init(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_gc_run_init)
-    Arenas * const arena_base       = interp->arena_base;
+    Memory_Pools * const mem_pools       = interp->mem_pools;
 
-    arena_base->gc_trace_ptr        = NULL;
-    arena_base->gc_mark_start       = NULL;
-    arena_base->num_early_PMCs_seen = 0;
-    arena_base->num_extended_PMCs   = 0;
+    mem_pools->gc_trace_ptr        = NULL;
+    mem_pools->gc_mark_start       = NULL;
+    mem_pools->num_early_PMCs_seen = 0;
 }
 
 /*
@@ -160,9 +169,8 @@
 Parrot_gc_trace_root(PARROT_INTERP, Parrot_gc_trace_type trace)
 {
     ASSERT_ARGS(Parrot_gc_trace_root)
-    Arenas           * const arena_base = interp->arena_base;
-    Parrot_Context   *ctx;
-    PObj             *obj;
+    Memory_Pools  * const mem_pools = interp->mem_pools;
+    PObj    *obj;
 
     /* note: adding locals here did cause increased GC runs */
     mark_context_start();
@@ -172,40 +180,35 @@
         return 0;
     }
 
-    if (interp->profile)
-        Parrot_gc_profile_start(interp);
-
     /* We have to start somewhere; the interpreter globals is a good place */
-    if (!arena_base->gc_mark_start) {
-        arena_base->gc_mark_start
-            = arena_base->gc_mark_ptr
+    if (!mem_pools->gc_mark_start) {
+        mem_pools->gc_mark_start
+            = mem_pools->gc_mark_ptr
             = interp->iglobals;
     }
 
     /* mark the list of iglobals */
-    Parrot_gc_mark_PObj_alive(interp, (PObj *)interp->iglobals);
+    Parrot_gc_mark_PMC_alive(interp, interp->iglobals);
 
     /* mark the current continuation */
     obj = (PObj *)interp->current_cont;
     if (obj && obj != (PObj *)NEED_CONTINUATION)
-        Parrot_gc_mark_PObj_alive(interp, obj);
+        Parrot_gc_mark_PMC_alive(interp, (PMC *)obj);
 
     /* mark the current context. */
-    ctx = CONTEXT(interp);
-    mark_context(interp, ctx);
+    Parrot_gc_mark_PMC_alive(interp, CURRENT_CONTEXT(interp));
 
     /* mark the dynamic environment. */
-    mark_stack(interp, interp->dynamic_env);
+    Parrot_gc_mark_PMC_alive(interp, interp->dynamic_env);
 
     /* mark the vtables: the data, Class PMCs, etc. */
     mark_vtables(interp);
 
     /* mark the root_namespace */
-    Parrot_gc_mark_PObj_alive(interp, (PObj *)interp->root_namespace);
+    Parrot_gc_mark_PMC_alive(interp, interp->root_namespace);
 
     /* mark the concurrency scheduler */
-    if (interp->scheduler)
-        Parrot_gc_mark_PObj_alive(interp, (PObj *)interp->scheduler);
+    Parrot_gc_mark_PMC_alive(interp, interp->scheduler);
 
     /* s. packfile.c */
     mark_const_subs(interp);
@@ -214,15 +217,15 @@
     mark_object_cache(interp);
 
     /* Now mark the class hash */
-    Parrot_gc_mark_PObj_alive(interp, (PObj *)interp->class_hash);
+    Parrot_gc_mark_PMC_alive(interp, interp->class_hash);
 
     /* Now mark the HLL stuff */
-    Parrot_gc_mark_PObj_alive(interp, (PObj *)interp->HLL_info);
-    Parrot_gc_mark_PObj_alive(interp, (PObj *)interp->HLL_namespace);
+    Parrot_gc_mark_PMC_alive(interp, interp->HLL_info);
+    Parrot_gc_mark_PMC_alive(interp, interp->HLL_namespace);
 
     /* Mark the registry */
     PARROT_ASSERT(interp->gc_registry);
-    Parrot_gc_mark_PObj_alive(interp, (PObj *)interp->gc_registry);
+    Parrot_gc_mark_PMC_alive(interp, interp->gc_registry);
 
     /* Mark the MMD cache. */
     if (interp->op_mmd_cache)
@@ -237,80 +240,57 @@
     /* quick check to see if we have already marked all impatient PMCs. If we
        have, return 0 and exit here. This will alert other parts of the GC
        that if we are in a lazy run we can just stop it. */
-    if (arena_base->lazy_gc
-    &&  arena_base->num_early_PMCs_seen >= arena_base->num_early_gc_PMCs)
+    if (mem_pools->lazy_gc
+    &&  mem_pools->num_early_PMCs_seen >= mem_pools->num_early_gc_PMCs)
         return 0;
 
-    if (interp->profile)
-        Parrot_gc_profile_end(interp, PARROT_PROF_GC_p1);
-
     return 1;
 }
 
 
 /*
 
-=item C<void Parrot_gc_sweep_pool(PARROT_INTERP, Small_Object_Pool *pool)>
+=item C<void Parrot_gc_sweep_pool(PARROT_INTERP, Fixed_Size_Pool *pool)>
 
 Puts any buffers/PMCs that are marked as "dead" or "black" onto the pool
-free list. If C<GC_IS_MALLOC>, bufstart gets freed too, if possible. Avoids
-buffers that are immune from collection (i.e. constant).
+free list.
 
 =cut
 
 */
 
 void
-Parrot_gc_sweep_pool(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool))
+Parrot_gc_sweep_pool(PARROT_INTERP, ARGMOD(Fixed_Size_Pool *pool))
 {
     ASSERT_ARGS(Parrot_gc_sweep_pool)
-    UINTVAL total_used        = 0;
-    const UINTVAL object_size = pool->object_size;
 
-    Small_Object_Arena *cur_arena;
-    gc_object_fn_type   gc_object = pool->gc_object;
+    PObj               *b;
+    Fixed_Size_Arena   *cur_arena;
+    gc_object_fn_type   gc_object   = pool->gc_object;
+    UINTVAL             total_used  = 0;
+    const UINTVAL       object_size = pool->object_size;
+    UINTVAL             i;
 
-#if GC_VERBOSE
-    if (Interp_trace_TEST(interp, 1)) {
-        Interp * const tracer = interp->debugger;
-        PMC *pio       = Parrot_io_STDERR(interp);
-
-        Parrot_io_flush(interp, pio);
-
-        if (tracer) {
-            pio = Parrot_io_STDERR(tracer);
-            Parrot_io_flush(tracer, pio);
-        }
-    }
-#endif
 
-    /* Run through all the buffer header pools and mark */
+    /* Run through all the PObj header pools and mark */
     for (cur_arena = pool->last_Arena; cur_arena; cur_arena = cur_arena->prev) {
-        Buffer *b = (Buffer *)cur_arena->start_objects;
-        UINTVAL i;
+        const size_t objects_end = cur_arena->used;
+        UINTVAL      i;
+        b = (PObj *)cur_arena->start_objects;
 
         /* loop only while there are objects in the arena */
-        for (i = cur_arena->total_objects; i; i--) {
+        for (i = objects_end; i; i--) {
 
-            if (PObj_on_free_list_TEST(b))
-                ; /* if it's on free list, do nothing */
-            else if (PObj_live_TEST(b)) {
+            /* if it's on free list, do nothing */
+
+            if (PObj_live_TEST(b)) {
                 total_used++;
                 PObj_live_CLEAR(b);
                 PObj_get_FLAGS(b) &= ~PObj_custom_GC_FLAG;
             }
-            else {
+            else if (!PObj_on_free_list_TEST(b)) {
                 /* it must be dead */
 
-#if GC_VERBOSE
-                if (Interp_trace_TEST(interp, 1)) {
-                    fprintf(stderr, "Freeing pobject %p\n", b);
-                    if (PObj_is_PMC_TEST(b)) {
-                        fprintf(stderr, "\t = PMC type %s\n",
-                                (char*) ((PMC*)b)->vtable->whoami->strstart);
-                    }
-                }
-#endif
 
                 if (PObj_is_shared_TEST(b)) {
                     /* only mess with shared objects if we
@@ -318,9 +298,8 @@
                      * a GC run.
                      * XXX wrong thing to do with "other" GCs
                      */
-                    if (!(interp->thread_data &&
-                            (interp->thread_data->state &
-                            THREAD_STATE_SUSPENDED_GC))) {
+                    if (!(interp->thread_data
+                    &&   (interp->thread_data->state & THREAD_STATE_SUSPENDED_GC))) {
                         ++total_used;
                         goto next;
                     }
@@ -332,7 +311,7 @@
                 pool->add_free_object(interp, pool, b);
             }
 next:
-            b = (Buffer *)((char *)b + object_size);
+            b = (PObj *)((char *)b + object_size);
         }
     }
 
@@ -342,8 +321,8 @@
 
 /*
 
-=item C<INTVAL contained_in_pool(const Small_Object_Pool *pool, const void
-*ptr)>
+=item C<INTVAL contained_in_pool(PARROT_INTERP, const Fixed_Size_Pool *pool,
+const void *ptr)>
 
 Returns whether the given C<*ptr> points to a location in C<pool>.
 
@@ -353,12 +332,10 @@
 
 PARROT_WARN_UNUSED_RESULT
 INTVAL
-contained_in_pool(ARGIN(const Small_Object_Pool *pool), ARGIN(const void *ptr))
+contained_in_pool(PARROT_INTERP, ARGIN(const Fixed_Size_Pool *pool), ARGIN(const void *ptr))
 {
     ASSERT_ARGS(contained_in_pool)
-    const Small_Object_Arena *arena;
-
-    ptr = PObj_to_ARENA(ptr);
+    const Fixed_Size_Arena *arena;
 
     for (arena = pool->last_Arena; arena; arena = arena->prev) {
         const ptrdiff_t ptr_diff =
@@ -378,10 +355,8 @@
 
 =item C<void mark_special(PARROT_INTERP, PMC *obj)>
 
-Marks the children of a special PMC. Handles the marking necessary
-for shared PMCs, and ensures timely marking of high-priority PMCs.
-Ensures PMC_EXT structures are properly organized for garbage
-collection.
+Handles marking a PMC. Specifically, calls the VTABLE_mark for that PMC
+if one is present. Also handles marking shared PMCs.
 
 =cut
 
@@ -391,8 +366,6 @@
 mark_special(PARROT_INTERP, ARGIN(PMC *obj))
 {
     ASSERT_ARGS(mark_special)
-    int     hi_prio;
-    Arenas *arena_base;
 
     /*
      * If the object is shared, we have to use the arena and gc
@@ -409,66 +382,29 @@
         interp = PMC_sync(obj)->owner;
         PARROT_ASSERT(interp);
 
-        if (!interp->arena_base->gc_mark_ptr)
-            interp->arena_base->gc_mark_ptr = obj;
+        if (!interp->mem_pools->gc_mark_ptr)
+            interp->mem_pools->gc_mark_ptr = obj;
     }
 
-    arena_base = interp->arena_base;
+    PObj_get_FLAGS(obj) |= PObj_custom_GC_FLAG;
 
-    if (PObj_needs_early_gc_TEST(obj))
-        ++arena_base->num_early_PMCs_seen;
+    /* clearing the flag is much more expensive then testing */
+    if (!PObj_needs_early_gc_TEST(obj))
+        PObj_high_priority_gc_CLEAR(obj);
 
-    if (PObj_high_priority_gc_TEST(obj) && arena_base->gc_trace_ptr) {
-        /* set obj's parent to high priority */
-        PObj_high_priority_gc_SET(arena_base->gc_trace_ptr);
-        hi_prio = 1;
-    }
-    else
-        hi_prio = 0;
-
-    if (obj->pmc_ext) {
-        PMC * const tptr = arena_base->gc_trace_ptr;
+    /* mark properties */
+    Parrot_gc_mark_PMC_alive(interp, PMC_metadata(obj));
 
-        ++arena_base->num_extended_PMCs;
-        /*
-         * XXX this basically invalidates the high-priority marking
-         *     of PMCs by putting all PMCs onto the front of the list.
-         *     The reason for this is the by far better cache locality
-         *     when aggregates and their contents are marked "together".
-         *
-         *     To enable high priority marking again we should probably
-         *     use a second pointer chain, which is, when not empty,
-         *     processed first.
-         */
-        if (hi_prio && tptr) {
-            if (PMC_next_for_GC(tptr) == tptr)
-                PMC_next_for_GC(obj) = obj;
-            else
-                /* put it at the head of the list */
-                PMC_next_for_GC(obj) = PMC_next_for_GC(tptr);
-
-            PMC_next_for_GC(tptr)    = (PMC*)obj;
-        }
-        else {
-            /* put it on the end of the list */
-            PMC_next_for_GC(arena_base->gc_mark_ptr) = obj;
-
-            /* Explicitly make the tail of the linked list be
-             * self-referential */
-            arena_base->gc_mark_ptr = PMC_next_for_GC(obj) = obj;
-        }
-    }
     if (PObj_custom_mark_TEST(obj)) {
-        PObj_get_FLAGS(obj) |= PObj_custom_GC_FLAG;
-        if (!PObj_constant_TEST(obj))
-            VTABLE_mark(interp, obj);
+        PARROT_ASSERT(!PObj_on_free_list_TEST(obj));
+        VTABLE_mark(interp, obj);
     }
 }
 
 
 /*
 
-=item C<void Parrot_gc_clear_live_bits(PARROT_INTERP, const Small_Object_Pool
+=item C<void Parrot_gc_clear_live_bits(PARROT_INTERP, const Fixed_Size_Pool
 *pool)>
 
 Resets the PMC pool, so all objects are marked as "White". This
@@ -480,10 +416,10 @@
 */
 
 void
-Parrot_gc_clear_live_bits(PARROT_INTERP, ARGIN(const Small_Object_Pool *pool))
+Parrot_gc_clear_live_bits(PARROT_INTERP, ARGIN(const Fixed_Size_Pool *pool))
 {
     ASSERT_ARGS(Parrot_gc_clear_live_bits)
-    Small_Object_Arena *arena;
+    Fixed_Size_Arena *arena;
     const UINTVAL object_size = pool->object_size;
 
     for (arena = pool->last_Arena; arena; arena = arena->prev) {
@@ -500,85 +436,8 @@
 
 /*
 
-=item C<int Parrot_gc_trace_children(PARROT_INTERP, size_t how_many)>
-
-Traces through the linked list formed by the C<next_for_GC> pointer.
-Returns 0 if this is a lazy GC run and we've found all impatient PMCs.
-Returns 1 if we've traced the entire list.
-
-=cut
-
-*/
-
-int
-Parrot_gc_trace_children(PARROT_INTERP, size_t how_many)
-{
-    ASSERT_ARGS(Parrot_gc_trace_children)
-    Arenas * const arena_base = interp->arena_base;
-    const int      lazy_gc    = arena_base->lazy_gc;
-    PMC           *current    = arena_base->gc_mark_start;
-
-    /*
-     * First phase of mark is finished. Now if we are the owner
-     * of a shared pool, we must run the mark phase of other
-     * interpreters in our pool, so that live shared PMCs in that
-     * interpreter are appended to our mark_ptrs chain.
-     *
-     * If there is a count of shared PMCs and we have already seen
-     * all these, we could skip that.
-     */
-    if (interp->profile)
-        Parrot_gc_profile_start(interp);
-
-    pt_gc_mark_root_finished(interp);
-
-    do {
-        PMC *next;
-
-        if (lazy_gc && arena_base->num_early_PMCs_seen >=
-                arena_base->num_early_gc_PMCs) {
-            return 0;
-        }
-
-        arena_base->gc_trace_ptr = current;
-
-        /* short-term hack to color objects black */
-        PObj_get_FLAGS(current) |= PObj_custom_GC_FLAG;
-
-        /* clearing the flag is much more expensive then testing */
-        if (!PObj_needs_early_gc_TEST(current))
-            PObj_high_priority_gc_CLEAR(current);
-
-        /* mark properties */
-        if (PMC_metadata(current))
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)PMC_metadata(current));
-
-         if (PObj_custom_mark_TEST(current)) {
-            PARROT_ASSERT(!PObj_on_free_list_TEST(current));
-            VTABLE_mark(interp, current);
-        }
-
-        next = PMC_next_for_GC(current);
-
-        if (!PMC_IS_NULL(next) && next == current)
-            break;
-
-        current = next;
-    } while (--how_many > 0);
-
-    arena_base->gc_mark_start = current;
-    arena_base->gc_trace_ptr  = NULL;
-
-    if (interp->profile)
-        Parrot_gc_profile_end(interp, PARROT_PROF_GC_p2);
-
-    return 1;
-}
-
-/*
-
-=item C<void Parrot_add_to_free_list(PARROT_INTERP, Small_Object_Pool *pool,
-Small_Object_Arena *arena)>
+=item C<void Parrot_add_to_free_list(PARROT_INTERP, Fixed_Size_Pool *pool,
+Fixed_Size_Arena *arena)>
 
 Adds the objects in the newly allocated C<arena> to the free list of the pool.
 
@@ -588,8 +447,8 @@
 
 void
 Parrot_add_to_free_list(PARROT_INTERP,
-        ARGMOD(Small_Object_Pool  *pool),
-        ARGMOD(Small_Object_Arena *arena))
+        ARGMOD(Fixed_Size_Pool  *pool),
+        ARGMOD(Fixed_Size_Arena *arena))
 {
     ASSERT_ARGS(Parrot_add_to_free_list)
     UINTVAL  i;
@@ -597,24 +456,32 @@
     const UINTVAL num_objects = pool->objects_per_alloc;
 
     pool->total_objects += num_objects;
-    arena->used          = num_objects;
-
-    /* Move all the new objects into the free list */
     object = (void *)arena->start_objects;
-
+#if GC_USE_LAZY_ALLOCATOR
+    /* Don't move anything onto the free list. Set the pointers and do it
+       lazily when we allocate. */
+    {
+        const size_t total_size = num_objects * pool->object_size;
+        pool->newfree = arena->start_objects;
+        pool->newlast = (void*)((char*)object + total_size);
+        arena->used = 0;
+    }
+#else
+    /* Move all the new objects into the free list */
+    arena->used          = num_objects;
     for (i = 0; i < num_objects; i++) {
         pool->add_free_object(interp, pool, object);
         object = (void *)((char *)object + pool->object_size);
     }
-
+#endif
     pool->num_free_objects += num_objects;
 }
 
 
 /*
 
-=item C<void Parrot_append_arena_in_pool(PARROT_INTERP, Small_Object_Pool *pool,
-Small_Object_Arena *new_arena, size_t size)>
+=item C<void Parrot_append_arena_in_pool(PARROT_INTERP, Fixed_Size_Pool *pool,
+Fixed_Size_Arena *new_arena, size_t size)>
 
 Insert the new arena into the pool's structure. Arenas are stored in a
 linked list, so add the new arena to the list. Set information in the
@@ -626,8 +493,8 @@
 
 void
 Parrot_append_arena_in_pool(PARROT_INTERP,
-    ARGMOD(Small_Object_Pool *pool),
-    ARGMOD(Small_Object_Arena *new_arena), size_t size)
+    ARGMOD(Fixed_Size_Pool *pool),
+    ARGMOD(Fixed_Size_Arena *new_arena), size_t size)
 {
     ASSERT_ARGS(Parrot_append_arena_in_pool)
 
@@ -649,86 +516,18 @@
         new_arena->prev->next = new_arena;
 
     pool->last_Arena = new_arena;
-    interp->arena_base->header_allocs_since_last_collect++;
+    interp->mem_pools->header_allocs_since_last_collect++;
 }
 
 /*
 
-=item C<void Parrot_gc_profile_start(PARROT_INTERP)>
-
-Records the start time of a GC mark run when profiling is enabled.
-
-=cut
-
-*/
-
-void
-Parrot_gc_profile_start(PARROT_INTERP)
-{
-    ASSERT_ARGS(Parrot_gc_profile_start)
-    if (Interp_flags_TEST(interp, PARROT_PROFILE_FLAG))
-        interp->profile->gc_time = Parrot_floatval_time();
-}
-
-/*
-
-=item C<void Parrot_gc_profile_end(PARROT_INTERP, int what)>
-
-Records the end time of the GC mark run part C<what> run when profiling is
-enabled. Also record start time of next part.
-
-=cut
-
-*/
-
-void
-Parrot_gc_profile_end(PARROT_INTERP, int what)
-{
-    ASSERT_ARGS(Parrot_gc_profile_end)
-    if (Interp_flags_TEST(interp, PARROT_PROFILE_FLAG)) {
-        RunProfile * const profile = interp->profile;
-        const FLOATVAL     now     = Parrot_floatval_time();
-
-        profile->data[what].numcalls++;
-        profile->data[what].time += now - profile->gc_time;
-
-        /*
-         * we've recorded the time of a GC piece from
-         * gc_time until now, so add this to the start of the
-         * currently executing opcode, which hasn't run this
-         * interval.
-         */
-        profile->starttime += now - profile->gc_time;
-
-        /* prepare start for next step */
-        profile->gc_time    = now;
-    }
-}
-
-#ifndef GC_IS_MALLOC
-#  define PMC_HEADERS_PER_ALLOC    10240 / sizeof (PMC)
-#  define BUFFER_HEADERS_PER_ALLOC  5120 / sizeof (Buffer)
-#  define STRING_HEADERS_PER_ALLOC  5120 / sizeof (STRING)
-#else /* GC_IS_MALLOC */
-#  define PMC_HEADERS_PER_ALLOC    10240 / sizeof (PMC)
-#  define BUFFER_HEADERS_PER_ALLOC 10240 / sizeof (Buffer)
-#  define STRING_HEADERS_PER_ALLOC 10240 / sizeof (STRING)
-#endif /* GC_IS_MALLOC */
-
-#define CONSTANT_PMC_HEADERS_PER_ALLOC 64
-#define GET_SIZED_POOL_IDX(x) ((x) / sizeof (void *))
-
-
-
-/*
-
 =back
 
 =head2 Header Pool Creation Functions
 
 =over 4
 
-=item C<static Small_Object_Pool * new_pmc_pool(PARROT_INTERP)>
+=item C<static Fixed_Size_Pool * new_pmc_pool(PARROT_INTERP)>
 
 Creates and initializes a new pool for PMCs and returns it.
 
@@ -738,65 +537,53 @@
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-static Small_Object_Pool *
+static Fixed_Size_Pool *
 new_pmc_pool(PARROT_INTERP)
 {
     ASSERT_ARGS(new_pmc_pool)
     const int num_headers = PMC_HEADERS_PER_ALLOC;
-    Small_Object_Pool * const pmc_pool =
-        new_small_object_pool(sizeof (PMC), num_headers);
+    Fixed_Size_Pool * const pmc_pool =
+        new_fixed_size_obj_pool(sizeof (PMC), num_headers);
 
     pmc_pool->mem_pool   = NULL;
     pmc_pool->gc_object  = free_pmc_in_pool;
 
-    (interp->arena_base->init_pool)(interp, pmc_pool);
+    (interp->gc_sys->init_pool)(interp, pmc_pool);
     return pmc_pool;
 }
 
 /*
 
-=item C<static void free_pmc_in_pool(PARROT_INTERP, Small_Object_Pool *pool,
-PObj *p)>
+=item C<static void free_pmc_in_pool(PARROT_INTERP, Fixed_Size_Pool *pool, PObj
+*p)>
 
 Frees a PMC that is no longer being used. Calls a custom C<destroy> VTABLE
-method if one is available. If the PMC uses a PMC_EXT structure, that is freed
-as well.
+method if one is available.
 
 =cut
 
 */
 
 static void
-free_pmc_in_pool(PARROT_INTERP, SHIM(Small_Object_Pool *pool),
+free_pmc_in_pool(PARROT_INTERP, SHIM(Fixed_Size_Pool *pool),
         ARGMOD(PObj *p))
 {
     ASSERT_ARGS(free_pmc_in_pool)
     PMC    * const pmc        = (PMC *)p;
-    Arenas * const arena_base = interp->arena_base;
 
     /* TODO collect objects with finalizers */
-    if (PObj_needs_early_gc_TEST(p))
-        --arena_base->num_early_gc_PMCs;
-
-    if (PObj_active_destroy_TEST(p))
-        VTABLE_destroy(interp, pmc);
-
-    if (PObj_is_PMC_EXT_TEST(p))
-         Parrot_gc_free_pmc_ext(interp, pmc);
-
-#ifndef NDEBUG
-
-    pmc->pmc_ext     = (PMC_EXT *)0xdeadbeef;
-    pmc->vtable      = (VTABLE  *)0xdeadbeef;
-
-#endif
+    if (PObj_needs_early_gc_TEST(p)) {
+        Memory_Pools * const mem_pools = interp->mem_pools;
+        --mem_pools->num_early_gc_PMCs;
+    }
 
+    Parrot_pmc_destroy(interp, pmc);
 }
 
 
 /*
 
-=item C<static Small_Object_Pool * new_bufferlike_pool(PARROT_INTERP, size_t
+=item C<static Fixed_Size_Pool * new_bufferlike_pool(PARROT_INTERP, size_t
 actual_buffer_size)>
 
 Creates a new pool for buffer-like structures. This is called from
@@ -808,28 +595,29 @@
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-static Small_Object_Pool *
+static Fixed_Size_Pool *
 new_bufferlike_pool(PARROT_INTERP, size_t actual_buffer_size)
 {
     ASSERT_ARGS(new_bufferlike_pool)
     const int num_headers          = BUFFER_HEADERS_PER_ALLOC;
     const size_t buffer_size       =
             (actual_buffer_size + sizeof (void *) - 1) & ~(sizeof (void *) - 1);
-    Small_Object_Pool * const pool =
-            new_small_object_pool(buffer_size, num_headers);
+    Fixed_Size_Pool * const pool =
+            new_fixed_size_obj_pool(buffer_size, num_headers);
+
+    pool->gc_object = (gc_object_fn_type)free_buffer;
 
-    pool->gc_object = NULL;
-    pool->mem_pool  = interp->arena_base->memory_pool;
-    (interp->arena_base->init_pool)(interp, pool);
+    pool->mem_pool  = interp->mem_pools->memory_pool;
+    (interp->gc_sys->init_pool)(interp, pool);
     return pool;
 }
 
 /*
 
-=item C<static Small_Object_Pool * new_small_object_pool(size_t object_size,
+=item C<static Fixed_Size_Pool * new_fixed_size_obj_pool(size_t object_size,
 size_t objects_per_alloc)>
 
-Creates a new C<Small_Object_Pool> and returns a pointer to it.
+Creates a new C<Fixed_Size_Pool> and returns a pointer to it.
 Initializes the pool structure based on the size of objects in the
 pool and the number of items to allocate in each arena.
 
@@ -839,31 +627,33 @@
 
 PARROT_MALLOC
 PARROT_CANNOT_RETURN_NULL
-static Small_Object_Pool *
-new_small_object_pool(size_t object_size, size_t objects_per_alloc)
+static Fixed_Size_Pool *
+new_fixed_size_obj_pool(size_t object_size, size_t objects_per_alloc)
 {
-    ASSERT_ARGS(new_small_object_pool)
-    Small_Object_Pool * const pool =
-        mem_internal_allocate_zeroed_typed(Small_Object_Pool);
+    ASSERT_ARGS(new_fixed_size_obj_pool)
+    Fixed_Size_Pool * const pool =
+        mem_internal_allocate_zeroed_typed(Fixed_Size_Pool);
 
     pool->last_Arena        = NULL;
     pool->free_list         = NULL;
     pool->mem_pool          = NULL;
     pool->object_size       = object_size;
     pool->objects_per_alloc = objects_per_alloc;
+#if GC_USE_LAZY_ALLOCATOR
+    pool->newfree           = NULL;
+    pool->newlast           = NULL;
+#endif
 
     return pool;
 }
 
-
-
 /*
 
-=item C<static Small_Object_Pool * new_buffer_pool(PARROT_INTERP)>
-
-Creates a new C<Small_Object_Pool> structure for managing buffer objects.
+=item C<static Fixed_Size_Pool * new_string_pool(PARROT_INTERP, INTVAL
+constant)>
 
-Non-constant strings and plain Buffers are stored in the sized header pools.
+Creates a new pool for C<STRING>s and returns it. This calls
+C<get_bufferlike_pool> internally, which in turn calls C<new_bufferlike_pool>.
 
 =cut
 
@@ -871,25 +661,28 @@
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-static Small_Object_Pool *
-new_buffer_pool(PARROT_INTERP)
+static Fixed_Size_Pool *
+new_string_pool(PARROT_INTERP, INTVAL constant)
 {
-    ASSERT_ARGS(new_buffer_pool)
-    Small_Object_Pool * const pool = get_bufferlike_pool(interp, sizeof (Buffer));
+    ASSERT_ARGS(new_string_pool)
+    Fixed_Size_Pool *pool;
+    if (constant) {
+        pool           = new_bufferlike_pool(interp, sizeof (STRING));
+        pool->gc_object = NULL;
+        pool->mem_pool = interp->mem_pools->constant_string_pool;
+    }
+    else
+        pool = get_bufferlike_pool(interp, sizeof (STRING));
 
-#ifdef GC_IS_MALLOC
-    pool->gc_object = free_buffer_malloc;
-#else
-    pool->gc_object = free_buffer;
-#endif
+    pool->objects_per_alloc = STRING_HEADERS_PER_ALLOC;
 
     return pool;
 }
 
 /*
 
-=item C<static void free_buffer_malloc(PARROT_INTERP, Small_Object_Pool *pool,
-PObj *b)>
+=item C<static void free_buffer_malloc(PARROT_INTERP, Fixed_Size_Pool *pool,
+Buffer *b)>
 
 Frees the given buffer, returning the storage space to the operating system
 and removing it from Parrot's memory management system. If the buffer is COW,
@@ -900,31 +693,31 @@
 */
 
 static void
-free_buffer_malloc(SHIM_INTERP, SHIM(Small_Object_Pool *pool),
-        ARGMOD(PObj *b))
+free_buffer_malloc(SHIM_INTERP, SHIM(Fixed_Size_Pool *pool),
+        ARGMOD(Buffer *b))
 {
     ASSERT_ARGS(free_buffer_malloc)
     /* free allocated space at (int *)bufstart - 1, but not if it used COW or is
      * external */
-    PObj_buflen(b) = 0;
+    Buffer_buflen(b) = 0;
 
-    if (!PObj_bufstart(b) || PObj_is_external_or_free_TESTALL(b))
+    if (!Buffer_bufstart(b) || PObj_is_external_or_free_TESTALL(b))
         return;
 
     if (PObj_COW_TEST(b)) {
-        INTVAL * const refcount = PObj_bufrefcountptr(b);
+        INTVAL * const refcount = Buffer_bufrefcountptr(b);
 
         if (--(*refcount) == 0) {
             mem_sys_free(refcount); /* the actual bufstart */
         }
     }
     else
-        mem_sys_free(PObj_bufrefcountptr(b));
+        mem_sys_free(Buffer_bufrefcountptr(b));
 }
 
 /*
 
-=item C<static void free_buffer(PARROT_INTERP, Small_Object_Pool *pool, PObj
+=item C<static void free_buffer(PARROT_INTERP, Fixed_Size_Pool *pool, Buffer
 *b)>
 
 Frees a buffer, returning it to the memory pool for Parrot to possibly
@@ -935,59 +728,27 @@
 */
 
 static void
-free_buffer(SHIM_INTERP, ARGMOD(Small_Object_Pool *pool), ARGMOD(PObj *b))
+free_buffer(SHIM_INTERP, ARGMOD(Fixed_Size_Pool *pool), ARGMOD(Buffer *b))
 {
     ASSERT_ARGS(free_buffer)
-    Memory_Pool * const mem_pool = (Memory_Pool *)pool->mem_pool;
+    Variable_Size_Pool * const mem_pool = (Variable_Size_Pool *)pool->mem_pool;
 
     /* XXX Jarkko reported that on irix pool->mem_pool was NULL, which really
      * shouldn't happen */
     if (mem_pool) {
         if (!PObj_COW_TEST(b))
-            mem_pool->guaranteed_reclaimable += PObj_buflen(b);
-
-         mem_pool->possibly_reclaimable += PObj_buflen(b);
+            mem_pool->guaranteed_reclaimable += Buffer_buflen(b);
+        else
+            mem_pool->possibly_reclaimable   += Buffer_buflen(b);
     }
 
-    PObj_buflen(b)        = 0;
+    Buffer_buflen(b) = 0;
 }
 
 
 /*
 
-=item C<static Small_Object_Pool * new_string_pool(PARROT_INTERP, INTVAL
-constant)>
-
-Creates a new pool for C<STRING>s and returns it. This calls
-C<get_bufferlike_pool> internally, which in turn calls C<new_bufferlike_pool>.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static Small_Object_Pool *
-new_string_pool(PARROT_INTERP, INTVAL constant)
-{
-    ASSERT_ARGS(new_string_pool)
-    Small_Object_Pool *pool;
-    if (constant) {
-        pool           = new_bufferlike_pool(interp, sizeof (STRING));
-        pool->mem_pool = interp->arena_base->constant_string_pool;
-    }
-    else
-        pool = get_bufferlike_pool(interp, sizeof (STRING));
-
-    pool->objects_per_alloc = STRING_HEADERS_PER_ALLOC;
-
-    return pool;
-}
-
-
-/*
-
-=item C<Small_Object_Pool * get_bufferlike_pool(PARROT_INTERP, size_t
+=item C<Fixed_Size_Pool * get_bufferlike_pool(PARROT_INTERP, size_t
 buffer_size)>
 
 Makes and return a bufferlike header pool for objects of a given size. If a
@@ -1000,12 +761,12 @@
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-Small_Object_Pool *
+Fixed_Size_Pool *
 get_bufferlike_pool(PARROT_INTERP, size_t buffer_size)
 {
     ASSERT_ARGS(get_bufferlike_pool)
-    Small_Object_Pool **sized_pools = interp->arena_base->sized_header_pools;
-    const UINTVAL       num_old     = interp->arena_base->num_sized;
+    Fixed_Size_Pool **sized_pools = interp->mem_pools->sized_header_pools;
+    const UINTVAL       num_old     = interp->mem_pools->num_sized;
     const UINTVAL       idx         = GET_SIZED_POOL_IDX(buffer_size);
 
     /* Expands the array of sized resource pools, if necessary */
@@ -1015,12 +776,12 @@
                 same debugging behavior as mem_internal_realloc, we would
                 need to add a new function/macro for
                 mem_internal_realloc_zeroed, to mirror mem_sys_realloc_zeroed. */
-        sized_pools = (Small_Object_Pool **)mem_internal_realloc(sized_pools,
+        sized_pools = (Fixed_Size_Pool **)mem_internal_realloc(sized_pools,
                                            num_new * sizeof (void *));
         memset(sized_pools + num_old, 0, sizeof (void *) * (num_new - num_old));
 
-        interp->arena_base->sized_header_pools = sized_pools;
-        interp->arena_base->num_sized = num_new;
+        interp->mem_pools->sized_header_pools = sized_pools;
+        interp->mem_pools->num_sized = num_new;
     }
 
     if (sized_pools[idx] == NULL)
@@ -1031,13 +792,13 @@
 
 /*
 
-=item C<void initialize_header_pools(PARROT_INTERP)>
+=item C<void initialize_fixed_size_pools(PARROT_INTERP)>
 
 The initialization routine for the interpreter's header pools. Initializes
-pools for string headers, constant string headers, buffers, PMCs, PMC_EXTs, and
+pools for string headers, constant string headers, buffers, PMCs and
 constant PMCs.
 
-The C<string_header_pool> and C<buffer_header_pool> are actually both in the
+The C<string_header_pool> actually lives in the
 sized pools, although no other sized pools are created here.
 
 =cut
@@ -1045,55 +806,33 @@
 */
 
 void
-initialize_header_pools(PARROT_INTERP)
+initialize_fixed_size_pools(PARROT_INTERP)
 {
-    ASSERT_ARGS(initialize_header_pools)
-    Arenas * const arena_base                     = interp->arena_base;
+    ASSERT_ARGS(initialize_fixed_size_pools)
+    Memory_Pools * const mem_pools                     = interp->mem_pools;
 
     /* Init the constant string header pool */
-    arena_base->constant_string_header_pool       = new_string_pool(interp, 1);
-    arena_base->constant_string_header_pool->name = "constant_string_header";
+    mem_pools->constant_string_header_pool       = new_string_pool(interp, 1);
+    mem_pools->constant_string_header_pool->name = "constant_string_header";
 
     /* Init the buffer header pool
      *
-     * The buffer_header_pool and the string_header_pool actually live in the
+     * The string_header_pool actually lives in the
      * sized_header_pools. These pool pointers only provide faster access in
      * new_*_header */
-    arena_base->buffer_header_pool       = new_buffer_pool(interp);
-    arena_base->buffer_header_pool->name = "buffer_header";
 
     /* Init the string header pool */
-    arena_base->string_header_pool       = new_string_pool(interp, 0);
-    arena_base->string_header_pool->name = "string_header";
+    mem_pools->string_header_pool       = new_string_pool(interp, 0);
+    mem_pools->string_header_pool->name = "string_header";
 
     /* Init the PMC header pool */
-    arena_base->pmc_pool                 = new_pmc_pool(interp);
-    arena_base->pmc_pool->name           = "pmc";
-
-    /* pmc extension buffer */
-    arena_base->pmc_ext_pool             =
-        new_small_object_pool(sizeof (PMC_EXT), 1024);
-
-#if PARROT_GC_MS
-    /*
-     * pmc_ext isn't a managed item. If a PMC has a pmc_ext structure
-     * it is returned to the pool instantly - the structure is never
-     * marked.
-     * Use GS MS pool functions
-     */
-    gc_ms_pmc_ext_pool_init(arena_base->pmc_ext_pool);
-#elif PARROT_GC_INF
-    arena_base->init_pool(interp, arena_base->pmc_ext_pool);
-#else
-    /* rational, consistant behavior (as yet unwritten) */
-#endif
-
-    arena_base->pmc_ext_pool->name = "pmc_ext";
+    mem_pools->pmc_pool                 = new_pmc_pool(interp);
+    mem_pools->pmc_pool->name           = "pmc";
 
     /* constant PMCs */
-    arena_base->constant_pmc_pool                    = new_pmc_pool(interp);
-    arena_base->constant_pmc_pool->name              = "constant_pmc";
-    arena_base->constant_pmc_pool->objects_per_alloc =
+    mem_pools->constant_pmc_pool                    = new_pmc_pool(interp);
+    mem_pools->constant_pmc_pool->name              = "constant_pmc";
+    mem_pools->constant_pmc_pool->objects_per_alloc =
         CONSTANT_PMC_HEADERS_PER_ALLOC;
 }
 
@@ -1129,7 +868,7 @@
 
 =item pool_iter_fn
 
-Called with C<(Parrot_Interp, Small_Object_Pool *, int flag, void *arg)>.  If
+Called with C<(Parrot_Interp, Fixed_Size_Pool *, int flag, void *arg)>.  If
 the function returns a non-zero value, iteration will stop.
 
 =back
@@ -1144,12 +883,12 @@
         NOTNULL(pool_iter_fn func))
 {
     ASSERT_ARGS(header_pools_iterate_callback)
-    Arenas * const arena_base = interp->arena_base;
+    Memory_Pools * const mem_pools = interp->mem_pools;
 
     if (flag & POOL_PMC) {
-        Small_Object_Pool *pool = flag & POOL_CONST
-            ? arena_base->constant_pmc_pool
-            : arena_base->pmc_pool;
+        Fixed_Size_Pool *pool = flag & POOL_CONST
+            ? mem_pools->constant_pmc_pool
+            : mem_pools->pmc_pool;
 
         const int ret_val = (func)(interp, pool,
             flag & (POOL_PMC | POOL_CONST) , arg);
@@ -1163,15 +902,15 @@
 
         if (flag & POOL_CONST) {
             const int ret_val = (func)(interp,
-                arena_base->constant_string_header_pool,
+                mem_pools->constant_string_header_pool,
                 POOL_BUFFER | POOL_CONST, arg);
 
             if (ret_val)
                 return ret_val;
         }
 
-        for (i = interp->arena_base->num_sized - 1; i >= 0; --i) {
-            Small_Object_Pool * const pool = arena_base->sized_header_pools[i];
+        for (i = interp->mem_pools->num_sized - 1; i >= 0; --i) {
+            Fixed_Size_Pool * const pool = mem_pools->sized_header_pools[i];
 
             if (pool) {
                 const int ret_val = (func)(interp, pool, POOL_BUFFER, arg);
@@ -1184,6 +923,186 @@
     return 0;
 }
 
+/*
+
+=over 4
+
+=item C<void * Parrot_gc_get_attributes_from_pool(PARROT_INTERP,
+PMC_Attribute_Pool * pool)>
+
+Get a new fixed-size storage space from the given pool. The pool contains
+information on the size of the item to allocate already.
+
+=item C<static void Parrot_gc_allocate_new_attributes_arena(PARROT_INTERP,
+PMC_Attribute_Pool *pool)>
+
+Allocate a new arena of fixed-sized data structures for the given pool.
+
+=item C<void Parrot_gc_initialize_fixed_size_pools(PARROT_INTERP, size_t
+init_num_pools)>
+
+Initialize the pools (zeroize)
+
+=item C<PMC_Attribute_Pool * Parrot_gc_get_attribute_pool(PARROT_INTERP, size_t
+attrib_size)>
+
+Find a fixed-sized data structure pool given the size of the object to
+allocate. If the pool does not exist, create it.
+
+=item C<static PMC_Attribute_Pool * Parrot_gc_create_attrib_pool(PARROT_INTERP,
+size_t attrib_idx)>
+
+Create a new pool for fixed-sized data items with the given C<attrib_size>.
+
+=back
+
+=cut
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+void *
+Parrot_gc_get_attributes_from_pool(PARROT_INTERP, ARGMOD(PMC_Attribute_Pool * pool))
+{
+    ASSERT_ARGS(Parrot_gc_get_attributes_from_pool)
+    PMC_Attribute_Free_List *item;
+
+#if GC_USE_LAZY_ALLOCATOR
+    if (pool->free_list) {
+        item            = pool->free_list;
+        pool->free_list = item->next;
+    }
+    else if (pool->newfree) {
+        item          = pool->newfree;
+        pool->newfree = (PMC_Attribute_Free_List *)
+                        ((char *)(pool->newfree) + pool->attr_size);
+        if (pool->newfree >= pool->newlast)
+            pool->newfree = NULL;
+    }
+    else {
+        Parrot_gc_allocate_new_attributes_arena(interp, pool);
+        return Parrot_gc_get_attributes_from_pool(interp, pool);
+    }
+#else
+    if (pool->free_list == NULL)
+        Parrot_gc_allocate_new_attributes_arena(interp, pool);
+    item            = pool->free_list;
+    pool->free_list = item->next;
+#endif
+
+    pool->num_free_objects--;
+    return (void *)item;
+}
+
+
+static void
+Parrot_gc_allocate_new_attributes_arena(PARROT_INTERP, ARGMOD(PMC_Attribute_Pool *pool))
+{
+    ASSERT_ARGS(Parrot_gc_allocate_new_attributes_arena)
+    PMC_Attribute_Free_List *list, *next, *first;
+
+    size_t       i;
+    const size_t num_items  = pool->objects_per_alloc;
+    const size_t item_size  = pool->attr_size;
+    const size_t item_space = item_size * num_items;
+    const size_t total_size = sizeof (PMC_Attribute_Arena) + item_space;
+
+    PMC_Attribute_Arena * const new_arena = (PMC_Attribute_Arena *)mem_internal_allocate(
+        total_size);
+
+    new_arena->prev = NULL;
+    new_arena->next = pool->top_arena;
+    pool->top_arena = new_arena;
+    next            = (PMC_Attribute_Free_List *)(new_arena + 1);
+
+#if GC_USE_LAZY_ALLOCATOR
+    pool->newfree   = next;
+    pool->newlast   = (PMC_Attribute_Free_List *)((char *)next + item_space);
+#else
+    pool->free_list = next;
+    for (i = 0; i < num_items; i++) {
+        list        = next;
+        list->next  = (PMC_Attribute_Free_List *)((char *)list + item_size);
+        next        = list->next;
+    }
+    list->next      = pool->free_list;
+#endif
+
+    pool->num_free_objects += num_items;
+    pool->total_objects    += num_items;
+}
+
+void
+Parrot_gc_initialize_fixed_size_pools(PARROT_INTERP, size_t init_num_pools)
+{
+    ASSERT_ARGS(Parrot_gc_initialize_fixed_size_pools)
+    Memory_Pools       * const mem_pools = interp->mem_pools;
+    PMC_Attribute_Pool **pools;
+    const size_t total_size = (init_num_pools + 1) * sizeof (void *);
+
+    pools = (PMC_Attribute_Pool **)mem_internal_allocate(total_size);
+    memset(pools, 0, total_size);
+
+    mem_pools->attrib_pools = pools;
+    mem_pools->num_attribs = init_num_pools;
+}
+
+
+PARROT_CANNOT_RETURN_NULL
+PMC_Attribute_Pool *
+Parrot_gc_get_attribute_pool(PARROT_INTERP, size_t attrib_size)
+{
+    ASSERT_ARGS(Parrot_gc_get_attribute_pool)
+
+    Memory_Pools       * const mem_pools = interp->mem_pools;
+    PMC_Attribute_Pool **pools = mem_pools->attrib_pools;
+    const size_t         idx   = (attrib_size < sizeof (void *))
+                               ? 0
+                               : attrib_size - sizeof (void *);
+
+    if (mem_pools->num_attribs <= idx) {
+        const size_t total_length = idx + GC_ATTRIB_POOLS_HEADROOM;
+        const size_t total_size   = total_length * sizeof (void *);
+        const size_t current_size = mem_pools->num_attribs;
+        const size_t diff         = total_length - current_size;
+
+        pools = (PMC_Attribute_Pool **)mem_internal_realloc(pools, total_size);
+        memset(pools + current_size, 0, diff * sizeof (void *));
+        mem_pools->attrib_pools = pools;
+        mem_pools->num_attribs = total_length;
+    }
+
+    if (!pools[idx]) {
+        PMC_Attribute_Pool * const pool = Parrot_gc_create_attrib_pool(interp, idx);
+        /* Create the first arena now, so we don't have to check for it later */
+        Parrot_gc_allocate_new_attributes_arena(interp, pool);
+        pools[idx] = pool;
+    }
+
+    return pools[idx];
+}
+
+PARROT_CANNOT_RETURN_NULL
+static PMC_Attribute_Pool *
+Parrot_gc_create_attrib_pool(PARROT_INTERP, size_t attrib_idx)
+{
+    ASSERT_ARGS(Parrot_gc_create_attrib_pool)
+    const size_t attrib_size = attrib_idx + sizeof (void *);
+    const size_t num_objs_raw =
+        (GC_FIXED_SIZE_POOL_SIZE - sizeof (PMC_Attribute_Arena)) / attrib_size;
+    const size_t num_objs = (num_objs_raw == 0)?(1):(num_objs_raw);
+    PMC_Attribute_Pool * const newpool = mem_internal_allocate_typed(PMC_Attribute_Pool);
+
+    newpool->attr_size         = attrib_size;
+    newpool->total_objects     = 0;
+    newpool->objects_per_alloc = num_objs;
+    newpool->num_free_objects  = 0;
+    newpool->free_list         = NULL;
+    newpool->top_arena         = NULL;
+
+    return newpool;
+}
+
 
 /*
 

Deleted: branches/orderedhash_revamp/src/gc/res_lea.c
==============================================================================
--- branches/orderedhash_revamp/src/gc/res_lea.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,305 +0,0 @@
-/*
-Copyright (C) 2001-2008, Parrot Foundation.
-$Id$
-
-=head1 NAME
-
-src/gc/res_lea.c - Resource allocation using malloc
-
-=head1 DESCRIPTION
-
-This file provides alternative implementations of memory allocation
-function found in F<src/resources.c>. It is used if F<Configure.pl> is
-passed the C<--gc=malloc> or C<--gc=malloc-trace> options.
-
-The "lea" in the file name refers to Doug Lea, who wrote malloc
-implementation found in F<src/malloc.c>.
-
-As of May 14, 2007, it doesn't work (and hasn't worked for some
-time.)  The problem appears to be related to strings, but actually
-could be somewhere else.  This allocator does not support any of
-Parrot's Copy-on-Write schemes.  Nor does the string allocator
-handle "external" strings.
-
-=head2 Functions
-
-=over 4
-
-=cut
-
-*/
-
-#include "parrot/parrot.h"
-
-/*
-
-=item C<void Parrot_gc_compact_memory_pool(PARROT_INTERP)>
-
-Does nothing other than increment the interpreter's C<gc_collect_runs>
-count.
-
-=cut
-
-*/
-
-void
-Parrot_gc_compact_memory_pool(PARROT_INTERP)
-{
-    ASSERT_ARGS(parrot_go_collect)
-    if (interp->arena_base->gc_sweep_block_level) {
-        return;
-    }
-    interp->arena_base->gc_collect_runs++;        /* fake it */
-}
-
-/*
-
-=item C<static PARROT_INLINE void* xmalloc(size_t size)>
-
-Obtains the memory from C<malloc()> and returns it. Panics if there is
-no memory available.
-
-=cut
-
-*/
-
-static PARROT_INLINE void*
-xmalloc(size_t size)
-{
-    ASSERT_ARGS(xmalloc)
-    void *p = malloc(size);
-    if (!p)
-        do_panic(NULL, "malloc: out of mem", __FILE__, __LINE__);
-    return p;
-}
-
-/*
-
-=item C<static PARROT_INLINE void* xcalloc(size_t n, size_t size)>
-
-Obtains the memory from C<calloc()> and returns it. Panics if there is
-no memory available.
-
-=cut
-
-*/
-
-static PARROT_INLINE void*
-xcalloc(size_t n, size_t size)
-{
-    ASSERT_ARGS(xcalloc)
-    void * const p = calloc(n, size);
-    if (!p)
-        do_panic(NULL, "calloc: out of mem", __FILE__, __LINE__);
-    return p;
-}
-
-/*
-
-=item C<static PARROT_INLINE void* xrealloc(void *p, size_t size)>
-
-Reallocates the memory with C<realloc()> and returns it. Panics if there
-is no memory available.
-
-=cut
-
-*/
-
-static PARROT_INLINE void*
-xrealloc(void *p, size_t size)
-{
-    ASSERT_ARGS(xrealloc)
-    void * const n = realloc(p, size);
-    if (!n)
-        do_panic(NULL, "realloc: out of mem", __FILE__, __LINE__);
-    return n;
-}
-
-/*
-
-=item C<void Parrot_gc_reallocate_buffer_storage(PARROT_INTERP, Buffer *buffer, size_t newsize)>
-
-COWable objects (strings or Buffers) use an INTVAL before C<bufstart> for
-refcounting in GC.
-
-=cut
-
-*/
-
-void
-Parrot_gc_reallocate_buffer_storage(PARROT_INTERP, Buffer *buffer, size_t newsize)
-{
-    ASSERT_ARGS(parrot_reallocate)
-    const size_t oldlen = PObj_buflen(buffer);
-    Buffer_alloc_unit *p;
-
-    if (!PObj_bufstart(buffer)) {
-        Parrot_gc_allocate_buffer_storage_aligned(interp, buffer, newsize);
-        /* The previous version zeroed the memory here, but I'm not
-           sure why. */
-        memset(PObj_bufstart(buffer), 0, newsize);
-    }
-    else {
-        if (!newsize) {    /* realloc(3) does free, if newsize == 0 here */
-            return;    /* do nothing */
-        }
-        p = (Buffer_alloc_unit *) xrealloc(PObj_bufallocstart(buffer),
-                                           Buffer_alloc_offset + newsize);
-        if (newsize > oldlen)
-            memset((char *)p->buffer + oldlen, 0, newsize - oldlen);
-        PObj_bufstart(buffer) = p->buffer;
-        PObj_buflen(buffer) = newsize;
-    }
-}
-
-
-/*
-
-=item C<void Parrot_gc_allocate_buffer_storage_aligned(PARROT_INTERP,
-Buffer *buffer, size_t size)>
-
-Allocate buffer memory for the given Buffer pointer. The C<size>
-has to be a multiple of the word size.
-C<PObj_buflen> will be set to exactly the given C<size>.
-See the comments and diagram in resources.c.
-
-This was never called anyway, so it isn't implemented here.
-
-=item C<void Parrot_gc_allocate_buffer_storage_aligned(PARROT_INTERP, Buffer *buffer,
-size_t size)>
-
-Like above, except the address of the buffer is guaranteed to be
-suitably aligned for holding anything contained in UnionVal
-(such as FLOATVAL).
-
-=cut
-
-*/
-
-void
-Parrot_gc_allocate_buffer_storage_aligned(PARROT_INTERP, Buffer *buffer, size_t size)
-{
-    ASSERT_ARGS(parrot_allocate_aligned)
-    Buffer_alloc_unit *p;
-    p = (Buffer_alloc_unit *) xmalloc(Buffer_alloc_offset + size);
-    p->ref_count = 0;
-    PObj_bufstart(buffer) = p->buffer;
-    PObj_buflen(buffer) = size;
-}
-
-/*
-
-=item C<void Parrot_gc_reallocate_string_storage(PARROT_INTERP, STRING *str, size_t newsize)>
-
-Reallocates the string buffer in C<*str> and returns it. C<newsize> is the
-number of bytes memory required.
-
-=cut
-
-*/
-
-void
-Parrot_gc_reallocate_string_storage(PARROT_INTERP, STRING *str, size_t newsize)
-{
-    ASSERT_ARGS(parrot_reallocate_string)
-    Buffer_alloc_unit *p;
-
-    if (!PObj_bufstart(str)) {
-        Parrot_gc_allocate_string_storage(interp, str, newsize);
-    }
-    else if (newsize) {
-        p = (Buffer_alloc_unit *) xrealloc(PObj_bufallocstart(str),
-                                           Buffer_alloc_offset + newsize);
-        PObj_bufstart(str) = str->strstart = (char *) p->buffer;
-        PObj_buflen(str) = newsize;
-    }
-}
-
-/*
-
-=item C<void Parrot_gc_allocate_string_storage(PARROT_INTERP, STRING *str, size_t size)>
-
-Allocates the string buffer in C<*str> and returns it. C<size> is the
-number bytes of memory required.
-
-=cut
-
-*/
-
-void
-Parrot_gc_allocate_string_storage(PARROT_INTERP, STRING *str, size_t size)
-{
-    ASSERT_ARGS(Parrot_gc_allocate_string_storage)
-    Buffer_alloc_unit *p;
-    p = (Buffer_alloc_unit *) xcalloc(Buffer_alloc_offset + size, 1);
-    p->ref_count = 0;
-    PObj_bufstart(str) = str->strstart = (char *) p->buffer;
-    PObj_buflen(str) = size;
-}
-
-/*
-
-=item C<void initialize_memory_pools(PARROT_INTERP)>
-
-Does nothing.
-
-=cut
-
-*/
-
-void
-initialize_memory_pools(PARROT_INTERP)
-{
-    ASSERT_ARGS(parrot_initialize_memory_pools)
-}
-
-/*
-
-=item C<void Parrot_gc_merge_memory_pools(Interp *dest, Interp *source)>
-
-Does nothing.
-
-=cut
-
-*/
-void
-Parrot_gc_merge_memory_pools(Interp *dest, Interp *source)
-{
-    ASSERT_ARGS(parrot_merge_memory_pools)
-}
-
-/*
-
-=item C<void Parrot_gc_destroy_memory_pools(PARROT_INTERP)>
-
-Does nothing.
-
-=cut
-
-*/
-
-void
-Parrot_gc_destroy_memory_pools(PARROT_INTERP)
-{
-    ASSERT_ARGS(parrot_destroy_memory_pools)
-}
-
-/*
-
-=back
-
-=head1 SEE ALSO
-
-F<config/auto/gc.pl>, F<src/malloc.c>
-
-=cut
-
-*/
-
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Modified: branches/orderedhash_revamp/src/gc/system.c
==============================================================================
--- branches/orderedhash_revamp/src/gc/system.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/gc/system.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -72,26 +72,26 @@
 static void trace_system_stack(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_find_common_mask __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_get_max_buffer_address __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_get_max_pmc_address __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_get_min_buffer_address __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_get_min_pmc_address __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_is_buffer_ptr __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_find_common_mask __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_get_max_buffer_address __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_get_max_pmc_address __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_get_min_buffer_address __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_get_min_pmc_address __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_is_buffer_ptr __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ptr)
-#define ASSERT_ARGS_is_pmc_ptr __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(ptr))
+#define ASSERT_ARGS_is_pmc_ptr __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ptr)
-#define ASSERT_ARGS_trace_mem_block __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_trace_system_stack __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+    , PARROT_ASSERT_ARG(ptr))
+#define ASSERT_ARGS_trace_mem_block __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_trace_system_stack __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: static */
 
@@ -172,6 +172,12 @@
         struct ucontext ucp;
         void *current_regstore_top;
 
+        /* Trace the memory block for the register backing stack, which
+           is separate from the normal system stack. The register backing
+           stack starts at memory address 0x80000FFF80000000 and ends at
+           current_regstore_top. */
+        size_t base = 0x80000fff80000000;
+
         getcontext(&ucp);
 
         /* flush_reg_store() is defined in config/gen/platforms/ia64/asm.s.
@@ -179,12 +185,6 @@
            returns the address of the register backing stack. */
         current_regstore_top = flush_reg_store();
 
-        /* Trace the memory block for the register backing stack, which
-           is separate from the normal system stack. The register backing
-           stack starts at memory address 0x80000FFF80000000 and ends at
-           current_regstore_top. */
-        size_t base = 0x80000fff80000000;
-
 #  endif /* __hpux */
 
         trace_mem_block(interp, base,
@@ -238,6 +238,7 @@
        the "bottom" of the stack. We must trace the entire area between the
        top and bottom. */
     const size_t lo_var_ptr = (size_t)interp->lo_var_ptr;
+    PARROT_ASSERT(lo_var_ptr);
 
     trace_mem_block(interp, (size_t)lo_var_ptr,
             (size_t)&lo_var_ptr);
@@ -262,14 +263,14 @@
 get_max_buffer_address(PARROT_INTERP)
 {
     ASSERT_ARGS(get_max_buffer_address)
-    Arenas * const arena_base = interp->arena_base;
+    Memory_Pools * const mem_pools = interp->mem_pools;
     size_t         max        = 0;
     UINTVAL        i;
 
-    for (i = 0; i < arena_base->num_sized; i++) {
-        if (arena_base->sized_header_pools[i]) {
-            if (arena_base->sized_header_pools[i]->end_arena_memory > max)
-                max = arena_base->sized_header_pools[i]->end_arena_memory;
+    for (i = 0; i < mem_pools->num_sized; i++) {
+        if (mem_pools->sized_header_pools[i]) {
+            if (mem_pools->sized_header_pools[i]->end_arena_memory > max)
+                max = mem_pools->sized_header_pools[i]->end_arena_memory;
         }
     }
 
@@ -297,15 +298,15 @@
 get_min_buffer_address(PARROT_INTERP)
 {
     ASSERT_ARGS(get_min_buffer_address)
-    Arenas * const arena_base = interp->arena_base;
+    Memory_Pools * const mem_pools = interp->mem_pools;
     size_t         min        = (size_t) -1;
     UINTVAL        i;
 
-    for (i = 0; i < arena_base->num_sized; i++) {
-        if (arena_base->sized_header_pools[i]
-        &&  arena_base->sized_header_pools[i]->start_arena_memory) {
-            if (arena_base->sized_header_pools[i]->start_arena_memory < min)
-                min = arena_base->sized_header_pools[i]->start_arena_memory;
+    for (i = 0; i < mem_pools->num_sized; i++) {
+        if (mem_pools->sized_header_pools[i]
+        &&  mem_pools->sized_header_pools[i]->start_arena_memory) {
+            if (mem_pools->sized_header_pools[i]->start_arena_memory < min)
+                min = mem_pools->sized_header_pools[i]->start_arena_memory;
         }
     }
 
@@ -328,7 +329,7 @@
 get_max_pmc_address(PARROT_INTERP)
 {
     ASSERT_ARGS(get_max_pmc_address)
-    return interp->arena_base->pmc_pool->end_arena_memory;
+    return interp->mem_pools->pmc_pool->end_arena_memory;
 }
 
 
@@ -349,7 +350,7 @@
 get_min_pmc_address(PARROT_INTERP)
 {
     ASSERT_ARGS(get_min_pmc_address)
-    return interp->arena_base->pmc_pool->start_arena_memory;
+    return interp->mem_pools->pmc_pool->start_arena_memory;
 }
 
 
@@ -450,9 +451,6 @@
              * free headers... */
             if (pmc_min <= ptr && ptr < pmc_max &&
                     is_pmc_ptr(interp, (void *)ptr)) {
-                /* ...so ensure that Parrot_gc_mark_PObj_alive checks PObj_on_free_list_FLAG
-                 * before adding it to the next_for_GC list, to have
-                 * vtable->mark() called. */
                 Parrot_gc_mark_PObj_alive(interp, (PObj *)ptr);
             }
             else if (buffer_min <= ptr && ptr < buffer_max &&
@@ -483,12 +481,12 @@
 is_buffer_ptr(PARROT_INTERP, ARGIN(const void *ptr))
 {
     ASSERT_ARGS(is_buffer_ptr)
-    Arenas * const arena_base = interp->arena_base;
+    Memory_Pools * const mem_pools = interp->mem_pools;
     UINTVAL        i;
 
-    for (i = 0; i < arena_base->num_sized; i++) {
-        if (arena_base->sized_header_pools[i]
-        &&  contained_in_pool(arena_base->sized_header_pools[i], ptr))
+    for (i = 0; i < mem_pools->num_sized; i++) {
+        if (mem_pools->sized_header_pools[i]
+            &&  contained_in_pool(interp, mem_pools->sized_header_pools[i], ptr))
             return 1;
     }
 
@@ -511,7 +509,7 @@
 is_pmc_ptr(PARROT_INTERP, ARGIN(const void *ptr))
 {
     ASSERT_ARGS(is_pmc_ptr)
-    return contained_in_pool(interp->arena_base->pmc_pool, ptr);
+        return contained_in_pool(interp, interp->mem_pools->pmc_pool, ptr);
 }
 
 

Modified: branches/orderedhash_revamp/src/global.c
==============================================================================
--- branches/orderedhash_revamp/src/global.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/global.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -4,11 +4,13 @@
 
 =head1 NAME
 
-src/global.c - Access to global PMCs
+src/global.c
 
 =head1 DESCRIPTION
 
-=head2 Functions
+Access to global PMCs
+
+=head1 FUNCTIONS
 
 =over 4
 
@@ -19,6 +21,7 @@
 #include "parrot/parrot.h"
 #include "global.str"
 #include "pmc/pmc_sub.h"
+#include "pmc/pmc_callcontext.h"
 
 /* HEADERIZER HFILE: include/parrot/global.h */
 /* HEADERIZER BEGIN: static */
@@ -77,29 +80,29 @@
         __attribute__nonnull__(2)
         __attribute__nonnull__(3);
 
-#define ASSERT_ARGS_get_namespace_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_get_namespace_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub_pmc)
-#define ASSERT_ARGS_internal_ns_keyed __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(sub_pmc))
+#define ASSERT_ARGS_internal_ns_keyed __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(base_ns) \
-    || PARROT_ASSERT_ARG(pmc_key)
-#define ASSERT_ARGS_internal_ns_keyed_key __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(base_ns) \
+    , PARROT_ASSERT_ARG(pmc_key))
+#define ASSERT_ARGS_internal_ns_keyed_key __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ns) \
-    || PARROT_ASSERT_ARG(key)
-#define ASSERT_ARGS_internal_ns_keyed_str __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(ns) \
+    , PARROT_ASSERT_ARG(key))
+#define ASSERT_ARGS_internal_ns_keyed_str __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(base_ns) \
-    || PARROT_ASSERT_ARG(key)
-#define ASSERT_ARGS_internal_ns_maybe_create __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(base_ns) \
+    , PARROT_ASSERT_ARG(key))
+#define ASSERT_ARGS_internal_ns_maybe_create __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ns) \
-    || PARROT_ASSERT_ARG(key)
-#define ASSERT_ARGS_store_sub_in_multi __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(ns) \
+    , PARROT_ASSERT_ARG(key))
+#define ASSERT_ARGS_store_sub_in_multi __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub_pmc) \
-    || PARROT_ASSERT_ARG(ns)
+    , PARROT_ASSERT_ARG(sub_pmc) \
+    , PARROT_ASSERT_ARG(ns))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -205,20 +208,15 @@
         PMC *ns = base_ns;
 
         for (i = 0; i < n; ++i) {
-            if (!pmc_key)
-                Parrot_ex_throw_from_c_args(interp, NULL, 1,
-                    "Passed a NULL pmc_key into VTABLE_get_string_keyed_int");
-            else {
-                STRING * const part = VTABLE_get_string_keyed_int(interp, pmc_key, i);
-                PMC *sub_ns = VTABLE_get_pmc_keyed_str(interp, ns, part);
-
-                if (PMC_IS_NULL(sub_ns) || !VTABLE_isa(interp, sub_ns, isans)) {
-                    sub_ns = internal_ns_maybe_create(interp, ns, part, flags);
-                    if (PMC_IS_NULL(sub_ns))
-                        return PMCNULL;
-                }
-                ns = sub_ns;
+            STRING * const part = VTABLE_get_string_keyed_int(interp, pmc_key, i);
+            PMC *sub_ns = VTABLE_get_pmc_keyed_str(interp, ns, part);
+
+            if (PMC_IS_NULL(sub_ns) || !VTABLE_isa(interp, sub_ns, isans)) {
+                sub_ns = internal_ns_maybe_create(interp, ns, part, flags);
+                if (PMC_IS_NULL(sub_ns))
+                    return PMCNULL;
             }
+            ns = sub_ns;
         }
         return ns;
     }
@@ -246,11 +244,11 @@
     ASSERT_ARGS(internal_ns_maybe_create)
     PMC *sub_ns;
 
-    /* RT #46157 - stop depending on typed namespace */
+    /* TT #1220 - stop depending on typed namespace */
     if (!(flags & INTERN_NS_CREAT))
         return PMCNULL;
 
-    /* RT #46159 - match HLL of enclosing namespace? */
+    /* TT #1221 - match HLL of enclosing namespace? */
     sub_ns = pmc_new(interp, Parrot_get_ctx_HLL_type(interp,
                                                  enum_class_NameSpace));
 
@@ -280,7 +278,7 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
 PMC *
-Parrot_get_namespace_keyed(PARROT_INTERP, ARGIN(PMC *base_ns), ARGIN_NULLOK(PMC *pmc_key))
+Parrot_get_namespace_keyed(PARROT_INTERP, ARGIN(PMC *base_ns), ARGIN(PMC *pmc_key))
 {
     ASSERT_ARGS(Parrot_get_namespace_keyed)
     return internal_ns_keyed(interp, base_ns, pmc_key, 0);
@@ -327,7 +325,7 @@
 PARROT_CAN_RETURN_NULL
 PMC *
 Parrot_make_namespace_keyed(PARROT_INTERP, ARGIN(PMC *base_ns),
-        ARGIN_NULLOK(PMC *pmc_key))
+        ARGIN(PMC *pmc_key))
 {
     ASSERT_ARGS(Parrot_make_namespace_keyed)
     return internal_ns_keyed(interp, base_ns, pmc_key, INTERN_NS_CREAT);
@@ -380,44 +378,15 @@
     ASSERT_ARGS(Parrot_make_namespace_autobase)
     PMC *base_ns;
     if (VTABLE_isa(interp, key, CONST_STRING(interp, "String")))
-        base_ns = CONTEXT(interp)->current_namespace;
+        base_ns = Parrot_pcc_get_namespace(interp, CURRENT_CONTEXT(interp));
     else
         base_ns = VTABLE_get_pmc_keyed_int(interp, interp->HLL_namespace,
-            CONTEXT(interp)->current_HLL);
+            Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp)));
     return Parrot_make_namespace_keyed(interp, base_ns, key);
 }
 
 /*
 
-=item C<PMC * Parrot_get_namespace_autobase(PARROT_INTERP, PMC *key)>
-
-Find a namespace with the key C<key>, which may be a String, a Key, or an
-array of strings. If it is a String, then the lookup is relative to the
-current namespace. Otherwise, it is relative to the current HLL root
-namespace. Return the namespace, or NULL if not found.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-PMC *
-Parrot_get_namespace_autobase(PARROT_INTERP, ARGIN_NULLOK(PMC *key))
-{
-    ASSERT_ARGS(Parrot_get_namespace_autobase)
-    PMC *base_ns;
-    if (VTABLE_isa(interp, key, CONST_STRING(interp, "String")))
-        base_ns = CONTEXT(interp)->current_namespace;
-    else
-        base_ns = VTABLE_get_pmc_keyed_int(interp, interp->HLL_namespace,
-            CONTEXT(interp)->current_HLL);
-    return Parrot_get_namespace_keyed(interp, base_ns, key);
-}
-
-/*
-
 =item C<PMC * Parrot_ns_get_name(PARROT_INTERP, PMC *_namespace)>
 
 Retrieve an array of names from a namespace object.
@@ -434,7 +403,7 @@
 {
     ASSERT_ARGS(Parrot_ns_get_name)
     PMC *names;
-    Parrot_PCCINVOKE(interp, _namespace, CONST_STRING(interp, "get_name"), "->P", &names);
+    Parrot_pcc_invoke_method_from_c_args(interp, _namespace, CONST_STRING(interp, "get_name"), "->P", &names);
     return names;
 }
 
@@ -511,7 +480,7 @@
 Search the namespace PMC C<ns> for an object with name C<globalname>.
 Return the object, or NULL if not found.
 
-RT #46161 - For now this function prefers non-namespaces, it will eventually
+TT #1222 - For now this function prefers non-namespaces, it will eventually
 entirely use the untyped interface.
 
 =cut
@@ -536,7 +505,7 @@
         res = PMCNULL;
     else {
         /*
-         * RT #46163 - we should be able to use 'get_pmc_keyed' here,
+         * TT #1219 - we should be able to use 'get_pmc_keyed' here,
          * but we can't because Parrot's default namespaces are not
          * fully typed and there's a pseudo-typed interface that
          * distinguishes 'get_pmc_keyed' from 'get_pointer_keyed';
@@ -565,37 +534,7 @@
 Parrot_find_global_cur(PARROT_INTERP, ARGIN_NULLOK(STRING *globalname))
 {
     ASSERT_ARGS(Parrot_find_global_cur)
-    PMC * const ns = CONTEXT(interp)->current_namespace;
-    return Parrot_find_global_n(interp, ns, globalname);
-}
-
-/*
-
-=item C<PMC * Parrot_find_global_k(PARROT_INTERP, PMC *pmc_key, STRING
-*globalname)>
-
-Search the namespace designated by C<pmc_key>, which may be a key PMC,
-an array of namespace name strings, or a string PMC, for an object
-with name C<globalname>.  Return the object, or NULL if not found.
-
-RT #46161 - For now this function prefers non-namespaces, it will eventually
-entirely use the untyped interface.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-PMC *
-Parrot_find_global_k(PARROT_INTERP, ARGIN_NULLOK(PMC *pmc_key), ARGIN(STRING *globalname))
-{
-    ASSERT_ARGS(Parrot_find_global_k)
-    PMC * const ns =
-        Parrot_get_namespace_keyed(interp,
-                                   Parrot_get_ctx_HLL_namespace(interp),
-                                   pmc_key);
+    PMC * const ns = Parrot_pcc_get_namespace(interp, CURRENT_CONTEXT(interp));
     return Parrot_find_global_n(interp, ns, globalname);
 }
 
@@ -608,7 +547,7 @@
 C<str_key> is NULL, for an object with name C<globalname>.  Return the
 object, or NULL if not found.
 
-RT #46161 - For now this function prefers non-namespaces, it will eventually
+TT #1222 - For now this function prefers non-namespaces, it will eventually
 entirely use the untyped interface.
 
 =cut
@@ -682,7 +621,7 @@
 
     Parrot_store_global_n(interp, ns, globalname, val);
 
-    /* RT #46169 - method cache invalidation should be a namespace function */
+    /* TT #1225 - method cache invalidation should be a namespace function */
     Parrot_invalidate_method_cache(interp, str_key);
 }
 
@@ -725,7 +664,7 @@
 
 =item C<PMC * Parrot_find_name_op(PARROT_INTERP, STRING *name, void *next)>
 
-RT #46171 - THIS IS BROKEN - it doesn't walk up the scopes yet
+TT #1223 - THIS IS BROKEN - it doesn't walk up the scopes yet
 
 Find the given C<name> in lexicals, then the current namespace, then the HLL
 root namespace, and finally Parrot builtins.  If the name isn't found
@@ -742,7 +681,7 @@
 Parrot_find_name_op(PARROT_INTERP, ARGIN(STRING *name), SHIM(void *next))
 {
     ASSERT_ARGS(Parrot_find_name_op)
-    Parrot_Context * const ctx = CONTEXT(interp);
+    PMC * const ctx     = CURRENT_CONTEXT(interp);
     PMC * const lex_pad = Parrot_find_pad(interp, name, ctx);
     PMC *g;
 
@@ -751,7 +690,7 @@
     else
         g = VTABLE_get_pmc_keyed_str(interp, lex_pad, name);
 
-    /* RT #46171 - walk up the scopes!  duh!! */
+    /* TT #1223 - walk up the scopes!  duh!! */
 
     if (PMC_IS_NULL(g))
         g = Parrot_find_global_cur(interp, name);
@@ -782,7 +721,7 @@
 get_namespace_pmc(PARROT_INTERP, ARGIN(PMC *sub_pmc))
 {
     ASSERT_ARGS(get_namespace_pmc)
-    Parrot_sub *sub;
+    Parrot_Sub_attributes *sub;
     PMC        *nsname, *nsroot;
 
     PMC_get_sub(interp, sub_pmc, sub);
@@ -816,7 +755,7 @@
 store_sub_in_multi(PARROT_INTERP, ARGIN(PMC *sub_pmc), ARGIN(PMC *ns))
 {
     ASSERT_ARGS(store_sub_in_multi)
-    Parrot_sub *sub;
+    Parrot_Sub_attributes *sub;
     STRING     *ns_entry_name;
     PMC        *multisub;
 
@@ -852,17 +791,17 @@
 Parrot_store_sub_in_namespace(PARROT_INTERP, ARGIN(PMC *sub_pmc))
 {
     ASSERT_ARGS(Parrot_store_sub_in_namespace)
-    const INTVAL cur_id = CONTEXT(interp)->current_HLL;
+    const INTVAL cur_id = Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp));
 
     PMC        *ns;
-    Parrot_sub *sub;
+    Parrot_Sub_attributes *sub;
 
     /* PF structures aren't fully constructed yet */
     Parrot_block_GC_mark(interp);
 
     /* store relative to HLL namespace */
     PMC_get_sub(interp, sub_pmc, sub);
-    CONTEXT(interp)->current_HLL = sub->HLL_id;
+    Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp), sub->HLL_id);
 
     ns = get_namespace_pmc(interp, sub_pmc);
 
@@ -880,7 +819,8 @@
 
         Parrot_store_global_n(interp, ns, ns_entry_name, sub_pmc);
 
-        /* TEMPORARY HACK - cache invalidation should be a namespace function */
+        /* TT #1224:
+           TEMPORARY HACK - cache invalidation should be a namespace function */
         if (!PMC_IS_NULL(nsname)) {
             STRING * const nsname_s = VTABLE_get_string(interp, nsname);
             Parrot_invalidate_method_cache(interp, nsname_s);
@@ -888,7 +828,7 @@
     }
 
     /* restore HLL_id */
-    CONTEXT(interp)->current_HLL = cur_id;
+    Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp), cur_id);
     Parrot_unblock_GC_mark(interp);
 }
 

Modified: branches/orderedhash_revamp/src/global_setup.c
==============================================================================
--- branches/orderedhash_revamp/src/global_setup.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/global_setup.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -27,7 +27,7 @@
 
 /* These functions are defined in the auto-generated file core_pmcs.c */
 /* XXX Get it into some public place */
-extern void Parrot_initialize_core_pmcs(PARROT_INTERP);
+extern void Parrot_initialize_core_pmcs(PARROT_INTERP, int pass);
 void Parrot_register_core_pmcs(PARROT_INTERP, PMC* registry);
 
 static const unsigned char* parrot_config_stored = NULL;
@@ -38,12 +38,17 @@
 /* HEADERIZER BEGIN: static */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
+static void parrot_global_setup_2(PARROT_INTERP)
+        __attribute__nonnull__(1);
+
 static void parrot_set_config_hash_interpreter(PARROT_INTERP)
         __attribute__nonnull__(1);
 
+#define ASSERT_ARGS_parrot_global_setup_2 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
 #define ASSERT_ARGS_parrot_set_config_hash_interpreter \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+     __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: static */
 
@@ -159,10 +164,9 @@
     Parrot_platform_init_code();
 #endif
 
-    parrot_alloc_vtables(interp);
-
     /* Call base vtable class constructor methods */
-    Parrot_initialize_core_pmcs(interp);
+    parrot_global_setup_2(interp);
+    Parrot_initialize_core_pmcs(interp, 1);
 
     iglobals = interp->iglobals;
     VTABLE_set_pmc_keyed_int(interp, iglobals,
@@ -190,7 +194,7 @@
 
 /*
 
-=item C<void parrot_global_setup_2(PARROT_INTERP)>
+=item C<static void parrot_global_setup_2(PARROT_INTERP)>
 
 called from inmidst of PMC bootstrapping between pass 0 and 1
 
@@ -198,19 +202,21 @@
 
 */
 
-void
+static void
 parrot_global_setup_2(PARROT_INTERP)
 {
     ASSERT_ARGS(parrot_global_setup_2)
     PMC *classname_hash, *iglobals;
     int  i;
 
+    create_initial_context(interp);
+
     /* create the namespace root stash */
     interp->root_namespace = pmc_new(interp, enum_class_NameSpace);
     Parrot_init_HLL(interp);
 
-    CONTEXT(interp)->current_namespace =
-        VTABLE_get_pmc_keyed_int(interp, interp->HLL_namespace, 0);
+    Parrot_pcc_set_namespace(interp, CURRENT_CONTEXT(interp),
+        VTABLE_get_pmc_keyed_int(interp, interp->HLL_namespace, 0));
 
     /* We need a class hash */
     interp->class_hash = classname_hash = pmc_new(interp, enum_class_NameSpace);

Modified: branches/orderedhash_revamp/src/hash.c
==============================================================================
--- branches/orderedhash_revamp/src/hash.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/hash.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -84,14 +84,6 @@
     size_t seed)
         __attribute__nonnull__(2);
 
-PARROT_WARN_UNUSED_RESULT
-static size_t key_hash_STRING(PARROT_INTERP,
-    ARGMOD(STRING *s),
-    SHIM(size_t seed))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*s);
-
 static void parrot_mark_hash_both(PARROT_INTERP, ARGIN(Hash *hash))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
@@ -104,53 +96,33 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-PARROT_WARN_UNUSED_RESULT
-PARROT_PURE_FUNCTION
-static int pointer_compare(SHIM_INTERP,
-    ARGIN_NULLOK(const void *a),
-    ARGIN_NULLOK(const void *b));
-
-PARROT_WARN_UNUSED_RESULT
-static int STRING_compare(PARROT_INTERP,
-    ARGIN(const void *search_key),
-    ARGIN_NULLOK(const void *bucket_key))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-#define ASSERT_ARGS_cstring_compare __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_cstring_compare __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(a) \
-    || PARROT_ASSERT_ARG(b)
-#define ASSERT_ARGS_expand_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(hash)
-#define ASSERT_ARGS_hash_freeze __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(hash) \
-    || PARROT_ASSERT_ARG(info)
-#define ASSERT_ARGS_hash_thaw __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(b))
+#define ASSERT_ARGS_expand_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(hash) \
-    || PARROT_ASSERT_ARG(info)
-#define ASSERT_ARGS_key_hash_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(value)
-#define ASSERT_ARGS_key_hash_pointer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(value)
-#define ASSERT_ARGS_key_hash_STRING __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(hash))
+#define ASSERT_ARGS_hash_freeze __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_parrot_mark_hash_both __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(hash) \
+    , PARROT_ASSERT_ARG(info))
+#define ASSERT_ARGS_hash_thaw __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(hash)
-#define ASSERT_ARGS_parrot_mark_hash_keys __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(hash) \
+    , PARROT_ASSERT_ARG(info))
+#define ASSERT_ARGS_key_hash_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(value))
+#define ASSERT_ARGS_key_hash_pointer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(value))
+#define ASSERT_ARGS_parrot_mark_hash_both __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(hash)
-#define ASSERT_ARGS_parrot_mark_hash_values __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(hash))
+#define ASSERT_ARGS_parrot_mark_hash_keys __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(hash)
-#define ASSERT_ARGS_pointer_compare __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_STRING_compare __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(hash))
+#define ASSERT_ARGS_parrot_mark_hash_values __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(search_key)
+    , PARROT_ASSERT_ARG(hash))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -158,7 +130,7 @@
 
 /*
 
-=item C<static size_t key_hash_STRING(PARROT_INTERP, STRING *s, size_t seed)>
+=item C<size_t key_hash_STRING(PARROT_INTERP, STRING *s, size_t seed)>
 
 Returns the hashed value of the key C<value>.  See also string.c.
 
@@ -168,7 +140,7 @@
 
 
 PARROT_WARN_UNUSED_RESULT
-static size_t
+size_t
 key_hash_STRING(PARROT_INTERP, ARGMOD(STRING *s), SHIM(size_t seed))
 {
     ASSERT_ARGS(key_hash_STRING)
@@ -176,14 +148,14 @@
     if (s->hashval)
         return s->hashval;
 
-   return Parrot_str_to_hashval(interp, s);
+    return Parrot_str_to_hashval(interp, s);
 }
 
 
 /*
 
-=item C<static int STRING_compare(PARROT_INTERP, const void *search_key, const
-void *bucket_key)>
+=item C<int STRING_compare(PARROT_INTERP, const void *search_key, const void
+*bucket_key)>
 
 Compares the two strings, returning 0 if they are identical.
 
@@ -192,7 +164,7 @@
 */
 
 PARROT_WARN_UNUSED_RESULT
-static int
+int
 STRING_compare(PARROT_INTERP, ARGIN(const void *search_key), ARGIN_NULLOK(const void *bucket_key))
 {
     ASSERT_ARGS(STRING_compare)
@@ -206,7 +178,7 @@
         return 1;
 
     /* COWed strings */
-    if (s1->strstart == s2->strstart && s1->bufused == s2->bufused)
+    if (Buffer_bufstart(s1) == Buffer_bufstart(s2) && s1->bufused == s2->bufused)
         return 0;
 
     return CHARSET_COMPARE(interp, s1, s2);
@@ -215,7 +187,7 @@
 
 /*
 
-=item C<static int pointer_compare(PARROT_INTERP, const void *a, const void *b)>
+=item C<int pointer_compare(PARROT_INTERP, const void *a, const void *b)>
 
 Compares the two pointers, returning 0 if they are identical
 
@@ -225,7 +197,7 @@
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_PURE_FUNCTION
-static int
+int
 pointer_compare(SHIM_INTERP, ARGIN_NULLOK(const void *a), ARGIN_NULLOK(const void *b))
 {
     ASSERT_ARGS(pointer_compare)
@@ -311,6 +283,54 @@
 
 /*
 
+=item C<size_t key_hash_PMC(PARROT_INTERP, PMC *value, size_t seed)>
+
+Returns a hashed value for an PMC key (passed as a void pointer, sadly).
+
+=cut
+
+*/
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_PURE_FUNCTION
+size_t
+key_hash_PMC(PARROT_INTERP, ARGIN(PMC *value), SHIM(size_t seed))
+{
+    ASSERT_ARGS(key_hash_PMC)
+    return VTABLE_hashvalue(interp, value);
+}
+
+/*
+
+=item C<int PMC_compare(PARROT_INTERP, PMC *a, PMC *b)>
+
+Compares two PMC for equality, returning 0 if the first is equal to second.
+Uses void pointers to store the PMC, sadly.
+
+=cut
+
+*/
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_PURE_FUNCTION
+int
+PMC_compare(PARROT_INTERP, ARGIN(PMC *a), ARGIN_NULLOK(PMC *b))
+{
+    ASSERT_ARGS(PMC_compare)
+
+    /* If pointers are same - PMCs are same */
+    if (a == b)
+        return 0;
+
+    /* PMCs of different types are differ */
+    if (a->vtable->base_type != b->vtable->base_type)
+        return 1;
+
+    return !VTABLE_is_equal(interp, a, b);
+}
+
+/*
+
 =item C<size_t key_hash_int(PARROT_INTERP, const void *value, size_t seed)>
 
 Returns a hashed value for an integer key (passed as a void pointer, sadly).
@@ -535,7 +555,6 @@
 hash_thaw(PARROT_INTERP, ARGMOD(Hash *hash), ARGMOD(visit_info *info))
 {
     ASSERT_ARGS(hash_thaw)
-    IMAGE_IO * const io         = info->image_io;
 
     /* during thaw, info->extra is the key/value count */
     const size_t     num_entries = (size_t) hash->entries;
@@ -547,43 +566,41 @@
         HashBucket *b;
 
         switch (hash->key_type) {
-            case Hash_key_type_STRING:
-                {
-                    STRING * const s_key = VTABLE_shift_string(interp, io);
-                    b = parrot_hash_put(interp, hash, s_key, NULL);
-                }
-                break;
-            case Hash_key_type_int:
-                {
-                    const INTVAL i_key = VTABLE_shift_integer(interp, io);
-                    b = parrot_hash_put(interp, hash, (void*)i_key, NULL);
-                }
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, 1,
+          case Hash_key_type_STRING:
+            {
+                STRING * const s_key = VTABLE_shift_string(interp, info);
+                b = parrot_hash_put(interp, hash, s_key, NULL);
+            }
+            break;
+          case Hash_key_type_int:
+            {
+                const INTVAL i_key = VTABLE_shift_integer(interp, info);
+                b = parrot_hash_put(interp, hash, (void*)i_key, NULL);
+            }
+            break;
+          default:
+            Parrot_ex_throw_from_c_args(interp, NULL, 1,
                     "unimplemented key type");
-                break;
+            break;
         }
 
         switch (hash->entry_type) {
-            case enum_hash_pmc:
-                {
-                    /* this looks awful, but it avoids type-punning warnings */
-                    void **ptr     = &b->value;
-                    info->thaw_ptr = (PMC **)ptr;
-                    (info->visit_pmc_now)(interp, NULL, info);
-                    break;
-                }
-            case enum_hash_int:
-                {
-                    const INTVAL i = VTABLE_shift_integer(interp, io);
-                    b->value       = (void *)i;
-                    break;
-                }
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, 1,
-                    "unimplemented value type");
+          case enum_hash_pmc:
+            {
+                PMC *p   = VTABLE_shift_pmc(interp, info);
+                b->value = (void *)p;
+                break;
+            }
+          case enum_hash_int:
+            {
+                const INTVAL i = VTABLE_shift_integer(interp, info);
+                b->value       = (void *)i;
                 break;
+            }
+          default:
+            Parrot_ex_throw_from_c_args(interp, NULL, 1,
+                    "unimplemented value type");
+            break;
         }
     }
 }
@@ -609,36 +626,35 @@
 hash_freeze(PARROT_INTERP, ARGIN(const Hash * const hash), ARGMOD(visit_info *info))
 {
     ASSERT_ARGS(hash_freeze)
-    IMAGE_IO * const io = info->image_io;
     size_t           i;
 
     for (i = 0; i < hash->entries; i++) {
         HashBucket * const b = hash->bs+i;
 
         switch (hash->key_type) {
-            case Hash_key_type_STRING:
-                VTABLE_push_string(interp, io, (STRING *)b->key);
-                break;
-            case Hash_key_type_int:
-                VTABLE_push_integer(interp, io, (INTVAL)b->key);
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, 1,
+          case Hash_key_type_STRING:
+            VTABLE_push_string(interp, info, (STRING *)b->key);
+            break;
+          case Hash_key_type_int:
+            VTABLE_push_integer(interp, info, (INTVAL)b->key);
+            break;
+          default:
+            Parrot_ex_throw_from_c_args(interp, NULL, 1,
                     "unimplemented key type");
-                break;
+            break;
         }
 
         switch (hash->entry_type) {
-            case enum_hash_pmc:
-                (info->visit_pmc_now)(interp, (PMC *)b->value, info);
-                break;
-            case enum_hash_int:
-                VTABLE_push_integer(interp, io, (INTVAL)b->value);
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, 1,
+          case enum_hash_pmc:
+            VTABLE_push_pmc(interp, info, (PMC *)b->value);
+            break;
+          case enum_hash_int:
+            VTABLE_push_integer(interp, info, (INTVAL)b->value);
+            break;
+          default:
+            Parrot_ex_throw_from_c_args(interp, NULL, 1,
                     "unimplemented value type");
-                break;
+            break;
         }
     }
 }
@@ -663,17 +679,15 @@
     ASSERT_ARGS(parrot_hash_visit)
     visit_info* const info = (visit_info*) pinfo;
 
-    switch (info->what) {
-        case VISIT_THAW_NORMAL:
-        case VISIT_THAW_CONSTANTS:
-            hash_thaw(interp, hash, info);
-            break;
-        case VISIT_FREEZE_NORMAL:
-        case VISIT_FREEZE_AT_DESTRUCT:
-            hash_freeze(interp, hash, info);
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, 1,
+    switch (VTABLE_get_integer(interp, info)) {
+      case VISIT_THAW_NORMAL:
+        hash_thaw(interp, hash, info);
+        break;
+      case VISIT_FREEZE_NORMAL:
+        hash_freeze(interp, hash, info);
+        break;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, 1,
                 "unimplemented visit mode");
     }
 }
@@ -769,7 +783,7 @@
     hash->mask = new_size - 1;
 
     /* clear freshly allocated bucket index */
-    memset(new_bi + old_size, 0, sizeof (HashBucket *) * (new_size - old_size));
+    memset(new_bi + old_size, 0, sizeof (HashBucket *) * old_size);
 
     /*
      * reloc pointers - this part would be also needed, if we
@@ -843,26 +857,6 @@
 
 /*
 
-=item C<void parrot_new_pmc_hash(PARROT_INTERP, PMC *container)>
-
-Creates a new Parrot STRING hash in C<container>.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-parrot_new_pmc_hash(PARROT_INTERP, ARGOUT(PMC *container))
-{
-    ASSERT_ARGS(parrot_new_pmc_hash)
-    Hash * const hash = parrot_new_hash(interp);
-    VTABLE_set_pointer(interp, container, hash);
-}
-
-
-/*
-
 =item C<Hash* parrot_new_cstring_hash(PARROT_INTERP)>
 
 Creates a new C string hash in C<hptr>.
@@ -1010,7 +1004,7 @@
 =item C<void parrot_hash_destroy(PARROT_INTERP, Hash *hash)>
 
 Frees the memory allocated to the specified hash and its bucket store.  Used by
-Parrot_chash_destroy.
+parrot_chash_destroy.
 
 =cut
 
@@ -1302,18 +1296,19 @@
     const UINTVAL hashval = (hash->hash_val)(interp, key, hash->seed);
     HashBucket   *bucket  = hash->bi[hashval & hash->mask];
 
-    /* Very complex assert that we'll not put non-constant stuff into constant hash */
-    PARROT_ASSERT(
-        PMC_IS_NULL(hash->container)
-        || !(PObj_constant_TEST(hash->container))
-        || (
-            (
-                !(hash->key_type == Hash_key_type_STRING)
-                || PObj_constant_TEST((PObj *)key))
-            && (
-                !((hash->entry_type == enum_type_PMC) || (hash->entry_type == enum_type_STRING))
-                || PObj_constant_TEST((PObj *)value)))
-        || !"Use non-constant key or value in constant hash");
+    /* When the hash is constant, check that the key and value are also
+     * constant. */
+    if (!PMC_IS_NULL(hash->container)
+            && PObj_constant_TEST(hash->container)) {
+        if (hash->key_type == Hash_key_type_STRING
+                && !PObj_constant_TEST((PObj *)key))
+            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                "Used non-constant key in constant hash.");
+        if (((hash->entry_type == enum_type_PMC) || (hash->entry_type == enum_type_STRING))
+                && !PObj_constant_TEST((PObj *)value))
+            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                "Used non-constant value in constant hash.");
+    }
 
     while (bucket) {
         /* store hash_val or not */
@@ -1322,19 +1317,9 @@
         bucket = bucket->next;
     }
 
-    if (bucket) {
-        if (hash->entry_type == enum_type_PMC && hash->container) {
-            GC_WRITE_BARRIER_KEY(interp, hash->container,
-                    (PMC *)bucket->value, bucket->key, (PMC *)value, key);
-        }
-
+    if (bucket)
         bucket->value = value;
-    }
     else {
-        if (hash->entry_type == enum_type_PMC && hash->container) {
-            GC_WRITE_BARRIER_KEY(interp, hash->container,
-                    NULL, NULL, (PMC *)value, key);
-        }
 
         bucket = hash->free_list;
 
@@ -1419,32 +1404,658 @@
         void * const  key = b->key;
 
         switch (hash->entry_type) {
-            case enum_type_undef:
-            case enum_type_ptr:
-            case enum_type_INTVAL:
-                valtmp = (void *)b->value;
-                break;
+          case enum_type_undef:
+          case enum_type_ptr:
+          case enum_type_INTVAL:
+            valtmp = (void *)b->value;
+            break;
 
-            case enum_type_STRING:
-                valtmp = (void *)Parrot_str_copy(interp, (STRING *)b->value);
-                break;
+          case enum_type_STRING:
+            valtmp = (void *)Parrot_str_copy(interp, (STRING *)b->value);
+            break;
 
-            case enum_type_PMC:
-                if (PMC_IS_NULL((PMC *)b->value))
-                    valtmp = (void *)PMCNULL;
-                else
-                    valtmp = (void *)VTABLE_clone(interp, (PMC*)b->value);
-                break;
+          case enum_type_PMC:
+            if (PMC_IS_NULL((PMC *)b->value))
+                valtmp = (void *)PMCNULL;
+            else
+                valtmp = (void *)VTABLE_clone(interp, (PMC*)b->value);
+            break;
 
-            default:
-                valtmp = NULL; /* avoid warning */
-                Parrot_ex_throw_from_c_args(interp, NULL, -1,
+          default:
+            valtmp = NULL; /* avoid warning */
+            Parrot_ex_throw_from_c_args(interp, NULL, -1,
                     "hash corruption: type = %d\n", hash->entry_type);
         };
 
-        if (key)
+        if (key){
             parrot_hash_put(interp, dest, key, valtmp);
+        }
+    }
+}
+
+/*
+
+=item C<PMC* get_integer_pmc(PARROT_INTERP, INTVAL value)>
+
+Lookup the PMC type which is used for storing native integers.
+
+=cut
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+PMC*
+get_integer_pmc(PARROT_INTERP, INTVAL value)
+{
+    ASSERT_ARGS(get_integer_pmc)
+    PMC * const ret = pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_Integer));
+    VTABLE_set_integer_native(interp, ret, value);
+    return ret;
+}
+
+
+/*
+
+=item C<PMC* get_number_pmc(PARROT_INTERP, FLOATVAL value)>
+
+Lookup the PMC type which is used for floating point numbers.
+
+=cut
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+PMC*
+get_number_pmc(PARROT_INTERP, FLOATVAL value)
+{
+    ASSERT_ARGS(get_number_pmc)
+    PMC * const ret = pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_Float));
+    VTABLE_set_number_native(interp, ret, value);
+    return ret;
+}
+
+/*
+
+=item C<PMC * get_string_pmc(PARROT_INTERP, STRING *value)>
+
+Lookup the PMC type which is used for storing strings.
+
+=cut
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+PMC *
+get_string_pmc(PARROT_INTERP, ARGIN(STRING *value))
+{
+    ASSERT_ARGS(get_string_pmc)
+    PMC * const ret = pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_String));
+    VTABLE_set_string_native(interp, ret, value);
+    return ret;
+}
+
+
+/*
+
+Poor-man polymorphic functions to convert something to something.
+
+There is bunch of functions to convert from passed value to stored keys type and to/from
+stored values type.
+
+void *hash_key_from_TYPE convert to keys type.
+TYPE hash_key_to_TYPE convert from keys type.
+void *hash_value_from_TYPE convert to values type.
+TYPE hash_value_to_TYPE convert from values type.
+
+*/
+
+/*
+
+=item C<void* hash_key_from_int(PARROT_INTERP, const Hash * const hash, INTVAL
+key)>
+
+Cast INTVAL to hash key.
+
+=cut
+
+*/
+
+PARROT_CAN_RETURN_NULL
+void*
+hash_key_from_int(PARROT_INTERP, ARGIN(const Hash * const hash), INTVAL key)
+{
+    ASSERT_ARGS(hash_key_from_int)
+    void *ret;
+    switch (hash->key_type) {
+      case Hash_key_type_int:
+        ret = (void *)key;
+        break;
+        /* Currently PMCs are stringified */
+      case Hash_key_type_PMC:
+        ret = (void *)get_integer_pmc(interp, key);
+        break;
+      case Hash_key_type_STRING:
+        ret = (void *)Parrot_str_from_int(interp, key);
+        break;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+                    "Hash: unsupported key_type");
+    }
+    return ret;
+}
+
+/*
+
+=item C<void* hash_key_from_string(PARROT_INTERP, const Hash * const hash,
+STRING *key)>
+
+Cast STRING to hash key.
+
+=cut
+
+*/
+
+PARROT_CAN_RETURN_NULL
+void*
+hash_key_from_string(PARROT_INTERP, ARGIN(const Hash * const hash), ARGIN(STRING *key))
+{
+    ASSERT_ARGS(hash_key_from_string)
+    void *ret;
+    switch (hash->key_type) {
+      case Hash_key_type_int:
+      {
+        /* Pacify compiler about casting INVTAL to void */
+        const INTVAL int_key = Parrot_str_to_int(interp, key);
+        ret                  = INTVAL2PTR(void *, int_key);
+        break;
+      }
+
+      case Hash_key_type_PMC:
+        ret = get_string_pmc(interp, key);
+        break;
+
+      case Hash_key_type_STRING:
+        ret = key;
+        break;
+
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+                    "Hash: unsupported key_type");
+    }
+    return ret;
+}
+
+/*
+
+=item C<void* hash_key_from_pmc(PARROT_INTERP, const Hash * const hash, PMC
+*key)>
+
+Cast PMC* to hash key.
+
+=cut
+
+*/
+
+PARROT_CAN_RETURN_NULL
+void*
+hash_key_from_pmc(PARROT_INTERP, ARGIN(const Hash * const hash), ARGIN(PMC *key))
+{
+    ASSERT_ARGS(hash_key_from_pmc)
+    void *ret;
+    switch (hash->key_type) {
+      case Hash_key_type_int:
+        {
+            const INTVAL int_key = VTABLE_get_integer(interp, key);
+            ret                  = INTVAL2PTR(void *, int_key);
+            break;
+        }
+      case Hash_key_type_PMC:
+        {
+            /* Extract real value from Key (and box it if nessary) */
+            if (key->vtable->base_type == enum_class_Key)
+                switch (key_type(interp, key)) {
+                  case KEY_integer_FLAG:
+                    key = get_integer_pmc(interp, key_integer(interp, key));
+                    break;
+                  case KEY_string_FLAG:
+                    key = get_string_pmc(interp, key_string(interp, key));
+                    break;
+                  case KEY_number_FLAG:
+                    key = get_number_pmc(interp, key_number(interp, key));
+                    break;
+                  case KEY_pmc_FLAG:
+                    key = key_pmc(interp, key);
+                    break;
+                  default:
+                    /* It's impossible if Keys are same (and they are not) */
+                    /* So throw exception */
+                    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                                "hash: unexpected type of Key");
+                    break;
+                }
+
+            ret = key;
+            break;
+        }
+      case Hash_key_type_STRING:
+        {
+            STRING * const tmp = VTABLE_get_string(interp, key);
+            if (!tmp)
+                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNEXPECTED_NULL,
+                            "hash: can't use null as key");
+            ret = (void *)tmp;
+        }
+        break;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+                    "Hash: unsupported key_type");
+    }
+    return ret;
+}
+
+/*
+
+=item C<INTVAL hash_key_to_int(PARROT_INTERP, const Hash * const hash, void
+*key)>
+
+Cast hash key to INTVAL.
+
+=cut
+
+*/
+
+INTVAL
+hash_key_to_int(PARROT_INTERP, ARGIN(const Hash * const hash), ARGIN_NULLOK(void *key))
+{
+    ASSERT_ARGS(hash_key_to_int)
+    INTVAL ret;
+    switch (hash->key_type) {
+      case Hash_key_type_int:
+        ret = (INTVAL)key;
+        break;
+      case Hash_key_type_PMC:
+        ret = VTABLE_get_integer(interp, (PMC *)key);
+        break;
+      case Hash_key_type_STRING:
+        ret = Parrot_str_to_int(interp, (STRING *)key);
+        break;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+                    "Hash: unsupported key_type");
+    }
+    return ret;
+}
+
+/*
+
+=item C<STRING* hash_key_to_string(PARROT_INTERP, const Hash * const hash, void
+*key)>
+
+Cast hash key to STRING.
+
+=cut
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+STRING*
+hash_key_to_string(PARROT_INTERP, ARGIN(const Hash * const hash), ARGIN_NULLOK(void *key))
+{
+    ASSERT_ARGS(hash_key_to_string)
+    STRING *ret;
+    switch (hash->key_type) {
+      case Hash_key_type_int:
+        ret = Parrot_str_from_int(interp, (INTVAL)key);
+        break;
+
+      case Hash_key_type_PMC:
+        ret = VTABLE_get_string(interp, (PMC *)key);
+        break;
+
+      case Hash_key_type_STRING:
+        ret = (STRING *)key;
+        break;
+
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+                    "Hash: unsupported key_type");
+    }
+    return ret;
+}
+
+/*
+
+=item C<PMC* hash_key_to_pmc(PARROT_INTERP, const Hash * const hash, void *key)>
+
+Cast hash key to PMC*.
+
+=cut
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+PMC*
+hash_key_to_pmc(PARROT_INTERP, ARGIN(const Hash * const hash), ARGIN(void *key))
+{
+    ASSERT_ARGS(hash_key_to_pmc)
+    PMC *ret;
+    switch (hash->key_type) {
+      case Hash_key_type_int:
+        ret = get_integer_pmc(interp, (INTVAL)key);
+        break;
+      case Hash_key_type_PMC:
+        ret = (PMC*)key;
+        break;
+      case Hash_key_type_STRING:
+        ret = get_string_pmc(interp, (STRING*)key);
+        break;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+                    "Hash: unsupported key_type");
+    }
+    return ret;
+}
+
+/* Second part - convert from stored void* to real type */
+/* TODO: FLOATVALs converted into Float PMC for now */
+
+/*
+
+=item C<void* hash_value_from_int(PARROT_INTERP, const Hash * const hash, INTVAL
+value)>
+
+Cast INTVAL to hash value.
+
+=cut
+
+*/
+
+PARROT_CAN_RETURN_NULL
+void*
+hash_value_from_int(PARROT_INTERP, ARGIN(const Hash * const hash), INTVAL value)
+{
+    ASSERT_ARGS(hash_value_from_int)
+    void *ret;
+    switch (hash->entry_type) {
+      case enum_type_INTVAL:
+        ret = INTVAL2PTR(void *, value);
+        break;
+      case enum_type_PMC:
+        {
+            PMC * const tmp = get_integer_pmc(interp, value);
+            ret = (void *)tmp;
+        }
+        break;
+      case enum_type_STRING:
+        ret = (void *)Parrot_str_from_int(interp, value);
+        break;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+                    "Hash: unsupported entry_type");
+    }
+    return ret;
+}
+
+/*
+
+=item C<void* hash_value_from_string(PARROT_INTERP, const Hash * const hash,
+STRING *value)>
+
+Cast STRING to hash value.
+
+=cut
+
+*/
+
+PARROT_CAN_RETURN_NULL
+void*
+hash_value_from_string(PARROT_INTERP, ARGIN(const Hash * const hash),
+        ARGIN_NULLOK(STRING *value))
+{
+    ASSERT_ARGS(hash_value_from_string)
+    void *ret;
+    switch (hash->entry_type) {
+      case enum_type_INTVAL:
+        {
+            const INTVAL int_val = STRING_IS_NULL(value) ?
+                    (INTVAL) 0 : Parrot_str_to_int(interp, value);
+            ret = INTVAL2PTR(void *, int_val);
+        }
+        break;
+      case enum_type_STRING:
+        ret = (void *)value;
+        break;
+      case enum_type_PMC:
+        {
+            PMC * const s = STRING_IS_NULL(value) ?
+                   PMCNULL : get_string_pmc(interp, value);
+            ret = (void *)s;
+        }
+        break;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+                    "Hash: unsupported entry_type");
+    }
+    return ret;
+}
+
+/*
+
+=item C<void* hash_value_from_pmc(PARROT_INTERP, const Hash * const hash, PMC
+*value)>
+
+Cast PMC to hash value.
+
+=cut
+
+*/
+
+PARROT_CAN_RETURN_NULL
+void*
+hash_value_from_pmc(PARROT_INTERP, ARGIN(const Hash * const hash),
+    ARGIN_NULLOK(PMC *value))
+{
+    ASSERT_ARGS(hash_value_from_pmc)
+    void *ret;
+    switch (hash->entry_type) {
+      case enum_type_INTVAL:
+        {
+            const INTVAL int_val = PMC_IS_NULL(value) ?
+                    (INTVAL) 0 : VTABLE_get_integer(interp, value);
+            ret                  = INTVAL2PTR(void *, int_val);
+        }
+        break;
+      case enum_type_STRING:
+        ret = PMC_IS_NULL(value) ?
+                PMCNULL : (void *)VTABLE_get_string(interp, value);
+        break;
+      case enum_type_PMC:
+        ret = (void *)value;
+        break;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+                    "Hash: unsupported entry_type");
+    }
+    return ret;
+}
+
+/*
+
+=item C<void* hash_value_from_number(PARROT_INTERP, const Hash * const hash,
+FLOATVAL value)>
+
+Cast FLOATVAL to hash value.
+
+=cut
+
+*/
+
+PARROT_CAN_RETURN_NULL
+void*
+hash_value_from_number(PARROT_INTERP, ARGIN(const Hash * const hash), FLOATVAL value)
+{
+    ASSERT_ARGS(hash_value_from_number)
+    void *ret;
+    switch (hash->entry_type) {
+      case enum_type_INTVAL:
+        {
+            const INTVAL tmp = value;
+            ret = (void*)tmp;
+        }
+        break;
+      case enum_type_STRING:
+        ret = (void *)Parrot_str_from_num(interp, value);
+        break;
+      case enum_type_PMC:
+        {
+            PMC * const tmp = get_number_pmc(interp, value);
+            ret = (void *)tmp;
+        }
+        break;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+                    "Hash: unsupported entry_type");
+    }
+    return ret;
+}
+
+/*
+
+=item C<INTVAL hash_value_to_int(PARROT_INTERP, const Hash * const hash, void
+*value)>
+
+Cast hash value to INTVAL.
+
+=cut
+
+*/
+
+INTVAL
+hash_value_to_int(PARROT_INTERP, ARGIN(const Hash * const hash), ARGIN_NULLOK(void *value))
+{
+    ASSERT_ARGS(hash_value_to_int)
+    INTVAL ret;
+    switch (hash->entry_type) {
+      case enum_type_ptr:
+      case enum_type_INTVAL:
+        ret = (INTVAL)value;
+        break;
+      case enum_type_STRING:
+        ret = Parrot_str_to_int(interp, (STRING*)value);
+        break;
+      case enum_type_PMC:
+        ret = VTABLE_get_integer(interp, (PMC*)value);
+        break;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+                    "Hash: unsupported entry_type");
+    }
+    return ret;
+}
+
+/*
+
+=item C<STRING* hash_value_to_string(PARROT_INTERP, const Hash * const hash,
+void *value)>
+
+Cast hash value to STRING.
+
+=cut
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+STRING*
+hash_value_to_string(PARROT_INTERP, ARGIN(const Hash * const hash), ARGIN_NULLOK(void *value))
+{
+    ASSERT_ARGS(hash_value_to_string)
+    STRING *ret;
+    switch (hash->entry_type) {
+      case enum_type_INTVAL:
+        ret = Parrot_str_from_int(interp, (INTVAL)value);
+        break;
+      case enum_type_STRING:
+        ret = (STRING *)value;
+        break;
+      case enum_type_PMC:
+        ret = VTABLE_get_string(interp, (PMC *)value);
+        break;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+                    "Hash: unsupported entry_type");
+    }
+    return ret;
+}
+
+/*
+
+=item C<PMC* hash_value_to_pmc(PARROT_INTERP, const Hash * const hash, void
+*value)>
+
+Cast hash value to PMC.
+
+=cut
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+PMC*
+hash_value_to_pmc(PARROT_INTERP, ARGIN(const Hash * const hash), ARGIN_NULLOK(void *value))
+{
+    ASSERT_ARGS(hash_value_to_pmc)
+    PMC *ret;
+    switch (hash->entry_type) {
+      case enum_type_INTVAL:
+        ret = get_integer_pmc(interp, (INTVAL)value);
+        break;
+      case enum_type_STRING:
+        ret = get_string_pmc(interp, (STRING*)value);
+        break;
+      case enum_type_PMC:
+        ret = (PMC *)value;
+        break;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+                    "Hash: unsupported entry_type");
+    }
+    return ret;
+}
+
+/*
+
+=item C<FLOATVAL hash_value_to_number(PARROT_INTERP, const Hash * const hash,
+void *value)>
+
+Cast hash value to FLOATVAL.
+
+=cut
+
+*/
+
+FLOATVAL
+hash_value_to_number(PARROT_INTERP, ARGIN(const Hash * const hash), ARGIN_NULLOK(void *value))
+{
+    ASSERT_ARGS(hash_value_to_number)
+    FLOATVAL ret;
+    switch (hash->entry_type) {
+      case enum_type_INTVAL:
+        {
+            /* Pacify compiler about casting */
+            const INTVAL tmp = (INTVAL)value;
+            ret = tmp;
+        }
+        break;
+      case enum_type_STRING:
+        ret = Parrot_str_to_num(interp, (STRING*)value);
+        break;
+      case enum_type_PMC:
+        ret = VTABLE_get_number(interp, (PMC*)value);
+        break;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+                    "Hash: unsupported entry_type");
     }
+    return ret;
 }
 
 /*

Modified: branches/orderedhash_revamp/src/hll.c
==============================================================================
--- branches/orderedhash_revamp/src/hll.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/hll.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -31,6 +31,7 @@
 
 #include "parrot/parrot.h"
 #include "parrot/dynext.h"
+#include "pmc/pmc_callcontext.h"
 #include "hll.str"
 
 /* HEADERIZER HFILE: include/parrot/hll.h */
@@ -43,8 +44,8 @@
 static PMC* new_hll_entry(PARROT_INTERP, ARGIN_NULLOK(STRING *entry_name))
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_new_hll_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_new_hll_entry __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: static */
 
@@ -53,7 +54,7 @@
 #define END_READ_HLL_INFO(interp, hll_info)
 #define START_WRITE_HLL_INFO(interp, hll_info) \
     do { \
-        if (PMC_sync((interp)->HLL_info)) { \
+        if (PObj_is_PMC_shared_TEST(hll_info) && PMC_sync((interp)->HLL_info)) { \
             (hll_info) = (interp)->HLL_info = \
                 Parrot_clone((interp), (interp)->HLL_info); \
             if (PMC_sync((interp)->HLL_info)) \
@@ -90,14 +91,7 @@
     PMC * const entry = constant_pmc_new(interp, enum_class_FixedPMCArray);
 
     if (entry_name && !STRING_IS_EMPTY(entry_name)) {
-        char   * const cstring    = Parrot_str_to_cstring(interp, entry_name);
-        const  UINTVAL len        = Parrot_str_byte_length(interp, entry_name);
-        STRING *const_name        = Parrot_str_new_init(interp, cstring,
-            len, PARROT_DEFAULT_ENCODING, PARROT_DEFAULT_CHARSET,
-            PObj_constant_FLAG);
-
-        Parrot_str_free_cstring(cstring);
-        VTABLE_set_pmc_keyed_str(interp, hll_info, const_name, entry);
+        VTABLE_set_pmc_keyed_str(interp, hll_info, entry_name, entry);
     }
     else
         VTABLE_push_pmc(interp, hll_info, entry);
@@ -362,8 +356,8 @@
             "no such HLL ID (%vd)", hll_id);
 
     /* the type might already be registered in a non-conflicting way, in which
-     * case we can avoid copying */
-    if (PMC_sync(hll_info)) {
+     * ca se we can avoid copying */
+    if (PObj_is_PMC_shared_TEST(hll_info) && PMC_sync(hll_info)) {
         if (hll_type == Parrot_get_HLL_type(interp, hll_id, core_type))
             return;
     }
@@ -446,7 +440,7 @@
 Parrot_get_ctx_HLL_type(PARROT_INTERP, INTVAL core_type)
 {
     ASSERT_ARGS(Parrot_get_ctx_HLL_type)
-    const INTVAL hll_id = CONTEXT(interp)->current_HLL;
+    const INTVAL hll_id = Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp));
 
     return Parrot_get_HLL_type(interp, hll_id, core_type);
 }
@@ -468,7 +462,7 @@
 Parrot_get_ctx_HLL_namespace(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_get_ctx_HLL_namespace)
-    return Parrot_get_HLL_namespace(interp, CONTEXT(interp)->current_HLL);
+    return Parrot_get_HLL_namespace(interp, Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp)));
 }
 
 /*
@@ -554,6 +548,7 @@
 
 =cut
 
+
 */
 
 /*

Modified: branches/orderedhash_revamp/src/interp/inter_cb.c
==============================================================================
--- branches/orderedhash_revamp/src/interp/inter_cb.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/interp/inter_cb.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -41,18 +41,18 @@
         __attribute__nonnull__(3)
         FUNC_MODIFIES(*user_data);
 
-static void verify_CD(ARGIN(char *external_data), ARGMOD(PMC *user_data))
+static void verify_CD(
+    ARGIN(char *external_data),
+    ARGMOD_NULLOK(PMC *user_data))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
         FUNC_MODIFIES(*user_data);
 
-#define ASSERT_ARGS_callback_CD __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_callback_CD __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(external_data) \
-    || PARROT_ASSERT_ARG(user_data)
-#define ASSERT_ARGS_verify_CD __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(external_data) \
-    || PARROT_ASSERT_ARG(user_data)
+    , PARROT_ASSERT_ARG(external_data) \
+    , PARROT_ASSERT_ARG(user_data))
+#define ASSERT_ARGS_verify_CD __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(external_data))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -76,9 +76,9 @@
 {
     ASSERT_ARGS(Parrot_make_cb)
     PMC *cb, *cb_sig;
-    int type;
-    char * sig_str;
+    int type = 0;
     STRING *sc;
+    char * const signature = Parrot_str_to_cstring(interp, cb_signature);
     /*
      * we stuff all the information into the user_data PMC and pass that
      * on to the external sub
@@ -92,27 +92,22 @@
     sc = CONST_STRING(interp, "_sub");
     VTABLE_setprop(interp, user_data, sc, sub);
     /* only ASCII signatures are supported */
-    sig_str = cb_signature->strstart;
+    if (strlen(signature) == 3) {
+        /* Callback return type ignored */
 
-    if (strlen(sig_str) != 3)
-        Parrot_ex_throw_from_c_args(interp, NULL, 1,
-            "unhandled signature '%s' in make_cb", cb_signature->strstart);
-
-    ++sig_str;     /* Skip callback return type */
-
-    if (*sig_str == 'U') {
-        type = 'D';
-    }
-    else {
-        ++sig_str;
-        if (*sig_str == 'U') {
-            type = 'C';
+        if (signature[1] == 'U') {
+            type = 'D';
         }
         else {
-            Parrot_ex_throw_from_c_args(interp, NULL, 1,
-                "unhandled signature '%s' in make_cb", cb_signature->strstart);
+            if (signature[2] == 'U') {
+                type = 'C';
+            }
         }
     }
+    Parrot_str_free_cstring(signature);
+    if (type != 'C' && type != 'D')
+        Parrot_ex_throw_from_c_args(interp, NULL, 1,
+            "unhandled signature '%Ss' in make_cb", cb_signature);
 
     cb_sig = pmc_new(interp, enum_class_String);
     VTABLE_set_string_native(interp, cb_sig, cb_signature);
@@ -159,7 +154,7 @@
 */
 
 static void
-verify_CD(ARGIN(char *external_data), ARGMOD(PMC *user_data))
+verify_CD(ARGIN(char *external_data), ARGMOD_NULLOK(PMC *user_data))
 {
     ASSERT_ARGS(verify_CD)
     PARROT_INTERP = NULL;
@@ -172,7 +167,11 @@
      */
 
     /* a NULL pointer or a pointer not aligned is very likely wrong */
-    if (!user_data || ((UINTVAL)user_data & 3))
+    if (!user_data)
+        PANIC(interp, "user_data is NULL");
+    if (PMC_IS_NULL(user_data))
+        PANIC(interp, "user_data is PMCNULL");
+    if ((UINTVAL)user_data & 3)
         PANIC(interp, "user_data doesn't look like a pointer");
 
     /*
@@ -182,12 +181,11 @@
      */
     LOCK(interpreter_array_mutex);
     for (i = 0; i < n_interpreters; ++i) {
-        if (interpreter_array[i] == NULL)
-            continue;
-        interp = interpreter_array[i];
-        if (interp)
-            if (Parrot_gc_ptr_is_pmc(interp, user_data))
-                break;
+        Parrot_Interp checkinterp = interpreter_array [i];
+        if (checkinterp && Parrot_gc_ptr_is_pmc(checkinterp, user_data)) {
+            interp = checkinterp;
+            break;
+        }
     }
     UNLOCK(interpreter_array_mutex);
     if (!interp)
@@ -294,7 +292,9 @@
     PMC     *sub;
     STRING  *sig_str;
     char    *p;
-    char     pasm_sig[4];
+    char     ch;
+    char    *sig_cstr;
+    char     pasm_sig[5];
     INTVAL   i_param;
     PMC     *p_param;
     void    *param = NULL;      /* avoid -Ox warning */
@@ -306,67 +306,72 @@
     signature = VTABLE_getprop(interp, user_data, sc);
 
     sig_str   = VTABLE_get_string(interp, signature);
-    p         = sig_str->strstart;
+    sig_cstr  = Parrot_str_to_cstring(interp, sig_str);
+    p         = sig_cstr;
     ++p;     /* Skip return type */
 
-    pasm_sig[0] = 'v';  /* no return value supported yet */
-    pasm_sig[1] = 'P';
+    pasm_sig[0] = 'P';
     if (*p == 'U') /* user_data Z in pdd16 */
         ++p;       /* p is now type of external data */
     switch (*p) {
-        case 'v':
-            pasm_sig[2] = 'v';
-            break;
+      case 'v':
+        pasm_sig[1] = 'v';
+        break;
 #if 0
-        case '2':
-        case '3':
-        case '4':
+      case '2':
+      case '3':
+      case '4':
 #endif
-        case 'l':
-            i_param = (INTVAL)(long) external_data;
-            goto case_I;
-        case 'i':
-            i_param = (INTVAL)(int)(long) external_data;
-            goto case_I;
-        case 's':
-            i_param = (INTVAL)(short)(long) external_data;
-            goto case_I;
-        case 'c':
-            i_param = (INTVAL)(char)(long)external_data;
+      case 'l':
+        i_param = (INTVAL)(long) external_data;
+        goto case_I;
+      case 'i':
+        i_param = (INTVAL)(int)(long) external_data;
+        goto case_I;
+      case 's':
+        i_param = (INTVAL)(short)(long) external_data;
+        goto case_I;
+      case 'c':
+        i_param = (INTVAL)(char)(long)external_data;
 case_I:
-            pasm_sig[2] = 'I';
-            param = (void*) i_param;
-            break;
+        pasm_sig[1] = 'I';
+        param = (void*) i_param;
+        break;
 #if 0
-        case 'f':
-        case 'd':
-            /* these types don't fit into a pointer, they will not
-             * work
-             */
-            break;
+      case 'f':
+      case 'd':
+        /* these types don't fit into a pointer, they will not
+         * work
+         */
+        break;
 #endif
-        case 'p':
-            /* created a UnManagedStruct */
-            p_param = pmc_new(interp, enum_class_UnManagedStruct);
-            VTABLE_set_pointer(interp, p_param, external_data);
-            pasm_sig[2] = 'P';
-            param = (void*) p_param;
-            break;
+      case 'p':
+        /* created a UnManagedStruct */
+        p_param = pmc_new(interp, enum_class_UnManagedStruct);
+        VTABLE_set_pointer(interp, p_param, external_data);
+        pasm_sig[1] = 'P';
+        param = (void*) p_param;
+        break;
 #if 0
-        case 'P':
-            pasm_sig[2] = 'P';
-            break;
+      case 'P':
+        pasm_sig[1] = 'P';
+        break;
 #endif
-        case 't':
-            pasm_sig[2] = 'S';
-            param = Parrot_str_new(interp, external_data, 0);
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, 1,
-                "unhandled signature char '%c' in run_cb", *p);
+      case 't':
+        pasm_sig[1] = 'S';
+        param = Parrot_str_new(interp, external_data, 0);
+        break;
+      default:
+        ch = *p;
+        Parrot_str_free_cstring(sig_cstr);
+        Parrot_ex_throw_from_c_args(interp, NULL, 1,
+                "unhandled signature char '%c' in run_cb", ch);
     }
-    pasm_sig[3] = '\0';
-    Parrot_runops_fromc_args_event(interp, sub, pasm_sig,
+    Parrot_str_free_cstring(sig_cstr);
+    pasm_sig[2] = '-';
+    pasm_sig[3] = '>';  /* no return value supported yet */
+    pasm_sig[4] = '\0';
+    Parrot_pcc_invoke_sub_from_c_args(interp, sub, pasm_sig,
             user_data, param);
 }
 /*
@@ -383,7 +388,7 @@
 
 PARROT_EXPORT
 void
-Parrot_callback_C(ARGIN(char *external_data), ARGMOD(PMC *user_data))
+Parrot_callback_C(ARGIN(char *external_data), ARGMOD_NULLOK(PMC *user_data))
 {
     ASSERT_ARGS(Parrot_callback_C)
     verify_CD(external_data, user_data);
@@ -391,7 +396,7 @@
 
 PARROT_EXPORT
 void
-Parrot_callback_D(ARGMOD(PMC *user_data), ARGIN(char *external_data))
+Parrot_callback_D(ARGMOD(PMC *user_data), ARGMOD_NULLOK(char *external_data))
 {
     ASSERT_ARGS(Parrot_callback_D)
     verify_CD(external_data, user_data);

Modified: branches/orderedhash_revamp/src/interp/inter_create.c
==============================================================================
--- branches/orderedhash_revamp/src/interp/inter_create.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/interp/inter_create.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -23,6 +23,7 @@
 #include "parrot/runcore_api.h"
 #include "parrot/oplib/core_ops.h"
 #include "../compilers/imcc/imc.h"
+#include "pmc/pmc_callcontext.h"
 #include "inter_create.str"
 
 /* HEADERIZER HFILE: include/parrot/interpreter.h */
@@ -31,32 +32,26 @@
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
 PARROT_WARN_UNUSED_RESULT
-static int is_env_var_set(ARGIN(const char* var))
-        __attribute__nonnull__(1);
+static int is_env_var_set(PARROT_INTERP, ARGIN(STRING* var))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
 static void setup_default_compreg(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_is_env_var_set __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(var)
-#define ASSERT_ARGS_setup_default_compreg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_is_env_var_set __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(var))
+#define ASSERT_ARGS_setup_default_compreg __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: static */
 
-#if EXEC_CAPABLE
-    extern int Parrot_exec_run;
-#endif
-
-#if EXEC_CAPABLE
-Interp interpre;
-#endif
-
 #define ATEXIT_DESTROY
 
 /*
 
-=item C<static int is_env_var_set(const char* var)>
+=item C<static int is_env_var_set(PARROT_INTERP, STRING* var)>
 
 Checks whether the specified environment variable is set.
 
@@ -66,19 +61,17 @@
 
 PARROT_WARN_UNUSED_RESULT
 static int
-is_env_var_set(ARGIN(const char* var))
+is_env_var_set(PARROT_INTERP, ARGIN(STRING* var))
 {
     ASSERT_ARGS(is_env_var_set)
-    int free_it, retval;
-    char* const value = Parrot_getenv(var, &free_it);
+    int retval;
+    char* const value = Parrot_getenv(interp, var);
     if (value == NULL)
         retval = 0;
     else if (*value == '\0')
         retval = 0;
     else
         retval = !STREQ(value, "0");
-    if (free_it)
-        mem_sys_free(value);
     return retval;
 }
 
@@ -122,12 +115,7 @@
     Interp *interp;
 
     /* Get an empty interpreter from system memory */
-#if EXEC_CAPABLE
-    if (Parrot_exec_run)
-        interp = &interpre;
-    else
-#endif
-        interp = mem_allocate_zeroed_typed(Interp);
+    interp = mem_allocate_zeroed_typed(Interp);
 
     interp->lo_var_ptr = NULL;
 
@@ -144,22 +132,30 @@
         MUTEX_INIT(interpreter_array_mutex);
     }
 
-    create_initial_context(interp);
+    /* Must initialize flags before Parrot_gc_initialize() is called
+     * so the GC_DEBUG stuff is available. */
+    interp->flags = flags;
+    /* Set up the memory allocation system */
+    Parrot_gc_initialize(interp, (void*)&stacktop);
+    Parrot_block_GC_mark(interp);
+    Parrot_block_GC_sweep(interp);
+
+    interp->ctx         = PMCNULL;
     interp->resume_flag = RESUME_INITIAL;
 
-    /* main is called as a Sub too - this will get depth 0 then */
-    CONTEXT(interp)->recursion_depth = (UINTVAL)-1;
     interp->recursion_limit = RECURSION_LIMIT;
 
-    /* Must initialize flags here so the GC_DEBUG stuff is available before
-     * Parrot_gc_initialize() is called. */
-    interp->flags = flags;
-
     /* PANIC will fail until this is done */
     interp->piodata = NULL;
     Parrot_io_init(interp);
 
-    if (is_env_var_set("PARROT_GC_DEBUG")) {
+    /*
+     * Set up the string subsystem
+     * This also generates the constant string tables
+     */
+    Parrot_str_init(interp);
+
+    if (is_env_var_set(interp, CONST_STRING(interp, "PARROT_GC_DEBUG"))) {
 #if ! DISABLE_GC_DEBUG
         Interp_flags_SET(interp, PARROT_GC_DEBUG_FLAG);
 #else
@@ -168,21 +164,9 @@
 #endif
     }
 
-    /* Set up the memory allocation system */
-    Parrot_gc_initialize(interp, (void*)&stacktop);
-    Parrot_block_GC_mark(interp);
-    Parrot_block_GC_sweep(interp);
+    Parrot_initialize_core_vtables(interp);
 
-    /*
-     * Set up the string subsystem
-     * This also generates the constant string tables
-     */
-    Parrot_str_init(interp);
-
-    /* Set up the MMD struct */
-    interp->binop_mmd_funcs = NULL;
-
-    /* MMD cache for builtins. */
+    /* Set up MMD; MMD cache for builtins. */
     interp->op_mmd_cache = Parrot_mmd_cache_create(interp);
 
     /* create caches structure */
@@ -210,16 +194,15 @@
     PARROT_ERRORS_on(interp, PARROT_ERRORS_RESULT_COUNT_FLAG);
 #endif
 
-    /* allocate stack chunk cache */
-    stack_system_init(interp);
-
-    /* And a dynamic environment stack */
-    interp->dynamic_env = new_stack(interp, "DynamicEnv");
+    create_initial_context(interp);
 
     /* clear context introspection vars */
-    CONTEXT(interp)->current_sub    = NULL;
-    CONTEXT(interp)->current_cont   = NULL;
-    CONTEXT(interp)->current_object = NULL;
+    Parrot_pcc_set_sub(interp, CURRENT_CONTEXT(interp), NULL);
+    Parrot_pcc_set_continuation(interp, CURRENT_CONTEXT(interp), NULL); /* TODO Use PMCNULL */
+    Parrot_pcc_set_object(interp, CURRENT_CONTEXT(interp), NULL);
+
+    /* initialize built-in runcores */
+    Parrot_runcore_init(interp);
 
     /* Load the core op func and info tables */
     interp->op_lib          = PARROT_CORE_OPLIB_INIT(1);
@@ -230,11 +213,14 @@
     interp->evc_func_table  = NULL;
     interp->save_func_table = NULL;
     interp->code            = NULL;
-    interp->profile         = NULL;
 
     /* create the root set registry */
     interp->gc_registry     = pmc_new(interp, enum_class_AddrRegistry);
 
+    /* And a dynamic environment stack */
+    /* TODO: We should really consider removing this (TT #876) */
+    interp->dynamic_env = pmc_new(interp, enum_class_ResizablePMCArray);
+
     /* create exceptions list */
     interp->current_runloop_id    = 0;
     interp->current_runloop_level = 0;
@@ -364,6 +350,10 @@
     /* Now the PIOData gets also cleared */
     Parrot_io_finish(interp);
 
+    /* deinit runcores and dynamic op_libs */
+    if (!interp->parent_interpreter)
+        Parrot_runcore_destroy(interp);
+
     /*
      * now all objects that need timely destruction should be finalized
      * so terminate the event loop
@@ -395,6 +385,12 @@
     /* copies of constant tables */
     Parrot_destroy_constants(interp);
 
+    destroy_runloop_jump_points(interp);
+
+    /* packfile */
+    if (interp->initial_pf)
+        PackFile_destroy(interp, interp->initial_pf);
+
     /* buffer headers, PMCs */
     Parrot_gc_destroy_header_pools(interp);
 
@@ -402,26 +398,14 @@
     Parrot_gc_destroy_memory_pools(interp);
 
     /* mem subsystem is dead now */
-    mem_sys_free(interp->arena_base);
-    interp->arena_base = NULL;
+    mem_sys_free(interp->mem_pools);
+    interp->mem_pools = NULL;
+    mem_sys_free(interp->gc_sys);
+    interp->gc_sys = NULL;
 
     /* cache structure */
     destroy_object_cache(interp);
 
-    /* packfile */
-    if (interp->initial_pf)
-        PackFile_destroy(interp, interp->initial_pf);
-
-    if (interp->profile) {
-        mem_sys_free(interp->profile->data);
-        interp->profile->data = NULL;
-        mem_sys_free(interp->profile);
-        interp->profile = NULL;
-    }
-
-    destroy_context(interp);
-    destroy_runloop_jump_points(interp);
-
     if (interp->evc_func_table) {
         mem_sys_free(interp->evc_func_table);
         interp->evc_func_table = NULL;
@@ -439,15 +423,6 @@
         /* free vtables */
         parrot_free_vtables(interp);
 
-        /* dynop libs */
-        if (interp->n_libs > 0) {
-            mem_sys_free(interp->op_info_table);
-            mem_sys_free(interp->op_func_table);
-
-            /* deinit op_lib */
-            Parrot_runcore_destroy(interp);
-        }
-
         MUTEX_DESTROY(interpreter_array_mutex);
         mem_sys_free(interp);
 

Modified: branches/orderedhash_revamp/src/interp/inter_misc.c
==============================================================================
--- branches/orderedhash_revamp/src/interp/inter_misc.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/interp/inter_misc.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -22,6 +22,8 @@
 #include "parrot/parrot.h"
 #include "inter_misc.str"
 #include "../compilers/imcc/imc.h"
+#include "parrot/runcore_api.h"
+#include "pmc/pmc_callcontext.h"
 
 #include "parrot/has_header.h"
 
@@ -172,31 +174,11 @@
     return IMCC_compile_file_s(interp, fullname, error);
 }
 
-#ifdef GC_IS_MALLOC
-#  if 0
-struct mallinfo {
-    int arena;                  /* non-mmapped space allocated from system */
-    int ordblks;                /* number of free chunks */
-    int smblks;                 /* number of fastbin blocks */
-    int hblks;                  /* number of mmapped regions */
-    int hblkhd;                 /* space in mmapped regions */
-    int usmblks;                /* maximum total allocated space */
-    int fsmblks;                /* space available in freed fastbin blocks */
-    int uordblks;               /* total allocated space */
-    int fordblks;               /* total free space */
-    int keepcost;               /* top-most, releasable (via malloc_trim)
-                                 * space */
-};
-#  endif
-extern struct mallinfo mallinfo(void);
-#endif /* GC_IS_MALLOC */
-
 /*
 
 =item C<INTVAL interpinfo(PARROT_INTERP, INTVAL what)>
 
-C<what> specifies the type of information you want about the
-interpreter.
+C<what> specifies the type of information you want about the interpreter.
 
 =cut
 
@@ -211,55 +193,68 @@
     INTVAL ret;
 
     switch (what) {
-        case TOTAL_MEM_ALLOC:
-#ifdef GC_IS_MALLOC
-#  if 0
-            interp->memory_allocated = mallinfo().uordblks;
-#  endif
-#endif
-            ret = Parrot_gc_total_memory_allocated(interp);
-            break;
-        case GC_MARK_RUNS:
-            ret = Parrot_gc_count_mark_runs(interp);
-            break;
-        case GC_LAZY_MARK_RUNS:
-            ret = Parrot_gc_count_lazy_mark_runs(interp);
-            break;
-        case GC_COLLECT_RUNS:
-            ret = Parrot_gc_count_collect_runs(interp);
-            break;
-        case ACTIVE_PMCS:
-            ret = Parrot_gc_active_pmcs(interp);
-            break;
-        case ACTIVE_BUFFERS:
-            ret = Parrot_gc_active_sized_buffers(interp);
-            break;
-        case TOTAL_PMCS:
-            ret = Parrot_gc_total_pmcs(interp);
-            break;
-        case TOTAL_BUFFERS:
-            ret = Parrot_gc_total_sized_buffers(interp);
-            break;
-        case HEADER_ALLOCS_SINCE_COLLECT:
-            ret = Parrot_gc_headers_alloc_since_last_collect(interp);
-            break;
-        case MEM_ALLOCS_SINCE_COLLECT:
-            ret = Parrot_gc_mem_alloc_since_last_collect(interp);
-            break;
-        case TOTAL_COPIED:
-            ret = Parrot_gc_total_copied(interp);
-            break;
-        case IMPATIENT_PMCS:
-            ret = Parrot_gc_impatient_pmcs(interp);
-            break;
-        case EXTENDED_PMCS:
-            ret = Parrot_gc_extended_pmcs(interp);
-            break;
-        case CURRENT_RUNCORE:
-            ret = interp->run_core;
-            break;
-        default:        /* or a warning only? */
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+      case TOTAL_MEM_ALLOC:
+        ret = Parrot_gc_total_memory_allocated(interp);
+        break;
+      case GC_MARK_RUNS:
+        ret = Parrot_gc_count_mark_runs(interp);
+        break;
+      case GC_LAZY_MARK_RUNS:
+        ret = Parrot_gc_count_lazy_mark_runs(interp);
+        break;
+      case GC_COLLECT_RUNS:
+        ret = Parrot_gc_count_collect_runs(interp);
+        break;
+      case ACTIVE_PMCS:
+        ret = Parrot_gc_active_pmcs(interp);
+        break;
+      case ACTIVE_BUFFERS:
+        ret = Parrot_gc_active_sized_buffers(interp);
+        break;
+      case TOTAL_PMCS:
+        ret = Parrot_gc_total_pmcs(interp);
+        break;
+      case TOTAL_BUFFERS:
+        ret = Parrot_gc_total_sized_buffers(interp);
+        break;
+      case HEADER_ALLOCS_SINCE_COLLECT:
+        ret = Parrot_gc_headers_alloc_since_last_collect(interp);
+        break;
+      case MEM_ALLOCS_SINCE_COLLECT:
+        ret = Parrot_gc_mem_alloc_since_last_collect(interp);
+        break;
+      case TOTAL_COPIED:
+        ret = Parrot_gc_total_copied(interp);
+        break;
+      case IMPATIENT_PMCS:
+        ret = Parrot_gc_impatient_pmcs(interp);
+        break;
+      case CURRENT_RUNCORE:
+        {
+            STRING *name = interp->run_core->name;
+
+            if (Parrot_str_equal(interp, name, CONST_STRING(interp, "slow")))
+                return PARROT_SLOW_CORE;
+            else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "fast")))
+                return PARROT_FAST_CORE;
+            else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "switch")))
+                return PARROT_SWITCH_CORE;
+            else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "cgp")))
+                return PARROT_CGP_CORE;
+            else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "cgoto")))
+                return PARROT_CGOTO_CORE;
+            else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "exec")))
+                return PARROT_EXEC_CORE;
+            else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "gc_debug")))
+                return PARROT_GC_DEBUG_CORE;
+            else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "debugger")))
+                return PARROT_DEBUGGER_CORE;
+            else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "profiling")))
+                return PARROT_PROFILING_CORE;
+        }
+      default:        /* or a warning only? */
+        ret = -1;
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
                 "illegal argument in interpinfo");
     }
     return ret;
@@ -284,22 +279,22 @@
 {
     ASSERT_ARGS(interpinfo_p)
     switch (what) {
-        case CURRENT_SUB:
-            return CONTEXT(interp)->current_sub;
-        case CURRENT_CONT:
-            {
-            PMC * const cont = CONTEXT(interp)->current_cont;
+      case CURRENT_SUB:
+        return Parrot_pcc_get_sub(interp, CURRENT_CONTEXT(interp));
+      case CURRENT_CONT:
+        {
+            PMC * const cont = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp));
             if (!PMC_IS_NULL(cont) && cont->vtable->base_type ==
                     enum_class_RetContinuation)
                 return VTABLE_clone(interp, cont);
             return cont;
-            }
-        case CURRENT_OBJECT:
-            return CONTEXT(interp)->current_object;
-        case CURRENT_LEXPAD:
-            return CONTEXT(interp)->lex_pad;
-        default:        /* or a warning only? */
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+        }
+      case CURRENT_OBJECT:
+        return Parrot_pcc_get_object(interp, CURRENT_CONTEXT(interp));
+      case CURRENT_LEXPAD:
+        return Parrot_pcc_get_lex_pad(interp, CURRENT_CONTEXT(interp));
+      default:        /* or a warning only? */
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
                 "illegal argument in interpinfo");
     }
 }
@@ -327,7 +322,7 @@
 {
     ASSERT_ARGS(interpinfo_s)
     switch (what) {
-        case EXECUTABLE_FULLNAME:
+      case EXECUTABLE_FULLNAME:
         {
             PMC *exe_name = VTABLE_get_pmc_keyed_int(interp, interp->iglobals,
                     IGLOBALS_EXECUTABLE);
@@ -335,7 +330,7 @@
                 return string_from_literal(interp, "");
             return VTABLE_get_string(interp, exe_name);
         }
-        case EXECUTABLE_BASENAME:
+      case EXECUTABLE_BASENAME:
         {
             STRING *basename;
             PMC    *exe_name = VTABLE_get_pmc_keyed_int(interp,
@@ -346,9 +341,9 @@
 
             else {
                 /* Need to strip back to what follows the final / or \. */
-                STRING *fullname   = VTABLE_get_string(interp, exe_name);
-                char   *fullname_c = Parrot_str_to_cstring(interp, fullname);
-                int     pos        = strlen(fullname_c) - 1;
+                STRING *       fullname   = VTABLE_get_string(interp, exe_name);
+                char   * const fullname_c = Parrot_str_to_cstring(interp, fullname);
+                int            pos        = strlen(fullname_c) - 1;
 
                 while (pos              >  0
                 &&     fullname_c[pos] != '/'
@@ -359,15 +354,15 @@
                     pos++;
 
                 basename = Parrot_str_new(interp, fullname_c + pos, 0);
-                mem_sys_free(fullname_c);
+                Parrot_str_free_cstring(fullname_c);
 
                 return basename;
             }
         }
-        case RUNTIME_PREFIX:
-            return Parrot_get_runtime_path(interp);
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+      case RUNTIME_PREFIX:
+        return Parrot_get_runtime_path(interp);
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
                 "illegal argument in interpinfo");
     }
 }
@@ -398,18 +393,18 @@
 {
     ASSERT_ARGS(sysinfo_i)
     switch (info_wanted) {
-        case PARROT_INTSIZE:
-            return sizeof (INTVAL);
-        case PARROT_FLOATSIZE:
-            return sizeof (FLOATVAL);
-        case PARROT_POINTERSIZE:
-            return sizeof (void *);
-        case PARROT_INTMIN:
-            return PARROT_INTVAL_MIN;
-        case PARROT_INTMAX:
-            return PARROT_INTVAL_MAX;
-        default:
-            return -1;
+      case PARROT_INTSIZE:
+        return sizeof (INTVAL);
+      case PARROT_FLOATSIZE:
+        return sizeof (FLOATVAL);
+      case PARROT_POINTERSIZE:
+        return sizeof (void *);
+      case PARROT_INTMIN:
+        return PARROT_INTVAL_MIN;
+      case PARROT_INTMAX:
+        return PARROT_INTVAL_MAX;
+      default:
+        return -1;
     }
 }
 
@@ -440,33 +435,33 @@
 {
     ASSERT_ARGS(sysinfo_s)
     switch (info_wanted) {
-        case PARROT_OS:
-            return Parrot_str_new_constant(interp, BUILD_OS_NAME);
-        case PARROT_OS_VERSION:
+      case PARROT_OS:
+        return Parrot_str_new_constant(interp, BUILD_OS_NAME);
+      case PARROT_OS_VERSION:
 #ifdef PARROT_HAS_HEADER_SYSUTSNAME
-            {
-                struct utsname info;
-                if (uname(&info) == 0) {
-                    return string_make(interp, info.version, strlen(info.version), "ascii", 0);
-                }
+        {
+            struct utsname info;
+            if (uname(&info) == 0) {
+                return string_make(interp, info.version, strlen(info.version), "ascii", 0);
             }
+        }
 #endif
-            break;
-        case PARROT_OS_VERSION_NUMBER:
+        break;
+      case PARROT_OS_VERSION_NUMBER:
 #ifdef PARROT_HAS_HEADER_SYSUTSNAME
-            {
-                struct utsname info;
-                if (uname(&info) == 0) {
-                    return string_make(interp, info.release, strlen(info.version), "ascii", 0);
-                }
+        {
+            struct utsname info;
+            if (uname(&info) == 0) {
+                return string_make(interp, info.release, strlen(info.version), "ascii", 0);
             }
+        }
 #endif
-            break;
-        case CPU_ARCH:
-            return string_make(interp, PARROT_CPU_ARCH, sizeof (PARROT_CPU_ARCH) - 1, "ascii", 0);
-        case CPU_TYPE:
-        default:
-            break;
+        break;
+      case CPU_ARCH:
+        return string_make(interp, PARROT_CPU_ARCH, sizeof (PARROT_CPU_ARCH) - 1, "ascii", 0);
+      case CPU_TYPE:
+      default:
+        break;
     }
     return string_from_literal(interp, "");
 }

Modified: branches/orderedhash_revamp/src/io/api.c
==============================================================================
--- branches/orderedhash_revamp/src/io/api.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/io/api.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -30,8 +30,8 @@
 #include "parrot/parrot.h"
 #include "io_private.h"
 #include "api.str"
-#include "../pmc/pmc_filehandle.h"
-#include "../pmc/pmc_stringhandle.h"
+#include "pmc/pmc_filehandle.h"
+#include "pmc/pmc_stringhandle.h"
 
 #include <stdarg.h>
 
@@ -151,7 +151,7 @@
         filehandle = pmc;
     }
     else
-        Parrot_PCCINVOKE(interp, new_filehandle, CONST_STRING(interp, "open"), "SS->P", path, mode, &filehandle);
+        Parrot_pcc_invoke_method_from_c_args(interp, new_filehandle, CONST_STRING(interp, "open"), "SS->P", path, mode, &filehandle);
     return filehandle;
 }
 
@@ -212,7 +212,7 @@
 
 PARROT_EXPORT
 INTVAL
-Parrot_io_close(PARROT_INTERP, ARGMOD(PMC *pmc))
+Parrot_io_close(PARROT_INTERP, ARGMOD_NULLOK(PMC *pmc))
 {
     ASSERT_ARGS(Parrot_io_close)
     INTVAL result = 1;
@@ -228,7 +228,7 @@
         SETATTR_StringHandle_read_offset(interp, pmc, 0);
     }
     else
-        Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "close"), "->I", &result);
+        Parrot_pcc_invoke_method_from_c_args(interp, pmc, CONST_STRING(interp, "close"), "->I", &result);
 
     return result;
 }
@@ -283,7 +283,7 @@
         result = STRING_IS_NULL(stringhandle);
     }
     else
-        Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "is_closed"), "->I", &result);
+        Parrot_pcc_invoke_method_from_c_args(interp, pmc, CONST_STRING(interp, "is_closed"), "->I", &result);
 
     return result;
 }
@@ -301,7 +301,7 @@
 
 PARROT_EXPORT
 void
-Parrot_io_flush(PARROT_INTERP, ARGMOD(PMC *pmc))
+Parrot_io_flush(PARROT_INTERP, ARGMOD_NULLOK(PMC *pmc))
 {
     ASSERT_ARGS(Parrot_io_flush)
     if (PMC_IS_NULL(pmc))
@@ -313,7 +313,7 @@
         SETATTR_StringHandle_stringhandle(interp, pmc, NULL);
     }
     else
-        Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "flush"), "->");
+        Parrot_pcc_invoke_method_from_c_args(interp, pmc, CONST_STRING(interp, "flush"), "->");
 }
 
 /*
@@ -385,7 +385,7 @@
         }
     }
     else
-        Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "read"), "I->S", length, &result);
+        Parrot_pcc_invoke_method_from_c_args(interp, pmc, CONST_STRING(interp, "read"), "I->S", length, &result);
     return result;
 }
 
@@ -443,7 +443,7 @@
         SETATTR_StringHandle_read_offset(interp, pmc, newline_pos + 1);
     }
     else
-        Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "readline"), "->S", &result);
+        Parrot_pcc_invoke_method_from_c_args(interp, pmc, CONST_STRING(interp, "readline"), "->S", &result);
     return result;
 }
 
@@ -466,17 +466,14 @@
     ASSERT_ARGS(Parrot_io_write)
     DECL_CONST_CAST;
     INTVAL result;
-    STRING fake;
+    STRING *s;
 
     if (PMC_IS_NULL(pmc))
         return -1;
 
-    fake.strstart = (char *) PARROT_const_cast(void *, buffer);
-    fake.strlen = fake.bufused = length;
-    fake.charset = Parrot_default_charset_ptr;
-    fake.encoding = Parrot_default_encoding_ptr;
+    s = Parrot_str_new(interp, (char *) PARROT_const_cast(void *, buffer), length);
 
-    result = Parrot_io_putps(interp, pmc, &fake);
+    result = Parrot_io_putps(interp, pmc, s);
     return result;
 }
 
@@ -584,7 +581,7 @@
             return 1;
         return 0;
     }
-    Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "eof"), "->I", &result);
+    Parrot_pcc_invoke_method_from_c_args(interp, pmc, CONST_STRING(interp, "eof"), "->I", &result);
     return result;
 }
 
@@ -642,7 +639,7 @@
             result = Parrot_io_write_buffer(interp, pmc, s);
     }
     else
-        Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "puts"), "S->I", s, &result);
+        Parrot_pcc_invoke_method_from_c_args(interp, pmc, CONST_STRING(interp, "puts"), "S->I", s, &result);
 
     return result;
 

Modified: branches/orderedhash_revamp/src/io/buffer.c
==============================================================================
--- branches/orderedhash_revamp/src/io/buffer.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/io/buffer.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -28,8 +28,8 @@
 static INTVAL io_is_end_of_line(ARGIN(const char *c))
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_io_is_end_of_line __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(c)
+#define ASSERT_ARGS_io_is_end_of_line __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(c))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -83,17 +83,17 @@
 
     /* Choose an appropriate buffer size for caller */
     switch (bufsize) {
-        case 0:
-            Parrot_io_set_buffer_size(interp, filehandle, 0);
-            break;
-        case PIO_UNBOUND:
-            Parrot_io_set_buffer_size(interp, filehandle,
+      case 0:
+        Parrot_io_set_buffer_size(interp, filehandle, 0);
+        break;
+      case PIO_UNBOUND:
+        Parrot_io_set_buffer_size(interp, filehandle,
                     PIO_GETBLKSIZE(Parrot_io_get_os_handle(interp, filehandle)));
-            break;
-        default:
-            Parrot_io_set_buffer_size(interp, filehandle,
+        break;
+      default:
+        Parrot_io_set_buffer_size(interp, filehandle,
                     (bufsize >= PIO_GRAIN ? bufsize : PIO_GRAIN));
-            break;
+        break;
     }
 
     buffer_size = Parrot_io_get_buffer_size(interp, filehandle);
@@ -173,9 +173,6 @@
 Parrot_io_flush_buffer(PARROT_INTERP, ARGMOD(PMC *filehandle))
 {
     ASSERT_ARGS(Parrot_io_flush_buffer)
-    long wrote;
-    size_t to_write;
-    STRING fake;
     unsigned char *buffer_start = Parrot_io_get_buffer_start(interp, filehandle);
     unsigned char *buffer_next  = Parrot_io_get_buffer_next(interp, filehandle);
     INTVAL         buffer_flags = Parrot_io_get_buffer_flags(interp, filehandle);
@@ -191,12 +188,10 @@
      * Write flush
      */
     if (buffer_flags & PIO_BF_WRITEBUF) {
-        to_write = buffer_next - buffer_start;
-
+        size_t  to_write = buffer_next - buffer_start;
+        STRING *s        = Parrot_str_new(interp, (char *)buffer_start, to_write);
         /* Flush to next layer */
-        fake.strstart = (char *)buffer_start;
-        fake.bufused = to_write;
-        wrote = PIO_WRITE(interp, filehandle, &fake);
+        long wrote = PIO_WRITE(interp, filehandle, s);
         if (wrote == (long)to_write) {
             Parrot_io_set_buffer_next(interp, filehandle, buffer_start);
             /* Release buffer */
@@ -238,10 +233,9 @@
     STRING  *s    = &fake;
     PIOOFF_T pos  = Parrot_io_get_file_position(interp, filehandle);
 
-    fake.strstart = (char *)Parrot_io_get_buffer_start(interp, filehandle);
-    fake.bufused  = Parrot_io_get_buffer_size(interp, filehandle);
-
-    got           = PIO_READ(interp, filehandle, &s);
+    Buffer_bufstart(s) = Parrot_io_get_buffer_start(interp, filehandle);
+    fake.bufused       = Parrot_io_get_buffer_size(interp, filehandle);
+    got                = PIO_READ(interp, filehandle, &s);
 
     /* buffer-filling does not change fileposition */
     Parrot_io_set_file_position(interp, filehandle, pos);
@@ -352,10 +346,10 @@
             STRING     fake;
             STRING    *sf = &fake;
 
-            fake.strstart = (char *)out_buf;
-            fake.bufused  = len;
-            got           = PIO_READ(interp, filehandle, &sf);
-            s->strlen     = s->bufused = current + got;
+            Buffer_bufstart(sf) = (char *)out_buf;
+            fake.bufused        = len;
+            got                 = PIO_READ(interp, filehandle, &sf);
+            s->strlen           = s->bufused = current + got;
 
             Parrot_io_set_file_position(interp, filehandle,
                     (got + Parrot_io_get_file_position(interp, filehandle)));
@@ -571,7 +565,6 @@
 Parrot_io_write_buffer(PARROT_INTERP, ARGMOD(PMC *filehandle), ARGIN(STRING *s))
 {
     ASSERT_ARGS(Parrot_io_write_buffer)
-    void          * const buffer       = s->strstart;
     unsigned char * const buffer_start = Parrot_io_get_buffer_start(interp, filehandle);
     unsigned char *       buffer_next  = Parrot_io_get_buffer_next(interp, filehandle);
     const size_t          buffer_size  = Parrot_io_get_buffer_size(interp, filehandle);
@@ -602,7 +595,7 @@
 
     if (Parrot_io_get_flags(interp, filehandle) & PIO_F_LINEBUF) {
         /* scan from end, it's likely that EOL is at end of string */
-        const char *p = (char*)buffer + len - 1;
+        const char *p = (char*)(s->strstart) + len - 1;
         size_t      i;
 
         for (i = 0; i < len; ++i, --p) {
@@ -639,7 +632,7 @@
         buffer_flags |= PIO_BF_WRITEBUF;
         Parrot_io_set_buffer_flags(interp, filehandle, buffer_flags);
 
-        memmove(buffer_next, buffer, len);
+        memmove(buffer_next, s->strstart, len);
         buffer_next += len;
         Parrot_io_set_buffer_next(interp, filehandle, buffer_next);
         Parrot_io_set_file_position(interp, filehandle, (len +
@@ -653,7 +646,7 @@
         Parrot_io_set_buffer_flags(interp, filehandle, buffer_flags);
 
         /* Fill remainder, flush, then try to buffer more */
-        memmove(buffer_next, buffer, avail);
+        memmove(buffer_next, s->strstart, avail);
         buffer_next += avail;
         Parrot_io_set_buffer_next(interp, filehandle, buffer_next);
         Parrot_io_set_file_position(interp, filehandle, (avail +
@@ -664,7 +657,7 @@
         Parrot_io_set_buffer_flags(interp, filehandle, buffer_flags);
 
         buffer_next = Parrot_io_get_buffer_next(interp, filehandle);
-        memmove(buffer_start, ((const char *)buffer + avail), diff);
+        memmove(buffer_start, (s->strstart + avail), diff);
 
         buffer_next += diff;
         Parrot_io_set_buffer_next(interp, filehandle, buffer_next);
@@ -698,20 +691,20 @@
     unsigned char *buffer_end   = Parrot_io_get_buffer_end(interp, filehandle);
 
     switch (whence) {
-    case SEEK_SET:
+      case SEEK_SET:
         newpos = offset;
         break;
-    case SEEK_CUR:
+      case SEEK_CUR:
         newpos = file_pos + offset;
         break;
-    case SEEK_END:
+      case SEEK_END:
         newpos = PIO_SEEK(interp, filehandle, offset,
                                whence);
         if (newpos == -1)
             return -1;
 
         break;
-    default:
+      default:
         /* XXX: somehow report the illegal whence value */
         return -1;
     }

Modified: branches/orderedhash_revamp/src/io/core.c
==============================================================================
--- branches/orderedhash_revamp/src/io/core.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/io/core.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -125,9 +125,7 @@
      * to be kept alive AFAIK -leo
      */
     for (i = 0; i < 3; i++) {
-        if (table[i]) {
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)table[i]);
-        }
+        Parrot_gc_mark_PMC_alive(interp, table[i]);
     }
 }
 

Modified: branches/orderedhash_revamp/src/io/filehandle.c
==============================================================================
--- branches/orderedhash_revamp/src/io/filehandle.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/io/filehandle.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -17,7 +17,7 @@
 
 #include "parrot/parrot.h"
 #include "io_private.h"
-#include "../pmc/pmc_filehandle.h"
+#include "pmc/pmc_filehandle.h"
 
 /* HEADERIZER HFILE: include/parrot/io.h */
 
@@ -53,25 +53,25 @@
     for (i = 0; i < mode_len; ++i) {
         INTVAL s = Parrot_str_indexed(interp, mode_str, i);
         switch (s) {
-            case 'r':
-                flags |= PIO_F_READ;
-                break;
-            case 'w':
-                flags |= PIO_F_WRITE;
-                if (!(flags & PIO_F_APPEND)) /* don't truncate if appending */
-                    flags |= PIO_F_TRUNC;
-                break;
-            case 'a':
-                flags |= PIO_F_APPEND;
-                flags |= PIO_F_WRITE;
-                if ((flags & PIO_F_TRUNC)) /* don't truncate if appending */
-                    flags &= ~PIO_F_TRUNC;
-                break;
-            case 'p':
-                flags |= PIO_F_PIPE;
-                break;
-            default:
-                break;
+          case 'r':
+            flags |= PIO_F_READ;
+            break;
+          case 'w':
+            flags |= PIO_F_WRITE;
+            if (!(flags & PIO_F_APPEND)) /* don't truncate if appending */
+                flags |= PIO_F_TRUNC;
+            break;
+          case 'a':
+            flags |= PIO_F_APPEND;
+            flags |= PIO_F_WRITE;
+            if ((flags & PIO_F_TRUNC)) /* don't truncate if appending */
+                flags &= ~PIO_F_TRUNC;
+            break;
+          case 'p':
+            flags |= PIO_F_PIPE;
+            break;
+          default:
+            break;
         }
     }
 

Modified: branches/orderedhash_revamp/src/io/portable.c
==============================================================================
--- branches/orderedhash_revamp/src/io/portable.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/io/portable.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -37,8 +37,8 @@
 static const char * convert_flags_to_stdio(INTVAL flags);
 
 static INTVAL io_is_tty_portable(PIOHANDLE fptr);
-#define ASSERT_ARGS_convert_flags_to_stdio __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_io_is_tty_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
+#define ASSERT_ARGS_convert_flags_to_stdio __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_io_is_tty_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -375,7 +375,7 @@
     ASSERT_ARGS(Parrot_io_read_portable)
     FILE   * const fptr   = (FILE *)Parrot_io_get_os_handle(interp, filehandle);
     STRING * const s      = Parrot_io_make_string(interp, buf, 2048);
-    void   * const buffer = s->strstart;
+    void   * const buffer = Buffer_bufstart(s);
     const   size_t len    = s->bufused;
     const   size_t bytes  = fread(buffer, 1, len, fptr);
 

Modified: branches/orderedhash_revamp/src/io/socket_api.c
==============================================================================
--- branches/orderedhash_revamp/src/io/socket_api.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/io/socket_api.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -21,7 +21,7 @@
 #include "parrot/parrot.h"
 #include "io_private.h"
 #include "api.str"
-#include "../pmc/pmc_socket.h"
+#include "pmc/pmc_socket.h"
 
 #include <stdarg.h>
 

Modified: branches/orderedhash_revamp/src/io/socket_unix.c
==============================================================================
--- branches/orderedhash_revamp/src/io/socket_unix.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/io/socket_unix.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -30,7 +30,7 @@
 
 #include "parrot/parrot.h"
 #include "io_private.h"
-#include "../pmc/pmc_socket.h"
+#include "pmc/pmc_socket.h"
 
 #ifdef PIO_OS_UNIX
 
@@ -49,10 +49,10 @@
         __attribute__nonnull__(2)
         __attribute__nonnull__(3);
 
-#define ASSERT_ARGS_get_sockaddr_in __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_get_sockaddr_in __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sockaddr) \
-    || PARROT_ASSERT_ARG(host)
+    , PARROT_ASSERT_ARG(sockaddr) \
+    , PARROT_ASSERT_ARG(host))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -105,7 +105,7 @@
     PMC  * const sockaddr = pmc_new(interp, enum_class_Sockaddr);
 
     get_sockaddr_in(interp, sockaddr, s, port);
-    free(s);
+    Parrot_str_free_cstring(s);
     return sockaddr;
 }
 
@@ -166,14 +166,14 @@
     if ((connect(io->os_handle, (struct sockaddr *)SOCKADDR_REMOTE(socket),
             sizeof (struct sockaddr_in))) != 0) {
         switch (errno) {
-            case EINTR:
-                goto AGAIN;
-            case EINPROGRESS:
-                goto AGAIN;
-            case EISCONN:
-                return 0;
-            default:
-                return -1;
+          case EINTR:
+            goto AGAIN;
+          case EINPROGRESS:
+            goto AGAIN;
+          case EISCONN:
+            return 0;
+          default:
+            return -1;
         }
     }
 
@@ -312,21 +312,21 @@
     }
     else {
         switch (errno) {
-            case EINTR:
-                goto AGAIN;
+          case EINTR:
+            goto AGAIN;
 #    ifdef EWOULDBLOCK
-            case EWOULDBLOCK:
-                goto AGAIN;
+          case EWOULDBLOCK:
+            goto AGAIN;
 #    else
-            case EAGAIN:
-                goto AGAIN;
+          case EAGAIN:
+            goto AGAIN;
 #    endif
-            case EPIPE:
-                /* XXX why close it here and not below */
-                close(io->os_handle);
-                return -1;
-            default:
-                return -1;
+          case EPIPE:
+            /* XXX why close it here and not below */
+            close(io->os_handle);
+            return -1;
+          default:
+            return -1;
         }
     }
 }
@@ -361,24 +361,24 @@
     }
     else {
         switch (errno) {
-            case EINTR:
-                goto AGAIN;
+          case EINTR:
+            goto AGAIN;
 #    ifdef EWOULDBLOCK
-            case EWOULDBLOCK:
-                goto AGAIN;
+          case EWOULDBLOCK:
+            goto AGAIN;
 #    else
-            case EAGAIN:
-                goto AGAIN;
+          case EAGAIN:
+            goto AGAIN;
 #    endif
-            case ECONNRESET:
-                /* XXX why close it on err return result is -1 anyway */
-                close(io->os_handle);
-                *s = Parrot_str_new_noinit(interp, enum_stringrep_one, 0);
-                return -1;
-            default:
-                close(io->os_handle);
-                *s = Parrot_str_new_noinit(interp, enum_stringrep_one, 0);
-                return -1;
+          case ECONNRESET:
+            /* XXX why close it on err return result is -1 anyway */
+            close(io->os_handle);
+            *s = Parrot_str_new_noinit(interp, enum_stringrep_one, 0);
+            return -1;
+          default:
+            close(io->os_handle);
+            *s = Parrot_str_new_noinit(interp, enum_stringrep_one, 0);
+            return -1;
         }
     }
 }
@@ -392,12 +392,12 @@
 
 Returns a 1 | 2 | 4 (read, write, error) value.
 
-This is not equivalent to any speficic POSIX or BSD socket call, however
+This is not equivalent to any specific POSIX or BSD socket call, but
 it is a useful, common primitive.
 
 Not at all usefule --leo.
 
-Also, a buffering layer above this may choose to reimpliment by checking
+Also, a buffering layer above this may choose to reimplement by checking
 the read buffer.
 
 =cut

Modified: branches/orderedhash_revamp/src/io/socket_win32.c
==============================================================================
--- branches/orderedhash_revamp/src/io/socket_win32.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/io/socket_win32.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -28,7 +28,7 @@
 
 #include "parrot/parrot.h"
 #include "io_private.h"
-#include "../pmc/pmc_socket.h"
+#include "pmc/pmc_socket.h"
 
 #ifdef PIO_OS_WIN32
 
@@ -44,10 +44,10 @@
         __attribute__nonnull__(2)
         __attribute__nonnull__(3);
 
-#define ASSERT_ARGS_get_sockaddr_in __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_get_sockaddr_in __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sockaddr) \
-    || PARROT_ASSERT_ARG(host)
+    , PARROT_ASSERT_ARG(sockaddr) \
+    , PARROT_ASSERT_ARG(host))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -77,8 +77,8 @@
 Parrot_io_socket_win32(PARROT_INTERP, ARGIN(PMC * s), int fam, int type, int proto)
 {
     ASSERT_ARGS(Parrot_io_socket_win32)
-    int sock, i = 1;
-    sock = socket(fam, type, proto);
+    int       i    = 1;
+    const int sock = socket(fam, type, proto);
     if (sock >= 0) {
         setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (const char*)&i, sizeof (i));
         Parrot_io_set_os_handle(interp, s, sock);
@@ -113,14 +113,14 @@
     if ((connect((int)io->os_handle, (struct sockaddr *)SOCKADDR_REMOTE(socket),
             sizeof (struct sockaddr_in))) != 0) {
         switch (errno) {
-            case WSAEINTR:
-                goto AGAIN;
-            case WSAEINPROGRESS:
-                goto AGAIN;
-            case WSAEISCONN:
-                return 0;
-            default:
-                return -1;
+          case WSAEINTR:
+            goto AGAIN;
+          case WSAEINPROGRESS:
+            goto AGAIN;
+          case WSAEISCONN:
+            return 0;
+          default:
+            return -1;
         }
     }
 
@@ -259,21 +259,21 @@
     }
     else {
         switch (errno) {
-            case WSAEINTR:
-                goto AGAIN;
+          case WSAEINTR:
+            goto AGAIN;
 #    ifdef WSAEWOULDBLOCK
-            case WSAEWOULDBLOCK:
-                goto AGAIN;
+          case WSAEWOULDBLOCK:
+            goto AGAIN;
 #    else
-            case WSAEAGAIN:
-                goto AGAIN;
+          case WSAEAGAIN:
+            goto AGAIN;
 #    endif
-            case EPIPE:
-                /* XXX why close it here and not below */
-                close((int)io->os_handle);
-                return -1;
-            default:
-                return -1;
+          case EPIPE:
+            /* XXX why close it here and not below */
+            close((int)io->os_handle);
+            return -1;
+          default:
+            return -1;
         }
     }
 }
@@ -308,24 +308,24 @@
     }
     else {
         switch (errno) {
-            case EINTR:
-                goto AGAIN;
+          case EINTR:
+            goto AGAIN;
 #    ifdef WSAEWOULDBLOCK
-            case WSAEWOULDBLOCK:
-                goto AGAIN;
+          case WSAEWOULDBLOCK:
+            goto AGAIN;
 #    else
-            case WSAEAGAIN:
-                goto AGAIN;
+          case WSAEAGAIN:
+            goto AGAIN;
 #    endif
-            case WSAECONNRESET:
-                /* XXX why close it on err return result is -1 anyway */
-                close((int)io->os_handle);
-                *s = Parrot_str_new_noinit(interp, enum_stringrep_one, 0);
-                return -1;
-            default:
-                close((int)io->os_handle);
-                *s = Parrot_str_new_noinit(interp, enum_stringrep_one, 0);
-                return -1;
+          case WSAECONNRESET:
+            /* XXX why close it on err return result is -1 anyway */
+            close((int)io->os_handle);
+            *s = Parrot_str_new_noinit(interp, enum_stringrep_one, 0);
+            return -1;
+          default:
+            close((int)io->os_handle);
+            *s = Parrot_str_new_noinit(interp, enum_stringrep_one, 0);
+            return -1;
         }
     }
 }
@@ -339,12 +339,12 @@
 
 Returns a 1 | 2 | 4 (read, write, error) value.
 
-This is not equivalent to any speficic POSIX or BSD socket call, however
+This is not equivalent to any specific POSIX or BSD socket call, but
 it is a useful, common primitive.
 
 Not at all usefule --leo.
 
-Also, a buffering layer above this may choose to reimpliment by checking
+Also, a buffering layer above this may choose to reimplement by checking
 the read buffer.
 
 =cut
@@ -443,13 +443,11 @@
 Parrot_io_sockaddr_in(PARROT_INTERP, ARGIN(STRING *addr), INTVAL port)
 {
     ASSERT_ARGS(Parrot_io_sockaddr_in)
-    PMC * sockaddr;
-    char * s;
-
-    s = Parrot_str_to_cstring(interp, addr);
+    PMC  * sockaddr;
+    char * const s = Parrot_str_to_cstring(interp, addr);
     sockaddr = pmc_new(interp, enum_class_Sockaddr);
     get_sockaddr_in(interp, sockaddr, s, port);
-    free(s);
+    Parrot_str_free_cstring(s);
     return sockaddr;
 }
 

Modified: branches/orderedhash_revamp/src/io/unix.c
==============================================================================
--- branches/orderedhash_revamp/src/io/unix.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/io/unix.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -30,6 +30,7 @@
 
 #include "parrot/parrot.h"
 #include "io_private.h"
+#include "pmc/pmc_filehandle.h"
 
 #ifdef PIO_OS_UNIX
 
@@ -46,8 +47,8 @@
 static int convert_flags_to_unix(INTVAL flags);
 
 static INTVAL io_is_tty_unix(PIOHANDLE fd);
-#define ASSERT_ARGS_convert_flags_to_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_io_is_tty_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
+#define ASSERT_ARGS_convert_flags_to_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_io_is_tty_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -352,6 +353,13 @@
         if (flags & PIO_F_PIPE) {
             int status;
             waitpid(VTABLE_get_integer_keyed_int(interp, filehandle, 0), &status, 0);
+            if (WIFEXITED(status)) {
+                SETATTR_FileHandle_exit_status(interp, filehandle, WEXITSTATUS(status));
+            }
+            else {
+                /* abnormal termination means non-zero exit status */
+                SETATTR_FileHandle_exit_status(interp, filehandle, 1);
+            }
         }
     }
     Parrot_io_set_os_handle(interp, filehandle, -1);
@@ -502,7 +510,7 @@
     STRING * const s = Parrot_io_make_string(interp, buf, 2048);
 
     const size_t len = s->bufused;
-    void * const buffer = s->strstart;
+    void * const buffer = Buffer_bufstart(s);
 
     for (;;) {
         const int bytes = read(file_descriptor, buffer, len);
@@ -512,9 +520,9 @@
         }
         else if (bytes < 0) {
             switch (errno) {
-            case EINTR:
+              case EINTR:
                 continue;
-            default:
+              default:
                 s->bufused = s->strlen = 0;
                 return bytes;
             }
@@ -551,7 +559,7 @@
     size_t to_write = s->bufused;
     size_t written  = 0;
 
-    write_through:
+  write_through:
     while (to_write > 0) {
         const int err = write(file_descriptor, ptr, to_write);
         if (err >= 0) {
@@ -599,24 +607,24 @@
 
     if (pos >= 0) {
         switch (whence) {
-            case SEEK_SET:
-                if (offset > Parrot_io_get_file_size(interp, filehandle)) {
-                    Parrot_io_set_file_size(interp, filehandle, offset);
-                }
-                break;
-            case SEEK_CUR:
-                {
-                    const PIOOFF_T avail = offset
-                            + Parrot_io_get_buffer_next(interp, filehandle)
-                            - Parrot_io_get_buffer_start(interp, filehandle);
-                    if (avail > Parrot_io_get_file_size(interp, filehandle)) {
-                        Parrot_io_set_file_size(interp, filehandle, avail);
-                    }
+          case SEEK_SET:
+            if (offset > Parrot_io_get_file_size(interp, filehandle)) {
+                Parrot_io_set_file_size(interp, filehandle, offset);
+            }
+            break;
+          case SEEK_CUR:
+            {
+                const PIOOFF_T avail = offset
+                        + Parrot_io_get_buffer_next(interp, filehandle)
+                        - Parrot_io_get_buffer_start(interp, filehandle);
+                if (avail > Parrot_io_get_file_size(interp, filehandle)) {
+                    Parrot_io_set_file_size(interp, filehandle, avail);
                 }
-                break;
-            case SEEK_END:
-            default:
-                break;
+             }
+            break;
+          case SEEK_END:
+          default:
+            break;
         }
 
         Parrot_io_set_file_position(interp, filehandle, pos);
@@ -756,7 +764,7 @@
     }
 
 #  else
-    UNUSED(l);
+    UNUSED(filehandle);
     UNUSED(command);
     UNUSED(flags);
     Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,

Modified: branches/orderedhash_revamp/src/io/utf8.c
==============================================================================
--- branches/orderedhash_revamp/src/io/utf8.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/io/utf8.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -80,8 +80,8 @@
                 s2->charset  = Parrot_unicode_charset_ptr;
                 s2->encoding = Parrot_utf8_encoding_ptr;
 
-                /* RT#46413 need to check the amount read here? */
-                read         = Parrot_io_read_buffer(interp, filehandle, &s2);
+                /* TT #1257: need to check the amount read here? */
+                read = Parrot_io_read_buffer(interp, filehandle, &s2);
                 UNUSED(read);
 
                 s->strlen    = iter.charpos;

Modified: branches/orderedhash_revamp/src/io/win32.c
==============================================================================
--- branches/orderedhash_revamp/src/io/win32.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/io/win32.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -27,6 +27,7 @@
 #endif
 
 #include "parrot/parrot.h"
+#include "pmc/pmc_filehandle.h"
 #include "io_private.h"
 
 #ifdef PIO_OS_WIN32
@@ -50,11 +51,11 @@
 PARROT_WARN_UNUSED_RESULT
 static INTVAL io_is_tty_win32(PIOHANDLE fd);
 
-#define ASSERT_ARGS_convert_flags_to_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_convert_flags_to_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(fdwAccess) \
-    || PARROT_ASSERT_ARG(fdwShareMode) \
-    || PARROT_ASSERT_ARG(fdwCreate)
-#define ASSERT_ARGS_io_is_tty_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
+    , PARROT_ASSERT_ARG(fdwShareMode) \
+    , PARROT_ASSERT_ARG(fdwCreate))
+#define ASSERT_ARGS_io_is_tty_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -336,10 +337,17 @@
         if (CloseHandle(os_handle) == 0)
             result = GetLastError();
         Parrot_io_set_os_handle(interp, filehandle, INVALID_HANDLE_VALUE);
+
         if (flags & PIO_F_PIPE) {
-            INTVAL procid =  VTABLE_get_integer_keyed_int(interp, filehandle, 0);
+            INTVAL procid  = VTABLE_get_integer_keyed_int(interp, filehandle, 0);
             HANDLE process = (HANDLE) procid;
-            WaitForSingleObject(process, INFINITE);
+            DWORD  status  = WaitForSingleObject(process, INFINITE);
+            DWORD  exit_code;
+
+            if (status != WAIT_FAILED && GetExitCodeProcess(process, &exit_code))
+                SETATTR_FileHandle_exit_status(interp, filehandle, exit_code);
+            else
+                SETATTR_FileHandle_exit_status(interp, filehandle, 1);
             CloseHandle(process);
         }
     }
@@ -439,7 +447,7 @@
 
     s = Parrot_io_make_string(interp, buf, 2048);
     len = s->bufused;
-    buffer = s->strstart;
+    buffer = Buffer_bufstart(s);
 
     if (ReadFile(Parrot_io_get_os_handle(interp, filehandle),
                 (LPVOID) buffer, (DWORD) len, &countread, NULL)) {
@@ -693,8 +701,6 @@
             NULL, NULL, TRUE, 0,
             NULL, NULL, &start, &procinfo) == 0)
         goto fail;
-    Parrot_str_free_cstring(cmd);
-    cmd = NULL;
     if (f_read) {
         Parrot_io_set_os_handle(interp, io, hread);
         CloseHandle(hwrite);
@@ -703,6 +709,8 @@
         Parrot_io_set_os_handle(interp, io, hwrite);
         CloseHandle(hread);
     }
+
+    Parrot_str_free_cstring(cmd);
     CloseHandle(procinfo.hThread);
     VTABLE_set_integer_keyed_int(interp, io, 0, (INTVAL)procinfo.hProcess);
     return io;

Deleted: branches/orderedhash_revamp/src/jit.c
==============================================================================
--- branches/orderedhash_revamp/src/jit.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,1858 +0,0 @@
-/*
-Copyright (C) 2001-2009, Parrot Foundation.
-$Id$
-
-=head1 NAME
-
-src/jit.c - JIT
-
-=head1 DESCRIPTION
-
-JIT (Just In Time) compilation converts bytecode to native machine code
-instructions and executes the generated instruction sequence directly.
-
-Actually it's not really just in time, it's just before this piece of code is
-used and not per subroutine or even opcode, it works per bytecode segment.
-
-=head2 Functions
-
-=over 4
-
-=cut
-
-*/
-
-/* HEADERIZER HFILE: none */
-/* HEADERIZER STOP */
-
-#include <parrot/parrot.h>
-#if PARROT_EXEC_CAPABLE
-#  include "parrot/exec.h"
-#endif
-#include "jit.h"
-#define JIT_EMIT 0
-#include "jit_emit.h"
-#include "parrot/packfile.h"
-#include "parrot/oplib/ops.h"
-#include "pmc/pmc_sub.h"
-#include "pmc/pmc_managedstruct.h"
-
-#define JIT_SEGS 0
-
-extern int jit_op_count(void);
-/*
- * s. jit/$jitcpuarch/jit_emit.h for the meaning of these defs
- */
-
-#ifndef ALLOCATE_REGISTERS_PER_SECTION
-#  define ALLOCATE_REGISTERS_PER_SECTION 1
-#endif
-
-#if defined __GNUC__ || defined __IBMC__
-void Parrot_jit_debug(PARROT_INTERP);
-#endif
-
-/*
-
-=item C<static void
-insert_fixup_targets(PARROT_INTERP, char *branch,
-        size_t limit)>
-
-Look at fixups, mark all fixup entries as branch target.
-
-TODO: actually this is wrong: fixups belong only to one code segment.
-The code below doesn't check, for which segments the fixups are
-inserted.
-
-=cut
-
-*/
-
-static void
-insert_fixup_targets(PARROT_INTERP, char *branch,
-        size_t limit)
-{
-    PackFile_FixupTable *ft = interp->code->fixups;
-    int i;
-
-    if (!ft)
-        return;
-
-    for (i = 0; i < ft->fixup_count; i++) {
-        if (ft->fixups[i]->type == enum_fixup_label) {
-            if ((size_t)ft->fixups[i]->offset < limit)
-                branch[ft->fixups[i]->offset] |= JIT_BRANCH_TARGET;
-        }
-    }
-}
-
-/*
-
-=item C<static void
-make_branch_list(PARROT_INTERP,
-        Parrot_jit_optimizer_t * optimizer,
-        opcode_t *code_start, opcode_t *code_end)>
-
-C<< optimizer->map_branch >> parallels the opcodes with a list of
-branch information and register mapping information
-
-=over 4
-
-=item branch instructions have C<JIT_BRANCH_SOURCE>
-
-=item opcodes jumped to have C<JIT_BRANCH_TARGET>
-
-=item mapped arguments have register type + 1 and finally
-
-=item after register allocation these have the processor register that
-got mapped
-
-=back
-
-=cut
-
-*/
-
-static void
-make_branch_list(PARROT_INTERP,
-        Parrot_jit_optimizer_t * optimizer,
-         opcode_t *code_start, opcode_t *code_end)
-{
-    op_info_t *op_info;
-    char *branch;
-    opcode_t *cur_op;
-
-    cur_op = code_start;
-
-    /* Allocate space for the branch information and register map */
-    optimizer->map_branch = branch =
-        (char *)mem_sys_allocate_zeroed((size_t)(code_end - code_start + 1));
-
-    /* Allocate space for the branch list */
-    optimizer->branch_list = (opcode_t **)
-        mem_sys_allocate_zeroed(
-                (size_t)(code_end - code_start) * sizeof (opcode_t *));
-
-    /* If the opcode jumps we may:
-     *
-     * PARROT_JUMP_RELATIVE:
-     *      The op jumps to an address relative to the current position,
-     *      thus we mark the branch target and the branch source.
-     *
-     * PARROT_JUMP_ADDRESS:
-     *      The op jumps to an absolute address, thus we mark the branch
-     *      target.
-     *
-     * PARROT_JUMP_POP:
-     *      The op pops the address to jump to, thus we don't mark the
-     *      branch target, anyway it may probably use expr(NEXT)
-     *
-     * PARROT_JUMP_ENEXT:
-     *      The op does something with expr(NEXT),
-     *      XXX I'll assume that it's stored in the control stack for
-     *          later returning since that's the only way it's used now
-     *          but this should go away by the time we add some metadata
-     *          to the ops.
-     *      So we will mark the branch target.
-     *
-     * PARROT_JUMP_GNEXT:
-     *      Means the opcode does some other kind of jump, and also
-     *      might goto(NEXT)
-     *
-     * PARROT_JUMP_UNPREDICTABLE:
-     *      The branch target is unpredictable.
-     *      Things get a little tricky since it's not 100% true that the
-     *      target is unpredictable because of the set_addr opcode, we
-     *      need to find a solution for this, in the mean time, we will
-     *      make each section have its own arena and try to avoid
-     *      going in and out from them as much as possible.
-     *
-     *  PARROT_JUMP_RESTART
-     *      If the parrot program counter is zero, fall out of the
-     *      run loop.
-     *
-     */
-
-    while (cur_op < code_end) {
-        opcode_t op = *cur_op;
-        int i, n;
-        size_t rel_offset;
-
-
-        /* Predereference the opcode information table for this opcode
-         * early since it's going to be used many times */
-        op_info = &interp->op_info_table[op];
-
-        /* if op_info->jump is not 0 this opcode may jump,
-         * so mark this opcode as a branch source */
-        rel_offset = cur_op - code_start;
-
-        n = op_info->op_count;
-
-        if (op == PARROT_OP_set_args_pc ||
-                op == PARROT_OP_set_returns_pc ||
-                op == PARROT_OP_get_results_pc)
-            goto no_branch;
-        if (op_info->jump)
-            branch[rel_offset] |= JIT_BRANCH_SOURCE;
-        for (i = 1; i < n; ++i) {
-            /* If it's not a constant, no joy */
-            if (op_info->types[i-1] == PARROT_ARG_IC && op_info->labels[i-1]) {
-                /* The branch target is relative,
-                 * the offset is in the i argument
-                 */
-                if (op_info->jump & PARROT_JUMP_RELATIVE) {
-                    /* Set the branch target */
-                    optimizer->branch_list[rel_offset] = cur_op + cur_op[i];
-                    branch[rel_offset + cur_op[i]] |= JIT_BRANCH_TARGET;
-                }
-                /* The branch target is absolute,
-                 * the address is in the i argument
-                 */
-                else if (op_info->jump & PARROT_JUMP_ADDRESS) {
-                    /* Set the branch target */
-                    optimizer->branch_list[rel_offset] = cur_op + cur_op[i];
-                    branch[cur_op[i]] |= JIT_BRANCH_TARGET;
-                }
-                /* the labels of set_addr and newsub are branch targets too
-                 * this is needed e.g. for JIT_CGP
-                 */
-                else {
-                    branch[rel_offset + cur_op[i]] |= JIT_BRANCH_TARGET;
-                }
-            }
-        }
-        /* The address of the next opcode */
-        if ((op_info->jump & PARROT_JUMP_ENEXT) ||
-            (op_info->jump & PARROT_JUMP_GNEXT))
-            branch[rel_offset + n] |= JIT_BRANCH_TARGET;
-        if (op_info->jump & PARROT_JUMP_UNPREDICTABLE) {
-            /*
-             * TODO
-             *   this flag is currently not used or set
-             *   and: if we have a branch that isn't going to a constant
-             *   target like a calculated branch used by rx_ opcodes
-             *   we are totally lost WRT register preservation.
-             *   If we don't know, that the code is a branch target, inside
-             *   a JITted code section, mapped registers might be
-             *   not up to date WRT Parrot registers.
-             */
-            optimizer->has_unpredictable_jump = 1;
-        }
-no_branch:
-        /* Move to the next opcode */
-        ADD_OP_VAR_PART(interp, interp->code, cur_op, n);
-        cur_op += n;
-    }
-    insert_fixup_targets(interp, branch, code_end - code_start);
-}
-
-/*
-
-=item C<static void
-set_register_usage(PARROT_INTERP,
-        Parrot_jit_info_t *jit_info,
-        Parrot_jit_optimizer_section_ptr cur_section,
-        op_info_t *op_info, opcode_t *cur_op, opcode_t *code_start)>
-
-Sets the register usage counts.
-
-=cut
-
-*/
-
-static void
-set_register_usage(PARROT_INTERP,
-        Parrot_jit_info_t *jit_info,
-        Parrot_jit_optimizer_section_ptr cur_section,
-        op_info_t *op_info, opcode_t *cur_op, opcode_t *code_start)
-{
-    int argn, args, argt;
-    int typ;
-    Parrot_jit_register_usage_t *ru = cur_section->ru;
-    Parrot_jit_optimizer_t * optimizer = jit_info->optimizer;
-    char * const map = optimizer->map_branch;
-
-    /* For each argument that has the opcode increment the usage count,
-     * We move from the end since we need to check if the first opcode
-     * using the register will read or write it.
-     *
-     * registers are set per their type [IPSN]
-     * */
-    args = argt = op_info->op_count;
-    ADD_OP_VAR_PART(interp, interp->code, cur_op, argt);
-    for (argn = argt - 1; argn > 0; argn--) {
-        /* TODO check the argn-1 entries */
-        int idx = *(cur_op + argn);
-        int arg_type;
-        PMC *sig;
-        if (argn >= args) {
-            sig = CONTEXT(interp)->constants[cur_op[1]]->u.key;
-            arg_type = VTABLE_get_integer_keyed_int(interp,
-                    sig, argn - args);
-            arg_type &= (PARROT_ARG_TYPE_MASK | PARROT_ARG_CONSTANT);
-        }
-        else
-            arg_type = op_info->types[argn - 1];
-
-        switch (arg_type) {
-            case PARROT_ARG_I:
-            case PARROT_ARG_KI:
-                typ = 0;
-                /*
-                 * if the register number is negative, the register mapping
-                 * was done by imcc/jit.c, which used negative numbers
-                 * for allocated CPU registers. That's currently not
-                 * functional because of changed register allocation
-                 * strategy inside imcc.
-                 * The code is still here and should probably be reactivated
-                 * later, when things are stable: imcc has all the
-                 * necessary information like basic blocks and loop depth
-                 * calculated already. A lot is duplicated here to regain this
-                 * information.
-                 */
-                if (idx < 0)
-                    idx = -1 - idx;
-                break;
-            case PARROT_ARG_P:
-            case PARROT_ARG_K:
-                /*
-                 * P and S regs aren't currently used at all. That's not
-                 * really optimal. If we have plenty of mappable registers
-                 * and if we can call vtables or MMD functions directly
-                 * we should finally allocate P and S regs too.
-                 */
-                typ = 1;
-                break;
-            case PARROT_ARG_S:
-                typ = 2;
-                break;
-            case PARROT_ARG_N:
-                if (idx < 0)
-                    idx = -1 - idx;
-                typ = 3;
-                break;
-            default:
-                typ = -1;
-                break;
-        }
-        /*
-         * JIT structures are NUM_REGISTERS big
-         * we can currently allocate only that much
-         */
-        if (typ >= 0 && idx < NUM_REGISTERS) {
-            /* remember the register typ (+1) for this op argument
-             * for register allocation */
-            map[cur_op + argn - code_start] = typ + 1;
-            if ((!ru[typ].reg_count[idx]++) &&
-                (op_info->dirs[argn-1] & PARROT_ARGDIR_IN))
-                ru[typ].reg_dir[idx] |= PARROT_ARGDIR_IN;
-            if (op_info->dirs[argn-1] & PARROT_ARGDIR_OUT) {
-                ru[typ].reg_dir[idx] |= PARROT_ARGDIR_OUT;
-            }
-        }
-        /* key constants may have register keys */
-        else if (arg_type == PARROT_ARG_KC) {
-            PMC *key = interp->code->const_table->constants[idx]->u.key;
-            while (key) {
-                const UINTVAL flags = PObj_get_FLAGS(key);
-                if (flags & KEY_register_FLAG) {
-                    INTVAL n = 0;
-                    if (flags & KEY_integer_FLAG) {
-                        n = VTABLE_get_integer(interp, key);
-                        typ = 0;
-                        if (n < 0)
-                            n = -1 - n;
-                    }
-                    else if (flags & KEY_pmc_FLAG)
-                        typ = 1;
-                    else if (flags & KEY_string_FLAG)
-                        typ = 2;
-
-                    if (n < NUM_REGISTERS && !ru[typ].reg_count[n]++)
-                        ru[typ].reg_dir[n] |= PARROT_ARGDIR_IN;
-                }
-                key = VTABLE_shift_pmc(interp, key);
-            }
-        }
-    }
-}
-
-/*
-
-=item C<static void
-init_regusage(PARROT_INTERP,
-        Parrot_jit_optimizer_section_ptr cur_section)>
-
-Init all register usage to Parrot register usage. Used when JITting
-subroutines to registers only
-
-=cut
-
-*/
-
-static void
-init_regusage(PARROT_INTERP, Parrot_jit_optimizer_section_ptr cur_section)
-{
-    int typ;
-
-    cur_section->ru[0].registers_used = CONTEXT(interp)->n_regs_used[REGNO_INT];
-    cur_section->ru[3].registers_used = CONTEXT(interp)->n_regs_used[REGNO_NUM];
-    cur_section->ru[1].registers_used = cur_section->ru[2].registers_used = 0;
-
-    for (typ = 0; typ < 4; typ++) {
-        int j;
-        for (j = 0; j < cur_section->ru[typ].registers_used; j++)
-            cur_section->ru[typ].reg_usage[j] = j;
-    }
-}
-
-/*
-
-=item C<static void make_sections(PARROT_INTERP,
-        Parrot_jit_info_t *jit_info,
-        opcode_t *code_start, opcode_t *code_end)>
-
-I386 has JITed vtables, which have the vtable# in extcall.
-
-This C<Parrot_jit_vtable_n_op()> does use register mappings.
-
-=cut
-
-*/
-
-#ifndef EXTCALL
-#  define EXTCALL(op) (op_jit[(op)].extcall >= 1 || (op) >= jit_op_count())
-#  define CALLS_C_CODE(op) (op_func[(op)].extcall == -1)
-#endif
-
-static void
-make_sections(PARROT_INTERP,
-        Parrot_jit_info_t *jit_info,
-         opcode_t *code_start, opcode_t *code_end)
-{
-    Parrot_jit_optimizer_section_ptr cur_section, t_section, prev_section;
-    opcode_t *next_op;
-    op_info_t *op_info;
-    char *branch;
-    int branched, start_new;
-    opcode_t *cur_op;
-    Parrot_jit_optimizer_t * optimizer;
-
-    optimizer = jit_info->optimizer;
-    branch = optimizer->map_branch;
-
-    /* Allocate the first section */
-    cur_section = optimizer->sections = (Parrot_jit_optimizer_section_t *)
-        mem_sys_allocate_zeroed(sizeof (Parrot_jit_optimizer_section_t));
-    cur_section->begin = code_start;
-    prev_section = cur_section;
-
-    cur_op = code_start;
-    /* set all regs to Parrot's */
-    if (jit_info->code_type == JIT_CODE_SUB_REGS_ONLY)
-        init_regusage(interp, cur_section);
-    while (cur_section) {
-        opcode_t op = *cur_op;
-        branched = start_new = 0;
-        /* Predereference the opcode information for this opcode
-         * early since it's going to be used many times */
-        op_info = &interp->op_info_table[op];
-
-        /* Calculate the next pc */
-        next_op = cur_op + op_info->op_count;
-        ADD_OP_VAR_PART(interp, interp->code, cur_op, next_op);
-
-        /* Update op_count */
-        cur_section->op_count++;
-
-        /* set register usage for this section */
-        set_register_usage(interp, jit_info, cur_section,
-                op_info, cur_op, code_start);
-
-        /*
-         * End a section:
-         * If this opcode is jitted and next is a C function */
-        if (!EXTCALL(op)) {
-            cur_section->jit_op_count++;
-
-            if (next_op < code_end && EXTCALL(*next_op))
-                start_new = 1;
-        }
-        else
-            /* or if current section is not jitted, and the next opcode
-             * is. */
-            if (next_op < code_end && !EXTCALL(*next_op))
-                start_new = 1;
-
-        /* or when the current opcode is a branch source,
-         * in other words if the opcode jumps, or if the next opcode is
-         * a branch target, allocate a new section only if it's not the
-         * last opcode */
-        if ((branch[cur_op - code_start] & JIT_BRANCH_SOURCE)
-                || (next_op < code_end &&
-                    (branch[next_op - code_start] & JIT_BRANCH_TARGET))
-                || (next_op >= code_end)) {
-            /* remember to start a new block */
-            branched = 1;
-            start_new = 1;
-        }
-
-        if (start_new) {
-            /* Set the type, depending on whether the current
-             * instruction is external or jitted. */
-            cur_section->isjit = !EXTCALL(op);
-
-            /* Save the address where the section ends */
-            cur_section->end = cur_op;
-
-            if (next_op < code_end) {
-                /* Allocate a new section */
-                t_section = (Parrot_jit_optimizer_section_t *)
-                    mem_sys_allocate_zeroed(
-                            sizeof (Parrot_jit_optimizer_section_t));
-                /* Add it to the double linked list */
-                cur_section->next = t_section;
-                t_section->prev = cur_section;
-                /* Make the new section be the current one */
-                cur_section = t_section;
-                /* set all regs to Parrot's */
-                if (jit_info->code_type == JIT_CODE_SUB_REGS_ONLY)
-                    init_regusage(interp, cur_section);
-
-                /* registers get either allocated per section or
-                 * per basic block (i.e. one or more sections divided
-                 * by branches. When allocation per block is done
-                 * all sections in one block have the same block number
-                 */
-                if (ALLOCATE_REGISTERS_PER_SECTION || branched) {
-                    cur_section->block = prev_section->block + 1;
-                    prev_section = cur_section;
-                }
-                else
-                    cur_section->block = prev_section->block;
-                /* Save the address where the section begins */
-                cur_section->begin = next_op;
-            }
-            else {
-                cur_section = NULL;
-            }
-        }
-
-        /* Move to the next opcode */
-        cur_op = next_op;
-    }
-}
-
-/*
-
-=item C<static void
-make_branch_targets(
-        Parrot_jit_optimizer_t *optimizer, opcode_t * code_start)>
-
-Makes the branch targets.
-
-=cut
-
-*/
-
-static void
-make_branch_targets(Parrot_jit_optimizer_t *optimizer, const opcode_t * code_start)
-{
-    Parrot_jit_optimizer_section_ptr cur_section, t_section;
-    /* Set the branch target of this section, that is the section where
-     * the program execution continues, if it ends in a branch source we
-     * use the branch target and not the next section. */
-    cur_section = optimizer->sections;
-    while (cur_section) {
-        if (optimizer->branch_list[cur_section->end - code_start]) {
-            /* If the branch target is to a section before the current one
-             * move from the start, otherwise from the current section */
-            if (optimizer->branch_list[cur_section->end - code_start] <
-                    cur_section->begin)
-                t_section = optimizer->sections;
-            else
-                t_section = cur_section;
-
-            while (t_section) {
-                /* If we find the section attach it to the current one. */
-                if (t_section->begin ==
-                        optimizer->branch_list[cur_section->end - code_start]) {
-                    cur_section->branch_target = t_section;
-                    break;
-                }
-                /* If not move to the next. */
-                t_section = t_section->next;
-            }
-
-        }
-        /* Move to the next section */
-        cur_section = cur_section->next;
-    }
-}
-
-/*
-
-=item C<static void
-sort_registers(Parrot_jit_info_t *jit_info)>
-
-Sorts the Parrot registers prior to mapping them to actual hardware registers.
-
-=cut
-
-*/
-
-static void
-sort_registers(Parrot_jit_info_t *jit_info)
-{
-    Parrot_jit_optimizer_t *optimizer;
-    Parrot_jit_optimizer_section_ptr cur_section, next;
-    int any, k, typ, code_type;
-    int max_count, max_i = 0;
-    int to_map[] = { 0, 0, 0, 0 };
-
-    code_type = jit_info->code_type;
-    to_map[0] = jit_info->arch_info->regs[code_type].n_mapped_I;
-    to_map[3] = jit_info->arch_info->regs[code_type].n_mapped_F;
-
-    optimizer = jit_info->optimizer;
-    /* Start from the first section */
-    cur_section = optimizer->sections;
-
-    while (cur_section) {
-        Parrot_jit_register_usage_t *ru = cur_section->ru;
-        /* sum up register usage for one block, don't change
-         * reg_dir. If allocation is done per section, block numbers
-         * are different, so this is a nop
-         */
-        next = cur_section->next;
-        while (next && next->block == cur_section->block) {
-            const Parrot_jit_register_usage_t * const nru = next->ru;
-            for (typ = 0; typ < 4; typ++) {
-                int i;
-                for (i = 0; i < NUM_REGISTERS; i++)
-                    ru[typ].reg_count[i] += nru[typ].reg_count[i];
-            }
-            next = next->next;
-        }
-
-        /* now sort registers by their usage count */
-        for (typ = 0; typ < 4; typ++) {
-            /* find most used register */
-            int i;
-            for (i = max_count = 0; i < NUM_REGISTERS; i++) {
-                if (cur_section->ru[typ].reg_count[i] > max_count) {
-                    max_count = cur_section->ru[typ].reg_count[i];
-                    max_i = i;
-                }
-            }
-            /* start from this register and set usage */
-            k = ru[typ].registers_used = 0;
-            /* no usage, go on with next type */
-            if (max_count == 0 || !to_map[typ])
-                continue;
-            /* as long as we map registers for this typ */
-            while (1) {
-                if (max_i >= 0)
-                    ru[typ].reg_usage[k++] = max_i;
-                /* all mapped? */
-                if (k == to_map[typ])
-                    break;
-                /* now check for equal usage starting after maxi */
-                for (any = 0, i = max_i + 1; i < NUM_REGISTERS; i++) {
-                    if (ru[typ].reg_count[i] == max_count) {
-                        max_i = i;
-                        any = 1;
-                        break;
-                    }
-                }
-                /* if same usage not found, look for lower usage */
-                if (any == 0) {
-                    if (max_count > 1) {
-                        max_count--;
-                        max_i = -1;
-                        continue;
-                    }
-                    break;
-                }
-            }
-            ru[typ].registers_used = k;
-        }
-        next = cur_section->next;
-        /* duplicate usage to all sections of block */
-        while (next && next->block == cur_section->block) {
-            Parrot_jit_register_usage_t * const nru = next->ru;
-            for (typ = 0; typ < 4; typ++) {
-                int i;
-                for (i = 0; i < ru[typ].registers_used; i++) {
-                    nru[typ].reg_count[i] = ru[typ].reg_count[i];
-                    nru[typ].reg_usage[i] = ru[typ].reg_usage[i];
-                }
-                nru[typ].registers_used = ru[typ].registers_used;
-            }
-            next = next->next;
-        }
-        /* Move to the next section */
-        cur_section = next;
-    }
-}
-
-/*
-
-=item C<static void
-assign_registers(PARROT_INTERP,
-        Parrot_jit_info_t *jit_info,
-        Parrot_jit_optimizer_section_ptr cur_section,
-        opcode_t * code_start, int from_imcc)>
-
-Called by C<map_registers()> to actually assign the Parrot registers to
-hardware registers.
-
-TODO
-
-Before actually assigning registers, we should optimize a bit:
-
-1) calculate max use count of register types for all sections
-
-2) calculate costs for register preserving and restoring
-   for two different allocation strategies:
-
-   a) allocate non-volatiles first
-      overhead for jit_begin, jit_end:
-      - 2 * max_used_non_volatile registers
-      overhead for register preserving around non-jitted sections:
-      - only used IN arguments are saved
-      - only OUT non-volatile arguments are restored
-   b) allocate volatiles first
-      no overhead for jit_begin, jit_end
-      overhead per JITed op that calls a C function:
-      - 2 * n_used_volatiles_to_preserve for each call
-      overhead for register preserving around non-jitted sections:
-      - all volatiles are saved and restored around non-jitted sections
-
-NB for all cost estimations size does matter: a 64bit double counts as
-   two 32bit ints. Opcode count is assumed to be just one.
-
-3) depending on costs from 2) use one of the strategies
-   That does still not account for any usage patterns. Imcc has loop
-   nesting depth, but that's not available here. OTOH smaller code tends
-   to perform better because of better cache usage.
-
-Usage analysis could show that a mixture of both strategies is best, e.g:
-allocate 2-4 non-volatiles and the rest from volatiles. But that would
-complicate the allocation code a bit.
-
-=cut
-
-*/
-
-static void
-assign_registers(PARROT_INTERP,
-        Parrot_jit_info_t *jit_info,
-        Parrot_jit_optimizer_section_ptr cur_section,
-        opcode_t * code_start, int from_imcc)
-{
-    char *map;
-    Parrot_jit_optimizer_t *optimizer;
-    int i;
-    opcode_t * cur_op;
-    const char * maps[] = {0, 0, 0, 0};
-    const int code_type = jit_info->code_type;
-
-    maps[0] = jit_info->arch_info->regs[code_type].map_I;
-    maps[3] = jit_info->arch_info->regs[code_type].map_F;
-
-    optimizer = jit_info->optimizer;
-    map = optimizer->map_branch;
-    /* For each opcode in this section */
-    cur_op = cur_section->begin;
-    while (cur_op <= cur_section->end) {
-        const opcode_t op = *cur_op;
-        const op_info_t * const op_info = &interp->op_info_table[op];
-        int op_arg;
-        int n;
-
-        /* For each argument of the current opcode */
-        n = op_info->op_count;
-        ADD_OP_VAR_PART(interp, interp->code, cur_op, n);
-        for (op_arg = 1; op_arg < n; op_arg++) {
-            /* get the register typ */
-            int typ = map[cur_op + op_arg - code_start];
-            /* clear the register typ/map */
-            map[cur_op + op_arg - code_start] = 0;
-            /* if not JITted, don't map */
-            if (!cur_section->isjit)
-                continue;
-            if (typ > 0) {
-                typ--;  /* types are + 1 */
-                if (!maps[typ])
-                    continue;
-                /* If the argument is in most used list for this typ */
-                for (i = 0; i < cur_section->ru[typ].registers_used; i++) {
-                    opcode_t idx = cur_op[op_arg];
-                    if (from_imcc)
-                        idx = -1 - idx;
-                    if (idx == (opcode_t)cur_section->ru[typ].reg_usage[i]) {
-                        map[cur_op + op_arg - code_start] = maps[typ][i];
-                        cur_section->maps++;
-                        break;
-                    }
-                }
-            }
-        }
-
-        /* Move to the next opcode */
-        cur_op += n;
-    }
-}
-
-/*
-
-=item C<static void
-map_registers(PARROT_INTERP,
-        Parrot_jit_info_t *jit_info, opcode_t * code_start)>
-
-Maps the most used Parrot registers to hardware registers.
-
-=cut
-
-*/
-
-static void
-map_registers(PARROT_INTERP,
-        Parrot_jit_info_t *jit_info,
-         opcode_t * code_start)
-{
-    /* Start from the first section */
-    Parrot_jit_optimizer_section_ptr cur_section = jit_info->optimizer->sections;
-
-    /* While there is section */
-    while (cur_section) {
-
-        assign_registers(interp, jit_info, cur_section, code_start, 0);
-
-        /* Move to the next section */
-        cur_section = cur_section->next;
-    }
-}
-
-
-#define JIT_DEBUG 0
-
-#if JIT_DEBUG
-/*
-
-=item C<static void
-debug_sections(PARROT_INTERP,
-        Parrot_jit_optimizer_t *optimizer, opcode_t * code_start)>
-
-Prints out debugging info.
-
-=cut
-
-*/
-
-static void
-debug_sections(PARROT_INTERP,
-        Parrot_jit_optimizer_t *optimizer, opcode_t * code_start)
-{
-    Parrot_jit_optimizer_section_ptr cur_section;
-#  if JIT_DEBUG > 1
-    char * map = optimizer->map_branch;
-#  endif
-    int n;
-    const char types[] = "IPSN";
-    int types_to_list[] = {0, 3};
-
-    cur_section = optimizer->sections;
-    while (cur_section) {
-        opcode_t * cur_op;
-        unsigned int j;
-        Parrot_jit_register_usage_t *ru = cur_section->ru;
-
-        Parrot_io_eprintf(interp, "\nSection:\n");
-        Parrot_io_eprintf(interp, "%s block %d\n",
-                (cur_section->isjit) ? "JITTED" : "NOT JITTED",
-                cur_section->block);
-        for (cur_op = cur_section->begin; cur_op <= cur_section->end;) {
-            char instr[256];
-            const opcode_t op = *cur_op;
-            const op_info_t * const op_info = &interp->op_info_table[op];
-
-            PDB_disassemble_op(interp, instr, sizeof (instr),
-                    op_info, cur_op, NULL, code_start, 0);
-            Parrot_io_eprintf(interp, "\t\tOP%vu: ext %3d\t%s\n",
-                    cur_op - code_start, op_jit[*cur_op].extcall, instr);
-            n = op_info->op_count;
-            ADD_OP_VAR_PART(interp, interp->code, cur_op, n);
-#  if JIT_DEBUG > 1
-            Parrot_io_eprintf(interp, "\t\t\tmap_branch: ");
-            for (i = 0; i < n; i++)
-                Parrot_io_eprintf(interp, "%02x ", map[cur_op-code_start+i]);
-            Parrot_io_eprintf(interp, "\n");
-#  endif
-            cur_op += n;
-        }
-        Parrot_io_eprintf(interp, "\tbegin:\t%#p\t(%Ou)\n",
-                cur_section->begin, *cur_section->begin);
-        Parrot_io_eprintf(interp, "\tend:\t%#p\t(%Ou)\n",
-                cur_section->end, *cur_section->end);
-
-        for (j = 0; j < sizeof (types_to_list)/sizeof (int); j++) {
-            const int typ = types_to_list[j];
-            const char t  = types[typ];
-            Parrot_io_eprintf(interp, "\t%c registers used:\t%i\n",
-                    t, ru[typ].registers_used);
-            if (ru[typ].registers_used) {
-                int i;
-                Parrot_io_eprintf(interp, "\t%c register count:\t", t);
-                for (i = 0; i < NUM_REGISTERS; i++)
-                    Parrot_io_eprintf(interp, "%i ", ru[typ].reg_count[i]);
-                Parrot_io_eprintf(interp, "\n\t%c register usage:\t", t);
-                for (i = 0; i < NUM_REGISTERS; i++)
-                    Parrot_io_eprintf(interp, "%i ", ru[typ].reg_usage[i]);
-                Parrot_io_eprintf(interp, "\n\t%c register direction:\t", t);
-                for (i = 0; i < NUM_REGISTERS; i++)
-                    Parrot_io_eprintf(interp, "%i ", (int)ru[typ].reg_dir[i]);
-                Parrot_io_eprintf(interp, "\n");
-            }
-        }
-        Parrot_io_eprintf(interp, "\tJit opcodes:\t%u\n",
-                cur_section->jit_op_count);
-        Parrot_io_eprintf(interp, "\tTotal opcodes:\t%u\n",
-                cur_section->op_count);
-        if (cur_section->branch_target)
-            Parrot_io_eprintf(interp, "\tBranch target:\tOP%u\n",
-                    cur_section->branch_target->begin - code_start);
-
-        cur_section = cur_section->next;
-    }
-}
-#endif
-
-/*
-
-=item C<static Parrot_jit_optimizer_t *
-optimize_jit(PARROT_INTERP,
-            Parrot_jit_info_t *jit_info,
-             opcode_t *code_start, opcode_t *code_end)>
-
-Called by C<parrot_build_asm()> to run the optimizer.
-
-=cut
-
-*/
-
-static void
-optimize_jit(PARROT_INTERP,
-            Parrot_jit_info_t *jit_info,
-            opcode_t *code_start, opcode_t *code_end)
-{
-    Parrot_jit_optimizer_t *optimizer;
-
-    /* Allocate space for the optimizer */
-    jit_info->optimizer =
-        optimizer = (Parrot_jit_optimizer_t *)
-            mem_sys_allocate_zeroed(sizeof (Parrot_jit_optimizer_t));
-
-    /* Look, which opcodes might branch */
-    make_branch_list(interp, optimizer, code_start, code_end);
-
-    /* ok, let's loop again and generate the sections */
-    make_sections(interp, jit_info, code_start, code_end);
-
-    /* look where a section jumps to */
-    make_branch_targets(optimizer, code_start);
-
-    /* This is where we start deciding which Parrot registers get
-     * mapped to a hardware one in each different section. */
-
-#if JIT_DEBUG > 2
-    debug_sections(interp, optimizer, code_start);
-#endif
-    if (jit_info->code_type != JIT_CODE_SUB_REGS_ONLY)
-        sort_registers(jit_info);
-    map_registers(interp, jit_info, code_start);
-
-#if JIT_DEBUG
-    debug_sections(interp, optimizer, code_start);
-#endif
-}
-
-/*
-
-=item C<static Parrot_jit_optimizer_t *
-optimize_imcc_jit(PARROT_INTERP,
-            Parrot_jit_info_t *jit_info,
-            opcode_t *code_start, opcode_t *code_end,
-            PackFile_Segment *jit_seg)>
-
-Generate optimizer stuff from the C<_JIT> section in the packfile.
-
-=cut
-
-*/
-
-static void
-optimize_imcc_jit(PARROT_INTERP,
-            Parrot_jit_info_t *jit_info,
-             opcode_t *code_start, opcode_t *code_end,
-             PackFile_Segment *jit_seg)
-{
-    Parrot_jit_optimizer_t *optimizer;
-    size_t size, i, typ, n;
-    int j;
-    opcode_t *ptr, offs;
-    Parrot_jit_optimizer_section_ptr section, prev;
-    char *branch;
-    opcode_t *cur_op;
-
-    /* Allocate space for the optimizer */
-    jit_info->optimizer =
-        optimizer = (Parrot_jit_optimizer_t *)
-            mem_sys_allocate_zeroed(sizeof (Parrot_jit_optimizer_t));
-    /*
-     * TODO: pass the whole map_branch in the PBC
-     *       this would save two runs through all the opcode
-     */
-    optimizer->map_branch = branch =
-        (char *)mem_sys_allocate_zeroed((size_t)(code_end - code_start));
-    ptr = jit_seg->data;
-    size = jit_seg->size;
-    PARROT_ASSERT(jit_seg->itype == 0);
-    PARROT_ASSERT((size % 6) == 0);
-    cur_op = code_start;
-    for (prev = NULL, i = 0; i < size/6; i++, prev = section) {
-        section = (Parrot_jit_optimizer_section_t *)
-            mem_sys_allocate_zeroed(sizeof (Parrot_jit_optimizer_section_t));
-        if (prev)
-            prev->next = section;
-        else
-            optimizer->sections = section;
-        section->prev = prev;
-        section->block = i;
-        offs = *ptr++;
-        if (offs & 0x80000000) {
-            offs &= ~0x80000000;
-            branch[offs] = JIT_BRANCH_TARGET;
-        }
-        section->begin = code_start + offs;
-        section->end = code_start + *ptr++;
-        section->isjit = 1;
-        for (typ = 0; typ < 4; typ++) {
-            section->ru[typ].registers_used = *ptr++;
-            for (j = 0; j < section->ru[typ].registers_used; j++)
-                section->ru[typ].reg_usage[j] = j;
-
-        }
-        while (cur_op <= section->end) {
-            const opcode_t op = *cur_op;
-            op_info_t * const op_info = &interp->op_info_table[op];
-            set_register_usage(interp, jit_info, section,
-                    op_info, cur_op, code_start);
-            section->op_count++;
-            n = op_info->op_count;
-            ADD_OP_VAR_PART(interp, interp->code, cur_op, n);
-            cur_op += n;
-        }
-        assign_registers(interp, jit_info, section, code_start, 1);
-    }
-    insert_fixup_targets(interp, branch, code_end - code_start);
-#if JIT_DEBUG
-    debug_sections(interp, optimizer, code_start);
-#endif
-}
-
-/*
-
-=item C<size_t reg_offs(int typ, int i)>
-
-Returns the offset of register C<typ[i]>.
-
-F<src/jit/arch/jit_emit.h> has to define C<Parrot_jit_emit_get_base_reg_no(pc)>
-
-=cut
-
-*/
-
-/* we always are using offsets */
-
-
-static size_t
-reg_offs(int typ, int i)
-{
-    switch (typ) {
-        case 0:
-            return REG_OFFS_INT(i);
-        case 3:
-            return REG_OFFS_NUM(i);
-        default:
-            return 0;
-    }
-}
-
-/*
-
-=item C<static void
-Parrot_jit_load_registers(Parrot_jit_info_t *jit_info,
-                          PARROT_INTERP, int volatiles)>
-
-Load registers for the current section from parrot to processor registers.
-If C<volatiles> is true, this code is used to restore these registers in
-JITted code that calls out to Parrot.
-
-=cut
-
-*/
-
-static void
-Parrot_jit_load_registers(Parrot_jit_info_t *jit_info,
-                          PARROT_INTERP, int volatiles)
-{
-    Parrot_jit_optimizer_section_t *sect = jit_info->optimizer->cur_section;
-    Parrot_jit_register_usage_t *ru = sect->ru;
-    int typ;
-    size_t offs;
-    int base_reg = 0;   /* -O3 warning */
-    int lasts[] = { 0, 0, 0, 0 };
-    const char * maps[] = {0, 0, 0, 0};
-    int first = 1;
-    const int code_type                   = jit_info->code_type;
-    const jit_arch_info * const arch_info = jit_info->arch_info;
-    const jit_arch_regs * const reg_info  = arch_info->regs + code_type;
-
-    maps[0]  = reg_info->map_I;
-    maps[3]  = reg_info->map_F;
-    lasts[0] = reg_info->n_preserved_I;
-    lasts[3] = reg_info->n_preserved_F;
-
-    for (typ = 0; typ < 4; typ++) {
-        if (maps[typ]) {
-            int i;
-            for (i = ru[typ].registers_used-1; i >= 0; --i) {
-                const int us      = ru[typ].reg_usage[i];
-                const int is_used = i >= lasts[typ] && ru[typ].reg_dir[us];
-                if ((is_used && volatiles) ||
-                        (!volatiles &&
-                         ((ru[typ].reg_dir[us] & PARROT_ARGDIR_IN)))) {
-                    if (first) {
-                        base_reg = Parrot_jit_emit_get_base_reg_no(
-                                jit_info->native_ptr);
-                        first = 0;
-                    }
-                    offs = reg_offs(typ, us);
-                    if (typ == 3)
-                        (arch_info->mov_RM_n)(interp, jit_info,
-                                              maps[typ][i], base_reg, offs);
-                    else
-                        (arch_info->mov_RM_i)(interp, jit_info,
-                                              maps[typ][i], base_reg, offs);
-
-                }
-            }
-        }
-    }
-
-    /* The total size of the loads. This is used for branches to
-     * the same section - these skip the load asm bytes */
-    sect->load_size = jit_info->native_ptr -
-        (jit_info->arena.start +
-         jit_info->arena.op_map[jit_info->op_i].offset);
-}
-
-/*
-
-=item C<static void
-Parrot_jit_save_registers(Parrot_jit_info_t *jit_info,
-                          PARROT_INTERP, int volatiles)>
-
-Save registers for the current section.
-If C<volatiles> is true, this code is used to preserve these registers in
-JITted code that calls out to Parrot.
-
-=cut
-
-*/
-
-static void
-Parrot_jit_save_registers(Parrot_jit_info_t *jit_info,
-                          PARROT_INTERP, int volatiles)
-{
-    Parrot_jit_optimizer_section_t *sect = jit_info->optimizer->cur_section;
-    Parrot_jit_register_usage_t *ru = sect->ru;
-    int i, typ;
-    size_t offs;
-    int base_reg = 0; /* -O3 warning */
-    int lasts[] = { 0, 0, 0, 0 };
-    const char * maps[] = {0, 0, 0, 0};
-    int first = 1;
-    int code_type;
-    const jit_arch_info *arch_info;
-    const jit_arch_regs *reg_info;
-
-    arch_info = jit_info->arch_info;
-    code_type = jit_info->code_type;
-    reg_info = arch_info->regs + code_type;
-    maps[0]  = reg_info->map_I;
-    maps[3]  = reg_info->map_F;
-    lasts[0] = reg_info->n_preserved_I;
-    lasts[3] = reg_info->n_preserved_F;
-
-    for (typ = 0; typ < 4; typ++) {
-        if (maps[typ])
-            for (i = 0; i < ru[typ].registers_used; ++i) {
-                const int us = ru[typ].reg_usage[i];
-                const int is_used = i >= lasts[typ] && ru[typ].reg_dir[us];
-                if ((is_used && volatiles) ||
-                    (!volatiles &&
-                     (ru[typ].reg_dir[us] & PARROT_ARGDIR_OUT))) {
-                    if (first) {
-                        base_reg = Parrot_jit_emit_get_base_reg_no(
-                                jit_info->native_ptr);
-                        first = 0;
-                    }
-
-                    offs = reg_offs(typ, us);
-                    if (typ == 3)
-                        (arch_info->mov_MR_n)(interp, jit_info,
-                                 base_reg, offs, maps[typ][i]);
-                    else
-                        (arch_info->mov_MR_i)(interp, jit_info,
-                                 base_reg, offs, maps[typ][i]);
-
-                }
-            }
-    }
-}
-
-/*
-
-=item C<void
-Parrot_destroy_jit(void *ptr)>
-
-Frees the memory used by the JIT subsystem.
-
-=cut
-
-*/
-
-void
-Parrot_destroy_jit(void *ptr)
-{
-    Parrot_jit_optimizer_t *optimizer;
-    Parrot_jit_optimizer_section_ptr cur_section, next;
-    Parrot_jit_fixup_t *fixup, *next_f;
-    Parrot_jit_info_t *jit_info = (Parrot_jit_info_t *)ptr;
-
-    if (!jit_info)
-        return;
-    /* delete sections */
-    optimizer = jit_info->optimizer;
-    cur_section = optimizer->sections;
-    while (cur_section) {
-        next = cur_section->next;
-        mem_sys_free(cur_section);
-        cur_section = next;
-    }
-    /* arena stuff */
-    mem_sys_free(jit_info->arena.op_map);
-    mem_free_executable(jit_info->arena.start, jit_info->arena.size);
-    fixup = jit_info->arena.fixups;
-    while (fixup) {
-        next_f = fixup->next;
-        mem_sys_free(fixup);
-        fixup = next_f;
-    }
-    /* optimizer stuff */
-    mem_sys_free(optimizer->map_branch);
-    mem_sys_free(optimizer->branch_list);
-    mem_sys_free(optimizer);
-
-    free(jit_info);
-}
-
-/*
- * see TODO below
- * - locate Sub according to pc
- * - set register usage in context
- */
-static void
-set_reg_usage(PARROT_INTERP, const opcode_t *pc)
-{
-    PackFile_ByteCode   * const seg = interp->code;
-    PackFile_FixupTable * const ft  = seg->fixups;
-    PackFile_ConstTable * const ct  = seg->const_table;
-
-    int i;
-
-    if (!ft)
-        return;
-
-    if (!ct)
-        return;
-
-    for (i = 0; i < ft->fixup_count; i++) {
-        if (ft->fixups[i]->type == enum_fixup_sub) {
-            const int ci               = ft->fixups[i]->offset;
-            PMC        * const sub_pmc = ct->constants[ci]->u.key;
-            Parrot_sub        *sub;
-            size_t             offs;
-            int                i;
-
-            PMC_get_sub(interp, sub_pmc, sub);
-            offs = pc - sub->seg->base.data;
-
-            if (offs >= sub->start_offs && offs < sub->end_offs) {
-                for (i = 0; i < 4; i++)
-                    CONTEXT(interp)->n_regs_used[i] = sub->n_regs_used[i];
-
-                return;
-            }
-        }
-    }
-}
-
-/*
-
-=item C<Parrot_jit_info_t *
-parrot_build_asm(PARROT_INTERP,
-          opcode_t *code_start, opcode_t *code_end,
-          void *objfile, enum_jit_code_type)>
-
-This is the main function of the JIT code generator.
-
-It loops over the bytecode, calling the code generating routines for
-each opcode.
-
-The information obtained is used to perform certain types of fixups on
-native code, as well as by the native code itself to convert bytecode
-program counters values to hardware program counter values.
-
-Finally this code here is used to generate native executables (or better
-object files that are linked to executables), if EXEC_CAPABLE is defined.
-This functionality is triggered by
-
-  parrot -o foo.o foo.pir
-
-which uses the JIT engine to translate to native code inside the object
-file.
-
-=cut
-
-*/
-
-Parrot_jit_info_t *
-parrot_build_asm(PARROT_INTERP, ARGIN(opcode_t *code_start), ARGIN(opcode_t *code_end),
-          ARGIN(void *objfile), INTVAL jit_type)
-{
-    int                   n;
-    UINTVAL               i;
-    char                 *new_arena;
-    Parrot_jit_info_t    *jit_info = NULL;
-    opcode_t              cur_opcode_byte;
-    opcode_t             *cur_op;
-    PackFile_Segment     *jit_seg;
-    char                 *map;
-    Parrot_jit_fn_info_t *op_func;
-    INTVAL                n_regs_used[4];        /* INSP in PBC */
-    op_info_t            *op_info;
-    const jit_arch_info  *arch_info;
-    int                   needs_fs;       /* fetch/store */
-
-    /* XXX
-     * no longer referenced due to disabled code below
-    char *name;
-    */
-
-    Parrot_jit_optimizer_section_ptr cur_section;
-
-#if EXEC_CAPABLE
-    Parrot_exec_objfile_t *obj = (Parrot_exec_objfile_t *)objfile;
-#endif
-
-    jit_info = interp->code->jit_info = mem_allocate_typed(Parrot_jit_info_t);
-
-    jit_info->flags      = jit_type & JIT_CODE_RECURSIVE;
-    jit_type            &= ~ JIT_CODE_RECURSIVE;
-    jit_info->code_type  = jit_type;
-    needs_fs             = jit_type
-                        != JIT_CODE_SUB_REGS_ONLY;
-
-#if EXEC_CAPABLE
-    if (objfile) {
-        op_func           = op_exec;
-        jit_info->objfile = obj;
-    }
-    else
-#endif
-    {
-        op_func           = op_jit;
-        jit_info->objfile = NULL;
-    }
-
-    /* reset some extcall bits - all is JITed
-     */
-    if (jit_type == JIT_CODE_SUB_REGS_ONLY) {
-        op_func[PARROT_OP_set_returns_pc].extcall = 0;
-        op_func[PARROT_OP_get_params_pc].extcall  = 0;
-        op_func[PARROT_OP_get_params_pc].extcall  = 0;
-        op_func[PARROT_OP_invokecc_p].extcall     = 0;
-    }
-
-    /* get register mappings and such */
-    arch_info = jit_info->arch_info = Parrot_jit_init(interp);
-
-    /*
-     * check if IMCC did all the work. If yes, we have a PF segment with
-     * register allocation information inside.
-     * See imcc/jit.c for more
-     */
-#if JIT_SEGS
-    /* RT #45055
-     * JIT segs are currently not built
-     * the find_segments also segfaults on PPC eval_2
-     * maybe something not initialized correctly
-     * - disabled --leo
-     */
-    name    = mem_sys_allocate(strlen(interp->code->base.name) + 5);
-    sprintf(name, "%s_JIT", interp->code->base.name);
-    jit_seg = PackFile_find_segment(interp,
-            interp->code->base.dir, name, 0);
-    mem_sys_free(name);
-#else
-    jit_seg = NULL;
-#endif
-
-    /* remember register usage */
-    for (i = 0; i < 4; i++)
-        n_regs_used[i] = CONTEXT(interp)->n_regs_used[i];
-
-    set_reg_usage(interp, code_start);
-
-#if JIT_SEGS
-    optimize_imcc_jit(interp, jit_info, code_start, code_end, jit_seg);
-#else
-    optimize_jit(interp, jit_info, code_start, code_end);
-#endif
-
-    /* Byte code size in opcode_t's */
-    jit_info->arena.map_size = (code_end - code_start) + 1;
-    jit_info->arena.op_map   =
-        (Parrot_jit_opmap_t *)mem_sys_allocate_zeroed(
-            jit_info->arena.map_size * sizeof (* (jit_info->arena.op_map)));
-
-#if REQUIRES_CONSTANT_POOL
-    Parrot_jit_init_arenas(jit_info);
-#else
-    jit_info->arena.size = 1024;
-
-    /* estimate size needed
-     * 10 times pbc code size seems to be enough for i386
-     */
-    if ((size_t)jit_info->arena.map_size * 20 > (size_t)jit_info->arena.size)
-        jit_info->arena.size = jit_info->arena.map_size * 20;
-    jit_info->native_ptr     = jit_info->arena.start =
-        (char *)mem_alloc_executable((size_t)jit_info->arena.size);
-
-#  if EXEC_CAPABLE
-    if (obj)
-        jit_info->objfile->text.code = jit_info->arena.start;
-#  endif
-#endif
-
-    jit_info->op_i         = 0;
-    jit_info->arena.fixups = NULL;
-
-    /* The first section */
-    cur_section = jit_info->optimizer->cur_section
-                = jit_info->optimizer->sections;
-    map         = jit_info->optimizer->map_branch;
-
-    /*
-     * from C's ABI all the emitted code here is one (probably big)
-     * function. So we have to generate an appropriate function
-     * prologue, that makes all this look like a normal function ;)
-     */
-    jit_info->cur_op = cur_section->begin;
-    (arch_info->regs[jit_type].jit_begin)(jit_info, interp);
-
-    /*
-     *   op_map holds the offset from arena.start
-     *   of the parrot op at the given opcode index
-     *
-     * Set the offset of the first opcode
-     */
-    jit_info->arena.op_map[jit_info->op_i].offset =
-        jit_info->native_ptr - jit_info->arena.start;
-
-    /*
-     * the function epilog can basically be anywhere, that's done
-     * by the Parrot_end opcode somewhere in core.jit
-     */
-
-    while (jit_info->optimizer->cur_section) {
-        /* the code emitting functions need cur_op and cur_section
-         * so these vars are in jit_info too
-         */
-
-        /*
-         * TODO
-         *
-         * Register offsets depend on n_regs_used, which is per
-         * subroutine. JIT code is currently generated for a whole
-         * PBC. We can either:
-         * 1) create JIT per subroutine or
-         * 2) track the sub we are currently in, set register usage
-         *    in the interpreter context and restore it at end
-         *
-         * for now we use 2) - longterm plan is 1)
-         */
-
-        /* The first opcode for this section */
-        cur_op = jit_info->cur_op = cur_section->begin;
-
-        set_reg_usage(interp, cur_op);
-
-        /* Load mapped registers for this section, if JIT */
-        if (!jit_seg && cur_section->isjit && needs_fs)
-            Parrot_jit_load_registers(jit_info, interp, 0);
-
-        /* The first opcode of each section doesn't have a previous one since
-         * it's impossible to be sure which was it */
-        jit_info->prev_op = NULL;
-
-        while (cur_op <= cur_section->end) {
-            /* Grow the arena early */
-            if (jit_info->arena.size <
-                    (jit_info->arena.op_map[jit_info->op_i].offset + 200)) {
-#if REQUIRES_CONSTANT_POOL
-                Parrot_jit_extend_arena(jit_info);
-#else
-                new_arena = (char *)mem_realloc_executable(jit_info->arena.start,
-                        jit_info->arena.size, (size_t)jit_info->arena.size * 2);
-                jit_info->arena.size *= 2;
-                jit_info->native_ptr  = new_arena +
-                    (jit_info->native_ptr - jit_info->arena.start);
-                jit_info->arena.start = new_arena;
-#  if EXEC_CAPABLE
-                if (obj)
-                    obj->text.code = new_arena;
-#  endif
-#endif
-            }
-
-            cur_opcode_byte = *cur_op;
-
-            /* Need to save the registers if there is a branch and is not to
-             * the same section, I admit I don't like this, and it should be
-             * really checking if the target section has the same registers
-             * mapped too.
-             *
-             * Yep so: TODO
-             * during register allocation try to use the same registers, if
-             * its a loop or a plain branch and if register usage doesn't
-             * differ too much. This could save a lot of register reloads.
-             *
-             * --
-             *
-             * save also, if we have a jitted sections and encounter
-             * an "end" opcode, e.g. in evaled code
-             */
-            if (needs_fs) {
-                if ((((map[cur_op - code_start] == JIT_BRANCH_SOURCE) &&
-                            (cur_section->branch_target != cur_section)) ||
-                            !cur_opcode_byte) &&
-                        cur_section->isjit &&
-                        !jit_seg) {
-                    Parrot_jit_save_registers(jit_info, interp, 0);
-                }
-                else if (CALLS_C_CODE(cur_opcode_byte)) {
-                    /*
-                     * a JITted function with a function call, we have to
-                     * save volatile registers but
-                     * TODO not if the previous opcode was also one
-                     *      that called C code
-                     */
-                    Parrot_jit_save_registers(jit_info, interp, 1);
-                }
-            }
-
-            /*
-             * for all opcodes that are dynamically loaded, we can't have
-             * a JITted version, so we execute the function incarnation
-             * via the wrapper opcode, which just runs one opcode
-             * see ops/core.ops for more
-             */
-            if (cur_opcode_byte >= jit_op_count())
-                cur_opcode_byte = CORE_OPS_wrapper__;
-
-            (op_func[cur_opcode_byte].fn) (jit_info, interp);
-
-            if (CALLS_C_CODE(cur_opcode_byte) && needs_fs) {
-                /*
-                 * restore volatiles only - and TODO only if next
-                 *      wouldn't load registers anyway
-                 */
-                Parrot_jit_load_registers(jit_info, interp, 1);
-            }
-            /* Update the previous opcode */
-            jit_info->prev_op = cur_op;
-
-            op_info = &interp->op_info_table[*cur_op];
-            n       = op_info->op_count;
-            ADD_OP_VAR_PART(interp, interp->code, cur_op, n);
-            cur_op += n;
-
-            /* update op_i and cur_op accordingly */
-            jit_info->op_i   += n;
-            jit_info->cur_op += n;
-
-            if (*jit_info->prev_op == PARROT_OP_set_args_pc &&
-                    jit_type == JIT_CODE_SUB_REGS_ONLY) {
-                PARROT_ASSERT(*cur_op == PARROT_OP_set_p_pc);
-
-                /* skip it */
-                cur_op           += 3;
-                jit_info->op_i   += 3;
-                jit_info->cur_op += 3;
-
-                jit_info->arena.op_map[jit_info->op_i].offset =
-                    jit_info->native_ptr - jit_info->arena.start;
-
-                PARROT_ASSERT(*cur_op == PARROT_OP_get_results_pc);
-
-                /* now emit the call - use special op for this */
-                (op_func[PARROT_OP_pic_callr___pc].fn)(jit_info, interp);
-
-                /* and the get_results */
-                (op_func[*cur_op].fn)(jit_info, interp);
-
-                op_info = &interp->op_info_table[*cur_op];
-                n       = op_info->op_count;
-                ADD_OP_VAR_PART(interp, interp->code, cur_op, n);
-
-                cur_op += n;
-
-                /* update op_i and cur_op accordingly */
-                jit_info->op_i   += n;
-                jit_info->cur_op += n;
-
-                jit_info->arena.op_map[jit_info->op_i].offset =
-                    jit_info->native_ptr - jit_info->arena.start;
-
-                /* now at invoke */
-                PARROT_ASSERT(*cur_op == PARROT_OP_invokecc_p);
-
-                cur_op            += 2;    /* skip it */
-                jit_info->op_i    += 2;
-                jit_info->cur_op  += 2;
-            }
-
-            /* if this is a branch target, align it */
-#ifdef jit_emit_noop
-#  if JUMP_ALIGN
-            if (((!cur_section->next && cur_op <= cur_section->end) ||
-                        cur_section->next) &&
-                    map[cur_op - code_start] == JIT_BRANCH_TARGET) {
-                while ((long)jit_info->native_ptr & ((1<<JUMP_ALIGN) - 1))
-                    jit_emit_noop(jit_info->native_ptr);
-            }
-#  endif
-#endif
-            /* set the offset */
-            jit_info->arena.op_map[jit_info->op_i].offset =
-                jit_info->native_ptr - jit_info->arena.start;
-        }
-
-        /* Save mapped registers back to the Parrot registers */
-        if (!jit_seg && cur_section->isjit && needs_fs)
-            Parrot_jit_save_registers(jit_info, interp, 0);
-
-        /* update the offset for saved registers */
-        jit_info->arena.op_map[jit_info->op_i].offset =
-            jit_info->native_ptr - jit_info->arena.start;
-
-        /* Move to the next section */
-        cur_section = jit_info->optimizer->cur_section =
-            cur_section->next;
-    }
-
-    /* restore register usage */
-    for (i = 0; i < 4; i++)
-        CONTEXT(interp)->n_regs_used[i] = n_regs_used[i];
-
-    /* Do fixups before converting offsets */
-    (arch_info->jit_dofixup)(jit_info, interp);
-
-    /* Convert offsets to pointers */
-    if (!objfile)
-        for (i = 0; i < jit_info->arena.map_size; i++) {
-
-            /* Assuming native code chunks contain some initialization code,
-             * the first op (and every other op) is at an offset > 0
-             */
-            if (jit_info->arena.op_map[i].offset) {
-                jit_info->arena.op_map[i].ptr = (char *)jit_info->arena.start +
-                    jit_info->arena.op_map[i].offset;
-            }
-        }
-
-    jit_info->arena.size =
-        (ptrdiff_t)(jit_info->native_ptr - jit_info->arena.start);
-#if JIT_DEBUG
-    Parrot_io_eprintf(interp, "\nTotal size %u bytes\n",
-            (unsigned int)(jit_info->native_ptr - jit_info->arena.start));
-#endif
-
-    /*
-     * sync data cache if needed - we are executing it as code in some usecs
-     */
-    if (arch_info->jit_flush_cache)
-        (arch_info->jit_flush_cache)(jit_info, interp);
-
-    /* assume gdb is available: generate symbol information  */
-#if defined __GNUC__ || defined __IBMC__
-    if (Interp_debug_TEST(interp, PARROT_JIT_DEBUG_FLAG)) {
-        /*
-         * TODO same like above here e.g. create ASM listing of code
-         *      if real debug support isn't available
-         */
-        if (jit_type == JIT_CODE_FILE) {
-            interp->code->jit_info = jit_info;
-            Parrot_jit_debug(interp);
-        }
-    }
-#endif
-
-    return jit_info;
-}
-
-/*
-
-=item C<void
-Parrot_jit_newfixup(Parrot_jit_info_t *jit_info)>
-
-Remember the current position in the native code for later update.
-
-=cut
-
-*/
-
-void
-Parrot_jit_newfixup(Parrot_jit_info_t *jit_info)
-{
-    Parrot_jit_fixup_t *fixup;
-
-    fixup = mem_allocate_zeroed_typed(Parrot_jit_fixup_t);
-
-    /* Insert fixup at the head of the list */
-    fixup->next = jit_info->arena.fixups;
-    jit_info->arena.fixups = fixup;
-
-    /* Fill in the native code offset */
-    fixup->native_offset =
-        (ptrdiff_t)(jit_info->native_ptr - jit_info->arena.start);
-}
-
-/*
-
-=item C<void Parrot_jit_free_buffer(PARROT_INTERP, void *ptr, void *priv)>
-
-This is a callback to implement the proper freeing semantics.  It is called by
-the ManagedStruct PMC as it is garbage collected.
-
-=cut
-
-*/
-
-void
-Parrot_jit_free_buffer(PARROT_INTERP, void *ptr, void *priv)
-{
-    const struct jit_buffer_private_data * const jit = (struct jit_buffer_private_data*)priv;
-    mem_free_executable(ptr, jit->size);
-    free(priv);
-}
-
-/*
-
-=item C<PMC *Parrot_jit_clone_buffer(PARROT_INTERP, PMC *pmc, void *priv)>
-
-This is a callback to implement the proper cloning semantics for jit buffers.
-It is called by the ManagedStruct PMC's clone() function.
-
-=cut
-
-*/
-
-PMC *
-Parrot_jit_clone_buffer(PARROT_INTERP, PMC *pmc, void *priv)
-{
-    PMC * const rv = pmc_new(interp, pmc->vtable->base_type);
-
-    VTABLE_init(interp, rv);
-    /* copy the attributes */
-    {
-        void (*tmpfreefunc)(PARROT_INTERP, void*, void*);
-        GETATTR_ManagedStruct_custom_free_func(interp, pmc, tmpfreefunc);
-        SETATTR_ManagedStruct_custom_free_func(interp, rv , tmpfreefunc);
-    }
-    {
-        PMC* (*tmpclonefunc)(PARROT_INTERP, PMC*, void*);
-        GETATTR_ManagedStruct_custom_clone_func(interp, pmc, tmpclonefunc);
-        SETATTR_ManagedStruct_custom_clone_func(interp, rv , tmpclonefunc);
-    }
-
-    {
-        void *freepriv, *clonepriv;
-        GETATTR_ManagedStruct_custom_free_priv(interp , pmc, freepriv);
-        GETATTR_ManagedStruct_custom_clone_priv(interp, pmc, clonepriv);
-        if (freepriv) {
-            void *tmp = mem_sys_allocate(sizeof (struct jit_buffer_private_data));
-            memcpy(tmp, freepriv, sizeof (struct jit_buffer_private_data));
-            SETATTR_ManagedStruct_custom_free_priv(interp, rv , tmp);
-            if (clonepriv == freepriv) {
-                /* clonepriv is a copy of freepriv, make it a copy in the clone too. */
-                SETATTR_ManagedStruct_custom_clone_priv(interp, rv , tmp);
-                clonepriv = NULL; /* disable the clonepriv copying below */
-            }
-        }
-        if (clonepriv) {
-            void *tmp = mem_sys_allocate(sizeof (struct jit_buffer_private_data));
-            memcpy(tmp, clonepriv, sizeof (struct jit_buffer_private_data));
-            SETATTR_ManagedStruct_custom_clone_priv(interp, rv , tmp);
-        }
-    }
-
-    /* copy the execmem buffer */
-    if (PARROT_MANAGEDSTRUCT(pmc)->ptr) {
-        struct jit_buffer_private_data *jit = (struct jit_buffer_private_data*)priv;
-        void *ptr = PARROT_MANAGEDSTRUCT(pmc)->ptr;
-        void *newptr = mem_alloc_executable(jit->size);
-        memcpy(newptr, ptr, jit->size);
-        PARROT_MANAGEDSTRUCT(rv)->ptr = newptr;
-    }
-
-    return rv;
-}
-
-
-/*
-
-=back
-
-=head1 SEE ALSO
-
-F<src/jit.h>, F<docs/jit.pod>, F<src/jit_debug.c>,
-F<src/jit/$jitcpuarch/jit_emit.h>, F<jit/$jitcpuarch/core.jit>.
-
-=cut
-
-*/
-
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit.h
==============================================================================
--- branches/orderedhash_revamp/src/jit.h	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,340 +0,0 @@
-/*
- * Copyright (C) 2001-2007, Parrot Foundation.
- */
-
-/*
- * jit.h
- *
- * $Id$
- */
-
-#ifndef PARROT_JIT_H_GUARD
-#define PARROT_JIT_H_GUARD
-
-#if EXEC_CAPABLE
-#  include "parrot/exec.h"
-#endif
-
-typedef void (*jit_f)(PARROT_INTERP, opcode_t *pc);
-
-
-void Parrot_destroy_jit(void *);
-
-/*  Parrot_jit_fixup_t
- *      Platform generic fixup information
- *
- *  type:           The type of fixup.
- *  native_offset:  Where to apply the fixup.
- *  skip:           Skip instructions after the target.
- *  param:          Fixup specific data.
- */
-
-typedef struct Parrot_jit_fixup *Parrot_jit_fixup_ptr;
-
-typedef struct Parrot_jit_fixup {
-    int                         type;
-    ptrdiff_t                   native_offset;
-    char                        skip;
-    char                        dummy[3]; /* For alignment ??? XXX */
-    union {                               /* What has to align with what? */
-        opcode_t opcode;
-        void (*fptr)(void);
-    } param;
-
-    Parrot_jit_fixup_ptr        next;
-} Parrot_jit_fixup_t;
-
-/*  Parrot_jit_opmap_t
- *      Hold native code offsets/addresses
- *
- *  ptr:    Pointer to native code
- *  offset: Offset of native code from arena.start
- */
-
-typedef union {
-    void *ptr;
-    ptrdiff_t offset;
-} Parrot_jit_opmap_t;
-
-enum {
-    JIT_BRANCH_NO,      /* The opcode doesn't branch */
-    JIT_BRANCH_TARGET,  /* The opcode is a branch target */
-    JIT_BRANCH_SOURCE   /* The opcode is a branch source */
-};
-
-
-/*  Parrot_jit_arena_t
- *      Holds pointers to the native code of one or more sections.
- *
- *  start:          Start of current native code segment.
- *  size:           The size of the arena in bytes
- *  op_map:         Maps opcode offsets to native code.
- *  map_size:       The size of the map in bytes.
- *  fixups:         List of fixups.
- */
-
-typedef struct Parrot_jit_arena_t {
-    char                            *start;
-    ptrdiff_t                        size;
-    Parrot_jit_opmap_t              *op_map;
-    unsigned long                    map_size;
-    Parrot_jit_fixup_t              *fixups;
-} Parrot_jit_arena_t;
-
-/*  Parrot_jit_optimizer_section_t
- *      The bytecode will be divided in sections depending on the
- *      program structure.
- *
- *  begin:              Points where sections begins in the bytecode.
- *  end:                Points where sections ends in the bytecode.
- *  arena:              The first arena for this section, or NULL if the
- *                      section is in the arena inlined in jit_info.
- *  ru[4]:              register_usage_t per [IPSN]
- *  maps:               Total maps done.
- *  jit_op_count:       How many opcodes are jitted.
- *  op_count:           Opcodes in this section.
- *  load_size:          The size of the register load instructions to be
- *                      skipped in an in-section branch.
- *  isjit:              If this section is a jitted one or not.
- *  block:              block number of section
- *  branch_target:      The section where execution continues if this section
- *                      ends at a branch source the targeted section is used.
- */
-
-typedef struct Parrot_jit_optimizer_section *Parrot_jit_optimizer_section_ptr;
-
-/*  reg_count:      An array with one position for each register
- *                  holding the number of times each register is used in the
- *                  section.
- *  reg_usage:      An array with the registers sorted by the usage.
- *  reg_dir:        If the register needs to be loaded or saved.
- *  registers_used: count of used registers
- */
-typedef struct Parrot_jit_register_usage_t {
-    int                                 reg_count[NUM_REGISTERS];
-    unsigned int                        reg_usage[NUM_REGISTERS];
-    char                                reg_dir[NUM_REGISTERS];
-    int                        registers_used;
-} Parrot_jit_register_usage_t;
-
-typedef struct Parrot_jit_optimizer_section {
-    opcode_t                            *begin;
-    opcode_t                            *end;
-    Parrot_jit_register_usage_t          ru[4];
-    Parrot_jit_arena_t                  *arena;
-    unsigned int                         maps;
-    unsigned int                         jit_op_count;
-    unsigned int                         op_count;
-    ptrdiff_t                            load_size;
-    char                                 isjit;
-    char                                 done;
-    char                                 ins_count;
-    char                                 dummy; /* For alignment ??? XXX */
-    int                                  block; /* What has to align with what? */
-    Parrot_jit_optimizer_section_ptr     branch_target;
-    Parrot_jit_optimizer_section_ptr     prev;
-    Parrot_jit_optimizer_section_ptr     next;
-} Parrot_jit_optimizer_section_t;
-
-/*  Parrot_jit_optimizer_section_t
- *      All the information related to optimizing the bytecode.
- *
- *  sections:               A pointer to the first section.
- *  cur_section:            Pointer to the current section.
- *  map_branch:             A pointer to an array with the size of the bytecode
- *                          where the positions of the opcodes will have a value
- *                          indicating if the opcode is a branch target, source
- *                          or isn't related with a control flow opcode at all,
- *                          and which register was allocated for each opcode
- *                          argument if any.
- *  has_unpredictable_jump: XXX need to define how to handle this.
- */
-
-typedef struct Parrot_jit_optimizer_t {
-    Parrot_jit_optimizer_section_t  *sections;
-    Parrot_jit_optimizer_section_t  *cur_section;
-    char                            *map_branch;
-    opcode_t                       **branch_list;
-    unsigned char                    has_unpredictable_jump;
-    unsigned char                    dummy[3]; /* For alignment ??? XXX */
-} Parrot_jit_optimizer_t;                      /* What has to align with what? */
-
-/*  Parrot_jit_constant_pool_t
- *      Constants pool information.
- *
- */
-typedef struct Parrot_jit_constant_pool_t {
-    long                             frames_used;
-    long                             cur_used;
-    char                            *cur_const;
-    INTVAL                          *slot_ptr;
-} Parrot_jit_constant_pool_t;
-
-typedef enum {
-    JIT_CODE_FILE,
-    JIT_CODE_SUB,
-    JIT_CODE_SUB_REGS_ONLY,
-
-    /* size */
-    JIT_CODE_TYPES,
-    /* special cases */
-    JIT_CODE_RECURSIVE     = 0x10,
-    JIT_CODE_SUB_REGS_ONLY_REC = JIT_CODE_SUB_REGS_ONLY|JIT_CODE_RECURSIVE
-} enum_jit_code_type;
-
-/*  Parrot_jit_info_t
- *      All the information needed to jit the bytecode will be here.
- *
- *  prev_op:        The previous opcode in this section.
- *  cur_op:         The current opcode during the build process.
- *  op_i:           Opcode index.
- *  native_ptr:     Current pointer to native code.
- *  arena:          The arena inlined, this will be the only one used in cases
- *                  where there is a way to load an immediate.
- *  optimizer:      Optimizer information.
- *  constant_pool:  The constant pool information.
- */
-
-typedef struct Parrot_jit_info_t {
-    opcode_t                        *prev_op;
-    opcode_t                        *cur_op;
-    opcode_t                         op_i;
-    char                            *native_ptr;
-    Parrot_jit_arena_t               arena;
-    Parrot_jit_optimizer_t          *optimizer;
-    Parrot_jit_constant_pool_t      *constant_pool;
-    INTVAL                          code_type;
-    int                             flags;
-    const struct jit_arch_info_t    *arch_info;
-    int                              n_args;
-#if EXEC_CAPABLE
-    Parrot_exec_objfile_t           *objfile;
-#else
-    void                            *objfile;
-#endif /* EXEC_CAPABLE */
-} Parrot_jit_info_t;
-
-#define Parrot_jit_fixup_target(jit_info, fixup) \
-    ((jit_info)->arena.start + (fixup)->native_offset)
-
-typedef void (*jit_fn_t)(Parrot_jit_info_t *jit_info,
-                         PARROT_INTERP);
-
-/*  Parrot_jit_fn_info_t
- *      The table of opcodes.
- *
- *  jit_fn_t:       A pointer to the function that emits code for the opcode
- *                  or to the C funtion if the opcode is not jitted.
- *  extcall:        If the opcode makes an external call to a C funtion.
- *                  also used for vtable functions, extcall is #of vtable func
- */
-
-typedef struct Parrot_jit_fn_info_t {
-    jit_fn_t                        fn;
-    int                            extcall;
-} Parrot_jit_fn_info_t;
-
-PARROT_DATA Parrot_jit_fn_info_t *op_jit;
-extern Parrot_jit_fn_info_t op_exec[];
-
-PARROT_EXPORT void Parrot_jit_newfixup(Parrot_jit_info_t *jit_info);
-
-void Parrot_jit_cpcf_op(Parrot_jit_info_t *jit_info,
-                        PARROT_INTERP);
-
-void Parrot_jit_normal_op(Parrot_jit_info_t *jit_info,
-                          PARROT_INTERP);
-
-void Parrot_jit_restart_op(Parrot_jit_info_t *jit_info,
-                          PARROT_INTERP);
-
-void Parrot_exec_cpcf_op(Parrot_jit_info_t *jit_info,
-                        PARROT_INTERP);
-
-void Parrot_exec_normal_op(Parrot_jit_info_t *jit_info,
-                          PARROT_INTERP);
-
-void Parrot_exec_restart_op(Parrot_jit_info_t *jit_info,
-                          PARROT_INTERP);
-
-/*
- * interface functions for the register save/restore code
- * with offsets relative to the base register (obtained by
- * Parrot_jit_emit_get_base_reg_no)
- */
-void Parrot_jit_emit_mov_mr_n_offs(
-    Interp *, int base_reg, size_t offs, int src_reg);
-void Parrot_jit_emit_mov_mr_offs(
-    Interp *,  int base_reg, size_t offs, int src_reg);
-void Parrot_jit_emit_mov_rm_n_offs(
-    Interp *, int dst_reg, int base_reg, size_t offs);
-void Parrot_jit_emit_mov_rm_offs(
-    Interp *, int dst_reg, int base_reg, size_t offs);
-
-/*
- * interface to architecture specific details
- */
-typedef void (*jit_arch_f)(Parrot_jit_info_t *, Interp *);
-
-typedef struct jit_arch_regs {
-    /*
-     * begin function - emit ABI call prologue
-     */
-    jit_arch_f jit_begin;
-
-    int n_mapped_I;
-    int n_preserved_I;
-    const char *map_I;
-    int n_mapped_F;
-    int n_preserved_F;
-    const char *map_F;
-} jit_arch_regs;
-
-typedef void (*mov_RM_f)(PARROT_INTERP, Parrot_jit_info_t *,
-        int cpu_reg, int base_reg, INTVAL offs);
-typedef void (*mov_MR_f)(PARROT_INTERP, Parrot_jit_info_t *,
-        int base_reg, INTVAL offs, int cpu_reg);
-
-typedef struct jit_arch_info_t {
-    /* CPU <- Parrot reg move functions */
-    mov_RM_f mov_RM_i;
-    mov_RM_f mov_RM_n;
-    /* Parrot <- CPU reg move functions */
-    mov_MR_f mov_MR_i;
-    mov_MR_f mov_MR_n;
-
-    /* fixup branches and calls after codegen */
-    jit_arch_f jit_dofixup;
-    /* flush caches */
-    jit_arch_f jit_flush_cache;
-    /* register mapping info */
-    const jit_arch_regs regs[JIT_CODE_TYPES];
-} jit_arch_info;
-
-/*
- * interface to create JIT code
- */
-Parrot_jit_info_t *
-parrot_build_asm(PARROT_INTERP,
-                opcode_t *code_start, opcode_t *code_end,
-                void *objfile, INTVAL);
-/*
- * NCI interface
- */
-void *Parrot_jit_build_call_func(Interp *, PMC *, STRING *, int *);
-/* custom pmc callback functions */
-void Parrot_jit_free_buffer(PARROT_INTERP, void *ptr, void *priv);
-PMC* Parrot_jit_clone_buffer(PARROT_INTERP, PMC *pmc, void *priv);
-struct jit_buffer_private_data {
-    int size;
-};
-
-#endif /* PARROT_JIT_H_GUARD */
-
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/alpha/core.jit
==============================================================================
--- branches/orderedhash_revamp/src/jit/alpha/core.jit	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,142 +0,0 @@
-;
-; alpha/core.jit
-;
-;
-; $Id$
-;
-
-Parrot_noop {
-    emit_nop(NATIVECODE);
-}
-
-Parrot_set_i_i {
-    if (MAP[1] && MAP[2]) {
-        jit_emit_mov_rr(NATIVECODE, MAP[2], MAP[1]);
-    }
-    else if (MAP[1]) {
-        jit_emit_mov_rm_i(NATIVECODE, MAP[1], &INT_REG[2]);
-    }
-    else if (MAP[2]) {
-        jit_emit_mov_mr_i(NATIVECODE, &INT_REG[1], MAP[2]);
-    }
-    else {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, &INT_REG[2]);
-        jit_emit_mov_mr_i(NATIVECODE, &INT_REG[1], ISR1);
-    }
-}
-
-Parrot_set_i_ic {
-    if (MAP[1]) {
-        jit_emit_mov_ri_i(NATIVECODE, MAP[1], *INT_CONST[2]);
-    }
-    else {
-        jit_emit_mov_ri_i(NATIVECODE, ISR1, *INT_CONST[2]);
-        jit_emit_mov_mr_i(NATIVECODE, &INT_REG[1], ISR1);
-    }
-}
-
-Parrot_sub_i_i_i {
-    if (MAP[1] && MAP[2] && MAP[3]) {
-        jit_emit_sub_rrr(NATIVECODE, MAP[2], MAP[3], MAP[1]);
-    }
-    else if (MAP[1] && MAP[2]) {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, &INT_REG[3]);
-        jit_emit_sub_rrr(NATIVECODE, MAP[2], ISR1, MAP[1]);
-    }
-    else if (MAP[1] && MAP[3]) {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, &INT_REG[2]);
-        jit_emit_sub_rrr(NATIVECODE, ISR1, MAP[3], MAP[1]);
-    }
-    else if (MAP[2] && MAP[3]) {
-        jit_emit_sub_rrr(NATIVECODE, MAP[2], MAP[3], ISR1);
-        jit_emit_mov_mr_i(NATIVECODE, &INT_REG[1], ISR1);
-    }
-    else if (MAP[1]) {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, &INT_REG[3]);
-        jit_emit_mov_rm_i(NATIVECODE, ISR2, &INT_REG[2]);
-        jit_emit_sub_rrr(NATIVECODE, ISR2, ISR1, MAP[1]);
-    }
-    else if (MAP[2]) {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, &INT_REG[3]);
-        jit_emit_sub_rrr(NATIVECODE, MAP[2], ISR1, ISR1);
-        jit_emit_mov_mr_i(NATIVECODE, &INT_REG[1], ISR1);
-    }
-    else if (MAP[3]) {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, &INT_REG[2]);
-        jit_emit_sub_rrr(NATIVECODE, ISR1, MAP[3], ISR1);
-        jit_emit_mov_mr_i(NATIVECODE, &INT_REG[1], ISR1);
-    }
-    else {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, &INT_REG[3]);
-        jit_emit_mov_rm_i(NATIVECODE, ISR2, &INT_REG[2]);
-        jit_emit_sub_rrr(NATIVECODE, ISR1, ISR2, ISR1);
-        jit_emit_mov_mr_i(NATIVECODE, &INT_REG[1], ISR1);
-    }
-}
-
-Parrot_add_i_i_i {
-    if (MAP[1] && MAP[2] && MAP[3]) {
-        jit_emit_add_rrr(NATIVECODE, MAP[2], MAP[3], MAP[1]);
-    }
-    else if (MAP[1] && MAP[2]) {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, &INT_REG[3]);
-        jit_emit_add_rrr(NATIVECODE, MAP[2], ISR1, MAP[1]);
-    }
-    else if (MAP[1] && MAP[3]) {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, &INT_REG[2]);
-        jit_emit_add_rrr(NATIVECODE, ISR1, MAP[3], MAP[1]);
-    }
-    else if (MAP[2] && MAP[3]) {
-        jit_emit_add_rrr(NATIVECODE, MAP[2], MAP[3], ISR1);
-        jit_emit_mov_mr_i(NATIVECODE, &INT_REG[1], ISR1);
-    }
-    else if (MAP[1]) {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, &INT_REG[3]);
-        jit_emit_mov_rm_i(NATIVECODE, ISR2, &INT_REG[2]);
-        jit_emit_add_rrr(NATIVECODE, ISR2, ISR1, MAP[1]);
-    }
-    else if (MAP[2]) {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, &INT_REG[3]);
-        jit_emit_add_rrr(NATIVECODE, MAP[2], ISR1, ISR1);
-        jit_emit_mov_mr_i(NATIVECODE, &INT_REG[1], ISR1);
-    }
-    else if (MAP[3]) {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, &INT_REG[2]);
-        jit_emit_add_rrr(NATIVECODE, ISR1, MAP[3], ISR1);
-        jit_emit_mov_mr_i(NATIVECODE, &INT_REG[1], ISR1);
-    }
-    else {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, &INT_REG[3]);
-        jit_emit_mov_rm_i(NATIVECODE, ISR2, &INT_REG[2]);
-        jit_emit_add_rrr(NATIVECODE, ISR1, ISR2, ISR1);
-        jit_emit_mov_mr_i(NATIVECODE, &INT_REG[1], ISR1);
-    }
-}
-
-Parrot_if_i_ic {
-    if (MAP[1]) {
-        emit_bne(NATIVECODE, MAP[1], *INT_CONST[2]);
-    }
-    else {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, &INT_REG[1]);
-        emit_bne(NATIVECODE, ISR1, *INT_CONST[2]);
-    }
-}
-
-Parrot_end {
-;   jit_emit_mov_rr(NATIVECODE, REG15_s6, REG30_sp);
-    emit_ldq_b(NATIVECODE, REG26_ra, 0, REG30_sp);
-    emit_ldq_b(NATIVECODE, REG15_s6, 8, REG30_sp);
-    emit_lda_b(NATIVECODE, REG30_sp, 16, REG30_sp);
-    emit_ret(NATIVECODE);
-}
-
-/*
- * Local variables:
- * c-indentation-style: bsd
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- *
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/alpha/jit_defs.c
==============================================================================
--- branches/orderedhash_revamp/src/jit/alpha/jit_defs.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,13 +0,0 @@
-/* Stub file for RT#38929 fixes */
-/*
-Copyright (C) 2008, Parrot Foundation.
-$Id$
-*/
-/* HEADERIZER HFILE: none */
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/alpha/jit_emit.h
==============================================================================
--- branches/orderedhash_revamp/src/jit/alpha/jit_emit.h	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,561 +0,0 @@
-/*
- * Copyright (C) 2002-2007, Parrot Foundation.
- */
-
-/*
- * jit_emit.h
- *
- * ALPHA
- *
- * $Id$
- */
-
-/*  Register usage:
- *
- * REG0 v0          Used for expression evaluations and to hold the integer
- *                  function results. Not preserved across procedure calls.
- * REG1-8 t0-t7     Temporary registers used for expression evaluations. Not
- *                  preserved across procedure calls.
- * REG9-14 s0-s5    Saved registers. Preserved across procedure calls.
- * REG15 s6 or fp   Contains the frame pointer (if needed); otherwise, a saved
- *                  register.
- * REG16-21 a0-a5   Used to pass the first six integer type actual arguments.
- *                  Not preserved across procedure calls.
- * REG22-25 t8-t11  Temporary registers used for expression evaluations. Not
- *                  preserved across procedure calls.
- * REG26 ra         Contains the return address. Preserved across procedure
- *                  calls.
- * REG27 pv or t12  Contains the procedure value and used for expression
- *                  evaluation. Not preserved across procedure calls.
- * REG28 or at      AT Reserved for the assembler. Not preserved across
- *                  procedure calls.
- * REG29 or gp      gp Contains the global pointer. Not preserved across
- *                  procedure calls.
- * REG30 or sp      sp Contains the stack pointer. Preserved across procedure
- *                  calls.
- * REG31 zero       Always has the value 0.
- *
- */
-
-#ifndef PARROT_ALPHA_JIT_EMIT_H_GUARD
-#define PARROT_ALPHA_JIT_EMIT_H_GUARD
-
-typedef enum {
-    REG0_v0,
-    REG1_t0,
-    REG2_t1,
-    REG3_t2,
-    REG4_t3,
-    REG5_t4,
-    REG6_t5,
-    REG7_t6,
-    REG8_t7,
-    REG9_s0,
-    REG10_s1,
-    REG11_s2,
-    REG12_s3,
-    REG13_s4,
-    REG14_s5,
-    REG15_s6,
-    REG16_a0,
-    REG17_a1,
-    REG18_a2,
-    REG19_a3,
-    REG20_a4,
-    REG21_a5,
-    REG22_t8,
-    REG23_t9,
-    REG24_t10,
-    REG25_t11,
-    REG26_ra,
-    REG27_t12,
-    REG28_at,
-    REG29_gp,
-    REG30_sp,
-    REG31_zero
-} alpha_register_t;
-
-typedef enum {
-    LDA = 8,
-    LDH = 9,
-    LDQ = 41,
-    STQ = 45
-} ld_st_t;
-
-typedef enum {
-    BSR = 0xd0,
-    BEQ = 0xe4,
-    BNE = 61
-} branch_t;
-
-#  define CONSTANT_POOL_SIZE 0xfff0
-
-#if JIT_EMIT
-
-/* All instruction formats are 32 bits long with a 6-bit major opcode field in
-   bits <31:26> of the instruction. */
-
-enum { JIT_ALPHABRANCH, JIT_ALPHABSR };
-
-#  define emit_nop(pc) { \
-      *((pc)++) = 0x1f; \
-      *((pc)++) = 0x04; \
-      *((pc)++) = 0xff; \
-      *((pc)++) = 0x47; }
-
-#  define jit_emit_mov_rr(pc, src, Ra)  { \
-      *((pc)++) = (Ra); \
-      *((pc)++) = 0x04; \
-      *((pc)++) = 0xe0 + (src); \
-      *((pc)++) = 0x47; }
-
-/* Memory instruction format
- *
- *  +---------------------------------------------------------------+
- *  |   Opcode    |   Ra   |   Rb   |         memory_disp           |
- *  +---------------------------------------------------------------+
- *   31         26 25    21 20    16 15                            0
- *
- *  Depending on the opcode Ra could be the source of a store or the
- *  destination of a load.
- *
- *  The displacement field is a byte offset. It is sign-extended and added to
- *  the contents of Rb to form a virtual address. Overflow is ignored in this
- *  calculation.
- *
- */
-
-#  define emit_mem(pc, opcode, Ra, Rb, disp) \
-      *((pc)++) = (char)(disp); \
-      *((pc)++) = (char)((disp) >> 8); \
-      *((pc)++) = (char)((Rb) | (char)((Ra) << 5)); \
-      *((pc)++) = (opcode) << 2 | (Ra) >> 3
-
-#  define base_reg REG9_s0
-
-/* Scratch registers. */
-
-#  define ISR1 REG0_v0
-#  define ISR2 REG8_t7
-
-/* Load / Store a Parrot register.
- *
- * Perform a memory operation using a Parrot register as the source or
- * the destination.
- *
- */
-
-#  define emit_l_s_r(pc, opcode, Ra, Rb, Parrot_reg) \
-      emit_mem((pc), (opcode), (Ra), (Rb), \
-        (((char *)(Parrot_reg)) - (char *)&REG_INT(interp, 0)))
-
-#  define emit_ldq_b(pc, Ra, addr, Rb) \
-      emit_mem((pc), LDQ, (Ra), (Rb), (addr))
-
-#  define emit_lda_b(pc, Ra, addr, Rb) \
-      emit_mem((pc), LDA, (Ra), (Rb), (addr))
-
-#  define jit_emit_mov_rm_i(pc, Ra, addr) \
-      emit_l_s_r((pc), LDQ, (Ra), (base_reg), (addr))
-
-#  define emit_lda(pc, Ra, addr) \
-      emit_l_s_r((pc), LDA, (Ra), (base_reg), (addr))
-
-#  define emit_ldah(pc, Ra, addr, Rb) \
-      emit_mem((pc), LDH, (Ra), (Rb), (addr))
-
-#  define emit_stq_b(pc, Ra, addr, Rb) \
-      emit_mem((pc), STQ, (Ra), (Rb), (addr))
-
-#  define jit_emit_mov_mr_i(pc, addr, Ra) \
-      emit_l_s_r((pc), STQ, (Ra), (base_reg), (addr))
-
-/* Branch instruction format
- *
- *  +---------------------------------------------------------------+
- *  |   Opcode    |   Ra   |              Branch_disp               |
- *  +---------------------------------------------------------------+
- *   31         26 25    21 20                                     0
- *
- * The displacement is treated as a longword offset. This means it is shifted
- * left two bits (to address a longword boundary), sign-extended to 64 bits,
- * and added to the updated PC to form the target virtual address. Overflow is
- * ignored.
- *
- */
-
-#  define emit_branch(pc, opcode, Ra) \
-      *((pc)++) = 0; \
-      *((pc)++) = 0; \
-      *((pc)++) = (Ra) << 5; \
-      *((pc)++) = (opcode) << 2 | (Ra) >> 3
-
-/* Operate instruction format
- *
- *  +---------------------------------------------------------------+
- *  |   Opcode    |   Ra   |   Rb   | SBZ | 0 |  Function  |   Rc   |
- *  +---------------------------------------------------------------+
- *   31         26 25    21 20    16 15 13 12  11         5 4      0
- *
- *  +---------------------------------------------------------------+
- *  |   Opcode    |   Ra   |      LIT     | 1 |  Function  |   Rc   |
- *  +---------------------------------------------------------------+
- *   31         26 25    21 20          13 12  11         5 4      0
- *
- * The operate format is used for instructions that perform integer register to
- * register operations. The operate format allows the specification of one
- * destination register and two source operands. One of the source operands can
- * be a literal constant.
- *
- */
-
-#  define emit_operate1(pc, opcode, Ra, Rb, function, Rc) \
-      *((pc)++) = (Rc) | (char)((function) << 5); \
-      *((pc)++) = (char)((function) >> 5); \
-      *((pc)++) = (Rb) | (char)(Ra) << 5; \
-      *((pc)++) = (opcode) << 2 | (Ra) >> 3
-
-/* Addq (Operate instruction)
- *
- * opcode = 16;
- * function = 128;
- *
- */
-
-#  define jit_emit_add_rrr(pc, Ra, Rb, Rc) \
-      emit_operate1((pc), 16, (Ra), (Rb), 128, (Rc))
-
-/* Subq (Operate instruction)
- *
- * opcode = 16;
- * function = 161;
- *
- */
-
-#  define jit_emit_sub_rrr(pc, Ra, Rb, Rc) \
-      emit_operate1((pc), 16, (Ra), (Rb), 161, (Rc))
-
-/* Mulq (Operate instruction)
- *
- * opcode = 19;
- * function = 128;
- *
- */
-
-#  define emit_mulq(pc, Ra, Rb, Rc) \
-      emit_operate1((pc), 19, (Ra), (Rb), 128, (Rc))
-
-/* Load a constant */
-
-#  define jit_emit_mov_ri_i(pc, target, constant) \
-      (pc) = emit_l_c(jit_info, interp, (target), (long)(constant))
-
-static void
-emit_load_intval_cpool(Parrot_jit_info_t *jit_info,
-    PARROT_INTERP, alpha_register_t dest, INTVAL constant)
-{
-    char *new_arena;
-
-    /* If there is not space in the current pool */
-    if ((char *)(jit_info->constant_pool->slot_ptr + sizeof (INTVAL)) >=
-        jit_info->arena.start)
-    {
-        /* Check if the arena is big enough for a move or needs a realloc */
-        if (jit_info->arena.size >
-            (jit_info->arena.op_map[jit_info->op_i].offset + CONSTANT_POOL_SIZE))
-        {
-            new_arena = mem_sys_realloc(jit_info->arena.start,
-                (size_t)jit_info->arena.size * 2);
-            jit_info->arena.size *= 2;
-            jit_info->native_ptr = new_arena +
-                (jit_info->native_ptr - jit_info->arena.start);
-            jit_info->constant_pool->slot_ptr = (INTVAL *)new_arena +
-                ((char *)jit_info->constant_pool->slot_ptr -
-                    jit_info->arena.start);
-            jit_info->arena.start = new_arena;
-            jit_info->constant_pool->cur_used = 0;
-        }
-        memcpy(jit_info->arena.start + CONSTANT_POOL_SIZE,
-            jit_info->arena.start, jit_info->arena.size);
-        jit_info->constant_pool->frames_used++;
-    }
-
-    if (jit_info->constant_pool->frames_used) {
-        emit_ldah(jit_info->native_ptr, dest,
-            jit_info->constant_pool->frames_used, REG15_s6);
-        emit_ldq_b(jit_info->native_ptr, dest,
-            jit_info->constant_pool->cur_used, dest);
-    }
-    else {
-        emit_ldq_b(jit_info->native_ptr, dest,
-            jit_info->constant_pool->cur_used, REG15_s6);
-    }
-    jit_info->constant_pool->cur_used += sizeof (INTVAL);
-    *(jit_info->constant_pool->slot_ptr++) = constant;
-}
-
-/* calculates the proper values for the displacement
- * from s to d.
- * returned values should be interpreted as:
- * d = s + *high * 65536 + *low
- */
-
-static void
-calculate_displacement(long *s, long *d, long *high, long *low)
-{
-    long displacement = *d - *s;
-
-    *high = displacement / 65536;
-    *low = displacement % 65536;
-    if (*low > 32767) {
-        *high += 1;
-        *low -= 65536;
-    }
-    else if (*low < -32767) {
-        *high -= 1;
-        *low += 65536;
-    }
-}
-
-static char *
-emit_l_c(Parrot_jit_info_t *jit_info, PARROT_INTERP,
-    alpha_register_t target, long constant)
-{
-    char *pc = jit_info->native_ptr;
-    long high, low;
-
-    if ((constant < -0x7fffffff) || (constant > 0x7fffffff)) {
-        emit_load_intval_cpool(jit_info, interp, target, (INTVAL)constant);
-        return jit_info->native_ptr;
-    }
-    else if ((constant < -0x7fff) || (constant > 0x7fff)) {
-        high = 0;
-        calculate_displacement(&high, &constant, &high, &low);
-        emit_ldah(pc, target, high, REG31_zero);
-        emit_lda_b(pc, target, low, target);
-    }
-    else {
-        emit_lda_b(pc, target, constant, REG31_zero);
-    }
-    return pc;
-}
-
-static char *
-emit_b(Parrot_jit_info_t *jit_info, branch_t opcode, alpha_register_t reg,
-    opcode_t disp)
-{
-    char *pc = jit_info->native_ptr;
-
-    Parrot_jit_newfixup(jit_info);
-    jit_info->arena.fixups->type = JIT_ALPHABRANCH;
-    jit_info->arena.fixups->param.opcode = jit_info->op_i + disp;
-
-    if (jit_info->optimizer->cur_section->branch_target ==
-        jit_info->optimizer->cur_section)
-            jit_info->arena.fixups->skip =
-                jit_info->optimizer->cur_section->branch_target->load_size;
-
-    emit_branch(pc, opcode, reg);
-
-    return pc;
-}
-
-#  define emit_bne(pc, reg, disp) \
-      (pc) = emit_b(jit_info, BNE, (reg), (disp))
-
-void
-Parrot_jit_begin(Parrot_jit_info_t *jit_info,
-    PARROT_INTERP)
-{
-    emit_lda_b(jit_info->native_ptr, REG30_sp, -16, REG30_sp);
-    emit_stq_b(jit_info->native_ptr, REG26_ra, 0, REG30_sp);
-    emit_stq_b(jit_info->native_ptr, REG15_s6, 8, REG30_sp);
-    jit_emit_mov_rr(jit_info->native_ptr, REG16_a0, REG9_s0);
-    jit_emit_mov_rr(jit_info->native_ptr, REG27_t12, REG15_s6);
-    /* TODO
-    emit_ldah(jit_info->native_ptr, REG15_s6, -1, REG15_s6);
-    */
-    emit_lda_b(jit_info->native_ptr, REG15_s6, -0x7ff8, REG15_s6);
-    jit_emit_mov_ri_i(jit_info->native_ptr, REG10_s1,
-        interp->code->base.data);
-    jit_emit_mov_ri_i(jit_info->native_ptr, REG11_s2, jit_info->arena.op_map);
-}
-
-void
-Parrot_jit_dofixup(Parrot_jit_info_t *jit_info,
-    PARROT_INTERP)
-{
-    Parrot_jit_fixup_t *fixup;
-    char *fixup_ptr;
-    char *disp;
-    long d, high, low;
-
-    fixup = jit_info->arena.fixups;
-
-    while (fixup){
-        switch (fixup->type){
-            case JIT_ALPHABRANCH:
-                fixup_ptr = Parrot_jit_fixup_target(jit_info, fixup);
-                d = (jit_info->arena.op_map[fixup->param.opcode].offset -
-                     fixup->native_offset + fixup->skip - 4) / 4;
-                disp = (char *)&d;
-                *(fixup_ptr++) = *disp;
-                *(fixup_ptr++) = *(disp + 1);
-                *(fixup_ptr++) |= *(disp + 2) & 0x1f;
-                break;
-            case JIT_ALPHABSR:
-                fixup_ptr = Parrot_jit_fixup_target(jit_info, fixup);
-                d = ((long)fixup->param.fptr - (long)fixup_ptr - 4) / 4;
-                disp = (char *)&d;
-                *(fixup_ptr++) = *disp;
-                *(fixup_ptr++) = *(disp + 1);
-                *(fixup_ptr++) |= *(disp + 2) & 0x1f;
-                break;
-            default:
-                exit_fatal(EXCEPTION_JIT_ERROR, "Unknown fixup type:%d\n",
-                                   fixup->type);
-                break;
-        }
-        fixup = fixup->next;
-    }
-}
-
-static char *
-emit_bsr(Parrot_jit_info_t *jit_info,
-    PARROT_INTERP)
-{
-    char *pc = jit_info->native_ptr;
-
-    jit_emit_mov_ri_i(pc, REG27_t12,
-        interp->op_func_table[*(jit_info->cur_op)]);
-
-    Parrot_jit_newfixup(jit_info);
-    jit_info->arena.fixups->type = JIT_ALPHABSR;
-    jit_info->arena.fixups->param.fptr =
-        (void (*)(void))interp->op_func_table[*(jit_info->cur_op)];
-
-    *(pc++) = 0;
-    *(pc++) = 0;
-    *(pc++) = 0x40;
-    *(pc++) = 0xd3;
-
-    return pc;
-}
-
-/* TODO: re-write this properly */
-#  define emit_jsr(pc) { \
-        *((pc)++) = 0; \
-        *((pc)++) = 0x40; \
-        *((pc)++) = 0xe0; \
-        *((pc)++) = 0x6b; \
-}
-
-#  define emit_ret(pc) { \
-        *((pc)++) = 1; \
-        *((pc)++) = 0x80; \
-        *((pc)++) = 0xfa; \
-        *((pc)++) = 0x6b; \
-}
-
-void
-Parrot_jit_normal_op(Parrot_jit_info_t *jit_info,
-    PARROT_INTERP)
-{
-    jit_emit_mov_ri_i(jit_info->native_ptr, REG16_a0, jit_info->cur_op);
-    jit_emit_mov_rr(jit_info->native_ptr, REG9_s0, REG17_a1);
-    jit_info->native_ptr = emit_bsr(jit_info, interp);
-}
-
-void
-Parrot_jit_cpcf_op(Parrot_jit_info_t *jit_info,
-    PARROT_INTERP)
-{
-    Parrot_jit_normal_op(jit_info, interp);
-
-    jit_emit_sub_rrr(jit_info->native_ptr, ISR1, REG10_s1, ISR1);
-    jit_emit_add_rrr(jit_info->native_ptr, ISR1, REG11_s2, ISR1);
-    emit_ldq_b(jit_info->native_ptr, ISR1, 0, ISR1);
-    /* XXX this is incorrect, might blow the stack, use jmp instead */
-    emit_jsr(jit_info->native_ptr);
-}
-
-
-/* move reg to mem (i.e. intreg) */
-void
-Parrot_jit_emit_mov_mr(PARROT_INTERP, char *mem, int reg)
-{
-    jit_emit_mov_mr_i(
-        ((Parrot_jit_info_t *)(interp->code->jit_info))->native_ptr, mem, reg);
-}
-
-/* move mem (i.e. intreg) to reg */
-void
-Parrot_jit_emit_mov_rm(PARROT_INTERP, int reg, char *mem)
-{
-    jit_emit_mov_rm_i(
-        ((Parrot_jit_info_t *)(interp->code->jit_info))->native_ptr, reg, mem);
-}
-
-/* move reg to mem (i.e. numreg) */
-void
-Parrot_jit_emit_mov_mr_n(PARROT_INTERP, char *mem, int reg)
-{
-}
-
-/* move mem (i.e. numreg) to reg */
-void
-Parrot_jit_emit_mov_rm_n(PARROT_INTERP, int reg, char *mem)
-{
-}
-
-#else
-
-#  define REQUIRES_CONSTANT_POOL 1
-#  define INT_REGISTERS_TO_MAP 21
-
-#  ifndef JIT_IMCC
-
-char intval_map[INT_REGISTERS_TO_MAP] =
-    { REG1_t0, REG2_t1, REG3_t2, REG4_t3, REG5_t4, REG6_t5, REG7_t6, REG12_s3,
-      REG13_s4, REG14_s5, REG16_a0, REG17_a1, REG18_a2, REG19_a3, REG20_a4,
-      REG21_a5, REG22_t8, REG23_t9, REG24_t10, REG25_t11, REG28_at };
-
-static void
-Parrot_jit_init_arenas(Parrot_jit_info_t *jit_info)
-{
-    jit_info->arena.size = CONSTANT_POOL_SIZE;
-    jit_info->native_ptr = jit_info->arena.start =
-        mem_sys_allocate((size_t)jit_info->arena.size * 2);
-    jit_info->constant_pool = (Parrot_jit_constant_pool_t *)
-        mem_sys_allocate((size_t)sizeof (Parrot_jit_constant_pool_t));
-    jit_info->constant_pool->slot_ptr = (INTVAL *)jit_info->arena.start;
-    jit_info->arena.start = jit_info->native_ptr += CONSTANT_POOL_SIZE;
-    jit_info->constant_pool->cur_used = -0x7ff8;
-}
-
-static void
-Parrot_jit_extend_arena(Parrot_jit_info_t *jit_info)
-{
-    char *new_arena;
-
-    new_arena = mem_sys_realloc(jit_info->arena.start,
-        (size_t)jit_info->arena.size * 2);
-    jit_info->arena.size *= 2;
-    jit_info->native_ptr = new_arena +
-        (jit_info->native_ptr - jit_info->arena.start);
-    jit_info->constant_pool->slot_ptr = (INTVAL *)new_arena +
-        ((char *)jit_info->constant_pool->slot_ptr - jit_info->arena.start);
-    jit_info->arena.start = new_arena;
-}
-
-#  endif /* JITIMCC */
-#endif /* JIT_EMIT */
-#endif /* PARROT_ALPHA_JIT_EMIT_H_GUARD */
-
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/amd64/core.jit
==============================================================================
--- branches/orderedhash_revamp/src/jit/amd64/core.jit	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,471 +0,0 @@
-;
-; amd64/core.jit
-;
-; $Id$
-;
-
-Parrot_end {
-    jit_emit_end(NATIVECODE);
-}
-
-Parrot_noop {
-    emit_nop(NATIVECODE);
-}
-
-TEMPLATE Parrot_set_x_x {
-    if (MAP[1] && MAP[2]) {
-        emit_mov_<R>_<R>(NATIVECODE, MAP[1], MAP[2]);
-    }
-    else if (MAP[1]) {
-        emit_mov_<R>_m<R>(NATIVECODE, MAP[1], RBX, ROFFS_INT(2));
-    }
-    else if (MAP[2]) {
-        emit_mov_m<R>_<R>(NATIVECODE, RBX, ROFFS_INT(1), MAP[2]);
-    }
-    else {
-        emit_mov_<R>_m<R>(NATIVECODE, ISR1, RBX, ROFFS_INT(2));
-        emit_mov_m<R>_<R>(NATIVECODE, RBX, ROFFS_INT(1), ISR1);
-    }
-}
-
-
-Parrot_set_i_i {
-    Parrot_set_x_x s/<R>/r/
-}
-
-Parrot_set_i_ic {
-    if (MAP[1]) {
-        emit_mov_r_i(NATIVECODE, MAP[1], *INT_CONST[2]);
-    }
-    else {
-        emit_mov_mr_i(NATIVECODE, RBX, (long)ROFFS_INT(1), *INT_CONST[2]);
-    }
-}
-
-Parrot_set_n_n {
-    Parrot_set_x_x s/<R>/x/ s/ISR/FSR/ s/INT/NUM/
-}
-
-Parrot_set_i_n {
-    if (MAP[1] && MAP[2]) {
-        emit_cvttsd2si_r_x(NATIVECODE, MAP[1], MAP[2]);
-    }
-    else if (MAP[1]) {
-        emit_cvttsd2si_r_mx(NATIVECODE, MAP[1], RBX, ROFFS_NUM(2));
-    }
-    else if (MAP[2]) {
-        emit_cvttsd2si_r_x(NATIVECODE, ISR1, MAP[2]);
-        emit_mov_mr_r(NATIVECODE, RBX, ROFFS_INT(1), ISR1);
-    }
-    else {
-        emit_cvttsd2si_r_mx(NATIVECODE, ISR1, RBX, ROFFS_NUM(2));
-        emit_mov_mr_r(NATIVECODE, RBX, ROFFS_INT(1), ISR1);
-    }
-}
-
-Parrot_set_i_nc {
-    if (MAP[1]) {
-        emit_xor_r_r(NATIVECODE, ISR1, ISR1);
-        emit_cvttsd2si_r_mx(NATIVECODE, MAP[1], ISR1, &NUM_CONST[2]);
-    }
-    else {
-        emit_xor_r_r(NATIVECODE, ISR1, ISR1);
-        emit_cvttsd2si_r_mx(NATIVECODE, FSR1, ISR1, &NUM_CONST[2]);
-        emit_mov_mx_x(NATIVECODE, RBX, ROFFS_NUM(1), FSR1);
-    }
-}
-
-Parrot_set_n_i {
-    if (MAP[1] && MAP[2]) {
-        emit_cvtsi2sd_x_r(NATIVECODE, MAP[1], MAP[2]);
-    }
-    else if (MAP[1]) {
-        emit_cvtsi2sd_x_mr(NATIVECODE, MAP[1], RBX, ROFFS_INT(2));
-    }
-    else if (MAP[2]) {
-        emit_cvtsi2sd_x_r(NATIVECODE, FSR1, MAP[2]);
-        emit_mov_mr_r(NATIVECODE, RBX, ROFFS_NUM(1), FSR1);
-    }
-    else {
-        emit_cvtsi2sd_x_mr(NATIVECODE, FSR1, RBX, ROFFS_INT(2));
-        emit_mov_mr_r(NATIVECODE, RBX, ROFFS_NUM(1), FSR1);
-    }
-}
-
-Parrot_set_n_ic {
-    if (MAP[1]) {
-        emit_mov_r_i(NATIVECODE, ISR1, *INT_CONST[2]);
-        emit_cvtsi2sd_x_r(NATIVECODE, MAP[1], ISR1);
-    }
-    else {
-        emit_mov_r_i(NATIVECODE, ISR1, *INT_CONST[2]);
-        emit_cvtsi2sd_x_r(NATIVECODE, FSR1, ISR1);
-        emit_mov_mx_x(NATIVECODE, RBX, ROFFS_NUM(1), FSR1);
-    }
-}
-
-Parrot_set_n_nc {
-    if (MAP[1]) {
-        /* I want something like this
-         * emit_mov_x_mx(NATIVECODE, MAP[1], RBX, ROFFS_NUM(2));
-         * but this works, even if ugly
-         * It's either this or dereferencing
-         *      ((interp->ctx).state)->constants[cur_opcode[2]]->u.number
-         * Instead we do a jit-run time
-         * &interp->code->const_table->constants[jit_info->cur_op[2]]->u.number
-         */
-        emit_xor_r_r(NATIVECODE, ISR1, ISR1);
-        emit_mov_x_mx(NATIVECODE, MAP[1], ISR1, &NUM_CONST[2]);
-    }
-    else {
-        /* unmapped floats is screwy at the moment, but we get 15 plus a
-         * scratch */
-        emit_xor_r_r(NATIVECODE, ISR1, ISR1);
-        emit_mov_x_mx(NATIVECODE, FSR1, ISR1, &NUM_CONST[2]);
-        emit_mov_mx_x(NATIVECODE, RBX, ROFFS_NUM(1), FSR1);
-    }
-}
-
-
-TEMPLATE Parrot_binop_x_x {
-    if (MAP[1] && MAP[2]) {
-        emit_<op>_<R>_<R>(NATIVECODE, MAP[1], MAP[2]);
-    }
-    else if (MAP[1]) {
-        emit_<op>_<R>_m<R>(NATIVECODE, MAP[1], RBX, ROFFS_INT(2));
-    }
-    else if (MAP[2]) {
-# ifdef emit_<op>_m<R>_<R>
-        emit_<op>_m<R>_<R>(NATIVECODE, RBX, ROFFS_INT(1), MAP[2]);
-# else
-        emit_mov_<R>_m<R>(NATIVECODE, ISR1, RBX, ROFFS_INT(1));
-        emit_<op>_<R>_<R>(NATIVECODE, ISR1, MAP[2]);
-        emit_mov_m<R>_<R>(NATIVECODE, RBX, ROFFS_INT(1), ISR1);
-# endif
-    }
-    else {
-        emit_mov_<R>_m<R>(NATIVECODE, ISR1, RBX, ROFFS_INT(1));
-        emit_<op>_<R>_m<R>(NATIVECODE, ISR1, RBX, ROFFS_INT(2));
-        emit_mov_m<R>_<R>(NATIVECODE, RBX, ROFFS_INT(1), ISR1);
-    }
-}
-
-TEMPLATE Parrot_binop_x_xc {
-    if (MAP[1]) {
-        emit_<op>_<R>_i(NATIVECODE, MAP[1], *INT_CONST[2]);
-    }
-    else {
-# ifdef emit_<op>_m<R>_i
-        emit_<op>_m<R>_i(NATIVECODE, RBX, ROFFS_INT(1), *INT_CONST[2]);
-# else
-        emit_mov_<R>_m<R>(NATIVECODE, ISR1, RBX, ROFFS_INT(1));
-        emit_<op>_<R>_i(NATIVECODE, ISR1, *INT_CONST[2]);
-        emit_mov_m<R>_<R>(NATIVECODE, RBX, ROFFS_INT(1), ISR1);
-# endif
-    }
-}
-
-TEMPLATE Parrot_binop_x_x_x {
-    if (MAP[1] && MAP[2] && MAP[3]){
-        if (MAP[1] == MAP[3]) {
-            emit_mov_<R>_<R>(NATIVECODE, ISR1, MAP[2]);
-            emit_<op>_<R>_<R>(NATIVECODE, ISR1, MAP[3]);
-            emit_mov_<R>_<R>(NATIVECODE, MAP[1], ISR1);
-        }
-        else {
-            emit_mov_<R>_<R>(NATIVECODE, MAP[1], MAP[2]);
-            emit_<op>_<R>_<R>(NATIVECODE, MAP[1], MAP[3]);
-        }
-    }
-    else if (MAP[1] && MAP[2]) {
-        emit_mov_<R>_<R>(NATIVECODE, MAP[1], MAP[2]);
-        emit_<op>_<R>_m<R>(NATIVECODE, MAP[1], RBX, ROFFS_INT(3));
-    }
-    else if (MAP[1] && MAP[3]) {
-        if (MAP[1] == MAP[3]) {
-            emit_mov_<R>_m<R>(NATIVECODE, ISR1, RBX, ROFFS_INT(2));
-            emit_<op>_<R>_<R>(NATIVECODE, ISR1, MAP[3]);
-            emit_mov_<R>_<R>(NATIVECODE, MAP[1], ISR1);
-        }
-        else {
-            emit_mov_<R>_m<R>(NATIVECODE, MAP[1], RBX, ROFFS_INT(2));
-            emit_<op>_<R>_<R>(NATIVECODE, MAP[1], MAP[3]);
-        }
-    }
-    else if (MAP[2] && MAP[3]) {
-        emit_mov_<R>_<R>(NATIVECODE, ISR1, MAP[2]);
-        emit_<op>_<R>_<R>(NATIVECODE, ISR1, MAP[3]);
-        emit_mov_m<R>_<R>(NATIVECODE, RBX, ROFFS_INT(1), ISR1);
-    }
-    else if (MAP[1]) {
-        emit_mov_<R>_m<R>(NATIVECODE, MAP[1], RBX, ROFFS_INT(2));
-        emit_<op>_<R>_m<R>(NATIVECODE, MAP[1], RBX, ROFFS_INT(3));
-    }
-    else if (MAP[2]) {
-        emit_mov_<R>_<R>(NATIVECODE, ISR1, MAP[2]);
-        emit_<op>_<R>_m<R>(NATIVECODE, ISR1, RBX, ROFFS_INT(3));
-        emit_mov_m<R>_<R>(NATIVECODE, RBX, ROFFS_INT(1), ISR1);
-    }
-    else if (MAP[3]) {
-        emit_mov_<R>_m<R>(NATIVECODE, ISR1, RBX, ROFFS_INT(2));
-        emit_<op>_<R>_<R>(NATIVECODE, ISR1, MAP[3]);
-        emit_mov_m<R>_<R>(NATIVECODE, RBX, ROFFS_INT(1), ISR1);
-    }
-    else {
-        emit_mov_<R>_m<R>(NATIVECODE, ISR1, RBX, ROFFS_INT(2));
-        emit_<op>_<R>_m<R>(NATIVECODE, ISR1, RBX, ROFFS_INT(3));
-        emit_mov_m<R>_<R>(NATIVECODE, RBX, ROFFS_INT(1), ISR1);
-    }
-}
-
-Parrot_add_i_i {
-    Parrot_binop_x_x s/<op>/add/ s/<R>/r/
-}
-
-Parrot_add_i_ic {
-    Parrot_binop_x_xc s/<op>/add/ s/<R>/r/
-}
-
-Parrot_add_i_i_i {
-    Parrot_binop_x_x_x s/<op>/add/ s/<R>/r/
-}
-
-Parrot_sub_i_i {
-    Parrot_binop_x_x s/<op>/sub/ s/<R>/r/
-}
-
-Parrot_sub_i_ic {
-    Parrot_binop_x_xc s/<op>/sub/ s/<R>/r/
-}
-
-Parrot_sub_i_i_i {
-    Parrot_binop_x_x_x s/<op>/sub/ s/<R>/r/
-}
-
-Parrot_band_i_i {
-    Parrot_binop_x_x s/<op>/and/ s/<R>/r/
-}
-
-Parrot_band_i_i_i {
-    Parrot_binop_x_x_x s/<op>/and/ s/<R>/r/
-}
-
-Parrot_band_i_ic {
-    Parrot_binop_x_xc s/<op>/and/ s/<R>/r/
-}
-
-Parrot_bxor_i_i {
-    Parrot_binop_x_x s/<op>/xor/ s/<R>/r/
-}
-
-Parrot_bxor_i_ic {
-    Parrot_binop_x_xc s/<op>/xor/ s/<R>/r/
-}
-
-Parrot_bxor_i_i_i {
-    Parrot_binop_x_x_x s/<op>/xor/ s/<R>/r/
-}
-
-Parrot_bor_i_i {
-    Parrot_binop_x_x s/<op>/or/ s/<R>/r/
-}
-
-Parrot_bor_i_ic {
-    Parrot_binop_x_xc s/<op>/or/ s/<R>/r/
-}
-
-Parrot_bor_i_i_i {
-    Parrot_binop_x_x_x s/<op>/or/ s/<R>/r/
-}
-
-Parrot_neg_i {
-    if (MAP[1]) {
-        emit_not_r(NATIVECODE, MAP[1]);
-    }
-    else {
-        emit_mov_r_mr(NATIVECODE, ISR1, RBX, ROFFS_INT(1));
-        emit_neg_r(NATIVECODE, ISR1);
-        emit_mov_mr_r(NATIVECODE, RBX, ROFFS_INT(1), ISR1);
-    }
-}
-
-Parrot_mul_i_i {
-    Parrot_binop_x_x s/<op>/imul/ s/<R>/r/ s/ISR1/ISR2/
-}       
-
-Parrot_div_i_i {
-    if (MAP[1]) {
-        emit_mov_r_r(NATIVECODE, ISR2, MAP[1]);
-    }
-    else {
-        emit_mov_r_mr(NATIVECODE, ISR2, RBX, ROFFS_INT(1));
-    }
-
-    if (MAP[2]) {
-        emit_idiv_r_r(NATIVECODE, ISR2, MAP[2]);
-    }
-    else {
-        emit_idiv_r_mr(NATIVECODE, ISR2, RBX, ROFFS_INT(2));
-    }
-
-    if (MAP[2]) {
-        emit_mov_r_r(NATIVECODE, MAP[1], ISR2);
-    }
-    else {
-        emit_mov_mr_r(NATIVECODE, RBX, ROFFS_INT(1), ISR2);
-    }
-}
-
-
-
-Parrot_not_i {
-    if (MAP[1]) {
-        emit_not_r(NATIVECODE, MAP[1]);
-    }
-    else {
-        emit_mov_r_mr(NATIVECODE, ISR1, RBX, ROFFS_INT(1));
-        emit_not_r(NATIVECODE, ISR1);
-        emit_mov_mr_r(NATIVECODE, RBX, ROFFS_INT(1), ISR1);
-    }
-}
-
-Parrot_exchange_i_i {
-    Parrot_binop_x_x s/<op>/xchg/ s/<R>/r/
-}
-
-Parrot_exchange_s_s {
-    Parrot_binop_x_x s/<op>/xchg/ s/<R>/r/ s/INT/STR/
-}
-
-Parrot_exchange_p_p {
-    Parrot_binop_x_x s/<op>/xchg/ s/<R>/r/ s/INT/PMC/
-}
-
-
-TEMPLATE Parrot_unary_x {
-    if (MAP[1]) {
-        emit_<op>_r(NATIVECODE, MAP[1]);
-    }
-    else {
-        emit_mov_r_mr(NATIVECODE, ISR1, RBX, ROFFS_INT(1));
-        emit_<op>_r(NATIVECODE, ISR1);
-        emit_mov_mr_r(NATIVECODE, RBX, ROFFS_INT(1), ISR1)
-    }
-}
-
-Parrot_inc_i {
-    Parrot_unary_x s/<op>/inc/
-}
-
-Parrot_dec_i {
-    Parrot_unary_x s/<op>/dec/
-}
-
-Parrot_add_n_n {
-    Parrot_binop_x_x s/<op>/add/ s/<R>/x/ s/ISR/FSR/ s/INT/NUM/
-}
-
-Parrot_add_n_n_n {
-    Parrot_binop_x_x_x s/<op>/add/ s/<R>/x/ s/ISR/FSR/ s/INT/NUM/
-}
-
-Parrot_sub_n_n {
-    Parrot_binop_x_x s/<op>/sub/ s/<R>/x/ s/ISR/FSR/ s/INT/NUM/
-}
-
-Parrot_sub_n_n_n {
-    Parrot_binop_x_x_x s/<op>/sub/ s/<R>/x/ s/ISR/FSR/ s/INT/NUM/
-}
-
-Parrot_mul_n_n {
-    Parrot_binop_x_x s/<op>/mul/ s/<R>/x/ s/ISR/FSR/ s/INT/NUM/
-}
-
-Parrot_mul_n_n_n {
-    Parrot_binop_x_x_x s/<op>/mul/ s/<R>/x/ s/ISR/FSR/ s/INT/NUM/
-}
-
-Parrot_div_n_n {
-    Parrot_binop_x_x s/<op>/div/ s/<R>/x/ s/ISR/FSR/ s/INT/NUM/
-}
-
-Parrot_div_n_n_n {
-    Parrot_binop_x_x_x s/<op>/div/ s/<R>/x/ s/ISR/FSR/ s/INT/NUM/
-}
-
-Parrot_sqrt_n_n {
-    Parrot_binop_x_x s/<op>/sqrt/ s/<R>/x/ s/ISR/FSR/ s/INT/NUM/
-}
-
-
-Parrot_neg_n {
-    if (MAP[1]) {
-        emit_mov_r_i(NATIVECODE, ISR1, 1L << 63);
-        emit_movd_x_r(NATIVECODE, FSR1, ISR1);
-        emit_xor_x_x(NATIVECODE, MAP[1], FSR1);
-    }
-    else {
-        emit_mov_r_mr(NATIVECODE, ISR1, RBX, ROFFS_NUM(1));
-        emit_mov_r_i(NATIVECODE, RAX, 1L << 63);
-        emit_xor_r_r(NATIVECODE, ISR1, RAX);
-        emit_mov_mr_r(NATIVECODE, RBX, ROFFS_NUM(1), ISR1);
-    }
-}
-
-Parrot_abs_n {
-    if (MAP[1]) {
-        emit_mov_r_i(NATIVECODE, ISR1, ~(1L << 63));
-        emit_movd_x_r(NATIVECODE, FSR1, ISR1);
-        emit_and_x_x(NATIVECODE, MAP[1], FSR1);
-    }
-    else {
-        emit_mov_r_mr(NATIVECODE, ISR1, RBX, ROFFS_NUM(1));
-        emit_mov_r_i(NATIVECODE, RAX, ~(1L << 63));
-        emit_and_r_r(NATIVECODE, ISR1, RAX);
-        emit_mov_mr_r(NATIVECODE, RBX, ROFFS_NUM(1), ISR1);
-    }
-}
-
-Parrot_branch_ic {
-    emit_jmp_i_fixup(jit_info, *INT_CONST[1]);
-}
-
-TEMPLATE Parrot_ifunless_x_ic {
-    if (MAP[1]) {
-        emit_test_<R>(NATIVECODE, MAP[1]);
-        emit_jcc_fixup(jit_info, <jcc>, *INT_CONST[2]);
-    }
-    else {
-        emit_mov_r_mr(NATIVECODE, ISR1, RBX, ROFFS_INT(1));
-        emit_test_<R>(NATIVECODE, ISR1);
-        emit_jcc_fixup(jit_info, <jcc>, *INT_CONST[2]);
-    }
-}
-
-Parrot_if_i_ic {
-    Parrot_ifunless_x_ic s/<jcc>/jcc_jnz/ s/<R>/r/
-}
-
-Parrot_unless_i_ic {
-    Parrot_ifunless_x_ic s/<jcc>/jcc_jz/ s/<R>/r/
-}
-
-Parrot_if_n_ic {
-    Parrot_ifunless_x_ic s/<jcc>/jcc_jnz/ s/<R>/x/ s/ISR/FSR/
-}
-
-Parrot_unless_n_ic {
-    Parrot_ifunless_x_ic s/<jcc>/jcc_jz/ s/<R>/x/ s/ISR/FSR/
-}
-
-
-
-/*
- * Local variables:
- * c-indentation-style: bsd
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- *
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/amd64/jit_defs.c
==============================================================================
--- branches/orderedhash_revamp/src/jit/amd64/jit_defs.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,368 +0,0 @@
-/*
-Copyright (C) 2008-2009, Parrot Foundation.
-$Id$
-*/
-
-#include "parrot/parrot.h"
-#include "jit_emit.h"
-
-/* HEADERIZER HFILE: none */
-
-/*
- * enumerate these mapped registers
- * please note that you have to preserve registers in
- * Parrot_jit_begin according to the ABI of the architecture
- */
-
-const char intval_map[INT_REGISTERS_TO_MAP] =
-    {
-
-        /* Preserved, we'd have more, but keeping code_start, op_map, interp,
-         * and the base pointer in registers takes away four, not to mention
-         * RBP which is used for easier debugging.  That's five registers used
-         * for one reason or another at the moment.  I'm not sure if it's worth
-         * it yet. */
-        /*
-         *  RAX     ISR2
-         *  RDX     for idiv, TODO: handle corner cases, i.e. steal i386 code
-         *  RBX     for Interp->ctx.bp
-         *  RBP     for debugging, can add it to the preserved list
-         *  R12
-         *  R13     for CODE_START
-         *  R14     for OP_MAP
-         *  R15     for INTERP
-         */
-        R12,
-#ifndef USE_OP_MAP_AND_CODE_START
-        R13, R14,
-#endif
-        /* Unpreserved */
-        RCX, RSI, RDI, R8, R9, R10, RDX
-    };
-
-const char floatval_map[FLOAT_REGISTERS_TO_MAP] =
-    {
-      XMM2, XMM3, XMM4, XMM5, XMM6, XMM7,
-      XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15
-    };
-
-
-/*
- * define arch specific details in jit_arch_info
- */
-
-const jit_arch_info arch_info = {
-    /* CPU <- Parrot reg move functions */
-    jit_mov_r_mr,
-    jit_mov_x_mx,
-    /* Parrot <- CPU reg move functions */
-    jit_mov_mr_r,
-    jit_mov_mx_x,
-    Parrot_jit_dofixup,
-    (jit_arch_f)NULL,
-    {
-        /* JIT_CODE_FILE */
-        {
-            Parrot_jit_begin,   /* emit code prologue */
-#ifdef USE_OP_MAP_AND_CODE_START
-            7,
-            1,
-#else
-            9,                 /* mapped int */
-            3,                  /* preserved int */
-#endif
-            intval_map,         /* which ints mapped */
-            14,                 /* mapped float  */
-            0,                  /* preserved float */
-            floatval_map        /* which floats mapped */
-         },
-        /* JIT_CODE_SUB */
-        {
-            Parrot_jit_begin_sub,
-            9,
-            8,
-            intval_map,
-            0,
-            0,
-            floatval_map
-        },
-        /* JIT_CODE_SUB_REGS_ONLY */
-        {
-            /*Parrot_jit_begin_sub_regs*/0,  /* emit code prologue */
-            16,
-            6,
-            intval_map,
-            0,
-            0,
-            floatval_map
-        }
-    }
-};
-
-const char div_by_zero[] = "Divide by zero";
-const int mxcsr = 0x7fa0; /* Add 6000 to mxcsr */
-
-/*
- * emit code that calls a Parrot opcode function
- */
-void call_func(Parrot_jit_info_t *jit_info, void *addr) {
-    if ((long)addr > (long)INT_MAX) {
-        /* Move the address into our scratch register R11
-         * We cannot use just the immediate form of call because the address
-         * will be too large if we're using a shared parrot, but will be ok on
-         * a static parrot.
-         *
-         * This will most likely only be used on shared libraries.
-         */
-        /* Absolute near call to R11 */
-        emit_mov_r_i(jit_info->native_ptr, R11, addr);
-        emit_call_r(jit_info->native_ptr, R11);
-    }
-    else {
-        /* Call with an immediate value.  Mainly for a static parrot, and
-         * debugging */
-        Parrot_jit_newfixup(jit_info);
-        jit_info->arena.fixups->type = JIT_AMD64CALL;
-        jit_info->arena.fixups->param.fptr = D2FPTR(addr);
-        emit_call_i(jit_info->native_ptr, 0xdead);
-    }
-}
-
-/* Jump to RAX, which needs to be set before calling this */
-void
-Parrot_emit_jump_to_rax(Parrot_jit_info_t *jit_info, Interp *interp)
-{
-    if (!jit_info->objfile) {
-#ifdef USE_OP_MAP_AND_CODE_START
-        /* Get interp->code->base.data */
-        jit_emit_load_code_start(jit_info->native_ptr);
-        emit_sub_r_r(jit_info->native_ptr, RAX, CODE_START);
-
-        /* Get interp->code->jit_info->arena->op_map */
-        jit_emit_load_op_map(jit_info->native_ptr);
-#else
-        /* emit code that gets interp->code->base.data */
-        emit_mov_r_mr(jit_info->native_ptr, RCX, INTERP, (long)offsetof(Interp, code));
-        emit_mov_r_mr(jit_info->native_ptr, RDX, RCX, (long)offsetof(PackFile_Segment, data));
-        emit_sub_r_r(jit_info->native_ptr, RAX, RDX);
-
-        /* Reuse interp->code in RCX, get interp->code->jit_info->arena->op_map */
-        emit_mov_r_mr(jit_info->native_ptr, RDX, RCX, (long)offsetof(PackFile_ByteCode, jit_info));
-        emit_lea_r_mr(jit_info->native_ptr, RDX, RDX, (long)offsetof(Parrot_jit_info_t, arena));
-        emit_mov_r_mr(jit_info->native_ptr, RDX, RDX, (long)offsetof(Parrot_jit_arena_t, op_map));
-#endif
-    }
-    /* Base pointer */
-    emit_mov_r_mr(jit_info->native_ptr, RBX, INTERP, (long)offsetof(Interp, ctx.bp));
-
-#ifdef USE_OP_MAP_AND_CODE_START
-    emit_jmp_r_r(jit_info->native_ptr, RAX, OP_MAP);
-#else
-    emit_jmp_r_r(jit_info->native_ptr, RAX, RDX);
-#endif
-}
-
-void
-Parrot_jit_normal_op(Parrot_jit_info_t *jit_info,
-                     Interp *interp)
-{
-    int cur_op = *jit_info->cur_op;
-    static int check;
-
-    if (cur_op >= jit_op_count()) {
-        cur_op = CORE_OPS_wrapper__;
-    }
-
-    /* check every eight ops, could be changed to 16, or 32, or ... */
-    if ((++check & 0x7) == 0) {
-        emit_mov_r_i(jit_info->native_ptr, RDI, jit_info->cur_op);
-        emit_mov_r_r(jit_info->native_ptr, RSI, INTERP);
-        call_func(jit_info, (void (*)(void))interp->op_func_table[CORE_OPS_check_events]);
-    }
-
-    emit_mov_r_i(jit_info->native_ptr, RDI, jit_info->cur_op);
-    emit_mov_r_r(jit_info->native_ptr, RSI, INTERP);
-
-    call_func(jit_info, (void (*)(void))interp->op_func_table[cur_op]);
-
-}
-
-/*
- * emit code for a branching parrot opcode. All cached registers
- * need recalculation, as a branch can go into different code segments
- * with different code start and different jit_info
- */
-void
-Parrot_jit_cpcf_op(Parrot_jit_info_t *jit_info,
-                   Interp *interp)
-{
-    Parrot_jit_normal_op(jit_info, interp);
-    Parrot_emit_jump_to_rax(jit_info, interp);
-}
-
-/*
- * emit code that might leave the JIT runcore
- * see  ppc or i386
- */
-void
-Parrot_jit_restart_op(Parrot_jit_info_t *jit_info,
-                      Interp *interp)
-{
-    char *sav_ptr;
-
-    Parrot_jit_normal_op(jit_info, interp);
-    emit_test_r(jit_info->native_ptr, RAX);
-
-    /* Quick fixup, but we know it's 12, anyway it needs to be a byte */
-    emit_jcc(jit_info->native_ptr, jcc_jnz, 0x00);
-    sav_ptr = (char *)(jit_info->native_ptr - 1);
-    /* Parrot_end_jit(jit_info, interp); */
-    jit_emit_end(jit_info->native_ptr);
-    *sav_ptr = (char)(jit_info->native_ptr - sav_ptr - 1);
-
-    Parrot_emit_jump_to_rax(jit_info, interp);
-}
-
-/*
- * emit stack frame according to ABI
- * preserve mapped registers according to ABI
- * load INTERP, OP_MAP, CODE_START, BP registers
- * then run the code at pc
- *
- * the function is called as
- *   runops(interp, pc)
- *
- * at runtime
- */
-void
-Parrot_jit_begin(Parrot_jit_info_t *jit_info,
-                 Interp *interp)
-{
-    jit_emit_stack_frame_enter(jit_info->native_ptr);
-
-    /* Saved registers */
-    /* push rbp
-     * push rbx
-     * push r12
-     * push r13
-     * push r14
-     * push r15 */
-    emit_push_r(jit_info->native_ptr, RBP);
-    emit_push_r(jit_info->native_ptr, RBX);
-    emit_push_r(jit_info->native_ptr, R12);
-    emit_push_r(jit_info->native_ptr, R13);
-    emit_push_r(jit_info->native_ptr, R14);
-    emit_push_r(jit_info->native_ptr, R15);
-    /* When our "function" gets called, RDI will be the interp,
-     * and RSI will be jit_info->native_ptr */
-    /* Set R15 to interp */
-    /* mov r15, rdi */
-    /* emit_ldmxcsr(jit_info->native_ptr); */
-    emit_mov_r_r(jit_info->native_ptr, R15, RDI);
-    emit_mov_r_r(jit_info->native_ptr, RAX, RSI);
-
-    Parrot_emit_jump_to_rax(jit_info, interp);
-
-}
-
-
-/*
- * fix up all emitted branches
- * see  ppc or i386
- */
-
-void
-Parrot_jit_dofixup(Parrot_jit_info_t *jit_info,
-                   Interp *interp)
-{
-    Parrot_jit_fixup_t *fixup, *next;
-    char *fixup_ptr;
-
-    fixup = jit_info->arena.fixups;
-
-    while (fixup) {
-        switch (fixup->type) {
-            case JIT_AMD64BRANCH:
-                fixup_ptr = Parrot_jit_fixup_target(jit_info, fixup) + 2;
-                *(int *)(fixup_ptr) =
-                    jit_info->arena.op_map[fixup->param.opcode].offset
-                    - (fixup->native_offset + 6) + fixup->skip;
-                break;
-            case JIT_AMD64JUMP:
-                fixup_ptr = Parrot_jit_fixup_target(jit_info, fixup) + 1;
-                *(int *)(fixup_ptr) =
-                    jit_info->arena.op_map[fixup->param.opcode].offset
-                    - (fixup->native_offset + 5) + fixup->skip;
-                break;
-            case JIT_AMD64CALL:
-                fixup_ptr = jit_info->arena.start + fixup->native_offset + 1;
-                *(int *)(fixup_ptr) = (int)(long)fixup->param.fptr -
-                    (int)(long)fixup_ptr - 4;
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_JIT_ERROR,
-                    "Unknown fixup type: %d\n", fixup->type);
-        }
-        next = fixup->next;
-        free(fixup);
-        fixup = next;
-    }
-    jit_info->arena.fixups = NULL;
-}
-
-void
-Parrot_jit_begin_sub(Parrot_jit_info_t *jit_info,
-                         Interp *interp)
-{
-    /* NOT CALLED CURRENTLY */
-}
-
-/*
- * define interface functions for register -> parrot register moves
- * and v.v.
- */
-
-/* set mem to reg */
-void
-jit_mov_mx_x(Interp *interp, Parrot_jit_info_t *jit_info,
-        int base_reg, INTVAL offs, int src_reg)
-{
-    emit_mov_mx_x(jit_info->native_ptr, base_reg, offs, src_reg);
-}
-
-void
-jit_mov_mr_r(Interp *interp, Parrot_jit_info_t *jit_info,
-        int base_reg, INTVAL offs, int src_reg)
-{
-    emit_mov_mr_r(jit_info->native_ptr, base_reg, offs, src_reg);
-}
-
-/* set reg to mem */
-void
-jit_mov_x_mx(Interp *interp, Parrot_jit_info_t *jit_info,
-        int dst_reg, int base_reg, INTVAL offs)
-{
-    emit_mov_x_mx(jit_info->native_ptr, dst_reg, base_reg, offs);
-}
-
-void
-jit_mov_r_mr(Interp *interp, Parrot_jit_info_t *jit_info,
-        int dst_reg, int base_reg, INTVAL offs)
-{
-    emit_mov_r_mr(jit_info->native_ptr, dst_reg, base_reg, offs);
-}
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-const jit_arch_info *
-Parrot_jit_init(SHIM_INTERP)
-{
-    return &arch_info;
-}
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/amd64/jit_emit.h
==============================================================================
--- branches/orderedhash_revamp/src/jit/amd64/jit_emit.h	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,946 +0,0 @@
-/*
- * Copyright (C) 2007-2009, Parrot Foundation.
- */
-
-/*
- * jit_emit.h
- *
- * amd64
- *
- * $Id$
-
-=head1 NAME
-
-src/jit/amd64/jit_emit.h - AMD64 JIT Generation
-
-=head1 DESCRIPTION
-
-Provide the support for a JIT on the AMD64 architecture.
-
-=cut
-
-*/
-
-#ifndef PARROT_JIT_AMD64_JIT_EMIT_H_GUARD
-#define PARROT_JIT_AMD64_JIT_EMIT_H_GUARD
-
-/*
-
-hex to binary converter
-perl -ne '@a=split;push at b,unpack"B*",chr hex foreach at a;print"@b\n";@b=()'
-
-src/jit/amd64/jit_emit.h copied to src/jit_emit.h
-src/jit/amd64/exec_dep.h copied to src/exec_dep.h
-src/jit/amd64/core.jit used to build src/jit_cpu.h
-src/jit/amd64/core.jit used to build src/exec_cpu.h
-
-src/exec_start.c    #define JIT_EMIT 1
-src/exec.c          #define JIT_EMIT 1
-src/jit.c           #define JIT_EMIT 0
-src/jit_cpu.c       #define JIT_EMIT 2
-
-REX Byte
-    0100 wrxb
-        w => make 64 bits
-        r => use upper 8 registers for REG
-        x => high bit of index in SIB
-        b => use upper 8 registers for r/m, and for the base in SIB
-
-ModRM
-    mm REG R/m
-    mm => mode
-        00  no displacement
-        01  disp8
-        10  disp16/32
-        11  only regs
-    xxx/yyy
-        0   EAX     AX  AL  SS0 MM0
-        1   ECX     CX  CL  SS1 MM1
-        2   EDX     DX  DL  SS2 MM2
-        3   EBX     BX  BL  SS3 MM3
-        4   ESP     SP  AH  SS4 MM4
-        5   EBP     BP  CH  SS5 MM5
-        6   ESI     SI  DH  SS6 MM6
-        7   EDI     DI  BH  SS7 MM7
-
-SIB
-    ssiiibbb
-        scale
-        index
-        base
-        [index * 2**scale + base]
-
-
-For calling functions use:  RDI, RSI, RDX, RCX, R8, and R9
-                            XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, and XMM7
-    For varargs, RAX is used for the number of SSE regs
-    Extras are pushed onto the stack
-    The return is in RAX
-
-    R11 is a scratch register, not preserved, not used in calling
-    R10 is used for a static chain pointer
-
-RBP, RBX, and R12->R15 are preserved
-
-*/
-
-#include "parrot/parrot.h"
-#include "jit.h"
-#include <unistd.h>
-#include <limits.h>
-
-void Parrot_jit_begin(Parrot_jit_info_t *, PARROT_INTERP);
-
-
-/* This is used for testing whether or not keeping these two in registers is an
- * improvement or not.  This file may need to be expanded further to know for
- * sure.  But so far, there appears a 20 second improvement on my 2GHz. */
-#undef USE_OP_MAP_AND_CODE_START
-
-/*
- * define all the available cpu registers
- * reserve some for special purposes
- */
-typedef enum {
-    RAX,
-    ISR2 = RAX, /* Not like it's good for anything else */
-    RCX,
-    RDX,
-    RBX,
-    RSP,
-    RBP,
-    RSI,
-    RDI,
-
-    R8,
-    R9,
-    R10,
-    R11,
-    ISR1 = R11,
-    R12,
-    R13,
-#ifdef USE_OP_MAP_AND_CODE_START
-    CODE_START = R13,
-#endif
-    R14,
-#ifdef USE_OP_MAP_AND_CODE_START
-    OP_MAP = R14,
-#endif
-    R15,
-    INTERP = R15
-} amd64_iregister_t;
-
-
-/*
-
-=head2 Register usage
-
-=over 4
-
-=item RAX
-
-Return values, second scratch
-
-=item RCX
-
-Allocated, unpreserved
-
-=item RDX
-
-Allocated, unpreserved
-
-=item RBX
-
-Parrot register frame pointer
-
-=item RSP
-
-Stack pointer
-
-=item RBP
-
-Base pointer
-
-=item RSI
-
-Allocated, unpreserved
-
-=item RDI
-
-Allocated, unpreserved
-
-=item R8
-
-Allocated, unpreserved
-
-=item R9
-
-Allocated, unpreserved
-
-=item R10
-
-Allocated, unpreserved
-
-=item R11
-
-Scratch
-
-=item R12
-
-Allocated, preserved
-
-=item R13
-
-Allocated, preserved, or code_start
-
-=item R14
-
-Allocated, preserved, or op_map
-
-=item R15
-
-Interp
-
-=item XMM0
-
-Scratch
-
-=item XMM1-XMM15
-
-Allocated, all unpreserved
-
-=back
-
-=cut
-
-*/
-
-
-#define Parrot_jit_emit_get_base_reg_no(pc) RBX
-
-typedef enum {
-      XMM0,
-      FSR1 = XMM0,
-      XMM1,
-      FSR2 = XMM1,
-      XMM2, XMM3, XMM4, XMM5, XMM6, XMM7,
-      XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15
-} amd64_fregister_t;
-
-
-/* Call can be handled without a fixup */
-enum { JIT_AMD64BRANCH, JIT_AMD64JUMP, JIT_AMD64CALL };
-
-
-/*
- * now define macros for all possible (and implemented) operations
- *
- * Parrot defines JIT_EMIT to 1 or 2, when this file is included in
- * exec_cpu.c or jit_cpu.c
- */
-
-/*
-
-=head2 Macros
-
-Most of the functionality is provided by macros instead of functions.
-
-=over 4
-
-=cut
-
-*/
-
-#define b00 0
-#define b01 1
-#define b10 2
-#define b11 3
-
-#define b000 0
-#define b001 1
-#define b010 2
-#define b011 3
-#define b100 4
-#define b101 5
-#define b110 6
-#define b111 7
-
-/* rex.[wrxb], incomplete but oh well */
-/*
-
-=item C<emit_rex64(pc, reg, rm)>
-
-The REX prefix, setting REX.W making the instruction 64 bit.
-
-=item C<emit_rex(pc, reg, rm)>
-
-The REX prefix, only emitted if using an extended register.
-
-=cut
-
-*/
-#  define emit_rex64(pc, reg, rm) \
-    *((pc)++) = (char)(0x48 | (((reg) & 8) >> 1) | (((rm) & 8) >> 3))
-
-#  define emit_rex(pc, dst, src) { \
-        if ((dst) & 8 || (src) & 8) \
-        *((pc)++) = (char)(0x40 | (((dst) & 8) >> 1) | (((src) & 8) >> 3)); }
-
-/* Use a 0x66 prefix for increased padding */
-#  define emit_nop(pc) { \
-        *((pc)++) = (char)(0x90); }
-
-#  define emit_modrm(pc, mod, dst, src) { \
-        *((pc)++) = (char)(((mod) << 6) | (((dst) & 7) << 3) | ((src) & 7)); }
-
-#  define emit_sib(pc, scale, index, base) { \
-        *((pc)++) = (char)(((scale) << 6) | (((index) & 7) << 3) | ((base) & 7)); }
-
-/* 0xXX +rq */
-#  define emit_op_r(op, pc, reg) { \
-        emit_rex64((pc), 0x0, (reg)); \
-        *((pc)++) = (char)((op) | ((reg) & 7)); \
-    }
-
-#  define emit_64op_r(op, pc, reg) { \
-        emit_rex((pc), 0x0, (reg)); \
-        *((pc)++) = (char)((op) | ((reg) & 7)); \
-    }
-
-/* 0xXX /r */
-#  define emit_op_r_r(op, pc, dst, src) { \
-        emit_rex64((pc), (dst), (src)); \
-        *((pc)++) = (char) (op); \
-        emit_modrm((pc), b11, (dst), (src)); \
-    }
-
-#  define emit_op_r_mr(op, pc, dst, src, disp) { \
-        emit_rex64((pc), (dst), (src)); \
-        *((pc)++) = (char) (op); \
-        if ((disp) == 0) { \
-            emit_modrm((pc), b00, (dst), (src)); \
-        } \
-        else if (is8bit(disp)) { \
-            emit_modrm((pc), b01, (dst), (src)); \
-            *((pc)++) = (char)(disp); \
-        } \
-        else { \
-            emit_modrm((pc), b10, (dst), (src)); \
-            *(int *)(pc) = (int)(disp); \
-            (pc) += 4; \
-        } \
-    }
-
-#  define emit_op_i(op, pc, imm) { \
-        *((pc)++) = (char)(op); \
-        *(int *)(pc) = (int)(imm); \
-        (pc) += 4; \
-    }
-
-#  define emit_op_r_i(pc, op, op2, code, dst, imm) { \
-        emit_rex64((pc), 0x0, (dst)); \
-        if (is8bit(imm)) { \
-            *((pc)++) = (char) (op); \
-            emit_modrm((pc), b11, (code), (dst)); \
-            *((pc)++) = (char)(imm); \
-        } \
-        else { \
-            *((pc)++) = (char) (op2); \
-            emit_modrm((pc), b11, (code), (dst)); \
-            *(int *)(pc) = (int)(imm); \
-            (pc) += 4; \
-        } \
-    }
-
-#  define emit_op_mr_i(pc, op, op2, code, dst, disp, imm) { \
-        emit_rex64((pc), 0x0, (dst)); \
-        if (is8bit(imm)) { \
-            *((pc)++) = (char) (op); \
-            if ((disp) == 0) { \
-                emit_modrm((pc), b00, (code), (dst)); \
-            } \
-            else if (is8bit(disp)) { \
-                emit_modrm((pc), b01, (code), (dst)); \
-                *((pc)++) = (char)(disp); \
-            } \
-            else { \
-                emit_modrm((pc), b10, (code), (dst)); \
-                *(int *)(pc) = (int)(disp); \
-                (pc) += 4; \
-            } \
-            *((pc)++) = (char)(imm); \
-        } \
-        else { \
-            *((pc)++) = (char) (op2); \
-            if ((disp) == 0) { \
-                emit_modrm((pc), b00, (code), (dst)); \
-            } \
-            else if (is8bit(disp)) { \
-                emit_modrm((pc), b01, (code), (dst)); \
-                *((pc)++) = (char)(disp); \
-            } \
-            else { \
-                emit_modrm((pc), b10, (code), (dst)); \
-                *(int *)(pc) = (int)(disp); \
-                (pc) += 4; \
-            } \
-            *(int *)(pc) = (int)(imm); \
-            (pc) += 4; \
-        } \
-    }
-
-/* Test for zero, then call this; it'll call Parrot_ex_throw_from_c_args if you try
- * to divide by zero */
-#  define emit_div_check_zero(pc) { \
-    char *sav_ptr; \
-    emit_jcc((pc), jcc_jnz, 0x00); \
-    sav_ptr = (char *)((pc) - 1); \
-    emit_mov_r_r((pc), RDI, INTERP); \
-    emit_mov_r_i((pc), RSI, 0); \
-    emit_mov_r_i((pc), RDX, EXCEPTION_DIV_BY_ZERO); \
-    emit_mov_r_i((pc), RCX, div_by_zero); \
-    /* We must explicitly zero out RAX, since RAX is used in calling
-     * conventions for va_arg functions, and Parrot_ex_throw_from_c_args is a va_arg
-     * function */ \
-    emit_xor_r_r((pc), RAX, RAX); \
-    /* This assumes that jit_info is defined, if it's not, the code's not "consistent" */ \
-    call_func(jit_info, (void (*)(void)) Parrot_ex_throw_from_c_args); \
-    *sav_ptr = (char)((pc) - sav_ptr - 1); \
-}
-
-#  define emit_cmp_r_i(pc, dst, imm) emit_op_r_i((pc), 0x83, 0x81, 0x7, (dst), (imm))
-#  define emit_cmp_mr_i(pc, dst, disp, imm) emit_op_mr_i((pc), 0x83, 0x81, 0x7, (dst), (disp), (imm))
-#  define emit_cmp_r_r(pc, dst, src) emit_op_r_r(0x3b, (pc), (dst), (src))
-#  define emit_cmp_r_mr(pc, dst, src, disp) emit_op_r_mr(0x3b, (pc), (dst), (src), (disp))
-#  define emit_cmp_mr_r(pc, dst, disp, src) emit_op_r_mr(0x39, (pc), (src), (dst), (disp))
-
-
-#  define emit_add_r_i(pc, dst, imm) emit_op_r_i((pc), 0x83, 0x81, 0x0, (dst), (imm))
-#  define emit_add_mr_i(pc, dst, disp, imm) emit_op_mr_i((pc), 0x83, 0x81, 0x0, (dst), (disp), (imm))
-#  define emit_add_r_r(pc, dst, src) emit_op_r_r(0x03, (pc), (dst), (src))
-#  define emit_add_r_mr(pc, dst, src, disp) emit_op_r_mr(0x03, (pc), (dst), (src), (disp))
-#  define emit_add_mr_r(pc, dst, disp, src) emit_op_r_mr(0x01, (pc), (src), (dst), (disp))
-
-#  define emit_sub_r_i(pc, dst, imm) emit_op_r_i((pc), 0x83, 0x81, 0x5, (dst), (imm))
-#  define emit_sub_mr_i(pc, dst, disp, imm) emit_op_mr_i((pc), 0x83, 0x81, 0x5, (dst), (disp), (imm))
-#  define emit_sub_r_r(pc, dst, src) emit_op_r_r(0x2b, (pc), (dst), (src))
-#  define emit_sub_r_mr(pc, dst, src, disp) emit_op_r_mr(0x29, (pc), (dst), (src), (disp))
-#  define emit_sub_mr_r(pc, dst, disp, src) emit_op_r_mr(0x2b, (pc), (src), (dst), (disp))
-
-#  define emit_xchg_r_r(pc, dst, src) emit_op_r_r(0x87, (pc), (dst), (src))
-#  define emit_xchg_r_mr(pc, dst, src, disp) emit_op_r_mr(0x87, (pc), (dst), (src), (disp))
-#  define emit_xchg_mr_r(pc, dst, disp, src) emit_op_r_mr(0x87, (pc), (src), (dst), (disp))
-
-#  define emit_xor_r_i(pc, dst, imm) emit_op_r_i((pc), 0x83, 0x81, 0x6, (dst), (imm))
-#  define emit_xor_mr_i(pc, dst, disp, imm) emit_op_mr_i((pc), 0x83, 0x81, 0x6, (dst), (disp), (imm))
-#  define emit_xor_r_r(pc, dst, src) emit_op_r_r(0x33, (pc), (dst), (src))
-#  define emit_xor_r_mr(pc, dst, src, disp) emit_op_r_mr(0x33, (pc), (dst), (src), (disp))
-#  define emit_xor_mr_r(pc, dst, disp, src) emit_op_r_mr(0x31, (pc), (src), (dst), (disp))
-
-#  define emit_and_r_i(pc, dst, imm) emit_op_r_i((pc), 0x83, 0x81, 0x4, (dst), (imm))
-#  define emit_and_mr_i(pc, dst, disp, imm) emit_op_mr_i((pc), 0x83, 0x81, 0x4, (dst), (disp), (imm))
-#  define emit_and_r_r(pc, dst, src) emit_op_r_r(0x23, (pc), (dst), (src))
-#  define emit_and_r_mr(pc, dst, src, disp) emit_op_r_mr(0x23, (pc), (dst), (src), (disp))
-#  define emit_and_mr_r(pc, dst, disp, src) emit_op_r_mr(0x21, (pc), (src), (dst), (disp))
-
-#  define emit_or_r_i(pc, dst, imm) emit_op_r_i((pc), 0x83, 0x81, 0x1, (dst), (imm))
-#  define emit_or_mr_i(pc, dst, disp, imm) emit_op_mr_i((pc), 0x83, 0x81, 0x1, (dst), (disp), (imm))
-#  define emit_or_r_r(pc, dst, src) emit_op_r_r(0x0b, (pc), (dst), (src))
-#  define emit_or_r_mr(pc, dst, src, disp) emit_op_r_mr(0x0b, (pc), (dst), (src), (disp))
-#  define emit_or_mr_r(pc, dst, disp, src) emit_op_r_mr(0x09, (pc), (src), (dst), (disp))
-
-#  define emit_imul_r_r(pc, dst, src) { \
-    emit_rex64((pc), (dst), (src)); \
-    *((pc)++) = (char) 0x0f; \
-    *((pc)++) = (char) 0xaf; \
-    emit_modrm((pc), b11, (dst), (src)); \
-}
-#  define emit_imul_r_mr(pc, dst, src, disp) { \
-    emit_rex64((pc), (dst), (src)); \
-    *((pc)++) = (char) 0x0f; \
-    *((pc)++) = (char) 0xaf; \
-    if ((disp) == 0) { \
-        emit_modrm((pc), b00, (dst), (src)); \
-    } \
-    else if (is8bit(disp)) { \
-        emit_modrm((pc), b01, (dst), (src)); \
-        *((pc)++) = (char)(disp); \
-    } \
-    else { \
-        emit_modrm((pc), b10, (dst), (src)); \
-        *(int *)(pc) = (int)(disp); \
-        (pc) += 4; \
-    } \
-}
-
-#  define emit_idiv_r_r(pc, dst, src) { \
-    emit_xor_r_r((pc), RDX, RDX); \
-    emit_test_r((pc), (src)); \
-    emit_div_check_zero(pc); \
-    emit_op_r_r(0xf7, (pc), 0x7, (src)); \
-}
-#  define emit_idiv_r_mr(pc, dst, src, disp) { \
-    emit_xor_r_r((pc), RDX, RDX); \
-    emit_mov_r_mr((pc), ISR1, (src), (disp)); \
-    emit_test_r((pc), ISR1); \
-    emit_div_check_zero(pc); \
-    emit_op_r_mr(0xf7, (pc), 0x7, (src), (disp)); \
-}
-
-#  define emit_abs_r(pc, reg) emit_and_r_i((pc), (reg), ~(1L << 63))
-
-#  define emit_neg_r(pc, reg) emit_op_r_r(0xf7, (pc), 0x2, (reg))
-#  define emit_not_r(pc, reg) emit_op_r_r(0xf7, (pc), 0x3, (reg))
-#  define emit_inc_r(pc, reg) emit_op_r_r(0xff, (pc), 0x0, (reg))
-#  define emit_dec_r(pc, reg) emit_op_r_r(0xff, (pc), 0x1, (reg))
-
-/* This needs a fixup it seems...  call_r doesn't */
-#  define emit_call_i(pc, imm) emit_op_i(0xe8, (pc), (imm))
-#  define emit_call_r(pc, reg) { \
-        emit_rex64((pc), 0x0, (reg)); \
-        *(pc)++ = (char)0xff; \
-        emit_modrm((pc), b11, 0x2, (reg)); }
-
-#  define emit_jmp_r_r(pc, reg1, reg2) { \
-    emit_rex((pc), (reg1), (reg2)); \
-    *((pc)++) = (char)0xff; \
-    emit_modrm((pc), b00, 0x4, b100); \
-    emit_sib((pc), b00, (reg1), (reg2)); \
-}
-
-#  define emit_jmp_i(pc, imm) emit_op_i(0xe9, (pc), (imm))
-#  define emit_jmp_i_fixup(ji, imm) { \
-    opcode_t opcode; \
-    opcode = jit_info->op_i + (imm); \
-    Parrot_jit_newfixup(jit_info); \
-    jit_info->arena.fixups->type = JIT_AMD64JUMP; \
-    jit_info->arena.fixups->param.opcode = opcode; \
-    if (jit_info->optimizer->cur_section->branch_target == \
-            jit_info->optimizer->cur_section) \
-        jit_info->arena.fixups->skip = \
-            jit_info->optimizer->cur_section->branch_target->load_size; \
-    emit_jmp_i(jit_info->native_ptr, 0xdead); \
-}
-
-#  define emit_leave(pc) *((pc)++) = (char)0xc9;
-#  define emit_ret(pc) *((pc)++) = (char)0xc3;
-
-#  define emit_mov_r_r(pc, dst, src) \
-            emit_op_r_r(0x8B, (pc), (dst), (src))
-
-/* mov [reg + offs], imm */
-#  define emit_mov_mr_i(pc, reg, offs, imm) {\
-            if (is32bit(imm)) { \
-                emit_rex64((pc), 0x0, (reg)); \
-                *((pc)++) = (char) 0xc7; \
-                    if ((offs) == 0) { \
-                        emit_modrm((pc), b00, 0x0, (reg)); \
-                    } \
-                    else if (is8bit(offs)) { \
-                        emit_modrm((pc), b01, 0x0, (reg)); \
-                        *((pc)++) = (char)(offs); \
-                    } \
-                    else { \
-                        emit_modrm((pc), b10, 0x0, (reg)); \
-                        *(int *)(pc) = (int)(offs); \
-                        (pc) += 4; \
-                    } \
-                *(int *)(pc) = (int)(imm); \
-                (pc) += 4; \
-            } \
-            else { \
-                emit_mov_r_i((pc), ISR1, (imm)); \
-                emit_mov_mr_r((pc), (reg), (offs), ISR1); \
-            } \
- }
-
-/* mov reg, imm */
-#  define emit_mov_r_i(pc, reg, imm) {\
-            emit_op_r(0xb8, (pc), (reg)); \
-            *(long *)(pc) = (long)(imm); \
-            (pc) += 8; \
- }
-
-/* push reg */
-#  define emit_push_r(pc, reg) emit_64op_r(0x50, (pc), (reg))
-/* pop reg */
-#  define emit_pop_r(pc, reg)  emit_64op_r(0x58, (pc), (reg))
-
-/* push imm */
-#  define emit_push_i(pc, imm) emit_op_i(0x68, (pc), (imm))
-
-/* did you know, that (unsigned)0 is not an 8 bit value? */
-#  define is8bit(c) (((long)(c)) >= -128 && ((long)(c)) <= 127)
-#  define is32bit(c) (((long)(c)) >= -2147483648 && ((long)(c)) <= 2147483647)
-
-#  define emit_get_int_from_stack(pc, dst, disp) \
-    emit_mov_r_mr((pc), (dst), RBP, (disp))
-
-#  define emit_send_int_to_stack(pc, src, disp) \
-    emit_mov_mr_r((pc), RBP, (disp), (src))
-
-/* mov dst, [src + disp] */
-#  define emit_mov_r_mr(pc, dst, src, disp) \
-          emit_op_r_mr(0x8b, (pc), (dst), (src), (disp))
-/* mov [dst + disp], src */
-#  define emit_mov_mr_r(pc, dst, disp, src) \
-          emit_op_r_mr(0x89, (pc), (src), (dst), (disp))
-
-/* lea dst, [src + disp] */
-#  define emit_lea_r_mr(pc, dst, src, disp) \
-          emit_op_r_mr(0x8d, (pc), (src), (dst), (disp))
-
-/* push rbp
- * mov rbp, rsp */
-/* move rsp to rbp; set rbp to rsp */
-#  define jit_emit_stack_frame_enter(pc) { \
-        emit_push_r((pc), RBP); \
-        emit_mov_r_r((pc), RBP, RSP); \
-    }
-
-/* pop rbp */
-#  define jit_emit_stack_frame_leave(pc) { \
-        emit_pop_r((pc), RBP); \
-    }
-
-#  define emit_jcc(pc, code, disp) { \
-        if (is8bit(disp)) { \
-            *((pc)++) = (char) 0x70 | (code); \
-            *((pc)++) = (char) (disp); \
-        } \
-        else { \
-            *((pc)++) = (char) 0x0f; \
-            *((pc)++) = (char) 0x80 | (code); \
-            *(int *)(pc) = (int)(disp); \
-            (pc) += 4; \
-        } \
-}
-
-#  define emit_jcc_fixup(ji, code, imm) { \
-    opcode_t opcode; \
-    opcode = (ji)->op_i + (imm); \
-    Parrot_jit_newfixup(ji); \
-    (ji)->arena.fixups->type = JIT_AMD64BRANCH; \
-    (ji)->arena.fixups->param.opcode = opcode; \
-    if ((ji)->optimizer->cur_section->branch_target == \
-            (ji)->optimizer->cur_section) \
-        (ji)->arena.fixups->skip = \
-            (ji)->optimizer->cur_section->branch_target->load_size; \
-    emit_jcc((ji)->native_ptr, (code), 0xdead); \
-}
-
-typedef enum {
- jcc_jo,                /* Jump if overflow */
- jcc_jno,               /* Jump if not overflow */
- jcc_jb,                /* Jump if below */
- jcc_jc   = jcc_jb,     /* Jump if carry */
- jcc_jnae = jcc_jb,     /* Jump if not above or equal */
- jcc_jnb,               /* Jump if not below */
- jcc_jnc  = jcc_jnb,    /* Jump if not carry */
- jcc_jae  = jcc_jnb,    /* Jump if above or equal */
- jcc_jz,                /* Jump if zero */
- jcc_je   = jcc_jz,     /* Jump if equal */
- jcc_jnz,               /* Jump if not zero */
- jcc_jne  = jcc_jnz,    /* Jump if not equal */
- jcc_jbe,               /* Jump if below or equal */
- jcc_jna  = jcc_jbe,    /* Jump if not above */
- jcc_jnbe,              /* Jump if not below or equal */
- jcc_ja   = jcc_jnbe,   /* Jump if above */
- jcc_js,                /* Jump if sign */
- jcc_jns,               /* Jump if not sign */
- jcc_jp,                /* Jump if parity */
- jcc_jpe  = jcc_jp,     /* Jump if parity even */
- jcc_jnp,               /* Jump if not parity */
- jcc_jpo  = jcc_jnp,    /* Jump if parity odd */
- jcc_jl,                /* Jump if less */
- jcc_jnge = jcc_jl,     /* Jump if not greater or equal */
- jcc_jnl,               /* Jump if not less */
- jcc_jge  = jcc_jnl,    /* Jump if greater or equal */
- jcc_jle,               /* Jump if less or equal */
- jcc_jng  = jcc_jle,    /* Jump if not greater */
- jcc_jnle,              /* Jump if not less or equal */
- jcc_jg   = jcc_jnle    /* Jump if greater */
-} amd64_jcc_t;
-
-#  define emit_test_r(pc, reg) \
-          emit_op_r_r(0x85, (pc), (reg), (reg))
-
-#  define emit_test_r_r(pc, dst, src) \
-          emit_op_r_r(0x85, (pc), (src), (dst))
-
-    /* pop r15
-     * pop r14
-     * pop r13
-     * pop r12
-     * pop rbx
-     * pop rbp
-     * ret */
-#  define jit_emit_end(pc) { \
-    emit_pop_r((pc), R15); \
-    emit_pop_r((pc), R14); \
-    emit_pop_r((pc), R13); \
-    emit_pop_r((pc), R12); \
-    emit_pop_r((pc), RBX); \
-    emit_pop_r((pc), RBP); \
-    emit_leave(pc); \
-    emit_ret(pc); \
-}
-
-
-/**************************************
- * Floating Point                     *
- **************************************/
-
-#  define emit_op_x_x(prefix, op, pc, dst, src) { \
-    *((pc)++) = (char) (prefix); \
-    emit_rex((pc), (dst), (src)); \
-    *((pc)++) = (char) 0x0f; \
-    *((pc)++) = (char) (op); \
-    emit_modrm((pc), b11, (dst), (src)); \
-}
-
-#  define emit_op64_x_x(prefix, op, pc, dst, src) { \
-    *((pc)++) = (char) (prefix); \
-    emit_rex64((pc), (dst), (src)); \
-    *((pc)++) = (char) 0x0f; \
-    *((pc)++) = (char) (op); \
-    emit_modrm((pc), b11, (dst), (src)); \
-}
-
-#  define emit_op_x_mx(prefix, op, pc, dst, src, offs) { \
-    *((pc)++) = (char) (prefix); \
-    emit_rex((pc), (dst), (src)); \
-    *((pc)++) = (char) 0x0f; \
-    *((pc)++) = (char) (op); \
-    if ((offs) == 0) { \
-        emit_modrm((pc), b00, (dst), (src)); \
-    } \
-    else if (is8bit(offs)) { \
-        emit_modrm((pc), b01, (dst), (src)); \
-        *((pc)++) = (char)(long)(offs); \
-    } \
-    else { \
-        emit_modrm((pc), b10, (dst), (src)); \
-        *(int *)(pc) = (int)(long)(offs); \
-        (pc) += 4; \
-    } \
-}
-
-#  define emit_op64_x_mx(prefix, op, pc, dst, src, offs) { \
-    *((pc)++) = (char) (prefix); \
-    emit_rex64((pc), (dst), (src)); \
-    *((pc)++) = (char) 0x0f; \
-    *((pc)++) = (char) (op); \
-    if ((offs) == 0 || (src) == RBP) { \
-        emit_modrm((pc), b00, (dst), (src)); \
-    } \
-    else if (is8bit(offs)) { \
-        emit_modrm((pc), b01, (dst), (src)); \
-        *((pc)++) = (char)(long)(offs); \
-    } \
-    else { \
-        emit_modrm((pc), b10, (dst), (src)); \
-        *(int *)(pc) = (int)(long)(offs); \
-        (pc) += 4; \
-    } \
-}
-
-#  define emit_mov_x_x(pc, dst, src) emit_op_x_x(0x66, 0x28, (pc), (dst), (src))
-
-#  define emit_mov_x_mx(pc, dst, src, offs) emit_op_x_mx(0xf2, 0x10, (pc), (dst), (src), (offs))
-#  define emit_mov_mx_x(pc, dst, offs, src) emit_op_x_mx(0xf2, 0x11, (pc), (src), (dst), (offs))
-
-/* Intended to zero a register */
-#  define emit_movhlps_x_x(pc, dst, src) { \
-    emit_rex((pc), (src), (dst)); \
-    *((pc)++) = (char) 0x0f; \
-    *((pc)++) = (char) 0x12; \
-    emit_modrm((pc), b11, (src), (dst)); \
-}
-
-#  define emit_movlhps_x_x(pc, dst, src) { \
-    emit_rex((pc), (src), (dst)); \
-    *((pc)++) = (char) 0x0f; \
-    *((pc)++) = (char) 0x16; \
-    emit_modrm((pc), b11, (src), (dst)); \
-}
-
-#  define emit_movd_r_x(pc, dst, src) { \
-    *((pc)++) = (char) 0x66; \
-    emit_rex64((pc), (dst), (src)); \
-    *((pc)++) = (char) 0x0f; \
-    *((pc)++) = (char) 0x7e; \
-    emit_modrm((pc), b11, (dst), (src)); \
-}
-
-#  define emit_movd_x_r(pc, dst, src) { \
-    *((pc)++) = (char) 0x66; \
-    emit_rex64((pc), (dst), (src)); \
-    *((pc)++) = (char) 0x0f; \
-    *((pc)++) = (char) 0x6e; \
-    emit_modrm((pc), b11, (dst), (src)); \
-}
-
-#  define emit_test_x(pc, reg) { \
-    emit_xor_x_x((pc), FSR2, FSR2); \
-    emit_comisd_x_x((pc), (reg), FSR2); \
-}
-
-#  define emit_comisd_x_x(pc, dst, src)         emit_op_x_x(0x66, 0x2f, (pc), (dst), (src))
-#  define emit_comisd_x_mx(pc, dst, src, offs) emit_op_x_mx(0x66, 0x2f, (pc), (dst), (src), (offs))
-
-#  define emit_add_x_x(pc, dst, src)         emit_op_x_x(0xf2, 0x58, (pc), (dst), (src))
-#  define emit_add_x_mx(pc, dst, src, offs) emit_op_x_mx(0xf2, 0x58, (pc), (dst), (src), (offs))
-
-#  define emit_sub_x_x(pc, dst, src)         emit_op_x_x(0xf2, 0x5c, (pc), (dst), (src))
-#  define emit_sub_x_mx(pc, dst, src, offs) emit_op_x_mx(0xf2, 0x5c, (pc), (dst), (src), (offs))
-
-#  define emit_and_x_x(pc, dst, src)         emit_op_x_x(0x66, 0x54, (pc), (dst), (src))
-#  define emit_and_x_mx(pc, dst, src, offs) emit_op_x_mx(0x66, 0x54, (pc), (dst), (src), (offs))
-
-#  define emit_xor_x_x(pc, dst, src)         emit_op_x_x(0x66, 0x57, (pc), (dst), (src))
-#  define emit_xor_x_mx(pc, dst, src, offs) emit_op_x_mx(0x66, 0x57, (pc), (dst), (src), (offs))
-
-#  define emit_mul_x_x(pc, dst, src)         emit_op_x_x(0xf2, 0x59, (pc), (dst), (src))
-#  define emit_mul_x_mx(pc, dst, src, offs) emit_op_x_mx(0xf2, 0x59, (pc), (dst), (src), (offs))
-
-/* I tried to do a check for FSR1 == dst, such as from core.jit, but the bugs
- * to track down, the hackish things to do(movhlpd and movlhpd were used, but I
- * gave up and settled on the cleaner and likely faster overall method of
- * getting an FSR2 and going down to 14 mapped registers.
- */
-#  define emit_div_x_x(pc, dst, src) { \
-    emit_movhlps_x_x((pc), FSR2, FSR2); \
-    emit_comisd_x_x((pc), FSR2, (src)); \
-    emit_div_check_zero((pc)); \
-    emit_op_x_x(0xf2, 0x5e, (pc), (dst), (src)); \
-}
-#  define emit_div_x_mx(pc, dst, src, offs) { \
-    emit_movhlps_x_x((pc), FSR2, FSR2); \
-    emit_comisd_x_mx((pc), FSR2, (src), (offs)); \
-    emit_div_check_zero((pc)); \
-    emit_op_x_mx(0xf2, 0x5e, (pc), (dst), (src), (offs)); \
-}
-
-#  define emit_sqrt_x_x(pc, dst, src)         emit_op_x_x(0xf2, 0x51, (pc), (dst), (src))
-#  define emit_sqrt_x_mx(pc, dst, src, offs) emit_op_x_mx(0xf2, 0x51, (pc), (dst), (src), (offs))
-
-#  define emit_cvtsi2sd_x_mr(pc, dst, src, offs) emit_op64_x_mx(0xf2, 0x2a, (pc), (dst), (src), (offs))
-#  define emit_cvtsi2sd_x_r(pc, dst, src)         emit_op64_x_x(0xf2, 0x2a, (pc), (dst), (src))
-
-/* Truncate */
-#  define emit_cvttsd2si_r_mx(pc, dst, src, offs) emit_op64_x_mx(0xf2, 0x2c, (pc), (dst), (src), (offs))
-#  define emit_cvttsd2si_r_x(pc, dst, src)         emit_op64_x_x(0xf2, 0x2c, (pc), (dst), (src))
-
-/* Round */
-#  define emit_cvtsd2si_r_mx(pc, dst, src, offs) emit_op64_x_mx(0xf2, 0x2d, (pc), (dst), (src), (offs))
-#  define emit_cvtsd2si_r_x(pc, dst, src)         emit_op64_x_x(0xf2, 0x2d, (pc), (dst), (src))
-
-#  define emit_ldmxcsr(pc) { \
-    emit_xor_r_r((pc), ISR2, ISR2); \
-    *((pc)++) = (char) 0x0f; \
-    *((pc)++) = (char) 0xAE; \
-    emit_modrm((pc), b10, 0x2, ISR2); \
-    *(int *)(pc) = (int)&mxcsr; \
-    (pc) += 4; \
-}
-/*********************************************************/
-
-#ifdef USE_OP_MAP_AND_CODE_START
-/* These two can be mixed together just like in the i386 jit.  All the places I
- * can see this being called require it to be included, but for the moment I'm
- * keeping it as these macros. */
-/*
- * emit code that gets interp->code->jit_info->arena->op_map
- * and sets the OP_MAP register
- */
-#  define jit_emit_load_op_map(pc) { \
-        emit_mov_r_mr((pc), OP_MAP, INTERP, (long)offsetof(Interp, code)); \
-        emit_mov_r_mr((pc), OP_MAP, OP_MAP, (long)offsetof(PackFile_ByteCode, jit_info)); \
-        emit_lea_r_mr((pc), OP_MAP, OP_MAP, (long)offsetof(Parrot_jit_info_t, arena)); \
-        emit_mov_r_mr((pc), OP_MAP, OP_MAP, (long)offsetof(Parrot_jit_arena_t, op_map)); \
-}
-
-/*
- * emit code that gets interp->code->base.data
- * and sets the CODE_START register
- */
-#  define jit_emit_load_code_start(pc) { \
-        emit_mov_r_mr((pc), CODE_START, INTERP, (long)offsetof(Interp, code)); \
-        emit_mov_r_mr((pc), CODE_START, CODE_START, (long)offsetof(PackFile_Segment, data)); \
-}
-
-#endif /* USE_OP_MAP_AND_CODE_START */
-
-void call_func(Parrot_jit_info_t *jit_info, void *addr);
-void Parrot_emit_jump_to_rax(Parrot_jit_info_t *jit_info, Interp *interp);
-
-/*
- * emit code that calls a core.ops function from src/core_ops.c,
- * the generated code is the translation of this:
- *
- *  PC = ((INTERP->op_func_table)[*PC])(PC,INTERP)
- */
-
-extern int jit_op_count(void);
-
-/*
- * release stack frame end exit see core.jit
- */
-/* extern static void Parrot_end_jit(Parrot_jit_info_t *, Interp *); */
-
-#  undef Parrot_jit_restart_op
-
-void Parrot_jit_normal_op(Parrot_jit_info_t *jit_info, Interp *interp);
-void Parrot_jit_cpcf_op(Parrot_jit_info_t *jit_info, Interp *interp);
-void Parrot_jit_restart_op(Parrot_jit_info_t *jit_info, Interp *interp);
-void jit_mov_mx_x(Interp *interp, Parrot_jit_info_t *jit_info,
-        int base_reg, INTVAL offs, int src_reg);
-void jit_mov_mr_r(Interp *interp, Parrot_jit_info_t *jit_info,
-        int base_reg, INTVAL offs, int src_reg);
-void jit_mov_x_mx(Interp *interp, Parrot_jit_info_t *jit_info,
-        int dst_reg, int base_reg, INTVAL offs);
-void jit_mov_r_mr(Interp *interp, Parrot_jit_info_t *jit_info,
-        int dst_reg, int base_reg, INTVAL offs);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-const jit_arch_info * Parrot_jit_init(Interp *interp);
-
-
-/*
- * define how many int and float registers can be used by the
- * jit core
- */
-
-#  define INT_REGISTERS_TO_MAP 10
-#  define FLOAT_REGISTERS_TO_MAP 15
-
-#  define REQUIRES_CONSTANT_POOL 0
-
-void Parrot_jit_begin(Parrot_jit_info_t *jit_info, Interp *interp);
-void Parrot_jit_dofixup(Parrot_jit_info_t *jit_info, Interp *interp);
-void Parrot_jit_begin_sub(Parrot_jit_info_t *jit_info, Interp *interp);
-
-extern const char intval_map[INT_REGISTERS_TO_MAP];
-extern const char floatval_map[FLOAT_REGISTERS_TO_MAP];
-extern const jit_arch_info arch_info;
-extern const char div_by_zero[];
-extern const int mxcsr;
-
-#endif /* PARROT_JIT_AMD64_JIT_EMIT_H_GUARD */
-
-/*
-
-=back
-
-=cut
-
-*/
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/arm/core.jit
==============================================================================
--- branches/orderedhash_revamp/src/jit/arm/core.jit	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,673 +0,0 @@
-;
-; arm/core.jit
-;
-; $Id$
-;
-
-Parrot_noop {
-    jit_info->native_ptr = emit_nop(jit_info->native_ptr);
-}
-
-; ldmea fp, {r4, r5, r6, r7, fp, sp, pc
-; but K bug Grr if I load pc direct.
-
-Parrot_end {
- #ifndef ARM_K_BUG
-    jit_info->native_ptr = emit_ldmstm (jit_info->native_ptr,
-                                        cond_AL, is_load, dir_EA, no_writeback,
-                                        REG11_fp,
-                                        reg2mask(4) | reg2mask(REG11_fp)
-                                        | reg2mask(REG13_sp)
-                                        | reg2mask(REG15_pc));
- #else
-    jit_info->native_ptr = emit_ldmstm (jit_info->native_ptr,
-                                        cond_AL, is_load, dir_EA, no_writeback,
-                                        REG11_fp,
-                                        reg2mask(4) | reg2mask(REG11_fp)
-                                        | reg2mask(REG13_sp)
-                                        | reg2mask(REG14_lr));
-    jit_info->native_ptr = emit_mov(jit_info->native_ptr, REG15_pc, REG14_lr);
- #endif
-}
-
-; This shows why it would be nice in the future to have a way to have ops
-;  broken into 1 to 3 of:
-;
-; -1) get values from parrot registers into CPU registers
-;  0) do stuff
-; +1) write values back to parrot registers
-;
-; that way, a JIT optimiser could punt -1 and +1 outside loops leaving
-; intermediate values in CPU registers. It could collate -1 and +1 [leaving
-; nothing :-)] and choose how to maximise use of as many real CPU registers as
-; possible.
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; set ops
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-Parrot_set_i_i {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-}
-
-Parrot_set_i_ic {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-}
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; comparison ops
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-Parrot_eq_i_i_ic {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 1, r0);
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r1);
-    jit_info->native_ptr = emit_arith_reg (jit_info->native_ptr, cond_AL,
-                                                 CMP, 0, 0, r0, r1);
-    emit_jump_to_op (jit_info, cond_EQ, *INT_CONST[3]);
-}
-Parrot_eq_i_ic_ic {
-    Parrot_jit_jumpif_const (jit_info, interp, 1, *INT_CONST[2],
-                             *INT_CONST[3], cond_EQ);
-}
-Parrot_eq_ic_i_ic {
-    Parrot_jit_jumpif_const (jit_info, interp, 2, *INT_CONST[1],
-                             *INT_CONST[3], cond_EQ);
-}
-Parrot_eq_ic_ic_ic {
-    if (*INT_CONST[1] == *INT_CONST[2])
-        emit_jump_to_op (jit_info, cond_AL, *INT_CONST[3]);
-}
-
-Parrot_ne_i_i_ic {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 1, r0);
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r1);
-    jit_info->native_ptr = emit_arith_reg (jit_info->native_ptr, cond_AL,
-                                                 CMP, 0, 0, r0, r1);
-    emit_jump_to_op (jit_info, cond_NE, *INT_CONST[3]);
-}
-Parrot_ne_i_ic_ic {
-    Parrot_jit_jumpif_const (jit_info, interp, 1, *INT_CONST[2],
-                             *INT_CONST[3], cond_NE);
-}
-Parrot_ne_ic_i_ic {
-    Parrot_jit_jumpif_const (jit_info, interp, 2, *INT_CONST[1],
-                             *INT_CONST[3], cond_NE);
-}
-Parrot_ne_ic_ic_ic {
-    if (*INT_CONST[1] != *INT_CONST[2])
-        emit_jump_to_op (jit_info, cond_AL, *INT_CONST[3]);
-}
-
-Parrot_lt_i_i_ic {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 1, r0);
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r1);
-    jit_info->native_ptr = emit_arith_reg (jit_info->native_ptr, cond_AL,
-                                                 CMP, 0, 0, r0, r1);
-    emit_jump_to_op (jit_info, cond_LT, *INT_CONST[3]);
-}
-Parrot_lt_i_ic_ic {
-    Parrot_jit_jumpif_const (jit_info, interp, 1, *INT_CONST[2],
-                             *INT_CONST[3], cond_LT);
-}
-Parrot_lt_ic_i_ic {
-    Parrot_jit_jumpif_const (jit_info, interp, 2, *INT_CONST[1],
-                             *INT_CONST[3], cond_GE);
-}
-Parrot_lt_ic_ic_ic {
-    if (*INT_CONST[1] < *INT_CONST[2])
-        emit_jump_to_op (jit_info, cond_AL, *INT_CONST[3]);
-}
-
-Parrot_le_i_i_ic {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 1, r0);
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r1);
-    jit_info->native_ptr = emit_arith_reg (jit_info->native_ptr, cond_AL,
-                                                 CMP, 0, 0, r0, r1);
-    emit_jump_to_op (jit_info, cond_LE, *INT_CONST[3]);
-}
-Parrot_le_i_ic_ic {
-    Parrot_jit_jumpif_const (jit_info, interp, 1, *INT_CONST[2],
-                             *INT_CONST[3], cond_LE);
-}
-Parrot_le_ic_i_ic {
-    Parrot_jit_jumpif_const (jit_info, interp, 2, *INT_CONST[1],
-                             *INT_CONST[3], cond_GT);
-}
-Parrot_le_ic_ic_ic {
-    if (*INT_CONST[1] <= *INT_CONST[2])
-        emit_jump_to_op (jit_info, cond_AL, *INT_CONST[3]);
-}
-
-Parrot_gt_i_i_ic {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 1, r0);
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r1);
-    jit_info->native_ptr = emit_arith_reg (jit_info->native_ptr, cond_AL,
-                                                 CMP, 0, 0, r0, r1);
-    emit_jump_to_op (jit_info, cond_GT, *INT_CONST[3]);
-}
-Parrot_gt_i_ic_ic {
-    Parrot_jit_jumpif_const (jit_info, interp, 1, *INT_CONST[2],
-                             *INT_CONST[3], cond_GT);
-}
-Parrot_gt_ic_i_ic {
-    Parrot_jit_jumpif_const (jit_info, interp, 2, *INT_CONST[1],
-                             *INT_CONST[3], cond_LE);
-}
-Parrot_gt_ic_ic_ic {
-    if (*INT_CONST[1] > *INT_CONST[2])
-        emit_jump_to_op (jit_info, cond_AL, *INT_CONST[3]);
-}
-
-Parrot_ge_i_i_ic {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 1, r0);
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r1);
-    jit_info->native_ptr = emit_arith_reg (jit_info->native_ptr, cond_AL,
-                                                 CMP, 0, 0, r0, r1);
-    emit_jump_to_op (jit_info, cond_GE, *INT_CONST[3]);
-}
-Parrot_ge_i_ic_ic {
-    Parrot_jit_jumpif_const (jit_info, interp, 1, *INT_CONST[2],
-                             *INT_CONST[3], cond_GE);
-}
-Parrot_ge_ic_i_ic {
-    Parrot_jit_jumpif_const (jit_info, interp, 2, *INT_CONST[1],
-                             *INT_CONST[3], cond_LT);
-}
-Parrot_ge_ic_ic_ic {
-    if (*INT_CONST[1] >= *INT_CONST[2])
-        emit_jump_to_op (jit_info, cond_AL, *INT_CONST[3]);
-}
-
-Parrot_if_i_ic {
-    Parrot_jit_jumpif_const (jit_info, interp, 1, 0, *INT_CONST[2],
-                             cond_NE);
-}
-Parrot_unless_i_ic {
-    Parrot_jit_jumpif_const (jit_info, interp, 1, 0, *INT_CONST[2],
-                             cond_EQ);
-}
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; arithmetic ops
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-Parrot_abs_i_ic {
-    jit_info->native_ptr = emit_load_constant (jit_info->native_ptr,
-                                               interp, cond_AL,
-                                               (*INT_CONST[2] < 0)
-                                               ? -*INT_CONST[2] : *INT_CONST[2],
-                                               r0);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-}
-;
-; maybe not the best way:
-; cmp   r0, #0
-; rsblt r0, r0, #0
-;
-Parrot_abs_i_i {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    jit_info->native_ptr = emit_arith_immediate (jit_info->native_ptr, cond_AL,
-                                                 CMP, 0, 0, r0, 0, 0);
-    jit_info->native_ptr = emit_arith_immediate (jit_info->native_ptr, cond_LT,
-                                                 RSB, 0, r0, r0, 0, 0);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-}
-;
-; rsbs  r0, r0, #0
-; strgt r0, [...]
-;
-;Parrot_abs_i {
-;    Parrot_jit_int_laod(jit_info, interp, cond_AL, 1, r0);
-;    jit_info->native_ptr = emit_arith_immediate (jit_info->native_ptr, cond_AL,
-;                                                 RSB, arith_sets_S,
-;                                                 r0, r0, 0, 0);
-;    Parrot_jit_int_store(jit_info, interp, cond_GT, 1, r0);
-;}
-
-Parrot_add_i_i_i {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 3, r1);
-    jit_info->native_ptr = emit_arith_reg (jit_info->native_ptr, cond_AL,
-                                                 ADD, 0, r2, r0, r1);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r2);
-}
-Parrot_add_i_i_ic {
-    Parrot_jit_arith_const_neg (jit_info, interp, cond_AL, ADD, SUB,
-        1, 2, *INT_CONST[3]);
-}
-Parrot_add_i_ic_i {
-    Parrot_jit_arith_const_neg (jit_info, interp, cond_AL, ADD, SUB,
-        1, 3, *INT_CONST[2]);
-}
-Parrot_add_i_ic_ic {
-    jit_info->native_ptr = emit_load_constant (jit_info->native_ptr,
-                                               interp,
-                                               cond_AL,
-                                               *INT_CONST[2] + *INT_CONST[3],
-                                               r0);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-}
-Parrot_add_i_ic {
-    Parrot_jit_arith_const_neg (jit_info, interp, cond_AL, ADD, SUB,
-        1, 1, *INT_CONST[2]);
-}
-
-Parrot_dec_i {
-    Parrot_jit_arith_const_neg (jit_info, interp, cond_AL, SUB, ADD,
-        1, 1, 1);
-}
-Parrot_inc_i {
-    Parrot_jit_arith_const_neg (jit_info, interp, cond_AL, ADD, SUB,
-        1, 1, 1);
-}
-
-; mul can't do immediate constants, and there are restrictions on which
-; registers you can use. (IIRC rd and rn can't be the same register)
-Parrot_mul_i_i {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 1, r0);
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r1);
-    jit_info->native_ptr = emit_mul (jit_info->native_ptr, cond_AL, 0,
-                                     r2, r0, r1);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r2);
-}
-Parrot_mul_i_i_i {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 3, r1);
-    jit_info->native_ptr = emit_mul (jit_info->native_ptr, cond_AL, 0,
-                                     r2, r0, r1);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r2);
-}
-Parrot_mul_i_ic_ic {
-    jit_info->native_ptr = emit_load_constant (jit_info->native_ptr,
-                                               interp,
-                                               cond_AL,
-                                               *INT_CONST[2] * *INT_CONST[3],
-                                               r0);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-}
-
-Parrot_neg_i {
-    Parrot_jit_arith_const (jit_info, interp, cond_AL, RSB, 1, 1, 0);
-}
-Parrot_neg_i_i {
-    Parrot_jit_arith_const (jit_info, interp, cond_AL, RSB, 1, 2, 0);
-}
-Parrot_neg_i_ic {
-    jit_info->native_ptr = emit_load_constant (jit_info->native_ptr,
-                                               interp,
-                                               cond_AL,
-                                               -*INT_CONST[2],
-                                               r0);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-}
-
-
-Parrot_sub_i_i_i {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 3, r1);
-    jit_info->native_ptr = emit_arith_reg (jit_info->native_ptr, cond_AL,
-                                                 SUB, 0, r2, r0, r1);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r2);
-}
-Parrot_sub_i_i_ic {
-    Parrot_jit_arith_const_neg (jit_info, interp, cond_AL, SUB, ADD,
-        1, 2, *INT_CONST[3]);
-}
-Parrot_sub_i_ic_i {
-    Parrot_jit_arith_const_neg (jit_info, interp, cond_AL, RSB, ADD,
-        1, 3, *INT_CONST[2]);
-}
-Parrot_sub_i_ic_ic {
-    jit_info->native_ptr = emit_load_constant (jit_info->native_ptr,
-                                               interp,
-                                               cond_AL,
-                                               *INT_CONST[2] - *INT_CONST[3],
-                                               r0);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-}
-Parrot_sub_i_ic {
-    Parrot_jit_arith_const_neg (jit_info, interp, cond_AL, SUB, ADD,
-        1, 1, *INT_CONST[2]);
-}
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; bit ops
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-Parrot_band_i_i_i {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 3, r1);
-    jit_info->native_ptr = emit_arith_reg (jit_info->native_ptr, cond_AL,
-                                                 AND, 0, r2, r0, r1);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r2);
-}
-Parrot_band_i_i_ic {
-    Parrot_jit_arith_const_not (jit_info, interp, cond_AL, AND, BIC,
-        1, 2, *INT_CONST[3]);
-}
-Parrot_band_i_ic_i {
-    Parrot_jit_arith_const_not (jit_info, interp, cond_AL, AND, BIC,
-        1, 3, *INT_CONST[2]);
-}
-Parrot_band_i_ic_ic {
-    jit_info->native_ptr = emit_load_constant (jit_info->native_ptr,
-                                               interp,
-                                               cond_AL,
-                                               *INT_CONST[2] & *INT_CONST[3],
-                                               r0);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-}
-Parrot_band_i_ic {
-    Parrot_jit_arith_const_not (jit_info, interp, cond_AL, AND, BIC,
-        1, 1, *INT_CONST[2]);
-}
-
-;Parrot_bnot_i {
-;    Parrot_jit_int_load(jit_info, interp, cond_AL, 1, r0);
-;    jit_info->native_ptr = emit_arith_reg (jit_info->native_ptr, cond_AL,
-;                                                 MVN, 0, r0, 0, r0);
-;    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-;}
-Parrot_bnot_i_i {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    jit_info->native_ptr = emit_arith_reg (jit_info->native_ptr, cond_AL,
-                                                 MVN, 0, r0, 0, r0);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-}
-Parrot_bnot_i_ic {
-    jit_info->native_ptr = emit_load_constant (jit_info->native_ptr,
-                                               interp,
-                                               cond_AL,
-                                               ~*INT_CONST[2],
-                                               r0);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-}
-
-Parrot_bor_i_i_i {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 3, r1);
-    jit_info->native_ptr = emit_arith_reg (jit_info->native_ptr, cond_AL,
-                                           ORR, 0, r2, r0, r1);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r2);
-}
-Parrot_bor_i_i_ic {
-    Parrot_jit_arith_const (jit_info, interp, cond_AL, ORR,
-                            1, 2, *INT_CONST[3]);
-}
-Parrot_bor_i_ic_i {
-    Parrot_jit_arith_const (jit_info, interp, cond_AL, ORR,
-                            1, 3, *INT_CONST[2]);
-}
-Parrot_bor_i_ic_ic {
-    jit_info->native_ptr = emit_load_constant (jit_info->native_ptr,
-                                               interp,
-                                               cond_AL,
-                                               *INT_CONST[2] | *INT_CONST[3],
-                                               r0);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-}
-Parrot_bor_i_ic {
-    Parrot_jit_arith_const(jit_info, interp, cond_AL, ORR,
-                           1, 1, *INT_CONST[2]);
-}
-
-Parrot_bxor_i_i_i {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 3, r1);
-    jit_info->native_ptr = emit_arith_reg (jit_info->native_ptr, cond_AL,
-                                           EOR, 0, r2, r0, r1);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r2);
-}
-Parrot_bxor_i_i_ic {
-    Parrot_jit_arith_const (jit_info, interp, cond_AL, EOR,
-                            1, 2, *INT_CONST[3]);
-}
-Parrot_bxor_i_ic_i {
-    Parrot_jit_arith_const (jit_info, interp, cond_AL, EOR,
-                            1, 3, *INT_CONST[2]);
-}
-Parrot_bxor_i_ic_ic {
-    jit_info->native_ptr = emit_load_constant (jit_info->native_ptr,
-                                               interp,
-                                               cond_AL,
-                                               *INT_CONST[2] | *INT_CONST[3],
-                                               r0);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-}
-Parrot_bxor_i_ic {
-    Parrot_jit_arith_const(jit_info, interp, cond_AL, EOR,
-                           1, 1, *INT_CONST[2]);
-}
-
-Parrot_shl_i_i_i {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 3, r1);
-    jit_info->native_ptr
-       = emit_arith_reg_shift_reg (jit_info->native_ptr, cond_AL,
-                                   MOV, 0, r2, 0, r0, shift_LSL, r1);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r2);
-}
-Parrot_shl_i_i_ic {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    jit_info->native_ptr
-       = emit_arith_reg_shift_const (jit_info->native_ptr, cond_AL,
-                                     MOV, 0, r2, 0, r0, shift_LSL,
-                                     *INT_CONST[3]);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r2);
-}
-Parrot_shl_i_ic_i {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 3, r1);
-    jit_info->native_ptr
-       = emit_arith_reg_shift_reg (jit_info->native_ptr, cond_AL,
-                                   MOV, 0, r2, 0, r0, shift_LSL, r1);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r2);
-}
-Parrot_shl_i_ic_ic {
-    jit_info->native_ptr = emit_load_constant (jit_info->native_ptr,
-                                               interp,
-                                               cond_AL,
-                                               *INT_CONST[2] << *INT_CONST[3],
-                                               r0);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-}
-Parrot_shr_i_i_i {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 3, r1);
-    jit_info->native_ptr
-       = emit_arith_reg_shift_reg (jit_info->native_ptr, cond_AL,
-                                   MOV, 0, r2, 0, r0, shift_ASR, r1);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r2);
-}
-Parrot_shr_i_i_ic {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    jit_info->native_ptr
-       = emit_arith_reg_shift_const (jit_info->native_ptr, cond_AL,
-                                     MOV, 0, r2, 0, r0, shift_ASR,
-                                     *INT_CONST[3]);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r2);
-}
-Parrot_shr_i_ic_i {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 3, r1);
-    jit_info->native_ptr
-       = emit_arith_reg_shift_reg (jit_info->native_ptr, cond_AL,
-                                   MOV, 0, r2, 0, r0, shift_ASR, r1);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r2);
-}
-Parrot_shr_i_ic_ic {
-    jit_info->native_ptr = emit_load_constant (jit_info->native_ptr,
-                                               interp,
-                                               cond_AL,
-                                               *INT_CONST[2] >> *INT_CONST[3],
-                                               r0);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-}
-
-Parrot_lsr_i_i_i {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 3, r1);
-    jit_info->native_ptr
-       = emit_arith_reg_shift_reg (jit_info->native_ptr, cond_AL,
-                                   MOV, 0, r2, 0, r0, shift_LSR, r1);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r2);
-}
-Parrot_lsr_i_i_ic {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    jit_info->native_ptr
-       = emit_arith_reg_shift_const (jit_info->native_ptr, cond_AL,
-                                     MOV, 0, r2, 0, r0, shift_LSR,
-                                     *INT_CONST[3]);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r2);
-}
-Parrot_lsr_i_ic_i {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 3, r1);
-    jit_info->native_ptr
-       = emit_arith_reg_shift_reg (jit_info->native_ptr, cond_AL,
-                                   MOV, 0, r2, 0, r0, shift_LSR, r1);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r2);
-}
-Parrot_lsr_i_ic_ic {
-    jit_info->native_ptr = emit_load_constant (jit_info->native_ptr,
-                                               interp,
-                                               cond_AL,
-                                               ((UINTVAL)*INT_CONST[2]) >> *INT_CONST[3],
-                                               r0);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-}
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; logical ops
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-Parrot_and_i_i_i {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    jit_info->native_ptr = emit_arith_immediate (jit_info->native_ptr, cond_AL,
-                                                 CMP, 0, 0, r0, 0, 0);
-    Parrot_jit_int_load(jit_info, interp, cond_NE, 3, r0);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-}
-Parrot_and_i_i_ic {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    jit_info->native_ptr = emit_arith_immediate (jit_info->native_ptr, cond_AL,
-                                                 CMP, 0, 0, r0, 0, 0);
-    Parrot_jit_int_load(jit_info, interp, cond_NE, 3, r1);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-}
-Parrot_and_i_ic_i {
-    if (*INT_CONST[2]) {
-        Parrot_jit_int_load(jit_info, interp, cond_AL, 3, r0);
-    } else {
-        /* *INT_CONST[2] is going to be 0 anyway, but this does generate the
-           shortest code to load 0.  */
-        Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    }
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-}
-Parrot_and_i_ic_ic {
-    if (*INT_CONST[2]) {
-        Parrot_jit_int_load(jit_info, interp, cond_AL, 3, r0);
-    } else {
-        /* *INT_CONST[2] is going to be 0 anyway, but this does generate the
-           shortest code to load 0.  */
-        Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    }
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-}
-
-Parrot_or_i_i_i {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    jit_info->native_ptr = emit_arith_immediate (jit_info->native_ptr, cond_AL,
-                                                 CMP, 0, 0, r0, 0, 0);
-    Parrot_jit_int_load(jit_info, interp, cond_EQ, 3, r0);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-}
-Parrot_or_i_i_ic {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    jit_info->native_ptr = emit_arith_immediate (jit_info->native_ptr, cond_AL,
-                                                 CMP, 0, 0, r0, 0, 0);
-    Parrot_jit_int_load(jit_info, interp, cond_EQ, 3, r0);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-}
-Parrot_or_i_ic_i {
-    if (*INT_CONST[2]) {
-        Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    } else {
-        Parrot_jit_int_load(jit_info, interp, cond_AL, 3, r0);
-    }
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-}
-Parrot_or_i_ic_ic {
-    if (*INT_CONST[2]) {
-        Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    } else {
-        Parrot_jit_int_load(jit_info, interp, cond_AL, 3, r0);
-    }
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-}
-;
-; no or_i_i :-(
-;
-;
-; RSBS  r1, r0, #1
-; ie flags set for CMP #1, r0
-; think unsigned - if r0 is 0, #1 is HIgher
-; for all other cases it's Lower or Same.
-; if r0 is 0, then #1 - #0 is 1, and r1 is set correctly.
-; else
-; MOVLS r1, #0
-; (actaully it's also set correctly for r0 is #1)
-Parrot_not_i_i {
-    Parrot_jit_int_load(jit_info, interp, cond_AL, 2, r0);
-    jit_info->native_ptr = emit_arith_immediate (jit_info->native_ptr, cond_AL,
-                                                 RSB, arith_sets_S,
-                                                 r1, r0, 1, 0);
-    jit_info->native_ptr = emit_arith_immediate (jit_info->native_ptr, cond_LS,
-                                                 MOV, 0,
-                                                 r1, 0, 0, 0);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r1);
-}
-Parrot_not_i_ic {
-    jit_info->native_ptr = emit_load_constant (jit_info->native_ptr,
-                                               interp,
-                                               cond_AL,
-                                               !*INT_CONST[2],
-                                               r0);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-}
-
-; XXX TODO - the non constant versions of this
-Parrot_xor_i_ic_ic {
-    jit_info->native_ptr
-       = emit_load_constant (jit_info->native_ptr, interp, cond_AL,
-                             (*INT_CONST[2] && ! *INT_CONST[3])
-                               ? *INT_CONST[2]
-                               : (*INT_CONST[3] && ! *INT_CONST[2])
-                                 ? *INT_CONST[3] : 0, r0);
-    Parrot_jit_int_store(jit_info, interp, cond_AL, 1, r0);
-}
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; branches
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-Parrot_branch_i {
-   Parrot_jit_int_load(jit_info, interp, cond_AL, 1, r0);
-   Parrot_jump_to_op_in_reg(jit_info, interp, r0);
-}
-Parrot_branch_ic {
-    emit_jump_to_op (jit_info, cond_AL, *INT_CONST[1]);
-}
-
-/*
- * Local variables:
- * c-indentation-style: bsd
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- *
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/arm/exec_dep.c
==============================================================================
--- branches/orderedhash_revamp/src/jit/arm/exec_dep.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,100 +0,0 @@
-/*
-  Copyright (C) 2003-2008, Parrot Foundation.
-  $Id$
-*/
-
-/*
- * exec_dep.c
- *
- * Overview:
- *    ARM dependent functions to emit an executable.
- * History:
- *      Initial version by Daniel Grunblatt on 2003.8.12
- * Notes:
- * References:
- */
-
-#include "parrot/parrot.h"
-#include "jit.h"
-#define JIT_EMIT 1
-#include "jit_emit.h"
-#include "exec_dep.h"
-
-/* HEADERIZER HFILE: src/jit/arm/exec_dep.h */
-
-#ifdef JIT_CGP
-
-void
-Parrot_exec_normal_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-}
-
-#else /* JIT_CGP */
-
-void
-Parrot_exec_normal_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-    jit_info->native_ptr = emit_mov(jit_info->native_ptr, r1, r4);
-#  ifndef ARM_K_BUG
-    jit_info->native_ptr = emit_mov(jit_info->native_ptr, REG14_lr, REG15_pc);
-    jit_info->native_ptr = emit_ldmstm(jit_info->native_ptr,
-                                        cond_AL, is_load, dir_IA,
-                                        is_writeback,
-                                        REG14_lr,
-                                        reg2mask(0) | reg2mask(REG15_pc));
-#  else
-    jit_info->native_ptr = emit_arith_immediate(jit_info->native_ptr, cond_AL,
-                                                 ADD, 0, REG14_lr, REG15_pc,
-                                                 4, 0);
-    jit_info->native_ptr = emit_ldmstm(jit_info->native_ptr,
-                                        cond_AL, is_load, dir_IA,
-                                        is_writeback,
-                                        REG14_lr,
-                                        reg2mask(0) | reg2mask(REG12_ip));
-    jit_info->native_ptr = emit_mov(jit_info->native_ptr, REG15_pc, REG12_ip);
-#  endif /* ARM_K_BUG */
-    Parrot_exec_add_text_rellocation(jit_info->objfile,
-        jit_info->native_ptr, RTYPE_DATA, "program_code", 0);
-    jit_info->native_ptr
-        = emit_word(jit_info->native_ptr, ((int)jit_info->cur_op) -
-            ((int)interp->code->base.data) +
-                (jit_info->objfile->bytecode_header_size));
-    Parrot_exec_add_text_rellocation(jit_info->objfile,
-        jit_info->native_ptr, RTYPE_FUNC,
-            interp->op_info_table[*jit_info->cur_op].func_name, 0);
-    jit_info->native_ptr
-        = emit_word(jit_info->native_ptr, 0);
-}
-
-#endif /* JIT_CGP */
-
-void
-Parrot_exec_cpcf_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-    Parrot_exec_normal_op(jit_info, interp);
-    Parrot_jump_to_op_in_reg(jit_info, interp, r0);
-}
-
-void
-Parrot_exec_restart_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-}
-
-/* Assign the offset of the progra_code */
-void
-offset_fixup(Parrot_exec_objfile_t *obj)
-{
-    int i, j;
-
-    for (i = 0; i < obj->data_count; i++) {
-        for (j = 0; j < i; j++)
-            obj->symbol_table[i].value += obj->data_size[j];
-    }
-}
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/arm/exec_dep.h
==============================================================================
--- branches/orderedhash_revamp/src/jit/arm/exec_dep.h	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,47 +0,0 @@
-/*
-  Copyright (C) 2003-2008, Parrot Foundation.
-  $Id$
-*/
-
-/*
- * exec_dep.h
- *
- * Overview:
- *    ARM dependent functions to emit an executable.
- * History:
- *      Initial version by Daniel Grunblatt on 2003.8.12
- * Notes:
- * References:
- */
-
-#include "jit.h"
-#include "jit_emit.h"
-
-#ifndef PARROT_ARM_EXEC_DEP_H_GUARD
-#define PARROT_ARM_EXEC_DEP_H_GUARD
-
-/* HEADERIZER BEGIN: src/exec_dep.c */
-
-void
-Parrot_exec_normal_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-void
-Parrot_exec_cpcf_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-void
-Parrot_exec_restart_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-/* Assign the offset of the program_code */
-void
-offset_fixup(Parrot_exec_objfile_t *obj);
-
-/* HEADERIZER END: src/exec_dep.c */
-
-#endif /* PARROT_ARM_EXEC_DEP_H_GUARD */
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/arm/jit_defs.c
==============================================================================
--- branches/orderedhash_revamp/src/jit/arm/jit_defs.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,13 +0,0 @@
-/* Stub file for RT#38929 fixes */
-/*
-Copyright (C) 2008, Parrot Foundation.
-$Id$
-*/
-/* HEADERIZER HFILE: none */
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/arm/jit_emit.h
==============================================================================
--- branches/orderedhash_revamp/src/jit/arm/jit_emit.h	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,1101 +0,0 @@
-/*
- * Copyright (C) 2003-2008, Parrot Foundation.
- */
-
-/*
- * jit_emit.h
- *
- * ARM (I think this is all ARM2 or later, although it is APCS-32)
- *
- * $Id$
- */
-
-#ifndef PARROT_ARM_JIT_EMIT_H_GUARD
-#define PARROT_ARM_JIT_EMIT_H_GUARD
-
-#ifdef ARM
-#  ifdef __linux
-#    include <asm/unistd.h>
-#  endif
-#endif /* ARM */
-
-/*  Registers
- *
- *  r0  Argument/result/scratch register 0.
- *  r1  Argument/result/scratch register 1.
- *  r2  Argument/result/scratch register 2.
- *  r3  Argument/result/scratch register 3.
- *  r4  Variable register 1.
- *  r5  Variable register 2.
- *  r6  Variable register 3.
- *  r7  Variable register 4.
- *  r8  Variable register 5.
- *  r9  ARM State variable register 6. Static Base in PID, re-entrant
- *      shared-library variants.
- *  r10 ARM State variable register 7. Stack limit pointer in stack-checked
- *      variants.
- *  r11 ARM State variable register 8. ARM state frame pointer.
- *  r12 The Intra-Procedure call scratch register.
- *  r13 The Stack Pointer.
- *  r14 The Link Register.
- *  r15 The Program Counter.
- *
- * r0-r3 are used to pass in first 4 arguments, and are not preserved by a
- * function. Results (that would fit) are returned in r0
- * Other registers are preserved across calls, although (by implication) r14
- * and r15 are used by the call process. I don't think that it is mandated
- * that r14 on return must hold the link address.
- * r12 (ip) is only used on subroutine entry for stack frame calculations -
- * after then it is a useful scratch register. If you push r14 you get
- * another scratch register quickly.
- *
- * Most things nowadays are StrongARM or later. StrongARM is v4 of the
- * architecture. ARM6 and ARM7 cores are v3, which introduced the 32 bit
- * address bus. Earlier cores (which you won't encounter) used a 26 bit address
- * bus, with program counter and status register combined in r15
- */
-
-typedef enum {
-    r0,
-    r1,
-    r2,
-    r3,
-    r4,
-    r5,
-    r6,
-    r7,
-    r8,
-    r9,
-    r10,
-    r11,
-    r12,
-    r13,
-    r14,
-    r15,
-    REG10_sl = 10,
-    REG11_fp = 11,
-    REG12_ip = 12,
-    REG13_sp = 13,
-    REG14_lr = 14,
-    REG15_pc = 15
-} arm_register_t;
-
-#if JIT_EMIT
-
-typedef enum {
-    cond_EQ = 0x00,
-    cond_NE = 0x10,
-    cond_CS = 0x20,
-    cond_CC = 0x30,
-    cond_MI = 0x40,
-    cond_PL = 0x50,
-    cond_VS = 0x60,
-    cond_VC = 0x70,
-    cond_HI = 0x80,
-    cond_LS = 0x90,
-    cond_GE = 0xA0,
-    cond_LT = 0xB0,
-    cond_GT = 0xC0,
-    cond_LE = 0xD0,
-    cond_AL = 0xE0,
-/*  cond_NV = 0xF0, */
-/*  synonyms for CS and CC:  */
-    cond_HS = 0x20,
-    cond_LO = 0x30
-} arm_cond_t;
-
-/* I've deliberately shifted these right by 1 bit so that I can forcibly
-   set the status flag on ops such as CMP. It's easy to forget (the assembler
-   doesn't mandate you explicitly write CMPS, it just sets the bit for you).
-   I got an illegal instruction trap on a StrongARM for a CMP without S, but
-   I think some of the other comparison operators have legal weird effects
-   with no S flag.  */
-typedef enum {
-    AND = 0x00,
-    EOR = 0x02,
-    SUB = 0x04,  /* Subtract         rd = rn - op2   */
-    RSB = 0x06,  /* Reverse SUbtract rd = op2 - rn  ; op2 is more flexible.   */
-    ADD = 0x08,
-    ADC = 0x0A,  /* ADd with Carry.  */
-    SBC = 0x0C,  /* SuBtract with Carry.  */
-    RSC = 0x0E,  /* Reverse Subtract with Carry.  */
-    TST = 0x11,  /* TeST                  rn AND op2    (sets flags).  */
-    TEQ = 0x13,  /* Test EQuivalence      rn XOR op2    (won't set V flag). */
-    CMP = 0x15,  /* CoMPare               rn  -  op2    */
-    CMN = 0x17,  /* CoMpare Negated       rn  +  op2    */
-    ORR = 0x18,
-    MOV = 0x1A,  /* MOVe                  rd =   op2 */
-    BIC = 0x1C,  /* BIt Clear             rd = rn AND NOT op2 */
-    MVN = 0x1E   /* MoV Not               rd = NOT op2 */
-} alu_op_t;
-
-/* note MVN is move    NOT      (ie logical NOT, 1s complement), whereas
-        CMN is compare NEGATIVE (ie arithmetic NEGATION, 2s complement)  */
-
-#  define arith_sets_S 0x10
-
-#  define INTERP_STRUCT_ADDR_REG r4
-
-/* B / BL
- *
- *  +--------------------------------------------------------------------+
- *  | cond | 1 0 1 | L |                signed_immed_24                  |
- *  +--------------------------------------------------------------------+
- *   31  28 27   25 24  23                                              0
- *
- *
- * The L bit
- *
- * If L == 1 the instruction will store a return address in the link
- * register (R14). Otherwise L == 0, the instruction will simply branch without
- * storing a return address.
- *
- * The target address
- *
- * Specifies the address to branch to. The branch target address is calculated
- * by:
- *
- *  - Sign-extending the 24-bit signed (two's complement) immediate to 32 bits.
- *
- *  - Shifting the result left two bits.
- *
- *  - Adding this to the contents of the PC, which contains the address of the
- *    branch instruction plus 8.
- *
- * The instruction can therefore specify a branch of approximately ±32MB.
- *
- * [Not the full 32 bit address range of the v3 and later cores.]
- */
-
-/* IIRC bx is branch into thumb mode, so don't name this back to bx  */
-
-static char *
-emit_branch(char *pc,
-            arm_cond_t cond,
-            int L,
-            int imm)
-{
-    *(pc++) = imm;
-    *(pc++) = ((imm) >> 8);
-    *(pc++) = ((imm) >> 16);
-    *(pc++) = cond | 0xA | L;
-    return pc;
-}
-
-#  define emit_b(pc, cond, imm) \
-    emit_branch((pc), (cond), 0, (imm))
-
-#  define emit_bl(pc, cond, imm) \
-    emit_branch((pc), (cond), 1, (imm))
-
-
-#  define reg2mask(reg) (1<<(reg))
-
-typedef enum {
-    is_store      = 0x00,
-    is_load       = 0x10,
-    is_writeback  = 0x20,
-    no_writeback  = 0,
-    is_caret      = 0x40, /* assembler syntax is ^ - load sets status flags in
-                             USR mode, or load/store use user bank registers
-                             in other mode. IIRC.  */
-    no_caret      = 0,
-    is_byte       = 0x40,
-    no_byte       = 0,    /* It's a B suffix for a byte load, no suffix for
-                             word load, so this is more natural than is_word  */
-    is_pre        = 0x01, /* pre index addressing.  */
-    is_post       = 0x00  /* post indexed addressing. ie arithmetic for free  */
-} transfer_flags;
-
-/* multiple register transfer direction.
-   D = decrease, I = increase
-   A = after, B = before
-   or the stack notation
-   FD = full descending (the usual)
-   ED = empty descending
-   FA = full ascending
-   FD = full descending
-   values for stack notation are 0x10 | (ldm type) << 2 | (stm type)
-*/
-typedef enum {
-    dir_DA = 0,
-    dir_IA = 1,
-    dir_DB = 2,
-    dir_IB = 3,
-    dir_FD = 0x10 | (1 << 2) | 2,
-    dir_FA = 0x10 | (0 << 2) | 3,
-    dir_ED = 0x10 | (3 << 2) | 0,
-    dir_EA = 0x10 | (2 << 2) | 1
-} ldm_stm_dir_t;
-
-typedef enum {
-    dir_Up = 0x80,
-    dir_Down = 0x00
-} ldr_str_dir_t;
-
-enum { JIT_ARMBRANCH };
-
-static char *
-emit_ldmstm_x(char *pc,
-             arm_cond_t cond,
-             int l_s,
-             ldm_stm_dir_t direction,
-             int caret,
-             int writeback,
-             arm_register_t base,
-             int regmask)
-{
-    if ((l_s == is_load) && (direction & 0x10))
-        direction >>= 2;
-
-    *(pc++) = regmask;
-    *(pc++) = regmask >> 8;
-    /* bottom bit of direction is the up/down flag.  */
-    *(pc++) = ((direction & 1) << 7) | caret | writeback | l_s | base;
-    /* binary 100x is code for stm/ldm.  */
-    /* Top bit of direction is pre/post increment flag.  */
-    *(pc++) = cond | 0x8 | ((direction >> 1) & 1);
-    return pc;
-}
-
-/* Is is going to be rare to non existent that anyone needs to use the ^
-   syntax on LDM or STM, so make it easy to generate the normal form:  */
-#  define emit_ldmstm(pc, cond, l_s, direction, writeback, base, regmask) \
-      emit_ldmstm_x((pc), (cond), (l_s), (direction), 0, (writeback), (base), (regmask))
-
-/* Load / Store
- *
- *  +--------------------------------------------------------------------+
- *  | cond | 0 1 | I | P | U | B | W | L |  Rn  |  Rd  |      offset     |
- *  +--------------------------------------------------------------------+
- *   31  28 27 26 25  24  23  22  21  20  19  16 15  12 11              0
- *
- *
- * The P bit
- *
- * P == 0 indicates the use of post-indexed addressing. The base register value
- *        is used for the memory address, and the offset is then applied to the
- *        base register and written back to the base register.
- *
- * P == 1 indicates the use of offset addressing or pre-indexed addressing (the
- *        W bit determines which). The memory address is generated by applying
- *        the offset to the base register value.
- *
- * The U bit
- *
- * Indicates whether the offset is added to the base (U == 1) or is subtracted
- * from the base (U == 0).
- *
- * The B bit
- *
- * Distinguishes between an unsigned byte (B == 1) and a word (B == 0) access.
- *
- * The W bit
- *
- * P == 0 If W == 0, the instruction is LDR, LDRB, STR or STRB and a normal
- *        memory access is performed. If W == 1, the instruction is LDRBT,
- *        LDRT, STRBT or STRT and an unprivileged (User mode) memory access is
- *        performed.
- *
- * P == 1 If W == 0, the base register is not updated (offset addressing). If
- *        W == 1, the calculated memory address is written back to the base
- *        register (pre-indexed addressing).
- *
- * The L bit
- *
- * Distinguishes between a Load (L == 1) and a Store (L == 0).
- *
- *  <Rd> is the destination register.
- *  <Rn> is the base register.
- *
- * XXX need to detail addr mode, for I = 0 and I = 1
- *
- * Note that you can take advantage of post indexed addressing to get a free
- * add onto the base register if you need it for some other purpose.
- *
- * Note that on StrongARM [and later? but not XScale :-(] if you don't use Rd
- * next instruction then a load doesn't stall if it is from the cache (ie
- * 1 cycle loads). You will want to re-order things where possible to take
- * advantage of this.
- *
- * ARM1 had register shift register as possibilities for the offset (as the
- * ALU ops still do. These took 1 more cycle, and were taken out as virtually
- * no use was found for them. However, the bit patterns they represent
- * certainly didn't used to fault as an illegal instruction on ARM2s, and
- * probably later. So beware of generating illegal bit pattern offsets, as
- * you'll get silent undefined behaviour.
- */
-
-static char *
-emit_ldrstr(char *pc,
-            arm_cond_t cond,
-            int l_s,
-            ldr_str_dir_t direction,
-            int pre,
-            int writeback,
-            int byte,
-            arm_register_t dest,
-            arm_register_t base,
-            int offset_type,
-            unsigned int offset)
-{
-    *(pc++) = offset;
-    *(pc++) = ((offset >> 8) & 0xF) | (dest << 4);
-    *(pc++) = direction | byte | writeback | l_s | base;
-    *(pc++) = cond | 0x4 | offset_type | pre;
-    return pc;
-}
-
-static char *
-emit_ldrstr_offset(char *pc,
-                    arm_cond_t cond,
-                    int l_s,
-                    int pre,
-                    int writeback,
-                    int byte,
-                    arm_register_t dest,
-                    arm_register_t base,
-                    int offset)
-{
-    ldr_str_dir_t direction = dir_Up;
-    if (offset > 4095 || offset < -4095) {
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_JIT_ERROR,
-            "Unable to generate offset %d, larger than 4095\n", offset);
-    }
-
-    if (offset < 0) {
-        direction = dir_Down;
-        offset    = -offset;
-    }
-    return emit_ldrstr(pc, cond, l_s, direction, pre, writeback, byte, dest,
-                       base, 0, offset);
-}
-
-/* Arithmetic
- *
- *  +--------------------------------------------------------------------+
- *  | cond | 0 0 | I |  ALU  Opcode  | S |  Rn  |  Rd  | shifted operand |
- *  +--------------------------------------------------------------------+
- *   31  28 27 26 25  24  23  22  21  20  19  16 15  12 11              0
- *
- *
- * The S bit
- *
- * Indicates if the CPSR will be updated (S == 1) or not (S == 0).
- *
- * Two types of CPSR updates can occur:
- *
- *  - If <Rd> is not R15, the N and Z flags are set according to the result of
- *    of the addition, and C and V flags are set according to whether the
- *    addition generated a carry (unsigned overflow) and a signed overflow,
- *    respectively. The rest of the CPSR is unchanged.
- *
- * XXX shifted immediate values for the second operand can also set the C
- * flag (and therefore presumably also clear it) when the S flag is set for
- * certain ALU ops. (I think just the logical ops) This is obscure, but
- * sometimes useful. No idea where this is documented.
- *
- *  - If <Rd> is R15, the SPSR of the current mode is copied to the CPSR. This
- *    form of the instruction is UNPREDICTABLE if executed in User mode or
- *    System mode, because these do not have an SPSR.
- *
- *
- */
-
-typedef enum {
-    shift_LSL = 0x00,
-    shift_LSR = 0x20,
-    shift_ASR = 0x40,
-    shift_ROR = 0x60,
-    shift_ASL = 0x00    /* Synonym - no sign extension (or not) on <<  */
-} barrel_shift_t;
-/* RRX (rotate right with extend - a 1 position 33 bit rotate including the
-   carry flag) is encoded as ROR by 0.  */
-
-static char *
-emit_arith(char *pc,
-           arm_cond_t cond,
-           alu_op_t op,
-           int status,
-           arm_register_t rd,
-           arm_register_t rn,
-           int operand2_type,
-           int operand2)
-{
-    *(pc++) = operand2;
-    *(pc++) = rd << 4 | ((operand2 >> 8) & 0xF);
-    *(pc++) = op << 4 | status | rn;
-    *(pc++) = cond | 0 | operand2_type | op >> 4;
-    return pc;
-}
-
-static char *
-emit_mul(char *pc,
-         arm_cond_t cond,
-         int status,
-         arm_register_t rd,
-         arm_register_t rm,
-         arm_register_t rs)
-{
-    *(pc++) = 0x90 | rm;
-    *(pc++) = rs;
-    *(pc++) = status | rd;
-    *(pc++) = cond | 0;
-    return pc;
-}
-
-static char *
-emit_mla(char *pc,
-         arm_cond_t cond,
-         int status,
-         arm_register_t rd,
-         arm_register_t rm,
-         arm_register_t rs,
-         arm_register_t rn)
-{
-    *(pc++) = 0x90 | rm;
-    *(pc++) = rn << 4 | rs;
-    *(pc++) = 0x20 | status | rd;
-    *(pc++) = cond | 0;
-    return pc;
-}
-
-/* operand2 immediate constants are expressed as val rotate right (2 * n),
-   where val is 8 bits, n is 4 bits. This uses the 12 bits available to
-   generate many useful common constants, far more than would be given by a
-   12 bit number 0 - 0xFFF.
-   Often, you're trying to use the immediate constant in an operand that could
-   be replaced its complement. So if MOV rd, #const doesn't work,
-   MVN rn, #~const might. And ADD rd, rn, #const may be impossible, but
-   SUB rd, rn, #-const will. So allow the return struct to flag this.
-
-   I believe that the only case where a 32 bit value and its converse is
-   representable in 8 shift 4 is for 0 and -(0)
-   So it's perfectly valid to try the inverse every time.  */
-
-
-enum constant_state {doesnt_fit, fits_as_not, fits_as_neg, fits_as_is};
-
-/* Deliberate 4th char to pad the struct and hence silence a warning.  */
-struct constant {
-    unsigned char value;
-    unsigned char rotation;
-    unsigned char state;
-    unsigned char pad;
-};
-/* XXX Future work would be to try to find a fast compramise way of looking
-   for the double instruction constants. eg 0xFFF is 0xF00 + 0xFF, or
-   0xF00 | 0xFF
-   The problem comes that for building an immediate constant all combinations
-   are on (ie MOV followed by anything, including hacks with setting the carry
-   flag using non-standard rotations) but for add_i_i_ic you probably only
-   want to break down into two halves that are in turn each added/subtracted.
-*/
-
-static void
-constant_neg(int value,  struct constant *result)
-{
-    result->rotation = 0;
-    while (1) {
-        if ((value & ~0xFF) == 0) {
-            /* No bits spill out.  */
-            result->state = fits_as_is;
-            result->value = value;
-            return;
-        }
-        if (((-value) & ~0xFF) == 0) {
-            result->value = -value;
-            result->state = fits_as_neg;
-            return;
-        }
-        if (++result->rotation == 16)
-            break;
-
-        /* There is no rotate op in C, and to do it with 2 shifts and an or
-           would mean casting to unsigned to prevent sign extensions, and it's
-           exactly 1 arm instruction I need, so it's clearer like this:  */
-        __asm__(
-            "mov     %0, %1, ror #30\n"
-            : "=r" (value)
-            : "r" (value));
-
-    }
-    result->state = doesnt_fit;
-    return;
-}
-
-
-static void
-constant_not(int value,  struct constant *result)
-{
-    result->rotation = 0;
-    while (1) {
-        if ((value & ~0xFF) == 0) {
-            /* No bits spill out.  */
-            result->state = fits_as_is;
-            result->value = value;
-            return;
-        }
-        if (((~value) & ~0xFF) == 0) {
-            result->value = ~value;
-            result->state = fits_as_not;
-            return;
-        }
-        if (++result->rotation == 16)
-            break;
-
-        /* There is no rotate op in C, and to do it with 2 shifts and an or
-           would mean casting to unsigned to prevent sign extensions, and it's
-           exactly 1 arm instruction I need, so it's clearer like this:  */
-        __asm__(
-            "mov     %0, %1, ror #30\n"
-            : "=r" (value)
-            : "r" (value));
-
-    }
-    result->state = doesnt_fit;
-    return;
-}
-
-/* eg add r0, r3, r7  */
-#  define emit_arith_reg(pc, cond, op, status, rd, rn, rm) \
-      emit_arith((pc), (cond), (op), (status), (rd), (rn), 0, (rm))
-
-/* eg sub r0, r3, r7 lsr #3 */
-#  define emit_arith_reg_shift_const(pc, cond, op, status, rd, rn, rm, shift, by) \
-      emit_arith((pc), (cond), (op), (status), (rd), (rn), 0, ((by) << 7) | (shift) | 0 | (rm))
-
-/* eg orrs r1, r2, r1 rrx */
-#  define emit_arith_reg_rrx(pc, cond, op, status, rd, rn, rm) \
-      emit_arith((pc), (cond), (op), (status), (rd), (rn), 0, shift_ROR | 0 | (rm))
-
-/* I believe these take 2 cycles (due to having to access a 4th register.  */
-#  define emit_arith_reg_shift_reg(pc, cond, op, status, rd, rn, rm, shift, rs) \
-      emit_arith((pc), (cond), (op), (status), (rd), (rn), 0, ((rs) << 8) | (shift) | 0x10 | (rm))
-
-#  define emit_arith_immediate(pc, cond, op, status, rd, rn, val, rotate) \
-      emit_arith((pc), (cond), (op), (status), (rd), (rn), 2, ((rotate) << 8) | (val))
-
-/* I'll use mov r0, r0 as my NOP for now.  */
-#  define emit_nop(pc) emit_mov((pc), r0, r0)
-
-/* MOV ignores rn  */
-#  define emit_mov(pc, dest, src) emit_arith_reg((pc), cond_AL, MOV, 0, (dest), 0, (src))
-
-static char *
-emit_word(char *pc, unsigned int word)
-{
-    *(pc++) = word;
-    *(pc++) = word >> 8;
-    *(pc++) = word >> 16;
-    *(pc++) = word >> 24;
-    return pc;
-}
-
-static void emit_jump_to_op(Parrot_jit_info_t *jit_info, arm_cond_t cond,
-                            opcode_t disp)
-{
-    opcode_t opcode = jit_info->op_i + disp;
-    int offset = 0;
-    if (opcode <= jit_info->op_i) {
-        offset = jit_info->arena.op_map[opcode].offset -
-            (jit_info->native_ptr - jit_info->arena.start);
-    }
-    else {
-        Parrot_jit_newfixup(jit_info);
-        jit_info->arena.fixups->type = JIT_ARMBRANCH;
-        jit_info->arena.fixups->param.opcode = opcode;
-    }
-
-    jit_info->native_ptr
-        = emit_branch(jit_info->native_ptr, cond, 0, (offset >> 2) - 2);
-}
-
-static char *
-emit_load_constant_from_pool(char *pc,
-                              PARROT_INTERP,
-                              arm_cond_t cond,
-                              int value,
-                              arm_register_t hwreg)
-{
-    /* can't do it in one.  XXX this should use a constant pool.
-       ldr  rd, [pc]    ; pipelining makes this .L1
-       b    L2
-       .L1 value
-       .L2 next
-    */
-
-    pc = emit_ldrstr_offset(pc, cond,
-                             is_load, is_pre,
-                             0, 0,
-                             hwreg,
-                             REG15_pc, 0);
-    /* Must always jump round our inlined constant, if if we don't load it
-       (due to condition codes) */
-    pc = emit_b(pc, cond_AL, 0);
-    pc = emit_word(pc, value);
-    return pc;
-}
-
-static char *
-emit_load_constant(char *pc,
-                    PARROT_INTERP,
-                    arm_cond_t cond,
-                    int value,
-                    arm_register_t hwreg)
-{
-    struct constant immediate;
-
-    constant_not(value, &immediate);
-
-    if (immediate.state == fits_as_is) {
-        pc = emit_arith_immediate(pc, cond, MOV, 0, hwreg, 0,
-                                  immediate.value, immediate.rotation);
-    }
-    else if (immediate.state == fits_as_not) {
-        pc = emit_arith_immediate(pc, cond, MVN, 0, hwreg, 0,
-                                   immediate.value, immediate.rotation);
-    }
-    else {
-        pc = emit_load_constant_from_pool(pc, interp, cond, value, hwreg);
-    }
-    return pc;
-}
-
-static void
-Parrot_jit_int_load(Parrot_jit_info_t *jit_info,
-                    PARROT_INTERP,
-                    arm_cond_t cond,
-                    int param,
-                    arm_register_t hwreg)
-{
-    opcode_t op_type
-        = interp->op_info_table[*jit_info->cur_op].types[param];
-    int val = jit_info->cur_op[param];
-    int offset;
-
-    switch (op_type){
-        case PARROT_ARG_I:
-            offset = ((char *)&interp->int_reg.registers[val])
-                - (char *)interp;
-            if (offset > 4095)
-                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_JIT_ERROR,
-                    "integer load register %d generates offset %d, "
-                    "larger than 4095\n", val, offset);
-            }
-            jit_info->native_ptr = emit_ldrstr_offset(jit_info->native_ptr,
-                                                       cond,
-                                                       is_load,
-                                                       is_pre,
-                                                       0, 0,
-                                                       hwreg,
-                                                       INTERP_STRUCT_ADDR_REG,
-                                                       offset);
-            break;
-        case PARROT_ARG_IC:
-            jit_info->native_ptr = emit_load_constant(jit_info->native_ptr,
-                                                       interp,
-                                                       cond,
-                                                       val,
-                                                       hwreg);
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_JIT_ERROR,
-                "Unsupported op parameter type %d in jit_int_load\n", op_type);
-    }
-}
-
-static void
-Parrot_jit_int_store(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP,
-                     arm_cond_t cond,
-                     int param,
-                     arm_register_t hwreg)
-{
-    opcode_t op_type
-         = interp->op_info_table[*jit_info->cur_op].types[param];
-    int val = jit_info->cur_op[param];
-    int offset;
-
-    switch (op_type){
-        case PARROT_ARG_I:
-            offset = ((char *)&interp->int_reg.registers[val])
-                - (char *)interp;
-
-            if (offset > 4095)
-                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_JIT_ERROR,
-                    "integer store register %d generates offset %d, "
-                    "larger than 4095\n", val, offset);
-            }
-            jit_info->native_ptr = emit_ldrstr_offset(jit_info->native_ptr,
-                                                       cond,
-                                                       is_store,
-                                                       is_pre,
-                                                       0, 0,
-                                                       hwreg,
-                                                       INTERP_STRUCT_ADDR_REG,
-                                                       offset);
-            break;
-
-        case PARROT_ARG_N:
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_JIT_ERROR,
-                "Unsupported op parameter type %d in jit_int_store\n", op_type);
-    }
-}
-
-static void
-Parrot_jit_arith_const_alternate(Parrot_jit_info_t *jit_info,
-                                  PARROT_INTERP,
-                                  arm_cond_t cond,
-                                  enum constant_state alternate_on,
-                                  alu_op_t normal, alu_op_t alternative,
-                                  int dest, int src, int const_val)
-{
-    struct constant val;
-
-    Parrot_jit_int_load(jit_info, interp, cond, src, r0);
-
-    constant_neg(const_val, &val);
-
-    if (val.state == fits_as_is || val.state == alternate_on) {
-        /* We can use an immediate constant.  */
-        /* say plus is ADD, minus is SUB
-           Then if value fits into an immediate constant, we add r0, r0, #value
-           If -value fits, then we sub, r0, r0, #-value
-        */
-        jit_info->native_ptr
-            = emit_arith_immediate(jit_info->native_ptr, cond,
-                                    val.state == fits_as_is
-                                    ? normal : alternative,
-                                    0, r0, r0, val.value, val.rotation);
-    }
-    else {
-        /* Else we load it into a reg the slow way. */
-        jit_info->native_ptr
-            = emit_load_constant_from_pool(jit_info->native_ptr, interp,
-                                            cond, const_val, r1);
-        jit_info->native_ptr
-            = emit_arith_reg(jit_info->native_ptr, cond, normal, 0,
-                              r0, r0, r1);
-    }
-    Parrot_jit_int_store(jit_info, interp, cond, dest, r0);
-}
-
-#  define Parrot_jit_arith_const_neg(ji, i, cond, plus, minus, dest, src, const_val) \
-      Parrot_jit_arith_const_alternate((ji), (i), (cond), fits_as_neg, \
-                      (plus), (minus), (dest), (src), (const_val))
-
-#  define Parrot_jit_arith_const_not(ji, i, cond, plus, minus, dest, src, const_val) \
-      Parrot_jit_arith_const_alternate((ji), (i), (cond), fits_as_not, \
-                      (plus), (minus), (dest), (src), (const_val))
-#  define Parrot_jit_arith_const(ji, i, cond, plus, dest, src, const_val) \
-      Parrot_jit_arith_const_alternate((ji), (i), (cond), fits_as_is, \
-                      (plus), (plus), (dest), (src), (const_val))
-
-
-/* branching on if cannot (in future) be conditional (easily), because we
-   want to set the flags.
-   Yes, for seriously advanced stuff you can
-   1: chain compatible comparisons (eg something setting LE and something else
-      setting LE can be done with the second conditional)
-   2: use TEQ which doesn't change the V flag (or C, IIRC), and chain that with
-      something else that did set the V flag
-
-   but that's JIT v5 or later (where v3 can hold intermediate values in CPU
-   registers, and v4 can do some things conditionally)
-*/
-static void
-Parrot_jit_jumpif_const(Parrot_jit_info_t *jit_info,
-                         PARROT_INTERP,
-                         int src, int const_val, int where_to,
-                         arm_cond_t when)
-{
-    struct constant val;
-
-    Parrot_jit_int_load(jit_info, interp, cond_AL, src, r0);
-
-    constant_neg(const_val, &val);
-
-    if (val.state == fits_as_is || val.state == fits_as_neg) {
-        /* We can use an immediate constant.  */
-        jit_info->native_ptr
-            = emit_arith_immediate(jit_info->native_ptr, cond_AL,
-                                    val.state == fits_as_is ? CMP : CMN, 0,
-                                    0, r0, val.value, val.rotation);
-    }
-    else {
-        /* Else we load it into a reg the slow way. */
-        jit_info->native_ptr
-            = emit_load_constant_from_pool(jit_info->native_ptr, interp,
-                                            cond_AL, const_val, r1);
-        jit_info->native_ptr
-            = emit_arith_reg(jit_info->native_ptr, cond_AL, CMP, 0, 0, r0, r1);
-    }
-    emit_jump_to_op(jit_info, when, where_to);
-}
-
-static void
-Parrot_jump_to_op_in_reg(Parrot_jit_info_t *jit_info,
-                         PARROT_INTERP, arm_register_t reg)
-{
-    /* This is effectively the pseudo-opcode ldr - ie load relative to PC.
-       So offset includes pipeline.  */
-    jit_info->native_ptr = emit_ldrstr_offset(jit_info->native_ptr, cond_AL,
-                                               is_load, is_pre, 0, 0,
-                                               REG14_lr, REG15_pc, 0);
-    /* ldr pc, [r14, r0]  */
-    /* lazy. this is offset type 0, 0x000 which is r0 with zero shift  */
-    jit_info->native_ptr = emit_ldrstr(jit_info->native_ptr, cond_AL,
-                                        is_load, dir_Up, is_pre, 0, reg,
-                                        REG15_pc, REG14_lr, 2, 0);
-    /* and this "instruction" is never reached, so we can use it to store
-       the constant that we load into r14  */
-    jit_info->native_ptr
-        = emit_word(jit_info->native_ptr,
-                     ((int) jit_info->arena.op_map) -
-                     ((int) interp->code->base.code));
-}
-
-#endif /* JIT_EMIT */
-#if JIT_EMIT == 2
-
-void Parrot_jit_dofixup(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-    Parrot_jit_fixup_t *fixup = jit_info->arena.fixups;
-
-    while (fixup){
-        switch (fixup->type){
-            case JIT_ARMBRANCH:
-            {
-                char *fixup_ptr = Parrot_jit_fixup_target(jit_info, fixup);
-                int offset = jit_info->arena.op_map[fixup->param.opcode].offset
-                    - fixup->native_offset;
-                int disp = (offset >> 2) - 2;
-                *(fixup_ptr++) = disp;
-                *(fixup_ptr++) = disp >> 8;
-                *(fixup_ptr) = disp >> 16;
-                break;
-            }
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_JIT_ERROR,
-                    "Unknown fixup type:%d\n", fixup->type);
-                break;
-        }
-        fixup = fixup->next;
-    }
-}
-/* My entry code is create a stack frame:
-    mov ip, sp
-    stmfd   sp!, {r4, fp, ip, lr, pc}
-    sub fp, ip, #4
-   Then store the first parameter (pointer to the interpreter) in r4.
-    mov r4, r0
-*/
-
-void
-Parrot_jit_begin(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-    jit_info->native_ptr = emit_mov(jit_info->native_ptr, REG12_ip, REG13_sp);
-    jit_info->native_ptr = emit_ldmstm(jit_info->native_ptr,
-                                        cond_AL, is_store, dir_FD,
-                                        is_writeback,
-                                        REG13_sp,
-                                        reg2mask(4) | reg2mask(REG11_fp)
-                                        | reg2mask(REG12_ip)
-                                        | reg2mask(REG14_lr)
-                                        | reg2mask(REG15_pc));
-    jit_info->native_ptr = emit_arith_immediate(jit_info->native_ptr, cond_AL,
-                                                 SUB, 0, REG11_fp, REG12_ip,
-                                                 4, 0);
-    jit_info->native_ptr = emit_mov(jit_info->native_ptr, 4, 0);
-    /* TODO emit restart code s. i386
-     *
-     * emit get r0 from stack
-     * Parrot_jump_to_op_in_reg(jit_info, interp, r0);
-     */
-}
-
-/* I'm going to load registers to call functions in general like this:
-    adr     r14,  .L1
-    ldmia   r14!,  {r0, r1, r2, pc} ; register list built by jit
-    .L1:    r0 data
-            r1 data
-            r2 data
-           <where ever> ; address of function.
-    .L2:                      ; next instruction - return point from func.
-
-    here I'm going to do
-
-    mov     r1, r4 ; current interpreter is arg 1
-    adr     r14,  .L1
-    ldmia   r14!,  {r0, pc}
-    .L1:    address of current opcode
-           <where ever> ; address of function for op
-    .L2:                      ; next instruction - return point from func.
-*/
-
-/*
-XXX no.
-need to adr beyond:
-
-    mov     r1, r4 ; current interpreter is arg 1
-    adr     r14,  .L1
-    ldmda   r14!,  {r0, ip}
-    mov     pc, ip
-    .L1     address of current opcode
-    dcd     <where ever>      ; address of function for op
-    .L2:                      ; next instruction - return point from func.
-*/
-void
-Parrot_jit_normal_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-    jit_info->native_ptr = emit_mov(jit_info->native_ptr, r1, r4);
-#  ifndef ARM_K_BUG
-    jit_info->native_ptr = emit_mov(jit_info->native_ptr, REG14_lr, REG15_pc);
-    jit_info->native_ptr = emit_ldmstm(jit_info->native_ptr,
-                                        cond_AL, is_load, dir_IA,
-                                        is_writeback,
-                                        REG14_lr,
-                                        reg2mask(0) | reg2mask(REG15_pc));
-#  else
-    jit_info->native_ptr = emit_arith_immediate(jit_info->native_ptr, cond_AL,
-                                                 ADD, 0, REG14_lr, REG15_pc,
-                                                 4, 0);
-    jit_info->native_ptr = emit_ldmstm(jit_info->native_ptr,
-                                        cond_AL, is_load, dir_IA,
-                                        is_writeback,
-                                        REG14_lr,
-                                        reg2mask(0) | reg2mask(REG12_ip));
-    jit_info->native_ptr = emit_mov(jit_info->native_ptr, REG15_pc, REG12_ip);
-#  endif /* ARM_K_BUG */
-    jit_info->native_ptr
-        = emit_word(jit_info->native_ptr, (int) jit_info->cur_op);
-    jit_info->native_ptr
-        = emit_word(jit_info->native_ptr,
-                     (int) interp->op_func_table[*(jit_info->cur_op)]);
-}
-
-/* We get back address of opcode in bytecode.
-   We want address of equivalent bit of jit code, which is stored as an
-   address at the same offset in a jit table. */
-void Parrot_jit_cpcf_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-    Parrot_jit_normal_op(jit_info, interp);
-    Parrot_jump_to_op_in_reg(jit_info, interp, r0);
-}
-
-/* move reg to mem (i.e. intreg) */
-void
-Parrot_jit_emit_mov_mr(PARROT_INTERP, char *mem, int reg)
-{
-}
-
-/* move mem (i.e. intreg) to reg */
-void
-Parrot_jit_emit_mov_rm(PARROT_INTERP, int reg, char *mem)
-{
-}
-
-/* move reg to mem (i.e. numreg) */
-void
-Parrot_jit_emit_mov_mr_n(PARROT_INTERP, char *mem, int reg)
-{
-}
-
-/* move mem (i.e. numreg) to reg */
-void
-Parrot_jit_emit_mov_rm_n(PARROT_INTERP, int reg, char *mem)
-{
-}
-
-#endif /* JIT_EMIT == 2 */
-#if JIT_EMIT == 0
-
-#  define REQUIRES_CONSTANT_POOL 0
-#  define INT_REGISTERS_TO_MAP 10
-
-/* XXX NOTE before actually mapping things
-
-   1: currently the code has r4  (INTERP_STRUCT_ADDR_REG) is in use
-   2: r12 is trashed over any function call
-   3: currently the entry code doesn't save r5, r6, r7, r8 (or r9) - if the
-      mapping code uses them then it must arrange to save (and restore them)
-
-   and as we're not generating re-entrant code (I assume) surely we can also
-   map r9?
-
-   NWC
-*/
-
-#  ifndef JIT_IMCC
-
-char intval_map[INT_REGISTERS_TO_MAP] =
-    { r0, r1, r2, r3, r4, r5, r6, r7, r8, r12 };
-
-static void
-arm_sync_d_i_cache(void *start, void *end)
-{
-    /* Strictly this is only needed for StrongARM and later (not sure about
-     * ARM8) because earlier cores don't have separate D and I caches.
-     * However there aren't that many ARM7 or earlier devices around that
-     * we'll be running on.  */
-#    ifdef __linux
-#      ifdef __GNUC__
-    int result;
-    /* swi call based on code snippet from Russell King.  Description
-       verbatim:  */
-    /*
-     * Flush a region from virtual address 'r0' to virtual address 'r1'
-     * _inclusive_.  There is no alignment requirement on either address;
-     * user space does not need to know the hardware cache layout.
-     *
-     * r2 contains flags.  It should ALWAYS be passed as ZERO until it
-     * is defined to be something else.  For now we ignore it, but may
-     * the fires of hell burn in your belly if you break this rule. ;)
-     *
-     * (at a later date, we may want to allow this call to not flush
-     * various aspects of the cache.  Passing '0' will guarantee that
-     * everything necessary gets flushed to maintain consistency in
-     * the specified region).
-     */
-
-    /* The value of the SWI is actually available by in
-       __ARM_NR_cacheflush defined in <asm/unistd.h>, but quite how to
-       get that to interpolate as a number into the ASM string is beyond
-       me.  */
-    /* I'm actually passing in exclusive end address, so subtract 1 from
-       it inside the assembler.  */
-    __asm__ __volatile__(
-        "mov     r0, %1\n"
-        "sub     r1, %2, #1\n"
-        "mov     r2, #0\n"
-        "swi     " __sys1(__ARM_NR_cacheflush) "\n"
-        "mov     %0, r0\n"
-        : "=r" (result)
-        : "r" ((long)start), "r" ((long)end)
-        : "r0", "r1", "r2");
-
-    if (result < 0)
-        Parrot_ex_throw_from_c_args(interp, NULL, JIT_ERROR,
-               "Synchronising I and D caches failed with errno=%d\n", -result);
-#      else
-#        error "ARM needs to sync D and I caches, and I don't know how to embed assembler on this C compiler"
-#      endif
-#    else
-/* Not strictly true - on RISC OS it's OS_SynchroniseCodeAreas  */
-#      error "ARM needs to sync D and I caches, and I don't know how to on this OS"
-#    endif
-}
-
-#  endif
-#endif /* JIT_EMIT == 0 */
-#endif /* PARROT_ARM_JIT_EMIT_H_GUARD */
-
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/hppa/core.jit
==============================================================================
--- branches/orderedhash_revamp/src/jit/hppa/core.jit	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,151 +0,0 @@
-;
-; hppa/core.jit
-;
-;
-; $Id$
-;
-
-Parrot_end {
-    jit_emit_end(NATIVECODE);
-}
-
-Parrot_set_i_ic {
-    if (MAP[1]) {
-        jit_emit_mov_ri_i(NATIVECODE, MAP[1], *INT_CONST[2]);
-    }
-    else {
-        jit_emit_mov_ri_i(NATIVECODE, ISR1, *INT_CONST[2]);
-        jit_emit_mov_mr_i(NATIVECODE, ROFFS_INT(1), ISR1); 
-    }
-}
-
-Parrot_set_i_i {
-    if (MAP[1] && MAP[2]) {
-        jit_emit_mov_rr(NATIVECODE, MAP[1], MAP[2]);
-    }
-    else if (MAP[1]) {
-        jit_emit_mov_rm_i(NATIVECODE, MAP[1], ROFFS_INT(2)); 
-    } 
-    else if (MAP[2]) {
-        jit_emit_mov_mr_i(NATIVECODE, ROFFS_INT(1), MAP[2]); 
-    }
-    else {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, ROFFS_INT(2)); 
-        jit_emit_mov_mr_i(NATIVECODE, ROFFS_INT(1), ISR1); 
-    }
-}
-
-TEMPLATE Parrot_binop_x_x {
-    if (MAP[1] && MAP[2]) {
-        jit_emit_<op>_rrr(NATIVECODE, MAP[1], MAP[1], MAP[2]);
-    }
-    else if (MAP[1]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<T>(2)); 
-        jit_emit_<op>_rrr(NATIVECODE, MAP[1], MAP[1], <s1>);
-    }
-    else if (MAP[2]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<T>(1));
-        jit_emit_<op>_rrr(NATIVECODE, <s1>, <s1>, MAP[2]);
-        jit_emit_mov_mr<_N>(NATIVECODE, ROFFS_<T>(1), <s1>);
-    }
-    else {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<T>(1));
-        jit_emit_mov_rm<_N>(NATIVECODE, <s2>, ROFFS_<T>(2));
-        jit_emit_<op>_rrr(NATIVECODE, <s1>, <s2>, <s1>);
-        jit_emit_mov_mr<_N>(NATIVECODE, ROFFS_<T>(1), <s1>);
-    }
-}
-
-TEMPLATE Parrot_binop_x_x_x {
-    if (MAP[1] && MAP[2] && MAP[3]) {
-        jit_emit_<op>_rrr(NATIVECODE, MAP[1], MAP[2], MAP[3]);
-    }
-    else if (MAP[1] && MAP[2]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<T>(3)); 
-        jit_emit_<op>_rrr(NATIVECODE, MAP[1], MAP[2], <s1>);
-    }
-    else if (MAP[1] && MAP[3]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<T>(2));
-        jit_emit_<op>_rrr(NATIVECODE, MAP[1], <s1>, MAP[3]);
-    }
-    else if (MAP[2] && MAP[3]) {
-        jit_emit_<op>_rrr(NATIVECODE, <s1>, MAP[2], MAP[3]);
-        jit_emit_mov_mr<_N>(NATIVECODE, ROFFS_<T>(3), <s1>);
-    }
-    else if (MAP[1]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<T>(3));
-        jit_emit_mov_rm<_N>(NATIVECODE, <s2>, ROFFS_<T>(2));
-        jit_emit_<op>_rrr(NATIVECODE, MAP[1], <s2>, <s1>);
-    }
-    else if (MAP[2]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<T>(3));
-        jit_emit_<op>_rrr(NATIVECODE, <s1>, MAP[2], <s1>);
-        jit_emit_mov_mr<_N>(NATIVECODE, ROFFS_<T>(1), <s1>);
-    }
-    else if (MAP[3]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<T>(2));
-        jit_emit_<op>_rrr(NATIVECODE, <s1>, <s1>, MAP[3]);
-        jit_emit_mov_mr<_N>(NATIVECODE, ROFFS_<T>(1), <s1>);
-    }
-    else {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<T>(3));
-        jit_emit_mov_rm<_N>(NATIVECODE, <s2>, ROFFS_<T>(2));
-        jit_emit_<op>_rrr(NATIVECODE, <s1>, <s2>, <s1>);
-        jit_emit_mov_mr<_N>(NATIVECODE, ROFFS_<T>(1), <s1>);
-    }
-}
-
-Parrot_band_i_i {
-    Parrot_binop_x_x s/<_N>/_i/ s/<op>/and/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_bor_i_i {
-    Parrot_binop_x_x s/<_N>/_i/ s/<op>/or/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_bxor_i_i {
-    Parrot_binop_x_x s/<_N>/_i/ s/<op>/xor/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_add_i_i {
-    Parrot_binop_x_x s/<_N>/_i/ s/<op>/add/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_sub_i_i {
-    Parrot_binop_x_x s/<_N>/_i/ s/<op>/sub/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_band_i_i_i {
-    Parrot_binop_x_x_x s/<_N>/_i/ s/<op>/and/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_bor_i_i_i {
-    Parrot_binop_x_x_x s/<_N>/_i/ s/<op>/or/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_bxor_i_i_i {
-    Parrot_binop_x_x_x s/<_N>/_i/ s/<op>/xor/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_add_i_i_i {
-    Parrot_binop_x_x_x s/<_N>/_i/ s/<op>/add/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_sub_i_i_i {
-    Parrot_binop_x_x_x s/<_N>/_i/ s/<op>/sub/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-TEMPLATE Parrot_ifunless_i_ic {
-    if (!MAP[1]) {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, ROFFS_INT(1));
-    }
-    jit_emit_bc(jit_info, ISR1, r0, <COND>, *INT_CONST[2]);
-}
-
-Parrot_if_i_ic {
-    Parrot_ifunless_i_ic s/<COND>/emit_EQ/
-}
-
-Parrot_unless_i_ic {
-    Parrot_ifunless_i_ic s/<COND>/emit_NE/
-}

Deleted: branches/orderedhash_revamp/src/jit/hppa/jit_defs.c
==============================================================================
--- branches/orderedhash_revamp/src/jit/hppa/jit_defs.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,13 +0,0 @@
-/* Stub file for RT#38929 fixes */
-/*
-Copyright (C) 2008, Parrot Foundation.
-$Id$
-*/
-/* HEADERIZER HFILE: none */
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/hppa/jit_emit.h
==============================================================================
--- branches/orderedhash_revamp/src/jit/hppa/jit_emit.h	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,786 +0,0 @@
-/*
- * Copyright (C) 2004-2009, Parrot Foundation.
- */
-
-/*
- * jit_emit.h
- *
- * HPPA
- *
- * $Id$
- */
-
-#ifndef PARROT_HPPA_JIT_EMIT_H_GUARD
-#define PARROT_HPPA_JIT_EMIT_H_GUARD
-
-
-/*
- *      r0          Zero
- *      r26         Argument 1
- *      r25         Argument 2
- *      r24         Argument 3
- *      r23         Argument 4
- *      r28         Return value 0
- *      r29         Return value 1
- */
-
-typedef enum {
-    r0,
-    r1,
-    r2,
-    r3,
-    r4,
-    r5,
-    r6,
-    r7,
-    r8,
-    r9,
-    r10,
-    r11,
-    r12,
-    r13,
-    r14,
-    r15,
-    r16,
-    r17,
-    r18,
-    r19,
-    r20,
-    r21,
-    r22,
-    r23,
-    r24,
-    r25,
-    r26,
-    r27,
-    r28,
-    r29,
-    r30,
-    r31
-} hppa_iregister_t;
-
-typedef enum {
-    f0,
-    f1,
-    f2,
-    f3,
-    f4,
-    f5,
-    f6,
-    f7,
-    f8,
-    f9,
-    f10,
-    f11,
-    f12,
-    f13,
-    f14,
-    f15,
-    f16,
-    f17,
-    f18,
-    f19,
-    f20,
-    f21,
-    f22,
-    f23,
-    f24,
-    f25,
-    f26,
-    f27,
-    f28,
-    f29,
-    f30,
-    f31
-} hppa_fregister_t;
-
-enum { JIT_HPPA_BRANCH, JIT_HPPA_CALL };
-
-/* BASE: interpreter address
- * CIR:  call index register
- */
-#  define BASE r4
-#  define CIR r5
-#  define ISR1 r21
-#  define ISR2 r22
-#  define RET0 r28
-
-#  define Parrot_jit_emit_get_base_reg_no(pc) BASE
-
-/* Load / Store.
- *
- *
- *
- *  +--------------------------------------------------------------------+
- *  |    op    |     b      |    t/r    |  s  |         im14             |
- *  +--------------------------------------------------------------------+
- * 0          5 6         10 11       15 16 17 18                      31
- *
- *  ldw (load word)
- *      op = 18
- *  ldo (load offset)
- *      op = 13
- *  stw (store word)
- *      op = 26
- */
-
-#  define emit_ls(pc, op, b, tr, s, im14) \
-    *((pc)++) = (op) << 2 | (b) >> 3; \
-    *((pc)++) = (char)((b) << 5 | (tr)); \
-    *((pc)++) = (s) << 6 | (((im14) >> 7) & 0x3f) ; \
-    if ((im14) < 0) \
-      *((pc)++) = (char)((im14) << 1) + 1; \
-    else \
-      *((pc)++) = (char)(im14) << 1
-
-#  define emit_ldw(pc, b, t, d) \
-    emit_ls((pc), 18, (b), (t), 0, (d))
-
-#  define emit_ldo(pc, b, t, d) \
-    emit_ls((pc), 13, (b), (t), 0, (d))
-
-#  define emit_stw(pc, b, r, d) \
-    emit_ls((pc), 26, (b), (r), 0, (d))
-
-#  define emit_stwm(pc, b, r, d) \
-    emit_ls((pc), 27, (b), (r), 0, (d))
-
-#  define emit_ldwm(pc, b, r, d) \
-    emit_ls((pc), 19, (b), (r), 0, (d))
-
-#  define emit_ldd(pc, b, t, d) \
-    emit_ls((pc), 20, (b), (t), 0, (d))
-
-#  define emit_std(pc, b, r, d) \
-    emit_ls((pc), 28, (b), (r), 0, (d))
-
-/* Load / Store Indexed.
- *
- *
- *
- *  +--------------------------------------------------------------------+
- *  |    op    |     b      |     x     |  s  |u| 0 |cc|  2  |m|    t    |
- *  +--------------------------------------------------------------------+
- * 0          5 6         10 11       15 16 17 18 19 20 22   26 27     31
- *
- */
-
-#  define emit_lsi(pc, op, b, x, tr) \
-    *((pc)++) = (op) << 2 | (b) >> 3; \
-    *((pc)++) = (char)((b) << 5 | (x)); \
-    (pc)++; \
-    *((pc)++) = (2 << 6) | (tr);
-
-
-/*  21 bit immediates.
- *
- *
- *
- *  +--------------------------------------------------------------------+
- *  |    op    |    t / r   |                   im21                     |
- *  +--------------------------------------------------------------------+
- * 0          5 6         10 11                                        31
- *
- *  ldil
- *      op = 8
- */
-
-#  define emit_im21(pc, op, r, imm) \
-    *((pc)++) = (op) << 2 | (r) >> 3; \
-    *((pc)++) = (char)((r) << 5 | (((imm) >> 2) & 0x1f)); \
-    *((pc)++) = (char)(((((imm) >> 7) & 0x3) << 6) | (((imm) & 0x3) << 4) | \
-        (((imm) >> 16) & 0xf)); \
-    *((pc)++) = (char)(((((imm) >> 9) & 0x7f) << 1) | (((imm) >> 20) & 1));
-
-#  define emit_ldil(pc, r, imm) \
-    emit_im21((pc), 8, (r), (imm))
-
-/*  Arithmetic
- *
- *
- *  +--------------------------------------------------------------------+
- *  |    op    |    r2    |    r1    |  c  | f |   ext6   | 0 |    t     |
- *  +--------------------------------------------------------------------+
- * 0          5 6       10 11      15 16 18 19  20      25 26  27      31
- *
- */
-
-#  define emit_arith(pc, op, ext6, s2, s1, t) \
-    *((pc)++) = (op) << 2 | (s2) >> 3; \
-    *((pc)++) = (char)((s2) << 5 | (s1)); \
-    *((pc)++) = (char)((ext6) >> 2); \
-    *((pc)++) = (char)((ext6) << 6 | (t))
-
-#  define jit_emit_add_rrr(pc, dst, src1, src2) \
-    emit_arith((pc), 2, 0x18, (src2), (src1), (dst))
-
-#  define jit_emit_sub_rrr(pc, dst, src1, src2) \
-    emit_arith((pc), 2, 0x10, (src2), (src1), (dst))
-
-#  define jit_emit_or_rrr(pc, dst, src1, src2) \
-    emit_arith((pc), 2, 9, (src2), (src1), (dst))
-
-#  define jit_emit_xor_rrr(pc, dst, src1, src2) \
-    emit_arith((pc), 2, 0xA, (src2), (src1), (dst))
-
-#  define jit_emit_and_rrr(pc, dst, src1, src2) \
-    emit_arith((pc), 2, 8, (src2), (src1), (dst))
-
-/*  Deposit / Extract
- *
- *
- *  +--------------------------------------------------------------------+
- *  |    op    |    r     |    t     |  c  |  x  |     p     |   clen    |
- *  +--------------------------------------------------------------------+
- * 0          5 6       10 11      15 16 18 19 21 22       26 27       31
- *
- */
-
-#  define emit_depext(pc, op, r, t, x, p, clen) \
-    *((pc)++) = (op) << 2 | (r) >> 3; \
-    *((pc)++) = (char)((r) << 5 | (t)); \
-    *((pc)++) = (char)((x) << 2 | (p) >> 3); \
-    *((pc)++) = (char)((p) << 5 | (clen))
-
-#  define emit_extu(pc, r, t, p, clen) \
-    emit_depext((pc), 0x34, (r), (t), 6, (p), (clen));
-
-#  define emit_exts(pc, r, t, p, clen) \
-    emit_depext((pc), 0x34, (r), (t), 7, (p), (clen));
-
-/* Conditions */
-
-#  define emit_NEVER    0
-#  define emit_EQ       1
-#  define emit_LT       2
-#  define emit_LTE      3
-#  define emit_LTU      4
-#  define emit_LTEU     5
-#  define emit_SV       6
-#  define emit_ODD      7
-
-/* Fake conditions */
-
-#  define emit_NE       8
-#  define emit_GTE      9
-#  define emit_GT       10
-#  define emit_GTEU     11
-#  define emit_GTU      12
-
-/* Compare and branch.
- *
- *
- *
- *  +--------------------------------------------------------------------+
- *  |    op    |     r2     |     r1    |  c  |      im11        | n | w |
- *  +--------------------------------------------------------------------+
- * 0          5 6         10 11       15 16 18 19              29  30  31
- *
- *  branch target = cat(w,im11[10], im11[0..9])
- */
-
-#  define emit_cmpbch(pc, op, s2, s1, c, trg, n, w) \
-    *((pc)++) = (op) << 2 | (s2) >> 3; \
-    *((pc)++) = (char)((s2) << 5 | (s1)); \
-    *((pc)++) = (c) << 5 | (trg) >> 6; \
-    *((pc)++) = (char)((trg) << 3 | (n) << 1 | (w))
-
-#  define jit_emit_cmpbt(pc, s2, s1, c, targ, n) \
-    emit_cmpbch((pc), 0x20, (s2), (s1), (c), (targ), (n), (((targ) >> 11) & 1))
-
-#  define jit_emit_cmpbf(pc, s2, s1, c, targ, n) \
-    emit_cmpbch((pc), 0x22, (s2), (s1), (c), (targ), (n), (((targ) >> 11) & 1))
-
-/* Branch and link.
- *
- *
- *
- *  +--------------------------------------------------------------------+
- *  |    op    |     t      |     w1    |  0  |       w2         | n | w |
- *  +--------------------------------------------------------------------+
- * 0          5 6         10 11       15 16 18 19              29  30  31
- *
- * address is:
- *  w1 * 8192
- *  w2 = 10 . 0-9
- *  w + -
- */
-
-#  define _emit_bl(pc, op, t, w1, w2, n, w) \
-    *((pc)++) = (op) << 2 | (t) >> 3; \
-    *((pc)++) = (char)((t) << 5 | (w1)); \
-    *((pc)++) = (w2) >> 6; \
-    *((pc)++) = (char)((w2) << 3 | (n) << 1 | (w))
-
-#  define emit_bl(pc, disp) \
-    _emit_bl((pc), 0x3A, r2, \
-      (((disp) >> 11) & 0x1f), ((((disp) & 0x3ff) << 1) + (((disp) >> 10) & 1)), \
-        0, (((disp) >> 31) & 1));
-
-#  define emit_b(pc) \
-    _emit_bl((pc), 0x3A, r2, 0, 0, 0, 0)
-
-/* Branch and Link Register.
- *
- *
- *
- *  +--------------------------------------------------------------------+
- *  |   0x3A   |     t      |     x     |  2  |        0         | n | 0 |
- *  +--------------------------------------------------------------------+
- * 0          5 6         10 11       15 16 18 19              29  30  31
- *
- * t = curret_ip
- * IP = curret_ip + (x << 3) + 8
- * if (n) execute_next_instruction
- */
-
-#  define emit_blr(pc, t, x, n) \
-    *((pc)++) = 0x3a << 2 | (t) >> 3; \
-    *((pc)++) = (char)((t) << 5 | (x)); \
-    *((pc)++) = 2 << 5; \
-    *((pc)++) = ((n) << 1)
-
-/*  Move.
- XXX MOVE AND BRACH
- */
-
-#  define jit_emit_mov_rr(pc, dst, src) \
-    *((pc)++) = 8; \
-    *((pc)++) = (src); \
-    *((pc)++) = 2; \
-    *((pc)++) = 0x40 + (dst)
-
-/*
- */
-
-#  define emit_ret(pc) \
-    *((pc)++) = 0xe8; \
-    *((pc)++) = 0x40; \
-    *((pc)++) = 0xc0; \
-    *((pc)++) = 0x02
-
-/* Branch Vectored.
- *
- *
- *
- *  +--------------------------------------------------------------------+
- *  |    op    |     b      |     x     |  6  |       0          | n | 0 |
- *  +--------------------------------------------------------------------+
- * 0          5 6         10 11       15 16 18 19              29  30  31
- *
- *  IP = (b << 3) + x
- *
- *  No return address is saved.
- */
-
-#  define _emit_bv(pc, op, b, x, n) \
-    *((pc)++) = (op) << 2 | (b) >> 3; \
-    *((pc)++) = (char)((b) << 5 | (x)); \
-    *((pc)++) = 6 << 5; \
-    *((pc)++) = (n) << 1
-
-#  define emit_bv(pc, b, x, n) \
-    _emit_bv((pc), 0x3A, (b), (x), (n));
-
-/*  Immediate
- *
- *
- *  +--------------------------------------------------------------------+
- *  |    op    |    r     |    t     |  c  | f | 0 |       imm11         |
- *  +--------------------------------------------------------------------+
- * 0          5 6       10 11      15 16 18 19  20                     31
- *
- *  imm11 is low_sign_ext ( ie. the sign bit is 0 )
- */
-
-#  define _emit_imm11(pc, op, r, t, imm11) \
-    *((pc)++) = (op) << 2 | (r) >> 3; \
-    *((pc)++) = (char)((r) << 5 | (t)); \
-    *((pc)++) = (char)((imm11) >> 7); \
-    *((pc)++) = (char)((imm11) << 1)
-
-#  define emit_addimm11(pc, r, t, imm11) \
-    _emit_imm11(pc, 0x2d, r, t, imm11);
-
-/*  Synchronize caches
- *
- *
- *  +--------------------------------------------------------------------+
- *  |    00    |    rv    | 0 |   rv   |  0  |        20       |    0    |
- *  +--------------------------------------------------------------------+
- * 0          5 6       10 11  12    15 16 18 19             26 27     31
- *
- */
-
-#  define emit_sync(pc) \
-    *((pc)++) = 0; \
-    *((pc)++) = 0; \
-    *((pc)++) = 0x4; \
-    *((pc)++) = 0;
-
-
-/* Pseudo instructions. */
-
-#  define jit_emit_nop(pc) \
-    jit_emit_or_rrr((pc), 0, 0, 0)
-
-/* ldil loads a 21 bits immediate into the left part of a general register,
- * ldo loads a 14 bits offset into a general register, so we use it to add
- * the missing 11 bits.
- */
-
-#  define jit_emit_mov_ri_i(pc, D, imm) \
-    emit_ldil((pc), (D), (((imm) >> 11) & 0x1fffff)); \
-    emit_ldo((pc), (D), (D), ((imm) & 0x7ff))
-
-#  define jit_emit_mov_rm_i(pc, reg, offs) \
-    emit_ldw((pc), BASE, (reg), (offs));
-
-#  define jit_emit_mov_mr_i(pc, offs, reg) \
-    emit_stw((pc), BASE, (reg), (offs));
-
-#  define jit_emit_mov_mr_n(pc, offs, reg) \
-    emit_std((pc), BASE, (reg), (offs));
-
-#  define jit_emit_mov_rm_n(pc, offs, reg) \
-    emit_ldd((pc), BASE, (reg), (offs));
-
-/*  emit_cmpbranch
- *
- *      Branches to dest if cond is satisfied.
- *      Doesn't save a return address.
- */
-
-#define jit_emit_cmpbranch(pc, s1, s2, cond, dest) { \
-    if ((cond) >= emit_GTE) { \
-        jit_emit_cmpbf((pc), ((cond) - 7), (s2), (s1), 3, 0); \
-    } \
-    else { \
-        jit_emit_cmpbf((pc), (cond), (s1), (s2), 3, 0); \
-    } \
-    jit_emit_nop(pc); \
-    jit_emit_mov_ri_i((pc), ISR2, (dest)); \
-    emit_bv((pc), ISR2, r0, 1); \
-}
-
-static void
-jit_emit_bc(Parrot_jit_info_t *jit_info, hppa_iregister_t s1,
-    hppa_iregister_t s2,  int cond, opcode_t disp)
-{
-    Parrot_jit_newfixup(jit_info);
-    jit_info->arena.fixups->type = JIT_HPPA_BRANCH;
-    jit_info->arena.fixups->param.opcode = jit_info->op_i + disp;
-
-    if (jit_info->optimizer->cur_section->branch_target ==
-        jit_info->optimizer->cur_section)
-            jit_info->arena.fixups->skip =
-                jit_info->optimizer->cur_section->branch_target->load_size;
-
-    jit_emit_cmpbranch(jit_info->native_ptr, s1, s2, cond, 0);
-}
-
-static void
-Parrot_emit_jump_to_ret(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-    /* This calculates (INDEX into op_map * 4) */
-
-    /* we have to get the code pointer, which might change
-     * due too intersegment branches
-     */
-    emit_ldw(jit_info->native_ptr, BASE, CIR,
-        (offsetof(Interp, code)));
-    emit_ldw(jit_info->native_ptr, CIR, ISR2,
-    (offsetof(PackFile_Segment, data)));
-    jit_emit_sub_rrr(jit_info->native_ptr, CIR, RET0, ISR2);
-    /*
-     * now we have the offset of the ins in CIR
-     *
-     * we have to get the op_map too at runtime
-     */
-    emit_ldw(jit_info->native_ptr, BASE, ISR1,
-        (offsetof(Interp, code)));
-    emit_ldo(jit_info->native_ptr, ISR1, ISR2,
-        (offsetof(Parrot_jit_info_t, arena)));
-    emit_ldw(jit_info->native_ptr, ISR2, ISR1,
-        (offsetof(Parrot_jit_arena_t, op_map)));
-    /* This jumps to the address in op_map[ISR1 + sizeof(void *) * INDEX] */
-    emit_lsi(jit_info->native_ptr, 0x3, ISR1, CIR, ISR2);
-    emit_bv(jit_info->native_ptr, ISR2, r0, 1);
-    jit_emit_nop(jit_info->native_ptr);
-
-}
-
-/* Load the return address from the stack and return. */
-/* Restore the callee-save registers. */
-#  define jit_emit_end(pc) \
-    emit_ldo(jit_info->native_ptr, r30, r30, 0x40); \
-    emit_ldw(jit_info->native_ptr, r30, r4, -0x4); \
-    emit_ldw(jit_info->native_ptr, r30, r5, -0x8); \
-    emit_ldw(jit_info->native_ptr, r30, r6, -0xc); \
-    emit_ldw(jit_info->native_ptr, r30, r7, -0x10); \
-    emit_ldw(jit_info->native_ptr, r30, r8, -0x14); \
-    emit_ldw(jit_info->native_ptr, r30, r9, -0x18); \
-    emit_ldw(jit_info->native_ptr, r30, r10, -0x1c); \
-    emit_ldw(jit_info->native_ptr, r30, r11, -0x20); \
-    emit_ldw(jit_info->native_ptr, r30, r12, -0x24); \
-    emit_ldw(jit_info->native_ptr, r30, r13, -0x28); \
-    emit_ldw(jit_info->native_ptr, r30, r14, -0x2c); \
-    emit_ldw(jit_info->native_ptr, r30, r15, -0x30); \
-    emit_ldw(jit_info->native_ptr, r30, r16, -0x34); \
-    emit_ldw(jit_info->native_ptr, r30, r17, -0x38); \
-    emit_ldw(jit_info->native_ptr, r30, r18, -0x40); \
-    emit_ldw(jit_info->native_ptr, r3, r2, -0x14); \
-    emit_ldo((pc), r3, r30, 0x40); \
-    emit_ldwm((pc), r30, r4, -0x40); \
-    emit_ret(pc)
-
-/*
- * For the JIT procedure calls are built using BRANCH AND LINK REGISTER,
- * specifically, we load the FDP (Function Descriptor Pointer) into ISR2,
- * get the address and r19 set, load the IP, and calculate the displacement
- * right shiff it by 3 and branch there.
- * The FDP will contain the actual function address the second time it's
- * called.
- * But for EXEC using BRANCH AND LINK, this is because the address of
- * the code generated in the JIT could (probably will) be 65535 * 4 bytes
- * farest than the called procedure, and this is won't happend for EXEC
- * (and if it does, it's ld's problem, not ours).
- */
-
-#if JIT_EMIT == 2
-
-void
-Parrot_jit_normal_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-    jit_emit_mov_rr(jit_info->native_ptr, r25, BASE);
-    jit_emit_mov_ri_i(jit_info->native_ptr, r26, ((int)(jit_info->cur_op)));
-
-    Parrot_jit_newfixup(jit_info);
-
-    jit_info->arena.fixups->type = JIT_HPPA_CALL;
-    jit_info->arena.fixups->param.fptr =
-        (void (*)(void))interp->op_func_table[*(jit_info->cur_op)];
-
-    jit_info->native_ptr += 32;
-}
-
-void
-Parrot_jit_cpcf_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-    Parrot_jit_normal_op(jit_info, interp);
-    Parrot_emit_jump_to_ret(jit_info, interp);
-}
-
-#  undef Parrot_jit_restart_op
-void
-Parrot_jit_restart_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-    char *jmp_ptr, *sav_ptr;
-
-    Parrot_jit_normal_op(jit_info, interp);
-    /* remember PC */
-    jmp_ptr = jit_info->native_ptr;
-    jit_emit_cmpbf(jit_info->native_ptr, RET0, r0, emit_EQ, 0, 0);
-    jit_emit_end(jit_info->native_ptr);
-    /* fixup above jump */
-    sav_ptr = jit_info->native_ptr;
-    jit_info->native_ptr = jmp_ptr;
-    jit_emit_cmpbf(jit_info->native_ptr, RET0, r0, emit_EQ,
-        (long)(((sav_ptr - jmp_ptr) - 8) / 4), 0);
-    jit_info->native_ptr = sav_ptr;
-    Parrot_emit_jump_to_ret(jit_info, interp);
-}
-
-#endif /* JIT_EMIT */
-#if JIT_EMIT == 0
-
-#  define FLOAT_REGISTERS_TO_MAP 4
-
-void
-Parrot_jit_begin(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-    /* Save the return address in the stack. */
-    emit_stw(jit_info->native_ptr, r30, r2, -0x14);
-    jit_emit_mov_rr(jit_info->native_ptr, r1, r3);
-    jit_emit_mov_rr(jit_info->native_ptr, r3, r30);
-    emit_stwm(jit_info->native_ptr, r30, r1, 0x40);
-    emit_stw(jit_info->native_ptr, r3, r26, -0x24);
-    emit_stw(jit_info->native_ptr, r3, r25, -0x28);
-    /* Callee-save registers. */
-    emit_ldo(jit_info->native_ptr, r30, r30, 0x40);
-    emit_stw(jit_info->native_ptr, r30, r4, -0x4);
-    emit_stw(jit_info->native_ptr, r30, r5, -0x8);
-    emit_stw(jit_info->native_ptr, r30, r6, -0xc);
-    emit_stw(jit_info->native_ptr, r30, r7, -0x10);
-    emit_stw(jit_info->native_ptr, r30, r8, -0x14);
-    emit_stw(jit_info->native_ptr, r30, r9, -0x18);
-    emit_stw(jit_info->native_ptr, r30, r10, -0x1c);
-    emit_stw(jit_info->native_ptr, r30, r11, -0x20);
-    emit_stw(jit_info->native_ptr, r30, r12, -0x24);
-    emit_stw(jit_info->native_ptr, r30, r13, -0x28);
-    emit_stw(jit_info->native_ptr, r30, r14, -0x2c);
-    emit_stw(jit_info->native_ptr, r30, r15, -0x30);
-    emit_stw(jit_info->native_ptr, r30, r16, -0x34);
-    emit_stw(jit_info->native_ptr, r30, r17, -0x38);
-    emit_stw(jit_info->native_ptr, r30, r18, -0x3c);
-    /* Move the interpreter to the base register. */
-    jit_emit_mov_rr(jit_info->native_ptr, BASE, r26);
-    jit_emit_mov_rr(jit_info->native_ptr, RET0, r25);
-    Parrot_emit_jump_to_ret(jit_info, interp);
-}
-
-void
-Parrot_jit_dofixup(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-    Parrot_jit_fixup_t *fixup;
-    char *fixup_ptr;
-    char *disp;
-    long d;
-
-    fixup = jit_info->arena.fixups;
-
-    while (fixup) {
-        switch (fixup->type) {
-            case JIT_HPPA_BRANCH:
-                fixup_ptr = Parrot_jit_fixup_target(jit_info, fixup) + 8;
-                d = jit_info->arena.op_map[fixup->param.opcode].offset
-                        + jit_info->arena.start + fixup->skip;
-                jit_emit_mov_ri_i(fixup_ptr, ISR2, d);
-                break;
-            case JIT_HPPA_CALL:
-                /* Load the FDP. */
-                fixup_ptr = Parrot_jit_fixup_target(jit_info, fixup);
-                d = (long)fixup->param.fptr - 2;
-                jit_emit_mov_ri_i(fixup_ptr, ISR2, d);
-                emit_ldw(fixup_ptr, ISR2, CIR, 0);
-                emit_ldw(fixup_ptr, ISR2, r19, 4);
-                /* Save the return address in r2 */
-                emit_bl(fixup_ptr, 0);
-                /* Make the return address pass the actual branch */
-                emit_addimm11(fixup_ptr, r2, r2, 8);
-                /* Branch without modifying r2 */
-                emit_bv(fixup_ptr, CIR, r0, 1);
-                jit_emit_nop(fixup_ptr);
-                break;
-            default:
-                exit_fatal(EXCEPTION_JIT_ERROR, "Unknown fixup type:%d\n",
-                                   fixup->type);
-                break;
-        }
-        fixup = fixup->next;
-    }
-}
-
-/* move reg to mem (i.e. intreg) */
-static void
-jit_mov_mr_offs(Parrot_jit_info_t *jit_info, int base, INTVAL offs, int reg)
-{
-    jit_emit_mov_mr_i(jit_info->native_ptr, offs, reg);
-}
-
-/* move mem (i.e. intreg) to reg */
-static void
-jit_mov_rm_offs(Parrot_jit_info_t *jit_info, int reg, int base, INTVAL offs)
-{
-    jit_emit_mov_rm_i(jit_info->native_ptr, reg, offs);
-}
-
-/* move reg to mem (i.e. numreg) */
-static void
-jit_mov_mr_n_offs(Parrot_jit_info_t * jit_info, int base, INTVAL offs, int reg)
-{
-    jit_emit_mov_mr_n(jit_info->native_ptr, offs, reg);
-}
-
-/* move mem (i.e. numreg) to reg */
-static void
-jit_mov_rm_n_offs(Parrot_jit_info_t * jit_info, int reg, int base, INTVAL offs)
-{
-    jit_emit_mov_rm_n(jit_info->native_ptr, reg, offs);
-}
-
-
-#  define REQUIRES_CONSTANT_POOL 0
-#  define INT_REGISTERS_TO_MAP 14
-#  define CACHELINESIZE 32
-
-#  ifndef JIT_IMCC
-
-char intval_map[INT_REGISTERS_TO_MAP] =
-    { r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18};
-
-char intval_map_sub[] =
-    { r0, r1, r2, r3, r4, r5 };
-
-static void
-hppa_sync_cache(void *_start, void *_end)
-{
-    char *start = (char*)(((int)_start) &~(CACHELINESIZE));
-    char *end = (char *)((((int)_end)+CACHELINESIZE) &~(CACHELINESIZE));
-    char *_sync;
-
-    for (_sync = start; _sync < end; _sync += CACHELINESIZE) {
-        __asm__ __volatile__("fdc %r0(%0)":: "r" ((long)_sync));
-    }
-
-    __asm__ __volatile__("sync");
-}
-
-static const jit_arch_info arch_info = {
-    jit_mov_rm_offs,
-    jit_mov_rm_n_offs,
-    jit_mov_mr_offs,
-    jit_mov_mr_n_offs,
-    Parrot_jit_dofixup,
-    hppa_sync_cache,
-    {
-        {
-            Parrot_jit_begin,
-            INT_REGISTERS_TO_MAP,
-            INT_REGISTERS_TO_MAP,
-            intval_map,
-            0,
-            0,
-            NULL
-        },
-        {
-            NULL,
-            0,
-            0,
-            NULL,
-            0,
-            0,
-            NULL
-        },
-        {
-            NULL,
-            0,
-            0,
-            NULL,
-            0,
-            0,
-            NULL
-        }
-    }
-};
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-const jit_arch_info*
-Parrot_jit_init(PARROT_INTERP)
-{
-    return &arch_info;
-}
-
-#  endif
-
-#endif /* !JIT_EMIT */
-
-#endif /* PARROT_HPPA_JIT_EMIT_H_GUARD */
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/i386/core.jit
==============================================================================
--- branches/orderedhash_revamp/src/jit/i386/core.jit	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,1757 +0,0 @@
-;
-; i386/core.jit
-;
-; $Id$
-;
-
-# TODO complete this
-#define P_ARITH ((PREV_OP == dec_i) || (PREV_OP == inc_i) || (PREV_OP == sub_i_i_i) || (PREV_OP == sub_i_i))
-
-#define CALL_FUNCTION(j, f) call_func(j, (void (*)(void)) & f)
-
-Parrot_end {
-    jit_emit_end(NATIVECODE);
-}
-
-Parrot_noop {
-    emit_nop(NATIVECODE);
-}
-
-
-TEMPLATE Parrot_set_x_x {
-    if (MAP[1] && MAP[2]) {
-        jit_emit_mov_rr<_N>(NATIVECODE, MAP[1], MAP[2]);
-    }
-    else if (MAP[1]) {
-        jit_emit_mov_RM<_N>(interp, NATIVECODE, MAP[1], ROFFS_INT(2));
-    }
-    else if (MAP[2]) {
-        jit_emit_mov_MR<_N>(interp, NATIVECODE, ROFFS_INT(1), MAP[2]);
-    }
-    else {
-        jit_emit_mov_RM<_N>(interp, NATIVECODE, ISR1, ROFFS_INT(2));
-        jit_emit_mov_MR<_N>(interp, NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-}
-
-Parrot_set_n_n {
-    Parrot_set_x_x s/<_N>/_n/ s/ISR/FSR/ s/INT/NUM/
-}
-
-Parrot_set_i_i {
-    Parrot_set_x_x s/<_N>/_i/
-}
-
-Parrot_set_p_p {
-    Parrot_set_x_x s/<_N>/_i/ s/INT/PMC/
-}
-
-Parrot_set_s_s {
-    Parrot_set_x_x s/<_N>/_i/ s/INT/STR/
-}
-
-TEMPLATE Parrot_set_x_ic {
-    if (MAP[1]) {
-        jit_emit_mov_ri<_N>(interp, NATIVECODE, MAP[1], <typ>_CONST[2]);
-    }
-    else {
-        jit_emit_mov_MI<_N>(interp, NATIVECODE, ROFFS_INT(1), <typ>_CONST[2]);
-    }
-}
-
-Parrot_set_i_ic {
-    Parrot_set_x_ic s/<_N>/_i/ s/<typ>/*INT/
-}
-
-Parrot_set_n_ic {
-    Parrot_set_x_ic s/<_N>/_ni/ s/INT/NUM/ s/<typ>/&INT/
-}
-
-Parrot_set_n_nc {
-    if (MAP[1]) {
-        jit_emit_mov_ri_n(interp, NATIVECODE, MAP[1], &NUM_CONST[2]);
-    }
-    else {
-        jit_emit_mov_ri_n(interp, NATIVECODE, FSR1, &NUM_CONST[2]);
-        jit_emit_mov_MR_n(interp, NATIVECODE, ROFFS_NUM(1), FSR1);
-    }
-}
-
-Parrot_set_p_pc {
-    if (MAP[1]) {
-        jit_emit_mov_rm_i(interp, NATIVECODE, MAP[1], &PMC_CONST[2]);
-    }
-    else {
-        jit_emit_mov_rm_i(interp, NATIVECODE, ISR1, &PMC_CONST[2]);
-        jit_emit_mov_MR_i(interp, NATIVECODE, ROFFS_PMC(1), ISR1);
-    }
-}
-
-Parrot_set_n_i {
-; store mapped int
-    if (MAP[2]) {
-        jit_emit_mov_MR_i(interp, NATIVECODE, ROFFS_INT(2), MAP[2]);
-    }
-    if (MAP[1]) {
-        jit_emit_mov_RM_ni(interp, NATIVECODE, MAP[1], ROFFS_INT(2));
-    }
-    else {
-        jit_emit_mov_RM_ni(interp, NATIVECODE, FSR1, ROFFS_INT(2));
-        jit_emit_mov_MR_n(interp, NATIVECODE, ROFFS_NUM(1), FSR1);
-    }
-}
-
-; these are wrong: fist does rounding, but we should truncate
-;Parrot_set_i_n {
-;    if (MAP[2]) {
-;        jit_emit_mov_MR_in(NATIVECODE, ROFFS_INT(1), MAP[2]);
-;    }
-;    else {
-;        jit_emit_mov_RM_n(NATIVECODE, FSR1, ROFFS_NUM(2));
-;        jit_emit_mov_MR_in(NATIVECODE, ROFFS_INT(1), FSR1);
-;    }
-;    if (MAP[1]) {
-;        jit_emit_mov_RM_i(interp, NATIVECODE, MAP[1], ROFFS_INT(1));
-;    }
-;}
-;
-;Parrot_set_i_nc {
-;    jit_emit_mov_ri_n(interp, NATIVECODE, FSR1, &NUM_CONST[2]);
-;    jit_emit_mov_MR_in(NATIVECODE, ROFFS_INT(1), FSR1);
-;    if (MAP[1]) {
-;        jit_emit_mov_RM_i(interp, NATIVECODE, MAP[1], ROFFS_INT(1));
-;    }
-;}
-
-; -- null op.
-TEMPLATE Parrot_null_x {
-    if (MAP[1]) {
-        jit_emit_mov_ri<_N>(interp, NATIVECODE, MAP[1], <val>);
-    }
-    else {
-        jit_emit_mov_MI<_N>(interp, NATIVECODE, ROFFS_INT(1), <val>);
-    }
-}
-
-Parrot_null_i {
-    Parrot_null_x s/<_N>/_i/ s/<val>/0/
-}
-
-Parrot_null_p {
-    Parrot_null_x s/<_N>/_i/ s/INT/PMC/ s/<val>/PMCNULL/
-}
-
-Parrot_null_s {
-    Parrot_null_x s/<_N>/_i/ s/INT/STR/ s/<val>/NULL/
-}
-
-; TODO use fldz
-Parrot_null_n {
-    static FLOATVAL zero = 0;
-    if (MAP[1]) {
-        jit_emit_mov_ri_n(interp, NATIVECODE, MAP[1], &zero);
-    }
-    else {
-        jit_emit_mov_MI_ni(interp, NATIVECODE, ROFFS_NUM(1), &zero);
-    }
-}
-
-TEMPLATE Parrot_binop_x_x {
-    if (MAP[1] && MAP[2]) {
-        jit_emit_<op>_rr<_N>(interp, NATIVECODE, MAP[1], MAP[2]);
-    }
-    else if (MAP[1]) {
-        jit_emit_<op>_RM<_N>(interp, NATIVECODE, MAP[1], ROFFS_INT(2));
-    }
-    else if (MAP[2]) {
-# ifdef jit_emit_<op>_MR<_N>
-        jit_emit_<op>_MR<_N>(interp, NATIVECODE, ROFFS_INT(1), MAP[2]);
-# else
-        jit_emit_mov_RM<_N>(interp, NATIVECODE, ISR1, ROFFS_INT(1));
-        jit_emit_<op>_rr<_N>(interp, NATIVECODE, ISR1, MAP[2]);
-        jit_emit_mov_MR<_N>(interp, NATIVECODE, ROFFS_INT(1), ISR1);
-# endif
-    }
-    else {
-        jit_emit_mov_RM<_N>(interp, NATIVECODE, ISR1, ROFFS_INT(1));
-        jit_emit_<op>_RM<_N>(interp, NATIVECODE, ISR1, ROFFS_INT(2));
-        jit_emit_mov_MR<_N>(interp, NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-}
-
-TEMPLATE Parrot_divop_x_x {
-    if (MAP[1]) {
-        jit_emit_mov_rr<_N>(NATIVECODE, ISR1, MAP[1]);
-    }
-    else {
-        jit_emit_mov_RM<_N>(interp, NATIVECODE, ISR1, ROFFS_INT(1));
-    }
-    if (MAP[2]) {
-        jit_emit_<op>_rr<_N>(interp, NATIVECODE, ISR1, MAP[2]);
-    }
-    else {
-        jit_emit_<op>_RM<_N>(interp, NATIVECODE, ISR1, ROFFS_INT(2));
-    }
-    if (MAP[1]) {
-        jit_emit_mov_rr<_N>(NATIVECODE, MAP[1], ISR1);
-    }
-    else {
-        jit_emit_mov_MR<_N>(interp, NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-}
-
-Parrot_mul_i_i {
-    Parrot_binop_x_x s/<op>/mul/ s/<_N>/_i/
-}
-
-Parrot_div_i_i {
-    Parrot_divop_x_x s/<op>/div/ s/<_N>/_i/
-}
-
-Parrot_add_i_i {
-    Parrot_binop_x_x s/<op>/add/ s/<_N>/_i/
-}
-
-Parrot_sub_i_i {
-    Parrot_binop_x_x s/<op>/sub/ s/<_N>/_i/
-}
-
-Parrot_bor_i_i {
-    Parrot_binop_x_x s/<op>/bor/ s/<_N>/_i/
-}
-
-Parrot_bxor_i_i {
-    Parrot_binop_x_x s/<op>/bxor/ s/<_N>/_i/
-}
-
-Parrot_band_i_i {
-    Parrot_binop_x_x s/<op>/band/ s/<_N>/_i/
-}
-
-Parrot_shl_i_i {
-    Parrot_binop_x_x s/<op>/shl/ s/<_N>/_i/
-}
-
-Parrot_shr_i_i {
-    Parrot_binop_x_x s/<op>/shr/ s/<_N>/_i/
-}
-
-Parrot_lsr_i_i {
-    Parrot_binop_x_x s/<op>/lsr/ s/<_N>/_i/
-}
-
-Parrot_mul_n_n {
-    Parrot_binop_x_x s/<op>/mul/ s/<_N>/_n/ s/ISR/FSR/ s/INT/NUM/
-}
-
-Parrot_add_n_n {
-    Parrot_binop_x_x s/<op>/add/ s/<_N>/_n/ s/ISR/FSR/ s/INT/NUM/
-}
-
-Parrot_sub_n_n {
-    Parrot_binop_x_x s/<op>/sub/ s/<_N>/_n/ s/ISR/FSR/ s/INT/NUM/
-}
-
-Parrot_div_n_n {
-    Parrot_binop_x_x s/<op>/div/ s/<_N>/_n/ s/ISR/FSR/ s/INT/NUM/
-}
-
-Parrot_exchange_i_i {
-    Parrot_binop_x_x s/<op>/xchg/ s/<_N>/_i/
-}
-
-Parrot_exchange_s_s {
-    Parrot_binop_x_x s/<op>/xchg/ s/<_N>/_i/ s/INT/STR/
-}
-
-Parrot_exchange_p_p {
-    Parrot_binop_x_x s/<op>/xchg/ s/<_N>/_i/ s/INT/PMC/
-}
-
-Parrot_exchange_n_n {
-    Parrot_binop_x_x s/<op>/xchg/ s/<_N>/_n/ s/INT/NUM/
-}
-
-Parrot_mul_i_i_ic {
-    if (MAP[1] && MAP[2]) {
-        jit_emit_mul_rir_i(NATIVECODE, MAP[1], *INT_CONST[3], MAP[2]);
-    }
-    else if (MAP[1]) {
-        jit_emit_mul_RIM_ii(NATIVECODE, MAP[1], *INT_CONST[3], ROFFS_INT(2));
-    }
-    else if (MAP[2]) {
-        jit_emit_mul_rir_i(NATIVECODE, ISR1, *INT_CONST[3], MAP[2]);
-        jit_emit_mov_MR_i(interp, NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-    else {
-        jit_emit_mov_RM_i(interp, NATIVECODE, ISR1, ROFFS_INT(2));
-        jit_emit_mul_rir_i(NATIVECODE, ISR1, *INT_CONST[3], ISR1);
-        jit_emit_mov_MR_i(interp, NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-}
-
-Parrot_mul_i_ic_i {
-    if (MAP[1] && MAP[3]) {
-        jit_emit_mul_rir_i(NATIVECODE, MAP[1], *INT_CONST[2], MAP[3]);
-    }
-    else if (MAP[1]) {
-        jit_emit_mul_RIM_ii(NATIVECODE, MAP[1], *INT_CONST[2], ROFFS_INT(3));
-    }
-    else if (MAP[3]) {
-        jit_emit_mul_rir_i(NATIVECODE, ISR1, *INT_CONST[2], MAP[3]);
-        jit_emit_mov_MR_i(interp, NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-    else {
-        jit_emit_mul_RIM_ii(NATIVECODE, ISR1, *INT_CONST[2], ROFFS_INT(3));
-        jit_emit_mov_MR_i(interp, NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-}
-
-TEMPLATE Parrot_binop_x_xc {
-    if (MAP[1]) {
-        jit_emit_<op>_ri<_N>(interp, NATIVECODE, MAP[1], <typ>_CONST[2]);
-    }
-    else {
-# ifdef jit_emit_<op>_MI_<_N>
-        jit_emit_<op>_MI<_N>(NATIVECODE, ROFFS_INT(1), <typ>_CONST[2]);
-# else
-        jit_emit_mov_RM<_N>(interp, NATIVECODE, ISR1, ROFFS_INT(1));
-        jit_emit_<op>_ri<_N>(interp, NATIVECODE, ISR1, <typ>_CONST[2]);
-        jit_emit_mov_MR<_N>(interp, NATIVECODE, ROFFS_INT(1), ISR1)
-# endif
-    }
-}
-
-Parrot_add_i_ic {
-    Parrot_binop_x_xc s/<_N>/_i/ s/<op>/add/ s/<typ>/*INT/
-}
-
-Parrot_mul_i_ic {
-    if (MAP[1]) {
-        jit_emit_mul_rir_i(NATIVECODE, MAP[1], *INT_CONST[2], MAP[1]);
-    }
-    else  {
-        jit_emit_mul_RIM_ii(NATIVECODE, ISR1, *INT_CONST[2], ROFFS_INT(1));
-        jit_emit_mov_MR_i(interp, NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-}
-
-Parrot_div_i_ic {
-    if (MAP[1]) {
-        jit_emit_mov_rr_i(NATIVECODE, ISR1, MAP[1]);
-    }
-    else {
-        jit_emit_mov_RM_i(interp, NATIVECODE, ISR1, ROFFS_INT(1));
-    }
-    jit_emit_div_ri_i(NATIVECODE, ISR1, *INT_CONST[2]);
-    if (MAP[1]) {
-        jit_emit_mov_rr_i(NATIVECODE, MAP[1], ISR1);
-    }
-    else {
-        jit_emit_mov_MR_i(interp,NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-}
-
-Parrot_add_n_nc {
-    Parrot_binop_x_xc s/<_N>/_n/ s/<op>/add/ s/INT/NUM/ s/<typ>/&NUM/ s/ISR/FSR/
-}
-
-Parrot_sub_i_ic {
-    Parrot_binop_x_xc s/<_N>/_i/ s/<op>/sub/ s/<typ>/*INT/
-}
-
-Parrot_bor_i_ic {
-    Parrot_binop_x_xc s/<_N>/_i/ s/<op>/bor/ s/<typ>/*INT/
-}
-
-Parrot_band_i_ic {
-    Parrot_binop_x_xc s/<_N>/_i/ s/<op>/band/ s/<typ>/*INT/
-}
-
-Parrot_bxor_i_ic {
-    Parrot_binop_x_xc s/<_N>/_i/ s/<op>/bxor/ s/<typ>/*INT/
-}
-
-Parrot_shl_i_ic {
-    Parrot_binop_x_xc s/<_N>/_i/ s/<op>/shl/ s/<typ>/*INT/
-}
-
-Parrot_shr_i_ic {
-    Parrot_binop_x_xc s/<_N>/_i/ s/<op>/shr/ s/<typ>/*INT/
-}
-
-Parrot_lsr_i_ic {
-    Parrot_binop_x_xc s/<_N>/_i/ s/<op>/lsr/ s/<typ>/*INT/
-}
-
-Parrot_sub_n_nc {
-    Parrot_binop_x_xc s/<_N>/_n/ s/<op>/sub/ s/INT/NUM/ s/<typ>/&NUM/ s/ISR/FSR/
-}
-
-Parrot_mul_n_nc {
-    Parrot_binop_x_xc s/<_N>/_n/ s/<op>/mul/ s/INT/NUM/ s/<typ>/&NUM/ s/ISR/FSR/
-}
-
-Parrot_div_n_nc {
-    Parrot_binop_x_xc s/<_N>/_n/ s/<op>/div/ s/INT/NUM/ s/<typ>/&NUM/ s/ISR/FSR/
-}
-
-TEMPLATE Parrot_binop_i_ic_ic {
-    if (MAP[1]) {
-        jit_emit_mov_ri_i(interp, NATIVECODE, MAP[1], (INTVAL)((uicast)*INT_CONST[2] <op> *INT_CONST[3]));
-    }
-    else {
-        jit_emit_mov_MI_i(interp, NATIVECODE, ROFFS_INT(1), (INTVAL)((uicast)*INT_CONST[2] <op> *INT_CONST[3]));
-    }
-}
-Parrot_mul_i_ic_ic {
-    Parrot_binop_i_ic_ic s!<op>!*! s/uicast/INTVAL/
-}
-
-Parrot_add_i_ic_ic {
-    Parrot_binop_i_ic_ic s/<op>/+/ s/uicast/INTVAL/
-}
-
-Parrot_sub_i_ic_ic {
-    Parrot_binop_i_ic_ic s/<op>/-/ s/uicast/INTVAL/
-}
-
-Parrot_cmod_i_ic_ic {
-    Parrot_binop_i_ic_ic s!<op>!%! s/uicast/INTVAL/
-}
-
-Parrot_band_i_ic_ic {
-    Parrot_binop_i_ic_ic s/<op>/&/ s/uicast/INTVAL/
-}
-
-Parrot_bor_i_ic_ic {
-    Parrot_binop_i_ic_ic s/<op>/|/ s/uicast/INTVAL/
-}
-
-Parrot_bxor_i_ic_ic {
-    Parrot_binop_i_ic_ic s/<op>/^/ s/uicast/INTVAL/
-}
-
-Parrot_shl_i_ic_ic {
-    Parrot_binop_i_ic_ic s/<op>/<</ s/uicast/INTVAL/
-}
-
-Parrot_shr_i_ic_ic {
-    Parrot_binop_i_ic_ic s/<op>/>>/ s/uicast/INTVAL/
-}
-
-Parrot_lsr_i_ic_ic {
-    Parrot_binop_i_ic_ic s/<op>/>>/ s/uicast/UINTVAL/
-}
-
-TEMPLATE Parrot_binop_n_nc_nc {
-    if (MAP[1]) {
-        jit_emit_mov_ri_n(interp, NATIVECODE, MAP[1], &NUM_CONST[2]);
-        jit_emit_<op>_ri_n(interp, NATIVECODE, MAP[1], &NUM_CONST[3]);
-    }
-    else {
-        jit_emit_mov_ri_n(interp, NATIVECODE, FSR1, &NUM_CONST[2]);
-        jit_emit_<op>_ri_n(interp, NATIVECODE, FSR1, &NUM_CONST[3]);
-        jit_emit_mov_MR_n(interp, NATIVECODE, ROFFS_NUM(1), FSR1)
-    }
-}
-
-Parrot_add_n_nc_nc {
-    Parrot_binop_n_nc_nc s/<op>/add/
-}
-
-Parrot_sub_n_nc_nc {
-    Parrot_binop_n_nc_nc s/<op>/sub/
-}
-
-Parrot_mul_n_nc_nc {
-    Parrot_binop_n_nc_nc s/<op>/mul/
-}
-
-Parrot_cmod_n_nc_nc {
-    Parrot_binop_n_nc_nc s/<op>/cmod/
-}
-
-TEMPLATE Parrot_binop_x_x_xc {
-    if (MAP[1] && MAP[2]) {
-        if (*CUR_OPCODE == PARROT_OP_add_i_i_ic) {
-            emitm_lea_m_r(interp, NATIVECODE, MAP(1), MAP(2), 0, 1, CUR_OPCODE[3]);
-        }
-        else if (*CUR_OPCODE == PARROT_OP_sub_i_i_ic) {
-            emitm_lea_m_r(interp, NATIVECODE, MAP(1), MAP(2), 0, 1, -CUR_OPCODE[3]);
-        }
-        else {
-            jit_emit_mov_rr<_N>(NATIVECODE, MAP[1], MAP[2]);
-            jit_emit_<op>_ri<_N>(interp, NATIVECODE, MAP[1], <typ>_CONST[3]);
-        }
-    }
-    else if (MAP[1]) {
-        jit_emit_mov_RM<_N>(interp, NATIVECODE, MAP[1], ROFFS_INT(2));
-        jit_emit_<op>_ri<_N>(interp, NATIVECODE, MAP[1], <typ>_CONST[3]);
-    }
-    else {
-        if (MAP[2]) {
-            jit_emit_mov_rr<_N>(NATIVECODE, ISR1, MAP[2]);
-        }
-        else {
-            jit_emit_mov_RM<_N>(interp, NATIVECODE, ISR1, ROFFS_INT(2));
-        }
-        jit_emit_<op>_ri<_N>(interp, NATIVECODE, ISR1, <typ>_CONST[3]);
-        jit_emit_mov_MR<_N>(interp, NATIVECODE, ROFFS_INT(1), ISR1)
-    }
-}
-
-TEMPLATE Parrot_divop_x_x_xc {
-    if (MAP[2]) {
-        jit_emit_mov_rr<_N>(NATIVECODE, ISR1, MAP[2]);
-    }
-    else {
-        jit_emit_mov_RM<_N>(interp, NATIVECODE, ISR1, ROFFS_INT(2));
-    }
-    jit_emit_<op>_ri<_N>(NATIVECODE, ISR1, <typ>_CONST[3]);
-    if (MAP[1]) {
-        jit_emit_mov_rr_i(NATIVECODE, MAP[1], ISR1);
-    }
-    else {
-        jit_emit_mov_MR_i(interp, NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-}
-
-Parrot_add_i_i_ic {
-    Parrot_binop_x_x_xc s/<_N>/_i/ s/<op>/add/ s/<typ>/*INT/
-}
-
-Parrot_add_n_n_nc {
-    Parrot_binop_x_x_xc s/<_N>/_n/ s/<op>/add/ s/INT/NUM/ s/<typ>/&NUM/ s/ISR/FSR/
-}
-
-Parrot_sub_i_i_ic {
-    Parrot_binop_x_x_xc s/<_N>/_i/ s/<op>/sub/ s/<typ>/*INT/
-}
-
-Parrot_sub_n_n_nc {
-    Parrot_binop_x_x_xc s/<_N>/_n/ s/<op>/sub/ s/INT/NUM/ s/<typ>/&NUM/ s/ISR/FSR/
-}
-
-Parrot_div_i_i_ic {
-    Parrot_divop_x_x_xc s/<_N>/_i/ s/<op>/div/ s/<typ>/*INT/
-}
-
-Parrot_mul_n_n_nc {
-    Parrot_binop_x_x_xc s/<_N>/_n/ s/<op>/mul/ s/INT/NUM/ s/<typ>/&NUM/ s/ISR/FSR/
-}
-
-Parrot_div_n_n_nc {
-    Parrot_binop_x_x_xc s/<_N>/_n/ s/<op>/div/ s/INT/NUM/ s/<typ>/&NUM/ s/ISR/FSR/
-}
-
-Parrot_cmod_i_i_ic {
-    Parrot_divop_x_x_xc s/<_N>/_i/ s/<op>/cmod/ s/<typ>/*INT/
-}
-
-Parrot_cmod_n_n_nc {
-    Parrot_binop_x_x_xc s/<_N>/_n/ s/<op>/cmod/ s/INT/NUM/ s/<typ>/&NUM/ s/ISR/FSR/
-}
-
-Parrot_bor_i_i_ic {
-    Parrot_binop_x_x_xc s/<_N>/_i/ s/<op>/bor/ s/<typ>/*INT/
-}
-
-Parrot_bxor_i_i_ic {
-    Parrot_binop_x_x_xc s/<_N>/_i/ s/<op>/bxor/ s/<typ>/*INT/
-}
-
-Parrot_band_i_i_ic {
-    Parrot_binop_x_x_xc s/<_N>/_i/ s/<op>/band/ s/<typ>/*INT/
-}
-
-Parrot_shl_i_i_ic {
-    Parrot_binop_x_x_xc s/<_N>/_i/ s/<op>/shl/ s/<typ>/*INT/
-}
-
-Parrot_shr_i_i_ic {
-    Parrot_binop_x_x_xc s/<_N>/_i/ s/<op>/shr/ s/<typ>/*INT/
-}
-
-Parrot_lsr_i_i_ic {
-    Parrot_binop_x_x_xc s/<_N>/_i/ s/<op>/lsr/ s/<typ>/*INT/
-}
-
-Parrot_rot_i_i_ic_ic {
-    Parrot_binop_x_x_xc s/<_N>/_i/ s/<op>/rol/ s/<typ>/*INT/
-}
-
-TEMPLATE Parrot_binop_x_xc_x {
-    if (MAP[1] && MAP[3]) {
-        if (*CUR_OPCODE == PARROT_OP_add_i_ic_i) {
-            emitm_lea_m_r(interp, NATIVECODE, MAP(1), MAP(3), 0, 1, CUR_OPCODE[2]);
-        }
-#ifdef emitm_f<op>
-        else if (*CUR_OPCODE == PARROT_OP_<op>_n_nc_n && *&NUM_CONST[2] == 1.0) {
-            emitm_fld1(NATIVECODE);
-            emitm_f<op>(NATIVECODE, (MAP[3]+1));
-            emitm_fstp(NATIVECODE, (MAP[1]+1));
-        }
-#endif
-        else {
-            if (MAP[1] == MAP[3]) {
-                jit_emit_mov_ri<_N>(interp, NATIVECODE, ISR1, <typ>_CONST[2]);
-                jit_emit_<op>_rr<_N>(interp, NATIVECODE, ISR1, MAP[3]);
-                jit_emit_mov_rr<_N>(NATIVECODE, MAP[1], ISR1)
-            }
-            else {
-                jit_emit_mov_ri<_N>(interp, NATIVECODE, MAP[1], <typ>_CONST[2]);
-                jit_emit_<op>_rr<_N>(interp, NATIVECODE, MAP[1], MAP[3]);
-            }
-        }
-    }
-    else if (MAP[1]) {
-        jit_emit_mov_ri<_N>(interp, NATIVECODE, MAP[1], <typ>_CONST[2]);
-        jit_emit_<op>_RM<_N>(interp, NATIVECODE, MAP[1], ROFFS_INT(3));
-    }
-    else if (MAP[3]) {
-        jit_emit_mov_ri<_N>(interp, NATIVECODE, ISR1, <typ>_CONST[2]);
-        jit_emit_<op>_rr<_N>(interp, NATIVECODE, ISR1, MAP[3]);
-        jit_emit_mov_MR<_N>(interp, NATIVECODE, ROFFS_INT(1), ISR1)
-    }
-    else {
-        jit_emit_mov_ri<_N>(interp, NATIVECODE, ISR1, <typ>_CONST[2]);
-        jit_emit_<op>_RM<_N>(interp, NATIVECODE, ISR1, ROFFS_INT(3));
-        jit_emit_mov_MR<_N>(interp, NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-}
-
-Parrot_add_i_ic_i {
-    Parrot_binop_x_xc_x s/<_N>/_i/ s/<op>/add/ s/<typ>/*INT/
-}
-
-Parrot_add_n_nc_n {
-    Parrot_binop_x_xc_x s/<_N>/_n/ s/<op>/add/ s/INT/NUM/ s/<typ>/&NUM/ s/ISR/FSR/
-}
-
-Parrot_sub_i_ic_i {
-    Parrot_binop_x_xc_x s/<_N>/_i/ s/<op>/sub/ s/<typ>/*INT/
-}
-
-Parrot_sub_n_nc_n {
-    Parrot_binop_x_xc_x s/<_N>/_n/ s/<op>/sub/ s/INT/NUM/ s/<typ>/&NUM/ s/ISR/FSR/
-}
-
-Parrot_mul_n_nc_n {
-    Parrot_binop_x_xc_x s/<_N>/_n/ s/<op>/mul/ s/INT/NUM/ s/<typ>/&NUM/ s/ISR/FSR/
-}
-
-Parrot_div_i_ic_i {
-    Parrot_binop_x_xc_x s/<_N>/_i/ s/<op>/div/ s/<typ>/*INT/
-}
-
-Parrot_div_n_nc_n {
-    Parrot_binop_x_xc_x s/<_N>/_n/ s/<op>/div/ s/INT/NUM/ s/<typ>/&NUM/ s/ISR/FSR/
-}
-
-Parrot_cmod_i_ic_i {
-    Parrot_binop_x_xc_x s/<_N>/_i/ s/<op>/cmod/ s/<typ>/*INT/
-}
-
-Parrot_cmod_n_nc_n {
-    Parrot_binop_x_xc_x s/<_N>/_n/ s/<op>/cmod/ s/INT/NUM/ s/<typ>/&NUM/ s/ISR/FSR/
-}
-
-Parrot_bor_i_ic_i {
-    Parrot_binop_x_xc_x s/<_N>/_i/ s/<op>/bor/ s/<typ>/*INT/
-}
-
-Parrot_bxor_i_ic_i {
-    Parrot_binop_x_xc_x s/<_N>/_i/ s/<op>/bxor/ s/<typ>/*INT/
-}
-
-Parrot_band_i_ic_i {
-    Parrot_binop_x_xc_x s/<_N>/_i/ s/<op>/band/ s/<typ>/*INT/
-}
-
-Parrot_shl_i_ic_i {
-    Parrot_binop_x_xc_x s/<_N>/_i/ s/<op>/shl/ s/<typ>/*INT/
-}
-
-Parrot_shr_i_ic_i {
-    Parrot_binop_x_xc_x s/<_N>/_i/ s/<op>/shr/ s/<typ>/*INT/
-}
-
-Parrot_lsr_i_ic_i {
-    Parrot_binop_x_xc_x s/<_N>/_i/ s/<op>/lsr/ s/<typ>/*INT/
-}
-
-
-
-TEMPLATE Parrot_binop_x_x_x {
-    if (MAP[1] && MAP[2] && MAP[3]) {
-        if (MAP[1] == MAP[3]) {
-            jit_emit_mov_rr<_N>(NATIVECODE, ISR1, MAP[2]);
-            jit_emit_<op>_rr<_N>(interp, NATIVECODE, ISR1, MAP[3]);
-            jit_emit_mov_rr<_N>(NATIVECODE, MAP[1], ISR1);
-        }
-        else {
-            jit_emit_mov_rr<_N>(NATIVECODE, MAP[1], MAP[2]);
-            jit_emit_<op>_rr<_N>(interp, NATIVECODE, MAP[1], MAP[3]);
-        }
-    }
-    else if (MAP[1] && MAP[2]) {
-        jit_emit_mov_rr<_N>(NATIVECODE, MAP[1], MAP[2]);
-        jit_emit_<op>_RM<_N>(interp, NATIVECODE, MAP[1], ROFFS_INT(3));
-    }
-    else if (MAP[1] && MAP[3]) {
-        if (MAP[1] == MAP[3]) {
-            jit_emit_mov_RM<_N>(interp, NATIVECODE, ISR1, ROFFS_INT(2));
-            jit_emit_<op>_rr<_N>(interp, NATIVECODE, ISR1, MAP[3]);
-            jit_emit_mov_rr<_N>(NATIVECODE, MAP[1], ISR1);
-        }
-        else {
-            jit_emit_mov_RM<_N>(interp, NATIVECODE, MAP[1], ROFFS_INT(2));
-            jit_emit_<op>_rr<_N>(interp, NATIVECODE, MAP[1], MAP[3]);
-        }
-    }
-    else if (MAP[2] && MAP[3]) {
-        jit_emit_mov_rr<_N>(NATIVECODE, ISR1, MAP[2]);
-        jit_emit_<op>_rr<_N>(interp, NATIVECODE, ISR1, MAP[3]);
-        jit_emit_mov_MR<_N>(interp, NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-    else if (MAP[1]) {
-        jit_emit_mov_RM<_N>(interp, NATIVECODE, MAP[1], ROFFS_INT(2));
-        jit_emit_<op>_RM<_N>(interp, NATIVECODE, MAP[1], ROFFS_INT(3));
-    }
-    else if (MAP[2]) {
-        jit_emit_mov_rr<_N>(NATIVECODE, ISR1, MAP[2]);
-        jit_emit_<op>_RM<_N>(interp, NATIVECODE, ISR1, ROFFS_INT(3));
-        jit_emit_mov_MR<_N>(interp, NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-    else if (MAP[3]) {
-        jit_emit_mov_RM<_N>(interp, NATIVECODE, ISR1, ROFFS_INT(2));
-        jit_emit_<op>_rr<_N>(interp, NATIVECODE, ISR1, MAP[3]);
-        jit_emit_mov_MR<_N>(interp, NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-    else {
-        jit_emit_mov_RM<_N>(interp, NATIVECODE, ISR1, ROFFS_INT(2));
-        jit_emit_<op>_RM<_N>(interp, NATIVECODE, ISR1, ROFFS_INT(3));
-        jit_emit_mov_MR<_N>(interp, NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-}
-
-TEMPLATE Parrot_divop_x_x_x {
-    if (MAP[2]) {
-        jit_emit_mov_rr<_N>(NATIVECODE, ISR1, MAP[2]);
-    }
-    else {
-        jit_emit_mov_RM<_N>(interp, NATIVECODE, ISR1, ROFFS_INT(2));
-    }
-    if (MAP[3]) {
-        jit_emit_<op>_rr<_N>(interp, NATIVECODE, ISR1, MAP[3]);
-    }
-    else {
-        jit_emit_<op>_RM<_N>(interp, NATIVECODE, ISR1, ROFFS_INT(3));
-    }
-    if (MAP[1]) {
-        jit_emit_mov_rr<_N>(NATIVECODE, MAP[1], ISR1);
-    }
-    else {
-        jit_emit_mov_MR<_N>(interp, NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-}
-
-Parrot_mul_i_i_i {
-        Parrot_binop_x_x_x s/<op>/mul/ s/<_N>/_i/
-}
-
-Parrot_add_i_i_i {
-        Parrot_binop_x_x_x s/<op>/add/ s/<_N>/_i/
-}
-
-Parrot_sub_i_i_i {
-        Parrot_binop_x_x_x s/<op>/sub/ s/<_N>/_i/
-}
-
-Parrot_div_i_i_i {
-        Parrot_divop_x_x_x s/<op>/div/ s/<_N>/_i/
-}
-
-Parrot_bor_i_i_i {
-        Parrot_binop_x_x_x s/<op>/bor/ s/<_N>/_i/
-}
-
-Parrot_bxor_i_i_i {
-        Parrot_binop_x_x_x s/<op>/bxor/ s/<_N>/_i/
-}
-
-Parrot_band_i_i_i {
-        Parrot_binop_x_x_x s/<op>/band/ s/<_N>/_i/
-}
-
-Parrot_shl_i_i_i {
-        Parrot_binop_x_x_x s/<op>/shl/ s/<_N>/_i/
-}
-
-Parrot_shr_i_i_i {
-        Parrot_binop_x_x_x s/<op>/shr/ s/<_N>/_i/
-}
-
-Parrot_lsr_i_i_i {
-        Parrot_binop_x_x_x s/<op>/lsr/ s/<_N>/_i/
-}
-
-Parrot_cmod_i_i_i {
-        Parrot_divop_x_x_x s/<op>/cmod/ s/<_N>/_i/
-}
-
-Parrot_sub_n_n_n {
-        Parrot_binop_x_x_x s/<op>/sub/ s/<_N>/_n/ s/ISR/FSR/ s/INT/NUM/
-}
-
-Parrot_add_n_n_n {
-        Parrot_binop_x_x_x s/<op>/add/ s/<_N>/_n/ s/ISR/FSR/ s/INT/NUM/
-}
-
-Parrot_mul_n_n_n {
-        Parrot_binop_x_x_x s/<op>/mul/ s/<_N>/_n/ s/ISR/FSR/ s/INT/NUM/
-}
-
-Parrot_div_n_n_n {
-        Parrot_binop_x_x_x s/<op>/div/ s/<_N>/_n/ s/ISR/FSR/ s/INT/NUM/
-}
-
-Parrot_cmod_n_n_n {
-        Parrot_binop_x_x_x s/<op>/cmod/ s/<_N>/_n/ s/ISR/FSR/ s/INT/NUM/
-}
-
-TEMPLATE unary_x {
-    if (MAP[1]) {
-        jit_emit_<op>_r<_N>(NATIVECODE, MAP[1]);
-    }
-    else {
-#ifdef jit_emit_<op>_M<_N>
-        jit_emit_<op>_M<_N>(interp, NATIVECODE, ROFFS_INT(1));
-#else
-        jit_emit_mov_RM<_N>(interp, NATIVECODE, ISR1, ROFFS_INT(1));
-        jit_emit_<op>_r<_N>(NATIVECODE, ISR1);
-        jit_emit_mov_MR<_N>(interp, NATIVECODE, ROFFS_INT(1), ISR1);
-#endif
-    }
-}
-
-Parrot_neg_i {
-    unary_x s/<_N>/_i/  s/<op>/neg/
-}
-
-Parrot_neg_n {
-    unary_x s/<_N>/_n/ s/INT/NUM/  s/<op>/neg/
-}
-
-
-Parrot_bnot_i {
-    unary_x s/<_N>/_i/  s/<op>/not/
-}
-
-Parrot_abs_i {
-    unary_x s/<_N>/_i/ s/<op>/abs/
-}
-
-Parrot_abs_n {
-    unary_x s/<_N>/_n/ s/INT/NUM/  s/<op>/abs/
-}
-
-TEMPLATE unary_x_x {
-    if (MAP[1] && MAP[2]) {
-        jit_emit_mov_rr<_N>(NATIVECODE, MAP[1], MAP[2]);
-        jit_emit_<op>_r<_N>(NATIVECODE, MAP[1]);
-    }
-    else if (MAP[1]) {
-        jit_emit_mov_RM<_N>(interp, NATIVECODE, MAP[1], ROFFS_INT(2));
-        jit_emit_<op>_r<_N>(NATIVECODE, MAP[1]);
-    }
-    else if (MAP[2]) {
-        jit_emit_mov_rr<_N>(NATIVECODE, ISR1, MAP[2]);
-        jit_emit_<op>_r<_N>(NATIVECODE, ISR1);
-        jit_emit_mov_MR<_N>(interp, NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-    else {
-        jit_emit_mov_RM<_N>(interp, NATIVECODE, ISR1, ROFFS_INT(2));
-        jit_emit_<op>_r<_N>(NATIVECODE, ISR1);
-        jit_emit_mov_MR<_N>(interp, NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-}
-
-Parrot_bnot_i_i {
-    unary_x_x s/<_N>/_i/ s/<op>/not/
-}
-
-Parrot_neg_i_i {
-    unary_x_x s/<_N>/_i/ s/<op>/neg/
-}
-
-Parrot_abs_i_i {
-    unary_x_x s/<_N>/_i/ s/<op>/abs/
-}
-Parrot_neg_n_n {
-    unary_x_x s/<_N>/_n/ s/ISR/FSR/ s/INT/NUM/ s/<op>/neg/
-}
-
-Parrot_abs_n_n {
-    unary_x_x s/<_N>/_n/ s/ISR/FSR/ s/INT/NUM/ s/<op>/abs/
-}
-
-Parrot_sin_n_n {
-    unary_x_x s/<_N>/_n/ s/ISR/FSR/ s/INT/NUM/ s/<op>/sin/
-}
-
-Parrot_cos_n_n {
-    unary_x_x s/<_N>/_n/ s/ISR/FSR/ s/INT/NUM/ s/<op>/cos/
-}
-
-Parrot_sqrt_n_n {
-    unary_x_x s/<_N>/_n/ s/ISR/FSR/ s/INT/NUM/ s/<op>/sqrt/
-}
-
-
-TEMPLATE Parrot_ifunless_x_ic {
-    if ( P_ARITH && jit_info->prev_op[1] == jit_info->cur_op[1]) {
-        jit_emit_jcc(jit_info, <jnz>, *INT_CONST[2]);
-    }
-    else if (MAP[1]) {
-        jit_emit_test_r<_N>(NATIVECODE, MAP[1]);
-        jit_emit_jcc(jit_info, <jne>, *INT_CONST[2]);
-    }
-    else {
-        jit_emit_mov_RM<_N>(interp, NATIVECODE, ISR1, ROFFS_<t>(1));
-        jit_emit_test_r<_N>(NATIVECODE, ISR1);
-        jit_emit_jcc(jit_info, <jne>, *INT_CONST[2]);
-    }
-}
-
-Parrot_if_i_ic {
-    Parrot_ifunless_x_ic s/<jnz>/emitm_jnz/ s/<jne>/emitm_jne/ s/<_N>/_i/ s/<t>/INT/
-}
-
-Parrot_unless_i_ic {
-    Parrot_ifunless_x_ic s/<jnz>/emitm_jz/ s/<jne>/emitm_je/ s/<_N>/_i/ s/<t>/INT/
-}
-
-Parrot_if_n_ic {
-    Parrot_ifunless_x_ic s/<jnz>/emitm_jnz/ s/<jne>/emitm_jnz/ s/<_N>/_n/ s/<t>/NUM/ s/ISR/FSR/ s/P_ARITH/0/
-}
-
-Parrot_unless_n_ic {
-    Parrot_ifunless_x_ic s/<jnz>/emitm_jz/ s/<jne>/emitm_jz/ s/<_N>/_n/ s/<t>/NUM/ s/ISR/FSR/ s/P_ARITH/0/
-}
-
-TEMPLATE Parrot_cmp_x_xc_ic {
-    if (MAP[1]) {
-        jit_emit_cmp_ri<_N>(interp, NATIVECODE, MAP[1], <c>_CONST[2]);
-    }
-    else {
-        jit_emit_mov_RM<_N>(interp, NATIVECODE, ISR1, ROFFS_<t>(1));
-        jit_emit_cmp_ri<_N>(interp, NATIVECODE, ISR1, <c>_CONST[2]);
-    }
-    jit_emit_jcc(jit_info, <je>, *INT_CONST[3]);
-}
-
-Parrot_eq_i_ic_ic {
-    Parrot_cmp_x_xc_ic s/<_N>/_i/ s/<je>/emitm_je/ s/<c>/*INT/ s/<t>/INT/
-}
-
-Parrot_eq_n_nc_ic {
-    Parrot_cmp_x_xc_ic s/<_N>/_n/ s/<je>/emitm_je/ s/<t>/NUM/ s/<c>/&NUM/ s/ISR/FSR/
-}
-
-Parrot_ne_i_ic_ic {
-    Parrot_cmp_x_xc_ic s/<_N>/_i/ s/<je>/emitm_jne/ s/<c>/*INT/ s/<t>/INT/
-}
-
-Parrot_ne_n_nc_ic {
-    Parrot_cmp_x_xc_ic s/<_N>/_n/ s/<je>/emitm_jne/ s/<t>/NUM/ s/<c>/&NUM/ s/ISR/FSR/
-}
-
-Parrot_lt_i_ic_ic {
-    Parrot_cmp_x_xc_ic s/<_N>/_i/ s/<je>/emitm_jl/ s/<c>/*INT/ s/<t>/INT/
-}
-
-Parrot_lt_n_nc_ic {
-    Parrot_cmp_x_xc_ic s/<_N>/_n/ s/<je>/emitm_jb/ s/<t>/NUM/ s/<c>/&NUM/ s/ISR/FSR/
-}
-
-Parrot_le_i_ic_ic {
-    Parrot_cmp_x_xc_ic s/<_N>/_i/ s/<je>/emitm_jle/ s/<c>/*INT/ s/<t>/INT/
-}
-
-Parrot_le_n_nc_ic {
-    Parrot_cmp_x_xc_ic s/<_N>/_n/ s/<je>/emitm_jbe/ s/<c>/&NUM/ s/ISR/FSR/ s/<t>/NUM/
-}
-
-TEMPLATE Parrot_cmp_xc_x_ic {
-    jit_emit_mov_ri<_N>(interp, NATIVECODE, ISR1,<c>_CONST[1]);
-    if (MAP[2]) {
-        jit_emit_cmp_rr<_N>(NATIVECODE, ISR1, MAP[2]);
-    }
-    else {
-        jit_emit_cmp_RM<_N>(interp, NATIVECODE, ISR1, ROFFS_<t>(2));
-    }
-    jit_emit_jcc(jit_info, <je>, *INT_CONST[3]);
-}
-
-Parrot_eq_ic_i_ic {
-    Parrot_cmp_xc_x_ic s/<_N>/_i/ s/<je>/emitm_je/ s/<c>/*INT/ s/<t>/INT/
-}
-
-Parrot_eq_nc_n_ic {
-    Parrot_cmp_xc_x_ic s/<_N>/_n/ s/<je>/emitm_je/ s/<c>/&NUM/ s/ISR/FSR/ s/<t>/NUM/
-}
-
-Parrot_ne_ic_i_ic {
-    Parrot_cmp_xc_x_ic s/<_N>/_i/ s/<je>/emitm_jne/ s/<c>/*INT/ s/<t>/INT/
-}
-
-Parrot_ne_nc_n_ic {
-    Parrot_cmp_xc_x_ic s/<_N>/_n/ s/<je>/emitm_jne/ s/<c>/&NUM/ s/ISR/FSR/ s/<t>/NUM/
-}
-
-Parrot_lt_ic_i_ic {
-    Parrot_cmp_xc_x_ic s/<_N>/_i/ s/<je>/emitm_jl/ s/<c>/*INT/ s/<t>/INT/
-}
-
-Parrot_lt_nc_n_ic {
-    Parrot_cmp_xc_x_ic s/<_N>/_n/ s/<je>/emitm_jb/ s/<c>/&NUM/ s/ISR/FSR/ s/<t>/NUM/
-}
-
-Parrot_le_ic_i_ic {
-    Parrot_cmp_xc_x_ic s/<_N>/_i/ s/<je>/emitm_jle/ s/<c>/*INT/ s/<t>/INT/
-}
-
-Parrot_le_nc_n_ic {
-    Parrot_cmp_xc_x_ic s/<_N>/_n/ s/<je>/emitm_jbe/ s/<c>/&NUM/ s/ISR/FSR/ s/<t>/NUM/
-}
-
-TEMPLATE Parrot_cmp_x_x_ic {
-    if (MAP[1] && MAP[2]) {
-        jit_emit_cmp_rr<_N>(NATIVECODE, MAP[1], MAP[2]);
-    }
-    else if (MAP[1]) {
-        jit_emit_cmp_RM<_N>(interp, NATIVECODE, MAP[1], ROFFS_<typ>(2));
-    }
-    else if (MAP[2]) {
-        jit_emit_cmp_MR<_N>(interp, NATIVECODE, ROFFS_<typ>(1), MAP[2]);
-    }
-    else {
-        jit_emit_mov_RM<_N>(interp, NATIVECODE, ISR1, ROFFS_<typ>(1));
-        jit_emit_cmp_RM<_N>(interp, NATIVECODE, ISR1, ROFFS_<typ>(2));
-    }
-    jit_emit_jcc(jit_info, <je>, *INT_CONST[3]);
-}
-
-Parrot_eq_i_i_ic {
-    Parrot_cmp_x_x_ic s/<_N>/_i/ s/<je>/emitm_je/ s/<typ>/INT/
-}
-
-Parrot_eq_n_n_ic {
-    Parrot_cmp_x_x_ic s/<_N>/_n/ s/<je>/emitm_je/ s/<typ>/NUM/ s/ISR/FSR/
-}
-
-Parrot_ne_i_i_ic {
-    Parrot_cmp_x_x_ic s/<_N>/_i/ s/<je>/emitm_jne/ s/<typ>/INT/
-}
-
-Parrot_ne_n_n_ic {
-    Parrot_cmp_x_x_ic s/<_N>/_n/ s/<je>/emitm_jne/ s/<typ>/NUM/ s/ISR/FSR/
-}
-
-Parrot_lt_i_i_ic {
-    Parrot_cmp_x_x_ic s/<_N>/_i/ s/<je>/emitm_jl/ s/<typ>/INT/
-}
-
-Parrot_lt_n_n_ic {
-    Parrot_cmp_x_x_ic s/<_N>/_n/ s/<je>/emitm_jb/ s/<typ>/NUM/ s/ISR/FSR/
-}
-
-Parrot_le_i_i_ic {
-    Parrot_cmp_x_x_ic s/<_N>/_i/ s/<je>/emitm_jle/ s/<typ>/INT/
-}
-
-Parrot_le_n_n_ic {
-    Parrot_cmp_x_x_ic s/<_N>/_n/ s/<je>/emitm_jbe/ s/<typ>/NUM/ s/ISR/FSR/
-}
-
-Parrot_branch_ic {
-    emit_jump(jit_info, *INT_CONST[1]);
-}
-
-TEMPLATE Parrot_incdec_x {
-    if (MAP[1]) {
-        jit_emit_<op>_r<_N>(NATIVECODE, MAP[1]);
-    }
-    else {
-        jit_emit_mov_RM<_N>(interp, NATIVECODE, ISR1, ROFFS_INT(1));
-        jit_emit_<op>_r<_N>(NATIVECODE, ISR1);
-        jit_emit_mov_MR<_N>(interp, NATIVECODE, ROFFS_INT(1), ISR1)
-    }
-}
-
-Parrot_inc_i {
-    Parrot_incdec_x s/<op>/inc/ s/<_N>/_i/
-}
-
-Parrot_dec_i {
-    Parrot_incdec_x s/<op>/dec/ s/<_N>/_i/
-}
-
-Parrot_inc_n {
-    Parrot_incdec_x s/<op>/inc/ s/<_N>/_n/ s/INT/NUM/ s/ISR/FSR/
-}
-
-Parrot_dec_n {
-    Parrot_incdec_x s/<op>/dec/ s/<_N>/_n/ s/INT/NUM/ s/ISR/FSR/
-}
-
-
-; string funcs
-;
-Parrot_set_s_sc {
-    Parrot_jit_emit_get_INTERP(interp, jit_info->native_ptr, emit_ECX);
-    emitm_pushl_i(NATIVECODE, CONST(2)->u.string);
-    emitm_pushl_r(NATIVECODE, emit_ECX);
-    CALL_FUNCTION(jit_info, Parrot_str_copy);
-    emitm_addb_i_r(NATIVECODE, 8, emit_ESP);
-    jit_emit_mov_MR_i(interp, NATIVECODE, ROFFS_STR(1), emit_EAX );
-}
-
-TEMPLATE Parrot_cmp_sx_sx_ic {
-# define push_r(i) \
-    jit_emit_mov_RM_i(interp, NATIVECODE, emit_EAX, ROFFS_STR(i)); \
-    emitm_pushl_r(NATIVECODE, emit_EAX)
-# define push_c(i) emitm_pushl_i(NATIVECODE, CONST(i)->u.string)
-
-    push_<typ2>(2);
-    push_<typ1>(1);
-    Parrot_jit_emit_get_INTERP(interp, jit_info->native_ptr, emit_ECX);
-    emitm_pushl_r(NATIVECODE, emit_ECX);
-    CALL_FUNCTION(jit_info, Parrot_str_compare);
-    emitm_addb_i_r(NATIVECODE, 12, emit_ESP);
-    jit_emit_test_r_i(NATIVECODE, emit_EAX);
-    jit_emit_jcc(jit_info, <op>, *INT_CONST[3]);
-#undef push_r
-#undef push_c
-}
-
-TEMPLATE Parrot_eq_sx_sx_ic {
-# define push_r(i) \
-    jit_emit_mov_RM_i(interp, NATIVECODE, emit_EAX, ROFFS_STR(i)); \
-    emitm_pushl_r(NATIVECODE, emit_EAX)
-# define push_c(i) emitm_pushl_i(NATIVECODE, CONST(i)->u.string)
-    push_<typ2>(2);
-    push_<typ1>(1);
-    Parrot_jit_emit_get_INTERP(interp, jit_info->native_ptr, emit_ECX);
-    emitm_pushl_r(NATIVECODE, emit_ECX);
-    CALL_FUNCTION(jit_info, Parrot_str_not_equal);
-    emitm_addb_i_r(NATIVECODE, 12, emit_ESP);
-    jit_emit_test_r_i(NATIVECODE, emit_EAX);
-    jit_emit_jcc(jit_info, <op>, *INT_CONST[3]);
-#undef push_r
-#undef push_c
-}
-
-Parrot_eq_s_s_ic {
-    Parrot_eq_sx_sx_ic s/<typ1>/r/ s/<typ2>/r/ s/<op>/emitm_jz/
-}
-
-Parrot_eq_s_sc_ic {
-    Parrot_eq_sx_sx_ic s/<typ1>/r/ s/<typ2>/c/ s/<op>/emitm_jz/
-}
-
-Parrot_eq_sc_s_ic {
-    Parrot_eq_sx_sx_ic s/<typ1>/c/ s/<typ2>/r/ s/<op>/emitm_jz/
-}
-
-Parrot_ne_s_s_ic {
-    Parrot_eq_sx_sx_ic s/<typ1>/r/ s/<typ2>/r/ s/<op>/emitm_jnz/
-}
-
-Parrot_ne_s_sc_ic {
-    Parrot_eq_sx_sx_ic s/<typ1>/r/ s/<typ2>/c/ s/<op>/emitm_jnz/
-}
-
-Parrot_ne_sc_s_ic {
-    Parrot_eq_sx_sx_ic s/<typ1>/c/ s/<typ2>/r/ s/<op>/emitm_jnz/
-}
-
-Parrot_le_s_s_ic {
-    Parrot_cmp_sx_sx_ic s/<typ1>/r/ s/<typ2>/r/ s/<op>/emitm_jle/
-}
-
-Parrot_le_s_sc_ic {
-    Parrot_cmp_sx_sx_ic s/<typ1>/r/ s/<typ2>/c/ s/<op>/emitm_jle/
-}
-
-Parrot_le_sc_s_ic {
-    Parrot_cmp_sx_sx_ic s/<typ1>/c/ s/<typ2>/r/ s/<op>/emitm_jle/
-}
-
-Parrot_lt_s_s_ic {
-    Parrot_cmp_sx_sx_ic s/<typ1>/r/ s/<typ2>/r/ s/<op>/emitm_jl/
-}
-
-Parrot_lt_s_sc_ic {
-    Parrot_cmp_sx_sx_ic s/<typ1>/r/ s/<typ2>/c/ s/<op>/emitm_jl/
-}
-
-Parrot_lt_sc_s_ic {
-    Parrot_cmp_sx_sx_ic s/<typ1>/c/ s/<typ2>/r/ s/<op>/emitm_jl/
-}
-
-
-TEMPLATE Parrot_ifunless_sx_ic {
-# define push_r(i) \
-    jit_emit_mov_RM_i(interp, NATIVECODE, emit_EAX, ROFFS_STR(i)); \
-    emitm_pushl_r(NATIVECODE, emit_EAX)
-# define push_c(i) emitm_pushl_i(NATIVECODE, CONST(i)->u.string)
-
-    push_<typ>(1);
-    Parrot_jit_emit_get_INTERP(interp, jit_info->native_ptr, emit_ECX);
-    emitm_pushl_r(NATIVECODE, emit_ECX);
-    CALL_FUNCTION(jit_info, Parrot_str_boolean);
-    emitm_addb_i_r(NATIVECODE, 8, emit_ESP);
-    jit_emit_test_r_i(NATIVECODE, emit_EAX);
-    jit_emit_jcc(jit_info, <op>, *INT_CONST[2]);
-
-#undef push_r
-#undef push_c
-}
-
-
-Parrot_if_s_ic {
-    Parrot_ifunless_sx_ic s/<typ>/r/ s/<op>/emitm_jnz/
-}
-
-Parrot_unless_s_ic {
-    Parrot_ifunless_sx_ic s/<typ>/r/ s/<op>/emitm_jz/
-}
-
-TEMPLATE Parrot_ord_i_sx {
-# define push_r(i) \
-    jit_emit_mov_RM_i(interp, NATIVECODE, emit_EAX, ROFFS_STR(i)); \
-        emitm_pushl_r(NATIVECODE, emit_EAX)
-# define push_c(i) emitm_pushl_i(NATIVECODE, CONST(i)->u.string)
-
-    emitm_pushl_i(NATIVECODE, 0);
-    push_<typ>(2);
-    Parrot_jit_emit_get_INTERP(interp, jit_info->native_ptr, emit_ECX);
-    emitm_pushl_r(NATIVECODE, emit_ECX);
-    CALL_FUNCTION(jit_info, string_ord);
-    emitm_addb_i_r(NATIVECODE, 12, emit_ESP);
-    if (MAP[1]) {
-        jit_emit_mov_rr_i(NATIVECODE, MAP[1], ISR1);
-    }
-    else {
-        jit_emit_mov_MR_i(interp, NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-#undef push_r
-#undef push_c
-}
-
-Parrot_ord_i_s {
-    Parrot_ord_i_sx s/<typ>/r/
-}
-
-Parrot_ord_i_sc {
-    Parrot_ord_i_sx s/<typ>/c/
-}
-
-TEMPLATE Parrot_ord_i_sx_i {
-# define push_r(i) \
-    jit_emit_mov_RM_i(interp, NATIVECODE, emit_EAX, ROFFS_STR(i)); \
-        emitm_pushl_r(NATIVECODE, emit_EAX)
-# define push_c(i) emitm_pushl_i(NATIVECODE, CONST(i)->u.string)
-
-    if (MAP[3]) {
-        emitm_pushl_r(NATIVECODE, MAP[3]);
-    }
-    else {
-        jit_emit_mov_RM_i(interp, NATIVECODE, ISR1, ROFFS_INT(3));
-        emitm_pushl_r(NATIVECODE, ISR1);
-    }
-    push_<typ>(2);
-    Parrot_jit_emit_get_INTERP(interp, jit_info->native_ptr, emit_EAX);
-    emitm_pushl_r(NATIVECODE, emit_EAX);
-    CALL_FUNCTION(jit_info, string_ord);
-    emitm_addb_i_r(NATIVECODE, 12, emit_ESP);
-    if (MAP[1]) {
-        jit_emit_mov_rr_i(NATIVECODE, MAP[1], ISR1);
-    }
-    else {
-        jit_emit_mov_MR_i(interp, NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-#undef push_r
-#undef push_c
-}
-
-Parrot_ord_i_s_i {
-    char *L1, *L2, *L3, *L4, *L5, *Lpos, *L3a;
-    /*
-     * this opcode has a CALL_FUNCTION, so ext_call = -1
-     * in src/jit.cpu.c for such ext_call types volatile
-     * registers are stored back to Parrot registers: ecx, edx are usable
-     */
-
-    /*
-     * movl $2, %ecx         # %ecx := string
-     * movl $3, %edx         # %edx := offset
-     * movl %ecx, %eax       # %eax := Parrot_str_byte_length
-     * cmpl #0, %ecx
-     * je  L1
-     */
-    jit_emit_mov_RM_i(interp, NATIVECODE, emit_ECX, ROFFS_STR(2));
-    if (MAP[3]) {
-        jit_emit_mov_rr_i(NATIVECODE, emit_EDX, MAP(3));
-    }
-    else {
-        jit_emit_mov_RM_i(interp, NATIVECODE, emit_EDX, ROFFS_INT(3));
-    }
-    jit_emit_mov_rr_i(NATIVECODE, emit_EAX, emit_ECX);
-    jit_emit_cmp_ri_i(interp, NATIVECODE, emit_ECX, 0);
-    L1 = NATIVECODE;
-    emitm_jxs(NATIVECODE, emitm_jz, 0);
-    /*
-     * mov (strlen)%ecx, %eax
-     */
-    emitm_movl_m_r(interp, NATIVECODE, emit_EAX, emit_ECX, emit_None, 1,
-            offsetof(STRING, strlen));
-    /* L1: */
-    L1[1] = (char)(NATIVECODE - L1 - 2);
-    /*
-     * cmpl #0, %eax
-     * je  L2
-     */
-    jit_emit_cmp_ri_i(interp, NATIVECODE, emit_EAX, 0);
-    L2 = NATIVECODE;
-    emitm_jxs(NATIVECODE, emitm_jz, 0);
-    /*
-     * cmp $edx, 0
-     * jge Lpos
-     * add %eax, %edx
-     * js  L3a
-     * Lpos:
-     * cmp %edx, %eax
-     * jge L3
-     */
-    jit_emit_cmp_ri_i(interp, NATIVECODE, emit_EDX, 0);
-    Lpos = NATIVECODE;
-    emitm_jxs(NATIVECODE, emitm_jnl, 0);
-    jit_emit_add_rr_i(interp, NATIVECODE, emit_EDX, emit_EAX);
-    L3a = NATIVECODE;
-    emitm_jxs(NATIVECODE, emitm_js, 0);
-    /* LPos: */
-    Lpos[1] = (char)(NATIVECODE - Lpos - 2);
-
-    jit_emit_cmp_rr_i(NATIVECODE, emit_EDX, emit_EAX);
-    L3 = NATIVECODE;
-    emitm_jxs(NATIVECODE, emitm_jnl, 0);
-
-    /*
-     * mov (encoding)%ecx, %eax
-     * cmp fixed8, %ecx
-     * jne L4
-     */
-    emitm_movl_m_r(interp, NATIVECODE, emit_EAX, emit_ECX, emit_None, 1,
-            offsetof(STRING, encoding));
-    jit_emit_cmp_ri_i(interp, NATIVECODE, emit_EAX, Parrot_fixed_8_encoding_ptr);
-    L4 = NATIVECODE;
-    emitm_jxs(NATIVECODE, emitm_jnz, 0);
-    /*
-     * mov (strstart)%ecx, %ecx
-     * xor %eax, %eax
-     * movb (%ecx + %edx), %eax)
-     */
-    emitm_movl_m_r(interp, NATIVECODE, emit_ECX, emit_ECX, emit_None, 1,
-            offsetof(STRING, strstart));
-    jit_emit_bxor_rr_i(interp, NATIVECODE, emit_EAX, emit_EAX);
-    emitm_movb_m_r(interp, NATIVECODE, emit_EAX, emit_ECX, emit_EDX, 1, 0);
-    /*
-     * branch L5
-     */
-    L5 = NATIVECODE;
-    emitm_jumps(NATIVECODE, 0);
-
-    L3a[1] = (char)(NATIVECODE - L3a - 2);
-    /*
-     * L3a:
-     */
-    jit_emit_sub_rr_i(interp, NATIVECODE, emit_EDX, emit_EAX);
-
-    /*
-     * L2:
-     * L3:
-     * L4:
-     */
-    L2[1] = (char)(NATIVECODE - L2 - 2);
-    L3[1] = (char)(NATIVECODE - L3 - 2);
-    L4[1] = (char)(NATIVECODE - L4 - 2);
-    emitm_pushl_r(NATIVECODE, emit_EDX);        /* offs */
-    emitm_pushl_r(NATIVECODE, emit_ECX);        /* string */
-    Parrot_jit_emit_get_INTERP(interp, jit_info->native_ptr, emit_EAX);
-    emitm_pushl_r(NATIVECODE, emit_EAX);        /* interp */
-    CALL_FUNCTION(jit_info, string_ord);
-    emitm_addb_i_r(NATIVECODE, 12, emit_ESP);   /* result in eax */
-    /*
-     * L5:
-     */
-    L5[1] = (char)(NATIVECODE - L5 - 2);
-    if (MAP[1] && MAP[1] != emit_ECX && MAP[1] != emit_EDX) {
-        jit_emit_mov_rr_i(NATIVECODE, MAP[1], emit_EAX);
-    }
-    else {
-        jit_emit_mov_MR_i(interp, NATIVECODE, ROFFS_INT(1), emit_EAX);
-    }
-
-}
-
-Parrot_ord_i_sc_i {
-    Parrot_ord_i_sx_i s/<typ>/c/
-}
-
-; the following 4 ops don't branch but are translated as cpfp
-; which adds unneeded overhead - convert to normal ops
-; or just JIT the 2 easy ones
-Parrot_set_args_pc {
-    if (jit_info->code_type == JIT_CODE_FILE) {
-        Parrot_jit_emit_get_INTERP(interp, jit_info->native_ptr, emit_EAX);
-        emitm_movl_i_m(NATIVECODE, jit_info->cur_op, emit_EAX, emit_None, 1,
-                offsetof(Interp, current_args));
-    }
-    else  {
-        jit_set_args_pc(jit_info, interp,
-            jit_info->flags & JIT_CODE_RECURSIVE);
-    }
-}
-
-extern Parrot_set_returns_pc {
-    if (jit_info->code_type == JIT_CODE_FILE)
-        Parrot_jit_normal_op(jit_info, interp);
-    else  {
-        jit_set_returns_pc(jit_info, interp,
-            jit_info->flags & JIT_CODE_RECURSIVE);
-    }
-}
-
-extern Parrot_returncc {
-    if (jit_info->code_type == JIT_CODE_FILE)
-        Parrot_jit_restart_op(jit_info, interp);
-    else {
-        /* restore pushed regs if any */
-        if (!(jit_info->flags & JIT_CODE_RECURSIVE)) {
-            jit_restore_regs(jit_info, interp);
-            /* no branch ret 0 */
-            jit_emit_bxor_rr_i(interp, NATIVECODE, emit_EAX, emit_EAX);
-            jit_emit_stack_frame_leave(NATIVECODE);
-        }
-        emitm_ret(NATIVECODE);
-    }
-}
-
-Parrot_pic_callr___pc {
-    int offset, here, op_i;
-    PackFile_Constant ** constants;
-    PMC *sig_params, *sig_result;
-    opcode_t *params;
-    int skip;
-
-    constants = CONTEXT(interp)->constants;
-    params = jit_info->optimizer->sections->begin;
-    sig_params = constants[params[1]]->u.key;
-    op_i = 2 + VTABLE_elements(interp, sig_params);
-
-    offset = jit_info->arena.op_map[op_i].offset;
-    /* TODO preserve necessary regs */
-    assert(*CUR_OPCODE == PARROT_OP_get_results_pc);
-    constants = CONTEXT(interp)->constants;
-    sig_result = constants[CUR_OPCODE[1]]->u.key;
-    if (!VTABLE_elements(interp, sig_result))
-        skip = -1;
-    else
-        skip = MAP(2);      /* skip result - save rest */
-    /* registers are saved in set_args */
-
-    here = NATIVECODE - jit_info->arena.start;
-    emitm_calll(NATIVECODE, offset - here - 5);
-
-    jit_restore_regs_call(jit_info, interp, skip);
-}
-
-extern Parrot_get_params_pc {
-    if (jit_info->code_type == JIT_CODE_FILE)
-        Parrot_jit_normal_op(jit_info, interp);
-    else if (!(jit_info->flags & JIT_CODE_RECURSIVE)) {
-        jit_get_params_pc(jit_info, interp);
-    }
-}
-
-Parrot_get_results_pc {
-    if (jit_info->code_type == JIT_CODE_FILE) {
-        Parrot_jit_emit_get_INTERP(interp, jit_info->native_ptr, emit_EAX);
-        emitm_movl_m_r(interp, NATIVECODE, emit_EAX, emit_EAX, emit_None, 1,
-                offsetof(Interp, ctx.state));
-        emitm_movl_i_m(NATIVECODE, jit_info->cur_op, emit_EAX, emit_None, 1,
-                offsetof(Parrot_Context, current_results));
-    }
-    else {
-        PackFile_Constant ** constants;
-        PMC *sig_result;
-
-        constants = CONTEXT(interp)->constants;
-        sig_result = constants[CUR_OPCODE[1]]->u.key;
-        if (!VTABLE_elements(interp, sig_result))
-            return;
-        if (VTABLE_get_integer_keyed_int(interp, sig_result, 0) ==
-            PARROT_ARG_FLOATVAL) {
-            /* float result is in ISR1 */
-            emitm_fst(NATIVECODE, MAP(2));
-        }
-        else {
-            jit_emit_mov_rr_i(NATIVECODE, MAP(2), emit_EAX);
-        }
-    }
-}
-; TODO or,and,not,cmp
-
-TEMPLATE iscc_i_x_x {
-    if (MAP[2] && MAP[3]) {
-        jit_emit_cmp_rr<_N>(NATIVECODE, MAP[2], MAP[3]);
-    }
-    else if (MAP[2]) {
-        jit_emit_cmp_RM<_N>(interp, NATIVECODE, MAP[2], ROFFS_<typ>(3));
-    }
-    else if (MAP[3]) {
-        jit_emit_cmp_MR<_N>(interp, NATIVECODE, ROFFS_<typ>(2), MAP[3]);
-    }
-    else {
-        jit_emit_mov_RM<_N>(interp, NATIVECODE, <scr>, ROFFS_<typ>(2));
-        jit_emit_cmp_RM<_N>(interp, NATIVECODE, <scr>, ROFFS_<typ>(3));
-    }
-    jit_emit_mov_ri_i(interp, NATIVECODE, ISR1, 0);
-    jit_emit_setcc_r(NATIVECODE, <cc>, ISR1);
-    if (MAP[1]) {
-        jit_emit_mov_rr_i(NATIVECODE, MAP[1], ISR1);
-    }
-    else {
-        jit_emit_mov_MR_i(interp, NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-}
-
-Parrot_iseq_i_i_i {
-    iscc_i_x_x s/<_N>/_i/ s/<cc>/emitm_je/ s/<typ>/INT/ s/<scr>/ISR1/
-}
-
-Parrot_isne_i_i_i {
-    iscc_i_x_x s/<_N>/_i/ s/<cc>/emitm_jne/ s/<typ>/INT/ s/<scr>/ISR1/
-}
-
-Parrot_islt_i_i_i {
-    iscc_i_x_x s/<_N>/_i/ s/<cc>/emitm_jl/ s/<typ>/INT/ s/<scr>/ISR1/
-}
-
-Parrot_isle_i_i_i {
-    iscc_i_x_x s/<_N>/_i/ s/<cc>/emitm_jle/ s/<typ>/INT/ s/<scr>/ISR1/
-}
-
-Parrot_iseq_i_n_n {
-    iscc_i_x_x s/<_N>/_n/ s/<cc>/emitm_je/ s/<typ>/NUM/ s/<scr>/FSR1/
-}
-
-Parrot_isne_i_n_n {
-    iscc_i_x_x s/<_N>/_n/ s/<cc>/emitm_jne/ s/<typ>/NUM/ s/<scr>/FSR1/
-}
-
-Parrot_islt_i_n_n {
-    iscc_i_x_x s/<_N>/_n/ s/<cc>/emitm_jb/ s/<typ>/NUM/ s/<scr>/FSR1/
-}
-
-Parrot_isle_i_n_n {
-    iscc_i_x_x s/<_N>/_n/ s/<cc>/emitm_jbe/ s/<typ>/NUM/ s/<scr>/FSR1/
-}
-
-TEMPLATE iscc_i_x_xc {
-    if (MAP[2]) {
-        jit_emit_cmp_ri<_N>(interp, NATIVECODE, MAP[2], <c>_CONST[3]);
-    }
-    else {
-        jit_emit_mov_RM<_N>(interp, NATIVECODE, <scr>, ROFFS_<typ>(2));
-        jit_emit_cmp_ri<_N>(interp, NATIVECODE, <scr>, <c>_CONST[3]);
-    }
-    jit_emit_mov_ri_i(interp, NATIVECODE, ISR1, 0);
-    jit_emit_setcc_r(NATIVECODE, <cc>, ISR1);
-    if (MAP[1]) {
-        jit_emit_mov_rr_i(NATIVECODE, MAP[1], ISR1);
-    }
-    else {
-        jit_emit_mov_MR_i(interp, NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-}
-
-Parrot_iseq_i_i_ic {
-    iscc_i_x_xc s/<_N>/_i/ s/<cc>/emitm_je/ s/<typ>/INT/ s/<scr>/ISR1/ s/<c>/*INT/
-}
-
-Parrot_isne_i_i_ic {
-    iscc_i_x_xc s/<_N>/_i/ s/<cc>/emitm_jne/ s/<typ>/INT/ s/<scr>/ISR1/ s/<c>/*INT/
-}
-
-Parrot_islt_i_i_ic {
-    iscc_i_x_xc s/<_N>/_i/ s/<cc>/emitm_jl/ s/<typ>/INT/ s/<scr>/ISR1/ s/<c>/*INT/
-}
-
-Parrot_isle_i_i_ic {
-    iscc_i_x_xc s/<_N>/_i/ s/<cc>/emitm_jle/ s/<typ>/INT/ s/<scr>/ISR1/ s/<c>/*INT/
-}
-
-Parrot_iseq_i_n_nc {
-    iscc_i_x_xc s/<_N>/_n/ s/<cc>/emitm_je/ s/<typ>/NUM/ s/<scr>/FSR1/ s/<c>/&NUM/
-}
-
-Parrot_isne_i_n_nc {
-    iscc_i_x_xc s/<_N>/_n/ s/<cc>/emitm_jne/ s/<typ>/NUM/ s/<scr>/FSR1/ s/<c>/&NUM/
-}
-
-Parrot_islt_i_n_nc {
-    iscc_i_x_xc s/<_N>/_n/ s/<cc>/emitm_jb/ s/<typ>/NUM/ s/<scr>/FSR1/ s/<c>/&NUM/
-}
-
-Parrot_isle_i_n_nc {
-    iscc_i_x_xc s/<_N>/_n/ s/<cc>/emitm_jbe/ s/<typ>/NUM/ s/<scr>/FSR1/ s/<c>/&NUM/
-}
-
-TEMPLATE iscc_i_xc_x {
-    jit_emit_mov_ri<_N>(interp, NATIVECODE, <scr>, <c>_CONST[2]);
-    if (MAP[3]) {
-        jit_emit_cmp_rr<_N>(NATIVECODE, <scr>, MAP[3]);
-    }
-    else {
-        jit_emit_cmp_RM<_N>(interp, NATIVECODE, <scr>, ROFFS_<typ>(3));
-    }
-    jit_emit_mov_ri_i(interp, NATIVECODE, ISR1, 0);
-    jit_emit_setcc_r(NATIVECODE, <cc>, ISR1);
-    if (MAP[1]) {
-        jit_emit_mov_rr_i(NATIVECODE, MAP[1], ISR1);
-    }
-    else {
-        jit_emit_mov_MR_i(interp, NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-}
-
-Parrot_iseq_i_ic_i {
-    iscc_i_xc_x s/<_N>/_i/ s/<cc>/emitm_je/ s/<typ>/INT/ s/<scr>/ISR1/ s/<c>/*INT/
-}
-
-Parrot_isne_i_ic_i {
-    iscc_i_xc_x s/<_N>/_i/ s/<cc>/emitm_jne/ s/<typ>/INT/ s/<scr>/ISR1/ s/<c>/*INT/
-}
-
-Parrot_islt_i_ic_i {
-    iscc_i_xc_x s/<_N>/_i/ s/<cc>/emitm_jl/ s/<typ>/INT/ s/<scr>/ISR1/ s/<c>/*INT/
-}
-
-Parrot_isle_i_ic_i {
-    iscc_i_xc_x s/<_N>/_i/ s/<cc>/emitm_jle/ s/<typ>/INT/ s/<scr>/ISR1/ s/<c>/*INT/
-}
-
-Parrot_iseq_i_nc_n {
-    iscc_i_xc_x s/<_N>/_n/ s/<cc>/emitm_je/ s/<typ>/NUM/ s/<scr>/FSR1/ s/<c>/&NUM/
-}
-
-Parrot_isne_i_nc_n {
-    iscc_i_xc_x s/<_N>/_n/ s/<cc>/emitm_jne/ s/<typ>/NUM/ s/<scr>/FSR1/ s/<c>/&NUM/
-}
-
-Parrot_islt_i_nc_n {
-    iscc_i_xc_x s/<_N>/_n/ s/<cc>/emitm_jb/ s/<typ>/NUM/ s/<scr>/FSR1/ s/<c>/&NUM/
-}
-
-Parrot_isle_i_nc_n {
-    iscc_i_xc_x s/<_N>/_n/ s/<cc>/emitm_jbe/ s/<typ>/NUM/ s/<scr>/FSR1/ s/<c>/&NUM/
-}
-
-;
-; TODO check alignment, and maybe move 1 msk into reg
-;
-Parrot_pow_n_n_i {
-    int saved = 0;
-    char *L1, *L2, *L3, *L4, *L5, *L6;
-
-    emitm_fld1(NATIVECODE);              /* res = 1.0  ST(1) */
-    if (MAP[3]) {
-        jit_emit_mov_rr_i(NATIVECODE, emit_EAX, MAP[3]);
-    }
-    else {
-        jit_emit_mov_RM_i(interp, NATIVECODE, emit_EAX, ROFFS_INT(3));
-    }
-    jit_emit_test_r_i(NATIVECODE, emit_EAX);               /* e == 0? */
-    L1 = NATIVECODE;
-    emitm_jxs(NATIVECODE, emitm_jz, 0);                    /* jz L1 */
-    if (MAP[2]) {
-        emitm_fld(NATIVECODE, (MAP[2] + 1));
-    }
-    else {
-        jit_emit_fload_mb_n(interp, NATIVECODE, emit_EBX, ROFFS_NUM(2));
-    }                                    /* n2  = $2   ST(0) */
-    if (intreg_is_used(jit_info, emit_ECX)) {
-        emitm_pushl_r(NATIVECODE, emit_ECX);
-        saved = 1;
-    }
-    jit_emit_mov_ri_i(interp, NATIVECODE, emit_ECX, 1);    /* s = 1 */
-    L2 = NATIVECODE;
-    emitm_jxs(NATIVECODE, emitm_jg, 0);                    /* jg L2 */
-    jit_emit_neg_r_i(NATIVECODE, emit_ECX);                /* s = -1 */
-    jit_emit_neg_r_i(NATIVECODE, emit_EAX);                /* e = -e */
-    L2[1] = NATIVECODE - L2 - 2;
-    /* L2:  */
-    /* while (e) */
-        jit_emit_test_r_i(NATIVECODE, emit_EAX);            /* e == 0? */
-        L4 = NATIVECODE;
-        emitm_jxs(NATIVECODE, emitm_jz, 0);                 /* jz L4 */
-        L3 = NATIVECODE;
-        /* L3: */
-        jit_emit_test_ri_i(NATIVECODE, emit_EAX, 1);        /* e & 1 ? */
-        L5 = NATIVECODE;
-        emitm_jxs(NATIVECODE, emitm_jz, 0);                 /* jz L5 */
-        jit_emit_mul_rr_n(interp, NATIVECODE, 1, 0);        /* res *= n2 */
-        /* L5: */
-        L5[1] = (char)(NATIVECODE - L5 - 2);
-        jit_emit_lsr_ri_i(interp, NATIVECODE, emit_EAX, 1);  /* e >>= 1 */
-        jit_emit_mul_rr_n(interp, NATIVECODE, 0, 0);         /* n2 *= n2 */
-        /* lsr is setting flags - branch past test at L3 */
-        emitm_jxs(NATIVECODE, emitm_jnz, (L3 - NATIVECODE - 1)); /* jmp L3 */
-    /* endwhile */
-    L4[1] = (char)(NATIVECODE - L4 - 2);
-    /* L4:  */
-    jit_emit_test_r_i(NATIVECODE, emit_ECX);               /* s ? */
-    L6 = NATIVECODE;
-    emitm_jxs(NATIVECODE, emitm_jg, 0);                    /* jg L6 */
-    emitm_fld1(NATIVECODE);                                /* push 1.0 */
-    emitm_fxch(NATIVECODE, 2);
-    emitm_fdivp(NATIVECODE, 2);                            /* res = 1.0/res */
-    L6[1] = (char)(NATIVECODE - L6 - 2);
-    /* L6:  */
-    emitm_fstp(NATIVECODE, 0);                             /* pop n2 */
-    L1[1] = (char)(NATIVECODE - L1 - 2);
-    /* L1:  */
-    if (MAP[1]) {
-        emitm_fstp(NATIVECODE, (MAP[1] + 1));              /* store res */
-    }
-    else {
-        jit_emit_fstore_m_n(interp, NATIVECODE, ROFFS_NUM(1));
-    }
-    if (saved)
-        emitm_popl_r(NATIVECODE, emit_ECX);
-}
-
-/*
- * Local variables:
- * c-indentation-style: bsd
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- *
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/i386/exec_dep.c
==============================================================================
--- branches/orderedhash_revamp/src/jit/i386/exec_dep.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,194 +0,0 @@
-/*
- * Copyright (C) 2003-2009, Parrot Foundation.
- */
-
-/*
- * exec_dep.c
- *
- * SVN Info
- *    $Id$
- * Overview:
- *    i386 dependent functions to emit an executable.
- * History:
- *      Initial version by Daniel Grunblatt on 2003.6.9
- * Notes:
- * References:
- */
-
-#include "parrot/parrot.h"
-#include "jit.h"
-#define JIT_EMIT 1
-#include "jit_emit.h"
-#include "exec_dep.h"
-
-/* HEADERIZER HFILE: src/jit/i386/exec_dep.h */
-
-#ifdef JIT_CGP
-
-void
-Parrot_exec_normal_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-    ASSERT_ARGS(Parrot_exec_normal_op)
-    Parrot_jit_optimizer_section_ptr cur_section =
-        jit_info->optimizer->cur_section;
-    int i, j, last_is_branch = 0;
-    void ** offset;
-
-    assert(op_jit[*jit_info->cur_op].extcall == 1);
-    if (cur_section->done == 1)
-        return;
-    else if (cur_section->done == -1 && --cur_section->ins_count > 0)
-        return;
-
-    /* check where section ends */
-    if (interp->op_info_table[*cur_section->end].jump)
-        last_is_branch = 1;
-    else if (cur_section->next && !cur_section->next->isjit)
-        last_is_branch = 1;
-
-    /* if more then 1 op, then jump to CGP, branches are never
-     * executed in CGP, they are handled below */
-    if (cur_section->done >= 0
-    && (INTVAL)cur_section->op_count >= 2 + last_is_branch) {
-        int saved = 0;
-        offset    = (void **)((int)jit_info->cur_op -
-            (int)interp->code->base.data);
-
-        jit_emit_mov_ri_i(jit_info->native_ptr, emit_ESI, offset);
-        Parrot_exec_add_text_rellocation(jit_info->objfile,
-            jit_info->native_ptr, RTYPE_COM, "exec_prederef_code", -4);
-
-        emitm_callm(jit_info->native_ptr, emit_ESI, 0, 0, 0);
-
-        /* now patch a B<cpu_ret> opcode after the end of the
-         * prederefed (non JIT) section */
-        if (last_is_branch) {
-            offset = (cur_section->end - interp->code->base.data) +
-                interp->code->prederef.code;
-            cur_section->done = -1;
-
-            /* ins to skip */
-            cur_section->ins_count = cur_section->op_count - 1;
-        }
-        else {
-            /* There must be a next section: either we have a B<end>
-             * or a JITed branch,
-             * when the branch is non JIT, we are in the above case
-             */
-            offset = (cur_section->next->begin - interp->code->base.data)
-                + interp->code->prederef.code;
-            cur_section->done = 1;
-        }
-
-        i = (int)(((op_func_t*)interp->op_lib->op_func_table)[PARROT_OP_cpu_ret]);
-        j = (int)cgp_core;
-
-        *offset = (void *)(i - j);
-    }
-    else {
-
-        /* else call normal funtion */
-        emitm_pushl_i(jit_info->native_ptr, 0x0);
-        Parrot_exec_add_text_rellocation(jit_info->objfile,
-            jit_info->native_ptr, RTYPE_COM, "interpre", -4);
-        emitm_pushl_i(jit_info->native_ptr,
-            jit_info->objfile->bytecode_header_size +
-                jit_info->op_i * sizeof (opcode_t));
-        Parrot_exec_add_text_rellocation(jit_info->objfile,
-            jit_info->native_ptr, RTYPE_DATA, "program_code", -4);
-
-        Parrot_exec_add_text_rellocation_func(jit_info->objfile,
-            jit_info->native_ptr,
-                interp->op_info_table[*jit_info->cur_op].func_name);
-        emitm_calll(jit_info->native_ptr, EXEC_CALLDISP);
-        emitm_addb_i_r(jit_info->native_ptr, 8, emit_ESP);
-
-        /* when this was a branch, then EAX is now the offset
-         * in the byte_code */
-    }
-}
-
-#else /* JIT_CGP */
-
-void
-Parrot_exec_normal_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    ASSERT_ARGS(Parrot_exec_normal_op)
-    emitm_pushl_i(jit_info->native_ptr,
-        jit_info->objfile->bytecode_header_size +
-            jit_info->op_i * sizeof (opcode_t));
-    Parrot_exec_add_text_rellocation(jit_info->objfile, jit_info->native_ptr,
-        RTYPE_DATA, "program_code", -4);
-
-    Parrot_exec_add_text_rellocation_func(jit_info->objfile,
-        jit_info->native_ptr,
-            interp->op_info_table[*jit_info->cur_op].func_name);
-    emitm_calll(jit_info->native_ptr, EXEC_CALLDISP);
-    emitm_addb_i_r(jit_info->native_ptr, 4, emit_ESP);
-}
-
-#endif /* JIT_CGP */
-
-void
-Parrot_exec_cpcf_op(Parrot_jit_info_t *jit_info,
-                   PARROT_INTERP)
-{
-    ASSERT_ARGS(Parrot_exec_cpcf_op)
-    Parrot_exec_normal_op(jit_info, interp);
-    Parrot_emit_jump_to_eax(jit_info, interp);
-}
-
-void
-Parrot_exec_restart_op(Parrot_jit_info_t *jit_info,
-                   PARROT_INTERP)
-{
-    ASSERT_ARGS(Parrot_exec_restart_op)
-    char *jmp_ptr, *sav_ptr;
-
-    Parrot_exec_normal_op(jit_info, interp);
-
-    /* test eax, if zero (e.g after trace), return from JIT */
-    jit_emit_test_r_i(jit_info->native_ptr, emit_EAX);
-
-    /* remember PC */
-    jmp_ptr = jit_info->native_ptr;
-
-    /* emit jump past exit code, dummy offset
-     * this assumes exit code is not longer then a short jump (126 bytes) */
-    emitm_jxs(jit_info->native_ptr, emitm_jnz, 0);
-    exec_emit_end(jit_info->native_ptr);
-
-    /* fixup above jump */
-    sav_ptr              = jit_info->native_ptr;
-    jit_info->native_ptr = jmp_ptr;
-    emitm_jxs(jit_info->native_ptr, emitm_jnz, (long)(sav_ptr - jmp_ptr) - 2);
-
-    /* restore PC */
-    jit_info->native_ptr = sav_ptr;
-    Parrot_emit_jump_to_eax(jit_info, interp);
-}
-
-/* Assign the offset of the program_code */
-void
-offset_fixup(Parrot_exec_objfile_t *obj)
-{
-    ASSERT_ARGS(offset_fixup)
-    int i;
-
-    for (i = 0; i < obj->data_count; i++) {
-        int j;
-#ifdef EXEC_A_OUT
-        obj->symbol_table[i].value = obj->text.size;
-#endif
-        for (j = 0; j < i; j++)
-            obj->symbol_table[i].value += obj->data_size[j];
-    }
-}
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/i386/exec_dep.h
==============================================================================
--- branches/orderedhash_revamp/src/jit/i386/exec_dep.h	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,55 +0,0 @@
-/*
-  Copyright (C) 2003-2008, Parrot Foundation.
-  $Id$
-*/
-
-/*
- * exec_dep.h
- *
- * Overview:
- *    i386 dependent functions to emit an executable.
- * History:
- *      Initial version by Daniel Grunblatt on 2003.6.9
- * Notes:
- * References:
- */
-
-#ifndef PARROT_I386_EXEC_DEP_H_GUARD
-#define PARROT_I386_EXEC_DEP_H_GUARD
-
-/* 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 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_Parrot_exec_cpcf_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_exec_normal_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_exec_normal_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_exec_restart_op __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/exec_dep.c */
-
-#endif /* PARROT_I386_EXEC_DEP_H_GUARD */
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/i386/jit_defs.c
==============================================================================
--- branches/orderedhash_revamp/src/jit/i386/jit_defs.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,2545 +0,0 @@
-/*
-Copyright (C) 2008-2009, Parrot Foundation.
-$Id$
-*/
-
-/* HEADERIZER HFILE: none */
-/* HEADERIZER STOP */
-
-#include <assert.h>
-#include "parrot/parrot.h"
-#include "parrot/hash.h"
-#include "parrot/oplib/ops.h"
-#include "pmc/pmc_fixedintegerarray.h"
-#include "pmc/pmc_unmanagedstruct.h"
-#include "pmc/pmc_pointer.h"
-#include "jit.h"
-#include "jit_emit.h"
-
-INTVAL
-get_nci_I(PARROT_INTERP, ARGMOD(call_state *st), int n)
-{
-    if (n >= st->src.n)
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-            "too few arguments passed to NCI function");
-
-    Parrot_fetch_arg_nci(interp, st);
-
-    return UVal_int(st->val);
-}
-
-FLOATVAL
-get_nci_N(PARROT_INTERP, ARGMOD(call_state *st), int n)
-{
-    if (n >= st->src.n)
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-            "too few arguments passed to NCI function");
-
-    Parrot_fetch_arg_nci(interp, st);
-
-    return UVal_num(st->val);
-}
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-STRING*
-get_nci_S(PARROT_INTERP, ARGMOD(call_state *st), int n)
-{
-    /* TODO or act like below? */
-    if (n >= st->src.n)
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-            "too few arguments passed to NCI function");
-
-    Parrot_fetch_arg_nci(interp, st);
-
-    return UVal_str(st->val);
-}
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-PMC*
-get_nci_P(PARROT_INTERP, ARGMOD(call_state *st), int n)
-{
-    /*
-     * excessive args are passed as NULL
-     * used by e.g. MMD infix like __add
-     */
-    if (n < st->src.n)
-        Parrot_fetch_arg_nci(interp, st);
-    else
-        UVal_pmc(st->val) = PMCNULL;
-
-    return UVal_pmc(st->val);
-}
-
-/*
- * set return value
- */
-void
-set_nci_I(PARROT_INTERP, ARGOUT(call_state *st), INTVAL val)
-{
-    Parrot_init_ret_nci(interp, st, "I");
-    if (st->dest.i < st->dest.n) {
-        UVal_int(st->val) = val;
-        Parrot_convert_arg(interp, st);
-        Parrot_store_arg(interp, st);
-    }
-}
-
-void
-set_nci_N(PARROT_INTERP, ARGOUT(call_state *st), FLOATVAL val)
-{
-    Parrot_init_ret_nci(interp, st, "N");
-    if (st->dest.i < st->dest.n) {
-        UVal_num(st->val) = val;
-        Parrot_convert_arg(interp, st);
-        Parrot_store_arg(interp, st);
-    }
-}
-
-void
-set_nci_S(PARROT_INTERP, ARGOUT(call_state *st), STRING *val)
-{
-    Parrot_init_ret_nci(interp, st, "S");
-    if (st->dest.i < st->dest.n) {
-        UVal_str(st->val) = val;
-        Parrot_convert_arg(interp, st);
-        Parrot_store_arg(interp, st);
-    }
-}
-
-void
-set_nci_P(PARROT_INTERP, ARGOUT(call_state *st), PMC* val)
-{
-    Parrot_init_ret_nci(interp, st, "P");
-    if (st->dest.i < st->dest.n) {
-        UVal_pmc(st->val) = val;
-        Parrot_convert_arg(interp, st);
-        Parrot_store_arg(interp, st);
-    }
-}
-
-int
-emit_is8bit(long disp)
-{
-    return disp >= -128 && disp <= 127;
-}
-
-char *
-emit_disp8_32(char *pc, int disp)
-{
-    if (emit_is8bit(disp)) {
-        *(pc++) = (char)disp;
-        return pc;
-    }
-    else {
-        *(long *)pc = disp;
-        return pc + 4;
-    }
-}
-
-void
-emit_sib(PARROT_INTERP, char *pc, int scale, int i, int base)
-{
-    int scale_byte;
-
-    switch (scale) {
-        case 1:
-            scale_byte = emit_Scale_1;
-            break;
-        case 2:
-            scale_byte = emit_Scale_2;
-            break;
-        case 4:
-            scale_byte = emit_Scale_4;
-            break;
-        case 8:
-            scale_byte = emit_Scale_8;
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_JIT_ERROR,
-                "Invalid scale factor %d\n", scale);
-            return;
-    }
-
-    *pc = (char)(scale_byte | (i == emit_None ? emit_Index_None : emit_reg_Index(i)) |
-            emit_reg_Base(base));
-}
-
-char *
-emit_r_X(PARROT_INTERP, char *pc, int reg_opcode, int base, int i, int scale, long disp)
-{
-    if (i && !scale)
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_JIT_ERROR,
-            "emit_r_X passed invalid scale+index combo\n");
-
-    if (base == emit_EBP) {
-    /* modrm disp */
-        if (i == emit_None) {
-            *(pc++) = (char)((emit_is8bit(disp) ? emit_Mod_b01 : emit_Mod_b10)
-                    | reg_opcode | emit_reg_rm(emit_EBP));
-            return emit_disp8_32(pc, disp);
-        }
-        /* modrm sib disp */
-        else {
-            *(pc++) = (char)((emit_is8bit(disp) ? emit_Mod_b01 : emit_Mod_b10)
-                    | reg_opcode | emit_b100);
-            emit_sib(interp, pc++, scale, i, base);
-            return emit_disp8_32(pc, disp);
-        }
-    }
-
-    /* modrm sib disp */
-    if (base == emit_ESP) {
-        *(pc++) = (char)((emit_is8bit(disp) ? emit_Mod_b01 : emit_Mod_b10)
-                | reg_opcode | emit_rm_b100);
-        emit_sib(interp, pc++, scale, i, emit_ESP);
-        return emit_disp8_32(pc, disp);
-    }
-
-    /* modrm disp32 */
-    if (!base && !(i && scale)) {
-        *(pc++) = (char)(emit_Mod_b00 | reg_opcode | emit_rm_b101);
-        *(long *)pc = disp;
-        return pc + 4;
-    }
-
-    /* Ok, everything should be more regular here */
-    *(pc++) = (char)((disp == 0 ? emit_Mod_b00 :
-              (emit_is8bit(disp) ?
-               emit_Mod_b01 : emit_Mod_b10)) |
-               reg_opcode |
-               (!base || (scale && i) ? emit_rm_b100 : emit_reg_rm(base)));
-
-    if (!base || (scale && i)) {
-        emit_sib(interp, pc++, scale, i, base);
-    }
-    if (disp)
-        pc = emit_disp8_32(pc, disp);
-
-    return pc;
-}
-
-char *
-emit_shift_i_r(PARROT_INTERP, char *pc, int opcode, int imm, int reg)
-{
-    if (opcode == emit_b000 && imm < 0) {
-        opcode = emit_b001;     /* -rol => 32 + ror */
-        imm = -imm;
-    }
-
-    if (imm == 0) {
-        /* noop */
-    }
-    else if (imm == 1) {
-        *(pc++) = (char) 0xd1;
-        *(pc++) = (char) emit_alu_X_r(opcode,  reg);
-    }
-    else if (imm > 1 && imm < 33) {
-        *(pc++) = (char) 0xc1;
-        *(pc++) = (char) emit_alu_X_r(opcode,  reg);
-        *(pc++) = (char)imm;
-    }
-    else {
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_JIT_ERROR,
-            "emit_shift_i_r passed invalid shift\n");
-    }
-
-    return pc;
-}
-
-char *
-emit_shift_i_m(PARROT_INTERP, char *pc, int opcode, int imm,
-               int base, int i, int scale, long disp)
-{
-    if (imm == 0) {
-        /* noop */
-    }
-    else if (imm == 1) {
-        *(pc++) = (char) 0xd1;
-        pc = emit_r_X(interp, pc, opcode,  base, i, scale, disp);
-    }
-    else if (imm > 1 && imm < 33) {
-        *(pc++) = (char) 0xc1;
-        pc = emit_r_X(interp, pc, opcode,  base, i, scale, disp);
-        *(pc++) = (char)imm;
-    }
-    else {
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_JIT_ERROR,
-            "emit_shift_i_m passed invalid shift\n");
-    }
-
-    return pc;
-}
-
-char *
-emit_shift_r_r(PARROT_INTERP, char *pc, int opcode, int reg1, int reg2)
-{
-    if (reg1 != emit_ECX)
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_JIT_ERROR,
-            "emit_shift_r_r passed invalid register\n");
-
-    *(pc++) = (char) 0xd3;
-    *(pc++) = (char) emit_alu_X_r(opcode,  reg2);
-
-    return pc;
-}
-
-char *
-emit_shift_r_m(PARROT_INTERP, char *pc, int opcode, int reg,
-               int base, int i, int scale, long disp)
-{
-    if (reg != emit_ECX)
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_JIT_ERROR,
-            "emit_shift_r_m passed invalid register\n");
-
-    *(pc++) = (char) 0xd3;
-    pc = emit_r_X(interp, pc, opcode,  base, i, scale, disp);
-
-    return pc;
-}
-
-char *
-emit_pushl_m(PARROT_INTERP, char *pc, int base, int i, int scale, long disp)
-{
-    *(pc++) = (char) 0xff;
-    return emit_r_X(interp, pc, emit_reg(emit_b110), base, i, scale, disp);
-}
-
-char *
-emit_popl_r(char *pc, int reg)
-{
-    *(pc++) = (char)(0x58 | (reg - 1));
-    return pc;
-}
-
-char *
-emit_popl_m(PARROT_INTERP, char *pc, int base, int i, int scale, long disp)
-{
-    *(pc++) = (char) 0x8f;
-    return emit_r_X(interp, pc, emit_reg(emit_b000), base, i, scale, disp);
-}
-
-char *
-emit_movb_r_r(char *pc, int reg1, int reg2)
-{
-    *(pc++) = (char) 0x88;
-    *(pc++) = (char) emit_alu_r_r(reg1, reg2);
-    return pc;
-}
-
-char *
-emit_movb_i_r(char *pc, char imm, int reg)
-{
-    *(pc++) = (char)(0xb0 | (reg - 1));
-    *(pc++) = imm;
-    return pc;
-}
-
-char *
-emit_movb_i_m(PARROT_INTERP, char *pc, char imm, int base, int i, int scale, long disp)
-{
-    *(pc++) = (char) 0xc6;
-    pc = emit_r_X(interp, pc, emit_reg(emit_b000), base, i, scale, disp);
-    *(pc++) = imm;
-    return pc;
-}
-
-char *
-opt_mul(PARROT_INTERP, char *pc, int dest, INTVAL imm, int src)
-{
-    UINTVAL ld2 = ld((UINTVAL) imm);
-
-    if (imm == 0) {
-        jit_emit_mov_ri_i(interp, pc, dest, 0);
-    }
-    else if (imm > 0 && !(imm & (imm - 1))) {
-        /* positive power of 2 - do a shift */
-        jit_emit_mov_rr_i(pc, dest, src);
-        pc = emit_shift_i_r(interp, pc, emit_b100, ld2, dest);
-    }
-    else {
-        /* special small numbers */
-        switch (imm) {
-            case 3:
-                /* LEA dest, base, index, scale, displace
-                 * note: src may be dest, so can't be reused
-                 *
-                 * dest = src + src*2 */
-                emitm_lea_m_r(interp, pc, dest, src, src, 2, 0);
-                break;
-            case 5:      /* dest = src + src*4 */
-                emitm_lea_m_r(interp, pc, dest, src, src, 4, 0);
-                break;
-            case 6:     /* dest = src*3; dest += dest */
-                emitm_lea_m_r(interp, pc, dest, src, src, 2, 0);
-                jit_emit_add_rr_i(interp, pc, dest, dest);
-                break;
-            case 9:      /* dest = src + src*8 */
-                emitm_lea_m_r(interp, pc, dest, src, src, 8, 0);
-                break;
-            case 10:      /* dest = src + src*4 ; dest+= dest */
-                emitm_lea_m_r(interp, pc, dest, src, src, 4, 0);
-                jit_emit_add_rr_i(interp, pc, dest, dest);
-                break;
-            case 12:     /* dest= src*3; dest <<= 2 */
-                emitm_lea_m_r(interp, pc, dest, src, src, 2, 0);
-                pc = emit_shift_i_r(interp, pc, emit_b100, 2, dest);
-                break;
-            case 100:      /* dest = src + src*4 ; dest <<= 2; dest = 5*dest*/
-                emitm_lea_m_r(interp, pc, dest, src, src, 4, 0);
-                pc = emit_shift_i_r(interp, pc, emit_b100, 2, dest);
-                emitm_lea_m_r(interp, pc, dest, dest, dest, 4, 0);
-                break;
-            default:
-                emitm_alul_r_r(pc, 0x69, dest, src);
-                *(long *)(pc) = (long)imm;
-                pc += 4;
-        }
-    }
-    return pc;
-}
-
-int
-intreg_is_used(Parrot_jit_info_t *jit_info, char reg)
-{
-    int i;
-    const jit_arch_regs *reg_info;
-    Parrot_jit_register_usage_t *ru = jit_info->optimizer->cur_section->ru;
-
-    reg_info = jit_info->arch_info->regs + jit_info->code_type;
-
-    for (i = 0; i < ru[0].registers_used; ++i) {
-        if (reg_info->map_I[i] == reg) {
-            return 1;
-        }
-    }
-    return 0;
-}
-
-char *
-opt_shift_rr(PARROT_INTERP, Parrot_jit_info_t *jit_info, int dest, int count, int op)
-{
-    char *pc = jit_info->native_ptr;
-    if (count == emit_ECX) {
-        pc = emit_shift_r_r(interp, pc, op, count, dest);
-    }
-    else {
-        int saved = 0;
-        PARROT_ASSERT(count != emit_EAX);
-        if (dest == emit_EAX) {
-            if (intreg_is_used(jit_info, emit_ECX)) {
-                emitm_pushl_r(pc, emit_ECX);
-                saved = 1;
-            }
-            jit_emit_mov_rr_i(pc, emit_ECX, count);
-            pc = emit_shift_r_r(interp, pc, op, emit_ECX, dest);
-            if (saved) {
-                emitm_popl_r(pc, emit_ECX);
-            }
-
-        }
-        else if (dest == emit_ECX) {
-            jit_emit_xchg_rr_i(interp, pc, dest, count);
-            pc = emit_shift_r_r(interp, pc, op, dest, count);
-            jit_emit_xchg_rr_i(interp, pc, dest, count);
-        }
-        else {
-            jit_emit_mov_rr_i(pc, emit_EAX, emit_ECX);
-            jit_emit_mov_rr_i(pc, emit_ECX, count);
-            pc = emit_shift_r_r(interp, pc, op, emit_ECX, dest);
-            jit_emit_mov_rr_i(pc, emit_ECX, emit_EAX);
-        }
-    }
-    return pc;
-}
-
-char *
-opt_shift_rm(PARROT_INTERP, Parrot_jit_info_t *jit_info, int dest, int offs, int op)
-{
-    char *pc = jit_info->native_ptr;
-    int saved = 0;
-    /* if ECX is mapped, save it */
-    if (dest != emit_ECX && intreg_is_used(jit_info, emit_ECX)) {
-        emitm_pushl_r(pc, emit_ECX);
-        saved = 1;
-    }
-    if (dest == emit_ECX) {
-        /* jit_emit_mov_RM_i(pc, emit_EAX, count); */
-        emitm_movl_m_r(interp, pc, emit_EAX, emit_EBX, emit_None, 1, offs);
-        jit_emit_xchg_rr_i(interp, pc, dest, emit_EAX);
-        pc = emit_shift_r_r(interp, pc, op, emit_ECX, emit_EAX);
-        jit_emit_xchg_rr_i(interp, pc, dest, emit_EAX);
-    }
-    else {
-        /* jit_emit_mov_RM_i(pc, emit_ECX, count); */
-        emitm_movl_m_r(interp, pc, emit_ECX, emit_EBX, emit_None, 1, offs);
-        pc = emit_shift_r_r(interp, pc, op, emit_ECX, dest);
-    }
-    if (saved) {
-        emitm_popl_r(pc, emit_ECX);
-    }
-    return pc;
-}
-
-void call_func(Parrot_jit_info_t *jit_info, void (*addr) (void))
-{
-    Parrot_jit_newfixup(jit_info);
-    jit_info->arena.fixups->type = JIT_X86CALL;
-    jit_info->arena.fixups->param.fptr = D2FPTR(addr);
-    emitm_calll(jit_info->native_ptr, 0xdeafc0de);
-}
-
-void jit_emit_real_exception(Parrot_jit_info_t *jit_info)
-{
-    call_func(jit_info, (void (*) (void)) & Parrot_ex_throw_from_c_args);
-}
-
-unsigned char *lastpc;
-
-/* ST(r1) /= ST(r2) */
-char *
-div_rr_n(PARROT_INTERP, Parrot_jit_info_t *jit_info, int r1)
-{
-    char *L1;
-    static const char div_by_zero[] = "Divide by zero";
-    char *pc = jit_info->native_ptr;
-
-    jit_emit_test_r_n(pc, (char)0);   /* TOS */
-    L1 = pc;
-    emitm_jxs(pc, emitm_jnz, 0);
-    emitm_pushl_i(pc, div_by_zero);
-    emitm_pushl_i(pc, EXCEPTION_DIV_BY_ZERO);
-    emitm_pushl_i(pc, 0);    /* NULL */
-    Parrot_jit_emit_get_INTERP(interp, pc, emit_ECX);
-    emitm_pushl_r(pc, emit_ECX);
-    jit_info->native_ptr = pc;
-    jit_emit_real_exception(jit_info);
-    pc = jit_info->native_ptr;
-    /* L1: */
-    L1[1] = (char)(pc - L1 - 2);
-    emitm_fdivp(pc, (r1+1));
-    return pc;
-}
-
-char *
-mod_rr_n(PARROT_INTERP, Parrot_jit_info_t *jit_info, int r)
-{
-    char *L1;
-    static const char div_by_zero[] = "Divide by zero";
-    char *pc = jit_info->native_ptr;
-
-    jit_emit_test_r_n(pc, (char)0);   /* TOS */
-    L1 = pc;
-    emitm_jxs(pc, emitm_jnz, 0);
-    emitm_pushl_i(pc, div_by_zero);
-    emitm_pushl_i(pc, EXCEPTION_DIV_BY_ZERO);
-    emitm_pushl_i(pc, 0);    /* NULL */
-    Parrot_jit_emit_get_INTERP(interp, pc, emit_ECX);
-    emitm_pushl_r(pc, emit_ECX);
-    jit_info->native_ptr = pc;
-    jit_emit_real_exception(jit_info);
-    pc = jit_info->native_ptr;
-    /* L1: */
-    L1[1] = (char)(pc - L1 - 2);
-    /* L2: */
-    emitm_fxch(pc, (char)1);
-    emitm_fprem(pc);
-    emitm_fstw(pc);
-    emitm_sahf(pc);
-    emitm_jxs(pc, emitm_jp, -7); /* jo L2 */
-    emitm_fstp(pc, (r+1));
-    return pc;
-}
-
-/* dest /= src
- * edx:eax /= src, quotient => eax, rem => edx
- */
-char *
-opt_div_rr(PARROT_INTERP, Parrot_jit_info_t *jit_info, int dest, int src, int is_div)
-{
-    char *pc = jit_info->native_ptr;
-    int saved = 0;
-    int div_ecx = 0;
-    char *L1, *L2, *L3;
-    static const char div_by_zero[] = "Divide by zero";
-
-    PARROT_ASSERT(src != emit_EAX);
-
-    if (dest != emit_EAX) {
-        jit_emit_mov_rr_i(pc, emit_EAX, dest);
-    }
-    if (dest == emit_EDX) {
-        /* all ok, we can globber it */
-    }
-    else {
-        /* if ECX is not mapped use it */
-        if (!intreg_is_used(jit_info, emit_ECX) && src == emit_EDX) {
-            jit_emit_mov_rr_i(pc, emit_ECX, emit_EDX);
-            div_ecx = 1;
-        }
-        else
-            /* if EDX is mapped, preserve EDX on stack */
-            if (intreg_is_used(jit_info, emit_EDX)) {
-                emitm_pushl_r(pc, emit_EDX);
-                saved = 1;
-                /* if EDX is the src, we need another temp register: ECX */
-                if (src == emit_EDX) {
-                    /* if ECX is mapped save it, but not if it's dest */
-                    if (intreg_is_used(jit_info, emit_ECX) &&
-                            dest != emit_ECX) {
-                        emitm_pushl_r(pc, emit_ECX);
-                        saved = 2;
-                    }
-                    /* else just use it */
-                    jit_emit_mov_rr_i(pc, emit_ECX, emit_EDX);
-                    div_ecx = 1;
-                }
-            }
-    }
-    /* this sequence allows 2 other instructions to run parallel */
-    if (dest != emit_EDX) {
-        jit_emit_mov_rr_i(pc, emit_EDX, emit_EAX);
-    }
-    pc = emit_shift_i_r(interp, pc, emit_b111, 31, emit_EDX); /* SAR 31 */
-    if (div_ecx) {
-        jit_emit_test_r_i(pc, emit_ECX);
-        L1 = pc;
-        emitm_jxs(pc, emitm_jz, 0);
-        emitm_sdivl_r(pc, emit_ECX);
-        L3 = pc;
-        emitm_jumps(pc, 0);
-        /* L1: */
-        L1[1] = (char)(pc - L1 - 2);
-    }
-    else {
-        jit_emit_test_r_i(pc, src);
-        L2 = pc;
-        emitm_jxs(pc, emitm_jz, 0);
-        emitm_sdivl_r(pc, src);
-        L3 = pc;
-        emitm_jumps(pc, 0);
-        /* L2: */
-        L2[1] = (char)(pc - L2 - 2);
-    }
-    /* TODO Parrot_ex_throw_from_c_args */
-    emitm_pushl_i(pc, div_by_zero);
-    emitm_pushl_i(pc, EXCEPTION_DIV_BY_ZERO);
-    emitm_pushl_i(pc, 0);    /* NULL */
-    Parrot_jit_emit_get_INTERP(interp, pc, emit_ECX);
-    emitm_pushl_r(pc, emit_ECX);
-    jit_info->native_ptr = pc;
-    jit_emit_real_exception(jit_info);
-    pc = jit_info->native_ptr;
-    /* L3: */
-    L3[1] = (char)(pc - L3 - 2);
-    if (saved == 2) {
-        emitm_popl_r(pc, emit_ECX);
-    }
-    if (is_div) {
-        /* result = quotient in EAX */
-        if (saved) {
-            emitm_popl_r(pc, emit_EDX);
-        }
-        if (dest != emit_EAX) {
-            jit_emit_mov_rr_i(pc, dest, emit_EAX);
-        }
-    }
-    else {
-        /* result = remainder in EDX */
-        if (saved) {
-            emitm_popl_r(pc, emit_EAX);
-            jit_emit_mov_rr_i(pc, dest, emit_EDX);
-            jit_emit_mov_rr_i(pc, emit_EDX, emit_EAX);
-        }
-        else {
-            if (dest != emit_EDX)
-                jit_emit_mov_rr_i(pc, dest, emit_EDX);
-        }
-    }
-    if (!saved && div_ecx) {
-        /* restore EDX */
-        jit_emit_mov_rr_i(pc, emit_EDX, emit_ECX);
-    }
-    return pc;
-}
-
-char *
-opt_div_ri(PARROT_INTERP, Parrot_jit_info_t *jit_info, int dest, INTVAL imm, int is_div)
-{
-    char *pc = jit_info->native_ptr;
-
-    UINTVAL ld2 = ld((UINTVAL) imm);
-    if (is_div && imm > 1 && !(imm & (imm - 1))) {
-        /* positive power of 2 - do a shift */
-        pc = emit_shift_i_r(interp, pc, emit_b101, ld2, dest);
-    }
-    else {
-        if (dest != emit_EBX) {
-            emitm_pushl_r(pc, emit_EBX);
-            jit_emit_mov_ri_i(interp, pc, emit_EBX, imm);
-            jit_info->native_ptr = pc;
-            pc = opt_div_rr(interp, jit_info, dest, emit_EBX, is_div);
-            pc = emit_popl_r(pc, emit_EBX);
-        }
-        else {
-            emitm_pushl_r(pc, emit_EDI);
-            jit_emit_mov_ri_i(interp, pc, emit_EDI, imm);
-            jit_info->native_ptr = pc;
-            pc = opt_div_rr(interp, jit_info, dest, emit_EDI, is_div);
-            pc = emit_popl_r(pc, emit_EDI);
-        }
-    }
-    return pc;
-}
-
-char *
-opt_div_RM(PARROT_INTERP, Parrot_jit_info_t *jit_info, int dest, int offs, int is_div)
-{
-    char *pc = jit_info->native_ptr;
-    int saved = 0;
-
-    if (dest != emit_EAX) {
-        jit_emit_mov_rr_i(pc, emit_EAX, dest);
-    }
-    if (dest == emit_EDX) {
-        /* all ok, we can globber it */
-    }
-    else {
-        /* if ECX is mapped, push EDX on stack */
-        if (intreg_is_used(jit_info, emit_ECX)) {
-            emitm_pushl_r(pc, emit_EDX);
-            saved = 2;
-        }
-        /* if EDX is mapped, save it in ECX */
-        else if (intreg_is_used(jit_info, emit_EDX)) {
-            saved = 1;
-            jit_emit_mov_rr_i(pc, emit_ECX, emit_EDX);
-        }
-    }
-    /* this sequence allows 2 other instructions to run parallel */
-    jit_emit_mov_rr_i(pc, emit_EDX, emit_EAX);
-    pc = emit_shift_i_r(interp, pc, emit_b111, 31, emit_EDX); /* SAR 31 */
-
-    emitm_sdivl_m(pc, emit_EBX, 0, 1, offs);
-
-    if (is_div) {
-        /* result = quotient in EAX */
-        if (saved == 1) {
-            jit_emit_mov_rr_i(pc, emit_EDX, emit_ECX);
-        }
-        if (dest != emit_EAX) {
-            jit_emit_mov_rr_i(pc, dest, emit_EAX);
-        }
-        if (saved == 2) {
-            emitm_popl_r(pc, emit_EDX);
-        }
-    }
-    else {
-        /* result = remainder in EDX */
-        if (dest != emit_EDX) {
-            jit_emit_mov_rr_i(pc, dest, emit_EDX);
-            if (saved == 1) {
-                jit_emit_mov_rr_i(pc, emit_EDX, emit_ECX);
-            }
-            else if (saved == 2)
-                emitm_popl_r(pc, emit_EDX);
-        }
-    }
-    return pc;
-}
-
-void
-jit_emit_jcc(Parrot_jit_info_t *jit_info, int code, opcode_t disp)
-{
-    long offset;
-    opcode_t opcode;
-
-    opcode = jit_info->op_i + disp;
-
-    if (opcode <= jit_info->op_i) {
-        offset = jit_info->arena.op_map[opcode].offset -
-                (jit_info->native_ptr - jit_info->arena.start);
-
-        /* If we are here, the current section must have a branch_target
-           section, I think. */
-        if (jit_info->optimizer->cur_section->branch_target ==
-            jit_info->optimizer->cur_section)
-                offset +=
-                    jit_info->optimizer->cur_section->branch_target->load_size;
-
-        if (emit_is8bit(offset - 2)) {
-            emitm_jxs(jit_info->native_ptr, code, offset - 2);
-        }
-        else {
-            emitm_jxl(jit_info->native_ptr, code, offset - 6);
-        }
-
-        return;
-    }
-
-    Parrot_jit_newfixup(jit_info);
-    jit_info->arena.fixups->type = JIT_X86BRANCH;
-    jit_info->arena.fixups->param.opcode = opcode;
-    /* If the branch is to the current section, skip the load instructions. */
-    if (jit_info->optimizer->cur_section->branch_target ==
-        jit_info->optimizer->cur_section)
-            jit_info->arena.fixups->skip =
-                (char)jit_info->optimizer->cur_section->branch_target->load_size;
-
-    emitm_jxl(jit_info->native_ptr, code, 0xc0def00d);
-}
-
-void
-emit_jump(Parrot_jit_info_t *jit_info, opcode_t disp)
-{
-    long offset;
-    opcode_t opcode;
-
-    opcode = jit_info->op_i + disp;
-
-    if (opcode <= jit_info->op_i) {
-        offset = jit_info->arena.op_map[opcode].offset -
-                                (jit_info->native_ptr - jit_info->arena.start);
-        if (emit_is8bit(offset - 2)) {
-            emitm_jumps(jit_info->native_ptr, (char)(offset - 2));
-        }
-        else {
-            emitm_jumpl(jit_info->native_ptr, offset - 5);
-        }
-        return;
-    }
-
-    Parrot_jit_newfixup(jit_info);
-    jit_info->arena.fixups->type = JIT_X86JUMP;
-    jit_info->arena.fixups->param.opcode = opcode;
-    /* If the branch is to the current section, skip the load instructions. */
-    if (jit_info->optimizer->cur_section->branch_target ==
-        jit_info->optimizer->cur_section)
-            jit_info->arena.fixups->skip =
-                (char)jit_info->optimizer->cur_section->branch_target->load_size;
-    emitm_jumpl(jit_info->native_ptr, 0xc0def00d);
-}
-
-void
-Parrot_emit_jump_to_eax(Parrot_jit_info_t *jit_info,
-                   PARROT_INTERP)
-{
-    /* we have to get the code pointer, which might change
-     * due to intersegment branches
-     */
-
-    /* get interpreter
-     */
-    emitm_movl_m_r(interp, jit_info->native_ptr,
-            emit_EBX, emit_EBP, emit_None, 1, INTERP_BP_OFFS);
-    if (!jit_info->objfile) {
-        /*
-         * emit interp->code->base.data
-         */
-        emitm_movl_m_r(interp, jit_info->native_ptr, emit_ECX, emit_EBX, 0, 1,
-                offsetof(Interp, code));
-        emitm_movl_m_r(interp, jit_info->native_ptr, emit_EDX, emit_ECX, 0, 1,
-                offsetof(PackFile_Segment, data));
-        /* calc code offset */
-        jit_emit_sub_rr_i(interp, jit_info->native_ptr, emit_EAX, emit_EDX);
-        /*
-         * now we have the offset of the ins in EAX
-         *
-         * interp->code->jit_info->arena->op_map
-         *
-         * TODO interleave these 2 calculations
-         */
-        emitm_movl_m_r(interp, jit_info->native_ptr, emit_EDX, emit_ECX, 0, 1,
-                offsetof(PackFile_ByteCode, jit_info));
-        emitm_lea_m_r(interp, jit_info->native_ptr, emit_EDX, emit_EDX, 0, 1,
-                offsetof(Parrot_jit_info_t, arena));
-        emitm_movl_m_r(interp, jit_info->native_ptr, emit_EDX, emit_EDX, 0, 1,
-                offsetof(Parrot_jit_arena_t, op_map));
-
-    }
-#if EXEC_CAPABLE
-    else {
-        int *reg;
-        emitm_subl_i_r(jit_info->native_ptr,
-            jit_info->objfile->bytecode_header_size, emit_EAX);
-        Parrot_exec_add_text_rellocation(jit_info->objfile,
-            jit_info->native_ptr, RTYPE_DATA, "program_code", -4);
-        reg = Parrot_exec_add_text_rellocation_reg(jit_info->objfile,
-                jit_info->native_ptr, "opcode_map", 0, 0);
-        jit_emit_mov_ri_i(interp, jit_info->native_ptr, emit_EDX, (long) reg);
-    }
-#endif
-    /* get base pointer */
-    emitm_movl_m_r(interp, jit_info->native_ptr, emit_EBX, emit_EBX, 0, 1,
-            offsetof(Interp, ctx.bp));
-
-    /* This jumps to the address in op_map[EDX + sizeof (void *) * INDEX] */
-    emitm_jumpm(jit_info->native_ptr, emit_EDX, emit_EAX,
-            sizeof (*jit_info->arena.op_map) / 4, 0);
-}
-
-#  define CONST(i) (int *)(jit_info->cur_op[i] * \
-       sizeof (PackFile_Constant) + \
-       offsetof(PackFile_Constant, u))
-
-/* for vtable calls registers are already saved back */
-void
-Parrot_jit_vtable_n_op(Parrot_jit_info_t *jit_info,
-                PARROT_INTERP, int n, int *args)
-{
-    int        nvtable = op_jit[*jit_info->cur_op].extcall;
-    size_t     offset;
-    op_info_t *op_info = &interp->op_info_table[*jit_info->cur_op];
-    int        pi;
-    int        idx, i, op;
-    int        st      = 0;         /* stack pop correction */
-    char      *L4      = NULL;
-
-    /* get the offset of the first vtable func */
-    offset  = offsetof(VTABLE, absolute);
-    offset += nvtable * sizeof (void *);
-    op      = *jit_info->cur_op;
-
-    /* get params $i, 0 is opcode */
-    for (idx = n; idx > 0; idx--) {
-        i  = args[idx-1];
-        pi = *(jit_info->cur_op + i);
-
-        switch (op_info->types[i - 1]) {
-            case PARROT_ARG_S:
-                emitm_movl_m_r(interp, jit_info->native_ptr,
-                        emit_EAX, emit_EBX, emit_None, 1, REG_OFFS_STR(pi));
-                emitm_pushl_r(jit_info->native_ptr, emit_EAX);
-                break;
-            case PARROT_ARG_K:
-            case PARROT_ARG_P:
-                emitm_movl_m_r(interp, jit_info->native_ptr,
-                        emit_EAX, emit_EBX, emit_None, 1, REG_OFFS_PMC(pi));
-                /* push $i, the left most Pi stays in eax, which is used
-                 * below, to call the vtable method
-                 */
-                emitm_pushl_r(jit_info->native_ptr, emit_EAX);
-                break;
-            case PARROT_ARG_KI:
-            case PARROT_ARG_I:
-                if (MAP(i))
-                    emitm_pushl_r(jit_info->native_ptr, MAP(i));
-                else {
-                    emitm_movl_m_r(interp, jit_info->native_ptr,
-                            emit_EAX, emit_EBX, emit_None, 1, REG_OFFS_INT(pi));
-                    emitm_pushl_r(jit_info->native_ptr, emit_EAX);
-                }
-                break;
-                break;
-            case PARROT_ARG_KIC:
-            case PARROT_ARG_IC:
-                /* XXX INTVAL_SIZE */
-                /* push value */
-                emitm_pushl_i(jit_info->native_ptr, pi);
-                break;
-            case PARROT_ARG_N:
-                /* push num on st(0) */
-                if (MAP(i))
-                    emitm_fld(jit_info->native_ptr, MAP(i));
-                else
-                    jit_emit_fload_mb_n(interp, jit_info->native_ptr,
-                            emit_EBX, REG_OFFS_NUM(pi));
-                goto store;
-            case PARROT_ARG_NC:
-                /*
-                 * TODO not all constants are shared between interpreters
-                 */
-#if EXEC_CAPABLE
-                if (jit_info->objfile) {
-                    jit_emit_fload_m_n(interp, jit_info->native_ptr, CONST(i));
-                    Parrot_exec_add_text_rellocation(jit_info->objfile,
-                            jit_info->native_ptr, RTYPE_DATA, "const_table", -4);
-                }
-                else
-#endif
-                    jit_emit_fload_m_n(interp, jit_info->native_ptr,
-                            &interp->code->const_table->
-                            constants[pi]->u.number);
-store:
-#if NUMVAL_SIZE == 8
-                /* make room for double */
-                emitm_addb_i_r(jit_info->native_ptr, -8, emit_ESP);
-                emitm_fstpl(interp, jit_info->native_ptr, emit_ESP, emit_None, 1, 0);
-                /* additional stack adjustment */
-                st += 4;
-#else
-                emitm_addb_i_r(jit_info->native_ptr, -12, emit_ESP);
-                emitm_fstpt(jit_info->native_ptr, emit_ESP, emit_None, 1, 0);
-                st += 8;
-#endif
-                break;
-
-            case PARROT_ARG_SC:
-#if EXEC_CAPABLE
-                if (jit_info->objfile) {
-                    emitm_pushl_m(jit_info->native_ptr, CONST(i));
-                    Parrot_exec_add_text_rellocation(jit_info->objfile,
-                            jit_info->native_ptr, RTYPE_DATA, "const_table", -4);
-                }
-                else
-#endif
-                    emitm_pushl_i(jit_info->native_ptr,
-                            interp->code->const_table->
-                            constants[pi]->u.string);
-                break;
-
-            case PARROT_ARG_KC:
-            case PARROT_ARG_PC:
-#if EXEC_CAPABLE
-                if (jit_info->objfile) {
-                    emitm_pushl_m(jit_info->native_ptr, CONST(i));
-                    Parrot_exec_add_text_rellocation(jit_info->objfile,
-                            jit_info->native_ptr, RTYPE_DATA,
-                            "const_table", -4);
-                }
-                else
-#endif
-                    emitm_pushl_i(jit_info->native_ptr,
-                            interp->code->const_table->
-                            constants[pi]->u.key);
-                break;
-
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, 1,
-                    "jit_vtable_n_op: unimp type %d, arg %d vtable %d",
-                    op_info->types[i - 1], i, nvtable);
-                break;
-        }
-    }
-
-    /* push interpreter */
-    Parrot_jit_emit_get_INTERP(interp, jit_info->native_ptr, emit_ECX);
-    emitm_pushl_r(jit_info->native_ptr, emit_ECX);
-
-    if (L4) {
-        emitm_callr(jit_info->native_ptr, emit_ESI);
-    }
-    else {
-        /* mov (offs)%eax, %eax i.e. $1->vtable */
-        emitm_movl_m_r(interp, jit_info->native_ptr, emit_EAX, emit_EAX, emit_None, 1,
-                offsetof(struct PMC, vtable));
-        /* call *(offset)eax */
-        emitm_callm(jit_info->native_ptr, emit_EAX, emit_None, emit_None, offset);
-    }
-
-    emitm_addb_i_r(jit_info->native_ptr,
-            st + sizeof (void *) * (n + 1), emit_ESP);
-
-    /* L4: */
-    if (L4)
-        L4[1] = (char)(jit_info->native_ptr - L4 - 2);
-}
-
-void
-Parrot_jit_store_retval(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    op_info_t *op_info = &interp->op_info_table[*jit_info->cur_op];
-    int p1 = *(jit_info->cur_op + 1);
-
-    /* return result is in EAX or ST(0) */
-    switch (op_info->types[0]) {
-        case PARROT_ARG_I:
-            emitm_movl_r_m(interp, jit_info->native_ptr,
-                    emit_EAX, emit_EBX, emit_None, 1, REG_OFFS_INT(p1));
-            break;
-        case PARROT_ARG_S:
-            emitm_movl_r_m(interp, jit_info->native_ptr,
-                    emit_EAX, emit_EBX, emit_None, 1, REG_OFFS_STR(p1));
-            break;
-        case PARROT_ARG_P:
-            emitm_movl_r_m(interp, jit_info->native_ptr,
-                    emit_EAX, emit_EBX, emit_None, 1, REG_OFFS_PMC(p1));
-            break;
-        case PARROT_ARG_N:
-            jit_emit_fstore_mb_n(interp, jit_info->native_ptr, emit_EBX,
-                    REG_OFFS_NUM(p1));
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, 1, "jit_vtable1r: ill LHS");
-            break;
-    }
-}
-
-/* emit a call to a vtable func
- * $1->vtable(interp, $1)
- */
-void
-Parrot_jit_vtable1_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    int a[] = { 1 };
-    Parrot_jit_vtable_n_op(jit_info, interp, 1, a);
-}
-
-/* emit a call to a vtable func
- * $1 = $2->vtable(interp, $2)
- */
-void
-Parrot_jit_vtable1r_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    int a[] = { 2 };
-    Parrot_jit_vtable_n_op(jit_info, interp, 1, a);
-    Parrot_jit_store_retval(jit_info, interp);
-}
-
-
-/* emit a call to a vtable func
- * $1 = $2->vtable(interp, $2, $3)
- */
-void
-Parrot_jit_vtable_1r223_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    int a[] = { 2 , 3};
-    Parrot_jit_vtable_n_op(jit_info, interp, 2, a);
-    Parrot_jit_store_retval(jit_info, interp);
-}
-
-/* emit a call to a vtable func
- * $1 = $3->vtable(interp, $3, $2)
- */
-void
-Parrot_jit_vtable_1r332_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    int a[] = { 3 , 2};
-    Parrot_jit_vtable_n_op(jit_info, interp, 2, a);
-    Parrot_jit_store_retval(jit_info, interp);
-}
-/* emit a call to a vtable func
- * $1->vtable(interp, $1, $2)
- */
-void
-Parrot_jit_vtable_112_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    int a[] = { 1, 2 };
-    Parrot_jit_vtable_n_op(jit_info, interp, 2, a);
-}
-
-/* emit a call to a vtable func
- * $1->vtable(interp, $1, $1)
- */
-void
-Parrot_jit_vtable_111_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    int a[] = { 1, 1 };
-    Parrot_jit_vtable_n_op(jit_info, interp, 2, a);
-}
-/* emit a call to a vtable func
- * $2->vtable(interp, $2, $1)
- */
-void
-Parrot_jit_vtable_221_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    int a[] = { 2, 1 };
-    Parrot_jit_vtable_n_op(jit_info, interp, 2, a);
-}
-
-/* emit a call to a vtable func
- * $2->vtable(interp, $2, $3, $1)
- */
-void
-Parrot_jit_vtable_2231_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    int a[] = { 2, 3, 1 };
-    Parrot_jit_vtable_n_op(jit_info, interp, 3, a);
-}
-
-/* emit a call to a vtable func
- * $1->vtable(interp, $1, $2, $3)
- */
-void
-Parrot_jit_vtable_1123_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    int a[] = { 1, 2, 3 };
-    Parrot_jit_vtable_n_op(jit_info, interp, 3, a);
-}
-
-/* emit a call to a vtable func
- * $1->vtable(interp, $1, $2, $1)
- */
-void
-Parrot_jit_vtable_1121_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    int a[] = { 1, 2, 1 };
-    Parrot_jit_vtable_n_op(jit_info, interp, 3, a);
-}
-
-
-/* if_p_ic, unless_p_ic */
-void
-Parrot_jit_vtable_if_unless_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP, int unless)
-{
-    int ic = *(jit_info->cur_op + 2);   /* branch offset */
-
-    /* emit call  vtable function i.e. get_bool, result eax */
-    Parrot_jit_vtable1_op(jit_info, interp);
-    /* test result */
-    jit_emit_test_r_i(jit_info->native_ptr, emit_EAX);
-    jit_emit_jcc(jit_info, unless ? emitm_jz : emitm_jnz, ic);
-}
-
-/* unless_p_ic */
-void
-Parrot_jit_vtable_unlessp_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    Parrot_jit_vtable_if_unless_op(jit_info, interp, 1);
-}
-
-/* if_p_ic */
-void
-Parrot_jit_vtable_ifp_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    Parrot_jit_vtable_if_unless_op(jit_info, interp, 0);
-}
-
-#  define CALL(f) Parrot_exec_add_text_rellocation_func(jit_info->objfile, \
-       jit_info->native_ptr, (f)); \
-       emitm_calll(jit_info->native_ptr, EXEC_CALLDISP);
-
-/* new_p_ic */
-void
-Parrot_jit_vtable_newp_ic_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    int p1, i2;
-    op_info_t *op_info = &interp->op_info_table[*jit_info->cur_op];
-    size_t offset = offsetof(VTABLE, init);
-
-    PARROT_ASSERT(op_info->types[0] == PARROT_ARG_P);
-    p1 = *(jit_info->cur_op + 1);
-    i2 = *(jit_info->cur_op + 2);
-
-    if (i2 <= 0 || i2 >= interp->n_vtable_max)
-        Parrot_ex_throw_from_c_args(interp, NULL, 1,
-            "Illegal PMC enum (%d) in new", i2);
-
-    /* get interpreter */
-    Parrot_jit_emit_get_INTERP(interp, jit_info->native_ptr, emit_ECX);
-
-    /* push pmc enum and interpreter */
-    emitm_pushl_i(jit_info->native_ptr, i2);
-    emitm_pushl_r(jit_info->native_ptr, emit_ECX);
-#if EXEC_CAPABLE
-    if (jit_info->objfile) {
-        CALL("pmc_new_noinit");
-    }
-    else
-#endif
-    {
-        call_func(jit_info, (void (*) (void))pmc_new_noinit);
-    }
-    /* result = eax push pmc */
-    emitm_pushl_r(jit_info->native_ptr, emit_EAX);
-    /* store in PMC too */
-    emitm_movl_r_m(interp, jit_info->native_ptr,
-            emit_EAX, emit_EBX, emit_None, 1, REG_OFFS_PMC(p1));
-    /* push interpreter */
-    Parrot_jit_emit_get_INTERP(interp, jit_info->native_ptr, emit_ECX);
-    emitm_pushl_r(jit_info->native_ptr, emit_ECX);
-    /* mov (offs)%eax, %eax i.e. $1->vtable */
-    emitm_movl_m_r(interp, jit_info->native_ptr, emit_EAX, emit_EAX, emit_None, 1,
-            offsetof(struct PMC, vtable));
-    /* call *(offset)eax */
-    emitm_callm(jit_info->native_ptr, emit_EAX, emit_None, emit_None, offset);
-    /* adjust 4 args pushed */
-    emitm_addb_i_r(jit_info->native_ptr, 16, emit_ESP);
-}
-
-#  undef IREG
-#  undef NREG
-#  undef SREG
-#  undef PREG
-#  undef CONST
-#  undef CALL
-
-#  define NATIVECODE jit_info->native_ptr
-#  define CUR_OPCODE jit_info->cur_op
-#  define CONST(i) PCONST(jit_info->cur_op[(i)])
-
-void
-jit_get_params_pc(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-    PMC *sig_pmc;
-    INTVAL *sig_bits, i, n;
-
-    sig_pmc = CONTEXT(interp)->constants[CUR_OPCODE[1]]->u.key;
-    GETATTR_FixedIntegerArray_int_array(interp, sig_pmc, sig_bits);
-    n = VTABLE_elements(interp, sig_pmc);
-    jit_info->n_args = n;
-    emitm_movl_m_r(interp, NATIVECODE, emit_EAX, emit_EBP, emit_None, 1, 16);
-    for (i = 0; i < n; ++i) {
-        switch (sig_bits[i] & PARROT_ARG_TYPE_MASK) {
-            case PARROT_ARG_INTVAL:
-                emitm_movl_m_r(interp, NATIVECODE, MAP(2+i), emit_EAX, emit_None,
-                        1, 4 + i*4);
-                break;
-            case PARROT_ARG_FLOATVAL:
-                emitm_movl_m_r(interp, NATIVECODE, emit_EAX, emit_EAX, emit_None,
-                        1, 4+ i*4);
-                jit_emit_fload_mb_n(interp, NATIVECODE, emit_EAX, 0);
-                emitm_fstp(NATIVECODE, (MAP(2+i) + 1));
-                if (i < n - 1)
-                    emitm_movl_m_r(interp, NATIVECODE, emit_EAX, emit_EBP,
-                            emit_None, 1, 16);
-                break;
-            default:
-                break;
-        }
-    }
-}
-
-/*
- * preserve registers
- * a) all callee saved on function entry
- */
-void
-jit_save_regs(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-    int i, used_i, save_i;
-    const jit_arch_regs *reg_info;
-
-    used_i = CONTEXT(interp)->n_regs_used[REGNO_INT];
-    reg_info = &jit_info->arch_info->regs[jit_info->code_type];
-    save_i = reg_info->n_preserved_I;
-    for (i = save_i; i < used_i; ++i) {
-        emitm_pushl_r(jit_info->native_ptr, reg_info->map_I[i]);
-    }
-}
-
-/* restore saved regs, see above */
-void
-jit_restore_regs(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-
-    int i, used_i, save_i;
-    const jit_arch_regs *reg_info;
-
-    used_i = CONTEXT(interp)->n_regs_used[REGNO_INT];
-    reg_info = &jit_info->arch_info->regs[jit_info->code_type];
-    save_i = reg_info->n_preserved_I;
-    /* note - reversed order of jit_save_regs  */
-    for (i = used_i - 1; i >= save_i; --i) {
-        emitm_popl_r(jit_info->native_ptr, reg_info->map_I[i]);
-    }
-}
-
-/*
- * preserve registers around a functioncall
- *
- * all used register around a call (skip >= 0 := return result
- *
- * TODO factor out common code
- *      use jit_emit_mov_RM_{in} functions (load/store base indexed)
- *      and a macro to retrieve sp
- */
-int
-jit_save_regs_call(Parrot_jit_info_t *jit_info, PARROT_INTERP, int skip)
-{
-    int i, used_i, used_n;
-    const jit_arch_regs *reg_info;
-
-    used_i = CONTEXT(interp)->n_regs_used[REGNO_INT];
-    used_n = CONTEXT(interp)->n_regs_used[REGNO_NUM];
-    jit_emit_sub_ri_i(interp, jit_info->native_ptr, emit_ESP,
-            (used_i * sizeof (INTVAL) + used_n * sizeof (FLOATVAL)));
-    reg_info = &jit_info->arch_info->regs[jit_info->code_type];
-    for (i = 0; i < used_i; ++i) {
-        /* XXX need 2 skip vars */
-        if (reg_info->map_I[i] == skip)
-            continue;
-        emitm_movl_r_m(interp, NATIVECODE, reg_info->map_I[i], emit_ESP,
-                            emit_None, 1,
-                            (used_n * sizeof (FLOATVAL) +
-                             i      * sizeof (INTVAL)));
-    }
-    for (i = 0; i < used_n; ++i) {
-        if (reg_info->map_F[i] == skip)
-            continue;
-        emitm_fld(NATIVECODE, reg_info->map_F[i]);
-        jit_emit_fstore_mb_n(interp, NATIVECODE, emit_ESP, (i * sizeof (FLOATVAL)));
-    }
-    return used_n;
-}
-
-void
-jit_restore_regs_call(Parrot_jit_info_t *jit_info, PARROT_INTERP,
-        int skip)
-{
-
-    int i, used_i, used_n;
-    const jit_arch_regs *reg_info;
-
-    used_i = CONTEXT(interp)->n_regs_used[REGNO_INT];
-    used_n = CONTEXT(interp)->n_regs_used[REGNO_NUM];
-    reg_info = &jit_info->arch_info->regs[jit_info->code_type];
-
-    for (i = 0; i < used_i; ++i) {
-        if (reg_info->map_I[i] == skip)
-            continue;
-        emitm_movl_m_r(interp, NATIVECODE, reg_info->map_I[i], emit_ESP,
-                            emit_None, 1,
-                            (used_n * sizeof (FLOATVAL) +
-                             i      * sizeof (INTVAL)));
-    }
-    for (i = 0; i < used_n; ++i) {
-        if (reg_info->map_F[i] == skip)
-            continue;
-        jit_emit_fload_mb_n(interp, NATIVECODE, emit_ESP, (i * sizeof (FLOATVAL)));
-        emitm_fstp(NATIVECODE, (1+reg_info->map_F[i]));
-    }
-
-    jit_emit_add_ri_i(interp, jit_info->native_ptr, emit_ESP,
-            (used_i * sizeof (INTVAL) + used_n * sizeof (FLOATVAL)));
-}
-
-void
-jit_set_returns_pc(Parrot_jit_info_t *jit_info, PARROT_INTERP,
-        int recursive)
-{
-    PMC *sig_pmc;
-    INTVAL *sig_bits, sig;
-
-    sig_pmc = CONTEXT(interp)->constants[CUR_OPCODE[1]]->u.key;
-    if (!VTABLE_elements(interp, sig_pmc))
-        return;
-    GETATTR_FixedIntegerArray_int_array(interp, sig_pmc, sig_bits);
-    sig = sig_bits[0];
-    if (!recursive) {
-        /* mov 16(%ebp), %eax - fetch args ptr */
-        emitm_movl_m_r(interp, NATIVECODE, emit_EAX, emit_EBP, emit_None, 1, 16);
-        emitm_movl_m_r(interp, NATIVECODE, emit_EAX, emit_EAX, emit_None, 1, 0);
-    }
-    /*
-     * recursive returns according to ABI */
-    switch (sig & (PARROT_ARG_TYPE_MASK|PARROT_ARG_CONSTANT)) {
-        case PARROT_ARG_INTVAL:
-            if (recursive) {
-                jit_emit_mov_rr_i(NATIVECODE, emit_EAX, MAP(2));
-            }
-            else {
-                emitm_movl_r_m(interp, NATIVECODE, MAP(2), emit_EAX, 0, 1, 0);
-            }
-            break;
-        case PARROT_ARG_INTVAL|PARROT_ARG_CONSTANT:
-            if (recursive) {
-                jit_emit_mov_ri_i(interp, NATIVECODE, emit_EAX, CUR_OPCODE[2]);
-            }
-            else {
-                emitm_movl_i_m(NATIVECODE, CUR_OPCODE[2], emit_EAX, 0, 1, 0);
-            }
-            break;
-        case PARROT_ARG_FLOATVAL:
-            if (recursive) {
-                jit_emit_mov_rr_n(NATIVECODE, FSR1, MAP(2));
-            }
-            else {
-                emitm_fld(NATIVECODE, MAP(2));
-                jit_emit_fstore_mb_n(interp, NATIVECODE, emit_EAX, 0);
-            }
-            break;
-        case PARROT_ARG_FLOATVAL|PARROT_ARG_CONSTANT:
-            if (recursive) {
-                jit_emit_mov_ri_n(interp, NATIVECODE, FSR1, &CONST(2)->u.number);
-            }
-            else {
-                jit_emit_mov_ri_n(interp, NATIVECODE, FSR1, &CONST(2)->u.number);
-                jit_emit_fstore_mb_n(interp, NATIVECODE, emit_EAX, 0);
-            }
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, 1,
-                "set_returns_jit - unknown typ");
-            break;
-    }
-}
-
-void
-jit_set_args_pc(Parrot_jit_info_t *jit_info, PARROT_INTERP,
-        int recursive)
-{
-    PMC *sig_args, *sig_params, *sig_result;
-    INTVAL *sig_bits, sig, i, n;
-    PackFile_Constant ** constants;
-    opcode_t *params, *result;
-    char params_map;
-    int skip, used_n;
-    char collision[16];
-    const jit_arch_regs *reg_info;
-
-    reg_info = &jit_info->arch_info->regs[jit_info->code_type];
-
-    /* create args array */
-    if (!recursive)
-        Parrot_ex_throw_from_c_args(interp, NULL, 1,
-            "set_args_jit - can't do that yet ");
-
-    constants = CONTEXT(interp)->constants;
-    sig_args  = constants[CUR_OPCODE[1]]->u.key;
-
-    if (!VTABLE_elements(interp, sig_args))
-        return;
-    params = jit_info->optimizer->sections->begin;
-    sig_params = constants[params[1]]->u.key;
-    ASSERT_SIG_PMC(sig_params);
-    GETATTR_FixedIntegerArray_int_array(interp, sig_args, sig_bits);
-    n = VTABLE_elements(interp, sig_args);
-    /*
-     * preserve registers - need get_results, because we skip the
-     * return value
-     */
-    result = CUR_OPCODE + 2 + n + 3; /* set_args, set_p_pc */
-    PARROT_ASSERT(*result == PARROT_OP_get_results_pc);
-    sig_result = constants[result[1]]->u.key;
-    ASSERT_SIG_PMC(sig_result);
-
-    if (!VTABLE_elements(interp, sig_result))
-        skip = -1;
-    else
-        skip = MAP(2 + n + 3 + 2);
-    used_n = jit_save_regs_call(jit_info, interp, skip);
-    memset(collision, 0, 16);
-    for (i = 0; i < n; ++i) {
-        sig = sig_bits[i];
-        /* move args to params regs */
-        params_map = jit_info->optimizer->map_branch[2 + i];
-        switch (sig & (PARROT_ARG_TYPE_MASK|PARROT_ARG_CONSTANT)) {
-            case PARROT_ARG_INTVAL:
-                /* if the arg was already set,
-                 * we can't use the src again - fetch from stack
-                 *
-                 * XXX skip
-                 *
-                 * TODO write a general reg_move
-                 */
-                if (collision[(int)MAP(2+i)]) {
-                    int j;
-                    for (j = 0; j < reg_info->n_mapped_I; ++j) {
-                        if (reg_info->map_I[j] == MAP(2+i)) {
-                            emitm_movl_m_r(interp, NATIVECODE, params_map, emit_ESP,
-                                    emit_None, 1,
-                                    (used_n * sizeof (FLOATVAL) +
-                                     j  * sizeof (INTVAL)));
-                            break;
-                        }
-                    }
-                }
-                else {
-                    if (params_map != MAP(2+i)) {
-                        jit_emit_mov_rr_i(NATIVECODE, params_map, MAP(2 + i));
-                    }
-                }
-                collision[(int)params_map] = 1;
-                break;
-            case PARROT_ARG_INTVAL|PARROT_ARG_CONSTANT:
-                /* TODO move constants last */
-                jit_emit_mov_ri_i(interp, NATIVECODE, params_map, CUR_OPCODE[2 + i]);
-                break;
-            case PARROT_ARG_FLOATVAL:
-                if (collision[(int)MAP(2+i)]) {
-                    int j;
-                    for (j = 0; j < reg_info->n_mapped_F; ++j) {
-                        if (reg_info->map_F[j] == MAP(2+i)) {
-                            jit_emit_fload_mb_n(interp, NATIVECODE, emit_ESP,
-                                                (j * sizeof (FLOATVAL)));
-                            emitm_fstp(NATIVECODE, (1+params_map));
-                            break;
-                        }
-                    }
-                }
-                else {
-                    jit_emit_mov_rr_n(NATIVECODE, params_map, MAP(2 + i));
-                }
-                collision[(int)params_map] = 1;
-                break;
-            case PARROT_ARG_FLOATVAL|PARROT_ARG_CONSTANT:
-                jit_emit_mov_ri_n(interp, NATIVECODE, params_map,
-                        &CONST(2 + i)->u.number);
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, 1,
-                    "set_args_jit - unknown type");
-                break;
-        }
-    }
-}
-
-#  undef CONST
-
-void
-Parrot_jit_dofixup(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-    Parrot_jit_fixup_t *fixup, *next;
-    char *fixup_ptr;
-
-    fixup = jit_info->arena.fixups;
-
-    while (fixup) {
-        switch (fixup->type) {
-        /* This fixes-up a branch to a known opcode offset -
-           32-bit displacement only */
-            case JIT_X86BRANCH:
-                fixup_ptr = Parrot_jit_fixup_target(jit_info, fixup) + 2;
-                *(long *)(fixup_ptr) =
-                    jit_info->arena.op_map[fixup->param.opcode].offset
-                        - (fixup->native_offset + 6) + fixup->skip;
-                break;
-            case JIT_X86JUMP:
-                fixup_ptr = Parrot_jit_fixup_target(jit_info, fixup) + 1;
-                *(long *)(fixup_ptr) =
-                    jit_info->arena.op_map[fixup->param.opcode].offset
-                        - (fixup->native_offset + 5) + fixup->skip;
-                break;
-            case JIT_X86CALL:
-                fixup_ptr = jit_info->arena.start + fixup->native_offset + 1;
-                *(long *)(fixup_ptr) = (long)fixup->param.fptr -
-                    (long)fixup_ptr - 4;
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_JIT_ERROR,
-                    "Unknown fixup type:%d\n", fixup->type);
-            break;
-        }
-        next = fixup->next;
-        free(fixup);
-        fixup = next;
-    }
-    jit_info->arena.fixups = NULL;
-}
-
-int control_word = 0x27f;
-
-#ifdef JIT_CGP
-
-/*
- * This is the somewhat complicated program flow
- *
- * JIT code                     prederef code
- * 1) jit_begin
- *    stack_enter
- *    call cgp_core  -->        set stack frame
- *                              jump to retaddr
- *    test EAX, 0    <--        also from HALT
- *    jnz code_start
- *    stack_leave
- *    ret
- * code_start: of JIT code
- *    jit code
- *    ....
- *
- * 2) normal_op
- *    mov prederef_code_ptr, esi
- *    call *(esi)    ---->      prederefed (non JITted code)
- *                              ....
- *    ....           <----      ret
- *    jit_code
- *    ....
- * 3) HALT == jit_end
- *    mov prederefed_op_func[0], esi
- *    jump *esi      ----->     cleanup prederef stack frame
- *                              xor eax,eax ; return 0
- *                              ret (--> after call cgp_core in 1)
- *
- */
-
-void
-Parrot_jit_begin(Parrot_jit_info_t *jit_info,
-                 PARROT_INTERP)
-{
-    jit_emit_stack_frame_enter(jit_info->native_ptr);
-    emitm_fldcw(interp, jit_info->native_ptr, &control_word);
-    emitm_pushl_r(jit_info->native_ptr, emit_EBX);
-    /* get the pc from stack:  mov 12(%ebp), %ebx */
-    emitm_movl_m_r(interp, jit_info->native_ptr, emit_EBX, emit_EBP, emit_None, 1, 12);
-    /* emit cgp_core(1, interp) */
-    /* get the interpreter from stack:  mov 8(%ebp), %eax */
-    emitm_movl_m_r(interp, jit_info->native_ptr, emit_EAX, emit_EBP, emit_None, 1, 8);
-    emitm_pushl_r(jit_info->native_ptr, emit_EAX);
-    /*
-     * TODO define the offset of the interpreter on the stack
-     *      relative to %ebp
-     */
-    emitm_pushl_i(jit_info->native_ptr, 1);
-    /* use EAX as flag, when jumping back on init, EAX==1 */
-    jit_emit_mov_ri_i(interp, jit_info->native_ptr, emit_EAX, 1);
-    if (!jit_info->objfile)
-        call_func(jit_info, (void (*)(void))cgp_core);
-#  if EXEC_CAPABLE
-    else {
-        Parrot_exec_add_text_rellocation_func(jit_info->objfile,
-            jit_info->native_ptr, "cgp_core");
-        emitm_calll(jit_info->native_ptr, EXEC_CALLDISP);
-    }
-#  endif
-    /* when cur_opcode == 1, cgp_core jumps back here
-     * when EAX == 0, the official return from HALT was called */
-    jit_emit_test_r_i(jit_info->native_ptr, emit_EAX);
-    emitm_jxs(jit_info->native_ptr, emitm_jnz, 5);
-    emitm_popl_r(jit_info->native_ptr, emit_EBX);
-    jit_emit_stack_frame_leave(jit_info->native_ptr);
-    emitm_ret(jit_info->native_ptr);
-    /* get PC = ebx to eax, jump there */
-    jit_emit_mov_rr_i(jit_info->native_ptr, emit_EAX, emit_EBX);
-    Parrot_emit_jump_to_eax(jit_info, interp);
-
-/* code_start: */
-}
-
-#else /* JIT_CGP */
-
-void
-Parrot_jit_begin(Parrot_jit_info_t *jit_info,
-                 PARROT_INTERP)
-{
-    /* the generated code gets called as:
-     * (jit_code)(interp, pc)
-     * jumping to pc is the same code as used in Parrot_jit_cpcf_op()
-     */
-
-    /* Maintain the stack frame pointer for the sake of gdb */
-    jit_emit_stack_frame_enter(jit_info->native_ptr);
-    emitm_fldcw(interp, jit_info->native_ptr, &control_word);
-    /* stack:
-     *  12   pc
-     *   8   interpreter
-     *   4   retaddr
-     *   0   ebp <----- ebp
-     *  -4   ebx .. preserved regs
-     *  -8   esi ..
-     * -12   edi ..
-     * -16   interpreter
-     */
-
-    /* Save all callee-saved registers (cdecl)
-     */
-    emitm_pushl_r(jit_info->native_ptr, emit_EBX);
-    emitm_pushl_r(jit_info->native_ptr, emit_ESI);
-    emitm_pushl_r(jit_info->native_ptr, emit_EDI);
-
-    /* Cheat on op function calls by writing the interpreter arg on the stack
-     * just once. If an op function ever modifies the interpreter argument on
-     * the stack this will stop working !!! */
-
-    /* get the interpreter from stack:  mov 8(%ebp), %eax */
-    emitm_movl_m_r(interp, jit_info->native_ptr, emit_EAX, emit_EBP, emit_None, 1, 8);
-    emitm_pushl_r(jit_info->native_ptr, emit_EAX);
-
-    /* get the pc from stack:  mov 12(%ebp), %eax */
-    emitm_movl_m_r(interp, jit_info->native_ptr, emit_EAX, emit_EBP, emit_None, 1, 12);
-
-    /* jump to restart pos or first op */
-    Parrot_emit_jump_to_eax(jit_info, interp);
-}
-
-#endif /* JIT_CGP */
-
-/*
- * create a JITted version of a PIR sub, where everything
- * resided in registers
- *
- * The sub is called as
- *
- *   opcode_t * func(Interp *i, INTVAL *sig_bits, void **args);
- *
- *   args[0] ...    NULL / return value address
- *   args[1..n] ... addresses of n arguments
- *   args[n + 1] .. opcode_t* next - usually just returned
- */
-
-void
-Parrot_jit_begin_sub_regs(Parrot_jit_info_t *jit_info,
-                 PARROT_INTERP)
-{
-    jit_emit_stack_frame_enter(jit_info->native_ptr);
-    /* stack:
-     *  16   args
-     *  12   sig_bits
-     *   8   interpreter
-     *   4   retaddr
-     *   0   ebp <----- ebp
-     * [ -4   ebx .. preserved regs ]
-     * [ -8   edi .. preserved regs ]
-     */
-    /*
-     * check register usage of the subroutine
-     * how many we have to preserve
-     */
-    jit_save_regs(jit_info, interp);
-    /* when it's a recursive sub, we fetch params to registers
-     * and all a inner helper sub, which run with registers only
-     */
-    if (jit_info->flags & JIT_CODE_RECURSIVE) {
-        char * L1;
-        PackFile_Constant ** constants;
-        PMC *sig_result;
-        opcode_t *result;
-
-        jit_get_params_pc(jit_info, interp);
-        /* remember fixup position - call sub */
-        L1 = NATIVECODE;
-        emitm_calll(NATIVECODE, 0);
-        /* check type of return value */
-        constants = CONTEXT(interp)->constants;
-        result = CONTEXT(interp)->current_results;
-        sig_result = constants[result[1]]->u.key;
-        if (!VTABLE_elements(interp, sig_result))
-            goto no_result;
-        /* fetch args to %edx */
-        emitm_movl_m_r(interp, NATIVECODE, emit_EDX, emit_EBP, emit_None, 1, 16);
-        emitm_movl_m_r(interp, NATIVECODE, emit_ECX, emit_EDX, emit_None, 1, 0);
-        if (VTABLE_get_integer_keyed_int(interp, sig_result, 0) ==
-                PARROT_ARG_FLOATVAL) {
-            jit_emit_fst_mb_n(interp, jit_info->native_ptr, emit_ECX, 0);
-        }
-        else {
-            emitm_movl_r_m(interp, NATIVECODE, emit_EAX, emit_ECX, 0, 1, 0);
-        }
-no_result:
-        /* return 0 - no branch */
-        jit_emit_bxor_rr_i(interp, NATIVECODE, emit_EAX, emit_EAX);
-        /* restore pushed callee saved */
-        jit_restore_regs(jit_info, interp);
-        jit_emit_stack_frame_leave(NATIVECODE);
-        emitm_ret(NATIVECODE);
-        /* align the inner sub */
-#if SUB_ALIGN
-        while ((long)jit_info->native_ptr & ((1<<SUB_ALIGN) - 1)) {
-            jit_emit_noop(jit_info->native_ptr);
-        }
-#endif
-        /* fixup call statement */
-        L1[1] = NATIVECODE - L1 - 5;
-    }
-    /* TODO be sure we got a label here in map_branch */
-}
-
-void
-Parrot_jit_begin_sub(Parrot_jit_info_t *jit_info,
-                 PARROT_INTERP)
-{
-}
-
-void
-jit_mov_mr_n_offs(PARROT_INTERP, Parrot_jit_info_t *jit_info,
-        int base_reg, INTVAL offs, int src_reg)
-{
-    emitm_fld(jit_info->native_ptr, src_reg);
-    jit_emit_fstore_mb_n(interp, jit_info->native_ptr, base_reg, offs);
-}
-
-void
-jit_mov_mr_offs(PARROT_INTERP, Parrot_jit_info_t *jit_info,
-        int base_reg, INTVAL offs, int src_reg)
-{
-    emitm_movl_r_m(interp, jit_info->native_ptr,
-            src_reg, base_reg, emit_None, 1, offs);
-}
-
-void
-jit_mov_rm_n_offs(PARROT_INTERP, Parrot_jit_info_t *jit_info,
-        int dst_reg, int base_reg, INTVAL offs)
-{
-    jit_emit_fload_mb_n(interp, jit_info->native_ptr, base_reg,  offs);
-    emitm_fstp(jit_info->native_ptr, (dst_reg+1));
-}
-
-void
-jit_mov_rm_offs(PARROT_INTERP, Parrot_jit_info_t *jit_info,
-        int dst_reg, int base_reg, INTVAL offs)
-{
-    emitm_movl_m_r(interp, jit_info->native_ptr,
-            dst_reg, base_reg, emit_None, 1, offs);
-}
-
-void
-Parrot_jit_emit_finit(Parrot_jit_info_t *jit_info)
-{
-    jit_emit_finit(jit_info->native_ptr);
-}
-
-#ifdef JIT_CGP
-/*
- * XXX needs some fixing
- * s. t/sub/pmc_{8,9}.t: the 2 print in tail call without that 'end'
- *    are recognized as one non JITted block
- */
-void
-Parrot_jit_normal_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    Parrot_jit_optimizer_section_ptr cur_section =
-        jit_info->optimizer->cur_section;
-    int last_is_branch = 0;
-    void ** offset;
-
-    PARROT_ASSERT(op_jit[*jit_info->cur_op].extcall == 1);
-    if (cur_section->done == 1)
-        return;
-    else if (cur_section->done == -1 && --cur_section->ins_count > 0)
-        return;
-    /* check, where section ends
-     */
-    if (interp->op_info_table[*cur_section->end].jump)
-        last_is_branch = 1;
-    else if (cur_section->next && !cur_section->next->isjit)
-        last_is_branch = 1;
-    /* if more then 1 op, then jump to CGP, branches are never
-     * executed in CGP, they are handled below */
-    if (cur_section->done >= 0 &&
-            (INTVAL)cur_section->op_count >= 2 + last_is_branch) {
-        int saved = 0;
-        offset = (jit_info->cur_op - interp->code->base.data) +
-            interp->code->prederef.code;
-
-        jit_emit_mov_ri_i(interp, jit_info->native_ptr, emit_ESI, offset);
-        emitm_callm(jit_info->native_ptr, emit_ESI, 0, 0, 0);
-        /* now patch a B<cpu_ret> opcode after the end of the
-         * prederefed (non JIT) section */
-        if (last_is_branch) {
-            offset = (cur_section->end - interp->code->base.data) +
-                interp->code->prederef.code;
-            cur_section->done = -1;
-            /* ins to skip */
-            cur_section->ins_count = cur_section->op_count - 1;
-        }
-        else {
-            /* There must be a next section: either we have a B<end>
-             * or a JITed branch,
-             * when the branch is non JIT, we are in the above case
-             */
-            offset = (cur_section->next->begin - interp->code->base.data)
-                + interp->code->prederef.code;
-            cur_section->done = 1;
-        }
-        *offset = ((op_func_t*)interp->op_lib->op_func_table)[PARROT_OP_cpu_ret];
-    }
-    else {
-        /* else call normal funtion */
-        emitm_pushl_i(jit_info->native_ptr, interp);
-        emitm_pushl_i(jit_info->native_ptr, jit_info->cur_op);
-        call_func(jit_info,
-            (void (*)(void))interp->op_func_table[*(jit_info->cur_op)]);
-        emitm_addb_i_r(jit_info->native_ptr, 8, emit_ESP);
-        /* when this was a branch, then EAX is now the offset
-         * in the byte_code
-         */
-    }
-}
-
-#else /* JIT_CGP */
-extern int jit_op_count(void);
-
-void
-Parrot_jit_normal_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    int cur_op = *jit_info->cur_op;
-    static int check;
-
-    if (cur_op >= jit_op_count()) {
-        cur_op = CORE_OPS_wrapper__;
-    }
-
-    if ((++check & 0x7) == 0) {
-        /*
-         * every 8 ??? normal ops, we emit a check for event processing
-         */
-
-/*
- * There is an optimization to reuse arguments on the stack.  Compilers may
- * decide to reuse the argument space though.  If you are *absolutely sure*
- * this does not happen define PARROT_JIT_STACK_REUSE_INTERP.
- */
-#  ifdef PARROT_JIT_STACK_REUSE_INTERP
-        /*
-        * op functions have the signature (cur_op, interp)
-        * we use the interpreter already on stack and only push the
-        * cur_op
-        */
-#  else
-        /* push interpreter */
-        Parrot_jit_emit_get_INTERP(interp, jit_info->native_ptr, emit_ECX);
-        emitm_pushl_r(jit_info->native_ptr, emit_ECX);
-#  endif
-
-        emitm_pushl_i(jit_info->native_ptr, CORE_OPS_check_events);
-
-        call_func(jit_info,
-            (void (*) (void)) (interp->op_func_table[CORE_OPS_check_events]));
-#  ifdef PARROT_JIT_STACK_REUSE_INTERP
-        emitm_addb_i_r(jit_info->native_ptr, 4, emit_ESP);
-#  else
-        emitm_addb_i_r(jit_info->native_ptr, 8, emit_ESP);
-#  endif
-    }
-
-#  ifdef PARROT_JIT_STACK_REUSE_INTERP
-    /*
-    * op functions have the signature (cur_op, interp)
-    * we use the interpreter already on stack and only push the
-    * cur_op
-    */
-#  else
-    Parrot_jit_emit_get_INTERP(interp, jit_info->native_ptr, emit_ECX);
-    emitm_pushl_r(jit_info->native_ptr, emit_ECX);
-#  endif
-
-    emitm_pushl_i(jit_info->native_ptr, jit_info->cur_op);
-
-    call_func(jit_info,
-            (void (*) (void))(interp->op_func_table[cur_op]));
-#  ifdef PARROT_JIT_STACK_REUSE_INTERP
-    emitm_addb_i_r(jit_info->native_ptr, 4, emit_ESP);
-#  else
-    emitm_addb_i_r(jit_info->native_ptr, 8, emit_ESP);
-#  endif
-}
-
-#endif /* JIT_CGP */
-
-void
-Parrot_jit_cpcf_op(Parrot_jit_info_t *jit_info,
-                   PARROT_INTERP)
-{
-    Parrot_jit_normal_op(jit_info, interp);
-    Parrot_emit_jump_to_eax(jit_info, interp);
-}
-
-void
-Parrot_jit_restart_op(Parrot_jit_info_t *jit_info,
-                   PARROT_INTERP)
-{
-    char *jmp_ptr, *sav_ptr;
-
-    Parrot_jit_normal_op(jit_info, interp);
-    /* test eax, if zero (e.g after trace), return from JIT */
-    jit_emit_test_r_i(jit_info->native_ptr, emit_EAX);
-    /* remember PC */
-    jmp_ptr = jit_info->native_ptr;
-    /* emit jump past exit code, dummy offset
-     * this assumes exit code is not longer then a short jump (126 bytes) */
-    emitm_jxs(jit_info->native_ptr, emitm_jnz, 0);
-    jit_emit_end(jit_info->native_ptr);
-    /* fixup above jump */
-    sav_ptr = jit_info->native_ptr;
-    jit_info->native_ptr = jmp_ptr;
-    emitm_jxs(jit_info->native_ptr, emitm_jnz, (long)(sav_ptr - jmp_ptr) - 2);
-    /* restore PC */
-    jit_info->native_ptr = sav_ptr;
-    Parrot_emit_jump_to_eax(jit_info, interp);
-}
-
-/*
- * params are put rigth to left on the stack
- * parrot registers are counted left to right
- * so this function returns for a given register type
- * the needed register number
- * TODO handel overflow params
- */
-
-int
-count_regs(PARROT_INTERP, char *sig, char *sig_start)
-{
-    const char *typs[] = {
-        "Ilisc",         /* I */
-        "StbB",          /* S */
-        "pP234",         /* P */
-        "Nfd"            /* N */
-    };
-    int first_reg = 0;
-    int i, found;
-
-    /* char at sig is the type to look at */
-    for (found = -1, i = 0; i < 4; i++) {
-        if (strchr(typs[i], *sig)) {
-            found = i;
-            break;
-        }
-    }
-
-    if (found == -1)
-        Parrot_ex_throw_from_c_args(interp, NULL, 1,
-            "Parrot_jit_build_call_func: sig char not found\n");
-
-    for (--sig; sig > sig_start; --sig) {
-        if (strchr(typs[found], *sig)) {
-            ++first_reg;
-        }
-    }
-    return first_reg;
-}
-
-size_t
-calc_signature_needs(const char *sig, int *strings)
-{
-    size_t stack_size = 0;
-    while (*sig) {
-        switch (*sig) {
-            case 't':
-                (*strings)++;
-                stack_size +=4;
-                break;
-            case 'd':
-                stack_size +=8;
-                break;
-            default:
-                stack_size +=4;
-                break;
-        }
-        sig++;
-    }
-    return stack_size;
-
-}
-
-/*
- * The function generated here is called as func(interp, nci_info)
- * interp   ...  8(%ebp)
- * nci_info ... 12(%ebp)
- *
- * The generate function for a specific signature looks quite similar to
- * an optimized compile of src/nci.c:pcf_x_yy(). In case of any troubles
- * just compare the disassembly.
- *
- * If a non-NULL sizeptr is passed, the integer it points to will be written
- * with the size of the allocated execmem buffer.
- */
-
-void *
-Parrot_jit_build_call_func(PARROT_INTERP, PMC *pmc_nci, STRING *signature, int *sizeptr)
-{
-    Parrot_jit_info_t jit_info;
-    char     *pc;
-    int       i                    = 0;
-    int       arg_count            = 0;
-    int       string_buffer_count  = 0;
-    const int ST_SIZE_OF           = 124;
-    const int JIT_ALLOC_SIZE       = 1024;
-
-    /* skip over the result */
-    char      *sig                = (char *)signature->strstart + 1;
-    size_t     stack_space_needed = calc_signature_needs(sig,
-                                        &string_buffer_count);
-
-    int base_offset        = 0;
-    int strings_offset     = base_offset - (sizeof (char *) * string_buffer_count);
-    int st_offset          = strings_offset - ST_SIZE_OF;
-    int args_offset        = st_offset - stack_space_needed;
-    int temp_calls_offset  = args_offset - 16;
-    int total_stack_needed = -temp_calls_offset;
-
-    /*
-     * ESP
-     * 0-15, 16 bytes for utility calls
-     * stack_space_needed for actual NCI call
-     * st
-     * STRINGS -> char * holding space
-     * EBP
-     */
-
-    /* this ought to be enough - the caller of this function
-     * should free the function pointer returned here
-     */
-    pc = jit_info.native_ptr = jit_info.arena.start = (char *)mem_alloc_executable(JIT_ALLOC_SIZE);
-
-
-    /* this generated jit function will be called as (INTERP (EBP 8), func_ptr
-    * (ESP 12), args signature (ESP 16)) */
-
-    /* make stack frame, preserve %ebx */
-    jit_emit_stack_frame_enter(pc);
-
-    emitm_subl_i_r(pc, total_stack_needed, emit_ESP);
-
-    /* Parrot_init_arg_nci(interp, &st, "S"); */
-    /* args signature "S" */
-    emitm_movl_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, 16);
-    emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 8);
-
-    /*&st*/
-    emitm_lea_m_r(interp,  pc, emit_EAX, emit_EBP, 0, 1, st_offset);
-    emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4);
-
-    /*interpreter*/
-    emitm_movl_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, 8);
-    emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 0);
-
-    if (sig && *sig)
-      emitm_call_cfunc(pc, Parrot_init_arg_nci);
-
-    while (*sig) {
-        emitm_movl_i_m(pc, arg_count, emit_EBP, 0, 1, temp_calls_offset + 8);
-
-        switch (*sig) {
-            case '0':    /* null ptr or such - doesn't consume a reg */
-                jit_emit_bxor_rr_i(interp, pc, emit_EAX, emit_EAX);
-                emitm_movl_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
-                break;
-            case 'f':
-                emitm_call_cfunc(pc, get_nci_N);
-                emitm_fstps(interp, pc, emit_EBP, 0, 1, args_offset);
-                break;
-            case 'N':
-            case 'd':
-                emitm_call_cfunc(pc, get_nci_N);
-                emitm_fstpl(interp, pc, emit_EBP, 0, 1, args_offset);
-                args_offset += 4;
-                break;
-            case 'I':   /* INTVAL */
-            case 'l':   /* long */
-            case 'i':   /* int */
-                emitm_call_cfunc(pc, get_nci_I);
-                emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
-                break;
-            case 't':   /* string, pass a cstring */
-                emitm_call_cfunc(pc, get_nci_S);
-                emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4);
-                emitm_call_cfunc(pc, string_to_cstring_nullable);
-
-                emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
-                /* save off temporary allocation address */
-                emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, strings_offset);
-                strings_offset += 4;
-
-                /* reset ESP(4) */
-                emitm_lea_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, st_offset);
-                emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4);
-                break;
-            case 's':   /* short: movswl intreg_o(base), %eax */
-                emitm_call_cfunc(pc, get_nci_I);
-                emitm_movswl_r_r(pc, emit_EAX, emit_EAX);
-                emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
-                break;
-            case 'c':   /* char: movsbl intreg_o(base), %eax */
-                emitm_call_cfunc(pc, get_nci_I);
-                emitm_movsbl_r_r(pc, emit_EAX, emit_EAX);
-                emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
-                break;
-            case 'J':   /* interpreter */
-                emitm_movl_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, 8);
-                emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
-                arg_count--;
-                break;
-            case 'p':   /* push pmc->data */
-                emitm_call_cfunc(pc, get_nci_P);
-                /* save off PMC* */
-                emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4);
-                /* lookup get_pointer in VTABLE */
-                emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, offsetof(PMC, vtable));
-                emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, offsetof(VTABLE, get_pointer));
-                emitm_callr(pc, emit_EAX);
-                emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
-                /* reset ESP(4) */
-                emitm_lea_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, st_offset);
-                emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4);
-
-                break;
-            case 'O':   /* push PMC * object in P2 */
-            case 'P':   /* push PMC * */
-            case '@':
-                emitm_call_cfunc(pc, get_nci_P);
-#if PARROT_CATCH_NULL
-                /* PMCNULL is a global */
-                jit_emit_cmp_rm_i(pc, emit_EAX, &PMCNULL);
-                emitm_jxs(pc, emitm_jne, 2); /* skip the xor */
-                jit_emit_bxor_rr_i(interp, pc, emit_EAX, emit_EAX);
-#endif
-                emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
-                break;
-            case 'v':
-                break;
-            case 'V':
-                emitm_call_cfunc(pc, get_nci_P);
-                emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4);
-                /* Call the get_pointer VTABLE on the Pointer PMC to get the returned pointer */
-                emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, offsetof(PMC, vtable));
-                emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, offsetof(VTABLE, get_pointer));
-                emitm_callr(pc, emit_EAX);
-                emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
-                break;
-            case 'b':   /* buffer (void*) pass PObj_bufstart(SReg) */
-                emitm_call_cfunc(pc, get_nci_S);
-                emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1,
-                               (size_t) &PObj_bufstart((STRING *) NULL));
-                emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
-                break;
-            case 'B':   /* buffer (void**) pass &PObj_bufstart(SReg) */
-                emitm_call_cfunc(pc, get_nci_S);
-                emitm_lea_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1,
-                              (size_t) &PObj_bufstart((STRING *) NULL));
-                emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
-                break;
-            case 'S':
-                emitm_call_cfunc(pc, get_nci_S);
-                emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
-                break;
-
-
-            /* I have no idea how to handle these */
-            case '2':
-            case '3':
-            case '4':
-                mem_free_executable(jit_info.native_ptr, JIT_ALLOC_SIZE);
-                return NULL;
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_JIT_ERROR,
-                    "Unknown arg Signature %c\n", *sig);
-                /*
-                 * oops unknown signature:
-                 * cleanup and try nci.c
-                 */
-                mem_free_executable(jit_info.native_ptr, JIT_ALLOC_SIZE);
-                return NULL;
-        }
-        args_offset +=4;
-        arg_count++;
-        sig++;
-    }
-
-    /* prepare to call VTABLE_get_pointer, set up args */
-    /* interpreter - movl 8(%ebp), %eax */
-    emitm_movl_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, 8);
-    emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 0);
-
-    /* pmc - movl 12(%ebp), %eax */
-    emitm_movl_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, 12);
-    emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4);
-
-    /* get the get_pointer() pointer from the pmc's vtable */
-    emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, offsetof(PMC, vtable));
-    emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, offsetof(VTABLE, get_pointer));
-
-    /* call get_pointer(), result goes into eax */
-    emitm_callr(pc, emit_EAX);
-    emitm_addl_i_r(pc, 16, emit_ESP);
-
-    /* call the resulting function pointer */
-    emitm_callr(pc, emit_EAX);
-    emitm_subl_i_r(pc, 16, emit_ESP);
-
-    /* SAVE OFF EAX */
-    emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 8);
-
-    /*&st*/
-    emitm_lea_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, st_offset);
-    emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4);
-
-    /*interpreter*/
-    emitm_movl_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, 8);
-    emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 0);
-
-    /* RESTORE BACK EAX */
-    emitm_movl_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 8);
-
-    /* now place return value in registers */
-    /* first in signature is the return value */
-    sig = (char *)signature->strstart; /* the result */
-    switch (*sig) {
-        /* I have no idea how to handle these */
-        case '2':
-        case '3':
-        case '4':
-            /* get integer from pointer - untested */
-            emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, 0);
-            if (*sig == 2)      /* short */
-                emitm_movswl_r_r(pc, emit_EAX, emit_EAX);
-            emitm_call_cfunc(pc, set_nci_I);
-            break;
-        case 'f':
-        case 'd':
-            jit_emit_fstore_mb_n(interp, pc, emit_EBP, temp_calls_offset + 8);
-            emitm_call_cfunc(pc, set_nci_N);
-            /* pop num from st(0) and mov to reg */
-            break;
-        case 's':
-            /* movswl %ax, %eax */
-            emitm_movswl_r_r(pc, emit_EAX, emit_EAX);
-            emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 8);
-            emitm_call_cfunc(pc, set_nci_I);
-            break;
-        case 'c':
-            /* movsbl %al, %eax */
-            emitm_movsbl_r_r(pc, emit_EAX, emit_EAX);
-            emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 8);
-            emitm_call_cfunc(pc, set_nci_I);
-            break;
-        case 'I':   /* INTVAL */
-        case 'l':
-        case 'i':
-            emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 8);
-            emitm_call_cfunc(pc, set_nci_I);
-            break;
-        case 'v': /* void - do nothing */
-            break;
-        case 'P':
-            emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 8);
-            emitm_call_cfunc(pc, set_nci_P);
-            break;
-        case 'p':   /* make a new unmanaged struct */
-            /* save return value on stack */
-
-            /* save pointer p */
-            emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 12);
-
-            /* make new pmc */
-            emitm_movl_i_m(pc, enum_class_UnManagedStruct, emit_EBP, 0, 1, temp_calls_offset + 4);
-            emitm_call_cfunc(pc, pmc_new);
-
-            /* restore pointer p to EDX */
-            emitm_movl_m_r(interp, pc, emit_EDX, emit_EBP, 0, 1, temp_calls_offset + 12);
-
-            /* copy UnManagedStruct to stack for set_nci_P call */
-            emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 8);
-
-            /* eax = PMC, get return value into edx */
-            /* mov data(%eax), %eax
-               mov %edx, ptr(%eax) */
-            emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, offsetof(struct PMC, data));
-            emitm_movl_r_m(interp, pc, emit_EDX, emit_EAX, 0, 1,
-                           offsetof(struct Parrot_UnManagedStruct_attributes, ptr));
-
-            /* reset EBP(4) */
-            emitm_lea_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, st_offset);
-            emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4);
-
-            emitm_call_cfunc(pc, set_nci_P);
-            break;
-        case 'S':
-            emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 8);
-            emitm_call_cfunc(pc, set_nci_S);
-            break;
-        case 't':   /* string */
-            /* EAX is char* */
-            emitm_movl_i_m(pc, 0, emit_EBP, 0, 1, temp_calls_offset + 8); /* len */
-
-            /* overwrites address of st in EBP(4) */
-            emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4);
-
-            emitm_call_cfunc(pc, Parrot_str_new);
-
-            emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 8);
-
-            /* reset EBP(4) */
-            emitm_lea_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, st_offset);
-            emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4);
-
-            emitm_call_cfunc(pc, set_nci_S);
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_JIT_ERROR,
-                "Unknown return Signature %c\n", *sig);
-            /*
-             * oops unknown signature:
-             * cleanup and try nci.c
-             */
-            mem_free_executable(jit_info.native_ptr, JIT_ALLOC_SIZE);
-            return NULL;
-    }
-
-    /* free temporary strings */
-    strings_offset = st_offset + ST_SIZE_OF;
-    for (i=0; i<string_buffer_count; i++) {
-        emitm_movl_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, strings_offset);
-        emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 0);
-        emitm_call_cfunc(pc, Parrot_str_free_cstring);
-        strings_offset += 4;
-    }
-
-    jit_emit_stack_frame_leave(pc);
-    emitm_ret(pc);
-    PARROT_ASSERT(pc - jit_info.arena.start <= JIT_ALLOC_SIZE);
-    /* could shrink arena.start here to used size */
-    PObj_active_destroy_SET(pmc_nci);
-    if (sizeptr)
-        *sizeptr = JIT_ALLOC_SIZE;
-    return (void *)D2FPTR(jit_info.arena.start);
-}
-
-const char i_map[] =
-    { emit_EDI, emit_ESI, emit_EDX, emit_ECX };
-const char floatval_map[] =
-    { 1, 2, 3, 4, 5 };         /* ST(1) .. (ST(4) */
-
-const char i_map_sub[] =
-    { emit_EDX, emit_ECX, emit_EBX, emit_EDI, emit_ESI };
-
-const jit_arch_info arch_info = {
-    jit_mov_rm_offs,
-    jit_mov_rm_n_offs,
-    jit_mov_mr_offs,
-    jit_mov_mr_n_offs,
-    Parrot_jit_dofixup,
-    (jit_arch_f)0,              /* no cache flush needed */
-    {
-        {
-            Parrot_jit_begin,   /* emit code prologue */
-            4,                  /* 4 mapped ints */
-            2,                  /* first 2 are preserved */
-            i_map,
-            4,                  /* 4 mapped float regs */
-            0,                  /* ABI sez it's not preserved */
-            floatval_map
-        },
-        /* unused */
-        {
-            Parrot_jit_begin_sub,   /* emit code prologue */
-            4,                  /* 4 mapped ints */
-            2,                  /* first 2 are *non*preserved */
-            i_map_sub,
-            4,                  /* 4 mapped float regs */
-            0,                  /* ABI sez it's not preserved */
-            floatval_map
-        },
-        /*
-         * compile a sub to registers only
-         * if a mapped count is 0, code containing this register kind
-         * will not be created
-         *
-         * TODO implement FLOATVAL arg passing and set mapped
-         * register count.
-         */
-        {
-            Parrot_jit_begin_sub_regs,   /* emit code prologue */
-            5,                  /* 5 mapped ints */
-            2,                  /* first 2 are *non*preserved */
-            i_map_sub,
-            5,                  /* TODO 0 mapped float regs */
-            5,                  /* ABI sez it's not preserved */
-            floatval_map
-        }
-    }
-};
-
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-const jit_arch_info *
-Parrot_jit_init(PARROT_INTERP)
-{
-    return &arch_info;
-}
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/i386/jit_emit.h
==============================================================================
--- branches/orderedhash_revamp/src/jit/i386/jit_emit.h	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,1912 +0,0 @@
-/*
- * Copyright (C) 2002-2009, Parrot Foundation.
- */
-
-/*
- * jit_emit.h
- *
- * i386
- *
- * $Id$
- */
-
-#ifndef PARROT_I386_JIT_EMIT_H_GUARD
-#define PARROT_I386_JIT_EMIT_H_GUARD
-
-#if defined(__cplusplus)
-#  define EXTERN extern "C"
-#else
-#  define EXTERN
-#endif
-
-#include <assert.h>
-#include "parrot/parrot.h"
-#include "parrot/hash.h"
-#include "parrot/oplib/ops.h"
-
-/* Scale factor values */
-#define emit_Scale(scale) ((scale) << 6)
-#define emit_Scale_1 emit_Scale(0)
-#define emit_Scale_2 emit_Scale(1)
-#define emit_Scale_4 emit_Scale(2)
-#define emit_Scale_8 emit_Scale(3)
-
-/* Scale factor values */
-#define emit_Scale(scale) ((scale) << 6)
-#define emit_Scale_1 emit_Scale(0)
-#define emit_Scale_2 emit_Scale(1)
-#define emit_Scale_4 emit_Scale(2)
-#define emit_Scale_8 emit_Scale(3)
-
-/* ESIB byte */
-#define emit_reg_Index(x) (((x)-1) << 3)
-#define emit_reg_Base(x) ((x)-1)
-#define emit_Index_None ((emit_b100) << 3)
-
-/*
- * helper funcs - get argument n
- */
-INTVAL get_nci_I(PARROT_INTERP, ARGMOD(call_state *st), int n);
-
-FLOATVAL get_nci_N(PARROT_INTERP, ARGMOD(call_state *st), int n);
-;
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-STRING*
-get_nci_S(PARROT_INTERP, ARGMOD(call_state *st), int n);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-PMC*
-get_nci_P(PARROT_INTERP, ARGMOD(call_state *st), int n);
-
-/*
- * set return value
- */
-void set_nci_I(PARROT_INTERP, ARGOUT(call_state *st), INTVAL val);
-
-void set_nci_N(PARROT_INTERP, ARGOUT(call_state *st), FLOATVAL val);
-
-void set_nci_S(PARROT_INTERP, ARGOUT(call_state *st), STRING *val);
-
-void set_nci_P(PARROT_INTERP, ARGOUT(call_state *st), PMC* val);
-
-
-#if defined HAVE_COMPUTED_GOTO && defined __GNUC__ && PARROT_I386_JIT_CGP
-#  define JIT_CGP
-#endif
-
-void call_func(Parrot_jit_info_t *jit_info, void (*addr) (void));
-
-void jit_emit_real_exception(Parrot_jit_info_t *jit_info);
-
-/*
- * get the register frame pointer
- */
-#define Parrot_jit_emit_get_base_reg_no(pc) \
-    emit_EBX
-
-/*
- * get the *runtime* interpreter
- */
-
-#define Parrot_jit_emit_get_INTERP(interp, pc, dest) \
-    emitm_movl_m_r((interp), (pc), (dest), emit_EBP, emit_None, 1, INTERP_BP_OFFS)
-
-/* see jit_begin */
-#ifdef JIT_CGP
-#  define INTERP_BP_OFFS todo
-#else
-#  define INTERP_BP_OFFS -16
-#endif
-
-/*
- * if we have a delegated method like typeof_i_p, that returns an INTVAL
- * and that is all in a sequence of JITted opcodes, and when these INTVAL
- * is MAPped, we got a problem. So the EXT_CALL flag is disabled - mapped
- * registers are saved/restored around vtable calls.
- */
-#define  JIT_VTABLE_OPS 1
-
-/* EXEC_SHARED generates code to be used with libparrot.so
- * It grabs the real address of cgp_core from the gcc generated code
- * x/1i cgp_code
- *     jmp *0xXXXX
- * x/1wx 0xXXXX
- *     real address of cpg_core
- * s. exec_emit_end
- * XXX This should be a command line option.
- */
-#undef EXEC_SHARED
-
-extern UINTVAL ld(UINTVAL);
-
-#define NEG_MINUS_ZERO
-/* #define NEG_ZERO_SUB */
-
-/* Register codes */
-#define emit_None 0
-
-/* These are + 1 the real values */
-#define emit_EAX 1
-#define emit_ECX 2
-#define emit_EDX 3
-#define emit_EBX 4
-#define emit_ESP 5
-#define emit_EBP 6
-#define emit_ESI 7
-#define emit_EDI 8
-
-#define INT_REGISTERS_TO_MAP 4
-
-/* Scratch register. */
-
-#define ISR1 emit_EAX
-#define FSR1 0
-
-#define emit_b00 0
-#define emit_b01 1
-#define emit_b10 2
-#define emit_b11 3
-
-#define emit_b000 0
-#define emit_b001 1
-#define emit_b010 2
-#define emit_b011 3
-#define emit_b100 4
-#define emit_b101 5
-#define emit_b110 6
-#define emit_b111 7
-
-/* Mod R/M byte */
-#define emit_reg(x) ((x) << 3)
-#define emit_Mod(Mod) ((Mod) << 6)
-#define emit_reg_rm(x) ((x)-1)
-
-/* Mod values for Mod R/M Byte */
-#define emit_Mod_b00 emit_Mod(emit_b00)
-#define emit_Mod_b01 emit_Mod(emit_b01)
-#define emit_Mod_b10 emit_Mod(emit_b10)
-
-/* special R/M values */
-#define emit_rm_b101 emit_b101
-#define emit_rm_b100 emit_b100
-
-#define emit_r_m(interp, pc, reg1, b, i, s, d) \
-    emit_r_X((interp), (pc), emit_reg((reg1)-1), (b), (i), (s), (d))
-
-#define emit_alu_X_r(X, reg) ((emit_b11 << 6) | ((X) << 3) | ((reg) - 1))
-
-#define emit_alu_r_r(reg1, reg2) emit_alu_X_r(((reg1) - 1), (reg2))
-
-int emit_is8bit(long disp);
-
-char * emit_disp8_32(char *pc, int disp);
-
-void emit_sib(PARROT_INTERP, char *pc, int scale, int i, int base);
-
-char * emit_r_X(PARROT_INTERP, char *pc, int reg_opcode, int base, int i,
-    int scale, long disp);
-
-char * emit_shift_i_r(PARROT_INTERP, char *pc, int opcode, int imm, int reg);
-
-char * emit_shift_i_m(PARROT_INTERP, char *pc, int opcode, int imm,
-               int base, int i, int scale, long disp);
-
-char * emit_shift_r_r(PARROT_INTERP, char *pc, int opcode, int reg1, int reg2);
-
-char * emit_shift_r_m(PARROT_INTERP, char *pc, int opcode, int reg,
-               int base, int i, int scale, long disp);
-
-/* CDQ - need this to do multiply */
-#define emitm_cdq(pc) *((pc)++) = (char) 0x99
-
-/* RET */
-#define emitm_ret(pc) *((pc)++) = (char) 0xc3
-
-/* NOP */
-#define emit_nop(pc) *((pc)++) = (char) 0x90
-
-/* PUSHes */
-
-#define emitm_pushl_r(pc, reg) \
-    *((pc)++) = (char) 0x50 | ((reg) - 1)
-
-#define emitm_pushl_i(pc, imm) { \
-    *((pc)++) = (char) 0x68; \
-    *(long *)(pc) = (long)(imm); \
-    (pc) += 4; }
-
-#if EXEC_CAPABLE
-#  define emitm_pushl_m(pc, mem) { \
-       *((pc)++) = (char) 0xff; \
-       *((pc)++) = (char) 0x35; \
-       *(long *)(pc) = (long)(mem); \
-       (pc) += 4; }
-#else /* EXEC_CAPABLE */
-#  define emitm_pushl_m(pc, mem) { \
-       *((pc)++) = (char) 0xff; \
-       *((pc)++) = (char) 0x35; \
-       *(long *)(pc) = (long)(mem); \
-       (pc) += 4; }
-#endif /* EXEC_CAPABLE */
-
-char * emit_pushl_m(PARROT_INTERP, char *pc, int base, int i, int scale,
-    long disp);
-
-/* POPs */
-
-char * emit_popl_r(char *pc, int reg);
-
-#  define emitm_popl_r(pc, reg) \
-    (pc) = emit_popl_r((pc), (reg))
-
-char * emit_popl_m(PARROT_INTERP, char *pc, int base, int i, int scale,
-    long disp);
-
-/* MOVes */
-
-char * emit_movb_r_r(char *pc, int reg1, int reg2);
-
-#  define jit_emit_mov_rr_i(pc, reg2, reg1) if ((reg1) != (reg2)) { \
-    *((pc)++) = (char) 0x89; \
-    *((pc)++) = (char) emit_alu_r_r((reg1), (reg2)); }
-
-char * emit_movb_i_r(char *pc, char imm, int reg);
-
-#  define jit_emit_mov_ri_i(interp, pc, reg, imm) { \
-    *((pc)++) = (char)(0xb8 | ((reg) - 1)); \
-    *(long *)(pc) = (long)(imm); (pc) += 4; }
-
-#  define emitm_movX_Y_Z(interp, op, pc, reg1, b, i, s, d) { \
-    *((pc)++) = (char) (op); \
-    (pc) = emit_r_m((interp), (pc), (reg1), (b), (i), (s), (long)(d)); }
-
-#  define emitm_movb_r_m(interp, pc, reg1, b, i, s, d) \
-    emitm_movX_Y_Z((interp), 0x88, (pc), (reg1), (b), (i), (s), (d))
-
-#  define emitm_movl_r_m(interp, pc, reg1, b, i, s, d) \
-    emitm_movX_Y_Z((interp), 0x89, (pc), (reg1), (b), (i), (s), (d))
-
-/* move byte/word with sign extension */
-#  define emitm_movsbl_r_m(interp, pc, reg1, b, i, s, d) { \
-    *((pc)++) = (char) 0x0f; \
-    emitm_movX_Y_Z((interp), 0xBE, (pc), (reg1), (b), (i), (s), (d)); \
-}
-
-#  define emitm_movswl_r_m(interp, pc, reg1, b, i, s, d) { \
-    *((pc)++) = (char) 0x0f; \
-    emitm_movX_Y_Z((interp), 0xBF, (pc), (reg1), (b), (i), (s), (d)); \
-}
-
-#  define emitm_movsbl_r_r(pc, reg1, reg2) { \
-    *((pc)++) = (char) 0x0f; \
-    *((pc)++) = (char) 0xbe; \
-    *((pc)++) = (char) emit_alu_r_r((reg1), (reg2)); \
-}
-
-#  define emitm_movswl_r_r(pc, reg1, reg2) { \
-    *((pc)++) = (char) 0x0f; \
-    *((pc)++) = (char) 0xbf; \
-    *((pc)++) = (char) emit_alu_r_r((reg1), (reg2)); \
-}
-
-#  define emitm_movb_m_r(interp, pc, reg1, b, i, s, d) \
-    emitm_movX_Y_Z((interp), 0x8a, (pc), (reg1), (b), (i), (s), (d))
-
-#  define emitm_movl_m_r(interp, pc, reg1, b, i, s, d) \
-    emitm_movX_Y_Z((interp), 0x8b, (pc), (reg1), (b), (i), (s), (d))
-
-#  define emitm_lea_m_r(interp, pc, reg1, b, i, s, d) \
-    emitm_movX_Y_Z((interp), 0x8d, (pc), (reg1), (b), (i), (s), (d))
-
-char * emit_movb_i_m(PARROT_INTERP, char *pc, char imm, int base, int i,
-    int scale, long disp);
-
-#  define emitm_movl_i_m(pc, imm, b, i, s, d) { \
-    *((pc)++) = (char) 0xc7; \
-    (pc) = emit_r_X((interp), (pc), emit_reg(emit_b000), (b), (i), (s), (long)(d)); \
-    *(long *)(pc) = (long)(imm); (pc) += 4; }
-
-/* Various ALU formats */
-
-#  define emitm_alul_r_r(pc, op, reg1, reg2) { \
-    *((pc)++) = (char) (op); *((pc)++) = (char) emit_alu_r_r((reg1), (reg2)); }
-
-#  define emitm_alub_i_r(pc, op1, op2, imm, reg) { \
-    *((pc)++) = (char) (op1); *((pc)++) = (char) emit_alu_X_r((op2), (reg)); *((pc)++) = (char)(imm); }
-
-#  define emitm_alul_i_r(pc, op1, op2, imm, reg) { \
-    *((pc)++) = (char) (op1); \
-    *((pc)++) = (char) emit_alu_X_r((op2), (reg)); \
-    *(long *)((pc)) = (long)(imm); (pc) += 4; }
-
-#  define emitm_alul_i_m(pc, op1, op2, imm, b, i, s, d) { \
-    *((pc)++) = (char) (op1); \
-    (pc) = emit_r_X((interp), (pc), emit_reg(op2), (b), (i), (s), (d)); \
-    *(long *)(pc) = (long)(imm); (pc) += 4; }
-
-#  define emitm_alul_r_m(pc, op, reg, b, i, s, d) { \
-    *((pc)++) = (char) (op); \
-    (pc) = emit_r_X((interp), (pc), emit_reg((reg)-1), (b), (i), (s), (long)(d)); }
-
-/* ADDs */
-
-#  define emitm_addb_r_r(pc, reg1, reg2) \
-    emitm_alul_r_r((pc), 0x00, (reg1), (reg2))
-
-#  define emitm_addb_i_r(pc, imm, reg) \
-    emitm_alub_i_r((pc), 0x83, emit_b000, (imm), (reg))
-
-#  define jit_emit_add_rr_i(interp, pc, reg1, reg2) \
-    emitm_alul_r_r((pc), 0x01, (reg2), (reg1))
-
-#  define jit_emit_add_ri_i(interp, pc, reg, imm)   \
-    emitm_alul_i_r((pc), 0x81, emit_b000, (imm), (reg))
-
-#  define emitm_addl_i_r(pc, imm, reg)   \
-    emitm_alul_i_r((pc), 0x81, emit_b000, (imm), (reg))
-
-#  define emitm_addl_i_m(pc, imm, b, i, s, d) \
-    emitm_alul_i_m((pc), 0x81, emit_b000, (imm), (b), (i), (s), (d))
-
-#  define emitm_addl_r_m(pc, reg, b, i, s, d) \
-    emitm_alul_r_m((pc), 0x01, (reg), (b), (i), (s), (d))
-
-#  define emitm_addl_m_r(pc, reg, b, i, s, d) \
-    emitm_alul_r_m((pc), 0x03, (reg), (b), (i), (s), (d))
-
-/* SUBs */
-
-#  define jit_emit_sub_rr_i(interp, pc, reg1, reg2) \
-    emitm_alul_r_r((pc), 0x29, (reg2), (reg1))
-
-#  define emitm_subl_i_r(pc, imm, reg) \
-    emitm_alul_i_r((pc), 0x81, emit_b101, (imm), (reg))
-
-#  define jit_emit_sub_ri_i(interp, pc, r, i) emitm_subl_i_r((pc), (i), (r))
-
-#  define emitm_subl_r_m(pc, reg, b, i, s, d) \
-    emitm_alul_r_m((pc), 0x29, (reg), (b), (i), (s), (d))
-
-#  define emitm_subl_m_r(pc, reg, b, i, s, d) \
-    emitm_alul_r_m((pc), 0x2b, (reg), (b), (i), (s), (d))
-
-#  define emitm_subl_i_m(pc, imm, b, i, s, d) \
-    emitm_alul_i_m((pc), 0x81, emit_b101, (imm), (b), (i), (s), (d))
-
-/* These are used by both signed and unsigned EDIV, but only unsigned MUL */
-#  define emitm_alu_imp_r(pc, op, reg) { \
-    *((pc)++) = (char) 0xf7; \
-    *((pc)++) = (char) emit_alu_X_r((op), (reg)); }
-
-#  define emitm_alu_imp_m(pc, op, b, i, s, d) { \
-    *((pc)++) = (char) 0xf7; \
-    (pc) = emit_r_X((interp), (pc), emit_reg(op), (b), (i), (s), (d)); }
-
-/* Unsigned MUL and EDIV */
-/* EAX implicit destination in multiply and divide */
-
-#  define emitm_umull_r(pc, reg2) emitm_alu_imp_r((pc), emit_b100, (reg2))
-
-#  define emitm_udivl_r(pc, reg2) emitm_alu_imp_r((pc), emit_b110, (reg2))
-
-#  define emitm_umull_m(pc, b, i, s, d) \
-    emitm_alu_imp_m((pc), emit_b100, (b), (i), (s), (d))
-
-#  define emitm_udivl_m(pc, b, i, s, d) \
-    emitm_alu_imp_m((pc), emit_b110, (b), (i), (s), (d))
-
-/* Signed MUL and EDIV */
-
-#  define emitm_sdivl_r(pc, reg2) emitm_alu_imp_r((pc), emit_b111, (reg2))
-
-#  define emitm_sdivl_m(pc, b, i, s, d) \
-    emitm_alu_imp_m((pc), emit_b111, (b), (i), (s), (d))
-
-#  define jit_emit_cdq(pc) *(pc)++ = 0x99
-
-/* TEST for zero */
-#  define jit_emit_test_r_i(pc, reg1) emitm_alul_r_r((pc), 0x85, (reg1), (reg1))
-
-#  define emitm_smull_r(pc, reg2) emitm_alu_imp_r((pc), emit_b101, (reg2))
-
-#  define jit_emit_mul_rr_i(interp, pc, reg1, reg2) { \
-    *(pc)++ = 0xf; \
-    emitm_alul_r_r((pc), 0xaf, (reg1), (reg2)); }
-
-#  define emitm_smull_r_m(pc, reg1, b, i, s, d) { \
-    *(pc)++ = 0xf; \
-    emitm_alul_r_m((pc), 0xaf, (reg1), (b), (i), (s), (d)); }
-
-char * opt_mul(PARROT_INTERP, char *pc, int dest, INTVAL imm, int src);
-
-#  define jit_emit_mul_rir_i(pc, dest, imm, src) \
-       (pc) = opt_mul(interp, (pc), (dest), (imm), (src))
-
-
-#  define jit_emit_mul_ri_i(pc, r, imm) jit_emit_mul_rir_i((pc), (r), (imm), (r))
-
-#  define jit_emit_mul_RIM_ii(pc, reg, imm, ofs) \
-    emitm_alul_r_m((pc), 0x69, (reg), emit_EBX, emit_None, 1, (ofs)); \
-    *(long *)(pc) = (long)(imm); \
-    (pc) += 4;
-
-/* NEG */
-
-#  define jit_emit_neg_r_i(pc, reg) emitm_alu_imp_r((pc), emit_b011, (reg))
-
-#  define emitm_negl_m(pc, b, i, s, d) \
-    emitm_alu_imp_m((pc), emit_b011, (b), (i), (s), (d))
-
-/* AND */
-
-#  define emit_andl_r_r(pc, reg1, reg2) emitm_alul_r_r((pc), 0x21, (reg1), (reg2))
-#  define jit_emit_band_rr_i(interp, pc, r1, r2) emit_andl_r_r((pc), (r2), (r1))
-
-#  define jit_emit_band_ri_i(interp, pc, reg, imm)  \
-    emitm_alul_i_r((pc), 0x81, emit_b100, (imm), (reg))
-
-#  define emitm_andl_r_m(pc, reg, b, i, s, d) \
-    emitm_alul_r_m((pc), 0x21, (reg), (b), (i), (s), (d))
-
-#  define emitm_andl_m_r(pc, reg, b, i, s, d) \
-    emitm_alul_r_m((pc), 0x23, (reg), (b), (i), (s), (d))
-
-#  define emitm_andl_i_m(pc, imm, b, i, s, d) \
-    emitm_alul_i_m((pc), 0x81, emit_b100, (imm), (b), (i), (s), (d))
-
-/* TEST op */
-#  define jit_emit_test_rr_i(pc, r1, r2) emitm_alul_r_r((pc), 0x85, (r1), (r2))
-
-#  define jit_emit_test_ri_i(pc, r, im)  \
-           emitm_alul_i_r((pc), 0xF7, emit_b000, (im), (r))
-
-#  define jit_emit_test_RM_i(pc, r, offs)  \
-           emitm_alul_r_m((pc), 0x85, (r), emit_EBX, 0, 1, (offs))
-
-/* OR */
-
-#  define jit_emit_bor_rr_i(interp, pc, reg1, reg2) emitm_alul_r_r((pc), 0x9, (reg2), (reg1))
-
-#  define jit_emit_bor_ri_i(interp, pc, reg, imm) \
-    emitm_alul_i_r((pc), 0x81, emit_b001, (imm), (reg))
-
-#  define emitm_orl_r_m(pc, reg, b, i, s, d) \
-    emitm_alul_r_m((pc), 0x09, (reg), (b), (i), (s), (d))
-
-#  define emitm_orl_m_r(pc, reg, b, i, s, d) \
-    emitm_alul_r_m((pc), 0x0b, (reg), (b), (i), (s), (d))
-
-#  define emitm_orl_i_m(pc, imm, b, i, s, d) \
-    emitm_alul_i_m((pc), 0x81, emit_b001, (imm), (b), (i), (s), (d))
-
-/* XOR */
-
-#  define jit_emit_bxor_rr_i(interp, pc, reg1, reg2) \
-    emitm_alul_r_r((pc), 0x31, (reg2), (reg1))
-
-#  define jit_emit_bxor_ri_i(intepr, pc, reg, imm) \
-    emitm_alul_i_r((pc), 0x81, emit_b110, (imm), (reg))
-
-#  define emitm_xorl_r_m(pc, reg, b, i, s, d) \
-    emitm_alul_r_m((pc), 0x31, (reg), (b), (i), (s), (d))
-
-#  define emitm_xorl_m_r(pc, reg, b, i, s, d) \
-    emitm_alul_r_m((pc), 0x33, (reg), (b), (i), (s), (d))
-
-#  define emitm_xorl_i_m(pc, imm, b, i, s, d) \
-    emitm_alul_i_m((pc), 0x81, emit_b110, (imm), (b), (i), (s), (d))
-
-/* NOT */
-
-#  define jit_emit_not_r_i(pc, reg) emitm_alu_imp_r((pc), emit_b010, (reg))
-#  define emitm_notl_m(pc, b, i, s, d) \
-    emitm_alu_imp_m((pc), emit_b010, (b), (i), (s), (d))
-
-#  define jit_emit_not_M_i(interp, pc, offs) emitm_notl_m((pc), emit_EBX, 0, 1, (offs))
-
-/* XCHG */
-#  define jit_emit_xchg_rr_i(interp, pc, r1, r2) { \
-    if ((r1) != (r2)) { \
-    *((pc)++) = (char) 0x87; \
-    *((pc)++) = (char) emit_alu_r_r((r1), (r2)); \
-    } \
-}
-
-#  define jit_emit_xchg_rm_i(pc, r, m) { \
-    emitm_alul_r_m((pc), 0x87, (r), emit_None, emit_None, emit_None, (m)) \
-}
-#  define jit_emit_xchg_RM_i(interp, pc, r, offs) { \
-    emitm_alul_r_m((pc), 0x87, (r), emit_EBX, emit_None, 1, (offs)) \
-}
-#  define jit_emit_xchg_MR_i(interp, pc, offs, r) jit_emit_xchg_RM_i((interp), (pc), (r), (offs))
-
-/* SHL */
-
-#  define jit_emit_shl_ri_i(interp, pc, reg, imm) \
-    { (pc) = emit_shift_i_r((interp), (pc), emit_b100, (imm), (reg)); }
-
-#  define emitm_shll_i_m(pc, imm, b, i, s, d) \
-    { (pc) = emit_shift_i_m((pc), emit_b100, (imm), (b), (i), (s), (d)); }
-
-#  define emitm_shll_r_r(interp, pc, reg1, reg2) \
-    { (pc) = emit_shift_r_r((interp), (pc), emit_b100, (reg1), (reg2)); }
-
-#  define emitm_shll_r_m(pc, reg, b, i, s, d) \
-    { (pc) = emit_shift_r_m((pc), emit_b100, (reg), (b), (i), (s), (d)); }
-
-/* SHR */
-
-#  define jit_emit_lsr_ri_i(interp, pc, reg, imm) \
-    { (pc) = emit_shift_i_r((interp), (pc), emit_b101, (imm), (reg)); }
-
-#  define emitm_shrl_i_m(pc, imm, b, i, s, d) \
-    { (pc) = emit_shift_i_m((pc), emit_b101, (imm), (b), (i), (s), (d)); }
-
-#  define emitm_shrl_r_r(interp, pc, reg1, reg2) \
-    { (pc) = emit_shift_r_r((interp), (pc), emit_b101, (reg1), (reg2)); }
-
-#  define emitm_shrl_r_m(pc, reg, b, i, s, d) \
-    { (pc) = emit_shift_r_m((pc), emit_b101, (reg), (b), (i), (s), (d)); }
-
-/* SAL */
-
-#  define emitm_sall_i_r(interp, pc, imm, reg) \
-    { (pc) = emit_shift_i_r((interp), (pc), emit_b100, (imm), (reg)); }
-
-#  define emitm_sall_i_m(pc, imm, b, i, s, d) \
-    { (pc) = emit_shift_i_m((pc), emit_b100, (imm), (b), (i), (s), (d)); }
-
-#  define emitm_sall_r_r(interp, pc, reg1, reg2) \
-    { (pc) = emit_shift_r_r((interp), (pc), emit_b100, (reg1), (reg2)); }
-
-#  define emitm_sall_r_m(pc, reg, b, i, s, d) \
-    { (pc) = emit_shift_r_m((pc), emit_b100, (reg), (b), (i), (s), (d)); }
-
-/* SAR */
-
-#  define jit_emit_shr_ri_i(interp, pc, reg, imm) \
-    { (pc) = emit_shift_i_r((interp), (pc), emit_b111, (imm), (reg)); }
-
-
-#  define emitm_sarl_i_m(pc, imm, b, i, s, d) \
-    { (pc) = emit_shift_i_m((pc), emit_b111, (imm), (b), (i), (s), (d)); }
-
-#  define emitm_sarl_r_r(interp, pc, reg1, reg2) \
-    { (pc) = emit_shift_r_r((interp), (pc), emit_b111, (reg1), (reg2)); }
-
-#  define emitm_sarl_r_m(pc, reg, b, i, s, d) \
-    { (pc) = emit_shift_r_m((pc), emit_b111, (reg), (b), (i), (s), (d)); }
-
-/* rotate */
-
-#  define jit_emit_rol_ri_i(interp, pc, reg, imm) \
-    { (pc) = emit_shift_i_r((interp), (pc), emit_b000, (imm), (reg)); }
-
-#  define jit_emit_ror_ri_i(interp, pc, reg, imm) \
-    { (pc) = emit_shift_i_r((interp), (pc), emit_b001, (imm), (reg)); }
-
-int intreg_is_used(Parrot_jit_info_t *jit_info, char reg);
-
-char * opt_shift_rr(PARROT_INTERP, Parrot_jit_info_t *jit_info, int dest,
-    int count, int op);
-
-char * opt_shift_rm(PARROT_INTERP, Parrot_jit_info_t *jit_info, int dest,
-    int offs, int op);
-
-/* interface, shift r1 by r2 bits */
-
-#  define jit_emit_shl_rr_i(interp, pc, r1, r2) \
-    (pc) = opt_shift_rr((interp), jit_info, (r1), (r2), emit_b100)
-
-#  define jit_emit_shl_RM_i(interp, pc, r1, offs)  \
-    (pc) = opt_shift_rm((interp), jit_info, (r1), (offs), emit_b100)
-
-/* shr seems to be the arithmetic shift */
-#  define jit_emit_shr_rr_i(interp, pc, r1, r2)  \
-    (pc) = opt_shift_rr((interp), jit_info, (r1), (r2), emit_b111)
-
-#  define jit_emit_shr_RM_i(interp, pc, r1, offs)  \
-    (pc) = opt_shift_rm((interp), jit_info, (r1), (offs), emit_b111)
-
-#  define jit_emit_lsr_rr_i(interp, pc, r1, r2)  \
-    (pc) = opt_shift_rr((interp), jit_info, (r1), (r2), emit_b101)
-
-#  define jit_emit_lsr_RM_i(interp, pc, r1, offs)  \
-    (pc) = opt_shift_rm((interp), jit_info, (r1), (offs), emit_b101)
-
-/* MOV (reg), reg */
-#  define emit_movm_r_r(pc, src, dest) \
-    *((pc)++) = (char) 0x8b; \
-    *((pc)++) = (char) (src) | (dest) << 3
-
-/* MOV X(reg), reg */
-#  define emit_movb_i_r_r(pc, imm, src, dest) \
-    *((pc)++) = (char)(0x8b); \
-    *((p)c++) = (char)(0x40 | ((src) - 1) | ((dest) - 1) << 3); \
-    *((pc)++) = (imm)
-
-/* INC / DEC */
-#  define jit_emit_inc_r_i(pc, reg) *((pc)++) = (char)(0x40 | ((reg) - 1))
-#  define jit_emit_dec_r_i(pc, reg) *((pc)++) = (char)(0x48 | ((reg) - 1))
-
-/* Floating point ops */
-
-#  define emitm_floatop 0xd8  /* 11011000 */
-#  define jit_emit_dec_fsp(pc) { *((pc)++) = (char) 0xD9; *((pc)++) = (char) 0xF6; }
-#  define jit_emit_inc_fsp(pc) { *((pc)++) = (char) 0xD9; *((pc)++) = (char) 0xF7; }
-
-#  define emitm_fl_2(interp, pc, mf, opa, opb, b, i, s, d) { \
-    *((pc)++) = (char)(emitm_floatop | ((mf) << 1) | (opa)); \
-    (pc) = emit_r_X((interp), (pc), emit_reg(opb), (b), (i), (s), (long)(d)); }
-
-#  define emitm_fl_3(pc, d_p_opa, opb_r, sti) { \
-    *((pc)++) = (char)(emitm_floatop | (d_p_opa)); \
-    *((pc)++) = (char)(0xc0 | ((opb_r) << 3) | (sti)); }
-
-#  define emitm_fl_4(pc, op) { \
-    *((pc)++) = (char)(emitm_floatop | emit_b001); \
-    *((pc)++) = (char)(0xe0 | (op)); }
-
-/* Integer loads and stores */
-#  define emitm_fildl(interp, pc, b, i, s, d) \
-    emitm_fl_2((interp), (pc), emit_b01, 1, emit_b000, (b), (i), (s), (d))
-
-#  define emitm_fistpl(interp, pc, b, i, s, d) \
-    emitm_fl_2((interp), (pc), emit_b01, 1, emit_b011, (b), (i), (s), (d))
-
-#  define emitm_fistl(interp, pc, b, i, s, d) \
-    emitm_fl_2((interp), (pc), emit_b01, 1, emit_b010, (b), (i), (s), (d))
-
-/* long long integer load/store */
-#  define emitm_fildll(interp, pc, b, i, s, d) \
-    emitm_fl_2((interp), (pc), emit_b11, 1, emit_b101, (b), (i), (s), (d))
-
-#  define emitm_fistpll(interp, pc, b, i, s, d) \
-    emitm_fl_2((interp), (pc), emit_b11, 1, emit_b111, (b), (i), (s), (d))
-
-/* Double loads and stores */
-#  define emitm_fldl(interp, pc, b, i, s, d) \
-    emitm_fl_2((interp), (pc), emit_b10, 1, emit_b000, (b), (i), (s), (d))
-
-#  define emitm_fstpl(interp, pc, b, i, s, d) \
-    emitm_fl_2((interp), (pc), emit_b10, 1, emit_b011, (b), (i), (s), (d))
-
-#  define emitm_fstl(interp, pc, b, i, s, d) \
-    emitm_fl_2((interp), (pc), emit_b10, 1, emit_b010, (b), (i), (s), (d))
-
-/* long double load / store */
-#  define emitm_fldt(interp, pc, b, i, s, d) \
-    emitm_fl_2((interp), (pc), emit_b01, 1, emit_b101, (b), (i), (s), (d))
-
-#  define emitm_fstpt(interp, pc, b, i, s, d) \
-    emitm_fl_2((interp), (pc), emit_b01, 1, emit_b111, (b), (i), (s), (d))
-
-/* short float load / store */
-#  define emitm_flds(interp, pc, b, i, s, d) \
-    emitm_fl_2((interp), (pc), emit_b00, 1, emit_b000, (b), (i), (s), (d))
-
-#  define emitm_fstps(interp, pc, b, i, s, d) \
-    emitm_fl_2((interp), (pc), emit_b00, 1, emit_b010, (b), (i), (s), (d))
-
-#if NUMVAL_SIZE == 8
-
-#  define jit_emit_fload_m_n(interp, pc, address) \
-      emitm_fldl((interp), (pc), emit_None, emit_None, emit_None, (address))
-
-#  define jit_emit_fload_mb_n(interp, pc, base, offs) \
-      emitm_fldl((interp), (pc), (base), emit_None, 1, (offs))
-
-#  define jit_emit_fstore_m_n(interp, pc, address) \
-      emitm_fstpl((interp), (pc), emit_None, emit_None, emit_None, (address))
-
-#  define jit_emit_fstore_mb_n(interp, pc, base, offs) \
-      emitm_fstpl((interp), (pc), (base), emit_None, 1, (offs))
-
-#  define jit_emit_fst_mb_n(interp, pc, base, offs) \
-      emitm_fstl((interp), (pc), (base), emit_None, 1, (offs))
-
-#else /* NUMVAL_SIZE */
-
-#  define jit_emit_fload_m_n(interp, pc, address) \
-      emitm_fldt((pc), emit_None, emit_None, emit_None, (address))
-
-#  define jit_emit_fload_mb_n(interp, pc, base, offs) \
-      emitm_fldt((pc), (base), emit_None, 1, (offs))
-
-#  define jit_emit_fstore_m_n(pc, address) \
-      emitm_fstpt((pc), emit_None, emit_None, emit_None, (address))
-
-#  define jit_emit_fstore_mb_n(interp, pc, base, offs) \
-      emitm_fstpt((pc), (base), emit_None, 1, (offs))
-
-#  define jit_emit_fst_mb_n(interp, pc, base, offs) \
-      emitm_fstt((pc), (base), emit_None, 1, (offs))
-
-#endif /* NUMVAL_SIZE */
-
-#if INTVAL_SIZE == 4
-
-#  define jit_emit_fload_m_i(interp, pc, address) \
-      emitm_fildl((interp), (pc), emit_None, emit_None, emit_None, (address))
-#  define jit_emit_fload_mb_i(interp, pc, offs) \
-      emitm_fildl((interp), (pc), emit_EBX, emit_None, 1, (offs))
-#  define jit_emit_fstore_m_i(pc, m) \
-      emitm_fistpl((pc), emit_None, emit_None, emit_None, (m))
-
-#else /* INTVAL_SIZE */
-
-#  define jit_emit_fload_m_i(interp, pc, address) \
-      emitm_fildll((interp), (pc), emit_None, emit_None, emit_None, (address))
-#  define jit_emit_fload_mb_i(interp, pc, offs) \
-      emitm_fildll((interp), (pc), emit_EBX, emit_None, 1, (offs))
-#  define jit_emit_fstore_m_i(pc, m) \
-      emitm_fistpll((pc), emit_None, emit_None, emit_None, (m))
-
-#endif /* INTVAL_SIZE */
-
-/* 0xD8 ops */
-#  define emitm_fadd(pc, sti) emitm_fl_3((pc), emit_b000, emit_b000, (sti))
-#  define emitm_fmul(pc, sti) emitm_fl_3((pc), emit_b000, emit_b001, (sti))
-#  define emitm_fsub(pc, sti) emitm_fl_3((pc), emit_b000, emit_b100, (sti))
-#  define emitm_fdiv(pc, sti) emitm_fl_3((pc), emit_b000, emit_b110, (sti))
-
-/* 0xD9 ops */
-#  define emitm_fldz(pc)  { *((pc)++) = (char) 0xd9; *((pc)++) = (char) 0xee; }
-#  define emitm_fld1(pc)  { *((pc)++) = (char) 0xd9; *((pc)++) = (char) 0xe8; }
-#  define emitm_fsqrt(pc) { *((pc)++) = (char) 0xd9; *((pc)++) = (char) 0xfa; }
-#  define emitm_fsin(pc)  { *((pc)++) = (char) 0xd9; *((pc)++) = (char) 0xfe; }
-#  define emitm_fcos(pc)  { *((pc)++) = (char) 0xd9; *((pc)++) = (char) 0xff; }
-#  define emitm_fxam(pc)  { *((pc)++) = (char) 0xd9; *((pc)++) = (char) 0xe5; }
-
-/* FXCH ST, ST(i) , optimize 2 consecutive fxch with same reg */
-#  define emitm_fxch(pc, sti) { \
-    emitm_fl_3((pc), emit_b001, emit_b001, (sti)); \
-}
-
-/* FLD ST, ST(i), optimized FSTP(N+1);FLD(N) => FST(N+1)  */
-extern unsigned char *lastpc;
-#  define emitm_fld(pc, sti) do { \
-     if ((unsigned char *)(pc) == (lastpc + 2) && \
-       (int)(*lastpc) == (int)0xDD && \
-       (int)lastpc[1] == (int)(0xD8+(sti)+1)) \
-       lastpc[1] = 0xD0+(sti)+1; \
-     else \
-       emitm_fl_3((pc), emit_b001, emit_b000, (sti)); \
-  } while (0)
-
-/* 0xDA, 0xDB ops */
-/* FCMOV*, FCOMI PPRO */
-
-/* 0xDC like 0xD8 with reversed operands */
-#  define emitm_faddr(pc, sti) emitm_fl_3((pc), emit_b100, emit_b000, (sti))
-#  define emitm_fmulr(pc, sti) emitm_fl_3((pc), emit_b100, emit_b001, (sti))
-#  define emitm_fsubr(pc, sti) emitm_fl_3((pc), emit_b100, emit_b100, (sti))
-
-/* 0xDD ops */
-/* FFree ST(i) */
-#  define emitm_ffree(pc, sti) emitm_fl_3((pc), emit_b101, emit_b000, (sti))
-
-/* FST ST(i) = ST */
-#  define emitm_fst(pc, sti) emitm_fl_3((pc), emit_b101, emit_b010, (sti))
-
-/* FSTP ST(i) = ST, POP */
-#  define emitm_fstp(pc, sti) { \
-    lastpc = (unsigned char*) (pc); \
-    emitm_fl_3((pc), emit_b101, emit_b011, (sti)); \
-}
-
-/* FUCOM ST(i) <=> ST  unordered compares */
-#  define emitm_fucom(pc, sti) emitm_fl_3((pc), emit_b101, emit_b100, (sti))
-
-/* FUCOMP ST(i) <=> ST, POP */
-#  define emitm_fucomp(pc, sti) emitm_fl_3((pc), emit_b101, emit_b101, (sti))
-
-/* 0xDE ops */
-/* FADDP Add ST(i) = ST + ST(i); POP  */
-#  define emitm_faddp(pc, sti) emitm_fl_3((pc), emit_b110, emit_b000, (sti))
-
-/* FMULP Mul ST(i) = ST * ST(i); POP  */
-#  define emitm_fmulp(pc, sti) emitm_fl_3((pc), emit_b110, emit_b001, (sti))
-
-/* FSUB ST = ST - ST(i) */
-
-/* FSUBRP SubR ST(i) = ST - ST(i); POP  */
-#  define emitm_fsubrp(pc, sti) emitm_fl_3((pc), emit_b110, emit_b100, (sti))
-
-/* FSUBP Sub ST(i) = ST(i) - ST; POP  */
-#  define emitm_fsubp(pc, sti) emitm_fl_3((pc), emit_b110, emit_b101, (sti))
-
-/* FDIVRP DivR ST(i) = ST(i) / ST(0); POP  */
-#  define emitm_fdivrp(pc, sti) emitm_fl_3((pc), emit_b110, emit_b110, (sti))
-
-/* FDIVP Div ST(i) = ST(0) / ST(i); POP ST(0) */
-#  define emitm_fdivp(pc, sti) emitm_fl_3((pc), emit_b110, emit_b111, (sti))
-
-/* 0xDF OPS: FCOMIP, FUCOMIP PPRO */
-
-/* Negate - called change sign */
-#  define emitm_fchs(pc) emitm_fl_4((pc), 0)
-
-/* ABS - ST(0) = ABS(ST(0)) */
-#  define emitm_fabs(pc) emitm_fl_4((pc), 1)
-
-/* Comparisons */
-
-#  define emitm_fcom(pc, sti) emitm_fl_3((pc), emit_b000, emit_b010, (sti))
-
-#  define emitm_fcomp(pc, sti) emitm_fl_3((pc), emit_b000, emit_b011, (sti))
-
-#ifdef PARROT_HAS_JIT_FCOMIP
-#  define emitm_fcomip(pc, sti) emitm_fl_3((pc), emit_b111, emit_b110, (sti))
-#  define emitm_fcomi(pc, sti) emitm_fl_3((pc), emit_b011, emit_b110, (sti))
-#else
-#  define emitm_fcomip(pc, sti) do { \
-      emitm_fcomp((pc), (sti)); \
-      emitm_fstw(pc); \
-      emitm_sahf(pc); \
-    } while (0)
-#  define emitm_fcomi(pc, sti) do { \
-      emitm_fcom((pc), (sti)); \
-      emitm_fstw(pc); \
-      emitm_sahf(pc); \
-    } while (0)
-#endif
-
-#  define emitm_fcompp(pc) { *((pc)++) = (char) 0xde; *((pc)++) = (char) 0xd9; }
-
-#  define emitm_fcom_m(interp, pc, b, i, s, d) \
-    emitm_fl_2((interp), (pc), emit_b10, 0, emit_b010, (b), (i), (s), (d))
-
-#  define emitm_fcomp_m(interp, pc, b, i, s, d) \
-    emitm_fl_2((interp), (pc), emit_b10, 0, emit_b011, (b), (i), (s), (d))
-
-/* ST -= real64 */
-#  define emitm_fsub_m(interp, pc, b, i, s, d) \
-    emitm_fl_2((interp), (pc), emit_b10, 0, emit_b100, (b), (i), (s), (d))
-
-/* ST -= int32_mem */
-#  define emitm_fisub_m(interp, pc, b, i, s, d) \
-    emitm_fl_2((interp), (pc), emit_b01, 0, emit_b100, (b), (i), (s), (d))
-
-#  define emitm_fadd_m(interp, pc, b, i, s, d) \
-    emitm_fl_2((interp), (pc), emit_b10, 0, emit_b000, (b), (i), (s), (d))
-
-/* ST += int32_mem */
-#  define emitm_fiadd_m(interp, pc, b, i, s, d) \
-    emitm_fl_2((interp), (pc), emit_b01, 0, emit_b000, (b), (i), (s), (d))
-
-/* ST *= real64 */
-#  define emitm_fmul_m(interp, pc, b, i, s, d) \
-    emitm_fl_2((interp), (pc), emit_b10, 0, emit_b001, (b), (i), (s), (d))
-
-/* ST *= int32_mem */
-#  define emitm_fimul_m(interp, pc, b, i, s, d) \
-    emitm_fl_2((interp), (pc), emit_b01, 0, emit_b001, (b), (i), (s), (d))
-
-/* ST /= real64 */
-#  define emitm_fdiv_m(interp, pc, b, i, s, d) \
-    emitm_fl_2((interp), (pc), emit_b10, 0, emit_b110, (b), (i), (s), (d))
-
-/* ST /= int32_mem */
-#  define emitm_fidiv_m(interp, pc, b, i, s, d) \
-    emitm_fl_2((interp), (pc), emit_b01, 0, emit_b110, (b), (i), (s), (d))
-
-/* Ops Needed to support loading EFLAGs for conditional branches */
-#  define emitm_fstw(pc) emitm_fl_3((pc), emit_b111, emit_b100, emit_b000)
-
-#  define emitm_sahf(pc) *((pc)++) = (char) 0x9e
-
-/* misc float */
-#  define emitm_ftst(pc) { *(pc)++ = 0xd9; *(pc)++ = 0xE4; }
-#  define emitm_fprem(pc) { *(pc)++ = 0xd9; *(pc)++ = 0xF8; }
-#  define emitm_fprem1(pc) { *(pc)++ = 0xd9; *(pc)++ = 0xF5; }
-
-#  define emitm_fldcw(interp, pc, mem) \
-    emitm_fl_2((interp), (pc), emit_b00, 1, emit_b101, 0, 0, 0, (mem))
-
-#if defined(NEG_MINUS_ZERO)
-#  define jit_emit_neg_r_n(pc, r) { \
-       if (r) { \
-         emitm_fld((pc), (r)); \
-       } \
-       emitm_fchs(pc); \
-       if (r) { \
-         emitm_fstp((pc), ((r)+1)); \
-       } \
-     }
-
-#  define jit_emit_neg_M_n(interp, pc, mem) { \
-       jit_emit_fload_mb_n((interp), (pc), emit_EBX, (mem)); \
-       emitm_fchs(pc); \
-       jit_emit_fstore_mb_n((interp), (pc), emit_EBX, (mem)); \
-     }
-
-#elif defined(NEG_ZERO_SUB)
-
-#  define jit_emit_neg_r_n(pc, r) { \
-       emitm_fldz(pc); \
-       emitm_fsubrp((pc), ((r)+1)); \
-     }
-
-#  define jit_emit_neg_M_n(interp, pc, mem) { \
-       jit_emit_fload_mb_n((interp), (pc), emit_EBX, (mem)); \
-       emitm_fldz(pc); \
-       emitm_fsubrp((pc), 1); \
-       jit_emit_fstore_mb_n((interp), (pc), emit_EBX, (mem)); \
-     }
-#else
-
-#  define jit_emit_neg_r_n(pc, r) { \
-       if (r) { \
-         emitm_fld((pc), (r)); \
-       } \
-       emitm_ftst(pc); \
-       emitm_fstw(pc); \
-       emitm_sahf(pc); \
-       emitm_jxs((pc), emitm_jz, 2); \
-       emitm_fchs(pc); \
-       if (r) { \
-         emitm_fstp((pc), ((r)+1)); \
-       } \
-     }
-
-#  define jit_emit_neg_M_n(interp, pc, mem) { \
-       jit_emit_fload_mb_n((interp), (pc), emit_EBX, (mem)); \
-       emitm_ftst(pc); \
-       emitm_fstw(pc); \
-       emitm_sahf(pc); \
-       emitm_jxs((pc), emitm_jz, 2); \
-       emitm_fchs(pc); \
-       jit_emit_fstore_mb_n((interp), (pc), emit_EBX, (mem)); \
-     }
-#endif
-
-#  define jit_emit_sin_r_n(pc, r) \
-     if (r) { \
-       emitm_fld((pc), (r)); \
-     } \
-     emitm_fsin(pc); \
-     if (r) { \
-       emitm_fstp((pc), ((r)+1)); \
-     }
-
-#  define jit_emit_cos_r_n(pc, r) \
-     if (r) { \
-       emitm_fld((pc), (r)); \
-     } \
-     emitm_fcos(pc); \
-     if (r) { \
-       emitm_fstp((pc), ((r)+1)); \
-     }
-
-#  define jit_emit_sqrt_r_n(pc, r) \
-     if (r) { \
-       emitm_fld((pc), (r)); \
-     } \
-     emitm_fsqrt(pc); \
-     if (r) { \
-       emitm_fstp((pc), ((r)+1)); \
-     }
-
-#  define jit_emit_abs_r_n(pc, r) { \
-     if (r) { \
-       emitm_fld((pc), (r)); \
-     } \
-     emitm_fabs(pc); \
-     if (r) { \
-       emitm_fstp((pc), ((r)+1)); \
-     } \
-   }
-
-#  define jit_emit_abs_r_i(pc, r) { \
-     jit_emit_test_r_i((pc), (r)); \
-     emitm_jxs((pc), emitm_jns, 3); \
-     jit_emit_not_r_i((pc), (r)); \
-     jit_emit_inc_r_i((pc), (r)); \
-   }
-
-#  define jit_emit_abs_m_n(interp, pc, mem) { \
-     jit_emit_fload_m_n((interp), (pc), (mem)); \
-     emitm_fabs(pc); \
-     jit_emit_fstore_m_n((pc), (mem)); \
-   }
-
-/* Integer comparisons */
-#  define jit_emit_cmp_rr(pc, reg1, reg2) \
-    emitm_alul_r_r((pc), 0x39, (reg2), (reg1))
-#  define jit_emit_cmp_rr_i(pc, r1, r2) jit_emit_cmp_rr((pc), (r1), (r2))
-
-#  define emitm_cmpl_r_m(pc, reg, b, i, s, d) \
-    emitm_alul_r_m((pc), 0x3b, (reg), (b), (i), (s), (d))
-
-#  define emitm_cmpl_m_r(pc, reg, b, i, s, d) \
-    emitm_alul_r_m((pc), 0x39, (reg), (b), (i), (s), (d))
-
-#  define jit_emit_cmp_ri_i(interp, pc, reg, imm) \
-    emitm_alul_i_r((pc), 0x81, emit_b111, (imm), (reg))
-
-/* Unconditional Jump/Call */
-
-#  define emitm_call_cfunc(pc, func) emitm_calll((pc), (char *)(func) - (pc) - 4)
-
-#  define emitm_calll(pc, disp) { \
-    *((pc)++) = (char) 0xe8; \
-    *(long *)(pc) = (disp); (pc) += 4; }
-
-#  define emitm_callr(pc, reg) { \
-    *((pc)++) = (char) 0xff; \
-    *((pc)++) = (char) 0xd0 | ((reg) - 1); }
-
-#if EXEC_CAPABLE
-#  define emitm_callm(pc, b, i, s, d) { \
-       *((pc)++) = (char) 0xff; \
-       (pc) = emit_r_X((interp), (pc), emit_reg(emit_b010), (b), (i), (s), (d));\
-       }
-#else /* EXEC_CAPABLE */
-#  define emitm_callm(pc, b, i, s, d) { \
-       *((pc)++) = (char) 0xff; \
-       (pc) = emit_r_X((interp), (pc), emit_reg(emit_b010), (b), (i), (s), (d)); }
-#endif /* EXEC_CAPABLE */
-
-#  define emitm_jumps(pc, disp) { \
-    *((pc)++) = (char) 0xeb; \
-    *((pc)++) = (disp); }
-
-#  define emitm_jumpl(pc, disp) { \
-    *((pc)++) = (char) 0xe9; \
-    *(long *)(pc) = (disp); (pc) += 4; }
-
-#  define emitm_jumpr(pc, reg) { \
-    *((pc)++) = (char) 0xff; \
-    *((pc)++) = (char)(0xe0 | ((reg) - 1)); }
-
-#if EXEC_CAPABLE
-#  define emitm_jumpm(pc, b, i, s, d) { \
-       *((pc)++) = (char) 0xff; \
-       (pc) = emit_r_X((interp), (pc), emit_reg(emit_b100), (b), (i), (s), (d)); \
-       }
-#else /* EXEC_CAPABLE */
-#  define emitm_jumpm(pc, b, i, s, d) { \
-       *((pc)++) = (char) 0xff; \
-       (pc) = emit_r_X((interp), (pc), emit_reg(emit_b100), (b), (i), (s), (d)); }
-#endif /* EXEC_CAPABLE */
-
-/* Conditional jumps */
-
-/* Short jump - 8 bit disp */
-#  define emitm_jxs(pc, code, disp) { \
-    *((pc)++) = (char)(0x70 | (code)); \
-    *((pc)++) = (char)(disp); }
-
-/* Long jump - 32 bit disp */
-#  define emitm_jxl(pc, code, disp) { \
-    *((pc)++) = (char) 0x0f; \
-    *((pc)++) = (char)(0x80 | (code));  \
-    *(long *)(pc) = (disp); (pc) += 4; }
-
-#  define emitm_jo   0
-#  define emitm_jno  1
-#  define emitm_jb   2
-#  define emitm_jnb  3
-#  define emitm_jz   4
-#  define emitm_je emitm_jz
-#  define emitm_jnz  5
-#  define emitm_jne emitm_jnz
-#  define emitm_jbe  6
-#  define emitm_ja   7
-#  define emitm_js   8
-#  define emitm_jns  9
-#  define emitm_jp  10
-#  define emitm_jnp 11
-#  define emitm_jl  12
-#  define emitm_jnl 13
-#  define emitm_jle 14
-#  define emitm_jg  15
-
-/* set byte conditional */
-#  define jit_emit_setcc_r(pc, cc, r) \
-    *(pc)++ = 0x0f; \
-    *(pc)++ = 0x90 + (cc); \
-    *(pc)++ = (char) emit_alu_X_r(0, (r))
-
-/*
- * core.jit interface
- *
- * The new offset based versions have uppercase RM or MR inside
- * That's probably only during transition time
- */
-
-#  define jit_emit_mov_mi_i(pc, dest, immediate) \
-    emitm_movl_i_m((pc), (immediate), emit_None, emit_None, emit_None, (dest))
-
-#  define jit_emit_mov_MI_i(interp, pc, offs, immediate) \
-    emitm_movl_i_m((pc), (immediate), emit_EBX, emit_None, 1, (offs))
-
-#  define jit_emit_mov_rm_i(interp, pc, reg, address) \
-    emitm_movl_m_r((interp), (pc), (reg), emit_None, emit_None, emit_None, (address))
-
-#  define jit_emit_mov_RM_i(interp, pc, reg, offs) \
-    emitm_movl_m_r((interp), (pc), (reg), emit_EBX, emit_None, 1, (offs))
-
-#  define jit_emit_mov_mr_i(interp, pc, address, reg) \
-    emitm_movl_r_m((interp), (pc), (reg), emit_None, emit_None, emit_None, (address))
-
-#  define jit_emit_mov_MR_i(interp, pc, offs, reg) \
-    emitm_movl_r_m((interp), (pc), (reg), emit_EBX, emit_None, 1, (offs))
-
-#  define jit_emit_mul_RM_i(interp, pc, reg, offs) \
-    emitm_smull_r_m((pc), (reg), emit_EBX, emit_None, 1, (offs))
-
-#  define jit_emit_sub_RM_i(interp, pc, reg, offs) \
-    emitm_subl_m_r((pc), (reg), emit_EBX, emit_None, 1, (offs))
-
-#  define jit_emit_sub_MR_i(interp, pc, offs, reg) \
-    emitm_subl_r_m((pc), (reg), emit_EBX, emit_None, 1, (offs))
-
-#  define jit_emit_sub_MI_i(pc, offs, imm) \
-    emitm_subl_i_m((pc), (imm), emit_EBX, emit_None, 1, (offs))
-
-#  define jit_emit_add_RM_i(interp, pc, reg, offs) \
-    emitm_addl_m_r((pc), (reg), emit_EBX, emit_None, 1, (offs))
-
-#  define jit_emit_add_MR_i(interp, pc, offs, reg) \
-    emitm_addl_r_m((pc), (reg), emit_EBX, emit_None, 1, (offs))
-
-#  define jit_emit_add_MI_i(pc, offs, imm) \
-    emitm_addl_i_m((pc), (imm), emit_EBX, emit_None, 1, (offs))
-
-#  define jit_emit_cmp_rm_i(pc, reg, address) \
-    emitm_cmpl_r_m((pc), (reg), emit_None, emit_None, emit_None, (address))
-
-#  define jit_emit_cmp_RM_i(interp, pc, reg, offs) \
-    emitm_cmpl_r_m((pc), (reg), emit_EBX, emit_None, 1, (offs))
-
-#  define jit_emit_cmp_MR_i(interp, pc, offs, reg) \
-    emitm_cmpl_m_r((pc), (reg), emit_EBX, emit_None, 1, (offs))
-
-/* high level routines, behave like real 2 register FP */
-
-/* mapped float registers numbers are ST(1)-ST(4).
- * scratch register is ST(0)
- */
-
-/* ST(i) <- numvar */
-#  define jit_emit_mov_RM_n(interp, pc, r, d) { \
-    jit_emit_fload_mb_n((interp), (pc), emit_EBX, (d)); \
-    emitm_fstp((pc), ((r)+1)); \
-}
-
-/* ST(i) <= NUM_CONST */
-#  define jit_emit_mov_ri_n(interp, pc, r, i) { \
-    jit_emit_fload_m_n((interp), (pc), (i)); \
-    emitm_fstp((pc), ((r)+1)); \
-}
-
-/* ST(i) <= &INT_CONST */
-#  define jit_emit_mov_ri_ni(interp, pc, r, i) { \
-    jit_emit_fload_m_i((interp), (pc), (i)); \
-    emitm_fstp((pc), ((r)+1)); \
-}
-
-/* ST(i) <= INT_REG */
-#  define jit_emit_mov_RM_ni(interp, pc, r, i) { \
-    jit_emit_fload_mb_i((interp), (pc), (i)); \
-    emitm_fstp((pc), ((r)+1)); \
-}
-
-/* NUM_REG(i) <= &INT_CONST
- * the int const i is loaded from the code memory
- */
-#  define jit_emit_mov_MI_ni(interp, pc, offs, i) { \
-    jit_emit_fload_m_i((interp), (pc), (i)); \
-    jit_emit_fstore_mb_n((interp), (pc), emit_EBX, (offs)); \
-}
-
-/* INT_REG <= ST(i) */
-#  define jit_emit_mov_mr_in(pc, mem, r) { \
-    emitm_fld((pc), (r)); \
-    jit_emit_fstore_m_i((pc), (mem)); \
-}
-
-/* numvar <- ST(i) */
-#  define jit_emit_mov_mr_n(pc, d, r) { \
-    emitm_fld((pc), (r)); \
-    jit_emit_fstore_m_n((pc), (d)); \
-}
-
-#  define jit_emit_mov_MR_n(interp, pc, d, r) { \
-    if (r) { \
-        emitm_fld((pc), (r)); \
-        jit_emit_fstore_mb_n((interp), (pc), emit_EBX, (d)); \
-    } \
-    else { \
-        jit_emit_fst_mb_n((interp), (pc), emit_EBX, (d)); \
-    } \
-}
-
-/* ST(r1) <= ST(r2) */
-#  define jit_emit_mov_rr_n(pc, r1, r2) { \
-    if ((r1) != (r2)) { \
-      if (r2) { \
-        emitm_fld((pc), (r2)); \
-        emitm_fstp((pc), ((r1)+1)); \
-      } \
-      else { \
-        emitm_fst((pc), (r1)); \
-      } \
-    } \
-}
-
-/* ST(r1) xchg ST(r2) */
-#  define jit_emit_xchg_rr_n(interp, pc, r1, r2) { \
-    if ((r1) != (r2)) { \
-      emitm_fld((pc), (r1)); \
-      emitm_fld((pc), ((r2)+1)); \
-      emitm_fstp((pc), ((r1)+2)); \
-      emitm_fstp((pc), ((r2)+1)); \
-    } \
-}
-
-#  define jit_emit_xchg_RM_n(interp, pc, r, offs) { \
-    emitm_fld((pc), (r)); \
-    jit_emit_fload_mb_n((interp), (pc), emit_EBX, (offs)); \
-    emitm_fstp((pc), ((r)+2)); \
-    jit_emit_fstore_mb_n((interp), (pc), emit_EBX, (offs)); \
-}
-
-#  define jit_emit_xchg_MR_n(interp, pc, offs, r) { \
-    emitm_fld((pc), (r)); \
-    jit_emit_fload_mb_n((interp), (pc), emit_EBX, (offs)); \
-    emitm_fstp((pc), ((r)+2)); \
-    jit_emit_fstore_mb_n((interp), (pc), emit_EBX, (offs)); \
-}
-
-#  define jit_emit_finit(pc) { *((pc)++) = (char) 0xdb; *((pc)++) = (char) 0xe3; }
-
-/* ST(i) op= MEM */
-
-#  define jit_emit_xxx_rm_n(interp, op, pc, r, m) { \
-    jit_emit_fload_m_n((interp), (pc), (m)); \
-    emitm_f ## op ## p((pc), ((r)+1)); \
-}
-
-#  define jit_emit_xxx_RM_n(interp, op, pc, r, offs) { \
-    jit_emit_fload_mb_n((interp), (pc), emit_EBX, (offs)); \
-    emitm_f ## op ## p((pc), ((r)+1)); \
-}
-
-/*
- * float ops in two flavors: abs memory for constants, offsets for regs
- */
-
-#  define jit_emit_add_ri_n(interp, pc, r, m) jit_emit_xxx_rm_n((interp), add, (pc), (r), (m))
-#  define jit_emit_sub_ri_n(interp, pc, r, m) jit_emit_xxx_rm_n((interp), sub, (pc), (r), (m))
-#  define jit_emit_mul_ri_n(interp, pc, r, m) jit_emit_xxx_rm_n((interp), mul, (pc), (r), (m))
-
-#  define jit_emit_add_RM_n(interp, pc, r, o) jit_emit_xxx_RM_n((interp), add, (pc), (r), (o))
-#  define jit_emit_sub_RM_n(interp, pc, r, o) jit_emit_xxx_RM_n((interp), sub, (pc), (r), (o))
-#  define jit_emit_mul_RM_n(interp, pc, r, o) jit_emit_xxx_RM_n((interp), mul, (pc), (r), (o))
-
-/* ST(r1) += ST(r2) */
-/* r1 == 0:  ST(0) <- ST(0) + ST(i)
- * r2 == 0:  ST(i) <- ST(0) + ST(i)
- */
-#  define jit_emit_add_rr_n(interp, pc, r1, r2) do { \
-        if (!(r1)) { \
-          emitm_fadd((pc), (r2)); \
-        }  \
-        else if (!(r2)) { \
-          emitm_faddr((pc), (r1)); \
-        }  \
-        else { \
-            emitm_fld((pc), (r2)); \
-            emitm_faddp((pc), ((r1)+1)); \
-        } \
-    } \
-    while (0)
-/*
- * ST(r) += INT_REG
- */
-#  define jit_emit_add_RM_ni(pc, r, offs) { \
-    emitm_fld((pc), (r)); \
-    emitm_fiadd_m((pc), emit_EBX, 0, 1, (offs)); \
-    emitm_fstp((pc), ((r)+1)); \
-}
-
-/* ST(r1) -= ST(r2) */
-/* r1 == 0:  ST(0) <- ST(0) - ST(i)
- * r2 == 0:  ST(i) <- ST(i) - ST(0)
- */
-#  define jit_emit_sub_rr_n(interp, pc, r1, r2) do { \
-        if (!(r1)) { \
-          emitm_fsub((pc), (r2)); \
-        }  \
-        else if (!(r2)) { \
-          emitm_fsubr((pc), (r1)); \
-        }  \
-        else { \
-            emitm_fld((pc), (r2)); \
-            emitm_fsubp((pc), ((r1)+1)); \
-        } \
-    } \
-    while (0)
-
-/*
- * ST(r) -= INT_REG
- */
-#  define jit_emit_sub_RM_ni(pc, r, offs) { \
-    emitm_fld((pc), (r)); \
-    emitm_fisub_m((pc), emit_EBX, 0, 1, (offs)); \
-    emitm_fstp((pc), ((r)+1)); \
-}
-
-#  define jit_emit_inc_r_n(pc, r) { \
-    emitm_fld1(pc); \
-    emitm_faddp((pc), ((r)+1)); \
-}
-
-#  define jit_emit_dec_r_n(pc, r) { \
-    emitm_fld1(pc); \
-    emitm_fsubp((pc), ((r)+1)); \
-}
-
-/* ST(r1) *= ST(r2) */
-/* r1 == 0:  ST(0) <- ST(0) * ST(i)
- * r2 == 0:  ST(i) <- ST(0) * ST(i)
- */
-#  define jit_emit_mul_rr_n(interp, pc, r1, r2) do { \
-        if (!(r1)) { \
-          emitm_fmul((pc), (r2)); \
-        }  \
-        else if (!(r2)) { \
-          emitm_fmulr((pc), (r1)); \
-        }  \
-        else { \
-            emitm_fld((pc), (r2)); \
-            emitm_fmulp((pc), ((r1)+1)); \
-        } \
-    } \
-    while (0)
-
-/*
- * ST(r) *= INT_REG
- */
-#  define jit_emit_mul_RM_ni(pc, r, offs) { \
-    emitm_fld((pc), (r)); \
-    emitm_fimul_m((pc), emit_EBX, 0, 1, (offs)); \
-    emitm_fstp((pc), ((r)+1)); \
-}
-
-/*
- * ST(r) /= INT_REG
- */
-#  define jit_emit_div_RM_ni(pc, r, offs) { \
-    emitm_fld((pc), (r)); \
-    emitm_fidiv_m((pc), emit_EBX, 0, 1, (offs)); \
-    emitm_fstp((pc), ((r)+1)); \
-}
-
-/* test r for zero */
-#  define jit_emit_test_r_n(pc, r) { \
-    if (r) { \
-      emitm_fxch((pc), (r)); \
-    } \
-    emitm_fxam(pc); \
-    emitm_fstw(pc); \
-    emitm_sahf(pc); \
-    if (r) { \
-      emitm_fxch((pc), (r)); \
-    } \
-}
-
-/* ST(r1) /= ST(r2) */
-char * div_rr_n(PARROT_INTERP, Parrot_jit_info_t *jit_info, int r1);
-
-#  define jit_emit_div_rr_n(interp, pc, r1, r2) \
-    emitm_fld((pc), (r2)); \
-    jit_info->native_ptr = (pc); \
-    (pc) = div_rr_n((interp), jit_info, (r1))
-
-#  define jit_emit_div_ri_n(interp, pc, r, m) \
-    jit_emit_fload_m_n((interp), (pc), (m)); \
-    jit_info->native_ptr = (pc); \
-    (pc) = div_rr_n((interp), jit_info, (r))
-
-#  define jit_emit_div_RM_n(interp, pc, r, o) \
-    jit_emit_fload_mb_n((interp), (pc), emit_EBX, (o)); \
-    jit_info->native_ptr = (pc); \
-    (pc) = div_rr_n((interp), jit_info, (r))
-
-char * mod_rr_n(PARROT_INTERP, Parrot_jit_info_t *jit_info, int r);
-
-/* ST(i) %= MEM
- * please note the hardcoded jumps */
-#  define jit_emit_cmod_RM_n(interp, pc, r, offs)  \
-    if (r)  \
-      emitm_fxch((pc), (r)); \
-    jit_emit_fload_mb_n((interp), (pc), emit_EBX, (offs)); \
-    (pc) = mod_rr_n((interp), jit_info, (r))
-
-#  define jit_emit_cmod_ri_n(interp, pc, r, mem)  \
-    if (r)  \
-      emitm_fxch((pc), (r)); \
-    jit_emit_fload_m_n((interp), (pc), (mem)); \
-    (pc) = mod_rr_n((interp), jit_info, (r))
-
-/* ST(r1) %= ST(r2) */
-#  define jit_emit_cmod_rr_n(interp, pc, r1, r2)  \
-    if (r1)  \
-      emitm_fxch((pc), (r1)); \
-    emitm_fld((pc), (r2)); \
-    (pc) = mod_rr_n((interp), jit_info, (r1))
-
-/* compare ST(r) <-> mem i.e. constant */
-#  define jit_emit_cmp_ri_n(interp, pc, r, mem) { \
-    jit_emit_fload_m_n((interp), (pc), (mem)); \
-    emitm_fld((pc), ((r)+1)); \
-    emitm_fcompp(pc); \
-    emitm_fstw(pc); \
-    emitm_sahf(pc); \
-}
-
-#  define jit_emit_cmp_RM_n(interp, pc, r, offs) { \
-    jit_emit_fload_mb_n((interp), (pc), emit_EBX, (offs)); \
-    emitm_fld((pc), ((r)+1)); \
-    emitm_fcompp(pc); \
-    emitm_fstw(pc); \
-    emitm_sahf(pc); \
-}
-
-/* compare mem <-> ST(r) */
-#  define jit_emit_cmp_mi_n(interp, pc, mem, r) { \
-    jit_emit_fload_m_n((interp), (pc), (mem)); \
-    emitm_fcomip((pc), ((r)+1)); \
-}
-
-#  define jit_emit_cmp_MR_n(interp, pc, offs, r) { \
-    jit_emit_fload_mb_n((interp), (pc), emit_EBX, (offs)); \
-    emitm_fcomip((pc), ((r)+1)); \
-}
-
-/* compare ST(r1) <-> ST(r2) test FCOMI (=fcom, fstw, sahf) */
-#  define jit_emit_cmp_rr_n(pc, r1, r2) { \
-    if (!(r2) || ((r1)==(r2))) { \
-      emitm_fld((pc), (r1)); \
-      emitm_fcomip((pc), ((r2)+1)); \
-    } \
-    else { \
-      if (r1) { \
-        emitm_fxch((pc), (r1)); \
-        emitm_fcomi((pc), (r2)); \
-        emitm_fxch((pc), (r1)); \
-      } \
-      else { \
-        emitm_fcomi((pc), (r2)); \
-      } \
-    } \
-}
-
-#  define jit_emit_neg_M_i(interp, pc, offs) \
-    emitm_negl_m((pc), emit_EBX, emit_None, 1, (long)(offs))
-
-#  define jit_emit_band_MR_i(interp, pc, offs, reg) \
-    emitm_andl_r_m((pc), (reg), emit_EBX, emit_None, 1, (offs))
-
-#  define jit_emit_band_RM_i(interp, pc, reg, offs) \
-    emitm_andl_m_r((pc), (reg), emit_EBX, emit_None, 1, (offs))
-
-#  define jit_emit_band_MI_i(pc, offs, imm) \
-    emitm_andl_i_m((pc), (imm), emit_EBX, emit_None, 1, (offs))
-
-#  define jit_emit_bor_MR_i(interp, pc, offs, reg) \
-    emitm_orl_r_m((pc), (reg), emit_EBX, emit_None, 1, (offs))
-
-#  define jit_emit_bor_RM_i(interp, pc, reg, offs) \
-    emitm_orl_m_r((pc), (reg), emit_EBX, emit_None, 1, (offs))
-
-#  define jit_emit_bor_MI_i(pc, offs, imm) \
-    emitm_orl_i_m((pc), (imm), emit_EBX, emit_None, 1, (offs))
-
-#  define jit_emit_bxor_MR_i(interp, pc, offs, reg) \
-    emitm_xorl_r_m((pc), (reg), emit_EBX, emit_None, 1, (offs))
-
-#  define jit_emit_bxor_RM_i(interp, pc, reg, offs) \
-    emitm_xorl_m_r((pc), (reg), emit_EBX, emit_None, 1, (offs))
-
-#  define jit_emit_bxor_MI_i(pc, offs, imm) \
-    emitm_xorl_i_m((pc), (imm), emit_EBX, emit_None, 1, (offs))
-
-/* dest /= src
- * edx:eax /= src, quotient => eax, rem => edx
- */
-char * opt_div_rr(PARROT_INTERP, Parrot_jit_info_t *jit_info, int dest,
-    int src, int is_div);
-
-#  define jit_emit_div_rr_i(interp, pc, r1, r2) (pc) = opt_div_rr((interp), jit_info, (r1), (r2), 1)
-#  define jit_emit_cmod_rr_i(interp, pc, r1, r2) (pc) = opt_div_rr((interp), jit_info, (r1), (r2), 0)
-
-char * opt_div_ri(PARROT_INTERP, Parrot_jit_info_t *jit_info, int dest,
-    INTVAL imm, int is_div);
-
-#  define jit_emit_div_ri_i(pc, r1, imm) (pc) = opt_div_ri(interp, jit_info, (r1), (imm), 1)
-#  define jit_emit_cmod_ri_i(pc, r1, imm) (pc) = opt_div_ri(interp, jit_info, (r1), (imm), 0)
-
-char * opt_div_RM(PARROT_INTERP, Parrot_jit_info_t *jit_info, int dest,
-    int offs, int is_div);
-
-#  define jit_emit_div_RM_i(interp, pc, r, m)  (pc) = opt_div_RM((interp), jit_info, (r), (m), 1)
-#  define jit_emit_cmod_RM_i(interp, pc, r, m) (pc) = opt_div_RM((interp), jit_info, (r), (m), 0)
-
-enum { JIT_X86BRANCH, JIT_X86JUMP, JIT_X86CALL };
-
-void jit_emit_jcc(Parrot_jit_info_t *jit_info, int code, opcode_t disp);
-
-void emit_jump(Parrot_jit_info_t *jit_info, opcode_t disp);
-
-void Parrot_emit_jump_to_eax(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-#  define jit_emit_stack_frame_enter(pc) do { \
-    emitm_pushl_r((pc), emit_EBP); \
-    jit_emit_mov_rr_i((pc), emit_EBP, emit_ESP); \
-} while (0)
-
-#  define jit_emit_stack_frame_leave(pc) do { \
-    jit_emit_mov_rr_i((pc), emit_ESP, emit_EBP); \
-    emitm_popl_r((pc), emit_EBP); \
-} while (0)
-
-#if JIT_VTABLE_OPS
-
-#  undef Parrot_jit_vtable1_op
-#  undef Parrot_jit_vtable1r_op
-
-#  undef Parrot_jit_vtable_111_op
-#  undef Parrot_jit_vtable_112_op
-#  undef Parrot_jit_vtable_221_op
-#  undef Parrot_jit_vtable_1121_op
-#  undef Parrot_jit_vtable_1123_op
-#  undef Parrot_jit_vtable_2231_op
-
-#  undef Parrot_jit_vtable_1r223_op
-#  undef Parrot_jit_vtable_1r332_op
-
-#  undef Parrot_jit_vtable_ifp_op
-#  undef Parrot_jit_vtable_unlessp_op
-#  undef Parrot_jit_vtable_newp_ic_op
-
-/* emit a call to a vtable func
- * $X->vtable(interp, $X [, $Y...])
- */
-#  define MAP(i) jit_info->optimizer->map_branch[jit_info->op_i + (i)]
-
-#  include "parrot/oplib/ops.h"
-
-INTVAL Parrot_FixedIntegerArray_get_integer_keyed_int(Interp*, PMC*, INTVAL);
-void Parrot_FixedIntegerArray_set_integer_keyed_int(Interp*, PMC*, INTVAL, INTVAL);
-
-char * jit_set_i_p_ki(Parrot_jit_info_t *jit_info, PARROT_INTERP,
-    size_t offset);
-
-char * jit_set_p_ki_i(Parrot_jit_info_t *jit_info, PARROT_INTERP,
-    size_t offset);
-
-/*
- * for vtable calls registers are already saved back
- */
-void Parrot_jit_vtable_n_op(Parrot_jit_info_t *jit_info, PARROT_INTERP,
-    int n, int *args);
-
-void Parrot_jit_store_retval(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-/* emit a call to a vtable func
- * $1->vtable(interp, $1)
- */
-void Parrot_jit_vtable1_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-/* emit a call to a vtable func
- * $1 = $2->vtable(interp, $2)
- */
-void Parrot_jit_vtable1r_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-/* emit a call to a vtable func
- * $1 = $2->vtable(interp, $2, $3)
- */
-void Parrot_jit_vtable_1r223_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-/* emit a call to a vtable func
- * $1 = $3->vtable(interp, $3, $2)
- */
-void Parrot_jit_vtable_1r332_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-/* emit a call to a vtable func
- * $1->vtable(interp, $1, $2)
- */
-void Parrot_jit_vtable_112_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-/* emit a call to a vtable func
- * $1->vtable(interp, $1, $1)
- */
-void Parrot_jit_vtable_111_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-/* emit a call to a vtable func
- * $2->vtable(interp, $2, $1)
- */
-void Parrot_jit_vtable_221_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-/* emit a call to a vtable func
- * $2->vtable(interp, $2, $3, $1)
- */
-void Parrot_jit_vtable_2231_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-/* emit a call to a vtable func
- * $1->vtable(interp, $1, $2, $3)
- */
-void Parrot_jit_vtable_1123_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-/* emit a call to a vtable func
- * $1->vtable(interp, $1, $2, $1)
- */
-void Parrot_jit_vtable_1121_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-/* if_p_ic, unless_p_ic */
-void Parrot_jit_vtable_if_unless_op(Parrot_jit_info_t *jit_info,
-    PARROT_INTERP, int unless);
-
-/* unless_p_ic */
-void Parrot_jit_vtable_unlessp_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-/* if_p_ic */
-void Parrot_jit_vtable_ifp_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-/* new_p_ic */
-void Parrot_jit_vtable_newp_ic_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-#endif /* JIT_VTABLE_OPS */
-
-#if EXEC_CAPABLE
-#  ifdef JIT_CGP
-#    ifdef EXEC_SHARED
-#      define exec_emit_end(interp, pc) { \
-           jit_emit_mov_rm_i((pc), c, 2); \
-           Parrot_exec_add_text_rellocation(jit_info->objfile, \
-             jit_info->native_ptr, RTYPE_COM, "cgp_core", 0); \
-           emitm_movl_m_r((interp), jit_info->native_ptr, emit_ESI, emit_ESI, \
-             emit_None, 1, 0); \
-           emitm_addb_i_r(jit_info->native_ptr, \
-             (int)((ptrcast_t)((op_func_t*) \
-               (interp)->op_lib->op_func_table)[0]) - (int)cgp_core, \
-                 emit_ESI); \
-           emitm_jumpr((pc), emit_ESI); \
-         }
-#    else /* EXEC_SHARED */
-#      define exec_emit_end(interp, pc) { \
-           jit_emit_mov_ri_i((interp), (pc), emit_ESI, \
-             (int)((ptrcast_t)((op_func_t*) \
-               (interp)->op_lib->op_func_table)[0]) - (int)cgp_core); \
-           Parrot_exec_add_text_rellocation(jit_info->objfile, \
-             jit_info->native_ptr, RTYPE_COM, "cgp_core", -4); \
-           emitm_jumpr((pc), emit_ESI); \
-         }
-#    endif /* EXEC_SHARED */
-
-#  else /* JIT_CGP */
-
-#    define exec_emit_end(pc) jit_emit_end(pc)
-
-#  endif /* JIT_CGP */
-#endif /* EXEC_CAPABLE */
-
-#ifdef JIT_CGP
-#  define jit_emit_end(interp, pc) { \
-       jit_emit_mov_ri_i((interp), (pc), emit_ESI, \
-         (ptrcast_t)((op_func_t*)(interp)->op_lib->op_func_table) [0]); \
-       emitm_jumpr((pc), emit_ESI); \
-     }
-#else /* JIT_CGP */
-#  define jit_emit_end(pc) { \
-       jit_emit_add_ri_i((interp), (pc), emit_ESP, 4); \
-       emitm_popl_r((pc), emit_EDI); \
-       emitm_popl_r((pc), emit_ESI); \
-       emitm_popl_r((pc), emit_EBX); \
-       emitm_popl_r((pc), emit_EBP); \
-       emitm_ret(pc); \
-     }
-
-#endif /* JIT_CGP */
-
-void jit_get_params_pc(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-/*
- * preserve registers
- * a) all callee saved on function entry
- */
-
-void jit_save_regs(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-/* restore saved regs, see above */
-
-void jit_restore_regs(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-/*
- * preserve registers around a functioncall
- *
- * all used register around a call (skip >= 0 := return result
- *
- * TODO factor out common code
- *      use jit_emit_mov_RM_{in} functions (load/store base indexed)
- *      and a macro to retrieve sp
- */
-
-int jit_save_regs_call(Parrot_jit_info_t *jit_info, PARROT_INTERP, int skip);
-
-void jit_restore_regs_call(Parrot_jit_info_t *jit_info, PARROT_INTERP,
-    int skip);
-
-void jit_set_returns_pc(Parrot_jit_info_t *jit_info, PARROT_INTERP,
-    int recursive);
-
-void jit_set_args_pc(Parrot_jit_info_t *jit_info, PARROT_INTERP,
-    int recursive);
-
-/*
- * if jit_emit_noop is defined, it does align a jump target
- * to 1 << JUMP_ALIGN
- * It may emit exactly one byte, or some desired padding.
- * The instructions must perform like a noop.
- *
- * Alignment effects seem to be rather processor specific and
- * it's not quite clear if the branch src or target should be
- * aligned. Turned off for now.
- *
- * s. also info gcc /align-jump
- *
- * noop; mov %esi, %esi; lea 0(%esi), %esi
- * TODO
- * 7 bytes: 8d b4 26 00 00 00 00    lea    0x0(%esi),%esi
- * 6 bytes: 8d b6 00 00 00 00       lea    0x0(%esi),%esi
- * 5 bytes: 90 8d 74 26 00          nop,   lea    0x0(%esi),%esi
- * 4 bytes: 8d 74 26 00             lea    0x0(%esi),%esi
- *
- */
-
-#  define jit_emit_noop(pc) do { \
-     switch (((unsigned long) (pc)) & 3) { \
-       case 1: *(pc)++ = (char) 0x8d; *(pc)++ = (char) 0x76; *(pc)++ = (char) 0x00; break; \
-       case 2: *(pc)++ = (char) 0x89; *(pc)++ = (char) 0xf6; break; \
-       case 3: *(pc)++ = (char) 0x90; break; \
-     } \
-   } while (0)
-
-#  define JUMP_ALIGN 0
-#  define SUB_ALIGN 0
-
-#ifdef JIT_EMIT
-#  if JIT_EMIT == 0
-
-extern int control_word;
-
-#    ifdef JIT_CGP
-#      include <parrot/oplib/core_ops_cgp.h>
-#    endif
-
-#    define REQUIRES_CONSTANT_POOL 0
-/*
- * examples/pir/mandel.pir and t/op/jitn_14 show rounding problems
- * due to keeping intermediate results in FP registers
- * When intermediates are written back to parrot regs, rounding to
- * 64 bit is performed, which changes results slightly
- *
- * One method is to just turn off mapped floats. The other one is
- * setting a different control word (with precision control = double)
- * see emitm_fldcw above
- */
-#    define FLOAT_REGISTERS_TO_MAP 4
-
-/* registers are either allocate per section or per basic block
- * set this to 1 or 0 to change allocation scheme
- */
-#    define ALLOCATE_REGISTERS_PER_SECTION 1
-
-/*
- * new style move function using offsets relative to the base_reg
- */
-#    ifdef JIT_CGP
-#      define INTERP_BP_OFFS todo
-#    else
-#      define INTERP_BP_OFFS -16
-#    endif
-
-#  endif /* JIT_EMIT = 0 */
-#endif /* JIT_EMIT */
-
-void Parrot_jit_dofixup(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-void Parrot_jit_begin(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-/*
- * create a JITted version of a PIR sub, where everything
- * resided in registers
- *
- * The sub is called as
- *
- *   opcode_t * func(Interp *i, INTVAL *sig_bits, void **args);
- *
- *   args[0] ...    NULL / return value address
- *   args[1..n] ... addresses of n arguments
- *   args[n + 1] .. opcode_t* next - usually just returned
- */
-
-void Parrot_jit_begin_sub_regs(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-void Parrot_jit_begin_sub(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-void jit_mov_mr_n_offs(PARROT_INTERP, Parrot_jit_info_t *jit_info,
-        int base_reg, INTVAL offs, int src_reg);
-
-void jit_mov_mr_offs(PARROT_INTERP, Parrot_jit_info_t *jit_info,
-        int base_reg, INTVAL offs, int src_reg);
-
-void jit_mov_rm_n_offs(PARROT_INTERP, Parrot_jit_info_t *jit_info,
-        int dst_reg, int base_reg, INTVAL offs);
-
-void jit_mov_rm_offs(PARROT_INTERP, Parrot_jit_info_t *jit_info,
-        int dst_reg, int base_reg, INTVAL offs);
-
-void Parrot_jit_emit_finit(Parrot_jit_info_t *jit_info);
-
-void Parrot_jit_normal_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-void Parrot_jit_cpcf_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-#ifdef JIT_EMIT
-#  if JIT_EMIT == 2
-/* generate code just once */
-
-/* autogened inside core.ops */
-static void Parrot_end_jit(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-#    undef Parrot_jit_restart_op
-#  endif /* JIT_EMIT == 2 */
-#endif /* JIT_EMIT */
-
-void Parrot_jit_restart_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
-int count_regs(PARROT_INTERP, char *sig, char *sig_start);
-
-size_t calc_signature_needs(const char *sig, int *strings);
-
-void * Parrot_jit_build_call_func(PARROT_INTERP, PMC *pmc_nci,
-    STRING *signature, int *sizeptr);
-
-/*
- * register usage
- * %edi, %esi ... mapped, preserved
- * %edx, %ecx ... mapped, not preserved
- * %ebx       ... base pointer for register access, preserved
- * %eax       ... scratch, return value register
- */
-
-extern const char i_map[];
-
-extern const char floatval_map[];
-
-extern const char i_map_sub[];
-
-extern const jit_arch_info arch_info;
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-const jit_arch_info * Parrot_jit_init(PARROT_INTERP);
-
-#undef INT_REGISTERS_TO_MAP
-#endif /* PARROT_I386_JIT_EMIT_H_GUARD */
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/ia64/core.jit
==============================================================================
--- branches/orderedhash_revamp/src/jit/ia64/core.jit	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,305 +0,0 @@
-;
-; ia64/core.jit
-;
-;
-; $Id$
-;
-
-Parrot_end {
-    jit_emit_end(NATIVECODE);
-}
-
-Parrot_set_i_ic {
-    if (MAP[1]) {
-        jit_emit_mov_ri_i(NATIVECODE, MAP[1], *INT_CONST[2]);
-    }
-    else {
-        jit_emit_mov_ri_i(NATIVECODE, ISR1, *INT_CONST[2]);
-        jit_emit_mov_mr_i(NATIVECODE, &INT_REG[1], ISR1);
-    }
-    NATIVECODE = close_template(NATIVECODE);
-}
-
-Parrot_set_i_i {
-    if (MAP[1] && MAP[2]) {
-        jit_emit_mov_rr(NATIVECODE, MAP[1], MAP[2]);
-    }
-    else if (MAP[1]) {
-        jit_emit_mov_rm_i(NATIVECODE, MAP[1], &INT_REG[2]);
-    }
-    else if (MAP[2]) {
-        jit_emit_mov_mr_i(NATIVECODE, &INT_REG[1], MAP[2]);
-    }
-    else {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, &INT_REG[2]);
-        jit_emit_mov_mr_i(NATIVECODE, &INT_REG[1], ISR1);
-    }
-    NATIVECODE = close_template(NATIVECODE);
-}
-
-TEMPLATE Parrot_binop_i_ic {
-    if (MAP[1]) {
-        jit_emit_mov_ri_i(NATIVECODE, ISR1, *INT_CONST[2]);
-        jit_emit_<op>_rrr(NATIVECODE, MAP[1], MAP[1], ISR1);
-    }
-    else {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, &INT_REG[1]);
-        jit_emit_mov_ri_i(NATIVECODE, ISR2, *INT_CONST[2]);
-        jit_emit_<op>_rrr(NATIVECODE, ISR1, ISR2, ISR1);
-        jit_emit_mov_mr_i(NATIVECODE, &INT_REG[1], ISR1);
-    }
-    NATIVECODE = close_template(NATIVECODE);
-}
-
-TEMPLATE Parrot_binop_x_x {
-    if (MAP[1] && MAP[2]) {
-        jit_emit_<op>_rrr(NATIVECODE, MAP[1], MAP[1], MAP[2]);
-    }
-    else if (MAP[1]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, &<T>_REG[2]);
-        jit_emit_<op>_rrr(NATIVECODE, MAP[1], MAP[1], <s1>);
-    }
-    else if (MAP[2]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, &<T>_REG[1]);
-        jit_emit_<op>_rrr(NATIVECODE, <s1>, <s1>, MAP[2]);
-        jit_emit_mov_mr<_N>(NATIVECODE, &<T>_REG[1], <s1>);
-    }
-    else {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, &<T>_REG[1]);
-        jit_emit_mov_rm<_N>(NATIVECODE, <s2>, &<T>_REG[2]);
-        jit_emit_<op>_rrr(NATIVECODE, <s1>, <s2>, <s1>);
-        jit_emit_mov_mr<_N>(NATIVECODE, &<T>_REG[1], <s1>);
-    }
-    NATIVECODE = close_template(NATIVECODE);
-}
-
-TEMPLATE Parrot_binop_x_x_x {
-    if (MAP[1] && MAP[2] && MAP[3]) {
-        jit_emit_<op>_rrr(NATIVECODE, MAP[1], MAP[2], MAP[3]);
-    }
-    else if (MAP[1] && MAP[2]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, &<T>_REG[3]);
-        jit_emit_<op>_rrr(NATIVECODE, MAP[1], MAP[2], <s1>);
-    }
-    else if (MAP[1] && MAP[3]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, &<T>_REG[2]);
-        jit_emit_<op>_rrr(NATIVECODE, MAP[1], <s1>, MAP[3]);
-    }
-    else if (MAP[2] && MAP[3]) {
-        jit_emit_<op>_rrr(NATIVECODE, <s1>, MAP[2], MAP[3]);
-        jit_emit_mov_mr<_N>(NATIVECODE, &<T>_REG[1], <s1>);
-    }
-    else if (MAP[1]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, &<T>_REG[3]);
-        jit_emit_mov_rm<_N>(NATIVECODE, <s2>, &<T>_REG[2]);
-        jit_emit_<op>_rrr(NATIVECODE, MAP[1], <s2>, <s1>);
-    }
-    else if (MAP[2]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, &<T>_REG[3]);
-        jit_emit_<op>_rrr(NATIVECODE, <s1>, MAP[2], <s1>);
-        jit_emit_mov_mr<_N>(NATIVECODE, &<T>_REG[1], <s1>);
-    }
-    else if (MAP[3]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, &<T>_REG[2]);
-        jit_emit_<op>_rrr(NATIVECODE, <s1>, <s1>, MAP[3]);
-        jit_emit_mov_mr<_N>(NATIVECODE, &<T>_REG[1], <s1>);
-    }
-    else {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, &<T>_REG[3]);
-        jit_emit_mov_rm<_N>(NATIVECODE, <s2>, &<T>_REG[2]);
-        jit_emit_<op>_rrr(NATIVECODE, <s1>, <s2>, <s1>);
-        jit_emit_mov_mr<_N>(NATIVECODE, &<T>_REG[1], <s1>);
-    }
-    NATIVECODE = close_template(NATIVECODE);
-}
-
-TEMPLATE Parrot_binop_i_ic_i {
-    if (MAP[1] && MAP[3]) {
-        jit_emit_mov_ri_i(NATIVECODE, ISR1, *INT_CONST[2]);
-        jit_emit_<op>_rrr(NATIVECODE, MAP[1], ISR1, MAP[3]);
-    }
-    else if (MAP[1]) {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, &INT_REG[3]);
-        jit_emit_mov_ri_i(NATIVECODE, ISR2, *INT_CONST[2]);
-        jit_emit_<op>_rrr(NATIVECODE, MAP[1], ISR2, ISR1);
-    }
-    else if (MAP[3]) {
-        jit_emit_mov_ri_i(NATIVECODE, ISR1, *INT_CONST[2]);
-        jit_emit_<op>_rrr(NATIVECODE, ISR1, ISR1, MAP[3]);
-        jit_emit_mov_mr_i(NATIVECODE, &INT_REG[1], ISR1);
-    }
-    else {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, &INT_REG[3]);
-        jit_emit_mov_ri_i(NATIVECODE, ISR2, *INT_CONST[2]);
-        jit_emit_<op>_rrr(NATIVECODE, ISR1, ISR2, ISR1);
-        jit_emit_mov_mr_i(NATIVECODE, &INT_REG[1], ISR1);
-    }
-    NATIVECODE = close_template(NATIVECODE);
-}
-
-TEMPLATE Parrot_binop_i_i_ic {
-    if (MAP[1] && MAP[2]) {
-        jit_emit_mov_ri_i(NATIVECODE, ISR1, *INT_CONST[3]);
-        jit_emit_<op>_rrr(NATIVECODE, MAP[1], MAP[2], ISR1);
-    }
-    else if (MAP[1]) {
-        jit_emit_mov_ri_i(NATIVECODE, ISR1, *INT_CONST[3]);
-        jit_emit_mov_rm_i(NATIVECODE, ISR2, &INT_REG[2]);
-        jit_emit_<op>_rrr(NATIVECODE, MAP[1], ISR2, ISR1);
-    }
-    else if (MAP[2]) {
-        jit_emit_mov_ri_i(NATIVECODE, ISR1, *INT_CONST[3]);
-        jit_emit_<op>_rrr(NATIVECODE, ISR1, MAP[2], ISR1);
-        jit_emit_mov_mr_i(NATIVECODE, &INT_REG[1], ISR1);
-    }
-    else {
-        jit_emit_mov_ri_i(NATIVECODE, ISR1, *INT_CONST[3]);
-        jit_emit_mov_rm_i(NATIVECODE, ISR2, &INT_REG[2]);
-        jit_emit_<op>_rrr(NATIVECODE, ISR1, ISR2, ISR1);
-        jit_emit_mov_mr_i(NATIVECODE, &INT_REG[1], ISR1);
-    }
-    NATIVECODE = close_template(NATIVECODE);
-}
-
-Parrot_band_i_i {
-    Parrot_binop_x_x s/<_N>/_i/ s/<op>/and/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_bor_i_i {
-    Parrot_binop_x_x s/<_N>/_i/ s/<op>/or/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_bxor_i_i {
-    Parrot_binop_x_x s/<_N>/_i/ s/<op>/xor/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_add_i_i {
-    Parrot_binop_x_x s/<_N>/_i/ s/<op>/add/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_sub_i_i {
-    Parrot_binop_x_x s/<_N>/_i/ s/<op>/sub/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_band_i_ic {
-    Parrot_binop_i_ic s/<op>/and/
-}
-
-Parrot_bor_i_ic {
-    Parrot_binop_i_ic s/<op>/or/
-}
-
-Parrot_bxor_i_ic {
-    Parrot_binop_i_ic s/<op>/xor/
-}
-
-Parrot_add_i_ic {
-    Parrot_binop_i_ic s/<op>/add/
-}
-
-Parrot_sub_i_ic {
-    Parrot_binop_i_ic s/<op>/sub/
-}
-
-Parrot_band_i_i_i {
-    Parrot_binop_x_x_x s/<_N>/_i/ s/<op>/and/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_bor_i_i_i {
-    Parrot_binop_x_x_x s/<_N>/_i/ s/<op>/or/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_bxor_i_i_i {
-    Parrot_binop_x_x_x s/<_N>/_i/ s/<op>/xor/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_add_i_i_i {
-    Parrot_binop_x_x_x s/<_N>/_i/ s/<op>/add/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_sub_i_i_i {
-    Parrot_binop_x_x_x s/<_N>/_i/ s/<op>/sub/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_band_i_i_ic {
-    Parrot_binop_i_i_ic s/<op>/and/
-}
-
-Parrot_bor_i_i_ic {
-    Parrot_binop_i_i_ic s/<op>/or/
-}
-
-Parrot_bxor_i_i_ic {
-    Parrot_binop_i_i_ic s/<op>/xor/
-}
-
-Parrot_add_i_i_ic {
-    Parrot_binop_i_i_ic s/<op>/add/
-}
-
-Parrot_sub_i_i_ic {
-    Parrot_binop_i_i_ic s/<op>/sub/
-}
-
-Parrot_band_i_ic_i {
-    Parrot_binop_i_ic_i s/<op>/and/
-}
-
-Parrot_bor_i_ic_i {
-    Parrot_binop_i_ic_i s/<op>/or/
-}
-
-Parrot_bxor_i_ic_i {
-    Parrot_binop_i_ic_i s/<op>/xor/
-}
-
-Parrot_add_i_ic_i {
-    Parrot_binop_i_ic_i s/<op>/add/
-}
-
-Parrot_sub_i_ic_i {
-    Parrot_binop_i_ic_i s/<op>/sub/
-}
-
-Parrot_neg_i {
-    if (MAP[1]) {
-        jit_emit_neg_rr(NATIVECODE, MAP[1], MAP[1]);
-    }
-    else {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, &INT_REG[1]);
-        jit_emit_neg_rr(NATIVECODE, ISR1, ISR1);
-        jit_emit_mov_mr_i(NATIVECODE, &INT_REG[1], ISR1);
-    }
-}
-
-Parrot_neg_i_i {
-    if (MAP[1] && MAP[2]) {
-        jit_emit_neg_rr(NATIVECODE, MAP[1], MAP[2]);
-    }
-    else if (MAP[1]) {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, &INT_REG[2]);
-        jit_emit_neg_rr(NATIVECODE, MAP[1], ISR1);
-    }
-    else if (MAP[2]) {
-        jit_emit_neg_rr(NATIVECODE, ISR1, MAP[1]);
-        jit_emit_mov_mr_i(NATIVECODE, &INT_REG[1], ISR1);
-    }
-    else {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, &INT_REG[2]);
-        jit_emit_neg_rr(NATIVECODE, ISR1, ISR1);
-        jit_emit_mov_mr_i(NATIVECODE, &INT_REG[1], ISR1);
-    }
-}
-
-Parrot_if_i_ic {
-    if (MAP[1]) {
-        jit_emit_cmp_r0(NATIVECODE, MAP[1]);
-    }
-    else {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, &INT_REG[1]);
-        jit_emit_cmp_r0(NATIVECODE, ISR1);
-    }
-    jit_emit_bc(jit_info, *INT_CONST[2]);
-    NATIVECODE = close_template(NATIVECODE);
-}
-

Deleted: branches/orderedhash_revamp/src/jit/ia64/jit_defs.c
==============================================================================
--- branches/orderedhash_revamp/src/jit/ia64/jit_defs.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,13 +0,0 @@
-/* Stub file for RT#38929 fixes */
-/*
-Copyright (C) 2008, Parrot Foundation.
-$Id$
-*/
-/* HEADERIZER HFILE: none */
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/ia64/jit_emit.h
==============================================================================
--- branches/orderedhash_revamp/src/jit/ia64/jit_emit.h	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,779 +0,0 @@
-/*
- * Copyright (C) 2004-2007, Parrot Foundation.
- */
-
-#ifndef PARROT_JIT_IA64_JIT_EMIT_H_GUARD
-#define PARROT_JIT_IA64_JIT_EMIT_H_GUARD
-
-/*
- * jit_emit.h
- *
- * IA64
- *
- * $Id$
- */
-
-#if JIT_EMIT
-
-#  define NATIVE_PTR ((Parrot_jit_info_t *)(interp->code->jit_info))->native_ptr
-
-/* r0            Zero
- * r1            Special
- * r2-r3         Scratch
- * r4-r7         Preserved
- * r8-r11        Scratch
- * r12-r13       Special
- * r14-r31       Scratch
- */
-
-long it = 0;
-int inst_size = 0;
-int inst_tmpl = 0;
-
-typedef struct  inst_tmp_t {
-    char    tmplt;
-    char    used;
-    unsigned long    inst1;
-    int     it1;
-    unsigned long    inst2;
-    int     it2;
-    unsigned long    inst3;
-    int     it3;
-} inst_tmp_t;
-
-inst_tmp_t sit;
-
-/* Instruction types */
-
-enum {
-    IT_A = 1,   /* Integer ALU = I | M */
-    IT_As,  /* Integer ALU stop */
-    IT_I,   /* Non-ALU integer */
-    IT_Is,  /* Non-ALU integer stop */
-    IT_M,   /* Memory */
-    IT_Ms,  /* Memory stop */
-    IT_F,   /* Floating-Point */
-    IT_Fs,  /* Floating-Point */
-    IT_B,   /* Branch */
-    IT_Bs,  /* Branch */
-    IT_L,   /* Extended */
-    IT_X,   /* Extended */
-    IT_Xs,  /* Extended */
-};
-
-/* Templates */
-
-enum {
-    MII,
-    MIIs,
-    MIsI,
-    MIsIs,
-    MLX,
-    MLXs,
-    MMI = 8,
-    MMIs,
-    MsMI,
-    MsMIs,
-    MFI,
-    MFIs,
-    MMF,
-    MMFs,
-    MIB,
-    MIBs,
-    MBB,
-    MBBs,
-    BBB = 0x16,
-    BBBs,
-    MMB,
-    MMBs,
-    MFB = 0x1C,
-    MFBs
-};
-
-/* Reserved registers */
-
-#  define ISR1 2
-#  define ISR2 3
-#  define RSF 34
-#  define R_INTREP 4
-#  define R_BYTECODE 5
-#  define R_OPMAP 6
-#  define R_RETURN_ADR 7
-#  define R_RETURN 8
-#  define R_ARG1 32
-#  define R_ARG2 33
-
-#  define FSR1 2
-#  define FSR2 3
-
-/* Application Registers */
-#  define PFS 64
-
-#  define RSRV_REG 26
-
-#  define emit_x2(pc, r1, imm64) \
-    pc = close_template(pc); \
-    pc = loadinst(pc, ((long)((imm64 >> 22) & (long)0x1fffffffffff)), IT_L); \
-    it = ((long)6 << 37) | \
-        ((long)((imm64 >> 63) & 0x1)     << 36) | \
-        ((long)((imm64 >> 7) & 0x1ff)     << 27) | \
-        ((long)((imm64 >> 21) & 0x1)     << 21) | \
-        ((long)((imm64 >> 16) & 0x1f)     << 22) | \
-        ((long)((imm64           & 0x7f))     << 13) | \
-        ((((long)r1 & 0x3f)) << 6); \
-    pc = loadinst(pc, it, IT_X); \
-
-#  define emit_x4(pc, d, wh, imm64, p, b1) \
-    pc = close_template(pc); \
-    pc = loadinst(pc, (long)((imm64 >> 20) & 0x7fffffffff) << 2, IT_L); \
-    it = ((long)0xD << 37) | ((long)(((long)(imm64) >> 63) & 0x1) << 36) | \
-        ((long)d << 35) | ((long)wh << 33) | \
-        (((long)imm64 & 0xfffff) << 13) | (p << 12) | (b1 << 6); \
-    pc = loadinst(pc, it, IT_X);
-
-#  define emit_a1(pc, x2a, ve, x4, x2b, r3, r2, r1) \
-    it = ((long)8 << 37) | ((long)x2a << 34) | ((long)ve << 33) | \
-        ((long)x4 << 29) | ((long)x2b << 27) | (r3 << 20) | (r2 << 13) | \
-        (r1 << 6); \
-    pc = loadinst(pc, it, IT_A);
-
-#  define emit_a4(pc, r3, imm14, r1) \
-    it = ((long)8 << 37) | ((long)((imm14 >> 13) & 0x1) << 36) | \
-        ((long)2 << 34) | (((imm14 >> 7) & 0x3f) << 27) | (r3 << 20) | \
-        ((imm14 & 0x7f) << 13) | (r1 << 6); \
-    pc = loadinst(pc, it, IT_A);
-
-#  define emit_a5(pc, r3, imm22, r1) \
-    it = ((long)9 << 37) | ((long)((imm22 >> 7) & 0x1ff) << 27) | \
-        (((imm22 >> 16) & 0x1f) << 22) | ((imm22 & 0x7f) << 13) | \
-        ((r3 & 0x3) << 20) | (r1 << 6); \
-    pc = loadinst(pc, it, IT_A);
-
-#  define emit_a6(pc, op, tb, x2, ta, c, p2, r3, r2, p1) \
-    it = ((long)op << 37) | ((long)tb << 36) | ((long)x2 << 34) | \
-        ((long)ta << 33) | ((long)p2 << 27) | ((long)r3 << 20) | \
-        ((long)r2 << 13) | ((long)c << 12) | (p1 << 6); \
-    pc = loadinst(pc, it, IT_M); /**/ \
-    pc = loadinst(pc, emit_fill_nop_m, IT_F);
-
-#  define emit_m1(pc, x6, r3, r1) \
-    it = ((long)4 << 37) | ((long)x6 << 30) | (r3 << 20) | (r1 << 6); \
-    pc = loadinst(pc, it, IT_M);
-
-#  define emit_m2(pc, x6, r3, r2, r1) \
-    it = ((long)4 << 37) | ((long)1 << 36) | ((long)x6 << 30) | \
-        (r3 << 20) | (r2 << 13) | (r1 << 6); \
-    pc = loadinst(pc, it, IT_M);
-
-#  define emit_m4(pc, x6, r3, r2) \
-    it = ((long)4 << 37) | ((long)x6 << 30) | (r3 << 20) | (r2 << 13); \
-    pc = loadinst(pc, it, IT_M);
-
-#  define fd_sig 0x1C
-#  define fd_exp 0x1D
-#  define fd_s   0x1E
-#  define fd_d   0x1F
-
-#  define emit_m18(pc, x6, r2, f1) \
-    it = ((long)6 << 37) | ((long)x6 << 30) | ((long)1 << 27) | \
-        (r2 << 13) | (f1 << 6); \
-    pc = loadinst(pc, it, IT_M);
-
-#  define emit_m19(pc, x6, f2, r1) \
-    it = ((long)4 << 37) | ((long)x6 << 30) | ((long)1 << 27) | \
-        (f2 << 13) | (r1 << 6); \
-    pc = loadinst(pc, it, IT_M);
-
-#  define emit_m34(pc, il, o, r, r1) \
-    it = ((long)1 << 37) | (long)0x6 << 33 | ((long)(r >> 3) << 27) | \
-        ((long)il << 20) | ((long)(il + o) << 13) | ((long)r1 << 6); \
-    pc = loadinst(pc, it, IT_M);
-
-#  define ph_few 0
-#  define ph_many 1
-
-#  define bwh_sptk 0
-#  define bwh_spnt 1
-#  define bwh_dptk 2
-#  define bwh_dpnt 3
-
-#  define dh_none 0
-#  define dh_clr 1
-
-#  define emit_b1(pc, d, wh, imm21, p, b1, qp) \
-    it = ((long)4 << 37) | ((long)((imm21 >> 20) & 0x1) << 36) | \
-        ((long)d << 35) | ((long)wh << 33) | \
-        ((long)(imm21 & 0xfffff) << 13) | (p << 12) | (b1 << 6) | qp; \
-    pc = loadinst(pc, it, IT_B);
-
-#  define emit_b3(pc, d, wh, imm20b, p, b1) \
-    it = ((long)5 << 37) | ((long)((imm20b >> 20) & 0x1) << 36) | \
-        ((long)d << 35) | ((long)wh << 33) | \
-        ((long)(imm20b & 0xfffff) << 13) | (p << 12) | (b1 << 6); \
-    pc = loadinst(pc, it, IT_B);
-
-#  define emit_b4(pc, d, wh, x6, b2, p, btype) \
-    it = ((long)1 << 36) | ((long)d << 35) | ((long)wh << 33) | \
-        ((long)x6 << 27) | (b2 << 13) | (p << 12) | (btype << 6); \
-    pc = loadinst(pc, it, IT_B);
-
-#  define emit_i21(pc, b1, r2) \
-    it = ((long)0 << 37) | (long)0x7 << 33 | \
-        ((long)r2 << 13) | ((long)b1 << 6);\
-    pc = loadinst(pc, it, IT_I);
-
-#  define emit_i22(pc, r1, b2) \
-    it = ((long)0 << 37) | (long)0x31 << 27 | \
-        ((long)b2 << 13) | ((long)r1 << 6);\
-    pc = loadinst(pc, it, IT_I);
-
-#  define emit_i26(pc, ar3, r2) \
-    it = ((long)0x2A << 27) | (long)ar3 << 20 | ((long)r2 << 13);\
-    pc = loadinst(pc, it, IT_I);
-
-/* Pseudo instructions. */
-#  define jit_emit_mov_ri_i(pc, dest, imm) \
-    emit_x2((pc), (dest), ((long)(imm)));
-
-/* Store a CPU register back to a Parrot register. */
-
-#  define jit_emit_mov_mr_i(pc, addr, reg) \
-    emit_a4((pc), R_INTREP, (((char *)(addr)) - ((char *)(interp))), ISR2); \
-    emit_m4((pc), 0x33, ISR2, (reg));
-
-#  define jit_emit_mov_rm_i(pc, reg, addr) \
-    emit_a4((pc), R_INTREP, (((char *)(addr)) - ((char *)(interp))), ISR2); \
-    emit_m1((pc), 0x3, ISR2, (reg));
-
-#  define jit_emit_mov_rr(pc, dst, src) \
-    emit_a4((pc), (src), 0, (dst));
-
-#  define jit_emit_add_rrr(pc, D, A, B) \
-    emit_a1((pc), 0, 0, 0, 0, (A), (B), (D));
-
-#  define jit_emit_sub_rrr(pc, D, A, B) \
-    emit_a1((pc), 0, 0, 1, 1, (B), (A), (D));
-
-#  define jit_emit_neg_rr(pc, D, A) \
-    emit_a1((pc), 0, 0, 1, 1, (A), 0, (D));
-
-#  define jit_emit_and_rrr(pc, D, A, B) \
-    emit_a1((pc), 0, 0, 3, 0, (A), (B), (D));
-
-#  define jit_emit_or_rrr(pc, D, A, B) \
-    emit_a1((pc), 0, 0, 3, 2, (A), (B), (D));
-
-#  define jit_emit_xor_rrr(pc, D, A, B) \
-    emit_a1((pc), 0, 0, 3, 3, (A), (B), (D));
-
-#  define jit_emit_mov_nr(pc, dst, src) \
-    emit_m18((pc), (fr_sig), (dst), (src));
-
-#  define jit_emit_mov_rn(pc, dst, src) \
-    emit_m19((pc), (fr_sig), (dst), (src));
-
-#  define jit_emit_cmp_r0(pc, src) \
-    emit_a6(pc, 0xE, 0, 2, 0, 0, 7, src, 0, 6);
-
-#  define jit_emit_nop(pc) \
-    (it) = emit_fill_nop_m; \
-    (pc) = loadinst((pc), it, IT_M);
-
-#  define jit_emit_end(pc) \
-    emit_i26((pc), PFS, RSF); \
-    emit_i21((pc), 0, R_RETURN_ADR); \
-    jit_emit_mov_rr(NATIVE_PTR, 12, 35); \
-    emit_b4((pc), dh_none, bwh_sptk, 0x21, 0, ph_many, 4); \
-    (pc) = close_template((pc));
-
-#  define emit_fill_nop 0x4000000
-#  define emit_fill_nop_m 0x8000000
-#  define emit_fill_nop_b 0x4000000000
-
-#  define JIT_IA64_CALL 1
-#  define JIT_IA64_BRANCH 2
-
-static int
-invalid_template(void)
-{
-    if (sit.it2 == 0)
-        return 0;
-    if (sit.it1 == IT_M && sit.it2 == IT_I && sit.it3 == 0)
-        return 0;
-    if (sit.it1 == IT_M && sit.it2 == IT_Is && sit.it3 == 0)
-        return 0;
-    if (sit.it1 == IT_M && sit.it2 == IT_L && sit.it3 == 0)
-        return 0;
-    if (sit.it1 == IT_M && sit.it2 == IT_M && sit.it3 == 0)
-        return 0;
-    if (sit.it1 == IT_Ms && sit.it2 == IT_M && sit.it3 == 0)
-        return 0;
-    if (sit.it1 == IT_M && sit.it2 == IT_F && sit.it3 == 0)
-        return 0;
-    if (sit.it1 == IT_M && sit.it2 == IT_B && sit.it3 == 0)
-        return 0;
-    if (sit.it1 == IT_B && sit.it2 == IT_B && sit.it3 == 0)
-        return 0;
-    if (sit.it1 == IT_M && sit.it2 == IT_I && sit.it3 == IT_I)
-        return 0;
-    if (sit.it1 == IT_M && sit.it2 == IT_I && sit.it3 == IT_Is)
-        return 0;
-    if (sit.it1 == IT_M && sit.it2 == IT_Is && sit.it3 == IT_I)
-        return 0;
-    if (sit.it1 == IT_M && sit.it2 == IT_Is && sit.it3 == IT_Is)
-        return 0;
-    if (sit.it1 == IT_M && sit.it2 == IT_L && sit.it3 == IT_X)
-        return 0;
-    if (sit.it1 == IT_M && sit.it2 == IT_L && sit.it3 == IT_Xs)
-        return 0;
-    if (sit.it1 == IT_M && sit.it2 == IT_M && sit.it3 == IT_I)
-        return 0;
-    if (sit.it1 == IT_M && sit.it2 == IT_M && sit.it3 == IT_Is)
-        return 0;
-    if (sit.it1 == IT_Ms && sit.it2 == IT_M && sit.it3 == IT_I)
-        return 0;
-    if (sit.it1 == IT_Ms && sit.it2 == IT_M && sit.it3 == IT_Is)
-        return 0;
-    if (sit.it1 == IT_M && sit.it2 == IT_F && sit.it3 == IT_I)
-        return 0;
-    if (sit.it1 == IT_M && sit.it2 == IT_F && sit.it3 == IT_Is)
-        return 0;
-    if (sit.it1 == IT_M && sit.it2 == IT_M && sit.it3 == IT_F)
-        return 0;
-    if (sit.it1 == IT_M && sit.it2 == IT_M && sit.it3 == IT_Fs)
-        return 0;
-    if (sit.it1 == IT_M && sit.it2 == IT_I && sit.it3 == IT_B)
-        return 0;
-    if (sit.it1 == IT_M && sit.it2 == IT_I && sit.it3 == IT_Bs)
-        return 0;
-    if (sit.it1 == IT_M && sit.it2 == IT_B && sit.it3 == IT_B)
-        return 0;
-    if (sit.it1 == IT_M && sit.it2 == IT_B && sit.it3 == IT_Bs)
-        return 0;
-    if (sit.it1 == IT_B && sit.it2 == IT_B && sit.it3 == IT_B)
-        return 0;
-    if (sit.it1 == IT_B && sit.it2 == IT_B && sit.it3 == IT_Bs)
-        return 0;
-    if (sit.it1 == IT_M && sit.it2 == IT_M && sit.it3 == IT_B)
-        return 0;
-    if (sit.it1 == IT_M && sit.it2 == IT_M && sit.it3 == IT_Bs)
-        return 0;
-    if (sit.it1 == IT_M && sit.it2 == IT_F && sit.it3 == IT_B)
-        return 0;
-    if (sit.it1 == IT_M && sit.it2 == IT_F && sit.it3 == IT_Bs)
-        return 0;
-    return 1;
-}
-
-static char *
-close_template(char *pc)
-{
-    char *pit;
-    int i;
-
-    if (sit.used == 0)
-        return pc;
-    else if (sit.used == 1 && sit.it1 == IT_M) {
-        sit.tmplt = MIsIs; /**/
-        sit.inst2 = emit_fill_nop_m >> 2;
-        sit.inst3 = emit_fill_nop_m >> 1;
-    }
-    else if (sit.it1 == IT_M && sit.it2 == IT_I && sit.it3 == IT_I)
-        sit.tmplt = MIsIs; /**/
-    else if (sit.it1 == IT_M && sit.it2 == IT_I && sit.it3 == IT_Is)
-        sit.tmplt = MIsIs; /**/
-    else if (sit.it1 == IT_M && sit.it2 == IT_Is && sit.it3 == IT_I)
-        sit.tmplt = MIsIs; /**/
-    else if (sit.it1 == IT_M && sit.it2 == IT_Is && sit.it3 == IT_Is)
-        sit.tmplt = MIsIs;
-    else if (sit.it1 == IT_M && sit.it2 == IT_L && sit.it3 == IT_X)
-        sit.tmplt = MLXs; /* Force stop */
-    else if (sit.it1 == IT_M && sit.it2 == IT_L && sit.it3 == IT_Xs)
-        sit.tmplt = MLXs;
-    else if (sit.it1 == IT_M && sit.it2 == IT_M && sit.it3 == IT_I)
-        sit.tmplt = MMIs; /**/
-    else if (sit.it1 == IT_M && sit.it2 == IT_M && sit.it3 == IT_Is)
-        sit.tmplt = MMIs;
-    else if (sit.it1 == IT_Ms && sit.it2 == IT_M && sit.it3 == IT_I)
-        sit.tmplt = MsMIs; /**/
-    else if (sit.it1 == IT_Ms && sit.it2 == IT_M && sit.it3 == IT_Is)
-        sit.tmplt = MsMIs;
-    else if (sit.it1 == IT_M && sit.it2 == IT_F && sit.it3 == IT_I)
-        sit.tmplt = MFIs; /**/
-    else if (sit.it1 == IT_M && sit.it2 == IT_F && sit.it3 == IT_Is)
-        sit.tmplt = MFIs;
-    else if (sit.it1 == IT_M && sit.it2 == IT_M && sit.it3 == IT_F)
-        sit.tmplt = MMF;
-    else if (sit.it1 == IT_M && sit.it2 == IT_M && sit.it3 == IT_Fs)
-        sit.tmplt = MMFs;
-    else if (sit.it1 == IT_M && sit.it2 == IT_I && sit.it3 == IT_B)
-        sit.tmplt = MIBs; /**/
-    else if (sit.it1 == IT_M && sit.it2 == IT_I && sit.it3 == IT_Bs)
-        sit.tmplt = MIBs;
-    else if (sit.it1 == IT_M && sit.it2 == IT_B && sit.it3 == IT_B)
-        sit.tmplt = MBB;
-    else if (sit.it1 == IT_M && sit.it2 == IT_B && sit.it3 == IT_Bs)
-        sit.tmplt = MBBs;
-    else if (sit.it1 == IT_B && sit.it2 == IT_B && sit.it3 == IT_B)
-        sit.tmplt = BBBs; /**/
-    else if (sit.it1 == IT_B && sit.it2 == IT_B && sit.it3 == IT_Bs)
-        sit.tmplt = BBBs;
-    else if (sit.it1 == IT_M && sit.it2 == IT_M && sit.it3 == IT_B)
-        sit.tmplt = MMBs; /**/
-    else if (sit.it1 == IT_M && sit.it2 == IT_M && sit.it3 == IT_Bs)
-        sit.tmplt = MMBs;
-    else if (sit.it1 == IT_M && sit.it2 == IT_F && sit.it3 == IT_B)
-        sit.tmplt = MFB;
-    else if (sit.it1 == IT_M && sit.it2 == IT_F && sit.it3 == IT_Bs)
-        sit.tmplt = MFBs;
-    else if (sit.it1 == IT_M && sit.it2 == IT_I) {
-        sit.tmplt = MIsIs; /**/
-        sit.inst3 = emit_fill_nop;
-    }
-    else if (sit.it1 == IT_M && sit.it2 == IT_Is) {
-        sit.tmplt = MIsIs; /**/
-        sit.inst3 = emit_fill_nop;
-    }
-    else if (sit.it1 == IT_M && sit.it2 == IT_L) {
-        sit.tmplt = MLXs; /**/
-        sit.inst3 = emit_fill_nop;
-    }
-    else if (sit.it1 == IT_M && sit.it2 == IT_M) {
-        sit.tmplt = MMI;
-        sit.inst3 = emit_fill_nop;
-    }
-    else if (sit.it1 == IT_Ms && sit.it2 == IT_M) {
-        sit.tmplt = MsMI;
-        sit.inst3 = emit_fill_nop;
-    }
-    else if (sit.it1 == IT_M && sit.it2 == IT_F) {
-        sit.tmplt = MFI;
-        sit.inst3 = emit_fill_nop;
-    }
-    else if (sit.it1 == IT_M && sit.it2 == IT_B) {
-        sit.tmplt = MBB;
-        sit.inst3 = emit_fill_nop_b;
-    }
-    else if (sit.it1 == IT_B && sit.it2 == IT_B) {
-        sit.tmplt = BBBs; /**/
-        sit.inst3 = emit_fill_nop_b;
-    }
-
-    pit = (char *)&sit.inst1;
-    *(pc++) = (char)sit.tmplt | *(pit++);
-    for (i = 0; i < 5; i++)
-        *(pc++) = *(pit++);
-    pit = (char *)&sit.inst2;
-    for (i = 0; i < 5; i++)
-        *(pc++) = *(pit++);
-    pit = (char *)&sit.inst3;
-    for (i = 0; i < 5; i++)
-        *(pc++) = *(pit++);
-
-    sit.used = 0;
-    sit.inst1 = 0;
-    sit.it1 = 0;
-    sit.inst2 = 0;
-    sit.it2 = 0;
-    sit.inst3 = 0;
-    sit.it3 = 0;
-    return pc;
-}
-
-static char *
-loadinst(char *pc, long inst, int itype)
-{
-    char *pit = (char *)&inst;
-    int i;
-
-RELOAD:
-    switch (sit.used++) {
-        case 0:
-                sit.inst1 = inst << 5;
-                if (itype == IT_B) {
-                    sit.inst1 = emit_fill_nop_b << 5;
-                    sit.it1 = IT_B;
-                    sit.inst2 = emit_fill_nop_b >> 2;
-                    sit.it2 = IT_B;
-                    sit.inst3 = inst >> 1;
-                    sit.inst2 |= (long)((inst & 0x1) << 39);
-                    sit.it3 = itype;
-                    sit.used = 3;
-                    return close_template(pc);
-                }
-                else if (itype == IT_M)
-                    sit.it1 = IT_M;
-                else if ((itype == IT_I) || (itype == IT_A)) {
-                    sit.inst1 = ((long)emit_fill_nop_m << 5);
-                    sit.it1 = IT_M;
-                    sit.inst2 = (inst >> 2) & 0x7fffffffff;
-                    sit.inst1 |= (long)((inst & 0x3) << 46);
-                    sit.it2 = IT_I;
-                    sit.used++;
-                }
-                else if (itype == IT_L) {
-                    sit.it1 = IT_M;
-                    sit.inst1 = ((long)emit_fill_nop_m << 5);
-                    sit.inst2 = (inst >> 2) & 0x7fffffffff;
-                    sit.inst1 |= (long)((inst & 0x3) << 46);
-                    sit.it2 = itype;
-                    sit.used++;
-                }
-                break;
-        case 1:
-                if (itype == IT_A)
-                    sit.it2 = IT_I;
-                else
-                    sit.it2 = itype;
-                sit.inst2 = (inst >> 2) & 0x7fffffffff;
-                sit.inst1 |= (long)((inst & 0x3) << 46);
-                break;
-        case 2:
-                if (itype == IT_A)
-                    sit.it3 = IT_I;
-                else
-                    sit.it3 = itype;
-                if (invalid_template()) {
-                    pc = close_template(pc);
-                    goto RELOAD;
-                }
-                sit.inst3 = inst >> 1;
-                sit.inst2 |= (long)((inst & 0x1) << 39);
-                pc = close_template(pc);
-                return pc;
-    }
-
-    if (invalid_template())
-        pc = close_template(pc);
-
-    return pc;
-}
-
-static void
-jit_emit_bc(Parrot_jit_info_t *jit_info, opcode_t disp)
-{
-    opcode_t opcode = jit_info->op_i + disp;
-    int offset;
-    if (opcode <= jit_info->op_i) {
-        offset = jit_info->arena.op_map[opcode].offset -
-            (jit_info->native_ptr - jit_info->arena.start);
-        if (jit_info->optimizer->cur_section->branch_target ==
-            jit_info->optimizer->cur_section)
-                offset +=
-                    jit_info->optimizer->cur_section->branch_target->load_size;
-    }
-    else {
-        offset = 0;
-        Parrot_jit_newfixup(jit_info);
-        jit_info->arena.fixups->type = JIT_IA64_BRANCH;
-        jit_info->arena.fixups->param.opcode = opcode;
-
-        if (jit_info->optimizer->cur_section->branch_target ==
-            jit_info->optimizer->cur_section)
-                jit_info->arena.fixups->skip =
-                    jit_info->optimizer->cur_section->branch_target->load_size;
-
-    }
-    emit_b1(jit_info->native_ptr, dh_none, bwh_dptk, offset >> 4, ph_few, 0, 7);
-}
-
-static void
-Parrot_jit_jump_to_ret(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-    jit_emit_sub_rrr(NATIVE_PTR, ISR1, R_RETURN, R_BYTECODE);
-    jit_emit_add_rrr(NATIVE_PTR, ISR1, ISR1, R_OPMAP);
-    emit_m1(NATIVE_PTR, 3, ISR1, ISR1);
-    NATIVE_PTR = close_template(NATIVE_PTR);
-    emit_i21(NATIVE_PTR, 0, ISR1);
-    emit_b4(NATIVE_PTR, dh_none, bwh_sptk, 0x20, 0, ph_many, 0);
-}
-
-void
-Parrot_jit_begin(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-    emit_m34(NATIVE_PTR, RSRV_REG, 2, 0, RSF);
-    jit_emit_mov_rr(NATIVE_PTR, 1, 4);
-    jit_emit_mov_rr(NATIVE_PTR, R_INTREP, R_ARG1);
-    jit_emit_mov_rr(NATIVE_PTR, R_BYTECODE, R_ARG2);
-    jit_emit_mov_ri_i(NATIVE_PTR, R_OPMAP, jit_info->arena.op_map);
-    jit_emit_mov_rr(NATIVE_PTR, 35, 12);
-    emit_i22(NATIVE_PTR, R_RETURN_ADR, 0);
-    jit_emit_mov_rr(NATIVE_PTR, 8, R_ARG2);
-    Parrot_jit_jump_to_ret(jit_info, interp);
-}
-
-static void
-fixup_jump_addr(char *fixup_ptr, long d)
-{
-    char *pit;
-    long tmp, i;
-
-    tmp = (long)(((long)((d >> 21) & 0xfffff) << 35) |
-        ((long)((d & 0xfffff) << 12)));
-    for (i = 0; i < 11; i++)
-        fixup_ptr++;
-    pit = (char *)&tmp;
-    for (i = 0; i < 5; i++)
-        *(fixup_ptr++) |= *(pit++);
-}
-
-void
-Parrot_jit_dofixup(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-    Parrot_jit_fixup_t *fixup;
-    char *fixup_ptr, *pit, *disp;
-    long d, tmp, i;
-
-    fixup = jit_info->arena.fixups;
-
-    while (fixup){
-        switch (fixup->type){
-            case JIT_IA64_CALL:
-                fixup_ptr = Parrot_jit_fixup_target(jit_info, fixup);
-                d = (((long)fixup->param.fptr - (long)fixup_ptr)) >> 4;
-                emit_x4(fixup_ptr, dh_none, bwh_sptk, d, ph_many, 0);
-                break;
-            case JIT_IA64_BRANCH:
-                fixup_ptr = Parrot_jit_fixup_target(jit_info, fixup);
-                d = (jit_info->arena.op_map[fixup->param.opcode].offset
-                    - fixup->native_offset + fixup->skip) >> 4;
-                fixup_jump_addr(fixup_ptr, d);
-                break;
-
-            default:
-                exit_fatal(EXCEPTION_JIT_ERROR, "Unknown fixup type:%d\n",
-                                   fixup->type);
-                break;
-        }
-        fixup = fixup->next;
-    }
-}
-
-void
-Parrot_jit_normal_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-    emit_a4(NATIVE_PTR, R_BYTECODE,
-        ((long)jit_info->cur_op - (long)interp->code->base.data),
-            (R_ARG1 + RSRV_REG));
-    jit_emit_mov_rr(NATIVE_PTR, (R_ARG2 + RSRV_REG), R_INTREP);
-    jit_emit_mov_rr(NATIVE_PTR, 32, 1);
-
-    NATIVE_PTR = close_template(NATIVE_PTR);
-    Parrot_jit_newfixup(jit_info);
-
-    jit_info->arena.fixups->type = JIT_IA64_CALL;
-    jit_info->arena.fixups->param.fptr =
-        (void (*)(void))(*(long *)(
-            interp->op_func_table[*(jit_info->cur_op)]));
-
-    emit_x4(NATIVE_PTR, dh_none, bwh_sptk, 0, ph_many, 0);
-    jit_emit_mov_rr(NATIVE_PTR, 1, 32);
-    NATIVE_PTR = close_template(NATIVE_PTR);
-}
-
-void
-Parrot_jit_cpcf_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-    Parrot_jit_normal_op(jit_info, interp);
-    Parrot_jit_jump_to_ret(jit_info, interp);
-}
-
-#  undef Parrot_jit_restart_op
-void
-Parrot_jit_restart_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-    char *jmp_ptr, *sav_ptr;
-
-    Parrot_jit_normal_op(jit_info, interp);
-    /* test r8, if zero (e.g after trace), return from JIT */
-    jit_emit_cmp_r0(jit_info->native_ptr, R_RETURN);
-    /* remember PC */
-    jmp_ptr = jit_info->native_ptr;
-    emit_b1(jit_info->native_ptr, dh_none, bwh_dptk, 0, ph_few, 0, 7);
-    jit_emit_end(jit_info->native_ptr);
-    /* fixup above jump */
-    sav_ptr = jit_info->native_ptr;
-    jit_info->native_ptr = jmp_ptr;
-    fixup_jump_addr(jit_info->native_ptr, (long)((sav_ptr - jmp_ptr) >> 4));
-    /* restore PC */
-    jit_info->native_ptr = sav_ptr;
-    Parrot_jit_jump_to_ret(jit_info, interp);
-}
-
-/* move reg to mem (i.e. intreg) */
-void
-Parrot_jit_emit_mov_mr(PARROT_INTERP, char *mem, int reg)
-{
-    jit_emit_mov_mr_i(
-        ((Parrot_jit_info_t *)(interp->code->jit_info))->native_ptr, mem, reg);
-    NATIVE_PTR = close_template(NATIVE_PTR);
-}
-
-/* move mem (i.e. intreg) to reg */
-void
-Parrot_jit_emit_mov_rm(PARROT_INTERP, int reg, char *mem)
-{
-    jit_emit_mov_rm_i(
-        ((Parrot_jit_info_t *)(interp->code->jit_info))->native_ptr, reg, mem);
-    NATIVE_PTR = close_template(NATIVE_PTR);
-}
-
-/* move reg to mem (i.e. numreg) */
-void
-Parrot_jit_emit_mov_mr_n(PARROT_INTERP, char *mem, int reg)
-{
-}
-
-/* move mem (i.e. numreg) to reg */
-void
-Parrot_jit_emit_mov_rm_n(PARROT_INTERP, int reg, char *mem)
-{
-}
-
-
-
-#endif /* JIT_EMIT */
-#if JIT_EMIT == 0
-
-#  define REQUIRES_CONSTANT_POOL 0
-#  define INT_REGISTERS_TO_MAP 22
-
-#  ifndef JIT_IMCC
-#    define CACHELINESIZE 32
-
-char intval_map[INT_REGISTERS_TO_MAP] =
-    { 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
-      48, 49, 50, 51, 52, 53, 54, 55, 56, 57 };
-
-static void
-ia64_sync_cache(void *_start, void *_end)
-{
-    char *start = (char*)(((long)_start) &~(CACHELINESIZE - 1));
-    char *end = (char *)((((long)_end)+CACHELINESIZE-1) &~(CACHELINESIZE - 1));
-    char *_sync;
-
-    for (_sync = start; _sync < end; _sync += CACHELINESIZE) {
-        __asm__ __volatile__(
-        "fc %0\n"
-        ";;\n"
-        "sync.i\n"
-        ";;\n"
-        "srlz.i\n"
-        ";;\n"
-        :
-        : "r" ((long)_sync));
-    }
-}
-
-#  endif
-
-#endif /* !JIT_EMIT */
-
-#endif /* PARROT_JIT_IA64_JIT_EMIT_H_GUARD */
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/mips/core.jit
==============================================================================
--- branches/orderedhash_revamp/src/jit/mips/core.jit	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,58 +0,0 @@
-;
-; mips/core.jit
-;
-;
-; $Id$
-;
-
-Parrot_end {
-    emit_lw(NATIVECODE, ra, 32, sp);
-    emit_lw(NATIVECODE, fp, 28, sp);
-    emit_addiu(jit_info->native_ptr, sp, sp, 40);
-    emit_jr(NATIVECODE, ra);
-}
-
-Parrot_set_i_ic {
-    if (MAP[1]) {
-        emit_imm32(NATIVECODE, MAP[1], *INT_CONST[2]);
-    }
-    else {
-        emit_imm32(NATIVECODE, at, *INT_CONST[2]);
-        emit_sw_r(NATIVECODE, at, ROFFS_INT(1));
-    }
-}
-
-Parrot_set_i_i {
-    if (MAP[1] && MAP[2]) {
-        emit_mov(NATIVECODE, MAP[1], MAP[2]);
-    }
-    else if (MAP[1]) {
-        emit_lw_r(NATIVECODE, MAP[1], ROFFS_INT(2));
-    }
-    else if (MAP[2]) {
-        emit_sw_r(NATIVECODE, MAP[2], ROFFS_INT(1));
-    }
-    else {
-        emit_lw_r(NATIVECODE, at, ROFFS_INT(2));
-        emit_sw_r(NATIVECODE, at, ROFFS_INT(1));
-    }
-}
-
-Parrot_neg_i_i {
-    if (MAP[1] && MAP[2]) {
-        emit_neg(NATIVECODE, MAP[1], MAP[2]);
-    }
-    else if (MAP[1]) {
-        emit_lw_r(NATIVECODE, at, ROFFS_INT(2));
-        emit_neg(NATIVECODE, MAP[1], at);
-    }
-    else if (MAP[2]) {
-        emit_neg(NATIVECODE, at, MAP[1]);
-        emit_sw_r(NATIVECODE, at, ROFFS_INT(1));
-    }
-    else {
-        emit_lw_r(NATIVECODE, at, ROFFS_INT(2));
-        emit_neg(NATIVECODE, at, at);
-        emit_sw_r(NATIVECODE, at, ROFFS_INT(1));
-    }
-}

Deleted: branches/orderedhash_revamp/src/jit/mips/jit_defs.c
==============================================================================
--- branches/orderedhash_revamp/src/jit/mips/jit_defs.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,13 +0,0 @@
-/* Stub file for RT#38929 fixes */
-/*
-Copyright (C) 2008, Parrot Foundation.
-$Id$
-*/
-/* HEADERIZER HFILE: none */
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/mips/jit_emit.h
==============================================================================
--- branches/orderedhash_revamp/src/jit/mips/jit_emit.h	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,497 +0,0 @@
-/*
- * Copyright (C) 2003-2008, Parrot Foundation.
- */
-
-/*
- * jit_emit.h
- *
- * SVN Info
- *    $Id$
- * Overview:
- *    MIPS JIT
- * History:
- *      Initial version by Daniel Grunblatt on 2002.8.20
- * Notes:
- * References:
- */
-
-#ifndef PARROT_MIPS_JIT_EMIT_H_GUARD
-#define PARROT_MIPS_JIT_EMIT_H_GUARD
-
-#  define BASE_REG s0
-#  define Parrot_jit_emit_get_base_reg_no(pc) BASE_REG
-
-typedef enum {
-    zero,
-    at,
-    v0,
-    v1,
-    a0,
-    a1,
-    a2,
-    a3,
-    t0,
-    t1,
-    t2,
-    t3,
-    t4,
-    t5,
-    t6,
-    t7,
-    s0,
-    s1,
-    s2,
-    s3,
-    s4,
-    s5,
-    s6,
-    s7,
-    t8,
-    t9,
-    k0,
-    k1,
-    gp,
-    sp,
-    fp,
-    ra
-} mips_register_t;
-
-#if JIT_EMIT
-
-enum { JIT_MIPS_CALL, JIT_MIPS_BRANCH };
-
-/*
- * R type
- *
- *  +--------------------------------------------------------------------+
- *  |  Opcode  |    rs    |    rt    |    rd    |    re    |    funct    |
- *  +--------------------------------------------------------------------+
- *   31      26 25      21 20      16 15      11 10       6 5           0
- *
- */
-
-#  define emit_r(pc, opcode, rs, rt, rd, re, funct) \
-      *(int *)(((pc) += 4) - 4) = \
-        (opcode) << 26 | (rs) << 21 | (rt) << 16 | (rd) << 11 | (re) << 6 | (funct);
-
-/*
- * I type
- *
- *  +--------------------------------------------------------------------+
- *  |  Opcode  |     rs     |     rt     |            offset             |
- *  +--------------------------------------------------------------------+
- *   31      26 25        21 20        16 15                            0
- *
- */
-
-#  define emit_i(pc, opcode, rs, rt, offset) \
-      *(int *)(((pc) += 4) - 4) = \
-        (opcode) << 26 | (rs) << 21 | (rt) << 16 | ((long)(offset) & 0xffff);
-
-/*
- * J type
- *
- *  +--------------------------------------------------------------------+
- *  |  Opcode  |                       target                            |
- *  +--------------------------------------------------------------------+
- *   31      26 25                                                      0
- *
- */
-
-#  define emit_j(pc, opcode, target) \
-      *(int *)(((pc) += 4) - 4) = (opcode) << 26 | (target);
-
-#  define emit_nop(pc) emit_j((pc), 0, 0)
-
-/*  LW
- *
- *  To load a word from memory as a signed value.
- *  rt = (rs + offset)
- */
-
-#  define emit_lw(pc, rt, offset, rs) \
-      emit_i((pc), 0x23, (rs), (rt), (offset))
-
-#  define emit_sw(pc, rt, offset, rs) \
-      emit_i((pc), 0x2b, (rs), (rt), (offset))
-
-#  define emit_sw_r(pc, reg, addr) \
-      emit_sw((pc), (reg), (addr), BASE_REG)
-
-#  define emit_lw_r(pc, reg, addr) \
-      emit_lw((pc), (reg), (addr), BASE_REG)
-
-/*  LUI
- *
- *  To load a constant into the upper half of a word.
- *  rt = imm << 16
- */
-
-#  define emit_lui(pc, rt, imm) \
-      emit_i((pc), 0xf, 0, (rt), (imm))
-
-/*  AND
- *
- *  To do a bitwise logical AND.
- *  rd = rs ^ rt
- */
-
-#  define emit_and(pc, rd, rs, rt) \
-      emit_r((pc), 0, (rs), (rt), (rd), 0, 0x24)
-
-/*  OR
- *
- *  To do a bitwise logical OR.
- *  rd = rs | rt
- */
-
-#  define emit_or(pc, rd, rs, rt) \
-      emit_r((pc), 0, (rs), (rt), (rd), 0, 0x25)
-
-/*  XOR
- *
- *  To do a bitwise logical EXCLUSIVE OR.
- *  rd = rs ^ rt
- */
-
-#  define emit_xor(pc, rd, rs, rt) \
-      emit_r((pc), 0, (rs), (rt), (rd), 0, 0x26)
-
-
-/*  ORI
- *
- *  To do a bitwise logical OR with a constant.
- *  rt = rs | imm
- */
-
-#  define emit_ori(pc, rs, rt, imm) \
-      emit_i((pc), 0xd, (rs), (rt), (imm))
-
-/*  ADD
- *
- *  To add 32 bit integers.
- *  rd = rs + rt
- */
-
-#  define emit_add(pc, rd, rs, rt) \
-      emit_r((pc), 0, (rs), (rt), (rd), 0, 0x20)
-
-/*  ADDIU
- *
- *  To add a constant to a 32 bit integer.
- *  rt = rs + imm
- */
-
-#  define emit_addiu(pc, rs, rt, imm) \
-      emit_i((pc), 9, (rs), (rt), (imm))
-
-/*  SUB
- *
- *  To substract 32 bit integers.
- *  rd = rs - rt
- */
-
-#  define emit_sub(pc, rd, rs, rt) \
-      emit_r((pc), 0, (rs), (rt), (rd), 0, 0x22)
-
-/*  MULT
- *
- *  To multiply 32 bit integers.
- *  (LO , HI) = rs * rt
- */
-
-#  define emit_mult(pc, rs, rt) \
-      emit_r((pc), 0, (rs), (rt), 0, 0, 0x18)
-
-/*  MFLO
- *
- *  To copy the special purpose register LO to a GPR.
- */
-
-#  define emit_mflo(pc, rd) \
-      emit_r((pc), 0, 0, 0, (rd), 0, 0x12)
-
-/*  MUL (Pseudo instruction)
- *
- *  To multiply 32 bit integers.
- *  rd = rs * rt
- */
-
-#  define emit_mul(pc, rd, rs, rt) \
-      emit_mult((pc), (rs), (rt)); \
-      emit_mflo((pc), (rd))
-
-/*  DIV
- *
- *  To divide 32 bit integers.
- *  (LO , HI) = rs / rt
- *  The quotient is placed in LO and the reminder in HI.
- */
-
-#  define emit_divi(pc, rs, rt) \
-      emit_r((pc), 0, (rs), (rt), 0, 0, 0x1a)
-
-/*  DIV (Pseudo instruction)
- *
- *  To divide 32 bit integers.
- *  rd = rs / rt
- */
-
-#  define emit_div(pc, rd, rs, rt) \
-      emit_divi((pc), (rs), (rt)); \
-      emit_mflo((pc), (rd))
-
-/*  JR
- *
- *  To branch to an instruction address in a register.
- *  PC = rs
- */
-
-#  define emit_jr(pc, rs) \
-      emit_r((pc), 0, (rs), 0, 0, 0, 8)
-
-/*  JAL
- *
- *  To procedure call within the current 256 MB aligned region.
- */
-
-#  define emit_jal(pc) \
-      emit_j((pc), 3, 0)
-
-/*  JALR
- *
- *  To procedure call to an instruction address in a register.
- */
-
-#  define emit_jalr(pc, rs, rd) \
-      emit_r((pc), 0, (rs),  0, (rd), 0, 9)
-
-/*  MOVE
- *
- *  To move a GPR.
- *  rd = rs
- */
-
-#  define emit_move(pc, rs, rd) \
-      emit_r((pc), 0, (rs), 0, (rd), 0, 0x21)
-
-#  define emit_mov(pc, rd, rs) \
-      emit_move((pc), (rs), (rd))
-
-/*  NEG
- *  rd = -rt
- */
-
-#  define emit_negu(pc, rd, rt) \
-      emit_r((pc), 0, 0, (rt), (rd), 0, 0x23)
-
-#  define emit_neg(pc, rd, rt) \
-      emit_r((pc), 0, 0, (rt), (rd), 0, 0x22)
-
-/* Load a constant */
-
-#  define emit_imm32(pc, rd, imm) \
-      emit_lui((pc), (rd), ((long)(imm) >> 16)); \
-      emit_ori((pc), (rd), (rd), (imm))
-
-
-static void
-emit_if(Parrot_jit_info_t *jit_info, char opcode, mips_register_t rs,
-    mips_register_t rt, opcode_t disp)
-{
-    opcode_t opcode = jit_info->op_i + disp;
-    int offset;
-
-    if (opcode <= jit_info->op_i) {
-        offset = jit_info->arena.op_map[opcode].offset -
-            (jit_info->native_ptr - jit_info->arena.start);
-        if (jit_info->optimizer->cur_section->branch_target ==
-            jit_info->optimizer->cur_section)
-                offset +=
-                    jit_info->optimizer->cur_section->branch_target->load_size;
-    }
-    else {
-        offset = 0;
-        Parrot_jit_newfixup(jit_info);
-        jit_info->arena.fixups->type = JIT_MIPS_BRANCH;
-        jit_info->arena.fixups->param.opcode = opcode;
-
-        if (jit_info->optimizer->cur_section->branch_target ==
-            jit_info->optimizer->cur_section)
-                jit_info->arena.fixups->skip =
-                    jit_info->optimizer->cur_section->branch_target->load_size;
-
-    }
-    emit_i(jit_info->native_ptr, opcode, rs, rt, offset);
-}
-
-/*  BEQ
- *
- *  To compare GPRs then do a PC-relative conditional branch.
- *  if (rs == rt) branch
- */
-
-#  define emit_beq(pc, rs, rt, imm) \
-      emit_if((pc), 4, (rs), (rt), (imm))
-
-/*  BNE
- *
- *  To compare GPRs then do a PC-relative conditional branch.
- *  if (rs != rt) branch
- */
-
-#  define emit_bne(pc, rs, rt, imm) \
-      emit_if((pc), 5, (rs), (rt), (imm))
-
-/*  BNEZ
- *
- *  To compare GPRs then do a PC-relative conditional branch.
- *  if (rs != 0) branch
- */
-
-#  define emit_bnez(pc, rs, imm) \
-      emit_if((pc), 1, (rs), 2, (imm))
-
-
-/*  BEGZ
- *
- *  To compare GPRs then do a PC-relative conditional branch.
- *  if (rs >= 0) branch
- */
-
-#  define emit_begz(pc, rs, imm) \
-      emit_if((pc), 1, (rs), 1, (imm))
-
-/*  SLT
- *
- *  To record the result of a less than comparison.
- *  rd <- (rs < rt)
- */
-
-#  define emit_slt(pc, rs, rt, rd) \
-      emit_r((pc), 0, (rs), (rt), (rd), 0, 0x2a)
-
-/*  GE (Pseudo-op)
- */
-#  define emit_ge(pc, rs, rt, imm) \
-      emit_slt((pc), (rs), (rt), (at)); \
-      emit_beqz((pc), (at), (imm))
-
-#endif /* JIT_EMIT */
-
-#if JIT_EMIT == 2
-
-void
-Parrot_jit_begin(Parrot_jit_info_t *jit_info,
-                 PARROT_INTERP)
-{
-    emit_addiu(jit_info->native_ptr, sp, sp, -40);
-    emit_sw(jit_info->native_ptr, ra, 32, sp);
-    emit_sw(jit_info->native_ptr, fp, 28, sp);
-    emit_mov(jit_info->native_ptr, s0, a0);
-    emit_imm32(jit_info->native_ptr, s1, jit_info->arena.op_map);
-    emit_imm32(jit_info->native_ptr, s2, interp->code->base.data);
-}
-
-void
-Parrot_jit_dofixup(Parrot_jit_info_t *jit_info,
-    Interp * interp)
-{
-    Parrot_jit_fixup_t *fixup;
-    char *fixup_ptr;
-    char *disp;
-    long d, high, low;
-
-    fixup = jit_info->arena.fixups;
-
-    while (fixup) {
-        switch (fixup->type) {
-            case JIT_MIPS_CALL:
-                fixup_ptr = Parrot_jit_fixup_target(jit_info, fixup);
-                d = (((long)fixup->param.fptr - (long)0x10000000) / 4);
-                *(fixup_ptr++) |= (char)(d >> 29) & 3;
-                *(fixup_ptr++) = (char)(d >> 16);
-                *(fixup_ptr++) = (char)(d >> 8);
-                *(fixup_ptr++) |= (char)d & ~3;
-                break;
-            default:
-                exit_fatal(EXCEPTION_JIT_ERROR, "Unknown fixup type:%d\n",
-                                   fixup->type);
-                break;
-        }
-        fixup = fixup->next;
-    }
-}
-
-void
-Parrot_jit_normal_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-}
-
-void
-Parrot_jit_cpcf_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-}
-
-/*void
-Parrot_jit_restart_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-}*/
-
-/* move reg to mem (i.e. intreg) */
-void
-Parrot_jit_emit_mov_mr_offs(PARROT_INTERP, int base, size_t offs, int reg)
-{
-}
-
-/* move mem (i.e. intreg) to reg */
-void
-Parrot_jit_emit_mov_rm_offs(PARROT_INTERP, int reg, int base, size_t offs)
-{
-}
-
-void
-Parrot_jit_emit_mov_mr_n_offs(PARROT_INTERP, int base, size_t offs, int reg)
-{
-}
-
-void
-Parrot_jit_emit_mov_rm_n_offs(PARROT_INTERP, int reg, int base, size_t offs)
-{
-}
-
-
-#endif /* JIT_EMIT == 2 */
-
-#if JIT_EMIT == 0
-
-#  define REQUIRES_CONSTANT_POOL 0
-#  define INT_REGISTERS_TO_MAP 24
-
-#  ifndef JIT_IMCC
-static char intval_map[INT_REGISTERS_TO_MAP] =
-    { v0, v1, a0, a1, a2, a3, t0, t1, t2, t3, t4, t5, t6, t7, s0, s1, s2, s3,
-      s4, s5, s6, s7, t8, t9 };
-
-#    include <asm/cachectl.h>
-
-extern int cacheflush(char* addr, int nbytes, int cache);
-static void sync_cache(void *_start, void *_end);
-
-static void
-sync_cache(void *_start, void *_end)
-{
-    cacheflush((char*)_start, (int)((char *)_end - (char *)_start), BCACHE);
-}
-
-#  endif /* JIT_IMCC */
-#endif /* JIT_EMIT == 0 */
-#endif /* PARROT_MIPS_JIT_EMIT_H_GUARD */
-
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/ppc/asm.s
==============================================================================
--- branches/orderedhash_revamp/src/jit/ppc/asm.s	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,51 +0,0 @@
-.text
-    .align 12
-#if !defined(__NetBSD__) && !defined(__OpenBSD__)
-    .globl _Parrot_ppc_jit_restore_nonvolatile_registers
-_Parrot_ppc_jit_restore_nonvolatile_registers:
-#else
-    .globl Parrot_ppc_jit_restore_nonvolatile_registers
-Parrot_ppc_jit_restore_nonvolatile_registers:
-#endif
-
-#if defined(__NetBSD__) || defined(__OpenBSD__)
-    lfd     %f14,-84(%r1)
-    lfd     %f15,-92(%r1)
-    lfd     %f16,-100(%r1)
-    lfd     %f17,-108(%r1)
-    lfd     %f18,-116(%r1)
-    lfd     %f19,-124(%r1)
-    lfd     %f20,-132(%r1)
-    lfd     %f21,-140(%r1)
-    lfd     %f22,-148(%r1)
-    lfd     %f23,-156(%r1)
-    lfd     %f24,-164(%r1)
-    lfd     %f25,-172(%r1)
-    lfd     %f26,-180(%r1)
-    lfd     %f27,-188(%r1)
-    lfd     %f28,-196(%r1)
-    lfd     %f29,-204(%r1)
-    lfd     %f30,-212(%r1)
-    lfd     %f31,-220(%r1)
-#else /* !__NetBSD__ && !__OpenBSD__ */
-    lfd     f14,-84(r1)
-    lfd     f15,-92(r1)
-    lfd     f16,-100(r1)
-    lfd     f17,-108(r1)
-    lfd     f18,-116(r1)
-    lfd     f19,-124(r1)
-    lfd     f20,-132(r1)
-    lfd     f21,-140(r1)
-    lfd     f22,-148(r1)
-    lfd     f23,-156(r1)
-    lfd     f24,-164(r1)
-    lfd     f25,-172(r1)
-    lfd     f26,-180(r1)
-    lfd     f27,-188(r1)
-    lfd     f28,-196(r1)
-    lfd     f29,-204(r1)
-    lfd     f30,-212(r1)
-    lfd     f31,-220(r1)
-#endif /* __NetBSD__ || __OpenBSD__ */
-
-    blr

Deleted: branches/orderedhash_revamp/src/jit/ppc/core.jit
==============================================================================
--- branches/orderedhash_revamp/src/jit/ppc/core.jit	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,1312 +0,0 @@
-;
-; ppc/core.jit
-;
-;
-; $Id$
-;
-
-# TODO complete this
-#define P_ARITH ((PREV_OP == dec_i) || (PREV_OP == inc_i) || (PREV_OP == sub_i_i_i))
-Parrot_end {
-    jit_emit_lwz(NATIVECODE, r1, 0, r1);
-    jit_emit_lwz(NATIVECODE, r0, 8, r1);
-
-    jit_emit_call_func(NATIVECODE, (void *)Parrot_ppc_jit_restore_nonvolatile_registers);
-
-    jit_emit_mtlr(NATIVECODE, r0);
-    jit_emit_lmw(NATIVECODE, r13, -PPC_JIT_GP_REGISTER_SAVE_SPACE, r1);
-
-    jit_emit_blr(NATIVECODE);
-}
-
-Parrot_noop {
-; preferred no-op on ppc
-    jit_emit_ori(NATIVECODE, r0, r0, 0);
-}
-
-Parrot_set_i_ic {
-    if (MAP[1]) {
-        jit_emit_mov_ri_i(NATIVECODE, MAP[1], *INT_CONST[2]);
-    }
-    else {
-        jit_emit_mov_ri_i(NATIVECODE, ISR1, *INT_CONST[2]);
-        jit_emit_mov_mr_i(NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-}
-
-Parrot_set_i_n {
-    if (MAP[2]) {
-    jit_emit_fctiwz  (NATIVECODE, FSR2, MAP[2]);
-    }
-    else {
-        jit_emit_mov_rm_n(NATIVECODE, FSR1, ROFFS_NUM(2));
-    jit_emit_fctiwz  (NATIVECODE, FSR2, FSR1);
-    }
-    if (MAP[1]) {
-    jit_emit_add_rri_i(NATIVECODE, ISR1, 0, -4);
-    jit_emit_stfiwx   (NATIVECODE, FSR2, ISR1, r1);   /* -> -4(sp) */
-    jit_emit_lwz      (NATIVECODE, MAP[1], -4, r1);
-    }
-    else {
-    jit_emit_add_rri_i(NATIVECODE, ISR1, 0, ROFFS_INT(1));
-    jit_emit_stfiwx   (NATIVECODE, FSR2, ISR1, r13);   /* -> offs(base) */
-    }
-}
-
-Parrot_set_n_ic {
-    static double xx = 4503601774854144.0; /* 0x4330000080000000L; */
-    jit_emit_mov_ri_i(NATIVECODE, ISR1, *INT_CONST[2]);
-    jit_emit_xoris(   NATIVECODE, ISR1, ISR1, 0x8000);
-    /* use redzone for intermediate */
-    jit_emit_stw(     NATIVECODE, ISR1, -4, r1);
-    jit_emit_addis(   NATIVECODE, ISR1, r31, 0x4330);
-    jit_emit_stw(     NATIVECODE, ISR1, -8, r1);
-    jit_emit_lfd(     NATIVECODE, FSR1, -8, r1);
-    /* we should keep this magic const in a preserved eg eg. f31 */
-    jit_emit_mov_ri_i(NATIVECODE, ISR2, &xx);
-    jit_emit_lfd(     NATIVECODE, FSR2, 0, ISR2);
-    if (MAP[1]) {
-    jit_emit_fsub_rrr(NATIVECODE, MAP[1], FSR1, FSR2);
-    }
-    else {
-    jit_emit_fsub_rrr(NATIVECODE, FSR1, FSR1, FSR2);
-        jit_emit_mov_mr_n(NATIVECODE, ROFFS_NUM(1), FSR1);
-    }
-}
-
-Parrot_set_n_i {
-    static double xx = 4503601774854144.0; /* 0x4330000080000000L; */
-    if (MAP[2]) {
-    jit_emit_xoris(   NATIVECODE, ISR1, MAP[2], 0x8000);
-    }
-    else {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, ROFFS_INT(2));
-    jit_emit_xoris(   NATIVECODE, ISR1, ISR1, 0x8000);
-    }
-    /* use redzone for intermediate */
-    jit_emit_stw(     NATIVECODE, ISR1, -4, r1);
-    jit_emit_addis(   NATIVECODE, ISR1, r31, 0x4330);
-    jit_emit_stw(     NATIVECODE, ISR1, -8, r1);
-    jit_emit_lfd(     NATIVECODE, FSR1, -8, r1);
-    /* we should keep this magic const in a preserved eg  f31 */
-    jit_emit_mov_ri_i(NATIVECODE, ISR2, &xx);
-    jit_emit_lfd(     NATIVECODE, FSR2, 0, ISR2);
-    if (MAP[1]) {
-    jit_emit_fsub_rrr(NATIVECODE, MAP[1], FSR1, FSR2);
-    }
-    else {
-    jit_emit_fsub_rrr(NATIVECODE, FSR1, FSR1, FSR2);
-        jit_emit_mov_mr_n(NATIVECODE, ROFFS_NUM(1), FSR1);
-    }
-}
-
-Parrot_null_i {
-    if (MAP[1]) {
-        jit_emit_mov_rr(NATIVECODE, MAP[1], r31);
-    }
-    else {
-        jit_emit_mov_mr_i(NATIVECODE, ROFFS_INT(1), r31);
-    }
-}
-
-TEMPLATE Parrot_set_x_x {
-    if (MAP[1] && MAP[2]) {
-        jit_emit_mov_rr(NATIVECODE, MAP[1], MAP[2]);
-    }
-    else if (MAP[1]) {
-        jit_emit_mov_rm_i(NATIVECODE, MAP[1], ROFFS_INT(2));
-    }
-    else if (MAP[2]) {
-        jit_emit_mov_mr_i(NATIVECODE, ROFFS_INT(1), MAP[2]);
-    }
-    else {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, ROFFS_INT(2));
-        jit_emit_mov_mr_i(NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-}
-
-Parrot_set_i_i {
-    Parrot_set_x_x
-}
-
-Parrot_set_s_s {
-    Parrot_set_x_x s/INT/STR/`
-}
-
-Parrot_set_p_p {
-    Parrot_set_x_x s/INT/PMC/
-}
-
-Parrot_set_n_n {
-    if (MAP[1] && MAP[2]) {
-        jit_emit_mov_rr_n(NATIVECODE, MAP[1], MAP[2]);
-    }
-    else if (MAP[1]) {
-    jit_emit_mov_rm_n(NATIVECODE, MAP[1], ROFFS_NUM(2));
-    }
-    else if (MAP[2]) {
-        jit_emit_mov_mr_n(NATIVECODE, ROFFS_NUM(1), MAP[2]);
-    }
-    else {
-    jit_emit_mov_rm_n(NATIVECODE, FSR1, ROFFS_NUM(2));
-        jit_emit_mov_mr_n(NATIVECODE, ROFFS_NUM(1), FSR1);
-    }
-}
-
-Parrot_set_n_nc {
-    if (MAP[1]) {
-        jit_emit_mov_ri_i(NATIVECODE, ISR1, &NUM_CONST[2]);
-        jit_emit_lfd(NATIVECODE, MAP[1], 0, ISR1);
-    }
-    else {
-        jit_emit_mov_ri_i(NATIVECODE, ISR1, &NUM_CONST[2]);
-        jit_emit_lfd(NATIVECODE, FSR1, 0, ISR1);
-        jit_emit_mov_mr_n(NATIVECODE, ROFFS_NUM(1), FSR1);
-    }
-}
-
-TEMPLATE unary_x_x {
-    if (MAP[1] && MAP[2]) {
-        jit_emit_<op>_rr<_N>(NATIVECODE, MAP[1], MAP[2]);
-    }
-    else if (MAP[1]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<t>(2));
-        jit_emit_<op>_rr<_N>(NATIVECODE, MAP[1], <s1>);
-    }
-    else if (MAP[2]) {
-        jit_emit_<op>_rr<_N>(NATIVECODE, <s1>, MAP[1]);
-        jit_emit_mov_mr<_N>(NATIVECODE, ROFFS_<t>(1), <s1>);
-    }
-    else {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<t>(2));
-        jit_emit_<op>_rr<_N>(NATIVECODE, <s1>, <s1>);
-        jit_emit_mov_mr<_N>(NATIVECODE, ROFFS_<t>(1), <s1>);
-    }
-}
-
-TEMPLATE unary_i_i {
-    unary_x_x s/<_N>/_i/ s/<t>/INT/ s/<s1>/ISR1/
-}
-
-TEMPLATE unary_n_n {
-    unary_x_x s/<_N>/_n/ s/<t>/NUM/ s/<s1>/FSR1/
-}
-
-Parrot_neg_i_i {
-    unary_i_i s/<op>/neg/
-}
-
-Parrot_neg_n_n {
-    unary_n_n s/<op>/neg/
-}
-
-Parrot_abs_n_n {
-    unary_n_n s/<op>/abs/
-}
-
-TEMPLATE binop_x_xc {
-    int im;
-    if (MAP[1]) {
-#ifdef jit_emit_<op>_rri<_N>
-    im = *INT_CONST[2];
-    /* *if* immediate constant is small and there is a dedicated
-     * opcode, just use it
-     * _n variants don't have immediates, only _i
-     *
-     * This could be further improved, if there exists also
-     * a shifted opcode variant like 'oris'. But then this code
-     * should be factored out into jit_emit.h. This OTOH needs some
-     * convention about scratch register usage.
-     */
-    if (!(im >> 16)) {
-        jit_emit_<op>_rri_i(NATIVECODE, MAP[1], MAP[1], im);
-    }
-    else
-#endif
-    {
-        jit_emit_mov_ri<_N>(NATIVECODE, <s1>, <c>_CONST[2]);
-        jit_emit_<op>_rrr<_N>(NATIVECODE, MAP[1], MAP[1], <s1>);
-    }
-    }
-    else {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<t>(1));
-#ifdef jit_emit_<op>_rri<_N>
-    im = *INT_CONST[2];
-    if (!(im >> 16)) {
-        jit_emit_<op>_rri_i(NATIVECODE, <s1>, <s1>, im);
-    }
-    else
-#endif
-    {
-        jit_emit_mov_ri<_N>(NATIVECODE, <s2>, <c>_CONST[2]);
-        jit_emit_<op>_rrr<_N>(NATIVECODE, <s1>, <s1>, <s2>);
-    }
-        jit_emit_mov_mr<_N>(NATIVECODE, ROFFS_<t>(1), <s1>);
-    }
-}
-
-TEMPLATE binop_n_nc {
-    binop_x_xc s/<_N>/_n/ s/<t>/NUM/ s/<s1>/FSR1/ s/<s2>/FSR2/ s/<c>/&NUM/
-}
-
-TEMPLATE binop_i_ic {
-    binop_x_xc s/<_N>/_i/ s/<t>/INT/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<c>/*INT/
-}
-
-TEMPLATE binop_x_x {
-    if (MAP[1] && MAP[2]) {
-        jit_emit_<op>_rrr<_N>(NATIVECODE, MAP[1], MAP[1], MAP[2]);
-    }
-    else if (MAP[1]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<T>(2));
-        jit_emit_<op>_rrr<_N>(NATIVECODE, MAP[1], MAP[1], <s1>);
-    }
-    else if (MAP[2]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<T>(1));
-        jit_emit_<op>_rrr<_N>(NATIVECODE, <s1>, <s1>, MAP[2]);
-        jit_emit_mov_mr<_N>(NATIVECODE, ROFFS_<T>(1), <s1>);
-    }
-    else {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<T>(1));
-        jit_emit_mov_rm<_N>(NATIVECODE, <s2>, ROFFS_<T>(2));
-        jit_emit_<op>_rrr<_N>(NATIVECODE, <s1>, <s1>, <s2>);
-        jit_emit_mov_mr<_N>(NATIVECODE, ROFFS_<T>(1), <s1>);
-    }
-}
-
-TEMPLATE binop_x_x_x {
-    if (MAP[1] && MAP[2] && MAP[3]) {
-        jit_emit_<op>_rrr<_N>(NATIVECODE, MAP[1], MAP[2], MAP[3]);
-    }
-    else if (MAP[1] && MAP[2]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<T>(3));
-        jit_emit_<op>_rrr<_N>(NATIVECODE, MAP[1], MAP[2], <s1>);
-    }
-    else if (MAP[1] && MAP[3]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<T>(2));
-        jit_emit_<op>_rrr<_N>(NATIVECODE, MAP[1], <s1>, MAP[3]);
-    }
-    else if (MAP[2] && MAP[3]) {
-        jit_emit_<op>_rrr<_N>(NATIVECODE, <s1>, MAP[2], MAP[3]);
-        jit_emit_mov_mr<_N>(NATIVECODE, ROFFS_<T>(1), <s1>);
-    }
-    else if (MAP[1]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<T>(3));
-        jit_emit_mov_rm<_N>(NATIVECODE, <s2>, ROFFS_<T>(2));
-        jit_emit_<op>_rrr<_N>(NATIVECODE, MAP[1], <s2>, <s1>);
-    }
-    else if (MAP[2]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<T>(3));
-        jit_emit_<op>_rrr<_N>(NATIVECODE, <s1>, MAP[2], <s1>);
-        jit_emit_mov_mr<_N>(NATIVECODE, ROFFS_<T>(1), <s1>);
-    }
-    else if (MAP[3]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<T>(2));
-        jit_emit_<op>_rrr<_N>(NATIVECODE, <s1>, <s1>, MAP[3]);
-        jit_emit_mov_mr<_N>(NATIVECODE, ROFFS_<T>(1), <s1>);
-    }
-    else {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<T>(3));
-        jit_emit_mov_rm<_N>(NATIVECODE, <s2>, ROFFS_<T>(2));
-        jit_emit_<op>_rrr<_N>(NATIVECODE, <s1>, <s2>, <s1>);
-        jit_emit_mov_mr<_N>(NATIVECODE, ROFFS_<T>(1), <s1>);
-    }
-}
-
-TEMPLATE binop_x_xc_x {
-    if (MAP[1] && MAP[3]) {
-        jit_emit_mov_ri<_N>(NATIVECODE, <s1>, <c>_CONST[2]);
-        jit_emit_<op>_rrr<_N>(NATIVECODE, MAP[1], <s1>, MAP[3]);
-    }
-    else if (MAP[1]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<t>(3));
-        jit_emit_mov_ri<_N>(NATIVECODE, <s2>, <c>_CONST[2]);
-        jit_emit_<op>_rrr<_N>(NATIVECODE, MAP[1], <s2>, <s1>);
-    }
-    else if (MAP[3]) {
-        jit_emit_mov_ri<_N>(NATIVECODE, <s1>, <c>_CONST[2]);
-        jit_emit_<op>_rrr<_N>(NATIVECODE, <s1>, <s1>, MAP[3]);
-        jit_emit_mov_mr<_N>(NATIVECODE, ROFFS_<t>(1), <s1>);
-    }
-    else {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<t>(3));
-        jit_emit_mov_ri<_N>(NATIVECODE, <s2>, <c>_CONST[2]);
-        jit_emit_<op>_rrr<_N>(NATIVECODE, <s1>, <s2>, <s1>);
-        jit_emit_mov_mr<_N>(NATIVECODE, ROFFS_<t>(1), <s1>);
-    }
-}
-
-TEMPLATE binop_i_ic_i {
-    binop_x_xc_x  s/<_N>/_i/ s/<t>/INT/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<c>/*INT/
-}
-TEMPLATE binop_n_nc_n {
-    binop_x_xc_x  s/<_N>/_n/ s/<t>/NUM/ s/<s1>/FSR1/ s/<s2>/FSR2/ s/<c>/&NUM/
-}
-
-TEMPLATE binop_x_x_xc {
-    if (MAP[1] && MAP[2]) {
-#ifdef jit_emit_<op>_rri<_N>
-        /* common case - operands are MAPped */
-    int im = *INT_CONST[3];
-    if (!(im >> 16)) {
-        jit_emit_<op>_rri_i(NATIVECODE, MAP[1], MAP[2], im);
-    }
-    else
-#endif
-    {
-        jit_emit_mov_ri<_N>(NATIVECODE, <s1>, <c>_CONST[3]);
-        jit_emit_<op>_rrr<_N>(NATIVECODE, MAP[1], MAP[2], <s1>);
-    }
-    }
-    else if (MAP[1]) {
-        jit_emit_mov_ri<_N>(NATIVECODE, <s1>, <c>_CONST[3]);
-        jit_emit_mov_rm<_N>(NATIVECODE, <s2>, ROFFS_<t>(2));
-        jit_emit_<op>_rrr<_N>(NATIVECODE, MAP[1], <s2>, <s1>);
-    }
-    else if (MAP[2]) {
-        jit_emit_mov_ri<_N>(NATIVECODE, <s1>, <c>_CONST[3]);
-        jit_emit_<op>_rrr<_N>(NATIVECODE, <s1>, MAP[2], <s1>);
-        jit_emit_mov_mr<_N>(NATIVECODE, ROFFS_<t>(1), <s1>);
-    }
-    else {
-        jit_emit_mov_ri<_N>(NATIVECODE, <s1>, <c>_CONST[3]);
-        jit_emit_mov_rm<_N>(NATIVECODE, <s2>, ROFFS_<t>(2));
-        jit_emit_<op>_rrr<_N>(NATIVECODE, <s1>, <s2>, <s1>);
-        jit_emit_mov_mr<_N>(NATIVECODE, ROFFS_<t>(1), <s1>);
-    }
-}
-
-TEMPLATE binop_i_i_ic {
-    binop_x_x_xc  s/<_N>/_i/ s/<t>/INT/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<c>/*INT/
-}
-
-TEMPLATE binop_n_n_nc {
-    binop_x_x_xc  s/<_N>/_n/ s/<t>/NUM/ s/<s1>/FSR1/ s/<s2>/FSR2/ s/<c>/&NUM/
-}
-
-Parrot_band_i_i {
-    binop_x_x s/<_N>/_i/ s/<op>/and/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_bor_i_i {
-    binop_x_x s/<_N>/_i/ s/<op>/or/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_bxor_i_i {
-    binop_x_x s/<_N>/_i/ s/<op>/xor/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_shr_i_i {
-    binop_x_x s/<_N>/_i/ s/<op>/shr/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_shl_i_i {
-    binop_x_x s/<_N>/_i/ s/<op>/shl/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_lsr_i_i {
-    binop_x_x s/<_N>/_i/ s/<op>/lsr/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_add_i_i {
-    binop_x_x s/<_N>/_i/ s/<op>/add/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_sub_i_i {
-    binop_x_x s/<_N>/_i/ s/<op>/sub/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_mul_i_i {
-    binop_x_x s/<_N>/_i/ s/<op>/mul/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_div_i_i {
-    binop_x_x s/<_N>/_i/ s/<op>/div/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_cmod_i_i {
-    binop_x_x s/<_N>/_i/ s/<op>/cmod/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_band_i_ic {
-    binop_i_ic s/<op>/and/
-}
-
-Parrot_bor_i_ic {
-    binop_i_ic s/<op>/or/
-}
-
-Parrot_bxor_i_ic {
-    binop_i_ic s/<op>/xor/
-}
-
-Parrot_shr_i_ic {
-    binop_i_ic s/<op>/shr/
-}
-
-Parrot_shl_i_ic {
-    binop_i_ic s/<op>/shl/
-}
-
-Parrot_lsr_i_ic {
-    binop_i_ic s/<op>/lsr/
-}
-
-Parrot_add_i_ic {
-    binop_i_ic s/<op>/add/
-}
-
-Parrot_sub_i_ic {
-    binop_i_ic s/<op>/sub/
-}
-
-Parrot_mul_i_ic {
-    binop_i_ic s/<op>/mul/
-}
-
-Parrot_div_i_ic {
-    binop_i_ic s/<op>/div/
-}
-
-Parrot_cmod_i_ic {
-    binop_i_ic s/<op>/cmod/
-}
-
-Parrot_add_n_nc {
-    binop_n_nc s/<op>/add/
-}
-
-Parrot_sub_n_nc {
-    binop_n_nc s/<op>/sub/
-}
-
-Parrot_mul_n_nc {
-    binop_n_nc s/<op>/mul/
-}
-
-Parrot_div_n_nc {
-    binop_n_nc s/<op>/div/
-}
-
-Parrot_add_n_n {
-    binop_x_x s/<_N>/_n/ s/<op>/add/ s/<s1>/FSR1/ s/<s2>/FSR2/ s/<T>/NUM/
-}
-
-Parrot_div_n_n {
-    binop_x_x s/<_N>/_n/ s/<op>/div/ s/<s1>/FSR1/ s/<s2>/FSR2/ s/<T>/NUM/
-}
-
-Parrot_mul_n_n {
-    binop_x_x s/<_N>/_n/ s/<op>/mul/ s/<s1>/FSR1/ s/<s2>/FSR2/ s/<T>/NUM/
-}
-
-Parrot_sub_n_n {
-    binop_x_x s/<_N>/_n/ s/<op>/sub/ s/<s1>/FSR1/ s/<s2>/FSR2/ s/<T>/NUM/
-}
-
-Parrot_band_i_i_i {
-    binop_x_x_x s/<_N>/_i/ s/<op>/and/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_bor_i_i_i {
-    binop_x_x_x s/<_N>/_i/ s/<op>/or/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_bxor_i_i_i {
-    binop_x_x_x s/<_N>/_i/ s/<op>/xor/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_add_i_i_i {
-    binop_x_x_x s/<_N>/_i/ s/<op>/add/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_sub_i_i_i {
-    binop_x_x_x s/<_N>/_i/ s/<op>/sub/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_mul_i_i_i {
-    binop_x_x_x s/<_N>/_i/ s/<op>/mul/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_div_i_i_i {
-    binop_x_x_x s/<_N>/_i/ s/<op>/div/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_cmod_i_i_i {
-    binop_x_x_x s/<_N>/_i/ s/<op>/cmod/ s/<s1>/ISR1/ s/<s2>/ISR2/ s/<T>/INT/
-}
-
-Parrot_band_i_i_ic {
-    binop_i_i_ic s/<op>/and/
-}
-
-Parrot_bor_i_i_ic {
-    binop_i_i_ic s/<op>/or/
-}
-
-Parrot_bxor_i_i_ic {
-    binop_i_i_ic s/<op>/xor/
-}
-
-Parrot_shr_i_i_ic {
-    binop_i_i_ic s/<op>/shr/
-}
-
-Parrot_shl_i_i_ic {
-    binop_i_i_ic s/<op>/shl/
-}
-
-Parrot_lsr_i_i_ic {
-    binop_i_i_ic s/<op>/lsr/
-}
-
-Parrot_add_i_i_ic {
-    binop_i_i_ic s/<op>/add/
-}
-
-Parrot_sub_i_i_ic {
-    binop_i_i_ic s/<op>/sub/
-}
-
-Parrot_mul_i_i_ic {
-    binop_i_i_ic s/<op>/mul/
-}
-
-Parrot_div_i_i_ic {
-    binop_i_i_ic s/<op>/div/
-}
-
-Parrot_cmod_i_i_ic {
-    binop_i_i_ic s/<op>/cmod/
-}
-
-Parrot_add_n_n_nc {
-    binop_n_n_nc s/<op>/add/
-}
-
-Parrot_sub_n_n_nc {
-    binop_n_n_nc s/<op>/sub/
-}
-
-Parrot_mul_n_n_ic {
-    binop_n_n_nc s/<op>/mul/
-}
-
-Parrot_div_n_n_nc {
-    binop_n_n_nc s/<op>/div/
-}
-
-Parrot_band_i_ic_i {
-    binop_i_ic_i s/<op>/and/
-}
-
-Parrot_bor_i_ic_i {
-    binop_i_ic_i s/<op>/or/
-}
-
-Parrot_bxor_i_ic_i {
-    binop_i_ic_i s/<op>/xor/
-}
-
-Parrot_shr_i_ic_i {
-    binop_i_ic_i s/<op>/shr/
-}
-
-Parrot_lsr_i_ic_i {
-    binop_i_ic_i s/<op>/lsr/
-}
-
-Parrot_shl_i_ic_i {
-    binop_i_ic_i s/<op>/shl/
-}
-
-Parrot_add_i_ic_i {
-    binop_i_ic_i s/<op>/add/
-}
-
-Parrot_sub_i_ic_i {
-    binop_i_ic_i s/<op>/sub/
-}
-
-Parrot_mul_i_ic_i {
-    binop_i_ic_i s/<op>/mul/
-}
-
-Parrot_div_i_ic_i {
-    binop_i_ic_i s/<op>/div/
-}
-
-Parrot_cmod_i_ic_i {
-    binop_i_ic_i s/<op>/cmod/
-}
-
-Parrot_add_n_nc_n {
-    binop_n_nc_n s/<op>/add/
-}
-
-Parrot_sub_n_nc_n {
-    binop_n_nc_n s/<op>/sub/
-}
-
-Parrot_mul_n_nc_n {
-    binop_n_nc_n s/<op>/mul/
-}
-
-Parrot_div_n_nc_n {
-    binop_n_nc_n s/<op>/div/
-}
-
-Parrot_add_n_n_n {
-    binop_x_x_x s/<_N>/_n/ s/<op>/add/ s/<s1>/FSR1/ s/<s2>/FSR2/ s/<T>/NUM/
-}
-
-Parrot_sub_n_n_n {
-    binop_x_x_x s/<_N>/_n/ s/<op>/sub/ s/<s1>/FSR1/ s/<s2>/FSR2/ s/<T>/NUM/
-}
-
-Parrot_mul_n_n_n {
-    binop_x_x_x s/<_N>/_n/ s/<op>/mul/ s/<s1>/FSR1/ s/<s2>/FSR2/ s/<T>/NUM/
-}
-
-Parrot_div_n_n_n {
-    binop_x_x_x s/<_N>/_n/ s/<op>/div/ s/<s1>/FSR1/ s/<s2>/FSR2/ s/<T>/NUM/
-}
-
-Parrot_rot_i_i_ic_ic {
-    int rc = *INT_CONST[3];
-    int bw = *INT_CONST[4];
-    if (rc < 0)
-    rc = bw + rc;
-    if (MAP[1] && MAP[2]) {
-    jit_emit_rot_rri(NATIVECODE, MAP[1], MAP[2], rc);
-    }
-    else if (MAP[1]) {
-        jit_emit_mov_rm_i(NATIVECODE, ISR2, ROFFS_INT(2));
-    jit_emit_rot_rri(NATIVECODE, MAP[1], ISR2, rc);
-    }
-    else if (MAP[2]) {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, ROFFS_INT(1));
-    jit_emit_rot_rri(NATIVECODE, ISR1, MAP[2], rc);
-        jit_emit_mov_mr_i(NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-    else {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, ROFFS_INT(1));
-        jit_emit_mov_rm_i(NATIVECODE, ISR2, ROFFS_INT(2));
-    jit_emit_rot_rri(NATIVECODE, ISR1, ISR2, rc);
-        jit_emit_mov_mr_i(NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-
-}
-
-; actually this covers islt too, by passing the bit
-TEMPLATE iseq_i_x_x {
-    if (MAP[2] && MAP[3]) {
-        jit_emit_cmp_rr<_N>(NATIVECODE, MAP[2], MAP[3]);
-    }
-    else if (MAP[2]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<t>(3));
-        jit_emit_cmp_rr<_N>(NATIVECODE, MAP[2], <s1>);
-    }
-    else if (MAP[3]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<t>(2));
-        jit_emit_cmp_rr<_N>(NATIVECODE, <s1>, MAP[3]);
-    }
-    else {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s2>, ROFFS_<t>(2));
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<t>(3));
-        jit_emit_cmp_rr<_N>(NATIVECODE, <s2>, <s1>);
-    }
-    jit_emit_mfcr(NATIVECODE, ISR1);
-    /* bits 0 LT, 1 GT, 2 EQ */
-    /* see also extrwi */
-    if (MAP[1]) {
-    jit_emit_rlwinm(NATIVECODE, MAP[1], ISR1, <b>, 31, 31);
-    }
-    else {
-    jit_emit_rlwinm(NATIVECODE, ISR1, ISR1, <b>, 31, 31);
-        jit_emit_mov_mr_i(NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-}
-
-TEMPLATE isle_i_x_x {
-    if (MAP[2] && MAP[3]) {
-        jit_emit_cmp_rr<_N>(NATIVECODE, MAP[2], MAP[3]);
-    }
-    else if (MAP[2]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<t>(3));
-        jit_emit_cmp_rr<_N>(NATIVECODE, MAP[2], <s1>);
-    }
-    else if (MAP[3]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<t>(2));
-        jit_emit_cmp_rr<_N>(NATIVECODE, <s1>, MAP[3]);
-    }
-    else {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s2>, ROFFS_<t>(2));
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<t>(3));
-        jit_emit_cmp_rr<_N>(NATIVECODE, <s2>, <s1>);
-    }
-    jit_emit_mfcr(NATIVECODE, ISR1);
-    /* bits 0 LT, 1 GT, 2 EQ */
-    /* this is LT or LE - get LT */
-    jit_emit_rlwinm(NATIVECODE, ISR2, ISR1, 1, 31, 31);
-    /* get EQ and or the bits into destination */
-    jit_emit_rlwinm(NATIVECODE, ISR1, ISR1, 3, 31, 31);
-    if (MAP[1]) {
-    jit_emit_or_rrr(NATIVECODE, MAP[1], ISR1, ISR2);
-    }
-    else {
-    jit_emit_or_rrr(NATIVECODE, ISR1, ISR1, ISR2);
-        jit_emit_mov_mr_i(NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-}
-
-TEMPLATE cmp_i_x_x {
-    if (MAP[2] && MAP[3]) {
-        jit_emit_cmp_rr<_N>(NATIVECODE, MAP[2], MAP[3]);
-    }
-    else if (MAP[2]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<t>(3));
-        jit_emit_cmp_rr<_N>(NATIVECODE, MAP[2], <s1>);
-    }
-    else if (MAP[3]) {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<t>(2));
-        jit_emit_cmp_rr<_N>(NATIVECODE, <s1>, MAP[3]);
-    }
-    else {
-        jit_emit_mov_rm<_N>(NATIVECODE, <s2>, ROFFS_<t>(2));
-        jit_emit_mov_rm<_N>(NATIVECODE, <s1>, ROFFS_<t>(3));
-        jit_emit_cmp_rr<_N>(NATIVECODE, <s2>, <s1>);
-    }
-    jit_emit_mfcr(NATIVECODE, ISR1);
-    /* bits 0 LT, 1 GT, 2 EQ */
-    /* get LT -> 0/1 */
-    jit_emit_rlwinm(NATIVECODE, ISR2, ISR1, 1, 31, 31);
-    /* reverse bit */
-    jit_emit_xori  (NATIVECODE, ISR2, ISR2, 1);
-    /* sub 1 -> -1 / 0 */
-    jit_emit_subi  (NATIVECODE, ISR2, ISR2, 1);
-    /* get GT  or the bits into destination */
-    jit_emit_rlwinm(NATIVECODE, ISR1, ISR1, 2, 31, 31);
-    if (MAP[1]) {
-    jit_emit_or_rrr(NATIVECODE, MAP[1], ISR1, ISR2);
-    }
-    else {
-    jit_emit_or_rrr(NATIVECODE, ISR1, ISR1, ISR2);
-        jit_emit_mov_mr_i(NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-}
-Parrot_iseq_i_i_i {
-    iseq_i_x_x  s/<s1>/ISR1/ s/<s2>/ISR2/ s/<t>/INT/ s/<_N>/_i/ s/<b>/3/
-}
-
-Parrot_iseq_i_n_n {
-    iseq_i_x_x  s/<s1>/FSR1/ s/<s2>/FSR2/ s/<t>/NUM/ s/<_N>/_n/ s/<b>/3/
-}
-
-Parrot_islt_i_i_i {
-    iseq_i_x_x  s/<s1>/ISR1/ s/<s2>/ISR2/ s/<t>/INT/ s/<_N>/_i/ s/<b>/1/
-}
-
-Parrot_islt_i_n_n {
-    iseq_i_x_x  s/<s1>/FSR1/ s/<s2>/FSR2/ s/<t>/NUM/ s/<_N>/_n/ s/<b>/1/
-}
-
-Parrot_isle_i_i_i {
-    isle_i_x_x  s/<s1>/ISR1/ s/<s2>/ISR2/ s/<t>/INT/ s/<_N>/_i/
-}
-
-Parrot_isle_i_n_n {
-    isle_i_x_x  s/<s1>/FSR1/ s/<s2>/FSR2/ s/<t>/NUM/ s/<_N>/_n/
-}
-
-Parrot_cmp_i_i_i {
-    cmp_i_x_x  s/<s1>/ISR1/ s/<s2>/ISR2/ s/<t>/INT/ s/<_N>/_i/
-}
-
-Parrot_cmp_i_n_n {
-    cmp_i_x_x  s/<s1>/FSR1/ s/<s2>/FSR2/ s/<t>/NUM/ s/<_N>/_n/
-}
-
-Parrot_inc_i {
-    if (MAP[1]) {
-        jit_emit_add_rri_i (NATIVECODE, MAP[1], MAP[1], 1);
-    }
-    else {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, ROFFS_INT(1));
-        jit_emit_add_rri_i (NATIVECODE, ISR1, ISR1, 1);
-        jit_emit_mov_mr_i(NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-}
-
-Parrot_dec_i {
-    if (MAP[1]) {
-        jit_emit_add_rri_i (NATIVECODE, MAP[1], MAP[1], -1);
-    }
-    else {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, ROFFS_INT(1));
-        jit_emit_add_rri_i (NATIVECODE, ISR1, ISR1, -1);
-        jit_emit_mov_mr_i(NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-}
-
-Parrot_inc_n {
-    static const double one = 1.0;
-    jit_emit_mov_ri_i(NATIVECODE, ISR1, &one);
-    jit_emit_lfd(NATIVECODE, FSR1, 0, ISR1);
-    if (MAP[1]) {
-        jit_emit_fadd_rrr(NATIVECODE, MAP[1], MAP[1], FSR1);
-    }
-    else {
-    jit_emit_mov_rm_n(NATIVECODE, FSR2, ROFFS_NUM(1));
-        jit_emit_fadd_rrr(NATIVECODE, FSR2, FSR2, FSR1);
-        jit_emit_mov_mr_n(NATIVECODE, ROFFS_NUM(1), FSR2);
-    }
-}
-
-Parrot_dec_n {
-    static const double one = 1.0;
-    jit_emit_mov_ri_i(NATIVECODE, ISR1, &one);
-    jit_emit_lfd(NATIVECODE, FSR1, 0, ISR1);
-    if (MAP[1]) {
-        jit_emit_fsub_rrr(NATIVECODE, MAP[1], MAP[1], FSR1);
-    }
-    else {
-    jit_emit_mov_rm_n(NATIVECODE, FSR2, ROFFS_NUM(1));
-        jit_emit_fsub_rrr(NATIVECODE, FSR2, FSR2, FSR1);
-        jit_emit_mov_mr_n(NATIVECODE, ROFFS_NUM(1), FSR2);
-    }
-}
-
-
-TEMPLATE Parrot_unaryop_x {
-    if (MAP[1]) {
-        jit_emit_<op>_rr<_N>(NATIVECODE, MAP[1], MAP[1]);
-    }
-    else {
-        jit_emit_mov_rm<_N>(NATIVECODE, SCRATCH1, ROFFS_INT(1));
-        jit_emit_<op>_rr<_N>(NATIVECODE, SCRATCH1, SCRATCH1);
-        jit_emit_mov_mr<_N>(NATIVECODE, ROFFS_INT(1), SCRATCH1);
-    }
-}
-
-; a recursive template
-TEMPLATE Parrot_unaryop_i {
-    Parrot_unaryop_x s/<_N>/_i/  s/SCRATCH1/ISR1/
-}
-
-TEMPLATE Parrot_unaryop_n {
-    Parrot_unaryop_x s/<_N>/_n/ s/INT/NUM/ s/SCRATCH1/FSR1/
-}
-
-Parrot_neg_i {
-    Parrot_unaryop_i s/<op>/neg/
-}
-
-Parrot_neg_n {
-    Parrot_unaryop_n s/<op>/neg/
-}
-
-Parrot_abs_n {
-    Parrot_unaryop_n s/<op>/abs/
-}
-
-Parrot_abs_i {
-    if (MAP[1]) {
-        jit_emit_srawi(NATIVECODE, ISR1, MAP[1], 31);
-        jit_emit_add_rrr(NATIVECODE, ISR2, ISR1, MAP[1]);
-        jit_emit_xor_rrr(NATIVECODE, MAP[1], ISR2, ISR1);
-    }
-    else {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, ROFFS_INT(1));
-        jit_emit_srawi(NATIVECODE, ISR2, ISR1, 31);
-        jit_emit_add_rrr(NATIVECODE, ISR1, ISR2, ISR1);
-        jit_emit_xor_rrr(NATIVECODE, ISR1, ISR1, ISR2);
-        jit_emit_mov_mr_i(NATIVECODE, ROFFS_INT(1), ISR1);
-    }
-}
-
-
-TEMPLATE Parrot_ifunless_i_ic {
-    if (P_ARITH && MAP[1]) {
-        /* set the Rc bit of prev for the sake of +50% more MOPS  */
-        NATIVECODE[-1] |= 1;
-    }
-    else if (MAP[1]) {
-        jit_emit_cmp_ri(NATIVECODE, MAP[1], 0);
-    }
-    else {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, ROFFS_INT(1));
-        jit_emit_cmp_ri(NATIVECODE, ISR1, 0);
-    }
-    jit_emit_bc(jit_info, <COND>, *INT_CONST[2]);
-}
-
-Parrot_if_i_ic {
-    Parrot_ifunless_i_ic s/<COND>/BNE/
-}
-
-Parrot_unless_i_ic {
-    Parrot_ifunless_i_ic s/<COND>/BEQ/
-}
-
-TEMPLATE Parrot_ifunless_n_ic {
-    static const double zero = 0.0;
-    jit_emit_mov_ri_i(NATIVECODE, ISR1, &zero);
-    jit_emit_lfd(NATIVECODE, FSR1, 0, ISR1);
-    if (MAP[1]) {
-        jit_emit_cmp_rr_n(NATIVECODE, MAP[1], FSR1);
-    }
-    else {
-    jit_emit_mov_rm_n(NATIVECODE, FSR2, ROFFS_NUM(1));
-        jit_emit_cmp_rr_n(NATIVECODE, FSR2, FSR1);
-    }
-    jit_emit_bc(jit_info, <COND>, *INT_CONST[2]);
-}
-
-Parrot_if_n_ic {
-    Parrot_ifunless_n_ic s/<COND>/BNE/
-}
-
-Parrot_unless_n_ic {
-    Parrot_ifunless_n_ic s/<COND>/BEQ/
-}
-
-TEMPLATE Parrot_branch_i_i_ic {
-; First, emit the compare op:
-    if (MAP[1] && MAP[2]) {
-        jit_emit_cmp_rr_i(NATIVECODE, MAP[1], MAP[2]);
-    }
-    else if (MAP[1]) {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, ROFFS_INT(2));
-        jit_emit_cmp_rr_i(NATIVECODE, MAP[1], ISR1);
-    }
-    else if (MAP[2]) {
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, ROFFS_INT(1));
-        jit_emit_cmp_rr_i(NATIVECODE, ISR1, MAP[2]);
-    }
-    else {
-        jit_emit_mov_rm_i(NATIVECODE, ISR2, ROFFS_INT(1));
-        jit_emit_mov_rm_i(NATIVECODE, ISR1, ROFFS_INT(2));
-        jit_emit_cmp_rr_i(NATIVECODE, ISR2, ISR1);
-    }
-; Now the branch. XXX: need to handle large displacements.
-    jit_emit_bc(jit_info, <CON>, *INT_CONST[3]);
-}
-
-TEMPLATE Parrot_branch_i_ic_ic {
-    jit_emit_mov_ri_i(NATIVECODE, ISR1, *INT_CONST[2]);
-
-    if (MAP[1]) {
-        jit_emit_cmp_rr_i(NATIVECODE, MAP[1], ISR1);
-    }
-    else {
-        jit_emit_mov_rm_i(NATIVECODE, ISR2, ROFFS_INT(1));
-        jit_emit_cmp_rr_i(NATIVECODE, ISR2, ISR1);
-    }
-; Now the branch. XXX: need to handle large displacements.
-    jit_emit_bc(jit_info, <CON>, *INT_CONST[3]);
-
-}
-
-TEMPLATE Parrot_branch_ic_i_ic {
-    jit_emit_mov_ri_i(NATIVECODE, ISR1, *INT_CONST[1]);
-
-    if (MAP[2]) {
-        jit_emit_cmp_rr_i(NATIVECODE, ISR1, MAP[2]);
-    }
-    else {
-        jit_emit_mov_rm_i(NATIVECODE, ISR2, ROFFS_INT(2));
-        jit_emit_cmp_rr_i(NATIVECODE, ISR1, ISR2);
-    }
-; Now the branch. XXX: need to handle large displacements.
-    jit_emit_bc(jit_info, <CON>, *INT_CONST[3]);
-}
-
-Parrot_eq_i_i_ic {
-    Parrot_branch_i_i_ic s/<CON>/BEQ/
-}
-
-Parrot_eq_i_ic_ic {
-    Parrot_branch_i_ic_ic s/<CON>/BEQ/
-}
-
-Parrot_eq_ic_i_ic {
-    Parrot_branch_ic_i_ic s/<CON>/BEQ/
-}
-
-
-Parrot_lt_i_i_ic {
-    Parrot_branch_i_i_ic s/<CON>/BLT/
-}
-
-Parrot_lt_i_ic_ic {
-    Parrot_branch_i_ic_ic s/<CON>/BLT/
-}
-
-Parrot_lt_ic_i_ic {
-    Parrot_branch_ic_i_ic s/<CON>/BLT/
-}
-
-Parrot_le_i_i_ic {
-    Parrot_branch_i_i_ic s/<CON>/BLE/
-}
-
-Parrot_le_i_ic_ic {
-    Parrot_branch_i_ic_ic s/<CON>/BLE/
-}
-
-Parrot_le_ic_i_ic {
-    Parrot_branch_ic_i_ic s/<CON>/BLE/
-}
-
-
-Parrot_ne_i_i_ic {
-    Parrot_branch_i_i_ic s/<CON>/BNE/
-}
-
-Parrot_ne_i_ic_ic {
-    Parrot_branch_i_ic_ic s/<CON>/BNE/
-}
-
-Parrot_ne_ic_i_ic {
-    Parrot_branch_ic_i_ic s/<CON>/BNE/
-}
-
-
-TEMPLATE Parrot_branch_n_n_ic {
-    if (MAP[1] && MAP[2]) {
-        jit_emit_cmp_rr_n(NATIVECODE, MAP[1], MAP[2]);
-    }
-    else if (MAP[1]) {
-        jit_emit_mov_rm_n(NATIVECODE, FSR1, ROFFS_NUM(2));
-        jit_emit_cmp_rr_n(NATIVECODE, MAP[1], FSR1);
-    }
-    else if (MAP[2]) {
-        jit_emit_mov_rm_n(NATIVECODE, FSR1, ROFFS_NUM(1));
-        jit_emit_cmp_rr_n(NATIVECODE, FSR1, MAP[2]);
-    }
-    else {
-        jit_emit_mov_rm_n(NATIVECODE, FSR2, ROFFS_NUM(1));
-        jit_emit_mov_rm_n(NATIVECODE, FSR1, ROFFS_NUM(2));
-        jit_emit_cmp_rr_n(NATIVECODE, FSR2, FSR1);
-    }
-    jit_emit_bc(jit_info, <CON>, *INT_CONST[3]);
-}
-
-TEMPLATE Parrot_branch_n_nc_ic {
-    jit_emit_mov_ri_n(NATIVECODE, FSR1, &NUM_CONST[2]);
-    if (MAP[1]) {
-        jit_emit_cmp_rr_n(NATIVECODE, MAP[1], FSR1);
-    }
-    else {
-        jit_emit_mov_rm_n(NATIVECODE, FSR2, ROFFS_NUM(1));
-        jit_emit_cmp_rr_n(NATIVECODE, FSR2, FSR1);
-    }
-    jit_emit_bc(jit_info, <CON>, *INT_CONST[3]);
-}
-
-TEMPLATE Parrot_branch_nc_n_ic {
-    if (MAP[2]) {
-        jit_emit_mov_ri_i(NATIVECODE, ISR1, &NUM_CONST[1]);
-        jit_emit_lfd(NATIVECODE, FSR1, 0, ISR1);
-        jit_emit_cmp_rr_n(NATIVECODE, FSR1, MAP[2]);
-    }
-    else {
-        jit_emit_mov_rm_n(NATIVECODE, FSR2, ROFFS_NUM(2));
-        jit_emit_mov_ri_i(NATIVECODE, ISR1, &NUM_CONST[1]);
-        jit_emit_lfd(NATIVECODE, FSR1, 0, ISR1);
-        jit_emit_cmp_rr_n(NATIVECODE, FSR1, FSR2);
-    }
-    jit_emit_bc(jit_info, <CON>, *INT_CONST[3]);
-}
-
-Parrot_eq_n_n_ic {
-        Parrot_branch_n_n_ic s/<CON>/BEQ/
-}
-
-Parrot_eq_n_nc_ic {
-    Parrot_branch_n_nc_ic s/<CON>/BEQ/
-}
-
-Parrot_eq_nc_n_ic {
-    Parrot_branch_nc_n_ic s/<CON>/BEQ/
-}
-
-
-Parrot_lt_n_n_ic {
-    Parrot_branch_n_n_ic s/<CON>/BLT/
-}
-
-Parrot_lt_n_nc_ic {
-    Parrot_branch_n_nc_ic s/<CON>/BLT/
-}
-
-Parrot_lt_nc_n_ic {
-    Parrot_branch_nc_n_ic s/<CON>/BLT/
-}
-
-
-Parrot_le_n_n_ic {
-    Parrot_branch_n_n_ic s/<CON>/BLE/
-}
-
-Parrot_le_n_nc_ic {
-    Parrot_branch_n_nc_ic s/<CON>/BLE/
-}
-
-Parrot_le_nc_n_ic {
-    Parrot_branch_nc_n_ic s/<CON>/BLE/
-}
-
-Parrot_ne_n_n_ic {
-    Parrot_branch_n_n_ic s/<CON>/BNE/
-}
-
-Parrot_ne_n_nc_ic {
-    Parrot_branch_n_nc_ic s/<CON>/BNE/
-}
-
-Parrot_ne_nc_n_ic {
-    Parrot_branch_nc_n_ic s/<CON>/BLE/
-}
-
-
-Parrot_branch_ic {
-    jit_emit_bx(jit_info, 0, *INT_CONST[1]);
-}
-
-Parrot_branch_i {
-    jit_emit_mov_rm_i(NATIVECODE, ISR1, ROFFS_INT(1));
-    jit_emit_mtlr(NATIVECODE, ISR1);
-    jit_emit_blr(NATIVECODE);
-}
-
-TEMPLATE Parrot_set_or_clone_s_sc {
-; Parrot_str_copy(Interp *interp, STRING *s)
-    jit_emit_mov_rr(NATIVECODE, r3, r16);
-    jit_emit_mov_ri_i(NATIVECODE, r4, CONST(2)->u.string);
-
-    jit_emit_call_func(NATIVECODE, (void*) Parrot_str_copy);
-
-    jit_emit_mov_mr_i(NATIVECODE, ROFFS_STR(1), r3);
-}
-
-Parrot_set_s_sc {
-    Parrot_set_or_clone_s_sc
-}
-
-Parrot_clone_s_sc {
-    Parrot_set_or_clone_s_sc
-}
-
-Parrot_set_s_s {
-    jit_emit_mov_rm_i(NATIVECODE, ISR1, ROFFS_STR(2));
-    jit_emit_mov_mr_i(NATIVECODE, ROFFS_STR(1), ISR1);
-}
-
-Parrot_clone_s_s {
-    jit_emit_mov_rr(NATIVECODE, r3, r16);
-    jit_emit_mov_rm_i(NATIVECODE, r4, ROFFS_STR(2));
-
-    jit_emit_call_func(NATIVECODE, (void*) Parrot_str_copy);
-
-    jit_emit_mov_mr_i(NATIVECODE,ROFFS_STR(1), r3);
-}
-
-Parrot_set_p_pc {
-    jit_emit_mov_ri_i(NATIVECODE, ISR1, CONST(2)->u.key);
-    jit_emit_mov_mr_i(NATIVECODE, ROFFS_PMC(1), ISR1);
-}
-
-; the following 4 ops don't branch but are translated as cpfp
-; which adds unneeded overhead - convert to normal ops
-; or just JIT (TODO)  the 2 easy ones
-Parrot_set_args_pc {
-    if (jit_info->code_type == JIT_CODE_FILE) {
-    jit_emit_mov_ri_i(NATIVECODE, ISR1, jit_info->cur_op);
-    jit_emit_stw(NATIVECODE, ISR1, offsetof(Interp, current_args), r16);
-    }
-    else  {
-        jit_set_args_pc(jit_info, interp,
-            jit_info->flags & JIT_CODE_RECURSIVE);
-    }
-}
-
-extern Parrot_set_returns_pc {
-    if (jit_info->code_type == JIT_CODE_FILE)
-    Parrot_jit_normal_op(jit_info, interp);
-    else {
-        jit_set_returns_pc(jit_info, interp,
-            jit_info->flags & JIT_CODE_RECURSIVE);
-    }
-}
-
-extern Parrot_returncc {
-    if (jit_info->code_type == JIT_CODE_FILE)
-    Parrot_jit_restart_op(jit_info, interp);
-    else {
-    /* fetch args[n+1] -> retval */
-        if (!(jit_info->flags & JIT_CODE_RECURSIVE)) {
-        jit_emit_lwz(jit_info->native_ptr, r1, 0, r1);
-        jit_emit_lwz(jit_info->native_ptr, r3, 4 + jit_info->n_args * 4, r5);
-        jit_emit_lwz(jit_info->native_ptr, r31, -4, r1);
-        jit_emit_lwz(jit_info->native_ptr, r0, 8, r1);   /* get link reg */
-        jit_emit_mtlr(jit_info->native_ptr, r0);   /* move to link reg */
-    }
-    jit_emit_blr(jit_info->native_ptr);
-    }
-}
-
-Parrot_pic_callr___pc {
-    PackFile_Constant **constants  = CONTEXT(interp)->constants;
-    PMC                *sig_result = constants[CUR_OPCODE[1]]->u.key;
-    opcode_t           *params     = jit_info->optimizer->sections->begin;
-    PMC                *sig_params = constants[params[1]]->u.key;
-    int                 op_i       = VTABLE_elements(interp, sig_params) + 2;
-    int                 offset     = jit_info->arena.op_map[op_i].offset;
-    int                 here       = NATIVECODE - jit_info->arena.start;
-    int                 skip;
-
-    /* TODO preserve necessary regs */
-    assert(*CUR_OPCODE == PARROT_OP_get_results_pc);
-
-    if (!VTABLE_elements(interp, sig_result))
-        skip = -1;
-    /* skip result - save rest */
-    else
-        skip = MAP(2);
-
-    offset -= here;
-
-    /* bl */
-    _emit_bx(NATIVECODE, 1, offset);
-
-    jit_restore_regs_call(jit_info, interp, skip);
-}
-
-extern Parrot_get_params_pc {
-    if (jit_info->code_type == JIT_CODE_FILE)
-    Parrot_jit_normal_op(jit_info, interp);
-    else if (!(jit_info->flags & JIT_CODE_RECURSIVE)) {
-        jit_get_params_pc(jit_info, interp);
-    }
-}
-
-Parrot_get_results_pc {
-    if (jit_info->code_type == JIT_CODE_FILE) {
-    jit_emit_mov_ri_i(NATIVECODE, ISR1, jit_info->cur_op);
-    jit_emit_lwz(NATIVECODE, ISR2, offsetof(Interp, ctx.state), r16);
-    jit_emit_stw(NATIVECODE, ISR1,
-        offsetof(Parrot_Context, current_results), ISR2);
-    }
-    else {
-    PackFile_Constant **constants  = CONTEXT(interp)->constants;
-    PMC                *sig_result = constants[CUR_OPCODE[1]]->u.key;
-
-    if (!VTABLE_elements(interp, sig_result))
-        return;
-
-    /* result is r3 TODO Nums */
-    jit_emit_mov_rr(NATIVECODE, MAP(2), r3);
-    }
-}

Deleted: branches/orderedhash_revamp/src/jit/ppc/exec_dep.c
==============================================================================
--- branches/orderedhash_revamp/src/jit/ppc/exec_dep.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,85 +0,0 @@
-/*
-  Copyright (C) 2003-2008, Parrot Foundation.
-  $Id$
-*/
-
-/*
- * exec_dep.c
- *
- * Overview:
- *    PPC dependent functions to emit an executable.
- * History:
- *      Initial version by Daniel Grunblatt on 2003.6.9
- * Notes:
- * References:
- */
-
-#include "parrot/parrot.h"
-#include "jit.h"
-#define JIT_EMIT 1
-#include "jit_emit.h"
-#include "exec_dep.h"
-
-/* HEADERIZER HFILE: src/jit/ppc/exec_dep.h */
-
-#ifdef JIT_CGP
-
-void
-Parrot_exec_normal_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-}
-
-#else /* JIT_CGP */
-
-void
-Parrot_exec_normal_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-    add_disp(jit_info->native_ptr, r3,
-        ((long)jit_info->cur_op - (long)interp->code->base.data));
-    jit_emit_mov_rr(jit_info->native_ptr, r4, r13);
-
-    Parrot_exec_add_text_rellocation(jit_info->objfile,
-        jit_info->native_ptr, RTYPE_FUNC,
-            interp->op_info_table[*jit_info->cur_op].func_name, 0);
-    _emit_bx(jit_info->native_ptr, 1, 0);
-}
-
-#endif /* JIT_CGP */
-
-void
-Parrot_exec_cpcf_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-    Parrot_exec_normal_op(jit_info, interp);
-    jit_emit_sub_rrr(jit_info->native_ptr, r3, r3, r15);
-    jit_emit_add_rrr(jit_info->native_ptr, r3, r14, r3);
-    jit_emit_lwz(jit_info->native_ptr, r3, 0, r3);
-    jit_emit_mtlr(jit_info->native_ptr, r3);
-    jit_emit_blr(jit_info->native_ptr);
-}
-
-void
-Parrot_exec_restart_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-}
-
-/* Assign the offset of the program_code */
-void
-offset_fixup(Parrot_exec_objfile_t *obj)
-{
-    int i, j;
-
-    for (i = 0; i < obj->data_count; i++) {
-#ifdef EXEC_MACH_O
-        obj->symbol_table[i].value = obj->text.size;
-#endif
-        for (j = 0; j < i; j++)
-            obj->symbol_table[i].value += obj->data_size[j];
-    }
-}
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/ppc/exec_dep.h
==============================================================================
--- branches/orderedhash_revamp/src/jit/ppc/exec_dep.h	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,58 +0,0 @@
-/*
-  Copyright (C) 2003-2008, Parrot Foundation.
-  $Id$
-*/
-
-/*
- * exec_dep.h
- *
- * Overview:
- *    PPC dependent functions to emit an executable.
- * History:
- *      Initial version by Daniel Grunblatt on 2003.6.9
- * Notes:
- * References:
- */
-
-#include "jit.h"
-#include "jit_emit.h"
-
-#ifndef PARROT_PPC_EXEC_DEP_H_GUARD
-#define PARROT_PPC_EXEC_DEP_H_GUARD
-
-/* 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 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_Parrot_exec_cpcf_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_exec_normal_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_exec_normal_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_exec_restart_op __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/exec_dep.c */
-
-#endif /* PARROT_PPC_EXEC_DEP_H_GUARD */
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/ppc/jit_defs.c
==============================================================================
--- branches/orderedhash_revamp/src/jit/ppc/jit_defs.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,13 +0,0 @@
-/* Stub file for RT#38929 fixes */
-/*
-Copyright (C) 2008, Parrot Foundation.
-$Id$
-*/
-/* HEADERIZER HFILE: none */
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/ppc/jit_emit.h
==============================================================================
--- branches/orderedhash_revamp/src/jit/ppc/jit_emit.h	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,1406 +0,0 @@
-/*
- * Copyright (C) 2002-2009, Parrot Foundation.
- */
-
-/*
- * jit_emit.h
- *
- * PPC
- *
- * $Id$
- */
-
-#ifndef PARROT_PPC_JIT_EMIT_H_GUARD
-#define PARROT_PPC_JIT_EMIT_H_GUARD
-
-#  include <unistd.h>
-#  include <sys/mman.h>
-#  include <limits.h>
-#  include "parrot/oplib/ops.h"
-#  include "pmc/pmc_fixedintegerarray.h"
-
-#ifndef CACHELINESIZE
-   /* TODO this should be determined by configure */
-#  ifdef PARROT_EXEC_OS_AIX
-     /* for POWER3 */
-#    define CACHELINESIZE 0x80
-#  else
-     /* for PowerPC */
-#    define CACHELINESIZE 0x10
-#  endif
-#endif
-
-typedef enum {
-    r0,
-    r1,
-    r2,
-    r3,
-    r4,
-    r5,
-    r6,
-    r7,
-    r8,
-    r9,
-    r10,
-    r11,
-    ISR1 = r11,
-    r12,
-    ISR2 = r12,
-    r13,
-    r14,
-    r15,
-    r16,
-    r17,
-    r18,
-    r19,
-    r20,
-    r21,
-    r22,
-    r23,
-    r24,
-    r25,
-    r26,
-    r27,
-    r28,
-    r29,
-    r30,
-    r31
-} ppc_iregister_t;
-
-#  define Parrot_jit_emit_get_base_reg_no(pc) r13
-
-typedef enum {
-    f0,
-    FSR1 = f0,
-    f1,
-    f2,
-    f3,
-    f4,
-    f5,
-    f6,
-    f7,
-    f8,
-    f9,
-    f10,
-    f11,
-    f12,
-    f13,
-    FSR2 = f13,
-    f14,
-    f15,
-    f16,
-    f17,
-    f18,
-    f19,
-    f20,
-    f21,
-    f22,
-    f23,
-    f24,
-    f25,
-    f26,
-    f27,
-    f28,
-    f29,
-    f30,
-    f31
-} ppc_fregister_t;
-
-/* Scratch registers. */
-
-
-enum { JIT_PPC_CALL, JIT_PPC_BRANCH, JIT_PPC_UBRANCH };
-
-#  define emit_op(op) ((op) << 2)
-
-#  define emit_r3(reg) ((reg) >> 3)
-
-#  define emit_l5(reg) ((reg) << 5)
-
-/* Move (mr).
- *
- * mr rD,rA
- *
- *  +-----------------------------------+
- *  | 31 |
- *  +-----------------------------------+
- * 0    5 6                     29 30 31
- * */
-#  define jit_emit_mov_rr(pc, dst, src) \
-    do { \
-        if ((dst) != (src)) { \
-        *((pc)++) = emit_op(31) | emit_r3(src); \
-        *((pc)++) = (char)(emit_l5(src) | (dst)); \
-        *((pc)++) = (char)(0x3 | (src) * 8); \
-        *((pc)++) = 0x78; \
-        } \
-    } \
-    while (0)
-
-/* Move from/to special purpose register.
- *
- * mtspr SPR,rS
- *
- *  +--------------------------------------------------------------------+
- *  |    31    |     D-S    |         spr            |      type     | 0 |
- *  +--------------------------------------------------------------------+
- * 0          5 6         10 11                    20 21           30  31
- *
- * spr = 8 == LR
- * spr = 9 == CTR
- *
- * mfspr type == 339
- * mtspr type == 467
- *
- * mtlr  rS == mtspr 8,rS
- * mtctr rS == mtspr 9,rS
- *
- */
-#  define jit_emit_mxspr(pc, S, spr, type) \
-    *((pc)++) = 31 << 2 | (S) >> 3; \
-    *((pc)++) = (char)((S) << 5 | (spr)); \
-    *((pc)++) = (type) >> 7; \
-    *((pc)++) = (char)((type) << 1)
-
-#  define jit_emit_mtlr(pc, S) \
-    jit_emit_mxspr((pc), (S), 8, 467)
-
-#  define jit_emit_mtctr(pc, S) \
-    jit_emit_mxspr((pc), (S), 9, 467)
-
-#  define jit_emit_mflr(pc, D) \
-    jit_emit_mxspr((pc), (D), 8, 339)
-
-/* Branches (b/bl/ba/bla) with 24 bits literal.
- *
- * b   (AA = 0, LK = 0)
- * bl  (AA = 0, LK = 1)
- * ba  (AA = 1, LK = 0)
- * bla (AA = 1, LK = 1)
- *
- *  +--------------------------------------------------------------------+
- *  |    18    |                      LI                       | AA | LK |
- *  +--------------------------------------------------------------------+
- * 0          5 6                                            29   30   31
- *
- * If AA = 0, the branch target address is the sum of LI and the address of
- * this instruction.
- * If AA = 1, the branch target address is the value of LI.
- * If LK = 1, the effective address of the instruction following the branch
- * instruction is placed into the link register.
- *
- */
-
-
-#  define _emit_bx(pc, type, disp) \
-    *((pc)++) = (char)((18 << 2) | (((disp) >> 24) & 3)); \
-    *((pc)++) = (char)((disp) >> 16); \
-    *((pc)++) = (char)((disp) >> 8); \
-    *((pc)++) = (char)((disp) | (type))
-
-#  define jit_emit_b(pc, disp) \
-    jit_emit_bx((pc), 0, (disp))
-
-#  define jit_emit_bl(pc, disp) \
-    jit_emit_bx((pc), 1, (disp))
-
-#  define jit_emit_ba(pc, disp) \
-    jit_emit_bx((pc), 2, (disp))
-
-#  define jit_emit_bla(pc, disp) \
-    jit_emit_bx((pc), 3, (disp))
-
-/* Branch conditional to count register or link register.
- *
- *  +--------------------------------------------------------------------+
- *  |    19    |     BO     |     BI     |     0     |     type     | LK |
- *  +--------------------------------------------------------------------+
- * 0          5 6         10 11        15 16       20 21          30   31
- *
- * cr [type = 528]
- * lr [type = 16]
- */
-
-#  define jit_emit_bcctrx(pc, bo, bi, type, lk) \
-    *((pc)++) = 19 << 2 | (bo) >> 3; \
-    *((pc)++) = (char)((bo) << 5 | (bi)); \
-    *((pc)++) = (type) >> 7; \
-    *((pc)++) = (char)((type) << 1| (lk))
-
-#  define jit_emit_bcctr(pc, bo, bi) \
-    jit_emit_bcctrx((pc), (bo), (bi), 528, 0)
-
-#  define jit_emit_bcctrl(pc, bo, bi) \
-    jit_emit_bcctrx((pc), (bo), (bi), 528, 1)
-
-#  define jit_emit_bctrl(pc) \
-    jit_emit_bcctrl((pc), 20, 0)
-
-#  define jit_emit_blr(pc) \
-    jit_emit_bcctrx((pc), 20, 0, 16, 0)
-
-#  define jit_emit_bclr(pc, bo, bi) \
-    jit_emit_bcctrx((pc), (bo), (bi), 16, 0)
-
-#  define jit_emit_bclrl(pc, bo, bi) \
-    jit_emit_bcctrx((pc), (bo), (bi), 16, 1)
-
-/* 3 register operation.
- *
- *  +--------------------------------------------------------------------+
- *  |  Opcode  |     D     |     A     |     B     |OE|     type      |Rc|
- *  +--------------------------------------------------------------------+
- * 0          5 6        10 11       15 16       20 21 22           30 31
- *
- */
-
-#  define jit_emit_3reg(pc, opcode, D, A, B, OE, type, Rc) \
-    *((pc)++) = opcode << 2 | D >> 3; \
-    *((pc)++) = (char)(D << 5 | A); \
-    *((pc)++) = B << 3 | OE | type >> 7; \
-    *((pc)++) = (char)(type << 1 | Rc);
-
-/* 3 register operation (without OE bit)
- *
- *  +--------------------------------------------------------------------+
- *  |  Opcode  |     D     |     A     |     B     |        type      |Rc|
- *  +--------------------------------------------------------------------+
- * 0          5 6        10 11       15 16       20 21 22           30 31
- *
- */
-
-#  define jit_emit_3reg_x(pc, opcode, D, A, B, type, Rc) \
-    *(pc++) = opcode << 2 | D >> 3; \
-    *(pc++) = (char)(D << 5 | A); \
-    *(pc++) = B << 3 | type >> 7; \
-    *(pc++) = (char)(type << 1 | Rc);
-
-/* Add [type = 266, OE = 0, Rc = 0]
- *
- * adds rA and rB and place the result in rD.
- */
-
-#  define jit_emit_add_rrr(pc, D, A, B) \
-    jit_emit_3reg((pc), 31, (D), (A), (B), 0, 266, 0);
-
-#  define jit_emit_subf(pc, D, A, B) \
-    jit_emit_3reg((pc), 31, (D), (B), (A), 0, 40, 0);
-
-#  define jit_emit_sub_rrr jit_emit_subf
-
-#  define jit_emit_neg_rr_i(pc, D, A) \
-    jit_emit_3reg((pc), 31, (D), (A), 0, 0, 104, 0);
-
-#  define jit_emit_mul_rrr(pc, D, A, B) \
-    jit_emit_3reg((pc), 31, (D), (A), (B), 0, 235, 0);
-
-#  define jit_emit_div_rrr_no_check(pc, D, A, B) \
-    jit_emit_3reg((pc), 31, (D), (A), (B), 0, 491, 0);
-
-#  define jit_emit_cmp_ri(pc, ra, simm) \
-    _emit_cmpi((pc), 11, 0, (ra), (simm));
-
-
-#  define jit_emit_and_rrr(pc, D, A, B) \
-    jit_emit_3reg_x((pc), 31, (A), (D), (B), 28, 0)
-
-#  define jit_emit_or_rrr(pc, D, A, B) \
-    jit_emit_3reg_x((pc), 31, (A), (D), (B), 444, 0)
-
-#  define jit_emit_xor_rrr(pc, D, A, B) \
-    jit_emit_3reg_x((pc), 31, (A), (D), (B), 316, 0)
-
-#  define jit_emit_srawi(pc, D, A, immediate) \
-    jit_emit_3reg_x((pc), 31, (A), (D), (immediate), 824, 0)
-
-/* canonical names */
-
-#  define jit_emit_and_rrr_i jit_emit_and_rrr
-#  define jit_emit_add_rrr_i jit_emit_add_rrr
-#  define jit_emit_cmod_rrr_i jit_emit_cmod_rrr
-#  define jit_emit_div_rrr_i jit_emit_div_rrr
-#  define jit_emit_mul_rrr_i jit_emit_mul_rrr
-#  define jit_emit_or_rrr_i  jit_emit_or_rrr
-#  define jit_emit_sub_rrr_i jit_emit_sub_rrr
-#  define jit_emit_xor_rrr_i jit_emit_xor_rrr
-
-/* shift ops */
-/* slw */
-#  define jit_emit_shl_rrr_i(pc, D, A, B) \
-    jit_emit_3reg_x((pc), 31, (A), (D), (B), 24, 0)
-
-/* sraw */
-#  define jit_emit_shr_rrr_i(pc, D, A, B) \
-    jit_emit_3reg_x((pc), 31, (A), (D), (B), 792, 0)
-
-/* srw */
-#  define jit_emit_lsr_rrr_i(pc, D, A, B) \
-    jit_emit_3reg_x((pc), 31, (A), (D), (B), 536, 0)
-
-#  define jit_emit_shr_rri jit_emit_srawi
-#  define jit_emit_shl_rri(pc, D, A, n) \
-    jit_emit_rlwinm((pc), (D), (A), (n), 0, 31-(n))
-#  define jit_emit_lsr_rri(pc, D, A, n) \
-    jit_emit_rlwinm((pc), (D), (A), 32-(n), (n), 31)
-
-/* 2 register and immediate operation.
- *
- *  +--------------------------------------------------------------------+
- *  |  Opcode  |    D-S     |     A      |       Immediate-Disp          |
- *  +--------------------------------------------------------------------+
- * 0          5 6         10 11        15 16                           31
- *
- * addi  [opcode = 14] Adds rA to Immediate and place the result in rD.
- *
- * addis [opcode = 15] Adds rA to Immediate shifted 16 bits and place the
- *                     result in rD.
- *
- * andil [opcode = 28] Ands rD and the (unsigned)Immediate and place the
- *                     result in rA.
- *
- * lwz   rD,d(rA) [op = 32]
- * lwzu  rD,d(rA) [op = 33]
- * lbz   rD,d(rA) [op = 34]
- * lbzu  rD,d(rA) [op = 35]
- * stw   rS,d(rA) [op = 36]
- * stwu  rS,d(rA) [op = 37]
- * stb   rS,d(rA) [op = 38]
- * stbu  rS,d(rA) [op = 39]
- * lhz   rD,d(rA) [op = 40]
- * lhzu  rD,d(rA) [op = 41]
- * lha   rD,d(rA) [op = 42]
- * lhau  rD,d(rA) [op = 43]
- * sth   rS,d(rA) [op = 44]
- * sthu  rS,d(rA) [op = 45]
- * lmw   rD,d(rA) [op = 46]
- * stmw  rS,d(rA) [op = 47]
- * lfu   frD,d(rA) [op = 48]
- * lfsu  frD,d(rA) [op = 49]
- * lfd   frD,d(rA) [op = 50]
- * lfdu  frD,d(rA) [op = 51]
- * stfs  frS,d(rA) [op = 52]
- * stfsu frS,d(rA) [op = 53]
- * stfd  frS,d(rA) [op = 54]
- * stfdu frS,d(rA) [op = 55]
- */
-
-#  define jit_emit_2reg(pc, opcode, D, A, immediate) \
-    *((pc)++) = (opcode) << 2 | (D) >> 3; \
-    *((pc)++) = (char)((D) << 5 | (A)); \
-    *((pc)++) = ((immediate) >> 8); \
-    *((pc)++) = (char)(immediate)
-
-#  define jit_emit_add_rri_i(pc, D, A, immediate) \
-    jit_emit_2reg((pc), 14, (D), (A), (immediate))
-
-#  define jit_emit_addis(pc, D, A, immediate) \
-    jit_emit_2reg((pc), 15, (D), (A), (immediate))
-
-#  define jit_emit_ori(pc, D, S, immediate) \
-    jit_emit_2reg((pc), 24, (S), (D), (immediate))
-
-#  define jit_emit_oris(pc, D, S, immediate) \
-    jit_emit_2reg((pc), 25, (S), (D), (immediate))
-
-#  define jit_emit_xori(pc, D, S, immediate) \
-    jit_emit_2reg((pc), 26, (S), (D), (immediate))
-
-#  define jit_emit_xoris(pc, D, S, immediate) \
-    jit_emit_2reg((pc), 27, (S), (D), (immediate))
-
-#  define jit_emit_andil(pc, S, A, uimm) \
-    jit_emit_2reg((pc), 28, (S), (A), (uimm))
-
-#  define jit_emit_subfic(pc, D, A, immediate) \
-    jit_emit_2reg((pc), 8, (D), (A), (immediate))
-
-#  define jit_emit_subi(pc, D, A, im) jit_emit_add_rri_i((pc), (D), (A), -(im))
-
-#  define jit_emit_lwz(pc, D, disp, A) \
-    jit_emit_2reg((pc), 32, (D), (A), (disp))
-
-#  define jit_emit_lwzu(pc, D, disp, A) \
-    jit_emit_2reg((pc), 33, (D), (A), (disp))
-
-#  define jit_emit_lwzx(pc, D, A, B) \
-    jit_emit_3reg_x((pc), 31, (D), (A), (B), 23, 0)
-
-#  define jit_emit_stw(pc, S, disp, A) \
-    jit_emit_2reg((pc), 36, (S), (A), (disp))
-
-#  define jit_emit_stwu(pc, S, disp, A) \
-    jit_emit_2reg((pc), 37, (S), (A), (disp))
-
-#  define jit_emit_stmw(pc, S, disp, A) \
-    jit_emit_2reg((pc), 47, (S), (A), (disp))
-
-#  define jit_emit_lmw(pc, D, disp, A) \
-    jit_emit_2reg((pc), 46, (D), (A), (disp))
-
-#  define jit_emit_lfd(pc, D, disp, A) \
-    jit_emit_2reg((pc), 50, (D), (A), (disp))
-
-#  define jit_emit_stfd(pc, S, disp, A) \
-    jit_emit_2reg((pc), 54, (S), (A), (disp))
-
-/* A-format operation.
- *
- *  +--------------------------------------------------------------------+
- *  |  Opcode  |     D     |     A     |     B     |    C    |  XOP   |Rc|
- *  +--------------------------------------------------------------------+
- * 0          5 6        10 11       15 16       20 21     25 26    30 31
- *
- */
-
-#  define jit_emit_3a(pc, opcode, D, A, B, C, type, Rc) \
-    *((pc)++) = (opcode)<< 2 | (D) >> 3; \
-    *((pc)++) = (char)((D) << 5 | (A)); \
-    *((pc)++) = (char)((B) << 3 | (C) >> 2); \
-    *((pc)++) = (char)((C) << 6 | (type) << 1 | (Rc))
-
-/* rotate instructions */
-
-#  define jit_emit_rlwimi(pc, A, S, SH, MB, ME) \
-    jit_emit_3a((pc), 20, (S), (A), (SH), (MB), (ME), 0)
-
-#  define jit_emit_rlwinm(pc, A, S, SH, MB, ME) \
-    jit_emit_3a((pc), 21, (S), (A), (SH), (MB), (ME), 0)
-
-#  define jit_emit_rot_rri(pc, A, S, im) \
-    jit_emit_rlwinm((pc), (A), (S), (im), 0, 31)
-
-#  define jit_emit_rlwnm(pc, A, S, B, MB, ME) \
-    jit_emit_3a((pc), 23, (S), (A), (B), (M), (ME), 0)
-
-/* mfcr (CR -> D) */
-#  define jit_emit_mfcr(pc, D) jit_emit_3reg_x((pc), 31, (D), 0, 0, 19, 0)
-
-#  define jit_emit_fadd_rrr(pc, D, A, B) jit_emit_3a((pc), 63, (D), (A), (B), 0, 21, 0)
-#  define jit_emit_fsub_rrr(pc, D, A, B) jit_emit_3a((pc), 63, (D), (A), (B), 0, 20, 0)
-#  define jit_emit_fmul_rrr(pc, D, A, B) jit_emit_3a((pc), 63, (D), (A), 0, (B), 25, 0)
-#  define jit_emit_fdiv_rrr_no_check(pc, D, A, B) jit_emit_3a((pc), 63, (D), (A), (B), 0, 18, 0)
-
-/* canonical names */
-#  define jit_emit_add_rrr_n jit_emit_fadd_rrr
-#  define jit_emit_div_rrr_n jit_emit_fdiv_rrr
-#  define jit_emit_mul_rrr_n jit_emit_fmul_rrr
-#  define jit_emit_sub_rrr_n jit_emit_fsub_rrr
-
-#  define jit_emit_fsel(pc, D, A, B, C) jit_emit_3a((pc), 63, (D), (A), (B), (C), 23, 0)
-
-#  define jit_emit_abs_rr_n(pc, D, A)  jit_emit_3reg_x((pc), 63, (D), 0, (A), 264, 0)
-#  define jit_emit_neg_rr_n(pc, D, A)   jit_emit_3reg_x((pc), 63, (D), 0, (A), 40, 0)
-
-#  define jit_emit_fmr(pc, D, A)   jit_emit_3reg_x((pc), 63, (D), 0, (A), 72, 0)
-#  define jit_emit_mov_rr_n(pc, D, A) jit_emit_fmr((pc), (D), (A))
-
-/* float cvt to int (round towards zero) */
-#  define jit_emit_fctiwz(pc, D, A)   jit_emit_3reg_x((pc), 63, (D), 0, (A), 15, 0)
-/* Store Floating-Point as Integer Word Indexed */
-#  define jit_emit_stfiwx(pc, S, A, B)  jit_emit_3reg_x((pc), 31, (S), (A), (B), 983, 0)
-
-/* not in core.ops, but probably should be: */
-#  define jit_emit_fsqrt(pc, D, A) jit_emit_3reg((pc), 63, (D), 0, (A), 0, 18, 0)
-
-/* Load a CPU register from a Parrot register. */
-
-#  define jit_emit_mov_rm_i(pc, reg, offs) \
-    jit_emit_lwz((pc), (reg), (offs), r13)
-
-#  define jit_emit_mov_rm_n(pc, reg, offs) \
-    jit_emit_lfd((pc), (reg), (offs), r13)
-
-/* compare operation.
- *
- *  +--------------------------------------------------------------------+
- *  |  Opcode  | BF   | |L |     A     |     B     |                     |
- *  +--------------------------------------------------------------------+
- * 0          5 6    8 9 10 11       15 16       20 21                 31
- *
- * opcode = 31 for integer, 63 for floating point
- * bf is the comparison result field to use (we just always use 0)
- */
-
-#  define _emit_cmp(pc, t, bf, ra, rb) \
-    *((pc)++) = (t) << 2 | ((int)(bf)) >> 1; \
-    *((pc)++) = (char)((bf) << 7 | (ra)); \
-    *((pc)++) = (char)((rb) << 3); \
-    *((pc)++) = 0
-
-#  define jit_emit_cmp_rr_i(pc, ra, rb) _emit_cmp((pc), 31, 0, (ra), (rb))
-#  define jit_emit_cmp_rr_n(pc, ra, rb) _emit_cmp((pc), 63, 0, (ra), (rb))
-
-/* compare immediate operation.
- *
- *  +--------------------------------------------------------------------+
- *  |  Opcode  | BF   | |L |     A     |             SIMM                |
- *  +--------------------------------------------------------------------+
- * 0          5 6    8 9 10 11       15 16                             31
- *
- */
-
-#  define _emit_cmpi(pc, t, bf, ra, simm) \
-    *((pc)++) = (t) << 2 | ((int)(bf)) >> 1; \
-    *((pc)++) = (char)((bf) << 7 | (ra)); \
-    *((pc)++) = (simm) >> 8; \
-    *((pc)++) = (char)(simm)
-
-/* Branch conditional to immediate
- *
- *  +--------------------------------------------------------------------+
- *  |    16    |     BO     |     BI     |     BD              | AA | LK |
- *  +--------------------------------------------------------------------+
- * 0          5 6         10 11        15 16                      30   31
- *
- * Branch flags.  A 10-bit quantity representing BO and BI.  BO is 12
- * for true and 4 for false.  BI indicates the comparison type (lt=0,
- * gt = 1, eq = 2).  BD is the relative or absolute displacement,
- * divided by four, or AA, LK are set to zero, giving a 16-bit displacement.
- */
-
-#  define _BLT 0
-#  define _BGT 1
-#  define _BEQ 2
-#  define _BYES (12 << 5)
-#  define _BNO (4 << 5)
-
-typedef enum {
-    BLT = _BYES | _BLT,
-    BGE = _BNO | _BLT,
-    BGT = _BYES | _BGT,
-    BLE = _BNO | _BGT,
-    BEQ = _BYES | _BEQ,
-    BNE = _BNO | _BEQ
-} branch_t;
-
-#  define _emit_bc(pc, opt, bd, aa, lk) \
-    *((pc)++) = 16 << 2 | ((int)(opt)) >> 8; \
-    *((pc)++) = (char)((opt)&0xff); \
-    *((pc)++) = (char)((bd) >> 8); \
-    *((pc)++) = (char)((bd) | (aa) << 1 | (lk))
-
-static void
-jit_emit_bc(Parrot_jit_info_t *jit_info, branch_t cond, opcode_t disp) {
-    opcode_t opcode = jit_info->op_i + disp;
-    int offset;
-    if (opcode <= jit_info->op_i) {
-        offset = jit_info->arena.op_map[opcode].offset -
-            (jit_info->native_ptr - jit_info->arena.start);
-        if (jit_info->optimizer->cur_section->branch_target ==
-            jit_info->optimizer->cur_section)
-                offset +=
-                    jit_info->optimizer->cur_section->branch_target->load_size;
-    }
-    else {
-        offset = 0;
-        Parrot_jit_newfixup(jit_info);
-        jit_info->arena.fixups->type = JIT_PPC_BRANCH;
-        jit_info->arena.fixups->param.opcode = opcode;
-
-        if (jit_info->optimizer->cur_section->branch_target ==
-            jit_info->optimizer->cur_section)
-                jit_info->arena.fixups->skip =
-                    jit_info->optimizer->cur_section->branch_target->load_size;
-
-    }
-    /* TODO check offset - 16 bits only allowed */
-    _emit_bc(jit_info->native_ptr, cond, offset, 0, 0);
-}
-
-static void
-jit_emit_bx(Parrot_jit_info_t *jit_info, char type, opcode_t disp)
-{
-    opcode_t opcode = jit_info->op_i + disp;
-    int offset;
-
-    if (opcode <= jit_info->op_i) {
-        offset = jit_info->arena.op_map[opcode].offset -
-            (jit_info->native_ptr - jit_info->arena.start);
-        if (jit_info->optimizer->cur_section->branch_target ==
-            jit_info->optimizer->cur_section)
-                offset +=
-                    jit_info->optimizer->cur_section->branch_target->load_size;
-    }
-    else {
-        offset = 0;
-        Parrot_jit_newfixup(jit_info);
-        jit_info->arena.fixups->type = JIT_PPC_UBRANCH;
-        jit_info->arena.fixups->param.opcode = opcode;
-
-        if (jit_info->optimizer->cur_section->branch_target ==
-            jit_info->optimizer->cur_section)
-                jit_info->arena.fixups->skip =
-                    jit_info->optimizer->cur_section->branch_target->load_size;
-
-    }
-    _emit_bx(jit_info->native_ptr, type, offset);
-}
-
-
-/* Store a CPU register back to a Parrot register. */
-
-#  define jit_emit_mov_mr_i(pc, offs, reg) \
-    jit_emit_stw((pc), (reg), (offs), r13)
-
-#  define jit_emit_mov_mr_n(pc, offs, reg) \
-    jit_emit_stfd((pc), (reg), (offs), r13)
-
-/*
- * Load a 32-bit immediate value.
- */
-
-#  define jit_emit_mov_ri_i(pc, D, imm) \
-    jit_emit_ori((pc), (D), r31, (long)(imm) & 0xffff); \
-    if ((long)(imm) >> 16 != 0) { \
-      jit_emit_oris((pc), (D), (D), (long)(imm) >> 16); }
-
-/* load a float constant (needs a gpr temp: ISR2) */
-
-#  define jit_emit_mov_ri_n(pc, D, offs) \
-    jit_emit_mov_ri_i((pc), ISR1, (offs)); \
-    jit_emit_lfd((pc), (D), 0, ISR1);
-
-#  define add_disp(pc, D, disp) \
-    jit_emit_mov_ri_i((pc), ISR1, (disp)); \
-    jit_emit_add_rrr((pc), (D), r15, ISR1)
-
-#  define jit_emit_load_op_map(pc) \
-    jit_emit_lwz((pc), ISR1, offsetof(Interp, code), r16); \
-    jit_emit_lwz((pc), ISR1, offsetof(PackFile_ByteCode, jit_info), ISR1); \
-    jit_emit_lwz((pc), r14, (offsetof(Parrot_jit_arena_t, op_map) + \
-                           offsetof(Parrot_jit_info_t, arena)), ISR1)
-
-#  define jit_emit_load_code_start(pc) \
-    jit_emit_lwz((pc), ISR1, offsetof(Interp, code), r16); \
-    jit_emit_lwz((pc), r15,  offsetof(PackFile_Segment, data), ISR1)
-
-#  define jit_emit_branch_to_opcode(pc, D) \
-    jit_emit_lwz((pc), r13, offsetof(Interp, ctx.bp), r16); \
-    jit_emit_sub_rrr(jit_info->native_ptr, ISR1, (D), r15); \
-    jit_emit_lwzx(jit_info->native_ptr, ISR1, ISR1, r14); \
-    jit_emit_mtctr(jit_info->native_ptr, ISR1); \
-    jit_emit_bctrl(jit_info->native_ptr)
-
-#ifdef PARROT_EXEC_OS_AIX /* support AIX calling convention using compiler intermediary _ptrgl */
-#  define jit_emit_call_func(pc, addr) \
-      jit_emit_mov_ri_i(jit_info->native_ptr, ISR1, (long)*((long*)(addr))); \
-      jit_emit_mtctr(jit_info->native_ptr, ISR1); \
-      jit_emit_bctrl(jit_info->native_ptr);
-#else
-#  define jit_emit_call_func(pc, addr) \
-      jit_emit_mov_ri_i(jit_info->native_ptr, ISR1, (long)(addr)); \
-      jit_emit_mtctr(jit_info->native_ptr, ISR1); \
-      jit_emit_bctrl(jit_info->native_ptr);
-#endif
-
-#if EXEC_CAPABLE
-#  define load_nc(pc, D, disp) \
-       jit_emit_oris((pc), (D), r31, (long)(disp) >> 16); \
-       Parrot_exec_add_text_rellocation(jit_info->objfile, \
-         (pc), RTYPE_DATA, "const_table", -2); \
-       jit_emit_ori(jit_info->native_ptr, (D), (D), (long)(disp) & 0xffff); \
-       Parrot_exec_add_text_rellocation(jit_info->objfile, \
-         (pc), RTYPE_DATA1, "const_table", -2);
-#endif /* EXEC_CAPABLE */
-
-static char *
-div_rrr(Parrot_jit_info_t *jit_info, char D, char A, char B)
-{
-    char *jmp_ptr, *sav_ptr;
-    static const char div_by_zero[] = "Divide by zero";
-    char *pc = jit_info->native_ptr;
-
-    jit_emit_cmp_ri(pc, B, 0);
-     /* remember PC */
-    jmp_ptr = pc;
-    /* emit jump past exception code, dummy offset */
-    _emit_bc(pc, BNE, 0, 0, 0);
-    jit_emit_mov_rr(pc, r3, r16); /* interp */
-    jit_emit_mov_ri_i(pc, r4, 0);          /* NULL */
-    jit_emit_mov_ri_i(pc, r5, EXCEPTION_DIV_BY_ZERO);          /* type */
-    jit_emit_mov_ri_i(pc, r6, div_by_zero);
-    jit_info->native_ptr = pc;
-    jit_emit_call_func(pc, Parrot_ex_throw_from_c_args);
-    pc = jit_info->native_ptr;
-    /* fixup above jump */
-    sav_ptr = pc;
-    pc = jmp_ptr;
-    _emit_bc(pc, BNE, ((long)(sav_ptr - jmp_ptr)), 0, 0);
-    /* restore PC */
-    pc = sav_ptr;
-    jit_emit_div_rrr_no_check(pc, D, A, B);
-    return pc;
-}
-
-static char *
-fdiv_rrr(Parrot_jit_info_t *jit_info, char D, char A, char B)
-{
-    char *jmp_ptr, *sav_ptr;
-    static const char div_by_zero[] = "Divide by zero";
-    char *pc = jit_info->native_ptr;
-    static const double zero = 0.0;
-
-    jit_emit_mov_ri_i(pc, ISR1, &zero);
-    jit_emit_lfd(pc, f1, 0, ISR1);
-
-    jit_emit_cmp_rr_n(pc, B, f1);   /* XXX be sure it's unmapped */
-     /* remember PC */
-    jmp_ptr = pc;
-    /* emit jump past exception code, dummy offset */
-    _emit_bc(pc, BNE, 0, 0, 0);
-    jit_emit_mov_rr(pc, r3, r16); /* interp */
-    jit_emit_mov_ri_i(pc, r4, 0);          /* NULL */
-    jit_emit_mov_ri_i(pc, r5, EXCEPTION_DIV_BY_ZERO);          /* type */
-    jit_emit_mov_ri_i(pc, r6, div_by_zero);
-    jit_info->native_ptr = pc;
-    jit_emit_call_func(pc, Parrot_ex_throw_from_c_args);
-    pc = jit_info->native_ptr;
-    /* fixup above jump */
-    sav_ptr = pc;
-    pc = jmp_ptr;
-    _emit_bc(pc, BNE, ((long)(sav_ptr - jmp_ptr)), 0, 0);
-    /* restore PC */
-    pc = sav_ptr;
-    jit_emit_fdiv_rrr_no_check(pc, D, A, B);
-    return pc;
-}
-
-#  define jit_emit_div_rrr(pc, D, A, B) (pc) = div_rrr(jit_info, (D), (A), (B))
-#  define jit_emit_fdiv_rrr(pc, D, A, B) (pc) = fdiv_rrr(jit_info, (D), (A), (B))
-
-/* XXX except A = -2^31 and B = -1 */
-
-static char *
-cmod_rrr(Parrot_jit_info_t *jit_info, char D, char A, char B)
-{
-    char *pc;
-    pc = div_rrr(jit_info, D, A, B);
-    jit_emit_mul_rrr(pc, D, D, B);
-    jit_emit_sub_rrr(pc, D, A, D);
-    return pc;
-}
-
-#  define jit_emit_cmod_rrr(pc, D, A, B) (pc) = cmod_rrr(jit_info, (D), (A), (B))
-
-
-void Parrot_ppc_jit_restore_nonvolatile_registers(void);
-
-/*
- * r13 - r31 are preserved i.e. 19 GPRs
- * f14 - f31 are preserved
- * (these are all of the nonvolatile registers)
- */
-#  define PPC_JIT_GP_REGISTER_SAVE_SPACE (4*19)
-#  define PPC_JIT_FP_REGISTER_SAVE_SPACE (8*18)
-/*
- * 24 linkage area
- * 32 param area i.e.enough for 8 args
- * 12 round up so that sum is divisible by 16
- */
-#  define PPC_JIT_FRAME_SIZE (PPC_JIT_GP_REGISTER_SAVE_SPACE + PPC_JIT_FP_REGISTER_SAVE_SPACE + 68)
-
-#if JIT_EMIT == 2
-
-void
-Parrot_jit_normal_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    add_disp(jit_info->native_ptr, r3,
-        ((long)jit_info->cur_op - (long)interp->code->base.data));
-    jit_emit_mov_rr(jit_info->native_ptr, r4, r16); /* interp */
-
-    /*
-    Parrot_jit_newfixup(jit_info);
-
-    jit_info->arena.fixups->type = JIT_PPC_CALL;
-    jit_info->arena.fixups->param.fptr =
-        (void (*)(void))interp->op_func_table[*(jit_info->cur_op)];
-
-    _emit_bx(jit_info->native_ptr, 1, 0);
-    */
-
-    jit_emit_call_func(jit_info->native_ptr,
-                       interp->op_func_table[*(jit_info->cur_op)]);
-}
-
-void
-Parrot_jit_cpcf_op(Parrot_jit_info_t *jit_info,
-                   PARROT_INTERP)
-{
-    Parrot_jit_normal_op(jit_info, interp);
-
-    /* fix our reserved registers, in case we are branching to a new segment */
-    jit_emit_load_op_map(jit_info->native_ptr);
-    jit_emit_load_code_start(jit_info->native_ptr);
-
-    /* branch to the opcode just returned from the normal_op call, in r3 */
-    jit_emit_branch_to_opcode(jit_info->native_ptr, r3);
-}
-
-static void Parrot_end_jit(Parrot_jit_info_t *, PARROT_INTERP);
-
-#  undef Parrot_jit_restart_op
-/* Parrot_jit_restart_op is based on the i386 version */
-void
-Parrot_jit_restart_op(Parrot_jit_info_t *jit_info,
-                      PARROT_INTERP)
-{
-    char *jmp_ptr, *sav_ptr;
-
-    Parrot_jit_normal_op(jit_info, interp);
-    /* test return value; if zero (e.g after trace), return from JIT */
-    jit_emit_cmp_ri(jit_info->native_ptr, r3, 0);
-    /* remember PC */
-    jmp_ptr = jit_info->native_ptr;
-    /* emit jump past exit code, dummy offset */
-    _emit_bc(jit_info->native_ptr, BNE, 0, 0, 0);
-    Parrot_end_jit(jit_info, interp);
-    /* fixup above jump */
-    sav_ptr = jit_info->native_ptr;
-    jit_info->native_ptr = jmp_ptr;
-    _emit_bc(jit_info->native_ptr, BNE, ((long)(sav_ptr - jmp_ptr)), 0, 0);
-    /* restore PC */
-    jit_info->native_ptr = sav_ptr;
-
-    /* fix our reserved registers, in case we are branching to a new segment */
-    jit_emit_load_op_map(jit_info->native_ptr);
-    jit_emit_load_code_start(jit_info->native_ptr);
-
-    /* branch to the opcode just returned from the normal_op call, in r3 */
-    jit_emit_branch_to_opcode(jit_info->native_ptr, r3);
-}
-
-#endif /* JIT_EMIT == 2 */
-
-#  define NATIVECODE jit_info->native_ptr
-#  define CUR_OPCODE jit_info->cur_op
-#  define MAP(i) jit_info->optimizer->map_branch[jit_info->op_i + (i)]
-static void
-jit_get_params_pc(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-{
-    PMC    *sig_pmc  = CONTEXT(interp)->constants[CUR_OPCODE[1]]->u.key;
-    INTVAL *sig_bits = PMC_data_typed(sig_pmc, INTVAL *);
-    INTVAL  n        = VTABLE_get_integer(interp, sig_pmc);
-    INTVAL  i;
-
-    jit_info->n_args = n;
-
-    for (i = 0; i < n; ++i) {
-        switch (sig_bits[i] & PARROT_ARG_TYPE_MASK) {
-            case PARROT_ARG_INTVAL:
-                jit_emit_lwz(NATIVECODE, MAP(2+i), 4 + i*4, r5);
-                break;
-            case PARROT_ARG_FLOATVAL:
-                jit_emit_lwz(NATIVECODE, ISR1, 4 + i*4, r5);
-                jit_emit_lfd(jit_info->native_ptr, MAP(2+i), 0, ISR1);
-                break;
-            default:
-                break;
-        }
-    }
-}
-
-#  define CONST(i) interp->code->const_table->constants[jit_info->cur_op[(i)]]
-static void
-jit_set_returns_pc(Parrot_jit_info_t *jit_info, PARROT_INTERP,
-        int recursive)
-{
-    PMC *sig_pmc;
-    INTVAL *sig_bits, sig;
-
-    sig_pmc = CONTEXT(interp)->constants[CUR_OPCODE[1]]->u.key;
-    if (!VTABLE_elements(interp, sig_pmc))
-        return;
-    GETATTR_FixedIntegerArray_int_array(interp, sig_pmc, sig_bits);
-    sig = sig_bits[0];
-    if (!recursive) {
-        /* ISR2 <- args[0] */
-        jit_emit_lwz(jit_info->native_ptr, ISR2, 0, r5);
-    }
-    switch (sig & (PARROT_ARG_TYPE_MASK|PARROT_ARG_CONSTANT)) {
-        case PARROT_ARG_INTVAL:
-            if (recursive) {
-                jit_emit_mov_rr(NATIVECODE, r3, MAP(2));
-            }
-            else {
-                jit_emit_stw(jit_info->native_ptr, MAP(2), 0, ISR2);
-            }
-            break;
-        case PARROT_ARG_INTVAL|PARROT_ARG_CONSTANT:
-            if (recursive) {
-                jit_emit_mov_ri_i(NATIVECODE, r3, CUR_OPCODE[2]);
-            }
-            else {
-                jit_emit_mov_ri_i(NATIVECODE, ISR1, CUR_OPCODE[2]);
-                jit_emit_stw(jit_info->native_ptr, ISR1, 0, ISR2);
-            }
-            break;
-        case PARROT_ARG_FLOATVAL:
-            if (recursive) {
-                /* floats are returned in f1 according to ABI */
-                jit_emit_mov_rr_n(NATIVECODE, f1, MAP(2));
-            }
-            else {
-                jit_emit_stfd(jit_info->native_ptr, MAP(2), 0, ISR2);
-            }
-            break;
-        case PARROT_ARG_FLOATVAL|PARROT_ARG_CONSTANT:
-            jit_emit_mov_ri_i(NATIVECODE, ISR1, &CONST(2)->u.number);
-            if (recursive) {
-                jit_emit_lfd(jit_info->native_ptr, f1, 0, ISR1);
-            }
-            else {
-                jit_emit_lfd(jit_info->native_ptr, FSR1, 0, ISR1);
-                jit_emit_stfd(jit_info->native_ptr, FSR1, 0, ISR2);
-            }
-            break;
-        default:
-            exit_fatal(1, "set_returns_jit - unknown type");
-            break;
-    }
-}
-
-static int jit_save_regs_call(Parrot_jit_info_t *, PARROT_INTERP, int skip);
-
-static void
-jit_set_args_pc(Parrot_jit_info_t *jit_info, PARROT_INTERP, int recursive)
-{
-    PMC *sig_args, *sig_params, *sig_result;
-    INTVAL *sig_bits, sig, i, n;
-    PackFile_Constant ** constants;
-    opcode_t *params, *result;
-    char params_map;
-    int skip, used_n;
-    const jit_arch_regs *reg_info;
-
-    if (!recursive) {
-        /* create args array */
-        exit_fatal(1, "set_args_jit - can't do that yet ");
-    }
-
-    constants = CONTEXT(interp)->constants;
-    sig_args = constants[CUR_OPCODE[1]]->u.key;
-    if (!VTABLE_elements(interp, sig_args))
-        return;
-    params = jit_info->optimizer->sections->begin;
-    sig_params = constants[params[1]]->u.key;
-    ASSERT_SIG_PMC(sig_params);
-    GETATTR_FixedIntegerArray_int_array(interp, sig_args, sig_bits);
-    n = VTABLE_elements(interp, sig_args);
-    /*
-     * preserve registers - need get_results, because we skip the
-     * return value
-     */
-    result = CUR_OPCODE + 2 + n + 3; /* set_args, set_p_pc */
-    PARROT_ASSERT(*result == PARROT_OP_get_results_pc);
-    sig_result = constants[result[1]]->u.key;
-    ASSERT_SIG_PMC(sig_result);
-
-    if (!VTABLE_elements(interp, sig_result))
-        skip = -1;
-    else
-        skip = MAP(2 + n + 3 + 2);
-    used_n = jit_save_regs_call(jit_info, interp, skip);
-    for (i = 0; i < n; ++i) {
-        sig = sig_bits[i];
-        /* move args to params regs */
-        params_map = jit_info->optimizer->map_branch[2 + i];
-        /* TODO check for overlaps/collision */
-        switch (sig & (PARROT_ARG_TYPE_MASK|PARROT_ARG_CONSTANT)) {
-            case PARROT_ARG_INTVAL:
-                jit_emit_mov_rr(NATIVECODE, params_map, MAP(2 + i));
-                break;
-            case PARROT_ARG_INTVAL|PARROT_ARG_CONSTANT:
-                jit_emit_mov_ri_i(NATIVECODE, params_map, CUR_OPCODE[2 + i]);
-                break;
-            default:
-                exit_fatal(1, "set_args_jit - unknown type");
-                break;
-        }
-    }
-}
-
-/*
- * preserve registers around a functioncall
- *
- * b) all used register around a call (skip >= 0 := return result
- *    TODO save N regs for b) too
- */
-static int
-jit_save_regs_call(Parrot_jit_info_t *jit_info, PARROT_INTERP, int skip)
-{
-    int i, used_i, save_i;
-    const jit_arch_regs *reg_info;
-
-    /* create stack frame 24 link + 32 params -> 64 */
-    jit_emit_mflr(jit_info->native_ptr, r0);    /* store link reg */
-    jit_emit_stw(jit_info->native_ptr, r0, 8, r1); /* stw     r0,8(r1) */
-    jit_emit_stwu(jit_info->native_ptr, r1, -64, r1);
-    used_i = CONTEXT(interp)->n_regs_used[REGNO_INT];
-    reg_info = &jit_info->arch_info->regs[jit_info->code_type];
-    for (i = 0; i < used_i; ++i) {
-        if (reg_info->map_I[i] == skip)
-            continue;
-        /* we use param area sp+24 := r3, sp+52 := r10 */
-        jit_emit_stw(jit_info->native_ptr, reg_info->map_I[i], 24 + i*4, r1);
-    }
-    /* preserve link register */
-    return 0;  /* TODO N regs */
-}
-
-static void
-jit_restore_regs_call(Parrot_jit_info_t *jit_info, PARROT_INTERP,
-        int skip)
-{
-
-    int i, used_i, save_i;
-    const jit_arch_regs *reg_info;
-
-    used_i = CONTEXT(interp)->n_regs_used[REGNO_INT];
-    reg_info = &jit_info->arch_info->regs[jit_info->code_type];
-    /* note - reversed order of jit_save_regs  */
-    for (i = used_i - 1; i >= 0; --i) {
-        if (reg_info->map_I[i] == skip)
-            continue;
-        /* we use param area sp+24 := r3, sp+52 := r10 */
-        jit_emit_lwz(jit_info->native_ptr, reg_info->map_I[i], 24 + i*4, r1);
-    }
-    /* pop stack frame */
-    jit_emit_add_rri_i(jit_info->native_ptr, r1, r1, 64);
-    /* restore link reg */
-    jit_emit_lwz(jit_info->native_ptr, r0, 8, r1);
-    jit_emit_mtlr(jit_info->native_ptr, r0);
-    /* TODO other types */
-}
-
-#if JIT_EMIT == 0
-
-/*
- * emit stack frame according to ABI
- * see also jit/ppc/core.jit for Parrot_end
- */
-static void
-Parrot_jit_begin(Parrot_jit_info_t *jit_info,
-                 PARROT_INTERP)
-{
-    int i;
-    jit_emit_mflr(jit_info->native_ptr, r0);
-    jit_emit_stmw(jit_info->native_ptr, r13, -PPC_JIT_GP_REGISTER_SAVE_SPACE, r1);
-
-    for (i = 1; i <= 18; ++i)
-    {
-        jit_emit_stfd(jit_info->native_ptr, (i + 13), (-PPC_JIT_GP_REGISTER_SAVE_SPACE - i*8), r1);
-    }
-    jit_emit_stw(jit_info->native_ptr, r0, 8, r1);
-    jit_emit_stwu(jit_info->native_ptr, r1, -PPC_JIT_FRAME_SIZE, r1);
-    jit_emit_xor_rrr(jit_info->native_ptr, r31, r31, r31);
-    jit_emit_mov_rr(jit_info->native_ptr, r16, r3);  /* interp */
-    if (!jit_info->objfile) {
-        jit_emit_load_op_map(jit_info->native_ptr);
-    }
-#  if EXEC_CAPABLE
-    else {
-        jit_emit_oris(jit_info->native_ptr, r14, r31, 0);
-        Parrot_exec_add_text_rellocation(jit_info->objfile,
-            jit_info->native_ptr, RTYPE_DATA, "opcode_map", -2);
-        jit_emit_ori(jit_info->native_ptr, r14, r14, 0);
-        Parrot_exec_add_text_rellocation(jit_info->objfile,
-            jit_info->native_ptr, RTYPE_DATA1, "opcode_map", -2);
-    }
-#  endif
-
-    jit_emit_load_code_start(jit_info->native_ptr);
-
-    /* jit_emit restart code: branch to the program counter passed into
-       the JIT invocation as the second parameter, which is r4 */
-    jit_emit_branch_to_opcode(jit_info->native_ptr, r4);
-}
-
-static void
-Parrot_jit_begin_sub(Parrot_jit_info_t *jit_info,
-                 PARROT_INTERP)
-{
-}
-
-static void
-Parrot_jit_begin_sub_regs(Parrot_jit_info_t *jit_info,
-                 PARROT_INTERP)
-{
-    jit_emit_mflr(jit_info->native_ptr, r0);    /* optional */
-    jit_emit_stw(jit_info->native_ptr, r0, 8, r1); /* stw     r0,8(r1) */
-    /* preserve r31 */
-    jit_emit_stw(jit_info->native_ptr, r31, -4, r1);
-    /* 24 linkage area, 32 params , 1 word local, roundup => 32 */
-    jit_emit_stwu(jit_info->native_ptr, r1, -64, r1);
-    /* r31 = 0 - needed for load immediate */
-    jit_emit_xor_rrr(jit_info->native_ptr, r31, r31, r31);
-
-    if (jit_info->flags & JIT_CODE_RECURSIVE) {
-        char * L1;
-        int offs;
-        jit_get_params_pc(jit_info, interp);
-        /* remember fixup position - call sub */
-        L1 = NATIVECODE;
-        _emit_bx(NATIVECODE, 1, 0xbeef); /* bl */
-        /* fetch args */
-        jit_emit_lwz(jit_info->native_ptr, ISR2, 0, r5);
-        /* store INTVAL result */
-        jit_emit_stw(jit_info->native_ptr, r3, 0, ISR2);
-        /* fetch pc -> return it */
-        jit_emit_lwz(jit_info->native_ptr, r3, 4 + jit_info->n_args * 4, r5);
-    /* return sequence */
-    jit_emit_lwz(jit_info->native_ptr, r1, 0, r1);
-    jit_emit_lwz(jit_info->native_ptr, r31, -4, r1);
-    jit_emit_lwz(jit_info->native_ptr, r0, 8, r1);   /* opt */
-    jit_emit_mtlr(jit_info->native_ptr, r0);   /* opt */
-    jit_emit_blr(jit_info->native_ptr);
-        /* re-emit call */
-        offs = NATIVECODE - L1;
-        _emit_bx(L1, 1, offs); /* bl */
-    }
-}
-
-static void
-Parrot_jit_dofixup(Parrot_jit_info_t *jit_info,
-                   PARROT_INTERP)
-{
-    Parrot_jit_fixup_t *fixup;
-    char *fixup_ptr;
-    char *disp;
-    long d, high, low;
-
-    fixup = jit_info->arena.fixups;
-
-    while (fixup){
-        switch (fixup->type){
-            case JIT_PPC_CALL:
-                fixup_ptr = Parrot_jit_fixup_target(jit_info, fixup);
-                d = ((long)fixup->param.fptr - (long)fixup_ptr);
-                *(fixup_ptr++) |= (char)(d >> 29) & 3;
-                *(fixup_ptr++) = (char)(d >> 16);
-                *(fixup_ptr++) = (char)(d >> 8);
-                *(fixup_ptr++) |= (char)d & ~3;
-                break;
-
-            case JIT_PPC_UBRANCH:
-                fixup_ptr = Parrot_jit_fixup_target(jit_info, fixup);
-                d = jit_info->arena.op_map[fixup->param.opcode].offset
-                    - fixup->native_offset + fixup->skip;
-                *(fixup_ptr++) |= (char)(d >> 24) & 3;
-                *(fixup_ptr++) = (char)(d >> 16);
-                *(fixup_ptr++) = (char)(d >> 8);
-                *(fixup_ptr++) |= (char)d & ~3;
-                break;
-
-            case JIT_PPC_BRANCH:
-                /* TODO check offset - 16 bits only allowed */
-                fixup_ptr = Parrot_jit_fixup_target(jit_info, fixup);
-                d = jit_info->arena.op_map[fixup->param.opcode].offset
-                    - fixup->native_offset + fixup->skip;
-                fixup_ptr += 2;
-                *(fixup_ptr++) = (char)(d >> 8);
-                *(fixup_ptr++) |= (char)d & ~3;
-                break;
-
-            default:
-                exit_fatal(EXCEPTION_JIT_ERROR, "Unknown fixup type:%d\n",
-                                   fixup->type);
-                break;
-        }
-        fixup = fixup->next;
-    }
-}
-
-
-/* move reg to mem (i.e. intreg) */
-static void
-jit_mov_mr_offs(PARROT_INTERP, Parrot_jit_info_t *jit_info, int base,
-                INTVAL offs, int reg)
-{
-    jit_emit_mov_mr_i(jit_info->native_ptr, offs, reg);
-    /*
-     * if we save registers, the last instruction isn't the ins that
-     * sets condition codes, so the speed hack in Parrot_ifunless_i_ic
-     * doesn't work.
-     */
-    jit_info->prev_op = 0;
-}
-
-/* move mem (i.e. intreg) to reg */
-static void
-jit_mov_rm_offs(PARROT_INTERP, Parrot_jit_info_t *jit_info, int reg, int base,
-                INTVAL offs)
-{
-    jit_emit_mov_rm_i(jit_info->native_ptr, reg, offs);
-}
-
-/* move reg to mem (i.e. numreg) */
-static void
-jit_mov_mr_n_offs(PARROT_INTERP, Parrot_jit_info_t * jit_info, int base,
-                  INTVAL offs, int reg)
-{
-    jit_emit_mov_mr_n(jit_info->native_ptr, offs, reg);
-    jit_info->prev_op = 0;
-}
-
-/* move mem (i.e. numreg) to reg */
-static void
-jit_mov_rm_n_offs(PARROT_INTERP, Parrot_jit_info_t * jit_info, int reg,
-                  int base, INTVAL offs)
-{
-    jit_emit_mov_rm_n(jit_info->native_ptr, reg, offs);
-}
-#  define REQUIRES_CONSTANT_POOL 0
-#  ifdef PARROT_EXEC_OS_AIX
-#    define INT_REGISTERS_TO_MAP 14
-#  else
-#    define INT_REGISTERS_TO_MAP 14
-#  endif
-#  define FLOAT_REGISTERS_TO_MAP 18
-
-/*
- * Register usage
- * r0  special rA/0 not allocatable, not usable as ISR1
- * r1  SP
- * r2 TOC (AIX only) / allocated
- * r3 - r10 allocated
- * r11 ISR1
- * r12 ISR2
- * r13 Parrot register frame pointer
- * r14 op_map
- * r15 code_start
- * r16 interpreter
- * r17 - r30 allocated
- * r31 zero
- *
- * f0  FSR1
- * f1 - f12 allocated
- * f13 FSR2
- * f14 - f31 - unused, need preserving if allocated
- */
-
-
-static const char intval_map[INT_REGISTERS_TO_MAP] =
-    { r17, r18, r19, r20, r21, r22, r23,
-      r24, r25, r26, r27, r28, r29, r30
-#  ifndef PARROT_EXEC_OS_AIX
-      /* AIX calling convention reserves r2 */
-      /* r2, */
-#  endif
-    };
-
-static const char intval_map_sub[] =
-    { r4, r6, r7, r8, r9, r10 };
-/*
- * f0, f13 are used as scratch registers
- * f1  - f12 are (additional) volatile registers
- * f14 - f31 are not nonvolatile, and preserved in begin/end
- */
-static const char floatval_map[FLOAT_REGISTERS_TO_MAP] =
-    {
-      f14, f15, f16, f17, f18, f19, f20, f21,
-      f22, f23, f24, f25, f26, f27, f28, f29, f30, f31
-    };
-
-static const char floatval_map_sub[] =
-{ f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12 };
-
-void ppc_flush_line(char *_sync);
-void ppc_sync(void);
-
-#  ifndef __IBMC__
-
-void
-ppc_flush_line(char *_sync)
-{
-    __asm__ __volatile__(
-    "dcbf 0,%0"
-    :
-    : "r" ((long)_sync));
-}
-
-void
-ppc_sync(void)
-{
-    __asm__ __volatile__("sync");
-}
-
-#  endif
-
-static void
-ppc_sync_cache(void *_start, void *_end)
-{
-    char *start = (char*)(((int)_start) &~(CACHELINESIZE - 1));
-    char *end = (char *)((((int)_end)+CACHELINESIZE-1) &~(CACHELINESIZE - 1));
-    char *_sync;
-
-    for (_sync = start; _sync < end; _sync += CACHELINESIZE) {
-        ppc_flush_line(_sync);
-    }
-    ppc_sync();
-}
-
-static void
-ppc_flush_cache(Parrot_jit_info_t * jit_info, PARROT_INTERP)
-{
-    ppc_sync_cache(jit_info->arena.start, jit_info->native_ptr);
-}
-
-
-static const jit_arch_info arch_info = {
-    jit_mov_rm_offs,
-    jit_mov_rm_n_offs,
-    jit_mov_mr_offs,
-    jit_mov_mr_n_offs,
-    Parrot_jit_dofixup,
-    ppc_flush_cache,
-    {
-        {
-            Parrot_jit_begin,   /* emit code prologue */
-            INT_REGISTERS_TO_MAP,   /* mapped ints */
-            INT_REGISTERS_TO_MAP,   /* all are preserved */
-            intval_map,
-            FLOAT_REGISTERS_TO_MAP,    /* mapped float regs */
-            FLOAT_REGISTERS_TO_MAP,    /* all preserved */
-            floatval_map
-        },
-        {
-            Parrot_jit_begin_sub,   /* emit code prologue */
-            6,                  /* 6 mapped ints */
-            6,                  /* all volatile */
-            intval_map_sub,
-            12,                  /* mapped float regs */
-            12,                  /* all volatile */
-            floatval_map_sub
-        },
-        {
-            Parrot_jit_begin_sub_regs,  /* emit code prologue */
-            6,                  /* 6 mapped ints */
-            6,                  /* all volatile */
-            intval_map_sub,
-            12,                  /* TODO 12 mapped float regs */
-            12,                  /* all volatile */
-            floatval_map_sub
-        }
-    }
-};
-
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-const jit_arch_info *
-Parrot_jit_init(PARROT_INTERP)
-{
-    return &arch_info;
-}
-
-#endif /* JIT_EMIT == 0 */
-#endif /* PARROT_PPC_JIT_EMIT_H_GUARD */
-
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/ppc/ppc-linux.s
==============================================================================
--- branches/orderedhash_revamp/src/jit/ppc/ppc-linux.s	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,25 +0,0 @@
-.text
-    .align 12
-    .globl Parrot_ppc_jit_restore_nonvolatile_registers
-Parrot_ppc_jit_restore_nonvolatile_registers:
-
-    lfd     14,-84(1)
-    lfd     15,-92(1)
-    lfd     16,-100(1)
-    lfd     17,-108(1)
-    lfd     18,-116(1)
-    lfd     19,-124(1)
-    lfd     20,-132(1)
-    lfd     21,-140(1)
-    lfd     22,-148(1)
-    lfd     23,-156(1)
-    lfd     24,-164(1)
-    lfd     25,-172(1)
-    lfd     26,-180(1)
-    lfd     27,-188(1)
-    lfd     28,-196(1)
-    lfd     29,-204(1)
-    lfd     30,-212(1)
-    lfd     31,-220(1)
-
-    blr

Deleted: branches/orderedhash_revamp/src/jit/skeleton/jit_defs.c
==============================================================================
--- branches/orderedhash_revamp/src/jit/skeleton/jit_defs.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,13 +0,0 @@
-/* Stub file for RT#38929 fixes */
-/*
-Copyright (C) 2008, Parrot Foundation.
-$Id$
-*/
-/* HEADERIZER HFILE: none */
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/skeleton/jit_emit.h
==============================================================================
--- branches/orderedhash_revamp/src/jit/skeleton/jit_emit.h	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,374 +0,0 @@
-/*
- * Copyright (C) 2005-2007, Parrot Foundation.
- */
-
-/*
- * jit_emit.h
- *
- * skeleton example - a stripped down jit/ppc/jit_emit.h
- *
- * $Id$
- */
-
-#ifndef PARROT_JIT_SKELETON_JIT_EMIT_H_GUARD
-#define PARROT_JIT_SKELETON_JIT_EMIT_H_GUARD
-
-#  include <unistd.h>
-#  include <limits.h>
-
-/*
- * define all the available cpu registers
- * reserve some for special purposes
- */
-typedef enum {
-    r0,       /* r0 (reg #0) can't be mapped - use it as temp if possible */
-    r1,
-    r2,
-    ARG1 = r3,      /* return value, first arg of function call */
-    r4,
-    r5,
-    r6,
-    r7,
-    r8,
-    r9,
-    r10,
-    r11,
-    ISR1 = r11,         /* temp aka intermediate scratch reg 1 */
-    r12,
-    ISR2 = r12,         /* temp reg 2 */
-    BP   = r13,         /* register base pointer (persistent) */
-    OP_MAP = r14,       /* cached op_map (persistent) */
-    CODE_START = r15,   /* cached code begint (persistent) */
-    INTERP = r16,       /* cached interpreter register (persistent) */
-    r17,
-    ...
-    r31
-} arch_iregister_t;
-
-/*
- * If your arch doesn't have that much register available, you
- * don't cache OP_MAP, CODE_START, and INTERP in a cpu register.
- * Only BP (the register base pointer is needed and 1 or 2 temp regs
- */
-
-
-/*
- * define, which register is the register base pointer
- */
-
-#  define Parrot_jit_emit_get_base_reg_no(pc) BP
-
-/*
- * define floating point register too, if there are some
- */
-typedef enum {
-    f0,       /* f0 (reg #0) can't be mapped - use it as temp if possible */
-    FSR1 = f0,
-    f1,
-    ...
-    f13,
-    FSR2 = f13,
-    ...
-    f31
-} arch_fregister_t;
-
-/*
- * now define macros for all possible (and implemented) operations
- *
- * Parrot defines JIT_EMIT to 1 or 2, when this file is included in
- * exec_cpu.c or jit_cpu.c
- */
-
-#if JIT_EMIT
-
-/*
- * the arch might have different branch types:
- * long offset, short offset, absolute, ...
- */
-enum { JIT_ARCH_CALL, JIT_ARCH_BRANCH, JIT_ARCH_UBRANCH };
-
-/*
- * emit code for a register move, pc is the location to emit the
- * asm code
- */
-#  define jit_emit_mov_rr(pc, dst, src) ...
-
-#  define jit_emit_add_rrr(pc, D, A, B) ...
-
-/*
- * load register from memory offset, relative to the register base pointer
- * this is used to load hardware cpu registers from parrot registers
- */
-#  define jit_emit_mov_rm_i(pc, reg, offs) \
-      jit_emit_lwz((pc), (reg), (offs), BP)     /* e.g. PPC */
-
-/* load floating point register from Parrot register */
-#  define jit_emit_mov_rm_n(pc, reg, offs) \
-      jit_emit_lfd((pc), (reg), (offs), BP)     /* e.g. PPC */
-
-/* Store a CPU register back to a Parrot register. */
-
-#  define jit_emit_mov_mr_i(pc, offs, reg) \
-      jit_emit_stw((pc), (reg), (offs), BP)
-
-#  define jit_emit_mov_mr_n(pc, offs, reg) \
-      jit_emit_stfd((pc), (reg), (offs), BP)
-
-/*
- * emit a branch and remember the branch target for code fixup,
- * which id done, when all code is emitted
- */
-static void
-jit_emit_bc(Parrot_jit_info_t *jit_info, branch_t cond, opcode_t disp)
-{
-    /* see other architectures */
-}
-
-
-/*
- * Load a 32-bit immediate value.
- */
-
-#  define jit_emit_mov_ri_i(pc, D, imm)   ...
-
-/*
- * define some helper macros for code generation
- * Parrot_jit_normal_op() is: create code that does the equivalent of:
- *
- * PC = ((INTERP->op_func_table)[*PC])(PC,INTERP)
- *
- * First we need to calculate the PC at runtime by adding disp to
- * to the cached CODE_START register 'add_disp' in jit/ppc
- */
-
-#  define add_disp(pc, D, disp) \
-      jit_emit_mov_ri_i((pc), ISR1, (disp)); \
-      jit_emit_add_rrr((pc), (D), CODE_START, ISR1)
-
-/*
- * emit code that gets interp->code->jit_info->arena->op_map
- * and sets the OP_MAP register
- */
-#  define jit_emit_load_op_map(pc) ...
-
-/*
- * emit code that gets interp->code->base.data
- * and sets the CODE_START register
- */
-#  define jit_emit_load_code_start(pc)  ...
-
-/*
- * emit code that branches to the next code piece
- */
-#  define jit_emit_branch_to_opcode(pc, D)  ...
-
-/*
- * emit code that calls a Parrot opcode function
- */
-#  define jit_emit_call_func(pc, addr)  ...
-
-#endif /* JIT_EMIT */
-
-#if JIT_EMIT == 2
-
-/*
- * emit code that calls a core.ops function from src/core_ops.c,
- * the generated code is the translation of this:
- *
- *  PC = ((INTERP->op_func_table)[*PC])(PC,INTERP)
- */
-void
-Parrot_jit_normal_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-}
-
-/*
- * emit code for a branching parrot opcode. All cached registers
- * need recalculation, as a branch can go into different code segments
- * with different code start and different jit_info
- */
-void
-Parrot_jit_cpcf_op(Parrot_jit_info_t *jit_info,
-                   PARROT_INTERP)
-{
-    Parrot_jit_normal_op(jit_info, interp);
-
-    /* fix our reserved registers,
-     * in case we are branching to a new segment
-     */
-    jit_emit_load_op_map(jit_info->native_ptr);
-    jit_emit_load_code_start(jit_info->native_ptr);
-
-    /* branch to the opcode just returned from the normal_op call ARG1 */
-    jit_emit_branch_to_opcode(jit_info->native_ptr, ARG1);
-}
-
-/*
- * release stack frame end exit see core.jit
- */
-static void Parrot_end_jit(Parrot_jit_info_t *, Interp *);
-
-#  undef Parrot_jit_restart_op
-/*
- * emit code that might leave the JIT runcore
- * see  ppc or i386
- */
-void
-Parrot_jit_restart_op(Parrot_jit_info_t *jit_info,
-                      PARROT_INTERP)
-{
-}
-
-#endif /* JIT_EMIT == 2 */
-
-#if JIT_EMIT == 0
-
-/*
- * emit stack frame according to ABI
- * preserve mapped registers according to ABI
- * load INTERP, OP_MAP, CODE_START, BP registers
- * then run the code at pc
- *
- * the function is called as
- *   runops(interp, pc)
- *
- * at runtime
- */
-void
-Parrot_jit_begin(Parrot_jit_info_t *jit_info,
-                 PARROT_INTERP)
-{
-    ...
-}
-/*
- * fix up all emitted branches
- * see  ppc or i386
- */
-static void
-Parrot_jit_dofixup(Parrot_jit_info_t *jit_info,
-                   PARROT_INTERP)
-{
-}
-
-/*
- * define interface functions for register -> parrot register moves
- * and v.v.
- *
- * see ppc or x86
- */
-
-static void
-jit_mov_mr_offs(...) {}
-static void
-jit_mov_rm_offs(...) {}
-
-static void
-jit_mov_mr_n_offs(...) {}
-static void
-jit_mov_rm_n_offs(...) {}
-
-/*
- * define how many int and float registers can be used by the
- * jit core
- */
-
-#  define INT_REGISTERS_TO_MAP 14
-#  define FLOAT_REGISTERS_TO_MAP 2
-
-/*
- * enumerate these mapped registers
- * please note that you have to preserve registers in
- * Parrot_jit_begin according to the ABI of the architecture
- */
-
-static const char intval_map[INT_REGISTERS_TO_MAP] =
-
-    { r17, r18, r19, r20, r21, r22, r23,
-      r24, r25, r26, r27, r28, r29, r30
-    };
-
-static const char floatval_map[FLOAT_REGISTERS_TO_MAP] =
-    {
-
-      f4, f5
-    };
-
-/*
- * you might need a function that flushes hardware caches after
- * JIT compilation is done
- */
-static void
-ppc_flush_cache(Parrot_jit_info_t * jit_info, Interp *i)
-{
-    ...
-}
-
-/*
- * define arch specific details in jit_arch_info
- */
-
-static const jit_arch_info arch_info = {
-    jit_mov_rm_offs,
-    jit_mov_rm_n_offs,
-    jit_mov_mr_offs,
-    jit_mov_mr_n_offs,
-    Parrot_jit_dofixup,
-    ppc_flush_cache,
-    {
-        /* JIT_CODE_FILE */
-        {
-            Parrot_jit_begin,   /* emit code prologue */
-            INT_REGISTERS_TO_MAP,   /* mapped ints */
-            INT_REGISTERS_TO_MAP,   /* all are preserved */
-            intval_map,
-            FLOAT_REGISTERS_TO_MAP,    /* mapped float regs */
-            FLOAT_REGISTERS_TO_MAP,    /* all preserved */
-            floatval_map
-        },
-        /* JIT_CODE_SUB */
-        {
-            Parrot_jit_begin_sub,   /* emit code prologue */
-            7,                  /* 7 mapped ints */
-            7,                  /* all volatile */
-            intval_map_sub,
-            12,                  /* mapped float regs */
-            12,                  /* all volatile */
-            floatval_map_sub
-        },
-        /* JIT_CODE_SUB_REGS_ONLY */
-        {
-            Parrot_jit_begin_sub_regs,  /* emit code prologue */
-            7,                  /* 7 mapped ints */
-            7,                  /* all volatile */
-            intval_map_sub,
-            12,                  /* 12 mapped float regs */
-            12,                  /* all volatile */
-            floatval_map_sub
-        }
-    }
-};
-
-/*
- * and finally you need an interface function to return above structure
- */
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-const jit_arch_info *
-Parrot_jit_init(PARROT_INTERP)
-{
-    return &arch_info;
-}
-
-
-#endif /* JIT_EMIT == 0 */
-#endif /* PARROT_JIT_SKELETON_JIT_EMIT_H_GUARD */
-
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/sun4/core.jit
==============================================================================
--- branches/orderedhash_revamp/src/jit/sun4/core.jit	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,956 +0,0 @@
-;
-; sun4/core.jit
-;
-; $Id$
-;
-
-Parrot_end {
-    emitm_ret(NATIVECODE);
-    emitm_restore_i(NATIVECODE, emitm_g(0), emitm_g(0), emitm_g(0));
-}
-
-Parrot_noop {
-    emitm_nop(NATIVECODE);
-}
-
-TEMPLATE Parrot_set_x_x {
-    if(MAP[1] && MAP[2]){
-    jit_emit_mov_rr<_N>(NATIVECODE, MAP[1], MAP[2]);
-    }
-    else if(MAP[1]){
-        jit_emit_load<_N>(jit_info, interp, 2, MAP[1]);
-    }
-    else if(MAP[2]){
-        jit_emit_store<_N>(jit_info, interp, 1, MAP[2]);
-    }
-    else {
-        jit_emit_load<_N>(jit_info, interp, 2, ISR1);
-        jit_emit_store<_N>(jit_info, interp, 1, ISR1);
-    }
-}
-
-Parrot_set_i_i {
-    Parrot_set_x_x s/<_N>/_i/
-}
-
-Parrot_set_p_p {
-    Parrot_set_x_x s/<_N>/_i/
-}
-
-Parrot_set_s_s {
-    Parrot_set_x_x s/<_N>/_i/
-}
-
-Parrot_set_n_n {
-    Parrot_set_x_x s/<_N>/_n/ s/ISR/FSR/
-}
-
-Parrot_set_i_ic {
-    Parrot_set_x_x s/<_N>/_i/
-}
-
-Parrot_set_n_ic {
-    if(MAP[1]){
-        jit_emit_load_n(jit_info, interp, 2, MAP[1]);
-        emitm_fitod(NATIVECODE, MAP[1], MAP[1]);
-    }
-    else {
-        jit_emit_load_n(jit_info, interp, 2, FSR1);
-        emitm_fitod(NATIVECODE, FSR1, FSR1);
-        jit_emit_store_n(jit_info, interp, 1, FSR1);
-    }
-}
-
-Parrot_set_n_nc {
-    Parrot_set_x_x s/<_N>/_n/ s/ISR/FSR/
-}
-
-Parrot_set_n_i {
-    /* There's no way to move a value directly between integer and floating
-     * point registers so the mapped integer register must be written to memory
-     */
-    if(MAP[2]){
-        jit_emit_store_i(jit_info, interp, 2, MAP[2]);
-    }
-
-    jit_emit_load_n(jit_info, interp, 2, FSR1);
-
-    /* If result register is mapped convert directly into the register */
-    if(MAP[1]){
-    emitm_fitod(NATIVECODE, FSR1, MAP[1]);
-    }
-    else {
-        emitm_fitod(NATIVECODE, FSR1, FSR2);
-        jit_emit_store_n(jit_info, interp, 1, FSR2);
-    }
-}
-
-Parrot_set_i_n {
-    if(MAP[2]){
-        emitm_fdtoi(NATIVECODE, MAP[2], FSR2);
-    }
-    else {
-        jit_emit_load_n(jit_info, interp, 2, FSR1);
-        emitm_fdtoi(NATIVECODE, FSR1, FSR2);
-    }
-
-    jit_emit_store_n(jit_info, interp, 1, FSR2);
-
-    /* No float reg to integer reg move instruction available */
-    if(MAP[1]){
-        jit_emit_load_i(jit_info, interp, 1, MAP[1]);
-    }
-}
-
-Parrot_set_i_nc {
-    if(MAP[2]){
-        emitm_fdtoi(NATIVECODE, MAP[2], FSR1);
-    }
-    else {
-        jit_emit_load_n(jit_info, interp, 2, FSR2);
-        emitm_fdtoi(NATIVECODE, FSR2, FSR1);
-    }
-
-    jit_emit_store_n(jit_info, interp, 1, FSR1);
-
-    if(MAP[1]){
-        jit_emit_load_i(jit_info, interp, 1, MAP[1]);
-    }
-}
-
-TEMPLATE Parrot_binop_x_x {
-    int arg1, arg2;
-
-    if (MAP[1]) {
-        arg1 = MAP[1];
-    }
-    else {
-        arg1 = ISR1;
-        jit_emit_load<_N>(jit_info, interp, 1, ISR1);
-    }
-
-    if (MAP[2]) {
-        arg2 = MAP[2];
-    }
-    else {
-        arg2 = ISR2;
-        jit_emit_load<_N>(jit_info, interp, 2, arg2);
-    }
-
-    emitm_<op>(NATIVECODE, arg1, arg2, arg1);
-
-    if(!MAP[1]){
-        jit_emit_store<_N>(jit_info, interp, 1, arg1);
-    }
-}
-
-Parrot_add_i_i {
-    Parrot_binop_x_x s/<op>/add_r/ s/<_N>/_i/
-}
-
-Parrot_sub_i_i {
-    Parrot_binop_x_x s/<op>/sub_r/ s/<_N>/_i/
-}
-
-Parrot_bor_i_i {
-    Parrot_binop_x_x s/<op>/or_r/ s/<_N>/_i/
-}
-
-Parrot_bxor_i_i {
-    Parrot_binop_x_x s/<op>/xor_r/ s/<_N>/_i/
-}
-
-Parrot_band_i_i {
-    Parrot_binop_x_x s/<op>/and_r/ s/<_N>/_i/
-}
-
-Parrot_add_n_n {
-    Parrot_binop_x_x s/<op>/faddd/ s/<_N>/_n/
-}
-
-Parrot_sub_n_n {
-    Parrot_binop_x_x s/<op>/fsubd/ s/<_N>/_n/
-}
-
-Parrot_mul_n_n {
-    Parrot_binop_x_x s/<op>/fmuld/ s/<_N>/_n/
-}
-
-Parrot_div_n_n {
-    Parrot_binop_x_x s/<op>/fdivd/ s/<_N>/_n/
-}
-
-TEMPLATE Parrot_incdec_i {
-    int arg1;
-
-    if(MAP[1]){
-        arg1 = MAP[1];
-    }
-    else {
-        arg1 = ISR1;
-        jit_emit_load_i(jit_info, interp, 1, arg1);
-    }
-
-    emitm_<op>_i(NATIVECODE, arg1, 1, arg1);
-
-    if(!MAP[1]){
-        jit_emit_store_i(jit_info, interp, 1, arg1);
-    }
-}
-
-Parrot_inc_i {
-    Parrot_incdec_i s/<op>/add/
-}
-
-Parrot_dec_i {
-    Parrot_incdec_i s/<op>/sub/
-}
-
-TEMPLATE Parrot_binop_i_xc {
-    int arg1;
-
-    if(MAP[1]){
-        arg1 = MAP[1];
-    }
-    else {
-        arg1 = ISR1;
-        jit_emit_load_i(jit_info, interp, 1, arg1);
-    }
-
-    if(emitm_simm13_const(*INT_CONST[2])){
-        emitm_<op>_i(NATIVECODE, arg1, *INT_CONST[2], arg1);
-    }
-    else {
-        jit_emit_load_i(jit_info, interp, 2, ISR1);
-        emitm_<op>_r(NATIVECODE, arg1, ISR1, arg1);
-    }
-
-    if(!MAP[1]){
-        jit_emit_store_i(jit_info, interp, 1, arg1);
-    }
-}
-
-Parrot_add_i_ic {
-    Parrot_binop_i_xc s/<op>/add/
-}
-
-Parrot_sub_i_ic {
-    Parrot_binop_i_xc s/<op>/sub/
-}
-
-Parrot_bor_i_ic {
-    Parrot_binop_i_xc s/<op>/or/
-}
-
-Parrot_band_i_ic {
-    Parrot_binop_i_xc s/<op>/and/
-}
-
-Parrot_bxor_i_ic {
-    Parrot_binop_i_xc s/<op>/xor/
-}
-
-Parrot_add_n_nc {
-    Parrot_binop_x_x s/<op>/faddd/ s/ISR/FSR/ s/<_N>/_n/
-}
-
-Parrot_sub_n_nc {
-    Parrot_binop_x_x s/<op>/fsubd/ s/ISR/FSR/ s/<_N>/_n/
-}
-
-Parrot_mul_n_nc {
-    Parrot_binop_x_x s/<op>/fmuld/ s/ISR/FSR/ s/<_N>/_n/
-}
-
-Parrot_div_n_nc {
-    Parrot_binop_x_x s/<op>/fdivd/ s/ISR/FSR/ s/<_N>/_n/
-}
-
-TEMPLATE Parrot_binop_x_x_x {
-    int arg2, arg3;
-
-    /* Generate load if needed */
-    if(MAP[2]){
-        arg2 = MAP[2];
-    }
-    else {
-        arg2 = ISR1;
-        jit_emit_load<_N>(jit_info, interp, 2, arg2);
-    }
-
-    /* Generate load if needed */
-    if (MAP[3]) {
-        arg3 = MAP[3];
-    }
-    else {
-        arg3 = ISR2;
-        jit_emit_load<_N>(jit_info, interp, 3, arg3);
-    }
-
-    /* Destination is a register */
-    if (MAP[1]) {
-        emitm_<op>(NATIVECODE, arg2, arg3, MAP[1]);
-    }
-    /* Destination is memory */
-    else {
-        emitm_<op>(NATIVECODE, arg2, arg3, ISR1);
-        jit_emit_store<_N>(jit_info, interp, 1, ISR1);
-    }
-}
-
-Parrot_add_i_ic_ic {
-    Parrot_binop_x_x_x s/<op>/add_r/ s/<_N>/_i/
-}
-
-Parrot_sub_i_ic_ic {
-    Parrot_binop_x_x_x s/<op>/sub_r/ s/<_N>/_i/
-}
-
-Parrot_band_i_ic_ic {
-    Parrot_binop_x_x_x s/<op>/and_r/ s/<_N>/_i/
-}
-
-Parrot_bor_i_ic_ic {
-    Parrot_binop_x_x_x s/<op>/or_r/ s/<_N>/_i/
-}
-
-Parrot_bxor_i_ic_ic {
-    Parrot_binop_x_x_x s/<op>/xor_r/ s/<_N>/_i/
-}
-
-Parrot_shl_i_ic_ic {
-    Parrot_binop_x_x_x s/<op>/sll_r/ s/<_N>/_i/
-}
-
-Parrot_shr_i_ic_ic {
-    Parrot_binop_x_x_x s/<op>/sra_r/ s/<_N>/_i/
-}
-
-Parrot_lsr_i_ic_ic {
-    Parrot_binop_x_x_x s/<op>/srl_r/ s/<_N>/_i/
-}
-
-Parrot_add_n_nc_nc {
-    Parrot_binop_x_x_x s/<op>/faddd/ s/<_N>/_n/ s/ISR/FSR/
-}
-
-Parrot_sub_n_nc_nc {
-    Parrot_binop_x_x_x s/<op>/fsubd/ s/<_N>/_n/ s/ISR/FSR/
-}
-
-Parrot_mul_n_nc_nc {
-    Parrot_binop_x_x_x s/<op>/fmuld/ s/<_N>/_n/ s/ISR/FSR/
-}
-
-Parrot_div_n_nc_nc {
-    Parrot_binop_x_x_x s/<op>/fdivd/ s/<_N>/_n/ s/ISR/FSR/
-}
-
-Parrot_add_i_i_ic {
-    Parrot_binop_x_x_x s/<op>/add_r/ s/<_N>/_i/
-}
-
-Parrot_sub_i_i_ic {
-    Parrot_binop_x_x_x s/<op>/sub_r/ s/<_N>/_i/
-}
-
-Parrot_bor_i_i_ic {
-    Parrot_binop_x_x_x s/<op>/or_r/ s/<_N>/_i/
-}
-
-Parrot_bxor_i_i_ic {
-    Parrot_binop_x_x_x s/<op>/xor_r/ s/<_N>/_i/
-}
-
-Parrot_band_i_i_ic {
-    Parrot_binop_x_x_x s/<op>/and_r/ s/<_N>/_i/
-}
-
-Parrot_add_n_n_nc {
-    Parrot_binop_x_x_x s/<op>/faddd/ s/<_N>/_n/
-}
-
-Parrot_sub_n_n_nc {
-    Parrot_binop_x_x_x s/<op>/fsubd/ s/<_N>/_n/
-}
-
-Parrot_mul_n_n_nc {
-    Parrot_binop_x_x_x s/<op>/fmuld/ s/<_N>/_n/
-}
-
-Parrot_div_n_n_nc {
-    Parrot_binop_x_x_x s/<op>/fdivd/ s/<_N>/_n/
-}
-
-Parrot_add_i_ic_i {
-    Parrot_binop_x_x_x s/<op>/add_r/ s/<_N>/_i/
-}
-
-Parrot_sub_i_ic_i {
-    Parrot_binop_x_x_x s/<op>/sub_r/ s/<_N>/_i/
-}
-
-Parrot_bor_i_ic_i {
-    Parrot_binop_x_x_x s/<op>/or_r/ s/<_N>/_i/
-}
-
-Parrot_bxor_i_ic_i {
-    Parrot_binop_x_x_x s/<op>/xor_r/ s/<_N>/_i/
-}
-
-Parrot_band_i_ic_i {
-    Parrot_binop_x_x_x s/<op>/and_r/ s/<_N>/_i/
-}
-
-Parrot_shl_i_ic_i {
-    Parrot_binop_x_x_x s/<op>/sll_r/ s/<_N>/_i/
-}
-
-Parrot_shr_i_ic_i {
-    Parrot_binop_x_x_x s/<op>/sra_r/ s/<_N>/_i/
-}
-
-Parrot_lsr_i_ic_i {
-    Parrot_binop_x_x_x s/<op>/srl_r/ s/<_N>/_i/
-}
-
-Parrot_add_n_nc_n {
-    Parrot_binop_x_x_x s/<op>/faddd/ s/<_N>/_n/
-}
-
-Parrot_sub_n_nc_n {
-    Parrot_binop_x_x_x s/<op>/fsubd/ s/<_N>/_n/
-}
-
-Parrot_mul_n_nc_n {
-    Parrot_binop_x_x_x s/<op>/fmuld/ s/<_N>/_n/
-}
-
-Parrot_div_n_nc_n {
-    Parrot_binop_x_x_x s/<op>/fdivd/ s/<_N>/_n/
-}
-
-Parrot_add_i_i_i {
-    Parrot_binop_x_x_x s/<op>/add_r/ s/<_N>/_i/
-}
-
-Parrot_sub_i_i_i {
-    Parrot_binop_x_x_x s/<op>/sub_r/ s/<_N>/_i/
-}
-
-Parrot_bor_i_i_i {
-    Parrot_binop_x_x_x s/<op>/or_r/ s/<_N>/_i/
-}
-
-Parrot_bxor_i_i_i {
-    Parrot_binop_x_x_x s/<op>/xor_r/ s/<_N>/_i/
-}
-
-Parrot_band_i_i_i {
-    Parrot_binop_x_x_x s/<op>/and_r/ s/<_N>/_i/
-}
-
-Parrot_shl_i_i_i {
-    Parrot_binop_x_x_x s/<op>/sll_r/ s/<_N>/_i/
-}
-
-Parrot_shr_i_i_i {
-    Parrot_binop_x_x_x s/<op>/sra_r/ s/<_N>/_i/
-}
-
-Parrot_lsr_i_i_i {
-    Parrot_binop_x_x_x s/<op>/srl_r/ s/<_N>/_i/
-}
-
-Parrot_sub_n_n_n {
-    Parrot_binop_x_x_x s/<op>/fsubd/ s/<_N>/_n/ s/ISR/FSR/
-}
-
-Parrot_add_n_n_n {
-    Parrot_binop_x_x_x s/<op>/faddd/ s/<_N>/_n/ s/ISR/FSR/
-}
-
-Parrot_mul_n_n_n {
-    Parrot_binop_x_x_x s/<op>/fmuld/ s/<_N>/_n/ s/ISR/FSR/
-}
-
-Parrot_div_n_n_n {
-    Parrot_binop_x_x_x s/<op>/fdivd/ s/<_N>/_n/ s/ISR/FSR/
-}
-
-;
-;Parrot_neg_n {
-;    if(MAP[1]){
-;        emitm_fnegs(NATIVECODE, MAP[1], MAP[1]);
-;    }
-;    else {
-;        jit_emit_load_n(jit_info, interp, 1, FSR1);
-;        emitm_fnegs(NATIVECODE, FSR1, FSR1);
-;        jit_emit_store_n(jit_info, interp, 1, FSR1);
-;    }
-;}
-
-TEMPLATE Parrot_unop_x_x {
-    if(MAP[1] && MAP[2]){
-        emitm_<op>(NATIVECODE, MAP[2], MAP[1]);
-    }
-    else if(MAP[1]){
-        jit_emit_load<_N>(jit_info, interp, 2, MAP[1]);
-        emitm_<op>(NATIVECODE, MAP[1], MAP[1]);
-    }
-    else {
-        jit_emit_load<_N>(jit_info, interp, 2, ISR1);
-        emitm_<op>(NATIVECODE, ISR1, ISR1);
-        jit_emit_store<_N>(jit_info, interp, 1, ISR1);
-    }
-}
-
-TEMPLATE Parrot_unop_x_nc {
-    if(MAP[1] && MAP[2]){
-        emitm_<op>(NATIVECODE, MAP[2], MAP[1]);
-    }
-    else if(MAP[1]){
-        jit_emit_load<_N>(jit_info, interp, 2, MAP[1]);
-        emitm_<op>(NATIVECODE, MAP[1], MAP[1]);
-    }
-    else {
-        jit_emit_load<_N>(jit_info, interp, 2, ISR1);
-        emitm_<op>(NATIVECODE, ISR1, ISR1);
-        jit_emit_store<_N>(jit_info, interp, 1, ISR1);
-    }
-}
-
-;Parrot_neg_n_nc {
-;    Parrot_unop_x_x s/<op>/fnegs/ s/<_N>/_n/ s/ISR/FSR/
-;}
-
-;Parrot_neg_n_n {
-;    Parrot_unop_x_x s/<op>/fnegs/ s/<_N>/_n/ s/ISR/FSR/
-;}
-
-TEMPLATE Parrot_abs_nx_nx {
-    if(MAP[1] && MAP[2]){
-        emitm_fabss(NATIVECODE, MAP[2], MAP[1]);
-        emitm_fmovs(NATIVECODE, MAP[2] + 1, MAP[1] + 1);
-    }
-    else if(MAP[1]){
-        jit_emit_load_n(jit_info, interp, 2, MAP[1]);
-        emitm_fabss(NATIVECODE, MAP[1], MAP[1]);
-    }
-    else {
-        jit_emit_load_n(jit_info, interp, 2, FSR1);
-        emitm_fabss(NATIVECODE, FSR1, FSR1);
-        jit_emit_store_n(jit_info, interp, 1, FSR1);
-    }
-}
-
-Parrot_abs_n_n {
-    Parrot_abs_nx_nx
-}
-
-Parrot_abs_n_nc {
-    Parrot_abs_nx_nx
-}
-
-TEMPLATE Parrot_sqrt_nx_nx {
-    if(MAP[1] && MAP[2]){
-        emitm_fsqrtd(NATIVECODE, MAP[2], MAP[1]);
-    }
-    else if(MAP[1]){
-        jit_emit_load_n(jit_info, interp, 2, MAP[1]);
-        emitm_fsqrtd(NATIVECODE, MAP[1], MAP[1]);
-    }
-    else {
-        jit_emit_load_n(jit_info, interp, 2, FSR1);
-        emitm_fsqrtd(NATIVECODE, FSR1, FSR1);
-        jit_emit_store_n(jit_info, interp, 1, FSR1);
-    }
-}
-
-Parrot_sqrt_n_n {
-    Parrot_sqrt_nx_nx
-}
-
-Parrot_sqrt_n_nc {
-    Parrot_sqrt_nx_nx
-}
-
-
-TEMPLATE Parrot_if_ix_x {
-    if(MAP[1]){
-        emitm_subcc_r(NATIVECODE, MAP[1], emitm_g(0), emitm_g(0));
-    }
-    else {
-        jit_emit_load_i(jit_info, interp, 1, ISR1);
-        emitm_subcc_r(NATIVECODE, ISR1, emitm_g(0), emitm_g(0));
-    }
-
-    Parrot_jit_bicc(jit_info, emitm_<a>, 0, *INT_CONST[2]);
-    emitm_nop(NATIVECODE);
-}
-
-Parrot_if_ic_ic {
-    Parrot_if_ix_x s/<a>/bne/
-}
-
-Parrot_if_i_ic {
-    Parrot_if_ix_x s/<a>/bne/
-}
-
-Parrot_unless_i_ic {
-    Parrot_if_ix_x  s/<a>/be/
-}
-
-Parrot_branch_ic {
-    Parrot_jit_bicc(jit_info, emitm_ba, 0, *INT_CONST[1]);
-    emitm_nop(NATIVECODE);
-}
-
-TEMPLATE Parrot_cmp_x_x_ic {
-    if(MAP[1] && MAP[2]){
-        emitm_<op>(NATIVECODE, MAP[1], MAP[2] <nill>);
-    }
-    else if (MAP[1]) {
-        jit_emit_load<_N>(jit_info, interp, 2, ISR2);
-        emitm_<op>(NATIVECODE, MAP[1], ISR2 <nill>);
-    }
-    else if (MAP[2]) {
-        jit_emit_load<_N>(jit_info, interp, 1, ISR1);
-        emitm_<op>(NATIVECODE, ISR1, MAP[2] <nill>);
-    }
-    else {
-        jit_emit_load<_N>(jit_info, interp, 1, ISR1);
-        jit_emit_load<_N>(jit_info, interp, 2, ISR2);
-        emitm_<op>(NATIVECODE, ISR1, ISR2 <nill>);
-    }
-
-    Parrot_jit_<branch>(jit_info, emitm_<a>, 0, *INT_CONST[3]);
-    emitm_nop(NATIVECODE);
-}
-
-Parrot_eq_ic_ic_ic {
-    Parrot_cmp_x_x_ic  s/<a>/be/ s/<op>/subcc_r/ s/<branch>/bicc/ s/<_N>/_i/ s/<nill>/, emitm_g(0)/
-}
-
-Parrot_eq_i_ic_ic {
-    Parrot_cmp_x_x_ic  s/<a>/be/ s/<op>/subcc_r/ s/<branch>/bicc/ s/<_N>/_i/ s/<nill>/, emitm_g(0)/
-}
-
-Parrot_eq_ic_i_ic {
-    Parrot_cmp_x_x_ic  s/<a>/be/ s/<op>/subcc_r/ s/<branch>/bicc/ s/<_N>/_i/ s/<nill>/, emitm_g(0)/
-}
-
-Parrot_eq_i_i_ic {
-    Parrot_cmp_x_x_ic  s/<a>/be/ s/<op>/subcc_r/ s/<branch>/bicc/ s/<_N>/_i/ s/<nill>/, emitm_g(0)/
-}
-
-Parrot_ne_ic_ic_ic {
-    Parrot_cmp_x_x_ic  s/<a>/bne/ s/<op>/subcc_r/ s/<branch>/bicc/ s/<_N>/_i/ s/<nill>/, emitm_g(0)/
-}
-
-Parrot_ne_i_ic_ic {
-    Parrot_cmp_x_x_ic  s/<a>/bne/ s/<op>/subcc_r/ s/<branch>/bicc/ s/<_N>/_i/ s/<nill>/, emitm_g(0)/
-}
-
-Parrot_ne_ic_i_ic {
-    Parrot_cmp_x_x_ic  s/<a>/bne/ s/<op>/subcc_r/ s/<branch>/bicc/ s/<_N>/_i/ s/<nill>/, emitm_g(0)/
-}
-
-Parrot_ne_i_i_ic {
-    Parrot_cmp_x_x_ic  s/<a>/bne/ s/<op>/subcc_r/ s/<branch>/bicc/ s/<_N>/_i/ s/<nill>/, emitm_g(0)/
-}
-
-Parrot_lt_ic_ic_ic {
-    Parrot_cmp_x_x_ic  s/<a>/bl/ s/<op>/subcc_r/ s/<branch>/bicc/ s/<_N>/_i/ s/<nill>/, emitm_g(0)/
-}
-
-Parrot_lt_i_ic_ic {
-    Parrot_cmp_x_x_ic  s/<a>/bl/ s/<op>/subcc_r/ s/<branch>/bicc/ s/<_N>/_i/ s/<nill>/, emitm_g(0)/
-}
-
-Parrot_lt_ic_i_ic {
-    Parrot_cmp_x_x_ic  s/<a>/bl/ s/<op>/subcc_r/ s/<branch>/bicc/ s/<_N>/_i/ s/<nill>/, emitm_g(0)/
-}
-
-Parrot_lt_i_i_ic {
-    Parrot_cmp_x_x_ic  s/<a>/bl/ s/<op>/subcc_r/ s/<branch>/bicc/ s/<_N>/_i/ s/<nill>/, emitm_g(0)/
-}
-
-Parrot_le_ic_ic_ic {
-    Parrot_cmp_x_x_ic  s/<a>/ble/ s/<op>/subcc_r/ s/<branch>/bicc/ s/<_N>/_i/ s/<nill>/, emitm_g(0)/
-}
-
-Parrot_le_i_ic_ic {
-    Parrot_cmp_x_x_ic  s/<a>/ble/ s/<op>/subcc_r/ s/<branch>/bicc/ s/<_N>/_i/ s/<nill>/, emitm_g(0)/
-}
-
-Parrot_le_ic_i_ic {
-    Parrot_cmp_x_x_ic  s/<a>/ble/ s/<op>/subcc_r/ s/<branch>/bicc/ s/<_N>/_i/ s/<nill>/, emitm_g(0)/
-}
-
-Parrot_le_i_i_ic {
-    Parrot_cmp_x_x_ic  s/<a>/ble/ s/<op>/subcc_r/ s/<branch>/bicc/ s/<_N>/_i/ s/<nill>/, emitm_g(0)/
-}
-
-Parrot_gt_ic_ic_ic {
-    Parrot_cmp_x_x_ic  s/<a>/bg/ s/<op>/subcc_r/ s/<branch>/bicc/ s/<_N>/_i/ s/<nill>/, emitm_g(0)/
-}
-
-Parrot_gt_i_ic_ic {
-    Parrot_cmp_x_x_ic  s/<a>/bg/ s/<op>/subcc_r/ s/<branch>/bicc/ s/<_N>/_i/ s/<nill>/, emitm_g(0)/
-}
-
-Parrot_gt_ic_i_ic {
-    Parrot_cmp_x_x_ic  s/<a>/bg/ s/<op>/subcc_r/ s/<branch>/bicc/ s/<_N>/_i/ s/<nill>/, emitm_g(0)/
-}
-
-Parrot_gt_i_i_ic {
-    Parrot_cmp_x_x_ic  s/<a>/bg/ s/<op>/subcc_r/ s/<branch>/bicc/ s/<_N>/_i/ s/<nill>/, emitm_g(0)/
-}
-
-Parrot_ge_ic_ic_ic {
-    Parrot_cmp_x_x_ic  s/<a>/bge/ s/<op>/subcc_r/ s/<branch>/bicc/ s/<_N>/_i/ s/<nill>/, emitm_g(0)/
-}
-
-Parrot_ge_i_ic_ic {
-    Parrot_cmp_x_x_ic  s/<a>/bge/ s/<op>/subcc_r/ s/<branch>/bicc/ s/<_N>/_i/ s/<nill>/, emitm_g(0)/
-}
-
-Parrot_ge_ic_i_ic {
-    Parrot_cmp_x_x_ic  s/<a>/bge/ s/<op>/subcc_r/ s/<branch>/bicc/ s/<_N>/_i/ s/<nill>/, emitm_g(0)/
-}
-
-Parrot_ge_i_i_ic {
-    Parrot_cmp_x_x_ic  s/<a>/bge/ s/<op>/subcc_r/ s/<branch>/bicc/ s/<_N>/_i/ s/<nill>/, emitm_g(0)/
-}
-
-Parrot_eq_n_n_ic {
-    Parrot_cmp_x_x_ic  s/<a>/fbe/ s/<op>/fcmpd/ s/<branch>/fbfcc/ s/<_N>/_n/ s/ISR/FSR/ s/<nill>//
-}
-
-Parrot_eq_nc_n_ic {
-    Parrot_cmp_x_x_ic  s/<a>/fbe/ s/<op>/fcmpd/ s/<branch>/fbfcc/ s/<_N>/_n/ s/ISR/FSR/ s/<nill>//
-}
-
-Parrot_eq_n_nc_ic {
-    Parrot_cmp_x_x_ic  s/<a>/fbe/ s/<op>/fcmpd/ s/<branch>/fbfcc/ s/<_N>/_n/ s/ISR/FSR/ s/<nill>//
-}
-
-Parrot_eq_nc_nc_ic {
-    Parrot_cmp_x_x_ic  s/<a>/fbe/ s/<op>/fcmpd/ s/<branch>/fbfcc/ s/<_N>/_n/ s/ISR/FSR/ s/<nill>//
-}
-
-Parrot_ne_n_n_ic {
-    Parrot_cmp_x_x_ic  s/<a>/fbne/ s/<op>/fcmpd/ s/<branch>/fbfcc/ s/<_N>/_n/ s/ISR/FSR/ s/<nill>//
-}
-
-Parrot_ne_nc_n_ic {
-    Parrot_cmp_x_x_ic  s/<a>/fbne/ s/<op>/fcmpd/ s/<branch>/fbfcc/ s/<_N>/_n/ s/ISR/FSR/ s/<nill>//
-}
-
-Parrot_ne_n_nc_ic {
-    Parrot_cmp_x_x_ic  s/<a>/fbne/ s/<op>/fcmpd/ s/<branch>/fbfcc/ s/<_N>/_n/ s/ISR/FSR/ s/<nill>//
-}
-
-Parrot_ne_nc_nc_ic {
-    Parrot_cmp_x_x_ic  s/<a>/fbne/ s/<op>/fcmpd/ s/<branch>/fbfcc/ s/<_N>/_n/ s/ISR/FSR/ s/<nill>//
-}
-
-Parrot_lt_n_n_ic {
-    Parrot_cmp_x_x_ic  s/<a>/fbl/ s/<op>/fcmpd/ s/<branch>/fbfcc/ s/<_N>/_n/ s/ISR/FSR/ s/<nill>//
-}
-
-Parrot_lt_nc_n_ic {
-    Parrot_cmp_x_x_ic  s/<a>/fbl/ s/<op>/fcmpd/ s/<branch>/fbfcc/ s/<_N>/_n/ s/ISR/FSR/ s/<nill>//
-}
-
-Parrot_lt_n_nc_ic {
-    Parrot_cmp_x_x_ic  s/<a>/fbl/ s/<op>/fcmpd/ s/<branch>/fbfcc/ s/<_N>/_n/ s/ISR/FSR/ s/<nill>//
-}
-
-Parrot_lt_nc_nc_ic {
-    Parrot_cmp_x_x_ic  s/<a>/fbl/ s/<op>/fcmpd/ s/<branch>/fbfcc/ s/<_N>/_n/ s/ISR/FSR/ s/<nill>//
-}
-
-Parrot_le_n_n_ic {
-    Parrot_cmp_x_x_ic  s/<a>/fble/ s/<op>/fcmpd/ s/<branch>/fbfcc/ s/<_N>/_n/ s/ISR/FSR/ s/<nill>//
-}
-
-Parrot_le_nc_n_ic {
-    Parrot_cmp_x_x_ic  s/<a>/fble/ s/<op>/fcmpd/ s/<branch>/fbfcc/ s/<_N>/_n/ s/ISR/FSR/ s/<nill>//
-}
-
-Parrot_le_n_nc_ic {
-    Parrot_cmp_x_x_ic  s/<a>/fble/ s/<op>/fcmpd/ s/<branch>/fbfcc/ s/<_N>/_n/ s/ISR/FSR/ s/<nill>//
-}
-
-Parrot_le_nc_nc_ic {
-    Parrot_cmp_x_x_ic  s/<a>/fble/ s/<op>/fcmpd/ s/<branch>/fbfcc/ s/<_N>/_n/ s/ISR/FSR/ s/<nill>//
-}
-
-Parrot_gt_n_n_ic {
-    Parrot_cmp_x_x_ic  s/<a>/fbg/ s/<op>/fcmpd/ s/<branch>/fbfcc/ s/<_N>/_n/ s/ISR/FSR/ s/<nill>//
-}
-
-Parrot_gt_nc_n_ic {
-    Parrot_cmp_x_x_ic  s/<a>/fbg/ s/<op>/fcmpd/ s/<branch>/fbfcc/ s/<_N>/_n/ s/ISR/FSR/ s/<nill>//
-}
-
-Parrot_gt_n_nc_ic {
-    Parrot_cmp_x_x_ic  s/<a>/fbg/ s/<op>/fcmpd/ s/<branch>/fbfcc/ s/<_N>/_n/ s/ISR/FSR/ s/<nill>//
-}
-
-Parrot_gt_nc_nc_ic {
-    Parrot_cmp_x_x_ic  s/<a>/fbg/ s/<op>/fcmpd/ s/<branch>/fbfcc/ s/<_N>/_n/ s/ISR/FSR/ s/<nill>//
-}
-
-Parrot_ge_n_n_ic {
-    Parrot_cmp_x_x_ic  s/<a>/fbge/ s/<op>/fcmpd/ s/<branch>/fbfcc/ s/<_N>/_n/ s/ISR/FSR/ s/<nill>//
-}
-
-Parrot_ge_nc_n_ic {
-    Parrot_cmp_x_x_ic  s/<a>/fbge/ s/<op>/fcmpd/ s/<branch>/fbfcc/ s/<_N>/_n/ s/ISR/FSR/ s/<nill>//
-}
-
-Parrot_ge_n_nc_ic {
-    Parrot_cmp_x_x_ic  s/<a>/fbge/ s/<op>/fcmpd/ s/<branch>/fbfcc/ s/<_N>/_n/ s/ISR/FSR/ s/<nill>//
-}
-
-Parrot_ge_nc_nc_ic {
-    Parrot_cmp_x_x_ic  s/<a>/fbge/ s/<op>/fcmpd/ s/<branch>/fbfcc/ s/<_N>/_n/ s/ISR/FSR/ s/<nill>//
-}
-
-TEMPLATE Parrot_iscmp_ix_ix_ix {
-    if(MAP[2] && MAP[3]){
-        emitm_subcc_r(NATIVECODE, MAP[2], MAP[3], emitm_g(0));
-    }
-    else if (MAP[2]) {
-        jit_emit_load_i(jit_info, interp, 3, ISR2);
-        emitm_subcc_r(NATIVECODE, MAP[2], ISR2, emitm_g(0));
-    }
-    else if (MAP[3]) {
-        jit_emit_load_i(jit_info, interp, 2, ISR1);
-        emitm_subcc_r(NATIVECODE, ISR1, MAP[3], emitm_g(0));
-    }
-    else {
-        jit_emit_load_i(jit_info, interp, 2, ISR1);
-        jit_emit_load_i(jit_info, interp, 3, ISR2);
-        emitm_subcc_r(NATIVECODE, ISR1, ISR2, emitm_g(0));
-    }
-
-    emitm_bicc(NATIVECODE, 1, emitm_<a>, 3);
-
-    if(MAP[1]){
-        emitm_mov_i(NATIVECODE, 1, MAP[1]);
-        emitm_or_r(NATIVECODE, emitm_g(0), emitm_g(0), MAP[1]);
-    } else {
-        jit_emit_store_i(jit_info, interp, 1, 1);
-        jit_emit_store_i(jit_info, interp, 1, 0);
-    }
-}
-
-Parrot_isgt_i_i_i {
-    Parrot_iscmp_ix_ix_ix  s/<a>/bg/
-}
-
-Parrot_isgt_i_ic_i {
-    Parrot_iscmp_ix_ix_ix  s/<a>/bg/
-}
-
-Parrot_isgt_i_i_ic {
-    Parrot_iscmp_ix_ix_ix  s/<a>/bg/
-}
-
-Parrot_isgt_i_ic_ic {
-    Parrot_iscmp_ix_ix_ix  s/<a>/bg/
-}
-
-Parrot_isge_i_i_i {
-    Parrot_iscmp_ix_ix_ix  s/<a>/bge/
-}
-
-Parrot_isge_i_ic_i {
-    Parrot_iscmp_ix_ix_ix  s/<a>/bge/
-}
-
-Parrot_isge_i_i_ic {
-    Parrot_iscmp_ix_ix_ix  s/<a>/bge/
-}
-
-Parrot_isge_i_ic_ic {
-    Parrot_iscmp_ix_ix_ix  s/<a>/bge/
-}
-
-Parrot_isle_i_i_i {
-    Parrot_iscmp_ix_ix_ix  s/<a>/ble/
-}
-
-Parrot_isle_i_ic_i {
-    Parrot_iscmp_ix_ix_ix  s/<a>/ble/
-}
-
-Parrot_isle_i_i_ic {
-    Parrot_iscmp_ix_ix_ix  s/<a>/ble/
-}
-
-Parrot_isle_i_ic_ic {
-    Parrot_iscmp_ix_ix_ix  s/<a>/ble/
-}
-
-Parrot_islt_i_i_i {
-    Parrot_iscmp_ix_ix_ix  s/<a>/bl/
-}
-
-Parrot_islt_i_ic_i {
-    Parrot_iscmp_ix_ix_ix  s/<a>/bl/
-}
-
-Parrot_islt_i_i_ic {
-    Parrot_iscmp_ix_ix_ix  s/<a>/bl/
-}
-
-Parrot_islt_i_ic_ic {
-    Parrot_iscmp_ix_ix_ix  s/<a>/bl/
-}
-
-Parrot_iseq_i_i_i {
-    Parrot_iscmp_ix_ix_ix  s/<a>/be/
-}
-
-Parrot_iseq_i_ic_i {
-    Parrot_iscmp_ix_ix_ix  s/<a>/be/
-}
-
-Parrot_iseq_i_i_ic {
-    Parrot_iscmp_ix_ix_ix  s/<a>/be/
-}
-
-Parrot_iseq_i_ic_ic {
-    Parrot_iscmp_ix_ix_ix  s/<a>/be/
-}
-
-Parrot_isne_i_i_i {
-    Parrot_iscmp_ix_ix_ix  s/<a>/bne/
-}
-
-Parrot_isne_i_ic_i {
-    Parrot_iscmp_ix_ix_ix  s/<a>/bne/
-}
-
-Parrot_isne_i_i_ic {
-    Parrot_iscmp_ix_ix_ix  s/<a>/bne/
-}
-
-Parrot_isne_i_ic_ic {
-    Parrot_iscmp_ix_ix_ix  s/<a>/bne/
-}
-
-/*
- * Local variables:
- * c-indentation-style: bsd
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- *
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/sun4/jit_defs.c
==============================================================================
--- branches/orderedhash_revamp/src/jit/sun4/jit_defs.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,13 +0,0 @@
-/* Stub file for RT#38929 fixes */
-/*
-Copyright (C) 2008, Parrot Foundation.
-$Id$
-*/
-/* HEADERIZER HFILE: none */
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit/sun4/jit_emit.h
==============================================================================
--- branches/orderedhash_revamp/src/jit/sun4/jit_emit.h	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,1196 +0,0 @@
-/*
- * Copyright (C) 2002-2009, Parrot Foundation.
- */
-
-/*
-** jit_emit.h
-**
-** SPARC
-**
-** $Id$
-**/
-
-#ifndef PARROT_SUN4_JIT_EMIT_H_GUARD
-#define PARROT_SUN4_JIT_EMIT_H_GUARD
-
-/* XXX As of rev 11423, sun4 jit no longer compiles due to the missing
-   Parrot_jit_init() function and the corresponding arch_info structure.
-   Prior to that, it compiled, but probably didn't work.  See notes labeled
-   XXX Hack [perl #37819]  below.
-*/
-
-/*
- * SPARC JIT overview:
- *
- * The interpreter pointer is kept in i0.
- * The address of register I0 is stored in i1, with all parrot register access
- * performed relative to this register.
- * The address of the opcode - native code mapping array is kept in i3.
- *
- * See IMPORTANT SHORTCUTS below.
- */
-
-/* Sparc register numbers */
-#define emitm_g(n) (n)
-#define emitm_o(n) ((n) + 8)
-#define emitm_l(n) ((n) + 16)
-#define emitm_i(n) ((n) + 24)
-#define emitm_f(n) (n)
-
-#if JIT_EMIT
-
-#  define emitm_FP emitm_i(6)
-#  define emitm_SP emitm_o(6)
-
-#  define emitm_mask(n, val) ((unsigned)(val) & ((1U << (n)) - 1))
-
-#  define emitm_hi30(val)   ((unsigned)(val) >> 2)
-#  define emitm_hi22(val)   ((unsigned)(val) >> 10)
-#  define emitm_lo10(val)   emitm_mask(10, (val))
-#  define emitm_simm13(val) emitm_mask(13, (val))
-
-#  define emitm_opval(val)  ((unsigned)(val) << 30)
-#  define emitm_op2val(val) ((unsigned)(val) << 22)
-#  define emitm_op3val(val) ((unsigned)(val) << 19)
-#  define emitm_rd(val)     ((unsigned)(val) << 25)
-#  define emitm_rs1(val)    ((unsigned)(val) << 14)
-
-#  define emitm_simm13_max 4095
-#  define emitm_simm13_min -4096
-
-#  define emitm_simm13_const(val) (((val) >= emitm_simm13_min) && ((val) < emitm_simm13_max))
-
-#  define emitm_branch_max 8388607
-#  define emitm_branch_min -8388608
-
-/* format 1 - only instruction */
-#  define emitm_call_30(pc, disp30) { \
-    *(unsigned *)(pc) = emitm_opval(1) | (disp30); \
-    pc += 4; }
-
-/* format 2a - sethi primarily */
-#  define emitm_2a(pc, op, rd, op2, imm22) { \
-    *(unsigned *)(pc) = emitm_opval(op) | emitm_rd(rd) | emitm_op2val(op2) | \
-        (imm22); \
-    pc += 4; }
-
-/* format 2b - branches */
-#  define emitm_2b(pc, a, cond, op2, disp22) { \
-    *(unsigned *)(pc) = emitm_opval(0) | ((unsigned)(a) << 29) | \
-                        ((unsigned)(cond) << 25) | emitm_op2val(op2) | \
-                        emitm_mask(22, disp22); \
-                        pc += 4; }
-
-/* Generic fields of format 3 */
-#  define emitm_fmt3(pc, op, rd, op3, rs1, low14) { \
-    *(unsigned *)pc = emitm_opval(op) |emitm_rd(rd) | emitm_op3val(op3) | \
-        emitm_rs1(rs1) | (low14); \
-    pc +=4 ; }
-
-/* format 3a */
-#  define emitm_3a(pc, op, rd, op3, rs1, asi, rs2) \
-    emitm_fmt3(pc, op, rd, op3, rs1, ((asi) << 5) | (rs2))
-
-/* format 3b */
-#  define emitm_3b(pc, op, rd, op3, rs1, simm13) \
-    emitm_fmt3(pc, op, rd, op3, rs1, (1L << 13) | emitm_mask(13, (simm13)))
-
-/* format 3c */
-#  define emitm_3c(pc, op, rd, op3, rs1, opf, rs2) \
-    emitm_fmt3(pc, op, rd, op3, rs1, (opf << 5) | (rs2))
-
-/* Miscellaneous instructions */
-
-/* sethi imm22, r[rd] */
-#  define emitm_sethi(pc, imm22, rd) emitm_2a((pc), 0, (rd), 04, (imm22))
-
-/* NOP */
-#  define emitm_nop(pc) emitm_sethi((pc), 0, 0)
-
-/* SAVE */
-
-#  define emitm_save_r(pc, rs1, rs2, rd) emitm_3a((pc), 2, (rd), 074, (rs1), 0, (rs2))
-#  define emitm_save_i(pc, rs1, i, rd)   emitm_3b((pc), 2, (rd), 074, (rs1), (i))
-
-/* RESTORE */
-#  define emitm_restore_r(pc, rs1, rs2, rd) emitm_3a((pc), 2, (rd), 075, (rs1), 0, (rd))
-#  define emitm_restore_i(pc, rs1, i, rd)   emitm_3b((pc), 2, (rd), 075, (rs1), (i))
-
-/* MOV */
-#  define emitm_mov_r(pc, rs, rd) emitm_or_r((pc), emitm_g(0), (rs), (rd))
-#  define emitm_mov_i(pc, i, rd)  emitm_or_i((pc), emitm_g(0), (i), (rd))
-
-/* Integer Register Loads */
-
-/* ldX[rs1 + simm13], rd */
-#  define emitm_ldsb_i(pc, rs1, i, rd) emitm_3b((pc), 3, (rd), 011, (rs1), (i))
-#  define emitm_ldub_i(pc, rs1, i, rd) emitm_3b((pc), 3, (rd), 001, (rs1), (i))
-#  define emitm_ldsh_i(pc, rs1, i, rd) emitm_3b((pc), 3, (rd), 012, (rs1), (i))
-#  define emitm_lduh_i(pc, rs1, i, rd) emitm_3b((pc), 3, (rd), 002, (rs1), (i))
-#  define emitm_ld_i(pc, rs1, i, rd)   emitm_3b((pc), 3, (rd), 000, (rs1), (i))
-#  define emitm_ldd_i(pc, rs1, i, rd)  emitm_3b((pc), 3, (rd), 003, (rs1), (i))
-
-/* ldX[rs1 + rs2], rd */
-#  define emitm_ldsb_r(pc, rs1, rs2, rd) emitm_3a((pc), 3, (rd), 011, (rs1), 0, (rs2))
-#  define emitm_ldub_r(pc, rs1, rs2, rd) emitm_3a((pc), 3, (rd), 001, (rs1), 0, (rs2))
-#  define emitm_ldsh_r(pc, rs1, rs2, rd) emitm_3a((pc), 3, (rd), 012, (rs1), 0, (rs2))
-#  define emitm_lduh_r(pc, rs1, rs2, rd) emitm_3a((pc), 3, (rd), 002, (rs1), 0, (rs2))
-#  define emitm_ld_r(pc, rs1, rs2, rd)   emitm_3a((pc), 3, (rd), 000, (rs1), 0, (rs2))
-#  define emitm_ldd_r(pc, rs1, rs2, rd)  emitm_3a((pc), 3, (rd), 003, (rs1), 0, (rs2))
-
-/* Integer Register Stores */
-
-/* stX rd, [rs1 + simm13] */
-#  define emitm_stb_i(pc, rd, rs1, i) emitm_3b((pc), 3, (rd), 005, (rs1), (i))
-#  define emitm_sth_i(pc, rd, rs1, i) emitm_3b((pc), 3, (rd), 006, (rs1), (i))
-#  define emitm_st_i(pc, rd, rs1, i)  emitm_3b((pc), 3, (rd), 004, (rs1), (i))
-#  define emitm_std_i(pc, rd, rs1, i) emitm_3b((pc), 3, (rd), 007, (rs1), (i))
-
-/* stX rd, [rs1 + rs2] */
-#  define emitm_stb_r(pc, rd, rs1, rs2) emitm_3a((pc), 3, (rd), 005, (rs1), 0, (rs2))
-#  define emitm_sth_r(pc, rd, rs1, rs2) emitm_3a((pc), 3, (rd), 006, (rs1), 0, (rs2))
-#  define emitm_st_r(pc, rd, rs1, rs2)  emitm_3a((pc), 3, (rd), 004, (rs1), 0, (rs2))
-#  define emitm_std_r(pc, rd, rs1, rs2) emitm_3a((pc), 3, (rd), 007, (rs1), 0, (rs2))
-
-/* Floating Point Register Loads */
-
-/* ldX[rs1 + simm13], freg[rd] */
-#  define emitm_ldf_i(pc, rs1, i, rd)   emitm_3b((pc), 3, (rd), 040, (rs1), (i))
-#  define emitm_lddf_i(pc, rs1, i, rd)  emitm_3b((pc), 3, (rd), 043, (rs1), (i))
-
-#  define emitm_ldfsr_i(pc, rs1, i, rd) emitm_3b((pc), 3, (rd), 041, (rs1), (i))
-
-/* ldX[rs1 + rs2], freg[rd] */
-#  define emitm_ldf_r(pc, rs1, rs2, rd)   emitm_3a((pc), 3, (rd), 040, (rs1), 0, (rs2))
-#  define emitm_lddf_r(pc, rs1, rs2, rd)  emitm_3a((pc), 3, (rd), 043, (rs1), 0, (rs2))
-
-#  define emitm_ldfsr_r(pc, rs1, rs2, rd) emitm_3a((pc), 3, (rd), 041, (rs1), 0, (rs2))
-
-/* Floating Point Register Stores */
-
-/* stX freg[rd], [rs1 + simm13] */
-#  define emitm_stf_i(pc, rd, rs1, i)   emitm_3b((pc), 3, (rd), 044, (rs1), (i))
-#  define emitm_stdf_i(pc, rd, rs1, i)  emitm_3b((pc), 3, (rd), 047, (rs1), (i))
-
-#  define emitm_stfsr_i(pc, rd, rs1, i) emitm_3b((pc), 3, (rd), 045, (rs1), (i))
-
-/* stX freg[rd], [rs1 + rs2] */
-#  define emitm_stf_r_r(pc, rd, rs1, rs2)   emitm_3a((pc), 3, (rd), 044, (rs1), 0, (rs2))
-#  define emitm_stdf_r_r(pc, rd, rs1, rs2)  emitm_3a((pc), 3, (rd), 047, (rs1), 0, (rs2))
-#  define emitm_stfsr_r_r(pc, rd, rs1, rs2) emitm_3a((pc), 3, (rd), 045, (rs1), 0, (rs2))
-
-/* Logical instructions */
-
-/* op r[rs1], r[rs2], r[rd] */
-#  define emitm_logic_r(pc, op3, rs1, rs2, rd) \
-    emitm_3a((pc), 2, (rd), (op3), (rs1), 0, (rs2))
-
-/* op r[rs1], simm13, r[rd] */
-#  define emitm_logic_i(pc, op3, rs1, simm13, rd) \
-    emitm_3b((pc), 2, (rd), (op3), (rs1), (simm13))
-
-#  define emitm_and_r(pc, rs1, rs2, rd)    emitm_logic_r((pc), 001, (rs1), (rs2), (rd))
-#  define emitm_andcc_r(pc, rs1, rs2, rd)  emitm_logic_r((pc), 021, (rs1), (rs2), (rd))
-#  define emitm_andn_r(pc, rs1, rs2, rd)   emitm_logic_r((pc), 005, (rs1), (rs2), (rd))
-#  define emitm_andncc_r(pc, rs1, rs2, rd) emitm_logic_r((pc), 025, (rs1), (rs2), (rd))
-#  define emitm_and_i(pc, rs1, i, rd)      emitm_logic_i((pc), 001, (rs1), (i), (rd))
-#  define emitm_andcc_i(pc, rs1, i, rd)    emitm_logic_i((pc), 021, (rs1), (i), (rd))
-#  define emitm_andn_i(pc, rs1, i, rd)     emitm_logic_i((pc), 005, (rs1), (i), (rd))
-#  define emitm_andncc_i(pc, rs1, i, rd)   emitm_logic_i((pc), 025, (rs1), (i), (rd))
-#  define emitm_or_r(pc, rs1, rs2, rd)     emitm_logic_r((pc), 002, (rs1), (rs2), (rd))
-#  define emitm_orcc_r(pc, rs1, rs2, rd)   emitm_logic_r((pc), 022, (rs1), (rs2), (rd))
-#  define emitm_orn_r(pc, rs1, rs2, rd)    emitm_logic_r((pc), 006, (rs1), (rs2), (rd))
-#  define emitm_orncc_r(pc, rs1, rs2, rd)  emitm_logic_r((pc), 026, (rs1), (rs2), (rd))
-#  define emitm_or_i(pc, rs1, i, rd)       emitm_logic_i((pc), 002, (rs1), (i), (rd))
-#  define emitm_orcc_i(pc, rs1, i, rd)     emitm_logic_i((pc), 022, (rs1), (i), (rd))
-#  define emitm_orn_i(pc, rs1, i, rd)      emitm_logic_i((pc), 006, (rs1), (i), (rd))
-#  define emitm_orncc_i(pc, rs1, i, rd)    emitm_logic_i((pc), 026, (rs1), (i), (rd))
-#  define emitm_xor_r(pc, rs1, rs2, rd)    emitm_logic_r((pc), 003, (rs1), (rs2), (rd))
-#  define emitm_xorcc_r(pc, rs1, rs2, rd)  emitm_logic_r((pc), 023, (rs1), (rs2), (rd))
-#  define emitm_xorn_r(pc, rs1, rs2, rd)   emitm_logic_r((pc), 007, (rs1), (rs2), (rd))
-#  define emitm_xorncc_r(pc, rs1, rs2, rd) emitm_logic_r((pc), 027, (rs1), (rs2), (rd))
-#  define emitm_xor_i(pc, rs1, i, rd)      emitm_logic_i((pc), 003, (rs1), (i), (rd))
-#  define emitm_xorcc_i(pc, rs1, i, rd)    emitm_logic_i((pc), 023, (rs1), (i), (rd))
-#  define emitm_xorn_i(pc, rs1, i, rd)     emitm_logic_i((pc), 007, (rs1), (i), (rd))
-#  define emitm_xorncc_i(pc, rs1, i, rd)   emitm_logic_i((pc), 027, (rs1), (i), (rd))
-
-/* Shift Left Logical */
-#  define emitm_sll_r(pc, rs1, rs2, rd) emitm_3a((pc), 2, (rd), 045, (rs1), 0, (rs2))
-#  define emitm_sll_i(pc, rs1, i, rd)   emitm_3b((pc), 2, (rd), 045, (rs1), (i))
-
-/* Shift Right Logical */
-#  define emitm_srl_r(pc, rs1, rs2, rd) emitm_3a((pc), 2, (rd), 046, (rs1), 0, (rs2))
-#  define emitm_srl_i(pc, rs1, i, rd)   emitm_3b((pc), 2, (rd), 046, (rs1), (i))
-
-/* Shift Right Arithmetic */
-#  define emitm_sra_r(pc, rs1, rs2, rd) emitm_3a((pc), 2, (rd), 047, (rs1), 0, (rs2))
-#  define emitm_sra_i(pc, rs1, i, rd)   emitm_3a((pc), 2, (rd), 047, (rs1), (i))
-
-/* Arithmetic ops */
-#  define emitm_add_r(pc, rs1, rs2, rd)    emitm_3a((pc), 2, (rd), 0, (rs1), 0, (rs2))
-#  define emitm_addcc_r(pc, rs1, rs2, rd)  emitm_3a((pc), 2, (rd), 020, (rs1), 0, (rs2))
-#  define emitm_addX_r(pc, rs1, rs2, rd)   emitm_3a((pc), 2, (rd), 010, (rs1), 0, (rs2))
-#  define emitm_addXcc_r(pc, rs1, rs2, rd) emitm_3a((pc), 2, (rd), 030, (rs1), 0, (rs2))
-#  define emitm_add_i(pc, rs1, i, rd)      emitm_3b((pc), 2, (rd), 0, (rs1), (i))
-#  define emitm_addcc_i(pc, rs1, i, rd)    emitm_3b((pc), 2, (rd), 020, (rs1), (i))
-#  define emitm_addX_i(pc, rs1, i, rd)     emitm_3b((pc), 2, (rd), 010, (rs1), (i))
-#  define emitm_addXcc_i(pc, rs1, i, rd)   emitm_3b((pc), 2, (rd), 030, (rs1), (i))
-
-/* Arithmetic ops */
-#  define emitm_sub_r(pc, rs1, rs2, rd)    emitm_3a((pc), 2, (rd), 004, (rs1), 0, (rs2))
-#  define emitm_subcc_r(pc, rs1, rs2, rd)  emitm_3a((pc), 2, (rd), 024, (rs1), 0, (rs2))
-#  define emitm_subX_r(pc, rs1, rs2, rd)   emitm_3a((pc), 2, (rd), 014, (rs1), 0, (rs2))
-#  define emitm_subXcc_r(pc, rs1, rs2, rd) emitm_3a((pc), 2, (rd), 034, (rs1), 0, (rs2))
-#  define emitm_sub_i(pc, rs1, i, rd)      emitm_3b((pc), 2, (rd), 004, (rs1), (i))
-#  define emitm_subcc_i(pc, rs1, i, rd)    emitm_3b((pc), 2, (rd), 024, (rs1), (i))
-#  define emitm_subX_i(pc, rs1, i, rd)     emitm_3b((pc), 2, (rd), 014, (rs1), (i))
-#  define emitm_subXcc_i(pc, rs1, i, rd)   emitm_3b((pc), 2, (rd), 034, (rs1), (i))
-
-/* Floating point operations */
-
-/* MOV */
-#  define emitm_fmovs(pc, rs, rd) emitm_3c((pc), 2, (rd), 064, 0, 0001, (rs))
-
-/* Arithmetic operations */
-#  define emitm_faddd(pc, rs1, rs2, rd) emitm_3c((pc), 2, (rd), 064, (rs1), 0102, (rs2))
-#  define emitm_fsubd(pc, rs1, rs2, rd) emitm_3c((pc), 2, (rd), 064, (rs1), 0106, (rs2))
-#  define emitm_fmuld(pc, rs1, rs2, rd) emitm_3c((pc), 2, (rd), 064, (rs1), 0112, (rs2))
-#  define emitm_fdivd(pc, rs1, rs2, rd) emitm_3c((pc), 2, (rd), 064, (rs1), 0116, (rs2))
-#  define emitm_fabss(pc, rs, rd) emitm_3c((pc), 2, (rd), 064, 0, 0011, (rs))
-#  define emitm_fnegs(pc, rs, rd) emitm_3c((pc), 2, (rd), 064, 0, 0005, (rs))
-
-#  define emitm_fsqrtd(pc, rs, rd) emitm_3c((pc), 2, (rd), 064, 0, 0052, (rs))
-
-/* Floating <-> Integer Conversion */
-#  define emitm_fitod(pc, rs, rd) emitm_3c((pc), 2, (rd), 064, 0, 0310, (rs))
-#  define emitm_fdtoi(pc, rs, rd) emitm_3c((pc), 2, (rd), 064, 0, 0322, (rs))
-
-/* Floating point tests */
-#  define emitm_fcmpd(pc, rs1, rs2) emitm_3c((pc), 2, 0, 065, (rs1), 0122, (rs2))
-
-/* Jump and Link */
-
-#  define emitm_jumpl_r(pc, rs1, rs2, rd) emitm_3a((pc), 2, (rd), 070, (rs1), 0, (rs2))
-#  define emitm_jumpl_i(pc, rs1, i, rd)   emitm_3b((pc), 2, (rd), 070, (rs1), (i))
-
-/* RET */
-#  define emitm_ret(pc) emitm_jumpl_i((pc), emitm_i(7), 8, emitm_g(0))
-
-/* integer conditions */
-#  define emitm_ba   010
-#  define emitm_bn   000
-#  define emitm_bne  011
-#  define emitm_be   001
-#  define emitm_bg   012
-#  define emitm_ble  002
-#  define emitm_bge  013
-#  define emitm_bl   003
-#  define emitm_bgu  014
-#  define emitm_bleu 004
-#  define emitm_bcc  015
-#  define emitm_bcs  005
-#  define emitm_bpos 016
-#  define emitm_bneg 006
-#  define emitm_bvc  017
-#  define emitm_bvs  007
-
-/* floating-point conditions */
-#  define emitm_fba   010
-#  define emitm_fbn   000
-#  define emitm_fbu   007
-#  define emitm_fbg   006
-#  define emitm_fbug  005
-#  define emitm_fbl   004
-#  define emitm_fbul  003
-#  define emitm_fblg  002
-#  define emitm_fbne  001
-#  define emitm_fbe   011
-#  define emitm_fbue  012
-#  define emitm_fbge  013
-#  define emitm_fbuge 014
-#  define emitm_fble  015
-#  define emitm_fbule 016
-#  define emitm_fbo   017
-
-#  define emitm_icc   02
-#  define emitm_fcc   06
-
-/* Branch on integer condition codes */
-#  define emitm_bicc(pc, a, cond, disp22) emitm_2b((pc), (a), (cond), 02, (disp22))
-
-/* Branch on floating-point condition codes */
-#  define emitm_fbfcc(pc, a, cond, disp22) emitm_2b((pc), (a), (cond), 06, (disp22))
-
-#  define jit_emit_mov_rr_i(pc, dst, src) emitm_mov_r((pc), (src), (dst))
-#  define jit_emit_mov_rr_n(pc, dst, src) { \
-    emitm_fmovs((pc), (src), (dst)); \
-    emitm_fmovs((pc), (src)+1, (dst)+1); }
-
-/*
-void main(){
-    char ar[1024];
-    char *ar2;
-
-    ar2 = &ar[0];
-    emitm_ld_r(ar2, emitm_g(0), emitm_i(1), emitm_o(7));
-    emitm_ldub_r(ar2, emitm_g(0), emitm_i(1), emitm_o(7));
-    emitm_ldsh_r(ar2, emitm_g(0), emitm_i(1), emitm_o(7));
-}
-*/
-
-/* Fixup types */
-enum  {JIT_BRANCH, JIT_CALL30 };
-
-/*
- *
- * IMPORTANT SHORTCUTS
- *
- * */
-
-/* The register holding the interpreter pointer */
-#  define Parrot_jit_intrp emitm_i(0)
-
-/* The register holding the address of I0 */
-#  define Parrot_jit_regbase emitm_i(2)
-
-/* The register containing the address of the opmap */
-#  define Parrot_jit_opmap emitm_i(3)
-
-/* These registers should be used only in .jit ops and not helper routines
- *   in jit_emit.h
- */
-#  define ISR1 emitm_i(4)
-#  define ISR2 emitm_i(5)
-#  define FSR1 emitm_f(0)
-#  define FSR2 emitm_f(2)
-
-/* This register can be used only in jit_emit.h calculations */
-#  define XSR1 emitm_l(0)
-#  define XSR2 emitm_g(1)
-
-#  define Parrot_jit_regbase_ptr(interp) &REG_INT((interp), 0)
-
-/* The offset of a Parrot register from the base register */
-#  define Parrot_jit_regoff(a, i) (unsigned)(a) - (unsigned)(Parrot_jit_regbase_ptr(i))
-
-/* interp->code */
-#  define jit_emit_load_coderef(pc, reg) \
-    emitm_ld_i(jit_info->native_ptr, Parrot_jit_intrp, offsetof(Interp, code), (reg)); \
-
-/* Load op_map address */
-#  define jit_emit_load_op_map(pc, code) \
-    emitm_ld_i(jit_info->native_ptr, (code),                                         \
-        offsetof(PackFile_ByteCode, jit_info), XSR1);                       \
-    emitm_ld_i(jit_info->native_ptr, XSR1,                                         \
-      (offsetof(Parrot_jit_arena_t, op_map) + offsetof(Parrot_jit_info_t, arena)), \
-      Parrot_jit_opmap);
-
-/* Construct the starting address of the byte code (code start) */
-#  define jit_emit_load_code_start(pc, code) \
-    emitm_ld_i(jit_info->native_ptr, (code), offsetof(PackFile_Segment, data), \
-               XSR1);
-
-/* Generate a jump to a bytecode address in reg_num
- *  - uses the temporary register
- */
-static void
-Parrot_jit_bytejump(Parrot_jit_info_t *jit_info,
-                    PARROT_INTERP, int reg_num)
-{
-    jit_emit_load_coderef(jit_info->native_ptr, XSR2);
-
-    jit_emit_load_op_map(jit_info->native_ptr, XSR2);
-    jit_emit_load_code_start(jit_info->native_ptr, XSR2);
-
-    /* Calculates the offset into op_map shadow array
-     * assuming sizeof (opcode_t) == sizeof (opmap array entry) */
-    emitm_sub_r(jit_info->native_ptr, reg_num, XSR1, XSR1);
-
-    /* Load the address of the native code from op_map */
-    emitm_ld_r(jit_info->native_ptr, Parrot_jit_opmap, XSR1, XSR1);
-
-    /* This jumps to the address from op_map */
-    emitm_jumpl_i(jit_info->native_ptr, XSR1, 0, XSR1);
-
-    /* fixup where we have the Parrot registers - context switches */
-    emitm_ld_i(jit_info->native_ptr, Parrot_jit_intrp, offsetof(Interp, ctx.bp),
-        Parrot_jit_regbase);
-}
-
-/* Generate conditional branch to offset from current parrot op */
-static void Parrot_jit_branch(Parrot_jit_info_t *jit_info, int branch, int cond,
-                              int annul, opcode_t disp)
-{
-    int offset;
-    opcode_t opcode;
-
-    opcode = jit_info->op_i + disp;
-    if (opcode <= jit_info->op_i){
-        offset = jit_info->arena.op_map[opcode].offset -
-                    (jit_info->native_ptr - jit_info->arena.start);
-
-        if (jit_info->optimizer->cur_section->branch_target ==
-            jit_info->optimizer->cur_section)
-                offset +=
-                    jit_info->optimizer->cur_section->branch_target->load_size;
-
-        if ((offset > emitm_branch_max) || (offset < emitm_branch_min))
-            exit_fatal(EXCEPTION_JIT_ERROR,
-                           "Branches beyond 8 Megabytes not yet supported\n");
-        offset /= 4;
-        emitm_2b(jit_info->native_ptr, annul, cond, branch, offset);
-        return;
-    }
-
-    Parrot_jit_newfixup(jit_info);
-    jit_info->arena.fixups->type = JIT_BRANCH;
-    jit_info->arena.fixups->param.opcode = opcode;
-
-    /* If the branch is to the current section, skip the load instructions. */
-    if (jit_info->optimizer->cur_section->branch_target ==
-        jit_info->optimizer->cur_section)
-            jit_info->arena.fixups->skip =
-                jit_info->optimizer->cur_section->branch_target->load_size;
-
-    emitm_2b(jit_info->native_ptr, annul, cond, branch, 0);
-}
-
-/* Generate branch on integer condition codes */
-#  define Parrot_jit_bicc(jit_info, cond, annul, disp) \
-        Parrot_jit_branch((jit_info), emitm_icc, (cond), (annul), (disp))
-
-/* Generate branch on floating-point condition codes */
-#  define Parrot_jit_fbfcc(jit_info, cond, annul, disp) \
-        Parrot_jit_branch((jit_info), emitm_fcc, (cond), (annul), (disp))
-
-/* This function loads a value */
-static void jit_emit_load_i(Parrot_jit_info_t *jit_info,
-                             PARROT_INTERP,
-                             int param,
-                             int hwreg)
-{
-    opcode_t op_type;
-    int val;
-
-    op_type = interp->op_info_table[*jit_info->cur_op].types[param - 1];
-    val = jit_info->cur_op[param];
-
-    switch (op_type){
-        case PARROT_ARG_IC:
-            if ((val < emitm_simm13_min) || (val > emitm_simm13_max)){
-                emitm_sethi(jit_info->native_ptr, emitm_hi22(val), hwreg);
-                emitm_or_i(jit_info->native_ptr, hwreg, emitm_lo10(val),
-                           hwreg);
-            }
-            else {
-                emitm_or_i(jit_info->native_ptr, emitm_g(0), val, hwreg);
-            }
-
-            break;
-        case PARROT_ARG_NC:
-            val = (int)&interp->code->const_table->
-                    constants[val]->u.number;
-
-            /* Load double into integer registers */
-            emitm_sethi(jit_info->native_ptr, emitm_hi22(val), XSR1);
-            emitm_ldd_i(jit_info->native_ptr, XSR1, emitm_lo10(val),
-                        hwreg);
-            break;
-
-        case PARROT_ARG_I:
-            val = (int)&REG_INT(interp, val);
-            emitm_ld_i(jit_info->native_ptr, Parrot_jit_regbase,
-                       Parrot_jit_regoff(val, interp), hwreg);
-            break;
-
-        case PARROT_ARG_P:
-            val = (int)&REG_PMC(interp, val);
-            emitm_ld_i(jit_info->native_ptr, Parrot_jit_regbase,
-                       Parrot_jit_regoff(val, interp), hwreg);
-            break;
-
-        case PARROT_ARG_S:
-            val = (int)&REG_STR(interp, val);
-            emitm_ld_i(jit_info->native_ptr, Parrot_jit_regbase,
-                       Parrot_jit_regoff(val, interp), hwreg);
-            break;
-
-        case PARROT_ARG_N:
-            val = (int)&REG_NUM(interp, val);
-            emitm_ldd_i(jit_info->native_ptr, Parrot_jit_regbase,
-                       Parrot_jit_regoff(val, interp), hwreg);
-            break;
-
-        default:
-            exit_fatal(EXCEPTION_JIT_ERROR,
-                               "Unsupported op parameter type %d\n",
-                               op_type);
-    }
-}
-
-static void jit_emit_store_i(Parrot_jit_info_t *jit_info,
-                             PARROT_INTERP,
-                             int param,
-                             int hwreg)
-{
-    opcode_t op_type;
-    int val;
-
-    op_type = interp->op_info_table[*jit_info->cur_op].types[param - 1];
-    val = jit_info->cur_op[param];
-
-    switch (op_type){
-        case PARROT_ARG_I:
-            val = (int)&REG_INT(interp, val);
-            emitm_st_i(jit_info->native_ptr, hwreg, Parrot_jit_regbase,
-                       Parrot_jit_regoff(val, interp));
-            break;
-
-        case PARROT_ARG_P:
-            val = (int)&REG_PMC(interp, val);
-            emitm_st_i(jit_info->native_ptr, hwreg, Parrot_jit_regbase,
-                       Parrot_jit_regoff(val, interp));
-            break;
-
-        case PARROT_ARG_S:
-            val = (int)&REG_STR(interp, val);
-            emitm_st_i(jit_info->native_ptr, hwreg, Parrot_jit_regbase,
-                       Parrot_jit_regoff(val, interp));
-            break;
-
-        case PARROT_ARG_N:
-            val = (int)&REG_NUM(interp, val);
-            emitm_std_i(jit_info->native_ptr, hwreg, Parrot_jit_regbase,
-                       Parrot_jit_regoff(val, interp));
-            break;
-
-        default:
-            exit_fatal(EXCEPTION_JIT_ERROR,
-                            "Unsupported op parameter type %d\n", op_type);
-    }
-}
-
-static void jit_emit_load_n(Parrot_jit_info_t *jit_info,
-                             PARROT_INTERP,
-                             int param,
-                             int hwreg)
-{
-    opcode_t op_type;
-    long val;
-
-    op_type = interp->op_info_table[*jit_info->cur_op].types[param - 1];
-    val = jit_info->cur_op[param];
-
-    switch (op_type){
-        case PARROT_ARG_IC:
-            /* Load integer into floating point registers - should use
-               constant pool */
-            val = &jit_info->cur_op[param];
-            emitm_sethi(jit_info->native_ptr, emitm_hi22(val), XSR1);
-            emitm_ldf_i(jit_info->native_ptr, XSR1, emitm_lo10(val), hwreg);
-            break;
-
-        case PARROT_ARG_NC:
-            val = (int)&interp->code->const_table->
-                    constants[val]->u.number;
-
-            /* Load double into floating point registers */
-            emitm_sethi(jit_info->native_ptr, emitm_hi22(val), XSR1);
-            emitm_lddf_i(jit_info->native_ptr, XSR1, emitm_lo10(val),
-                        hwreg);
-            break;
-
-        case PARROT_ARG_I:
-            val = (int)&REG_INT(interp, val);
-            emitm_ldf_i(jit_info->native_ptr, Parrot_jit_regbase,
-                        Parrot_jit_regoff(val, interp), hwreg);
-            break;
-
-        case PARROT_ARG_N:
-            val = (int)&REG_NUM(interp, val);
-            emitm_lddf_i(jit_info->native_ptr, Parrot_jit_regbase,
-                         Parrot_jit_regoff(val, interp), hwreg);
-            break;
-
-        default:
-            exit_fatal(EXCEPTION_JIT_ERROR,
-                            "Unsupported op parameter type %d\n", op_type);
-    }
-}
-
-static void jit_emit_store_n(Parrot_jit_info_t *jit_info,
-                             PARROT_INTERP,
-                             int param,
-                             int hwreg)
-{
-    opcode_t op_type;
-    int val;
-
-    op_type = interp->op_info_table[*jit_info->cur_op].types[param - 1];
-    val = jit_info->cur_op[param];
-
-    switch (op_type){
-        case PARROT_ARG_I:
-            val = (int)&REG_INT(interp, val);
-            emitm_stf_i(jit_info->native_ptr, hwreg, Parrot_jit_regbase,
-                       Parrot_jit_regoff(val, interp));
-            break;
-
-        case PARROT_ARG_N:
-            val = (int)&REG_NUM(interp, val);
-            emitm_stdf_i(jit_info->native_ptr, hwreg, Parrot_jit_regbase,
-                       Parrot_jit_regoff(val, interp));
-            break;
-
-        default:
-            exit_fatal(EXCEPTION_JIT_ERROR,
-                            "Unsupported op parameter type %d\n", op_type);
-    }
-}
-
-
-void Parrot_jit_dofixup(Parrot_jit_info_t *jit_info,
-                        PARROT_INTERP)
-{
-    Parrot_jit_fixup_t *fixup;
-    Parrot_jit_fixup_t *last_fixup;
-    char *fixup_ptr;
-    int fixup_val;
-
-    fixup = jit_info->arena.fixups;
-
-    while (fixup){
-        switch (fixup->type){
-        /* This fixes-up a branch to a known opcode offset */
-            case JIT_BRANCH:
-                fixup_ptr = Parrot_jit_fixup_target(jit_info, fixup);
-                fixup_val = (jit_info->arena.op_map[fixup->param.opcode].offset
-                                - fixup->native_offset + fixup->skip) / 4;
-                *(int *)(fixup_ptr) |= emitm_mask(22, fixup_val);
-                break;
-
-            case JIT_CALL30:
-                fixup_ptr = jit_info->arena.start + fixup->native_offset;
-                fixup_val = (int)fixup->param.fptr - (int)fixup_ptr;
-                emitm_call_30(fixup_ptr, emitm_hi30(fixup_val));
-                break;
-
-            default:
-                exit_fatal(EXCEPTION_JIT_ERROR, "Unknown fixup type:%d\n",
-                    fixup->type);
-            break;
-        }
-        fixup = fixup->next;
-    }
-}
-
-void
-Parrot_jit_begin(Parrot_jit_info_t *jit_info,
-                      PARROT_INTERP)
-{
-    /* generated code is called as jit_code(interp, pc)
-     * so interpreter is in i0 and pc in i1.
-     * i1 is reusable once past the jump. interpreter is preserved in i0
-     */
-    int ireg0_offset;
-    int ireg0_address;
-
-    /* Standard Prolog */
-    emitm_save_i(jit_info->native_ptr, emitm_SP, -104, emitm_SP);
-
-    /* Calculate the offset of I0 in the interpreter struct */
-    ireg0_address = (int)Parrot_jit_regbase_ptr(interp);
-    ireg0_offset  = ireg0_address - (int)interp;
-
-    /* All parrot registers will be addressed relative to I0 */
-    if ((ireg0_offset < emitm_simm13_min) || (ireg0_offset > emitm_simm13_max)){
-        /* Store the address of I0 if its offset doesnt fit in the immediate */
-        emitm_sethi(jit_info->native_ptr, emitm_hi22(ireg0_address), Parrot_jit_regbase);
-        emitm_or_i(jit_info->native_ptr, Parrot_jit_regbase, emitm_lo10(ireg0_address),
-                   Parrot_jit_regbase);
-    }
-    else {
-        /* Calculate the address of I0 */
-        emitm_add_i(jit_info->native_ptr, Parrot_jit_intrp, ireg0_offset,
-                    Parrot_jit_regbase);
-    }
-
-    /* Jump to the current pc */
-    Parrot_jit_bytejump(jit_info, interp, emitm_i(1));
-}
-
-void Parrot_jit_normal_op(Parrot_jit_info_t *jit_info,
-                          PARROT_INTERP)
-{
-    emitm_sethi(jit_info->native_ptr, emitm_hi22(jit_info->cur_op), emitm_o(0));
-    emitm_or_i(jit_info->native_ptr,
-        emitm_o(0), emitm_lo10(jit_info->cur_op), emitm_o(0));
-
-    Parrot_jit_newfixup(jit_info);
-    jit_info->arena.fixups->type = JIT_CALL30;
-    jit_info->arena.fixups->param.fptr =
-        (void (*)(void))interp->op_func_table[*(jit_info->cur_op)];
-
-    emitm_call_30(jit_info->native_ptr, 0);
-    emitm_mov_r(jit_info->native_ptr, Parrot_jit_intrp, emitm_o(1));
-}
-
-void Parrot_jit_cpcf_op(Parrot_jit_info_t *jit_info,
-                        PARROT_INTERP)
-{
-    Parrot_jit_normal_op(jit_info, interp);
-    Parrot_jit_bytejump(jit_info, interp, emitm_o(0));
-}
-
-#  undef Parrot_jit_restart_op
-void Parrot_jit_restart_op(Parrot_jit_info_t *jit_info,
-                        PARROT_INTERP)
-{
-    Parrot_jit_normal_op(jit_info, interp);
-
-    /* Test whether the return value is 0 */
-    emitm_subcc_r(jit_info->native_ptr, emitm_o(0), emitm_g(0), emitm_g(0));
-
-    /* If the return pc is not zero skip the next 3 instructions */
-    emitm_bicc(jit_info->native_ptr, 0, emitm_bne, 4);
-    emitm_nop(jit_info->native_ptr);
-
-    /* Return if the return pc is 0 */
-    emitm_ret(jit_info->native_ptr);
-    emitm_restore_i(jit_info->native_ptr, emitm_g(0), emitm_g(0), emitm_g(0));
-
-    Parrot_jit_bytejump(jit_info, interp, emitm_o(0));
-}
-
-/* move reg to mem (i.e. intreg) */
-void
-Parrot_jit_emit_mov_mr(PARROT_INTERP, char *mem, int reg)
-{
-    emitm_st_i(((Parrot_jit_info_t *)(interp->code->jit_info))->native_ptr,
-               reg, Parrot_jit_regbase, Parrot_jit_regoff(mem, interp));
-}
-
-/* move mem (i.e. intreg) to reg */
-void
-Parrot_jit_emit_mov_rm(PARROT_INTERP, int reg, char *mem)
-{
-    emitm_ld_i(((Parrot_jit_info_t *)(interp->code->jit_info))->native_ptr,
-               Parrot_jit_regbase, Parrot_jit_regoff(mem, interp), reg);
-}
-
-/* move reg to mem (i.e. numreg) */
-void
-Parrot_jit_emit_mov_mr_n(PARROT_INTERP, char *mem, int reg)
-{
-    emitm_stdf_i(((Parrot_jit_info_t *)(interp->code->jit_info))->native_ptr,
-                 reg, Parrot_jit_regbase, Parrot_jit_regoff(mem, interp));
-}
-
-/* move mem (i.e. numreg) to reg */
-void
-Parrot_jit_emit_mov_rm_n(PARROT_INTERP, int reg, char *mem)
-{
-    emitm_lddf_i(((Parrot_jit_info_t *)(interp->code->jit_info))->native_ptr,
-                 Parrot_jit_regbase, Parrot_jit_regoff(mem, interp), reg);
-}
-
-/* XXX Hack to fix the following bug as of 05 Dec 2005:
-    Hack [perl #37819] Sun4 builds fail linking against jit.o
-    These dummy definitions blindly copied from jit/mips/jit_emit.h.
-    Apparently, they need to be inside a JIT_EMIT section of this
-    file.
-    See also the "Hack [perl #37819]" section near the bottom of this
-    file.
-*/
-void
-Parrot_jit_emit_mov_mr_offs(PARROT_INTERP, int base, size_t offs, int reg)
-{
-}
-
-void
-Parrot_jit_emit_mov_rm_offs(PARROT_INTERP, int reg, int base, size_t offs)
-{
-}
-
-void
-Parrot_jit_emit_mov_mr_n_offs(PARROT_INTERP, int base, size_t offs, int reg)
-{
-}
-
-void
-Parrot_jit_emit_mov_rm_n_offs(PARROT_INTERP, int reg, int base, size_t offs)
-{
-}
-/* XXX end blind hack for [perl #37819] --but see
-   additional hack section at bottom.
-*/
-#  ifndef NO_JIT_VTABLE_OPS
-
-#    undef Parrot_jit_vtable1_op
-#    undef Parrot_jit_vtable1r_op
-
-#    undef Parrot_jit_vtable_111_op
-#    undef Parrot_jit_vtable_112_op
-#    undef Parrot_jit_vtable_221_op
-#    undef Parrot_jit_vtable_1121_op
-#    undef Parrot_jit_vtable_1123_op
-#    undef Parrot_jit_vtable_2231_op
-
-#    undef Parrot_jit_vtable_1r223_op
-#    undef Parrot_jit_vtable_1r332_op
-
-#    undef Parrot_jit_vtable_ifp_op
-#    undef Parrot_jit_vtable_unlessp_op
-#    undef Parrot_jit_vtable_newp_ic_op
-
-/* emit a call to a vtable func
- * $X->vtable(interp, $X [, $Y...] )
- */
-static void
-Parrot_jit_vtable_n_op(Parrot_jit_info_t *jit_info,
-                       PARROT_INTERP, int n, int *args)
-{
-    int        nvtable = op_jit[*jit_info->cur_op].extcall;
-    op_info_t *op_info = &interp->op_info_table[*jit_info->cur_op];
-
-    int    pmc = 0;  /* pmc saves the left most Pi       */
-    int    rdx = 1;  /* native (outgoing) register index */
-
-    int    idx, pi, i;
-    size_t offset;
-
-    offset  = offsetof(VTABLE, absolute);
-    offset += nvtable * sizeof (void *);
-
-    for (idx = 1; idx <= n; idx++) {
-        i  = args[idx - 1];
-        pi = *(jit_info->cur_op + i);
-
-        switch (op_info->types[i - 1]) {
-            case PARROT_ARG_S:
-                emitm_ld_i(jit_info->native_ptr, Parrot_jit_regbase,
-                           REG_OFFS_STR(pi), emitm_o(rdx));
-                break;
-            case PARROT_ARG_K:
-            case PARROT_ARG_P:
-                emitm_ld_i(jit_info->native_ptr, Parrot_jit_regbase,
-                           REG_OFFS_PMC(pi), emitm_o(rdx));
-                if (! pmc) { pmc = rdx; }
-                break;
-            case PARROT_ARG_KI:
-            case PARROT_ARG_I:
-                emitm_ld_i(jit_info->native_ptr, Parrot_jit_regbase,
-                           REG_OFFS_INT(pi), emitm_o(rdx));
-                break;
-            case PARROT_ARG_KIC:
-            case PARROT_ARG_IC:
-                if (emitm_simm13_const(pi)) {
-                    emitm_mov_i(jit_info->native_ptr, pi, emitm_o(rdx));
-                }
-                else {
-                    emitm_sethi(jit_info->native_ptr, emitm_hi22(pi), emitm_o(rdx));
-                    emitm_or_i(jit_info->native_ptr, emitm_o(rdx), emitm_lo10(pi), emitm_o(rdx));
-                }
-                break;
-            case PARROT_ARG_N:
-                emitm_ld_i(jit_info->native_ptr, Parrot_jit_regbase,
-                           REG_OFFS_NUM(pi), emitm_o(rdx));
-                emitm_ld_i(jit_info->native_ptr, Parrot_jit_regbase,
-                           REG_OFFS_NUM(pi) + 4, emitm_o(++rdx));
-                break;
-            case PARROT_ARG_NC:
-#    define NC_addr &interp->code->const_table->constants[pi]->u.number
-                emitm_sethi(jit_info->native_ptr, emitm_hi22(NC_addr), XSR1);
-                emitm_or_i(jit_info->native_ptr, XSR1, emitm_lo10(NC_addr), XSR1);
-
-                emitm_ld_i(jit_info->native_ptr, XSR1, 0, emitm_o(rdx));
-                emitm_ld_i(jit_info->native_ptr, XSR1, 4, emitm_o(++rdx));
-                break;
-            case PARROT_ARG_SC:
-#    define SC_addr &interp->code->const_table->constants[pi]->u.string
-                emitm_sethi(jit_info->native_ptr, emitm_hi22(SC_addr), XSR1);
-                emitm_or_i(jit_info->native_ptr, XSR1, emitm_lo10(SC_addr), XSR1);
-
-                emitm_ld_i(jit_info->native_ptr, XSR1, 0, emitm_o(rdx));
-                break;
-            case PARROT_ARG_KC:
-            case PARROT_ARG_PC:
-#    define KC_addr &interp->code->const_table->constants[pi]->u.key
-                emitm_sethi(jit_info->native_ptr, emitm_hi22(KC_addr), XSR1);
-                emitm_or_i(jit_info->native_ptr, XSR1, emitm_lo10(KC_addr), XSR1);
-
-                emitm_ld_i(jit_info->native_ptr, XSR1, 0, emitm_o(rdx));
-                break;
-            default:
-                exit_fatal(1,
-                        "jit_vtable_n_op: unimp type %d, arg %d vtable %d",
-                        op_info->types[i - 1], i, nvtable);
-                break;
-        }
-
-        rdx++;
-    }
-
-    emitm_ld_i(jit_info->native_ptr, emitm_o(pmc), offsetof(struct PMC, vtable), XSR1);
-    emitm_ld_i(jit_info->native_ptr, XSR1, offset, XSR1);
-
-    emitm_jumpl_i(jit_info->native_ptr, XSR1, 0, emitm_o(7));
-    emitm_mov_r(jit_info->native_ptr, Parrot_jit_intrp, emitm_o(0));
-}
-
-static void
-Parrot_jit_store_retval(Parrot_jit_info_t *jit_info,
-                        PARROT_INTERP)
-{
-    opcode_t op_type = interp->op_info_table[*jit_info->cur_op].types[0];
-    long     val     = jit_info->cur_op[1];
-
-    switch (op_type){
-        case PARROT_ARG_I:
-            emitm_st_i(jit_info->native_ptr, emitm_o(0), Parrot_jit_regbase,
-                       Parrot_jit_regoff((int)&REG_INT(interp, val), interp));
-            break;
-        case PARROT_ARG_P:
-            emitm_st_i(jit_info->native_ptr, emitm_o(0), Parrot_jit_regbase,
-                       Parrot_jit_regoff((int)&REG_PMC(interp, val), interp));
-            break;
-        case PARROT_ARG_S:
-            emitm_st_i(jit_info->native_ptr, emitm_o(0), Parrot_jit_regbase,
-                       Parrot_jit_regoff((int)&REG_STR(interp, val), interp));
-            break;
-        case PARROT_ARG_N:
-            emitm_stdf_i(jit_info->native_ptr, emitm_f(0), Parrot_jit_regbase,
-                       Parrot_jit_regoff((int)&REG_NUM(interp, val), interp));
-            break;
-        default:
-            exit_fatal(EXCEPTION_JIT_ERROR, "jit_vtable1r: ill LHS");
-    }
-}
-
-/* emit a call to a vtable func
- * $1->vtable(interp, $1)
- */
-static void
-Parrot_jit_vtable1_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    int a[] = { 1 };
-    Parrot_jit_vtable_n_op(jit_info, interp, 1, a);
-}
-
-/* emit a call to a vtable func
- * $1 = $2->vtable(interp, $2)
- */
-static void
-Parrot_jit_vtable1r_op(Parrot_jit_info_t *jit_info,
-                      Interp * interp)
-{
-    int a[] = { 2 };
-    Parrot_jit_vtable_n_op(jit_info, interp, 1, a);
-    Parrot_jit_store_retval(jit_info, interp);
-}
-
-/* emit a call to a vtable func
- * $1 = $2->vtable(interp, $2, $3)
- */
-static void
-Parrot_jit_vtable_1r223_op(Parrot_jit_info_t *jit_info,
-                      PARROT_INTERP)
-{
-    int a[] = { 2, 3 };
-    Parrot_jit_vtable_n_op(jit_info, interp, 2, a);
-    Parrot_jit_store_retval(jit_info, interp);
-}
-
-/* emit a call to a vtable func
- * $1 = $3->vtable(interp, $3, $2)
- */
-static void
-Parrot_jit_vtable_1r332_op(Parrot_jit_info_t *jit_info,
-                      PARROT_INTERP)
-{
-    int a[] = { 3, 2 };
-    Parrot_jit_vtable_n_op(jit_info, interp, 2, a);
-    Parrot_jit_store_retval(jit_info, interp);
-}
-
-/* emit a call to a vtable func
- * $1->vtable(interp, $1, $2)
- */
-static void
-Parrot_jit_vtable_112_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    int a[] = { 1, 2 };
-    Parrot_jit_vtable_n_op(jit_info, interp, 2, a);
-}
-
-/* emit a call to a vtable func
- * $1->vtable(interp, $1, $1)
- */
-static void
-Parrot_jit_vtable_111_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    int a[] = { 1, 1 };
-    Parrot_jit_vtable_n_op(jit_info, interp, 2, a);
-}
-
-/* emit a call to a vtable func
- * $2->vtable(interp, $2, $1)
- */
-static void
-Parrot_jit_vtable_221_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    int a[] = { 2, 1 };
-    Parrot_jit_vtable_n_op(jit_info, interp, 2, a);
-}
-
-/* emit a call to a vtable func
- * $2->vtable(interp, $2, $3, $1)
- */
-static void
-Parrot_jit_vtable_2231_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    int a[] = { 2, 3, 1 };
-    Parrot_jit_vtable_n_op(jit_info, interp, 3, a);
-}
-
-/* emit a call to a vtable func
- * $1->vtable(interp, $1, $2, $3)
- */
-static void
-Parrot_jit_vtable_1123_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    int a[] = { 1, 2, 3 };
-    Parrot_jit_vtable_n_op(jit_info, interp, 3, a);
-}
-
-/* emit a call to a vtable func
- * $1->vtable(interp, $1, $2, $1)
- */
-static void
-Parrot_jit_vtable_1121_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    int a[] = { 1, 2, 1 };
-    Parrot_jit_vtable_n_op(jit_info, interp, 3, a);
-}
-
-/* if_p_ic, unless_p_ic */
-static void
-Parrot_jit_vtable_if_unless_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP, int unless)
-{
-    int ic = *(jit_info->cur_op + 2);  /* branch offset */
-
-    /* emit call to vtable function i.e. get_bool, result in o0 */
-    Parrot_jit_vtable1_op(jit_info, interp);
-
-    /* test the result - and branch (or not) accordingly */
-    emitm_subcc_r(jit_info->native_ptr, emitm_o(0), emitm_g(0), emitm_g(0));
-    Parrot_jit_bicc(jit_info, unless ? emitm_be : emitm_bne, 0, ic);
-
-    emitm_nop(jit_info->native_ptr);
-}
-
-static void
-Parrot_jit_vtable_ifp_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    Parrot_jit_vtable_if_unless_op(jit_info, interp, 0);
-}
-
-static void
-Parrot_jit_vtable_unlessp_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    Parrot_jit_vtable_if_unless_op(jit_info, interp, 1);
-}
-
-/* new_p_ic */
-static void
-Parrot_jit_vtable_newp_ic_op(Parrot_jit_info_t *jit_info,
-                     PARROT_INTERP)
-{
-    void *igniter = (void (*)(void))pmc_new_noinit;
-    size_t offset = offsetof(VTABLE, init);
-
-    int p1 = *(jit_info->cur_op + 1);
-    int i2 = *(jit_info->cur_op + 2);
-
-    if (i2 <= 0 || i2 >= interp->n_vtable_max)
-        exit_fatal(1, "Illegal PMC enum (%d) in new", i2);
-
-    /* get "a" pmc first - calling function:  pmc_new_noinit(...) */
-    /* PMC* pmc_new_noinit(PARROT_INTERP, INTVAL base_type) */
-    if (emitm_simm13_const(i2)) {
-        emitm_mov_i(jit_info->native_ptr, i2, emitm_o(1));
-    }
-    else {
-        emitm_sethi(jit_info->native_ptr, emitm_hi22(i2), emitm_o(1));
-        emitm_or_i(jit_info->native_ptr, emitm_o(1), emitm_lo10(i2), emitm_o(1));
-    }
-
-    Parrot_jit_newfixup(jit_info);
-    jit_info->arena.fixups->type = JIT_CALL30;
-    jit_info->arena.fixups->param.fptr = D2FPTR(igniter);
-
-    emitm_call_30(jit_info->native_ptr, 0);
-    emitm_mov_r(jit_info->native_ptr, Parrot_jit_intrp, emitm_o(0));
-
-    /* got a new pmc, sync mem and prepare vtable call (regs) */
-    emitm_mov_r(jit_info->native_ptr, emitm_o(0), emitm_o(1));
-    emitm_st_i(jit_info->native_ptr, emitm_o(0), Parrot_jit_regbase,
-               Parrot_jit_regoff((int)&REG_PMC(interp, p1), interp));
-
-    emitm_ld_i(jit_info->native_ptr, emitm_o(0), offsetof(struct PMC, vtable), XSR1);
-    emitm_ld_i(jit_info->native_ptr, XSR1, offset, XSR1);
-
-    emitm_jumpl_i(jit_info->native_ptr, XSR1, 0, emitm_o(7));
-    emitm_mov_r(jit_info->native_ptr, Parrot_jit_intrp, emitm_o(0));
-}
-
-#  endif /* NO_JIT_VTABLE_OPS */
-
-#else /* JIT_EMIT */
-
-#  define REQUIRES_CONSTANT_POOL 0
-#  define INT_REGISTERS_TO_MAP 6
-#  define FLOAT_REGISTERS_TO_MAP 6
-
-#  ifndef JIT_IMCC
-char intval_map[INT_REGISTERS_TO_MAP] =
-    { emitm_l(1), emitm_l(2), emitm_l(3), emitm_l(4), emitm_l(5), emitm_l(6)
-    };
-
-char floatval_map[] =
-    { emitm_f(4), emitm_f(6), emitm_f(8), emitm_f(10), emitm_f(12), emitm_f(14)
-    };
-#  endif
-
-#  define PRESERVED_INT_REGS 6
-#  define PRESERVED_FLOAT_REGS 0
-
-#endif /* JIT_EMIT */
-
-/* XXX Hack [perl #37819]  Unlike the functions above, this one apparently
-    sometimes needs to be defined both in and out of the JIT_EMIT section.
-    However, at this point, the Parrot_jit_regbase symbol is not
-    defined, so we replace it with the integer 26 (which is what it
-    expands to anyway.
-*/
-#  define Parrot_jit_emit_get_base_reg_no(pc) 26 /*Parrot_jit_regbase */
-
-#endif /* PARROT_SUN4_JIT_EMIT_H_GUARD */
-
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit_debug.c
==============================================================================
--- branches/orderedhash_revamp/src/jit_debug.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,413 +0,0 @@
-/*
-Copyright (C) 2001-2008, Parrot Foundation.
-$Id$
-
-=head1 NAME
-
-src/jit_debug.c - Write stabs file for JIT code
-
-=head1 SYNOPSIS
-
-When debugging JIT code with C<gdb>, do:
-
-    add-symbol-file <file.o> 0
-
-=head1 DESCRIPTION
-
-Stabs is a file format for information that describes a program to a
-debugger.
-
-For more information see the stabs documentation at
-http://sources.redhat.com/gdb/current/onlinedocs/stabs_toc.html.
-
-=head2 Functions
-
-=over 4
-
-=cut
-
-*/
-
-/* HEADERIZER HFILE: none */
-/* HEADERIZER STOP */
-
-#include <parrot/parrot.h>
-#include "parrot/exec.h"
-#include "jit.h"
-
-#define N_GSYM "32"     /* global variable */
-#define N_FNAME "34"
-#define N_FUN "36"
-#define N_STSYM "38"    /* variable in data section */
-#define N_LCSYM "40"    /* bss section */
-#define N_MAIN "42"
-#define N_ROSYM "44"
-#define N_PC "48"
-#define N_NSYMS "50"
-#define N_NOMAP "52"
-#define N_OBJ "56"
-#define N_OPT "60"
-#define N_RSYM "64"     /* register variable */
-#define N_M2C "66"
-#define N_SLINE "68"
-#define N_DSLINE "70"
-#define N_BSLINE "72"
-#define N_BROWS "72"
-#define N_DEFD "74"
-#define N_FLINE "76"
-#define N_EHDECL "80"
-#define N_MOD2 "80"
-#define N_CATCH "84"
-#define N_SSYM "96"
-#define N_ENDM "98"
-#define N_SO "100"     /* filename */
-#define N_LSYM "128"   /* stack variable */
-#define N_BINCL "130"
-#define N_SOL "132"
-#define N_PSYM "160"   /* parameter */
-#define N_EINCL "162"
-#define N_ENTRY "164"
-#define N_LBRAC "192"
-#define N_EXCL "194"
-#define N_SCOPE "196"
-#define N_RBRAC "224"
-#define N_BCOMM "226"
-#define N_ECOMM "228"
-#define N_ECOML "232"
-#define N_WITH "234"
-#define N_NBTEXT "240"
-#define N_NBDATA "242"
-#define N_NBBSS "244"
-#define N_NBSTS "246"
-#define N_NBLCS "248"
-
-#ifdef __GNUC__
-void Parrot_jit_debug(PARROT_INTERP);
-
-#  define BIT_SIZE(t) ((int)(sizeof (t)*8))
-#  define BYTE_SIZE(t) ((int)sizeof (t))
-#  define BIT_OFFSET(str, field) ((int)(offsetof(str, field) * 8))
-
-typedef struct BaseTypes {
-    const char *name;
-    const char *spec;
-} BaseTypes;
-
-/*
-
-=item C<static void write_types(FILE *stabs, PARROT_INTERP)>
-
-Writes the types to C<stabs>.
-
-=cut
-
-*/
-
-static void
-write_types(FILE *stabs, PARROT_INTERP)
-{
-    int i, j;
-    /* borrowed from mono */
-    static BaseTypes base_types[] = {
-            {"Void", "(0,1)"},
-            {"Char", ";-128;127;"},
-            {"Byte", ";0;255;"},
-            {"Int16", ";-32768;32767;"},
-            {"UInt16", ";0;65535;"},
-            {"Int32", ";0020000000000;0017777777777;"}, /* 5 */
-            {"UInt32", ";0000000000000;0037777777777;"},
-            {"Int64", ";01000000000000000000000;0777777777777777777777;"},
-            {"UInt64", ";0000000000000;01777777777777777777777;"},
-            {"Single", "r(0,8);4;0;"},
-            {"Double", "r(0,8);8;0;"},  /* 10 */
-            {"LongDouble", "r(0,8);12;0;"},
-#  if INTVAL_SIZE == 4
-            {"INTVAL", "(0,5);"},       /* 12 */
-#  else
-            {"INTVAL", "(0,7);"},
-#  endif
-#  if NUMVAL_SIZE == 8
-            {"FLOATVAL", "(0,10);"},    /* 13 */
-#  else
-            {"FLOATVAL", "(0,11);"},
-#  endif
-            {"Ptr", "*(0,0);"},
-            {"CharPtr", "*(0,1);"},     /* 15 */
-            {0, 0}
-        };
-    for (i = 0; base_types[i].name; ++i) {
-        if (! base_types[i].spec)
-            continue;
-        fprintf(stabs, ".stabs \"%s:t(0,%d)=", base_types[i].name, i);
-        if (base_types[i].spec [0] == ';') {
-            fprintf(stabs, "r(0,%d)%s\"", i, base_types[i].spec);
-        }
-        else {
-            fprintf(stabs, "%s\"", base_types[i].spec);
-        }
-        fprintf(stabs, "," N_LSYM ",0,0,0\n");
-    }
-    fprintf(stabs, ".stabs \"STRING:t(0,%d)=*(0,%d)\""
-                "," N_LSYM ",0,0,0\n", i, i+1);
-    ++i;
-    fprintf(stabs, ".stabs \"Parrot_String:T(0,%d)=s%d"
-                "bufstart:(0,14),%d,%d;"
-                "buflen:(0,6),%d,%d;"   /* XXX type */
-                "flags:(0,12),%d,%d;"
-                "bufused:(0,12),%d,%d;"
-                "strstart:(0,15),%d,%d;"        /* fake a char* */
-                ";\""
-                "," N_LSYM ",0,0,0\n", i++, BYTE_SIZE(STRING),
-                BIT_OFFSET(STRING, cache._b._bufstart), BIT_SIZE(void*),
-                BIT_OFFSET(STRING, cache._b._buflen), BIT_SIZE(size_t),
-                BIT_OFFSET(STRING, flags), BIT_SIZE(UINTVAL),
-                BIT_OFFSET(STRING, bufused), BIT_SIZE(UINTVAL),
-                BIT_OFFSET(STRING, strstart), BIT_SIZE(void*));
-
-    fprintf(stabs, ".stabs \"PMCType:T(0,%d)=e", i++);
-    for (j = 0; j < interp->n_vtable_max; ++j) {
-        if (interp->vtables[j] && interp->vtables[j]->whoami) {
-            STRING *name  = interp->vtables[j]->whoami;
-            size_t  items = fwrite(name->strstart, name->strlen, 1, stabs);
-            if (!items)
-                fprintf(stderr, "Error writing stabs!\n");
-            fprintf(stabs, ":%d,", j);
-        }
-    }
-
-    fprintf(stabs, ";\"," N_LSYM ",0,0,0\n");
-
-    /* PMC type */
-    fprintf(stabs, ".stabs \"PMC:T(0,%d)=s%d", i, BYTE_SIZE(PMC));
-    fprintf(stabs, "cache:(0,%d),%d,%d;",
-            i + 1, BIT_OFFSET(PMC, cache), BIT_SIZE(UnionVal));
-    fprintf(stabs, "flags:(0,%d),%d,%d;",
-            i + 1, BIT_OFFSET(PMC, flags), BIT_SIZE(Parrot_UInt));
-    fprintf(stabs, "vtable:*(0,%d),%d,%d;",
-            i + 3, BIT_OFFSET(PMC, vtable), BIT_SIZE(void*));
-    fprintf(stabs, "data:(0,14),%d,%d;",
-            BIT_OFFSET(PMC, data), BIT_SIZE(void*));
-    fprintf(stabs, "pmc_ext:*(0,%d),%d,%d;",
-            i, BIT_OFFSET(PMC, pmc_ext), BIT_SIZE(void*));
-    fprintf(stabs, ";\"");
-    fprintf(stabs, "," N_LSYM ",0,0,0\n");
-
-    fprintf(stabs, ".stabs \"UnionVal:T(0,%d)=u%d"
-                "int_val:(0,12),%d,%d;"
-                "pmc_val:*(0,%d),%d,%d;"
-                ";\""
-                "," N_LSYM ",0,0,0\n", i + 2, BYTE_SIZE(UnionVal),
-                BIT_OFFSET(UnionVal, _i._int_val), BIT_SIZE(INTVAL),
-                i, BIT_OFFSET(UnionVal, _ptrs._pmc_val), BIT_SIZE(void*));
-    fprintf(stabs, ".stabs \"VTABLE:T(0,%d)=s%d"
-                "base_type:(0,%d),%d,%d;"
-                ";\""
-                "," N_LSYM ",0,0,0\n", i + 3, BYTE_SIZE(UnionVal),
-                i - 1, BIT_OFFSET(VTABLE, base_type), BIT_SIZE(INTVAL));
-    i += 4;
-
-}
-
-/*
-
-=item C<static void
-write_vars(FILE *stabs, PARROT_INTERP)>
-
-Writes the contents of the registers to C<stabs>.
-
-=cut
-
-*/
-
-static void
-write_vars(FILE *stabs, PARROT_INTERP)
-{
-    int i;
-    /* fake static var stabs */
-    for (i = 0; i < NUM_REGISTERS; i++) {
-        fprintf(stabs, ".stabs \"I%d:S(0,12)\"," N_STSYM ",0,0,%p\n", i,
-                (char*)&REG_INT(interp, i));
-        fprintf(stabs, ".stabs \"N%d:S(0,13)\"," N_STSYM ",0,0,%p\n", i,
-                (char*)&REG_NUM(interp, i));
-        fprintf(stabs, ".stabs \"S%d:S(0,16)\"," N_STSYM ",0,0,%p\n", i,
-                (char*)&REG_STR(interp, i));
-        fprintf(stabs, ".stabs \"P%d:S*(0,19)\"," N_STSYM ",0,0,%p\n", i,
-                (char*)&REG_PMC(interp, i));
-    }
-}
-
-/*
-
-=item C<static STRING *
-debug_file(PARROT_INTERP, STRING *file, const char *ext)>
-
-Returns C<file> with C<ext> appended.
-
-=cut
-
-*/
-
-static STRING *
-debug_file(PARROT_INTERP, STRING *file, const char *ext)
-{
-    STRING *ret;
-    ret = Parrot_str_copy(interp, file);
-    ret = Parrot_str_append(interp, ret,
-            string_make(interp, ext, strlen(ext), NULL,
-                PObj_external_FLAG));
-    return ret;
-}
-
-/*
-
-=item C<static void
-Parrot_jit_debug_stabs(PARROT_INTERP)>
-
-Writes the JIT debugging stabs.
-
-=cut
-
-*/
-
-static void
-Parrot_jit_debug_stabs(PARROT_INTERP)
-{
-    Parrot_jit_info_t *jit_info = interp->code->jit_info;
-    STRING *file = NULL;
-    STRING *pasmfile, *stabsfile, *ofile, *cmd;
-    FILE *stabs;
-    size_t i;
-    int line;
-    opcode_t lc;
-    PackFile_Debug *debug;
-
-    if (interp->code->debugs) {
-        char *ext;
-        char * const src = Parrot_str_to_cstring(interp,
-            Parrot_debug_pc_to_filename(interp,
-            interp->code->debugs, 0));
-        pasmfile = string_make(interp, src, strlen(src), NULL,
-                PObj_external_FLAG);
-        file = Parrot_str_copy(interp, pasmfile);
-        /* chop pasm/pir */
-
-        ext = strrchr(src, '.');
-        if (ext && STREQ(ext, ".pasm"))
-            Parrot_str_chopn_inplace(interp, file, 4);
-        else if (ext && STREQ(ext, ".pir"))
-            Parrot_str_chopn_inplace(interp, file, 3);
-        else if (!ext) /* EVAL_n */
-            file = Parrot_str_append(interp, file,
-                    string_make(interp, ".", 1, NULL, PObj_external_FLAG));
-
-        Parrot_str_free_cstring(src);
-    }
-    else {
-        /* chop pbc */
-        Parrot_str_chopn_inplace(interp, file, 3);
-        pasmfile = debug_file(interp, file, "pasm");
-    }
-    stabsfile = debug_file(interp, file, "stabs.s");
-    ofile     = debug_file(interp, file, "o");
-    {
-        char *const temp = Parrot_str_to_cstring(interp, stabsfile);
-        stabs            = fopen(temp, "w");
-        Parrot_str_free_cstring(temp);
-    }
-    if (stabs == NULL)
-        return;
-
-    {
-        char * const temp = Parrot_str_to_cstring(interp, pasmfile);
-        /* filename info */
-        fprintf(stabs, ".data\n.text\n");       /* darwin wants it */
-        fprintf(stabs, ".stabs \"%s\"," N_SO ",0,0,0\n", temp);
-        Parrot_str_free_cstring(temp);
-    }
-    /* jit_func start addr */
-    fprintf(stabs, ".stabs \"jit_func:F(0,1)\"," N_FUN ",0,1,%p\n",
-            jit_info->arena.start);
-
-    write_types(stabs, interp);
-    write_vars(stabs, interp);
-    /* if we don't have line numbers, emit dummys, assuming there are
-     * no comments and spaces in source for testing
-     */
-
-    /* jit_begin */
-    fprintf(stabs, ".stabn " N_SLINE ",0,1,0\n");
-    line = 1;
-    lc = 0;
-    debug = interp->code->debugs;
-    for (i = 0; i < interp->code->base.size; i++) {
-        if (jit_info->arena.op_map[i].ptr) {
-            op_info_t* op = &interp->op_info_table[
-                interp->code->base.data[i]];
-            if (interp->code->debugs) {
-                if (lc >= (int)(debug->base.size))
-                    break;
-                line = (int)debug->base.data[lc++];
-            }
-            fprintf(stabs, ".stabn " N_SLINE ",0,%d,%d /* %s */\n", line,
-                    (int)((char *)jit_info->arena.op_map[i].ptr -
-                    (char *)jit_info->arena.start),
-                    op->full_name);
-            line++;
-        }
-    }
-    /* eof */
-    fprintf(stabs, ".stabs \"\"," N_FUN ",0,1,%p\n",
-            (char *) jit_info->arena.size);
-    fclose(stabs);
-
-    /* run the stabs file through C<as> generating file.o */
-    cmd = Parrot_sprintf_c(interp, "as %Ss -o %Ss", stabsfile, ofile);
-
-    {
-        char * const temp   = Parrot_str_to_cstring(interp, cmd);
-        int          status = system(temp);
-        if (status)
-            fprintf(stderr, "Assembly failed: %d\n%s\n", status, temp);
-        Parrot_str_free_cstring(temp);
-    }
-}
-
-/*
-
-=item C<void
-Parrot_jit_debug(PARROT_INTERP)>
-
-Writes the JIT debugging stabs. Just calls C<Parrot_jit_debug_stabs()>.
-
-=cut
-
-*/
-
-void
-Parrot_jit_debug(PARROT_INTERP)
-{
-    Parrot_jit_debug_stabs(interp);
-}
-
-
-#endif
-
-/*
-
-=back
-
-=head1 SEE ALSO
-
-F<src/jit.c>, F<include/parrot/jit.h>, F<docs/jit.pod>.
-
-=cut
-
-*/
-
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/jit_debug_xcoff.c
==============================================================================
--- branches/orderedhash_revamp/src/jit_debug_xcoff.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,381 +0,0 @@
-/*
-Copyright (C) 2001-2008, Parrot Foundation.
-$Id$
-
-=head1 NAME
-
-src/jit_debug_xcoff.c - XCOFF stabs for JIT
-
-=head1 DESCRIPTION
-
-Write an XCOFF stabs file for JIT code. This file is based on
-F<src/jit_debug.c>.
-
-Stabs is a file format for information that describes a program to a
-debugger.
-
-For more information see the stabs documentation at
-http://sources.redhat.com/gdb/current/onlinedocs/stabs_toc.html.
-
-=head2 Functions
-
-=over 4
-
-=cut
-
-*/
-
-/* HEADERIZER HFILE: none */
-/* HEADERIZER STOP */
-
-#include <parrot/parrot.h>
-#include "parrot/exec.h"
-#include "jit.h"
-
-#ifdef __IBMC__
-
-/* following from /usr/include/dbxstclass.h */
-#  define C_GSYM        "0x80" /* global variable */
-#  define C_LSYM        "0x81" /* stack variable */
-#  define C_PSYM        "0x82" /* parameter */
-#  define C_RSYM        "0x83" /* register variable */
-#  define C_RPSYM       "0x84"
-#  define C_STSYM       "0x85" /* variable in data section */
-#  define C_TCSYM       "0x86"
-#  define C_BCOMM       "0x87"
-#  define C_ECOML       "0x88"
-#  define C_ECOMM       "0x89"
-#  define C_DECL        "0x8c" /* type declaration */
-#  define C_ENTRY       "0x8d"
-#  define C_FUN         "0x8e"
-#  define C_BSTAT       "0x8f"
-#  define C_ESTAT       "0x90"
-
-void Parrot_jit_debug(PARROT_INTERP);
-
-#  define BIT_SIZE(t) ((int)(sizeof (t)*8))
-#  define BYTE_SIZE(t) ((int)sizeof (t))
-#  define BIT_OFFSET(str, field) ((int)(offsetof((str), (field)) * 8))
-
-typedef struct BaseTypes {
-    const char *name;
-    const char *spec;
-} BaseTypes;
-
-/*
-
-=item C<static void write_types(FILE *stabs, PARROT_INTERP)>
-
-Writes the types to C<stabs>.
-
-=cut
-
-*/
-
-static void
-write_types(FILE *stabs, PARROT_INTERP)
-{
-    int i, j;
-    /* borrowed from mono */
-    static BaseTypes base_types[] = {
-            {"Char", "-6"},
-            {"Byte", "-5"},
-            {"Int16", "-3"},
-            {"UInt16", "-7"},
-            {"Int32", "-1"}, /* 5 */
-            {"UInt32", "-8"},
-            {"Int64", ";01000000000000000000000;0777777777777777777777;"},
-            {"UInt64", ";0000000000000;01777777777777777777777;"},
-            {"Single", "-12"},
-            {"Double", "-13"},  /* 10 */
-            {"LongDouble", "-14"},
-#  if INTVAL_SIZE == 4
-            {"INTVAL", "5;"},       /* 12 */
-#  else
-            {"INTVAL", "7;"},
-#  endif
-#  if NUMVAL_SIZE == 8
-            {"FLOATVAL", "10;"},    /* 13 */
-#  else
-            {"FLOATVAL", "11;"},
-#  endif
-            {"Ptr", "*0;"},
-            {"CharPtr", "*1;"},     /* 15 */
-            {0, 0}
-        };
-    for (i = 0; base_types[i].name; ++i) {
-        if (! base_types[i].spec)
-            continue;
-        fprintf(stabs, ".stabx \"%s:t%d=", base_types[i].name, i);
-        if (base_types[i].spec [0] == ';') {
-            fprintf(stabs, "r%d%s\"", i, base_types[i].spec);
-        }
-        else {
-            fprintf(stabs, "%s\"", base_types[i].spec);
-        }
-        fprintf(stabs, ",0," C_DECL ",0\n");
-    }
-    fprintf(stabs, ".stabx \"STRING:t%d=*%d\""
-                ",0," C_DECL ",0\n", i, i+1);
-    ++i;
-    fprintf(stabs, ".stabx \"Parrot_String:T%d=s%d"
-                "bufstart:14,%d,%d;"
-                "buflen:6,%d,%d;"   /* XXX type */
-                "flags:12,%d,%d;"
-                "bufused:12,%d,%d;"
-                "strstart:15,%d,%d;"        /* fake a char* */
-                ";\""
-                ",0," C_DECL ",0\n", i++, BYTE_SIZE(STRING),
-                BIT_OFFSET(STRING, cache._b._bufstart), BIT_SIZE(void*),
-                BIT_OFFSET(STRING, cache._b._buflen), BIT_SIZE(size_t),
-                BIT_OFFSET(STRING, flags), BIT_SIZE(UINTVAL),
-                BIT_OFFSET(STRING, bufused), BIT_SIZE(UINTVAL),
-                BIT_OFFSET(STRING, strstart), BIT_SIZE(void*));
-
-    fprintf(stabs, ".stabx \"PMCType:T%d=e", i++);
-    for (j = 0; j < interp->n_vtable_max; ++j) {
-        if (interp->vtables[j] && interp->vtables[j]->whoami) {
-            STRING* name = interp->vtables[j]->whoami;
-            fwrite(name->strstart, name->strlen, 1, stabs);
-            fprintf(stabs, ":%d,", j);
-        }
-    }
-    fprintf(stabs, ";\",0," C_DECL ",0\n");
-
-    /* PMC type */
-    fprintf(stabs, ".stabx \"PMC:T%d=s%d", i, BYTE_SIZE(PMC));
-    fprintf(stabs, "cache:%d,%d,%d;",
-            i + 1, BIT_OFFSET(PMC, cache), BIT_SIZE(UnionVal));
-    fprintf(stabs, "flags:%d,%d,%d;",
-            i + 1, BIT_OFFSET(PMC, flags), BIT_SIZE(Parrot_UInt));
-    fprintf(stabs, "vtable:*%d,%d,%d;",
-            i + 3, BIT_OFFSET(PMC, vtable), BIT_SIZE(void*));
-    fprintf(stabs, "data:14,%d,%d;",
-            BIT_OFFSET(PMC, data), BIT_SIZE(void*));
-    fprintf(stabs, "pmc_ext:*%d,%d,%d;",
-            i, BIT_OFFSET(PMC, pmc_ext), BIT_SIZE(void*));
-    fprintf(stabs, ";\"");
-    fprintf(stabs, ",0," C_DECL ",0\n");
-
-    fprintf(stabs, ".stabx \"cache:%d,%d,%d;"
-                "flags:12,%d,%d;"
-                ";\""
-                ",0," C_DECL ",0\n",
-                i + 2, BIT_SIZE(UnionVal), BIT_SIZE(Parrot_UInt));
-    fprintf(stabs, ".stabx \"UnionVal:T%d=u%d"
-                "int_val:12,%d,%d;"
-                "pmc_val:*%d,%d,%d;"
-                ";\""
-                ",0," C_DECL ",0\n", i + 2, BYTE_SIZE(UnionVal),
-                BIT_OFFSET(UnionVal, int_val), BIT_SIZE(INTVAL),
-                i, BIT_OFFSET(UnionVal, pmc_val), BIT_SIZE(void*));
-    fprintf(stabs, ".stabx \"VTABLE:T%d=s%d"
-                "base_type:%d,%d,%d;"
-                ";\""
-                ",0," C_DECL ",0\n", i + 3, BYTE_SIZE(UnionVal),
-                i - 1, BIT_OFFSET(VTABLE, base_type), BIT_SIZE(INTVAL));
-    i += 4;
-
-}
-
-/*
-
-=item C<static void
-write_vars(FILE *stabs, PARROT_INTERP)>
-
-Writes the contents of the registers to C<stabs>.
-
-=cut
-
-*/
-
-static void
-write_vars(FILE *stabs, PARROT_INTERP)
-{
-    int i;
-    /* fake static var stabs */
-    fprintf(stabs, ".bs parrot_jit_vars\n");
-    for (i = 0; i < NUM_REGISTERS; i++) {
-        fprintf(stabs, ".stabx \"I%d:V12\",0x%p," C_STSYM ",0\n", i,
-                (char*)&REG_INT(interp, i));
-        fprintf(stabs, ".stabx \"N%d:V13\",0x%p," C_STSYM ",0\n", i,
-                (char*)&REG_NUM(interp, i));
-        fprintf(stabs, ".stabx \"S%d:V16\",0x%p," C_STSYM ",0\n", i,
-                (char*)&REG_STR(interp, i));
-        fprintf(stabs, ".stabx \"P%d:V19\",0x%p," C_STSYM ",0\n", i,
-                (char*)&REG_PMC(interp, i));
-    }
-    fprintf(stabs, ".es\n");
-}
-
-/*
-
-=item C<static STRING *
-debug_file(PARROT_INTERP, STRING *file, const char *ext)>
-
-Returns C<file> with C<ext> appended.
-
-=cut
-
-*/
-
-static STRING *
-debug_file(PARROT_INTERP, STRING *file, const char *ext)
-{
-    STRING *ret;
-    ret = Parrot_str_copy(interp, file);
-    ret = Parrot_str_append(interp, ret,
-            string_make(interp, ext, strlen(ext), NULL,
-                PObj_external_FLAG));
-    return ret;
-}
-
-/*
-
-=item C<static void
-Parrot_jit_debug_stabs(PARROT_INTERP)>
-
-Writes the JIT debugging stabs.
-
-=cut
-
-*/
-
-static void
-Parrot_jit_debug_stabs(PARROT_INTERP)
-{
-    Parrot_jit_info_t *jit_info = interp->jit_info;
-    STRING *file = NULL;
-    STRING *pasmfile, *stabsfile, *ofile, *cmd;
-    FILE *stabs;
-    size_t i;
-    int line;
-    opcode_t lc;
-
-    if (interp->code->debugs) {
-        char *ext;
-        char * const src = Parrot_str_to_cstring(interp,
-            Parrot_debug_pc_to_filename(interp,
-            interp->code->debugs, 0));
-        pasmfile = string_make(interp, src, strlen(src), NULL,
-                PObj_external_FLAG);
-        file = Parrot_str_copy(interp, pasmfile);
-        /* chop pasm/pir */
-
-        ext = strrchr(src, '.');
-        if (ext && STREQ(ext, ".pasm"))
-            Parrot_str_chopn_inplace(interp, file, 4);
-        else if (ext && STREQ(ext, ".pir"))
-            Parrot_str_chopn_inplace(interp, file, 3);
-        else if (!ext) /* EVAL_n */
-            file = Parrot_str_append(interp, file,
-                    string_make(interp, ".", 1, NULL, PObj_external_FLAG));
-        Parrot_str_free_cstring(src);
-    }
-    else {
-        /* chop pbc */
-        Parrot_str_chopn_inplace(interp, file, 3);
-        pasmfile = debug_file(interp, file, "pasm");
-    }
-    stabsfile = debug_file(interp, file, "stabs.s");
-    ofile = debug_file(interp, file, "o");
-    {
-        char * const temp = Parrot_str_to_cstring(interp, stabsfile);
-        stabs      = fopen(temp, "w");
-        Parrot_str_free_cstring(temp);
-    }
-    if (stabs == NULL)
-        return;
-
-    {
-        char * const temp = Parrot_str_to_cstring(interp, pasmfile);
-        /* filename info */
-        fprintf(stabs, ".file \"%s\"\n", temp);
-        Parrot_str_free_cstring(temp);
-    }
-    /* declare function name */
-    fprintf(stabs, ".jit_func:\n");
-    /* jit_func start addr */
-    fprintf(stabs, ".stabx \"jit_func:F1\",0x%p," C_FUN ",0\n",
-            jit_info->arena.start);
-    fprintf(stabs, ".function .jit_func,.jit_func,0,0\n");
-    fprintf(stabs, ".bf 1\n");
-
-    write_types(stabs, interp);
-    write_vars(stabs, interp);
-    /* if we don't have line numbers, emit dummys, assuming there are
-     * no comments and spaces in source for testing
-     */
-
-    /* jit_begin */
-    fprintf(stabs, ".line 1\n");
-    line = 1;
-    lc = 0;
-    for (i = 0; i < interp->code->base.size; i++) {
-        if (jit_info->arena.op_map[i].ptr) {
-            op_info_t* op = &interp->op_info_table[
-                interp->code->base.data[i]];
-            if (interp->code->debugs) {
-                line = (int)interp->code->debugs->base.data[lc++];
-            }
-            fprintf(stabs, ".line %d # 0x%p %s\n", line,
-                    (int)((char *)jit_info->arena.op_map[i].ptr -
-                    (char *)jit_info->arena.start),
-                    op->full_name);
-            line++;
-        }
-    }
-    /* eof */
-    fprintf(stabs, ".stabx \"\",0x%p," C_FUN ",0\n",
-            (char *) jit_info->arena.size);
-    fprintf(stabs, ".ef %d\n", line);
-    fclose(stabs);
-    /* run the stabs file through C<as> generating file.o */
-    cmd = Parrot_sprintf_c(interp, "as %Ss -o %Ss", stabsfile, ofile);
-
-    {
-        char * const temp = Parrot_str_to_cstring(interp, cmd);
-        system(temp);
-        Parrot_str_free_cstring(temp);
-    }
-}
-
-/*
-
-=item C<void
-Parrot_jit_debug(PARROT_INTERP)>
-
-Writes the JIT debugging stabs. Just calls C<Parrot_jit_debug_stabs()>.
-
-=cut
-
-*/
-
-void
-Parrot_jit_debug(PARROT_INTERP)
-{
-    Parrot_jit_debug_stabs(interp);
-}
-
-#endif
-
-
-/*
-
-=back
-
-=head1 SEE ALSO
-
-F<src/jit_debug.c>, F<src/jit.c>, F<src/jit.h>.
-
-=cut
-
-*/
-
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Modified: branches/orderedhash_revamp/src/key.c
==============================================================================
--- branches/orderedhash_revamp/src/key.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/key.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -22,6 +22,7 @@
 #include "parrot/key.h"
 #include "key.str"
 #include "pmc/pmc_key.h"
+#include "pmc/pmc_callcontext.h"
 
 /* HEADERIZER HFILE: include/parrot/key.h */
 
@@ -332,50 +333,40 @@
     FLOATVAL num_key;
 
     switch (PObj_get_FLAGS(key) & KEY_type_FLAGS) {
-        case KEY_hash_iterator_FLAGS:
-
-        case KEY_integer_FLAG:
-            GETATTR_Key_int_key(interp, key, int_key);
-            return int_key;
-        case KEY_integer_FLAG | KEY_register_FLAG:
-            GETATTR_Key_int_key(interp, key, int_key);
-            return REG_INT(interp, int_key);
+      case KEY_integer_FLAG:
+        GETATTR_Key_int_key(interp, key, int_key);
+        return int_key;
+      case KEY_integer_FLAG | KEY_register_FLAG:
+        GETATTR_Key_int_key(interp, key, int_key);
+        return REG_INT(interp, int_key);
 
-        case KEY_number_FLAG:
-            GETATTR_Key_num_key(interp, key, num_key);
-            return (INTVAL)num_key;
-        case KEY_number_FLAG | KEY_register_FLAG:
-            GETATTR_Key_int_key(interp, key, int_key);
-            return (INTVAL)REG_NUM(interp, int_key);
+      case KEY_number_FLAG:
+        GETATTR_Key_num_key(interp, key, num_key);
+        return (INTVAL)num_key;
+      case KEY_number_FLAG | KEY_register_FLAG:
+        GETATTR_Key_int_key(interp, key, int_key);
+        return (INTVAL)REG_NUM(interp, int_key);
 
-        case KEY_pmc_FLAG | KEY_register_FLAG:
-            {
+      case KEY_pmc_FLAG | KEY_register_FLAG:
+        {
             PMC *reg;
             GETATTR_Key_int_key(interp, key, int_key);
             reg = REG_PMC(interp, int_key);
             return VTABLE_get_integer(interp, reg);
-            }
+        }
 
-        case KEY_string_FLAG:
-            GETATTR_Key_str_key(interp, key, str_key);
-            return Parrot_str_to_int(interp, str_key);
-        case KEY_string_FLAG | KEY_register_FLAG:
-            {
+      case KEY_string_FLAG:
+        GETATTR_Key_str_key(interp, key, str_key);
+        return Parrot_str_to_int(interp, str_key);
+      case KEY_string_FLAG | KEY_register_FLAG:
+        {
             STRING *s_reg;
             GETATTR_Key_int_key(interp, key, int_key);
             s_reg = REG_STR(interp, int_key);
             return Parrot_str_to_int(interp, s_reg);
-            }
+        }
 
-        case KEY_string_FLAG | KEY_start_slice_FLAG:
-        case KEY_string_FLAG | KEY_inf_slice_FLAG:
-            {
-            STRING * const s_key = VTABLE_get_string(interp, key);
-            return Parrot_str_to_int(interp, s_key);
-            }
-        case KEY_start_slice_FLAG:
-        case KEY_inf_slice_FLAG:
-        default:
+      default:
             break;
     }
 
@@ -406,22 +397,22 @@
     FLOATVAL num_key;
 
     switch (PObj_get_FLAGS(key) & KEY_type_FLAGS) {
-    case KEY_number_FLAG:
+      case KEY_number_FLAG:
         GETATTR_Key_num_key(interp, key, num_key);
         return num_key;
-    case KEY_number_FLAG | KEY_register_FLAG:
+      case KEY_number_FLAG | KEY_register_FLAG:
         GETATTR_Key_int_key(interp, key, int_key);
         return REG_NUM(interp, int_key);
-    case KEY_pmc_FLAG:
+      case KEY_pmc_FLAG:
         return VTABLE_get_number(interp, key);
-    case KEY_pmc_FLAG | KEY_register_FLAG:
+      case KEY_pmc_FLAG | KEY_register_FLAG:
         {
-        PMC *reg;
-        GETATTR_Key_int_key(interp, key, int_key);
-        reg = REG_PMC(interp, int_key);
-        return VTABLE_get_number(interp, reg);
+            PMC *reg;
+            GETATTR_Key_int_key(interp, key, int_key);
+            reg = REG_PMC(interp, int_key);
+            return VTABLE_get_number(interp, reg);
         }
-    default:
+      default:
         Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
             "Key not a number!\n");
     }
@@ -448,7 +439,7 @@
 
     switch (PObj_get_FLAGS(key) & KEY_type_FLAGS) {
         /* remember to COW strings instead of returning them directly */
-        case KEY_string_FLAG:
+      case KEY_string_FLAG:
         {
             STRING *s;
             GETATTR_Key_str_key(interp, key, s);
@@ -456,7 +447,7 @@
                 s = Parrot_str_new_COW(interp, s);
             return s;
         }
-        case KEY_string_FLAG | KEY_register_FLAG:
+      case KEY_string_FLAG | KEY_register_FLAG:
         {
             INTVAL int_key;
             STRING *s;
@@ -466,7 +457,7 @@
                 s = Parrot_str_new_COW(interp, s);
             return s;
         }
-        case KEY_pmc_FLAG | KEY_register_FLAG:
+      case KEY_pmc_FLAG | KEY_register_FLAG:
         {
             INTVAL int_key;
             PMC *reg;
@@ -474,33 +465,33 @@
             reg = REG_PMC(interp, int_key);
             return VTABLE_get_string(interp, reg);
         }
-        case KEY_integer_FLAG:
+      case KEY_integer_FLAG:
         {
             INTVAL int_key;
             GETATTR_Key_int_key(interp, key, int_key);
             return Parrot_str_from_int(interp, int_key);
         }
-        case KEY_integer_FLAG | KEY_register_FLAG:
+      case KEY_integer_FLAG | KEY_register_FLAG:
         {
             INTVAL int_key;
             GETATTR_Key_int_key(interp, key, int_key);
             return Parrot_str_from_int(interp, REG_INT(interp, int_key));
         }
-        case KEY_number_FLAG:
+      case KEY_number_FLAG:
         {
             FLOATVAL num_key;
             GETATTR_Key_num_key(interp, key, num_key);
             return Parrot_str_from_num(interp, num_key);
         }
-        case KEY_number_FLAG | KEY_register_FLAG:
+      case KEY_number_FLAG | KEY_register_FLAG:
         {
             INTVAL int_key;
             GETATTR_Key_int_key(interp, key, int_key);
             return Parrot_str_from_num(interp, REG_NUM(interp, int_key));
         }
-        default:
-        case KEY_pmc_FLAG:
-            return VTABLE_get_string(interp, key);
+      default:
+      case KEY_pmc_FLAG:
+        return VTABLE_get_string(interp, key);
     }
 }
 
@@ -526,10 +517,10 @@
     INTVAL int_key;
 
     switch (PObj_get_FLAGS(key) & KEY_type_FLAGS) {
-    case KEY_pmc_FLAG | KEY_register_FLAG:
+      case KEY_pmc_FLAG | KEY_register_FLAG:
         GETATTR_Key_int_key(interp, key, int_key);
         return REG_PMC(interp, int_key);
-    default:
+      default:
         return key;
     }
 }
@@ -554,7 +545,7 @@
     ASSERT_ARGS(key_next)
     PMC *next_key;
 
-    if (VTABLE_isa(interp, key, CONST_STRING(interp, "Key")) && key->pmc_ext) {
+    if (VTABLE_isa(interp, key, CONST_STRING(interp, "Key"))) {
         GETATTR_Key_next_key(interp, key, next_key);
         return next_key;
     }
@@ -616,28 +607,19 @@
 key_mark(PARROT_INTERP, ARGIN(PMC *key))
 {
     ASSERT_ARGS(key_mark)
+    PMC          *next_key;
     const UINTVAL flags = PObj_get_FLAGS(key) & KEY_type_FLAGS;
 
     if (flags == KEY_string_FLAG) {
         STRING *str_key;
         GETATTR_Key_str_key(interp, key, str_key);
-
-        /* XXX str_key can be NULL from GETATTR_Key_str_key, */
-        /* so shouldn't be marked. */
-        Parrot_gc_mark_PObj_alive(interp, (PObj *)str_key);
+        Parrot_gc_mark_STRING_alive(interp, str_key);
     }
 
-    /*
-     * KEY_hash_iterator_FLAGS denote a hash key iteration, PMC_data() is
-     * the bucket_index and not the next key component
-     * Note to self: shoot whoever thought this was a good idea.
-     */
-    if (flags != KEY_hash_iterator_FLAGS) {
-        PMC *next_key;
-        /* if iteration hasn't started, above flag isn't set yet */
+    /* Mark next key */
+    if ((flags == KEY_string_FLAG) || (flags == KEY_pmc_FLAG)) {
         GETATTR_Key_next_key(interp, key, next_key);
-        if (next_key && (void *)next_key != (void *)INITBucketIndex)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)next_key);
+        Parrot_gc_mark_PMC_alive(interp, next_key);
     }
 
 }
@@ -671,57 +653,57 @@
 
     while (key != NULL) {
         switch (PObj_get_FLAGS(key) & KEY_type_FLAGS) {
-            case KEY_integer_FLAG:
-                GETATTR_Key_int_key(interp, key, int_key);
-                value = Parrot_str_append(interp, value,
+          case KEY_integer_FLAG:
+            GETATTR_Key_int_key(interp, key, int_key);
+            value = Parrot_str_append(interp, value,
                     Parrot_str_from_int(interp, int_key));
-                break;
-            case KEY_number_FLAG:
-                GETATTR_Key_int_key(interp, key, int_key);
-                value = Parrot_str_append(interp, value,
+            break;
+          case KEY_number_FLAG:
+            GETATTR_Key_int_key(interp, key, int_key);
+            value = Parrot_str_append(interp, value,
                     Parrot_str_from_num(interp, (FLOATVAL)int_key));
-                break;
-            case KEY_string_FLAG:
-                GETATTR_Key_str_key(interp, key, str_key);
-                value = Parrot_str_append(interp, value, quote);
-                value = Parrot_str_append(interp, value, str_key);
-                value = Parrot_str_append(interp, value, quote);
-                break;
-            case KEY_pmc_FLAG:
-                value = Parrot_str_append(interp, value,
+            break;
+          case KEY_string_FLAG:
+            GETATTR_Key_str_key(interp, key, str_key);
+            value = Parrot_str_append(interp, value, quote);
+            value = Parrot_str_append(interp, value, str_key);
+            value = Parrot_str_append(interp, value, quote);
+            break;
+          case KEY_pmc_FLAG:
+            value = Parrot_str_append(interp, value,
                     VTABLE_get_string(interp, key));
-                break;
-            case KEY_integer_FLAG | KEY_register_FLAG:
-                GETATTR_Key_int_key(interp, key, int_key);
-                value = Parrot_str_append(interp, value,
+            break;
+          case KEY_integer_FLAG | KEY_register_FLAG:
+            GETATTR_Key_int_key(interp, key, int_key);
+            value = Parrot_str_append(interp, value,
                         Parrot_str_from_int(interp,
                             REG_INT(interp, int_key)));
-                break;
-            case KEY_number_FLAG | KEY_register_FLAG:
-                GETATTR_Key_int_key(interp, key, int_key);
-                value = Parrot_str_append(interp, value,
+            break;
+          case KEY_number_FLAG | KEY_register_FLAG:
+            GETATTR_Key_int_key(interp, key, int_key);
+            value = Parrot_str_append(interp, value,
                         Parrot_str_from_num(interp,
                             REG_NUM(interp, int_key)));
-                break;
-            case KEY_string_FLAG | KEY_register_FLAG:
-                value = Parrot_str_append(interp, value, quote);
-                GETATTR_Key_int_key(interp, key, int_key);
-                value = Parrot_str_append(interp, value,
+            break;
+          case KEY_string_FLAG | KEY_register_FLAG:
+            value = Parrot_str_append(interp, value, quote);
+            GETATTR_Key_int_key(interp, key, int_key);
+            value = Parrot_str_append(interp, value,
                     REG_STR(interp, int_key));
-                value = Parrot_str_append(interp, value, quote);
-                break;
-            case KEY_pmc_FLAG | KEY_register_FLAG:
-                {
+            value = Parrot_str_append(interp, value, quote);
+            break;
+          case KEY_pmc_FLAG | KEY_register_FLAG:
+            {
                 PMC *reg;
                 GETATTR_Key_int_key(interp, key, int_key);
                 reg = REG_PMC(interp, int_key);
                 value           = Parrot_str_append(interp, value,
                                     VTABLE_get_string(interp, reg));
-                }
-                break;
-            default:
-                value = Parrot_str_append(interp, value, CONST_STRING(interp, "Key type unknown"));
-                break;
+            }
+            break;
+          default:
+            value = Parrot_str_append(interp, value, CONST_STRING(interp, "Key type unknown"));
+            break;
         }
 
         GETATTR_Key_next_key(interp, key, next_key);

Modified: branches/orderedhash_revamp/src/library.c
==============================================================================
--- branches/orderedhash_revamp/src/library.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/library.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -93,33 +93,33 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(* path);
 
-#define ASSERT_ARGS_cnv_to_win32_filesep __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(path)
-#define ASSERT_ARGS_get_search_paths __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_is_abs_path __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(file)
-#define ASSERT_ARGS_path_append __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_cnv_to_win32_filesep __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(path))
+#define ASSERT_ARGS_get_search_paths __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_is_abs_path __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(file))
+#define ASSERT_ARGS_path_append __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(l_path) \
-    || PARROT_ASSERT_ARG(r_path)
-#define ASSERT_ARGS_path_concat __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(l_path) \
+    , PARROT_ASSERT_ARG(r_path))
+#define ASSERT_ARGS_path_concat __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(l_path) \
-    || PARROT_ASSERT_ARG(r_path)
-#define ASSERT_ARGS_path_finalize __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(l_path) \
+    , PARROT_ASSERT_ARG(r_path))
+#define ASSERT_ARGS_path_finalize __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(path)
+    , PARROT_ASSERT_ARG(path))
 #define ASSERT_ARGS_path_guarantee_trailing_separator \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(path)
-#define ASSERT_ARGS_try_bytecode_extensions __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(path))
+#define ASSERT_ARGS_try_bytecode_extensions __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(path)
-#define ASSERT_ARGS_try_load_path __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(path))
+#define ASSERT_ARGS_try_load_path __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(path)
+    , PARROT_ASSERT_ARG(path))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -159,37 +159,50 @@
 parrot_init_library_paths(PARROT_INTERP)
 {
     ASSERT_ARGS(parrot_init_library_paths)
-    PMC *paths;
+    PMC    *paths;
     STRING *entry;
-    STRING *versionlib = NULL;
-
-    PMC * const iglobals = interp->iglobals;
-    PMC * const config_hash =
-            VTABLE_get_pmc_keyed_int(interp, iglobals, (INTVAL) IGLOBALS_CONFIG_HASH);
+    STRING *versionlib      = NULL;
+    STRING *builddir        = NULL;
+    PMC * const iglobals    = interp->iglobals;
+    PMC * const config_hash = VTABLE_get_pmc_keyed_int(interp, iglobals,
+                                (INTVAL)IGLOBALS_CONFIG_HASH);
 
     /* create the lib_paths array */
-    PMC * const lib_paths = pmc_new(interp, enum_class_FixedPMCArray);
+    PMC * const lib_paths   = pmc_new(interp, enum_class_FixedPMCArray);
+
     VTABLE_set_integer_native(interp, lib_paths, PARROT_LIB_PATH_SIZE);
     VTABLE_set_pmc_keyed_int(interp, iglobals,
             IGLOBALS_LIB_PATHS, lib_paths);
 
+    if (VTABLE_elements(interp, config_hash)) {
+        STRING * const libkey      = CONST_STRING(interp, "libdir");
+        STRING * const verkey      = CONST_STRING(interp, "versiondir");
+        STRING * const builddirkey = CONST_STRING(interp, "build_dir");
+        STRING * const installed   = CONST_STRING(interp, "installed");
+
+        versionlib = VTABLE_get_string_keyed_str(interp, config_hash, libkey);
+        entry      = VTABLE_get_string_keyed_str(interp, config_hash, verkey);
+        versionlib = Parrot_str_append(interp, versionlib, entry);
+
+        if (!VTABLE_get_integer_keyed_str(interp, config_hash, installed))
+            builddir = VTABLE_get_string_keyed_str(interp,
+                                config_hash, builddirkey);
+    }
+
     /* each is an array of strings */
     /* define include paths */
     paths = pmc_new(interp, enum_class_ResizableStringArray);
     VTABLE_set_pmc_keyed_int(interp, lib_paths,
             PARROT_LIB_PATH_INCLUDE, paths);
-    entry = CONST_STRING(interp, "runtime/parrot/include/");
-    VTABLE_push_string(interp, paths, entry);
-    entry = CONST_STRING(interp, "runtime/parrot/");
-    VTABLE_push_string(interp, paths, entry);
+    if (!STRING_IS_NULL(builddir)) {
+        entry = Parrot_str_concat(interp, builddir, CONST_STRING(interp, "/"), 0);
+        VTABLE_push_string(interp, paths, entry);
+        entry = Parrot_str_concat(interp, builddir, CONST_STRING(interp, "/runtime/parrot/include/"), 0);
+        VTABLE_push_string(interp, paths, entry);
+    }
     entry = CONST_STRING(interp, "./");
     VTABLE_push_string(interp, paths, entry);
-    if (VTABLE_elements(interp, config_hash)) {
-        STRING * const libkey = CONST_STRING(interp, "libdir");
-        STRING * const verkey = CONST_STRING(interp, "versiondir");
-        versionlib = VTABLE_get_string_keyed_str(interp, config_hash, libkey);
-        entry = VTABLE_get_string_keyed_str(interp, config_hash, verkey);
-        versionlib = Parrot_str_append(interp, versionlib, entry);
+    if (!STRING_IS_NULL(versionlib)) {
         entry = Parrot_str_concat(interp, versionlib, CONST_STRING(interp, "/include/"), 0);
         VTABLE_push_string(interp, paths, entry);
     }
@@ -199,10 +212,10 @@
     paths = pmc_new(interp, enum_class_ResizableStringArray);
     VTABLE_set_pmc_keyed_int(interp, lib_paths,
             PARROT_LIB_PATH_LIBRARY, paths);
-    entry = CONST_STRING(interp, "runtime/parrot/library/");
-    VTABLE_push_string(interp, paths, entry);
-    entry = CONST_STRING(interp, "runtime/parrot/");
-    VTABLE_push_string(interp, paths, entry);
+    if (!STRING_IS_NULL(builddir)) {
+        entry = Parrot_str_concat(interp, builddir, CONST_STRING(interp, "/runtime/parrot/library/"), 0);
+        VTABLE_push_string(interp, paths, entry);
+    }
     entry = CONST_STRING(interp, "./");
     VTABLE_push_string(interp, paths, entry);
     if (!STRING_IS_NULL(versionlib)) {
@@ -214,8 +227,10 @@
     paths = pmc_new(interp, enum_class_ResizableStringArray);
     VTABLE_set_pmc_keyed_int(interp, lib_paths,
             PARROT_LIB_PATH_LANG, paths);
-    entry = CONST_STRING(interp, "runtime/parrot/languages/");
-    VTABLE_push_string(interp, paths, entry);
+    if (!STRING_IS_NULL(builddir)) {
+        entry = Parrot_str_concat(interp, builddir, CONST_STRING(interp, "/runtime/parrot/languages/"), 0);
+        VTABLE_push_string(interp, paths, entry);
+    }
     entry = CONST_STRING(interp, "./");
     VTABLE_push_string(interp, paths, entry);
     if (!STRING_IS_NULL(versionlib)) {
@@ -227,8 +242,10 @@
     paths = pmc_new(interp, enum_class_ResizableStringArray);
     VTABLE_set_pmc_keyed_int(interp, lib_paths,
             PARROT_LIB_PATH_DYNEXT, paths);
-    entry = CONST_STRING(interp, "runtime/parrot/dynext/");
-    VTABLE_push_string(interp, paths, entry);
+    if (!STRING_IS_NULL(builddir)) {
+        entry = Parrot_str_concat(interp, builddir, CONST_STRING(interp, "/runtime/parrot/dynext/"), 0);
+        VTABLE_push_string(interp, paths, entry);
+    }
     entry = CONST_STRING(interp, "dynext/");
     VTABLE_push_string(interp, paths, entry);
     if (!STRING_IS_NULL(versionlib)) {
@@ -311,7 +328,7 @@
 is_abs_path(ARGIN(const STRING *file))
 {
     ASSERT_ARGS(is_abs_path)
-    const char * const file_name = file->strstart;
+    const char * const file_name = (const char *)file->strstart;
     if (file->strlen <= 1)
         return 0;
     PARROT_ASSERT(file->encoding == Parrot_fixed_8_encoding_ptr ||
@@ -614,7 +631,7 @@
     PMC * const lib_paths = VTABLE_get_pmc_keyed_int(interp, iglobals,
         IGLOBALS_LIB_PATHS);
     PMC * const paths = VTABLE_get_pmc_keyed_int(interp, lib_paths, which);
-    VTABLE_push_string(interp, paths, path_str);
+    VTABLE_unshift_string(interp, paths, path_str);
 }
 
 /*
@@ -644,9 +661,7 @@
 =item C<STRING* Parrot_locate_runtime_file_str(PARROT_INTERP, STRING *file,
 enum_runtime_ft type)>
 
-Locate the full path for C<file_name> and the given file type(s). If
-successful, returns a C-string allocated with C<Parrot_str_to_cstring> or
-NULL otherwise.  Remember to free the string with C<Parrot_str_free_cstring()>.
+Locate the full path for C<file_name> and the given file type(s).
 
 The C<enum_runtime_ft type> is one or more of the types defined in
 F<include/parrot/library.h>.
@@ -771,7 +786,7 @@
 must free it.
 
 This function is deprecated, use Parrot_get_runtime_path instead.
-See RT#58988
+See TT #1191
 
 =cut
 
@@ -784,11 +799,10 @@
 Parrot_get_runtime_prefix(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_get_runtime_prefix)
-    int     free_it;
-    char * const env = Parrot_getenv("PARROT_RUNTIME", &free_it);
+    char * const env = Parrot_getenv(interp, CONST_STRING(interp, "PARROT_RUNTIME"));
 
     if (env)
-        return free_it ? env : mem_sys_strdup(env);
+        return env;
     else {
         PMC    * const config_hash =
             VTABLE_get_pmc_keyed_int(interp, interp->iglobals, (INTVAL) IGLOBALS_CONFIG_HASH);
@@ -819,15 +833,12 @@
 Parrot_get_runtime_path(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_get_runtime_path)
-    int     free_it;
-    char * const env = Parrot_getenv("PARROT_RUNTIME", &free_it);
+    char * const env = Parrot_getenv(interp, CONST_STRING(interp, "PARROT_RUNTIME"));
     STRING *result;
 
     if (env)
     {
         result = Parrot_str_new(interp, env, 0);
-        if (free_it)
-             free(env);
     }
     else {
         PMC    * const config_hash =

Modified: branches/orderedhash_revamp/src/list.c
==============================================================================
--- branches/orderedhash_revamp/src/list.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/list.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -132,7 +132,7 @@
 A List can hold various datatypes. See F<src/datatypes.h> for the
 enumeration of types.
 
-Not all are yet implemented in C<list_set>/C<list_item>, see the
+Not all are yet implemented in C<Parrot_pmc_array_set>/C<Parrot_pmc_array_item>, see the
 C<switch()>.
 
 Arbitrary length data:
@@ -149,10 +149,10 @@
 
 =back
 
-In C<list_assign> the values are copied into the array, C<list_get>
+In C<Parrot_pmc_array_assign> the values are copied into the array, C<Parrot_pmc_array_get>
 returns a pointer as for all other data types.
 
-See F<src/list_2.t> and C<list_new_init()>.
+See F<src/list_2.t> and C<Parrot_pmc_array_new_init()>.
 
 =head2 Return value
 
@@ -237,7 +237,7 @@
         FUNC_MODIFIES(*list)
         FUNC_MODIFIES(*idx);
 
-static void list_append(PARROT_INTERP,
+static void Parrot_pmc_array_append(PARROT_INTERP,
     ARGMOD(List *list),
     ARGIN_NULLOK(void *item),
     int type,
@@ -248,7 +248,7 @@
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-static void * list_item(PARROT_INTERP,
+static void * Parrot_pmc_array_item(PARROT_INTERP,
     ARGMOD(List *list),
     int type,
     INTVAL idx)
@@ -256,7 +256,7 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*list);
 
-static void list_set(PARROT_INTERP,
+static void Parrot_pmc_array_set(PARROT_INTERP,
     ARGMOD(List *list),
     ARGIN_NULLOK(void *item),
     INTVAL type,
@@ -297,56 +297,56 @@
         FUNC_MODIFIES(*list)
         FUNC_MODIFIES(*chunk);
 
-#define ASSERT_ARGS_add_chunk_at_end __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_add_chunk_at_end __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_add_chunk_at_start __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(list))
+#define ASSERT_ARGS_add_chunk_at_start __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_alloc_next_size __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(list))
+#define ASSERT_ARGS_alloc_next_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_allocate_chunk __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(list))
+#define ASSERT_ARGS_allocate_chunk __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_get_chunk __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(list))
+#define ASSERT_ARGS_get_chunk __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(list) \
-    || PARROT_ASSERT_ARG(idx)
-#define ASSERT_ARGS_list_append __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(list) \
+    , PARROT_ASSERT_ARG(idx))
+#define ASSERT_ARGS_Parrot_pmc_array_append __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_list_item __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(list))
+#define ASSERT_ARGS_Parrot_pmc_array_item __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_list_set __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(list))
+#define ASSERT_ARGS_Parrot_pmc_array_set __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_rebuild_chunk_list __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(list))
+#define ASSERT_ARGS_rebuild_chunk_list __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_rebuild_chunk_ptrs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_rebuild_fix_ends __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_rebuild_other __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(list))
+#define ASSERT_ARGS_rebuild_chunk_ptrs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(list))
+#define ASSERT_ARGS_rebuild_fix_ends __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(list))
+#define ASSERT_ARGS_rebuild_other __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_rebuild_sparse __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(list)
-#define ASSERT_ARGS_split_chunk __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(list))
+#define ASSERT_ARGS_rebuild_sparse __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(list))
+#define ASSERT_ARGS_split_chunk __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(list) \
-    || PARROT_ASSERT_ARG(chunk)
+    , PARROT_ASSERT_ARG(list) \
+    , PARROT_ASSERT_ARG(chunk))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
 #define chunk_list_size(list) \
-                (PObj_buflen(&(list)->chunk_list) / sizeof (List_chunk *))
+                (Buffer_buflen(&(list)->chunk_list) / sizeof (List_chunk *))
 
 /* hide the ugly cast somehow: */
 #define chunk_list_ptr(list, idx) \
-        ((List_chunk**) PObj_bufstart(&(list)->chunk_list))[(idx)]
+        ((List_chunk**) Buffer_bufstart(&(list)->chunk_list))[(idx)]
 
 /*
 
@@ -381,11 +381,7 @@
     chunk->next     = NULL;
     chunk->prev     = NULL;
     Parrot_gc_allocate_buffer_storage_aligned(interp, (Buffer *)chunk, size);
-    memset(PObj_bufstart((Buffer*)chunk), 0, size);
-
-    /* see also src/hash.c */
-    if (list->container)
-        GC_WRITE_BARRIER(interp, list->container, 0, chunk);
+    memset(Buffer_bufstart((Buffer*)chunk), 0, size);
 
     Parrot_unblock_GC_mark(interp);
 
@@ -515,18 +511,14 @@
                 Parrot_gc_reallocate_buffer_storage(interp, (Buffer *)prev,
                         MAX_ITEMS * list->item_size);
 
-                if (list->container) {
-                    GC_WRITE_BARRIER(interp, list->container, 0, prev);
-                }
-
                 mem_sys_memmove(
-                        (char *) PObj_bufstart(&prev->data) +
+                        (char *) Buffer_bufstart(&prev->data) +
                         prev->items * list->item_size,
-                        (const char *) PObj_bufstart(&chunk->data),
+                        (const char *) Buffer_bufstart(&chunk->data),
                         (MAX_ITEMS - prev->items) * list->item_size);
                 mem_sys_memmove(
-                        (char *) PObj_bufstart(&chunk->data),
-                        (const char *) PObj_bufstart(&chunk->data) +
+                        (char *) Buffer_bufstart(&chunk->data),
+                        (const char *) Buffer_bufstart(&chunk->data) +
                         (MAX_ITEMS - prev->items) * list->item_size,
                         (chunk->items - (MAX_ITEMS - prev->items))
                                                         * list->item_size);
@@ -536,13 +528,11 @@
             else {
                 Parrot_gc_reallocate_buffer_storage(interp, (Buffer *)prev,
                         (prev->items + chunk->items) * list->item_size);
-                if (list->container) {
-                    GC_WRITE_BARRIER(interp, list->container, 0, prev);
-                }
+
                 mem_sys_memmove(
-                        (char *) PObj_bufstart(&prev->data) +
+                        (char *) Buffer_bufstart(&prev->data) +
                         prev->items * list->item_size,
-                        (const char *) PObj_bufstart(&chunk->data),
+                        (const char *) Buffer_bufstart(&chunk->data),
                         chunk->items * list->item_size);
                 prev->items += chunk->items;
                 chunk->items = 0;
@@ -583,8 +573,8 @@
 
         chunk->flags      = 0;
         list->grow_policy = enum_grow_unknown;
-        list->cap        += PObj_buflen(&chunk->data) / list->item_size - chunk->items;
-        chunk->items      = PObj_buflen(&chunk->data) / list->item_size;
+        list->cap        += Buffer_buflen(&chunk->data) / list->item_size - chunk->items;
+        chunk->items      = Buffer_buflen(&chunk->data) / list->item_size;
     }
 
     /* XXX - still needed? - if last is empty and last->prev not full then
@@ -636,10 +626,6 @@
         Parrot_gc_reallocate_buffer_storage(interp, (Buffer *)list,
                 len * sizeof (List_chunk *));
 
-        if (list->container) {
-            GC_WRITE_BARRIER(interp, list->container, 0, list);
-        }
-
         list->collect_runs = Parrot_gc_count_collect_runs(interp);
     }
 
@@ -975,7 +961,7 @@
 other. So the time to look up a chunk doesn't depend on the array
 length, but on the complexity of the array. C<rebuild_chunk_list> tries
 to reduce the complexity, but may fail, if you e.g. do a prime sieve by
-actually C<list_delet>ing the none prime numbers.
+actually C<Parrot_pmc_array_delet>ing the none prime numbers.
 
 The complexity of the array is how many different C<chunk_blocks> are
 there. They come from:
@@ -1009,10 +995,8 @@
     List_chunk *chunk;
     UINTVAL i;
 
-#ifndef GC_IS_MALLOC
     if (list->collect_runs != Parrot_gc_count_collect_runs(interp))
         rebuild_chunk_list(interp, list);
-#endif
 #ifdef SLOW_AND_BORING
     /* in SLOW_AND_BORING mode, we loop through each chunk, and determine if
        idx is in the chunk using basic bounds checking. If the loop completes
@@ -1135,10 +1119,6 @@
         Parrot_gc_reallocate_buffer_storage(interp, (Buffer *)chunk,
                 chunk->items * list->item_size);
 
-        if (list->container) {
-            GC_WRITE_BARRIER(interp, list->container, 0, chunk);
-        }
-
         chunk->flags |= no_power_2;
         chunk->flags &= ~sparse;
     }
@@ -1155,10 +1135,6 @@
         Parrot_gc_reallocate_buffer_storage(interp, (Buffer *)chunk,
                 chunk->items * list->item_size);
 
-        if (list->container) {
-            GC_WRITE_BARRIER(interp, list->container, 0, chunk);
-        }
-
         chunk->flags &= ~sparse;
 
         if (n3) {
@@ -1194,8 +1170,8 @@
 
 /*
 
-=item C<static void list_set(PARROT_INTERP, List *list, void *item, INTVAL type,
-INTVAL idx)>
+=item C<static void Parrot_pmc_array_set(PARROT_INTERP, List *list, void *item,
+INTVAL type, INTVAL idx)>
 
 Sets C<item> of type C<type> in chunk at C<idx>.
 
@@ -1204,10 +1180,10 @@
 */
 
 static void
-list_set(PARROT_INTERP, ARGMOD(List *list), ARGIN_NULLOK(void *item),
+Parrot_pmc_array_set(PARROT_INTERP, ARGMOD(List *list), ARGIN_NULLOK(void *item),
         INTVAL type, INTVAL idx)
 {
-    ASSERT_ARGS(list_set)
+    ASSERT_ARGS(Parrot_pmc_array_set)
     List_chunk  *chunk = get_chunk(interp, list, (UINTVAL *)&idx);
     const INTVAL oidx  = idx;
 
@@ -1225,38 +1201,33 @@
     }
 
     switch (type) {
-    case enum_type_sized:
+      case enum_type_sized:
         /* copy data into list */
-        memcpy(&((char *) PObj_bufstart(&chunk->data))[idx * list->item_size],
+        memcpy(&((char *) Buffer_bufstart(&chunk->data))[idx * list->item_size],
                 item, list->item_size);
         break;
-    case enum_type_char:
-        ((char *) PObj_bufstart(&chunk->data))[idx] = (char)PTR2INTVAL(item);
+      case enum_type_char:
+        ((char *) Buffer_bufstart(&chunk->data))[idx] = (char)PTR2INTVAL(item);
         break;
-    case enum_type_short:
-        ((short *) PObj_bufstart(&chunk->data))[idx] = (short)PTR2INTVAL(item);
+      case enum_type_short:
+        ((short *) Buffer_bufstart(&chunk->data))[idx] = (short)PTR2INTVAL(item);
         break;
-    case enum_type_int:
-        ((int *) PObj_bufstart(&chunk->data))[idx] = (int)PTR2INTVAL(item);
+      case enum_type_int:
+        ((int *) Buffer_bufstart(&chunk->data))[idx] = (int)PTR2INTVAL(item);
         break;
-    case enum_type_INTVAL:
-        ((INTVAL *) PObj_bufstart(&chunk->data))[idx] = PTR2INTVAL(item);
+      case enum_type_INTVAL:
+        ((INTVAL *) Buffer_bufstart(&chunk->data))[idx] = PTR2INTVAL(item);
         break;
-    case enum_type_FLOATVAL:
-        ((FLOATVAL *) PObj_bufstart(&chunk->data))[idx] = *(FLOATVAL *)item;
+      case enum_type_FLOATVAL:
+        ((FLOATVAL *) Buffer_bufstart(&chunk->data))[idx] = *(FLOATVAL *)item;
         break;
-    case enum_type_PMC:
-        if (list->container) {
-            GC_WRITE_BARRIER(interp, list->container,
-                    ((PMC **) PObj_bufstart(&chunk->data))[idx],
-                    (PMC *)item);
-        }
-        ((PMC **) PObj_bufstart(&chunk->data))[idx] = (PMC *)item;
+      case enum_type_PMC:
+        ((PMC **) Buffer_bufstart(&chunk->data))[idx] = (PMC *)item;
         break;
-    case enum_type_STRING:
-        ((STRING **) PObj_bufstart(&chunk->data))[idx] = (STRING *)item;
+      case enum_type_STRING:
+        ((STRING **) Buffer_bufstart(&chunk->data))[idx] = (STRING *)item;
         break;
-    default:
+      default:
         Parrot_ex_throw_from_c_args(interp, NULL, 1, "Unknown list entry type\n");
         break;
     }
@@ -1265,8 +1236,8 @@
 
 /*
 
-=item C<static void * list_item(PARROT_INTERP, List *list, int type, INTVAL
-idx)>
+=item C<static void * Parrot_pmc_array_item(PARROT_INTERP, List *list, int type,
+INTVAL idx)>
 
 Get the pointer to the item of type C<type> in the chunk at C<idx>.
 
@@ -1277,9 +1248,9 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 static void *
-list_item(PARROT_INTERP, ARGMOD(List *list), int type, INTVAL idx)
+Parrot_pmc_array_item(PARROT_INTERP, ARGMOD(List *list), int type, INTVAL idx)
 {
-    ASSERT_ARGS(list_item)
+    ASSERT_ARGS(Parrot_pmc_array_item)
     List_chunk * const chunk = get_chunk(interp, list, (UINTVAL *)&idx);
     /* if this is a sparse chunk return -1, the caller may decide to return 0
      * or undef or whatever */
@@ -1294,33 +1265,33 @@
     }
 
     switch (type) {
-        case enum_type_sized:
-            return (void *)&((char *)
-                PObj_bufstart(&chunk->data))[idx * list->item_size];
-        case enum_type_char:
-            return (void *)&((char *) PObj_bufstart(&chunk->data))[idx];
-        case enum_type_short:
-            return (void *)&((short *) PObj_bufstart(&chunk->data))[idx];
-        case enum_type_int:
-            return (void *)&((int *) PObj_bufstart(&chunk->data))[idx];
-        case enum_type_INTVAL:
-            return (void *)&((INTVAL *) PObj_bufstart(&chunk->data))[idx];
-        case enum_type_FLOATVAL:
-            return (void *)&((FLOATVAL *) PObj_bufstart(&chunk->data))[idx];
-        case enum_type_PMC:
-            return (void *)&((PMC **) PObj_bufstart(&chunk->data))[idx];
-        case enum_type_STRING:
-            return (void *)&((STRING **) PObj_bufstart(&chunk->data))[idx];
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, 1, "Unknown list entry type\n");
+      case enum_type_sized:
+        return (void *)&((char *)
+                Buffer_bufstart(&chunk->data))[idx * list->item_size];
+      case enum_type_char:
+        return (void *)&((char *) Buffer_bufstart(&chunk->data))[idx];
+      case enum_type_short:
+        return (void *)&((short *) Buffer_bufstart(&chunk->data))[idx];
+      case enum_type_int:
+        return (void *)&((int *) Buffer_bufstart(&chunk->data))[idx];
+      case enum_type_INTVAL:
+        return (void *)&((INTVAL *) Buffer_bufstart(&chunk->data))[idx];
+      case enum_type_FLOATVAL:
+        return (void *)&((FLOATVAL *) Buffer_bufstart(&chunk->data))[idx];
+      case enum_type_PMC:
+        return (void *)&((PMC **) Buffer_bufstart(&chunk->data))[idx];
+      case enum_type_STRING:
+        return (void *)&((STRING **) Buffer_bufstart(&chunk->data))[idx];
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, 1, "Unknown list entry type\n");
     }
 }
 
 
 /*
 
-=item C<static void list_append(PARROT_INTERP, List *list, void *item, int type,
-UINTVAL idx)>
+=item C<static void Parrot_pmc_array_append(PARROT_INTERP, List *list, void
+*item, int type, UINTVAL idx)>
 
 Adds one or more chunks to end of list.
 
@@ -1329,14 +1300,15 @@
 */
 
 static void
-list_append(PARROT_INTERP, ARGMOD(List *list), ARGIN_NULLOK(void *item), int type, UINTVAL idx)
+Parrot_pmc_array_append(PARROT_INTERP, ARGMOD(List *list),
+    ARGIN_NULLOK(void *item), int type, UINTVAL idx)
 {
-    ASSERT_ARGS(list_append)
+    ASSERT_ARGS(Parrot_pmc_array_append)
     /* initially, list may be empty, also used by assign */
-    while (idx >= list->cap)
+    while (idx >= list->cap){
         add_chunk_at_end(interp, list, idx);
-
-    list_set(interp, list, item, type, idx);
+    }
+    Parrot_pmc_array_set(interp, list, item, type, idx);
 
     /* invariant: prepare for next push */
     if (idx >= list->cap - 1)
@@ -1352,7 +1324,7 @@
 
 =over 4
 
-=item C<List * list_new(PARROT_INTERP, PARROT_DATA_TYPE type)>
+=item C<List * Parrot_pmc_array_new(PARROT_INTERP, PARROT_DATA_TYPE type)>
 
 Returns a new list of type C<type>.
 
@@ -1364,39 +1336,39 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 List *
-list_new(PARROT_INTERP, PARROT_DATA_TYPE type)
+Parrot_pmc_array_new(PARROT_INTERP, PARROT_DATA_TYPE type)
 {
-    ASSERT_ARGS(list_new)
+    ASSERT_ARGS(Parrot_pmc_array_new)
     List * const list = (List *)Parrot_gc_new_bufferlike_header(interp,
                              sizeof (*list));
 
     list->item_type = type;
     switch (type) {
-        case enum_type_sized:       /* gets overridden below */
-        case enum_type_char:
-            list->item_size = sizeof (char);
-            break;
-        case enum_type_short:
-            list->item_size = sizeof (short);
-            break;
-        case enum_type_int:
-            list->item_size = sizeof (int);
-            break;
-        case enum_type_INTVAL:
-            list->item_size = sizeof (INTVAL);
-            break;
-        case enum_type_FLOATVAL:
-            list->item_size = sizeof (FLOATVAL);
-            break;
-        case enum_type_PMC:
-            list->item_size = sizeof (PMC *);
-            break;
-        case enum_type_STRING:
-            list->item_size = sizeof (STRING *);
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, 1, "Unknown list type\n");
-            break;
+      case enum_type_sized:       /* gets overridden below */
+      case enum_type_char:
+        list->item_size = sizeof (char);
+        break;
+      case enum_type_short:
+        list->item_size = sizeof (short);
+        break;
+      case enum_type_int:
+        list->item_size = sizeof (int);
+        break;
+      case enum_type_INTVAL:
+        list->item_size = sizeof (INTVAL);
+        break;
+      case enum_type_FLOATVAL:
+        list->item_size = sizeof (FLOATVAL);
+        break;
+      case enum_type_PMC:
+        list->item_size = sizeof (PMC *);
+        break;
+      case enum_type_STRING:
+        list->item_size = sizeof (STRING *);
+        break;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, 1, "Unknown list type\n");
+        break;
     }
 
     return list;
@@ -1405,7 +1377,7 @@
 
 /*
 
-=item C<void list_pmc_new(PARROT_INTERP, PMC *container)>
+=item C<void Parrot_pmc_array_pmc_new(PARROT_INTERP, PMC *container)>
 
 Creates a new list containing PMC* values in C<PMC_data(container)>.
 
@@ -1415,11 +1387,11 @@
 
 PARROT_EXPORT
 void
-list_pmc_new(PARROT_INTERP, ARGMOD(PMC *container))
+Parrot_pmc_array_pmc_new(PARROT_INTERP, ARGMOD(PMC *container))
 {
-    ASSERT_ARGS(list_pmc_new)
+    ASSERT_ARGS(Parrot_pmc_array_pmc_new)
 
-    List * const l      = list_new(interp, enum_type_PMC);
+    List * const l      = Parrot_pmc_array_new(interp, enum_type_PMC);
     l->container        = container;
     PMC_data(container) = l;
 }
@@ -1427,9 +1399,10 @@
 
 /*
 
-=item C<List * list_new_init(PARROT_INTERP, PARROT_DATA_TYPE type, PMC *init)>
+=item C<List * Parrot_pmc_array_new_init(PARROT_INTERP, PARROT_DATA_TYPE type,
+PMC *init)>
 
-C<list_new_init()> uses these initializers:
+C<Parrot_pmc_array_new_init()> uses these initializers:
 
     0 ... size (set initial size of list)
     1 ... array dimensions (multiarray)
@@ -1445,9 +1418,9 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 List *
-list_new_init(PARROT_INTERP, PARROT_DATA_TYPE type, ARGIN(PMC *init))
+Parrot_pmc_array_new_init(PARROT_INTERP, PARROT_DATA_TYPE type, ARGIN(PMC *init))
 {
-    ASSERT_ARGS(list_new_init)
+    ASSERT_ARGS(Parrot_pmc_array_new_init)
     List  *list;
     PMC   *multi_key       = NULL;
     INTVAL size            = 0;
@@ -1470,33 +1443,33 @@
         const INTVAL key = VTABLE_get_integer_keyed_int(interp, init, i);
         const INTVAL val = i + 1;
         switch (key) {
-            case 0:
-                size = VTABLE_get_integer_keyed_int(interp, init, val);
-                break;
-            case 1:
-                multi_key = VTABLE_get_pmc_keyed_int(interp, init, val);
-                break;
-            case 2:
-                {
+          case 0:
+            size = VTABLE_get_integer_keyed_int(interp, init, val);
+            break;
+          case 1:
+            multi_key = VTABLE_get_pmc_keyed_int(interp, init, val);
+            break;
+          case 2:
+            {
                 const INTVAL result =
                     VTABLE_get_integer_keyed_int(interp, init, val);
                 type   = (PARROT_DATA_TYPE)result;
-                }
-                break;
-            case 3:
-                item_size = VTABLE_get_integer_keyed_int(interp, init, val);
-                break;
-            case 4:
-                items_per_chunk = VTABLE_get_integer_keyed_int(
+            }
+            break;
+          case 3:
+            item_size = VTABLE_get_integer_keyed_int(interp, init, val);
+            break;
+          case 4:
+            items_per_chunk = VTABLE_get_integer_keyed_int(
                         interp, init, val);
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, 1,
+            break;
+          default:
+            Parrot_ex_throw_from_c_args(interp, NULL, 1,
                     "Invalid initializer for list\n");
         }
     }
 
-    list = list_new(interp, type);
+    list = Parrot_pmc_array_new(interp, type);
 
     if (list->item_type == enum_type_sized) { /* override item_size */
 
@@ -1512,7 +1485,7 @@
     }
 
     if (size)
-        list_set_length(interp, list, size);
+        Parrot_pmc_array_set_length(interp, list, size);
 
     return list;
 }
@@ -1520,7 +1493,8 @@
 
 /*
 
-=item C<void list_pmc_new_init(PARROT_INTERP, PMC *container, PMC *init)>
+=item C<void Parrot_pmc_array_pmc_new_init(PARROT_INTERP, PMC *container, PMC
+*init)>
 
 Creates a new list of PMC* values in C<PMC_data(container)>.
 
@@ -1530,11 +1504,11 @@
 
 PARROT_EXPORT
 void
-list_pmc_new_init(PARROT_INTERP, ARGMOD(PMC *container), ARGIN(PMC *init))
+Parrot_pmc_array_pmc_new_init(PARROT_INTERP, ARGMOD(PMC *container), ARGIN(PMC *init))
 {
-    ASSERT_ARGS(list_pmc_new_init)
+    ASSERT_ARGS(Parrot_pmc_array_pmc_new_init)
 
-    List * const l      = list_new_init(interp, enum_type_PMC, init);
+    List * const l      = Parrot_pmc_array_new_init(interp, enum_type_PMC, init);
     l->container        = container;
     PMC_data(container) = l;
 }
@@ -1542,7 +1516,7 @@
 
 /*
 
-=item C<List * list_clone(PARROT_INTERP, const List *other)>
+=item C<List * Parrot_pmc_array_clone(PARROT_INTERP, const List *other)>
 
 Returns a clone of the C<other> list.
 
@@ -1556,9 +1530,9 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 List *
-list_clone(PARROT_INTERP, ARGIN(const List *other))
+Parrot_pmc_array_clone(PARROT_INTERP, ARGIN(const List *other))
 {
-    ASSERT_ARGS(list_clone)
+    ASSERT_ARGS(Parrot_pmc_array_clone)
     List       *l;
     List_chunk *chunk, *prev;
     UINTVAL     i;
@@ -1566,15 +1540,15 @@
     Parrot_block_GC_mark(interp);
     Parrot_block_GC_sweep(interp);
 
-    l = list_new(interp, other->item_type);
+    l = Parrot_pmc_array_new(interp, other->item_type);
 
     STRUCT_COPY(l, other);
-    PObj_buflen(&l->chunk_list)   = 0;
-    PObj_bufstart(&l->chunk_list) = NULL;
+    Buffer_buflen(&l->chunk_list)   = 0;
+    Buffer_bufstart(&l->chunk_list) = NULL;
 
     for (chunk = other->first, prev = NULL; chunk; chunk = chunk->next) {
         List_chunk * const new_chunk = allocate_chunk(interp, l,
-                chunk->items, PObj_buflen(&chunk->data));
+                chunk->items, Buffer_buflen(&chunk->data));
 
         new_chunk->flags = chunk->flags;
 
@@ -1587,26 +1561,26 @@
 
         if (!(new_chunk->flags & sparse)) {
             switch (l->item_type) {
-            case enum_type_PMC:
+              case enum_type_PMC:
                 for (i = 0; i < chunk->items; i++) {
-                    PMC * const op = ((PMC **) PObj_bufstart(&chunk->data))[i];
+                    PMC * const op = ((PMC **) Buffer_bufstart(&chunk->data))[i];
 
                     if (op)
-                        ((PMC **) PObj_bufstart(&new_chunk->data))[i] =
+                        ((PMC **) Buffer_bufstart(&new_chunk->data))[i] =
                             VTABLE_clone(interp, op);
                 }
                 break;
-            case enum_type_STRING:
+              case enum_type_STRING:
                 for (i = 0; i < chunk->items; i++) {
-                    STRING *s = ((STRING **) PObj_bufstart(&chunk->data))[i];
+                    STRING *s = ((STRING **) Buffer_bufstart(&chunk->data))[i];
                     if (s)
-                        ((STRING **) PObj_bufstart(&new_chunk->data))[i] =
+                        ((STRING **) Buffer_bufstart(&new_chunk->data))[i] =
                                 Parrot_str_copy(interp, s);
                 }
                 break;
-            default:
-                mem_sys_memcopy(PObj_bufstart(&new_chunk->data),
-                        PObj_bufstart(&chunk->data), PObj_buflen(&chunk->data));
+              default:
+                mem_sys_memcopy(Buffer_bufstart(&new_chunk->data),
+                        Buffer_bufstart(&chunk->data), Buffer_buflen(&chunk->data));
                 break;
             }
         }
@@ -1622,7 +1596,7 @@
 
 /*
 
-=item C<void list_mark(PARROT_INTERP, List *list)>
+=item C<void Parrot_pmc_array_mark(PARROT_INTERP, List *list)>
 
 Marks the list and its contents as live for the memory management system.
 
@@ -1632,9 +1606,9 @@
 
 PARROT_EXPORT
 void
-list_mark(PARROT_INTERP, ARGMOD(List *list))
+Parrot_pmc_array_mark(PARROT_INTERP, ARGMOD(List *list))
 {
-    ASSERT_ARGS(list_mark)
+    ASSERT_ARGS(Parrot_pmc_array_mark)
     List_chunk *chunk;
 
     for (chunk = list->first; chunk; chunk = chunk->next) {
@@ -1643,7 +1617,7 @@
         if (list->item_type == enum_type_PMC
         ||  list->item_type == enum_type_STRING) {
             if (!(chunk->flags & sparse)) {
-                PObj **p = ((PObj **) PObj_bufstart(&chunk->data));
+                PObj **p = ((PObj **) Buffer_bufstart(&chunk->data));
                 UINTVAL i;
 
                 for (i = 0; i < chunk->items; i++, ++p) {
@@ -1661,7 +1635,8 @@
 
 /*
 
-=item C<void list_visit(PARROT_INTERP, List *list, void *pinfo)>
+=item C<void Parrot_pmc_array_visit(PARROT_INTERP, List *list, visit_info
+*info)>
 
 This is used by freeze/thaw to visit the contents of the list.
 
@@ -1673,14 +1648,13 @@
 
 PARROT_EXPORT
 void
-list_visit(PARROT_INTERP, ARGIN(List *list), ARGMOD(void *pinfo))
+Parrot_pmc_array_visit(PARROT_INTERP, ARGIN(List *list), ARGMOD(visit_info *info))
 {
-    ASSERT_ARGS(list_visit)
+    ASSERT_ARGS(Parrot_pmc_array_visit)
     List_chunk        *chunk;
-    visit_info * const info = (visit_info*) pinfo;
     UINTVAL            idx;
 
-    const UINTVAL n = list_length(interp, list);
+    const UINTVAL n = Parrot_pmc_array_length(interp, list);
     PARROT_ASSERT(list->item_type == enum_type_PMC);
 
     for (idx = 0, chunk = list->first; chunk; chunk = chunk->next) {
@@ -1688,9 +1662,7 @@
         if (!(chunk->flags & sparse)) {
             UINTVAL i;
             for (i = 0; i < chunk->items && idx < n; i++, idx++) {
-                PMC ** const pos = ((PMC **) PObj_bufstart(&chunk->data)) + i;
-                info->thaw_ptr   = pos;
-                (info->visit_pmc_now)(interp, *pos, info);
+                VISIT_PMC(interp, info, ((PMC **)Buffer_bufstart(&chunk->data))[i]);
             }
         }
         /*
@@ -1702,7 +1674,7 @@
 
 /*
 
-=item C<INTVAL list_length(PARROT_INTERP, const List *list)>
+=item C<INTVAL Parrot_pmc_array_length(PARROT_INTERP, const List *list)>
 
 Returns the length of the list.
 
@@ -1713,16 +1685,16 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_PURE_FUNCTION
 INTVAL
-list_length(SHIM_INTERP, ARGIN(const List *list))
+Parrot_pmc_array_length(SHIM_INTERP, ARGIN(const List *list))
 {
-    ASSERT_ARGS(list_length)
+    ASSERT_ARGS(Parrot_pmc_array_length)
     return list->length;
 }
 
 
 /*
 
-=item C<void list_set_length(PARROT_INTERP, List *list, INTVAL len)>
+=item C<void Parrot_pmc_array_set_length(PARROT_INTERP, List *list, INTVAL len)>
 
 Sets the length of the list to C<len>.
 
@@ -1732,9 +1704,9 @@
 
 PARROT_EXPORT
 void
-list_set_length(PARROT_INTERP, ARGMOD(List *list), INTVAL len)
+Parrot_pmc_array_set_length(PARROT_INTERP, ARGMOD(List *list), INTVAL len)
 {
-    ASSERT_ARGS(list_set_length)
+    ASSERT_ARGS(Parrot_pmc_array_set_length)
 
     if (len < 0)
         len += list->length;
@@ -1751,7 +1723,7 @@
                 }
             }
 
-            list_append(interp, list, NULL, list->item_type, idx);
+            Parrot_pmc_array_append(interp, list, NULL, list->item_type, idx);
         }
         else
             rebuild_chunk_ptrs(list, 1);
@@ -1763,7 +1735,8 @@
 
 /*
 
-=item C<void list_insert(PARROT_INTERP, List *list, INTVAL idx, INTVAL n_items)>
+=item C<void Parrot_pmc_array_insert(PARROT_INTERP, List *list, INTVAL idx,
+INTVAL n_items)>
 
 Makes room for C<n_items> at C<idx>.
 
@@ -1773,9 +1746,9 @@
 
 PARROT_EXPORT
 void
-list_insert(PARROT_INTERP, ARGMOD(List *list), INTVAL idx, INTVAL n_items)
+Parrot_pmc_array_insert(PARROT_INTERP, ARGMOD(List *list), INTVAL idx, INTVAL n_items)
 {
-    ASSERT_ARGS(list_insert)
+    ASSERT_ARGS(Parrot_pmc_array_insert)
     List_chunk *chunk;
 
     PARROT_ASSERT(idx >= 0);
@@ -1830,8 +1803,8 @@
 
             /* copy data over */
             mem_sys_memmove(
-                    (char *)PObj_bufstart(&rest->data),
-                    (char *)PObj_bufstart(&chunk->data) + idx * list->item_size,
+                    (char *)Buffer_bufstart(&rest->data),
+                    (char *)Buffer_bufstart(&chunk->data) + idx * list->item_size,
                     items * list->item_size);
         }
         else {
@@ -1848,7 +1821,8 @@
 
 /*
 
-=item C<void list_delete(PARROT_INTERP, List *list, INTVAL idx, INTVAL n_items)>
+=item C<void Parrot_pmc_array_delete(PARROT_INTERP, List *list, INTVAL idx,
+INTVAL n_items)>
 
 Deletes C<n_items> at C<idx>.
 
@@ -1858,9 +1832,9 @@
 
 PARROT_EXPORT
 void
-list_delete(PARROT_INTERP, ARGMOD(List *list), INTVAL idx, INTVAL n_items)
+Parrot_pmc_array_delete(PARROT_INTERP, ARGMOD(List *list), INTVAL idx, INTVAL n_items)
 {
-    ASSERT_ARGS(list_delete)
+    ASSERT_ARGS(Parrot_pmc_array_delete)
     List_chunk *chunk;
 
     PARROT_ASSERT(idx >= 0);
@@ -1895,15 +1869,15 @@
                             list->item_size;
 
                     mem_sys_memmove(
-                            (char *) PObj_bufstart(&chunk->data) +
+                            (char *) Buffer_bufstart(&chunk->data) +
                             idx * list->item_size,
-                            (char *) PObj_bufstart(&chunk->data) +
+                            (char *) Buffer_bufstart(&chunk->data) +
                             (idx + n_items) * list->item_size, tmp_size);
 #else
                     mem_sys_memmove(
-                            (char *) PObj_bufstart(&chunk->data) +
+                            (char *) Buffer_bufstart(&chunk->data) +
                             idx * list->item_size,
-                            (char *) PObj_bufstart(&chunk->data) +
+                            (char *) Buffer_bufstart(&chunk->data) +
                             (idx + n_items) * list->item_size,
                             (chunk->items - idx - n_items) * list->item_size);
 #endif
@@ -1943,7 +1917,8 @@
 
 /*
 
-=item C<void list_push(PARROT_INTERP, List *list, void *item, int type)>
+=item C<void Parrot_pmc_array_push(PARROT_INTERP, List *list, void *item, int
+type)>
 
 Pushes C<item> of type C<type> on to the end of the list.
 
@@ -1953,18 +1928,19 @@
 
 PARROT_EXPORT
 void
-list_push(PARROT_INTERP, ARGMOD(List *list), ARGIN_NULLOK(void *item), int type)
+Parrot_pmc_array_push(PARROT_INTERP, ARGMOD(List *list), ARGIN_NULLOK(void *item), int type)
 {
-    ASSERT_ARGS(list_push)
+    ASSERT_ARGS(Parrot_pmc_array_push)
     const INTVAL idx = list->start + list->length++;
 
-    list_append(interp, list, item, type, idx);
+    Parrot_pmc_array_append(interp, list, item, type, idx);
 }
 
 
 /*
 
-=item C<void list_unshift(PARROT_INTERP, List *list, void *item, int type)>
+=item C<void Parrot_pmc_array_unshift(PARROT_INTERP, List *list, void *item, int
+type)>
 
 Pushes C<item> of type C<type> on to the start of the list.
 
@@ -1974,9 +1950,9 @@
 
 PARROT_EXPORT
 void
-list_unshift(PARROT_INTERP, ARGMOD(List *list), ARGIN(void *item), int type)
+Parrot_pmc_array_unshift(PARROT_INTERP, ARGMOD(List *list), ARGIN(void *item), int type)
 {
-    ASSERT_ARGS(list_unshift)
+    ASSERT_ARGS(Parrot_pmc_array_unshift)
     List_chunk *chunk;
 
     if (list->start == 0) {
@@ -1988,14 +1964,14 @@
     else
         chunk = list->first;
 
-    list_set(interp, list, item, type, --list->start);
+    Parrot_pmc_array_set(interp, list, item, type, --list->start);
     list->length++;
 }
 
 
 /*
 
-=item C<void * list_pop(PARROT_INTERP, List *list, int type)>
+=item C<void * Parrot_pmc_array_pop(PARROT_INTERP, List *list, int type)>
 
 Removes and returns the last item of type C<type> from the end of the list.
 
@@ -2006,9 +1982,9 @@
 PARROT_EXPORT
 PARROT_CAN_RETURN_NULL
 void *
-list_pop(PARROT_INTERP, ARGMOD(List *list), int type)
+Parrot_pmc_array_pop(PARROT_INTERP, ARGMOD(List *list), int type)
 {
-    ASSERT_ARGS(list_pop)
+    ASSERT_ARGS(Parrot_pmc_array_pop)
     List_chunk *chunk = list->last;
     UINTVAL     idx;
 
@@ -2032,13 +2008,13 @@
         rebuild_chunk_list(interp, list);
     }
 
-    return list_item(interp, list, type, idx);
+    return Parrot_pmc_array_item(interp, list, type, idx);
 }
 
 
 /*
 
-=item C<void * list_shift(PARROT_INTERP, List *list, int type)>
+=item C<void * Parrot_pmc_array_shift(PARROT_INTERP, List *list, int type)>
 
 Removes and returns the first item of type C<type> from the start of the list.
 
@@ -2049,9 +2025,9 @@
 PARROT_EXPORT
 PARROT_CAN_RETURN_NULL
 void *
-list_shift(PARROT_INTERP, ARGMOD(List *list), int type)
+Parrot_pmc_array_shift(PARROT_INTERP, ARGMOD(List *list), int type)
 {
-    ASSERT_ARGS(list_shift)
+    ASSERT_ARGS(Parrot_pmc_array_shift)
     void       *ret;
     List_chunk *chunk = list->first;
     UINTVAL     idx;
@@ -2067,7 +2043,7 @@
     else
         list->start++;
 
-    ret = list_item(interp, list, type, idx);
+    ret = Parrot_pmc_array_item(interp, list, type, idx);
 
     if (list->start >= chunk->items) {
         list->cap  -= chunk->items;
@@ -2086,8 +2062,8 @@
 
 /*
 
-=item C<void list_assign(PARROT_INTERP, List *list, INTVAL idx, void *item, int
-type)>
+=item C<void Parrot_pmc_array_assign(PARROT_INTERP, List *list, INTVAL idx, void
+*item, int type)>
 
 Assigns C<item> of type C<type> to index C<idx>.
 
@@ -2097,9 +2073,10 @@
 
 PARROT_EXPORT
 void
-list_assign(PARROT_INTERP, ARGMOD(List *list), INTVAL idx, ARGIN_NULLOK(void *item), int type)
+Parrot_pmc_array_assign(PARROT_INTERP, ARGMOD(List *list), INTVAL idx,
+    ARGIN_NULLOK(void *item), int type)
 {
-    ASSERT_ARGS(list_assign)
+    ASSERT_ARGS(Parrot_pmc_array_assign)
     const INTVAL length = list->length;
 
     if (idx < -length)
@@ -2107,17 +2084,18 @@
     else if (idx < 0)
         idx += length;
     if (idx >= length) {
-        list_append(interp, list, item, type, list->start + idx);
+        Parrot_pmc_array_append(interp, list, item, type, list->start + idx);
         list->length = idx + 1;
     }
     else
-        list_set(interp, list, item, type, list->start + idx);
+        Parrot_pmc_array_set(interp, list, item, type, list->start + idx);
 }
 
 
 /*
 
-=item C<void * list_get(PARROT_INTERP, List *list, INTVAL idx, int type)>
+=item C<void * Parrot_pmc_array_get(PARROT_INTERP, List *list, INTVAL idx, int
+type)>
 
 Returns the item of type C<type> at index C<idx>.
 
@@ -2129,9 +2107,9 @@
 PARROT_CAN_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
 void *
-list_get(PARROT_INTERP, ARGMOD(List *list), INTVAL idx, int type)
+Parrot_pmc_array_get(PARROT_INTERP, ARGMOD(List *list), INTVAL idx, int type)
 {
-    ASSERT_ARGS(list_get)
+    ASSERT_ARGS(Parrot_pmc_array_get)
     const INTVAL length = list->length;
 
     if (idx >= length || -idx > length)
@@ -2142,14 +2120,14 @@
 
     idx += list->start;
 
-    return list_item(interp, list, type, idx);
+    return Parrot_pmc_array_item(interp, list, type, idx);
 }
 
 
 /*
 
-=item C<void list_splice(PARROT_INTERP, List *list, List *value_list, INTVAL
-offset, INTVAL count)>
+=item C<void Parrot_pmc_array_splice(PARROT_INTERP, List *list, List
+*value_list, INTVAL offset, INTVAL count)>
 
 Replaces C<count> items starting at C<offset> with the items in C<value>.
 
@@ -2161,10 +2139,10 @@
 
 PARROT_EXPORT
 void
-list_splice(PARROT_INTERP, ARGMOD(List *list), ARGMOD_NULLOK(List *value_list),
+Parrot_pmc_array_splice(PARROT_INTERP, ARGMOD(List *list), ARGMOD_NULLOK(List *value_list),
         INTVAL offset, INTVAL count)
 {
-    ASSERT_ARGS(list_splice)
+    ASSERT_ARGS(Parrot_pmc_array_splice)
     const INTVAL value_length = value_list ? value_list->length : 0;
     const INTVAL length       = list->length;
     const int    type         = list->item_type;
@@ -2191,42 +2169,42 @@
 
     /* replace count items at offset with values */
     for (i = j = 0; i < count && j < value_length; i++, j++) {
-        void *val = list_get(interp, value_list, j, type);
+        void *val = Parrot_pmc_array_get(interp, value_list, j, type);
 
         /* no clone here, if the HL wants to reuse the values, the HL has to */
         /* clone the values */
 
-        /* XXX We don't know that val is non-NULL coming back from list_get. */
+        /* XXX We don't know that val is non-NULL coming back from Parrot_pmc_array_get. */
         /* We need to check that we're not dereferencing NULL. */
         if (type == enum_type_PMC)
             val = *(PMC **)val;
         else if (type == enum_type_STRING)
             val = *(STRING **)val;
 
-        list_assign(interp, list, offset + i, val, type);
+        Parrot_pmc_array_assign(interp, list, offset + i, val, type);
     }
 
     /* if we still have values in value_list, insert them */
     if (j < value_length) {
         /* make room for the remaining values */
-        list_insert(interp, list, offset + i, value_length - j);
+        Parrot_pmc_array_insert(interp, list, offset + i, value_length - j);
 
         for (; j < value_length; i++, j++) {
-            void *val = list_get(interp, value_list, j, type);
+            void *val = Parrot_pmc_array_get(interp, value_list, j, type);
 
             /* XXX We don't know that val is non-NULL coming back from
-             * list_get; check that we're not dereferencing NULL. */
+             * Parrot_pmc_array_get; check that we're not dereferencing NULL. */
             if (type == enum_type_PMC)
                 val = *(PMC **)val;
             else if (type == enum_type_STRING)
                 val = *(STRING **)val;
 
-            list_assign(interp, list, offset + i, val, type);
+            Parrot_pmc_array_assign(interp, list, offset + i, val, type);
         }
     }
     /* else delete the rest */
     else
-        list_delete(interp, list, offset + i, count - i);
+        Parrot_pmc_array_delete(interp, list, offset + i, count - i);
 }
 
 

Modified: branches/orderedhash_revamp/src/longopt.c
==============================================================================
--- branches/orderedhash_revamp/src/longopt.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/longopt.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -19,7 +19,6 @@
 */
 
 #include "parrot/parrot.h"
-#include "parrot/longopt.h"
 
 /* HEADERIZER HFILE: include/parrot/longopt.h */
 
@@ -48,16 +47,16 @@
         __attribute__nonnull__(5)
         FUNC_MODIFIES(* info_buf);
 
-#define ASSERT_ARGS_longopt_get_longopt __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_longopt_get_longopt __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(argv) \
-    || PARROT_ASSERT_ARG(options) \
-    || PARROT_ASSERT_ARG(info_buf)
-#define ASSERT_ARGS_longopt_get_shortopt __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(argv) \
+    , PARROT_ASSERT_ARG(options) \
+    , PARROT_ASSERT_ARG(info_buf))
+#define ASSERT_ARGS_longopt_get_shortopt __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(argv) \
-    || PARROT_ASSERT_ARG(options) \
-    || PARROT_ASSERT_ARG(info_buf)
+    , PARROT_ASSERT_ARG(argv) \
+    , PARROT_ASSERT_ARG(options) \
+    , PARROT_ASSERT_ARG(info_buf))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 

Modified: branches/orderedhash_revamp/src/misc.c
==============================================================================
--- branches/orderedhash_revamp/src/misc.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/misc.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -112,6 +112,8 @@
                  size_t len, ARGIN(const char *pat), va_list args)
 {
     ASSERT_ARGS(Parrot_vsnprintf)
+    char   *str_ret;
+    size_t  str_len;
     if (len == 0)
         return;
     len--;
@@ -119,12 +121,15 @@
         const STRING * const ret = Parrot_vsprintf_c(interp, pat, args);
         /* string_transcode(interp, ret, NULL, NULL, &ret); */
 
-        if (len > ret->bufused) {
-            len = ret->bufused;
+        str_ret = Parrot_str_to_cstring(interp, ret);
+        str_len = strlen(str_ret);
+        if (len > str_len) {
+            len = str_len;
         }
 
         if (len)
-            memcpy(targ, ret->strstart, len);
+            memcpy(targ, str_ret, len);
+        Parrot_str_free_cstring(str_ret);
     }
     targ[len] = 0;
 }

Modified: branches/orderedhash_revamp/src/multidispatch.c
==============================================================================
--- branches/orderedhash_revamp/src/multidispatch.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/multidispatch.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -29,9 +29,6 @@
 
 =head2 Remarks
 
-C<< binop_mmd_funcs->x >> and C<< ->y >> are table sizes
-not highest type in table.
-
 =head2 Functions
 
 =over 4
@@ -47,6 +44,7 @@
 #include "multidispatch.str"
 #include "pmc/pmc_nci.h"
 #include "pmc/pmc_sub.h"
+#include "pmc/pmc_callcontext.h"
 
 /* HEADERIZER HFILE: include/parrot/multidispatch.h */
 
@@ -139,11 +137,6 @@
         __attribute__nonnull__(3);
 
 PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static PMC* Parrot_mmd_arg_tuple_func(PARROT_INTERP)
-        __attribute__nonnull__(1);
-
-PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
 static PMC * Parrot_mmd_get_cached_multi_sig(PARROT_INTERP,
     ARGIN(PMC *sub_pmc))
@@ -171,69 +164,67 @@
         __attribute__nonnull__(2)
         __attribute__nonnull__(3);
 
-#define ASSERT_ARGS_distance_cmp __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_mmd_add_multi_global __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_distance_cmp __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_mmd_add_multi_global __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub_name) \
-    || PARROT_ASSERT_ARG(sub_obj)
-#define ASSERT_ARGS_mmd_add_multi_to_namespace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(sub_name) \
+    , PARROT_ASSERT_ARG(sub_obj))
+#define ASSERT_ARGS_mmd_add_multi_to_namespace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ns_name) \
-    || PARROT_ASSERT_ARG(sub_name) \
-    || PARROT_ASSERT_ARG(sub_obj)
+    , PARROT_ASSERT_ARG(ns_name) \
+    , PARROT_ASSERT_ARG(sub_name) \
+    , PARROT_ASSERT_ARG(sub_obj))
 #define ASSERT_ARGS_mmd_build_type_tuple_from_long_sig \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(long_sig)
+    , PARROT_ASSERT_ARG(long_sig))
 #define ASSERT_ARGS_mmd_build_type_tuple_from_type_list \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(type_list)
-#define ASSERT_ARGS_mmd_cache_key_from_types __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(type_list))
+#define ASSERT_ARGS_mmd_cache_key_from_types __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(types)
-#define ASSERT_ARGS_mmd_cache_key_from_values __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(types))
+#define ASSERT_ARGS_mmd_cache_key_from_values __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(values)
-#define ASSERT_ARGS_mmd_cvt_to_types __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(values))
+#define ASSERT_ARGS_mmd_cvt_to_types __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(multi_sig)
-#define ASSERT_ARGS_mmd_distance __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(multi_sig))
+#define ASSERT_ARGS_mmd_distance __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc) \
-    || PARROT_ASSERT_ARG(arg_tuple)
-#define ASSERT_ARGS_mmd_search_by_sig_obj __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(pmc) \
+    , PARROT_ASSERT_ARG(arg_tuple))
+#define ASSERT_ARGS_mmd_search_by_sig_obj __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(sig_obj) \
-    || PARROT_ASSERT_ARG(candidates)
-#define ASSERT_ARGS_mmd_search_global __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(sig_obj) \
+    , PARROT_ASSERT_ARG(candidates))
+#define ASSERT_ARGS_mmd_search_global __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(cl)
-#define ASSERT_ARGS_mmd_search_local __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(cl))
+#define ASSERT_ARGS_mmd_search_local __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(candidates)
-#define ASSERT_ARGS_Parrot_mmd_arg_tuple_func __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(candidates))
 #define ASSERT_ARGS_Parrot_mmd_get_cached_multi_sig \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub_pmc)
-#define ASSERT_ARGS_Parrot_mmd_maybe_candidate __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(sub_pmc))
+#define ASSERT_ARGS_Parrot_mmd_maybe_candidate __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc) \
-    || PARROT_ASSERT_ARG(cl)
-#define ASSERT_ARGS_Parrot_mmd_search_scopes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(pmc) \
+    , PARROT_ASSERT_ARG(cl))
+#define ASSERT_ARGS_Parrot_mmd_search_scopes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(meth)
-#define ASSERT_ARGS_Parrot_mmd_sort_candidates __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(meth))
+#define ASSERT_ARGS_Parrot_mmd_sort_candidates __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(arg_tuple) \
-    || PARROT_ASSERT_ARG(cl)
+    , PARROT_ASSERT_ARG(arg_tuple) \
+    , PARROT_ASSERT_ARG(cl))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -399,141 +390,6 @@
 }
 
 
-/*
-
-=item C<PMC * Parrot_mmd_sort_manhattan(PARROT_INTERP, PMC *candidates)>
-
-Given an array PMC (usually a MultiSub) sorts the mmd candidates by their
-manhattan distance to the current args and returns the best one.
-
-=cut
-
-*/
-PARROT_EXPORT
-PARROT_CAN_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-PMC *
-Parrot_mmd_sort_manhattan(PARROT_INTERP, ARGIN(PMC *candidates))
-{
-    ASSERT_ARGS(Parrot_mmd_sort_manhattan)
-    const INTVAL n = VTABLE_elements(interp, candidates);
-
-    if (n) {
-        PMC * const arg_tuple = Parrot_mmd_arg_tuple_func(interp);
-        return Parrot_mmd_sort_candidates(interp, arg_tuple, candidates);
-    }
-
-    return PMCNULL;
-}
-
-
-/*
-
-=item C<static PMC* Parrot_mmd_arg_tuple_func(PARROT_INTERP)>
-
-Return a list of argument types. PMC arguments are taken from registers
-according to calling conventions.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static PMC*
-Parrot_mmd_arg_tuple_func(PARROT_INTERP)
-{
-    ASSERT_ARGS(Parrot_mmd_arg_tuple_func)
-    PMC                *arg;
-    PMC                *args_array;    /* from recent set_args opcode */
-    PackFile_Constant **constants;
-
-    /*
-     * if there is no signature e.g. because of
-     *      m = getattribute l, "__add"
-     * - we have to return the MultiSub
-     * - create a BoundMulti
-     * - dispatch in invoke - yeah ugly
-     */
-
-    PMC * const arg_tuple = pmc_new(interp, enum_class_ResizableIntegerArray);
-    opcode_t   *args_op   = interp->current_args;
-    INTVAL sig_len, i, type;
-
-    if (!args_op)
-        return arg_tuple;
-
-    PARROT_ASSERT(*args_op == PARROT_OP_set_args_pc);
-    constants  = interp->code->const_table->constants;
-    ++args_op;
-    args_array = constants[*args_op]->u.key;
-
-    ASSERT_SIG_PMC(args_array);
-
-    sig_len = VTABLE_elements(interp, args_array);
-    if (!sig_len)
-        return arg_tuple;
-
-    ++args_op;
-
-    for (i = 0; i < sig_len; ++i, ++args_op) {
-        type = VTABLE_get_integer_keyed_int(interp, args_array, i);
-
-        /* named don't MMD */
-        if (type & PARROT_ARG_NAME)
-            break;
-        switch (type & (PARROT_ARG_TYPE_MASK | PARROT_ARG_FLATTEN)) {
-            case PARROT_ARG_INTVAL:
-                VTABLE_push_integer(interp, arg_tuple, enum_type_INTVAL);
-                break;
-            case PARROT_ARG_FLOATVAL:
-                VTABLE_push_integer(interp, arg_tuple, enum_type_FLOATVAL);
-                break;
-            case PARROT_ARG_STRING:
-                VTABLE_push_integer(interp, arg_tuple, enum_type_STRING);
-                break;
-            case PARROT_ARG_PMC:
-                {
-                const int idx = *args_op;
-                if ((type & PARROT_ARG_CONSTANT))
-                    arg = constants[idx]->u.key;
-                else
-                    arg = REG_PMC(interp, idx);
-
-                if (PMC_IS_NULL(arg))
-                    type = enum_type_PMC;
-                else
-                    type = VTABLE_type(interp, arg);
-
-                VTABLE_push_integer(interp, arg_tuple, type);
-                }
-                break;
-            case PARROT_ARG_FLATTEN | PARROT_ARG_PMC:  {
-                /* expand flattening args */
-                int j, n;
-
-                const int idx = *args_op;
-                arg           = REG_PMC(interp, idx);
-                n             = VTABLE_elements(interp, arg);
-
-                for (j = 0; j < n; ++j)  {
-                    PMC * const elem = VTABLE_get_pmc_keyed_int(interp, arg, j);
-                    type             = VTABLE_type(interp, elem);
-                    VTABLE_push_integer(interp, arg_tuple, type);
-                }
-                break;
-            }
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, 1,
-                    "Unknown signature type %d in mmd_arg_tuple", type);
-                break;
-        }
-    }
-
-
-    return arg_tuple;
-}
-
 
 /*
 
@@ -657,25 +513,19 @@
 Parrot_mmd_build_type_tuple_from_sig_obj(PARROT_INTERP, ARGIN(PMC *sig_obj))
 {
     ASSERT_ARGS(Parrot_mmd_build_type_tuple_from_sig_obj)
-    PMC * const  type_tuple = pmc_new(interp, enum_class_FixedIntegerArray);
+    PMC * const  type_tuple = pmc_new(interp, enum_class_ResizableIntegerArray);
     STRING      *string_sig = VTABLE_get_string(interp, sig_obj);
-    const INTVAL sig_len    = Parrot_str_byte_length(interp, string_sig);
     INTVAL       tuple_size = 0;
     INTVAL       args_ended = 0;
     INTVAL       i, seen_invocant = 0;
+    INTVAL       sig_len;
 
-    /* First calculate the number of arguments participating in MMD */
-    for (i = 0; i < sig_len; ++i) {
-        INTVAL type = Parrot_str_indexed(interp, string_sig, i);
-        if (type == '-')
-            break;
-        if (type == 'i')
-            continue;
-
-        tuple_size++;
+    if (STRING_IS_NULL(string_sig)) {
+            Parrot_ex_throw_from_c_args(interp, NULL, 1,
+                    "Call has no signature, unable to dispatch.\n");
     }
 
-    VTABLE_set_integer_native(interp, type_tuple, tuple_size);
+    sig_len = Parrot_str_byte_length(interp, string_sig);
 
     for (i = 0; i < sig_len; ++i) {
         INTVAL type = Parrot_str_indexed(interp, string_sig, i + seen_invocant);
@@ -684,19 +534,26 @@
 
         /* Regular arguments just set the value */
         switch (type) {
-            case 'I':
-                VTABLE_set_integer_keyed_int(interp, type_tuple,
+          case 'I':
+            VTABLE_set_integer_keyed_int(interp, type_tuple,
                         i, enum_type_INTVAL);
-                break;
-            case 'N':
-                VTABLE_set_integer_keyed_int(interp, type_tuple,
+            break;
+          case 'N':
+            VTABLE_set_integer_keyed_int(interp, type_tuple,
                         i, enum_type_FLOATVAL);
-                break;
-            case 'S':
+            break;
+          case 'S':
+            {
+                INTVAL type_lookahead = Parrot_str_indexed(interp, string_sig, (i + 1));
+                if (type_lookahead == 'n') {
+                    args_ended = 1;
+                    break;
+                }
                 VTABLE_set_integer_keyed_int(interp, type_tuple,
-                        i, enum_type_STRING);
+                            i, enum_type_STRING);
                 break;
-            case 'P':
+            }
+          case 'P':
             {
                 INTVAL type_lookahead = Parrot_str_indexed(interp, string_sig, (i + 1));
                 if (type_lookahead == 'i') {
@@ -706,6 +563,10 @@
                             "Multiple Dispatch: only the first argument can be an invocant");
                     seen_invocant = 1;
                 }
+                else if (type_lookahead == 'f') {
+                    args_ended = 1;
+                    break;
+                }
                 else {
                     PMC *pmc_arg = VTABLE_get_pmc_keyed_int(interp, sig_obj, i);
                     if (PMC_IS_NULL(pmc_arg))
@@ -718,11 +579,11 @@
 
                 break;
             }
-            case '-':
-                args_ended = 1;
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL,
+          case '-':
+            args_ended = 1;
+            break;
+          default:
+            Parrot_ex_throw_from_c_args(interp, NULL,
                     EXCEPTION_INVALID_OPERATION,
                     "Multiple Dispatch: invalid argument type %c!", type);
         }
@@ -816,8 +677,8 @@
 {
     ASSERT_ARGS(Parrot_mmd_get_cached_multi_sig)
     if (VTABLE_isa(interp, sub_pmc, CONST_STRING(interp, "Sub"))) {
-        Parrot_sub *sub;
-        PMC        *multi_sig;
+        Parrot_Sub_attributes *sub;
+        PMC                   *multi_sig;
 
         PMC_get_sub(interp, sub_pmc, sub);
         multi_sig = sub->multi_signature;
@@ -856,7 +717,7 @@
 {
     ASSERT_ARGS(mmd_distance)
     PMC        *multi_sig, *mro;
-    Parrot_sub *sub;
+    Parrot_Sub_attributes *sub;
     INTVAL      args, dist, i, j, n, m;
 
     /* has to be a builtin multi method */
@@ -907,17 +768,17 @@
         /* promote primitives to their PMC equivalents, as PCC will autobox
          * the distance penalty makes primitive variants look cheaper */
         switch (type_call) {
-            case enum_type_INTVAL:
-                if (type_sig == enum_class_Integer) { dist++; continue; }
-                break;
-            case enum_type_FLOATVAL:
-                if (type_sig == enum_class_Float)   { dist++; continue; }
-                break;
-            case enum_type_STRING:
-                if (type_sig == enum_class_String)  { dist++; continue; }
-                break;
-            default:
-                break;
+          case enum_type_INTVAL:
+            if (type_sig == enum_class_Integer) { dist++; continue; }
+            break;
+          case enum_type_FLOATVAL:
+            if (type_sig == enum_class_Float)   { dist++; continue; }
+            break;
+          case enum_type_STRING:
+            if (type_sig == enum_class_String)  { dist++; continue; }
+            break;
+          default:
+            break;
         }
 
         /*
@@ -1073,8 +934,6 @@
 
     if (VTABLE_isa(interp, pmc, _sub)) {
         /* a plain sub stops outer searches */
-        /* RT #45959 check arity of sub */
-
         VTABLE_push_pmc(interp, cl, pmc);
         return 1;
     }
@@ -1229,7 +1088,8 @@
 {
     ASSERT_ARGS(mmd_add_multi_to_namespace)
     PMC * const hll_ns = VTABLE_get_pmc_keyed_int(interp,
-                        interp->HLL_namespace, CONTEXT(interp)->current_HLL);
+                        interp->HLL_namespace,
+                        Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp)));
     PMC * const ns     = Parrot_make_namespace_keyed_str(interp, hll_ns, ns_name);
     PMC        *multi_sub = Parrot_get_global(interp, ns, sub_name);
 
@@ -1261,7 +1121,7 @@
         ARGIN(STRING *sub_name), ARGIN(STRING *long_sig), ARGIN(PMC *sub_obj))
 {
     ASSERT_ARGS(Parrot_mmd_add_multi_from_long_sig)
-    Parrot_sub *sub;
+    Parrot_Sub_attributes *sub;
     STRING     *sub_str     = CONST_STRING(interp, "Sub");
     STRING     *closure_str = CONST_STRING(interp, "Closure");
     PMC        *type_list   = Parrot_str_split(interp, CONST_STRING(interp, ","), long_sig);

Modified: branches/orderedhash_revamp/src/nci_test.c
==============================================================================
--- branches/orderedhash_revamp/src/nci_test.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/nci_test.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -33,10 +33,11 @@
 
 */
 
+#define PARROT_IN_EXTENSION
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <parrot/config.h>
+#include "parrot/parrot.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -70,87 +71,86 @@
 
 */
 
-PARROT_EXPORT int    call_back(const char *str);
-PARROT_EXPORT char   nci_c(void);
-PARROT_EXPORT char   nci_csc(short, char);
-PARROT_EXPORT double nci_d(void);
-PARROT_EXPORT double nci_dd(double);
-PARROT_EXPORT float  nci_f(void);
-PARROT_EXPORT float  nci_fff(float, float);
-PARROT_EXPORT int    nci_i(void);
-PARROT_EXPORT int    nci_ib(int *);
-PARROT_EXPORT int    nci_iiii(int, int, int);
-PARROT_EXPORT int    nci_ii3(int, int *);
-PARROT_EXPORT int    nci_ip(void *);
-PARROT_EXPORT int    nci_isc(short, char);
-PARROT_EXPORT int    nci_it(void *);
-PARROT_EXPORT int    nci_i33(int *, int *);
-PARROT_EXPORT int    nci_i4i(long *, int);
-PARROT_EXPORT long   nci_l(void);
-PARROT_EXPORT int *  nci_p(void);
-PARROT_EXPORT void * nci_pi(int);
-PARROT_EXPORT void * nci_pii(int, int);
-PARROT_EXPORT void * nci_piiii(int, int, int, int);
-PARROT_EXPORT void   nci_pip(int, Rect_Like *);
-PARROT_EXPORT void * nci_pp(void *);
-PARROT_EXPORT short  nci_s(void);
-PARROT_EXPORT short  nci_ssc(short, char);
-PARROT_EXPORT char * nci_t(void);
-PARROT_EXPORT char * nci_tb(void *);
-PARROT_EXPORT char * nci_tB(void **);
-PARROT_EXPORT char * nci_tt(void *);
-PARROT_EXPORT void   nci_v(void);
-PARROT_EXPORT void   nci_vP(void *);
-PARROT_EXPORT void   nci_vpii(Outer *, int, int);
-PARROT_EXPORT void   nci_vv(void);
-PARROT_EXPORT void   nci_vVi(Opaque**, int);
-PARROT_EXPORT void   nci_vp(Opaque*);
-PARROT_EXPORT char * nci_ttt(char *, char *);
-PARROT_EXPORT void   nci_vfff(float, float, float);
-PARROT_EXPORT void   nci_vV(const char **);
-PARROT_EXPORT void   nci_vVVV(const char **, const char **, const char **);
+PARROT_DYNEXT_EXPORT int    call_back(const char *str);
+PARROT_DYNEXT_EXPORT char   nci_c(void);
+PARROT_DYNEXT_EXPORT char   nci_csc(short, char);
+PARROT_DYNEXT_EXPORT double nci_d(void);
+PARROT_DYNEXT_EXPORT double nci_dd(double);
+PARROT_DYNEXT_EXPORT float  nci_f(void);
+PARROT_DYNEXT_EXPORT float  nci_fff(float, float);
+PARROT_DYNEXT_EXPORT int    nci_i(void);
+PARROT_DYNEXT_EXPORT int    nci_ib(int *);
+PARROT_DYNEXT_EXPORT int    nci_iiii(int, int, int);
+PARROT_DYNEXT_EXPORT int    nci_ii3(int, int *);
+PARROT_DYNEXT_EXPORT int    nci_ip(void *);
+PARROT_DYNEXT_EXPORT int    nci_isc(short, char);
+PARROT_DYNEXT_EXPORT int    nci_it(void *);
+PARROT_DYNEXT_EXPORT int    nci_i33(int *, int *);
+PARROT_DYNEXT_EXPORT int    nci_i4i(long *, int);
+PARROT_DYNEXT_EXPORT long   nci_l(void);
+PARROT_DYNEXT_EXPORT int *  nci_p(void);
+PARROT_DYNEXT_EXPORT void * nci_pi(int);
+PARROT_DYNEXT_EXPORT void * nci_pii(int, int);
+PARROT_DYNEXT_EXPORT void * nci_piiii(int, int, int, int);
+PARROT_DYNEXT_EXPORT void   nci_pip(int, Rect_Like *);
+PARROT_DYNEXT_EXPORT void * nci_pp(void *);
+PARROT_DYNEXT_EXPORT short  nci_s(void);
+PARROT_DYNEXT_EXPORT short  nci_ssc(short, char);
+PARROT_DYNEXT_EXPORT char * nci_t(void);
+PARROT_DYNEXT_EXPORT char * nci_tb(void *);
+PARROT_DYNEXT_EXPORT char * nci_tB(void **);
+PARROT_DYNEXT_EXPORT char * nci_tt(char *);
+PARROT_DYNEXT_EXPORT void   nci_v(void);
+PARROT_DYNEXT_EXPORT void   nci_vP(void *);
+PARROT_DYNEXT_EXPORT void   nci_vpii(Outer *, int, int);
+PARROT_DYNEXT_EXPORT void   nci_vv(void);
+PARROT_DYNEXT_EXPORT void   nci_vVi(Opaque**, int);
+PARROT_DYNEXT_EXPORT void   nci_vp(Opaque*);
+PARROT_DYNEXT_EXPORT char * nci_ttt(char *, char *);
+PARROT_DYNEXT_EXPORT void   nci_vfff(float, float, float);
+PARROT_DYNEXT_EXPORT void   nci_vV(const char **);
+PARROT_DYNEXT_EXPORT void   nci_vVVV(const char **, const char **, const char **);
 
 /* Declarations for callback tests */
 
 typedef void (*cb_C1_func)(const char*, void*);
-PARROT_EXPORT void nci_cb_C1(cb_C1_func, void*);
+PARROT_DYNEXT_EXPORT void nci_cb_C1(cb_C1_func, void*);
 
 typedef void (*cb_C2_func)(int, void*);
-PARROT_EXPORT void nci_cb_C2(cb_C2_func, void*);
+PARROT_DYNEXT_EXPORT void nci_cb_C2(cb_C2_func, void*);
 
 typedef void (*cb_C3_func)(void*, void*);
-PARROT_EXPORT void nci_cb_C3(cb_C3_func, void*);
+PARROT_DYNEXT_EXPORT void nci_cb_C3(cb_C3_func, void*);
 
 typedef void (*cb_D1_func)(void*, const char*);
-PARROT_EXPORT void nci_cb_D1(cb_D1_func, void*);
+PARROT_DYNEXT_EXPORT void nci_cb_D1(cb_D1_func, void*);
 
 typedef void (*cb_D2_func)(void*, int);
-PARROT_EXPORT void nci_cb_D2(cb_D2_func, void*);
+PARROT_DYNEXT_EXPORT void nci_cb_D2(cb_D2_func, void*);
 
 typedef void (*cb_D3_func)(void*, void*);
-PARROT_EXPORT void nci_cb_D3(cb_D3_func, void*);
+PARROT_DYNEXT_EXPORT void nci_cb_D3(cb_D3_func, void*);
 
 typedef void (*cb_D4_func)(void*, void*);
-PARROT_EXPORT void nci_cb_D4(cb_D4_func, void*);
+PARROT_DYNEXT_EXPORT void nci_cb_D4(cb_D4_func, void*);
 
 /* Variable definitions */
 
-PARROT_EXPORT int    int_cb_D4           = -55555;
-PARROT_EXPORT int    nci_dlvar_char      = 22;
-PARROT_EXPORT int    nci_dlvar_short     = 333;
-PARROT_EXPORT int    nci_dlvar_int       = -4444;
-PARROT_EXPORT long   nci_dlvar_long      = -7777777;
-PARROT_EXPORT float  nci_dlvar_float     = -333.0;
-PARROT_EXPORT double nci_dlvar_double    = -55555.55555;
-PARROT_EXPORT char   nci_dlvar_cstring[] = "This is a C-string.\n";
+PARROT_DYNEXT_EXPORT int    int_cb_D4           = -55555;
+PARROT_DYNEXT_EXPORT int    nci_dlvar_char      = 22;
+PARROT_DYNEXT_EXPORT int    nci_dlvar_short     = 333;
+PARROT_DYNEXT_EXPORT int    nci_dlvar_int       = -4444;
+PARROT_DYNEXT_EXPORT long   nci_dlvar_long      = -7777777;
+PARROT_DYNEXT_EXPORT float  nci_dlvar_float     = -333.0;
+PARROT_DYNEXT_EXPORT double nci_dlvar_double    = -55555.55555;
+PARROT_DYNEXT_EXPORT char   nci_dlvar_cstring[] = "This is a C-string.\n";
 
 
 /* Function definitions */
 
 /*
 
-=item C<PARROT_EXPORT char
-nci_c(void)>
+=item C<PARROT_DYNEXT_EXPORT char nci_c(void)>
 
 Returns the value of the variable C<nci_dlvar_char>, which is set to 22 by
 default.
@@ -159,15 +159,14 @@
 
 */
 
-PARROT_EXPORT char
+PARROT_DYNEXT_EXPORT char
 nci_c(void) {
     return nci_dlvar_char;
 }
 
 /*
 
-=item C<PARROT_EXPORT char
-nci_csc(short l1, char l2)>
+=item C<PARROT_DYNEXT_EXPORT char nci_csc(short l1, char l2)>
 
 Multiplies C<l1> and C<l2> together and returns the first byte of the result.
 
@@ -175,7 +174,7 @@
 
 */
 
-PARROT_EXPORT char
+PARROT_DYNEXT_EXPORT char
 nci_csc(short l1, char l2)
 {
     return l1 * l2;
@@ -183,8 +182,7 @@
 
 /*
 
-=item C<PARROT_EXPORT double
-nci_d(void)>
+=item C<PARROT_DYNEXT_EXPORT double nci_d(void)>
 
 Multiplies the current value of C<nci_dlvar_double> by 10.0, and returns
 the new value.
@@ -193,7 +191,7 @@
 
 */
 
-PARROT_EXPORT double
+PARROT_DYNEXT_EXPORT double
 nci_d(void)
 {
     nci_dlvar_double *= 10.0;
@@ -203,8 +201,7 @@
 
 /*
 
-=item C<PARROT_EXPORT double
-nci_dd(double d)>
+=item C<PARROT_DYNEXT_EXPORT double nci_dd(double d)>
 
 Returns the value C<d> multiplied by 2.0.
 
@@ -212,7 +209,7 @@
 
 */
 
-PARROT_EXPORT double
+PARROT_DYNEXT_EXPORT double
 nci_dd(double d)
 {
     return d * 2.0;
@@ -220,8 +217,7 @@
 
 /*
 
-=item C<PARROT_EXPORT float
-nci_f(void)>
+=item C<PARROT_DYNEXT_EXPORT float nci_f(void)>
 
 Multiplies the value C<nci_dlvar_float> by 10.0 and returns the new
 value.
@@ -230,7 +226,7 @@
 
 */
 
-PARROT_EXPORT float
+PARROT_DYNEXT_EXPORT float
 nci_f(void)
 {
     nci_dlvar_float *= 10.0;
@@ -240,8 +236,7 @@
 
 /*
 
-=item C<PARROT_EXPORT float
-nci_fff(float l1, float l2)>
+=item C<PARROT_DYNEXT_EXPORT float nci_fff(float l1, float l2)>
 
 Returns the result of C<l1> / C<l2>.
 
@@ -249,7 +244,7 @@
 
 */
 
-PARROT_EXPORT float
+PARROT_DYNEXT_EXPORT float
 nci_fff(float l1, float l2)
 {
     return l1 / l2;
@@ -257,8 +252,7 @@
 
 /*
 
-=item C<PARROT_EXPORT int
-nci_i(void)>
+=item C<PARROT_DYNEXT_EXPORT int nci_i(void)>
 
 Returns the current value of <nci_dlvar_int>.
 
@@ -266,16 +260,15 @@
 
 */
 
-PARROT_EXPORT int
+PARROT_DYNEXT_EXPORT int
 nci_i(void)
 {
-   return nci_dlvar_int;
+    return nci_dlvar_int;
 }
 
 /*
 
-=item C<PARROT_EXPORT int
-nci_isc(short l1, char l2)>
+=item C<PARROT_DYNEXT_EXPORT int nci_isc(short l1, char l2)>
 
 Returns the int product of C<l1 * l2>.
 
@@ -283,7 +276,7 @@
 
 */
 
-PARROT_EXPORT int
+PARROT_DYNEXT_EXPORT int
 nci_isc(short l1, char l2)
 {
     return l1 * l2;
@@ -291,8 +284,7 @@
 
 /*
 
-=item C<PARROT_EXPORT int
-nci_ip(void *p)>
+=item C<PARROT_DYNEXT_EXPORT int nci_ip(void *p)>
 
 Performs a series of operations on values stored at pointer C<p>.
 
@@ -300,7 +292,7 @@
 
 */
 
-PARROT_EXPORT int
+PARROT_DYNEXT_EXPORT int
 nci_ip(void *p)
 {
     typedef struct _dfi {
@@ -318,16 +310,15 @@
 
 /*
 
-=item C<PARROT_EXPORT int
-nci_it(void *p)>
+=item C<PARROT_DYNEXT_EXPORT int nci_it(void *p)>
 
-test calls this with a string
+Prints the first two characters in C<p>, in reversed order.  Returns 2.
 
 =cut
 
 */
 
-PARROT_EXPORT int
+PARROT_DYNEXT_EXPORT int
 nci_it(void *p)
 {
     fprintf(stderr, "%c%c\n", ((char*) p)[1], ((char *) p)[0]);
@@ -338,8 +329,7 @@
 
 /*
 
-=item C<PARROT_EXPORT long
-nci_l(void)>
+=item C<PARROT_DYNEXT_EXPORT long nci_l(void)>
 
 Returns the value of C<nci_dlvar_long>.
 
@@ -347,7 +337,7 @@
 
 */
 
-PARROT_EXPORT long
+PARROT_DYNEXT_EXPORT long
 nci_l(void)
 {
     return nci_dlvar_long;
@@ -355,8 +345,7 @@
 
 /*
 
-=item C<PARROT_EXPORT int *
-nci_p(void)>
+=item C<PARROT_DYNEXT_EXPORT int * nci_p(void)>
 
 Returns the address of C<nci_dlvar_int>.
 
@@ -364,7 +353,7 @@
 
 */
 
-PARROT_EXPORT int *
+PARROT_DYNEXT_EXPORT int *
 nci_p(void)
 {
     return &nci_dlvar_int;
@@ -372,8 +361,7 @@
 
 /*
 
-=item C<PARROT_EXPORT char *
-nci_t(void)>
+=item C<PARROT_DYNEXT_EXPORT char * nci_t(void)>
 
 Returns the value of C<nci_dlvar_cstring>.
 
@@ -381,7 +369,7 @@
 
 */
 
-PARROT_EXPORT char *
+PARROT_DYNEXT_EXPORT char *
 nci_t(void)
 {
     return nci_dlvar_cstring;
@@ -389,10 +377,9 @@
 
 /*
 
-=item C<PARROT_EXPORT char *
-nci_tb(void *p)>
+=item C<PARROT_DYNEXT_EXPORT char * nci_tb(void *p)>
 
-Prints "xx worked", where "xx" is replaced with the first two character values
+Returns "xx worked", where "xx" is replaced with the first two character values
 of C<p>, in reverse order.
 
 =cut
@@ -401,7 +388,7 @@
 
 static char b[] = "xx worked\n";
 
-PARROT_EXPORT char *
+PARROT_DYNEXT_EXPORT char *
 nci_tb(void *p)
 {
     b[0] = ((char*) p)[1];
@@ -412,10 +399,9 @@
 
 /*
 
-=item C<PARROT_EXPORT char *
-nci_tt(void *p)>
+=item C<PARROT_DYNEXT_EXPORT char * nci_tt(char *p)>
 
-Prints "xx worked", where "xx" is replaced with the first two character values
+Returns "xx worked", where "xx" is replaced with the first two character values
 of C<p>, in reverse order.
 
 =cut
@@ -424,21 +410,20 @@
 
 static char s[] = "xx worked\n";
 
-PARROT_EXPORT char *
-nci_tt(void *p)
+PARROT_DYNEXT_EXPORT char *
+nci_tt(char *p)
 {
-    s[0] = ((char*) p)[1];
-    s[1] = ((char*) p)[0];
+    s[0] = p[1];
+    s[1] = p[0];
 
     return s;
 }
 
 /*
 
-=item C<PARROT_EXPORT char *
-nci_tB(void **p)>
+=item C<PARROT_DYNEXT_EXPORT char * nci_tB(void **p)>
 
-Prints "xx done", where "xx" is replaced with the first two character values
+Returns "xx done", where "xx" is replaced with the first two character values
 of C<p>, in reverse order.
 
 =cut
@@ -447,7 +432,7 @@
 
 static char B[] = "xx done\n";
 
-PARROT_EXPORT char *
+PARROT_DYNEXT_EXPORT char *
 nci_tB(void **p)
 {
     B[0] = (*(char**) p)[1];
@@ -458,8 +443,7 @@
 
 /*
 
-=item C<PARROT_EXPORT void *
-nci_pp(void *p)>
+=item C<PARROT_DYNEXT_EXPORT void * nci_pp(void *p)>
 
 Returns the value C<p> directly.
 
@@ -467,7 +451,7 @@
 
 */
 
-PARROT_EXPORT void *
+PARROT_DYNEXT_EXPORT void *
 nci_pp(void *p)
 {
     return p;
@@ -475,16 +459,16 @@
 
 /*
 
-=item C<PARROT_EXPORT int
-nci_iiii(int i1, int i2, int i3)>
+=item C<PARROT_DYNEXT_EXPORT int nci_iiii(int i1, int i2, int i3)>
 
 Prints three integers separated by whitespace to C<stderr>.
+Returns 2.
 
 =cut
 
 */
 
-PARROT_EXPORT int
+PARROT_DYNEXT_EXPORT int
 nci_iiii(int i1, int i2, int i3)
 {
     fprintf(stderr, "%d %d %d\n", i1, i2, i3);
@@ -495,8 +479,7 @@
 
 /*
 
-=item C<PARROT_EXPORT int
-nci_i4i(long * l, int i)>
+=item C<PARROT_DYNEXT_EXPORT int nci_i4i(long * l, int i)>
 
 Returns the product of C<*l> and C<i>, as an int.
 
@@ -504,7 +487,7 @@
 
 */
 
-PARROT_EXPORT int
+PARROT_DYNEXT_EXPORT int
 nci_i4i(long * l, int i)
 {
 
@@ -513,8 +496,7 @@
 
 /*
 
-=item C<PARROT_EXPORT int
-nci_ii3(int a, int *bp)>
+=item C<PARROT_DYNEXT_EXPORT int nci_ii3(int a, int *bp)>
 
 Multiplies C<a> and C<*bp> together and returns the result. Updates C<*bp>
 to the value  4711.
@@ -523,7 +505,7 @@
 
 */
 
-PARROT_EXPORT int
+PARROT_DYNEXT_EXPORT int
 nci_ii3(int a, int *bp)
 {
     int r = a * *bp;
@@ -534,8 +516,7 @@
 
 /*
 
-=item C<PARROT_EXPORT int
-call_back(const char *str)>
+=item C<PARROT_DYNEXT_EXPORT int call_back(const char *str)>
 
 writes the string C<str> to stdout and returns the value 4711.
 
@@ -543,7 +524,7 @@
 
 */
 
-PARROT_EXPORT int
+PARROT_DYNEXT_EXPORT int
 call_back(const char *str)
 {
     puts(str);
@@ -554,8 +535,7 @@
 
 /*
 
-=item C<PARROT_EXPORT void *
-nci_pi(int test)>
+=item C<PARROT_DYNEXT_EXPORT void * nci_pi(int test)>
 
 Performs one from a series of tests, depending on the value given for C<test>.
 
@@ -563,137 +543,139 @@
 
 */
 
-PARROT_EXPORT void *
+PARROT_DYNEXT_EXPORT void *
 nci_pi(int test)
 {
     switch (test) {
-        case 0:
-            {
-                static struct {
-                    int i[2];
-                    char c;
-                } t = {
-                    {42, 100},
-                    'B'
-                };
-                return &t;
-            }
-        case 1:
-            {
-                static struct {
-                    float f[2];
-                    double d;
-                } t = {
-                    {42.0, 100.0},
-                    47.11
-                };
-                return &t;
-            }
-        case 2:
-            {
-                static struct {
-                    char c;
+      case 0:
+        {
+            static struct {
+                int i[2];
+                char c;
+            } t = {
+                {42, 100},
+                'B'
+            };
+            return &t;
+        }
+      case 1:
+        {
+            static struct {
+                float f[2];
+                double d;
+            } t = {
+                {42.0, 100.0},
+                47.11
+            };
+            return &t;
+          }
+      case 2:
+        {
+            static struct {
+                char c;
+                int i;
+            } t = {
+                10,
+                20
+            };
+            return &t;
+        }
+      case 3:
+        {
+            static struct {
+                const char *c;
+                int i;
+            } t = {
+                "hello",
+                20
+            };
+            return &t;
+        }
+      case 4:
+        {
+            static struct _x {
+                int i;
+                int j;
+                double d;
+            } xx = { 100, 77, 200.0 };
+            static struct {
+                char c;
+                struct _x *x;
+            } t = {
+                10,
+                &xx
+            };
+            return &t;
+        }
+      case 5:
+        {
+            static struct {
+                int (*f)(const char *);
+            } t = {
+                call_back
+            };
+            return &t;
+        }
+      case 6:
+        {
+            static struct xt {
+                int x;
+                struct yt {
                     int i;
-                } t = {
-                     10,
-                     20
-                };
-                return &t;
-            }
-        case 3:
-            {
-                static struct {
-                    const char *c;
-                    int i;
-                } t = {
-                     "hello",
-                     20
-                };
-                return &t;
-            }
-        case 4:
-            {
-                static struct _x {
-                    int i;
-                    int j;
-                    double d;
-                } xx = { 100, 77, 200.0 };
-                static struct {
-                    char c;
-                    struct _x *x;
-                } t = {
-                     10,
-                     &xx
-                };
-                return &t;
-            }
-        case 5:
-            {
-                static struct {
-                    int (*f)(const char *);
-                } t = {
-                     call_back
-                };
-                return &t;
-            }
-        case 6:
-            {
-                static struct xt {
-                    int x;
-                    struct yt {
-                        int i;
-                        int  j;
-                    } _y;
-                    int z;
-                } _x = {
-                    32,
-                    { 127, 12345 },
-                    33
-                };
-                return &_x;
-            }
-        case 7:
-            {
-                static struct xt {
-                    char x;
-                    struct yt {
-                        char i;
-                        int  j;
-                    } _y;
-                    char z;
-                } _x = {
-                    32,
-                    { 127, 12345 },
-                    33
-                };
-                return &_x;
-            }
-        case 8:
-            {
-                static struct _z {
+                    int  j;
+                } _y;
+                int z;
+            } _x = {
+                32,
+                { 127, 12345 },
+                33
+            };
+            return &_x;
+        }
+      case 7:
+        {
+            static struct xt {
+                char x;
+                struct yt {
+                    char i;
+                    int  j;
+                } _y;
+                char z;
+            } _x = {
+                32,
+                { 127, 12345 },
+                33
+            };
+            return &_x;
+        }
+      case 8:
+        {
+            static struct _z {
+                int i;
+                int j;
+            } zz = { 100, 77 };
+            static struct xt {
+                int x;
+                struct yt {
                     int i;
                     int j;
-                } zz = { 100, 77 };
-                static struct xt {
-                    int x;
-                    struct yt {
-                        int i;
-                        int j;
-                        struct _z *z;
-                    } _y;
-                } _x = {
-                    32,
-                    { 127, 12345, &zz },
-                };
-                return &_x;
-            }
-        case 9:
-            {
-                static int i = 55555;
-                return &i;
-            }
-        default:
-            fprintf(stderr, "unknown test number\n");
+                    struct _z *z;
+                } _y;
+            } _x = {
+                32,
+                { 127, 12345, &zz },
+            };
+            return &_x;
+        }
+      case 9:
+        {
+            static int i = 55555;
+            return &i;
+        }
+      case 10:
+        return NULL;
+      default:
+        fprintf(stderr, "unknown test number\n");
     }
 
     return NULL;
@@ -701,8 +683,7 @@
 
 /*
 
-=item C<PARROT_EXPORT short
-nci_s(void)>
+=item C<PARROT_DYNEXT_EXPORT short nci_s(void)>
 
 Returns the value of C<nci_dlvar_short>.
 
@@ -710,7 +691,7 @@
 
 */
 
-PARROT_EXPORT short
+PARROT_DYNEXT_EXPORT short
 nci_s(void)
 {
     return nci_dlvar_short;
@@ -718,8 +699,7 @@
 
 /*
 
-=item C<PARROT_EXPORT short
-nci_ssc(short l1, char l2)>
+=item C<PARROT_DYNEXT_EXPORT short nci_ssc(short l1, char l2)>
 
 Returns the product of C<l1 * l2>.
 
@@ -727,7 +707,7 @@
 
 */
 
-PARROT_EXPORT short
+PARROT_DYNEXT_EXPORT short
 nci_ssc(short l1, char l2)
 {
     return l1 * l2;
@@ -735,8 +715,7 @@
 
 /*
 
-=item C<PARROT_EXPORT void
-nci_vP(void *pmc)>
+=item C<PARROT_DYNEXT_EXPORT void nci_vP(void *pmc)>
 
 Prints "ok" if C<PMC> is not null, prints "got null" otherwise.
 
@@ -744,13 +723,17 @@
 
 */
 
-PARROT_EXPORT void
+PARROT_DYNEXT_EXPORT void
 nci_vP(void *pmc)
 {
-    if (pmc)
+    /* TODO:
+     * Disable this test until someone figures a way to check for
+     * PMCNULL without using libparrot.
+    if (!PMC_IS_NULL(pmc))
         puts("ok");
     else
-        puts("got null");
+     */
+    puts("got null");
 }
 
 
@@ -768,8 +751,7 @@
 
 /*
 
-=item C<PARROT_EXPORT void
-nci_cb_C1(cb_C1_func cb, void* user_data)>
+=item C<PARROT_DYNEXT_EXPORT void nci_cb_C1(cb_C1_func cb, void* user_data)>
 
 Calls C<cb> function with the string "result" and the given C<user_data>.
 No return value.
@@ -778,7 +760,7 @@
 
 */
 
-PARROT_EXPORT void
+PARROT_DYNEXT_EXPORT void
 nci_cb_C1(cb_C1_func cb, void* user_data)
 {
     const char *result = "succeeded";
@@ -790,16 +772,16 @@
 
 /*
 
-=item C<PARROT_EXPORT void
-nci_cb_C2(cb_C2_func cb, void* user_data)>
+=item C<PARROT_DYNEXT_EXPORT void nci_cb_C2(cb_C2_func cb, void* user_data)>
 
-Calls the function C<cb> with the pointer C<user_data>. No return value.
+Calls the function C<cb> with the integer 77 and the given C<user_data>.
+No return value.
 
 =cut
 
 */
 
-PARROT_EXPORT void
+PARROT_DYNEXT_EXPORT void
 nci_cb_C2(cb_C2_func cb, void* user_data)
 {
     /* call the cb synchronously */
@@ -810,10 +792,10 @@
 
 /*
 
-=item C<PARROT_EXPORT void
-nci_cb_C3(cb_C3_func cb, void* user_data)>
+=item C<PARROT_DYNEXT_EXPORT void nci_cb_C3(cb_C3_func cb, void* user_data)>
 
-Calls function C<cb> with data C<user_data>. No return value.
+Calls function C<cb> with C<&int_cb_C3> and the givn C<user_data>.
+No return value.
 
 =cut
 
@@ -821,7 +803,7 @@
 
 static int int_cb_C3 = 99;
 
-PARROT_EXPORT void
+PARROT_DYNEXT_EXPORT void
 nci_cb_C3(cb_C3_func cb, void* user_data)
 {
     /* call the cb synchronously */
@@ -832,16 +814,16 @@
 
 /*
 
-=item C<PARROT_EXPORT void
-nci_cb_D1(cb_D1_func cb, void* user_data)>
+=item C<PARROT_DYNEXT_EXPORT void nci_cb_D1(cb_D1_func cb, void* user_data)>
 
-Calls function C<cb> with data C<user_data>. No return value.
+Calls function C<cb> with data C<user_data> and the string "succeeded".
+No return value.
 
 =cut
 
 */
 
-PARROT_EXPORT void
+PARROT_DYNEXT_EXPORT void
 nci_cb_D1(cb_D1_func cb, void* user_data)
 {
     const char *result = "succeeded";
@@ -853,16 +835,16 @@
 
 /*
 
-=item C<PARROT_EXPORT void
-nci_cb_D2(cb_D2_func cb, void* user_data)>
+=item C<PARROT_DYNEXT_EXPORT void nci_cb_D2(cb_D2_func cb, void* user_data)>
 
-Calls function C<cb> with data C<user_data>.
+Calls function C<cb> with data C<user_data> and the integer 88.
+No return value.
 
 =cut
 
 */
 
-PARROT_EXPORT void
+PARROT_DYNEXT_EXPORT void
 nci_cb_D2(cb_D2_func cb, void* user_data)
 {
     /* call the cb synchronously */
@@ -873,10 +855,10 @@
 
 /*
 
-=item C<PARROT_EXPORT void
-nci_cb_D3(cb_D3_func cb, void* user_data)>
+=item C<PARROT_DYNEXT_EXPORT void nci_cb_D3(cb_D3_func cb, void* user_data)>
 
-Calls function C<cb> with data C<user_data>.
+Calls function C<cb> with data C<user_data> and C<&int_cb_D3>.
+No return value.
 
 =cut
 
@@ -884,7 +866,7 @@
 
 static int int_cb_D3 = 111;
 
-PARROT_EXPORT void
+PARROT_DYNEXT_EXPORT void
 nci_cb_D3(cb_D3_func cb, void* user_data)
 {
     /* call the cb synchronously */
@@ -895,16 +877,18 @@
 
 /*
 
-=item C<PARROT_EXPORT void
-nci_cb_D4(cb_D4_func times_ten, void* user_data)>
+=item C<PARROT_DYNEXT_EXPORT void nci_cb_D4(cb_D4_func times_ten, void*
+user_data)>
 
-Calls function C<times_ten> with data C<user_data> 10 times in a loop.
+Calls function C<times_ten> with data C<user_data> and C<&int_cb_D4> 10 times
+in a loop, incrementing C<int_cb_D4> after every call.
+No return value.
 
 =cut
 
 */
 
-PARROT_EXPORT void
+PARROT_DYNEXT_EXPORT void
 nci_cb_D4(cb_D4_func times_ten, void* user_data)
 {
     int cnt;
@@ -919,8 +903,7 @@
 
 /*
 
-=item C<PARROT_EXPORT void
-nci_pip(int count, Rect_Like *rects)>
+=item C<PARROT_DYNEXT_EXPORT void nci_pip(int count, Rect_Like *rects)>
 
 Prints a count integer and the coordinates of 4 rectangles.
 
@@ -928,7 +911,7 @@
 
 */
 
-PARROT_EXPORT void
+PARROT_DYNEXT_EXPORT void
 nci_pip(int count, Rect_Like *rects)
 {
     int i;
@@ -940,16 +923,15 @@
 
 /*
 
-=item C<PARROT_EXPORT int
-nci_i33(int *double_me, int *triple_me)>
+=item C<PARROT_DYNEXT_EXPORT int nci_i33(int *double_me, int *triple_me)>
 
-Returns the result C<*double_me * 2 + *triple_me * 3>.
+Doubles C<double_me> and triples C<triple_me>. Returns their sum.
 
 =cut
 
 */
 
-PARROT_EXPORT int
+PARROT_DYNEXT_EXPORT int
 nci_i33(int *double_me, int *triple_me)
 {
     *double_me *= 2;
@@ -960,8 +942,7 @@
 
 /*
 
-=item C<PARROT_EXPORT void
-nci_vpii(Outer *my_data, int my_x, int my_y)>
+=item C<PARROT_DYNEXT_EXPORT void nci_vpii(Outer *my_data, int my_x, int my_y)>
 
 Updates data in structure pointer C<my_data> with the given data C<my_x> and
 C<my_y>.
@@ -970,7 +951,7 @@
 
 */
 
-PARROT_EXPORT void
+PARROT_DYNEXT_EXPORT void
 nci_vpii(Outer *my_data, int my_x, int my_y)
 {
     my_data->x            = my_x;
@@ -979,8 +960,8 @@
 
 /*
 
-=item C<PARROT_EXPORT void *
-nci_piiii(int alpha, int beta, int gamma, int delta)>
+=item C<PARROT_DYNEXT_EXPORT void * nci_piiii(int alpha, int beta, int gamma,
+int delta)>
 
 Stores 4 integer values into an array structure, and returns the address
 of that structure.
@@ -991,7 +972,7 @@
 
 static int my_array[4];
 
-PARROT_EXPORT void *
+PARROT_DYNEXT_EXPORT void *
 nci_piiii(int alpha, int beta, int gamma, int delta)
 {
     static struct array_container
@@ -1013,8 +994,7 @@
 
 /*
 
-=item C<PARROT_EXPORT void *
-nci_pii(int fac1, int fac2)>
+=item C<PARROT_DYNEXT_EXPORT void * nci_pii(int fac1, int fac2)>
 
 Returns the address of global variable C<nci_dlvar_int> whose value is set
 to the product of C<fac1 * fac2>.
@@ -1023,18 +1003,17 @@
 
 */
 
-PARROT_EXPORT void *
+PARROT_DYNEXT_EXPORT void *
 nci_pii(int fac1, int fac2)
 {
-   nci_dlvar_int = fac1 * fac2;
+    nci_dlvar_int = fac1 * fac2;
 
-   return &nci_dlvar_int;
+    return &nci_dlvar_int;
 }
 
 /*
 
-=item C<PARROT_EXPORT void
-nci_v(void)>
+=item C<PARROT_DYNEXT_EXPORT void nci_v(void)>
 
 Multiplies the global variable C<nci_dlvar_int> times 10.
 
@@ -1042,7 +1021,7 @@
 
 */
 
-PARROT_EXPORT void
+PARROT_DYNEXT_EXPORT void
 nci_v(void)
 {
     nci_dlvar_int *= 10;
@@ -1050,8 +1029,7 @@
 
 /*
 
-=item C<PARROT_EXPORT void
-nci_vv(void)>
+=item C<PARROT_DYNEXT_EXPORT void nci_vv(void)>
 
 Multiplies the global variable C<nci_dlvar_int> by 3.
 
@@ -1059,7 +1037,7 @@
 
 */
 
-PARROT_EXPORT void
+PARROT_DYNEXT_EXPORT void
 nci_vv(void)
 {
     nci_dlvar_int *= 3;
@@ -1067,8 +1045,7 @@
 
 /*
 
-=item C<PARROT_EXPORT void
-nci_vVi(Opaque**, int)>
+=item C<PARROT_DYNEXT_EXPORT void nci_vVi(Opaque **outOpaque, int x)>
 
 Test an NCI opaque struct out value.
 
@@ -1076,7 +1053,7 @@
 
 */
 
-PARROT_EXPORT void
+PARROT_DYNEXT_EXPORT void
 nci_vVi(Opaque **outOpaque, int x)
 {
     static Opaque opaque;
@@ -1086,8 +1063,7 @@
 
 /*
 
-=item C<PARROT_EXPORT int
-nci_vp(Opaque*)>
+=item C<PARROT_DYNEXT_EXPORT void nci_vp(Opaque *inOpaque)>
 
 Test that a previously generated opaque struct gets passed back
 to an NCI function correctly.
@@ -1096,37 +1072,37 @@
 
 */
 
-PARROT_EXPORT void
+PARROT_DYNEXT_EXPORT void
 nci_vp(Opaque *inOpaque)
 {
     if (inOpaque)
         printf("got %d\n", inOpaque->x);
     else
-        printf("got null");
+        printf("got null\n");
 }
 
 /*
 
-=item C<PARROT_EXPORT char *
-nci_ttt(void *p)>
+=item C<PARROT_DYNEXT_EXPORT char * nci_ttt(char *s1, char *s2)>
 
-Prints "s2, s1, s1d"
+Prints and returns "s2, s2, s1"
 
 =cut
 
 */
 
-PARROT_EXPORT char *
+PARROT_DYNEXT_EXPORT char *
 nci_ttt(char *s1, char *s2)
 {
-    char* s = (char*) malloc(strlen(s2) + (2 * strlen(s1)) + 5);
+    char* s = (char*) malloc((2 * strlen(s2)) + strlen(s1) + 5);
     sprintf(s, "%s, %s, %s", s2, s2, s1);
     printf("%s\n", s);
     return s;
 }
 
 
-static void validate_float(float f, double checkval) {
+static void
+validate_float(float f, double checkval) {
     int valid;
     double error_ratio;
     error_ratio = (((double)f) - checkval) / checkval;
@@ -1136,58 +1112,58 @@
 
 /*
 
-=item C<PARROT_EXPORT float
-nci_fff(float l1, float l2)>
+=item C<PARROT_DYNEXT_EXPORT void nci_vfff(float l1, float l2, float l3)>
 
-Returns the result of C<l1> / C<l2>.
+Checks that C<[ l1, l2, l3 ]> = C<[ 3456.54, 10.1999, 14245.567 ]> within an
+error of 0.01.
 
 =cut
 
 */
 
-PARROT_EXPORT void
+PARROT_DYNEXT_EXPORT void
 nci_vfff(float l1, float l2, float l3)
 {
-  validate_float(l1, 3456.54);
-  validate_float(l2, 10.1999);
-  validate_float(l3, 14245.567);
+    validate_float(l1, 3456.54);
+    validate_float(l2, 10.1999);
+    validate_float(l3, 14245.567);
 }
 
 
 /*
 
-=item C<PARROT_EXPORT float
-nci_fff(float l1, float l2)>
+=item C<PARROT_DYNEXT_EXPORT void nci_vV(const char **ptr)>
 
-Returns the result of C<l1> / C<l2>.
+Sets C<*ptr> to "Hello bright new world\n".
 
 =cut
 
 */
 
-PARROT_EXPORT void
+PARROT_DYNEXT_EXPORT void
 nci_vV(const char **ptr)
 {
-  *ptr = "Hello bright new world\n";
+    *ptr = "Hello bright new world\n";
 }
 
 /*
 
-=item C<PARROT_EXPORT float
-nci_fff(float l1, float l2)>
+=item C<PARROT_DYNEXT_EXPORT void nci_vVVV(const char **ptr1, const char **ptr2,
+const char **ptr3)>
 
-Returns the result of C<l1> / C<l2>.
+Sets C<*ptr1> to "Hello bright new world!\n", C<*ptr2> to "It is a beautiful
+day!\n", and C<*ptr3> to "Go suck a lemon.\n".
 
 =cut
 
 */
 
-PARROT_EXPORT void
+PARROT_DYNEXT_EXPORT void
 nci_vVVV(const char **ptr1, const char **ptr2, const char **ptr3)
 {
-  *ptr1 = "Hello bright new world!\n";
-  *ptr2 = "It is a beautiful day!\n";
-  *ptr3 = "Go suck a lemon.\n";
+    *ptr1 = "Hello bright new world!\n";
+    *ptr2 = "It is a beautiful day!\n";
+    *ptr3 = "Go suck a lemon.\n";
 }
 
 #ifdef TEST
@@ -1197,8 +1173,7 @@
 
 /*
 
-=item C<int
-main(void)>
+=item C<int main(void)>
 
 Calls test functions C<nci_ssc> and C<nci_fff> and prints their results.
 

Modified: branches/orderedhash_revamp/src/oo.c
==============================================================================
--- branches/orderedhash_revamp/src/oo.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/oo.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -71,26 +71,26 @@
 static void invalidate_type_caches(PARROT_INTERP, UINTVAL type)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_C3_merge __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_C3_merge __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(merge_list)
-#define ASSERT_ARGS_debug_trace_find_meth __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(merge_list))
+#define ASSERT_ARGS_debug_trace_find_meth __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(_class) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_fail_if_type_exists __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(_class) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_fail_if_type_exists __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_find_method_direct_1 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_find_method_direct_1 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(_class) \
-    || PARROT_ASSERT_ARG(method_name)
-#define ASSERT_ARGS_get_pmc_proxy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_invalidate_all_caches __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_invalidate_type_caches __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+    , PARROT_ASSERT_ARG(_class) \
+    , PARROT_ASSERT_ARG(method_name))
+#define ASSERT_ARGS_get_pmc_proxy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_invalidate_all_caches __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_invalidate_type_caches __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: static */
 
@@ -109,15 +109,15 @@
 void
 Parrot_oo_extract_methods_from_namespace(PARROT_INTERP, ARGIN(PMC *self), ARGIN(PMC *ns))
 {
-   ASSERT_ARGS(Parrot_oo_extract_methods_from_namespace)
-   PMC *methods, *vtable_overrides;
+    ASSERT_ARGS(Parrot_oo_extract_methods_from_namespace)
+    PMC *methods, *vtable_overrides;
 
     /* Pull in methods from the namespace, if any. */
-   if (PMC_IS_NULL(ns))
-       return;
+    if (PMC_IS_NULL(ns))
+        return;
 
     /* Import any methods. */
-    Parrot_PCCINVOKE(interp, ns, CONST_STRING(interp, "get_associated_methods"), "->P", &methods);
+    Parrot_pcc_invoke_method_from_c_args(interp, ns, CONST_STRING(interp, "get_associated_methods"), "->P", &methods);
 
     if (!PMC_IS_NULL(methods)) {
         PMC * const iter = VTABLE_get_iter(interp, methods);
@@ -131,7 +131,7 @@
     }
 
     /* Import any vtable methods. */
-    Parrot_PCCINVOKE(interp, ns, CONST_STRING(interp, "get_associated_vtable_methods"), "->P", &vtable_overrides);
+    Parrot_pcc_invoke_method_from_c_args(interp, ns, CONST_STRING(interp, "get_associated_vtable_methods"), "->P", &vtable_overrides);
 
     if (!PMC_IS_NULL(vtable_overrides)) {
         PMC * const iter = VTABLE_get_iter(interp, vtable_overrides);
@@ -143,14 +143,7 @@
             /* Look up the name of the vtable function from the index. */
             const INTVAL vtable_index = Parrot_str_to_int(interp, vtable_index_str);
             const char * const meth_c = Parrot_vtable_slot_names[vtable_index];
-            STRING     *vtable_name   = Parrot_str_new(interp, meth_c, 0);
-
-            /* Strip leading underscores in the vtable name */
-            if (Parrot_str_find_index(interp, vtable_name, CONST_STRING(interp, "__"), 0) == 0) {
-                vtable_name = Parrot_str_substr(interp, vtable_name, 2,
-                    Parrot_str_byte_length(interp, vtable_name) - 2, NULL, 0);
-            }
-
+            STRING     * const vtable_name   = Parrot_str_new(interp, meth_c, 0);
             VTABLE_add_vtable_override(interp, self, vtable_name, vtable_sub);
         }
     }
@@ -163,6 +156,9 @@
 
 Lookup a namespace object from a class PMC.
 
+This function is deprecated, see TT #1069.
+Use the inspect interface in the Class PMC instead.
+
 =cut
 
 */
@@ -172,7 +168,7 @@
 PMC *
 Parrot_oo_get_namespace(SHIM_INTERP, ARGIN(const PMC *classobj))
 {
-   ASSERT_ARGS(Parrot_oo_get_namespace)
+    ASSERT_ARGS(Parrot_oo_get_namespace)
     Parrot_Class_attributes * const _class     = PARROT_CLASS(classobj);
     PMC          * const _namespace = _class->_namespace;
 
@@ -207,24 +203,24 @@
     else {
         /* Fast select of behavior based on type of the lookup key */
         switch (key->vtable->base_type) {
-            case enum_class_NameSpace:
-                classobj = VTABLE_get_class(interp, key);
-                break;
-            case enum_class_String:
-            case enum_class_Key:
-            case enum_class_ResizableStringArray:
-                {
+          case enum_class_NameSpace:
+            classobj = VTABLE_get_class(interp, key);
+            break;
+          case enum_class_String:
+          case enum_class_Key:
+          case enum_class_ResizableStringArray:
+            {
                 PMC * const hll_ns = VTABLE_get_pmc_keyed_int(interp,
                                         interp->HLL_namespace,
-                                        CONTEXT(interp)->current_HLL);
+                                        Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp)));
                 PMC * const ns     = Parrot_get_namespace_keyed(interp,
                                         hll_ns, key);
 
                 if (!PMC_IS_NULL(ns))
                     classobj = VTABLE_get_class(interp, ns);
-                }
-            default:
-                break;
+            }
+          default:
+            break;
         }
     }
 
@@ -279,8 +275,7 @@
     if (!PMC_IS_NULL(dest)) {
         PARROT_ASSERT(!PMC_IS_NULL(class_));
         PARROT_ASSERT(class_->vtable->base_type == enum_class_Class);
-        obj = (Parrot_Object_attributes *)
-            Parrot_oo_new_object_attrs(interp, class_);
+        obj    = PARROT_OBJECT(pmc);
         cloned = dest;
     }
     else {
@@ -294,15 +289,15 @@
 
     /* Set custom GC mark and destroy on the object. */
     PObj_custom_mark_SET(cloned);
-    PObj_active_destroy_SET(cloned);
+    PObj_custom_destroy_SET(cloned);
 
     /* Flag that it is an object */
     PObj_is_object_SET(cloned);
 
-    /* Now create the underlying structure, and clone attributes list.class. */
-    cloned_guts               = mem_allocate_zeroed_typed(Parrot_Object_attributes);
-    PMC_data(cloned)          = cloned_guts;
+    /* Now clone attributes list.class. */
+    cloned_guts               = (Parrot_Object_attributes *) PMC_data(cloned);
     cloned_guts->_class       = obj->_class;
+    cloned_guts->attrib_store = NULL;
     cloned_guts->attrib_store = VTABLE_clone(interp, obj->attrib_store);
     num_attrs                 = VTABLE_elements(interp, cloned_guts->attrib_store);
     for (i = 0; i < num_attrs; i++) {
@@ -335,31 +330,6 @@
 
 /*
 
-=item C<void * Parrot_oo_new_object_attrs(PARROT_INTERP, PMC * class_)>
-
-Create a new C<Parrot_Object_attributes> structure, which is the thing that
-holds data for an Object PMC. We need this for places where a new Object
-is being created without being instantiated by it's associated class, such
-as in C<Parrot_oo_clone_object>.
-
-=cut
-
-*/
-
-PARROT_CANNOT_RETURN_NULL
-void *
-Parrot_oo_new_object_attrs(PARROT_INTERP, ARGIN(PMC * class_))
-{
-    ASSERT_ARGS(Parrot_oo_new_object_attrs)
-    Parrot_Object_attributes * const obj_guts =
-        mem_allocate_typed(Parrot_Object_attributes);
-    obj_guts->_class       = class_;
-    obj_guts->attrib_store = pmc_new(interp, enum_class_ResizablePMCArray);
-    return (void *)obj_guts;
-}
-
-/*
-
 =item C<static PMC * get_pmc_proxy(PARROT_INTERP, INTVAL type)>
 
 Get the PMC proxy for a PMC with the given type, creating it if does not exist.
@@ -381,10 +351,17 @@
 get_pmc_proxy(PARROT_INTERP, INTVAL type)
 {
     ASSERT_ARGS(get_pmc_proxy)
+    PMC * type_class;
 
     /* Check if not a PMC or invalid type number */
     if (type > interp->n_vtable_max || type <= 0)
         return PMCNULL;
+
+    type_class = interp->vtables[type]->pmc_class;
+    if (type != enum_class_Class
+        && type_class->vtable->base_type == enum_class_Class) {
+        return type_class;
+    }
     else {
         PMC * const parrot_hll = Parrot_get_namespace_keyed_str(interp, interp->root_namespace, CONST_STRING(interp, "parrot"));
         PMC * const pmc_ns =
@@ -397,7 +374,7 @@
             PMC * const type_num = pmc_new(interp, enum_class_Integer);
             VTABLE_set_integer_native(interp, type_num, type);
             proxy = pmc_new_init(interp, enum_class_PMCProxy, type_num);
-            Parrot_PCCINVOKE(interp, pmc_ns, CONST_STRING(interp, "set_class"), "P->", proxy);
+            Parrot_pcc_invoke_method_from_c_args(interp, pmc_ns, CONST_STRING(interp, "set_class"), "P->", proxy);
         }
         return proxy;
     }
@@ -417,22 +394,27 @@
 PARROT_CAN_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
 PMC *
-Parrot_oo_get_class_str(PARROT_INTERP, ARGIN(STRING *name))
+Parrot_oo_get_class_str(PARROT_INTERP, ARGIN_NULLOK(STRING *name))
 {
     ASSERT_ARGS(Parrot_oo_get_class_str)
 
-    /* First check in current HLL namespace */
-    PMC * const hll_ns = VTABLE_get_pmc_keyed_int(interp, interp->HLL_namespace,
-                           CONTEXT(interp)->current_HLL);
-    PMC * const ns     = Parrot_get_namespace_keyed_str(interp, hll_ns, name);
-    PMC * const _class = PMC_IS_NULL(ns)
-                       ? PMCNULL : VTABLE_get_class(interp, ns);
-
-    /* If not found, check for a PMC */
-    if (PMC_IS_NULL(_class))
-        return get_pmc_proxy(interp, pmc_type(interp, name));
-    else
-        return _class;
+    if (STRING_IS_NULL(name))
+        return PMCNULL;
+    else {
+
+        /* First check in current HLL namespace */
+        PMC * const hll_ns = VTABLE_get_pmc_keyed_int(interp, interp->HLL_namespace,
+                               Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp)));
+        PMC * const ns     = Parrot_get_namespace_keyed_str(interp, hll_ns, name);
+        PMC * const _class = PMC_IS_NULL(ns)
+                           ? PMCNULL : VTABLE_get_class(interp, ns);
+
+        /* If not found, check for a PMC */
+        if (PMC_IS_NULL(_class))
+            return get_pmc_proxy(interp, pmc_type(interp, name));
+        else
+            return _class;
+    }
 }
 
 
@@ -477,6 +459,7 @@
 
 */
 
+PARROT_EXPORT
 PARROT_CAN_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
 PMC *
@@ -504,6 +487,7 @@
 
 */
 
+PARROT_EXPORT
 PARROT_CAN_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
 PMC *
@@ -515,11 +499,7 @@
     PMC                            *result =
         VTABLE_get_pmc_keyed_str(interp, _class->parent_overrides, name);
 
-    if (!PMC_IS_NULL(result))
-        return result;
-    else if (VTABLE_exists_keyed_str(interp, _class->parent_overrides, name))
-        return PMCNULL;
-    else {
+    if (PMC_IS_NULL(result)) {
         /* Walk and search for the vtable method. */
         const INTVAL num_classes = VTABLE_elements(interp, _class->all_parents);
         INTVAL       i;
@@ -535,11 +515,13 @@
             if (!PMC_IS_NULL(result))
                 break;
         }
-
+        if (PMC_IS_NULL(result))
+            result = pmc_new(interp, enum_class_Undef);
         VTABLE_set_pmc_keyed_str(interp, _class->parent_overrides, name, result);
-
-        return result;
     }
+    if (result->vtable->base_type == enum_class_Undef)
+        result = PMCNULL;
+    return result;
 }
 
 
@@ -620,33 +602,6 @@
 
 /*
 
-=item C<const char* Parrot_MMD_method_name(PARROT_INTERP, INTVAL idx)>
-
-Return the method name for the given MMD enum.
-
-{{**DEPRECATE**}}
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_PURE_FUNCTION
-PARROT_CAN_RETURN_NULL
-const char*
-Parrot_MMD_method_name(SHIM_INTERP, INTVAL idx)
-{
-    ASSERT_ARGS(Parrot_MMD_method_name)
-    PARROT_ASSERT(idx >= 0);
-
-    if (idx >= MMD_USER_FIRST)
-        return NULL;
-
-    return Parrot_mmd_func_names[idx];
-}
-
-/*
-
 =item C<static INTVAL fail_if_type_exists(PARROT_INTERP, PMC *name)>
 
 This function throws an exception if a PMC or class with the same name *
@@ -668,24 +623,24 @@
         return 0;
 
     switch (VTABLE_type(interp, value)) {
-        case enum_class_NameSpace:
-            return 0;
-            break;
-        case enum_class_Integer:
-            {
-                const INTVAL type = VTABLE_get_integer(interp, value);
-                if (type < enum_type_undef)  {
-                    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+      case enum_class_NameSpace:
+        return 0;
+        break;
+      case enum_class_Integer:
+        {
+            const INTVAL type = VTABLE_get_integer(interp, value);
+            if (type < enum_type_undef)  {
+                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
                             "native type with name '%s' already exists - "
                             "can't register Class", data_types[type].name);
-                }
-                return type;
             }
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INTERP_ERROR,
+            return type;
+        }
+        break;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INTERP_ERROR,
                     "Unrecognized class name PMC type");
-            break;
+        break;
     }
 }
 
@@ -772,7 +727,7 @@
         for (entry = 0; entry < TBL_SIZE; ++entry) {
             Meth_cache_entry *e = mc->idx[type][entry];
             while (e) {
-                Parrot_gc_mark_PObj_alive(interp, (PObj *)e->pmc);
+                Parrot_gc_mark_PMC_alive(interp, e->pmc);
                 e = e->next;
             }
         }
@@ -927,14 +882,6 @@
         invalidate_type_caches(interp, (UINTVAL)type);
 }
 
-
-/*
- * quick'n'dirty method cache
- * RT #45987: use a hash if method_name is not constant
- *       i.e. from obj.$Sreg(args)
- *       If this hash is implemented mark it during GC
- */
-
 /*
 
 =item C<PMC * Parrot_find_method_direct(PARROT_INTERP, PMC *_class, STRING
@@ -991,23 +938,23 @@
 Parrot_find_method_with_cache(PARROT_INTERP, ARGIN(PMC *_class), ARGIN(STRING *method_name))
 {
     ASSERT_ARGS(Parrot_find_method_with_cache)
-    UINTVAL type, bits;
 
+    UINTVAL type, bits;
     Caches           *mc;
-    Meth_cache_entry *e, *old;
+    Meth_cache_entry *e;
 
     PARROT_ASSERT(method_name != 0);
 
 #if DISABLE_METH_CACHE
     return Parrot_find_method_direct(interp, _class, method_name);
-#endif
+#else
 
     if (! PObj_constant_TEST(method_name))
         return Parrot_find_method_direct(interp, _class, method_name);
 
     mc   = interp->caches;
     type = _class->vtable->base_type;
-    bits = (((UINTVAL) method_name->strstart) >> 2) & TBL_SIZE_MASK;
+    bits = (((UINTVAL) Buffer_bufstart(method_name)) >> 2) & TBL_SIZE_MASK;
 
     if (type >= mc->mc_size) {
         if (mc->idx) {
@@ -1027,10 +974,8 @@
     }
 
     e   = mc->idx[type][bits];
-    old = NULL;
 
-    while (e && e->strstart != method_name->strstart) {
-        old = e;
+    while (e && e->strstart != Buffer_bufstart(method_name)) {
         e   = e->next;
     }
 
@@ -1038,17 +983,16 @@
         /* when here no or no correct entry was at [bits] */
         e     = mem_allocate_typed(Meth_cache_entry);
 
-        if (old)
-            old->next = e;
-        else
-            mc->idx[type][bits] = e;
+        mc->idx[type][bits] = e;
 
         e->pmc      = Parrot_find_method_direct(interp, _class, method_name);
         e->next     = NULL;
-        e->strstart = method_name->strstart;
+        e->strstart = Buffer_bufstart(method_name);
     }
 
     return e->pmc;
+
+#endif
 }
 
 
@@ -1250,7 +1194,12 @@
 
 =item C<PMC* Parrot_ComputeMRO_C3(PARROT_INTERP, PMC *_class)>
 
-Computes the C3 linearization for the given class.
+Computes the C3 linearization for the given class. C3 is an algorithm to
+compute the method resolution order (MRO) of a class that is inheriting
+from multiple parent classes (multiple inheritance). C3 was first described
+by Barrett et al at:
+
+F<http://192.220.96.201/dylan/linearization-oopsla96.html>
 
 =cut
 
@@ -1361,7 +1310,7 @@
             return;
 
     /* Get the methods from the role. */
-    Parrot_PCCINVOKE(interp, role, CONST_STRING(interp, "methods"), "->P", &methods);
+    Parrot_pcc_invoke_method_from_c_args(interp, role, CONST_STRING(interp, "methods"), "->P", &methods);
 
     if (PMC_IS_NULL(methods))
         return;
@@ -1506,7 +1455,7 @@
      * that it did itself. Note that we already have the correct methods
      * as roles "flatten" the methods they get from other roles into their
      * own method list. */
-    Parrot_PCCINVOKE(interp, role, CONST_STRING(interp, "roles"), "->P", &roles_of_role);
+    Parrot_pcc_invoke_method_from_c_args(interp, role, CONST_STRING(interp, "roles"), "->P", &roles_of_role);
     roles_of_role_count = VTABLE_elements(interp, roles_of_role);
 
     for (i = 0; i < roles_of_role_count; i++) {

Modified: branches/orderedhash_revamp/src/ops/bit.ops
==============================================================================
--- branches/orderedhash_revamp/src/ops/bit.ops	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/ops/bit.ops	Sat Jan 23 01:49:53 2010	(r43541)
@@ -3,6 +3,7 @@
 ** bit.ops
 */
 
+BEGIN_OPS_PREAMBLE
  /* Signed shift operator that is compatible with PMC shifts.  This is
   * guaranteed to produce the same result as bitwise_left_shift_internal modulo
   * word size, ignoring the fact that Parrot integers are always signed.  This
@@ -18,7 +19,7 @@
      : (bits) > -8*INTVAL_SIZE   ? (number) >> -(bits)   \
      : 0)
 
-VERSION = PARROT_VERSION;
+END_OPS_PREAMBLE
 
 =head1 NAME
 
@@ -58,27 +59,27 @@
 =cut
 
 inline op band(inout INT, in INT) :base_core {
-  $1 &= $2;
+    $1 &= $2;
 }
 
 inline op band(invar PMC, in INT) :base_core {
-      VTABLE_i_bitwise_and_int(interp, $1, $2);
+    VTABLE_i_bitwise_and_int(interp, $1, $2);
 }
 
 inline op band(invar PMC, invar PMC) :base_core {
-      VTABLE_i_bitwise_and(interp, $1, $2);
+    VTABLE_i_bitwise_and(interp, $1, $2);
 }
 
 inline op band(out INT, in INT, in INT) :base_core {
-  $1 = $2 & $3;
+    $1 = $2 & $3;
 }
 
 inline op band(invar PMC, invar PMC, in INT) :base_core {
-      $1 = VTABLE_bitwise_and_int(interp, $2, $3, $1);
+    $1 = VTABLE_bitwise_and_int(interp, $2, $3, $1);
 }
 
 inline op band(invar PMC, invar PMC, invar PMC) :base_core {
-      $1 = VTABLE_bitwise_and(interp, $2, $3, $1);
+    $1 = VTABLE_bitwise_and(interp, $2, $3, $1);
 }
 
 =item B<bands>(inout STR, in STR)
@@ -102,27 +103,27 @@
 =cut
 
 inline op bands(inout STR, in STR) :base_core {
-  Parrot_str_bitwise_and(interp, $1, $2, &$1);
+    Parrot_str_bitwise_and(interp, $1, $2, &$1);
 }
 
 inline op bands(invar PMC, in STR) :base_core {
-      VTABLE_i_bitwise_ands_str(interp, $1, $2);
+    VTABLE_i_bitwise_ands_str(interp, $1, $2);
 }
 
 inline op bands(invar PMC, invar PMC) :base_core {
-      VTABLE_i_bitwise_ands(interp, $1, $2);
+    VTABLE_i_bitwise_ands(interp, $1, $2);
 }
 
 inline op bands(out STR, in STR, in STR) :base_core {
-  $1 = Parrot_str_bitwise_and(interp, $2, $3, NULL);
+    $1 = Parrot_str_bitwise_and(interp, $2, $3, NULL);
 }
 
 inline op bands(invar PMC, invar PMC, in STR) :base_core {
-      $1 = VTABLE_bitwise_ands_str(interp, $2, $3, $1);
+    $1 = VTABLE_bitwise_ands_str(interp, $2, $3, $1);
 }
 
 inline op bands(invar PMC, invar PMC, invar PMC) :base_core {
-      $1 = VTABLE_bitwise_ands(interp, $2, $3, $1);
+    $1 = VTABLE_bitwise_ands(interp, $2, $3, $1);
 }
 
 ########################################
@@ -140,19 +141,19 @@
 =cut
 
 inline op bnot(inout INT) :base_core {
-  $1 = ~ $1;
+    $1 = ~ $1;
 }
 
 inline op bnot(out INT, in INT) :base_core {
-  $1 = ~ $2;
+    $1 = ~ $2;
 }
 
 inline op bnot(invar PMC) :base_core {
-  VTABLE_i_bitwise_not(interp, $1);
+    VTABLE_i_bitwise_not(interp, $1);
 }
 
 inline op bnot(out PMC, invar PMC) :base_core {
-  $1 = VTABLE_bitwise_not(interp, $2, $1);
+    $1 = VTABLE_bitwise_not(interp, $2, $1);
 }
 
 =item B<bnots>(inout STR)
@@ -166,19 +167,19 @@
 =cut
 
 inline op bnots(inout STR) :base_core {
-  Parrot_str_bitwise_not(interp, $1, &$1);
+    Parrot_str_bitwise_not(interp, $1, &$1);
 }
 
 inline op bnots(out STR, in STR) :base_core {
-  Parrot_str_bitwise_not(interp, $2, &$1);
+    Parrot_str_bitwise_not(interp, $2, &$1);
 }
 
 inline op bnots(invar PMC) :base_core {
-  VTABLE_i_bitwise_nots(interp, $1);
+    VTABLE_i_bitwise_nots(interp, $1);
 }
 
 inline op bnots(out PMC, invar PMC) :base_core {
-  $1 = VTABLE_bitwise_nots(interp, $2, $1);
+    $1 = VTABLE_bitwise_nots(interp, $2, $1);
 }
 
 ########################################
@@ -204,27 +205,27 @@
 =cut
 
 inline op bor(inout INT, in INT) :base_core {
-  $1 |= $2;
+    $1 |= $2;
 }
 
 inline op bor(invar PMC, in INT) :base_core {
-      VTABLE_i_bitwise_or_int(interp, $1, $2);
+    VTABLE_i_bitwise_or_int(interp, $1, $2);
 }
 
 inline op bor(invar PMC, invar PMC) :base_core {
-      VTABLE_i_bitwise_or(interp, $1, $2);
+    VTABLE_i_bitwise_or(interp, $1, $2);
 }
 
 inline op bor(out INT, in INT, in INT) :base_core {
-  $1 = $2 | $3;
+    $1 = $2 | $3;
 }
 
 inline op bor(invar PMC, invar PMC, in INT) :base_core {
-      $1 = VTABLE_bitwise_or_int(interp, $2, $3, $1);
+    $1 = VTABLE_bitwise_or_int(interp, $2, $3, $1);
 }
 
 inline op bor(invar PMC, invar PMC, invar PMC) :base_core {
-      $1 = VTABLE_bitwise_or(interp, $2, $3, $1);
+    $1 = VTABLE_bitwise_or(interp, $2, $3, $1);
 }
 
 =item B<bors>(inout STR, in STR)
@@ -248,27 +249,27 @@
 =cut
 
 inline op bors(inout STR, in STR) :base_core {
-  Parrot_str_bitwise_or(interp, $1, $2, &$1);
+    Parrot_str_bitwise_or(interp, $1, $2, &$1);
 }
 
 inline op bors(invar PMC, in STR) :base_core {
-      VTABLE_i_bitwise_ors_str(interp, $1, $2);
+    VTABLE_i_bitwise_ors_str(interp, $1, $2);
 }
 
 inline op bors(invar PMC, invar PMC) :base_core {
-      VTABLE_i_bitwise_ors(interp, $1, $2);
+    VTABLE_i_bitwise_ors(interp, $1, $2);
 }
 
 inline op bors(out STR, in STR, in STR) :base_core {
-  $1 = Parrot_str_bitwise_or(interp, $2, $3, NULL);
+    $1 = Parrot_str_bitwise_or(interp, $2, $3, NULL);
 }
 
 inline op bors(invar PMC, invar PMC, in STR) :base_core {
-      $1 = VTABLE_bitwise_ors_str(interp, $2, $3, $1);
+    $1 = VTABLE_bitwise_ors_str(interp, $2, $3, $1);
 }
 
 inline op bors(invar PMC, invar PMC, invar PMC) :base_core {
-      $1 = VTABLE_bitwise_ors(interp, $2, $3, $1);
+    $1 = VTABLE_bitwise_ors(interp, $2, $3, $1);
 }
 
 ########################################
@@ -292,27 +293,27 @@
 =cut
 
 inline op shl(inout INT, in INT) :base_core {
-  $1 = bit_shift_left($1, $2);
+    $1 = bit_shift_left($1, $2);
 }
 
 inline op shl(invar PMC, in INT) :base_core {
-      VTABLE_i_bitwise_shl_int(interp, $1, $2);
+    VTABLE_i_bitwise_shl_int(interp, $1, $2);
 }
 
 inline op shl(invar PMC, invar PMC) :base_core {
-      VTABLE_i_bitwise_shl(interp, $1, $2);
+    VTABLE_i_bitwise_shl(interp, $1, $2);
 }
 
 inline op shl(out INT, in INT, in INT) :base_core {
-  $1 = bit_shift_left($2, $3);
+    $1 = bit_shift_left($2, $3);
 }
 
 inline op shl(invar PMC, invar PMC, in INT) :base_core {
-      $1 = VTABLE_bitwise_shl_int(interp, $2, $3, $1);
+    $1 = VTABLE_bitwise_shl_int(interp, $2, $3, $1);
 }
 
 inline op shl(invar PMC, invar PMC, invar PMC) :base_core {
-      $1 = VTABLE_bitwise_shl(interp, $2, $3, $1);
+    $1 = VTABLE_bitwise_shl(interp, $2, $3, $1);
 }
 
 ########################################
@@ -336,29 +337,29 @@
 =cut
 
 inline op shr(inout INT, in INT) :base_core {
-  const INTVAL signed_shift = -$2;
-  $1 = bit_shift_left($1, signed_shift);
+    const INTVAL signed_shift = -$2;
+    $1 = bit_shift_left($1, signed_shift);
 }
 
 inline op shr(invar PMC, in INT) :base_core {
-      VTABLE_i_bitwise_shr_int(interp, $1, $2);
+    VTABLE_i_bitwise_shr_int(interp, $1, $2);
 }
 
 inline op shr(invar PMC, invar PMC) :base_core {
-      VTABLE_i_bitwise_shr(interp, $1, $2);
+    VTABLE_i_bitwise_shr(interp, $1, $2);
 }
 
 inline op shr(out INT, in INT, in INT) :base_core {
-  const INTVAL signed_shift = -$3;
-  $1 = bit_shift_left($2, signed_shift);
+    const INTVAL signed_shift = -$3;
+    $1 = bit_shift_left($2, signed_shift);
 }
 
 inline op shr(invar PMC, invar PMC, in INT) :base_core {
-      $1 = VTABLE_bitwise_shr_int(interp, $2, $3, $1);
+    $1 = VTABLE_bitwise_shr_int(interp, $2, $3, $1);
 }
 
 inline op shr(invar PMC, invar PMC, invar PMC) :base_core {
-      $1 = VTABLE_bitwise_shr(interp, $2, $3, $1);
+    $1 = VTABLE_bitwise_shr(interp, $2, $3, $1);
 }
 
 ########################################
@@ -382,31 +383,31 @@
 =cut
 
 inline op lsr(out INT, in INT) :base_core {
-  /*
-   * lvalue casts are evil, but this one isn't evil enough to kill.
-   * it's just casting a signed integral to the equivalent unsigned.
-   */
-  LVALUE_CAST(UINTVAL, $1) >>= $2;
+    /*
+     * lvalue casts are evil, but this one isn't evil enough to kill.
+     * it's just casting a signed integral to the equivalent unsigned.
+     */
+    LVALUE_CAST(UINTVAL, $1) >>= $2;
 }
 
 inline op lsr(invar PMC, in INT) :base_core {
-      VTABLE_i_bitwise_lsr_int(interp, $1, $2);
+    VTABLE_i_bitwise_lsr_int(interp, $1, $2);
 }
 
 inline op lsr(invar PMC, invar PMC) :base_core {
-      VTABLE_i_bitwise_lsr(interp, $1, $2);
+    VTABLE_i_bitwise_lsr(interp, $1, $2);
 }
 
 inline op lsr(out INT, in INT, in INT) :base_core {
-  $1 = (INTVAL)((UINTVAL)$2 >> $3);
+    $1 = (INTVAL)((UINTVAL)$2 >> $3);
 }
 
 inline op lsr(invar PMC, invar PMC, in INT) :base_core {
-      $1 = VTABLE_bitwise_lsr_int(interp, $2, $3, $1);
+    $1 = VTABLE_bitwise_lsr_int(interp, $2, $3, $1);
 }
 
 inline op lsr(invar PMC, invar PMC, invar PMC) :base_core {
-      $1 = VTABLE_bitwise_lsr(interp, $2, $3, $1);
+    $1 = VTABLE_bitwise_lsr(interp, $2, $3, $1);
 }
 
 =item B<rot>(out INT, in INT, in INT, inconst INT)
@@ -419,17 +420,17 @@
 =cut
 
 inline op rot(out INT, in INT, in INT, inconst INT) {
-  const INTVAL r = $2;
-  INTVAL s = $3;
-  const INTVAL w = $4;
-  INTVAL d, t;
-  if (s < 0)
-    s += w;
-  d = r << s;
-  t = w - s;
-  t = (INTVAL)((UINTVAL)r >> t);
-  d |= t;
-  $1 = d;
+    const INTVAL r = $2;
+    INTVAL s = $3;
+    const INTVAL w = $4;
+    INTVAL d, t;
+    if (s < 0)
+        s += w;
+    d = r << s;
+    t = w - s;
+    t = (INTVAL)((UINTVAL)r >> t);
+    d |= t;
+    $1 = d;
 }
 
 
@@ -458,27 +459,27 @@
 =cut
 
 inline op bxor(inout INT, in INT) :base_core {
-  $1 ^= $2;
+    $1 ^= $2;
 }
 
 inline op bxor(invar PMC, in INT) :base_core {
-      VTABLE_i_bitwise_xor_int(interp, $1, $2);
+    VTABLE_i_bitwise_xor_int(interp, $1, $2);
 }
 
 inline op bxor(invar PMC, invar PMC) :base_core {
-      VTABLE_i_bitwise_xor(interp, $1, $2);
+    VTABLE_i_bitwise_xor(interp, $1, $2);
 }
 
 inline op bxor(out INT, in INT, in INT) :base_core {
-  $1 = $2 ^ $3;
+    $1 = $2 ^ $3;
 }
 
 inline op bxor(invar PMC, invar PMC, in INT) :base_core {
-      $1 = VTABLE_bitwise_xor_int(interp, $2, $3, $1);
+    $1 = VTABLE_bitwise_xor_int(interp, $2, $3, $1);
 }
 
 inline op bxor(invar PMC, invar PMC, invar PMC) :base_core {
-      $1 = VTABLE_bitwise_xor(interp, $2, $3, $1);
+    $1 = VTABLE_bitwise_xor(interp, $2, $3, $1);
 }
 
 =item B<bxors>(inout STR, in STR)
@@ -502,27 +503,27 @@
 =cut
 
 inline op bxors(inout STR, in STR) :base_core {
-  Parrot_str_bitwise_xor(interp, $1, $2, &$1);
+    Parrot_str_bitwise_xor(interp, $1, $2, &$1);
 }
 
 inline op bxors(invar PMC, in STR) :base_core {
-      VTABLE_i_bitwise_xors_str(interp, $1, $2);
+    VTABLE_i_bitwise_xors_str(interp, $1, $2);
 }
 
 inline op bxors(invar PMC, invar PMC) :base_core {
-      VTABLE_i_bitwise_xors(interp, $1, $2);
+    VTABLE_i_bitwise_xors(interp, $1, $2);
 }
 
 inline op bxors(out STR, in STR, in STR) :base_core {
-  $1 = Parrot_str_bitwise_xor(interp, $2, $3, NULL);
+    $1 = Parrot_str_bitwise_xor(interp, $2, $3, NULL);
 }
 
 inline op bxors(invar PMC, invar PMC, in STR) :base_core {
-      $1 = VTABLE_bitwise_xors_str(interp, $2, $3, $1);
+    $1 = VTABLE_bitwise_xors_str(interp, $2, $3, $1);
 }
 
 inline op bxors(invar PMC, invar PMC, invar PMC) :base_core {
-      $1 = VTABLE_bitwise_xors(interp, $2, $3, $1);
+    $1 = VTABLE_bitwise_xors(interp, $2, $3, $1);
 }
 
 =back

Modified: branches/orderedhash_revamp/src/ops/cmp.ops
==============================================================================
--- branches/orderedhash_revamp/src/ops/cmp.ops	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/ops/cmp.ops	Sat Jan 23 01:49:53 2010	(r43541)
@@ -3,8 +3,6 @@
 ** cmp.ops
 */
 
-VERSION = PARROT_VERSION;
-
 =head1 NAME
 
 cmp.ops - Comparison Opcodes
@@ -65,82 +63,81 @@
 =cut
 
 inline op eq(in INT, in INT, inconst LABEL) :base_core {
-  if ($1 == $2) {
-    goto OFFSET($3);
-  }
+    if ($1 == $2) {
+        goto OFFSET($3);
+    }
 }
 
 inline op eq(in NUM, in NUM, inconst LABEL) :base_core {
-  if ($1 == $2) {
-    goto OFFSET($3);
-  }
+    if ($1 == $2) {
+        goto OFFSET($3);
+    }
 }
 
 op eq(in STR, in STR, inconst LABEL) :base_core {
-  if (Parrot_str_equal(interp, $1, $2)) {
-    goto OFFSET($3);
-  }
+    if (Parrot_str_equal(interp, $1, $2)) {
+        goto OFFSET($3);
+    }
 }
 
 op eq(invar PMC, invar PMC, inconst LABEL) :base_core {
-  if (VTABLE_is_equal(interp, $1, $2)) {
-    goto OFFSET($3);
-  }
+    if (VTABLE_is_equal(interp, $1, $2)) {
+        goto OFFSET($3);
+    }
 }
 
 op eq(invar PMC, in INT, inconst LABEL) :base_core {
-  PMC * temp = temporary_pmc_new(interp, enum_class_Integer);
-  VTABLE_set_integer_native(interp, temp, $2);
+    PMC * temp = temporary_pmc_new(interp, enum_class_Integer);
+    VTABLE_set_integer_native(interp, temp, $2);
 
-  if (VTABLE_is_equal(interp, $1, temp)) {
-    temporary_pmc_free(interp, temp);
-    goto OFFSET($3);
-  }
+    if (VTABLE_is_equal(interp, $1, temp)) {
+        temporary_pmc_free(interp, temp);
+        goto OFFSET($3);
+    }
 
-  temporary_pmc_free(interp, temp);
+    temporary_pmc_free(interp, temp);
 }
 
 op eq(invar PMC, in NUM, inconst LABEL) :base_core {
-  /*
-   * the get_number and get_string should probably
-   * be also replaced with code like above, as
-   * overriding the compare multi subs wouldn't
-   * have any effect with the current code
-   */
-  if (VTABLE_get_number(interp, $1) == $2) {
-    goto OFFSET($3);
-  }
+    /*
+     * the get_number and get_string should probably
+     * be also replaced with code like above, as
+     * overriding the compare multi subs wouldn't
+     * have any effect with the current code
+     */
+    if (VTABLE_get_number(interp, $1) == $2) {
+        goto OFFSET($3);
+    }
 }
 
 op eq(invar PMC, in STR, inconst LABEL) :base_core {
-  if (Parrot_str_equal(interp,
-      VTABLE_get_string(interp, $1), $2)) {
-    goto OFFSET($3);
-  }
+    if (Parrot_str_equal(interp, VTABLE_get_string(interp, $1), $2)) {
+        goto OFFSET($3);
+    }
 }
 
 op eq_str(invar PMC, invar PMC, inconst LABEL) :base_core {
-  if (VTABLE_is_equal_string(interp, $1, $2)) {
-    goto OFFSET($3);
-  }
+    if (VTABLE_is_equal_string(interp, $1, $2)) {
+        goto OFFSET($3);
+    }
 }
 
 op eq_num(invar PMC, invar PMC, inconst LABEL) :base_core {
-  if (VTABLE_is_equal_num(interp, $1, $2)) {
-    goto OFFSET($3);
-  }
+    if (VTABLE_is_equal_num(interp, $1, $2)) {
+        goto OFFSET($3);
+    }
 }
 
 op eq_addr(in STR, in STR, inconst LABEL) :base_core {
-  if ($1 == $2) {
-    goto OFFSET($3);
-  }
+    if ($1 == $2) {
+        goto OFFSET($3);
+    }
 }
 
 op eq_addr(invar PMC, invar PMC, inconst LABEL) :base_core {
-  if ($1 == $2) {
-    goto OFFSET($3);
-  }
+    if ($1 == $2) {
+        goto OFFSET($3);
+    }
 }
 
 ########################################
@@ -172,76 +169,75 @@
 =cut
 
 inline op ne(in INT, in INT, inconst LABEL) :base_core {
-  if ($1 != $2) {
-    goto OFFSET($3);
-  }
+    if ($1 != $2) {
+        goto OFFSET($3);
+    }
 }
 
 inline op ne(in NUM, in NUM, inconst LABEL) :base_core {
-  if ($1 != $2) {
-    goto OFFSET($3);
-  }
+    if ($1 != $2) {
+        goto OFFSET($3);
+    }
 }
 
 op ne(in STR, in STR, inconst LABEL) :base_core {
-  if (Parrot_str_not_equal(interp, $1, $2)) {
-    goto OFFSET($3);
-  }
+    if (Parrot_str_not_equal(interp, $1, $2)) {
+        goto OFFSET($3);
+    }
 }
 
 op ne(invar PMC, invar PMC, inconst LABEL) :base_core {
-  if (!VTABLE_is_equal(interp, $1, $2)) {
-    goto OFFSET($3);
-  }
+    if (!VTABLE_is_equal(interp, $1, $2)) {
+        goto OFFSET($3);
+    }
 }
 
 op ne(invar PMC, in INT, inconst LABEL) :base_core {
-  PMC * temp = temporary_pmc_new(interp, enum_class_Integer);
-  VTABLE_set_integer_native(interp, temp, $2);
+    PMC * temp = temporary_pmc_new(interp, enum_class_Integer);
+    VTABLE_set_integer_native(interp, temp, $2);
 
-  if (!VTABLE_is_equal(interp, $1, temp)) {
-    temporary_pmc_free(interp, temp);
-    goto OFFSET($3);
-  }
+    if (!VTABLE_is_equal(interp, $1, temp)) {
+        temporary_pmc_free(interp, temp);
+        goto OFFSET($3);
+    }
 
-  temporary_pmc_free(interp, temp);
+    temporary_pmc_free(interp, temp);
 }
 
 op ne(invar PMC, in NUM, inconst LABEL) :base_core {
-  if (VTABLE_get_number(interp, $1) != $2) {
-    goto OFFSET($3);
-  }
+    if (VTABLE_get_number(interp, $1) != $2) {
+        goto OFFSET($3);
+    }
 }
 
 op ne(invar PMC, in STR, inconst LABEL) :base_core {
-  if (Parrot_str_not_equal(interp,
-      VTABLE_get_string(interp, $1), $2)) {
-    goto OFFSET($3);
-  }
+    if (Parrot_str_not_equal(interp, VTABLE_get_string(interp, $1), $2)) {
+        goto OFFSET($3);
+    }
 }
 
 op ne_str(invar PMC, invar PMC, inconst LABEL) :base_core {
-  if (VTABLE_cmp_string(interp, $1, $2) != 0) {
-    goto OFFSET($3);
-  }
+    if (VTABLE_cmp_string(interp, $1, $2) != 0) {
+        goto OFFSET($3);
+    }
 }
 
 op ne_num(invar PMC, invar PMC, inconst LABEL) :base_core {
-  if (VTABLE_cmp_num(interp, $1, $2) != 0) {
-    goto OFFSET($3);
-  }
+    if (VTABLE_cmp_num(interp, $1, $2) != 0) {
+        goto OFFSET($3);
+    }
 }
 
 op ne_addr(in STR, in STR, inconst LABEL) :base_core {
-  if ($1 != $2) {
-    goto OFFSET($3);
-  }
+    if ($1 != $2) {
+        goto OFFSET($3);
+    }
 }
 
 op ne_addr(invar PMC, invar PMC, inconst LABEL) :base_core {
-  if ($1 != $2) {
-    goto OFFSET($3);
-  }
+    if ($1 != $2) {
+        goto OFFSET($3);
+    }
 }
 
 ########################################
@@ -269,64 +265,63 @@
 =cut
 
 inline op lt(in INT, in INT, inconst LABEL) :base_core {
-  if ($1 < $2) {
-    goto OFFSET($3);
-  }
+    if ($1 < $2) {
+        goto OFFSET($3);
+    }
 }
 
 inline op lt(in NUM, in NUM, inconst LABEL) :base_core {
-  if ($1 < $2) {
-    goto OFFSET($3);
-  }
+    if ($1 < $2) {
+        goto OFFSET($3);
+    }
 }
 
 op lt(in STR, in STR, inconst LABEL) :base_core {
-  if (Parrot_str_compare(interp, $1, $2) < 0) {
-    goto OFFSET($3);
-  }
+    if (Parrot_str_compare(interp, $1, $2) < 0) {
+        goto OFFSET($3);
+    }
 }
 
 op lt(invar PMC, invar PMC, inconst LABEL) :base_core {
-  if (VTABLE_cmp(interp, $1, $2) < 0) {
-    goto OFFSET($3);
-  }
+    if (VTABLE_cmp(interp, $1, $2) < 0) {
+        goto OFFSET($3);
+    }
 }
 
 op lt(invar PMC, in INT, inconst LABEL) :base_core {
-  PMC * temp  = temporary_pmc_new(interp, enum_class_Integer);
-  VTABLE_set_integer_native(interp, temp, $2);
+    PMC * temp  = temporary_pmc_new(interp, enum_class_Integer);
+    VTABLE_set_integer_native(interp, temp, $2);
 
-  if (VTABLE_cmp(interp, $1, temp) < 0) {
-    temporary_pmc_free(interp, temp);
-    goto OFFSET($3);
-  }
+    if (VTABLE_cmp(interp, $1, temp) < 0) {
+        temporary_pmc_free(interp, temp);
+        goto OFFSET($3);
+    }
 
-  temporary_pmc_free(interp, temp);
+    temporary_pmc_free(interp, temp);
 }
 
 op lt(invar PMC, in NUM, inconst LABEL) :base_core {
-  if (VTABLE_get_number(interp, $1) < $2) {
-    goto OFFSET($3);
-  }
+    if (VTABLE_get_number(interp, $1) < $2) {
+        goto OFFSET($3);
+    }
 }
 
 op lt(invar PMC, in STR, inconst LABEL) :base_core {
-  if (Parrot_str_compare(interp,
-      VTABLE_get_string(interp, $1), $2) < 0) {
-    goto OFFSET($3);
-  }
+    if (Parrot_str_compare(interp, VTABLE_get_string(interp, $1), $2) < 0) {
+        goto OFFSET($3);
+    }
 }
 
 op lt_str(invar PMC, invar PMC, inconst LABEL) :base_core {
-  if (VTABLE_cmp_string(interp, $1, $2) < 0) {
-    goto OFFSET($3);
-  }
+    if (VTABLE_cmp_string(interp, $1, $2) < 0) {
+        goto OFFSET($3);
+    }
 }
 
 op lt_num(invar PMC, invar PMC, inconst LABEL) :base_core {
-  if (VTABLE_cmp_num(interp, $1, $2) < 0) {
-    goto OFFSET($3);
-  }
+    if (VTABLE_cmp_num(interp, $1, $2) < 0) {
+        goto OFFSET($3);
+    }
 }
 
 ########################################
@@ -354,64 +349,63 @@
 =cut
 
 inline op le(in INT, in INT, inconst LABEL) :base_core {
-  if ($1 <= $2) {
-    goto OFFSET($3);
-  }
+    if ($1 <= $2) {
+        goto OFFSET($3);
+    }
 }
 
 inline op le(in NUM, in NUM, inconst LABEL) :base_core {
-  if ($1 <= $2) {
-    goto OFFSET($3);
-  }
+    if ($1 <= $2) {
+        goto OFFSET($3);
+    }
 }
 
 op le(in STR, in STR, inconst LABEL) :base_core {
-  if (Parrot_str_compare(interp, $1, $2) <= 0) {
-    goto OFFSET($3);
-  }
+    if (Parrot_str_compare(interp, $1, $2) <= 0) {
+        goto OFFSET($3);
+    }
 }
 
 op le(invar PMC, invar PMC, inconst LABEL) :base_core {
-  if (VTABLE_cmp(interp, $1, $2) <= 0) {
-    goto OFFSET($3);
-  }
+    if (VTABLE_cmp(interp, $1, $2) <= 0) {
+        goto OFFSET($3);
+    }
 }
 
 op le(invar PMC, in INT, inconst LABEL) :base_core {
-  PMC * temp  = temporary_pmc_new(interp, enum_class_Integer);
-  VTABLE_set_integer_native(interp, temp, $2);
+    PMC * temp  = temporary_pmc_new(interp, enum_class_Integer);
+    VTABLE_set_integer_native(interp, temp, $2);
 
-  if (VTABLE_cmp(interp, $1, temp) <= 0) {
-    temporary_pmc_free(interp, temp);
-    goto OFFSET($3);
-  }
+    if (VTABLE_cmp(interp, $1, temp) <= 0) {
+        temporary_pmc_free(interp, temp);
+        goto OFFSET($3);
+    }
 
-  temporary_pmc_free(interp, temp);
+    temporary_pmc_free(interp, temp);
 }
 
 op le(invar PMC, in NUM, inconst LABEL) :base_core {
-  if (VTABLE_get_number(interp, $1) <= $2) {
-    goto OFFSET($3);
-  }
+    if (VTABLE_get_number(interp, $1) <= $2) {
+        goto OFFSET($3);
+    }
 }
 
 op le(invar PMC, in STR, inconst LABEL) :base_core {
-  if (Parrot_str_compare(interp,
-      VTABLE_get_string(interp, $1), $2) <= 0) {
-    goto OFFSET($3);
-  }
+    if (Parrot_str_compare(interp, VTABLE_get_string(interp, $1), $2) <= 0) {
+        goto OFFSET($3);
+    }
 }
 
 op le_str(invar PMC, invar PMC, inconst LABEL) :base_core {
-  if (VTABLE_cmp_string(interp, $1, $2) <= 0) {
-    goto OFFSET($3);
-  }
+    if (VTABLE_cmp_string(interp, $1, $2) <= 0) {
+        goto OFFSET($3);
+    }
 }
 
 op le_num(invar PMC, invar PMC, inconst LABEL) :base_core {
-  if (VTABLE_cmp_num(interp, $1, $2) <= 0) {
-    goto OFFSET($3);
-  }
+    if (VTABLE_cmp_num(interp, $1, $2) <= 0) {
+        goto OFFSET($3);
+    }
 }
 
 ########################################
@@ -433,46 +427,45 @@
 =cut
 
 op gt(invar PMC, invar PMC, inconst LABEL) :base_core {
-  if (VTABLE_cmp(interp, $1, $2) > 0) {
-    goto OFFSET($3);
-  }
+    if (VTABLE_cmp(interp, $1, $2) > 0) {
+        goto OFFSET($3);
+    }
 }
 
 op gt(invar PMC, in INT, inconst LABEL) :base_core {
-  PMC * temp  = temporary_pmc_new(interp, enum_class_Integer);
-  VTABLE_set_integer_native(interp, temp, $2);
+    PMC * temp  = temporary_pmc_new(interp, enum_class_Integer);
+    VTABLE_set_integer_native(interp, temp, $2);
 
-  if (VTABLE_cmp(interp, $1, temp) > 0) {
-    temporary_pmc_free(interp, temp);
-    goto OFFSET($3);
-  }
+    if (VTABLE_cmp(interp, $1, temp) > 0) {
+        temporary_pmc_free(interp, temp);
+        goto OFFSET($3);
+    }
 
-  temporary_pmc_free(interp, temp);
+    temporary_pmc_free(interp, temp);
 }
 
 op gt(invar PMC, in NUM, inconst LABEL) :base_core {
-  if (VTABLE_get_number(interp, $1) > $2) {
-    goto OFFSET($3);
-  }
+    if (VTABLE_get_number(interp, $1) > $2) {
+        goto OFFSET($3);
+    }
 }
 
 op gt(invar PMC, in STR, inconst LABEL) :base_core {
-  if (Parrot_str_compare(interp,
-      VTABLE_get_string(interp, $1), $2) > 0) {
-    goto OFFSET($3);
-  }
+    if (Parrot_str_compare(interp, VTABLE_get_string(interp, $1), $2) > 0) {
+        goto OFFSET($3);
+    }
 }
 
 op gt_str(invar PMC, invar PMC, inconst LABEL) :base_core {
-  if (VTABLE_cmp_string(interp, $1, $2) > 0) {
-    goto OFFSET($3);
-  }
+    if (VTABLE_cmp_string(interp, $1, $2) > 0) {
+        goto OFFSET($3);
+    }
 }
 
 op gt_num(invar PMC, invar PMC, inconst LABEL) :base_core {
-  if (VTABLE_cmp_num(interp, $1, $2) > 0) {
-    goto OFFSET($3);
-  }
+    if (VTABLE_cmp_num(interp, $1, $2) > 0) {
+        goto OFFSET($3);
+    }
 }
 
 ########################################
@@ -494,45 +487,45 @@
 =cut
 
 op ge(invar PMC, invar PMC, inconst LABEL) :base_core {
-  if (VTABLE_cmp(interp, $1, $2) >= 0) {
-    goto OFFSET($3);
-  }
+    if (VTABLE_cmp(interp, $1, $2) >= 0) {
+        goto OFFSET($3);
+    }
 }
 
 op ge(invar PMC, in INT, inconst LABEL) :base_core {
-  PMC * temp  = temporary_pmc_new(interp, enum_class_Integer);
-  VTABLE_set_integer_native(interp, temp, $2);
+    PMC * temp  = temporary_pmc_new(interp, enum_class_Integer);
+    VTABLE_set_integer_native(interp, temp, $2);
 
-  if (VTABLE_cmp(interp, $1, temp) >= 0) {
-    temporary_pmc_free(interp, temp);
-    goto OFFSET($3);
-  }
+    if (VTABLE_cmp(interp, $1, temp) >= 0) {
+        temporary_pmc_free(interp, temp);
+        goto OFFSET($3);
+    }
 
-  temporary_pmc_free(interp, temp);
+    temporary_pmc_free(interp, temp);
 }
 
 op ge(invar PMC, in NUM, inconst LABEL) :base_core {
-  if (VTABLE_get_number(interp, $1) >= $2) {
-    goto OFFSET($3);
-  }
+    if (VTABLE_get_number(interp, $1) >= $2) {
+        goto OFFSET($3);
+    }
 }
 
 op ge(invar PMC, in STR, inconst LABEL) :base_core {
-  if (Parrot_str_compare(interp, VTABLE_get_string(interp, $1), $2) >= 0) {
-    goto OFFSET($3);
-  }
+    if (Parrot_str_compare(interp, VTABLE_get_string(interp, $1), $2) >= 0) {
+        goto OFFSET($3);
+    }
 }
 
 op ge_str(invar PMC, invar PMC, inconst LABEL) :base_core {
-  if (VTABLE_cmp_string(interp, $1, $2) >= 0) {
-    goto OFFSET($3);
-  }
+    if (VTABLE_cmp_string(interp, $1, $2) >= 0) {
+        goto OFFSET($3);
+    }
 }
 
 op ge_num(invar PMC, invar PMC, inconst LABEL) :base_core {
-  if (VTABLE_cmp_num(interp, $1, $2) >= 0) {
-    goto OFFSET($3);
-  }
+    if (VTABLE_cmp_num(interp, $1, $2) >= 0) {
+        goto OFFSET($3);
+    }
 }
 
 ########################################
@@ -548,15 +541,15 @@
 =cut
 
 op if_null(invar PMC, inconst LABEL) {
-  if (PMC_IS_NULL($1)) {
-    goto OFFSET($2);
-  }
+    if (PMC_IS_NULL($1)) {
+        goto OFFSET($2);
+    }
 }
 
 op if_null(invar STR, inconst LABEL) {
-  if (!$1) {
-    goto OFFSET($2);
-  }
+    if (STRING_IS_NULL($1)) {
+        goto OFFSET($2);
+    }
 }
 
 ########################################
@@ -572,15 +565,15 @@
 =cut
 
 op unless_null(invar PMC, inconst LABEL) {
-  if (!PMC_IS_NULL($1)) {
-    goto OFFSET($2);
-  }
+    if (!PMC_IS_NULL($1)) {
+        goto OFFSET($2);
+    }
 }
 
 op unless_null(invar STR, inconst LABEL) {
-  if ($1) {
-    goto OFFSET($2);
-  }
+    if (!STRING_IS_NULL($1)) {
+        goto OFFSET($2);
+    }
 }
 
 =back
@@ -619,50 +612,50 @@
 =cut
 
 inline op cmp(out INT, in INT, in INT) :base_core {
-  $1 = $2 < $3 ? -1 :
-       $2 > $3 ? +1 :
-       0;
+    $1 = $2 < $3 ? -1 :
+         $2 > $3 ? +1 :
+         0;
 }
 
 inline op cmp(out INT, in NUM, in NUM) :base_core {
-  $1 = $2 < $3 ? -1 :
-       $2 > $3 ? +1 :
-       0;
+    $1 = $2 < $3 ? -1 :
+         $2 > $3 ? +1 :
+         0;
 }
 
 inline op cmp(out INT, in STR, in STR) :base_core {
-  $1 = Parrot_str_compare(interp, $2, $3);
+    $1 = Parrot_str_compare(interp, $2, $3);
 }
 
 inline op cmp(out INT, invar PMC, invar PMC) :base_core {
-  $1 = VTABLE_cmp(interp, $2, $3);
+    $1 = VTABLE_cmp(interp, $2, $3);
 }
 
 inline op cmp(out INT, invar PMC, in INT) :base_core {
-  const INTVAL l = VTABLE_get_integer(interp, $2);
-  $1 = l < $3 ? -1 :
-       l > $3 ? +1 :
-       0;
+    const INTVAL l = VTABLE_get_integer(interp, $2);
+    $1 = l < $3 ? -1 :
+         l > $3 ? +1 :
+         0;
 }
 
 inline op cmp(out INT, invar PMC, in NUM) :base_core {
-  const FLOATVAL l = VTABLE_get_number(interp, $2);
-  $1 = l < $3 ? -1 :
-       l > $3 ? +1 :
-       0;
+    const FLOATVAL l = VTABLE_get_number(interp, $2);
+    $1 = l < $3 ? -1 :
+         l > $3 ? +1 :
+         0;
 }
 
 inline op cmp(out INT, invar PMC, in STR) :base_core {
-  STRING* const l = VTABLE_get_string(interp, $2);
-  $1 = Parrot_str_compare(interp, l, $3);
+    STRING* const l = VTABLE_get_string(interp, $2);
+    $1 = Parrot_str_compare(interp, l, $3);
 }
 
 inline op cmp_str(out INT, invar PMC, invar PMC) :base_core {
-  $1 = VTABLE_cmp_string(interp, $2, $3);
+    $1 = VTABLE_cmp_string(interp, $2, $3);
 }
 
 inline op cmp_num(out INT, invar PMC, invar PMC) :base_core {
-  $1 = VTABLE_cmp_num(interp, $2, $3);
+    $1 = VTABLE_cmp_num(interp, $2, $3);
 }
 
 =item B<cmp_pmc>(out PMC, invar PMC, invar PMC)
@@ -674,7 +667,7 @@
 =cut
 
 inline op cmp_pmc(out PMC, invar PMC, invar PMC) :base_core {
-  $1 = VTABLE_cmp_pmc(interp, $2, $3);
+    $1 = VTABLE_cmp_pmc(interp, $2, $3);
 }
 
 ########################################
@@ -763,7 +756,7 @@
 =cut
 
 inline op isgt(out INT, invar PMC, invar PMC) {
-  $1 = (VTABLE_cmp(interp, $2, $3) > 0);
+    $1 = (VTABLE_cmp(interp, $2, $3) > 0);
 }
 
 =item B<isge>(out INT, in INT, in INT)
@@ -781,7 +774,7 @@
 =cut
 
 inline op isge(out INT, invar PMC, invar PMC) {
-  $1 = (VTABLE_cmp(interp, $2, $3) >= 0);
+    $1 = (VTABLE_cmp(interp, $2, $3) >= 0);
 }
 
 =item B<isle>(out INT, in INT, in INT)
@@ -797,19 +790,19 @@
 =cut
 
 inline op isle(out INT, in INT, in INT) {
-  $1 = $2 <= $3;
+    $1 = $2 <= $3;
 }
 
 inline op isle(out INT, in NUM, in NUM) {
-  $1 = $2 <= $3;
+    $1 = $2 <= $3;
 }
 
 inline op isle(out INT, in STR, in STR) {
-  $1 = Parrot_str_compare(interp, $2, $3) <= 0;
+    $1 = Parrot_str_compare(interp, $2, $3) <= 0;
 }
 
 inline op isle(out INT, invar PMC, invar PMC) {
-  $1 = (VTABLE_cmp(interp, $2, $3) <= 0);
+    $1 = (VTABLE_cmp(interp, $2, $3) <= 0);
 }
 
 =item B<islt>(out INT, in INT, in INT)
@@ -825,19 +818,19 @@
 =cut
 
 inline op islt(out INT, in INT, in INT) {
-  $1 = ($2 < $3) ? 1 : 0;
+    $1 = ($2 < $3) ? 1 : 0;
 }
 
 inline op islt(out INT, in NUM, in NUM) {
-  $1 = $2 < $3;
+    $1 = $2 < $3;
 }
 
 inline op islt(out INT, in STR, in STR) {
-  $1 = Parrot_str_compare(interp, $2, $3) < 0;
+    $1 = Parrot_str_compare(interp, $2, $3) < 0;
 }
 
 inline op islt(out INT, invar PMC, invar PMC) {
-  $1 = (VTABLE_cmp(interp, $2, $3) < 0);
+    $1 = (VTABLE_cmp(interp, $2, $3) < 0);
 }
 
 =item B<iseq>(out INT, in INT, in INT)
@@ -853,22 +846,22 @@
 =cut
 
 inline op iseq(out INT, in INT, in INT) {
-  $1 = ($2 == $3) ? 1 : 0;
+    $1 = ($2 == $3) ? 1 : 0;
 }
 
 inline op iseq(out INT, in NUM, in NUM) {
-  $1 = $2 == $3;
+    $1 = $2 == $3;
 }
 
 inline op iseq(out INT, in STR, in STR) {
-  $1 = (Parrot_str_equal(interp, $2, $3) ? 1 : 0);
+    $1 = (Parrot_str_equal(interp, $2, $3) ? 1 : 0);
 }
 
 inline op iseq(out INT, invar PMC, invar PMC) {
-  if (&$2 == &$3)
-    $1 = 1;
-  else
-    $1 = VTABLE_is_equal(interp, $2, $3);
+    if (&$2 == &$3)
+        $1 = 1;
+    else
+        $1 = VTABLE_is_equal(interp, $2, $3);
 }
 
 =item B<isne>(out INT, in INT, in INT)
@@ -884,22 +877,22 @@
 =cut
 
 inline op isne(out INT, in INT, in INT) {
-  $1 = ($2 == $3) ? 0 : 1;
+    $1 = ($2 == $3) ? 0 : 1;
 }
 
 inline op isne(out INT, in NUM, in NUM) {
-  $1 = $2 != $3;
+    $1 = $2 != $3;
 }
 
 inline op isne(out INT, in STR, in STR) {
-  $1 = (Parrot_str_not_equal(interp, $2, $3) ? 1 : 0);
+    $1 = (Parrot_str_not_equal(interp, $2, $3) ? 1 : 0);
 }
 
 inline op isne(out INT, invar PMC, invar PMC) {
-  if (&$2 == &$3)
-    $1 = 0;
-  else
-    $1 = !VTABLE_is_equal(interp, $2, $3);
+    if (&$2 == &$3)
+        $1 = 0;
+    else
+        $1 = !VTABLE_is_equal(interp, $2, $3);
 }
 
 =back
@@ -928,11 +921,11 @@
 =cut
 
 inline op and(out INT, in INT, in INT) :base_core {
-  $1 = $2 ? $3 : $2;
+    $1 = $2 ? $3 : $2;
 }
 
 inline op and(invar PMC, invar PMC, invar PMC) :base_core {
-  $1 = VTABLE_logical_and(interp, $2, $3, $1);
+    $1 = VTABLE_logical_and(interp, $2, $3, $1);
 }
 
 ########################################
@@ -950,19 +943,19 @@
 =cut
 
 inline op not(inout INT) :base_core {
-  $1 = ! $1;
+    $1 = ! $1;
 }
 
 inline op not(out INT, in INT) :base_core {
-  $1 = ! $2;
+    $1 = ! $2;
 }
 
 inline op not(invar PMC) :base_core {
-  VTABLE_i_logical_not(interp, $1);
+    VTABLE_i_logical_not(interp, $1);
 }
 
 inline op not(out PMC, invar PMC) :base_core {
-  $1 = VTABLE_logical_not(interp, $2, $1);
+    $1 = VTABLE_logical_not(interp, $2, $1);
 }
 
 ########################################
@@ -976,11 +969,11 @@
 =cut
 
 inline op or(out INT, in INT, in INT) :base_core {
-  $1 = $2 ? $2 : $3;
+    $1 = $2 ? $2 : $3;
 }
 
 inline op or(invar PMC, invar PMC, invar PMC) :base_core {
-      $1 = VTABLE_logical_or(interp, $2, $3, $1);
+    $1 = VTABLE_logical_or(interp, $2, $3, $1);
 }
 
 ########################################
@@ -995,11 +988,11 @@
 =cut
 
 inline op xor(out INT, in INT, in INT) :base_core {
-  $1 = ($2 && ! $3) ? $2 : ($3 && ! $2) ? $3 : 0;
+    $1 = ($2 && ! $3) ? $2 : ($3 && ! $2) ? $3 : 0;
 }
 
 inline op xor(invar PMC, invar PMC, invar PMC) :base_core {
-      $1 = VTABLE_logical_xor(interp, $2, $3, $1);
+    $1 = VTABLE_logical_xor(interp, $2, $3, $1);
 }
 
 =back

Modified: branches/orderedhash_revamp/src/ops/core.ops
==============================================================================
--- branches/orderedhash_revamp/src/ops/core.ops	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/ops/core.ops	Sat Jan 23 01:49:53 2010	(r43541)
@@ -3,13 +3,15 @@
 ** core.ops
 */
 
+BEGIN_OPS_PREAMBLE
+
 #include "parrot/dynext.h"
 #include "parrot/embed.h"
 #include "parrot/runcore_api.h"
-#include "../pmc/pmc_continuation.h"
-#include "../pmc/pmc_parrotlibrary.h"
+#include "pmc/pmc_continuation.h"
+#include "pmc/pmc_parrotlibrary.h"
 
-VERSION = PARROT_VERSION;
+END_OPS_PREAMBLE
 
 =head1 NAME
 
@@ -111,7 +113,7 @@
        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) {
+   if (PARROT_RUNCORE_JIT_OPS_TEST(interp->run_core)) {
 #ifdef __GNUC__
 #  ifdef I386
         __asm__("ret");
@@ -148,12 +150,12 @@
 
 inline op prederef__() :internal :flow {
     opcode_t * const _this = CUR_OPCODE;
-    if (interp->run_core & PARROT_CGOTO_CORE) {
+    if (PARROT_RUNCORE_CGOTO_OPS_TEST(interp->run_core)) {
         /* must be CGP then - check for events in not yet prederefed code */
         Parrot_cx_runloop_wake(interp, interp->scheduler);
     /*    _this = CHECK_EVENTS(interp, _this); */
     }
-    do_prederef((void**)cur_opcode, interp, op_lib.core_type);
+    do_prederef((void**)cur_opcode, interp, interp->run_core);
     goto ADDRESS(_this); /* force this being a branch op */
 }
 
@@ -203,60 +205,6 @@
 }
 
 
-=item B<branch_cs>(in STR)
-
-Intersegment branch to location in fixup table named $1.
-
-=cut
-
-inline op branch_cs(in STR) :base_loop :check_event :flow {
-    PackFile_FixupEntry * fe;
-    {
-        char * const label = Parrot_str_to_cstring(interp, $1);
-        fe = PackFile_find_fixup_entry(interp, enum_fixup_label, label);
-        Parrot_str_free_cstring(label);
-    }
-
-    if (!fe) {
-        opcode_t * handler= Parrot_ex_throw_from_op_args(interp, NULL,
-            EXCEPTION_INVALID_OPERATION,
-            "branch_cs: fixup for '%Ss' not found", $1);
-        goto ADDRESS(handler);
-    }
-    else {
-        interp->resume_offset = fe->offset;
-        Parrot_switch_to_cs(interp, fe->seg, 1);
-        mem_sys_free(fe);
-    }
-    interp->resume_flag = 2;
-    goto ADDRESS(0);
-}
-
-########################################
-
-=item B<bsr>(in LABEL)
-
-Branch to the location specified by $1. Push the current location onto the call
-stack for later returning.
-
-=cut
-
-inline op bsr(in LABEL) :base_core :check_event :flow {
-    stack_push(interp, &interp->dynamic_env,
-             expr NEXT(),  STACK_ENTRY_DESTINATION, STACK_CLEANUP_NULL);
-    goto OFFSET($1);
-}
-
-=item B<ret>()
-
-Pop the location off the top of the call stack and go there.
-
-=cut
-
-inline op ret() :flow {
-    goto POP();
-}
-
 ########################################
 
 =item B<local_branch>(invar PMC, in LABEL)
@@ -316,25 +264,6 @@
     goto ADDRESS(next);
 }
 
-
-
-########################################
-
-=item B<jsr>(in LABEL)
-
-Jump to the location specified by register $1. Push the current
-location onto the call stack for later returning.
-
-=cut
-
-inline op jsr(in LABEL) :base_core :check_event :flow {
-    opcode_t * loc;
-    stack_push(interp, &interp->dynamic_env,
-             expr NEXT(),  STACK_ENTRY_DESTINATION, STACK_CLEANUP_NULL);
-    loc = INTVAL2PTR(opcode_t *, $1);
-    goto ADDRESS(loc);
-}
-
 ########################################
 
 =item B<jump>(in LABEL)
@@ -501,42 +430,59 @@
 
     interp->current_object = NULL;
     interp->current_cont   = NEED_CONTINUATION;
-    dest                   = (opcode_t *)p->vtable->invoke(interp, p, dest);
+    dest                   = VTABLE_invoke(interp, p, dest);
 
     goto ADDRESS(dest);
 }
 
 inline op invoke(invar PMC, invar PMC) :flow {
-    opcode_t *dest;
-    PMC * const p = $1;
+    opcode_t   *dest       = expr NEXT();
+    PMC * const p          = $1;
 
     interp->current_object = NULL;
-    interp->current_cont = $2;
-    dest = (opcode_t *)p->vtable->invoke(interp, p, expr NEXT());
+    interp->current_cont   = $2;
+
+    dest = VTABLE_invoke(interp, p, dest);
     goto ADDRESS(dest);
 }
 
 inline op yield() :flow {
-    opcode_t *dest = expr NEXT();
-    PMC * const p = CONTEXT(interp)->current_sub;
-    dest = (opcode_t *)p->vtable->invoke(interp, p, dest);
+    opcode_t   *dest = expr NEXT();
+    PMC * const p    = Parrot_pcc_get_sub(interp, CURRENT_CONTEXT(interp));
+
+    VTABLE_increment(interp, p);
+    dest = VTABLE_invoke(interp, p, dest);
+
     goto ADDRESS(dest);
 }
 
 inline op tailcall(invar PMC) :flow {
-    opcode_t *dest;
-    PMC * const p = $1;
-    dest = expr NEXT();
-    interp->current_cont = CONTEXT(interp)->current_cont;
-    PObj_get_FLAGS(interp->current_cont) |= SUB_FLAG_TAILCALL;
-    dest = (opcode_t *)p->vtable->invoke(interp, p, dest);
+    PMC * const p               = $1;
+    opcode_t   *dest            = expr NEXT();
+    PMC * const ctx             = CURRENT_CONTEXT(interp);
+    PMC * const parent_ctx      = Parrot_pcc_get_caller_ctx(interp, ctx);
+    PMC * const this_call_sig   = Parrot_pcc_get_signature(interp, ctx);
+    PMC * const parent_call_sig = Parrot_pcc_get_signature(interp, parent_ctx);
+    interp->current_cont        = Parrot_pcc_get_continuation(interp, ctx);
+
+    Parrot_pcc_merge_signature_for_tailcall(interp, parent_call_sig, this_call_sig);
+
+    /* Detach continuation from current CallContext to avoid marking dead object. */
+    /* RetContinuation will kill itself after invoke */
+    if (interp->current_cont->vtable->base_type == enum_class_RetContinuation
+        && Parrot_pcc_do_run_ops(interp, p)) {
+        PMC_cont(interp->current_cont)->from_ctx = parent_ctx;
+        Parrot_pcc_set_continuation(interp, ctx, PMCNULL);
+    }
+
+    SUB_FLAG_TAILCALL_SET(interp->current_cont);
+    dest = VTABLE_invoke(interp, p, dest);
     goto ADDRESS(dest);
 }
 
 inline op returncc() :flow {
-    PMC * const p = CONTEXT(interp)->current_cont;
-    opcode_t * const dest = (opcode_t *)p->vtable->invoke(interp,
-            p, expr NEXT());
+    PMC * const p = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp));
+    opcode_t * const dest = VTABLE_invoke(interp, p, expr NEXT());
     goto ADDRESS(dest);
 }
 
@@ -583,95 +529,71 @@
 
 
 op set_args(inconst PMC) :flow {
-    opcode_t * const _this = CUR_OPCODE;
+    opcode_t * const raw_args = CUR_OPCODE;
     PMC * const signature = $1;
+    PMC * call_sig;
     INTVAL argc;
 
-    /* for now just point to the opcode */
-    interp->current_args = _this;
+    call_sig = Parrot_pcc_build_sig_object_from_op(interp,
+            PMCNULL, signature, raw_args);
+    Parrot_pcc_set_signature(interp, CURRENT_CONTEXT(interp), call_sig);
+
     argc = VTABLE_elements(interp, signature);
     goto OFFSET(argc + 2);
 }
 
 op get_results(inconst PMC) :flow {
-    opcode_t * const _this = CUR_OPCODE;
+    opcode_t * const raw_returns = CUR_OPCODE;
     PMC * const signature = $1;
+    PMC * call_sig;
     INTVAL argc;
 
-    CONTEXT(interp)->current_results = _this;
+    call_sig = Parrot_pcc_build_sig_object_returns_from_op(interp,
+            Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp)),
+            signature, raw_returns);
+    Parrot_pcc_set_signature(interp, CURRENT_CONTEXT(interp), call_sig);
+
     argc = VTABLE_elements(interp, signature);
     goto OFFSET(argc + 2);
 }
 
 op get_params(inconst PMC) :flow {
-    opcode_t * const _this = CUR_OPCODE;
-    Parrot_Context *caller_ctx, *ctx;
-    PMC * ccont;
+    opcode_t * const raw_params = CUR_OPCODE;
+    PMC *caller_ctx, *ctx;
+    PMC *ccont, *call_object;
     PMC * const signature = $1;
     INTVAL argc;
-    opcode_t *src_indexes, *dst_indexes;
 
-    interp->current_params = _this;
-    ctx = CONTEXT(interp);
-    ccont = ctx->current_cont;
+    ctx     = CURRENT_CONTEXT(interp);
+    ccont   = Parrot_pcc_get_continuation(interp, ctx);
 
-    caller_ctx = ctx->caller_ctx;
+    caller_ctx  = Parrot_pcc_get_caller_ctx(interp, ctx);
+    call_object = Parrot_pcc_get_signature(interp, caller_ctx);
 
-    src_indexes = interp->current_args;
-    dst_indexes = interp->current_params;
-    /* the args and params are now 'used.' */
-    interp->current_args = NULL;
-    interp->current_params = NULL;
+    Parrot_pcc_fill_params_from_op(interp, call_object, signature, raw_params);
 
-    parrot_pass_args(interp, caller_ctx, ctx, src_indexes, dst_indexes, PARROT_PASS_PARAMS);
+    /* TODO Factor out with Sub.invoke */
     if (PObj_get_FLAGS(ccont) & SUB_FLAG_TAILCALL) {
         PObj_get_FLAGS(ccont) &= ~SUB_FLAG_TAILCALL;
-        --ctx->recursion_depth;
-        ctx->caller_ctx = caller_ctx->caller_ctx;
-        /* ordinarily, this will free the context immediately, but not if the
-           sub created a closure (or continuation, or . . .).  */
-        Parrot_free_context(interp, caller_ctx, 1);
-        interp->current_args = NULL;
+        Parrot_pcc_dec_recursion_depth(interp, ctx);
+        Parrot_pcc_set_caller_ctx(interp, ctx, Parrot_pcc_get_caller_ctx(interp, caller_ctx));
     }
     argc = VTABLE_elements(interp, signature);
     goto OFFSET(argc + 2);
 }
 
 op set_returns(inconst PMC) :flow {
-    opcode_t * const _this = CUR_OPCODE;
-    Parrot_Context *ctx;
-    PMC *ccont;
-    PMC *signature = $1;
-    INTVAL argc;
-    opcode_t *src_indexes, *dest_indexes;
+    opcode_t * const raw_returns = CUR_OPCODE;
+    PMC      *signature          = $1;
+    PMC      *ctx                = CURRENT_CONTEXT(interp);
+    PMC      *caller_ctx         = Parrot_pcc_get_caller_ctx(interp, ctx);
+    PMC      *call_object        = Parrot_pcc_get_signature(interp, caller_ctx);
+    INTVAL    argc               = VTABLE_elements(interp, signature);
 
-    interp->current_returns = _this;
-    ctx = CONTEXT(interp);
-    ccont = ctx->current_cont;
-
-    if (PMC_cont(ccont)->address) {
-        /* Call is from runops_fromc */
-        Parrot_Context * const caller_ctx = PMC_cont(ccont)->to_ctx;
-        if (! caller_ctx) {
-            /* there is no point calling Parrot_ex_throw_..., because
-               PDB_backtrace can't deal with a missing to_ctx either. */
-            exit_fatal(1, "No caller_ctx for continuation %p.", ccont);
-        }
+    Parrot_pcc_fill_returns_from_op(interp, call_object, signature, raw_returns);
+
+    Parrot_pcc_set_signature(interp, ctx, NULL);
 
-        src_indexes = interp->current_returns;
-        dest_indexes = caller_ctx->current_results;
-        interp->current_returns = NULL;
-        /* does this need to be here */
-        interp->current_args = NULL;
-
-        parrot_pass_args(interp, ctx, caller_ctx, src_indexes, dest_indexes, PARROT_PASS_RESULTS);
-    }
-    else if (ctx->caller_ctx->results_signature) {
-    /* We have a dynamic result signature, from pcc_invoke */
-        parrot_pass_args(interp, ctx, ctx->caller_ctx, interp->current_returns,
-                ctx->caller_ctx->current_results, PARROT_PASS_RESULTS);
-    }
-    argc = VTABLE_elements(interp, signature);
     goto OFFSET(argc + 2);
 }
 
@@ -685,17 +607,10 @@
 =cut
 
 inline op result_info(out PMC) {
-    /* Get context of callee from return continuation. */
-    PMC * const cc = CONTEXT(interp)->current_cont;
-    PMC *sig = NULL;
-    if (cc && PMC_cont(cc)->to_ctx) {
-        /* caller context has results */
-        opcode_t * const results = PMC_cont(cc)->to_ctx->current_results;
-        if (results) {
-            /* get results PMC index and get PMC. */
-            sig = PF_CONST(PMC_cont(cc)->seg, results[1])->u.key;
-        }
-    }
+    PMC *caller_ctx  = Parrot_pcc_get_caller_ctx(interp, CURRENT_CONTEXT(interp));
+    PMC *call_object = Parrot_pcc_get_signature(interp, caller_ctx);
+    PMC *sig = VTABLE_get_attr_str(interp, call_object,
+            Parrot_str_new_constant(interp, "return_flags"));
 
     /* If no elements, hand back empty array; otherwise PMC. */
     if (!sig)
@@ -871,12 +786,10 @@
     opcode_t *const ret    = expr NEXT();
     PMC            *resume = new_ret_continuation_pmc(interp, ret);
     if (PMC_IS_NULL(except) || except->vtable->base_type != enum_class_Exception)
-        except = Parrot_ex_build_exception(interp, EXCEPT_fatal, 1, NULL);
-    /*
-     * We might return here after handling the exception, so mark the
-     * current context appropriately.
-     */
-    Parrot_context_ref(interp, CONTEXT(interp));
+        except = Parrot_ex_build_exception(interp, EXCEPT_fatal,
+                EXCEPTION_UNIMPLEMENTED,
+                Parrot_str_new_constant(interp, "Not a throwable object"));
+
     VTABLE_set_attr_str(interp, except, Parrot_str_new_constant(interp, "resume"), resume);
     dest = Parrot_ex_throw_from_op(interp, except, ret);
     goto ADDRESS(dest);
@@ -886,7 +799,9 @@
     opcode_t * dest;
     PMC * except = $1;
     if (PMC_IS_NULL(except) || except->vtable->base_type != enum_class_Exception)
-        except = Parrot_ex_build_exception(interp, EXCEPT_fatal, 1, NULL);
+        except = Parrot_ex_build_exception(interp, EXCEPT_fatal,
+                EXCEPTION_UNIMPLEMENTED,
+                Parrot_str_new_constant(interp, "Not a throwable object"));
     dest = Parrot_ex_throw_from_op(interp, $1,
                                 VTABLE_get_pointer(interp, $2));
     goto ADDRESS(dest);
@@ -896,7 +811,9 @@
     opcode_t * dest;
     if (PMC_IS_NULL($1) || $1->vtable->base_type != enum_class_Exception) {
         opcode_t * const ret = expr NEXT();
-        PMC * except = Parrot_ex_build_exception(interp, EXCEPT_fatal, 1, NULL);
+        PMC * except = Parrot_ex_build_exception(interp, EXCEPT_fatal,
+                EXCEPTION_UNIMPLEMENTED,
+                Parrot_str_new_constant(interp, "Not a throwable object"));
         dest = Parrot_ex_throw_from_op(interp, except, ret);
         goto ADDRESS(dest);
     }
@@ -965,15 +882,33 @@
 }
 
 inline op pushmark(in INT) {
-    Parrot_push_mark(interp, $1);
+    PMC * const newint = pmc_new(interp, enum_class_Integer);
+    VTABLE_set_integer_native(interp, newint, $1);
+    VTABLE_push_pmc(interp, interp->dynamic_env, newint);
 }
 
 inline op popmark(in INT) {
-    Parrot_pop_mark(interp, $1);
+    opcode_t * dest;
+    opcode_t * const ret = expr NEXT();
+    int found = 0;
+    while (VTABLE_elements(interp, interp->dynamic_env)) {
+        PMC * const item = VTABLE_pop_pmc(interp, interp->dynamic_env);
+        if (item->vtable->base_type == enum_class_Integer
+         && VTABLE_get_integer(interp, item) == $1) {
+            found = 1;
+            break;
+        }
+
+        else if (item->vtable->base_type == enum_class_Sub
+              || item->vtable->base_type == enum_class_NCI)
+            Parrot_pcc_invoke_sub_from_c_args(interp, item, "I->", 0);
+    }
+    if (!found)
+        dest = Parrot_ex_throw_from_op_args(interp, ret, 1, "Mark %d not found", $1);
 }
 
 inline op pushaction(invar PMC) {
-    Parrot_push_action(interp, $1);
+    VTABLE_push_pmc(interp, interp->dynamic_env, $1);
 }
 
 =back
@@ -1197,7 +1132,7 @@
 op runinterp(invar PMC, in LABEL) {
     Interp * const new_interp = (Interp *)VTABLE_get_pointer(interp, $1);
     Interp_flags_SET(new_interp, PARROT_EXTERN_CODE_FLAG);
-    new_interp->code = interp->code;
+    Parrot_switch_to_cs(new_interp, interp->code, 1);
     runops(new_interp, REL_PC + $2);
 }
 
@@ -1311,7 +1246,7 @@
 =cut
 
 op needs_destroy(invar PMC) {
-     Parrot_gc_pmc_needs_early_collection(interp, $1);
+    Parrot_gc_pmc_needs_early_collection(interp, $1);
 }
 
 =back
@@ -1518,3 +1453,5 @@
  * End:
  * vim: expandtab shiftwidth=4:
  */
+
+

Modified: branches/orderedhash_revamp/src/ops/debug.ops
==============================================================================
--- branches/orderedhash_revamp/src/ops/debug.ops	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/ops/debug.ops	Sat Jan 23 01:49:53 2010	(r43541)
@@ -7,8 +7,6 @@
 ** debug.ops
 */
 
-VERSION = PARROT_VERSION;
-
 =head1 NAME
 
 debug.ops - Debugging Opcodes
@@ -70,9 +68,6 @@
 When you re run/continue the program begin debugged it will pay
 no attention to the debug ops.
 
-RT #42377: clone the interpreter to allow people to play into the
-debugger and then continue the normal execution of the program.
-
 =cut
 
 op debug_break() :base_debug {
@@ -122,9 +117,9 @@
 =cut
 
 inline op getline(out INT) {
-  Parrot_Context_info info;
-  Parrot_Context_get_info(interp, CONTEXT(interp), &info);
-  $1 = info.line;
+    Parrot_Context_info info;
+    Parrot_Context_get_info(interp, CURRENT_CONTEXT(interp), &info);
+    $1 = info.line;
 }
 
 =item B<getfile>(out STR)
@@ -134,9 +129,9 @@
 =cut
 
 inline op getfile(out STR) {
-  Parrot_Context_info info;
-  Parrot_Context_get_info(interp, CONTEXT(interp), &info);
-  $1 = info.file;
+    Parrot_Context_info info;
+    Parrot_Context_get_info(interp, CURRENT_CONTEXT(interp), &info);
+    $1 = info.file;
 }
 
 =back

Modified: branches/orderedhash_revamp/src/ops/experimental.ops
==============================================================================
--- branches/orderedhash_revamp/src/ops/experimental.ops	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/ops/experimental.ops	Sat Jan 23 01:49:53 2010	(r43541)
@@ -3,8 +3,6 @@
 ** experimental.ops
 */
 
-VERSION = PARROT_VERSION;
-
 =head1 NAME
 
 experimental.ops - Experimental Opcodes
@@ -53,6 +51,190 @@
 #endif
 }
 
+=over 4
+
+=item B<set_label>(invar PMC, inconst LABEL)
+
+Sets the opcode_t* label value for the given PMC. This is basically only
+useful for PMCs such as Sub, Continuation, ExceptionHandler and derivatives
+
+=item B<get_label>(out INT, invar PMC)
+
+Gets the opcode_t* label value from the given PMC. This is basically only
+useful for PMCs such as Sub, Continuation, ExceptionHandler and derivatives
+
+=back
+
+=cut
+
+inline op set_label(invar PMC, inconst LABEL) {
+    VTABLE_set_pointer(interp, $1, (CUR_OPCODE + $2));
+}
+
+inline op get_label(out INT, invar PMC) {
+    void * const ptr = VTABLE_get_pointer(interp, $2);
+    $1 =  PTR2INTVAL(ptr);
+}
+
+=over 4
+
+=item B<fetch>(out PMC, in PMC, in PMC, in PMC)
+
+Fetches a value from $2, keyed by $3 into $1.  If the resulting PMC is PMCNULL,
+uses the type in $4 to create and return a new PMC.
+
+=item B<fetch>(out PMC, in PMC, in INT, in PMC)
+
+=item B<fetch>(out PMC, in PMC, in STR, in PMC)
+
+=back
+
+=cut
+
+inline op fetch(out PMC, in PMC, in PMC, in PMC) :base_core {
+    $1 = VTABLE_get_pmc_keyed(interp, $2, $3);
+    if (PMC_IS_NULL($1)) {
+        PMC * const classobj = Parrot_oo_get_class(interp, $4);
+        if (!PMC_IS_NULL(classobj))
+            $1 = VTABLE_instantiate(interp, classobj, PMCNULL);
+        else {
+            const INTVAL type = pmc_type_p(interp, $4);
+            if (type <= 0) {
+                opcode_t *dest = Parrot_ex_throw_from_op_args(
+                    interp, expr NEXT(), EXCEPTION_NO_CLASS,
+                    "Class '%Ss' not found", VTABLE_get_repr(interp, $4));
+                goto ADDRESS(dest);
+            }
+
+            $1 = pmc_new(interp, type);
+        }
+    }
+}
+
+inline op fetch(out PMC, in PMC, in INT, in PMC) :base_core {
+    $1 = VTABLE_get_pmc_keyed_int(interp, $2, $3);
+    if (PMC_IS_NULL($1)) {
+        PMC * const classobj = Parrot_oo_get_class(interp, $4);
+        if (!PMC_IS_NULL(classobj))
+            $1 = VTABLE_instantiate(interp, classobj, PMCNULL);
+        else {
+            const INTVAL type = pmc_type_p(interp, $4);
+            if (type <= 0) {
+                opcode_t *dest = Parrot_ex_throw_from_op_args(
+                    interp, expr NEXT(), EXCEPTION_NO_CLASS,
+                    "Class '%Ss' not found", VTABLE_get_repr(interp, $4));
+                goto ADDRESS(dest);
+            }
+
+            $1 = pmc_new(interp, type);
+        }
+    }
+}
+
+inline op fetch(out PMC, in PMC, in STR, in PMC) :base_core {
+    $1 = VTABLE_get_pmc_keyed_str(interp, $2, $3);
+    if (PMC_IS_NULL($1)) {
+        PMC * const classobj = Parrot_oo_get_class(interp, $4);
+        if (!PMC_IS_NULL(classobj))
+            $1 = VTABLE_instantiate(interp, classobj, PMCNULL);
+        else {
+            const INTVAL type = pmc_type_p(interp, $4);
+            if (type <= 0) {
+                opcode_t *dest = Parrot_ex_throw_from_op_args(
+                    interp, expr NEXT(), EXCEPTION_NO_CLASS,
+                    "Class '%Ss' not found", VTABLE_get_repr(interp, $4));
+                goto ADDRESS(dest);
+            }
+
+            $1 = pmc_new(interp, type);
+        }
+    }
+}
+
+=over 4
+
+=item B<vivify>(out PMC, in PMC, in PMC, in PMC)
+
+Fetches a value from $2, keyed by $3 into $1.  If the resulting PMC is PMCNULL,
+uses the type in $4 to create and return a new PMC.
+
+=item B<vivify>(out PMC, in PMC, in INT, in PMC)
+
+=item B<vivify>(out PMC, in PMC, in STR, in PMC)
+
+=back
+
+=cut
+
+inline op vivify(out PMC, in PMC, in PMC, in PMC) :base_core {
+    $1 = VTABLE_get_pmc_keyed(interp, $2, $3);
+
+    if (PMC_IS_NULL($1)) {
+        PMC * const classobj = Parrot_oo_get_class(interp, $4);
+
+        if (!PMC_IS_NULL(classobj))
+            $1 = VTABLE_instantiate(interp, classobj, PMCNULL);
+        else {
+            const INTVAL type = pmc_type_p(interp, $4);
+            if (type <= 0) {
+                opcode_t *dest = Parrot_ex_throw_from_op_args(
+                    interp, expr NEXT(), EXCEPTION_NO_CLASS,
+                    "Class '%Ss' not found", VTABLE_get_repr(interp, $4));
+                goto ADDRESS(dest);
+            }
+
+            $1 = pmc_new(interp, type);
+        }
+        VTABLE_set_pmc_keyed(interp, $2, $3, $1);
+    }
+}
+
+inline op vivify(out PMC, in PMC, in INT, in PMC) :base_core {
+    $1 = VTABLE_get_pmc_keyed_int(interp, $2, $3);
+
+    if (PMC_IS_NULL($1)) {
+        PMC * const classobj = Parrot_oo_get_class(interp, $4);
+        if (!PMC_IS_NULL(classobj))
+            $1 = VTABLE_instantiate(interp, classobj, PMCNULL);
+        else {
+            const INTVAL type = pmc_type_p(interp, $4);
+            if (type <= 0) {
+                opcode_t *dest = Parrot_ex_throw_from_op_args(
+                    interp, expr NEXT(), EXCEPTION_NO_CLASS,
+                    "Class '%Ss' not found", VTABLE_get_repr(interp, $4));
+                goto ADDRESS(dest);
+            }
+
+            $1 = pmc_new(interp, type);
+        }
+
+        VTABLE_set_pmc_keyed_int(interp, $2, $3, $1);
+    }
+}
+
+inline op vivify(out PMC, in PMC, in STR, in PMC) :base_core {
+    $1 = VTABLE_get_pmc_keyed_str(interp, $2, $3);
+
+    if (PMC_IS_NULL($1)) {
+        PMC * const classobj = Parrot_oo_get_class(interp, $4);
+        if (!PMC_IS_NULL(classobj))
+            $1 = VTABLE_instantiate(interp, classobj, PMCNULL);
+        else {
+            const INTVAL type = pmc_type_p(interp, $4);
+            if (type <= 0) {
+                opcode_t *dest = Parrot_ex_throw_from_op_args(
+                    interp, expr NEXT(), EXCEPTION_NO_CLASS,
+                    "Class '%Ss' not found", VTABLE_get_repr(interp, $4));
+                goto ADDRESS(dest);
+            }
+
+            $1 = pmc_new(interp, type);
+        }
+
+        VTABLE_set_pmc_keyed_str(interp, $2, $3, $1);
+    }
+}
+
 =head1 COPYRIGHT
 
 Copyright (C) 2001-2009, Parrot Foundation.
@@ -64,7 +246,6 @@
 
 =cut
 
-
 /*
  * Local variables:
  *   c-file-style: "parrot"

Modified: branches/orderedhash_revamp/src/ops/io.ops
==============================================================================
--- branches/orderedhash_revamp/src/ops/io.ops	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/ops/io.ops	Sat Jan 23 01:49:53 2010	(r43541)
@@ -4,8 +4,9 @@
 ** io.ops
 */
 
-VERSION = PARROT_VERSION;
+BEGIN_OPS_PREAMBLE
 #include "../io/io_private.h"
+END_OPS_PREAMBLE
 
 
 =head1 NAME
@@ -39,7 +40,7 @@
 =cut
 
 inline op close(invar PMC) :base_io {
-  Parrot_io_close(interp, $1);
+    Parrot_io_close(interp, $1);
 }
 
 ########################################
@@ -48,9 +49,6 @@
 
 Create ParrotIO object in $1 as a copy of file descriptor $2.
 
-RT#42373: integral file descriptors might not exist outside of the UNIX
-     platform.  This op needs work.
-
 =cut
 
 inline op fdopen(out PMC, in INT, in STR) :filesys_open {
@@ -77,15 +75,15 @@
 =cut
 
 inline op getstdin(out PMC) :base_io {
-  $1 = _PIO_STDIN(interp);
+    $1 = _PIO_STDIN(interp);
 }
 
 inline op getstdout(out PMC) :base_io {
-  $1 = _PIO_STDOUT(interp);
+    $1 = _PIO_STDOUT(interp);
 }
 
 inline op getstderr(out PMC) :base_io {
-  $1 = _PIO_STDERR(interp);
+    $1 = _PIO_STDERR(interp);
 }
 
 #########################################
@@ -108,15 +106,15 @@
 =cut
 
 inline op setstdin(invar PMC) :base_io {
-        _PIO_STDIN(interp) = $1;
+    _PIO_STDIN(interp) = $1;
 }
 
 inline op setstdout(invar PMC) :base_io {
-        _PIO_STDOUT(interp) = $1;
+    _PIO_STDOUT(interp) = $1;
 }
 
 inline op setstderr(invar PMC) :base_io {
-        _PIO_STDERR(interp) = $1;
+    _PIO_STDERR(interp) = $1;
 }
 
 #########################################
@@ -179,34 +177,34 @@
 =cut
 
 inline op print(in INT) :base_io {
-  Parrot_io_printf(interp, INTVAL_FMT, (INTVAL)$1);
+    Parrot_io_printf(interp, INTVAL_FMT, (INTVAL)$1);
 }
 
 inline op print(in NUM) :base_io {
 #ifdef PARROT_HAS_NEGATIVE_ZERO
-  Parrot_io_printf(interp, FLOATVAL_FMT, $1);
-#else
-  /* Workaround for older msvcrt and openbsd. TT #313 */
-  if (Parrot_is_nzero($1)) {
-    Parrot_io_printf(interp, "-0");
-  }
-  else {
     Parrot_io_printf(interp, FLOATVAL_FMT, $1);
-  }
+#else
+    /* Workaround for older msvcrt and openbsd. TT #313 */
+    if (Parrot_is_nzero($1)) {
+        Parrot_io_printf(interp, "-0");
+    }
+    else {
+        Parrot_io_printf(interp, FLOATVAL_FMT, $1);
+    }
 #endif
 }
 
 op print(in STR) :base_io {
-  STRING * const s = $1;
-  if (s && Parrot_str_byte_length(interp, s))
-    Parrot_io_putps(interp, _PIO_STDOUT(interp), s);
+    STRING * const s = $1;
+    if (s && Parrot_str_byte_length(interp, s))
+        Parrot_io_putps(interp, _PIO_STDOUT(interp), s);
 }
 
 op print(invar PMC) :base_io {
-  PMC * const p = $1;
-  STRING * const s = (VTABLE_get_string(interp, p));
-  if (s)
-    Parrot_io_putps(interp, _PIO_STDOUT(interp), s);
+    PMC * const p = $1;
+    STRING * const s = (VTABLE_get_string(interp, p));
+    if (s)
+        Parrot_io_putps(interp, _PIO_STDOUT(interp), s);
 }
 
 =item B<say>(in INT)
@@ -222,28 +220,28 @@
 =cut
 
 inline op say(in INT) :base_io {
-  Parrot_io_printf(interp, INTVAL_FMT "\n", (INTVAL)$1);
+    Parrot_io_printf(interp, INTVAL_FMT "\n", (INTVAL)$1);
 }
 
 inline op say(in NUM) :base_io {
 #ifdef PARROT_HAS_NEGATIVE_ZERO
-  Parrot_io_printf(interp, FLOATVAL_FMT "\n", $1);
+    Parrot_io_printf(interp, FLOATVAL_FMT "\n", $1);
 #else
-  /* Workaround for older msvcrt and openbsd. TT #313 */
-  if (Parrot_is_nzero($1)) {
-      Parrot_io_printf(interp, "-0\n");
-  }
-  else {
-      Parrot_io_printf(interp, FLOATVAL_FMT "\n", $1);
-  }
+    /* Workaround for older msvcrt and openbsd. TT #313 */
+    if (Parrot_is_nzero($1)) {
+        Parrot_io_printf(interp, "-0\n");
+    }
+    else {
+        Parrot_io_printf(interp, FLOATVAL_FMT "\n", $1);
+    }
 #endif
 }
 
 op say(in STR) :base_io {
-  STRING * const s = $1;
-  if (s && Parrot_str_byte_length(interp, s))
-    Parrot_io_putps(interp, _PIO_STDOUT(interp), s);
-  Parrot_io_putps(interp, _PIO_STDOUT(interp), Parrot_str_new_constant(interp, "\n"));
+    STRING * const s = $1;
+    if (s && Parrot_str_byte_length(interp, s))
+        Parrot_io_putps(interp, _PIO_STDOUT(interp), s);
+    Parrot_io_putps(interp, _PIO_STDOUT(interp), Parrot_str_new_constant(interp, "\n"));
 }
 
 op say(invar PMC) :base_io {
@@ -281,24 +279,24 @@
 =cut
 
 op printerr(in INT) :base_io {
-  Parrot_io_eprintf(interp, INTVAL_FMT, $1);
+    Parrot_io_eprintf(interp, INTVAL_FMT, $1);
 }
 
 op printerr(in NUM) :base_io {
-  Parrot_io_eprintf(interp, FLOATVAL_FMT, $1);
+    Parrot_io_eprintf(interp, FLOATVAL_FMT, $1);
 }
 
 op printerr(in STR) :base_io {
-  STRING * const s = $1;
-  if (s && Parrot_str_byte_length(interp, s))
-    Parrot_io_putps(interp, _PIO_STDERR(interp), s);
+    STRING * const s = $1;
+    if (s && Parrot_str_byte_length(interp, s))
+        Parrot_io_putps(interp, _PIO_STDERR(interp), s);
 }
 
 op printerr(invar PMC) :base_io {
-  PMC * const p = $1;
-  STRING * const s = (VTABLE_get_string(interp, p));
-  if (s)
-    Parrot_io_putps(interp, _PIO_STDERR(interp), s);
+    PMC * const p = $1;
+    STRING * const s = (VTABLE_get_string(interp, p));
+    if (s)
+        Parrot_io_putps(interp, _PIO_STDERR(interp), s);
 }
 
 ##########################################
@@ -316,30 +314,30 @@
 =cut
 
 op print(invar PMC, in INT) :base_io {
-  if ($1) {
-    STRING * const s = Parrot_str_from_int(interp, $2);
-    Parrot_io_putps(interp, $1, s);
-  }
+    if ($1) {
+        STRING * const s = Parrot_str_from_int(interp, $2);
+        Parrot_io_putps(interp, $1, s);
+    }
 }
 
 op print(invar PMC, in NUM) :base_io {
-  if ($1) {
-    STRING * const s = Parrot_sprintf_c(interp, FLOATVAL_FMT, $2);
-    Parrot_io_putps(interp, $1, s);
-  }
+    if ($1) {
+        STRING * const s = Parrot_sprintf_c(interp, FLOATVAL_FMT, $2);
+        Parrot_io_putps(interp, $1, s);
+    }
 }
 
 op print(invar PMC, in STR) :base_io {
-  if ($2 && $1) {
-    Parrot_io_putps(interp, $1, $2);
-  }
+    if ($2 && $1) {
+        Parrot_io_putps(interp, $1, $2);
+    }
 }
 
 op print(invar PMC, invar PMC) :base_io {
-  if ($2 && $1) {
-    STRING * const s = VTABLE_get_string(interp, $2);
-    Parrot_io_putps(interp, $1, s);
-  }
+    if ($2 && $1) {
+        STRING * const s = VTABLE_get_string(interp, $2);
+        Parrot_io_putps(interp, $1, s);
+    }
 }
 
 ##########################################
@@ -355,11 +353,11 @@
 =cut
 
 op read(out STR, in INT) :base_io {
-  $1 = Parrot_io_reads(interp, _PIO_STDIN(interp), (size_t)$2);
+    $1 = Parrot_io_reads(interp, _PIO_STDIN(interp), (size_t)$2);
 }
 
 op read(out STR, invar PMC, in INT) :base_io {
-  $1 = Parrot_io_reads(interp, $2, (size_t)$3);
+    $1 = Parrot_io_reads(interp, $2, (size_t)$3);
 }
 
 =item B<readline>(out STR, invar PMC)
@@ -388,21 +386,21 @@
 =cut
 
 op peek(out STR) :base_io {
-  STRING ** const s = &$1;
+    STRING ** const s = &$1;
 
-  *s = NULL;
-  if (Parrot_io_peek(interp, _PIO_STDIN(interp), s) < 0) {
-    $1 = Parrot_str_new_noinit(interp, enum_stringrep_one, 0);
-  }
+    *s = NULL;
+    if (Parrot_io_peek(interp, _PIO_STDIN(interp), s) < 0) {
+        $1 = Parrot_str_new_noinit(interp, enum_stringrep_one, 0);
+    }
 }
 
 op peek(out STR, invar PMC) :base_io {
-  STRING ** const s = &$1;
+    STRING ** const s = &$1;
 
-  *s = NULL;
-  if (Parrot_io_peek(interp, $2, s) < 0) {
-    $1 = Parrot_str_new_noinit(interp, enum_stringrep_one, 0);
-  }
+    *s = NULL;
+    if (Parrot_io_peek(interp, $2, s) < 0) {
+        $1 = Parrot_str_new_noinit(interp, enum_stringrep_one, 0);
+    }
 }
 
 ##########################################
@@ -430,11 +428,11 @@
 =cut
 
 op stat(out INT, in STR, in INT) {
-  $1 = Parrot_stat_info_intval(interp, $2, $3);
+    $1 = Parrot_stat_info_intval(interp, $2, $3);
 }
 
 op stat(out INT, in INT, in INT) {
-  $1 = Parrot_fstat_info_intval(interp, $2, $3);
+    $1 = Parrot_fstat_info_intval(interp, $2, $3);
 }
 
 
@@ -444,7 +442,15 @@
 
 seek:
 Set file position to offset $2 on IO stream $1. 'whence' is
-indicated by the value in $3.
+indicated by the value in $3. The valid values for 'whence' are:
+
+ Value      Meaning
+ 0          Seek from the beginning of the file
+ 1          Seek from the current position
+ 2          Seek from the end of the file
+
+[ Note: the above values for 'whence' is just an educated guess
+at this point ]
 
 =item B<seek>(invar PMC, in INT, in INT, in INT)
 
@@ -493,17 +499,17 @@
 =cut
 
 op tell(out INT, invar PMC) :base_io {
-  if ($2)
-    $1 = (INTVAL)Parrot_io_tell(interp, $2);
+    if ($2)
+        $1 = (INTVAL)Parrot_io_tell(interp, $2);
 }
 
 op tell(out INT, out INT, invar PMC) :base_io {
-  if ($3) {
-    PIOOFF_T pos;
-    pos = Parrot_io_tell(interp, $3);
-    $1 = (INTVAL)(pos >> 31);
-    $2 = (INTVAL)(pos & 0xffffffff);
-  }
+    if ($3) {
+        PIOOFF_T pos;
+        pos = Parrot_io_tell(interp, $3);
+        $1 = (INTVAL)(pos >> 31);
+        $2 = (INTVAL)(pos & 0xffffffff);
+    }
 }
 
 =back

Modified: branches/orderedhash_revamp/src/ops/math.ops
==============================================================================
--- branches/orderedhash_revamp/src/ops/math.ops	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/ops/math.ops	Sat Jan 23 01:49:53 2010	(r43541)
@@ -3,8 +3,6 @@
 ** math.ops
 */
 
-VERSION = PARROT_VERSION;
-
 =head1 NAME
 
 math.ops - Mathematical Opcodes
@@ -46,33 +44,33 @@
 =cut
 
 inline op abs(inout INT) :base_core {
-  $1 = abs($1);
+    $1 = abs($1);
 }
 
 inline op abs(inout NUM) :base_core {
-  $1 = fabs($1);
+    $1 = fabs($1);
 }
 
 inline op abs(out INT, in INT) :base_core {
-  if ($2 < 0)
-    $1 = - (INTVAL)$2;
-  else
-    $1 = (INTVAL)$2;
+    if ($2 < 0)
+        $1 = - (INTVAL)$2;
+    else
+        $1 = (INTVAL)$2;
 }
 
 inline op abs(out NUM, in NUM) :base_core {
-  if ($2 < 0)
-    $1 = - (FLOATVAL)$2;
-  else
-    $1 = (FLOATVAL)$2;
+    if ($2 < 0)
+        $1 = - (FLOATVAL)$2;
+    else
+        $1 = (FLOATVAL)$2;
 }
 
 inline op abs(invar PMC) :base_core {
-  VTABLE_i_absolute(interp, $1);
+    VTABLE_i_absolute(interp, $1);
 }
 
 inline op abs(out PMC, invar PMC) :base_core {
-  $1 = VTABLE_absolute(interp, $2, $1);
+    $1 = VTABLE_absolute(interp, $2, $1);
 }
 
 ########################################
@@ -104,43 +102,43 @@
 =cut
 
 inline op add(inout INT, in INT) :base_core {
-  $1 += $2;
+    $1 += $2;
 }
 
 inline op add(inout NUM, in NUM) :base_core {
-  $1 += $2;
+    $1 += $2;
 }
 
 inline op add(invar PMC, invar PMC) :base_core {
-      VTABLE_i_add(interp, $1, $2);
+    VTABLE_i_add(interp, $1, $2);
 }
 
 inline op add(invar PMC, in INT) :base_core {
-      VTABLE_i_add_int(interp, $1, $2);
+    VTABLE_i_add_int(interp, $1, $2);
 }
 
 inline op add(invar PMC, in NUM) :base_core {
-      VTABLE_i_add_float(interp, $1, $2);
+    VTABLE_i_add_float(interp, $1, $2);
 }
 
 inline op add(out INT, in INT, in INT) :base_core {
-  $1 = $2 + $3;
+    $1 = $2 + $3;
 }
 
 inline op add(out NUM, in NUM, in NUM) :base_core {
-  $1 = $2 + $3;
+    $1 = $2 + $3;
 }
 
 inline op add(invar PMC, invar PMC, invar PMC) :base_core {
-      $1 = VTABLE_add(interp, $2, $3, $1);
+    $1 = VTABLE_add(interp, $2, $3, $1);
 }
 
 inline op add(invar PMC, invar PMC, in INT) :base_core {
-      $1 = VTABLE_add_int(interp, $2, $3, $1);
+    $1 = VTABLE_add_int(interp, $2, $3, $1);
 }
 
 inline op add(invar PMC, invar PMC, in NUM) :base_core {
-      $1 = VTABLE_add_float(interp, $2, $3, $1);
+    $1 = VTABLE_add_float(interp, $2, $3, $1);
 }
 
 ########################################
@@ -185,47 +183,47 @@
 =cut
 
 inline op cmod(out INT, in INT, in INT) :base_core {
-  INTVAL den = $3;
-  if ($3 == 0) {
-    opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
-        EXCEPTION_DIV_BY_ZERO,
-        "Divide by zero");
-    goto ADDRESS(handler);
-  }
-  $1 = $2 % den;
+    INTVAL den = $3;
+    if ($3 == 0) {
+        opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
+            EXCEPTION_DIV_BY_ZERO,
+            "Divide by zero");
+        goto ADDRESS(handler);
+    }
+    $1 = $2 % den;
 }
 
 inline op cmod(invar PMC, invar PMC, in INT) :base_core {
-  INTVAL result;
+    INTVAL result;
 
-  if ($3 == 0) {
-    opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
-        EXCEPTION_DIV_BY_ZERO,
-        "Divide by zero");
-    goto ADDRESS(handler);
-  }
+    if ($3 == 0) {
+        opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
+            EXCEPTION_DIV_BY_ZERO,
+            "Divide by zero");
+        goto ADDRESS(handler);
+    }
 
-  result = VTABLE_get_integer(interp, $2) % $3;
+    result = VTABLE_get_integer(interp, $2) % $3;
 
-  $1 = pmc_new(interp, VTABLE_type(interp, $2));
-  VTABLE_set_integer_native(interp, $1, result);
+    $1 = pmc_new(interp, VTABLE_type(interp, $2));
+    VTABLE_set_integer_native(interp, $1, result);
 }
 
 inline op cmod(invar PMC, invar PMC, invar PMC) :base_core {
-  INTVAL result;
-  INTVAL value = VTABLE_get_integer(interp, $3);
+    INTVAL result;
+    INTVAL value = VTABLE_get_integer(interp, $3);
 
-  if (value == 0) {
-    opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
-        EXCEPTION_DIV_BY_ZERO,
-        "Divide by zero");
-    goto ADDRESS(handler);
-  }
+    if (value == 0) {
+        opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
+            EXCEPTION_DIV_BY_ZERO,
+            "Divide by zero");
+        goto ADDRESS(handler);
+    }
 
-  result = VTABLE_get_integer(interp, $2) % value;
+    result = VTABLE_get_integer(interp, $2) % value;
 
-  $1 = pmc_new(interp, VTABLE_type(interp, $2));
-  VTABLE_set_integer_native(interp, $1, result);
+    $1 = pmc_new(interp, VTABLE_type(interp, $2));
+    VTABLE_set_integer_native(interp, $1, result);
 }
 
 ########################################
@@ -262,31 +260,31 @@
 =cut
 
 inline op cmod(out NUM, in NUM, in NUM) :base_core {
-  FLOATVAL den = $3;
-  if (FLOAT_IS_ZERO($3)) {
-    opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
-        EXCEPTION_DIV_BY_ZERO,
-        "Divide by zero");
-    goto ADDRESS(handler);
-  }
-  $1 = fmod($2, den);
+    FLOATVAL den = $3;
+    if (FLOAT_IS_ZERO($3)) {
+        opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
+            EXCEPTION_DIV_BY_ZERO,
+            "Divide by zero");
+        goto ADDRESS(handler);
+    }
+    $1 = fmod($2, den);
 }
 
 inline op cmod(invar PMC, invar PMC, in NUM) :base_core {
-  FLOATVAL result;
-  FLOATVAL value = $3;
+    FLOATVAL result;
+    FLOATVAL value = $3;
 
-  if (FLOAT_IS_ZERO(value)) {
-    opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
-        EXCEPTION_DIV_BY_ZERO,
-        "Divide by zero");
-    goto ADDRESS(handler);
-  }
+    if (FLOAT_IS_ZERO(value)) {
+        opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
+            EXCEPTION_DIV_BY_ZERO,
+            "Divide by zero");
+        goto ADDRESS(handler);
+    }
 
-  result = fmod(VTABLE_get_integer(interp, $2), value);
+    result = fmod(VTABLE_get_integer(interp, $2), value);
 
-  $1 = pmc_new(interp, VTABLE_type(interp, $2));
-  VTABLE_set_integer_native(interp, $1, (INTVAL) result);
+    $1 = pmc_new(interp, VTABLE_type(interp, $2));
+    VTABLE_set_integer_native(interp, $1, (INTVAL) result);
 }
 
 ########################################
@@ -302,15 +300,15 @@
 =cut
 
 inline op dec(inout INT) :base_core {
-  $1--;
+    $1--;
 }
 
 inline op dec(inout NUM) :base_core {
-  $1--;
+    $1--;
 }
 
 inline op dec(invar PMC) :base_core {
-  VTABLE_decrement(interp, $1);
+    VTABLE_decrement(interp, $1);
 }
 
 ########################################
@@ -344,70 +342,70 @@
 =cut
 
 inline op div(inout INT, in INT) :base_core {
-  INTVAL den = $2;
-  if (den == 0) {
-    opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
-        EXCEPTION_DIV_BY_ZERO,
-        "Divide by zero");
-    goto ADDRESS(handler);
-  }
-  $1 /= den;
+    INTVAL den = $2;
+    if (den == 0) {
+        opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
+            EXCEPTION_DIV_BY_ZERO,
+            "Divide by zero");
+        goto ADDRESS(handler);
+    }
+    $1 /= den;
 }
 
 inline op div(inout NUM, in NUM) :base_core {
-  FLOATVAL den = $2;
-  if (FLOAT_IS_ZERO(den)) {
-    opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
-        EXCEPTION_DIV_BY_ZERO,
-        "Divide by zero");
-    goto ADDRESS(handler);
-  }
-  $1 /= den;
+    FLOATVAL den = $2;
+    if (FLOAT_IS_ZERO(den)) {
+        opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
+            EXCEPTION_DIV_BY_ZERO,
+            "Divide by zero");
+        goto ADDRESS(handler);
+    }
+    $1 /= den;
 }
 
 inline op div(invar PMC, invar PMC) :base_core {
-      VTABLE_i_divide(interp, $1, $2);
+    VTABLE_i_divide(interp, $1, $2);
 }
 
 inline op div(invar PMC, in INT) :base_core {
-      VTABLE_i_divide_int(interp, $1, $2);
+    VTABLE_i_divide_int(interp, $1, $2);
 }
 
 inline op div(invar PMC, in NUM) :base_core {
-      VTABLE_i_divide_float(interp, $1, $2);
+    VTABLE_i_divide_float(interp, $1, $2);
 }
 inline op div(out INT, in INT, in INT) :base_core {
-  INTVAL den = $3;
-  if (den == 0) {
-    opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
-        EXCEPTION_DIV_BY_ZERO,
-        "Divide by zero");
-    goto ADDRESS(handler);
-  }
-  $1 = $2 / den;
+    INTVAL den = $3;
+    if (den == 0) {
+        opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
+            EXCEPTION_DIV_BY_ZERO,
+            "Divide by zero");
+        goto ADDRESS(handler);
+    }
+    $1 = $2 / den;
 }
 
 inline op div(out NUM, in NUM, in NUM) :base_core {
-  FLOATVAL den = $3;
-  if (FLOAT_IS_ZERO(den)) {
-    opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
-        EXCEPTION_DIV_BY_ZERO,
-        "Divide by zero");
-    goto ADDRESS(handler);
-  }
-  $1 = $2 / den;
+    FLOATVAL den = $3;
+    if (FLOAT_IS_ZERO(den)) {
+        opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
+            EXCEPTION_DIV_BY_ZERO,
+            "Divide by zero");
+        goto ADDRESS(handler);
+    }
+    $1 = $2 / den;
 }
 
 inline op div(invar PMC, invar PMC, invar PMC) :base_core {
-      $1 = VTABLE_divide(interp, $2, $3, $1);
+    $1 = VTABLE_divide(interp, $2, $3, $1);
 }
 
 inline op div(invar PMC, invar PMC, in INT) :base_core {
-      $1 = VTABLE_divide_int(interp, $2, $3, $1);
+    $1 = VTABLE_divide_int(interp, $2, $3, $1);
 }
 
 inline op div(invar PMC, invar PMC, in NUM) :base_core {
-      $1 = VTABLE_divide_float(interp, $2, $3, $1);
+    $1 = VTABLE_divide_float(interp, $2, $3, $1);
 }
 
 
@@ -440,79 +438,79 @@
 =cut
 
 inline op fdiv(inout INT, in INT) :base_core {
-  INTVAL   den = $2;
-  FLOATVAL f;
+    INTVAL   den = $2;
+    FLOATVAL f;
 
-  if (den == 0) {
-    opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
-        EXCEPTION_DIV_BY_ZERO,
-        "Divide by zero");
-    goto ADDRESS(handler);
-  }
+    if (den == 0) {
+        opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
+            EXCEPTION_DIV_BY_ZERO,
+            "Divide by zero");
+        goto ADDRESS(handler);
+    }
 
-  f  = floor($1 / den);
-  $1 = (INTVAL)f;
+    f  = floor($1 / den);
+    $1 = (INTVAL)f;
 }
 
 inline op fdiv(inout NUM, in NUM) :base_core {
-  FLOATVAL den = $2;
-  if (FLOAT_IS_ZERO(den)) {
-    opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
-        EXCEPTION_DIV_BY_ZERO,
-        "Divide by zero");
-    goto ADDRESS(handler);
-  }
-  $1 = floor($1 / den);
+    FLOATVAL den = $2;
+    if (FLOAT_IS_ZERO(den)) {
+        opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
+            EXCEPTION_DIV_BY_ZERO,
+            "Divide by zero");
+        goto ADDRESS(handler);
+    }
+    $1 = floor($1 / den);
 }
 
 inline op fdiv(invar PMC, invar PMC) :base_core {
-      VTABLE_i_floor_divide(interp, $1, $2);
+    VTABLE_i_floor_divide(interp, $1, $2);
 }
 
 inline op fdiv(invar PMC, in INT) :base_core {
-      VTABLE_i_floor_divide_int(interp, $1, $2);
+    VTABLE_i_floor_divide_int(interp, $1, $2);
 }
 
 inline op fdiv(invar PMC, in NUM) :base_core {
-      VTABLE_i_floor_divide_float(interp, $1, $2);
+    VTABLE_i_floor_divide_float(interp, $1, $2);
 }
 
 inline op fdiv(out INT, in INT, in INT) :base_core {
-  INTVAL   den = $3;
-  FLOATVAL f;
+    INTVAL   den = $3;
+    FLOATVAL f;
 
-  if (den == 0) {
-    opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
-        EXCEPTION_DIV_BY_ZERO,
-        "Divide by zero");
-    goto ADDRESS(handler);
-  }
+    if (den == 0) {
+        opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
+            EXCEPTION_DIV_BY_ZERO,
+            "Divide by zero");
+        goto ADDRESS(handler);
+    }
 
-  f  = floor($2 / den);
-  $1 = (INTVAL)f;
+    f  = floor($2 / den);
+    $1 = (INTVAL)f;
 }
 
 inline op fdiv(out NUM, in NUM, in NUM) :base_core {
-  FLOATVAL den = $3;
-  if (FLOAT_IS_ZERO(den)) {
-    opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
-        EXCEPTION_DIV_BY_ZERO,
-        "Divide by zero");
-    goto ADDRESS(handler);
-  }
-  $1 = floor($2 / den);
+    FLOATVAL den = $3;
+    if (FLOAT_IS_ZERO(den)) {
+        opcode_t *handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
+            EXCEPTION_DIV_BY_ZERO,
+            "Divide by zero");
+        goto ADDRESS(handler);
+    }
+    $1 = floor($2 / den);
 }
 
 inline op fdiv(invar PMC, invar PMC, invar PMC) :base_core {
-      $1 = VTABLE_floor_divide(interp, $2, $3, $1);
+    $1 = VTABLE_floor_divide(interp, $2, $3, $1);
 }
 
 inline op fdiv(invar PMC, invar PMC, in INT) :base_core {
-      $1 = VTABLE_floor_divide_int(interp, $2, $3, $1);
+    $1 = VTABLE_floor_divide_int(interp, $2, $3, $1);
 }
 
 inline op fdiv(invar PMC, invar PMC, in NUM) :base_core {
-      $1 = VTABLE_floor_divide_float(interp, $2, $3, $1);
+    $1 = VTABLE_floor_divide_float(interp, $2, $3, $1);
 }
 
 ########################################
@@ -530,16 +528,16 @@
 =cut
 
 inline op ceil(inout NUM) :base_core {
-  $1 = ceil($1);
+    $1 = ceil($1);
 }
 
 inline op ceil(out INT, in NUM) :base_core {
-  FLOATVAL f = ceil($2);
-  $1         = (INTVAL)f;
+    FLOATVAL f = ceil($2);
+    $1         = (INTVAL)f;
 }
 
 inline op ceil(out NUM, in NUM) :base_core {
-  $1 = ceil($2);
+    $1 = ceil($2);
 }
 
 ########################################
@@ -557,16 +555,16 @@
 =cut
 
 inline op floor(inout NUM) :base_core {
-  $1 = floor($1);
+    $1 = floor($1);
 }
 
 inline op floor(out INT, in NUM) :base_core {
-  FLOATVAL f = floor($2);
-  $1         = (INTVAL)f;
+    FLOATVAL f = floor($2);
+    $1         = (INTVAL)f;
 }
 
 inline op floor(out NUM, in NUM) :base_core {
-  $1 = floor($2);
+    $1 = floor($2);
 }
 
 ########################################
@@ -582,15 +580,15 @@
 =cut
 
 inline op inc(inout INT) :base_core {
-  $1++;
+    $1++;
 }
 
 inline op inc(inout NUM) :base_core {
-  $1++;
+    $1++;
 }
 
 inline op inc(invar PMC) :base_core {
-  VTABLE_increment(interp, $1);
+    VTABLE_increment(interp, $1);
 }
 
 
@@ -642,43 +640,43 @@
 =cut
 
 op mod(inout INT, in INT) :base_core {
-  $1 = intval_mod($1, $2);
+    $1 = intval_mod($1, $2);
 }
 
 op mod(inout NUM, in NUM) :base_core {
-  $1 = floatval_mod($1, $2);
+    $1 = floatval_mod($1, $2);
 }
 
 inline op mod(invar PMC, invar PMC) :base_core {
-      VTABLE_i_modulus(interp, $1, $2);
+    VTABLE_i_modulus(interp, $1, $2);
 }
 
 inline op mod(invar PMC, in INT) :base_core {
-      VTABLE_i_modulus_int(interp, $1, $2);
+    VTABLE_i_modulus_int(interp, $1, $2);
 }
 
 inline op mod(invar PMC, in NUM) :base_core {
-      VTABLE_i_modulus_float(interp, $1, $2);
+    VTABLE_i_modulus_float(interp, $1, $2);
 }
 
 op mod(out INT, in INT, in INT) :base_core {
-  $1 = intval_mod($2, $3);
+    $1 = intval_mod($2, $3);
 }
 
 op mod(out NUM, in NUM, in NUM) :base_core {
-  $1 = floatval_mod($2, $3);
+    $1 = floatval_mod($2, $3);
 }
 
 inline op mod(invar PMC, invar PMC, invar PMC) :base_core {
-      $1 = VTABLE_modulus(interp, $2, $3, $1);
+    $1 = VTABLE_modulus(interp, $2, $3, $1);
 }
 
 inline op mod(invar PMC, invar PMC, in INT) :base_core {
-      $1 = VTABLE_modulus_int(interp, $2, $3, $1);
+    $1 = VTABLE_modulus_int(interp, $2, $3, $1);
 }
 
 inline op mod(invar PMC, invar PMC, in NUM) :base_core {
-      $1 = VTABLE_modulus_float(interp, $2, $3, $1);
+    $1 = VTABLE_modulus_float(interp, $2, $3, $1);
 }
 
 ########################################
@@ -710,43 +708,43 @@
 =cut
 
 inline op mul(inout INT, in INT) :base_core {
-  $1 *= $2;
+    $1 *= $2;
 }
 
 inline op mul(inout NUM, in NUM) :base_core {
-  $1 *= $2;
+    $1 *= $2;
 }
 
 inline op mul(invar PMC, invar PMC) :base_core {
-      VTABLE_i_multiply(interp, $1, $2);
+    VTABLE_i_multiply(interp, $1, $2);
 }
 
 inline op mul(invar PMC, in INT) :base_core {
-      VTABLE_i_multiply_int(interp, $1, $2);
+    VTABLE_i_multiply_int(interp, $1, $2);
 }
 
 inline op mul(invar PMC, in NUM) :base_core {
-      VTABLE_i_multiply_float(interp, $1, $2);
+    VTABLE_i_multiply_float(interp, $1, $2);
 }
 
 inline op mul(out INT, in INT, in INT) :base_core {
-  $1 = $2 * $3;
+    $1 = $2 * $3;
 }
 
 inline op mul(out NUM, in NUM, in NUM) :base_core {
-  $1 = $2 * $3;
+    $1 = $2 * $3;
 }
 
 inline op mul(invar PMC, invar PMC, invar PMC) :base_core {
-      $1 = VTABLE_multiply(interp, $2, $3, $1);
+    $1 = VTABLE_multiply(interp, $2, $3, $1);
 }
 
 inline op mul(invar PMC, invar PMC, in INT) :base_core {
-      $1 = VTABLE_multiply_int(interp, $2, $3, $1);
+    $1 = VTABLE_multiply_int(interp, $2, $3, $1);
 }
 
 inline op mul(invar PMC, invar PMC, in NUM) :base_core {
-      $1 = VTABLE_multiply_float(interp, $2, $3, $1);
+    $1 = VTABLE_multiply_float(interp, $2, $3, $1);
 }
 
 ########################################
@@ -770,27 +768,27 @@
 =cut
 
 inline op neg(inout INT) :base_core {
-  $1 = - $1;
+    $1 = - $1;
 }
 
 inline op neg(inout NUM) :base_core {
-  $1 = - $1;
+    $1 = - $1;
 }
 
 inline op neg(invar PMC) :base_core {
-  VTABLE_i_neg(interp, $1);
+    VTABLE_i_neg(interp, $1);
 }
 
 inline op neg(out INT, in INT) :base_core {
-  $1 = - $2;
+    $1 = - $2;
 }
 
 inline op neg(out NUM, in NUM) :base_core {
-  $1 = - $2;
+    $1 = - $2;
 }
 
 inline op neg(out PMC, invar PMC) :base_core {
-  $1 = VTABLE_neg(interp, $2, $1);
+    $1 = VTABLE_neg(interp, $2, $1);
 }
 
 ########################################
@@ -810,19 +808,19 @@
 =cut
 
 inline op pow(out NUM, in NUM, in NUM) :base_core {
-   $1 = pow((FLOATVAL)$2, (FLOATVAL)$3);
+    $1 = pow((FLOATVAL)$2, (FLOATVAL)$3);
 }
 
 inline op pow(invar PMC, invar PMC, invar PMC) :base_core {
-      $1 = VTABLE_pow(interp, $2, $3, $1);
+    $1 = VTABLE_pow(interp, $2, $3, $1);
 }
 
 inline op pow(invar PMC, invar PMC, in INT) :base_core {
-      $1 = VTABLE_pow_int(interp, $2, $3, $1);
+    $1 = VTABLE_pow_int(interp, $2, $3, $1);
 }
 
 inline op pow(invar PMC, invar PMC, in NUM) :base_core {
-      $1 = VTABLE_pow_float(interp, $2, $3, $1);
+    $1 = VTABLE_pow_float(interp, $2, $3, $1);
 }
 
 inline op pow(out NUM, in NUM, in INT) :base_core {
@@ -878,43 +876,43 @@
 =cut
 
 inline op sub(inout INT, in INT) :base_core {
-  $1 -= $2;
+    $1 -= $2;
 }
 
 inline op sub(inout NUM, in NUM) :base_core {
-  $1 -= $2;
+    $1 -= $2;
 }
 
 inline op sub(invar PMC, invar PMC) :base_core {
-      VTABLE_i_subtract(interp, $1, $2);
+    VTABLE_i_subtract(interp, $1, $2);
 }
 
 inline op sub(invar PMC, in INT) :base_core {
-      VTABLE_i_subtract_int(interp, $1, $2);
+    VTABLE_i_subtract_int(interp, $1, $2);
 }
 
 inline op sub(invar PMC, in NUM) :base_core {
-      VTABLE_i_subtract_float(interp, $1, $2);
+    VTABLE_i_subtract_float(interp, $1, $2);
 }
 
 inline op sub(out INT, in INT, in INT) :base_core {
-  $1 = $2 - $3;
+    $1 = $2 - $3;
 }
 
 inline op sub(out NUM, in NUM, in NUM) :base_core {
-  $1 = $2 - $3;
+    $1 = $2 - $3;
 }
 
 inline op sub(invar PMC, invar PMC, invar PMC) :base_core {
-      $1 = VTABLE_subtract(interp, $2, $3, $1);
+    $1 = VTABLE_subtract(interp, $2, $3, $1);
 }
 
 inline op sub(invar PMC, invar PMC, in INT) :base_core {
-      $1 = VTABLE_subtract_int(interp, $2, $3, $1);
+    $1 = VTABLE_subtract_int(interp, $2, $3, $1);
 }
 
 inline op sub(invar PMC, invar PMC, in NUM) :base_core {
-      $1 = VTABLE_subtract_float(interp, $2, $3, $1);
+    $1 = VTABLE_subtract_float(interp, $2, $3, $1);
 }
 
 ########################################
@@ -926,7 +924,7 @@
 =cut
 
 inline op sqrt(out NUM, in NUM) :base_core {
-  $1 = sqrt((FLOATVAL)$2);
+    $1 = sqrt((FLOATVAL)$2);
 }
 
 =back
@@ -955,7 +953,7 @@
 =cut
 
 inline op acos(out NUM, in NUM) :base_math {
-  $1 = acos((FLOATVAL)$2);
+    $1 = acos((FLOATVAL)$2);
 }
 
 ########################################
@@ -967,7 +965,7 @@
 =cut
 
 inline op asec(out NUM, in NUM) :base_math {
-  $1 = acos(((FLOATVAL)1) / ((FLOATVAL)$2));
+    $1 = acos(((FLOATVAL)1) / ((FLOATVAL)$2));
 }
 
 ########################################
@@ -980,7 +978,7 @@
 =cut
 
 inline op asin(out NUM, in NUM) :base_math {
-  $1 = asin((FLOATVAL)$2);
+    $1 = asin((FLOATVAL)$2);
 }
 
 ########################################
@@ -998,11 +996,11 @@
 =cut
 
 inline op atan(out NUM, in NUM) :base_math {
-  $1 = atan((FLOATVAL)$2);
+    $1 = atan((FLOATVAL)$2);
 }
 
 inline op atan(out NUM, in NUM, in NUM) :base_math {
-  $1 = atan2((FLOATVAL)$2, (FLOATVAL)$3);
+    $1 = atan2((FLOATVAL)$2, (FLOATVAL)$3);
 }
 
 ########################################
@@ -1014,7 +1012,7 @@
 =cut
 
 inline op cos(out NUM, in NUM) :base_math {
-  $1 = cos((FLOATVAL)$2);
+    $1 = cos((FLOATVAL)$2);
 }
 
 ########################################
@@ -1026,7 +1024,7 @@
 =cut
 
 inline op cosh(out NUM, in NUM) :base_math {
-  $1 = cosh((FLOATVAL)$2);
+    $1 = cosh((FLOATVAL)$2);
 }
 
 ########################################
@@ -1039,7 +1037,7 @@
 =cut
 
 inline op exp(out NUM, in NUM) :base_math {
-  $1 = exp((FLOATVAL)$2);
+    $1 = exp((FLOATVAL)$2);
 }
 
 ########################################
@@ -1051,7 +1049,7 @@
 =cut
 
 inline op ln(out NUM, in NUM) :base_math {
-  $1 = log((FLOATVAL)$2);
+    $1 = log((FLOATVAL)$2);
 }
 
 ########################################
@@ -1063,7 +1061,7 @@
 =cut
 
 inline op log10(out NUM, in NUM) :base_math {
-  $1 = log10((FLOATVAL)$2);
+    $1 = log10((FLOATVAL)$2);
 }
 
 ########################################
@@ -1075,8 +1073,8 @@
 =cut
 
 op log2(out NUM, in NUM) :base_math {
-   FLOATVAL temp = log((FLOATVAL)2.0);
-  $1 = log((FLOATVAL)$2) / temp;
+    FLOATVAL temp = log((FLOATVAL)2.0);
+    $1 = log((FLOATVAL)$2) / temp;
 }
 
 ########################################
@@ -1088,7 +1086,7 @@
 =cut
 
 inline op sec(out NUM, in NUM) :base_math {
-  $1 = ((FLOATVAL)1) / cos((FLOATVAL)$2);
+    $1 = ((FLOATVAL)1) / cos((FLOATVAL)$2);
 }
 
 ########################################
@@ -1100,7 +1098,7 @@
 =cut
 
 inline op sech(out NUM, in NUM) :base_math {
-  $1 = ((FLOATVAL)1) / cosh((FLOATVAL)$2);
+    $1 = ((FLOATVAL)1) / cosh((FLOATVAL)$2);
 }
 
 ########################################
@@ -1112,7 +1110,7 @@
 =cut
 
 inline op sin(out NUM, in NUM) :base_math {
-  $1 = sin((FLOATVAL)$2);
+    $1 = sin((FLOATVAL)$2);
 }
 
 ########################################
@@ -1124,7 +1122,7 @@
 =cut
 
 inline op sinh(out NUM, in NUM) :base_math {
-  $1 = sinh((FLOATVAL)$2);
+    $1 = sinh((FLOATVAL)$2);
 }
 
 ########################################
@@ -1136,7 +1134,7 @@
 =cut
 
 inline op tan(out NUM, in NUM) :base_math {
-  $1 = tan((FLOATVAL)$2);
+    $1 = tan((FLOATVAL)$2);
 }
 
 ########################################
@@ -1148,7 +1146,7 @@
 =cut
 
 inline op tanh(out NUM, in NUM) :base_math {
-  $1 = tanh((FLOATVAL)$2);
+    $1 = tanh((FLOATVAL)$2);
 }
 
 =back
@@ -1174,27 +1172,27 @@
 =cut
 
 inline op gcd(out INT, in INT, in INT) :advanced_math {
- INTVAL p = 0;
- INTVAL a = $2 < 0 ? -$2 : $2;
- INTVAL b = $3 < 0 ? -$3 : $3;
-
- if (a==0) { $1=b; goto NEXT(); }
- if (b==0) { $1=a; goto NEXT(); }
-
- while (!((a | b) & 1)) {
-   a>>=1;
-   b>>=1;
-   p++;
- }
-
- while (a>0) {
-   if (!(a & 1)) a>>=1;
-   else if (!(b & 1)) b>>=1;
-   else if (a<b)      b = (b-a)>>1;
-   else               a = (a-b)>>1;
- }
+    INTVAL p = 0;
+    INTVAL a = $2 < 0 ? -$2 : $2;
+    INTVAL b = $3 < 0 ? -$3 : $3;
+
+    if (a==0) { $1=b; goto NEXT(); }
+    if (b==0) { $1=a; goto NEXT(); }
+
+    while (!((a | b) & 1)) {
+        a>>=1;
+        b>>=1;
+        p++;
+    }
 
- $1 = b<<p;
+    while (a>0) {
+        if (!(a & 1)) a>>=1;
+        else if (!(b & 1)) b>>=1;
+        else if (a<b)      b = (b-a)>>1;
+        else               a = (a-b)>>1;
+    }
+
+    $1 = b<<p;
 }
 
 
@@ -1207,30 +1205,30 @@
 =cut
 
 inline op lcm(out INT, in INT, in INT) :advanced_math {
- INTVAL gcd = 0;
- INTVAL p = 0;
- INTVAL a = $2 < 0 ? -$2 : $2;
- INTVAL b = $3 < 0 ? -$3 : $3;
- INTVAL saved_var1 = a, saved_var2 = b;
-
- if (a==0 || b==0) { $1=0; goto NEXT(); }
-
- while (!((a | b) & 1)) {
-   a>>=1;
-   b>>=1;
-   p++;
- }
-
- while (a>0) {
-   if (!(a & 1)) a>>=1;
-   else if (!(b & 1)) b>>=1;
-   else if (a<b)      b = (b-a)>>1;
-   else               a = (a-b)>>1;
- }
-
- gcd = b<<p;
- saved_var1 /= gcd;
- $1 = saved_var1*saved_var2;
+    INTVAL gcd = 0;
+    INTVAL p = 0;
+    INTVAL a = $2 < 0 ? -$2 : $2;
+    INTVAL b = $3 < 0 ? -$3 : $3;
+    INTVAL saved_var1 = a, saved_var2 = b;
+
+    if (a==0 || b==0) { $1=0; goto NEXT(); }
+
+    while (!((a | b) & 1)) {
+        a>>=1;
+        b>>=1;
+        p++;
+    }
+
+    while (a>0) {
+        if (!(a & 1)) a>>=1;
+        else if (!(b & 1)) b>>=1;
+        else if (a<b)      b = (b-a)>>1;
+        else               a = (a-b)>>1;
+    }
+
+    gcd = b<<p;
+    saved_var1 /= gcd;
+    $1 = saved_var1*saved_var2;
 }
 
 ########################################
@@ -1244,27 +1242,27 @@
 =cut
 
 inline op fact(out INT, in INT) :advanced_math {
-  /* Coercing a negative to a UINT can get pretty ugly
-   * in this situation. */
-  INTVAL i = $2;
-  UINTVAL q = 1;
-  while (i>0) {
-    q = q*i;
-    i--;
-  }
-  $1 = q;
+    /* Coercing a negative to a UINT can get pretty ugly
+     * in this situation. */
+    INTVAL i = $2;
+    UINTVAL q = 1;
+    while (i>0) {
+        q = q*i;
+        i--;
+    }
+    $1 = q;
 }
 
 inline op fact(out NUM, in INT) :advanced_math {
-  /* Coercing a negative to a UINT can get pretty ugly
-   * in this situation. */
-  INTVAL i = $2;
-  FLOATVAL q = 1;
-  while (i>0) {
-    q = q*i;
-    i--;
-  }
-  $1 = q;
+    /* Coercing a negative to a UINT can get pretty ugly
+     * in this situation. */
+    INTVAL i = $2;
+    FLOATVAL q = 1;
+    while (i>0) {
+        q = q*i;
+        i--;
+    }
+    $1 = q;
 }
 
 =back

Modified: branches/orderedhash_revamp/src/ops/object.ops
==============================================================================
--- branches/orderedhash_revamp/src/ops/object.ops	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/ops/object.ops	Sat Jan 23 01:49:53 2010	(r43541)
@@ -6,9 +6,6 @@
 
 */
 
-
-VERSION = PARROT_VERSION;
-
 =head1 NAME
 
 object.ops - Class and Object Opcodes
@@ -50,121 +47,134 @@
 =cut
 
 op callmethodcc(invar PMC, in STR) :object_base :flow {
-  PMC      * const object     = $1;
-  STRING   * const meth       = $2;
-  opcode_t * const next       = expr NEXT();
-
-  /* a class-specific find_method can overwrite interp->current_args()! */
-  opcode_t *current_args      = interp->current_args;
-  PMC      * const method_pmc = VTABLE_find_method(interp, object, meth);
-  opcode_t *dest              = NULL;
-  interp->current_args        = current_args;
-
-  if (PMC_IS_NULL(method_pmc)) {
-    PMC * const _class = VTABLE_get_class(interp, object);
-    if (PMC_IS_NULL(_class)) {
-      dest = Parrot_ex_throw_from_op_args(interp, next,
-          EXCEPTION_METHOD_NOT_FOUND,
-          "Method '%Ss' not found for non-object", meth);
+    PMC      * const object     = $1;
+    STRING   * const meth       = $2;
+    opcode_t * const next       = expr NEXT();
+
+    PMC      * const method_pmc = VTABLE_find_method(interp, object, meth);
+    opcode_t *dest              = NULL;
+
+    if (PMC_IS_NULL(method_pmc)) {
+        PMC * const _class = VTABLE_get_class(interp, object);
+        if (PMC_IS_NULL(_class)) {
+            dest = Parrot_ex_throw_from_op_args(interp, next,
+                EXCEPTION_METHOD_NOT_FOUND,
+                "Method '%Ss' not found for non-object", meth);
+        }
+        else {
+            dest = Parrot_ex_throw_from_op_args(interp, next,
+                EXCEPTION_METHOD_NOT_FOUND,
+                "Method '%Ss' not found for invocant of class '%Ss'", meth,
+                VTABLE_get_string(interp, _class));
+        }
     }
     else {
-      dest = Parrot_ex_throw_from_op_args(interp, next,
-          EXCEPTION_METHOD_NOT_FOUND,
-          "Method '%Ss' not found for invocant of class '%Ss'", meth,
-          VTABLE_get_string(interp, _class));
+        interp->current_object = object;
+        interp->current_cont   = NEED_CONTINUATION;
+        dest                   = VTABLE_invoke(interp, method_pmc, next);
     }
-  }
-  else {
-    interp->current_object = object;
-    interp->current_cont   = NEED_CONTINUATION;
-    dest                   = VTABLE_invoke(interp, method_pmc, next);
-  }
-  goto ADDRESS(dest);
+    goto ADDRESS(dest);
 }
 
 op callmethodcc(invar PMC, invar PMC) :object_base :flow {
-  opcode_t        *dest;
-  opcode_t * const next  = expr NEXT();
+    opcode_t        *dest;
+    opcode_t * const next  = expr NEXT();
 
-  interp->current_object = $1;
-  interp->current_cont   = NEED_CONTINUATION;
-  dest                   = VTABLE_invoke(interp, $2, next);
+    interp->current_object = $1;
+    interp->current_cont   = NEED_CONTINUATION;
+    dest                   = VTABLE_invoke(interp, $2, next);
 
-  goto ADDRESS(dest);
+    goto ADDRESS(dest);
 }
 
 op callmethod(invar PMC, in STR, invar PMC) :object_base :flow {
-  PMC      * const object     = $1;
-  STRING   * const meth       = $2;
-  opcode_t * const next       = expr NEXT();
-
-  /* a class-specific find_method can overwrite interp->current_args()! */
-  opcode_t *current_args      = interp->current_args;
-  PMC      * const method_pmc = VTABLE_find_method(interp, object, meth);
-  opcode_t *dest              = NULL;
-  interp->current_args        = current_args;
-
-
-  if (PMC_IS_NULL(method_pmc)) {
-    dest = Parrot_ex_throw_from_op_args(interp, next, EXCEPTION_METHOD_NOT_FOUND,
-        "Method '%Ss' not found for invocant of class '%Ss'", meth,
-        VTABLE_get_string(interp, VTABLE_get_class(interp, object)));
-  }
-  else {
+    PMC      * const object     = $1;
+    STRING   * const meth       = $2;
+    opcode_t * const next       = expr NEXT();
+
+    PMC      * const method_pmc = VTABLE_find_method(interp, object, meth);
+    opcode_t *dest              = NULL;
+
+
+    if (PMC_IS_NULL(method_pmc)) {
+        dest = Parrot_ex_throw_from_op_args(interp, next, EXCEPTION_METHOD_NOT_FOUND,
+            "Method '%Ss' not found for invocant of class '%Ss'", meth,
+            VTABLE_get_string(interp, VTABLE_get_class(interp, object)));
+    }
+    else {
+        interp->current_object = object;
+        interp->current_cont = $3;
+        dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next);
+    }
+    goto ADDRESS(dest);
+}
+
+op callmethod(invar PMC, invar PMC, invar PMC) :object_base :flow {
+    PMC      * const object     = $1;
+    PMC      * const method_pmc = $2;
+    opcode_t * const next       = expr NEXT();
+
+    opcode_t *dest;
+
     interp->current_object = object;
     interp->current_cont = $3;
     dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next);
-  }
-  goto ADDRESS(dest);
+    goto ADDRESS(dest);
 }
 
-op callmethod(invar PMC, invar PMC, invar PMC) :object_base :flow {
-  PMC      * const object     = $1;
-  PMC      * const method_pmc = $2;
-  opcode_t * const next       = expr NEXT();
-
-  opcode_t *dest;
-
-  interp->current_object = object;
-  interp->current_cont = $3;
-  dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next);
-  goto ADDRESS(dest);
+op tailcallmethod(invar PMC, in STR) :object_base :flow {
+    opcode_t * const next       = expr NEXT();
+    PMC      * const object     = $1;
+    STRING   * const meth       = $2;
+    PMC      * const method_pmc = VTABLE_find_method(interp, object, meth);
+
+    opcode_t *dest;
+
+    if (PMC_IS_NULL(method_pmc)) {
+        dest = Parrot_ex_throw_from_op_args(interp, next, EXCEPTION_METHOD_NOT_FOUND,
+            "Method '%Ss' not found for invocant of class '%Ss'", meth,
+            VTABLE_get_string(interp, VTABLE_get_class(interp, object)));
+    }
+    else {
+        interp->current_cont = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp));
+        PObj_get_FLAGS(interp->current_cont) |= SUB_FLAG_TAILCALL;
+        /* Detach continuation from current CallContext to avoid marking dead object. */
+        /* RetContinuation will kill itself after invoke */
+        if (interp->current_cont->vtable->base_type == enum_class_RetContinuation
+            && Parrot_pcc_do_run_ops(interp, method_pmc)) {
+            PMC * const ctx             = CURRENT_CONTEXT(interp);
+            PMC * const parent_ctx      = Parrot_pcc_get_caller_ctx(interp, ctx);
+            PMC_cont(interp->current_cont)->from_ctx = parent_ctx;
+            Parrot_pcc_set_continuation(interp, ctx, PMCNULL);
+        }
+        interp->current_object = object;
+        dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next);
+    }
+    goto ADDRESS(dest);
 }
 
-op tailcallmethod(invar PMC, in STR) :object_base :flow {
-  opcode_t * const next       = expr NEXT();
-  PMC      * const object     = $1;
-  STRING   * const meth       = $2;
-  PMC      * const method_pmc = VTABLE_find_method(interp, object, meth);
-
-  opcode_t *dest;
-
-  if (PMC_IS_NULL(method_pmc)) {
-    dest = Parrot_ex_throw_from_op_args(interp, next, EXCEPTION_METHOD_NOT_FOUND,
-        "Method '%Ss' not found for invocant of class '%Ss'", meth,
-        VTABLE_get_string(interp, VTABLE_get_class(interp, object)));
-  }
-  else {
-    interp->current_cont = CONTEXT(interp)->current_cont;
+op tailcallmethod(invar PMC, invar PMC) :object_base :flow {
+    opcode_t * const next       = expr NEXT();
+    PMC      * const object     = $1;
+    PMC      * const method_pmc = $2;
+
+    opcode_t *dest;
+
+    interp->current_cont = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp));
     PObj_get_FLAGS(interp->current_cont) |= SUB_FLAG_TAILCALL;
+    /* Detach continuation from current CallContext to avoid marking dead object. */
+    /* RetContinuation will kill itself after invoke */
+    if (interp->current_cont->vtable->base_type == enum_class_RetContinuation
+        && Parrot_pcc_do_run_ops(interp, method_pmc)) {
+        PMC * const ctx             = CURRENT_CONTEXT(interp);
+        PMC * const parent_ctx      = Parrot_pcc_get_caller_ctx(interp, ctx);
+        PMC_cont(interp->current_cont)->from_ctx = parent_ctx;
+        Parrot_pcc_set_continuation(interp, ctx, PMCNULL);
+    }
+
     interp->current_object = object;
     dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next);
-  }
-  goto ADDRESS(dest);
-}
-
-op tailcallmethod(invar PMC, invar PMC) :object_base :flow {
-  opcode_t * const next       = expr NEXT();
-  PMC      * const object     = $1;
-  PMC      * const method_pmc = $2;
-
-  opcode_t *dest;
-
-  interp->current_cont = CONTEXT(interp)->current_cont;
-  PObj_get_FLAGS(interp->current_cont) |= SUB_FLAG_TAILCALL;
-  interp->current_object = object;
-  dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next);
-  goto ADDRESS(dest);
+    goto ADDRESS(dest);
 }
 
 =item B<addmethod>(invar PMC, in STR, invar PMC)
@@ -174,7 +184,7 @@
 =cut
 
 inline op addmethod(invar PMC, in STR, invar PMC) :object_classes {
-  VTABLE_add_method(interp, $1, $2, $3);
+    VTABLE_add_method(interp, $1, $2, $3);
 }
 
 
@@ -186,7 +196,7 @@
 =cut
 
 inline op can(out INT, invar PMC, in STR) :object_base {
-  $1 = VTABLE_can(interp, $2, $3);
+    $1 = VTABLE_can(interp, $2, $3);
 }
 
 
@@ -198,7 +208,7 @@
 =cut
 
 inline op does(out INT, invar PMC, in STR) :object_base {
-  $1 = $3 ? VTABLE_does(interp, $2, $3) : 0;
+    $1 = $3 ? VTABLE_does(interp, $2, $3) : 0;
 }
 
 =item B<does>(out INT, invar PMC, in PMC)
@@ -209,7 +219,7 @@
 =cut
 
 inline op does(out INT, invar PMC, in PMC) :object_base {
-  $1 = $3 ? VTABLE_does_pmc(interp, $2, $3) : 0;
+    $1 = $3 ? VTABLE_does_pmc(interp, $2, $3) : 0;
 }
 
 =item B<isa>(out INT, invar PMC, in STR)
@@ -222,7 +232,7 @@
 =cut
 
 inline op isa(out INT, invar PMC, in STR) :object_base {
-  $1 = $3 ? VTABLE_isa(interp, $2, $3) : 0;
+    $1 = $3 ? VTABLE_isa(interp, $2, $3) : 0;
 }
 
 inline op isa(out INT, invar PMC, in PMC) :object_base {
@@ -244,9 +254,9 @@
 =cut
 
 inline op newclass(out PMC, in STR) :object_classes {
-  PMC * const name = pmc_new(interp, enum_class_String);
-  VTABLE_set_string_native(interp, name, $2);
-  $1 = pmc_new_init(interp, enum_class_Class, name);
+    PMC * const name = pmc_new(interp, enum_class_String);
+    VTABLE_set_string_native(interp, name, $2);
+    $1 = pmc_new_init(interp, enum_class_Class, name);
 }
 
 inline op newclass(out PMC, in PMC) :object_classes {
@@ -382,11 +392,11 @@
 =cut
 
 inline op get_class(out PMC, in STR) :object_classes {
-  $1 = Parrot_oo_get_class_str(interp, $2);
+    $1 = Parrot_oo_get_class_str(interp, $2);
 }
 
 inline op get_class(out PMC, in PMC) :object_classes {
-  $1 = Parrot_oo_get_class(interp, $2);
+    $1 = Parrot_oo_get_class(interp, $2);
 }
 
 ###############################################################################
@@ -520,11 +530,11 @@
 =cut
 
 inline op inspect(out PMC, in PMC) :object_classes {
-  $1 = VTABLE_inspect(interp, $2);
+    $1 = VTABLE_inspect(interp, $2);
 }
 
 inline op inspect(out PMC, in PMC, in STR) :object_classes {
-  $1 = VTABLE_inspect_str(interp, $2, $3);
+    $1 = VTABLE_inspect_str(interp, $2, $3);
 }
 
 =back

Modified: branches/orderedhash_revamp/src/ops/ops.num
==============================================================================
--- branches/orderedhash_revamp/src/ops/ops.num	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/ops/ops.num	Sat Jan 23 01:49:53 2010	(r43541)
@@ -35,1248 +35,1242 @@
 load_language_sc                 11
 branch_i                         12
 branch_ic                        13
-branch_cs_s                      14
-branch_cs_sc                     15
-bsr_i                            16
-bsr_ic                           17
-ret                              18
-local_branch_p_i                 19
-local_branch_p_ic                20
-local_return_p                   21
-jsr_i                            22
-jsr_ic                           23
-jump_i                           24
-jump_ic                          25
-enternative                      26
-if_i_ic                          27
-if_n_ic                          28
-if_s_ic                          29
-if_p_ic                          30
-unless_i_ic                      31
-unless_n_ic                      32
-unless_s_ic                      33
-unless_p_ic                      34
-invokecc_p                       35
-invoke_p_p                       36
-yield                            37
-tailcall_p                       38
-returncc                         39
-capture_lex_p                    40
-newclosure_p_p                   41
-set_args_pc                      42
-get_results_pc                   43
-get_params_pc                    44
-set_returns_pc                   45
-result_info_p                    46
-set_addr_i_ic                    47
-set_addr_p_ic                    48
-set_addr_p_i                     49
-get_addr_i_p                     50
-schedule_p                       51
-addhandler_p                     52
-push_eh_ic                       53
-push_eh_p                        54
-pop_eh                           55
-throw_p                          56
-throw_p_p                        57
-rethrow_p                        58
-count_eh_i                       59
-die_s                            60
-die_sc                           61
-die_p                            62
-die_pc                           63
-die_i_i                          64
-die_ic_i                         65
-die_i_ic                         66
-die_ic_ic                        67
-exit_i                           68
-exit_ic                          69
-pushmark_i                       70
-pushmark_ic                      71
-popmark_i                        72
-popmark_ic                       73
-pushaction_p                     74
-debug_i                          75
-debug_ic                         76
-bounds_i                         77
-bounds_ic                        78
-profile_i                        79
-profile_ic                       80
-trace_i                          81
-trace_ic                         82
-gc_debug_i                       83
-gc_debug_ic                      84
-interpinfo_i_i                   85
-interpinfo_i_ic                  86
-interpinfo_p_i                   87
-interpinfo_p_ic                  88
-interpinfo_s_i                   89
-interpinfo_s_ic                  90
-warningson_i                     91
-warningson_ic                    92
-warningsoff_i                    93
-warningsoff_ic                   94
-errorson_i                       95
-errorson_ic                      96
-errorsoff_i                      97
-errorsoff_ic                     98
-runinterp_p_i                    99
-runinterp_p_ic                  100
-getinterp_p                     101
-sweep_ic                        102
-collect                         103
-sweepoff                        104
-sweepon                         105
-collectoff                      106
-collecton                       107
-needs_destroy_p                 108
-loadlib_p_s                     109
-loadlib_p_sc                    110
-dlfunc_p_p_s_s                  111
-dlfunc_p_p_sc_s                 112
-dlfunc_p_p_s_sc                 113
-dlfunc_p_p_sc_sc                114
-dlvar_p_p_s                     115
-dlvar_p_p_sc                    116
-compreg_s_p                     117
-compreg_sc_p                    118
-compreg_p_s                     119
-compreg_p_sc                    120
-new_callback_p_p_p_s            121
-new_callback_p_p_p_sc           122
-annotations_p                   123
-annotations_p_s                 124
-annotations_p_sc                125
-band_i_i                        126
-band_i_ic                       127
-band_p_i                        128
-band_p_ic                       129
-band_p_p                        130
-band_i_i_i                      131
-band_i_ic_i                     132
-band_i_i_ic                     133
-band_p_p_i                      134
-band_p_p_ic                     135
-band_p_p_p                      136
-bands_s_s                       137
-bands_s_sc                      138
-bands_p_s                       139
-bands_p_sc                      140
-bands_p_p                       141
-bands_s_s_s                     142
-bands_s_sc_s                    143
-bands_s_s_sc                    144
-bands_p_p_s                     145
-bands_p_p_sc                    146
-bands_p_p_p                     147
-bnot_i                          148
-bnot_i_i                        149
-bnot_p                          150
-bnot_p_p                        151
-bnots_s                         152
-bnots_s_s                       153
-bnots_s_sc                      154
-bnots_p                         155
-bnots_p_p                       156
-bor_i_i                         157
-bor_i_ic                        158
-bor_p_i                         159
-bor_p_ic                        160
-bor_p_p                         161
-bor_i_i_i                       162
-bor_i_ic_i                      163
-bor_i_i_ic                      164
-bor_p_p_i                       165
-bor_p_p_ic                      166
-bor_p_p_p                       167
-bors_s_s                        168
-bors_s_sc                       169
-bors_p_s                        170
-bors_p_sc                       171
-bors_p_p                        172
-bors_s_s_s                      173
-bors_s_sc_s                     174
-bors_s_s_sc                     175
-bors_p_p_s                      176
-bors_p_p_sc                     177
-bors_p_p_p                      178
-shl_i_i                         179
-shl_i_ic                        180
-shl_p_i                         181
-shl_p_ic                        182
-shl_p_p                         183
-shl_i_i_i                       184
-shl_i_ic_i                      185
-shl_i_i_ic                      186
-shl_p_p_i                       187
-shl_p_p_ic                      188
-shl_p_p_p                       189
-shr_i_i                         190
-shr_i_ic                        191
-shr_p_i                         192
-shr_p_ic                        193
-shr_p_p                         194
-shr_i_i_i                       195
-shr_i_ic_i                      196
-shr_i_i_ic                      197
-shr_p_p_i                       198
-shr_p_p_ic                      199
-shr_p_p_p                       200
-lsr_i_i                         201
-lsr_i_ic                        202
-lsr_p_i                         203
-lsr_p_ic                        204
-lsr_p_p                         205
-lsr_i_i_i                       206
-lsr_i_ic_i                      207
-lsr_i_i_ic                      208
-lsr_p_p_i                       209
-lsr_p_p_ic                      210
-lsr_p_p_p                       211
-rot_i_i_i_ic                    212
-rot_i_ic_i_ic                   213
-rot_i_i_ic_ic                   214
-bxor_i_i                        215
-bxor_i_ic                       216
-bxor_p_i                        217
-bxor_p_ic                       218
-bxor_p_p                        219
-bxor_i_i_i                      220
-bxor_i_ic_i                     221
-bxor_i_i_ic                     222
-bxor_p_p_i                      223
-bxor_p_p_ic                     224
-bxor_p_p_p                      225
-bxors_s_s                       226
-bxors_s_sc                      227
-bxors_p_s                       228
-bxors_p_sc                      229
-bxors_p_p                       230
-bxors_s_s_s                     231
-bxors_s_sc_s                    232
-bxors_s_s_sc                    233
-bxors_p_p_s                     234
-bxors_p_p_sc                    235
-bxors_p_p_p                     236
-eq_i_i_ic                       237
-eq_ic_i_ic                      238
-eq_i_ic_ic                      239
-eq_n_n_ic                       240
-eq_nc_n_ic                      241
-eq_n_nc_ic                      242
-eq_s_s_ic                       243
-eq_sc_s_ic                      244
-eq_s_sc_ic                      245
-eq_p_p_ic                       246
-eq_p_i_ic                       247
-eq_p_ic_ic                      248
-eq_p_n_ic                       249
-eq_p_nc_ic                      250
-eq_p_s_ic                       251
-eq_p_sc_ic                      252
-eq_str_p_p_ic                   253
-eq_num_p_p_ic                   254
-eq_addr_s_s_ic                  255
-eq_addr_sc_s_ic                 256
-eq_addr_s_sc_ic                 257
-eq_addr_sc_sc_ic                258
-eq_addr_p_p_ic                  259
-ne_i_i_ic                       260
-ne_ic_i_ic                      261
-ne_i_ic_ic                      262
-ne_n_n_ic                       263
-ne_nc_n_ic                      264
-ne_n_nc_ic                      265
-ne_s_s_ic                       266
-ne_sc_s_ic                      267
-ne_s_sc_ic                      268
-ne_p_p_ic                       269
-ne_p_i_ic                       270
-ne_p_ic_ic                      271
-ne_p_n_ic                       272
-ne_p_nc_ic                      273
-ne_p_s_ic                       274
-ne_p_sc_ic                      275
-ne_str_p_p_ic                   276
-ne_num_p_p_ic                   277
-ne_addr_s_s_ic                  278
-ne_addr_sc_s_ic                 279
-ne_addr_s_sc_ic                 280
-ne_addr_sc_sc_ic                281
-ne_addr_p_p_ic                  282
-lt_i_i_ic                       283
-lt_ic_i_ic                      284
-lt_i_ic_ic                      285
-lt_n_n_ic                       286
-lt_nc_n_ic                      287
-lt_n_nc_ic                      288
-lt_s_s_ic                       289
-lt_sc_s_ic                      290
-lt_s_sc_ic                      291
-lt_p_p_ic                       292
-lt_p_i_ic                       293
-lt_p_ic_ic                      294
-lt_p_n_ic                       295
-lt_p_nc_ic                      296
-lt_p_s_ic                       297
-lt_p_sc_ic                      298
-lt_str_p_p_ic                   299
-lt_num_p_p_ic                   300
-le_i_i_ic                       301
-le_ic_i_ic                      302
-le_i_ic_ic                      303
-le_n_n_ic                       304
-le_nc_n_ic                      305
-le_n_nc_ic                      306
-le_s_s_ic                       307
-le_sc_s_ic                      308
-le_s_sc_ic                      309
-le_p_p_ic                       310
-le_p_i_ic                       311
-le_p_ic_ic                      312
-le_p_n_ic                       313
-le_p_nc_ic                      314
-le_p_s_ic                       315
-le_p_sc_ic                      316
-le_str_p_p_ic                   317
-le_num_p_p_ic                   318
-gt_p_p_ic                       319
-gt_p_i_ic                       320
-gt_p_ic_ic                      321
-gt_p_n_ic                       322
-gt_p_nc_ic                      323
-gt_p_s_ic                       324
-gt_p_sc_ic                      325
-gt_str_p_p_ic                   326
-gt_num_p_p_ic                   327
-ge_p_p_ic                       328
-ge_p_i_ic                       329
-ge_p_ic_ic                      330
-ge_p_n_ic                       331
-ge_p_nc_ic                      332
-ge_p_s_ic                       333
-ge_p_sc_ic                      334
-ge_str_p_p_ic                   335
-ge_num_p_p_ic                   336
-if_null_p_ic                    337
-if_null_s_ic                    338
-unless_null_p_ic                339
-unless_null_s_ic                340
-cmp_i_i_i                       341
-cmp_i_ic_i                      342
-cmp_i_i_ic                      343
-cmp_i_n_n                       344
-cmp_i_nc_n                      345
-cmp_i_n_nc                      346
-cmp_i_s_s                       347
-cmp_i_sc_s                      348
-cmp_i_s_sc                      349
-cmp_i_p_p                       350
-cmp_i_p_i                       351
-cmp_i_p_ic                      352
-cmp_i_p_n                       353
-cmp_i_p_nc                      354
-cmp_i_p_s                       355
-cmp_i_p_sc                      356
-cmp_str_i_p_p                   357
-cmp_num_i_p_p                   358
-cmp_pmc_p_p_p                   359
-issame_i_p_p                    360
-issame_i_s_s                    361
-issame_i_sc_s                   362
-issame_i_s_sc                   363
-issame_i_sc_sc                  364
-isntsame_i_p_p                  365
-isntsame_i_s_s                  366
-isntsame_i_sc_s                 367
-isntsame_i_s_sc                 368
-isntsame_i_sc_sc                369
-istrue_i_p                      370
-isfalse_i_p                     371
-isnull_i_p                      372
-isnull_i_pc                     373
-isgt_i_p_p                      374
-isge_i_p_p                      375
-isle_i_i_i                      376
-isle_i_ic_i                     377
-isle_i_i_ic                     378
-isle_i_n_n                      379
-isle_i_nc_n                     380
-isle_i_n_nc                     381
-isle_i_s_s                      382
-isle_i_sc_s                     383
-isle_i_s_sc                     384
-isle_i_p_p                      385
-islt_i_i_i                      386
-islt_i_ic_i                     387
-islt_i_i_ic                     388
-islt_i_n_n                      389
-islt_i_nc_n                     390
-islt_i_n_nc                     391
-islt_i_s_s                      392
-islt_i_sc_s                     393
-islt_i_s_sc                     394
-islt_i_p_p                      395
-iseq_i_i_i                      396
-iseq_i_ic_i                     397
-iseq_i_i_ic                     398
-iseq_i_n_n                      399
-iseq_i_nc_n                     400
-iseq_i_n_nc                     401
-iseq_i_s_s                      402
-iseq_i_sc_s                     403
-iseq_i_s_sc                     404
-iseq_i_p_p                      405
-isne_i_i_i                      406
-isne_i_ic_i                     407
-isne_i_i_ic                     408
-isne_i_n_n                      409
-isne_i_nc_n                     410
-isne_i_n_nc                     411
-isne_i_s_s                      412
-isne_i_sc_s                     413
-isne_i_s_sc                     414
-isne_i_p_p                      415
-and_i_i_i                       416
-and_i_ic_i                      417
-and_i_i_ic                      418
-and_p_p_p                       419
-not_i                           420
-not_i_i                         421
-not_p                           422
-not_p_p                         423
-or_i_i_i                        424
-or_i_ic_i                       425
-or_i_i_ic                       426
-or_p_p_p                        427
-xor_i_i_i                       428
-xor_i_ic_i                      429
-xor_i_i_ic                      430
-xor_p_p_p                       431
-debug_init                      432
-debug_load_sc                   433
-debug_break                     434
-debug_print                     435
-backtrace                       436
-getline_i                       437
-getfile_s                       438
-close_p                         439
-fdopen_p_i_s                    440
-fdopen_p_ic_s                   441
-fdopen_p_i_sc                   442
-fdopen_p_ic_sc                  443
-getstdin_p                      444
-getstdout_p                     445
-getstderr_p                     446
-setstdin_p                      447
-setstdout_p                     448
-setstderr_p                     449
-open_p_s_s                      450
-open_p_sc_s                     451
-open_p_s_sc                     452
-open_p_sc_sc                    453
-open_p_s                        454
-open_p_sc                       455
-print_i                         456
-print_ic                        457
-print_n                         458
-print_nc                        459
-print_s                         460
-print_sc                        461
-print_p                         462
-say_i                           463
-say_ic                          464
-say_n                           465
-say_nc                          466
-say_s                           467
-say_sc                          468
-say_p                           469
-printerr_i                      470
-printerr_ic                     471
-printerr_n                      472
-printerr_nc                     473
-printerr_s                      474
-printerr_sc                     475
-printerr_p                      476
-print_p_i                       477
-print_p_ic                      478
-print_p_n                       479
-print_p_nc                      480
-print_p_s                       481
-print_p_sc                      482
-print_p_p                       483
-read_s_i                        484
-read_s_ic                       485
-read_s_p_i                      486
-read_s_p_ic                     487
-readline_s_p                    488
-peek_s                          489
-peek_s_p                        490
-stat_i_s_i                      491
-stat_i_sc_i                     492
-stat_i_s_ic                     493
-stat_i_sc_ic                    494
-stat_i_i_i                      495
-stat_i_ic_i                     496
-stat_i_i_ic                     497
-stat_i_ic_ic                    498
-seek_p_i_i                      499
-seek_p_ic_i                     500
-seek_p_i_ic                     501
-seek_p_ic_ic                    502
-seek_p_i_i_i                    503
-seek_p_ic_i_i                   504
-seek_p_i_ic_i                   505
-seek_p_ic_ic_i                  506
-seek_p_i_i_ic                   507
-seek_p_ic_i_ic                  508
-seek_p_i_ic_ic                  509
-seek_p_ic_ic_ic                 510
-tell_i_p                        511
-tell_i_i_p                      512
-abs_i                           513
-abs_n                           514
-abs_i_i                         515
-abs_n_n                         516
-abs_p                           517
-abs_p_p                         518
-add_i_i                         519
-add_i_ic                        520
-add_n_n                         521
-add_n_nc                        522
-add_p_p                         523
-add_p_i                         524
-add_p_ic                        525
-add_p_n                         526
-add_p_nc                        527
-add_i_i_i                       528
-add_i_ic_i                      529
-add_i_i_ic                      530
-add_n_n_n                       531
-add_n_nc_n                      532
-add_n_n_nc                      533
-add_p_p_p                       534
-add_p_p_i                       535
-add_p_p_ic                      536
-add_p_p_n                       537
-add_p_p_nc                      538
-cmod_i_i_i                      539
-cmod_i_ic_i                     540
-cmod_i_i_ic                     541
-cmod_p_p_i                      542
-cmod_p_p_ic                     543
-cmod_p_p_p                      544
-cmod_n_n_n                      545
-cmod_n_nc_n                     546
-cmod_n_n_nc                     547
-cmod_p_p_n                      548
-cmod_p_p_nc                     549
-dec_i                           550
-dec_n                           551
-dec_p                           552
-div_i_i                         553
-div_i_ic                        554
-div_n_n                         555
-div_n_nc                        556
-div_p_p                         557
-div_p_i                         558
-div_p_ic                        559
-div_p_n                         560
-div_p_nc                        561
-div_i_i_i                       562
-div_i_ic_i                      563
-div_i_i_ic                      564
-div_i_ic_ic                     565
-div_n_n_n                       566
-div_n_nc_n                      567
-div_n_n_nc                      568
-div_n_nc_nc                     569
-div_p_p_p                       570
-div_p_p_i                       571
-div_p_p_ic                      572
-div_p_p_n                       573
-div_p_p_nc                      574
-fdiv_i_i                        575
-fdiv_i_ic                       576
-fdiv_n_n                        577
-fdiv_n_nc                       578
-fdiv_p_p                        579
-fdiv_p_i                        580
-fdiv_p_ic                       581
-fdiv_p_n                        582
-fdiv_p_nc                       583
-fdiv_i_i_i                      584
-fdiv_i_ic_i                     585
-fdiv_i_i_ic                     586
-fdiv_n_n_n                      587
-fdiv_n_nc_n                     588
-fdiv_n_n_nc                     589
-fdiv_p_p_p                      590
-fdiv_p_p_i                      591
-fdiv_p_p_ic                     592
-fdiv_p_p_n                      593
-fdiv_p_p_nc                     594
-ceil_n                          595
-ceil_i_n                        596
-ceil_n_n                        597
-floor_n                         598
-floor_i_n                       599
-floor_n_n                       600
-inc_i                           601
-inc_n                           602
-inc_p                           603
-mod_i_i                         604
-mod_i_ic                        605
-mod_n_n                         606
-mod_n_nc                        607
-mod_p_p                         608
-mod_p_i                         609
-mod_p_ic                        610
-mod_p_n                         611
-mod_p_nc                        612
-mod_i_i_i                       613
-mod_i_ic_i                      614
-mod_i_i_ic                      615
-mod_n_n_n                       616
-mod_n_nc_n                      617
-mod_n_n_nc                      618
-mod_p_p_p                       619
-mod_p_p_i                       620
-mod_p_p_ic                      621
-mod_p_p_n                       622
-mod_p_p_nc                      623
-mul_i_i                         624
-mul_i_ic                        625
-mul_n_n                         626
-mul_n_nc                        627
-mul_p_p                         628
-mul_p_i                         629
-mul_p_ic                        630
-mul_p_n                         631
-mul_p_nc                        632
-mul_i_i_i                       633
-mul_i_ic_i                      634
-mul_i_i_ic                      635
-mul_n_n_n                       636
-mul_n_nc_n                      637
-mul_n_n_nc                      638
-mul_p_p_p                       639
-mul_p_p_i                       640
-mul_p_p_ic                      641
-mul_p_p_n                       642
-mul_p_p_nc                      643
-neg_i                           644
-neg_n                           645
-neg_p                           646
-neg_i_i                         647
-neg_n_n                         648
-neg_p_p                         649
-pow_n_n_n                       650
-pow_n_nc_n                      651
-pow_n_n_nc                      652
-pow_p_p_p                       653
-pow_p_p_i                       654
-pow_p_p_ic                      655
-pow_p_p_n                       656
-pow_p_p_nc                      657
-pow_n_n_i                       658
-pow_n_nc_i                      659
-pow_n_n_ic                      660
-pow_n_nc_ic                     661
-sub_i_i                         662
-sub_i_ic                        663
-sub_n_n                         664
-sub_n_nc                        665
-sub_p_p                         666
-sub_p_i                         667
-sub_p_ic                        668
-sub_p_n                         669
-sub_p_nc                        670
-sub_i_i_i                       671
-sub_i_ic_i                      672
-sub_i_i_ic                      673
-sub_n_n_n                       674
-sub_n_nc_n                      675
-sub_n_n_nc                      676
-sub_p_p_p                       677
-sub_p_p_i                       678
-sub_p_p_ic                      679
-sub_p_p_n                       680
-sub_p_p_nc                      681
-sqrt_n_n                        682
-acos_n_n                        683
-asec_n_n                        684
-asin_n_n                        685
-atan_n_n                        686
-atan_n_n_n                      687
-atan_n_nc_n                     688
-atan_n_n_nc                     689
-cos_n_n                         690
-cosh_n_n                        691
-exp_n_n                         692
-ln_n_n                          693
-log10_n_n                       694
-log2_n_n                        695
-sec_n_n                         696
-sech_n_n                        697
-sin_n_n                         698
-sinh_n_n                        699
-tan_n_n                         700
-tanh_n_n                        701
-gcd_i_i_i                       702
-gcd_i_ic_i                      703
-gcd_i_i_ic                      704
-lcm_i_i_i                       705
-lcm_i_ic_i                      706
-lcm_i_i_ic                      707
-fact_i_i                        708
-fact_n_i                        709
-callmethodcc_p_s                710
-callmethodcc_p_sc               711
-callmethodcc_p_p                712
-callmethod_p_s_p                713
-callmethod_p_sc_p               714
-callmethod_p_p_p                715
-tailcallmethod_p_s              716
-tailcallmethod_p_sc             717
-tailcallmethod_p_p              718
-addmethod_p_s_p                 719
-addmethod_p_sc_p                720
-can_i_p_s                       721
-can_i_p_sc                      722
-does_i_p_s                      723
-does_i_p_sc                     724
-does_i_p_p                      725
-does_i_p_pc                     726
-isa_i_p_s                       727
-isa_i_p_sc                      728
-isa_i_p_p                       729
-isa_i_p_pc                      730
-newclass_p_s                    731
-newclass_p_sc                   732
-newclass_p_p                    733
-newclass_p_pc                   734
-subclass_p_p                    735
-subclass_p_pc                   736
-subclass_p_p_s                  737
-subclass_p_pc_s                 738
-subclass_p_p_sc                 739
-subclass_p_pc_sc                740
-subclass_p_p_p                  741
-subclass_p_pc_p                 742
-subclass_p_p_pc                 743
-subclass_p_pc_pc                744
-subclass_p_s                    745
-subclass_p_sc                   746
-subclass_p_s_s                  747
-subclass_p_sc_s                 748
-subclass_p_s_sc                 749
-subclass_p_sc_sc                750
-subclass_p_s_p                  751
-subclass_p_sc_p                 752
-subclass_p_s_pc                 753
-subclass_p_sc_pc                754
-get_class_p_s                   755
-get_class_p_sc                  756
-get_class_p_p                   757
-get_class_p_pc                  758
-class_p_p                       759
-addparent_p_p                   760
-removeparent_p_p                761
-addrole_p_p                     762
-addattribute_p_s                763
-addattribute_p_sc               764
-removeattribute_p_s             765
-removeattribute_p_sc            766
-getattribute_p_p_s              767
-getattribute_p_p_sc             768
-getattribute_p_p_p_s            769
-getattribute_p_p_pc_s           770
-getattribute_p_p_p_sc           771
-getattribute_p_p_pc_sc          772
-setattribute_p_s_p              773
-setattribute_p_sc_p             774
-setattribute_p_p_s_p            775
-setattribute_p_pc_s_p           776
-setattribute_p_p_sc_p           777
-setattribute_p_pc_sc_p          778
-inspect_p_p                     779
-inspect_p_pc                    780
-inspect_p_p_s                   781
-inspect_p_pc_s                  782
-inspect_p_p_sc                  783
-inspect_p_pc_sc                 784
-pic_infix___ic_p_p              785
-pic_inline_sub___ic_p_p         786
-pic_get_params___pc             787
-pic_set_returns___pc            788
-pic_callr___pc                  789
-new_p_s                         790
-new_p_sc                        791
-new_p_s_p                       792
-new_p_sc_p                      793
-new_p_s_pc                      794
-new_p_sc_pc                     795
-new_p_p                         796
-new_p_pc                        797
-new_p_p_p                       798
-new_p_pc_p                      799
-new_p_p_pc                      800
-new_p_pc_pc                     801
-root_new_p_p                    802
-root_new_p_pc                   803
-root_new_p_p_p                  804
-root_new_p_pc_p                 805
-root_new_p_p_pc                 806
-root_new_p_pc_pc                807
-typeof_s_p                      808
-typeof_p_p                      809
-get_repr_s_p                    810
-find_method_p_p_s               811
-find_method_p_p_sc              812
-defined_i_p                     813
-defined_i_p_ki                  814
-defined_i_p_kic                 815
-defined_i_p_k                   816
-defined_i_p_kc                  817
-exists_i_p_ki                   818
-exists_i_p_kic                  819
-exists_i_p_k                    820
-exists_i_p_kc                   821
-delete_p_k                      822
-delete_p_kc                     823
-delete_p_ki                     824
-delete_p_kic                    825
-elements_i_p                    826
-push_p_i                        827
-push_p_ic                       828
-push_p_n                        829
-push_p_nc                       830
-push_p_s                        831
-push_p_sc                       832
-push_p_p                        833
-pop_i_p                         834
-pop_n_p                         835
-pop_s_p                         836
-pop_p_p                         837
-unshift_p_i                     838
-unshift_p_ic                    839
-unshift_p_n                     840
-unshift_p_nc                    841
-unshift_p_s                     842
-unshift_p_sc                    843
-unshift_p_p                     844
-shift_i_p                       845
-shift_n_p                       846
-shift_s_p                       847
-shift_p_p                       848
-splice_p_p_i_i                  849
-splice_p_p_ic_i                 850
-splice_p_p_i_ic                 851
-splice_p_p_ic_ic                852
-setprop_p_s_p                   853
-setprop_p_sc_p                  854
-getprop_p_s_p                   855
-getprop_p_sc_p                  856
-delprop_p_s                     857
-delprop_p_sc                    858
-prophash_p_p                    859
-freeze_s_p                      860
-thaw_p_s                        861
-thaw_p_sc                       862
-add_multi_s_s_p                 863
-add_multi_sc_s_p                864
-add_multi_s_sc_p                865
-add_multi_sc_sc_p               866
-find_multi_p_s_s                867
-find_multi_p_sc_s               868
-find_multi_p_s_sc               869
-find_multi_p_sc_sc              870
-register_p                      871
-unregister_p                    872
-box_p_i                         873
-box_p_ic                        874
-box_p_n                         875
-box_p_nc                        876
-box_p_s                         877
-box_p_sc                        878
-iter_p_p                        879
-morph_p_p                       880
-morph_p_pc                      881
-clone_s_s                       882
-clone_s_sc                      883
-exchange_i_i                    884
-exchange_p_p                    885
-exchange_n_n                    886
-exchange_s_s                    887
-set_i_i                         888
-set_i_ic                        889
-set_i_n                         890
-set_i_nc                        891
-set_i_s                         892
-set_i_sc                        893
-set_n_n                         894
-set_n_nc                        895
-set_n_i                         896
-set_n_ic                        897
-set_n_s                         898
-set_n_sc                        899
-set_n_p                         900
-set_s_p                         901
-set_s_s                         902
-set_s_sc                        903
-set_s_i                         904
-set_s_ic                        905
-set_s_n                         906
-set_s_nc                        907
-set_p_pc                        908
-set_p_p                         909
-set_p_i                         910
-set_p_ic                        911
-set_p_n                         912
-set_p_nc                        913
-set_p_s                         914
-set_p_sc                        915
-set_i_p                         916
-assign_p_p                      917
-assign_p_i                      918
-assign_p_ic                     919
-assign_p_n                      920
-assign_p_nc                     921
-assign_p_s                      922
-assign_p_sc                     923
-assign_s_s                      924
-assign_s_sc                     925
-setref_p_p                      926
-deref_p_p                       927
-setp_ind_i_p                    928
-setp_ind_ic_p                   929
-setn_ind_i_n                    930
-setn_ind_ic_n                   931
-setn_ind_i_nc                   932
-setn_ind_ic_nc                  933
-sets_ind_i_s                    934
-sets_ind_ic_s                   935
-sets_ind_i_sc                   936
-sets_ind_ic_sc                  937
-seti_ind_i_i                    938
-seti_ind_ic_i                   939
-seti_ind_i_ic                   940
-seti_ind_ic_ic                  941
-set_p_ki_i                      942
-set_p_kic_i                     943
-set_p_ki_ic                     944
-set_p_kic_ic                    945
-set_p_ki_n                      946
-set_p_kic_n                     947
-set_p_ki_nc                     948
-set_p_kic_nc                    949
-set_p_ki_s                      950
-set_p_kic_s                     951
-set_p_ki_sc                     952
-set_p_kic_sc                    953
-set_p_ki_p                      954
-set_p_kic_p                     955
-set_i_p_ki                      956
-set_i_p_kic                     957
-set_n_p_ki                      958
-set_n_p_kic                     959
-set_s_p_ki                      960
-set_s_p_kic                     961
-set_p_p_ki                      962
-set_p_p_kic                     963
-set_p_k_i                       964
-set_p_kc_i                      965
-set_p_k_ic                      966
-set_p_kc_ic                     967
-set_p_k_n                       968
-set_p_kc_n                      969
-set_p_k_nc                      970
-set_p_kc_nc                     971
-set_p_k_s                       972
-set_p_kc_s                      973
-set_p_k_sc                      974
-set_p_kc_sc                     975
-set_p_k_p                       976
-set_p_kc_p                      977
-set_i_p_k                       978
-set_i_p_kc                      979
-set_n_p_k                       980
-set_n_p_kc                      981
-set_s_p_k                       982
-set_s_p_kc                      983
-set_p_p_k                       984
-set_p_p_kc                      985
-clone_p_p                       986
-clone_p_p_p                     987
-clone_p_p_pc                    988
-copy_p_p                        989
-null_s                          990
-null_i                          991
-null_p                          992
-null_n                          993
-cleari                          994
-clearn                          995
-clears                          996
-clearp                          997
-ord_i_s                         998
-ord_i_sc                        999
-ord_i_s_i                      1000
-ord_i_sc_i                     1001
-ord_i_s_ic                     1002
-ord_i_sc_ic                    1003
-chr_s_i                        1004
-chr_s_ic                       1005
-chopn_s_i                      1006
-chopn_s_ic                     1007
-chopn_s_s_i                    1008
-chopn_s_sc_i                   1009
-chopn_s_s_ic                   1010
-chopn_s_sc_ic                  1011
-concat_s_s                     1012
-concat_s_sc                    1013
-concat_p_p                     1014
-concat_p_s                     1015
-concat_p_sc                    1016
-concat_s_s_s                   1017
-concat_s_sc_s                  1018
-concat_s_s_sc                  1019
-concat_p_p_s                   1020
-concat_p_p_sc                  1021
-concat_p_p_p                   1022
-repeat_s_s_i                   1023
-repeat_s_sc_i                  1024
-repeat_s_s_ic                  1025
-repeat_s_sc_ic                 1026
-repeat_p_p_i                   1027
-repeat_p_p_ic                  1028
-repeat_p_p_p                   1029
-repeat_p_i                     1030
-repeat_p_ic                    1031
-repeat_p_p                     1032
-length_i_s                     1033
-length_i_sc                    1034
-bytelength_i_s                 1035
-bytelength_i_sc                1036
-pin_s                          1037
-unpin_s                        1038
-substr_s_s_i                   1039
-substr_s_sc_i                  1040
-substr_s_s_ic                  1041
-substr_s_sc_ic                 1042
-substr_s_s_i_i                 1043
-substr_s_sc_i_i                1044
-substr_s_s_ic_i                1045
-substr_s_sc_ic_i               1046
-substr_s_s_i_ic                1047
-substr_s_sc_i_ic               1048
-substr_s_s_ic_ic               1049
-substr_s_sc_ic_ic              1050
-substr_s_s_i_i_s               1051
-substr_s_s_ic_i_s              1052
-substr_s_s_i_ic_s              1053
-substr_s_s_ic_ic_s             1054
-substr_s_s_i_i_sc              1055
-substr_s_s_ic_i_sc             1056
-substr_s_s_i_ic_sc             1057
-substr_s_s_ic_ic_sc            1058
-substr_s_i_i_s                 1059
-substr_s_ic_i_s                1060
-substr_s_i_ic_s                1061
-substr_s_ic_ic_s               1062
-substr_s_i_i_sc                1063
-substr_s_ic_i_sc               1064
-substr_s_i_ic_sc               1065
-substr_s_ic_ic_sc              1066
-substr_s_p_i_i                 1067
-substr_s_p_ic_i                1068
-substr_s_p_i_ic                1069
-substr_s_p_ic_ic               1070
-index_i_s_s                    1071
-index_i_sc_s                   1072
-index_i_s_sc                   1073
-index_i_sc_sc                  1074
-index_i_s_s_i                  1075
-index_i_sc_s_i                 1076
-index_i_s_sc_i                 1077
-index_i_sc_sc_i                1078
-index_i_s_s_ic                 1079
-index_i_sc_s_ic                1080
-index_i_s_sc_ic                1081
-index_i_sc_sc_ic               1082
-sprintf_s_s_p                  1083
-sprintf_s_sc_p                 1084
-sprintf_p_p_p                  1085
-new_s                          1086
-new_s_i                        1087
-new_s_ic                       1088
-stringinfo_i_s_i               1089
-stringinfo_i_sc_i              1090
-stringinfo_i_s_ic              1091
-stringinfo_i_sc_ic             1092
-upcase_s_s                     1093
-upcase_s_sc                    1094
-upcase_s                       1095
-downcase_s_s                   1096
-downcase_s_sc                  1097
-downcase_s                     1098
-titlecase_s_s                  1099
-titlecase_s_sc                 1100
-titlecase_s                    1101
-join_s_s_p                     1102
-join_s_sc_p                    1103
-split_p_s_s                    1104
-split_p_sc_s                   1105
-split_p_s_sc                   1106
-split_p_sc_sc                  1107
-charset_i_s                    1108
-charset_i_sc                   1109
-charsetname_s_i                1110
-charsetname_s_ic               1111
-find_charset_i_s               1112
-find_charset_i_sc              1113
-trans_charset_s_i              1114
-trans_charset_s_ic             1115
-trans_charset_s_s_i            1116
-trans_charset_s_sc_i           1117
-trans_charset_s_s_ic           1118
-trans_charset_s_sc_ic          1119
-encoding_i_s                   1120
-encoding_i_sc                  1121
-encodingname_s_i               1122
-encodingname_s_ic              1123
-find_encoding_i_s              1124
-find_encoding_i_sc             1125
-trans_encoding_s_i             1126
-trans_encoding_s_ic            1127
-trans_encoding_s_s_i           1128
-trans_encoding_s_sc_i          1129
-trans_encoding_s_s_ic          1130
-trans_encoding_s_sc_ic         1131
-is_cclass_i_i_s_i              1132
-is_cclass_i_ic_s_i             1133
-is_cclass_i_i_sc_i             1134
-is_cclass_i_ic_sc_i            1135
-is_cclass_i_i_s_ic             1136
-is_cclass_i_ic_s_ic            1137
-is_cclass_i_i_sc_ic            1138
-is_cclass_i_ic_sc_ic           1139
-find_cclass_i_i_s_i_i          1140
-find_cclass_i_ic_s_i_i         1141
-find_cclass_i_i_sc_i_i         1142
-find_cclass_i_ic_sc_i_i        1143
-find_cclass_i_i_s_ic_i         1144
-find_cclass_i_ic_s_ic_i        1145
-find_cclass_i_i_sc_ic_i        1146
-find_cclass_i_ic_sc_ic_i       1147
-find_cclass_i_i_s_i_ic         1148
-find_cclass_i_ic_s_i_ic        1149
-find_cclass_i_i_sc_i_ic        1150
-find_cclass_i_ic_sc_i_ic       1151
-find_cclass_i_i_s_ic_ic        1152
-find_cclass_i_ic_s_ic_ic       1153
-find_cclass_i_i_sc_ic_ic       1154
-find_cclass_i_ic_sc_ic_ic      1155
-find_not_cclass_i_i_s_i_i      1156
-find_not_cclass_i_ic_s_i_i     1157
-find_not_cclass_i_i_sc_i_i     1158
-find_not_cclass_i_ic_sc_i_i    1159
-find_not_cclass_i_i_s_ic_i     1160
-find_not_cclass_i_ic_s_ic_i    1161
-find_not_cclass_i_i_sc_ic_i    1162
-find_not_cclass_i_ic_sc_ic_i   1163
-find_not_cclass_i_i_s_i_ic     1164
-find_not_cclass_i_ic_s_i_ic    1165
-find_not_cclass_i_i_sc_i_ic    1166
-find_not_cclass_i_ic_sc_i_ic   1167
-find_not_cclass_i_i_s_ic_ic    1168
-find_not_cclass_i_ic_s_ic_ic   1169
-find_not_cclass_i_i_sc_ic_ic   1170
-find_not_cclass_i_ic_sc_ic_ic  1171
-escape_s_s                     1172
-compose_s_s                    1173
-compose_s_sc                   1174
-spawnw_i_s                     1175
-spawnw_i_sc                    1176
-spawnw_i_p                     1177
-err_i                          1178
-err_s                          1179
-err_s_i                        1180
-err_s_ic                       1181
-time_i                         1182
-time_n                         1183
-gmtime_s_i                     1184
-gmtime_s_ic                    1185
-localtime_s_i                  1186
-localtime_s_ic                 1187
-decodetime_p_i                 1188
-decodetime_p_ic                1189
-decodelocaltime_p_i            1190
-decodelocaltime_p_ic           1191
-sysinfo_s_i                    1192
-sysinfo_s_ic                   1193
-sysinfo_i_i                    1194
-sysinfo_i_ic                   1195
-sleep_i                        1196
-sleep_ic                       1197
-sleep_n                        1198
-sleep_nc                       1199
-sizeof_i_i                     1200
-sizeof_i_ic                    1201
-store_lex_s_p                  1202
-store_lex_sc_p                 1203
-find_lex_p_s                   1204
-find_lex_p_sc                  1205
-find_caller_lex_p_s            1206
-find_caller_lex_p_sc           1207
-get_namespace_p                1208
-get_namespace_p_p              1209
-get_namespace_p_pc             1210
-get_hll_namespace_p            1211
-get_hll_namespace_p_p          1212
-get_hll_namespace_p_pc         1213
-get_root_namespace_p           1214
-get_root_namespace_p_p         1215
-get_root_namespace_p_pc        1216
-get_global_p_s                 1217
-get_global_p_sc                1218
-get_global_p_p_s               1219
-get_global_p_pc_s              1220
-get_global_p_p_sc              1221
-get_global_p_pc_sc             1222
-get_hll_global_p_s             1223
-get_hll_global_p_sc            1224
-get_hll_global_p_p_s           1225
-get_hll_global_p_pc_s          1226
-get_hll_global_p_p_sc          1227
-get_hll_global_p_pc_sc         1228
-get_root_global_p_s            1229
-get_root_global_p_sc           1230
-get_root_global_p_p_s          1231
-get_root_global_p_pc_s         1232
-get_root_global_p_p_sc         1233
-get_root_global_p_pc_sc        1234
-set_global_s_p                 1235
-set_global_sc_p                1236
-set_global_p_s_p               1237
-set_global_pc_s_p              1238
-set_global_p_sc_p              1239
-set_global_pc_sc_p             1240
-set_hll_global_s_p             1241
-set_hll_global_sc_p            1242
-set_hll_global_p_s_p           1243
-set_hll_global_pc_s_p          1244
-set_hll_global_p_sc_p          1245
-set_hll_global_pc_sc_p         1246
-set_root_global_s_p            1247
-set_root_global_sc_p           1248
-set_root_global_p_s_p          1249
-set_root_global_pc_s_p         1250
-set_root_global_p_sc_p         1251
-set_root_global_pc_sc_p        1252
-find_name_p_s                  1253
-find_name_p_sc                 1254
-find_sub_not_null_p_s          1255
-find_sub_not_null_p_sc         1256
-isnull_i_s                     1257
-isnull_i_sc                    1258
+local_branch_p_i                 14
+local_branch_p_ic                15
+local_return_p                   16
+jump_i                           17
+jump_ic                          18
+enternative                      19
+if_i_ic                          20
+if_n_ic                          21
+if_s_ic                          22
+if_p_ic                          23
+unless_i_ic                      24
+unless_n_ic                      25
+unless_s_ic                      26
+unless_p_ic                      27
+invokecc_p                       28
+invoke_p_p                       29
+yield                            30
+tailcall_p                       31
+returncc                         32
+capture_lex_p                    33
+newclosure_p_p                   34
+set_args_pc                      35
+get_results_pc                   36
+get_params_pc                    37
+set_returns_pc                   38
+result_info_p                    39
+set_addr_i_ic                    40
+set_addr_p_ic                    41
+set_addr_p_i                     42
+get_addr_i_p                     43
+schedule_p                       44
+addhandler_p                     45
+push_eh_ic                       46
+push_eh_p                        47
+pop_eh                           48
+throw_p                          49
+throw_p_p                        50
+rethrow_p                        51
+count_eh_i                       52
+die_s                            53
+die_sc                           54
+die_p                            55
+die_pc                           56
+die_i_i                          57
+die_ic_i                         58
+die_i_ic                         59
+die_ic_ic                        60
+exit_i                           61
+exit_ic                          62
+pushmark_i                       63
+pushmark_ic                      64
+popmark_i                        65
+popmark_ic                       66
+pushaction_p                     67
+debug_i                          68
+debug_ic                         69
+bounds_i                         70
+bounds_ic                        71
+profile_i                        72
+profile_ic                       73
+trace_i                          74
+trace_ic                         75
+gc_debug_i                       76
+gc_debug_ic                      77
+interpinfo_i_i                   78
+interpinfo_i_ic                  79
+interpinfo_p_i                   80
+interpinfo_p_ic                  81
+interpinfo_s_i                   82
+interpinfo_s_ic                  83
+warningson_i                     84
+warningson_ic                    85
+warningsoff_i                    86
+warningsoff_ic                   87
+errorson_i                       88
+errorson_ic                      89
+errorsoff_i                      90
+errorsoff_ic                     91
+runinterp_p_i                    92
+runinterp_p_ic                   93
+getinterp_p                      94
+sweep_ic                         95
+collect                          96
+sweepoff                         97
+sweepon                          98
+collectoff                       99
+collecton                       100
+needs_destroy_p                 101
+loadlib_p_s                     102
+loadlib_p_sc                    103
+dlfunc_p_p_s_s                  104
+dlfunc_p_p_sc_s                 105
+dlfunc_p_p_s_sc                 106
+dlfunc_p_p_sc_sc                107
+dlvar_p_p_s                     108
+dlvar_p_p_sc                    109
+compreg_s_p                     110
+compreg_sc_p                    111
+compreg_p_s                     112
+compreg_p_sc                    113
+new_callback_p_p_p_s            114
+new_callback_p_p_p_sc           115
+annotations_p                   116
+annotations_p_s                 117
+annotations_p_sc                118
+band_i_i                        119
+band_i_ic                       120
+band_p_i                        121
+band_p_ic                       122
+band_p_p                        123
+band_i_i_i                      124
+band_i_ic_i                     125
+band_i_i_ic                     126
+band_p_p_i                      127
+band_p_p_ic                     128
+band_p_p_p                      129
+bands_s_s                       130
+bands_s_sc                      131
+bands_p_s                       132
+bands_p_sc                      133
+bands_p_p                       134
+bands_s_s_s                     135
+bands_s_sc_s                    136
+bands_s_s_sc                    137
+bands_p_p_s                     138
+bands_p_p_sc                    139
+bands_p_p_p                     140
+bnot_i                          141
+bnot_i_i                        142
+bnot_p                          143
+bnot_p_p                        144
+bnots_s                         145
+bnots_s_s                       146
+bnots_s_sc                      147
+bnots_p                         148
+bnots_p_p                       149
+bor_i_i                         150
+bor_i_ic                        151
+bor_p_i                         152
+bor_p_ic                        153
+bor_p_p                         154
+bor_i_i_i                       155
+bor_i_ic_i                      156
+bor_i_i_ic                      157
+bor_p_p_i                       158
+bor_p_p_ic                      159
+bor_p_p_p                       160
+bors_s_s                        161
+bors_s_sc                       162
+bors_p_s                        163
+bors_p_sc                       164
+bors_p_p                        165
+bors_s_s_s                      166
+bors_s_sc_s                     167
+bors_s_s_sc                     168
+bors_p_p_s                      169
+bors_p_p_sc                     170
+bors_p_p_p                      171
+shl_i_i                         172
+shl_i_ic                        173
+shl_p_i                         174
+shl_p_ic                        175
+shl_p_p                         176
+shl_i_i_i                       177
+shl_i_ic_i                      178
+shl_i_i_ic                      179
+shl_p_p_i                       180
+shl_p_p_ic                      181
+shl_p_p_p                       182
+shr_i_i                         183
+shr_i_ic                        184
+shr_p_i                         185
+shr_p_ic                        186
+shr_p_p                         187
+shr_i_i_i                       188
+shr_i_ic_i                      189
+shr_i_i_ic                      190
+shr_p_p_i                       191
+shr_p_p_ic                      192
+shr_p_p_p                       193
+lsr_i_i                         194
+lsr_i_ic                        195
+lsr_p_i                         196
+lsr_p_ic                        197
+lsr_p_p                         198
+lsr_i_i_i                       199
+lsr_i_ic_i                      200
+lsr_i_i_ic                      201
+lsr_p_p_i                       202
+lsr_p_p_ic                      203
+lsr_p_p_p                       204
+rot_i_i_i_ic                    205
+rot_i_ic_i_ic                   206
+rot_i_i_ic_ic                   207
+bxor_i_i                        208
+bxor_i_ic                       209
+bxor_p_i                        210
+bxor_p_ic                       211
+bxor_p_p                        212
+bxor_i_i_i                      213
+bxor_i_ic_i                     214
+bxor_i_i_ic                     215
+bxor_p_p_i                      216
+bxor_p_p_ic                     217
+bxor_p_p_p                      218
+bxors_s_s                       219
+bxors_s_sc                      220
+bxors_p_s                       221
+bxors_p_sc                      222
+bxors_p_p                       223
+bxors_s_s_s                     224
+bxors_s_sc_s                    225
+bxors_s_s_sc                    226
+bxors_p_p_s                     227
+bxors_p_p_sc                    228
+bxors_p_p_p                     229
+eq_i_i_ic                       230
+eq_ic_i_ic                      231
+eq_i_ic_ic                      232
+eq_n_n_ic                       233
+eq_nc_n_ic                      234
+eq_n_nc_ic                      235
+eq_s_s_ic                       236
+eq_sc_s_ic                      237
+eq_s_sc_ic                      238
+eq_p_p_ic                       239
+eq_p_i_ic                       240
+eq_p_ic_ic                      241
+eq_p_n_ic                       242
+eq_p_nc_ic                      243
+eq_p_s_ic                       244
+eq_p_sc_ic                      245
+eq_str_p_p_ic                   246
+eq_num_p_p_ic                   247
+eq_addr_s_s_ic                  248
+eq_addr_sc_s_ic                 249
+eq_addr_s_sc_ic                 250
+eq_addr_sc_sc_ic                251
+eq_addr_p_p_ic                  252
+ne_i_i_ic                       253
+ne_ic_i_ic                      254
+ne_i_ic_ic                      255
+ne_n_n_ic                       256
+ne_nc_n_ic                      257
+ne_n_nc_ic                      258
+ne_s_s_ic                       259
+ne_sc_s_ic                      260
+ne_s_sc_ic                      261
+ne_p_p_ic                       262
+ne_p_i_ic                       263
+ne_p_ic_ic                      264
+ne_p_n_ic                       265
+ne_p_nc_ic                      266
+ne_p_s_ic                       267
+ne_p_sc_ic                      268
+ne_str_p_p_ic                   269
+ne_num_p_p_ic                   270
+ne_addr_s_s_ic                  271
+ne_addr_sc_s_ic                 272
+ne_addr_s_sc_ic                 273
+ne_addr_sc_sc_ic                274
+ne_addr_p_p_ic                  275
+lt_i_i_ic                       276
+lt_ic_i_ic                      277
+lt_i_ic_ic                      278
+lt_n_n_ic                       279
+lt_nc_n_ic                      280
+lt_n_nc_ic                      281
+lt_s_s_ic                       282
+lt_sc_s_ic                      283
+lt_s_sc_ic                      284
+lt_p_p_ic                       285
+lt_p_i_ic                       286
+lt_p_ic_ic                      287
+lt_p_n_ic                       288
+lt_p_nc_ic                      289
+lt_p_s_ic                       290
+lt_p_sc_ic                      291
+lt_str_p_p_ic                   292
+lt_num_p_p_ic                   293
+le_i_i_ic                       294
+le_ic_i_ic                      295
+le_i_ic_ic                      296
+le_n_n_ic                       297
+le_nc_n_ic                      298
+le_n_nc_ic                      299
+le_s_s_ic                       300
+le_sc_s_ic                      301
+le_s_sc_ic                      302
+le_p_p_ic                       303
+le_p_i_ic                       304
+le_p_ic_ic                      305
+le_p_n_ic                       306
+le_p_nc_ic                      307
+le_p_s_ic                       308
+le_p_sc_ic                      309
+le_str_p_p_ic                   310
+le_num_p_p_ic                   311
+gt_p_p_ic                       312
+gt_p_i_ic                       313
+gt_p_ic_ic                      314
+gt_p_n_ic                       315
+gt_p_nc_ic                      316
+gt_p_s_ic                       317
+gt_p_sc_ic                      318
+gt_str_p_p_ic                   319
+gt_num_p_p_ic                   320
+ge_p_p_ic                       321
+ge_p_i_ic                       322
+ge_p_ic_ic                      323
+ge_p_n_ic                       324
+ge_p_nc_ic                      325
+ge_p_s_ic                       326
+ge_p_sc_ic                      327
+ge_str_p_p_ic                   328
+ge_num_p_p_ic                   329
+if_null_p_ic                    330
+if_null_s_ic                    331
+unless_null_p_ic                332
+unless_null_s_ic                333
+cmp_i_i_i                       334
+cmp_i_ic_i                      335
+cmp_i_i_ic                      336
+cmp_i_n_n                       337
+cmp_i_nc_n                      338
+cmp_i_n_nc                      339
+cmp_i_s_s                       340
+cmp_i_sc_s                      341
+cmp_i_s_sc                      342
+cmp_i_p_p                       343
+cmp_i_p_i                       344
+cmp_i_p_ic                      345
+cmp_i_p_n                       346
+cmp_i_p_nc                      347
+cmp_i_p_s                       348
+cmp_i_p_sc                      349
+cmp_str_i_p_p                   350
+cmp_num_i_p_p                   351
+cmp_pmc_p_p_p                   352
+issame_i_p_p                    353
+issame_i_s_s                    354
+issame_i_sc_s                   355
+issame_i_s_sc                   356
+issame_i_sc_sc                  357
+isntsame_i_p_p                  358
+isntsame_i_s_s                  359
+isntsame_i_sc_s                 360
+isntsame_i_s_sc                 361
+isntsame_i_sc_sc                362
+istrue_i_p                      363
+isfalse_i_p                     364
+isnull_i_p                      365
+isnull_i_pc                     366
+isnull_i_s                      367
+isnull_i_sc                     368
+isgt_i_p_p                      369
+isge_i_p_p                      370
+isle_i_i_i                      371
+isle_i_ic_i                     372
+isle_i_i_ic                     373
+isle_i_n_n                      374
+isle_i_nc_n                     375
+isle_i_n_nc                     376
+isle_i_s_s                      377
+isle_i_sc_s                     378
+isle_i_s_sc                     379
+isle_i_p_p                      380
+islt_i_i_i                      381
+islt_i_ic_i                     382
+islt_i_i_ic                     383
+islt_i_n_n                      384
+islt_i_nc_n                     385
+islt_i_n_nc                     386
+islt_i_s_s                      387
+islt_i_sc_s                     388
+islt_i_s_sc                     389
+islt_i_p_p                      390
+iseq_i_i_i                      391
+iseq_i_ic_i                     392
+iseq_i_i_ic                     393
+iseq_i_n_n                      394
+iseq_i_nc_n                     395
+iseq_i_n_nc                     396
+iseq_i_s_s                      397
+iseq_i_sc_s                     398
+iseq_i_s_sc                     399
+iseq_i_p_p                      400
+isne_i_i_i                      401
+isne_i_ic_i                     402
+isne_i_i_ic                     403
+isne_i_n_n                      404
+isne_i_nc_n                     405
+isne_i_n_nc                     406
+isne_i_s_s                      407
+isne_i_sc_s                     408
+isne_i_s_sc                     409
+isne_i_p_p                      410
+and_i_i_i                       411
+and_i_ic_i                      412
+and_i_i_ic                      413
+and_p_p_p                       414
+not_i                           415
+not_i_i                         416
+not_p                           417
+not_p_p                         418
+or_i_i_i                        419
+or_i_ic_i                       420
+or_i_i_ic                       421
+or_p_p_p                        422
+xor_i_i_i                       423
+xor_i_ic_i                      424
+xor_i_i_ic                      425
+xor_p_p_p                       426
+debug_init                      427
+debug_load_sc                   428
+debug_break                     429
+debug_print                     430
+backtrace                       431
+getline_i                       432
+getfile_s                       433
+set_label_p_ic                  434
+get_label_i_p                   435
+close_p                         436
+fdopen_p_i_s                    437
+fdopen_p_ic_s                   438
+fdopen_p_i_sc                   439
+fdopen_p_ic_sc                  440
+getstdin_p                      441
+getstdout_p                     442
+getstderr_p                     443
+setstdin_p                      444
+setstdout_p                     445
+setstderr_p                     446
+open_p_s_s                      447
+open_p_sc_s                     448
+open_p_s_sc                     449
+open_p_sc_sc                    450
+open_p_s                        451
+open_p_sc                       452
+print_i                         453
+print_ic                        454
+print_n                         455
+print_nc                        456
+print_s                         457
+print_sc                        458
+print_p                         459
+say_i                           460
+say_ic                          461
+say_n                           462
+say_nc                          463
+say_s                           464
+say_sc                          465
+say_p                           466
+printerr_i                      467
+printerr_ic                     468
+printerr_n                      469
+printerr_nc                     470
+printerr_s                      471
+printerr_sc                     472
+printerr_p                      473
+print_p_i                       474
+print_p_ic                      475
+print_p_n                       476
+print_p_nc                      477
+print_p_s                       478
+print_p_sc                      479
+print_p_p                       480
+read_s_i                        481
+read_s_ic                       482
+read_s_p_i                      483
+read_s_p_ic                     484
+readline_s_p                    485
+peek_s                          486
+peek_s_p                        487
+stat_i_s_i                      488
+stat_i_sc_i                     489
+stat_i_s_ic                     490
+stat_i_sc_ic                    491
+stat_i_i_i                      492
+stat_i_ic_i                     493
+stat_i_i_ic                     494
+stat_i_ic_ic                    495
+seek_p_i_i                      496
+seek_p_ic_i                     497
+seek_p_i_ic                     498
+seek_p_ic_ic                    499
+seek_p_i_i_i                    500
+seek_p_ic_i_i                   501
+seek_p_i_ic_i                   502
+seek_p_ic_ic_i                  503
+seek_p_i_i_ic                   504
+seek_p_ic_i_ic                  505
+seek_p_i_ic_ic                  506
+seek_p_ic_ic_ic                 507
+tell_i_p                        508
+tell_i_i_p                      509
+abs_i                           510
+abs_n                           511
+abs_i_i                         512
+abs_n_n                         513
+abs_p                           514
+abs_p_p                         515
+add_i_i                         516
+add_i_ic                        517
+add_n_n                         518
+add_n_nc                        519
+add_p_p                         520
+add_p_i                         521
+add_p_ic                        522
+add_p_n                         523
+add_p_nc                        524
+add_i_i_i                       525
+add_i_ic_i                      526
+add_i_i_ic                      527
+add_n_n_n                       528
+add_n_nc_n                      529
+add_n_n_nc                      530
+add_p_p_p                       531
+add_p_p_i                       532
+add_p_p_ic                      533
+add_p_p_n                       534
+add_p_p_nc                      535
+cmod_i_i_i                      536
+cmod_i_ic_i                     537
+cmod_i_i_ic                     538
+cmod_p_p_i                      539
+cmod_p_p_ic                     540
+cmod_p_p_p                      541
+cmod_n_n_n                      542
+cmod_n_nc_n                     543
+cmod_n_n_nc                     544
+cmod_p_p_n                      545
+cmod_p_p_nc                     546
+dec_i                           547
+dec_n                           548
+dec_p                           549
+div_i_i                         550
+div_i_ic                        551
+div_n_n                         552
+div_n_nc                        553
+div_p_p                         554
+div_p_i                         555
+div_p_ic                        556
+div_p_n                         557
+div_p_nc                        558
+div_i_i_i                       559
+div_i_ic_i                      560
+div_i_i_ic                      561
+div_i_ic_ic                     562
+div_n_n_n                       563
+div_n_nc_n                      564
+div_n_n_nc                      565
+div_n_nc_nc                     566
+div_p_p_p                       567
+div_p_p_i                       568
+div_p_p_ic                      569
+div_p_p_n                       570
+div_p_p_nc                      571
+fdiv_i_i                        572
+fdiv_i_ic                       573
+fdiv_n_n                        574
+fdiv_n_nc                       575
+fdiv_p_p                        576
+fdiv_p_i                        577
+fdiv_p_ic                       578
+fdiv_p_n                        579
+fdiv_p_nc                       580
+fdiv_i_i_i                      581
+fdiv_i_ic_i                     582
+fdiv_i_i_ic                     583
+fdiv_n_n_n                      584
+fdiv_n_nc_n                     585
+fdiv_n_n_nc                     586
+fdiv_p_p_p                      587
+fdiv_p_p_i                      588
+fdiv_p_p_ic                     589
+fdiv_p_p_n                      590
+fdiv_p_p_nc                     591
+ceil_n                          592
+ceil_i_n                        593
+ceil_n_n                        594
+floor_n                         595
+floor_i_n                       596
+floor_n_n                       597
+inc_i                           598
+inc_n                           599
+inc_p                           600
+mod_i_i                         601
+mod_i_ic                        602
+mod_n_n                         603
+mod_n_nc                        604
+mod_p_p                         605
+mod_p_i                         606
+mod_p_ic                        607
+mod_p_n                         608
+mod_p_nc                        609
+mod_i_i_i                       610
+mod_i_ic_i                      611
+mod_i_i_ic                      612
+mod_n_n_n                       613
+mod_n_nc_n                      614
+mod_n_n_nc                      615
+mod_p_p_p                       616
+mod_p_p_i                       617
+mod_p_p_ic                      618
+mod_p_p_n                       619
+mod_p_p_nc                      620
+mul_i_i                         621
+mul_i_ic                        622
+mul_n_n                         623
+mul_n_nc                        624
+mul_p_p                         625
+mul_p_i                         626
+mul_p_ic                        627
+mul_p_n                         628
+mul_p_nc                        629
+mul_i_i_i                       630
+mul_i_ic_i                      631
+mul_i_i_ic                      632
+mul_n_n_n                       633
+mul_n_nc_n                      634
+mul_n_n_nc                      635
+mul_p_p_p                       636
+mul_p_p_i                       637
+mul_p_p_ic                      638
+mul_p_p_n                       639
+mul_p_p_nc                      640
+neg_i                           641
+neg_n                           642
+neg_p                           643
+neg_i_i                         644
+neg_n_n                         645
+neg_p_p                         646
+pow_n_n_n                       647
+pow_n_nc_n                      648
+pow_n_n_nc                      649
+pow_p_p_p                       650
+pow_p_p_i                       651
+pow_p_p_ic                      652
+pow_p_p_n                       653
+pow_p_p_nc                      654
+pow_n_n_i                       655
+pow_n_nc_i                      656
+pow_n_n_ic                      657
+pow_n_nc_ic                     658
+sub_i_i                         659
+sub_i_ic                        660
+sub_n_n                         661
+sub_n_nc                        662
+sub_p_p                         663
+sub_p_i                         664
+sub_p_ic                        665
+sub_p_n                         666
+sub_p_nc                        667
+sub_i_i_i                       668
+sub_i_ic_i                      669
+sub_i_i_ic                      670
+sub_n_n_n                       671
+sub_n_nc_n                      672
+sub_n_n_nc                      673
+sub_p_p_p                       674
+sub_p_p_i                       675
+sub_p_p_ic                      676
+sub_p_p_n                       677
+sub_p_p_nc                      678
+sqrt_n_n                        679
+acos_n_n                        680
+asec_n_n                        681
+asin_n_n                        682
+atan_n_n                        683
+atan_n_n_n                      684
+atan_n_nc_n                     685
+atan_n_n_nc                     686
+cos_n_n                         687
+cosh_n_n                        688
+exp_n_n                         689
+ln_n_n                          690
+log10_n_n                       691
+log2_n_n                        692
+sec_n_n                         693
+sech_n_n                        694
+sin_n_n                         695
+sinh_n_n                        696
+tan_n_n                         697
+tanh_n_n                        698
+gcd_i_i_i                       699
+gcd_i_ic_i                      700
+gcd_i_i_ic                      701
+lcm_i_i_i                       702
+lcm_i_ic_i                      703
+lcm_i_i_ic                      704
+fact_i_i                        705
+fact_n_i                        706
+callmethodcc_p_s                707
+callmethodcc_p_sc               708
+callmethodcc_p_p                709
+callmethod_p_s_p                710
+callmethod_p_sc_p               711
+callmethod_p_p_p                712
+tailcallmethod_p_s              713
+tailcallmethod_p_sc             714
+tailcallmethod_p_p              715
+addmethod_p_s_p                 716
+addmethod_p_sc_p                717
+can_i_p_s                       718
+can_i_p_sc                      719
+does_i_p_s                      720
+does_i_p_sc                     721
+does_i_p_p                      722
+does_i_p_pc                     723
+isa_i_p_s                       724
+isa_i_p_sc                      725
+isa_i_p_p                       726
+isa_i_p_pc                      727
+newclass_p_s                    728
+newclass_p_sc                   729
+newclass_p_p                    730
+newclass_p_pc                   731
+subclass_p_p                    732
+subclass_p_pc                   733
+subclass_p_p_s                  734
+subclass_p_pc_s                 735
+subclass_p_p_sc                 736
+subclass_p_pc_sc                737
+subclass_p_p_p                  738
+subclass_p_pc_p                 739
+subclass_p_p_pc                 740
+subclass_p_pc_pc                741
+subclass_p_s                    742
+subclass_p_sc                   743
+subclass_p_s_s                  744
+subclass_p_sc_s                 745
+subclass_p_s_sc                 746
+subclass_p_sc_sc                747
+subclass_p_s_p                  748
+subclass_p_sc_p                 749
+subclass_p_s_pc                 750
+subclass_p_sc_pc                751
+get_class_p_s                   752
+get_class_p_sc                  753
+get_class_p_p                   754
+get_class_p_pc                  755
+class_p_p                       756
+addparent_p_p                   757
+removeparent_p_p                758
+addrole_p_p                     759
+addattribute_p_s                760
+addattribute_p_sc               761
+removeattribute_p_s             762
+removeattribute_p_sc            763
+getattribute_p_p_s              764
+getattribute_p_p_sc             765
+getattribute_p_p_p_s            766
+getattribute_p_p_pc_s           767
+getattribute_p_p_p_sc           768
+getattribute_p_p_pc_sc          769
+setattribute_p_s_p              770
+setattribute_p_sc_p             771
+setattribute_p_p_s_p            772
+setattribute_p_pc_s_p           773
+setattribute_p_p_sc_p           774
+setattribute_p_pc_sc_p          775
+inspect_p_p                     776
+inspect_p_pc                    777
+inspect_p_p_s                   778
+inspect_p_pc_s                  779
+inspect_p_p_sc                  780
+inspect_p_pc_sc                 781
+new_p_s                         782
+new_p_sc                        783
+new_p_s_p                       784
+new_p_sc_p                      785
+new_p_s_pc                      786
+new_p_sc_pc                     787
+new_p_p                         788
+new_p_pc                        789
+new_p_p_p                       790
+new_p_pc_p                      791
+new_p_p_pc                      792
+new_p_pc_pc                     793
+root_new_p_p                    794
+root_new_p_pc                   795
+root_new_p_p_p                  796
+root_new_p_pc_p                 797
+root_new_p_p_pc                 798
+root_new_p_pc_pc                799
+typeof_s_p                      800
+typeof_p_p                      801
+get_repr_s_p                    802
+find_method_p_p_s               803
+find_method_p_p_sc              804
+defined_i_p                     805
+defined_i_p_ki                  806
+defined_i_p_kic                 807
+defined_i_p_k                   808
+defined_i_p_kc                  809
+exists_i_p_ki                   810
+exists_i_p_kic                  811
+exists_i_p_k                    812
+exists_i_p_kc                   813
+delete_p_k                      814
+delete_p_kc                     815
+delete_p_ki                     816
+delete_p_kic                    817
+elements_i_p                    818
+push_p_i                        819
+push_p_ic                       820
+push_p_n                        821
+push_p_nc                       822
+push_p_s                        823
+push_p_sc                       824
+push_p_p                        825
+pop_i_p                         826
+pop_n_p                         827
+pop_s_p                         828
+pop_p_p                         829
+unshift_p_i                     830
+unshift_p_ic                    831
+unshift_p_n                     832
+unshift_p_nc                    833
+unshift_p_s                     834
+unshift_p_sc                    835
+unshift_p_p                     836
+shift_i_p                       837
+shift_n_p                       838
+shift_s_p                       839
+shift_p_p                       840
+splice_p_p_i_i                  841
+splice_p_p_ic_i                 842
+splice_p_p_i_ic                 843
+splice_p_p_ic_ic                844
+setprop_p_s_p                   845
+setprop_p_sc_p                  846
+getprop_p_s_p                   847
+getprop_p_sc_p                  848
+delprop_p_s                     849
+delprop_p_sc                    850
+prophash_p_p                    851
+freeze_s_p                      852
+thaw_p_s                        853
+thaw_p_sc                       854
+add_multi_s_s_p                 855
+add_multi_sc_s_p                856
+add_multi_s_sc_p                857
+add_multi_sc_sc_p               858
+find_multi_p_s_s                859
+find_multi_p_sc_s               860
+find_multi_p_s_sc               861
+find_multi_p_sc_sc              862
+register_p                      863
+unregister_p                    864
+box_p_i                         865
+box_p_ic                        866
+box_p_n                         867
+box_p_nc                        868
+box_p_s                         869
+box_p_sc                        870
+iter_p_p                        871
+morph_p_p                       872
+morph_p_pc                      873
+clone_s_s                       874
+clone_s_sc                      875
+exchange_i_i                    876
+exchange_p_p                    877
+exchange_n_n                    878
+exchange_s_s                    879
+set_i_i                         880
+set_i_ic                        881
+set_i_n                         882
+set_i_nc                        883
+set_i_s                         884
+set_i_sc                        885
+set_n_n                         886
+set_n_nc                        887
+set_n_i                         888
+set_n_ic                        889
+set_n_s                         890
+set_n_sc                        891
+set_n_p                         892
+set_s_p                         893
+set_s_s                         894
+set_s_sc                        895
+set_s_i                         896
+set_s_ic                        897
+set_s_n                         898
+set_s_nc                        899
+set_p_pc                        900
+set_p_p                         901
+set_p_i                         902
+set_p_ic                        903
+set_p_n                         904
+set_p_nc                        905
+set_p_s                         906
+set_p_sc                        907
+set_i_p                         908
+assign_p_p                      909
+assign_p_i                      910
+assign_p_ic                     911
+assign_p_n                      912
+assign_p_nc                     913
+assign_p_s                      914
+assign_p_sc                     915
+assign_s_s                      916
+assign_s_sc                     917
+setref_p_p                      918
+deref_p_p                       919
+setp_ind_i_p                    920
+setp_ind_ic_p                   921
+setn_ind_i_n                    922
+setn_ind_ic_n                   923
+setn_ind_i_nc                   924
+setn_ind_ic_nc                  925
+sets_ind_i_s                    926
+sets_ind_ic_s                   927
+sets_ind_i_sc                   928
+sets_ind_ic_sc                  929
+seti_ind_i_i                    930
+seti_ind_ic_i                   931
+seti_ind_i_ic                   932
+seti_ind_ic_ic                  933
+set_p_ki_i                      934
+set_p_kic_i                     935
+set_p_ki_ic                     936
+set_p_kic_ic                    937
+set_p_ki_n                      938
+set_p_kic_n                     939
+set_p_ki_nc                     940
+set_p_kic_nc                    941
+set_p_ki_s                      942
+set_p_kic_s                     943
+set_p_ki_sc                     944
+set_p_kic_sc                    945
+set_p_ki_p                      946
+set_p_kic_p                     947
+set_i_p_ki                      948
+set_i_p_kic                     949
+set_n_p_ki                      950
+set_n_p_kic                     951
+set_s_p_ki                      952
+set_s_p_kic                     953
+set_p_p_ki                      954
+set_p_p_kic                     955
+set_p_k_i                       956
+set_p_kc_i                      957
+set_p_k_ic                      958
+set_p_kc_ic                     959
+set_p_k_n                       960
+set_p_kc_n                      961
+set_p_k_nc                      962
+set_p_kc_nc                     963
+set_p_k_s                       964
+set_p_kc_s                      965
+set_p_k_sc                      966
+set_p_kc_sc                     967
+set_p_k_p                       968
+set_p_kc_p                      969
+set_i_p_k                       970
+set_i_p_kc                      971
+set_n_p_k                       972
+set_n_p_kc                      973
+set_s_p_k                       974
+set_s_p_kc                      975
+set_p_p_k                       976
+set_p_p_kc                      977
+clone_p_p                       978
+clone_p_p_p                     979
+clone_p_p_pc                    980
+copy_p_p                        981
+null_s                          982
+null_i                          983
+null_p                          984
+null_n                          985
+cleari                          986
+clearn                          987
+clears                          988
+clearp                          989
+ord_i_s                         990
+ord_i_sc                        991
+ord_i_s_i                       992
+ord_i_sc_i                      993
+ord_i_s_ic                      994
+ord_i_sc_ic                     995
+chr_s_i                         996
+chr_s_ic                        997
+chopn_s_i                       998
+chopn_s_ic                      999
+chopn_s_s_i                    1000
+chopn_s_sc_i                   1001
+chopn_s_s_ic                   1002
+chopn_s_sc_ic                  1003
+concat_s_s                     1004
+concat_s_sc                    1005
+concat_p_p                     1006
+concat_p_s                     1007
+concat_p_sc                    1008
+concat_s_s_s                   1009
+concat_s_sc_s                  1010
+concat_s_s_sc                  1011
+concat_p_p_s                   1012
+concat_p_p_sc                  1013
+concat_p_p_p                   1014
+repeat_s_s_i                   1015
+repeat_s_sc_i                  1016
+repeat_s_s_ic                  1017
+repeat_s_sc_ic                 1018
+repeat_p_p_i                   1019
+repeat_p_p_ic                  1020
+repeat_p_p_p                   1021
+repeat_p_i                     1022
+repeat_p_ic                    1023
+repeat_p_p                     1024
+length_i_s                     1025
+length_i_sc                    1026
+bytelength_i_s                 1027
+bytelength_i_sc                1028
+pin_s                          1029
+unpin_s                        1030
+substr_s_s_i                   1031
+substr_s_sc_i                  1032
+substr_s_s_ic                  1033
+substr_s_sc_ic                 1034
+substr_s_s_i_i                 1035
+substr_s_sc_i_i                1036
+substr_s_s_ic_i                1037
+substr_s_sc_ic_i               1038
+substr_s_s_i_ic                1039
+substr_s_sc_i_ic               1040
+substr_s_s_ic_ic               1041
+substr_s_sc_ic_ic              1042
+substr_s_s_i_i_s               1043
+substr_s_s_ic_i_s              1044
+substr_s_s_i_ic_s              1045
+substr_s_s_ic_ic_s             1046
+substr_s_s_i_i_sc              1047
+substr_s_s_ic_i_sc             1048
+substr_s_s_i_ic_sc             1049
+substr_s_s_ic_ic_sc            1050
+substr_s_i_i_s                 1051
+substr_s_ic_i_s                1052
+substr_s_i_ic_s                1053
+substr_s_ic_ic_s               1054
+substr_s_i_i_sc                1055
+substr_s_ic_i_sc               1056
+substr_s_i_ic_sc               1057
+substr_s_ic_ic_sc              1058
+substr_s_p_i_i                 1059
+substr_s_p_ic_i                1060
+substr_s_p_i_ic                1061
+substr_s_p_ic_ic               1062
+index_i_s_s                    1063
+index_i_sc_s                   1064
+index_i_s_sc                   1065
+index_i_sc_sc                  1066
+index_i_s_s_i                  1067
+index_i_sc_s_i                 1068
+index_i_s_sc_i                 1069
+index_i_sc_sc_i                1070
+index_i_s_s_ic                 1071
+index_i_sc_s_ic                1072
+index_i_s_sc_ic                1073
+index_i_sc_sc_ic               1074
+sprintf_s_s_p                  1075
+sprintf_s_sc_p                 1076
+sprintf_p_p_p                  1077
+new_s                          1078
+new_s_i                        1079
+new_s_ic                       1080
+stringinfo_i_s_i               1081
+stringinfo_i_sc_i              1082
+stringinfo_i_s_ic              1083
+stringinfo_i_sc_ic             1084
+upcase_s_s                     1085
+upcase_s_sc                    1086
+upcase_s                       1087
+downcase_s_s                   1088
+downcase_s_sc                  1089
+downcase_s                     1090
+titlecase_s_s                  1091
+titlecase_s_sc                 1092
+titlecase_s                    1093
+join_s_s_p                     1094
+join_s_sc_p                    1095
+split_p_s_s                    1096
+split_p_sc_s                   1097
+split_p_s_sc                   1098
+split_p_sc_sc                  1099
+charset_i_s                    1100
+charset_i_sc                   1101
+charsetname_s_i                1102
+charsetname_s_ic               1103
+find_charset_i_s               1104
+find_charset_i_sc              1105
+trans_charset_s_i              1106
+trans_charset_s_ic             1107
+trans_charset_s_s_i            1108
+trans_charset_s_sc_i           1109
+trans_charset_s_s_ic           1110
+trans_charset_s_sc_ic          1111
+encoding_i_s                   1112
+encoding_i_sc                  1113
+encodingname_s_i               1114
+encodingname_s_ic              1115
+find_encoding_i_s              1116
+find_encoding_i_sc             1117
+trans_encoding_s_i             1118
+trans_encoding_s_ic            1119
+trans_encoding_s_s_i           1120
+trans_encoding_s_sc_i          1121
+trans_encoding_s_s_ic          1122
+trans_encoding_s_sc_ic         1123
+is_cclass_i_i_s_i              1124
+is_cclass_i_ic_s_i             1125
+is_cclass_i_i_sc_i             1126
+is_cclass_i_ic_sc_i            1127
+is_cclass_i_i_s_ic             1128
+is_cclass_i_ic_s_ic            1129
+is_cclass_i_i_sc_ic            1130
+is_cclass_i_ic_sc_ic           1131
+find_cclass_i_i_s_i_i          1132
+find_cclass_i_ic_s_i_i         1133
+find_cclass_i_i_sc_i_i         1134
+find_cclass_i_ic_sc_i_i        1135
+find_cclass_i_i_s_ic_i         1136
+find_cclass_i_ic_s_ic_i        1137
+find_cclass_i_i_sc_ic_i        1138
+find_cclass_i_ic_sc_ic_i       1139
+find_cclass_i_i_s_i_ic         1140
+find_cclass_i_ic_s_i_ic        1141
+find_cclass_i_i_sc_i_ic        1142
+find_cclass_i_ic_sc_i_ic       1143
+find_cclass_i_i_s_ic_ic        1144
+find_cclass_i_ic_s_ic_ic       1145
+find_cclass_i_i_sc_ic_ic       1146
+find_cclass_i_ic_sc_ic_ic      1147
+find_not_cclass_i_i_s_i_i      1148
+find_not_cclass_i_ic_s_i_i     1149
+find_not_cclass_i_i_sc_i_i     1150
+find_not_cclass_i_ic_sc_i_i    1151
+find_not_cclass_i_i_s_ic_i     1152
+find_not_cclass_i_ic_s_ic_i    1153
+find_not_cclass_i_i_sc_ic_i    1154
+find_not_cclass_i_ic_sc_ic_i   1155
+find_not_cclass_i_i_s_i_ic     1156
+find_not_cclass_i_ic_s_i_ic    1157
+find_not_cclass_i_i_sc_i_ic    1158
+find_not_cclass_i_ic_sc_i_ic   1159
+find_not_cclass_i_i_s_ic_ic    1160
+find_not_cclass_i_ic_s_ic_ic   1161
+find_not_cclass_i_i_sc_ic_ic   1162
+find_not_cclass_i_ic_sc_ic_ic  1163
+escape_s_s                     1164
+compose_s_s                    1165
+compose_s_sc                   1166
+spawnw_i_s                     1167
+spawnw_i_sc                    1168
+spawnw_i_p                     1169
+err_i                          1170
+err_s                          1171
+err_s_i                        1172
+err_s_ic                       1173
+time_i                         1174
+time_n                         1175
+gmtime_s_i                     1176
+gmtime_s_ic                    1177
+localtime_s_i                  1178
+localtime_s_ic                 1179
+decodetime_p_i                 1180
+decodetime_p_ic                1181
+decodelocaltime_p_i            1182
+decodelocaltime_p_ic           1183
+sysinfo_s_i                    1184
+sysinfo_s_ic                   1185
+sysinfo_i_i                    1186
+sysinfo_i_ic                   1187
+sleep_i                        1188
+sleep_ic                       1189
+sleep_n                        1190
+sleep_nc                       1191
+sizeof_i_i                     1192
+sizeof_i_ic                    1193
+store_lex_s_p                  1194
+store_lex_sc_p                 1195
+store_dynamic_lex_s_p          1196
+store_dynamic_lex_sc_p         1197
+find_lex_p_s                   1198
+find_lex_p_sc                  1199
+find_dynamic_lex_p_s           1200
+find_dynamic_lex_p_sc          1201
+find_caller_lex_p_s            1202
+find_caller_lex_p_sc           1203
+get_namespace_p                1204
+get_namespace_p_p              1205
+get_namespace_p_pc             1206
+get_hll_namespace_p            1207
+get_hll_namespace_p_p          1208
+get_hll_namespace_p_pc         1209
+get_root_namespace_p           1210
+get_root_namespace_p_p         1211
+get_root_namespace_p_pc        1212
+get_global_p_s                 1213
+get_global_p_sc                1214
+get_global_p_p_s               1215
+get_global_p_pc_s              1216
+get_global_p_p_sc              1217
+get_global_p_pc_sc             1218
+get_hll_global_p_s             1219
+get_hll_global_p_sc            1220
+get_hll_global_p_p_s           1221
+get_hll_global_p_pc_s          1222
+get_hll_global_p_p_sc          1223
+get_hll_global_p_pc_sc         1224
+get_root_global_p_s            1225
+get_root_global_p_sc           1226
+get_root_global_p_p_s          1227
+get_root_global_p_pc_s         1228
+get_root_global_p_p_sc         1229
+get_root_global_p_pc_sc        1230
+set_global_s_p                 1231
+set_global_sc_p                1232
+set_global_p_s_p               1233
+set_global_pc_s_p              1234
+set_global_p_sc_p              1235
+set_global_pc_sc_p             1236
+set_hll_global_s_p             1237
+set_hll_global_sc_p            1238
+set_hll_global_p_s_p           1239
+set_hll_global_pc_s_p          1240
+set_hll_global_p_sc_p          1241
+set_hll_global_pc_sc_p         1242
+set_root_global_s_p            1243
+set_root_global_sc_p           1244
+set_root_global_p_s_p          1245
+set_root_global_pc_s_p         1246
+set_root_global_p_sc_p         1247
+set_root_global_pc_sc_p        1248
+find_name_p_s                  1249
+find_name_p_sc                 1250
+find_sub_not_null_p_s          1251
+find_sub_not_null_p_sc         1252

Deleted: branches/orderedhash_revamp/src/ops/pic.ops
==============================================================================
--- branches/orderedhash_revamp/src/ops/pic.ops	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,323 +0,0 @@
-/*
- * $Id$
-** pic.ops
-*/
-
-#include "parrot/oplib/ops.h"
-#include "../src/pmc/pmc_fixedintegerarray.h"
-
-typedef opcode_t* (*interface_f)(Interp*, INTVAL*, void **);
-
-VERSION = PARROT_VERSION;
-
-=head1 NAME
-
-pic.ops - PIC (Polymorphic Inline Cache) Opcodes [deprecated]
-
-=cut
-
-=head1 DESCRIPTION
-
-During predereferencing opcodes that allow caching are rewritten so that
-equivalent opcodes in this file are used. User code MUST never emit these
-opcodes directly.
-
-=head2 General infix operations
-
-These operations take an infix operation number and PMC arguments.
-
-=cut
-
-=over 4
-
-=item B<pic_infix__>(inconst INT, invar PMC, invar PMC)
-
-One for fun and MOPS.
-
-=cut
-
-inline op pic_infix__(inconst INT, invar PMC, invar PMC) :pic :flow {
-    Parrot_MIC *mic;
-    Parrot_PIC_lru *lru;
-    PMC *left, *right;
-    INTVAL lr_types;
-
-    mic = (Parrot_MIC *) cur_opcode[1];
-    left = $2;
-    right = $3;
-    lru = &mic->lru;
-    lr_types = (VTABLE_type(interp, left) << 16) | VTABLE_type(interp, right);
-    if (lru->u.type == lr_types) {
-runit_v_pp:
-        ((mmd_f_v_pp)lru->f.real_function)(interp, left, right);
-        goto NEXT();
-    }
-    if (mic->pic) {
-        lru = mic->pic->lru;
-        if (lru->u.type == lr_types)
-            goto runit_v_pp;
-        if (++lru->u.type == lr_types)
-            goto runit_v_pp;
-        if (++lru->u.type == lr_types)
-            goto runit_v_pp;
-        mic->pic->miss_count++;
-        /*
-         * RT#42353 if we got too often here just do a dynamic lookup
-         */
-    }
-    parrot_pic_find_infix_v_pp(interp, left, right, mic, cur_opcode);
-    /* rerun this opcode */
-    goto OFFSET(0);
-}
-
-=item B<pic_inline_sub__>(inconst INT, invar PMC, invar PMC)
-
-And for more fun an inlined variant too.
-
-=cut
-
-inline op pic_inline_sub__(inconst INT, invar PMC, invar PMC) :pic {
-    Parrot_MIC *mic;
-    Parrot_PIC_lru *lru;
-    PMC *left, *right;
-    INTVAL lr_types, lt, rt;
-
-    left = $2;
-    mic = (Parrot_MIC *) cur_opcode[1];
-    lt = VTABLE_type(interp, left);
-    right = $3;
-    lru = &mic->lru;
-    rt = VTABLE_type(interp, right);
-    lr_types = (lt << 16) | rt;
-    if (lru->u.type == lr_types) {
-        INTVAL a = VTABLE_get_integer(interp, left);
-        INTVAL b = VTABLE_get_integer(interp, right);
-        INTVAL c = a - b;
-        if ((c^a) >= 0 || (c^~b) >= 0) {
-            VTABLE_set_integer_native(interp, left, c);
-        }
-        else {
-            if (PARROT_ERRORS_test(interp, PARROT_ERRORS_OVERFLOW_FLAG)) {
-                opcode_t *handler = Parrot_ex_throw_from_op_args(interp, NULL,
-                        EXCEPTION_ERR_OVERFLOW,
-                        "Integer overflow");
-                goto ADDRESS(handler);
-            }
-            /* #RT42354 preserve type system */
-            VTABLE_morph(interp, left, interp->vtables[enum_class_BigInt]->pmc_class);
-            VTABLE_set_integer_native(interp, left, a);
-            $2 = VTABLE_subtract_int(interp, left, b, left);
-        }
-    }
-    else {
-        ((void**)cur_opcode)[0] =
-            parrot_pic_opcode(interp, PARROT_OP_pic_infix___ic_p_p);
-        goto OFFSET(0);
-    }
-}
-
-=item B<pic_get_params__>(inconst PMC /* , ... */)
-
-Fetch function parameters for this subroutine.
-
-=item B<pic_set_returns__>(inconst PMC /* , ... */)
-
-Return values to caller.
-
-=cut
-
-inline op pic_get_params__(inconst PMC) :pic :flow {
-    Parrot_MIC *mic;
-    Parrot_PIC_lru *lru;
-    PMC *sig, *ccont;
-    opcode_t *src_pc;
-    void **src_pred;
-    Parrot_Context *caller_ctx, *ctx;
-    int n;
-
-    /* avoid load dependencies - intermix derefs
-     * - yes, confusing but faster
-     */
-    ctx = CONTEXT(interp);
-    src_pc = interp->current_args;
-    mic = (Parrot_MIC *) cur_opcode[1];
-    caller_ctx = ctx->caller_ctx;
-    if (src_pc) {
-        src_pred = (void**) src_pc - caller_ctx->pred_offset;
-        sig = (PMC*)(src_pred[1]);
-    }
-    else {
-        sig = NULL;
-        src_pred = NULL;        /* just for gcc */
-    }
-    lru = &mic->lru;
-    if (lru->u.signature == sig) {
-        if (sig) {
-            n = ((arg_pass_f)lru->f.real_function)(interp, sig,
-                    (char*)caller_ctx->bp.regs_i, src_pred,
-                    _reg_base, (void**)cur_opcode);
-        }
-        else
-            n = 2;
-        ccont = ctx->current_cont;
-        if (PObj_get_FLAGS(ccont) & SUB_FLAG_TAILCALL) {
-            PObj_get_FLAGS(ccont) &= ~SUB_FLAG_TAILCALL;
-            --ctx->recursion_depth;
-            ctx->caller_ctx = caller_ctx->caller_ctx;
-            Parrot_free_context(interp, caller_ctx, 1);
-            interp->current_args = NULL;
-        }
-
-        goto OFFSET(n);
-    }
-    /* no match redo plain opcode */
-    ((void**)cur_opcode)[0] =
-        parrot_pic_opcode(interp, PARROT_OP_get_params_pc);
-    ((void**)cur_opcode)[1] = mic->m.sig;
-    goto OFFSET(0);
-}
-
-inline op pic_set_returns__(inconst PMC) :pic :flow {
-    Parrot_MIC *mic;
-    Parrot_PIC_lru *lru;
-    PMC *sig, *ccont;
-    opcode_t *dest_pc;
-    void **dest_pred;
-    Parrot_Context *caller_ctx, *ctx;
-    Parrot_cont *cc;
-    int n;
-
-    ctx = CONTEXT(interp);
-    mic = (Parrot_MIC *) cur_opcode[1];
-    ccont = ctx->current_cont;
-    cc = PMC_cont(ccont);
-    if (!cc->address) {
-        interp->current_returns = CUR_OPCODE;
-        n = VTABLE_get_integer(interp, mic->m.sig);
-        goto OFFSET(n + 2);
-    }
-    caller_ctx = cc->to_ctx;
-    interp->current_args = NULL;
-    dest_pc = caller_ctx->current_results;
-    if (dest_pc) {
-        dest_pred = (void**) dest_pc - caller_ctx->pred_offset;
-        sig = (PMC*)(dest_pred[1]);
-    }
-    else {
-        sig = NULL;
-        dest_pred = NULL;
-    }
-    lru = &mic->lru;
-    if (lru->u.signature == sig) {
-        if (sig) {
-            n = ((arg_pass_f)lru->f.real_function)(interp, mic->m.sig,
-                    _reg_base, (void**)cur_opcode,
-                    (char*)caller_ctx->bp.regs_i, dest_pred);
-        }
-        else
-            n = 2;
-        goto OFFSET(n);
-    }
-    /* no match redo plain opcode */
-    ((void**)cur_opcode)[0] =
-        parrot_pic_opcode(interp, PARROT_OP_set_returns_pc);
-    ((void**)cur_opcode)[1] = mic->m.sig;
-    goto OFFSET(0);
-}
-
-=item B<pic_callr__>(inconst PMC)
-
-Call the function $1 as C<pc = func(interp, 0, **args)>. args[0] holds the
-address of the function result, args[1..] are function arguments, both
-according to the C<get_results> and C<set_args> opcodes. The function is
-a C interface function (or NCI) or a JITed PIR function. args[n+1] holds the
-C<pc> of the next opcode and is usually just returned.
-
-=cut
-
-inline op pic_callr__(inconst PMC) :pic :flow {
-    Parrot_MIC *mic;
-    Parrot_PIC_lru *lru;
-    void *args[6];      /* RT#42355 ARG_MAX */
-    Parrot_Context *ctx;
-    opcode_t *pc;
-    void **pred_pc;
-    INTVAL i, n_args, *sig_bits;
-    PMC *sig;
-
-    ctx = CONTEXT(interp);
-    mic = (Parrot_MIC *) cur_opcode[1];
-    /* get_results */
-    pc = ctx->current_results;
-    if (pc) {
-        pred_pc = (void**) pc - ctx->pred_offset;
-        sig = (PMC*)(pred_pc[1]);
-        ASSERT_SIG_PMC(sig);
-        PARROT_ASSERT(VTABLE_elements(interp, sig) <= 1);
-        args[0] = VTABLE_elements(interp, sig) ?
-            (_reg_base + ((opcode_t*)pred_pc)[2]) : NULL;
-    }
-    else
-        args[0] = NULL;
-    /* set_args */
-    n_args = 0;
-    sig = mic->m.sig;
-    ASSERT_SIG_PMC(sig);
-    n_args = VTABLE_elements(interp, sig);
-    GETATTR_FixedIntegerArray_int_array(interp, sig, sig_bits);
-    for (i = 0; i < n_args; ++i) {
-        switch (sig_bits[i]) {
-            case PARROT_ARG_INTVAL:
-                args[1 + i] = (void*)*(INTVAL*)(_reg_base +
-                        ((opcode_t*)cur_opcode)[2 + i]);
-                break;
-            case PARROT_ARG_INTVAL|PARROT_ARG_CONSTANT:
-            case PARROT_ARG_FLOATVAL|PARROT_ARG_CONSTANT:
-                args[1 + i] = (void**)cur_opcode[2 + i];
-                break;
-            case PARROT_ARG_FLOATVAL:
-                args[1 + i] = (_reg_base +
-                        ((opcode_t*)cur_opcode)[2 + i]);
-                break;
-            default:
-                {
-                    opcode_t *handler = Parrot_ex_throw_from_op_args(interp, NULL,
-                        EXCEPTION_INVALID_OPERATION,
-                        "unhandled sig_bits");
-                    goto ADDRESS(handler);
-                }
-        }
-    }
-    /* set_args(); set_p_pc; get_results(1), x; invokecc_p */
-    pc = CUR_OPCODE + 2 + n_args + 3 + 3 + 2;
-    args[1 + n_args] = pc;
-    lru = &mic->lru;
-    /* RT#42356 verify $1 didn't change */
-    (void) ((interface_f)lru->f.real_function)(interp, sig_bits, args);
-    goto ADDRESS(pc);
-}
-
-=back
-
-=cut
-
-###############################################################################
-
-=head1 COPYRIGHT
-
-Copyright (C) 2005-2008, Parrot Foundation.
-
-=head1 LICENSE
-
-This program is free software. It is subject to the same license
-as the Parrot interpreter itself.
-
-=cut
-
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Modified: branches/orderedhash_revamp/src/ops/pmc.ops
==============================================================================
--- branches/orderedhash_revamp/src/ops/pmc.ops	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/ops/pmc.ops	Sat Jan 23 01:49:53 2010	(r43541)
@@ -6,8 +6,6 @@
 
 */
 
-VERSION = PARROT_VERSION;
-
 =head1 NAME
 
 pmc.ops - PMC Opcodes
@@ -44,7 +42,7 @@
 For strings and keys, first check the namespace for a class object, then fall
 back to the type ID if no class object is stored in the namespace.
 
-  new P0, 'ResizableBooleanArray'
+  new $P0, 'ResizableBooleanArray'
 
 Optionally a PMC may be passed to the constructor. It's up to the class what
 to do with the initializer.  See PDD17 and the init_pmc function for more.
@@ -52,17 +50,19 @@
 =cut
 
 op new(out PMC, in STR) {
-    STRING * const classname = $2;
-    PMC * const classobj = Parrot_oo_get_class_str(interp, classname);
+    STRING * const name   = $2;
+    PMC    * const _class = Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp))
+                          ? Parrot_oo_get_class_str(interp, name)
+                          : PMCNULL;
 
-    if (!PMC_IS_NULL(classobj))
-        $1 = VTABLE_instantiate(interp, classobj, PMCNULL);
+    if (!PMC_IS_NULL(_class))
+        $1 = VTABLE_instantiate(interp, _class, PMCNULL);
     else {
-        const INTVAL type = pmc_type(interp, classname);
+        const INTVAL type = pmc_type(interp, name);
         if (type <= 0) {
             opcode_t *dest = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
                 EXCEPTION_NO_CLASS,
-                "Class '%Ss' not found", classname);
+                "Class '%Ss' not found", name);
             goto ADDRESS(dest);
         }
         $1 = pmc_new(interp, type);
@@ -70,17 +70,19 @@
 }
 
 op new(out PMC, in STR, in PMC) {
-    STRING * const classname = $2;
-    PMC * const classobj = Parrot_oo_get_class_str(interp, classname);
+    STRING * const name   = $2;
+    PMC    * const _class = Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp))
+                          ? Parrot_oo_get_class_str(interp, name)
+                          : PMCNULL;
 
-    if (!PMC_IS_NULL(classobj))
-        $1 = VTABLE_instantiate(interp, classobj, $3);
+    if (!PMC_IS_NULL(_class))
+        $1 = VTABLE_instantiate(interp, _class, $3);
     else {
-        const INTVAL type = pmc_type(interp, classname);
+        const INTVAL type = pmc_type(interp, name);
         if (type <= 0) {
             opcode_t *dest = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
                 EXCEPTION_NO_CLASS,
-                "Class '%Ss' not found", classname);
+                "Class '%Ss' not found", name);
             goto ADDRESS(dest);
         }
         $1 = pmc_new_init(interp, type, $3);
@@ -88,17 +90,17 @@
 }
 
 inline op new(out PMC, in PMC) :object_classes {
-    PMC * const classname_key = $2;
-    PMC * const classobj = Parrot_oo_get_class(interp, classname_key);
+    PMC * const name_key = $2;
+    PMC * const _class   = Parrot_oo_get_class(interp, name_key);
 
-    if (!PMC_IS_NULL(classobj))
-        $1 = VTABLE_instantiate(interp, classobj, PMCNULL);
+    if (!PMC_IS_NULL(_class))
+        $1 = VTABLE_instantiate(interp, _class, PMCNULL);
     else {
-        const INTVAL type = pmc_type_p(interp, classname_key);
+        const INTVAL type = pmc_type_p(interp, name_key);
         if (type <= 0) {
             opcode_t *dest = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
                 EXCEPTION_NO_CLASS,
-                "Class '%Ss' not found", VTABLE_get_repr(interp, classname_key));
+                "Class '%Ss' not found", VTABLE_get_repr(interp, name_key));
             goto ADDRESS(dest);
         }
         $1 = pmc_new(interp, type);
@@ -106,17 +108,17 @@
 }
 
 op new(out PMC, in PMC, in PMC) {
-    PMC * const classname_key = $2;
-    PMC * const classobj = Parrot_oo_get_class(interp, classname_key);
+    PMC * const name_key = $2;
+    PMC * const _class   = Parrot_oo_get_class(interp, name_key);
 
-    if (!PMC_IS_NULL(classobj))
-        $1 = VTABLE_instantiate(interp, classobj, $3);
+    if (!PMC_IS_NULL(_class))
+        $1 = VTABLE_instantiate(interp, _class, $3);
     else {
-        const INTVAL type = pmc_type_p(interp, classname_key);
+        const INTVAL type = pmc_type_p(interp, name_key);
         if (type <= 0) {
             opcode_t *dest = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
                 EXCEPTION_NO_CLASS,
-                "Class '%Ss' not found", VTABLE_get_repr(interp, classname_key));
+                "Class '%Ss' not found", VTABLE_get_repr(interp, name_key));
             goto ADDRESS(dest);
         }
         $1 = pmc_new_init(interp, type, $3);
@@ -131,7 +133,7 @@
 
 Instantiate a new object from a key name relative to the root namespace.
 
-  root_new P0, ['parrot';'ResizableBooleanArray']
+  root_new $P0, ['parrot';'ResizableBooleanArray']
 
 Optionally a PMC may be passed to the constructor. It's up to the class what
 to do with the initializer.
@@ -186,11 +188,11 @@
 =cut
 
 inline op typeof(out STR, invar PMC) {
-  $1 = VTABLE_name(interp, $2);
+    $1 = VTABLE_name(interp, $2);
 }
 
 inline op typeof(out PMC, invar PMC) {
-  $1 = VTABLE_get_class(interp, $2);
+    $1 = VTABLE_get_class(interp, $2);
 }
 
 ########################################
@@ -261,23 +263,23 @@
 =cut
 
 inline op defined(out INT, invar PMC) {
-  $1 = PMC_IS_NULL($2) ? 0 : VTABLE_defined(interp, $2);
+    $1 = PMC_IS_NULL($2) ? 0 : VTABLE_defined(interp, $2);
 }
 
 inline op defined(out INT, invar PMC, in INTKEY) {
-  $1 = PMC_IS_NULL($2) ? 0 : VTABLE_defined_keyed_int(interp, $2, $3);
+    $1 = PMC_IS_NULL($2) ? 0 : VTABLE_defined_keyed_int(interp, $2, $3);
 }
 
 inline op defined(out INT, invar PMC, in KEY) {
-  $1 = PMC_IS_NULL($2) ? 0 : VTABLE_defined_keyed(interp, $2, $3);
+    $1 = PMC_IS_NULL($2) ? 0 : VTABLE_defined_keyed(interp, $2, $3);
 }
 
 inline op exists(out INT, invar PMC, in INTKEY) {
-  $1 = PMC_IS_NULL($2) ? 0 : VTABLE_exists_keyed_int(interp, $2, $3);
+    $1 = PMC_IS_NULL($2) ? 0 : VTABLE_exists_keyed_int(interp, $2, $3);
 }
 
 inline op exists(out INT, invar PMC, in KEY) {
-  $1 = PMC_IS_NULL($2) ? 0: VTABLE_exists_keyed(interp, $2, $3);
+    $1 = PMC_IS_NULL($2) ? 0: VTABLE_exists_keyed(interp, $2, $3);
 }
 
 ########################################
@@ -291,11 +293,11 @@
 =cut
 
 inline op delete(invar PMC, in KEY) {
-  VTABLE_delete_keyed(interp, $1, $2);
+    VTABLE_delete_keyed(interp, $1, $2);
 }
 
 inline op delete(invar PMC, in INTKEY) {
-  VTABLE_delete_keyed_int(interp, $1, $2);
+    VTABLE_delete_keyed_int(interp, $1, $2);
 }
 
 ########################################
@@ -307,7 +309,7 @@
 =cut
 
 inline op elements(out INT, invar PMC) {
-  $1 = VTABLE_elements(interp, $2);
+    $1 = VTABLE_elements(interp, $2);
 }
 
 =back
@@ -480,7 +482,7 @@
 =cut
 
 op setprop(invar PMC, in STR, invar PMC) {
-      VTABLE_setprop(interp, $1, $2, $3);
+    VTABLE_setprop(interp, $1, $2, $3);
 }
 
 ########################################
@@ -492,7 +494,7 @@
 =cut
 
 op getprop(out PMC, in STR, invar PMC) {
-   $1 = VTABLE_getprop(interp, $3, $2);
+    $1 = VTABLE_getprop(interp, $3, $2);
 }
 
 ########################################
@@ -504,7 +506,7 @@
 =cut
 
 op delprop(invar PMC, in STR) {
-   VTABLE_delprop(interp, $1, $2);
+    VTABLE_delprop(interp, $1, $2);
 }
 
 ########################################
@@ -517,7 +519,7 @@
 =cut
 
 op prophash(out PMC, invar PMC) {
-   $1 = VTABLE_getprops(interp, $2);
+    $1 = VTABLE_getprops(interp, $2);
 }
 
 =back
@@ -547,11 +549,11 @@
 =cut
 
 op freeze(out STR, invar PMC) {
-   $1 = Parrot_freeze(interp, $2);
+    $1 = Parrot_freeze(interp, $2);
 }
 
 op thaw(out PMC, in STR) {
-   $1 = Parrot_thaw(interp, $2);
+    $1 = Parrot_thaw(interp, $2);
 }
 
 =back
@@ -582,7 +584,7 @@
 =cut
 
 inline op add_multi(in STR, in STR, invar PMC) {
-  Parrot_mmd_add_multi_from_long_sig(interp, $1, $2, $3);
+    Parrot_mmd_add_multi_from_long_sig(interp, $1, $2, $3);
 }
 
 =item B<find_multi>(out PMC, in STR, in STR)
@@ -592,7 +594,7 @@
 =cut
 
 inline op find_multi(out PMC, in STR, in STR) {
-  $1 = Parrot_mmd_find_multi_from_long_sig(interp, $2, $3);
+    $1 = Parrot_mmd_find_multi_from_long_sig(interp, $2, $3);
 }
 
 =back
@@ -625,11 +627,11 @@
 =cut
 
 op register(invar PMC) {
-  gc_register_pmc(interp, $1);
+    gc_register_pmc(interp, $1);
 }
 
 op unregister(invar PMC) {
-  gc_unregister_pmc(interp, $1);
+    gc_unregister_pmc(interp, $1);
 }
 
 
@@ -681,7 +683,7 @@
 =cut
 
 inline op morph(invar PMC, in PMC) {
-  VTABLE_morph(interp, $1, $2);
+    VTABLE_morph(interp, $1, $2);
 }
 
 =back

Modified: branches/orderedhash_revamp/src/ops/set.ops
==============================================================================
--- branches/orderedhash_revamp/src/ops/set.ops	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/ops/set.ops	Sat Jan 23 01:49:53 2010	(r43541)
@@ -3,8 +3,6 @@
 ** set.ops
 */
 
-VERSION = PARROT_VERSION;
-
 =head1 NAME
 
 set.ops - Assignment Opcodes
@@ -27,7 +25,10 @@
 =cut
 
 inline op clone(out STR, in STR) :base_mem {
-  $1 = Parrot_str_copy(interp, $2);
+    /* cloning a NULL STRING produces an empty STRING; TT #964 */
+    $1 = $2
+       ? Parrot_str_copy(interp, $2)
+       : Parrot_str_new(interp, NULL, 0);
 }
 
 
@@ -47,27 +48,27 @@
 =cut
 
 op exchange(inout INT, inout INT) :base_core {
-   const INTVAL temp = $1;
-   $1 = $2;
-   $2 = temp;
+    const INTVAL temp = $1;
+    $1 = $2;
+    $2 = temp;
 }
 
 op exchange(inout PMC, inout PMC) :base_core {
-   PMC * const temp = $1;
-   $1 = $2;
-   $2 = temp;
+    PMC * const temp = $1;
+    $1 = $2;
+    $2 = temp;
 }
 
 op exchange(inout NUM, inout NUM) :base_core {
-   FLOATVAL temp = $1;
-   $1 = $2;
-   $2 = temp;
+    FLOATVAL temp = $1;
+    $1 = $2;
+    $2 = temp;
 }
 
 op exchange(inout STR, inout STR) :base_core {
-   STRING * const temp = $1;
-   $1 = $2;
-   $2 = temp;
+    STRING * const temp = $1;
+    $1 = $2;
+    $2 = temp;
 }
 
 ########################################
@@ -117,79 +118,79 @@
 =cut
 
 inline op set(out INT, in INT) :base_core {
-  $1 = $2;
+    $1 = $2;
 }
 
 inline op set(out INT, in NUM) :base_core {
-  $1 = (INTVAL)($2);
+    $1 = (INTVAL)($2);
 }
 
 inline op set(out INT, in STR) :base_core {
-  $1 = Parrot_str_to_int(interp, $2);
+    $1 = Parrot_str_to_int(interp, $2);
 }
 
 inline op set(out NUM, in NUM) :base_core {
-  $1 = $2;
+    $1 = $2;
 }
 
 inline op set(out NUM, in INT) :base_core {
-  $1 = (FLOATVAL)$2;
+    $1 = (FLOATVAL)$2;
 }
 
 inline op set(out NUM, in STR) :base_core {
-  $1 = Parrot_str_to_num(interp, $2);
+    $1 = Parrot_str_to_num(interp, $2);
 }
 
 inline op set(out NUM, invar PMC) :base_core {
-  $1 = VTABLE_get_number(interp, $2);
+    $1 = VTABLE_get_number(interp, $2);
 }
 
 inline op set(out STR, invar PMC) :base_core {
-  $1 = VTABLE_get_string(interp, $2);
+    $1 = VTABLE_get_string(interp, $2);
 }
 
 inline op set(out STR, invar STR) :base_core {
-  $1 = $2;
+    $1 = $2;
 }
 
 inline op set(out STR, inconst STR) :base_core {
-  $1 = Parrot_str_copy(interp, $2);
+    $1 = Parrot_str_copy(interp, $2);
 }
 
 inline op set(out STR, in INT) :base_core {
-  $1 = Parrot_str_from_int(interp, $2);
+    $1 = Parrot_str_from_int(interp, $2);
 }
 
 inline op set(out STR, in NUM) :base_core {
-  $1 = Parrot_str_from_num(interp, $2);
+    $1 = Parrot_str_from_num(interp, $2);
 }
 
 inline op set(out PMC, inconst PMC) :base_core {
-  $1 = $2;
+    $1 = $2;
 }
 
 inline op set(out PMC, invar PMC) :base_core {
-  $1 = $2;
+    $1 = $2;
 }
 
 inline op set(invar PMC, in INT) :base_core {
-  VTABLE_set_integer_native(interp, $1, $2);
+    VTABLE_set_integer_native(interp, $1, $2);
 }
 
 inline op set(invar PMC, in NUM) :base_core {
-  VTABLE_set_number_native(interp, $1, $2);
+    VTABLE_set_number_native(interp, $1, $2);
 }
 
 inline op set(invar PMC, invar STR) :base_core {
-  VTABLE_set_string_native(interp, $1, $2);
+    VTABLE_set_string_native(interp, $1, $2);
 }
 
 inline op set(invar PMC, inconst STR) :base_core {
-  VTABLE_set_string_native(interp, $1,
-    Parrot_str_copy(interp, $2));
+    VTABLE_set_string_native(interp, $1,
+        Parrot_str_copy(interp, $2));
 }
 inline op set(out INT, invar PMC) :base_core {
-  $1 = VTABLE_get_integer(interp, $2);
+    $1 = VTABLE_get_integer(interp, $2);
 }
 
 =back
@@ -230,31 +231,31 @@
 =cut
 
 inline op assign(invar PMC, invar PMC) :base_core {
-  VTABLE_assign_pmc(interp, $1, $2);
+    VTABLE_assign_pmc(interp, $1, $2);
 }
 
 inline op assign(invar PMC, in INT) :base_core {
-  VTABLE_set_integer_native(interp, $1, $2);
+    VTABLE_set_integer_native(interp, $1, $2);
 }
 
 inline op assign(invar PMC, in NUM) :base_core {
-  VTABLE_set_number_native(interp, $1, $2);
+    VTABLE_set_number_native(interp, $1, $2);
 }
 
 inline op assign(invar PMC, in STR) :base_core {
-  VTABLE_assign_string_native(interp, $1, $2);
+    VTABLE_assign_string_native(interp, $1, $2);
 }
 
 inline op assign(out STR, in STR) :base_core {
-  $1 = Parrot_str_set(interp, $1, $2);
+    $1 = Parrot_str_set(interp, $1, $2);
 }
 
 inline op setref(invar PMC, invar PMC) :base_core {
-  VTABLE_set_pmc(interp, $1, $2);
+    VTABLE_set_pmc(interp, $1, $2);
 }
 
 inline op deref(out PMC, invar PMC) :base_ref {
-  $1 = VTABLE_get_pmc(interp, $2);
+    $1 = VTABLE_get_pmc(interp, $2);
 }
 
 =back
@@ -470,7 +471,7 @@
 =cut
 
 inline op clone(out PMC, invar PMC) :base_mem {
-  $1 = VTABLE_clone(interp, $2);
+    $1 = VTABLE_clone(interp, $2);
 }
 
 =item B<clone>(out PMC, invar PMC, in PMC)
@@ -480,7 +481,7 @@
 =cut
 
 inline op clone(out PMC, invar PMC, in PMC) :base_mem {
-  $1 = VTABLE_clone_pmc(interp, $2, $3);
+    $1 = VTABLE_clone_pmc(interp, $2, $3);
 }
 
 =item B<copy>(inout PMC, invar PMC)
@@ -502,8 +503,7 @@
         PMC   * const meta  = VTABLE_getprops(interp, $1);
 
         /* avoid leaks and unreachable memory by destroying the destination PMC */
-        if (PObj_active_destroy_TEST($1))
-            VTABLE_destroy(interp, $1);
+        Parrot_pmc_destroy(interp, $1);
 
         /* the source PMC knows how to clone itself, but we must reuse the
          * destination header */
@@ -511,8 +511,9 @@
 
         /* don't let the clone's destruction destroy the destination's data */
         PObj_active_destroy_CLEAR(clone);
-        if (PObj_is_PMC_EXT_TEST(clone))
-            clone->pmc_ext = NULL;
+        PMC_data(clone)        = NULL;
+        PMC_sync(clone)        = NULL;
+        PMC_metadata(clone)    = NULL;
 
         /* Restore metadata. */
         if (!PMC_IS_NULL(meta)) {
@@ -559,19 +560,19 @@
 =cut
 
 inline op null(out STR) :base_core {
-  $1 = NULL;
+    $1 = NULL;
 }
 
 inline op null(out INT) :base_core {
-  $1 = 0;
+    $1 = 0;
 }
 
 inline op null(out PMC) :base_core {
-  $1 = PMCNULL;
+    $1 = PMCNULL;
 }
 
 inline op null(out NUM) :base_core {
-  $1 = 0;
+    $1 = 0;
 }
 
 ########################################
@@ -593,19 +594,19 @@
 =cut
 
 inline op cleari() :base_core {
-  Parrot_clear_i(interp);
+    Parrot_clear_i(interp);
 }
 
 inline op clearn() :base_core {
-  Parrot_clear_n(interp);
+    Parrot_clear_n(interp);
 }
 
 inline op clears() :base_core {
-  Parrot_clear_s(interp);
+    Parrot_clear_s(interp);
 }
 
 inline op clearp() :base_core {
-  Parrot_clear_p(interp);
+    Parrot_clear_p(interp);
 }
 
 =back

Modified: branches/orderedhash_revamp/src/ops/string.ops
==============================================================================
--- branches/orderedhash_revamp/src/ops/string.ops	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/ops/string.ops	Sat Jan 23 01:49:53 2010	(r43541)
@@ -3,8 +3,6 @@
 ** string.ops
 */
 
-VERSION = PARROT_VERSION;
-
 =head1 NAME
 
 string.ops - String Opcodes
@@ -104,11 +102,11 @@
 }
 
 inline op concat(invar PMC, invar PMC) :base_core {
-      VTABLE_i_concatenate(interp, $1, $2);
+    VTABLE_i_concatenate(interp, $1, $2);
 }
 
 inline op concat(invar PMC, in STR) :base_core {
-      VTABLE_i_concatenate_str(interp, $1, $2);
+    VTABLE_i_concatenate_str(interp, $1, $2);
 }
 
 inline op concat(out STR, in STR, in STR) :base_mem {
@@ -116,11 +114,11 @@
 }
 
 inline op concat(invar PMC, invar PMC, in STR) :base_core {
-      $1 = VTABLE_concatenate_str(interp, $2, $3, $1);
+    $1 = VTABLE_concatenate_str(interp, $2, $3, $1);
 }
 
 inline op concat(invar PMC, invar PMC, invar PMC) :base_core {
-      $1 = VTABLE_concatenate(interp, $2, $3, $1);
+    $1 = VTABLE_concatenate(interp, $2, $3, $1);
 }
 
 =item B<repeat>(out STR, in STR, in INT)
@@ -151,7 +149,7 @@
                 "Cannot repeat with negative arg");
         goto ADDRESS(handler);
     }
-      $1 = VTABLE_repeat_int(interp, $2, $3, $1);
+    $1 = VTABLE_repeat_int(interp, $2, $3, $1);
 }
 
 inline op repeat(invar PMC, invar PMC, invar PMC) :base_core {
@@ -161,7 +159,7 @@
                 "Cannot repeat with negative arg");
         goto ADDRESS(handler);
     }
-      $1 = VTABLE_repeat(interp, $2, $3, $1);
+    $1 = VTABLE_repeat(interp, $2, $3, $1);
 }
 
 =item B<repeat>(invar PMC, in INT)
@@ -174,11 +172,11 @@
 =cut
 
 inline op repeat(invar PMC, in INT) :base_core {
-      VTABLE_i_repeat_int(interp, $1, $2);
+    VTABLE_i_repeat_int(interp, $1, $2);
 }
 
 inline op repeat(invar PMC, invar PMC) :base_core {
-      VTABLE_i_repeat(interp, $1, $2);
+    VTABLE_i_repeat(interp, $1, $2);
 }
 
 
@@ -349,7 +347,7 @@
 =cut
 
 inline op new(out STR) :base_mem {
-  $1 = Parrot_str_new_noinit(interp, enum_stringrep_one, 0);
+    $1 = Parrot_str_new_noinit(interp, enum_stringrep_one, 0);
 }
 
 inline op new(out STR, in INT) :base_mem {
@@ -387,31 +385,31 @@
         $1 = 0;
     else {
         switch ($3) {
-            case STRINGINFO_HEADER:
-                $1 = PTR2UINTVAL($2);
-                break;
-            case STRINGINFO_STRSTART:
-                $1 = PTR2UINTVAL($2->strstart);
-                break;
-            case STRINGINFO_BUFLEN:
-                $1 = PObj_buflen($2);
-                break;
-            case STRINGINFO_FLAGS:
-                $1 = PObj_get_FLAGS($2);
-                break;
-            case STRINGINFO_BUFUSED:
-                $1 = $2->bufused;
-                break;
-            case STRINGINFO_STRLEN:
-                $1 = $2->strlen;
-                break;
-            default:
-                {
-                    opcode_t *handler = Parrot_ex_throw_from_op_args(interp, NULL,
-                        EXCEPTION_INVALID_OPERATION,
-                        "stringinfo: unknown info type: %d", $3);
-                    goto ADDRESS(handler);
-                }
+          case STRINGINFO_HEADER:
+            $1 = PTR2UINTVAL($2);
+            break;
+          case STRINGINFO_STRSTART:
+            $1 = PTR2UINTVAL($2->strstart);
+            break;
+          case STRINGINFO_BUFLEN:
+            $1 = Buffer_buflen($2);
+            break;
+          case STRINGINFO_FLAGS:
+            $1 = PObj_get_FLAGS($2);
+            break;
+          case STRINGINFO_BUFUSED:
+            $1 = $2->bufused;
+            break;
+          case STRINGINFO_STRLEN:
+            $1 = $2->strlen;
+            break;
+          default:
+            {
+                opcode_t *handler = Parrot_ex_throw_from_op_args(interp, NULL,
+                    EXCEPTION_INVALID_OPERATION,
+                    "stringinfo: unknown info type: %d", $3);
+                goto ADDRESS(handler);
+            }
         }
     }
 }
@@ -583,7 +581,7 @@
 =cut
 
 op encoding(out INT, in STR) :base_core {
-  $1 = Parrot_encoding_number_of_str(interp, $2);
+    $1 = Parrot_encoding_number_of_str(interp, $2);
 }
 
 op encodingname(out STR, in INT) :base_core {

Modified: branches/orderedhash_revamp/src/ops/sys.ops
==============================================================================
--- branches/orderedhash_revamp/src/ops/sys.ops	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/ops/sys.ops	Sat Jan 23 01:49:53 2010	(r43541)
@@ -3,8 +3,6 @@
 ** sys.ops
 */
 
-VERSION = PARROT_VERSION;
-
 =head1 NAME
 
 sys.ops - System Interaction Opcodes
@@ -31,17 +29,21 @@
 $2 and wait for it to finish. The return status, which is very
 system-dependent, goes in $1.
 
-RT#36619: spawnw should return something less system-dependent, and more
-object-like. see RT ticket [perl #36619] for more info.
+TT #847: C<spawnw()> should itself handle splitting up command-line arguments,
+rather than depending on the shell to do so in potentially unsafe manner.
+See https://trac.parrot.org/parrot/ticket/847.
+
+TT #848: C<spawnw()> should return something less system-dependent, and more
+object-like. See https://trac.parrot.org/parrot/ticket/848.
 
 =cut
 
 inline op spawnw(out INT, in STR) {
-  $1 = Parrot_Run_OS_Command(interp, $2);
+    $1 = Parrot_Run_OS_Command(interp, $2);
 }
 
 inline op spawnw(out INT, invar PMC) {
-  $1 = Parrot_Run_OS_Command_Argv(interp, $2);
+    $1 = Parrot_Run_OS_Command_Argv(interp, $2);
 }
 
 ###############################################################################
@@ -62,17 +64,17 @@
 =cut
 
 inline op err(out INT) {
-  $1 = errno;
+    $1 = errno;
 }
 
 op err(out STR) {
-  const char * const tmp = strerror(errno);
-  $1 = string_make(interp, tmp, strlen(tmp), "ascii", 0);
+    const char * const tmp = strerror(errno);
+    $1 = string_make(interp, tmp, strlen(tmp), "ascii", 0);
 }
 
 op err(out STR, in INT) {
-  const char * const tmp = strerror($2);
-  $1 = string_make(interp, tmp, strlen(tmp), "ascii", 0);
+    const char * const tmp = strerror($2);
+    $1 = string_make(interp, tmp, strlen(tmp), "ascii", 0);
 }
 
 
@@ -86,7 +88,7 @@
 =cut
 
 inline op time(out INT) {
-  $1 = Parrot_intval_time();
+    $1 = Parrot_intval_time();
 }
 
 
@@ -100,7 +102,7 @@
 =cut
 
 inline op time(out NUM) {
-  $1 = Parrot_floatval_time();
+    $1 = Parrot_floatval_time();
 }
 
 ########################################
@@ -173,35 +175,35 @@
 =cut
 
 op gmtime(out STR, in INT) {
-  struct tm tm;
-  const time_t t = (time_t) $2;
-  char resultbuffer[26];
-  Parrot_gmtime_r(&t, &tm);
-  Parrot_asctime_r(&tm, resultbuffer);
-  $1 = Parrot_str_new(interp, resultbuffer, 25);
+    struct tm tm;
+    const time_t t = (time_t) $2;
+    char resultbuffer[26];
+    Parrot_gmtime_r(&t, &tm);
+    Parrot_asctime_r(&tm, resultbuffer);
+    $1 = Parrot_str_new(interp, resultbuffer, 25);
 }
 
 op localtime(out STR, in INT) {
-  struct tm tm;
-  const time_t t = (time_t) $2;
-  char resultbuffer[26];
-  Parrot_localtime_r(&t, &tm);
-  Parrot_asctime_r(&tm, resultbuffer);
-  $1 = Parrot_str_new(interp, resultbuffer, 25);
+    struct tm tm;
+    const time_t t = (time_t) $2;
+    char resultbuffer[26];
+    Parrot_localtime_r(&t, &tm);
+    Parrot_asctime_r(&tm, resultbuffer);
+    $1 = Parrot_str_new(interp, resultbuffer, 25);
 }
 
 op decodetime(out PMC, in INT) {
-  struct tm tm;
-  const time_t t = (time_t) $2;
-  Parrot_gmtime_r(&t, &tm);
-  $1 = tm_to_array(interp, &tm);
+    struct tm tm;
+    const time_t t = (time_t) $2;
+    Parrot_gmtime_r(&t, &tm);
+    $1 = tm_to_array(interp, &tm);
 }
 
 op decodelocaltime(out PMC, in INT) {
-  struct tm tm;
-  const time_t t = (time_t) $2;
-  Parrot_localtime_r(&t, &tm);
-  $1 = tm_to_array(interp, &tm);
+    struct tm tm;
+    const time_t t = (time_t) $2;
+    Parrot_localtime_r(&t, &tm);
+    $1 = tm_to_array(interp, &tm);
 }
 
 ########################################
@@ -262,11 +264,11 @@
 =cut
 
 inline op sysinfo(out STR, in INT) {
-   $1 = sysinfo_s(interp, $2);
+    $1 = sysinfo_s(interp, $2);
 }
 
 inline op sysinfo(out INT, in INT) {
-   $1 = sysinfo_i(interp, $2);
+    $1 = sysinfo_i(interp, $2);
 }
 
 ########################################
@@ -280,27 +282,27 @@
 =cut
 
 inline op sleep(in INT) :flow {
-  opcode_t *next = expr NEXT();
-  if ($1 < 0) {
-      opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, next,
-        EXCEPTION_NEG_SLEEP,
-        "Cannot go back in time");
-      goto ADDRESS(handler);
-  }
-  next = (opcode_t *)Parrot_cx_schedule_sleep(interp, (FLOATVAL) $1, next);
-  goto ADDRESS(next);
+    opcode_t *next = expr NEXT();
+    if ($1 < 0) {
+        opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, next,
+            EXCEPTION_NEG_SLEEP,
+            "Cannot go back in time");
+        goto ADDRESS(handler);
+    }
+    next = (opcode_t *)Parrot_cx_schedule_sleep(interp, (FLOATVAL) $1, next);
+    goto ADDRESS(next);
 }
 
 inline op sleep(in NUM) :flow {
-  opcode_t *next = expr NEXT();
-  if ($1 < 0.0) {
-      opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, next,
-          EXCEPTION_NEG_SLEEP,
-          "Cannot go back in time");
-      goto ADDRESS(handler);
-  }
-  next = (opcode_t *)Parrot_cx_schedule_sleep(interp, $1, next);
-  goto ADDRESS(next);
+    opcode_t *next = expr NEXT();
+    if ($1 < 0.0) {
+        opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, next,
+            EXCEPTION_NEG_SLEEP,
+            "Cannot go back in time");
+        goto ADDRESS(handler);
+    }
+    next = (opcode_t *)Parrot_cx_schedule_sleep(interp, $1, next);
+    goto ADDRESS(next);
 }
 
 ########################################

Modified: branches/orderedhash_revamp/src/ops/var.ops
==============================================================================
--- branches/orderedhash_revamp/src/ops/var.ops	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/ops/var.ops	Sat Jan 23 01:49:53 2010	(r43541)
@@ -3,8 +3,6 @@
 ** var.ops
 */
 
-VERSION = PARROT_VERSION;
-
 =head1 NAME
 
 var.ops - Variable Opcodes
@@ -39,9 +37,9 @@
 =cut
 
 op store_lex(in STR, invar PMC) {
-    Parrot_Context   * const ctx      = CONTEXT(interp);
-    STRING           * const lex_name = $1;
-    PMC              * const lex_pad  = Parrot_find_pad(interp, lex_name, ctx);
+    PMC     * const ctx      = CURRENT_CONTEXT(interp);
+    STRING  * const lex_name = $1;
+    PMC     * const lex_pad  = Parrot_find_pad(interp, lex_name, ctx);
 
     if (PMC_IS_NULL(lex_pad)) {
         opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, NULL,
@@ -54,19 +52,48 @@
 
 ########################################
 
+=item B<store_dynamic_lex>(in STR, invar PMC)
+
+Search caller lexpads for lexical symbol $1 and store object $2
+there.  Throws an exception if no caller lexpad claims the
+lexical symbol.  (To store a value in the current lexpad,
+use C<store_lex> above.)
+
+=cut
+
+op store_dynamic_lex(in STR, invar PMC) {
+    STRING  * const lex_name = $1;
+    PMC     * const ctx      =
+        Parrot_pcc_get_caller_ctx(interp, CURRENT_CONTEXT(interp));
+    PMC     * const lex_pad  =
+        PMC_IS_NULL(ctx)
+            ? PMCNULL
+            : Parrot_find_dynamic_pad(interp, lex_name, ctx);
+
+    if (PMC_IS_NULL(lex_pad)) {
+        opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, NULL,
+                EXCEPTION_LEX_NOT_FOUND,
+                "Lexical '%Ss' not found in dynamic scope", lex_name);
+        goto ADDRESS(handler);
+    }
+    VTABLE_set_pmc_keyed_str(interp, lex_pad, lex_name, $2);
+}
+
+########################################
+
 =item B<find_lex>(out PMC, in STR)
 
 Find the lexical variable named $2 and store it in $1. This
 opcode either throws an exception or returns a Null PMC for the failure case,
 depending on the implementation of the LexPad PMC. Parrot's
-standard LexPad throws and exception for non-existing names.
+standard LexPad throws an exception for non-existent names.
 
 =cut
 
 op find_lex(out PMC, in STR) {
-    Parrot_Context   * const ctx      = CONTEXT(interp);
-    STRING           * const lex_name = $2;
-    PMC              * const lex_pad  = Parrot_find_pad(interp, lex_name, ctx);
+    PMC     * const ctx      = CURRENT_CONTEXT(interp);
+    STRING  * const lex_name = $2;
+    PMC     * const lex_pad  = Parrot_find_pad(interp, lex_name, ctx);
 
     PMC * const result =
         PMC_IS_NULL(lex_pad)
@@ -83,21 +110,48 @@
 
 ########################################
 
+=item B<find_dynamic_lex>(out PMC, in STR)
+
+Search through caller lexpads for a lexical variable named $2
+and store it in $1.  Return a Null PMC if the lexical variable
+is not found.  (To search the current lexpad, use C<find_lex>
+above.)
+
+=cut
+
+op find_dynamic_lex(out PMC, in STR) {
+    STRING  * const lex_name = $2;
+    PMC     * const ctx      =
+        Parrot_pcc_get_caller_ctx(interp, CURRENT_CONTEXT(interp));
+    PMC     * const lex_pad  =
+        PMC_IS_NULL(ctx)
+            ? PMCNULL
+            : Parrot_find_dynamic_pad(interp, lex_name, ctx);
+    PMC     * const result =
+        PMC_IS_NULL(lex_pad)
+            ? PMCNULL
+            : VTABLE_get_pmc_keyed_str(interp, lex_pad, lex_name);
+    $1 = result;
+}
+
+########################################
+
 =item B<find_caller_lex>(out PMC, in STR)
 
-Like find_lex above, but searches through callers' lexical
-scopes (scanning up the dynamic chain) instead of the current
-lexical scope.  Note that the I<current> lexical scope is not
-included in the search (use C<find_lex> above for that).
+Like find_dynamic_lex above, but also searches caller's
+outer scopes in addition to the lexpads.
 
 =cut
 
 op find_caller_lex(out PMC, in STR) {
-    STRING         * const lex_name = $2;
-    Parrot_Context * ctx            = CONTEXT(interp);
-    PMC            * result         = PMCNULL;
-
-    for (ctx = ctx->caller_ctx; ctx && PMC_IS_NULL(result); ctx = ctx->caller_ctx) {
+    STRING  * const lex_name = $2;
+    PMC     * ctx            = CURRENT_CONTEXT(interp);
+    PMC     * result         = PMCNULL;
+
+    for (ctx = Parrot_pcc_get_caller_ctx(interp, ctx);
+            !PMC_IS_NULL(ctx) && PMC_IS_NULL(result);
+            ctx = Parrot_pcc_get_caller_ctx(interp, ctx))
+    {
         PMC * const lex_pad = Parrot_find_pad(interp, lex_name, ctx);
         if (!PMC_IS_NULL(lex_pad)) {
             result = VTABLE_get_pmc_keyed_str(interp, lex_pad, lex_name);
@@ -129,12 +183,12 @@
 =cut
 
 op get_namespace(out PMC) {
-    PMC * const cur_ns = CONTEXT(interp)->current_namespace;
+    PMC * const cur_ns = Parrot_pcc_get_namespace(interp, CURRENT_CONTEXT(interp));
     $1 = cur_ns;
 }
 
 op get_namespace(out PMC, in PMC) {
-    PMC * const cur_ns = CONTEXT(interp)->current_namespace;
+    PMC * const cur_ns = Parrot_pcc_get_namespace(interp, CURRENT_CONTEXT(interp));
     PMC * const ns     = Parrot_get_namespace_keyed(interp, cur_ns, $2);
 
     $1 = PMC_IS_NULL(ns) ? PMCNULL : ns;
@@ -217,12 +271,12 @@
 =cut
 
 op get_global(out PMC, in STR) {
-    PMC * const cur_ns = CONTEXT(interp)->current_namespace;
+    PMC * const cur_ns = Parrot_pcc_get_namespace(interp, CURRENT_CONTEXT(interp));
     $1 = Parrot_find_global_op(interp, cur_ns, $2, expr NEXT());
 }
 
 op get_global(out PMC, in PMC, in STR) {
-    PMC * const cur_ns = CONTEXT(interp)->current_namespace;
+    PMC * const cur_ns = Parrot_pcc_get_namespace(interp, CURRENT_CONTEXT(interp));
     if (PMC_IS_NULL(cur_ns)) {
         $1 = PMCNULL;
     }
@@ -321,12 +375,12 @@
 =cut
 
 op set_global(in STR, invar PMC) {
-    PMC * const cur_ns = CONTEXT(interp)->current_namespace;
+    PMC * const cur_ns = Parrot_pcc_get_namespace(interp, CURRENT_CONTEXT(interp));
     Parrot_set_global(interp, cur_ns, $1, $2);
 }
 
 op set_global(in PMC, in STR, invar PMC) {
-    PMC * const cur_ns = CONTEXT(interp)->current_namespace;
+    PMC * const cur_ns = Parrot_pcc_get_namespace(interp, CURRENT_CONTEXT(interp));
     PMC * const ns     = Parrot_make_namespace_keyed(interp, cur_ns, $1);
 
     Parrot_set_global(interp, ns, $2, $3);

Modified: branches/orderedhash_revamp/src/packdump.c
==============================================================================
--- branches/orderedhash_revamp/src/packdump.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/packdump.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -21,7 +21,6 @@
 */
 
 #include "parrot/parrot.h"
-#include "parrot/packfile.h"
 #include "pmc/pmc_sub.h"
 #include "pmc/pmc_key.h"
 
@@ -40,12 +39,12 @@
 static void pobj_flag_dump(PARROT_INTERP, long flags)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_PackFile_Constant_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_PackFile_Constant_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ct) \
-    || PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_pobj_flag_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+    , PARROT_ASSERT_ARG(ct) \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_pobj_flag_dump __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: static */
 
@@ -100,7 +99,6 @@
     "private7",
     "is_string",
     "is_PMC",
-    "is_PMC_EXT",
     "is_shared",
     "constant",
     "external",
@@ -112,11 +110,10 @@
     "on_free_list",
     "custom_mark",
     "custom_GC",
-    "active_destroy",
+    "custom_destroy",
     "report",
     "data_is_PMC_array",
     "need_finalize",
-    "is_special_PMC",
     "high_priority_gc",
     "needs_early_gc",
     "is_class",
@@ -165,11 +162,11 @@
 
     switch (self->type) {
 
-    case PFC_NUMBER:
+      case PFC_NUMBER:
         Parrot_io_printf(interp, "    [ 'PFC_NUMBER', %g ],\n", self->u.number);
         break;
 
-    case PFC_STRING:
+      case PFC_STRING:
         Parrot_io_printf(interp, "    [ 'PFC_STRING', {\n");
         pobj_flag_dump(interp, (long)PObj_get_FLAGS(self->u.string));
         Parrot_io_printf(interp, "        CHARSET  => %ld,\n",
@@ -183,7 +180,7 @@
         Parrot_io_printf(interp, "    } ],\n");
         break;
 
-    case PFC_KEY:
+      case PFC_KEY:
         for (i = 0, key = self->u.key; key; i++) {
             GETATTR_Key_next_key(interp, key, key);
         }
@@ -194,28 +191,18 @@
             opcode_t type = PObj_get_FLAGS(key);
 
             Parrot_io_printf(interp, "       {\n");
-            if ((type & (KEY_start_slice_FLAG|KEY_inf_slice_FLAG)) ==
-                (KEY_start_slice_FLAG|KEY_inf_slice_FLAG))
-                Parrot_io_printf(interp, "        SLICE_BITS  => PF_VT_END_INF\n");
-            if ((type & (KEY_end_slice_FLAG|KEY_inf_slice_FLAG)) ==
-                (KEY_end_slice_FLAG|KEY_inf_slice_FLAG))
-                Parrot_io_printf(interp, "        SLICE_BITS  => PF_VT_START_ZERO\n");
-            if (type & KEY_start_slice_FLAG)
-                Parrot_io_printf(interp, "        SLICE_BITS  => PF_VT_START_SLICE\n");
-            if (type & KEY_end_slice_FLAG)
-                Parrot_io_printf(interp, "        SLICE_BITS  => PF_VT_END_SLICE\n");
 
             type &= KEY_type_FLAGS;
             pobj_flag_dump(interp, (long)PObj_get_FLAGS(key));
             switch (type) {
-                case KEY_integer_FLAG:
-                    Parrot_io_printf(interp, "        TYPE        => INTEGER\n");
-                    Parrot_io_printf(interp, "        DATA        => %ld\n",
+              case KEY_integer_FLAG:
+                Parrot_io_printf(interp, "        TYPE        => INTEGER\n");
+                Parrot_io_printf(interp, "        DATA        => %ld\n",
                             VTABLE_get_integer(interp, key));
-                    Parrot_io_printf(interp, "       },\n");
-                    break;
-                case KEY_number_FLAG:
-                    {
+                Parrot_io_printf(interp, "       },\n");
+                break;
+              case KEY_number_FLAG:
+                {
                     const PackFile_Constant *detail;
                     size_t ct_index;
 
@@ -225,10 +212,10 @@
                     detail = ct->constants[ct_index];
                     Parrot_io_printf(interp, "        DATA        => %ld\n", detail->u.number);
                     Parrot_io_printf(interp, "       },\n");
-                    }
-                    break;
-                case KEY_string_FLAG:
-                    {
+                }
+                break;
+              case KEY_string_FLAG:
+                {
                     const PackFile_Constant *detail;
                     size_t ct_index;
 
@@ -236,65 +223,64 @@
                     ct_index = PackFile_find_in_const(interp, ct, key, PFC_STRING);
                     Parrot_io_printf(interp, "        PFC_OFFSET  => %ld\n", ct_index);
                     detail = ct->constants[ct_index];
-                    Parrot_io_printf(interp, "        DATA        => '%.*s'\n",
-                              (int)detail->u.string->bufused,
-                              (char *)detail->u.string->strstart);
+                    Parrot_io_printf(interp, "        DATA        => '%Ss'\n",
+                              detail->u.string);
                     Parrot_io_printf(interp, "       },\n");
-                    }
-                    break;
-                case KEY_integer_FLAG | KEY_register_FLAG:
-                    Parrot_io_printf(interp, "        TYPE        => I REGISTER\n");
-                    Parrot_io_printf(interp, "        DATA        => %ld\n",
+                }
+                break;
+              case KEY_integer_FLAG | KEY_register_FLAG:
+                Parrot_io_printf(interp, "        TYPE        => I REGISTER\n");
+                Parrot_io_printf(interp, "        DATA        => %ld\n",
                             VTABLE_get_integer(interp, key));
-                    Parrot_io_printf(interp, "       },\n");
-                    break;
-                case KEY_number_FLAG | KEY_register_FLAG:
-                    Parrot_io_printf(interp, "        TYPE        => N REGISTER\n");
-                    Parrot_io_printf(interp, "        DATA        => %ld\n",
+                Parrot_io_printf(interp, "       },\n");
+                break;
+              case KEY_number_FLAG | KEY_register_FLAG:
+                Parrot_io_printf(interp, "        TYPE        => N REGISTER\n");
+                Parrot_io_printf(interp, "        DATA        => %ld\n",
                             VTABLE_get_integer(interp, key));
-                    Parrot_io_printf(interp, "       },\n");
-                    break;
-                case KEY_string_FLAG | KEY_register_FLAG:
-                    Parrot_io_printf(interp, "        TYPE        => S REGISTER\n");
-                    Parrot_io_printf(interp, "        DATA        => %ld\n",
+                Parrot_io_printf(interp, "       },\n");
+                break;
+              case KEY_string_FLAG | KEY_register_FLAG:
+                Parrot_io_printf(interp, "        TYPE        => S REGISTER\n");
+                Parrot_io_printf(interp, "        DATA        => %ld\n",
                             VTABLE_get_integer(interp, key));
-                    Parrot_io_printf(interp, "       },\n");
-                    break;
-                case KEY_pmc_FLAG | KEY_register_FLAG:
-                    Parrot_io_printf(interp, "        TYPE        => P REGISTER\n");
-                    Parrot_io_printf(interp, "        DATA        => %ld\n",
+                Parrot_io_printf(interp, "       },\n");
+                break;
+              case KEY_pmc_FLAG | KEY_register_FLAG:
+                Parrot_io_printf(interp, "        TYPE        => P REGISTER\n");
+                Parrot_io_printf(interp, "        DATA        => %ld\n",
                             VTABLE_get_integer(interp, key));
-                    Parrot_io_printf(interp, "       },\n");
-                    break;
-                default:
-                    Parrot_io_eprintf(NULL, "PackFile_Constant_pack: "
+                Parrot_io_printf(interp, "       },\n");
+                break;
+              default:
+                Parrot_io_eprintf(NULL, "PackFile_Constant_pack: "
                             "unsupported constant type\n");
-                    Parrot_exit(interp, 1);
+                Parrot_exit(interp, 1);
             }
             GETATTR_Key_next_key(interp, key, key);
         }
         Parrot_io_printf(interp, "    ],\n");
         break;
-    case PFC_PMC:
+      case PFC_PMC:
         Parrot_io_printf(interp, "    [ 'PFC_PMC', {\n");
         {
             PMC * const pmc = self->u.key;
-            Parrot_sub *sub;
+            Parrot_Sub_attributes *sub;
             STRING * const null = Parrot_str_new_constant(interp, "(null)");
             STRING *namespace_description;
 
             pobj_flag_dump(interp, (long)PObj_get_FLAGS(pmc));
             switch (pmc->vtable->base_type) {
-                case enum_class_FixedBooleanArray:
-                case enum_class_FixedFloatArray:
-                case enum_class_FixedPMCArray:
-                case enum_class_FixedStringArray:
-                case enum_class_ResizableBooleanArray:
-                case enum_class_ResizableIntegerArray:
-                case enum_class_ResizableFloatArray:
-                case enum_class_ResizablePMCArray:
-                case enum_class_ResizableStringArray:
-                    {
+              case enum_class_FixedBooleanArray:
+              case enum_class_FixedFloatArray:
+              case enum_class_FixedPMCArray:
+              case enum_class_FixedStringArray:
+              case enum_class_ResizableBooleanArray:
+              case enum_class_ResizableIntegerArray:
+              case enum_class_ResizableFloatArray:
+              case enum_class_ResizablePMCArray:
+              case enum_class_ResizableStringArray:
+                {
                     const int n = VTABLE_get_integer(interp, pmc);
                     STRING* const out_buffer = VTABLE_get_repr(interp, pmc);
                     Parrot_io_printf(interp,
@@ -304,34 +290,34 @@
                             pmc->vtable->whoami,
                             n,
                             out_buffer);
-                    }
-                    break;
-                case enum_class_Sub:
-                case enum_class_Coroutine:
-                    PMC_get_sub(interp, pmc, sub);
-                    if (sub->namespace_name) {
-                        switch (sub->namespace_name->vtable->base_type) {
-                            case enum_class_String:
-                                namespace_description = Parrot_str_new(interp, "'", 1);
-                                namespace_description = Parrot_str_append(interp,
+                }
+                break;
+              case enum_class_Sub:
+              case enum_class_Coroutine:
+                PMC_get_sub(interp, pmc, sub);
+                if (sub->namespace_name) {
+                    switch (sub->namespace_name->vtable->base_type) {
+                      case enum_class_String:
+                        namespace_description = Parrot_str_new(interp, "'", 1);
+                        namespace_description = Parrot_str_append(interp,
                                         namespace_description,
                                         VTABLE_get_string(interp, sub->namespace_name));
-                                namespace_description = Parrot_str_append(interp,
+                        namespace_description = Parrot_str_append(interp,
                                         namespace_description,
                                         Parrot_str_new(interp, "'", 1));
-                                break;
-                            case enum_class_Key:
-                                namespace_description =
+                        break;
+                      case enum_class_Key:
+                        namespace_description =
                                     key_set_to_string(interp, sub->namespace_name);
-                                break;
-                            default:
-                                namespace_description = sub->namespace_name->vtable->whoami;
-                        }
+                        break;
+                      default:
+                        namespace_description = sub->namespace_name->vtable->whoami;
                     }
-                    else {
-                        namespace_description = null;
-                    }
-                    Parrot_io_printf(interp,
+                }
+                else {
+                    namespace_description = null;
+                }
+                Parrot_io_printf(interp,
                             "\tclass => %Ss,\n"
                             "\tstart_offs => %d,\n"
                             "\tend_offs => %d,\n"
@@ -350,23 +336,23 @@
                             sub->ns_entry_name,
                             namespace_description,
                             sub->HLL_id);
-                    break;
-                case enum_class_FixedIntegerArray:
-                    Parrot_io_printf(interp,
+                break;
+              case enum_class_FixedIntegerArray:
+                Parrot_io_printf(interp,
                             "\tclass => %Ss,\n"
                             "\trepr => '%Ss'\n",
                             pmc->vtable->whoami,
                             VTABLE_get_repr(interp, pmc));
-                    break;
-                default:
-                    Parrot_io_printf(interp, "\tno dump info for PMC %ld %Ss\n",
+                break;
+              default:
+                Parrot_io_printf(interp, "\tno dump info for PMC %ld %Ss\n",
                             pmc->vtable->base_type, pmc->vtable->whoami);
-                    Parrot_io_printf(interp, "\tclass => %Ss,\n", pmc->vtable->whoami);
+                Parrot_io_printf(interp, "\tclass => %Ss,\n", pmc->vtable->whoami);
             }
         }
         Parrot_io_printf(interp, "    } ],\n");
         break;
-    default:
+      default:
         Parrot_io_printf(interp, "    [ 'PFC_\?\?\?', type '0x%x' ],\n",
                 self->type);
         break;
@@ -393,18 +379,18 @@
     for (i = 0; i < ft->fixup_count; i++) {
         Parrot_io_printf(interp, "\t#%d\n", (int) i);
         switch (ft->fixups[i]->type) {
-            case enum_fixup_label:
-            case enum_fixup_sub:
-                Parrot_io_printf(interp,
+          case enum_fixup_label:
+          case enum_fixup_sub:
+            Parrot_io_printf(interp,
                         "\ttype => %d offs => %8d name => '%s',\n",
                         (int)ft->fixups[i]->type,
                         (int)ft->fixups[i]->offset,
                         ft->fixups[i]->name);
-                    break;
-            default:
-                Parrot_io_printf(interp, "\ttype => %d ???,\n",
+            break;
+          default:
+            Parrot_io_printf(interp, "\ttype => %d ???,\n",
                         (int) ft->fixups[i]->type);
-                break;
+            break;
         }
     }
 }

Modified: branches/orderedhash_revamp/src/packfile.c
==============================================================================
--- branches/orderedhash_revamp/src/packfile.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/packfile.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -10,14 +10,14 @@
 
 =head1 DESCRIPTION
 
-=head2 PackFile Manipulation Functions
-
 This file contains all the functions required for the processing of the
 structure of a PackFile. It is not intended to understand the byte code
 stream itself, but merely to dissect and reconstruct data from the
 various segments. See F<docs/pdds/pdd13_bytecode.pod> for information
 about the structure of the frozen bytecode.
 
+=head2 PackFile Manipulation Functions
+
 =over 4
 
 =cut
@@ -26,12 +26,14 @@
 
 #include "parrot/parrot.h"
 #include "parrot/embed.h"
+#include "parrot/extend.h"
 #include "parrot/packfile.h"
-#include "jit.h"
+#include "parrot/runcore_api.h"
 #include "../compilers/imcc/imc.h"
 #include "packfile.str"
 #include "pmc/pmc_sub.h"
 #include "pmc/pmc_key.h"
+#include "pmc/pmc_callcontext.h"
 
 /* HEADERIZER HFILE: include/parrot/packfile.h */
 
@@ -47,7 +49,7 @@
 PARROT_CANNOT_RETURN_NULL
 static PackFile_Segment * byte_code_new(SHIM_INTERP,
     SHIM(PackFile *pf),
-    SHIM(const char *name),
+    SHIM(STRING *name),
     SHIM(int add));
 
 PARROT_WARN_UNUSED_RESULT
@@ -72,7 +74,7 @@
 PARROT_CANNOT_RETURN_NULL
 static PackFile_Segment * const_new(SHIM_INTERP,
     SHIM(PackFile *pf),
-    SHIM(const char *name),
+    SHIM(STRING *name),
     SHIM(int add));
 
 PARROT_WARN_UNUSED_RESULT
@@ -80,8 +82,8 @@
 static PackFile_Segment * create_seg(PARROT_INTERP,
     ARGMOD(PackFile_Directory *dir),
     pack_file_types t,
-    ARGIN(const char *name),
-    ARGIN(const char *file_name),
+    ARGIN(STRING *name),
+    ARGIN(STRING *file_name),
     int add)
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
@@ -132,7 +134,7 @@
 PARROT_CANNOT_RETURN_NULL
 static PackFile_Segment * directory_new(SHIM_INTERP,
     SHIM(PackFile *pf),
-    SHIM(const char *name),
+    SHIM(STRING *name),
     SHIM(int add));
 
 PARROT_WARN_UNUSED_RESULT
@@ -210,7 +212,7 @@
 PARROT_CANNOT_RETURN_NULL
 static PackFile_Segment * fixup_new(SHIM_INTERP,
     SHIM(PackFile *pf),
-    SHIM(const char *name),
+    SHIM(STRING *name),
     SHIM(int add));
 
 PARROT_WARN_UNUSED_RESULT
@@ -278,7 +280,7 @@
 PARROT_CANNOT_RETURN_NULL
 static PackFile_Segment * pf_debug_new(SHIM_INTERP,
     SHIM(PackFile *pf),
-    SHIM(const char *name),
+    SHIM(STRING *name),
     SHIM(int add));
 
 PARROT_WARN_UNUSED_RESULT
@@ -316,13 +318,14 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-static void segment_init(
+static void segment_init(PARROT_INTERP,
     ARGOUT(PackFile_Segment *self),
     ARGIN(PackFile *pf),
-    ARGIN(const char *name))
+    ARGIN(STRING *name))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         __attribute__nonnull__(3)
+        __attribute__nonnull__(4)
         FUNC_MODIFIES(*self);
 
 static void sort_segs(ARGMOD(PackFile_Directory *dir))
@@ -335,136 +338,133 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(3);
 
-#define ASSERT_ARGS_byte_code_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_byte_code_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_byte_code_new __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_clone_constant __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_byte_code_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_clone_constant __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(old_const)
-#define ASSERT_ARGS_compile_or_load_file __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(old_const))
+#define ASSERT_ARGS_compile_or_load_file __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(path)
-#define ASSERT_ARGS_const_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(path))
+#define ASSERT_ARGS_const_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_const_new __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_create_seg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_const_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_create_seg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(dir) \
-    || PARROT_ASSERT_ARG(name) \
-    || PARROT_ASSERT_ARG(file_name)
-#define ASSERT_ARGS_default_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_default_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(dir) \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(file_name))
+#define ASSERT_ARGS_default_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_default_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_default_pack __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_default_pack __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(self) \
-    || PARROT_ASSERT_ARG(dest)
-#define ASSERT_ARGS_default_packed_size __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_default_unpack __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(dest))
+#define ASSERT_ARGS_default_packed_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_default_unpack __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(self) \
-    || PARROT_ASSERT_ARG(cursor)
-#define ASSERT_ARGS_directory_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(cursor))
+#define ASSERT_ARGS_directory_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_directory_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_directory_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_directory_new __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_directory_pack __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_directory_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_directory_pack __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self) \
-    || PARROT_ASSERT_ARG(cursor)
-#define ASSERT_ARGS_directory_packed_size __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(cursor))
+#define ASSERT_ARGS_directory_packed_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_directory_unpack __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_directory_unpack __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(segp) \
-    || PARROT_ASSERT_ARG(cursor)
-#define ASSERT_ARGS_do_1_sub_pragma __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(segp) \
+    , PARROT_ASSERT_ARG(cursor))
+#define ASSERT_ARGS_do_1_sub_pragma __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub_pmc)
-#define ASSERT_ARGS_find_const_iter __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(sub_pmc))
+#define ASSERT_ARGS_find_const_iter __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(seg)
-#define ASSERT_ARGS_find_constants __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(seg))
+#define ASSERT_ARGS_find_constants __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ct)
-#define ASSERT_ARGS_find_fixup __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(ct))
+#define ASSERT_ARGS_find_fixup __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(ft) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_find_fixup_iter __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_find_fixup_iter __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(seg) \
-    || PARROT_ASSERT_ARG(user_data)
-#define ASSERT_ARGS_fixup_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(seg) \
+    , PARROT_ASSERT_ARG(user_data))
+#define ASSERT_ARGS_fixup_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_fixup_new __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_fixup_pack __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_fixup_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_fixup_pack __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self) \
-    || PARROT_ASSERT_ARG(cursor)
-#define ASSERT_ARGS_fixup_packed_size __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(cursor))
+#define ASSERT_ARGS_fixup_packed_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_fixup_unpack __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_fixup_unpack __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(seg) \
-    || PARROT_ASSERT_ARG(cursor)
-#define ASSERT_ARGS_make_annotation_value_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(seg) \
+    , PARROT_ASSERT_ARG(cursor))
+#define ASSERT_ARGS_make_annotation_value_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_make_code_pointers __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(seg)
-#define ASSERT_ARGS_mark_1_seg __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_make_code_pointers __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(seg))
+#define ASSERT_ARGS_mark_1_seg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ct)
-#define ASSERT_ARGS_PackFile_append_pbc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_PackFile_set_header __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(header)
-#define ASSERT_ARGS_pf_debug_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_pf_debug_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(ct))
+#define ASSERT_ARGS_PackFile_append_pbc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_PackFile_set_header __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(header))
+#define ASSERT_ARGS_pf_debug_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_pf_debug_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_pf_debug_new __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_pf_debug_pack __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_pf_debug_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_pf_debug_pack __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(self) \
-    || PARROT_ASSERT_ARG(cursor)
-#define ASSERT_ARGS_pf_debug_packed_size __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_pf_debug_unpack __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(cursor))
+#define ASSERT_ARGS_pf_debug_packed_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(self))
+#define ASSERT_ARGS_pf_debug_unpack __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self) \
-    || PARROT_ASSERT_ARG(cursor)
-#define ASSERT_ARGS_pf_register_standard_funcs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(cursor))
+#define ASSERT_ARGS_pf_register_standard_funcs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pf)
-#define ASSERT_ARGS_run_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(pf))
+#define ASSERT_ARGS_run_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub_pmc)
-#define ASSERT_ARGS_segment_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(self) \
-    || PARROT_ASSERT_ARG(pf) \
-    || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_sort_segs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(dir)
-#define ASSERT_ARGS_sub_pragma __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(sub_pmc))
+#define ASSERT_ARGS_segment_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(pf) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_sort_segs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(dir))
+#define ASSERT_ARGS_sub_pragma __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub_pmc)
+    , PARROT_ASSERT_ARG(sub_pmc))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
-#if EXEC_CAPABLE
-    extern int Parrot_exec_run;
-#endif
-
 /* offset not in ptr diff, but in byte */
 #define OFFS(pf, cursor) ((pf) ? ((const char *)(cursor) - (const char *)((pf)->src)) : 0)
 /**
@@ -530,7 +530,7 @@
     if (pf->is_mmap_ped) {
         DECL_CONST_CAST;
         /* Cast the result to void to avoid a warning with
-         * some not-so-standard mmap headers, see RT #56110
+         * some not-so-standard mmap headers
          */
         munmap((void *)PARROT_const_cast(opcode_t *, pf->src), pf->size);
     }
@@ -564,32 +564,30 @@
     PackFile * const pf = seg->pf;
 
     switch (seg->type) {
-        case PF_BYTEC_SEG:
-            if (!pf->cur_cs)
-                pf->cur_cs = (PackFile_ByteCode *)seg;
-            break;
-        case PF_FIXUP_SEG:
-            if (!pf->cur_cs->fixups) {
-                pf->cur_cs->fixups       = (PackFile_FixupTable *)seg;
-                pf->cur_cs->fixups->code = pf->cur_cs;
-            }
-            break;
-        case PF_CONST_SEG:
-            if (!pf->cur_cs->const_table) {
-                pf->cur_cs->const_table       = (PackFile_ConstTable *)seg;
-                pf->cur_cs->const_table->code = pf->cur_cs;
-            }
-            break;
-        case PF_UNKNOWN_SEG:
-            if (memcmp(seg->name, "PIC_idx", 7) == 0)
-                pf->cur_cs->pic_index = seg;
-            break;
-        case PF_DEBUG_SEG:
-            pf->cur_cs->debugs       = (PackFile_Debug *)seg;
-            pf->cur_cs->debugs->code = pf->cur_cs;
-            break;
-        default:
-            break;
+      case PF_BYTEC_SEG:
+        if (!pf->cur_cs)
+            pf->cur_cs = (PackFile_ByteCode *)seg;
+        break;
+      case PF_FIXUP_SEG:
+        if (!pf->cur_cs->fixups) {
+            pf->cur_cs->fixups       = (PackFile_FixupTable *)seg;
+            pf->cur_cs->fixups->code = pf->cur_cs;
+        }
+        break;
+      case PF_CONST_SEG:
+        if (!pf->cur_cs->const_table) {
+            pf->cur_cs->const_table       = (PackFile_ConstTable *)seg;
+            pf->cur_cs->const_table->code = pf->cur_cs;
+        }
+        break;
+      case PF_UNKNOWN_SEG:
+        break;
+      case PF_DEBUG_SEG:
+        pf->cur_cs->debugs       = (PackFile_Debug *)seg;
+        pf->cur_cs->debugs->code = pf->cur_cs;
+        break;
+      default:
+        break;
     }
 }
 
@@ -618,7 +616,7 @@
      * These casts are a quick fix to allow parrot build with c++,
      * a refactor of the macros will be a cleaner solution.  */
     DECL_CONST_CAST;
-    Parrot_sub *sub;
+    Parrot_Sub_attributes *sub;
     int         todo    = 0;
     const int   pragmas = PObj_get_FLAGS(sub_pmc) &  SUB_FLAG_PF_MASK
                                                   & ~SUB_FLAG_IS_OUTER;
@@ -627,25 +625,25 @@
         return 0;
 
     switch (action) {
-        case PBC_PBC:
-        case PBC_MAIN:
-            /* denote MAIN entry in first loaded PASM */
-            if (interp->resume_flag & RESUME_INITIAL)
-                todo = 1;
-
-            /* :init functions need to be called at MAIN time, so return 1 */
-            /* symreg.h:P_INIT */
-            if (Sub_comp_INIT_TEST(sub))
-                todo = 1;
-
-            break;
-        case PBC_LOADED:
-            /* symreg.h:P_LOAD */
-            if (pragmas & SUB_FLAG_PF_LOAD)
-                todo = 1;
-            break;
-        default:
-            break;
+      case PBC_PBC:
+      case PBC_MAIN:
+        /* denote MAIN entry in first loaded PASM */
+        if (interp->resume_flag & RESUME_INITIAL)
+            todo = 1;
+
+        /* :init functions need to be called at MAIN time, so return 1 */
+        /* symreg.h:P_INIT */
+        if (Sub_comp_INIT_TEST(sub))
+            todo = 1;
+
+        break;
+      case PBC_LOADED:
+        /* symreg.h:P_LOAD */
+        if (pragmas & SUB_FLAG_PF_LOAD)
+            todo = 1;
+        break;
+      default:
+        break;
     }
 
     if (pragmas & (SUB_FLAG_PF_IMMEDIATE | SUB_FLAG_PF_POSTCOMP))
@@ -671,20 +669,20 @@
 run_sub(PARROT_INTERP, ARGIN(PMC *sub_pmc))
 {
     ASSERT_ARGS(run_sub)
-    const INTVAL old = interp->run_core;
-    PMC *retval;
+    Parrot_runcore_t *old_core = interp->run_core;
+    PMC              *retval   = PMCNULL;
 
     /* turn off JIT and prederef - both would act on the whole
      * PackFile which probably isn't worth the effort */
-    if (interp->run_core != PARROT_CGOTO_CORE
-    &&  interp->run_core != PARROT_SLOW_CORE
-    &&  interp->run_core != PARROT_FAST_CORE)
-            interp->run_core = PARROT_FAST_CORE;
+    if (PARROT_RUNCORE_JIT_OPS_TEST(interp->run_core)
+    ||  PARROT_RUNCORE_PREDEREF_OPS_TEST(interp->run_core))
+        Parrot_runcore_switch(interp, CONST_STRING(interp, "fast"));
 
-    CONTEXT(interp)->constants = interp->code->const_table->constants;
+    Parrot_pcc_set_constants(interp, CURRENT_CONTEXT(interp),
+            interp->code->const_table->constants);
 
-    retval           = (PMC *)Parrot_runops_fromc_args(interp, sub_pmc, "P");
-    interp->run_core = old;
+    Parrot_pcc_invoke_sub_from_c_args(interp, sub_pmc, "->P", &retval);
+    interp->run_core = old_core;
 
     return retval;
 }
@@ -707,78 +705,78 @@
 do_1_sub_pragma(PARROT_INTERP, ARGMOD(PMC *sub_pmc), pbc_action_enum_t action)
 {
     ASSERT_ARGS(do_1_sub_pragma)
-    Parrot_sub *sub;
+    Parrot_Sub_attributes *sub;
     PMC_get_sub(interp, sub_pmc, sub);
 
     switch (action) {
-        case PBC_IMMEDIATE:
-            /* run IMMEDIATE sub */
-            if (PObj_get_FLAGS(sub_pmc) & SUB_FLAG_PF_IMMEDIATE) {
-                void *lo_var_ptr = interp->lo_var_ptr;
-                PMC  *result;
-
-                PObj_get_FLAGS(sub_pmc) &= ~SUB_FLAG_PF_IMMEDIATE;
-                result     = run_sub(interp, sub_pmc);
-
-                /* reset initial flag so MAIN detection works
-                 * and reset lo_var_ptr to prev */
-                interp->resume_flag = RESUME_INITIAL;
-                interp->lo_var_ptr  = lo_var_ptr;
-                return result;
-            }
-            break;
-        case PBC_POSTCOMP:
-            /* run POSTCOMP sub */
-            if (PObj_get_FLAGS(sub_pmc) &   SUB_FLAG_PF_POSTCOMP) {
-                PObj_get_FLAGS(sub_pmc) &= ~SUB_FLAG_PF_POSTCOMP;
-                run_sub(interp, sub_pmc);
+      case PBC_IMMEDIATE:
+        /* run IMMEDIATE sub */
+        if (PObj_get_FLAGS(sub_pmc) & SUB_FLAG_PF_IMMEDIATE) {
+            void *lo_var_ptr = interp->lo_var_ptr;
+            PMC  *result;
+
+            PObj_get_FLAGS(sub_pmc) &= ~SUB_FLAG_PF_IMMEDIATE;
+            result     = run_sub(interp, sub_pmc);
+
+            /* reset initial flag so MAIN detection works
+             * and reset lo_var_ptr to prev */
+            interp->resume_flag = RESUME_INITIAL;
+            interp->lo_var_ptr  = lo_var_ptr;
+            return result;
+        }
+        break;
+      case PBC_POSTCOMP:
+        /* run POSTCOMP sub */
+        if (PObj_get_FLAGS(sub_pmc) &   SUB_FLAG_PF_POSTCOMP) {
+            PObj_get_FLAGS(sub_pmc) &= ~SUB_FLAG_PF_POSTCOMP;
+            run_sub(interp, sub_pmc);
 
-                /* reset initial flag so MAIN detection works */
-                interp->resume_flag = RESUME_INITIAL;
-                return NULL;
-            }
-            break;
+            /* reset initial flag so MAIN detection works */
+            interp->resume_flag = RESUME_INITIAL;
+            return NULL;
+        }
+        break;
 
-        case PBC_LOADED:
-            if (PObj_get_FLAGS(sub_pmc) &   SUB_FLAG_PF_LOAD) {
-                PObj_get_FLAGS(sub_pmc) &= ~SUB_FLAG_PF_LOAD;
-
-                /* if loaded no need for init */
-                Sub_comp_INIT_CLEAR(sub);
-                run_sub(interp, sub_pmc);
-            }
-            break;
-        default:
-            if (PObj_get_FLAGS(sub_pmc) & SUB_FLAG_PF_MAIN) {
-                if ((interp->resume_flag   &  RESUME_INITIAL)
-                &&   interp->resume_offset == 0) {
-                    void           *ptr   = VTABLE_get_pointer(interp, sub_pmc);
-                    const ptrdiff_t code  = (ptrdiff_t) sub->seg->base.data;
+      case PBC_LOADED:
+        if (PObj_get_FLAGS(sub_pmc) &   SUB_FLAG_PF_LOAD) {
+            PObj_get_FLAGS(sub_pmc) &= ~SUB_FLAG_PF_LOAD;
+
+            /* if loaded no need for init */
+            Sub_comp_INIT_CLEAR(sub);
+            run_sub(interp, sub_pmc);
+        }
+        break;
+      default:
+        if (PObj_get_FLAGS(sub_pmc) & SUB_FLAG_PF_MAIN) {
+            if ((interp->resume_flag   &  RESUME_INITIAL)
+             &&  interp->resume_offset == 0) {
+                void           *ptr   = VTABLE_get_pointer(interp, sub_pmc);
+                const ptrdiff_t code  = (ptrdiff_t) sub->seg->base.data;
 
-                    interp->resume_offset = ((ptrdiff_t)ptr - code)
-                                          / sizeof (opcode_t *);
+                interp->resume_offset = ((ptrdiff_t)ptr - code)
+                                      / sizeof (opcode_t *);
 
-                    PObj_get_FLAGS(sub_pmc)      &= ~SUB_FLAG_PF_MAIN;
-                    CONTEXT(interp)->current_sub  = sub_pmc;
-                }
-                else {
-                    Parrot_warn(interp, PARROT_WARNINGS_ALL_FLAG,
+                PObj_get_FLAGS(sub_pmc)      &= ~SUB_FLAG_PF_MAIN;
+                Parrot_pcc_set_sub(interp, CURRENT_CONTEXT(interp), sub_pmc);
+            }
+            else {
+                Parrot_warn(interp, PARROT_WARNINGS_ALL_FLAG,
                                 ":main sub not allowed\n");
-                }
             }
+        }
 
-            /* run :init tagged functions */
-            if (action == PBC_MAIN && Sub_comp_INIT_TEST(sub)) {
-                /* if loaded no need for init */
-                Sub_comp_INIT_CLEAR(sub);
+        /* run :init tagged functions */
+        if (action == PBC_MAIN && Sub_comp_INIT_TEST(sub)) {
+            /* if loaded no need for init */
+            Sub_comp_INIT_CLEAR(sub);
 
-                /* if inited no need for load */
-                PObj_get_FLAGS(sub_pmc) &= ~SUB_FLAG_PF_LOAD;
+            /* if inited no need for load */
+            PObj_get_FLAGS(sub_pmc) &= ~SUB_FLAG_PF_LOAD;
 
-                run_sub(interp, sub_pmc);
-                interp->resume_flag = RESUME_INITIAL;
-            }
-            break;
+            run_sub(interp, sub_pmc);
+            interp->resume_flag = RESUME_INITIAL;
+        }
+        break;
     }
 
     return NULL;
@@ -807,20 +805,18 @@
         PMC    * pmc;
         STRING * string;
         switch (constants[i]->type) {
-            case PFC_PMC:
-            case PFC_KEY:
-                pmc = constants[i]->u.key;
-                if (pmc)
-                    Parrot_gc_mark_PObj_alive(interp, (PObj *)pmc);
-                break;
-            case PFC_STRING:
-                string = constants[i]->u.string;
-                if (string)
-                    Parrot_gc_mark_PObj_alive(interp, (PObj *)string);
-                break;
-            default:
-                /* Do nothing. */
-                break;
+          case PFC_PMC:
+          case PFC_KEY:
+            pmc = constants[i]->u.key;
+            Parrot_gc_mark_PMC_alive(interp, pmc);
+            break;
+          case PFC_STRING:
+            string = constants[i]->u.string;
+            Parrot_gc_mark_STRING_alive(interp, string);
+            break;
+          default:
+            /* Do nothing. */
+            break;
         }
     }
 }
@@ -922,7 +918,7 @@
             {
                 /* offset is an index into const_table holding the Sub PMC */
                 PMC           *sub_pmc;
-                Parrot_sub    *sub;
+                Parrot_Sub_attributes    *sub;
                 const opcode_t ci = ft->fixups[i]->offset;
 
                 if (ci < 0 || ci >= ct->const_count)
@@ -948,10 +944,6 @@
 
                 break;
             }
-            case enum_fixup_label:
-                /* fill in current bytecode seg */
-                ft->fixups[i]->seg = self;
-                break;
             default:
                 break;
         }
@@ -989,6 +981,13 @@
     PackFile        * const pf  = self;
 #endif
 
+    if (packed_size < PACKFILE_HEADER_BYTES) {
+        Parrot_io_eprintf(NULL, "PackFile_unpack: "
+            "Buffer length %d is shorter than PACKFILE_HEADER_BYTES %d\n",
+            packed_size, PACKFILE_HEADER_BYTES);
+        return 0;
+    }
+
     self->src  = packed;
     self->size = packed_size;
 
@@ -1005,8 +1004,9 @@
     /* Ensure the bytecode version is one we can read. Currently, we only
      * support bytecode versions matching the current one.
      *
-     * tools/dev/pbc_header.pl --upd t/native_pbc/ *.pbc
-     * stamps version and fingerprint in the native tests. */
+     * tools/dev/pbc_header.pl --upd t/native_pbc/(ASTERISK).pbc
+     * stamps version and fingerprint in the native tests.
+     * NOTE: (ASTERISK) is *, we don't want to fool the C preprocessor. */
     if (header->bc_major != PARROT_PBC_MAJOR
     ||  header->bc_minor != PARROT_PBC_MINOR) {
         Parrot_io_eprintf(NULL, "PackFile_unpack: This Parrot cannot read "
@@ -1052,13 +1052,21 @@
         /* No UUID; fine, nothing more to do. */
     }
     else if (header->uuid_type == 1) {
+        if (packed_size < PACKFILE_HEADER_BYTES + header->uuid_size) {
+            Parrot_io_eprintf(NULL, "PackFile_unpack: "
+                    "Buffer length %d is shorter than PACKFILE_HEADER_BYTES + uuid_size %d\n",
+                    packed_size, PACKFILE_HEADER_BYTES + header->uuid_size);
+            return 0;
+        }
+
+
         /* Read in the UUID. We'll put it in a NULL-terminated string, just in
          * case people use it that way. */
         header->uuid_data = (unsigned char *)
             mem_sys_allocate(header->uuid_size + 1);
 
         memcpy(header->uuid_data, packed + PACKFILE_HEADER_BYTES,
-            header->uuid_size);
+                header->uuid_size);
 
         /* NULL terminate */
         header->uuid_data[header->uuid_size] = '\0';
@@ -1079,6 +1087,9 @@
     /* Set what transforms we need to do when reading the rest of the file. */
     PackFile_assign_transforms(self);
 
+    if (self->options & PFOPT_PMC_FREEZE_ONLY)
+        return cursor - packed;
+
     /* Directory format. */
     header->dir_format = PF_fetch_opcode(self, &cursor);
 
@@ -1112,7 +1123,7 @@
     && (self->need_endianize || self->need_wordsize)) {
         DECL_CONST_CAST;
         /* Cast the result to void to avoid a warning with
-         * some not-so-standard mmap headers, see RT #56110
+         * some not-so-standard mmap headers
          */
         munmap((void *)PARROT_const_cast(opcode_t *, self->src), self->size);
         self->is_mmap_ped = 0;
@@ -1188,7 +1199,7 @@
 /*
 
 =item C<PackFile_Segment * PackFile_find_segment(PARROT_INTERP,
-PackFile_Directory *dir, const char *name, int sub_dir)>
+PackFile_Directory *dir, STRING *name, int sub_dir)>
 
 Finds the segment with the name C<name> in the C<PackFile_Directory> if
 C<sub_dir> is true, searches directories recursively.  The returned segment is
@@ -1203,7 +1214,7 @@
 PARROT_CAN_RETURN_NULL
 PackFile_Segment *
 PackFile_find_segment(PARROT_INTERP, ARGIN_NULLOK(PackFile_Directory *dir),
-    ARGIN(const char *name), int sub_dir)
+    ARGIN(STRING *name), int sub_dir)
 {
     ASSERT_ARGS(PackFile_find_segment)
     if (dir) {
@@ -1213,7 +1224,7 @@
             PackFile_Segment *seg = dir->segments[i];
 
             if (seg) {
-                if (STREQ(seg->name, name))
+                if (Parrot_str_equal(interp, seg->name, name))
                     return seg;
 
                 if (sub_dir && seg->type == PF_DIR_SEG) {
@@ -1234,7 +1245,7 @@
 /*
 
 =item C<PackFile_Segment * PackFile_remove_segment_by_name(PARROT_INTERP,
-PackFile_Directory *dir, const char *name)>
+PackFile_Directory *dir, STRING *name)>
 
 Finds, removes, and returns the segment with name C<name> in the
 C<PackFile_Directory>.  The caller is responsible for destroying the segment.
@@ -1247,15 +1258,15 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
 PackFile_Segment *
-PackFile_remove_segment_by_name(SHIM_INTERP, ARGMOD(PackFile_Directory *dir),
-                                ARGIN(const char *name))
+PackFile_remove_segment_by_name(PARROT_INTERP, ARGMOD(PackFile_Directory *dir),
+                                ARGIN(STRING *name))
 {
     ASSERT_ARGS(PackFile_remove_segment_by_name)
     size_t i;
 
     for (i = 0; i < dir->num_segments; i++) {
         PackFile_Segment * const seg = dir->segments[i];
-        if (STREQ(seg->name, name)) {
+        if (Parrot_str_equal(interp, seg->name, name)) {
             dir->num_segments--;
 
             if (i != dir->num_segments) {
@@ -1402,7 +1413,7 @@
 
 /*
 
-=item C<PackFile * PackFile_new_dummy(PARROT_INTERP, const char *name)>
+=item C<PackFile * PackFile_new_dummy(PARROT_INTERP, STRING *name)>
 
 Creates a new (initial) dummy PackFile. This is necessary if the interpreter
 doesn't load any bytecode but instead uses C<Parrot_compile_string>.
@@ -1415,7 +1426,7 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
 PackFile *
-PackFile_new_dummy(PARROT_INTERP, ARGIN(const char *name))
+PackFile_new_dummy(PARROT_INTERP, ARGIN(STRING *name))
 {
     ASSERT_ARGS(PackFile_new_dummy)
 
@@ -1445,7 +1456,6 @@
                         const PackFile_funcs funcs)
 {
     ASSERT_ARGS(PackFile_funcs_register)
-    /* TODO dynamic registering */
     pf->PackFuncs[type] = funcs;
 }
 
@@ -1534,7 +1544,7 @@
 default_dump_header(PARROT_INTERP, ARGIN(const PackFile_Segment *self))
 {
     ASSERT_ARGS(default_dump_header)
-    Parrot_io_printf(interp, "%s => [ # offs 0x%x(%d)",
+    Parrot_io_printf(interp, "%Ss => [ # offs 0x%x(%d)",
             self->name, (int)self->file_offset, (int)self->file_offset);
     Parrot_io_printf(interp, " = op_count %d, itype %d, id %d, size %d, ...",
             (int)self->op_count, (int)self->itype,
@@ -1669,7 +1679,7 @@
 /*
 
 =item C<PackFile_Segment * PackFile_Segment_new_seg(PARROT_INTERP,
-PackFile_Directory *dir, UINTVAL type, const char *name, int add)>
+PackFile_Directory *dir, UINTVAL type, STRING *name, int add)>
 
 Creates a new segment in the given PackFile_Directory of the given C<type> with
 the given C<name>.  If C<add> is true, adds the segment to the directory.
@@ -1683,14 +1693,14 @@
 PARROT_CANNOT_RETURN_NULL
 PackFile_Segment *
 PackFile_Segment_new_seg(PARROT_INTERP, ARGMOD(PackFile_Directory *dir),
-        UINTVAL type, ARGIN(const char *name), int add)
+        UINTVAL type, ARGIN(STRING *name), int add)
 {
     ASSERT_ARGS(PackFile_Segment_new_seg)
     PackFile * const                  pf  = dir->base.pf;
     const PackFile_Segment_new_func_t f   = pf->PackFuncs[type].new_seg;
     PackFile_Segment * const          seg = (f)(interp, pf, name, add);
 
-    segment_init(seg, pf, name);
+    segment_init(interp, seg, pf, name);
     seg->type = type;
 
     if (add)
@@ -1703,7 +1713,7 @@
 /*
 
 =item C<static PackFile_Segment * create_seg(PARROT_INTERP, PackFile_Directory
-*dir, pack_file_types t, const char *name, const char *file_name, int add)>
+*dir, pack_file_types t, STRING *name, STRING *file_name, int add)>
 
 Creates a new PackFile_Segment for the given C<file_name>.  See
 C<PackFile_Segment_new_seg()> for the other arguments.
@@ -1716,24 +1726,21 @@
 PARROT_CANNOT_RETURN_NULL
 static PackFile_Segment *
 create_seg(PARROT_INTERP, ARGMOD(PackFile_Directory *dir), pack_file_types t,
-           ARGIN(const char *name), ARGIN(const char *file_name), int add)
+           ARGIN(STRING *name), ARGIN(STRING *file_name), int add)
 {
     ASSERT_ARGS(create_seg)
     PackFile_Segment *seg;
+    STRING           *seg_name;
 
-    const size_t len = strlen(name) + strlen(file_name) + 2;
-    char * const buf = (char *)mem_sys_allocate(len);
-
-    snprintf(buf, len, "%s_%s", name, file_name);
-    seg = PackFile_Segment_new_seg(interp, dir, t, buf, add);
-    mem_sys_free(buf);
+    seg_name = Parrot_sprintf_c(interp, "%Ss_%Ss", name, file_name);
+    seg = PackFile_Segment_new_seg(interp, dir, t, seg_name, add);
     return seg;
 }
 
 
 /*
 
-=item C<PackFile_ByteCode * PF_create_default_segs(PARROT_INTERP, const char
+=item C<PackFile_ByteCode * PF_create_default_segs(PARROT_INTERP, STRING
 *file_name, int add)>
 
 Creates the bytecode, constant, and fixup segments for C<file_name>. If C<add>
@@ -1748,7 +1755,7 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 PackFile_ByteCode *
-PF_create_default_segs(PARROT_INTERP, ARGIN(const char *file_name), int add)
+PF_create_default_segs(PARROT_INTERP, ARGIN(STRING *file_name), int add)
 {
     ASSERT_ARGS(PF_create_default_segs)
     PackFile          * const pf     = interp->initial_pf;
@@ -1768,9 +1775,6 @@
 
     cur_cs->const_table->code = cur_cs;
 
-    cur_cs->pic_index = create_seg(interp, &pf->directory,
-            PF_UNKNOWN_SEG, "PIC_idx", file_name, add);
-
     return cur_cs;
 }
 
@@ -1965,7 +1969,7 @@
 =over 4
 
 =item C<static PackFile_Segment * directory_new(PARROT_INTERP, PackFile *pf,
-const char *name, int add)>
+STRING *name, int add)>
 
 Returns a new C<PackFile_Directory> cast as a C<PackFile_Segment>.
 
@@ -1976,7 +1980,7 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 static PackFile_Segment *
-directory_new(SHIM_INTERP, SHIM(PackFile *pf), SHIM(const char *name), SHIM(int add))
+directory_new(SHIM_INTERP, SHIM(PackFile *pf), SHIM(STRING *name), SHIM(int add))
 {
     ASSERT_ARGS(directory_new)
 
@@ -2009,7 +2013,7 @@
         const PackFile_Segment * const seg = dir->segments[i];
 
         Parrot_io_printf(interp,
-                "\ttype %d\t%s\t", (int)seg->type, seg->name);
+                "\ttype %d\t%Ss\t", (int)seg->type, seg->name);
 
         Parrot_io_printf(interp,
                 " offs 0x%x(0x%x)\top_count %d\n",
@@ -2048,13 +2052,15 @@
     size_t                     i;
     int                        offs;
 
+    PARROT_ASSERT(pf);
     dir->num_segments = PF_fetch_opcode(pf, &cursor);
     TRACE_PRINTF(("directory_unpack: %ld num_segments\n", dir->num_segments));
     mem_realloc_n_typed(dir->segments, dir->num_segments, PackFile_Segment *);
 
     for (i = 0; i < dir->num_segments; i++) {
         PackFile_Segment *seg;
-        char             *name;
+        char             *buf;
+        STRING           *name;
         size_t            opcode;
 
         /* get type */
@@ -2065,12 +2071,13 @@
         TRACE_PRINTF_VAL(("Segment type %d.\n", type));
 
         /* get name */
-        name = PF_fetch_cstring(pf, &cursor);
+        buf = PF_fetch_cstring(pf, &cursor);
         TRACE_PRINTF_VAL(("Segment name \"%s\".\n", name));
 
         /* create it */
+        name = Parrot_str_new(interp, buf, strlen(buf));
         seg = PackFile_Segment_new_seg(interp, dir, type, name, 0);
-        mem_sys_free(name);
+        mem_sys_free(buf);
 
         seg->file_offset = PF_fetch_opcode(pf, &cursor);
         TRACE_PRINTF_VAL(("Segment file_offset %ld.\n", seg->file_offset));
@@ -2101,8 +2108,8 @@
         opcode = PF_fetch_opcode(pf, &pos);
 
         if (seg->op_count != opcode) {
-            fprintf(stderr,
-                     "%s: Size in directory %d doesn't match size %d "
+            Parrot_io_eprintf(interp,
+                     "%Ss: Size in directory %d doesn't match size %d "
                      "at offset 0x%x\n", seg->name, (int)seg->op_count,
                      (int)opcode, (int)seg->file_offset);
         }
@@ -2143,7 +2150,7 @@
         pos    = PackFile_Segment_unpack(interp, dir->segments[i], cursor);
 
         if (!pos) {
-            fprintf(stderr, "PackFile_unpack segment '%s' failed\n",
+            Parrot_io_eprintf(interp, "PackFile_unpack segment '%Ss' failed\n",
                     dir->segments[i]->name);
             return NULL;
         }
@@ -2168,7 +2175,7 @@
                           delta, pos, cursor));
 
         if ((size_t)delta != tmp || dir->segments[i]->op_count != tmp)
-            fprintf(stderr, "PackFile_unpack segment '%s' directory length %d "
+            Parrot_io_eprintf(interp, "PackFile_unpack segment '%Ss' directory length %d "
                     "length in file %d needed %d for unpack\n",
                     dir->segments[i]->name,
                     (int)dir->segments[i]->op_count, (int)tmp,
@@ -2197,12 +2204,24 @@
     PackFile_Directory * const dir = (PackFile_Directory *)self;
     size_t i;
 
-    for (i = 0; i < dir->num_segments; i++)
-        PackFile_Segment_destroy(interp, dir->segments[i]);
+    for (i = 0; i < dir->num_segments; i++) {
+        PackFile_Segment *segment = dir->segments[i];
+        /* Prevent repeated destruction */
+        dir->segments[i] = NULL;
+
+        /* XXX Black magic here.
+         * There are some failures that looks like a segment directory
+         * inserted into another. Until that problems gets fixed,
+         * these checks are a workaround.
+         */
+        if (segment && segment != self && segment->type != PF_DIR_SEG)
+            PackFile_Segment_destroy(interp, segment);
+    }
 
     if (dir->segments) {
         mem_sys_free(dir->segments);
         dir->segments = NULL;
+        dir->num_segments = 0;
     }
 }
 
@@ -2302,9 +2321,11 @@
     size = 1 + default_packed_size(self);
 
     for (i = 0; i < dir->num_segments; i++) {
+        char *name = Parrot_str_to_cstring(interp, dir->segments[i]->name);
         /* type, offset, size */
         size += 3;
-        size += PF_size_cstring(dir->segments[i]->name);
+        size += PF_size_cstring(name);
+        Parrot_str_free_cstring(name);
     }
 
     /* pad/align it */
@@ -2356,10 +2377,12 @@
 
     for (i = 0; i < num_segs; i++) {
         const PackFile_Segment * const seg = dir->segments[i];
+        char *name = Parrot_str_to_cstring(interp, seg->name);
         *cursor++ = seg->type;
-        cursor = PF_store_cstring(cursor, seg->name);
+        cursor = PF_store_cstring(cursor, name);
         *cursor++ = seg->file_offset;
         *cursor++ = seg->op_count;
+        Parrot_str_free_cstring(name);
     }
 
     TRACE_PRINTF_ALIGN(("-ALIGN_16: offset=0x%x src=0x%x cursor=0x%x\n",
@@ -2393,8 +2416,8 @@
 
 =over 4
 
-=item C<static void segment_init(PackFile_Segment *self, PackFile *pf, const
-char *name)>
+=item C<static void segment_init(PARROT_INTERP, PackFile_Segment *self, PackFile
+*pf, STRING *name)>
 
 Initializes the segment C<self> with the provided PackFile and the given name.
 Note that this duplicates the given name.
@@ -2404,8 +2427,8 @@
 */
 
 static void
-segment_init(ARGOUT(PackFile_Segment *self), ARGIN(PackFile *pf),
-        ARGIN(const char *name))
+segment_init(PARROT_INTERP, ARGOUT(PackFile_Segment *self), ARGIN(PackFile *pf),
+        ARGIN(STRING *name))
 {
     ASSERT_ARGS(segment_init)
     self->pf          = pf;
@@ -2416,14 +2439,14 @@
     self->size        = 0;
     self->data        = NULL;
     self->id          = 0;
-    self->name        = mem_sys_strdup(name);
+    self->name        = Parrot_str_copy(interp, name);
 }
 
 
 /*
 
 =item C<PackFile_Segment * PackFile_Segment_new(PARROT_INTERP, PackFile *pf,
-const char *name, int add)>
+STRING *name, int add)>
 
 Creates a new default section.
 
@@ -2435,7 +2458,7 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 PackFile_Segment *
-PackFile_Segment_new(SHIM_INTERP, SHIM(PackFile *pf), SHIM(const char *name), SHIM(int add))
+PackFile_Segment_new(SHIM_INTERP, SHIM(PackFile *pf), SHIM(STRING *name), SHIM(int add))
 {
     ASSERT_ARGS(PackFile_Segment_new)
     PackFile_Segment * const seg = mem_allocate_typed(PackFile_Segment);
@@ -2472,11 +2495,6 @@
         self->data = NULL;
     }
 
-    if (self->name) {
-        mem_sys_free(self->name);
-        self->name = NULL;
-    }
-
     mem_sys_free(self);
 }
 
@@ -2553,10 +2571,6 @@
     ASSERT_ARGS(byte_code_destroy)
     PackFile_ByteCode * const byte_code = (PackFile_ByteCode *)self;
 
-#ifdef HAS_JIT
-    Parrot_destroy_jit(byte_code->jit_info);
-#endif
-    parrot_PIC_destroy(byte_code);
     if (byte_code->prederef.code) {
         Parrot_free_memalign(byte_code->prederef.code);
         byte_code->prederef.code = NULL;
@@ -2569,7 +2583,6 @@
 
     byte_code->fixups      = NULL;
     byte_code->const_table = NULL;
-    byte_code->pic_index   = NULL;
     byte_code->debugs      = NULL;
 }
 
@@ -2577,10 +2590,9 @@
 /*
 
 =item C<static PackFile_Segment * byte_code_new(PARROT_INTERP, PackFile *pf,
-const char *name, int add)>
+STRING *name, int add)>
 
-Creates a new C<PackFile_ByteCode> segment.  Ignores C<pf>, C<name>, and C<add>
-are ignored.
+Creates a new C<PackFile_ByteCode> segment.  Ignores C<pf>, C<name>, and C<add>.
 
 =cut
 
@@ -2589,7 +2601,7 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 static PackFile_Segment *
-byte_code_new(SHIM_INTERP, SHIM(PackFile *pf), SHIM(const char *name), SHIM(int add))
+byte_code_new(SHIM_INTERP, SHIM(PackFile *pf), SHIM(STRING *name), SHIM(int add))
 {
     ASSERT_ARGS(byte_code_new)
     PackFile_ByteCode * const byte_code = mem_allocate_zeroed_typed(PackFile_ByteCode);
@@ -2635,7 +2647,7 @@
 /*
 
 =item C<static PackFile_Segment * pf_debug_new(PARROT_INTERP, PackFile *pf,
-const char *name, int add)>
+STRING *name, int add)>
 
 Creates and returns a new C<PackFile_Debug> segment.  Ignores C<pf>, C<name>,
 and C<add> ignored.
@@ -2647,7 +2659,7 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 static PackFile_Segment *
-pf_debug_new(SHIM_INTERP, SHIM(PackFile *pf), SHIM(const char *name), SHIM(int add))
+pf_debug_new(SHIM_INTERP, SHIM(PackFile *pf), SHIM(STRING *name), SHIM(int add))
 {
     ASSERT_ARGS(pf_debug_new)
     PackFile_Debug * const debug = mem_allocate_zeroed_typed(PackFile_Debug);
@@ -2741,7 +2753,7 @@
        name. So we can't find the bytecode seg without knowing the filename.
        But with the new scheme we can have many file names. For now, just
        base this on the name of the debug segment. */
-    char  *code_name = NULL;
+    STRING *code_name = NULL;
     size_t str_len;
 
     /* Number of mappings. */
@@ -2761,22 +2773,19 @@
     }
 
     /* find seg e.g. CODE_DB => CODE and attach it */
-    code_name              = mem_sys_strdup(debug->base.name);
-    str_len                = strlen(code_name);
-    code_name[str_len - 3] = '\0';
-    code                   = (PackFile_ByteCode *)PackFile_find_segment(interp,
-                                self->dir, code_name, 0);
+    str_len     = Parrot_str_length(interp, debug->base.name);
+    code_name   = Parrot_str_substr(interp, debug->base.name, 0, str_len - 3, NULL, 1);
+    code        = (PackFile_ByteCode *)PackFile_find_segment(interp, self->dir, code_name, 0);
 
     if (!code || code->base.type != PF_BYTEC_SEG) {
         Parrot_ex_throw_from_c_args(interp, NULL, 1,
-            "Code '%s' not found for debug segment '%s'\n",
+            "Code '%Ss' not found for debug segment '%Ss'\n",
             code_name, self->name);
     }
 
     code->debugs = debug;
     debug->code  = code;
 
-    mem_sys_free(code_name);
     return cursor;
 }
 
@@ -2813,23 +2822,6 @@
     }
 
     Parrot_io_printf(interp, "  ]\n");
-
-    j = self->data ? 0: self->file_offset + 4;
-
-    if (j % 8)
-        Parrot_io_printf(interp, "\n %04x:  ", (int) j);
-
-    for (; j < (self->data ? self->size :
-            self->file_offset + self->op_count); j++) {
-
-        if (j % 8 == 0)
-            Parrot_io_printf(interp, "\n %04x:  ", (int) j);
-
-        Parrot_io_printf(interp, "%08lx ", (unsigned long)
-                self->data ? self->data[j] : self->pf->src[j]);
-    }
-
-    Parrot_io_printf(interp, "\n]\n");
 }
 
 
@@ -2861,8 +2853,7 @@
     }
     /* create one */
     else {
-        const size_t len  = strlen(cs->base.name) + 4;
-        char * const name = (char *)mem_sys_allocate(len);
+        STRING * name;
         const int add     = (interp->code && interp->code->base.dir);
         PackFile_Directory * const dir = add
                 ? interp->code->base.dir
@@ -2870,10 +2861,9 @@
                     ? cs->base.dir
                     : &interp->initial_pf->directory;
 
-        snprintf(name, len, "%s_DB", cs->base.name);
+        name = Parrot_sprintf_c(interp, "%Ss_DB", cs->base.name);
         debug = (PackFile_Debug *)PackFile_Segment_new_seg(interp, dir,
                                     PF_DEBUG_SEG, name, add);
-        mem_sys_free(name);
 
         debug->base.data = mem_allocate_n_zeroed_typed(size, opcode_t);
         debug->code      = cs;
@@ -2905,6 +2895,19 @@
     ASSERT_ARGS(Parrot_debug_add_mapping)
     PackFile_ConstTable * const    ct         = debug->code->const_table;
     int                            insert_pos = 0;
+    opcode_t                       prev_filename_n;
+    STRING                        *filename_pstr;
+
+    /* If the previous mapping has the same filename, don't record it. */
+    if (debug->num_mappings) {
+        prev_filename_n = debug->mappings[debug->num_mappings-1]->filename;
+        filename_pstr = Parrot_str_new(interp, filename, 0);
+        if (ct->constants[prev_filename_n]->type == PFC_STRING &&
+                Parrot_str_equal(interp, filename_pstr,
+                    ct->constants[prev_filename_n]->u.string)) {
+            return;
+        }
+    }
 
     /* Allocate space for the extra entry. */
     mem_realloc_n_typed(debug->mappings, debug->num_mappings + 1,
@@ -3082,13 +3085,13 @@
     }
 
     interp->code               = new_cs;
-    CONTEXT(interp)->constants = really
+    Parrot_pcc_set_constants(interp, CURRENT_CONTEXT(interp), really
                                ? find_constants(interp, new_cs->const_table)
-                               : new_cs->const_table->constants;
+                               : new_cs->const_table->constants);
 
     /* new_cs->const_table->constants; */
-    CONTEXT(interp)->pred_offset =
-        new_cs->base.data - (opcode_t*) new_cs->prederef.code;
+    Parrot_pcc_set_pred_offset(interp, CURRENT_CONTEXT(interp),
+        new_cs->base.data - (opcode_t*) new_cs->prederef.code);
 
     if (really)
         prepare_for_run(interp);
@@ -3119,7 +3122,7 @@
     if (old_const->type == PFC_PMC
     &&  VTABLE_isa(interp, old_const->u.key, _sub)) {
         PMC        *old_sub_pmc, *new_sub_pmc;
-        Parrot_sub *old_sub,     *new_sub;
+        Parrot_Sub_attributes *old_sub,     *new_sub;
         PackFile_Constant * const ret = mem_allocate_typed(PackFile_Constant);
 
         ret->type = old_const->type;
@@ -3340,15 +3343,15 @@
         /* fixup_entry type */
         size++;
         switch (ft->fixups[i]->type) {
-            case enum_fixup_label:
-            case enum_fixup_sub:
-                size += PF_size_cstring(ft->fixups[i]->name);
-                size ++; /* offset */
-                break;
-            case enum_fixup_none:
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, 1,
+          case enum_fixup_label:
+          case enum_fixup_sub:
+            size += PF_size_cstring(ft->fixups[i]->name);
+            size ++; /* offset */
+            break;
+          case enum_fixup_none:
+            break;
+          default:
+            Parrot_ex_throw_from_c_args(interp, NULL, 1,
                     "Unknown fixup type\n");
         }
     }
@@ -3382,15 +3385,15 @@
     for (i = 0; i < ft->fixup_count; i++) {
         *cursor++ = (opcode_t) ft->fixups[i]->type;
         switch (ft->fixups[i]->type) {
-            case enum_fixup_label:
-            case enum_fixup_sub:
-                cursor    = PF_store_cstring(cursor, ft->fixups[i]->name);
-                *cursor++ = ft->fixups[i]->offset;
-                break;
-            case enum_fixup_none:
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, 1,
+          case enum_fixup_label:
+          case enum_fixup_sub:
+            cursor    = PF_store_cstring(cursor, ft->fixups[i]->name);
+            *cursor++ = ft->fixups[i]->offset;
+            break;
+          case enum_fixup_none:
+            break;
+          default:
+            Parrot_ex_throw_from_c_args(interp, NULL, 1,
                     "Unknown fixup type\n");
         }
     }
@@ -3401,8 +3404,8 @@
 
 /*
 
-=item C<static PackFile_Segment * fixup_new(PARROT_INTERP, PackFile *pf, const
-char *name, int add)>
+=item C<static PackFile_Segment * fixup_new(PARROT_INTERP, PackFile *pf, STRING
+*name, int add)>
 
 Returns a new C<PackFile_FixupTable> segment.
 
@@ -3413,7 +3416,7 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 static PackFile_Segment *
-fixup_new(SHIM_INTERP, SHIM(PackFile *pf), SHIM(const char *name), SHIM(int add))
+fixup_new(SHIM_INTERP, SHIM(PackFile *pf), SHIM(STRING *name), SHIM(int add))
 {
     ASSERT_ARGS(fixup_new)
     PackFile_FixupTable * const fixup = mem_allocate_zeroed_typed(PackFile_FixupTable);
@@ -3480,21 +3483,21 @@
         entry->type = PF_fetch_opcode(pf, &cursor);
 
         switch (entry->type) {
-            case enum_fixup_label:
-            case enum_fixup_sub:
-                entry->name   = PF_fetch_cstring(pf, &cursor);
-                entry->offset = PF_fetch_opcode(pf, &cursor);
-                TRACE_PRINTF_VAL(("PackFile_FixupTable_unpack(): type %d, "
+          case enum_fixup_label:
+          case enum_fixup_sub:
+            entry->name   = PF_fetch_cstring(pf, &cursor);
+            entry->offset = PF_fetch_opcode(pf, &cursor);
+            TRACE_PRINTF_VAL(("PackFile_FixupTable_unpack(): type %d, "
                     "name %s, offset %ld\n",
                     entry->type, entry->name, entry->offset));
-                break;
-            case enum_fixup_none:
-                break;
-            default:
-                Parrot_io_eprintf(interp,
+            break;
+          case enum_fixup_none:
+            break;
+          default:
+            Parrot_io_eprintf(interp,
                     "PackFile_FixupTable_unpack: Unknown fixup type %d!\n",
                     entry->type);
-                return NULL;
+            return NULL;
         }
     }
 
@@ -3539,7 +3542,6 @@
     self->fixups[i]->type   = type;
     self->fixups[i]->name   = mem_sys_strdup(label);
     self->fixups[i]->offset = offs;
-    self->fixups[i]->seg    = self->code;
 }
 
 
@@ -3568,7 +3570,6 @@
     for (i = 0; i < ft->fixup_count; i++) {
         if ((INTVAL)((enum_fixup_t)ft->fixups[i]->type) == type
         &&  STREQ(ft->fixups[i]->name, name)) {
-            ft->fixups[i]->seg = ft->code;
             return ft->fixups[i];
         }
     }
@@ -3689,10 +3690,6 @@
 }
 
 
-#if EXEC_CAPABLE
-PackFile_Constant *exec_const_table;
-#endif
-
 /*
 
 =item C<const opcode_t * PackFile_ConstTable_unpack(PARROT_INTERP,
@@ -3744,13 +3741,7 @@
     for (i = 0; i < self->const_count; i++) {
         TRACE_PRINTF(("PackFile_ConstTable_unpack(): Unpacking constant %ld/%ld\n",
             i, self->const_count));
-
-#if EXEC_CAPABLE
-        if (Parrot_exec_run)
-            self->constants[i] = &exec_const_table[i];
-        else
-#endif
-            self->constants[i] = PackFile_Constant_new(interp);
+        self->constants[i] = PackFile_Constant_new(interp);
 
         cursor = PackFile_Constant_unpack(interp, self, self->constants[i],
                     cursor);
@@ -3762,8 +3753,8 @@
 
 /*
 
-=item C<static PackFile_Segment * const_new(PARROT_INTERP, PackFile *pf, const
-char *name, int add)>
+=item C<static PackFile_Segment * const_new(PARROT_INTERP, PackFile *pf, STRING
+*name, int add)>
 
 Returns a new C<PackFile_ConstTable> segment.
 
@@ -3774,7 +3765,7 @@
 PARROT_MALLOC
 PARROT_CANNOT_RETURN_NULL
 static PackFile_Segment *
-const_new(SHIM_INTERP, SHIM(PackFile *pf), SHIM(const char *name), SHIM(int add))
+const_new(SHIM_INTERP, SHIM(PackFile *pf), SHIM(STRING *name), SHIM(int add))
 {
     ASSERT_ARGS(const_new)
     PackFile_ConstTable * const const_table = mem_allocate_zeroed_typed(PackFile_ConstTable);
@@ -3879,40 +3870,40 @@
     size_t  packed_size;
 
     switch (self->type) {
-        case PFC_NUMBER:
-            packed_size = PF_size_number();
-            break;
-
-        case PFC_STRING:
-            packed_size = PF_size_string(self->u.string);
-            break;
-
-        case PFC_KEY:
-            packed_size = 1;
-
-            for (component = self->u.key; component;){
-                packed_size += 2;
-                GETATTR_Key_next_key(interp, component, component);
-            }
-            break;
+      case PFC_NUMBER:
+        packed_size = PF_size_number();
+        break;
+
+      case PFC_STRING:
+        packed_size = PF_size_string(self->u.string);
+        break;
+
+      case PFC_KEY:
+        packed_size = 1;
+
+        for (component = self->u.key; component;){
+            packed_size += 2;
+            GETATTR_Key_next_key(interp, component, component);
+        }
+        break;
 
-        case PFC_PMC:
-            component = self->u.key; /* the pmc (Sub, ...) */
+      case PFC_PMC:
+        component = self->u.key; /* the pmc (Sub, ...) */
 
-            /*
-             * TODO create either
-             * a) a frozen_size freeze entry or
-             * b) change packout.c so that component size isn't needed
-             */
-            image       = Parrot_freeze(interp, component);
-            packed_size = PF_size_string(image);
-            break;
+        /*
+         * TODO create either
+         * a) a frozen_size freeze entry or
+         * b) change packout.c so that component size isn't needed
+         */
+        image       = Parrot_freeze(interp, component);
+        packed_size = PF_size_string(image);
+        break;
 
-        default:
-            Parrot_io_eprintf(NULL,
+      default:
+        Parrot_io_eprintf(NULL,
                     "Constant_packed_size: Unrecognized type '%c'!\n",
                     (char)self->type);
-            return 0;
+        return 0;
     }
 
     /* Tack on space for the initial type field */
@@ -3951,30 +3942,28 @@
                   type, (char)type));
 
     switch (type) {
-        case PFC_NUMBER:
-            self->u.number = PF_fetch_number(pf, &cursor);
-            self->type     = PFC_NUMBER;
-            break;
-
-        case PFC_STRING:
-            self->u.string = PF_fetch_string(interp, pf, &cursor);
-            self->type     = PFC_STRING;
-            break;
-
-        case PFC_KEY:
-            cursor = PackFile_Constant_unpack_key(interp, constt,
-                    self, cursor);
-            break;
-
-        case PFC_PMC:
-            cursor = PackFile_Constant_unpack_pmc(interp, constt,
-                    self, cursor);
-            break;
-        default:
-            Parrot_io_eprintf(NULL,
+      case PFC_NUMBER:
+        self->u.number = PF_fetch_number(pf, &cursor);
+        self->type     = PFC_NUMBER;
+        break;
+
+      case PFC_STRING:
+        self->u.string = PF_fetch_string(interp, pf, &cursor);
+        self->type     = PFC_STRING;
+        break;
+
+      case PFC_KEY:
+        cursor = PackFile_Constant_unpack_key(interp, constt, self, cursor);
+        break;
+
+      case PFC_PMC:
+        cursor = PackFile_Constant_unpack_pmc(interp, constt, self, cursor);
+        break;
+      default:
+        Parrot_io_eprintf(NULL,
                     "Constant_unpack: Unrecognized type '%c' during unpack!\n",
                     (char)type);
-            return NULL;
+        return NULL;
     }
 
     return cursor;
@@ -4067,11 +4056,8 @@
 
     while (components-- > 0) {
         opcode_t       type       = PF_fetch_opcode(pf, &cursor);
-        const opcode_t slice_bits = type & PF_VT_SLICE_BITS;
         opcode_t        op;
 
-        type &= ~PF_VT_SLICE_BITS;
-
         if (tail) {
             SETATTR_Key_next_key(interp, tail, constant_pmc_new(interp, pmc_enum));
             GETATTR_Key_next_key(interp, tail, tail);
@@ -4082,38 +4068,29 @@
         op = PF_fetch_opcode(pf, &cursor);
 
         switch (type) {
-            case PARROT_ARG_IC:
-                key_set_integer(interp, tail, op);
-                break;
-            case PARROT_ARG_NC:
-                key_set_number(interp, tail, constt->constants[op]->u.number);
-                break;
-            case PARROT_ARG_SC:
-                key_set_string(interp, tail, constt->constants[op]->u.string);
-                break;
-            case PARROT_ARG_I:
-                key_set_register(interp, tail, op, KEY_integer_FLAG);
-                break;
-            case PARROT_ARG_N:
-                key_set_register(interp, tail, op, KEY_number_FLAG);
-                break;
-            case PARROT_ARG_S:
-                key_set_register(interp, tail, op, KEY_string_FLAG);
-                break;
-            case PARROT_ARG_P:
-                key_set_register(interp, tail, op, KEY_pmc_FLAG);
-                break;
-            default:
-                return NULL;
-        }
-
-        if (slice_bits) {
-            if (slice_bits & PF_VT_START_SLICE)
-                PObj_get_FLAGS(tail) |= KEY_start_slice_FLAG;
-            if (slice_bits & PF_VT_END_SLICE)
-                PObj_get_FLAGS(tail) |= KEY_end_slice_FLAG;
-            if (slice_bits & (PF_VT_START_ZERO | PF_VT_END_INF))
-                PObj_get_FLAGS(tail) |= KEY_inf_slice_FLAG;
+          case PARROT_ARG_IC:
+            key_set_integer(interp, tail, op);
+            break;
+          case PARROT_ARG_NC:
+            key_set_number(interp, tail, constt->constants[op]->u.number);
+            break;
+          case PARROT_ARG_SC:
+            key_set_string(interp, tail, constt->constants[op]->u.string);
+            break;
+          case PARROT_ARG_I:
+            key_set_register(interp, tail, op, KEY_integer_FLAG);
+            break;
+          case PARROT_ARG_N:
+            key_set_register(interp, tail, op, KEY_number_FLAG);
+            break;
+          case PARROT_ARG_S:
+            key_set_register(interp, tail, op, KEY_string_FLAG);
+            break;
+          case PARROT_ARG_P:
+            key_set_register(interp, tail, op, KEY_pmc_FLAG);
+            break;
+          default:
+            return NULL;
         }
     }
 
@@ -4127,7 +4104,7 @@
 /*
 
 =item C<PackFile_Segment * PackFile_Annotations_new(PARROT_INTERP, struct
-PackFile *pf, const char *name, int add)>
+PackFile *pf, STRING *name, int add)>
 
 Creates a new annotations segment structure. Ignores the parameters C<name> and
 C<add>.
@@ -4139,7 +4116,7 @@
 PARROT_CANNOT_RETURN_NULL
 PackFile_Segment *
 PackFile_Annotations_new(SHIM_INTERP, SHIM(struct PackFile *pf),
-        SHIM(const char *name), SHIM(int add))
+        SHIM(STRING *name), SHIM(int add))
 {
     ASSERT_ARGS(PackFile_Annotations_new)
 
@@ -4288,7 +4265,7 @@
     ASSERT_ARGS(PackFile_Annotations_unpack)
     PackFile_Annotations *self = (PackFile_Annotations *)seg;
     PackFile_ByteCode    *code;
-    char                 *code_name;
+    STRING               *code_name;
 #if TRACE_PACKFILE
     PackFile * const pf  = seg->pf;
 #endif
@@ -4338,10 +4315,9 @@
     }
 
     /* Need to associate this segment with the applicable code segment. */
-    code_name              = mem_sys_strdup(self->base.name);
-    str_len                = strlen(code_name);
-    code_name[str_len - 4] = '\0';
-    code                   = (PackFile_ByteCode *)PackFile_find_segment(interp,
+    str_len     = Parrot_str_length(interp, self->base.name);
+    code_name   = Parrot_str_substr(interp, self->base.name, 0, str_len - 4, NULL, 1);
+    code        = (PackFile_ByteCode *)PackFile_find_segment(interp,
                                 self->base.dir, code_name, 0);
 
     if (!code || code->base.type != PF_BYTEC_SEG) {
@@ -4353,8 +4329,6 @@
     self->code        = code;
     code->annotations = self;
 
-    mem_sys_free(code_name);
-
     return cursor;
 }
 
@@ -4572,18 +4546,18 @@
     PMC *result;
 
     switch (type) {
-        case PF_ANNOTATION_KEY_TYPE_INT:
-            result = pmc_new(interp, enum_class_Integer);
-            VTABLE_set_integer_native(interp, result, value);
-            break;
-        case PF_ANNOTATION_KEY_TYPE_NUM:
-            result = pmc_new(interp, enum_class_Float);
-            VTABLE_set_number_native(interp, result,
+      case PF_ANNOTATION_KEY_TYPE_INT:
+        result = pmc_new(interp, enum_class_Integer);
+        VTABLE_set_integer_native(interp, result, value);
+        break;
+      case PF_ANNOTATION_KEY_TYPE_NUM:
+        result = pmc_new(interp, enum_class_Float);
+        VTABLE_set_number_native(interp, result,
                     PF_CONST(self->code, value)->u.number);
-            break;
-        default:
-            result = pmc_new(interp, enum_class_String);
-            VTABLE_set_string_native(interp, result,
+        break;
+      default:
+        result = pmc_new(interp, enum_class_String);
+        VTABLE_set_string_native(interp, result,
                     PF_CONST(self->code, value)->u.string);
     }
 
@@ -4636,10 +4610,6 @@
     for (i = 0; i < self->num_groups; i++)
         if (offset < self->groups[i]->bytecode_offset)
             break;
-
-
-    /* Check if the found file was actually bytecode (.pbc extension), or a
-     * source file (.pir or .pasm extension). */
         else
             start_entry = self->groups[i]->entries_offset;
 
@@ -4717,6 +4687,13 @@
     ASSERT_ARGS(compile_or_load_file)
     char * const filename = Parrot_str_to_cstring(interp, path);
 
+    UINTVAL regs_used[]     = { 2, 2, 2, 2 }; /* Arbitrary values */
+    const int parrot_hll_id = 0;
+    PMC * context = Parrot_push_context(interp, regs_used);
+    Parrot_pcc_set_HLL(interp, context, parrot_hll_id);
+    Parrot_pcc_set_namespace(interp, context,
+            Parrot_get_HLL_namespace(interp, parrot_hll_id));
+
     if (file_type == PARROT_RUNTIME_FT_PBC) {
         PackFile * const pf = PackFile_append_pbc(interp, filename);
         Parrot_str_free_cstring(filename);
@@ -4744,6 +4721,8 @@
             Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
                 "compiler returned NULL ByteCode '%Ss' - %Ss", path, err);
     }
+
+    Parrot_pop_context(interp);
 }
 
 /*
@@ -4797,13 +4776,19 @@
             wo_ext, path);
 
     /* Add the include and dynext paths to the global search */
+
+    /* Get the base path of the located module */
     parrot_split_path_ext(interp, path, &found_path, &found_ext);
     name_length = Parrot_str_length(interp, lang_name);
-    found_path = Parrot_str_substr(interp, found_path, -name_length, name_length, NULL, 0);
+    found_path = Parrot_str_substr(interp, found_path, 0,
+            Parrot_str_length(interp, found_path)-name_length, NULL, 0);
+
     Parrot_lib_add_path(interp, Parrot_str_append(interp, found_path, CONST_STRING(interp, "include/")),
             PARROT_LIB_PATH_INCLUDE);
     Parrot_lib_add_path(interp, Parrot_str_append(interp, found_path, CONST_STRING(interp, "dynext/")),
             PARROT_LIB_PATH_DYNEXT);
+    Parrot_lib_add_path(interp, Parrot_str_append(interp, found_path, CONST_STRING(interp, "library/")),
+            PARROT_LIB_PATH_LIBRARY);
 
 
     /* Check if the file found was actually a bytecode file (.pbc extension) or
@@ -4929,7 +4914,9 @@
 PackFile_fixup_subs(PARROT_INTERP, pbc_action_enum_t what, ARGIN_NULLOK(PMC *eval))
 {
     ASSERT_ARGS(PackFile_fixup_subs)
+    PARROT_CALLIN_START(interp);
     do_sub_pragmas(interp, interp->code, what, eval);
+    PARROT_CALLIN_END(interp);
 }
 
 

Modified: branches/orderedhash_revamp/src/packfile/pf_items.c
==============================================================================
--- branches/orderedhash_revamp/src/packfile/pf_items.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/packfile/pf_items.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -161,60 +161,60 @@
 static opcode_t fetch_op_mixed_le(ARGIN(const unsigned char *b))
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_cvt_num12_num16 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_cvt_num12_num16 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(dest) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_cvt_num12_num16_le __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_cvt_num12_num16_le __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(dest) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_cvt_num12_num8 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_cvt_num12_num8 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(dest) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_cvt_num12_num8_le __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_cvt_num12_num8_le __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(dest) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_cvt_num16_num12 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_cvt_num16_num12 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(dest) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_cvt_num16_num12_be __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_cvt_num16_num12_be __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(dest) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_cvt_num16_num8 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_cvt_num16_num8 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(dest) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_cvt_num16_num8_be __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_cvt_num16_num8_be __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(dest) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_cvt_num16_num8_le __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_cvt_num16_num8_le __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(dest) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_cvt_num8_num12 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_cvt_num8_num12 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(dest) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_cvt_num8_num12_be __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_cvt_num8_num12_be __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(dest) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_cvt_num8_num16 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_cvt_num8_num16 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(dest) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_cvt_num8_num16_be __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_cvt_num8_num16_be __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(dest) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_cvt_num8_num16_le __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_cvt_num8_num16_le __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(dest) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_fetch_op_be_4 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(b)
-#define ASSERT_ARGS_fetch_op_be_8 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(b)
-#define ASSERT_ARGS_fetch_op_le_4 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(b)
-#define ASSERT_ARGS_fetch_op_le_8 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(b)
-#define ASSERT_ARGS_fetch_op_mixed_be __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(b)
-#define ASSERT_ARGS_fetch_op_mixed_le __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(b)
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_fetch_op_be_4 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(b))
+#define ASSERT_ARGS_fetch_op_be_8 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(b))
+#define ASSERT_ARGS_fetch_op_le_4 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(b))
+#define ASSERT_ARGS_fetch_op_le_8 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(b))
+#define ASSERT_ARGS_fetch_op_mixed_be __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(b))
+#define ASSERT_ARGS_fetch_op_mixed_le __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(b))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -1537,28 +1537,28 @@
 
         switch (pf->header->floattype) {
 #  if NUMVAL_SIZE == 8
-        case FLOATTYPE_8:
+          case FLOATTYPE_8:
             pf->fetch_nv = fetch_buf_le_8;
             break;
-        case FLOATTYPE_12:
+          case FLOATTYPE_12:
             pf->fetch_nv = cvt_num12_num8_le;
             break;
-        case FLOATTYPE_16:
+          case FLOATTYPE_16:
             pf->fetch_nv = cvt_num16_num8_le;
             break;
 #  endif
 #  if NUMVAL_SIZE == 16
-        case FLOATTYPE_8:
+          case FLOATTYPE_8:
             pf->fetch_nv = cvt_num8_num16_le;
             break;
-        case FLOATTYPE_12:
+          case FLOATTYPE_12:
             pf->fetch_nv = cvt_num12_num16_le;
             break;
-        case FLOATTYPE_16:
+          case FLOATTYPE_16:
             pf->fetch_nv = fetch_buf_le_16;
             break;
 #  endif
-        default:
+          default:
             exit_fatal(1,
               "PackFile_unpack: unsupported float conversion %d to %d, "
               "PARROT_BIGENDIAN=%d\n",
@@ -1576,26 +1576,26 @@
 
         switch (pf->header->floattype) {
 #  if NUMVAL_SIZE == 8
-        case FLOATTYPE_8: /* native */
+          case FLOATTYPE_8: /* native */
             break;
-        case FLOATTYPE_12:
+          case FLOATTYPE_12:
             pf->fetch_nv = cvt_num12_num8;
             break;
-        case FLOATTYPE_16:
+          case FLOATTYPE_16:
             pf->fetch_nv = cvt_num16_num8;
             break;
 #  endif
 #  if NUMVAL_SIZE == 16
-        case FLOATTYPE_8:
+          case FLOATTYPE_8:
             pf->fetch_nv = cvt_num8_num16;
             break;
-        case FLOATTYPE_12:
+          case FLOATTYPE_12:
             pf->fetch_nv = cvt_num12_num16;
             break;
-        case FLOATTYPE_16: /* native */
+          case FLOATTYPE_16: /* native */
             break;
 #  endif
-        default:
+          default:
             exit_fatal(1,
               "PackFile_unpack: unsupported float conversion %d to %d, "
               "PARROT_BIGENDIAN=%d\n",
@@ -1617,39 +1617,39 @@
 
         switch (pf->header->floattype) {
 #  if NUMVAL_SIZE == 8
-        case FLOATTYPE_8:
+          case FLOATTYPE_8:
             pf->fetch_nv = fetch_buf_be_8;
             break;
-        case FLOATTYPE_12:
+          case FLOATTYPE_12:
             exit_fatal(1, "PackFile_unpack: invalid floattype 1 big-endian");
             break;
-        case FLOATTYPE_16:
+          case FLOATTYPE_16:
             pf->fetch_nv = cvt_num16_num8_be;
             break;
 #  endif
 #  if NUMVAL_SIZE == 12
-        case FLOATTYPE_8:
+          case FLOATTYPE_8:
             pf->fetch_nv = cvt_num8_num12_be;
             break;
-        case FLOATTYPE_12:
+          case FLOATTYPE_12:
             exit_fatal(1, "PackFile_unpack: invalid floattype 1 big-endian");
             break;
-        case FLOATTYPE_16:
+          case FLOATTYPE_16:
             pf->fetch_nv = cvt_num16_num12_be;
             break;
 #  endif
 #  if NUMVAL_SIZE == 16
-        case FLOATTYPE_8:
+          case FLOATTYPE_8:
             pf->fetch_nv = cvt_num8_num16_be;
             break;
-        case FLOATTYPE_12:
+          case FLOATTYPE_12:
             exit_fatal(1, "PackFile_unpack: invalid floattype 1 big-endian");
             break;
-        case FLOATTYPE_16:
+          case FLOATTYPE_16:
             pf->fetch_nv = fetch_buf_be_16;
             break;
 #  endif
-        default:
+          default:
             exit_fatal(1,
               "PackFile_unpack: unsupported float conversion %d to %d, "
               "PARROT_BIGENDIAN=%d\n",
@@ -1667,33 +1667,33 @@
 
         switch (pf->header->floattype) {
 #  if NUMVAL_SIZE == 8
-        case FLOATTYPE_8: /* native */
+          case FLOATTYPE_8: /* native */
             break;
-        case FLOATTYPE_12:
+          case FLOATTYPE_12:
             pf->fetch_nv = cvt_num12_num8;
             break;
-        case FLOATTYPE_16:
+          case FLOATTYPE_16:
             pf->fetch_nv = cvt_num16_num8;
             break;
 #  endif
 #  if NUMVAL_SIZE == 12
-        case FLOATTYPE_8:
+          case FLOATTYPE_8:
             pf->fetch_nv = cvt_num8_num12;
             break;
-        case FLOATTYPE_12: /* native */
+          case FLOATTYPE_12: /* native */
             break;
-        case FLOATTYPE_16:
+          case FLOATTYPE_16:
             pf->fetch_nv = cvt_num16_num12;
             break;
 #  endif
 #  if NUMVAL_SIZE == 16
-        case FLOATTYPE_8:
+          case FLOATTYPE_8:
             pf->fetch_nv = cvt_num8_num16;
             break;
-        case FLOATTYPE_12:
+          case FLOATTYPE_12:
             pf->fetch_nv = cvt_num12_num16;
             break;
-        case FLOATTYPE_16: /* native */
+          case FLOATTYPE_16: /* native */
             break;
 #  endif
           default:

Modified: branches/orderedhash_revamp/src/packout.c
==============================================================================
--- branches/orderedhash_revamp/src/packout.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/packout.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -136,7 +136,7 @@
     size = seg->op_count;
     ret = PackFile_Segment_pack(interp, seg, cursor);
     if ((size_t)(ret - cursor) != size) {
-        fprintf(stderr, "PackFile_pack segment '%s' used size %d "
+        Parrot_io_eprintf(interp, "PackFile_pack segment '%Ss' used size %d "
                 "but reported %d\n", seg->name, (int)(ret-cursor), (int)size);
     }
 }
@@ -270,28 +270,27 @@
     ASSERT_ARGS(PackFile_Constant_pack)
     PMC *key;
     size_t i;
-    opcode_t slice_bits;
     STRING *image;
 
     *cursor++ = self->type;
 
     switch (self->type) {
 
-    case PFC_NUMBER:
+      case PFC_NUMBER:
         cursor = PF_store_number(cursor, &self->u.number);
         break;
 
-    case PFC_STRING:
+      case PFC_STRING:
         cursor = PF_store_string(cursor, self->u.string);
         break;
 
-    case PFC_PMC:
+      case PFC_PMC:
         key = self->u.key;      /* the (Sub) PMC */
         image = Parrot_freeze(interp, key);
         cursor = PF_store_string(cursor, image);
         break;
 
-    case PFC_KEY:
+      case PFC_KEY:
         for (i = 0, key = self->u.key; key; i++){
             GETATTR_Key_next_key(interp, key, key);
         }
@@ -301,61 +300,50 @@
         /* and now type / value per component */
         for (key = self->u.key; key;) {
             const opcode_t type = PObj_get_FLAGS(key);
-            slice_bits = 0;
-            if ((type & (KEY_start_slice_FLAG|KEY_inf_slice_FLAG)) ==
-                    (KEY_start_slice_FLAG|KEY_inf_slice_FLAG))
-                slice_bits |= PF_VT_END_INF;
-            if ((type & (KEY_end_slice_FLAG|KEY_inf_slice_FLAG)) ==
-                    (KEY_end_slice_FLAG|KEY_inf_slice_FLAG))
-                slice_bits |= PF_VT_START_ZERO;
-            if (type & KEY_start_slice_FLAG)
-                slice_bits |= PF_VT_START_SLICE;
-            if (type & KEY_end_slice_FLAG)
-                slice_bits |= PF_VT_END_SLICE;
 
             switch (type & KEY_type_FLAGS) {
-                case KEY_integer_FLAG:
-                    *cursor++ = PARROT_ARG_IC | slice_bits;
-                    GETATTR_Key_int_key(interp, key, *cursor++);
-                    break;
-                case KEY_number_FLAG:
-                    *cursor++ = PARROT_ARG_NC | slice_bits;
-                    /* Argh */
-                    *cursor++ = PackFile_find_in_const(interp, const_table, key, PFC_NUMBER);
-                    break;
-                case KEY_string_FLAG:
-                    *cursor++ = PARROT_ARG_SC | slice_bits;
-                    /* Argh */
-                    *cursor++ = PackFile_find_in_const(interp, const_table, key, PFC_STRING);
-                    break;
-
-                case KEY_integer_FLAG | KEY_register_FLAG:
-                    *cursor++ = PARROT_ARG_I | slice_bits;
-                    GETATTR_Key_int_key(interp, key, *cursor++);
-                    break;
-                case KEY_number_FLAG | KEY_register_FLAG:
-                    *cursor++ = PARROT_ARG_N | slice_bits;
-                    GETATTR_Key_int_key(interp, key, *cursor++);
-                    break;
-                case KEY_string_FLAG | KEY_register_FLAG:
-                    *cursor++ = PARROT_ARG_S | slice_bits;
-                    GETATTR_Key_int_key(interp, key, *cursor++);
-                    break;
-                case KEY_pmc_FLAG | KEY_register_FLAG:
-                    *cursor++ = PARROT_ARG_P | slice_bits;
-                    GETATTR_Key_int_key(interp, key, *cursor++);
-                    break;
-                default:
-                    Parrot_io_eprintf(NULL, "PackFile_Constant_pack: "
+              case KEY_integer_FLAG:
+                *cursor++ = PARROT_ARG_IC;
+                GETATTR_Key_int_key(interp, key, *cursor++);
+                break;
+              case KEY_number_FLAG:
+                *cursor++ = PARROT_ARG_NC;
+                /* Argh */
+                *cursor++ = PackFile_find_in_const(interp, const_table, key, PFC_NUMBER);
+                break;
+              case KEY_string_FLAG:
+                *cursor++ = PARROT_ARG_SC;
+                /* Argh */
+                *cursor++ = PackFile_find_in_const(interp, const_table, key, PFC_STRING);
+                break;
+
+              case KEY_integer_FLAG | KEY_register_FLAG:
+                *cursor++ = PARROT_ARG_I;
+                GETATTR_Key_int_key(interp, key, *cursor++);
+                break;
+              case KEY_number_FLAG | KEY_register_FLAG:
+                *cursor++ = PARROT_ARG_N;
+                GETATTR_Key_int_key(interp, key, *cursor++);
+                break;
+              case KEY_string_FLAG | KEY_register_FLAG:
+                *cursor++ = PARROT_ARG_S;
+                GETATTR_Key_int_key(interp, key, *cursor++);
+                break;
+              case KEY_pmc_FLAG | KEY_register_FLAG:
+                *cursor++ = PARROT_ARG_P;
+                GETATTR_Key_int_key(interp, key, *cursor++);
+                break;
+              default:
+                Parrot_io_eprintf(NULL, "PackFile_Constant_pack: "
                             "unsupported constant type\n");
-                    Parrot_exit(interp, 1);
+                Parrot_exit(interp, 1);
             }
             GETATTR_Key_next_key(interp, key, key);
         }
 
         break;
 
-    default:
+      default:
         Parrot_io_eprintf(NULL, "PackFile_Constant_pack: unsupported constant\n");
         Parrot_exit(interp, 1);
         break;

Modified: branches/orderedhash_revamp/src/parrot_debugger.c
==============================================================================
--- branches/orderedhash_revamp/src/parrot_debugger.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/parrot_debugger.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -2,20 +2,20 @@
 Copyright (C) 2001-2009, Parrot Foundation.
 $Id$
 
-History:
-    Renamed from pdb.c in 2008.7.15
-
 =head1 NAME
 
-parrot_debugger - The Parrot debugger
+parrot_debugger
 
-=head1 SYNOPSIS
+=head1 DESCRIPTION
 
- parrot_debugger programfile
+The Parrot debugger
 
-=head1 DESCRIPTION
+=head1 SYNOPSIS
 
-=head2 Commands
+    parrot_debugger programfile
+    parrot_debugger --script scriptfile programfile
+
+=head1 COMMANDS
 
 =over 4
 
@@ -39,7 +39,13 @@
 
 =item C<break> or C<b>
 
-Add a breakpoint.
+Add a breakpoint at the line number given or the current line if none is given.
+
+    (pdb) b
+    Breakpoint 1 at pos 0
+
+    (pdb) b 10
+    Breakpoint 1 at pos 10
 
 =item C<watch> or C<w>
 
@@ -47,7 +53,10 @@
 
 =item C<delete> or C<d>
 
-Delete a breakpoint.
+Given a number n, deletes the n-th breakpoint. To delete the first breakpoint:
+
+    (pdb) d 1
+    Breakpoint 1 deleted
 
 =item C<disable>
 
@@ -71,11 +80,26 @@
 
 =item C<trace> or C<t>
 
-Trace the next instruction.
+Trace the next instruction. This is equivalent to printing the source of the
+next instruction and then executing it.
 
 =item C<print> or C<p>
 
-Print the interpreter registers.
+Print an interpreter register. If a register I0 has been used, this
+would look like:
+
+    (pdb) p I0
+    2
+
+If no register number is given then all registers of that type will be printed.
+If the two registers I0 and I1 have been used, then this would look like:
+
+    (pdb) p I
+    I0 = 2
+    I1 = 5
+
+It would be nice if "p" with no arguments printed all registers, but this is
+currently not the case.
 
 =item C<stack> or C<s>
 
@@ -83,7 +107,13 @@
 
 =item C<info>
 
-Print interpreter information.
+Print interpreter information relating to memory allocation and garbage
+collection.
+
+=item C<gcdebug>
+
+Toggle garbage collection debugging mode.  In gcdebug mode a garbage collection
+cycle is run before each opcocde, which is the same as using the gcdebug core.
 
 =item C<quit> or C<q>
 
@@ -114,6 +144,7 @@
 #include "../compilers/imcc/parser.h"
 #include "parrot/embed.h"
 #include "parrot/debugger.h"
+#include "parrot/runcore_api.h"
 
 static void PDB_printwelcome(void);
 static void PDB_run_code(PARROT_INTERP, int argc, char *argv[]);
@@ -122,7 +153,7 @@
 
 =item C<int main(int argc, char *argv[])>
 
-Reads the PASM or PBC file from argv[1], loads it, and then calls
+Reads the PIR, PASM or PBC file from argv[1], loads it, and then calls
 Parrot_debug().
 
 =cut
@@ -220,7 +251,7 @@
         const char source []= ".sub aux :main\nexit 0\n.end\n";
         PMC *code = Parrot_compile_string(interp, compiler, source, &errstr);
 
-        if (!STRING_IS_NULL(errstr))
+        if (!STRING_is_null(interp, errstr))
             Parrot_io_eprintf(interp, "%Ss\n", errstr);
     }
 
@@ -232,10 +263,9 @@
     else
         PDB_printwelcome();
 
-    interp->run_core = PARROT_DEBUGGER_CORE;
+    Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "debugger"));
     PDB_run_code(interp, argc - nextarg, argv + nextarg);
 
-
     Parrot_exit(interp, 0);
 }
 
@@ -331,6 +361,10 @@
 
 =back
 
+=head1 HISTORY
+
+Renamed from F<pdb.c> on 2008.7.15
+
 =cut
 
 */

Modified: branches/orderedhash_revamp/src/pbc_disassemble.c
==============================================================================
--- branches/orderedhash_revamp/src/pbc_disassemble.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pbc_disassemble.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -103,24 +103,24 @@
     while ((status = longopt_get(interp,
                     argc, argv, options, &opt)) > 0) {
         switch (opt.opt_id) {
-            case 'h':
-                option += enum_DIS_HEADER;
-                break;
-            case 'b':
-                option += enum_DIS_BARE;
-                break;
-            case 'o':
-                outfile = opt.opt_arg;
-                break;
+          case 'h':
+            option += enum_DIS_HEADER;
+            break;
+          case 'b':
+            option += enum_DIS_BARE;
+            break;
+          case 'o':
+            outfile = opt.opt_arg;
+            break;
 #if TRACE_PACKFILE
-            case 'D':
-                debug += atoi(opt.opt_arg) << 2;
-                break;
+          case 'D':
+            debug += atoi(opt.opt_arg) << 2;
+            break;
 #endif
-            case '?':
-            default:
-                help();
-                break;
+          case '?':
+          default:
+            help();
+            break;
         }
     }
     if (status == -1) {

Modified: branches/orderedhash_revamp/src/pbc_dump.c
==============================================================================
--- branches/orderedhash_revamp/src/pbc_dump.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pbc_dump.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -74,7 +74,7 @@
 static void
 const_dump(PARROT_INTERP, const PackFile_Segment *segp)
 {
-    Parrot_io_printf(interp, "%s => [\n", segp->name);
+    Parrot_io_printf(interp, "%Ss => [\n", segp->name);
     PackFile_ConstTable_dump(interp, (const PackFile_ConstTable *)segp);
     Parrot_io_printf(interp, "],\n");
 }
@@ -93,7 +93,7 @@
 static void
 fixup_dump(PARROT_INTERP, const PackFile_Segment *segp)
 {
-    Parrot_io_printf(interp, "%s => [\n", segp->name);
+    Parrot_io_printf(interp, "%Ss => [\n", segp->name);
     PackFile_Fixup_dump(interp, (const PackFile_FixupTable *)segp);
     Parrot_io_printf(interp, "],\n");
 }
@@ -114,7 +114,7 @@
 {
     opcode_t *pc;
     size_t i, n;
-    Parrot_io_printf(interp, "%s => [ # %d ops at offs 0x%x\n",
+    Parrot_io_printf(interp, "%Ss => [ # %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) {
@@ -249,28 +249,28 @@
     while ((status = longopt_get(interp,
                     argc, argv, opt_options, &opt)) > 0) {
         switch (opt.opt_id) {
-            case 'h':
-                options += PFOPT_HEADERONLY;
-                break;
-            case 't':
-                terse = 1;
-                break;
-            case 'd':
-                disas = 1;
-                break;
+          case 'h':
+            options += PFOPT_HEADERONLY;
+            break;
+          case 't':
+            terse = 1;
+            break;
+          case 'd':
+            disas = 1;
+            break;
 #if TRACE_PACKFILE
-            case 'D':
-                options += atoi(opt.opt_arg) << 2;
-                break;
+          case 'D':
+            options += atoi(opt.opt_arg) << 2;
+            break;
 #endif
-            case 'o':
-                file = opt.opt_arg;
-                convert = 1;
-                break;
-            case '?':
-            default:
-                help();
-                break;
+          case 'o':
+            file = opt.opt_arg;
+            convert = 1;
+            break;
+          case '?':
+          default:
+            help();
+            break;
         }
     }
     if (status == -1) {

Deleted: branches/orderedhash_revamp/src/pbc_info.c
==============================================================================
--- branches/orderedhash_revamp/src/pbc_info.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,113 +0,0 @@
-/*
-Copyright (C) 2001-2003, Parrot Foundation.
-$Id$
-
-=head1 NAME
-
-pbc_info - PackFile demo
-
-=head1 SYNOPSIS
-
- pbc_info file.pbc
-
-=head1 DESCRIPTION
-
-Sample program for dumping PackFile segment names by iterating
-over the main directory.
-
-=head2 Functions
-
-=over 4
-
-=cut
-
-*/
-
-#include "parrot/parrot.h"
-#include "parrot/embed.h"
-
-/*
-
-=item C<static INTVAL iter(PARROT_INTERP, PackFile_Segment *seg, void
- *user_data)>
-
-This function is passed the callback to PackFile_map_segments() to print out
-the name of each segment in the directory.
-
-=cut
-
-*/
-
-static INTVAL
-iter(PARROT_INTERP, PackFile_Segment *seg, void *user_data)
-{
-    long ident = (long)user_data;
-    int length = ident;
-    printf("%*.0s%s\n", length, "", seg->name);
-    if (seg->type == PF_DIR_SEG)
-        PackFile_map_segments(interp, (PackFile_Directory*)seg,
-                iter, (void*)(ident+2));
-    return 0;
-}
-
-/*
-
-=item C<int main(int argc, char *argv[])>
-
-Reads the PBC from argv[1], adds a few extra sections, and then iterates over
-the directory using PackFile_map_segments() and iter().
-
-=cut
-
-*/
-
-int
-main(SHIM(int argc), char *argv[])
-{
-    PackFile *pf;
-    Interp *interp;
-    PackFile_Segment *seg;
-
-    interp = Parrot_new(NULL);
-
-    pf = Parrot_pbc_read(interp, argv[1], PFOPT_UTILS);
-
-    /*
-     * add some more segments
-     */
-    seg = PackFile_Segment_new_seg(interp,
-                    &pf->directory, PF_DIR_SEG, "dir2", 1);
-    seg = PackFile_Segment_new_seg(interp,
-                    (PackFile_Directory*)seg, PF_BYTEC_SEG, "code", 1);
-    seg = PackFile_Segment_new_seg(interp,
-                    &pf->directory, PF_DIR_SEG, "dir3", 1);
-
-    /*
-     * show these
-     */
-    printf("%s\n", pf->directory.base.name);
-    PackFile_map_segments(interp, &pf->directory, iter, (void*)2);
-
-    Parrot_exit(interp, 0);
-}
-
-/*
-
-=back
-
-=head1 SEE ALSO
-
-F<src/packfile.c>, F<include/parrot/packfile.h>.
-
-=cut
-
-*/
-
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */
-

Modified: branches/orderedhash_revamp/src/pbc_merge.c
==============================================================================
--- branches/orderedhash_revamp/src/pbc_merge.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pbc_merge.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -140,19 +140,6 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-static void pbc_merge_pic_index(PARROT_INTERP,
-    ARGMOD(pbc_merge_input **inputs),
-    int num_inputs,
-    ARGMOD(PackFile *pf),
-    ARGMOD(PackFile_ByteCode *bc))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(4)
-        __attribute__nonnull__(5)
-        FUNC_MODIFIES(*inputs)
-        FUNC_MODIFIES(*pf)
-        FUNC_MODIFIES(*bc);
-
 static void pbc_merge_write(PARROT_INTERP,
     ARGMOD(PackFile *pf),
     ARGIN(const char *filename))
@@ -161,46 +148,41 @@
         __attribute__nonnull__(3)
         FUNC_MODIFIES(*pf);
 
-#define ASSERT_ARGS_help __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_pbc_merge_begin __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(inputs)
-#define ASSERT_ARGS_pbc_merge_bytecode __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_help __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_pbc_merge_begin __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(inputs) \
-    || PARROT_ASSERT_ARG(pf)
-#define ASSERT_ARGS_pbc_merge_constants __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(inputs))
+#define ASSERT_ARGS_pbc_merge_bytecode __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(inputs) \
-    || PARROT_ASSERT_ARG(pf) \
-    || PARROT_ASSERT_ARG(bc)
-#define ASSERT_ARGS_pbc_merge_ctpointers __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(inputs) \
+    , PARROT_ASSERT_ARG(pf))
+#define ASSERT_ARGS_pbc_merge_constants __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(inputs) \
-    || PARROT_ASSERT_ARG(bc)
-#define ASSERT_ARGS_pbc_merge_debugs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(inputs) \
+    , PARROT_ASSERT_ARG(pf) \
+    , PARROT_ASSERT_ARG(bc))
+#define ASSERT_ARGS_pbc_merge_ctpointers __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(inputs) \
-    || PARROT_ASSERT_ARG(pf) \
-    || PARROT_ASSERT_ARG(bc)
-#define ASSERT_ARGS_pbc_merge_fixups __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(inputs) \
+    , PARROT_ASSERT_ARG(bc))
+#define ASSERT_ARGS_pbc_merge_debugs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(inputs) \
-    || PARROT_ASSERT_ARG(pf) \
-    || PARROT_ASSERT_ARG(bc)
-#define ASSERT_ARGS_pbc_merge_loadpbc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(inputs) \
+    , PARROT_ASSERT_ARG(pf) \
+    , PARROT_ASSERT_ARG(bc))
+#define ASSERT_ARGS_pbc_merge_fixups __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(fullname)
-#define ASSERT_ARGS_pbc_merge_pic_index __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(inputs) \
+    , PARROT_ASSERT_ARG(pf) \
+    , PARROT_ASSERT_ARG(bc))
+#define ASSERT_ARGS_pbc_merge_loadpbc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(inputs) \
-    || PARROT_ASSERT_ARG(pf) \
-    || PARROT_ASSERT_ARG(bc)
-#define ASSERT_ARGS_pbc_merge_write __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(fullname))
+#define ASSERT_ARGS_pbc_merge_write __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pf) \
-    || PARROT_ASSERT_ARG(filename)
+    , PARROT_ASSERT_ARG(pf) \
+    , PARROT_ASSERT_ARG(filename))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -378,7 +360,7 @@
     /* Stash produced bytecode. */
     bc_seg->base.data = bc;
     bc_seg->base.size = cursor;
-    bc_seg->base.name = mem_sys_strdup("MERGED");
+    bc_seg->base.name = Parrot_str_new_constant(interp, "MERGED");
     return bc_seg;
 }
 
@@ -454,17 +436,17 @@
             /* If it's a sub PMC, need to deal with offsets. */
             if (copy->type == PFC_PMC) {
                 switch (copy->u.key->vtable->base_type) {
-                    case enum_class_Sub:
-                    case enum_class_Coroutine:
-                        {
-                        Parrot_sub *sub;
+                  case enum_class_Sub:
+                  case enum_class_Coroutine:
+                    {
+                        Parrot_Sub_attributes *sub;
                         PMC_get_sub(interp, copy->u.key, sub);
                         sub->start_offs += inputs[i]->code_start;
                         sub->end_offs += inputs[i]->code_start;
-                        }
-                        break;
-                    default:
-                        break;
+                    }
+                    break;
+                  default:
+                    break;
                 }
             }
 
@@ -555,19 +537,17 @@
 
             /* Set new offset and bytecode pointer. */
             switch (copy->type) {
-                case enum_fixup_label:
-                    copy->offset = cur_entry->offset + inputs[i]->code_start;
-                    break;
-                case enum_fixup_sub:
-                    copy->offset = cur_entry->offset + inputs[i]->const_start;
-                    break;
-                default:
-                    Parrot_io_eprintf(interp, "PBC Merge: Unknown fixup type");
-                    Parrot_exit(interp, 1);
+              case enum_fixup_label:
+                copy->offset = cur_entry->offset + inputs[i]->code_start;
+                break;
+              case enum_fixup_sub:
+                copy->offset = cur_entry->offset + inputs[i]->const_start;
+                break;
+              default:
+                Parrot_io_eprintf(interp, "PBC Merge: Unknown fixup type");
+                Parrot_exit(interp, 1);
             }
 
-            copy->seg = bc;
-
             /* Slot it into the list. */
             fixups[cursor] = copy;
             cursor++;
@@ -633,8 +613,6 @@
             mappings[num_mappings + j] = mapping;
         }
 
-        /* Update counts.  The "- 1" allows for the fact that the size value
-           itself is included in in_seg->base.size.  See RT#58660. */
         num_lines    += in_seg->base.size - 1;
         num_mappings += in_seg->num_mappings;
     }
@@ -653,59 +631,6 @@
 
 /*
 
-=item C<static void pbc_merge_pic_index(PARROT_INTERP, pbc_merge_input **inputs,
-int num_inputs, PackFile *pf, PackFile_ByteCode *bc)>
-
-This function merges the pic_index segments from the input PBC files.
-
-=cut
-
-*/
-
-static void
-pbc_merge_pic_index(PARROT_INTERP, ARGMOD(pbc_merge_input **inputs),
-                 int num_inputs, ARGMOD(PackFile *pf), ARGMOD(PackFile_ByteCode *bc))
-{
-    ASSERT_ARGS(pbc_merge_pic_index)
-    int i;
-    PackFile_Segment *pic_index;
-    size_t size;
-    opcode_t cursor = 0;
-    opcode_t start = 0;
-    opcode_t last = 0;
-
-    /* calc needed size */
-    for (i = 0, size = 0; i < num_inputs; i++) {
-        PackFile_Segment * const in_seg  = inputs[i]->pf->cur_cs->pic_index;
-        size   += in_seg->size;
-    }
-    pic_index = PackFile_Segment_new_seg(interp,
-              &pf->directory, PF_UNKNOWN_SEG, "PIC_idx_MERGED", 1);
-    pic_index->data
-        = (opcode_t *)mem_sys_allocate_zeroed(size * sizeof (opcode_t));
-    pic_index->size = size;
-
-    for (i = 0, size = 0; i < num_inputs; i++) {
-        PackFile_Segment * const in_seg = inputs[i]->pf->cur_cs->pic_index;
-        size_t j;
-        /*
-         * pic_index is 0 or an ever increasing (by 1) number
-         */
-        for (j = 0; j < in_seg->size; j++) {
-            const opcode_t k = in_seg->data[j];
-            if (k) {
-                pic_index->data[cursor] = k + start;
-                last = k;
-            }
-            cursor++;
-        }
-        start = last;
-    }
-    bc->pic_index = pic_index;
-}
-
-/*
-
 =item C<static void pbc_merge_ctpointers(PARROT_INTERP, pbc_merge_input
 **inputs, int num_inputs, PackFile_ByteCode *bc)>
 
@@ -747,14 +672,14 @@
         for (cur_arg = 1; cur_arg < op->op_count; cur_arg++) {
             /* Pick out any indexes into the constant table and correct them. */
             switch (op->types[cur_arg - 1]) {
-                case PARROT_ARG_NC:
-                case PARROT_ARG_PC:
-                case PARROT_ARG_SC:
-                case PARROT_ARG_KC:
-                    ops[cur_op] += inputs[cur_input]->const_start;
-                    break;
-                default:
-                    break;
+              case PARROT_ARG_NC:
+              case PARROT_ARG_PC:
+              case PARROT_ARG_SC:
+              case PARROT_ARG_KC:
+                ops[cur_op] += inputs[cur_input]->const_start;
+                break;
+              default:
+                break;
             }
 
             /* Move along the bytecode array. */
@@ -773,14 +698,14 @@
             const int sig_items = VTABLE_elements(interp, sig);
             for (cur_arg = 0; cur_arg < sig_items; cur_arg++) {
                 switch (VTABLE_get_integer_keyed_int(interp, sig, cur_arg)) {
-                    case PARROT_ARG_NC:
-                    case PARROT_ARG_PC:
-                    case PARROT_ARG_SC:
-                    case PARROT_ARG_KC:
-                        ops[cur_op] += inputs[cur_input]->const_start;
-                        break;
-                    default:
-                        break;
+                  case PARROT_ARG_NC:
+                  case PARROT_ARG_PC:
+                  case PARROT_ARG_SC:
+                  case PARROT_ARG_KC:
+                    ops[cur_op] += inputs[cur_input]->const_start;
+                    break;
+                  default:
+                    break;
                 }
                 cur_op++;
             }
@@ -822,7 +747,6 @@
 
     pbc_merge_fixups(interp, inputs, num_inputs, merged, bc);
     pbc_merge_debugs(interp, inputs, num_inputs, merged, bc);
-    pbc_merge_pic_index(interp, inputs, num_inputs, merged, bc);
 
     /* Walk bytecode and fix ops that reference the constants table. */
     pbc_merge_ctpointers(interp, inputs, num_inputs, bc);
@@ -910,17 +834,17 @@
     }
     while ((status = longopt_get(interp, argc, argv, options, &opt)) > 0) {
         switch (opt.opt_id) {
-            case 'o':
-                if (output_file == NULL)
-                    output_file = opt.opt_arg;
-                else
-                    help(interp);
-                break;
-            case '?':
+          case 'o':
+            if (output_file == NULL)
+                output_file = opt.opt_arg;
+            else
                 help(interp);
-                break;
-            default:
-                break;
+            break;
+          case '?':
+            help(interp);
+            break;
+          default:
+            break;
         }
     }
     if (status == -1 || !output_file) {

Deleted: branches/orderedhash_revamp/src/pic.c
==============================================================================
--- branches/orderedhash_revamp/src/pic.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,946 +0,0 @@
-/*
-Copyright (C) 2004-2009, Parrot Foundation.
-$Id$
-
-=head1 NAME
-
-src/pic.c - Polymorphic Inline Cache
-
-=head1 DESCRIPTION
-
-The PIC supports inline caching for MMD and object method lookups in
-prederefed run cores. Additionally opcodes that do some kind of lookup
-like C<new_p_sc> are changed to faster variants.
-
-For non-prederefed run-cores there's a less efficient variant which
-is basically:
-
- * the bytecode segment has an index per cached opcode (code->pic_index)
- * this index points into pic_store
- * TODO use the cache in opcodes
-
-=head1 OPERATION SCHEME
-
-Given this bytecode:
-
-    0               1              2    3    4                5
-  +--------------+---------------+----+----+-----------------+----------+
-  | infix_ic_p_p | .MMD_SUBTRACT | P5 | P6 | callmethodcc_sc | "method" |
-  +--------------+---------------+----+----+-----------------+----------+
-
-In init_prederef the opcodes are replaced with prederef__, operands
-are replaced with their addresses (&) in the const table or offsets
-(+) in the register frame:
-
-    0               1              2    3    4                5
-  +--------------+---------------+----+----+-----------------+----------+
-  | prederef__   | .MMD_SUBTRACT | +P5| +P6| prederef__      |&"method" |
-  +--------------+---------------+----+----+-----------------+----------+
-
-we have code->pic_index with an index into pic_store - the pic_index is
-half the size of the bytecode and addressed with pc_offset/2:
-
-    0   1   2
-  +---+---+---+
-  | 1 |   | 2 |
-  +---+---+---+
-
-During predereferencing the opcode gets rewritten to the PIC variant,
-the constant infix operation number is replaced with a pointer to the MIC
-in the pic_store at the index pic_index:
-
-    0                    1     2    3
-  +--------------------+-----+----+----+-----------------------+-----+
-  | pic_infix___ic_p_p | MIC1|+P5 |+P6 | pic_callmethodcc___sc | MIC2|
-  +--------------------+-----+----+----+-----------------------+-----+
-
-This can be further optimized due to static inlining:
-
-    0                    1     2    3
-  +--------------------+-----+----+----+-----------------------+-----+
-  | pic_inline_sub_p_p | MIC1|+P5 |+P6 | pic_callmethodcc___sc | MIC2|
-  +--------------------+-----+----+----+-----------------------+-----+
-
-The opcode is an opcode number for the switched core or the actual code address
-for the direct-threaded CGP core. With a little help of the JIT system we could
-also dynamicall create inlined code.
-
-Runcores with r/o (mmapped) bytecode can't be rewritten in this way, the
-lookup of the cache has to be done in the opcode itself.
-
-=head2 Functions
-
-=over 4
-
-=cut
-
-*/
-
-#include "parrot/parrot.h"
-#include "parrot/oplib/ops.h"
-#include "pmc/pmc_fixedintegerarray.h"
-#include "pmc/pmc_continuation.h"
-#ifdef HAVE_COMPUTED_GOTO
-#  include "parrot/oplib/core_ops_cgp.h"
-#endif
-
-#ifdef HAS_JIT
-#  include "parrot/exec.h"
-#  include "jit.h"
-#endif
-
-/* needs a Makefile dependency */
-/* #include "pmc/pmc_integer.h" */
-
-/* XXX Define this in a header file */
-extern void Parrot_Integer_i_subtract_Integer(Interp* , PMC* pmc, PMC* value);
-
-/*
- * hack to turn on inlining - just sub_p_p for mops done
- */
-
-#define ENABLE_INLINING 0
-
-/* HEADERIZER HFILE: include/parrot/pic.h */
-
-/* HEADERIZER BEGIN: static */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-
-static int is_pic_func(PARROT_INTERP,
-    ARGIN(void **pc),
-    ARGOUT(Parrot_MIC *mic),
-    int core_type)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*mic);
-
-static int is_pic_param(PARROT_INTERP,
-    ARGIN(void **pc),
-    ARGOUT(Parrot_MIC *mic),
-    opcode_t op)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*mic);
-
-static int pass_int(PARROT_INTERP,
-    ARGIN(PMC *sig),
-    ARGIN(const char *src_base),
-    ARGIN(const void **src),
-    ARGOUT(char *dest_base),
-    ARGIN(void * const *dest))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        __attribute__nonnull__(5)
-        __attribute__nonnull__(6)
-        FUNC_MODIFIES(*dest_base);
-
-static int pass_mixed(PARROT_INTERP,
-    ARGIN(PMC *sig),
-    ARGIN(const char *src_base),
-    ARGIN(void * const *src),
-    ARGOUT(char *dest_base),
-    ARGIN(void * const *dest))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        __attribute__nonnull__(5)
-        __attribute__nonnull__(6)
-        FUNC_MODIFIES(*dest_base);
-
-static int pass_num(PARROT_INTERP,
-    ARGIN(PMC *sig),
-    ARGIN(const char *src_base),
-    ARGIN(const void **src),
-    ARGOUT(char *dest_base),
-    ARGIN(void * const *dest))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        __attribute__nonnull__(5)
-        __attribute__nonnull__(6)
-        FUNC_MODIFIES(*dest_base);
-
-static int pass_pmc(PARROT_INTERP,
-    ARGIN(PMC *sig),
-    ARGIN(const char *src_base),
-    ARGIN(const void **src),
-    ARGOUT(char *dest_base),
-    ARGIN(void * const *dest))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        __attribute__nonnull__(5)
-        __attribute__nonnull__(6)
-        FUNC_MODIFIES(*dest_base);
-
-static int pass_str(PARROT_INTERP,
-    ARGIN(PMC *sig),
-    ARGIN(const char *src_base),
-    ARGIN(const void **src),
-    ARGOUT(char *dest_base),
-    ARGIN(void * const *dest))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        __attribute__nonnull__(5)
-        __attribute__nonnull__(6)
-        FUNC_MODIFIES(*dest_base);
-
-#define ASSERT_ARGS_is_pic_func __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pc) \
-    || PARROT_ASSERT_ARG(mic)
-#define ASSERT_ARGS_is_pic_param __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pc) \
-    || PARROT_ASSERT_ARG(mic)
-#define ASSERT_ARGS_pass_int __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sig) \
-    || PARROT_ASSERT_ARG(src_base) \
-    || PARROT_ASSERT_ARG(src) \
-    || PARROT_ASSERT_ARG(dest_base) \
-    || PARROT_ASSERT_ARG(dest)
-#define ASSERT_ARGS_pass_mixed __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sig) \
-    || PARROT_ASSERT_ARG(src_base) \
-    || PARROT_ASSERT_ARG(src) \
-    || PARROT_ASSERT_ARG(dest_base) \
-    || PARROT_ASSERT_ARG(dest)
-#define ASSERT_ARGS_pass_num __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sig) \
-    || PARROT_ASSERT_ARG(src_base) \
-    || PARROT_ASSERT_ARG(src) \
-    || PARROT_ASSERT_ARG(dest_base) \
-    || PARROT_ASSERT_ARG(dest)
-#define ASSERT_ARGS_pass_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sig) \
-    || PARROT_ASSERT_ARG(src_base) \
-    || PARROT_ASSERT_ARG(src) \
-    || PARROT_ASSERT_ARG(dest_base) \
-    || PARROT_ASSERT_ARG(dest)
-#define ASSERT_ARGS_pass_str __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sig) \
-    || PARROT_ASSERT_ARG(src_base) \
-    || PARROT_ASSERT_ARG(src) \
-    || PARROT_ASSERT_ARG(dest_base) \
-    || PARROT_ASSERT_ARG(dest)
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: static */
-
-
-/*
-
-=item C<void parrot_PIC_alloc_store(PackFile_ByteCode *cs, size_t n)>
-
-Initialize the PIC storage for the given code segment with the capacitiy of
-holding at least C<n> MIC entries. The PIC_store itself, room for C<n> MICs and
-some space for PICs is allocated as one piece. MICs are returned from the start
-of usable memory, PICs from the rear.
-
-=cut
-
-*/
-
-void
-parrot_PIC_alloc_store(ARGOUT(PackFile_ByteCode *cs), size_t n)
-{
-    ASSERT_ARGS(parrot_PIC_alloc_store)
-    Parrot_PIC_store *store;
-    size_t size;
-
-    /*
-     * estimated 95% of calls are monomorphic, 5% are polymorphic
-     * we need therefore:
-     */
-#define POLYMORPHIC 0.05
-    size_t poly = (size_t)(n * POLYMORPHIC) * sizeof (Parrot_PIC);
-
-    if (!poly)
-        poly = 2 * sizeof (Parrot_PIC);
-
-    size = n * sizeof (Parrot_MIC) + poly + sizeof (Parrot_PIC_store);
-
-    store         = (Parrot_PIC_store *)mem_sys_allocate_zeroed(size);
-    store->prev   = NULL;
-    cs->pic_store = store;
-    store->pic    = (Parrot_PIC *)((char *)store + size);
-    store->usable = poly;
-    store->mic    = (Parrot_MIC *)((char*)store + sizeof (Parrot_PIC_store));
-    store->n_mics = n;
-}
-
-/*
-
-=item C<void parrot_PIC_destroy(PackFile_ByteCode *cs)>
-
-Free memory for the PIC storage.
-
-=cut
-
-*/
-
-void
-parrot_PIC_destroy(ARGMOD(PackFile_ByteCode *cs))
-{
-    ASSERT_ARGS(parrot_PIC_destroy)
-    Parrot_PIC_store *store = cs->pic_store;
-
-    while (store) {
-        Parrot_PIC_store * const prev = store->prev;
-        mem_sys_free(store);
-        store = prev;
-    }
-
-    cs->pic_store = NULL;
-}
-
-/*
-
-=item C<int parrot_PIC_op_is_cached(int op_code)>
-
-Return true, if the opcode needs a PIC slot.
-
-=cut
-
-*/
-
-PARROT_CONST_FUNCTION
-int
-parrot_PIC_op_is_cached(int op_code)
-{
-    ASSERT_ARGS(parrot_PIC_op_is_cached)
-    switch (op_code) {
-        case PARROT_OP_get_params_pc:
-        case PARROT_OP_set_returns_pc:
-        case PARROT_OP_set_args_pc:
-            return 1;
-        default:
-            return 0;
-    }
-}
-
-/*
-
-=item C<Parrot_MIC* parrot_PIC_alloc_mic(const PARROT_INTERP, size_t n)>
-
-Allocate a new MIC structure for the C<n>th cached opcode in this
-bytecode segement.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-Parrot_MIC*
-parrot_PIC_alloc_mic(const PARROT_INTERP, size_t n)
-{
-    ASSERT_ARGS(parrot_PIC_alloc_mic)
-    Parrot_PIC_store * const store = interp->code->pic_store;
-    PARROT_ASSERT(n < store->n_mics);
-    return store->mic + n;
-}
-
-/*
-
-=item C<Parrot_PIC* parrot_PIC_alloc_pic(PARROT_INTERP)>
-
-Allocate a new PIC structure for the C<n>th cached opcode in this
-bytecode segement.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-Parrot_PIC*
-parrot_PIC_alloc_pic(PARROT_INTERP)
-{
-    ASSERT_ARGS(parrot_PIC_alloc_pic)
-    Parrot_PIC_store *store = interp->code->pic_store;
-    Parrot_PIC_store *new_store;
-
-    if (store->usable < sizeof (Parrot_PIC)) {
-        size_t size =
-            (size_t)(store->n_mics * POLYMORPHIC) * sizeof (Parrot_PIC);
-
-        if (size == 0)
-            size = 2 * sizeof (Parrot_PIC);
-
-        new_store               = (Parrot_PIC_store *)
-                    mem_sys_allocate_zeroed(size + sizeof (Parrot_PIC_store));
-        new_store->prev         = store;
-        interp->code->pic_store = new_store;
-
-        new_store->pic    = (Parrot_PIC *)((char *)new_store + size
-                          + sizeof (Parrot_PIC_store));
-        new_store->usable = size;
-
-        /* the addon store has only poly-morphic slots
-         * point the monomorphic to the old store */
-        new_store->mic    = store->mic;
-        new_store->n_mics = store->n_mics;
-        store             = new_store;
-    }
-    store->usable -= sizeof (Parrot_PIC);
-    return --store->pic;
-}
-
-/*
-
-=item C<void * parrot_pic_opcode(PARROT_INTERP, INTVAL op)>
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-void *
-parrot_pic_opcode(PARROT_INTERP, INTVAL op)
-{
-    ASSERT_ARGS(parrot_pic_opcode)
-#ifdef HAVE_COMPUTED_GOTO
-    op_lib_t *cg_lib;
-#endif
-    const int core = interp->run_core;
-
-    if (core == PARROT_SWITCH_CORE || core == PARROT_SWITCH_JIT_CORE)
-        return (void *)op;
-#ifdef HAVE_COMPUTED_GOTO
-    cg_lib = PARROT_CORE_CGP_OPLIB_INIT(1);
-    return ((void **)cg_lib->op_func_table)[op];
-#else
-    return NULL;
-#endif
-}
-
-/*
-
-=item C<static int pass_int(PARROT_INTERP, PMC *sig, const char *src_base, const
-void **src, char *dest_base, void * const *dest)>
-
-=cut
-
-*/
-
-static int
-pass_int(PARROT_INTERP, ARGIN(PMC *sig), ARGIN(const char *src_base),
-        ARGIN(const void **src), ARGOUT(char *dest_base), ARGIN(void * const *dest))
-{
-    ASSERT_ARGS(pass_int)
-    int i;
-    int n = VTABLE_elements(interp, sig);
-
-    for (i = 2; n; ++i, --n) {
-        const INTVAL arg = *(const INTVAL *)(src_base + ((const opcode_t*)src)[i]);
-        *(INTVAL *)(dest_base + ((const opcode_t*)dest)[i]) = arg;
-    }
-    return i;
-}
-
-/*
-
-=item C<static int pass_num(PARROT_INTERP, PMC *sig, const char *src_base, const
-void **src, char *dest_base, void * const *dest)>
-
-=cut
-
-*/
-
-static int
-pass_num(PARROT_INTERP, ARGIN(PMC *sig), ARGIN(const char *src_base),
-        ARGIN(const void **src), ARGOUT(char *dest_base), ARGIN(void * const *dest))
-{
-    ASSERT_ARGS(pass_num)
-    int i;
-    int n = VTABLE_elements(interp, sig);
-
-    for (i = 2; n; ++i, --n) {
-        const FLOATVAL arg = *(const FLOATVAL *)(src_base + ((const opcode_t*)src)[i]);
-        *(FLOATVAL *)(dest_base + ((const opcode_t*)dest)[i]) = arg;
-    }
-    return i;
-}
-
-/*
-
-=item C<static int pass_str(PARROT_INTERP, PMC *sig, const char *src_base, const
-void **src, char *dest_base, void * const *dest)>
-
-=cut
-
-*/
-
-static int
-pass_str(PARROT_INTERP, ARGIN(PMC *sig), ARGIN(const char *src_base),
-        ARGIN(const void **src), ARGOUT(char *dest_base), ARGIN(void * const *dest))
-{
-    ASSERT_ARGS(pass_str)
-    int i;
-    int n = VTABLE_elements(interp, sig);
-
-    for (i = 2; n; ++i, --n) {
-        STRING * const arg = *(STRING* const *)(src_base + ((const opcode_t*)src)[i]);
-        *(STRING* *)(dest_base + ((const opcode_t*)dest)[i]) = arg;
-    }
-
-    return i;
-}
-
-/*
-
-=item C<static int pass_pmc(PARROT_INTERP, PMC *sig, const char *src_base, const
-void **src, char *dest_base, void * const *dest)>
-
-=cut
-
-*/
-
-static int
-pass_pmc(PARROT_INTERP, ARGIN(PMC *sig), ARGIN(const char *src_base),
-        ARGIN(const void **src), ARGOUT(char *dest_base), ARGIN(void * const *dest))
-{
-    ASSERT_ARGS(pass_pmc)
-    int i;
-    int n = VTABLE_elements(interp, sig);
-
-    for (i = 2; n; ++i, --n) {
-        PMC * const arg = *(PMC* const *)(src_base + ((const opcode_t*)src)[i]);
-        *(PMC* *)(dest_base + ((const opcode_t*)dest)[i])= arg;
-    }
-    return i;
-}
-
-/*
-
-=item C<static int pass_mixed(PARROT_INTERP, PMC *sig, const char *src_base,
-void * const *src, char *dest_base, void * const *dest)>
-
-=cut
-
-*/
-
-static int
-pass_mixed(PARROT_INTERP, ARGIN(PMC *sig), ARGIN(const char *src_base),
-        ARGIN(void * const *src), ARGOUT(char *dest_base), ARGIN(void * const *dest))
-{
-    ASSERT_ARGS(pass_mixed)
-    int i;
-    INTVAL *bitp;
-    int n = VTABLE_elements(interp, sig);
-
-    ASSERT_SIG_PMC(sig);
-    GETATTR_FixedIntegerArray_int_array(interp, sig, bitp);
-
-    for (i = 2; n; ++i, --n) {
-        const INTVAL bits = *bitp++;
-        switch (bits) {
-            case PARROT_ARG_INTVAL:
-                {
-                const INTVAL argI = *(const INTVAL *)(src_base + ((const opcode_t*)src)[i]);
-                *(INTVAL *)(dest_base + ((const opcode_t*)dest)[i])= argI;
-                }
-                break;
-            case PARROT_ARG_INTVAL|PARROT_ARG_CONSTANT:
-                *(INTVAL *)(dest_base + ((const opcode_t*)dest)[i]) = (INTVAL)(src)[i];
-                break;
-            case PARROT_ARG_FLOATVAL:
-                {
-                const FLOATVAL argN = *(const FLOATVAL *)(src_base + ((const opcode_t*)src)[i]);
-                *(FLOATVAL *)(dest_base + ((const opcode_t*)dest)[i])= argN;
-                }
-                break;
-            case PARROT_ARG_FLOATVAL|PARROT_ARG_CONSTANT:
-                {
-                const FLOATVAL argN = *(const FLOATVAL*)(src)[i];
-                *(FLOATVAL *)(dest_base + ((const opcode_t*)dest)[i])= argN;
-                }
-                break;
-            case PARROT_ARG_STRING:
-                {
-                STRING *argS = *(STRING * const *)(src_base + ((const opcode_t *)src)[i]);
-
-                if (argS && PObj_constant_TEST(argS))
-                    argS = Parrot_str_new_COW(interp, argS);
-
-                *(STRING **)(dest_base + ((const opcode_t*)dest)[i]) = argS;
-                }
-                break;
-            case PARROT_ARG_STRING|PARROT_ARG_CONSTANT:
-                {
-                STRING *argS = (STRING *)(src)[i];
-                if (argS && PObj_constant_TEST(argS))
-                    argS = Parrot_str_new_COW(interp, argS);
-                *(STRING **)(dest_base + ((const opcode_t *)dest)[i]) = argS;
-                }
-                break;
-            case PARROT_ARG_PMC:
-                {
-                PMC* const argP = *(PMC * const *)(src_base + ((const opcode_t*)src)[i]);
-                *(PMC* *)(dest_base + ((const opcode_t*)dest)[i])= argP;
-                }
-                break;
-            case PARROT_ARG_PMC|PARROT_ARG_CONSTANT:
-                {
-                PMC* const argP = (PMC*)(src)[i];
-                *(PMC* *)(dest_base + ((const opcode_t*)dest)[i])= argP;
-                }
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, 1,
-                    "bogus signature 0x%x", bits);
-                break;
-        }
-    }
-    return i;
-}
-
-/*
-
-=item C<int parrot_pic_check_sig(PARROT_INTERP, PMC *sig1, PMC *sig2, int
-*type)>
-
-return argument count and type of the signature or -1 if not pic-able
-the type PARROT_ARG_CONSTANT stands for mixed types or constants
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-int
-parrot_pic_check_sig(PARROT_INTERP, ARGIN(PMC *sig1), ARGIN(PMC *sig2),
-        ARGOUT(int *type))
-{
-    ASSERT_ARGS(parrot_pic_check_sig)
-    int i, n, t0;
-
-    ASSERT_SIG_PMC(sig1);
-    ASSERT_SIG_PMC(sig2);
-
-    n = VTABLE_elements(interp, sig1);
-
-    if (n != VTABLE_elements(interp, sig2))
-        return -1;
-
-    if (!n) {
-        *type = 0;
-        return 0;
-    }
-
-    for (i = 0; i < n; ++i) {
-        int t1 = VTABLE_get_integer_keyed_int(interp, sig1, i);
-        int t2 = VTABLE_get_integer_keyed_int(interp, sig2, i);
-
-        if (i) {
-            t0 = 0;
-        }
-        else {
-            t0 = t1 & PARROT_ARG_TYPE_MASK;
-            *type = t0;
-        }
-
-        if (t1 & PARROT_ARG_CONSTANT) {
-            *type =  PARROT_ARG_CONSTANT;
-            t1   &= ~PARROT_ARG_CONSTANT;
-        }
-
-        if (t1 & ~PARROT_ARG_TYPE_MASK)
-            return -1;
-
-        if (t2 & PARROT_ARG_CONSTANT) {
-            *type =  PARROT_ARG_CONSTANT;
-            t2   &= ~PARROT_ARG_CONSTANT;
-        }
-
-        if (t2 & ~PARROT_ARG_TYPE_MASK)
-            return -1;
-
-        if (t2 != t1)
-            return -1;
-
-        if (t1 != t0)
-            *type = PARROT_ARG_CONSTANT;
-    }
-
-    return n;
-}
-
-/*
-
-=item C<static int is_pic_param(PARROT_INTERP, void **pc, Parrot_MIC *mic,
-opcode_t op)>
-
-=cut
-
-*/
-
-static int
-is_pic_param(PARROT_INTERP, ARGIN(void **pc), ARGOUT(Parrot_MIC *mic), opcode_t op)
-{
-    ASSERT_ARGS(is_pic_param)
-    PMC                           *sig2;
-    Parrot_Context                *caller_ctx;
-    opcode_t                      *args;
-    PMC                    * const sig1 = (PMC *)(pc[1]);
-    const Parrot_Context   * const ctx  = CONTEXT(interp);
-    int                            type = 0;
-
-    /* check params */
-
-    if (op == PARROT_OP_set_returns_pc) {
-        PMC * const ccont = ctx->current_cont;
-        if (!PMC_cont(ccont)->address)
-            return 0;
-        caller_ctx = PMC_cont(ccont)->to_ctx;
-        args       = caller_ctx->current_results;
-    }
-    else {
-        caller_ctx = ctx->caller_ctx;
-        args       = interp->current_args;
-    }
-
-    if (args) {
-        const INTVAL const_nr = args[1];
-        int          n;
-
-        /* check current_args signature */
-        sig2 = caller_ctx->constants[const_nr]->u.key;
-        n    = parrot_pic_check_sig(interp, sig1, sig2, &type);
-
-        if (n == -1)
-            return 0;
-    }
-    else {
-        if (VTABLE_elements(interp, sig1) == 0) {
-            sig2 = NULL;
-            type = 0;
-        }
-        else
-            return 0;
-    }
-
-    switch (type) {
-        case PARROT_ARG_INTVAL:
-            mic->lru.f.real_function = (funcptr_t)pass_int;
-            break;
-        case PARROT_ARG_FLOATVAL:
-            mic->lru.f.real_function = (funcptr_t)pass_num;
-            break;
-        case PARROT_ARG_STRING:
-            mic->lru.f.real_function = (funcptr_t)pass_str;
-            break;
-        case PARROT_ARG_PMC:
-            mic->lru.f.real_function = (funcptr_t)pass_pmc;
-            break;
-        case PARROT_ARG_CONSTANT:
-            mic->lru.f.real_function = (funcptr_t)pass_mixed;
-            break;
-        default:
-            return 0;
-    }
-
-    mic->m.sig = sig1;
-
-    /* remember this sig2 - it has to match the other end at call time */
-    mic->lru.u.signature = sig2;
-
-    return 1;
-}
-
-
-/*
-
-=item C<static int is_pic_func(PARROT_INTERP, void **pc, Parrot_MIC *mic, int
-core_type)>
-
-=cut
-
-*/
-
-static int
-is_pic_func(PARROT_INTERP, ARGIN(void **pc), ARGOUT(Parrot_MIC *mic), int core_type)
-{
-    ASSERT_ARGS(is_pic_func)
-    /*
-     * if we have these opcodes
-     *
-     *   set_args '..' ...
-     *   set_p_pc Px, PFunx
-     *   get_results '..' ...
-     *   invokecc_p Px
-     *
-     * and all args are matching the called sub and we don't have
-     * too many args, and only INTVAL or FLOATVAL, the
-     * whole sequence is replaced by the C<callr> pic opcode.
-     *
-     * Oh, I forgot to mention - the to-be-called C function is of
-     * course compiled on-the-fly by the JIT compiler ;)
-     *
-     * pc is at set_args
-     */
-
-    PMC *sub, *sig_results;
-    opcode_t *op, n;
-    int flags;
-
-    Parrot_Context * const ctx      = CONTEXT(interp);
-    PMC            * const sig_args = (PMC *)(pc[1]);
-
-    ASSERT_SIG_PMC(sig_args);
-    n                    = VTABLE_elements(interp, sig_args);
-    interp->current_args = (opcode_t*)pc + ctx->pred_offset;
-    pc                  += 2 + n;
-    op                   = (opcode_t*)pc + ctx->pred_offset;
-
-    if (*op != PARROT_OP_set_p_pc)
-        return 0;
-
-    do_prederef(pc, interp, core_type);
-    sub = (PMC *)(pc[2]);
-
-    PARROT_ASSERT(PObj_is_PMC_TEST(sub));
-
-    if (sub->vtable->base_type != enum_class_Sub)
-        return 0;
-
-    pc += 3;    /* results */
-    op  = (opcode_t *)pc + ctx->pred_offset;
-
-    if (*op != PARROT_OP_get_results_pc)
-        return 0;
-
-    do_prederef(pc, interp, core_type);
-    sig_results = (PMC *)(pc[1]);
-    ASSERT_SIG_PMC(sig_results);
-
-    ctx->current_results = (opcode_t *)pc + ctx->pred_offset;
-    if (!parrot_pic_is_safe_to_jit(interp, sub, sig_args, sig_results, &flags))
-        return 0;
-
-    mic->lru.f.real_function = parrot_pic_JIT_sub(interp, sub, flags);
-    mic->m.sig               = sig_args;
-
-    return 1;
-}
-
-/*
-
-=item C<void parrot_PIC_prederef(PARROT_INTERP, opcode_t op, void **pc_pred, int
-core)>
-
-Define either the normal prederef function or the PIC stub, if PIC for
-this opcode function is available. Called from C<do_prederef>.
-
-=cut
-
-*/
-
-void
-parrot_PIC_prederef(PARROT_INTERP, opcode_t op, ARGOUT(void **pc_pred), int core)
-{
-    ASSERT_ARGS(parrot_PIC_prederef)
-    op_func_t * const prederef_op_func = interp->op_lib->op_func_table;
-    opcode_t  * const cur_opcode       = (opcode_t *)pc_pred;
-    Parrot_MIC       *mic              = NULL;
-
-    if (parrot_PIC_op_is_cached(op)) {
-        const PackFile_ByteCode * const cs = interp->code;
-        size_t                          n  = cur_opcode
-                                           - (opcode_t *)cs->prederef.code;
-
-        /*
-         * pic_index is half the size of the code
-         * XXX if it's there - pbc_merge needs updates
-         */
-        PARROT_ASSERT(cs->pic_index);
-        n   = cs->pic_index->data[n / 2];
-        mic = parrot_PIC_alloc_mic(interp, n);
-    }
-
-    switch (op) {
-        case PARROT_OP_get_params_pc:
-            if (is_pic_param(interp, pc_pred, mic, op)) {
-                pc_pred[1] = (void *)mic;
-                op         = PARROT_OP_pic_get_params___pc;
-            }
-            break;
-        case PARROT_OP_set_returns_pc:
-            if (is_pic_param(interp, pc_pred, mic, op)) {
-                pc_pred[1] = (void *)mic;
-                op         = PARROT_OP_pic_set_returns___pc;
-            }
-            break;
-        case PARROT_OP_set_args_pc:
-            if (is_pic_func(interp, pc_pred, mic, core)) {
-                pc_pred[1] = (void *)mic;
-                op         = PARROT_OP_pic_callr___pc;
-            }
-            break;
-        default:
-            break;
-    }
-
-    /* rewrite opcode */
-    if (core == PARROT_SWITCH_CORE || core == PARROT_SWITCH_JIT_CORE)
-        *pc_pred = (void **)op;
-    else
-        *pc_pred = ((void **)prederef_op_func)[op];
-}
-
-/*
-
-=item C<void parrot_pic_find_infix_v_pp(PARROT_INTERP, PMC *left, PMC *right,
-Parrot_MIC *mic, opcode_t *cur_opcode)>
-
-=cut
-
-*/
-
-void
-parrot_pic_find_infix_v_pp(PARROT_INTERP, ARGIN(PMC *left), ARGIN(PMC *right),
-                ARGOUT(Parrot_MIC *mic), ARGOUT(opcode_t *cur_opcode))
-{
-    ASSERT_ARGS(parrot_pic_find_infix_v_pp)
-    /* unused; deprecated */
-}
-
-/*
-
-=back
-
-=head1 AUTHOR
-
-Leopold Toetsch with many hints from Ken Fox.
-
-=head1 SEE ALSO
-
-L<src/multidispatch.c>, L<src/object.c>, L<src/interp/interpreter.c>,
-L<ops/core_ops_cgp.c>, L<include/parrot/pic.h>, L<ops/pic.ops>
-
-=cut
-
-*/
-
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/orderedhash_revamp/src/pic_jit.c
==============================================================================
--- branches/orderedhash_revamp/src/pic_jit.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,604 +0,0 @@
-/*
-Copyright (C) 2006-2009, Parrot Foundation.
-$Id$
-
-=head1 NAME
-
-src/pic_jit.c - Polymorphic Inline Cache to JIT compilation
-
-=head1 DESCRIPTION
-
-Some statically known and simple subroutines are replaced by
-their JITted variants, if
-
-  - JIT is supported and can JIT subroutines
-  - arguments passing is simple
-  - the code is fully JITtable
-  - and more such checks
-
-TODO:
-
-  - save jit_info in sub
-  - check for multiple calls to the same sub
-    either reuse code or create new
-  - handle void calls/returns
-
-=head2 Functions
-
-=over 4
-
-=cut
-
-*/
-
-#include "parrot/parrot.h"
-#include "parrot/oplib/ops.h"
-#include "pmc/pmc_sub.h"
-
-/* HEADERIZER HFILE: include/parrot/pic.h */
-
-/* HEADERIZER BEGIN: static */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-
-PARROT_WARN_UNUSED_RESULT
-static int args_match_params(PARROT_INTERP,
-    ARGIN(PMC *sig_args),
-    ARGIN(const PackFile_ByteCode *seg),
-    ARGIN(const opcode_t *start))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4);
-
-PARROT_WARN_UNUSED_RESULT
-static int call_is_safe(PARROT_INTERP,
-    ARGIN(PMC *sub_pmc),
-    ARGMOD(opcode_t **set_args))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*set_args);
-
-PARROT_WARN_UNUSED_RESULT
-static int jit_can_compile_sub(PARROT_INTERP, ARGIN(PMC *sub_pmc))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-PARROT_WARN_UNUSED_RESULT
-static int ops_jittable(PARROT_INTERP,
-    ARGIN(PMC *sub),
-    ARGIN(PMC *sig_results),
-    ARGIN(const PackFile_ByteCode *seg),
-    ARGIN(opcode_t *pc),
-    ARGIN(const opcode_t *end),
-    ARGOUT(int *flags))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        __attribute__nonnull__(5)
-        __attribute__nonnull__(6)
-        __attribute__nonnull__(7)
-        FUNC_MODIFIES(*flags);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-static opcode_t * pic_test_func(PARROT_INTERP,
-    SHIM(INTVAL *sig_bits),
-    ARGOUT(void **args))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*args);
-
-PARROT_WARN_UNUSED_RESULT
-static int returns_match_results(PARROT_INTERP,
-    ARGIN(PMC *sig_ret),
-    ARGIN(PMC *sig_result))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3);
-
-#define ASSERT_ARGS_args_match_params __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sig_args) \
-    || PARROT_ASSERT_ARG(seg) \
-    || PARROT_ASSERT_ARG(start)
-#define ASSERT_ARGS_call_is_safe __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub_pmc) \
-    || PARROT_ASSERT_ARG(set_args)
-#define ASSERT_ARGS_jit_can_compile_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub_pmc)
-#define ASSERT_ARGS_ops_jittable __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sub) \
-    || PARROT_ASSERT_ARG(sig_results) \
-    || PARROT_ASSERT_ARG(seg) \
-    || PARROT_ASSERT_ARG(pc) \
-    || PARROT_ASSERT_ARG(end) \
-    || PARROT_ASSERT_ARG(flags)
-#define ASSERT_ARGS_pic_test_func __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(args)
-#define ASSERT_ARGS_returns_match_results __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(sig_ret) \
-    || PARROT_ASSERT_ARG(sig_result)
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: static */
-
-
-#ifdef HAVE_COMPUTED_GOTO
-#  include "parrot/oplib/core_ops_cgp.h"
-#endif
-
-#ifdef HAS_JIT
-#  include "parrot/exec.h"
-#  include "jit.h"
-
-extern const jit_arch_info *
-Parrot_jit_init(PARROT_INTERP);
-
-
-#  ifdef PIC_TEST
-/*
- * just for testing the whole scheme ...
-
-
-.sub main :main
-    .local int i
-    i = 32
-    i = __pic_test(i, 10)
-    print i
-    print "\n"
-.end
-.sub __pic_test
-    .param int i
-    .param int j
-    $I0 = i + j
-    .return ($I0)
-.end
-... prints 42, if PIC_TEST is 1, because the C function is called
-    with cgp and switch runcores.
-*/
-
-/*
-
-=item C<static opcode_t * pic_test_func(PARROT_INTERP, INTVAL *sig_bits, void
-**args)>
-
-Determines whether the given subroutine C<sub> can be JIT'd. Counts the
-number of registers used by the sub, and returns C<0> if more registers
-are used then JIT supports. Returns 1 if it does not use too many registers.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-static opcode_t *
-pic_test_func(PARROT_INTERP, SHIM(INTVAL *sig_bits), ARGOUT(void **args))
-{
-    ASSERT_ARGS(pic_test_func)
-    INTVAL * const result = (INTVAL*) args[0];
-    INTVAL   const i      = (INTVAL) args[1];
-    INTVAL   const j      = (INTVAL) args[2];
-
-    *result = i + j;
-
-    return args[3];
-}
-#  endif
-
-/*
-
-=item C<static int jit_can_compile_sub(PARROT_INTERP, PMC *sub_pmc)>
-
-Determines whether the given subroutine C<sub> can be JIT'd. Counts the
-number of registers used by the sub, and returns C<0> if more registers
-are used then JIT supports. Returns 1 if it does not use too many registers.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-static int
-jit_can_compile_sub(PARROT_INTERP, ARGIN(PMC *sub_pmc))
-{
-    ASSERT_ARGS(jit_can_compile_sub)
-    const jit_arch_info * const info = Parrot_jit_init(interp);
-    const jit_arch_regs * const regs = info->regs + JIT_CODE_SUB_REGS_ONLY;
-    INTVAL                     *n_regs_used;
-    Parrot_sub                 *sub;
-
-    PMC_get_sub(interp, sub_pmc, sub);
-    n_regs_used = sub->n_regs_used;
-
-    /* if the sub is using more regs than the arch has
-     * we don't JIT it at all
-     */
-    if (n_regs_used[REGNO_INT] > regs->n_mapped_I)
-        return 0;
-
-    if (n_regs_used[REGNO_NUM] > regs->n_mapped_F)
-        return 0;
-
-    /* if the Sub is using S regs, we can't JIT it yet */
-    if (n_regs_used[REGNO_STR])
-        return 0;
-
-    /* if the Sub is using more than 1 P reg, we can't JIT it yet
-     * the P reg could be a (recursive) call to a sub
-     */
-    if (n_regs_used[REGNO_PMC] > 1)
-        return 0;
-
-    return 1;
-}
-
-
-/*
-
-=item C<static int args_match_params(PARROT_INTERP, PMC *sig_args, const
-PackFile_ByteCode *seg, const opcode_t *start)>
-
-Returns C<1> if the passed arguments match the subroutine's parameter list.
-Returns C<0> otherwise.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-static int
-args_match_params(PARROT_INTERP, ARGIN(PMC *sig_args), ARGIN(const PackFile_ByteCode *seg),
-    ARGIN(const opcode_t *start))
-{
-    ASSERT_ARGS(args_match_params)
-    PMC *sig_params;
-    int  n, type;
-
-    if (*start != PARROT_OP_get_params_pc)
-        return 0;
-
-    sig_params = seg->const_table->constants[start[1]]->u.key;
-
-    /* verify that we actually can pass arguments */
-    ASSERT_SIG_PMC(sig_params);
-
-    n = parrot_pic_check_sig(interp, sig_args, sig_params, &type);
-
-    /* arg count mismatch */
-    if (n == -1)
-        return 0;
-
-    /* no args - this would be safe, if the JIT code could already
-    * deal with no args
-    * TODO
-    */
-    if (!n)
-        return 0;
-
-    switch (type & ~PARROT_ARG_CONSTANT) {
-        case PARROT_ARG_INTVAL:
-        case PARROT_ARG_FLOATVAL:
-            return 1;
-        default:
-            return 0;
-    }
-}
-
-/*
-
-=item C<static int returns_match_results(PARROT_INTERP, PMC *sig_ret, PMC
-*sig_result)>
-
-Returns 1 if the return values match the returned results. Returns C<0>
-otherwise.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-static int
-returns_match_results(PARROT_INTERP, ARGIN(PMC *sig_ret), ARGIN(PMC *sig_result))
-{
-    ASSERT_ARGS(returns_match_results)
-    int type;
-    const int n = parrot_pic_check_sig(interp, sig_ret, sig_result, &type);
-
-    /* arg count mismatch */
-    if (n == -1)
-        return 0;
-
-    /* no args - this would be safe, if the JIT code could already
-     * deal with no args
-     * TODO
-     */
-    if (!n)
-        return 0;
-
-    switch (type & ~PARROT_ARG_CONSTANT) {
-        case PARROT_ARG_INTVAL:
-        case PARROT_ARG_FLOATVAL:
-            return 1;
-        default:
-            return 0;
-    }
-}
-
-/*
-
-=item C<static int call_is_safe(PARROT_INTERP, PMC *sub_pmc, opcode_t
-**set_args)>
-
-Returns C<1> if the passed arguments match the subroutine's parameter list.
-Returns C<0> otherwise.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-static int
-call_is_safe(PARROT_INTERP, ARGIN(PMC *sub_pmc), ARGMOD(opcode_t **set_args))
-{
-    ASSERT_ARGS(call_is_safe)
-    PMC        *called, *sig_results;
-    Parrot_sub *sub;
-    PMC        *sig_args;
-    opcode_t   *pc  = *set_args;
-
-    PMC_get_sub(interp, sub_pmc, sub);
-    sig_args = sub->seg->const_table->constants[pc[1]]->u.key;
-
-    /* ignore the signature for now */
-    pc += 2 + VTABLE_elements(interp, sig_args);
-
-    if (*pc != PARROT_OP_set_p_pc)
-       return 0;
-
-    called = sub->seg->const_table->constants[pc[2]]->u.key;
-
-    /* we can JIT just recursive subs for now */
-    if (called != sub_pmc)
-        return 0;
-
-    pc += 3;
-
-    if (*pc != PARROT_OP_get_results_pc)
-        return 0;
-
-    sig_results  = sub->seg->const_table->constants[pc[1]]->u.key;
-    pc          += 2 + VTABLE_elements(interp, sig_results);
-
-    if (*pc != PARROT_OP_invokecc_p)
-        return 0;
-
-    pc        += 2;
-    *set_args  = pc;
-
-    return 1;
-}
-
-/*
-
-=item C<static int ops_jittable(PARROT_INTERP, PMC *sub, PMC *sig_results, const
-PackFile_ByteCode *seg, opcode_t *pc, const opcode_t *end, int *flags)>
-
-Returns 1 if the return values match the returned results. Returns C<0>
-otherwise.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-static int
-ops_jittable(PARROT_INTERP, ARGIN(PMC *sub), ARGIN(PMC *sig_results),
-        ARGIN(const PackFile_ByteCode *seg), ARGIN(opcode_t *pc),
-        ARGIN(const opcode_t *end), ARGOUT(int *flags))
-{
-    ASSERT_ARGS(ops_jittable)
-    while (pc < end) {
-        /* special opcodes which are handled, but not marked as JITtable */
-        int i;
-
-        const int               op      = *pc;
-        const op_info_t * const op_info = interp->op_info_table + op;
-        int                     n       = op_info->op_count;
-
-        switch (op) {
-            case PARROT_OP_returncc:
-            case PARROT_OP_get_params_pc:
-                goto op_is_ok;
-                break;
-            case PARROT_OP_set_returns_pc:
-                {
-                PMC * const sig_ret = seg->const_table->constants[pc[1]]->u.key;
-                if (!returns_match_results(interp, sig_ret, sig_results))
-                    return 0;
-                }
-                goto op_is_ok;
-                break;
-            case PARROT_OP_set_args_pc:
-                /* verify call, return address after the call */
-                if (!call_is_safe(interp, sub, &pc))
-                    return 0;
-                *flags |= JIT_CODE_RECURSIVE;
-                continue;
-            default:
-                /* non-jitted or JITted vtable */
-                if (op_jit[op].extcall != 0)
-                    return 0;
-                break;
-        }
-        /*
-         * there are some JITted opcodes like set_s_s, which we can't
-         * handle (yet)
-         */
-        for (i = 1; i < n; i++) {
-            const int type = op_info->types[i - 1];
-            switch (type) {
-                case PARROT_ARG_I:
-                case PARROT_ARG_N:
-                case PARROT_ARG_IC:
-                case PARROT_ARG_NC:
-                    break;
-                default:
-                    return 0;
-            }
-        }
-op_is_ok:
-        ADD_OP_VAR_PART(interp, seg, pc, n);
-        pc += n;
-    }
-    return 1;
-}
-
-#endif     /* HAS_JIT */
-
-
-/*
-
-=item C<int parrot_pic_is_safe_to_jit(PARROT_INTERP, PMC *sub_pmc, PMC
-*sig_args, PMC *sig_results, int *flags)>
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-int
-parrot_pic_is_safe_to_jit(PARROT_INTERP, ARGIN(PMC *sub_pmc), ARGIN(PMC *sig_args),
-        ARGIN(PMC *sig_results), ARGOUT(int *flags))
-{
-    ASSERT_ARGS(parrot_pic_is_safe_to_jit)
-#ifdef HAS_JIT
-    opcode_t   *base, *start, *end;
-    Parrot_sub *sub;
-
-    *flags = 0;
-
-    /*
-     * 0) if runcore setting doesn't contain JIT
-     *    forget it
-     */
-    if (!(interp->run_core & PARROT_JIT_CORE))
-        return 0;
-
-    /* 1) if the JIT system can't JIT_CODE_SUB_REGS_ONLY
-     *    or the sub is using too many registers
-     */
-    if (!jit_can_compile_sub(interp, sub_pmc))
-        return 0;
-
-    /*
-     * 2) check if get_params is matching set_args
-     */
-
-    PMC_get_sub(interp, sub_pmc, sub);
-    base  = sub->seg->base.data;
-    start = base + sub->start_offs;
-    end   = base + sub->end_offs;
-
-    if (!args_match_params(interp, sig_args, sub->seg, start))
-        return 0;
-
-    /*
-     * 3) verify if all opcodes are JITtable, also check set_returns
-     *   if it's reached
-     */
-    if (!ops_jittable(interp, sub_pmc, sig_results, sub->seg, start, end, flags))
-        return 0;
-
-    return 1;
-#else
-    UNUSED(interp);
-    UNUSED(sub_pmc);
-    UNUSED(sig_args);
-    UNUSED(sig_results);
-    UNUSED(flags);
-
-    return 0;
-#endif
-}
-
-/*
-
-=item C<funcptr_t parrot_pic_JIT_sub(PARROT_INTERP, PMC *sub_pmc, int flags)>
-
-=cut
-
-*/
-
-funcptr_t
-parrot_pic_JIT_sub(PARROT_INTERP, ARGIN(PMC *sub_pmc), int flags)
-{
-    ASSERT_ARGS(parrot_pic_JIT_sub)
-#ifdef HAS_JIT
-#  ifdef PIC_TEST
-    UNUSED(interp);
-    UNUSED(sub_pmc);
-    return (funcptr_t) pic_test_func;
-#  else
-    /*
-     * create JIT code - just a test
-     */
-    Parrot_sub        *sub;
-    opcode_t          *base;
-    opcode_t          *start;
-    opcode_t          *end;
-    Parrot_jit_info_t *jit_info;
-
-    PMC_get_sub(interp, sub_pmc, sub);
-    base  = sub->seg->base.data;
-    start = base + sub->start_offs;
-    end   = base + sub->end_offs;
-    /* TODO pass Sub */
-
-    jit_info = parrot_build_asm(interp,
-                         start, end, NULL, JIT_CODE_SUB_REGS_ONLY | flags);
-
-    if (!jit_info)
-        return NULLfunc;
-
-    return (funcptr_t) jit_info->arena.start;
-#  endif
-#else
-    UNUSED(interp);
-    UNUSED(sub_pmc);
-    UNUSED(flags);
-
-    return NULLfunc;
-#endif
-}
-
-
-/*
-
-=back
-
-=head1 AUTHOR
-
-Leopold Toetsch
-
-=head1 SEE ALSO
-
-F<src/pic.c>, F<src/jit.c>, F<ops/core_ops_cgp.c>,
-F<include/parrot/pic.h>, F<ops/pic.ops>
-
-=cut
-
-*/
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Modified: branches/orderedhash_revamp/src/pmc.c
==============================================================================
--- branches/orderedhash_revamp/src/pmc.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -4,11 +4,13 @@
 
 =head1 NAME
 
-src/pmc.c - The base vtable calling functions
+src/pmc.c
 
 =head1 DESCRIPTION
 
-=head2 Functions
+The base vtable calling functions
+
+=head1 FUNCTIONS
 
 =over 4
 
@@ -19,6 +21,7 @@
 #include "parrot/parrot.h"
 #include "pmc.str"
 #include "pmc/pmc_class.h"
+#include "pmc/pmc_callcontext.h"
 
 /* HEADERIZER HFILE: include/parrot/pmc.h */
 
@@ -42,14 +45,6 @@
     UINTVAL flags)
         __attribute__nonnull__(1);
 
-static INTVAL pmc_reuse_check_pmc_ext(PARROT_INTERP,
-    ARGMOD(PMC * pmc),
-    INTVAL newflags,
-    INTVAL flags)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(* pmc);
-
 PARROT_CANNOT_RETURN_NULL
 static PMC* pmc_reuse_no_init(PARROT_INTERP,
     ARGIN(PMC *pmc),
@@ -58,18 +53,15 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-#define ASSERT_ARGS_check_pmc_reuse_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_create_class_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_get_new_pmc_header __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_pmc_reuse_check_pmc_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_pmc_reuse_no_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_check_pmc_reuse_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_create_class_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_get_new_pmc_header __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_pmc_reuse_no_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
+    , PARROT_ASSERT_ARG(pmc))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -102,6 +94,47 @@
 
 /*
 
+=item C<void Parrot_pmc_destroy(PARROT_INTERP, PMC *pmc)>
+
+Destroy a PMC. Call his destroy vtable function if needed, and deallocate
+his attributes if they are automatically allocated.
+
+For internal usage of the PMC handling functions and garbage collection
+subsystem.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_pmc_destroy(PARROT_INTERP, ARGMOD(PMC *pmc))
+{
+    ASSERT_ARGS(Parrot_pmc_destroy)
+
+    if (PObj_custom_destroy_TEST(pmc))
+        VTABLE_destroy(interp, pmc);
+
+    PObj_gc_CLEAR(pmc);
+
+    if (PObj_is_PMC_shared_TEST(pmc) && PMC_sync(pmc))
+        Parrot_gc_free_pmc_sync(interp, pmc);
+
+    if (pmc->vtable->attr_size)
+        Parrot_gc_free_pmc_attributes(interp, pmc);
+    else
+        PMC_data(pmc) = NULL;
+
+#ifndef NDEBUG
+
+    pmc->vtable      = (VTABLE  *)0xdeadbeef;
+
+#endif
+
+}
+
+/*
+
 =item C<PMC * pmc_new(PARROT_INTERP, INTVAL base_type)>
 
 Creates a new PMC of type C<base_type> (which is an index into the list of PMC
@@ -229,18 +262,20 @@
     /* Singleton/const PMCs/types are not eligible */
     check_pmc_reuse_flags(interp, pmc->vtable->flags, new_vtable->flags);
 
-    /* Does the old PMC need any resources freed? */
-    if (PObj_active_destroy_TEST(pmc))
-        VTABLE_destroy(interp, pmc);
-
-    new_flags = pmc_reuse_check_pmc_ext(interp, pmc, new_flags, new_vtable->flags);
+    /* Free the old PMC resources. */
+    Parrot_pmc_destroy(interp, pmc);
 
-    /* we are a PMC + maybe is_PMC_EXT */
     PObj_flags_SETTO(pmc, PObj_is_PMC_FLAG | new_flags);
 
     /* Set the right vtable */
     pmc->vtable = new_vtable;
 
+    if (new_vtable->attr_size)
+        Parrot_gc_allocate_pmc_attributes(interp, pmc);
+
+    else
+        PMC_data(pmc) = NULL;
+
     return pmc;
 }
 
@@ -276,19 +311,18 @@
     /* Singleton/const PMCs/types are not eligible */
     check_pmc_reuse_flags(interp, pmc->vtable->flags, new_vtable->flags);
 
-    /* Does the old PMC need any resources freed? */
-    if (PObj_active_destroy_TEST(pmc))
-        VTABLE_destroy(interp, pmc);
-
-    new_flags = pmc_reuse_check_pmc_ext(interp, pmc,
-        new_flags, new_vtable->flags);
+    Parrot_pmc_destroy(interp, pmc);
 
-    /* we are a PMC + maybe is_PMC_EXT */
     PObj_flags_SETTO(pmc, PObj_is_PMC_FLAG | new_flags);
 
     /* Set the right vtable */
     pmc->vtable = new_vtable;
 
+    if (new_vtable->attr_size)
+        Parrot_gc_allocate_pmc_attributes(interp, pmc);
+    else
+        PMC_data(pmc) = NULL;
+
     return pmc;
 }
 
@@ -341,45 +375,6 @@
 
 /*
 
-=item C<static INTVAL pmc_reuse_check_pmc_ext(PARROT_INTERP, PMC * pmc, INTVAL
-newflags, INTVAL flags)>
-
-We are converting one PMC type into another, such as in C<pmc_reuse> or
-C<pmc_reuse_by_class>. Check to make sure that we have a pmc_ext if we need
-one, and that we don't have it if we don't need it. Returns the updated
-flags field with the C<PObj_is_PMC_EXT> flag set if necessary.
-
-=cut
-
-*/
-
-static INTVAL
-pmc_reuse_check_pmc_ext(PARROT_INTERP, ARGMOD(PMC * pmc),
-    INTVAL newflags, INTVAL flags)
-{
-    ASSERT_ARGS(pmc_reuse_check_pmc_ext)
-    /* Do we have an extension area? */
-    INTVAL const has_ext = (PObj_is_PMC_EXT_TEST(pmc) && pmc->pmc_ext);
-
-    /* Do we need one? */
-    if (flags & VTABLE_PMC_NEEDS_EXT) {
-        /* If we need an ext area, go allocate one */
-        Parrot_gc_add_pmc_ext(interp, pmc);
-        newflags |= PObj_is_PMC_EXT_FLAG;
-        PARROT_ASSERT((newflags & PObj_is_PMC_EXT_FLAG) != 0);
-    }
-    else {
-        Parrot_gc_free_pmc_ext(interp, pmc);
-        PMC_data(pmc) = NULL;
-        newflags &= ~PObj_is_PMC_EXT_FLAG;
-        PARROT_ASSERT((newflags & PObj_is_PMC_EXT_FLAG) == 0);
-        PARROT_ASSERT(pmc->pmc_ext == NULL);
-    }
-    return newflags;
-}
-
-/*
-
 =item C<static PMC * get_new_pmc_header(PARROT_INTERP, INTVAL base_type, UINTVAL
 flags)>
 
@@ -456,21 +451,14 @@
         vtable = interp->vtables[base_type];
     }
 
-    if (vtable_flags & VTABLE_PMC_NEEDS_EXT) {
-        flags |= PObj_is_PMC_EXT_FLAG;
-        if (vtable_flags & VTABLE_IS_SHARED_FLAG)
-            flags |= PObj_is_PMC_shared_FLAG;
-    }
+    if (vtable_flags & VTABLE_IS_SHARED_FLAG)
+        flags |= PObj_is_PMC_shared_FLAG;
 
     pmc            = Parrot_gc_new_pmc_header(interp, flags);
     pmc->vtable    = vtable;
 
-#if GC_VERBOSE
-    if (Interp_flags_TEST(interp, PARROT_TRACE_FLAG)) {
-        /* XXX make a more verbose trace flag */
-        fprintf(stderr, "\t=> new %p type %d\n", pmc, (int)base_type);
-    }
-#endif
+    if (vtable->attr_size)
+        Parrot_gc_allocate_pmc_attributes(interp, pmc);
 
     return pmc;
 }
@@ -810,11 +798,10 @@
      * original because we have a singleton. Just set the singleton to
      * be our class object, but don't mess with its vtable.  */
     if ((interp->vtables[type]->flags & VTABLE_PMC_IS_SINGLETON)
-    &&  (_class == _class->vtable->pmc_class)) {
+    &&  (_class == _class->vtable->pmc_class))
         interp->vtables[type]->pmc_class = _class;
-    }
     else {
-        Parrot_gc_free_pmc_ext(interp, _class);
+        Parrot_gc_free_pmc_sync(interp, _class);
         gc_flag_CLEAR(is_special_PMC, _class);
         PObj_is_PMC_shared_CLEAR(_class);
         interp->vtables[type]->pmc_class = _class;
@@ -877,7 +864,7 @@
 
             /* anchor at parent, aka current_namespace, that is 'parrot' */
             VTABLE_set_pmc_keyed_str(interp,
-                    CONTEXT(interp)->current_namespace, class_name, ns);
+                    Parrot_pcc_get_namespace(interp, CURRENT_CONTEXT(interp)), class_name, ns);
         }
 
         _class = vtable->pmc_class;

Modified: branches/orderedhash_revamp/src/pmc/addrregistry.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/addrregistry.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/addrregistry.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2005-2008, Parrot Foundation.
+Copyright (C) 2005-2009, Parrot Foundation.
 $Id$
 
 =head1 NAME
@@ -25,11 +25,10 @@
 
 */
 
-/* included manually to prevent breaking C++ builds -- see RT #56534 */
 #include "parrot/hash.h"
-#include "pmc_hash.h"
+#include "pmc/pmc_hash.h"
 
-pmclass AddrRegistry extends Hash need_ext provides hash {
+pmclass AddrRegistry extends Hash provides hash auto_attrs {
 /*
 
 =item C<void init()>
@@ -47,10 +46,7 @@
                 int_compare,
                 key_hash_int);
 
-        Parrot_AddrRegistry_attributes *attrs =
-            mem_allocate_zeroed_typed(Parrot_AddrRegistry_attributes);
-        PMC_data(SELF) = attrs;
-        SELF.set_pointer(registry);
+        SET_ATTR_hash(INTERP, SELF, registry);
         PObj_custom_mark_destroy_SETALL(SELF);
 
     }
@@ -74,8 +70,11 @@
 */
 
     VTABLE INTVAL get_integer_keyed(PMC *key) {
-        Hash   *hash  = (Hash *)SELF.get_pointer();
-        void   *value = parrot_hash_get(INTERP, hash, key);
+        Hash       *hash;
+        const void *value;
+
+        GET_ATTR_hash(interp, SELF, hash);
+        value = parrot_hash_get(INTERP, hash, key);
 
         if (value)
             return (INTVAL)value;
@@ -84,11 +83,19 @@
     }
 
     VTABLE INTVAL elements() {
-        return parrot_hash_size(INTERP, (Hash *)SELF.get_pointer());
+        const Hash *hash;
+
+        GET_ATTR_hash(interp, SELF, hash);
+
+        return parrot_hash_size(INTERP, hash);
     }
 
     VTABLE INTVAL get_bool() {
-        return parrot_hash_size(INTERP, (Hash *)SELF.get_pointer()) != 0;
+        const Hash *hash;
+
+        GET_ATTR_hash(interp, SELF, hash);
+
+        return parrot_hash_size(INTERP, hash) != 0;
     }
 /*
 
@@ -112,11 +119,15 @@
 */
 
     VTABLE void set_pmc_keyed(PMC *key, PMC *value) {
-        Hash       * const hash = (Hash *)SELF.get_pointer();
-        void       *oldval      = parrot_hash_get(INTERP, hash, key);
-        long        newval      = 1;
+        const void *oldval;
+        long        newval = 1;
+        Hash       *hash;
         UNUSED(value);
 
+        GET_ATTR_hash(interp, SELF, hash);
+
+        oldval = parrot_hash_get(INTERP, hash, key);
+
         if (oldval)
             newval += (long)oldval;
 
@@ -124,13 +135,17 @@
     }
 
     VTABLE void set_integer_keyed(PMC *key, INTVAL value) {
-        Hash *hash = (Hash *)SELF.get_pointer();
+        Hash *hash;
+        GET_ATTR_hash(interp, SELF, hash);
         parrot_hash_put(INTERP, hash, key, (void *)value);
     }
 
     VTABLE void delete_keyed(PMC *key) {
-        Hash       * const hash  = (Hash *)SELF.get_pointer();
-        void              *value = parrot_hash_get(INTERP, hash, key);
+        Hash       *hash;
+        void       *value;
+
+        GET_ATTR_hash(interp, SELF, hash);
+        value = parrot_hash_get(INTERP, hash, key);
 
         /* these casts look bad, but they avoid type punning warnings with -O */
         if (value) {
@@ -144,24 +159,6 @@
         }
     }
 
-/*
-
-=item C<PMC *get_pmc_keyed(PMC *key)>
-
-If called from iteration, return the key PMC, else PMCNULL is returned.
-
-=cut
-
-*/
-
-    VTABLE PMC *get_pmc_keyed(PMC *key) {
-        Hash * const hash = (Hash *)SELF.get_pointer();
-
-        if (KEY_IS_HASH_ITERATOR(key))
-            return (PMC *)parrot_hash_get_idx(INTERP, hash, key);
-
-        return PMCNULL;
-    }
 }
 
 /*

Modified: branches/orderedhash_revamp/src/pmc/array.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/array.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/array.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -79,7 +79,7 @@
 */
 
 static PMC *Parrot_Array_set_pmc_ptr(PARROT_INTERP, List *list, INTVAL key) {
-    void * const ret = list_get(interp, list, key, enum_type_PMC);
+    void * const ret = Parrot_pmc_array_get(interp, list, key, enum_type_PMC);
     PMC  *value;
 
     if (ret == NULL)
@@ -89,7 +89,7 @@
     /* assign into a sparse or not yet set value */
     if (ret == (void *)-1 || *(PMC **)ret == NULL) {
         value = undef(interp);
-        list_assign(interp, list, key, value, enum_type_PMC);
+        Parrot_pmc_array_assign(interp, list, key, value, enum_type_PMC);
     }
     else
         value = *(PMC **)ret;
@@ -98,7 +98,7 @@
 }
 
 
-pmclass Array need_ext provides array {
+pmclass Array provides array {
 
 /*
 
@@ -108,30 +108,16 @@
 
 =over 4
 
-=item C<void class_init()>
-
-Class initialization. Creates the required memory pools.
-
-=cut
-
-*/
-
-    void class_init() {
-
-    }
-
-/*
-
 =item C<void init()>
 
-Initializes the PMC by calling the underlying C<list_new()> function.
+Initializes the PMC by calling the underlying C<Parrot_pmc_array_new()> function.
 
 =cut
 
 */
 
     VTABLE void init() {
-        list_pmc_new(INTERP, SELF);
+        Parrot_pmc_array_pmc_new(INTERP, SELF);
         PObj_custom_mark_SET(SELF);
     }
 
@@ -147,7 +133,7 @@
 */
 
     VTABLE void init_pmc(PMC *init) {
-        list_pmc_new_init(INTERP, SELF, init);
+        Parrot_pmc_array_pmc_new_init(INTERP, SELF, init);
         PObj_custom_mark_SET(SELF);
     }
 
@@ -198,7 +184,7 @@
 */
 
     VTABLE void mark() {
-        list_mark(INTERP, (List *)PMC_data(SELF));
+        Parrot_pmc_array_mark(INTERP, (List *)PMC_data(SELF));
     }
 
 /*
@@ -212,7 +198,7 @@
 */
 
     VTABLE PMC *clone() {
-        List       *l    = list_clone(INTERP, (List *)PMC_data(SELF));
+        List       *l    = Parrot_pmc_array_clone(INTERP, (List *)PMC_data(SELF));
         PMC * const dest = pmc_new_noinit(INTERP, SELF->vtable->base_type);
 
         PObj_custom_mark_SET(dest);
@@ -450,7 +436,7 @@
     VTABLE PMC *get_pmc_keyed_int(INTVAL key) {
 
         return retval(INTERP,
-            list_get(INTERP, (List *)PMC_data(SELF), key, enum_type_PMC));
+            Parrot_pmc_array_get(INTERP, (List *)PMC_data(SELF), key, enum_type_PMC));
     }
 
 /*
@@ -495,7 +481,7 @@
 */
 
     VTABLE void set_integer_native(INTVAL size) {
-        list_set_length(INTERP, (List *)PMC_data(SELF), size);
+        Parrot_pmc_array_set_length(INTERP, (List *)PMC_data(SELF), size);
     }
 /*
 
@@ -509,7 +495,7 @@
 
     VTABLE void set_integer_same(PMC *value) {
         const INTVAL size = VTABLE_elements(INTERP, value);
-        list_set_length(INTERP, (List *)PMC_data(SELF), size);
+        Parrot_pmc_array_set_length(INTERP, (List *)PMC_data(SELF), size);
     }
 
 /*
@@ -682,7 +668,7 @@
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
                 "Array index out of bounds!");
 
-        list_assign(INTERP, (List *)PMC_data(SELF), idx,
+        Parrot_pmc_array_assign(INTERP, (List *)PMC_data(SELF), idx,
             (void *)src, enum_type_PMC);
     }
 
@@ -794,7 +780,7 @@
     VTABLE void unshift_integer(INTVAL value) {
         PMC * const val = undef(INTERP);
 
-        list_unshift(INTERP, (List *)PMC_data(SELF), val, enum_type_PMC);
+        Parrot_pmc_array_unshift(INTERP, (List *)PMC_data(SELF), val, enum_type_PMC);
         VTABLE_set_integer_native(INTERP, val, value);
     }
 
@@ -812,7 +798,7 @@
     VTABLE void unshift_float(FLOATVAL value) {
         PMC * const val = undef(INTERP);
 
-        list_unshift(INTERP, (List *)PMC_data(SELF), val, enum_type_PMC);
+        Parrot_pmc_array_unshift(INTERP, (List *)PMC_data(SELF), val, enum_type_PMC);
         VTABLE_set_number_native(INTERP, val, value);
     }
 
@@ -829,7 +815,7 @@
 
     VTABLE void unshift_string(STRING *value) {
         PMC * const val = undef(INTERP);
-        list_unshift(INTERP, (List *)PMC_data(SELF), val, enum_type_PMC);
+        Parrot_pmc_array_unshift(INTERP, (List *)PMC_data(SELF), val, enum_type_PMC);
         VTABLE_set_string_native(INTERP, val, value);
     }
 
@@ -845,7 +831,7 @@
 */
 
     VTABLE void unshift_pmc(PMC *value) {
-        list_unshift(INTERP, (List *)PMC_data(SELF), value, enum_type_PMC);
+        Parrot_pmc_array_unshift(INTERP, (List *)PMC_data(SELF), value, enum_type_PMC);
     }
 
 /*
@@ -905,7 +891,7 @@
 
     VTABLE PMC *pop_pmc() {
         return retval(INTERP,
-            list_pop(INTERP, (List *)PMC_data(SELF), enum_type_PMC));
+            Parrot_pmc_array_pop(INTERP, (List *)PMC_data(SELF), enum_type_PMC));
     }
 
 /*
@@ -965,7 +951,7 @@
 
     VTABLE PMC *shift_pmc() {
         return retval(INTERP,
-            list_shift(INTERP, (List *)PMC_data(SELF), enum_type_PMC));
+            Parrot_pmc_array_shift(INTERP, (List *)PMC_data(SELF), enum_type_PMC));
     }
 
 /*
@@ -987,7 +973,7 @@
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
                 "Type mismatch in splice");
 
-        list_splice(INTERP, (List *)PMC_data(SELF),
+        Parrot_pmc_array_splice(INTERP, (List *)PMC_data(SELF),
             (List *)PMC_data(value), offset, count);
     }
 
@@ -1004,7 +990,7 @@
     VTABLE INTVAL defined_keyed_int(INTVAL key) {
         PMC  *value;
         void * const ret =
-            list_get(INTERP, (List *)PMC_data(pmc), key, enum_type_PMC);
+            Parrot_pmc_array_get(INTERP, (List *)PMC_data(pmc), key, enum_type_PMC);
 
         if (ret == NULL || ret == (void *) -1)
             return 0;
@@ -1055,7 +1041,7 @@
 */
 
     VTABLE INTVAL exists_keyed_int(INTVAL key) {
-        void * ret = list_get(INTERP,
+        void * ret = Parrot_pmc_array_get(INTERP,
             (List *)PMC_data(pmc), key, enum_type_PMC);
 
         if (ret == NULL || ret == (void *)-1)
@@ -1102,7 +1088,7 @@
 */
 
     VTABLE void delete_keyed_int(INTVAL key) {
-        list_splice(INTERP, (List *)PMC_data(pmc), NULL, key, 1);
+        Parrot_pmc_array_splice(INTERP, (List *)PMC_data(pmc), NULL, key, 1);
     }
 
 /*
@@ -1117,7 +1103,7 @@
 
     VTABLE void delete_keyed(PMC *key) {
         const INTVAL ix = VTABLE_get_integer(INTERP, key);
-        list_splice(INTERP, (List *)PMC_data(pmc), NULL, ix, 1);
+        Parrot_pmc_array_splice(INTERP, (List *)PMC_data(pmc), NULL, ix, 1);
     }
 
 /*
@@ -1155,13 +1141,8 @@
         return 1;
     }
 
-/*
-
-=item C<PMC *slice(PMC *key, INTVAL f)>
-
-Return a new iterator for the slice PMC C<key> if f == 0.
 
-Return a new pythonic array slice if f == 1.
+/*
 
 =item C<PMC *get_iter()>
 
@@ -1171,18 +1152,6 @@
 
 */
 
-    VTABLE PMC *slice(PMC *key, INTVAL f) {
-        if (f == 0) {
-            STRING * const name = CONST_STRING(interp, "set_key");
-            PMC * const iter = pmc_new_init(INTERP, enum_class_Iterator, SELF);
-            Parrot_PCCINVOKE(interp, iter, name, "P->", key);
-            return iter;
-        }
-
-        Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
-                "Array: Unknown slice type");
-    }
-
     VTABLE PMC *get_iter() {
         return pmc_new_init(INTERP, enum_class_ArrayIterator, SELF);
     }
@@ -1200,7 +1169,7 @@
 */
 
     VTABLE void visit(visit_info *info) {
-        list_visit(INTERP, (List *)PMC_data(SELF), info);
+        Parrot_pmc_array_visit(INTERP, (List *)PMC_data(SELF), info);
         SUPER(info);
     }
 
@@ -1215,9 +1184,8 @@
 */
 
     VTABLE void freeze(visit_info *info) {
-        IMAGE_IO * const io = info->image_io;
         SUPER(info);
-        VTABLE_push_integer(INTERP, io, VTABLE_elements(INTERP, SELF));
+        VTABLE_push_integer(INTERP, info, VTABLE_elements(INTERP, SELF));
     }
 
 /*
@@ -1231,13 +1199,9 @@
 */
 
     VTABLE void thaw(visit_info *info) {
-        IMAGE_IO * const io = info->image_io;
-
         SUPER(info);
-        if (info->extra_flags == EXTRA_IS_NULL) {
-            SELF.set_integer_native(VTABLE_shift_integer(INTERP, io));
+        SELF.set_integer_native(VTABLE_shift_integer(INTERP, info));
     }
-}
 
 /*
 
@@ -1271,7 +1235,7 @@
 
             for (i = 0; i < max; ++i) {
                 PMC * const value =
-                    (PMC *)list_get(INTERP, PMC_data_typed(ret, List *),
+                    (PMC *)Parrot_pmc_array_get(INTERP, PMC_data_typed(ret, List *),
                                  i, enum_type_PMC);
 
                 if (!PMC_IS_NULL(value)) {
@@ -1279,7 +1243,7 @@
                     PMC * const new_value = VTABLE_share_ro(INTERP, value);
 
                     if (new_value != value)
-                        list_assign(INTERP, PMC_data_typed(ret, List *),
+                        Parrot_pmc_array_assign(INTERP, PMC_data_typed(ret, List *),
                             i, new_value, enum_type_PMC);
                 }
             }

Modified: branches/orderedhash_revamp/src/pmc/arrayiterator.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/arrayiterator.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/arrayiterator.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -51,7 +51,7 @@
 
 */
 
-pmclass ArrayIterator extends Iterator no_ro {
+pmclass ArrayIterator extends Iterator no_ro auto_attrs {
     ATTR PMC    *array;     /* the array which this Iterator iterates */
     ATTR INTVAL  pos;       /* Current position of iterator for forward iterator */
                             /* Previous position of iterator for reverse iterator */
@@ -85,30 +85,13 @@
 */
 
     VTABLE void init_pmc(PMC *array) {
-        Parrot_ArrayIterator_attributes * const attrs =
-            mem_allocate_zeroed_typed(Parrot_ArrayIterator_attributes);
 
-        attrs->array     = array;
-        PMC_data(SELF)   = attrs;
+        SET_ATTR_array(interp, SELF, array);
 
-        PObj_custom_mark_destroy_SETALL(SELF);
+        PObj_custom_mark_SET(SELF);
 
         /* by default, iterate from start */
-        SELF.set_integer_native(ITERATE_FROM_START);
-    }
-
-/*
-
-=item C<void destroy()>
-
-destroys this PMC
-
-=cut
-
-*/
-
-    VTABLE void destroy() {
-        mem_sys_free(PMC_data(SELF));
+        STATICSELF.set_integer_native(ITERATE_FROM_START);
     }
 
 /*
@@ -123,9 +106,10 @@
 
     VTABLE void mark() {
         PMC *array;
+
         GET_ATTR_array(INTERP, SELF, array);
-        if (array)
-             Parrot_gc_mark_PObj_alive(INTERP, (PObj *)array);
+
+        Parrot_gc_mark_PMC_alive(INTERP, array);
     }
 
 /*
@@ -136,15 +120,19 @@
 
 */
     VTABLE PMC* clone() {
-        Parrot_ArrayIterator_attributes * const attrs =
-                PARROT_ARRAYITERATOR(SELF);
-        PMC                             * const clone =
-                pmc_new_init(INTERP, enum_class_ArrayIterator, attrs->array);
-        Parrot_ArrayIterator_attributes * const clone_attrs =
-                PARROT_ARRAYITERATOR(clone);
+        INTVAL pos, reverse;
+        PMC   *array;
+        PMC   *clone;
+
+        GET_ATTR_array(interp, SELF, array);
+        GET_ATTR_pos(interp, SELF, pos);
+        GET_ATTR_reverse(interp, SELF, reverse);
+
+        clone = pmc_new_init(INTERP, enum_class_ArrayIterator, array);
+
+        SET_ATTR_pos(interp, clone, pos);
+        SET_ATTR_reverse(interp, clone, reverse);
 
-        clone_attrs->pos     = attrs->pos;
-        clone_attrs->reverse = attrs->reverse;
         return clone;
     }
 
@@ -159,7 +147,7 @@
 */
 
     VTABLE INTVAL get_bool() {
-        return SELF.elements() > 0;
+        return STATICSELF.elements() > 0;
     }
 
 /*
@@ -173,16 +161,23 @@
 */
 
     VTABLE INTVAL elements() {
-        Parrot_ArrayIterator_attributes * const attrs =
-                PARROT_ARRAYITERATOR(SELF);
-        if (attrs->reverse)
-            return attrs->pos;
-        else
-            return attrs->length - attrs->pos;
+        INTVAL reverse, pos, length;
+
+        GET_ATTR_reverse(interp, SELF, reverse);
+
+        if (reverse) {
+            GET_ATTR_pos(interp, SELF, pos);
+            return pos;
+        }
+        else {
+            GET_ATTR_length(interp, SELF, length);
+            GET_ATTR_pos(interp, SELF, pos);
+            return length - pos;
+        }
     }
 
     VTABLE INTVAL get_integer() {
-        return SELF.elements();
+        return STATICSELF.elements();
     }
 
 /*
@@ -199,17 +194,21 @@
 */
 
     VTABLE void set_integer_native(INTVAL value) {
-        Parrot_ArrayIterator_attributes * const attrs =
-                PARROT_ARRAYITERATOR(SELF);
+        PMC *array;
+
         if (value == ITERATE_FROM_START) {
-            attrs->reverse   = 0;
-            attrs->pos       = 0;
-            attrs->length    = VTABLE_elements(INTERP, attrs->array);
+            GET_ATTR_array(interp, SELF, array);
+            SET_ATTR_reverse(interp, SELF, 0);
+            SET_ATTR_pos(interp, SELF, 0);
+            SET_ATTR_length(interp, SELF, VTABLE_elements(INTERP, array));
         }
         else if (value == ITERATE_FROM_END) {
-            attrs->reverse   = 1;
-            attrs->pos       = attrs->length
-                             = VTABLE_elements(INTERP, attrs->array);
+            INTVAL element;
+            GET_ATTR_array(interp, SELF, array);
+            element = VTABLE_elements(INTERP, array);
+            SET_ATTR_reverse(interp, SELF, 1);
+            SET_ATTR_length(interp, SELF, element);
+            SET_ATTR_pos(interp, SELF, element);
         }
         else
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
@@ -244,14 +243,20 @@
 */
 
     VTABLE INTVAL shift_integer() {
-        Parrot_ArrayIterator_attributes * const attrs =
-                PARROT_ARRAYITERATOR(SELF);
+        INTVAL pos, length;
+        PMC   *array;
+
+        GET_ATTR_pos(INTERP, SELF, pos);
+        GET_ATTR_length(INTERP, SELF, length);
 
-        if (attrs->pos >= attrs->length)
+        if (pos >= length)
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
                 "StopIteration");
 
-        return VTABLE_get_integer_keyed_int(INTERP, attrs->array, attrs->pos++);
+        GET_ATTR_array(INTERP, SELF, array);
+        SET_ATTR_pos(INTERP, SELF, pos+1);
+
+        return VTABLE_get_integer_keyed_int(INTERP, array, pos);
     }
 
 /*
@@ -263,14 +268,19 @@
 */
 
     VTABLE FLOATVAL shift_float() {
-        Parrot_ArrayIterator_attributes * const attrs =
-                PARROT_ARRAYITERATOR(SELF);
+        INTVAL pos;
+        PMC   *array;
+
+        GET_ATTR_pos(INTERP, SELF, pos);
 
         if (!STATICSELF.get_bool())
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
                 "StopIteration");
 
-        return VTABLE_get_number_keyed_int(INTERP, attrs->array, attrs->pos++);
+        GET_ATTR_array(INTERP, SELF, array);
+        SET_ATTR_pos(INTERP, SELF, pos+1);
+
+        return VTABLE_get_number_keyed_int(INTERP, array, pos);
     }
 
 
@@ -283,14 +293,19 @@
 */
 
     VTABLE STRING *shift_string() {
-        Parrot_ArrayIterator_attributes * const attrs =
-                PARROT_ARRAYITERATOR(SELF);
+        INTVAL pos;
+        PMC   *array;
+
+        GET_ATTR_pos(INTERP, SELF, pos);
 
         if (!STATICSELF.get_bool())
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
                 "StopIteration");
 
-        return VTABLE_get_string_keyed_int(INTERP, attrs->array, attrs->pos++);
+        GET_ATTR_array(INTERP, SELF, array);
+        SET_ATTR_pos(INTERP, SELF, pos+1);
+
+        return VTABLE_get_string_keyed_int(INTERP, array, pos);
     }
 
 /*
@@ -305,14 +320,20 @@
 */
 
     VTABLE PMC *shift_pmc() {
-        Parrot_ArrayIterator_attributes * const attrs =
-                PARROT_ARRAYITERATOR(SELF);
+        INTVAL pos;
+        PMC   *array;
+
+        GET_ATTR_pos(INTERP, SELF, pos);
+
 
         if (!STATICSELF.get_bool())
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
                 "StopIteration");
 
-        return VTABLE_get_pmc_keyed_int(INTERP, attrs->array, attrs->pos++);
+        GET_ATTR_array(INTERP, SELF, array);
+        SET_ATTR_pos(INTERP, SELF, pos+1);
+
+        return VTABLE_get_pmc_keyed_int(INTERP, array, pos);
     }
 
 
@@ -328,14 +349,20 @@
 */
 
     VTABLE INTVAL pop_integer() {
-        Parrot_ArrayIterator_attributes * const attrs =
-                PARROT_ARRAYITERATOR(SELF);
+        INTVAL pos;
+        PMC   *array;
+
+        GET_ATTR_pos(INTERP, SELF, pos);
+
 
         if (!STATICSELF.get_bool())
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
                 "StopIteration");
 
-        return VTABLE_get_integer_keyed_int(INTERP, attrs->array, --attrs->pos);
+        GET_ATTR_array(INTERP, SELF, array);
+        SET_ATTR_pos(INTERP, SELF, --pos);
+
+        return VTABLE_get_integer_keyed_int(INTERP, array, pos);
     }
 
 /*
@@ -347,14 +374,19 @@
 */
 
     VTABLE FLOATVAL pop_float() {
-        Parrot_ArrayIterator_attributes * const attrs =
-                PARROT_ARRAYITERATOR(SELF);
+        INTVAL pos;
+        PMC   *array;
+
+        GET_ATTR_pos(INTERP, SELF, pos);
 
         if (!STATICSELF.get_bool())
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
                 "StopIteration");
 
-        return VTABLE_get_number_keyed_int(INTERP, attrs->array, --attrs->pos);
+        GET_ATTR_array(INTERP, SELF, array);
+        SET_ATTR_pos(INTERP, SELF, --pos);
+
+        return VTABLE_get_number_keyed_int(INTERP, array, pos);
     }
 
 
@@ -367,14 +399,19 @@
 */
 
     VTABLE STRING *pop_string() {
-        Parrot_ArrayIterator_attributes * const attrs =
-                PARROT_ARRAYITERATOR(SELF);
+        INTVAL pos;
+        PMC   *array;
+
+        GET_ATTR_pos(INTERP, SELF, pos);
 
         if (!STATICSELF.get_bool())
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
                 "StopIteration");
 
-        return VTABLE_get_string_keyed_int(INTERP, attrs->array, --attrs->pos);
+        GET_ATTR_array(INTERP, SELF, array);
+        SET_ATTR_pos(INTERP, SELF, --pos);
+
+        return VTABLE_get_string_keyed_int(INTERP, array, pos);
     }
 
 /*
@@ -389,14 +426,19 @@
 */
 
     VTABLE PMC *pop_pmc() {
-        Parrot_ArrayIterator_attributes * const attrs =
-                PARROT_ARRAYITERATOR(SELF);
+        INTVAL pos;
+        PMC   *array;
+
+        GET_ATTR_pos(INTERP, SELF, pos);
 
         if (!STATICSELF.get_bool())
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
                 "StopIteration");
 
-        return VTABLE_get_pmc_keyed_int(INTERP, attrs->array, --attrs->pos);
+        GET_ATTR_array(INTERP, SELF, array);
+        SET_ATTR_pos(INTERP, SELF, --pos);
+
+        return VTABLE_get_pmc_keyed_int(INTERP, array, pos);
     }
 
 /*
@@ -423,8 +465,12 @@
 */
 
     VTABLE PMC *get_pmc_keyed_int(INTVAL idx) {
+        INTVAL pos;
+
+        GET_ATTR_pos(INTERP, SELF, pos);
+
         return VTABLE_get_pmc_keyed_int(INTERP, STATICSELF.get_pmc(),
-                PARROT_ARRAYITERATOR(SELF)->pos + idx);
+                pos + idx);
     }
 /*
 
@@ -449,8 +495,12 @@
 */
 
     VTABLE INTVAL get_integer_keyed_int(INTVAL idx) {
+        INTVAL pos;
+
+        GET_ATTR_pos(INTERP, SELF, pos);
+
         return VTABLE_get_integer_keyed_int(INTERP, STATICSELF.get_pmc(),
-                PARROT_ARRAYITERATOR(SELF)->pos + idx);
+                pos + idx);
     }
 
 /*
@@ -476,8 +526,12 @@
 */
 
     VTABLE FLOATVAL get_number_keyed_int(INTVAL idx) {
+        INTVAL pos;
+
+        GET_ATTR_pos(INTERP, SELF, pos);
+
         return VTABLE_get_number_keyed_int(INTERP, STATICSELF.get_pmc(),
-                PARROT_ARRAYITERATOR(SELF)->pos + idx);
+                pos + idx);
     }
 
 
@@ -505,8 +559,12 @@
 */
 
     VTABLE STRING *get_string_keyed_int(INTVAL idx) {
+        INTVAL pos;
+
+        GET_ATTR_pos(INTERP, SELF, pos);
+
         return VTABLE_get_string_keyed_int(INTERP, STATICSELF.get_pmc(),
-                PARROT_ARRAYITERATOR(SELF)->pos + idx);
+                pos + idx);
     }
 
 /*
@@ -534,12 +592,17 @@
 */
 
     VTABLE INTVAL exists_keyed_int(INTVAL idx) {
-        Parrot_ArrayIterator_attributes * const attrs =
-                PARROT_ARRAYITERATOR(SELF);
+        INTVAL pos, reverse, final_pos;
+        PMC   *array;
+
+        GET_ATTR_pos(INTERP, SELF, pos);
+        GET_ATTR_reverse(INTERP, SELF, reverse);
+        GET_ATTR_array(INTERP, SELF, array);
+
         /* Cheat! */
-        const INTVAL final_pos = attrs->pos + idx - attrs->reverse;
+        final_pos = pos + idx - reverse;
 
-        return VTABLE_exists_keyed_int(INTERP, attrs->array, final_pos);
+        return VTABLE_exists_keyed_int(INTERP, array, final_pos);
     }
 
 /*
@@ -565,12 +628,17 @@
 */
 
     VTABLE INTVAL defined_keyed_int(INTVAL idx) {
-        Parrot_ArrayIterator_attributes * const attrs =
-                PARROT_ARRAYITERATOR(SELF);
+        INTVAL pos, reverse, final_pos;
+        PMC   *array;
+
+        GET_ATTR_pos(INTERP, SELF, pos);
+        GET_ATTR_reverse(INTERP, SELF, reverse);
+        GET_ATTR_array(INTERP, SELF, array);
+
         /* Cheat! */
-        const INTVAL final_pos = attrs->pos + idx - attrs->reverse;
+        final_pos = pos + idx - reverse;
 
-        return VTABLE_defined_keyed_int(INTERP, attrs->array, final_pos);
+        return VTABLE_defined_keyed_int(INTERP, array, final_pos);
     }
 }
 

Modified: branches/orderedhash_revamp/src/pmc/bigint.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/bigint.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/bigint.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -37,18 +37,17 @@
 
 static void
 bigint_init(PARROT_INTERP, PMC *self) {
-    Parrot_BigInt_attributes *attrs =
-        mem_allocate_zeroed_typed(Parrot_BigInt_attributes);
-    attrs->bi = mem_allocate_zeroed_typed(BIGINT);
-    mpz_init(attrs->bi->b);
-    PMC_data(self) = attrs;
+    BIGINT * const bi = mem_allocate_zeroed_typed(BIGINT);
+    SETATTR_BigInt_bi(interp, self, bi);
+    mpz_init(bi->b);
 }
 
 static void
 bigint_clear(PARROT_INTERP, PMC *self) {
-    BIGINT *bi;
+    BIGINT * bi;
     GETATTR_BigInt_bi(interp, self, bi);
     mpz_clear(bi->b);
+    mem_sys_free(bi);
 }
 
 static void
@@ -562,7 +561,7 @@
 
 #endif /* ifdef PARROT_HAS_GMP */
 
-pmclass BigInt {
+pmclass BigInt auto_attrs {
     ATTR struct BIGINT * bi; /*bigint val*/
 
 /*
@@ -591,43 +590,9 @@
         RETURN(STRING *version);
     }
 
-/*
-
-=item C<PMC *instantiate(PMC *sig)>
-
-Object constructor. SELF is a BigInt Class object. Return a new
-BigInt object.
-
-=cut
-
-*/
-    VTABLE PMC *instantiate(PMC *sig) {
-        UNUSED(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_BigInt);
-        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() {
         bigint_init(INTERP, SELF);
-        PObj_active_destroy_SET(SELF);
+        PObj_custom_destroy_SET(SELF);
     }
 
     VTABLE PMC *clone() {
@@ -637,14 +602,7 @@
     }
 
     VTABLE void destroy() {
-        BIGINT                   *bi;
-        Parrot_BigInt_attributes *attrs;
-
         bigint_clear(INTERP, SELF);
-
-        attrs = (Parrot_BigInt_attributes*)PMC_data(SELF);
-        mem_sys_free(attrs->bi);
-        mem_sys_free(attrs);
     }
 
 /*

Modified: branches/orderedhash_revamp/src/pmc/bignum.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/bignum.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/bignum.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -153,16 +153,14 @@
 
 static void
 bignum_init(PARROT_INTERP, PMC *self) {
-    Parrot_BigNum_attributes *attrs =
-        mem_allocate_zeroed_typed(Parrot_BigNum_attributes);
 #ifdef PARROT_HAS_GMP
-    attrs->bn = mem_allocate_zeroed_typed(BIGNUM);
-    mpf_clear(attrs->bn->b);
-    mpf_init(attrs->bn->b);
+    BIGNUM * const bn = mem_allocate_zeroed_typed(BIGNUM);
+    SETATTR_BigNum_bn(interp, self, bn);
+    mpf_clear(bn->b);
+    mpf_init(bn->b);
 #else
-    attrs->bn = NULL;
+    SETATTR_BigNum_bn(interp, self, NULL);
 #endif
-    PMC_data(self) = attrs;
 }
 
 
@@ -172,6 +170,7 @@
     BIGNUM *bn;
     GETATTR_BigNum_bn(interp, self, bn);
     mpf_clear(bn->b);
+    mem_sys_free(bn);
 #endif
 }
 
@@ -225,10 +224,8 @@
 static void
 bignum_set_bigint(PARROT_INTERP, PMC *self, struct BIGINT *value) {
     BIGNUM *bn;
-    struct BIGINT *bi;
     GETATTR_BigNum_bn(interp, self, bn);
-    bi->b = PARROT_BIGINT(value);
-    mpf_set(bn->b, (mpf_srcptr)bi->b);
+    mpf_set(bn->b, (mpf_srcptr)value->b);
 }
 #  endif
 
@@ -243,7 +240,7 @@
 bignum_set_self(PARROT_INTERP, PMC *self, BIGNUM *value) {
     BIGNUM *bn;
     GETATTR_BigNum_bn(interp, self, bn);
-    mpf_set(bn->b, (mpf_srcptr)((BIGNUM*)value)->b);
+    mpf_set(bn->b, (mpf_srcptr)(value)->b);
 }
 
 static long
@@ -778,7 +775,7 @@
 
 #endif /* ifdef PARROT_HAS_GMP */
 
-pmclass BigNum {
+pmclass BigNum auto_attrs {
     ATTR struct BIGNUM * bn; /*bignum val*/
 
 /*
@@ -807,41 +804,9 @@
         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) {
-#ifdef PARROT_HAS_GMP
-        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;
-#else
-        return PMCNULL;
-#endif
-    }
-
     VTABLE void init() {
         bignum_init(INTERP, SELF);
-        PObj_active_destroy_SET(SELF);
+        PObj_custom_destroy_SET(SELF);
     }
 
     VTABLE PMC *clone() {
@@ -851,16 +816,7 @@
     }
 
     VTABLE void destroy() {
-        BIGNUM                   *bn;
-        Parrot_BigNum_attributes *attrs;
-
         bignum_clear(INTERP, SELF);
-
-        attrs = (Parrot_BigNum_attributes*)PMC_data(SELF);
-#ifdef PARROT_HAS_GMP
-        mem_sys_free(attrs->bn);
-#endif
-        mem_sys_free(attrs);
     }
 
 /*

Modified: branches/orderedhash_revamp/src/pmc/boolean.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/boolean.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/boolean.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -21,27 +21,24 @@
 
 */
 
-pmclass Boolean extends Integer provides boolean provides scalar {
+pmclass Boolean extends Integer provides boolean provides scalar auto_attrs {
 
 /*
 
-=item C<PMC *instantiate(PMC *sig)>
+=item C<void init_pmc(PMC *value)>
 
-Object constructor. SELF is a Boolean Class object. Return a new
-C<bool> object according to the passed PMC value.
+Initialises SELF value according to the boolean value of the passed PMC.
 
 =cut
 
 */
-    VTABLE PMC *instantiate(PMC *sig) {
-        /* XXX other types */
-        const int argcP = REG_INT(interp, 3);
-        PMC * const res = pmc_new(interp, enum_class_Boolean);
-
-        if (argcP)
-            SELF.set_bool(VTABLE_get_bool(interp, REG_PMC(interp, 5)));
-
-        return PMCNULL; /* TODO */
+    VTABLE void init_pmc(PMC *value) {
+        if (!PMC_IS_NULL(value)) {
+            SELF.set_bool(VTABLE_get_bool(INTERP, value));
+        }
+        else {
+            SELF.set_bool(0);
+        }
     }
 /*
 

Added: branches/orderedhash_revamp/src/pmc/callcontext.pmc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/src/pmc/callcontext.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,1554 @@
+/*
+Copyright (C) 2008-2009, Parrot Foundation.
+$Id$
+
+=head1 NAME
+
+src/pmc/callcontext.pmc - CallContext PMC
+
+=head1 DESCRIPTION
+
+The CallContext PMC is used to store the argument list and argument meta
+information for a multiple dispatch call.
+
+=head2 Functions
+
+=over 4
+
+=cut
+
+*/
+
+typedef struct Pcc_cell
+{
+    union u {
+        PMC     *p;
+        STRING  *s;
+        INTVAL   i;
+        FLOATVAL n;
+    } u;
+    struct Pcc_cell *next;
+} Pcc_cell;
+
+/* mask off lower two bits (1 + 2 = 3) for pointer tags */
+#define TAG_BITS 3
+#define UNTAG_CELL(c) INTVAL2PTR(Pcc_cell *, (PTR2INTVAL(c)) & ~TAG_BITS)
+
+#define CELL_INT(c)     UNTAG_CELL(c)->u.i
+#define CELL_FLOAT(c)   UNTAG_CELL(c)->u.n
+#define CELL_STRING(c)  UNTAG_CELL(c)->u.s
+#define CELL_PMC(c)     UNTAG_CELL(c)->u.p
+
+#define NEXT_CELL(c) UNTAG_CELL(c)->next
+#define FREE_CELL(i, c) \
+    Parrot_gc_free_fixed_size_storage((i), sizeof (Pcc_cell), (UNTAG_CELL(c)))
+
+#define CELL_TYPE_MASK(c) (PTR2INTVAL(c)) & 3
+#define INTCELL    0
+#define FLOATCELL  1
+#define STRINGCELL 2
+#define PMCCELL    3
+
+#define SET_CELL_INT(c) \
+        INTVAL2PTR(Pcc_cell *, PTR2INTVAL(UNTAG_CELL(c)) | INTCELL)
+
+#define SET_CELL_FLOAT(c) \
+        INTVAL2PTR(Pcc_cell *, PTR2INTVAL(UNTAG_CELL(c)) | FLOATCELL)
+
+#define SET_CELL_STRING(c) \
+        INTVAL2PTR(Pcc_cell *, PTR2INTVAL(UNTAG_CELL(c)) | STRINGCELL)
+
+#define SET_CELL_PMC(c) \
+        INTVAL2PTR(Pcc_cell *, PTR2INTVAL(UNTAG_CELL(c)) | PMCCELL)
+
+#define ALLOC_CELL(i) \
+    (Pcc_cell *)Parrot_gc_allocate_fixed_size_storage((i), sizeof (Pcc_cell))
+
+#define INIT_CELL_INT(c)    INTVAL2PTR(Pcc_cell *, PTR2INTVAL(c) | INTCELL)
+#define INIT_CELL_FLOAT(c)  INTVAL2PTR(Pcc_cell *, PTR2INTVAL(c) | FLOATCELL)
+#define INIT_CELL_STRING(c) INTVAL2PTR(Pcc_cell *, PTR2INTVAL(c) | STRINGCELL)
+#define INIT_CELL_PMC(c)    INTVAL2PTR(Pcc_cell *, PTR2INTVAL(c) | PMCCELL)
+
+#define CREATE_INTVAL_CELL(i)   INIT_CELL_INT(ALLOC_CELL(i))
+
+#define CREATE_FLOATVAL_CELL(i) INIT_CELL_FLOAT(ALLOC_CELL(i))
+
+#define CREATE_STRING_CELL(i)   INIT_CELL_STRING(ALLOC_CELL(i))
+
+#define CREATE_PMC_CELL(i)      INIT_CELL_PMC(ALLOC_CELL(i))
+
+#define APPEND_CELL(i, obj, cell) \
+    do { \
+        INTVAL num_positionals; \
+        Pcc_cell *positionals; \
+        GETATTR_CallContext_num_positionals((i), (obj), num_positionals); \
+        GETATTR_CallContext_positionals((i), (obj), positionals); \
+        SETATTR_CallContext_num_positionals((i), (obj), num_positionals+1); \
+        NEXT_CELL(cell) = NULL; \
+        if (positionals) { \
+            while (NEXT_CELL(positionals)) { \
+                positionals = NEXT_CELL(positionals); \
+            } \
+            NEXT_CELL(positionals) = (cell); \
+        } \
+        else \
+            SETATTR_CallContext_positionals((i), (obj), (cell)); \
+    } while (0)
+
+#define PREPEND_CELL(i, obj, cell) \
+    do { \
+        INTVAL num_positionals; \
+        Pcc_cell *positionals; \
+        GETATTR_CallContext_num_positionals((i), (obj), num_positionals); \
+        GETATTR_CallContext_positionals((i), (obj), positionals); \
+        SETATTR_CallContext_num_positionals((i), (obj), num_positionals+1); \
+        NEXT_CELL(cell) = positionals; \
+        SETATTR_CallContext_positionals((i), (obj), (cell)); \
+    } while (0)
+
+#define HLL_TYPE(i) Parrot_get_ctx_HLL_type(interp, (i))
+
+/* TODO: could use get_cell_at */
+static Pcc_cell *
+pop_cell(PARROT_INTERP, ARGIN(PMC *SELF))
+{
+    INTVAL num_positionals;
+    Pcc_cell *cell;
+    Pcc_cell *prev = NULL;
+
+    GETATTR_CallContext_positionals(interp, SELF, cell);
+
+    /* no cells */
+    if (!cell)
+        return NULL;
+
+    GETATTR_CallContext_num_positionals(interp, SELF, num_positionals);
+    SETATTR_CallContext_num_positionals(interp, SELF, num_positionals-1);
+
+    /* one cell */
+    if (!NEXT_CELL(cell)) {
+        SETATTR_CallContext_positionals(interp, SELF, NULL);
+        return cell;
+    }
+
+    while (cell) {
+        if (!NEXT_CELL(cell)) {
+            NEXT_CELL(prev) = NULL;
+            return cell;
+        }
+
+        prev = cell;
+        cell = NEXT_CELL(cell);
+    }
+
+    /* should abort here */
+    SETATTR_CallContext_num_positionals(interp, SELF, num_positionals+1);
+    return NULL;
+}
+
+static Pcc_cell *
+shift_cell(PARROT_INTERP, ARGIN(PMC *SELF))
+{
+    INTVAL num_positionals;
+    Pcc_cell *cell;
+
+    GETATTR_CallContext_positionals(interp, SELF, cell);
+
+    /* no cells */
+    if (!cell)
+        return NULL;
+
+    GETATTR_CallContext_num_positionals(interp, SELF, num_positionals);
+    SETATTR_CallContext_num_positionals(interp, SELF, num_positionals-1);
+
+    /* one cell */
+    if (!NEXT_CELL(cell))
+        SETATTR_CallContext_positionals(interp, SELF, NULL);
+    else
+        SETATTR_CallContext_positionals(interp, SELF, NEXT_CELL(cell));
+
+    return cell;
+}
+
+static Pcc_cell *
+get_cell_at(PARROT_INTERP, ARGIN(PMC *SELF), INTVAL key)
+{
+    INTVAL    i, num_positionals;
+    Pcc_cell *cell;
+
+    GETATTR_CallContext_num_positionals(interp, SELF, num_positionals);
+
+    if (key > num_positionals)
+        return NULL;
+
+    GETATTR_CallContext_positionals(interp, SELF, cell);
+
+    while (key) {
+        /* XXX: shouldn't happen */
+        if (!NEXT_CELL(cell))
+            return NULL;
+
+        cell = NEXT_CELL(cell);
+        key--;
+    }
+
+    return cell;
+
+}
+
+static INTVAL
+autobox_intval(PARROT_INTERP, Pcc_cell *cell)
+{
+    switch (CELL_TYPE_MASK(cell)) {
+      case INTCELL:
+        return CELL_INT(cell);
+      case FLOATCELL:
+        return (INTVAL)CELL_FLOAT(cell);
+      case STRINGCELL:
+        return CELL_STRING(cell) ? Parrot_str_to_int(interp, CELL_STRING(cell)) : 0;
+      case PMCCELL:
+        return PMC_IS_NULL(CELL_PMC(cell))
+                ? 0
+                : VTABLE_get_integer(interp, CELL_PMC(cell));
+      default:
+        break;
+    }
+
+    /* exception */
+    return 0;
+}
+
+static FLOATVAL
+autobox_floatval(PARROT_INTERP, Pcc_cell *cell)
+{
+    switch (CELL_TYPE_MASK(cell)) {
+      case INTCELL:
+        return (FLOATVAL)CELL_INT(cell);
+      case FLOATCELL:
+        return CELL_FLOAT(cell);
+      case STRINGCELL:
+        return CELL_STRING(cell) ? Parrot_str_to_num(interp, CELL_STRING(cell)) : 0.0;
+      case PMCCELL:
+        return PMC_IS_NULL(CELL_PMC(cell))
+                ? 0.0
+                : VTABLE_get_number(interp, CELL_PMC(cell));
+      default:
+        break;
+    }
+
+    /* exception */
+    return 0.0;
+}
+
+static STRING *
+autobox_string(PARROT_INTERP, Pcc_cell *cell)
+{
+    switch (CELL_TYPE_MASK(cell)) {
+      case INTCELL:
+        return Parrot_str_from_int(interp, CELL_INT(cell));
+      case FLOATCELL:
+        return Parrot_str_from_num(interp, CELL_FLOAT(cell));
+      case STRINGCELL:
+        return CELL_STRING(cell);
+      case PMCCELL:
+        return PMC_IS_NULL(CELL_PMC(cell))
+                ? NULL
+                : VTABLE_get_string(interp, CELL_PMC(cell));
+      default:
+        break;
+    }
+
+    /* exception */
+    return NULL;
+}
+
+static PMC *
+autobox_pmc(PARROT_INTERP, Pcc_cell *cell)
+{
+    PMC *result = PMCNULL;
+
+    switch (CELL_TYPE_MASK(cell)) {
+      case INTCELL:
+        result = pmc_new(interp, HLL_TYPE(enum_class_Integer));
+        VTABLE_set_integer_native(interp, result, CELL_INT(cell));
+        break;
+      case FLOATCELL:
+        result = pmc_new(interp, HLL_TYPE(enum_class_Float));
+        VTABLE_set_number_native(interp, result, CELL_FLOAT(cell));
+        break;
+      case STRINGCELL:
+        result = pmc_new(interp, HLL_TYPE(enum_class_String));
+        VTABLE_set_string_native(interp, result, CELL_STRING(cell));
+        break;
+      case PMCCELL:
+        return CELL_PMC(cell);
+      default:
+        /* exception */
+        break;
+    }
+
+    return result;
+}
+
+static Hash *
+get_hash(PARROT_INTERP, ARGIN(PMC *SELF))
+{
+    Hash   *hash;
+
+    GETATTR_CallContext_hash(interp, SELF, hash);
+
+    if (!hash) {
+        hash = parrot_create_hash(interp,
+            enum_type_ptr,
+            Hash_key_type_STRING,
+            STRING_compare,
+            (hash_hash_key_fn)key_hash_STRING);
+
+        SETATTR_CallContext_hash(interp, SELF, hash);
+    }
+
+    return hash;
+}
+
+static void
+mark_positionals(PARROT_INTERP, ARGIN(Pcc_cell *c))
+{
+    while (c) {
+        switch (CELL_TYPE_MASK(c)) {
+          case STRINGCELL:
+            if (CELL_STRING(c))
+                Parrot_gc_mark_STRING_alive(interp, CELL_STRING(c));
+            break;
+          case PMCCELL:
+            if (!PMC_IS_NULL(CELL_PMC(c)))
+                Parrot_gc_mark_PMC_alive(interp, CELL_PMC(c));
+            break;
+          case INTCELL:
+          case FLOATCELL:
+          default:
+            break;
+        }
+
+        c = NEXT_CELL(c);
+    }
+}
+
+/* don't look now, but here goes encapsulation.... */
+static void
+mark_hash(PARROT_INTERP, ARGIN(Hash *h))
+{
+    UINTVAL entries = h->entries;
+    INTVAL  i;
+
+    for (i = h->mask; i >= 0; --i) {
+        HashBucket *b = h->bi[i];
+
+        while (b) {
+            Parrot_gc_mark_STRING_alive(interp, (STRING *)b->key);
+            mark_positionals(interp, (Pcc_cell *)b->value);
+            b = b->next;
+        }
+
+    }
+}
+
+static PMC *
+get_named_names(PARROT_INTERP, ARGIN(PMC *SELF))
+{
+    Hash *hash;
+    PMC  *result = PMCNULL;
+
+    GETATTR_CallContext_hash(interp, SELF, hash);
+
+    /* yes, this *looks* risky, but it's a Parrot STRING hash internally */
+    if (hash && hash->entries) {
+        UINTVAL i, j = 0;
+        result  = pmc_new(interp, enum_class_FixedStringArray);
+        VTABLE_set_integer_native(interp, result, hash->entries);
+
+        for (i = 0; i <= hash->mask; i++) {
+            HashBucket *b = hash->bi[i];
+
+            while (b) {
+                VTABLE_set_string_keyed_int(interp, result,
+                    j++, (STRING *)b->key);
+                b = b->next;
+            }
+        }
+    }
+
+    return result;
+}
+
+#include "parrot/packfile.h"
+#include "pmc/pmc_sub.h"
+
+pmclass CallContext provides array provides hash auto_attrs {
+    /* Context attributes */
+    ATTR PMC     *caller_ctx;      /* caller context */
+
+    ATTR void    *registers;       /* pointer to allocated registers */
+    ATTR Regs_ni  bp;              /* pointers to FLOATVAL & INTVAL */
+    ATTR Regs_ps  bp_ps;           /* pointers to PMC & STR */
+
+    ATTR UINTVAL  n_regs_used[4];   /* INSP in PBC points to Sub */
+    ATTR PMC      *lex_pad;         /* LexPad PMC */
+    ATTR PMC      *outer_ctx;       /* outer context, if a closure */
+
+    /* new call scheme and introspective variables */
+    ATTR PMC      *current_sub;           /* the Sub we are executing */
+
+    /* for now use a return continuation PMC */
+    ATTR PMC      *handlers;              /* local handlers for the context */
+    ATTR PMC      *current_cont;          /* the return continuation PMC */
+    ATTR PMC      *current_object;        /* current object if a method call */
+    ATTR PMC      *current_namespace;     /* The namespace we're currently in */
+    ATTR PMC      *results_signature;     /* non-const results signature PMC */
+    ATTR opcode_t *current_pc;            /* program counter of Sub invocation */
+    ATTR opcode_t *current_results;       /* ptr into code with get_results opcode */
+    ATTR PMC      *current_sig;           /* temporary CallContext PMC for active call */
+
+    /* deref the constants - we need it all the time */
+    ATTR struct PackFile_Constant **constants;
+
+    ATTR INTVAL                 current_HLL;     /* see also src/hll.c */
+
+    ATTR UINTVAL                warns;           /* Keeps track of what warnings
+                                             * have been activated */
+    ATTR UINTVAL                errors;          /* fatals that can be turned off */
+    ATTR UINTVAL                trace_flags;
+    ATTR UINTVAL                recursion_depth; /* Sub call recursion depth */
+
+    /* code->prederefed.code - code->base.data in opcodes
+     * to simplify conversion between code ptrs in e.g. invoke */
+    ATTR size_t pred_offset;
+
+    /* Storage for arguments */
+    ATTR struct Pcc_cell *positionals; /* linked list of positionals */
+    ATTR PMC    *type_tuple;           /* Cached argument types for MDD */
+    ATTR STRING *short_sig;            /* Simple string sig args & returns */
+    ATTR PMC    *arg_flags;            /* Integer array of argument flags */
+    ATTR PMC    *return_flags;         /* Integer array of return flags */
+    ATTR Hash   *hash;                 /* Hash of named arguments */
+    ATTR INTVAL  num_positionals;      /* count of positionals */
+
+    /* Storage for returns */
+    ATTR void     **returns_values;             /* stored pointers */
+    ATTR INTVAL     returns_size;               /* number of stored elements */
+    ATTR INTVAL     returns_resize_threshold;   /* max size before resizing array */
+/*
+
+=item C<void init()>
+
+Initializes a newly created CallContext object.
+
+=cut
+
+*/
+
+    VTABLE void init() {
+        SET_ATTR_type_tuple(INTERP, SELF, PMCNULL);
+
+        SET_ATTR_positionals(INTERP, SELF, NULL);
+        SET_ATTR_returns_values(INTERP, SELF, NULL);
+
+        SET_ATTR_returns_size(INTERP, SELF, 0);
+        SET_ATTR_num_positionals(INTERP, SELF, 0);
+        SET_ATTR_returns_resize_threshold(INTERP, SELF, 0);
+
+        PObj_custom_mark_destroy_SETALL(SELF);
+    }
+
+/*
+
+=item C<void mark()>
+
+Mark any referenced strings and PMCs.
+
+=cut
+
+*/
+    VTABLE void mark() {
+        Hash     *hash;
+        STRING   *short_sig;
+        Pcc_cell *positionals;
+        INTVAL    num_positionals;
+        PMC      *arg_flags, *type_tuple, *return_flags, *tmp;
+        UINTVAL   i;
+        UINTVAL  *n_regs_used;
+        Regs_ps   bp_ps;
+
+        if (!PMC_data(SELF))
+            return;
+
+        GET_ATTR_type_tuple(INTERP, SELF, type_tuple);
+        GET_ATTR_short_sig(INTERP, SELF, short_sig);
+        GET_ATTR_arg_flags(INTERP, SELF, arg_flags);
+        GET_ATTR_return_flags(INTERP, SELF, return_flags);
+        GET_ATTR_num_positionals(INTERP, SELF, num_positionals);
+        GET_ATTR_positionals(INTERP, SELF, positionals);
+        GET_ATTR_hash(INTERP, SELF, hash);
+
+        Parrot_gc_mark_PMC_alive(INTERP, type_tuple);
+        Parrot_gc_mark_STRING_alive(INTERP, short_sig);
+        Parrot_gc_mark_PMC_alive(INTERP, arg_flags);
+        Parrot_gc_mark_PMC_alive(INTERP, return_flags);
+
+        if (num_positionals)
+            mark_positionals(INTERP, positionals);
+
+        if (hash)
+            mark_hash(INTERP, hash);
+
+        GET_ATTR_caller_ctx(INTERP, SELF, tmp);
+        Parrot_gc_mark_PMC_alive(INTERP, tmp);
+
+        GET_ATTR_lex_pad(INTERP, SELF, tmp);
+        Parrot_gc_mark_PMC_alive(INTERP, tmp);
+
+        GET_ATTR_outer_ctx(INTERP, SELF, tmp);
+        Parrot_gc_mark_PMC_alive(INTERP, tmp);
+
+        GET_ATTR_current_sub(INTERP, SELF, tmp);
+        Parrot_gc_mark_PMC_alive(INTERP, tmp);
+
+        GET_ATTR_handlers(INTERP, SELF, tmp);
+        Parrot_gc_mark_PMC_alive(INTERP, tmp);
+
+        GET_ATTR_current_cont(INTERP, SELF, tmp);
+        Parrot_gc_mark_PMC_alive(INTERP, tmp);
+
+        GET_ATTR_current_object(INTERP, SELF, tmp);
+        Parrot_gc_mark_PMC_alive(INTERP, tmp);
+
+        GET_ATTR_current_namespace(INTERP, SELF, tmp);
+        Parrot_gc_mark_PMC_alive(INTERP, tmp);
+
+        GET_ATTR_results_signature(INTERP, SELF, tmp);
+        Parrot_gc_mark_PMC_alive(INTERP, tmp);
+
+        GET_ATTR_current_sig(INTERP, SELF, tmp);
+        Parrot_gc_mark_PMC_alive(INTERP, tmp);
+
+        GET_ATTR_n_regs_used(INTERP, SELF, n_regs_used);
+        if (!n_regs_used)
+            return;
+
+        GET_ATTR_bp_ps(INTERP, SELF, bp_ps);
+        for (i = 0; i < n_regs_used[REGNO_PMC]; ++i) {
+            PMC *p = bp_ps.regs_p[-1L-(i)];
+            /* Original code from CTX_REG_PMC */
+            if (p)
+                Parrot_gc_mark_PMC_alive(interp, p);
+        }
+
+        for (i = 0; i < n_regs_used[REGNO_STR]; ++i) {
+            STRING *s = bp_ps.regs_s[i];
+            if (s)
+                Parrot_gc_mark_STRING_alive(interp, s);
+        }
+
+    }
+
+    VTABLE void destroy() {
+        INTVAL    num_positionals, returns_resize_threshold;
+        Hash     *hash;
+        void    **returns_values;
+
+        if (!PMC_data(SELF))
+            return;
+
+        GET_ATTR_hash(INTERP, SELF, hash);
+        GET_ATTR_num_positionals(INTERP, SELF, num_positionals);
+        GET_ATTR_returns_values(INTERP, SELF, returns_values);
+        GET_ATTR_returns_resize_threshold(INTERP, SELF, returns_resize_threshold);
+
+        if (num_positionals) {
+            Pcc_cell *c;
+
+            GET_ATTR_positionals(INTERP, SELF, c);
+
+            while (c) {
+                Pcc_cell *to_free = c;
+                c = NEXT_CELL(c);
+                FREE_CELL(INTERP, to_free);
+            }
+        }
+
+        if (hash) {
+            UINTVAL i;
+
+            for (i = 0; i <= hash->mask; i++) {
+                HashBucket *b = hash->bi[i];
+
+                while (b) {
+                    FREE_CELL(INTERP, (Pcc_cell *)b->value);
+                    b = b->next;
+                }
+            }
+
+            parrot_hash_destroy(INTERP, hash);
+        }
+
+        /* Destroy returns storage */
+        if (returns_values) {
+            if (returns_resize_threshold == 8)
+                Parrot_gc_free_fixed_size_storage(INTERP,
+                    8 * sizeof (void *), returns_values);
+            else
+                mem_sys_free(returns_values);
+        }
+
+        Parrot_pcc_free_registers(INTERP, SELF);
+    }
+
+/*
+
+=item C<void set_string_native(STRING *value)>
+
+Sets the short signature for the CallContext.
+
+=cut
+
+*/
+
+    VTABLE void set_string_native(STRING *value) {
+        SET_ATTR_short_sig(INTERP, SELF, value);
+    }
+
+/*
+
+=item C<STRING *get_string()>
+
+Returns the short signature for the CallContext.
+
+=cut
+
+*/
+
+    VTABLE STRING *get_string() {
+        INTVAL    num_positionals;
+        STRING   *res;
+        Pcc_cell *c;
+
+        GET_ATTR_short_sig(INTERP, SELF, res);
+
+        if (res)
+            return res;
+
+        GET_ATTR_positionals(INTERP, SELF, c);
+        GET_ATTR_num_positionals(INTERP, SELF, num_positionals);
+
+        res = Parrot_str_new(INTERP, NULL, num_positionals);
+
+        while (c) {
+            switch (CELL_TYPE_MASK(c)) {
+              case INTCELL:
+                res = Parrot_str_append(INTERP, res, CONST_STRING(INTERP, "I"));
+                break;
+              case FLOATCELL:
+                res = Parrot_str_append(INTERP, res, CONST_STRING(INTERP, "N"));
+                break;
+              case STRINGCELL:
+                res = Parrot_str_append(INTERP, res, CONST_STRING(INTERP, "S"));
+                break;
+              case PMCCELL:
+                res = Parrot_str_append(INTERP, res, CONST_STRING(INTERP, "P"));
+                break;
+              default:
+                PARROT_ASSERT(!"Impossible flag");
+                break;
+            }
+            c = NEXT_CELL(c);
+        }
+        /* TODO Add named args to signature */
+        /* After fixind build_MMD_type_tuple to use raw arguments instead of signature */
+
+        SET_ATTR_short_sig(INTERP, SELF, res);
+
+        return res;
+    }
+
+/*
+
+=item C<void set_pmc(PMC *value)>
+
+Sets a fixed-size array of integer types (a type tuple) for the CallContext.
+
+=cut
+
+*/
+
+    VTABLE void set_pmc(PMC *value) {
+        SET_ATTR_type_tuple(INTERP, SELF, value);
+    }
+
+/*
+
+=item C<PMC *get_pmc()>
+
+Returns a fixed-size array of integer types (a type tuple) for the
+CallContext.
+
+=cut
+
+*/
+
+    VTABLE PMC *get_pmc() {
+        PMC *type_tuple;
+
+        GET_ATTR_type_tuple(INTERP, SELF, type_tuple);
+
+        if (PMC_IS_NULL(type_tuple)) {
+            type_tuple = Parrot_mmd_build_type_tuple_from_sig_obj(INTERP, SELF);
+            SET_ATTR_type_tuple(INTERP, SELF, type_tuple);
+        }
+
+        return type_tuple;
+
+    }
+
+/*
+
+=item C<void set_attr_str(STRING *key, PMC *value)>
+
+Set a PMC value for an attribute by string name.
+
+=over
+
+=item results
+
+Stores the return signature, an array of PMCs.
+
+=item arg_flags
+
+Stores a set of flags for the call signature arguments, an array of
+integers.
+
+=item return_flags
+
+Stores a set of flags for the call signature return arguments, an array
+of integers.
+
+=back
+
+=cut
+
+*/
+
+    VTABLE void set_attr_str(STRING *key, PMC *value) {
+
+        if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "arg_flags"))) {
+            SET_ATTR_arg_flags(INTERP, SELF, value);
+        }
+        else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "return_flags"))) {
+            SET_ATTR_return_flags(INTERP, SELF, value);
+        }
+        else {
+            /* If unknown attribute name, throw an exception. */
+            Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
+                "No such attribute '%S'", key);
+        }
+    }
+
+/*
+
+=item C<PMC *get_attr_str(STRING *key)>
+
+Get a PMC value for an attribute by string name.
+
+=over
+
+=item results
+
+Retrieves the return signature, an array of PMCs.
+
+=item arg_flags
+
+Retrieves the flags for the call signature arguments, an array of
+integers.
+
+=item return_flags
+
+Retrieves the flags for the call signature return arguments, an array of
+integers.
+
+=item named
+
+Retrieves the hash of named arguments.
+
+=item caller_ctx
+
+return Caller Context
+
+=item lex_pad
+
+return LexPad
+
+=item outer_ctx
+
+return Outer Context
+
+=item current_sub
+
+return current Sub
+
+=item handlers
+
+return list of ExceptioHandlers
+
+=item current_cont
+
+return current Continuation
+
+=item current_object
+
+return current Object (if in method call)
+
+=item current_namespace
+
+return current Namespace
+
+=back
+
+=cut
+
+*/
+
+    VTABLE PMC *get_attr_str(STRING *key) {
+        PMC    *value = PMCNULL;
+        INTVAL  hll;
+
+        if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "named")))
+            value = get_named_names(INTERP, SELF);
+        else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "arg_flags")))
+            GET_ATTR_arg_flags(INTERP, SELF, value);
+        else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "return_flags")))
+            GET_ATTR_return_flags(INTERP, SELF, value);
+        else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "caller_ctx")))
+            GET_ATTR_caller_ctx(INTERP, SELF, value);
+        else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "lex_pad")))
+            GET_ATTR_lex_pad(INTERP, SELF, value);
+        else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "outer_ctx")))
+            GET_ATTR_outer_ctx(INTERP, SELF, value);
+        else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "current_sub")))
+            GET_ATTR_current_sub(INTERP, SELF, value);
+        else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "current_cont")))
+            GET_ATTR_current_cont(INTERP, SELF, value);
+        else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "current_object")))
+            GET_ATTR_current_object(INTERP, SELF, value);
+        else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "current_namespace")))
+            GET_ATTR_current_namespace(INTERP, SELF, value);
+        else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "handlers")))
+            GET_ATTR_handlers(INTERP, SELF, value);
+        else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "results_signature")))
+            GET_ATTR_results_signature(INTERP, SELF, value);
+        else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "current_HLL"))) {
+            /* This function from src/hash.c. */
+            /* We probably have to move it to more suitable place */
+            GET_ATTR_current_HLL(INTERP, SELF, hll);
+            value = get_integer_pmc(INTERP, hll);
+        }
+        else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "current_hll"))) {
+            GET_ATTR_current_HLL(INTERP, SELF, hll);
+            value = get_string_pmc(INTERP, Parrot_get_HLL_name(INTERP, hll));
+        }
+        else {
+            /* If unknown attribute name, throw an exception. */
+            Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
+                "No such attribute '%S'", key);
+        }
+
+        return value;
+    }
+
+    VTABLE INTVAL elements() {
+        INTVAL num_positionals;
+
+        if (!PMC_data(SELF))
+            return 0;
+
+        GET_ATTR_num_positionals(INTERP, SELF, num_positionals);
+
+        return num_positionals;
+    }
+
+    VTABLE void push_integer(INTVAL value) {
+        Pcc_cell *cell = CREATE_INTVAL_CELL(INTERP);
+        APPEND_CELL(INTERP, SELF, cell);
+        CELL_INT(cell) = value;
+    }
+
+    VTABLE void push_float(FLOATVAL value) {
+        Pcc_cell *cell = CREATE_FLOATVAL_CELL(INTERP);
+        APPEND_CELL(INTERP, SELF, cell);
+        CELL_FLOAT(cell) = value;
+    }
+
+    VTABLE void push_string(STRING *value) {
+        Pcc_cell *cell = CREATE_STRING_CELL(INTERP);
+        APPEND_CELL(INTERP, SELF, cell);
+        CELL_STRING(cell) = value;
+    }
+
+    VTABLE void push_pmc(PMC *value) {
+        Pcc_cell *cell = CREATE_PMC_CELL(INTERP);
+        APPEND_CELL(INTERP, SELF, cell);
+        CELL_PMC(cell) = value;
+    }
+
+    VTABLE INTVAL pop_integer() {
+        Pcc_cell *cell = pop_cell(INTERP, SELF);
+
+        if (cell) {
+            INTVAL result = autobox_intval(INTERP, cell);
+            FREE_CELL(INTERP, cell);
+            return result;
+        }
+
+        return 0;
+    }
+
+    VTABLE FLOATVAL pop_float() {
+        Pcc_cell *cell = pop_cell(INTERP, SELF);
+
+        if (cell) {
+            FLOATVAL result = autobox_floatval(INTERP, cell);
+            FREE_CELL(INTERP, cell);
+            return result;
+        }
+
+        return 0.0;
+    }
+
+    VTABLE PMC * pop_pmc() {
+        Pcc_cell *cell = pop_cell(INTERP, SELF);
+
+        if (cell) {
+            PMC *result = autobox_pmc(INTERP, cell);
+            FREE_CELL(INTERP, cell);
+            return result;
+        }
+
+        return PMCNULL;
+    }
+
+    VTABLE STRING * pop_string() {
+        Pcc_cell *cell = pop_cell(INTERP, SELF);
+
+        if (cell) {
+            STRING *result = autobox_string(INTERP, cell);
+            FREE_CELL(INTERP, cell);
+            return result;
+        }
+
+        return NULL;
+    }
+
+    VTABLE INTVAL get_integer_keyed_int(INTVAL key) {
+        Pcc_cell *cell = get_cell_at(INTERP, SELF, key);
+
+        if (!cell)
+            return 0;
+
+        return autobox_intval(INTERP, cell);
+    }
+
+    VTABLE FLOATVAL get_number_keyed_int(INTVAL key) {
+        Pcc_cell *cell = get_cell_at(INTERP, SELF, key);
+
+        if (!cell)
+            return 0.0;
+
+        return autobox_floatval(INTERP, cell);
+    }
+
+    VTABLE STRING * get_string_keyed_int(INTVAL key) {
+        Pcc_cell *cell = get_cell_at(INTERP, SELF, key);
+
+        if (!cell)
+            return NULL;
+
+        return autobox_string(INTERP, cell);
+    }
+
+    VTABLE PMC * get_pmc_keyed_int(INTVAL key) {
+        Pcc_cell *cell = get_cell_at(INTERP, SELF, key);
+
+        if (!cell)
+            return PMCNULL;
+
+        return autobox_pmc(INTERP, cell);
+    }
+
+    VTABLE void unshift_integer(INTVAL value) {
+        Pcc_cell *cell = CREATE_INTVAL_CELL(INTERP);
+        PREPEND_CELL(INTERP, SELF, cell);
+        CELL_INT(cell) = value;
+    }
+
+    VTABLE void unshift_float(FLOATVAL value) {
+        Pcc_cell *cell = CREATE_FLOATVAL_CELL(INTERP);
+        PREPEND_CELL(INTERP, SELF, cell);
+        CELL_FLOAT(cell) = value;
+    }
+
+    VTABLE void unshift_string(STRING *value) {
+        Pcc_cell *cell = CREATE_STRING_CELL(INTERP);
+        PREPEND_CELL(INTERP, SELF, cell);
+        CELL_STRING(cell) = value;
+    }
+
+    VTABLE void unshift_pmc(PMC *value) {
+        Pcc_cell *cell = CREATE_PMC_CELL(INTERP);
+        PREPEND_CELL(INTERP, SELF, cell);
+        CELL_PMC(cell) = value;
+    }
+
+    VTABLE INTVAL shift_integer() {
+        Pcc_cell *cell = shift_cell(INTERP, SELF);
+
+        if (cell) {
+            INTVAL result = autobox_intval(INTERP, cell);
+            FREE_CELL(INTERP, cell);
+            return result;
+        }
+
+        return 0;
+    }
+
+    VTABLE FLOATVAL shift_float() {
+        Pcc_cell *cell = shift_cell(INTERP, SELF);
+
+        if (cell) {
+            FLOATVAL result = autobox_floatval(INTERP, cell);
+            FREE_CELL(INTERP, cell);
+            return result;
+        }
+
+        return 0.0;
+    }
+
+    VTABLE STRING * shift_string() {
+        Pcc_cell *cell = shift_cell(INTERP, SELF);
+
+        if (cell) {
+            STRING *result = autobox_string(INTERP, cell);
+            FREE_CELL(INTERP, cell);
+            return result;
+        }
+
+        return NULL;
+    }
+
+    VTABLE PMC * shift_pmc() {
+        Pcc_cell *cell = shift_cell(INTERP, SELF);
+
+        if (cell) {
+            PMC *result = autobox_pmc(INTERP, cell);
+            FREE_CELL(INTERP, cell);
+            return result;
+        }
+
+        return PMCNULL;
+    }
+
+    VTABLE void set_integer_keyed_int(INTVAL key, INTVAL value) {
+        Pcc_cell *cell = get_cell_at(INTERP, SELF, key);
+
+        if (!cell) {
+            INTVAL num_positionals;
+
+            GET_ATTR_num_positionals(INTERP, SELF, num_positionals);
+
+            if (key == num_positionals)
+                VTABLE_push_integer(INTERP, SELF, value);
+
+            /* XXX: else throw exception? */
+            return;
+        }
+
+        CELL_INT(cell) = value;
+    }
+
+    VTABLE void set_number_keyed_int(INTVAL key, FLOATVAL value) {
+        Pcc_cell *cell = get_cell_at(INTERP, SELF, key);
+
+        if (!cell) {
+            INTVAL num_positionals;
+
+            GET_ATTR_num_positionals(INTERP, SELF, num_positionals);
+
+            if (key == num_positionals)
+                VTABLE_push_float(INTERP, SELF, value);
+
+            /* XXX: else throw exception? */
+            return;
+        }
+
+        CELL_FLOAT(cell) = value;
+    }
+
+    VTABLE void set_string_keyed_int(INTVAL key, STRING *value) {
+        Pcc_cell *cell = get_cell_at(INTERP, SELF, key);
+
+        if (!cell) {
+            INTVAL num_positionals;
+
+            GET_ATTR_num_positionals(INTERP, SELF, num_positionals);
+
+            if (key == num_positionals)
+                VTABLE_push_string(INTERP, SELF, value);
+
+            /* XXX: else throw exception? */
+            return;
+        }
+
+        CELL_STRING(cell) = value;
+    }
+
+    VTABLE void set_pmc_keyed_int(INTVAL key, PMC *value) {
+        Pcc_cell *cell = get_cell_at(INTERP, SELF, key);
+
+        if (!cell) {
+            INTVAL num_positionals;
+
+            GET_ATTR_num_positionals(INTERP, SELF, num_positionals);
+
+            if (key == num_positionals)
+                VTABLE_push_pmc(INTERP, SELF, value);
+
+            /* XXX: else throw exception? */
+            return;
+        }
+
+        CELL_PMC(cell) = value;
+    }
+
+    VTABLE void set_integer_keyed_str(STRING *key, INTVAL value) {
+        Hash     *hash = get_hash(INTERP, SELF);
+        Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, (void *)key);
+
+        if (!cell) {
+            cell = CREATE_INTVAL_CELL(INTERP);
+            parrot_hash_put(INTERP, hash, (void *)key, (void *)cell);
+            NEXT_CELL(cell) = NULL;
+        }
+        else
+            SET_CELL_INT(cell);
+
+        CELL_INT(cell) = value;
+    }
+
+    VTABLE void set_number_keyed_str(STRING *key, FLOATVAL value) {
+        Hash     *hash = get_hash(INTERP, SELF);
+        Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, (void *)key);
+
+        if (!cell) {
+            cell = CREATE_FLOATVAL_CELL(INTERP);
+            parrot_hash_put(INTERP, hash, (void *)key, (void *)cell);
+            NEXT_CELL(cell) = NULL;
+        }
+        else
+            SET_CELL_FLOAT(cell);
+
+        CELL_FLOAT(cell) = value;
+    }
+
+    VTABLE void set_string_keyed_str(STRING *key, STRING *value) {
+        Hash     *hash = get_hash(INTERP, SELF);
+        Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, (void *)key);
+
+        if (!cell) {
+            cell = CREATE_STRING_CELL(INTERP);
+            parrot_hash_put(INTERP, hash, (void *)key, (void *)cell);
+            NEXT_CELL(cell) = NULL;
+        }
+        else
+            SET_CELL_STRING(cell);
+
+        CELL_STRING(cell) = value;
+    }
+
+    VTABLE void set_pmc_keyed_str(STRING *key, PMC *value) {
+        Hash     *hash = get_hash(INTERP, SELF);
+        Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, (void *)key);
+
+        if (!cell) {
+            cell = CREATE_PMC_CELL(INTERP);
+            parrot_hash_put(INTERP, hash, (void *)key, (void *)cell);
+            NEXT_CELL(cell) = NULL;
+        }
+        else
+            SET_CELL_PMC(cell);
+
+        CELL_PMC(cell) = value;
+    }
+
+    VTABLE void set_integer_keyed(PMC *key, INTVAL value) {
+        Hash     *hash = get_hash(INTERP, SELF);
+        void     *k    = hash_key_from_pmc(INTERP, hash, key);
+        Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k);
+
+        if (!cell) {
+            cell = CREATE_INTVAL_CELL(INTERP);
+            parrot_hash_put(INTERP, hash, k, (void *)cell);
+            NEXT_CELL(cell) = NULL;
+        }
+        else
+            SET_CELL_INT(cell);
+
+        CELL_INT(cell) = value;
+    }
+
+    VTABLE void set_number_keyed(PMC *key, FLOATVAL value) {
+        Hash     *hash = get_hash(INTERP, SELF);
+        void     *k    = hash_key_from_pmc(INTERP, hash, key);
+        Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k);
+
+        if (!cell) {
+            cell = CREATE_FLOATVAL_CELL(INTERP);
+            parrot_hash_put(INTERP, hash, k, (void *)cell);
+            NEXT_CELL(cell) = NULL;
+        }
+        else
+            SET_CELL_FLOAT(cell);
+
+        CELL_FLOAT(cell) = value;
+    }
+
+    VTABLE void set_string_keyed(PMC *key, STRING *value) {
+        Hash     *hash = get_hash(INTERP, SELF);
+        void     *k    = hash_key_from_pmc(INTERP, hash, key);
+        Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k);
+
+        if (!cell) {
+            cell = CREATE_STRING_CELL(INTERP);
+            parrot_hash_put(INTERP, hash, k, (void *)cell);
+            NEXT_CELL(cell) = NULL;
+        }
+        else
+            SET_CELL_STRING(cell);
+
+        CELL_STRING(cell) = value;
+    }
+
+    VTABLE void set_pmc_keyed(PMC *key, PMC *value) {
+        Hash     *hash = get_hash(INTERP, SELF);
+        void     *k    = hash_key_from_pmc(INTERP, hash, key);
+        Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k);
+
+        if (!cell) {
+            cell = CREATE_PMC_CELL(INTERP);
+            parrot_hash_put(INTERP, hash, k, (void *)cell);
+            NEXT_CELL(cell) = NULL;
+        }
+        else
+            SET_CELL_PMC(cell);
+
+        CELL_PMC(cell) = value;
+    }
+
+    VTABLE INTVAL get_integer_keyed_str(STRING *key) {
+        Hash *hash = get_hash(INTERP, SELF);
+
+        if (hash) {
+            void     *k    = hash_key_from_string(INTERP, hash, key);
+            Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k);
+
+            if (cell)
+                return autobox_intval(INTERP, cell);
+        }
+
+        return 0;
+    }
+
+    VTABLE FLOATVAL get_number_keyed_str(STRING *key) {
+        Hash *hash = get_hash(INTERP, SELF);
+
+        if (hash) {
+            void     *k    = hash_key_from_string(INTERP, hash, key);
+            Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k);
+
+            if (cell)
+                return autobox_floatval(INTERP, cell);
+        }
+
+        return 0.0;
+    }
+
+
+    VTABLE STRING * get_string_keyed_str(STRING *key) {
+        Hash *hash = get_hash(INTERP, SELF);
+
+        if (hash) {
+            void     *k    = hash_key_from_string(INTERP, hash, key);
+            Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k);
+
+            if (cell)
+                return autobox_string(INTERP, cell);
+        }
+
+        return NULL;
+    }
+
+    VTABLE PMC * get_pmc_keyed_str(STRING *key) {
+        Hash *hash = get_hash(INTERP, SELF);
+
+        if (hash) {
+            void     *k    = hash_key_from_string(INTERP, hash, key);
+            Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k);
+
+            if (cell)
+                return autobox_pmc(INTERP, cell);
+        }
+
+        return PMCNULL;
+    }
+
+    VTABLE INTVAL get_integer_keyed(PMC *key) {
+        Hash *hash = get_hash(INTERP, SELF);
+
+        if (hash) {
+            void     *k    = hash_key_from_pmc(INTERP, hash, key);
+            Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k);
+
+            if (cell)
+                return autobox_intval(INTERP, cell);
+        }
+
+        return 0;
+    }
+
+    VTABLE FLOATVAL get_number_keyed(PMC *key) {
+        Hash *hash = get_hash(INTERP, SELF);
+
+        if (hash) {
+            void     *k    = hash_key_from_pmc(INTERP, hash, key);
+            Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k);
+
+            if (cell)
+                return autobox_floatval(INTERP, cell);
+        }
+
+        return 0.0;
+    }
+
+    VTABLE STRING * get_string_keyed(PMC *key) {
+        Hash *hash = get_hash(INTERP, SELF);
+
+        if (hash) {
+            void     *k    = hash_key_from_pmc(INTERP, hash, key);
+            Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k);
+
+            if (cell)
+                return autobox_string(INTERP, cell);
+        }
+
+        return NULL;
+    }
+
+    VTABLE PMC * get_pmc_keyed(PMC *key) {
+        Hash *hash = get_hash(INTERP, SELF);
+
+        if (hash) {
+            void     *k    = hash_key_from_pmc(INTERP, hash, key);
+            Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k);
+
+            if (cell)
+                return autobox_pmc(INTERP, cell);
+        }
+
+        return PMCNULL;
+    }
+
+    VTABLE INTVAL exists_keyed(PMC *key) {
+        Hash *hash = get_hash(INTERP, SELF);
+
+        if (hash) {
+            void     *k = hash_key_from_pmc(INTERP, hash, key);
+            return parrot_hash_exists(INTERP, hash, k);
+        }
+
+        return 0;
+    }
+
+    VTABLE INTVAL exists_keyed_str(STRING *key) {
+        Hash *hash = get_hash(INTERP, SELF);
+
+        if (hash) {
+            void     *k = hash_key_from_string(INTERP, hash, key);
+            return parrot_hash_exists(INTERP, hash, k);
+        }
+
+        return 0;
+    }
+
+    VTABLE INTVAL exists_keyed_int(INTVAL key) {
+        INTVAL num_positionals;
+
+        GET_ATTR_num_positionals(INTERP, SELF, num_positionals);
+
+        if (num_positionals)
+            return key < num_positionals;
+
+        return 0;
+    }
+
+/*
+
+=item C<PMC *clone()>
+
+Creates and returns a clone of the signature.
+
+=cut
+
+*/
+    VTABLE PMC *clone() {
+        Pcc_cell    *cell;
+        STRING      *short_sig;
+        PMC         *type_tuple, *arg_flags, *return_flags;
+        PMC * const dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        GET_ATTR_positionals(INTERP, SELF, cell);
+
+        /* Copy all positional cells (thanks to APPEND_CELL, this also
+         * sets num_positionals). */
+        for (; cell; cell = NEXT_CELL(cell)) {
+            Pcc_cell *cloned_cell;
+
+            switch (CELL_TYPE_MASK(cell)) {
+              case INTCELL:
+                cloned_cell = CREATE_INTVAL_CELL(INTERP);
+                CELL_INT(cloned_cell) = CELL_INT(cell);
+                break;
+              case FLOATCELL:
+                cloned_cell = CREATE_FLOATVAL_CELL(INTERP);
+                CELL_FLOAT(cloned_cell) = CELL_FLOAT(cell);
+                break;
+              case STRINGCELL:
+                cloned_cell = CREATE_STRING_CELL(INTERP);
+                CELL_STRING(cloned_cell) = CELL_STRING(cell);
+                break;
+              case PMCCELL:
+                cloned_cell = CREATE_PMC_CELL(INTERP);
+                CELL_PMC(cloned_cell) = CELL_PMC(cell);
+                break;
+              default:
+                break;
+            }
+            APPEND_CELL(INTERP, dest, cloned_cell);
+        }
+
+
+        GET_ATTR_type_tuple(INTERP, SELF, type_tuple);
+        GET_ATTR_short_sig(INTERP, SELF, short_sig);
+        GET_ATTR_arg_flags(INTERP, SELF, arg_flags);
+        GET_ATTR_return_flags(INTERP, SELF, return_flags);
+
+        /* FIXME
+        PMC *results;
+
+        GET_ATTR_results(INTERP, SELF, results);
+
+        if (!PMC_IS_NULL(results))
+            SET_ATTR_results(INTERP, dest, VTABLE_clone(INTERP, results));
+        */
+
+        if (!PMC_IS_NULL(type_tuple))
+            SET_ATTR_type_tuple(INTERP, dest, VTABLE_clone(INTERP, type_tuple));
+
+        if (short_sig)
+            SET_ATTR_short_sig(INTERP, dest, Parrot_str_copy(INTERP, short_sig));
+
+        if (!PMC_IS_NULL(arg_flags))
+            SET_ATTR_arg_flags(INTERP, dest, VTABLE_clone(INTERP, arg_flags));
+
+        if (!PMC_IS_NULL(return_flags))
+            SET_ATTR_return_flags(INTERP, dest, VTABLE_clone(INTERP, return_flags));
+
+        parrot_hash_clone(INTERP, get_hash(INTERP, SELF),
+            get_hash(INTERP, dest));
+
+        return dest;
+    }
+
+
+/*
+
+=item C<PMC *backtrace>
+
+Gets a representation of the backtrace starting from this Context.
+Returns an array of hashes. Each array element represents a caller in
+the backtrace, the most recent caller first. The hash has two keys: C<sub>,
+which holds the PMC representing the sub, and C<annotations> which is a hash
+of the annotations at the point where the exception was thrown for the current
+sub, or for the point of the call a level deeper for the rest.
+
+=cut
+
+*/
+
+    METHOD backtrace(PMC *resume :optional, INTVAL has_resume :opt_flag) {
+        PMC *result  = pmc_new(interp, enum_class_ResizablePMCArray);
+        PMC *cur_ctx = SELF;
+        Parrot_Continuation_attributes *cont = has_resume ? PMC_cont(resume) : NULL;
+
+        /* Get starting context, then loop over them. */
+        while (cur_ctx) {
+            PMC        *frame       = pmc_new(interp, enum_class_Hash);
+            PMC        *annotations = NULL;
+            Parrot_Sub_attributes *sub;
+
+            /* Get sub and put it in the hash. */
+            PMC *sub_pmc = Parrot_pcc_get_sub(interp, cur_ctx);
+
+            if (!sub_pmc)
+                sub_pmc = PMCNULL;
+
+            VTABLE_set_pmc_keyed_str(interp, frame, CONST_STRING(interp, "sub"), sub_pmc);
+
+            /* Look up any annotations and put them in the hash. */
+            if (!PMC_IS_NULL(sub_pmc)) {
+                PMC_get_sub(interp, sub_pmc, sub);
+
+                if (sub->seg->annotations) {
+                    PackFile_ByteCode *seg = sub->seg;
+                    opcode_t          *pc  = cont && cur_ctx == cont->to_ctx
+                                             ? cont->address
+                                             : Parrot_pcc_get_pc(interp, cur_ctx);
+
+                    annotations = PackFile_Annotations_lookup(interp,
+                        seg->annotations, pc - seg->base.data,
+                        NULL);
+                }
+            }
+
+            if (!annotations)
+                annotations = pmc_new(interp, enum_class_Hash);
+
+            VTABLE_set_pmc_keyed_str(interp, frame, CONST_STRING(interp, "annotations"), annotations);
+
+            /* Push frame and go to next caller. */
+            VTABLE_push_pmc(interp, result, frame);
+            cur_ctx = Parrot_pcc_get_caller_ctx(interp, cur_ctx);
+        }
+
+        RETURN(PMC *result);
+    }
+/*
+
+=back
+
+=cut
+
+*/
+
+} /* end pmclass */
+
+/*
+ * Local variables:
+ *   c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */

Deleted: branches/orderedhash_revamp/src/pmc/callsignature.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/callsignature.pmc	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,226 +0,0 @@
-/*
-Copyright (C) 2008-2009, Parrot Foundation.
-$Id$
-
-=head1 NAME
-
-src/pmc/callsignature.pmc - CallSignature PMC
-
-=head1 DESCRIPTION
-
-The CallSignature PMC is used to store the argument list and argument meta
-information for a multiple dispatch call.
-
-=head2 Functions
-
-=over 4
-
-=cut
-
-*/
-
-#define CAPTURE_DATA_SIZE   2
-#define CAPTURE_array_CREATE(i, obj) \
-    if (!PARROT_CAPTURE(obj)->array) \
-        PARROT_CAPTURE(obj)->array = pmc_new((i), enum_class_ResizablePMCArray);
-#define CAPTURE_hash_CREATE(i, obj) \
-    if (!PARROT_CAPTURE(obj)->hash) \
-        PARROT_CAPTURE(obj)->hash = pmc_new((i), enum_class_Hash);
-
-pmclass CallSignature extends Capture need_ext provides array provides hash {
-    ATTR PMC    *returns;    /* Result PMCs, if they were passed with the call */
-    ATTR PMC    *type_tuple; /* Cached argument types for multiple dispatch */
-    ATTR STRING *short_sig;  /* Simple string signature args & returns */
-
-/*
-
-=item C<void init()>
-
-Initializes a newly created CallSignature object.
-
-=cut
-
-*/
-
-    VTABLE void init() {
-        Parrot_CallSignature_attributes * const sig_struct =
-            mem_allocate_typed(Parrot_CallSignature_attributes);
-        PMC_data(SELF)         = sig_struct;
-        sig_struct->short_sig  = NULL;
-        sig_struct->type_tuple = PMCNULL;
-        sig_struct->returns    = PMCNULL;
-        sig_struct->array      = NULL;
-        sig_struct->hash       = NULL;
-        sig_struct->data_size  = CAPTURE_DATA_SIZE;
-        PObj_active_destroy_SET(SELF);
-        PObj_custom_mark_SET(SELF);
-    }
-
-/*
-
-=item C<void set_string_native(STRING *value)>
-
-Sets the short signature for the CallSignature.
-
-=cut
-
-*/
-
-    VTABLE void set_string_native(STRING *value) {
-        Parrot_CallSignature_attributes * const sig_struct = PARROT_CALLSIGNATURE(SELF);
-        sig_struct->short_sig = value;
-    }
-
-/*
-
-=item C<STRING *get_string()>
-
-Returns the short signature for the CallSignature.
-
-=cut
-
-*/
-
-    VTABLE STRING *get_string() {
-        Parrot_CallSignature_attributes * const sig_struct = PARROT_CALLSIGNATURE(SELF);
-        return sig_struct->short_sig;
-    }
-
-/*
-
-=item C<void set_pmc(PMC *value)>
-
-Sets a fixed-size array of integer types (a type tuple) for the CallSignature.
-
-=cut
-
-*/
-
-    VTABLE void set_pmc(PMC *value) {
-        Parrot_CallSignature_attributes * const sig_struct = PARROT_CALLSIGNATURE(SELF);
-        sig_struct->type_tuple = value;
-    }
-
-/*
-
-=item C<PMC *get_pmc()>
-
-Returns a fixed-size array of integer types (a type tuple) for the
-CallSignature.
-
-=cut
-
-*/
-
-    VTABLE PMC *get_pmc() {
-        PMC *type_tuple;
-
-        GET_ATTR_type_tuple(INTERP, SELF, type_tuple);
-
-        if (PMC_IS_NULL(type_tuple)) {
-            type_tuple = Parrot_mmd_build_type_tuple_from_sig_obj(INTERP, SELF);
-            SET_ATTR_type_tuple(INTERP, SELF, type_tuple);
-        }
-
-        return type_tuple;
-
-    }
-
-/*
-
-=item C<void set_attr_str(STRING *key, PMC *value)>
-
-Set a PMC value for an attribute by string name.
-
-=over
-
-=item returns
-
-Stores the return signature, an array of PMCs.
-
-=back
-
-=cut
-
-*/
-
-    VTABLE void set_attr_str(STRING *key, PMC *value) {
-        Parrot_CallSignature_attributes * const sig_struct = PARROT_CALLSIGNATURE(SELF);
-        sig_struct->returns = value;
-    }
-
-/*
-
-=item C<PMC *get_attr_str(STRING *key)>
-
-Get a PMC value for an attribute by string name.
-
-=over
-
-=item returns
-
-Retrieves the return signature, an array of PMCs.
-
-=back
-
-=cut
-
-*/
-
-    VTABLE PMC *get_attr_str(STRING *key) {
-        Parrot_CallSignature_attributes * const sig_struct = PARROT_CALLSIGNATURE(SELF);
-        return sig_struct->returns;
-    }
-
-/*
-
-=item C<void mark()>
-
-Mark any referenced strings and PMCs.
-
-=cut
-
-*/
-    VTABLE void mark() {
-        PMC ** const data = PMC_data_typed(SELF, PMC **);
-        Parrot_CallSignature_attributes * const attrs = PARROT_CALLSIGNATURE(SELF);
-
-        if (attrs) {
-
-            if (attrs->array)
-                Parrot_gc_mark_PObj_alive(interp, (PObj*)attrs->array);
-            if (attrs->hash)
-                Parrot_gc_mark_PObj_alive(interp, (PObj*)attrs->hash);
-            if (attrs->returns)
-                Parrot_gc_mark_PObj_alive(interp, (PObj*)attrs->returns);
-            if (attrs->type_tuple)
-                Parrot_gc_mark_PObj_alive(interp, (PObj*)attrs->type_tuple);
-            if (attrs->short_sig)
-                Parrot_gc_mark_PObj_alive(interp, (PObj*)attrs->short_sig);
-        }
-
-        if (data) {
-            INTVAL i;
-            for (i = attrs->data_size - 1; i >= 0; --i)
-                if (data[i])
-                    Parrot_gc_mark_PObj_alive(interp, (PObj *)data[i]);
-        }
-    }
-
-
-/*
-
-=back
-
-=cut
-
-*/
-
-} /* end pmclass */
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Modified: branches/orderedhash_revamp/src/pmc/capture.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/capture.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/capture.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2001-2008, Parrot Foundation.
+Copyright (C) 2001-2009, Parrot Foundation.
 $Id$
 
 =head1 NAME
@@ -18,18 +18,22 @@
 
 */
 
-#define CAPTURE_DATA_SIZE   2
 #define CAPTURE_array_CREATE(i, obj) \
-    if (!PARROT_CAPTURE(obj)->array) \
-        PARROT_CAPTURE(obj)->array = pmc_new((i), enum_class_ResizablePMCArray);
+    do { \
+        GETATTR_Capture_array((i), (obj), array); \
+        if (!array) \
+            SETATTR_Capture_array((i), (obj), pmc_new((i), enum_class_ResizablePMCArray)); \
+    } while (0)
 #define CAPTURE_hash_CREATE(i, obj) \
-    if (!PARROT_CAPTURE(obj)->hash) \
-        PARROT_CAPTURE(obj)->hash = pmc_new((i), enum_class_Hash);
+    do { \
+        GETATTR_Capture_hash((i), (obj), hash); \
+        if (!hash) \
+            SETATTR_Capture_hash((i), (obj),  pmc_new((i), enum_class_Hash)); \
+    } while (0)
 
-pmclass Capture need_ext {
+pmclass Capture auto_attrs {
     ATTR PMC    *array;
     ATTR PMC    *hash;
-    ATTR INTVAL  data_size;
 
 /*
 
@@ -37,31 +41,14 @@
 
 Initializes the Capture instance.
 
-=item C<void destroy()>
-
-Free structures.
-
 =cut
 
 */
 
     VTABLE void init() {
-        Parrot_Capture_attributes *capture = mem_allocate_typed(Parrot_Capture_attributes);
-        PMC_data(SELF)          = capture;
-        capture->array          = NULL;
-        capture->hash           = NULL;
-        capture->data_size      = CAPTURE_DATA_SIZE;
-        PObj_active_destroy_SET(SELF);
         PObj_custom_mark_SET(SELF);
     }
 
-    VTABLE void destroy() {
-        if (PARROT_CAPTURE(SELF)) {
-            mem_sys_free(PARROT_CAPTURE(SELF));
-            PMC_data(SELF) = NULL;
-        }
-    }
-
 /*
 
 =item C<PMC *clone()>
@@ -104,27 +91,35 @@
 */
 
     VTABLE void set_number_keyed_int(INTVAL key, FLOATVAL value) {
+        PMC *array;
+
         CAPTURE_array_CREATE(INTERP, SELF);
-        VTABLE_set_number_keyed_int(INTERP, PARROT_CAPTURE(SELF)->array,
-                                    key, value);
+        GET_ATTR_array(INTERP, SELF, array);
+        VTABLE_set_number_keyed_int(INTERP, array, key, value);
     }
 
     VTABLE void set_integer_keyed_int(INTVAL key, INTVAL value) {
+        PMC *array;
+
         CAPTURE_array_CREATE(INTERP, SELF);
-        VTABLE_set_integer_keyed_int(INTERP, PARROT_CAPTURE(SELF)->array,
-                                     key, value);
+        GET_ATTR_array(INTERP, SELF, array);
+        VTABLE_set_integer_keyed_int(INTERP, array, key, value);
     }
 
     VTABLE void set_pmc_keyed_int(INTVAL key, PMC *value) {
+        PMC *array;
+
         CAPTURE_array_CREATE(INTERP, SELF);
-        VTABLE_set_pmc_keyed_int(INTERP, PARROT_CAPTURE(SELF)->array,
-                                 key, value);
+        GET_ATTR_array(INTERP, SELF, array);
+        VTABLE_set_pmc_keyed_int(INTERP, array, key, value);
     }
 
     VTABLE void set_string_keyed_int(INTVAL key, STRING *value) {
+        PMC *array;
+
         CAPTURE_array_CREATE(INTERP, SELF);
-        VTABLE_set_string_keyed_int(INTERP, PARROT_CAPTURE(SELF)->array,
-                                    key, value);
+        GET_ATTR_array(INTERP, SELF, array);
+        VTABLE_set_string_keyed_int(INTERP, array, key, value);
     }
 
 /*
@@ -144,31 +139,47 @@
 */
 
     VTABLE FLOATVAL get_number_keyed_int(INTVAL key) {
-        if (!(PARROT_CAPTURE(SELF)->array))
+        PMC *array;
+
+        GET_ATTR_array(INTERP, SELF, array);
+
+        if (!array)
             return 0.0;
-        return VTABLE_get_number_keyed_int(INTERP, PARROT_CAPTURE(SELF)->array,
-                                           key);
+
+        return VTABLE_get_number_keyed_int(INTERP, array, key);
     }
 
     VTABLE INTVAL get_integer_keyed_int(INTVAL key) {
-        if (!(PARROT_CAPTURE(SELF)->array))
+        PMC *array;
+
+        GET_ATTR_array(INTERP, SELF, array);
+
+        if (!array)
             return 0;
-        return VTABLE_get_integer_keyed_int(INTERP, PARROT_CAPTURE(SELF)->array,
-                                            key);
+
+        return VTABLE_get_integer_keyed_int(INTERP, array, key);
     }
 
     VTABLE PMC *get_pmc_keyed_int(INTVAL key) {
-        if (!(PARROT_CAPTURE(SELF)->array))
+        PMC *array;
+
+        GET_ATTR_array(INTERP, SELF, array);
+
+        if (!array)
             return PMCNULL;
-        return VTABLE_get_pmc_keyed_int(INTERP, PARROT_CAPTURE(SELF)->array,
-                                        key);
+
+        return VTABLE_get_pmc_keyed_int(INTERP, array, key);
     }
 
     VTABLE STRING *get_string_keyed_int(INTVAL key) {
-        if (!(PARROT_CAPTURE(SELF)->array))
+        PMC *array;
+
+        GET_ATTR_array(INTERP, SELF, array);
+
+        if (!array)
             return CONST_STRING(INTERP, "");
-        return VTABLE_get_string_keyed_int(INTERP, PARROT_CAPTURE(SELF)->array,
-                                           key);
+
+        return VTABLE_get_string_keyed_int(INTERP, array, key);
     }
 
 /*
@@ -198,43 +209,75 @@
 */
 
     VTABLE void push_float(FLOATVAL value) {
+        PMC *array;
+
         CAPTURE_array_CREATE(INTERP, SELF);
-        VTABLE_push_float(INTERP, PARROT_CAPTURE(SELF)->array, value);
+        GET_ATTR_array(INTERP, SELF, array);
+
+        VTABLE_push_float(INTERP, array, value);
     }
 
     VTABLE void push_integer(INTVAL value) {
+        PMC *array;
+
         CAPTURE_array_CREATE(INTERP, SELF);
-        VTABLE_push_integer(INTERP, PARROT_CAPTURE(SELF)->array, value);
+        GET_ATTR_array(INTERP, SELF, array);
+
+        VTABLE_push_integer(INTERP, array, value);
     }
 
     VTABLE void push_pmc(PMC *value) {
+        PMC *array;
+
         CAPTURE_array_CREATE(INTERP, SELF);
-        VTABLE_push_pmc(INTERP, PARROT_CAPTURE(SELF)->array, value);
+        GET_ATTR_array(INTERP, SELF, array);
+
+        VTABLE_push_pmc(INTERP, array, value);
     }
 
     VTABLE void push_string(STRING *value) {
+        PMC *array;
+
         CAPTURE_array_CREATE(INTERP, SELF);
-        VTABLE_push_string(INTERP, PARROT_CAPTURE(SELF)->array, value);
+        GET_ATTR_array(INTERP, SELF, array);
+
+        VTABLE_push_string(INTERP, array, value);
     }
 
     VTABLE void unshift_float(FLOATVAL value) {
+        PMC *array;
+
         CAPTURE_array_CREATE(INTERP, SELF);
-        VTABLE_unshift_float(INTERP, PARROT_CAPTURE(SELF)->array, value);
+        GET_ATTR_array(INTERP, SELF, array);
+
+        VTABLE_unshift_float(INTERP, array, value);
     }
 
     VTABLE void unshift_integer(INTVAL value) {
+        PMC *array;
+
         CAPTURE_array_CREATE(INTERP, SELF);
-        VTABLE_unshift_integer(INTERP, PARROT_CAPTURE(SELF)->array, value);
+        GET_ATTR_array(INTERP, SELF, array);
+
+        VTABLE_unshift_integer(INTERP, array, value);
     }
 
     VTABLE void unshift_pmc(PMC *value) {
+        PMC *array;
+
         CAPTURE_array_CREATE(INTERP, SELF);
-        VTABLE_unshift_pmc(INTERP, PARROT_CAPTURE(SELF)->array, value);
+        GET_ATTR_array(INTERP, SELF, array);
+
+        VTABLE_unshift_pmc(INTERP, array, value);
     }
 
     VTABLE void unshift_string(STRING *value) {
+        PMC *array;
+
         CAPTURE_array_CREATE(INTERP, SELF);
-        VTABLE_unshift_string(INTERP, PARROT_CAPTURE(SELF)->array, value);
+        GET_ATTR_array(INTERP, SELF, array);
+
+        VTABLE_unshift_string(INTERP, array, value);
     }
 
 /*
@@ -264,43 +307,75 @@
 */
 
     VTABLE FLOATVAL pop_float() {
+        PMC *array;
+
         CAPTURE_array_CREATE(INTERP, SELF);
-        return VTABLE_pop_float(INTERP, PARROT_CAPTURE(SELF)->array);
+        GET_ATTR_array(INTERP, SELF, array);
+
+        return VTABLE_pop_float(INTERP, array);
     }
 
     VTABLE INTVAL pop_integer() {
+        PMC *array;
+
         CAPTURE_array_CREATE(INTERP, SELF);
-        return VTABLE_pop_integer(INTERP, PARROT_CAPTURE(SELF)->array);
+        GET_ATTR_array(INTERP, SELF, array);
+
+        return VTABLE_pop_integer(INTERP, array);
     }
 
     VTABLE PMC *pop_pmc() {
+        PMC *array;
+
         CAPTURE_array_CREATE(INTERP, SELF);
-        return VTABLE_pop_pmc(INTERP, PARROT_CAPTURE(SELF)->array);
+        GET_ATTR_array(INTERP, SELF, array);
+
+        return VTABLE_pop_pmc(INTERP, array);
     }
 
     VTABLE STRING *pop_string() {
+        PMC *array;
+
         CAPTURE_array_CREATE(INTERP, SELF);
-        return VTABLE_pop_string(INTERP, PARROT_CAPTURE(SELF)->array);
+        GET_ATTR_array(INTERP, SELF, array);
+
+        return VTABLE_pop_string(INTERP, array);
     }
 
     VTABLE FLOATVAL shift_float() {
+        PMC *array;
+
         CAPTURE_array_CREATE(INTERP, SELF);
-        return VTABLE_shift_float(INTERP, PARROT_CAPTURE(SELF)->array);
+        GET_ATTR_array(INTERP, SELF, array);
+
+        return VTABLE_shift_float(INTERP, array);
     }
 
     VTABLE INTVAL shift_integer() {
+        PMC *array;
+
         CAPTURE_array_CREATE(INTERP, SELF);
-        return VTABLE_shift_integer(INTERP, PARROT_CAPTURE(SELF)->array);
+        GET_ATTR_array(INTERP, SELF, array);
+
+        return VTABLE_shift_integer(INTERP, array);
     }
 
     VTABLE PMC *shift_pmc() {
+        PMC *array;
+
         CAPTURE_array_CREATE(INTERP, SELF);
-        return VTABLE_shift_pmc(INTERP, PARROT_CAPTURE(SELF)->array);
+        GET_ATTR_array(INTERP, SELF, array);
+
+        return VTABLE_shift_pmc(INTERP, array);
     }
 
     VTABLE STRING *shift_string() {
+        PMC *array;
+
         CAPTURE_array_CREATE(INTERP, SELF);
-        return VTABLE_shift_string(INTERP, PARROT_CAPTURE(SELF)->array);
+        GET_ATTR_array(INTERP, SELF, array);
+
+        return VTABLE_shift_string(INTERP, array);
     }
 
 /*
@@ -326,29 +401,45 @@
 */
 
     VTABLE INTVAL elements() {
-        if (!PARROT_CAPTURE(SELF)->array) return 0;
-        return VTABLE_elements(INTERP, PARROT_CAPTURE(SELF)->array);
+        PMC *array;
+
+        GET_ATTR_array(INTERP, SELF, array);
+
+        if (!array)
+            return 0;
+
+        return VTABLE_elements(INTERP, array);
     }
 
     VTABLE INTVAL defined_keyed_int(INTVAL key) {
-        if (!PARROT_CAPTURE(SELF)->array)
+        PMC *array;
+
+        GET_ATTR_array(INTERP, SELF, array);
+
+        if (!array)
             return 0;
 
-        return VTABLE_defined_keyed_int(INTERP, PARROT_CAPTURE(SELF)->array,
-                                        key);
+        return VTABLE_defined_keyed_int(INTERP, array, key);
     }
 
     VTABLE INTVAL exists_keyed_int(INTVAL key) {
-        if (!PARROT_CAPTURE(SELF)->array)
+        PMC *array;
+
+        GET_ATTR_array(INTERP, SELF, array);
+
+        if (!array)
             return 0;
 
-        return VTABLE_exists_keyed_int(INTERP, PARROT_CAPTURE(SELF)->array,
-                                               key);
+        return VTABLE_exists_keyed_int(INTERP, array, key);
     }
 
     VTABLE void delete_keyed_int(INTVAL key) {
-        if (PARROT_CAPTURE(SELF)->array)
-            VTABLE_delete_keyed_int(INTERP, PARROT_CAPTURE(SELF)->array, key);
+        PMC *array;
+
+        GET_ATTR_array(INTERP, SELF, array);
+
+        if (array)
+            VTABLE_delete_keyed_int(INTERP, array, key);
     }
 
 /*
@@ -368,24 +459,39 @@
 */
 
     VTABLE void set_number_keyed(PMC *key, FLOATVAL value) {
+        PMC *hash;
+
         CAPTURE_hash_CREATE(INTERP, SELF);
-        VTABLE_set_number_keyed(INTERP, PARROT_CAPTURE(SELF)->hash, key, value);
+        GET_ATTR_hash(INTERP, SELF, hash);
+
+        VTABLE_set_number_keyed(INTERP, hash, key, value);
     }
 
     VTABLE void set_integer_keyed(PMC *key, INTVAL value) {
+        PMC *hash;
+
         CAPTURE_hash_CREATE(INTERP, SELF);
-        VTABLE_set_integer_keyed(INTERP, PARROT_CAPTURE(SELF)->hash,
-                                 key, value);
+        GET_ATTR_hash(INTERP, SELF, hash);
+
+        VTABLE_set_integer_keyed(INTERP, hash, key, value);
     }
 
     VTABLE void set_pmc_keyed(PMC *key, PMC *value) {
+        PMC *hash;
+
         CAPTURE_hash_CREATE(INTERP, SELF);
-        VTABLE_set_pmc_keyed(INTERP, PARROT_CAPTURE(SELF)->hash, key, value);
+        GET_ATTR_hash(INTERP, SELF, hash);
+
+        VTABLE_set_pmc_keyed(INTERP, hash, key, value);
     }
 
     VTABLE void set_string_keyed(PMC *key, STRING *value) {
+        PMC *hash;
+
         CAPTURE_hash_CREATE(INTERP, SELF);
-        VTABLE_set_string_keyed(INTERP, PARROT_CAPTURE(SELF)->hash, key, value);
+        GET_ATTR_hash(INTERP, SELF, hash);
+
+        VTABLE_set_string_keyed(INTERP, hash, key, value);
     }
 
 /*
@@ -405,28 +511,158 @@
 */
 
     VTABLE FLOATVAL get_number_keyed(PMC *key) {
-        if (!(PARROT_CAPTURE(SELF)->hash))
+        PMC *hash;
+
+        GET_ATTR_hash(INTERP, SELF, hash);
+
+        if (!hash)
             return 0.0;
-        return VTABLE_get_number_keyed(INTERP, PARROT_CAPTURE(SELF)->hash, key);
+
+        return VTABLE_get_number_keyed(INTERP, hash, key);
     }
 
     VTABLE INTVAL get_integer_keyed(PMC *key) {
-        if (!(PARROT_CAPTURE(SELF)->hash))
+        PMC *hash;
+
+        GET_ATTR_hash(INTERP, SELF, hash);
+
+        if (!hash)
             return 0;
-        return VTABLE_get_integer_keyed(INTERP, PARROT_CAPTURE(SELF)->hash,
-                                        key);
+
+        return VTABLE_get_integer_keyed(INTERP, hash, key);
     }
 
     VTABLE PMC *get_pmc_keyed(PMC *key) {
-        if (!(PARROT_CAPTURE(SELF)->hash))
+        PMC *hash;
+
+        GET_ATTR_hash(INTERP, SELF, hash);
+
+        if (!hash)
             return PMCNULL;
-        return VTABLE_get_pmc_keyed(INTERP, PARROT_CAPTURE(SELF)->hash, key);
+
+        return VTABLE_get_pmc_keyed(INTERP, hash, key);
     }
 
     VTABLE STRING *get_string_keyed(PMC *key) {
-        if (!(PARROT_CAPTURE(SELF)->hash))
+        PMC *hash;
+
+        GET_ATTR_hash(INTERP, SELF, hash);
+
+        if (!hash)
+            return CONST_STRING(INTERP, "");
+
+        return VTABLE_get_string_keyed(INTERP, hash, key);
+    }
+
+/*
+
+=item C<void set_number_keyed_str(STRING *key, FLOATVAL value)>
+
+=item C<void set_integer_keyed_str(STRING *key, INTVAL value)>
+
+=item C<void set_pmc_keyed_str(STRING *key, PMC *value)>
+
+=item C<void set_string_keyed_str(STRING *key, STRING *value)>
+
+Sets a value in the hash component of the Capture.
+
+=cut
+
+*/
+
+    VTABLE void set_number_keyed_str(STRING *key, FLOATVAL value) {
+        PMC *hash;
+
+        CAPTURE_hash_CREATE(INTERP, SELF);
+        GET_ATTR_hash(INTERP, SELF, hash);
+
+        VTABLE_set_number_keyed_str(INTERP, hash, key, value);
+    }
+
+    VTABLE void set_integer_keyed_str(STRING *key, INTVAL value) {
+        PMC *hash;
+
+        CAPTURE_hash_CREATE(INTERP, SELF);
+        GET_ATTR_hash(INTERP, SELF, hash);
+
+        VTABLE_set_integer_keyed_str(INTERP, hash, key, value);
+    }
+
+    VTABLE void set_pmc_keyed_str(STRING *key, PMC *value) {
+        PMC *hash;
+
+        CAPTURE_hash_CREATE(INTERP, SELF);
+        GET_ATTR_hash(INTERP, SELF, hash);
+
+        VTABLE_set_pmc_keyed_str(INTERP, hash, key, value);
+    }
+
+    VTABLE void set_string_keyed_str(STRING *key, STRING *value) {
+        PMC *hash;
+
+        CAPTURE_hash_CREATE(INTERP, SELF);
+        GET_ATTR_hash(INTERP, SELF, hash);
+
+        VTABLE_set_string_keyed_str(INTERP, hash, key, value);
+    }
+
+/*
+
+=item C<FLOATVAL get_number_keyed_str(STRING *key)>
+
+=item C<INTVAL get_integer_keyed_str(STRING *key)>
+
+=item C<PMC *get_pmc_keyed_str(STRING *key)>
+
+=item C<STRING *get_string_keyed_str(STRING *key)>
+
+Retrieves a value in the hash component of the Capture.
+
+=cut
+
+*/
+
+    VTABLE FLOATVAL get_number_keyed_str(STRING *key) {
+        PMC *hash;
+
+        GET_ATTR_hash(INTERP, SELF, hash);
+
+        if (!hash)
+            return 0.0;
+
+        return VTABLE_get_number_keyed_str(INTERP, hash, key);
+    }
+
+    VTABLE INTVAL get_integer_keyed_str(STRING *key) {
+        PMC *hash;
+
+        GET_ATTR_hash(INTERP, SELF, hash);
+
+        if (!hash)
+            return 0;
+
+        return VTABLE_get_integer_keyed_str(INTERP, hash, key);
+    }
+
+    VTABLE PMC *get_pmc_keyed_str(STRING *key) {
+        PMC *hash;
+
+        GET_ATTR_hash(INTERP, SELF, hash);
+
+        if (!hash)
+            return PMCNULL;
+
+        return VTABLE_get_pmc_keyed_str(INTERP, hash, key);
+    }
+
+    VTABLE STRING *get_string_keyed_str(STRING *key) {
+        PMC *hash;
+
+        GET_ATTR_hash(INTERP, SELF, hash);
+
+        if (!hash)
             return CONST_STRING(INTERP, "");
-        return VTABLE_get_string_keyed(INTERP, PARROT_CAPTURE(SELF)->hash, key);
+        return VTABLE_get_string_keyed_str(INTERP, hash, key);
     }
 
 /*
@@ -448,18 +684,81 @@
 */
 
     VTABLE INTVAL defined_keyed(PMC *key) {
-        if (!PARROT_CAPTURE(SELF)->hash) return 0;
-        return VTABLE_defined_keyed(INTERP, PARROT_CAPTURE(SELF)->hash, key);
+        PMC *hash;
+
+        GET_ATTR_hash(INTERP, SELF, hash);
+
+        if (!hash)
+            return 0;
+
+        return VTABLE_defined_keyed(INTERP, hash, key);
     }
 
     VTABLE INTVAL exists_keyed(PMC *key) {
-        if (!PARROT_CAPTURE(SELF)->hash) return 0;
-        return VTABLE_exists_keyed(INTERP, PARROT_CAPTURE(SELF)->hash, key);
+        PMC *hash;
+
+        GET_ATTR_hash(INTERP, SELF, hash);
+
+        if (!hash)
+            return 0;
+
+        return VTABLE_exists_keyed(INTERP, hash, key);
     }
 
     VTABLE void delete_keyed(PMC *key) {
-        if (PARROT_CAPTURE(SELF)->hash)
-            VTABLE_delete_keyed(INTERP, PARROT_CAPTURE(SELF)->hash, key);
+        PMC *hash;
+
+        GET_ATTR_hash(INTERP, SELF, hash);
+
+        if (hash)
+            VTABLE_delete_keyed(INTERP, hash, key);
+    }
+
+/*
+
+=item C<INTVAL defined_keyed_str(STRING *key)>
+
+Return true if element C<key> of the hash component is defined.
+
+=item C<INTVAL exists_keyed_str(STRING *key)>
+
+Return true if element C<key> of the hash component exists.
+
+=item C<void delete_keyed_str(STRING *key)>
+
+Delete the element corresponding to C<key> in the hash component.
+
+=cut
+
+*/
+
+    VTABLE INTVAL defined_keyed_str(STRING *key) {
+        PMC *hash;
+
+        GET_ATTR_hash(INTERP, SELF, hash);
+
+        if (!hash)
+            return 0;
+        return VTABLE_defined_keyed_str(INTERP, hash, key);
+    }
+
+    VTABLE INTVAL exists_keyed_str(STRING *key) {
+        PMC *hash;
+
+        GET_ATTR_hash(INTERP, SELF, hash);
+
+        if (!hash)
+            return 0;
+        return VTABLE_exists_keyed_str(INTERP, hash, key);
+    }
+
+    VTABLE void delete_keyed_str(STRING *key) {
+        PMC *hash;
+
+        GET_ATTR_hash(INTERP, SELF, hash);
+
+        if (hash)
+            VTABLE_delete_keyed_str(INTERP, hash, key);
     }
 
 /*
@@ -475,12 +774,15 @@
 
     VTABLE void set_pmc(PMC *capture) {
         if (PMC_IS_NULL(capture)) {
-            PARROT_CAPTURE(SELF)->array = NULL;
-            PARROT_CAPTURE(SELF)->hash = NULL;
+            SET_ATTR_array(INTERP, SELF, NULL);
+            SET_ATTR_hash(INTERP, SELF, NULL);
         }
         else if (VTABLE_isa(INTERP, capture, CONST_STRING(INTERP, "Capture"))) {
-            PARROT_CAPTURE(SELF)->array = PARROT_CAPTURE(capture)->array;
-            PARROT_CAPTURE(SELF)->hash  = PARROT_CAPTURE(capture)->hash;
+            PMC *array, *hash;
+            GET_ATTR_array(INTERP, capture, array);
+            GET_ATTR_hash(INTERP, capture, hash);
+            SET_ATTR_array(INTERP, SELF, array);
+            SET_ATTR_hash(INTERP, SELF, hash);
         }
         else
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
@@ -499,7 +801,7 @@
 */
 
     VTABLE STRING *get_string() {
-        STRING *classname = VTABLE_name(INTERP, SELF);
+        const STRING * const classname = VTABLE_name(INTERP, SELF);
         return Parrot_sprintf_c(INTERP, "%S[0x%x]", classname, SELF);
     }
 
@@ -514,15 +816,16 @@
 */
 
     VTABLE void mark() {
-        PMC ** const data = PMC_data_typed(SELF, PMC **);
-        INTVAL i;
+        PMC *array, *hash;
 
-        if (!data)
+        if (!PMC_data(SELF))
             return;
 
-        for (i = PARROT_CAPTURE(SELF)->data_size - 1; i >= 0; --i)
-            if (data[i])
-                Parrot_gc_mark_PObj_alive(interp, (PObj *)data[i]);
+        GET_ATTR_array(INTERP, SELF, array);
+        GET_ATTR_hash(INTERP, SELF, hash);
+
+        Parrot_gc_mark_PMC_alive(INTERP, array);
+        Parrot_gc_mark_PMC_alive(INTERP, hash);
     }
 
 /*
@@ -538,40 +841,45 @@
 */
 
     METHOD list() {
-        PMC *capt_array;
+        PMC *array;
         PMC *capt = SELF;
+
         /* XXX:  This workaround is for when we get here as
                  part of a subclass of Capture */
         if (PObj_is_object_TEST(SELF)) {
-            STRING *attribute = CONST_STRING(interp, "proxy");
             PMC    *classobj;
-            PMC *ns = INTERP->root_namespace;
-            ns = Parrot_get_namespace_keyed_str(INTERP, ns, CONST_STRING(INTERP, "parrot"));
-            ns = Parrot_get_namespace_keyed_str(INTERP, ns, CONST_STRING(INTERP, "Capture"));
-            classobj  = Parrot_oo_get_class(INTERP, ns);
-            capt              = VTABLE_get_attr_keyed(interp, SELF, classobj, attribute);
+            PMC    *ns        = INTERP->root_namespace;
+            STRING *attribute = CONST_STRING(INTERP, "proxy");
+
+            ns                = Parrot_get_namespace_keyed_str(INTERP, ns, CONST_STRING(INTERP, "parrot"));
+            ns                = Parrot_get_namespace_keyed_str(INTERP, ns, CONST_STRING(INTERP, "Capture"));
+            classobj          = Parrot_oo_get_class(INTERP, ns);
+            capt              = VTABLE_get_attr_keyed(INTERP, SELF, classobj, attribute);
         }
 
         CAPTURE_array_CREATE(INTERP, capt);
-        capt_array = PARROT_CAPTURE(capt)->array;
+        GET_ATTR_array(INTERP, capt, array);
 
-        RETURN(PMC *capt_array);
+        RETURN(PMC *array);
     }
 
     METHOD hash() {
-        PMC *capt_hash;
+        PMC *hash;
         PMC *capt = SELF;
         /* XXX:  This workaround is for when we get here as
                  part of a subclass of Capture */
         if (PObj_is_object_TEST(SELF)) {
-            STRING *classname = CONST_STRING(INTERP, "Capture");
-            PMC    *classobj  = Parrot_oo_get_class_str(INTERP, classname);
-            STRING *attribute = CONST_STRING(interp, "proxy");
-            capt              = VTABLE_get_attr_keyed(interp, SELF, classobj, attribute);
+            STRING * const classname = CONST_STRING(INTERP, "Capture");
+            STRING        *attribute = CONST_STRING(INTERP, "proxy");
+            PMC           *classobj  = Parrot_oo_get_class_str(INTERP, classname);
+
+            capt                     = VTABLE_get_attr_keyed(INTERP, SELF, classobj, attribute);
         }
+
         CAPTURE_hash_CREATE(INTERP, capt);
-        capt_hash = PARROT_CAPTURE(capt)->hash;
-        RETURN(PMC *capt_hash);
+        GET_ATTR_hash(INTERP, capt, hash);
+
+        RETURN(PMC *hash);
     }
 
 }

Modified: branches/orderedhash_revamp/src/pmc/class.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/class.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/class.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -21,7 +21,7 @@
 
 =item C<id>
 
-The type number of the PMC. [deprecated: See RT #48024]
+The type number of the PMC.
 
 =item C<name>
 
@@ -46,8 +46,8 @@
 
 =item C<all_parents>
 
-A cached array of ourself and all parent classes, in MRO order.
-A ResizablePMCArray PMC is allocated during initialization,
+A cached array of ourself and all parent classes, in method resolution
+order (MRO). A ResizablePMCArray PMC is allocated during initialization,
 and is populated with the current class.
 
 =item C<roles>
@@ -91,8 +91,45 @@
 
 #define PARROT_IN_OBJECTS_C /* To get the vtable.h imports we want. */
 #include "parrot/oo_private.h"
-#include "pmc_object.h"
-#include "pmc_namespace.h"
+#include "pmc/pmc_object.h"
+#include "pmc/pmc_namespace.h"
+
+static int
+cache_class_attribs(PARROT_INTERP, PMC *cur_class, PMC *attrib_index,
+    PMC *cache, int cur_index)
+{
+    /* The attribute metadata hash. */
+    Parrot_Class_attributes * const class_info = PARROT_CLASS(cur_class);
+    PMC          * const attribs     = class_info->attrib_metadata;
+    PMC          * const iter        = VTABLE_get_iter(interp, attribs);
+
+    /* Build a string representing the fully qualified class name. */
+    /* Retrieve the fully qualified class name for the class. */
+    STRING       * const fq_class    = VTABLE_get_string(interp, cur_class);
+    PMC          * const class_cache = pmc_new(interp, enum_class_Hash);
+    VTABLE_set_pmc_keyed_str(interp, cache, fq_class, class_cache);
+
+    /* Iterate over the attributes. */
+    while (VTABLE_get_bool(interp, iter)) {
+        /* Get attribute. */
+        PMC    * const cur_attrib  = VTABLE_get_pmc_keyed_str(interp,
+                attribs, VTABLE_shift_string(interp, iter));
+
+        /* Get attribute name and append it to the key. */
+        STRING * const name_str    = CONST_STRING(interp, "name");
+        STRING * const attrib_name = VTABLE_get_string_keyed_str(
+            interp, cur_attrib, name_str);
+
+        STRING * const full_key    = Parrot_str_append(interp, fq_class, attrib_name);
+
+        /* Insert into hash, along with index. */
+        VTABLE_set_integer_keyed_str(interp, attrib_index, full_key, cur_index);
+        VTABLE_set_integer_keyed_str(interp, class_cache, attrib_name, cur_index);
+        cur_index++;
+    }
+
+    return cur_index;
+}
 
 /* This function builds the attribute index (table to map class name and
  * attribute name to an index) for the current class. */
@@ -106,7 +143,7 @@
     const int            num_classes  = VTABLE_elements(interp, _class->all_parents);
     int                  i;
 
-    /* We will go over the list of all parents to construct the attribute index. */
+    /* Go over the list of all parents to construct the attribute index. */
     for (i = 0; i < num_classes; i++) {
        /* Get the class and check that it respects the standard class interface
         * (if not we don't know how it stores its attributes, so we'll have to
@@ -114,44 +151,15 @@
         PMC * const cur_class = VTABLE_get_pmc_keyed_int(interp,
                                     _class->all_parents, i);
 
-        if (PObj_is_class_TEST(cur_class)) {
-            /* The attribute metadata hash. */
-            Parrot_Class_attributes * const class_info = PARROT_CLASS(cur_class);
-            PMC          * const attribs     = class_info->attrib_metadata;
-            PMC          * const iter        = VTABLE_get_iter(interp, attribs);
-
-            /* Build a string representing the fully qualified class name. */
-            /* Retrieve the fully qualified class name for the class. */
-            STRING       * const fq_class    = VTABLE_get_string(interp, cur_class);
-            PMC          * const class_cache = pmc_new(interp, enum_class_Hash);
-            VTABLE_set_pmc_keyed_str(interp, cache, fq_class, class_cache);
-
-            /* Iterate over the attributes. */
-            while (VTABLE_get_bool(interp, iter)) {
-                /* Get attribute. */
-                PMC    * const cur_attrib  = VTABLE_get_pmc_keyed_str(interp,
-                        attribs, VTABLE_shift_string(interp, iter));
-
-                /* Get attribute name and append it to the key. */
-                STRING * const name_str    = CONST_STRING(interp, "name");
-                STRING * const attrib_name = VTABLE_get_string_keyed_str(
-                    interp, cur_attrib, name_str);
-
-                STRING * const full_key    = Parrot_str_append(interp, fq_class, attrib_name);
-
-                /* Insert into hash, along with index. */
-                VTABLE_set_integer_keyed_str(interp, attrib_index, full_key, cur_index);
-                VTABLE_set_integer_keyed_str(interp, class_cache, attrib_name, cur_index);
-                cur_index++;
-            }
-        }
+        if (PObj_is_class_TEST(cur_class))
+            cur_index = cache_class_attribs(interp, cur_class,
+                attrib_index, cache, cur_index);
     }
 
     /* Store built attribute index and invalidate cache. */
     _class->attrib_index = attrib_index;
     _class->attrib_cache = cache;
 }
-
 /* Takes a hash and initializes the class based on it. */
 static void
 init_class_from_hash(PARROT_INTERP, PMC *self, PMC *info)
@@ -189,7 +197,7 @@
         }
         else {
             PMC * const hll_ns = VTABLE_get_pmc_keyed_int(interp,
-                    interp->HLL_namespace, CONTEXT(interp)->current_HLL);
+                    interp->HLL_namespace, Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp)));
             new_namespace = Parrot_make_namespace_keyed(interp, hll_ns, name_arg);
         }
 
@@ -233,12 +241,13 @@
     /* If we were attached to a namespace and are now attached to a new one,
      * need to unset ourselves in the old namespace. */
     if (!PMC_IS_NULL(old_ns) && _class->_namespace != old_ns)
-        Parrot_PCCINVOKE(interp, old_ns, CONST_STRING(interp, "set_class"), "P->", PMCNULL);
+        Parrot_pcc_invoke_method_from_c_args(interp, old_ns, CONST_STRING(interp, "set_class"), "P->", PMCNULL);
 
     /* Link namespace to this class, if there is one. */
     if (!PMC_IS_NULL(_class->_namespace)) {
         STRING * const set_class_str = CONST_STRING(interp, "set_class");
-        Parrot_PCCINVOKE(interp, _class->_namespace, set_class_str, "P->", self);
+        Parrot_pcc_invoke_method_from_c_args(interp, _class->_namespace, set_class_str, "P->",
+                                             self);
     }
 
     /* Initialize resolve_method. */
@@ -335,12 +344,15 @@
 
         if (!PMC_IS_NULL(meth)) {
             /* build an empty signature; it has an invocant but no args/retvals */
-            PMC * const sig_obj = pmc_new(interp, enum_class_CallSignature);
+            PMC * const sig_obj = pmc_new(interp, enum_class_CallContext);
+            /* preserve current_object */
+            PMC * const old_object = interp->current_object;
             VTABLE_set_string_native(interp, sig_obj, CONST_STRING(interp, "Pi->"));
             /* add the invocant */
             VTABLE_unshift_pmc(interp, sig_obj, object);
+            interp->current_object = object;
             Parrot_pcc_invoke_from_sig_object(interp, meth, sig_obj);
-            gc_unregister_pmc(interp, sig_obj);
+            interp->current_object = old_object;
         }
     }
 }
@@ -367,7 +379,8 @@
         meth = Parrot_oo_find_vtable_override_for_class(interp, parent, name);
 
         if (!PMC_IS_NULL(meth))
-            Parrot_run_meth_fromc_args(interp, meth, object, name, "vP", init);
+            Parrot_pcc_invoke_sub_from_c_args(interp, meth,
+                    "PiP->", object, init);
     }
 }
 
@@ -403,16 +416,19 @@
     return _class->name;
 }
 
-/* calculates the C3 method resolution order for this class --
- * working hard *not* to recalculate MRO when unnecessary */
-static PMC *
+/* calculates the C3 method resolution order for this class. C3 is the
+ * name of an algorithm used to calculate the method resolution order
+ * (MRO) to use in a system with multiple inheritance. For more information
+ * see the documentation associated with C<Parrot_ComputeMRO_C3>.
+ */
+static void
 calculate_mro(PARROT_INTERP, PMC *SELF, INTVAL num_parents)
 {
     Parrot_Class_attributes  * const _class = PARROT_CLASS(SELF);
 
     /* SELF is already on the all_parents */
     if (num_parents == 0)
-        return _class->all_parents;
+        return;
 
     if (num_parents == 1) {
         STRING * const ap         = CONST_STRING(interp, "all_parents");
@@ -421,10 +437,13 @@
         PMC    * const parent_mro = VTABLE_inspect_str(interp, parent, ap);
         PMC    * const mro        = VTABLE_clone(interp, parent_mro);
         VTABLE_unshift_pmc(interp, mro, SELF);
-        return mro;
+        _class->all_parents = mro;
     }
+    else
+        _class->all_parents = Parrot_ComputeMRO_C3(interp, SELF);
 
-    return Parrot_ComputeMRO_C3(interp, SELF);
+    if (!CLASS_is_anon_TEST(SELF))
+        interp->vtables[VTABLE_type(interp, SELF)]->mro = _class->all_parents;
 }
 
 /*
@@ -439,10 +458,9 @@
 
 */
 
-pmclass Class
-    need_ext {
+pmclass Class auto_attrs {
 
-    ATTR INTVAL id;             /* The type number of the PMC. [deprecated: See RT #48024] */
+    ATTR INTVAL id;             /* The type number of the PMC. */
     ATTR STRING *name;          /* The name of the class. */
     ATTR STRING *fullname;      /* The name of the class. */
     ATTR PMC *_namespace;       /* The namespace it's linked to, if any. */
@@ -458,6 +476,7 @@
     ATTR PMC *resolve_method;   /* List of method names the class provides to resolve
                                  * conflicts with methods from roles. */
     ATTR PMC *parent_overrides;
+    ATTR PMC *meth_cache;
 
 /*
 
@@ -476,14 +495,13 @@
 */
 
     VTABLE void init() {
-        Parrot_Class_attributes * const _class = mem_allocate_zeroed_typed(Parrot_Class_attributes);
+        Parrot_Class_attributes * const _class =
+                (Parrot_Class_attributes *) PMC_data(SELF);
 
-        /* Set flags for custom GC mark and destroy. */
+        /* Set flag for custom GC mark. */
         PObj_custom_mark_SET(SELF);
-        PObj_active_destroy_SET(SELF);
 
         /* Set up the object. */
-        PMC_data(SELF)          = _class;
         _class->name            = CONST_STRING(interp, "");
         _class->_namespace      = PMCNULL;
         _class->parents         = pmc_new(interp, enum_class_ResizablePMCArray);
@@ -493,6 +511,7 @@
         _class->attrib_metadata = pmc_new(interp, enum_class_Hash);
         _class->attrib_index    = PMCNULL;
         _class->attrib_cache    = PMCNULL;
+        _class->meth_cache      = PMCNULL;
         _class->resolve_method  = pmc_new(interp, enum_class_ResizablePMCArray);
 
         _class->vtable_overrides = pmc_new(interp, enum_class_Hash);
@@ -518,36 +537,36 @@
 
         /* fast attempt to determine init_data type */
         switch (arg_type) {
-            case enum_class_String:
-            case enum_class_Key:
-            case enum_class_ResizableStringArray:
-            case enum_class_NameSpace:
+          case enum_class_String:
+          case enum_class_Key:
+          case enum_class_ResizableStringArray:
+          case enum_class_NameSpace:
+            /* set only the name property */
+            arg = pmc_new(interp, enum_class_Hash);
+            VTABLE_set_pmc_keyed_str(interp, arg, name_str, init_data);
+            break;
+
+          case enum_class_Hash:
+            arg = init_data;
+            break;
+
+            /* slow attempt to determine init_data type */
+          default:
+            if (VTABLE_isa(interp, init_data, CONST_STRING(interp, "String"))
+             || VTABLE_isa(interp, init_data, CONST_STRING(interp, "Key"))
+             || VTABLE_isa(interp, init_data, CONST_STRING(interp, "ResizableStringArray"))) {
                 /* set only the name property */
                 arg = pmc_new(interp, enum_class_Hash);
                 VTABLE_set_pmc_keyed_str(interp, arg, name_str, init_data);
-                break;
+            }
 
-            case enum_class_Hash:
+            if (VTABLE_isa(interp, init_data, CONST_STRING(interp, "Hash")))
                 arg = init_data;
-                break;
-
-            /* slow attempt to determine init_data type */
-            default:
-                if (VTABLE_isa(interp, init_data, CONST_STRING(interp, "String"))
-                || VTABLE_isa(interp, init_data, CONST_STRING(interp, "Key"))
-                || VTABLE_isa(interp, init_data, CONST_STRING(interp, "ResizableStringArray"))) {
-                    /* set only the name property */
-                    arg = pmc_new(interp, enum_class_Hash);
-                    VTABLE_set_pmc_keyed_str(interp, arg, name_str, init_data);
-                }
-
-                if (VTABLE_isa(interp, init_data, CONST_STRING(interp, "Hash")))
-                    arg = init_data;
-                else
-                    Parrot_ex_throw_from_c_args(INTERP, NULL,
+            else
+                Parrot_ex_throw_from_c_args(INTERP, NULL,
                         EXCEPTION_INVALID_OPERATION,
                             "Invalid class name key in init_pmc for Class");
-                break;
+            break;
         }
 
         /* Initialize the class with the supplied data. */
@@ -556,20 +575,6 @@
 
 /*
 
-=item C<void destroy()>
-
-Frees the memory associated with the class's underlying struct.
-
-=cut
-
-*/
-
-    VTABLE void destroy() {
-        mem_sys_free(PMC_data(SELF));
-    }
-
-/*
-
 =item C<STRING *get_string()>
 
 Returns the name of the class (without the HLL namespace).
@@ -594,32 +599,20 @@
 
     VTABLE void mark() {
         Parrot_Class_attributes * const _class = PARROT_CLASS(SELF);
-        if (_class->name)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)_class->name);
-        if (_class->fullname)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)_class->fullname);
-        if (_class->_namespace)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)_class->_namespace);
-        if (_class->parents)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)_class->parents);
-        if (_class->all_parents)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)_class->all_parents);
-        if (_class->roles)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)_class->roles);
-        if (_class->methods)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)_class->methods);
-        if (_class->vtable_overrides)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)_class->vtable_overrides);
-        if (_class->parent_overrides)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)_class->parent_overrides);
-        if (_class->attrib_metadata)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)_class->attrib_metadata);
-        if (_class->attrib_index)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)_class->attrib_index);
-        if (_class->attrib_cache)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)_class->attrib_cache);
-        if (_class->resolve_method)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)_class->resolve_method);
+        Parrot_gc_mark_STRING_alive(interp, _class->name);
+        Parrot_gc_mark_STRING_alive(interp, _class->fullname);
+        Parrot_gc_mark_PMC_alive(interp, _class->_namespace);
+        Parrot_gc_mark_PMC_alive(interp, _class->parents);
+        Parrot_gc_mark_PMC_alive(interp, _class->all_parents);
+        Parrot_gc_mark_PMC_alive(interp, _class->roles);
+        Parrot_gc_mark_PMC_alive(interp, _class->methods);
+        Parrot_gc_mark_PMC_alive(interp, _class->vtable_overrides);
+        Parrot_gc_mark_PMC_alive(interp, _class->parent_overrides);
+        Parrot_gc_mark_PMC_alive(interp, _class->attrib_metadata);
+        Parrot_gc_mark_PMC_alive(interp, _class->attrib_index);
+        Parrot_gc_mark_PMC_alive(interp, _class->attrib_cache);
+        Parrot_gc_mark_PMC_alive(interp, _class->resolve_method);
+        Parrot_gc_mark_PMC_alive(interp, _class->meth_cache);
     }
 
 
@@ -725,7 +718,7 @@
 
 /*
 
-=item C<void remove_method(STRING *name, PMC *sub)>
+=item C<void remove_method(STRING *name)>
 
 Removes the method with the given name.
 
@@ -789,24 +782,26 @@
 */
     VTABLE void add_parent(PMC *parent) {
         Parrot_Class_attributes * const _class = PARROT_CLASS(SELF);
-
-        /* get name of the parent being added */
-        STRING * const parent_name  = VTABLE_get_string(interp, parent);
-
-        /* get number of direct parents */
-        int parent_count      = VTABLE_elements(interp, _class->parents);
-
-        int index; /* loop iterator */
+        int parent_count, index;
 
         /* If we've been instantiated already, not allowed. */
         if (_class->instantiated)
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+            Parrot_ex_throw_from_c_args(interp, NULL,
+                EXCEPTION_INVALID_OPERATION,
                 "Modifications to classes are not allowed after instantiation.");
 
         /* Ensure it really is a class. */
         if (!PObj_is_class_TEST(parent))
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-                    "Parent isn't a Class.");
+            Parrot_ex_throw_from_c_args(interp, NULL,
+                EXCEPTION_INVALID_OPERATION, "Parent isn't a Class.");
+
+        /* Check is not self */
+        if (parent == SELF)
+            Parrot_ex_throw_from_c_args(interp, NULL,
+                    EXCEPTION_INVALID_OPERATION, "Can't be own parent");
+
+        /* get number of direct parents */
+        parent_count = VTABLE_elements(interp, _class->parents);
 
         /* iterate over all direct parents, check whether this class already has
          * the parent being added. */
@@ -815,29 +810,24 @@
             PMC * const current_parent = VTABLE_get_pmc_keyed_int(interp,
                                       _class->parents, index);
 
-            /* get the name of the current parent */
-            STRING * const current_name = VTABLE_get_string(interp, current_parent);
-
             /* throw an exception if we already have this parent */
             if (current_parent == parent)
                 Parrot_ex_throw_from_c_args(interp, NULL,
                     EXCEPTION_INVALID_OPERATION,
                     "The class '%S' already has a parent class '%S'. "
                     "It may have been supplied by a role.",
-                    VTABLE_get_string(interp, SELF), parent_name);
+                    VTABLE_get_string(interp, SELF),
+                    VTABLE_get_string(interp, parent));
         }
-        /* Check is not self */
-        if (parent == SELF)
-            Parrot_ex_throw_from_c_args(interp, NULL,
-                    EXCEPTION_INVALID_OPERATION, "Can't be own parent");
 
         /* Check that none of the parents is self */
-        parent_count = VTABLE_elements(interp,
-            PARROT_CLASS(parent)->all_parents);
+        parent_count = VTABLE_elements(interp, PARROT_CLASS(parent)->all_parents);
+
         for (index = 0; index < parent_count; index++) {
             /* get the next parent */
             PMC * const current_parent = VTABLE_get_pmc_keyed_int(interp,
                 PARROT_CLASS(parent)->all_parents, index);
+
             if (current_parent == SELF)
                 Parrot_ex_throw_from_c_args(interp, NULL,
                     EXCEPTION_INVALID_OPERATION,
@@ -848,11 +838,7 @@
 
         /* Add to the lists of our immediate parents and all parents. */
         VTABLE_push_pmc(interp, _class->parents, parent);
-        _class->all_parents = calculate_mro(interp, SELF, parent_count + 1);
-
-        /* Anonymous classes have no entry in the vtable array */
-        if (!CLASS_is_anon_TEST(SELF))
-            interp->vtables[VTABLE_type(interp, SELF)]->mro = _class->all_parents;
+        calculate_mro(interp, SELF, parent_count + 1);
     }
 
 /*
@@ -868,27 +854,23 @@
 */
     VTABLE void remove_parent(PMC *parent) {
         Parrot_Class_attributes * const _class = PARROT_CLASS(SELF);
-
-        /* get number of direct parents */
-        const int parent_count      = VTABLE_elements(interp, _class->parents);
-
-        int index; /* loop iterator */
+        int parent_count, index;
 
         /* If we've been instantiated already, not allowed. */
-        if (_class->instantiated) {
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+        if (_class->instantiated)
+            Parrot_ex_throw_from_c_args(interp, NULL,
+                EXCEPTION_INVALID_OPERATION,
                 "Modifications to classes are not allowed after instantiation.");
-        }
 
         /* Ensure it really is a class. */
-        if (!PObj_is_class_TEST(parent)) {
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-                "Parent isn't a Class.");
-        }
+        if (!PObj_is_class_TEST(parent))
+            Parrot_ex_throw_from_c_args(interp, NULL,
+                EXCEPTION_INVALID_OPERATION, "Parent isn't a Class.");
+
+        /* get number of direct parents */
+        parent_count = VTABLE_elements(interp, _class->parents);
 
-        /* iterate over all direct parents, looking for
-         * the parent to be removed.
-         */
+        /* iterate over all direct parents, looking for the parent to remove */
         for (index = 0; index < parent_count; index++) {
             /* get the next parent */
             PMC * const current_parent = VTABLE_get_pmc_keyed_int(interp,
@@ -896,24 +878,14 @@
             if (current_parent == parent)
                 break;
         }
+
         if (index >= parent_count)
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+            Parrot_ex_throw_from_c_args(interp, NULL,
+                EXCEPTION_INVALID_OPERATION,
                 "Can't remove_parent: is not a parent.");
 
-        /* Move up the remaining parents on the list and pops it */
-        for (; index < parent_count - 1; index++) {
-            PMC * const current_parent = VTABLE_get_pmc_keyed_int(interp,
-                _class->parents, index + 1);
-            VTABLE_set_pmc_keyed_int(interp, _class->parents,
-                index, current_parent);
-        }
-
-        VTABLE_pop_pmc(interp, _class->parents);
-        _class->all_parents = calculate_mro(interp, SELF, parent_count - 1);
-
-        /* Anonymous classes have no entry in the vtable array */
-        if (!CLASS_is_anon_TEST(SELF))
-            interp->vtables[VTABLE_type(interp, SELF)]->mro = _class->all_parents;
+        VTABLE_delete_keyed_int(interp, _class->parents, index);
+        calculate_mro(interp, SELF, parent_count - 1);
     }
 
 /*
@@ -981,7 +953,13 @@
         /* What should we return? */
         PMC *found;
 
-        if (Parrot_str_equal(interp, what, CONST_STRING(interp, "name"))) {
+        if (Parrot_str_equal(interp, what, CONST_STRING(interp, "attributes"))) {
+            found = _class->attrib_metadata;
+        }
+        else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "parents"))) {
+            found = _class->parents;
+        }
+        else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "name"))) {
             found = pmc_new(interp, enum_class_String);
             VTABLE_set_string_native(interp, found, _class->name);
         }
@@ -993,9 +971,6 @@
             /* Should not clone this. */
             return _class->_namespace;
         }
-        else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "attributes"))) {
-            found = _class->attrib_metadata;
-        }
         else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "attrib_index"))) {
             found = _class->attrib_index;
         }
@@ -1005,9 +980,6 @@
         else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "vtable_overrides"))) {
             found = _class->vtable_overrides;
         }
-        else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "parents"))) {
-            found = _class->parents;
-        }
         else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "all_parents"))) {
             found = _class->all_parents;
         }
@@ -1173,13 +1145,13 @@
             /* Check that we have all methods listed in resolve list. */
             const int resolve_count  = VTABLE_elements(interp,
                                                        _class->resolve_method);
-            const INTVAL cur_hll     = CONTEXT(interp)->current_HLL;
+            const INTVAL cur_hll     = Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp));
             const INTVAL num_parents = VTABLE_elements(interp, _class->parents);
             INTVAL       mro_length;
             int          i;
 
             /* don't use HLL mappings for internal-only data */
-            CONTEXT(interp)->current_HLL = 0;
+            Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp), 0);
 
             for (i = 0; i < resolve_count; i++) {
                 STRING * const check_meth =
@@ -1191,12 +1163,8 @@
             }
 
             /* Build full parents list.
-             * RT #46101 Need pluggable MRO, for now always do C3. */
-             _class->all_parents = calculate_mro(interp, SELF, num_parents);
-
-            if (!CLASS_is_anon_TEST(SELF))
-                interp->vtables[VTABLE_type(interp, SELF)]->mro = _class->all_parents;
-
+             * TT #1256:  Need pluggable MRO, for now always do C3. */
+            calculate_mro(interp, SELF, num_parents);
             build_attrib_index(interp, SELF);
 
             if (PMC_IS_NULL(_class->attrib_index))
@@ -1216,7 +1184,7 @@
                 }
             }
 
-            CONTEXT(interp)->current_HLL = cur_hll;
+            Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp), cur_hll);
         }
 
         /* Set instantiated flag. */
@@ -1226,38 +1194,41 @@
         object = pmc_new_noinit(interp, enum_class_Object);
 
         /* Set custom GC mark and destroy on the object. */
-        PObj_custom_mark_SET(object);
-        PObj_active_destroy_SET(object);
+        PObj_custom_mark_destroy_SETALL(object);
 
         /* Flag that it is an object */
         PObj_is_object_SET(object);
 
         /* Initialize the object's underlying structure, pointing it to this
          * class. */
-        PMC_data(object) =
-            (Parrot_Object_attributes *)Parrot_oo_new_object_attrs(interp, SELF);
+        /* TODO: this has been changed in order to use auto_attrs in the
+         * Object PMC. Needs to be redone in a cleaner way. */
+        {
+            Parrot_Object_attributes * const objattr =
+                PMC_data_typed(object, Parrot_Object_attributes *);
+            objattr->_class       = SELF;
+            objattr->attrib_store = pmc_new(interp, enum_class_ResizablePMCArray);
+        }
 
         if (!PMC_IS_NULL(init)) {
             /* Initialize attributes with the supplied values. */
             PMC * const iter = VTABLE_get_iter(interp, init);
 
             while (VTABLE_get_bool(interp, iter)) {
-                /* Get name and value. */
-                STRING * const attr_name  = VTABLE_shift_string(interp, iter);
-                PMC    * const attr_value = VTABLE_get_pmc_keyed_str(interp, init,
-                    attr_name);
+                STRING * const name  = VTABLE_shift_string(interp, iter);
+                PMC    * const value = VTABLE_get_pmc_keyed_str(interp, init,
+                                            name);
 
                 /* Set the attribute. */
-                VTABLE_set_attr_str(interp, object, attr_name, attr_value);
+                VTABLE_set_attr_str(interp, object, name, value);
             }
-        }
 
-        /* Check for overrides on the init or init_pmc vtable function and call
-         * them if they exist */
-        if (PMC_IS_NULL(init))
-            initialize_parents(interp, object, _class->all_parents);
-        else
+            /* Check for overrides on the init_pmc vtable function */
             initialize_parents_pmc(interp, object, _class->all_parents, init);
+        }
+        else
+            /* Check for overrides on the init vtable function */
+            initialize_parents(interp, object, _class->all_parents);
 
         return object;
     }
@@ -1274,14 +1245,14 @@
 */
 
     VTABLE INTVAL isa_pmc(PMC *lookup) {
-        Parrot_Class_attributes * const _class    = PARROT_CLASS(SELF);
+        Parrot_Class_attributes * const _class = PARROT_CLASS(SELF);
         PMC          *classobj;
         INTVAL        i, num_classes;
 
         if (PMC_IS_NULL(lookup))
             return 0;
 
-        if (SUPER(lookup))
+        if (PObj_is_class_TEST(lookup) && lookup == SELF)
             return 1;
 
         classobj = Parrot_oo_get_class(interp, lookup);
@@ -1292,19 +1263,20 @@
         /* Check if the class object is the same as self's class object */
         if (VTABLE_is_same(interp, SELF, classobj))
             return 1;
-        else {
-            STRING * const classname = VTABLE_get_string(interp, classobj);
-            const INTVAL is_proxy    = (SELF->vtable->base_type == enum_class_PMCProxy);
 
-            /* avoid the expensive string copy, if possible */
-            STRING * const self_name = is_proxy
-                               ? VTABLE_get_string(interp, SELF)
-                               : make_class_name(interp, SELF);
+        /* this is effectively what the default PMC's isa_pmc does
+         * ... but this can cheat and avoid COW STRINGs for the classobj
+         * only in these two, very specific and common cases */
+        if (classobj->vtable->base_type == enum_class_Class
+        ||  classobj->vtable->base_type == enum_class_PMCProxy) {
+            STRING *classname = make_class_name(interp, classobj);
 
-            /* Check if the passed name is the same as the stored short name. */
-            const INTVAL name_match = Parrot_str_equal(interp, classname, self_name);
+            if (Parrot_str_equal(interp, SELF->vtable->whoami, classname))
+                return 1;
 
-            if (name_match)
+            if (SELF->vtable->isa_hash
+            &&  parrot_hash_exists(interp, SELF->vtable->isa_hash,
+                                    (void *)classname))
                 return 1;
         }
 
@@ -1460,38 +1432,23 @@
 */
 
     VTABLE void visit(visit_info *info) {
-        Parrot_Class_attributes * const class_data = PARROT_CLASS(SELF);
-        PMC **pos;
-
         /* 1) visit the attribute description hash */
-        pos            = &class_data->attrib_metadata;
-        info->thaw_ptr = pos;
-        (info->visit_pmc_now)(INTERP, *pos, info);
+        VISIT_PMC_ATTR(INTERP, info, SELF, Class, attrib_metadata);
 
         /* 2) visit list of parents */
-        pos            = &class_data->parents;
-        info->thaw_ptr = pos;
-        (info->visit_pmc_now)(INTERP, *pos, info);
+        VISIT_PMC_ATTR(INTERP, info, SELF, Class, parents);
 
         /* 3) visit list of roles */
-        pos            = &class_data->roles;
-        info->thaw_ptr = pos;
-        (info->visit_pmc_now)(INTERP, *pos, info);
+        VISIT_PMC_ATTR(INTERP, info, SELF, Class, roles);
 
         /* 4) visit hash of methods */
-        pos            = &class_data->methods;
-        info->thaw_ptr = pos;
-        (info->visit_pmc_now)(INTERP, *pos, info);
+        VISIT_PMC_ATTR(INTERP, info, SELF, Class, methods);
 
         /* 5) visit hash of vtable overrides */
-        pos            = &class_data->vtable_overrides;
-        info->thaw_ptr = pos;
-        (info->visit_pmc_now)(INTERP, *pos, info);
+        VISIT_PMC_ATTR(INTERP, info, SELF, Class, vtable_overrides);
 
         /* 6) visit list of resolve methods */
-        pos            = &class_data->resolve_method;
-        info->thaw_ptr = pos;
-        (info->visit_pmc_now)(INTERP, *pos, info);
+        VISIT_PMC_ATTR(INTERP, info, SELF, Class, resolve_method);
     }
 
 /*
@@ -1505,15 +1462,14 @@
 */
 
     VTABLE void freeze(visit_info *info) {
-        IMAGE_IO     * const io         = info->image_io;
         Parrot_Class_attributes * const class_data = PARROT_CLASS(SELF);
         STRING       *serial_namespace = CONST_STRING(interp, "");
 
         /* 1) freeze class id */
-        VTABLE_push_integer(INTERP, io, class_data->id);
+        VTABLE_push_integer(INTERP, info, class_data->id);
 
         /* 2) freeze class name */
-        VTABLE_push_string(INTERP, io, class_data->name);
+        VTABLE_push_string(INTERP, info, class_data->name);
 
         /* 3) serialize namespace name, including HLL */
         if (!PMC_IS_NULL(class_data->_namespace)) {
@@ -1522,7 +1478,7 @@
             if (!PMC_IS_NULL(names))
                 serial_namespace = Parrot_str_join(interp, CONST_STRING(interp, ";"), names);
         }
-        VTABLE_push_string(INTERP, io, serial_namespace);
+        VTABLE_push_string(INTERP, info, serial_namespace);
     }
 
 /*
@@ -1540,46 +1496,39 @@
          * anonymous class and later decide whether to link it into the
          * namespace.  */
 
-        if (info->extra_flags == EXTRA_IS_PROP_HASH) {
-            SUPER(info);
-        }
-        else if (info->extra_flags == EXTRA_IS_NULL) {
-            IMAGE_IO * const io = info->image_io;
+        /* 1) thaw class id */
+        const INTVAL id = VTABLE_shift_integer(INTERP, info);
 
-            /* 1) thaw class id */
-            const INTVAL id = VTABLE_shift_integer(INTERP, io);
+        /* 2) thaw class name */
+        STRING * const name = VTABLE_shift_string(INTERP, info);
 
-            /* 2) thaw class name */
-            STRING * const name = VTABLE_shift_string(INTERP, io);
-
-            /* 3) deserialize namespace name, including HLL */
-            STRING * const serial_namespace = VTABLE_shift_string(INTERP, io);
-            STRING * const semicolon_str = CONST_STRING(INTERP, ";");
-            PMC    * const namespace_array =
-                Parrot_str_split(INTERP, semicolon_str, serial_namespace);
-            PMC *ns = Parrot_get_namespace_keyed(interp,
+        /* 3) deserialize namespace name, including HLL */
+        STRING * const serial_namespace = VTABLE_shift_string(INTERP, info);
+        STRING * const semicolon_str = CONST_STRING(INTERP, ";");
+        PMC    * const namespace_array =
+            Parrot_str_split(INTERP, semicolon_str, serial_namespace);
+        PMC *ns = Parrot_get_namespace_keyed(interp,
+                INTERP->root_namespace, namespace_array);
+
+        /* If the namespace doesn't exist, we create it, and initialize
+         * ourselves in it */
+        if (PMC_IS_NULL(ns)) {
+            ns = Parrot_make_namespace_keyed(interp,
                     INTERP->root_namespace, namespace_array);
+            SELF.init_pmc(ns);
+        }
+        /* If the namespace exists already, we point to it, but otherwise
+         * act as an anonymous class. */
+        else {
+            SELF.init();
+            PARROT_CLASS(SELF)->_namespace = ns;
+        }
 
-            /* If the namespace doesn't exist, we create it, and initialize
-             * ourselves in it */
-            if (PMC_IS_NULL(ns)) {
-                ns = Parrot_make_namespace_keyed(interp,
-                        INTERP->root_namespace, namespace_array);
-                SELF.init_pmc(ns);
-            }
-            /* If the namespace exists already, we point to it, but otherwise
-             * act as an anonymous class. */
-            else {
-                SELF.init();
-                PARROT_CLASS(SELF)->_namespace = ns;
-            }
-
-            /* Set the class's short name to the frozen name */
-            PARROT_CLASS(SELF)->name = name;
+        /* Set the class's short name to the frozen name */
+        PARROT_CLASS(SELF)->name = name;
 
-            /* Set the class's id the frozen id */
-            PARROT_CLASS(SELF)->id = id;
-        }
+        /* Set the class's id the frozen id */
+        PARROT_CLASS(SELF)->id = id;
     }
 
 /*
@@ -1770,8 +1719,7 @@
 =cut
 
 */
-    METHOD add_method(STRING *name, PMC *sub)
-    {
+    METHOD add_method(STRING *name, PMC *sub) {
         SELF.add_method(name, sub);
     }
 
@@ -1798,8 +1746,7 @@
 =cut
 
 */
-    METHOD remove_method(STRING *name)
-    {
+    METHOD remove_method(STRING *name) {
         VTABLE_remove_method(interp, SELF, name);
     }
 

Modified: branches/orderedhash_revamp/src/pmc/codestring.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/codestring.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/codestring.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -34,16 +34,45 @@
 #  include <unicode/uchar.h>
 #endif
 
-pmclass CodeString extends String provides string {
-    ATTR INTVAL last_line_number; /* most recent line number seen   */
-    ATTR INTVAL last_pos;         /* most recent byte position seen */
+pmclass CodeString extends String provides string auto_attrs {
+    ATTR PMC *linepos;            /* start of line positions */
+
+/*
+
+=item C<init()>
+
+Initialize the CodeString.
+
+=cut
+
+*/
 
     VTABLE void init() {
-        Parrot_CodeString_attributes *attrs =
-            mem_allocate_zeroed_typed(Parrot_CodeString_attributes);
-        attrs->str_val = Parrot_str_new_noinit(INTERP, enum_stringrep_one, 0);
-        PMC_data(SELF) = attrs;
-        PObj_custom_mark_destroy_SETALL(SELF);
+        SUPER();
+        SET_ATTR_linepos(INTERP, SELF, PMCNULL);
+        PObj_custom_mark_SET(SELF);
+    }
+
+/*
+
+=item C<mark()>
+
+Mark the CodeString as live.
+
+=cut
+
+*/
+
+    VTABLE void mark() {
+        PMC *linepos;
+
+        SUPER();
+        if (!PMC_data(SELF))
+            return;
+
+        GET_ATTR_linepos(INTERP, SELF, linepos);
+
+        Parrot_gc_mark_PMC_alive(INTERP, linepos);
     }
 
 /*
@@ -72,10 +101,10 @@
 */
 
   METHOD emit(STRING *fmt, PMC *args :slurpy, PMC *hash :slurpy :named) {
-    STRING *percent     = CONST_STRING(INTERP, "%");
-    STRING *comma       = CONST_STRING(INTERP, ",");
-    STRING *comma_space = CONST_STRING(INTERP, ", ");
-    STRING *newline     = CONST_STRING(INTERP, "\n");
+    STRING * const percent     = CONST_STRING(INTERP, "%");
+    STRING * const comma       = CONST_STRING(INTERP, ",");
+    STRING * const comma_space = CONST_STRING(INTERP, ", ");
+    STRING * const newline     = CONST_STRING(INTERP, "\n");
     STRING *key, *repl, *S0, *S1;
     INTVAL pos          = 0;
     INTVAL replen       = 0;
@@ -125,7 +154,7 @@
     }
 
     /* Add a newline if necessary */
-    if ('\n' != Parrot_str_indexed(INTERP, fmt, Parrot_str_byte_length(interp, fmt) - 1))
+    if ('\n' != Parrot_str_indexed(INTERP, fmt, Parrot_str_byte_length(INTERP, fmt) - 1))
         fmt = Parrot_str_concat(INTERP, fmt, newline, 0);
 
     GET_ATTR_str_val(INTERP, SELF, S1);
@@ -133,7 +162,7 @@
     VTABLE_set_string_native(INTERP, SELF, S1);
 
     RETURN(PMC *SELF);
-}
+  }
 
 
 /*
@@ -148,54 +177,55 @@
 */
 
   METHOD lineof(INTVAL pos) {
-    STRING *str             = NULL;
-    INTVAL  line            = 0;
-    INTVAL  ipos            = 0;
-    INTVAL  seen_first_line = 0;
-    INTVAL  jpos;
-    INTVAL  last_pos;
-
-    GET_ATTR_last_pos(INTERP, SELF, last_pos);
-
-    /* the previous line number for this position is the same */
-    if (last_pos == pos) {
-        GET_ATTR_last_line_number(INTERP, SELF, line);
-        RETURN(INTVAL line);
-    }
-
-    /* start from the previous max line number and position */
-    if (last_pos < pos) {
-        GET_ATTR_last_line_number(INTERP, SELF, line);
-        ipos = last_pos;
-    }
-
-    GET_ATTR_str_val(INTERP, SELF, str);
-    jpos = Parrot_str_find_cclass(INTERP, enum_cclass_newline, str, ipos, pos);
-
-    while (jpos < pos) {
-
-        if (ipos
-        &&  jpos == ipos
-        &&  string_ord(INTERP, str, jpos)     == 10
-        &&  string_ord(INTERP, str, ipos - 1) == 13) {
-            /* do not increment line; \r\n is a single line separator */
+    PMC    *linepos;
+    INTVAL  count;
+    INTVAL  line = 0;
+
+    GET_ATTR_linepos(INTERP, SELF, linepos);
+
+    /* build the linepos array if we haven't already done so */
+    if (!linepos || PMC_IS_NULL(linepos)) {
+        STRING *str             = NULL;
+        INTVAL  eos;
+        INTVAL  jpos;
+
+        linepos = pmc_new(INTERP, enum_class_ResizableIntegerArray);
+        /* get the string itself */
+        GET_ATTR_str_val(INTERP, SELF, str);
+        eos  = Parrot_str_byte_length(INTERP, str);
+        /* find the first newline, if any */
+        jpos = Parrot_str_find_cclass(INTERP, enum_cclass_newline,
+                                      str, 0, eos);
+        while (jpos < eos) {
+            jpos++;
+            /* add the start of line position */
+            VTABLE_push_integer(INTERP, linepos, jpos);
+
+            /* treat \r\n as a single newline */
+            if (jpos < eos
+            && string_ord(INTERP, str, jpos - 1)     == 13
+            && string_ord(INTERP, str, jpos)         == 10) {
+                jpos++;
+            }
+            /* search for the next newline */
+            jpos = Parrot_str_find_cclass(INTERP, enum_cclass_newline,
+                                          str, jpos, eos);
         }
-        else
-            line++;
-
-        ipos = jpos + 1;
-
-        jpos = Parrot_str_find_cclass(INTERP, enum_cclass_newline, str, ipos, pos);
+        /* save the array of line positions */
+        SET_ATTR_linepos(INTERP, SELF, linepos);
     }
 
-    /* cache this position and line number for next time */
-    if (pos > last_pos) {
-        SET_ATTR_last_pos(INTERP, SELF, jpos);
-        SET_ATTR_last_line_number(INTERP, SELF, line);
-    }
+    /* Find the line from the array, stop at the first index that is
+     * greater than the position we're looking for.  We do a linear
+     * search for now, * perhaps a binary search would be better someday.
+     */
+    count = VTABLE_elements(INTERP, linepos);
+    while (line < count
+          && VTABLE_get_integer_keyed_int(INTERP, linepos, line) <= pos)
+        line++;
 
     RETURN(INTVAL line);
-}
+  }
 
 
 /*
@@ -242,9 +272,9 @@
 */
 
   METHOD escape(STRING *str) {
-    STRING *escaped_str = Parrot_str_escape(INTERP, str);
-    STRING *quote       = CONST_STRING(INTERP, "\x22");
-    STRING *x           = CONST_STRING(INTERP, "\\x");
+    STRING *escaped_str  = Parrot_str_escape(INTERP, str);
+    STRING * const quote = CONST_STRING(INTERP, "\x22");
+    STRING * const x     = CONST_STRING(INTERP, "\\x");
     INTVAL x_pos;
     INTVAL is_unicode = 0;
     UNUSED(SELF);
@@ -256,17 +286,16 @@
     if (x_pos != -1) {
         is_unicode = 1;
     }
-    else
-    {
-        STRING *u = CONST_STRING(INTERP, "\\u");
+    else {
+        STRING * const u = CONST_STRING(INTERP, "\\u");
         INTVAL u_pos = Parrot_str_find_index(INTERP, escaped_str, u, 0);
         if (u_pos != -1)
             is_unicode = 1;
     }
 
     if (is_unicode) {
-        STRING *unicode = CONST_STRING(INTERP, "unicode:");
-        escaped_str     = Parrot_str_concat(INTERP, unicode, escaped_str, 1);
+        STRING * const unicode = CONST_STRING(INTERP, "unicode:");
+        escaped_str            = Parrot_str_concat(INTERP, unicode, escaped_str, 1);
     }
 
     RETURN(STRING *escaped_str);
@@ -286,17 +315,16 @@
 
   METHOD charname_to_ord(STRING *name) {
 #if PARROT_HAS_ICU
-    UChar32    codepoint;
-    UErrorCode err       = U_ZERO_ERROR;
-    char       *cstr     = Parrot_str_to_cstring(INTERP, name);
-    codepoint = u_charFromName(U_EXTENDED_CHAR_NAME, cstr, &err);
+    UErrorCode   err       = U_ZERO_ERROR;
+    char * const cstr      = Parrot_str_to_cstring(INTERP, name);
+    UChar32      codepoint = u_charFromName(U_EXTENDED_CHAR_NAME, cstr, &err);
     Parrot_str_free_cstring(cstr);
     if (U_SUCCESS(err)) {
         RETURN(INTVAL codepoint);
     }
     RETURN(INTVAL -1);
 #else
-    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+    Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_LIBRARY_ERROR,
         "no ICU lib loaded");
 #endif
   }
@@ -313,20 +341,19 @@
 */
 
   METHOD key(PMC *args :slurpy) {
-    STRING *open_bracket  = CONST_STRING(INTERP, "[");
-    STRING *semi          = CONST_STRING(INTERP, ";");
-    STRING *close_bracket = CONST_STRING(INTERP, "]");
-    STRING *s_array       = CONST_STRING(INTERP, "array");
-    STRING *prefix        = NULL;
-    STRING *out           = open_bracket;
-    INTVAL elements, index;
-
-    elements     = VTABLE_elements(INTERP, args);
+    INTVAL         index;
+    INTVAL         elements      = VTABLE_elements(INTERP, args);
+    STRING * const open_bracket  = CONST_STRING(INTERP, "[");
+    STRING * const semi          = CONST_STRING(INTERP, ";");
+    STRING * const close_bracket = CONST_STRING(INTERP, "]");
+    STRING * const s_array       = CONST_STRING(INTERP, "array");
+    STRING *       prefix        = NULL;
+    STRING *       out           = open_bracket;
 
     for (index = 0; index < elements; index++) {
         PMC *P0      = VTABLE_get_pmc_keyed_int(INTERP, args, index);
         if (PMC_IS_NULL(P0)) continue;
-        else if (VTABLE_does(interp, P0, s_array)) {
+        else if (VTABLE_does(INTERP, P0, s_array)) {
             INTVAL elements2, index2;
             elements2 = VTABLE_elements(INTERP, P0);
             for (index2 = 0; index2 < elements2; index2++) {

Modified: branches/orderedhash_revamp/src/pmc/complex.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/complex.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/complex.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -217,70 +217,13 @@
 }
 
 
-pmclass Complex need_ext {
+pmclass Complex auto_attrs {
 
     ATTR FLOATVAL re; /* real part */
     ATTR FLOATVAL im; /* imaginary part */
 
 /*
 
-=item C<PMC *instantiate(PMC *sig)>
-
-Create a new complex PMC with passed arguments according to pdd03.
-
-=cut
-
-*/
-
-    VTABLE PMC *instantiate(PMC *sig) {
-        return PMCNULL;
-
-        /* TODO -- really build this thing */
-#if 0
-        PMC *res = pmc_new(INTERP, enum_class_Complex);
-        FLOATVAL re    = 0.0;
-        FLOATVAL im    = 0.0;
-        int      argcI = REG_INT(interp, 1);
-        int      argcS = REG_INT(interp, 2);
-        int      argcP = REG_INT(interp, 3);
-        int      argcN = REG_INT(interp, 4);
-
-        /*
-         * we can only allow 0..2 arguments of one kind. For
-         * mixed (e.g. N, P) args the order of arguments isn't fixed
-         */
-        if (argcP) {
-            re = VTABLE_get_number(INTERP, REG_PMC(interp, 5));
-
-            if (argcP == 2)
-                im = VTABLE_get_number(INTERP, REG_PMC(interp, 6));
-            /* TODO throw exception if argument mismatch */
-        }
-        else if (argcN) {
-            re = REG_NUM(interp, 5);
-
-            if (argcN == 2)
-                im = REG_NUM(interp, 6);
-        }
-        else if (argcI) {
-            re = REG_INT(interp, 5);
-
-            if (argcI == 2)
-                im = REG_INT(interp, 6);
-        }
-        else if (argcS == 1) {
-            complex_parse_string(INTERP, &RE(res), &IM(res), REG_STR(interp, 5));
-            return res;
-        }
-
-        RE(res) = re;
-        IM(res) = im;
-        return res;
-#endif
-    }
-
-/*
-
 =item C<opcode_t *invoke(void *next)>
 
 Pythonic object constructor. SELF is a Complex Class object. Return a new
@@ -327,10 +270,6 @@
 Initializes the complex number with the specified initializer.
 The initializer can be a string PMC or a numeric array with (real, imag)
 
-=item C<void destroy()>
-
-Cleans up.
-
 =item C<PMC *clone()>
 
 Creates an identical copy of the complex number.
@@ -340,51 +279,42 @@
 */
 
     VTABLE void init() {
-        /* XXX should check if mem_sys_allocate failed */
-        PMC_data(SELF) = mem_allocate_typed(Parrot_Complex_attributes);
         SET_ATTR_re(INTERP, SELF, 0.0);
         SET_ATTR_im(INTERP, SELF, 0.0);
-
-        PObj_active_destroy_SET(SELF);
     }
 
     VTABLE void init_pmc(PMC *initializer) {
         const INTVAL arg_type = VTABLE_type(interp, initializer);
         SELF.init();
         switch (arg_type) {
-            case enum_class_String:
-                SELF.set_string_native(VTABLE_get_string(interp, initializer));
+          case enum_class_String:
+            SELF.set_string_native(VTABLE_get_string(interp, initializer));
+            break;
+          case enum_class_FixedFloatArray:
+          case enum_class_ResizableFloatArray:
+          case enum_class_FixedIntegerArray:
+          case enum_class_ResizableIntegerArray:
+            if (VTABLE_get_integer(interp, initializer) == 2) {
+                FLOATVAL re = VTABLE_get_number_keyed_int(interp, initializer, 0);
+                FLOATVAL im = VTABLE_get_number_keyed_int(interp, initializer, 1);
+                SET_ATTR_re(INTERP, SELF, re);
+                SET_ATTR_im(INTERP, SELF, im);
                 break;
-            case enum_class_FixedFloatArray:
-            case enum_class_ResizableFloatArray:
-            case enum_class_FixedIntegerArray:
-            case enum_class_ResizableIntegerArray:
-                if (VTABLE_get_integer(interp, initializer) == 2) {
-                    FLOATVAL re = VTABLE_get_number_keyed_int(interp, initializer, 0);
-                    FLOATVAL im = VTABLE_get_number_keyed_int(interp, initializer, 1);
-                    SET_ATTR_re(INTERP, SELF, re);
-                    SET_ATTR_im(INTERP, SELF, im);
-                    break;
-                }
-                /* else let it fall to default */
-            default:
-                if (VTABLE_isa(interp, initializer, CONST_STRING(interp, "String"))) {
-                    STRING * s = VTABLE_get_string(interp, initializer);
-                    SELF.set_string_native(s);
-                }
-                else {
-                    Parrot_ex_throw_from_c_args(interp, NULL,
+            }
+            /* else let it fall to default */
+          default:
+            if (VTABLE_isa(interp, initializer, CONST_STRING(interp, "String"))) {
+                STRING * s = VTABLE_get_string(interp, initializer);
+                SELF.set_string_native(s);
+            }
+            else {
+                Parrot_ex_throw_from_c_args(interp, NULL,
                         EXCEPTION_INVALID_OPERATION,
                         "Invalid Complex initializer");
-                }
+            }
         }
     }
 
-    VTABLE void destroy() {
-        mem_sys_free(PMC_data(SELF));
-        PMC_data(SELF) = NULL;
-    }
-
     VTABLE PMC *clone() {
         PMC * const dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
         FLOATVAL re, im;
@@ -549,14 +479,14 @@
     VTABLE FLOATVAL get_number_keyed_int(INTVAL key) {
         FLOATVAL f;
         switch (key) {
-            case 0:
-                GET_ATTR_re(INTERP, SELF, f);
-                break;
-            case 1:
-                GET_ATTR_im(INTERP, SELF, f);
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL,
+          case 0:
+            GET_ATTR_re(INTERP, SELF, f);
+            break;
+          case 1:
+            GET_ATTR_im(INTERP, SELF, f);
+            break;
+          default:
+            Parrot_ex_throw_from_c_args(interp, NULL,
                     EXCEPTION_INVALID_OPERATION, "Complex: key must be 0 or 1");
         }
         return f;
@@ -564,14 +494,14 @@
 
     VTABLE void set_number_keyed_int(INTVAL key, FLOATVAL v) {
         switch (key) {
-            case 0:
-                SET_ATTR_re(INTERP, SELF, v);
-                break;
-            case 1:
-                SET_ATTR_im(INTERP, SELF, v);
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL,
+          case 0:
+            SET_ATTR_re(INTERP, SELF, v);
+            break;
+          case 1:
+            SET_ATTR_im(INTERP, SELF, v);
+            break;
+          default:
+            Parrot_ex_throw_from_c_args(interp, NULL,
                     EXCEPTION_INVALID_OPERATION, "Complex: key must be 0 or 1");
         }
     }
@@ -1869,13 +1799,13 @@
         dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
 
-        Parrot_PCCINVOKE(interp, SELF, CONST_STRING(interp, "ln"),
+        Parrot_pcc_invoke_method_from_c_args(interp, SELF, CONST_STRING(interp, "ln"),
                     "->P", &log);
 
         l = Parrot_Complex_multi_multiply_Complex_PMC(INTERP,
                     log, value, l);
 
-        Parrot_PCCINVOKE(interp, l, CONST_STRING(interp, "exp"),
+        Parrot_pcc_invoke_method_from_c_args(interp, l, CONST_STRING(interp, "exp"),
                     "->P", &dest);
 
         return dest;
@@ -1887,10 +1817,10 @@
 
         dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
-        Parrot_PCCINVOKE(interp, SELF, CONST_STRING(interp, "ln"),
+        Parrot_pcc_invoke_method_from_c_args(interp, SELF, CONST_STRING(interp, "ln"),
                      "->P", &log);
         l = Parrot_Complex_multi_multiply_DEFAULT_PMC(INTERP, log, value, l);
-        Parrot_PCCINVOKE(interp, l, CONST_STRING(interp, "exp"),
+        Parrot_pcc_invoke_method_from_c_args(interp, l, CONST_STRING(interp, "exp"),
                      "->P", &dest);
 
         return dest;

Modified: branches/orderedhash_revamp/src/pmc/continuation.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/continuation.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/continuation.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -22,7 +22,7 @@
 
 
 #include "parrot/oplib/ops.h"
-#include "pmc_sub.h"
+#include "pmc/pmc_sub.h"
 
 /*
 
@@ -41,13 +41,18 @@
  * A Continuation (and RetContinuation, ExceptionHandler) has in its
  * context a pointer to the register frame, which contains active objects.
  * Additionally ct->current_cont has the continuation of the caller.
- * To avoid deep recursion during marking of nested subroutines, we
- * need the next_for_GC pointer in the pmc_ext area.
  */
 
-pmclass Continuation need_ext {
-    ATTR struct Parrot_cont *cont; /* the continuation struct */
-
+pmclass Continuation auto_attrs {
+    /* continuation destination */
+    ATTR PackFile_ByteCode *seg;             /* bytecode segment */
+    ATTR opcode_t          *address;         /* start of bytecode, addr to continue */
+    ATTR PMC               *to_ctx;          /* pointer to dest context */
+    ATTR PMC               *to_call_object;  /* pointer to CallSignature */
+    /* a Continuation keeps the from_ctx alive */
+    ATTR PMC               *from_ctx;        /* sub, this cont is returning from */
+    ATTR int                runloop_id;      /* id of the creating runloop. */
+    ATTR int                invoked;         /* flag when a handler has been invoked. */
 /*
 
 =item C<void init()>
@@ -59,12 +64,17 @@
 */
 
     VTABLE void init() {
-        Parrot_Continuation_attributes *attrs =
-            mem_allocate_zeroed_typed(Parrot_Continuation_attributes);
-        PMC_data(SELF) = attrs;
+        Parrot_Continuation_attributes * const attrs = PARROT_CONTINUATION(SELF);
+
+        attrs->to_ctx           = CURRENT_CONTEXT(interp);
+        attrs->to_call_object   = Parrot_pcc_get_signature(INTERP, attrs->to_ctx);
+        attrs->from_ctx         = CURRENT_CONTEXT(interp);
+        attrs->runloop_id       = 0;
+        attrs->seg              = interp->code;
+        attrs->address          = NULL;
+
+        PObj_custom_mark_SET(SELF);
 
-        PMC_cont(SELF) = new_continuation(INTERP, NULL);
-        PObj_custom_mark_destroy_SETALL(SELF);
         /* PANIC("don't do that"); */
         /*
          * Whenever we create a continuation, all return continuations
@@ -75,54 +85,54 @@
         invalidate_retc_context(INTERP, SELF);
     }
 
-/*
+    /*if they pass in a PMC to initialize with*/
+    VTABLE void init_pmc(PMC *values) {
+        Parrot_Continuation_attributes * const attrs  = PARROT_CONTINUATION(SELF);
+        Parrot_Continuation_attributes * const theirs = PARROT_CONTINUATION(values);
+
+        attrs->to_ctx           = theirs->to_ctx;
+        attrs->to_call_object   = Parrot_pcc_get_signature(INTERP, attrs->to_ctx);
+        attrs->from_ctx         = CURRENT_CONTEXT(interp);
+        attrs->runloop_id       = 0;
+        attrs->seg              = theirs->seg;
+        attrs->address          = theirs->address;
 
-=item C<void mark()>
-
-Marks the continuation as live.
-
-=cut
+        PObj_custom_mark_SET(SELF);
 
-*/
+        /* PANIC("don't do that"); */
+        /*
+         * Whenever we create a continuation, all return continuations
+         * up the call chain may be reused due to invoking the
+         * continuation. To avoid that all return continuations are
+         * converted to true continuations.
+         */
+        invalidate_retc_context(INTERP, SELF);
+    }
 
-    VTABLE void mark() {
-        Parrot_cont *cc = PMC_cont(SELF);
 
-        if (cc->to_ctx)
-            mark_context(INTERP, cc->to_ctx);
-        if (cc->from_ctx)
-            mark_context(INTERP, cc->from_ctx);
-    }
 
 /*
 
-=item C<void destroy()>
+=item C<void mark()>
 
-Destroys the continuation.
+Marks the continuation as live.
 
 =cut
 
 */
 
-    VTABLE void destroy() {
-        Parrot_cont * const cc = PMC_cont(SELF);
-        if (cc) {
-#if CTX_LEAK_DEBUG
-            if (Interp_debug_TEST(interp, PARROT_CTX_DESTROY_DEBUG_FLAG)) {
-                fprintf(stderr,
-                        "[destroy cont    %p, to_ctx %p, from_ctx %p]\n",
-                        (void *)SELF, (void *)cc->to_ctx, (void *)cc->from_ctx);
-            }
-
-#endif
-            if (cc->from_ctx)
-                Parrot_free_context(interp, cc->from_ctx, 1);
+    VTABLE void mark() {
+        Parrot_Continuation_attributes * const cc = PARROT_CONTINUATION(SELF);
 
-            mem_sys_free(cc);
-        }
-        mem_sys_free(PMC_data(SELF));
-        PMC_data(SELF) = NULL;
+        /* If Continuation wasn't fully constructed yet */
+        if (!cc)
+            return;
+
+        Parrot_gc_mark_PMC_alive(INTERP, cc->to_ctx);
+        Parrot_gc_mark_PMC_alive(INTERP, cc->to_call_object);
+        Parrot_gc_mark_PMC_alive(INTERP, cc->from_ctx);
     }
+
 /*
 
 =item C<PMC *clone()>
@@ -134,20 +144,9 @@
 */
 
     VTABLE PMC *clone() {
-        Parrot_cont * const cc_self  = PMC_cont(SELF);
-        Parrot_cont * const cc       = new_continuation(INTERP, cc_self);
-        PMC         * const ret      = pmc_new(INTERP, enum_class_Continuation);
-        Parrot_cont * const ret_cont = PMC_cont(ret);
-
-        PObj_custom_mark_destroy_SETALL(ret);
-
-        /* free ret's PMC_cont */
-        Parrot_free_context(interp, ret_cont->from_ctx, 1);
-        mem_sys_free(ret_cont);
-
-        cc->runloop_id = cc_self->runloop_id;
-        PMC_cont(ret)  = cc;
-
+        /* Start to prepare for subclassable continuations */
+        INTVAL type = SELF->vtable->base_type;
+        PMC * ret = pmc_new_init(interp, type, SELF);
         return ret;
     }
 
@@ -161,8 +160,8 @@
 
 */
     VTABLE void set_pmc(PMC *src) {
-        Parrot_cont * const cc_self = PMC_cont(SELF);
-        Parrot_cont * const cc_src  = PMC_cont(src);
+        Parrot_Continuation_attributes * const cc_self = PARROT_CONTINUATION(SELF);
+        Parrot_Continuation_attributes * const cc_src  = PARROT_CONTINUATION(src);
 
         STRUCT_COPY(cc_self, cc_src);
     }
@@ -178,16 +177,11 @@
 */
 
     VTABLE void set_pointer(void *value) {
-        opcode_t    * const pos = (opcode_t *)value;
-        Parrot_cont * const cc  = PMC_cont(SELF);
+        opcode_t                       * const pos = (opcode_t *)value;
+        Parrot_Continuation_attributes * const cc  = PARROT_CONTINUATION(SELF);
 
-        cc->address       = (opcode_t *)value;
-        cc->runloop_id    = INTERP->current_runloop_id;
-
-        if (pos && (*pos == PARROT_OP_get_results_pc))
-            cc->current_results = pos;
-        else
-            cc->current_results = NULL;
+        cc->address    = pos;
+        cc->runloop_id = INTERP->current_runloop_id;
     }
 
 /*
@@ -201,8 +195,9 @@
 */
 
     VTABLE void *get_pointer() {
-        return PMC_cont(SELF)->address;
+        return PARROT_CONTINUATION(SELF)->address;
     }
+
 /*
 
 =item C<INTVAL defined()>
@@ -216,11 +211,11 @@
 */
 
     VTABLE INTVAL defined() {
-        return PMC_cont(SELF)->address != NULL;
+        return PARROT_CONTINUATION(SELF)->address != NULL;
     }
 
     VTABLE INTVAL get_bool() {
-        return PMC_cont(SELF)->address != NULL;
+        return PARROT_CONTINUATION(SELF)->address != NULL;
     }
 
 /*
@@ -235,40 +230,34 @@
 */
 
     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_Continuation_attributes * const cc = PARROT_CONTINUATION(SELF);
+        PMC      *from_ctx = CURRENT_CONTEXT(interp);
+        PMC      *to_ctx   = cc->to_ctx;
+        opcode_t *pc       = cc->address;
+        PMC      *call_obj = cc->to_call_object;
+        PMC      *from_obj = Parrot_pcc_get_signature(interp, from_ctx);
         UNUSED(next)
 
-        Parrot_continuation_check(interp, SELF, cc);
-        Parrot_continuation_rewind_environment(interp, SELF, cc);
+        Parrot_continuation_check(interp, SELF);
+        Parrot_continuation_rewind_environment(interp, SELF);
 
-        /* pass args to where caller wants result */
-        if (cc->current_results)
-            to_ctx->current_results = cc->current_results;
-
-        if (to_ctx->current_results && INTERP->current_args) {
-            /*
-             * the register pointer is already switched back
-             * to the caller, therefore the registers of the
-             * sub we are returning from aren't marked, if
-             * inside argument passing a GC run is triggered
-             * therefore we have to block GC
-             */
-            opcode_t *src_indexes  = interp->current_args;
-            opcode_t *dest_indexes = to_ctx->current_results;
-            interp->current_args   = NULL;
-
-            Parrot_block_GC_mark(INTERP);
-            parrot_pass_args(INTERP, from_ctx, to_ctx,
-                             src_indexes, dest_indexes, PARROT_PASS_PARAMS);
-            Parrot_unblock_GC_mark(INTERP);
+        if (!PMC_IS_NULL(from_obj)) {
+            STRING *string_sig = VTABLE_get_string(INTERP, from_obj);
+            /* If there is no string - there is no args */
+            if (string_sig) {
+                PMC *raw_sig, *invalid_sig;
+                Parrot_pcc_parse_signature_string(INTERP, string_sig, &raw_sig, &invalid_sig);
+
+                /* Build results signature for continuation */
+                if (*pc == PARROT_OP_get_results_pc)
+                    call_obj = Parrot_pcc_build_sig_object_returns_from_op(INTERP, call_obj,
+                        Parrot_pcc_get_pmc_constant(INTERP, to_ctx, pc[1]), pc);
+
+                Parrot_pcc_fill_returns_from_continuation(interp, call_obj, raw_sig, from_obj);
+            }
         }
 
         /* switch segment */
-        INTERP->current_args = NULL;
-
         if (INTERP->code != cc->seg)
             Parrot_switch_to_cs(INTERP, cc->seg, 1);
 
@@ -286,7 +275,7 @@
 */
 
     VTABLE STRING *get_string() {
-        return Parrot_Context_infostr(INTERP, PMC_cont(SELF)->to_ctx);
+        return Parrot_Context_infostr(INTERP, PARROT_CONTINUATION(SELF)->to_ctx);
     }
 
 /*
@@ -300,13 +289,17 @@
 */
 
     METHOD caller() {
-        Parrot_cont *cc     = PMC_cont(SELF);
-        PMC         *caller = cc->to_ctx->current_sub;
-        Parrot_sub  *sub;
+        Parrot_Continuation_attributes * const cc = PARROT_CONTINUATION(SELF);
+        PMC *caller = Parrot_pcc_get_sub(interp, cc->to_ctx);
 
-        PMC_get_sub(INTERP, caller, sub);
-        if (!caller || !sub->seg)
+        if (!caller)
             caller = PMCNULL;
+        else {
+            Parrot_Sub_attributes *sub;
+            PMC_get_sub(INTERP, caller, sub);
+            if (!sub->seg)
+                caller = PMCNULL;
+        }
 
         RETURN(PMC *caller);
 
@@ -322,8 +315,8 @@
 */
 
     METHOD continuation() {
-        Parrot_cont *cc   = PMC_cont(SELF);
-        PMC         *cont = cc->to_ctx->current_cont;
+        Parrot_Continuation_attributes * const cc = PARROT_CONTINUATION(SELF);
+        PMC * const cont = Parrot_pcc_get_continuation(interp, cc->to_ctx);
 
         if (cont)
             RETURN(PMC *cont);

Modified: branches/orderedhash_revamp/src/pmc/coroutine.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/coroutine.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/coroutine.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2001-2008, Parrot Foundation.
+Copyright (C) 2001-2009, Parrot Foundation.
 $Id$
 
 =head1 NAME
@@ -36,13 +36,11 @@
 print_sub_name(PARROT_INTERP, PMC *sub_pmc)
 {
     /* It's actually a Parrot_coro, but this avoids casting warnings. */
-    Parrot_sub          *co;
+    Parrot_Sub_attributes *co = PARROT_SUB(sub_pmc);
     Interp      * const tracer = (interp->pdb && interp->pdb->debugger) ?
         interp->pdb->debugger :
         interp;
 
-    GETATTR_Coroutine_sub(interp, sub_pmc, co);
-
     Parrot_io_eprintf(tracer, "# %s coro '%Ss'",
         !(PObj_get_FLAGS(sub_pmc) & SUB_FLAG_CORO_FF) ?
         "Calling" : "yielding from",
@@ -51,14 +49,17 @@
     if (co->ctx && (PObj_get_FLAGS(sub_pmc) & SUB_FLAG_CORO_FF)) {
         Parrot_io_eprintf(tracer, " to '%Ss'",
                 Parrot_full_sub_name(interp,
-                    co->ctx->caller_ctx->current_sub));
+                    Parrot_pcc_get_sub(interp, Parrot_pcc_get_caller_ctx(interp, co->ctx))));
     }
 
     Parrot_io_eprintf(tracer, "\n# ");
     print_pbc_location(interp);
 }
 
-pmclass Coroutine extends Sub need_ext {
+pmclass Coroutine extends Sub auto_attrs {
+    ATTR PackFile_ByteCode *caller_seg; /* bytecode segment */
+    ATTR opcode_t *address;             /* next address to run - toggled each time */
+    ATTR INTVAL yield;                  /* yield in process */
 
 /*
 
@@ -75,11 +76,10 @@
 */
 
     VTABLE void init() {
-        Parrot_Coroutine_attributes *attrs =
-            mem_allocate_typed(Parrot_Coroutine_attributes);
+        Parrot_Coroutine_attributes *attrs = PARROT_COROUTINE(SELF);
 
-        attrs->sub     = (Parrot_sub *)new_coroutine(INTERP);
-        PMC_data(SELF) = attrs;
+        attrs->seg = INTERP->code;
+        attrs->ctx = PMCNULL;
 
         PObj_custom_mark_destroy_SETALL(SELF);
     }
@@ -96,23 +96,35 @@
 */
 
     VTABLE PMC *clone() {
-        PMC         * const ret      = pmc_new(INTERP, SELF->vtable->base_type);
-        Parrot_sub         *sub;
-        Parrot_sub         *coro_sub;
+        PMC * const ret = pmc_new(INTERP, SELF->vtable->base_type);
+        Parrot_Coroutine_attributes * const sub      = PARROT_COROUTINE(SELF);
+        Parrot_Coroutine_attributes * const coro_sub = PARROT_COROUTINE(ret);
 
         PObj_custom_mark_destroy_SETALL(ret);
 
-        PMC_get_sub(INTERP, ret,  coro_sub);
-        PMC_get_sub(INTERP, SELF, sub);
-        memcpy(coro_sub, sub, sizeof (Parrot_coro));
+        memcpy(coro_sub, sub, sizeof (Parrot_Coroutine_attributes));
 
-        coro_sub->name      = Parrot_str_copy(INTERP, coro_sub->name);
+        coro_sub->name = Parrot_str_copy(INTERP, coro_sub->name);
 
         return ret;
     }
 
 /*
 
+=item C<void increment()>
+
+Signals the start of a yield.
+
+=cut
+
+*/
+
+    VTABLE void increment() {
+        SET_ATTR_yield(INTERP, SELF, 1);
+    }
+
+/*
+
 =item C<opcode_t *invoke(void *next)>
 
 Swaps the "context".
@@ -122,52 +134,50 @@
 */
 
     VTABLE opcode_t *invoke(void *next) {
-        PackFile_ByteCode  *wanted_seg;
-        Parrot_Coroutine_attributes *attrs = PARROT_COROUTINE(SELF);
-        Parrot_coro * const co = (Parrot_coro *)attrs->sub;
-        opcode_t    * dest     = co->address;
+        PackFile_ByteCode *wanted_seg;
+        Parrot_Coroutine_attributes * const co = PARROT_COROUTINE(SELF);
+        opcode_t * dest = co->address;
+        opcode_t * const next_op = (opcode_t *)next;
 
         if (Interp_trace_TEST(INTERP, PARROT_TRACE_SUB_CALL_FLAG))
             print_sub_name(INTERP, SELF);
 
-        if (!co->ctx) {
-            Parrot_Context *caller_ctx;
-            Parrot_Context *ctx;
-            PMC *ccont;
-
-            ccont = INTERP->current_cont;
+        if (PMC_IS_NULL(co->ctx)) {
+            PMC * const caller_ctx = CURRENT_CONTEXT(interp);
+            PMC *ctx;
+            PMC *ccont = INTERP->current_cont;
 
             if (ccont == NEED_CONTINUATION)
-                ccont = (PMC *)new_ret_continuation_pmc(interp,
-                                                       (opcode_t *)next);
+                ccont = (PMC *)new_ret_continuation_pmc(interp, next_op);
 
             if (PObj_get_FLAGS(ccont) & SUB_FLAG_TAILCALL)
                 Parrot_ex_throw_from_c_args(INTERP, NULL, CONTROL_ERROR,
                         "tail call to coro not allowed");
 
             /* first time set current sub, cont, object */
-            caller_ctx = CONTEXT(interp);
-            ctx        = Parrot_set_new_context(INTERP, co->n_regs_used);
-
-            co->ctx                   = Parrot_context_ref(interp, ctx);
-            co->dynamic_state         = interp->dynamic_env;
-
-            ctx->caller_ctx           = caller_ctx;
-            PMC_cont(ccont)->from_ctx = ctx;
-            ctx->current_sub          = SELF;
-            ctx->current_HLL          = co->HLL_id;
-            ctx->current_namespace    = co->namespace_stash;
-            ctx->current_cont         = ccont;
-            ctx->current_object       = NULL;
-            INTERP->current_object    = NULL;
-            INTERP->current_cont      = NULL;
+            ctx = Parrot_pcc_get_signature(INTERP, caller_ctx);
+            if (PMC_IS_NULL(ctx))
+                ctx = pmc_new(INTERP, enum_class_CallContext);
+            CURRENT_CONTEXT(INTERP) = ctx;
+            Parrot_pcc_allocate_registers(INTERP, ctx, co->n_regs_used);
+            Parrot_pcc_set_caller_ctx(INTERP, ctx, caller_ctx);
+            Parrot_pcc_init_context(INTERP, ctx, caller_ctx);
+
+            co->ctx = ctx;
+
+            PARROT_CONTINUATION(ccont)->from_ctx = ctx;
+            Parrot_pcc_set_sub(INTERP, ctx, SELF);
+            Parrot_pcc_set_continuation(INTERP, ctx, ccont);
+            Parrot_pcc_set_object(interp, ctx, PMCNULL);
+            INTERP->current_object = PMCNULL;
+            INTERP->current_cont   = PMCNULL;
 
             /* create pad if needed */
             if (!PMC_IS_NULL(co->lex_info)) {
-                ctx->lex_pad = pmc_new_init(INTERP,
-                        Parrot_get_ctx_HLL_type(interp, enum_class_LexPad),
-                        co->lex_info);
-                VTABLE_set_pointer(INTERP, ctx->lex_pad, ctx);
+                const INTVAL hlltype = Parrot_get_ctx_HLL_type(interp, enum_class_LexPad);
+                PMC * const lexpad = pmc_new_init(INTERP, hlltype, co->lex_info);
+                Parrot_pcc_set_lex_pad(INTERP, ctx, lexpad);
+                VTABLE_set_pointer(INTERP, lexpad, ctx);
             }
 
             PObj_get_FLAGS(SELF) |= SUB_FLAG_CORO_FF;
@@ -178,58 +188,49 @@
 
         /* if calling the Coro we need the segment of the Coro */
         else if (!(PObj_get_FLAGS(SELF) & SUB_FLAG_CORO_FF)) {
-            PMC *ccont;
-            Stack_Chunk_t    *state;
-            Parrot_Context   *ctx;
+            PMC * const ctx   = co->ctx;
+            PMC * const ccont = Parrot_pcc_get_continuation(INTERP, ctx);
 
             PObj_get_FLAGS(SELF) |= SUB_FLAG_CORO_FF;
             wanted_seg            = co->seg;
 
             /* remember segment of caller */
             co->caller_seg        = INTERP->code;
-            ctx                   = co->ctx;
 
             /* and the recent call context */
-            ccont                 = ctx->current_cont;
-            ctx->caller_ctx       = PMC_cont(ccont)->to_ctx
-                                  = CONTEXT(interp);
+            PARROT_CONTINUATION(ccont)->to_ctx = CURRENT_CONTEXT(interp);
+            Parrot_pcc_set_caller_ctx(interp, ctx, CURRENT_CONTEXT(interp));
 
             /* set context to coro context */
-            state                 = interp->dynamic_env;
-            interp->dynamic_env   = co->dynamic_state;
-            co->dynamic_state     = state;
-            CONTEXT(interp)       = ctx;
-            INTERP->ctx.bp        = ctx->bp;
-            INTERP->ctx.bp_ps     = ctx->bp_ps;
+            CURRENT_CONTEXT(interp) = ctx;
         }
         else {
-            PMC *ccont;
-            Stack_Chunk_t    *state;
-            Parrot_Context   *ctx;
+            PMC * const ccont = Parrot_pcc_get_continuation(INTERP, co->ctx);
+            PMC * const ctx   = PARROT_CONTINUATION(ccont)->to_ctx;
+            INTVAL yield;
+            GET_ATTR_yield(INTERP, SELF, yield);
+            if (! yield)
+                Parrot_ex_throw_from_c_args(INTERP, NULL, CONTROL_ERROR,
+                               "Cannot resume dead coroutine.");
+            SET_ATTR_yield(INTERP, SELF, 0);
 
             PObj_get_FLAGS(SELF) &= ~SUB_FLAG_CORO_FF;
             /* switch back to last remembered code seg and context */
 
             wanted_seg            = co->caller_seg;
-            ccont                 = co->ctx->current_cont;
-            ctx                   = PMC_cont(ccont)->to_ctx;
 
-            if (! ctx) {
+            if (PMC_IS_NULL(ctx)) {
                 /* This still isn't quite right, but it beats segfaulting.  See
                    the "Call an exited coroutine" case in t/pmc/coroutine.t; the
                    problem is that the defunct coroutine yields up one more
                    result before we get here.  -- rgr, 7-Oct-06.
-                */
+                 * This may be unneeded after the yield fix, see TT #1003
+                 */
                 Parrot_ex_throw_from_c_args(INTERP, NULL, CONTROL_ERROR,
                                "Cannot resume dead coroutine.");
             }
 
-            state                = interp->dynamic_env;
-            interp->dynamic_env  = co->dynamic_state;
-            co->dynamic_state    = state;
-            CONTEXT(interp)      = ctx;
-            INTERP->ctx.bp       = ctx->bp;
-            INTERP->ctx.bp_ps    = ctx->bp_ps;
+            CURRENT_CONTEXT(interp) = ctx;
         }
 
         /* toggle address */
@@ -242,28 +243,6 @@
         return dest;
     }
 
-/*
-
-=item C<void mark()>
-
-Marks the coroutine as live.
-
-=cut
-
-*/
-
-    VTABLE void mark() {
-        Parrot_Coroutine_attributes *attrs = PARROT_COROUTINE(SELF);
-        Parrot_coro * const          co    = (Parrot_coro *)attrs->sub;
-
-        /* co->ctx marked in SUPER(), so do not mark here */
-        if (co) {
-            if (co->dynamic_state)
-                mark_stack(INTERP, co->dynamic_state);
-
-            SUPER();
-        }
-    }
 }
 
 /*

Modified: branches/orderedhash_revamp/src/pmc/cpointer.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/cpointer.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/cpointer.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -46,7 +46,7 @@
 
 */
 
-pmclass CPointer need_ext {
+pmclass CPointer auto_attrs {
     ATTR void   *pointer; /* The stored pointer. */
     ATTR STRING *sig;     /* A string signature for the pointer. */
 
@@ -61,14 +61,10 @@
 */
 
     VTABLE void init() {
-        Parrot_CPointer_attributes * const pdata_struct =
-            mem_allocate_typed(Parrot_CPointer_attributes);
+        SET_ATTR_pointer(INTERP, SELF, NULL);
+        SET_ATTR_sig(INTERP, SELF, NULL);
 
-        PMC_data(SELF)        = pdata_struct;
-        pdata_struct->pointer = NULL;
-        pdata_struct->sig     = NULL;
-
-        PObj_custom_mark_destroy_SETALL(SELF);
+        PObj_custom_mark_SET(SELF);
     }
 
 /*
@@ -83,42 +79,12 @@
 */
 
     VTABLE void mark() {
-        Parrot_CPointer_attributes * const data = PARROT_CPOINTER(SELF);
-
-        if (data->sig) {
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)data->sig);
-
-            if (data->pointer) {
-                if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "P"))) {
-                    PMC ** const pmc_pointer = (PMC **) data->pointer;
-                    PARROT_ASSERT(*pmc_pointer);
-                    Parrot_gc_mark_PObj_alive(interp, (PObj *) *pmc_pointer);
-                }
-                else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "S"))) {
-                    STRING ** const str_pointer = (STRING **) data->pointer;
-                    PARROT_ASSERT(*str_pointer);
-                    Parrot_gc_mark_PObj_alive(interp, (PObj *) *str_pointer);
-                }
-            }
-        }
-    }
-
-/*
-
-=item C<void destroy()>
-
-Destroys the PMC and frees all allocated memory.
-
-=cut
-
-*/
-
-    VTABLE void destroy() {
-        Parrot_CPointer_attributes * const data = PARROT_CPOINTER(SELF);
-
-        if (data) {
-            mem_sys_free(data);
-            PMC_data(SELF) = NULL;
+        STRING *sig;
+        GET_ATTR_sig(INTERP, SELF, sig);
+        if (sig) {
+            void *pointer;
+            GET_ATTR_pointer(INTERP, SELF, pointer);
+            Parrot_gc_mark_STRING_alive(interp, sig);
         }
     }
 
@@ -134,8 +100,16 @@
 
     VTABLE PMC *clone() {
         PMC * const dest = pmc_new_noinit(INTERP, SELF->vtable->base_type);
+        void       *ptr;
+        STRING     *sig;
+
+        GET_ATTR_pointer(INTERP, SELF, ptr);
+        SET_ATTR_pointer(INTERP, dest, ptr);
+
+        GET_ATTR_sig(INTERP, SELF, sig);
+        SET_ATTR_sig(INTERP, dest, sig);
+
         PObj_custom_mark_SET(dest);
-        PMC_data(dest) = PMC_data(SELF);
         return dest;
     }
 
@@ -218,16 +192,25 @@
         Parrot_CPointer_attributes * const data = PARROT_CPOINTER(SELF);
 
         if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "I"))) {
-            const INTVAL * const int_pointer = (INTVAL *) data->pointer;
+            INTVAL * const int_pointer = (INTVAL *) data->pointer;
             return *int_pointer;
         }
+        else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "N"))) {
+            FLOATVAL * const num_pointer = (FLOATVAL *) data->pointer;
+            return (INTVAL)*num_pointer;
+        }
+        else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "S"))) {
+            STRING ** const str_pointer = (STRING **) data->pointer;
+            return Parrot_str_to_int(INTERP, *str_pointer);
+        }
         else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "P"))) {
             PMC ** const pmc_pointer = (PMC **) data->pointer;
-            return VTABLE_get_integer(interp, *pmc_pointer);
+            return VTABLE_get_integer(INTERP, *pmc_pointer);
+        }
+        else {
+            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                    "Unable to fetch value, broken signature!");
         }
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-                "Unable to fetch integer value, the pointer is not an integer");
-
     }
 
 /*
@@ -248,13 +231,21 @@
             INTVAL * const int_pointer = (INTVAL *) data->pointer;
             *int_pointer = value;
         }
+        else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "N"))) {
+            FLOATVAL * const num_pointer = (FLOATVAL *) data->pointer;
+            *num_pointer = value;
+        }
+        else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "S"))) {
+            STRING ** const str_pointer = (STRING **) data->pointer;
+            *str_pointer = Parrot_str_from_int(INTERP, value);
+        }
         else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "P"))) {
             PMC ** const pmc_pointer = (PMC **) data->pointer;
-            VTABLE_set_integer_native(interp, *pmc_pointer, value);
+            *pmc_pointer = get_integer_pmc(INTERP, value);
         }
         else {
             Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-                    "Unable to set integer value, the pointer is not an integer");
+                    "Unable to set value, broken signature!");
         }
     }
 
@@ -272,16 +263,26 @@
     VTABLE FLOATVAL get_number() {
         Parrot_CPointer_attributes * const data = PARROT_CPOINTER(SELF);
 
-        if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "N"))) {
-            const FLOATVAL * const num_pointer = (FLOATVAL *) data->pointer;
+        if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "I"))) {
+            INTVAL * const int_pointer = (INTVAL *) data->pointer;
+            return (FLOATVAL)*int_pointer;
+        }
+        else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "N"))) {
+            FLOATVAL * const num_pointer = (FLOATVAL *) data->pointer;
             return *num_pointer;
         }
+        else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "S"))) {
+            STRING ** const str_pointer = (STRING **) data->pointer;
+            return Parrot_str_to_num(INTERP, *str_pointer);
+        }
         else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "P"))) {
             PMC ** const pmc_pointer = (PMC **) data->pointer;
-            return VTABLE_get_number(interp, *pmc_pointer);
+            return VTABLE_get_number(INTERP, *pmc_pointer);
+        }
+        else {
+            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                    "Unable to fetch value, broken signature!");
         }
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-                "Unable to fetch number value, the pointer is not a number");
     }
 
 /*
@@ -298,17 +299,25 @@
     VTABLE void set_number_native(FLOATVAL value) {
         Parrot_CPointer_attributes * const data = PARROT_CPOINTER(SELF);
 
-        if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "N"))) {
+        if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "I"))) {
+            INTVAL * const int_pointer = (INTVAL *) data->pointer;
+            *int_pointer = (INTVAL)value;
+        }
+        else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "N"))) {
             FLOATVAL * const num_pointer = (FLOATVAL *) data->pointer;
             *num_pointer = value;
         }
+        else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "S"))) {
+            STRING ** const str_pointer = (STRING **) data->pointer;
+            *str_pointer = Parrot_str_from_num(INTERP, value);
+        }
         else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "P"))) {
             PMC ** const pmc_pointer = (PMC **) data->pointer;
-            VTABLE_set_number_native(interp, *pmc_pointer, value);
+            *pmc_pointer = get_number_pmc(INTERP, value);
         }
         else {
             Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-                    "Unable to set number value, the pointer is not a number");
+                    "Unable to set value, broken signature!");
         }
     }
 
@@ -326,16 +335,26 @@
     VTABLE STRING *get_string() {
         Parrot_CPointer_attributes * const data = PARROT_CPOINTER(SELF);
 
-        if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "S"))) {
+        if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "I"))) {
+            INTVAL * const int_pointer = (INTVAL *) data->pointer;
+            return Parrot_str_from_int(INTERP, *int_pointer);
+        }
+        else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "N"))) {
+            FLOATVAL * const num_pointer = (FLOATVAL *) data->pointer;
+            return Parrot_str_from_num(INTERP, *num_pointer);
+        }
+        else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "S"))) {
             STRING ** const str_pointer = (STRING **) data->pointer;
             return *str_pointer;
         }
         else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "P"))) {
             PMC ** const pmc_pointer = (PMC **) data->pointer;
-            return VTABLE_get_string(interp, *pmc_pointer);
+            return VTABLE_get_string(INTERP, *pmc_pointer);
+        }
+        else {
+            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                    "Unable to fetch value, broken signature!");
         }
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-                "Unable to fetch string value, the pointer is not a string");
     }
 
 /*
@@ -352,17 +371,25 @@
     VTABLE void set_string_native(STRING *value) {
         Parrot_CPointer_attributes * const data = PARROT_CPOINTER(SELF);
 
-        if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "S"))) {
+        if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "I"))) {
+            INTVAL * const int_pointer = (INTVAL *) data->pointer;
+            *int_pointer = Parrot_str_to_int(INTERP, value);
+        }
+        else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "N"))) {
+            FLOATVAL * const num_pointer = (FLOATVAL *) data->pointer;
+            *num_pointer = Parrot_str_to_num(INTERP, value);
+        }
+        else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "S"))) {
             STRING ** const str_pointer = (STRING **) data->pointer;
             *str_pointer = value;
         }
         else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "P"))) {
             PMC ** const pmc_pointer = (PMC **) data->pointer;
-            VTABLE_set_string_native(interp, *pmc_pointer, value);
+            *pmc_pointer = get_string_pmc(INTERP, value);
         }
         else {
             Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-                    "Unable to set string value, the pointer is not a string");
+                    "Unable to set value, broken signature!");
         }
     }
 
@@ -379,12 +406,26 @@
     VTABLE PMC *get_pmc() {
         const Parrot_CPointer_attributes * const data = PARROT_CPOINTER(SELF);
 
-        if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "P"))) {
+        if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "I"))) {
+            INTVAL * const int_pointer = (INTVAL *) data->pointer;
+            return get_integer_pmc(INTERP, *int_pointer);
+        }
+        else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "N"))) {
+            FLOATVAL * const num_pointer = (FLOATVAL *) data->pointer;
+            return get_number_pmc(INTERP, *num_pointer);
+        }
+        else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "S"))) {
+            STRING ** const str_pointer = (STRING **) data->pointer;
+            return get_string_pmc(INTERP, *str_pointer);
+        }
+        else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "P"))) {
             PMC ** const pmc_pointer = (PMC **) data->pointer;
             return *pmc_pointer;
         }
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-                "Unable to fetch PMC value, the pointer is not a PMC");
+        else {
+            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                    "Unable to fetch value, broken signature!");
+        }
     }
 
 /*
@@ -400,13 +441,25 @@
     VTABLE void set_pmc(PMC *value) {
         const Parrot_CPointer_attributes * const data = PARROT_CPOINTER(SELF);
 
-        if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "P"))) {
+        if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "I"))) {
+            INTVAL * const int_pointer = (INTVAL *) data->pointer;
+            *int_pointer = VTABLE_get_integer(INTERP, value);
+        }
+        else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "N"))) {
+            FLOATVAL * const num_pointer = (FLOATVAL *) data->pointer;
+            *num_pointer = VTABLE_get_number(INTERP, value);
+        }
+        else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "S"))) {
+            STRING ** const str_pointer = (STRING **) data->pointer;
+            *str_pointer = VTABLE_get_string(INTERP, value);
+        }
+        else if (Parrot_str_equal(interp, data->sig, CONST_STRING(interp, "P"))) {
             PMC ** const pmc_pointer = (PMC **) data->pointer;
             *pmc_pointer = value;
         }
         else {
             Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-                    "Unable to set PMC value, the pointer is not a PMC");
+                    "Unable to set value, broken signature!");
         }
     }
 

Modified: branches/orderedhash_revamp/src/pmc/default.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/default.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/default.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -48,7 +48,7 @@
 /*
 
 =item C<static void cant_do_method(PARROT_INTERP, PMC *pmc,
-                                   const char *methname)>
+                                   int index)>
 
 Throws an exception "$methname() not implemented in class '$class'", used by
 all unimplemented messages.
@@ -59,10 +59,11 @@
 
 PARROT_DOES_NOT_RETURN
 static void
-cant_do_method(PARROT_INTERP, PMC *pmc /*NULLOK*/, const char *methname)
+cant_do_method(PARROT_INTERP, PMC *pmc /*NULLOK*/, int index)
 {
     Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ILL_INHERIT,
-            "%s() not implemented in class '%Ss'", methname,
+            "%s() not implemented in class '%Ss'",
+            Parrot_get_vtable_name(interp, index),
             caller(interp, pmc));
 }
 
@@ -70,7 +71,7 @@
 /*
 
 =item C<static void cant_do_write_method(PARROT_INTERP, PMC *pmc,
-                                   const char *methname)>
+                                   int index)>
 
 Throws an exception "$methname() on read-only instance of '$class'", used by
 all updating messages on read-only instances.
@@ -81,10 +82,11 @@
 
 PARROT_DOES_NOT_RETURN
 static void
-cant_do_write_method(PARROT_INTERP, PMC *pmc /*NULLOK*/, const char *methname)
+cant_do_write_method(PARROT_INTERP, PMC *pmc /*NULLOK*/, int index)
 {
     Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_WRITE_TO_CONSTCLASS,
-            "%s() in read-only instance of '%Ss'", methname,
+            "%s() in read-only instance of '%Ss'",
+            Parrot_get_vtable_name(interp, index),
             caller(interp, pmc));
 }
 
@@ -106,30 +108,14 @@
 static INTVAL
 check_set_std_props(PARROT_INTERP, PMC *pmc, STRING *key, PMC *value)
 {
-    /* the quick hack below cannot be used because the string could
-       be constructed in an interpreter that is later destroyed */
-#if  0
-    /* RT #46659
-     * a quick hack, to prevent freeing that string during GC
-     * triggered in t/pmc/pmc_62.t when configured with --gc=libc
-     */
-    static STRING *ro;
-    if (!ro)
-        ro = string_make(interp, "_ro", 3, "ascii",
-            PObj_constant_FLAG|PObj_external_FLAG);
-    if (Parrot_str_equal(interp, key, ro)) {
-#else
-
     /*
      * s2 in Parrot_str_equal is freed here
      */
     if (Parrot_str_equal(interp, key, CONST_STRING(interp, "_ro"))) {
-#endif
         /* pmc should set/clear readonly */
         const INTVAL on = VTABLE_get_bool(interp, value);
 
         /* morph to Const/normal class or readonly class */
-        /* RT #46661 warn when this fails? */
         if (on && (pmc->vtable->flags & VTABLE_HAS_CONST_TOO))
             pmc->vtable = interp->vtables[pmc->vtable->base_type + 1];
         else if (!on && (pmc->vtable->flags & (VTABLE_IS_CONST_FLAG)))
@@ -228,11 +214,7 @@
 make_prop_hash(PARROT_INTERP, PMC *self) {
     PMC *prop;
 
-    if (!self->pmc_ext)
-        Parrot_gc_add_pmc_ext(interp, self);
-
     PMC_metadata(self) = prop = pmc_new(interp, enum_class_Hash);
-    GC_WRITE_BARRIER(interp, self, NULL, prop);
     propagate_std_props(interp, self, prop);
     return prop;
 }
@@ -325,6 +307,19 @@
 
 /*
 
+=item C<void destroy()>
+
+Does nothing.
+
+=cut
+
+*/
+
+    VTABLE void destroy() {
+    }
+
+/*
+
 =item C<PMC *instantiate(PMC *init)>
 
 Default fallback. Creates a new PMC of the type of the class SELF and
@@ -375,10 +370,10 @@
 */
 
     VTABLE PMC *getprop(STRING *key) {
-        if (SELF->pmc_ext && PMC_metadata(SELF))
-            return VTABLE_get_pmc_keyed_str(INTERP, PMC_metadata(SELF), key);
-        else
+        if (PMC_IS_NULL(PMC_metadata(SELF)))
             return check_get_std_props(interp, SELF, key);
+        else
+            return VTABLE_get_pmc_keyed_str(INTERP, PMC_metadata(SELF), key);
     }
 
 /*
@@ -395,15 +390,10 @@
         if (check_set_std_props(INTERP, SELF, key, value))
             return;
 
-        if (SELF->pmc_ext && PMC_metadata(SELF)) {
-            VTABLE_set_pmc_keyed_str(INTERP,
-                PMC_metadata(SELF), key, value);
-        }
-        else {
-            PMC * const prop = make_prop_hash(INTERP, SELF);
+        if (PMC_IS_NULL(PMC_metadata(SELF)))
+            make_prop_hash(INTERP, SELF);
 
-            VTABLE_set_pmc_keyed_str(INTERP, prop, key, value);
-        }
+        VTABLE_set_pmc_keyed_str(INTERP, PMC_metadata(SELF), key, value);
     }
 
 /*
@@ -417,7 +407,7 @@
 */
 
     VTABLE void delprop(STRING *key) {
-        if (SELF->pmc_ext && PMC_metadata(SELF))
+        if (!PMC_IS_NULL(PMC_metadata(SELF)))
             VTABLE_delete_keyed_str(INTERP, PMC_metadata(SELF), key);
     }
 
@@ -432,10 +422,7 @@
 */
 
     VTABLE PMC *getprops() {
-        if (!SELF->pmc_ext)
-            Parrot_gc_add_pmc_ext(INTERP, SELF);
-
-        if (!PMC_metadata(SELF)) {
+        if (PMC_IS_NULL(PMC_metadata(SELF))) {
             if (has_pending_std_props(SELF))
                 return make_prop_hash(INTERP, SELF);
             else
@@ -714,6 +701,21 @@
 
 /*
 
+=item C<INTVAL hashvalue()>
+
+Calculate hashvalue for PMC. Default behaviour stringify and use string.
+
+=cut
+
+*/
+
+    INTVAL hashvalue() {
+        STRING *s = SELF.get_string();
+        return key_hash_STRING(INTERP, s, 0);
+    }
+
+/*
+
 =item C<INTVAL is_equal(PMC *value)>
 
 Default fallback. Performs a multiple dispatch call for 'is_equal'.
@@ -829,22 +831,6 @@
 
 /*
 
-=item C<PMC *nextkey_keyed_int(INTVAL key, INTVAL w)>
-
-Converts C<key> to a PMC key and returns the result of calling
-C<nextkey_keyed()> with it.
-
-=cut
-
-*/
-
-    VTABLE PMC *nextkey_keyed_int(INTVAL key, INTVAL w) {
-        PMC *const r_key = INT2KEY(INTERP, key);
-        return SELF.nextkey_keyed(r_key, w);
-    }
-
-/*
-
 =item C<INTVAL can(STRING *method)>
 
 Reports whether the PMC "can" perform C<method>.
@@ -904,8 +890,8 @@
 */
 
     VTABLE INTVAL isa_pmc(PMC *lookup) {
-       Hash   * const isa_hash = SELF->vtable->isa_hash;
-       STRING *pmc_name;
+        Hash   * const isa_hash = SELF->vtable->isa_hash;
+        STRING *pmc_name;
 
         if (PMC_IS_NULL(lookup))
             return 0;
@@ -915,7 +901,6 @@
         if (!isa_hash)
             return Parrot_str_equal(interp, SELF->vtable->whoami, pmc_name);
 
-        /* RT #46665 - walk mro */
         return parrot_hash_exists(INTERP, isa_hash, (void *)pmc_name);
     }
 
@@ -932,7 +917,6 @@
 */
 
     VTABLE INTVAL isa(STRING *_class) {
-        /* RT #46665 - walk mro */
         Hash * const isa_hash = SELF->vtable->isa_hash;
         if (!isa_hash)
             return Parrot_str_equal(interp, SELF->vtable->whoami, _class);
@@ -1068,18 +1052,6 @@
 */
 
     VTABLE void visit(visit_info *info) {
-        /* default - mark prop hash */
-        if (SELF->pmc_ext && PMC_metadata(SELF) &&
-            info->extra_flags != EXTRA_IS_PROP_HASH) {
-            info->extra_flags = EXTRA_IS_PROP_HASH;
-            info->extra       = PMC_metadata(SELF);
-
-            /* place escape mark */
-            (info->visit_pmc_now)(INTERP, SELF, info);
-
-            /* place and the prop hash */
-            (info->visit_pmc_now)(INTERP, PMC_metadata(SELF), info);
-        }
     }
 
 /*
@@ -1123,17 +1095,7 @@
 
     VTABLE void thaw(visit_info *info) {
         /* default - initialize the PMC */
-        if (info->extra_flags == EXTRA_IS_PROP_HASH) {
-            if (!SELF->pmc_ext)
-                Parrot_gc_add_pmc_ext(INTERP, SELF);
-
-            info->thaw_ptr  = &PMC_metadata(SELF);
-            info->container = SELF;
-
-            (info->visit_pmc_now)(INTERP, PMC_metadata(SELF), info);
-        }
-        else
-            SELF.init();
+        SELF.init();
     }
 
 /*

Modified: branches/orderedhash_revamp/src/pmc/env.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/env.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/env.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -99,6 +99,19 @@
 
 /*
 
+=item C<INTVAL get_bool()>
+
+Returns whether the environment has any elements.
+
+=cut
+
+*/
+    VTABLE INTVAL get_bool() {
+        return SELF.elements() ? 1 : 0;
+    }
+
+/*
+
 =item C<INTVAL get_integer()>
 
 Returns the size of the hash.
@@ -135,21 +148,12 @@
 */
 
     VTABLE STRING *get_string_keyed_str(STRING *key) {
-        char * const keyname = Parrot_str_to_cstring(interp, key);
-
-        if (keyname) {
-            int free_it = 0;
-            char * const val = Parrot_getenv(keyname, &free_it);
-            Parrot_str_free_cstring(keyname);
+        if (!STRING_IS_EMPTY(key)) {
+            char * const val = Parrot_getenv(interp, key);
 
             if (val) {
                 STRING * const retval = Parrot_str_new(interp, val, 0);
-
-                if (free_it)
-                    mem_sys_free(val);
-
                 return retval;
-
             }
         }
 
@@ -194,22 +198,17 @@
 */
 
     VTABLE PMC *get_pmc_keyed(PMC *key) {
-        char * const keyname = Parrot_str_to_cstring(INTERP,
-            VTABLE_get_string(INTERP, key));
+        STRING *keyname = VTABLE_get_string(INTERP, key);
 
         char   *val     = NULL;
         STRING *retval  = NULL;
         PMC    *return_pmc;
 
-        if (keyname) {
-            int free_it = 0;
-            val         = Parrot_getenv(keyname, &free_it);
-            Parrot_str_free_cstring(keyname);
+        if (!STRING_IS_EMPTY(keyname)) {
+            val         = Parrot_getenv(INTERP, keyname);
 
             if (val) {
                 retval = Parrot_str_new(INTERP, val, 0);
-                if (free_it)
-                    mem_sys_free(val);
             }
         }
 
@@ -233,18 +232,10 @@
 */
 
     VTABLE void set_string_keyed(PMC *key, STRING *value) {
-        char * const keyname = Parrot_str_to_cstring(INTERP,
-            VTABLE_get_string(INTERP, key));
-        char * const env_val = Parrot_str_to_cstring(INTERP, value);
-
-        if (keyname && env_val)
-            Parrot_setenv(keyname, env_val);
+        STRING *keyname = VTABLE_get_string(INTERP, key);
 
-        if (keyname)
-            Parrot_str_free_cstring(keyname);
-
-        if (env_val)
-            Parrot_str_free_cstring(env_val);
+        if (keyname && value)
+            Parrot_setenv(INTERP, keyname, value);
     }
 
 /*
@@ -258,20 +249,11 @@
 */
 
     VTABLE void set_pmc_keyed(PMC *key, PMC *value) {
-        char * const keyname = Parrot_str_to_cstring(INTERP,
-            VTABLE_get_string(INTERP, key));
-
-        const STRING * const str_value = VTABLE_get_string(INTERP, value);
-        char         * const env_val   = Parrot_str_to_cstring(INTERP, str_value);
+        STRING * keyname   = VTABLE_get_string(INTERP, key);
+        STRING * str_value = VTABLE_get_string(INTERP, value);
 
-        if (keyname && env_val)
-            Parrot_setenv(keyname, env_val);
-
-        if (keyname)
-            Parrot_str_free_cstring(keyname);
-
-        if (env_val)
-            Parrot_str_free_cstring(env_val);
+        if (keyname && str_value)
+            Parrot_setenv(INTERP, keyname, str_value);
     }
 
 /*
@@ -284,18 +266,13 @@
 
 */
 
-    VTABLE INTVAL exists_keyed(PMC *key) {
-        char * const keyname = Parrot_str_to_cstring(INTERP,
-            VTABLE_get_string(INTERP, key));
-
-        if (keyname) {
-            int free_it;
-            char * const val = Parrot_getenv(keyname, &free_it);
-            Parrot_str_free_cstring(keyname);
+    VTABLE INTVAL exists_keyed(PMC *pmckey) {
+        STRING *keyname = VTABLE_get_string(INTERP, pmckey);
+
+        if (!STRING_IS_EMPTY(keyname)) {
+            char * const val = Parrot_getenv(interp, keyname);
 
             if (val) {
-                if (free_it)
-                    mem_sys_free(val);
                 return 1;
             }
         }
@@ -314,21 +291,14 @@
 */
 
     VTABLE void delete_keyed(PMC *key) {
-        char * const keyname = Parrot_str_to_cstring(INTERP,
-            VTABLE_get_string(INTERP, key));
+        STRING *keyname = VTABLE_get_string(INTERP, key);
 
-        if (keyname) {
-            int          free_it;
-            char * const val = Parrot_getenv(keyname, &free_it);
+        if (!STRING_IS_EMPTY(keyname)) {
+            char * const val = Parrot_getenv(INTERP, keyname);
 
             if (val) {
-                if (free_it)
-                    mem_sys_free(val);
-
-                Parrot_unsetenv(keyname);
+                Parrot_unsetenv(INTERP, keyname);
             }
-
-            Parrot_str_free_cstring(keyname);
         }
     }
 }
@@ -340,7 +310,7 @@
 =head1 SEE ALS0
 
 PDD -
-L<http://www.parrotcode.org/docs/pdd/pdd17_pdd.html#Hash_types>
+L<http://docs.parrot.org/parrot/latest/html/docs/pdds/pdd17_pmc.pod.html#Hash_types>
 
 Environment in Perl 6 - L<http://dev.perl.org/perl6/rfc/318.html>
 

Modified: branches/orderedhash_revamp/src/pmc/eval.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/eval.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/eval.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2001-2008, Parrot Foundation.
+Copyright (C) 2001-2009, Parrot Foundation.
 $Id$
 
 =head1 NAME
@@ -19,10 +19,10 @@
 
 */
 
-#include "pmc_sub.h"
+#include "pmc/pmc_sub.h"
 
 static void
-clear_fixups(PARROT_INTERP, Parrot_sub *sub_data)
+clear_fixups(PARROT_INTERP, Parrot_Sub_attributes *sub_data)
 {
     INTVAL               i;
     PackFile_ByteCode   *seg = sub_data->seg;
@@ -55,11 +55,11 @@
 static PMC*
 get_sub(PARROT_INTERP, PMC *self, int idx)
 {
-    INTVAL               i, n;
-    Parrot_sub          *sub;
-    PackFile_ByteCode   *seg;
-    PackFile_FixupTable *ft;
-    PackFile_ConstTable *ct;
+    INTVAL                 i, n;
+    Parrot_Sub_attributes *sub;
+    PackFile_ByteCode     *seg;
+    PackFile_FixupTable   *ft;
+    PackFile_ConstTable   *ct;
 
     PMC_get_sub(interp, self, sub);
     seg = sub->seg;
@@ -92,7 +92,7 @@
 static void
 mark_subs(PARROT_INTERP, PMC *self)
 {
-    Parrot_sub          *sub;
+    Parrot_Sub_attributes *sub;
     PackFile_ByteCode   *seg;
     PackFile_FixupTable *ft;
     PackFile_ConstTable *ct;
@@ -119,16 +119,15 @@
             opcode_t  ci  = e->offset;
             PMC      *sub = ct->constants[ci]->u.key;
 
-            if (!PMC_IS_NULL(sub))
-                Parrot_gc_mark_PObj_alive(interp, (PObj *)sub);
+            Parrot_gc_mark_PMC_alive(interp, sub);
         }
     }
 }
 
-pmclass Eval extends Sub need_ext {
+pmclass Eval extends Sub auto_attrs {
 
     VTABLE void init() {
-        Parrot_sub *sub_data;
+        Parrot_Sub_attributes *sub_data;
         SUPER();
 
         PMC_get_sub(INTERP, SELF, sub_data);
@@ -159,8 +158,8 @@
          * These globals still exist, calling them will segfault
          * as the segment is destroyed now.
          *
-         * RT#46683 walk the fixups for this segment, locate globals
-         *      and nullify the Sub PMC.
+         * TT # 1230:
+         * Walk the fixups, locate globals and nullify the Sub PMC
          * This probably needs a pointer into the globals.
          *
          * OTOH - if the global exists - this eval pmc ought
@@ -168,7 +167,7 @@
          */
         PackFile_Segment  *seg;
         PackFile_ByteCode *cur_cs;
-        Parrot_sub        *sub_data;
+        Parrot_Sub_attributes *sub_data;
 
         PMC_get_sub(INTERP, SELF, sub_data);
 
@@ -185,14 +184,25 @@
             return;
         }
 
-        /* RT#46685 create PF API, move it there */
+        /* XXX Quick and dirty fix for TT #995 */
+        if ((struct PackFile *)cur_cs == interp->initial_pf
+                || cur_cs == interp->code) {
+            SUPER();
+            return;
+        }
+
+        /* TT #1315 create PF API, move it there */
         seg = (PackFile_Segment *)cur_cs->const_table;
-        if (seg)
+        if (seg) {
             PackFile_Segment_destroy(INTERP, seg);
+            cur_cs->const_table = NULL;
+        }
 
         seg = (PackFile_Segment *)cur_cs->debugs;
-        if (seg)
+        if (seg) {
             PackFile_Segment_destroy(INTERP, seg);
+            cur_cs->debugs = NULL;
+        }
 
         seg = (PackFile_Segment *)cur_cs->fixups;
         if (seg) {
@@ -200,15 +210,17 @@
             cur_cs->fixups = NULL;
         }
 
-        seg = cur_cs->pic_index;
-        if (seg)
-            PackFile_Segment_destroy(INTERP, seg);
+/* XXX Commenting out this to fix TT #995 and related problems.
+ * May leak some memory, need further revision.
 
         seg = (PackFile_Segment *)cur_cs;
         if (seg)
             PackFile_Segment_destroy(INTERP, seg);
+ * XXX End of commented out section.
+ */
 
         sub_data->seg = NULL;
+
         SUPER();
     }
 
@@ -229,7 +241,7 @@
 */
 
     VTABLE STRING *get_string() {
-        Parrot_sub        *sub;
+        Parrot_Sub_attributes *sub;
         PackFile          *pf  = PackFile_new(INTERP, 0);
         PackFile_ByteCode *seg;
         STRING            *res;
@@ -252,10 +264,6 @@
             PackFile_add_segment(INTERP, &pf->directory,
                     (PackFile_Segment *)seg->fixups);
 
-        if (seg->pic_index)
-            PackFile_add_segment(INTERP, &pf->directory,
-                    (PackFile_Segment *)seg->pic_index);
-
         size = PackFile_pack_size(INTERP, pf) * sizeof (opcode_t);
 
         /*
@@ -281,7 +289,8 @@
 
         /* We block GC while doing the packing, since GC run during a pack
            has been observed to cause problems. There may be a Better Fix.
-           See RT #40410 for example of the problem (note on line that
+           See http://rt.perl.org/rt3/Ticket/Display.html?id=40410
+           for example of the problem (note on line that
            segfaults, it is *cursor that is pointing to dealloced memory). */
         Parrot_block_GC_mark(INTERP);
         PackFile_pack(INTERP, pf, (opcode_t *)res->strstart);
@@ -324,19 +333,17 @@
 */
 
     VTABLE void freeze(visit_info *info) {
-        IMAGE_IO *io     = info->image_io;
         STRING   *packed = SELF.get_string();
-        VTABLE_push_string(INTERP, io, packed);
+        VTABLE_push_string(INTERP, info, packed);
 
         SUPER(info);
     }
 
     VTABLE void thaw(visit_info *info) {
-        IMAGE_IO         *io     = info->image_io;
-        STRING           *packed = VTABLE_shift_string(INTERP, io);
+        STRING           *packed = VTABLE_shift_string(INTERP, info);
         PackFile         *pf;
         PackFile_Segment *seg;
-        Parrot_sub       *sub;
+        Parrot_Sub_attributes *sub;
         size_t            i;
 
         SUPER(info);
@@ -362,7 +369,7 @@
         pf->directory.num_segments = 0;
 
         /*
-         * RT#46687 this isn't ok - it seems that the packfile
+         * TT #1292 this isn't ok - it seems that the packfile
          *     gets attached to interp->code and is
          *     destroyed again during interpreter destruction
          */
@@ -371,7 +378,7 @@
 
     VTABLE INTVAL elements() {
         INTVAL               i, n;
-        Parrot_sub          *sub;
+        Parrot_Sub_attributes *sub;
         PackFile_ByteCode   *seg;
         PackFile_FixupTable *ft;
 

Modified: branches/orderedhash_revamp/src/pmc/eventhandler.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/eventhandler.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/eventhandler.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -19,7 +19,7 @@
 
 */
 
-pmclass EventHandler extends Sub need_ext {
+pmclass EventHandler extends Sub auto_attrs {
 
     ATTR STRING *type;          /* the type of the event to handle */
     ATTR PMC    *code;          /* the code object to execute */
@@ -38,13 +38,8 @@
 */
 
     VTABLE void init() {
-        Parrot_EventHandler_attributes *e =
-            mem_allocate_zeroed_typed(Parrot_EventHandler_attributes);
-
         PObj_custom_mark_SET(SELF);
-        PObj_active_destroy_SET(SELF);
-
-        PMC_data(SELF) = e;
+        PObj_custom_destroy_SET(SELF);
     }
 
 /*
@@ -84,7 +79,8 @@
         PMC                 *interpreter = PMCNULL;
         STRING              *type        = NULL;
         INTVAL               priority    = 0;
-        Parrot_EventHandler_attributes *e           = NULL;
+        Parrot_EventHandler_attributes *e =
+                (Parrot_EventHandler_attributes *) PMC_data(SELF);
 
         if (VTABLE_isa(INTERP, data, CONST_STRING(INTERP, "Sub"))) {
             code = data;
@@ -104,12 +100,9 @@
             interpreter = VTABLE_get_pmc_keyed_int(INTERP,
                     INTERP->iglobals, IGLOBALS_INTERPRETER);
 
-        e = mem_allocate_zeroed_typed(Parrot_EventHandler_attributes);
-
         PObj_custom_mark_SET(SELF);
-        PObj_active_destroy_SET(SELF);
+        PObj_custom_destroy_SET(SELF);
 
-        PMC_data(SELF) = e;
         e->type        = type;
         e->code        = code;
         e->interp      = interpreter;
@@ -127,17 +120,12 @@
 */
 
     VTABLE void mark() {
-        Parrot_EventHandler_attributes *e = PMC_data_typed(SELF, Parrot_EventHandler_attributes *);
+        Parrot_EventHandler_attributes * const e = PARROT_EVENTHANDLER(SELF);
 
         if (e) {
-            if (e->type)
-                Parrot_gc_mark_PObj_alive(INTERP, (PObj *)e->type);
-
-            if (! PMC_IS_NULL(e->interp))
-                Parrot_gc_mark_PObj_alive(INTERP, (PObj *)e->interp);
-
-            if (! PMC_IS_NULL(e->code))
-                Parrot_gc_mark_PObj_alive(INTERP, (PObj *)e->code);
+            Parrot_gc_mark_STRING_alive(INTERP, e->type);
+            Parrot_gc_mark_PMC_alive(INTERP, e->interp);
+            Parrot_gc_mark_PMC_alive(INTERP, e->code);
 
             SUPER();
         }
@@ -154,7 +142,7 @@
 */
 
     VTABLE void set_string(STRING *type) {
-        Parrot_EventHandler_attributes *e = PMC_data_typed(SELF, Parrot_EventHandler_attributes *);
+        Parrot_EventHandler_attributes * const e = PARROT_EVENTHANDLER(SELF);
 
         if (e)
             e->type = type;
@@ -171,8 +159,7 @@
 */
 
     VTABLE STRING *get_string() {
-        Parrot_EventHandler_attributes *e =
-            PMC_data_typed(SELF, Parrot_EventHandler_attributes *);
+        Parrot_EventHandler_attributes * const e = PARROT_EVENTHANDLER(SELF);
 
         if (e)
             return Parrot_str_copy(INTERP, e->type);
@@ -190,7 +177,7 @@
 
 */
     VTABLE void set_integer_native(INTVAL priority) {
-        Parrot_EventHandler_attributes *e = PMC_data_typed(SELF, Parrot_EventHandler_attributes *);
+        Parrot_EventHandler_attributes * const e = PARROT_EVENTHANDLER(SELF);
 
         if (e)
             e->priority = priority;
@@ -207,8 +194,7 @@
 
 */
     VTABLE void set_pmc(PMC *interpreter) {
-        Parrot_EventHandler_attributes *e =
-            PMC_data_typed(SELF, Parrot_EventHandler_attributes *);
+        Parrot_EventHandler_attributes * const e = PARROT_EVENTHANDLER(SELF);
 
         if (e)
             e->interp = interpreter;
@@ -223,12 +209,11 @@
 */
 
     VTABLE PMC *get_attr_str(STRING *name) {
-        Parrot_EventHandler_attributes *core_struct
-            = PMC_data_typed(SELF, Parrot_EventHandler_attributes *);
+        Parrot_EventHandler_attributes * const e = PARROT_EVENTHANDLER(SELF);
         PMC *value = PMCNULL;
 
         if (Parrot_str_equal(interp, name, CONST_STRING(interp, "code"))) {
-            value = core_struct->code;
+            value = e->code;
         }
 
         return value;
@@ -244,8 +229,8 @@
 
 */
     VTABLE opcode_t *invoke(void *next) {
-        Parrot_EventHandler_attributes *e = PMC_data_typed(SELF, Parrot_EventHandler_attributes *);
-        void                *unused;
+        Parrot_EventHandler_attributes * const e = PARROT_EVENTHANDLER(SELF);
+        void *unused;
 
         /* can't invoke on INTERP and can't return its result; this may not be
          * the right interpreter */
@@ -281,8 +266,7 @@
 */
 
     METHOD can_handle(PMC *event) {
-        Parrot_EventHandler_attributes *handler_struct =
-            PMC_data_typed(SELF, Parrot_EventHandler_attributes *);
+        Parrot_EventHandler_attributes * const handler_struct = PARROT_EVENTHANDLER(SELF);
         if (event->vtable->base_type == enum_class_Task) {
             PMC *type = VTABLE_get_attr_str(interp, event, CONST_STRING(interp, "type"));
             STRING *type_str = VTABLE_get_string(interp, type);

Modified: branches/orderedhash_revamp/src/pmc/exception.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/exception.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/exception.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -50,9 +50,9 @@
 */
 
 #include "parrot/exceptions.h"
-#include "pmc_sub.h"
+#include "pmc/pmc_sub.h"
 
-pmclass Exception {
+pmclass Exception auto_attrs {
 
     ATTR INTVAL          id;           /* The task ID in the scheduler. */
     ATTR FLOATVAL        birthtime;    /* The creation time stamp of the exception. */
@@ -65,8 +65,8 @@
     ATTR PMC            *backtrace;    /* The backtrace of an exception. */
     ATTR INTVAL          handled;      /* Whether the exception has been handled. */
     ATTR PMC            *handler_iter; /* An iterator of handlers (for rethrow). */
-    ATTR Parrot_Context *handler_ctx;  /* A stored context for handler iterator. */
-    ATTR Parrot_Context *thrower;      /* The position we were at when thrown. */
+    ATTR PMC            *handler_ctx;  /* A stored context for handler iterator. */
+    ATTR PMC            *thrower;      /* The position we were at when thrown. */
 
 /*
 
@@ -83,22 +83,16 @@
 */
 
     VTABLE void init() {
-        Parrot_Exception_attributes * const core_struct =
-            mem_allocate_zeroed_typed(Parrot_Exception_attributes);
-
         /* Set flags for custom GC mark and destroy. */
         PObj_custom_mark_SET(SELF);
-        PObj_active_destroy_SET(SELF);
 
-        /* Set up the core struct and default values for the exception object. */
-        PMC_data(SELF)            = core_struct;
-        core_struct->severity     = EXCEPT_error;
-        core_struct->handled      = 0;
-        core_struct->message      = CONST_STRING(interp, "");
-        core_struct->payload      = PMCNULL;
-        core_struct->resume       = PMCNULL;
-        core_struct->backtrace    = PMCNULL;
-        core_struct->handler_iter = PMCNULL;
+        SET_ATTR_severity(INTERP, SELF, EXCEPT_error);
+        SET_ATTR_handled(INTERP, SELF, 0);
+        SET_ATTR_message(INTERP, SELF, NULL);
+        SET_ATTR_payload(INTERP, SELF, PMCNULL);
+        SET_ATTR_resume(INTERP, SELF, PMCNULL);
+        SET_ATTR_backtrace(INTERP, SELF, PMCNULL);
+        SET_ATTR_handler_iter(INTERP, SELF, PMCNULL);
     }
 
 /*
@@ -112,31 +106,35 @@
 */
 
     VTABLE void init_pmc(PMC *values) {
-        STRING * const severity = CONST_STRING(interp, "severity");
-        STRING * const message  = CONST_STRING(interp, "message");
-
-        Parrot_Exception_attributes * const core_struct =
-            mem_allocate_zeroed_typed(Parrot_Exception_attributes);
+        INTVAL severity_val;
+        STRING *message_val;
 
         INTVAL ishash = VTABLE_isa(interp, values, CONST_STRING(interp, 'Hash'));
 
-        /* Set flags for custom GC mark and destroy. */
+        if (ishash) {
+            STRING * const severity = CONST_STRING(interp, "severity");
+            STRING * const message  = CONST_STRING(interp, "message");
+            severity_val = VTABLE_get_integer_keyed_str(interp, values, severity);
+            message_val = VTABLE_get_string_keyed_str(interp, values, message);
+        }
+        else {
+            severity_val = EXCEPT_error;
+            message_val  = VTABLE_get_string(interp, values);
+        }
+
+        /* Set flags for custom GC mark. */
         PObj_custom_mark_SET(SELF);
-        PObj_active_destroy_SET(SELF);
 
         /* Set up the core struct and default values for the exception object. */
-        PMC_data(SELF)            = core_struct;
-        core_struct->severity     = ishash
-            ? VTABLE_get_integer_keyed_str(interp, values, severity)
-            : (INTVAL) EXCEPT_error;
-        core_struct->handled      = 0;
-        core_struct->message      = ishash
-            ? VTABLE_get_string_keyed_str(interp, values, message)
-            : VTABLE_get_string(interp, values);
-        core_struct->payload      = PMCNULL;
-        core_struct->resume       = PMCNULL;
-        core_struct->backtrace    = PMCNULL;
-        core_struct->handler_iter = PMCNULL;
+
+        SET_ATTR_severity(INTERP, SELF, severity_val);
+        SET_ATTR_handled(INTERP, SELF, 0);
+        SET_ATTR_message(INTERP, SELF, message_val);
+        SET_ATTR_payload(INTERP, SELF, PMCNULL);
+        SET_ATTR_resume(INTERP, SELF, PMCNULL);
+        SET_ATTR_backtrace(INTERP, SELF, PMCNULL);
+        SET_ATTR_handler_iter(INTERP, SELF, PMCNULL);
+
     }
 
 /*
@@ -151,34 +149,13 @@
 
     VTABLE void mark() {
         Parrot_Exception_attributes * const core_struct = PARROT_EXCEPTION(SELF);
-        if (core_struct->message)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)core_struct->message);
-        if (core_struct->payload)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)core_struct->payload);
-        if (core_struct->resume)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)core_struct->resume);
-        if (core_struct->backtrace)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)core_struct->backtrace);
-        if (core_struct->handler_iter)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)core_struct->handler_iter);
-    }
-
-/*
-
-=item C<void destroy()>
-
-Destroys the exception.
-
-=cut
-
-*/
-
-    VTABLE void destroy() {
-        Parrot_Exception_attributes * const core_struct = PARROT_EXCEPTION(SELF);
-        if (core_struct->thrower)
-            Parrot_free_context(interp, core_struct->thrower, 1);
-        if (core_struct)
-            mem_sys_free(core_struct);
+        Parrot_gc_mark_STRING_alive(interp, core_struct->message);
+        Parrot_gc_mark_PMC_alive(interp, core_struct->payload);
+        Parrot_gc_mark_PMC_alive(interp, core_struct->resume);
+        Parrot_gc_mark_PMC_alive(interp, core_struct->backtrace);
+        Parrot_gc_mark_PMC_alive(interp, core_struct->handler_iter);
+        Parrot_gc_mark_PMC_alive(interp, core_struct->handler_ctx);
+        Parrot_gc_mark_PMC_alive(interp, core_struct->thrower);
     }
 
 /*
@@ -208,6 +185,8 @@
     VTABLE STRING *get_string() {
         STRING *message;
         GET_ATTR_message(interp, SELF, message);
+        if (STRING_IS_NULL(message))
+            message = CONST_STRING(interp, "");
         return message;
     }
 
@@ -242,7 +221,7 @@
         STRING *message;
 
         if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "message"))) {
-            GET_ATTR_message(interp, SELF, message);
+            message = SELF.get_string();
         }
         else {
             /* If unknown attribute name, throw an exception. */
@@ -396,7 +375,7 @@
         STRING *name = VTABLE_get_string(INTERP, key);
 
         if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "message"))) {
-            SET_ATTR_message(interp, SELF, value);
+            SELF.set_string_native(value);
         }
         else {
             /* If unknown attribute name, throw an exception. */
@@ -495,11 +474,7 @@
     VTABLE void set_pointer(void *context) {
         Parrot_Exception_attributes * const core_struct = PARROT_EXCEPTION(SELF);
 
-        /* contexts are refcounted; increment and decrement appropriately */
-        if (core_struct->handler_ctx)
-            Parrot_free_context(interp, core_struct->handler_ctx, 1);
-        core_struct->handler_ctx = Parrot_context_ref(interp,
-                                       (Parrot_Context *)context);
+        core_struct->handler_ctx = (PMC*)context;
     }
 
 /*
@@ -588,8 +563,7 @@
                 VTABLE_set_integer_native(interp, value, handled);
         }
         else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "message"))) {
-                STRING *message;
-                GET_ATTR_message(interp, SELF, message);
+                STRING *message = SELF.get_string();
                 value = pmc_new(interp, enum_class_String);
                 VTABLE_set_string_native(interp, value, message);
         }
@@ -643,7 +617,7 @@
         }
         else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "message"))) {
             STRING *message = VTABLE_get_string(interp, value);
-            SET_ATTR_message(interp, SELF, message);
+            SELF.set_string_native(message);
         }
         else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "payload"))) {
             SET_ATTR_payload(interp, SELF, value);
@@ -659,13 +633,11 @@
         }
         else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "thrower"))) {
             /* Ensure it's a ret cont, and extract the from_ctx.
-             * XXX TT#596 - when we have Context PMCs, just take and set that. */
-            if (VTABLE_isa(interp, value, CONST_STRING(interp, "Continuation"))) {
-                Parrot_Context *ctx = PMC_cont(value)->from_ctx;
-                if (ctx) {
-                    Parrot_context_ref(interp, ctx);
+             * XXX TT #596 - when we have Context PMCs, just take and set that. */
+            if (!PMC_IS_NULL(value) && VTABLE_isa(interp, value, CONST_STRING(interp, "Continuation"))) {
+                PMC *ctx = PMC_cont(value)->from_ctx;
+                if (!PMC_IS_NULL(ctx))
                     SET_ATTR_thrower(interp, SELF, ctx);
-                }
             }
         }
         else {
@@ -728,7 +700,7 @@
         /* Get resume continuation, to find location we failed at. */
         GET_ATTR_resume(interp, SELF, resume);
         if (!PMC_IS_NULL(resume)) {
-            Parrot_cont *cont = PMC_cont(resume);
+            Parrot_Continuation_attributes *cont = PARROT_CONTINUATION(resume);
             if (cont->seg != NULL && cont->seg->annotations != NULL)
                 result = PackFile_Annotations_lookup(interp, cont->seg->annotations,
                         cont->address - cont->seg->base.data, name);
@@ -759,64 +731,24 @@
 */
 
     METHOD backtrace() {
-        PMC *result = pmc_new(interp, enum_class_ResizablePMCArray);
+        PMC *result = PMCNULL;
         PMC *resume;
-        Parrot_Context *cur_ctx;
-        Parrot_cont    *cont;
+        PMC *cur_ctx;
+        Parrot_Continuation_attributes    *cont;
 
         /* Get starting context, then loop over them. */
         GET_ATTR_resume(interp, SELF, resume);
         if (!PMC_IS_NULL(resume)) {
             /* We have a resume continuation, so we can get the address from
              * that. */
-            cont    = PMC_cont(resume);
-            cur_ctx = cont->to_ctx;
+            cont    = PARROT_CONTINUATION(resume);
+            Parrot_pcc_invoke_method_from_c_args(INTERP, cont->to_ctx, CONST_STRING(interp, "backtrace"), "P->P", resume, &result);
         }
         else {
             /* No return continuation. Assuming we're being called  */
             cont = NULL;
             GET_ATTR_thrower(interp, SELF, cur_ctx);
-        }
-
-        {
-            while (cur_ctx) {
-                PMC        *frame       = pmc_new(interp, enum_class_Hash);
-                PMC        *annotations = NULL;
-                Parrot_sub *sub;
-
-                /* Get sub and put it in the hash. */
-                PMC *sub_pmc = cur_ctx->current_sub;
-
-                if (!sub_pmc)
-                    sub_pmc = PMCNULL;
-
-                VTABLE_set_pmc_keyed_str(interp, frame, CONST_STRING(interp, "sub"), sub_pmc);
-
-                /* Look up any annotations and put them in the hash. */
-                if (!PMC_IS_NULL(sub_pmc)) {
-                    PMC_get_sub(interp, sub_pmc, sub);
-
-                    if (sub->seg->annotations) {
-                        PackFile_ByteCode *seg = sub->seg;
-                        opcode_t          *pc  = cont && cur_ctx == cont->to_ctx
-                                               ? cont->address
-                                               : cur_ctx->current_pc;
-
-                        annotations = PackFile_Annotations_lookup(interp,
-                                        seg->annotations, pc - seg->base.data,
-                                        NULL);
-                    }
-                }
-
-                if (!annotations)
-                    annotations = pmc_new(interp, enum_class_Hash);
-
-                VTABLE_set_pmc_keyed_str(interp, frame, CONST_STRING(interp, "annotations"), annotations);
-
-                /* Push frame and go to next caller. */
-                VTABLE_push_pmc(interp, result, frame);
-                cur_ctx = cur_ctx->caller_ctx;
-            }
+            Parrot_pcc_invoke_method_from_c_args(INTERP, CURRENT_CONTEXT(INTERP), CONST_STRING(interp, "backtrace"), "->P", &result);
         }
 
         RETURN(PMC *result);

Modified: branches/orderedhash_revamp/src/pmc/exceptionhandler.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/exceptionhandler.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/exceptionhandler.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -22,7 +22,7 @@
 
 #include "parrot/oplib/ops.h"
 
-pmclass ExceptionHandler extends Continuation need_ext {
+pmclass ExceptionHandler extends Continuation auto_attrs {
 
     ATTR PMC    *handled_types;
     ATTR PMC    *handled_types_except;
@@ -40,25 +40,21 @@
 */
 
     VTABLE void init() {
-        Parrot_ExceptionHandler_attributes * const core_struct =
-            mem_allocate_zeroed_typed(Parrot_ExceptionHandler_attributes);
-        Parrot_cont * const cc     = new_continuation(INTERP, NULL);
-
-        cc->invoked                = 0;
-        PMC_data(SELF)             = core_struct;
-        PMC_cont(SELF)             = cc;
-        core_struct->min_severity  = 0;
-        core_struct->max_severity  = 0;
-        core_struct->handled_types = PMCNULL;
-        core_struct->handled_types_except = PMCNULL;
+        Parrot_ExceptionHandler_attributes * const attrs = PARROT_EXCEPTIONHANDLER(SELF);
+        SUPER();
+        attrs->invoked              = 0;
+        attrs->min_severity         = 0;
+        attrs->max_severity         = 0;
+        attrs->handled_types        = PMCNULL;
+        attrs->handled_types_except = PMCNULL;
 
         /* an exception handler has no separate context; it's only a snapshot
          * of an "earlier" context, which is contained in the interpreter's
          * context - the stacks can only be deeper in the interpreter - so no
          * mark of context is needed */
         PObj_custom_mark_SET(SELF);
-        PObj_active_destroy_SET(SELF);
     }
+
 /*
 
 =item C<void mark()>
@@ -70,17 +66,16 @@
 */
 
     VTABLE void mark() {
-        Parrot_ExceptionHandler_attributes * const core_struct =
+        Parrot_ExceptionHandler_attributes * const attrs =
             PARROT_EXCEPTIONHANDLER(SELF);
-        if (core_struct->handled_types)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)core_struct->handled_types);
-        if (core_struct->handled_types_except)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)core_struct->handled_types_except);
+        Parrot_gc_mark_PMC_alive(interp, attrs->handled_types);
+        Parrot_gc_mark_PMC_alive(interp, attrs->handled_types_except);
         SUPER();
     }
 
     VTABLE PMC *clone() {
         PMC * const result = SUPER();
+        /* This looks wrong, why wouldn't we want to mark the clone? */
         PObj_custom_mark_CLEAR(result);
         return result;
     }
@@ -96,8 +91,7 @@
 */
 
     VTABLE void set_integer_native(INTVAL value) {
-        Parrot_cont * const cc = (Parrot_cont *)PMC_cont(SELF);
-        cc->invoked = value;
+        PARROT_CONTINUATION(SELF)->invoked = value;
     }
 
 /*
@@ -111,8 +105,7 @@
 */
 
     VTABLE INTVAL get_integer() {
-        const Parrot_cont * const cc = (Parrot_cont *)PMC_cont(SELF);
-        return cc->invoked;
+        return PARROT_CONTINUATION(SELF)->invoked;
     }
 
 /*
@@ -126,15 +119,14 @@
 */
 
     VTABLE opcode_t *invoke(void *next) {
-        Parrot_cont * const cc = (Parrot_cont *)PMC_cont(SELF);
-        opcode_t    * const pc = cc->address;
+        opcode_t    * const pc = PARROT_CONTINUATION(SELF)->address;
 
-        Parrot_continuation_check(interp, SELF, cc);
-        Parrot_continuation_rewind_environment(interp, SELF, cc);
+        Parrot_continuation_check(interp, SELF);
+        Parrot_continuation_rewind_environment(interp, SELF);
 
         /* switch code segment if needed */
-        if (INTERP->code != cc->seg)
-            Parrot_switch_to_cs(INTERP, cc->seg, 1);
+        if (INTERP->code != PARROT_CONTINUATION(SELF)->seg)
+            Parrot_switch_to_cs(INTERP, PARROT_CONTINUATION(SELF)->seg, 1);
 
         return pc;
     }
@@ -233,13 +225,13 @@
 */
 
     METHOD min_severity(INTVAL severity :optional, INTVAL have_severity :opt_flag) {
-        Parrot_ExceptionHandler_attributes * const core_struct =
+        Parrot_ExceptionHandler_attributes * const attrs =
                     PARROT_EXCEPTIONHANDLER(SELF);
 
         if (have_severity)
-            core_struct->min_severity = severity;
+            attrs->min_severity = severity;
         else
-            severity = core_struct->min_severity;
+            severity = attrs->min_severity;
 
         RETURN(INTVAL severity);
     }
@@ -255,13 +247,13 @@
 */
 
     METHOD max_severity(INTVAL severity :optional, INTVAL have_severity :opt_flag) {
-        Parrot_ExceptionHandler_attributes * const core_struct =
+        Parrot_ExceptionHandler_attributes * const attrs =
                     PARROT_EXCEPTIONHANDLER(SELF);
 
         if (have_severity)
-            core_struct->max_severity = severity;
+            attrs->max_severity = severity;
         else
-            severity = core_struct->max_severity;
+            severity = attrs->max_severity;
 
         RETURN(INTVAL severity);
     }
@@ -277,9 +269,9 @@
 */
 
     METHOD handle_types(PMC *types :slurpy) {
-        Parrot_ExceptionHandler_attributes * const core_struct =
+        Parrot_ExceptionHandler_attributes * const attrs =
                     PARROT_EXCEPTIONHANDLER(SELF);
-        core_struct->handled_types =
+        attrs->handled_types =
             VTABLE_elements(interp, types) > 0
                 ? types
                 : PMCNULL;
@@ -296,9 +288,9 @@
 */
 
     METHOD handle_types_except(PMC *types :slurpy) {
-        Parrot_ExceptionHandler_attributes * const core_struct =
+        Parrot_ExceptionHandler_attributes * const attrs =
                     PARROT_EXCEPTIONHANDLER(SELF);
-        core_struct->handled_types_except =
+        attrs->handled_types_except =
             VTABLE_elements(interp, types) > 0
                 ? types
                 : PMCNULL;

Modified: branches/orderedhash_revamp/src/pmc/exporter.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/exporter.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/exporter.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -90,7 +90,7 @@
 
 */
 
-pmclass Exporter need_ext {
+pmclass Exporter auto_attrs {
 
     ATTR PMC *ns_src;
     ATTR PMC *ns_dest;
@@ -107,36 +107,15 @@
 */
 
     VTABLE void init() {
-        Parrot_Exporter_attributes * const exp =
-            mem_allocate_zeroed_typed(Parrot_Exporter_attributes);
-
         /* Set up the object. */
-        exp->ns_src          = PMCNULL;
-        exp->ns_dest         = CONTEXT(interp)->current_namespace;
-        exp->globals         = PMCNULL;
-        PMC_data(SELF)       = exp;
+        SET_ATTR_ns_src(INTERP, SELF, PMCNULL);
+        SET_ATTR_ns_dest(INTERP, SELF, Parrot_pcc_get_namespace(INTERP, CURRENT_CONTEXT(INTERP)));
+        SET_ATTR_globals(INTERP, SELF, PMCNULL);
 
         /* Set flags for custom GC mark and destroy. */
         PObj_custom_mark_SET(SELF);
-        PObj_active_destroy_SET(SELF);
-    }
-
-
-/*
-
-=item C<void destroy()>
-
-Free the memory associated with the object's underlying struct.
-
-=cut
-
-*/
-
-    VTABLE void destroy() {
-        mem_sys_free(PMC_data(SELF));
     }
 
-
 /*
 
 =item C<void mark()>
@@ -148,14 +127,16 @@
 */
 
     VTABLE void mark() {
-        Parrot_Exporter_attributes * const exp = PARROT_EXPORTER(SELF);
-
-        if (exp->ns_src)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)exp->ns_src);
-        if (exp->ns_dest)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)exp->ns_dest);
-        if (exp->globals)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)exp->globals);
+        PMC *ns_src;
+        PMC *ns_dest;
+        PMC *globals;
+        GET_ATTR_ns_src(INTERP, SELF, ns_src);
+        GET_ATTR_ns_dest(INTERP, SELF, ns_dest);
+        GET_ATTR_globals(INTERP, SELF, globals);
+
+        Parrot_gc_mark_PMC_alive(interp, ns_src);
+        Parrot_gc_mark_PMC_alive(interp, ns_dest);
+        Parrot_gc_mark_PMC_alive(interp, globals);
     }
 
 

Modified: branches/orderedhash_revamp/src/pmc/file.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/file.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/file.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -22,7 +22,7 @@
 #  include <direct.h>
 #endif
 
-/* RT#46681 apparently, strerror_r is thread-safe and should be used instead.*/
+/* TT #1050 apparently, strerror_r is thread-safe and should be used instead.*/
 
 static PMC *File_PMC;
 pmclass File singleton {

Modified: branches/orderedhash_revamp/src/pmc/filehandle.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/filehandle.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/filehandle.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -31,12 +31,13 @@
 #endif
 #endif
 
-pmclass FileHandle extends Handle {
+pmclass FileHandle extends Handle auto_attrs {
     ATTR INTVAL flags;                /* Filehandle flags             */
     ATTR STRING *filename;            /* The opened path and filename */
     ATTR STRING *mode;                /* The mode string used in open */
     ATTR STRING *encoding;            /* The encoding for read/write  */
     ATTR INTVAL process_id;           /* Child process on pipes       */
+    ATTR INTVAL exit_status;          /* Child exit status on pipes   */
     ATTR PIOOFF_T file_size;          /* Current file size            */
     ATTR PIOOFF_T file_pos;           /* Current real file pointer    */
     ATTR PIOOFF_T last_pos;           /* Last file position           */
@@ -48,8 +49,7 @@
 
 /*
  * Using INTVAL for process_id is a temporary solution.
- * We may need to define a custom type to store it in a platform
- * dependant way.
+ * We may need to define a custom type to store it in a platform dependant way.
  */
 
 /*
@@ -64,14 +64,14 @@
 
     VTABLE void init() {
         Parrot_FileHandle_attributes * const data_struct =
-                mem_allocate_typed(Parrot_FileHandle_attributes);
+            PMC_data_typed(SELF, Parrot_FileHandle_attributes *);
 
-        PMC_data(SELF)             = data_struct;
         data_struct->flags         = 0;
         data_struct->filename      = NULL;
         data_struct->mode          = NULL;
         data_struct->encoding      = NULL;
         data_struct->process_id    = 0;
+        data_struct->exit_status   = 0;
         data_struct->file_size     = 0;
         data_struct->file_pos      = piooffsetzero;
         data_struct->last_pos      = piooffsetzero;
@@ -81,13 +81,14 @@
         data_struct->buffer_end    = NULL;
         data_struct->buffer_next   = NULL;
 
-        /* Initialize the os_handle to the platform-specific value for closed. */
+        /* Initialize the os_handle to the platform-specific value for closed */
         data_struct->os_handle     = (PIOHANDLE) PIO_INVALID_HANDLE;
 
         PObj_custom_mark_SET(SELF);
-        PObj_active_destroy_SET(SELF);
+        PObj_custom_destroy_SET(SELF);
     }
 
+
 /*
 
 =item C<PMC *clone()>
@@ -99,15 +100,18 @@
 */
 
     VTABLE PMC *clone() {
-        Parrot_FileHandle_attributes * const old_struct  = PARROT_FILEHANDLE(SELF);
+        Parrot_FileHandle_attributes * const old_struct
+            = PARROT_FILEHANDLE(SELF);
         PMC * const copy = Parrot_io_new_pmc(interp, old_struct->flags);
-        Parrot_FileHandle_attributes * const data_struct = PARROT_FILEHANDLE(copy);
+        Parrot_FileHandle_attributes * const data_struct
+            = PARROT_FILEHANDLE(copy);
 
-        data_struct->os_handle    = Parrot_dup(old_struct->os_handle);
+        data_struct->os_handle = (PIOHANDLE)Parrot_dup(old_struct->os_handle);
 
         return copy;
     }
 
+
 /*
 
 =item C<void mark()>
@@ -119,15 +123,15 @@
 */
 
     VTABLE void mark() {
-        Parrot_FileHandle_attributes * const data_struct = PARROT_FILEHANDLE(SELF);
-        if (data_struct->mode)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)data_struct->mode);
-        if (data_struct->filename)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)data_struct->filename);
-        if (data_struct->encoding)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)data_struct->encoding);
+        Parrot_FileHandle_attributes * const data_struct
+            = PARROT_FILEHANDLE(SELF);
+
+        Parrot_gc_mark_STRING_alive(interp, data_struct->mode);
+        Parrot_gc_mark_STRING_alive(interp, data_struct->filename);
+        Parrot_gc_mark_STRING_alive(interp, data_struct->encoding);
     }
 
+
 /*
 
 =item C<void destroy()>
@@ -150,12 +154,10 @@
 
             if (data_struct->buffer_start)
                 mem_sys_free(data_struct->buffer_start);
-
-            mem_sys_free(PARROT_FILEHANDLE(SELF));
-            PMC_data(SELF) = NULL;
         }
     }
 
+
 /*
 
 =item C<INTVAL get_integer_keyed_int(INTVAL key)>
@@ -170,15 +172,17 @@
     VTABLE INTVAL get_integer_keyed_int(INTVAL key) {
         INTVAL result;
         switch (key) {
-            case 0:
-                GET_ATTR_process_id(INTERP, SELF, result);
-                break;
-            default:
-                result = 0;
+          case 0:
+            GET_ATTR_process_id(INTERP, SELF, result);
+            break;
+          default:
+            result = 0;
         }
+
         return result;
     }
 
+
 /*
 
 =item C<void set_integer_keyed_int(INTVAL key, INTVAL value)>
@@ -192,14 +196,15 @@
 
     VTABLE void set_integer_keyed_int(INTVAL key, INTVAL value) {
         switch (key) {
-            case 0:
-                SET_ATTR_process_id(INTERP, SELF, value);
-                break;
-            default:
-                break;
+          case 0:
+            SET_ATTR_process_id(INTERP, SELF, value);
+            break;
+          default:
+            break;
         }
     }
 
+
 /*
 
 =item C<INTVAL get_bool()>
@@ -236,7 +241,7 @@
 
     METHOD open(STRING *filename :optional, INTVAL got_filename :opt_flag,
         STRING *mode :optional, INTVAL got_mode :opt_flag) {
-        PMC *filehandle;
+        PMC    *filehandle;
         STRING *open_filename, *open_mode;
 
         if (!Parrot_io_is_closed_filehandle(INTERP, SELF))
@@ -249,12 +254,10 @@
         if (got_filename && !STRING_IS_NULL(filename))
             SET_ATTR_filename(INTERP, SELF, Parrot_str_copy(INTERP, filename));
 
-        /* Open the file. When no options are passed, reopen the same file as
-         * before */
+        /* Open the file. With no options, reopen the same file as before */
         GET_ATTR_filename(INTERP, SELF, open_filename);
         GET_ATTR_mode(INTERP, SELF, open_mode);
 
-
         if (STRING_IS_NULL(open_filename))
             Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
                             "Cannot open filehandle, no filename");
@@ -269,6 +272,7 @@
         RETURN(PMC *filehandle);
     }
 
+
 /*
 
 =item C<METHOD isatty()>
@@ -277,7 +281,8 @@
 
 */
     METHOD isatty() {
-        const INTVAL isatty = (PARROT_FILEHANDLE(SELF)->flags & PIO_F_CONSOLE) == PIO_F_CONSOLE;
+        const INTVAL isatty =
+            (PARROT_FILEHANDLE(SELF)->flags & PIO_F_CONSOLE) == PIO_F_CONSOLE;
         RETURN(INTVAL isatty);
     }
 
@@ -296,6 +301,7 @@
         RETURN(INTVAL status);
     }
 
+
 /*
 
 =item C<METHOD is_closed()>
@@ -311,6 +317,7 @@
         RETURN(INTVAL status);
     }
 
+
 /*
 
 =item C<METHOD read(INTVAL bytes)>
@@ -327,6 +334,7 @@
         RETURN(STRING *string_result);
     }
 
+
 /*
 
 =item C<METHOD readline()>
@@ -342,6 +350,7 @@
         RETURN(STRING *string_result);
     }
 
+
 /*
 
 =item C<METHOD readline_interactive(STRING *prompt)>
@@ -352,8 +361,10 @@
 
 */
 
-    METHOD readline_interactive(STRING *prompt :optional, INTVAL got_prompt :opt_flag) {
+    METHOD readline_interactive(STRING *prompt     :optional,
+                                INTVAL  got_prompt :opt_flag) {
         STRING *string_result = NULL;
+
 #ifdef PARROT_HAS_READLINE
     /* 4-column indent to get c_indent.t to DTRT */
         char * const r = readline(got_prompt ? prompt->strstart : NULL);
@@ -373,21 +384,23 @@
             Parrot_io_setlinebuf(INTERP, SELF);
 
         string_result = Parrot_io_reads(INTERP, SELF, 0);
+
         if (string_result) {
             UINTVAL len = Parrot_str_byte_length(INTERP, string_result);
             if (len < 1)
                 string_result = NULL;
             else {
-                while (len > 0 &&
-                        (((char*)string_result->strstart)[len - 1] == '\n' ||
-                         ((char*)string_result->strstart)[len - 1] == '\r')) {
-                    --len;
-                    --string_result->strlen;
-                    --string_result->bufused;
+                while (len > 0
+                &&    (((char *)string_result->strstart)[len - 1] == '\n'
+                  ||   ((char *)string_result->strstart)[len - 1] == '\r')) {
+                        --len;
+                        --string_result->strlen;
+                        --string_result->bufused;
                 }
             }
         }
 #endif
+
         if (string_result)
             RETURN(STRING *string_result);
         else
@@ -423,16 +436,20 @@
 
         if (got_name) {
             /* called as class method - open, slurp, close file */
-            PMC *filehandle;
+            PMC    *filehandle;
             STRING *encoding;
-            size_t size;
+            size_t  size;
+
             GET_ATTR_encoding(INTERP, SELF, encoding);
-            if (!Parrot_io_is_closed_filehandle(INTERP, SELF)) {
+
+            if (!Parrot_io_is_closed_filehandle(INTERP, SELF))
                 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
-                                "Cannot readall on a new file from an already open filehandle");
-            }
+                    "Cannot readall on a new file from an already open filehandle");
+
             filehandle  = Parrot_io_open(INTERP, PMCNULL, name, NULL);
+
             PARROT_ASSERT(filehandle->vtable->base_type == enum_class_FileHandle);
+
             SET_ATTR_encoding(INTERP, filehandle, encoding);
             size = (size_t)(Parrot_stat_info_intval(INTERP, name, STAT_FILESIZE));
 
@@ -442,10 +459,10 @@
         }
         else {
             /* slurp open file */
-            if (Parrot_io_is_closed_filehandle(INTERP, SELF)) {
+            if (Parrot_io_is_closed_filehandle(INTERP, SELF))
                 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
-                                "Cannot readall without a file name or open filehandle");
-            }
+                    "Cannot readall without a file name or open filehandle");
+
             result = Parrot_str_new_noinit(INTERP, enum_stringrep_one, 0);
 
             /* Do line buffering on the filehandle */
@@ -454,8 +471,8 @@
 
             do {
                 STRING * const part = Parrot_io_reads(INTERP, SELF, 0);
-
                 result = Parrot_str_append(INTERP, result, part);
+
                 if (Parrot_io_eof(INTERP, SELF))
                     break;
             } while (1);
@@ -464,6 +481,7 @@
         RETURN(STRING *result);
     }
 
+
 /*
 
 =item C<METHOD flush()>
@@ -495,6 +513,7 @@
         Parrot_io_putps(interp, SELF, string_to_print);
     }
 
+
 /*
 
 =item C<METHOD puts(STRING *value)>
@@ -510,6 +529,7 @@
         RETURN(INTVAL status);
     }
 
+
 /*
 
 =item C<METHOD buffer_type(STRING *new_type :optional)>
@@ -536,10 +556,10 @@
 */
 
     METHOD buffer_type(STRING *new_type :optional, INTVAL got_type :opt_flag) {
-        INTVAL flags;
         STRING * const nobuffer_string   = CONST_STRING(INTERP, "unbuffered");
         STRING * const linebuffer_string = CONST_STRING(INTERP, "line-buffered");
         STRING * const fullbuffer_string = CONST_STRING(INTERP, "full-buffered");
+        INTVAL flags;
 
         if (got_type) {
             if (Parrot_str_equal(INTERP, new_type, nobuffer_string))
@@ -558,9 +578,9 @@
             RETURN(STRING *fullbuffer_string);
 
         RETURN(STRING *nobuffer_string);
-
     }
 
+
 /*
 
 =item C<METHOD buffer_size(INTVAL new_size :optional)>
@@ -574,16 +594,15 @@
     METHOD buffer_size(INTVAL new_size :optional, INTVAL got_size :opt_flag) {
         INTVAL buffer_size;
 
-        if (got_size) {
-            Parrot_io_setbuf(INTERP, SELF, (size_t) new_size);
-        }
+        if (got_size)
+            Parrot_io_setbuf(INTERP, SELF, (size_t)new_size);
 
-        buffer_size = (INTVAL) Parrot_io_get_buffer_size(INTERP, SELF);
+        buffer_size = (INTVAL)Parrot_io_get_buffer_size(INTERP, SELF);
 
         RETURN(INTVAL buffer_size);
-
     }
 
+
 /*
 
 =item C<METHOD mode()>
@@ -601,9 +620,9 @@
         mode_copy = Parrot_str_copy(INTERP, mode);
 
         RETURN(STRING *mode_copy);
-
     }
 
+
 /*
 
 =item C<METHOD encoding(STRING *new_encoding)>
@@ -631,9 +650,9 @@
             encoding_copy = Parrot_str_copy(INTERP, encoding);
 
         RETURN(STRING *encoding_copy);
-
     }
 
+
 /*
 
 =item C<METHOD eof()>
@@ -649,6 +668,21 @@
         RETURN(INTVAL flags);
     }
 
+/*
+
+=item C<METHOD exit_status()>
+
+If this is a pipe, return the exit status of the child process.
+
+=cut
+
+*/
+    METHOD exit_status() {
+        INTVAL exit_status;
+        GET_ATTR_exit_status(INTERP, SELF, exit_status);
+        RETURN(INTVAL exit_status);
+    }
+
 
 /*
 
@@ -663,13 +697,14 @@
 
     METHOD get_fd() {
 #ifndef PIO_OS_STDIO
-        INTVAL os_handle;
+        PIOHANDLE os_handle;
+        INTVAL    fd;
         GET_ATTR_os_handle(INTERP, SELF, os_handle);
-        RETURN(INTVAL os_handle);
+        fd = (INTVAL)os_handle;
+        RETURN(INTVAL fd);
 #endif /*PIO_OS_STDIO*/
 
         RETURN(INTVAL -1);
-
     }
 
 

Modified: branches/orderedhash_revamp/src/pmc/fixedbooleanarray.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/fixedbooleanarray.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/fixedbooleanarray.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -17,13 +17,25 @@
 
 =over 4
 
+=item C<static UINTVAL get_size_in_bytes(UINTVAL size)>
+
+Auxiliar function to avoid repeating the size evaluation.
+
 =cut
 
 */
 
 #define BITS_PER_CHAR 8
 
-pmclass FixedBooleanArray need_ext provides array {
+PARROT_INLINE
+static UINTVAL
+get_size_in_bytes(UINTVAL size)
+{
+    return (size + BITS_PER_CHAR - 1) / BITS_PER_CHAR;
+}
+
+
+pmclass FixedBooleanArray auto_attrs provides array {
     ATTR UINTVAL         size;             /* # of bits this fba holds */
     ATTR UINTVAL         resize_threshold; /* max capacity before resizing */
     ATTR unsigned char * bit_array;        /* where the bits go */
@@ -32,7 +44,7 @@
 
 =back
 
-=head2 Methods
+=head2 Vtable functions
 
 =over 4
 
@@ -45,11 +57,7 @@
 */
 
     VTABLE void init() {
-        Parrot_FixedBooleanArray_attributes* attrs =
-            mem_allocate_zeroed_typed(Parrot_FixedBooleanArray_attributes);
-
-        PMC_data(SELF) = attrs;
-        PObj_active_destroy_SET(SELF);
+        PObj_custom_destroy_SET(SELF);
     }
 
 /*
@@ -67,7 +75,6 @@
         GET_ATTR_bit_array(INTERP, SELF, bit_array);
         if (bit_array)
             mem_sys_free(bit_array);
-        mem_sys_free(PMC_data(SELF));
     }
 
 /*
@@ -90,19 +97,18 @@
         GET_ATTR_resize_threshold(INTERP, SELF, resize_threshold);
 
         if (my_bit_array) {
-            size_t size_in_bytes;
+            const size_t size_in_bytes = get_size_in_bytes(resize_threshold);
 
             SET_ATTR_size(INTERP, dest, size);
             SET_ATTR_resize_threshold(INTERP, dest, resize_threshold);
 
-            size_in_bytes   = resize_threshold / BITS_PER_CHAR;
             clone_bit_array = (unsigned char*)mem_sys_allocate(size_in_bytes);
             mem_sys_memcopy(clone_bit_array, my_bit_array, size_in_bytes);
 
             SET_ATTR_bit_array(INTERP, dest, clone_bit_array);
         }
 
-        PObj_active_destroy_SET(dest);
+        PObj_custom_destroy_SET(dest);
         return dest;
     }
 
@@ -322,7 +328,7 @@
 */
 
     VTABLE void set_integer_native(INTVAL size) {
-        size_t size_in_bytes;
+        const size_t size_in_bytes = get_size_in_bytes(size);
         UINTVAL old_size;
 
         GET_ATTR_size(INTERP, SELF, old_size);
@@ -331,7 +337,6 @@
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
                 "FixedBooleanArray: Can't resize!");
 
-        size_in_bytes = size / BITS_PER_CHAR + 1;
         SET_ATTR_size(INTERP, SELF, size);
         SET_ATTR_resize_threshold(INTERP, SELF, size_in_bytes * BITS_PER_CHAR);
         SET_ATTR_bit_array(INTERP, SELF,
@@ -479,22 +484,6 @@
 
 /*
 
-=item C<void push_integer(INTVAL value)>
-
-Extends the array by adding an element of value C<value> to the end of
-the array.
-
-=cut
-
-*/
-
-    VTABLE void push_integer(INTVAL value) {
-        const INTVAL nextix = SELF.elements();
-        SELF.set_integer_keyed_int(nextix, value);
-    }
-
-/*
-
 =item C<PMC *get_iter()>
 
 Return a new iterator for SELF.
@@ -527,7 +516,6 @@
     VTABLE void freeze(visit_info *info) {
         UINTVAL          size, resize_threshold;
         unsigned char  * bit_array;
-        IMAGE_IO * const io = info->image_io;
         STRING   *       s;
         GET_ATTR_size(INTERP, SELF, size);
         GET_ATTR_resize_threshold(INTERP, SELF, resize_threshold);
@@ -536,8 +524,8 @@
         s = Parrot_str_new(INTERP, (char*)bit_array,
                 (resize_threshold / BITS_PER_CHAR));
 
-        VTABLE_push_integer(INTERP, io, size);
-        VTABLE_push_string(INTERP, io, s);
+        VTABLE_push_integer(INTERP, info, size);
+        VTABLE_push_string(INTERP, info, s);
     }
 
 /*
@@ -550,26 +538,31 @@
 
 */
     VTABLE void thaw(visit_info *info) {
-        IMAGE_IO * const io = info->image_io;
         SUPER(info);
 
-        if (info->extra_flags == EXTRA_IS_NULL) {
+        {
             unsigned char * bit_array;
-            const INTVAL    size      = VTABLE_shift_integer(INTERP, io);
-            STRING * const  s         = VTABLE_shift_string(INTERP, io);
+            UINTVAL         threshold;
+            const INTVAL    size      = VTABLE_shift_integer(INTERP, info);
+            STRING * const  s         = VTABLE_shift_string(INTERP, info);
 
-            bit_array = (unsigned char*)mem_sys_allocate_zeroed(s->bufused);
-            mem_sys_memcopy(bit_array, s->strstart, s->bufused);
+            bit_array = (unsigned char *)Parrot_str_to_cstring(INTERP, s);
+            threshold = Parrot_str_byte_length(interp, s) * BITS_PER_CHAR;
 
             SET_ATTR_size(INTERP, SELF, size);
-            SET_ATTR_resize_threshold(INTERP, SELF,
-                    s->bufused * BITS_PER_CHAR);
+            SET_ATTR_resize_threshold(INTERP, SELF, threshold);
             SET_ATTR_bit_array(INTERP, SELF, bit_array);
         }
     }
 
 /*
 
+=back
+
+=head2 Methods
+
+=over 4
+
 =item C<METHOD fill(INTVAL fill)>
 
 Sets all of the entires to true if fill is a true value, otherwise
@@ -582,16 +575,14 @@
     METHOD fill(INTVAL fill) {
         UINTVAL         size;
         unsigned char * bit_array;
-        size_t          j;
+        size_t          size_in_bytes;
 
         GET_ATTR_bit_array(INTERP, SELF, bit_array);
         GET_ATTR_size(INTERP, SELF, size);
-        j  = size / BITS_PER_CHAR + 1;
+        size_in_bytes  = get_size_in_bytes(size);
 
-        if (fill)
-            memset(bit_array, 0xff, j);
-        else
-            memset(bit_array, 0, j);
+        if (size_in_bytes)
+            memset(bit_array, fill ? 0xff : 0, size_in_bytes);
     }
 }
 

Modified: branches/orderedhash_revamp/src/pmc/fixedfloatarray.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/fixedfloatarray.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/fixedfloatarray.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -19,7 +19,7 @@
 
 */
 
-pmclass FixedFloatArray need_ext provides array {
+pmclass FixedFloatArray auto_attrs provides array {
     ATTR INTVAL    size;
     ATTR FLOATVAL *float_array;
 
@@ -31,22 +31,6 @@
 
 =over 4
 
-=item C<void init()>
-
-Initializes the array.
-
-=cut
-
-*/
-
-    VTABLE void init() {
-        Parrot_FixedFloatArray_attributes* attrs =
-            mem_allocate_zeroed_typed(Parrot_FixedFloatArray_attributes);
-        PMC_data(SELF) = attrs;
-    }
-
-/*
-
 =item C<void destroy()>
 
 Destroys the array.
@@ -60,8 +44,6 @@
         GET_ATTR_float_array(INTERP, SELF, float_array);
         if (float_array)
             mem_sys_free(float_array);
-
-        mem_sys_free(PMC_data(SELF));
     }
 
 /*
@@ -91,7 +73,7 @@
         dest_float_array  = (FLOATVAL*)mem_sys_allocate(mem_size);
         mem_sys_memcopy(dest_float_array, self_float_array, mem_size);
         SET_ATTR_float_array(INTERP, dest, dest_float_array);
-        PObj_active_destroy_SET(dest);
+        PObj_custom_destroy_SET(dest);
 
         return dest;
     }
@@ -308,7 +290,7 @@
         SET_ATTR_size(INTERP, SELF, new_size);
         SET_ATTR_float_array(INTERP, SELF,
                 mem_allocate_n_typed(new_size, FLOATVAL));
-        PObj_active_destroy_SET(SELF);
+        PObj_custom_destroy_SET(SELF);
     }
 
 /*

Modified: branches/orderedhash_revamp/src/pmc/fixedintegerarray.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/fixedintegerarray.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/fixedintegerarray.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -19,7 +19,7 @@
 
 */
 
-pmclass FixedIntegerArray need_ext provides array {
+pmclass FixedIntegerArray auto_attrs provides array {
     ATTR INTVAL   size;  /* number of INTVALs stored in this array */
     ATTR INTVAL * int_array; /* INTVALs are stored here */
 
@@ -40,103 +40,7 @@
 */
 
     VTABLE void init() {
-        Parrot_FixedIntegerArray_attributes* attrs =
-            mem_allocate_zeroed_typed(Parrot_FixedIntegerArray_attributes);
-        PMC_data(SELF) = attrs;
-        PObj_active_destroy_SET(SELF);
-    }
-
-/*
-
-=item C<PMC instantiate_str(STRING *rep, INTVAL flags)>
-
-Class method to construct an array from the string representation C<rep>,
-which is a string I<"(el0, el1, ...)">. C<flags> may have the
-C<PObj_constant_FLAG> bit set, which will be honored to create a PMC
-in the constant PMC pool.
-
-=cut
-
-*/
-    VTABLE PMC *instantiate_str(STRING *rep, INTVAL flags) {
-        const INTVAL type = SELF->vtable->base_type;
-        INTVAL  n, elem, i, l;
-        char   *source, *p, *start;
-        int     base;
-
-        if (flags & PObj_constant_FLAG)
-            SELF = constant_pmc_new(INTERP, type);
-        else
-            SELF = pmc_new(INTERP, type);
-
-        l = Parrot_str_byte_length(INTERP, rep);
-
-        if (!l)
-            return SELF;
-
-        if (rep->encoding != Parrot_fixed_8_encoding_ptr)
-            Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_ENCODING,
-                    "unhandled string encoding in constructor");
-
-        source = Parrot_str_to_cstring(interp, rep);
-
-        /* "()" - no args */
-        if (l <= 2 && *source == '(') {
-            Parrot_str_free_cstring(source);
-            return SELF;
-        }
-
-        /* count commas */
-        p = source;
-        n = 0;
-        while (*p) {
-            if (*p == ',')
-                ++n;
-            p++;
-        }
-
-        /* presize the array */
-        SELF.set_integer_native(n + 1);
-
-        /* parse string */
-        p = source;
-
-        for (i = l, n = 0; i; --i, ++p) {
-            switch (*p) {
-                case ' ': continue;
-                case '\t': continue;
-                case '(': continue;
-                case ')': break;
-                case ',':
-                          n++;
-                          break;
-                default:
-                          base = 10;
-                          if (*p == '0') {
-                              ++p;
-                              --i;
-                              if (*p == 'b' || *p == 'B') {
-                                  base = 2;
-                                  ++p;
-                                  --i;
-                              }
-                              else if (*p == 'x' || *p == 'X') {
-                                  base = 16;
-                                  ++p;
-                                  --i;
-                              }
-                          }
-                          start = p;
-                          elem  = strtoul(p, &p, base);
-                          --p;
-                          i -= (p - start);
-                          SELF.set_integer_keyed_int(n, elem);
-                          break;
-            }
-        }
-
-        Parrot_str_free_cstring(source);
-        return SELF;
+        PObj_custom_destroy_SET(SELF);
     }
 
 /*
@@ -154,7 +58,6 @@
         GET_ATTR_int_array(INTERP, SELF, int_array);
         if (int_array)
             mem_sys_free(int_array);
-        mem_sys_free(PMC_data(SELF));
     }
 
 /*
@@ -194,7 +97,7 @@
             SET_ATTR_int_array(INTERP, dest, dest_int_array);
 
             mem_sys_memcopy(dest_int_array, int_array, size * sizeof (INTVAL));
-            PObj_active_destroy_SET(dest);
+            PObj_custom_destroy_SET(dest);
         }
 
         return dest;
@@ -436,7 +339,7 @@
         GET_ATTR_int_array(INTERP, SELF, int_array);
         SET_ATTR_int_array(INTERP, SELF,
                 mem_realloc_n_typed(int_array, size, INTVAL));
-        PObj_active_destroy_SET(SELF);
+        PObj_custom_destroy_SET(SELF);
     }
 
 /*
@@ -588,6 +491,38 @@
 
 /*
 
+=item C<INTVAL is_equal(PMC *value)>
+
+The C<==> operation. Compares two array to hold equal elements.
+
+=cut
+
+*/
+
+    VTABLE INTVAL is_equal(PMC *value) {
+        INTVAL j, n;
+
+        if (value->vtable->base_type != SELF->vtable->base_type)
+            return 0;
+
+        n = SELF.elements();
+
+        if (VTABLE_elements(INTERP, value) != n)
+            return 0;
+
+        for (j = 0; j < n; ++j) {
+            INTVAL item1 = SELF.get_integer_keyed_int(j);
+            INTVAL item2 = VTABLE_get_integer_keyed_int(INTERP, value, j);
+
+            if (item1 != item2)
+                return 0;
+        }
+
+        return 1;
+    }
+
+/*
+
 =item C<PMC *get_iter()>
 
 Return a new Iterator for this PMC.
@@ -625,47 +560,37 @@
     }*/
 
     VTABLE void freeze(visit_info *info) {
-        IMAGE_IO *io = info->image_io;
         INTVAL   *int_array;
         INTVAL    i, n;
 
         SUPER(info);
 
         GET_ATTR_size(INTERP, SELF, n);
-        VTABLE_push_integer(INTERP, io, n);
+        VTABLE_push_integer(INTERP, info, n);
         GET_ATTR_int_array(INTERP, SELF, int_array);
 
         for (i = 0; i < n; ++i)
-            VTABLE_push_integer(INTERP, io, int_array[i]);
+            VTABLE_push_integer(INTERP, info, int_array[i]);
     }
 
     VTABLE void thaw(visit_info *info) {
+        INTVAL n;
+
+        SUPER(info);
+
+        SET_ATTR_size(INTERP, SELF, 0);
+        SET_ATTR_int_array(INTERP, SELF, NULL);
+
+        if ((n = VTABLE_shift_integer(INTERP, info))) {
+            INTVAL  i;
+            INTVAL *int_array;
+
+            SELF.set_integer_native(n);
+            GET_ATTR_int_array(INTERP, SELF, int_array);
 
-        Parrot_FixedIntegerArray_attributes *attrs =
-            mem_allocate_zeroed_typed(Parrot_FixedIntegerArray_attributes);
-        PMC_data(SELF) = attrs;
-        PObj_active_destroy_SET(SELF);
-
-        if (info->extra_flags == EXTRA_IS_NULL) {
-            IMAGE_IO * const io = info->image_io;
-            const INTVAL n = VTABLE_shift_integer(INTERP, io);
-
-            SET_ATTR_size(INTERP, SELF, 0);
-            SET_ATTR_int_array(INTERP, SELF, NULL);
-
-            if (n) {
-                INTVAL  i;
-                INTVAL *int_array;
-
-                SELF.set_integer_native(n);
-                GET_ATTR_int_array(INTERP, SELF, int_array);
-
-                for (i = 0; i < n; ++i)
-                    int_array[i] = VTABLE_shift_integer(INTERP, io);
-            }
+            for (i = 0; i < n; ++i)
+                int_array[i] = VTABLE_shift_integer(INTERP, info);
         }
-        else
-            SUPER(info);
     }
 }
 

Modified: branches/orderedhash_revamp/src/pmc/fixedpmcarray.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/fixedpmcarray.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/fixedpmcarray.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -27,7 +27,7 @@
 #define PMC_size(x)  ((Parrot_FixedPMCArray_attributes *)PMC_data(x))->size
 #define PMC_array(x) ((Parrot_FixedPMCArray_attributes *)PMC_data(x))->pmc_array
 
-pmclass FixedPMCArray need_ext provides array {
+pmclass FixedPMCArray auto_attrs provides array {
     ATTR INTVAL   size;      /* number of elements in the array */
     ATTR PMC    **pmc_array; /* pointer to PMC array */
 
@@ -44,8 +44,15 @@
     METHOD sort(PMC *cmp_func :optional) {
         const INTVAL n = SELF.elements();
 
-        if (n > 1)
-           Parrot_quicksort(interp, (void **)PMC_array(SELF), n, cmp_func);
+        if (n > 1) {
+            /* XXX Workaround for TT #218 */
+            if (PObj_is_object_TEST(SELF)) {
+                PMC *parent = SELF.get_attr_str(CONST_STRING(interp, "proxy"));
+                Parrot_pcc_invoke_method_from_c_args(interp, parent, CONST_STRING(interp, "sort"), "P->", cmp_func);
+            }
+            else
+                Parrot_quicksort(interp, (void **)PMC_array(SELF), n, cmp_func);
+        }
     }
 
 /*
@@ -65,10 +72,6 @@
 */
 
     VTABLE void init() {
-        Parrot_FixedPMCArray_attributes *attrs =
-            mem_allocate_zeroed_typed(Parrot_FixedPMCArray_attributes);
-
-        PMC_data(SELF) = attrs;
         PObj_custom_mark_destroy_SETALL(SELF);
     }
 
@@ -83,10 +86,8 @@
 */
 
     VTABLE void destroy() {
-        if (PMC_array(SELF)) {
+        if (PMC_array(SELF))
             mem_sys_free(PMC_array(SELF));
-        }
-        mem_sys_free(PMC_data(SELF));
     }
 
 /*
@@ -104,8 +105,8 @@
         const INTVAL size = PMC_size(SELF);
 
         if (size) {
-            PMC_size(dest) = size;
-            PMC_array(dest)    = mem_allocate_n_typed(size, PMC *);
+            PMC_size(dest)  = size;
+            PMC_array(dest) = mem_allocate_n_typed(size, PMC *);
             mem_copy_n_typed(PMC_array(dest), PMC_array(SELF), size, PMC *);
             PObj_custom_mark_destroy_SETALL(dest);
         }
@@ -178,7 +179,7 @@
 =item C<STRING *get_repr()>
 
 Returns a string representation of the array contents.
-RT #46673 implement freeze/thaw and use that instead.
+TT #1229: implement freeze/thaw and use that instead.
 
 =cut
 
@@ -195,12 +196,10 @@
 
         for (i = 0; i < n; ++i) {
             PMC * const val = SELF.get_pmc_keyed_int(i);
+            if (i > 0)
+                res = Parrot_str_append(INTERP, res, CONST_STRING(INTERP, ", "));
 
             res = Parrot_str_append(INTERP, res, VTABLE_get_repr(INTERP, val));
-            if (n == 1)
-                res = Parrot_str_append(INTERP, res, CONST_STRING(INTERP, ","));
-            else if (i < n - 1)
-                res = Parrot_str_append(INTERP, res, CONST_STRING(INTERP, ", "));
         }
 
         res = Parrot_str_append(INTERP, res, CONST_STRING(INTERP, ")"));
@@ -372,6 +371,10 @@
         if (!size)
             return;
 
+        if (size < 0)
+            Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
+                    _("FixedPMCArray: Cannot set array size to a negative number"));
+
         PMC_size(SELF) = size;
         data           = mem_allocate_n_typed(size, PMC *);
 
@@ -481,7 +484,7 @@
         else {
             PMC *box = SELF.get_pmc_keyed_int(k);
 
-            /* RT #46675: autovivify an Array and insert it in SELF */
+            /* TT #1295: autovivify an Array and insert it in SELF */
             if (!box)
                 box = pmc_new(INTERP, SELF.type());
 
@@ -546,7 +549,6 @@
                 _("FixedPMCArray: index out of bounds!"));
 
         data      = PMC_array(SELF);
-        GC_WRITE_BARRIER(INTERP, SELF, data[key], src);
         data[key] = src;
     }
 
@@ -570,7 +572,7 @@
         else {
             PMC *box = SELF.get_pmc_keyed_int(k);
 
-            /* RT #46675: autovivify an Array and insert it in SELF */
+            /* TT #1295: autovivify an Array and insert it in SELF */
             if (!box)
                 box = pmc_new(INTERP, SELF.type());
 
@@ -591,7 +593,7 @@
     VTABLE INTVAL is_equal(PMC *value) {
         INTVAL j, n;
 
-        if (value->vtable->base_type != enum_class_FixedPMCArray)
+        if (value->vtable->base_type != SELF->vtable->base_type)
             return 0;
 
         n = SELF.elements();
@@ -617,13 +619,8 @@
         return 1;
     }
 
-/*
-
-=item C<PMC *slice(PMC *key, INTVAL f)>
 
-Return a new iterator for the slice PMC C<key> if f == 0.
-
-Return a new pythonic array slice if f == 1.
+/*
 
 =item C<PMC *get_iter()>
 
@@ -633,18 +630,6 @@
 
 */
 
-    VTABLE PMC *slice(PMC *key, INTVAL f) {
-        if (f == 0) {
-            STRING     *name = CONST_STRING(interp, "set_key");
-            PMC * const iter = pmc_new_init(INTERP, enum_class_Iterator, SELF);
-            Parrot_PCCINVOKE(interp, iter, name, "P->", key);
-            return iter;
-        }
-
-        Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
-                _("Array: Unknown slice type"));
-    }
-
     VTABLE PMC *get_iter() {
         return pmc_new_init(INTERP, enum_class_ArrayIterator, SELF);
     }
@@ -736,16 +721,13 @@
     }
 
     VTABLE void freeze(visit_info *info) {
-        IMAGE_IO * const io = info->image_io;
         SUPER(info);
-        VTABLE_push_integer(INTERP, io, VTABLE_elements(INTERP, SELF));
+        VTABLE_push_integer(INTERP, info, VTABLE_elements(INTERP, SELF));
     }
 
     VTABLE void thaw(visit_info *info) {
-        IMAGE_IO * const io = info->image_io;
         SUPER(info);
-        if (info->extra_flags == EXTRA_IS_NULL)
-            SELF.set_integer_native(VTABLE_shift_integer(INTERP, io));
+        SELF.set_integer_native(VTABLE_shift_integer(INTERP, info));
     }
 
 /*
@@ -785,8 +767,7 @@
             return;
 
         for (i = PMC_size(SELF) - 1; i >= 0; --i)
-            if (data[i])
-                Parrot_gc_mark_PObj_alive(interp, (PObj *)data[i]);
+            Parrot_gc_mark_PMC_alive(interp, data[i]);
     }
 
 

Modified: branches/orderedhash_revamp/src/pmc/fixedstringarray.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/fixedstringarray.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/fixedstringarray.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -19,7 +19,7 @@
 
 */
 
-pmclass FixedStringArray need_ext provides array {
+pmclass FixedStringArray auto_attrs provides array {
     ATTR STRING **str_array; /* where the STRINGs are stored */
     ATTR UINTVAL  size;      /* element count */
 
@@ -40,12 +40,6 @@
 */
 
     VTABLE void init() {
-
-        Parrot_FixedStringArray_attributes *attrs =
-            mem_allocate_zeroed_typed(Parrot_FixedStringArray_attributes);
-
-        PMC_data(SELF) = attrs;
-
         PObj_custom_mark_destroy_SETALL(SELF);
     }
 
@@ -67,8 +61,6 @@
 
         if (str_array)
             mem_sys_free(str_array);
-
-        mem_sys_free(PMC_data(SELF));
     }
 
 /*
@@ -126,8 +118,7 @@
             GET_ATTR_size(INTERP, SELF, size);
 
             for (i = 0; i < size; i++) {
-                if (str_array[i])
-                    Parrot_gc_mark_PObj_alive(INTERP, (PObj *) str_array[i]);
+                Parrot_gc_mark_STRING_alive(INTERP, str_array[i]);
             }
         }
     }
@@ -204,8 +195,8 @@
 */
 
     VTABLE INTVAL get_integer_keyed_int(INTVAL key) {
-        PMC * const tempPMC = SELF.get_pmc_keyed_int(key);
-        return VTABLE_get_integer(INTERP, tempPMC);
+        STRING * const element = SELF.get_string_keyed_int(key);
+        return Parrot_str_to_int(interp, element);
     }
 
 /*
@@ -236,8 +227,8 @@
 */
 
     VTABLE FLOATVAL get_number_keyed_int(INTVAL key) {
-        PMC * const tempPMC = SELF.get_pmc_keyed_int(key);
-        return VTABLE_get_number(INTERP, tempPMC);
+        STRING * const element = SELF.get_string_keyed_int(key);
+        return Parrot_str_to_num(interp, element);
     }
 
 /*
@@ -266,7 +257,6 @@
 */
 
     VTABLE STRING *get_string_keyed_int(INTVAL key) {
-
         STRING **str_array;
         UINTVAL  size;
 
@@ -367,11 +357,7 @@
 */
 
     VTABLE void set_integer_keyed_int(INTVAL key, INTVAL value) {
-        PMC    *const ret = pmc_new(INTERP, enum_class_String);
-        STRING *val;
-
-        VTABLE_set_integer_native(INTERP, ret, value);
-        val = VTABLE_get_string(INTERP, ret);
+        STRING *val = Parrot_str_from_int(interp, value);
         SELF.set_string_keyed_int(key, val);
     }
 
@@ -402,11 +388,7 @@
 */
 
     VTABLE void set_number_keyed_int(INTVAL key, FLOATVAL value) {
-        PMC    *const ret = pmc_new(INTERP, enum_class_String);
-        STRING *val;
-
-        VTABLE_set_number_native(INTERP, ret, value);
-        val = VTABLE_get_string(INTERP, ret);
+        STRING *val = Parrot_str_from_num(interp, value);
         SELF.set_string_keyed_int(key, val);
     }
 
@@ -444,7 +426,7 @@
                 "FixedStringArray: index out of bounds!");
 
         GET_ATTR_str_array(INTERP, SELF, str_array);
-        GC_WRITE_BARRIER(INTERP, SELF, str_array[key], value);
+
         str_array[key] = value;
     }
 
@@ -497,6 +479,8 @@
 
 /*
 
+=item C<STRING *get_string()>
+
 =item C<STRING *get_repr()>
 
 Returns the Parrot string representation C<key>.
@@ -504,6 +488,9 @@
 =cut
 
 */
+    VTABLE STRING *get_string() {
+        return STATICSELF.get_repr();
+    }
 
     VTABLE STRING *get_repr() {
 
@@ -512,9 +499,9 @@
         INTVAL        j;
 
         for (j = 0; j < n; ++j) {
-            PMC * const val = SELF.get_pmc_keyed_int(j);
+            STRING * const val = SELF.get_string_keyed_int(j);
             res = Parrot_str_append(INTERP, res, CONST_STRING(INTERP, "\""));
-            res = Parrot_str_append(INTERP, res, VTABLE_get_repr(INTERP, val));
+            res = Parrot_str_append(INTERP, res, val);
             res = Parrot_str_append(INTERP, res, CONST_STRING(INTERP, "\""));
 
             if (j < n - 1)
@@ -526,6 +513,43 @@
     }
 
 
+/*
+
+=item C<INTVAL is_equal(PMC *value)>
+
+The C<==> operation. Compares two array to hold equal elements.
+
+=cut
+
+*/
+
+    VTABLE INTVAL is_equal(PMC *value) {
+        INTVAL j, n;
+
+        if (value->vtable->base_type != SELF->vtable->base_type)
+            return 0;
+
+        n = SELF.elements();
+
+        if (VTABLE_elements(INTERP, value) != n)
+            return 0;
+
+        for (j = 0; j < n; ++j) {
+            STRING * const item1 = SELF.get_string_keyed_int(j);
+            STRING * const item2 = VTABLE_get_string_keyed_int(INTERP, value, j);
+
+            if (item1 == item2)
+                continue;
+
+            if (item1 == NULL ||  item2 == NULL)
+                return 0;
+
+            if (!Parrot_str_equal(interp, item1, item2))
+                return 0;
+        }
+
+        return 1;
+    }
 
 /*
 
@@ -543,16 +567,15 @@
 
 */
     VTABLE void freeze(visit_info *info) {
-        IMAGE_IO * const   io  = info->image_io;
         STRING           **str_array;
         UINTVAL            size, i;
 
         GET_ATTR_size(INTERP, SELF, size);
         GET_ATTR_str_array(INTERP, SELF, str_array);
-        VTABLE_push_integer(INTERP, io, size);
+        VTABLE_push_integer(INTERP, info, size);
 
         for (i = 0; i < size; ++i)
-            VTABLE_push_string(INTERP, io, str_array[i]);
+            VTABLE_push_string(INTERP, info, str_array[i]);
     }
 
 /*
@@ -565,22 +588,18 @@
 
 */
     VTABLE void thaw(visit_info *info) {
-        IMAGE_IO * const io = info->image_io;
+        UINTVAL  i, size;
+        STRING **str_array;
+
+        SELF.init();
         SUPER(info);
 
-        if (info->extra_flags == EXTRA_IS_NULL) {
-            UINTVAL  i, size;
-            STRING **str_array;
-
-            SELF.init();
-
-            size   = VTABLE_shift_integer(INTERP, io);
-            SELF.set_integer_native((INTVAL)size);
-            GET_ATTR_str_array(INTERP, SELF, str_array);
+        size   = VTABLE_shift_integer(INTERP, info);
+        SELF.set_integer_native((INTVAL)size);
+        GET_ATTR_str_array(INTERP, SELF, str_array);
 
-            for (i = 0; i < size; ++i)
-                str_array[i] = VTABLE_shift_string(INTERP, io);
-        }
+        for (i = 0; i < size; ++i)
+            str_array[i] = VTABLE_shift_string(INTERP, info);
     }
 }
 

Modified: branches/orderedhash_revamp/src/pmc/float.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/float.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/float.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -18,7 +18,7 @@
 
 */
 
-pmclass Float extends scalar provides float provides scalar {
+pmclass Float extends scalar provides float provides scalar auto_attrs {
     ATTR FLOATVAL fv;
 
 /*
@@ -32,26 +32,9 @@
 */
 
     VTABLE void init() {
-        Parrot_Float_attributes * const fattr = mem_allocate_zeroed_typed(Parrot_Float_attributes);
-
-        fattr->fv      = 0.0;
-        PMC_data(SELF) = fattr;
-
-        PObj_active_destroy_SET(SELF);
+        SET_ATTR_fv(INTERP, SELF, 0.0);
     }
-/*
-
-=item C<void destroy()>
-
-Destroy this PMC.
-
-=cut
-
-*/
 
-    VTABLE void destroy() {
-        mem_sys_free(PMC_data(SELF));
-    }
 /*
 
 =item C<PMC *clone()>
@@ -72,26 +55,6 @@
 
 /*
 
-=item C<PMC *instantiate_str(STRING *rep, INTVAL flags)>
-
-Class method to construct an Integer from the string representation C<rep>.
-
-=cut
-
-*/
-    VTABLE PMC *instantiate_str(STRING *rep, INTVAL flags) {
-        const INTVAL type = SELF->vtable->base_type;
-        PMC * const res =
-            (flags & PObj_constant_FLAG)
-                ? constant_pmc_new(INTERP, type)
-                : pmc_new(INTERP, type);
-
-        SET_ATTR_fv(INTERP, res, Parrot_str_to_num(INTERP, rep));
-        return res;
-    }
-
-/*
-
 =item C<FLOATVAL get_number()>
 
 Returns the value of the number.
@@ -196,22 +159,6 @@
 
 /*
 
-=item C<void set_number_same(PMC *value)>
-
-Sets the value of the number to the value of C<*value>.
-
-=cut
-
-*/
-
-    VTABLE void set_number_same(PMC *value) {
-        FLOATVAL fv;
-        GET_ATTR_fv(INTERP, value, fv);
-        SET_ATTR_fv(INTERP, SELF, fv);
-    }
-
-/*
-
 =item C<void set_string_native(STRING *value)>
 
 Sets the value of the number to the value of C<*value>.
@@ -405,9 +352,8 @@
 
 */
     VTABLE void freeze(visit_info *info) {
-        IMAGE_IO * const io = info->image_io;
         SUPER(info);
-        VTABLE_push_float(INTERP, io, SELF.get_number());
+        VTABLE_push_float(INTERP, info, SELF.get_number());
     }
 
 /*
@@ -420,10 +366,8 @@
 
 */
     VTABLE void thaw(visit_info *info) {
-        IMAGE_IO * const io = info->image_io;
         SUPER(info);
-        if (info->extra_flags == EXTRA_IS_NULL)
-            SET_ATTR_fv(INTERP, SELF, VTABLE_shift_float(INTERP, io));
+        SET_ATTR_fv(INTERP, SELF, VTABLE_shift_float(INTERP, info));
     }
 /*
 

Modified: branches/orderedhash_revamp/src/pmc/hash.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/hash.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/hash.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -8,7 +8,7 @@
 
 =head1 DESCRIPTION
 
-Hash PMC wraps Parrot's _hash to provide high-level API:
+Hash PMC wraps Parrot's _hash to provide a high-level API:
 
 =over 4
 
@@ -30,6 +30,10 @@
 
 =back
 
+By default Hash uses string keys and PMC values. Methods C<set_key_type> and
+C<set_value_type> may be used to switch key and values type. For C<PMC> keys
+hash value is calculated using VTABLE C<get_hashvalue> function.
+
 These are the vtable functions for the Hash PMC.
 
 =head2 Functions
@@ -40,343 +44,11 @@
 
 */
 
-#include "pmc_iterator.h"
-#include "pmc_key.h"
-#include "pmc_hashiteratorkey.h"
-
-/*
-
-=item C<static PMC *get_integer_pmc(PARROT_INTERP, INTVAL base_type )>
-
-Lookup the PMC type which is used for storing native integers.
-
-=cut
-
-*/
-
-static PMC *get_integer_pmc(PARROT_INTERP) {
-    return pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_Integer));
-}
-
-
-/*
-
-=item C<static PMC *get_number_pmc(PARROT_INTERP, INTVAL base_type )>
-
-Lookup the PMC type which is used for floating point numbers.
-
-=cut
-
-*/
-
-static PMC *get_number_pmc(PARROT_INTERP) {
-    return pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_Float));
-}
-
-/*
-
-=item C<static PMC *get_string_pmc(PARROT_INTERP, INTVAL base_type )>
-
-Lookup the PMC type which is used for storing strings.
-
-=cut
-
-*/
-
-static PMC *get_string_pmc(PARROT_INTERP) {
-    return pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_String));
-}
-
-
-/*
-
-Poor-man polymorphic functions to convert something to something.
-
-There is bunch of functions to convert from passed value to stored keys type and to/from
-stored values type.
-
-void *hash_key_from_TYPE convert to keys type.
-void *hash_value_from_TYPE convert to values type.
-TYPE hash_value_to_TYPE convert from values type.
-
-*/
-
-static void*
-hash_key_from_int(PARROT_INTERP, const Hash * const hash, INTVAL key)
-{
-    void *ret;
-    switch (hash->key_type) {
-        case Hash_key_type_int:
-            ret = (void *)key;
-            break;
-        /* Currently PMCs are stringified */
-        case Hash_key_type_PMC:
-        case Hash_key_type_STRING:
-            ret = (void *)Parrot_str_from_int(interp, key);
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
-                    "Hash: unsupported key_type");
-    }
-    return ret;
-}
-
-static void*
-hash_key_from_string(PARROT_INTERP, const Hash * const hash, ARGIN(STRING *key))
-{
-    void *ret;
-    switch (hash->key_type) {
-        case Hash_key_type_int:
-        {
-            /* Pacify compiler about casting INVTAL to void */
-            const INTVAL int_key = Parrot_str_to_int(interp, key);
-            ret                  = INTVAL2PTR(void *, int_key);
-            break;
-        }
-        /* Currently PMCs are stringified */
-        case Hash_key_type_PMC:
-        case Hash_key_type_STRING:
-            ret = key;
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
-                    "Hash: unsupported key_type");
-    }
-    return ret;
-}
-
-static void*
-hash_key_from_pmc(PARROT_INTERP, const Hash * const hash, ARGIN(PMC *key))
-{
-    void *ret;
-    switch (hash->key_type) {
-        case Hash_key_type_int:
-        {
-            const INTVAL int_key = VTABLE_get_integer(interp, key);
-            ret                  = INTVAL2PTR(void *, int_key);
-            break;
-        }
-        /* Currently PMCs are stringified */
-        case Hash_key_type_PMC:
-        case Hash_key_type_STRING:
-            {
-                STRING * const tmp = VTABLE_get_string(interp, key);
-                if (!tmp)
-                    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNEXPECTED_NULL,
-                            "hash: can't use null as key");
-                ret = (void *)tmp;
-            }
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
-                    "Hash: unsupported key_type");
-    }
-    return ret;
-}
-
-
-/* Second part - convert from stored void* to real type */
-/* TODO: FLOATVALs converted into Float PMC for now */
-static void*
-hash_value_from_int(PARROT_INTERP, const Hash * const hash, INTVAL value)
-{
-    void *ret;
-    switch (hash->entry_type) {
-        case enum_type_INTVAL:
-            ret = INTVAL2PTR(void *, value);
-            break;
-        case enum_type_PMC:
-            {
-                PMC * const tmp = get_integer_pmc(interp);
-                VTABLE_set_integer_native(interp, tmp, value);
-                ret = INTVAL2PTR(void *, tmp);
-            }
-            break;
-        case enum_type_STRING:
-            ret = (void *)Parrot_str_from_int(interp, value);
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
-                    "Hash: unsupported entry_type");
-    }
-    return ret;
-}
-
-static void*
-hash_value_from_string(PARROT_INTERP, const Hash * const hash, STRING *value)
-{
-    void *ret;
-    switch (hash->entry_type) {
-        case enum_type_INTVAL:
-        {
-            const INTVAL int_val = Parrot_str_to_int(interp, value);
-            ret                  = INTVAL2PTR(void *, int_val);
-            break;
-        }
-        case enum_type_STRING:
-            ret = (void *)value;
-            break;
-        case enum_type_PMC:
-            {
-                PMC * const s = get_string_pmc(interp);
-                VTABLE_set_string_native(interp, s, value);
-                ret = (void *)s;
-            }
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
-                    "Hash: unsupported entry_type");
-    }
-    return ret;
-}
-
-static void*
-hash_value_from_pmc(PARROT_INTERP, const Hash * const hash, PMC *value)
-{
-    void *ret;
-    switch (hash->entry_type) {
-        case enum_type_INTVAL:
-        {
-            const INTVAL int_val = VTABLE_get_integer(interp, value);
-            ret                  = INTVAL2PTR(void *, int_val);
-            break;
-        }
-        case enum_type_STRING:
-            ret = (void *)VTABLE_get_string(interp, value);
-            break;
-        case enum_type_PMC:
-            ret = (void *)value;
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
-                    "Hash: unsupported entry_type");
-    }
-    return ret;
-}
+#include "pmc/pmc_iterator.h"
+#include "pmc/pmc_key.h"
+#include "pmc/pmc_hashiteratorkey.h"
 
-static void*
-hash_value_from_number(PARROT_INTERP, const Hash * const hash, FLOATVAL value)
-{
-    void *ret;
-    switch (hash->entry_type) {
-        case enum_type_INTVAL:
-            {
-                const INTVAL tmp = value;
-                ret = (void*)tmp;
-            }
-            break;
-        case enum_type_STRING:
-            ret = (void *)Parrot_str_from_num(interp, value);
-            break;
-        case enum_type_PMC:
-            {
-                PMC * const tmp = get_number_pmc(interp);
-                VTABLE_set_number_native(interp, tmp, value);
-                ret = (void *)tmp;
-            }
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
-                    "Hash: unsupported entry_type");
-    }
-    return ret;
-}
-
-static INTVAL
-hash_value_to_int(PARROT_INTERP, const Hash * const hash, void *value)
-{
-    INTVAL ret;
-    switch (hash->entry_type) {
-        case enum_type_INTVAL:
-            ret = (INTVAL)value;
-            break;
-        case enum_type_STRING:
-            ret = Parrot_str_to_int(interp, (STRING*)value);
-            break;
-        case enum_type_PMC:
-            ret = VTABLE_get_integer(interp, (PMC*)value);
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
-                    "Hash: unsupported entry_type");
-    }
-    return ret;
-}
-
-static STRING*
-hash_value_to_string(PARROT_INTERP, const Hash * const hash, void *value)
-{
-    STRING *ret;
-    switch (hash->entry_type) {
-        case enum_type_INTVAL:
-            ret = Parrot_str_from_int(interp, (INTVAL)value);
-            break;
-        case enum_type_STRING:
-            ret = (STRING *)value;
-            break;
-        case enum_type_PMC:
-            ret = VTABLE_get_string(interp, (PMC *)value);
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
-                    "Hash: unsupported entry_type");
-    }
-    return ret;
-}
-
-static PMC*
-hash_value_to_pmc(PARROT_INTERP, const Hash * const hash, void *value)
-{
-    PMC *ret;
-    switch (hash->entry_type) {
-        case enum_type_INTVAL:
-            ret = get_integer_pmc(interp);
-            VTABLE_set_integer_native(interp, ret, (INTVAL)value);
-            break;
-        case enum_type_STRING:
-            ret = get_string_pmc(interp);
-            VTABLE_set_string_native(interp, ret, (STRING *)value);
-            break;
-        case enum_type_PMC:
-            ret = (PMC *)value;
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
-                    "Hash: unsupported entry_type");
-    }
-    return ret;
-}
-
-static FLOATVAL
-hash_value_to_number(PARROT_INTERP, const Hash * const hash, void *value)
-{
-    FLOATVAL ret;
-    switch (hash->entry_type) {
-        case enum_type_INTVAL:
-            {
-                /* Pacify compiler about casting */
-                const INTVAL tmp = (INTVAL)value;
-                ret = tmp;
-            }
-            break;
-        case enum_type_STRING:
-            ret = Parrot_str_to_num(interp, (STRING*)value);
-            break;
-        case enum_type_PMC:
-            ret = VTABLE_get_number(interp, (PMC*)value);
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
-                    "Hash: unsupported entry_type");
-    }
-    return ret;
-}
-
-
-/* Needs ext struct for the next_for_GC pointer
- * We would get recursive marking of a deeply nested HoHoH...
- */
-pmclass Hash need_ext provides hash {
+pmclass Hash provides hash auto_attrs {
     ATTR Hash *hash;
 
 /*
@@ -395,9 +67,8 @@
 
     VTABLE void init() {
         Parrot_Hash_attributes * const attr =
-            mem_allocate_typed(Parrot_Hash_attributes);
+            (Parrot_Hash_attributes *) PMC_data(SELF);
 
-        PMC_data(SELF)        = attr;
         attr->hash            = parrot_new_hash(INTERP);
         attr->hash->container = SELF;
         PObj_custom_mark_destroy_SETALL(SELF);
@@ -407,8 +78,6 @@
         Hash * const hash = (Hash *)SELF.get_pointer();
         if (hash)
             parrot_hash_destroy(INTERP, hash);
-
-        mem_sys_free(PMC_data(SELF));
     }
 /*
 
@@ -466,33 +135,51 @@
             parrot_hash_destroy(INTERP, old_hash);
     }
 
+
 /*
+
 =item C<void set_integer(INTVAL type)>
 
-Reset Hash to use differen keys. See enum C<Hash_key_type> for possible values.
+=item C<void set_key_type(INTVAL type)>
+
+Reset Hash to use different keys. See enum C<Hash_key_type> for possible
+values.
 
 NB: this method will destroy all old data!
 
 =cut
+
 */
     VTABLE void set_integer_native(INTVAL type) {
-        Hash * const old_hash = (Hash *)SELF.get_pointer();
-        Hash *new_hash;
+        Hash            *new_hash;
+        Hash * const     old_hash   = PARROT_HASH(SELF)->hash;
+        PARROT_DATA_TYPE entry_type = old_hash
+                                    ? old_hash->entry_type
+                                    : enum_type_PMC;
 
         if (type == Hash_key_type_STRING)
-            new_hash = parrot_new_hash(INTERP);
+            new_hash = parrot_create_hash(interp,
+                    entry_type,
+                    Hash_key_type_STRING,
+                    STRING_compare,
+                    (hash_hash_key_fn)key_hash_STRING);
         else if (type == Hash_key_type_int)
             /* new_int_hash set BOTH keys and values to INTVAL */
             new_hash = parrot_create_hash(interp,
-                    old_hash ? old_hash->entry_type : enum_type_PMC,
+                    entry_type,
                     Hash_key_type_int,
                     int_compare,
                     key_hash_int);
+        else if (type == Hash_key_type_PMC)
+            /* new_int_hash set BOTH keys and values to INTVAL */
+            new_hash = parrot_create_hash(interp,
+                    entry_type,
+                    Hash_key_type_PMC,
+                    (hash_comp_fn)PMC_compare,
+                    (hash_hash_key_fn)key_hash_PMC);
         else
-            /*
-                We probably will not implement other types of keys. They are way
-                too dangerous to use from PIR
-            */
+            /* We probably will not implement other types of keys. They are way
+             * too dangerous to use from PIR */
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_UNIMPLEMENTED,
                 "Hash: Unknown key type");
 
@@ -508,6 +195,15 @@
         SELF.set_integer_native(type);
     }
 
+/*
+
+=item C<METHOD get_key_type()>
+
+Return type of keys in Hash.
+
+=cut
+
+*/
     METHOD get_key_type() {
         const INTVAL ret = ((Hash *)SELF.get_pointer())->key_type;
         RETURN(INTVAL ret);
@@ -537,18 +233,18 @@
             old_hash = parrot_new_hash(INTERP);
 
         switch (type) {
-            case enum_type_INTVAL:
-            case enum_type_STRING:
-            case enum_type_PMC:
-                new_hash = parrot_create_hash(interp,
+          case enum_type_INTVAL:
+          case enum_type_STRING:
+          case enum_type_PMC:
+            new_hash = parrot_create_hash(interp,
                         (PARROT_DATA_TYPE)type,
                         old_hash->key_type,
                         old_hash->compare,
                         old_hash->hash_val);
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
-                        "Hash: unsupported entry_type");
+            break;
+          default:
+            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+                        "Hash: unsupported entry_type %d", type);
         }
 
         PARROT_HASH(SELF)->hash = new_hash;
@@ -615,7 +311,7 @@
     }
 
     VTABLE STRING *get_repr() {
-        /* RT #44643 use freeze */
+        /* TT #1231:  Use freeze in get_repr() (for hashes) */
         PMC * const  iter = VTABLE_get_iter(INTERP, SELF);
         STRING      *res  = CONST_STRING(INTERP, "{");
         const INTVAL n    = VTABLE_elements(INTERP, SELF);
@@ -623,16 +319,20 @@
 
         for (j = 0; j < n; ++j) {
             STRING * const key       = VTABLE_shift_string(INTERP, iter);
+            char *         key_str;
+            size_t         i, str_len;
             int            all_digit = 1;
-            int            i;
             PMC           *val;
 
-            for (i = 0; i < (int)key->strlen; ++i) {
-                if (!isdigit((unsigned char)((const char *)key->strstart)[i])) {
+            key_str = Parrot_str_to_cstring(INTERP, key);
+            str_len = strlen(key_str);
+            for (i = 0; i < str_len; ++i) {
+                if (!isdigit((unsigned char)key_str[i])) {
                     all_digit = 0;
                     break;
                 }
             }
+            Parrot_str_free_cstring(key_str);
 
             if (all_digit) {
                 res = Parrot_str_append(INTERP, res, key);
@@ -970,14 +670,26 @@
 */
 
     VTABLE PMC *get_pmc_keyed_str(STRING *key) {
-        const Hash * const hash = (Hash *)SELF.get_pointer();
-        HashBucket * const b    = parrot_hash_get_bucket(INTERP, hash,
+        const Hash *hash;
+        HashBucket *b = NULL;
+
+        GET_ATTR_hash(interp, SELF, hash);
+
+        /* special case the most key type, for speed */
+        if (hash->key_type == Hash_key_type_STRING)
+            b = parrot_hash_get_bucket(interp, hash, key);
+        else
+            b = parrot_hash_get_bucket(INTERP, hash,
                 hash_key_from_string(INTERP, hash, key));
 
         if (!b)
             return PMCNULL;
 
-        return hash_value_to_pmc(INTERP, hash, b->value);
+        /* special case the most likely value type, for speed */
+        if (hash->entry_type == enum_type_PMC)
+            return (PMC *)b->value;
+        else
+            return hash_value_to_pmc(INTERP, hash, b->value);
     }
 
     VTABLE PMC *get_pmc_keyed_int(INTVAL key) {
@@ -1030,8 +742,7 @@
 
 
         if (!nextkey) {
-            PMC * const val = get_number_pmc(INTERP);
-            VTABLE_set_number_native(INTERP, val, value);
+            PMC * const val = get_number_pmc(INTERP, value);
             parrot_hash_put(INTERP, hash, keystr, hash_value_from_pmc(INTERP, hash, val));
             return;
         }
@@ -1058,8 +769,7 @@
 */
 
     VTABLE void set_number_keyed_str(STRING *key, FLOATVAL value) {
-        PMC * const val  = get_number_pmc(INTERP);
-        VTABLE_set_number_native(INTERP, val, value);
+        PMC * const val  = get_number_pmc(INTERP, value);
 
         parrot_hash_put(INTERP, (Hash *)SELF.get_pointer(), key, val);
     }
@@ -1277,7 +987,7 @@
 
 =item C<PMC *get_iter()>
 
-Return a new iterator for the slice PMC C<key>
+Return a new iterator.
 
 =cut
 
@@ -1329,7 +1039,6 @@
         for (j = 0; j < n; ++j) {
             STRING * const key = VTABLE_shift_string(INTERP, iter);
             PMC           *item1, *item2;
-            INTVAL         result;
 
             if (!VTABLE_exists_keyed_str(INTERP, value, key))
                 return 0;
@@ -1340,9 +1049,7 @@
             if (item1 == item2)
                 continue;
 
-            Parrot_mmd_multi_dispatch_from_c_args(INTERP, "is_equal",
-                "PP->I", item1, item2, &result);
-            if (!result)
+            if (!VTABLE_is_equal(INTERP, item1, item2))
                 return 0;
         }
 
@@ -1380,7 +1087,6 @@
 */
 
     VTABLE void visit(visit_info *info) {
-        info->container = SELF;
         parrot_hash_visit(INTERP, (Hash *)SELF.get_pointer(), info);
         SUPER(info);
     }
@@ -1396,13 +1102,12 @@
 */
 
     VTABLE void freeze(visit_info *info) {
-        IMAGE_IO * const io   = info->image_io;
         Hash     * const hash = (Hash *)SELF.get_pointer();;
 
         SUPER(info);
-        VTABLE_push_integer(INTERP, io, VTABLE_elements(INTERP, SELF));
-        VTABLE_push_integer(INTERP, io, (INTVAL)hash->key_type);
-        VTABLE_push_integer(INTERP, io, hash->entry_type);
+        VTABLE_push_integer(INTERP, info, VTABLE_elements(INTERP, SELF));
+        VTABLE_push_integer(INTERP, info, (INTVAL)hash->key_type);
+        VTABLE_push_integer(INTERP, info, hash->entry_type);
     }
 
 /*
@@ -1416,16 +1121,14 @@
 */
 
     VTABLE void thaw(visit_info *info) {
-        IMAGE_IO * const io = info->image_io;
-
         SUPER(info);
-        if (info->extra_flags == EXTRA_IS_NULL) {
-            const INTVAL elems  = VTABLE_shift_integer(INTERP, io);
-            const INTVAL k_type = VTABLE_shift_integer(INTERP, io);
-            const INTVAL v_type = VTABLE_shift_integer(INTERP, io);
+
+        {
+            const INTVAL elems  = VTABLE_shift_integer(INTERP, info);
+            const INTVAL k_type = VTABLE_shift_integer(INTERP, info);
+            const INTVAL v_type = VTABLE_shift_integer(INTERP, info);
             Hash        *hash;
 
-            /* RT #46653 create hash with needed size in the first place */
             if (k_type == Hash_key_type_int && v_type == enum_hash_int) {
                 SELF.set_pointer(parrot_new_intval_hash(INTERP));
             }

Modified: branches/orderedhash_revamp/src/pmc/hashiterator.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/hashiterator.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/hashiterator.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -46,8 +46,8 @@
 
 */
 
-#include "pmc_hash.h"
-#include "pmc_hashiteratorkey.h"
+#include "pmc/pmc_hash.h"
+#include "pmc/pmc_hashiteratorkey.h"
 
 /*
 
@@ -75,7 +75,7 @@
     return bucket;
 }
 
-pmclass HashIterator extends Iterator no_ro {
+pmclass HashIterator extends Iterator no_ro auto_attrs {
     ATTR PMC        *pmc_hash;      /* the Hash which this Iterator iterates */
     ATTR Hash       *parrot_hash;   /* Underlying implementation of hash */
     ATTR HashBucket *bucket;        /* Current bucket */
@@ -96,7 +96,7 @@
 
     VTABLE void init_pmc(PMC *hash) {
         Parrot_HashIterator_attributes * const attrs =
-            mem_allocate_zeroed_typed(Parrot_HashIterator_attributes);
+            (Parrot_HashIterator_attributes *) PMC_data(SELF);
 
         attrs->pmc_hash         = hash;
         attrs->parrot_hash      = (Hash*)VTABLE_get_pointer(INTERP, hash);
@@ -106,9 +106,8 @@
         /* Will be decreased on initial advance_to_next */
         /* XXX Do we really need to support this use-case ? */
         attrs->elements         = attrs->parrot_hash->entries + 1;
-        PMC_data(SELF)          = attrs;
 
-        PObj_custom_mark_destroy_SETALL(SELF);
+        PObj_custom_mark_SET(SELF);
 
         /* Initial state of iterator is "before start" */
         /* So, advance to first element */
@@ -117,20 +116,6 @@
 
 /*
 
-=item C<void destroy()>
-
-destroys this PMC
-
-=cut
-
-*/
-
-    VTABLE void destroy() {
-        mem_sys_free(PMC_data(SELF));
-    }
-
-/*
-
 =item C<void mark()>
 
 Marks the hash as live.
@@ -141,8 +126,7 @@
 
     VTABLE void mark() {
         PMC *hash = PARROT_HASHITERATOR(SELF)->pmc_hash;
-        if (hash)
-             Parrot_gc_mark_PObj_alive(INTERP, (PObj *)hash);
+        Parrot_gc_mark_PMC_alive(INTERP, hash);
         /* We don't mark underlying parrot_hash. Hash PMC will mark it */
     }
 
@@ -246,9 +230,8 @@
                 "StopIteration");
 
         ret = pmc_new(INTERP, enum_class_HashIteratorKey);
-        /* Poke directly into HIK. We don't want to create any kind of public API for this */
-        PARROT_HASHITERATORKEY(ret)->parrot_hash = attrs->parrot_hash;
-        PARROT_HASHITERATORKEY(ret)->bucket      = attrs->bucket;
+        VTABLE_set_pointer_keyed_int(INTERP, ret, 0, attrs->parrot_hash);
+        VTABLE_set_pointer_keyed_int(INTERP, ret, 1, attrs->bucket);
 
         /* Move to next bucket */
         advance_to_next(INTERP, SELF);
@@ -261,8 +244,10 @@
 */
 
     VTABLE STRING* shift_string() {
-        PMC * const key = SELF.shift_pmc();
-        return VTABLE_get_string(INTERP, key);
+        PMC    * const key = SELF.shift_pmc();
+        STRING * const ret = VTABLE_get_string(INTERP, key);
+        temporary_pmc_free(INTERP, key);
+        return ret;
     }
 
 }

Modified: branches/orderedhash_revamp/src/pmc/hashiteratorkey.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/hashiteratorkey.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/hashiteratorkey.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -19,86 +19,81 @@
 
 */
 
-pmclass HashIteratorKey no_ro {
+pmclass HashIteratorKey no_ro auto_attrs {
     ATTR Hash        *parrot_hash; /* Underlying parrot's hash */
     ATTR HashBucket  *bucket;      /* Current bucket from HashItertor */
 
 /*
 
-=item C<void init()>
-
-Initializes the PMC.
+=item C<get_pmc()>
 
-Not really part of public API.
+Get "key".
 
 =cut
 
 */
-
-    VTABLE void init() {
+    VTABLE PMC* get_pmc() {
         Parrot_HashIteratorKey_attributes *attrs =
-            mem_allocate_zeroed_typed(Parrot_HashIteratorKey_attributes);
+                PARROT_HASHITERATORKEY(SELF);
 
-        PMC_data(SELF) = attrs;
+        /* TT #1080 & TT #1081 Wallpapering problem with NULL attributes */
+        if (!attrs->parrot_hash || !attrs->bucket)
+            return PMCNULL;
 
-        PObj_active_destroy_SET(SELF);
+        return hash_key_to_pmc(INTERP, attrs->parrot_hash, attrs->bucket->key);
     }
 
-/*
+    METHOD key() {
+        PMC *ret = SELF.get_pmc();
+        RETURN(PMC* ret);
+    }
 
-=item C<void destroy()>
+    METHOD value() {
+        Parrot_HashIteratorKey_attributes *attrs =
+                PARROT_HASHITERATORKEY(SELF);
+        PMC *ret = hash_value_to_pmc(INTERP, attrs->parrot_hash, attrs->bucket->value);
+        RETURN(PMC* ret);
+    }
 
-Destroys this PMC
 
-=cut
+    VTABLE INTVAL get_integer() {
+        return -1;
+    }
 
-*/
+    VTABLE STRING* get_string() {
+        Parrot_HashIteratorKey_attributes *attrs =
+                PARROT_HASHITERATORKEY(SELF);
+
+        /* TT #1080 & TT #1081 Wallpapering problem with NULL attributes */
+        if (!attrs->parrot_hash || !attrs->bucket)
+            return CONST_STRING(INTERP, "");
 
-    VTABLE void destroy() {
-        mem_sys_free(PMC_data(SELF));
+        return hash_key_to_string(INTERP, attrs->parrot_hash, attrs->bucket->key);
     }
 
 /*
 
-=item C<get_pmc()>
+=item C<set_pointer_keyed_int()>
 
-Get "key".
+Set pointers to Hash and HashBucket. Not really part of public API.
 
 =cut
 
 */
-    VTABLE PMC* get_pmc() {
-        return PMCNULL;
-    }
-
-    VTABLE INTVAL get_integer() {
-        return -1;
-    }
-
-    VTABLE STRING* get_string() {
+    VTABLE void set_pointer_keyed_int(INTVAL key, void *value) {
         Parrot_HashIteratorKey_attributes *attrs =
                 PARROT_HASHITERATORKEY(SELF);
 
-        switch (attrs->parrot_hash->key_type) {
-            case Hash_key_type_int:
-                return Parrot_str_from_int(INTERP, (INTVAL)attrs->bucket->key);
-
-            case Hash_key_type_STRING:
-                return (STRING*)attrs->bucket->key;
-
-            case Hash_key_type_PMC:
-                return VTABLE_get_string(INTERP, (PMC *)attrs->bucket->key);
-
-            default:
-                /* Horribly die? */
-                break;
-        }
+        PARROT_ASSERT(value || !"Can't set NULL pointer into HashIteratorKey");
 
-        return NULL;
+        if (key == 0) {
+            attrs->parrot_hash = (Hash*)value;
+        }
+        else if (key == 1) {
+            attrs->bucket = (HashBucket*)value;
+        }
     }
 
-
-
 }
 
 /*

Modified: branches/orderedhash_revamp/src/pmc/integer.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/integer.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/integer.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -19,7 +19,7 @@
 
 */
 
-#include "pmc_bigint.h"
+#include "pmc/pmc_bigint.h"
 
 static void
 maybe_throw_overflow_error(PARROT_INTERP)
@@ -43,11 +43,12 @@
     return self;
 }
 
-pmclass Integer extends scalar provides integer provides scalar {
+pmclass Integer extends scalar provides integer provides scalar auto_attrs {
     ATTR INTVAL iv; /* the value of this Integer */
 
 /*
-=item C<PMC instantiate(PMC *sig)>
+
+=item C<PMC init_pmc(PMC *init)>
 
 Create a new Integer with arguments passed according to pdd03.
 
@@ -55,52 +56,22 @@
 
 Initializes the integer with a default value of C<0>.
 
-=item C<void destroy()>
-
-Destroys this PMC.
-
 =cut
 
 */
 
-    VTABLE PMC *instantiate(PMC *sig) {
-        PMC            * const ret    = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
-        const opcode_t * const arg_op = interp->current_args;
-        INTVAL                 init   = 0;
-
-        if (VTABLE_elements(interp, sig) == 2) {
-            switch (VTABLE_get_integer_keyed_int(INTERP, sig, 1)) {
-                case PARROT_ARG_I:
-                    init = REG_INT(interp, arg_op[3]);
-                    break;
-                case PARROT_ARG_IC:
-                    init = arg_op[3];
-                    break;
-                default:
-                    Parrot_ex_throw_from_c_args(INTERP, NULL,
-                            EXCEPTION_SYNTAX_ERROR,
-                            "Integer.instantiate: unhandled initializer");
-                    break;
-            }
-        }
-
-        VTABLE_set_integer_native(INTERP, ret, init);
-        return ret;
-    }
-
-
     VTABLE void init() {
         Parrot_Integer_attributes * const attrs =
-            mem_allocate_typed(Parrot_Integer_attributes);
+            (Parrot_Integer_attributes *)PMC_data(SELF);
 
         attrs->iv      = 0;
-        PMC_data(SELF) = attrs;
-        PObj_active_destroy_SET(SELF);
     }
 
-    VTABLE void destroy() {
-        mem_sys_free(PMC_data(SELF));
-        PMC_data(SELF) = NULL;
+    VTABLE void init_pmc(PMC *init) {
+        Parrot_Integer_attributes * const attrs =
+            (Parrot_Integer_attributes *)PMC_data(SELF);
+
+        attrs->iv      = VTABLE_get_integer(INTERP, init);
     }
 
 /*
@@ -120,29 +91,6 @@
 
 /*
 
-=item C<PMC instantiate_str(STRING *rep)>
-
-Class method to construct an Integer from the string representation C<rep>.
-
-=cut
-
-*/
-
-    VTABLE PMC *instantiate_str(STRING *rep, INTVAL flags) {
-        const INTVAL type = SELF->vtable->base_type;
-        PMC * const  res  = (flags & PObj_constant_FLAG)
-            ? constant_pmc_new(INTERP, type)
-            : pmc_new(INTERP, type);
-
-        /* Parrot_str_to_int catches overflow automatically, so we don't need to
-           worry about it here. */
-        VTABLE_set_integer_native(INTERP, res, Parrot_str_to_int(INTERP, rep));
-        return res;
-    }
-
-
-/*
-
 =item C<void set_pmc(PMC *value)>
 
 Sets the value of the integer to the value in C<*value>.
@@ -207,7 +155,9 @@
 
 */
     VTABLE INTVAL get_bool() {
-        return SELF.get_integer() ? 1 : 0;
+        INTVAL iv;
+        GET_ATTR_iv(INTERP, SELF, iv);
+        return iv ? 1 : 0;
     }
 
 /*
@@ -221,7 +171,9 @@
 
 */
     VTABLE FLOATVAL get_number() {
-        return SELF.get_integer();
+        INTVAL iv;
+        GET_ATTR_iv(INTERP, SELF, iv);
+        return (FLOATVAL)iv;
     }
 
 
@@ -265,8 +217,6 @@
 
 /*
 
-=item C<void set_integer_same(PMC *value)>
-
 =item C<void set_integer_native(INTVAL value)>
 
 Sets the value of the integer to the value of the C<Integer> C<*value>.
@@ -275,11 +225,6 @@
 
 */
 
-    VTABLE void set_integer_same(PMC *value) {
-        SELF.set_integer_native(VTABLE_get_integer(INTERP, value));
-    }
-
-
     VTABLE void set_integer_native(INTVAL value) {
         SET_ATTR_iv(INTERP, SELF, value);
     }
@@ -1063,7 +1008,7 @@
 
 Raises SELF to the C<value>th power.
 
-RT #46631 Complex and BigInt rhs.
+TODO:  TT #1228: Implement Complex and BigInt RHS values for the pow() functions
 
 =cut
 
@@ -1154,17 +1099,17 @@
         PMC *temp;
 
         switch (value->vtable->base_type) {
-            case enum_class_BigInt:
-                temp = pmc_new(INTERP, enum_class_BigInt);
-                VTABLE_set_integer_native(INTERP, temp, SELF.get_integer());
-                Parrot_mmd_multi_dispatch_from_c_args(interp,
+          case enum_class_BigInt:
+            temp = pmc_new(INTERP, enum_class_BigInt);
+            VTABLE_set_integer_native(INTERP, temp, SELF.get_integer());
+            Parrot_mmd_multi_dispatch_from_c_args(interp,
                     "is_equal", "PP->I", temp, value, &retval);
-                return retval;
-                break;
-            default:
-                return (VTABLE_get_integer(INTERP, SELF)
-                    ==  VTABLE_get_integer(INTERP, value));
-                break;
+            return retval;
+            break;
+          default:
+            return (VTABLE_get_integer(INTERP, SELF)
+                ==  VTABLE_get_integer(INTERP, value));
+            break;
         }
     }
 
@@ -1193,17 +1138,24 @@
 
 
     MULTI INTVAL cmp(Float value) {
-        const FLOATVAL diff = SELF.get_number() - VTABLE_get_number(INTERP, value);
-        return diff > 0 ? 1 : diff < 0 ? -1 : 0;
+        INTVAL iv;
+        GET_ATTR_iv(interp, SELF, iv);
+
+        {
+            const FLOATVAL diff = (FLOATVAL)iv - VTABLE_get_number(INTERP, value);
+            return diff > 0 ? 1 : diff < 0 ? -1 : 0;
+        }
     }
 
 
     MULTI INTVAL cmp(DEFAULT value) {
         /* int or undef */
-        const INTVAL selfint  = SELF.get_integer();
-        const INTVAL valueint = VTABLE_get_integer(INTERP, value);
-
-        return selfint > valueint ? 1 : selfint < valueint ? -1 : 0;
+        INTVAL selfint;
+        GET_ATTR_iv(interp, SELF, selfint);
+        {
+            const INTVAL valueint = VTABLE_get_integer(INTERP, value);
+            return selfint > valueint ? 1 : selfint < valueint ? -1 : 0;
+        }
     }
 
 
@@ -1254,15 +1206,16 @@
 */
 
     VTABLE void increment() {
-        const INTVAL a = VTABLE_get_integer(INTERP, SELF);
-        const INTVAL c = a + 1;
+        INTVAL a, c;
+        GET_ATTR_iv(interp, SELF, a);
+        c = a + 1;
 
         /* did not overflow */
         if ((c^a) >= 0 || (c^1) >= 0)
-            VTABLE_set_integer_native(interp, SELF, c);
+            SET_ATTR_iv(interp, SELF, c);
         else {
-            pmc_reuse(INTERP, SELF, enum_class_BigInt, 0);
-            VTABLE_set_integer_native(INTERP, SELF, a);
+            pmc_reuse(interp, SELF, enum_class_BigInt, 0);
+            VTABLE_set_integer_native(interp, SELF, a);
             VTABLE_increment(interp, SELF);
         }
     }
@@ -1307,7 +1260,7 @@
     VTABLE PMC *absolute(PMC *dest) {
         const INTVAL a = abs(SELF.get_integer());
 
-        /* RT #46635 overflow for -maxint */
+        /* TT # 1245 overflow for -maxint */
         dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         VTABLE_set_integer_native(INTERP, dest, a);
@@ -1359,9 +1312,8 @@
 
 */
     VTABLE void freeze(visit_info *info) {
-        IMAGE_IO * const io = info->image_io;
         SUPER(info);
-        VTABLE_push_integer(INTERP, io, SELF.get_integer());
+        VTABLE_push_integer(INTERP, info, SELF.get_integer());
     }
 
 
@@ -1375,10 +1327,8 @@
 
 */
     VTABLE void thaw(visit_info *info) {
-        IMAGE_IO * const io = info->image_io;
         SUPER(info);
-        if (info->extra_flags == EXTRA_IS_NULL)
-            SELF.set_integer_native(VTABLE_shift_integer(INTERP, io));
+        SELF.set_integer_native(VTABLE_shift_integer(INTERP, info));
     }
 }
 

Modified: branches/orderedhash_revamp/src/pmc/iterator.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/iterator.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/iterator.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -86,18 +86,8 @@
 */
 
     VTABLE void init_pmc(PMC *aggregate) {
-        if (VTABLE_does(INTERP, aggregate, CONST_STRING(INTERP, "array"))
-            || VTABLE_does(INTERP, aggregate, CONST_STRING(INTERP, "hash"))
-            || VTABLE_does(INTERP, aggregate, CONST_STRING(INTERP, "string"))) {
-            /* It's ugly hack... But I cant figure out proper way to do it. */
-            PMC * const real_iter = VTABLE_get_iter(INTERP, aggregate);
-            SELF = pmc_reuse_init(INTERP, SELF, VTABLE_type(INTERP, real_iter), aggregate, 0);
-            return;
-        }
-        else {
-            /* Die horribly */
-            PARROT_ASSERT(!"Unsupported Aggregate for Iterator");
-        }
+        Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
+                "Direct creation of Iterator");
     }
 
 

Modified: branches/orderedhash_revamp/src/pmc/key.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/key.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/key.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -18,7 +18,7 @@
 
 */
 
-pmclass Key need_ext {
+pmclass Key auto_attrs {
     ATTR PMC      *next_key; /* Sometimes it's the next key, sometimes it's
                                 not.  The Key code is like that. */
     ATTR INTVAL    int_key;  /* int value of this key, or something magical if
@@ -40,25 +40,7 @@
 */
 
     VTABLE void init() {
-
-        Parrot_Key_attributes * const attrs =
-            mem_allocate_zeroed_typed(Parrot_Key_attributes);
-
-        PMC_data(SELF) = attrs;
-        PObj_custom_mark_destroy_SETALL(SELF);
-    }
-
-/*
-
-=item C<void destroy()>
-
-Destroy this Key, but not in the way anyone reading its code would want.
-
-=cut
-
-*/
-    VTABLE void destroy() {
-        mem_sys_free(PMC_data(SELF));
+        PObj_custom_mark_SET(SELF);
     }
 
 /*
@@ -76,32 +58,30 @@
         PMC *dkey        = dest;
         PMC *key         = SELF;
 
-        PObj_custom_mark_destroy_SETALL(dest);
-
         for (; key ;) {
             switch (PObj_get_FLAGS(key) & KEY_type_FLAGS) {
-                case KEY_integer_FLAG:
-                case KEY_integer_FLAG | KEY_register_FLAG:
-                    key_set_integer(INTERP, dkey, key_integer(INTERP, key));
-                    break;
-                case KEY_number_FLAG:
-                case KEY_number_FLAG | KEY_register_FLAG:
-                    key_set_number(INTERP, dkey, key_number(INTERP, key));
-                    break;
-                case KEY_string_FLAG:
-                case KEY_string_FLAG | KEY_register_FLAG:
-                    key_set_string(INTERP, dkey,
+              case KEY_integer_FLAG:
+              case KEY_integer_FLAG | KEY_register_FLAG:
+                key_set_integer(INTERP, dkey, key_integer(INTERP, key));
+                break;
+              case KEY_number_FLAG:
+              case KEY_number_FLAG | KEY_register_FLAG:
+                key_set_number(INTERP, dkey, key_number(INTERP, key));
+                break;
+              case KEY_string_FLAG:
+              case KEY_string_FLAG | KEY_register_FLAG:
+                key_set_string(INTERP, dkey,
                         Parrot_str_copy(INTERP, VTABLE_get_string(INTERP, key)));
-                    break;
-                case KEY_pmc_FLAG:
-                case KEY_pmc_FLAG | KEY_register_FLAG:
-                    {
+                break;
+              case KEY_pmc_FLAG:
+              case KEY_pmc_FLAG | KEY_register_FLAG:
+                {
                     PMC * const p = key_pmc(INTERP, key);
                     key_set_pmc(INTERP, dkey, VTABLE_clone(INTERP, p));
-                    }
-                    break;
-                default:
-                    break;
+                }
+                break;
+              default:
+                break;
             }
 
             key = key_next(INTERP, key);
@@ -277,9 +257,6 @@
     VTABLE PMC *shift_pmc() {
         PMC *next_key;
 
-        if (!SELF->pmc_ext)
-            return NULL;
-
         GET_ATTR_next_key(INTERP, SELF, next_key);
         return next_key;
     }
@@ -306,95 +283,6 @@
 
 /*
 
-=item C<PMC *nextkey_keyed(PMC *key, INTVAL what)>
-
-Returns the next key relative to the location specified in C<what>.
-int_key == -1 means end of iteration.
-
-=cut
-
-*/
-
-    VTABLE PMC *nextkey_keyed(PMC *agg, INTVAL what) {
-        PMC  * const ret = SELF;
-        const INTVAL n   = VTABLE_elements(INTERP, agg);
-        INTVAL       int_key;
-
-        switch (what) {
-            case ITERATE_FROM_START_KEYS:
-                /*
-                 * OrderedHash supports two iterators: by key
-                 * or by ordered values
-                 */
-                PObj_get_FLAGS(ret) &= ~KEY_type_FLAGS;
-                PObj_get_FLAGS(ret) |=  KEY_integer_FLAG;
-
-                if (agg->vtable->base_type == enum_class_OrderedHash)
-                    PObj_get_FLAGS(ret) |= KEY_number_FLAG;
-
-                goto init;
-            case ITERATE_FROM_START:    /* reset key */
-                PObj_get_FLAGS(ret) &= ~KEY_type_FLAGS;
-                PObj_get_FLAGS(ret) |= KEY_integer_FLAG;
-
-                /*
-                 * KEY_hash_iterator_FLAGS, which is the same as
-                 * KEY_integer_FLAG | KEY_number_FLAG
-                 * indicates a hash iterator operation
-                 * KEY_integer_FLAG alone is an indexed hash lookup
-                 * with an Integer KEY
-                 */
-
-                 if (VTABLE_isa(INTERP, agg, CONST_STRING(interp, "Hash"))
-                 &&  agg->vtable->base_type != enum_class_OrderedHash)
-                    PObj_get_FLAGS(ret) |= KEY_hash_iterator_FLAGS;
-        init:
-                if (!n) {
-                    SET_ATTR_int_key(INTERP, ret, -1);
-                }
-                else {
-                    SET_ATTR_int_key(INTERP, ret, 0);
-                }
-
-                /* iterating over a hash additionally needs the Bucket index */
-                if (KEY_IS_HASH_ITERATOR(ret))
-                    SET_ATTR_next_key(INTERP, ret, (PMC *)INITBucketIndex);
-
-                break;
-            case ITERATE_GET_NEXT:
-                /*
-                 * src/hash.c:parrot_hash_get_idx() advances to next
-                 * so, if we are iterating over a hash do nothing
-                 * */
-                if (!KEY_IS_HASH_ITERATOR(ret)) {
-                    GET_ATTR_int_key(INTERP, ret, int_key);
-                    if (int_key < n - 1) {
-                        SET_ATTR_int_key(INTERP, ret, int_key+1);
-                    }
-                    else {
-                        SET_ATTR_int_key(INTERP, ret, -1);
-                    }
-                }
-                break;
-            case ITERATE_GET_PREV:
-                GET_ATTR_int_key(INTERP, ret, int_key);
-                if (int_key >= 0)
-                    SET_ATTR_int_key(INTERP, ret, int_key-1);
-                break;
-            case ITERATE_FROM_END:
-                PObj_get_FLAGS(ret) &= ~KEY_type_FLAGS;
-                PObj_get_FLAGS(ret) |= KEY_integer_FLAG;
-                SET_ATTR_int_key(INTERP, ret, n-1);
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL,
-                    EXCEPTION_INVALID_OPERATION,
-                    "Unknown iterator type in Key.nextkey_keyed: %d", what);
-        }
-        return ret;
-    }
-/*
-
 =item C<void visit(visit_info *info)>
 
 This is used by freeze/thaw to visit the contents of the Key.
@@ -416,54 +304,44 @@
 */
 
     VTABLE void visit(visit_info *info) {
-
-        Parrot_Key_attributes *attrs;
-        /* at end a PMCNULL is written during thaw, which should stop visiting
-         * the key */
-
         /* Sometimes visit gets an uninitialized Key.  Initialize it. */
         if (!PMC_data(SELF))
             SELF.init();
 
-        attrs = (Parrot_Key_attributes *)PMC_data(SELF);
-        info->thaw_ptr  = &attrs->next_key;
-        (info->visit_pmc_now)(INTERP, attrs->next_key, info);
+        VISIT_PMC_ATTR(INTERP, info, SELF, Key, next_key);
     }
 
     void freeze(visit_info *info) {
-        IMAGE_IO * const io = info->image_io;
-
         /* write flags */
         const INTVAL flags  = (PObj_get_FLAGS(SELF) & KEY_type_FLAGS);
 
         /* write the contents of a register - else thaw can't restore
          * the register state */
-        VTABLE_push_integer(INTERP, io, flags & ~KEY_register_FLAG);
+        VTABLE_push_integer(INTERP, info, flags & ~KEY_register_FLAG);
 
         /* and contents of this key component */
         switch (flags) {
-            case KEY_integer_FLAG:
-            case KEY_integer_FLAG | KEY_register_FLAG:
-                VTABLE_push_integer(INTERP, io, key_integer(INTERP, SELF));
-                break;
-            case KEY_number_FLAG:
-            case KEY_number_FLAG | KEY_register_FLAG:
-                VTABLE_push_float(INTERP, io, key_number(INTERP, SELF));
-                break;
-            case KEY_string_FLAG:
-            case KEY_string_FLAG | KEY_register_FLAG:
-                VTABLE_push_string(INTERP, io, key_string(INTERP, SELF));
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_KEY_NOT_FOUND,
+          case KEY_integer_FLAG:
+          case KEY_integer_FLAG | KEY_register_FLAG:
+            VTABLE_push_integer(INTERP, info, key_integer(INTERP, SELF));
+            break;
+          case KEY_number_FLAG:
+          case KEY_number_FLAG | KEY_register_FLAG:
+            VTABLE_push_float(INTERP, info, key_number(INTERP, SELF));
+            break;
+          case KEY_string_FLAG:
+          case KEY_string_FLAG | KEY_register_FLAG:
+            VTABLE_push_string(INTERP, info, key_string(INTERP, SELF));
+            break;
+          default:
+            Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_KEY_NOT_FOUND,
                     "Unsupported key type in Key.freeze");
-                break;
+            break;
         }
     }
 
     void thaw(visit_info *info) {
-        IMAGE_IO * const io = info->image_io;
-        const INTVAL flags  = VTABLE_shift_integer(INTERP, io) & KEY_type_FLAGS;
+        const INTVAL flags  = VTABLE_shift_integer(INTERP, info) & KEY_type_FLAGS;
 
         PObj_get_FLAGS(SELF) |= flags;
         PObj_custom_mark_SET(SELF);
@@ -473,19 +351,19 @@
 
         /* get contents */
         switch (flags) {
-            case KEY_integer_FLAG:
-                SET_ATTR_int_key(INTERP, SELF, VTABLE_shift_integer(INTERP, io));
-                break;
-            case KEY_number_FLAG:
-                VTABLE_set_number_native(INTERP, SELF, VTABLE_shift_float(INTERP, io));
-                break;
-            case KEY_string_FLAG:
-                VTABLE_set_string_native(INTERP, SELF, VTABLE_shift_string(INTERP, io));
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_KEY_NOT_FOUND,
+          case KEY_integer_FLAG:
+            SET_ATTR_int_key(INTERP, SELF, VTABLE_shift_integer(INTERP, info));
+            break;
+          case KEY_number_FLAG:
+            VTABLE_set_number_native(INTERP, SELF, VTABLE_shift_float(INTERP, info));
+            break;
+          case KEY_string_FLAG:
+            VTABLE_set_string_native(INTERP, SELF, VTABLE_shift_string(INTERP, info));
+            break;
+          default:
+            Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_KEY_NOT_FOUND,
                     "Unsupported key type in Key.thaw");
-                break;
+            break;
         }
     }
 

Modified: branches/orderedhash_revamp/src/pmc/lexinfo.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/lexinfo.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/lexinfo.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2008, Parrot Foundation.
+Copyright (C) 2008-2009, Parrot Foundation.
 $Id$
 
 =head1 NAME
@@ -18,16 +18,14 @@
 
 */
 
-/* included manually to prevent breaking C++ builds -- see RT #56534*/
-#include "pmc_hash.h"
+#include "pmc/pmc_hash.h"
 
 /*
  * LexInfo contains a constant Hash with constant string
- * keys and integer indices - no marking and no pmc_ext
- * needed (except for freeze/thaw
+ * keys and integer indices
  */
 
-pmclass LexInfo extends Hash need_ext provides hash no_ro {
+pmclass LexInfo extends Hash  provides hash no_ro auto_attrs {
 
 /*
 
@@ -49,8 +47,7 @@
     void class_init() {
 
         /* there is no pmclass const_pmc flag yet */
-        if (pass == 1)
-            interp->vtables[entry]->flags |= VTABLE_IS_CONST_PMC_FLAG;
+        interp->vtables[entry]->flags |= VTABLE_IS_CONST_PMC_FLAG;
 
     }
 
@@ -60,20 +57,13 @@
     }
 
     VTABLE void init_pmc(PMC *sub) {
-        Hash                      *hash;
         Parrot_LexInfo_attributes *attrs =
-            mem_allocate_zeroed_typed(Parrot_LexInfo_attributes);
+            (Parrot_LexInfo_attributes *) PMC_data(SELF);
+
         PARROT_ASSERT(PObj_constant_TEST(SELF));
 
-        hash = parrot_create_hash(INTERP,
-            (PARROT_DATA_TYPE)enum_hash_int,
-            Hash_key_type_STRING,
-            (hash_comp_fn)Parrot_str_not_equal,     /* STRING compare */
-            (hash_hash_key_fn)Parrot_str_to_hashval); /*        hash    */
-
-        PMC_data(SELF) = attrs;
-        SELF.set_pointer(hash);
-        PObj_active_destroy_SET(SELF);
+        /* Set value type to INTVAL */
+        Parrot_pcc_invoke_method_from_c_args(interp, SELF, CONST_STRING(INTERP, "set_value_type"), "I->", (INTVAL)enum_type_INTVAL);
     }
 
 /*
@@ -83,20 +73,12 @@
 Declare a lexical variable that is an alias for a PMC register.  The PIR
 compiler calls this method in response to a ".lex STRING, PREG" directive.
 
-=item C<INTVAL elements()>
-
-Returns the number of elements in the LexInfo hash.
-
 =cut
 
 */
 
     METHOD declare_lex_preg(STRING *name, INTVAL preg) {
-        parrot_hash_put(INTERP, (Hash *)SELF.get_pointer(), name, (void*)preg);
-    }
-
-    VTABLE INTVAL elements() {
-        return parrot_hash_size(INTERP, (Hash *)SELF.get_pointer());
+        VTABLE_set_integer_keyed_str(INTERP, SELF, name, preg);
     }
 
 
@@ -158,29 +140,22 @@
 
 
     VTABLE void thaw(visit_info *info) {
-        IMAGE_IO * const io = info->image_io;
-
-        if (info->extra_flags == EXTRA_IS_NULL) {
-            const INTVAL elems  = VTABLE_shift_integer(INTERP, io);
-            const INTVAL k_type = VTABLE_shift_integer(INTERP, io);
-            const INTVAL v_type = VTABLE_shift_integer(INTERP, io);
-            Hash        *hash;
-
-            UNUSED(k_type);
-            UNUSED(v_type);
-
-            PARROT_ASSERT(v_type == enum_hash_int);
-            /* TODO make a better interface for hash creation
-             * TODO create hash with needed types in the first place
-             */
-
-            SELF.init_pmc(NULL);
-            hash          = (Hash *)SELF.get_pointer();
-            hash->entries = elems;
-        }
-        else {
-            SUPER(info);
-        }
+        const INTVAL elems  = VTABLE_shift_integer(INTERP, info);
+        const INTVAL k_type = VTABLE_shift_integer(INTERP, info);
+        const INTVAL v_type = VTABLE_shift_integer(INTERP, info);
+        Hash        *hash;
+
+        UNUSED(k_type);
+        UNUSED(v_type);
+
+        PARROT_ASSERT(v_type == enum_hash_int);
+        /* TODO make a better interface for hash creation
+         * TODO create hash with needed types in the first place
+         */
+
+        SELF.init_pmc(NULL);
+        hash          = (Hash *)SELF.get_pointer();
+        hash->entries = elems;
     }
 }
 

Modified: branches/orderedhash_revamp/src/pmc/lexpad.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/lexpad.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/lexpad.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -22,13 +22,13 @@
  * LexPad provides a Hash interface for lexical fetch/store
  * needed
  *
- * struct_val ... Parrot_Context *ctx
+ * struct_val ... Context *ctx
  * pmc_val    ... LexInfo
  */
 
-pmclass LexPad provides hash no_ro {
-    ATTR PMC                   *lexinfo;
-    ATTR struct Parrot_Context *ctx;
+pmclass LexPad provides hash no_ro auto_attrs {
+    ATTR PMC *lexinfo;
+    ATTR PMC *ctx;
 
     VTABLE void init() {
         Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
@@ -78,21 +78,11 @@
 
 */
     VTABLE void init_pmc(PMC *lexinfo) {
-        Parrot_LexPad_attributes * const attrs =
-            mem_allocate_zeroed_typed(Parrot_LexPad_attributes);
-
-        PObj_active_destroy_SET(SELF);
-
-        attrs->lexinfo = lexinfo;
-        PMC_data(SELF) = attrs;
-    }
-
-    VTABLE void destroy() {
-        mem_sys_free(PMC_data(SELF));
+        SET_ATTR_lexinfo(INTERP, SELF, lexinfo);
     }
 
     VTABLE void set_pointer(void *ctx) {
-        SET_ATTR_ctx(INTERP, SELF, (struct Parrot_Context *)ctx);
+        SET_ATTR_ctx(INTERP, SELF, (PMC *)ctx);
     }
 
     VTABLE INTVAL elements() {
@@ -117,7 +107,7 @@
     VTABLE PMC *get_pmc_keyed_str(STRING *name) {
         PMC              * info;
         Hash             * hash;
-        Parrot_Context   * ctx;
+        PMC              * ctx;
         HashBucket       * b;
         INTVAL            regno;
 
@@ -142,7 +132,7 @@
     VTABLE void set_pmc_keyed_str(STRING *name, PMC *value) {
         PMC              * info;
         Hash             * hash;
-        Parrot_Context   * ctx;
+        PMC              * ctx;
         HashBucket       * b;
         INTVAL             regno;
 
@@ -169,6 +159,22 @@
         GET_ATTR_lexinfo(INTERP, SELF, lexinfo);
         RETURN(PMC *lexinfo);
     }
+
+/*
+
+=item C<PMC *get_iter()>
+
+Get iterator for declared lexicals.
+
+=cut
+
+*/
+    VTABLE PMC *get_iter() {
+        PMC *lexinfo;
+        GET_ATTR_lexinfo(INTERP, SELF, lexinfo);
+        return VTABLE_get_iter(INTERP, lexinfo);
+    }
+
 }
 
 

Modified: branches/orderedhash_revamp/src/pmc/managedstruct.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/managedstruct.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/managedstruct.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -22,7 +22,7 @@
 typedef void (*custom_free_func_t)(PARROT_INTERP, void *ptr, void *priv);
 typedef PMC * (*custom_clone_func_t)(PARROT_INTERP, PMC *ptr, void *priv);
 
-pmclass ManagedStruct extends UnManagedStruct need_ext {
+pmclass ManagedStruct extends UnManagedStruct auto_attrs {
     /* if custom_free_func and ptr (inherited from UnManagedStruct) are both set,
      * custom_free_func is called before the normal destroy() function does any
      * work.
@@ -46,11 +46,7 @@
 */
 
     VTABLE void init() {
-        Parrot_ManagedStruct_attributes *attrs =
-            mem_allocate_zeroed_typed(Parrot_ManagedStruct_attributes);
-        PObj_active_destroy_SET(SELF);
-        PMC_data(SELF) = attrs;
-
+        PObj_custom_destroy_SET(SELF);
     }
 
 /*
@@ -91,7 +87,6 @@
             } else
                 mem_sys_free(ptr);
         }
-        mem_sys_free(PMC_data(SELF));
     }
 
 /*

Modified: branches/orderedhash_revamp/src/pmc/multisub.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/multisub.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/multisub.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -19,7 +19,15 @@
 
 */
 
-pmclass MultiSub extends ResizablePMCArray need_ext provides array {
+#include "pmc/pmc_callcontext.h"
+
+pmclass MultiSub extends ResizablePMCArray auto_attrs provides array {
+
+    VTABLE STRING * get_string() {
+        PMC * const sub0    = VTABLE_get_pmc_keyed_int(INTERP, SELF, 0);
+        STRING * const name = VTABLE_get_string(INTERP, sub0);
+        return name;
+    }
 
     VTABLE void push_pmc(PMC *value) {
         STRING * const _sub = CONST_STRING(interp, "Sub");
@@ -57,37 +65,43 @@
     }
 
     VTABLE opcode_t *invoke(void *next) {
-        PMC * const func = Parrot_mmd_sort_manhattan(interp, SELF);
+        PMC * const sig_obj = CONTEXT(interp)->current_sig;
+        PMC * const func    = Parrot_mmd_sort_manhattan_by_sig_pmc(interp,
+                SELF, sig_obj);
 
         if (PMC_IS_NULL(func))
-            Parrot_ex_throw_from_c_args(INTERP, NULL, 1, "No applicable methods.\n");
-
+            Parrot_ex_throw_from_c_args(INTERP, NULL, 1,
+                    "No applicable candidates found to dispatch to for '%Ss'",
+                    VTABLE_get_string(interp, SELF));
         return VTABLE_invoke(INTERP, func, next);
     }
 
-    VTABLE PMC *get_iter() {
-        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();
-    }
 
     /* I don't really know how to implement these if they need something
        special, so I'll sort the sub list and defer processing to the
        ResizablePMCArray's VTABLE methods of the same names. Hopefully we
        don't need anything beyond that. */
     VTABLE PMC *get_pmc_keyed(PMC *key) {
-        PMC * const sub = Parrot_mmd_sort_manhattan(INTERP, SELF);
+        PMC * const sig_obj = CONTEXT(interp)->current_sig;
+        PMC * const sub     = Parrot_mmd_sort_manhattan_by_sig_pmc(interp,
+                SELF, sig_obj);
+
         if (PMC_IS_NULL(sub))
-            Parrot_ex_throw_from_c_args(INTERP, NULL, 1, "No applicable methods.\n");
+            Parrot_ex_throw_from_c_args(INTERP, NULL, 1,
+                    "No applicable candidates found to dispatch to for '%Ss'",
+                    VTABLE_get_string(interp, SELF));
         return SUPER(key);
     }
 
     VTABLE PMC *get_pmc_keyed_str(STRING *s) {
-        PMC * const sub = Parrot_mmd_sort_manhattan(INTERP, SELF);
+        PMC * const sig_obj = CONTEXT(interp)->current_sig;
+        PMC * const sub     = Parrot_mmd_sort_manhattan_by_sig_pmc(interp,
+                SELF, sig_obj);
+
         if (PMC_IS_NULL(sub))
-            Parrot_ex_throw_from_c_args(INTERP, NULL, 1, "No applicable methods.\n");
+            Parrot_ex_throw_from_c_args(INTERP, NULL, 1,
+                    "No applicable candidates found to dispatch to for '%Ss'",
+                    VTABLE_get_string(interp, SELF));
         return SUPER(s);
     }
 

Modified: branches/orderedhash_revamp/src/pmc/namespace.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/namespace.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/namespace.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -18,7 +18,7 @@
 
 */
 
-#include "pmc_sub.h"
+#include "pmc/pmc_sub.h"
 
 static void add_to_class(
         Interp *interp,
@@ -50,20 +50,10 @@
     PMC              *       vtable   = nsinfo->vtable;
     PMC              * const classobj = VTABLE_get_class(interp, self);
     STRING           * vtable_key     = NULL;
-    Parrot_sub              *sub;
+    Parrot_Sub_attributes *sub;
 
     PMC_get_sub(interp, value, sub);
 
-    /* Handle vtable methods with two underscores at the start. */
-    if (sub->vtable_index == -1) {
-        if (Parrot_str_find_index(interp, key, CONST_STRING(interp, "__"), 0) == 0) {
-            STRING * const meth_name = Parrot_str_substr(interp, key, 2,
-                (INTVAL)(Parrot_str_byte_length(interp, key) - 2), NULL, 0);
-            sub->vtable_index        =
-                Parrot_get_vtable_index(interp, meth_name);
-        }
-    }
-
     if (sub->vtable_index != -1) {
         /* Insert it in class, if there is a class */
         if (!PMC_IS_NULL(classobj) && PObj_is_class_TEST(classobj)) {
@@ -104,6 +94,74 @@
     return 0;
 }
 
+static int
+maybe_add_sub_to_namespace(PARROT_INTERP, PMC *SELF, STRING *key, PMC *value)
+{
+    STRING *sub_str = CONST_STRING(interp, "Sub");
+
+    if (!PMC_IS_NULL(value)
+    &&   VTABLE_isa(interp, value, sub_str)
+    &&   value->vtable->base_type != enum_class_Object)
+        return ns_insert_sub_keyed_str(interp, SELF, key, value);
+
+    return 0;
+}
+
+static void
+add_nci_to_namespace(PARROT_INTERP, PMC *SELF, STRING *key, PMC *value)
+{
+    STRING *nci_str = CONST_STRING(interp, "NCI");
+
+    if (!PMC_IS_NULL(value)
+    &&   VTABLE_isa(interp, value, nci_str)) {
+        Parrot_NameSpace_attributes * const nsinfo = PARROT_NAMESPACE(SELF);
+        PMC * const classobj = VTABLE_get_class(interp, SELF);
+
+        /* Insert it in class, if there is a class */
+        add_to_class(interp, nsinfo, classobj, key, value);
+    }
+}
+
+static void
+add_multi_to_namespace(PARROT_INTERP, PMC *SELF, STRING *key, PMC *value)
+{
+    STRING *multi_str = CONST_STRING(interp, "MultiSub");
+
+    if (!PMC_IS_NULL(value)
+    &&   VTABLE_isa(interp, value, multi_str)) {
+
+        /* TT #10; work around that Sub doesn't use PMC ATTRs */
+        if (value->vtable->base_type != enum_class_Object
+        &&  VTABLE_elements(interp, value) > 0) {
+            Parrot_NameSpace_attributes * const nsinfo = PARROT_NAMESPACE(SELF);
+            PMC * const classobj = VTABLE_get_class(interp, SELF);
+
+            /* Extract the first alternate and check if it is a method */
+            PMC *pmc_sub = VTABLE_get_pmc_keyed_int(interp, value, 0);
+            Parrot_Sub_attributes *sub;
+            PMC_get_sub(interp, pmc_sub, sub);
+
+            if (sub->comp_flags & SUB_COMP_FLAG_METHOD) {
+                STRING *empty_str   = CONST_STRING(interp, "");
+                STRING *method_name = key;
+                Hash   *hash;
+
+                if (Parrot_str_not_equal(interp, sub->method_name, empty_str))
+                    method_name = sub->method_name;
+
+                add_to_class(interp, nsinfo, classobj, method_name, value);
+
+                GETATTR_NameSpace_hash(interp, SELF, hash);
+
+                parrot_hash_put(interp, hash,
+                    hash_key_from_string(interp, hash, key),
+                    hash_value_from_pmc(interp, hash, value));
+            }
+        }
+    }
+}
+
+
 /*
  * Typically a named slot contains either another namespace or a
  * var/sub (not both).
@@ -123,7 +181,7 @@
 
 #define FPA_is_ns_ext PObj_private0_FLAG
 
-pmclass NameSpace extends Hash provides hash need_ext no_ro {
+pmclass NameSpace extends Hash provides hash no_ro auto_attrs {
 
     ATTR STRING *name;     /* Name of this namespace part. */
     ATTR PMC    *_class;   /* The class or role attached to this namespace. */
@@ -144,8 +202,6 @@
 */
 
     VTABLE void init() {
-        PMC_data(SELF)    =
-                mem_allocate_zeroed_typed(Parrot_NameSpace_attributes);
         PARROT_NAMESPACE(SELF)->vtable = PMCNULL;
         PARROT_NAMESPACE(SELF)->_class = PMCNULL;
         SELF.set_pointer(parrot_new_hash(INTERP));
@@ -163,31 +219,15 @@
 */
     VTABLE void mark() {
         Parrot_NameSpace_attributes * const nsinfo = PARROT_NAMESPACE(SELF);
-        SUPER();
-        if (nsinfo->parent)
-            Parrot_gc_mark_PObj_alive(INTERP, (PObj *)nsinfo->parent);
-        if (nsinfo->name)
-            Parrot_gc_mark_PObj_alive(INTERP, (PObj *)nsinfo->name);
-        if (nsinfo->_class)
-            Parrot_gc_mark_PObj_alive(INTERP, (PObj *)nsinfo->_class);
-        if (nsinfo->vtable)
-            Parrot_gc_mark_PObj_alive(INTERP, (PObj *)nsinfo->vtable);
-        if (nsinfo->methods)
-            Parrot_gc_mark_PObj_alive(INTERP, (PObj *)nsinfo->methods);
-    }
-
-/*
-
-=item C<void destroy()>
 
-Frees the namespace info struct.
+        if (nsinfo->hash)
+            parrot_mark_hash(interp, nsinfo->hash);
 
-=cut
-
-*/
-    VTABLE void destroy() {
-        /* Call Hash.destroy. It will free all memory. */
-        SUPER();
+        Parrot_gc_mark_PMC_alive(interp, nsinfo->parent);
+        Parrot_gc_mark_PMC_alive(interp, nsinfo->_class);
+        Parrot_gc_mark_PMC_alive(interp, nsinfo->vtable);
+        Parrot_gc_mark_PMC_alive(interp, nsinfo->methods);
+        Parrot_gc_mark_STRING_alive(interp, nsinfo->name);
     }
 
 /*
@@ -247,50 +287,14 @@
         PMC * const old = (PMC *)parrot_hash_get(INTERP, (Hash *)SELF.get_pointer(), key);
 
         /* If it's a sub... */
-        if (!PMC_IS_NULL(value) && VTABLE_isa(INTERP, value, CONST_STRING(INTERP, "Sub"))) {
-            /* TT #10; work around that Sub doesn't use PMC ATTRs */
-            if (value->vtable->base_type != enum_class_Object) {
-                if (ns_insert_sub_keyed_str(interp, SELF, key, value))
-                    return;
-            }
-        }
+        if (maybe_add_sub_to_namespace(interp, SELF, key, value))
+            return;
 
         /* If it's an NCI method */
-        if (!PMC_IS_NULL(value) && VTABLE_isa(INTERP, value, CONST_STRING(INTERP, "NCI"))) {
-            Parrot_NameSpace_attributes * const nsinfo = PARROT_NAMESPACE(SELF);
-            PMC * const classobj = VTABLE_get_class(interp, SELF);
-
-            /* Insert it in class, if there is a class */
-              add_to_class(INTERP, nsinfo, classobj, key, value);
-        }
+        add_nci_to_namespace(interp, SELF, key, value);
 
         /* If it's a multi-sub and the first in this NS... */
-        if (!PMC_IS_NULL(value)
-        &&   VTABLE_isa(INTERP, value, CONST_STRING(INTERP, "MultiSub"))) {
-
-            /* TT #10; work around that Sub doesn't use PMC ATTRs */
-            if (value->vtable->base_type != enum_class_Object
-            && VTABLE_elements(interp, value) > 0) {
-                Parrot_NameSpace_attributes * const nsinfo = PARROT_NAMESPACE(SELF);
-                PMC * const classobj = VTABLE_get_class(interp, SELF);
-
-                /* Extract the first alternate and check if it is a method */
-                PMC *pmc_sub = VTABLE_get_pmc_keyed_int(interp, value, 0);
-                Parrot_sub *sub;
-                PMC_get_sub(INTERP, pmc_sub, sub);
-
-                if (sub->comp_flags & SUB_COMP_FLAG_METHOD) {
-                    STRING *method_name = key;
-
-                    if (Parrot_str_not_equal(interp, sub->method_name, CONST_STRING(interp, "")))
-                        method_name = sub->method_name;
-
-                    add_to_class(INTERP, nsinfo, classobj, method_name, value);
-
-                    SUPER(key, value);
-                }
-            }
-        }
+        add_multi_to_namespace(interp, SELF, key, value);
 
         if (!old)
             SUPER(key, value);

Modified: branches/orderedhash_revamp/src/pmc/nci.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/nci.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/nci.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2001-2008, Parrot Foundation.
+Copyright (C) 2001-2009, Parrot Foundation.
 $Id$
 
 =head1 NAME
@@ -21,62 +21,68 @@
 typedef INTVAL (*nci_sub_t)(PARROT_INTERP, PMC *);
 typedef INTVAL (*nci_jit_sub_t)(PARROT_INTERP, PMC *, char *);
 
-void pcc_params(PARROT_INTERP, STRING *sig, Parrot_NCI_attributes * const nci_info);
-void pcc_params(PARROT_INTERP, STRING *sig, Parrot_NCI_attributes * const nci_info) {
-    size_t  sig_length = Parrot_str_byte_length(interp, sig);
-    char   *param_sig  = mem_allocate_n_typed(sig_length, char);
-    size_t  j          = 0;
+void pcc_params(PARROT_INTERP, STRING *sig, Parrot_NCI_attributes * const nci_info,
+                size_t sig_length);
+void pcc_params(PARROT_INTERP, STRING *sig, Parrot_NCI_attributes * const nci_info,
+                size_t sig_length) {
+    char    param_buf[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+    char   *param_sig    = sig_length <= 7
+                         ? param_buf
+                         : mem_allocate_n_typed(sig_length, char);
+    size_t  j            = 0;
     size_t  i;
 
     for (i = 1; i < sig_length; i++) {
         INTVAL c = Parrot_str_indexed(interp, sig, i);
 
         switch (c) {
-            case (INTVAL)'0':    /* null ptr or such - doesn't consume a reg */
-                break;
-            case (INTVAL)'f':
-            case (INTVAL)'N':
-            case (INTVAL)'d':
-                param_sig[j++] = 'N';
-                break;
-            case (INTVAL)'I':   /* INTVAL */
-            case (INTVAL)'l':   /* long */
-            case (INTVAL)'i':   /* int */
-            case (INTVAL)'s':   /* short */
-            case (INTVAL)'c':   /* char */
-                param_sig[j++] = 'I';
-                break;
-            case (INTVAL)'S':
-            case (INTVAL)'t':   /* string, pass a cstring */
-                param_sig[j++] = 'S';
-                break;
-            case (INTVAL)'J':   /* interpreter */
-                break;
-            case (INTVAL)'p':   /* push pmc->data */
-            case (INTVAL)'O':   /* push PMC * object in P2 */
-            case (INTVAL)'P':   /* push PMC * */
-            case (INTVAL)'V':   /* push PMC * */
-                param_sig[j++] = 'P';
-            case (INTVAL)'v':
-                break;
-                /* I have no idea how to handle these */
-            case (INTVAL)'2':
-            case (INTVAL)'3':
-            case (INTVAL)'4':
-                param_sig[j++] = 'I';
-                break;
-            case (INTVAL)'@':
-                param_sig[j++] = '@';
-                break;
-            case (INTVAL)'b':   /* buffer (void*) pass PObj_bufstart(SReg) */
-            case (INTVAL)'B':   /* buffer (void**) pass &PObj_bufstart(SReg) */
-                param_sig[j++] = 'S';
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL,
+          case (INTVAL)'0':    /* null ptr or such - doesn't consume a reg */
+            break;
+          case (INTVAL)'f':
+          case (INTVAL)'N':
+          case (INTVAL)'d':
+            param_sig[j++] = 'N';
+            break;
+          case (INTVAL)'I':   /* INTVAL */
+          case (INTVAL)'l':   /* long */
+          case (INTVAL)'i':   /* int */
+          case (INTVAL)'s':   /* short */
+          case (INTVAL)'c':   /* char */
+            param_sig[j++] = 'I';
+            break;
+          case (INTVAL)'S':
+          case (INTVAL)'t':   /* string, pass a cstring */
+            param_sig[j++] = 'S';
+            break;
+          case (INTVAL)'J':   /* interpreter */
+            break;
+          case (INTVAL)'p':   /* push pmc->data */
+          case (INTVAL)'O':   /* push PMC * object in P2 */
+          case (INTVAL)'P':   /* push PMC * */
+          case (INTVAL)'V':   /* push PMC * */
+            param_sig[j++] = 'P';
+          case (INTVAL)'v':
+            break;
+            /* I have no idea how to handle these */
+          case (INTVAL)'2':
+          case (INTVAL)'3':
+          case (INTVAL)'4':
+            param_sig[j++] = 'I';
+            break;
+          case (INTVAL)'@':
+            param_sig[j++] = '@';
+            break;
+          case (INTVAL)'b': /* buffer (void*) pass Buffer_bufstart(SReg) */
+          case (INTVAL)'B': /* buffer (void**) pass &Buffer_bufstart(SReg) */
+            param_sig[j++] = 'S';
+            break;
+          default:
+            if (sig_length > 7)
+                mem_sys_free(param_sig);
+            Parrot_ex_throw_from_c_args(interp, NULL,
                     EXCEPTION_JIT_ERROR,
                     "Unknown param Signature %c\n", (char)c);
-                break;
+            break;
         }
     }
 
@@ -90,11 +96,34 @@
     else
         nci_info->pcc_params_signature = CONST_STRING(interp, "");
 
-    mem_sys_free(param_sig);
+    if (sig_length > 7)
+        mem_sys_free(param_sig);
 }
 
+/* actually build the NCI thunk */
+static nci_sub_t build_func(PARROT_INTERP, PMC *, Parrot_NCI_attributes *);
 
-pmclass NCI need_ext {
+static
+nci_sub_t build_func(PARROT_INTERP, PMC *pmc, Parrot_NCI_attributes *nci_info)
+{
+    STRING    *key        = nci_info->signature;
+    size_t     key_length = Parrot_str_byte_length(interp, key);
+    int       jitted      = 0;
+
+    pcc_params(interp, key, nci_info, key_length);
+
+    /* Arity is length of that string minus one (the return type). */
+    nci_info->arity       = key_length - 1;
+
+    /* Build call function. */
+    nci_info->func        = (PMC *)(build_call_func(interp, pmc, key, &jitted));
+    nci_info->jitted      = jitted;
+
+    return (nci_sub_t)nci_info->func;
+}
+
+
+pmclass NCI auto_attrs {
     ATTR STRING    *signature;              /* The signature. */
     ATTR void      *func;                   /* Function pointer to call. */
     ATTR void      *orig_func;              /* Function pointer
@@ -148,12 +177,9 @@
 */
 
     VTABLE void init() {
-        PMC_data(SELF) = mem_allocate_zeroed_typed(Parrot_NCI_attributes);
-
         /* Mark that we're not a raw NCI. */
         PObj_flag_CLEAR(private2, SELF);
         PObj_custom_mark_SET(SELF);
-        PObj_active_destroy_SET(SELF);
     }
 
 /*
@@ -176,30 +202,21 @@
     }
 
     VTABLE void set_pointer_keyed_str(STRING *key, void *func) {
-        Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF);
-        int                             jitted = 0;
+        Parrot_NCI_attributes * const nci_info   = PARROT_NCI(SELF);
 
         /* Store the original function and signature. */
         SET_ATTR_orig_func(INTERP, SELF, func);
 
         /* ensure that the STRING signature is constant */
         if (!PObj_constant_TEST(key)) {
-            char * const key_c = Parrot_str_to_cstring(INTERP, key);
-            key                = string_make(interp, key_c, strlen(key_c),
-                                    NULL, PObj_constant_FLAG);
+            char * const key_c      = Parrot_str_to_cstring(INTERP, key);
+            size_t       key_length = Parrot_str_byte_length(interp, key);
+            key                     = string_make(interp, key_c, key_length,
+                                        NULL, PObj_constant_FLAG);
             Parrot_str_free_cstring(key_c);
         }
 
-        nci_info->signature  = key;
-        pcc_params(INTERP, key, nci_info);
-
-        /* Arity is length of that string minus one (the return type). */
-        nci_info->arity      = Parrot_str_byte_length(INTERP, key) - 1;
-
-        /* Build call function. */
-        nci_info->func       = (PMC *)(build_call_func(INTERP, SELF,
-                                            key, &jitted));
-        nci_info->jitted = jitted;
+        nci_info->signature = key;
     }
 
 /*
@@ -215,29 +232,10 @@
         if (PARROT_NCI(SELF)) {
             Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF);
 
-            if (nci_info->signature)
-                Parrot_gc_mark_PObj_alive(interp, (PObj*)nci_info->signature);
-            if (nci_info->pcc_params_signature)
-                Parrot_gc_mark_PObj_alive(interp, (PObj*)nci_info->pcc_params_signature);
-        }
-    }
-
-/*
-
-=item C<void destroy()>
-
-Destroys the NCI, freeing any allocated memory.
-
-=cut
-
-*/
-
-    VTABLE void destroy() {
-        if (PMC_data(SELF)) {
-            Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF);
-
-            mem_sys_free(nci_info);
-            PMC_data(SELF) = NULL;
+            Parrot_gc_mark_STRING_alive(interp, nci_info->signature);
+            Parrot_gc_mark_STRING_alive(interp, nci_info->pcc_params_signature);
+            Parrot_gc_mark_STRING_alive(interp, nci_info->long_signature);
+            Parrot_gc_mark_PMC_alive(interp, nci_info->multi_sig);
         }
     }
 
@@ -257,7 +255,6 @@
         void                  *orig_func;
 
         PMC * const ret     = pmc_new(INTERP, SELF->vtable->base_type);
-        PMC_data(ret)       = mem_allocate_zeroed_typed(Parrot_NCI_attributes);
         nci_info_ret        = PARROT_NCI(ret);
 
         /* FIXME if data is malloced (JIT/i386!) then we need
@@ -287,25 +284,24 @@
 
     VTABLE INTVAL defined() {
         Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF);
-        return nci_info->func != NULL;
+        return nci_info->orig_func != NULL;
     }
 
 /*
 
 =item C<opcode_t *invoke(void *next)>
 
-Calls the associated C function, returning C<*next>. If
-the invocant is a class, the PMC arguments are
-shifted down.
+Calls the associated C function, returning C<*next>. If the invocant is a
+class, the PMC arguments are shifted down.
 
 =cut
 
 */
 
     VTABLE opcode_t *invoke(void *next) {
-
         Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF);
         nci_sub_t                     func;
+        char                         *sig_str;
         void                         *orig_func;
         PMC                          *cont;
 
@@ -314,16 +310,23 @@
             ? (nci_sub_t) D2FPTR(orig_func)
             : (nci_sub_t) D2FPTR(nci_info->func);
 
-        if (!func)
-            Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
-                "attempt to call NULL function");
+        if (!func) {
+            /* build the thunk only when necessary */
+            func = build_func(interp, SELF, nci_info);
+
+            if (!func)
+                Parrot_ex_throw_from_c_args(INTERP, NULL,
+                    EXCEPTION_INVALID_OPERATION,
+                    "attempt to call NULL function");
+        }
 
         if (nci_info->jitted) {
-
             nci_jit_sub_t jit_func = (nci_jit_sub_t) D2FPTR(nci_info->func);
 
             /* Parrot_eprintf(interp, "JITTED %S\n", nci_info->signature); */
-            jit_func(INTERP, SELF, (char *) nci_info->pcc_params_signature->strstart);
+            sig_str = Parrot_str_to_cstring(interp, nci_info->pcc_params_signature);
+            jit_func(INTERP, SELF, sig_str);
+            Parrot_str_free_cstring(sig_str);
         }
         else {
             if (PObj_flag_TEST(private2, SELF)) {
@@ -343,9 +346,9 @@
          * return continuation here, which gets rid of this frame
          * and returns the real return address
          */
-        if (cont && cont != NEED_CONTINUATION &&
-                (PObj_get_FLAGS(cont) & SUB_FLAG_TAILCALL)) {
-            cont = CONTEXT(interp)->current_cont;
+        if (cont && cont != NEED_CONTINUATION
+        && (PObj_get_FLAGS(cont) & SUB_FLAG_TAILCALL)) {
+            cont = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp));
             next = VTABLE_invoke(INTERP, cont, next);
         }
 
@@ -364,6 +367,8 @@
 
     VTABLE INTVAL get_integer() {
         Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF);
+        if (!nci_info->func)
+            build_func(INTERP, SELF, nci_info);
         return (INTVAL)nci_info->func;
     }
 
@@ -379,7 +384,7 @@
 
     VTABLE INTVAL get_bool() {
         Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF);
-        return (0 != (INTVAL)nci_info->func);
+        return (0 != (INTVAL)nci_info->orig_func);
     }
 
 /*
@@ -395,14 +400,18 @@
         Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF);
         INTVAL arity = 0;
 
-        if (nci_info && nci_info->func)
-            arity = nci_info->arity;
-        else
-            Parrot_ex_throw_from_c_args(INTERP, NULL,
-                EXCEPTION_INVALID_OPERATION,
-                "You cannot get the arity of an undefined NCI.");
+        if (nci_info) {
+            if (!nci_info->func)
+                build_func(INTERP, SELF, nci_info);
+            if (nci_info->func) {
+                arity = nci_info->arity;
+                RETURN(INTVAL arity);
+            }
+        }
 
-        RETURN(INTVAL arity);
+        Parrot_ex_throw_from_c_args(INTERP, NULL,
+            EXCEPTION_INVALID_OPERATION,
+            "You cannot get the arity of an undefined NCI.");
     }
 }
 

Modified: branches/orderedhash_revamp/src/pmc/null.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/null.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/null.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -19,6 +19,15 @@
 
 */
 
+PARROT_DOES_NOT_RETURN
+static void
+null_pmc_access(PARROT_INTERP, int index)
+{
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_NULL_REG_ACCESS,
+            "Null PMC access in %s()",
+            Parrot_get_vtable_name(interp, index));
+}
+
 pmclass Null singleton {
 
 /*
@@ -61,6 +70,22 @@
         return PMC_IS_NULL(value);
     }
 
+/*
+
+=item C<PMC *find_method(STRING *method_name)>
+
+=cut
+
+Gives a more informative message than the automaticaaly generated version.
+
+*/
+
+    VTABLE PMC *find_method(STRING *method_name) {
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_NULL_REG_ACCESS,
+                "Null PMC access in find_method('%Ss')",
+                method_name);
+    }
+
 }
 
 /*

Modified: branches/orderedhash_revamp/src/pmc/object.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/object.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/object.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -19,7 +19,7 @@
 */
 
 #include "parrot/oo_private.h"
-#include "pmc_class.h"
+#include "pmc/pmc_class.h"
 
 /* This finds the index of an attribute in an object's attribute store and
  * returns it. Returns -1 if the attribute does not exist. */
@@ -27,11 +27,11 @@
 get_attrib_index(PARROT_INTERP, PMC *self, STRING *name)
 {
     Parrot_Class_attributes * const _class  = PARROT_CLASS(self);
-    const INTVAL                    cur_hll = CONTEXT(interp)->current_HLL;
+    const INTVAL                    cur_hll = Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp));
     int                             num_classes, i;
     INTVAL                          retval;
 
-    CONTEXT(interp)->current_HLL = 0;
+    Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp), 0);
 
     /* First see if we can find it in the cache. */
     retval                       = VTABLE_get_integer_keyed_str(interp,
@@ -40,7 +40,7 @@
     /* there's a semi-predicate problem with a retval of 0 */
     if (retval
     || VTABLE_exists_keyed_str(interp, _class->attrib_cache, name)) {
-        CONTEXT(interp)->current_HLL = cur_hll;
+        Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp), cur_hll);
         return retval;
     }
 
@@ -65,12 +65,12 @@
             VTABLE_set_integer_keyed_str(interp, _class->attrib_cache, name,
                 index);
 
-            CONTEXT(interp)->current_HLL = cur_hll;
+            Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp), cur_hll);
             return index;
         }
     }
 
-    CONTEXT(interp)->current_HLL = cur_hll;
+    Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp), cur_hll);
     return -1;
 }
 
@@ -107,7 +107,33 @@
     return -1;
 }
 
-pmclass Object need_ext {
+static PMC *
+find_cached(PARROT_INTERP, PMC *_class, STRING *name)
+{
+    PMC *cache;
+    GETATTR_Class_meth_cache(interp, _class, cache);
+
+    if (PMC_IS_NULL(cache))
+        return PMCNULL;
+
+    return VTABLE_get_pmc_keyed_str(interp, cache, name);
+}
+
+static void
+cache_method(PARROT_INTERP, PMC *_class, STRING *name, PMC *method)
+{
+    PMC *cache;
+    GETATTR_Class_meth_cache(interp, _class, cache);
+
+    if (PMC_IS_NULL(cache)) {
+        cache = pmc_new(interp, enum_class_Hash);
+        SETATTR_Class_meth_cache(interp, _class, cache);
+    }
+
+    VTABLE_set_pmc_keyed_str(interp, cache, name, method);
+}
+
+pmclass Object auto_attrs {
     ATTR PMC *_class;       /* The class this is an instance of. */
     ATTR PMC *attrib_store; /* The attributes store - a resizable PMC array. */
 
@@ -146,13 +172,12 @@
 
 =item C<void destroy()>
 
-Free the object's underlying struct.
+Just to avoid the automatic generation of one.
 
 =cut
 
 */
     VTABLE void destroy() {
-        mem_sys_free(PMC_data(SELF));
     }
 
 /*
@@ -172,8 +197,12 @@
         /* If there's a vtable override for 'name' run that instead. */
         PMC * const method = Parrot_oo_find_vtable_override(interp, _class, name);
 
-        if (!PMC_IS_NULL(method))
-            return (STRING *)Parrot_run_meth_fromc_args(interp, method, SELF, name, "S");
+        if (!PMC_IS_NULL(method)) {
+            STRING *result = NULL;
+            Parrot_pcc_invoke_sub_from_c_args(interp, method, "Pi->S",
+                    SELF, &result);
+            return result;
+        }
         else
             return VTABLE_get_string(interp, _class);
     }
@@ -191,10 +220,8 @@
         if (PARROT_OBJECT(SELF)) {
             Parrot_Object_attributes * const obj = PARROT_OBJECT(SELF);
 
-            if (obj->_class)
-                Parrot_gc_mark_PObj_alive(interp, (PObj*)obj->_class);
-            if (obj->attrib_store)
-                Parrot_gc_mark_PObj_alive(interp, (PObj*)obj->attrib_store);
+            Parrot_gc_mark_PMC_alive(interp, obj->_class);
+            Parrot_gc_mark_PMC_alive(interp, obj->attrib_store);
         }
     }
 
@@ -217,9 +244,12 @@
         PMC * const method = Parrot_oo_find_vtable_override(interp,
                 VTABLE_get_class(interp, SELF), get_attr);
 
-        if (!PMC_IS_NULL(method))
-            return (PMC *)Parrot_run_meth_fromc_args(interp, method, SELF,
-                    get_attr, "PS", name);
+        if (!PMC_IS_NULL(method)) {
+            PMC *result = PMCNULL;
+            Parrot_pcc_invoke_sub_from_c_args(interp, method, "PiS->P",
+                    SELF, name, &result);
+            return result;
+        }
 
         /* Look up the index. */
         index = get_attrib_index(interp, obj->_class, name);
@@ -276,9 +306,8 @@
         PMC * const method = Parrot_oo_find_vtable_override(interp,
                 VTABLE_get_class(interp, SELF), vtable_meth_name);
         if (!PMC_IS_NULL(method)) {
-            PMC *unused = (PMC *)Parrot_run_meth_fromc_args(interp, method,
-                SELF, vtable_meth_name, "vSP", name, value);
-            UNUSED(unused);
+            Parrot_pcc_invoke_sub_from_c_args(interp, method, "PiSP->",
+                SELF, name, value);
             return;
         }
 
@@ -325,48 +354,66 @@
 
 */
     VTABLE PMC *find_method(STRING *name) {
-        Parrot_Object_attributes * const obj         = PARROT_OBJECT(SELF);
-        Parrot_Class_attributes  * const _class      = PARROT_CLASS(obj->_class);
-        STRING                   * const find_method = CONST_STRING(interp, "find_method");
-        PMC           *method        = PMCNULL;
+        Parrot_Object_attributes * const obj    = PARROT_OBJECT(SELF);
+        Parrot_Class_attributes  * const _class = PARROT_CLASS(obj->_class);
+        PMC                             *method = find_cached(interp, obj->_class, name);
 
-        /* Walk and search. One day, we'll use the cache first. */
-        const int num_classes        = VTABLE_elements(interp,
+        if (!PMC_IS_NULL(method))
+            return method;
+        else {
+            STRING * const find_method = CONST_STRING(interp, "find_method");
+            const int      num_classes = VTABLE_elements(interp,
                                                       _class->all_parents);
-        const int all_in_universe    = !CLASS_has_alien_parents_TEST(obj->_class);
-        int i;
 
-        for (i = 0; i < num_classes; i++) {
-            /* Get the class. */
-            PMC * const cur_class =
-                VTABLE_get_pmc_keyed_int(interp, _class->all_parents, i);
+            const int all_in_universe  =
+                            !CLASS_has_alien_parents_TEST(obj->_class);
+            int i;
+
+            for (i = 0; i < num_classes; i++) {
+                /* Get the class. */
+                PMC * const cur_class =
+                    VTABLE_get_pmc_keyed_int(interp, _class->all_parents, i);
+
+                const Parrot_Class_attributes * const class_info =
+                        PARROT_CLASS(cur_class);
+
+                /* If there's a vtable override for 'find_method' in the
+                 * current class, run that first. */
+
+                method = Parrot_oo_find_vtable_override_for_class(interp,
+                            cur_class, find_method);
+
+                if (!PMC_IS_NULL(method)) {
+                    PMC *result = PMCNULL;
+                    Parrot_pcc_invoke_sub_from_c_args(interp, method,
+                            "PiS->P", SELF, name, &result);
 
-            const Parrot_Class_attributes * const class_info = PARROT_CLASS(cur_class);
+                    /* break out to the CACHE IF FOUND code */
+                    method = result;
+                    break;
+                }
 
-            /* If there's a vtable override for 'find_method' in the current
-             * class, run that first. */
-            method = Parrot_oo_find_vtable_override_for_class(interp, cur_class,
-                    find_method);
+                /* If it's from this universe or the class doesn't inherit from
+                 * anything outside of it... */
+                if (all_in_universe || VTABLE_isa(interp, cur_class, CONST_STRING(interp, "Class"))) {
+                    method = VTABLE_get_pmc_keyed_str(interp,
+                                    class_info->methods, name);
+
+                    /* Found it! */
+                    if (!PMC_IS_NULL(method))
+                        break;
+                }
+                else
+                    Parrot_ex_throw_from_c_args(INTERP, NULL, -1,
+                        "Class %Ss inherits from alien parents.",
+                        class_info->name);
+            }
 
             if (!PMC_IS_NULL(method))
-                return (PMC *)Parrot_run_meth_fromc_args(interp, method, SELF,
-                        find_method, "PS", name);
+                cache_method(interp, obj->_class, name, method);
 
-            /* If it's from this universe or the class doesn't inherit from
-             * anything outside of it... */
-            if (all_in_universe || VTABLE_isa(interp, cur_class, CONST_STRING(interp, "Class"))) {
-                method = VTABLE_get_pmc_keyed_str(interp, class_info->methods, name);
-                /* Found it! */
-                if (!PMC_IS_NULL(method))
-                    break;
-            }
-            else {
-                Parrot_ex_throw_from_c_args(INTERP, NULL, -1,
-                        "Class %Ss inherits from alien parents.", class_info->name);
-            }
+            return method;
         }
-
-        return method;
     }
 
 /*
@@ -394,9 +441,8 @@
                     cur_class, meth_name);
             if (!PMC_IS_NULL(meth)) {
                 INTVAL result;
-                Parrot_pcc_invoke_sub_from_c_args(interp, meth, "P->I", pmc, &result);
+                Parrot_pcc_invoke_sub_from_c_args(interp, meth, "Pi->I", pmc, &result);
                 return result;
-/*            return (INTVAL)Parrot_run_meth_fromc_args_reti(interp, meth, pmc, meth_name, "I"); */
 
             }
             /* method name is get_integer */
@@ -430,9 +476,12 @@
         PMC * const method = Parrot_oo_find_vtable_override(interp,
                 classobj, get_class);
 
-        if (!PMC_IS_NULL(method))
-            return (PMC *)Parrot_run_meth_fromc_args(interp, method, SELF,
-                    get_class, "P");
+        if (!PMC_IS_NULL(method)) {
+            PMC *result;
+            Parrot_pcc_invoke_sub_from_c_args(interp, method, "Pi->P",
+                    SELF, &result);
+            return result;
+        }
 
         return classobj;
     }
@@ -454,9 +503,12 @@
         PMC * const method = Parrot_oo_find_vtable_override(interp,
                 classobj, get_namespace);
 
-        if (!PMC_IS_NULL(method))
-            return (PMC *)Parrot_run_meth_fromc_args(interp, method, SELF,
-                    get_namespace, "P");
+        if (!PMC_IS_NULL(method)) {
+            PMC *result;
+            Parrot_pcc_invoke_sub_from_c_args(interp, method, "Pi->P",
+                    SELF, &result);
+            return result;
+        }
         else
             return VTABLE_inspect_str(interp, classobj, CONST_STRING(interp, "namespace"));
 
@@ -540,9 +592,13 @@
             PMC * const method = Parrot_oo_find_vtable_override(interp,
                 classobj, meth_name);
 
-            if (!PMC_IS_NULL(method)
-             && Parrot_run_meth_fromc_args_reti(interp, method, SELF, meth_name, "IS", role_name))
-                return 1;
+            if (!PMC_IS_NULL(method)) {
+                INTVAL result;
+                Parrot_pcc_invoke_sub_from_c_args(interp, method,
+                        "PiS->I", SELF, role_name, &result);
+                if (result)
+                    return 1;
+            }
         }
         /* Check the superclass's vtable interface, if any. */
         if (SUPER(role_name))
@@ -601,8 +657,16 @@
             PMC * const meth =
                 Parrot_oo_find_vtable_override_for_class(interp, cur_class,
                                                          meth_name);
-            if (!PMC_IS_NULL(meth))
+            if (!PMC_IS_NULL(meth)) {
+                /* Experimental code. See DEPRECATED.pod */
+                PMC *call_sig = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
+                if (PMC_IS_NULL(interp->current_object) &&
+                        (VTABLE_elements(interp, call_sig) == 0 ||
+                        VTABLE_get_pmc_keyed_int(interp, call_sig, 0) != SELF))
+                    VTABLE_unshift_pmc(interp, call_sig, SELF);
+
                 return VTABLE_invoke(interp, meth, next);
+            }
 
             if (cur_class->vtable->base_type == enum_class_PMCProxy) {
                 /* Get the PMC instance and call the vtable method on that. */
@@ -643,26 +707,20 @@
 */
 
     VTABLE PMC * clone() {
-    Parrot_Object_attributes * const obj = PARROT_OBJECT(pmc);
-        Parrot_Class_attributes  * const _class    = PARROT_CLASS(obj->_class);
-        STRING        * const meth_name = CONST_STRING(interp, "clone");
-
-        /* See if we have a custom override of the method first. */
-        const int num_classes = VTABLE_elements(interp, _class->all_parents);
-        int i;
-        for (i = 0; i < num_classes; i++) {
-            /* Get the class. */
-            PMC * const cur_class = VTABLE_get_pmc_keyed_int(interp, _class->all_parents, i);
-
-            /* Look for a method and run it if we find one. */
-            PMC * const meth =
-                Parrot_oo_find_vtable_override_for_class(interp, cur_class, meth_name);
-            if (!PMC_IS_NULL(meth))
-                return (PMC*)Parrot_run_meth_fromc_args(interp, meth, pmc, meth_name, "P");
+        Parrot_Object_attributes * const obj = PARROT_OBJECT(pmc);
+        /* If we have a custom override, invoke it.
+         * If not, use the oo function. */
+        STRING * const meth_name = CONST_STRING(interp, "clone");
+        PMC * const meth =
+                Parrot_oo_find_vtable_override(interp, obj->_class, meth_name);
+        if (!PMC_IS_NULL(meth)) {
+            PMC *result;
+            Parrot_pcc_invoke_sub_from_c_args(interp, meth, "Pi->P",
+                    pmc, &result);
+            return result;
         }
-
-        /* If we get here, no custom clone. Create a new object PMC. */
-        return Parrot_oo_clone_object(interp, SELF, obj->_class, NULL);
+        else
+            return Parrot_oo_clone_object(interp, SELF, obj->_class, NULL);
     }
 
 /*
@@ -703,13 +761,7 @@
 */
 
     VTABLE void thaw(visit_info *info) {
-        if (info->extra_flags == EXTRA_IS_PROP_HASH) {
-            SUPER(info);
-        }
-        else if (info->extra_flags == EXTRA_IS_NULL) {
-            /* Allocate the object's core data struct */
-            PMC_data(SELF) = mem_allocate_zeroed_typed(Parrot_Object_attributes);
-        }
+        return;
     }
 
 /*
@@ -725,7 +777,7 @@
     VTABLE void thawfinish(visit_info *info) {
         /* Set custom GC mark and destroy on the object. */
         PObj_custom_mark_SET(SELF);
-        PObj_active_destroy_SET(SELF);
+        PObj_custom_destroy_SET(SELF);
 
         /* Flag that it is an object */
         PObj_is_object_SET(SELF);
@@ -810,7 +862,8 @@
                 classobj, meth_name);
 
         if (!PMC_IS_NULL(method))
-            Parrot_run_meth_fromc_args(interp, method, SELF, meth_name, "vP", type);
+            Parrot_pcc_invoke_sub_from_c_args(interp, method, "PiP->",
+                    SELF, type);
         else
             SUPER(type);
     }

Modified: branches/orderedhash_revamp/src/pmc/orderedhashiterator.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/orderedhashiterator.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/orderedhashiterator.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -4,13 +4,13 @@
 
 =head1 NAME
 
-src/pmc/orderedhashiterator.pmc - Implementation of Iterator for OrderedHash.
+src/pmc/orderedhashiterator.pmc
 
 =head1 DESCRIPTION
 
-=head1 SYNOPSIS
+Implementation of Iterator for OrderedHash.
 
-=head1 Methods
+=head1 METHODS
 
 =over 4
 
@@ -18,10 +18,10 @@
 
 */
 
-#include "pmc_orderedhash.h"
-#include "pmc_hashiteratorkey.h"
+#include "pmc/pmc_orderedhash.h"
+#include "pmc/pmc_hashiteratorkey.h"
 
-pmclass OrderedHashIterator extends Iterator no_ro {
+pmclass OrderedHashIterator extends Iterator no_ro auto_attrs {
     ATTR PMC        *pmc_hash;      /* the Hash which this Iterator iterates */
     ATTR PMC        *next_entry;    /* Next entry to shift/pop */
     ATTR INTVAL      pos;           /* */
@@ -41,7 +41,7 @@
 
     VTABLE void init_pmc(PMC *hash) {
         Parrot_OrderedHashIterator_attributes * const attrs =
-            mem_allocate_zeroed_typed(Parrot_OrderedHashIterator_attributes);
+           (Parrot_OrderedHashIterator_attributes *) PMC_data(SELF);
 
         attrs->pmc_hash         = hash;
         attrs->pos              = 0;
@@ -49,21 +49,7 @@
         attrs->next_entry       = PARROT_ORDEREDHASH(hash)->first;
         PMC_data(SELF)          = attrs;
 
-        PObj_custom_mark_destroy_SETALL(SELF);
-    }
-
-/*
-
-=item C<void destroy()>
-
-destroys this PMC
-
-=cut
-
-*/
-
-    VTABLE void destroy() {
-        mem_sys_free(PMC_data(SELF));
+        PObj_custom_mark_SET(SELF);
     }
 
 /*
@@ -78,8 +64,7 @@
 
     VTABLE void mark() {
         PMC * const hash = PARROT_ORDEREDHASHITERATOR(SELF)->pmc_hash;
-        if (hash)
-             Parrot_gc_mark_PObj_alive(INTERP, (PObj *)hash);
+        Parrot_gc_mark_PMC_alive(INTERP, hash);
     }
 
 /*
@@ -130,6 +115,7 @@
 Returns this Iterator's Hash.
 
 =cut
+
 */
     VTABLE PMC* get_pmc() {
         return PARROT_ORDEREDHASHITERATOR(SELF)->pmc_hash;

Modified: branches/orderedhash_revamp/src/pmc/os.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/os.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/os.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -85,13 +85,13 @@
 #  endif
 #endif
         if (cwd) {
-            STRING * const scwd = Parrot_str_new(interp, cwd, strlen(cwd));
+            STRING * const scwd = Parrot_str_new(INTERP, cwd, strlen(cwd));
             mem_sys_free(cwd);
             RETURN(STRING *scwd);
         }
         else {
             const char * const errmsg = strerror(errno);
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+            Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
                 errmsg);
         }
     }
@@ -108,7 +108,7 @@
 
     METHOD chdir(STRING *path) {
         int error;
-        char * const cpath = Parrot_str_to_cstring(interp, path);
+        char * const cpath = Parrot_str_to_cstring(INTERP, path);
 #ifdef _MSC_VER
         error = _chdir(cpath);
 #else
@@ -117,7 +117,7 @@
         Parrot_str_free_cstring(cpath);
         if (error) {
             const char * const errmsg = strerror(errno);
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+            Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
                 errmsg);
         }
     }
@@ -135,13 +135,13 @@
 
     METHOD rm(STRING *path) {
         struct stat info;
-        char * const cpath = Parrot_str_to_cstring(interp, path);
+        char * const cpath = Parrot_str_to_cstring(INTERP, path);
         int          error = stat(cpath, &info);
 
         if (error) {
             const char * const errmsg = strerror(errno);
             Parrot_str_free_cstring(cpath);
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+            Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
                 errmsg);
         }
 
@@ -154,7 +154,7 @@
             Parrot_str_free_cstring(cpath);
             if (error) {
                 const char * const errmsg = strerror(errno);
-                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+                Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
                     errmsg);
             }
         }
@@ -163,7 +163,7 @@
             Parrot_str_free_cstring(cpath);
             if (error) {
                 const char * const errmsg = strerror(errno);
-                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+                Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
                     errmsg);
             }
         }
@@ -180,7 +180,7 @@
 */
 
     METHOD mkdir(STRING *path, INTVAL mode) {
-        char * const cpath = Parrot_str_to_cstring(interp, path);
+        char * const cpath = Parrot_str_to_cstring(INTERP, path);
         /* should we validate mode? */
 #ifdef WIN32
         const int error = _mkdir(cpath);
@@ -190,7 +190,7 @@
         Parrot_str_free_cstring(cpath);
         if (error) {
             const char * const errmsg = strerror(errno);
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+            Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
                 errmsg);
         }
     }
@@ -219,50 +219,53 @@
 
 =cut
 
+TT #849:  Provide a mechanism for setting 'mtime' and 'atime':
+https://trac.parrot.org/parrot/ticket/849
+
 */
 
     METHOD stat(STRING *path) {
         struct stat   info;
-        char  * const cpath = Parrot_str_to_cstring(interp, path);
+        char  * const cpath = Parrot_str_to_cstring(INTERP, path);
         const int     error = stat(cpath, &info);
 
         Parrot_str_free_cstring(cpath);
 
         if (error) {
             const char * const errmsg = strerror(errno);
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+            Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
                 errmsg);
         }
         else {
-            PMC * const array = pmc_new(interp, enum_class_FixedPMCArray);
-            VTABLE_set_integer_native(interp, array, 13);
+            PMC * const array = pmc_new(INTERP, enum_class_FixedPMCArray);
+            VTABLE_set_integer_native(INTERP, array, 13);
 
-            VTABLE_set_integer_keyed_int(interp, array,  0,
+            VTABLE_set_integer_keyed_int(INTERP, array,  0,
                     (INTVAL)info.st_dev);
-            VTABLE_set_integer_keyed_int(interp, array,  1,
+            VTABLE_set_integer_keyed_int(INTERP, array,  1,
                     (INTVAL)info.st_ino);
-            VTABLE_set_integer_keyed_int(interp, array,  2,
+            VTABLE_set_integer_keyed_int(INTERP, array,  2,
                     (INTVAL)info.st_mode);
-            VTABLE_set_integer_keyed_int(interp, array,  3,
+            VTABLE_set_integer_keyed_int(INTERP, array,  3,
                     (INTVAL)info.st_nlink);
-            VTABLE_set_integer_keyed_int(interp, array,  4,
+            VTABLE_set_integer_keyed_int(INTERP, array,  4,
                     (INTVAL)info.st_uid);
-            VTABLE_set_integer_keyed_int(interp, array,  5,
+            VTABLE_set_integer_keyed_int(INTERP, array,  5,
                     (INTVAL)info.st_gid);
-            VTABLE_set_integer_keyed_int(interp, array,  6,
+            VTABLE_set_integer_keyed_int(INTERP, array,  6,
                     (INTVAL)info.st_rdev);
-            VTABLE_set_integer_keyed_int(interp, array,  7,
+            VTABLE_set_integer_keyed_int(INTERP, array,  7,
                     (INTVAL)info.st_size);
-            VTABLE_set_integer_keyed_int(interp, array,  8,
+            VTABLE_set_integer_keyed_int(INTERP, array,  8,
                     (INTVAL)info.st_atime);
-            VTABLE_set_integer_keyed_int(interp, array,  9,
+            VTABLE_set_integer_keyed_int(INTERP, array,  9,
                     (INTVAL)info.st_mtime);
-            VTABLE_set_integer_keyed_int(interp, array, 10,
+            VTABLE_set_integer_keyed_int(INTERP, array, 10,
                     (INTVAL)info.st_ctime);
 #ifndef WIN32
-            VTABLE_set_integer_keyed_int(interp, array, 11,
+            VTABLE_set_integer_keyed_int(INTERP, array, 11,
                     (INTVAL)info.st_blksize);
-            VTABLE_set_integer_keyed_int(interp, array, 12,
+            VTABLE_set_integer_keyed_int(INTERP, array, 12,
                     (INTVAL)info.st_blocks);
 #endif
             RETURN(PMC *array);
@@ -298,7 +301,7 @@
     METHOD lstat(STRING *path) {
         struct stat info;
 
-        char * const cpath = Parrot_str_to_cstring(interp, path);
+        char * const cpath = Parrot_str_to_cstring(INTERP, path);
 #ifdef WIN32
         const int error = stat(cpath, &info);
 #else
@@ -308,39 +311,39 @@
 
         if (error) {
             const char * const errmsg = strerror(errno);
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+            Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
                 errmsg);
         }
         else {
-            PMC * const array = pmc_new(interp, enum_class_FixedPMCArray);
-            VTABLE_set_integer_native(interp, array, 13);
+            PMC * const array = pmc_new(INTERP, enum_class_FixedPMCArray);
+            VTABLE_set_integer_native(INTERP, array, 13);
 
-            VTABLE_set_integer_keyed_int(interp, array,  0,
+            VTABLE_set_integer_keyed_int(INTERP, array,  0,
                     (INTVAL)info.st_dev);
-            VTABLE_set_integer_keyed_int(interp, array,  1,
+            VTABLE_set_integer_keyed_int(INTERP, array,  1,
                     (INTVAL)info.st_ino);
-            VTABLE_set_integer_keyed_int(interp, array,  2,
+            VTABLE_set_integer_keyed_int(INTERP, array,  2,
                     (INTVAL)info.st_mode);
-            VTABLE_set_integer_keyed_int(interp, array,  3,
+            VTABLE_set_integer_keyed_int(INTERP, array,  3,
                     (INTVAL)info.st_nlink);
-            VTABLE_set_integer_keyed_int(interp, array,  4,
+            VTABLE_set_integer_keyed_int(INTERP, array,  4,
                     (INTVAL)info.st_uid);
-            VTABLE_set_integer_keyed_int(interp, array,  5,
+            VTABLE_set_integer_keyed_int(INTERP, array,  5,
                     (INTVAL)info.st_gid);
-            VTABLE_set_integer_keyed_int(interp, array,  6,
+            VTABLE_set_integer_keyed_int(INTERP, array,  6,
                     (INTVAL)info.st_rdev);
-            VTABLE_set_integer_keyed_int(interp, array,  7,
+            VTABLE_set_integer_keyed_int(INTERP, array,  7,
                     (INTVAL)info.st_size);
-            VTABLE_set_integer_keyed_int(interp, array,  8,
+            VTABLE_set_integer_keyed_int(INTERP, array,  8,
                     (INTVAL)info.st_atime);
-            VTABLE_set_integer_keyed_int(interp, array,  9,
+            VTABLE_set_integer_keyed_int(INTERP, array,  9,
                     (INTVAL)info.st_mtime);
-            VTABLE_set_integer_keyed_int(interp, array, 10,
+            VTABLE_set_integer_keyed_int(INTERP, array, 10,
                     (INTVAL)info.st_ctime);
 #ifndef WIN32
-            VTABLE_set_integer_keyed_int(interp, array, 11,
+            VTABLE_set_integer_keyed_int(INTERP, array, 11,
                     (INTVAL)info.st_blksize);
-            VTABLE_set_integer_keyed_int(interp, array, 12,
+            VTABLE_set_integer_keyed_int(INTERP, array, 12,
                     (INTVAL)info.st_blocks);
 #endif
             RETURN(PMC *array);
@@ -359,8 +362,8 @@
 
     METHOD symlink(STRING *from, STRING *to) {
 #ifndef WIN32
-        char * const cfrom = Parrot_str_to_cstring(interp, from);
-        char * const cto   = Parrot_str_to_cstring(interp, to);
+        char * const cfrom = Parrot_str_to_cstring(INTERP, from);
+        char * const cto   = Parrot_str_to_cstring(INTERP, to);
         const int error    = symlink(cfrom, cto);
 
         Parrot_str_free_cstring(cfrom);
@@ -368,11 +371,11 @@
 
         if (error) {
             const char * const errmsg = strerror(errno);
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+            Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
                 errmsg);
         }
 #else
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+        Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_UNIMPLEMENTED,
                 "Win32 does not support symlinks!");
 #endif
     }
@@ -389,8 +392,8 @@
 
     METHOD link(STRING *from, STRING *to) {
 #ifndef WIN32
-        char * const cfrom = Parrot_str_to_cstring(interp, from);
-        char * const cto   = Parrot_str_to_cstring(interp, to);
+        char * const cfrom = Parrot_str_to_cstring(INTERP, from);
+        char * const cto   = Parrot_str_to_cstring(INTERP, to);
         const int    error = link(cfrom, cto);
 
         Parrot_str_free_cstring(cfrom);
@@ -398,11 +401,11 @@
 
         if (error) {
             const char * const errmsg = strerror(errno);
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+            Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
                 "link() failed for OS PMC: %s\n", errmsg);
         }
 #else
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+        Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
                 "Win32 is not POSIX. Need win32 developer!");
 #endif
     }
@@ -423,7 +426,7 @@
         const INTVAL old = umask((mode_t)mask);
         RETURN(INTVAL old);
 #else
-        Parrot_ex_throw_from_c_args(interp, NULL,
+        Parrot_ex_throw_from_c_args(INTERP, NULL,
             EXCEPTION_UNIMPLEMENTED,
             "Win32 is not POSIX. Need Win32 developer!");
 #endif
@@ -445,18 +448,18 @@
 
     METHOD chroot(STRING *path) {
 #ifndef WIN32
-        char * const cpath = Parrot_str_to_cstring(interp, path);
+        char * const cpath = Parrot_str_to_cstring(INTERP, path);
         const int    error = chroot(cpath);
 
         Parrot_str_free_cstring(cpath);
 
         if (error) {
             const char * const errmsg = strerror(errno);
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+            Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
                 errmsg);
         }
 #else
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+        Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
                 "Win32 is not POSIX. Need Win32 developer!");
 #endif
     }
@@ -473,32 +476,32 @@
 */
     METHOD readdir(STRING *path) {
 #ifndef _MSC_VER
+        char  * const cpath = Parrot_str_to_cstring(INTERP, path);
+        DIR           *dir  = opendir(cpath);
         struct dirent *dirent;
         PMC           *array;
-        char          *cpath = Parrot_str_to_cstring(interp, path);
         STRING        *retval;
-        DIR           *dir   = opendir(cpath);
 
         Parrot_str_free_cstring(cpath);
 
         if (!dir) {
             const char * const errmsg = strerror(errno);
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+            Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
                 errmsg);
         }
 
-        array = pmc_new(interp, enum_class_ResizableStringArray);
+        array = pmc_new(INTERP, enum_class_ResizableStringArray);
 
         while ((dirent = readdir(dir)) != NULL) {
-            retval = Parrot_str_new(interp, dirent->d_name, 0) ;
-            VTABLE_push_string(interp, array, retval);
+            retval = Parrot_str_new(INTERP, dirent->d_name, 0) ;
+            VTABLE_push_string(INTERP, array, retval);
         }
 
         closedir(dir);
 
         RETURN(PMC *array);
 #else
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+        Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
                 "Win32 is not POSIX. Need Win32 developer!");
 #endif
     }
@@ -509,10 +512,11 @@
 thrown.
 
 =cut
+
 */
     METHOD rename(STRING *oldpath, STRING *newpath) {
-        char * const coldpath = Parrot_str_to_cstring(interp, oldpath);
-        char * const cnewpath = Parrot_str_to_cstring(interp, newpath);
+        char * const coldpath = Parrot_str_to_cstring(INTERP, oldpath);
+        char * const cnewpath = Parrot_str_to_cstring(INTERP, newpath);
         const int    ret      = rename(coldpath, cnewpath);
 
         Parrot_str_free_cstring(coldpath);
@@ -520,7 +524,7 @@
 
         if (ret < 0) {
             const char * const errmsg = strerror(errno) ;
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+            Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
                 "%s", errmsg);
         }
     }

Modified: branches/orderedhash_revamp/src/pmc/packfile.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/packfile.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/packfile.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -19,7 +19,7 @@
 
 */
 
-#include "pmc_packfiledirectory.h"
+#include "pmc/pmc_packfiledirectory.h"
 
 /*
 Copy attributes from PackFile* to Packfile PMC.
@@ -43,19 +43,19 @@
 
 }
 
-pmclass Packfile {
-        ATTR INTVAL wordsize;
-        ATTR INTVAL byteorder;
-        ATTR INTVAL fptype;
-        ATTR INTVAL version_major;
-        ATTR INTVAL version_minor;
-        ATTR INTVAL version_patch;
-        ATTR INTVAL bytecode_major;
-        ATTR INTVAL bytecode_minor;
-        ATTR INTVAL uuid_type;
-        ATTR STRING *uuid;
+pmclass Packfile auto_attrs {
+    ATTR INTVAL wordsize;
+    ATTR INTVAL byteorder;
+    ATTR INTVAL fptype;
+    ATTR INTVAL version_major;
+    ATTR INTVAL version_minor;
+    ATTR INTVAL version_patch;
+    ATTR INTVAL bytecode_major;
+    ATTR INTVAL bytecode_minor;
+    ATTR INTVAL uuid_type;
+    ATTR STRING *uuid;
 
-        ATTR PMC    *directory;
+    ATTR PMC    *directory;
 /*
 
 =item C<void init()>
@@ -67,41 +67,23 @@
 */
     VTABLE void init() {
         Parrot_Packfile_attributes *attrs =
-            mem_allocate_zeroed_typed(Parrot_Packfile_attributes);
+                PMC_data_typed(SELF, Parrot_Packfile_attributes*);
         PackFile                   *pf;
 
         attrs->uuid     = Parrot_str_new_noinit(INTERP, enum_stringrep_one, 0);
         attrs->directory = pmc_new(INTERP, enum_class_PackfileDirectory);
-        PMC_data(SELF)  = attrs;
 
         /* Create dummy PackFile and copy default attributes to self */
         pf = PackFile_new(interp, 0);
         copy_packfile_header(interp, SELF, pf);
         PackFile_destroy(interp, pf);
 
-        PObj_custom_mark_destroy_SETALL(SELF);
+        PObj_custom_mark_SET(SELF);
     }
 
 
 /*
 
-=item C<void destroy()>
-
-Destroys the PackFile object.
-
-=cut
-
-*/
-
-    VTABLE void destroy() {
-        if (PARROT_PACKFILE(SELF)) {
-            mem_sys_free(PARROT_PACKFILE(SELF));
-            PMC_data(SELF) = NULL;
-        }
-    }
-
-/*
-
 =item C<void mark()>
 
 Marks the Packfile as alive.
@@ -113,10 +95,8 @@
     VTABLE void mark() {
         Parrot_Packfile_attributes * attrs = PARROT_PACKFILE(SELF);
 
-        if (attrs->uuid)
-            Parrot_gc_mark_PObj_alive(INTERP, (PObj *)attrs->uuid);
-        if (attrs->directory)
-            Parrot_gc_mark_PObj_alive(INTERP, (PObj *)attrs->directory);
+        Parrot_gc_mark_STRING_alive(INTERP, attrs->uuid);
+        Parrot_gc_mark_PMC_alive(INTERP, attrs->directory);
     }
 /*
 

Modified: branches/orderedhash_revamp/src/pmc/packfileannotation.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/packfileannotation.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/packfileannotation.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -19,7 +19,7 @@
 
 */
 
-pmclass PackfileAnnotation {
+pmclass PackfileAnnotation auto_attrs {
     ATTR STRING    *name;
     ATTR INTVAL     offset;
     ATTR INTVAL     value_type;
@@ -40,32 +40,31 @@
 
     VTABLE void init() {
         Parrot_PackfileAnnotation_attributes * attrs =
-                mem_allocate_zeroed_typed(Parrot_PackfileAnnotation_attributes);
+                PMC_data_typed(SELF, Parrot_PackfileAnnotation_attributes*);
 
-        PObj_active_destroy_SET(SELF);
+        PObj_custom_mark_SET(SELF);
         PMC_data(SELF) = attrs;
     }
 
 /*
 
-=item C<void destroy()>
+=item C<void mark()>
 
-Destroys the PMC and frees all allocated memory.
+Marks the object as live.
 
 =cut
 
 */
 
-    VTABLE void destroy() {
+    VTABLE void mark() {
         Parrot_PackfileAnnotation_attributes * attrs =
                 PARROT_PACKFILEANNOTATION(SELF);
 
-        if (attrs) {
-            mem_sys_free(attrs);
-            PMC_data(SELF) = NULL;
-        }
+        Parrot_gc_mark_STRING_alive(interp, attrs->name);
+        Parrot_gc_mark_STRING_alive(interp, attrs->str_value);
     }
 
+
 /*
 
 =item C<INTVAL get_offset()>

Modified: branches/orderedhash_revamp/src/pmc/packfileannotations.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/packfileannotations.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/packfileannotations.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -27,9 +27,9 @@
 
 */
 
-#include "pmc_packfileannotation.h"
+#include "pmc/pmc_packfileannotation.h"
 
-pmclass PackfileAnnotations extends PackfileSegment {
+pmclass PackfileAnnotations auto_attrs extends PackfileSegment {
     /* ConstantTable used for names lookup */
     ATTR PMC *const_table;
 
@@ -47,12 +47,15 @@
 */
     VTABLE void init() {
         Parrot_PackfileAnnotations_attributes * attrs =
-                mem_allocate_zeroed_typed(Parrot_PackfileAnnotations_attributes);
+                PMC_data_typed(SELF, Parrot_PackfileAnnotations_attributes*);
 
         attrs->annotations = pmc_new(interp, enum_class_ResizablePMCArray);
+        /*
+        Don't initialize C<const_table>. It will be set to NULL bu auto_attrs
+        handling. And should be set to proper PMC in set_directory.
+        */
 
-        PObj_custom_mark_destroy_SETALL(SELF);
-        PMC_data(SELF) = attrs;
+        PObj_custom_mark_SET(SELF);
     }
 
 /*
@@ -69,35 +72,12 @@
         Parrot_PackfileAnnotations_attributes * attrs =
                 PARROT_PACKFILEANNOTATIONS(SELF);
 
-        if (attrs->const_table)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)attrs->const_table);
-
-        if (attrs->annotations)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)attrs->annotations);
+        Parrot_gc_mark_PMC_alive(interp, attrs->const_table);
+        Parrot_gc_mark_PMC_alive(interp, attrs->annotations);
 
         SUPER();
     }
 
-/*
-
-=item C<void destroy()>
-
-Destroys the PMC and frees all allocated memory.
-
-=cut
-
-*/
-
-    VTABLE void destroy() {
-        Parrot_PackfileAnnotations_attributes * attrs =
-                PARROT_PACKFILEANNOTATIONS(SELF);
-
-        if (attrs) {
-            mem_sys_free(attrs);
-            PMC_data(SELF) = NULL;
-        }
-    }
-
 
 /*
 
@@ -394,7 +374,23 @@
 
         return res;
     }
+
+/*
+
+=item C<METHOD type()>
+
+Get segment type.
+
+=cut
+
+*/
+
+    METHOD type() {
+        RETURN(INTVAL PF_ANNOTATIONS_SEG);
+    }
+
 }
+
 /*
 
 =back

Modified: branches/orderedhash_revamp/src/pmc/packfileconstanttable.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/packfileconstanttable.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/packfileconstanttable.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -24,7 +24,7 @@
 
 */
 
-pmclass PackfileConstantTable extends PackfileSegment {
+pmclass PackfileConstantTable auto_attrs extends PackfileSegment {
     /* ResizablePMCArray for storing constants */
     ATTR PMC *constants;
 
@@ -43,12 +43,12 @@
 
     VTABLE void init() {
         Parrot_PackfileConstantTable_attributes * attrs =
-                mem_allocate_zeroed_typed(Parrot_PackfileConstantTable_attributes);
+                PMC_data_typed(SELF, Parrot_PackfileConstantTable_attributes*);
 
         attrs->constants = pmc_new(interp, enum_class_ResizablePMCArray);
         attrs->types     = pmc_new(interp, enum_class_ResizableIntegerArray);
 
-        PObj_custom_mark_destroy_SETALL(SELF);
+        PObj_custom_mark_SET(SELF);
         PMC_data(SELF) = attrs;
     }
 
@@ -66,35 +66,12 @@
         Parrot_PackfileConstantTable_attributes * attrs =
                 PARROT_PACKFILECONSTANTTABLE(SELF);
 
-        if (attrs->constants)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)attrs->constants);
-        if (attrs->types)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)attrs->types);
+        Parrot_gc_mark_PMC_alive(interp, attrs->constants);
+        Parrot_gc_mark_PMC_alive(interp, attrs->types);
 
         SUPER();
     }
 
-/*
-
-=item C<void destroy()>
-
-Destroys the PMC and frees all allocated memory.
-
-=cut
-
-*/
-
-    VTABLE void destroy() {
-        Parrot_PackfileConstantTable_attributes * attrs =
-                PARROT_PACKFILECONSTANTTABLE(SELF);
-
-        if (attrs) {
-            mem_sys_free(attrs);
-            PMC_data(SELF) = NULL;
-        }
-    }
-
-
 
 /*
 
@@ -121,21 +98,21 @@
         for (i = 0; i < table->const_count; ++i) {
             val = table->constants[i];
             switch (val->type) {
-                case PFC_NONE:
-                    break;
-                case PFC_NUMBER:
-                    SELF.set_number_keyed_int(i, val->u.number);
-                    break;
-                case PFC_STRING:
-                    SELF.set_string_keyed_int(i, val->u.string);
-                    break;
-                case PFC_KEY:
-                    /* fall through */
-                case PFC_PMC:
-                    SELF.set_pmc_keyed_int(i, val->u.key);
-                    break;
-                default:
-                    Parrot_ex_throw_from_c_args(interp, NULL,
+              case PFC_NONE:
+                break;
+              case PFC_NUMBER:
+                SELF.set_number_keyed_int(i, val->u.number);
+                break;
+              case PFC_STRING:
+                SELF.set_string_keyed_int(i, val->u.string);
+                break;
+              case PFC_KEY:
+                /* fall through */
+              case PFC_PMC:
+                SELF.set_pmc_keyed_int(i, val->u.key);
+                break;
+              default:
+                Parrot_ex_throw_from_c_args(interp, NULL,
                         EXCEPTION_MALFORMED_PACKFILE,
                         "Unknown PackFile constant type: %d", val->type);
             }
@@ -167,23 +144,23 @@
             value = PackFile_Constant_new(interp);
             value->type = VTABLE_get_integer_keyed_int(interp, attrs->types, i);
             switch (value->type) {
-                case PFC_NONE:
-                    break;
-                case PFC_NUMBER:
-                    value->u.number = VTABLE_get_number_keyed_int(interp,
+              case PFC_NONE:
+                break;
+              case PFC_NUMBER:
+                value->u.number = VTABLE_get_number_keyed_int(interp,
                             attrs->constants, i);
-                    break;
-                case PFC_STRING:
-                    value->u.string = VTABLE_get_string_keyed_int(interp,
+                break;
+              case PFC_STRING:
+                value->u.string = VTABLE_get_string_keyed_int(interp,
                             attrs->constants, i);
-                    break;
-                case PFC_KEY:
-                case PFC_PMC:
-                    value->u.key = VTABLE_get_pmc_keyed_int(interp,
+                break;
+              case PFC_KEY:
+              case PFC_PMC:
+                value->u.key = VTABLE_get_pmc_keyed_int(interp,
                             attrs->constants, i);
-                    break;
-                default:
-                    Parrot_ex_throw_from_c_args(interp, NULL,
+                break;
+              default:
+                Parrot_ex_throw_from_c_args(interp, NULL,
                         EXCEPTION_MALFORMED_PACKFILE,
                         "Unknown PackFile constant type: %d", value->type);
             }
@@ -352,8 +329,6 @@
 
 =cut
 
-TODO: Add same for PMCs.
-
 */
     MULTI INTVAL get_or_create_constant(STRING *value) {
         Parrot_PackfileConstantTable_attributes *attrs =
@@ -395,6 +370,44 @@
         return i;
     }
 
+    MULTI INTVAL get_or_create_constant(PMC *value) {
+        Parrot_PackfileConstantTable_attributes *attrs =
+                PARROT_PACKFILECONSTANTTABLE(SELF);
+        INTVAL   num = VTABLE_elements(interp, attrs->types);
+        INTVAL   i;
+        PMC     *val;
+        INTVAL   val_type = value->vtable->base_type == enum_class_Key
+                            ? PFC_KEY
+                            : PFC_PMC;
+
+        for (i=0; i < num; ++i) {
+            INTVAL type = VTABLE_get_integer_keyed_int(interp, attrs->types, i);
+            if (type != val_type)
+                continue;
+
+            val = VTABLE_get_pmc_keyed_int(interp, attrs->constants, i);
+            if (VTABLE_is_equal(INTERP, value, val))
+                return i;
+        }
+        /* Constant not found. Add new one */
+        VTABLE_set_pmc_keyed_int(interp, SELF, i, value);
+        return i;
+    }
+
+/*
+
+=item C<METHOD type()>
+
+Set segment type.
+
+=cut
+
+*/
+
+    METHOD type() {
+        RETURN(INTVAL PF_CONST_SEG);
+    }
+
 
 }
 /*

Modified: branches/orderedhash_revamp/src/pmc/packfiledirectory.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/packfiledirectory.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/packfiledirectory.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -25,7 +25,7 @@
 
 */
 
-pmclass PackfileDirectory extends PackfileSegment {
+pmclass PackfileDirectory auto_attrs extends PackfileSegment {
     /* Directory is a hash of Segments */
     ATTR PMC *hash;
 
@@ -40,12 +40,11 @@
 */
     VTABLE void init() {
         Parrot_PackfileDirectory_attributes * attrs =
-                mem_allocate_zeroed_typed(Parrot_PackfileDirectory_attributes);
+                PMC_data_typed(SELF, Parrot_PackfileDirectory_attributes*);
 
         attrs->hash = pmc_new(interp, enum_class_Hash);
 
-        PObj_custom_mark_destroy_SETALL(SELF);
-        PMC_data(SELF) = attrs;
+        PObj_custom_mark_SET(SELF);
     }
 
 /*
@@ -62,35 +61,13 @@
         Parrot_PackfileDirectory_attributes * attrs =
                 PARROT_PACKFILEDIRECTORY(SELF);
 
-        if (attrs->hash)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)attrs->hash);
+        Parrot_gc_mark_PMC_alive(interp, attrs->hash);
 
         SUPER();
     }
 
 /*
 
-=item C<void destroy()>
-
-Destroys the PMC and frees all allocated memory.
-
-=cut
-
-*/
-
-    VTABLE void destroy() {
-        Parrot_PackfileDirectory_attributes * attrs =
-                PARROT_PACKFILEDIRECTORY(SELF);
-
-        if (attrs) {
-            mem_sys_free(attrs);
-            PMC_data(SELF) = NULL;
-        }
-    }
-
-
-/*
-
 =item C<void set_pointer(void *ptr)>
 
 Initialize PackfileDirectory from PackFile_Directory.
@@ -113,28 +90,28 @@
             STRING  *name;
 
             switch (pfseg->type) {
-                case PF_DIR_SEG:
-                    pmc_type = enum_class_PackfileDirectory;
-                    break;
-                case PF_FIXUP_SEG:
-                    pmc_type = enum_class_PackfileFixupTable;
-                    break;
-                case PF_CONST_SEG:
-                    pmc_type = enum_class_PackfileConstantTable;
-                    break;
-                case PF_ANNOTATIONS_SEG:
-                    pmc_type = enum_class_PackfileAnnotations;
-                    break;
-                case PF_BYTEC_SEG:
-                case PF_UNKNOWN_SEG:
-                case PF_DEBUG_SEG:
-                default:
-                    pmc_type = enum_class_PackfileRawSegment;
-                    break;
+              case PF_DIR_SEG:
+                pmc_type = enum_class_PackfileDirectory;
+                break;
+              case PF_FIXUP_SEG:
+                pmc_type = enum_class_PackfileFixupTable;
+                break;
+              case PF_CONST_SEG:
+                pmc_type = enum_class_PackfileConstantTable;
+                break;
+              case PF_ANNOTATIONS_SEG:
+                pmc_type = enum_class_PackfileAnnotations;
+                break;
+              case PF_BYTEC_SEG:
+              case PF_UNKNOWN_SEG:
+              case PF_DEBUG_SEG:
+              default:
+                pmc_type = enum_class_PackfileRawSegment;
+                break;
             }
 
             segment = pmc_new(interp, pmc_type);
-            name    = Parrot_str_new(interp, pfseg->name, strlen(pfseg->name));
+            name    = pfseg->name;
             VTABLE_set_pmc_keyed_str(interp, SELF, name, segment);
 
             /* Initialize internal PMC structure */
@@ -167,7 +144,7 @@
             PackFile_Segment * const pfseg = (PackFile_Segment *)VTABLE_get_pointer(interp, seg);
 
             pfseg->pf   = pf;
-            pfseg->name = strdup(Parrot_string_cstring(interp, name));
+            pfseg->name = Parrot_str_copy(interp, name);
             PackFile_add_segment(interp, pfdir, pfseg);
         }
 
@@ -246,7 +223,7 @@
 
 */
     VTABLE void set_pmc_keyed_str(STRING *name, PMC *segment)  {
-        Parrot_PCCINVOKE(interp, segment,
+        Parrot_pcc_invoke_method_from_c_args(interp, segment,
             Parrot_str_new_constant(interp, "set_directory"),
             "P->", SELF);
         VTABLE_set_pmc_keyed_str(interp,

Modified: branches/orderedhash_revamp/src/pmc/packfilefixupentry.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/packfilefixupentry.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/packfilefixupentry.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -19,7 +19,7 @@
 
 */
 
-pmclass PackfileFixupEntry {
+pmclass PackfileFixupEntry auto_attrs {
     ATTR INTVAL     type;
     ATTR STRING     *name;
     ATTR INTVAL     offset;
@@ -36,12 +36,11 @@
 */
     VTABLE void init() {
         Parrot_PackfileFixupEntry_attributes * attrs =
-                mem_allocate_zeroed_typed(Parrot_PackfileFixupEntry_attributes);
+                PMC_data_typed(SELF, Parrot_PackfileFixupEntry_attributes*);
 
         attrs->name = Parrot_str_new_noinit(interp, enum_stringrep_one, 0);
 
-        PObj_custom_mark_destroy_SETALL(SELF);
-        PMC_data(SELF) = attrs;
+        PObj_custom_mark_SET(SELF);
     }
 
 /*
@@ -58,33 +57,11 @@
         Parrot_PackfileFixupEntry_attributes * attrs =
                 PARROT_PACKFILEFIXUPENTRY(SELF);
 
-        if (attrs->name)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)attrs->name);
+        Parrot_gc_mark_STRING_alive(interp, attrs->name);
     }
 
 /*
 
-=item C<void destroy()>
-
-Destroys the PMC and frees all allocated memory.
-
-=cut
-
-*/
-
-    VTABLE void destroy() {
-        Parrot_PackfileFixupEntry_attributes * attrs =
-                PARROT_PACKFILEFIXUPENTRY(SELF);
-
-        if (attrs) {
-            mem_sys_free(attrs);
-            PMC_data(SELF) = NULL;
-        }
-    }
-
-
-/*
-
 =item C<void set_pointer(void *pointer)>
 
 Initialize from PackFile_FixupEntry pointer.

Modified: branches/orderedhash_revamp/src/pmc/packfilefixuptable.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/packfilefixuptable.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/packfilefixuptable.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -24,7 +24,7 @@
 
 */
 
-pmclass PackfileFixupTable extends PackfileSegment {
+pmclass PackfileFixupTable auto_attrs extends PackfileSegment {
     /* RPA of entries */
     ATTR PMC *entries;
 
@@ -40,12 +40,11 @@
 
     VTABLE void init() {
         Parrot_PackfileFixupTable_attributes * attrs =
-                mem_allocate_zeroed_typed(Parrot_PackfileFixupTable_attributes);
+                PMC_data_typed(SELF, Parrot_PackfileFixupTable_attributes*);
 
         attrs->entries = pmc_new(interp, enum_class_ResizablePMCArray);
 
-        PObj_custom_mark_destroy_SETALL(SELF);
-        PMC_data(SELF) = attrs;
+        PObj_custom_mark_SET(SELF);
     }
 
 /*
@@ -62,36 +61,13 @@
         Parrot_PackfileFixupTable_attributes * attrs =
                 PARROT_PACKFILEFIXUPTABLE(SELF);
 
-        if (attrs->entries)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)attrs->entries);
+        Parrot_gc_mark_PMC_alive(interp, attrs->entries);
 
         SUPER();
     }
 
 /*
 
-=item C<void destroy()>
-
-Destroys the PMC and frees all allocated memory.
-
-=cut
-
-*/
-
-    VTABLE void destroy() {
-        Parrot_PackfileFixupTable_attributes * attrs =
-                PARROT_PACKFILEFIXUPTABLE(SELF);
-
-        if (attrs) {
-            mem_sys_free(attrs);
-            PMC_data(SELF) = NULL;
-        }
-    }
-
-
-
-/*
-
 =item C<void set_pointer(void *pointer)>
 
 Initialize from PackFile_FixupTable pointer.
@@ -198,6 +174,20 @@
     }
 
 
+/*
+
+=item C<METHOD type()>
+
+Set segment type.
+
+=cut
+
+*/
+
+    METHOD type() {
+        RETURN(INTVAL PF_FIXUP_SEG);
+    }
+
 }
 /*
 

Modified: branches/orderedhash_revamp/src/pmc/packfilerawsegment.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/packfilerawsegment.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/packfilerawsegment.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -24,7 +24,9 @@
 
 */
 
-pmclass PackfileRawSegment extends PackfileSegment {
+pmclass PackfileRawSegment auto_attrs extends PackfileSegment {
+    /* Type of segment */
+    ATTR INTVAL  type;
     /* ResizableIntegerArray of opcodes */
     ATTR PMC    *opcodes;
 
@@ -40,12 +42,12 @@
 
     VTABLE void init() {
         Parrot_PackfileRawSegment_attributes * attrs =
-                mem_allocate_zeroed_typed(Parrot_PackfileRawSegment_attributes);
+                PMC_data_typed(SELF, Parrot_PackfileRawSegment_attributes*);
 
         attrs->opcodes = pmc_new(interp, enum_class_ResizableIntegerArray);
+        attrs->type    = PF_BYTEC_SEG;
 
-        PObj_custom_mark_destroy_SETALL(SELF);
-        PMC_data(SELF) = attrs;
+        PObj_custom_mark_SET(SELF);
     }
 
 /*
@@ -62,33 +64,11 @@
         Parrot_PackfileRawSegment_attributes * attrs =
                 PARROT_PACKFILERAWSEGMENT(SELF);
 
-        if (attrs->opcodes)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)attrs->opcodes);
+        Parrot_gc_mark_PMC_alive(interp, attrs->opcodes);
 
         SUPER();
     }
 
-/*
-
-=item C<void destroy()>
-
-Destroys the PMC and frees all allocated memory.
-
-=cut
-
-*/
-
-    VTABLE void destroy() {
-        Parrot_PackfileRawSegment_attributes * attrs =
-                PARROT_PACKFILERAWSEGMENT(SELF);
-
-        if (attrs) {
-            mem_sys_free(attrs);
-            PMC_data(SELF) = NULL;
-        }
-    }
-
-
 
 /*
 
@@ -103,9 +83,14 @@
     VTABLE void set_pointer(void * pointer) {
         const PackFile_Segment * const pfseg =
                 (const PackFile_Segment *)pointer;
-        PMC * opcodes = PARROT_PACKFILERAWSEGMENT(SELF)->opcodes;
+        Parrot_PackfileRawSegment_attributes * attrs =
+                PARROT_PACKFILERAWSEGMENT(SELF);
+        PMC * opcodes = attrs->opcodes;
         size_t i;
 
+        /* Preserve type of unpacked segment */
+        attrs->type = pfseg->type;
+
         if (pfseg->size) {
             /* copy data to own array */
             VTABLE_set_integer_native(interp, opcodes, pfseg->size);
@@ -132,7 +117,7 @@
         PMC * opcodes = attrs->opcodes;
         size_t i;
 
-        pfseg->type     = PF_BYTEC_SEG;
+        pfseg->type     = attrs->type;
         pfseg->size     = VTABLE_get_integer(interp, opcodes);
         pfseg->data     = mem_allocate_n_typed(pfseg->size, opcode_t);
 
@@ -187,6 +172,44 @@
             PARROT_PACKFILERAWSEGMENT(SELF)->opcodes, key, value);
     }
 
+/*
+
+=item C<void push_integer(INTVAL value)>
+
+Append opcode to segment
+
+=cut
+
+*/
+    VTABLE void push_integer(INTVAL value)  {
+        VTABLE_push_integer(interp,
+            PARROT_PACKFILERAWSEGMENT(SELF)->opcodes, value);
+    }
+
+/*
+
+=item C<METHOD type()>
+
+Set of get segment type.
+
+=cut
+
+TODO: Don't allow create Directory, Annotations, etc segments.
+
+*/
+
+    METHOD type(INTVAL type :optional, INTVAL got_type :opt_flag) {
+        Parrot_PackfileRawSegment_attributes * attrs =
+                PARROT_PACKFILERAWSEGMENT(SELF);
+        INTVAL res;
+
+        if (got_type) {
+            attrs->type = type;
+        }
+
+        res = attrs->type;
+        RETURN(INTVAL res);
+    }
 
 }
 /*

Modified: branches/orderedhash_revamp/src/pmc/packfilesegment.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/packfilesegment.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/packfilesegment.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -23,7 +23,7 @@
 
 */
 
-pmclass PackfileSegment {
+pmclass PackfileSegment auto_attrs {
     /*
     Directory which owns this segment. Required for correct pack/unpack
     Annotations.
@@ -42,12 +42,11 @@
 */
     VTABLE void init() {
         Parrot_PackfileSegment_attributes * attrs =
-                mem_allocate_zeroed_typed(Parrot_PackfileSegment_attributes);
+                PMC_data_typed(SELF, Parrot_PackfileSegment_attributes*);
 
-        attrs->directory = NULL;
+        attrs->directory = PMCNULL;
 
-        PObj_custom_mark_destroy_SETALL(SELF);
-        PMC_data(SELF) = attrs;
+        PObj_custom_mark_SET(SELF);
     }
 
 /*
@@ -64,28 +63,7 @@
         Parrot_PackfileSegment_attributes * attrs =
                 PARROT_PACKFILESEGMENT(SELF);
 
-        if (attrs->directory)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)attrs->directory);
-    }
-
-/*
-
-=item C<void destroy()>
-
-Destroys the PMC and frees all allocated memory.
-
-=cut
-
-*/
-
-    VTABLE void destroy() {
-        Parrot_PackfileSegment_attributes * attrs =
-                PARROT_PACKFILESEGMENT(SELF);
-
-        if (attrs) {
-            mem_sys_free(attrs);
-            PMC_data(SELF) = NULL;
-        }
+        Parrot_gc_mark_PMC_alive(interp, attrs->directory);
     }
 
 /*

Modified: branches/orderedhash_revamp/src/pmc/parrotinterpreter.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/parrotinterpreter.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/parrotinterpreter.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -28,8 +28,9 @@
 #include "parrot/embed.h"
 #include "parrot/dynext.h"
 #include "parrot/io.h"
-#include "pmc_class.h"
-#include "pmc_sub.h"
+#include "parrot/runcore_api.h"
+#include "pmc/pmc_class.h"
+#include "pmc/pmc_sub.h"
 
 #define PMC_interp(x) ((Parrot_ParrotInterpreter_attributes *)PMC_data(x))->interp
 #define PMC_args(x)   ((Parrot_ParrotInterpreter_attributes *)PMC_data(x))->args
@@ -55,8 +56,9 @@
     d->scheduler = pmc_new(d, enum_class_Scheduler);
     d->scheduler = VTABLE_share_ro(d, d->scheduler);
 
+    /* can't copy directly, unless you want double-frees */
     if (flags & PARROT_CLONE_RUNOPS)
-        d->run_core = s->run_core;
+        Parrot_runcore_switch(d, s->run_core->name);
 
     if (flags & PARROT_CLONE_INTERP_FLAGS) {
         /* XXX setting of IS_THREAD? */
@@ -125,12 +127,12 @@
                     PObj_is_class_TEST(s->vtables[i]->pmc_class)) {
                 /* Cloning the class into the new interpreter ought
                  * to be sufficient to instantiate the class.  */
-                 PMC          *source       = s->vtables[i]->pmc_class;
-                 PMC          *dest         = Parrot_clone(d, source);
-                 Parrot_Class_attributes *source_class = PARROT_CLASS(source);
-                 Parrot_Class_attributes *dest_class   = PARROT_CLASS(dest);
-                 dest_class->name           = Parrot_str_copy(d, source_class->name);
-                 dest_class->_namespace     = VTABLE_clone(d, source_class->_namespace);
+                PMC          *source       = s->vtables[i]->pmc_class;
+                PMC          *dest         = Parrot_clone(d, source);
+                Parrot_Class_attributes *source_class = PARROT_CLASS(source);
+                Parrot_Class_attributes *dest_class   = PARROT_CLASS(dest);
+                dest_class->name           = Parrot_str_copy(d, source_class->name);
+                dest_class->_namespace     = VTABLE_clone(d, source_class->_namespace);
             }
         }
     }
@@ -141,7 +143,7 @@
     if (flags & PARROT_CLONE_GLOBALS)
         pt_clone_globals(d, s);
 
-    Parrot_unblock_GC_sweep(d);
+    Parrot_unblock_GC_mark(d);
 }
 
 
@@ -184,7 +186,7 @@
     return ret;
 }
 
-pmclass ParrotInterpreter need_ext no_ro {
+pmclass ParrotInterpreter no_ro {
     ATTR struct parrot_interp_t *interp; /* this PMC's interpreter */
     ATTR INTVAL                  tid;    /* thread id */
     ATTR PMC                    *args;   /* args passed to this thread */
@@ -209,15 +211,13 @@
     void class_init() {
         const int typ = enum_class_ParrotInterpreter;
 
-        if (pass) {
-            /* TODO unify and fix signatures */
-            register_nci_method(INTERP, typ,
-                    F2DPTR(pt_thread_yield), "yield", "v");
-
-            /* misc functions */
-            register_nci_method(INTERP, typ,
-                    F2DPTR(recursion_limit), "recursion_limit", "iJOi");
-        }
+        /* TODO unify and fix signatures */
+        register_nci_method(INTERP, typ,
+                F2DPTR(pt_thread_yield), "yield", "v");
+
+        /* misc functions */
+        register_nci_method(INTERP, typ,
+                F2DPTR(recursion_limit), "recursion_limit", "iJOi");
     }
 
 /*
@@ -240,10 +240,11 @@
             Parrot_ParrotInterpreter_attributes *attrs =
                 mem_allocate_zeroed_typed(Parrot_ParrotInterpreter_attributes);
             PMC_data(SELF) = attrs;
+        }
+        if (!PMC_interp(SELF)) {
             create_interp(SELF, INTERP);
-            PARROT_ASSERT(attrs->interp);
         }
-        PObj_active_destroy_SET(SELF);
+        PObj_custom_destroy_SET(SELF);
     }
 
 /*
@@ -261,8 +262,15 @@
     VTABLE void init_pmc(PMC *parent) {
         Parrot_Interp p = PMC_interp(parent);
 
-        if (!PMC_interp(SELF))
+        if (!PMC_data(SELF)) {
+            Parrot_ParrotInterpreter_attributes *attrs =
+                mem_allocate_zeroed_typed(Parrot_ParrotInterpreter_attributes);
+            PMC_data(SELF) = attrs;
+        }
+        if (!PMC_interp(SELF)) {
             create_interp(SELF, p);
+        }
+        PObj_custom_destroy_SET(SELF);
     }
 
 
@@ -277,8 +285,10 @@
 */
 
     VTABLE void destroy() {
-        if (PMC_data(SELF))
+        if (PMC_data(SELF)) {
             mem_sys_free(PMC_data(SELF));
+            PMC_data(SELF) = NULL;
+        }
     }
 
 
@@ -301,7 +311,7 @@
             Parrot_ParrotInterpreter_attributes *attrs =
                 mem_allocate_zeroed_typed(Parrot_ParrotInterpreter_attributes);
             PMC_data(SELF) = attrs;
-            PObj_active_destroy_SET(SELF);
+            PObj_custom_destroy_SET(SELF);
         }
         PMC_interp(SELF) = (struct parrot_interp_t *)value;
     }
@@ -420,6 +430,7 @@
 
 Introspection interface. C<key> can be:
 
+  "context"                 ... return Context PMC
   "sub"                     ... return Sub object of this subroutine
   "continuation"            ... return Continuation PMC
   "lexpad"                  ... return lexpad PMC for this sub
@@ -439,17 +450,17 @@
         PMC    *nextkey, *cont;
         STRING *outer = NULL;
         STRING *item  = key_string(interp, key);
-        STRING *s     = CONST_STRING(interp, "globals");
+        STRING *name  = CONST_STRING(interp, "globals");
         int     level = 0;
 
-        Parrot_Context *ctx;
+        PMC *ctx;
 
-        if (Parrot_str_equal(interp, item, s))
+        if (Parrot_str_equal(interp, item, name))
             return interp->root_namespace;
 
-        s     = CONST_STRING(interp, "outer");
+        name  = CONST_STRING(interp, "outer");
 
-        if (Parrot_str_equal(interp, item, s)) {
+        if (Parrot_str_equal(interp, item, name)) {
             outer   = item;
             nextkey = key_next(INTERP, key);
 
@@ -470,78 +481,85 @@
             Parrot_ex_throw_from_c_args(interp, NULL, CONTROL_ERROR,
                 "No such caller depth");
 
-        ctx = CONTEXT(interp);
+        ctx = CURRENT_CONTEXT(interp);
 
         if (outer) {
             for (; level; --level) {
-                ctx = ctx->outer_ctx;
-                if (!ctx)
+                ctx = Parrot_pcc_get_outer_ctx(interp, ctx);
+                if (PMC_IS_NULL(ctx))
                     Parrot_ex_throw_from_c_args(interp, NULL,
                         CONTROL_ERROR, "No such outer depth");
             }
         }
         else {
             for (; level; --level) {
-                cont = ctx->current_cont;
+                cont = Parrot_pcc_get_continuation(interp, ctx);
 
-                if (PMC_IS_NULL(cont) || !PMC_cont(cont)->seg)
+                if (PMC_IS_NULL(cont) || !PARROT_CONTINUATION(cont)->seg)
                     Parrot_ex_throw_from_c_args(interp, NULL,
                         CONTROL_ERROR, "No such caller depth");
 
-                ctx = PMC_cont(cont)->to_ctx;
+                ctx = PARROT_CONTINUATION(cont)->to_ctx;
 
-                if (!ctx->current_sub)
+                if (PMC_IS_NULL(Parrot_pcc_get_sub(interp, ctx)))
                     Parrot_ex_throw_from_c_args(interp, NULL,
                         CONTROL_ERROR, "No such caller depth");
             }
         }
 
         if (item == outer)
-            return ctx->current_sub;
+            return Parrot_pcc_get_sub(interp, ctx);
 
-        s = CONST_STRING(interp, "sub");
+        name = CONST_STRING(interp, "context");
 
-        if (Parrot_str_equal(interp, item, s))
-            return ctx->current_sub;
+        if (Parrot_str_equal(interp, item, name))
+            return ctx;
 
-        s = CONST_STRING(interp, "lexpad");
+        name = CONST_STRING(interp, "sub");
 
-        if (Parrot_str_equal(interp, item, s))
-            return ctx->lex_pad;
+        if (Parrot_str_equal(interp, item, name))
+            return Parrot_pcc_get_sub(interp, ctx);
 
-        s = CONST_STRING(interp, "namespace");
+        name = CONST_STRING(interp, "lexpad");
 
-        if (Parrot_str_equal(interp, item, s))
-            return ctx->current_namespace;
+        if (Parrot_str_equal(interp, item, name))
+            return Parrot_pcc_get_lex_pad(interp, ctx);
 
-        s = CONST_STRING(interp, "continuation");
+        name = CONST_STRING(interp, "namespace");
 
-        if (Parrot_str_equal(interp, item, s))
-            return VTABLE_clone(interp, ctx->current_cont);
+        if (Parrot_str_equal(interp, item, name))
+            return Parrot_pcc_get_namespace(interp, ctx);
 
-        s = CONST_STRING(interp, "annotations");
+        name = CONST_STRING(interp, "continuation");
 
-        if (Parrot_str_equal(interp, item, s)) {
-            Parrot_sub *sub;
-            PMC        *sub_pmc = ctx->current_sub;
-            PMC_get_sub(interp, sub_pmc, sub);
-            if (ctx == CONTEXT(interp)) {
+        if (Parrot_str_equal(interp, item, name))
+            return VTABLE_clone(interp, Parrot_pcc_get_continuation(interp, ctx));
+
+        name = CONST_STRING(interp, "annotations");
+
+        if (Parrot_str_equal(interp, item, name)) {
+            PMC        *sub_pmc = Parrot_pcc_get_sub(interp, ctx);
+            if (ctx == CURRENT_CONTEXT(interp)) {
                 /* We can't know the current program counter for the currently
                  * executing sub, so can't return annotations for that. */
-                if (ctx == CONTEXT(interp))
-                    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-                            "Cannot get annotations at depth 0; use annotations op instead.");
+                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                        "Cannot get annotations at depth 0; use annotations op instead.");
             }
-            if (!PMC_IS_NULL(sub_pmc) && sub_pmc->vtable->base_type == enum_class_Sub &&
-                    sub->seg->annotations) {
-                PackFile_ByteCode *seg = sub->seg;
-                opcode_t *pc = ctx->current_pc;
-                return PackFile_Annotations_lookup(interp,  seg->annotations,
+            if (!PMC_IS_NULL(sub_pmc)
+            &&   sub_pmc->vtable->base_type == enum_class_Sub) {
+                Parrot_Sub_attributes *sub;
+                PackFile_ByteCode     *seg;
+                opcode_t              *pc  = Parrot_pcc_get_pc(interp, ctx);
+
+                PMC_get_sub(interp, sub_pmc, sub);
+                seg = sub->seg;
+
+                if (sub->seg->annotations)
+                    return PackFile_Annotations_lookup(interp, seg->annotations,
                         pc - seg->base.data, NULL);
             }
-            else {
-                return pmc_new(interp, enum_class_Hash);
-            }
+
+            return pmc_new(interp, enum_class_Hash);
         }
 
         Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
@@ -690,8 +708,8 @@
          */
 
         /*  HLL_info */
-        if (info->what == VISIT_THAW_NORMAL ||
-                info->what == VISIT_THAW_CONSTANTS) {
+        if (VTABLE_get_integer(INTERP, info) == VISIT_THAW_NORMAL ||
+            VTABLE_get_integer(INTERP, info) == VISIT_THAW_CONSTANTS) {
             pos = &PMC_args(SELF);
         }
         else
@@ -702,21 +720,14 @@
     }
 
     VTABLE void thaw(visit_info *info) {
-        if (info->extra_flags == EXTRA_IS_PROP_HASH) {
-            SUPER(info);
+        if (!PMC_data(SELF)) {
+            Parrot_ParrotInterpreter_attributes *attrs =
+                mem_allocate_zeroed_typed(Parrot_ParrotInterpreter_attributes);
+            PMC_data(SELF) = attrs;
+            PObj_custom_destroy_SET(SELF);
         }
-        else if (info->extra_flags == EXTRA_IS_NULL) {
-
-            if (!PMC_data(SELF)) {
-                Parrot_ParrotInterpreter_attributes *attrs =
-                    mem_allocate_zeroed_typed(Parrot_ParrotInterpreter_attributes);
-                PMC_data(SELF) = attrs;
-                PObj_active_destroy_SET(SELF);
-            }
 
-            PMC_interp(SELF) = INTERP;
-            info->what       = VISIT_THAW_CONSTANTS;
-        }
+        PMC_interp(SELF) = INTERP;
     }
 
     VTABLE void thawfinish(visit_info *info) {
@@ -792,7 +803,7 @@
     METHOD hll_map(PMC *core_type, PMC *hll_type) {
         INTVAL core_type_id = VTABLE_type(INTERP, core_type);
         INTVAL hll_type_id  = VTABLE_type(INTERP, hll_type);
-        INTVAL hll_id       = CONTEXT(interp)->current_HLL;
+        INTVAL hll_id       = Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp));
         Parrot_register_HLL_type(INTERP, hll_id, core_type_id, hll_type_id);
     }
 
@@ -834,3 +845,5 @@
  * End:
  * vim: expandtab shiftwidth=4:
  */
+
+

Modified: branches/orderedhash_revamp/src/pmc/parrotlibrary.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/parrotlibrary.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/parrotlibrary.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -31,7 +31,7 @@
 #define PMC_dlhandle(x) ((Parrot_ParrotLibrary_attributes*)PMC_data(x))->dl_handle
 #define PMC_oplib_init(x) ((Parrot_ParrotLibrary_attributes*)PMC_data(x))->oplib_init
 
-pmclass ParrotLibrary need_ext provides library {
+pmclass ParrotLibrary auto_attrs provides library {
     ATTR void * dl_handle;  /* DLL handle */
     ATTR void * oplib_init; /* oplib init function */
 
@@ -46,10 +46,7 @@
 */
 
     VTABLE void init() {
-        Parrot_ParrotLibrary_attributes * const attrs =
-            mem_allocate_zeroed_typed(Parrot_ParrotLibrary_attributes);
-        PMC_data(SELF) = attrs;
-        PObj_active_destroy_SET(SELF);
+        PObj_custom_destroy_SET(SELF);
     }
 
 /*
@@ -66,7 +63,6 @@
         void *dl_handle = PMC_dlhandle(SELF);
         if (dl_handle)
             Parrot_dlclose(dl_handle);
-        mem_sys_free(PMC_data(SELF));
     }
 
 
@@ -124,6 +120,20 @@
 
 /*
 
+=item C<void *get_pointer()>
+
+Get the pointer to the shared library handle.
+
+=cut
+
+*/
+
+    VTABLE void *get_pointer() {
+        return PMC_dlhandle(SELF);
+    }
+
+/*
+
 =item C<void set_pointer(void *handle)>
 
 Set the pointer to the shared library handle.

Modified: branches/orderedhash_revamp/src/pmc/parrotrunningthread.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/parrotrunningthread.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/parrotrunningthread.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -30,9 +30,9 @@
 
 #include "parrot/embed.h"
 
-#define PMC_tid(x) ((Parrot_ParrotRunningThread_attributes *)PMC_data(x))->tid
+#define PMC_tid(x) (PARROT_PARROTRUNNINGTHREAD(x))->tid
 
-pmclass ParrotRunningThread no_ro {
+pmclass ParrotRunningThread no_ro auto_attrs {
     ATTR INTVAL tid; /* thread id */
 
 /*
@@ -46,25 +46,7 @@
 */
 
     VTABLE void init() {
-        Parrot_ParrotRunningThread_attributes *attrs =
-            mem_allocate_zeroed_typed(Parrot_ParrotRunningThread_attributes);
-        attrs->tid = -1;
-        PMC_data(SELF) = attrs;
-        PObj_active_destroy_SET(SELF);
-    }
-
-/*
-
-=item C<void destroy()>
-
-Destroy this PMC.
-
-=cut
-
-*/
-
-    VTABLE void destroy() {
-        mem_sys_free(PMC_data(SELF));
+        PMC_tid(SELF) = -1;
     }
 
 /*

Modified: branches/orderedhash_revamp/src/pmc/parrotthread.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/parrotthread.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/parrotthread.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -47,12 +47,10 @@
 static void
 stop_GC(Interp *parent, Interp *thread)
 {
-#if 0
     Parrot_block_GC_mark(parent);
     Parrot_block_GC_mark(thread);
     Parrot_block_GC_sweep(parent);
     Parrot_block_GC_sweep(thread);
-#endif
 }
 
 /* XXX FIXME probably not the best interface [see also list post of
@@ -63,6 +61,11 @@
                             INTVAL clone_flags, PMC *sub, PMC *args) {
     INTVAL tid = VTABLE_get_integer(interp, thread);
 
+    if (PMC_IS_NULL(sub)) {
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+            "Invalid thread sub");
+    }
+
     clone_interpreter(PMC_interp(thread), interp, clone_flags);
 
     interp->flags &= ~PARROT_THR_COPY_INTERP; /* XXX */
@@ -82,7 +85,7 @@
 }
 
 
-pmclass ParrotThread extends ParrotInterpreter need_ext no_ro {
+pmclass ParrotThread extends ParrotInterpreter no_ro {
 
 /*
 
@@ -103,14 +106,12 @@
     void class_init() {
         const int typ = enum_class_ParrotThread;
 
-        if (pass) {
-            register_nci_method(INTERP, typ,
-                    F2DPTR(do_thread_run), "run", "IJOIP@");
-
-            /* XXX appropriate name given that this won't clone globals? */
-            register_nci_method(INTERP, typ,
-                    F2DPTR(do_thread_run_clone_default), "run_clone", "IJOP@");
-        }
+        register_nci_method(INTERP, typ,
+                F2DPTR(do_thread_run), "run", "IJOIP@");
+
+        /* XXX appropriate name given that this won't clone globals? */
+        register_nci_method(INTERP, typ,
+                F2DPTR(do_thread_run_clone_default), "run_clone", "IJOP@");
     }
 
 /*

Modified: branches/orderedhash_revamp/src/pmc/pccmethod_test.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/pccmethod_test.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/pccmethod_test.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -4,13 +4,17 @@
 
 =head1 NAME
 
-src/pmc/pmethod_test.pmc - METHOD_Test PMC
+src/pmc/pmethod_test.pmc
+
+=head1 DESCRIPTION
+
+METHOD_Test PMC
 
 =cut
 
 */
 
-pmclass PCCMETHOD_Test need_ext provides hash {
+pmclass PCCMETHOD_Test provides hash {
 
 
     METHOD test_method()

Modified: branches/orderedhash_revamp/src/pmc/pmcproxy.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/pmcproxy.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/pmcproxy.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -64,7 +64,7 @@
 */
 
 
-pmclass PMCProxy extends Class need_ext {
+pmclass PMCProxy extends Class auto_attrs {
 
 /*
 
@@ -77,14 +77,13 @@
 */
 
     VTABLE void init() {
-        Parrot_Class_attributes * const _pmc = mem_allocate_zeroed_typed(Parrot_Class_attributes);
+        Parrot_Class_attributes * const _pmc =
+                (Parrot_Class_attributes *) PMC_data(SELF);
         PMC          * const new_attribute   = pmc_new(interp, enum_class_Hash);
         STRING       * const name            = CONST_STRING(interp, "proxy");
-        PMC_data(SELF)                       = _pmc;
 
-        /* Set flags for custom GC mark and destroy. */
+        /* Set flag for custom GC mark. */
         PObj_custom_mark_SET(SELF);
-        PObj_active_destroy_SET(SELF);
 
         /* Set up the object. */
         _pmc->id               = 0;
@@ -154,7 +153,7 @@
 
             /* Link the proxy and the namespace, caching the proxy object for
              * later retrieval on class lookup. */
-             Parrot_PCCINVOKE(interp, proxy_info->_namespace, CONST_STRING(interp, "set_class"), "P->", SELF);
+             Parrot_pcc_invoke_method_from_c_args(interp, proxy_info->_namespace, CONST_STRING(interp, "set_class"), "P->", SELF);
 
             /* Extract any methods from the namespace */
             Parrot_oo_extract_methods_from_namespace(interp, SELF,

Modified: branches/orderedhash_revamp/src/pmc/pointer.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/pointer.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/pointer.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -20,7 +20,7 @@
 
 */
 
-pmclass Pointer need_ext {
+pmclass Pointer auto_attrs {
     ATTR void * mark_function;
     ATTR void * pointer;
 
@@ -35,27 +35,11 @@
 */
 
     VTABLE void init() {
-        PObj_custom_mark_destroy_SETALL(SELF);
-        PMC_data(SELF) = mem_allocate_zeroed_typed(Parrot_Pointer_attributes);
+        PObj_custom_mark_SET(SELF);
     }
 
 /*
 
-=item C<void destroy()>
-
-Destroy the Pointer and free associated memory
-
-=cut
-
-*/
-
-    VTABLE void destroy() {
-        mem_sys_free(PARROT_POINTER(SELF));
-    }
-
-
-/*
-
 =item C<void mark()>
 
 Marks the pointer as live.

Deleted: branches/orderedhash_revamp/src/pmc/random.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/random.pmc	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,145 +0,0 @@
-/*
-Copyright (C) 2001-2007, Parrot Foundation.
-$Id$
-
-=head1 NAME
-
-src/pmc/random.pmc - Random Numbers
-
-=head1 DESCRIPTION
-
-These are the vtable functions for the Random base class.
-
-This is a singleton (monadic) class - only one instance exists.
-
-=head2 Methods
-
-=over 4
-
-=cut
-
-*/
-
-static PMC *Rand_PMC;
-
-pmclass Random singleton {
-
-/*
-
-=item C<void class_init()>
-
-Class initialization.  Clears the singleton PMC.
-
-=cut
-
-*/
-
-    void class_init() {
-        Rand_PMC = NULL;
-    }
-
-/*
-
-=item C<void *get_pointer()>
-
-=cut
-
-*/
-
-    VTABLE void *get_pointer() {
-        return Rand_PMC;
-    }
-
-/*
-
-=item C<void set_pointer(void *ptr)>
-
-These two functions are part of the singleton creation interface. For more
-information see F<src/pmc.c>.
-
-=cut
-
-*/
-
-    VTABLE void set_pointer(void *ptr) {
-        PARROT_ASSERT(!Rand_PMC);
-        Rand_PMC = (PMC *)ptr;
-    }
-
-/*
-
-=item C<void set_integer_native(INTVAL seed)>
-
-Sets the random number seed to C<seed>.
-
-=cut
-
-*/
-
-    VTABLE void set_integer_native(INTVAL seed) {
-        Parrot_srand(seed);
-    }
-
-/*
-
-=item C<INTVAL get_integer()>
-
-Returns a random integer in the range C<-2^31..2^31>.
-
-=cut
-
-*/
-
-    VTABLE INTVAL get_integer() {
-        return Parrot_int_rand(0);
-    }
-
-/*
-
-=item C<INTVAL get_integer_keyed_int(INTVAL max)>
-
-Returns a random integer in the range C<0..max>.
-
-=cut
-
-*/
-
-    VTABLE INTVAL get_integer_keyed_int(INTVAL max) {
-        return Parrot_range_rand(0, max, 0);
-    }
-
-/*
-
-=item C<FLOATVAL get_number()>
-
-Returns a random floating-point number in the range C<0.0..1.0>.
-
-=cut
-
-*/
-
-    VTABLE FLOATVAL get_number() {
-        return Parrot_float_rand(0);
-    }
-
-}
-
-/*
-
-=back
-
-=head1 HISTORY
-
-2003.12.10  first rev by leo.
-
-=cut
-
-*/
-
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Modified: branches/orderedhash_revamp/src/pmc/resizablebooleanarray.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/resizablebooleanarray.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/resizablebooleanarray.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -30,7 +30,7 @@
 /* Convert a size in bits to a size in bytes */
 #define BITS_TO_BYTES(size) ((size) / BITS_PER_CHAR)
 
-pmclass ResizableBooleanArray extends FixedBooleanArray need_ext provides array {
+pmclass ResizableBooleanArray extends FixedBooleanArray auto_attrs provides array {
     /* RBA uses the same attributes as FBA, but in RBA they're used as follows:
        size:             position of the last element (a.k.a tail_pos)
        resize_threshold: position of the first element (a.k.a. head_pos) */
@@ -392,7 +392,7 @@
 
         SET_ATTR_bit_array(INTERP, dest, dest_bit_array);
 
-        PObj_active_destroy_SET(dest);
+        PObj_custom_destroy_SET(dest);
         return dest;
     }
 
@@ -422,19 +422,18 @@
         STRING           *s;
         UINTVAL           tail_pos, rounded_size, head_pos;
         unsigned char    *bit_array;
-        IMAGE_IO * const  io = info->image_io;
 
         GET_ATTR_size(INTERP, SELF, tail_pos);
         GET_ATTR_resize_threshold(INTERP, SELF, head_pos);
         GET_ATTR_bit_array(INTERP, SELF, bit_array);
         rounded_size = ROUND_BYTES(tail_pos);
 
-        VTABLE_push_integer(INTERP, io, head_pos);
-        VTABLE_push_integer(INTERP, io, tail_pos);
+        VTABLE_push_integer(INTERP, info, head_pos);
+        VTABLE_push_integer(INTERP, info, tail_pos);
 
         s = Parrot_str_new(INTERP, (char*)bit_array, rounded_size);
 
-        VTABLE_push_string(INTERP, io, s);
+        VTABLE_push_string(INTERP, info, s);
     }
 
 /*
@@ -448,16 +447,11 @@
 */
     VTABLE void thaw(visit_info *info) {
         unsigned char   *bit_array;
-        IMAGE_IO * const io       = info->image_io;
-        const UINTVAL    head_pos = VTABLE_shift_integer(INTERP, io);
-        const UINTVAL    tail_pos = VTABLE_shift_integer(INTERP, io);
-        STRING * const   s        = VTABLE_shift_string(INTERP, io);
-
-        bit_array      = (unsigned char *)mem_sys_allocate_zeroed(s->bufused);
-        mem_sys_memcopy(bit_array, (unsigned char *)s->strstart, s->bufused);
-        PMC_data(SELF) =
-            mem_allocate_zeroed_typed(Parrot_ResizableBooleanArray_attributes);
+        const UINTVAL    head_pos = VTABLE_shift_integer(INTERP, info);
+        const UINTVAL    tail_pos = VTABLE_shift_integer(INTERP, info);
+        STRING * const   s        = VTABLE_shift_string(INTERP, info);
 
+        bit_array      = (unsigned char*)Parrot_str_to_cstring(INTERP, s);
         SET_ATTR_size(INTERP, SELF, tail_pos);
         SET_ATTR_resize_threshold(INTERP, SELF, head_pos);
         SET_ATTR_bit_array(INTERP, SELF, bit_array);

Modified: branches/orderedhash_revamp/src/pmc/resizablefloatarray.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/resizablefloatarray.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/resizablefloatarray.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -20,26 +20,9 @@
 
 */
 
-pmclass ResizableFloatArray extends FixedFloatArray need_ext provides array {
+pmclass ResizableFloatArray extends FixedFloatArray auto_attrs provides array {
     ATTR INTVAL resize_threshold; /* max size before array needs resizing */
 
-
-
-/*
-
-=item C<void init()>
-
-Initializes this array.
-
-=cut
-
-*/
-    VTABLE void init() {
-        Parrot_ResizableFloatArray_attributes* attrs =
-            mem_allocate_zeroed_typed(Parrot_ResizableFloatArray_attributes);
-        PMC_data(SELF) = attrs;
-    }
-
 /*
 
 =item C<FLOATVAL get_number_keyed_int(INTVAL key)>

Modified: branches/orderedhash_revamp/src/pmc/resizableintegerarray.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/resizableintegerarray.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/resizableintegerarray.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -20,27 +20,11 @@
 
 */
 
-pmclass ResizableIntegerArray extends FixedIntegerArray need_ext provides array {
+pmclass ResizableIntegerArray extends FixedIntegerArray auto_attrs provides array {
     ATTR INTVAL resize_threshold; /* max size before array needs to be resized */
 
 /*
 
-=item C<void init()>
-
-Initializes the array.
-
-=cut
-
-*/
-    VTABLE void init() {
-        Parrot_ResizableIntegerArray_attributes* attrs =
-            mem_allocate_zeroed_typed(Parrot_ResizableIntegerArray_attributes);
-        PMC_data(SELF) = attrs;
-        PObj_active_destroy_SET(SELF);
-    }
-
-/*
-
 =item C<INTVAL get_integer_keyed_int(INTVAL key)>
 
 Returns the integer value of the element at index C<key>.
@@ -51,12 +35,15 @@
 
     VTABLE INTVAL get_integer_keyed_int(INTVAL key) {
         INTVAL *int_array;
+        INTVAL  size;
 
         if (key < 0)
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
                 "ResizableIntegerArray: index out of bounds!");
 
-        if (key >= SELF.get_integer())
+        GET_ATTR_size(interp, SELF, size);
+
+        if (key >= size)
             return 0;
 
         GET_ATTR_int_array(INTERP, SELF, int_array);
@@ -81,7 +68,7 @@
                 "ResizableIntegerArray: index out of bounds!");
 
         if (key >= SELF.get_integer())
-            SELF.set_integer_native(key+1);
+            SELF.set_integer_native(key + 1);
 
         GET_ATTR_int_array(INTERP, SELF, int_array);
         int_array[key] = value;
@@ -98,7 +85,6 @@
 */
 
     VTABLE void set_integer_native(INTVAL size) {
-
         INTVAL *int_array;
         INTVAL  resize_threshold;
 
@@ -138,7 +124,7 @@
             }
 
             GET_ATTR_int_array(INTERP, SELF, int_array);
-            int_array = (INTVAL*) mem_sys_realloc((void*) int_array, cur * sizeof (INTVAL));
+            mem_realloc_n_typed(int_array, cur, INTVAL);
             SET_ATTR_int_array(INTERP, SELF, int_array);
             SET_ATTR_size(INTERP, SELF, size);
             SET_ATTR_resize_threshold(INTERP, SELF, cur);
@@ -157,8 +143,22 @@
 */
 
     VTABLE void push_integer(INTVAL value) {
-        INTVAL nextix = SELF.get_integer();
-        SELF.set_integer_keyed_int(nextix, value);
+        INTVAL *int_array;
+        INTVAL  nextix;
+        INTVAL  resize_threshold;
+
+        GET_ATTR_size(interp, SELF, nextix);
+        GET_ATTR_resize_threshold(interp, SELF, resize_threshold);
+
+        /* can't always avoid the resize, but don't duplicate the code */
+        if ((nextix && (nextix >= resize_threshold)) || !nextix)
+            SELF.set_integer_native(nextix + 1);
+        else
+            SET_ATTR_size(interp, SELF, nextix + 1);
+
+        /* fetch the array only after resize check; realloc may move it */
+        GET_ATTR_int_array(interp, SELF, int_array);
+        int_array[nextix] = value;
     }
 
 /*
@@ -214,7 +214,7 @@
 
 =item C<void unshift_integer(INTVAL value)>
 
-Add and integer to the start of the array.
+Add an integer to the start of the array.
 
 =cut
 
@@ -292,7 +292,6 @@
 */
 
     VTABLE void freeze(visit_info *info) {
-        IMAGE_IO *io = info->image_io;
         INTVAL   *int_array;
         INTVAL    i, n, rt;
 
@@ -300,43 +299,33 @@
 
         n  = SELF.get_integer();
         GET_ATTR_resize_threshold(INTERP, SELF, rt);
-        VTABLE_push_integer(INTERP, io, n);
-        VTABLE_push_integer(INTERP, io, rt);
+        VTABLE_push_integer(INTERP, info, n);
+        VTABLE_push_integer(INTERP, info, rt);
 
         GET_ATTR_int_array(INTERP, SELF, int_array);
 
         for (i = 0; i < n; ++i)
-            VTABLE_push_integer(INTERP, io, int_array[i]);
+            VTABLE_push_integer(INTERP, info, int_array[i]);
     }
 
     VTABLE void thaw(visit_info *info) {
+        const INTVAL n = VTABLE_shift_integer(INTERP, info);
+        const INTVAL rt = VTABLE_shift_integer(INTERP, info);
 
-        Parrot_ResizableIntegerArray_attributes *attrs =
-            mem_allocate_zeroed_typed(Parrot_ResizableIntegerArray_attributes);
-        PMC_data(SELF) = attrs;
-
-        if (info->extra_flags == EXTRA_IS_NULL) {
-            IMAGE_IO * const io = info->image_io;
-            const INTVAL n = VTABLE_shift_integer(INTERP, io);
-            const INTVAL rt = VTABLE_shift_integer(INTERP, io);
-
-            SET_ATTR_size(INTERP, SELF, 0);
-            SET_ATTR_resize_threshold(INTERP, SELF, rt);
-            SET_ATTR_int_array(INTERP, SELF, NULL);
-
-            if (n) {
-                INTVAL  i;
-                INTVAL *int_array;
+        SET_ATTR_size(INTERP, SELF, 0);
+        SET_ATTR_resize_threshold(INTERP, SELF, rt);
+        SET_ATTR_int_array(INTERP, SELF, NULL);
 
-                SELF.set_integer_native(n);
-                GET_ATTR_int_array(INTERP, SELF, int_array);
+        if (n) {
+            INTVAL  i;
+            INTVAL *int_array;
 
-                for (i = 0; i < n; ++i)
-                    int_array[i] = VTABLE_shift_integer(INTERP, io);
-            }
+            SELF.set_integer_native(n);
+            GET_ATTR_int_array(INTERP, SELF, int_array);
+
+            for (i = 0; i < n; ++i)
+                int_array[i] = VTABLE_shift_integer(INTERP, info);
         }
-        else
-            SUPER(info);
     }
 
 

Modified: branches/orderedhash_revamp/src/pmc/resizablepmcarray.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/resizablepmcarray.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/resizablepmcarray.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -23,7 +23,7 @@
 #define PMC_array(x)     ((Parrot_ResizablePMCArray_attributes *)PMC_data(x))->pmc_array
 #define PMC_threshold(x) ((Parrot_ResizablePMCArray_attributes *)PMC_data(x))->resize_threshold
 
-pmclass ResizablePMCArray extends FixedPMCArray need_ext provides array {
+pmclass ResizablePMCArray extends FixedPMCArray auto_attrs provides array {
     ATTR INTVAL resize_threshold; /* max size before array needs resizing */
 
 
@@ -37,10 +37,6 @@
 */
 
     VTABLE void init() {
-        Parrot_ResizablePMCArray_attributes *attrs =
-            mem_allocate_zeroed_typed(Parrot_ResizablePMCArray_attributes);
-
-        PMC_data(SELF) = attrs;
         PObj_custom_mark_destroy_SETALL(SELF);
     }
 
@@ -250,7 +246,7 @@
 
 =item C<void set_pmc_keyed(PMC *key, PMC *src)>
 
-If key is a slice, do a splice as set that item.
+Sets the PMC value of the element keyed by C<key> to C<*src>.
 
 =cut
 
@@ -270,7 +266,7 @@
             SELF.set_integer_native(key+1);
 
         data      = PMC_array(SELF);
-        GC_WRITE_BARRIER(INTERP, SELF, data[key], src);
+
         data[key] = src;
     }
 
@@ -601,45 +597,6 @@
 
 /*
 
-=item C<INTVAL is_equal(PMC *value)>
-
-The C<==> operation. Compares two array to hold equal elements.
-
-=cut
-
-*/
-
-    VTABLE INTVAL is_equal(PMC *value) {
-        INTVAL j, n;
-
-        if (value->vtable->base_type != enum_class_ResizablePMCArray)
-            return 0;
-
-        n = SELF.elements();
-
-        if (VTABLE_elements(INTERP, value) != n)
-            return 0;
-
-        for (j = 0; j < n; ++j) {
-            PMC *item1 = SELF.get_pmc_keyed_int(j);
-            PMC *item2 = VTABLE_get_pmc_keyed_int(INTERP, value, j);
-            INTVAL result;
-
-            if (item1 == item2)
-                continue;
-
-            Parrot_mmd_multi_dispatch_from_c_args(INTERP,
-                    "is_equal", "PP->I", item1, item2, &result);
-
-            if (!result)
-                return 0;
-        }
-
-        return 1;
-    }
-
-/*
-
 =item METHOD append(PMC *other)
 
 Append the other array to this array.

Modified: branches/orderedhash_revamp/src/pmc/resizablestringarray.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/resizablestringarray.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/resizablestringarray.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -18,7 +18,7 @@
 
 */
 
-pmclass ResizableStringArray extends FixedStringArray need_ext provides array {
+pmclass ResizableStringArray extends FixedStringArray auto_attrs provides array {
     ATTR UINTVAL resize_threshold; /*max capacity before resizing */
 
 /*
@@ -27,25 +27,6 @@
 
 =over 4
 
-=item C<void init()>
-
-Initializes the array.
-
-=cut
-
-*/
-
-    VTABLE void init() {
-        Parrot_ResizableStringArray_attributes *attrs =
-            mem_allocate_zeroed_typed(Parrot_ResizableStringArray_attributes);
-
-        PMC_data(SELF)   = attrs;
-
-        PObj_custom_mark_destroy_SETALL(SELF);
-    }
-
-/*
-
 =item C<STRING *get_string_keyed_int(INTVAL key)>
 
 Returns the Parrot string value of the element at index C<key>.
@@ -57,7 +38,8 @@
     VTABLE STRING *get_string_keyed_int(INTVAL key) {
 
         STRING **str_array;
-        INTVAL size = SELF.elements();
+        INTVAL size;
+        GET_ATTR_size(interp, SELF, size);
 
         if (key < 0) {
             if (key < -size)
@@ -91,7 +73,8 @@
     VTABLE void set_string_keyed_int(INTVAL key, STRING *value) {
 
         STRING **str_array;
-        INTVAL size = SELF.elements();
+        INTVAL   size;
+        GET_ATTR_size(interp, SELF, size);
 
         if (key < 0) {
             if (key < -size)
@@ -105,7 +88,6 @@
             SELF.set_integer_native(key+1);
 
         GET_ATTR_str_array(INTERP, SELF, str_array);
-        GC_WRITE_BARRIER(INTERP, SELF, str_array[key], value);
         str_array[key] = value;
     }
 
@@ -121,7 +103,8 @@
 */
 
     VTABLE void push_string(STRING *value) {
-        INTVAL next_idx = SELF.elements();
+        INTVAL next_idx;
+        GET_ATTR_size(interp, SELF, next_idx);
         SELF.set_string_keyed_int(next_idx, value);
     }
 
@@ -136,8 +119,9 @@
 */
 
     VTABLE STRING *pop_string() {
-        INTVAL  size = SELF.elements();
         STRING *value;
+        INTVAL  size;
+        GET_ATTR_size(interp, SELF, size);
 
         if (size == 0)
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
@@ -233,7 +217,8 @@
         else if (new_size <= resize_threshold) {
             /* zero out anything that was previously allocated
              * if we're growing the array */
-            INTVAL old_size = SELF.elements();
+            INTVAL old_size;
+            GET_ATTR_size(interp, SELF, old_size);
             if (new_size > old_size) {
                 INTVAL i;
                 for (i = old_size; i < new_size; i++)
@@ -280,8 +265,10 @@
 
     VTABLE PMC *clone() {
         PMC *copy = SUPER();
+        INTVAL size;
+        GET_ATTR_size(interp, SELF, size);
         /* copy trimmed extra space */
-        SET_ATTR_resize_threshold(INTERP, copy, SELF.elements());
+        SET_ATTR_resize_threshold(INTERP, copy, size);
         return copy;
     }
 
@@ -296,8 +283,9 @@
 */
 
     VTABLE STRING *shift_string() {
-        INTVAL  size = SELF.elements();
         STRING *value;
+        INTVAL  size;
+        GET_ATTR_size(interp, SELF, size);
 
         if (size == 0)
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,

Modified: branches/orderedhash_revamp/src/pmc/retcontinuation.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/retcontinuation.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/retcontinuation.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -23,7 +23,7 @@
 
 #include "parrot/oplib/ops.h"
 
-pmclass RetContinuation extends Continuation need_ext {
+pmclass RetContinuation extends Continuation auto_attrs {
 
 /*
 
@@ -36,28 +36,16 @@
 */
 
     VTABLE void init() {
-        Parrot_RetContinuation_attributes * const attrs =
-            mem_allocate_typed(Parrot_RetContinuation_attributes);
+        Parrot_RetContinuation_attributes * const attrs = PARROT_RETCONTINUATION(SELF);
 
-        PMC_data(SELF) = attrs;
-        PMC_cont(SELF) = new_ret_continuation(INTERP);
-
-        PObj_custom_mark_destroy_SETALL(SELF);
+        attrs->to_ctx          = CURRENT_CONTEXT(interp);
+        attrs->from_ctx        = PMCNULL;    /* filled in during a call */
+        attrs->runloop_id      = 0;
+        attrs->seg             = interp->code;
+        attrs->address         = NULL;
     }
 
-    /*
-     * XXX when reusing SUPER.destroy() RetContinuations
-     *     have to set ref_count initially to 1
-     */
-
-    VTABLE void destroy() {
-        Parrot_cont * const cc = PMC_cont(SELF);
-
-        if (cc)
-            mem_sys_free(cc);
 
-        mem_sys_free(PMC_data(SELF));
-    }
 /*
 
 =item C<PMC *clone>
@@ -85,21 +73,19 @@
 */
 
     VTABLE opcode_t *invoke(void *in_next) {
-        Parrot_cont       *cc         = PMC_cont(SELF);
-        Parrot_Context    *from_ctx   = cc->from_ctx;
-        PackFile_ByteCode * const seg = cc->seg;
-        opcode_t          *next       = cc->address;
+        Parrot_Continuation_attributes *data = PARROT_CONTINUATION(SELF);
+        PMC               *from_ctx   = data->from_ctx;
+        PackFile_ByteCode * const seg = data->seg;
+        opcode_t          *next       = data->address;
         UNUSED(in_next)
 
-        Parrot_continuation_check(interp, SELF, cc);
-        Parrot_continuation_rewind_environment(interp, SELF, cc);
-        Parrot_free_context(INTERP, from_ctx, 1);
-
-        /* the continuation is dead - delete and destroy it */
-        /* This line causes a failure in t/pmc/packfiledirectory.t. No idea
-           what the relationship is between this line of code and that test
-           failure. Will look into it later */
-        /* Parrot_gc_free_pmc_header(interp, SELF); */
+        Parrot_continuation_check(interp, SELF);
+        Parrot_continuation_rewind_environment(interp, SELF);
+
+        /* recycle this PMC and make sure it doesn't get marked */
+        if (!PMC_IS_NULL(from_ctx))
+            Parrot_pcc_set_continuation(interp, from_ctx, NULL);
+        Parrot_gc_free_pmc_header(interp, SELF);
 
         if (INTERP->code != seg)
             Parrot_switch_to_cs(INTERP, seg, 1);

Modified: branches/orderedhash_revamp/src/pmc/role.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/role.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/role.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -48,7 +48,7 @@
 
 */
 
-#include "pmc_namespace.h"
+#include "pmc/pmc_namespace.h"
 
 /* Takes a hash and initializes the role based on it. */
 static void init_role_from_hash(PARROT_INTERP, PMC *self, PMC *info)
@@ -102,7 +102,7 @@
         /* Namespace is nested in the current namespace and with the name of
          * the role. */
         role->_namespace = Parrot_make_namespace_keyed_str(interp,
-            CONTEXT(interp)->current_namespace, role->name);
+            Parrot_pcc_get_namespace(interp, CURRENT_CONTEXT(interp)), role->name);
     }
 
     /* Otherwise, we may just have a namespace. */
@@ -198,7 +198,7 @@
 
 */
 
-pmclass Role need_ext {
+pmclass Role auto_attrs {
     ATTR STRING *name;            /* The name of the role. */
     ATTR PMC    *_namespace;      /* The namespace it's linked to, if any. */
     ATTR PMC    *roles;           /* Roles from which this role is composed. */
@@ -221,12 +221,11 @@
 */
 
     VTABLE void init() {
-        Parrot_Role_attributes * const role = mem_allocate_zeroed_typed(Parrot_Role_attributes);
-        PMC_data(SELF)        = role;
+        Parrot_Role_attributes * const role =
+                (Parrot_Role_attributes *) PMC_data(SELF);
 
-        /* Set flags for custom GC mark and destroy. */
+        /* Set flags for custom GC mark. */
         PObj_custom_mark_SET(SELF);
-        PObj_active_destroy_SET(SELF);
 
         /* Set up the object. */
         role->name            = CONST_STRING(interp, "");
@@ -246,20 +245,6 @@
 
 /*
 
-=item C<void destroy()>
-
-Free the memory associated with the object's underlying struct.
-
-=cut
-
-*/
-
-    VTABLE void destroy() {
-        mem_sys_free(PMC_data(SELF));
-    }
-
-/*
-
 =item C<void mark()>
 
 Mark referenced strings and PMCs in the structure as live.
@@ -271,16 +256,11 @@
     VTABLE void mark() {
         Parrot_Role_attributes * const role = PARROT_ROLE(SELF);
 
-        if (role->name)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)role->name);
-        if (role->_namespace)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)role->_namespace);
-        if (role->roles)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)role->roles);
-        if (role->methods)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)role->methods);
-        if (role->attrib_metadata)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)role->attrib_metadata);
+        Parrot_gc_mark_STRING_alive(interp, role->name);
+        Parrot_gc_mark_PMC_alive(interp, role->_namespace);
+        Parrot_gc_mark_PMC_alive(interp, role->roles);
+        Parrot_gc_mark_PMC_alive(interp, role->methods);
+        Parrot_gc_mark_PMC_alive(interp, role->attrib_metadata);
     }
 
 /*
@@ -744,7 +724,8 @@
             PMC *alias_method       :optional :named("alias_method"),
             int  got_alias_method   :opt_flag) {
         Parrot_Role_attributes *role_info = PARROT_ROLE(SELF);
-        STRING *s_name, *r_name;
+        STRING *s_name   = NULL;
+        STRING *r_name   = NULL;
 
         (STRING *s_name) = PCCINVOKE(interp, SELF, "name");
         (STRING *r_name) = PCCINVOKE(interp, role, "name");

Modified: branches/orderedhash_revamp/src/pmc/scalar.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/scalar.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/scalar.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -18,7 +18,7 @@
 
 */
 
-#include "pmc_bigint.h"
+#include "pmc/pmc_bigint.h"
 
 static PMC *
 bitwise_left_shift_internal(PARROT_INTERP, PMC *self,
@@ -96,41 +96,41 @@
 */
 
     VTABLE void assign_pmc(PMC *value) {
-        STRING * const s_int = CONST_STRING(INTERP, "Integer");
-        STRING        *s_num;
-        STRING        *s_str;
+        INTVAL  self_type = VTABLE_type(INTERP, SELF);
+        INTVAL  val_type  = VTABLE_type(INTERP, value);
 
-        if (SELF->vtable->base_type == enum_class_Boolean)
+        if (self_type == enum_class_Boolean)
             /* doesn't morph */
-            pmc_reuse(INTERP, SELF, value->vtable->base_type, 0);
+            pmc_reuse(INTERP, SELF, val_type, 0);
 
-        if (value->vtable->base_type == enum_class_Undef) {
-            pmc_reuse(INTERP, SELF, value->vtable->base_type, 0);
+        if (val_type == enum_class_Undef) {
+            pmc_reuse(INTERP, SELF, val_type, 0);
             return;
         }
 
-        if (VTABLE_isa(INTERP, value, s_int)) {
+        if (VTABLE_isa(INTERP, value, CONST_STRING(INTERP, "Undef"))) {
+            pmc_reuse(INTERP, SELF, enum_class_Undef, 0);
+            return;
+        }
+
+        if (VTABLE_isa(INTERP, value, CONST_STRING(INTERP, "Integer"))) {
             const INTVAL v = VTABLE_get_integer(INTERP, value);
             SELF.set_integer_native(v);
             return;
         }
 
-        s_num = CONST_STRING(INTERP, "Float");
-
-        if (VTABLE_isa(INTERP, value, s_num)) {
+        if (VTABLE_isa(INTERP, value, CONST_STRING(INTERP, "Float"))) {
             const FLOATVAL v = VTABLE_get_number(INTERP, value);
             SELF.set_number_native(v);
             return;
         }
 
-        s_str = CONST_STRING(INTERP, "String");
-
-        if (VTABLE_isa(INTERP, value, s_str)) {
+        if (VTABLE_isa(INTERP, value, CONST_STRING(INTERP, "String"))) {
             STRING * const v = VTABLE_get_string(INTERP, value);
             SELF.set_string_native(v);
             return;
         }
-        pmc_reuse(INTERP, SELF, value->vtable->base_type, 0);
+        pmc_reuse(INTERP, SELF, val_type, 0);
         SELF.set_pmc(value);
     }
 
@@ -1374,7 +1374,7 @@
         /* first set readonly */
         VTABLE_setprop(INTERP, ret, CONST_STRING(INTERP, "_ro"), _true);
 
-        /* now share; we add a PMC_EXT so we can identify the owning interp */
+        /* We're sharing this, so make sure it has a PMC_sync */
         Parrot_gc_add_pmc_sync(INTERP, ret);
         PObj_is_PMC_shared_SET(ret);
 

Modified: branches/orderedhash_revamp/src/pmc/scheduler.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/scheduler.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/scheduler.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -20,7 +20,7 @@
 
 #include "parrot/scheduler_private.h"
 
-pmclass Scheduler need_ext {
+pmclass Scheduler auto_attrs {
 
     ATTR INTVAL        id;         /* The scheduler's ID. */
     ATTR INTVAL        max_tid;    /* The highest assigned task ID. */
@@ -48,14 +48,13 @@
 
     VTABLE void init() {
         Parrot_Scheduler_attributes * const core_struct =
-            mem_allocate_zeroed_typed(Parrot_Scheduler_attributes);
+            (Parrot_Scheduler_attributes *) PMC_data(SELF);
 
         /* Set flags for custom GC mark and destroy. */
         PObj_custom_mark_SET(SELF);
-        PObj_active_destroy_SET(SELF);
+        PObj_custom_destroy_SET(SELF);
 
         /* Set up the core struct. */
-        PMC_data(SELF)           = core_struct;
         core_struct->id          = 0;
         core_struct->max_tid     = 0;
         core_struct->task_list   = pmc_new(interp, enum_class_Hash);
@@ -247,8 +246,10 @@
 */
     VTABLE void destroy() {
         Parrot_Scheduler_attributes * const core_struct = PARROT_SCHEDULER(SELF);
-        MUTEX_DESTROY(core_struct->msg_lock);
-        mem_sys_free(core_struct);
+        /* TT #946: this line is causing an order-of-destruction error
+           because the scheduler is being freed before it's tasks.
+           Commenting this out till we get a real fix (although it's a hack) */
+        /* MUTEX_DESTROY(core_struct->msg_lock); */
     }
 
 
@@ -265,16 +266,11 @@
         if (PARROT_SCHEDULER(SELF)) {
             Parrot_Scheduler_attributes * const core_struct = PARROT_SCHEDULER(SELF);
 
-            if (core_struct->task_list)
-                Parrot_gc_mark_PObj_alive(interp, (PObj *)core_struct->task_list);
-            if (core_struct->task_index)
-                Parrot_gc_mark_PObj_alive(interp, (PObj *)core_struct->task_index);
-            if (core_struct->wait_index)
-                Parrot_gc_mark_PObj_alive(interp, (PObj *)core_struct->wait_index);
-            if (core_struct->handlers)
-                Parrot_gc_mark_PObj_alive(interp, (PObj *)core_struct->handlers);
-            if (core_struct->messages)
-                Parrot_gc_mark_PObj_alive(interp, (PObj *)core_struct->messages);
+            Parrot_gc_mark_PMC_alive(interp, core_struct->task_list);
+            Parrot_gc_mark_PMC_alive(interp, core_struct->task_index);
+            Parrot_gc_mark_PMC_alive(interp, core_struct->wait_index);
+            Parrot_gc_mark_PMC_alive(interp, core_struct->handlers);
+            Parrot_gc_mark_PMC_alive(interp, core_struct->messages);
         }
     }
 
@@ -292,18 +288,11 @@
 */
 
     VTABLE void visit(visit_info *info) {
-        Parrot_Scheduler_attributes * const core_struct = PARROT_SCHEDULER(SELF);
-        PMC **pos;
-
         /* 1) visit task list */
-        pos            = &core_struct->task_list;
-        info->thaw_ptr = pos;
-        (info->visit_pmc_now)(INTERP, *pos, info);
+        VISIT_PMC_ATTR(INTERP, info, SELF, Scheduler, task_list);
 
         /* 2) visit the handlers */
-        pos            = &core_struct->handlers;
-        info->thaw_ptr = pos;
-        (info->visit_pmc_now)(INTERP, *pos, info);
+        VISIT_PMC_ATTR(INTERP, info, SELF, Scheduler, handlers);
     }
 
 
@@ -318,14 +307,13 @@
 */
 
     VTABLE void freeze(visit_info *info) {
-        IMAGE_IO *io = info->image_io;
         Parrot_Scheduler_attributes * const core_struct = PARROT_SCHEDULER(SELF);
 
         /* 1) freeze scheduler id */
-        VTABLE_push_integer(INTERP, io, core_struct->id);
+        VTABLE_push_integer(INTERP, info, core_struct->id);
 
         /* 2) freeze maximum task id */
-        VTABLE_push_integer(INTERP, io, core_struct->max_tid);
+        VTABLE_push_integer(INTERP, info, core_struct->max_tid);
     }
 
 
@@ -340,13 +328,11 @@
 */
 
     VTABLE void thaw(visit_info *info) {
-        IMAGE_IO * const io = info->image_io;
-
         /* 1. thaw scheduler id */
-        const INTVAL id = VTABLE_shift_integer(INTERP, io);
+        const INTVAL id = VTABLE_shift_integer(INTERP, info);
 
         /* 2. thaw maximum task id */
-        const INTVAL max_tid = VTABLE_shift_integer(INTERP, io);
+        const INTVAL max_tid = VTABLE_shift_integer(INTERP, info);
 
         /* Allocate the scheduler's core data struct and set custom flags. */
         SELF.init();

Modified: branches/orderedhash_revamp/src/pmc/schedulermessage.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/schedulermessage.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/schedulermessage.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2001-2008, Parrot Foundation.
+Copyright (C) 2001-2009, Parrot Foundation.
 $Id$
 
 =head1 NAME
@@ -20,7 +20,7 @@
 
 #include "parrot/scheduler_private.h"
 
-pmclass SchedulerMessage need_ext {
+pmclass SchedulerMessage auto_attrs {
     ATTR INTVAL  id;        /* The message's ID. */
     ATTR STRING *type;      /* The message's type. */
     ATTR PMC    *data;      /* Additional data for the message. */
@@ -37,14 +37,12 @@
 
     VTABLE void init() {
         Parrot_SchedulerMessage_attributes * const core_struct
-            = mem_allocate_zeroed_typed(Parrot_SchedulerMessage_attributes);
+            = (Parrot_SchedulerMessage_attributes *) PMC_data(SELF);
 
-        /* Set flags for custom GC mark and destroy. */
+        /* Set flags for custom GC mark. */
         PObj_custom_mark_SET(SELF);
-        PObj_active_destroy_SET(SELF);
 
         /* Set up the core struct. */
-        PMC_data(SELF)           = core_struct;
         core_struct->id          = 0;
         core_struct->type        = CONST_STRING(INTERP, "");
         core_struct->data        = PMCNULL;
@@ -189,19 +187,6 @@
 
 /*
 
-=item C<void destroy()>
-
-Free the scheduler's underlying struct.
-
-=cut
-
-*/
-    VTABLE void destroy() {
-        mem_sys_free(PMC_data(SELF));
-    }
-
-/*
-
 =item C<void mark()>
 
 Mark any referenced strings and PMCs.
@@ -214,8 +199,8 @@
             Parrot_SchedulerMessage_attributes * const core_struct =
                 PARROT_SCHEDULERMESSAGE(SELF);
 
-            if (core_struct->data)
-                Parrot_gc_mark_PObj_alive(interp, (PObj*)core_struct->data);
+            Parrot_gc_mark_STRING_alive(interp, core_struct->type);
+            Parrot_gc_mark_PMC_alive(interp, core_struct->data);
         }
     }
 
@@ -253,15 +238,14 @@
 */
 
     VTABLE void freeze(visit_info *info) {
-        IMAGE_IO *io = info->image_io;
         Parrot_SchedulerMessage_attributes * const core_struct =
             PARROT_SCHEDULERMESSAGE(SELF);
 
         /* 1) freeze message id */
-        VTABLE_push_integer(INTERP, io, core_struct->id);
+        VTABLE_push_integer(INTERP, info, core_struct->id);
 
         /* 2) freeze message type */
-        VTABLE_push_string(INTERP, io, core_struct->type);
+        VTABLE_push_string(INTERP, info, core_struct->type);
     }
 
 /*
@@ -275,13 +259,11 @@
 */
 
     VTABLE void thaw(visit_info *info) {
-        IMAGE_IO * const io = info->image_io;
-
         /* 1. thaw message id */
-        const INTVAL id = VTABLE_shift_integer(INTERP, io);
+        const INTVAL id = VTABLE_shift_integer(INTERP, info);
 
         /* 2. thaw message type */
-        STRING * const type = VTABLE_shift_string(INTERP, io);
+        STRING * const type = VTABLE_shift_string(INTERP, info);
 
         /* Allocate the message's core data struct and set custom flags. */
         SELF.init();

Modified: branches/orderedhash_revamp/src/pmc/sockaddr.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/sockaddr.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/sockaddr.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -29,7 +29,7 @@
 }
 #endif
 
-pmclass Sockaddr need_ext {
+pmclass Sockaddr auto_attrs {
     ATTR void   *pointer; /* The stored pointer. */
 
 /*
@@ -44,10 +44,10 @@
 
     VTABLE void init() {
         Parrot_Sockaddr_attributes * const pdata_struct =
-            mem_allocate_typed(Parrot_Sockaddr_attributes);
+            (Parrot_Sockaddr_attributes *) PMC_data(SELF);
 
-        PMC_data(SELF)        = pdata_struct;
         pdata_struct->pointer = mem_allocate_zeroed_typed(struct sockaddr_in);
+        PObj_custom_destroy_SET(SELF);
     }
 
 /*
@@ -65,8 +65,7 @@
 
         if (data) {
             mem_sys_free(data->pointer);
-            mem_sys_free(data);
-            PMC_data(SELF) = NULL;
+            data->pointer = NULL;
         }
     }
 

Modified: branches/orderedhash_revamp/src/pmc/socket.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/socket.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/socket.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -20,7 +20,7 @@
 
 #include "../src/io/io_private.h"
 
-pmclass Socket extends Handle {
+pmclass Socket extends Handle auto_attrs {
     ATTR PMC *local;           /* Local addr                   */
     ATTR PMC *remote;          /* Remote addr                  */
 
@@ -36,9 +36,8 @@
 
     VTABLE void init() {
         Parrot_Socket_attributes *data_struct =
-                mem_allocate_zeroed_typed(Parrot_Socket_attributes);
+                (Parrot_Socket_attributes *) PMC_data(SELF);
 
-        PMC_data(SELF)      = data_struct;
         data_struct->local  = PMCNULL;
         data_struct->remote = PMCNULL;
 
@@ -95,11 +94,8 @@
         Parrot_Socket_attributes * const data = PARROT_SOCKET(SELF);
 
         if (data) {
-            if (data->local)
-                Parrot_gc_mark_PObj_alive(interp, (PObj *)data->local);
-
-            if (data->remote)
-                Parrot_gc_mark_PObj_alive(interp, (PObj *)data->remote);
+            Parrot_gc_mark_PMC_alive(interp, data->local);
+            Parrot_gc_mark_PMC_alive(interp, data->remote);
         }
     }
 /*
@@ -143,7 +139,7 @@
 
 =over 4
 
-=item C<socket>
+=item C<socket(INTVAL fam, INTVAL type, INTVAL proto)>
 
 =cut
 
@@ -158,7 +154,25 @@
 
 /*
 
-=item C<sockaddr>
+=item C<poll(INTVAL which, INTVAL sec, INTVAL usec)>
+
+Watches the socket for C<sec> seconds and C<usec> milliseconds.  C<which>
+is a bitmask representing the states you want to watch for.  Or together 1
+for readable, two for writeable, and four for exceptions.
+
+=cut
+
+*/
+
+
+    METHOD poll(INTVAL which, INTVAL sec, INTVAL usec) {
+        INTVAL poll = Parrot_io_poll(INTERP, SELF, which, sec, usec);
+        RETURN(INTVAL poll);
+    }
+
+/*
+
+=item C<sockaddr(STRING * address, INTVAL port)>
 
 C<sockaddr> returns an object representing a socket address, generated
 from a port number (integer) and an address (string).
@@ -174,7 +188,7 @@
 
 /*
 
-=item C<connect>
+=item C<connect(PMC * address)>
 
 Connects a socket object to an address.
 
@@ -196,7 +210,7 @@
 
 /*
 
-=item C<close>
+=item C<close()>
 
 Close a socket.
 
@@ -218,7 +232,7 @@
 
 /*
 
-=item C<recv>
+=item C<recv()>
 
 Receives a message from a connected socket object. It returns
 the message in a string.
@@ -240,7 +254,7 @@
 
 /*
 
-=item C<send>
+=item C<send(STRING *buf)>
 
 Sends a message string to a connected socket object.
 
@@ -259,7 +273,7 @@
 
 /*
 
-=item C<bind>
+=item C<bind(PMC *host)>
 
 C<bind> binds a socket object to the port and address specified by an
 address object (the packed result of C<sockaddr>).
@@ -282,7 +296,7 @@
 
 /*
 
-=item C<listen>
+=item C<listen(INTVAL backlog)>
 
 C<listen> specifies that a socket object is willing to accept incoming
 connections. The integer argument gives the maximum size of the queue
@@ -302,7 +316,7 @@
 
 /*
 
-=item C<accept>
+=item C<accept()>
 
 C<accept> accepts a new connection on a given socket object, and returns
 a newly created socket object for the connection.

Modified: branches/orderedhash_revamp/src/pmc/string.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/string.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/string.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -20,7 +20,7 @@
 
 */
 
-pmclass String extends scalar provides string provides scalar {
+pmclass String extends scalar provides string provides scalar auto_attrs {
     ATTR STRING * str_val;
 
 /*
@@ -34,50 +34,10 @@
 */
 
     VTABLE void init() {
-        Parrot_String_attributes *attrs =
-            mem_allocate_typed(Parrot_String_attributes);
+        STRING *str_val = STRINGNULL;
+        SET_ATTR_str_val(INTERP, SELF, str_val);
 
-        attrs->str_val = Parrot_str_new_noinit(INTERP, enum_stringrep_one, 0);
-        PMC_data(SELF) = attrs;
-
-        PObj_custom_mark_destroy_SETALL(SELF);
-    }
-
-/*
-
-=item C<void destroy()>
-
-Destroys this String PMC.
-
-=cut
-
-*/
-
-    VTABLE void destroy() {
-        mem_sys_free(PMC_data(SELF));
-    }
-
-
-/*
-
-=item C<PMC instantiate_str(STRING *rep)>
-
-Class method to construct a String from the string representation C<rep>.
-
-=cut
-
-*/
-    VTABLE PMC *instantiate_str(STRING *rep, INTVAL flags) {
-        PMC         *res;
-        const INTVAL type   = SELF->vtable->base_type;
-
-        if (flags & PObj_constant_FLAG)
-            res = constant_pmc_new(INTERP, type);
-        else
-            res = pmc_new(INTERP, type);
-
-        SET_ATTR_str_val(INTERP, res, rep);
-        return res;
+        PObj_custom_mark_SET(SELF);
     }
 
 /*
@@ -92,10 +52,12 @@
 
     VTABLE void mark() {
         STRING *str_val;
-        GET_ATTR_str_val(INTERP, SELF, str_val);
 
-        if (str_val)
-            Parrot_gc_mark_PObj_alive(INTERP, (PObj *)str_val);
+        if (!PMC_data(SELF))
+            return;
+
+        GET_ATTR_str_val(INTERP, SELF, str_val);
+        Parrot_gc_mark_STRING_alive(INTERP, str_val);
     }
 
 /*
@@ -110,7 +72,6 @@
 
     VTABLE PMC *clone() {
         PMC * const dest = pmc_new(INTERP, SELF->vtable->base_type);
-        PObj_custom_mark_destroy_SETALL(dest);
         VTABLE_set_string_native(INTERP, dest, Parrot_str_copy(INTERP, SELF.get_string()));
         return dest;
     }
@@ -239,11 +200,16 @@
 */
 
     VTABLE void set_string_native(STRING *value) {
+        /* in lieu of a STRINGNULL, promote any NULL STRINGs to empty ones */
+        if (!value)
+            value = Parrot_str_new(INTERP, NULL, 0);
+
         /* Only allow constant PMCs to embed constant strings */
         if (PObj_constant_TEST(SELF) && !PObj_constant_TEST(value)) {
-            char *copy = Parrot_str_to_cstring(INTERP, value);
-            value      = Parrot_str_new_init(INTERP, copy, strlen(copy),
-                    PARROT_DEFAULT_ENCODING, PARROT_DEFAULT_CHARSET, PObj_constant_FLAG);
+            char * const copy = Parrot_str_to_cstring(INTERP, value);
+            value             = Parrot_str_new_init(INTERP, copy, strlen(copy),
+                PARROT_DEFAULT_ENCODING, PARROT_DEFAULT_CHARSET,
+                PObj_constant_FLAG);
             Parrot_str_free_cstring(copy);
         }
 
@@ -270,22 +236,6 @@
 
 /*
 
-=item C<VOID set_string_same(PMC *value)>
-
-Sets the value of the string to the value of
-the specified C<String> PMC.
-
-=cut
-
-*/
-
-    VTABLE void set_string_same(PMC *value) {
-        SET_ATTR_str_val(INTERP, SELF,
-            Parrot_str_set(INTERP, SELF.get_string(), VTABLE_get_string(INTERP, value)));
-    }
-
-/*
-
 =item C<VOID set_pmc(PMC *value)>
 
 Sets the value of the string to the string value of
@@ -664,6 +614,16 @@
         return string_ord(INTERP, s, pos);
     }
 
+    VTABLE PMC *get_pmc_keyed(PMC *key) {
+        return SELF.get_pmc_keyed_int(VTABLE_get_integer(INTERP, key));
+    }
+
+    VTABLE PMC *get_pmc_keyed_int(INTVAL pos) {
+        PMC * const dest = pmc_new(INTERP, SELF->vtable->base_type);
+        VTABLE_set_string_native(INTERP, dest, SELF.get_string_keyed_int(pos));
+        return dest;
+    }
+
     VTABLE void set_string_keyed(PMC *key, STRING * const value) {
         SELF.set_string_keyed_int(VTABLE_get_integer(INTERP, key), value);
     }
@@ -685,6 +645,14 @@
         Parrot_str_replace(INTERP, s, pos, 1, c, NULL);
         VTABLE_set_string_native(INTERP, SELF, s);
     }
+
+    VTABLE void set_pmc_keyed(PMC *key, PMC *value) {
+        SELF.set_pmc_keyed_int(VTABLE_get_integer(INTERP, key), value);
+    }
+
+    VTABLE void set_pmc_keyed_int(INTVAL pos, PMC *value) {
+        SELF.set_string_keyed_int(pos, VTABLE_get_string(INTERP, value));
+    }
 /*
 
 =item C<void replace(STRING *orig, STRING *_new)>
@@ -730,17 +698,18 @@
                         enum_class_Integer));
 
         /* TODO verify encoding */
-        const STRING *me         = VTABLE_get_string(INTERP, SELF);
-        const char   *start      = me->strstart;
-        const char   * const end = start + me->bufused;
-        UINTVAL              i   = 0;
+        const STRING *me  = VTABLE_get_string(INTERP, SELF);
+        char         *str = Parrot_str_to_cstring(INTERP, me);
+        UINTVAL       i   = 0;
+        size_t        j   = 0;
+        size_t        len = strlen(str);
 
         if (base < 2 || base > 36)
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
                     "invalid conversion to int - bad base %d", base);
 
-        while (start < end) {
-            const unsigned char c = *start;
+        while (j < len) {
+            const unsigned char c = str[j];
             int dig;
 
             if (isdigit((unsigned char)c))
@@ -756,17 +725,23 @@
                 break;
 
             i = i * base + dig;
-            ++start;
+            j++;
         }
 
-        if (start < end)
+        if (j < len) {
+            char ch = str[j];
+            Parrot_str_free_cstring(str);
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
-                    "invalid conversion to int - bad char %c", *start);
+                    "invalid conversion to int - bad char %c", ch);
+        }
 
+        Parrot_str_free_cstring(str);
         /* TODO: autopromote to BigInt instead of casting away the high bit */
         VTABLE_set_integer_native(INTERP, result, (INTVAL)i);
         RETURN(PMC *result);
     }
+
+
 /*
 
 =back
@@ -775,12 +750,6 @@
 
 =over 4
 
-=item C<PMC *slice(PMC *key, INTVAL f)>
-
-Return a new iterator for the slice PMC C<key> if f==0.
-
-Return a new pythonic slice if f == 1.
-
 =item C<PMC *get_iter(PMC *key)>
 
 Return a new iterator for this string.
@@ -789,7 +758,6 @@
 
 Return length of the string.
 
-
 =cut
 
 */
@@ -798,18 +766,6 @@
         return Parrot_str_byte_length(INTERP, VTABLE_get_string(INTERP, SELF));
     }
 
-    VTABLE PMC *slice(PMC *key, INTVAL f) {
-        if (f == 0) {
-            STRING     *name = CONST_STRING(interp, "set_key");
-            PMC * const iter = pmc_new_init(INTERP, enum_class_Iterator, SELF);
-            Parrot_PCCINVOKE(interp, iter, name, "P->", key);
-            return iter;
-        }
-
-        Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
-                "String: Unknown slice type");
-    }
-
     VTABLE PMC *get_iter() {
         return pmc_new_init(INTERP, enum_class_StringIterator, SELF);
     }
@@ -830,9 +786,8 @@
 
 */
     VTABLE void freeze(visit_info *info) {
-        IMAGE_IO * const io = info->image_io;
         SUPER(info);
-        VTABLE_push_string(INTERP, io, VTABLE_get_string(INTERP, SELF));
+        VTABLE_push_string(INTERP, info, VTABLE_get_string(INTERP, SELF));
     }
 
 /*
@@ -845,10 +800,8 @@
 
 */
     VTABLE void thaw(visit_info *info) {
-        IMAGE_IO * const io = info->image_io;
         SUPER(info);
-        if (info->extra_flags == EXTRA_IS_NULL)
-            SET_ATTR_str_val(INTERP, SELF, VTABLE_shift_string(INTERP, io));
+        SET_ATTR_str_val(INTERP, SELF, VTABLE_shift_string(INTERP, info));
     }
 /*
 
@@ -897,7 +850,7 @@
             Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_ENCODING,
                 "Can't translate non-ascii");
 
-        p = (unsigned char *)src->strstart;
+        p = (unsigned char *)Buffer_bufstart(src);
         /* TODO verify trans table */
 
         GETATTR_FixedIntegerArray_int_array(INTERP, table, tr_data);
@@ -931,7 +884,7 @@
             Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_ENCODING,
                 "Can't reverse non-ascii");
 
-        p = (unsigned char *)src->strstart;
+        p = (unsigned char *)Buffer_bufstart(src);
 
         for (i = 0, --len; i < len; ++i, --len) {
             const unsigned char ch = p[len];
@@ -964,7 +917,7 @@
                 "Can't is_integer non-ascii");
 
         i = 0;
-        p = (unsigned char *)src->strstart;
+        p = (unsigned char *)Buffer_bufstart(src);
 
         if (p[i] == '-' || p[i] == '+' ||
             (p[i] >= '0' && p[i] <= '9')) {
@@ -983,8 +936,10 @@
         PMC   * const ret    = SUPER();
 
         GET_ATTR_str_val(INTERP, SELF, str_val);
-        /* prevent wrong garbage collection */
-        PObj_is_shared_SET(str_val);
+        if (!STRING_IS_NULL(str_val)) {
+            /* prevent wrong garbage collection */
+            PObj_is_shared_SET(str_val);
+        }
         return ret;
     }
 

Modified: branches/orderedhash_revamp/src/pmc/stringhandle.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/stringhandle.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/stringhandle.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -46,7 +46,7 @@
         return Parrot_str_equal(interp, s, CONST_STRING(interp, "utf8"));
 }
 
-pmclass StringHandle extends Handle need_ext {
+pmclass StringHandle extends Handle auto_attrs {
     ATTR INTVAL  flags;               /* Filehandle flags             */
     ATTR STRING *stringhandle;        /* The string data              */
     ATTR STRING *mode;                /* The mode string used in open */
@@ -70,9 +70,8 @@
 
     VTABLE void init() {
         Parrot_StringHandle_attributes *data_struct =
-                mem_allocate_typed(Parrot_StringHandle_attributes);
+                (Parrot_StringHandle_attributes *) PMC_data(SELF);
 
-        PMC_data(SELF)            = data_struct;
         data_struct->flags        = 0;
         data_struct->stringhandle = NULL;
         data_struct->mode         = NULL;
@@ -81,7 +80,6 @@
         data_struct->read_offset  = 0;
 
         PObj_custom_mark_SET(SELF);
-        PObj_active_destroy_SET(SELF);
     }
 
 /*
@@ -122,30 +120,10 @@
 
     VTABLE void mark() {
         Parrot_StringHandle_attributes * const data_struct = PARROT_STRINGHANDLE(SELF);
-        if (data_struct->stringhandle)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)data_struct->stringhandle);
-        if (data_struct->mode)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)data_struct->mode);
-        if (data_struct->encoding)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)data_struct->encoding);
-        if (data_struct->filename)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)data_struct->filename);
-    }
-
-/*
-
-=item C<void destroy()>
-
-Free structures.
-
-=cut
-
-*/
-    VTABLE void destroy() {
-        if (PARROT_STRINGHANDLE(SELF)) {
-            mem_sys_free(PARROT_STRINGHANDLE(SELF));
-            PMC_data(SELF) = NULL;
-        }
+        Parrot_gc_mark_STRING_alive(interp, data_struct->stringhandle);
+        Parrot_gc_mark_STRING_alive(interp, data_struct->mode);
+        Parrot_gc_mark_STRING_alive(interp, data_struct->encoding);
+        Parrot_gc_mark_STRING_alive(interp, data_struct->filename);
     }
 
 /*

Modified: branches/orderedhash_revamp/src/pmc/stringiterator.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/stringiterator.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/stringiterator.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -22,7 +22,7 @@
 */
 
 
-pmclass StringIterator extends Iterator {
+pmclass StringIterator auto_attrs extends Iterator {
     ATTR PMC    *string;    /* String to iterate over */
     ATTR INTVAL  pos;       /* Current position of iterator for forward iterator */
                             /* Previous position of iterator for reverse iterator */
@@ -39,30 +39,11 @@
 
 */
     VTABLE void init_pmc(PMC *string) {
-        Parrot_StringIterator_attributes * const attrs =
-            mem_allocate_zeroed_typed(Parrot_StringIterator_attributes);
-
-        attrs->string    = string;
-        PMC_data(SELF)   = attrs;
-
-        PObj_custom_mark_destroy_SETALL(SELF);
+        SET_ATTR_string(INTERP, SELF, string);
 
         /* by default, iterate from start */
         SELF.set_integer_native(ITERATE_FROM_START);
-    }
-
-/*
-
-=item C<void destroy()>
-
-destroys this PMC
-
-=cut
-
-*/
-
-    VTABLE void destroy() {
-        mem_sys_free(PMC_data(SELF));
+        PObj_custom_mark_SET(SELF);
     }
 
 /*
@@ -78,8 +59,7 @@
     VTABLE void mark() {
         PMC *string;
         GET_ATTR_string(INTERP, SELF, string);
-        if (string)
-             Parrot_gc_mark_PObj_alive(INTERP, (PObj *)string);
+        Parrot_gc_mark_PMC_alive(INTERP, string);
     }
 
 /*

Modified: branches/orderedhash_revamp/src/pmc/sub.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/sub.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/sub.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -35,12 +35,33 @@
     print_pbc_location(interp);
 }
 
-/*
- * A sub now contains more data like namespace, which makes it
- * effectively a container. Therefore need_ext has to be set
- */
-pmclass Sub need_ext {
-    ATTR struct Parrot_sub * sub; /* the Parrot sub structure */
+pmclass Sub auto_attrs {
+    ATTR PackFile_ByteCode *seg;        /* bytecode segment */
+    ATTR size_t             start_offs; /* sub entry in ops from seg->base.data */
+    ATTR size_t             end_offs;
+
+    ATTR INTVAL             HLL_id;         /* see src/hll.c XXX or per segment? */
+    ATTR PMC               *namespace_name; /* where this Sub is in - this is either
+                                             * a String or a [Key] and describes
+                                             * the relative path in the NameSpace
+                                             */
+    ATTR PMC               *namespace_stash; /* the actual hash, HLL::namespace */
+    ATTR STRING            *name;            /* name of the sub */
+    ATTR STRING            *method_name;     /* method name of the sub */
+    ATTR STRING            *ns_entry_name;   /* ns entry name of the sub */
+    ATTR STRING            *subid;           /* The ID of the sub. */
+    ATTR INTVAL             vtable_index;    /* index in Parrot_vtable_slot_names */
+    ATTR PMC               *multi_signature; /* list of types for MMD */
+    ATTR UINTVAL            n_regs_used[4];  /* INSP in PBC */
+
+    ATTR PMC               *lex_info;        /* LexInfo PMC */
+    ATTR PMC               *outer_sub;       /* :outer for closures */
+    ATTR PMC               *eval_pmc;        /* eval container / NULL */
+    ATTR PMC               *ctx;             /* the context this sub is in */
+    ATTR UINTVAL            comp_flags;      /* compile time and additional flags */
+    ATTR Parrot_sub_arginfo *arg_info;       /* Argument counts and flags. */
+
+    ATTR PMC               *outer_ctx;       /* outer context, if a closure */
 
 /*
 
@@ -68,10 +89,121 @@
      */
     VTABLE void init() {
         Parrot_Sub_attributes * const attrs =
-            mem_allocate_typed(Parrot_Sub_attributes);
+            (Parrot_Sub_attributes *) PMC_data(SELF);
+
+        attrs->seg             = INTERP->code;
+        attrs->outer_sub       = PMCNULL;
+        attrs->multi_signature = PMCNULL;
+        attrs->namespace_name  = PMCNULL;
+
+        PObj_custom_mark_destroy_SETALL(SELF);
+    }
+
+/*
+
+=item C<void init_pmc()>
+
+Initializes the "detached" subroutine from passed Hash. "Detached" means that
+surboutine is fully constructed but not attached to interpreter.
+
+=cut
+
+*/
+
+    VTABLE void init_pmc(PMC* init) {
+        Parrot_Sub_attributes * const attrs =
+            (Parrot_Sub_attributes *) PMC_data(SELF);
+        STRING *field;
+
+        field = CONST_STRING(INTERP, "start_offs");
+        if (VTABLE_exists_keyed_str(INTERP, init, field))
+            attrs->start_offs = VTABLE_get_integer_keyed_str(INTERP, init, field);
+
+        field = CONST_STRING(INTERP, "end_offs");
+        if (VTABLE_exists_keyed_str(INTERP, init, field))
+            attrs->end_offs = VTABLE_get_integer_keyed_str(INTERP, init, field);
+
+        field = CONST_STRING(INTERP, "HLL_id");
+        if (VTABLE_exists_keyed_str(INTERP, init, field))
+            attrs->HLL_id = VTABLE_get_integer_keyed_str(INTERP, init, field);
+
+        field = CONST_STRING(INTERP, "namespace_name");
+        if (VTABLE_exists_keyed_str(INTERP, init, field))
+            attrs->namespace_name = VTABLE_get_pmc_keyed_str(INTERP, init, field);
+
+        field = CONST_STRING(INTERP, "namespace_stash");
+        if (VTABLE_exists_keyed_str(INTERP, init, field))
+            attrs->namespace_stash = VTABLE_get_pmc_keyed_str(INTERP, init, field);
+
+        field = CONST_STRING(INTERP, "name");
+        if (VTABLE_exists_keyed_str(INTERP, init, field))
+            attrs->name = VTABLE_get_string_keyed_str(INTERP, init, field);
+
+        field = CONST_STRING(INTERP, "method_name");
+        if (VTABLE_exists_keyed_str(INTERP, init, field))
+            attrs->method_name = VTABLE_get_string_keyed_str(INTERP, init, field);
+
+        field = CONST_STRING(INTERP, "ns_entry_name");
+        if (VTABLE_exists_keyed_str(INTERP, init, field))
+            attrs->ns_entry_name = VTABLE_get_string_keyed_str(INTERP, init, field);
+
+        field = CONST_STRING(INTERP, "subid");
+        if (VTABLE_exists_keyed_str(INTERP, init, field))
+            attrs->subid = VTABLE_get_string_keyed_str(INTERP, init, field);
+
+        field = CONST_STRING(INTERP, "vtable_index");
+        if (VTABLE_exists_keyed_str(INTERP, init, field))
+            attrs->vtable_index = VTABLE_get_integer_keyed_str(INTERP, init, field);
+
+        field = CONST_STRING(INTERP, "multi_signature");
+        if (VTABLE_exists_keyed_str(INTERP, init, field))
+            attrs->multi_signature = VTABLE_get_pmc_keyed_str(INTERP, init, field);
+
+        field = CONST_STRING(INTERP, "lex_info");
+        if (VTABLE_exists_keyed_str(INTERP, init, field))
+            attrs->lex_info = VTABLE_get_pmc_keyed_str(INTERP, init, field);
+
+        field = CONST_STRING(INTERP, "outer_sub");
+        if (VTABLE_exists_keyed_str(INTERP, init, field))
+            attrs->outer_sub = VTABLE_get_pmc_keyed_str(INTERP, init, field);
+
+        /* comp_flags is actually UINTVAL */
+        field = CONST_STRING(INTERP, "comp_flags");
+        if (VTABLE_exists_keyed_str(INTERP, init, field))
+            attrs->comp_flags = (UINTVAL)VTABLE_get_integer_keyed_str(INTERP, init, field);
+
+        field = CONST_STRING(INTERP, "n_regs_used");
+        if (VTABLE_exists_keyed_str(INTERP, init, field)) {
+            PMC   *tmp = VTABLE_get_pmc_keyed_str(INTERP, init, field);
+            INTVAL i;
+            for (i = 0; i < 4; ++i)
+                attrs->n_regs_used[i] = VTABLE_get_integer_keyed_int(INTERP, tmp, i);
+        }
+
+        field = CONST_STRING(INTERP, "arg_info");
+        if (VTABLE_exists_keyed_str(INTERP, init, field)) {
+            PMC   *tmp = VTABLE_get_pmc_keyed_str(INTERP, init, field);
+            /* Allocate structure to store argument information in. */
+            attrs->arg_info = mem_allocate_zeroed_typed(Parrot_sub_arginfo);
+            /*
+            Hash.get_integer_keyed_str return 0 if key doesn't exists.
+            So, don't check existence of key, just use it.
+            NB: Don't split line. CONST_STRING b0rked.
+            */
+            attrs->arg_info->pos_required = VTABLE_get_integer_keyed_str(INTERP, tmp, CONST_STRING(INTERP, "pos_required"));
+            attrs->arg_info->pos_optional = VTABLE_get_integer_keyed_str(INTERP, tmp, CONST_STRING(INTERP, "pos_optional"));
+            attrs->arg_info->pos_slurpy = VTABLE_get_integer_keyed_str(INTERP, tmp, CONST_STRING(INTERP, "pos_slurpy"));
+            attrs->arg_info->named_required = VTABLE_get_integer_keyed_str(INTERP, tmp, CONST_STRING(INTERP, "named_required"));
+            attrs->arg_info->named_optional = VTABLE_get_integer_keyed_str(INTERP, tmp, CONST_STRING(INTERP, "named_optional"));
+            attrs->arg_info->named_slurpy = VTABLE_get_integer_keyed_str(INTERP, tmp, CONST_STRING(INTERP, "named_slurpy"));
+        }
+
+
+        /*
+        C<eval_pmc> and C<ctx> are not handled here. And shouldn't be handled
+        here at all because of run-time nature.
+        */
 
-        attrs->sub     = new_sub(INTERP);
-        PMC_data(SELF) = attrs;
         PObj_custom_mark_destroy_SETALL(SELF);
     }
 
@@ -86,22 +218,12 @@
 */
 
     VTABLE void destroy() {
-        Parrot_sub *sub;
-        GET_ATTR_sub(INTERP, SELF, sub);
+        Parrot_Sub_attributes *sub = PARROT_SUB(SELF);
 
         if (sub) {
             if (sub->arg_info)
                 mem_sys_free(sub->arg_info);
-            if (sub->ctx)
-                Parrot_free_context(INTERP, sub->ctx, 1);
-            if (sub->outer_ctx)
-                Parrot_free_context(INTERP, sub->outer_ctx, 1);
-
-            mem_sys_free(sub);
         }
-
-        mem_sys_free(PMC_data(SELF));
-        PMC_data(SELF) = NULL;
     }
 
 /*
@@ -119,7 +241,8 @@
 */
 
     VTABLE STRING *get_string() {
-        Parrot_sub *sub;
+        STRING *name;
+        Parrot_Sub_attributes *sub;
         PMC_get_sub(INTERP, SELF, sub);
 
         if (sub->name)
@@ -129,7 +252,7 @@
     }
 
     VTABLE void set_string_native(STRING *subname) {
-        Parrot_sub *sub;
+        Parrot_Sub_attributes *sub;
         PMC_get_sub(INTERP, SELF, sub);
         sub->name = Parrot_str_copy(INTERP, subname);
     }
@@ -163,7 +286,7 @@
 */
 
     VTABLE void *get_pointer() {
-        Parrot_sub *sub;
+        Parrot_Sub_attributes *sub;
         PMC_get_sub(INTERP, SELF, sub);
         return sub->seg->base.data + sub->start_offs;
     }
@@ -181,10 +304,10 @@
 */
 
     VTABLE INTVAL get_integer_keyed(PMC *key) {
-        Parrot_sub *sub;
+        Parrot_Sub_attributes *sub;
         UNUSED(key)
-
         PMC_get_sub(INTERP, SELF, sub);
+
         return (INTVAL) (sub->seg->base.data);
     }
 
@@ -219,11 +342,11 @@
 */
 
     VTABLE opcode_t *invoke(void *next) {
-        Parrot_sub     *sub;
-        Parrot_Context *caller_ctx;
-        Parrot_Context *context;
-        PMC            *ccont;
-        opcode_t       *pc;
+        Parrot_Sub_attributes *sub;
+        PMC                   *caller_ctx;
+        PMC                   *context;
+        PMC                   *ccont;
+        opcode_t              *pc;
 
         PMC_get_sub(INTERP, SELF, sub);
         if (Interp_trace_TEST(INTERP, PARROT_TRACE_SUB_CALL_FLAG))
@@ -252,7 +375,7 @@
          *
          */
         pc                   = sub->seg->base.data + sub->start_offs;
-        caller_ctx           = CONTEXT(interp);
+        caller_ctx           = CURRENT_CONTEXT(interp);
         ccont                = INTERP->current_cont;
         INTERP->current_cont = NULL;
 
@@ -263,67 +386,65 @@
 
         /* plain subroutine call
          * create new context, place it in interpreter */
-        context               = Parrot_set_new_context(INTERP, sub->n_regs_used);
-        context->current_sub  = SELF;
-        context->caller_ctx   = caller_ctx;
-        context->current_pc   = pc;
-        context->current_cont = ccont;
+        context = Parrot_pcc_get_signature(INTERP, caller_ctx);
+        if (PMC_IS_NULL(context))
+            context = pmc_new(INTERP, enum_class_CallContext);
+        CURRENT_CONTEXT(INTERP) = context;
+        Parrot_pcc_set_caller_ctx(INTERP, context, caller_ctx);
+        Parrot_pcc_allocate_registers(INTERP, context, sub->n_regs_used);
+        Parrot_pcc_init_context(INTERP, context, caller_ctx);
+
+        Parrot_pcc_set_sub(interp, context, SELF);
+        Parrot_pcc_set_continuation(interp, context, ccont);
+        Parrot_pcc_set_constants(interp, context, sub->seg->const_table->constants);
 
         /* check recursion/call depth */
-        if (++context->recursion_depth > INTERP->recursion_limit)
+        if (Parrot_pcc_inc_recursion_depth(INTERP, context) > INTERP->recursion_limit)
             Parrot_ex_throw_from_c_args(INTERP, next, CONTROL_ERROR,
                     "maximum recursion depth exceeded");
 
         /* and copy set context variables */
-        PMC_cont(ccont)->from_ctx = context;
+        PARROT_CONTINUATION(ccont)->from_ctx = context;
 
         /* if this is an outer sub, then we need to set sub->ctx
          * to the new context (refcounted) and convert the
          * retcontinuation to a normal continuation.  */
         if (PObj_get_FLAGS(SELF) & SUB_FLAG_IS_OUTER) {
-            /* release any previously held context */
-            if (sub->ctx)
-                Parrot_free_context(interp, sub->ctx, 1);
-            sub->ctx = Parrot_context_ref(interp, context);
+            sub->ctx = context;
             /* convert retcontinuation to a continuation */
             ccont->vtable = interp->vtables[enum_class_Continuation];
         }
 
-        /* reference counting should work */
-        Parrot_context_ref(interp, context);
-
         if (!PMC_IS_NULL(INTERP->current_object)) {
-            context->current_object = INTERP->current_object;
+            Parrot_pcc_set_object(interp, context, INTERP->current_object);
             INTERP->current_object  = NULL;
         }
 
-        context->current_HLL       = sub->HLL_id;
-        context->current_namespace = sub->namespace_stash;
-
         /* create pad if needed
          * TODO move this up in front of argument passing
          *      and factor out common code with coroutine pmc
          */
         if (!PMC_IS_NULL(sub->lex_info)) {
-            context->lex_pad = pmc_new_init(INTERP,
+            Parrot_pcc_set_lex_pad(interp, context, pmc_new_init(INTERP,
                     Parrot_get_ctx_HLL_type(interp, enum_class_LexPad),
-                    sub->lex_info);
-            VTABLE_set_pointer(INTERP, context->lex_pad, context);
+                    sub->lex_info));
+            VTABLE_set_pointer(INTERP, Parrot_pcc_get_lex_pad(interp, context), context);
         }
 
-        if (sub->outer_ctx) {
+        if (!PMC_IS_NULL(sub->outer_ctx)) {
             /* set outer context */
-            context->outer_ctx = Parrot_context_ref(interp, sub->outer_ctx);
+            Parrot_pcc_set_outer_ctx(interp, context, sub->outer_ctx);
         }
         else {
             /* autoclose */
-            Parrot_Context *c;
-            for (c = context; !c->outer_ctx; c = c->outer_ctx) {
+            PMC *c = context;
+            PMC *outer_c = Parrot_pcc_get_outer_ctx(interp, c);
+            for (c = context; PMC_IS_NULL(outer_c); c = outer_c) {
 
                 PMC         *outer_pmc;
-                Parrot_sub  *current_sub, *outer_sub;
+                Parrot_Sub_attributes *current_sub, *outer_sub;
 
-                PMC_get_sub(INTERP, c->current_sub, current_sub);
+                PMC_get_sub(INTERP, Parrot_pcc_get_sub(interp, c), current_sub);
                 outer_pmc   = current_sub->outer_sub;
 
                 if (PMC_IS_NULL(outer_pmc))
@@ -331,26 +452,25 @@
 
                 PMC_get_sub(INTERP, outer_pmc, outer_sub);
 
-                if (!outer_sub->ctx) {
-                    Parrot_Context * const dummy = Parrot_alloc_context(INTERP,
+                if (PMC_IS_NULL(outer_sub->ctx)) {
+                    PMC * const dummy = Parrot_alloc_context(INTERP,
                                                 outer_sub->n_regs_used, NULL);
-                    dummy->current_sub    = outer_pmc;
+                    Parrot_pcc_set_sub(interp, dummy, outer_pmc);
 
                     if (!PMC_IS_NULL(outer_sub->lex_info)) {
-                        dummy->lex_pad = pmc_new_init(INTERP,
+                        Parrot_pcc_set_lex_pad(interp, dummy, pmc_new_init(INTERP,
                                Parrot_get_ctx_HLL_type(interp, enum_class_LexPad),
-                               outer_sub->lex_info);
-                        VTABLE_set_pointer(INTERP, dummy->lex_pad, dummy);
+                               outer_sub->lex_info));
+                        VTABLE_set_pointer(INTERP, Parrot_pcc_get_lex_pad(interp, dummy), dummy);
                     }
 
-                    if (outer_sub->outer_ctx) {
-                        dummy->outer_ctx = Parrot_context_ref(interp,
-                                               outer_sub->outer_ctx);
-                    }
-                    outer_sub->ctx = Parrot_context_ref(interp, dummy);
+                    if (!PMC_IS_NULL(outer_sub->outer_ctx))
+                        Parrot_pcc_set_outer_ctx(interp, dummy, outer_sub->outer_ctx);
+                    outer_sub->ctx = dummy;
                 }
 
-                c->outer_ctx = Parrot_context_ref(interp, outer_sub->ctx);
+                Parrot_pcc_set_outer_ctx(interp, c, outer_sub->ctx);
+                outer_c = outer_sub->ctx;
             }
         }
 
@@ -364,12 +484,11 @@
             &&     pc[2] == PARROT_OP_get_params_pc))) {
 
                 /* TODO keep it or resize it */
-                --context->recursion_depth;
+                Parrot_pcc_dec_recursion_depth(INTERP, context);
 
                 PObj_get_FLAGS(ccont) &= ~SUB_FLAG_TAILCALL;
-                context->caller_ctx    = caller_ctx->caller_ctx;
-
-                Parrot_free_context(INTERP, caller_ctx, 1);
+                Parrot_pcc_set_caller_ctx(interp, context,
+                        Parrot_pcc_get_caller_ctx(interp, caller_ctx));
             }
         }
 
@@ -388,21 +507,15 @@
 
     VTABLE PMC *clone() {
         PMC        * const ret = pmc_new(INTERP, SELF->vtable->base_type);
-        Parrot_sub *dest_sub;
-        Parrot_sub *sub;
+        Parrot_Sub_attributes *dest_sub;
+        Parrot_Sub_attributes *sub;
 
+        /* XXX Why? */
         /* we have to mark it ourselves */
         PObj_custom_mark_destroy_SETALL(ret);
 
-        PMC_get_sub(INTERP, ret, sub);
-
-        /* release any previously held contexts */
-        if (sub->ctx)
-            Parrot_free_context(INTERP, sub->ctx, 1);
-        if (sub->outer_ctx)
-            Parrot_free_context(INTERP, sub->outer_ctx, 1);
-
         PMC_get_sub(INTERP, SELF, dest_sub);
+        PMC_get_sub(INTERP, ret, sub);
 
         /* first set the sub struct, Parrot_str_copy may cause GC */
         *sub = *dest_sub;
@@ -413,12 +526,6 @@
         /* Be sure not to share arg_info. */
         dest_sub->arg_info = NULL;
 
-        /* mark any newly held contexts */
-        if (sub->ctx)
-            Parrot_context_ref(INTERP, sub->ctx);
-        if (sub->outer_ctx)
-            Parrot_context_ref(INTERP, sub->outer_ctx);
-
         return ret;
     }
 
@@ -439,22 +546,14 @@
     VTABLE void assign_pmc(PMC *other) {
         /* only handle the case where the other PMC is the same type */
         if (other->vtable->base_type == SELF->vtable->base_type) {
-            Parrot_sub *my_sub;
-            Parrot_sub *other_sub;
+            Parrot_Sub_attributes *my_sub;
+            Parrot_Sub_attributes *other_sub;
+
             PMC_get_sub(INTERP, SELF, my_sub);
             PMC_get_sub(INTERP, other, other_sub);
 
-            /* Increase reference count of destination before
-             * freeing the one in self, to avoid problems in
-             * case of self assignment */
-            if (other_sub->ctx)
-                Parrot_context_ref(interp, other_sub->ctx);
-            /* get rid of this context, if attached */
-            if (my_sub->ctx)
-                Parrot_free_context(INTERP, my_sub->ctx, 1);
-
             /* copy the sub struct */
-            memmove(my_sub, other_sub, sizeof (Parrot_sub));
+            memmove(my_sub, other_sub, sizeof (Parrot_Sub_attributes));
 
             /* copy the name so it's a different string in memory */
             if (my_sub->name)
@@ -477,36 +576,23 @@
 */
 
     VTABLE void mark() {
-        Parrot_sub *sub;
-        PMC_get_sub(INTERP, SELF, sub);
+        Parrot_Sub_attributes * const sub = PARROT_SUB(SELF);
 
         if (!sub)
             return;
 
-        if (sub->name)
-            Parrot_gc_mark_PObj_alive(INTERP, (PObj *) sub->name);
-        if (sub->method_name)
-            Parrot_gc_mark_PObj_alive(INTERP, (PObj *) sub->method_name);
-        if (sub->ns_entry_name)
-            Parrot_gc_mark_PObj_alive(INTERP, (PObj *) sub->ns_entry_name);
-        if (!PMC_IS_NULL(sub->namespace_name))
-            Parrot_gc_mark_PObj_alive(INTERP, (PObj *) sub->namespace_name);
-        if (!PMC_IS_NULL(sub->namespace_stash))
-            Parrot_gc_mark_PObj_alive(INTERP, (PObj *) sub->namespace_stash);
-        if (!PMC_IS_NULL(sub->multi_signature))
-            Parrot_gc_mark_PObj_alive(INTERP, (PObj *) sub->multi_signature);
-        if (!PMC_IS_NULL(sub->lex_info))
-            Parrot_gc_mark_PObj_alive(INTERP, (PObj *) sub->lex_info);
-        if (!PMC_IS_NULL(sub->outer_sub))
-            Parrot_gc_mark_PObj_alive(INTERP, (PObj *) sub->outer_sub);
-        if (!PMC_IS_NULL(sub->eval_pmc))
-            Parrot_gc_mark_PObj_alive(INTERP, (PObj *) sub->eval_pmc);
-        if (sub->subid)
-            Parrot_gc_mark_PObj_alive(INTERP, (PObj *) sub->subid);
-        if (sub->ctx)
-            mark_context(interp, sub->ctx);
-        if (sub->outer_ctx)
-            mark_context(interp, sub->outer_ctx);
+        Parrot_gc_mark_STRING_alive(INTERP, sub->name);
+        Parrot_gc_mark_STRING_alive(INTERP, sub->method_name);
+        Parrot_gc_mark_STRING_alive(INTERP, sub->ns_entry_name);
+        Parrot_gc_mark_PMC_alive(INTERP, sub->namespace_name);
+        Parrot_gc_mark_PMC_alive(INTERP, sub->namespace_stash);
+        Parrot_gc_mark_PMC_alive(INTERP, sub->multi_signature);
+        Parrot_gc_mark_PMC_alive(INTERP, sub->lex_info);
+        Parrot_gc_mark_PMC_alive(INTERP, sub->outer_sub);
+        Parrot_gc_mark_PMC_alive(INTERP, sub->eval_pmc);
+        Parrot_gc_mark_STRING_alive(INTERP, sub->subid);
+        Parrot_gc_mark_PMC_alive(interp, sub->ctx);
+        Parrot_gc_mark_PMC_alive(interp, sub->outer_ctx);
     }
 
 /*
@@ -520,7 +606,8 @@
 */
 
     MULTI INTVAL is_equal(PMC *value) {
-        Parrot_sub *my_sub, *value_sub;
+        Parrot_Sub_attributes *my_sub;
+        Parrot_Sub_attributes *value_sub;
 
         PMC_get_sub(INTERP, SELF, my_sub);
         PMC_get_sub(INTERP, value, value_sub);
@@ -545,18 +632,11 @@
 */
 
     VTABLE void visit(visit_info *info) {
-        Parrot_sub *sub;
-
-        PMC_get_sub(INTERP, SELF, sub);
+        VISIT_PMC_ATTR(INTERP, info, SELF, Sub, namespace_name);
 
-        info->thaw_ptr = &sub->namespace_name;
-        (info->visit_pmc_now)(INTERP, sub->namespace_name, info);
+        VISIT_PMC_ATTR(INTERP, info, SELF, Sub, multi_signature);
 
-        info->thaw_ptr = &sub->multi_signature;
-        (info->visit_pmc_now)(INTERP, sub->multi_signature, info);
-
-        info->thaw_ptr = &sub->outer_sub;
-        (info->visit_pmc_now)(INTERP, sub->outer_sub, info);
+        VISIT_PMC_ATTR(INTERP, info, SELF, Sub, outer_sub);
 
         /*
          * XXX visit_pmc_now is wrong, because it breaks
@@ -566,20 +646,18 @@
          *
          * Therefore the hash must be last during visit for now.
          */
-        info->thaw_ptr = &sub->lex_info;
-        (info->visit_pmc_now)(INTERP, sub->lex_info, info);
+        VISIT_PMC_ATTR(INTERP, info, SELF, Sub, lex_info);
+
         SUPER(info);
     }
 
     VTABLE void freeze(visit_info *info) {
-        IMAGE_IO   * const io  = info->image_io;
-        Parrot_sub        *sub;
-        STRING            *hll_name;
+        Parrot_Sub_attributes *sub;
+        STRING                *hll_name;
         int i;
 
-        PMC_get_sub(INTERP, SELF, sub);
-
         SUPER(info);
+        PMC_get_sub(INTERP, SELF, sub);
         /*
          * we currently need to write these items:
          * - start offset in byte-code segment
@@ -598,35 +676,35 @@
          * - subid
          */
 
-        VTABLE_push_integer(INTERP, io, (INTVAL) sub->start_offs);
-        VTABLE_push_integer(INTERP, io, (INTVAL) sub->end_offs);
-        VTABLE_push_integer(INTERP, io,
+        VTABLE_push_integer(INTERP, info, (INTVAL) sub->start_offs);
+        VTABLE_push_integer(INTERP, info, (INTVAL) sub->end_offs);
+        VTABLE_push_integer(INTERP, info,
             (INTVAL)(PObj_get_FLAGS(pmc) & SUB_FLAG_PF_MASK));
 
-        VTABLE_push_string(INTERP, io, sub->name);
+        VTABLE_push_string(INTERP, info, sub->name);
 
         if (!sub->method_name)
             sub->method_name = CONST_STRING(INTERP, "");
-        VTABLE_push_string(INTERP, io, sub->method_name);
+        VTABLE_push_string(INTERP, info, sub->method_name);
 
         if (!sub->ns_entry_name)
             sub->ns_entry_name = CONST_STRING(INTERP, "");
-        VTABLE_push_string(INTERP, io, sub->ns_entry_name);
+        VTABLE_push_string(INTERP, info, sub->ns_entry_name);
 
         hll_name = Parrot_get_HLL_name(INTERP, sub->HLL_id);
         if (!hll_name)
             hll_name = CONST_STRING(INTERP, "");
-        VTABLE_push_string(INTERP, io, hll_name);
+        VTABLE_push_string(INTERP, info, hll_name);
 
-        VTABLE_push_integer(INTERP, io, (INTVAL)sub->comp_flags);
-        VTABLE_push_integer(INTERP, io, sub->vtable_index);
+        VTABLE_push_integer(INTERP, info, (INTVAL)sub->comp_flags);
+        VTABLE_push_integer(INTERP, info, sub->vtable_index);
 
         for (i = 0; i < 4; ++i)
-            VTABLE_push_integer(INTERP, io, sub->n_regs_used[i]);
+            VTABLE_push_integer(INTERP, info, sub->n_regs_used[i]);
 
         if (!sub->subid)
             sub->subid = CONST_STRING(INTERP, "");
-        VTABLE_push_string(INTERP, io, sub->subid);
+        VTABLE_push_string(INTERP, info, sub->subid);
     }
 
 /*
@@ -640,36 +718,33 @@
 */
 
     VTABLE void thaw(visit_info *info) {
-        IMAGE_IO * const io = info->image_io;
+        Parrot_Sub_attributes *sub;
+        INTVAL flags;
+        int    i;
+
         SUPER(info);
 
-        if (info->extra_flags == EXTRA_IS_NULL) {
-            Parrot_sub *sub;
-            INTVAL flags;
-            int    i;
-
-            PMC_get_sub(INTERP, SELF, sub);
-
-            /* we get relative offsets */
-            sub->start_offs   = (size_t) VTABLE_shift_integer(INTERP, io);
-            sub->end_offs     = (size_t) VTABLE_shift_integer(INTERP, io);
-            flags             = VTABLE_shift_integer(INTERP, io);
-
-            PObj_get_FLAGS(SELF) |= flags & SUB_FLAG_PF_MASK;
-
-            sub->name           = VTABLE_shift_string(INTERP, io);
-            sub->method_name    = VTABLE_shift_string(INTERP, io);
-            sub->ns_entry_name  = VTABLE_shift_string(INTERP, io);
-            sub->HLL_id         = Parrot_get_HLL_id(INTERP,
-                VTABLE_shift_string(INTERP, io));
-            sub->comp_flags     = VTABLE_shift_integer(INTERP, io);
-            sub->vtable_index   = VTABLE_shift_integer(INTERP, io);
+        PMC_get_sub(INTERP, SELF, sub);
 
-            for (i = 0; i < 4; ++i)
-                sub->n_regs_used[i] = VTABLE_shift_integer(INTERP, io);
+        /* we get relative offsets */
+        sub->start_offs   = (size_t) VTABLE_shift_integer(INTERP, info);
+        sub->end_offs     = (size_t) VTABLE_shift_integer(INTERP, info);
+        flags             = VTABLE_shift_integer(INTERP, info);
+
+        PObj_get_FLAGS(SELF) |= flags & SUB_FLAG_PF_MASK;
+
+        sub->name           = VTABLE_shift_string(INTERP, info);
+        sub->method_name    = VTABLE_shift_string(INTERP, info);
+        sub->ns_entry_name  = VTABLE_shift_string(INTERP, info);
+        sub->HLL_id         = Parrot_get_HLL_id(INTERP,
+            VTABLE_shift_string(INTERP, info));
+        sub->comp_flags     = VTABLE_shift_integer(INTERP, info);
+        sub->vtable_index   = VTABLE_shift_integer(INTERP, info);
 
-            sub->subid        = VTABLE_shift_string(INTERP, io);
-        }
+        for (i = 0; i < 4; ++i)
+            sub->n_regs_used[i] = VTABLE_shift_integer(INTERP, info);
+
+        sub->subid        = VTABLE_shift_string(INTERP, info);
     }
 
 /*
@@ -686,13 +761,13 @@
     {
         /* Create a hash, then use inspect_str to get all of the data to
          * fill it up with. */
-        PMC    * const metadata          = pmc_new(interp, enum_class_Hash);
-        STRING * const pos_required_str  = CONST_STRING(interp, "pos_required");
-        STRING * const pos_optional_str  = CONST_STRING(interp, "pos_optional");
+        PMC    * const metadata           = pmc_new(interp, enum_class_Hash);
+        STRING * const pos_required_str   = CONST_STRING(interp, "pos_required");
+        STRING * const pos_optional_str   = CONST_STRING(interp, "pos_optional");
         STRING * const named_required_str = CONST_STRING(interp, "named_required");
         STRING * const named_optional_str = CONST_STRING(interp, "named_optional");
-        STRING * const pos_slurpy_str    = CONST_STRING(interp, "pos_slurpy");
-        STRING * const named_slurpy_str  = CONST_STRING(interp, "named_slurpy");
+        STRING * const pos_slurpy_str     = CONST_STRING(interp, "pos_slurpy");
+        STRING * const named_slurpy_str   = CONST_STRING(interp, "named_slurpy");
 
         VTABLE_set_pmc_keyed_str(interp, metadata, pos_required_str,
             VTABLE_inspect_str(interp, SELF, pos_required_str));
@@ -756,9 +831,9 @@
 
     VTABLE PMC *inspect_str(STRING *what)
     {
-        Parrot_sub *sub;
-        PMC        *retval;
-        INTVAL      count_found = -1;
+        Parrot_Sub_attributes *sub;
+        PMC                   *retval;
+        INTVAL                 count_found = -1;
 
         PMC_get_sub(INTERP, SELF, sub);
 
@@ -846,6 +921,14 @@
 
 =over 4
 
+=item C<INTVAL start_offs()>
+
+Return the start offset of the Sub.
+
+=item C<INTVAL end_offs()>
+
+Return the end offset of the Sub.
+
 =item C<PMC *get_namespace()>
 
 Return the namespace PMC, where the Sub is defined.
@@ -880,12 +963,31 @@
 =cut
 
 */
+    METHOD start_offs() {
+        Parrot_Sub_attributes  *sub;
+        INTVAL                  start_offs;
+        PMC_get_sub(INTERP, SELF, sub);
+        start_offs = sub->start_offs;
+        RETURN(INTVAL start_offs);
+    }
+
+    METHOD end_offs() {
+        Parrot_Sub_attributes  *sub;
+        INTVAL                  end_offs;
+        PMC_get_sub(INTERP, SELF, sub);
+        end_offs = sub->end_offs;
+        RETURN(INTVAL end_offs);
+    }
 
     METHOD get_namespace() {
-        Parrot_sub *sub;
         PMC *_namespace;
-
+        Parrot_Sub_attributes *sub;
         PMC_get_sub(INTERP, SELF, sub);
+        /*
+        XXX Rakudo's failing with with this code on ASSERT. Why???
+        GET_ATTR_namespace_stash(INTERP, SELF, _namespace);
+        PARROT_ASSERT(_namespace == sub->namespace_stash || !"consistency!!!");
+        */
         _namespace = sub->namespace_stash;
         RETURN(PMC *_namespace);
     }
@@ -894,65 +996,65 @@
 
         /* TODO switch to canonical NiSP order
          * see also imcc/reg_alloc.c */
-        static const char types[] = "INSP";
-        char *p;
-        Parrot_sub         *sub;
-        char       * const kind = Parrot_str_to_cstring(interp, reg);
-        INTVAL             regs_used;
+        STRING                *types = CONST_STRING(INTERP, "INSP");
+        Parrot_Sub_attributes *sub;
+        INTVAL                 regs_used;
+        INTVAL                 kind;
 
         PMC_get_sub(INTERP, SELF, sub);
-
         PARROT_ASSERT(sub->n_regs_used);
 
-        if (!*kind || kind[1]) {
-            Parrot_str_free_cstring(kind);
+        if (!reg || Parrot_str_length(INTERP, reg) != 1) {
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
                 "illegal register kind '%Ss'", reg);
         }
 
-        p = strchr(types, *kind);
-        Parrot_str_free_cstring(kind);
+        kind = Parrot_str_find_index(INTERP, types, reg, 0);
 
-        if (!p)
+        if (kind == -1)
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
                 "illegal register kind '%Ss'", reg);
 
-        regs_used = sub->n_regs_used[p - types];
+        regs_used = sub->n_regs_used[kind];
         RETURN(INTVAL regs_used);
     }
 
     METHOD get_lexinfo() {
-        Parrot_sub *sub;
         PMC        *lexinfo;
-
+        Parrot_Sub_attributes *sub;
         PMC_get_sub(INTERP, SELF, sub);
-        lexinfo = sub->lex_info ? sub->lex_info : PMCNULL;
+
+        lexinfo = sub->lex_info ? sub->lex_info: PMCNULL;
+
         RETURN(PMC *lexinfo);
     }
 
     METHOD get_subid() {
-        Parrot_sub *sub;
         STRING     *subid;
-
+        Parrot_Sub_attributes *sub;
         PMC_get_sub(INTERP, SELF, sub);
+
         subid = sub->subid ? sub->subid : CONST_STRING(interp, "");
+
         RETURN(STRING *subid);
     }
 
     METHOD get_outer() {
-        Parrot_sub *sub;
-        PMC        *outersub;
-
+        PMC                   *outersub;
+        Parrot_Sub_attributes *sub;
         PMC_get_sub(INTERP, SELF, sub);
+
         outersub = sub->outer_sub ? sub->outer_sub : PMCNULL;
+
         RETURN(PMC *outersub);
     }
 
     METHOD set_outer(PMC *outer) {
         /* Set outer sub. */
-        Parrot_sub *sub;
-
+        Parrot_Sub_attributes *sub;
+        PMC *tmp1;
         PMC_get_sub(INTERP, SELF, sub);
+
         sub->outer_sub = outer;
 
         /* Make sure outer flag of that sub is set. */
@@ -967,18 +1069,23 @@
 
         /* If we've got a context around for the outer sub, set it as the
          * outer context. */
-        if (CONTEXT(interp)->caller_ctx->caller_ctx->current_sub == outer)
-            sub->outer_ctx = Parrot_context_ref(interp, CONTEXT(interp)->caller_ctx->caller_ctx);
-        else if (CONTEXT(interp)->caller_ctx->current_sub == outer)
-            sub->outer_ctx = Parrot_context_ref(interp, CONTEXT(interp)->caller_ctx);
+        tmp1 = CURRENT_CONTEXT(interp);
+        while (!PMC_IS_NULL(tmp1)) {
+            if (Parrot_pcc_get_sub(interp, tmp1) == outer) {
+                sub->outer_ctx = tmp1;
+                break;
+            }
+            tmp1 = Parrot_pcc_get_caller_ctx(interp, tmp1);
+        }
     }
 
     METHOD get_multisig() {
-        Parrot_sub *sub;
-        PMC        *multisig;
-
+        PMC                 *multisig;
+        Parrot_Sub_attributes *sub;
         PMC_get_sub(INTERP, SELF, sub);
+
         multisig = sub->multi_signature ? sub->multi_signature : PMCNULL;
+
         RETURN(PMC *multisig);
     }
 

Modified: branches/orderedhash_revamp/src/pmc/task.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/task.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/task.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -20,7 +20,7 @@
 
 #include "parrot/scheduler_private.h"
 
-pmclass Task need_ext {
+pmclass Task auto_attrs {
     ATTR INTVAL        id;        /* The task ID. */
     ATTR INTVAL        priority;  /* The priority of the task. */
     ATTR FLOATVAL      birthtime; /* The creation time stamp of the task. */
@@ -43,15 +43,12 @@
 */
 
     VTABLE void init() {
-        Parrot_Task_attributes * const core_struct =
-            mem_allocate_zeroed_typed(Parrot_Task_attributes);
+        Parrot_Task_attributes * const core_struct = PARROT_TASK(SELF);
 
-        /* Set flags for custom GC mark and destroy. */
+        /* Set flags for custom GC mark. */
         PObj_custom_mark_SET(SELF);
-        PObj_active_destroy_SET(SELF);
 
         /* Set up the core struct. */
-        PMC_data(SELF)           = core_struct;
         core_struct->id          = 0;
         core_struct->type        = CONST_STRING(interp, "");
         core_struct->subtype     = CONST_STRING(interp, "");
@@ -123,14 +120,12 @@
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
                 "Task initializer must be a Hash");
 
-        core_struct = mem_allocate_zeroed_typed(Parrot_Task_attributes);
+        core_struct = (Parrot_Task_attributes *) PMC_data(SELF);
 
-        /* Set flags for custom GC mark and destroy. */
+        /* Set flags for custom GC mark. */
         PObj_custom_mark_SET(SELF);
-        PObj_active_destroy_SET(SELF);
 
         /* Set up the core struct. */
-        PMC_data(SELF)           = core_struct;
 
         elem = VTABLE_get_pmc_keyed_str(INTERP, data, CONST_STRING(INTERP, "id"));
         if (! PMC_IS_NULL(elem))
@@ -289,7 +284,7 @@
 
 */
     VTABLE INTVAL get_integer() {
-        const Parrot_Task_attributes * const core_struct = PARROT_TASK(SELF);
+        Parrot_Task_attributes * const core_struct = PARROT_TASK(SELF);
         return core_struct->id;
     }
 
@@ -369,19 +364,6 @@
 
 /*
 
-=item C<void destroy()>
-
-Free the task's underlying struct.
-
-=cut
-
-*/
-    VTABLE void destroy() {
-        mem_sys_free(PMC_data(SELF));
-    }
-
-/*
-
 =item C<void mark()>
 
 Mark any referenced strings and PMCs.
@@ -393,10 +375,11 @@
         if (PARROT_TASK(SELF)) {
             Parrot_Task_attributes * const core_struct = PARROT_TASK(SELF);
 
-            if (core_struct->codeblock)
-                Parrot_gc_mark_PObj_alive(interp, (PObj*)core_struct->codeblock);
-            if (core_struct->data)
-                Parrot_gc_mark_PObj_alive(interp, (PObj*)core_struct->data);
+            Parrot_gc_mark_STRING_alive(interp, core_struct->type);
+            Parrot_gc_mark_STRING_alive(interp, core_struct->subtype);
+            Parrot_gc_mark_STRING_alive(interp, core_struct->status);
+            Parrot_gc_mark_PMC_alive(interp, core_struct->codeblock);
+            Parrot_gc_mark_PMC_alive(interp, core_struct->data);
         }
     }
 
@@ -413,13 +396,8 @@
 */
 
     VTABLE void visit(visit_info *info) {
-        Parrot_Task_attributes * const core_struct = PARROT_TASK(SELF);
-        PMC **pos;
-
         /* 1) visit code block */
-        pos            = &core_struct->codeblock;
-        info->thaw_ptr = pos;
-        (info->visit_pmc_now)(INTERP, *pos, info);
+        VISIT_PMC_ATTR(INTERP, info, SELF, Task, codeblock);
     }
 
 /*
@@ -433,26 +411,25 @@
 */
 
     VTABLE void freeze(visit_info *info) {
-        IMAGE_IO * const io = info->image_io;
         const Parrot_Task_attributes * const core_struct = PARROT_TASK(SELF);
 
         /* 1) freeze task id */
-        VTABLE_push_integer(INTERP, io, core_struct->id);
+        VTABLE_push_integer(INTERP, info, core_struct->id);
 
         /* 2) freeze task birthtime */
-        VTABLE_push_float(INTERP, io, core_struct->birthtime);
+        VTABLE_push_float(INTERP, info, core_struct->birthtime);
 
         /* 3) freeze task priority */
-        VTABLE_push_integer(INTERP, io, core_struct->priority);
+        VTABLE_push_integer(INTERP, info, core_struct->priority);
 
         /* 4) freeze task type */
-        VTABLE_push_string(INTERP, io, core_struct->type);
+        VTABLE_push_string(INTERP, info, core_struct->type);
 
         /* 5) freeze task subtype */
-        VTABLE_push_string(INTERP, io, core_struct->subtype);
+        VTABLE_push_string(INTERP, info, core_struct->subtype);
 
         /* 6) freeze task status */
-        VTABLE_push_string(INTERP, io, core_struct->status);
+        VTABLE_push_string(INTERP, info, core_struct->status);
     }
 
 /*
@@ -466,25 +443,23 @@
 */
 
     VTABLE void thaw(visit_info *info) {
-        IMAGE_IO * const io = info->image_io;
-
         /* 1. thaw task id */
-        const INTVAL id = VTABLE_shift_integer(INTERP, io);
+        const INTVAL id = VTABLE_shift_integer(INTERP, info);
 
         /* 2. thaw task birthtime */
-        const FLOATVAL birthtime = VTABLE_shift_float(INTERP, io);
+        const FLOATVAL birthtime = VTABLE_shift_float(INTERP, info);
 
         /* 3. thaw task priority */
-        const INTVAL priority = VTABLE_shift_integer(INTERP, io);
+        const INTVAL priority = VTABLE_shift_integer(INTERP, info);
 
         /* 4. thaw task type */
-        STRING * const type = VTABLE_shift_string(INTERP, io);
+        STRING * const type = VTABLE_shift_string(INTERP, info);
 
         /* 5. thaw task subtype */
-        STRING * const subtype = VTABLE_shift_string(INTERP, io);
+        STRING * const subtype = VTABLE_shift_string(INTERP, info);
 
         /* 6. thaw task status */
-        STRING * const status = VTABLE_shift_string(INTERP, io);
+        STRING * const status = VTABLE_shift_string(INTERP, info);
 
         /* Allocate the task's core data struct and set custom flags. */
         SELF.init();

Modified: branches/orderedhash_revamp/src/pmc/timer.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/timer.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/timer.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -57,11 +57,11 @@
 
 #include "parrot/scheduler_private.h"
 
-pmclass Timer extends Task provides event need_ext {
-    ATTR FLOATVAL      duration;  /* The duration of the timer pause */
-    ATTR FLOATVAL      interval;  /* How often to repeat */
-    ATTR INTVAL        repeat;    /* Whether to repeat:
-                                   * 0 = run once (no repeat), -1 = forever */
+pmclass Timer extends Task provides event auto_attrs {
+    ATTR FLOATVAL duration;  /* The duration of the timer pause */
+    ATTR FLOATVAL interval;  /* How often to repeat */
+    ATTR INTVAL   repeat;    /* Whether to repeat:
+                              * 0 = run once (no repeat), -1 = forever */
 
 /*
 
@@ -74,15 +74,13 @@
 */
 
     VTABLE void init() {
-        Parrot_Timer_attributes * const core_struct =
-            mem_allocate_zeroed_typed(Parrot_Timer_attributes);
+        Parrot_Timer_attributes * const core_struct = PARROT_TIMER(SELF);
 
         /* Set flags for custom GC mark and destroy. */
         PObj_custom_mark_SET(SELF);
-        PObj_active_destroy_SET(SELF);
+        PObj_custom_destroy_SET(SELF);
 
         /* Set up the core struct. */
-        PMC_data(SELF)           = core_struct;
         core_struct->id          = 0;
         core_struct->type        = CONST_STRING(interp, "timer");
         core_struct->subtype     = CONST_STRING(interp, "");
@@ -118,29 +116,29 @@
         for (i = 0; i < n; i += 2) {
             const INTVAL key = VTABLE_get_integer_keyed_int(INTERP, init, i);
             switch (key) {
-                case PARROT_TIMER_SEC:
-                case PARROT_TIMER_USEC:
-                case PARROT_TIMER_REPEAT:
-                case PARROT_TIMER_RUNNING:
-                    {
+              case PARROT_TIMER_SEC:
+              case PARROT_TIMER_USEC:
+              case PARROT_TIMER_REPEAT:
+              case PARROT_TIMER_RUNNING:
+                {
                     const INTVAL val = VTABLE_get_integer_keyed_int(INTERP, init, i+1);
                     SELF.set_integer_keyed_int(key, val);
-                    }
-                    break;
-                case PARROT_TIMER_NSEC:
-                    {
+                }
+                break;
+              case PARROT_TIMER_NSEC:
+                {
                     const FLOATVAL nval = VTABLE_get_number_keyed_int(INTERP, init, i+1);
                     SELF.set_number_keyed_int(key, nval);
-                    }
-                    break;
-                case PARROT_TIMER_HANDLER:
-                    {
+                }
+                break;
+              case PARROT_TIMER_HANDLER:
+                {
                     PMC * const pval = VTABLE_get_pmc_keyed_int(INTERP, init, i+1);
                     SELF.set_pmc_keyed_int(key, pval);
-                    }
-                    break;
-                default:
-                    break;
+                }
+                break;
+              default:
+                break;
             }
         }
     }
@@ -156,7 +154,7 @@
 */
 
     VTABLE PMC *clone() {
-        PMC          * const copy       = SUPER();
+        PMC * const copy = SUPER();
         Parrot_Timer_attributes * const new_struct = PARROT_TIMER(copy);
         Parrot_Timer_attributes * const old_struct = PARROT_TIMER(SELF);
 
@@ -179,7 +177,6 @@
 
     VTABLE void destroy() {
         Parrot_cx_delete_task(INTERP, SELF);
-        mem_sys_free(PMC_data(SELF));
     }
 
 /*
@@ -197,18 +194,18 @@
         const FLOATVAL absolute_time = core_struct->birthtime + core_struct->duration;
 
         switch (key) {
-            case PARROT_TIMER_SEC:
-                return (INTVAL)absolute_time;
-            case PARROT_TIMER_USEC:
-                return (INTVAL)((absolute_time - (INTVAL)absolute_time) *1000000.0);
-            case PARROT_TIMER_REPEAT:
-                return (INTVAL) core_struct->repeat;
-            case PARROT_TIMER_INTERVAL:
-                return (INTVAL) core_struct->interval;
-            case PARROT_TIMER_RUNNING:
-                return 0;
-            default:
-                return -1;
+          case PARROT_TIMER_SEC:
+            return (INTVAL)absolute_time;
+          case PARROT_TIMER_USEC:
+            return (INTVAL)((absolute_time - (INTVAL)absolute_time) *1000000.0);
+          case PARROT_TIMER_REPEAT:
+            return (INTVAL) core_struct->repeat;
+          case PARROT_TIMER_INTERVAL:
+            return (INTVAL) core_struct->interval;
+          case PARROT_TIMER_RUNNING:
+            return 0;
+          default:
+            return -1;
         }
     }
 
@@ -242,15 +239,15 @@
 */
 
     VTABLE FLOATVAL get_number_keyed_int(INTVAL key) {
-        const Parrot_Timer_attributes * const core_struct = PARROT_TIMER(SELF);
+        Parrot_Timer_attributes * const core_struct = PARROT_TIMER(SELF);
 
         switch (key) {
-            case PARROT_TIMER_NSEC:
-                return core_struct->birthtime + core_struct->duration;
-            case PARROT_TIMER_INTERVAL:
-                return core_struct->interval;
-            default:
-                break;
+          case PARROT_TIMER_NSEC:
+            return core_struct->birthtime + core_struct->duration;
+          case PARROT_TIMER_INTERVAL:
+            return core_struct->interval;
+          default:
+            break;
         }
 
         return -1.0;
@@ -270,26 +267,26 @@
         Parrot_Timer_attributes * const core_struct = PARROT_TIMER(SELF);
 
         switch (key) {
-            case PARROT_TIMER_SEC:
-                core_struct->duration = value;
-                break;
-            case PARROT_TIMER_USEC:
-                core_struct->duration += value / 1000000.0;
-                break;
-            case PARROT_TIMER_REPEAT:
-                core_struct->repeat = value;
-                break;
-            case PARROT_TIMER_INTERVAL:
-                core_struct->interval = value;
-                break;
-            case PARROT_TIMER_RUNNING:
-                if (value)
-                    Parrot_cx_schedule_task(INTERP, SELF);
-                else
-                    Parrot_cx_delete_task(INTERP, SELF);
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(INTERP, NULL,
+          case PARROT_TIMER_SEC:
+            core_struct->duration = value;
+            break;
+          case PARROT_TIMER_USEC:
+            core_struct->duration += value / 1000000.0;
+            break;
+          case PARROT_TIMER_REPEAT:
+            core_struct->repeat = value;
+            break;
+          case PARROT_TIMER_INTERVAL:
+            core_struct->interval = value;
+            break;
+          case PARROT_TIMER_RUNNING:
+            if (value)
+                Parrot_cx_schedule_task(INTERP, SELF);
+            else
+                Parrot_cx_delete_task(INTERP, SELF);
+            break;
+          default:
+            Parrot_ex_throw_from_c_args(INTERP, NULL,
                     EXCEPTION_INVALID_OPERATION,
                     "Unknown timer type in Timer.set_integer_keyed_int: %d",
                     key);
@@ -345,14 +342,14 @@
         Parrot_Timer_attributes * const core_struct = PARROT_TIMER(SELF);
 
         switch (key) {
-            case PARROT_TIMER_NSEC:
-                core_struct->duration = value;
-                break;
-            case PARROT_TIMER_INTERVAL:
-                core_struct->interval = value;
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(INTERP, NULL,
+          case PARROT_TIMER_NSEC:
+            core_struct->duration = value;
+            break;
+          case PARROT_TIMER_INTERVAL:
+            core_struct->interval = value;
+            break;
+          default:
+            Parrot_ex_throw_from_c_args(INTERP, NULL,
                     EXCEPTION_INVALID_OPERATION,
                     "Unknown timer attribute in Timer.set_number_keyed_int: %d",
                     key);

Modified: branches/orderedhash_revamp/src/pmc/undef.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/undef.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/undef.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -23,7 +23,7 @@
 
 */
 
-#include "pmc_object.h"
+#include "pmc/pmc_object.h"
 #define UNDEF_STRING_CLASS enum_class_String
 
 pmclass Undef no_ro {
@@ -45,20 +45,28 @@
             VTABLE_set_pmc(INTERP, SELF, other);
         }
         else {
-            PMC * const class_ = PARROT_OBJECT(other)->_class;
-            PMC        *clone  = VTABLE_clone(interp, other);
-            void       *attrs;
-            pmc_reuse_by_class(INTERP, SELF, class_, PObj_is_object_FLAG);
+            PMC * const class_  = PARROT_OBJECT(other)->_class;
+            PMC        *clone   = VTABLE_clone(interp, other);
+            void       *attrs   = PMC_data(clone);
+            PMC        *meta    = PMC_metadata(clone);
 
             /* now swap memory without leaking it */
-            attrs              = PMC_data(SELF);
-            PMC_data(SELF)     = PMC_data(clone);
-            PMC_data(clone)    = attrs;
-            VTABLE_destroy(interp, clone);
+            PMC_data(clone)     = PMC_data(SELF);
+            PMC_data(SELF)      = attrs;
+            SELF->vtable        = clone->vtable;
+
+            /* Restore metadata. */
+            if (!PMC_IS_NULL(meta)) {
+                PMC * const iter = VTABLE_get_iter(interp, meta);
+                while (VTABLE_get_bool(interp, iter)) {
+                    STRING * const key = VTABLE_shift_string(interp, iter);
+                    PMC * const value  = VTABLE_get_pmc_keyed_str(interp, meta, key);
+                    VTABLE_setprop(interp, SELF, key, value);
+                }
+            }
+            PMC_data(clone) = NULL;
 
             PObj_is_object_SET(SELF);
-            PObj_active_destroy_SET(SELF);
-
         }
     }
 
@@ -200,6 +208,22 @@
 
 /*
 
+=item C<INTVAL logical_not()>
+
+Returns 1.
+
+=cut
+
+*/
+
+    VTABLE PMC *logical_not(PMC *dest) {
+        dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
+        VTABLE_set_bool(INTERP, dest, 1);
+        return dest;
+    }
+
+/*
+
 =item C<void share()>
 
 Unknown. (TODO)

Modified: branches/orderedhash_revamp/src/pmc/unmanagedstruct.pmc
==============================================================================
--- branches/orderedhash_revamp/src/pmc/unmanagedstruct.pmc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc/unmanagedstruct.pmc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -238,55 +238,55 @@
 ret_int(PARROT_INTERP, const char *p, int type)
 {
     switch (type) {
-        case enum_type_INTVAL:
-            return *(const INTVAL*) p;
+      case enum_type_INTVAL:
+        return *(const INTVAL*) p;
 
 #if INT_SIZE == 4
-        case enum_type_int32:
-        case enum_type_uint32:
+      case enum_type_int32:
+      case enum_type_uint32:
 #endif
 
 #if INT_SIZE == 8
-        case enum_type_int64:
-        case enum_type_uint64:
+      case enum_type_int64:
+      case enum_type_uint64:
 #endif
 
-        case enum_type_int:
-            return *(const int *)p;
+      case enum_type_int:
+        return *(const int *)p;
 
 #if (LONG_SIZE == 4) && !(INT_SIZE == 4) /* Unlikely combination. */
-        case enum_type_int32:
-        case enum_type_uint32:
+      case enum_type_int32:
+      case enum_type_uint32:
 #endif
 
 #if (LONG_SIZE == 8) && !(INT_SIZE == 8)
-        case enum_type_int64:
-        case enum_type_uint64:
+      case enum_type_int64:
+      case enum_type_uint64:
 #endif
 
-        case enum_type_long:
-        case enum_type_ulong:
-            return *(const long *)p;
+      case enum_type_long:
+      case enum_type_ulong:
+        return *(const long *)p;
 
 #if SHORT_SIZE == 2
-        case enum_type_int16:
-        case enum_type_uint16:
+      case enum_type_int16:
+      case enum_type_uint16:
 #endif
 
         /* If SHORT_SIZE != 2 getting int16s requires extra tricks. */
-        case enum_type_short:
-            return *(const short *)p;
-        case enum_type_uint8:
-        case enum_type_uchar:
+      case enum_type_short:
+        return *(const short *)p;
+      case enum_type_uint8:
+      case enum_type_uchar:
         {
             const unsigned char *uc = (const unsigned char *)p;
             return (INTVAL)*uc;
         }
-        case enum_type_int8:
-        case enum_type_char:
-            return *p;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, 1,
+      case enum_type_int8:
+      case enum_type_char:
+        return *p;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, 1,
                 "returning unhandled int type in struct");
     }
 }
@@ -310,14 +310,14 @@
 ret_float(PARROT_INTERP, const char *p, int type)
 {
     switch (type) {
-        case enum_type_FLOATVAL:
-            return (FLOATVAL) *(const FLOATVAL *)p;
-        case enum_type_float:
-            return (FLOATVAL) *(const float *)p;
-        case enum_type_double:
-            return (FLOATVAL) *(const double *)p;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, 1,
+      case enum_type_FLOATVAL:
+        return (FLOATVAL) *(const FLOATVAL *)p;
+      case enum_type_float:
+        return (FLOATVAL) *(const float *)p;
+      case enum_type_double:
+        return (FLOATVAL) *(const double *)p;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, 1,
                 "returning unhandled float type in struct");
     }
 }
@@ -377,41 +377,40 @@
     PMC *ptr  = VTABLE_get_pmc_keyed_int(interp, init, idx * 3);
 
     switch (type) {
-        case enum_type_func_ptr:
-            /* this is a raw function pointer - not a PMC */
-            ret  = *(PMC**) p;
-
-            /* now check if initializer has a signature attached */
-            if (ptr->pmc_ext && PMC_metadata(ptr)) {
-                STRING *signature_str = CONST_STRING(interp, "_signature");
-                PMC *sig = VTABLE_getprop(interp, ptr, signature_str);
-                if (VTABLE_defined(interp, sig)) {
-                    STRING *sig_str = VTABLE_get_string(interp, sig);
-                    ret             = pmc_new(interp, enum_class_NCI);
-                    VTABLE_set_pointer_keyed_str(interp, ret, sig_str,
+      case enum_type_func_ptr:
+        /* this is a raw function pointer - not a PMC */
+        ret  = *(PMC**) p;
+
+        /* now check if initializer has a signature attached */
+        if (PMC_metadata(ptr)) {
+            STRING *signature_str = CONST_STRING(interp, "_signature");
+            PMC *sig = VTABLE_getprop(interp, ptr, signature_str);
+            if (VTABLE_defined(interp, sig)) {
+                STRING *sig_str = VTABLE_get_string(interp, sig);
+                ret             = pmc_new(interp, enum_class_NCI);
+                VTABLE_set_pointer_keyed_str(interp, ret, sig_str,
                             *(PMC **)p);
-                }
             }
+        }
 
-            return ret;
-        case enum_type_struct_ptr:
-            /* check the metadata for an initializer */
-
-            /* grab the struct from the metadata */
-            if (ptr->pmc_ext && PMC_metadata(ptr)) {
-                ret = VTABLE_getprop(interp, ptr, CONST_STRING(interp, "_struct"));
-            }
-            else {
-                Parrot_ex_throw_from_c_args(interp, NULL,
+        return ret;
+      case enum_type_struct_ptr:
+        /* check the metadata for an initializer */
+
+        /* grab the struct from the metadata */
+        if (PMC_metadata(ptr))
+            ret = VTABLE_getprop(interp, ptr, CONST_STRING(interp, "_struct"));
+        else {
+            Parrot_ex_throw_from_c_args(interp, NULL,
                     EXCEPTION_INVALID_OPERATION,
                     "no initializer available for nested struct");
-            }
+        }
 
-            VTABLE_set_pointer(interp, ret, *(void**)p);
+        VTABLE_set_pointer(interp, ret, *(void**)p);
 
-            return ret;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+        return ret;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
                     "returning unhandled pmc type (%d) in struct", type);
     }
 }
@@ -429,27 +428,27 @@
 set_int(PARROT_INTERP, char *p, int type, INTVAL value)
 {
     switch (type) {
-        case enum_type_uint8:
-        case enum_type_int8:
-        case enum_type_char:
-        case enum_type_uchar:
-            *(char *)p = (char)(value & 0xff);
-            break;
-        case enum_type_INTVAL:
-            *(INTVAL *)p = value;
-            break;
-        case enum_type_int:
-            *(int *)p = value;
-            break;
-        case enum_type_int16:
-        case enum_type_uint16:
-        case enum_type_short:
-            *(short *)p = (short)value;
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, 1,
+      case enum_type_uint8:
+      case enum_type_int8:
+      case enum_type_char:
+      case enum_type_uchar:
+        *(char *)p = (char)(value & 0xff);
+        break;
+      case enum_type_INTVAL:
+        *(INTVAL *)p = value;
+        break;
+      case enum_type_int:
+        *(int *)p = value;
+        break;
+      case enum_type_int16:
+      case enum_type_uint16:
+      case enum_type_short:
+        *(short *)p = (short)value;
+        break;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, 1,
                 "setting unhandled int type in struct");
-            break;
+        break;
     }
 }
 
@@ -469,19 +468,19 @@
 set_float(PARROT_INTERP, char *p, int type, FLOATVAL value)
 {
     switch (type) {
-        case enum_type_FLOATVAL:
-            *(FLOATVAL *)p = (FLOATVAL)value;
-            break;
-        case enum_type_float:
-            *(float *)p = (float)value;
-            break;
-        case enum_type_double:
-            *(double *)p = (double)value;
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, 1,
+      case enum_type_FLOATVAL:
+        *(FLOATVAL *)p = (FLOATVAL)value;
+        break;
+      case enum_type_float:
+        *(float *)p = (float)value;
+        break;
+      case enum_type_double:
+        *(double *)p = (double)value;
+        break;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, 1,
                 "setting unhandled float type in struct");
-            break;
+        break;
     }
 }
 
@@ -503,7 +502,7 @@
     if (type == enum_type_cstr) {
         /* assuming 0-terminated C-string here;
          * we can't use Parrot_str_to_cstring easily */
-        char *cstr  = value->strstart;
+        char *cstr  = (char *)Buffer_bufstart(value);
         *(char **)p = cstr;
     }
     else
@@ -651,7 +650,7 @@
     return toff;
 }
 
-pmclass UnManagedStruct need_ext no_ro {
+pmclass UnManagedStruct auto_attrs no_ro {
     ATTR void   *ptr;   /* the struct that this UnManagedStruct isn't managing */
     ATTR PMC    *init;  /* the initializer used with this UnManagedStruct */
     ATTR INTVAL  size;  /* the size of the struct */
@@ -664,38 +663,6 @@
 
 =over 4
 
-=item C<void init()>
-
-Initializes the C<struct> with a default value of C<NULL>.
-
-=cut
-
-*/
-
-    VTABLE void init() {
-        Parrot_UnManagedStruct_attributes *attrs =
-            mem_allocate_zeroed_typed(Parrot_UnManagedStruct_attributes);
-        PMC_data(SELF) = attrs;
-        PObj_active_destroy_SET(SELF);
-    }
-
-/*
-
-=item C<void destroy()>
-
-Destroys the subroutine.
-
-=cut
-
-*/
-
-    VTABLE void destroy() {
-        mem_sys_free(PMC_data(SELF));
-    }
-
-
-/*
-
 =item C<void init_pmc(PMC *value)>
 
 Initialize the struct with some data.
@@ -723,9 +690,6 @@
 */
 
     VTABLE void init_pmc(PMC *value) {
-        Parrot_UnManagedStruct_attributes *attrs =
-            mem_allocate_zeroed_typed(Parrot_UnManagedStruct_attributes);
-        PMC_data(SELF) = attrs;
         SELF.set_pmc(value);
     }
 
@@ -775,8 +739,8 @@
 */
 
     VTABLE void mark() {
-        if (PARROT_UNMANAGEDSTRUCT(SELF)->init)
-            Parrot_gc_mark_PObj_alive(INTERP, (PObj *)PARROT_UNMANAGEDSTRUCT(SELF)->init);
+        PMC *init = PARROT_UNMANAGEDSTRUCT(SELF)->init;
+        Parrot_gc_mark_PMC_alive(INTERP, init);
     }
 
 /*

Modified: branches/orderedhash_revamp/src/pmc_freeze.c
==============================================================================
--- branches/orderedhash_revamp/src/pmc_freeze.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/pmc_freeze.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -8,11 +8,6 @@
 
 =head1 DESCRIPTION
 
-Freeze uses the C<next_for_GC pointer()> to remember seen PMCs. PMCs are
-written as IDs (or tags), which are calculated from their arena address.
-This PMC number is multiplied by four. The 2 low bits indicate a seen
-PMC or a PMC of the same type as the previous one respectively.
-
 Thawing PMCs uses a list with (maximum) size of the amount of PMCs to
 keep track of retrieved PMCs.
 
@@ -23,7 +18,7 @@
 Container PMCs call a "todo-callback" for all contained PMCs. The
 individual action vtable (freeze/thaw) is then called for all todo-PMCs.
 
-In the current implementation C<IMAGE_IO> is a stand-in for some kind of
+In the current implementation C<visit_info> is a stand-in for some kind of
 serializer PMC which will eventually be written. It associates a Parrot
 C<STRING> with a vtable.
 
@@ -32,26 +27,14 @@
 */
 
 #include "parrot/parrot.h"
+#include "pmc/pmc_callcontext.h"
 #include "pmc_freeze.str"
 
 /* HEADERIZER HFILE: include/parrot/pmc_freeze.h */
 /* HEADERIZER BEGIN: static */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
-static void add_pmc_next_for_GC(SHIM_INTERP,
-    ARGIN(PMC *pmc),
-    ARGOUT(visit_info *info))
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*info);
-
-static void add_pmc_todo_list(PARROT_INTERP,
-    ARGIN_NULLOK(PMC *pmc),
-    ARGIN(visit_info *info))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3);
-
-static void create_image(PARROT_INTERP,
+static void create_buffer(PARROT_INTERP,
     ARGIN_NULLOK(PMC *pmc),
     ARGMOD(visit_info *info))
         __attribute__nonnull__(1)
@@ -59,1563 +42,640 @@
         FUNC_MODIFIES(*info);
 
 PARROT_INLINE
-static void do_action(PARROT_INTERP,
-    ARGIN_NULLOK(PMC *pmc),
-    ARGIN(visit_info *info),
-    int seen,
-    UINTVAL id)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3);
-
-PARROT_INLINE
-static void do_thaw(PARROT_INTERP,
-    ARGIN_NULLOK(PMC* pmc),
-    ARGIN(visit_info *info))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3);
-
-PARROT_INLINE
-static void freeze_pmc(PARROT_INTERP,
-    ARGIN_NULLOK(PMC *pmc),
-    ARGIN(visit_info *info),
-    int seen,
-    UINTVAL id)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3);
-
-static void ft_init(PARROT_INTERP, ARGIN(visit_info *info))
+static void ensure_buffer_size(PARROT_INTERP,
+    ARGIN(visit_info *io),
+    size_t len)
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-static UINTVAL id_from_pmc(PARROT_INTERP, ARGIN(PMC* pmc))
+static INTVAL get_visit_integer(PARROT_INTERP, ARGIN(visit_info *io))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
 PARROT_INLINE
-static int next_for_GC_seen(PARROT_INTERP,
-    ARGIN_NULLOK(PMC *pmc),
-    ARGIN(visit_info *info),
-    ARGOUT(UINTVAL *id))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        FUNC_MODIFIES(*id);
-
-static void op_append(PARROT_INTERP,
-    ARGIN(STRING *s),
-    opcode_t b,
-    size_t len)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
+static INTVAL INFO_HAS_DATA(ARGIN(visit_info *io))
+        __attribute__nonnull__(1);
 
 PARROT_INLINE
-static void op_check_size(PARROT_INTERP, ARGIN(STRING *s), size_t len)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static void pmc_add_ext(PARROT_INTERP, ARGIN(PMC *pmc))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static void push_ascii_integer(PARROT_INTERP, ARGIN(IMAGE_IO *io), INTVAL v)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static void push_ascii_number(PARROT_INTERP,
-    ARGIN(const IMAGE_IO *io),
-    FLOATVAL v)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static void push_ascii_pmc(PARROT_INTERP,
-    ARGIN(IMAGE_IO *io),
-    ARGIN(const PMC* v))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3);
-
-static void push_ascii_string(PARROT_INTERP,
-    ARGIN(IMAGE_IO *io),
-    ARGIN(const STRING *s))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3);
+static INTVAL OUTPUT_LENGTH(ARGIN(visit_info *io))
+        __attribute__nonnull__(1);
 
 static void push_opcode_integer(PARROT_INTERP,
-    ARGIN(IMAGE_IO *io),
+    ARGIN(visit_info *io),
     INTVAL v)
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
 static void push_opcode_number(PARROT_INTERP,
-    ARGIN(IMAGE_IO *io),
+    ARGIN(visit_info *io),
     FLOATVAL v)
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-static void push_opcode_pmc(PARROT_INTERP,
-    ARGIN(IMAGE_IO *io),
-    ARGIN(PMC* v))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3);
-
 static void push_opcode_string(PARROT_INTERP,
-    ARGIN(IMAGE_IO *io),
+    ARGIN(visit_info *io),
     ARGIN(STRING *v))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         __attribute__nonnull__(3);
 
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-static PMC* run_thaw(PARROT_INTERP,
-    ARGIN(STRING* image),
-    visit_enum_type what)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static INTVAL shift_ascii_integer(SHIM_INTERP, ARGIN(IMAGE_IO *io))
-        __attribute__nonnull__(2);
-
-static FLOATVAL shift_ascii_number(SHIM_INTERP, ARGIN(IMAGE_IO *io))
-        __attribute__nonnull__(2);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-static PMC* shift_ascii_pmc(SHIM_INTERP, ARGIN(IMAGE_IO *io))
-        __attribute__nonnull__(2);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-static STRING* shift_ascii_string(PARROT_INTERP, ARGIN(IMAGE_IO *io))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static INTVAL shift_opcode_integer(SHIM_INTERP, ARGIN(IMAGE_IO *io))
+static INTVAL shift_opcode_integer(SHIM_INTERP, ARGIN(visit_info *io))
         __attribute__nonnull__(2);
 
-static FLOATVAL shift_opcode_number(SHIM_INTERP, ARGIN(IMAGE_IO *io))
-        __attribute__nonnull__(2);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-static PMC* shift_opcode_pmc(PARROT_INTERP, ARGIN(IMAGE_IO *io))
-        __attribute__nonnull__(1)
+static FLOATVAL shift_opcode_number(SHIM_INTERP, ARGIN(visit_info *io))
         __attribute__nonnull__(2);
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-static STRING* shift_opcode_string(PARROT_INTERP, ARGIN(IMAGE_IO *io))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static void str_append(PARROT_INTERP,
-    ARGMOD(STRING *s),
-    ARGIN(const void *b),
-    size_t len)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        FUNC_MODIFIES(*s);
-
-PARROT_INLINE
-PARROT_CANNOT_RETURN_NULL
-static PMC* thaw_create_pmc(PARROT_INTERP,
-    ARGIN(const visit_info *info),
-    INTVAL type)
+static STRING* shift_opcode_string(PARROT_INTERP, ARGIN(visit_info *io))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-PARROT_INLINE
-static int thaw_pmc(PARROT_INTERP,
-    ARGMOD(visit_info *info),
-    ARGOUT(UINTVAL *id),
-    ARGOUT(INTVAL *type))
+static void visit_info_init(PARROT_INTERP,
+    ARGOUT(visit_info *info),
+    visit_enum_type what,
+    ARGIN(STRING *input),
+    ARGIN(PMC *pmc))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
         __attribute__nonnull__(4)
-        FUNC_MODIFIES(*info)
-        FUNC_MODIFIES(*id)
-        FUNC_MODIFIES(*type);
-
-static void todo_list_init(PARROT_INTERP, ARGOUT(visit_info *info))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
+        __attribute__nonnull__(5)
         FUNC_MODIFIES(*info);
 
-PARROT_INLINE
-static int todo_list_seen(PARROT_INTERP,
-    ARGIN(PMC *pmc),
-    ARGMOD(visit_info *info),
-    ARGOUT(UINTVAL *id))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        FUNC_MODIFIES(*info)
-        FUNC_MODIFIES(*id);
-
-static void visit_loop_next_for_GC(PARROT_INTERP,
-    ARGIN(PMC *current),
-    ARGIN(visit_info *info))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3);
-
 static void visit_loop_todo_list(PARROT_INTERP,
     ARGIN_NULLOK(PMC *current),
     ARGIN(visit_info *info))
         __attribute__nonnull__(1)
         __attribute__nonnull__(3);
 
-static void visit_next_for_GC(PARROT_INTERP,
-    ARGIN(PMC* pmc),
-    ARGIN(visit_info* info))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3);
-
-static void visit_todo_list(PARROT_INTERP,
+static void visit_todo_list_freeze(PARROT_INTERP,
     ARGIN_NULLOK(PMC* pmc),
     ARGIN(visit_info* info))
         __attribute__nonnull__(1)
         __attribute__nonnull__(3);
 
+PARROT_INLINE
 static void visit_todo_list_thaw(PARROT_INTERP,
-    ARGIN_NULLOK(PMC* old),
+    SHIM(PMC* pmc_not_used),
     ARGIN(visit_info* info))
         __attribute__nonnull__(1)
         __attribute__nonnull__(3);
 
-#define ASSERT_ARGS_add_pmc_next_for_GC __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pmc) \
-    || PARROT_ASSERT_ARG(info)
-#define ASSERT_ARGS_add_pmc_todo_list __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(info)
-#define ASSERT_ARGS_create_image __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(info)
-#define ASSERT_ARGS_do_action __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(info)
-#define ASSERT_ARGS_do_thaw __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(info)
-#define ASSERT_ARGS_freeze_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(info)
-#define ASSERT_ARGS_ft_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(info)
-#define ASSERT_ARGS_id_from_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_next_for_GC_seen __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(info) \
-    || PARROT_ASSERT_ARG(id)
-#define ASSERT_ARGS_op_append __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_op_check_size __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_pmc_add_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_push_ascii_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(io)
-#define ASSERT_ARGS_push_ascii_number __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(io)
-#define ASSERT_ARGS_push_ascii_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(io) \
-    || PARROT_ASSERT_ARG(v)
-#define ASSERT_ARGS_push_ascii_string __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(io) \
-    || PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_push_opcode_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_create_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(io)
-#define ASSERT_ARGS_push_opcode_number __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(info))
+#define ASSERT_ARGS_ensure_buffer_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(io)
-#define ASSERT_ARGS_push_opcode_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(io))
+#define ASSERT_ARGS_get_visit_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(io) \
-    || PARROT_ASSERT_ARG(v)
-#define ASSERT_ARGS_push_opcode_string __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(io))
+#define ASSERT_ARGS_INFO_HAS_DATA __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(io))
+#define ASSERT_ARGS_OUTPUT_LENGTH __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(io))
+#define ASSERT_ARGS_push_opcode_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(io))
+#define ASSERT_ARGS_push_opcode_number __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(io))
+#define ASSERT_ARGS_push_opcode_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(io) \
+    , PARROT_ASSERT_ARG(v))
+#define ASSERT_ARGS_shift_opcode_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(io))
+#define ASSERT_ARGS_shift_opcode_number __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(io))
+#define ASSERT_ARGS_shift_opcode_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(io))
+#define ASSERT_ARGS_visit_info_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(info) \
+    , PARROT_ASSERT_ARG(input) \
+    , PARROT_ASSERT_ARG(pmc))
+#define ASSERT_ARGS_visit_loop_todo_list __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(io) \
-    || PARROT_ASSERT_ARG(v)
-#define ASSERT_ARGS_run_thaw __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(info))
+#define ASSERT_ARGS_visit_todo_list_freeze __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(image)
-#define ASSERT_ARGS_shift_ascii_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(io)
-#define ASSERT_ARGS_shift_ascii_number __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(io)
-#define ASSERT_ARGS_shift_ascii_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(io)
-#define ASSERT_ARGS_shift_ascii_string __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(info))
+#define ASSERT_ARGS_visit_todo_list_thaw __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(io)
-#define ASSERT_ARGS_shift_opcode_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(io)
-#define ASSERT_ARGS_shift_opcode_number __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(io)
-#define ASSERT_ARGS_shift_opcode_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(io)
-#define ASSERT_ARGS_shift_opcode_string __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(io)
-#define ASSERT_ARGS_str_append __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s) \
-    || PARROT_ASSERT_ARG(b)
-#define ASSERT_ARGS_thaw_create_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(info)
-#define ASSERT_ARGS_thaw_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(info) \
-    || PARROT_ASSERT_ARG(id) \
-    || PARROT_ASSERT_ARG(type)
-#define ASSERT_ARGS_todo_list_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(info)
-#define ASSERT_ARGS_todo_list_seen __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc) \
-    || PARROT_ASSERT_ARG(info) \
-    || PARROT_ASSERT_ARG(id)
-#define ASSERT_ARGS_visit_loop_next_for_GC __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(current) \
-    || PARROT_ASSERT_ARG(info)
-#define ASSERT_ARGS_visit_loop_todo_list __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(info)
-#define ASSERT_ARGS_visit_next_for_GC __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc) \
-    || PARROT_ASSERT_ARG(info)
-#define ASSERT_ARGS_visit_todo_list __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(info)
-#define ASSERT_ARGS_visit_todo_list_thaw __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(info)
+    , PARROT_ASSERT_ARG(info))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
-/*
- * define this to 1 for testing. TODO: 1 is broken.
- */
-#ifndef FREEZE_ASCII
-#  define FREEZE_ASCII 0
-#endif
-
-/* normal freeze can use next_for_GC ptrs or a seen hash */
-#define FREEZE_USE_NEXT_FOR_GC 0
-
 /* when thawing a string longer then this size, we first do a GC run and then
  * block GC - the system can't give us more headers */
 
 #define THAW_BLOCK_GC_SIZE 100000
 
 /* preallocate freeze image for aggregates with this estimation */
-#if FREEZE_ASCII
-#  define FREEZE_BYTES_PER_ITEM 17
-#else
-#  define FREEZE_BYTES_PER_ITEM 9
-#endif
+#define FREEZE_BYTES_PER_ITEM 9
+
+/* macros/constants to handle packing/unpacking of PMC IDs and flags
+ * the 2 LSBs are used for flags, all other bits are used for PMC ID
+ */
+#define PackID_new(id, flags)       (((UINTVAL)(id) * 4) | ((UINTVAL)(flags) & 3))
+#define PackID_get_PMCID(id)        ((UINTVAL)(id) / 4)
+#define PackID_set_PMCID(lv, id)    (lv) = PackID_new((id), PackID_get_FLAGS(lv))
+#define PackID_get_FLAGS(id)        ((UINTVAL)(id) & 3)
+#define PackID_set_FLAGS(lv, flags) (lv) = PackID_new(PackID_get_PMCID(lv), (flags))
+
+enum {
+    enum_PackID_normal     = 0,
+    enum_PackID_seen       = 1,
+};
 
 /*
 
-=head2 Image Stream Functions
+=head2 C<opcode_t> IO Functions
 
 =over 4
 
-=item C<static void str_append(PARROT_INTERP, STRING *s, const void *b, size_t
+=item C<static void ensure_buffer_size(PARROT_INTERP, visit_info *io, size_t
 len)>
 
-Appends C<len> bytes from buffer C<*b> to string C<*s>.
-
-Plain ascii - for testing only:
-
-For speed reasons we mess around with the string buffers directly.
-
-No encoding of strings, no transcoding.
-
-=cut
-
-*/
-
-static void
-str_append(PARROT_INTERP, ARGMOD(STRING *s), ARGIN(const void *b), size_t len)
-{
-    ASSERT_ARGS(str_append)
-    const size_t used = s->bufused;
-    const int need_free = (int)PObj_buflen(s) - used - len;
-    /*
-     * grow by factor 1.5 or such
-     */
-    if (need_free <= 16) {
-        size_t new_size = (size_t) (PObj_buflen(s) * 1.5);
-        if (new_size < PObj_buflen(s) - need_free + 512)
-            new_size = PObj_buflen(s) - need_free + 512;
-        Parrot_gc_reallocate_string_storage(interp, s, new_size);
-        PARROT_ASSERT(PObj_buflen(s) - used - len >= 15);
-    }
-    mem_sys_memcopy((void *)((ptrcast_t)s->strstart + used), b, len);
-    s->bufused += len;
-    s->strlen += len;
-}
-
-/*
-
-=item C<static void push_ascii_integer(PARROT_INTERP, IMAGE_IO *io, INTVAL v)>
-
-Pushes an ASCII version of the integer C<v> onto the end of the C<*io>
-"stream".
+Checks the size of the "stream" buffer to see if it can accommodate
+C<len> more bytes. If not, expands the buffer.
 
 =cut
 
 */
 
-static void
-push_ascii_integer(PARROT_INTERP, ARGIN(IMAGE_IO *io), INTVAL v)
-{
-    ASSERT_ARGS(push_ascii_integer)
-    char buffer[20];
-    const size_t len = snprintf(buffer, sizeof (buffer), "%d ", (int) v);
-    str_append(interp, io->image, buffer, len);
-}
-
-/*
-
-=item C<static void push_ascii_number(PARROT_INTERP, const IMAGE_IO *io,
-FLOATVAL v)>
+#define GET_VISIT_CURSOR(io) \
+    ((opcode_t *)(((char *)Buffer_bufstart((io)->buffer) + (io)->pos)))
+#define SET_VISIT_CURSOR(io, x) do {\
+    (io)->pos = ((char *)(x) - (char *)Buffer_bufstart((io)->buffer)); \
+} while (0)
+#define INC_VISIT_CURSOR(io, x) do {\
+    (io)->pos += (x); \
+} while (0)
 
-Pushes an ASCII version of the number C<v> onto the end of the C<*io>
-"stream".
+#define BYTECODE_SHIFT_OK(io) PARROT_ASSERT((io)->pos <= (io)->input_length)
 
-=cut
-
-*/
 
+PARROT_INLINE
 static void
-push_ascii_number(PARROT_INTERP, ARGIN(const IMAGE_IO *io), FLOATVAL v)
+ensure_buffer_size(PARROT_INTERP, ARGIN(visit_info *io), size_t len)
 {
-    ASSERT_ARGS(push_ascii_number)
-    char buffer[40];
-    const size_t len = snprintf(buffer, sizeof (buffer), "%g ", (double) v);
-    str_append(interp, io->image, buffer, len);
-}
-
-/*
-
-=item C<static void push_ascii_string(PARROT_INTERP, IMAGE_IO *io, const STRING
-*s)>
+    ASSERT_ARGS(ensure_buffer_size)
+    Buffer *buf         = io->buffer;
+    const size_t used   = io->pos;
+    const int need_free = Buffer_buflen(buf) - used - len;
 
-Pushes an ASCII version of the string C<*s> onto the end of the C<*io>
-"stream".
-
-For testing only - no encodings and such.
-
-XXX no string delimiters - so no space allowed.
-
-=cut
-
-*/
+    /* grow by factor 1.5 or such */
+    if (need_free <= 16) {
+        size_t new_size = (size_t) (Buffer_buflen(buf) * 1.5);
+        if (new_size < Buffer_buflen(buf) - need_free + 512)
+            new_size = Buffer_buflen(buf) - need_free + 512;
+        Parrot_gc_reallocate_buffer_storage(interp, buf, new_size);
 
-static void
-push_ascii_string(PARROT_INTERP, ARGIN(IMAGE_IO *io), ARGIN(const STRING *s))
-{
-    ASSERT_ARGS(push_ascii_string)
-    const UINTVAL length = Parrot_str_byte_length(interp, s);
-    char * const buffer = (char *)malloc(4*length); /* XXX Why 4?  What does that mean? */
-    char *cursor = buffer;
-    UINTVAL idx = 0;
-
-    /* temporary--write out in UTF-8 */
-    for (idx = 0; idx < length; ++idx) {
-        *cursor++ = (unsigned char)Parrot_str_indexed(interp, s, idx);
+        PARROT_ASSERT(Buffer_buflen(buf) - used - len >= 15);
     }
 
-    str_append(interp, io->image, buffer, cursor - buffer);
-    str_append(interp, io->image, " ", 1);
-
-    mem_sys_free(buffer);
-}
-
-/*
-
-=item C<static void push_ascii_pmc(PARROT_INTERP, IMAGE_IO *io, const PMC* v)>
-
-Pushes an ASCII version of the PMC C<*v> onto the end of the C<*io>
-"stream".
-
-=cut
-
-*/
+#ifndef DISABLE_GC_DEBUG
+    Parrot_gc_compact_memory_pool(interp);
+#endif
 
-static void
-push_ascii_pmc(PARROT_INTERP, ARGIN(IMAGE_IO *io), ARGIN(const PMC* v))
-{
-    ASSERT_ARGS(push_ascii_pmc)
-    char buffer[20];
-    const size_t len = snprintf(buffer, sizeof (buffer), "%p ", (const void *)v);
-    str_append(interp, io->image, buffer, len);
 }
 
 /*
 
-=item C<static INTVAL shift_ascii_integer(PARROT_INTERP, IMAGE_IO *io)>
+=item C<static INTVAL OUTPUT_LENGTH(visit_info *io)>
 
-Removes and returns an integer from the start of the C<*io> "stream".
+XXX TODO
 
 =cut
 
 */
 
+PARROT_INLINE
 static INTVAL
-shift_ascii_integer(SHIM_INTERP, ARGIN(IMAGE_IO *io))
-{
-    ASSERT_ARGS(shift_ascii_integer)
-    char * const start = (char*)io->image->strstart;
-    char *p = start;
-    const INTVAL i = strtoul(p, &p, 10);
-
-    ++p;
-    PARROT_ASSERT(p <= start + io->image->bufused);
-    io->image->strstart = p;
-    io->image->bufused -= (p - start);
-    PARROT_ASSERT((int)io->image->bufused >= 0);
-    return i;
-}
-
-/*
-
-=item C<static FLOATVAL shift_ascii_number(PARROT_INTERP, IMAGE_IO *io)>
-
-Removes and returns an number from the start of the C<*io> "stream".
-
-=cut
-
-*/
-
-static FLOATVAL
-shift_ascii_number(SHIM_INTERP, ARGIN(IMAGE_IO *io))
-{
-    ASSERT_ARGS(shift_ascii_number)
-    char * const start = (char*)io->image->strstart;
-    char *p = start;
-    const FLOATVAL f = (FLOATVAL) strtod(p, &p);
-
-    ++p;
-    PARROT_ASSERT(p <= start + io->image->bufused);
-    io->image->strstart = p;
-    io->image->bufused -= (p - start);
-    PARROT_ASSERT((int)io->image->bufused >= 0);
-    return f;
+OUTPUT_LENGTH(ARGIN(visit_info *io)) {
+    ASSERT_ARGS(OUTPUT_LENGTH)
+    return io->pos;
 }
 
 /*
 
-=item C<static STRING* shift_ascii_string(PARROT_INTERP, IMAGE_IO *io)>
+=item C<static INTVAL INFO_HAS_DATA(visit_info *io)>
 
-Removes and returns an string from the start of the C<*io> "stream".
+XXX TODO
 
 =cut
 
 */
 
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-static STRING*
-shift_ascii_string(PARROT_INTERP, ARGIN(IMAGE_IO *io))
-{
-    ASSERT_ARGS(shift_ascii_string)
-    STRING *s;
-
-    char * const start = (char*)io->image->strstart;
-    char *p = start;
-
-    while (*p != ' ')
-        ++p;
-    ++p;
-    PARROT_ASSERT(p <= start + io->image->bufused);
-    io->image->strstart = p;
-    io->image->bufused -= (p - start);
-    PARROT_ASSERT((int)io->image->bufused >= 0);
-    s = string_make(interp, start, p - start - 1, "iso-8859-1", 0);
-/*    s = string_make(interp, start, p - start - 1, "UTF-8", 0); */
-    return s;
+PARROT_INLINE
+static INTVAL
+INFO_HAS_DATA(ARGIN(visit_info *io)) {
+    ASSERT_ARGS(INFO_HAS_DATA)
+    return io->pos < io->input_length;
 }
 
-/*
-
-=item C<static PMC* shift_ascii_pmc(PARROT_INTERP, IMAGE_IO *io)>
-
-Removes and returns a PMC from the start of the C<*io> "stream".
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-static PMC*
-shift_ascii_pmc(SHIM_INTERP, ARGIN(IMAGE_IO *io))
-{
-    ASSERT_ARGS(shift_ascii_pmc)
-    char * const start = (char*)io->image->strstart;
-    char *p = start;
-    const unsigned long i = strtoul(p, &p, 16);
-    ++p;
-    PARROT_ASSERT(p <= start + io->image->bufused);
-    io->image->strstart = p;
-    io->image->bufused -= (p - start);
-    PARROT_ASSERT((int)io->image->bufused >= 0);
-    return (PMC*) i;
-}
 
 /*
 
-=back
-
-=head2 C<opcode_t> IO Functions
-
-=over 4
-
-=item C<static void op_check_size(PARROT_INTERP, STRING *s, size_t len)>
+=item C<static INTVAL get_visit_integer(PARROT_INTERP, visit_info *io)>
 
-Checks the size of the "stream" buffer to see if it can accommodate
-C<len> more bytes. If not then the buffer is expanded.
+get the flags describing the visit action
 
 =cut
 
 */
 
-PARROT_INLINE
-static void
-op_check_size(PARROT_INTERP, ARGIN(STRING *s), size_t len)
-{
-    ASSERT_ARGS(op_check_size)
-    const size_t used = s->bufused;
-    const int need_free = (int)PObj_buflen(s) - used - len;
-    /*
-     * grow by factor 1.5 or such
-     */
-    if (need_free <= 16) {
-        size_t new_size = (size_t) (PObj_buflen(s) * 1.5);
-        if (new_size < PObj_buflen(s) - need_free + 512)
-            new_size = PObj_buflen(s) - need_free + 512;
-        Parrot_gc_reallocate_string_storage(interp, s, new_size);
-        PARROT_ASSERT(PObj_buflen(s) - used - len >= 15);
-    }
-#ifndef DISABLE_GC_DEBUG
-    Parrot_gc_compact_memory_pool(interp);
-#endif
-}
-
-/*
-
-=item C<static void op_append(PARROT_INTERP, STRING *s, opcode_t b, size_t len)>
-
-Appends the opcode C<b> to the string C<*s>.
-
-=cut
-
-*/
-
-static void
-op_append(PARROT_INTERP, ARGIN(STRING *s), opcode_t b, size_t len)
-{
-    ASSERT_ARGS(op_append)
-    char *str_pos;
-
-    op_check_size(interp, s, len);
-    str_pos = s->strstart + s->bufused;
-    *((opcode_t *)(str_pos)) = b;
-    s->bufused += len;
-    s->strlen += len;
-}
-
-/*
-
-=item C<static void push_opcode_integer(PARROT_INTERP, IMAGE_IO *io, INTVAL v)>
-
-Pushes the integer C<v> onto the end of the C<*io> "stream".
-
-XXX assumes sizeof (opcode_t) == sizeof (INTVAL).
-
-=cut
-
-*/
-
-static void
-push_opcode_integer(PARROT_INTERP, ARGIN(IMAGE_IO *io), INTVAL v)
-{
-    ASSERT_ARGS(push_opcode_integer)
-    PARROT_ASSERT(sizeof (opcode_t) == sizeof (INTVAL));
-    op_append(interp, io->image, (opcode_t)v, sizeof (opcode_t));
-}
-
-/*
-
-=item C<static void push_opcode_number(PARROT_INTERP, IMAGE_IO *io, FLOATVAL v)>
-
-Pushes the number C<v> onto the end of the C<*io> "stream".
-
-=cut
-
-*/
-
-static void
-push_opcode_number(PARROT_INTERP, ARGIN(IMAGE_IO *io), FLOATVAL v)
-{
-    ASSERT_ARGS(push_opcode_number)
-    const size_t   len  = PF_size_number() * sizeof (opcode_t);
-    STRING * const s    = io->image;
-    const size_t   used = s->bufused;
-    opcode_t      *ignored;
-
-    op_check_size(interp, s, len);
-    ignored = PF_store_number((opcode_t *)((ptrcast_t)s->strstart + used), &v);
-    UNUSED(ignored);
-
-    s->bufused += len;
-    s->strlen  += len;
-}
-
-/*
-
-=item C<static void push_opcode_string(PARROT_INTERP, IMAGE_IO *io, STRING *v)>
-
-Pushes the string C<*v> onto the end of the C<*io> "stream".
-
-=cut
-
-*/
-
-static void
-push_opcode_string(PARROT_INTERP, ARGIN(IMAGE_IO *io), ARGIN(STRING *v))
-{
-    ASSERT_ARGS(push_opcode_string)
-    const size_t len = PF_size_string(v) * sizeof (opcode_t);
-    STRING * const s = io->image;
-    const size_t used = s->bufused;
-    opcode_t      *ignored;
-
-    op_check_size(interp, s, len);
-    ignored = PF_store_string((opcode_t *)((ptrcast_t)s->strstart + used), v);
-    UNUSED(ignored);
-
-    s->bufused += len;
-    s->strlen += len;
-}
-
-/*
-
-=item C<static void push_opcode_pmc(PARROT_INTERP, IMAGE_IO *io, PMC* v)>
-
-Pushes the PMC C<*v> onto the end of the C<*io> "stream".
-
-=cut
-
-*/
-
-static void
-push_opcode_pmc(PARROT_INTERP, ARGIN(IMAGE_IO *io), ARGIN(PMC* v))
-{
-    ASSERT_ARGS(push_opcode_pmc)
-    op_append(interp, io->image, (opcode_t)v, sizeof (opcode_t));
-}
-
-/*
-
-=item C<static INTVAL shift_opcode_integer(PARROT_INTERP, IMAGE_IO *io)>
-
-Removes and returns an integer from the start of the C<*io> "stream".
-
-=cut
-
-*/
-
-static INTVAL
-shift_opcode_integer(SHIM_INTERP, ARGIN(IMAGE_IO *io))
-{
-    ASSERT_ARGS(shift_opcode_integer)
-    const char * const   start  = (char *)io->image->strstart;
-    char               **opcode = &io->image->strstart;
-    const INTVAL i              = PF_fetch_integer(io->pf,
-                                    (const opcode_t **)opcode);
-
-    io->image->bufused -= ((char *)io->image->strstart - start);
-    PARROT_ASSERT((int)io->image->bufused >= 0);
-
-    return i;
-}
-
-/*
-
-=item C<static PMC* shift_opcode_pmc(PARROT_INTERP, IMAGE_IO *io)>
-
-Removes and returns an PMC from the start of the C<*io> "stream".
-
-Note that this actually reads a PMC id, not a PMC.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-static PMC*
-shift_opcode_pmc(PARROT_INTERP, ARGIN(IMAGE_IO *io))
-{
-    ASSERT_ARGS(shift_opcode_pmc)
-    INTVAL i = shift_opcode_integer(interp, io);
-    return (PMC *)i;
-}
-
-/*
-
-=item C<static FLOATVAL shift_opcode_number(PARROT_INTERP, IMAGE_IO *io)>
-
-Removes and returns an number from the start of the C<*io> "stream".
-
-=cut
-
-*/
-
-static FLOATVAL
-shift_opcode_number(SHIM_INTERP, ARGIN(IMAGE_IO *io))
-{
-    ASSERT_ARGS(shift_opcode_number)
-    const char * const   start  = (const char *)io->image->strstart;
-    char               **opcode = &io->image->strstart;
-    const FLOATVAL       f      = PF_fetch_number(io->pf,
-                                    (const opcode_t **)opcode);
-
-    io->image->bufused -= ((char *)io->image->strstart - start);
-    PARROT_ASSERT((int)io->image->bufused >= 0);
-
-    return f;
-}
-
-/*
-
-=item C<static STRING* shift_opcode_string(PARROT_INTERP, IMAGE_IO *io)>
-
-Removes and returns a string from the start of the C<*io> "stream".
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static STRING*
-shift_opcode_string(PARROT_INTERP, ARGIN(IMAGE_IO *io))
-{
-    ASSERT_ARGS(shift_opcode_string)
-    char * const   start  = (char*)io->image->strstart;
-    char         **opcode = &io->image->strstart;
-    STRING * const s      = PF_fetch_string(interp, io->pf,
-                                (const opcode_t **)opcode);
-
-    io->image->bufused -= ((char *)io->image->strstart - start);
-    PARROT_ASSERT((int)io->image->bufused >= 0);
-
-    return s;
-}
-
-/*
-
-=back
-
-=head2 Helper Functions
-
-=over 4
-
-=item C<static void pmc_add_ext(PARROT_INTERP, PMC *pmc)>
-
-Adds a C<PMC_EXT> to C<*pmc>.
-
-=cut
-
-*/
-
-static void
-pmc_add_ext(PARROT_INTERP, ARGIN(PMC *pmc))
-{
-    ASSERT_ARGS(pmc_add_ext)
-    if (pmc->vtable->flags & VTABLE_PMC_NEEDS_EXT)
-        Parrot_gc_add_pmc_ext(interp, pmc);
-}
-
-/*
- * this function setup stuff may be replaced by a real PMC
- * in the future
- * TODO add read/write header functions, e.g. vtable->init_pmc
- */
-
-#if FREEZE_ASCII
-static image_funcs ascii_funcs = {
-    push_ascii_integer,
-    push_ascii_pmc,
-    push_ascii_string,
-    push_ascii_number,
-    shift_ascii_integer,
-    shift_ascii_pmc,
-    shift_ascii_string,
-    shift_ascii_number
-};
-#else
-static image_funcs opcode_funcs = {
-    push_opcode_integer,
-    push_opcode_pmc,
-    push_opcode_string,
-    push_opcode_number,
-    shift_opcode_integer,
-    shift_opcode_pmc,
-    shift_opcode_string,
-    shift_opcode_number
-};
-#endif
-
-/*
-
-=item C<static void ft_init(PARROT_INTERP, visit_info *info)>
-
-Initializes the freeze/thaw subsystem.
-
-=cut
-
-*/
-
-static void
-ft_init(PARROT_INTERP, ARGIN(visit_info *info))
-{
-    ASSERT_ARGS(ft_init)
-    STRING *s = info->image;
-    PackFile *pf;
-
-    /* We want to store a 16-byte aligned header, but the actual
-     * header may be shorter. */
-    const unsigned int header_length = PACKFILE_HEADER_BYTES +
-        (PACKFILE_HEADER_BYTES % 16 ?
-         16 - PACKFILE_HEADER_BYTES % 16 : 0);
-
-    info->image_io = mem_allocate_typed(IMAGE_IO);
-    info->image_io->image = s = info->image;
-#if FREEZE_ASCII
-    info->image_io->vtable = &ascii_funcs;
-#else
-    info->image_io->vtable = &opcode_funcs;
-#endif
-    pf = info->image_io->pf = PackFile_new(interp, 0);
-    if (info->what == VISIT_FREEZE_NORMAL ||
-        info->what == VISIT_FREEZE_AT_DESTRUCT) {
-
-        op_check_size(interp, s, header_length);
-        mem_sys_memcopy(s->strstart, pf->header, PACKFILE_HEADER_BYTES);
-        s->bufused += header_length;
-        s->strlen += header_length;
-    }
-    else {
-        if (Parrot_str_byte_length(interp, s) < header_length) {
-            Parrot_ex_throw_from_c_args(interp, NULL,
-                EXCEPTION_INVALID_STRING_REPRESENTATION,
-                "bad string to thaw");
-        }
-
-        /* TT #749: use the validation logic from Packfile_unpack */
-        if (pf->header->bc_major != PARROT_PBC_MAJOR
-        ||  pf->header->bc_minor != PARROT_PBC_MINOR)
-            Parrot_ex_throw_from_c_args(interp, NULL,
-                    EXCEPTION_INVALID_STRING_REPRESENTATION,
-                    "can't thaw a PMC from Parrot %d.%d", pf->header->bc_major,
-                    pf->header->bc_minor);
-
-        mem_sys_memcopy(pf->header, s->strstart, PACKFILE_HEADER_BYTES);
-        PackFile_assign_transforms(pf);
-        s->bufused -= header_length;
-        LVALUE_CAST(char *, s->strstart) += header_length;
-    }
-
-    info->last_type = -1;
-    info->id_list = pmc_new(interp, enum_class_Array);
-    info->id = 0;
-    info->extra_flags = EXTRA_IS_NULL;
-    info->container = NULL;
-}
-
-/*
-
-=item C<static void todo_list_init(PARROT_INTERP, visit_info *info)>
-
-Initializes the C<*info> lists.
-
-=cut
-
-*/
-
-static void
-todo_list_init(PARROT_INTERP, ARGOUT(visit_info *info))
-{
-    ASSERT_ARGS(todo_list_init)
-    info->visit_pmc_now = visit_todo_list;
-    info->visit_pmc_later = add_pmc_todo_list;
-    /* we must use PMCs here, so that they get marked properly */
-    info->todo = pmc_new(interp, enum_class_Array);
-    info->seen = pmc_new(interp, enum_class_Hash);
-    VTABLE_set_pointer(interp, info->seen, parrot_new_intval_hash(interp));
-
-    ft_init(interp, info);
-}
-
-
-/*
-
-=item C<static void freeze_pmc(PARROT_INTERP, PMC *pmc, visit_info *info, int
-seen, UINTVAL id)>
-
-Freeze PMC, setting type, seen, and "same-as-last" indicators as
-appropriate.
-
-=cut
-
-*/
-
-PARROT_INLINE
-static void
-freeze_pmc(PARROT_INTERP, ARGIN_NULLOK(PMC *pmc), ARGIN(visit_info *info),
-        int seen, UINTVAL id)
-{
-    ASSERT_ARGS(freeze_pmc)
-    IMAGE_IO * const io = info->image_io;
-    INTVAL type;
-
-    if (PMC_IS_NULL(pmc)) {
-        /* NULL + seen bit */
-        VTABLE_push_pmc(interp, io, (PMC*) 1);
-        return;
-    }
-    type = pmc->vtable->base_type;
-
-    if (PObj_is_object_TEST(pmc))
-        type = enum_class_Object;
-    if (seen) {
-        if (info->extra_flags) {
-            id |= 3;
-            VTABLE_push_pmc(interp, io, (PMC*)id);
-            VTABLE_push_integer(interp, io, info->extra_flags);
-            return;
-        }
-        id |= 1;         /* mark bit 0 if this PMC is known */
-    }
-    else if (type == info->last_type) {
-        id |= 2;         /* mark bit 1 and don't write type */
-    }
-    VTABLE_push_pmc(interp, io, (PMC*)id);
-    if (! (id & 3)) {    /* else write type */
-        VTABLE_push_integer(interp, io, type);
-        info->last_type = type;
-    }
-}
-
-/*
-
-=item C<static int thaw_pmc(PARROT_INTERP, visit_info *info, UINTVAL *id, INTVAL
-*type)>
-
-Freeze and thaw a PMC (id).
-
-For example, the ASCII representation of the C<Array>
-
-    P0 = [P1=666, P2=777, P0]
-
-may look like this:
-
-    0xdf4 30 3 0xdf8 33 666 0xdf2 777 0xdf5
-
-where 30 is C<class_enum_Array>, 33 is C<class_enum_Integer>, the
-type of the second C<Integer> is suppressed, the repeated P0 has bit 0
-set.
-
-=cut
-
-*/
-
-PARROT_INLINE
-static int
-thaw_pmc(PARROT_INTERP, ARGMOD(visit_info *info),
-        ARGOUT(UINTVAL *id), ARGOUT(INTVAL *type))
-{
-    ASSERT_ARGS(thaw_pmc)
-    PMC *n;
-    IMAGE_IO * const io = info->image_io;
-    int seen = 0;
-
-    info->extra_flags = EXTRA_IS_NULL;
-    n = VTABLE_shift_pmc(interp, io);
-    if (((UINTVAL) n & 3) == 3) {
-        /* pmc has extra data */
-        info->extra_flags = VTABLE_shift_integer(interp, io);
-    }
-    else if ((UINTVAL) n & 1) {     /* seen PMCs have bit 0 set */
-        seen = 1;
-    }
-    else if ((UINTVAL) n & 2) {     /* prev PMC was same type */
-        *type = info->last_type;
-    }
-    else {                          /* type follows */
-        *type = VTABLE_shift_integer(interp, io);
-        info->last_type = *type;
-        if (*type <= 0)
-            Parrot_ex_throw_from_c_args(interp, NULL, 1,
-                "Unknown PMC type to thaw %d", (int) *type);
-
-        if (*type >= interp->n_vtable_max ||
-            !interp->vtables[*type]) {
-            /* that ought to be a class */
-            *type = enum_class_Class;
-        }
-    }
-    *id = (UINTVAL) n;
-    return seen;
+static INTVAL
+get_visit_integer(PARROT_INTERP, ARGIN(visit_info *io)) {
+    ASSERT_ARGS(get_visit_integer)
+    return io->what;
 }
 
 /*
 
-=item C<static void do_action(PARROT_INTERP, PMC *pmc, visit_info *info, int
-seen, UINTVAL id)>
+=item C<static void push_opcode_integer(PARROT_INTERP, visit_info *io, INTVAL
+v)>
 
-Called from C<visit_next_for_GC()> and C<visit_todo_list()> to perform
-the action specified in C<< info->what >>.
+Pushes the integer C<v> onto the end of the C<*io> "stream".
 
-Currently only C<VISIT_FREEZE_NORMAL> is implemented.
+XXX assumes sizeof (opcode_t) == sizeof (INTVAL).
 
 =cut
 
 */
 
-PARROT_INLINE
 static void
-do_action(PARROT_INTERP, ARGIN_NULLOK(PMC *pmc), ARGIN(visit_info *info),
-        int seen, UINTVAL id)
+push_opcode_integer(PARROT_INTERP, ARGIN(visit_info *io), INTVAL v)
 {
-    ASSERT_ARGS(do_action)
-    switch (info->what) {
-        case VISIT_FREEZE_AT_DESTRUCT:
-        case VISIT_FREEZE_NORMAL:
-            freeze_pmc(interp, pmc, info, seen, id);
-            if (pmc)
-                info->visit_action = pmc->vtable->freeze;
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, 1, "Illegal action %ld",
-                (long)info->what);
-    }
+    ASSERT_ARGS(push_opcode_integer)
+    size_t len = PF_size_integer() * sizeof (opcode_t);
+    ensure_buffer_size(interp, io, len);
+    SET_VISIT_CURSOR(io, PF_store_integer(GET_VISIT_CURSOR(io), v));
 }
 
+
 /*
 
-=item C<static PMC* thaw_create_pmc(PARROT_INTERP, const visit_info *info,
-INTVAL type)>
+=item C<static void push_opcode_number(PARROT_INTERP, visit_info *io, FLOATVAL
+v)>
 
-Called from C<do_thaw()> to attach the vtable etc. to C<*pmc>.
+Pushes the number C<v> onto the end of the C<*io> "stream".
 
 =cut
 
 */
 
-PARROT_INLINE
-PARROT_CANNOT_RETURN_NULL
-static PMC*
-thaw_create_pmc(PARROT_INTERP, ARGIN(const visit_info *info),
-        INTVAL type)
+static void
+push_opcode_number(PARROT_INTERP, ARGIN(visit_info *io), FLOATVAL v)
 {
-    ASSERT_ARGS(thaw_create_pmc)
-    PMC *pmc;
-    switch (info->what) {
-        case VISIT_THAW_NORMAL:
-            pmc = pmc_new_noinit(interp, type);
-            break;
-        case VISIT_THAW_CONSTANTS:
-            pmc = constant_pmc_new_noinit(interp, type);
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, 1, "Illegal visit_next type");
-    }
-    return pmc;
+    ASSERT_ARGS(push_opcode_number)
+    size_t len = PF_size_number() * sizeof (opcode_t);
+    ensure_buffer_size(interp, io, len);
+    SET_VISIT_CURSOR(io, PF_store_number(GET_VISIT_CURSOR(io), &v));
 }
 
-/*
 
-=item C<static void do_thaw(PARROT_INTERP, PMC* pmc, visit_info *info)>
+/*
 
-Called by C<visit_todo_list_thaw()> to thaw and return a PMC.
+=item C<static void push_opcode_string(PARROT_INTERP, visit_info *io, STRING
+*v)>
 
-C<seen> is false if this is the first time the PMC has been encountered.
+Pushes the string C<*v> onto the end of the C<*io> "stream".
 
 =cut
 
 */
 
-PARROT_INLINE
 static void
-do_thaw(PARROT_INTERP, ARGIN_NULLOK(PMC* pmc), ARGIN(visit_info *info))
+push_opcode_string(PARROT_INTERP, ARGIN(visit_info *io), ARGIN(STRING *v))
 {
-    ASSERT_ARGS(do_thaw)
-    UINTVAL id;
-    INTVAL type;
-    PMC ** pos;
-    int must_have_seen;
-    type = 0; /* it's set below, avoid compiler warning. */
-    must_have_seen = thaw_pmc(interp, info, &id, &type);
-
-    id >>= 2;
-
-    if (!id) {
-        /* got a NULL PMC */
-        pmc = PMCNULL;
-        if (!info->thaw_result)
-            info->thaw_result = pmc;
-        else
-            *info->thaw_ptr = pmc;
-        return;
-    }
-
-    pos = (PMC **)list_get(interp, (List *)PMC_data(info->id_list), id, enum_type_PMC);
-    if (pos == (void*)-1)
-        pos = NULL;
-    else if (pos) {
-        pmc = *(PMC**)pos;
-        if (!pmc)
-            pos = NULL;
-    }
-    if (pos) {
-        if (info->extra_flags == EXTRA_IS_PROP_HASH) {
-            interp->vtables[enum_class_default]->thaw(interp, pmc, info);
-            return;
-        }
-        /* else maybe VTABLE_thaw ... but there is no other extra stuff */
-
-#if FREEZE_USE_NEXT_FOR_GC
-        /*
-         * the next_for_GC method doesn't keep track of repeated scalars
-         * and such, as these are lacking the next_for_GC pointer, so
-         * these are just duplicated with their data.
-         * But we track these when thawing, so that we don't create dups
-         */
-        if (!must_have_seen) {
-            /* so we must consume the bytecode */
-            VTABLE_thaw(interp, pmc, info);
-        }
-#else
-        PARROT_ASSERT(must_have_seen);
-#endif
-        /*
-         * that's a duplicate
-         if (info->container)
-         GC_WRITE_BARRIER(interp, info->container, NULL, pmc);
-         */
-        *info->thaw_ptr = pmc;
-        return;
-    }
-
-    PARROT_ASSERT(!must_have_seen);
-    pmc = thaw_create_pmc(interp, info, type);
-
-    VTABLE_thaw(interp, pmc, info);
-    if (info->extra_flags == EXTRA_CLASS_EXISTS) {
-        pmc = (PMC *)info->extra;
-        info->extra = NULL;
-        info->extra_flags = 0;
-    }
-    if (!info->thaw_result)
-        info->thaw_result = pmc;
-    else {
-        if (info->container) {
-            GC_WRITE_BARRIER(interp, info->container, NULL, pmc);
-        }
-        *info->thaw_ptr = pmc;
-    }
-    list_assign(interp, (List *)PMC_data(info->id_list), id, pmc, enum_type_PMC);
-    /* remember nested aggregates depth first */
-    if (pmc->pmc_ext)
-        list_unshift(interp, (List *)PMC_data(info->todo), pmc, enum_type_PMC);
+    ASSERT_ARGS(push_opcode_string)
+    size_t len = PF_size_string(v) * sizeof (opcode_t);
+    ensure_buffer_size(interp, io, len);
+    SET_VISIT_CURSOR(io, PF_store_string(GET_VISIT_CURSOR(io), v));
 }
 
-
 /*
 
-=item C<static UINTVAL id_from_pmc(PARROT_INTERP, PMC* pmc)>
-
-Find a PMC in an arena, and return an id (left-shifted 2 bits),
-based on its position.
+=item C<static void push_opcode_pmc(PARROT_INTERP, visit_info *io, PMC *v)>
 
-If not found, throw an exception.
+Pushes a reference to pmc C<*v> onto the end of the C<*io> "stream". If C<*v>
+hasn't been seen yet, it is also pushed onto the todo list.
 
 =cut
 
 */
 
-static UINTVAL
-id_from_pmc(PARROT_INTERP, ARGIN(PMC* pmc))
-{
-    ASSERT_ARGS(id_from_pmc)
-    return Parrot_gc_get_pmc_index(interp, pmc) << 2;
+static void
+push_opcode_pmc(PARROT_INTERP, ARGIN(visit_info *io), ARGIN(PMC *v)) {
+    io->thaw_ptr = &v;
+    (io->visit_pmc_now)(interp, v, io);
 }
 
 /*
 
-=item C<static void add_pmc_next_for_GC(PARROT_INTERP, PMC *pmc, visit_info
-*info)>
+=item C<static INTVAL shift_opcode_integer(PARROT_INTERP, visit_info *io)>
 
-Remembers the PMC for later processing.
+Removes and returns an integer from the start of the C<*io> "stream".
 
 =cut
 
 */
 
-static void
-add_pmc_next_for_GC(SHIM_INTERP, ARGIN(PMC *pmc), ARGOUT(visit_info *info))
+static INTVAL
+shift_opcode_integer(SHIM_INTERP, ARGIN(visit_info *io))
 {
-    ASSERT_ARGS(add_pmc_next_for_GC)
-    if (pmc->pmc_ext) {
-        PMC_next_for_GC(info->mark_ptr) = pmc;
-        info->mark_ptr = PMC_next_for_GC(pmc) = pmc;
-    }
+    ASSERT_ARGS(shift_opcode_integer)
+    opcode_t *pos  = GET_VISIT_CURSOR(io);
+    const INTVAL i = PF_fetch_integer(io->pf, (const opcode_t **)&pos);
+    SET_VISIT_CURSOR(io, pos);
+    BYTECODE_SHIFT_OK(io);
+    return i;
 }
 
+
 /*
 
-=item C<static int next_for_GC_seen(PARROT_INTERP, PMC *pmc, visit_info *info,
-UINTVAL *id)>
+=item C<static FLOATVAL shift_opcode_number(PARROT_INTERP, visit_info *io)>
 
-Remembers next child to visit via the C<next_for_GC pointer> generate a
-unique ID per PMC and freeze the ID (not the PMC address) so thaw the
-hash-lookup can be replaced by an array lookup then which is a lot
-faster.
+Removes and returns an number from the start of the C<*io> "stream".
 
 =cut
 
 */
 
-PARROT_INLINE
-static int
-next_for_GC_seen(PARROT_INTERP, ARGIN_NULLOK(PMC *pmc),
-        ARGIN(visit_info *info), ARGOUT(UINTVAL *id))
+static FLOATVAL
+shift_opcode_number(SHIM_INTERP, ARGIN(visit_info *io))
 {
-    ASSERT_ARGS(next_for_GC_seen)
-    int seen = 0;
-
-    if (PMC_IS_NULL(pmc)) {
-        *id = 0;
-        return 1;
-    }
-
-    /*
-     * we can only remember PMCs with a next_for_GC pointer
-     * which is located in pmc_ext
-     */
-    if (pmc->pmc_ext) {
-        /* already seen? */
-        if (!PMC_IS_NULL(PMC_next_for_GC(pmc))) {
-            seen = 1;
-            goto skip;
-        }
-        /* put pmc at the end of the list */
-        PMC_next_for_GC(info->mark_ptr) = pmc;
-        /* make end self-referential */
-        info->mark_ptr = PMC_next_for_GC(pmc) = pmc;
-    }
-skip:
-    *id = id_from_pmc(interp, pmc);
-    return seen;
+    ASSERT_ARGS(shift_opcode_number)
+    opcode_t *pos     = GET_VISIT_CURSOR(io);
+    const FLOATVAL f  = PF_fetch_number(io->pf, (const opcode_t **)&pos);
+    SET_VISIT_CURSOR(io, pos);
+    BYTECODE_SHIFT_OK(io);
+    return f;
 }
 
+
 /*
 
-=item C<static void add_pmc_todo_list(PARROT_INTERP, PMC *pmc, visit_info
-*info)>
+=item C<static STRING* shift_opcode_string(PARROT_INTERP, visit_info *io)>
 
-Remembers the PMC to be processed later.
+Removes and returns a string from the start of the C<*io> "stream".
 
 =cut
 
 */
 
-static void
-add_pmc_todo_list(PARROT_INTERP, ARGIN_NULLOK(PMC *pmc), ARGIN(visit_info *info))
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+static STRING*
+shift_opcode_string(PARROT_INTERP, ARGIN(visit_info *io))
 {
-    ASSERT_ARGS(add_pmc_todo_list)
-    list_push(interp, (List *)PMC_data(info->todo), pmc, enum_type_PMC);
+    ASSERT_ARGS(shift_opcode_string)
+    opcode_t *pos    = GET_VISIT_CURSOR(io);
+    STRING * const s = PF_fetch_string(interp, io->pf, (const opcode_t **)&pos);
+    SET_VISIT_CURSOR(io, pos);
+    BYTECODE_SHIFT_OK(io);
+    return s;
 }
 
 /*
 
-=item C<static int todo_list_seen(PARROT_INTERP, PMC *pmc, visit_info *info,
-UINTVAL *id)>
+=item C<static PMC *shift_opcode_pmc(PARROT_INTERP, visit_info *io)>
 
-Returns true if the PMC was seen, otherwise it put it on the todo list,
-generates an ID (tag) for PMC, offset by 4 as are addresses, low bits
-are flags.
+Removes and returns a reference to a pmc from the start of the C<*io> "stream".
 
 =cut
 
 */
 
-PARROT_INLINE
-static int
-todo_list_seen(PARROT_INTERP, ARGIN(PMC *pmc), ARGMOD(visit_info *info),
-        ARGOUT(UINTVAL *id))
-{
-    ASSERT_ARGS(todo_list_seen)
-    HashBucket * const b =
-        parrot_hash_get_bucket(interp,
-                (Hash *)VTABLE_get_pointer(interp, info->seen), pmc);
-
-    if (b) {
-        *id = (UINTVAL) b->value;
-        return 1;
-    }
-
-    info->id += 4;      /* next id to freeze */
-    *id = info->id;
-    parrot_hash_put(interp,
-            (Hash *)VTABLE_get_pointer(interp, info->seen), pmc, (void*)*id);
-    /* remember containers */
-    if (pmc->pmc_ext)
-        list_unshift(interp, (List *)PMC_data(info->todo), pmc, enum_type_PMC);
-    return 0;
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+static PMC *
+shift_opcode_pmc(PARROT_INTERP, ARGIN(visit_info *io)) {
+    PMC *result;
+    io->thaw_ptr = &result;
+    (io->visit_pmc_now)(interp, NULL, io);
+    return result;
 }
 
 /*
 
-=item C<static void visit_next_for_GC(PARROT_INTERP, PMC* pmc, visit_info*
-info)>
+=back
 
-C<visit_child> callbacks:
+=head2 Helper Functions
 
-Checks if the PMC was seen, generate an ID for it if not, then do the
-appropriate action.
+=over 4
 
 =cut
 
 */
 
-static void
-visit_next_for_GC(PARROT_INTERP, ARGIN(PMC* pmc), ARGIN(visit_info* info))
-{
-    ASSERT_ARGS(visit_next_for_GC)
-    UINTVAL id;
-    const int seen = next_for_GC_seen(interp, pmc, info, &id);
-    UNUSED(seen);
+/*
+ * this function setup stuff may be replaced by a real PMC
+ * in the future
+ * TODO add read/write header functions, e.g. vtable->init_pmc
+ */
 
-    Parrot_ex_throw_from_c_args(interp, NULL, 1, "todo convert to depth first");
-    /* do_action(interp, pmc, info, seen, id); UNCOMMENT WHEN TODO IS DONE*/
-    /*
-     * TODO probe for class methods that override the default.
-     * To avoid overhead, we could have an array[class_enums]
-     * which (after first find_method) has a bit, if a user
-     * callback is there.
-     */
-    /* UNCOMMENT WHEN TODO IS DONE
-    if (!seen)
-        (info->visit_action)(interp, pmc, info);
-    */
-}
+static image_funcs opcode_funcs = {
+    get_visit_integer,
+    push_opcode_integer,
+    push_opcode_string,
+    push_opcode_number,
+    push_opcode_pmc,
+    shift_opcode_integer,
+    shift_opcode_string,
+    shift_opcode_number,
+    shift_opcode_pmc
+};
 
 /*
 
-=item C<static void visit_todo_list(PARROT_INTERP, PMC* pmc, visit_info* info)>
+=item C<static void visit_info_init(PARROT_INTERP, visit_info *info,
+visit_enum_type what, STRING *input, PMC *pmc)>
 
-Checks the seen PMC via the todo list.
+Initializes the C<*info> lists.
 
 =cut
 
 */
+#define GROW_TO_16_BYTE_BOUNDARY(size) ((size) + ((size) % 16 ? 16 - (size) % 16 : 0))
 
 static void
-visit_todo_list(PARROT_INTERP, ARGIN_NULLOK(PMC* pmc), ARGIN(visit_info* info))
+visit_info_init(PARROT_INTERP, ARGOUT(visit_info *info),
+  visit_enum_type what, ARGIN(STRING *input), ARGIN(PMC *pmc))
 {
-    ASSERT_ARGS(visit_todo_list)
-    UINTVAL id;
-    int seen;
-
-    if (PMC_IS_NULL(pmc)) {
-        seen = 1;
-        id = 0;
+    ASSERT_ARGS(visit_info_init)
+    /* We want to store a 16-byte aligned header, but the actual * header may be shorter. */
+    const unsigned int header_length = GROW_TO_16_BYTE_BOUNDARY(PACKFILE_HEADER_BYTES);
+
+    PackFile *pf = info->pf = PackFile_new(interp, 0);
+    info->what = what;
+    info->vtable = &opcode_funcs;
+    info->image_io = info; /* backwards-compat hack */
+
+    if (info->what == VISIT_FREEZE_NORMAL) {
+        info->visit_pmc_now  = visit_todo_list_freeze;
+        create_buffer(interp, pmc, info);
+        ensure_buffer_size(interp, info, header_length);
+        mem_sys_memcopy(GET_VISIT_CURSOR(info), pf->header, PACKFILE_HEADER_BYTES);
+        INC_VISIT_CURSOR(info, header_length);
+    }
+    else { /* VISIT_THAW_ */
+        int unpacked_length;
+        info->visit_pmc_now    = visit_todo_list_thaw;
+        info->buffer = (Buffer *)input;
+        PARROT_ASSERT(input->_bufstart == input->strstart);
+        SET_VISIT_CURSOR(info, Buffer_bufstart(info->buffer));
+        info->input_length = input->strlen;
+
+        pf->options |= PFOPT_PMC_FREEZE_ONLY;
+        unpacked_length = PackFile_unpack(interp, pf, GET_VISIT_CURSOR(info), info->input_length);
+        if (!unpacked_length) {
+            PackFile_destroy(interp, info->pf);
+            Parrot_ex_throw_from_c_args(interp, NULL,
+                    EXCEPTION_INVALID_STRING_REPRESENTATION,
+                    "PackFile header failed during unpack");
+        }
+        else {
+            INC_VISIT_CURSOR(info, header_length);
+        }
     }
-    else
-        seen = todo_list_seen(interp, pmc, info, &id);
-    do_action(interp, pmc, info, seen, id);
-    if (!seen)
-        (info->visit_action)(interp, pmc, info);
+
+    /* we must use PMCs here so that they get marked properly */
+    info->todo        = pmc_new(interp, enum_class_Array);
+    info->seen        = pmc_new(interp, enum_class_Hash);
+    VTABLE_set_pointer(interp, info->seen, parrot_new_intval_hash(interp));
+    info->id_list     = pmc_new(interp, enum_class_Array);
+    info->id          = 0;
+    info->extra_flags = EXTRA_IS_NULL;
+
+    visit_loop_todo_list(interp, pmc, info);
+    PackFile_destroy(interp, info->pf);
+}
+
+
+PARROT_INLINE
+static PMC*
+id_list_get(PARROT_INTERP, ARGIN(visit_info *info), UINTVAL id) {
+    List * const id_list = (List *)PMC_data(info->id_list);
+    PMC **pos = (PMC **)Parrot_pmc_array_get(interp, id_list, id, enum_type_PMC);
+
+    if (pos && pos != ((void *)-1))
+        return *pos;
+    return NULL;
 }
 
 /*
 
-=item C<static void visit_todo_list_thaw(PARROT_INTERP, PMC* old, visit_info*
-info)>
+=item C<static void visit_todo_list_thaw(PARROT_INTERP, PMC* pmc_not_used,
+visit_info* info)>
 
 Callback for thaw - action first.
-
-Todo-list and seen handling is all in C<do_thaw()>.
+thaws and return a PMC.
 
 =cut
 
 */
 
+PARROT_INLINE
 static void
-visit_todo_list_thaw(PARROT_INTERP, ARGIN_NULLOK(PMC* old), ARGIN(visit_info* info))
+visit_todo_list_thaw(PARROT_INTERP, SHIM(PMC* pmc_not_used), ARGIN(visit_info* info))
 {
     ASSERT_ARGS(visit_todo_list_thaw)
-    do_thaw(interp, old, info);
+
+    UINTVAL  n            = VTABLE_shift_integer(interp, info);
+    UINTVAL  id           = PackID_get_PMCID(n);
+    int      packid_flags = PackID_get_FLAGS(n);
+    PMC     *pmc          = PMCNULL;
+
+    PARROT_ASSERT(info->what == VISIT_THAW_NORMAL);
+
+    switch (packid_flags) {
+      case enum_PackID_seen:
+        if (id) /* got a non-NULL PMC */
+            pmc = id_list_get(interp, info, id);
+        break;
+      case enum_PackID_normal:
+        {
+            INTVAL type = VTABLE_shift_integer(interp, info);
+            if (type <= 0 || type > interp->n_vtable_max)
+                Parrot_ex_throw_from_c_args(interp, NULL, 1, "Unknown PMC type to thaw %d", type);
+
+            pmc = pmc_new_noinit(interp, type);
+            VTABLE_thaw(interp, pmc, info);
+
+            {
+                List * const todo    = (List *)PMC_data(info->todo);
+                List * const id_list = (List *)PMC_data(info->id_list);
+                Parrot_pmc_array_assign(interp, id_list, id, pmc, enum_type_PMC);
+                /* remember nested aggregates depth first */
+                Parrot_pmc_array_unshift(interp, todo, pmc, enum_type_PMC);
+            }
+        }
+        break;
+      default:
+        Parrot_ex_throw_from_c_args(interp, NULL, 1, "Unknown PMC id args thaw %d", packid_flags);
+        break;
+    }
+
+    *info->thaw_ptr = pmc;
 }
 
+
 /*
 
-=item C<static void visit_loop_next_for_GC(PARROT_INTERP, PMC *current,
-visit_info *info)>
+=item C<static void visit_todo_list_freeze(PARROT_INTERP, PMC* pmc, visit_info*
+info)>
 
-Put first item on todo list, then run as long as there are items to be
-done.
+Checks the seen PMC via the todo list.
 
 =cut
 
 */
 
 static void
-visit_loop_next_for_GC(PARROT_INTERP, ARGIN(PMC *current),
-        ARGIN(visit_info *info))
+visit_todo_list_freeze(PARROT_INTERP, ARGIN_NULLOK(PMC* pmc), ARGIN(visit_info* info))
 {
-    ASSERT_ARGS(visit_loop_next_for_GC)
-    visit_next_for_GC(interp, current, info);
-    if (current->pmc_ext) {
-        PMC *prev = NULL;
-
-        while (current != prev) {
-            VTABLE_visit(interp, current, info);
-            prev = current;
-            current = PMC_next_for_GC(current);
+    ASSERT_ARGS(visit_todo_list_freeze)
+    UINTVAL id;
+    int packid_type;
+
+    PARROT_ASSERT(info->what == VISIT_FREEZE_NORMAL);
+
+    if (PMC_IS_NULL(pmc)) {
+        id   = 0;
+        packid_type = enum_PackID_seen;
+    }
+    else {
+        Hash *hash = (Hash *)VTABLE_get_pointer(interp, info->seen);
+        HashBucket * const b = parrot_hash_get_bucket(interp, hash, pmc);
+        if (b) {
+            id = (UINTVAL) b->value;
+            packid_type = enum_PackID_seen;
+        }
+        else {
+            info->id++; /* next id to freeze */
+            id = info->id;
+            packid_type = enum_PackID_normal;
         }
     }
+
+    VTABLE_push_integer(interp, info, PackID_new(id, packid_type));
+
+    if (packid_type == enum_PackID_normal) {
+        Hash *hash = (Hash *)VTABLE_get_pointer(interp, info->seen);
+        PARROT_ASSERT(pmc);
+        VTABLE_push_integer(interp, info,
+                PObj_is_object_TEST(pmc) ? enum_class_Object : pmc->vtable->base_type);
+        parrot_hash_put(interp, hash, pmc, (void *)id);
+        Parrot_pmc_array_unshift(interp, (List *)PMC_data(info->todo), pmc, enum_type_PMC);
+        VTABLE_freeze(interp, pmc, info);
+    }
 }
 
 
@@ -1636,65 +696,37 @@
 {
     ASSERT_ARGS(visit_loop_todo_list)
     PMC        **list_item;
-    List        *finish_list    = NULL;
     List * const todo           = (List *)PMC_data(info->todo);
-    int          finished_first = 0;
-    const int    thawing        = info->what == VISIT_THAW_CONSTANTS
-                               || info->what == VISIT_THAW_NORMAL;
-    int          i;
-
-    /* create a list that contains PMCs that need thawfinish */
-    if (thawing) {
-        PMC * const finish_list_pmc = pmc_new(interp, enum_class_Array);
-        finish_list                 = (List *)PMC_data(finish_list_pmc);
-    }
+    const int    thawing        = info->what == VISIT_THAW_NORMAL;
 
     (info->visit_pmc_now)(interp, current, info);
 
     /* can't cache upper limit, visit may append items */
-again:
-    while ((list_item = (PMC**)list_shift(interp, todo, enum_type_PMC))) {
+    while ((list_item = (PMC **)Parrot_pmc_array_shift(interp, todo, enum_type_PMC))) {
         current = *list_item;
         if (!current)
             Parrot_ex_throw_from_c_args(interp, NULL, 1,
-                "NULL current PMC in visit_loop_todo_list");
+                    "NULL current PMC in visit_loop_todo_list");
 
         PARROT_ASSERT(current->vtable);
 
-        /* Workaround for thawing constants. Clear constant flag */
-        /* See src/packfile.c:3999 */
-        if (thawing)
-            PObj_constant_CLEAR(current);
-
         VTABLE_visit(interp, current, info);
 
-        if (thawing) {
-            if (current == info->thaw_result)
-                finished_first = 1;
-            if (current->vtable->thawfinish != interp->vtables[enum_class_default]->thawfinish)
-                list_unshift(interp, finish_list, current, enum_type_PMC);
-        }
+        VISIT_PMC(interp, info, PMC_metadata(current));
     }
 
-    if (thawing) {
-        INTVAL n;
-        /* if image isn't consumed, there are some extra data to thaw */
-        if (info->image->bufused > 0) {
-            (info->visit_pmc_now)(interp, NULL, info);
-            goto again;
-        }
+    if (thawing)
+        /* we're done reading the image */
+        PARROT_ASSERT(!INFO_HAS_DATA(info));
 
+    if (thawing) {
         /* on thawing call thawfinish for each processed PMC */
-        if (!finished_first) {
-            /* the first create PMC might not be in the list,
-             * if it has no pmc_ext */
-            list_unshift(interp, finish_list, info->thaw_result, enum_type_PMC);
-        }
-
-        n = list_length(interp, finish_list);
+        List        *finish_list = (List *)PMC_data(info->id_list);
+        const INTVAL n           = Parrot_pmc_array_length(interp, finish_list);
+        int          i;
 
         for (i = 0; i < n ; ++i) {
-            current = *(PMC**)list_get(interp, finish_list, i, enum_type_PMC);
+            current = *(PMC**)Parrot_pmc_array_get(interp, finish_list, i, enum_type_PMC);
             if (!PMC_IS_NULL(current))
                 VTABLE_thawfinish(interp, current, info);
         }
@@ -1704,110 +736,36 @@
 
 /*
 
-=item C<static void create_image(PARROT_INTERP, PMC *pmc, visit_info *info)>
+=item C<static void create_buffer(PARROT_INTERP, PMC *pmc, visit_info *info)>
 
-Allocate image to some estimated size.
+Allocate buffer to some estimated size.
 
 =cut
 
 */
 
 static void
-create_image(PARROT_INTERP, ARGIN_NULLOK(PMC *pmc), ARGMOD(visit_info *info))
+create_buffer(PARROT_INTERP, ARGIN_NULLOK(PMC *pmc), ARGMOD(visit_info *info))
 {
-    ASSERT_ARGS(create_image)
+    ASSERT_ARGS(create_buffer)
     STRING *array = CONST_STRING(interp, "array");
     STRING *hash  = CONST_STRING(interp, "hash");
     INTVAL  len;
 
-    if (!PMC_IS_NULL(pmc) && (VTABLE_does(interp, pmc, array) ||
-        VTABLE_does(interp, pmc, hash))) {
+    if (!PMC_IS_NULL(pmc)
+    && (VTABLE_does(interp, pmc, array) || VTABLE_does(interp, pmc, hash))) {
         const INTVAL items = VTABLE_elements(interp, pmc);
         /* TODO check e.g. first item of aggregate and estimate size */
-        len = items * FREEZE_BYTES_PER_ITEM;
+        len = (items ? items : 1) * FREEZE_BYTES_PER_ITEM;
     }
     else
         len = FREEZE_BYTES_PER_ITEM;
 
-    info->image = Parrot_str_new_noinit(interp, enum_stringrep_one, len);
+    info->buffer = (Buffer *)Parrot_gc_new_bufferlike_header(interp, sizeof (Buffer));
+    Parrot_gc_allocate_buffer_storage_aligned(interp, info->buffer, len);
+    SET_VISIT_CURSOR(info, Buffer_bufstart(info->buffer));
 }
 
-/*
-
-=item C<static PMC* run_thaw(PARROT_INTERP, STRING* image, visit_enum_type
-what)>
-
-Performs thawing. C<what> indicates what to be thawed.
-
-Thaw could use the C<next_for_GC> pointers as todo-list too, but this
-would need 2 runs through the arenas to clean the C<next_for_GC>
-pointers.
-
-For now it seems cheaper to use a list for remembering contained
-aggregates. We could of course decide dynamically, which strategy to
-use, e.g.: given a big image, the first thawed item is a small
-aggregate. This implies, it probably contains (or some big strings) more
-nested containers, for which the C<next_for_GC> approach could be a win.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-static PMC*
-run_thaw(PARROT_INTERP, ARGIN(STRING* image), visit_enum_type what)
-{
-    ASSERT_ARGS(run_thaw)
-    visit_info info;
-    int gc_block = 0;
-    const UINTVAL bufused = image->bufused;
-
-    info.image = image;
-    /*
-     * if we are thawing a lot of PMCs, its cheaper to do
-     * a GC run first and then block GC - the limit should be
-     * chosen so that no more then one GC run would be triggered
-     *
-     * XXX
-     *
-     * md5_3.pir shows a segfault during thawing the config hash
-     * info->thaw_ptr becomes invalid - seems that the hash got
-     * collected under us.
-     */
-    if (1 || (Parrot_str_byte_length(interp, image) > THAW_BLOCK_GC_SIZE)) {
-        Parrot_block_GC_mark(interp);
-        Parrot_block_GC_sweep(interp);
-        gc_block = 1;
-    }
-
-    info.what = what;   /* _NORMAL or _CONSTANTS */
-    todo_list_init(interp, &info);
-    info.visit_pmc_now = visit_todo_list_thaw;
-    info.visit_pmc_later = add_pmc_todo_list;
-
-    info.thaw_result = NULL;
-    /*
-     * run thaw loop
-     */
-    visit_loop_todo_list(interp, NULL, &info);
-    /*
-     * thaw does "consume" the image string by incrementing strstart
-     * and decrementing bufused - restore that
-     */
-    LVALUE_CAST(char *, image->strstart) -= bufused;
-    image->bufused = bufused;
-    PARROT_ASSERT(image->strstart >= (char *)PObj_bufstart(image));
-
-    if (gc_block) {
-        Parrot_unblock_GC_mark(interp);
-        Parrot_unblock_GC_sweep(interp);
-    }
-    PackFile_destroy(interp, info.image_io->pf);
-    mem_sys_free(info.image_io);
-    info.image_io = NULL;
-    return info.thaw_result;
-}
 
 /*
 
@@ -1817,11 +775,9 @@
 
 =over 4
 
-=item C<STRING* Parrot_freeze_at_destruct(PARROT_INTERP, PMC* pmc)>
+=item C<STRING* Parrot_freeze(PARROT_INTERP, PMC *pmc)>
 
-This function must not consume any resources (except the image itself).
-It uses the C<next_for_GC> pointer, so its not reentrant and must not be
-interrupted by a GC run.
+Freeze using either method.
 
 =cut
 
@@ -1831,34 +787,27 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
 STRING*
-Parrot_freeze_at_destruct(PARROT_INTERP, ARGIN(PMC* pmc))
+Parrot_freeze(PARROT_INTERP, ARGIN(PMC *pmc))
 {
-    ASSERT_ARGS(Parrot_freeze_at_destruct)
+    ASSERT_ARGS(Parrot_freeze)
     visit_info info;
 
-    Parrot_block_GC_mark(interp);
-    Parrot_gc_cleanup_next_for_GC(interp);
-    info.what = VISIT_FREEZE_AT_DESTRUCT;
-    info.mark_ptr = pmc;
-    info.thaw_ptr = NULL;
-    info.visit_pmc_now = visit_next_for_GC;
-    info.visit_pmc_later = add_pmc_next_for_GC;
-    create_image(interp, pmc, &info);
-    ft_init(interp, &info);
-
-    visit_loop_next_for_GC(interp, pmc, &info);
-
-    Parrot_unblock_GC_mark(interp);
-    PackFile_destroy(interp, info.image_io->pf);
-    mem_sys_free(info.image_io);
-    return info.image;
+    visit_info_init(interp, &info, VISIT_FREEZE_NORMAL, STRINGNULL, pmc);
+    return Parrot_str_new_from_buffer(interp, info.buffer, OUTPUT_LENGTH(&info));
 }
 
+
 /*
 
-=item C<STRING* Parrot_freeze(PARROT_INTERP, PMC* pmc)>
+=item C<PMC* Parrot_thaw(PARROT_INTERP, STRING *image)>
 
-Freeze using either method.
+Thaws a PMC.  Called from the C<thaw> opcode.
+
+For now it seems cheaper to use a list for remembering contained
+aggregates. We could of course decide dynamically, which strategy to
+use, e.g.: given a big image, the first thawed item is a small
+aggregate. This implies, it probably contains (or some big strings) more
+nested containers, for which another approach could be a win.
 
 =cut
 
@@ -1867,62 +816,51 @@
 PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
-STRING*
-Parrot_freeze(PARROT_INTERP, ARGIN(PMC* pmc))
+PMC*
+Parrot_thaw(PARROT_INTERP, ARGIN(STRING *image))
 {
-    ASSERT_ARGS(Parrot_freeze)
-#if FREEZE_USE_NEXT_FOR_GC
-    ASSERT_ARGS(Parrot_freeze)
-    /*
-     * we could do a GC run here before, to free resources
-     */
-    return Parrot_freeze_at_destruct(interp, pmc);
-#else
-    /*
-     * freeze using a todo list and seen hash
-     * Please note that both have to be PMCs, so that trace_system_stack
-     * can call mark on the PMCs
-     */
-    visit_info info;
-
-    info.what = VISIT_FREEZE_NORMAL;
-    create_image(interp, pmc, &info);
-    todo_list_init(interp, &info);
-
-    visit_loop_todo_list(interp, pmc, &info);
-
-    PackFile_destroy(interp, info.image_io->pf);
-    mem_sys_free(info.image_io);
-    return info.image;
-#endif
-}
-
-/*
+    ASSERT_ARGS(Parrot_thaw)
 
-=item C<PMC* Parrot_thaw(PARROT_INTERP, STRING* image)>
+    visit_info  info;
+    int         gc_block = 0;
+    PMC        *result;
 
-Thaw a PMC, called from the C<thaw> opcode.
+    /*
+     * if we are thawing a lot of PMCs, it's cheaper to do
+     * a GC run first and then block GC - the limit should be
+     * chosen so that no more then one GC run would be triggered
+     *
+     * XXX
+     *
+     * md5_3.pir shows a segfault during thawing the config hash
+     * info->thaw_ptr becomes invalid - seems that the hash got
+     * collected under us.
+     */
+    if (1 || (Parrot_str_byte_length(interp, image) > THAW_BLOCK_GC_SIZE)) {
+        Parrot_block_GC_mark(interp);
+        Parrot_block_GC_sweep(interp);
+        gc_block = 1;
+    }
 
-=cut
+    info.thaw_ptr = &result;
+    visit_info_init(interp, &info, VISIT_THAW_NORMAL, image, PMCNULL);
+    BYTECODE_SHIFT_OK(&info);
 
-*/
+    if (gc_block) {
+        Parrot_unblock_GC_mark(interp);
+        Parrot_unblock_GC_sweep(interp);
+    }
 
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-PMC*
-Parrot_thaw(PARROT_INTERP, ARGIN(STRING* image))
-{
-    ASSERT_ARGS(Parrot_thaw)
-    return run_thaw(interp, image, VISIT_THAW_NORMAL);
+    return result;
 }
 
+
 /*
 
-=item C<PMC* Parrot_thaw_constants(PARROT_INTERP, STRING* image)>
+=item C<PMC* Parrot_thaw_constants(PARROT_INTERP, STRING *image)>
 
-Thaw the constants. This is used by PackFile for unpacking PMC
-constants.
+Thaws constants, used by PackFile for unpacking PMC constants.
+This is a lie. It does nothing different from Parrot_thaw at the moment.
 
 =cut
 
@@ -1932,19 +870,19 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
 PMC*
-Parrot_thaw_constants(PARROT_INTERP, ARGIN(STRING* image))
+Parrot_thaw_constants(PARROT_INTERP, ARGIN(STRING *image))
 {
     ASSERT_ARGS(Parrot_thaw_constants)
-    return run_thaw(interp, image, VISIT_THAW_CONSTANTS);
+    return Parrot_thaw(interp, image);
 }
 
+
 /*
 
-=item C<PMC* Parrot_clone(PARROT_INTERP, PMC* pmc)>
+=item C<PMC* Parrot_clone(PARROT_INTERP, PMC *pmc)>
 
 There are for sure shortcuts to clone faster, e.g. always thaw the image
-immediately or use a special callback. But for now we just thaw a frozen
-PMC.
+immediately or use a special callback.  For now we just thaw a frozen PMC.
 
 =cut
 
@@ -1954,19 +892,20 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
 PMC*
-Parrot_clone(PARROT_INTERP, ARGIN(PMC* pmc))
+Parrot_clone(PARROT_INTERP, ARGIN(PMC *pmc))
 {
     ASSERT_ARGS(Parrot_clone)
     return VTABLE_clone(interp, pmc);
 }
 
+
 /*
 
 =back
 
 =head1 TODO
 
-The seen-hash version for freezing might go away sometimes.
+The seen-hash version for freezing might go away sometime.
 
 =head1 SEE ALSO
 

Modified: branches/orderedhash_revamp/src/runcore/cores.c
==============================================================================
--- branches/orderedhash_revamp/src/runcore/cores.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/runcore/cores.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -2,7 +2,11 @@
 Copyright (C) 2001-2009, Parrot Foundation.
 $Id$
 
-=head1 Run Cores
+=head1 NAME
+
+src/runcore/cores.c - Parrot's execution runcores
+
+=head1 DESCRIPTION
 
 During execution, the runcore is like the heart of Parrot. The runcore
 controls calling the various opcodes with the correct data, and making
@@ -241,9 +245,23 @@
 #include "parrot/runcore_api.h"
 #include "parrot/embed.h"
 #include "parrot/runcore_trace.h"
+#include "cores.str"
+
+#include "parrot/oplib/ops.h"
+#include "parrot/oplib/core_ops.h"
+#include "parrot/oplib/core_ops_switch.h"
+#include "parrot/dynext.h"
+
+#include "pmc/pmc_sub.h"
+#include "pmc/pmc_callcontext.h"
 
 #ifdef HAVE_COMPUTED_GOTO
 #  include "parrot/oplib/core_ops_cg.h"
+#  include "parrot/oplib/core_ops_cgp.h"
+#endif
+
+#ifdef WIN32
+#  define getpid _getpid
 #endif
 
 /* HEADERIZER HFILE: include/parrot/runcore_api.h */
@@ -253,19 +271,376 @@
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
-static opcode_t * runops_trace_core(PARROT_INTERP, ARGIN(opcode_t *pc))
+static opcode_t * runops_cgoto_core(PARROT_INTERP,
+    ARGIN(Parrot_runcore_t *runcore),
+    ARGIN(opcode_t *pc))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+static opcode_t * runops_cgp_core(PARROT_INTERP,
+    ARGIN(Parrot_runcore_t *runcore),
+    ARGIN(opcode_t *pc))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CAN_RETURN_NULL
+static opcode_t * runops_debugger_core(PARROT_INTERP,
+    ARGIN(Parrot_runcore_t *runcore),
+    ARGIN(opcode_t *pc))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CAN_RETURN_NULL
+static opcode_t * runops_exec_core(PARROT_INTERP,
+    ARGIN(Parrot_runcore_t *runcore),
+    ARGIN(opcode_t *pc))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CAN_RETURN_NULL
+static opcode_t * runops_fast_core(PARROT_INTERP,
+    ARGIN(Parrot_runcore_t *runcore),
+    ARGIN(opcode_t *pc))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
 
-#define ASSERT_ARGS_runops_trace_core __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+PARROT_WARN_UNUSED_RESULT
+PARROT_CAN_RETURN_NULL
+static opcode_t * runops_gc_debug_core(PARROT_INTERP,
+    ARGIN(Parrot_runcore_t *runcore),
+    ARGIN(opcode_t *pc))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CAN_RETURN_NULL
+static opcode_t * runops_slow_core(PARROT_INTERP,
+    ARGIN(Parrot_runcore_t *runcore),
+    ARGIN(opcode_t *pc))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+static opcode_t * runops_switch_core(PARROT_INTERP,
+    ARGIN(Parrot_runcore_t *runcore),
+    ARGIN(opcode_t *pc))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CAN_RETURN_NULL
+static opcode_t * runops_trace_core(PARROT_INTERP,
+    ARGIN(Parrot_runcore_t *runcore),
+    ARGIN(opcode_t *pc))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
+
+#define ASSERT_ARGS_runops_cgoto_core __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(runcore) \
+    , PARROT_ASSERT_ARG(pc))
+#define ASSERT_ARGS_runops_cgp_core __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(runcore) \
+    , PARROT_ASSERT_ARG(pc))
+#define ASSERT_ARGS_runops_debugger_core __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(runcore) \
+    , PARROT_ASSERT_ARG(pc))
+#define ASSERT_ARGS_runops_exec_core __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(runcore) \
+    , PARROT_ASSERT_ARG(pc))
+#define ASSERT_ARGS_runops_fast_core __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(runcore) \
+    , PARROT_ASSERT_ARG(pc))
+#define ASSERT_ARGS_runops_gc_debug_core __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pc)
+    , PARROT_ASSERT_ARG(runcore) \
+    , PARROT_ASSERT_ARG(pc))
+#define ASSERT_ARGS_runops_slow_core __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(runcore) \
+    , PARROT_ASSERT_ARG(pc))
+#define ASSERT_ARGS_runops_switch_core __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(runcore) \
+    , PARROT_ASSERT_ARG(pc))
+#define ASSERT_ARGS_runops_trace_core __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(runcore) \
+    , PARROT_ASSERT_ARG(pc))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
+
+/*
+
+=item C<void Parrot_runcore_slow_init(PARROT_INTERP)>
+
+Registers the slow runcore with Parrot.
+
+=cut
+
+*/
+
+void
+Parrot_runcore_slow_init(PARROT_INTERP)
+{
+    ASSERT_ARGS(Parrot_runcore_slow_init)
+
+    Parrot_runcore_t *coredata = mem_allocate_typed(Parrot_runcore_t);
+    coredata->name             = CONST_STRING(interp, "slow");
+    coredata->id               = PARROT_SLOW_CORE;
+    coredata->opinit           = PARROT_CORE_OPLIB_INIT;
+    coredata->runops           = runops_slow_core;
+    coredata->prepare_run      = NULL;
+    coredata->destroy          = NULL;
+    coredata->flags            = 0;
+
+    PARROT_RUNCORE_FUNC_TABLE_SET(coredata);
+
+    Parrot_runcore_register(interp, coredata);
+}
+
+
+/*
+
+=item C<void Parrot_runcore_fast_init(PARROT_INTERP)>
+
+Registers the fast runcore with Parrot.
+
+=cut
+
+*/
+
+void
+Parrot_runcore_fast_init(PARROT_INTERP)
+{
+    ASSERT_ARGS(Parrot_runcore_fast_init)
+
+    Parrot_runcore_t *coredata = mem_allocate_typed(Parrot_runcore_t);
+    coredata->name             = CONST_STRING(interp, "fast");
+    coredata->id               = PARROT_FAST_CORE;
+    coredata->opinit           = PARROT_CORE_OPLIB_INIT;
+    coredata->runops           = runops_fast_core;
+    coredata->destroy          = NULL;
+    coredata->prepare_run      = NULL;
+    coredata->flags            = 0;
+
+    PARROT_RUNCORE_FUNC_TABLE_SET(coredata);
+
+    Parrot_runcore_register(interp, coredata);
+}
+
+
+/*
+
+=item C<void Parrot_runcore_switch_init(PARROT_INTERP)>
+
+Registers the switch runcore with Parrot.
+
+=cut
+
+*/
+
+void
+Parrot_runcore_switch_init(PARROT_INTERP)
+{
+    ASSERT_ARGS(Parrot_runcore_switch_init)
+
+    Parrot_runcore_t *coredata = mem_allocate_typed(Parrot_runcore_t);
+    coredata->name             = CONST_STRING(interp, "switch");
+    coredata->id               = PARROT_SWITCH_CORE;
+    coredata->opinit           = PARROT_CORE_SWITCH_OPLIB_INIT;
+    coredata->runops           = runops_switch_core;
+    coredata->prepare_run      = init_prederef;
+    coredata->destroy          = NULL;
+    coredata->flags            = 0;
+
+    PARROT_RUNCORE_PREDEREF_OPS_SET(coredata);
+
+    Parrot_runcore_register(interp, coredata);
+}
+
+
+/*
+
+=item C<void Parrot_runcore_exec_init(PARROT_INTERP)>
+
+Registers the exec runcore with Parrot.
+
+=cut
+
+*/
+
+void
+Parrot_runcore_exec_init(PARROT_INTERP)
+{
+    ASSERT_ARGS(Parrot_runcore_exec_init)
+
+    Parrot_runcore_t *coredata = mem_allocate_typed(Parrot_runcore_t);
+    coredata->name             = CONST_STRING(interp, "exec");
+    coredata->id               = PARROT_EXEC_CORE;
+    coredata->opinit           = PARROT_CORE_OPLIB_INIT;
+    coredata->runops           = runops_exec_core;
+    coredata->destroy          = NULL;
+    coredata->prepare_run      = NULL;
+    coredata->flags            = 0;
+
+    Parrot_runcore_register(interp, coredata);
+}
+
+
+/*
+
+=item C<void Parrot_runcore_gc_debug_init(PARROT_INTERP)>
+
+Registers the gc_debug runcore with Parrot.
+
+=cut
+
+*/
+
+void
+Parrot_runcore_gc_debug_init(PARROT_INTERP)
+{
+    ASSERT_ARGS(Parrot_runcore_gc_debug_init)
+
+    Parrot_runcore_t *coredata = mem_allocate_typed(Parrot_runcore_t);
+    coredata->name             = CONST_STRING(interp, "gc_debug");
+    coredata->id               = PARROT_GC_DEBUG_CORE;
+    coredata->opinit           = PARROT_CORE_OPLIB_INIT;
+    coredata->runops           = runops_gc_debug_core;
+    coredata->destroy          = NULL;
+    coredata->prepare_run      = NULL;
+    coredata->flags            = 0;
+
+    PARROT_RUNCORE_FUNC_TABLE_SET(coredata);
+
+    Parrot_runcore_register(interp, coredata);
+}
+
+
+/*
+
+=item C<void Parrot_runcore_debugger_init(PARROT_INTERP)>
+
+Registers the debugger runcore with Parrot.
+
+=cut
+
+*/
+
+void
+Parrot_runcore_debugger_init(PARROT_INTERP)
+{
+    ASSERT_ARGS(Parrot_runcore_debugger_init)
+
+    Parrot_runcore_t *coredata = mem_allocate_typed(Parrot_runcore_t);
+    coredata->name             = CONST_STRING(interp, "debugger");
+    coredata->id               = PARROT_DEBUGGER_CORE;
+    coredata->opinit           = PARROT_CORE_OPLIB_INIT;
+    coredata->prepare_run      = init_prederef;
+    coredata->runops           = runops_debugger_core;
+    coredata->destroy          = NULL;
+    coredata->flags            = 0;
+
+    PARROT_RUNCORE_FUNC_TABLE_SET(coredata);
+
+    Parrot_runcore_register(interp, coredata);
+}
+
+
+/*
+
+=item C<void Parrot_runcore_cgp_init(PARROT_INTERP)>
+
+Registers the CGP runcore with Parrot.
+
+=cut
+
+*/
+
+#ifdef HAVE_COMPUTED_GOTO
+
+void
+Parrot_runcore_cgp_init(PARROT_INTERP)
+{
+    ASSERT_ARGS(Parrot_runcore_cgp_init)
+
+    Parrot_runcore_t *coredata = mem_allocate_typed(Parrot_runcore_t);
+    coredata->name             = CONST_STRING(interp, "cgp");
+    coredata->id               = PARROT_CGP_CORE;
+    coredata->opinit           = PARROT_CORE_CGP_OPLIB_INIT;
+    coredata->prepare_run      = init_prederef;
+    coredata->runops           = runops_cgp_core;
+    coredata->flags            = 0;
+
+    coredata->destroy          = NULL;
+
+    PARROT_RUNCORE_CGOTO_OPS_SET(coredata);
+    PARROT_RUNCORE_EVENT_CHECK_SET(coredata);
+    PARROT_RUNCORE_PREDEREF_OPS_SET(coredata);
+
+    Parrot_runcore_register(interp, coredata);
+}
+
+
+/*
+
+=item C<void Parrot_runcore_cgoto_init(PARROT_INTERP)>
+
+Registers the cgoto runcore with Parrot.
+
+=cut
+
+*/
+
+void
+Parrot_runcore_cgoto_init(PARROT_INTERP)
+{
+    ASSERT_ARGS(Parrot_runcore_cgoto_init)
+
+    Parrot_runcore_t *coredata = mem_allocate_typed(Parrot_runcore_t);
+    coredata->name             = CONST_STRING(interp, "cgoto");
+    coredata->id               = PARROT_CGOTO_CORE;
+    coredata->opinit           = PARROT_CORE_CG_OPLIB_INIT;
+    coredata->runops           = runops_cgoto_core;
+    coredata->destroy          = NULL;
+    coredata->prepare_run      = NULL;
+    coredata->flags            = 0;
+
+    PARROT_RUNCORE_FUNC_TABLE_SET(coredata);
+    PARROT_RUNCORE_CGOTO_OPS_SET(coredata);
+
+    Parrot_runcore_register(interp, coredata);
+}
+
+
+#endif /* #ifdef HAVE_COMPUTED_GOTO */
+
+
 /*
 
-=item C<opcode_t * runops_fast_core(PARROT_INTERP, opcode_t *pc)>
+=item C<static opcode_t * runops_fast_core(PARROT_INTERP, Parrot_runcore_t
+*runcore, opcode_t *pc)>
 
 Runs the Parrot operations starting at C<pc> until there are no more
 operations.  This performs no bounds checking, profiling, or tracing.
@@ -276,15 +651,22 @@
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
-opcode_t *
-runops_fast_core(PARROT_INTERP, ARGIN(opcode_t *pc))
+static opcode_t *
+runops_fast_core(PARROT_INTERP, ARGIN(Parrot_runcore_t *runcore), ARGIN(opcode_t *pc))
 {
     ASSERT_ARGS(runops_fast_core)
 
     /* disable pc */
-    CONTEXT(interp)->current_pc = NULL;
+    Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), NULL);
 
     while (pc) {
+        /* TODO
+         * Decide do we need check here.
+         * Fast-core cause segfaults even on test suite
+        if (pc < code_start || pc >= code_end)
+            Parrot_ex_throw_from_c_args(interp, NULL, 1,
+                "attempt to access code outside of current code segment");
+        */
         DO_OP(pc, interp);
     }
 
@@ -294,7 +676,8 @@
 
 /*
 
-=item C<opcode_t * runops_cgoto_core(PARROT_INTERP, opcode_t *pc)>
+=item C<static opcode_t * runops_cgoto_core(PARROT_INTERP, Parrot_runcore_t
+*runcore, opcode_t *pc)>
 
 Runs the Parrot operations starting at C<pc> until there are no more
 operations, using the computed C<goto> core, performing no bounds checking,
@@ -308,13 +691,13 @@
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
-opcode_t *
-runops_cgoto_core(PARROT_INTERP, ARGIN(opcode_t *pc))
+static opcode_t *
+runops_cgoto_core(PARROT_INTERP, ARGIN(Parrot_runcore_t *runcore), ARGIN(opcode_t *pc))
 {
     ASSERT_ARGS(runops_cgoto_core)
 
     /* disable pc */
-    CONTEXT(interp)->current_pc = NULL;
+    Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), NULL);
 
 #ifdef HAVE_COMPUTED_GOTO
     pc = cg_core(pc, interp);
@@ -338,9 +721,11 @@
 #define  code_end (interp->code->base.data + interp->code->base.size)
 
 
+
 /*
 
-=item C<static opcode_t * runops_trace_core(PARROT_INTERP, opcode_t *pc)>
+=item C<static opcode_t * runops_trace_core(PARROT_INTERP, Parrot_runcore_t
+*runcore, opcode_t *pc)>
 
 Runs the Parrot operations starting at C<pc> until there are no more
 operations, using the tracing interpreter.
@@ -352,7 +737,7 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
 static opcode_t *
-runops_trace_core(PARROT_INTERP, ARGIN(opcode_t *pc))
+runops_trace_core(PARROT_INTERP, ARGIN(Parrot_runcore_t *runcore), ARGIN(opcode_t *pc))
 {
     ASSERT_ARGS(runops_trace_core)
 
@@ -382,7 +767,7 @@
         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 */
+         * see trace_system_areas() in src/gc/system.c */
         debugger->lo_var_ptr = interp->lo_var_ptr;
 
         pio = Parrot_io_STDERR(debugger);
@@ -403,7 +788,7 @@
             Parrot_ex_throw_from_c_args(interp, NULL, 1,
                 "attempt to access code outside of current code segment");
 
-        CONTEXT(interp)->current_pc = pc;
+        Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), pc);
 
         DO_OP(pc, interp);
         trace_op(interp, code_start, code_end, pc);
@@ -429,7 +814,8 @@
 
 /*
 
-=item C<opcode_t * runops_slow_core(PARROT_INTERP, opcode_t *pc)>
+=item C<static opcode_t * runops_slow_core(PARROT_INTERP, Parrot_runcore_t
+*runcore, opcode_t *pc)>
 
 Runs the Parrot operations starting at C<pc> until there are no more
 operations, with tracing and bounds checking enabled.
@@ -440,13 +826,13 @@
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
-opcode_t *
-runops_slow_core(PARROT_INTERP, ARGIN(opcode_t *pc))
+static opcode_t *
+runops_slow_core(PARROT_INTERP, ARGIN(Parrot_runcore_t *runcore), ARGIN(opcode_t *pc))
 {
     ASSERT_ARGS(runops_slow_core)
 
     if (Interp_trace_TEST(interp, PARROT_TRACE_OPS_FLAG))
-        return runops_trace_core(interp, pc);
+        return runops_trace_core(interp, runcore, pc);
 #if 0
     if (interp->debugger && interp->debugger->pdb)
         return Parrot_debug(interp, interp->debugger, pc);
@@ -457,7 +843,7 @@
             Parrot_ex_throw_from_c_args(interp, NULL, 1,
                 "attempt to access code outside of current code segment");
 
-        CONTEXT(interp)->current_pc = pc;
+        Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), pc);
 
         DO_OP(pc, interp);
     }
@@ -468,7 +854,8 @@
 
 /*
 
-=item C<opcode_t * runops_gc_debug_core(PARROT_INTERP, opcode_t *pc)>
+=item C<static opcode_t * runops_gc_debug_core(PARROT_INTERP, Parrot_runcore_t
+*runcore, opcode_t *pc)>
 
 Runs the Parrot operations starting at C<pc> until there are no more
 operations, performing a full GC run before each op.  This is very slow, but
@@ -480,8 +867,8 @@
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
-opcode_t *
-runops_gc_debug_core(PARROT_INTERP, ARGIN(opcode_t *pc))
+static opcode_t *
+runops_gc_debug_core(PARROT_INTERP, ARGIN(Parrot_runcore_t *runcore), ARGIN(opcode_t *pc))
 {
     ASSERT_ARGS(runops_gc_debug_core)
     while (pc) {
@@ -490,7 +877,7 @@
                 "attempt to access code outside of current code segment");
 
         Parrot_gc_mark_and_sweep(interp, GC_TRACE_FULL);
-        CONTEXT(interp)->current_pc = pc;
+        Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), pc);
 
         DO_OP(pc, interp);
     }
@@ -498,62 +885,14 @@
     return pc;
 }
 
+
 #undef code_start
 #undef code_end
 
-
 /*
 
-=item C<opcode_t * runops_profile_core(PARROT_INTERP, opcode_t *pc)>
-
-Runs the Parrot operations starting at C<pc> until there are no more
-operations, with tracing, bounds checking, and profiling enabled.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-opcode_t *
-runops_profile_core(PARROT_INTERP, ARGIN(opcode_t *pc))
-{
-    ASSERT_ARGS(runops_profile_core)
-    RunProfile * const profile = interp->profile;
-    const opcode_t     old_op  = profile->cur_op;
-
-    /* if reentering the runloop, remember old op and calc time 'til now */
-    if (old_op)
-        profile->data[old_op].time +=
-            Parrot_floatval_time() - profile->starttime;
-
-    while (pc) {/* && pc >= code_start && pc < code_end) */
-        opcode_t cur_op;
-
-        CONTEXT(interp)->current_pc      = pc;
-        profile->cur_op                  = cur_op = *pc + PARROT_PROF_EXTRA;
-        profile->starttime               = Parrot_floatval_time();
-        profile->data[cur_op].numcalls++;
-
-        DO_OP(pc, interp);
-
-        /* profile->cur_op may be different, if exception was thrown */
-        profile->data[profile->cur_op].time +=
-            Parrot_floatval_time() - profile->starttime;
-    }
-
-    if (old_op) {
-        /* old opcode continues */
-        profile->starttime = Parrot_floatval_time();
-        profile->cur_op    = old_op;
-    }
-
-    return pc;
-}
-
-/*
-
-=item C<opcode_t * runops_debugger_core(PARROT_INTERP, opcode_t *pc)>
+=item C<static opcode_t * runops_debugger_core(PARROT_INTERP, Parrot_runcore_t
+*runcore, opcode_t *pc)>
 
 Used by the debugger, under construction
 
@@ -563,17 +902,15 @@
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
-opcode_t *
-runops_debugger_core(PARROT_INTERP, ARGIN(opcode_t *pc))
+static opcode_t *
+runops_debugger_core(PARROT_INTERP, ARGIN(Parrot_runcore_t *runcore), ARGIN(opcode_t *pc))
 {
     ASSERT_ARGS(runops_debugger_core)
-    /*fprintf(stderr, "Enter runops_debugger_core\n");*/
 
     PARROT_ASSERT(interp->pdb);
 
-    if (interp->pdb->state & PDB_ENTER) {
+    if (interp->pdb->state & PDB_ENTER)
         Parrot_debugger_start(interp, pc);
-    }
 
     while (pc) {
         if (pc < interp->code->base.data || pc >= interp->code->base.data + interp->code->base.size)
@@ -591,30 +928,231 @@
                     pc);
         }
 
-        CONTEXT(interp)->current_pc = pc;
+        Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), pc);
         DO_OP(pc, interp);
 
         if (interp->pdb->state & PDB_STOPPED) {
             Parrot_debugger_start(interp, pc);
         }
-        else
-        {
+        else {
             if (PDB_break(interp)) {
                 Parrot_debugger_start(interp, pc);
                 continue;
             }
 
-            if (interp->pdb->tracing) {
-                if (--interp->pdb->tracing == 0) {
-                    Parrot_debugger_start(interp, pc);
-                }
-            }
+            if (interp->pdb->tracing && --interp->pdb->tracing == 0)
+                Parrot_debugger_start(interp, pc);
         }
     }
 
     return pc;
 }
 
+
+/*
+
+=item C<static opcode_t * runops_switch_core(PARROT_INTERP, Parrot_runcore_t
+*runcore, opcode_t *pc)>
+
+Runs the C<switch> core.
+
+=cut
+
+*/
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+static opcode_t *
+runops_switch_core(PARROT_INTERP, ARGIN(Parrot_runcore_t *runcore), ARGIN(opcode_t *pc))
+{
+    ASSERT_ARGS(runops_switch_core)
+    opcode_t * const code_start = (opcode_t *)interp->code->base.data;
+    opcode_t        *pc_prederef;
+
+    init_prederef(interp, runcore);
+    pc_prederef = (opcode_t*)interp->code->prederef.code + (pc - code_start);
+
+    return switch_core(pc_prederef, interp);
+}
+
+
+/*
+
+=item C<void * init_prederef(PARROT_INTERP, Parrot_runcore_t *runcore)>
+
+Initialize: load prederef C<func_table>, file prederef.code.
+
+=cut
+
+*/
+
+PARROT_CAN_RETURN_NULL
+void *
+init_prederef(PARROT_INTERP, ARGIN(Parrot_runcore_t *runcore))
+{
+    ASSERT_ARGS(init_prederef)
+    load_prederef(interp, runcore);
+
+    if (!interp->code->prederef.code) {
+        void        *pred_func;
+        opcode_t    *pc = interp->code->base.data;
+        const size_t N  = interp->code->base.size;
+        size_t       i, n_pics;
+
+/* Parrot_memalign_if_possible in OpenBSD allocates 256 if you ask for 312
+   -- Need to verify this, it may have been a bug elsewhere. If it works now,
+   we can remove the mem_sys_allocate_zeroed line below. */
+
+#if 0
+        void **temp = (void **)mem_sys_allocate_zeroed(N * sizeof (void *));
+#else
+        void **temp = (void **)Parrot_memalign_if_possible(256,
+                N * sizeof (void *));
+#endif
+        /* calc and remember pred_offset */
+        CONTEXT(interp)->pred_offset = pc - (opcode_t *)temp;
+
+        /* fill with the prederef__ opcode function */
+        if (PARROT_RUNCORE_PREDEREF_OPS_TEST(runcore)
+        && !PARROT_RUNCORE_CGOTO_OPS_TEST(runcore))
+            pred_func = (void *)CORE_OPS_prederef__;
+        else {
+            PARROT_ASSERT(interp->op_lib->op_func_table);
+            pred_func = ((void **)
+                    interp->op_lib->op_func_table)[CORE_OPS_prederef__];
+        }
+
+        for (i = n_pics = 0; i < N;) {
+            op_info_t * const opinfo = &interp->op_info_table[*pc];
+            size_t            n      = opinfo->op_count;
+
+            temp[i] = pred_func;
+
+            ADD_OP_VAR_PART(interp, interp->code, pc, n);
+
+            pc += n;
+            i  += n;
+        }
+
+        interp->code->prederef.code = temp;
+    }
+
+    return NULL;
+}
+
+
+/*
+
+=item C<void load_prederef(PARROT_INTERP, Parrot_runcore_t *runcore)>
+
+C<< interp->op_lib >> = prederefed oplib.
+
+=cut
+
+*/
+
+void
+load_prederef(PARROT_INTERP, ARGIN(Parrot_runcore_t *runcore))
+{
+    ASSERT_ARGS(load_prederef)
+    const oplib_init_f init_func = get_core_op_lib_init(interp, runcore);
+
+    int (*get_op)(const char * name, int full);
+
+    get_op          = interp->op_lib->op_code;
+    interp->op_lib  = init_func(1);
+
+    /* preserve the get_op function */
+    interp->op_lib->op_code = get_op;
+
+    if (interp->op_lib->op_count != interp->op_count)
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PREDEREF_LOAD_ERROR,
+            "Illegal op count (%d) in prederef oplib\n",
+            (int)interp->op_lib->op_count);
+}
+
+
+/*
+
+=item C<oplib_init_f get_core_op_lib_init(PARROT_INTERP, Parrot_runcore_t
+*runcore)>
+
+Returns an opcode's library C<op_lib> init function.
+
+=cut
+
+*/
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+oplib_init_f
+get_core_op_lib_init(PARROT_INTERP, ARGIN(Parrot_runcore_t *runcore))
+{
+    ASSERT_ARGS(get_core_op_lib_init)
+    return runcore->opinit;
+}
+
+
+/*
+
+=item C<static opcode_t * runops_exec_core(PARROT_INTERP, Parrot_runcore_t
+*runcore, opcode_t *pc)>
+
+Runs the native executable version of the specified opcode.
+
+=cut
+
+*/
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CAN_RETURN_NULL
+static opcode_t *
+runops_exec_core(PARROT_INTERP, ARGIN(Parrot_runcore_t *runcore), ARGIN(opcode_t *pc))
+{
+    ASSERT_ARGS(runops_exec_core)
+
+    UNUSED(interp);
+    UNUSED(pc);
+
+    return NULL;
+}
+
+
+/*
+
+=item C<static opcode_t * runops_cgp_core(PARROT_INTERP, Parrot_runcore_t
+*runcore, opcode_t *pc)>
+
+Runs the computed goto and predereferenced core.
+
+=cut
+
+*/
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+static opcode_t *
+runops_cgp_core(PARROT_INTERP, ARGIN(Parrot_runcore_t *runcore), ARGIN(opcode_t *pc))
+{
+    ASSERT_ARGS(runops_cgp_core)
+#ifdef HAVE_COMPUTED_GOTO
+    opcode_t * const code_start = (opcode_t *)interp->code->base.data;
+    opcode_t        *pc_prederef;
+
+    init_prederef(interp, runcore);
+
+    pc_prederef = (opcode_t *)interp->code->prederef.code + (pc - code_start);
+    return cgp_core(pc_prederef, interp);
+
+#else
+    UNUSED(pc);
+    Parrot_io_eprintf(interp,
+            "Computed goto unavailable in this configuration.\n");
+    Parrot_exit(interp, 1);
+#endif
+
+}
+
 /*
 
 =back

Modified: branches/orderedhash_revamp/src/runcore/main.c
==============================================================================
--- branches/orderedhash_revamp/src/runcore/main.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/runcore/main.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -34,19 +34,19 @@
 
 #include "parrot/parrot.h"
 #include "parrot/runcore_api.h"
+#include "parrot/runcore_profiling.h"
 #include "parrot/oplib/core_ops.h"
 #include "parrot/oplib/core_ops_switch.h"
 #include "parrot/oplib/ops.h"
-#if JIT_CAPABLE
-#  include "parrot/exec.h"
-#  include "../jit.h"
-#endif
+#include "main.str"
+
 #ifdef HAVE_COMPUTED_GOTO
 #  include "parrot/oplib/core_ops_cg.h"
 #  include "parrot/oplib/core_ops_cgp.h"
 #endif
 #include "parrot/dynext.h"
-#include "../pmc/pmc_parrotlibrary.h"
+#include "pmc/pmc_parrotlibrary.h"
+#include "pmc/pmc_callcontext.h"
 
 
 /* HEADERIZER HFILE: include/parrot/runcore_api.h */
@@ -64,23 +64,12 @@
 
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-static oplib_init_f get_core_op_lib_init(PARROT_INTERP, int which)
-        __attribute__nonnull__(1);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
 static oplib_init_f get_dynamic_op_lib_init(SHIM_INTERP,
     ARGIN(const PMC *lib))
         __attribute__nonnull__(2);
 
-static void init_prederef(PARROT_INTERP, int which)
-        __attribute__nonnull__(1);
-
-static void load_prederef(PARROT_INTERP, int which)
-        __attribute__nonnull__(1);
-
 static void notify_func_table(PARROT_INTERP,
-    ARGIN(op_func_t* table),
+    ARGIN(op_func_t *table),
     int on)
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
@@ -96,77 +85,131 @@
         __attribute__nonnull__(4)
         FUNC_MODIFIES(*pc_prederef);
 
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static opcode_t * runops_cgp(PARROT_INTERP, ARGIN(opcode_t *pc))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-static opcode_t * runops_exec(PARROT_INTERP, ARGIN(opcode_t *pc))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-static opcode_t * runops_jit(PARROT_INTERP, ARGIN(opcode_t *pc))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static opcode_t * runops_switch(PARROT_INTERP, ARGIN(opcode_t *pc))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
 static void stop_prederef(PARROT_INTERP)
         __attribute__nonnull__(1);
 
 static void turn_ev_check(PARROT_INTERP, int on)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_dynop_register_switch __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_dynop_register_xx __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_get_core_op_lib_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_get_dynamic_op_lib_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(lib)
-#define ASSERT_ARGS_init_prederef __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_load_prederef __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_notify_func_table __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_dynop_register_switch __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_dynop_register_xx __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_get_dynamic_op_lib_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(lib))
+#define ASSERT_ARGS_notify_func_table __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(table)
-#define ASSERT_ARGS_prederef_args __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(table))
+#define ASSERT_ARGS_prederef_args __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(pc_prederef) \
-    || PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pc) \
-    || PARROT_ASSERT_ARG(opinfo)
-#define ASSERT_ARGS_runops_cgp __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pc)
-#define ASSERT_ARGS_runops_exec __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pc)
-#define ASSERT_ARGS_runops_jit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pc)
-#define ASSERT_ARGS_runops_switch __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pc)
-#define ASSERT_ARGS_stop_prederef __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_turn_ev_check __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+    , PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pc) \
+    , PARROT_ASSERT_ARG(opinfo))
+#define ASSERT_ARGS_stop_prederef __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_turn_ev_check __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: static */
 
-#if EXEC_CAPABLE
-    extern int Parrot_exec_run;
+/*
+
+=item C<void Parrot_runcore_init(PARROT_INTERP)>
+
+Initializes the runcores.
+
+=cut
+
+*/
+
+void
+Parrot_runcore_init(PARROT_INTERP)
+{
+    ASSERT_ARGS(Parrot_runcore_init)
+    STRING * const default_core = CONST_STRING(interp, "fast");
+
+    interp->cores        = NULL;
+    interp->num_cores    = 0;
+
+    Parrot_runcore_slow_init(interp);
+    Parrot_runcore_fast_init(interp);
+    Parrot_runcore_switch_init(interp);
+
+    Parrot_runcore_exec_init(interp);
+    Parrot_runcore_gc_debug_init(interp);
+    Parrot_runcore_debugger_init(interp);
+
+    Parrot_runcore_profiling_init(interp);
+
+    /* set the default runcore */
+    Parrot_runcore_switch(interp, default_core);
+
+#ifdef HAVE_COMPUTED_GOTO
+    Parrot_runcore_cgp_init(interp);
+    Parrot_runcore_cgoto_init(interp);
 #endif
+}
+
+
+/*
+
+=item C<INTVAL Parrot_runcore_register(PARROT_INTERP, Parrot_runcore_t
+*coredata)>
+
+Registers a new runcore with Parrot.  Returns 1 on success, 0 on failure.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+INTVAL
+Parrot_runcore_register(PARROT_INTERP, ARGIN(Parrot_runcore_t *coredata))
+{
+    ASSERT_ARGS(Parrot_runcore_register)
+    size_t num_cores = ++interp->num_cores;
+
+    mem_realloc_n_typed(interp->cores, num_cores, Parrot_runcore_t *);
+
+    interp->cores[num_cores - 1] = coredata;
+
+    return 1;
+}
+
+
+/*
+
+=item C<void Parrot_runcore_switch(PARROT_INTERP, STRING *name)>
+
+Switches to a named runcore.  Throws an exception on an unknown runcore.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_runcore_switch(PARROT_INTERP, ARGIN(STRING *name))
+{
+    ASSERT_ARGS(Parrot_runcore_switch)
+
+    size_t num_cores = interp->num_cores;
+    size_t i;
+
+    if (interp->run_core
+    &&  Parrot_str_equal(interp, name, interp->run_core->name))
+        return;
+
+    for (i = 0; i < num_cores; ++i) {
+        if (Parrot_str_equal(interp, name, interp->cores[i]->name)) {
+            interp->run_core = interp->cores[i];
+            return;
+        }
+    }
+
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+        "Invalid runcore %Ss requested\n", name);
+}
+
 
 /*
 
@@ -188,10 +231,10 @@
     ASSERT_ARGS(prederef_args)
     const PackFile_ConstTable * const const_table = interp->code->const_table;
 
-    const int regs_n = CONTEXT(interp)->n_regs_used[REGNO_NUM];
-    const int regs_i = CONTEXT(interp)->n_regs_used[REGNO_INT];
-    const int regs_p = CONTEXT(interp)->n_regs_used[REGNO_PMC];
-    const int regs_s = CONTEXT(interp)->n_regs_used[REGNO_STR];
+    const int regs_n = Parrot_pcc_get_regs_used(interp, CURRENT_CONTEXT(interp), REGNO_NUM);
+    const int regs_i = Parrot_pcc_get_regs_used(interp, CURRENT_CONTEXT(interp), REGNO_INT);
+    const int regs_p = Parrot_pcc_get_regs_used(interp, CURRENT_CONTEXT(interp), REGNO_PMC);
+    const int regs_s = Parrot_pcc_get_regs_used(interp, CURRENT_CONTEXT(interp), REGNO_STR);
 
     /* prederef var part too */
     const int m = opinfo->op_count;
@@ -212,8 +255,8 @@
 
         switch (type) {
 
-        case PARROT_ARG_KI:
-        case PARROT_ARG_I:
+          case PARROT_ARG_KI:
+          case PARROT_ARG_I:
             if (arg < 0 || arg >= regs_i)
                 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INTERP_ERROR,
                     "Illegal register number");
@@ -221,7 +264,7 @@
             pc_prederef[i] = (void *)REG_OFFS_INT(arg);
             break;
 
-        case PARROT_ARG_N:
+          case PARROT_ARG_N:
             if (arg < 0 || arg >= regs_n)
                 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INTERP_ERROR,
                     "Illegal register number");
@@ -229,8 +272,8 @@
             pc_prederef[i] = (void *)REG_OFFS_NUM(arg);
             break;
 
-        case PARROT_ARG_K:
-        case PARROT_ARG_P:
+          case PARROT_ARG_K:
+          case PARROT_ARG_P:
             if (arg < 0 || arg >= regs_p)
                 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INTERP_ERROR,
                     "Illegal register number");
@@ -238,7 +281,7 @@
             pc_prederef[i] = (void *)REG_OFFS_PMC(arg);
             break;
 
-        case PARROT_ARG_S:
+          case PARROT_ARG_S:
             if (arg < 0 || arg >= regs_s)
                 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INTERP_ERROR,
                     "Illegal register number");
@@ -246,12 +289,12 @@
             pc_prederef[i] = (void *)REG_OFFS_STR(arg);
             break;
 
-        case PARROT_ARG_KIC:
-        case PARROT_ARG_IC:
+          case PARROT_ARG_KIC:
+          case PARROT_ARG_IC:
             pc_prederef[i] = (void *)pc[i];
             break;
 
-        case PARROT_ARG_NC:
+          case PARROT_ARG_NC:
             if (arg < 0 || arg >= const_table->const_count)
                 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INTERP_ERROR,
                     "Illegal constant number");
@@ -259,7 +302,7 @@
             pc_prederef[i] = (void *)&const_table->constants[arg]->u.number;
             break;
 
-        case PARROT_ARG_SC:
+          case PARROT_ARG_SC:
             if (arg < 0 || arg >= const_table->const_count)
                 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INTERP_ERROR,
                     "Illegal constant number");
@@ -267,15 +310,15 @@
             pc_prederef[i] = (void *)const_table->constants[arg]->u.string;
             break;
 
-        case PARROT_ARG_PC:
-        case PARROT_ARG_KC:
+          case PARROT_ARG_PC:
+          case PARROT_ARG_KC:
             if (arg < 0 || arg >= const_table->const_count)
                 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INTERP_ERROR,
                     "Illegal constant number");
 
             pc_prederef[i] = (void *)const_table->constants[arg]->u.key;
             break;
-        default:
+          default:
             Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ARG_OP_NOT_HANDLED,
                 "Unhandled argtype 0x%x\n", type);
             break;
@@ -286,7 +329,8 @@
 
 /*
 
-=item C<void do_prederef(void **pc_prederef, PARROT_INTERP, int type)>
+=item C<void do_prederef(void **pc_prederef, PARROT_INTERP, Parrot_runcore_t
+*runcore)>
 
 This is called from within the run cores to predereference the current
 opcode.
@@ -298,7 +342,7 @@
 */
 
 void
-do_prederef(ARGIN(void **pc_prederef), PARROT_INTERP, int type)
+do_prederef(ARGIN(void **pc_prederef), PARROT_INTERP, ARGIN(Parrot_runcore_t *runcore))
 {
     ASSERT_ARGS(do_prederef)
     const size_t     offset = pc_prederef - interp->code->prederef.code;
@@ -312,25 +356,16 @@
 
     opinfo = &interp->op_info_table[*pc];
 
-    /* first arguments - PIC needs it */
-
-    /* check for RT#58044 */
-    PARROT_ASSERT(CONTEXT(interp)->n_regs_used);
-
     prederef_args(pc_prederef, interp, pc, opinfo);
 
-    switch (type) {
-        case PARROT_SWITCH_CORE:
-        case PARROT_SWITCH_JIT_CORE:
-        case PARROT_CGP_CORE:
-        case PARROT_CGP_JIT_CORE:
-            parrot_PIC_prederef(interp, *pc, pc_prederef, type);
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, 1,
-                "Tried to prederef wrong core");
-            break;
+    if (PARROT_RUNCORE_PREDEREF_OPS_TEST(runcore)) {
+        *pc_prederef = PARROT_RUNCORE_CGOTO_OPS_TEST(runcore)
+            ? ((void **)interp->op_lib->op_func_table)[*pc]
+            : (void**)*pc;
     }
+    else
+        Parrot_ex_throw_from_c_args(interp, NULL, 1,
+            "Tried to prederef wrong core");
 
     /* now remember backward branches, invoke and similar opcodes */
     n = opinfo->op_count;
@@ -405,57 +440,6 @@
 
 /*
 
-=item C<static oplib_init_f get_core_op_lib_init(PARROT_INTERP, int which)>
-
-Returns an opcode's library C<op_lib> init function.
-
-C<which> is the run core type.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static oplib_init_f
-get_core_op_lib_init(PARROT_INTERP, int which)
-{
-    ASSERT_ARGS(get_core_op_lib_init)
-    oplib_init_f init_func;
-    switch (which) {
-        case PARROT_SWITCH_CORE:
-        case PARROT_SWITCH_JIT_CORE:
-            init_func = PARROT_CORE_SWITCH_OPLIB_INIT;
-            break;
-#ifdef HAVE_COMPUTED_GOTO
-        case PARROT_CGP_CORE:
-        case PARROT_CGP_JIT_CORE:
-            init_func = PARROT_CORE_CGP_OPLIB_INIT;
-            break;
-        case PARROT_CGOTO_CORE:
-            init_func = PARROT_CORE_CG_OPLIB_INIT;
-            break;
-#endif
-        /* normal func core */
-        case PARROT_EXEC_CORE:
-        case PARROT_JIT_CORE:
-        case PARROT_SLOW_CORE:
-        case PARROT_FAST_CORE:
-        case PARROT_GC_DEBUG_CORE:
-        case PARROT_DEBUGGER_CORE:
-            init_func = PARROT_CORE_OPLIB_INIT;
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, 1,
-                "Couldn't find init_func for core %d", which);
-    }
-
-    return init_func;
-}
-
-
-/*
-
 =item C<static oplib_init_f get_dynamic_op_lib_init(PARROT_INTERP, const PMC
 *lib)>
 
@@ -480,103 +464,6 @@
 
 /*
 
-=item C<static void load_prederef(PARROT_INTERP, int which)>
-
-C<< interp->op_lib >> = prederefed oplib.
-
-=cut
-
-*/
-
-static void
-load_prederef(PARROT_INTERP, int which)
-{
-    ASSERT_ARGS(load_prederef)
-    const oplib_init_f init_func = get_core_op_lib_init(interp, which);
-
-    int (*get_op)(const char * name, int full);
-
-    get_op          = interp->op_lib->op_code;
-    interp->op_lib  = init_func(1);
-
-    /* preserve the get_op function */
-    interp->op_lib->op_code = get_op;
-
-    if (interp->op_lib->op_count != interp->op_count)
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PREDEREF_LOAD_ERROR,
-            "Illegal op count (%d) in prederef oplib\n",
-            (int)interp->op_lib->op_count);
-}
-
-
-/*
-
-=item C<static void init_prederef(PARROT_INTERP, int which)>
-
-Initialize: load prederef C<func_table>, file prederef.code.
-
-=cut
-
-*/
-
-static void
-init_prederef(PARROT_INTERP, int which)
-{
-    ASSERT_ARGS(init_prederef)
-    load_prederef(interp, which);
-    if (!interp->code->prederef.code) {
-        void        *pred_func;
-        opcode_t    *pc = interp->code->base.data;
-        const size_t N  = interp->code->base.size;
-        size_t       i, n_pics;
-
-/* Parrot_memalign_if_possible in OpenBSD allocates 256 if you ask for 312
-   -- Need to verify this, it may have been a bug elsewhere. If it works now,
-   we can remove the mem_sys_allocate_zeroed line below. */
-
-#if 0
-        void **temp = (void **)mem_sys_allocate_zeroed(N * sizeof (void *));
-#else
-        void **temp = (void **)Parrot_memalign_if_possible(256,
-                N * sizeof (void *));
-#endif
-        /* calc and remember pred_offset */
-        CONTEXT(interp)->pred_offset = pc - (opcode_t *)temp;
-
-        /* fill with the prederef__ opcode function */
-        if (which == PARROT_SWITCH_CORE || which == PARROT_SWITCH_JIT_CORE)
-            pred_func = (void *)CORE_OPS_prederef__;
-        else
-            pred_func = ((void **)
-                    interp->op_lib->op_func_table)[CORE_OPS_prederef__];
-
-        for (i = n_pics = 0; i < N;) {
-            op_info_t * const opinfo = &interp->op_info_table[*pc];
-            size_t            n      = opinfo->op_count;
-
-            temp[i] = pred_func;
-
-            ADD_OP_VAR_PART(interp, interp->code, pc, n);
-
-            /* count ops that need a PIC */
-            if (parrot_PIC_op_is_cached(*pc))
-                n_pics++;
-
-            pc += n;
-            i  += n;
-        }
-
-        interp->code->prederef.code = temp;
-
-        /* allocate pic store, which starts from 1 */
-        if (n_pics)
-            parrot_PIC_alloc_store(interp->code, n_pics + 1);
-    }
-}
-
-
-/*
-
 =item C<static void stop_prederef(PARROT_INTERP)>
 
 Restore the interpreter's op function tables to their initial state.
@@ -602,89 +489,6 @@
 }
 
 
-#if EXEC_CAPABLE
-
-/*
-
-=item C<void exec_init_prederef(PARROT_INTERP, void *prederef_arena)>
-
-C<< interp->op_lib >> = prederefed oplib
-
-The "normal" C<op_lib> has a copy in the interpreter structure - but get
-the C<op_code> lookup function from standard core prederef has no
-C<op_info_table>
-
-=cut
-
-*/
-
-void
-exec_init_prederef(PARROT_INTERP, ARGIN(void *prederef_arena))
-{
-    ASSERT_ARGS(exec_init_prederef)
-    load_prederef(interp, PARROT_CGP_CORE);
-
-    if (!interp->code->prederef.code) {
-        void ** const temp = (void **)prederef_arena;
-
-        interp->code->prederef.code = temp;
-        /* TODO */
-    }
-}
-
-#endif
-
-
-/*
-
-=item C<void * init_jit(PARROT_INTERP, opcode_t *pc)>
-
-Initializes JIT function for the specified opcode and returns it.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-void *
-init_jit(PARROT_INTERP, SHIM(opcode_t *pc))
-{
-    ASSERT_ARGS(init_jit)
-#if JIT_CAPABLE
-    opcode_t          *code_start;
-    UINTVAL            code_size;          /* in opcodes */
-    opcode_t          *code_end;
-    Parrot_jit_info_t *jit_info;
-
-    if (interp->code->jit_info)
-        return ((Parrot_jit_info_t *)interp->code->jit_info)->arena.start;
-
-    code_start = interp->code->base.data;
-    code_size  = interp->code->base.size;
-    code_end   = code_start + code_size;
-
-#  if defined HAVE_COMPUTED_GOTO && PARROT_I386_JIT_CGP
-#    ifdef __GNUC__
-#      ifdef PARROT_I386
-    init_prederef(interp, PARROT_CGP_CORE);
-#      endif
-#    endif
-#  endif
-
-    interp->code->jit_info =
-        jit_info = parrot_build_asm(interp, code_start, code_end,
-            NULL, JIT_CODE_FILE);
-
-    return jit_info->arena.start;
-#else
-    UNUSED(interp);
-    return NULL;
-#endif
-
-}
-
-
 /*
 
 =item C<void prepare_for_run(PARROT_INTERP)>
@@ -699,185 +503,10 @@
 prepare_for_run(PARROT_INTERP)
 {
     ASSERT_ARGS(prepare_for_run)
-    void *ignored;
+    const runcore_prepare_fn_type prepare_run = interp->run_core->prepare_run;
 
-    switch (interp->run_core) {
-        case PARROT_JIT_CORE:
-            ignored = init_jit(interp, interp->code->base.data);
-            UNUSED(ignored);
-            break;
-        case PARROT_SWITCH_CORE:
-        case PARROT_SWITCH_JIT_CORE:
-        case PARROT_CGP_CORE:
-        case PARROT_CGP_JIT_CORE:
-        case PARROT_DEBUGGER_CORE:
-            init_prederef(interp, interp->run_core);
-            break;
-        default:
-            break;
-    }
-}
-
-
-#ifdef PARROT_EXEC_OS_AIX
-extern void* aix_get_toc();
-#endif
-
-/*
-
-=item C<static opcode_t * runops_jit(PARROT_INTERP, opcode_t *pc)>
-
-Runs the JIT code for the specified opcode.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-static opcode_t *
-runops_jit(PARROT_INTERP, ARGIN(opcode_t *pc))
-{
-    ASSERT_ARGS(runops_jit)
-#if JIT_CAPABLE
-#  ifdef PARROT_EXEC_OS_AIX
-    /* AIX calling convention requires that function-call-by-ptr be made
-       through the following struct: */
-    struct ptrgl_t { jit_f functPtr; void *toc; void *env; } ptrgl_t;
-
-    ptrgl_t.functPtr = (jit_f) D2FPTR(init_jit(interp, pc));
-    ptrgl_t.env      = NULL;
-
-    /* r2 (TOC) needs to point back here so we can return from non-JIT
-       functions */
-    ptrgl_t.toc = aix_get_toc();
-
-    ((jit_f) D2FPTR(&ptrgl_t)) (interp, pc);
-#  else
-    jit_f jit_code = (jit_f)(init_jit(interp, pc));
-    (jit_code) (interp, pc);
-#  endif
-#else
-    UNUSED(interp);
-    UNUSED(pc);
-#endif
-    return NULL;
-}
-
-
-/*
-
-=item C<static opcode_t * runops_exec(PARROT_INTERP, opcode_t *pc)>
-
-Runs the native executable version of the specified opcode.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-static opcode_t *
-runops_exec(PARROT_INTERP, ARGIN(opcode_t *pc))
-{
-    ASSERT_ARGS(runops_exec)
-#if EXEC_CAPABLE
-    opcode_t *code_start;
-    UINTVAL   code_size;          /* in opcodes */
-    opcode_t *code_end;
-
-    code_start = interp->code->base.data;
-    code_size = interp->code->base.size;
-    code_end = code_start + code_size;
-#  if defined HAVE_COMPUTED_GOTO && defined USE_CGP
-#    ifdef __GNUC__
-#      ifdef PARROT_I386
-    init_prederef(interp, PARROT_CGP_CORE);
-#      endif
-#    endif
-#  endif
-    if (Parrot_exec_run == 2) {
-        void *ignored;
-        Parrot_exec_run = 0;
-
-        Interp_core_SET(interp, PARROT_JIT_CORE);
-        ignored         = runops_jit(interp, pc);
-        UNUSED(ignored);
-
-        Interp_core_SET(interp, PARROT_EXEC_CORE);
-    }
-    else if (Parrot_exec_run == 1)
-        Parrot_exec(interp, pc, code_start, code_end);
-    else
-        run_native(interp, pc, code_start);
-
-#else
-    UNUSED(interp);
-    UNUSED(pc);
-#endif
-
-    return NULL;
-}
-
-
-/*
-
-=item C<static opcode_t * runops_cgp(PARROT_INTERP, opcode_t *pc)>
-
-Runs the C C<goto>, predereferenced core.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static opcode_t *
-runops_cgp(PARROT_INTERP, ARGIN(opcode_t *pc))
-{
-    ASSERT_ARGS(runops_cgp)
-#ifdef HAVE_COMPUTED_GOTO
-    opcode_t * const code_start = (opcode_t *)interp->code->base.data;
-    opcode_t        *pc_prederef;
-
-    init_prederef(interp, PARROT_CGP_CORE);
-
-    pc_prederef = (opcode_t*)interp->code->prederef.code + (pc - code_start);
-    return cgp_core(pc_prederef, interp);
-
-#else
-    UNUSED(pc);
-    Parrot_io_eprintf(interp,
-            "Computed goto unavailable in this configuration.\n");
-    Parrot_exit(interp, 1);
-#endif
-
-}
-
-
-/*
-
-=item C<static opcode_t * runops_switch(PARROT_INTERP, opcode_t *pc)>
-
-Runs the C<switch> core.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static opcode_t *
-runops_switch(PARROT_INTERP, ARGIN(opcode_t *pc))
-{
-    ASSERT_ARGS(runops_switch)
-    opcode_t * const code_start = (opcode_t *)interp->code->base.data;
-    opcode_t        *pc_prederef;
-
-    init_prederef(interp, PARROT_SWITCH_CORE);
-    pc_prederef = (opcode_t*)interp->code->prederef.code + (pc - code_start);
-
-    return switch_core(pc_prederef, interp);
+    if (prepare_run)
+        (*prepare_run)(interp, interp->run_core);
 }
 
 
@@ -898,7 +527,6 @@
 runops_int(PARROT_INTERP, size_t offset)
 {
     ASSERT_ARGS(runops_int)
-    opcode_t *(*core) (PARROT_INTERP, opcode_t *) = NULL;
 
     /* setup event function ptrs */
     if (!interp->save_func_table)
@@ -910,81 +538,12 @@
     while (interp->resume_flag & RESUME_RESTART) {
         opcode_t * const pc = (opcode_t *)
             interp->code->base.data + interp->resume_offset;
+        const runcore_runops_fn_type core = interp->run_core->runops;
 
         interp->resume_offset = 0;
         interp->resume_flag  &= ~(RESUME_RESTART | RESUME_INITIAL);
 
-        switch (interp->run_core) {
-            case PARROT_SLOW_CORE:
-                core = runops_slow_core;
-
-                if (Interp_flags_TEST(interp, PARROT_PROFILE_FLAG)) {
-                    core = runops_profile_core;
-                    if (interp->profile == NULL) {
-                        interp->profile = mem_allocate_zeroed_typed(RunProfile);
-                        interp->profile->data =
-                            mem_allocate_n_typed((interp->op_count +
-                                        PARROT_PROF_EXTRA), ProfData);
-                    }
-                }
-                break;
-            case PARROT_FAST_CORE:
-                core = runops_fast_core;
-                break;
-            case PARROT_CGOTO_CORE:
-#ifdef HAVE_COMPUTED_GOTO
-                core = runops_cgoto_core;
-#else
-                Parrot_ex_throw_from_c_args(interp, NULL, 1,
-                    "Error: PARROT_CGOTO_CORE not available");
-#endif
-                break;
-            case PARROT_CGP_CORE:
-            case PARROT_CGP_JIT_CORE:
-#ifdef HAVE_COMPUTED_GOTO
-                core = runops_cgp;
-#else
-                Parrot_ex_throw_from_c_args(interp, NULL, 1,
-                    "Error: PARROT_CGP_CORE not available");
-#endif
-                break;
-            case PARROT_SWITCH_CORE:
-            case PARROT_SWITCH_JIT_CORE:
-                core = runops_switch;
-                break;
-            case PARROT_JIT_CORE:
-#if !JIT_CAPABLE
-                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_JIT_UNAVAILABLE,
-                    "Error: PARROT_JIT_FLAG is set, "
-                    "but interpreter is not JIT_CAPABLE!\n");
-#else
-                core = runops_jit;
-#endif
-                break;
-            case PARROT_EXEC_CORE:
-#if !EXEC_CAPABLE
-                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXEC_UNAVAILABLE,
-                    "Error: PARROT_EXEC_FLAG is set, "
-                    "but interpreter is not EXEC_CAPABLE!\n");
-#else
-                core = runops_exec;
-#endif
-                break;
-            case PARROT_GC_DEBUG_CORE:
-                core = runops_gc_debug_core;
-                break;
-            case PARROT_DEBUGGER_CORE:
-                core = runops_debugger_core;
-                break;
-            default:
-                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
-                    "ambigious runcore switch used");
-                break;
-        }
-
-
-        /* run it finally */
-        core(interp, pc);
+        (*core)(interp, interp->run_core, pc);
 
         /* if we have fallen out with resume and we were running CGOTO, set
          * the stacktop again to a sane value, so that restarting the runloop
@@ -1053,10 +612,33 @@
 Parrot_runcore_destroy(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_runcore_destroy)
-    op_lib_t    *cg_lib;
+    op_lib_t         *cg_lib;
+    size_t            num_cores = interp->num_cores;
+    size_t            i;
+
+    for (i = 0; i < num_cores; ++i) {
+        Parrot_runcore_t        *core    = interp->cores[i];
+        runcore_destroy_fn_type  destroy = core->destroy;
+
+        if (destroy)
+            (*destroy)(interp, core);
+
+        mem_sys_free(core);
+    }
+
+    if (interp->cores)
+        mem_sys_free(interp->cores);
+
+    interp->cores    = NULL;
+    interp->run_core = NULL;
+
+    /* dynop libs */
+    if (interp->n_libs <= 0)
+        return;
 
 #ifdef HAVE_COMPUTED_GOTO
     cg_lib = PARROT_CORE_CGP_OPLIB_INIT(1);
+
     if (cg_lib->op_func_table)
         mem_sys_free(cg_lib->op_func_table);
     cg_lib->op_func_table = NULL;
@@ -1066,6 +648,11 @@
         mem_sys_free(cg_lib->op_func_table);
     cg_lib->op_func_table = NULL;
 #endif
+
+    mem_sys_free(interp->op_info_table);
+    mem_sys_free(interp->op_func_table);
+    interp->op_info_table = NULL;
+    interp->op_func_table = NULL;
 }
 
 
@@ -1169,7 +756,7 @@
          * if we are running a different core, entries are
          * changed below
          */
-        new_evc_func_table[i] = interp->op_func_table[CORE_OPS_check_events__];
+        new_evc_func_table[i] = new_func_table[CORE_OPS_check_events__];
     }
 
     interp->evc_func_table  = new_evc_func_table;
@@ -1287,11 +874,11 @@
         /* if not install wrappers */
         /* fill new entries with the wrapper op */
         for (i = n_old; i < n_tot; ++i)
-            ops_addr[i] = (cg_lib->op_func_table)[CORE_OPS_wrapper__];
+            ops_addr[i] = ops_addr[CORE_OPS_wrapper__];
     }
 
     /* if we are running this core, update event check ops */
-    if ((int)interp->run_core == cg_lib->core_type) {
+    if (interp->run_core->id == cg_lib->core_type) {
         size_t i;
 
         for (i = n_old; i < n_tot; ++i)
@@ -1330,7 +917,7 @@
 
 /*
 
-=item C<static void notify_func_table(PARROT_INTERP, op_func_t* table, int on)>
+=item C<static void notify_func_table(PARROT_INTERP, op_func_t *table, int on)>
 
 Tell the interpreter's running core about the new function table.
 
@@ -1339,27 +926,20 @@
 */
 
 static void
-notify_func_table(PARROT_INTERP, ARGIN(op_func_t* table), int on)
+notify_func_table(PARROT_INTERP, ARGIN(op_func_t *table), int on)
 {
     ASSERT_ARGS(notify_func_table)
     const oplib_init_f init_func = get_core_op_lib_init(interp, interp->run_core);
 
     init_func((long) table);
-    switch (interp->run_core) {
-        case PARROT_SLOW_CORE:      /* normal func core */
-        case PARROT_FAST_CORE:      /* normal func core */
-        case PARROT_CGOTO_CORE:     /* cgoto address list  */
-        case PARROT_DEBUGGER_CORE:
-            PARROT_ASSERT(table);
-            interp->op_func_table = table;
-            break;
-        case PARROT_CGP_CORE:
-        case PARROT_CGP_JIT_CORE:
-            turn_ev_check(interp, on);
-            break;
-        default:
-            break;
+
+    if (PARROT_RUNCORE_FUNC_TABLE_TEST(interp->run_core)) {
+        PARROT_ASSERT(table);
+        interp->op_func_table = table;
     }
+
+    if (PARROT_RUNCORE_EVENT_CHECK_TEST(interp->run_core))
+        turn_ev_check(interp, on);
 }
 
 

Added: branches/orderedhash_revamp/src/runcore/profiling.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/src/runcore/profiling.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,615 @@
+/*
+Copyright (C) 2009, Parrot Foundation.
+$Id$
+
+=head1 NAME
+
+src/runcore/profiling.c
+
+=head1 DESCRIPTION
+
+Functions controlling Parrot's profiling runcore.
+
+=head2 Functions
+
+=over 4
+
+=cut
+
+*/
+
+#include "parrot/runcore_api.h"
+#include "parrot/embed.h"
+#include "parrot/runcore_profiling.h"
+#include "parrot/oplib/core_ops.h"
+
+#include "profiling.str"
+
+#include "pmc/pmc_sub.h"
+#include "pmc/pmc_callcontext.h"
+#include "pmc/pmc_namespace.h"
+
+#ifdef WIN32
+#  define getpid _getpid
+#endif
+
+#define PPROF_VERSION 2
+#define MAX_NAMESPACE_DEPTH 32
+
+#define code_start interp->code->base.data
+#define code_end (interp->code->base.data + interp->code->base.size)
+
+/* HEADERIZER HFILE: include/parrot/runcore_profiling.h */
+
+/* HEADERIZER BEGIN: static */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+
+PARROT_CAN_RETURN_NULL
+static void * init_profiling_core(PARROT_INTERP,
+    ARGIN(Parrot_profiling_runcore_t *runcore),
+    ARGIN(opcode_t *pc))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
+
+static void record_values_ascii_pprof(
+    ARGIN(Parrot_profiling_runcore_t * runcore),
+    ARGIN_NULLOK(Parrot_profiling_line type))
+        __attribute__nonnull__(1);
+
+static void record_values_none(
+    ARGIN(Parrot_profiling_runcore_t * runcore),
+    ARGIN_NULLOK(Parrot_profiling_line type))
+        __attribute__nonnull__(1);
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CAN_RETURN_NULL
+static opcode_t * runops_profiling_core(PARROT_INTERP,
+    ARGIN(Parrot_profiling_runcore_t *runcore),
+    ARGIN(opcode_t *pc))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
+
+#define ASSERT_ARGS_init_profiling_core __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(runcore) \
+    , PARROT_ASSERT_ARG(pc))
+#define ASSERT_ARGS_record_values_ascii_pprof __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(runcore))
+#define ASSERT_ARGS_record_values_none __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(runcore))
+#define ASSERT_ARGS_runops_profiling_core __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(runcore) \
+    , PARROT_ASSERT_ARG(pc))
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+/* HEADERIZER END: static */
+
+
+/*
+
+=item C<void Parrot_runcore_profiling_init(PARROT_INTERP)>
+
+Registers the profiling runcore with Parrot.
+
+=cut
+
+*/
+
+void
+Parrot_runcore_profiling_init(PARROT_INTERP)
+{
+    ASSERT_ARGS(Parrot_runcore_profiling_init)
+
+    Parrot_profiling_runcore_t *coredata =
+                                 mem_allocate_typed(Parrot_profiling_runcore_t);
+
+    coredata->name        = CONST_STRING(interp, "profiling");
+    coredata->id          = PARROT_PROFILING_CORE;
+    coredata->opinit      = PARROT_CORE_OPLIB_INIT;
+    coredata->runops      = (Parrot_runcore_runops_fn_t) init_profiling_core;
+    coredata->destroy     = NULL;
+    coredata->prepare_run = NULL;
+    coredata->flags       = 0;
+
+    PARROT_RUNCORE_FUNC_TABLE_SET(coredata);
+
+    Parrot_runcore_register(interp, (Parrot_runcore_t *) coredata);
+}
+
+
+/*
+
+=item C<static void * init_profiling_core(PARROT_INTERP,
+Parrot_profiling_runcore_t *runcore, opcode_t *pc)>
+
+Perform initialization for the profiling runcore.
+
+=cut
+
+*/
+
+PARROT_CAN_RETURN_NULL
+static void *
+init_profiling_core(PARROT_INTERP, ARGIN(Parrot_profiling_runcore_t *runcore), ARGIN(opcode_t *pc))
+{
+    ASSERT_ARGS(init_profiling_core)
+
+    char *profile_filename, *output_cstr, *filename_cstr, *annotations_cstr;
+
+    /* initialize the runcore struct */
+    runcore->runops  = (Parrot_runcore_runops_fn_t)  runops_profiling_core;
+    runcore->destroy = (Parrot_runcore_destroy_fn_t) destroy_profiling_core;
+
+    runcore->prev_ctx        = NULL;
+    runcore->profiling_flags = 0;
+    runcore->runloop_count   = 0;
+    runcore->level           = 0;
+    runcore->time_size       = 32;
+    runcore->line_cache      = parrot_new_pointer_hash(interp);
+    runcore->time            = mem_allocate_n_typed(runcore->time_size,
+                                                    UHUGEINTVAL);
+
+    /* figure out what format the output should be in */
+    output_cstr = Parrot_getenv(interp, CONST_STRING(interp, "PARROT_PROFILING_OUTPUT"));
+
+    if (output_cstr) {
+
+        STRING *profile_format_str = Parrot_str_new(interp, output_cstr, 0);
+        if (Parrot_str_equal(interp, profile_format_str, CONST_STRING(interp, "pprof"))) {
+            runcore->output_fn = record_values_ascii_pprof;
+        }
+        else if (Parrot_str_equal(interp, profile_format_str, CONST_STRING(interp, "none"))) {
+            runcore->output_fn = record_values_none;
+        }
+        else {
+            fprintf(stderr, "'%s' is not a valid profiling output format.\n", output_cstr);
+            fprintf(stderr, "Valid values are pprof and none.  The default is pprof.\n");
+            exit(1);
+        }
+    }
+    else {
+        runcore->output_fn = record_values_ascii_pprof;
+    }
+
+    /* figure out where to write the output */
+    filename_cstr = Parrot_getenv(interp, CONST_STRING(interp, "PARROT_PROFILING_FILENAME"));
+
+    if (runcore->output_fn != record_values_none) {
+        if (filename_cstr) {
+            STRING  *lc_filename;
+            runcore->profile_filename = Parrot_str_new(interp, filename_cstr, 0);
+            /* this is a little goofy, but it means that we unconditionally free
+             * profile_filename later in this function */
+            profile_filename          = Parrot_str_to_cstring(interp, runcore->profile_filename);
+            lc_filename               = Parrot_str_downcase(interp, runcore->profile_filename);
+
+            if (Parrot_str_equal(interp, lc_filename, CONST_STRING(interp, "stderr"))) {
+                runcore->profile_fd       = stderr;
+                runcore->profile_filename = lc_filename;
+            }
+            else if (Parrot_str_equal(interp, lc_filename, CONST_STRING(interp, "stdout"))) {
+                runcore->profile_fd       = stdout;
+                runcore->profile_filename = lc_filename;
+            }
+            else
+                runcore->profile_fd = fopen(profile_filename, "w");
+        }
+        else {
+            runcore->profile_filename = Parrot_sprintf_c(interp, "parrot.pprof.%d", getpid());
+            profile_filename          = Parrot_str_to_cstring(interp, runcore->profile_filename);
+            runcore->profile_fd       = fopen(profile_filename, "w");
+        }
+
+        if (!runcore->profile_fd) {
+            fprintf(stderr, "unable to open %s for writing", profile_filename);
+            Parrot_str_free_cstring(profile_filename);
+            exit(1);
+        }
+
+        Parrot_str_free_cstring(profile_filename);
+    }
+    else {
+        runcore->profile_filename = CONST_STRING(interp, "none");
+    }
+
+    /* figure out if annotations are wanted */
+    annotations_cstr = Parrot_getenv(interp, CONST_STRING(interp, "PARROT_PROFILING_ANNOTATIONS"));
+
+    if (annotations_cstr) {
+        Profiling_report_annotations_SET(runcore);
+    }
+
+    /* put profile_filename in the gc root set so it won't get collected */
+    gc_register_pmc(interp, (PMC *) runcore->profile_filename);
+
+    Profiling_first_loop_SET(runcore);
+
+    return runops_profiling_core(interp, runcore, pc);
+}
+
+
+/*
+
+=item C<static opcode_t * runops_profiling_core(PARROT_INTERP,
+Parrot_profiling_runcore_t *runcore, opcode_t *pc)>
+
+Runs the Parrot operations starting at C<pc> until there are no more
+operations, with tracing, bounds checking, and profiling enabled.
+
+=cut
+
+*/
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CAN_RETURN_NULL
+static opcode_t *
+runops_profiling_core(PARROT_INTERP, ARGIN(Parrot_profiling_runcore_t *runcore),
+ARGIN(opcode_t *pc))
+{
+    ASSERT_ARGS(runops_profiling_core)
+
+    PMC                *preop_sub, *argv;
+    opcode_t           *preop_pc;
+    STRING             *unknown_file = CONST_STRING(interp, "<unknown file>");
+    UHUGEINTVAL         op_time;
+
+    runcore->runcore_start = Parrot_hires_get_time();
+
+    /* if we're in a nested runloop, */
+    if (runcore->level != 0) {
+
+        if (runcore->level >= runcore->time_size) {
+            runcore->time_size *= 2;
+            runcore->time =
+                mem_realloc_n_typed(runcore->time, runcore->time_size + 1,
+                                    UHUGEINTVAL);
+        }
+
+        /* store the time between DO_OP and the start of this runcore in this
+         * op's running total */
+        runcore->time[runcore->level] =
+             runcore->runcore_start - runcore->op_start;
+    }
+
+    argv = VTABLE_get_pmc_keyed_int(interp, interp->iglobals, IGLOBALS_ARGV_LIST);
+
+    /* argv isn't initialized until after :init (etc) subs are executed */
+    if (argv && !Profiling_have_printed_cli_TEST(runcore)) {
+
+        PMC    *iglobals     = interp->iglobals;
+        PMC    *executable   = VTABLE_get_pmc_keyed_int(interp, iglobals,
+                                                        IGLOBALS_EXECUTABLE);
+        STRING *space    = CONST_STRING(interp, " ");
+        STRING *cli_args = Parrot_str_join(interp, space, argv);
+        STRING *cli_str;
+        char   *cli_cstr;
+
+        cli_str  = Parrot_str_concat(interp, VTABLE_get_string(interp,
+                                     executable), space, 0);
+        cli_str  = Parrot_str_concat(interp, cli_str, cli_args, 0);
+        cli_cstr = Parrot_str_to_cstring(interp, cli_str);
+
+        /* CLI line won't reflect any options passed to the parrot binary. */
+        runcore->pprof_data[PPROF_DATA_CLI] = (PPROF_DATA) cli_cstr;
+        runcore->output_fn(runcore, PPROF_LINE_CLI);
+
+        Parrot_str_free_cstring(cli_cstr);
+
+        Profiling_have_printed_cli_SET(runcore);
+    }
+
+    if (Profiling_first_loop_TEST(runcore)) {
+
+        runcore->pprof_data[PPROF_DATA_VERSION] = (PPROF_DATA) PPROF_VERSION;
+        runcore->output_fn(runcore, PPROF_LINE_VERSION);
+
+        /* make all separate runloops appear to come from a single source */
+        runcore->pprof_data[PPROF_DATA_NAMESPACE] = (PPROF_DATA) "main";
+        runcore->pprof_data[PPROF_DATA_FILENAME]  = (PPROF_DATA) "no_file";
+        runcore->pprof_data[PPROF_DATA_SUB_ADDR]  = 1;
+        runcore->pprof_data[PPROF_DATA_CTX_ADDR]  = 1;
+        runcore->output_fn(runcore, PPROF_LINE_CONTEXT_SWITCH);
+
+        runcore->pprof_data[PPROF_DATA_LINE]   = runcore->runloop_count;
+        runcore->pprof_data[PPROF_DATA_TIME]   = 0;
+        runcore->pprof_data[PPROF_DATA_OPNAME] = (PPROF_DATA) "noop";
+        runcore->output_fn(runcore, PPROF_LINE_OP);
+
+        runcore->runloop_count++;
+        Profiling_first_loop_CLEAR(runcore);
+    }
+
+    while (pc) {
+        Parrot_Context *preop_ctx;
+        INTVAL          preop_line;
+        PMC            *preop_ctx_pmc;
+
+        if (pc < code_start || pc >= code_end)
+            Parrot_ex_throw_from_c_args(interp, NULL, 1,
+                    "attempt to access code outside of current code segment");
+
+        preop_ctx_pmc = CURRENT_CONTEXT(interp);
+        preop_ctx = PMC_data_typed(preop_ctx_pmc, Parrot_Context*);
+        preop_ctx->current_pc = pc;
+        preop_sub             = preop_ctx->current_sub;
+        preop_pc              = pc;
+
+        runcore->level++;
+        Profiling_exit_check_CLEAR(runcore);
+
+        runcore->op_start  = Parrot_hires_get_time();
+        DO_OP(pc, interp);
+        runcore->op_finish = Parrot_hires_get_time();
+
+        if (Profiling_exit_check_TEST(runcore)) {
+            op_time  = runcore->op_finish - runcore->runcore_finish;
+            op_time += runcore->time[runcore->level];
+            runcore->time[runcore->level] = 0;
+        }
+        else
+            op_time = runcore->op_finish - runcore->op_start;
+
+        runcore->level--;
+
+        /* if current context changed since the last printing of a CS line... */
+        /* Occasionally the ctx stays the same while the sub changes, possible
+         * with a call to a subclass' method. */
+
+        if ((runcore->prev_ctx != preop_ctx)
+        ||   runcore->prev_sub != preop_ctx->current_sub) {
+
+            if (preop_ctx->current_sub) {
+                STRING *sub_name, *full_ns, *ns_separator, *preop_filename;
+                char   *full_ns_cstr, *filename_cstr;
+                STRING *ns_names[MAX_NAMESPACE_DEPTH];
+                PMC    *ns = preop_ctx->current_namespace;
+                INTVAL  i;
+
+                preop_filename = Parrot_Sub_get_filename_from_pc(interp,
+                        Parrot_pcc_get_sub(interp, preop_ctx_pmc), pc);
+
+                filename_cstr = Parrot_str_to_cstring(interp, preop_filename);
+
+                /* build the namespace string */
+                full_ns      = Parrot_str_new(interp, "", 0);
+                ns_separator = Parrot_str_new(interp, ";", 1);
+
+                i = MAX_NAMESPACE_DEPTH - 1;
+                for (;ns ; i--) {
+                    if (i < 0) {
+                        /* should probably warn about truncated namespace here */
+                        break;
+                    }
+                    GETATTR_NameSpace_name(interp, ns, ns_names[i]);
+                    GETATTR_NameSpace_parent(interp, ns, ns);
+                }
+
+                i++;
+                i++; /* the root namespace has an empty name, so ignore it */
+                for (;i < MAX_NAMESPACE_DEPTH; i++) {
+                    full_ns = Parrot_str_concat(interp, full_ns, ns_names[i], 0);
+                    full_ns = Parrot_str_concat(interp, full_ns, ns_separator, 0);
+                }
+
+                GETATTR_Sub_name(interp, preop_ctx->current_sub, sub_name);
+                full_ns = Parrot_str_concat(interp, full_ns, sub_name, 0);
+                full_ns_cstr = Parrot_str_to_cstring(interp, full_ns);
+
+                runcore->pprof_data[PPROF_DATA_NAMESPACE] = (PPROF_DATA) full_ns_cstr;
+                runcore->pprof_data[PPROF_DATA_FILENAME]  = (PPROF_DATA) filename_cstr;
+                runcore->pprof_data[PPROF_DATA_SUB_ADDR]  = (PPROF_DATA) preop_ctx->current_sub;
+                runcore->pprof_data[PPROF_DATA_CTX_ADDR]  = (PPROF_DATA) preop_ctx;
+                runcore->output_fn(runcore, PPROF_LINE_CONTEXT_SWITCH);
+
+                Parrot_str_free_cstring(full_ns_cstr);
+                Parrot_str_free_cstring(filename_cstr);
+            }
+
+            runcore->prev_ctx = preop_ctx;
+            runcore->prev_sub = preop_ctx->current_sub;
+        }
+
+        preop_line = hash_value_to_int(interp, runcore->line_cache,
+            parrot_hash_get(interp, runcore->line_cache,
+                        preop_ctx->current_pc));
+
+        if (preop_line == 0) {
+            preop_line = Parrot_Sub_get_line_from_pc(interp,
+                    Parrot_pcc_get_sub(interp, preop_ctx_pmc),
+                    preop_ctx->current_pc);
+            parrot_hash_put(interp, runcore->line_cache, preop_ctx->current_pc,
+                            (void *) preop_line);
+        }
+
+        if (Profiling_report_annotations_TEST(runcore) && interp->code->annotations) {
+            PMC * const annot = PackFile_Annotations_lookup(interp,
+                    interp->code->annotations, pc - code_start + 1, NULL);
+
+            if (!PMC_IS_NULL(annot)) {
+
+                /* this is probably pessimal but it's just a poc at this point */
+                PMC *iter = VTABLE_get_iter(interp, annot);
+                while (VTABLE_get_bool(interp, iter)) {
+
+                    STRING *key      = VTABLE_shift_string(interp, iter);
+                    STRING *val      = VTABLE_get_string_keyed_str(interp, annot, key);
+                    char   *key_cstr = Parrot_str_to_cstring(interp, key);
+                    char   *val_cstr = Parrot_str_to_cstring(interp, val);
+
+                    runcore->pprof_data[PPROF_DATA_ANNOTATION_NAME]  = (PPROF_DATA) key_cstr;
+                    runcore->pprof_data[PPROF_DATA_ANNOTATION_VALUE] = (PPROF_DATA) val_cstr;
+                    runcore->output_fn(runcore, PPROF_LINE_ANNOTATION);
+
+                    Parrot_str_free_cstring(key_cstr);
+                    Parrot_str_free_cstring(val_cstr);
+                }
+            }
+        }
+
+        runcore->pprof_data[PPROF_DATA_LINE]   = preop_line;
+        runcore->pprof_data[PPROF_DATA_TIME]   = op_time;
+        runcore->pprof_data[PPROF_DATA_OPNAME] =
+            (PPROF_DATA)(interp->op_info_table)[*preop_pc].name;
+        runcore->output_fn(runcore, PPROF_LINE_OP);
+    }
+
+    /* make it easy to tell separate runloops apart */
+    if (runcore->level == 0) {
+        runcore->output_fn(runcore, PPROF_LINE_END_OF_RUNLOOP);
+
+        /* make all separate runloops appear to come from a single source */
+        runcore->pprof_data[PPROF_DATA_NAMESPACE] = (PPROF_DATA) "main";
+        runcore->pprof_data[PPROF_DATA_FILENAME]  = (PPROF_DATA) "no_file";
+        runcore->pprof_data[PPROF_DATA_SUB_ADDR]  = 1;
+        runcore->pprof_data[PPROF_DATA_CTX_ADDR]  = 1;
+        runcore->output_fn(runcore, PPROF_LINE_CONTEXT_SWITCH);
+
+        runcore->pprof_data[PPROF_DATA_LINE]   = runcore->runloop_count;
+        runcore->pprof_data[PPROF_DATA_TIME]   = 0;
+        runcore->pprof_data[PPROF_DATA_OPNAME] = (PPROF_DATA) "noop";
+        runcore->output_fn(runcore, PPROF_LINE_OP);
+
+        runcore->runloop_count++;
+    }
+
+    Profiling_exit_check_SET(runcore);
+    runcore->runcore_finish = Parrot_hires_get_time();;
+    return pc;
+}
+
+/*
+
+=item C<static void record_values_ascii_pprof(Parrot_profiling_runcore_t *
+runcore, Parrot_profiling_line type)>
+
+Record profiling data to a filehandle in a human-readable format.
+
+=cut
+
+*/
+
+static void
+record_values_ascii_pprof(ARGIN(Parrot_profiling_runcore_t * runcore),
+ARGIN_NULLOK(Parrot_profiling_line type))
+{
+    ASSERT_ARGS(record_values_ascii_pprof)
+
+    switch (type) {
+        case PPROF_LINE_CONTEXT_SWITCH:
+            {
+                char *pd_namespace = (char *) runcore->pprof_data[PPROF_DATA_NAMESPACE];
+                char *pd_filename  = (char *) runcore->pprof_data[PPROF_DATA_FILENAME];
+                void *sub_addr     = (void *) runcore->pprof_data[PPROF_DATA_SUB_ADDR];
+                void *ctx_addr     = (void *) runcore->pprof_data[PPROF_DATA_CTX_ADDR];
+                fprintf(runcore->profile_fd,
+                        "CS:{x{ns:%s}x}{x{file:%s}x}{x{sub:%p}x}{x{ctx:%p}x}\n",
+                        pd_namespace, pd_filename, sub_addr, ctx_addr);
+            }
+            break;
+
+        case PPROF_LINE_OP:
+            {
+                PPROF_DATA  line   = (PPROF_DATA) runcore->pprof_data[PPROF_DATA_LINE];
+                PPROF_DATA  time   = (PPROF_DATA) runcore->pprof_data[PPROF_DATA_TIME];
+                char       *opname = (char *)     runcore->pprof_data[PPROF_DATA_OPNAME];
+                fprintf(runcore->profile_fd, "OP:{x{line:%d}x}{x{time:%d}x}{x{op:%s}x}\n",
+                        (int) line, (int) time, opname);
+            }
+            break;
+
+        case PPROF_LINE_ANNOTATION:
+            {
+                char *name  = (char *) runcore->pprof_data[PPROF_DATA_ANNOTATION_NAME];
+                char *value = (char *) runcore->pprof_data[PPROF_DATA_ANNOTATION_VALUE];
+                fprintf(runcore->profile_fd, "AN:{x{name:%s}x}{x{value:%s}x}\n", name, value);
+            }
+
+        case PPROF_LINE_CLI:
+            {
+                char *cli = (char *) runcore->pprof_data[PPROF_DATA_CLI];
+                fprintf(runcore->profile_fd, "CLI: %s\n", cli);
+            }
+            break;
+
+        case PPROF_LINE_VERSION:
+            fprintf(runcore->profile_fd, "VERSION:%d\n",
+                    (int) runcore->pprof_data[PPROF_DATA_VERSION]);
+            break;
+
+        case PPROF_LINE_END_OF_RUNLOOP:
+            fprintf(runcore->profile_fd, "END_OF_RUNLOOP:1\n");
+            break;
+
+        default:
+            break;
+    } /* switch */
+}
+
+/*
+
+=item C<static void record_values_none(Parrot_profiling_runcore_t * runcore,
+Parrot_profiling_line type)>
+
+Accept data but don't actually write it anywhere.
+
+=cut
+
+*/
+
+static void
+record_values_none(ARGIN(Parrot_profiling_runcore_t * runcore),
+ARGIN_NULLOK(Parrot_profiling_line type))
+{
+    ASSERT_ARGS(record_values_none)
+    UNUSED(runcore);
+    UNUSED(type);
+}
+
+
+/*
+
+=item C<void * destroy_profiling_core(PARROT_INTERP, Parrot_profiling_runcore_t
+*runcore)>
+
+Perform any finalization needed by the profiling runcore.
+
+=cut
+
+*/
+
+PARROT_CAN_RETURN_NULL
+void *
+destroy_profiling_core(PARROT_INTERP, ARGIN(Parrot_profiling_runcore_t *runcore))
+{
+    ASSERT_ARGS(destroy_profiling_core)
+
+    char *filename_cstr = Parrot_str_to_cstring(interp, runcore->profile_filename);
+
+    fprintf(stderr, "\nPROFILING RUNCORE: wrote profile to %s\n"
+        "Use tools/dev/pprof2cg.pl to generate Callgrind-compatible "
+        "output from this file.\n", filename_cstr);
+
+    Parrot_str_free_cstring(filename_cstr);
+    parrot_hash_destroy(interp, runcore->line_cache);
+
+    if (runcore->output_fn != record_values_none)
+        fclose(runcore->profile_fd);
+    mem_sys_free(runcore->time);
+
+    return NULL;
+}
+
+/*
+
+=back
+
+*/
+
+/*
+ * Local variables:
+ *   c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */

Modified: branches/orderedhash_revamp/src/runcore/trace.c
==============================================================================
--- branches/orderedhash_revamp/src/runcore/trace.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/runcore/trace.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -25,7 +25,8 @@
 
 #include "parrot/runcore_trace.h"
 #include "parrot/oplib/ops.h"
-#include "../pmc/pmc_sub.h"
+#include "pmc/pmc_sub.h"
+#include "pmc/pmc_callcontext.h"
 
 /* HEADERIZER HFILE: include/parrot/runcore_trace.h */
 
@@ -38,9 +39,9 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-#define ASSERT_ARGS_trace_class_name __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_trace_class_name __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pmc)
+    , PARROT_ASSERT_ARG(pmc))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -105,7 +106,7 @@
 {
     ASSERT_ARGS(trace_pmc_dump)
     Interp * const debugger = debugger_or_interp(interp);
-    Parrot_sub    *sub;
+    Parrot_Sub_attributes    *sub;
 
     if (!pmc) {
         Parrot_io_eprintf(debugger, "(null)");
@@ -196,13 +197,13 @@
 
     while (key) {
         switch (PObj_get_FLAGS(key) & KEY_type_FLAGS) {
-        case KEY_integer_FLAG:
+          case KEY_integer_FLAG:
             len += Parrot_io_eprintf(debugger, "%vi", VTABLE_get_integer(interp, key));
             break;
-        case KEY_number_FLAG:
+          case KEY_number_FLAG:
             len += Parrot_io_eprintf(debugger, "%vg", VTABLE_get_number(interp, key));
             break;
-        case KEY_string_FLAG:
+          case KEY_string_FLAG:
             {
             const STRING * const s = key_string(interp, key);
             STRING* const escaped = Parrot_str_escape_truncate(
@@ -213,15 +214,15 @@
                 len += Parrot_io_eprintf(debugger, "\"(null)\"");
             }
             break;
-        case KEY_integer_FLAG|KEY_register_FLAG:
+          case KEY_integer_FLAG|KEY_register_FLAG:
             len += Parrot_io_eprintf(debugger, "I%vd=%vd", VTABLE_get_integer(interp, key),
                     REG_INT(interp, VTABLE_get_integer(interp, key)));
             break;
-        case KEY_number_FLAG|KEY_register_FLAG:
+          case KEY_number_FLAG|KEY_register_FLAG:
             len += Parrot_io_eprintf(debugger, "I%vd=%vd", VTABLE_get_integer(interp, key),
                     REG_NUM(interp, VTABLE_get_integer(interp, key)));
             break;
-        case KEY_string_FLAG|KEY_register_FLAG:
+          case KEY_string_FLAG|KEY_register_FLAG:
             {
             const STRING * const s = REG_STR(interp, VTABLE_get_integer(interp, key));
             STRING* const escaped = Parrot_str_escape_truncate(
@@ -234,18 +235,18 @@
                         VTABLE_get_integer(interp, key));
             }
             break;
-        case KEY_pmc_FLAG|KEY_register_FLAG:
+          case KEY_pmc_FLAG|KEY_register_FLAG:
             len += Parrot_io_eprintf(debugger, "P%vd=", VTABLE_get_integer(interp, key));
             trace_pmc_dump(debugger, REG_PMC(interp, VTABLE_get_integer(interp, key)));
             break;
-        default:
+          default:
             len += Parrot_io_eprintf(debugger, "??");
             key = NULL;
             break;
         }
 
         if (key) {
-            key = (PMC *)PMC_data(key);
+            key = VTABLE_shift_pmc(interp, key);
             if (key)
                 len += Parrot_io_eprintf(debugger, ";");
         }
@@ -288,21 +289,7 @@
 
     s = 1;
     len = Parrot_io_eprintf(debugger, "%6vu ", (UINTVAL)(pc - code_start));
-    if (STREQ(info->name, "infix")) {
-        /* this should rather be MMD_opcode_name, which doesn't
-         * exit yet
-         */
-        len += Parrot_io_eprintf(debugger, "%s",
-                Parrot_MMD_method_name(interp, pc[1]) + 2);
-        s = 2;
-    }
-    else if (STREQ(info->name, "n_infix")) {
-        len += Parrot_io_eprintf(debugger, "n_%s",
-                Parrot_MMD_method_name(interp, pc[1]) + 2);
-        s = 2;
-    }
-    else
-        len += Parrot_io_eprintf(debugger, "%s", info->name);
+    len += Parrot_io_eprintf(debugger, "%s", info->name);
 
     n = info->op_count;
     var_args = 0;
@@ -346,21 +333,21 @@
                 len += Parrot_io_eprintf(debugger, ", ");
             }
             switch (type) {
-                case PARROT_ARG_IC:
-                    len += Parrot_io_eprintf(debugger, "%vd", o);
-                    break;
-                case PARROT_ARG_NC:
-                    len += Parrot_io_eprintf(debugger, "%vg", PCONST(o)->u.number);
-                    break;
-                case PARROT_ARG_PC:
-                    if (var_args)
-                        len += Parrot_io_eprintf(debugger, "PC%d (%d)",
+              case PARROT_ARG_IC:
+                len += Parrot_io_eprintf(debugger, "%vd", o);
+                break;
+              case PARROT_ARG_NC:
+                len += Parrot_io_eprintf(debugger, "%vg", PCONST(o)->u.number);
+                break;
+              case PARROT_ARG_PC:
+                if (var_args)
+                    len += Parrot_io_eprintf(debugger, "PC%d (%d)",
                                 (int)o, var_args);
-                    else
-                        len += Parrot_io_eprintf(debugger, "PC%d", (int)o);
-                    break;
-                case PARROT_ARG_SC:
-                    {
+                else
+                    len += Parrot_io_eprintf(debugger, "PC%d", (int)o);
+                break;
+              case PARROT_ARG_SC:
+                {
                     STRING* const escaped = Parrot_str_escape_truncate(
                             interp,
                             PCONST(o)->u.string, 20);
@@ -368,42 +355,42 @@
                         len += Parrot_io_eprintf(debugger, "\"%Ss\"", escaped);
                     else
                         len += Parrot_io_eprintf(debugger, "\"(null)\"");
-                    }
-                    break;
-                case PARROT_ARG_KC:
-                    len += trace_key_dump(interp, PCONST(o)->u.key);
-                    break;
-                case PARROT_ARG_KIC:
-                    len += Parrot_io_eprintf(debugger, "[%vd]", o);
-                    break;
-                case PARROT_ARG_KI:
-                    len += Parrot_io_eprintf(debugger, "[I%vd]", o);
-                    more = 1;
-                    break;
-                case PARROT_ARG_K:
-                    len += Parrot_io_eprintf(debugger, "[P%vd]", o);
-                    more = 1;
-                    break;
-                case PARROT_ARG_I:
-                    len += Parrot_io_eprintf(debugger, "I%vd", o);
-                    more = 1;
-                    break;
-                case PARROT_ARG_N:
-                    len += Parrot_io_eprintf(debugger, "N%vd", o);
-                    more = 1;
-                    break;
-                case PARROT_ARG_P:
-                    len += Parrot_io_eprintf(debugger, "P%vd", o);
-                    more = 1;
-                    break;
-                case PARROT_ARG_S:
-                    len += Parrot_io_eprintf(debugger, "S%vd", o);
-                    more = 1;
-                    break;
-                default:
-                    Parrot_ex_throw_from_c_args(interp, NULL, 1,
+                }
+                break;
+              case PARROT_ARG_KC:
+                len += trace_key_dump(interp, PCONST(o)->u.key);
+                break;
+              case PARROT_ARG_KIC:
+                len += Parrot_io_eprintf(debugger, "[%vd]", o);
+                break;
+              case PARROT_ARG_KI:
+                len += Parrot_io_eprintf(debugger, "[I%vd]", o);
+                more = 1;
+                break;
+              case PARROT_ARG_K:
+                len += Parrot_io_eprintf(debugger, "[P%vd]", o);
+                more = 1;
+                break;
+              case PARROT_ARG_I:
+                len += Parrot_io_eprintf(debugger, "I%vd", o);
+                more = 1;
+                break;
+              case PARROT_ARG_N:
+                len += Parrot_io_eprintf(debugger, "N%vd", o);
+                more = 1;
+                break;
+              case PARROT_ARG_P:
+                len += Parrot_io_eprintf(debugger, "P%vd", o);
+                more = 1;
+                break;
+              case PARROT_ARG_S:
+                len += Parrot_io_eprintf(debugger, "S%vd", o);
+                more = 1;
+                break;
+              default:
+                Parrot_ex_throw_from_c_args(interp, NULL, 1,
                         "unhandled type in trace");
-                    break;
+                break;
             }
         }
         if (!more)
@@ -430,39 +417,39 @@
                 Parrot_io_eprintf(debugger, " ");
             }
             switch (type) {
-                case PARROT_ARG_I:
-                    Parrot_io_eprintf(debugger, "I%vd=%vd", o, REG_INT(interp, o));
-                    break;
-                case PARROT_ARG_N:
-                    Parrot_io_eprintf(debugger, "N%vd=%vf", o, REG_NUM(interp, o));
-                    break;
-                case PARROT_ARG_PC:
-                    Parrot_io_eprintf(debugger, "PC%vd=", o);
-                    trace_pmc_dump(interp, PCONST(o)->u.key);
-                    break;
-                case PARROT_ARG_P:
-                    Parrot_io_eprintf(debugger, "P%vd=", o);
-                    trace_pmc_dump(interp, REG_PMC(interp, o));
-                    break;
-                case PARROT_ARG_S:
-                    if (REG_STR(interp, o)) {
-                        STRING* const escaped = Parrot_str_escape_truncate(
+              case PARROT_ARG_I:
+                Parrot_io_eprintf(debugger, "I%vd=%vd", o, REG_INT(interp, o));
+                break;
+              case PARROT_ARG_N:
+                Parrot_io_eprintf(debugger, "N%vd=%vf", o, REG_NUM(interp, o));
+                break;
+              case PARROT_ARG_PC:
+                Parrot_io_eprintf(debugger, "PC%vd=", o);
+                trace_pmc_dump(interp, PCONST(o)->u.key);
+                break;
+              case PARROT_ARG_P:
+                Parrot_io_eprintf(debugger, "P%vd=", o);
+                trace_pmc_dump(interp, REG_PMC(interp, o));
+                break;
+              case PARROT_ARG_S:
+                if (REG_STR(interp, o)) {
+                    STRING* const escaped = Parrot_str_escape_truncate(
                                 interp, REG_STR(interp, o), 20);
-                        Parrot_io_eprintf(debugger, "S%vd=\"%Ss\"", o,
+                    Parrot_io_eprintf(debugger, "S%vd=\"%Ss\"", o,
                                 escaped);
-                    }
-                    else
-                        Parrot_io_eprintf(debugger, "S%vd=\"(null)\"", o);
-                    break;
-                case PARROT_ARG_K:
-                    Parrot_io_eprintf(debugger, "P%vd=", o);
-                    trace_key_dump(interp, REG_PMC(interp, *(pc + i)));
-                    break;
-                case PARROT_ARG_KI:
-                    Parrot_io_eprintf(debugger, "I%vd=[%vd]", o, REG_INT(interp, o));
-                    break;
-                default:
-                    break;
+                }
+                else
+                    Parrot_io_eprintf(debugger, "S%vd=\"(null)\"", o);
+                break;
+              case PARROT_ARG_K:
+                Parrot_io_eprintf(debugger, "P%vd=", o);
+                trace_key_dump(interp, REG_PMC(interp, *(pc + i)));
+                break;
+              case PARROT_ARG_KI:
+                Parrot_io_eprintf(debugger, "I%vd=[%vd]", o, REG_INT(interp, o));
+                break;
+              default:
+                break;
             }
         }
     }

Modified: branches/orderedhash_revamp/src/scheduler.c
==============================================================================
--- branches/orderedhash_revamp/src/scheduler.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/scheduler.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -44,12 +44,12 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*scheduler);
 
-#define ASSERT_ARGS_scheduler_process_messages __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_scheduler_process_messages __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(scheduler)
-#define ASSERT_ARGS_scheduler_process_wait_list __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(scheduler))
+#define ASSERT_ARGS_scheduler_process_wait_list __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(scheduler)
+    , PARROT_ASSERT_ARG(scheduler))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -140,8 +140,8 @@
                 PMC * const handler = Parrot_cx_find_handler_for_task(interp, task);
                 if (!PMC_IS_NULL(handler)) {
                     PMC * const handler_sub = VTABLE_get_attr_str(interp, handler, CONST_STRING(interp, "code"));
-                    Parrot_runops_fromc_args_event(interp, handler_sub,
-                            "vPP", handler, task);
+                    Parrot_pcc_invoke_sub_from_c_args(interp, handler_sub,
+                            "PP->", handler, task);
                 }
             }
             else {
@@ -482,10 +482,10 @@
 Parrot_cx_add_handler_local(PARROT_INTERP, ARGIN(PMC *handler))
 {
     ASSERT_ARGS(Parrot_cx_add_handler_local)
-    if (PMC_IS_NULL(CONTEXT(interp)->handlers))
-        CONTEXT(interp)->handlers = pmc_new(interp, enum_class_ResizablePMCArray);
+    if (PMC_IS_NULL(Parrot_pcc_get_handlers(interp, interp->ctx)))
+        Parrot_pcc_set_handlers(interp, interp->ctx, pmc_new(interp, enum_class_ResizablePMCArray));
 
-    VTABLE_unshift_pmc(interp, CONTEXT(interp)->handlers, handler);
+    VTABLE_unshift_pmc(interp, Parrot_pcc_get_handlers(interp, interp->ctx), handler);
 
 }
 
@@ -506,7 +506,7 @@
 Parrot_cx_delete_handler_local(PARROT_INTERP, ARGIN(STRING *handler_type))
 {
     ASSERT_ARGS(Parrot_cx_delete_handler_local)
-    PMC *handlers  = CONTEXT(interp)->handlers;
+    PMC *handlers  = Parrot_pcc_get_handlers(interp, interp->ctx);
 
     if (PMC_IS_NULL(handlers))
         Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
@@ -536,20 +536,20 @@
             PMC *handler = VTABLE_get_pmc_keyed_int(interp, handlers, index);
             if (!PMC_IS_NULL(handler)) {
                 switch (htype) {
-                    case Hexception:
-                        if (VTABLE_isa(interp, handler, handler_name)) {
-                            VTABLE_set_pmc_keyed_int(interp, handlers, index, PMCNULL);
-                            return;
-                        }
-                        break;
-                    case Hevent:
-                        if (handler->vtable->base_type == enum_class_EventHandler) {
-                            VTABLE_set_pmc_keyed_int(interp, handlers, index, PMCNULL);
-                            return;
-                        }
-                        break;
-                    default:
-                        break;
+                  case Hexception:
+                    if (VTABLE_isa(interp, handler, handler_name)) {
+                        VTABLE_set_pmc_keyed_int(interp, handlers, index, PMCNULL);
+                        return;
+                    }
+                    break;
+                  case Hevent:
+                    if (handler->vtable->base_type == enum_class_EventHandler) {
+                        VTABLE_set_pmc_keyed_int(interp, handlers, index, PMCNULL);
+                        return;
+                    }
+                    break;
+                  default:
+                    break;
                 }
             }
         }
@@ -577,7 +577,7 @@
 Parrot_cx_count_handlers_local(PARROT_INTERP, ARGIN(STRING *handler_type))
 {
     ASSERT_ARGS(Parrot_cx_count_handlers_local)
-    PMC *handlers = CONTEXT(interp)->handlers;
+    PMC *handlers = Parrot_pcc_get_handlers(interp, interp->ctx);
     INTVAL elements;
 
     if (PMC_IS_NULL(handlers))
@@ -610,16 +610,16 @@
             PMC *handler = VTABLE_get_pmc_keyed_int(interp, handlers, index);
             if (!PMC_IS_NULL(handler)) {
                 switch (htype) {
-                case Hexception:
-                        if (VTABLE_isa(interp, handler, handler_name))
-                            count++;
-                        break;
-                    case Hevent:
-                        if (handler->vtable->base_type == enum_class_EventHandler)
-                            count++;
-                        break;
-                    default:
-                        break;
+                  case Hexception:
+                    if (VTABLE_isa(interp, handler, handler_name))
+                        count++;
+                    break;
+                  case Hevent:
+                    if (handler->vtable->base_type == enum_class_EventHandler)
+                        count++;
+                    break;
+                  default:
+                    break;
                 }
             }
         }
@@ -648,7 +648,7 @@
         Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
             "Scheduler was not initialized for this interpreter.\n");
 
-    Parrot_PCCINVOKE(interp, interp->scheduler, add_handler, "P->", handler);
+    Parrot_pcc_invoke_method_from_c_args(interp, interp->scheduler, add_handler, "P->", handler);
 }
 
 /*
@@ -672,7 +672,7 @@
         Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
             "Scheduler was not initialized for this interpreter.\n");
 
-    Parrot_PCCINVOKE(interp, interp->scheduler, CONST_STRING(interp, "delete_handler"), "S->", handler_type);
+    Parrot_pcc_invoke_method_from_c_args(interp, interp->scheduler, CONST_STRING(interp, "delete_handler"), "S->", handler_type);
 }
 
 /*
@@ -698,7 +698,7 @@
         Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
             "Scheduler was not initialized for this interpreter.\n");
 
-    Parrot_PCCINVOKE(interp, interp->scheduler, CONST_STRING(interp, "count_handlers"), "S->I", handler_type, &count);
+    Parrot_pcc_invoke_method_from_c_args(interp, interp->scheduler, CONST_STRING(interp, "count_handlers"), "S->I", handler_type, &count);
 
     return count;
 }
@@ -816,7 +816,7 @@
         Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
             "Scheduler was not initialized for this interpreter.\n");
 
-    Parrot_PCCINVOKE(interp, interp->scheduler, CONST_STRING(interp, "find_handler"), "P->P", task, &handler);
+    Parrot_pcc_invoke_method_from_c_args(interp, interp->scheduler, CONST_STRING(interp, "find_handler"), "P->P", task, &handler);
 
 #if CX_DEBUG
     fprintf(stderr, "done searching for handler\n");
@@ -849,9 +849,9 @@
      * for a handler
      */
     static int already_doing = 0;
-    static Parrot_Context * keep_context = NULL;
+    static PMC * keep_context = NULL;
 
-    Parrot_Context *context;
+    PMC            *context;
     PMC            *iter        = PMCNULL;
     STRING * const  handled_str = CONST_STRING(interp, "handled");
     STRING * const  iter_str    = CONST_STRING(interp, "handler_iter");
@@ -865,30 +865,28 @@
          * Note that we are now trying to handle the new exception,
          * not the initial task argument (exception or whatever).
          */
-        context = keep_context->caller_ctx;
+        context = Parrot_pcc_get_caller_ctx(interp, keep_context);
         keep_context = NULL;
-        if (context && !PMC_IS_NULL(context->handlers))
-            iter = VTABLE_get_iter(interp, context->handlers);
+        if (context && !PMC_IS_NULL(Parrot_pcc_get_handlers(interp, context)))
+            iter = VTABLE_get_iter(interp, Parrot_pcc_get_handlers(interp, context));
         else
             iter = PMCNULL;
     }
     else {
+        ++already_doing;
 
-    ++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
-    && VTABLE_get_integer_keyed_str(interp, task, handled_str) == -1) {
-        iter    = VTABLE_get_attr_str(interp, task, iter_str);
-        context = (Parrot_Context *)VTABLE_get_pointer(interp, task);
-    }
-    else {
-        context = CONTEXT(interp);
-        if (!PMC_IS_NULL(context->handlers))
-            iter = VTABLE_get_iter(interp, context->handlers);
-    }
-
+        /* Exceptions store the handler iterator for rethrow, other kinds of
+         * tasks don't (though they could). */
+        if (task->vtable->base_type == enum_class_Exception
+        && VTABLE_get_integer_keyed_str(interp, task, handled_str) == -1) {
+            iter    = VTABLE_get_attr_str(interp, task, iter_str);
+            context = (PMC *)VTABLE_get_pointer(interp, task);
+        }
+        else {
+            context = CURRENT_CONTEXT(interp);
+            if (!PMC_IS_NULL(Parrot_pcc_get_handlers(interp, context)))
+                iter = VTABLE_get_iter(interp, Parrot_pcc_get_handlers(interp, context));
+        }
     }
 
     while (context) {
@@ -899,7 +897,11 @@
 
             if (!PMC_IS_NULL(handler)) {
                 INTVAL valid_handler = 0;
-                Parrot_PCCINVOKE(interp, handler, CONST_STRING(interp, "can_handle"),
+                if (handler->vtable->base_type == enum_class_Object)
+                    Parrot_pcc_invoke_method_from_c_args(interp, handler, CONST_STRING(interp, "can_handle"),
+                        "P->I", task, &valid_handler);
+                else
+                    Parrot_pcc_invoke_method_from_c_args(interp, handler, CONST_STRING(interp, "can_handle"),
                         "P->I", task, &valid_handler);
 
                 if (valid_handler) {
@@ -916,9 +918,9 @@
         }
 
         /* Continue the search in the next context up the chain. */
-        context = context->caller_ctx;
-        if (context && !PMC_IS_NULL(context->handlers))
-            iter = VTABLE_get_iter(interp, context->handlers);
+        context = Parrot_pcc_get_caller_ctx(interp, context);
+        if (context && !PMC_IS_NULL(Parrot_pcc_get_handlers(interp, context)))
+            iter = VTABLE_get_iter(interp, Parrot_pcc_get_handlers(interp, context));
         else
             iter = PMCNULL;
     }
@@ -950,8 +952,8 @@
                     Parrot_floatval_time());
 #endif
     if (!PMC_IS_NULL(timer_struct->codeblock)) {
-        Parrot_runops_fromc_args_event(interp,
-                timer_struct->codeblock, "v");
+        Parrot_pcc_invoke_sub_from_c_args(interp,
+                timer_struct->codeblock, "->");
     }
 }
 

Modified: branches/orderedhash_revamp/src/spf_render.c
==============================================================================
--- branches/orderedhash_revamp/src/spf_render.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/spf_render.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -22,7 +22,6 @@
 #define IN_SPF_SYSTEM
 
 #include "parrot/parrot.h"
-#include "parrot/string_funcs.h"
 #include "spf_render.str"
 
 typedef enum {
@@ -90,18 +89,18 @@
         FUNC_MODIFIES(*dest)
         FUNC_MODIFIES(*src);
 
-#define ASSERT_ARGS_gen_sprintf_call __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_gen_sprintf_call __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(out) \
-    || PARROT_ASSERT_ARG(info)
-#define ASSERT_ARGS_handle_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(info))
+#define ASSERT_ARGS_handle_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(info) \
-    || PARROT_ASSERT_ARG(str)
-#define ASSERT_ARGS_str_append_w_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(info) \
+    , PARROT_ASSERT_ARG(str))
+#define ASSERT_ARGS_str_append_w_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(dest) \
-    || PARROT_ASSERT_ARG(info) \
-    || PARROT_ASSERT_ARG(src)
+    , PARROT_ASSERT_ARG(dest) \
+    , PARROT_ASSERT_ARG(info) \
+    , PARROT_ASSERT_ARG(src))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -469,49 +468,49 @@
                     switch (info.phase) {
                     /*@fallthrough@ */ case PHASE_FLAGS:
                         switch (ch) {
-                        case '-':
+                          case '-':
                             info.flags |= FLAG_MINUS;
                             continue;
 
-                        case '+':
+                          case '+':
                             info.flags |= FLAG_PLUS;
                             continue;
 
-                        case '0':
+                          case '0':
                             info.flags |= FLAG_ZERO;
                             continue;
 
-                        case ' ':
+                          case ' ':
                             info.flags |= FLAG_SPACE;
                             continue;
 
-                        case '#':
+                          case '#':
                             info.flags |= FLAG_SHARP;
                             continue;
 
-                        default:
+                          default:
                             info.phase = PHASE_WIDTH;
                         }
 
 
                     /*@fallthrough@ */ case PHASE_WIDTH:
                         switch (ch) {
-                        case '0':
-                        case '1':
-                        case '2':
-                        case '3':
-                        case '4':
-                        case '5':
-                        case '6':
-                        case '7':
-                        case '8':
-                        case '9':
+                          case '0':
+                          case '1':
+                          case '2':
+                          case '3':
+                          case '4':
+                          case '5':
+                          case '6':
+                          case '7':
+                          case '8':
+                          case '9':
                             info.flags |= FLAG_WIDTH;
                             info.width *= 10;
                             info.width += ch - '0';
                             continue;
 
-                        case '*':
+                          case '*':
                             info.flags |= FLAG_WIDTH;
                             num = obj->getint(interp, SIZE_XVAL, obj);
                             if (num < 0) {
@@ -523,75 +522,75 @@
                             }
                             continue;
 
-                        case '.':
+                          case '.':
                             info.phase = PHASE_PREC;
                             continue;
 
-                        default:
+                          default:
                             info.phase = PHASE_PREC;
                         }
 
 
                     /*@fallthrough@ */ case PHASE_PREC:
                         switch (ch) {
-                        case '0':
-                        case '1':
-                        case '2':
-                        case '3':
-                        case '4':
-                        case '5':
-                        case '6':
-                        case '7':
-                        case '8':
-                        case '9':
+                          case '0':
+                          case '1':
+                          case '2':
+                          case '3':
+                          case '4':
+                          case '5':
+                          case '6':
+                          case '7':
+                          case '8':
+                          case '9':
                             info.flags |= FLAG_PREC;
                             info.prec *= 10;
                             info.prec += ch - '0';
                             continue;
 
-                        case '*':
+                          case '*':
                             info.flags |= FLAG_PREC;
                             info.prec = (UINTVAL)obj->getint(interp,
                                                      SIZE_XVAL, obj);
                             info.phase = PHASE_TYPE;
                             continue;
 
-                        default:
+                          default:
                             info.phase = PHASE_TYPE;
                         }
 
                     /*@fallthrough@ */ case PHASE_TYPE:
                         switch (ch) {
-                        case 'h':
+                          case 'h':
                             info.type = SIZE_SHORT;
                             continue;
 
-                        case 'l':
+                          case 'l':
                             info.type = SIZE_LONG;
                             continue;
 
-                        case 'L':
-                        case 'H':
+                          case 'L':
+                          case 'H':
                             info.type = SIZE_HUGE;
                             continue;
 
-                        case 'v':
+                          case 'v':
                             info.type = SIZE_XVAL;
                             continue;
 
-                        case 'O':
+                          case 'O':
                             info.type = SIZE_OPCODE;
                             continue;
 
-                        case 'P':
+                          case 'P':
                             info.type = SIZE_PMC;
                             continue;
 
-                        case 'S':
+                          case 'S':
                             info.type = SIZE_PSTR;
                             continue;
 
-                        default:
+                          default:
                             info.phase = PHASE_TERM;
                         }
 
@@ -599,7 +598,7 @@
                     /*@fallthrough@ */ case PHASE_TERM:
                         switch (ch) {
                             /* INTEGERS */
-                        case 'c':
+                          case 'c':
                             {
                             STRING * const ts = string_chr(interp,
                                  (UINTVAL)obj->getint(interp, info.type, obj));
@@ -607,7 +606,7 @@
                             }
                             break;
 
-                        case 'o':
+                          case 'o':
                             {
                             const UHUGEINTVAL theuint =
                                 obj->getuint(interp, info.type, obj);
@@ -622,7 +621,7 @@
                             }
                             break;
 
-                        case 'x':
+                          case 'x':
                             {
                             const UHUGEINTVAL theuint =
                                 obj->getuint(interp, info.type, obj);
@@ -637,7 +636,7 @@
                             }
                             break;
 
-                        case 'X':
+                          case 'X':
                             {
                             STRING * const prefix = CONST_STRING(interp, "0X");
                             const UHUGEINTVAL theuint =
@@ -653,7 +652,7 @@
                             }
                             break;
 
-                        case 'b':
+                          case 'b':
                             {
                             STRING * const prefix = CONST_STRING(interp, "0b");
                             const UHUGEINTVAL theuint =
@@ -668,7 +667,7 @@
                             }
                             break;
 
-                        case 'B':
+                          case 'B':
                             {
                             STRING * const prefix = CONST_STRING(interp, "0B");
                             const HUGEINTVAL theint =
@@ -683,15 +682,15 @@
                             }
                             break;
 
-                        case 'u':
+                          case 'u':
                             {
                             const UHUGEINTVAL theuint =
                                 obj->getuint(interp, info.type, obj);
                             sharedint = theuint;
                             }
                             goto do_sprintf;
-                        case 'd':
-                        case 'i':
+                          case 'd':
+                          case 'i':
 
                             /* EVIL: Work around bug in glibc that makes %0lld
                              * sometimes output an empty string. */
@@ -699,7 +698,7 @@
                                 info.flags &= ~FLAG_ZERO;
 
                             sharedint = obj->getint(interp, info.type, obj);
-                        do_sprintf:
+                          do_sprintf:
                             {
                             STRING *ts;
                             gen_sprintf_call(tc, &info, ch);
@@ -721,7 +720,7 @@
                             }
                             break;
 
-                        case 'p':
+                          case 'p':
                             {
                             STRING * const prefix = CONST_STRING(interp, "0x");
                             const void * const ptr =
@@ -735,11 +734,11 @@
                             break;
 
                             /* FLOATS - We cheat on these and use snprintf. */
-                        case 'e':
-                        case 'E':
-                        case 'f':
-                        case 'g':
-                        case 'G':
+                          case 'e':
+                          case 'E':
+                          case 'f':
+                          case 'g':
+                          case 'G':
                             {
                             STRING *ts;
                             const HUGEFLOATVAL thefloat =
@@ -822,7 +821,7 @@
                             break;
 
                             /* STRINGS */
-                        case 'r':        /* Python repr */
+                          case 'r':        /* Python repr */
                             /* XXX the right fix is to add a getrepr entry *
                              * to SPRINTF_OBJ, but for now, getstring_pmc  *
                              * is inlined and modified to call get_repr    */
@@ -841,7 +840,7 @@
                                 break;
                             }
 
-                        case 's':
+                          case 's':
                           CASE_s:
                             {
                             STRING * const string = obj->getstring(interp,
@@ -855,7 +854,7 @@
                             }
                             break;
 
-                        default:
+                          default:
                             /* fake the old %P and %S commands */
                             if (info.type == SIZE_PMC
                              || info.type == SIZE_PSTR) {
@@ -875,8 +874,8 @@
                         info.phase = PHASE_DONE;
                         break;
 
-                    case PHASE_DONE:
-                    default:
+                      case PHASE_DONE:
+                      default:
                         /* This is the terminating condition of the surrounding
                          * loop, so...
                          */

Modified: branches/orderedhash_revamp/src/spf_vtable.c
==============================================================================
--- branches/orderedhash_revamp/src/spf_vtable.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/spf_vtable.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -121,41 +121,41 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(3);
 
-#define ASSERT_ARGS_getchr_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_getchr_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(obj)
-#define ASSERT_ARGS_getchr_va __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(obj))
+#define ASSERT_ARGS_getchr_va __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(obj)
-#define ASSERT_ARGS_getfloat_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(obj))
+#define ASSERT_ARGS_getfloat_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(obj)
-#define ASSERT_ARGS_getfloat_va __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(obj))
+#define ASSERT_ARGS_getfloat_va __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(obj)
-#define ASSERT_ARGS_getint_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(obj))
+#define ASSERT_ARGS_getint_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(obj)
-#define ASSERT_ARGS_getint_va __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(obj))
+#define ASSERT_ARGS_getint_va __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(obj)
-#define ASSERT_ARGS_getptr_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(obj))
+#define ASSERT_ARGS_getptr_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(obj)
-#define ASSERT_ARGS_getptr_va __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(obj)
-#define ASSERT_ARGS_getstring_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(obj))
+#define ASSERT_ARGS_getptr_va __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(obj))
+#define ASSERT_ARGS_getstring_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(obj)
-#define ASSERT_ARGS_getstring_va __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(obj))
+#define ASSERT_ARGS_getstring_va __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(obj)
-#define ASSERT_ARGS_getuint_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(obj))
+#define ASSERT_ARGS_getuint_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(obj)
-#define ASSERT_ARGS_getuint_va __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(obj))
+#define ASSERT_ARGS_getuint_va __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(obj)
+    , PARROT_ASSERT_ARG(obj))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -209,30 +209,32 @@
     va_list * const arg = (va_list *)(obj->data);
 
     switch (size) {
-    case SIZE_REG:
+      case SIZE_REG:
         return va_arg(*arg, int);
 
-    case SIZE_SHORT:
+      case SIZE_SHORT:
         /* "'short int' is promoted to 'int' when passed through '...'" */
         return (short)va_arg(*arg, int);
 
-    case SIZE_LONG:
+      case SIZE_LONG:
         return va_arg(*arg, long);
 
-    case SIZE_HUGE:
+      case SIZE_HUGE:
         return va_arg(*arg, HUGEINTVAL);
 
-    case SIZE_XVAL:
+      case SIZE_XVAL:
         return va_arg(*arg, INTVAL);
 
-    case SIZE_OPCODE:
+      case SIZE_OPCODE:
         return va_arg(*arg, opcode_t);
 
-    case SIZE_PMC:{
+      case SIZE_PMC:
+        {
             PMC * const pmc = (PMC *)va_arg(*arg, PMC *);
             return VTABLE_get_integer(interp, pmc);
         }
-    default:
+
+      default:
         PANIC(interp, "Invalid int type!");
     }
 }
@@ -260,30 +262,32 @@
     va_list * const arg = (va_list *)(obj->data);
 
     switch (size) {
-    case SIZE_REG:
+      case SIZE_REG:
         return va_arg(*arg, unsigned int);
 
-    case SIZE_SHORT:
+      case SIZE_SHORT:
         /* short int promoted HLAGHLAGHLAGH. See note above */
         return (unsigned short)va_arg(*arg, unsigned int);
 
-    case SIZE_LONG:
+      case SIZE_LONG:
         return va_arg(*arg, unsigned long);
 
-    case SIZE_HUGE:
+      case SIZE_HUGE:
         return va_arg(*arg, UHUGEINTVAL);
 
-    case SIZE_XVAL:
+      case SIZE_XVAL:
         return va_arg(*arg, UINTVAL);
 
-    case SIZE_OPCODE:
+      case SIZE_OPCODE:
         return va_arg(*arg, opcode_t);
 
-    case SIZE_PMC:{
+      case SIZE_PMC:
+        {
             PMC * const pmc = va_arg(*arg, PMC *);
             return (UINTVAL)VTABLE_get_integer(interp, pmc);
         }
-    default:
+
+      default:
         PANIC(interp, "Invalid uint type!");
     }
 }
@@ -311,25 +315,27 @@
     va_list * const arg = (va_list *)(obj->data);
 
     switch (size) {
-    case SIZE_SHORT:
+      case SIZE_SHORT:
         /* float is promoted to double */
         return (HUGEFLOATVAL)(float)va_arg(*arg, double);
 
-    case SIZE_REG:
+      case SIZE_REG:
         return (HUGEFLOATVAL)(double)va_arg(*arg, double);
 
-    case SIZE_HUGE:
+      case SIZE_HUGE:
         return (HUGEFLOATVAL)(HUGEFLOATVAL) va_arg(*arg, HUGEFLOATVAL);
 
-    case SIZE_XVAL:
+      case SIZE_XVAL:
         return (HUGEFLOATVAL)(FLOATVAL) va_arg(*arg, FLOATVAL);
 
-    case SIZE_PMC:{
+      case SIZE_PMC:
+        {
             PMC * const pmc = (PMC *)va_arg(*arg, PMC *);
 
             return (HUGEFLOATVAL)(VTABLE_get_number(interp, pmc));
         }
-    default:
+
+      default:
         Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_CHARACTER,
             "Internal sprintf doesn't recognize size %d for a float", size);
     }
@@ -476,14 +482,14 @@
     ret = VTABLE_get_integer(interp, tmp);
 
     switch (size) {
-    case SIZE_SHORT:
+      case SIZE_SHORT:
         ret = (short)ret;
         break;
         /* case SIZE_REG: ret=(HUGEINTVAL)(int)ret; break; */
-    case SIZE_LONG:
+      case SIZE_LONG:
         ret = (long)ret;
         break;
-    default:
+      default:
         /* nothing */ ;
     }
 
@@ -516,14 +522,14 @@
     ret = (UINTVAL)VTABLE_get_integer(interp, tmp);
 
     switch (size) {
-    case SIZE_SHORT:
+      case SIZE_SHORT:
         ret = (unsigned short)ret;
         break;
         /* case SIZE_REG: * ret=(UHUGEINTVAL)(unsigned int)ret; * break; */
-    case SIZE_LONG:
+      case SIZE_LONG:
         ret = (unsigned long)ret;
         break;
-    default:
+      default:
         /* nothing */ ;
     }
 

Deleted: branches/orderedhash_revamp/src/stacks.c
==============================================================================
--- branches/orderedhash_revamp/src/stacks.c	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,618 +0,0 @@
-/*
-Copyright (C) 2001-2009, Parrot Foundation.
-$Id$
-
-=head1 NAME
-
-src/stacks.c - Stack handling routines for Parrot
-
-=head1 DESCRIPTION
-
-The stack is stored as a linked list of chunks (C<Stack_Chunk>),
-where each chunk has room for one entry.
-
-=head2 Functions
-
-=over 4
-
-=cut
-
-*/
-
-#include "parrot/parrot.h"
-#include "parrot/stacks.h"
-#include "stacks.str"
-
-/* HEADERIZER HFILE: include/parrot/stacks.h */
-
-/* HEADERIZER BEGIN: static */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-
-static void run_cleanup_action(PARROT_INTERP, ARGIN(Stack_Entry_t *e))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-#define ASSERT_ARGS_run_cleanup_action __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(e)
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: static */
-
-/*
-
-=item C<void stack_system_init(PARROT_INTERP)>
-
-Called from C<make_interpreter()> to initialize the interpreter's
-register stacks.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-stack_system_init(SHIM_INTERP)
-{
-    ASSERT_ARGS(stack_system_init)
-}
-
-/*
-
-=item C<Stack_Chunk_t * cst_new_stack_chunk(PARROT_INTERP, const Stack_Chunk_t
-*chunk)>
-
-Get a new chunk either from the freelist or allocate one.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-Stack_Chunk_t *
-cst_new_stack_chunk(PARROT_INTERP, ARGIN(const Stack_Chunk_t *chunk))
-{
-    ASSERT_ARGS(cst_new_stack_chunk)
-    Stack_Chunk_t * const new_chunk =
-        (Stack_Chunk_t *)Parrot_gc_new_bufferlike_header(interp, sizeof (Stack_Chunk_t));
-
-    PObj_bufstart(new_chunk) = NULL;
-    PObj_buflen(new_chunk)   = 0;
-
-    new_chunk->name          = chunk->name;
-
-    return new_chunk;
-}
-
-/*
-
-=item C<Stack_Chunk_t * new_stack(PARROT_INTERP, const char *name)>
-
-Create a new stack and name it. C<< stack->name >> is used for
-debugging/error reporting.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_CANNOT_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-Stack_Chunk_t *
-new_stack(PARROT_INTERP, ARGIN(const char *name))
-{
-    ASSERT_ARGS(new_stack)
-    Stack_Chunk_t * const chunk =
-        (Stack_Chunk_t *)Parrot_gc_new_bufferlike_header(interp, sizeof (Stack_Chunk_t));
-
-    chunk->prev = chunk;        /* mark the top of the stack */
-    chunk->name = name;
-
-    return chunk;
-}
-
-
-/*
-
-=item C<void mark_stack(PARROT_INTERP, Stack_Chunk_t *chunk)>
-
-Mark entries in a stack structure during GC.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-mark_stack(PARROT_INTERP, ARGMOD(Stack_Chunk_t *chunk))
-{
-    ASSERT_ARGS(mark_stack)
-    for (; ; chunk = chunk->prev) {
-        Stack_Entry_t  *entry;
-
-        Parrot_gc_mark_PObj_alive(interp, (PObj *)chunk);
-
-        if (chunk == chunk->prev)
-            break;
-
-        entry = STACK_DATAP(chunk);
-
-        if (entry->entry_type == STACK_ENTRY_PMC && UVal_pmc(entry->entry))
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)UVal_pmc(entry->entry));
-    }
-}
-
-/*
-
-=item C<size_t stack_height(PARROT_INTERP, const Stack_Chunk_t *chunk)>
-
-Returns the height of the stack. The maximum "depth" is height - 1.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-size_t
-stack_height(SHIM_INTERP, ARGIN(const Stack_Chunk_t *chunk))
-{
-    ASSERT_ARGS(stack_height)
-    size_t height = 0;
-
-    for (; ; chunk = chunk->prev) {
-        if (chunk == chunk->prev)
-            break;
-        ++height;
-    }
-
-    return height;
-}
-
-
-/*
-
-=item C<Stack_Entry_t * stack_entry(PARROT_INTERP, Stack_Chunk_t *stack, INTVAL
-depth)>
-
-If C<< depth >= 0 >>, return the entry at that depth from the top of the
-stack, with 0 being the top entry. If C<depth < 0>, then return the
-entry C<|depth|> entries from the bottom of the stack. Returns C<NULL>
-if C<|depth| > number> of entries in stack.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_CAN_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-Stack_Entry_t *
-stack_entry(SHIM_INTERP, ARGIN(Stack_Chunk_t *stack), INTVAL depth)
-{
-    ASSERT_ARGS(stack_entry)
-    Stack_Chunk_t *chunk;
-    size_t         offset = (size_t)depth;
-
-    if (depth < 0)
-        return NULL;
-
-    /* Start at top */
-    chunk = stack;
-
-    while (offset) {
-        if (chunk == chunk->prev)
-            break;
-        --offset;
-        chunk = chunk->prev;
-    }
-
-    if (chunk == chunk->prev)
-        return NULL;
-
-    return STACK_DATAP(chunk);
-}
-
-/*
-
-=item C<Stack_Entry_t* stack_prepare_push(PARROT_INTERP, Stack_Chunk_t
-**stack_p)>
-
-Return a pointer, where new entries go for push.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-Stack_Entry_t*
-stack_prepare_push(PARROT_INTERP, ARGMOD(Stack_Chunk_t **stack_p))
-{
-    ASSERT_ARGS(stack_prepare_push)
-    Stack_Chunk_t * const chunk     = *stack_p;
-    Stack_Chunk_t * const new_chunk = cst_new_stack_chunk(interp, chunk);
-
-    new_chunk->prev = chunk;
-    *stack_p        = new_chunk;
-
-    return STACK_DATAP(new_chunk);
-}
-
-/*
-
-=item C<void stack_push(PARROT_INTERP, Stack_Chunk_t **stack_p, void *thing,
-Stack_entry_type type, Stack_cleanup_method cleanup)>
-
-Push something on the generic stack.
-
-Note that the cleanup pointer, if non-C<NULL>, points to a routine
-that'll be called when the entry is removed from the stack. This is
-handy for those cases where you need some sort of activity to take place
-when an entry is removed, such as when you push a lexical lock onto the
-call stack, or localize (or tempify, or whatever we're calling it)
-variable or something.
-
-*/
-
-PARROT_EXPORT
-void
-stack_push(PARROT_INTERP, ARGMOD(Stack_Chunk_t **stack_p),
-           ARGIN(void *thing), Stack_entry_type type, NULLOK(Stack_cleanup_method cleanup))
-{
-    ASSERT_ARGS(stack_push)
-    Stack_Entry_t * const entry = (Stack_Entry_t *)stack_prepare_push(interp, stack_p);
-
-    /* Remember the type */
-    entry->entry_type = type;
-
-    /* Remember the cleanup function */
-    entry->cleanup = cleanup;
-
-    /* Store our thing */
-    switch (type) {
-        case STACK_ENTRY_MARK:
-            UVal_int(entry->entry) = *(INTVAL *)thing;
-            break;
-        case STACK_ENTRY_DESTINATION:
-            UVal_ptr(entry->entry) = thing;
-            break;
-        case STACK_ENTRY_ACTION:
-        case STACK_ENTRY_PMC:
-            UVal_pmc(entry->entry) = (PMC *)thing;
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, ERROR_BAD_STACK_TYPE,
-                "Invalid Stack_Entry_type!");
-    }
-}
-
-/*
-
-=item C<Stack_Entry_t* stack_prepare_pop(PARROT_INTERP, Stack_Chunk_t
-**stack_p)>
-
-Return a pointer, where new entries are popped off.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-Stack_Entry_t*
-stack_prepare_pop(PARROT_INTERP, ARGMOD(Stack_Chunk_t **stack_p))
-{
-    ASSERT_ARGS(stack_prepare_pop)
-    Stack_Chunk_t * const chunk = *stack_p;
-
-    /* the first entry (initial top) refers to itself */
-    if (chunk == chunk->prev)
-        Parrot_ex_throw_from_c_args(interp, NULL, ERROR_STACK_EMPTY,
-            "No entries on %s Stack!", chunk->name);
-
-    *stack_p = chunk->prev;
-
-    return STACK_DATAP(chunk);
-}
-
-/*
-
-=item C<void * stack_pop(PARROT_INTERP, Stack_Chunk_t **stack_p, void *where,
-Stack_entry_type type)>
-
-Pop off an entry and return a pointer to the contents.
-
-*/
-
-PARROT_EXPORT
-PARROT_CAN_RETURN_NULL
-void *
-stack_pop(PARROT_INTERP, ARGMOD(Stack_Chunk_t **stack_p),
-          ARGOUT_NULLOK(void *where), Stack_entry_type type)
-{
-    ASSERT_ARGS(stack_pop)
-    Stack_Chunk_t * const cur_chunk = *stack_p;
-    Stack_Entry_t * const entry =
-        (Stack_Entry_t *)stack_prepare_pop(interp, stack_p);
-
-    /* Types of 0 mean we don't care */
-    if (type && entry->entry_type != type)
-        Parrot_ex_throw_from_c_args(interp, NULL, ERROR_BAD_STACK_TYPE,
-            "Wrong type on top of stack!\n");
-
-    /* Cleanup routine? */
-    if (entry->cleanup != STACK_CLEANUP_NULL)
-        (*entry->cleanup) (interp, entry);
-
-    /* Sometimes the caller cares what the value was */
-    if (where) {
-        /* Snag the value */
-        switch (type) {
-        case STACK_ENTRY_MARK:
-            *(INTVAL *)where   = UVal_int(entry->entry);
-            break;
-        case STACK_ENTRY_DESTINATION:
-            *(void **)where    = UVal_ptr(entry->entry);
-            break;
-        case STACK_ENTRY_ACTION:
-        case STACK_ENTRY_PMC:
-            *(PMC **)where     = UVal_pmc(entry->entry);
-            break;
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, ERROR_BAD_STACK_TYPE,
-                "Wrong type on top of stack!\n");
-        }
-    }
-
-    /* recycle this chunk to the free list if it's otherwise unreferenced */
-    if (cur_chunk->refcount <= 0)
-        Parrot_gc_free_bufferlike_header(interp, (PObj *)cur_chunk, sizeof (Stack_Chunk_t));
-
-    return where;
-}
-
-/*
-
-=item C<void * pop_dest(PARROT_INTERP)>
-
-Pop off a destination entry and return a pointer to the contents.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-void *
-pop_dest(PARROT_INTERP)
-{
-    ASSERT_ARGS(pop_dest)
-    /* We don't mind the extra call, so we do this: (previous comment
-     * said we *do* mind, but I say let the compiler decide) */
-    void *dest;
-    (void)stack_pop(interp, &interp->dynamic_env,
-                    &dest, STACK_ENTRY_DESTINATION);
-    return dest;
-}
-
-/*
-
-=item C<void * stack_peek(PARROT_INTERP, Stack_Chunk_t *stack_base,
-Stack_entry_type *type)>
-
-Peek at stack and return pointer to entry and the type of the entry.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_CAN_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-void *
-stack_peek(PARROT_INTERP, ARGIN(Stack_Chunk_t *stack_base),
-           ARGMOD_NULLOK(Stack_entry_type *type))
-{
-    ASSERT_ARGS(stack_peek)
-    const Stack_Entry_t * const entry = stack_entry(interp, stack_base, 0);
-    if (entry == NULL)
-        return NULL;
-
-    if (type != NULL)
-        *type = entry->entry_type;
-
-    if (entry->entry_type == STACK_ENTRY_DESTINATION)
-        return UVal_ptr(entry->entry);
-
-    return (void *) UVal_pmc(entry->entry);
-}
-
-/*
-
-=item C<Stack_entry_type get_entry_type(const Stack_Entry_t *entry)>
-
-Returns the stack entry type of C<entry>.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_PURE_FUNCTION
-Stack_entry_type
-get_entry_type(ARGIN(const Stack_Entry_t *entry))
-{
-    ASSERT_ARGS(get_entry_type)
-    return entry->entry_type;
-}
-
-/*
-
-=item C<void Parrot_dump_dynamic_environment(PARROT_INTERP, Stack_Chunk_t
-*dynamic_env)>
-
-Print a representation of the dynamic stack to the standard error (using
-C<Parrot_io_eprintf>).  This is used only temporarily for debugging.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-Parrot_dump_dynamic_environment(PARROT_INTERP, ARGIN(Stack_Chunk_t *dynamic_env))
-{
-    ASSERT_ARGS(Parrot_dump_dynamic_environment)
-    int height = (int) stack_height(interp, dynamic_env);
-
-    while (dynamic_env->prev != dynamic_env) {
-        const Stack_Entry_t * const e = stack_entry(interp, dynamic_env, 0);
-
-        if (! e)
-            Parrot_ex_throw_from_c_args(interp, NULL, 1, "Dynamic environment stack damaged");
-
-        Parrot_io_eprintf(interp, "[%4d:  chunk %p entry %p "
-                                 "type %d cleanup %p]\n",
-                    height, dynamic_env, e,
-                    e->entry_type, e->cleanup);
-        if (e->entry_type == STACK_ENTRY_PMC
-                || e->entry_type == STACK_ENTRY_ACTION) {
-            PMC * const thing = UVal_pmc(e->entry);
-
-            Parrot_io_eprintf(interp, "[        PMC %p type %d => %Ss]\n",
-                        thing, thing->vtable->base_type,
-                        VTABLE_get_string(interp, thing));
-        }
-        else if (e->entry_type == STACK_ENTRY_MARK) {
-            Parrot_io_eprintf(interp, "[        mark %d]\n",
-                        UVal_int(e->entry));
-        }
-        dynamic_env = dynamic_env->prev;
-        height--;
-    }
-    Parrot_io_eprintf(interp, "[%4d:  chunk %p %s base]\n",
-                height, dynamic_env, dynamic_env->name);
-}
-
-
-/*
-
-=item C<static void run_cleanup_action(PARROT_INTERP, Stack_Entry_t *e)>
-
-Runs the sub PMC from the Stack_Entry_t pointer with an INTVAL arg of 0.  Used
-in C<Parrot_push_action>.
-
-=cut
-
-*/
-
-static void
-run_cleanup_action(PARROT_INTERP, ARGIN(Stack_Entry_t *e))
-{
-    ASSERT_ARGS(run_cleanup_action)
-    /*
-     * this is called during normal stack_pop of the control
-     * stack - run the action subroutine with an INTVAL arg of 0
-     */
-    PMC * const sub = UVal_pmc(e->entry);
-    Parrot_runops_fromc_args(interp, sub, "vI", 0);
-}
-
-/*
-
-=item C<void Parrot_push_action(PARROT_INTERP, PMC *sub)>
-
-Pushes an action handler onto the dynamic environment.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-Parrot_push_action(PARROT_INTERP, ARGIN(PMC *sub))
-{
-    ASSERT_ARGS(Parrot_push_action)
-    if (!VTABLE_isa(interp, sub, CONST_STRING(interp, "Sub")))
-        Parrot_ex_throw_from_c_args(interp, NULL, 1,
-            "Tried to push a non Sub PMC action");
-
-    stack_push(interp, &interp->dynamic_env, sub,
-               STACK_ENTRY_ACTION, run_cleanup_action);
-}
-
-/*
-
-=item C<void Parrot_push_mark(PARROT_INTERP, INTVAL mark)>
-
-Push a cleanup mark onto the dynamic environment.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-Parrot_push_mark(PARROT_INTERP, INTVAL mark)
-{
-    ASSERT_ARGS(Parrot_push_mark)
-    stack_push(interp, &interp->dynamic_env, &mark,
-               STACK_ENTRY_MARK, STACK_CLEANUP_NULL);
-}
-
-/*
-
-=item C<void Parrot_pop_mark(PARROT_INTERP, INTVAL mark)>
-
-Pop items off the dynamic environment up to the mark.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-Parrot_pop_mark(PARROT_INTERP, INTVAL mark)
-{
-    ASSERT_ARGS(Parrot_pop_mark)
-    do {
-        const Stack_Entry_t * const e
-            = stack_entry(interp, interp->dynamic_env, 0);
-        if (!e)
-            Parrot_ex_throw_from_c_args(interp, NULL, 1, "Mark %ld not found.",
-                (long)mark);
-
-        (void)stack_pop(interp, &interp->dynamic_env,
-                        NULL, e->entry_type);
-        if (e->entry_type == STACK_ENTRY_MARK) {
-            if (UVal_int(e->entry) == mark)
-                return;
-        }
-    } while (1);
-}
-
-
-/*
-
-=back
-
-=head1 SEE ALSO
-
-F<include/parrot/stacks.h> and F<include/parrot/enums.h>.
-
-=cut
-
-*/
-
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Modified: branches/orderedhash_revamp/src/string/api.c
==============================================================================
--- branches/orderedhash_revamp/src/string/api.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/string/api.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -24,11 +24,12 @@
 */
 
 #include "parrot/parrot.h"
-#include "parrot/compiler.h"
-#include "parrot/string_funcs.h"
 #include "private_cstring.h"
 #include "api.str"
 
+/* for parrot/interpreter.h */
+STRING *STRINGNULL;
+
 #define nonnull_encoding_name(s) (s) ? (s)->encoding->name : "null string"
 #define saneify_string(s) \
     PARROT_ASSERT((s)->encoding); \
@@ -48,12 +49,46 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*s);
 
-#define ASSERT_ARGS_make_writable __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+PARROT_INLINE
+PARROT_WARN_UNUSED_RESULT
+PARROT_CAN_RETURN_NULL
+static const CHARSET * string_rep_compatible(SHIM_INTERP,
+    ARGIN(const STRING *a),
+    ARGIN(const STRING *b),
+    ARGOUT(const ENCODING **e))
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4)
+        FUNC_MODIFIES(*e);
+
+#define ASSERT_ARGS_make_writable __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s)
+    , PARROT_ASSERT_ARG(s))
+#define ASSERT_ARGS_string_rep_compatible __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(a) \
+    , PARROT_ASSERT_ARG(b) \
+    , PARROT_ASSERT_ARG(e))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
+/*
+
+=item C<INTVAL STRING_is_null(PARROT_INTERP, const STRING *s)>
+
+Tests if the given STRING is STRINGNULL.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+INTVAL
+STRING_is_null(SHIM_INTERP, ARGIN_NULLOK(const STRING *s))
+{
+    ASSERT_ARGS(STRING_is_null)
+    return !s || s == STRINGNULL;
+}
+
 
 /*
 
@@ -89,16 +124,16 @@
          * also be sure not to allocate from the constant pool
          */
         PObj_flags_CLEARALL(&for_alloc);
-        Parrot_gc_allocate_string_storage(interp, &for_alloc, PObj_buflen(s));
+        Parrot_gc_allocate_string_storage(interp, &for_alloc, Buffer_buflen(s));
 
         /* now copy memory over */
         mem_sys_memcopy(for_alloc.strstart, s->strstart, s->bufused);
 
         /* and finally use that string memory */
 
-        PObj_bufstart(s) = PObj_bufstart(&for_alloc);
+        Buffer_bufstart(s) = Buffer_bufstart(&for_alloc);
         s->strstart      = for_alloc.strstart;
-        PObj_buflen(s)   = PObj_buflen(&for_alloc);
+        Buffer_buflen(s)   = Buffer_buflen(&for_alloc);
 
         /* COW_FLAG | external_FLAG */
         PObj_is_external_CLEARALL(s);
@@ -148,7 +183,7 @@
         /* XXX FIXME hack to avoid cross-interpreter issue until it
          * is fixed correctly. */
         if (n_interpreters > 1 && PObj_is_movable_TESTALL(s) &&
-                !Parrot_gc_ptr_in_memory_pool(interp, PObj_bufstart(s))) {
+                !Parrot_gc_ptr_in_memory_pool(interp, Buffer_bufstart(s))) {
             Parrot_str_write_COW(interp, d);
             Parrot_io_eprintf(interp, "cross-interpreter copy of "
                                      "relocatable string '%Ss' into tid %d\n",
@@ -214,11 +249,6 @@
         return dest;
     if (dest) { /* && dest != src */
         /* they are different, dest is not an external string */
-#ifdef GC_IS_MALLOC
-        if (!PObj_is_cowed_TESTALL(dest) && PObj_bufstart(dest)) {
-            mem_sys_free(PObj_bufallocstart(dest));
-        }
-#endif
         dest = Parrot_str_reuse_COW(interp, src, dest);
     }
     else
@@ -229,27 +259,6 @@
 
 /*
 
-=item C<void Parrot_str_free(PARROT_INTERP, STRING *s)>
-
-Frees the given STRING's header, accounting for reference counts for the
-STRING's buffer &c.  Use this only if you I<know> that nothing else has stored
-the STRING elsewhere.
-
-This function has been deprecated.
-
-=cut
-
-*/
-
-void
-Parrot_str_free(PARROT_INTERP, ARGIN(STRING *s))
-{
-    ASSERT_ARGS(Parrot_str_free)
-    Parrot_gc_free_string_header(interp, s);
-}
-
-/*
-
 =back
 
 =head2 Basic String Functions
@@ -284,7 +293,6 @@
         Parrot_srand(Parrot_intval_time());
         interp->hash_seed = Parrot_uint_rand(0);
     }
-
     /* initialize the constant string table */
     if (interp->parent_interpreter) {
         interp->const_cstring_table =
@@ -299,6 +307,11 @@
     interp->const_cstring_hash  = const_cstring_hash;
     Parrot_charsets_encodings_init(interp);
 
+    /* initialize STRINGNULL, but not in the constant table */
+    STRINGNULL = Parrot_str_new_init(interp, NULL, 0,
+                       PARROT_DEFAULT_ENCODING, PARROT_DEFAULT_CHARSET,
+                       PObj_constant_FLAG);
+
     interp->const_cstring_table =
         mem_allocate_n_zeroed_typed(n_parrot_cstrings, STRING *);
 
@@ -359,7 +372,7 @@
 {
     ASSERT_ARGS(string_capacity)
 
-    return ((ptrcast_t)PObj_bufstart(s) + PObj_buflen(s) -
+    return ((ptrcast_t)Buffer_bufstart(s) + Buffer_buflen(s) -
             (ptrcast_t)s->strstart);
 }
 
@@ -399,8 +412,8 @@
 
 /*
 
-=item C<const CHARSET * string_rep_compatible(PARROT_INTERP, const STRING *a,
-const STRING *b, const ENCODING **e)>
+=item C<static const CHARSET * string_rep_compatible(PARROT_INTERP, const STRING
+*a, const STRING *b, const ENCODING **e)>
 
 Find the "lowest" possible charset and encoding for the given string. E.g.
 
@@ -413,10 +426,10 @@
 
 */
 
-PARROT_EXPORT
+PARROT_INLINE
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
-const CHARSET *
+static const CHARSET *
 string_rep_compatible(SHIM_INTERP,
     ARGIN(const STRING *a), ARGIN(const STRING *b), ARGOUT(const ENCODING **e))
 {
@@ -427,8 +440,8 @@
     }
 
     /* a table could possibly simplify the logic */
-    if (a->encoding == Parrot_utf8_encoding_ptr &&
-            b->charset == Parrot_ascii_charset_ptr) {
+    if (a->encoding == Parrot_utf8_encoding_ptr
+    &&  b->charset == Parrot_ascii_charset_ptr) {
         if (a->strlen == a->bufused) {
             *e = Parrot_fixed_8_encoding_ptr;
             return b->charset;
@@ -436,8 +449,9 @@
         *e = a->encoding;
         return a->charset;
     }
-    if (b->encoding == Parrot_utf8_encoding_ptr &&
-            a->charset == Parrot_ascii_charset_ptr) {
+
+    if (b->encoding == Parrot_utf8_encoding_ptr
+    &&  a->charset == Parrot_ascii_charset_ptr) {
         if (b->strlen == b->bufused) {
             *e = Parrot_fixed_8_encoding_ptr;
             return a->charset;
@@ -445,11 +459,15 @@
         *e = b->encoding;
         return b->charset;
     }
+
     if (a->encoding != b->encoding)
         return NULL;
+
     if (a->encoding != Parrot_fixed_8_encoding_ptr)
         return NULL;
+
     *e = Parrot_fixed_8_encoding_ptr;
+
     if (a->charset == b->charset)
         return a->charset;
     if (b->charset == Parrot_ascii_charset_ptr)
@@ -460,9 +478,11 @@
         return a->charset;
     if (b->charset == Parrot_binary_charset_ptr)
         return b->charset;
+
     return NULL;
 }
 
+
 /*
 
 =item C<STRING * Parrot_str_concat(PARROT_INTERP, STRING *a, STRING *b, UINTVAL
@@ -485,8 +505,8 @@
             ARGIN_NULLOK(STRING *b), UINTVAL Uflags)
 {
     ASSERT_ARGS(Parrot_str_concat)
-    if (a != NULL && a->strlen != 0) {
-        if (b != NULL && b->strlen != 0) {
+    if (a && a->strlen) {
+        if (b && b->strlen) {
             const ENCODING *enc;
             const CHARSET  *cs = string_rep_compatible(interp, a, b, &enc);
             STRING         *result;
@@ -545,7 +565,7 @@
         return a;
 
     /* Is A real? */
-    if (a == NULL || PObj_bufstart(a) == NULL)
+    if (a == NULL || Buffer_bufstart(a) == NULL)
         return Parrot_str_copy(interp, b);
 
     saneify_string(a);
@@ -557,6 +577,7 @@
         return Parrot_str_concat(interp, a, b, 0);
 
     cs = string_rep_compatible(interp, a, b, &enc);
+
     if (cs) {
         a->charset  = cs;
         a->encoding = enc;
@@ -627,6 +648,45 @@
                                      point? */
 }
 
+
+/*
+
+=item C<STRING * Parrot_str_new_from_buffer(PARROT_INTERP, Buffer *buffer, const
+UINTVAL len)>
+
+Make a Parrot string from a Buffer.
+
+The Buffer is nulled afterwards - only one PObj can point at a given string pool object.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_WARN_UNUSED_RESULT
+PARROT_MALLOC
+PARROT_CANNOT_RETURN_NULL
+STRING *
+Parrot_str_new_from_buffer(PARROT_INTERP, ARGMOD(Buffer *buffer), const UINTVAL len)
+{
+    ASSERT_ARGS(Parrot_str_new_from_buffer)
+    STRING *result;
+
+    result = Parrot_gc_new_string_header(interp, 0);
+    Buffer_bufstart(result) = Buffer_bufstart(buffer);
+    Buffer_buflen(result)   = Buffer_buflen(buffer);
+    result->strstart        = (char *) Buffer_bufstart(result);
+    result->bufused         = len;
+    result->strlen          = len;
+    result->encoding        = Parrot_fixed_8_encoding_ptr;
+    result->charset         = Parrot_binary_charset_ptr;
+
+    Buffer_bufstart(buffer) = NULL;
+    Buffer_buflen(buffer)   = 0;
+
+    return result;
+}
+
 /*
 
 =item C<const char* string_primary_encoding_for_representation(PARROT_INTERP,
@@ -827,8 +887,8 @@
            it was safe by setting PObj_external_FLAG.
            (The cast is necessary to pacify TenDRA's tcc.)
            */
-        PObj_bufstart(s) = s->strstart = PARROT_const_cast(char *, buffer);
-        PObj_buflen(s)   = s->bufused  = len;
+        Buffer_bufstart(s) = s->strstart = PARROT_const_cast(char *, buffer);
+        Buffer_buflen(s)   = s->bufused  = len;
 
         if (encoding == Parrot_fixed_8_encoding_ptr)
             s->strlen = len;
@@ -876,7 +936,7 @@
 
     /* Don't check buflen, if we are here, we already checked. */
     Parrot_gc_reallocate_string_storage(interp,
-        s, PObj_buflen(s) + string_max_bytes(interp, s, addlen));
+        s, Buffer_buflen(s) + string_max_bytes(interp, s, addlen));
     return s;
 }
 
@@ -900,11 +960,11 @@
 PARROT_EXPORT
 PARROT_PURE_FUNCTION
 UINTVAL
-Parrot_str_byte_length(SHIM_INTERP, ARGIN(const STRING *s))
+Parrot_str_byte_length(SHIM_INTERP, ARGIN_NULLOK(const STRING *s))
 {
     ASSERT_ARGS(Parrot_str_byte_length)
 
-    return s->strlen;
+    return s ? s->strlen : 0;
 }
 
 
@@ -1349,7 +1409,7 @@
     diff = (end_byte - start_byte) - rep->bufused;
 
     if (diff >= 0
-    || ((INTVAL)src->bufused - (INTVAL)PObj_buflen(src)) <= diff) {
+    || ((INTVAL)src->bufused - (INTVAL)Buffer_buflen(src)) <= diff) {
         Parrot_str_write_COW(interp, src);
 
         if (diff != 0) {
@@ -2115,45 +2175,45 @@
                 break;
 
             switch (state) {
-                case parse_start:
-                    if (isdigit((unsigned char)c)) {
-                        const INTVAL nextval = c - '0';
-                        if (i < max_safe || (i == max_safe && nextval <= last_dig))
-                            i = i * 10 + nextval;
-                        else
-                            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ERR_OVERFLOW,
-                                "Integer value of String '%S' too big", s);
-                        state = parse_before_dot;
-                    }
-                    else if (c == '-') {
-                        sign      = -1;
-                        state = parse_before_dot;
-                    }
-                    else if (c == '+')
-                        state = parse_before_dot;
-                    else if (isspace((unsigned char)c))
-                        ; /* Do nothing */
+              case parse_start:
+                if (isdigit((unsigned char)c)) {
+                    const INTVAL nextval = c - '0';
+                    if (i < max_safe || (i == max_safe && nextval <= last_dig))
+                        i = i * 10 + nextval;
                     else
-                        state = parse_end;
+                        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ERR_OVERFLOW,
+                                "Integer value of String '%S' too big", s);
+                    state = parse_before_dot;
+                }
+                else if (c == '-') {
+                    sign      = -1;
+                    state = parse_before_dot;
+                }
+                else if (c == '+')
+                    state = parse_before_dot;
+                else if (isspace((unsigned char)c))
+                    ; /* Do nothing */
+                else
+                    state = parse_end;
 
-                    break;
+                break;
 
-                case parse_before_dot:
-                    if (isdigit((unsigned char)c)) {
-                        const INTVAL nextval = c - '0';
-                        if (i < max_safe || (i == max_safe && nextval <= last_dig))
-                            i = i * 10 + nextval;
-                        else
-                            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ERR_OVERFLOW,
-                                "Integer value of String '%S' too big", s);
-                    }
+              case parse_before_dot:
+                if (isdigit((unsigned char)c)) {
+                    const INTVAL nextval = c - '0';
+                    if (i < max_safe || (i == max_safe && nextval <= last_dig))
+                        i = i * 10 + nextval;
                     else
-                        state = parse_end;
-                    break;
+                        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ERR_OVERFLOW,
+                                "Integer value of String '%S' too big", s);
+                }
+                else
+                    state = parse_end;
+                break;
 
-                default:
-                    /* Pacify compiler */
-                    break;
+              default:
+                /* Pacify compiler */
+                break;
             }
         }
 
@@ -2210,100 +2270,100 @@
             break;
 
         switch (state) {
-            case parse_start:
-                if (isdigit((unsigned char)c)) {
-                    f = c - '0';
-                    m = c - '0';
-                    state = parse_before_dot;
-                }
-                else if (c == '-') {
-                    sign = -1.0;
-                    state = parse_before_dot;
-                }
-                else if (c == '+')
-                    state = parse_before_dot;
-                else if (c == '.')
-                    state = parse_after_dot;
-                else if (isspace((unsigned char)c))
-                    ; /* Do nothing */
-                else {
-                    check_nan = 1;
-                    state     = parse_end;
-                }
-                break;
+          case parse_start:
+            if (isdigit((unsigned char)c)) {
+                f = c - '0';
+                m = c - '0';
+                state = parse_before_dot;
+            }
+            else if (c == '-') {
+                sign = -1.0;
+                state = parse_before_dot;
+            }
+            else if (c == '+')
+                state = parse_before_dot;
+            else if (c == '.')
+                state = parse_after_dot;
+            else if (isspace((unsigned char)c))
+                ; /* Do nothing */
+            else {
+                check_nan = 1;
+                state     = parse_end;
+            }
+            break;
 
-            case parse_before_dot:
-                if (isdigit((unsigned char)c)) {
-                    f = f*10.0 + (c-'0');
-                    m = m*10 + (c-'0');
-                    /* Integer overflow for mantissa */
-                    if (m >= max_safe)
-                        m_is_safe = 0;
-                }
-                else if (c == '.') {
-                    state = parse_after_dot;
-                    /*
-                     * Throw gathered result. Recalulate from integer mantissa
-                     * to preserve precision.
-                     */
-                    if (m_is_safe)
-                        f = m;
-                    mantissa = f;
-                }
-                else if (c == 'e' || c == 'E') {
-                    state = parse_after_e;
-                    /* See comment above */
-                    if (m_is_safe)
-                        f = m;
-                    mantissa = f;
-                }
-                else {
-                    check_nan = 1;
-                    state     = parse_end;
-                }
-                break;
+          case parse_before_dot:
+            if (isdigit((unsigned char)c)) {
+                f = f*10.0 + (c-'0');
+                m = m*10 + (c-'0');
+                /* Integer overflow for mantissa */
+                if (m >= max_safe)
+                    m_is_safe = 0;
+            }
+            else if (c == '.') {
+                state = parse_after_dot;
+                /*
+                 * Throw gathered result. Recalulate from integer mantissa
+                 * to preserve precision.
+                 */
+                if (m_is_safe)
+                    f = m;
+                mantissa = f;
+            }
+            else if (c == 'e' || c == 'E') {
+                state = parse_after_e;
+                /* See comment above */
+                if (m_is_safe)
+                    f = m;
+                mantissa = f;
+            }
+            else {
+                check_nan = 1;
+                state     = parse_end;
+            }
+            break;
 
-            case parse_after_dot:
-                if (isdigit((unsigned char)c)) {
-                    f += (c-'0') * divider;
-                    divider /= 10.0;
-                    d = d*10 + (c-'0');
-                    if (d >= max_safe)
-                        d_is_safe = 0;
-                    d_length++;
-                }
-                else if (c == 'e' || c == 'E')
-                    state = parse_after_e;
-                else
-                    state = parse_end;
-                break;
+          case parse_after_dot:
+            if (isdigit((unsigned char)c)) {
+                f += (c-'0') * divider;
+                divider /= 10.0;
+                d = d*10 + (c-'0');
+                if (d >= max_safe)
+                    d_is_safe = 0;
+                d_length++;
+            }
+            else if (c == 'e' || c == 'E')
+                state = parse_after_e;
+            else
+                state = parse_end;
+            break;
 
-            case parse_after_e:
-                if (isdigit((unsigned char)c)) {
-                    e = e*10 + (c-'0');
-                    state = parse_after_e_sign;
-                }
-                else if (c == '-') {
-                    e_sign = -1;
-                    state = parse_after_e_sign;
-                }
-                else if (c == '+')
-                    state = parse_after_e_sign;
-                else
-                    state = parse_end;
-                break;
+          case parse_after_e:
+            if (isdigit((unsigned char)c)) {
+                e = e*10 + (c-'0');
+                state = parse_after_e_sign;
+            }
+            else if (c == '-') {
+                e_sign = -1;
+                state = parse_after_e_sign;
+            }
+            else if (c == '+')
+                state = parse_after_e_sign;
+            else
+                state = parse_end;
+            break;
 
-            case parse_after_e_sign:
-                if (isdigit((unsigned char)c))
-                    e = e*10 + (c-'0');
-                else
-                    state = parse_end;
-                break;
+          case parse_after_e_sign:
+            if (isdigit((unsigned char)c))
+                e = e*10 + (c-'0');
+            else
+                state = parse_end;
+            break;
 
-            case parse_end:
-            default:
-                /* Pacify compiler */
-                break;
+          case parse_end:
+          default:
+            /* Pacify compiler */
+            break;
         }
     }
 
@@ -2323,12 +2383,12 @@
             return 0.0;
     }
 
-/* local macro to call proper pow version depending on FLOATVAL */
-#if NUMVAL_SIZE == DOUBLE_SIZE
+/* powl() could be used here, but it is an optional POSIX extension that
+   needs to be checked for at Configure-time.
+
+   See https://trac.parrot.org/parrot/ticket/1176 for more details. */
+
 #  define POW pow
-#else
-#  define POW powl
-#endif
 
      if (d && d_is_safe) {
         f = mantissa + (1.0 * d / POW(10.0, d_length));
@@ -2500,11 +2560,11 @@
      */
     Parrot_str_write_COW(interp, s);
 
-    size   = PObj_buflen(s);
+    size   = Buffer_buflen(s);
     memory = (char *)mem_sys_allocate(size);
 
-    mem_sys_memcopy(memory, PObj_bufstart(s), size);
-    PObj_bufstart(s) = memory;
+    mem_sys_memcopy(memory, Buffer_bufstart(s), size);
+    Buffer_bufstart(s) = memory;
     s->strstart      = memory;
 
     /* Mark the memory as both from the system and immobile */
@@ -2537,10 +2597,10 @@
         return;
 
     Parrot_str_write_COW(interp, s);
-    size = PObj_buflen(s);
+    size = Buffer_buflen(s);
 
     /* We need a handle on the fixed memory so we can get rid of it later */
-    memory = PObj_bufstart(s);
+    memory = Buffer_bufstart(s);
 
     /* Reallocate it the same size
      * NOTE can't use Parrot_gc_reallocate_string_storage because of the LEA
@@ -2551,7 +2611,7 @@
     Parrot_block_GC_sweep(interp);
     Parrot_gc_allocate_string_storage(interp, s, size);
     Parrot_unblock_GC_sweep(interp);
-    mem_sys_memcopy(PObj_bufstart(s), memory, size);
+    mem_sys_memcopy(Buffer_bufstart(s), memory, size);
 
     /* Mark the memory as neither immobile nor system allocated */
     PObj_sysmem_CLEAR(s);
@@ -2684,43 +2744,43 @@
                 dp = (unsigned char *)result->strstart;
             }
             switch (c) {
-                case '\\':
-                    dp[i++] = '\\';
-                    break;
-                case '\a':
-                    dp[i++] = '\\';
-                    c = 'a';
-                    break;
-                case '\b':
-                    dp[i++] = '\\';
-                    c = 'b';
-                    break;
-                case '\n':
-                    dp[i++] = '\\';
-                    c = 'n';
-                    break;
-                case '\r':
-                    dp[i++] = '\\';
-                    c = 'r';
-                    break;
-                case '\t':
-                    dp[i++] = '\\';
-                    c = 't';
-                    break;
-                case '\f':
-                    dp[i++] = '\\';
-                    c = 'f';
-                    break;
-                case '"':
-                    dp[i++] = '\\';
-                    c = '"';
-                    break;
-                case 27:
-                    dp[i++] = '\\';
-                    c = 'e';
-                    break;
-                default:
-                    break;
+              case '\\':
+                dp[i++] = '\\';
+                break;
+              case '\a':
+                dp[i++] = '\\';
+                c = 'a';
+                break;
+              case '\b':
+                dp[i++] = '\\';
+                c = 'b';
+                break;
+              case '\n':
+                dp[i++] = '\\';
+                c = 'n';
+                break;
+              case '\r':
+                dp[i++] = '\\';
+                c = 'r';
+                break;
+              case '\t':
+                dp[i++] = '\\';
+                c = 't';
+                break;
+              case '\f':
+                dp[i++] = '\\';
+                c = 'f';
+                break;
+              case '"':
+                dp[i++] = '\\';
+                c = '"';
+                break;
+              case 27:
+                dp[i++] = '\\';
+                c = 'e';
+                break;
+              default:
+                break;
             }
             if (c >= 0x20) {
                 dp[i++]         = (unsigned char)c;
@@ -2743,7 +2803,7 @@
         i += hex->strlen;
 
         /* and usable len */
-        charlen = PObj_buflen(result);
+        charlen = Buffer_buflen(result);
         dp      = (unsigned char *)result->strstart;
 
         PARROT_ASSERT(i <= charlen);
@@ -2780,14 +2840,20 @@
     ARGIN(const char *cstring), char delimiter, ARGIN_NULLOK(const char *enc_char))
 {
     ASSERT_ARGS(Parrot_str_unescape)
-    size_t          clength = strlen(cstring);
-    Parrot_UInt4    r;
-    String_iter     iter;
+
     STRING         *result;
-    const ENCODING *encoding;
     const CHARSET  *charset;
-    char           *p;
+    const ENCODING *encoding = NULL;
+
+    /* the default encoding is ascii */
+    const char     *enc_name = enc_char ? enc_char : "ascii";
+
+    /* does the encoding have a character set? */
+    const char     *p        = enc_char ? strchr(enc_char, ':') : NULL;
+    size_t          clength  = strlen(cstring);
+    String_iter     iter;
     UINTVAL         offs, d;
+    Parrot_UInt4    r;
 
     /* we are constructing const table strings here */
     const UINTVAL   flags = PObj_constant_FLAG;
@@ -2795,16 +2861,17 @@
     if (delimiter && clength)
         --clength;
 
-    /* default is ascii */
-    if (!enc_char)
-        enc_char = "ascii";
-
-    /* check for encoding: */
-    p = strchr(enc_char, ':');
-
     if (p) {
-        *p       = '\0';
-        encoding = Parrot_find_encoding(interp, enc_char);
+        #define MAX_ENCODING_NAME_ALLOWED 63
+        char   buffer[MAX_ENCODING_NAME_ALLOWED + 1];
+        size_t l = p - enc_char;
+        charset  = NULL;
+
+        if (l < MAX_ENCODING_NAME_ALLOWED) {
+            memcpy(buffer, enc_char, l);
+            buffer[l] = '\0';
+            encoding  = Parrot_find_encoding(interp, buffer);
+        }
         if (!encoding)
             Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
                 "Can't make '%s' encoding strings", enc_char);
@@ -2857,7 +2924,7 @@
     if (encoding != result->encoding)
         Parrot_str_length(interp, result);
 
-    if (!CHARSET_VALIDATE(interp, result, 0))
+    if (!CHARSET_VALIDATE(interp, result))
         Parrot_ex_throw_from_c_args(interp, NULL,
             EXCEPTION_INVALID_STRING_REPRESENTATION, "Malformed string");
 
@@ -2937,13 +3004,19 @@
 PARROT_CANNOT_RETURN_NULL
 PARROT_MALLOC
 STRING *
-Parrot_str_downcase(PARROT_INTERP, ARGIN(const STRING *s))
+Parrot_str_downcase(PARROT_INTERP, ARGIN_NULLOK(const STRING *s))
 {
     ASSERT_ARGS(Parrot_str_downcase)
-    DECL_CONST_CAST;
-    STRING * const dest = Parrot_str_copy(interp, PARROT_const_cast(STRING *, s));
-    Parrot_str_downcase_inplace(interp, dest);
-    return dest;
+    if (STRING_IS_NULL(s)) {
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNEXPECTED_NULL,
+            "Can't downcase NULL string");
+    }
+    else {
+        DECL_CONST_CAST;
+        STRING * const dest = Parrot_str_copy(interp, PARROT_const_cast(STRING *, s));
+        Parrot_str_downcase_inplace(interp, dest);
+        return dest;
+    }
 }
 
 
@@ -2959,17 +3032,23 @@
 
 PARROT_EXPORT
 void
-Parrot_str_downcase_inplace(PARROT_INTERP, ARGMOD(STRING *s))
+Parrot_str_downcase_inplace(PARROT_INTERP, ARGMOD_NULLOK(STRING *s))
 {
     ASSERT_ARGS(Parrot_str_downcase_inplace)
-    /*
-     * TODO get rid of all the inplace variants. We have for utf8:
-     * * 1 Parrot_str_copy from the non-incase variant
-     * * conversion to utf16, with doubling the buffer
-     * * possibly one more reallocation in downcase
-     */
-    Parrot_str_write_COW(interp, s);
-    CHARSET_DOWNCASE(interp, s);
+    if (STRING_IS_NULL(s)) {
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNEXPECTED_NULL,
+            "Can't downcase NULL string");
+    }
+    else {
+        /*
+         * TODO get rid of all the inplace variants. We have for utf8:
+         * * 1 Parrot_str_copy from the non-incase variant
+         * * conversion to utf16, with doubling the buffer
+         * * possibly one more reallocation in downcase
+         */
+        Parrot_str_write_COW(interp, s);
+        CHARSET_DOWNCASE(interp, s);
+    }
 }
 
 
@@ -2988,13 +3067,19 @@
 PARROT_CANNOT_RETURN_NULL
 PARROT_MALLOC
 STRING *
-Parrot_str_titlecase(PARROT_INTERP, ARGIN(const STRING *s))
+Parrot_str_titlecase(PARROT_INTERP, ARGIN_NULLOK(const STRING *s))
 {
     ASSERT_ARGS(Parrot_str_titlecase)
-    DECL_CONST_CAST;
-    STRING * const dest = Parrot_str_copy(interp, PARROT_const_cast(STRING *, s));
-    Parrot_str_titlecase_inplace(interp, dest);
-    return dest;
+    if (STRING_IS_NULL(s)) {
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNEXPECTED_NULL,
+            "Can't titlecase NULL string");
+    }
+    else {
+        DECL_CONST_CAST;
+        STRING * const dest = Parrot_str_copy(interp, PARROT_const_cast(STRING *, s));
+        Parrot_str_titlecase_inplace(interp, dest);
+        return dest;
+    }
 }
 
 
@@ -3010,11 +3095,17 @@
 
 PARROT_EXPORT
 void
-Parrot_str_titlecase_inplace(PARROT_INTERP, ARGMOD(STRING *s))
+Parrot_str_titlecase_inplace(PARROT_INTERP, ARGMOD_NULLOK(STRING *s))
 {
     ASSERT_ARGS(Parrot_str_titlecase_inplace)
-    Parrot_str_write_COW(interp, s);
-    CHARSET_TITLECASE(interp, s);
+    if (STRING_IS_NULL(s)) {
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNEXPECTED_NULL,
+            "Can't titlecase NULL string");
+    }
+    else {
+        Parrot_str_write_COW(interp, s);
+        CHARSET_TITLECASE(interp, s);
+    }
 }
 
 
@@ -3376,8 +3467,8 @@
         VTABLE_set_integer_native(interp, res, slen);
 
         for (i = 0; i < slen; ++i) {
-           STRING * const p = Parrot_str_substr(interp, str, i, 1, NULL, 0);
-           VTABLE_set_string_keyed_int(interp, res, i, p);
+            STRING * const p = Parrot_str_substr(interp, str, i, 1, NULL, 0);
+            VTABLE_set_string_keyed_int(interp, res, i, p);
         }
 
         return res;

Modified: branches/orderedhash_revamp/src/string/charset.c
==============================================================================
--- branches/orderedhash_revamp/src/string/charset.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/string/charset.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -74,13 +74,13 @@
         __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 = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_register_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(charsetname) \
-    || PARROT_ASSERT_ARG(charset)
-#define ASSERT_ARGS_register_static_converters __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+    , PARROT_ASSERT_ARG(charset))
+#define ASSERT_ARGS_register_static_converters __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: static */
 
@@ -168,7 +168,7 @@
 
 =item C<CHARSET * Parrot_load_charset(PARROT_INTERP, const char *charsetname)>
 
-Throws an exception (Can't load charsets dynamically yet. RT#58184).
+Throws an exception (Can't load charsets dynamically yet. https://trac.parrot.org/parrot/wiki/StringsTasklist).
 
 =cut
 

Modified: branches/orderedhash_revamp/src/string/charset/ascii.c
==============================================================================
--- branches/orderedhash_revamp/src/string/charset/ascii.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/string/charset/ascii.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -130,51 +130,51 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-#define ASSERT_ARGS_compose __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_compose __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_decompose __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_decompose __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_downcase __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_downcase_first __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_find_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_downcase __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_downcase_first __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_find_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_find_not_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_find_not_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_is_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_is_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_set_graphemes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_set_graphemes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string) \
-    || PARROT_ASSERT_ARG(insert_string)
-#define ASSERT_ARGS_string_from_codepoint __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_titlecase __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_titlecase_first __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_to_ascii __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(source_string) \
+    , PARROT_ASSERT_ARG(insert_string))
+#define ASSERT_ARGS_string_from_codepoint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_titlecase __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_titlecase_first __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_to_ascii __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_to_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_to_charset __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 = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_to_unicode __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_upcase __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_upcase_first __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_validate __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_upcase __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_upcase_first __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_validate __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
+    , PARROT_ASSERT_ARG(src))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 

Modified: branches/orderedhash_revamp/src/string/charset/ascii.h
==============================================================================
--- branches/orderedhash_revamp/src/string/charset/ascii.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/string/charset/ascii.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -100,40 +100,40 @@
 const CHARSET * Parrot_charset_ascii_init(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_ascii_compare __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_ascii_compare __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(lhs) \
-    || PARROT_ASSERT_ARG(rhs)
-#define ASSERT_ARGS_ascii_compute_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_ascii_cs_index __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string) \
-    || PARROT_ASSERT_ARG(search_string)
-#define ASSERT_ARGS_ascii_cs_rindex __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string) \
-    || PARROT_ASSERT_ARG(search_string)
-#define ASSERT_ARGS_ascii_get_graphemes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_ascii_get_graphemes_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string) \
-    || PARROT_ASSERT_ARG(dest_string)
-#define ASSERT_ARGS_charset_cvt_ascii_to_binary __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(lhs) \
+    , PARROT_ASSERT_ARG(rhs))
+#define ASSERT_ARGS_ascii_compute_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_ascii_cs_index __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(source_string) \
+    , PARROT_ASSERT_ARG(search_string))
+#define ASSERT_ARGS_ascii_cs_rindex __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(source_string) \
+    , PARROT_ASSERT_ARG(search_string))
+#define ASSERT_ARGS_ascii_get_graphemes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_ascii_get_graphemes_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(source_string) \
+    , PARROT_ASSERT_ARG(dest_string))
+#define ASSERT_ARGS_charset_cvt_ascii_to_binary __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
+    , PARROT_ASSERT_ARG(src))
 #define ASSERT_ARGS_charset_cvt_ascii_to_iso_8859_1 \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_mixed_cs_index __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_mixed_cs_index __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src) \
-    || PARROT_ASSERT_ARG(search)
-#define ASSERT_ARGS_Parrot_charset_ascii_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+    , PARROT_ASSERT_ARG(src) \
+    , PARROT_ASSERT_ARG(search))
+#define ASSERT_ARGS_Parrot_charset_ascii_init __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/charset/ascii.c */
 

Modified: branches/orderedhash_revamp/src/string/charset/binary.c
==============================================================================
--- branches/orderedhash_revamp/src/string/charset/binary.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/string/charset/binary.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -108,40 +108,40 @@
         __attribute__nonnull__(1);
 
 static UINTVAL validate(SHIM_INTERP, SHIM(STRING *source_string));
-#define ASSERT_ARGS_compare __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_compare __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(lhs) \
-    || PARROT_ASSERT_ARG(rhs)
-#define ASSERT_ARGS_compose __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_cs_index __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_cs_rindex __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_decompose __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_downcase __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_downcase_first __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_find_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_find_not_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_is_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_set_graphemes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(rhs))
+#define ASSERT_ARGS_compose __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_cs_index __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_cs_rindex __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_decompose __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_downcase __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_downcase_first __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_find_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_find_not_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_is_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_set_graphemes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string) \
-    || PARROT_ASSERT_ARG(insert_string)
-#define ASSERT_ARGS_string_from_codepoint __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_titlecase __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_titlecase_first __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_to_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(source_string) \
+    , PARROT_ASSERT_ARG(insert_string))
+#define ASSERT_ARGS_string_from_codepoint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_titlecase __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_titlecase_first __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_to_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_upcase __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_upcase_first __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_validate __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_upcase __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_upcase_first __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_validate __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 

Modified: branches/orderedhash_revamp/src/string/charset/binary.h
==============================================================================
--- branches/orderedhash_revamp/src/string/charset/binary.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/string/charset/binary.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -20,8 +20,8 @@
 const CHARSET * Parrot_charset_binary_init(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_Parrot_charset_binary_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_charset_binary_init __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/charset/binary.c */
 

Modified: branches/orderedhash_revamp/src/string/charset/iso-8859-1.c
==============================================================================
--- branches/orderedhash_revamp/src/string/charset/iso-8859-1.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/string/charset/iso-8859-1.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -124,56 +124,56 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-#define ASSERT_ARGS_compose __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_compose __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_decompose __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_downcase __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_decompose __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_downcase __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_downcase_first __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_downcase_first __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_find_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_find_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_find_not_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_find_not_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_is_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_is_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_set_graphemes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_set_graphemes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string) \
-    || PARROT_ASSERT_ARG(insert_string)
-#define ASSERT_ARGS_string_from_codepoint __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_titlecase __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(source_string) \
+    , PARROT_ASSERT_ARG(insert_string))
+#define ASSERT_ARGS_string_from_codepoint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_titlecase __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_titlecase_first __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_titlecase_first __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_to_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_to_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_to_iso_8859_1 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#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 = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_to_unicode __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_upcase __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_upcase __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_upcase_first __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_upcase_first __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_validate __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_validate __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
+    , PARROT_ASSERT_ARG(src))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -268,12 +268,12 @@
         for (offs = 0; offs < src->strlen; ++offs) {
             const UINTVAL c = ENCODING_GET_BYTE(interp, src, offs);
 
-            if (iter.bytepos >= PObj_buflen(dest) - 4) {
+            if (iter.bytepos >= Buffer_buflen(dest) - 4) {
                 UINTVAL need = (UINTVAL)((src->strlen - offs) * 1.5);
                 if (need < 16)
                     need = 16;
                 Parrot_gc_reallocate_string_storage(interp, dest,
-                        PObj_buflen(dest) + need);
+                        Buffer_buflen(dest) + need);
             }
             iter.set_and_advance(interp, &iter, c);
         }

Modified: branches/orderedhash_revamp/src/string/charset/iso-8859-1.h
==============================================================================
--- branches/orderedhash_revamp/src/string/charset/iso-8859-1.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/string/charset/iso-8859-1.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -30,12 +30,12 @@
         __attribute__nonnull__(1);
 
 #define ASSERT_ARGS_charset_cvt_iso_8859_1_to_ascii \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
+    , PARROT_ASSERT_ARG(src))
 #define ASSERT_ARGS_Parrot_charset_iso_8859_1_init \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+     __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/charset/iso-8859-1.c */
 

Modified: branches/orderedhash_revamp/src/string/charset/unicode.c
==============================================================================
--- branches/orderedhash_revamp/src/string/charset/unicode.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/string/charset/unicode.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -145,65 +145,65 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-#define ASSERT_ARGS_compare __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_compare __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(lhs) \
-    || PARROT_ASSERT_ARG(rhs)
-#define ASSERT_ARGS_compose __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_compute_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_cs_rindex __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_decompose __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_downcase __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_downcase_first __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_find_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_find_not_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_get_graphemes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_get_graphemes_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string) \
-    || PARROT_ASSERT_ARG(dest_string)
-#define ASSERT_ARGS_is_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_set_graphemes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string) \
-    || PARROT_ASSERT_ARG(insert_string)
-#define ASSERT_ARGS_string_from_codepoint __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_titlecase __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_titlecase_first __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_to_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_u_iscclass __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_upcase __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_upcase_first __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_validate __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(lhs) \
+    , PARROT_ASSERT_ARG(rhs))
+#define ASSERT_ARGS_compose __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_compute_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_cs_rindex __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_decompose __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_downcase __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_downcase_first __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_find_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_find_not_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_get_graphemes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_get_graphemes_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(source_string) \
+    , PARROT_ASSERT_ARG(dest_string))
+#define ASSERT_ARGS_is_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_set_graphemes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(source_string) \
+    , PARROT_ASSERT_ARG(insert_string))
+#define ASSERT_ARGS_string_from_codepoint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_titlecase __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_titlecase_first __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_to_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_u_iscclass __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_upcase __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_upcase_first __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_validate __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
+    , PARROT_ASSERT_ARG(src))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -394,7 +394,7 @@
 decompose(PARROT_INTERP, SHIM(STRING *src))
 {
     ASSERT_ARGS(decompose)
-    /* TODO: RT #59696 Implement this. */
+    /* TODO: https://trac.parrot.org/parrot/wiki/StringsTasklist Implement this. */
     UNIMPL;
 }
 
@@ -440,7 +440,7 @@
 
     /* use all available space - see below XXX */
     /* TODO downcase, titlecase too */
-    dest_len = PObj_buflen(src) / sizeof (UChar);
+    dest_len = Buffer_buflen(src) / sizeof (UChar);
     src_len  = src->bufused     / sizeof (UChar);
 
     /*
@@ -642,7 +642,7 @@
 upcase_first(PARROT_INTERP, SHIM(STRING *source_string))
 {
     ASSERT_ARGS(upcase_first)
-    /* TODO: RT #59696 Implement this. */
+    /* TODO: https://trac.parrot.org/parrot/wiki/StringsTasklist Implement this. */
     UNIMPL;
 }
 
@@ -662,7 +662,7 @@
 downcase_first(PARROT_INTERP, SHIM(STRING *source_string))
 {
     ASSERT_ARGS(downcase_first)
-    /* TODO: RT #59696 Implement this. */
+    /* TODO: https://trac.parrot.org/parrot/wiki/StringsTasklist Implement this. */
     UNIMPL;
 }
 
@@ -682,7 +682,7 @@
 titlecase_first(PARROT_INTERP, SHIM(STRING *source_string))
 {
     ASSERT_ARGS(titlecase_first)
-    /* TODO: RT #59696 Implement this. */
+    /* TODO: https://trac.parrot.org/parrot/wiki/StringsTasklist Implement this. */
     UNIMPL;
 }
 
@@ -750,7 +750,7 @@
         SHIM(STRING *search_string), SHIM(UINTVAL offset))
 {
     ASSERT_ARGS(cs_rindex)
-    /* TODO: RT #59696 Implement this. */
+    /* TODO: https://trac.parrot.org/parrot/wiki/StringsTasklist Implement this. */
     UNIMPL;
 }
 
@@ -834,14 +834,14 @@
     if (flags & enum_cclass_whitespace) {
         /* from http://www.unicode.org/Public/UNIDATA/PropList.txt */
         switch (codepoint) {
-            case 0x1680: case 0x180e: case 0x2000: case 0x2001:
-            case 0x2002: case 0x2003: case 0x2004: case 0x2005:
-            case 0x2006: case 0x2007: case 0x2008: case 0x2009:
-            case 0x200a: case 0x2028: case 0x2029: case 0x202f:
-            case 0x205f: case 0x3000:
-                return 1;
-            default:
-                break;
+          case 0x1680: case 0x180e: case 0x2000: case 0x2001:
+          case 0x2002: case 0x2003: case 0x2004: case 0x2005:
+          case 0x2006: case 0x2007: case 0x2008: case 0x2009:
+          case 0x200a: case 0x2028: case 0x2029: case 0x202f:
+          case 0x205f: case 0x3000:
+            return 1;
+          default:
+            break;
         }
     }
 
@@ -969,6 +969,11 @@
     UINTVAL     end = offset + count;
     int         bit;
 
+    if (pos > source_string->strlen) {
+        /* XXX: Throw in this case? */
+        return offset + count;
+    }
+
     ENCODING_ITER_INIT(interp, source_string, &iter);
 
     if (pos)

Modified: branches/orderedhash_revamp/src/string/charset/unicode.h
==============================================================================
--- branches/orderedhash_revamp/src/string/charset/unicode.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/string/charset/unicode.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -25,8 +25,8 @@
 const CHARSET * Parrot_charset_unicode_init(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_Parrot_charset_unicode_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_charset_unicode_init __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/charset/unicode.c */
 

Modified: branches/orderedhash_revamp/src/string/encoding.c
==============================================================================
--- branches/orderedhash_revamp/src/string/encoding.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/string/encoding.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -30,17 +30,17 @@
         __attribute__nonnull__(2)
         __attribute__nonnull__(3);
 
-#define ASSERT_ARGS_register_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_register_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(encodingname) \
-    || PARROT_ASSERT_ARG(encoding)
+    , PARROT_ASSERT_ARG(encoding))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
-ENCODING *Parrot_default_encoding_ptr;
-ENCODING *Parrot_fixed_8_encoding_ptr;
-ENCODING *Parrot_utf8_encoding_ptr;
-ENCODING *Parrot_ucs2_encoding_ptr;
-ENCODING *Parrot_utf16_encoding_ptr;
+ENCODING *Parrot_default_encoding_ptr = NULL;
+ENCODING *Parrot_fixed_8_encoding_ptr = NULL;
+ENCODING *Parrot_utf8_encoding_ptr    = NULL;
+ENCODING *Parrot_ucs2_encoding_ptr    = NULL;
+ENCODING *Parrot_utf16_encoding_ptr   = NULL;
 
 typedef struct One_encoding {
     NOTNULL(ENCODING *encoding);
@@ -133,7 +133,7 @@
 *encodingname)>
 
 Loads an encoding. Currently throws an exception because we cannot load
-encodings. See RT #58186.
+encodings. See https://trac.parrot.org/parrot/wiki/StringsTasklist.
 
 =cut
 
@@ -456,7 +456,7 @@
     UNUSED(lhs);
     UNUSED(rhs);
 
-    /* XXX Apparently unwritten RT #58188 */
+    /* XXX Apparently unwritten https://trac.parrot.org/parrot/wiki/StringsTasklist */
     Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
         "Can't find encoding converters yet.");
 }

Modified: branches/orderedhash_revamp/src/string/encoding/fixed_8.c
==============================================================================
--- branches/orderedhash_revamp/src/string/encoding/fixed_8.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/string/encoding/fixed_8.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -167,64 +167,64 @@
     SHIM(STRING *dest))
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_become_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_codepoints __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_find_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s) \
-    || PARROT_ASSERT_ARG(typetable)
-#define ASSERT_ARGS_fixed8_get_next __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(iter)
-#define ASSERT_ARGS_fixed8_set_next __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(iter)
-#define ASSERT_ARGS_fixed8_set_position __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(iter)
-#define ASSERT_ARGS_get_byte __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_get_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_get_bytes_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string) \
-    || PARROT_ASSERT_ARG(return_string)
-#define ASSERT_ARGS_get_codepoint __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_get_codepoints __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_get_codepoints_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string) \
-    || PARROT_ASSERT_ARG(dest_string)
-#define ASSERT_ARGS_iter_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_become_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_codepoints __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_find_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s) \
+    , PARROT_ASSERT_ARG(typetable))
+#define ASSERT_ARGS_fixed8_get_next __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(iter))
+#define ASSERT_ARGS_fixed8_set_next __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(iter))
+#define ASSERT_ARGS_fixed8_set_position __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(iter))
+#define ASSERT_ARGS_get_byte __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_get_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_get_bytes_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(source_string) \
+    , PARROT_ASSERT_ARG(return_string))
+#define ASSERT_ARGS_get_codepoint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_get_codepoints __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_get_codepoints_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(source_string) \
+    , PARROT_ASSERT_ARG(dest_string))
+#define ASSERT_ARGS_iter_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(src) \
-    || PARROT_ASSERT_ARG(iter)
-#define ASSERT_ARGS_set_byte __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(iter))
+#define ASSERT_ARGS_set_byte __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_set_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_set_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string) \
-    || PARROT_ASSERT_ARG(new_bytes)
-#define ASSERT_ARGS_set_codepoint __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string)
-#define ASSERT_ARGS_set_codepoints __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(source_string) \
-    || PARROT_ASSERT_ARG(new_codepoints)
-#define ASSERT_ARGS_to_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+    , PARROT_ASSERT_ARG(source_string) \
+    , PARROT_ASSERT_ARG(new_bytes))
+#define ASSERT_ARGS_set_codepoint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(source_string))
+#define ASSERT_ARGS_set_codepoints __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(source_string) \
+    , PARROT_ASSERT_ARG(new_codepoints))
+#define ASSERT_ARGS_to_encoding __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: static */
 
@@ -634,7 +634,7 @@
 {
     ASSERT_ARGS(fixed8_set_position)
     iter->bytepos = iter->charpos = pos;
-    PARROT_ASSERT(pos <= PObj_buflen(iter->str));
+    PARROT_ASSERT(pos <= Buffer_buflen(iter->str));
 }
 
 

Modified: branches/orderedhash_revamp/src/string/encoding/fixed_8.h
==============================================================================
--- branches/orderedhash_revamp/src/string/encoding/fixed_8.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/string/encoding/fixed_8.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -20,8 +20,8 @@
 ENCODING * Parrot_encoding_fixed_8_init(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_Parrot_encoding_fixed_8_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_encoding_fixed_8_init __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/fixed_8.c */
 

Modified: branches/orderedhash_revamp/src/string/encoding/ucs2.c
==============================================================================
--- branches/orderedhash_revamp/src/string/encoding/ucs2.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/string/encoding/ucs2.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -170,57 +170,57 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*i);
 
-#define ASSERT_ARGS_become_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_become_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_codepoints __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_codepoints __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_find_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_find_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s) \
-    || PARROT_ASSERT_ARG(typetable)
-#define ASSERT_ARGS_get_byte __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_get_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_get_bytes_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_get_codepoint __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(s) \
+    , PARROT_ASSERT_ARG(typetable))
+#define ASSERT_ARGS_get_byte __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_get_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_get_bytes_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_get_codepoint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_get_codepoints __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_get_codepoints __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_get_codepoints_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_iter_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_get_codepoints_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_iter_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src) \
-    || PARROT_ASSERT_ARG(iter)
-#define ASSERT_ARGS_set_byte __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_set_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_set_codepoint __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src) \
+    , PARROT_ASSERT_ARG(iter))
+#define ASSERT_ARGS_set_byte __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_set_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_set_codepoint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_set_codepoints __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_to_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_set_codepoints __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_to_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src) \
-    || PARROT_ASSERT_ARG(dest)
-#define ASSERT_ARGS_ucs2_decode_and_advance __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src) \
+    , PARROT_ASSERT_ARG(dest))
+#define ASSERT_ARGS_ucs2_decode_and_advance __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(i)
-#define ASSERT_ARGS_ucs2_encode_and_advance __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(i))
+#define ASSERT_ARGS_ucs2_encode_and_advance __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(i)
-#define ASSERT_ARGS_ucs2_set_position __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(i)
+    , PARROT_ASSERT_ARG(i))
+#define ASSERT_ARGS_ucs2_set_position __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(i))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -605,6 +605,7 @@
      * See TT #557
      */
     PARROT_ASSERT(0);
+    return (UINTVAL)0; /* Stop the static analyzers from panicing */
 #endif
 }
 

Modified: branches/orderedhash_revamp/src/string/encoding/ucs2.h
==============================================================================
--- branches/orderedhash_revamp/src/string/encoding/ucs2.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/string/encoding/ucs2.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -20,8 +20,8 @@
 ENCODING * Parrot_encoding_ucs2_init(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_Parrot_encoding_ucs2_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_encoding_ucs2_init __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/ucs2.c */
 

Modified: branches/orderedhash_revamp/src/string/encoding/utf16.c
==============================================================================
--- branches/orderedhash_revamp/src/string/encoding/utf16.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/string/encoding/utf16.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -168,64 +168,64 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*i);
 
-#define ASSERT_ARGS_become_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_codepoints __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_become_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_codepoints __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_find_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_find_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s) \
-    || PARROT_ASSERT_ARG(typetable)
-#define ASSERT_ARGS_get_byte __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_get_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(s) \
+    , PARROT_ASSERT_ARG(typetable))
+#define ASSERT_ARGS_get_byte __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_get_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_get_bytes_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_get_bytes_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src) \
-    || PARROT_ASSERT_ARG(return_string)
-#define ASSERT_ARGS_get_codepoint __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src) \
+    , PARROT_ASSERT_ARG(return_string))
+#define ASSERT_ARGS_get_codepoint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_get_codepoints __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_get_codepoints __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_get_codepoints_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_get_codepoints_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src) \
-    || PARROT_ASSERT_ARG(return_string)
-#define ASSERT_ARGS_iter_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src) \
+    , PARROT_ASSERT_ARG(return_string))
+#define ASSERT_ARGS_iter_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src) \
-    || PARROT_ASSERT_ARG(iter)
-#define ASSERT_ARGS_set_byte __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src) \
+    , PARROT_ASSERT_ARG(iter))
+#define ASSERT_ARGS_set_byte __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_set_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_set_codepoint __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_set_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_set_codepoint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_set_codepoints __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_set_codepoints __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src) \
-    || PARROT_ASSERT_ARG(new_codepoints)
-#define ASSERT_ARGS_to_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src) \
+    , PARROT_ASSERT_ARG(new_codepoints))
+#define ASSERT_ARGS_to_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_utf16_decode_and_advance __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_utf16_decode_and_advance __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(i)
-#define ASSERT_ARGS_utf16_encode_and_advance __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(i))
+#define ASSERT_ARGS_utf16_encode_and_advance __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(i)
-#define ASSERT_ARGS_utf16_set_position __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(i))
+#define ASSERT_ARGS_utf16_set_position __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(i)
+    , PARROT_ASSERT_ARG(i))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 

Modified: branches/orderedhash_revamp/src/string/encoding/utf16.h
==============================================================================
--- branches/orderedhash_revamp/src/string/encoding/utf16.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/string/encoding/utf16.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -20,8 +20,8 @@
 ENCODING * Parrot_encoding_utf16_init(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_Parrot_encoding_utf16_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_encoding_utf16_init __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/utf16.c */
 

Modified: branches/orderedhash_revamp/src/string/encoding/utf8.c
==============================================================================
--- branches/orderedhash_revamp/src/string/encoding/utf8.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/string/encoding/utf8.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -185,71 +185,71 @@
 static const void * utf8_skip_forward(ARGIN(const void *ptr), UINTVAL n)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_become_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_codepoints __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_find_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(s) \
-    || PARROT_ASSERT_ARG(typetable)
-#define ASSERT_ARGS_get_byte __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_get_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_get_bytes_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_get_codepoint __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_get_codepoints __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_get_codepoints_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src) \
-    || PARROT_ASSERT_ARG(return_string)
-#define ASSERT_ARGS_iter_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_become_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_codepoints __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_find_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(s) \
+    , PARROT_ASSERT_ARG(typetable))
+#define ASSERT_ARGS_get_byte __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_get_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_get_bytes_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_get_codepoint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_get_codepoints __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_get_codepoints_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(src) \
+    , PARROT_ASSERT_ARG(return_string))
+#define ASSERT_ARGS_iter_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(src) \
-    || PARROT_ASSERT_ARG(iter)
-#define ASSERT_ARGS_set_byte __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(iter))
+#define ASSERT_ARGS_set_byte __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_set_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_set_codepoint __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_set_codepoints __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_to_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_utf8_characters __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ptr)
-#define ASSERT_ARGS_utf8_decode __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ptr)
-#define ASSERT_ARGS_utf8_decode_and_advance __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(i)
-#define ASSERT_ARGS_utf8_encode __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(ptr)
-#define ASSERT_ARGS_utf8_encode_and_advance __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(i)
-#define ASSERT_ARGS_utf8_set_position __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(i)
-#define ASSERT_ARGS_utf8_skip_backward __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(ptr)
-#define ASSERT_ARGS_utf8_skip_forward __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(ptr)
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_set_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_set_codepoint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_set_codepoints __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_to_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(src))
+#define ASSERT_ARGS_utf8_characters __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ptr))
+#define ASSERT_ARGS_utf8_decode __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ptr))
+#define ASSERT_ARGS_utf8_decode_and_advance __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(i))
+#define ASSERT_ARGS_utf8_encode __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(ptr))
+#define ASSERT_ARGS_utf8_encode_and_advance __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(i))
+#define ASSERT_ARGS_utf8_set_position __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(i))
+#define ASSERT_ARGS_utf8_skip_backward __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(ptr))
+#define ASSERT_ARGS_utf8_skip_forward __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(ptr))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -525,7 +525,7 @@
 
     i->bytepos += (new_pos - pos);
     /* XXX possible buffer overrun exception? */
-    PARROT_ASSERT(i->bytepos <= PObj_buflen(s));
+    PARROT_ASSERT(i->bytepos <= Buffer_buflen(s));
     i->charpos++;
 }
 

Modified: branches/orderedhash_revamp/src/string/encoding/utf8.h
==============================================================================
--- branches/orderedhash_revamp/src/string/encoding/utf8.h	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/string/encoding/utf8.h	Sat Jan 23 01:49:53 2010	(r43541)
@@ -20,8 +20,8 @@
 ENCODING * Parrot_encoding_utf8_init(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_Parrot_encoding_utf8_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_encoding_utf8_init __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/utf8.c */
 

Modified: branches/orderedhash_revamp/src/string/primitives.c
==============================================================================
--- branches/orderedhash_revamp/src/string/primitives.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/string/primitives.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -95,54 +95,90 @@
     ++*offset;
 
     switch (codepoint) {
-        case 'x':
+      case 'x':
+        codepoint = CHARSET_GET_BYTE(interp, string, *offset);
+        if (codepoint >= '0' && codepoint <= '9') {
+            workchar = codepoint - '0';
+        }
+        else if (codepoint >= 'a' && codepoint <= 'f') {
+            workchar = codepoint - 'a' + 10;
+        }
+        else if (codepoint >= 'A' && codepoint <= 'F') {
+            workchar = codepoint - 'A' + 10;
+        }
+        else if (codepoint == '{') {
+            int i;
+            ++*offset;
+            workchar = 0;
+            for (i = 0; i < 8 && *offset < len; ++i, ++*offset) {
+                codepoint = CHARSET_GET_BYTE(interp, string, *offset);
+                if (codepoint == '}') {
+                    ++*offset;
+                    return workchar;
+                }
+                workchar *= 16;
+                if (codepoint >= '0' && codepoint <= '9') {
+                    workchar += codepoint - '0';
+                }
+                else if (codepoint >= 'a' && codepoint <= 'f') {
+                    workchar += codepoint - 'a' + 10;
+                }
+                else if (codepoint >= 'A' && codepoint <= 'F') {
+                    workchar += codepoint - 'A' + 10;
+                }
+                else {
+                    Parrot_ex_throw_from_c_args(interp, NULL,
+                            EXCEPTION_UNIMPLEMENTED,
+                            "Illegal escape sequence inside {}");
+                }
+            }
+            if (*offset == len)
+                Parrot_ex_throw_from_c_args(interp, NULL,
+                        EXCEPTION_UNIMPLEMENTED,
+                        "Illegal escape sequence no '}'");
+        }
+        else {
+            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+                    "Illegal escape sequence in");
+        }
+
+        ++*offset;
+        if (*offset < len) {
+            workchar *= 16;
             codepoint = CHARSET_GET_BYTE(interp, string, *offset);
             if (codepoint >= '0' && codepoint <= '9') {
-                workchar = codepoint - '0';
+                workchar += codepoint - '0';
             }
             else if (codepoint >= 'a' && codepoint <= 'f') {
-                workchar = codepoint - 'a' + 10;
+                workchar += codepoint - 'a' + 10;
             }
             else if (codepoint >= 'A' && codepoint <= 'F') {
-                workchar = codepoint - 'A' + 10;
-            }
-            else if (codepoint == '{') {
-                int i;
-                ++*offset;
-                workchar = 0;
-                for (i = 0; i < 8 && *offset < len; ++i, ++*offset) {
-                    codepoint = CHARSET_GET_BYTE(interp, string, *offset);
-                    if (codepoint == '}') {
-                        ++*offset;
-                        return workchar;
-                    }
-                    workchar *= 16;
-                    if (codepoint >= '0' && codepoint <= '9') {
-                        workchar += codepoint - '0';
-                    }
-                    else if (codepoint >= 'a' && codepoint <= 'f') {
-                        workchar += codepoint - 'a' + 10;
-                    }
-                    else if (codepoint >= 'A' && codepoint <= 'F') {
-                        workchar += codepoint - 'A' + 10;
-                    }
-                    else {
-                        Parrot_ex_throw_from_c_args(interp, NULL,
-                            EXCEPTION_UNIMPLEMENTED,
-                            "Illegal escape sequence inside {}");
-                    }
-                }
-                if (*offset == len)
-                    Parrot_ex_throw_from_c_args(interp, NULL,
-                        EXCEPTION_UNIMPLEMENTED,
-                        "Illegal escape sequence no '}'");
+                workchar += codepoint - 'A' + 10;
             }
             else {
-                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
-                    "Illegal escape sequence in");
+                return workchar;
             }
+        }
+        else {
+            return workchar;
+        }
+        ++*offset;
+        return workchar;
+      case 'c':
+        codepoint = CHARSET_GET_BYTE(interp, string, *offset);
+        if (codepoint >= 'A' && codepoint <= 'Z') {
+            workchar = codepoint - 'A' + 1;
+        }
+        else {
+            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+                    "Illegal escape sequence");
+        }
 
-            ++*offset;
+        ++*offset;
+        return workchar;
+      case 'u':
+        workchar = 0;
+        for (charcount = 0; charcount < 4; charcount++) {
             if (*offset < len) {
                 workchar *= 16;
                 codepoint = CHARSET_GET_BYTE(interp, string, *offset);
@@ -156,146 +192,110 @@
                     workchar += codepoint - 'A' + 10;
                 }
                 else {
-                    return workchar;
+                    Parrot_ex_throw_from_c_args(interp, NULL,
+                            EXCEPTION_UNIMPLEMENTED,
+                            "Illegal escape sequence in uxxx escape");
                 }
             }
             else {
-                return workchar;
-            }
-            ++*offset;
-            return workchar;
-        case 'c':
-            codepoint = CHARSET_GET_BYTE(interp, string, *offset);
-            if (codepoint >= 'A' && codepoint <= 'Z') {
-                workchar = codepoint - 'A' + 1;
-            }
-            else {
-                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
-                    "Illegal escape sequence");
+                Parrot_ex_throw_from_c_args(interp, NULL,
+                        EXCEPTION_UNIMPLEMENTED,
+                        "Illegal escape sequence in uxxx escape - too short");
             }
 
             ++*offset;
-            return workchar;
-        case 'u':
-            workchar = 0;
-            for (charcount = 0; charcount < 4; charcount++) {
-                if (*offset < len) {
-                    workchar *= 16;
-                    codepoint = CHARSET_GET_BYTE(interp, string, *offset);
-                    if (codepoint >= '0' && codepoint <= '9') {
-                        workchar += codepoint - '0';
-                    }
-                    else if (codepoint >= 'a' && codepoint <= 'f') {
-                        workchar += codepoint - 'a' + 10;
-                    }
-                    else if (codepoint >= 'A' && codepoint <= 'F') {
-                        workchar += codepoint - 'A' + 10;
-                    }
-                    else {
-                        Parrot_ex_throw_from_c_args(interp, NULL,
-                            EXCEPTION_UNIMPLEMENTED,
-                            "Illegal escape sequence in uxxx escape");
-                    }
+        }
+        return workchar;
+      case 'U':
+        workchar = 0;
+        for (charcount = 0; charcount < 8; charcount++) {
+            if (*offset < len) {
+                workchar *= 16;
+                codepoint = CHARSET_GET_BYTE(interp, string, *offset);
+                if (codepoint >= '0' && codepoint <= '9') {
+                    workchar += codepoint - '0';
+                }
+                else if (codepoint >= 'a' && codepoint <= 'f') {
+                    workchar += codepoint - 'a' + 10;
+                }
+                else if (codepoint >= 'A' && codepoint <= 'F') {
+                    workchar += codepoint - 'A' + 10;
                 }
                 else {
                     Parrot_ex_throw_from_c_args(interp, NULL,
-                        EXCEPTION_UNIMPLEMENTED,
-                        "Illegal escape sequence in uxxx escape - too short");
-                }
-
-                ++*offset;
-            }
-            return workchar;
-        case 'U':
-            workchar = 0;
-            for (charcount = 0; charcount < 8; charcount++) {
-                if (*offset < len) {
-                    workchar *= 16;
-                    codepoint = CHARSET_GET_BYTE(interp, string, *offset);
-                    if (codepoint >= '0' && codepoint <= '9') {
-                        workchar += codepoint - '0';
-                    }
-                    else if (codepoint >= 'a' && codepoint <= 'f') {
-                        workchar += codepoint - 'a' + 10;
-                    }
-                    else if (codepoint >= 'A' && codepoint <= 'F') {
-                        workchar += codepoint - 'A' + 10;
-                    }
-                    else {
-                        Parrot_ex_throw_from_c_args(interp, NULL,
                             EXCEPTION_UNIMPLEMENTED,
                             "Illegal escape sequence in Uxxx escape");
-                    }
                 }
-                else {
-                    Parrot_ex_throw_from_c_args(interp, NULL,
+            }
+            else {
+                Parrot_ex_throw_from_c_args(interp, NULL,
                         EXCEPTION_UNIMPLEMENTED,
                         "Illegal escape sequence in uxxx escape - too short");
-                }
-
-                ++*offset;
             }
-            return workchar;
-        case '0':
-        case '1':
-        case '2':
-        case '3':
-        case '4':
-        case '5':
-        case '6':
-        case '7':
-            workchar = codepoint - '0';
-            if (*offset < len) {
-                workchar *= 8;
-                codepoint = CHARSET_GET_BYTE(interp, string, *offset);
-                if (codepoint >= '0' && codepoint <= '7') {
-                    workchar += codepoint - '0';
-                }
-                else {
-                    return workchar;
-                }
+
+            ++*offset;
+        }
+        return workchar;
+      case '0':
+      case '1':
+      case '2':
+      case '3':
+      case '4':
+      case '5':
+      case '6':
+      case '7':
+        workchar = codepoint - '0';
+        if (*offset < len) {
+            workchar *= 8;
+            codepoint = CHARSET_GET_BYTE(interp, string, *offset);
+            if (codepoint >= '0' && codepoint <= '7') {
+                workchar += codepoint - '0';
             }
             else {
                 return workchar;
             }
-            ++*offset;
-            if (*offset < len) {
-                workchar *= 8;
-                codepoint = CHARSET_GET_BYTE(interp, string, *offset);
-                if (codepoint >= '0' && codepoint <= '7') {
-                    workchar += codepoint - '0';
-                }
-                else {
-                    return workchar;
-                }
+        }
+        else {
+            return workchar;
+        }
+        ++*offset;
+        if (*offset < len) {
+            workchar *= 8;
+            codepoint = CHARSET_GET_BYTE(interp, string, *offset);
+            if (codepoint >= '0' && codepoint <= '7') {
+                workchar += codepoint - '0';
             }
             else {
                 return workchar;
             }
-            ++*offset;
+        }
+        else {
             return workchar;
-        case 'a':
-            return 7; /* bell */
-        case 'b':
-            return 8; /* bs */
-        case 't':
-            return 9;
-        case 'n':
-            return 10;
-        case 'v':
-            return 11;
-        case 'f':
-            return 12;
-        case 'r':
-            return 13;
-        case 'e':
-            return 27;
-        case 92: /* \ */
-            return 92;
-        case '"':
-            return '"';
-        default:
-            return codepoint;  /* any not special return the char */
+        }
+        ++*offset;
+        return workchar;
+      case 'a':
+        return 7; /* bell */
+      case 'b':
+        return 8; /* bs */
+      case 't':
+        return 9;
+      case 'n':
+        return 10;
+      case 'v':
+        return 11;
+      case 'f':
+        return 12;
+      case 'r':
+        return 13;
+      case 'e':
+        return 27;
+      case 92: /* \ */
+        return 92;
+      case '"':
+        return '"';
+      default:
+        return codepoint;  /* any not special return the char */
     }
 }
 
@@ -337,33 +337,6 @@
 
 /*
 
-=item C<char * str_dup(const char *old)>
-
-Duplicate a C string.  Just like strdup(), except it dies if it runs
-out of memory.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_MALLOC
-PARROT_CANNOT_RETURN_NULL
-char *
-str_dup(ARGIN(const char *old))
-{
-    ASSERT_ARGS(str_dup)
-    const size_t bytes = strlen(old) + 1;
-    char * const copy = (char *)mem_sys_allocate(bytes);
-    memcpy(copy, old, bytes);
-#ifdef MEMDEBUG
-    debug(interp, 1, "line %d str_dup %s [%x]\n", line, old, copy);
-#endif
-    return copy;
-}
-
-/*
-
 =item C<char * str_dup_remove_quotes(const char *old)>
 
 Duplicates a C string (minus the wrapping quotes).  Similar to strdup(),

Modified: branches/orderedhash_revamp/src/sub.c
==============================================================================
--- branches/orderedhash_revamp/src/sub.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/sub.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -49,225 +49,9 @@
 
 /*
 
-=item C<void mark_context(PARROT_INTERP, Parrot_Context* ctx)>
-
-Marks the context C<*ctx>.
-
-=cut
-
-*/
-
-void
-mark_context(PARROT_INTERP, ARGMOD(Parrot_Context* ctx))
-{
-    ASSERT_ARGS(mark_context)
-    PObj *obj;
-    int   i;
-
-    if (ctx->gc_mark == context_gc_mark)
-        return;
-    ctx->gc_mark = context_gc_mark;
-
-    /* don't mark the context if it's actually dead */
-    if (ctx->ref_count < 0) {
-        /* report it, though */
-        if (Interp_debug_TEST(interp, PARROT_CTX_DESTROY_DEBUG_FLAG)) {
-            fprintf(stderr, "[attempt to mark dead context %p]\n",
-                (void *)ctx);
-        }
-        return;
-    }
-
-    obj = (PObj *)ctx->current_sub;
-    if (obj)
-        Parrot_gc_mark_PObj_alive(interp, obj);
-
-    obj = (PObj *)ctx->current_object;
-    if (obj)
-        Parrot_gc_mark_PObj_alive(interp, obj);
-
-    obj = (PObj *)ctx->current_cont;
-    if (obj && !PObj_live_TEST(obj))
-        Parrot_gc_mark_PObj_alive(interp, obj);
-
-    if (ctx->caller_ctx)
-        mark_context(interp, ctx->caller_ctx);
-
-    if (ctx->outer_ctx)
-        mark_context(interp, ctx->outer_ctx);
-
-    obj = (PObj *)ctx->current_namespace;
-    if (obj)
-        Parrot_gc_mark_PObj_alive(interp, obj);
-
-    obj = (PObj *)ctx->lex_pad;
-    if (obj)
-        Parrot_gc_mark_PObj_alive(interp, obj);
-
-    obj = (PObj *)ctx->handlers;
-    if (obj)
-        Parrot_gc_mark_PObj_alive(interp, obj);
-
-
-    if (!ctx->n_regs_used)
-        return;
-
-    for (i = 0; i < ctx->n_regs_used[REGNO_PMC]; ++i) {
-        obj = (PObj *)CTX_REG_PMC(ctx, i);
-        if (obj)
-            Parrot_gc_mark_PObj_alive(interp, obj);
-    }
-
-    for (i = 0; i < ctx->n_regs_used[REGNO_STR]; ++i) {
-        obj = (PObj *)CTX_REG_STR(ctx, i);
-        if (obj)
-            Parrot_gc_mark_PObj_alive(interp, obj);
-    }
-}
-
-/*
-
-=item C<Parrot_sub * new_sub(PARROT_INTERP)>
-
-Returns a new C<Parrot_sub>.
-
-=cut
-
-*/
-
-PARROT_MALLOC
-PARROT_CANNOT_RETURN_NULL
-Parrot_sub *
-new_sub(PARROT_INTERP)
-{
-    ASSERT_ARGS(new_sub)
-    /* Using system memory until I figure out GC issues */
-    Parrot_sub * const newsub = mem_allocate_zeroed_typed(Parrot_sub);
-    newsub->seg               = interp->code;
-    return newsub;
-}
-
-/*
-
-=item C<Parrot_sub * new_closure(PARROT_INTERP)>
-
-Returns a new C<Parrot_sub> with its own scratchpad.
-
-XXX: Need to document semantics in detail.
-
-=cut
-
-*/
-
-PARROT_MALLOC
-PARROT_CANNOT_RETURN_NULL
-Parrot_sub *
-new_closure(PARROT_INTERP)
-{
-    ASSERT_ARGS(new_closure)
-    Parrot_sub * const newsub = new_sub(interp);
-    return newsub;
-}
-
-/*
-
-=item C<Parrot_cont * new_continuation(PARROT_INTERP, const Parrot_cont *to)>
-
-Returns a new C<Parrot_cont> to the context of C<to> with its own copy of the
-current interpreter context.  If C<to> is C<NULL>, then the C<to_ctx> is set
-to the current context.
-
-=cut
-
-*/
-
-PARROT_MALLOC
-PARROT_CANNOT_RETURN_NULL
-Parrot_cont *
-new_continuation(PARROT_INTERP, ARGIN_NULLOK(const Parrot_cont *to))
-{
-    ASSERT_ARGS(new_continuation)
-    Parrot_cont    * const cc     = mem_allocate_typed(Parrot_cont);
-    Parrot_Context * const to_ctx = to ? to->to_ctx : CONTEXT(interp);
-
-    cc->to_ctx        = to_ctx;
-    cc->from_ctx      = Parrot_context_ref(interp, CONTEXT(interp));
-    cc->dynamic_state = NULL;
-    cc->runloop_id    = 0;
-    if (to) {
-        cc->seg       = to->seg;
-        cc->address   = to->address;
-    }
-    else {
-        cc->seg       = interp->code;
-        cc->address   = NULL;
-    }
-
-    cc->current_results = to_ctx->current_results;
-    return cc;
-}
-
-/*
-
-=item C<Parrot_cont * new_ret_continuation(PARROT_INTERP)>
-
-Returns a new C<Parrot_cont> pointing to the current context.
-
-=cut
-
-*/
-
-PARROT_MALLOC
-PARROT_CANNOT_RETURN_NULL
-Parrot_cont *
-new_ret_continuation(PARROT_INTERP)
-{
-    ASSERT_ARGS(new_ret_continuation)
-    Parrot_cont * const cc = mem_allocate_typed(Parrot_cont);
-
-    cc->to_ctx          = CONTEXT(interp);
-    cc->from_ctx        = CONTEXT(interp);    /* filled in during a call */
-    cc->dynamic_state   = NULL;
-    cc->runloop_id      = 0;
-    cc->seg             = interp->code;
-    cc->current_results = NULL;
-    cc->address         = NULL;
-    return cc;
-}
-
-/*
-
-=item C<Parrot_coro * new_coroutine(PARROT_INTERP)>
-
-Returns a new C<Parrot_coro>.
-
-XXX: Need to document semantics in detail.
-
-=cut
-
-*/
-
-PARROT_MALLOC
-PARROT_CANNOT_RETURN_NULL
-Parrot_coro *
-new_coroutine(PARROT_INTERP)
-{
-    ASSERT_ARGS(new_coroutine)
-    Parrot_coro * const co = mem_allocate_zeroed_typed(Parrot_coro);
-
-    co->seg                = interp->code;
-    co->ctx                = NULL;
-    co->dynamic_state      = NULL;
-
-    return co;
-}
-
-/*
-
 =item C<PMC * new_ret_continuation_pmc(PARROT_INTERP, opcode_t *address)>
 
-Returns a new C<RetContinuation> PMC. Uses one from the cache,
-if possible; otherwise, creates a new one.
+Returns a new C<RetContinuation> PMC, and sets address field to C<address>
 
 =cut
 
@@ -299,10 +83,10 @@
 invalidate_retc_context(PARROT_INTERP, ARGMOD(PMC *cont))
 {
     ASSERT_ARGS(invalidate_retc_context)
-    Parrot_Context *ctx = PMC_cont(cont)->from_ctx;
-    cont = ctx->current_cont;
 
-    Parrot_set_context_threshold(interp, ctx);
+    PMC *ctx = PARROT_CONTINUATION(cont)->from_ctx;
+    cont = Parrot_pcc_get_continuation(interp, ctx);
+
     while (1) {
         /*
          * We  stop if we encounter a true continuation, because
@@ -312,11 +96,9 @@
         if (!cont || cont->vtable != interp->vtables[enum_class_RetContinuation])
             break;
         cont->vtable = interp->vtables[enum_class_Continuation];
-        Parrot_context_ref(interp, ctx);
-        ctx  = ctx->caller_ctx;
-        cont = ctx->current_cont;
+        ctx  = Parrot_pcc_get_caller_ctx(interp, ctx);
+        cont = Parrot_pcc_get_continuation(interp, ctx);
     }
-
 }
 
 /*
@@ -337,7 +119,7 @@
 {
     ASSERT_ARGS(Parrot_full_sub_name)
     if (sub_pmc && VTABLE_defined(interp, sub_pmc)) {
-        Parrot_sub *sub;
+        Parrot_Sub_attributes *sub;
 
         PMC_get_sub(interp, sub_pmc, sub);
 
@@ -356,12 +138,6 @@
              * the running program.
              */
             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);
 
@@ -369,12 +145,6 @@
 
             /* Restore stuff that might have got overwritten */
             interp->current_cont      = saved_ccont;
-            interp->current_args      = current_args;
-            interp->current_params    = current_params;
-            interp->current_returns   = current_returns;
-            interp->args_signature    = args_signature;
-            interp->params_signature  = params_signature;
-            interp->returns_signature = returns_signature;
 
             if (sub->name)
                 VTABLE_push_string(interp, ns_array, sub->name);
@@ -389,8 +159,8 @@
 
 /*
 
-=item C<int Parrot_Context_get_info(PARROT_INTERP, const Parrot_Context *ctx,
-Parrot_Context_info *info)>
+=item C<int Parrot_Context_get_info(PARROT_INTERP, PMC *ctx, Parrot_Context_info
+*info)>
 
 Takes pointers to a context and its information table.
 Populates the table and returns 0 or 1. XXX needs explanation
@@ -402,11 +172,13 @@
 
 PARROT_EXPORT
 int
-Parrot_Context_get_info(PARROT_INTERP, ARGIN(const Parrot_Context *ctx),
-                    ARGOUT(Parrot_Context_info *info))
+Parrot_Context_get_info(PARROT_INTERP, ARGIN(PMC *ctx),
+    ARGOUT(Parrot_Context_info *info))
 {
     ASSERT_ARGS(Parrot_Context_get_info)
-    Parrot_sub *sub;
+    PMC                   *subpmc;
+    Parrot_Sub_attributes *sub;
+    opcode_t              *pc;
 
     /* set file/line/pc defaults */
     info->file     = CONST_STRING(interp, "(unknown file)");
@@ -416,8 +188,10 @@
     info->subname  = NULL;
     info->fullname = NULL;
 
+    subpmc = Parrot_pcc_get_sub(interp, ctx);
+
     /* is the current sub of the specified context valid? */
-    if (PMC_IS_NULL(ctx->current_sub)) {
+    if (PMC_IS_NULL(subpmc)) {
         info->subname  = Parrot_str_new(interp, "???", 3);
         info->nsname   = info->subname;
         info->fullname = Parrot_str_new(interp, "??? :: ???", 10);
@@ -426,10 +200,10 @@
     }
 
     /* fetch Parrot_sub of the current sub in the given context */
-    if (!VTABLE_isa(interp, ctx->current_sub, CONST_STRING(interp, "Sub")))
+    if (!VTABLE_isa(interp, subpmc, CONST_STRING(interp, "Sub")))
         return 1;
 
-    PMC_get_sub(interp, ctx->current_sub, sub);
+    PMC_get_sub(interp, subpmc, sub);
     /* set the sub name */
     info->subname = sub->name;
 
@@ -440,18 +214,20 @@
     }
     else {
         info->nsname   = VTABLE_get_string(interp, sub->namespace_name);
-        info->fullname = Parrot_full_sub_name(interp, ctx->current_sub);
+        info->fullname = Parrot_full_sub_name(interp, subpmc);
     }
 
+    pc = Parrot_pcc_get_pc(interp, ctx);
+
     /* return here if there is no current pc */
-    if (ctx->current_pc == NULL)
+    if (!pc)
         return 1;
 
     /* calculate the current pc */
-    info->pc = ctx->current_pc - sub->seg->base.data;
+    info->pc = pc - sub->seg->base.data;
 
     /* determine the current source file/line */
-    if (ctx->current_pc) {
+    if (pc) {
         const size_t offs = info->pc;
         size_t i, n;
         opcode_t *pc = sub->seg->base.data;
@@ -476,13 +252,96 @@
             pc += op_info->op_count + var_args;
         }
     }
+
     return 1;
 }
 
+
+/*
+
+=item C<INTVAL Parrot_Sub_get_line_from_pc(PARROT_INTERP, PMC *subpmc, opcode_t
+*pc)>
+
+Given a PMC sub and the current opcode, returns the corresponding PIR line
+number.
+
+=cut
+
+*/
+
+INTVAL
+Parrot_Sub_get_line_from_pc(PARROT_INTERP, ARGIN_NULLOK(PMC *subpmc), ARGIN_NULLOK(opcode_t *pc))
+{
+    ASSERT_ARGS(Parrot_Sub_get_line_from_pc)
+    Parrot_Sub_attributes *sub;
+    opcode_t              *base_pc, *debug_ops;
+    size_t                 i, op, current_annotation, debug_size;
+
+    if (!subpmc || !pc)
+        return -1;
+
+    PMC_get_sub(interp, subpmc, sub);
+
+    debug_ops          = sub->seg->debugs->base.data;
+    debug_size         = sub->seg->debugs->base.size;
+    base_pc            = sub->seg->base.data;
+    current_annotation = pc - base_pc;
+
+    for (i = op = 0; op < debug_size; i++) {
+        op_info_t * const op_info  = &interp->op_info_table[*base_pc];
+        opcode_t          var_args = 0;
+
+        if (i >= debug_size)
+            return -1;
+
+        if (op >= current_annotation)
+            return debug_ops[i];
+
+        ADD_OP_VAR_PART(interp, sub->seg, base_pc, var_args);
+        op      += op_info->op_count + var_args;
+        base_pc += op_info->op_count + var_args;
+    }
+
+    return -1;
+}
+
+
 /*
 
-=item C<STRING* Parrot_Context_infostr(PARROT_INTERP, const Parrot_Context
-*ctx)>
+=item C<STRING * Parrot_Sub_get_filename_from_pc(PARROT_INTERP, PMC *subpmc,
+opcode_t *pc)>
+
+Given a PMC sub and the current opcode, returns the corresponding PIR file
+name.
+
+=cut
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+STRING *
+Parrot_Sub_get_filename_from_pc(PARROT_INTERP, ARGIN_NULLOK(PMC *subpmc),
+        ARGIN_NULLOK(opcode_t *pc))
+{
+    ASSERT_ARGS(Parrot_Sub_get_filename_from_pc)
+    Parrot_Sub_attributes *sub;
+    PackFile_Debug        *debug;
+    int                    position;
+
+    if (!subpmc || !pc)
+        return CONST_STRING(interp, "unknown file");
+
+    PMC_get_sub(interp, subpmc, sub);
+
+    debug    = sub->seg->debugs;
+    position = pc - sub->seg->base.data;
+
+    return Parrot_debug_pc_to_filename(interp, debug, position);
+}
+
+/*
+
+=item C<STRING* Parrot_Context_infostr(PARROT_INTERP, PMC *ctx)>
 
 Formats context information for display.  Takes a context pointer and
 returns a pointer to the text.  Used in debug.c and warnings.c
@@ -495,12 +354,12 @@
 PARROT_CAN_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
 STRING*
-Parrot_Context_infostr(PARROT_INTERP, ARGIN(const Parrot_Context *ctx))
+Parrot_Context_infostr(PARROT_INTERP, ARGIN(PMC *ctx))
 {
     ASSERT_ARGS(Parrot_Context_infostr)
     Parrot_Context_info info;
     STRING             *res = NULL;
-    const char * const  msg = (CONTEXT(interp) == ctx)
+    const char * const  msg = (CURRENT_CONTEXT(interp) == ctx)
         ? "current instr.:"
         : "called from Sub";
 
@@ -518,8 +377,7 @@
 
 /*
 
-=item C<PMC* Parrot_find_pad(PARROT_INTERP, STRING *lex_name, const
-Parrot_Context *ctx)>
+=item C<PMC* Parrot_find_pad(PARROT_INTERP, STRING *lex_name, PMC *ctx)>
 
 Locate the LexPad containing the given name. Return NULL on failure.
 
@@ -530,12 +388,12 @@
 PARROT_CAN_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
 PMC*
-Parrot_find_pad(PARROT_INTERP, ARGIN(STRING *lex_name), ARGIN(const Parrot_Context *ctx))
+Parrot_find_pad(PARROT_INTERP, ARGIN(STRING *lex_name), ARGIN(PMC *ctx))
 {
     ASSERT_ARGS(Parrot_find_pad)
     while (1) {
-        PMC                    * const lex_pad = ctx->lex_pad;
-        const Parrot_Context   * const outer   = ctx->outer_ctx;
+        PMC * const lex_pad = Parrot_pcc_get_lex_pad(interp, ctx);
+        PMC * outer         = Parrot_pcc_get_outer_ctx(interp, ctx);
 
         if (!outer)
             return lex_pad;
@@ -544,17 +402,6 @@
             if (VTABLE_exists_keyed_str(interp, lex_pad, lex_name))
                 return lex_pad;
 
-#if CTX_LEAK_DEBUG
-        if (outer == ctx) {
-            /* This is a bug; a context can never be its own :outer context.
-             * Detecting it avoids an unbounded loop, which is difficult to
-             * debug, though we'd rather not pay the cost of detection in a
-             * production release.
-             */
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-                "Bug:  Context %p :outer points back to itself.", ctx);
-        }
-#endif
         ctx = outer;
     }
 }
@@ -562,6 +409,39 @@
 
 /*
 
+=item C<PMC* Parrot_find_dynamic_pad(PARROT_INTERP, STRING *lex_name, PMC *ctx)>
+
+Locate the LexPad containing the given C<lex_name> in C<ctx> and
+its caller pads.  Return PMCNULL on failure.
+
+=cut
+
+*/
+
+PARROT_CAN_RETURN_NULL
+PARROT_WARN_UNUSED_RESULT
+PMC*
+Parrot_find_dynamic_pad(PARROT_INTERP, ARGIN(STRING *lex_name), ARGIN(PMC *ctx))
+{
+    ASSERT_ARGS(Parrot_find_dynamic_pad)
+    while (1) {
+        PMC * const lex_pad = Parrot_pcc_get_lex_pad(interp, ctx);
+        PMC * caller        = Parrot_pcc_get_caller_ctx(interp, ctx);
+
+        if (!caller)
+            return lex_pad;
+
+        if (!PMC_IS_NULL(lex_pad))
+            if (VTABLE_exists_keyed_str(interp, lex_pad, lex_name))
+                return lex_pad;
+
+        ctx = caller;
+    }
+}
+
+
+/*
+
 =item C<void Parrot_capture_lex(PARROT_INTERP, PMC *sub_pmc)>
 
 Capture the current lexical environment of a sub.
@@ -570,16 +450,16 @@
 
 */
 
+PARROT_EXPORT
 void
 Parrot_capture_lex(PARROT_INTERP, ARGMOD(PMC *sub_pmc))
 {
     ASSERT_ARGS(Parrot_capture_lex)
-    Parrot_Context * const ctx          = CONTEXT(interp);
-    Parrot_sub            *current_sub, *outer_sub;
-    Parrot_sub            *sub;
-    Parrot_Context        *old;
+    PMC            * const ctx          = CURRENT_CONTEXT(interp);
+    Parrot_Sub_attributes *current_sub;
+    Parrot_Sub_attributes *sub;
 
-    PMC_get_sub(interp, ctx->current_sub, current_sub);
+    PMC_get_sub(interp, Parrot_pcc_get_sub(interp, ctx), current_sub);
 
     /* MultiSub gets special treatment */
     if (VTABLE_isa(interp, sub_pmc, CONST_STRING(interp, "MultiSub"))) {
@@ -589,7 +469,7 @@
         while (VTABLE_get_bool(interp, iter)) {
 
             PMC        * const child_pmc = VTABLE_shift_pmc(interp, iter);
-            Parrot_sub        *child_sub, *child_outer_sub;
+            Parrot_Sub_attributes *child_sub, *child_outer_sub;
 
             PMC_get_sub(interp, child_pmc, child_sub);
 
@@ -597,10 +477,7 @@
                 PMC_get_sub(interp, child_sub->outer_sub, child_outer_sub);
                 if (Parrot_str_equal(interp, current_sub->subid,
                                       child_outer_sub->subid)) {
-                    old = child_sub->outer_ctx;
-                    child_sub->outer_ctx = Parrot_context_ref(interp, ctx);
-                    if (old)
-                        Parrot_free_context(interp, old, 1);
+                    child_sub->outer_ctx = ctx;
                 }
             }
         }
@@ -625,10 +502,7 @@
 #endif
 
     /* set the sub's outer context to the current context */
-    old = sub->outer_ctx;
-    sub->outer_ctx = Parrot_context_ref(interp, ctx);
-    if (old)
-        Parrot_free_context(interp, old, 1);
+    sub->outer_ctx = ctx;
 }
 
 
@@ -654,7 +528,7 @@
 parrot_new_closure(PARROT_INTERP, ARGIN(PMC *sub_pmc))
 {
     ASSERT_ARGS(parrot_new_closure)
-    PMC        * const clos_pmc = VTABLE_clone(interp, sub_pmc);
+    PMC * const clos_pmc = VTABLE_clone(interp, sub_pmc);
     Parrot_capture_lex(interp, clos_pmc);
     return clos_pmc;
 }
@@ -662,8 +536,7 @@
 
 /*
 
-=item C<void Parrot_continuation_check(PARROT_INTERP, const PMC *pmc, const
-Parrot_cont *cc)>
+=item C<void Parrot_continuation_check(PARROT_INTERP, const PMC *pmc)>
 
 Verifies that the provided continuation is sane.
 
@@ -672,29 +545,18 @@
 */
 
 void
-Parrot_continuation_check(PARROT_INTERP, ARGIN(const PMC *pmc),
-    ARGIN(const Parrot_cont *cc))
+Parrot_continuation_check(PARROT_INTERP, ARGIN(const PMC *pmc))
 {
     ASSERT_ARGS(Parrot_continuation_check)
-    Parrot_Context *to_ctx       = cc->to_ctx;
-    Parrot_Context *from_ctx     = CONTEXT(interp);
-
-#if CTX_LEAK_DEBUG
-    if (Interp_debug_TEST(interp, PARROT_CTX_DESTROY_DEBUG_FLAG))
-        fprintf(stderr,
-                "[invoke cont    %p, to_ctx %p, from_ctx %p (refs %d)]\n",
-                (const void *)pmc, (void *)to_ctx, (void *)from_ctx, (int)from_ctx->ref_count);
-#endif
-    if (!to_ctx)
+    PMC * const to_ctx       = PARROT_CONTINUATION(pmc)->to_ctx;
+    if (PMC_IS_NULL(to_ctx))
         Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
                        "Continuation invoked after deactivation.");
 }
 
-
 /*
 
-=item C<void Parrot_continuation_rewind_environment(PARROT_INTERP, PMC *pmc,
-Parrot_cont *cc)>
+=item C<void Parrot_continuation_rewind_environment(PARROT_INTERP, PMC *pmc)>
 
 Restores the appropriate context for the continuation.
 
@@ -703,15 +565,15 @@
 */
 
 void
-Parrot_continuation_rewind_environment(PARROT_INTERP, SHIM(PMC *pmc),
-        ARGIN(Parrot_cont *cc))
+Parrot_continuation_rewind_environment(PARROT_INTERP, ARGIN(PMC *pmc))
 {
     ASSERT_ARGS(Parrot_continuation_rewind_environment)
-    Parrot_Context * const to_ctx = cc->to_ctx;
+
+    PMC * const to_ctx = PARROT_CONTINUATION(pmc)->to_ctx;
 
     /* debug print before context is switched */
     if (Interp_trace_TEST(interp, PARROT_TRACE_SUB_CALL_FLAG)) {
-        PMC * const sub = to_ctx->current_sub;
+        PMC * const sub = Parrot_pcc_get_sub(interp, to_ctx);
 
         Parrot_io_eprintf(interp, "# Back in sub '%Ss', env %p\n",
                     Parrot_full_sub_name(interp, sub),
@@ -719,16 +581,13 @@
     }
 
     /* set context */
-    CONTEXT(interp)      = to_ctx;
-    interp->ctx.bp       = to_ctx->bp;
-    interp->ctx.bp_ps    = to_ctx->bp_ps;
+    CURRENT_CONTEXT(interp) = to_ctx;
 }
 
 
 /*
 
-=item C<Parrot_sub * Parrot_get_sub_pmc_from_subclass(PARROT_INTERP, PMC
-*subclass)>
+=item C<void * Parrot_get_sub_pmc_from_subclass(PARROT_INTERP, PMC *subclass)>
 
 Gets a Parrot_sub structure from something that isn't a Sub PMC, but rather a
 subclass.
@@ -739,19 +598,17 @@
 
 PARROT_EXPORT
 PARROT_CANNOT_RETURN_NULL
-Parrot_sub *
+void *
 Parrot_get_sub_pmc_from_subclass(PARROT_INTERP, ARGIN(PMC *subclass)) {
     ASSERT_ARGS(Parrot_get_sub_pmc_from_subclass)
-    PMC        *key, *sub_pmc;
-    Parrot_sub *sub;
+    PMC *key, *sub_pmc;
 
     /* Ensure we really do have a subclass of sub. */
     if (VTABLE_isa(interp, subclass, CONST_STRING(interp, "Sub"))) {
         /* If it's actually a PMC still, probably does the same structure
          * underneath. */
         if (!PObj_is_object_TEST(subclass)) {
-            GETATTR_Sub_sub(interp, subclass, sub);
-            return sub;
+            return PARROT_SUB(subclass);
         }
 
         /* Get the Sub PMC itself. */
@@ -759,8 +616,7 @@
         VTABLE_set_string_native(interp, key, CONST_STRING(interp, "Sub"));
         sub_pmc = VTABLE_get_attr_keyed(interp, subclass, key, CONST_STRING(interp, "proxy"));
         if (sub_pmc->vtable->base_type == enum_class_Sub) {
-            GETATTR_Sub_sub(interp, sub_pmc, sub);
-            return sub;
+            return PARROT_SUB(sub_pmc);
         }
     }
     Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,

Modified: branches/orderedhash_revamp/src/thread.c
==============================================================================
--- branches/orderedhash_revamp/src/thread.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/thread.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -103,46 +103,46 @@
 PARROT_CAN_RETURN_NULL
 static void* thread_func(ARGIN_NULLOK(void *arg));
 
-#define ASSERT_ARGS_detach __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_get_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_is_suspended_for_gc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_make_local_args_copy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_detach __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_get_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_is_suspended_for_gc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_make_local_args_copy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(old_interp)
-#define ASSERT_ARGS_make_local_copy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(old_interp))
+#define ASSERT_ARGS_make_local_copy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(from) \
-    || PARROT_ASSERT_ARG(arg)
-#define ASSERT_ARGS_mutex_unlock __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(arg)
-#define ASSERT_ARGS_pt_check_tid __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(from)
-#define ASSERT_ARGS_pt_gc_count_threads __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_pt_gc_wait_for_stage __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_pt_gc_wakeup_check __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_pt_ns_clone __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(from) \
+    , PARROT_ASSERT_ARG(arg))
+#define ASSERT_ARGS_mutex_unlock __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(arg))
+#define ASSERT_ARGS_pt_check_tid __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(from))
+#define ASSERT_ARGS_pt_gc_count_threads __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_pt_gc_wait_for_stage __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_pt_gc_wakeup_check __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_pt_ns_clone __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(d) \
-    || PARROT_ASSERT_ARG(dest_ns) \
-    || PARROT_ASSERT_ARG(s) \
-    || PARROT_ASSERT_ARG(source_ns)
-#define ASSERT_ARGS_pt_suspend_all_for_gc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_pt_suspend_one_for_gc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_pt_thread_signal __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+    , PARROT_ASSERT_ARG(d) \
+    , PARROT_ASSERT_ARG(dest_ns) \
+    , PARROT_ASSERT_ARG(s) \
+    , PARROT_ASSERT_ARG(source_ns))
+#define ASSERT_ARGS_pt_suspend_all_for_gc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_pt_suspend_one_for_gc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_pt_thread_signal __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(self) \
-    || PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_pt_thread_wait __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_remove_queued_suspend_gc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_thread_func __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
+    , PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_pt_thread_wait __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_remove_queued_suspend_gc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_thread_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -201,7 +201,7 @@
          * working as one might expect mainly because the segment is
          * not correctly copied
          */
-        Parrot_sub     *ret_val_sub, *arg_sub;
+        Parrot_Sub_attributes *ret_val_sub, *arg_sub;
 
         ret_val               = Parrot_clone(interp, arg);
         PMC_get_sub(interp, ret_val, ret_val_sub);
@@ -501,7 +501,7 @@
     PMC             * volatile sub_pmc;
     PMC             *sub_arg;
     PMC * const      self    = (PMC*) arg;
-    PMC             *ret_val = NULL;
+    PMC             *ret_val = PMCNULL;
     Parrot_Interp    interp  =
        (Parrot_Interp)((Parrot_ParrotInterpreter_attributes *)PMC_data(self))->interp;
 
@@ -524,15 +524,13 @@
                     VTABLE_get_string(interp, exception),
                     VTABLE_get_integer_keyed_str(interp, exception,
                         Parrot_str_new_constant(interp, "type"))); */
-
-        ret_val = PMCNULL;
     }
     else {
         /* run normally */
         Parrot_ex_add_c_handler(interp, &jump_point);
         Parrot_unblock_GC_mark(interp);
         Parrot_unblock_GC_sweep(interp);
-        ret_val = Parrot_runops_fromc_args(interp, sub_pmc, "PF", sub_arg);
+        Parrot_pcc_invoke_sub_from_c_args(interp, sub_pmc, "Pf->P", sub_arg, &ret_val);
     }
 
     /* thread is finito */
@@ -632,7 +630,7 @@
 
             if (PMC_IS_NULL(dval)) {
                 PMC * const copy = make_local_copy(d, s, val);
-                Parrot_sub *val_sub;
+                Parrot_Sub_attributes *val_sub;
 
                 if (val->vtable->base_type == enum_class_Sub)
                     PMC_get_sub(interp, val, val_sub);
@@ -1125,7 +1123,6 @@
     Shared_gc_info * const info = shared_gc_info;
     int             thread_count;
 
-    /* XXX: maybe a little hack; see RT #49532 */
     if (!info)
         return;
 
@@ -1620,8 +1617,7 @@
 =item C<void pt_gc_start_mark(PARROT_INTERP)>
 
 Record that the mark phase of GC is about to begin. In the presence of shared
-PMCs, we can only run one GC run at a time because C<< PMC->next_for_GC >> may
-be changed.
+PMCs, we can only run one GC run at a time.
 
 C<flags> are the GC flags. We check if we need to collect shared objects or
 not.
@@ -1696,8 +1692,7 @@
 
     DEBUG_ONLY(fprintf(stderr, "actually mark\n"));
     /*
-     * We can't allow parallel running GCs; both would mess with shared PMCs'
-     * next_for_GC pointers
+     * We can't allow parallel running GCs.
      */
     LOCK(interpreter_array_mutex);
     DEBUG_ONLY(fprintf(stderr, "got marking lock\n"));

Modified: branches/orderedhash_revamp/src/utils.c
==============================================================================
--- branches/orderedhash_revamp/src/utils.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/utils.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -70,23 +70,23 @@
     ARGIN(parrot_prm_context* c))
         __attribute__nonnull__(2);
 
-#define ASSERT_ARGS__drand48 __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS__erand48 __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS__jrand48 __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS__lrand48 __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS__mrand48 __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS__nrand48 __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS__srand48 __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_COMPARE __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS__drand48 __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS__erand48 __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS__jrand48 __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS__lrand48 __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS__mrand48 __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS__nrand48 __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS__srand48 __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_COMPARE __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(a) \
-    || PARROT_ASSERT_ARG(b) \
-    || PARROT_ASSERT_ARG(cmp)
-#define ASSERT_ARGS_next_rand __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_process_cycle_without_exit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(c)
-#define ASSERT_ARGS_rec_climb_back_and_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(c)
+    , PARROT_ASSERT_ARG(a) \
+    , PARROT_ASSERT_ARG(b) \
+    , PARROT_ASSERT_ARG(cmp))
+#define ASSERT_ARGS_next_rand __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_process_cycle_without_exit __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(c))
+#define ASSERT_ARGS_rec_climb_back_and_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(c))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -544,6 +544,7 @@
 tm_to_array(PARROT_INTERP, ARGIN(const struct tm *tm))
 {
     ASSERT_ARGS(tm_to_array)
+    /* TT #1270 Should make this a FixedIntegerArray instead of an Array */
     PMC * const Array = pmc_new(interp, enum_class_Array);
 
     VTABLE_set_integer_native(interp, Array, 9);
@@ -631,7 +632,7 @@
 {
     ASSERT_ARGS(Parrot_byte_rindex)
     const INTVAL searchlen          = search->strlen;
-    const char * const search_start = search->strstart;
+    const char * const search_start = (const char *)Buffer_bufstart(search);
     UINTVAL max_possible_offset     = (base->strlen - search->strlen);
     INTVAL current_offset;
 
@@ -640,7 +641,7 @@
 
     for (current_offset = max_possible_offset; current_offset >= 0;
             current_offset--) {
-        const char * const base_start = (char *)base->strstart + current_offset;
+        const char * const base_start = (char *)Buffer_bufstart(base) + current_offset;
         if (memcmp(base_start, search_start, searchlen) == 0) {
             return current_offset;
         }
@@ -906,6 +907,7 @@
 COMPARE(PARROT_INTERP, ARGIN(void *a), ARGIN(void *b), ARGIN(PMC *cmp))
 {
     ASSERT_ARGS(COMPARE)
+    INTVAL result = 0;
     if (PMC_IS_NULL(cmp))
         return VTABLE_cmp(interp, (PMC *)a, (PMC *)b);
 
@@ -914,7 +916,8 @@
         return f(interp, a, b);
     }
 
-    return Parrot_runops_fromc_args_reti(interp, cmp, "IPP", a, b);
+    Parrot_pcc_invoke_sub_from_c_args(interp, cmp, "PP->I", a, b, &result);
+    return result;
 }
 
 /*

Modified: branches/orderedhash_revamp/src/vtable.tbl
==============================================================================
--- branches/orderedhash_revamp/src/vtable.tbl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/vtable.tbl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -10,7 +10,6 @@
 # init must be first for JITed vtable meths
 void init_pmc(PMC* initializer)
 PMC* instantiate(PMC* sig)
-PMC* instantiate_str(STRING* rep, INTVAL flags)
 void morph(PMC* type) :write
 void mark()
 void destroy()
@@ -23,7 +22,6 @@
 PMC* getprops()
 
 INTVAL type()
-INTVAL type_keyed(PMC* key)
 
 STRING* name()
 
@@ -57,7 +55,6 @@
 PMC* get_pmc_keyed(PMC* key)
 PMC* get_pmc_keyed_int(INTVAL key)
 PMC* get_pmc_keyed_str(STRING* key)
-PMC* slice(PMC* key, INTVAL flag)
 
 void* get_pointer()
 void* get_pointer_keyed(PMC* key)
@@ -66,13 +63,11 @@
 
 [STORE] :write
 void set_integer_native(INTVAL value)
-void set_integer_same(PMC* value)
 void set_integer_keyed(PMC* key, INTVAL value)
 void set_integer_keyed_int(INTVAL key, INTVAL value)
 void set_integer_keyed_str(STRING* key, INTVAL value)
 
 void set_number_native(FLOATVAL value)
-void set_number_same(PMC* value)
 void set_number_keyed(PMC* key, FLOATVAL value)
 void set_number_keyed_int(INTVAL key, FLOATVAL value)
 void set_number_keyed_str(STRING* key, FLOATVAL value)
@@ -83,7 +78,6 @@
 
 void set_string_native(STRING* value)
 void assign_string_native(STRING* value)
-void set_string_same(PMC* value)
 void set_string_keyed(PMC* key, STRING* value)
 void set_string_keyed_int(INTVAL key, STRING* value)
 void set_string_keyed_str(STRING* key, STRING* value)
@@ -316,10 +310,8 @@
 void delete_keyed_str(STRING* key)
 
 [MAIN]
-PMC* nextkey_keyed(PMC* key, INTVAL what)
-PMC* nextkey_keyed_int(INTVAL key, INTVAL what)
-PMC* nextkey_keyed_str(STRING* key, INTVAL what)
 PMC* get_iter()
+INTVAL hashvalue()
 
 opcode_t* invoke(void* next)
 

Modified: branches/orderedhash_revamp/src/vtables.c
==============================================================================
--- branches/orderedhash_revamp/src/vtables.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/vtables.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -4,10 +4,12 @@
 
 =head1 NAME
 
-src/vtables.c - Functions to build and manipulate vtables
+src/vtables.c
 
 =head1 DESCRIPTION
 
+Functions to build and manipulate vtables
+
 =head2 Functions
 
 =over 4
@@ -17,7 +19,10 @@
 */
 
 #include "parrot/parrot.h"
-#include "parrot/vtables.h"
+
+/* This function is defined in the auto-generated file core_pmcs.c */
+/* XXX Get it into some public place */
+extern void Parrot_initialize_core_pmcs(PARROT_INTERP, int pass);
 
 /* HEADERIZER HFILE: include/parrot/vtables.h */
 
@@ -208,16 +213,33 @@
         if (!vtable)
             continue;
 
-        if (vtable->mro)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)vtable->mro);
-        if (vtable->_namespace)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)vtable->_namespace);
-        if (vtable->whoami)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)vtable->whoami);
-        if (vtable->provides_str)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)vtable->provides_str);
-        if (vtable->pmc_class)
-            Parrot_gc_mark_PObj_alive(interp, (PObj *)vtable->pmc_class);
+        Parrot_gc_mark_PMC_alive(interp, vtable->mro);
+        Parrot_gc_mark_PMC_alive(interp, vtable->_namespace);
+        Parrot_gc_mark_STRING_alive(interp, vtable->whoami);
+        Parrot_gc_mark_STRING_alive(interp, vtable->provides_str);
+        Parrot_gc_mark_PMC_alive(interp, vtable->pmc_class);
+    }
+}
+
+/*
+
+=item C<void Parrot_initialize_core_vtables(PARROT_INTERP)>
+
+Initialize vtables for the core PMCs.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_initialize_core_vtables(PARROT_INTERP)
+{
+    ASSERT_ARGS(Parrot_initialize_core_vtables)
+
+    if (! interp->vtables) {
+        parrot_alloc_vtables(interp);
+        Parrot_initialize_core_pmcs(interp, 0);
     }
 }
 

Modified: branches/orderedhash_revamp/src/warnings.c
==============================================================================
--- branches/orderedhash_revamp/src/warnings.c	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/src/warnings.c	Sat Jan 23 01:49:53 2010	(r43541)
@@ -29,8 +29,8 @@
 static INTVAL print_warning(PARROT_INTERP, ARGIN_NULLOK(STRING *msg))
         __attribute__nonnull__(1);
 
-#define ASSERT_ARGS_print_warning __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_print_warning __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: static */
 
@@ -53,8 +53,7 @@
         interp->pdb->debugger :
         interp;
     Parrot_io_eprintf(tracer, "%Ss\n",
-            Parrot_Context_infostr(interp,
-                CONTEXT(interp)));
+            Parrot_Context_infostr(interp, CURRENT_CONTEXT(interp)));
 }
 
 /*

Modified: branches/orderedhash_revamp/t/benchmark/benchmarks.t
==============================================================================
--- branches/orderedhash_revamp/t/benchmark/benchmarks.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/benchmark/benchmarks.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -153,16 +153,16 @@
 #        Estimated\sops:\s200000000\n
 #        Elapsed\stime:\s\s\d+\.\d+\n
 #        M\sop\/s:\s\s\s\s\s\s\s\s\d+\.\d+\n$/x,
-    q{oo1.pasm}     => qq(10\n),
-    q{oo2.pasm}     => qq(10\n),
-    q{oo3.pasm}     => qq(10\n),
+    q{oo1.pir}      => qq(10\n),
+    q{oo2.pir}      => qq(10\n),
+    q{oo3.pir}      => qq(10\n),
     q{oo4.pasm}     => qq(500000\n),
     q{oo5.pir}      => qq(10\n),
     q{oo6.pir}      => qq(500000\n),
     q{oofib.pir}    => qr/^fib\(24\)\s=\s46368\s\d+\.\d+s$/x,
     q{overload.pir} => qq(42\n),
-    q{primes.pasm}  => qr/^N\sprimes\sup\sto\s1000\sis:\s168\n
-        last\sis:\s1001\n
+    q{primes.pasm}  => qr/^N\sprimes\sup\sto\s5000\sis:\s669\n
+        last\sis:\s4999\n
         Elapsed\stime:\s\d+\.\d+\n$/x,
     q{primes2.pir} => qr/^N\sprimes\scalculated\sto\s500\sis\s96\n
         last\sis:\s499\n$/x,

Modified: branches/orderedhash_revamp/t/codingstd/c_function_docs.t
==============================================================================
--- branches/orderedhash_revamp/t/codingstd/c_function_docs.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/codingstd/c_function_docs.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -33,7 +33,7 @@
 my $DIST = Parrot::Distribution->new;
 my $headerizer = Parrot::Headerizer->new;
 
-# can't handle .ops or .pmc files yet
+# can not handle .ops or .pmc files yet
 my @files = grep {/\.(c|h)$/ } @ARGV ? @ARGV :
     map {s/^$PConfig{build_dir}\///; $_} map {s/\\/\//g; $_} map {$_->path} $DIST->get_c_language_files();
 
@@ -71,7 +71,12 @@
             $missing = 'missing';
         }
         if ($missing) {
-            push @missing_docs, "$path ($missing)\n$function_decl\n";
+            if ($missing eq 'boilerplate only') {
+                push @missing_docs, "$path ($missing)\nIn:\n$escaped_decl\n";
+            }
+            else {
+                push @missing_docs, "$path ($missing)\n$function_decl\nWant:\n$escaped_decl\n";
+            }
         }
     }
 
@@ -79,7 +84,7 @@
         local $TODO = 'Missing function docs' if $todos{$path};
 
     ok ( ! @missing_docs, $path)
-        or diag( scalar @missing_docs
+        or diag( @missing_docs
             . " function(s) lacking documentation:\n"
             . join ("\n", @missing_docs, "\n"));
     }
@@ -93,7 +98,6 @@
 compilers/imcc/pcc.c
 compilers/imcc/reg_alloc.c
 compilers/imcc/symreg.c
-compilers/pirc/src/bcgen.c
 compilers/pirc/src/pircapi.c
 compilers/pirc/src/pircompiler.c
 compilers/pirc/src/piremit.c
@@ -120,37 +124,19 @@
 config/gen/platform/solaris/math.c
 config/gen/platform/solaris/time.c
 examples/c/nanoparrot.c
+examples/c/pbc_info.c
 examples/compilers/japhc.c
-examples/embed/lorito.c
 src/atomic/gcc_x86.c
 src/debug.c
-src/gc/gc_malloc.c
 src/gc/generational_ms.c
-src/gc/res_lea.c
 src/io/io_string.c
-src/jit/amd64/jit_defs.c
-src/jit/arm/exec_dep.c
-src/jit/i386/exec_dep.c
-src/jit/ppc/exec_dep.c
-src/nci_test.c
 src/pbc_dump.c
-src/pbc_info.c
-src/pic.c
-src/pic_jit.c
 src/string/charset/ascii.c
 src/string/charset/binary.c
 src/string/charset/iso-8859-1.c
 src/string/charset/unicode.c
 src/tsq.c
-src/jit/alpha/jit_emit.h
-src/jit/arm/jit_emit.h
-src/jit/hppa/jit_emit.h
 include/parrot/atomic/gcc_pcc.h
-src/jit/ia64/jit_emit.h
-src/jit/mips/jit_emit.h
-src/jit/ppc/jit_emit.h
-src/jit/skeleton/jit_emit.h
-src/jit/sun4/jit_emit.h
 
 # Local Variables:
 #   mode: cperl

Modified: branches/orderedhash_revamp/t/codingstd/c_indent.t
==============================================================================
--- branches/orderedhash_revamp/t/codingstd/c_indent.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/codingstd/c_indent.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -188,15 +188,26 @@
             #
             # The indentation of the previous line is not considered.
             # Check sanity by verifying that the indentation of the current line
-            # is divisible by four.
-            if ( $indent % 4 &&
-                !$state{in_comment} &&
-                $state{prev_last_char} eq ';'
-            ) {
-                push @c_indent => "$path:$state{line_cnt}\n"
-                    . "    apparent non-4 space indenting ($indent space"
-                    . ( $indent == 1 ? '' : 's' ) . ")\n";
-                $c_failed{"$path\n"} = 1;
+            # is divisible by four, unless it should be outdented by 2.
+            if ($line =~ m{: (?:\s* /\* .*? \*/)? $}x) {
+                if ( $indent % 4 != 2 &&
+                    !$state{in_comment} &&
+                    $state{prev_last_char} eq ';'
+                ) {
+                    push @c_indent => "$path:$state{line_cnt}\n"
+                        . "    apparent non-2 space outdenting ($indent spaces)\n";
+                    $c_failed{"$path\n"} = 1
+                }
+            } else {
+                if ( $indent % 4 &&
+                    !$state{in_comment} &&
+                    $state{prev_last_char} eq ';'
+                ) {
+                    push @c_indent => "$path:$state{line_cnt}\n"
+                        . "    apparent non-4 space indenting ($indent space"
+                        . ( $indent == 1 ? '' : 's' ) . ")\n";
+                    $c_failed{"$path\n"} = 1;
+                }
             }
         }
     }

Modified: branches/orderedhash_revamp/t/codingstd/c_parens.t
==============================================================================
--- branches/orderedhash_revamp/t/codingstd/c_parens.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/codingstd/c_parens.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -90,7 +90,8 @@
 
         my @lines = split( /\n/, $buf );
         for my $line (@lines) {
-            next if $line =~ m{#\s*define};    # skip #defines
+            # skip #defines and typedefs
+            next if $line =~ m{(?:(#\s*define|^\s*typedef))};
             if ( $line =~ m{ ( (?<!\w) (?:$keywords) (?: \( | \ \s+ \( ) ) }xo ) {
                 my $paren = $1;
 

Modified: branches/orderedhash_revamp/t/codingstd/copyright.t
==============================================================================
--- branches/orderedhash_revamp/t/codingstd/copyright.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/codingstd/copyright.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -4,9 +4,10 @@
 
 use strict;
 use warnings;
+use lib qw( . lib ../lib ../../lib );
+
 use Cwd;
 use File::Spec ();
-use lib qw( . lib ../lib ../../lib );
 use Parrot::Distribution;
 use Test::More tests => 3;
 
@@ -142,6 +143,10 @@
         reason  => 'heredoc text for generated file',
     },
     {
+        file    => 'tools/dev/create_language.pl',
+        reason  => 'generated files in data section',
+    },
+    {
         file    => 'examples/pir/quine_ord.pir',
         reason  => 'quine',
     },

Modified: branches/orderedhash_revamp/t/codingstd/linelength.t
==============================================================================
--- branches/orderedhash_revamp/t/codingstd/linelength.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/codingstd/linelength.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -77,7 +77,7 @@
         $line =~ s/\t/' ' x (1 + length($`) % 8)/eg;  # expand \t
         next if $line =~ m/https?:\/\//;              # skip long web addresses
         next if $line =~ m/\$Id:/;
-        next if $line =~ m/CONST_STRING\(/;           # see RT#60616, no line splits with CONST_STRING
+        next if $line =~ m/CONST_STRING\(/;
 
         return sprintf '%s:%d: %d cols', $file, $., length($line)
             if length($line) > $num_col_limit;

Modified: branches/orderedhash_revamp/t/codingstd/pod_description.t
==============================================================================
--- branches/orderedhash_revamp/t/codingstd/pod_description.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/codingstd/pod_description.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -62,11 +62,11 @@
 
 #################### SUBROUTINES ####################
 
-=head1 t/codingstd/pod_description.t
+=head1 NAME
 
-Identify files lacking 'Description' section in their POD
+t/codingstd/pod_description.t - Identify files lacking 'DESCRIPTION' in POD
 
-=head2 SYNOPSIS
+=head1 SYNOPSIS
 
     # test all files
     % prove t/codingstd/pod_description.t
@@ -74,7 +74,7 @@
     # test specific files
     % perl t/codingstd/pod_description.t perl_module.pm perl_file.pl
 
-=head2 DESCRIPTION
+=head1 DESCRIPTION
 
 Tests the Pod syntax for all files listed in F<MANIFEST> and
 F<MANIFEST.generated> that appear to contain Pod markup. If any files

Modified: branches/orderedhash_revamp/t/codingstd/svn_id.t
==============================================================================
--- branches/orderedhash_revamp/t/codingstd/svn_id.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/codingstd/svn_id.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,7 +5,7 @@
 use strict;
 use warnings;
 use Cwd;
-use File::Spec ();
+use File::Spec::Functions;
 use lib qw( . lib ../lib ../../lib );
 use Parrot::Distribution;
 use Test::More            tests => 1;
@@ -35,18 +35,18 @@
 =cut
 
 my $DIST = Parrot::Distribution->new;
-my $cwd = cwd();
+my $cwd  = getcwd(); # cwd() has some bugs when parent directory is a symbolic link
 
 # Certain files, for various reasons, cannot have an
 # SVN Id tag.  We exclude them from examination by this test.
 
 my %known_exceptions = map {
         $_ => 1,
-        ( File::Spec->catdir( $cwd, $_ ) ) => 1,
-    } qw(
-        examples/pir/quine_ord.pir
-        examples/streams/FileLines.pir
-        examples/streams/ParrotIO.pir
+        ( catdir( $cwd, $_ ) ) => 1,
+    } (
+        catfile(qw/ examples pir quine_ord.pir/),
+        catfile(qw/ examples streams FileLines.pir/),
+        catfile(qw/ examples streams ParrotIO.pir/),
     );
 
 my @files = grep { ! $known_exceptions{$_} }
@@ -59,6 +59,7 @@
             $DIST->get_pir_language_files(),
         )
 );
+
 my @no_id_files;
 
 foreach my $file (@files) {

Deleted: branches/orderedhash_revamp/t/codingstd/test_file_coverage.t
==============================================================================
--- branches/orderedhash_revamp/t/codingstd/test_file_coverage.t	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,124 +0,0 @@
-#! perl
-# Copyright (C) 2006-2007, Parrot Foundation.
-# $Id$
-
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-
-use Test::More;
-use File::Find qw( find );
-use File::Basename qw( fileparse );
-use File::Spec::Functions qw( catdir catfile );
-
-use Parrot::Config;
-
-=head1 NAME
-
-t/codingstd/test_file_coverage.t - make sure source files have matching tests
-
-=head1 SYNOPSIS
-
-    % prove t/codingstd/test_file_coverage.t
-
-=head1 DESCRIPTION
-
-Makes sure that specific source files have matching test files.
-
-=cut
-
-## make sure PMC files match test files
-PMC: {
-
-    # Set variables for pmc
-    my $pmc_dir         = 'src/pmc';
-    my $pmc_suffix      = '.pmc';
-    my $test_pmc_dir    = 't/pmc';
-    my $test_pmc_suffix = '.t';
-    my $test_pmc_miss   = find_files($pmc_dir,$pmc_suffix,$test_pmc_dir,$test_pmc_suffix);
-
-    # Set variables for dynpmc
-    my $dynpmc_dir         = 'src/dynpmc';
-    my $dynpmc_suffix      = '.pmc';
-    my $test_dynpmc_dir    = 't/dynpmc';
-    my $test_dynpmc_suffix = '.t';
-    my $test_dynpmc_miss   = find_files($dynpmc_dir,$dynpmc_suffix,$test_dynpmc_dir,$test_dynpmc_suffix);
-
-    # Set variables for dynoplibs
-    my $dynoplibs_dir         = 'src/dynoplibs';
-    my $dynoplibs_suffix      = '.ops';
-    my $test_dynoplibs_dir    = 't/dynoplibs';
-    my $test_dynoplibs_suffix = '.t';
-    my $test_dynoplibs_miss   = find_files($dynoplibs_dir,$dynoplibs_suffix,$test_dynoplibs_dir,$test_dynoplibs_suffix);
-
-    local $" = "\n\t";
-
-    # Tests in src/pmc
-    ok( !@$test_pmc_miss, "there are test files in $test_pmc_dir for all PMC files" )
-        or diag "files in $pmc_dir but not in test dir:\n\t@$test_pmc_miss";
-
-    # Tests in src/dynpmc
-    ok( !@$test_dynpmc_miss, "there are test files in $test_dynpmc_dir for all PMC files" )
-        or diag "files in $dynpmc_dir but not in test dir:\n\t@$test_dynpmc_miss";
-
-    # Tests in src/dynoplibs
-    {
-    local $TODO = "obscure.ops needs tests. (TT #819)";
-    ok( !@$test_dynoplibs_miss, "there are test files in $test_dynoplibs_dir for all OPS files" )
-        or diag "files in $dynoplibs_dir but not in test dir:\n\t@$test_dynoplibs_miss";
-    }
-}    # PMC
-
-# remember to change the number of tests :-)
-BEGIN { plan tests => 3; }
-
-sub files_of_type {
-    my ( $listref, $ext ) = @_;
-
-    return unless -f $File::Find::name && $File::Find::name =~ m/\Q$ext\E$/;
-
-    my ( $name, $path, $suffix ) = fileparse( $File::Find::name, $ext );
-
-    push @{$listref} => $name;
-}
-
-sub list_diff {
-    my ( $a, $b ) = @_;
-
-    my %elem;
-    grep { $elem{$_}++ } @$a;
-    grep { $elem{$_}-- } @$b;
-
-    return [ sort grep { $elem{$_} > 0 } keys %elem ];
-}
-
-sub find_files {
-
-    my ($type_dir,$type_suffix,$test_dir,$test_suffix) = @_;
-
-    my ( @type_files, @test_files );
-
-    # find suffix type files
-    find {
-        no_chdir => 1,
-        wanted => sub { files_of_type( \@type_files, $type_suffix ) },
-    } => catdir( $PConfig{build_dir}, $type_dir );
-
-    # find test files
-    find {
-        no_chdir => 1,
-        wanted => sub { files_of_type( \@test_files, $test_suffix ) },
-    } => catdir( $PConfig{build_dir}, $test_dir );
-
-    my $test = list_diff( \@type_files, \@test_files );
-
-    return $test;
-
-}
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/t/compilers/imcc/imcpasm/cfg.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/imcc/imcpasm/cfg.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/imcc/imcpasm/cfg.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -9,24 +9,17 @@
 
 pir_2_pasm_is( <<'CODE', <<'OUT', "unreachable 1" );
 .sub _test
-   bsr L
    print "ok\n"
    end
    noop
    noop
-L: print "sub\n"
-   ret
 .end
 CODE
 # IMCC does produce b0rken PASM files
 # see http://guest@rt.perl.org/rt3/Ticket/Display.html?id=32392
 _test:
-   bsr L
    print "ok\n"
    end
-L:
-   print "sub\n"
-   ret
 OUT
 
 pir_2_pasm_is( <<'CODE', <<'OUT', "unreachable 2" );

Modified: branches/orderedhash_revamp/t/compilers/imcc/imcpasm/opt0.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/imcc/imcpasm/opt0.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/imcc/imcpasm/opt0.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -11,7 +11,7 @@
 # generated PASM code for various optimizations at level 0
 
 SKIP: {
-    skip("disabled graph coloring register allocator, RT #57028", 1);
+    skip("disabled graph coloring register allocator, TT #1281", 1);
 pir_2_pasm_like( <<'CODE', <<'OUT', "add_n_i_n" );
 .sub _ :anon
    add $N0, $I0, $N1
@@ -43,7 +43,7 @@
 
 ##############################
 SKIP: {
-    skip("disabled graph coloring register allocator, RT #57028", 1);
+    skip("disabled graph coloring register allocator, TT #1281", 1);
 pir_2_pasm_like( <<'CODE', <<'OUT', "sub_n_i_n" );
 .sub _test
    sub $N0, $I0, $N1

Modified: branches/orderedhash_revamp/t/compilers/imcc/imcpasm/optc.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/imcc/imcpasm/optc.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/imcc/imcpasm/optc.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -253,7 +253,7 @@
   returncc/
 OUT
 
-pir_2_pasm_like( <<'CODE', <<'OUT', "tailcall 1", todo => "RT #57028" );
+pir_2_pasm_like( <<'CODE', <<'OUT', "tailcall 1", todo => "TT #1281" );
 .sub _main
     foo(1, 2)
 .end

Deleted: branches/orderedhash_revamp/t/compilers/imcc/imcpasm/sub.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/imcc/imcpasm/sub.t	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,63 +0,0 @@
-#!perl
-# Copyright (C) 2005, Parrot Foundation.
-# $Id$
-
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Parrot::Test tests => 2;
-
-##############################
-pir_2_pasm_like( <<'CODE', <<'OUT', "non-constant dest bsr, invoke" );
-.sub _main
-    $P26 = new 'Sub'
-    $I15 = set_addr _sub1
-    $P26 = $I15
-    invokecc $P26
-    ret
-_sub1:
-    ret
-.end
-CODE
-/^# IMCC does produce b0rken PASM files
-# see http://guest@rt.perl.org/rt3/Ticket/Display.html\?id=32392
-_main:
- new P(\d+), 'Sub'
- set_addr I(\d+), _sub1
- set P\1, I\2
- invokecc P\1
- ret
-_sub1:
- ret/
-OUT
-
-pir_2_pasm_like( <<'CODE', <<'OUT', "nonlocal bsr" );
-.sub _main
-    $P26 = new 'Sub'
-    $I15 = set_addr _f
-    $P26 = $I15
-    invokecc $P26
-    ret
-.end
-.sub _f
-    ret
-.end
-CODE
-/^# IMCC does produce b0rken PASM files
-# see http://guest@rt.perl.org/rt3/Ticket/Display.html\?id=32392
-_main:
- new P(\d+), 'Sub'
- set_addr I(\d+), _f
- set P\1, I\2
- invokecc P\1
- ret
-_f:
- ret/
-OUT
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:

Deleted: branches/orderedhash_revamp/t/compilers/imcc/syn/bsr.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/imcc/syn/bsr.t	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,163 +0,0 @@
-#!perl
-# Copyright (C) 2001-2005, Parrot Foundation.
-# $Id$
-
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Config;
-use Parrot::Test tests => 7;
-
-pir_output_is( <<'CODE', <<'OUT', "bsr 1" );
-# this tests register allocation/preserving of local bsr calls
-.sub test :main
-   $I0 = 2
-   $I1 = 3
-   bsr L
-   print $I0
-   print $I1
-   print "\n"
-   end
-   noop
-L: $I2 = 4
-   $I3 = 5
-   ret
-.end
-CODE
-23
-OUT
-
-##############################
-# bsr recursion - caller saves
-pir_output_is( <<'CODE', <<'OUT', "recursive bsr" );
-.sub test :main
-   $P0 = new 'ResizableIntegerArray'
-   $I0 = 5	# count
-   $I1 = 1	# product
-   bsr _fact
-   print $I1
-   print "\n"
-   end
-_fact:
-   if $I0 <= 1 goto fin
-   push $P0, $I0
-   $I1 = $I1 * $I0
-   dec $I0
-   bsr _fact
-   pop $I0, $P0
-fin:
-   ret
-.end
-
-CODE
-120
-OUT
-
-##############################
-# bsr recursion - parrot calling convention
-pir_output_is( <<'CODE', <<'OUT', "tail recursive callcc" );
-.sub test :main
-   $I0 = _fact(1, 5)
-   print $I0
-   print "\n"
-   end
-.end
-
-.sub _fact
-   .param int f
-   .param int n
-   if n <= 1 goto fin
-   f = f * n
-   dec n
-   .tailcall _fact(f, n)
-fin:
-   .return(f)
-.end
-
-CODE
-120
-OUT
-
-##############################
-# coroutine
-pir_output_is( <<'CODE', <<'OUT', "coroutine" );
-.sub test :main
-    print "Hello"
-    _routine()
-    print "perl6"
-    _routine()
-    print "\n"
-    end
-.end
-.sub _routine
-   .local pmc co
-    print " "
-    .yield()
-    print "."
-    .yield()
-
-.end
-CODE
-Hello perl6.
-OUT
-
-# This is a workaround to suppress errors from POD::Checker.
-my $head1 = '=head1';
-my $cut   = '=cut';
-
-pir_output_is( <<"CODE", <<'OUT', "pod before" );
-$head1 BLA
-
- fasel
-
-$cut
-.sub test :main
-	print "ok 1\\n"
-	end
-.end
-CODE
-ok 1
-OUT
-
-pir_output_is( <<"CODE", <<'OUT', "pod before, after" );
-$head1 FOO
-
- fasel
-
-$cut
-.sub test :main
-	print "ok 1\\n"
-	end
-.end
-$head1 BAR
-
- junk
-
-CODE
-ok 1
-OUT
-
-pir_output_is( <<'CODE', <<'OUT', "bug #25948" );
-.sub main :main
-        goto L1
-test:
-        $I1 = 1
-        ret
-L1:
-        $I2 = 2
-        bsr test
-        print $I2               # printed 1, not 2
-	print "\n"
-        end
-.end
-CODE
-2
-OUT
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/t/compilers/imcc/syn/clash.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/imcc/syn/clash.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/imcc/syn/clash.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 #!perl
-# Copyright (C) 2001-2008, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
 use strict;
@@ -8,7 +8,7 @@
 
 use Test::More;
 use Parrot::Config;
-use Parrot::Test tests => 16;
+use Parrot::Test tests => 17;
 
 pir_output_is( <<'CODE', <<'OUT', "if/unless" );
 .sub test :main
@@ -170,7 +170,7 @@
 ok
 OUT
 
-pir_error_output_like( <<'CODE', <<'OUTPUT', 'new with a native type, no string constant', todo => 'RT #51662 not done yet' );
+pir_error_output_like( <<'CODE', <<'OUTPUT', 'new with a native type, no string constant', todo => 'TT #1323 not done yet' );
 .sub test :main
         $P1 = new INTVAL
     print "never\n"
@@ -261,6 +261,30 @@
 ok
 OUT
 
+pir_error_output_like( <<'CODE', <<'OUT', 'lexical redeclared in sub', todo => 'TT #1073' );
+.sub 'main' :main
+    .lex 'foo', $P0
+    $P1 = box 'ok 1'
+    store_lex 'foo', $P1
+
+    $P2 = find_lex 'foo'
+    say $P2
+
+    .lex 'bar', $P3
+    $P4 = box 'ok 2'
+    store_lex 'bar', $P4
+
+    $P5 = find_lex 'bar'
+    say $P5
+
+    .lex 'foo', $P6
+    $P7 = box 'ok 3'
+    store_lex 'foo', $P7
+.end
+CODE
+/Lexical 'foo' already declared/
+OUT
+
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4

Modified: branches/orderedhash_revamp/t/compilers/imcc/syn/const.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/imcc/syn/const.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/imcc/syn/const.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -574,7 +574,7 @@
 10
 OUT
 
-pir_output_is( <<'CODE', <<'OUT', "RT # 34991" );
+pir_output_is( <<'CODE', <<'OUT', "const int" );
 .const int c = 12
 .sub test
     .local num a

Modified: branches/orderedhash_revamp/t/compilers/imcc/syn/errors.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/imcc/syn/errors.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/imcc/syn/errors.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -67,7 +67,7 @@
 /^error:imcc:syntax error, unexpected IDENTIFIER, expecting/
 END_EXPECTED
 
-pir_error_output_like( <<'END_PIR', <<'END_EXPECTED', 'Array is on type, RT #42769' );
+pir_error_output_like( <<'END_PIR', <<'END_EXPECTED', 'Array is on type' );
 .sub main :main
   .local Array my_string
   my_string = new String
@@ -78,9 +78,6 @@
 /^error:imcc:syntax error, unexpected IDENTIFIER, expecting/
 END_EXPECTED
 
-TODO: {
-  local $TODO = 'TT #767';
-
 pir_error_output_like( <<'END_PIR', <<'END_EXPECTED', 'no multiple .local, TT #767' );
 .sub main :main
   .local pmc p
@@ -90,8 +87,6 @@
 /^error:imcc:syntax error, duplicated IDENTIFIER/
 END_EXPECTED
 
-}
-
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4

Modified: branches/orderedhash_revamp/t/compilers/imcc/syn/file.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/imcc/syn/file.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/imcc/syn/file.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -19,7 +19,7 @@
 
 syn/file.t - test inclusion of files
 
-=head1 SYNOPSIS
+=head1 DESCRIPTION
 
 A test script which is supposed to be called by Test::Harness.
 

Modified: branches/orderedhash_revamp/t/compilers/imcc/syn/hll.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/imcc/syn/hll.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/imcc/syn/hll.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -40,10 +40,13 @@
 OUT
 
 $ENV{TEST_PROG_ARGS} ||= '';
-my @todo = $ENV{TEST_PROG_ARGS} =~ /--run-pbc/
-    ? ( todo => 'classes and HLL maps not thawed from PBC, RT #60648' )
-    : ();
-pir_output_is( <<'CODE', <<'OUT', ".param :slurpy (using object)", @todo );
+
+SKIP: {
+
+skip('use of :immediate for this test does not work with --run-pbc', 1)
+  if $ENV{TEST_PROG_ARGS} =~ /--run-pbc/;
+
+pir_output_is( <<'CODE', <<'OUT', ".param :slurpy (using object)" );
 
 .sub setup :anon :immediate
  $P0 = subclass 'ResizablePMCArray', 'Stack'
@@ -77,3 +80,4 @@
 3
 Stack
 OUT
+}

Modified: branches/orderedhash_revamp/t/compilers/imcc/syn/labels.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/imcc/syn/labels.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/imcc/syn/labels.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,65 +1,49 @@
-#!perl
-# Copyright (C) 2001-2007, Parrot Foundation.
+#!parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Config;
-use Parrot::Test tests => 3;
+.sub main :main
+    .include 'test_more.pir'
+    plan(4)
+
+    test_goto_1()
+    test_goto_2()
+    test_illegal_label()
+.end
 
-##############################
-pir_output_is( <<'CODE', <<'OUT', "goto 1" );
-.sub test :main
+.sub test_goto_1
     goto foo
-    end
-foo:
-    print "ok 1\n"
-    end
+    .return()
+  foo:
+    ok(1, 'goto 1')
 .end
 
-CODE
-ok 1
-OUT
-
-##############################
-pir_output_is( <<'CODE', <<'OUT', "goto 2" );
-.sub test :main
+.sub test_goto_2
     goto foo
-bar:    print "ok 2\n"
-    end
-foo:
-    print "ok 1\n"
+  bar:
+    ok(1, 'goto 2')
+    .return()
+  foo:
+    ok(1, 'goto 2')
     goto bar
 .end
 
-CODE
-ok 1
-ok 2
-OUT
-
-##############################
-pir_error_output_like( <<'CODE', <<'OUT', "illegal label" );
-.sub bogus
-         bsr _function
-         print "never\n"
-         end
+.sub test_illegal_label
+    dies_ok( <<'CODE', 'illegal label' )
+.sub bogus :main
+    goto _function
+    print "never\n"
+    .return()
 .end
 .sub _function
-         bsr FOO
-         ret
-FOO:    print "in function\n"
-         ret
+    print "in function\n"
+    .return()
 .end
 CODE
-/no label offset defined/
-OUT
-
-
+.end
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 filetype=pir:

Modified: branches/orderedhash_revamp/t/compilers/imcc/syn/macro.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/imcc/syn/macro.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/imcc/syn/macro.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 #!perl
-# Copyright (C) 2001-2008, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
 use strict;
@@ -8,7 +8,7 @@
 
 use Test::More;
 use Parrot::Config;
-use Parrot::Test tests => 38;
+use Parrot::Test tests => 41;
 
 # macro tests
 
@@ -25,6 +25,44 @@
 42
 OUTPUT
 
+pir_error_output_like( <<'CODE', <<'OUTPUT', 'macro, zero parameters, line number' );
+.sub test :main
+.macro answer()
+    null  $P1
+    print $P1
+.endm
+    .answer()
+    end
+.end
+CODE
+/(?s:Null PMC access .*current instr.*:(4|-1)\))/
+OUTPUT
+
+pir_error_output_like( <<'CODE', <<'OUTPUT', 'macro, zero parameters, line number' );
+.sub test :main
+.macro answer()
+.endm
+    null $P1
+    print $P1
+    end
+.end
+CODE
+/(?s:Null PMC access .*current instr.*:(5|-1)\))/
+OUTPUT
+
+pir_error_output_like( <<'CODE', <<'OUTPUT', 'macro, zero parameters, line number' );
+.sub test :main
+.macro answer()
+    null $P1
+.endm
+    .answer()
+    print $P1
+    end
+.end
+CODE
+/(?s:Null PMC access .*current instr.*:(6|-1)\))/
+OUTPUT
+
 pir_output_is( <<'CODE', <<'OUTPUT', 'macro, one unused parameter, literal term' );
 .sub test :main
 .macro answer(A)
@@ -326,8 +364,7 @@
 /End of file reached/
 OUTPUT
 
-my @todo = (($^O =~ /darwin/i) ? (todo => 'Darwin segfault -- RT #60926') : ());
-pir_error_output_like( <<'CODE', <<'OUTPUT', 'unterminated macro 2', @todo );
+pir_error_output_like( <<'CODE', <<'OUTPUT', 'unterminated macro 2', );
 .sub test :main
 .macro M(A, B)
   print .A

Modified: branches/orderedhash_revamp/t/compilers/imcc/syn/objects.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/imcc/syn/objects.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/imcc/syn/objects.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,358 +1,298 @@
-#!perl
-# Copyright (C) 2001-2008, Parrot Foundation.
+#!parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Config;
-use Parrot::Test tests => 13;
-
+.sub main :main
+    .include 'test_more.pir'
+    plan(20)
+
+    test_different_namespace_declarations()
+    test_meth_call_syntax()
+    test_meth_call_syntax_m_o_arg()
+    test_meth_call_ret_o_m_arg()
+    test_meth_call_syntax_string()
+    test_initializer()
+    test_meth_call_syntax_method_self()
+    test_explicit_meth_call_syntax()
+    test_explicit_meth_call_syntax_meth_var()
+    test_explicit_meth_call_syntax_args()
+    test_explicit_meth_call_syntax_2()
+    test_meth_call_syntax_reserved_word()
+    test_vtable_implies_self()
+.end
 ##############################
 # ".namespace" sanity
 
-pir_output_is( <<'CODE', <<'OUT', "different namespace declarations");
-
+.sub test_different_namespace_declarations
+   lives_ok( <<'CODE', "different namespace declarations")
 .namespace ["Foo"]
 .namespace [ ]
 .namespace []
 
-.sub test :main
-    print "ok\n"
+.sub test 
+    $I0 = 42
 .end
 CODE
-ok
-OUT
+.end
 
 ##############################
 # Parrot Calling Conventions
 
-pir_output_is( <<'CODE', <<'OUT', "meth call syntax" );
-
-.sub test :main
+.sub test_meth_call_syntax
     .local pmc class
     .local pmc obj
     newclass class, "Foo"
     obj = new "Foo"
     obj.'_meth'()
-    print "done\n"
-    end
 .end
 
 .namespace [ "Foo" ]
 .sub _meth :method
-    print "in meth\n"
+    ok(1, 'meth call syntax')
 .end
-CODE
-in meth
-done
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "meth call syntax m.o(arg)" );
-.sub test :main
+# reset to default namespace
+.namespace []
+
+.sub test_meth_call_syntax_m_o_arg
     .local pmc class
     .local pmc obj
-    newclass class, "Foo"
-    obj = new "Foo"
+    newclass class, "Foo1"
+    obj = new "Foo1"
     $P0 = new 'String'
-    $P0 = "ok\n"
-    obj.'_meth'($P0)
-    print "done\n"
-    end
+    $P0 = "ok"
+    obj.'_meth1'($P0)
 .end
 
-.namespace [ "Foo" ]
-.sub _meth :method
+.namespace [ "Foo1" ]
+.sub _meth1 :method
     .param pmc s
-    print "in meth\n"
-    print s
+    is(s, 'ok','meth call syntax m.o(arg)')
 .end
-CODE
-in meth
-ok
-done
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "meth call ret = o.m(arg)" );
-.sub test :main
+# reset to default namespace
+.namespace []
+
+.sub test_meth_call_ret_o_m_arg
+# meth call ret = o.m(arg)
     .local pmc class
     .local pmc obj
-    newclass class, "Foo"
-    obj = new "Foo"
+    newclass class, "Foo2"
+    obj = new "Foo2"
     $P0 = new 'String'
-    $P0 = "ok\n"
+    $P0 = "ok"
     $S0 = obj.'_meth'($P0)
-    print $S0
-    end
 .end
 
-.namespace [ "Foo" ]
+.namespace [ "Foo2" ]
 .sub _meth :method
     .param pmc s
-    print "in meth\n"
-    print s
+    is(s, 'ok', 'meth call ret = o.m(arg)')
     .begin_return
     .set_return "done\n"
     .end_return
 .end
-CODE
-in meth
-ok
-done
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "meth call syntax, string" );
-.sub test :main
+# reset to default namespace
+.namespace []
+
+.sub test_meth_call_syntax_string
     .local pmc class
     .local pmc obj
     .local string meth
     meth = "_meth"
-    newclass class, "Foo"
-    obj = new "Foo"
+    newclass class, "Foo3"
+    obj = new "Foo3"
     obj."_meth"()
     set $S10, "_meth"
     obj.$S10()
     set $S10, "_meth"
     obj.$S10()
-    print "done\n"
-    end
 .end
-.namespace [ "Foo" ]
+
+.namespace [ "Foo3" ]
 .sub _meth :method
-    print "in meth\n"
+    ok(1, 'meth call syntax, string')
 .end
-CODE
-in meth
-in meth
-in meth
-done
-OUT
-
-pir_output_is( <<'CODE', <<'OUT', "initializer" );
-.sub test :main
-    newclass $P1, "Foo"
-    subclass $P2, $P1, "Bar"
-    subclass $P3, $P2, "Baz"
-    $P3 = new "Baz"
+
+# reset to default namespace
+.namespace []
+
+.sub test_initializer
+    newclass $P1, "Foo4"
+    subclass $P2, $P1, "Bar1"
+    subclass $P3, $P2, "Baz1"
+    $P3 = new "Baz1"
     get_global $P0, "_sub"
     invokecc $P0
-    print "done\n"
-    end
 .end
 
-.namespace ["Foo"]
+.namespace ["Foo4"]
 .sub init :vtable :method
-    print "foo_init\n"
+    ok(1, "initializer: foo_init")
 .end
 
-.namespace ["Bar"]
+.namespace ["Bar1"]
 .sub init :vtable :method
-    print "bar_init\n"
+    ok(1, "initializer: bar_init")
 .end
 
-.namespace ["Baz"]
+.namespace ["Baz1"]
 .sub init :vtable :method
-    print "baz_init\n"
+    ok(1, "initializer: baz_init")
 .end
 
 .namespace [] # main again
 .sub _sub
-    print "in sub\n"
+    ok(1, "initializer: in sub")
 .end
-CODE
-foo_init
-bar_init
-baz_init
-in sub
-done
-OUT
-
-pir_output_is( <<'CODE', <<'OUT', "meth call syntax - method, self" );
 
-.sub test :main
+.sub test_meth_call_syntax_method_self
+# meth call syntax - method, self
     .local pmc class
     .local pmc obj
-    newclass class, "Foo"
-    obj = new "Foo"
+    newclass class, "Foo5"
+    obj = new "Foo5"
     obj.'_meth'()
-    print "done\n"
-    end
 .end
 
-.namespace [ "Foo" ]
+.namespace [ "Foo5" ]
 .sub _meth :method
-    print "in meth\n"
-    isa $I0, self, "Foo"
+    isa $I0, self, "Foo5"
     if $I0, ok
-    print "not "
-ok:
-    print "ok\n"
+    ok(0, 'meth call syntax - method, self')
+    .return()
+  ok:
+    ok(1, 'meth call syntax - method, self')
 .end
-CODE
-in meth
-ok
-done
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "explicit meth call syntax" );
+# reset to default namespace
+.namespace []
 
-.sub test :main
+.sub test_explicit_meth_call_syntax
     .local pmc class
     .local pmc obj
-    newclass class, "Foo"
-    obj = new "Foo"
+    newclass class, "Foo6"
+    obj = new "Foo6"
     .begin_call
     .invocant obj
     .meth_call "_meth"
     .end_call
-    print "done\n"
-    end
 .end
 
-.namespace [ "Foo" ]
+.namespace [ "Foo6" ]
 .sub _meth :method
-    print "in meth\n"
+    ok(1, 'explicit meth call syntax')
 .end
-CODE
-in meth
-done
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "explicit meth call syntax, meth var" );
+# reset to default namespace
+.namespace []
 
-.sub test :main
+.sub test_explicit_meth_call_syntax_meth_var
     .local pmc class
     .local pmc obj
     .local string meth
-    newclass class, "Foo"
-    obj = new "Foo"
+    newclass class, "Foo7"
+    obj = new "Foo7"
     meth = "_me"
     meth = meth . "th"  # test concat to
     .begin_call
     .invocant obj
     .meth_call meth
     .end_call
-    print "done\n"
-    end
 .end
 
-.namespace [ "Foo" ]
+.namespace [ "Foo7" ]
 .sub _meth :method
-    print "in meth\n"
+    ok(1, 'explicit meth call syntax, meth var')
 .end
-CODE
-in meth
-done
-OUT
-pir_output_is( <<'CODE', <<'OUT', "explicit meth call syntax, args" );
 
-.sub test :main
+# reset to default namespace
+.namespace []
+
+.sub test_explicit_meth_call_syntax_args
     .local pmc class
     .local pmc obj
-    newclass class, "Foo"
-    obj = new "Foo"
+    newclass class, "Foo8"
+    obj = new "Foo8"
     .begin_call
     .set_arg "hello"
-    .set_arg "\n"
     .invocant obj
     .meth_call "_meth"
     .get_result $S0
     .end_call
-    print $S0
-    print "done\n"
-    end
+    is($S0, 'ok', 'explicit meth call syntax, args')
 .end
 
-.namespace [ "Foo" ]
+.namespace [ "Foo8" ]
+
 .sub _meth :method
     .param string p1
-    .param string p2
-    print "in meth\n"
-    print p1
-    print p2
+    is(p1, 'hello', 'explicit meth call syntax, args')
     .begin_return
-    .set_return "ok\n"
+    .set_return "ok"
     .end_return
 .end
-CODE
-in meth
-hello
-ok
-done
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "explicit meth call syntax" );
+# reset to default namespace
+.namespace []
 
-.sub test :main
+.sub test_explicit_meth_call_syntax_2
     .local pmc class
     .local pmc obj
-    newclass class, "Foo"
-    obj = new "Foo"
+    newclass class, "Foo9"
+    obj = new "Foo9"
     .begin_call
     .invocant obj
     .meth_call "_meth"
     .end_call
-    print "done\n"
-    end
 .end
 
-.namespace [ "Foo" ]
+.namespace [ "Foo9" ]
 .sub _meth :method
-    print "in meth\n"
+   ok(1, 'explicit meth call syntax')
 .end
-CODE
-in meth
-done
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "meth call syntax - reserved word" );
+# reset to default namespace
+.namespace []
 
-.sub test :main
+.sub test_meth_call_syntax_reserved_word
     .local pmc class
     .local pmc obj
-    newclass class, "Foo"
-    obj = new "Foo"
+    newclass class, "Foo10"
+    obj = new "Foo10"
     obj.'open'()
-    print "done\n"
-    end
 .end
 
-.namespace [ "Foo" ]
+.namespace [ "Foo10" ]
 .sub open :method
-    print "in meth\n"
+    ok(1, 'meth call syntax - reserved word')
 .end
-CODE
-in meth
-done
-OUT
-
-pir_output_is( <<'CODE', <<'OUT', ":vtable implies self (see RT #47674)" );
-.sub 'main' :main
-    $P1 = newclass "Foo"
-    $P2 = new "Foo"
+
+# reset to default namespace
+.namespace []
+
+.sub test_vtable_implies_self
+    $P1 = newclass "Foo11"
+    $P2 = new "Foo11"
     $S1 = $P2
-    print $S1
+    is($S1, 'stringy thingy', ':vtable implies self')
 .end
 
-.namespace [ "Foo" ]
+.namespace [ "Foo11" ]
 
 .sub 'get_string' :vtable
     self.'bar'()
-    .return ("stringy thingy\n")
+    .return ("stringy thingy")
 .end
 
 .sub bar :method
-    print "called bar\n"
+    ok(1, ":vtable implies self - called bar")
 .end
-CODE
-called bar
-stringy thingy
-OUT
 
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 filetype=pir:

Modified: branches/orderedhash_revamp/t/compilers/imcc/syn/op.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/imcc/syn/op.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/imcc/syn/op.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,533 +1,327 @@
-#!perl
-# Copyright (C) 2001-2006, Parrot Foundation.
+#!parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-
-use Test::More;
-use Parrot::Config;
-use Parrot::Test tests => 32;
-
-pir_output_is( <<'CODE', <<'OUT', "+=" );
 .sub test :main
+    .include 'test_more.pir'
+    plan(59)
+
+    test_plus_equal()
+    test_minus_equal()
+    test_times_equal()
+    test_divide_equal()
+    test_mod_equal()
+    test_dot_equal()
+    test_and_equal()
+    test_pipe_equal()
+    test_tilde_equal()
+    test_double_shift_right_equal()
+    test_triple_shift_right_equal()
+    test_double_shift_left_equal()
+    test_x_defined()
+    test_x_clone()
+    test_x_length()
+    test_x_sin()
+    test_x_can()
+    test_x_isa()
+    test_x_add()
+    test_x_invoke()
+    test_empty_sub()
+    test_if_null_x_goto_y()
+    test_unless_null_x_goto_y()
+    test_if_null_x_goto_y_2()
+    test_unless_null_x_goto_y_p0()
+    test_x_equal_a_double_equal_b()
+    test_x_equal_a_less_than_b()
+    test_x_equals_a_greater_than_b()
+    test_x_equal_a_greater_than_equal_b()
+    test_x_equal_a_less_than_equal_b()
+    test_x_equal_a_not_equal_b()
+    test_octal_hex_bin_dec_numbers()
+.end
+
+.sub test_plus_equal
     $I0 = 10
     $I0 += 20
-    print $I0
-    print "\n"
+    is($I0, 30, '+=')
 
     $I0 += -20
-    print $I0
-    print "\n"
-    end
+    is($I0, 10, '+=')
 .end
-CODE
-30
-10
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "-=" );
-.sub test :main
+.sub test_minus_equal
     $I0 = 10
     $I0 -= 20
-    print $I0
-    print "\n"
+    is($I0, -10, '-=')
 
     $I0 -= -20
-    print $I0
-    print "\n"
-    end
+    is($I0, 10, '-=')
 .end
-CODE
--10
-10
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "*=" );
-.sub test :main
+.sub test_times_equal
     $I0 = 10
     $I0 *= 20
-    print $I0
-    print "\n"
+    is($I0, 200, '*=')
 
     $I0 *= -2
-    print $I0
-    print "\n"
-    end
+    is($I0, -400, '*=')
 .end
-CODE
-200
--400
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "/=" );
-.sub test :main
+.sub test_divide_equal
     $I0 = 20
     $I0 /= 2
-    print $I0
-    print "\n"
+    is($I0, 10, '/=')
 
     $N0 = 20
     $N0 /= .5
     $I0 = $N0
-    print $I0
-    print "\n"
-
-    end
+    is($I0, 40, '/=')
 .end
-CODE
-10
-40
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "%=" );
-.sub test :main
+.sub test_mod_equal
     $I0 = 20
     $I0 %= 7
-    print $I0
-    print "\n"
+    is($I0, 6, '%=')
 
     $I0 = 200
     $I0 %= 2
-    print $I0
-    print "\n"
-    end
+    is($I0, 0, '%=')
 .end
-CODE
-6
-0
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', ".=" );
-.sub test :main
+.sub test_dot_equal
     $S0 = "ab"
     $S0 .= "cd"
-    print $S0
-    print "\n"
+    is($S0, 'abcd', '.=')
 
     $S0 .= ""
-    print $S0
-    print "\n"
-    end
+    is($S0, 'abcd', '.=')
 .end
-CODE
-abcd
-abcd
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "&=" );
-.sub test :main
+.sub test_and_equal
     $I0 =  0b1011
     $I0 &= 0b1000
-    print $I0
-    print "\n"
+    is($I0, 8, '&=')
 
     $I0 &= 0b0000
-    print $I0
-    print "\n"
-    end
+    is($I0, 0, '&=')
 .end
-CODE
-8
-0
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "|=" );
-.sub test :main
+.sub test_pipe_equal
     $I0 =  0b1011
     $I0 |= 0b1000
-    print $I0
-    print "\n"
+    is($I0, 11, '|=')
 
     $I0 |= 0b0100
-    print $I0
-    print "\n"
-    end
+    is($I0, 15, '|=')
 .end
-CODE
-11
-15
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "~=" );
-.sub test :main
+.sub test_tilde_equal
     $I0 =  0b1011
     $I0 ~= 0b1000
-    print $I0
-    print "\n"
+    is($I0, 3, '~=')
 
     $I0 ~= 0b0011
-    print $I0
-    print "\n"
-    end
+    is($I0, 0, '~=')
 .end
-CODE
-3
-0
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', ">>=" );
-.sub test :main
+.sub test_double_shift_right_equal
     $I0 =  0b1011
     $I0 >>= 1
-    print $I0
-    print "\n"
-    end
+    is($I0, 5, '>>=')
 .end
-CODE
-5
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', ">>>=" );
-.sub test :main
+.sub test_triple_shift_right_equal
     $I0 =  0b1011
     $I0 >>>= 1
-    print $I0
-    print "\n"
-    end
+    is($I0, 5, '>>>=')
 .end
-CODE
-5
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "<<=" );
-.sub test :main
+.sub test_double_shift_left_equal
     $I0 =  0b1011
     $I0 <<= 1
-    print $I0
-    print "\n"
-    end
+    is($I0, 22, '<<=')
 .end
-CODE
-22
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "x = defined" );
-.sub test :main
+.sub test_x_defined
     .local pmc a
     a = new 'ResizablePMCArray'
     push a, 10
     $I0 = defined a
-    print $I0
+    is($I0, 1, 'x = defined')
     $I0 = defined a[0]
-    print $I0
+    is($I0, 1, 'x = defined')
     $I0 = defined a[1]
-    print $I0
-    print "\n"
-    end
+    is($I0, 0, 'x = defined')
 .end
-CODE
-110
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "x = clone" );
-.sub test :main
+.sub test_x_clone
     .local pmc a
     a = new 'Integer'
     a = 10
     .local pmc b
     b = clone a
-    print b
-    print "\n"
-    end
+    is(b, 10, 'x = clone')
 .end
-CODE
-10
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "x = length" );
-.sub test :main
+.sub test_x_length
     .local string s
     s = "abc"
     $I0 = length s
-    print $I0
-    print "\n"
+    is($I0, 3, 'x = length')
 
     s = ""
     $I0 = length s
-    print $I0
-    print "\n"
-    end
+    is($I0, 0, 'x = length')
 .end
-CODE
-3
-0
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "x = sin" );
-.sub test :main
+.sub test_x_sin
     $N0 = sin 0
-    print $N0
-    print "\n"
-    end
+    is($N0, 0, 'x = sin')
 .end
-CODE
-0
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "x = can" );
-.sub test :main
+.sub test_x_can
     $P0 = new 'FileHandle'
     $I0 = can $P0, "puts"
-    print $I0
-    print "\n"
-    end
+    is($I0, 1, 'x = can')
 .end
-CODE
-1
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "x = isa" );
-.sub test :main
+.sub test_x_isa
     $P0 = new 'Integer'
     $I0 = isa $P0, "scalar"
-    print $I0
-    print "\n"
-    end
+    is($I0, 1, 'x = isa')
 .end
-CODE
-1
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "x = add" );
-.sub test :main
+.sub test_x_add
     $I0 = 10
     $I1 = add $I0, 10
-    print $I1
-    print "\n"
-    end
+    is($I1, 20, 'x = add')
 .end
-CODE
-20
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "x = invoke" );
-.sub test :main
+.sub test_x_invoke
     $P0 = get_global "_s"
     $P0 = invokecc
-    $S0 = "done\n"
-    $S0 = print
-    end
 .end
+
 .sub _s
-    print "in sub\n"
+    ok(1, 'x = invoke')
     returncc
 .end
-CODE
-in sub
-done
-OUT
 
 # ticket 32393
-pir_output_is( <<'CODE', '', "empty sub" );
+.sub test_empty_sub
+    lives_ok( <<'CODE', "empty sub" )
 .sub _foo
 .end
 
 .sub _foo :anon
 .end
 CODE
+.end
 
-pir_output_is( <<'CODE', <<'OUT', "if null X goto Y" );
-.sub main :main
+.sub test_if_null_x_goto_y
     null $P0
     if null $P0 goto BLAH
-    print "NOT A "
-BLAH:
-   print "PASS\n"
+    ok(0, 'if null X goto Y')
+    .return()
+  BLAH:
+    ok(1, 'if null X goto Y')
 .end
-CODE
-PASS
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "unless null X goto Y" );
-.sub main :main
+.sub test_unless_null_x_goto_y
     null $P0
     unless null $P0 goto BLAH
-    print "PASS\n"
-    end
-BLAH:
-   print "FAIL"
+    ok(1, 'unless null X goto Y')
+    .return()
+  BLAH:
+    ok(0, 'unless null X goto Y')
 .end
-CODE
-PASS
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "if null X goto Y" );
-.sub main :main
+.sub test_if_null_x_goto_y_2
     $S0 = "hello"
     if null $S0 goto BLAH
-    print "PASS\n"
-    end
-BLAH:
-   print "FAIL"
+    ok(1, 'if null X goto Y 2')
+    .return()
+  BLAH:
+    ok(0, 'if null X goto Y 2')
 .end
-CODE
-PASS
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', 'unless null X goto Y, $P0 = null' );
-.sub main :main
+.sub test_unless_null_x_goto_y_p0
     $P0 = null
     unless null $P0 goto BLAH
-    print "PASS\n"
-    end
-BLAH:
-   print "FAIL"
+    ok(1, 'unless null X goto Y, $P0 = null')
+    .return()
+  BLAH:
+    ok(0, 'unless null X goto Y, $P0 = null')
 .end
-CODE
-PASS
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', 'X = A == B' );
-.sub main :main
+.sub test_x_equal_a_double_equal_b
     $I0 = 1 == 1
-    print $I0
-    print "\n"
-
+    is($I0, 1, 'X = A == B')
     $I0 = 1 == 0
-    print $I0
-    print "\n"
+    is($I0, 0, 'X = A == B')
 .end
-CODE
-1
-0
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', 'X = A < B' );
-.sub main :main
+.sub test_x_equal_a_less_than_b
     $I0 = 1 < 1
-    print $I0
-    print "\n"
-
+    is($I0, 0, 'X = A < B')
     $I0 = 0 < 1
-    print $I0
-    print "\n"
+    is($I0, 1, 'X = A < B')
 .end
-CODE
-0
-1
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', 'X = A > B' );
-.sub main :main
+.sub test_x_equals_a_greater_than_b
     $I0 = 1 > 1
-    print $I0
-    print "\n"
-
+    is($I0, 0, 'X = A > B')
     $I0 = 4 > 1
-    print $I0
-    print "\n"
+    is($I0, 1, 'X = A > B')
 .end
-CODE
-0
-1
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', 'X = A >= B' );
-.sub main :main
+.sub test_x_equal_a_greater_than_equal_b
     $I0 = 1 >= 1
-    print $I0
-    print "\n"
-
+    is($I0, 1, 'X = A >= B')
     $I0 = 4 >= 1
-    print $I0
-    print "\n"
-
+    is($I0, 1, 'X = A >= B')
     $I0 = 0 >= 1
-    print $I0
-    print "\n"
+    is($I0, 0, 'X = A >= B')
 .end
-CODE
-1
-1
-0
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', 'X = A <= B' );
-.sub main :main
+.sub test_x_equal_a_less_than_equal_b
     $I0 = 1 <= 1
-    print $I0
-    print "\n"
-
+    is($I0, 1, 'X = A <= B')
     $I0 = 4 <= 1
-    print $I0
-    print "\n"
-
+    is($I0, 0, 'X = A <= B')
     $I0 = 0 <= 1
-    print $I0
-    print "\n"
+    is($I0, 1, 'X = A <= B')
 .end
-CODE
-1
-0
-1
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', 'X = A != B' );
-.sub main :main
+.sub test_x_equal_a_not_equal_b
     $I0 = 1 != 1
-    print $I0
-    print "\n"
-
+    is($I0, 0, 'X = A != B')
     $I0 = 4 != 1
-    print $I0
-    print "\n"
+    is($I0, 1, 'X = A != B')
 .end
-CODE
-0
-1
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', 'Test octal/hex/bin/dec numbers' );
-.sub main :main
+.sub test_octal_hex_bin_dec_numbers
     $I0 = 0077
-    print $I0
-    print "\n"
-
+    is($I0, 77, 'Test octal/hex/bin/dec numbers')
     $I0 = 0o77
-    print $I0
-    print "\n"
-
+    is($I0, 63, 'Test octal/hex/bin/dec numbers')
     $I0 = 0xfF
-    print $I0
-    print "\n"
-
+    is($I0, 255, 'Test octal/hex/bin/dec numbers')
     $I0 = 0b1101
-    print $I0
-    print "\n"
-
+    is($I0, 13, 'Test octal/hex/bin/dec numbers')
     $I0 = 0O10
-    print $I0
-    print "\n"
-
+    is($I0, 8, 'Test octal/hex/bin/dec numbers')
     $I0 = 0X10
-    print $I0
-    print "\n"
-
+    is($I0, 16, 'Test octal/hex/bin/dec numbers')
     $I0 = 0B10
-    print $I0
-    print "\n"
-
+    is($I0, 2, 'Test octal/hex/bin/dec numbers')
     $I0 = 10
-    print $I0
-    print "\n"
-
+    is($I0, 10, 'Test octal/hex/bin/dec numbers')
 .end
-CODE
-77
-63
-255
-13
-8
-16
-2
-10
-OUT
 
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 filetype=pir:

Modified: branches/orderedhash_revamp/t/compilers/imcc/syn/pcc.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/imcc/syn/pcc.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/imcc/syn/pcc.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -7,7 +7,7 @@
 use lib qw( . lib ../lib ../../lib );
 use Test::More;
 use Parrot::Config;
-use Parrot::Test tests => 23;
+use Parrot::Test tests => 26;
 
 ##############################
 # Parrot Calling Conventions
@@ -510,7 +510,6 @@
 foo
 OUT
 
-#RT #58866 calling a PIR sub with 206 params segfaults parrot
 my $too_many_args = <<'CODE';
 .sub main :main
     'foo'(_ARGS_)
@@ -563,6 +562,80 @@
 ok 2 - Unicode method names allowed
 OUT
 
+pir_output_is( <<'CODE', <<'OUT', 'named parameters', todo => 'long version fails, TT #1030');
+.sub main
+.local pmc foo
+foo = get_global 'foo'
+
+foo('x' => 1, 'y' => 2)
+foo(1 :named('x'), 2 :named('y'))
+
+.begin_call
+.set_arg 1 :named('x')
+.set_arg 2 :named('y')
+.call foo
+.end_call
+.end
+
+.sub foo
+.param int i :named('y')
+.param int j :named('x')
+say i
+say j
+.end
+
+CODE
+2
+1
+2
+1
+2
+1
+OUT
+
+pir_output_is( <<'CODE', <<'OUT', 'escape sequences in sub names, TT #1125' );
+.sub 'main'
+    say "xyz:<\" \">"
+    .const 'Sub' $P0 = 'foo'
+    say $P0
+
+    say ""
+
+    say "xyz:<\\>"
+    .const 'Sub' $P1 = 'bar'
+    say $P1
+.end
+
+.sub "xyz:<\" \">" :subid('foo')
+    say "xyz-quote"
+.end
+
+.sub "xyz:<\\>" :subid('bar')
+    say "xyz-backslash"
+.end
+CODE
+xyz:<" ">
+xyz:<" ">
+
+xyz:<\>
+xyz:<\>
+OUT
+
+pir_output_is( <<'CODE', <<'OUT', ':named should default to param name', todo=>'TT #1152');
+.sub main
+  $I0 = 'incr'('value'=>3)
+  say $I0
+.end
+
+.sub 'incr'
+  .param int value :named
+  inc value
+  .return(value)
+.end
+CODE
+4
+OUT
+
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4

Modified: branches/orderedhash_revamp/t/compilers/imcc/syn/pod.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/imcc/syn/pod.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/imcc/syn/pod.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -9,7 +9,20 @@
 use Parrot::Config;
 use Parrot::Test tests => 4;
 
-# POD
+=head1 NAME
+
+t/compilers/imcc/syn/pod.t
+
+=head1 SYNOPSIS
+
+    % prove t/compilers/imcc/syn/pod.t
+
+=head1 DESCRIPTION
+
+Tests PIR's handling of Plain Old Documentation (POD) format.
+
+=cut
+
 
 pir_output_is( <<'CODE', <<'OUT', "simple pod" );
 .sub test :main

Modified: branches/orderedhash_revamp/t/compilers/imcc/syn/regressions.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/imcc/syn/regressions.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/imcc/syn/regressions.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -6,7 +6,7 @@
 use warnings;
 use lib qw( . lib ../lib ../../lib );
 use Test::More;
-use Parrot::Test tests => 15;
+use Parrot::Test tests => 20;
 
 pir_error_output_like( <<'CODE', <<'OUT', 'invalid get_results syntax');
 .sub main :main
@@ -37,7 +37,7 @@
 ok 2 - caught div_n_nc_nc exception
 OUT
 
-pir_output_is( <<'CODE', <<'OUT', 'comments before .param(RT #46499)');
+pir_output_is( <<'CODE', <<'OUT', 'comments before .param(TT #1035)');
 .sub main :main
   comments(1,2)
 .end
@@ -51,7 +51,7 @@
 hello
 OUT
 
-pir_output_is( <<'CODE', <<'OUT', 'comments between .param(RT #46499)', todo => 'broken');
+pir_output_is( <<'CODE', <<'OUT', 'comments between .param(TT #1035)', todo => 'broken');
 .sub main :main
   comments(1,2)
 .end
@@ -65,7 +65,7 @@
 hello
 OUT
 
-pir_output_is( <<'CODE', <<'OUT', 'whitespace before .param(RT #46499)');
+pir_output_is( <<'CODE', <<'OUT', 'whitespace before .param(TT #1035)');
 .sub main :main
   comments(1,2)
 .end
@@ -79,7 +79,7 @@
 hello
 OUT
 
-pir_output_is( <<'CODE', <<'OUT', 'whitespace between .param(RT #46499)', todo => 'broken');
+pir_output_is( <<'CODE', <<'OUT', 'whitespace between .param(TT #1035)', todo => 'broken');
 .sub main :main
   comments(1,2)
 .end
@@ -93,7 +93,7 @@
 hello
 OUT
 
-pir_error_output_like( <<'CODE', <<'OUT', 'off by one error message (RT #40204)', todo=>'broken');
+pir_error_output_like( <<'CODE', <<'OUT', 'off by one error message (TT #1016)', );
 .sub foo :main
   $P0 = new 'Hash'
   $P1 = $P0['x']
@@ -102,10 +102,10 @@
 no:
 .end
 CODE
-/(?s:Null PMC access in get_bool.*current instr.*:4\))/
+/(?s:Null PMC access in get_bool.*current instr.*:(4|-1)\))/
 OUT
 
-pir_error_output_like( <<'CODE', <<'OUT', 'bare method names not allowed (RT #45859)');
+pir_error_output_like( <<'CODE', <<'OUT', 'bare method names not allowed');
 .sub foo :main
   $P0 = new 'String'
   $P0 = 'HI'
@@ -116,10 +116,10 @@
 /Bareword method name 'lower' not allowed/
 OUT
 
-pir_error_output_like( <<'CODE', <<'OUT', ':: not allowed in identifiers (RT #48735)');
+pir_error_output_like( <<'CODE', <<'OUT', ':: not allowed in identifiers');
 .sub foo :main
   .local string a::b
-  a::b = 'HI' 
+  a::b = 'HI'
   say a::b
 .end
 CODE
@@ -154,7 +154,7 @@
 OUT
 
 my $register = "9" x 4096;
-pir_output_is( <<"CODE", <<'OUT', 'long register numbers in PIR (RT #41788)');
+pir_output_is( <<"CODE", <<'OUT', 'long register numbers in PIR (TT #1025)');
 .sub main
       \$P$register = new 'Integer'
       \$P$register = 3
@@ -167,7 +167,7 @@
 TODO: {
     local $TODO = "works in PIR, not PASM";
 
-pasm_output_is( <<"CODE", <<'OUT', 'long register numbers in PASM (RT #41788)');
+pasm_output_is( <<"CODE", <<'OUT', 'long register numbers in PASM (TT #1025)');
       new P$register, 'Integer'
       assign P$register, 3
   say P$register
@@ -177,11 +177,6 @@
 
 }
 
-TODO: {
-    local $TODO = 'Broken with CGP'
-        if defined $ENV{TEST_PROG_ARGS}
-        &&         $ENV{TEST_PROG_ARGS} =~ /--run-pbc/;
-
 pir_error_output_like( <<'CODE', <<'OUT', 'die in immediate, TT #629');
 .sub 'foo' :immediate
   die 'no'
@@ -190,9 +185,7 @@
 /no\ncurrent inst.*:[\d-]+\)$/
 OUT
 
-}
-
-pir_error_output_like( <<'CODE', <<'OUT', 'No segfault from syntax error, RT #60172');
+pir_error_output_like( <<'CODE', <<'OUT', 'No segfault from syntax error');
 .sub 'main'
     ($S0) = 'blah'(:pir_only=>1)
 .end
@@ -200,6 +193,65 @@
 /syntax error.+unexpected/
 OUT
 
+pir_output_like( <<'CODE', <<'OUT', 'Segfault, TT #1027');
+.sub main :main
+push_eh handler
+test()
+## NB: This makes sure the sub call PC is sufficiently
+## different from the exception handler PC.
+print "foo\n"
+print "bar\n"
+.return ()
+handler:
+.local pmc exception
+.local string message
+.get_results (exception, message)
+print "Error: "
+print message
+.end
+
+.sub test
+## Throw an exception.
+$P0 = new 'Exception'
+$P0 = 'oops'
+throw $P0
+.end
+CODE
+/.*/
+OUT
+
+# We shouldn't crash (and valgrind shoudn't report invalid reads)
+pir_output_is( <<'CODE', <<'OUT', 'exit is last op in sub (TT #1009)');
+.sub main :main
+    exit 0
+.end
+CODE
+OUT
+
+# This test probably belongs in subflags.t
+# The test inspired by TT #744, even though it presents differently.
+{
+    my @types = qw/string num pmc/;
+    foreach my $invalid_type (@types) {
+
+    pir_error_output_like( <<"CODE", <<"OUT", 'opt_flag must be an int' );
+
+.sub bar
+  .param pmc foo :optional
+  .param $invalid_type joe :opt_flag
+  say joe
+.end
+
+.sub main :main
+bar()
+.end
+CODE
+/:opt_flag parameter must be of type 'I', not '$invalid_type'/
+OUT
+
+    }
+}
+
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4

Modified: branches/orderedhash_revamp/t/compilers/imcc/syn/scope.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/imcc/syn/scope.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/imcc/syn/scope.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,33 +1,27 @@
-#!perl
-# Copyright (C) 2001-2005, Parrot Foundation.
+#!parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Config;
-use Parrot::Test tests => 1;
+.sub main :main
+    .include 'test_more.pir'
+    plan(2)
 
-##############################
-pir_output_is( <<'CODE', <<'OUT', "global const" );
-.sub test :main
-	.globalconst string ok = "ok\n"
-	print ok
-	_sub()
-	end
+    test_global_const()
 .end
-.sub _sub
-	print ok
+
+.sub test_global_const
+	.globalconst string ok1 = "ok\n"
+	ok(1, 'global const')
+	_global_const_sub()
+.end
+
+.sub _global_const_sub
+	ok(1, 'global const')
 .end
-CODE
-ok
-ok
-OUT
 
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 filetype=pir:

Modified: branches/orderedhash_revamp/t/compilers/imcc/syn/subflags.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/imcc/syn/subflags.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/imcc/syn/subflags.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -4,7 +4,7 @@
 
 =head1 NAME
 
-t/compilers/imcc/syn/subflags.t  - test flags on PIR subs
+t/compilers/imcc/syn/subflags.t 
 
 =head1 SYNOPSIS
 
@@ -12,6 +12,8 @@
 
 =head1 DESCRIPTION
 
+test flags on PIR subs
+
 =cut
 
 .namespace ['FlagTest']

Modified: branches/orderedhash_revamp/t/compilers/imcc/syn/symbols.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/imcc/syn/symbols.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/imcc/syn/symbols.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -46,7 +46,7 @@
 OUT
 
 # 5 ##########################
-pir_output_is( <<'CODE', <<'OUT', "RT #42769 register name 'object' is valid" );
+pir_output_is( <<'CODE', <<'OUT', "register name 'object' is valid" );
 .sub main :main
     .local int object
     object = 1

Modified: branches/orderedhash_revamp/t/compilers/imcc/syn/veracity.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/imcc/syn/veracity.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/imcc/syn/veracity.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,132 +1,115 @@
-#!perl
-# Copyright (C) 2001-2006, Parrot Foundation.
+#!parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-
-use Test::More;
-use Parrot::Config;
-use Parrot::Test tests => 5;
-
-pir_output_is( <<'CODE', <<'OUT', "Positive and negative integers" );
 .sub test :main
+    .include 'test_more.pir'
+    plan(12)
+
+    test_positive_integers()
+    test_negative_integers()
+    test_positive_zero()
+    test_negative_zero()
+    test_positive_and_negative_floats()
+    test_float_zeros()
+    test_float_nan()
+.end
+
+.sub test_positive_integers
     $I0 = 1
     unless $I0 goto not_one
-    say "1 is true"
+    ok(1, "1 is true")
+    .return()
+  not_one:
+    ok(0, "1 is true")  
+.end
 
-    not_one:
+.sub test_negative_integers
     $I0 = -1
     unless $I0 goto not_neg_one
-    say "-1 is true"
-
-    not_neg_one:
-
-    end
+    ok(1, "-1 is true")
+    .return()
+  not_neg_one:
+    ok(0, "-1 is true")
 .end
-CODE
-1 is true
--1 is true
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "Integer zeros" );
-.sub test :main
+.sub test_positive_zero
     $I0 = 0
     if $I0 goto not_zero
-    say "0 is false"
+    ok(1, "0 is false")
+    .return()
+  not_zero:
+    ok(0, "0 is false")
+.end
 
-    not_zero:
+.sub test_negative_zero
     $I0 = -0
     if $I0 goto not_neg_zero
-    say "-0 is false"
-
-    not_neg_zero:
-
-    end
+    ok(1, "-0 is false")
+    .return()
+  not_neg_zero:
+    ok(0, "-0 is false")
 .end
-CODE
-0 is false
--0 is false
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "Positive and negative floats" );
-.sub test :main
+.sub test_positive_and_negative_floats
     $N0 = 1.0
     unless $N0 goto not_one
-    say "1.0 is true"
-
-    not_one:
+    ok(1, "1.0 is true")
+    goto neg_one
+  not_one:
+    ok(0, "1.0 is true")
+  neg_one:
     $N0 = -1.0
     unless $N0 goto not_neg_one
-    say "-1.0 is true"
-
-    not_neg_one:
+    ok(1, "-1.0 is true")
+    goto pfive
+  not_neg_one:
+    ok(0, "-1.0 is true")
+  pfive:
     $N0 = 0.5
     unless $N0 goto not_pfive
-    say "0.5 is true"
-
-    not_pfive:
+    ok(1, "0.5 is true")
+    goto small
+  not_pfive:
+    ok(0, "0.5 is true")
+  small:
     $N0 = 1e-33
     unless $N0 goto not_small
-    say "1e-33 is true"
-
-    not_small:
-    end
+    ok(1, "1e-33 is true")
+    .return()
+  not_small:
+    ok(0, "1e-33 is true")
 .end
-CODE
-1.0 is true
--1.0 is true
-0.5 is true
-1e-33 is true
-OUT
-
-#TODO: {
-
-#local $TODO = "Failing due to FLOAT_IS_ZERO macro";
 
-pir_output_is( <<'CODE', <<'OUT', "Float zeros" );
-.sub test :main
+.sub test_float_zeros
     $N0 = 0.0
     if $N0 goto not_zero
-    say "0.0 is false"
-
-    not_zero:
+    ok(1, "0.0 is false")
+    goto neg_zero
+  not_zero:
+    ok(0, "0.0 is false")
+  neg_zero: 
     $N0 = -0.0
     if $N0 goto not_neg_zero
-    say "-0.0 is false"
-
-    not_neg_zero:
-
-    end
+    ok(1, "-0.0 is false")
+    .return()
+  not_neg_zero:
+    ok(0, "-0.0 is false")
 .end
-CODE
-0.0 is false
--0.0 is false
-OUT
-
-#}
-
 
-pir_output_is( <<'CODE', <<'OUT', "Float NaN" );
-.sub test :main
+.sub test_float_nan
     $N0 = 'NaN'
-    say $N0
+    is($N0, 'NaN', 'Float NaN')
     unless $N0 goto not_nan
-    say "NaN is true"
-
-    not_nan:
-    end
+    ok(1, "NaN is true")
+    .return()
+  not_nan:
+    ok(0, "NaN is true")
 .end
-CODE
-NaN
-NaN is true
-OUT
-
 
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 filetype=pir:

Modified: branches/orderedhash_revamp/t/compilers/json/from_parrot.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/json/from_parrot.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/json/from_parrot.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,14 +1,7 @@
-#!perl
-# Copyright (C) 2001-2006, Parrot Foundation.
+#!parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( t . lib ../lib ../../lib );
-
-use Test::More;
-use Parrot::Test tests => 18;
-
 =head1 NAME
 
 t/compilers/json/from_parrot.t - test parrot to JSON conversion.
@@ -23,137 +16,127 @@
 
 =cut
 
-# no. 1
-pir_output_is( <<'CODE', <<'OUT', 'Create JSON of an empty string' );
+.sub main :main
+    .include 'test_more.pir'
+    plan(39)
+
+    test_create_json_of_an_empty_string()
+    test_create_json_of_a_non_empty_string()
+    test_create_json_of_a_string_with_simple_escapes()
+    test_create_json_of_some_integers()
+    test_create_json_of_some_numbers()
+    test_create_json_of_various_scalars_with_pretty_option()
+    test_create_json_of_an_array()
+    test_create_pretty_json_of_an_array()
+    test_create_json_of_array_keep_element_ordering()
+    test_create_json_of_a_mixed_array()
+    test_create_json_of_hash()
+    test_create_non_pretty_json_of_hash()
+    test_create_json_of_nested_structure_including_resizablepmcarray_and_empties()
+    test_create_non_pretty_json_of_nested_structure()
+    test_create_json_of_string_pmcs()
+    test_create_json_of_integer_pmcs()
+    test_create_json_of_boolean_pmcs()
+    test_create_json_of_null_and_undef()
+.end
 
-.sub test :main
+
+# no. 1
+.sub test_create_json_of_an_empty_string
     .local string s
     s = ''
 
     load_bytecode 'JSON.pbc'
     $S0 = _json( s, 0 )
-    say $S0
+    is($S0, '""', 'Create JSON of an empty string')
 .end
-CODE
-""
-OUT
 
-# no. 2
-pir_output_is( <<'CODE', <<'OUT', 'Create JSON of a non-empty string' );
 
-.sub test :main
+# no. 2
+.sub test_create_json_of_a_non_empty_string
     .local string s
     s = 'abcdeABCDE01234$%^&*'
 
     load_bytecode 'JSON.pbc'
     $S0 = _json( s, 0 )
-    say $S0
+    is($S0, '"abcdeABCDE01234$%^&*"', 'Create JSON of a non-empty string')
 .end
-CODE
-"abcdeABCDE01234$%^&*"
-OUT
 
-# no. 3
-pir_output_is( <<'CODE', <<'OUT', 'Create JSON of a string with simple escapes' );
 
-.sub test :main
+# no. 3
+.sub test_create_json_of_a_string_with_simple_escapes
     .local string s
     s = "abcde\\ABCDE\"01234\n$%^&*"
     # XXX more escapes need to be tested; see http://www.json.org/
     load_bytecode 'JSON.pbc'
     $S0 = _json( s, 0 )
-    say $S0
+    is($S0, '"abcde\\ABCDE\"01234\n$%^&*"', 'Create JSON of a string with simple escapes')
 .end
-CODE
-"abcde\\ABCDE\"01234\n$%^&*"
-OUT
 
-# no. 4
-pir_output_is( <<'CODE', <<'OUT', 'Create JSON of some integers' );
 
-.sub test :main
+# no. 4..8
+.sub test_create_json_of_some_integers
     .local int i
     i = 0
     load_bytecode 'JSON.pbc'
     $S0 = _json( i, 0 )
-    say $S0
+    is($S0, 0, 'Create JSON of some integers (0)')
     i = 35
     $S0 = _json( i, 0 )
-    say $S0
+    is($S0, 35, 'Create JSON of some integers (35)')
     i = -42
     $S0 = _json( i, 0 )
-    say $S0
+    is($S0, -42, 'Create JSON of some integers (-42)')
     i = 2147483647
     $S0 = _json( i, 0 )
-    say $S0
+    is($S0, 2147483647, 'Create JSON of some integers (2147483647)')
     i = -2147483648
     $S0 = _json( i, 0 )
-    say $S0
+    is($S0, -2147483648, 'Create JSON of some integers (-2147483647)')
 .end
-CODE
-0
-35
--42
-2147483647
--2147483648
-OUT
 
-# no. 5
-pir_output_is( <<'CODE', <<'OUT', 'Create JSON of some numbers' );
 
-.sub test :main
+# no. 9..12
+.sub test_create_json_of_some_numbers
     .local num n
     n = 0.0
     load_bytecode 'JSON.pbc'
     $S0 = _json( n )
-    say $S0
+    is($S0, 0, 'Create JSON of some numbers (0)')
     n = 2.50
     $S0 = _json( n )
-    say $S0
+    is($S0, 2.5, 'Create JSON of some numbers (2.5)')
     n = -42.0
     $S0 = _json( n )
-    say $S0
+    is($S0, -42, 'Create JSON of some numbers (-42)')
     n = 4.5e1
     $S0 = _json( n )
-    say $S0
+    is($S0, 45, 'Create JSON of some numbers (45)')
 .end
-CODE
-0
-2.5
--42
-45
-OUT
 
-# no. 6
-pir_output_is( <<'CODE', <<'OUT', 'Create JSON of various scalars with pretty option' );
 
-.sub test :main
+# no. 13..15
+.sub test_create_json_of_various_scalars_with_pretty_option
     .local string s
     s = "abcde\\ABCDE\"01234\n$%^&*"
     load_bytecode 'JSON.pbc'
     $S0 = _json( s, 1 )
-    print $S0
+    is($S0, "\"abcde\\\\ABCDE\\\"01234\\n\$\%\^\&\*\"\n", 'Create JSON of various scalars with pretty option (string)')
 
     .local int i
     i = -42
     $S0 = _json( i, 1 )
-    print $S0
+    is($S0, "-42\n", 'Create JSON of various scalars with pretty option (integer)')
 
     .local num n
     n = 2.50
     $S0 = _json( n, 1 )
-    print $S0
+    is($S0, "2.5\n", 'Create JSON of various scalars with pretty option (number)')
 .end
-CODE
-"abcde\\ABCDE\"01234\n$%^&*"
--42
-2.5
-OUT
 
-# no. 7
-pir_output_is( <<'CODE', <<'OUT', 'Create JSON of an array' );
 
-.sub test :main
+# no. 16
+.sub test_create_json_of_an_array
     .local pmc array
 
     new array, 'Array'
@@ -171,16 +154,12 @@
 
     load_bytecode 'JSON.pbc'
     $S0 = _json( array, 0 )
-    say $S0
+    is($S0, '[0,1,2,3,4,5,6,7,8,9]', 'Create JSON of an array')
 .end
-CODE
-[0,1,2,3,4,5,6,7,8,9]
-OUT
 
-# no. 8
-pir_output_is( <<'CODE', <<'OUT', 'Create pretty JSON of an array' );
 
-.sub test :main
+# no. 17
+.sub test_create_pretty_json_of_an_array
     .local pmc array
 
     new array, 'Array'
@@ -198,9 +177,7 @@
 
     load_bytecode 'JSON.pbc'
     $S0 = _json( array, 1 )
-    print $S0
-.end
-CODE
+    is($S0, <<'OUTPUT', 'Create pretty JSON of an array')
 [
   0,
   1,
@@ -213,12 +190,12 @@
   8,
   9
 ]
-OUT
+OUTPUT
+.end
 
-# no. 9
-pir_output_is( <<'CODE', <<'OUT', 'Create JSON of array, keep element ordering' );
 
-.sub test :main
+# no. 18
+.sub test_create_json_of_array_keep_element_ordering
     .local pmc array
 
     new array, 'Array'
@@ -232,9 +209,7 @@
 
     load_bytecode 'JSON.pbc'
     $S0 = _json( array, 1 )
-    print $S0
-.end
-CODE
+    is($S0, <<'OUTPUT', 'Create JSON of an array, keep element ordering')
 [
   35,
   1,
@@ -243,12 +218,12 @@
   -2147483648,
   2147483647
 ]
-OUT
+OUTPUT
+.end
 
-# no. 10
-pir_output_is( <<'CODE', <<'OUT', 'Create JSON of a mixed array' );
 
-.sub test :main
+# no. 19
+.sub test_create_json_of_a_mixed_array
     .local pmc array
 
     new array, 'Array'
@@ -262,9 +237,7 @@
 
     load_bytecode 'JSON.pbc'
     $S0 = _json( array, 1 )
-    print $S0
-.end
-CODE
+    is($S0, <<'OUTPUT', 'Create JSON of a mixed array')
 [
   0,
   15,
@@ -273,12 +246,12 @@
   "json",
   0
 ]
-OUT
+OUTPUT
+.end
 
-# no. 11
-pir_output_is( <<'CODE', <<'OUT', 'Create JSON of hash' );
 
-.sub test :main
+# no. 20
+.sub test_create_json_of_hash
     .local pmc hash
 
     new hash, 'Hash'
@@ -289,21 +262,19 @@
 
     load_bytecode 'JSON.pbc'
     $S0 = _json( hash, 1 )
-    print $S0
-.end
-CODE
+    is($S0, <<'OUTPUT', 'Create JSON of hash')
 {
   "alpha" : 29,
   "beta" : "B",
   "delta" : "DELTA",
   "gamma" : 3.1
 }
-OUT
+OUTPUT
+.end
 
-# no. 12
-pir_output_is( <<'CODE', <<'OUT', 'Create non-pretty JSON of hash' );
 
-.sub test :main
+# no. 21
+.sub test_create_non_pretty_json_of_hash
     .local pmc hash
 
     new hash, 'Hash'
@@ -314,17 +285,12 @@
 
     load_bytecode 'JSON.pbc'
     $S0 = _json( hash, 0 )
-    say $S0
+    is($S0, '{"alpha":29,"beta":"B","delta":"DELTA","gamma":3.1}', 'Create non-pretty JSON of hash')
 .end
-CODE
-{"alpha":29,"beta":"B","delta":"DELTA","gamma":3.1}
-OUT
 
-# no. 13
-pir_output_is(
-    <<'CODE', <<'OUT', 'Create JSON of nested structure including ResizablePMCArray and empties' );
 
-.sub test :main
+# no. 22
+.sub test_create_json_of_nested_structure_including_resizablepmcarray_and_empties
     .local pmc street1, street2, city1, city2, country, world
 
     street1 = new 'Hash'
@@ -351,9 +317,7 @@
 
     load_bytecode 'JSON.pbc'
     $S0 = _json( world, 1 )
-    print $S0
-.end
-CODE
+    is($S0, <<'OUTPUT', 'Create JSON of nested structure including ResizablePMCArray and empties')
 {
   "population" : 1234567890,
   "some_country" : [
@@ -370,12 +334,12 @@
     ]
   ]
 }
-OUT
+OUTPUT
+.end
 
-# no. 14
-pir_output_is( <<'CODE', <<'OUT', 'Create non-pretty JSON of nested structure' );
 
-.sub test :main
+# no. 23
+.sub test_create_non_pretty_json_of_nested_structure
     .local pmc street1, street2, city1, city2, country, world
 
     street1 = new 'Hash'
@@ -402,125 +366,94 @@
 
     load_bytecode 'JSON.pbc'
     $S0 = _json( world, 0 )
-    say $S0
+    is($S0, '{"population":1234567890,"some_country":[[{"Perl":"Highway","Python":"Grove","Ruby":"Lane"},{}],[]]}', 'Create non-pretty JSON of nested structure')
 .end
-CODE
-{"population":1234567890,"some_country":[[{"Perl":"Highway","Python":"Grove","Ruby":"Lane"},{}],[]]}
-OUT
 
-# no. 15
-pir_output_is( <<'CODE', <<'OUT', 'Create JSON of String PMCs' );
 
-.sub test :main
+# no. 24..27
+.sub test_create_json_of_string_pmcs
     .local pmc s
 
     s = new 'String'
     s = ''
     load_bytecode 'JSON.pbc'
     $S0 = _json( s, 0 )
-    say $S0
+    is($S0, '""', 'Create JSON of String PMCs')
     $S0 = _json( s, 1 )
-    print $S0
+    is($S0, "\"\"\n", 'Create JSON of String PMCs')
 
     s = new 'String'
     s = "12345\"67890"
     $S0 = _json( s, 0 )
-    say $S0
+    is($S0, '"12345\"67890"', 'Create JSON of String PMCs')
     $S0 = _json( s, 1 )
-    print $S0
+    is($S0, "\"12345\\\"67890\"\n", 'Create JSON of String PMCs')
 .end
-CODE
-""
-""
-"12345\"67890"
-"12345\"67890"
-OUT
 
-# no. 16
-pir_output_is( <<'CODE', <<'OUT', 'Create JSON of Integer PMCs' );
 
-.sub test :main
+# no. 28..31
+.sub test_create_json_of_integer_pmcs
     .local pmc i
 
     i = new 'Integer'
     i = 0
     load_bytecode 'JSON.pbc'
     $S0 = _json( i, 0 )
-    say $S0
+    is($S0, 0, 'Create JSON of String PMCs')
     $S0 = _json( i, 1 )
-    print $S0
+    is($S0, "0\n", 'Create JSON of String PMCs')
 
     i = new 'Integer'
     i = -42
     $S0 = _json( i, 0 )
-    say $S0
+    is($S0, -42, 'Create JSON of String PMCs')
     $S0 = _json( i, 1 )
-    print $S0
+    is($S0, "-42\n", 'Create JSON of String PMCs')
 .end
-CODE
-0
-0
--42
--42
-OUT
 
-# no. 17
-pir_output_is( <<'CODE', <<'OUT', 'Create JSON of Boolean PMCs' );
 
-.sub test :main
+# no. 32..35
+.sub test_create_json_of_boolean_pmcs
     .local pmc b
 
     b = new 'Boolean'
     b = 0
     load_bytecode 'JSON.pbc'
     $S0 = _json( b, 0 )
-    say $S0
+    is($S0, 'false', 'Create JSON of Boolean PMCs')
     $S0 = _json( b, 1 )
-    print $S0
+    is($S0, "false\n", 'Create JSON of Boolean PMCs')
 
     b = new 'Boolean'
     b = 1
     $S0 = _json( b, 0 )
-    say $S0
+    is($S0, 'true', 'Create JSON of Boolean PMCs')
     $S0 = _json( b, 1 )
-    print $S0
+    is($S0, "true\n", 'Create JSON of Boolean PMCs')
 .end
-CODE
-false
-false
-true
-true
-OUT
 
-# no. 18
-pir_output_is( <<'CODE', <<'OUT', 'Create JSON of null and .Undef' );
 
-.sub test :main
+# no. 36..39
+.sub test_create_json_of_null_and_undef
     .local pmc n
     null n
 
     load_bytecode 'JSON.pbc'
     $S0 = _json( n, 0 )
-    say $S0
+    is($S0, 'null', 'Create JSON of null and .Undef')
     $S0 = _json( n, 1 )
-    print $S0
+    is($S0, "null\n", 'Create JSON of null and .Undef')
 
     n = new 'Undef'
     $S0 = _json( n, 0 )
-    say $S0
+    is($S0, 'null', 'Create JSON of null and .Undef')
     $S0 = _json( n, 1 )
-    print $S0
+    is($S0, "null\n", 'Create JSON of null and .Undef')
 .end
-CODE
-null
-null
-null
-null
-OUT
 
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 filetype=pir:

Modified: branches/orderedhash_revamp/t/compilers/json/to_parrot.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/json/to_parrot.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/json/to_parrot.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -676,7 +676,7 @@
 ]
 OUT
 
-# RT #44443 Need many more tests, exercising all aspects of http://www.json.org/
+# TT #1226 Need many more tests, exercising all aspects of http://www.json.org/
 
 sub json_dump_is {
     my ( $code, $dumped, $reason, %args ) = @_;

Modified: branches/orderedhash_revamp/t/compilers/pct/past.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/pct/past.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/pct/past.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -48,11 +48,6 @@
 
 }
 
-# Next tests marked as "skip" instead of "todo" to prevent false-positives in case
-# when Hash keys order occationally can be same as in test.
-SKIP: {
-skip('Hash keys order dependency', 4);
-
 pir_output_is( <<'CODE', <<'OUT', 'dump PAST::Val node in visual format' );
 .sub _main :main
     load_bytecode 'PCT.pbc'
@@ -72,8 +67,8 @@
 1
 Integer
 "ast" => PMC 'PAST;Val'  {
-    <value> => 1
     <returns> => "Integer"
+    <value> => 1
 }
 OUT
 
@@ -94,9 +89,9 @@
 .end
 CODE
 "ast" => PMC 'PAST;Var'  {
+    <lvalue> => "buz"
     <scope> => "foo"
     <viviself> => "baz"
-    <lvalue> => "buz"
 }
 OUT
 
@@ -115,10 +110,10 @@
 .end
 CODE
 "ast" => PMC 'PAST;Op'  {
+    <inline> => "%r = add %0, %1"
+    <lvalue> => "foo"
     <pasttype> => "pirop"
     <pirop> => "add"
-    <lvalue> => "foo"
-    <inline> => "%r = add %0, %1"
 }
 OUT
 
@@ -138,8 +133,6 @@
 }
 OUT
 
-}
-
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4

Modified: branches/orderedhash_revamp/t/compilers/pct/post.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/pct/post.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/pct/post.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -47,11 +47,6 @@
 
 }
 
-SKIP: {
-    skip('Hash keys order dependency', 1);
-
-# Next tests marked as "skip" instead of "todo" to prevent false-positives in case
-# when Hash keys order occationally can be same as in test.
 pir_output_is( <<'CODE', <<'OUT', 'dump POST::Op node in visual format' );
 .sub _main
     load_bytecode 'PCT.pbc'
@@ -66,14 +61,12 @@
 .end
 CODE
 "ost" => PMC 'POST;Op'  {
+    <inline> => "%r=1"
     <pirop> => "add"
     <result> => "$P1"
-    <inline> => "%r=1"
 }
 OUT
 
-}
-
 pir_output_is( <<'CODE', <<'OUT', 'dump POST::Label node in visual format' );
 .sub _main
     load_bytecode 'PCT.pbc'

Modified: branches/orderedhash_revamp/t/compilers/pge/02-match.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/pge/02-match.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/pge/02-match.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,13 +1,7 @@
-#!perl
-# Copyright (C) 2006-2007, Parrot Foundation.
+#!parrot
+# Copyright (C) 2006-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 2;
-
 =head1 NAME
 
 t/compilers/pge/02-match.t - test the Match class
@@ -23,30 +17,31 @@
 
 =cut
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'concat on a Match object (rt#39135)' );
 .sub main :main
+    .include 'test_more.pir'
+    plan(4)
+
+    test_concat_on_a_match_object()
+    test_push_on_a_match_object()
+.end
+
+.sub test_concat_on_a_match_object
     load_bytecode 'PGE.pbc'
 
     $P0 = compreg 'PGE::Perl6Regex'
     $P1 = $P0('.+')
     $P2 = $P1('world')
 
-    say $P2              # world
+    is($P2, 'world', 'concat on a Match object (rt#39135)')
 
     $P3 = new 'String'
     $P3 = 'hello '
 
     $P4 = concat $P3, $P2
-    say $P4              # hello world
+    is($P4, 'hello world', 'concat on a Match object (rt#39135)')
 .end
 
-CODE
-world
-hello world
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', 'push on a Match object' );
-.sub main :main
+.sub test_push_on_a_match_object
     .local pmc match, str, arr
     load_bytecode 'PGE.pbc'
     match = new ['PGE';'Match']
@@ -55,19 +50,14 @@
     push match, str
     arr = match.'list'()
     $I0 = elements arr
-    print $I0
-    print "\n"
+    is($I0, 1, 'push on a Match object')
     $P3 = match[0]
-    say $P3
+    is($P3, 'foo', 'push on a Match object')
 .end
-CODE
-1
-foo
-OUTPUT
 
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 filetype=pir:

Modified: branches/orderedhash_revamp/t/compilers/pge/03-optable.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/pge/03-optable.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/pge/03-optable.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,100 +1,88 @@
-#! perl
+#!parrot
 # $Id$
 
-# Copyright (C) 2006-2007, Parrot Foundation.
+# Copyright (C) 2006-2009, Parrot Foundation.
 
-use strict;
-use warnings;
-use lib qw( t . lib ../lib ../../lib ../../../lib );
-use Test::More;
-use Parrot::Test tests => 37;
-
-optable_output_is( 'a',     'term:a',                                   'Simple term' );
-optable_output_is( 'a+b',   'infix:+(term:a, term:b)',                  'Simple infix' );
-optable_output_is( 'a-b',   'infix:-(term:a, term:b)',                  'Simple infix' );
-optable_output_is( 'a+b+c', 'infix:+(infix:+(term:a, term:b), term:c)', 'left associativity' );
-optable_output_is( 'a+b-c', 'infix:-(infix:+(term:a, term:b), term:c)', 'left associativity' );
-optable_output_is( 'a-b+c', 'infix:+(infix:-(term:a, term:b), term:c)', 'left associativity' );
-
-optable_output_is( 'a+b*c', 'infix:+(term:a, infix:*(term:b, term:c))', 'tighter precedence' );
-optable_output_is( 'a*b+c', 'infix:+(infix:*(term:a, term:b), term:c)', 'tighter precedence' );
-
-optable_output_is( 'a/b/c', 'infix:/(infix:/(term:a, term:b), term:c)', 'left associativity' );
-optable_output_is( 'a*b/c', 'infix:/(infix:*(term:a, term:b), term:c)', 'left associativity' );
-optable_output_is( 'a/b*c', 'infix:*(infix:/(term:a, term:b), term:c)', 'left associativity' );
-
-optable_output_is( 'a=b*c', 'infix:=(term:a, infix:*(term:b, term:c))', 'looser precedence' );
-
-optable_output_is( 'a=b=c', 'infix:=(term:a, infix:=(term:b, term:c))', 'right associativity' );
-
-optable_output_is(
-    'a=b,c,d+e',
-    'infix:=(term:a, infix:,(term:b, term:c, infix:+(term:d, term:e)))',
-    'list associativity'
-);
-
-optable_output_is( 'a b',     'term:a (pos=1)', 'two terms in sequence' );
-optable_output_is( 'a = = b', 'term:a (pos=1)', 'two opers in sequence' );
-optable_output_is( 'a +',     'term:a (pos=1)', 'infix missing rhs' );
-
-optable_output_is( 'a++', 'postfix:++(term:a)', 'postfix' );
-optable_output_is( 'a--', 'postfix:--(term:a)', 'postfix' );
-optable_output_is( '++a', 'prefix:++(term:a)',  'prefix' );
-optable_output_is( '--a', 'prefix:--(term:a)',  'prefix' );
-
-optable_output_is( '-a',  'prefix:-(term:a)',   'prefix ltm');
-optable_output_is( '->a', 'term:->a',           'prefix ltm');
-
-optable_output_is(
-    'a*(b+c)',
-    'infix:*(term:a, circumfix:( )(infix:+(term:b, term:c)))',
-    'circumfix parens'
-);
-optable_output_is(
-    'a*b+c)+4',
-    'infix:+(infix:*(term:a, term:b), term:c) (pos=5)',
-    'extra close paren'
-);
-optable_output_is( '  )a*b+c)+4', 'failed', 'only close paren' );
-optable_output_is( '(a*b+c',      'failed', 'missing close paren' );
-optable_output_is( '(a*b+c]',     'failed', 'mismatch close paren' );
-
-optable_output_is( 'a+++--b', 'infix:+(postfix:++(term:a), prefix:--(term:b))', 'mixed tokens' );
-
-optable_output_is( '=a+4', 'failed', 'missing lhs term' );
-
-optable_output_is( 'a(b,c)', 'postcircumfix:( )(term:a, infix:,(term:b, term:c))',
-    'postcircumfix' );
-optable_output_is( 'a (b,c)', 'term:a (pos=1)', 'nows on postcircumfix' );
-
-optable_output_is( 'a()', 'postcircumfix:( )(term:a, null)', 'nullterm in postcircumfix' );
-optable_output_is( 'a[]', 'term:a (pos=1)', 'nullterm disallowed' );
-
-optable_output_is(
-    '(a=b;c;d)',
-    'circumfix:( )(infix:;(infix:=(term:a, term:b), term:c, term:d))',
-    'loose list associativity in circumfix'
-);
-
-optable_output_is(
-    '(a;b);d',
-    'circumfix:( )(infix:;(term:a, term:b)) (pos=5)',
-    'top-level stop token'
-);
-
-optable_output_is( 'a,b;c', 'infix:,(term:a, term:b) (pos=3)', 'top-level stop token' );
-
-################
-
-sub optable_output_is {
-    my ( $test, $output, $msg, %opt ) = @_;
-    my ($pir) = <<'CODE';
 .sub main :main
+    .include 'test_more.pir'
+    plan(37)
+
     load_bytecode 'compilers/pge/PGE.pbc'
     load_bytecode 'dumper.pbc'
     load_bytecode 'PGE/Dumper.pbc'
 
+    optable_output_is( 'a',     'term:a',                                   'Simple term' )
+    optable_output_is( 'a+b',   'infix:+(term:a, term:b)',                  'Simple infix' )
+    optable_output_is( 'a-b',   'infix:-(term:a, term:b)',                  'Simple infix' )
+    optable_output_is( 'a+b+c', 'infix:+(infix:+(term:a, term:b), term:c)', 'left associativity' )
+    optable_output_is( 'a+b-c', 'infix:-(infix:+(term:a, term:b), term:c)', 'left associativity' )
+    optable_output_is( 'a-b+c', 'infix:+(infix:-(term:a, term:b), term:c)', 'left associativity' )
+
+    optable_output_is( 'a+b*c', 'infix:+(term:a, infix:*(term:b, term:c))', 'tighter precedence' )
+    optable_output_is( 'a*b+c', 'infix:+(infix:*(term:a, term:b), term:c)', 'tighter precedence' )
+
+    optable_output_is( 'a/b/c', 'infix:/(infix:/(term:a, term:b), term:c)', 'left associativity' )
+    optable_output_is( 'a*b/c', 'infix:/(infix:*(term:a, term:b), term:c)', 'left associativity' )
+    optable_output_is( 'a/b*c', 'infix:*(infix:/(term:a, term:b), term:c)', 'left associativity' )
+
+    optable_output_is( 'a=b*c', 'infix:=(term:a, infix:*(term:b, term:c))', 'looser precedence' )
+
+    optable_output_is( 'a=b=c', 'infix:=(term:a, infix:=(term:b, term:c))', 'right associativity' )
+
+    optable_output_is( 'a=b,c,d+e', 'infix:=(term:a, infix:,(term:b, term:c, infix:+(term:d, term:e)))', 'list associativity' )
+
+    optable_output_is( 'a b',     'term:a (pos=1)', 'two terms in sequence' )
+    optable_output_is( 'a = = b', 'term:a (pos=1)', 'two opers in sequence' )
+    optable_output_is( 'a +',     'term:a (pos=1)', 'infix missing rhs' )
+
+    optable_output_is( 'a++', 'postfix:++(term:a)', 'postfix' )
+    optable_output_is( 'a--', 'postfix:--(term:a)', 'postfix' )
+    optable_output_is( '++a', 'prefix:++(term:a)',  'prefix' )
+    optable_output_is( '--a', 'prefix:--(term:a)',  'prefix' )
+
+    optable_output_is( '-a',  'prefix:-(term:a)',   'prefix ltm')
+    optable_output_is( '->a', 'term:->a',           'prefix ltm')
+
+    optable_output_is( 'a*(b+c)', 'infix:*(term:a, circumfix:( )(infix:+(term:b, term:c)))', 'circumfix parens' )
+    optable_output_is( 'a*b+c)+4','infix:+(infix:*(term:a, term:b), term:c) (pos=5)', 'extra close paren' )
+    optable_output_is( '  )a*b+c)+4', 'failed', 'only close paren' )
+    optable_output_is( '(a*b+c',      'failed', 'missing close paren' )
+    optable_output_is( '(a*b+c]',     'failed', 'mismatch close paren' )
+
+    optable_output_is( 'a+++--b', 'infix:+(postfix:++(term:a), prefix:--(term:b))', 'mixed tokens' )
+
+    optable_output_is( '=a+4', 'failed', 'missing lhs term' )
+
+    optable_output_is( 'a(b,c)', 'postcircumfix:( )(term:a, infix:,(term:b, term:c))', 'postcircumfix' )
+    optable_output_is( 'a (b,c)', 'term:a (pos=1)', 'nows on postcircumfix' )
+
+    optable_output_is( 'a()', 'postcircumfix:( )(term:a, null)', 'nullterm in postcircumfix' )
+    optable_output_is( 'a[]', 'term:a (pos=1)', 'nullterm disallowed' )
+
+    optable_output_is( '(a=b;c;d)', 'circumfix:( )(infix:;(infix:=(term:a, term:b), term:c, term:d))', 'loose list associativity in circumfix' )
+
+    optable_output_is( '(a;b);d', 'circumfix:( )(infix:;(term:a, term:b)) (pos=5)', 'top-level stop token' )
+
+    optable_output_is( 'a,b;c', 'infix:,(term:a, term:b) (pos=3)', 'top-level stop token' )
+.end
+
+.sub optable_output_is
+    .param string test
+    .param string output
+    .param string message
+
+    $S0 = test_optable(test)
+    is($S0, output, message)
+.end
+
+################
+
+.sub test_optable
+    .param string test
+
     .local pmc optable
+    .local string return_string
+    return_string = ''
     $P0 = get_hll_global ['PGE'], 'OPTable'
     optable = $P0.'new'()
 
@@ -127,76 +115,77 @@
     arrow = $P0("'->' <ident>")
     optable.'newtok'('term:->', 'equiv'=>'term:', 'parsed'=>arrow, 'skipkey'=>0)
 
-    .local string test
-    test = "<<test>>"
-
     .local pmc match
     match = optable.'parse'(test, 'stop'=>' ;')
     unless match goto fail
     $P0 = match['expr']
-    tree($P0)
+    $S1 = tree($P0)
+    return_string .= $S1
     $I0 = match.'to'()
     $I1 = length test
     if $I0 == $I1 goto succeed
-    print " (pos="
-    print $I0
-    print ")"
+    return_string .= " (pos="
+    $S1 = $I0
+    return_string .= $S1
+    return_string .= ")"
   succeed:
-    print "\n"
-    goto end
+    goto endz
   fail:
-    print "failed\n"
-  end:
+    return_string = "failed"
+  endz:
+    .begin_return
+    .set_return return_string
+    .end_return
 .end
 
 .sub 'tree'
     .param pmc match
     .local string type
+    .local string return_string
     $S0 = match
     if $S0 == "" goto print_null
     type = match['type']
-    print type
+    return_string .= type
     if type == 'term:' goto print_term
     if type == 'term:->' goto print_term_arrow
-    print '('
-    .local pmc iter
+    return_string .= '('
+    .local pmc it
     $P0 = match.'list'()
     if null $P0 goto iter_end
     unless $P0 goto iter_end
-    iter = new 'Iterator', $P0
-    iter = 0
-    unless iter goto iter_end
+    it = iter $P0
+    unless it goto iter_end
   iter_loop:
-    $P0 = shift iter
-    tree($P0)
-    unless iter goto iter_end
-    print ', '
+    $P0 = shift it
+    $S1 = tree($P0)
+    return_string .= $S1
+    unless it goto iter_end
+    return_string .= ', '
     goto iter_loop
   iter_end:
-    print ')'
-    goto end
+    return_string .= ')'
+    goto endz
 
   print_null:
-    print "null"
-    goto end
+    return_string .= "null"
+    goto endz
   print_term:
-    print match
-    goto end
+    $S1 = match
+    return_string .= $S1
+    goto endz
   print_term_arrow:
     $S0 = match['ident']
-    print $S0
-  end:
+    return_string .= $S0
+  endz:
+    .begin_return
+    .set_return return_string
+    .end_return
     .return ()
 .end
-CODE
-    $pir =~ s/<<test>>/$test/g;
-    $output .= "\n";
-    pir_output_is( $pir, $output, $msg, %opt );
-}
 
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 filetype=pir:

Modified: branches/orderedhash_revamp/t/compilers/pge/04-compile.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/pge/04-compile.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/pge/04-compile.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,13 +1,7 @@
-#! perl
+#!parrot
 # $Id$
 
-# Copyright (C) 2007, Parrot Foundation.
-
-use strict;
-use warnings;
-use lib qw( t . lib ../lib ../../lib ../../../lib );
-use Test::More;
-use Parrot::Test tests => 4;
+# Copyright (C) 2007-2009, Parrot Foundation.
 
 =head1 NAME
 
@@ -23,73 +17,69 @@
 
 =cut
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'basic compile, no name/grammar' );
 .namespace []
 
 .sub main :main
+    .include 'test_more.pir'
+    plan(4)
+
+    test_basic_compile_no_name_grammar()
+    test_compile_into_current_namespace()
+    test_compile_into_a_new_grammar()
+    test_compile_into_a_new_grammar_2x()
+.end
+
+
+.sub test_basic_compile_no_name_grammar
     load_bytecode 'PGE.pbc'
 
     .local pmc p6compiler
     p6compiler = compreg 'PGE::Perl6Regex'
     $P1 = p6compiler('.+')
     $P2 = $P1('ok 1')
-    say $P2
+    is($P2, 'ok 1', 'basic compile, no name/grammar')
 .end
-CODE
-ok 1
-OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'compile into current namespace' );
-.namespace []
 
-.sub main :main
+.sub test_compile_into_current_namespace
     load_bytecode 'PGE.pbc'
 
     .local pmc p6compiler
     p6compiler = compreg 'PGE::Perl6Regex'
     $P1 = p6compiler('.+', 'name'=>'xyz', 'grammar'=>'')
     $P2 = 'xyz'('ok 1')
-    say $P2
+    is($P2, 'ok 1', 'compile into current namespace')
 .end
-CODE
-ok 1
-OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'compile into a new grammar' );
-.sub main :main
+
+.sub test_compile_into_a_new_grammar
     load_bytecode 'PGE.pbc'
 
     .local pmc p6compiler
     p6compiler = compreg 'PGE::Perl6Regex'
-    $P1 = p6compiler('.+', 'name'=>'xyz', 'grammar'=>'PGE::Test')
-    $P2 = get_hll_global ['PGE';'Test'], 'xyz'
+    $P1 = p6compiler('.+', 'name'=>'xyz1', 'grammar'=>'PGE::Test')
+    $P2 = get_hll_global ['PGE';'Test'], 'xyz1'
     $P3 = $P2('ok 1')
-    say $P3
+    is($P3, 'ok 1', 'compile into a new grammar')
 .end
-CODE
-ok 1
-OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'compile into a new grammar, 2x' );
-.sub main :main
+
+.sub test_compile_into_a_new_grammar_2x
     load_bytecode 'PGE.pbc'
 
     .local pmc p6compiler
     p6compiler = compreg 'PGE::Perl6Regex'
     $P1 = p6compiler('.+', 'name'=>'abc', 'grammar'=>'PGE::Test')
-    $P1 = p6compiler('.+', 'name'=>'xyz', 'grammar'=>'PGE::Test')
+    $P1 = p6compiler('.+', 'name'=>'xyz2', 'grammar'=>'PGE::Test')
     $P2 = get_hll_global ['PGE';'Test'], 'abc'
     $P3 = $P2('ok 1')
-    say $P3
+    is($P3, 'ok 1', 'compile into a new grammar, 2x')
 .end
-CODE
-ok 1
-OUTPUT
+
 
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
-
+# vim: expandtab shiftwidth=4 filetype=pir:

Modified: branches/orderedhash_revamp/t/compilers/pge/06-grammar.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/pge/06-grammar.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/pge/06-grammar.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -180,6 +180,7 @@
     load_bytecode 'PGE.pbc'
     load_bytecode 'PGE/Perl6Grammar.pbc'
 
+    ok        = 1
     match     = parser(expr)
     result    = match
 

Modified: branches/orderedhash_revamp/t/compilers/pge/p5regex/p5rx.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/pge/p5regex/p5rx.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/pge/p5regex/p5rx.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -81,7 +81,7 @@
     push test_files, 're_tests'
 
     .local pmc file_iterator # iterate over list of files..
-               file_iterator = new 'Iterator', test_files
+               file_iterator = iter test_files
 
     .local int test_number   # the number of the test we're running
                test_number = 0
@@ -291,7 +291,9 @@
     .local string test_file
 
     test_file = 're_tests'
-    bsr reset_todo_info
+    .local pmc jmpstack
+               jmpstack = new 'ResizableIntegerArray'
+    local_branch jmpstack,  reset_todo_info
 
     $S0 = 'character class in enumeration'
     todo_info[116] = $S0
@@ -497,7 +499,7 @@
 
   reset_todo_info:
     todo_info = new 'Hash'
-    ret
+    local_return jmpstack
 
   set_todo_loop: # for developer testing. not used normally
     if $I0 > $I1 goto end_loop
@@ -505,7 +507,7 @@
     $I0 += 1
     goto set_todo_loop
   end_loop:
-    ret
+    local_return jmpstack
 .end
 
 
@@ -520,51 +522,53 @@
     .local string test_file
 
     test_file = 're_tests'
-    bsr reset_skip_info
+    .local pmc jmpstack
+               jmpstack = new 'ResizableIntegerArray'
+    local_branch jmpstack,  reset_skip_info
 
     $S0 = 'trailing modifiers'
     $I0 = 264
     $I1 = 395
-    bsr set_range
+    local_branch jmpstack,  set_range
     $I0 = 458
     $I1 = 480
-    bsr set_range
+    local_branch jmpstack,  set_range
     skip_info[483] = $S0
     skip_info[484] = $S0
     skip_info[496] = $S0
     $I0 = 609
     $I1 = 617
-    bsr set_range
+    local_branch jmpstack,  set_range
     $I0 = 627
     $I1 = 635
-    bsr set_range
+    local_branch jmpstack,  set_range
     $I0 = 645
     $I1 = 653
-    bsr set_range
+    local_branch jmpstack,  set_range
     $I0 = 663
     $I1 = 671
-    bsr set_range
+    local_branch jmpstack,  set_range
     $I0 = 681
     $I1 = 689
-    bsr set_range
+    local_branch jmpstack,  set_range
     $I0 = 699
     $I1 = 707
-    bsr set_range
+    local_branch jmpstack,  set_range
     $I0 = 717
     $I1 = 725
-    bsr set_range
+    local_branch jmpstack,  set_range
     $I0 = 735
     $I1 = 743
-    bsr set_range
+    local_branch jmpstack,  set_range
     $I0 = 753
     $I1 = 761
-    bsr set_range
+    local_branch jmpstack,  set_range
     $I0 = 771
     $I1 = 779
-    bsr set_range
+    local_branch jmpstack,  set_range
     $I0 = 789
     $I1 = 797
-    bsr set_range
+    local_branch jmpstack,  set_range
     skip_info[802] = $S0
     skip_info[803] = $S0
     skip_info[805] = $S0
@@ -626,7 +630,7 @@
     skip_info[557] = $S0
     $I0 = 568
     $I1 = 592
-    bsr set_range
+    local_branch jmpstack,  set_range
     skip_info[800] = $S0
     skip_info[828] = $S0
     skip_info[829] = $S0
@@ -637,7 +641,7 @@
     $S0 = 'hangs a parrot'
     $I0 = 806
     $I1 = 823
-    bsr set_range
+    local_branch jmpstack,  set_range
     skip_info[924] = $S0
 
     $S0 = 'unknown reason'
@@ -661,7 +665,7 @@
 
   reset_skip_info:
     skip_info = new 'Hash'
-    ret
+    local_return jmpstack
 
   set_range:                         # for setting a range of tests
     if $I0 > $I1 goto end_loop       # put range min in $I0, max in $I1
@@ -673,7 +677,7 @@
     goto set_range
   end_loop:
     $S0 = ''
-    ret
+    local_return jmpstack
 .end
 
 

Modified: branches/orderedhash_revamp/t/compilers/pge/perl6regex/01-regex.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/pge/perl6regex/01-regex.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/pge/perl6regex/01-regex.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -93,7 +93,7 @@
                has_icu = config['has_icu']
 
     .local pmc file_iterator # iterate over list of files..
-               file_iterator = new 'Iterator', test_files
+               file_iterator = iter test_files
 
     .local int test_number   # the number of the test we're running
                test_number = 0

Modified: branches/orderedhash_revamp/t/compilers/pge/perl6regex/context.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/pge/perl6regex/context.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/pge/perl6regex/context.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -188,7 +188,6 @@
 CODE
 cba
 OUT
-## RT #44445: more
 
 ## as hash
 pir_output_is( $PRE . <<'CODE'. $POST, <<OUT, 'as hash (A => "a")' );

Modified: branches/orderedhash_revamp/t/compilers/pge/perl6regex/rx_quantifiers
==============================================================================
--- branches/orderedhash_revamp/t/compilers/pge/perl6regex/rx_quantifiers	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/pge/perl6regex/rx_quantifiers	Sat Jan 23 01:49:53 2010	(r43541)
@@ -204,7 +204,7 @@
 
 ^\w+ ** ','$		foo,bar,baz	y	** with a term
 ^\w+ **? ',' ....$	foo,bar,baz	y	**? with a term
-^\w+ **[','\s*]$	foo, bar, baz	y	**? with term + ws
-:sigspace ^\w+ ** ',' $	foo, bar ,baz	y	**? under :sigspace
-:sigspace ^\w+**',' $	foo, bar ,baz	n	**? under :sigspace w/o ws
-:sigspace ^\w+**',' $	foo,bar,baz	y	**? under :sigspace w/o ws
+^\w+ **[','\s*]$	foo, bar, baz	y	** with term + ws
+:sigspace ^\w+ ** ',' $	foo, bar ,baz	y	** under :sigspace
+:sigspace ^\w+**',' $	foo, bar ,baz	n	** under :sigspace w/o ws
+:sigspace ^\w+**',' $	foo,bar,baz	y	** under :sigspace w/o ws

Modified: branches/orderedhash_revamp/t/compilers/pge/pge-hs.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/pge/pge-hs.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/pge/pge-hs.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,26 +1,30 @@
-#! perl
-# Copyright (C) 2001-2005, Parrot Foundation.
+#!parrot 
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( t . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 1;
-
 =head1 NAME
 
-t/library/pge-hs.t - Grammar Engine Haskell Output tests
+t/library/pge-hs.t
 
 =head1 SYNOPSIS
 
         % prove t/library/pge-hs.t
 
+=head1 DESCRIPTION
+
+Grammar Engine Haskell Output tests
+
 =cut
 
 # 1
-pir_output_is( <<'CODE', <<'OUT', "PGE::Hs match" );
-.sub _main
+.sub main :main
+    .include 'test_more.pir'
+    plan(1)
+
+    test_pge_hs_match()
+.end
+
+.sub test_pge_hs_match
     .local pmc match, add_rule
     .local string result
 
@@ -32,19 +36,15 @@
     add_rule("foo", "s")
     result = match("test", "t(.<foo>)t")
     eq result, "PGE_Match 0 4 [PGE_Match 1 3 [] [(\"foo\", PGE_Match 2 3 [] [])]] []\n", OK
-    print "not "
-
-OK:
-    print "ok 1\n"
-    end
+    ok(0, 'PGE::Hs match')
+    .return()
+  OK:
+    ok(1, 'PGE::Hs match')
 .end
-CODE
-ok 1
-OUT
 
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 filetype=pir:

Modified: branches/orderedhash_revamp/t/compilers/pge/pge.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/pge/pge.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/pge/pge.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -11,12 +11,16 @@
 
 =head1 NAME
 
-t/library/pge.t - Parrot Grammar Engine basic tests
+t/library/pge.t
 
 =head1 SYNOPSIS
 
         % prove -Ilib t/library/pge.t
 
+=head1 DESCRIPTION
+
+Parrot Grammar Engine basic tests
+
 =cut
 
 ## definition of PGE public api

Modified: branches/orderedhash_revamp/t/compilers/pge/pge_examples.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/pge/pge_examples.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/pge/pge_examples.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -12,12 +12,16 @@
 
 =head1 NAME
 
-t/library/pge_examples.t - Parrot Grammar Engine tests of examples
+t/library/pge_examples.t
 
 =head1 SYNOPSIS
 
     % prove t/compilers/pge/pge_examples.t
 
+=head1 DESCRIPTION
+
+Parrot Grammar Engine tests of examples
+
 =cut
 
 # 1
@@ -52,8 +56,7 @@
 OUT
 
 # 2
-my @todo = (($^O =~ /darwin/i) ? (todo => 'Darwin segfault -- TT #479') : ());
-pir_output_is( <<'CODE', <<'OUT', "parse FASTA", @todo );
+pir_output_is( <<'CODE', <<'OUT', "parse FASTA" );
 
 # Grok fasta files, which usually contain DNA, RNA or protein sequences.
 # http://en.wikipedia.org/wiki/FASTA_format

Modified: branches/orderedhash_revamp/t/compilers/pge/pge_globs.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/pge/pge_globs.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/pge/pge_globs.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -11,12 +11,16 @@
 
 =head1 NAME
 
-t/library/pge_globs.t - Parrot Grammar Engine tests of globs
+t/library/pge_globs.t
 
 =head1 SYNOPSIS
 
         % prove -Ilib t/library/pge_globs.t
 
+=head1 DESCRIPTION
+
+Parrot Grammar Engine tests of globs
+
 =cut
 
 ## literal match

Modified: branches/orderedhash_revamp/t/compilers/pge/pge_text.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/pge/pge_text.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/pge/pge_text.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -33,43 +33,44 @@
     load_bytecode 'PGE/Text.pbc'
 
     bracketed = get_global ['PGE';'Text'], "bracketed"
-
+    .local pmc jmpstack
+               jmpstack = new 'ResizableIntegerArray'
     $S0 = "{ nested { and } okay, () and <>,  escaped \\}'s } okay"
     $P0 = bracketed($S0)
-    bsr result
+    local_branch jmpstack,  result
     $S0 = "{ nested \n{ and } okay, \n() and <>, escaped \\}'s } okay"
     $P0 = bracketed($S0)
-    bsr result
+    local_branch jmpstack,  result
     $S0 = "{ nested { and } okay,  unbalanced ( and < , escaped \\}'s } okay"
     $P0 = bracketed($S0, "{}")
-    bsr result
+    local_branch jmpstack,  result
     $S0 = "{ unmatched nested { not okay, nor ( and < } not okay"
     $P0 = bracketed($S0, "{}")
-    bsr result
+    local_branch jmpstack,  result
     $S0 = "{ unbalanced nested [ even with } and ] to match not okay"
     $P0 = bracketed($S0, "{}[]")
-    bsr result
+    local_branch jmpstack,  result
     $S0 = "<a quoted \">\" unbalanced right bracket> okay"
     $P0 = bracketed($S0, "<\">")
-    bsr result
+    local_branch jmpstack,  result
     $S0 = "<quoted \">\" unbalanced of two quotes (`>>>\"\"\">>>>`)> okay"
     $P0 = bracketed($S0, "<\"`>")
-    bsr result
+    local_branch jmpstack,  result
     $S0 = "<a misquoted '>' bracket ends string>"
     $P0 = bracketed($S0, "<\"`>")
-    bsr result
+    local_branch jmpstack,  result
     .return ()
 
   result:
     if $P0 goto succeed
     print "failed\n"
-    ret
+    local_return jmpstack
   succeed:
     $I0 = $P0."to"()
     $S1 = substr $S0, $I0
     print $S1
     print "\n"
-    ret
+    local_return jmpstack
 .end
 CODE
  okay

Modified: branches/orderedhash_revamp/t/compilers/pge/pge_util.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/pge/pge_util.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/pge/pge_util.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -11,12 +11,16 @@
 
 =head1 NAME
 
-t/library/pge_util.t - Parrot Grammar Engine tests of utility rules
+t/library/pge_util.t
 
 =head1 SYNOPSIS
 
         % prove -Ilib t/library/pge_util.t
 
+=head1 DESCRIPTION
+
+Parrot Grammar Engine tests of utility rules
+
 =cut
 
 my $str = "How will this\nstring choose\nto explode?\n\nTest";

Added: branches/orderedhash_revamp/t/compilers/pge/regression.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/compilers/pge/regression.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,64 @@
+#! perl
+# Copyright (C) 2001-2009, Parrot Foundation.
+# $Id$
+
+use strict;
+use warnings;
+use lib qw( t . lib ../lib ../../lib );
+use Test::More;
+use Parrot::Test tests => 2;
+
+=head1 NAME
+
+t/compilers/pge/regression.t
+
+=head1 SYNOPSIS
+
+        % prove t/compilers/pge/regression.t
+
+=head1 DESCRIPTION
+
+PGE regression tests
+
+=cut
+
+pir_output_is( <<'CODE', <<'OUTPUT', 'load_bytecode with .pir' );
+.sub main :main
+    load_bytecode 'PGE.pbc'
+    load_bytecode 'dumper.pir'
+    load_bytecode 'PGE/Dumper.pir'
+
+    $P0 = compreg 'PGE::P5Regex'
+    $P1 = $P0('aabb*')
+    $P2 = $P1('fooaabbbar')
+
+    _dumper($P2)
+.end
+CODE
+"VAR1" => PMC 'PGE;Match' => "aabbb" @ 3
+OUTPUT
+
+pir_output_is( <<'CODE', <<'OUTPUT', 'load_bytecode with .pbc' );
+.sub main :main
+    load_bytecode 'PGE.pbc'
+    load_bytecode 'dumper.pbc'
+    load_bytecode 'PGE/Dumper.pbc'
+
+    $P0 = compreg 'PGE::P5Regex'
+    $P1 = $P0('aabb*')
+    $P2 = $P1('fooaabbbar')
+
+    _dumper($P2)
+.end
+CODE
+"VAR1" => PMC 'PGE;Match' => "aabbb" @ 3
+OUTPUT
+
+
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/t/compilers/tge/basic.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/tge/basic.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/tge/basic.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,26 +1,31 @@
-#!perl
+#!parrot
 # Copyright (C) 2005-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw(t . lib ../lib ../../lib ../../../lib);
-use Test::More;
-use Parrot::Test tests => 3;
-
 =head1 NAME
 
-t/basic.t - testing a few basic components of TGE::Grammar and TGE::Tree
+t/basic.t
 
 =head1 SYNOPSIS
 
         $ prove t/compilers/tge/basic.t
 
+=head1 DESCRIPTION
+
+testing a few basic components of TGE::Grammar and TGE::Tree
+
 =cut
 
-pir_output_is( <<'CODE', <<'OUT', 'build up a basic rule in a grammar' );
+.sub main :main
+    .include 'test_more.pir'
+     plan(11)
+
+     test_build_up_a_basic_rule_in_a_grammar()
+     test_agid_hash()
+     test_malformed_string_in_r11890_under_linux_i386()
+.end
 
-.sub _main :main
+.sub test_build_up_a_basic_rule_in_a_grammar
     load_bytecode 'TGE.pbc'
 
     .local pmc AG
@@ -31,25 +36,14 @@
     .local pmc rule_obj
     rule_obj = $P1[0]
     $P2 = getattribute rule_obj, 'type'
-    print $P2
-    print "\n"
+    is($P2, 'Leaf', 'build up a basic rule in a grammar')
     $P3 = getattribute rule_obj, 'name'
-    print $P3
-    print "\n"
+    is($P3, 'min', 'build up a basic rule in a grammar')
     $P4 = getattribute rule_obj, 'parent'
-    print $P4
-    print "\n"
-    end
+    is($P4, '.', 'build up a basic rule in a grammar')
 .end
 
-CODE
-Leaf
-min
-.
-OUT
-
-pir_output_is( <<'CODE', <<'OUT', 'agid hash' );
-.sub _main :main
+.sub test_agid_hash
     load_bytecode 'TGE.pbc'
     .local pmc tree
     tree = new ['TGE';'Tree']
@@ -57,54 +51,34 @@
 
     $P0 = new 'Integer'
     id = tree.'_lookup_id'($P0)
-    print id
-    print "\n"
+    is(id, 1, 'agid hash')
     $P1 = new 'Integer'
     id = tree.'_lookup_id'($P1)
-    print id
-    print "\n"
+    is(id, 2, 'agid hash')
     id = tree.'_lookup_id'($P0)
-    print id
-    print "\n"
+    is(id, 1, 'agid hash')
     $P2 = new 'Integer'
     id = tree.'_lookup_id'($P2)
-    print id
-    print "\n"
+    is(id, 3, 'agid hash')
     id = tree.'_lookup_id'($P0)
-    print id
-    print "\n"
+    is(id, 1, 'agid hash')
     id = tree.'_lookup_id'($P1)
-    print id
-    print "\n"
+    is(id, 2, 'agid hash')
     id = tree.'_lookup_id'($P2)
-    print id
-    print "\n"
-    end
+    is(id, 3, 'agid hash')
 .end
 
-CODE
-1
-2
-1
-3
-1
-2
-3
-OUT
-
-pir_output_is( <<'CODE', <<'OUT', '"Malformed string" in r11890 under Linux i386' );
-
-.sub test
-  load_bytecode "TGE.pbc"
-  print "1\n"
+.sub test_malformed_string_in_r11890_under_linux_i386
+    lives_ok(<<'CODE', '"Malformed string" in r11890 under Linux i386')
+.sub main 
+    load_bytecode "TGE.pbc"
 .end
 CODE
-1
-OUT
+.end
 
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 filetype=pir:

Modified: branches/orderedhash_revamp/t/compilers/tge/grammar.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/tge/grammar.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/tge/grammar.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -274,7 +274,7 @@
 OUT
 
 TODO: {
-    local $TODO = "unresolved bug";
+    local $TODO = "unresolved bug; see: TT #1160";
 
     pir_output_is(
         <<'CODE', <<'OUT', 'two rules of the same name can apply to the same node, when called with a different dummy type' );
@@ -301,12 +301,12 @@
 GRAMMAR
 
 
-    .local object testing
+    .local pmc testing
     testing = new 'Hash'
 
     # Compile a grammar from the source
     .local pmc grammar
-    $P1 = new 'TGE;Compiler'
+    $P1 = new ['TGE';'Compiler']
     grammar = $P1.'compile'(source)
 
     # Apply the grammar to the test tree

Modified: branches/orderedhash_revamp/t/compilers/tge/parser.t
==============================================================================
--- branches/orderedhash_revamp/t/compilers/tge/parser.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/compilers/tge/parser.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,28 +1,31 @@
-#!perl
+#!parrot
 # Copyright (C) 2005-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw(t . lib ../lib ../../lib ../../../lib);
-use Test::More;
-use Parrot::Test tests => 2;
-
 =head1 NAME
 
-t/parser.t - TGE::Parser tests
+t/parser.t
 
 =head1 SYNOPSIS
 
         $ prove t/compilers/tge/parser.t
 
-=cut
+=head1 DESCRIPTION
+
+TGE::Parser tests
 
-pir_output_is( <<'CODE', <<'OUT', "parse a basic attribute grammar" );
+=cut
 
-.sub _main :main
+.sub main :main
     load_bytecode 'TGE.pbc'
+    .include 'test_more.pir'
+    plan(2)
+
+    test_parse_a_basic_attribute_grammar()
+    test_parse_failure()
+.end
 
+.sub test_parse_a_basic_attribute_grammar
     .local string source
     source = <<'GRAMMAR'
     transform min (Leaf) {
@@ -41,33 +44,23 @@
     .local pmc match
     .local pmc start_rule
     start_rule = get_global ['TGE';'Parser'], "start"
-    print "loaded start rule\n"
     match = start_rule(source)
-    print "matched start rule\n"
 
     # Verify the match
     unless match goto match_fail           # if match fails stop
-    print "parse succeeded\n"
-    goto cleanup
+    ok(1, "parse a basic attribute grammar" )
+    .return()
 
   match_fail:
-    print "parse failed\n"
+    ok(0, "parse a basic attribute grammar" )
 
-  cleanup:
-    end
 .end
 
-CODE
-loaded start rule
-matched start rule
-parse succeeded
-OUT
-
-pir_error_output_like( <<'CODE', qr/Syntax error at line 4, near "transform "/, "parse failure" );
-
-.sub _main :main
+.sub test_parse_failure
+    $S0 = "Syntax error at line 4, near \"transform \"\n"
+    throws_substring(<<'CODE', $S0, 'parse failure')
+.sub main 
     load_bytecode 'TGE.pbc'
-
     .local string source
     source = <<'GRAMMAR'
     transform min (Leaf) {
@@ -82,12 +75,12 @@
     start_rule = get_global ['TGE';'Parser'], "start"
     match = start_rule(source, 'grammar'=>'TGE::Parser') # should throw.
 .end
-
 CODE
+.end
 
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 filetype=pir:

Modified: branches/orderedhash_revamp/t/configure/008-file_based_configuration.t
==============================================================================
--- branches/orderedhash_revamp/t/configure/008-file_based_configuration.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/configure/008-file_based_configuration.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -12,12 +12,12 @@
     our $topdir = realpath($Bin) . "/../..";
     unshift @INC, qq{$topdir/lib};
 }
-use Test::More qw(no_plan); # tests => 29;
+use Test::More tests => 31;
 use Carp;
 use Parrot::Configure::Options qw| process_options |;
 
 {
-    my $configfile = q{xconf/samples/testfoobar};
+    my $configfile = q{examples/config/file/configwithfatalstep};
     my ($args, $steps_list_ref) = _test_good_config_file($configfile);
 
     ok(! defined $args->{maintainer}, 
@@ -40,7 +40,7 @@
 }
 
 {
-    my $configfile = q{xconf/samples/yourfoobar};
+    my $configfile = q{examples/config/file/configcompiler};
     my ($args, $steps_list_ref) = _test_good_config_file($configfile);
     
     my $c_compiler = '/usr/bin/gcc';

Modified: branches/orderedhash_revamp/t/configure/033-step.t
==============================================================================
--- branches/orderedhash_revamp/t/configure/033-step.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/configure/033-step.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -20,8 +20,6 @@
 Parrot::Configure::Utils->import(@Parrot::Configure::Utils::EXPORT_OK);
 can_ok( __PACKAGE__, @Parrot::Configure::Utils::EXPORT_OK );
 
-# RT #44455 add verbose tests with some Test::Warn like mechanism
-
 my $cwd = cwd();
 my ( @prompts, $object, $cc, $nonexistent, $command );
 

Modified: branches/orderedhash_revamp/t/configure/testlib/Make_VERSION_File.pm
==============================================================================
--- branches/orderedhash_revamp/t/configure/testlib/Make_VERSION_File.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/configure/testlib/Make_VERSION_File.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -27,7 +27,7 @@
 
 t/configure/testlib/Make_VERSION_File.pm - Subroutines used in testing C<Parrot::Build::Util::parrot_version()>
 
-=head1 SYNOPSIS
+=head1 DESCRIPTION
 
 Use only in test scripts.
 

Modified: branches/orderedhash_revamp/t/configure/testlib/init/alpha.pm
==============================================================================
--- branches/orderedhash_revamp/t/configure/testlib/init/alpha.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/configure/testlib/init/alpha.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,6 +5,10 @@
 
 t/configure/testlib/init/alpha.pm - Module used in configuration tests
 
+=head1 DESCRIPTION
+
+Nonsense module used only in testing the configuration system.
+
 =cut
 
 package init::alpha;

Modified: branches/orderedhash_revamp/t/configure/testlib/init/beta.pm
==============================================================================
--- branches/orderedhash_revamp/t/configure/testlib/init/beta.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/configure/testlib/init/beta.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,6 +5,10 @@
 
 t/configure/testlib/init/beta.pm - Module used in configuration tests
 
+=head1 DESCRIPTION
+
+Nonsense module used only in testing the configuration system.
+
 =cut
 
 package init::beta;

Modified: branches/orderedhash_revamp/t/configure/testlib/init/delta.pm
==============================================================================
--- branches/orderedhash_revamp/t/configure/testlib/init/delta.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/configure/testlib/init/delta.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,6 +5,10 @@
 
 t/configure/testlib/init/delta.pm - Module used in configuration tests
 
+=head1 DESCRIPTION
+
+Nonsense module used only in testing the configuration system.
+
 =cut
 
 package init::delta;

Modified: branches/orderedhash_revamp/t/configure/testlib/init/epsilon.pm
==============================================================================
--- branches/orderedhash_revamp/t/configure/testlib/init/epsilon.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/configure/testlib/init/epsilon.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,6 +5,10 @@
 
 t/configure/testlib/init/epsilon.pm - Module used in configuration tests
 
+=head1 DESCRIPTION
+
+Nonsense module used only in testing the configuration system.
+
 =cut
 
 package init::epsilon;

Modified: branches/orderedhash_revamp/t/configure/testlib/init/foobar.pm
==============================================================================
--- branches/orderedhash_revamp/t/configure/testlib/init/foobar.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/configure/testlib/init/foobar.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,6 +5,10 @@
 
 t/configure/testlib/init/foobar.pm - Module used in configuration tests
 
+=head1 DESCRIPTION
+
+Nonsense module used only in testing the configuration system.
+
 =cut
 
 package init::foobar;

Modified: branches/orderedhash_revamp/t/configure/testlib/init/gamma.pm
==============================================================================
--- branches/orderedhash_revamp/t/configure/testlib/init/gamma.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/configure/testlib/init/gamma.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,6 +5,10 @@
 
 t/configure/testlib/init/gamma.pm - Module used in configuration tests
 
+=head1 DESCRIPTION
+
+Nonsense module used only in testing the configuration system.
+
 =cut
 
 package init::gamma;

Modified: branches/orderedhash_revamp/t/configure/testlib/init/iota.pm
==============================================================================
--- branches/orderedhash_revamp/t/configure/testlib/init/iota.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/configure/testlib/init/iota.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,6 +5,10 @@
 
 t/configure/testlib/init/iota.pm - Module used in configuration tests
 
+=head1 DESCRIPTION
+
+Nonsense module used only in testing the configuration system.
+
 =cut
 
 package init::iota;

Modified: branches/orderedhash_revamp/t/configure/testlib/init/kappa.pm
==============================================================================
--- branches/orderedhash_revamp/t/configure/testlib/init/kappa.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/configure/testlib/init/kappa.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,6 +5,10 @@
 
 t/configure/testlib/init/kappa.pm - Module used in configuration tests
 
+=head1 DESCRIPTION
+
+Nonsense module used only in testing the configuration system.
+
 =cut
 
 package init::kappa;

Modified: branches/orderedhash_revamp/t/configure/testlib/init/lambda.pm
==============================================================================
--- branches/orderedhash_revamp/t/configure/testlib/init/lambda.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/configure/testlib/init/lambda.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,6 +5,10 @@
 
 t/configure/testlib/init/lambda.pm - Module used in configuration tests
 
+=head1 DESCRIPTION
+
+Nonsense module used only in testing the configuration system.
+
 =cut
 
 package init::lambda;

Modified: branches/orderedhash_revamp/t/configure/testlib/init/mu.pm
==============================================================================
--- branches/orderedhash_revamp/t/configure/testlib/init/mu.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/configure/testlib/init/mu.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,6 +5,10 @@
 
 t/configure/testlib/init/mu.pm - Module used in configuration tests
 
+=head1 DESCRIPTION
+
+Nonsense module used only in testing the configuration system.
+
 =cut
 
 package init::mu;

Modified: branches/orderedhash_revamp/t/configure/testlib/init/zeta.pm
==============================================================================
--- branches/orderedhash_revamp/t/configure/testlib/init/zeta.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/configure/testlib/init/zeta.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,6 +5,10 @@
 
 t/configure/testlib/init/zeta.pm - Module used in configuration tests
 
+=head1 DESCRIPTION
+
+Nonsense module used only in testing the configuration system.
+
 =cut
 
 package init::zeta;

Modified: branches/orderedhash_revamp/t/configure/testlib/inter/theta.pm
==============================================================================
--- branches/orderedhash_revamp/t/configure/testlib/inter/theta.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/configure/testlib/inter/theta.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,6 +5,10 @@
 
 t/configure/testlib/inter/theta.pm - Module used in configuration tests
 
+=head1 DESCRIPTION
+
+Nonsense module used only in testing the configuration system.
+
 =cut
 
 package inter::theta;

Added: branches/orderedhash_revamp/t/dynoplibs/math.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/dynoplibs/math.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,186 @@
+#! parrot
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/dynoplibs/math.t - Tests for mathematical ops
+
+=head1 SYNOPSIS
+
+        % prove t/dynoblibs/math.t
+
+=head1 DESCRIPTION
+
+Tests math.ops
+
+=cut
+
+.loadlib 'math_ops'
+.sub main :main
+    .include 'test_more.pir'
+    .include 'fp_equality.pasm'
+    plan(20)
+    ok(1, "load math_ops")
+    rand $I0
+    test_2_arg_int()
+    test_3_arg_int()
+    test_1_arg_num()
+    test_2_arg_num()
+    test_3_arg_num()
+    test_srand()
+    test_local_nums()
+    test_local_nums_2_arg()
+    test_local_ints()
+.end
+
+.sub test_2_arg_int
+    rand $I0, 5
+    lt $I0, 0, fail1
+    ok(1, 'rand returns a number greater than or equal to 0')
+    goto upper
+fail1:
+    ok(0, 'rand returns a number greater than or equal to 0')
+upper:
+    gt $I0, 5, fail2
+    ok(1, 'rand returns a number less than or equal to 5')
+    goto finish
+fail2:
+    ok(0, 'rand returns a number less than or equal to 5')
+finish:
+.end
+
+.sub test_3_arg_int
+    rand $I0, 5, 25
+    lt $I0, 5, fail1
+    ok(1, 'rand returns a number greater than or equal to 5')
+    goto upper
+fail1:
+    ok(0, 'rand returns a number greater than or equal to 5')
+upper:
+    gt $I0, 25, fail2
+    ok(1, 'rand returns a number less than or equal to 25')
+    goto finish
+fail2:
+    ok(0, 'rand returns a number less than or equal to 25')
+finish:
+.end
+
+.sub test_1_arg_num
+    rand $N0
+    lt $N0, 0, fail1
+    ok(1, 'rand returns a number greater than or equal to 0')
+    goto upper
+fail1:
+    ok(0, 'rand returns a number greater than or equal to 0')
+upper:
+    gt $N0, 1, fail2
+    ok(1, 'rand returns a number less than or equal to 1')
+    goto finish
+fail2:
+    ok(0, 'rand returns a number less than or equal to 1')
+finish:
+.end
+
+.sub test_2_arg_num
+    rand $N0, 5
+    lt $N0, 0, fail1
+    ok(1, 'rand returns a number greater than or equal to 0')
+    goto upper
+fail1:
+    ok(0, 'rand returns a number greater than or equal to 0')
+upper:
+    gt $N0, 5, fail2
+    ok(1, 'rand returns a number less than or equal to 5')
+    goto finish
+fail2:
+    ok(0, 'rand returns a number less than or equal to 5')
+finish:
+.end
+
+.sub test_3_arg_num
+    rand $N0, 5, 25
+    lt $N0, 5, fail1
+    ok(1, 'rand returns a number greater than or equal to 5')
+    goto upper
+fail1:
+    ok(0, 'rand returns a number greater than or equal to 5')
+upper:
+    gt $N0, 25, fail2
+    ok(1, 'rand returns a number less than or equal to 25')
+    goto finish
+fail2:
+    ok(0, 'rand returns a number less than or equal to 25')
+finish:
+.end
+
+.sub test_srand
+    srand 42
+    ok(1, 'call srand with int')
+    srand 42.0
+    ok(1, 'call srand with num')
+    rand $N0
+    srand 5
+    rand $N2
+    srand 42.0
+    rand $N1
+    .fp_eq_ok($N0, $N1, 'having the same seed generates the same numbers')
+.end
+
+.sub test_local_nums_2_arg
+    .local num foo, bar
+    foo = rand 5.0, 25.0
+    lt foo, 5, fail1
+    ok(1, 'rand returns a number greater than or equal to 5')
+    goto upper
+fail1:
+    ok(0, 'rand returns a number greater than or equal to 5')
+upper:
+    gt foo, 25, fail2
+    ok(1, 'rand returns a number less than or equal to 25')
+    goto finish
+fail2:
+    ok(0, 'rand returns a number less than or equal to 25')
+finish:
+.end
+
+.sub test_local_nums
+    .local num foo, bar
+    foo = rand
+    lt foo, 0, fail1
+    ok(1, 'rand returns a number greater than or equal to 0')
+    goto upper
+fail1:
+    ok(0, 'rand returns a number greater than or equal to 0')
+upper:
+    gt foo, 1, fail2
+    ok(1, 'rand returns a number less than or equal to 1')
+    goto finish
+fail2:
+    ok(0, 'rand returns a number less than or equal to 1')
+finish:
+.end
+
+.sub test_local_ints
+    .local int foo, bar
+    foo = rand 5, 25
+    lt foo, 5, fail1
+    ok(1, 'rand returns a number greater than or equal to 5')
+    goto upper
+fail1:
+    ok(0, 'rand returns a number greater than or equal to 5')
+upper:
+    gt foo, 25, fail2
+    ok(1, 'rand returns a number less than or equal to 25')
+    goto finish
+fail2:
+    ok(0, 'rand returns a number less than or equal to 25')
+finish:
+.end
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 filetype=pir:

Added: branches/orderedhash_revamp/t/dynoplibs/obscure.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/dynoplibs/obscure.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,106 @@
+#! parrot
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/dynoplibs/obscure.t - Tests for obscure mathematical functions
+
+=head1 SYNOPSIS
+
+        % prove t/dynoblibs/obscure.t
+
+=head1 DESCRIPTION
+
+Tests obscure.ops
+
+=cut
+
+.loadlib 'obscure_ops'
+.sub main :main
+    .include 'fp_equality.pasm'
+    .include 'test_more.pir'
+    plan(17)
+    ok(1,"load obscure_ops")
+
+    test_covers()
+    test_vers()
+    test_hav()
+    test_exsec()
+.end
+
+.sub test_covers
+    .local num x, pi, halfpi, y
+    y      = atan 1.0, 1.0
+    halfpi = y
+    halfpi *= 2
+    pi     = halfpi
+    pi     *= 2
+    covers x, 0
+    .fp_eq_ok(x, 1, "covers of 0")
+    covers x, halfpi
+    .fp_eq_ok(x, 0, 'covers of pi/2')
+    covers x, pi
+    .fp_eq_ok(x, 1, 'covers of pi')
+    covers x, y
+    .fp_eq_ok(x, 0.292893218813453, 'covers of pi/4')
+.end
+
+.sub test_vers
+    .local num x, pi, halfpi, y
+    y      = atan 1.0, 1.0
+    halfpi = y
+    halfpi *= 2
+    pi     = halfpi
+    pi     *= 2
+    vers x, 0
+    .fp_eq_ok(x, 0, "vers of 0")
+    vers x, halfpi
+    .fp_eq_ok(x, 1, 'vers of pi/2')
+    vers x, pi
+    .fp_eq_ok(x, 2, 'vers of pi')
+    vers x, y
+    .fp_eq_ok(x, 0.292893218813453, 'covers of pi/4')
+.end
+
+.sub test_hav
+    .local num x, pi, halfpi, y
+    y      = atan 1.0, 1.0
+    halfpi = y
+    halfpi *= 2
+    pi     = halfpi
+    pi     *= 2
+    hav x, 0
+    .fp_eq_ok(x, 0, "hav of 0")
+    hav x, halfpi
+    .fp_eq_ok(x, 0.5, 'hav of pi/2')
+    hav x, pi
+    .fp_eq_ok(x, 1, 'hav of pi')
+    hav x, y
+    .fp_eq_ok(x, 0.146446609406726, 'hav of pi/4')
+.end
+
+.sub test_exsec
+    .local num x, pi, halfpi, y
+    y      = atan 1.0, 1.0
+    halfpi = y
+    halfpi *= 2
+    pi     = halfpi
+    pi     *= 2
+    hav x, 0
+    .fp_eq_ok(x, 0, "exsec of 0")
+    exsec x, halfpi
+    .fp_eq_ok(x, 'nan', 'exsec of pi/2')
+    exsec x, pi
+    .fp_eq_ok(x, -2, 'exsec of pi')
+    exsec x, y
+    .fp_eq_ok(x, 0.414213562373095, 'exsec of pi/4')
+.end
+
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 filetype=pir:

Modified: branches/orderedhash_revamp/t/dynpmc/dynlexpad.t
==============================================================================
--- branches/orderedhash_revamp/t/dynpmc/dynlexpad.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/dynpmc/dynlexpad.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -205,47 +205,55 @@
 OUTPUT
 
 TODO: {
-    local $TODO = "iterator not implemented for DynLexPads";
+    local $TODO = "iterator not implemented for DynLexPads; TT #1028";
 
 pir_output_is( $loadlib . << 'CODE', << 'OUTPUT', "dynlexpad - iterator" );
+
+.loadlib 'dynlexpad'
+.sub 'onload' :immediate
+    .local pmc interp
+    interp = getinterp
+
+    .local pmc core
+    core = get_class 'LexPad'
+    .local pmc hll
+    hll = get_class 'DynLexPad'
+    interp.'hll_map'(core,hll)
+.end
+
 .sub 'test' :main
-    .local pmc dlp, str1, str2, str3, it, key, interp
 
+    .local pmc str1,str2,str3
     .lex 'a', str1
     .lex 'b', str2
     .lex 'c', str3
 
-    str1 = new 'String'
-    str1 = 'happy pants'
-
-    str2 = new 'String'
-    str2 = 'content pants'
-
-    str3 = new 'String'
-    str3 = 'sad pants'
+    str1 = box 'pants'
+    str2 = box 'pants'
+    str3 = box 'pants'
 
+    .local pmc interp
     interp = getinterp
+
+    .local pmc dlp
     dlp    = interp['lexpad']
 
-    say "Getting iterator"
-    it = new 'Iterator', dlp
-    say "Have iterator"
+    .local pmc iterator
+    iterator = iter dlp
 iter_loop:
-    unless it goto iter_done
-    key = shift it
-    $S0 = key
-    print key
-    print ":"
-    key = dlp[key]
-    $S0 = key
-    say key
+    unless iterator goto iter_done
+    .local pmc key
+    key = shift iterator
+    .local string value
+    value = dlp[key]
+    say value
     goto iter_loop
 iter_done:
 .end
 CODE
-a:happy pants
-b:content pants
-c:sad pants
+pants
+pants
+pants
 OUTPUT
 }
 

Modified: branches/orderedhash_revamp/t/dynpmc/foo.t
==============================================================================
--- branches/orderedhash_revamp/t/dynpmc/foo.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/dynpmc/foo.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -26,7 +26,7 @@
 pir_output_is( << 'CODE', << 'OUTPUT', "get_integer" );
 
 .sub main :main
-    loadlib $P1, "foo"
+    loadlib $P1, "foo_group"
     $P1 = new "Foo"
 
     $I1 = $P1
@@ -41,7 +41,7 @@
 .sub main :main
     ## load a relative pathname without the extension.  loadlib will convert the
     ## '/' characters to '\\' on windows.
-    $S0 = "runtime/parrot/dynext/foo"
+    $S0 = "runtime/parrot/dynext/foo_group"
     loadlib $P1, $S0
 
     ## ensure that we can still make Foo instances.
@@ -65,7 +65,7 @@
     ## convert cwd to an absolute pathname without the extension, and load it.
     ## this should always find the version in the build directory, since that's
     ## the only place "make test" will work.
-    $S0 = concat "/runtime/parrot/dynext/foo"
+    $S0 = concat "/runtime/parrot/dynext/foo_group"
     loadlib $P1, $S0
 
     ## ensure that we can still make Foo instances.
@@ -87,7 +87,7 @@
     $S0 = $P12["load_ext"]
 
     ## load a relative pathname with an extension.
-    $S0 = concat "runtime/parrot/dynext/foo", $S0
+    $S0 = concat "runtime/parrot/dynext/foo_group", $S0
     loadlib $P1, $S0
 
     ## ensure that we can still make Foo instances.
@@ -112,7 +112,7 @@
     ## convert $S0 to an absolute pathname with extension, and load it.
     ## this should always find the version in the build directory, since that's
     ## the only place "make test" will work.
-    $S0 = concat $S0, "/runtime/parrot/dynext/foo"
+    $S0 = concat $S0, "/runtime/parrot/dynext/foo_group"
     $S0 = concat $S0, $S1
     loadlib $P1, $S0
 
@@ -132,7 +132,7 @@
     pir_output_is( << 'CODE', << 'OUTPUT', "inherited add" );
 .sub _main :main
     .local pmc d, l, r
-    $P0 = loadlib "foo"
+    $P0 = loadlib "foo_group"
     print "ok\n"
     l = new "Foo"
     l = 42
@@ -157,7 +157,7 @@
 pir_output_is( <<'CODE', <<'OUTPUT', "Foo subclass isa Integer" );
 .sub main :main
     .local pmc F, f, d, r
-    loadlib F, "foo"
+    loadlib F, "foo_group"
     f = new "Foo"
     f = 1
     d = new 'Integer'
@@ -175,7 +175,7 @@
 # load our Foo test (pseudo) language
 # it defines one PMC type "Foo"
 .HLL "Fool"
-.loadlib "foo"
+.loadlib "foo_group"
 .sub main :main
     new $P1, "Foo"      # load by name
     $I1 = $P1
@@ -188,7 +188,7 @@
 
 pir_output_is( << 'CODE', << 'OUTPUT', ".HLL 2" );
 .HLL "Fool"
-.loadlib "foo"
+.loadlib "foo_group"
 .sub main :main
     new $P1, 'Foo'       # load by index
     $I1 = $P1

Added: branches/orderedhash_revamp/t/dynpmc/foo2.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/dynpmc/foo2.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,39 @@
+#! parrot
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/dynpmc/foo2.t - Test for a very simple dynamic PMC
+
+=head1 SYNOPSIS
+
+        % prove t/dynpmc/foo2.t
+
+=head1 DESCRIPTION
+
+Tests the Foo PMC.
+
+=cut
+
+.sub main :main
+    .include 'test_more.pir'
+    plan(1)
+
+    test_dynpmcs_can_use_super()
+.end
+
+.sub test_dynpmcs_can_use_super 
+    $P0 = loadlib 'foo_group'
+    $P1 = new "Foo2"
+
+    $I1 = $P1
+    is($I1, 43, 'dynpmcs can use SUPER to call parent dynpmc VTABLE functions')
+.end
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4: filetype=pir:

Deleted: branches/orderedhash_revamp/t/dynpmc/pair.t
==============================================================================
--- branches/orderedhash_revamp/t/dynpmc/pair.t	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,85 +0,0 @@
-#! parrot
-# Copyright (C) 2001-2009, Parrot Foundation.
-# $Id$
-
-.const int NUM_OF_TESTS = 8
-
-.sub main :main
-    loadlib $P1, 'pair'
-    load_bytecode 'Test/More.pbc'
-
-    .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/orderedhash_revamp/t/dynpmc/subproxy.t
==============================================================================
--- branches/orderedhash_revamp/t/dynpmc/subproxy.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/dynpmc/subproxy.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,14 +1,7 @@
-#! perl
-# Copyright (C) 2005-2007, Parrot Foundation.
+#! parrot
+# Copyright (C) 2005-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 2;
-use Parrot::Config;
-
 =head1 NAME
 
 t/dynpmc/subproxy.t - test if Sub is overridable via hll_map()
@@ -24,29 +17,32 @@
 
 =cut
 
-pir_output_is( << 'CODE', << 'OUTPUT', "loadlib" );
 .sub main :main
+    .include 'test_more.pir'
+    plan(3)
+
+    test_loadlib()
+    test_type_of_hll_mapped_sub()
+.end
+
+.sub test_loadlib
     .local pmc lib
     lib = loadlib "subproxy"
     unless lib goto not_loaded
-    print "ok\n"
-    end
-not_loaded:
-    print "not loaded\n"
-.end
-CODE
-ok
-OUTPUT
+    ok(1, 'loadlib')
+    .return()
+  not_loaded:
+    ok(1, 'loadlib')
+.end
 
-pir_output_is( << 'CODE', << 'OUTPUT', "test type of hll_map'ped .Sub" );
-.sub main :main
+.sub test_type_of_hll_mapped_sub
     .local pmc b, f
     b = get_global 'bar'
     $S0 = typeof b
-    say $S0
+    is($S0, 'Sub', "test type of hll_map'ped .Sub")
     f = get_root_global ['some'], 'foo'
     $S0 = typeof f
-    say $S0
+    is($S0, 'SubProxy', "test type of hll_map'ped .Sub")
 .end
 
 .sub bar
@@ -67,14 +63,10 @@
 .sub foo
     noop
 .end
-CODE
-Sub
-SubProxy
-OUTPUT
 
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 filetype=pir:

Modified: branches/orderedhash_revamp/t/examples/pir.t
==============================================================================
--- branches/orderedhash_revamp/t/examples/pir.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/examples/pir.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 #!perl
-# Copyright (C) 2005-2006, Parrot Foundation.
+# Copyright (C) 2005-2009, Parrot Foundation.
 # $Id$
 
 use strict;
@@ -266,7 +266,7 @@
 
 ## Added test this way, so we can have more interesting tests.
 pir_output_is( <<'CODE', <<OUTPUT, "Test Levenshtein example" );
-.include "../../examples/pir/levenshtein.pir"
+.include "examples/pir/levenshtein.pir"
 .sub main :main
         $S1 = "purl"
         $S2 = "perl"

Modified: branches/orderedhash_revamp/t/examples/pod.t
==============================================================================
--- branches/orderedhash_revamp/t/examples/pod.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/examples/pod.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -159,7 +159,7 @@
 
 =item * FRAGMENT
 
-For PIR, wraps the code in a C<.sub> block to
+For PIR, wraps the code in a C<.sub> block.
 
 =item * TODO
 

Modified: branches/orderedhash_revamp/t/examples/shootout.t
==============================================================================
--- branches/orderedhash_revamp/t/examples/shootout.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/examples/shootout.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -43,19 +43,10 @@
 See the explanation of benchmarks and sample data for reduced N benches at
 http://shootout.alioth.debian.org/sandbox/
 
-=head1 SEE ALSO
-
-#40064: shootout example testing in Parrot RT
-
-L<"https://rt.perl.org/rt3/Public/Bug/Display.html?id=40064">
-
 =cut
 
 my %skips = (
     'pidigits.pir'    => [ 'not exists $PConfig{HAS_GMP}', 'needs GMP' ],
-    'recursive.pir'   => [ '$PConfig{cpuarch} !~ /86/',    'float JIT broken on non-x86' ],
-    'recursive-2.pir' => [ '$PConfig{cpuarch} !~ /86/',    'float JIT broken on non-x86' ],
-    'revcomp.pir'     => [ '1',              'string buffering segfault, TT #445' ],
 );
 my $INPUT_EXT = '_input';
 foreach my $script (@shootouts) {

Modified: branches/orderedhash_revamp/t/examples/subs.t
==============================================================================
--- branches/orderedhash_revamp/t/examples/subs.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/examples/subs.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -6,7 +6,7 @@
 use warnings;
 use lib qw( . lib ../lib ../../lib );
 use Test::More;
-use Parrot::Test tests => 7;
+use Parrot::Test tests => 5;
 use Parrot::Config;
 
 =head1 NAME
@@ -31,14 +31,6 @@
 
 # Set up expected output for examples
 my %expected = (
-    'bsr_ret.pasm' => << 'END_EXPECTED',
-Main
-TestSub
-NestSub
-TestSub: Ret from NestSub
-Main: Return from TestSub
-END_EXPECTED
-
     'coroutine.pasm' => << 'END_EXPECTED',
 Calling 1st co-routine
 Entry
@@ -50,19 +42,6 @@
 Done
 END_EXPECTED
 
-    'jsr_ret.pasm' => << 'END_EXPECTED',
-Example of the jump op.
-
-Jumping to subroutine SUB_1.
-Entered subroutine SUB_1.
-Returning from subroutine SUB_1.
-Returned from subroutine SUB_1.
-Jumping to subroutine SUB_2.
-Entered subroutine SUB_2.
-Returning from subroutine SUB_2.
-Returned from subroutine SUB_2.
-END_EXPECTED
-
     'pasm_sub1.pasm' => << 'END_EXPECTED',
 Hello from subroutine
 Hello from main

Modified: branches/orderedhash_revamp/t/harness
==============================================================================
--- branches/orderedhash_revamp/t/harness	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/harness	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,9 +1,10 @@
 #!perl
-# Copyright (C) 2001-2008, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
 use strict;
 use warnings;
+use Data::Dumper;$Data::Dumper::Indent=1;
 use lib qw( lib );
 
 use Getopt::Std;
@@ -13,7 +14,7 @@
 undef $Test::Harness::Switches;
 
 use Parrot::Harness::DefaultTests qw(
-    get_default_tests
+    get_common_tests
     @developing_tests
 );
 use Parrot::Harness::Options qw(
@@ -35,7 +36,7 @@
 # Suck the short options into the TEST_PROG_ARGS
 # environmental variable.
 my %opts;
-getopts('wgjPCSefbvdr?hO:D:', \%opts);
+getopts('wgGjPCSefbvdr?hO:D:', \%opts);
 
 if ($opts{'?'} || $opts{h} || $longopts->{help}) {
     Usage();
@@ -50,19 +51,15 @@
 );
 $ENV{TEST_PROG_ARGS} = $args;
 
-# now build the list of tests to run, either from the command
-# line or from @default tests
-my @default_tests = get_default_tests(
-    $longopts->{core_tests_only},
-    $longopts->{runcore_tests_only}
-);
-
 my @tests;
 if ($longopts->{code}) {
     @tests = @developing_tests;
 }
 else {
-    @tests = map { glob($_) } (@ARGV ? @ARGV : @default_tests);
+    @tests = map { glob($_) } (@ARGV
+        ? @ARGV
+        : get_common_tests( $longopts )
+    );
 }
 
 my $harness;
@@ -119,7 +116,6 @@
     }
     my $results = $harness->runtests(@tests);
 
-    # a non-zero code stops make after test failures (RT #60116)
     exit ( $results->all_passed() ? 0 : 1 );
 }
 
@@ -145,9 +141,13 @@
 
 Run the C<CGoto> core.
 
+=item C<-G>
+
+Run the C<GCDebug> core.
+
 =item C<-j>
 
-Run with JIT enabled.
+Alias for running with the fast core.
 
 =item C<-C>
 

Added: branches/orderedhash_revamp/t/include/fp_equality.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/include/fp_equality.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,43 @@
+#! parrot
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/include/fp_equality.t - Test runtime/parrot/include/fp_equality.pasm
+
+=head1 SYNOPSIS
+
+        % prove t/include/fp_equality.t
+
+=head1 DESCRIPTION
+
+Tests fp_* functions.
+
+=cut
+
+.sub main :main
+    .include 'fp_equality.pasm'
+    .include 'test_more.pir'
+    .local num epsilon, zplus, zminus
+    .local num oplus, ominus
+    plan(4)
+    epsilon = 0.00000005
+    oplus  = 1 + epsilon
+    ominus = 1 - epsilon
+    zplus  = 0 + epsilon
+    zminus = 0 - epsilon
+
+    .fp_eq_ok(zplus, 0, 'zero')
+    .fp_eq_ok(0, zplus, 'zero')
+
+    .fp_eq_ok(oplus, 1, 'one')
+    .fp_eq_ok(1, oplus, 'one')
+
+.end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Added: branches/orderedhash_revamp/t/library/configure.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/library/configure.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,166 @@
+#!parrot
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/library/configure.t
+
+=head1 DESCRIPTION
+
+Test the Configure PBC
+
+=head1 SYNOPSIS
+
+    % prove t/library/configure.t
+
+=cut
+
+.sub 'main' :main
+    .include 'test_more.pir'
+
+    load_bytecode 'Configure/genfile.pbc'
+
+    plan(40)
+    test_conditioned_line()
+    test_eval_expr()
+    test_interpolate_var()
+    test_replace_slash()
+.end
+
+.sub 'test_conditioned_line'
+    .local pmc config
+    config = new 'Hash'
+    config['foo'] = 1
+    config['bar'] = 0
+    config['baz'] = 1
+
+    $S0 = conditioned_line("plain text\nwithout #", config)
+    is($S0, "plain text\nwithout #\n", "plain text")
+
+    $S0 = conditioned_line("#IF(malformed", config)
+    is($S0, "#IF(malformed\n", "malformed")
+
+    $S0 = conditioned_line("#IF(foo):positive", config)
+    is($S0, "positive\n", "#IF positive")
+    $S0 = conditioned_line("#IF(bar):negative", config)
+    is($S0, "", "#IF negative")
+
+    $S0 = conditioned_line("#UNLESS(bar):positive", config)
+    is($S0, "positive\n", "#UNLESS positive")
+    $S0 = conditioned_line("#UNLESS(foo):negative", config)
+    is($S0, "", "#UNLESS negative")
+
+    $S0 = conditioned_line("#IF(foo):positive\n#ELSE:alternate", config)
+    is($S0, "positive\n", "#IF/ELSE positive")
+    $S0 = conditioned_line("#IF(bar):negative\n#ELSE:alternate", config)
+    is($S0, "alternate\n", "#IF/ELSE alternate")
+
+    $S0 = conditioned_line("#IF(foo):positive\n#ELSIF(baz):alternate", config)
+    is($S0, "positive\n", "#IF/ELSIF positive")
+    $S0 = conditioned_line("#IF(bar):negative\n#ELSIF(baz):alternate", config)
+    is($S0, "alternate\n", "#IF/ELSIF alternate")
+    $S0 = conditioned_line("#IF(bar):negative\n#ELSIF(bar):negative", config)
+    is($S0, "", "#IF/ELSIF negative")
+.end
+
+.sub 'test_eval_expr'
+    .local pmc config
+    config = new 'Hash'
+    config['foo'] = 1
+    config['bar'] = 0
+    config['baz'] = 1
+
+    $I0 = cond_eval("foo", config)
+    is($I0, 1, "foo")
+    $I0 = cond_eval("   foo   ", config)
+    is($I0, 1, "   foo   ")
+    $I0 = cond_eval("bar", config)
+    is($I0, 0, "bar")
+    $I0 = cond_eval(" unknown ", config)
+    is($I0, 0, " unknown ")
+
+    $I0 = cond_eval("  ( foo )  ", config)
+    is($I0, 1, "  ( foo )  ")
+
+    $I0 = cond_eval("NOT foo", config)
+    is($I0, 0, "NOT foo")
+    $I0 = cond_eval(" NOT bar", config)
+    is($I0, 1, " NOT bar")
+    $I0 = cond_eval("!!foo", config)
+    is($I0, 1, "!!foo")
+
+    $I0 = cond_eval(" foo OR bar ", config)
+    is($I0, 1, " foo OR bar ")
+    $I0 = cond_eval("foo||bar", config)
+    is($I0, 1, "foo||bar")
+
+    $I0 = cond_eval(" foo AND bar ", config)
+    is($I0, 0, " foo AND bar ")
+    $I0 = cond_eval("foo&&bar", config)
+    is($I0, 0, "foo&&bar")
+
+    $I0 = cond_eval(" foo == bar ", config)
+    is($I0, 0, " foo == bar ")
+    $I0 = cond_eval(" foo == baz ", config)
+    is($I0, 1, " foo == baz ")
+
+    $I0 = cond_eval(" foo != bar ", config)
+    is($I0, 1, " foo != bar ")
+    $I0 = cond_eval(" foo != baz ", config)
+    is($I0, 0, " foo != baz ")
+.end
+
+.sub 'test_interpolate_var'
+    .local pmc config
+    config = new 'Hash'
+    config['foo'] = 'bar'
+    $S0 = interpolate_var("# plain text", config)
+    is($S0, "# plain text\n", "plain text")
+
+    $S0 = interpolate_var("\t at echo foo", config)
+    is($S0, "\t at echo foo\n", "@ alone")
+
+    $S0 = interpolate_var("here @foo@ variable", config)
+    is($S0, "here bar variable\n", "variable")
+
+    $S0 = interpolate_var("here @foo@ variable, and here @foo at .", config)
+    is($S0, "here bar variable, and here bar.\n", "variable")
+
+    $S0 = interpolate_var("\t at echo var @foo at .", config)
+    is($S0, "\t at echo var bar.\n", "gives a second change")
+.end
+
+.sub 'test_replace_slash'
+    $S1 = "path/to/somewhere/"
+    $S0 = replace_slash($S1, 'MSWin32')
+    is($S0, "path\\to\\somewhere\\", "paths on win32")
+    $S0 = replace_slash($S1, '*nix')
+    is($S0, $S1, "paths on *nix")
+
+    $S1 = "prove t/*.t"
+    $S0 = replace_slash($S1, 'MSWin32')
+    is($S0, "prove t\\\\*.t")
+    $S0 = replace_slash($S1, '*nix')
+    is($S0, $S1)
+
+    $S1 = "prove t//*.t"
+    $S0 = replace_slash($S1, 'MSWin32')
+    is($S0, "prove t/*.t")
+    $S0 = replace_slash($S1, '*nix')
+    is($S0, "prove t/*.t")
+
+    $S1 = "http:////host//paths//"
+    $S0 = replace_slash($S1, 'MSWin32')
+    is($S0, "http://host/paths/", "url on win32")
+    $S0 = replace_slash($S1, '*nix')
+    is($S0, "http://host/paths/", "url on *nix")
+.end
+
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/t/library/getopt_obj.t
==============================================================================
--- branches/orderedhash_revamp/t/library/getopt_obj.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/library/getopt_obj.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -37,7 +37,7 @@
 
         load_bytecode "Getopt/Obj.pbc"
         .local pmc getopts
-        getopts = new "Getopt::Obj"
+        getopts = new ['Getopt';'Obj']
 
         $P0 = getopts."add"()
         $P0."long"("foo")
@@ -96,7 +96,7 @@
 
         load_bytecode "Getopt/Obj.pbc"
         .local pmc getopts
-        getopts = new "Getopt::Obj"
+        getopts = new ['Getopt';'Obj']
 
         $P0 = getopts."add"()
         $P0."short"("f")
@@ -142,7 +142,7 @@
 
         load_bytecode "Getopt/Obj.pbc"
         .local pmc getopts
-        getopts = new "Getopt::Obj"
+        getopts = new ['Getopt';'Obj']
 
         $P0 = getopts."add"()
         $P0."short"("I")
@@ -176,7 +176,7 @@
 
         load_bytecode "Getopt/Obj.pbc"
         .local pmc getopts
-        getopts = new "Getopt::Obj"
+        getopts = new ['Getopt';'Obj']
 
         $P0 = getopts."add"()
         $P0."long"("include")
@@ -212,7 +212,7 @@
 
         load_bytecode "Getopt/Obj.pbc"
         .local pmc getopts
-        getopts = new "Getopt::Obj"
+        getopts = new ['Getopt';'Obj']
 
         $P0 = getopts."add"()
         $P0."long"("define")
@@ -252,7 +252,7 @@
 
         load_bytecode "Getopt/Obj.pbc"
         .local pmc getopts
-        getopts = new "Getopt::Obj"
+        getopts = new ['Getopt';'Obj']
 
         $P0 = getopts."add"()
         $P0."short"("a")
@@ -295,7 +295,7 @@
 
         load_bytecode "Getopt/Obj.pbc"
         .local pmc getopts
-        getopts = new "Getopt::Obj"
+        getopts = new ['Getopt';'Obj']
         getopts."notOptStop"(1)
 
         $P0 = getopts."add"()
@@ -330,7 +330,7 @@
 
         load_bytecode "Getopt/Obj.pbc"
         .local pmc getopts
-        getopts = new "Getopt::Obj"
+        getopts = new ['Getopt';'Obj']
 
         $P0 = getopts."add"()
         $P0."long"("foo")
@@ -373,7 +373,7 @@
 
         load_bytecode "Getopt/Obj.pbc"
         .local pmc getopts
-        getopts = new "Getopt::Obj"
+        getopts = new ['Getopt';'Obj']
         getopts."notOptStop"(1)
 
         $P0 = getopts."add"()
@@ -422,7 +422,7 @@
 
         load_bytecode "Getopt/Obj.pbc"
         .local pmc getopts
-        getopts = new "Getopt::Obj"
+        getopts = new ['Getopt';'Obj']
         getopts."notOptStop"(1)
 
         $P0 = getopts."add"()
@@ -476,7 +476,7 @@
 
         load_bytecode "Getopt/Obj.pbc"
         .local pmc getopts
-        getopts = new "Getopt::Obj"
+        getopts = new ['Getopt';'Obj']
 
         $P0 = getopts."add"()
         $P0."long"("foo")
@@ -524,7 +524,7 @@
 
         load_bytecode "Getopt/Obj.pbc"
         .local pmc getopts
-        getopts = new "Getopt::Obj"
+        getopts = new ['Getopt';'Obj']
 
         $P0 = getopts."add"()
         $P0."long"("foo")
@@ -576,7 +576,7 @@
 
         load_bytecode "Getopt/Obj.pbc"
         .local pmc getopts
-        getopts = new "Getopt::Obj"
+        getopts = new ['Getopt';'Obj']
 
         push getopts, 'foo=s'
         push getopts, 'bar|b=s'
@@ -659,7 +659,7 @@
         push argv, '--foo=file'
         load_bytecode "Getopt/Obj.pbc"
         .local pmc getopts
-        getopts = new "Getopt::Obj"
+        getopts = new ['Getopt';'Obj']
         $P1 = getopts."get_options"(argv)
         $S0 = $P1["foo"]
         print "foo is "
@@ -683,7 +683,7 @@
         push argv, '--bar'
         load_bytecode "Getopt/Obj.pbc"
         .local pmc getopts
-        getopts = new "Getopt::Obj"
+        getopts = new ['Getopt';'Obj']
         push getopts, 'foo=s'
         push getopts, 'bar=s'
         $P1 = getopts."get_options"(argv)

Modified: branches/orderedhash_revamp/t/library/md5.t
==============================================================================
--- branches/orderedhash_revamp/t/library/md5.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/library/md5.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,13 +1,7 @@
-#!perl
-# Copyright (C) 2001-2005, Parrot Foundation.
+#!parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( t . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 6;
-
 =head1 NAME
 
 t/library/md5.t - test MD5 library
@@ -32,180 +26,48 @@
 ##############################
 # Stress parrot using MD5 library
 
-pir_output_is( <<'CODE', <<'OUT', "Miscellaneous words" );
-.sub _main
+.sub main :main
     load_bytecode "Digest/MD5.pbc"
+
+    .include 'test_more.pir'
+    plan(517)
+
+    test_miscellaneous_words()
+    test_funny_chars()
+    test_string_lengths()
+    test_really_long_string()
+    test_recursive_md5_1()
+    test_recursive_md5_2()
+.end
+
+.sub test_miscellaneous_words
     $P0 = _md5sum ("Hello")
-    _md5_print ($P0)
-    print "\n"
+    $S0 = _md5_hex($P0)
+    is($S0, '8b1a9953c4611296a827abf8c47804d7', 'md5 Hello')
 
     $P0 = _md5sum ("Goodbye")
-    _md5_print ($P0)
-    print "\n"
+    $S0 = _md5_hex($P0)
+    is($S0, '6fc422233a40a75a1f028e11c3cd1140', 'md5 Goodbye')
 
     $P0 = _md5sum ("Parrot")
-    _md5_print ($P0)
-    print "\n"
+    $S0 = _md5_hex($P0)
+    is($S0, 'e7cb1e977e896954fec46d2ea7832072', 'md5 Parrot')
 
     $P0 = _md5sum ("Hello World!")
-    _md5_print ($P0)
-    print "\n"
-
-    end
+    $S0 = _md5_hex($P0)
+    is($S0, 'ed076287532e86365e841e92bfc50d8c', 'md5 Hello World')
 .end
-CODE
-8b1a9953c4611296a827abf8c47804d7
-6fc422233a40a75a1f028e11c3cd1140
-e7cb1e977e896954fec46d2ea7832072
-ed076287532e86365e841e92bfc50d8c
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "Funny chars" );
-.sub _main
-    load_bytecode "Digest/MD5.pbc"
+.sub test_funny_chars
     $P0 = _md5sum ("\n\n\n\n\t")
-    _md5_print ($P0)
-    print "\n"
-    end
+    $S0 = _md5_hex($P0)
+    is($S0, 'b66434493525523b4393ce0d1f2425d7', 'funny chars')
 .end
-CODE
-b66434493525523b4393ce0d1f2425d7
-OUT
-
-my $code = join(
-    "\n\n",
-    map {
-        <<CODE
-             \$P0 = _md5sum ("$_")
-             _md5_print (\$P0)
-             print "\\n"
-CODE
-            ;
-        } (
-        "",
-        "0",
-        "01",
-        "012",
-        "0123",
-        "01234",
-        "012345",
-        "0123456",
-        "01234567",
-        "012345678",
-        "0123456789",
-        "01234567890",
-        "012345678901",
-        "0123456789012",
-        "01234567890123",
-        "012345678901234",
-        "0123456789012345",
-        "01234567890123456",
-        "012345678901234567",
-        "0123456789012345678",
-        "01234567890123456789",
-        "012345678901234567890",
-        "0123456789012345678901",
-        "01234567890123456789012",
-        "012345678901234567890123",
-        "0123456789012345678901234",
-        "01234567890123456789012345",
-        "012345678901234567890123456",
-        "0123456789012345678901234567",
-        "01234567890123456789012345678",
-        "012345678901234567890123456789",
-        "0123456789012345678901234567890",
-        "01234567890123456789012345678901",
-        "012345678901234567890123456789012",
-        "0123456789012345678901234567890123",
-        "01234567890123456789012345678901234",
-        "012345678901234567890123456789012345",
-        "0123456789012345678901234567890123456",
-        "01234567890123456789012345678901234567",
-        "012345678901234567890123456789012345678",
-        "0123456789012345678901234567890123456789",
-        "01234567890123456789012345678901234567890",
-        "012345678901234567890123456789012345678901",
-        "0123456789012345678901234567890123456789012",
-        "01234567890123456789012345678901234567890123",
-        "012345678901234567890123456789012345678901234",
-        "0123456789012345678901234567890123456789012345",
-        "01234567890123456789012345678901234567890123456",
-        "012345678901234567890123456789012345678901234567",
-        "0123456789012345678901234567890123456789012345678",
-        "01234567890123456789012345678901234567890123456789",
-        "012345678901234567890123456789012345678901234567890",
-        "0123456789012345678901234567890123456789012345678901",
-        "01234567890123456789012345678901234567890123456789012",
-        "012345678901234567890123456789012345678901234567890123",
-        "0123456789012345678901234567890123456789012345678901234",
-        "01234567890123456789012345678901234567890123456789012345",
-        "012345678901234567890123456789012345678901234567890123456",
-        "0123456789012345678901234567890123456789012345678901234567",
-        "01234567890123456789012345678901234567890123456789012345678",
-        "012345678901234567890123456789012345678901234567890123456789",
-        "0123456789012345678901234567890123456789012345678901234567890",
-        "01234567890123456789012345678901234567890123456789012345678901",
-        "012345678901234567890123456789012345678901234567890123456789012",
-        "0123456789012345678901234567890123456789012345678901234567890123",
-        "01234567890123456789012345678901234567890123456789012345678901234",
-        "012345678901234567890123456789012345678901234567890123456789012345",
-        "0123456789012345678901234567890123456789012345678901234567890123456",
-        "01234567890123456789012345678901234567890123456789012345678901234567",
-        "012345678901234567890123456789012345678901234567890123456789012345678",
-        "0123456789012345678901234567890123456789012345678901234567890123456789",
-        "01234567890123456789012345678901234567890123456789012345678901234567890",
-        "012345678901234567890123456789012345678901234567890123456789012345678901",
-        "0123456789012345678901234567890123456789012345678901234567890123456789012",
-        "01234567890123456789012345678901234567890123456789012345678901234567890123",
-        "012345678901234567890123456789012345678901234567890123456789012345678901234",
-        "0123456789012345678901234567890123456789012345678901234567890123456789012345",
-        "01234567890123456789012345678901234567890123456789012345678901234567890123456",
-        "012345678901234567890123456789012345678901234567890123456789012345678901234567",
-        "0123456789012345678901234567890123456789012345678901234567890123456789012345678",
-        "01234567890123456789012345678901234567890123456789012345678901234567890123456789",
-        "012345678901234567890123456789012345678901234567890123456789012345678901234567890",
-        "0123456789012345678901234567890123456789012345678901234567890123456789012345678901",
-        "01234567890123456789012345678901234567890123456789012345678901234567890123456789012",
-        "012345678901234567890123456789012345678901234567890123456789012345678901234567890123",
-        "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234",
-        "01234567890123456789012345678901234567890123456789012345678901234567890123456789012345",
-        "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456",
-        "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567",
-        "01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678",
-"012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789",
-"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
-"01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901",
-"012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012",
-"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123",
-"01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234",
-"012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345",
-"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456",
-"01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567",
-"012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678",
-"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789",
-"01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
-"012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901",
-"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012",
-"01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123",
-"012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234",
-"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345",
-"01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456",
-"012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567",
-"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678",
-"01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789",
-"012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
 
-        )
-);
+.sub test_string_lengths
+    $I0 = 0
 
-pir_output_is( <<CODE, <<'OUT', "String lengths" );
-.sub _main
-    load_bytecode "Digest/MD5.pbc"
-    $code
-    end
-.end
-CODE
-d41d8cd98f00b204e9800998ecf8427e
+    $S10 = <<'OUTPUT'
 cfcd208495d565ef66e7dff9f98764da
 96a3be3cf272e017046d1b2674a52bd3
 d2490f048dc3b77a457e3e450ab4eb38
@@ -317,21 +179,31 @@
 2468a5c59cccb56bd51ed5ee766b2d2b
 09e32555adc12a6f2c8fed9a459935af
 6c27622d1d5365e4abfd02f2eccfd8f9
-OUT
-
-my $text = "Hello Parrot World! " x 50_000;
+OUTPUT
+    $P0 = split "\n", $S10
+  testing_loop:
+    $S1 = $I0
+    $S0 .= $S1
+    $S5 = shift $P0
+    $P1 = _md5sum ($S0)
+    $S6 = _md5_hex($P1)
+    inc $I0
+    mod $I0, $I0, 10
+    $I1 = length $S0
+    $S12 = $I1
+    $S11 = 'string length '
+    $S11 .= $S12
+    is($S6, $S5, $S11)
+    if $I1 <= 110 goto testing_loop
+.end
 
-pir_output_is( <<CODE, <<'OUT', "REALLY long string" );
-.sub _main
-    load_bytecode "Digest/MD5.pbc"
-    \$P0 = _md5sum ("$text")
-    _md5_print (\$P0)
-    print "\\n"
-    end
+.sub test_really_long_string
+    $S0 = "Hello Parrot World! "
+    repeat $S1, $S0, 50000
+    $P0 = _md5sum ($S1)
+    $S2 = _md5_hex($P0)
+    is($S2, '840e4dec51660b1f52473e0b0b9545f5', 'really long string')
 .end
-CODE
-840e4dec51660b1f52473e0b0b9545f5
-OUT
 
 =begin bash
 
@@ -349,26 +221,12 @@
 
 =cut
 
-pir_output_is( <<'CODE', <<'OUT', "recursive md5sum (1)" );
-.sub _main
-    load_bytecode "Digest/MD5.pbc"
-
+.sub test_recursive_md5_1
+    .local string output
     $S0 = "Hello World!"
     $I0 = 0
 
-loop:
-    print $S0
-    print "\n"
-    if $I0 >= 200 goto end
-    $P0 = _md5sum($S0)
-    $S0 = _md5_hex($P0)
-    inc $I0
-    branch loop
-end:
-    end
-.end
-CODE
-Hello World!
+    output = <<'OUTPUT'
 ed076287532e86365e841e92bfc50d8c
 153163e20c7dd03b131fe2bf21927e1e
 95b9b73c7a8abe6d5bf5ad8067a53cee
@@ -569,7 +427,20 @@
 b63d8a186e272754b70953ddd441e9fd
 84a112f819bf780dd268c68f21238374
 eab26f6455a08779bcb43bc48c02c717
-OUT
+OUTPUT
+
+    $P1 = split "\n", output
+  loop:
+    if $I0 >= 200 goto end
+    $P0 = _md5sum($S0)
+    $S0 = _md5_hex($P0)
+    $S1 = shift $P1
+    is($S0, $S1, 'recursive md5 (1)')
+    inc $I0
+    branch loop
+  end:
+
+.end
 
 =begin bash
 
@@ -587,28 +458,12 @@
 
 =cut
 
-pir_output_is( <<'CODE', <<'OUT', "recursive md5sum (2)" );
-.sub _main
-    load_bytecode "Digest/MD5.pbc"
-
+.sub test_recursive_md5_2
+    .local string output
+    .local pmc output_array
     $S0 = "Hello World!"
     $I0 = 0
-
-loop:
-    print $S0
-    print "\n"
-    if $I0 >= 200 goto end
-    $S0 = clone $S0
-    $S0 = concat $S0, $S0
-    $P0 = _md5sum($S0)
-    $S0 = _md5_hex($P0)
-    inc $I0
-    branch loop
-end:
-    end
-.end
-CODE
-Hello World!
+    output = <<'OUTPUT'
 ee41c968530f7715ab70805b341c3956
 9548194ce84b2f7953386080da112c3a
 9fb892cc0766429a1d8b0f752636c0fa
@@ -809,11 +664,26 @@
 982d93d2437c46edbf99f542900231c0
 8408bf5f0144309374e66278bec290b2
 982e0fde28cd2f62ef8db2d8dfd0f0d7
-OUT
+OUTPUT
+
+    output_array = split "\n", output
+  loop:
+    if $I0 >= 200 goto end
+    $S0 = clone $S0
+    $S0 = concat $S0, $S0
+    $P0 = _md5sum($S0)
+    $S0 = _md5_hex($P0)
+    $S1 = shift output_array
+    is($S0, $S1, 'recursive md5 (2)')
+    inc $I0
+    branch loop
+  end:
+
+.end
 
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 filetype=pir:

Modified: branches/orderedhash_revamp/t/library/mime_base64.t
==============================================================================
--- branches/orderedhash_revamp/t/library/mime_base64.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/library/mime_base64.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -332,7 +332,7 @@
     .local pmc test_iterator, test_case
     .local string plain, base64, comment, comment_cnt
 
-    test_iterator = new 'Iterator', encode_decode_tests
+    test_iterator = iter encode_decode_tests
     enc_dec_loop:
         unless test_iterator goto enc_dec_loop_end
         test_case   = shift test_iterator
@@ -350,7 +350,7 @@
     goto enc_dec_loop
     enc_dec_loop_end:
 
-    test_iterator = new 'Iterator', decode_tests
+    test_iterator = iter decode_tests
     dec_loop:
         unless test_iterator goto dec_loop_end
         test_case   = shift test_iterator

Modified: branches/orderedhash_revamp/t/library/mt19937ar.t
==============================================================================
--- branches/orderedhash_revamp/t/library/mt19937ar.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/library/mt19937ar.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,153 +1,66 @@
-#!perl
-# Copyright (C) 2008, Parrot Foundation.
+#!parrot
+# Copyright (C) 2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( t . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 10;
-
 =head1 NAME
 
-t/library/mt19937ar.t - Math::Random::MT tests
+t/library/mt19937ar.t
+
+=head1 DESCRIPTION
+
+Math::Random::MT tests
 
 =head1 SYNOPSIS
 
-    % prove t/library/mt19937ar.t
+    % parrot t/library/mt19937ar.t
 
 =cut
 
-pir_output_is( << 'CODE', << 'OUTPUT', 'MT typeof' );
-.sub test :main
+.sub 'main' :main
     load_bytecode 'Math/Random/mt19937ar.pbc'
-    .local pmc mt
-    mt = new [ 'Math'; 'Random'; 'MT' ]
-    $S0 = typeof mt
-    print $S0
-    print "\n"
-.end
-CODE
-Math;Random;MT
-OUTPUT
 
+    .include 'test_more.pir'
 
-pir_output_is( << 'CODE', << 'OUTPUT', 'MT can init_genrand' );
-.sub test :main
-    load_bytecode 'Math/Random/mt19937ar.pbc'
-    .local pmc mt
-    mt = new [ 'Math'; 'Random'; 'MT' ]
-    $I0 = can mt, 'init_genrand'
-    print $I0
-    print "\n"
-.end
-CODE
-1
-OUTPUT
+    plan(10)
 
+    test_interfaces()
+    test_output()
+.end
 
-pir_output_is( << 'CODE', << 'OUTPUT', 'MT can init_by_array' );
-.sub test :main
-    load_bytecode 'Math/Random/mt19937ar.pbc'
+.sub 'test_interfaces'
     .local pmc mt
     mt = new [ 'Math'; 'Random'; 'MT' ]
-    $I0 = can mt, 'init_by_array'
-    print $I0
-    print "\n"
-.end
-CODE
-1
-OUTPUT
 
+    $S0 = typeof mt
+    is($S0, 'Math;Random;MT', "MT typeof")
 
-pir_output_is( << 'CODE', << 'OUTPUT', 'MT can genrand_int32' );
-.sub test :main
-    load_bytecode 'Math/Random/mt19937ar.pbc'
-    .local pmc mt
-    mt = new [ 'Math'; 'Random'; 'MT' ]
-    $I0 = can mt, 'genrand_int32'
-    print $I0
-    print "\n"
-.end
-CODE
-1
-OUTPUT
+    $I0 = can mt, 'init_genrand'
+    ok($I0, "MT can init_genrand")
 
+    $I0 = can mt, 'init_by_array'
+    ok($I0, "MT can init_by_array")
 
-pir_output_is( << 'CODE', << 'OUTPUT', 'MT can genrand_int31' );
-.sub test :main
-    load_bytecode 'Math/Random/mt19937ar.pbc'
-    .local pmc mt
-    mt = new [ 'Math'; 'Random'; 'MT' ]
-    $I0 = can mt, 'genrand_int31'
-    print $I0
-    print "\n"
-.end
-CODE
-1
-OUTPUT
+    $I0 = can mt, 'genrand_int32'
+    ok($I0, "MT can genrand_int32")
 
+    $I0 = can mt, 'genrand_int31'
+    ok($I0, "MT can genrand_int31")
 
-pir_output_is( << 'CODE', << 'OUTPUT', 'MT can genrand_real1' );
-.sub test :main
-    load_bytecode 'Math/Random/mt19937ar.pbc'
-    .local pmc mt
-    mt = new [ 'Math'; 'Random'; 'MT' ]
     $I0 = can mt, 'genrand_real1'
-    print $I0
-    print "\n"
-.end
-CODE
-1
-OUTPUT
-
+    ok($I0, "MT can genrand_real1")
 
-pir_output_is( << 'CODE', << 'OUTPUT', 'MT can genrand_real2' );
-.sub test :main
-    load_bytecode 'Math/Random/mt19937ar.pbc'
-    .local pmc mt
-    mt = new [ 'Math'; 'Random'; 'MT' ]
     $I0 = can mt, 'genrand_real2'
-    print $I0
-    print "\n"
-.end
-CODE
-1
-OUTPUT
+    ok($I0, "MT can genrand_real2")
 
-
-pir_output_is( << 'CODE', << 'OUTPUT', 'MT can genrand_real3' );
-.sub test :main
-    load_bytecode 'Math/Random/mt19937ar.pbc'
-    .local pmc mt
-    mt = new [ 'Math'; 'Random'; 'MT' ]
     $I0 = can mt, 'genrand_real3'
-    print $I0
-    print "\n"
-.end
-CODE
-1
-OUTPUT
-
+    ok($I0, "MT can genrand_real3")
 
-pir_output_is( << 'CODE', << 'OUTPUT', 'MT can genrand_res53' );
-.sub test :main
-    load_bytecode 'Math/Random/mt19937ar.pbc'
-    .local pmc mt
-    mt = new [ 'Math'; 'Random'; 'MT' ]
     $I0 = can mt, 'genrand_res53'
-    print $I0
-    print "\n"
+    ok($I0, "MT can genrand_res53")
 .end
-CODE
-1
-OUTPUT
-
 
-my $out = Parrot::Test::slurp_file(File::Spec->catfile( 't', 'library', 'mt19937ar.txt' ));
-pir_output_is( << 'CODE', $out, 'mt19937ar output' );
-.sub test :main
-    load_bytecode 'Math/Random/mt19937ar.pbc'
+.sub 'generate_output' :anon
+    .param pmc fh
     .local pmc mt
     mt = new [ 'Math'; 'Random'; 'MT' ]
     .local pmc init
@@ -158,7 +71,7 @@
     set init[2], 0x345
     set init[3], 0x456
     mt.'init_by_array'(init)
-    print "1000 outputs of genrand_int32()\n"
+    fh.'puts'( "1000 outputs of genrand_int32()\n" )
     .local int i
     i = 0
     new $P0, 'FixedPMCArray'
@@ -168,36 +81,49 @@
     $I0 = mt.'genrand_int32'()
     $P0[0] = $I0
     $S0 = sprintf "%10lu ", $P0
-    print $S0
+    fh.'puts'( $S0 )
     $I0 = i % 5
     unless $I0 == 4 goto L3
-    print "\n"
+    fh.'puts'( "\n" )
   L3:
     inc i
     goto L1
   L2:
-    print "\n1000 outputs of genrand_real2()\n"
+    fh.'puts'( "\n1000 outputs of genrand_real2()\n" )
     i = 0
   L4:
     unless i < 1000 goto L5
     $N0 = mt.'genrand_real2'()
     $P0[0] = $N0
     $S0 = sprintf "%10.8f ", $P0
-    print $S0
+    fh.'puts'( $S0 )
     $I0 = i % 5
     unless $I0 == 4 goto L6
-    print "\n"
+    fh.'puts'( "\n" )
   L6:
     inc i
     goto L4
   L5:
 .end
-CODE
+
+.sub 'test_output'
+    .local pmc fh
+    fh = new 'FileHandle'
+    .local string ref
+    ref = fh.'readall'('t/library/mt19937ar.txt')
+    $P0 = split "\r\n", ref     # hack for Windows
+    ref = join "\n", $P0
+    fh = new 'StringHandle'
+    fh.'open'('output', 'w')
+    generate_output(fh)
+    $S0 = fh.'readall'()
+    fh.'close'()
+    is($S0, ref, "mt19937ar output")
+.end
 
 
 # Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
+#   mode: pir
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/t/library/p6object.t
==============================================================================
--- branches/orderedhash_revamp/t/library/p6object.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/library/p6object.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -26,7 +26,7 @@
     test_namespace.'export_to'(curr_namespace, exports)
 
     ##  set our plan
-    plan(252)
+    plan(295)
 
     ##  make sure we can load the P6object library
     push_eh load_fail
@@ -46,11 +46,12 @@
     p6obj_tests(p6meta, 'P6metaclass', 'isa'=>'P6metaclass')
 
     ##  register an existing PMCProxy-based class
-    .local pmc hashproto, hashobj
+    .local pmc hashproto, hashobj, hashns
     $P0 = p6meta.'register'('Hash')
     hashproto = get_hll_global 'Hash'
+    hashns = get_hll_namespace ['Hash']
     is_same($P0, hashproto, 'return from .register =:= Hash')
-    hashobj = p6obj_tests(hashproto, 'Hash', 'isa'=>'Hash')
+    hashobj = p6obj_tests(hashproto, 'Hash', 'isa'=>'Hash', 'who'=>hashns)
     ##  make sure class of hash object is still a PMCProxy
     isa_nok(hashobj, 'P6object', 'Hash_obj')
     $P0 = typeof hashobj
@@ -61,12 +62,13 @@
     nok($I0, '! < can Hash_obj, "new" >')
 
     ##  create a new standalone class by name
-    .local pmc abcproto, abcobj, abcmeta
+    .local pmc abcproto, abcobj, abcmeta, abcns
     $P0 = p6meta.'new_class'('ABC')
     abcproto = get_hll_global 'ABC'
+    abcns = get_hll_namespace ['ABC']
     is_same($P0, abcproto, 'return from .new_class =:= ABC')
     $P0 = split ' ', 'P6object'
-    abcobj = p6obj_tests(abcproto, 'ABC', 'isa'=>'ABC P6object', 'can'=>'foo')
+    abcobj = p6obj_tests(abcproto, 'ABC', 'isa'=>'ABC P6object', 'can'=>'foo', 'who'=>abcns)
     ##  make sure negative tests for 'can' work
     $I0 = can abcobj, 'bar'
     nok($I0, '! <can ABC_obj, "bar" >')
@@ -82,27 +84,30 @@
     ghins = get_hll_namespace ['GHI']
     $P0 = p6meta.'new_class'(ghins)
     ghiproto = get_hll_global 'GHI'
-    ghiobj = p6obj_tests(ghiproto, 'GHI', 'can'=>'foo')
+    ghiobj = p6obj_tests(ghiproto, 'GHI', 'can'=>'foo', 'who'=>ghins)
 
     ##  create a subclass called DEF1 from 'ABC'
-    .local pmc defproto, defobj
+    .local pmc defproto, defobj, defns
     $P0 = p6meta.'new_class'('DEF1', 'parent'=>'ABC')
     defproto = get_hll_global 'DEF1'
+    defns    = get_hll_namespace ['DEF1']
     is_same($P0, defproto, 'return from .new_class =:= DEF1')
-    defobj = p6obj_tests(defproto, 'DEF1', 'isa'=>'DEF1 ABC P6object')
+    defobj = p6obj_tests(defproto, 'DEF1', 'isa'=>'DEF1 ABC P6object', 'who'=>defns)
 
     ##  create a subclass called DEF2 from ABC proto
     $P0 = p6meta.'new_class'('DEF2', 'parent'=>abcproto)
     defproto = get_hll_global 'DEF2'
+    defns = get_hll_namespace ['DEF2']
     is_same($P0, defproto, 'return from .new_class =:= DEF2')
-    defobj = p6obj_tests(defproto, 'DEF2', 'isa'=>'DEF2 ABC P6object')
+    defobj = p6obj_tests(defproto, 'DEF2', 'isa'=>'DEF2 ABC P6object', 'who'=>defns)
 
     ##  create a subclass of a PMC called MyInt
-    .local pmc myintproto, myintobj, myintmeta
+    .local pmc myintproto, myintobj, myintmeta, myintns
     $P0 = p6meta.'new_class'('MyInt', 'parent'=>'Integer')
     myintproto = get_hll_global 'MyInt'
+    myintns = get_hll_namespace ['MyInt']
     is_same($P0, myintproto, 'return from .new_class =:= MyInt')
-    myintobj = p6obj_tests(myintproto, 'MyInt', 'isa'=>'MyInt Integer P6object')
+    myintobj = p6obj_tests(myintproto, 'MyInt', 'isa'=>'MyInt Integer P6object', 'who'=>myintns)
 
     ##  map Integer PMC objects to MyInt class, don't inherit from MyInt
     .local pmc integerobj, integermeta
@@ -145,13 +150,14 @@
     nok($I0, ".new_class didn't store proto as MyObject")
 
     ##  create class with ::-style name
-    .local pmc jklproto, jklobj
+    .local pmc jklproto, jklobj, jklns
     $P0 = p6meta.'new_class'('Foo::JKL')
     jklproto = get_hll_global ['Foo'], 'JKL'
+    jklns = get_hll_namespace ['Foo';'JKL']
     is_same($P0, jklproto, 'return from .new_class =:= Foo::JKL')
     $P0 = get_hll_global 'Foo::JKL'
     isa_nok($P0, 'P6protoobject', '["Foo::JKL"]')
-    jklobj = p6obj_tests(jklproto, 'Foo::JKL', 'isa'=>'P6object', 'can'=>'foo')
+    jklobj = p6obj_tests(jklproto, 'Foo::JKL', 'isa'=>'P6object', 'can'=>'foo', 'who'=>jklns)
 
     ##  add a method to a class
     $P0 = get_hll_global ['ABC'], 'foo'
@@ -201,6 +207,10 @@
     shortname = hash_default(options, 'shortname', classname)
     typename =  hash_default(options, 'typename',  classname)
 
+    .local pmc who
+    null who
+    who = hash_default(options, 'who', who)
+
     shortname = concat shortname, '()'
 
     .local string msg
@@ -228,6 +238,18 @@
     meta = proto.'HOW'()
     isa_ok(meta, 'P6metaclass', msg)
 
+    msg = 'concat'(classname, '.WHERE')
+    $P0 = proto.'WHERE'()
+    $I0 = get_addr proto
+    is($I0, $P0, msg)
+
+    if null who goto proto_who_done
+    msg = 'concat'(classname, '.WHO')
+    $P0 = proto.'WHO'()
+    is_same($P0, who, msg)
+  proto_who_done:
+
+  obj_tests:
     .local pmc obj, objmeta
     ##  skip object creation and tests for P6metaclass
     null obj
@@ -252,6 +274,17 @@
     $I0 = objmeta.'isa'(obj, proto)
     ok($I0, msg)
 
+    msg = 'concat'(objname, '.WHERE')
+    $P0 = obj.'WHERE'()
+    $I0 = get_addr obj
+    is($I0, $P0, msg)
+
+    if null who goto obj_who_done
+    msg = 'concat'(objname, '.WHO')
+    $P0 = obj.'WHO'()
+    is_same($P0, who, msg)
+  obj_who_done:
+
   obj_done:
 
     ##  test 'isa' semantics
@@ -449,17 +482,18 @@
     $P0 = get_root_global ['parrot'], 'XYZ'
     $I0 = isnull $P0
     ok($I0, ".new_class didn't store ['parrot'], 'XYZ'")
-    p6obj_tests(xyzproto, 'XYZ', 'isa'=>'XYZ P6object', 'can'=>'foo')
+    p6obj_tests(xyzproto, 'XYZ', 'isa'=>'XYZ P6object', 'can'=>'foo', 'who'=>xyzns)
 
     ##  build HLL class using name
-    .local pmc wxyproto, wxyobj
+    .local pmc wxyproto, wxyobj, wxyns
     $P0 = p6meta.'new_class'('WXY')
     wxyproto = get_hll_global 'WXY'
+    wxyns = get_hll_namespace ['WXY']
     is_same($P0, wxyproto, 'return from .new_class =:= WXY')
     $P0 = get_root_global ['parrot'], 'WXY'
     $I0 = isnull $P0
     ok($I0, ".new_class didn't store ['parrot'], 'WXY'")
-    p6obj_tests(wxyproto, 'WXY', 'isa'=>'WXY P6object', 'can'=>'foo')
+    p6obj_tests(wxyproto, 'WXY', 'isa'=>'WXY P6object', 'can'=>'foo', 'who'=>wxyns)
 
     ## build a Parrotclass
     .local pmc vwx_nsarray, vwx_ns, vwx_parrotclass, vwx_proto 
@@ -468,7 +502,7 @@
     vwx_ns = get_hll_namespace vwx_nsarray
     vwx_parrotclass = newclass vwx_ns
     vwx_proto = p6meta.'register'(vwx_parrotclass)
-    p6obj_tests(vwx_proto, 'VWX', 'can'=>'foo')
+    p6obj_tests(vwx_proto, 'VWX', 'can'=>'foo', 'who'=>vwx_ns)
 .end
 
 .namespace ['XYZ']

Modified: branches/orderedhash_revamp/t/library/parrotlib.t
==============================================================================
--- branches/orderedhash_revamp/t/library/parrotlib.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/library/parrotlib.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,14 +1,7 @@
-#!perl
-# Copyright (C) 2001-2005, Parrot Foundation.
+#!parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( t . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 6;
-use Parrot::Config;
-
 =head1 NAME
 
 t/library/parrotlib.t - testing library/parrotlib.pir
@@ -26,81 +19,82 @@
 
 # Common code in the test files
 
-my $template_top = << 'END_CODE';
-.sub _main
-
-  load_bytecode 'runtime/parrot/include/parrotlib.pbc'
-  .local pmc    location_sub
-  .local string location
-END_CODE
+.sub main :main
+    load_bytecode 'runtime/parrot/include/parrotlib.pbc'
 
-my $template_bottom = << 'END_CODE';
-  print location
-  print "\n"
+    .include 'test_more.pir'
+    plan(6)
 
-  end
+    test_include_file_location()
+    test_include_file_location_non_existent()
+    test_imcc_compile_file_location()
+    test_imcc_compile_file_location_non_existent()
+    test_dynext_location()
+    test_dynext_location_non_existent()
 .end
-END_CODE
+
 
 # Testing include_file_location
 
-pir_output_is( << "END_CODE", << 'END_OUT', 'include_file_location' );
-$template_top
-  location_sub = get_global ["_parrotlib"], "include_file_location"
-  location     = location_sub( 'datatypes.pasm' )
-$template_bottom
-END_CODE
-runtime/parrot/include/datatypes.pasm
-END_OUT
-
-pir_output_is( << "END_CODE", << 'END_OUT', 'include_file_location, non-existent' );
-$template_top
-  location_sub = get_global ['_parrotlib'], "include_file_location"
-  location     = location_sub( 'nonexistent.pasm' )
-$template_bottom
-END_CODE
+.sub test_include_file_location
+    .local pmc    location_sub
+    .local string location
+    location_sub = get_global ["_parrotlib"], "include_file_location"
+    location     = location_sub( 'datatypes.pasm' )
+    is(location,'runtime/parrot/include/datatypes.pasm', 'include file location' )
+.end
 
-END_OUT
+.sub test_include_file_location_non_existent
+    .local pmc    location_sub
+    .local string location
+    location_sub = get_global ['_parrotlib'], "include_file_location"
+    location     = location_sub( 'nonexistent.pasm' )
+    is(location, '', 'include file location non-existent')
+.end
 
 # Testing imcc_compile_file_location
 
-pir_output_is( << "END_CODE", << 'END_OUT', 'imcc_compile_file_location' );
-$template_top
-  location_sub = get_global ['_parrotlib'], "imcc_compile_file_location"
-  location     = location_sub( 'parrotlib.pbc' )
-$template_bottom
-END_CODE
-runtime/parrot/include/parrotlib.pbc
-END_OUT
-
-pir_output_is( << "END_CODE", << 'END_OUT', 'imcc_compile_file_location, non-existent' );
-$template_top
-  location_sub = get_global ['_parrotlib'], "imcc_compile_file_location"
-  location     = location_sub( 'nonexistent.pbc' )
-$template_bottom
-END_CODE
+.sub test_imcc_compile_file_location
+    .local pmc    location_sub
+    .local string location
+    location_sub = get_global ['_parrotlib'], "imcc_compile_file_location"
+    location     = location_sub( 'parrotlib.pbc' )
+    is(location, 'runtime/parrot/include/parrotlib.pbc','imcc compile file location')
+.end
 
-END_OUT
+.sub test_imcc_compile_file_location_non_existent
+    .local pmc    location_sub
+    .local string location
+    location_sub = get_global ['_parrotlib'], "imcc_compile_file_location"
+    location     = location_sub( 'nonexistent.pbc' )
+    is(location, '', 'imcc compile file location, non-existent')
+.end
 
 # Testing dynext_location
 
-pir_output_is( << "END_CODE", << "END_OUT", 'dynext_location' );
-$template_top
-  location_sub = get_global ['_parrotlib'], "dynext_location"
-  location     = location_sub( 'libnci_test', '$PConfig{load_ext}' )
-$template_bottom
-END_CODE
-runtime/parrot/dynext/libnci_test$PConfig{load_ext}
-END_OUT
-
-pir_output_is( << "END_CODE", << 'END_OUT', 'dynext_location, non-existent' );
-$template_top
-  location_sub = get_global ['_parrotlib'], "imcc_compile_file_location"
-  location     = location_sub( 'nonexistent' )
-$template_bottom
-END_CODE
+.sub test_dynext_location
+    .include 'iglobals.pasm'
+    .local pmc config_hash, interp
+    .local pmc    location_sub
+    .local string location
+
+    interp = getinterp
+    config_hash = interp[.IGLOBALS_CONFIG_HASH]
+    $S0 = config_hash['load_ext']
+    location_sub = get_global ['_parrotlib'], "dynext_location"
+    location     = location_sub( 'libnci_test', $S0 )
+    $S1 = 'runtime/parrot/dynext/libnci_test'
+    $S1 .= $S0
+    is(location, $S1, 'dynext_location')
+.end
 
-END_OUT
+.sub test_dynext_location_non_existent
+    .local pmc    location_sub
+    .local string location
+    location_sub = get_global ['_parrotlib'], "imcc_compile_file_location"
+    location     = location_sub( 'nonexistent' )
+    is(location, '', 'dynext location non-existent')
+.end
 
 =head1 AUTHOR
 
@@ -117,4 +111,4 @@
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 filetype=pir:

Modified: branches/orderedhash_revamp/t/library/pcre.t
==============================================================================
--- branches/orderedhash_revamp/t/library/pcre.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/library/pcre.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -7,7 +7,7 @@
 use lib qw( t . lib ../lib ../../lib );
 
 use Test::More;
-use Parrot::Test tests => 1;
+use Parrot::Test tests => 2;
 
 =head1 NAME
 
@@ -46,6 +46,61 @@
         unless $has_pcre;
 
 ## 1
+## Check that the library can be loaded and initialized,
+## diganose the failure otherwise.
+    pir_output_is(<<"CODE", <<'OUT', 'libpcre loading');
+
+.include 'iglobals.pasm'
+.include 'libpaths.pasm'
+
+.sub main :main
+    .local pmc interp
+    getinterp interp
+
+    .local pmc lib_paths
+    lib_paths = interp[.IGLOBALS_LIB_PATHS]
+
+    .local pmc dynext_path
+    dynext_path = lib_paths[.PARROT_LIB_PATH_DYNEXT]
+    unshift dynext_path, '$pcre_libpath'
+
+    load_bytecode 'pcre.pbc'
+    .local pmc pcre_init
+    .local pmc pcre_lib
+
+    get_global pcre_init, ['PCRE'], 'init'
+    if null pcre_init goto NOINIT
+    push_eh CATCH
+    pcre_lib = pcre_init()
+    pop_eh
+    if null pcre_lib goto NULLINIT
+    unless pcre_lib goto FALSEINIT
+    say 'Loaded'
+    .return()
+CATCH:
+    .local pmc exception
+    .get_results(exception)
+    .local string message
+    message = exception['message']
+    pop_eh
+    say message
+    .return()
+NOINIT:
+   say 'No init function'
+    .return()
+NULLINIT:
+    say 'init returned null value'
+    .return()
+FALSEINIT:
+    say 'init returned false value'
+    .return()
+.end
+
+CODE
+Loaded
+OUT
+
+## 2
     pir_output_is( <<"CODE", <<'OUT', 'soup to nuts' );
 
 .include 'iglobals.pasm'

Modified: branches/orderedhash_revamp/t/library/protoobject.t
==============================================================================
--- branches/orderedhash_revamp/t/library/protoobject.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/library/protoobject.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,13 +1,7 @@
-#!perl
-# Copyright (C) 2001-2005, Parrot Foundation.
+#!parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( t . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 9;
-
 =head1 NAME
 
 t/library/protoobject.t - testing Protoobject.pir
@@ -22,170 +16,138 @@
 
 =cut
 
-pir_output_is( << 'END_CODE', << 'END_OUT', 'basic load' );
 .sub main :main
     load_bytecode 'Protoobject.pbc'
 
+    .include 'test_more.pir'
+    plan(13)
+
+    test_basic_load()
+    test_type_of_protoobject()
+    test_type_of_ns_based_protoobject()
+    test_protoobject_symbol_1()
+    test_protoobject_symbol_2()
+    test_protoobject_symbol_for_classes()
+    test_new_subclass_for_classes()
+    test_new_subclass_with_attrs()
+    test_method_new_on_protoobject()
+.end
+
+
+.sub test_basic_load
     $P0 = get_hll_global 'Protomaker'
     $S0 = typeof $P0
-    say $S0
+    is($S0, 'Protomaker', 'basic load')
 .end
-END_CODE
-Protomaker
-END_OUT
 
-pir_output_is( << 'END_CODE', << 'END_OUT', 'type of protoobject' );
-.sub main :main
-    load_bytecode 'Protoobject.pbc'
 
+.sub test_type_of_protoobject
     $P0 = get_hll_global 'Protomaker'
     $P1 = newclass 'XYZ'
     $P2 = $P0.'new_proto'($P1)
 
     $S0 = typeof $P2
-    say $S0
+    is($S0, 'XYZ', 'type of protoobject')
 .end
-END_CODE
-XYZ
-END_OUT
 
-pir_output_is( << 'END_CODE', << 'END_OUT', 'type of ns-based protoobject' );
-.sub main :main
-    load_bytecode 'Protoobject.pbc'
 
+.sub test_type_of_ns_based_protoobject
     $P0 = get_hll_global 'Protomaker'
-    $P1 = newclass ['Foo';'Bar']
+    $P1 = newclass ['Foo';'Bar1']
     $P2 = $P0.'new_proto'($P1)
 
     $S0 = typeof $P2
-    say $S0
+    is($S0, 'Foo;Bar1', 'type of ns-based protoobject')
 .end
-END_CODE
-Foo;Bar
-END_OUT
 
-pir_output_is( << 'END_CODE', << 'END_OUT', 'Protoobject symbol' );
-.sub main :main
-    load_bytecode 'Protoobject.pbc'
 
+.sub test_protoobject_symbol_1
     $P0 = get_hll_global 'Protomaker'
-    $P1 = newclass ['Foo';'Bar']
+    $P1 = newclass ['Foo';'Bar2']
     $P2 = $P0.'new_proto'($P1)
 
-    $P2 = get_hll_global ['Foo'], 'Bar'
+    $P2 = get_hll_global ['Foo'], 'Bar2'
     $S0 = typeof $P2
-    say $S0
+    is($S0, 'Foo;Bar2', 'protoobject symbol 1')
 .end
-END_CODE
-Foo;Bar
-END_OUT
 
-pir_output_is( << 'END_CODE', << 'END_OUT', 'Protoobject symbol' );
-.sub main :main
-    load_bytecode 'Protoobject.pbc'
 
+.sub test_protoobject_symbol_2
     $P0 = get_hll_global 'Protomaker'
     $P1 = newclass 'Foo'
     $P2 = $P0.'new_proto'($P1)
 
     $P2 = get_hll_global 'Foo'
     $S0 = typeof $P2
-    say $S0
+    is($S0, 'Foo', 'protoobject symbol 2')
 .end
-END_CODE
-Foo
-END_OUT
 
-pir_output_is( <<'END_CODE', <<'END_OUT', 'Protoobject symbol for :: classes' );
-.sub main :main
-    load_bytecode 'Protoobject.pbc'
 
+.sub test_protoobject_symbol_for_classes
     $P0 = get_hll_global 'Protomaker'
-    $P1 = newclass 'Foo::Bar'
+    $P1 = newclass 'Foo::Bar3'
     $P2 = $P0.'new_proto'($P1)
 
-    $P2 = get_hll_global ['Foo'], 'Bar'
+    $P2 = get_hll_global ['Foo'], 'Bar3'
     $S0 = typeof $P2
-    say $S0
+    is($S0, 'Foo::Bar3', 'protoobject symbol for :: classes')
 .end
-END_CODE
-Foo::Bar
-END_OUT
 
-pir_output_is( <<'END_CODE', <<'END_OUT', 'new_subclass for :: classes' );
-.sub main :main
-    load_bytecode 'Protoobject.pbc'
 
+.sub test_new_subclass_for_classes
     $P0 = get_hll_global 'Protomaker'
     $P1 = get_class 'Hash'
-    $P0.'new_subclass'($P1, 'Foo::Bar')
+    $P0.'new_subclass'($P1, 'Foo::Bar4')
 
-    $P2 = new 'Foo::Bar'
+    $P2 = new 'Foo::Bar4'
     $S0 = typeof $P2
-    say $S0
+    is($S0, 'Foo::Bar4', 'new_subclass for :: classes')
 
-    $P2 = get_hll_global ['Foo'], 'Bar'
+    $P2 = get_hll_global ['Foo'], 'Bar4'
     $S0 = typeof $P2
-    say $S0
+    is($S0, 'Foo::Bar4', 'new_subclass for :: classes')
 .end
-END_CODE
-Foo::Bar
-Foo::Bar
-END_OUT
 
-pir_output_is( <<'END_CODE', <<'END_OUT', 'new_subclass with attrs' );
-.sub main :main
-    load_bytecode 'Protoobject.pbc'
 
+.sub test_new_subclass_with_attrs
     .local pmc protomaker, hashclass, attrs
     protomaker = get_hll_global 'Protomaker'
     hashclass = get_class 'Hash'
     attrs = split ' ', '$a $b $c $d'
     protomaker.'new_subclass'(hashclass, 'Foo::Bar', attrs :flat)
 
-    .local pmc object, iter
+    .local pmc object, it
     object = new 'Foo::Bar'
-    iter = new 'Iterator', attrs
+    it = iter attrs
   iter_loop:
-    unless iter goto iter_end
-    $P0 = shift iter
+    unless it goto iter_end
+    $P0 = shift it
     $S0 = $P0
     setattribute object, $S0, $P0
     $P1 = getattribute object, $S0
-    say $P1
+    is($P1, $P0,'new_subclass with attrs')
     goto iter_loop
   iter_end:
 .end
-END_CODE
-$a
-$b
-$c
-$d
-END_OUT
 
-pir_output_is( <<'END_CODE', <<'END_OUT', 'method "new" on protoobject' );
-.sub main :main
-    load_bytecode 'Protoobject.pbc'
 
-    $P0 = newclass 'Foo'
+.sub test_method_new_on_protoobject
+    $P0 = newclass 'Foo1'
 
     .local pmc protomaker
     protomaker = get_hll_global 'Protomaker'
-    protomaker.'new_proto'('Foo')
+    protomaker.'new_proto'('Foo1')
 
-    $P0 = get_hll_global 'Foo'
+    $P0 = get_hll_global 'Foo1'
     $P1 = $P0.'new'()
     $S0 = typeof $P1
-    say $S0
+    is($S0, 'Foo1', 'method "new" on protoobject')
 .end
-END_CODE
-Foo
-END_OUT
+
 
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
-
+# vim: expandtab shiftwidth=4 filetype=pir:

Modified: branches/orderedhash_revamp/t/library/rand.t
==============================================================================
--- branches/orderedhash_revamp/t/library/rand.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/library/rand.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,16 +1,14 @@
-#!perl
+#!parrot
 # Copyright (C) 2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( t . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 2;
-
 =head1 NAME
 
-t/library/rand.t - rand tests
+t/library/rand.t
+
+=head1 DESCRIPTION
+
+Test the Math::Rand PBC
 
 =head1 SYNOPSIS
 
@@ -18,47 +16,42 @@
 
 =cut
 
-pir_output_is( << 'CODE', << 'OUTPUT', 'rand / srand' );
-.sub test :main
+.sub main :main
     load_bytecode 'Math/Rand.pbc'
+
+    .include 'test_more.pir'
+    plan(7)
+
+    test_rand_srand()
+    test_rand_max()
+.end
+
+.sub test_rand_srand
     .local pmc rand
     rand = get_global [ 'Math'; 'Rand' ], 'rand'
     .local pmc srand
     srand = get_global [ 'Math'; 'Rand' ], 'srand'
     $I0 = rand()
-    say $I0
+    is($I0,16838)
     $I0 = rand()
-    say $I0
+    is($I0,5758)
     $I0 = rand()
-    say $I0
+    is($I0,10113)
     $I0 = rand()
-    say $I0
+    is($I0,17515)
     srand(1)
     $I0 = rand()
-    say $I0
+    is($I0,16838)
     $I0 = rand()
-    say $I0
+    is($I0,5758)
 .end
-CODE
-16838
-5758
-10113
-17515
-16838
-5758
-OUTPUT
 
-pir_output_is( << 'CODE', << 'OUTPUT', 'RAND_MAX' );
-.sub test :main
-    load_bytecode 'Math/Rand.pbc'
+.sub test_rand_max
     .local pmc rand_max
     rand_max = get_global [ 'Math'; 'Rand' ], 'RAND_MAX'
     $I0 = rand_max()
-    say $I0
+    is($I0,32767)
 .end
-CODE
-32767
-OUTPUT
 
 
 # Local Variables:

Modified: branches/orderedhash_revamp/t/library/string_utils.t
==============================================================================
--- branches/orderedhash_revamp/t/library/string_utils.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/library/string_utils.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -4,7 +4,11 @@
 
 =head1 NAME
 
-t/library/string_utils.t  -- Tests for String/Utils.pbc
+t/library/string_utils.t
+
+=head1 DESCRIPTION
+
+Tests for String/Utils.pbc
 
 =head1 SYNOPSIS
 

Modified: branches/orderedhash_revamp/t/library/tcl_glob.t
==============================================================================
--- branches/orderedhash_revamp/t/library/tcl_glob.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/library/tcl_glob.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -4,14 +4,16 @@
 
 =head1 NAME
 
-t/library/tcl_glob.t - test tcl-style globs
+t/library/tcl_glob.t
+
+=head1 DESCRIPTION
+
+test tcl-style globs
 
 =head1 SYNOPSIS
 
     % prove t/library/tcl_glob.t
 
-=head1 DESCRIPTION
-
 =cut
 
 .sub 'main' :main

Modified: branches/orderedhash_revamp/t/library/tcl_lib.t
==============================================================================
--- branches/orderedhash_revamp/t/library/tcl_lib.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/library/tcl_lib.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -4,14 +4,16 @@
 
 =head1 NAME
 
-t/library/tcl_lib.t - test parrot to external Tcl connection
+t/library/tcl_lib.t
+
+=head1 DESCRIPTION
+
+test parrot to external Tcl connection
 
 =head1 SYNOPSIS
 
     % prove t/library/tcl_lib.t
 
-=head1 DESCRIPTION
-
 =cut
 
 .const int TESTS = 1

Modified: branches/orderedhash_revamp/t/library/test_more.t
==============================================================================
--- branches/orderedhash_revamp/t/library/test_more.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/library/test_more.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
-#!./parrot
-# Copyright (C) 2005-2008, Parrot Foundation.
+#!parrot
+# Copyright (C) 2005-2009, Parrot Foundation.
 # $Id$
 
 .sub _main :main
@@ -15,28 +15,172 @@
     .local pmc exports, curr_namespace, test_namespace
     curr_namespace = get_namespace
     test_namespace = get_namespace [ 'Test'; 'More' ]
-    exports = split " ", "ok is diag like skip todo is_deeply isa_ok isnt"
+    exports = split " ", "ok nok is diag like skip todo is_deeply isa_ok isnt throws_like lives_ok dies_ok"
     test_namespace.'export_to'(curr_namespace, exports)
 
     test_namespace = get_namespace [ 'Test'; 'Builder'; 'Tester' ]
     exports = split " ", "plan test_out test_diag test_fail test_pass test_test"
     test_namespace.'export_to'(curr_namespace, exports)
 
-    plan( 75 )
+    plan( 108 )
 
     test_skip()
     test_todo()
     test_ok()
+    test_nok()
     test_is()
     test_isnt()
     test_like()
     test_is_deeply()
     test_diagnostics()
+    test_lives_ok()
+    test_dies_ok()
+    test_throws_like()
     test_isa_ok()
 
     test.'finish'()
 .end
 
+.sub test_dies_ok
+    test_pass( 'dies_ok passes when there is an error' )
+    dies_ok( <<'CODE', 'dies_ok passes when there is an error' )
+.sub main
+    die 'I did it for the lulz'
+.end
+CODE
+    test_test( 'dies_ok passes when there is an error' )
+
+    test_fail( 'dies_ok fails when there is no error' )
+    dies_ok( <<'CODE', 'dies_ok fails when there is no error' )
+.sub main
+    $I0 = 42
+.end
+CODE
+    test_diag( 'no error thrown' )
+    test_test( 'dies_ok fails when there is no error' )
+
+    test_pass( 'dies_ok passes when there is an error with diagnostic message' )
+    dies_ok( <<'CODE', 'dies_ok passes when there is an error with diagnostic message' )
+.sub main
+    die 'I did it for the lulz'
+.end
+CODE
+    test_diag( '' )
+    test_test( 'dies_ok passes when there is an error with diagnostic message' )
+
+    test_fail( 'dies_ok fails when there is no error with diagnostic message' )
+    dies_ok( <<'CODE', 'dies_ok fails when there is no error with diagnostic message' )
+.sub main
+    $I0 = 42
+.end
+CODE
+    test_diag( 'no error thrown' )
+    test_test( 'dies_ok fails when there is no error with diagnostic message' )
+
+.end
+
+.sub test_lives_ok
+
+    test_pass( 'lives_ok passes when there is no error' )
+    lives_ok( <<'CODE', 'lives_ok passes when there is no error' )
+.sub main
+    $I0 = 42
+.end
+CODE
+    test_test( 'lives_ok passes when there is no error' )
+
+    test_fail( 'lives_ok fails when there is an error')
+    lives_ok( <<'CODE', 'lives_ok fails when there is an error')
+.sub main
+    die 'I did it for the lulz'
+.end
+CODE
+    test_diag( 'I did it for the lulz' )
+    test_test( 'lives_ok fails when there is an error' )
+
+    test_pass( 'lives_ok passes when there is no error (with diagnostic message)' )
+    lives_ok( <<'CODE', 'lives_ok passes when there is no error (with diagnostic message)' )
+.sub main
+    $I0 = 42
+.end
+CODE
+    test_diag( '' )
+    test_test( 'lives_ok passes when there is no error (with diagnostic message)' )
+
+    test_fail( 'lives_ok fails when there is an error (with diagnostic message)' )
+    lives_ok( <<'CODE', 'lives_ok fails when there is an error (with diagnostic message)' )
+.sub main
+    die 'I did it for the lulz'
+.end
+CODE
+    test_diag( 'I did it for the lulz' )
+    test_test( 'lives_ok fails when there is an error' )
+.end
+
+.sub test_throws_like
+
+    test_fail('throws_like fails when there is no error')
+    throws_like( <<'CODE', 'somejunk', 'throws_like fails when there is no error')
+.sub main
+    $I0 = 42
+.end
+CODE
+    test_diag( 'no error thrown' )
+    test_test( 'throws_like fails when there is no error')
+
+    test_pass('throws_like passes when error matches pattern')
+    throws_like( <<'CODE', 'for\ the\ lulz','throws_like passes when error matches pattern')
+.sub main
+    die 'I did it for the lulz'
+.end
+CODE
+    test_test( 'throws_like passes when error matches pattern' )
+
+    test_fail( 'throws_like fails when error does not match pattern' )
+    throws_like( <<'CODE', 'for\ the\ lulz','throws_like fails when error does not match pattern')
+.sub main
+    die 'DO NOT WANT'
+.end
+CODE
+    .local string diagnostic
+    diagnostic  = "match failed: target 'DO NOT WANT' does not match pattern '"
+    diagnostic .= 'for\ the\ lulz'
+    diagnostic .= "'"
+    test_diag( diagnostic )
+    test_test('throws_like fails when error does not match pattern' )
+
+.end
+
+.namespace ['MyFalseClass']
+
+.sub '' :anon :load :init
+    $P0 = newclass ['MyFalseClass']
+.end
+
+.sub 'get_bool' :vtable
+    .return(0)
+.end
+
+.sub 'get_integer' :vtable
+    .return(1)
+.end
+
+.namespace ['MyTrueClass']
+
+.sub '' :anon :load :init
+    $P0 = newclass ['MyTrueClass']
+.end
+
+.sub 'get_bool' :vtable
+    .return(1)
+.end
+
+.sub 'get_integer' :vtable
+    .return(0)
+.end
+
+.namespace []
+
 .sub test_ok
     test_pass()
     ok( 1 )
@@ -53,6 +197,44 @@
     test_fail( 'with description' )
     ok( 0, 'with description' )
     test_test( 'failing test ok() with description')
+
+    $P0 = new ['MyFalseClass']
+    test_fail()
+    ok( $P0 )
+    test_test( 'failing ok() calls get_bool')
+
+    $P0 = new ['MyTrueClass']
+    test_pass()
+    ok( $P0 )
+    test_test( 'passing ok() calls get_bool')
+.end
+
+.sub test_nok
+    test_fail()
+    nok( 1 )
+    test_test( 'failing test nok()')
+
+    test_pass()
+    nok( 0 )
+    test_test( 'passing test nok()')
+
+    test_fail( 'with description' )
+    nok( 1, 'with description' )
+    test_test( 'failing test nok() with description')
+
+    test_pass( 'with description' )
+    nok( 0, 'with description' )
+    test_test( 'passing test nok() with description')
+
+    $P0 = new ['MyFalseClass']
+    test_pass()
+    nok( $P0 )
+    test_test( 'passing nok() calls get_bool')
+
+    $P0 = new ['MyTrueClass']
+    test_fail()
+    nok( $P0 )
+    test_test( 'failing nok() calls get_bool')
 .end
 
 .sub test_is
@@ -96,6 +278,41 @@
     test_diag( 'Want: 888.8' )
     test_test( 'failing test is() for floats with description')
 
+    test_fail( 'comparing two floats with precision, failure' )
+    is( 777.1, 888.8, 'comparing two floats with precision, failure', 1e-6)
+    test_diag( 'Have: 777.1' )
+    test_diag( 'Want: 888.8' )
+    test_test( 'failing test is() for floats with precision')
+
+    test_pass( 'comparing two floats with precision, success' )
+    is( 666.222, 666.223, 'comparing two floats with precision, success', 1e-2)
+    test_test( 'passing test is() for floats with precision')
+
+    test_fail( 'comparing Float PMC and a float with precision, failure' )
+    $P0 = new 'Float'
+    $P0 = 888.81
+    is( $P0, 888.82, 'comparing Float PMC and a float with precision, failure', 1e-2)
+    test_diag( 'Have: 888.81' )
+    test_diag( 'Want: 888.82' )
+    test_test( 'failing test is() for comparing a Float PMC and float with precision')
+
+    test_pass( 'comparing Float PMC and a float with precision, success' )
+    $P0 = 666.222
+    is( $P0, 666.223, 'comparing Float PMC and a float with precision, success', 1e-2)
+    test_test( 'passing test is() for comparing Float PMC and float with precision')
+
+    test_pass( 'comparing integer and a Float PMC with precision, success' )
+    $I0 = 42
+    is( $I0, 41.99, 'comparing integer and a Float PMC with precision, success', 0.1)
+    test_test( 'passing test is() for comparing Integer PMC and float with precision')
+
+    test_fail( 'comparing integer and a Float PMC with precision, failure' )
+    $I0 = 42
+    is( $I0, 41.99, 'comparing integer and a Float PMC with precision, failure', 1e-3)
+    test_diag( 'Have: 42' )
+    test_diag( 'Want: 41.99' )
+    test_test( 'failing test is() for comparing Integer PMC and float with precision')
+
     test_pass()
     is( 'bob', 'bob' )
     test_test( 'passing test is() for strings')
@@ -263,19 +480,33 @@
     test_test( 'passing test like() with description' )
 
     test_fail()
-    test_diag( 'match failed' )
+
+    test_diag( "match failed: target 'abcdef' does not match pattern '<[g]>'" )
     like( 'abcdef', '<[g]>' )
     test_test( 'failing test like()' )
 
     test_fail( 'testing like()' )
-    test_diag( 'match failed' )
+    test_diag( "match failed: target 'abcdef' does not match pattern '<[g]>'" )
     like( 'abcdef', '<[g]>', 'testing like()' )
     test_test( 'failing test like() with description' )
+
+    test_pass( 'like() can match literal strings' )
+    like( 'foobar', 'foobar', 'like() can match literal strings' )
+    test_test( 'like() can match literal strings' )
+
+    test_pass( 'like() can match partial literal strings' )
+    like( 'foobar()', 'foobar', 'like() can match partial literal strings' )
+    test_test( 'like() can match partial literal strings' )
+
+    test_pass( 'like() can match partial literal strings with spaces' )
+    like( 'foo bar()', 'foo\ bar', 'like() can match partial literal strings with spaces' )
+    test_test( 'like() can match partial literal strings with spaces' )
 .end
 
 .sub test_is_deeply
     test_is_deeply_array()
     test_is_deeply_hash()
+    test_is_deeply_hash_tt763()
     test_is_deeply_mismatch()
     test_is_deeply_nested()
 .end
@@ -326,9 +557,13 @@
 .sub test_is_deeply_hash
     .local pmc left
     .local pmc right
+    .local pmc undef1
+    .local pmc undef2
 
-    left  = new 'Hash'
-    right = new 'Hash'
+    left   = new 'Hash'
+    right  = new 'Hash'
+    undef1 = new 'Undef'
+    undef2 = new 'Undef'
 
     test_pass()
     is_deeply( left, right )
@@ -371,6 +606,49 @@
     test_test( 'passing test is_deeply() for hashes created in different orders' )
 .end
 
+.sub test_is_deeply_hash_tt763
+    .local pmc left
+    .local pmc right
+    .local pmc undef1
+    .local pmc undef2
+
+    left   = new 'Hash'
+    right  = new 'Hash'
+    undef1 = new 'Undef'
+    undef2 = new 'Undef'
+    right['undef1'] = undef1
+    left['undef2']  = undef2
+
+    test_fail()
+    is_deeply( left, right )
+    test_diag( 'Mismatch at [undef2]: expected (undef), received nonexistent' )
+    test_test( 'failing is_deeply() for undef in left, nonexistent in right' )
+
+    test_fail()
+    is_deeply( right, left )
+    test_diag( 'Mismatch at [undef1]: expected (undef), received nonexistent' )
+    test_test( 'failing is_deeply() for undef in left, nonexistent in right' )
+
+    right['undef2'] = undef2
+    left['undef1']  = undef1
+
+    test_pass()
+    is_deeply( left, right )
+    test_test( 'passing is_deeply() with undef values' )
+
+    left['foo'] = undef1
+    test_fail()
+    is_deeply( left, right )
+    test_diag( 'Mismatch: expected 3 elements, received 2')
+    test_test( 'failing is_deeply() for hashes differing by keys with undef values' )
+
+    right['bar'] = undef1
+    test_fail()
+    is_deeply( left, right )
+    test_diag( 'Mismatch at [foo]: expected (undef), received nonexistent')
+    test_test( 'failing is_deeply() for hashes differing by keys with undef values' )
+.end
+
 .sub test_is_deeply_mismatch
 .end
 

Modified: branches/orderedhash_revamp/t/library/uuid.t
==============================================================================
--- branches/orderedhash_revamp/t/library/uuid.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/library/uuid.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,183 +1,126 @@
-#!perl
-# Copyright (C) 2008, Parrot Foundation.
+#!parrot
+# Copyright (C) 2008-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( t . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 9;
-
 =head1 NAME
 
-t/library/uuid.t - uuid library tests
+t/library/uuid.t
 
 =head1 SYNOPSIS
 
     % prove t/library/uuid.t
 
+=head1 DESCRIPTION
+
+uuid library tests
+
 =cut
 
-pir_output_is( << 'CODE', << 'OUTPUT', 'generate' );
-.sub test :main
+.sub main :main
     load_bytecode 'uuid.pbc'
+
+    .include 'test_more.pir'
+    plan(20)
+
+    test_generate_1()
+    test_generate_2()
+    test_generate_random()
+    test_generate_time()
+    test_parse_1()
+    test_parse_2()
+    test_time()
+    test_type()
+    test_variant()
+.end
+
+
+.sub test_generate_1
     $P0 = get_global ['uuid'], 'generate'
     $P1 = $P0()
     $S1 = typeof $P1
-    print $S1
-    print "\n"
+    is($S1,'uuid', 'generate 1')
 .end
-CODE
-uuid
-OUTPUT
 
 
-pir_output_like( << 'CODE', << 'OUTPUT', 'generate' );
-.sub test :main
-    load_bytecode 'uuid.pbc'
+.sub test_generate_2
     $P0 = get_global ['uuid'], 'generate'
     $P1 = $P0()
-    print $P1
+    like($P1, '<[0..9a..f]>**8\-<[0..9a..f]>**4\-<[0..9a..f]>**4\-<[0..9a..f]>**4\-<[0..9a..f]>**12', 'generate 2' )
 .end
-CODE
-/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
-OUTPUT
 
 
-pir_output_like( << 'CODE', << 'OUTPUT', 'generate_random' );
-.sub test :main
-    load_bytecode 'uuid.pbc'
+.sub test_generate_random
     $P0 = get_global ['uuid'], 'generate_random'
     $P1 = $P0()
-    print $P1
+    like($P1, '<[0..9a..f]>**8\-<[0..9a..f]>**4\-<[0..9a..f]>**4\-<[0..9a..f]>**4\-<[0..9a..f]>**12', 'generate random')
 .end
-CODE
-/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
-OUTPUT
 
 
-pir_output_like( << 'CODE', << 'OUTPUT', 'generate_time' );
-.sub test :main
-    load_bytecode 'uuid.pbc'
+.sub test_generate_time
     $P0 = get_global ['uuid'], 'generate_time'
     $P1 = $P0()
-    print $P1
+    like($P1, '<[0..9a..f]>**8\-<[0..9a..f]>**4\-<[0..9a..f]>**4\-<[0..9a..f]>**4\-<[0..9a..f]>**12', 'generate time')
 .end
-CODE
-/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
-OUTPUT
 
 
-pir_output_is( << 'CODE', << 'OUTPUT', 'parse' );
-.sub test :main
-    load_bytecode 'uuid.pbc'
+.sub test_parse_1
     $P0 = get_global ['uuid'], 'parse'
     ($I0, $P1) = $P0("84949cc5-4701-4a84-895b-354c584a981b")
-    print $I0
-    print "\n"
+    is($I0, 0, 'parse 1')
     $S1 = typeof $P1
-    print $S1
-    print "\n"
+    is($S1, 'uuid', 'parse 1')
 .end
-CODE
-0
-uuid
-OUTPUT
 
 
-pir_output_is( << 'CODE', << 'OUTPUT', 'parse' );
-.sub test :main
-    load_bytecode 'uuid.pbc'
+.sub test_parse_2
     $P0 = get_global ['uuid'], 'parse'
     $I0 = $P0("84949cc5-4701-4a84-895b-354c584a981b")
-    print $I0
-    print "\n"
+    is($I0, 0, 'parse 2')
     $I0 = $P0("84949CC5-4701-4A84-895B-354C584A981B")
-    print $I0
-    print "\n"
+    is($I0, 0, 'parse 2')
     $I0 = $P0("84949cc5-4701-4a84-895b-354c584a981bc")
-    print $I0
-    print "\n"
+    is($I0, -1, 'parse 2')
     $I0 = $P0("84949cc5-4701-4a84-895b-354c584a981")
-    print $I0
-    print "\n"
+    is($I0, -1, 'parse 2')
     $I0 = $P0("84949cc5x4701-4a84-895b-354c584a981b")
-    print $I0
-    print "\n"
+    is($I0, -1, 'parse 2')
     $I0 = $P0("84949cc504701-4a84-895b-354c584a981b")
-    print $I0
-    print "\n"
+    is($I0, -1, 'parse 2')
     $I0 = $P0("84949cc5-470104a84-895b-354c584a981b")
-    print $I0
-    print "\n"
+    is($I0, -1, 'parse 2')
     $I0 = $P0("84949cc5-4701-4a840895b-354c584a981b")
-    print $I0
-    print "\n"
+    is($I0, -1, 'parse 2')
     $I0 = $P0("84949cc5-4701-4a84-895b0354c584a981b")
-    print $I0
-    print "\n"
+    is($I0, -1, 'parse 2')
     $I0 = $P0("g4949cc5-4701-4a84-895b-354c584a981b")
-    print $I0
-    print "\n"
+    is($I0, -1, 'parse 2')
     $I0 = $P0("84949cc5-4701-4a84-895b-354c584a981g")
-    print $I0
-    print "\n"
+    is($I0, -1, 'parse 2')
 .end
-CODE
-0
-0
--1
--1
--1
--1
--1
--1
--1
--1
--1
-OUTPUT
 
 
-pir_output_is( << 'CODE', << 'OUTPUT', 'time' );
-.sub test :main
-    load_bytecode 'uuid.pbc'
+.sub test_time
     $P0 = get_global ['uuid'], 'parse'
     ($I0, $P1) = $P0("84949cc5-4701-4a84-895b-354c584a981b")
     $I1 = $P1.'time'()
-    print $I1
-    print "\n"
+    is($I1, -1, 'time')
 .end
-CODE
--1
-OUTPUT
 
 
-pir_output_is( << 'CODE', << 'OUTPUT', 'type' );
-.sub test :main
-    load_bytecode 'uuid.pbc'
+.sub test_type
     $P0 = get_global ['uuid'], 'generate'
     $P1 = $P0()
     $I0 = $P1.'type'()
-    print $I0
-    print "\n"
+    is($I0, 4, 'type')
 .end
-CODE
-4
-OUTPUT
 
 
-pir_output_is( << 'CODE', << 'OUTPUT', 'variant' );
-.sub test :main
-    load_bytecode 'uuid.pbc'
+.sub test_variant
     $P0 = get_global ['uuid'], 'generate'
     $P1 = $P0()
     $I0 = $P1.'variant'()
-    print $I0
-    print "\n"
+    is($I0, 1, 'variant')
 .end
-CODE
-1
-OUTPUT
 
 
 # Local Variables:
@@ -185,4 +128,4 @@
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 filetype=pir:

Deleted: branches/orderedhash_revamp/t/library/yaml_parser_syck.t
==============================================================================
--- branches/orderedhash_revamp/t/library/yaml_parser_syck.t	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,175 +0,0 @@
-#!perl
-# Copyright (C) 2001-2006, Parrot Foundation.
-# $Id$
-
-use strict;
-use warnings;
-use lib qw( t . lib ../lib ../../lib );
-
-use Test::More;
-use Parrot::Test tests => 1;
-
-=head1 NAME
-
-t/library/yaml_parser_syck.t - testing library/YAML/Parser/Syck.pir
-
-=head1 SYNOPSIS
-
-    % prove t/library/yaml_parser_syck.t
-
-=head1 DESCRIPTION
-
-Try to parse a YAML document.
-
-=cut
-
-TODO: {
-
-    local $TODO = 'Not properly implemented yet';
-
-    pir_output_is( << 'CODE', << 'OUT', "basic parsing" );
-
-.sub test :main
-    load_bytecode "YAML/Parser/Syck.pbc"
-    load_bytecode "dumper.pbc"
-
-  .local pmc loaded
-  ( loaded ) = load( "---\n- key1: val1\n  key2: val2\n- elem1\n- elem12\n- elem123\n- elem1234\n- elem12345\n- elem123456\n- elem1234567\n- elem12345678\n" )
-  _dumper( "loaded", loaded )
-
-  end
-.end
-CODE
-val1
-
-val1
-key1
-
-val1
-key1
-val2
-
-val1
-key1
-val2
-key2
-
-val1
-key1
-val2
-key2
-
-val1
-key1
-val2
-key2
-elem1
-
-val1
-key1
-val2
-key2
-elem1
-elem12
-
-val1
-key1
-val2
-key2
-elem1
-elem12
-elem123
-
-val1
-key1
-val2
-key2
-elem1
-elem12
-elem123
-elem1234
-
-val1
-key1
-val2
-key2
-elem1
-elem12
-elem123
-elem1234
-elem12345
-
-val1
-key1
-val2
-key2
-elem1
-elem12
-elem123
-elem1234
-elem12345
-elem123456
-
-val1
-key1
-val2
-key2
-elem1
-elem12
-elem123
-elem1234
-elem12345
-elem123456
-elem1234567
-
-val1
-key1
-val2
-key2
-elem1
-elem12
-elem123
-elem1234
-elem12345
-elem123456
-elem1234567
-elem12345678
-
-val1
-key1
-val2
-key2
-elem1
-elem12
-elem123
-elem1234
-elem12345
-elem123456
-elem1234567
-elem12345678
-
-"loaded" => "val1\nkey1\nval2\nkey2\nelem1\nelem12\nelem123\nelem1234\nelem12345\nelem123456\nelem1234567\nelem12345678\n" with-properties: Hash {
-    "_interpreter" => PMC 'ParrotInterpreter' { ... },
-    "_signature" => "Up",
-    "_sub" => sub { ... },
-    "_synchronous" => 1
-}
-OUT
-}
-
-=head1 AUTHOR
-
-Bernhard Schmalhofer - <Bernhard.Schmalhofer at gmx.de>
-
-=head1 SEE ALSO
-
-F<runtime/parrot/library/YAML/Parser/Syck.pir>
-
-=cut
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/t/native_pbc/annotations.pbc
==============================================================================
Binary file (source and/or target). No diff available.

Modified: branches/orderedhash_revamp/t/native_pbc/integer_1.pbc
==============================================================================
Binary file (source and/or target). No diff available.

Modified: branches/orderedhash_revamp/t/native_pbc/number_1.pbc
==============================================================================
Binary file (source and/or target). No diff available.

Modified: branches/orderedhash_revamp/t/native_pbc/number_2.pbc
==============================================================================
Binary file (source and/or target). No diff available.

Modified: branches/orderedhash_revamp/t/native_pbc/string_1.pbc
==============================================================================
Binary file (source and/or target). No diff available.

Added: branches/orderedhash_revamp/t/native_pbc/testdata/number.pasm
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/native_pbc/testdata/number.pasm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,89 @@
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+        set     N0, 1.0
+        set     N1, 4.0
+        set     N2, 16.0
+        set     N3, 64.0
+        set     N4, 256.0
+        set     N5, 1024.0
+        set     N6, 4096.0
+        set     N7, 16384.0
+        set     N8, 65536.0
+        set     N9, 262144.0
+        set     N10, 1048576.0
+        set     N11, 4194304.0
+        set     N12, 16777216.0
+        set     N13, 67108864.0
+        set     N14, 268435456.0
+        set     N15, 1073741824.0
+        set     N16, 4294967296.0
+        set     N17, 17179869184.0
+        set     N18, 68719476736.0
+        set     N19, 274877906944.0
+        set     N20, 1099511627776.0
+        set     N21, 4398046511104.0
+        set     N22, 17592186044416.0
+        set     N23, 70368744177664.0
+        set     N24, 281474976710656.0
+        set     N25, 1.12589990684262e+15
+
+        print   N0
+        print   "\n"
+        print   N1
+        print   "\n"
+        print   N2
+        print   "\n"
+        print   N3
+        print   "\n"
+        print   N4
+        print   "\n"
+        print   N5
+        print   "\n"
+        print   N6
+        print   "\n"
+        print   N7
+        print   "\n"
+        print   N8
+        print   "\n"
+        print   N9
+        print   "\n"
+        print   N10
+        print   "\n"
+        print   N11
+        print   "\n"
+        print   N12
+        print   "\n"
+        print   N13
+        print   "\n"
+        print   N14
+        print   "\n"
+        print   N15
+        print   "\n"
+        print   N16
+        print   "\n"
+        print   N17
+        print   "\n"
+        print   N18
+        print   "\n"
+        print   N19
+        print   "\n"
+        print   N20
+        print   "\n"
+        print   N21
+        print   "\n"
+        print   N22
+        print   "\n"
+        print   N23
+        print   "\n"
+        print   N24
+        print   "\n"
+        print   N25
+        print   "\n"
+        end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Added: branches/orderedhash_revamp/t/native_pbc/testdata/string.pasm
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/native_pbc/testdata/string.pasm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,19 @@
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+    set S1, "abc"
+    set S2, "EE"
+    bors S0, S1, S2
+    print S0
+    print "\n"
+    print S1
+    print "\n"
+    print S2
+    print "\n"
+    end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/t/oo/metamodel.t
==============================================================================
--- branches/orderedhash_revamp/t/oo/metamodel.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/oo/metamodel.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -92,6 +92,11 @@
 
 .end
 
+.sub fail
+    .param string desc
+    'ok'(0, desc)
+.end
+
 .namespace['Dog']
 
 .sub _accessor :method
@@ -109,13 +114,12 @@
 .sub init_pmc :vtable :method
     .param pmc init_args
   # Iterate over the constructor arguments, calling the accessor for each
-    .local pmc iter
-    iter = new 'Iterator', init_args
-    iter = 0
+    .local pmc it
+    it = iter init_args
   iter_loop:
-    unless iter goto iter_end
-    $S1 = shift iter
-    $P1 = iter[$S1]
+    unless it goto iter_end
+    $S1 = shift it
+    $P1 = it[$S1]
     self.$S1($P1)
     goto iter_loop
   iter_end:

Added: branches/orderedhash_revamp/t/oo/new-old.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/oo/new-old.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,58 @@
+#! perl
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+use strict;
+use warnings;
+use lib qw( . lib ../lib ../../lib );
+
+use Test::More;
+use Parrot::Test;
+
+=head1 NAME
+
+t/oo/new-old.t - old style tests for new
+
+=head1 SYNOPSIS
+
+    % prove t/oo/new-old.t
+
+=head1 DESCRIPTION
+
+Tests instantiation 
+
+=cut
+
+plan tests => 1;
+
+pir_output_is( <<'CODE', <<'OUT', "exception in new", todo => 'TT #1151' );
+.sub main :main
+    .local pmc type
+    newclass type, 'Parent'
+
+    .local pmc obj, exception
+    .local string message
+    message = 'no error'
+    push_eh handler
+        obj = new 'Parent'
+        print 'not '
+    pop_eh
+    goto finally
+
+  handler:
+    .get_results(exception)
+    pop_eh
+    message = exception
+
+  finally:
+    print "ok #"
+    say message
+.end
+
+.namespace ['Parent']
+.sub 'init' :vtable
+    die 'test exception from init vtable'
+.end
+CODE
+ok #test exception from init vtable
+OUT

Modified: branches/orderedhash_revamp/t/op/00ff-dos.t
==============================================================================
--- branches/orderedhash_revamp/t/op/00ff-dos.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/00ff-dos.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,13 +1,7 @@
-#!perl
-# Copyright (C) 2001-2005, Parrot Foundation.
+#!parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 2;
-
 =head1 NAME
 
 t/op/00ff-dos.t - DOS File Format
@@ -22,19 +16,34 @@
 
 =cut
 
-my $code = qq(print "ok\\n"\r\nend\r\n);
-pasm_output_is( $code, <<'OUT', "fileformat dos" );
-ok
-OUT
-
-$code = qq(print "ok\\n"\r\nend\r\n\cZ\r\n);
-pasm_output_is( $code, <<'OUT', "fileformat dos w ctrl-z" );
-ok
-OUT
+.sub main :main
+    .include 'test_more.pir'
+    plan(2)
+
+    test_fileformat_dos()
+    test_fileformat_dos_ctrl_z()
+
+.end
+
+.sub test_fileformat_dos
+    lives_ok( <<"CODE", 'fileformat dos')
+.sub main
+    $I0 = 42\r\n
+.end
+CODE
+.end
+
+.sub test_fileformat_dos_ctrl_z
+    lives_ok( <<"CODE", 'fileformat dos w ctrl-z')
+.sub main
+    $I0 = 42\r\n\cZ
+.end
+CODE
+.end
 
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 filetype=pir:

Modified: branches/orderedhash_revamp/t/op/00ff-unix.t
==============================================================================
--- branches/orderedhash_revamp/t/op/00ff-unix.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/00ff-unix.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,13 +1,7 @@
-#!perl
-# Copyright (C) 2001-2005, Parrot Foundation.
+#!parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 1;
-
 =head1 NAME
 
 t/op/00ff-unix.t - UNIX File format
@@ -22,16 +16,24 @@
 
 =cut
 
-pasm_output_is( <<'CODE', <<'OUT', "fileformat unix" );
-    print "ok\n"
-    end
+.sub main :main
+    .include 'test_more.pir'
+    plan(1)
+
+    test_fileformat_unix()
+.end
+
+.sub test_fileformat_unix
+    lives_ok( <<'CODE', 'fileformat unix' )
+.sub main
+    print "testing\n"
+.end
 CODE
-ok
-OUT
+.end
 
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 filetype=pir:

Modified: branches/orderedhash_revamp/t/op/01-parse_ops.t
==============================================================================
--- branches/orderedhash_revamp/t/op/01-parse_ops.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/01-parse_ops.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -34,7 +34,7 @@
     n   => q<N0>,
     nc  => q<13.013>,
     p   => q<P0>,
-    pc  => undef,                  ## RT #39992 figure out how to test this type
+    pc  => undef,                  ## TT #1158 figure out how to test this type
     s   => q<S0>,
     sc  => q<'foo'>,
 };

Modified: branches/orderedhash_revamp/t/op/64bit.t
==============================================================================
--- branches/orderedhash_revamp/t/op/64bit.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/64bit.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,14 +1,7 @@
-#!perl
-# Copyright (C) 2001-2005, Parrot Foundation.
+#!parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test;
-use Parrot::Config;
-
 =head1 NAME
 
 t/op/64bit.t - Testing integer ops on 64-bit platforms
@@ -24,45 +17,54 @@
 
 =cut
 
-## remember to change the number of tests :-)
-if ( $PConfig{intvalsize} == 8 ) {
-    plan tests => 1;
-}
-else {
-    plan skip_all => "64bit INTVAL platforms only";
-}
+.sub main :main
+    .include "iglobals.pasm"
+    .include 'test_more.pir'
+
+    # Check to see if this is 64 bit
+    .local pmc interp     # a handle to our interpreter object.
+    interp = getinterp
+    .local pmc config
+    config = interp[.IGLOBALS_CONFIG_HASH]
+    .local int intvalsize 
+    intvalsize = config['intvalsize']
+
+    plan(5)
+
+    if intvalsize == 8 goto is_64_bit
+       skip(5, "this is not a 64 bit platform")
+    goto end
 
-pasm_output_is( <<'CODE', <<'OUTPUT', "bitops64" );
+  is_64_bit:
+    bitops64()
+
+  end:
+.end
+
+
+.sub bitops64
         # check bitops for 8-byte ints
-        set I0, 0xffffffffffffffff
-        print I0 # -1
-        print "\n"
-        set I1, 0x00000000ffffffff
-        print I1 # 4294967295
-        print "\n"
-        set I0, I1
-        shl I0, I0, 32
-        print I0 # -4294967296
-        print "\n"
-        band I2, I0, I1
-        print I2 # 0
-        print "\n"
-        bor I2, I0, I1
-        print I2 # -1
-        print "\n"
-        end
-
-CODE
--1
-4294967295
--4294967296
-0
--1
-OUTPUT
+
+        set $I0, 0xffffffffffffffff
+        is( $I0, -1, 'bitops64' )
+    
+        set $I1, 0x00000000ffffffff
+        is( $I1, 4294967295, 'bitops64' )
+    
+        set $I0, $I1
+        shl $I0, $I0, 32
+        is( $I0, -4294967296, 'bitops64' )
+        
+        band $I2, $I0, $I1
+        is( $I2, 0, 'bitops64' )
+
+        bor $I2, $I0, $I1
+        is( $I2, -1, 'bitops64' )
+.end
 
 # Local Variables:
-#   mode: cperl
+#   mode: pir
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir:

Added: branches/orderedhash_revamp/t/op/annotate-old.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/op/annotate-old.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,50 @@
+#!perl
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+use strict;
+use warnings;
+use lib qw( . lib ../lib ../../lib );
+use Test::More;
+use Parrot::Test tests => 1;
+
+=head1 NAME
+
+t/op/annotate-old.t - Test .annotate directive
+
+=head1 SYNOPSIS
+
+    % prove t/op/annotate-old.t
+
+=head1 DESCRIPTION
+
+Test use cases of the annotate directive that currently can't
+be covered with pir based tests.
+
+=cut
+
+TODO: {
+    local $TODO = q|fails in fast and cgoto runcores - TT #1135|
+        if $ENV{TEST_PROG_ARGS} =~ /--runcore=(fast|cgoto)/;
+
+pir_error_output_like( <<CODE, <<OUTPUT, 'unhandled exception from loaded function');
+.sub main :main
+    # Not using test more, just a quick way to pick a function
+    .include 'test_more.pir'
+    .annotate 'file', 'foobar'
+    .annotate 'line', 42
+    # Call with too many positional arguments
+    ok(0,0,0,0,0)
+.end
+CODE
+/\(foobar:42\)/
+OUTPUT
+
+}
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/t/op/annotate.t
==============================================================================
--- branches/orderedhash_revamp/t/op/annotate.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/annotate.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -36,6 +36,7 @@
 
   failed:
     .local pmc exception
+    pop_eh
     .get_results (exception)
     $P0 = exception.'annotations'()
     isa_ok ($P0, 'Hash', 'annotations gives back hash')
@@ -58,6 +59,7 @@
 
   failed:
     .local pmc exception
+    pop_eh
     .get_results (exception)
 
     $P0 = exception.'annotations'('file')
@@ -106,6 +108,7 @@
 
   failed:
     .local pmc exception, bt, frame, ann
+    pop_eh
     .get_results (exception)
     bt = exception.'backtrace'()
     $I0 = elements bt
@@ -167,7 +170,7 @@
 .sub 'parrotinterpreter_annotations'
     .annotate 'file', 'answer.p6'
     .annotate 'line', 42
-    $P0 = new 'ParrotInterpreter'
+    $P0 = getinterp
 
     .annotate 'line', 43
     'test_callee'()
@@ -175,7 +178,7 @@
 
 .sub 'test_callee'
     .annotate 'line', 100
-    $P0 = new 'ParrotInterpreter'
+    $P0 = getinterp
     $P1 = $P0['annotations'; 1]
     $S0 = $P1['file']
     'is'($S0, 'answer.p6', 'annotations for caller sub returend with level 1')
@@ -186,7 +189,7 @@
 
 .sub 'test_outer' :outer('parrotinterpreter_annotations')
     .annotate 'line', 101
-    $P0 = new 'ParrotInterpreter'
+    $P0 = getinterp
     $P1 = $P0['outer'; 'annotations'; 1]
     $S0 = $P1['file']
     'is'($S0, 'answer.p6', 'annotations for outer sub returend with level 1')

Modified: branches/orderedhash_revamp/t/op/arithmetics.t
==============================================================================
--- branches/orderedhash_revamp/t/op/arithmetics.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/arithmetics.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,17 +1,7 @@
-#!perl
+#!parrot
 # Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-
-use Test::More;
-use Parrot::Test tests => 23;
-
-# test for GMP
-use Parrot::Config;
-
 =head1 NAME
 
 t/op/arithmetics.t - Arithmetic Ops
@@ -27,615 +17,550 @@
 
 =cut
 
+.sub main :main
+    .include 'test_more.pir'
+
+    plan(129)
+
+    take_the_negative_of_a_native_integer()
+    take_the_absolute_of_a_native_integer()
+    add_native_integer_to_native_integer()
+    subtract_native_integer_from_native_integer()
+    multiply_native_integer_with_native_integer()
+    divide_native_integer_by_native_integer()
+    negate_minus_zero_point_zero()
+    negate_a_native_number()
+    take_the_absolute_of_a_native_number()
+    ceil_of_a_native_number()
+    floor_of_a_native_number()
+    add_native_integer_to_native_number()
+    subtract_native_integer_from_native_number()
+    multiply_native_number_with_native_integer()
+    divide_native_number_by_native_integer()
+    add_native_number_to_native_number()
+    subtract_native_number_from_native_number()
+    multiply_native_number_with_native_number()
+    divide_native_number_by_native_number()
+    lcm_test()
+    gcd_test()
+    integer_overflow_with_pow()
+    # END_OF_TESTS
+
+.end
+
 #
 # Operations on a single INTVAL
 #
-pasm_output_is( <<'CODE', <<OUTPUT, "take the negative of a native integer" );
-        set I0, 0
-        neg I0
-        say I0
-        set I0, 1234567890
-        neg I0
-        say I0
-        set I0, -1234567890
-        neg I0
-        say I0
-        set I0, 0
-        set I1, 0
-        neg I1, I0
-        say I1
-        set I0, 1234567890
-        neg I1, I0
-        say I1
-        set I0, -1234567890
-        neg I1, I0
-        say I1
-        end
-CODE
-0
--1234567890
-1234567890
-0
--1234567890
-1234567890
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "take the absolute of a native integer" );
-        set I0, 0
-        abs I0
-        say I0
-        set I0, 1234567890
-        abs I0
-        say I0
-        set I0, -1234567890
-        abs I0
-        say I0
-        set I0, 0
-        set I1, 0
-        abs I1, I0
-        say I1
-        set I0, 1234567890
-        abs I1, I0
-        say I1
-        set I0, -1234567890
-        abs I1, I0
-        say I1
-        end
-CODE
-0
-1234567890
-1234567890
-0
-1234567890
-1234567890
-OUTPUT
+.sub take_the_negative_of_a_native_integer
+    set $I0, 0
+    neg $I0
+    is( $I0, "0", 'take_the_negative_of_a_native_integer' )
+
+    set $I0, 1234567890
+    neg $I0
+    is( $I0, "-1234567890", 'take_the_negative_of_a_native_integer' )
+
+    set $I0, -1234567890
+    neg $I0
+    is( $I0, "1234567890", 'take_the_negative_of_a_native_integer' )
+
+    set $I0, 0
+    set $I1, 0
+    neg $I1, $I0
+    is( $I1, "0", 'take_the_negative_of_a_native_integer' )
+
+    set $I0, 1234567890
+    neg $I1, $I0
+    is( $I1, "-1234567890", 'take_the_negative_of_a_native_integer' )
+
+    set $I0, -1234567890
+    neg $I1, $I0
+    is( $I1, "1234567890", 'take_the_negative_of_a_native_integer' )
+.end
+
+.sub take_the_absolute_of_a_native_integer
+    set $I0, 0
+    abs $I0
+    is( $I0, "0", 'take_the_absolute_of_a_native_integer' )
+
+    set $I0, 1234567890
+    abs $I0
+    is( $I0, "1234567890", 'take_the_absolute_of_a_native_integer' )
+
+    set $I0, -1234567890
+    abs $I0
+    is( $I0, "1234567890", 'take_the_absolute_of_a_native_integer' )
+
+    set $I0, 0
+    set $I1, 0
+    abs $I1, $I0
+    is( $I1, "0", 'take_the_absolute_of_a_native_integer' )
+
+    set $I0, 1234567890
+    abs $I1, $I0
+    is( $I1, "1234567890", 'take_the_absolute_of_a_native_integer' )
+
+    set $I0, -1234567890
+    abs $I1, $I0
+    is( $I1, "1234567890", 'take_the_absolute_of_a_native_integer' )
+.end
 
 #
 # first arg is INTVAL, second arg is INTVAL
 #
-pasm_output_is( <<'CODE', <<OUTPUT, "add native integer to native integer" );
-        set I0, 4000
-        set I1, -123
-        add I2, I0, I1
-        say I2
-        add I0, I0, I1
-        say I0
-        end
-CODE
-3877
-3877
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "subtract native integer from native integer" );
-        set I0, 4000
-        set I1, -123
-        sub I2, I0, I1
-        say I2
-        sub I0, I0, I1
-        say I0
-        end
-CODE
-4123
-4123
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "multiply native integer with native integer" );
-        set I0, 4000
-        set I1, -123
-        mul I2, I0, I1
-        say I2
-        mul I0, I0, I1
-        say I0
-        end
-CODE
--492000
--492000
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "divide native integer by native integer" );
-        set I0, 4000
-        set I1, -123
-        div I2, I0, I1
-        say I2
-        div I0, I0, I1
-        say I0
-        end
-CODE
--32
--32
-OUTPUT
+.sub add_native_integer_to_native_integer
+    set $I0, 4000
+    set $I1, -123
+    add $I2, $I0, $I1
+    is( $I2, "3877", 'add_native_integer_to_native_integer' )
 
-#
-# print -0.0 as -0
-#
+    add $I0, $I0, $I1
+    is( $I0, "3877", 'add_native_integer_to_native_integer' )
+.end
 
-pasm_output_is( <<'CODE', <<OUTPUT, 'negate -0.0' );
-        set N0, 0
-        neg N0
-        say N0
-        set N0, -0.0
-        neg N0
-        say N0
-        set N0, -0.0
-        neg N1, N0
-        say N1
-        set N0, 0
-        set N1, 1
-        neg N1, N0
-        say N1
-        end
-CODE
--0
-0
-0
--0
-OUTPUT
+.sub subtract_native_integer_from_native_integer
+    set $I0, 4000
+    set $I1, -123
+    sub $I2, $I0, $I1
+    is( $I2, "4123", 'subtract_native_integer_from_native_integer' )
 
+    sub $I0, $I0, $I1
+    is( $I0, "4123", 'subtract_native_integer_from_native_integer' )
+.end
+
+.sub multiply_native_integer_with_native_integer
+    set $I0, 4000
+    set $I1, -123
+    mul $I2, $I0, $I1
+    is( $I2, "-492000", 'multiply_native_integer_with_native_integer' )
+
+    mul $I0, $I0, $I1
+    is( $I0, "-492000", 'multiply_native_integer_with_native_integer' )
+.end
 
+.sub divide_native_integer_by_native_integer
+    set $I0, 4000
+    set $I1, -123
+    div $I2, $I0, $I1
+    is( $I2, "-32", 'divide_native_integer_by_native_integer' )
+
+    div $I0, $I0, $I1
+    is( $I0, "-32", 'divide_native_integer_by_native_integer' )
+.end
+
+#
+# print -0.0 as -0
+#
+.sub negate_minus_zero_point_zero
+    .include 'sysinfo.pasm'
+    $S9 = sysinfo .SYSINFO_PARROT_OS
+
+    set $N0, 0
+    neg $N0
+    $S0 = $N0
+    if $S9 == 'MSWin32' goto Todo_test1
+    is( $S0, "-0", '1' )
+    goto End_test1
+Todo_test1:
+    $I0 = $S0 == "-0"
+    todo($I0, 'Faulty on this platform')
+End_test1:
+
+    set $N0, -0.0
+    neg $N0
+    $S0 = $N0
+    is( $S0, "0", '2' )
+
+    set $N0, -0.0
+    neg $N1, $N0
+    $S0 = $N1
+    is( $S0, "0", '3' )
+
+    set $N0, 0
+    set $N1, 1
+    neg $N1, $N0
+    $S0 = $N1
+    if $S9 == 'MSWin32' goto Todo_test4
+    is( $S0, "-0", '4' )
+    goto End_test4
+Todo_test4:
+    $I0 = $S0 == "-0"
+    todo($I0, 'Faulty on this platform')
+End_test4:
+.end
 
 #
 # Operations on a single NUMVAL
 #
+.sub negate_a_native_number
+    set $N0, 123.4567890
+    neg $N0
+    is( $N0, "-123.456789", 'negate_a_native_number' )
+
+    set $N0, -123.4567890
+    neg $N0
+    is( $N0, "123.456789", 'negate_a_native_number' )
+
+    set $N0, 123.4567890
+    neg $N1, $N0
+    is( $N1, "-123.456789", 'negate_a_native_number' )
+
+    set $N0, -123.4567890
+    neg $N1, $N0
+    is( $N1, "123.456789", 'negate_a_native_number' )
+.end
+
+.sub take_the_absolute_of_a_native_number
+    set $N0, 0
+    abs $N0
+    is( $N0, "0", 'take_the_absolute_of_a_native_number' )
+
+    set $N0, -0.0
+    abs $N0
+    is( $N0, "0", 'take_the_absolute_of_a_native_number' )
+
+    set $N0, 123.45678901
+    abs $N0
+    is( $N0, "123.45678901", 'take_the_absolute_of_a_native_number' )
+
+    set $N0, -123.45678901
+    abs $N0
+    is( $N0, "123.45678901", 'take_the_absolute_of_a_native_number' )
+
+    set $N0, 0
+    set $N1, 1
+    abs $N1, $N0
+    is( $N1, "0", 'take_the_absolute_of_a_native_number' )
+
+    set $N0, 0.0
+    set $N1, 1
+    abs $N1, $N0
+    is( $N1, "0", 'take_the_absolute_of_a_native_number' )
+
+    set $N0, 123.45678901
+    set $N1, 1
+    abs $N1, $N0
+    is( $N1, "123.45678901", 'take_the_absolute_of_a_native_number' )
+
+    set $N0, -123.45678901
+    set $N1, 1
+    abs $N1, $N0
+    is( $N1, "123.45678901", 'take_the_absolute_of_a_native_number' )
+.end
+
+.sub ceil_of_a_native_number
+    set $N0, 0
+    ceil $N0
+    is( $N0, "0", 'ceil_of_a_native_number' )
+
+    set $N0, 123.45678901
+    ceil $N0
+    is( $N0, "124", 'ceil_of_a_native_number' )
+
+    set $N0, -123.45678901
+    ceil $N0
+    is( $N0, "-123", 'ceil_of_a_native_number' )
+
+    set $N0, 0
+    set $N1, 1
+    ceil $N1, $N0
+    is( $N1, "0", 'ceil_of_a_native_number' )
+
+    set $N0, 0.0
+    set $N1, 1
+    ceil $N1, $N0
+    is( $N1, "0", 'ceil_of_a_native_number' )
+
+    set $N0, 123.45678901
+    set $N1, 1
+    ceil $N1, $N0
+    is( $N1, "124", 'ceil_of_a_native_number' )
+
+    set $N0, -123.45678901
+    set $N1, 1
+    ceil $N1, $N0
+    is( $N1, "-123", 'ceil_of_a_native_number' )
+
+    set $N0, 0
+    set $I1, 1
+    ceil $I1, $N0
+    is( $I1, "0", 'ceil_of_a_native_number' )
+
+    set $N0, 0.0
+    set $I1, 1
+    ceil $I1, $N0
+    is( $I1, "0", 'ceil_of_a_native_number' )
+
+    set $N0, 123.45678901
+    set $I1, 1
+    ceil $I1, $N0
+    is( $I1, "124", 'ceil_of_a_native_number' )
+
+    set $N0, -123.45678901
+    set $I1, 1
+    ceil $I1, $N0
+    is( $I1, "-123", 'ceil_of_a_native_number' )
+.end
 
-pasm_output_is( <<'CODE', <<OUTPUT, 'negate a native number' );
-        set N0, 123.4567890
-        neg N0
-        say N0
-        set N0, -123.4567890
-        neg N0
-        say N0
-        set N0, 123.4567890
-        neg N1, N0
-        say N1
-        set N0, -123.4567890
-        neg N1, N0
-        say N1
-        end
-CODE
--123.456789
-123.456789
--123.456789
-123.456789
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "take the absolute of a native number" );
-        set N0, 0
-        abs N0
-        say N0
-        set N0, -0.0
-        abs N0
-        say N0
-        set N0, 123.45678901
-        abs N0
-        say N0
-        set N0, -123.45678901
-        abs N0
-        say N0
-        set N0, 0
-        set N1, 1
-        abs N1, N0
-        say N1
-        set N0, 0.0
-        set N1, 1
-        abs N1, N0
-        say N1
-        set N0, 123.45678901
-        set N1, 1
-        abs N1, N0
-        say N1
-        set N0, -123.45678901
-        set N1, 1
-        abs N1, N0
-        say N1
-        end
-CODE
-0
-0
-123.45678901
-123.45678901
-0
-0
-123.45678901
-123.45678901
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "ceil of a native number" );
-       set N0, 0
-       ceil N0
-       say N0
-       set N0, 123.45678901
-       ceil N0
-       say N0
-       set N0, -123.45678901
-       ceil N0
-       say N0
-       set N0, 0
-       set N1, 1
-       ceil N1, N0
-       say N1
-       set N0, 0.0
-       set N1, 1
-       ceil N1, N0
-       say N1
-       set N0, 123.45678901
-       set N1, 1
-       ceil N1, N0
-       say N1
-       set N0, -123.45678901
-       set N1, 1
-       ceil N1, N0
-       say N1
-       set N0, 0
-       set I1, 1
-       ceil I1, N0
-       say I1
-       set N0, 0.0
-       set I1, 1
-       ceil I1, N0
-       say I1
-       set N0, 123.45678901
-       set I1, 1
-       ceil I1, N0
-       say I1
-       set N0, -123.45678901
-       set I1, 1
-       ceil I1, N0
-       say I1
-       end
-CODE
-0
-124
--123
-0
-0
-124
--123
-0
-0
-124
--123
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "floor of a native number" );
-       set N0, 0
-       floor N0
-       say N0
-       set N0, 123.45678901
-       floor N0
-       say N0
-       set N0, -123.45678901
-       floor N0
-       say N0
-       set N0, 0
-       set N1, 1
-       floor N1, N0
-       say N1
-       set N0, 0.0
-       set N1, 1
-       floor N1, N0
-       say N1
-       set N0, 123.45678901
-       set N1, 1
-       floor N1, N0
-       say N1
-       set N0, -123.45678901
-       set N1, 1
-       floor N1, N0
-       say N1
-       set N0, 0
-       set I1, 1
-       floor I1, N0
-       say I1
-       set N0, 0.0
-       set I1, 1
-       floor I1, N0
-       say I1
-       set N0, 123.45678901
-       set I1, 1
-       floor I1, N0
-       say I1
-       set N0, -123.45678901
-       set I1, 1
-       floor I1, N0
-       say I1
-       end
-CODE
-0
-123
--124
-0
-0
-123
--124
-0
-0
-123
--124
-OUTPUT
+.sub floor_of_a_native_number
+    set $N0, 0
+    floor $N0
+    is( $N0, "0", 'floor_of_a_native_number' )
+
+    set $N0, 123.45678901
+    floor $N0
+    is( $N0, "123", 'floor_of_a_native_number' )
+
+    set $N0, -123.45678901
+    floor $N0
+    is( $N0, "-124", 'floor_of_a_native_number' )
+
+    set $N0, 0
+    set $N1, 1
+    floor $N1, $N0
+    is( $N1, "0", 'floor_of_a_native_number' )
+
+    set $N0, 0.0
+    set $N1, 1
+    floor $N1, $N0
+    is( $N1, "0", 'floor_of_a_native_number' )
+
+    set $N0, 123.45678901
+    set $N1, 1
+    floor $N1, $N0
+    is( $N1, "123", 'floor_of_a_native_number' )
+
+    set $N0, -123.45678901
+    set $N1, 1
+    floor $N1, $N0
+    is( $N1, "-124", 'floor_of_a_native_number' )
+
+    set $N0, 0
+    set $I1, 1
+    floor $I1, $N0
+    is( $I1, "0", 'floor_of_a_native_number' )
+
+    set $N0, 0.0
+    set $I1, 1
+    floor $I1, $N0
+    is( $I1, "0", 'floor_of_a_native_number' )
+
+    set $N0, 123.45678901
+    set $I1, 1
+    floor $I1, $N0
+    is( $I1, "123", 'floor_of_a_native_number' )
+
+    set $N0, -123.45678901
+    set $I1, 1
+    floor $I1, $N0
+    is( $I1, "-124", 'floor_of_a_native_number' )
+
+.end
 
 #
 # FLOATVAL and INTVAL tests
 #
-pasm_output_is( <<'CODE', <<OUTPUT, "add native integer to native number" );
-        set I0, 4000
-        set N0, -123.123
-        add N1, N0, I0
-        say N1
-        add N0, N0, I0
-        say N0
-        add N0, I0
-        say N0
-        end
-CODE
-3876.877
-3876.877
-7876.877
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "subtract native integer from native number" );
-        set I0, 4000
-        set N0, -123.123
-        sub N1, N0, I0
-        say N1
-        sub N0, N0, I0
-        say N0
-        sub N0, I0
-        say N0
-        end
-CODE
--4123.123
--4123.123
--8123.123
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "multiply native number with native integer" );
-        set I0, 4000
-        set N0, -123.123
-        mul N1, N0, I0
-        say N1
-        mul N0, N0, I0
-        say N0
-        mul N0, -2
-        say N0
-        end
-CODE
--492492
--492492
-984984
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "divide native number by native integer" );
-        set I0, 4000
-        set N0, -123.123
-        div N1, N0, I0
-        say N1
-        div N0, N0, I0
-        say N0
-        div N0, 1
-        say N0
-        set N0, 100.000
-        div N0, 100
-        say N0
-        div N0, 0.01
-        say N0
-        end
-CODE
--0.03078075
--0.03078075
--0.03078075
-1
-100
-OUTPUT
+.sub add_native_integer_to_native_number
+    set $I0, 4000
+    set $N0, -123.123
+    add $N1, $N0, $I0
+    is( $N1, "3876.877", 'add_native_integer_to_native_number' )
+
+    add $N0, $N0, $I0
+    is( $N0, "3876.877", 'add_native_integer_to_native_number' )
+
+    add $N0, $I0
+    is( $N0, "7876.877", 'add_native_integer_to_native_number' )
+
+.end
+
+.sub subtract_native_integer_from_native_number
+    set $I0, 4000
+    set $N0, -123.123
+    sub $N1, $N0, $I0
+    is( $N1, "-4123.123", 'subtract_native_integer_from_native_number' )
+
+    sub $N0, $N0, $I0
+    is( $N0, "-4123.123", 'subtract_native_integer_from_native_number' )
+
+    sub $N0, $I0
+    is( $N0, "-8123.123", 'subtract_native_integer_from_native_number' )
+
+.end
+
+.sub multiply_native_number_with_native_integer
+    set $I0, 4000
+    set $N0, -123.123
+    mul $N1, $N0, $I0
+    is( $N1, "-492492", 'multiply_native_number_with_native_integer' )
+
+    mul $N0, $N0, $I0
+    is( $N0, "-492492", 'multiply_native_number_with_native_integer' )
+
+    mul $N0, -2
+    is( $N0, "984984", 'multiply_native_number_with_native_integer' )
+.end
+
+.sub divide_native_number_by_native_integer
+    set $I0, 4000
+    set $N0, -123.123
+    div $N1, $N0, $I0
+    is( $N1, "-0.03078075", 'divide_native_number_by_native_integer' )
+
+    div $N0, $N0, $I0
+    is( $N0, "-0.03078075", 'divide_native_number_by_native_integer' )
+
+    div $N0, 1
+    is( $N0, "-0.03078075", 'divide_native_number_by_native_integer' )
+
+    set $N0, 100.000
+    div $N0, 100
+    is( $N0, "1", 'divide_native_number_by_native_integer' )
+
+    div $N0, 0.01
+    is( $N0, "100", 'divide_native_number_by_native_integer' )
+.end
 
 #
 # FLOATVAL and FLOATVAL tests
 #
-pasm_output_is( <<'CODE', <<OUTPUT, "add native number to native number" );
-        set N2, 4000.246
-        set N0, -123.123
-        add N1, N0, N2
-        say N1
-        add N0, N0, N2
-        say N0
-        end
-CODE
-3877.123
-3877.123
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "subtract native number from native number" );
-        set N2, 4000.246
-        set N0, -123.123
-        sub N1, N0, N2
-        say N1
-        sub N0, N0, N2
-        say N0
-        end
-CODE
--4123.369
--4123.369
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "multiply native number with native number" );
-        set N2, 4000.246
-        set N0, -123.123
-        mul N1, N0, N2
-        say N1
-        mul N0, N0, N2
-        say N0
-        end
-CODE
--492522.288258
--492522.288258
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "divide native number by native number" );
-        set N2, 4000.246
-        set N0, -123.123
-        div N1, N0, N2
-        say N1
-        div N0, N0, N2
-        say N0
-        end
-CODE
--0.0307788571002883
--0.0307788571002883
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "lcm_I_I_I" );
-        set I0, 10
-        set I1, 10
-        lcm I2, I1, I0
-        eq I2, 10, OK1
-        print "not "
-OK1:    say "ok 1"
-
-        set I1, 17
-        lcm I2, I1, I0
-        eq I2, 170, OK2
-        print I2
-        print "not "
-OK2:    print "ok 2\n"
-
-        set I0, 17
-        set I1, 10
-        lcm I2, I1, I0
-        eq I2, 170, OK3
-        print "not "
-OK3:    print "ok 3\n"
-
-        set I0, 10
-        set I1, 0
-        lcm I2, I1, I0
-        eq I2, 0, OK4
-        print "not "
-OK4:    print "ok 4\n"
-
-        set I0, 0
-        set I1, 10
-        lcm I2, I1, I0
-        eq I2, 0, OK5
-        print "not "
-OK5:    print "ok 5\n"
-
-        end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-ok 5
-OUTPUT
-
-SKIP: {
-    skip( 'No integer overflow for 32-bit INTVALs without GMP installed', 1 )
-        if $PConfig{intvalsize} == 4 && !$PConfig{gmp};
+.sub add_native_number_to_native_number
+    set $N2, 4000.246
+    set $N0, -123.123
+    add $N1, $N0, $N2
+    is( $N1, "3877.123", 'add_native_number_to_native_number' )
+
+    add $N0, $N0, $N2
+    is( $N0, "3877.123", 'add_native_number_to_native_number' )
+.end
+
+.sub subtract_native_number_from_native_number
+    set $N2, 4000.246
+    set $N0, -123.123
+    sub $N1, $N0, $N2
+    is( $N1, "-4123.369", 'subtract_native_number_from_native_number' )
+
+    sub $N0, $N0, $N2
+    is( $N0, "-4123.369", 'subtract_native_number_from_native_number' )
+
+.end
+
+.sub multiply_native_number_with_native_number
+    set $N2, 4000.246
+    set $N0, -123.123
+    mul $N1, $N0, $N2
+    is( $N1, "-492522.288258", 'multiply_native_number_with_native_number' )
+
+    mul $N0, $N0, $N2
+    is( $N0, "-492522.288258", 'multiply_native_number_with_native_number' )
+
+.end
+
+.sub divide_native_number_by_native_number
+    set $N2, 4000.246
+    set $N0, -123.123
+    div $N1, $N0, $N2
+    is( $N1, "-0.0307788571002883", 'divide_native_number_by_native_number' )
+
+    div $N0, $N0, $N2
+    is( $N0, "-0.0307788571002883", 'divide_native_number_by_native_number' )
+
+.end
+
+.sub lcm_test
+    set $I0, 10
+    set $I1, 10
+    lcm $I2, $I1, $I0
+    is( $I2, 10, 'lcm_test' )
+
+    set $I1, 17
+    lcm $I2, $I1, $I0
+    is( $I2, 170, 'lcm_test' )
+
+    set $I0, 17
+    set $I1, 10
+    lcm $I2, $I1, $I0
+    is( $I2, 170, 'lcm_test' )
+
+    set $I0, 10
+    set $I1, 0
+    lcm $I2, $I1, $I0
+    is( $I2, 0, 'lcm_test' )
+
+    set $I0, 0
+    set $I1, 10
+    lcm $I2, $I1, $I0
+    is( $I2, 0, 'lcm_test' )
+.end
+
+.sub gcd_test
+    set $I0, 70
+    set $I1, 42
+    gcd $I2, $I1, $I0
+    is( $I2, 14, 'gcd_test' )
+
+    set $I0, 66
+    gcd $I2, $I1, $I0
+    is( $I2, 6, 'gcd_test' )
+
+    set $I0, 70
+    set $I1, 1
+    gcd $I2, $I1, $I0
+    is( $I2, 1, 'gcd_test' )
+
+    set $I0, 70
+    set $I1, 3
+    gcd $I2, $I1, $I0
+    is( $I2, 1, 'gcd_test' )
+.end
+
+.sub integer_overflow_with_pow
+    .include "iglobals.pasm"
+
+    # Check that we aren't 32-bit INTVALs without GMP
+    .local pmc interp     # a handle to our interpreter object.
+    interp = getinterp
+    .local pmc config
+    config = interp[.IGLOBALS_CONFIG_HASH]
+    .local int intvalsize
+    intvalsize = config['intvalsize']
+    .local int gmp
+    gmp = config['gmp']
+
+    if intvalsize != 4 goto can_test
+    if gmp goto can_test
+        skip(40,'No integer overflow for 32-bit INTVALs without GMP installed')
+        goto end
+
+  can_test:
 
-    pir_output_is( <<'CODE', <<OUTPUT, "integer overflow with 'pow'" );
-.sub main
     .local pmc i1, i2, r
     i1 = new 'Integer'
     i2 = new 'Integer'
     i1 = 2
     i2 = 1
-next:
+    $I1 = 1
+  next:
     null r
     r = pow i1, i2
     $S0 = r
-    say $S0
+
+    $I1 = $I1 * 2
+    is( $S0, $I1, 'integer_overflow_with_pow' )
+
     inc i2
 # XXX: this must be extended to at least 64 bit range
 # when sure that the result is not floating point.
 # In the meantime, make sure it overflows nicely
 # on 32 bit.
     unless i2 > 40 goto next
+
+  end:
 .end
-CODE
-2
-4
-8
-16
-32
-64
-128
-256
-512
-1024
-2048
-4096
-8192
-16384
-32768
-65536
-131072
-262144
-524288
-1048576
-2097152
-4194304
-8388608
-16777216
-33554432
-67108864
-134217728
-268435456
-536870912
-1073741824
-2147483648
-4294967296
-8589934592
-17179869184
-34359738368
-68719476736
-137438953472
-274877906944
-549755813888
-1099511627776
-OUTPUT
-}
-
-pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - basic arith" );
-.sub 'test' :main
-    $N0 = 'Inf'
-    say $N0
-    $N0 -= $N0
-    say $N0
-.end
-CODE
-Inf
-NaN
-OUTPUT
-
-pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - rounding" );
-.sub 'test' :main
-    $N0 = 'NaN'
-    $N1 = floor $N0
-    say $N1
-    $N2 = ceil $N0
-    say $N2
-    $N0 = 'Inf'
-    $N1 = floor $N0
-    say $N1
-    $N2 = ceil $N0
-    say $N2
-    $N0 = '-Inf'
-    $N1 = floor $N0
-    say $N1
-    $N2 = ceil $N0
-    say $N2
-.end
-CODE
-NaN
-NaN
-Inf
-Inf
--Inf
--Inf
-OUTPUT
 
 # Local Variables:
-#   mode: cperl
+#   mode: pir
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir :

Modified: branches/orderedhash_revamp/t/op/arithmetics_pmc.t
==============================================================================
--- branches/orderedhash_revamp/t/op/arithmetics_pmc.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/arithmetics_pmc.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,17 +1,7 @@
-#!perl
+#!parrot
 # Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-
-use Test::More;
-use Parrot::Test;
-
-# test for GMP
-use Parrot::Config;
-
 =head1 NAME
 
 t/op/arithmetics_pmc.t - Arithmetic Ops involving PMCs
@@ -26,84 +16,568 @@
 
 =cut
 
-# We don't check BigInt and BigNum ops
-if ( $PConfig{gmp} ) {
-    plan tests => 68;
-}
-else {
-    plan tests => 34;
-}
-
-
-# Map vtable method to op
-my %methods = qw{
-    add             add
-    subtract        sub
-    multiply        mul
-    divide          div
-
-    floor_divide    fdiv
-    modulus         mod
-    pow             pow
-
-    bitwise_or      bor
-    bitwise_and     band
-    bitwise_xor     bxor
-
-    bitwise_shr     shr
-    bitwise_shl     shl
-    bitwise_lsr     lsr
-
-    concatenate     concat
-
-    logical_or      or
-    logical_and     and
-    logical_xor     xor
-};
-
-# XXX Put BigInt and BigNum here
-my @pmcs = qw{
-    Integer Float
-};
-
-if ($PConfig{gmp}) {
-    push @pmcs, qw{ BigInt BigNum};
-}
-
-foreach my $pmc (@pmcs) {
-    while(my($vtable, $op) = each(%methods)) {
-
-# We should generate more tests for all possible combinations
-pir_output_is( <<"CODE", <<OUTPUT, "Original dest is untouched in $pmc.$vtable " );
-.sub 'test' :main
-    \$P0 = new '$pmc'
-    \$P0 = 40
-    \$P1 = new '$pmc'
-    \$P1 = 2
-    \$P2 = new '$pmc'
-    \$P2 = 115200
-
-    \$P99 = \$P2
-    # ignore exceptions
-    push_eh done
-    $op \$P2, \$P0, \$P1
-
-    \$I0 = cmp \$P99, 115200
-    unless \$I0 goto done
-    print " not "
-  done:
-    say "ok"
-.end
-CODE
-ok
-OUTPUT
+.sub main :main
+    .include 'test_more.pir'
+    .include "iglobals.pasm"
+
+    plan(68)
+
+    # Don't check BigInt or BigNum without gmp
+    .local pmc interp     # a handle to our interpreter object.
+    interp = getinterp
+    .local pmc config
+    config = interp[.IGLOBALS_CONFIG_HASH]
+    .local string gmp
+    gmp = config['gmp']
+
+    run_tests_for('Integer')
+    run_tests_for('Float')
+
+    if gmp goto do_big_ones
+        skip( 34, "will not test BigInt or BigNum without gmp" )
+        goto end   
+
+  do_big_ones:
+    run_tests_for('BigInt')
+    run_tests_for('BigNum')
+
+  end:
+.end
+
+.sub run_tests_for
+    .param pmc type
+    test_add(type)
+    test_divide(type)
+    test_multiply(type)
+    test_floor_divide(type)
+    test_logical_and(type)
+    test_concatenate(type)
+    test_logical_xor(type)
+    test_logical_or(type)
+    test_bitwise_shr(type)
+    test_bitwise_or(type)
+    test_bitwise_shl(type)
+    test_bitwise_xor(type)
+    test_modulus(type)
+    test_pow(type)
+    test_subtract(type)
+    test_bitwise_lsr(type)
+    test_bitwise_and(type)
+.end
+
+.sub test_add
+    .param pmc type
+
+    $P0 = new type
+    $P0 = 40
+    $P1 = new type
+    $P1 = 2
+    $P2 = new type
+    $P2 = 115200
+
+    $P99 = $P2
+
+    $S0 = "original dest is untouched in add for "
+    $S1 = type
+    concat $S0, $S1
+
+    # ignore exceptions
+    push_eh done
+    add $P2, $P0, $P1
+
+    $I0 = cmp $P99, 115200
+    
+    is( $I0, 0, $S0 )
+    goto end
+
+  done:
+    ok(1, 'ignoring exceptions')
+  end:
+.end
+
+.sub test_divide
+    .param pmc type
+
+    $P0 = new type
+    $P0 = 40
+    $P1 = new type
+    $P1 = 2
+    $P2 = new type
+    $P2 = 115200
+
+    $P99 = $P2
+
+    $S0 = "original dest is untouched in divide for "
+    $S1 = type
+    concat $S0, $S1
+
+    # ignore exceptions
+    push_eh done
+    div $P2, $P0, $P1
+
+    $I0 = cmp $P99, 115200
+    
+    is( $I0, 0, $S0 )
+    goto end
+
+  done:
+    ok(1, 'ignoring exceptions')
+  end:
+.end
+
+.sub test_multiply
+    .param pmc type
+
+    $P0 = new type
+    $P0 = 40
+    $P1 = new type
+    $P1 = 2
+    $P2 = new type
+    $P2 = 115200
+
+    $P99 = $P2
+
+    $S0 = "original dest is untouched in multiply for "
+    $S1 = type
+    concat $S0, $S1
+
+    # ignore exceptions
+    push_eh done
+    mul $P2, $P0, $P1
+
+    $I0 = cmp $P99, 115200
+    
+    is( $I0, 0, $S0 )
+    goto end
+
+  done:
+    ok(1, 'ignoring exceptions')
+  end:
+.end
+
+.sub test_floor_divide
+    .param pmc type
+
+    $P0 = new type
+    $P0 = 40
+    $P1 = new type
+    $P1 = 2
+    $P2 = new type
+    $P2 = 115200
+
+    $P99 = $P2
+
+    $S0 = "original dest is untouched in floor_divide for "
+    $S1 = type
+    concat $S0, $S1
+
+    # ignore exceptions
+    push_eh done
+    fdiv $P2, $P0, $P1
+
+    $I0 = cmp $P99, 115200
+    
+    is( $I0, 0, $S0 )
+    goto end
+
+  done:
+    ok(1, 'ignoring exceptions')
+  end:
+.end
+
+.sub test_logical_and
+    .param pmc type
+
+    $P0 = new type
+    $P0 = 40
+    $P1 = new type
+    $P1 = 2
+    $P2 = new type
+    $P2 = 115200
+
+    $P99 = $P2
+
+    $S0 = "original dest is untouched in logical_and for "
+    $S1 = type
+    concat $S0, $S1
+
+    # ignore exceptions
+    push_eh done
+    and $P2, $P0, $P1
+
+    $I0 = cmp $P99, 115200
+    
+    is( $I0, 0, $S0 )
+    goto end
+
+  done:
+    ok(1, 'ignoring exceptions')
+  end:
+.end
+
+.sub test_concatenate
+    .param pmc type
+
+    $P0 = new type
+    $P0 = 40
+    $P1 = new type
+    $P1 = 2
+    $P2 = new type
+    $P2 = 115200
+
+    $P99 = $P2
+
+    $S0 = "original dest is untouched in concatenate for "
+    $S1 = type
+    concat $S0, $S1
+
+    # ignore exceptions
+    push_eh done
+    concat $P2, $P0, $P1
+
+    $I0 = cmp $P99, 115200
+    
+    is( $I0, 0, $S0 )
+    goto end
+
+  done:
+    ok(1, 'ignoring exceptions')
+  end:
+.end
+
+.sub test_logical_xor
+    .param pmc type
+
+    $P0 = new type
+    $P0 = 40
+    $P1 = new type
+    $P1 = 2
+    $P2 = new type
+    $P2 = 115200
+
+    $P99 = $P2
+
+    $S0 = "original dest is untouched in logical_xor for "
+    $S1 = type
+    concat $S0, $S1
+
+    # ignore exceptions
+    push_eh done
+    xor $P2, $P0, $P1
+
+    $I0 = cmp $P99, 115200
+    
+    is( $I0, 0, $S0 )
+    goto end
+
+  done:
+    ok(1, 'ignoring exceptions')
+  end:
+.end
+
+.sub test_logical_or
+    .param pmc type
+
+    $P0 = new type
+    $P0 = 40
+    $P1 = new type
+    $P1 = 2
+    $P2 = new type
+    $P2 = 115200
+
+    $P99 = $P2
+
+    $S0 = "original dest is untouched in logical_or for "
+    $S1 = type
+    concat $S0, $S1
+
+    # ignore exceptions
+    push_eh done
+    or $P2, $P0, $P1
+
+    $I0 = cmp $P99, 115200
+    
+    is( $I0, 0, $S0 )
+    goto end
+
+  done:
+    ok(1, 'ignoring exceptions')
+  end:
+.end
+
+.sub test_bitwise_shr
+    .param pmc type
 
-    }
-}
+    $P0 = new type
+    $P0 = 40
+    $P1 = new type
+    $P1 = 2
+    $P2 = new type
+    $P2 = 115200
+
+    $P99 = $P2
+
+    $S0 = "original dest is untouched in bitwise_shr for "
+    $S1 = type
+    concat $S0, $S1
+
+    # ignore exceptions
+    push_eh done
+    shr $P2, $P0, $P1
+
+    $I0 = cmp $P99, 115200
+    
+    is( $I0, 0, $S0 )
+    goto end
+
+  done:
+    ok(1, 'ignoring exceptions')
+  end:
+.end
+
+.sub test_bitwise_or
+    .param pmc type
+
+    $P0 = new type
+    $P0 = 40
+    $P1 = new type
+    $P1 = 2
+    $P2 = new type
+    $P2 = 115200
+
+    $P99 = $P2
+
+    $S0 = "original dest is untouched in bitwise_or for "
+    $S1 = type
+    concat $S0, $S1
+
+    # ignore exceptions
+    push_eh done
+    bor $P2, $P0, $P1
+
+    $I0 = cmp $P99, 115200
+    
+    is( $I0, 0, $S0 )
+    goto end
+
+  done:
+    ok(1, 'ignoring exceptions')
+  end:
+.end
+
+.sub test_bitwise_shl
+    .param pmc type
+
+    $P0 = new type
+    $P0 = 40
+    $P1 = new type
+    $P1 = 2
+    $P2 = new type
+    $P2 = 115200
+
+    $P99 = $P2
+
+    $S0 = "original dest is untouched in bitwise_shl for "
+    $S1 = type
+    concat $S0, $S1
+
+    # ignore exceptions
+    push_eh done
+    shl $P2, $P0, $P1
+
+    $I0 = cmp $P99, 115200
+    
+    is( $I0, 0, $S0 )
+    goto end
+
+  done:
+    ok(1, 'ignoring exceptions')
+  end:
+.end
+
+.sub test_bitwise_xor
+    .param pmc type
+
+    $P0 = new type
+    $P0 = 40
+    $P1 = new type
+    $P1 = 2
+    $P2 = new type
+    $P2 = 115200
+
+    $P99 = $P2
+
+    $S0 = "original dest is untouched in bitwise_xor for "
+    $S1 = type
+    concat $S0, $S1
+
+    # ignore exceptions
+    push_eh done
+    bxor $P2, $P0, $P1
+
+    $I0 = cmp $P99, 115200
+    
+    is( $I0, 0, $S0 )
+    goto end
+
+  done:
+    ok(1, 'ignoring exceptions')
+  end:
+.end
+
+.sub test_modulus
+    .param pmc type
+
+    $P0 = new type
+    $P0 = 40
+    $P1 = new type
+    $P1 = 2
+    $P2 = new type
+    $P2 = 115200
+
+    $P99 = $P2
+
+    $S0 = "original dest is untouched in modulus for "
+    $S1 = type
+    concat $S0, $S1
+
+    # ignore exceptions
+    push_eh done
+    mod $P2, $P0, $P1
+
+    $I0 = cmp $P99, 115200
+    
+    is( $I0, 0, $S0 )
+    goto end
+
+  done:
+    ok(1, 'ignoring exceptions')
+  end:
+.end
+
+.sub test_pow
+    .param pmc type
+
+    $P0 = new type
+    $P0 = 40
+    $P1 = new type
+    $P1 = 2
+    $P2 = new type
+    $P2 = 115200
+
+    $P99 = $P2
+
+    $S0 = "original dest is untouched in pow for "
+    $S1 = type
+    concat $S0, $S1
+
+    # ignore exceptions
+    push_eh done
+    pow $P2, $P0, $P1
+
+    $I0 = cmp $P99, 115200
+    
+    is( $I0, 0, $S0 )
+    goto end
+
+  done:
+    ok(1, 'ignoring exceptions')
+  end:
+.end
+
+.sub test_subtract
+    .param pmc type
+
+    $P0 = new type
+    $P0 = 40
+    $P1 = new type
+    $P1 = 2
+    $P2 = new type
+    $P2 = 115200
+
+    $P99 = $P2
+
+    $S0 = "original dest is untouched in subtract for "
+    $S1 = type
+    concat $S0, $S1
+
+    # ignore exceptions
+    push_eh done
+    sub $P2, $P0, $P1
+
+    $I0 = cmp $P99, 115200
+    
+    is( $I0, 0, $S0 )
+    goto end
+
+  done:
+    ok(1, 'ignoring exceptions')
+  end:
+.end
+
+.sub test_bitwise_lsr
+    .param pmc type
+
+    $P0 = new type
+    $P0 = 40
+    $P1 = new type
+    $P1 = 2
+    $P2 = new type
+    $P2 = 115200
+
+    $P99 = $P2
+
+    $S0 = "original dest is untouched in bitwise_lsr for "
+    $S1 = type
+    concat $S0, $S1
+
+    # ignore exceptions
+    push_eh done
+    lsr $P2, $P0, $P1
+
+    $I0 = cmp $P99, 115200
+    
+    is( $I0, 0, $S0 )
+    goto end
+
+  done:
+    ok(1, 'ignoring exceptions')
+  end:
+.end
+
+.sub test_bitwise_and
+    .param pmc type
+
+    $P0 = new type
+    $P0 = 40
+    $P1 = new type
+    $P1 = 2
+    $P2 = new type
+    $P2 = 115200
+
+    $P99 = $P2
+
+    $S0 = "original dest is untouched in bitwise_and for "
+    $S1 = type
+    concat $S0, $S1
+
+    # ignore exceptions
+    push_eh done
+    band $P2, $P0, $P1
+
+    $I0 = cmp $P99, 115200
+    
+    is( $I0, 0, $S0 )
+    goto end
+
+  done:
+    ok(1, 'ignoring exceptions')
+  end:
+.end
 
 # Local Variables:
-#   mode: cperl
+#   mode: pir
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir :

Modified: branches/orderedhash_revamp/t/op/basic.t
==============================================================================
--- branches/orderedhash_revamp/t/op/basic.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/basic.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -6,7 +6,7 @@
 use warnings;
 use lib qw( . lib ../lib ../../lib );
 use Test::More;
-use Parrot::Test tests => 24;
+use Parrot::Test tests => 23;
 
 =head1 NAME
 
@@ -97,22 +97,6 @@
         end
 CODE
 
-pasm_output_is( <<'CODE', <<'OUTPUT', "bsr_i" );
-        print   "start\n"
-
-        bsr     LAB1
-
-        print   "done\n"
-        end
-
-LAB1:   print   "lab 1\n"
-        ret
-CODE
-start
-lab 1
-done
-OUTPUT
-
 pasm_output_is( <<'CODE', <<'OUTPUT', "local_branch_c_i" );
         print    "start\n"
 

Modified: branches/orderedhash_revamp/t/op/bitwise.t
==============================================================================
--- branches/orderedhash_revamp/t/op/bitwise.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/bitwise.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,14 +1,7 @@
-#!perl
-# Copyright (C) 2001-2005, Parrot Foundation.
+#!parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 27;
-use Parrot::Config;
-
 =head1 NAME
 
 t/op/bitwise.t - Bitwise Ops
@@ -23,500 +16,383 @@
 
 =cut
 
-pasm_output_is( <<'CODE', <<'OUTPUT', "shr_i_i_i (>>)" );
-        set I0, 0b001100
-        set I1, 0b010100
-        set I2, 1
-        set I3, 2
-        shr I4, I0, I2
-        shr I2, I0, I2
-        shr I1, I1, I3
-        print I4
-        print "\n"
-        print I2
-        print "\n"
-        print I1
-        print "\n"
-        print I0
-        print "\n"
-        end
-CODE
-6
-6
-5
-12
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "shr_i_i (>>)" );
-        set I0, 0b001100
-        set I1, 0b010100
-        set I2, 1
-        set I3, 2
-        shr I0, I2
-        shr I1, I3
-        print I0
-        print "\n"
-        print I1
-        print "\n"
-        end
-CODE
-6
-5
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "shr_i_i_ic (>>)" );
-        set     I0, 0b001100
-        set     I1, 0b010100
-        shr     I2, I0, 1
-        shr     I1, I1, 2
-        print   I2
-        print   "\n"
-        print   I1
-        print   "\n"
-        print   I0
-        print   "\n"
-        end
-CODE
-6
-5
-12
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "shr_i_ic_i (>>)" );
-        set I0, 1
-        set I1, 2
-        shr I2, 0b001100, I0
-        shr I1, 0b010100, I1
-        print I2
-        print "\n"
-        print I1
-        print "\n"
-        end
-CODE
-6
-5
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "shr_i_ic_ic (>>)" );
-        shr I2, 0b001100, 1
-        shr I1, 0b010100, 2
-        print I2
-        print "\n"
-        print I1
-        print "\n"
-        end
-CODE
-6
-5
-OUTPUT
+.sub main :main
+    .include 'test_more.pir'
+
+    plan(68)
+
+    test_shr_i_i_i_shift_rt_()
+    test_shr_i_i_shift_rt_()
+    test_shr_i_i_ic_shift_rt_()
+    test_shr_i_ic_i_shift_rt_()
+    test_shr_i_ic_ic_shift_rt_()
+    test_lsr_i_ic_ic_shift_rt_()
+    test_lsr_i_ic_shift_rt()
+    test_lsr_i_i_i_shift_rt()
+    test_lsr_i_i_ic_shift_rt()
+    test_shr_i_i_ic_shift_rt_negative()
+    test_shl_i_i_i_shift_lt()
+    test_shl_i_i_ic_shift_lt()
+    test_shl_i_ic_i_shift_lt()
+    test_shl_i_ic_ic_shift_lt()
+    test_shl_i_i_shift_lt()
+    test_bxor_i_i_i_xor()
+    test_bxor_i_i_ic_xor()
+    test_bxor_i_ic_xor()
+    test_band_i_i_i_and()
+    test_band_i_i_ic_and()
+    test_band_i_i_ic_and_2()
+    test_bor_i_i_i()
+    test_bor_i_i_ic()
+    test_bor_i_i_ic_2()
+    test_bnot_i_i_2()
+    test_rot_i_i_ic_ic()
+    test_i_reg_shl_and_pmc_shl_are_consistent()
+    # END_OF_TESTS
+.end
+
+.macro exception_is ( M )
+    .local pmc exception
+    .local string message
+    .get_results (exception)
+
+    message = exception['message']
+    is( message, .M, .M )
+.endm
+
+.sub test_shr_i_i_i_shift_rt_
+    set $I0, 0b001100
+    set $I1, 0b010100
+    set $I2, 1
+    set $I3, 2
+    shr $I4, $I0, $I2
+    shr $I2, $I0, $I2
+    shr $I1, $I1, $I3
+    is( $I4, "6", 'shr_i_i_i (>>)' )
+    is( $I2, "6", 'shr_i_i_i (>>)' )
+    is( $I1, "5", 'shr_i_i_i (>>)' )
+    is( $I0, "12", 'shr_i_i_i (>>)' )
+.end
+
+.sub test_shr_i_i_shift_rt_
+    set $I0, 0b001100
+    set $I1, 0b010100
+    set $I2, 1
+    set $I3, 2
+    shr $I0, $I2
+    shr $I1, $I3
+    is( $I0, "6", 'shr_i_i (>>)' )
+    is( $I1, "5", 'shr_i_i (>>)' )
+.end
+
+.sub test_shr_i_i_ic_shift_rt_
+    set     $I0, 0b001100
+    set     $I1, 0b010100
+    shr     $I2, $I0, 1
+    shr     $I1, $I1, 2
+    is( $I2, "6", 'shr_i_i_ic (>>)' )
+    is( $I1, "5", 'shr_i_i_ic (>>)' )
+    is( $I0, "12", 'shr_i_i_ic (>>)' )
+.end
+
+.sub test_shr_i_ic_i_shift_rt_
+    set $I0, 1
+    set $I1, 2
+    shr $I2, 0b001100, $I0
+    shr $I1, 0b010100, $I1
+    is( $I2, "6", 'shr_i_ic_i (>>)' )
+    is( $I1, "5", 'shr_i_ic_i (>>)' )
+.end
+
+.sub test_shr_i_ic_ic_shift_rt_
+    shr $I2, 0b001100, 1
+    shr $I1, 0b010100, 2
+    is( $I2, "6", 'shr_i_ic_ic (>>)' )
+    is( $I1, "5", 'shr_i_ic_ic (>>)' )
+.end
 
 # The crux of this test is that a proper logical right shift
 # will clear the most significant bit, so the shifted value
 # will be a positive value on any 2's or 1's complement CPU
-pasm_output_is( <<'CODE', <<'OUTPUT', "lsr_i_ic_ic (>>)" );
-        lsr I2, -40, 1
-        lt I2, 0, BAD
-        print "OK\n"
-        end
-BAD:
-        print "Not OK"
-        print "\n"
-        end
-CODE
-OK
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "lsr_i_ic (>>)" );
-        set I2, -100
-        lsr I2, 1
-        lt I2, 0, BAD
-        print "OK\n"
-        end
-BAD:
-        print "Not OK"
-        print "\n"
-        end
-CODE
-OK
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "lsr_i_i_i (>>)" );
-        set I0, -40
-        set I1, 1
-        lsr I2, I0, I1
-        lt I2, 0, BAD
-        print "OK\n"
-        end
-BAD:
-        print "Not OK"
-        print "\n"
-        end
-CODE
-OK
-OUTPUT
+.sub test_lsr_i_ic_ic_shift_rt_
+    lsr $I2, -40, 1
+    lt $I2, 0, BAD
+    ok( 1, 'lsr_i_ic_ic (>>)' )
+    goto END
+  BAD:
+    ok( 0, 'lsr_i_ic_ic (>>)' )
+  END:
+.end
+
+.sub test_lsr_i_ic_shift_rt
+    set $I2, -100
+    lsr $I2, 1
+    lt $I2, 0, BAD
+    ok( 1, 'lsr_i_ic (>>) OK')
+    goto END
+  BAD:
+    ok( 0, 'lsr_i_ic (>>)')
+  END:
+.end
+
+.sub test_lsr_i_i_i_shift_rt
+    set $I0, -40
+    set $I1, 1
+    lsr $I2, $I0, $I1
+    lt $I2, 0, BAD
+    ok( 1, 'lsr_i_i_i (>>) OK')
+    goto END
+  BAD:
+    ok( 0, 'lsr_i_i_i (>>)')
+  END:
+.end
 
 # ... and the missing op signature was untested and wrong in JIT/i386
-pasm_output_is( <<'CODE', <<'OUTPUT', "lsr_i_i_ic (>>)" );
-        set I0, -40
-        lsr I2, I0, 1
-        lt I2, 0, BAD
-        print "OK\n"
-        end
-BAD:
-        print "Not OK"
-        print "\n"
-        end
-CODE
-OK
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "shr_i_i_ic (>>) negative" );
-        set I0, -40
-        shr I2, I0, 1
-        ge I2, 0, BAD
-        print "OK\n"
-        end
-BAD:
-        print "Not OK"
-        print "\n"
-        end
-CODE
-OK
-OUTPUT
-pasm_output_is( <<'CODE', <<'OUTPUT', "shl_i_i_i (<<)" );
-        set I0, 0b001100
-        set I1, 0b010100
-        set I2, 2
-        set I3, 1
-        shl I4, I0, I2
-        shl I2, I0, I2
-        shl I1, I1, I3
-        print I4
-        print "\n"
-        print I2
-        print "\n"
-        print I1
-        print "\n"
-        print I0
-        print "\n"
-        end
-CODE
-48
-48
-40
-12
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "shl_i_i_ic (<<)" );
-        set I0, 0b001100
-        set I1, 0b010100
-        shl I2, I0, 2
-        shl I1, I1, 1
-        print I2
-        print "\n"
-        print I1
-        print "\n"
-        print I0
-        print "\n"
-        end
-CODE
-48
-40
-12
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "shl_i_ic_i (<<)" );
-        set I0, 2
-        set I1, 1
-        shl I2, 0b001100, I0
-        shl I1, 0b010100, I1
-        print I2
-        print "\n"
-        print I1
-        print "\n"
-        end
-CODE
-48
-40
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "shl_i_ic_ic (<<)" );
-        shl I2, 0b001100, 2
-        shl I1, 0b010100, 1
-        print I2
-        print "\n"
-        print I1
-        print "\n"
-        end
-CODE
-48
-40
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "shl_i_i (<<)" );
-        set I0, 0b001100
-        set I1, 0b010100
-        set I2, 1
-        set I3, 2
-        shl I0, I2
-        shl I1, I3
-        print I0
-        print "\n"
-        print I1
-        print "\n"
-        end
-CODE
-24
-80
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "bxor_i_i_i (^)" );
-        set     I0, 0b001100
-        set     I1, 0b100110
-        bxor    I2, I0, I1
-        print   I2
-        print   "\n"
-        bxor    I1, I0, I1
-        print   I1
-        print   "\n"
-        print   I0
-        print   "\n"
-        end
-CODE
-42
-42
-12
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "bxor_i_i_ic (^)" );
-        set I0, 0b001100
-        bxor I2, I0, 0b100110
-        print I2
-        print "\n"
-        print I0
-        print "\n"
-        bxor I0, I0, 0b100110
-        print I0
-        print "\n"
-        end
-CODE
-42
-12
-42
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "bxor_i|ic (^)" );
-        set I0, 0b001100
-        set I2, 0b000011
-        bxor I2, I0
-        print I2
-        print "\n"
-
-        set I2, 0b001100
-        bxor  I2, I0
-        print I2
-        print "\n"
-
-        set I2, 0b101010
-        bxor I2, I2
-        print I2
-        print "\n"
-
-        set I2, 0b010101
-        bxor I2, 0b000011
-        print I2
-        print "\n"
-
-        end
-CODE
-15
-0
-0
-22
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "band_i_i_i (&)" );
-        set     I0, 0b001100
-        set     I1, 0b010110
-        band    I2, I0,I1
-        print   I2
-        print   "\n"
-        band    I1,I0,I1
-        print   I1
-        print   "\n"
-        print   I0
-        print   "\n"
-        end
-CODE
-4
-4
-12
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "band_i_i_ic (&)" );
-        set I0, 0b001100
-        band I2, I0,0b010110
-        print I2
-        print "\n"
-        print I0
-        print "\n"
-        band I0,I0,0b010110
-        print I0
-        print "\n"
-        end
-CODE
-4
-12
-4
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "band_i_i|ic (&)" );
-        set I0, 0b001100
-        set I2, 0b000011
-        band I2, I0
-        print I2
-        print "\n"
-
-        set I2, 0b001100
-        band  I2, I0
-        print I2
-        print "\n"
-
-        set I2, 0b101010
-        band I2, I2
-        print I2
-        print "\n"
-
-        set I2, 0b010101
-        band I2, 0b000011
-        print I2
-        print "\n"
-
-        end
-CODE
-0
-12
-42
-1
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "bor_i_i_i (|)" );
-        set I0, 0b001100
-        set I1, 0b010110
-        bor I2, I0,I1
-        print I2
-        print "\n"
-        bor I1,I0,I1
-        print I1
-        print "\n"
-        print I0
-        print "\n"
-        end
-CODE
-30
-30
-12
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "bor_i_i_ic (|)" );
-        set I0, 0b001100
-        bor I2, I0,0b010110
-        print I2
-        print "\n"
-        print I0
-        print "\n"
-        bor I0,I0,0b010110
-        print I0
-        print "\n"
-        end
-CODE
-30
-12
-30
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "bor_i_i|ic (|)" );
-        set I0, 0b001100
-        set I2, 0b000011
-        bor I2, I0
-        print I2
-        print "\n"
-
-        set I2, 0b001100
-        bor  I2, I0
-        print I2
-        print "\n"
-
-        set I2, 0b101010
-        bor I2, I2
-        print I2
-        print "\n"
-
-        set I2, 0b010101
-        bor I2, 0b000011
-        print I2
-        print "\n"
-
-        end
-CODE
-15
-12
-42
-23
-OUTPUT
-
-# use C<and> to only check low order bits, this should be platform nice
-pasm_output_is( <<'CODE', <<'OUTPUT', "bnot_i_i (~)" );
-        set     I0, 0b001100
-        set     I1, 0b001100
-        set     I31, 0b111111
-        bnot    I2, I0
-        band    I2, I2, I31
-        print   I2
-        print   "\n"
-        bnot    I1, I1
-        band    I1, I1, I31
-        print   I1
-        print   "\n"
-        print   I0
-        print   "\n"
-        end
-CODE
-51
-51
-12
-OUTPUT
-
-my $int_bits = $PConfig{intvalsize} * 8;
-pasm_output_is( <<"CODE", <<'OUTPUT', 'rot_i_i_ic_ic' );
-    set I0, 0b001100
-    rot I1, I0, 1, $int_bits   # 1 left
-    print I1
-    print "\\n"
-    rot I1, I0, -1, $int_bits   # 1 right
-    print I1
-    print "\\n"
-    end
-CODE
-24
-6
-OUTPUT
-
-SKIP: {
-    skip 'no BigInt lib found' => 1
-        unless $PConfig{gmp};
-
-    my @todo;
-    @todo = ( todo => 'broken with JIT (RT #43245)' )
-        if ( defined $ENV{TEST_PROG_ARGS} and 
-            $ENV{TEST_PROG_ARGS} =~ /--runcore=jit/ );
+.sub test_lsr_i_i_ic_shift_rt
+    set $I0, -40
+    lsr $I2, $I0, 1
+    lt $I2, 0, BAD
+    ok( 1, 'lsr_i_i_ic (>>) OK')
+    goto END
+  BAD:
+    ok( 0, 'lsr_i_i_ic (>>)')
+  END:
+.end
+
+.sub test_shr_i_i_ic_shift_rt_negative
+    set $I0, -40
+    shr $I2, $I0, 1
+    ge $I2, 0, BAD
+    ok( 1, 'shr_i_i_ic (>>) negative OK')
+    goto END
+  BAD:
+    ok( 0, 'shr_i_i_ic (>>) negative')
+  END:
+.end
+
+.sub test_shl_i_i_i_shift_lt
+    set $I0, 0b001100
+    set $I1, 0b010100
+    set $I2, 2
+    set $I3, 1
+    shl $I4, $I0, $I2
+    shl $I2, $I0, $I2
+    shl $I1, $I1, $I3
+    is( $I4, "48", 'shl_i_i_i (<<)' )
+    is( $I2, "48", 'shl_i_i_i (<<)' )
+    is( $I1, "40", 'shl_i_i_i (<<)' )
+    is( $I0, "12", 'shl_i_i_i (<<)' )
+.end
+
+.sub test_shl_i_i_ic_shift_lt
+    set $I0, 0b001100
+    set $I1, 0b010100
+    shl $I2, $I0, 2
+    shl $I1, $I1, 1
+    is( $I2, "48", 'shl_i_i_ic (<<)' )
+    is( $I1, "40", 'shl_i_i_ic (<<)' )
+    is( $I0, "12", 'shl_i_i_ic (<<)' )
+.end
+
+.sub test_shl_i_ic_i_shift_lt
+    set $I0, 2
+    set $I1, 1
+    shl $I2, 0b001100, $I0
+    shl $I1, 0b010100, $I1
+    is( $I2, "48", 'shl_i_ic_i (<<)' )
+    is( $I1, "40", 'shl_i_ic_i (<<)' )
+.end
+
+.sub test_shl_i_ic_ic_shift_lt
+    shl $I2, 0b001100, 2
+    shl $I1, 0b010100, 1
+    is( $I2, "48", 'shl_i_ic_ic (<<)' )
+    is( $I1, "40", 'shl_i_ic_ic (<<)' )
+.end
+
+.sub test_shl_i_i_shift_lt
+    set $I0, 0b001100
+    set $I1, 0b010100
+    set $I2, 1
+    set $I3, 2
+    shl $I0, $I2
+    shl $I1, $I3
+    is( $I0, "24", 'shl_i_i (<<)' )
+    is( $I1, "80", 'shl_i_i (<<)' )
+.end
+
+.sub test_bxor_i_i_i_xor
+    set     $I0, 0b001100
+    set     $I1, 0b100110
+    bxor    $I2, $I0, $I1
+    is( $I2, "42", 'bxor_i_i_i (^)' )
+    bxor    $I1, $I0, $I1
+    is( $I1, "42", 'bxor_i_i_i (^)' )
+    is( $I0, "12", 'bxor_i_i_i (^)' )
+.end
+
+.sub test_bxor_i_i_ic_xor
+    set $I0, 0b001100
+    bxor $I2, $I0, 0b100110
+    is( $I2, "42", 'bxor_i_i_ic (^)' )
+    is( $I0, "12", 'bxor_i_i_ic (^)' )
+    bxor $I0, $I0, 0b100110
+    is( $I0, "42", 'bxor_i_i_ic (^)' )
+.end
+
+.sub test_bxor_i_ic_xor
+    set $I0, 0b001100
+    set $I2, 0b000011
+    bxor $I2, $I0
+    is( $I2, "15", 'bxor_i|ic (^)' )
+    set $I2, 0b001100
+    bxor  $I2, $I0
+    is( $I2, "0", 'bxor_i|ic (^)' )
+    set $I2, 0b101010
+    bxor $I2, $I2
+    is( $I2, "0", 'bxor_i|ic (^)' )
+    set $I2, 0b010101
+    bxor $I2, 0b000011
+    is( $I2, "22", 'bxor_i|ic (^)' )
+.end
+
+.sub test_band_i_i_i_and
+    set     $I0, 0b001100
+    set     $I1, 0b010110
+    band    $I2, $I0,$I1
+    is( $I2, "4", 'band_i_i_i (&)' )
+    band    $I1,$I0,$I1
+    is( $I1, "4", 'band_i_i_i (&)' )
+    is( $I0, "12", 'band_i_i_i (&)' )
+.end
+
+.sub test_band_i_i_ic_and
+    set $I0, 0b001100
+    band $I2, $I0,0b010110
+    is( $I2, "4", 'band_i_i_ic (&)' )
+    is( $I0, "12", 'band_i_i_ic (&)' )
+    band $I0,$I0,0b010110
+    is( $I0, "4", 'band_i_i_ic (&)' )
+.end
+
+.sub test_band_i_i_ic_and_2
+    set $I0, 0b001100
+    set $I2, 0b000011
+    band $I2, $I0
+    is( $I2, "0", 'band_i_i|ic (&)' )
+
+    set $I2, 0b001100
+    band  $I2, $I0
+    is( $I2, "12", 'band_i_i|ic (&)' )
+
+    set $I2, 0b101010
+    band $I2, $I2
+    is( $I2, "42", 'band_i_i|ic (&)' )
+    
+    set $I2, 0b010101
+    band $I2, 0b000011
+    is( $I2, "1", 'band_i_i|ic (&)' )
+.end
+
+.sub test_bor_i_i_i
+    set $I0, 0b001100
+    set $I1, 0b010110
+    bor $I2, $I0,$I1
+    is( $I2, "30", 'bor_i_i_i (|)' )
+    bor $I1,$I0,$I1
+    is( $I1, "30", 'bor_i_i_i (|)' )
+    is( $I0, "12", 'bor_i_i_i (|)' )
+.end
+
+.sub test_bor_i_i_ic
+    set $I0, 0b001100
+    bor $I2, $I0,0b010110
+    is( $I2, "30", 'bor_i_i_ic (|)' )
+    is( $I0, "12", 'bor_i_i_ic (|)' )
+    bor $I0,$I0,0b010110
+    is( $I0, "30", 'bor_i_i_ic (|)' )
+.end
+
+.sub test_bor_i_i_ic_2
+    set $I0, 0b001100
+    set $I2, 0b000011
+    bor $I2, $I0
+    is( $I2, "15", 'bor_i_i|ic (|) 2' )
+    set $I2, 0b001100
+    bor  $I2, $I0
+    is( $I2, "12", 'bor_i_i|ic (|) 2' )
+    set $I2, 0b101010
+    bor $I2, $I2
+    is( $I2, "42", 'bor_i_i|ic (|) 2' )
+    set $I2, 0b010101
+    bor $I2, 0b000011
+    is( $I2, "23", 'bor_i_i|ic (|) 2' )
+.end
+
+.sub test_bnot_i_i_2
+    set     $I0, 0b001100
+    set     $I1, 0b001100
+    set     $I31, 0b111111
+    bnot    $I2, $I0
+    band    $I2, $I2, $I31
+    is( $I2, "51", 'bnot_i_i (~) 2' )
+    bnot    $I1, $I1
+    band    $I1, $I1, $I31
+    is( $I1, "51", 'bnot_i_i (~) 2' )
+    is( $I0, "12", 'bnot_i_i (~) 2' )
+.end
+
+.sub test_rot_i_i_ic_ic
+    .include "iglobals.pasm"
+    .local pmc interp     # a handle to our interpreter object.
+    interp = getinterp
+    .local pmc config
+    config = interp[.IGLOBALS_CONFIG_HASH]
+    .local int intvalsize 
+    intvalsize = config['intvalsize']
+
+    .local int int_bits
+    int_bits = intvalsize * 8
+
+    set $I0, 0b001100
+
+    gt intvalsize, 4, do64bit
+
+    rot $I1, $I0, 1, 32         # 1 left
+    is( $I1, "24", 'rot_i_i_ic_ic' )
+    rot $I1, $I0, -1, 32        # 1 right
+    is( $I1, "6", 'rot_i_i_ic_ic' )
+    goto END
+
+  do64bit:
+    rot $I1, $I0, 1, 64         # 1 left
+    is( $I1, "24", 'rot_i_i_ic_ic' )
+    rot $I1, $I0, -1, 64        # 1 right
+    is( $I1, "6", 'rot_i_i_ic_ic' )
+    
+  END:
+.end
 
-    pir_output_is( <<'CODE', <<'OUT', "I-reg shl and PMC shl are consistent", @todo );
 ## The PMC shl op will promote Integer to Bigint when needed.  We can't stuff a
 ## BigInt in an I register, but we can produce the same result modulo wordsize.
 ## [Only we cheat by using the word size minus one, so that we don't have to
 ## deal with negative numbers.  -- rgr, 2-Jun-07.]
-.sub main :main
+.sub test_i_reg_shl_and_pmc_shl_are_consistent
+
+    .include "iglobals.pasm"
+    .local pmc interp     # a handle to our interpreter object.
+    interp = getinterp
+    .local pmc config
+    config = interp[.IGLOBALS_CONFIG_HASH]
+    .local int gmp
+    gmp = config['gmp']
+    
+    if gmp, runtest
+    skip( 2, 'no BigInt lib found' )
+    goto END
+
+  runtest:
+
     ## Figure out the wordsize.  We need integer_modulus because assigning a
     ## too-big BigInt throws an error otherwise.
     .include 'sysinfo.pasm'
@@ -539,6 +415,7 @@
     ## Test shifting a negative number.
     set $P0, -1000001
     test_shift($P0, integer_modulus)
+  END:
 .end
 
 .sub test_shift
@@ -550,7 +427,7 @@
     i_number = number
 
     ## Start the loop.
-loop:
+  loop:
     if $P1 > 100 goto done
     ## shift number and i_number into $P2 and $I2.
     shl $P2, number, $P1
@@ -567,36 +444,31 @@
     $I5 = - $I4
     if $I4 == $I5 goto ok
     goto bad
-pos_check:
+  pos_check:
     if $I2 == $I3 goto ok
-bad:
-    print "oops; not ok: "
-    print i_number
-    print ' << '
-    print $I1
-    print ' gives I '
-    print $I2
-    print ' vs. P '
-    print $P3
-    print ".\n"
-    print $I5
-    print "\n"
-ok:
+  bad:
+    ok( 0, "oops; not ok: " )
+    diag( i_number )
+    diag( ' << ' )
+    diag( $I1 )
+    diag( ' gives I ' )
+    diag( $I2 )
+    diag( ' vs. P ' )
+    diag( $P3 )
+    diag( ".\n" )
+    diag( $I5 )
+    diag( "\n" )
+  ok:
     ## set up for the next one
     inc $P1
     goto loop
-done:
-    print "done.\n"
+  done:
+    ok( 1, 'finished ok' )
 .end
-CODE
-done.
-done.
-OUT
-}
 
 # Local Variables:
-#   mode: cperl
+#   mode: pir
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/t/op/box.t
==============================================================================
--- branches/orderedhash_revamp/t/op/box.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/box.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 #!parrot
-# Copyright (C) 2008, Parrot Foundation.
+# Copyright (C) 2008-2009, Parrot Foundation.
 # $Id$
 
 =head1 NAME
@@ -16,7 +16,7 @@
 
 =cut
 
-.const int TESTS = 24
+.const int TESTS = 26
 
 # must set these up before the hll_map calls later
 .sub '__setup' :immediate
@@ -33,6 +33,7 @@
     'box_int'()
     'box_num'()
     'box_string'()
+    'box_null_string'()
 
     .local pmc box_int_hll
     box_int_hll = get_root_global [ 'for_test' ], 'box_int'
@@ -93,7 +94,20 @@
     isa_ok( $P0, 'String', 'string boxed to appropriate base type from reg' )
 .end
 
+.sub 'box_null_string'
+    null $S0
+    $P0 = box $S0
+    $S1 = $P0
+    is( $S1, '', 'NULL STRING boxed to empty String PMC' )
+
+    $P1 = clone $P0
+    $S1 = $P0
+    is( $S1, '', '... and survives clone of boxed PMC (TT #964)' )
+
+.end
+
 .HLL 'for_test'
+
 .sub anon :anon :init
   .local pmc interp
   .local pmc cint, myint

Modified: branches/orderedhash_revamp/t/op/calling.t
==============================================================================
--- branches/orderedhash_revamp/t/op/calling.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/calling.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -7,7 +7,7 @@
 use lib qw( . lib ../lib ../../lib );
 
 use Test::More;
-use Parrot::Test tests => 94;
+use Parrot::Test tests => 97;
 
 =head1 NAME
 
@@ -447,7 +447,7 @@
     print $P0
 .end
 CODE
-/too few arguments passed/
+/too few positional arguments/
 OUTPUT
 
 pir_output_like(
@@ -478,7 +478,7 @@
     print "nada"
 .end
 CODE
-/too many arguments passed/
+/too many positional arguments/
 OUTPUT
 
 pir_error_output_like( <<'CODE', <<'OUTPUT', "argc mismatch, too many" );
@@ -496,7 +496,7 @@
     print $P0
 .end
 CODE
-/too many arguments passed/
+/too many positional arguments/
 OUTPUT
 
 pir_output_like( <<'CODE', <<'OUTPUT', "argc mismatch, too many - catch exception" );
@@ -524,7 +524,7 @@
 #    print $S1
 .end
 CODE
-/^caught: too many arguments passed/
+/^caught: too many positional arguments/
 OUTPUT
 
 pir_output_is( <<'CODE', <<'OUTPUT', "argc mismatch, optional" );
@@ -571,7 +571,7 @@
     .param int got_k :opt_flag
 .end
 CODE
-/too many arguments passed/
+/too many positional arguments/
 OUTPUT
 
 pasm_output_is( <<'CODE', <<'OUTPUT', "get_param later" );
@@ -1210,7 +1210,7 @@
     $P35 = _fn1(1, $P34 :flat)
 .end
 CODE
-/too many arguments passed \(5\) - 4 params expected/
+/too many positional arguments: 5 passed, 4 expected/
 OUTPUT
 
 pir_error_output_like( <<'CODE', <<'OUTPUT', "too few args via :flat" );
@@ -1242,7 +1242,7 @@
     $P35 = _fn1(1, $P34 :flat)
 .end
 CODE
-/too few arguments passed \(3\) - 4 params expected/
+/too few positional arguments: 3 passed, 4 \(or more\) expected/
 OUTPUT
 
 pir_output_is( <<'CODE', <<'OUTPUT', "tailcall to NCI" );
@@ -1406,7 +1406,10 @@
 ok
 OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', "clone_key_arg" );
+my @todo = ( todo => 'broken with JIT (TT #983)' )
+    if ( defined $ENV{TEST_PROG_ARGS} and
+        $ENV{TEST_PROG_ARGS} =~ /--runcore=jit/ );
+pir_output_is( <<'CODE', <<'OUTPUT', "clone_key_arg", @todo );
 .sub main :main
     foo()
     print "ok\n"
@@ -1748,6 +1751,36 @@
 ok
 OUTPUT
 
+pir_output_is( <<'CODE', <<'OUTPUT', "named - 3 slurpy hash PIR" );
+.sub main :main
+    foo('a' => 10 , 'b' => 20, 'c' => 30)
+    print "ok\n"
+    end
+.end
+.sub foo
+    .param int a :named('a')
+    .param pmc bar :slurpy :named
+    print a
+    print ' '
+    elements $I1, bar
+    print $I1
+    print ' '
+    typeof $S0, bar
+    print $S0
+    print ' '
+    set $I2, bar['b']
+    print $I2
+    print ' '
+    set $I2, bar['c']
+    print $I2
+    print "\n"
+.end
+
+CODE
+10 2 Hash 20 30
+ok
+OUTPUT
+
 pasm_output_is( <<'CODE', <<'OUTPUT', "named - 3 slurpy hash" );
 .pcc_sub main:
     set_args "0x200, 0, 0x200, 0,0x200, 0", "a", 10, "b", 20, 'c', 30
@@ -1951,7 +1984,7 @@
         .param int b
 .end
 CODE
-/many named arguments/
+/too few positional/
 OUTPUT
 
 pir_output_is( <<'CODE', <<'OUTPUT', "named optional - set" );
@@ -2085,7 +2118,7 @@
 1120
 OUTPUT
 
-pir_error_output_like( <<'CODE', <<'OUTPUT', "argc mismatch - missing named" );
+pir_error_output_like( <<'CODE', qr/too few named arguments/, "argc mismatch - missing named" );
 .sub main :main
     .include "errors.pasm"
     errorson .PARROT_ERRORS_PARAM_COUNT_FLAG
@@ -2102,10 +2135,8 @@
         print "\n"
 .end
 CODE
-/too few arguments/
-OUTPUT
 
-pir_error_output_like( <<'CODE', <<'OUTPUT', "argc mismatch - missing named" );
+pir_error_output_like( <<'CODE', qr/too few named arguments/, "argc mismatch - missing named" );
 .sub main :main
     .include "errors.pasm"
     errorson .PARROT_ERRORS_PARAM_COUNT_FLAG
@@ -2122,8 +2153,6 @@
         print "\n"
 .end
 CODE
-/too few arguments/
-OUTPUT
 
 pir_error_output_like( <<'CODE', <<'OUTPUT', "argc mismatch - too many named" );
 .sub main :main
@@ -2258,7 +2287,7 @@
     .param pmc args :slurpy :named
 .end
 CODE
-/positional inside named args at position 2/
+/too many positional arguments/
 OUTPUT
 
 pir_error_output_like( <<'CODE', <<'OUTPUT', "unexpected positional arg" );
@@ -2271,10 +2300,10 @@
     .param pmc args :slurpy :named
 .end
 CODE
-/positional inside named args at position 3/
+/named arguments must follow all positional arguments/
 OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', "RT #40490 - flat/slurpy named arguments" );
+pir_output_is( <<'CODE', <<'OUTPUT', "flat/slurpy named arguments" );
 .sub 'main' :main
         .local pmc args
         args = new 'Hash'
@@ -2345,7 +2374,6 @@
     foo($P0 :flat, 'abc' => 3)
     $P0 = new 'ResizablePMCArray'
     foo($P0 :flat, 'abc' => 4)
-    # Shorter version of RT #53926
     $P0 = new 'Hash'
     $P0['abc'] = 5
     foo($P0 :named :flat)
@@ -2394,7 +2422,7 @@
 2
 OUTPUT
 
-pir_error_output_like( <<'CODE', <<'OUTPUT', "arg mismatch with no params", todo=> 'RT #39844' );
+pir_error_output_like( <<'CODE', <<'OUTPUT', "arg mismatch with no params", todo=> 'TT #1033' );
 .sub main :main
   foo(1)
 .end
@@ -2405,7 +2433,7 @@
 /too many arguments passed\(1\) - 0 params expected/
 OUTPUT
 
-# See Rakudo RT #62730
+# See Rakudo queue http://rt.perl.org/rt3/Ticket/Display.html?id=62730
 pir_output_is( <<'CODE', <<'OUTPUT', "named from register, not constant" );
 .sub 'main'
     $S0 = 'foo'
@@ -2432,6 +2460,53 @@
 42
 OUTPUT
 
+# See Rakudo queue http://rt.perl.org/rt3/Ticket/Display.html?id=62730
+pir_output_is( <<'CODE', <<'OUTPUT', "Handling :flat of emtpy arguments" );
+.sub 'main'
+    $P0   = new ['Undef']
+    ($P0) = foo()
+    $S0   = typeof $P0
+    say $S0
+.end
+
+.sub 'foo'
+    .param pmc arg :slurpy
+    $S0 = typeof arg
+    say $S0
+    .return (arg :flat)
+.end
+CODE
+ResizablePMCArray
+Undef
+OUTPUT
+
+pir_output_is( <<'CODE', <<'OUTPUT', "Tailcall from vtable" );
+
+.sub main :main
+$P1 = newclass "Foo"
+$P2 = new "Foo"
+
+## Should return 2, but doesn't.
+$I1 = elements $P2
+$S1 = $I1
+say $S1
+.end
+
+.namespace ["Foo"]
+
+.sub elements :vtable
+$I0 = 13
+$I1 = 2
+.tailcall identity($I1)
+.end
+
+.sub identity
+.param int arg
+.return (arg)
+.end
+CODE
+2
+OUTPUT
 
 # Local Variables:
 #   mode: cperl

Modified: branches/orderedhash_revamp/t/op/cc_params.t
==============================================================================
--- branches/orderedhash_revamp/t/op/cc_params.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/cc_params.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,20 +1,14 @@
-#!perl
-# Copyright (C) 2007, Parrot Foundation.
+#!parrot
+# Copyright (C) 2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test 'no_plan';
-
 =head1 NAME
 
 t/op/cc_params.t - Parrot Calling Conventions parameter matching tests
 
 =head1 SYNOPSIS
 
-    % prove t/op/cc_params.t
+% prove t/op/cc_params.t
 
 =head1 DESCRIPTION
 
@@ -22,200 +16,111 @@
 
 =cut
 
-my $t_testbody = <<'TESTBODY';
-.sub 'test' :main
-    .include 'errors.pasm'
-    errorson .PARROT_ERRORS_PARAM_COUNT_FLAG
-    errorson .PARROT_ERRORS_RESULT_COUNT_FLAG
-
- at INIT_ARGS@
- at INIT_RESULTS@
-
-    (@LIST_RESULTS@) = '@FUNC@'(@LIST_ARGS@)
-    print "ok\n"
-.end
-
-.sub '@FUNC@'
- at INIT_PARAMS@
- at INIT_RETURNS@
- at CHECK_PARAMS@
-    .return(@LIST_RETURNS@)
-.end
-TESTBODY
-
-my $t_expbody = <<'EXPBODY';
- at CHECK_RESULTS@
-EXPBODY
-
-## loop over test cases
-## expected in
-for my $c_args ( 0 .. 1 ) {
-    ## expected out
-    for my $c_results ( 0 .. 1 ) {
-        ## got in
-        for my $c_params ( 0 .. ( $c_args ? 2 : 1 ) ) {
-            ## got out
-            for my $c_returns ( 0 .. ( $c_results ? 2 : 1 ) ) {
-                my $td = TemplateData->new;
-
-                ## initialize template keys
-                for ( $t_testbody =~ m/@(\w+)@/g ) { $td->addkey($_) }
-
-                for ( $t_expbody =~ m/@(\w+)@/g ) { $td->addkey($_) }
-
-                ## initialize template data
-                $td->initialize( $c_args, $c_params, $c_returns, $c_results );
-
-                ## generate tests and results
-                my $testbody = $td->generate($t_testbody);
-                my $expbody  = $td->generate($t_expbody);
-                my $testhead = create_test_header( $c_args, $c_results, $c_params, $c_returns, );
-
-                ## execute tests
-                if ( $expbody eq "ok\n" ) {
-                    pir_output_like( $testbody, "/$expbody/", $testhead );
-                }
-                else {
-                    pir_error_output_like( $testbody, "/$expbody/", $testhead );
-                }
-            }
-        }
-    }
-}
-
-exit;
-
-sub create_test_header {
-    return 'param mismatch: args:'
-        . shift()
-        . ' results:'
-        . shift()
-        . ' params:'
-        . shift()
-        . ' returns:'
-        . shift();
-
-}
-
-package TemplateData;
-
-sub new { bless {} => shift; }
-sub addkey { my $self = shift; $self->{$_} = '' for @_ }
-
-sub create_args {
-    my $self = shift;
-    my $num  = shift;
-
-    $self->{C_ARGS} = $num;
-
-    if ( $self->{C_ARGS} ) {
-        $self->{_ARGS} = [ map { 'arg' . $_ } 1 .. $num ];
-        $self->{LIST_ARGS} = join ', ' => @{ $self->{_ARGS} };
-        $self->{INIT_ARGS} = '    .local int ' . $self->{LIST_ARGS} . $/;
-        $self->{INIT_ARGS} .= "    ${ $self->{_ARGS} }[$_] = $_$/" for 0 .. $#{ $self->{_ARGS} };
-    }
-}
-
-sub create_params {
-    my $self = shift;
-    my $num  = shift;
-
-    $self->{C_PARAMS} = $num;
-
-    if ( $self->{C_PARAMS} ) {
-        $self->{_PARAMS} = [ map { 'param' . $_ } 1 .. $num ];
-        $self->{LIST_PARAMS} = join ', ' => @{ $self->{_PARAMS} };
-        $self->{INIT_PARAMS} =
-            join( "\n" => map { '    .param int ' . ${ $self->{_PARAMS} }[$_] }
-                0 .. $#{ $self->{_PARAMS} } );
-    }
-    else {
-        $self->{INIT_PARAMS} = q{    get_params '()'};
-    }
-}
-
-sub create_returns {
-    my $self = shift;
-    my $num  = shift;
-
-    $self->{C_RETURNS} = $num;
-
-    if ( $self->{C_RETURNS} ) {
-        $self->{_RETURNS} = [ map { 'return' . $_ } 1 .. $num ];
-        $self->{LIST_RETURNS} = join ', ' => @{ $self->{_RETURNS} };
-        $self->{INIT_RETURNS} = '    .local int ' . $self->{LIST_RETURNS} . $/;
-        $self->{INIT_RETURNS} .= "    ${ $self->{_RETURNS} }[$_] = $_$/"
-            for 0 .. $#{ $self->{_RETURNS} };
-    }
-}
-
-sub create_results {
-    my $self = shift;
-    my $num  = shift;
-
-    $self->{C_RESULTS} = $num;
-
-    if ( $self->{C_RESULTS} ) {
-        $self->{_RESULTS} = [ map { 'result' . $_ } 1 .. $num ];
-        $self->{LIST_RESULTS} = join ', ' => @{ $self->{_RESULTS} };
-        $self->{INIT_RESULTS} =
-            join "\n" => ( map { '    .local int ' . $_ } @{ $self->{_RESULTS} } );
-    }
-}
-
-sub create_func {
-    my $self = shift;
-    my ( $c_args, $c_params, $c_returns, $c_results ) = @_;
-
-    $self->{FUNC} =
-        'args' . $c_args
-        . '_results'
-        . $c_results
-        . '__params'
-        . $c_params
-        . '_returns'
-        . $c_returns;
-}
-
-sub create_check_results {
-    my $self = shift;
-    my ( $c_args, $c_params, $c_returns, $c_results ) = @_;
-
-    $self->{CHECK_RESULTS} =
-        ( ( $c_args == $c_params ) and ( $c_results == $c_returns ) )
-        ? 'ok'
-        : 'too (many|few) arguments passed .*';
-}
-
-sub initialize {
-    my $self = shift;
-    my ( $c_args, $c_params, $c_returns, $c_results ) = @_;
-
-    $self->create_args($c_args);
-    $self->create_params($c_params);
-    $self->create_returns($c_returns);
-    $self->create_results($c_results);
-
-    $self->create_func( $c_args, $c_params, $c_returns, $c_results );
-
-    $self->create_check_results( $c_args, $c_params, $c_returns, $c_results );
-}
-
-sub generate {
-    my $self = shift;
-    my ($template) = @_;
-
-    for ( $template =~ m/@(\w+)@/g ) {
-        my $replacement = ( exists $self->{$_} and defined $self->{$_} ) ? $self->{$_} : '';
-
-        $template =~ s/@(\w+)@/$replacement/;
-    }
-    return $template;
-}
+.sub test_main :main
+    .include 'test_more.pir'
+    plan(21)
+    'call_sig_with_no_args'()
+    'call_sig_with_positionals'(1, 2, 3)
+    'call_sig_with_named'(4 :named("x"), 5 :named("y"))
+
+    $P0 = newclass ['OMGClass']
+    $P1 = new $P0
+    $P1.'lolmethod'()
+    $P1.'wtfmethod'(1, 2, 3 :named("beer"), 4 :named("borovicka"))
+.end
+
+.sub call_sig_with_no_args
+    .param pmc sig :call_sig
+    $S0 = typeof sig
+    is('CallContext', $S0)
+    $I0 = elements sig
+    is(0, $I0)
+.end
+
+.sub call_sig_with_positionals
+    .param pmc sig :call_sig
+    $S0 = typeof sig
+    is('CallContext', $S0)
+    $I0 = elements sig
+    is(3, $I0)
+    $I1 = sig[0]
+    is(1, $I1)
+    $I2 = sig[1]
+    is(2, $I2)
+    $I3 = sig[2]
+    is(3, $I3)
+.end
+
+.sub call_sig_with_named
+    .param pmc sig :call_sig
+    $S0 = typeof sig
+    is('CallContext', $S0)
+    $I0 = elements sig
+    is(0, $I0)
+    $I1 = sig["x"]
+    is(4, $I1)
+    $I2 = sig["y"]
+    is(5, $I2)
+.end
+
+
+.namespace ['OMGClass']
+.sub 'lolmethod' :method
+    .param pmc sig :call_sig
+    
+    # Self is set up correctly.
+    $S0 = typeof self
+    is('OMGClass', $S0)
+
+    # Have call sig.
+    $S0 = typeof sig
+    is('CallContext', $S0)
+
+    # First element is self.
+    $P0 = sig[0]
+    $I0 = 1
+    eq_addr $P0, self, sig_ok
+    $I0 = 0
+  sig_ok:
+    ok($I0)
+.end
+
+
+.sub 'wtfmethod' :method
+    .param pmc sig :call_sig
+    
+    # Self is set up correctly.
+    $S0 = typeof self
+    is('OMGClass', $S0)
+
+    # Have call sig.
+    $S0 = typeof sig
+    is('CallContext', $S0)
+
+    # First element is self.
+    $P0 = sig[0]
+    $I0 = 1
+    eq_addr $P0, self, sig_ok
+    $I0 = 0
+  sig_ok:
+    ok($I0)
+
+    # Positionals OK.
+    $I0 = sig[1]
+    is(1, $I0)
+    $I0 = sig[2]
+    is(2, $I0)
+
+    # Nameds OK.
+    $I0 = sig['beer']
+    is(3, $I0)
+    $I0 = sig['borovicka']
+    is(4, $I0)
+.end
 
 # Local Variables:
-#   mode: cperl
+#   mode: pir
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir:

Added: branches/orderedhash_revamp/t/op/cc_params_old.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/op/cc_params_old.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,221 @@
+#!perl
+# Copyright (C) 2007, Parrot Foundation.
+# $Id$
+
+use strict;
+use warnings;
+use lib qw( . lib ../lib ../../lib );
+use Test::More;
+use Parrot::Test 'no_plan';
+
+=head1 NAME
+
+t/op/cc_params.t - Parrot Calling Conventions parameter matching tests
+
+=head1 SYNOPSIS
+
+    % prove t/op/cc_params.t
+
+=head1 DESCRIPTION
+
+Tests Parrot calling conventions for parameter matching and mismatching.
+
+=cut
+
+my $t_testbody = <<'TESTBODY';
+.sub 'test' :main
+    .include 'errors.pasm'
+    errorson .PARROT_ERRORS_PARAM_COUNT_FLAG
+    errorson .PARROT_ERRORS_RESULT_COUNT_FLAG
+
+ at INIT_ARGS@
+ at INIT_RESULTS@
+
+    (@LIST_RESULTS@) = '@FUNC@'(@LIST_ARGS@)
+    print "ok\n"
+.end
+
+.sub '@FUNC@'
+ at INIT_PARAMS@
+ at INIT_RETURNS@
+ at CHECK_PARAMS@
+    .return(@LIST_RETURNS@)
+.end
+TESTBODY
+
+my $t_expbody = <<'EXPBODY';
+ at CHECK_RESULTS@
+EXPBODY
+
+## loop over test cases
+## expected in
+for my $c_args ( 0 .. 1 ) {
+    ## expected out
+    for my $c_results ( 0 .. 1 ) {
+        ## got in
+        for my $c_params ( 0 .. ( $c_args ? 2 : 1 ) ) {
+            ## got out
+            for my $c_returns ( 0 .. ( $c_results ? 2 : 1 ) ) {
+                my $td = TemplateData->new;
+
+                ## initialize template keys
+                for ( $t_testbody =~ m/@(\w+)@/g ) { $td->addkey($_) }
+
+                for ( $t_expbody =~ m/@(\w+)@/g ) { $td->addkey($_) }
+
+                ## initialize template data
+                $td->initialize( $c_args, $c_params, $c_returns, $c_results );
+
+                ## generate tests and results
+                my $testbody = $td->generate($t_testbody);
+                my $expbody  = $td->generate($t_expbody);
+                my $testhead = create_test_header( $c_args, $c_results, $c_params, $c_returns, );
+
+                ## execute tests
+                if ( $expbody eq "ok\n" ) {
+                    pir_output_like( $testbody, "/$expbody/", $testhead );
+                }
+                else {
+                    pir_error_output_like( $testbody, "/$expbody/", $testhead );
+                }
+            }
+        }
+    }
+}
+
+exit;
+
+sub create_test_header {
+    return 'param mismatch: args:'
+        . shift()
+        . ' results:'
+        . shift()
+        . ' params:'
+        . shift()
+        . ' returns:'
+        . shift();
+
+}
+
+package TemplateData;
+
+sub new { bless {} => shift; }
+sub addkey { my $self = shift; $self->{$_} = '' for @_ }
+
+sub create_args {
+    my $self = shift;
+    my $num  = shift;
+
+    $self->{C_ARGS} = $num;
+
+    if ( $self->{C_ARGS} ) {
+        $self->{_ARGS} = [ map { 'arg' . $_ } 1 .. $num ];
+        $self->{LIST_ARGS} = join ', ' => @{ $self->{_ARGS} };
+        $self->{INIT_ARGS} = '    .local int ' . $self->{LIST_ARGS} . $/;
+        $self->{INIT_ARGS} .= "    ${ $self->{_ARGS} }[$_] = $_$/" for 0 .. $#{ $self->{_ARGS} };
+    }
+}
+
+sub create_params {
+    my $self = shift;
+    my $num  = shift;
+
+    $self->{C_PARAMS} = $num;
+
+    if ( $self->{C_PARAMS} ) {
+        $self->{_PARAMS} = [ map { 'param' . $_ } 1 .. $num ];
+        $self->{LIST_PARAMS} = join ', ' => @{ $self->{_PARAMS} };
+        $self->{INIT_PARAMS} =
+            join( "\n" => map { '    .param int ' . ${ $self->{_PARAMS} }[$_] }
+                0 .. $#{ $self->{_PARAMS} } );
+    }
+    else {
+        $self->{INIT_PARAMS} = q{    get_params '()'};
+    }
+}
+
+sub create_returns {
+    my $self = shift;
+    my $num  = shift;
+
+    $self->{C_RETURNS} = $num;
+
+    if ( $self->{C_RETURNS} ) {
+        $self->{_RETURNS} = [ map { 'return' . $_ } 1 .. $num ];
+        $self->{LIST_RETURNS} = join ', ' => @{ $self->{_RETURNS} };
+        $self->{INIT_RETURNS} = '    .local int ' . $self->{LIST_RETURNS} . $/;
+        $self->{INIT_RETURNS} .= "    ${ $self->{_RETURNS} }[$_] = $_$/"
+            for 0 .. $#{ $self->{_RETURNS} };
+    }
+}
+
+sub create_results {
+    my $self = shift;
+    my $num  = shift;
+
+    $self->{C_RESULTS} = $num;
+
+    if ( $self->{C_RESULTS} ) {
+        $self->{_RESULTS} = [ map { 'result' . $_ } 1 .. $num ];
+        $self->{LIST_RESULTS} = join ', ' => @{ $self->{_RESULTS} };
+        $self->{INIT_RESULTS} =
+            join "\n" => ( map { '    .local int ' . $_ } @{ $self->{_RESULTS} } );
+    }
+}
+
+sub create_func {
+    my $self = shift;
+    my ( $c_args, $c_params, $c_returns, $c_results ) = @_;
+
+    $self->{FUNC} =
+        'args' . $c_args
+        . '_results'
+        . $c_results
+        . '__params'
+        . $c_params
+        . '_returns'
+        . $c_returns;
+}
+
+sub create_check_results {
+    my $self = shift;
+    my ( $c_args, $c_params, $c_returns, $c_results ) = @_;
+
+    $self->{CHECK_RESULTS} =
+        ( ( $c_args == $c_params ) and ( $c_results == $c_returns ) )
+        ? 'ok'
+        : 'too (many|few) ((positional|named) (arguments|returns)).*';
+}
+
+sub initialize {
+    my $self = shift;
+    my ( $c_args, $c_params, $c_returns, $c_results ) = @_;
+
+    $self->create_args($c_args);
+    $self->create_params($c_params);
+    $self->create_returns($c_returns);
+    $self->create_results($c_results);
+
+    $self->create_func( $c_args, $c_params, $c_returns, $c_results );
+
+    $self->create_check_results( $c_args, $c_params, $c_returns, $c_results );
+}
+
+sub generate {
+    my $self = shift;
+    my ($template) = @_;
+
+    for ( $template =~ m/@(\w+)@/g ) {
+        my $replacement = ( exists $self->{$_} and defined $self->{$_} ) ? $self->{$_} : '';
+
+        $template =~ s/@(\w+)@/$replacement/;
+    }
+    return $template;
+}
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/t/op/cc_state.t
==============================================================================
--- branches/orderedhash_revamp/t/op/cc_state.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/cc_state.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -53,7 +53,7 @@
 ## G
 pcc_error_like(
     { params => ".param pmc abc" },
-    '/too few arguments passed \(0\) - 1 param expected/',
+    '/too few positional arguments: 0 passed, 1 \(or more\) expected/',
     'G1: argument underflow: required param',
 );
 
@@ -71,13 +71,13 @@
 
 pcc_error_like(
     { params => ".param pmc abc :named('x')" },
-    '/too few arguments passed - missing required named arg \'x\'/',
+    '/too few named arguments: no argument for required parameter \'x\'/',
     'G5: argument underflow: named required param',
 );
 
 pcc_error_like(
     { params => ".param pmc abc :named('x') :slurpy" },
-    '/too few arguments passed - missing required named arg \'x\'/',
+    '/too few named arguments: no argument for required parameter \'x\'/',
     'G6: argument underflow: named required slurpy param',
 );
 

Modified: branches/orderedhash_revamp/t/op/cmp-nonbranch.t
==============================================================================
--- branches/orderedhash_revamp/t/op/cmp-nonbranch.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/cmp-nonbranch.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -22,15 +22,15 @@
 .macro EXP()
   exp_nok:
     exp = 0
-    ret
+    local_return jmpstack
   exp_ok:
     exp = 1
-    ret
+    local_return jmpstack
 .endm
 
 .macro TEST()
     is( res, exp, desc )
-    ret
+    local_return jmpstack
 .endm
 
 .macro SET_DESC(op)
@@ -72,22 +72,24 @@
 
 .sub 'issame'
     .local int exp, res
+    .local pmc jmpstack
+               jmpstack = new 'ResizableIntegerArray'
     .SET_DESC('issame')
 
   init:
     $P0 = new 'Integer'
     $P1 = new 'String'
-    bsr exp_nok
-    bsr test_it   # not ok
+    local_branch jmpstack,  exp_nok
+    local_branch jmpstack,  test_it   # not ok
     $P0 = new 'String'
-    bsr test_it   # not ok
-    bsr exp_ok
+    local_branch jmpstack,  test_it   # not ok
+    local_branch jmpstack,  exp_ok
     $P1 = $P0
-    bsr test_it   # ok
+    local_branch jmpstack,  test_it   # ok
     $P0 = new 'Null'
     $P1 = new 'Null'
-    bsr test_it   # ok -- Null is a singleton
-    .return ()
+    local_branch jmpstack,  test_it   # ok -- Null is a singleton
+    .return()
 
     .EXP()
   test_it:
@@ -98,22 +100,24 @@
 
 .sub 'isntsame'
     .local int exp, res
+    .local pmc jmpstack
+               jmpstack = new 'ResizableIntegerArray'
     .SET_DESC('isntsame')
 
   init:
     $P0 = new 'Integer'
     $P1 = new 'String'
-    bsr exp_ok
-    bsr test_it   # ok
+    local_branch jmpstack,  exp_ok
+    local_branch jmpstack,  test_it   # ok
     $P0 = new 'String'
-    bsr test_it   # ok
+    local_branch jmpstack,  test_it   # ok
     $P1 = $P0
-    bsr exp_nok
-    bsr test_it   # not ok
+    local_branch jmpstack,  exp_nok
+    local_branch jmpstack,  test_it   # not ok
     $P0 = new 'Null'
     $P1 = new 'Null'
-    bsr test_it   # not ok -- Null is a singleton
-    .return ()
+    local_branch jmpstack,  test_it   # not ok -- Null is a singleton
+    .return()
 
     .EXP()
   test_it:
@@ -124,17 +128,19 @@
 
 .sub 'istrue'
     .local int exp, res
+    .local pmc jmpstack
+               jmpstack = new 'ResizableIntegerArray'
     .SET_DESC('istrue')
 
   init:
     $P0 = new 'Integer'
     $P0 = 0
-    bsr exp_nok
-    bsr test_it   # not ok
+    local_branch jmpstack,  exp_nok
+    local_branch jmpstack,  test_it   # not ok
     $P0 = 1
-    bsr exp_ok
-    bsr test_it   # ok
-    .return ()
+    local_branch jmpstack,  exp_ok
+    local_branch jmpstack,  test_it   # ok
+    .return()
 
     .EXP()
   test_it:
@@ -145,17 +151,19 @@
 
 .sub 'isfalse'
     .local int exp, res
+    .local pmc jmpstack
+               jmpstack = new 'ResizableIntegerArray'
     .SET_DESC('isfalse')
 
   init:
     $P0 = new 'Integer'
     $P0 = 0
-    bsr exp_ok
-    bsr test_it   # ok
+    local_branch jmpstack,  exp_ok
+    local_branch jmpstack,  test_it   # ok
     $P0 = 1
-    bsr exp_nok
-    bsr test_it   # not ok
-    .return ()
+    local_branch jmpstack,  exp_nok
+    local_branch jmpstack,  test_it   # not ok
+    .return()
 
     .EXP()
   test_it:
@@ -166,18 +174,20 @@
 
 .sub 'isnull_pmc'
     .local int exp, res
+    .local pmc jmpstack
+               jmpstack = new 'ResizableIntegerArray'
     .SET_DESC('isnull pmc')
 
   init:
     $S0 = 'FUBAR'
-    bsr exp_ok
-    bsr test_it
+    local_branch jmpstack,  exp_ok
+    local_branch jmpstack,  test_it
     $S0 = 'Null' # this is a valid pmc type -- you can't trick parrot :)
-    bsr exp_nok
-    bsr test_it
+    local_branch jmpstack,  exp_nok
+    local_branch jmpstack,  test_it
     $S0 = 'Integer'
-    bsr test_it
-    .return ()
+    local_branch jmpstack,  test_it
+    .return()
 
     .EXP()
   test_it:

Modified: branches/orderedhash_revamp/t/op/comp.t
==============================================================================
--- branches/orderedhash_revamp/t/op/comp.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/comp.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,13 +1,7 @@
-#!perl
-# Copyright (C) 2001-2005, Parrot Foundation.
+#!parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 7;
-
 =head1 NAME
 
 t/op/comp.t - Conditionals
@@ -24,155 +18,150 @@
 
 # some of these were failing with JIT/i386
 
-pasm_output_is( <<'CODE', <<OUTPUT, "gt_ic_i_ic" );
-        set I0, 10
-        gt 11, I0, ok1
-        print "nok gt\n"
-ok1:
-        print "ok 1\n"
-        gt 9, I0, nok1
-        print "ok 2\n"
-        branch ok2
-nok1:
-        print "nok gt 2\n"
-ok2:
-        end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "ge_ic_i_ic" );
-        set I0, 10
-        ge 11, I0, ok1
-        print "nok ge\n"
-ok1:
-        print "ok 1\n"
-        ge 9, I0, nok1
-        print "ok 2\n"
-        branch ok2
-nok1:
-        print "nok ge 2\n"
-ok2:
-        ge 10, I0, ok3
-        print "nok ge 3\n"
-ok3:
-        print "ok 3\n"
-        end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "le_ic_i_ic" );
-        set I0, 10
-        le 9, I0, ok1
-        print "nok le\n"
-ok1:
-        print "ok 1\n"
-        le 11, I0, nok1
-        print "ok 2\n"
-        branch ok2
-nok1:
-        print "nok le 2\n"
-ok2:
-        le 10, I0, ok3
-        print "nok le 3\n"
-ok3:
-        print "ok 3\n"
-        end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "lt_ic_i_ic" );
-        set I0, 10
-        lt 9, I0, ok1
-        print "nok lt\n"
-ok1:
-        print "ok 1\n"
-        lt 10, I0, nok1
-        print "ok 2\n"
-        branch ok2
-nok1:
-        print "nok lt 2\n"
-ok2:
-        end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "eq_ic_i_ic" );
-        set I0, 10
-        eq 9, I0, nok1
-        print "ok 1\n"
-        branch ok1
-nok1:
-        print "nok eq\n"
-ok1:
-        eq 10, I0, ok2
-        print "nok eq 2\n"
-        end
-ok2:
-        print "ok 2\n"
-        eq 11, 10, nok3
-        print "ok 3\n"
-        end
-nok3:
-        print "nok 3 eq \n"
-        end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "ne_ic_i_ic" );
-        set I0, 10
-        ne 9, I0, ok1
-        print "nok 1\n"
-        branch nok1
-ok1:
-        print "ok 1\n"
-nok1:
-        ne 10, I0, nok2
-        print "ok 2\n"
-        branch ok2
-nok2:
-        print "nok 2\n"
-ok2:
-        ne 11, 10, ok3
-        print "nok 3\n"
-        end
-ok3:
-        print "ok 3\n"
-        end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "eq_num" );
-        new P0, 'Float'
-        set P0, -1.2
-        new P1, 'String'
-        set P1, "-1.2"
-        eq_num P0, P1, OK
-        print "not "
-OK:     print "ok\n"
-        end
-CODE
-ok
-OUTPUT
+.sub main :main
+    .include 'test_more.pir'
+    plan(17)
+    test_gt_ic_i_ic()
+    test_ge_ic_i_ic()
+    test_le_ic_i_ic()
+    test_lt_ic_i_ic()
+    test_eq_ic_i_ic()
+    test_ne_ic_i_ic()
+    test_eq_num()
+.end
+
+.sub test_gt_ic_i_ic
+    set $I0, 10
+    gt 11, $I0, ok1
+    ok(0, "nok gt1")
+    branch nok1
+  ok1:
+    ok(1, "ok gt1")
+  nok1:
+    gt 9, $I0, nok2
+    ok(1, "ok gt2")
+    .return()
+  nok2:
+    ok(0,"nok gt 2")
+.end
+
+.sub test_ge_ic_i_ic
+    set $I0, 10
+    ge 11, $I0, ok1
+    ok(0, "nok ge1")
+    branch nok1
+  ok1:
+    ok(1, "ok ge1")
+  nok1:
+    ge 9, $I0, nok2
+    ok(1, "ok ge2")
+    branch ok2
+  nok2:
+    ok(0, "nok ge2")
+  ok2:
+    ge 10, $I0, ok3
+    ok(0, "nok ge3")
+    .return()
+  ok3:
+    ok(1, "ok ge3")
+.end
+
+.sub test_le_ic_i_ic
+    set $I0, 10
+    le 9, $I0, ok1
+    ok(0, "nok le1")
+    branch nok1
+  ok1:
+    ok(1, "ok le1")
+  nok1:
+    le 11, $I0, nok2
+    ok(1, "ok le2")
+    branch ok2
+  nok2:
+    ok(0, "nok le2")
+  ok2:
+    le 10, $I0, ok3
+    ok(0, "nok le2")
+    .return()
+  ok3:
+    ok(1, "ok le3")
+.end
+
+.sub test_lt_ic_i_ic
+    set $I0, 10
+    lt 9, $I0, ok1
+    ok(0, "nok lt1")
+    branch nok1
+  ok1:
+    ok(1, "ok lt1")
+  nok1:
+    lt 10, $I0, nok2
+    ok(1, "ok lt2")
+    .return()
+  nok2:
+    ok(0, "nok lt2")
+.end
+
+.sub test_eq_ic_i_ic
+    set $I0, 10
+    eq 9, $I0, nok1
+    ok(1, "ok eq1")
+    branch ok1
+  nok1:
+    ok(0, "nok eq1")
+  ok1:
+    eq 10, $I0, ok2
+    ok(0, "nok eq2")
+    branch nok2
+  ok2:
+    ok(1, "ok eq2")
+  nok2:
+    eq 11, 10, nok3
+    ok(1, "ok eq3")
+    .return()
+  nok3:
+    ok(0, "nok eq3")
+.end
+
+.sub test_ne_ic_i_ic
+    set $I0, 10
+    ne 9, $I0, ok1
+    ok(0, "nok neq1")
+    branch nok1
+  ok1:
+    ok(1, "ok neq1")
+  nok1:
+    ne 10, $I0, nok2
+    ok(1, "ok neq2")
+    branch ok2
+  nok2:
+    ok(0, "nok neq2")
+  ok2:
+    ne 11, 10, ok3
+    ok(0, "nok neq2")
+    .return()
+  ok3:
+    ok(1, "ok neq3")
+.end
+
+.sub test_eq_num
+    new $P0, 'Float'
+    set $P0, -1.2
+    new $P1, 'String'
+#
+#   fix problems with g++ 4.4.1 (with --optimize) on i386 - TT #1275
+#   set $P1, "-1.2"
+    set $P1, "-1.2000000000"
+    eq_num $P0, $P1, OK
+    ok(0, "not eq_num")
+    .return()
+  OK:
+    ok(1, "eq_num")
+.end
 
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 filetype=pir:

Modified: branches/orderedhash_revamp/t/op/debuginfo.t
==============================================================================
--- branches/orderedhash_revamp/t/op/debuginfo.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/debuginfo.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -125,11 +125,6 @@
 called from Sub 'parrot;Test2;main' pc (\d+|-1) \(.*?:(\d+|-1)\)$/
 OUTPUT
 
-# RT #46895
-# in plain functional run-loop result is 999
-# other run-loops report 998
-# investigate this after interpreter strtup is done
-# see also todo item in src/embed.c
 pir_error_output_like( <<'CODE', <<'OUTPUT', "debug backtrace - recursion 1" );
 .sub main
     main()
@@ -163,16 +158,9 @@
 called from Sub 'main' pc (\d+|-1) \(.*?:(\d+|-1)\)$/
 OUTPUT
 
-$nolineno = $ENV{TEST_PROG_ARGS} =~ /--runcore=fast/
+$nolineno = $ENV{TEST_PROG_ARGS} =~ /--runcore=(fast|cgoto)/
     ? '\(\(unknown file\):-1\)' : '\(xyz.pir:126\)';
 
-#SKIP: {
-#skip "disabled on this core",2 if $ENV{TEST_PROG_ARGS} =~ /--runcore=(fast|cgoto|jit|switch)/;
-TODO: {
-    local $TODO = q|Not yet passing on 'cgoto', 'jit' or 'switch' runcores|
-        if $ENV{TEST_PROG_ARGS} =~ /--runcore=(cgoto|jit|switch)/;
-
-# See "RT #43269 and .annotate
 pir_error_output_like( <<'CODE', <<"OUTPUT", "setfile and setline" );
 .sub main :main
     setfile "xyz.pir"
@@ -185,15 +173,8 @@
 /$nolineno/
 OUTPUT
 
-} # END TODO
-
-TODO: {
-    local $TODO = q|Not yet passing on 'jit' or 'switch' runcores|
-        if $ENV{TEST_PROG_ARGS} =~ /--runcore=(jit|switch)/;
-
-$nolineno = $ENV{TEST_PROG_ARGS} =~ /--runcore=(fast|cgoto|jit|switch)/
+$nolineno = $ENV{TEST_PROG_ARGS} =~ /--runcore=(fast|cgoto)/
     ? '\(\(unknown file\):-1\)' : '\(foo.p6:128\)';
-# See "RT #43269 and .annotate
 pir_error_output_like( <<'CODE', <<"OUTPUT", "setfile and setline" );
 .sub main :main
     setfile "foo.p6"
@@ -212,8 +193,6 @@
 /$nolineno/
 OUTPUT
 
-} # END TODO
-
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4

Modified: branches/orderedhash_revamp/t/op/exceptions.t
==============================================================================
--- branches/orderedhash_revamp/t/op/exceptions.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/exceptions.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -425,7 +425,7 @@
 
 $ENV{TEST_PROG_ARGS} ||= '';
 my @todo = $ENV{TEST_PROG_ARGS} =~ /--run-pbc/
-    ? ( todo => '.tailcall and lexical maps not thawed from PBC, RT #60650' )
+    ? ( todo => '.tailcall and lexical maps not thawed from PBC, TT #1172' )
     : ();
 pir_output_is( <<'CODE', <<'OUTPUT', "exit_handler via exit exception", @todo );
 .sub main :main

Added: branches/orderedhash_revamp/t/op/exit.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/op/exit.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,72 @@
+#!perl
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+use strict;
+use warnings;
+use lib qw( . lib ../lib ../../lib );
+
+use Test::More;
+use Parrot::Test tests => 7;
+
+=head1 NAME
+
+t/op/exit.t - Testing the exit pseudo-opcode
+
+=head1 SYNOPSIS
+
+    % prove t/op/exit.t
+
+=head1 DESCRIPTION
+
+Test both success and failure exit status.
+
+=cut
+
+pir_exit_code_is( <<'CODE', 0, 'pir exit with success' );
+.sub main
+    exit 0
+.end
+CODE
+
+pir_exit_code_is( <<'CODE', 1, 'pir exit with failure' );
+.sub main
+    exit 1
+.end
+CODE
+
+pasm_exit_code_is( <<'CODE', 1, 'pasm exit with failure' );
+    exit 1
+CODE
+
+pasm_exit_code_is( <<'CODE', 0, 'pasm exit without failure' );
+    exit 0
+CODE
+
+# If you know of a better place to put these tests, please put them there
+
+pir_exit_code_is( <<'CODE', 0, 'pir exits with success by default' );
+.sub main
+    $S0 = "cheese"
+.end
+CODE
+
+TODO: {
+    local $TODO = 'pasm exits with 1 by default';
+    pasm_exit_code_is( <<'CODE', 0, 'exit with success by default' );
+        set I0, 0
+CODE
+
+}
+TODO: {
+    local $TODO = 'pbc exits with 1 by default';
+    # Should we be using this file?
+    my $pbc = File::Spec->catfile(qw/ t native_pbc integer_1.pbc /);
+    pbc_exit_code_is($pbc, 0, 'pbc exits with 0 by default');
+}
+
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Added: branches/orderedhash_revamp/t/op/fetch.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/op/fetch.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,108 @@
+#!parrot
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/op/fetch.t - the fetch opcode
+
+=head1 SYNOPSIS
+
+     % prove t/op/fetch.t
+
+=head1 DESCRIPTION
+
+Tests Parrot's experimental fetch opcode.
+
+=cut
+
+.sub 'main' :main
+    .include 'test_more.pir'
+
+    plan(17)
+
+    test_fetch_keyed_pmc()
+    test_fetch_keyed_int()
+    test_fetch_keyed_str()
+    # END_OF_TESTS
+.end
+
+.sub 'test_fetch_keyed_int'
+    diag( 'test_fetch_keyed_int' )
+    $P0    = new [ 'Hash' ]
+    $P1    = box 111
+    $P0[1] = $P1
+    $P0[3] = $P1
+
+    $P3 = fetch $P0, 1, [ 'Integer' ]
+    is( $P3, 111, 'fetch should return existing element unmodified' )
+    $P1 = 123
+    is( $P3, 123, '... the exact PMC itself' )
+
+    $P3 = fetch $P0, 3, [ 'Integer' ]
+    is( $P3, 123, '... even if stored in multiple locations' )
+
+    $P3 = fetch $P0, 2, [ 'Integer' ]
+    is( $P3, 0, 'fetch should create new PMC if not-existent' )
+    isa_ok( $P3, 'Integer', 'new PMC should have type Integer' )
+.end
+
+.sub 'test_fetch_keyed_str'
+    diag( 'test_fetch_keyed_str' )
+    $P0          = new [ 'Hash' ]
+    $P1          = box 111
+    $P0['one']   = $P1
+    $P0['three'] = $P1
+
+    $P3 = fetch $P0, 'one', [ 'Integer' ]
+    is( $P3, 111, 'fetch should return existing element unmodified' )
+    $P1 = 123
+    is( $P3, 123, '... the exact PMC itself' )
+
+    $P3 = fetch $P0, 'three', [ 'Integer' ]
+    is( $P3, 123, '... even if stored in multiple locations' )
+
+    $P3 = fetch $P0, 'two', [ 'Integer' ]
+    is( $P3, 0, 'fetch should create new PMC if not-existent' )
+    isa_ok( $P3, 'Integer', 'new PMC should have type Integer' )
+.end
+
+.sub 'test_fetch_keyed_pmc'
+    diag( 'test_fetch_keyed_pmc' )
+    $P0          = new [ 'Hash' ]
+    $P1          = box 111
+
+    .local pmc str_key
+    str_key      = box 'foo'
+    $P0[str_key] = $P1
+
+    .local pmc int_key
+    int_key      = box 435
+    $P0[int_key] = $P1
+
+    $P3          = fetch $P0, str_key, [ 'String' ]
+    is( $P3, 111, 'fetch should return existing element unmodified' )
+
+    $P1          = 123
+    is( $P3, 123, '... the exact PMC itself' )
+
+    $P3 = fetch $P0, int_key, [ 'String' ]
+    is( $P3, 123, '... even if stored in multiple locations' )
+
+    str_key = 'baz'
+    $P3 = fetch $P0, str_key, [ 'String' ]
+    is( $P3, '', 'fetch should return new PMC if keyed PMC is not there' )
+    isa_ok( $P3, 'String', 'new PMC should have given type' )
+
+    int_key = 789
+    $P3 = fetch $P0, str_key, [ 'String' ]
+    is( $P3, '', 'fetch should return new PMC if keyed PMC is not there' )
+    isa_ok( $P3, 'String', 'new PMC should have given type' )
+.end
+
+# Local Variables:
+#   mode: pir
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir :

Modified: branches/orderedhash_revamp/t/op/gc.t
==============================================================================
--- branches/orderedhash_revamp/t/op/gc.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/gc.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,20 +1,14 @@
-#!perl
-# Copyright (C) 2001-2005, Parrot Foundation.
+#! parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 18;
-
 =head1 NAME
 
-t/op/gc.t - Garbage Collection
+t/op/gc.t - Garbage collection
 
 =head1 SYNOPSIS
 
-        % prove t/op/gc.t
+    % prove t/op/gc.t
 
 =head1 DESCRIPTION
 
@@ -23,149 +17,157 @@
 
 =cut
 
-pasm_output_is( <<'CODE', '1', "sweep 1" );
-      interpinfo I1, 2   # How many GC mark runs have we done already?
-      sweep 1
-      interpinfo I2, 2   # Should be one more now
-      sub I3, I2, I1
-      print I3
-      end
-CODE
-
-pasm_output_is( <<'CODE', '0', "sweep 0" );
-      interpinfo I1, 2   # How many GC mark runs have we done already?
-      sweep 0
-      interpinfo I2, 2   # Should be same
-      sub I3, I2, I1
-      print I3
-      end
-CODE
-
-pasm_output_is( <<'CODE', '1', "sweep 0, with object that need destroy" );
-      new P0, 'Undef'
-      interpinfo I1, 2   # How many GC mark runs have we done already?
-      needs_destroy P0
-      sweep 0
-      interpinfo I2, 2   # Should be one more now
-      sub I3, I2, I1
-      print I3
-      end
-CODE
-
-pasm_output_is( <<'CODE', '10', "sweep 0, with object that need destroy/destroy" );
-      new P0, 'Undef'
-      needs_destroy P0
-      interpinfo I1, 2   # How many GC mark runs have we done already?
-      new P0, 'Undef'    # kill object
-      sweep 0
-      interpinfo I2, 2   # Should be one more now
-      sub I3, I2, I1
-      sweep 0
-      interpinfo I4, 2   # Should be same as last
-      sub I5, I4, I2
-      print I3           # These create PMCs that need early GC, so we need
-      print I5           # to put them after the second sweep op.
-      end
-CODE
-
-pasm_output_is( <<'CODE', '1', "collect" );
-      interpinfo I1, 3   # How many garbage collections have we done already?
-      collect
-      interpinfo I2, 3   # Should be one more now
-      sub I3, I2, I1
-      print I3
-      end
-CODE
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "collectoff/on" );
-      interpinfo I1, 3
-      collectoff
-      collect
-      interpinfo I2, 3
-      sub I3, I2, I1
-      print I3
-      print "\n"
-
-      collecton
-      collect
-      interpinfo I4, 3
-      sub I6, I4, I2
-      print I6
-      print "\n"
-
-      end
-CODE
-0
-1
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Nested collectoff/collecton" );
-      interpinfo I1, 3
-      collectoff
-      collectoff
-      collecton
-      collect           # This shouldn't do anything...    #'
-      interpinfo I2, 3
-      sub I3, I2, I1
-      print I3
-      print "\n"
-
-      collecton
-      collect           # ... but this should
-      interpinfo I4, 3
-      sub I6, I4, I2
-      print I6
-      print "\n"
-
-      end
-CODE
-0
-1
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "vanishing slingleton PMC" );
-_main:
-    .const 'Sub' P0 = "_rand"
-    set I16, 100
-    set I17, 0
-loop:
-    sweep 1
-    invokecc P0
-    inc I17
-    lt I17, I16, loop
-    print "ok\n"
-    end
-
-.pcc_sub _rand:
-    new P16, 'Random'
-    set I5, P16[10]
-    gt I5, 10, err
-    lt I5, 0, err
-    returncc
-err:
-    print "singleton destroyed .Random = ."
-    new P16, 'Random'
-    typeof S16, P16
-    print S16
-    print "\n"
-    end
-CODE
-ok
-OUTPUT
+.include 'interpinfo.pasm'
 
-pir_output_is( <<'CODE', <<OUTPUT, "vanishing return continuation in method calls" );
 .sub main :main
-    .local pmc o, cl
-    cl = newclass "Foo"
+    .include 'test_more.pir'
+    plan(140)
+
+    sweep_1()
+    sweep_0()
+    sweep_0_need_destroy_obj()
+    sweep_0_need_destroy_destroy_obj()
+    collect_count()
+    collect_toggle()
+    collect_toggle_nested()
+    vanishing_singleton_PMC()
+    vanishing_ret_continuation()
+    regsave_marked()
+    recursion_and_exceptions()
+    write_barrier_1()
+    write_barrier_2()
+    addr_registry_1()
+    addr_registry_2_int()
+    addr_registry_2_str()
+    pmc_proxy_obj_mark()
+    coro_context_ret_continuation()
+    # END_OF_TESTS
+
+.end
+
+.sub sweep_1
+    $I1 = interpinfo .INTERPINFO_GC_MARK_RUNS  # How many GC mark runs have we done already?
+    sweep 1
+    $I2 = interpinfo .INTERPINFO_GC_MARK_RUNS  # Should be one more now
+    $I3 = $I2 - $I1
+    is($I3,1, "sweep_1")
+.end
+
+
+.sub sweep_0
+    $I1 = interpinfo .INTERPINFO_GC_MARK_RUNS   # How many GC mark runs have we done already?
+    sweep 0
+    $I2 = interpinfo .INTERPINFO_GC_MARK_RUNS  # Should be same
+    $I3 = $I2 - $I1
+    is($I3,0, "sweep_0")
+.end
+
+
+# sweep 0, with object that needs destroy/destroy
+.sub sweep_0_need_destroy_obj
+    $P0 = new 'Undef'
+    $I1 = interpinfo .INTERPINFO_GC_MARK_RUNS   # How many GC mark runs have we done already?
+    needs_destroy $P0
+    sweep 0
+    $I2 = interpinfo .INTERPINFO_GC_MARK_RUNS   # Should be one more now
+    $I3 = $I2 - $I1
+    is($I3,1, "sweep_0_need_destroy_obj")
+.end
 
-    new o, "Foo"
-    print "ok\n"
-    end
+
+# sweep 0, with object that needs destroy/destroy
+.sub sweep_0_need_destroy_destroy_obj
+    $P0 = new 'Undef'
+    needs_destroy $P0
+    $I1 = interpinfo .INTERPINFO_GC_MARK_RUNS   # How many GC mark runs have we done already?
+    $P0 = new 'Undef'  #kill object
+    sweep 0
+    $I2 = interpinfo .INTERPINFO_GC_MARK_RUNS   # Should be one more now
+    $I3 = $I2 - $I1
+    sweep 0
+    $I4 = interpinfo .INTERPINFO_GC_MARK_RUNS   # Should be same as last
+    $I5 = $I4 - $I2
+    is($I3,1, "sweep_0_need_destroy_destroy_obj")
+    is($I5,0, "sweep_0_need_destroy_destroy_obj")
+.end
+
+
+.sub collect_count
+    $I1 = interpinfo .INTERPINFO_GC_COLLECT_RUNS   # How many garbage collections have we done already?
+    collect
+    $I2 = interpinfo .INTERPINFO_GC_COLLECT_RUNS  # Should be one more now
+    $I3 = $I2 - $I1
+    is($I3,1, "collect_count")
 .end
 
+
+.sub collect_toggle
+    $I1 = interpinfo .INTERPINFO_GC_COLLECT_RUNS
+    collectoff
+    collect
+    $I2 = interpinfo .INTERPINFO_GC_COLLECT_RUNS
+    $I3 = $I2 - $I1
+    is($I3,0, "collect_toggle")
+
+    collecton
+    collect
+    $I4 = interpinfo .INTERPINFO_GC_COLLECT_RUNS
+    $I6 = $I4 - $I2
+    is($I6,1, "collect_toggle")
+.end
+
+
+.sub collect_toggle_nested
+    $I1 = interpinfo .INTERPINFO_GC_COLLECT_RUNS
+    collectoff
+    collectoff
+    collecton
+    collect           # This shouldn't do anything...    #'
+    $I2 = interpinfo .INTERPINFO_GC_COLLECT_RUNS
+    $I3 = $I2 - $I1
+    is($I3,0, "collect_toggle_nested")
+
+    collecton
+    collect           # ... but this should
+    $I4 = interpinfo .INTERPINFO_GC_COLLECT_RUNS
+    $I6 = $I4 - $I2
+    is($I6,1, "collect_toggle_nested")
+
+.end
+
+
+.sub vanishing_singleton_PMC
+    $P16 = new 'Env'
+    $P16['Foo'] = 'bar'
+    $I16 = 100    #Why 100?
+    $I17 = 0
+
+    loop:
+	sweep 1
+    	_rand()
+    	$I17 += 1
+    	if $I17 <= $I16 goto loop
+.end
+
+.sub _rand
+    $P16 = new 'Env'
+    $P5 = $P16['Foo']
+    is($P5, 'bar', "_rand")
+    if $P5 != 'bar' goto err
+    .return()
+    err:
+	print "singleton destroyed .Env = ."
+    	$P16 = new 'Env'
+    	$S16 = typeof $P16
+    	say $S16
+.end
+# END: vanishing_singleton_PMC
+
+
+# vanishing return continuation in method calls
 .namespace ["Foo"]
 .sub init :vtable :method
-    print "init\n"
+    ok(1, "entered init()")
     sweep 1
     new $P6, 'String'
     set $P6, "hi"
@@ -177,105 +179,81 @@
     sweep 1
     inc self
     sweep 1
-    print "back from _inc\n"
+    ok(1, "leaving do_inc")
 .end
 
-.sub __increment :method
-    print "inc\n"
+.sub increment :vtable :method
+    ok(1, "in __increment")
     sweep 1
 .end
-CODE
-init
-inc
-back from _inc
-ok
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "failing if regsave is not marked" );
-    newclass P9, "Source"
-    newclass P10, "Source::Buffer"
-    new P12, "Source"
-
-    set S20, P12
-    print S20
-    set S20, P12
-    print S20
-    end
+.namespace [ ]
 
+.sub vanishing_ret_continuation
+    .local pmc o, cl
+    cl = newclass 'Foo'
+    o = new 'Foo'
+    ok(1, "end vanishing_return_continuation")
+.end
+
+# END: vanishing_return_continuation
+
+
+
+#Fail if regsave is not marked
 .namespace ["Source"]
-.pcc_sub __get_string:  # buffer
-    get_params "0", P2
-    getprop P12, "buffer", P2
+.sub get_string :method :vtable # buffer
+    $P4  = self
+    $P2 = getprop "buffer", $P4
     sweep 1
-    unless_null P12, buffer_ok
-    new P12, "Source::Buffer"
-    new P14, 'String'
-    set P14, "hello\n"
-    setprop P12, "buf", P14
-    setprop P2, "buffer", P12
+    unless_null $P2, buffer_ok
+    $P2 = new "Source::Buffer"
+    $P3 = new "String"
+    $P3 = "hello"
+    $P2 = setprop "buf", $P3
+    $P4  = setprop "buffer", $P2
 buffer_ok:
-    set_returns "0", P12
-    returncc
+    .return($P2)
+.end
 
 .namespace ["Source::Buffer"]
-.pcc_sub __get_string:
-    get_params "0", P2
+.sub get_string :method :vtable
+    $P4 = self
     sweep 1
-    getprop P12, "buf", P2
-    set S16, P12
-    set_returns "0", S16
-    returncc
-CODE
-hello
-hello
-OUTPUT
+    $P2 = getprop "buf", $P4
+    $S0 = $P2
+    .return($S0)
+.end
 
-# this is a stripped down version of imcc/t/syn/pcc_16
-# s. also src/pmc/retcontinuation.pmc
-pasm_output_is( <<'CODE', <<OUTPUT, "coro context and invalid return continuations" );
-.pcc_sub main:
-    .const 'Sub' P0 = "co1"
-    set I20, 0
-l:
-    get_results ''
-    set_args ''
-    invokecc P0
-    inc I20
-    lt I20, 3, l
-    print "done\n"
-    end
-.pcc_sub co1:
-    get_params ''
-    set P17, P1
-col:
-    print "coro\n"
-    sweep 1
-    yield
-    branch col
+.namespace [ ]
 
-CODE
-coro
-coro
-coro
-done
-OUTPUT
+.sub regsave_marked
+    $P0  = newclass "Source"
+    $P1 = newclass "Source::Buffer"
+    $P2 = new "Source"
 
-pir_output_is( <<'CODE', <<OUTPUT, "Recursion and exceptions" );
+    $S1 = $P2
+    is($S1, "hello")
 
-# this did segfault with GC_DEBUG
+    $S1 = $P2        #why are we doing this twice?
+    is($S1, "hello")
+.end
 
-.sub main :main
+# end regsave_marked()
+
+
+# Recursion and exceptions
+# NOTE: this did segfault with GC_DEBUG
+.sub recursion_and_exceptions
     .local pmc n
     $P0 = getinterp
     $P0."recursion_limit"(10)
-    newclass $P0, "b"
+    $P0 = newclass "b"
     $P0 = new "b"
     $P1 = new 'Integer'
     $P1 = 0
     n = $P0."b11"($P1)
-    print "ok 1\n"
-    print n
-    print "\n"
+    ok(1, "recursion_and_exceptions")
+    is(n,8, "recursion_and_exceptions")
 .end
 .namespace ["b"]
 .sub b11 :method
@@ -285,7 +263,8 @@
     # store_lex -1, "n", n
     n1 = new 'Integer'
     n1 = n + 1
-    push_eh catch
+    push_eh catch    # we're going to catch an exception when recursion_depth
+                     # is too large
     n = self."b11"(n1)
     # store_lex -1, "n", n
     pop_eh
@@ -293,233 +272,176 @@
     # n = find_lex "n"
     .return(n)
 .end
-CODE
-ok 1
-9
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "write barrier 1" );
-    null I2
-    set I3, 100
+.namespace [ ]
+
+# write barrier 1
+.sub write_barrier_1
+    null $I2
+    $I3 = 100
 lp3:
-    null I0
-    set I1, 1000
-    new P1, 'ResizablePMCArray'
+    null $I0
+    $I1 = 1000
+    $P1 = new 'ResizablePMCArray'
 lp1:
-    new P2, 'ResizablePMCArray'
-    new P0, 'Integer'
-    set P0, I0
-    set P2[0], P0
-    set P1[I0], P2
-    if I0, not_0
-    needs_destroy P0
-    # force marking past P2[0]
+    $P2 = new 'ResizablePMCArray'
+    $P0 = new 'Integer'
+    $P0 = $I0
+    $P2[0] = $P0
+    $P1[$I0] = $P2
+    if $I0, not_0
+    needs_destroy $P0
+    # force marking past $P2[0]
     sweep 0
 not_0:
-    new P3, 'Undef'
-    new P4, 'Undef'
-    inc I0
-    lt I0, I1, lp1
+    $P3 = new 'Undef'
+    $P4 = new 'Undef'
+    inc $I0
+    lt $I0, $I1, lp1
 
-    null I0
+    null $I0
     # trace 1
 lp2:
-    set P2, P1[I0]
-    set P2, P2[0]
-    eq P2, I0, ok
+    $P2 = $P1[$I0]
+    $P2 = $P2[0]
+    eq $P2, $I0, ok
     print "nok\n"
     print "I0: "
-    print I0
+    print $I0
     print " P2: "
-    print P2
+    print $P2
     print " type: "
-    typeof S0, P2
-    print S0
+    $S0 = typeof $P2
+    print $S0
     print " I2: "
-    print I2
+    print $I2
     print "\n"
     exit 1
 ok:
-    inc I0
-    lt I0, I1, lp2
-    inc I2
-    lt I2, I3, lp3
-    print "ok\n"
-    end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "write barrier 2 - hash" );
-    null I2
-    set I3, 100
+    inc $I0
+    lt $I0, $I1, lp2
+    inc $I2
+    lt $I2, $I3, lp3
+    ok(1, "leaving write_barrier_1")
+.end
+
+
+# write barrier 2 - hash
+.sub write_barrier_2
+    null $I2
+    $I3 = 100
 lp3:
-    null I0
-    set I1, 100
-    new P1, 'Hash'
+    null $I0
+    $I1 = 100
+    $P1 = new 'Hash'
 lp1:
-    new P2, 'Hash'
-    new P0, 'Integer'
-    set P0, I0
-    set S0, I0
-    set P2["first"], P0
-    set P1[S0], P2
-    if I0, not_0
-    new P0, 'Integer'
-    needs_destroy P0
-    null P0
+    $P2 = new 'Hash'
+    $P0 = new 'Integer'
+    $P0 = $I0
+    $S0 = $I0
+    $P2["first"] = $P0
+    $P1[$S0] = $P2
+    if $I0, not_0
+    $P0 = new 'Integer'
+    needs_destroy $P0
+    null $P0
     # force full sweep
     sweep 0
 not_0:
-    new P3, 'Undef'
-    new P4, 'Undef'
-    inc I0
-    lt I0, I1, lp1
+    $P3 = new 'Undef'
+    $P4 = new 'Undef'
+    inc $I0
+    lt $I0, $I1, lp1
 
-    null I0
+    null $I0
     # trace 1
 lp2:
-    set S0, I0
-    set P2, P1[S0]
-    set P2, P2["first"]
-    eq P2, I0, ok
+    $S0 = $I0
+    $P2 = $P1[$S0]
+    $P2 = $P2["first"]
+    eq $P2, $I0, ok
     print "nok\n"
     print "I0: "
-    print I0
+    print $I0
     print " P2: "
-    print P2
+    print $P2
     print " type: "
-    typeof S0, P2
-    print S0
+    $S0 = typeof $P2
+    print $S0
     print " I2: "
-    print I2
+    print $I2
     print "\n"
     exit 1
 ok:
-    inc I0
-    lt I0, I1, lp2
-    inc I2
-    lt I2, I3, lp3
-    print "ok\n"
-    end
-CODE
-ok
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', "verify pmc proxy object marking" );
-.sub main :main
-    .local pmc cl, s, t
-    cl = subclass "String", "X"
-    addattribute cl, "o3"
-    addattribute cl, "o4"
-    s = new "X"
-    $P0 = new 'String'
-    $S0 = "ok" . " 3\n"
-    $P0 = $S0
-    setattribute s, "o3", $P0
-    $P0 = new 'String'
-    $S0 = "ok" . " 4\n"
-    $P0 = $S0
-    setattribute s, "o4", $P0
-    null $P0
-    null $S0
-    null cl
-    sweep 1
-    s = "ok 1\n"
-    print s
-    .local int i
-    i = 0
-lp:
-    t = new "X"
-    inc i
-    if i < 1000 goto lp
-    t = "ok 2\n"
-    print s
-    print t
-    $P0 = getattribute s, "o3"
-    print $P0
-    $P0 = getattribute s, "o4"
-    print $P0
+    inc $I0
+    lt $I0, $I1, lp2
+    inc $I2
+    lt $I2, $I3, lp3
+    ok(1, "leaving write_barrier_2")
 .end
-CODE
-ok 1
-ok 1
-ok 2
-ok 3
-ok 4
-OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', "AddrRegistry 1" );
-.sub main :main
+
+
+# AddrRegistry 1
+.sub addr_registry_1
     .local pmc a, reg, nil
     reg = new 'AddrRegistry'
     a = new 'String'
     null nil
     $I0 = reg[a]
     if $I0 == 0 goto ok1
-    print "not "
+    notok(1)
 ok1:
-    print "ok 1\n"
+    ok(1, "ok 1")
     reg[a] = nil
     $I0 = reg[a]
     if $I0 == 1 goto ok2
-    print "not "
+    notok(1)
 ok2:
-    print "ok 2\n"
+    ok(1, "ok 2")
     reg[a] = nil
     $I0 = reg[a]
     if $I0 == 2 goto ok3
-    print "not "
+    notok(1)
 ok3:
-    print "ok 3\n"
-
+    ok(1, "ok 3")
     delete reg[a]
     $I0 = reg[a]
     if $I0 == 1 goto ok4
-    print "not "
+    notok(1)
 ok4:
-    print "ok 4\n"
+    ok(1, "ok 4")
     delete reg[a]
     $I0 = reg[a]
     if $I0 == 0 goto ok5
-    print "not "
+    notok(1)
 ok5:
-    print "ok 5\n"
+    ok(1, "ok 5")
 .end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-ok 5
-OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', "AddrRegistry 2" );
-.sub main :main
+
+# AddrRegistry 2
+.sub addr_registry_2_int
     .local pmc a, b, reg, nil
     null nil
     reg = new 'AddrRegistry'
     a = new 'String'
     b = new 'String'
     $I0 = elements reg
-    print $I0
+    is($I0, 0, "addr_registry_2_int")
     reg[a] = nil
     $I0 = elements reg
-    print $I0
+    is($I0, 1, "addr_registry_2_int")
     reg[a] = nil
     $I0 = elements reg
-    print $I0
+    is($I0, 1, "addr_registry_2_int")
     reg[b] = nil
     $I0 = elements reg
-    print $I0
-    print "\n"
+    is($I0, 2, "addr_registry_2_int")
 .end
-CODE
-0112
-OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', "AddrRegistry 2" );
-.sub main :main
+
+# AddrRegistry 2
+.sub addr_registry_2_str
     .local pmc a, b, c, reg, nil, it
     null nil
     reg = new 'AddrRegistry'
@@ -544,12 +466,71 @@
 done:
     $P1.'sort'()
     $S1 = join '', $P1
-    print $S1
-    print "\n"
+    is($S1, 'k1k2k3')
+.end
+
+# verify pmc proxy object marking
+.sub pmc_proxy_obj_mark
+    .local pmc cl, s, t
+    cl = subclass "String", "X"
+    addattribute cl, "o3"
+    addattribute cl, "o4"
+    s = new "X"
+    $P0 = new 'String'
+    $S0 = "ok" . " 3"
+    $P0 = $S0
+    setattribute s, "o3", $P0
+    $P0 = new 'String'
+    $S0 = "ok" . " 4"
+    $P0 = $S0
+    setattribute s, "o4", $P0
+    null $P0
+    null $S0
+    null cl
+    sweep 1
+    s = "ok 1"
+    is(s, "ok 1")
+    .local int i
+    i = 0
+lp:
+    t = new "X"
+    inc i
+    if i < 1000 goto lp
+    t = "ok 2"
+    is(s, "ok 1")
+    is(t, "ok 2")
+    $P0 = getattribute s, "o3"
+    is($P0, "ok 3")
+    $P0 = getattribute s, "o4"
+    is($P0, "ok 4")
+.end
+
+
+# coro context and invalid return continuations
+# this is a stripped down version of imcc/t/syn/pcc_16
+# s. also src/pmc/retcontinuation.pmc
+
+.sub coro_context_ret_continuation
+    .const 'Sub' $P0 = "co1"
+    $I20 = 0
+l:
+    get_results ''
+    set_args ''
+    invokecc $P0
+    inc $I20
+    lt $I20, 3, l
+    ok(1, "done\n")
+.end
+
+.sub co1
+    get_params ''
+    $P17 = $P1
+col:
+    ok(1, "coro\n")
+    sweep 1
+    yield
+    branch col
 .end
-CODE
-k1k2k3
-OUTPUT
 
 =head1 SEE ALSO
 
@@ -560,11 +541,9 @@
 F<examples/benchmarks/primes2.c>,
 F<examples/benchmarks/primes2.py>.
 
-=cut
-
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 filetype=pir:

Deleted: branches/orderedhash_revamp/t/op/hacks.t
==============================================================================
--- branches/orderedhash_revamp/t/op/hacks.t	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,86 +0,0 @@
-#!perl
-# Copyright (C) 2001-2008, Parrot Foundation.
-# $Id$
-
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 2;
-use Parrot::Config;
-use Config;
-
-=head1 NAME
-
-t/op/hacks.t - IO Ops
-
-=head1 SYNOPSIS
-
-        % prove t/op/hacks.t
-
-=head1 DESCRIPTION
-
-Tests basic file IO operations.
-
-=cut
-
-sub has_signal {
-    my $sig = shift;
-    foreach my $name ( split( ' ', $Config{sig_name} ) ) {
-        return 1 if ( "SIG$name" eq $sig );
-    }
-    return 0;
-}
-
-SKIP: {
-    skip( "no universal SIGFPE handling", 2 );
-
-    pasm_output_is( <<'CODE', <<OUT, "catch a SIGFPE" );
-    push_eh _handler
-    div I10, 0
-    print "not reached\n"
-    end
-_handler:
-    print "catched it\n"
-    set I0, P5["type"]
-    print "error "
-    print I0
-    print "\n"
-    set I0, P5
-    print "severity "
-    print I0
-    print "\n"
-    end
-# SIGFPE = 8
-CODE
-catched it
-error -8
-severity 0
-OUT
-
-    pasm_output_is( <<'CODE', <<OUT, "catch a SIGFPE 2" );
-    push_eh _handler
-    div I10, 0
-    print "not reached\n"
-    end
-_handler:
-.include "signal.pasm"
-    print "catched it\n"
-    set I0, P5["type"]
-    neg I0, I0
-    ne I0, .SIGFPE, nok
-    print "ok\n"
-nok:
-    end
-CODE
-catched it
-ok
-OUT
-}
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:

Added: branches/orderedhash_revamp/t/op/inf_nan.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/op/inf_nan.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,507 @@
+#! parrot
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/op/inf_nan.t - Test math properties of Inf and NaN
+
+=head1 SYNOPSIS
+
+    % prove t/op/inf_nan.t
+
+=head1 DESCRIPTION
+
+Tests for mathematical operations with Inf and Nan.
+
+=cut
+
+.sub main :main
+    .include 'test_more.pir'
+    plan(105)
+
+    test_basic_arith()
+    test_exp()
+    test_sqrt()
+    test_sin()
+    test_sinh()
+    test_asin()
+    test_cos()
+    test_cosh()
+    test_acos()
+    test_tan()
+    test_tanh()
+    test_atan()
+    test_cot()
+    test_coth()
+    test_acot()
+    test_sec()
+    test_sech()
+    test_asec()
+    test_ln()
+    test_log10()
+    test_log2()
+    test_neg()
+    test_pow()
+    test_mix_nan_inf()
+    test_rounding_n()
+    test_rounding_i()
+    test_nan_complex()
+    test_fdiv_integer_pmc_nan()
+    test_fdiv_float_pmc_nan()
+    test_fdiv_float_integer_pmc_nan()
+    test_cmod_float_integer_pmc_nan()
+    test_mod_float_integer_pmc_nan()
+
+.end
+
+.sub test_basic_arith
+    $N0 = 'Inf'
+    is($N0, 'Inf', 'basic arithmetic: =')
+    $N0 -= $N0
+    is($N0, 'NaN', '... -=')
+    $N0 *= -1
+    is($N0, 'NaN', '... *= -1')
+    $N0 *= 0
+    is($N0, 'NaN', '... *= 0')
+    $N0 += 5
+    is($N0, 'NaN', '... += 5')
+    $N0 -= 42
+    is($N0, 'NaN', '... -= 42')
+    inc $N0
+    is($N0, 'NaN', '... inc')
+    dec $N0
+    is($N0, 'NaN', '... dec')
+    $N2 = abs $N0
+    is($N2, 'NaN', '... abs NaN')
+    $N1 = 'Inf'
+    $N3 = abs $N1
+    is($N3, 'Inf', '... abs Inf')
+    $N1 = '-Inf'
+    $N3 = abs $N1
+    is($N3, 'Inf', '... abs -Inf')
+.end
+
+
+.sub test_exp
+    $N0 = 'Inf'
+    $N1 = exp $N0
+    is($N1, 'Inf', 'exp: exp Inf')
+    $N0 = '-Inf'
+    $N1 = exp $N0
+    is($N1, 0, '... exp -Inf')
+    $N0 = 'NaN'
+    $N1 = exp $N0
+    is($N1, 'NaN', '... exp NaN')
+.end
+
+.sub test_sqrt
+    $N0 = 'Inf'
+    $N1 =  $N0
+    is($N1, 'Inf', 'sqrt: assignment')
+    $N0 = '-Inf'
+    $N1 = sqrt $N0
+    is($N1, 'NaN', '... sqrt -Inf')
+    $N0 = 'NaN'
+    $N1 = sqrt $N0
+    is($N1, 'NaN', '... sqrt NaN')
+    $N0 = -1
+    $N1 = sqrt $N0
+    is($N1, 'NaN', '... sqrt -1')
+.end
+
+.sub test_sin
+    $N0 = 'Inf'
+    $N1 = sin $N0
+    is($N1, 'NaN', 'sin: sin Inf')
+    $N0 = '-Inf'
+    $N1 = sin $N0
+    is($N1, 'NaN', '... sin -Inf')
+    $N0 = 'NaN'
+    $N1 = sin $N0
+    is($N1, 'NaN', '... sin NaN')
+.end
+
+.sub test_sinh
+    $N0 = 'Inf'
+    $N1 = sinh $N0
+    is($N1, 'Inf', 'sinh: sinh Inf')
+    $N0 = '-Inf'
+    $N1 = sinh $N0
+    is($N1, '-Inf', '... sinh -Inf')
+    $N0 = 'NaN'
+    $N1 = sinh $N0
+    is($N1, 'NaN', '... sinh NaN')
+.end
+
+.sub test_asin
+    $N0 = 'Inf'
+    $N1 = asin $N0
+    is($N1, 'NaN', 'asin: asin Inf')
+    $N0 = '-Inf'
+    $N1 = asin $N0
+    is($N1, 'NaN', '... asin -Inf')
+    $N0 = 'NaN'
+    $N1 = asin $N0
+    is($N1, 'NaN', '... asin NaN')
+    $N0 = '-2'
+    $N1 = asin $N0
+    is($N1, 'NaN', '... asin -2')
+    $N0 = '2'
+    $N1 = asin $N0
+    is($N1, 'NaN', '... asin 2')
+.end
+
+.sub test_cos
+    $N0 = 'Inf'
+    $N1 = cos $N0
+    is($N1, 'NaN', 'cos: cos Inf')
+    $N0 = '-Inf'
+    $N1 = cos $N0
+    is($N1, 'NaN', '... cos -Inf')
+    $N0 = 'NaN'
+    $N1 = cos $N0
+    is($N1, 'NaN', '... cos NaN')
+.end
+
+.sub test_cosh
+    $N0 = 'Inf'
+    $N1 = cosh $N0
+    is($N1, 'Inf', 'cosh: cosh Inf')
+    $N0 = '-Inf'
+    $N1 = cosh $N0
+    is($N1, 'Inf', '... cosh -Inf')
+    $N0 = 'NaN'
+    $N1 = cosh $N0
+    is($N1, 'NaN', '... cosh NaN')
+.end
+
+.sub test_acos
+    $N0 = 'Inf'
+    $N1 = acos $N0
+    is($N1, 'NaN', 'acos: acos Inf')
+    $N0 = '-Inf'
+    $N1 = acos $N0
+    is($N1, 'NaN', '... acos -Inf')
+    $N0 = 'NaN'
+    $N1 = acos $N0
+    is($N1, 'NaN', '... acos NaN')
+    $N0 = '-2'
+    $N1 = acos $N0
+    is($N1, 'NaN', '... acos -2')
+    $N0 = '2'
+    $N1 = acos $N0
+    is($N1, 'NaN', '... acos 2')
+.end
+
+.sub test_tan
+    $N0 = 'Inf'
+    $N1 = tan $N0
+    is($N1, 'NaN', 'tan: tan Inf')
+    $N0 = '-Inf'
+    $N1 = tan $N0
+    is($N1, 'NaN', '... tan -Inf')
+    $N0 = 'NaN'
+    $N1 = tan $N0
+    is($N1, 'NaN', '... tan NaN')
+.end
+
+.sub test_tanh
+    $N0 = 'Inf'
+    $N1 = tanh $N0
+    is($N1, 1, 'tanh: tanh Inf')
+    $N0 = '-Inf'
+    $N1 = tanh $N0
+    is($N1, -1, '... tanh -Inf')
+    $N0 = 'NaN'
+    $N1 = tanh $N0
+    is($N1, 'NaN', '... tanh NaN')
+.end
+
+.sub test_atan
+    $N0 = 'Inf'
+    $N1 = atan $N0
+    $P1 = new 'Float'
+    $P1 = $N1
+    is($P1, 1.5707963, 'atan: atan Inf',1e-6)
+
+    $N0 = '-Inf'
+    $N1 = atan $N0
+    $P1 = new 'Float'
+    $P1 = $N1
+    is($P1, -1.5707963, '... atan -Inf',1e-6)
+
+    $N0 = 'NaN'
+    $N1 = atan $N0
+    is($N1, 'NaN', '... atan NaN')
+.end
+
+.sub test_cot
+    $N0 = 'Inf'
+    #$N1 = cot $N0
+    #is($N1, 'NaN', 'cot: cot Inf')
+    todo(0, 'cot Inf', 'cot/coth/acot not implemented for real numbers')
+    $N0 = '-Inf'
+    #$N1 = cot $N0
+    #is($N1, 'NaN', '... cot -Inf')
+    todo(0, 'cot -Inf', 'cot/coth/acot not implemented for real numbers')
+    $N0 = 'NaN'
+    #$N1 = cot $N0
+    #is($N1, 'NaN', '... cot NaN')
+    todo(0, 'cot NaN', 'cot/coth/acot not implemented for real numbers')
+.end
+
+.sub test_coth
+    $N0 = 'Inf'
+    #$N1 = coth $N0
+    #is($N1, 1, 'coth: coth Inf')
+    todo(0, 'coth Inf', 'cot/coth/acot not implemented for real numbers')
+    $N0 = '-Inf'
+    #$N1 = coth $N0
+    #is($N1, -1, '... coth -Inf')
+    todo(0, 'coth -Inf', 'cot/coth/acot not implemented for real numbers')
+    $N0 = 'NaN'
+    #$N1 = coth $N0
+    #is($N1, 'NaN', '... coth NaN')
+    todo(0, 'coth NaN', 'cot/coth/acot not implemented for real numbers')
+.end
+
+.sub test_acot
+    $N0 = 'Inf'
+    #$N1 = acot $N0
+    #is($N1, 'NaN', 'acot: acot Inf')
+    todo(0, 'acot Inf', 'cot/coth/acot not implemented for real numbers')
+    $N0 = '-Inf'
+    #$N1 = acot $N0
+    #is($N1, 'NaN', '... acot -Inf')
+    todo(0, 'acot -Inf', 'cot/coth/acot not implemented for real numbers')
+    $N0 = 'NaN'
+    #$N1 = acot $N0
+    #is($N1, 'NaN', '... acot NaN')
+    todo(0, 'acot NaN', 'cot/coth/acot not implemented for real numbers')
+    $N0 = '-2'
+    #$N1 = acot $N0
+    #is($N1, 'NaN', '... acot -2')
+    todo(0, 'acot -2', 'cot/coth/acot not implemented for real numbers')
+    $N0 = '2'
+    #$N1 = acot $N0
+    #is($N1, 'NaN', '... acot 2')
+    todo(0, 'acot 2', 'cot/coth/acot not implemented for real numbers')
+.end
+
+.sub test_sec
+    $N0 = 'Inf'
+    $N1 = sec $N0
+    is($N1, 'NaN', 'sec: sec Inf')
+    $N0 = '-Inf'
+    $N1 = sec $N0
+    is($N1, 'NaN', '... sec -Inf')
+    $N0 = 'NaN'
+    $N1 = sec $N0
+    is($N1, 'NaN', '... sec NaN')
+.end
+
+.sub test_sech
+    $N0 = 'Inf'
+    $N1 = sech $N0
+    is($N1, 0, 'sech: sech Inf')
+    $N0 = '-Inf'
+    $N1 = sech $N0
+    is($N1, 0, '... sech -Inf')
+    $N0 = 'NaN'
+    $N1 = sech $N0
+    is($N1, 'NaN', '... sech NaN')
+.end
+
+.sub test_asec
+    $N0 = 'Inf'
+    $N1 = asec $N0
+    $P1 = new 'Float'
+    $P1 = $N1
+    is($P1, 1.5707963, 'asec: asec Inf',1e-6)
+    $N0 = '-Inf'
+    $N1 = asec $N0
+    $P1 = $N1
+    is($P1, 1.5707963, '... asec -Inf',1e-6)
+    $N0 = 'NaN'
+    $N1 = asec $N0
+    is($N1, 'NaN', 'asec NaN')
+.end
+
+.sub test_ln
+    $N0 = 'Inf'
+    $N1 = ln $N0
+    is($N1, 'Inf', 'ln: ln Inf')
+    $N0 = '-Inf'
+    $N1 = ln $N0
+    is($N1, 'NaN', '... ln Inf')
+    $N0 = 'NaN'
+    $N1 = ln $N0
+    is($N1, 'NaN', '... ln NaN')
+.end
+
+.sub test_log10
+    $N0 = 'Inf'
+    $N1 = log10 $N0
+    is($N1, 'Inf', 'log10: log10 Inf')
+    $N0 = '-Inf'
+    $N1 = log10 $N0
+    is($N1, 'NaN', '... log10 -Inf')
+    $N0 = 'NaN'
+    $N1 = log10 $N0
+    is($N1, 'NaN', '... log10 NaN')
+.end
+
+.sub test_log2
+    $N0 = 'Inf'
+    $N1 = log2 $N0
+    is($N1, 'Inf', 'log2: log2 Inf')
+    $N0 = '-Inf'
+    $N1 = log2 $N0
+    is($N1, 'NaN', '... log2 -Inf')
+    $N0 = 'NaN'
+    $N1 = log2 $N0
+    is($N1, 'NaN', '... log2 -Inf')
+.end
+
+.sub test_neg
+    $N0 = 'Inf'
+    $N1 = neg $N0
+    is($N1, '-Inf', 'negative: neg Inf')
+    $N0 = '-Inf'
+    $N1 = neg $N0
+    is($N1, 'Inf', '... neg -Inf')
+    $N0 = 'NaN'
+    $N1 = neg $N0
+    is($N1, 'NaN', '... neg NaN')
+.end
+
+.sub test_pow
+    $N0 = 'Inf'
+    pow $N1, $N0, 2
+    is($N1, 'Inf', 'pow: Inf ^ 2')
+    pow $N1, 2, $N0
+    is($N1, 'Inf', '...: 2 ^ Inf')
+    $N0 = 'NaN'
+    pow $N1, $N0, 2
+    is($N1, 'NaN', '...: NaN ^ 2')
+    pow $N1, 2, $N0
+    is($N1, 'NaN', '...: 2 ^ NaN')
+.end
+
+.sub test_mix_nan_inf
+    $N0 = 'NaN'
+    $N1 = 'Inf'
+    $N0 *= $N1
+    is($N0, 'NaN', 'mixing NaN and Inf: NaN * Inf')
+    $N0 /= $N1
+    is($N0, 'NaN', '... NaN / Inf')
+    $N0 -= $N1
+    is($N0, 'NaN', '... NaN - Inf')
+    $N0 += $N1
+    is($N0, 'NaN', '... NaN + Inf')
+.end
+
+.sub test_rounding_n
+    $N0 = 'NaN'
+    $N1 = floor $N0
+    is($N1, 'NaN', 'rounding n: floor NaN')
+    $N2 = ceil $N0
+    is($N2, 'NaN', '... ceil NaN')
+    $N0 = 'Inf'
+    $N1 = floor $N0
+    is($N1, 'Inf', '... floor Inf')
+    $N2 = ceil $N0
+    is($N2, 'Inf', '... ceil Inf')
+    $N0 = '-Inf'
+    $N1 = floor $N0
+    is($N1, '-Inf', '... floor -Inf')
+    $N2 = ceil $N0
+    is($N2, '-Inf', '... ceil -Inf')
+.end
+
+#pir_output_is(<<'CODE',<<OUTPUT, "TT #370 Rounding inf/nan");
+.sub test_rounding_i
+    $N0 = 'Inf'
+    $I0 = floor $N0
+    #is($I0, 'Inf', 'floor Inf')
+    todo(0, 'floor Inf', 'rounding nan/inf gives something like -2147483648')
+    $N0 = 'NaN'
+    $I0 = floor $N0
+    #is($I0, 'NaN', 'floor Inf')
+    todo(0, 'floor NaN', 'rounding nan/inf gives something like -2147483648')
+    $N0 = 'Inf'
+    $I0 = ceil $N0
+    #is($I0, 'Inf', 'floor Inf')
+    todo(0, 'ceil Inf', 'rounding nan/inf gives something like -2147483648')
+    $N0 = 'NaN'
+    $I0 = ceil $N0
+    #is($I0, 'NaN', 'floor Inf')
+    todo(0, 'ceil NaN', 'rounding nan/inf gives something like -2147483648')
+.end
+
+.sub test_nan_complex
+    $P1 = new ["Complex"]
+    $N0 = 'NaN'
+    set $P1, "1 + i"
+    $P1 += $N0
+    #is($P1, 'NaN', '1+i + NaN')
+    todo(0, '1+i + NaN should be NaN')
+.end
+
+.sub test_fdiv_integer_pmc_nan
+    $P1 = new "Integer"
+    $P2 = new "Integer"
+    $P2 = 1
+    $N0 = 'NaN'
+    fdiv $P1, $P2, $N0
+    #is($P1, 'NaN', 'fdiv with Integer PMCs and NaN')
+    todo(0, 'fdiv with Integer PMCs and NaN', 'fdiv/mod/cmod do not play nicely with PMCs and NaN')
+.end
+
+.sub test_fdiv_float_pmc_nan
+    $P1 = new 'Float'
+    $P2 = new 'Float'
+    $P2 = 1
+    $N0 = 'NaN'
+    fdiv $P1, $P2, $N0
+    #is($P1, 'NaN','fdiv with Float PMCs and NaN')
+    todo(0,'fdiv with Float PMCs and NaN', 'fdiv/mod/cmod do not play nicely with PMCs and NaN')
+.end
+
+.sub test_fdiv_float_integer_pmc_nan
+    $P1 = new 'Float'
+    $P2 = new 'Integer'
+    $P2 = 1
+    $N0 = 'NaN'
+    fdiv $P1, $P2, $N0
+    #is($P1, 'NaN', 'fdiv with Float and Integer PMCs and NaN')
+    todo(0, 'fdiv with Float and Integer PMCs and NaN', 'fdiv/mod/cmod do not play nicely with PMCs and NaN')
+.end
+
+.sub test_cmod_float_integer_pmc_nan
+    $P1 = new 'Float'
+    $P2 = new 'Integer'
+    $P2 = 1
+    $N0 = 'NaN'
+    cmod $P1, $P2, $N0
+    #is($P1, 'NaN', 'cmod with Float and Integer PMCs and NaN')
+    todo(0, 'cmod with Float and Integer PMCs and NaN', 'fdiv/mod/cmod do not play nicely with PMCs and NaN')
+.end
+
+.sub test_mod_float_integer_pmc_nan
+    $P1 = new 'Float'
+    $P2 = new 'Integer'
+    $P2 = 1
+    $N0 = 'NaN'
+    mod $P1, $P2, $N0
+    #is($P1, 'NaN', 'mod with Float and Integer PMCs and NaN')
+    todo(0, 'mod with Float and Integer PMCs and NaN', 'fdiv/mod/cmod do not play nicely with PMCs and NaN')
+.end
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 filetype=pir:

Modified: branches/orderedhash_revamp/t/op/interp.t
==============================================================================
--- branches/orderedhash_revamp/t/op/interp.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/interp.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -24,26 +24,23 @@
 
 =cut
 
-SKIP: {
-    skip( "we really shouldn't run just a label - use a sub", 1 );
-
-    pasm_output_is( <<'CODE', <<'OUTPUT', "runinterp - new style" );
+# we probably shouldn't just run a label, but this catches a potential seggie
+pasm_output_is( <<'CODE', <<'OUTPUT', "runinterp - new style" );
     new P0, 'ParrotInterpreter'
-    print "calling\n"
+    say 'calling'
     # set_addr/invoke ?
     runinterp P0, foo
-    print "ending\n"
+    say 'ending'
     end
-    print "bad things!\n"
+    say 'bad things!'
   foo:
-    print "In 2\n"
+    say 'In 2'
     end
 CODE
 calling
 In 2
 ending
 OUTPUT
-}
 
 pir_output_is( <<'CODE', <<'OUTPUT', 'runinterp - works with printing' );
 .sub 'test' :main
@@ -89,8 +86,6 @@
 ok\s2\n$/x
 OUTPUT
 
-# This is the behavior as of Parrot 0.4.3
-# RT #46819 Should there be a warning?
 pasm_output_is( <<'CODE', 'nada:', 'interp - warnings' );
     new P0, 'Undef'
     set I0, P0
@@ -162,9 +157,6 @@
     if $I0 == .PARROT_SWITCH_CORE     goto ok1
     if $I0 == .PARROT_CGOTO_CORE      goto ok1
     if $I0 == .PARROT_CGP_CORE        goto ok1
-    if $I0 == .PARROT_JIT_CORE        goto ok1
-    if $I0 == .PARROT_SWITCH_JIT_CORE goto ok1
-    if $I0 == .PARROT_CGP_JIT_CORE    goto ok1
     if $I0 == .PARROT_EXEC_CORE       goto ok1
     if $I0 == .PARROT_GC_DEBUG_CORE   goto ok1
     print 'not '
@@ -183,7 +175,6 @@
 ok 2
 OUTPUT
 
-
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4

Modified: branches/orderedhash_revamp/t/op/io.t
==============================================================================
--- branches/orderedhash_revamp/t/op/io.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/io.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -52,27 +52,21 @@
 .end
 
 .sub 'tt661_todo_test' :anon
-    # Checks whether the platform is linux, MSWin32, darwin: on other
-    # platforms, the following tests are todo'ed.
+    # As of r41963, these tests need to be todo'ed at least on Win32. Add new
+    # platforms known to fail.
     .include 'sysinfo.pasm'
     $S0 = sysinfo .SYSINFO_PARROT_OS
-    if $S0 == 'linux' goto tt661_ok
-    if $S0 == 'MSWin32' goto tt661_ok
-    if $S0 == 'darwin' goto tt661_ok
-    if $S0 == 'openbsd' goto tt661_ok
+    if $S0 == 'MSWin32' goto tt661_todo
 
     .return (0)
 
-  tt661_ok:
+  tt661_todo:
     .return (1)
 .end
 
 .include 'iglobals.pasm'
 
 .sub 'open_pipe_for_reading'
-    $I0 = tt661_todo_test()
-    unless $I0 goto open_pipe_for_reading_todoed
-
     .local pmc interp
     interp = getinterp
 
@@ -96,21 +90,18 @@
     unless pipe goto open_pipe_for_reading_failed
     .local string line
     line = readline pipe
-    like('This is Parrot', ":s This is Parrot", 'open pipe for reading')
+    line = substr line, 0, 14
+    is('This is Parrot', line, 'open pipe for reading')
     .return ()
 
   open_pipe_for_reading_failed:
     nok(1, 'open pipe for reading')
     .return ()
-
-  open_pipe_for_reading_todoed:
-    todo(1, 'Unimplemented in this platform, TT #661')
 .end
 
 .sub 'open_pipe_for_writing'
     $I0 = tt661_todo_test()
-    unless $I0 goto open_pipe_for_writing_todoed
-
+    if $I0 goto open_pipe_for_writing_todoed
     .local pmc interp
     interp = getinterp
 
@@ -145,7 +136,8 @@
     .return ()
 
   open_pipe_for_writing_todoed:
-    todo(1, 'Unimplemented in this platform, TT #661')
+    todo(0, 'Unimplemented in this platform, TT #661')
+
 .end
 
 # Local Variables:

Modified: branches/orderedhash_revamp/t/op/jit.t
==============================================================================
--- branches/orderedhash_revamp/t/op/jit.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/jit.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -6,7 +6,7 @@
 use warnings;
 use lib qw( . lib ../lib ../../lib );
 use Test::More;
-use Parrot::Test tests => 62;
+use Parrot::Test tests => 61;
 
 =head1 NAME
 
@@ -876,13 +876,14 @@
         set I0, 42
         print I0
         print "\n"
-        bsr sub
+        new P0, 'ResizableIntegerArray'
+        local_branch P0, sub
         end
 sub:
         set I0, 43
         print I0
         print "\n"
-        ret
+        local_return P0
 CODE
 42
 43
@@ -907,11 +908,12 @@
         set I0, 42
         print I0
         print "\n"
-        bsr sub
+        new P0, 'ResizableIntegerArray'
+        local_branch P0, sub
         end
 sub:
         print "ok\n"
-        ret
+        local_return P0
 CODE
 42
 ok
@@ -929,19 +931,6 @@
 Jump succeeded
 OUTPUT
 
-pasm_output_is( <<'CODE', <<'OUTPUT', "jsr" );
-     set_addr I1, FOO
-     jsr I1
-     print "and back again\n"
-     end
-
-FOO: print "There "
-     ret
-
-CODE
-There and back again
-OUTPUT
-
 pasm_output_is( <<'CODE', <<'OUTPUT', "last is branch" );
     print "ok 1\n"
     branch l2

Modified: branches/orderedhash_revamp/t/op/lexicals.t
==============================================================================
--- branches/orderedhash_revamp/t/op/lexicals.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/lexicals.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 #!perl
-# Copyright (C) 2001-2008, Parrot Foundation.
+# Copyright (C) 2001-2010, Parrot Foundation.
 # $Id$
 
 use strict;
@@ -11,10 +11,10 @@
 
 $ENV{TEST_PROG_ARGS} ||= '';
 
-plan( skip_all => 'lexicals not thawed properly from PBC, RT #60652' )
+plan( skip_all => 'lexicals not thawed properly from PBC, TT #1171' )
     if $ENV{TEST_PROG_ARGS} =~ /--run-pbc/;
 
-plan( tests => 47 );
+plan( tests => 57 );
 
 =head1 NAME
 
@@ -1109,7 +1109,7 @@
 42
 OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'Example for RT #44395' );
+pir_output_is( <<'CODE', <<'OUTPUT', 'nested scopes' );
 
 =for never
 
@@ -1249,7 +1249,7 @@
 Sub 3 was called 4 times. Any sub was called 12 times.
 OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'Double-inner scope called from closure (RT #56184)' );
+pir_output_is( <<'CODE', <<'OUTPUT', 'Double-inner scope called from closure' );
 .sub 'main' :main
     .local pmc x
     x = 'foo'()
@@ -1290,7 +1290,7 @@
 hello world
 OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', "RT #56398:  Patrick's request" );
+pir_output_is( <<'CODE', <<'OUTPUT', "Patrick's request" );
 .sub 'main' :main
     foo('try 1')
     foo('try 2')
@@ -1323,7 +1323,7 @@
 inner foo try 3
 OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', "RT #56398: Bob's recursion bug");
+pir_output_is( <<'CODE', <<'OUTPUT', "Bob's recursion bug");
 .sub main :main
     rpwi(0)
 .end
@@ -1360,7 +1360,7 @@
 [got 99]
 OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', "RT #56398: Jonathan's recursive case" );
+pir_output_is( <<'CODE', <<'OUTPUT', "Jonathan's recursive case" );
 .sub 'main' :main
     $P0 = new 'ResizablePMCArray'
     push $P0, 'a'
@@ -1465,6 +1465,153 @@
 # ]
 OUTPUT
 
+pir_output_is( <<'CODE', <<'OUTPUT', 'TT #536: lexical sub lookup' );
+.sub 'main'
+    .const 'Sub' $P0 = 'lexfoo'
+    .lex 'foo1', $P0
+    .lex 'foo2', $P0
+
+    'foo1'(1)
+    'foo2'(2)
+.end
+
+.sub 'lexfoo'
+    .param int count
+    print 'ok '
+    print count
+    say ' - looking up lexical sub'
+.end
+
+.sub 'foo2'
+    .param int count
+    print 'not ok '
+    print count
+    say ' - looked up global sub, not lexical'
+.end
+CODE
+ok 1 - looking up lexical sub
+ok 2 - looking up lexical sub
+OUTPUT
+
+pir_output_is( <<'CODE', <<'OUTPUT', 'find_dynamic_lex basic' );
+.sub 'main'
+    $P0 = box 'main'
+    .lex '$*VAR', $P0
+    'foo'()
+    $P1 = find_dynamic_lex '$*VAR'
+    if null $P1 goto p1_null
+    print 'not '
+  p1_null:
+    say 'null'
+.end
+
+.sub 'foo'
+    $P1 = find_dynamic_lex '$*VAR'
+    say $P1
+.end
+CODE
+main
+null
+OUTPUT
+
+pir_output_is( <<'CODE', <<'OUTPUT', "find_dynamic_lex doesn't search outer" );
+.sub 'main'
+    $P0 = box 'main'
+    .lex '$*VAR', $P0
+    'bar'()
+.end
+
+.sub 'bar'
+    $P0 = box 'bar'
+    .lex '$*VAR', $P0
+    'foo'()
+.end
+
+.sub 'foo' :outer('main')
+    $P1 = find_dynamic_lex '$*VAR'
+    say $P1
+    $P1 = find_lex '$*VAR'
+    say $P1
+.end
+CODE
+bar
+main
+OUTPUT
+
+
+pir_output_is( <<'CODE', <<'OUTPUT', 'find_dynamic_lex two levels deep' );
+.sub 'main'
+    $P0 = box 'main'
+    .lex '$*VAR', $P0
+    'bar'()
+.end
+
+.sub 'bar'
+    'foo'()
+.end
+
+.sub 'foo'
+    $P1 = find_dynamic_lex '$*VAR'
+    say $P1
+.end
+CODE
+main
+OUTPUT
+
+pir_error_output_like( <<'CODE', <<'OUTPUT', '.lex should not accept $S#');
+.sub 'main'
+    $S0 = 'hello world'
+    .lex '$var', $S0
+.end
+CODE
+/error.*Cannot use S register with \.lex/
+OUTPUT
+
+pir_error_output_like( <<'CODE', <<'OUTPUT', '.lex should not accept $I#');
+.sub 'main'
+    $I0 = 5
+    .lex '$var', $I0
+.end
+CODE
+/error.*Cannot use I register with \.lex/
+OUTPUT
+
+pir_error_output_like( <<'CODE', <<'OUTPUT', '.lex should not accept $N#');
+.sub 'main'
+    $N0 = 3.14
+    .lex '$pi', $N0
+.end
+CODE
+/error.*Cannot use N register with \.lex/
+OUTPUT
+
+pir_error_output_like( <<'CODE', <<'OUTPUT', 'store_lex should not accept $S#');
+.sub 'main'
+    $S0 = 'hello world'
+    store_lex '$var', $S0
+.end
+CODE
+/error/
+OUTPUT
+
+pir_error_output_like( <<'CODE', <<'OUTPUT', 'store_lex should not accept $I#');
+.sub 'main'
+    $I0 = 5
+    store_lex '$var', $I0
+.end
+CODE
+/error/
+OUTPUT
+
+pir_error_output_like( <<'CODE', <<'OUTPUT', 'store_lex should not accept $N#');
+.sub 'main'
+    $N0 = 3.14
+    store_lex '$pi', $N0
+.end
+CODE
+/error/
+OUTPUT
+
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4

Copied and modified: branches/orderedhash_revamp/t/op/literal-old.t (from r40254, branches/orderedhash_revamp/t/op/literal.t)
==============================================================================

Modified: branches/orderedhash_revamp/t/op/literal.t
==============================================================================
--- branches/orderedhash_revamp/t/op/literal.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/literal.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,16 +1,10 @@
-#!perl
+#!parrot
 # Copyright (C) 2001-2005, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 2;
-
 =head1 NAME
 
-t/op/literal.t - Testing the PIR and PASM lexer
+t/op/literal.t - Testing the PIR lexer
 
 =head1 SYNOPSIS
 
@@ -18,57 +12,28 @@
 
 =head1 DESCRIPTION
 
-Test lexing of literal numbers.
-Taken from from the 2nd aoudad book (page 127).
-
-=head1 TODO
-
-More tests are welcome.
+Tests the lexing of literal numbers.  Taken from from the 2nd
+aoudad book (page 127).
 
-=head1 SEE ALSO
+=cut
 
-L<https://rt.perl.org/rt3/Ticket/Display.html?id=31197>
+.sub main :main
+    .include 'test_more.pir'
 
-=cut
+    plan(4)
+    test_integer_literals_in_pir()
+.end
 
-pasm_output_is( <<'CODE', <<'OUTPUT', "integer literals in PASM" );
-        print 0x2A
-        print "\n"
-        print 0X2A
-        print "\n"
-        print 0b101010
-        print "\n"
-        print 0B101010
-        print "\n"
-        end
-CODE
-42
-42
-42
-42
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', "integer literals in PIR" );
-.sub test :main
-        print 0x2A
-        print "\n"
-        print 0X2A
-        print "\n"
-        print 0b101010
-        print "\n"
-        print 0B101010
-        print "\n"
+.sub test_integer_literals_in_pir
+    is( 0x2A, 42, 'Integer hex literals in PIR' )
+    is( 0X2A, 42, 'Integer hex literals in PIR' )
+    is( 0b101010, 42, 'Integer binary literals in PIR' )
+    is( 0B101010, 42, 'Integer binary literals in PIR' )
 .end
-CODE
-42
-42
-42
-42
-OUTPUT
 
 # Local Variables:
-#   mode: cperl
+#   mode: pir
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/t/op/number.t
==============================================================================
--- branches/orderedhash_revamp/t/op/number.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/number.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,14 +1,7 @@
-#!perl
-# Copyright (C) 2001-2008, Parrot Foundation.
+#!parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 56;
-use Parrot::Config;
-
 =head1 NAME
 
 t/op/number.t - Number Registers
@@ -23,1210 +16,926 @@
 
 =cut
 
-my $output;
+.sub main :main
+    .include 'test_more.pir'
 
-pasm_output_is( <<CODE, <<OUTPUT, "set_n_nc" );
-        set     N0, 1.0
-        set     N1, 4.0
-        set     N2, 16.0
-        set     N3, 64.0
-        set     N4, 256.0
-        set     N5, 1024.0
-        set     N6, 4096.0
-        set     N7, 16384.0
-        set     N8, 65536.0
-        set     N9, 262144.0
-        set     N10, 1048576.0
-        set     N11, 4194304.0
-        set     N12, 16777216.0
-        set     N13, 67108864.0
-        set     N14, 268435456.0
-        set     N15, 1073741824.0
-        set     N16, 4294967296.0
-        set     N17, 17179869184.0
-        set     N18, 68719476736.0
-        set     N19, 274877906944.0
-        set     N20, 1099511627776.0
-        set     N21, 4398046511104.0
-        set     N22, 17592186044416.0
-        set     N23, 70368744177664.0
-        set     N24, 281474976710656.0
-        set     N25, 1.12589990684262e+15
-
-        print   N0
-        print   "\\n"
-        print   N1
-        print   "\\n"
-        print   N2
-        print   "\\n"
-        print   N3
-        print   "\\n"
-        print   N4
-        print   "\\n"
-        print   N5
-        print   "\\n"
-        print   N6
-        print   "\\n"
-        print   N7
-        print   "\\n"
-        print   N8
-        print   "\\n"
-        print   N9
-        print   "\\n"
-        print   N10
-        print   "\\n"
-        print   N11
-        print   "\\n"
-        print   N12
-        print   "\\n"
-        print   N13
-        print   "\\n"
-        print   N14
-        print   "\\n"
-        print   N15
-        print   "\\n"
-        print   N16
-        print   "\\n"
-        print   N17
-        print   "\\n"
-        print   N18
-        print   "\\n"
-        print   N19
-        print   "\\n"
-        print   N20
-        print   "\\n"
-        print   N21
-        print   "\\n"
-        print   N22
-        print   "\\n"
-        print   N23
-        print   "\\n"
-        print   N24
-        print   "\\n"
-        print   N25
-        print   "\\n"
-        end
-CODE
-1
-4
-16
-64
-256
-1024
-4096
-16384
-65536
-262144
-1048576
-4194304
-16777216
-67108864
-268435456
-1073741824
-4294967296
-17179869184
-68719476736
-274877906944
-1099511627776
-4398046511104
-17592186044416
-70368744177664
-281474976710656
-1.12589990684262e+15
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "set_n" );
-        set     N0, 42.0
-        set     N1, N0
-        print   N1
-        print   "\\n"
-        end
-CODE
-42
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "add_n_n_n" );
-        set     N0, 1.0
-        add     N1, N0, N0
-        print   N1
-        print   "\\n"
-
-        add     N2, N0, N1
-        print   N2
-        print   "\\n"
-
-        add     N2, N2, N2
-        print   N2
-        print   "\\n"
-        end
-CODE
-2
-3
-6
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "add_n_n" );
-        set     N0, 1.0
-        add     N0, N0
-        print   N0
-        print   "\\n"
-
-        set     N1, 1.0
-        add     N0, N1
-        print   N0
-        print   "\\n"
-
-        add     N0, 3.0
-        print   N0
-        print   "\\n"
-        end
-CODE
-2
-3
-6
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "sub_n_n_n" );
-        set     N0, 424242.0
-        set     N1, 4200.0
-        sub     N2, N0, N1
-        print   N2
-        print   "\\n"
-        end
-CODE
-420042
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "sub_n_n" );
-        set     N0, 424242.0
-        set     N1, 4200.0
-        sub     N0, N1
-        print   N0
-        print   "\\n"
-
-        sub     N0, N0
-        print   N0
-        print   "\\n"
-        end
-CODE
-420042
-0
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "abs(n, i|ic|n|nc)" );
-        set     I0, -1
-        abs     N0, I0
-        abs     N1, -1
-        set     I1, 1
-        abs     N2, I1
-        abs     N3, 1
-        set     N4, -1
-        abs     N4, N4
-        abs     N5, -1.0
-        set     N6, 1.0
-        abs     N6, N6
-        abs     N7, 1.0
-
-        print N0
-        print "\n"
-        print N1
-        print "\n"
-        print N2
-        print "\n"
-        print N3
-        print "\n"
-        print N4
-        print "\n"
-        print N5
-        print "\n"
-        print N6
-        print "\n"
-        print N7
-        print "\n"
-        end
-CODE
-1
-1
-1
-1
-1
-1
-1
-1
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "mul_i" );
-        set     N0, 2.0
-        mul     N1, N0, N0
-        mul     N1, N1, N0
-        mul     N1, N1, N0
-        mul     N1, N1, N0
-        mul     N1, N1, N0
-        mul     N1, N1, N0
-        mul     N1, N1, N0
-        print   N1
-        print   "\\n"
-        end
-CODE
-256
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "div_i" );
-        set     N0, 10.0
-        set     N1, 2.0
-        div     N2, N0, N1
-        print   N2
-        print   "\\n"
-
-        set     N3, 7.0
-        set     N4, 2.0
-        div     N3, N3, N4
-        print   N3
-        print   "\\n"
-
-        set     N5, 9.0
-        set     N6, -4.0
-        div     N7, N5, N6
-        print   N7
-        print   "\\n"
-        end
-CODE
-5
-3.5
--2.25
-OUTPUT
-
-pasm_output_like( <<CODE, <<OUTPUT, "mod_n" );
-        set     N0, 5.0
-        set     N1, 0.0
-        mod     N2, N0, N1
-        print   N2
-        print   "\\n"
-
-        set     N0, 0.0
-        set     N1, 3.0
-        mod     N2, N0, N1
-        print   N2
-        print   "\\n"
-
-        set     N0, 5.0
-        set     N1, 3.0
-        mod     N2, N0, N1
-        print   N2
-        print   "\\n"
-
-        set     N0, 5.0
-        set     N1, -3.0
-        mod     N2, N0, N1
-        print   N2
-        print   "\\n"
-
-        set     N0, -5.0
-        set     N1, 3.0
-        mod     N2, N0, N1
-        print   N2
-        print   "\\n"
-
-        set     N0, -5.0
-        set     N1, -3.0
-        mod     N2, N0, N1
-        print   N2
-        print   "\\n"
-
-        end
-CODE
-/5\
--?0\
-2\
--1\
-1\
--2\
-/
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "cmod_n" );
-        set     N0, 5.000
-        set     N1, 3.000
-        cmod    N2, N0, N1
-        print   N2
-        print   "\\n"
-
-        end
-CODE
-2
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "eq_n_ic" );
-        set     N0, 5.000001
-        set     N1, 5.000001
-        set     N2, 5.000002
-
-        eq      N0, N1, ONE
-        branch  ERROR
-        print   "bad\\n"
-
-ONE:
-        print   "ok 1\\n"
-        eq      N1, N2, ERROR
-        branch  TWO
-        print   "bad\\n"
-
-TWO:
-        print   "ok 2\\n"
-        end
-
-ERROR:
-        print   "bad\\n"
-        end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "eq_nc_ic" );
-        set     N0, 1.000001
-
-        eq      N0, 1, ERROR
-        branch  ONE
-        print   "bad\\n"
-
-ONE:
-        print   "ok 1\\n"
-        eq      N0, 1.000001, TWO
-        branch  ERROR
-        print   "bad\\n"
-
-TWO:
-        print   "ok 2\\n"
-        end
-
-ERROR:
-        print   "bad\\n"
-        end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "ne_n_ic" );
-        set     N0, -22.222222
-        set     N1, -22.222222
-        set     N2, 0.0
-
-        ne      N0, N2, ONE
-        branch  ERROR
-        print   "bad\\n"
-
-ONE:
-        print   "ok 1\\n"
-        ne      N0, N1, ERROR
-        branch  TWO
-        print   "bad\\n"
-
-TWO:
-        print   "ok 2\\n"
-        end
-
-ERROR:
-        print   "bad\\n"
-        end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "ne_n_nc_ic" );
-        set     N0, 1073741824.0
-        ne      N0, 1073741824.0, nok1
-        print   "ok 1\\n"
-        branch  ONE
-nok1:
-        print   "bad 1\\n"
-ONE:
-        ne      N0, 0.0, TWO
-        branch  ERROR
-TWO:
-        print   "ok 2\\n"
-        end
-ERROR:
-        print   "bad 2\\n"
-        end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "lt_n_ic" );
-        set     N0, 1000.0
-        set     N1, 500.0
-        set     N2, 0.0
-        set     N3, 0.0
-
-        lt      N1, N0, ONE
-        branch  ERROR
-        print   "bad\\n"
-
-ONE:
-        print   "ok 1\\n"
-        lt      N0, N1, ERROR
-        branch  TWO
-        print   "bad\\n"
-
-TWO:
-        print   "ok 2\\n"
-        lt      N2, N3, ERROR
-        branch  THREE
-        print   "bad\\n"
-
-THREE:
-        print   "ok 3\\n"
-        end
-
-ERROR:
-        print "bad\\n"
-        end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "lt_nc_ic" );
-        set     N0, 1000.0
-        set     N1, 500.0
-        set     N2, 0.0
-
-        lt      N0, 500.0, ERROR
-        branch  ONE
-        print   "bad\\n"
-
-ONE:
-        print   "ok 1\\n"
-        lt      N1, 1000.0, TWO
-        branch  ERROR
-        print   "bad\\n"
-
-TWO:
-        print   "ok 2\\n"
-        lt      N0, 0.0, ERROR
-        branch  THREE
-        print   "bad\\n"
-
-THREE:
-        print   "ok 3\\n"
-        end
-
-ERROR:
-        print   "bad\\n"
-        end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "le_n_ic" );
-        set     N0, 1000.0
-        set     N1, 500.0
-        set     N2, 0.0
-        set     N3, 0.0
-
-        le      N1, N0, ONE
-        branch  ERROR
-        print   "bad\\n"
-
-ONE:
-        print   "ok 1\\n"
-        le      N0, N1, ERROR
-        branch  TWO
-        print   "bad\\n"
-
-TWO:
-        print   "ok 2\\n"
-        le      N2, N3, THREE
-        branch  ERROR
-        print   "bad\\n"
-
-THREE:
-        print   "ok 3\\n"
-        end
-
-ERROR:
-        print "bad\\n"
-        end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "le_nc_ic" );
-        set     N0, 1000.0
-        set     N1, 500.0
-        set     N2, 0.0
-
-        le      N0, 500.0, ERROR
-        branch  ONE
-        print   "bad\\n"
-
-ONE:
-        print   "ok 1\\n"
-        le      N1, 1000.0, TWO
-        branch  ERROR
-        print   "bad\\n"
-
-TWO:
-        print   "ok 2\\n"
-        le      N2, 0.0, THREE
-        branch  ERROR
-        print   "bad\\n"
-
-THREE:
-        print   "ok 3\\n"
-        end
-
-ERROR:
-        print   "bad\\n"
-        end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "gt_n_ic" );
-        set     N0, 500.0
-        set     N1, 1000.0
-        set     N2, 0.0
-        set     N3, 0.0
-
-        gt      N1, N0, ONE
-        branch  ERROR
-        print   "bad\\n"
-
-ONE:
-        print   "ok 1\\n"
-        gt      N0, N1, ERROR
-        branch  TWO
-        print   "bad\\n"
-
-TWO:
-        print   "ok 2\\n"
-        gt      N2, N3, ERROR
-        branch  THREE
-        print   "bad\\n"
-
-THREE:
-        print   "ok 3\\n"
-        end
-
-ERROR:
-        print "bad\\n"
-        end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "gt_nc_ic" );
-        set     N0, 500.0
-        set     N1, 1000.0
-        set     N2, 0.0
-
-        gt      N0, 1000.0, ERROR
-        branch  ONE
-        print   "bad\\n"
-
-ONE:
-        print   "ok 1\\n"
-        gt      N1, 500.0, TWO
-        branch  ERROR
-        print   "bad\\n"
-
-TWO:
-        print   "ok 2\\n"
-        gt      N2, 0.0, ERROR
-        branch  THREE
-        print   "bad\\n"
-
-THREE:
-        print   "ok 3\\n"
-        end
-
-ERROR:
-        print   "bad\\n"
-        end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "ge_n_ic" );
-        set     N0, 500.0
-        set     N1, 1000.0
-        set     N2, 0.0
-        set     N3, 0.0
-
-        ge      N1, N0, ONE
-        branch  ERROR
-        print   "bad\\n"
-
-ONE:
-        print   "ok 1\\n"
-        ge      N0, N1, ERROR
-        branch  TWO
-        print   "bad\\n"
-
-TWO:
-        print   "ok 2\\n"
-        ge      N2, N3, THREE
-        branch  ERROR
-        print   "bad\\n"
-
-THREE:
-        print   "ok 3\\n"
-        end
-
-ERROR:
-        print "bad\\n"
-        end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "ge_nc_ic" );
-        set     N0, 500.0
-        set     N1, 1000.0
-        set     N2, 0.0
-
-        ge      N0, 1000.0, ERROR
-        branch  ONE
-        print   "bad\\n"
-
-ONE:
-        print   "ok 1\\n"
-        ge      N1, 500.0, TWO
-        branch  ERROR
-        print   "bad\\n"
-
-TWO:
-        print   "ok 2\\n"
-        ge      N2, 0.0, THREE
-        branch  ERROR
-        print   "bad\\n"
-
-THREE:
-        print   "ok 3\\n"
-        end
-
-ERROR:
-        print   "bad\\n"
-        end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "if_n_ic" );
-        set     N0, 1000.0
-        set     N1, 500.0
-        set     N2, 0.0
-
-        if      N0, ONE
-        branch  ERROR
-        print   "bad\\n"
-
-ONE:
-        print   "ok 1\\n"
-        if      N1, TWO
-        branch  ERROR
-        print   "bad\\n"
-
-TWO:
-        print   "ok 2\\n"
-        if      N2, ERROR
-        branch  THREE
-        print   "bad\\n"
-
-THREE:
-        print   "ok 3\\n"
-        end
-
-ERROR:
-        print   "bad\\n"
-        end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "inc_n" );
-        set     N0, 0.0
-
-        inc     N0
-        print   N0
-        print   "\\n"
-
-        inc     N0
-        inc     N0
-        inc     N0
-        inc     N0
-        print   N0
-        print   "\\n"
-        end
-CODE
-1
-5
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "dec_n" );
-        set     N0, 0.0
-
-        dec     N0
-        print   N0
-        print   "\\n"
-
-        dec     N0
-        dec     N0
-        dec     N0
-        dec     N0
-        print   N0
-        print   "\\n"
-        end
-CODE
--1
--5
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "set_i_n" );
-        set     N0, 0.0
-        set     I0, N0
-        print   I0
-        print   "\\n"
-
-        set     N1, 2147483647.0
-        set     I1, N1
-        print   I1
-        print   "\\n"
-
-        set     N2, -2147483648.0
-        set     I2, N2
-        print   I2
-        print   "\\n"
-        end
-CODE
-0
-2147483647
--2147483648
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "clearn" );
-        set     N0, 547972.0
-        set     N1, 547972.0
-        set     N2, 547972.0
-        set     N3, 547972.0
-        set     N4, 547972.0
-        set     N5, 547972.0
-        set     N6, 547972.0
-        set     N7, 547972.0
-        set     N8, 547972.0
-        set     N9, 547972.0
-        set     N10, 547972.0
-        set     N11, 547972.0
-        set     N12, 547972.0
-        set     N13, 547972.0
-        set     N14, 547972.0
-        set     N15, 547972.0
-        set     N16, 547972.0
-        set     N17, 547972.0
-        set     N18, 547972.0
-        set     N19, 547972.0
-        set     N20, 547972.0
-        set     N21, 547972.0
-        set     N22, 547972.0
-        set     N23, 547972.0
-        set     N24, 547972.0
-        set     N25, 547972.0
-        set     N26, 547972.0
-        set     N27, 547972.0
-        set     N28, 547972.0
-        set     N29, 547972.0
-        set     N30, 547972.0
-        set     N31, 547972.0
-        clearn
-        print   N0
-        print   N1
-        print   N2
-        print   N3
-        print   N4
-        print   N5
-        print   N6
-        print   N7
-        print   N8
-        print   N9
-        print   N10
-        print   N11
-        print   N12
-        print   N13
-        print   N14
-        print   N15
-        print   N16
-        print   N17
-        print   N18
-        print   N19
-        print   N20
-        print   N21
-        print   N22
-        print   N23
-        print   N24
-        print   N25
-        print   N26
-        print   N27
-        print   N28
-        print   N29
-        print   N30
-        print   N31
-        print   "\\n"
-        end
-CODE
-00000000000000000000000000000000
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "neg_n" );
-    neg N0,3.0
-    neg N0,N0
-    neg N0
-    print N0
-    print "\\n"
-    end
-CODE
--3
-OUTPUT
-
-pasm_output_like( <<CODE, <<OUTPUT, "neg 0.0" );
-    set N1, 0
-    neg N1
-    print N1
-    print "\\n"
-    end
-CODE
-/-?0\$/
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "mul_n_n" );
-    set N0,3.0
-    set N1,4.0
-    mul N0,N1
-    print N0
-    print "\\n"
-    end
-CODE
-12
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "fact_n_i" );
-    set I0, 3
-    set I1, 11
-    set I2, 0
-    set I3, -563
-    fact N5, I0
-    print N5
-    print "\\n"
-    fact N6, I1
-    print N6
-    print "\\n"
-    fact N7, I2
-    print N7
-    print "\\n"
-    fact N8, I3
-    print N8
-    print "\\n"
-    end
-CODE
-6
-39916800
-1
-1
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "fact_n_ic" );
-    fact N5, 3
-    print N5
-    print "\\n"
-    fact N6, 11
-    print N6
-    print "\\n"
-    fact N7, 0
-    print N7
-    print "\\n"
-    fact N8, -563
-    print N8
-    print "\\n"
-    end
-CODE
-6
-39916800
-1
-1
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "exchange" );
-    set N1, 1.234560
-    set N2, 9.876540
-    exchange N1, N2
-    print N1
-    print "\n"
-    print N2
-    print "\n"
-
-    set N3, -100.200300
-    exchange N3, N3
-    print N3
-    print "\n"
-    end
-CODE
-9.87654
-1.23456
--100.2003
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "op_n_nc_nc" );
-    add N1, 2.0, 3.0
-    print N1
-    print "\n"
-    sub N1, 2.0, 4.0
-    print N1
-    print "\n"
-    end
-CODE
-5
--2
-OUTPUT
+    plan(173)
+    test_set_n_nc()
+    test_set_n()
+    test_add_n_n_n()
+    test_add_n_n()
+    test_sub_n_n_n()
+    test_sub_n_n()
+    test_abs_n_i_ic_n_nc()
+    test_mul_i()
+    test_div_i()
+    test_mod_n()
+    test_cmod_n()
+    test_eq_n_ic()
+    test_eq_nc_ic()
+    test_ne_n_ic()
+    test_ne_n_nc_ic()
+    test_lt_n_ic()
+    test_lt_nc_ic()
+    test_le_n_ic()
+    test_le_nc_ic()
+    test_gt_n_ic()
+    test_gt_nc_ic()
+    test_ge_n_ic()
+    test_ge_nc_ic()
+    test_if_n_ic()
+    test_inc_n()
+    test_dec_n()
+    test_set_i_n()
+    test_clearn()
+    test_neg_n()
+    test_neg_0_dot_0()
+    test_mul_n_n()
+    test_fact_n_i()
+    test_fact_n_ic()
+    test_exchange()
+    test_op_n_nc_nc()
+    test_lt_nc_nc_ic()
+    test_string_gt_num()
+    test_null()
+    test_dot_dig_parsing()
+    test_sqrt_n_n()
+    test_exception_div_n_n_by_zero()
+    test_exception_div_n_nc_by_zero()
+    test_exception_div_n_n_n_by_zero()
+    test_exception_div_n_nc_n_by_zero()
+    test_exception_div_n_n_nc_by_zero()
+    test_exception_fdiv_n_n_by_zero()
+    test_exception_fdiv_n_nc_by_zero()
+    test_exception_fdiv_n_n_n_by_zero()
+    test_exception_fdiv_n_nc_n_by_zero()
+    test_exception_fdiv_n_n_nc_by_zero()
+    test_exception_cmod_n_n_n_by_zero()
+    test_exception_cmod_n_nc_n_by_zero()
+    test_exception_cmod_n_n_nc_by_zero()
+    test_mod_n_n_n_by_zero()
+    test_mod_n_nc_n_by_zero()
+    test_mod_n_n_nc_by_zero()
+    # END_OF_TESTS
+.end
+
+.macro exception_is ( M )
+    .local pmc exception
+    .local string message
+    .get_results (exception)
+
+    message = exception['message']
+    is( message, .M, .M )
+.endm
+
+.sub test_set_n_nc
+    set     $N0, 1.0
+    set     $N1, 4.0
+    set     $N2, 16.0
+    set     $N3, 64.0
+    set     $N4, 256.0
+    set     $N5, 1024.0
+    set     $N6, 4096.0
+    set     $N7, 16384.0
+    set     $N8, 65536.0
+    set     $N9, 262144.0
+    set     $N10, 1048576.0
+    set     $N11, 4194304.0
+    set     $N12, 16777216.0
+    set     $N13, 67108864.0
+    set     $N14, 268435456.0
+    set     $N15, 1073741824.0
+    set     $N16, 4294967296.0
+    set     $N17, 17179869184.0
+    set     $N18, 68719476736.0
+    set     $N19, 274877906944.0
+    set     $N20, 1099511627776.0
+    set     $N21, 4398046511104.0
+    set     $N22, 17592186044416.0
+    set     $N23, 70368744177664.0
+    set     $N24, 281474976710656.0
+    set     $N25, 1.12589990684262e+15
+    is( $N0, "1", 'set_n_nc' )
+    is( $N1, "4", 'set_n_nc' )
+    is( $N2, "16", 'set_n_nc' )
+    is( $N3, "64", 'set_n_nc' )
+    is( $N4, "256", 'set_n_nc' )
+    is( $N5, "1024", 'set_n_nc' )
+    is( $N6, "4096", 'set_n_nc' )
+    is( $N7, "16384", 'set_n_nc' )
+    is( $N8, "65536", 'set_n_nc' )
+    is( $N9, "262144", 'set_n_nc' )
+    is( $N10, "1048576", 'set_n_nc' )
+    is( $N11, "4194304", 'set_n_nc' )
+    is( $N12, "16777216", 'set_n_nc' )
+    is( $N13, "67108864", 'set_n_nc' )
+    is( $N14, "268435456", 'set_n_nc' )
+    is( $N15, "1073741824", 'set_n_nc' )
+    is( $N16, "4294967296", 'set_n_nc' )
+    is( $N17, "17179869184", 'set_n_nc' )
+    is( $N18, "68719476736", 'set_n_nc' )
+    is( $N19, "274877906944", 'set_n_nc' )
+    is( $N20, "1099511627776", 'set_n_nc' )
+    is( $N21, "4398046511104", 'set_n_nc' )
+    is( $N22, "17592186044416", 'set_n_nc' )
+    is( $N23, "70368744177664", 'set_n_nc' )
+    is( $N24, "281474976710656", 'set_n_nc' )
+    is( $N25, "1.12589990684262e+15", 'set_n_nc' )
+.end
+
+.sub test_set_n
+    set     $N0, 42.0
+    set     $N1, $N0
+    is( $N1, "42", 'set_n' )
+.end
+
+.sub test_add_n_n_n
+    set     $N0, 1.0
+    add     $N1, $N0, $N0
+    is( $N1, "2", 'add_n_n_n' )
+    add     $N2, $N0, $N1
+    is( $N2, "3", 'add_n_n_n' )
+    add     $N2, $N2, $N2
+    is( $N2, "6", 'add_n_n_n' )
+.end
+
+.sub test_add_n_n
+    set     $N0, 1.0
+    add     $N0, $N0
+    is( $N0, "2", 'add_n_n' )
+    set     $N1, 1.0
+    add     $N0, $N1
+    is( $N0, "3", 'add_n_n' )
+    add     $N0, 3.0
+    is( $N0, "6", 'add_n_n' )
+.end
+
+.sub test_sub_n_n_n
+    set     $N0, 424242.0
+    set     $N1, 4200.0
+    sub     $N2, $N0, $N1
+    is( $N2, "420042", 'sub_n_n_n' )
+.end
+
+.sub test_sub_n_n
+    set     $N0, 424242.0
+    set     $N1, 4200.0
+    sub     $N0, $N1
+    is( $N0, "420042", 'sub_n_n' )
+    sub     $N0, $N0
+    is( $N0, "0", 'sub_n_n' )
+.end
+
+.sub test_abs_n_i_ic_n_nc
+    set     $I0, -1
+    abs     $N0, $I0
+    abs     $N1, -1
+    set     $I1, 1
+    abs     $N2, $I1
+    abs     $N3, 1
+    set     $N4, -1
+    abs     $N4, $N4
+    abs     $N5, -1.0
+    set     $N6, 1.0
+    abs     $N6, $N6
+    abs     $N7, 1.0
+    is( $N0, "1", 'abs(n, i|ic|n|nc)' )
+    is( $N1, "1", 'abs(n, i|ic|n|nc)' )
+    is( $N2, "1", 'abs(n, i|ic|n|nc)' )
+    is( $N3, "1", 'abs(n, i|ic|n|nc)' )
+    is( $N4, "1", 'abs(n, i|ic|n|nc)' )
+    is( $N5, "1", 'abs(n, i|ic|n|nc)' )
+    is( $N6, "1", 'abs(n, i|ic|n|nc)' )
+    is( $N7, "1", 'abs(n, i|ic|n|nc)' )
+.end
+
+.sub test_mul_i
+    set     $N0, 2.0
+    mul     $N1, $N0, $N0
+    mul     $N1, $N1, $N0
+    mul     $N1, $N1, $N0
+    mul     $N1, $N1, $N0
+    mul     $N1, $N1, $N0
+    mul     $N1, $N1, $N0
+    mul     $N1, $N1, $N0
+    is( $N1, "256", 'mul_i' )
+.end
+
+.sub test_div_i
+    set     $N0, 10.0
+    set     $N1, 2.0
+    div     $N2, $N0, $N1
+    is( $N2, "5", 'div_i' )
+    set     $N3, 7.0
+    set     $N4, 2.0
+    div     $N3, $N3, $N4
+    is( $N3, "3.5", 'div_i' )
+    set     $N5, 9.0
+    set     $N6, -4.0
+    div     $N7, $N5, $N6
+    is( $N7, "-2.25", 'div_i' )
+.end
+
+.sub test_mod_n
+    set     $N0, 5.0
+    set     $N1, 0.0
+    mod     $N2, $N0, $N1
+    is( $N2, "5", 'mod_n' )
+    set     $N0, 0.0
+    set     $N1, 3.0
+    mod     $N2, $N0, $N1
+    is( $N2, "0", 'mod_n' )
+    set     $N0, 5.0
+    set     $N1, 3.0
+    mod     $N2, $N0, $N1
+    is( $N2, "2", 'mod_n' )
+    set     $N0, 5.0
+    set     $N1, -3.0
+    mod     $N2, $N0, $N1
+    is( $N2, "-1", 'mod_n' )
+    set     $N0, -5.0
+    set     $N1, 3.0
+    mod     $N2, $N0, $N1
+    is( $N2, "1", 'mod_n' )
+    set     $N0, -5.0
+    set     $N1, -3.0
+    mod     $N2, $N0, $N1
+    is( $N2, "-2", 'mod_n' )
+.end
+
+.sub test_cmod_n
+    set     $N0, 5.000
+    set     $N1, 3.000
+    cmod    $N2, $N0, $N1
+    is( $N2, "2", 'cmod_n' )
+.end
+
+.sub test_eq_n_ic
+    set     $N0, 5.000001
+    set     $N1, 5.000001
+    set     $N2, 5.000002
+    eq      $N0, $N1, ONE
+    branch  ERROR
+    ok( 0, 'test eq_n_ic bad' )
+  ONE:
+    ok( 1, 'eq_n_ic ok 1')
+    eq      $N1, $N2, ERROR
+    branch  TWO
+    ok( 0, 'eq_n_ic bad 1' )
+  TWO:
+    ok( 1, 'eq_n_ic ok 2')
+    goto END
+  ERROR:
+    ok( 0, 'eq_n_ic bad 2' )
+  END:
+.end
+
+.sub test_eq_nc_ic
+    set     $N0, 1.000001
+    eq      $N0, 1, ERROR
+    branch  ONE
+    ok( 0, 'eq_nc_ic')
+  ONE:
+    ok( 1, 'eq_nc_ic ok 1')
+    eq      $N0, 1.000001, TWO
+    branch  ERROR
+    ok( 0, 'eq_nc_ic')
+  TWO:
+    ok( 1, 'eq_nc_ic ok 2')
+    goto END
+  ERROR:
+    ok( 0, 'eq_nc_ic')
+  END:
+.end
+
+.sub test_ne_n_ic
+    set     $N0, -22.222222
+    set     $N1, -22.222222
+    set     $N2, 0.0
+    ne      $N0, $N2, ONE
+    branch  ERROR
+    ok( 0, 'ne_n_ic')
+  ONE:
+    ok( 1, 'ne_n_ic ok 1')
+    ne      $N0, $N1, ERROR
+    branch  TWO
+    ok( 0, 'ne_n_ic')
+  TWO:
+    ok( 1, 'ne_n_ic ok 2')
+    goto END
+  ERROR:
+    ok( 0, 'ne_n_ic')
+  END:
+.end
+
+.sub test_ne_n_nc_ic
+    set     $N0, 1073741824.0
+    ne      $N0, 1073741824.0, nok1
+    ok( 1, 'ne_n_nc_ic ok 1')
+    branch  ONE
+  nok1:
+    ok( 0, 'ne_n_nc_ic')
+  ONE:
+    ne      $N0, 0.0, TWO
+    branch  ERROR
+  TWO:
+    ok( 1, 'ne_n_nc_ic ok 2')
+    goto END
+  ERROR:
+    ok( 0, 'ne_n_nc_ic')
+  END:
+.end
+
+.sub test_lt_n_ic
+    set     $N0, 1000.0
+    set     $N1, 500.0
+    set     $N2, 0.0
+    set     $N3, 0.0
+    lt      $N1, $N0, ONE
+    branch  ERROR
+    ok( 0, 'lt_n_ic')
+  ONE:
+    ok( 1, 'lt_n_ic ok 1')
+    lt      $N0, $N1, ERROR
+    branch  TWO
+    ok( 0, 'lt_n_ic')
+  TWO:
+    ok( 1, 'lt_n_ic ok 2')
+    lt      $N2, $N3, ERROR
+    branch  THREE
+    ok( 0, 'lt_n_ic')
+  THREE:
+    ok( 1, 'lt_n_ic ok 3')
+    goto END
+  ERROR:
+    ok( 0, 'lt_n_ic')
+  END:
+.end
+
+.sub test_lt_nc_ic
+    set     $N0, 1000.0
+    set     $N1, 500.0
+    set     $N2, 0.0
+    lt      $N0, 500.0, ERROR
+    branch  ONE
+    ok( 0, 'lt_nc_ic')
+  ONE:
+    ok( 1, 'lt_nc_ic ok 1')
+    lt      $N1, 1000.0, TWO
+    branch  ERROR
+    ok( 0, 'lt_nc_ic')
+  TWO:
+    ok( 1, 'lt_nc_ic ok 2')
+    lt      $N0, 0.0, ERROR
+    branch  THREE
+    ok( 0, 'lt_nc_ic')
+  THREE:
+    ok( 1, 'lt_nc_ic ok 3')
+    goto END
+  ERROR:
+    ok( 0, 'lt_nc_ic')
+  END:
+.end
+
+.sub test_le_n_ic
+    set     $N0, 1000.0
+    set     $N1, 500.0
+    set     $N2, 0.0
+    set     $N3, 0.0
+    le      $N1, $N0, ONE
+    branch  ERROR
+    ok( 0, 'le_n_ic')
+  ONE:
+    ok( 1, 'le_n_ic ok 1')
+    le      $N0, $N1, ERROR
+    branch  TWO
+    ok( 0, 'le_n_ic')
+  TWO:
+    ok( 1, 'le_n_ic ok 2')
+    le      $N2, $N3, THREE
+    branch  ERROR
+    ok( 0, 'le_n_ic')
+  THREE:
+    ok( 1, 'le_n_ic ok 3')
+    goto END
+  ERROR:
+    ok( 0, 'le_n_ic')
+  END:
+.end
+
+.sub test_le_nc_ic
+    set     $N0, 1000.0
+    set     $N1, 500.0
+    set     $N2, 0.0
+    le      $N0, 500.0, ERROR
+    branch  ONE
+    ok( 0, 'le_nc_ic')
+  ONE:
+    ok( 1, 'le_nc_ic ok 1')
+    le      $N1, 1000.0, TWO
+    branch  ERROR
+    ok( 0, 'le_nc_ic')
+  TWO:
+    ok( 1, 'le_nc_ic ok 2')
+    le      $N2, 0.0, THREE
+    branch  ERROR
+    ok( 0, 'le_nc_ic')
+  THREE:
+    ok( 1, 'le_nc_ic ok 3')
+    goto END
+  ERROR:
+    ok( 0, 'le_nc_ic')
+  END:
+.end
+
+.sub test_gt_n_ic
+    set     $N0, 500.0
+    set     $N1, 1000.0
+    set     $N2, 0.0
+    set     $N3, 0.0
+    gt      $N1, $N0, ONE
+    branch  ERROR
+    ok( 0, 'gt_n_ic')
+  ONE:
+    ok( 1, 'gt_n_ic ok 1')
+    gt      $N0, $N1, ERROR
+    branch  TWO
+    ok( 0, 'gt_n_ic')
+  TWO:
+    ok( 1, 'gt_n_ic ok 2')
+    gt      $N2, $N3, ERROR
+    branch  THREE
+    ok( 0, 'gt_n_ic')
+  THREE:
+    ok( 1, 'gt_n_ic ok 3')
+    goto END
+  ERROR:
+    ok( 0, 'gt_n_ic')
+  END:
+.end
+
+.sub test_gt_nc_ic
+    set     $N0, 500.0
+    set     $N1, 1000.0
+    set     $N2, 0.0
+    gt      $N0, 1000.0, ERROR
+    branch  ONE
+    ok( 0, 'gt_nc_ic')
+  ONE:
+    ok( 1, 'gt_nc_ic ok 1')
+    gt      $N1, 500.0, TWO
+    branch  ERROR
+    ok( 0, 'gt_nc_ic')
+  TWO:
+    ok( 1, 'gt_nc_ic ok 2')
+    gt      $N2, 0.0, ERROR
+    branch  THREE
+    ok( 0, 'gt_nc_ic')
+  THREE:
+    ok( 1, 'gt_nc_ic ok 3')
+    goto END
+  ERROR:
+    ok( 0, 'gt_nc_ic')
+  END:
+.end
+
+.sub test_ge_n_ic
+    set     $N0, 500.0
+    set     $N1, 1000.0
+    set     $N2, 0.0
+    set     $N3, 0.0
+    ge      $N1, $N0, ONE
+    branch  ERROR
+    ok( 0, 'ge_n_ic')
+  ONE:
+    ok( 1, 'ge_n_ic ok 1')
+    ge      $N0, $N1, ERROR
+    branch  TWO
+    ok( 0, 'ge_n_ic')
+  TWO:
+    ok( 1, 'ge_n_ic ok 2')
+    ge      $N2, $N3, THREE
+    branch  ERROR
+    ok( 0, 'ge_n_ic')
+  THREE:
+    ok( 1, 'ge_n_ic ok 3')
+    goto END
+  ERROR:
+    ok( 0, 'ge_n_ic')
+  END:
+.end
+
+.sub test_ge_nc_ic
+    set     $N0, 500.0
+    set     $N1, 1000.0
+    set     $N2, 0.0
+    ge      $N0, 1000.0, ERROR
+    branch  ONE
+    ok( 0, 'ge_nc_ic')
+  ONE:
+    ok( 1, 'ge_nc_ic ok 1')
+    ge      $N1, 500.0, TWO
+    branch  ERROR
+    ok( 0, 'ge_nc_ic')
+  TWO:
+    ok( 1, 'ge_nc_ic ok 2')
+    ge      $N2, 0.0, THREE
+    branch  ERROR
+    ok( 0, 'ge_nc_ic')
+  THREE:
+    ok( 1, 'ge_nc_ic ok 3')
+    goto END
+  ERROR:
+    ok( 0, 'ge_nc_ic')
+  END:
+.end
+
+.sub test_if_n_ic
+    set     $N0, 1000.0
+    set     $N1, 500.0
+    set     $N2, 0.0
+    if      $N0, ONE
+    branch  ERROR
+    ok( 0, 'if_n_ic')
+  ONE:
+    ok( 1, 'if_n_ic ok 1')
+    if      $N1, TWO
+    branch  ERROR
+    ok( 0, 'if_n_ic')
+  TWO:
+    ok( 1, 'if_n_ic ok 2')
+    if      $N2, ERROR
+    branch  THREE
+    ok( 0, 'if_n_ic')
+  THREE:
+    ok( 1, 'if_n_ic ok 3')
+    goto END
+  ERROR:
+    ok( 0, 'if_n_ic')
+  END:
+.end
+
+.sub test_inc_n
+    set     $N0, 0.0
+    inc     $N0
+    is( $N0, "1", 'inc_n' )
+    inc     $N0
+    inc     $N0
+    inc     $N0
+    inc     $N0
+    is( $N0, "5", 'inc_n' )
+.end
+
+.sub test_dec_n
+    set     $N0, 0.0
+    dec     $N0
+    is( $N0, "-1", 'dec_n' )
+    dec     $N0
+    dec     $N0
+    dec     $N0
+    dec     $N0
+    is( $N0, "-5", 'dec_n' )
+.end
+
+.sub test_set_i_n
+    set     $N0, 0.0
+    set     $I0, $N0
+    is( $I0, "0", 'set_i_n' )
+    set     $N1, 2147483647.0
+    set     $I1, $N1
+    is( $I1, "2147483647", 'set_i_n' )
+    set     $N2, -2147483648.0
+    set     $I2, $N2
+    is( $I2, "-2147483648", 'set_i_n' )
+.end
+
+.sub test_clearn
+    set     $N0, 547972.0
+    set     $N1, 547972.0
+    set     $N2, 547972.0
+    set     $N3, 547972.0
+    set     $N4, 547972.0
+    set     $N5, 547972.0
+    set     $N6, 547972.0
+    set     $N7, 547972.0
+    set     $N8, 547972.0
+    set     $N9, 547972.0
+    set     $N10, 547972.0
+    set     $N11, 547972.0
+    set     $N12, 547972.0
+    set     $N13, 547972.0
+    set     $N14, 547972.0
+    set     $N15, 547972.0
+    set     $N16, 547972.0
+    set     $N17, 547972.0
+    set     $N18, 547972.0
+    set     $N19, 547972.0
+    set     $N20, 547972.0
+    set     $N21, 547972.0
+    set     $N22, 547972.0
+    set     $N23, 547972.0
+    set     $N24, 547972.0
+    set     $N25, 547972.0
+    set     $N26, 547972.0
+    set     $N27, 547972.0
+    set     $N28, 547972.0
+    set     $N29, 547972.0
+    set     $N30, 547972.0
+    set     $N31, 547972.0
+    clearn
+    is( $N0, "0", 'clearn' )
+    is( $N1, "0", 'clearn' )
+    is( $N2, "0", 'clearn' )
+    is( $N3, "0", 'clearn' )
+    is( $N4, "0", 'clearn' )
+    is( $N5, "0", 'clearn' )
+    is( $N6, "0", 'clearn' )
+    is( $N7, "0", 'clearn' )
+    is( $N8, "0", 'clearn' )
+    is( $N9, "0", 'clearn' )
+    is( $N10, "0", 'clearn' )
+    is( $N11, "0", 'clearn' )
+    is( $N12, "0", 'clearn' )
+    is( $N13, "0", 'clearn' )
+    is( $N14, "0", 'clearn' )
+    is( $N15, "0", 'clearn' )
+    is( $N16, "0", 'clearn' )
+    is( $N17, "0", 'clearn' )
+    is( $N18, "0", 'clearn' )
+    is( $N19, "0", 'clearn' )
+    is( $N20, "0", 'clearn' )
+    is( $N21, "0", 'clearn' )
+    is( $N22, "0", 'clearn' )
+    is( $N23, "0", 'clearn' )
+    is( $N24, "0", 'clearn' )
+    is( $N25, "0", 'clearn' )
+    is( $N26, "0", 'clearn' )
+    is( $N27, "0", 'clearn' )
+    is( $N28, "0", 'clearn' )
+    is( $N29, "0", 'clearn' )
+    is( $N30, "0", 'clearn' )
+    is( $N31, "0", 'clearn' )
+.end
+
+.sub test_neg_n
+    neg $N0,3.0
+    neg $N0,$N0
+    neg $N0
+    is( $N0, "-3", 'neg_n' )
+.end
+
+.sub test_neg_0_dot_0
+    load_bytecode 'config.pbc'
+    $P1 = _config()
+    $P2 = $P1['has_negative_zero']
+    unless $P2 goto negative_zero_todoed
+
+    set $N1, 0
+    neg $N1
+    is( $N1, "-0", 'neg 0.0' )
+    .return ()
+
+  negative_zero_todoed:
+    todo(0, '-0.0 not implemented, TT #313')
+.end
+
+.sub test_mul_n_n
+    set $N0,3.0
+    set $N1,4.0
+    mul $N0,$N1
+    is( $N0, "12", 'mul_n_n' )
+.end
+
+.sub test_fact_n_i
+    set $I0, 3
+    set $I1, 11
+    set $I2, 0
+    set $I3, -563
+    fact $N5, $I0
+    is( $N5, "6", 'fact_n_i' )
+    fact $N6, $I1
+    is( $N6, "39916800", 'fact_n_i' )
+    fact $N7, $I2
+    is( $N7, "1", 'fact_n_i' )
+    fact $N8, $I3
+    is( $N8, "1", 'fact_n_i' )
+.end
+
+.sub test_fact_n_ic
+    fact $N5, 3
+    is( $N5, "6", 'fact_n_ic' )
+    fact $N6, 11
+    is( $N6, "39916800", 'fact_n_ic' )
+    fact $N7, 0
+    is( $N7, "1", 'fact_n_ic' )
+    fact $N8, -563
+    is( $N8, "1", 'fact_n_ic' )
+.end
+
+.sub test_exchange
+    set $N1, 1.234560
+    set $N2, 9.876540
+    exchange $N1, $N2
+    is( $N1, "9.87654", 'exchange' )
+    is( $N2, "1.23456", 'exchange' )
+    set $N3, -100.200300
+    exchange $N3, $N3
+    is( $N3, "-100.2003", 'exchange' )
+.end
+
+.sub test_op_n_nc_nc
+    add $N1, 2.0, 3.0
+    is( $N1, "5", 'op_n_nc_nc' )
+    sub $N1, 2.0, 4.0
+    is( $N1, "-2", 'op_n_nc_nc' )
+.end
 
-pasm_output_is( <<'CODE', <<OUTPUT, "lt_nc_nc_ic" );
+.sub test_lt_nc_nc_ic
     lt 2.0, 1.0, nok
-    print "ok 1\n"
+    ok( 1, 'lt_nc_nc_ic ok 1')
     lt 3.0, 4.0, ok_2
-nok:
-    print "nok\n"
-    end
-ok_2:
-    print "ok 2\n"
-    end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "string -> num" );
-    set S0, "1"
-    set S1, "12.0"
-    set S2, "-2.45"
-    set S3, "25e2"
-    set S4, "Banana"
-
-    set N0, S0
-    set N1, S1
-    set N2, S2
-    set N3, S3
-    set N4, S4
-
-    print N0
-    print "\n"
-    print N1
-    print "\n"
-    print N2
-    print "\n"
-    print N3
-    print "\n"
-    print N4
-    print "\n"
-
-    end
-CODE
-1
-12
--2.45
-2500
-0
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "null" );
-    set N31, 12.5
-    print N31
-    print "\n"
-
-    null N31
-    print N31
-    print "\n"
-
-    end
-CODE
-12.5
-0
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, ".dig parsing" );
-   set N0, .5
-   print N0
-   print "\n"
-   end
-CODE
-0.5
-OUTPUT
+  nok:
+    ok( 0, 'lt_nc_nc_ic')
+    goto END
+  ok_2:
+    ok( 1, 'lt_nc_nc_ic ok 2')
+  END:
+.end
+
+.sub test_string_gt_num
+    set $S0, "1"
+    set $S1, "12.0"
+    set $S2, "-2.45"
+    set $S3, "25e2"
+    set $S4, "Banana"
+    set $N0, $S0
+    set $N1, $S1
+    set $N2, $S2
+    set $N3, $S3
+    set $N4, $S4
+    is( $N0, "1", 'string -> num' )
+    is( $N1, "12", 'string -> num' )
+    is( $N2, "-2.45", 'string -> num' )
+    is( $N3, "2500", 'string -> num' )
+    is( $N4, "0", 'string -> num' )
+.end
+
+.sub test_null
+    set $N31, 12.5
+    is( $N31, "12.5", 'null' )
+    null $N31
+    is( $N31, "0", 'null' )
+.end
+
+.sub test_dot_dig_parsing
+    set $N0, .5
+    is( $N0, "0.5", '.dig parsing' )
+.end
 
 # Don't check exact string representation. Last digit part can be different */
-pasm_output_like( <<'CODE', <<OUTPUT, "sqrt_n_n" );
-        set N1, 2
-        sqrt N2, N1
-        say N2
-        sqrt N2, 2.0
-        say N2
-        end
-CODE
-/^1.414213562373.*\n1.414213562373.*/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<OUTPUT, "div_n_n by zero" );
-        set N0, 0
-        set N1, 10
-        div N1, N0
-        end
-CODE
-/.*Divide by zero.*/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<OUTPUT, "div_n_nc by zero" );
-        set N1, 10
-        div N1, 0
-        end
-CODE
-/.*Divide by zero.*/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<OUTPUT, "div_n_n_n by zero" );
-        set N0, 0
-        set N1, 10
-        div N2, N1, N0
-        end
-CODE
-/.*Divide by zero.*/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<OUTPUT, "div_n_nc_n by zero" );
-        set N0, 0
-        div N2, 10, N0
-        end
-CODE
-/.*Divide by zero.*/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<OUTPUT, "div_n_n_nc by zero" );
-        set N1, 10
-        div N2, N1, 0
-        end
-CODE
-/.*Divide by zero.*/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<OUTPUT, "fdiv_n_n by zero" );
-        set N0, 0
-        set N1, 10
-        fdiv N1, N0
-        end
-CODE
-/.*Divide by zero.*/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<OUTPUT, "fdiv_n_nc by zero" );
-        set N1, 10
-        fdiv N1, 0
-        end
-CODE
-/.*Divide by zero.*/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<OUTPUT, "fdiv_n_n_n by zero" );
-        set N0, 0
-        set N1, 10
-        fdiv N2, N1, N0
-        end
-CODE
-/.*Divide by zero.*/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<OUTPUT, "fdiv_n_nc_n by zero" );
-        set N0, 0
-        fdiv N2, 10, N0
-        end
-CODE
-/.*Divide by zero.*/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<OUTPUT, "fdiv_n_n_nc by zero" );
-        set N1, 10
-        fdiv N2, N1, 0
-        end
-CODE
-/.*Divide by zero.*/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<OUTPUT, "cmod_n_n_n by zero" );
-        set N0, 0
-        set N1, 10
-        cmod N2, N1, N0
-        end
-CODE
-/.*Divide by zero.*/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<OUTPUT, "cmod_n_nc_n by zero" );
-        set N0, 0
-        cmod N2, 10, N0
-        end
-CODE
-/.*Divide by zero.*/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<OUTPUT, "cmod_n_n_nc by zero" );
-        set N1, 10
-        cmod N2, N1, 0
-        end
-CODE
-/.*Divide by zero.*/
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "mod_n_n_n by zero" );
-        set N0, 0
-        set N1, 10
-        mod N2, N1, N0
-        end
-CODE
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "mod_n_nc_n by zero" );
-        set N0, 0
-        mod N2, 10, N0
-        end
-CODE
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "mod_n_n_nc by zero" );
-        set N1, 10
-        mod N2, N1, 0
-        end
-CODE
-OUTPUT
+.sub test_sqrt_n_n
+    $P0 = new 'Float'
+    $N1 = 2
+    $N2 = sqrt $N1
+    $P0 = $N2
+    is( $P0, 1.414213562373, 'sqrt_n_n',1e-6 )
+
+    $N2 = sqrt 2.0
+    $P0 = $N2
+    is( $P0, 1.414213562373, 'sqrt_n_n',1e-6 )
+.end
+
+.sub test_exception_div_n_n_by_zero
+    push_eh handler
+    set $N0, 0
+    set $N1, 10
+    div $N1, $N0
+  handler:
+    .exception_is( 'Divide by zero' )
+.end
+
+.sub test_exception_div_n_nc_by_zero
+    push_eh handler
+    set $N1, 10
+    div $N1, 0
+  handler:
+    .exception_is( 'Divide by zero' )
+.end
+
+.sub test_exception_div_n_n_n_by_zero
+    push_eh handler
+    set $N0, 0
+    set $N1, 10
+    div $N2, $N1, $N0
+  handler:
+    .exception_is( 'Divide by zero' )
+.end
+
+.sub test_exception_div_n_nc_n_by_zero
+    push_eh handler
+    set $N0, 0
+    div $N2, 10, $N0
+  handler:
+    .exception_is( 'Divide by zero' )
+.end
+
+.sub test_exception_div_n_n_nc_by_zero
+    push_eh handler
+    set $N1, 10
+    div $N2, $N1, 0
+  handler:
+    .exception_is( 'Divide by zero' )
+.end
+
+.sub test_exception_fdiv_n_n_by_zero
+    push_eh handler
+    set $N0, 0
+    set $N1, 10
+    fdiv $N1, $N0
+  handler:
+    .exception_is( 'Divide by zero' )
+.end
+
+.sub test_exception_fdiv_n_nc_by_zero
+    push_eh handler
+    set $N1, 10
+    fdiv $N1, 0
+  handler:
+    .exception_is( 'Divide by zero' )
+.end
+
+.sub test_exception_fdiv_n_n_n_by_zero
+    push_eh handler
+    set $N0, 0
+    set $N1, 10
+    fdiv $N2, $N1, $N0
+  handler:
+    .exception_is( 'Divide by zero' )
+.end
+
+.sub test_exception_fdiv_n_nc_n_by_zero
+    push_eh handler
+    set $N0, 0
+    fdiv $N2, 10, $N0
+  handler:
+    .exception_is( 'Divide by zero' )
+.end
+
+.sub test_exception_fdiv_n_n_nc_by_zero
+    push_eh handler
+    set $N1, 10
+    fdiv $N2, $N1, 0
+  handler:
+    .exception_is( 'Divide by zero' )
+.end
+
+.sub test_exception_cmod_n_n_n_by_zero
+    push_eh handler
+    set $N0, 0
+    set $N1, 10
+    cmod $N2, $N1, $N0
+  handler:
+    .exception_is( 'Divide by zero' )
+.end
+
+.sub test_exception_cmod_n_nc_n_by_zero
+    push_eh handler
+    set $N0, 0
+    cmod $N2, 10, $N0
+  handler:
+    .exception_is( 'Divide by zero' )
+.end
+
+.sub test_exception_cmod_n_n_nc_by_zero
+    push_eh handler
+    set $N1, 10
+    cmod $N2, $N1, 0
+  handler:
+    .exception_is( 'Divide by zero' )
+.end
+
+.sub test_mod_n_n_n_by_zero
+    set $N0, 0
+    set $N1, 10
+    mod $N2, $N1, $N0
+    is( $N2, "10", 'mod_n_n_n by zero' )
+.end
+
+.sub test_mod_n_nc_n_by_zero
+    set $N0, 0
+    mod $N2, 10, $N0
+    is( $N2, 10, 'mod_n_nc_n by zero' )
+.end
+
+.sub test_mod_n_n_nc_by_zero
+    set $N1, 10
+    mod $N2, $N1, 0
+    is( $N2, '10', 'mod_n_n_nc by zero' )
+.end
 
 # Local Variables:
-#   mode: cperl
+#   mode: pir
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/t/op/pushaction.t
==============================================================================
--- branches/orderedhash_revamp/t/op/pushaction.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/pushaction.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -99,7 +99,7 @@
 
 $ENV{TEST_PROG_ARGS} ||= '';
 my @todo = $ENV{TEST_PROG_ARGS} =~ /--run-pbc/
-    ? ( todo => 'lexicals not thawed properly from PBC, RT #60652' )
+    ? ( todo => 'lexicals not thawed properly from PBC, TT #1171' )
     : ();
 pir_output_is( <<'CODE', <<'OUTPUT', "pushaction as closure", @todo );
 .sub main :main

Modified: branches/orderedhash_revamp/t/op/say.t
==============================================================================
--- branches/orderedhash_revamp/t/op/say.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/say.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -86,7 +86,7 @@
 3.14159
 OUTPUT
 
-pir_error_output_like( <<'CODE', <<'OUTPUT', 'say with PMCNULL argument (RT #59532)' );
+pir_error_output_like( <<'CODE', <<'OUTPUT', 'say with PMCNULL argument' );
 .sub 'main'
     null $P0
     say $P0

Modified: branches/orderedhash_revamp/t/op/spawnw.t
==============================================================================
--- branches/orderedhash_revamp/t/op/spawnw.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/spawnw.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -27,6 +27,9 @@
 In order to get the exit code from the spawned process, it needs to be right
 shifted by 8 bit.
 
+TT #1271: Do not rely on the existence of Perl5 here. Spawn Parrot or some
+other program which will exist on the target platform
+
 =head1 TODO
 
 Test negative return codes.

Modified: branches/orderedhash_revamp/t/op/sprintf.t
==============================================================================
--- branches/orderedhash_revamp/t/op/sprintf.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/sprintf.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -61,8 +61,6 @@
 
 .sub main :main
     load_bytecode 'Test/Builder.pbc'
-    load_bytecode 'PGE.pbc'
-    load_bytecode 'PGE/Dumper.pbc'
     .include "iglobals.pasm"
     .include "sysinfo.pasm"
 
@@ -87,7 +85,7 @@
 
 
     .local pmc file_iterator # iterate over list of files..
-               file_iterator = new 'Iterator', test_files
+               file_iterator = iter test_files
 
     .local int test_number   # the number of the test we're running
                test_number = 0
@@ -284,10 +282,12 @@
 
     .local pmc todo_info
                todo_info = new 'Hash'
+    .local pmc jmpstack
+               jmpstack = new 'ResizableIntegerArray'
 
     .local string test_file
 
-    bsr reset_todo_info
+    local_branch jmpstack,  reset_todo_info
     test_file = 'sprintf_tests'
     # TODOs
     todo_info[64] = 'undecided perl5 vs. posix behavior'
@@ -306,7 +306,7 @@
 
   reset_todo_info:
     todo_info = new 'Hash'
-    ret
+    local_return jmpstack
 
   set_todo_loop:
     if $I0 > $I1 goto end_loop
@@ -314,7 +314,7 @@
     $I0 += 1
     goto set_todo_loop
   end_loop:
-    ret
+    local_return jmpstack
 .end
 
 
@@ -325,10 +325,12 @@
 
     .local pmc skip_info
                skip_info = new 'Hash'
+    .local pmc jmpstack
+               jmpstack = new 'ResizableIntegerArray'
 
     .local string test_file
 
-    bsr reset_skip_info
+    local_branch jmpstack,  reset_skip_info
     test_file = 'sprintf_tests'
     skip_info[5] = 'parrot extension (%B)'
     skip_info[7] = 'perl5-specific extension (%D)'
@@ -343,7 +345,7 @@
     $S0 = 'perl5-specific extension (%v...)'
     $I0 = 71
     $I1 = 99
-    bsr set_skip_loop
+    local_branch jmpstack,  set_skip_loop
 
     skip_info[114] = 'harness needs support for * modifier'
     skip_info[144] = 'perl5 expresssion as test value'
@@ -366,12 +368,12 @@
     $S0 = 'perl5-specific test'
     $I0 = 238
     $I1 = 251
-    bsr set_skip_loop
+    local_branch jmpstack,  set_skip_loop
 
     $S0 = 'perl5-specific extension (%v...)'
     $I0 = 252
     $I1 = 298
-    bsr set_skip_loop
+    local_branch jmpstack,  set_skip_loop
 
     skip_info[307] = 'perl5-specific extension (%v...)'
     skip_info[308] = 'perl5-specific extension (%v...)'
@@ -382,7 +384,7 @@
 
   reset_skip_info:
     skip_info = new 'Hash'
-    ret
+    local_return jmpstack
 
   set_skip_loop:
     if $I0 > $I1 goto end_loop
@@ -394,7 +396,7 @@
     goto set_skip_loop
   end_loop:
     $S0 = ''
-    ret
+    local_return jmpstack
 .end
 
 
@@ -478,16 +480,16 @@
     .local pmc skip_os
     skip_os = split ' ', skip_list
 
-    .local pmc iter
-    iter = new 'Iterator', skip_os
+    .local pmc it
+    it = iter skip_os
 
     .local string osname
     osname = sysinfo .SYSINFO_PARROT_OS
 
   iter_loop:
-    unless iter goto iter_end
+    unless it goto iter_end
     .local string os_name
-    os_name = shift iter
+    os_name = shift it
     eq os_name, osname, skip_it
     goto iter_loop
   iter_end:

Modified: branches/orderedhash_revamp/t/op/sprintf2.t
==============================================================================
--- branches/orderedhash_revamp/t/op/sprintf2.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/sprintf2.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,14 +1,7 @@
-#!perl
-# Copyright (C) 2001-2008, Parrot Foundation.
+#! parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-
-use Test::More;
-use Parrot::Test;
-
 =head1 NAME
 
 t/op/sprintf2.t - Auxilliary tests for the sprintf opcode
@@ -19,41 +12,115 @@
 
 =head1 DESCRIPTION
 
-Executes sprintf tests that sprintf.t can't handle yet.
+Executes sprintf tests that were generated by tools/dev/sprintf2.pl
 
 =cut
 
-# [ 'format', [arguments], "expected output", 'description' ]
-my @tests = (
-  [ '<%*d>', [4,12], "<  12>\n", 'positive length' ],
-  [ '<%*d>', [-4,12], "<12  >\n", 'negative length' ],
-  [ '<%-*d>', [4,12], "<12  >\n", 'minus option, positive length' ],
-  [ '|%c|%0c|%-1c|%1c|%-6c|%6c|%*c|%*c|', [65,65,65,65,65,65,3,65,-4,65],
-    "|A|A|A|A|A     |     A|  A|A   |\n", 'misc w/ minus option' ],
-  [ '<%*s>', [4,'"hi"'], "<  hi>\n", 'string, positive length' ],
-  [ '<%*s>', [-4,'"hi"'], "<hi  >\n", 'string, negative length' ],
-  [ '<%-*s>', [4,'"hi"'], "<hi  >\n", 'string, minus flag' ],
-  [ '<%*.*f>', [7,2,123.456], "< 123.46>\n", 'float length&prec' ],
-  [ '<%*.*f>', [-7,2,123.456], "<123.46 >\n", 'float -length&prec' ],
-);
-
-plan tests => scalar @tests;
-
-foreach my $test (@tests) {
-  my $code = ".sub main\n"
-           . "  \$P0 = new 'ResizablePMCArray'\n";
-  foreach my $arg (@{$$test[1]}) {
-    $code .= "  push \$P0,$arg\n";
-  }
-  $code .= "  \$S0 = sprintf '$$test[0]', \$P0\n"
-        .  "  say \$S0\n"
-        .  ".end\n";
-  pir_output_is( $code, $$test[2], $$test[3] );
-}
+
+.sub main :main
+    .include 'test_more.pir'
+
+    plan(9)
+
+    positive_length()
+    negative_length()
+    minus_option__positive_length()
+    misc_w__minus_option()
+    string__positive_length()
+    string__negative_length()
+    string__minus_flag()
+    float_length_and_prec()
+    float_neg_length_and_prec()
+
+.end
+
+.sub positive_length
+  $P0 = new 'ResizablePMCArray'
+  push $P0,4
+  push $P0,12
+  $S0 = sprintf '<%*d>', $P0
+  is( $S0, '<  12>', 'positive length' )
+.end
+
+.sub negative_length
+  $P0 = new 'ResizablePMCArray'
+  push $P0,-4
+  push $P0,12
+  $S0 = sprintf '<%*d>', $P0
+  is( $S0, '<12  >', 'negative length' )
+.end
+
+.sub minus_option__positive_length
+  $P0 = new 'ResizablePMCArray'
+  push $P0,4
+  push $P0,12
+  $S0 = sprintf '<%-*d>', $P0
+  is( $S0, '<12  >', 'minus option, positive length' )
+.end
+
+.sub misc_w__minus_option
+  $P0 = new 'ResizablePMCArray'
+  push $P0,65
+  push $P0,65
+  push $P0,65
+  push $P0,65
+  push $P0,65
+  push $P0,65
+  push $P0,3
+  push $P0,65
+  push $P0,-4
+  push $P0,65
+  $S0 = sprintf '|%c|%0c|%-1c|%1c|%-6c|%6c|%*c|%*c|', $P0
+  is( $S0, '|A|A|A|A|A     |     A|  A|A   |', 'misc w/ minus option' )
+.end
+
+.sub string__positive_length
+  $P0 = new 'ResizablePMCArray'
+  push $P0,4
+  push $P0,"hi"
+  $S0 = sprintf '<%*s>', $P0
+  is( $S0, '<  hi>', 'string, positive length' )
+.end
+
+.sub string__negative_length
+  $P0 = new 'ResizablePMCArray'
+  push $P0,-4
+  push $P0,"hi"
+  $S0 = sprintf '<%*s>', $P0
+  is( $S0, '<hi  >', 'string, negative length' )
+.end
+
+.sub string__minus_flag
+  $P0 = new 'ResizablePMCArray'
+  push $P0,4
+  push $P0,"hi"
+  $S0 = sprintf '<%-*s>', $P0
+  is( $S0, '<hi  >', 'string, minus flag' )
+.end
+
+.sub float_length_and_prec
+  $P0 = new 'ResizablePMCArray'
+  push $P0,7
+  push $P0,2
+  push $P0,123.456
+  $S0 = sprintf '<%*.*f>', $P0
+  is( $S0, '< 123.46>', 'float length&prec' )
+.end
+
+.sub float_neg_length_and_prec
+  $P0 = new 'ResizablePMCArray'
+  push $P0,-7
+  push $P0,2
+  push $P0,123.456
+  $S0 = sprintf '<%*.*f>', $P0
+  is( $S0, '<123.46 >', 'float -length&prec' )
+.end
+
+
 
 # Local Variables:
-#   mode: cperl
+#   mode: pir
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/t/op/string.t
==============================================================================
--- branches/orderedhash_revamp/t/op/string.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/string.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,15 +1,7 @@
-#!perl
-# Copyright (C) 2001-2008, Parrot Foundation.
+#!parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-
-use Test::More;
-use Parrot::Test tests => 166;
-use Parrot::Config;
-
 =head1 NAME
 
 t/op/string.t - Parrot Strings
@@ -24,2978 +16,2168 @@
 
 =cut
 
-pasm_output_is( <<'CODE', <<'OUTPUT', 'set_s_s|sc' );
-    set S4, "JAPH\n"
-    set     S5, S4
-    print   S4
-    print   S5
-    end
-CODE
-JAPH
-JAPH
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'clone' );
-        set     S0, "Foo\n"
-    clone   S1, S0
-        print   S0
-    print   S1
-
-    clone   S1, "Bar\n"
-    print   S1
-        chopn   S1, 1   # Check that the contents of S1 are no longer constant
-    print   S1
-        print   "\n"
+.sub main :main
+    .include 'test_more.pir'
 
-    end
-CODE
-Foo
-Foo
-Bar
-Bar
-OUTPUT
-
-pasm_output_is( <<'CODE', '4', 'length_i_s' );
-    set I4, 0
-    set S4, "JAPH"
-    length  I4, S4
-    print   I4
-    end
-CODE
+    plan(411)
 
-pasm_output_is( <<'CODE', '0', '0 length substr' );
-    set I4, 0
-    set S4, "JAPH"
-        substr  S3, S4, 1, 0
-    length  I4, S3
-        print   I4
-    end
-CODE
+    set_s_s_sc()
+    test_clone()
+    clone_null()
+    test_length_i_s()
+    zero_length_substr()
+    chopn_with_clone()
+    chopn_with_set()
+    chopn_oob_values()
+    three_argument_chopn()
+    three_argument_chopn__oob_values()
+    substr_tests()
+    neg_substr_offset()
+    exception_substr_oob()
+    exception_substr_oob()
+    len_greater_than_strlen()
+    len_greater_than_strlen_neg_offset()
+    five_arg_substr_w_rep_eq_length()
+    five_arg_substr_w_replacement_gt_length()
+    five_arg_substr_w_replacement_lt_length()
+    five_arg_substr__offset_at_end_of_string()
+    exception_five_arg_substr__offset_past_end_of_string()
+    five_arg_substr_neg_offset_repl_eq_length()
+    five_arg_substr_neg_offset_repl_gt_length()
+    five_arg_substr_neg_offset_repl_lt_length()
+    exception_five_arg_substr_neg_offset_out_of_string()
+    five_arg_substr_length_gt_strlen()
+    five_arg_substr_length_gt_strlen_neg_offset()
+    four_arg_replacement_only_substr()
+    three_arg_substr()
+    exception_substr__pos_offset_zero_length_string()
+    substr_offset_zero_zero_length_string()
+    exception_substr_offset_one_zero_length_string()
+    exception_substr_neg_offset_zero_length_string()
+    zero_length_substr_zero_length_string()
+    zero_length_substr_zero_length_string()
+    three_arg_substr_zero_length_string()
+    five_arg_substr_zero_length_string()
+    four_arg_substr_replace_zero_length_string()
+    concat_s_s_sc_null_onto_null()
+    concat_s_sc_repeated_two_arg_concats()
+    concat_s_s_sc_foo_one_onto_null()
+    test_concat_s_s_sc()
+    concat_s_s_sc_s_sc()
+    concat_ensure_copy_is_made()
+    test_clears()
+
+    same_constant_twice_bug()
+    exception_two_param_ord_empty_string()
+    exception_two_param_ord_empty_string_register()
+    exception_three_param_ord_empty_string()
+    exception_three_param_ord_empty_string_register()
+    two_param_ord_one_character_string()
+    two_param_ord_multi_character_string()
+    two_param_ord_one_character_string_register()
+    three_param_ord_one_character_string()
+    three_param_ord_one_character_string_register()
+    three_param_ord_multi_character_string()
+    three_param_ord_multi_character_string_register()
+    exception_three_param_ord_multi_character_string()
+    exception_three_param_ord_multi_character_string()
+    three_param_ord_one_character_string_from_end()
+    three_param_ord_one_character_string_register_from_end()
+    three_param_ord_multi_character_string_from_end()
+    three_param_ord_multi_character_string_register_from_end()
+    exception_three_param_ord_multi_character_string_register_from_end_oob()
+    chr_of_thirty_two_is_space_in_ascii()
+    chr_of_sixty_five_is_a_in_ascii()
+    chr_of_one_hundred_and_twenty_two_is_z_in_ascii()
+    test_if_s_ic()
+    repeat_s_s_sc_i_ic()
+    exception_repeat_oob()
+    exception_repeat_oob_repeat_p_p_p()
+    exception_repeat_oob_repeate_p_p_i()
+    encodingname_oob()
+    index_three_arg_form()
+    index_four_arg_form()
+    index_four_arg_form_bug_twenty_two_thousand_seven_hundred_and_eighteen()
+    index_null_strings()
+    index_embedded_nulls()
+    index_big_strings()
+    index_big_hard_to_match_strings()
+    index_with_different_charsets()
+    negative_index_bug_35959()
+    index_multibyte_matching()
+    index_multibyte_matching_two()
+    num_to_string()
+    string_to_int()
+    concat_or_substr_cow()
+    constant_to_cstring()
+    cow_with_chopn_leaving_original_untouched()
+    check_that_bug_bug_16874_was_fixed()
+    stress_concat()
+    ord_and_substring_see_bug_17035()
+
+    test_sprintf()
+    other_form_of_sprintf_op()
+    sprintf_left_justify()
+    correct_precision_for_sprintf_x()
+    test_exchange()
+    test_find_encoding()
+    test_string_encoding()
+    test_assign()
+    assign_and_globber()
+    assign_and_globber_2()
+    bands_null_string()
+    bands_2()
+    bands_3()
+    bands_cow()
+    bors_null_string()
+    bors_2()
+    bors_3()
+    bors_cow()
+    bxors_null_string()
+    bxors_2()
+    bxors_3()
+    bxors_cow()
+    bnots_null_string()
+    bnots_2()
+    bnots_cow()
+    transcode_to_utf8()
+    string_chartype()
+    split_on_empty_string()
+    split_on_non_empty_string()
+    test_join()
+    eq_addr_or_ne_addr()
+    test_if_null_s_ic()
+    test_upcase()
+    test_downcase()
+    test_titlecase()
+    three_param_ord_one_character_string_register_i()
+    three_param_ord_multi_character_string_i()
+    three_param_ord_multi_character_string_register_i()
+    exception_three_param_ord_multi_character_string_i()
+    exception_three_param_ord_multi_character_string_i()
+    three_param_ord_one_character_string_from_end_i()
+    three_param_ord_one_character_string_register_from_end_i()
+    three_param_ord_multi_character_string_from_end_i()
+    three_param_ord_multi_character_string_register_from_end_i()
+    exception_three_param_ord_multi_character_string_register_from_end_oob_i()
+    more_string_to_int()
+    constant_string_and_modify_in_situ_op_rt_bug_60030()
+    corner_cases_of_numification()
+    non_canonical_nan_and_inf()
+    split_hll_mapped()
+    # END_OF_TESTS
+    join_get_string_returns_a_null_string()
+
+.end
+
+.macro exception_is ( M )
+    .local pmc exception
+    .local string message
+    .get_results (exception)
+
+    message = exception['message']
+    is( message, .M, .M )
+.endm
+
+.sub set_s_s_sc
+    set $S4, "JAPH"
+    set $S5, $S4
+    
+    is( $S4, "JAPH", '' )
+    is( $S5, "JAPH", '' )
+.end
+ 
+.sub test_clone
+    set   $S0, "Foo1"
+    clone $S1, $S0
+   
+    is( $S0, "Foo1", '' )
+    is( $S1, "Foo1", '' )
+   
+    clone $S1, "Bar1"
+    is( $S1, "Bar1", '' )
+
+    chopn $S1, 1   
+    is( $S1, "Bar", 'the contents of $S1 are no longer constant' )
+.end
+ 
+.sub clone_null
+    null $S0
+    clone $S1, $S0
+    is( $S1, $S0, '' )
+.end
+
+.sub test_length_i_s
+    set $I4, 0
+    set $S4, "JAPH"
+    length  $I4, $S4
+    is( $I4, "4", '' )
+.end
+
+.sub zero_length_substr
+    set $I4, 0
+    set $S4, "JAPH"
+    substr  $S3, $S4, 1, 0
+    length  $I4, $S3
+    is( $I4, "0", '' )
+.end
+
+.sub chopn_with_clone
+    set $S4, "JAPHxyzw"
+    set $S5, "japhXYZW"
+    clone $S3, $S4
+    set $I1, 4
+    chopn $S4, 3
+    chopn $S4, 1
+    chopn $S5, $I1
+
+    is( $S4, "JAPH", '' )
+    is( $S5, "japh", '' )
+    is( $S3, "JAPHxyzw", '' )
+.end
+ 
+.sub chopn_with_set
+    set $S4, "JAPHxyzw"
+    set $S5, "japhXYZW"
+    set     $S3, $S4
+    set $I1, 4
+    chopn   $S4, 3
+    chopn   $S4, 1
+    chopn   $S5, $I1
+
+    is( $S4, "JAPH", '' )
+    is( $S5, "japh", '' )
+    is( $S3, "JAPH", '' )
+.end
+
+.sub chopn_oob_values
+    set $S1, "A string of length 21"
+    chopn   $S1, 0
+    is( $S1, "A string of length 21", '' )
+
+    chopn   $S1, 4
+    is( $S1, "A string of lengt", '' )
 
-pasm_output_is( <<'CODE', <<'OUTPUT', 'chopn with clone' );
-    set S4, "JAPHxyzw"
-    set S5, "japhXYZW"
-        clone   S3, S4
-    set S1, "\n"
-    set I1, 4
-    chopn   S4, 3
-    chopn   S4, 1
-        chopn   S5, I1
-    print   S4
-        print   S1
-    print   S5
-        print   S1
-    print   S3
-        print   S1
-    end
-CODE
-JAPH
-japh
-JAPHxyzw
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'chopn with set' );
-    set S4, "JAPHxyzw"
-    set S5, "japhXYZW"
-        set     S3, S4
-    set S1, "\n"
-    set I1, 4
-    chopn   S4, 3
-    chopn   S4, 1
-        chopn   S5, I1
-    print   S4
-        print   S1
-    print   S5
-        print   S1
-    print   S3
-        print   S1
-    end
-CODE
-JAPH
-japh
-JAPH
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'chopn, OOB values' );
-    set S1, "A string of length 21"
-    chopn   S1, 0
-    print   S1
-    print   "\n"
-    chopn   S1, 4
-    print   S1
-    print   "\n"
     # -length cuts now
-    chopn   S1, -4
-    print   S1
-    print   "\n"
-    chopn   S1, 1000
-    print   S1
-    print   "** nothing **\n"
-    end
-CODE
-A string of length 21
-A string of lengt
-A st
-** nothing **
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'Three argument chopn' );
-    set S1, "Parrot"
-
-    chopn   S2, S1, 0
-    print   S1
-    print   "\n"
-    print   S2
-    print   "\n"
-
-    chopn   S2, S1, 1
-    print   S1
-    print   "\n"
-    print   S2
-    print   "\n"
-
-        set     I0, 2
-    chopn   S2, S1, I0
-    print   S1
-    print   "\n"
-    print   S2
-    print   "\n"
-
-    chopn   S2, "Parrot", 3
-    print   S2
-    print   "\n"
-
-    chopn   S1, S1, 5
-    print   S1
-    print   "\n"
-
-        set     S1, "Parrot"
-        set     S3, S1
-        chopn   S2, S1, 3
-        print   S3
-    print   "\n"
-
-        set     S3, S1
-        chopn   S1, 3
-        print   S3
-    print   "\n"
+    chopn   $S1, -4
+    is( $S1, "A st", '' )
 
-    end
-CODE
-Parrot
-Parrot
-Parrot
-Parro
-Parrot
-Parr
-Par
-P
-Parrot
-Par
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'Three argument chopn, OOB values' );
-    set S1, "Parrot"
-
-    chopn   S2, S1, 7
-    print   S1
-    print   "\n"
-    print   S2
-    print   "\n"
-
-    chopn   S2, S1, -1
-    print   S1
-    print   "\n"
-    print   S2
-    print   "\n"
+    chopn   $S1, 1000
+    is( $S1, "", '' )
+.end
+ 
+.sub three_argument_chopn
+    set $S1, "Parrot"
+    chopn   $S2, $S1, 0
+    is( $S1, "Parrot", '' )
+    is( $S2, "Parrot", '' )
+    
+    chopn   $S2, $S1, 1
+    is( $S1, "Parrot", '' )
+    is( $S2, "Parro", '' )
+    
+    set     $I0, 2
+    chopn   $S2, $S1, $I0
+    is( $S1, "Parrot", '' )
+    is( $S2, "Parr", '' )
+    
+    chopn   $S2, "Parrot", 3
+    is( $S2, "Par", '' )
+    
+    chopn   $S1, $S1, 5
+    is( $S1, "P", '' )
+    
+    set     $S1, "Parrot"
+    set     $S3, $S1
+    chopn   $S2, $S1, 3
+    is( $S3, "Parrot", '' )
+   
+    set     $S3, $S1
+    chopn   $S1, 3
+    is( $S3, "Par", '' )
+.end
+# 
+.sub three_argument_chopn__oob_values
+    set $S1, "Parrot"
+    chopn   $S2, $S1, 7
+    is( $S1, "Parrot", '' )
+    is( $S2, "", '' )
+    
+    chopn   $S2, $S1, -1
+    is( $S1, "Parrot", '' )
+    is( $S2, "P", '' )
+.end
 
-    end
-CODE
-Parrot
+.sub substr_tests
+    set $S4, "12345JAPH01"
+    set $I4, 5
+    set $I5, 4
 
-Parrot
-P
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'substr_s_s|sc_i|ic_i|ic' );
-    set S4, "12345JAPH01"
-    set I4, 5
-    set I5, 4
-    substr  S5, S4, I4, I5
-    print   S5
-    substr S5, S4, I4, 4
-    print  S5
-    substr S5, S4, 5, I5
-    print  S5
-    substr S5, S4, 5, 4
-    print  S5
-    substr S5, "12345JAPH01", I4, I5
-    print  S5
-    substr S5, "12345JAPH01", I4, 4
-    print  S5
-    substr S5, "12345JAPH01", 5, I5
-    print  S5
-    substr S5, "12345JAPH01", 5, 4
-    print  S5
-    print  "\n"
-    end
-CODE
-JAPHJAPHJAPHJAPHJAPHJAPHJAPHJAPH
-OUTPUT
+    substr  $S5, $S4, $I4, $I5
+    is( $S5, "JAPH", '' )
 
-# negative offsets
-pasm_output_is( <<'CODE', <<'OUTPUT', 'neg substr offset' );
-    set S0, "A string of length 21"
-    set I0, -9
-    set I1, 6
-    substr S1, S0, I0, I1
-    print S0
-    print "\n"
-    print S1
-    print "\n"
-    end
-CODE
-A string of length 21
-length
-OUTPUT
+    substr $S5, $S4, $I4, 4
+    is( $S5, "JAPH", '' )
+
+    substr $S5, $S4, 5, $I5
+    is( $S5, "JAPH", '' )
+
+    substr $S5, $S4, 5, 4
+    is( $S5, "JAPH", '' )
 
+    substr $S5, "12345JAPH01", $I4, $I5
+    is( $S5, "JAPH", '' )
+
+    substr $S5, "12345JAPH01", $I4, 4
+    is( $S5, "JAPH", '' )
+
+    substr $S5, "12345JAPH01", 5, $I5
+    is( $S5, "JAPH", '' )
+
+    substr $S5, "12345JAPH01", 5, 4
+    is( $S5, "JAPH", '' )
+.end
+
+# negative offsets
+.sub neg_substr_offset
+    set $S0, "A string of length 21"
+    set $I0, -9
+    set $I1, 6
+    substr $S1, $S0, $I0, $I1
+    is( $S0, "A string of length 21", '' )
+    is( $S1, "length", '' )
+.end
+ 
 # This asks for substring that shouldn't be allowed...
-pasm_error_output_like( <<'CODE', <<'OUTPUT', 'substr OOB' );
-    set S0, "A string of length 21"
-    set I0, -99
-    set I1, 6
-    substr S1, S0, I0, I1
-    end
-CODE
-/^Cannot take substr outside string/
-OUTPUT
+.sub exception_substr_oob
+    set $S0, "A string of length 21"
+    set $I0, -99
+    set $I1, 6
+    push_eh handler
+        substr $S1, $S0, $I0, $I1
+handler:
+    .exception_is( "Cannot take substr outside string" )
+.end
 
 # This asks for substring that shouldn't be allowed...
-pasm_error_output_like( <<'CODE', <<'OUTPUT', 'substr OOB' );
-    set S0, "A string of length 21"
-    set I0, 99
-    set I1, 6
-    substr S1, S0, I0, I1
-    end
-CODE
-/^Cannot take substr outside string/
-OUTPUT
+.sub exception_substr_oob
+    set $S0, "A string of length 21"
+    set $I0, 99
+    set $I1, 6
+    push_eh handler
+        substr $S1, $S0, $I0, $I1
+handler:
+    .exception_is( "Cannot take substr outside string" )
+.end
 
 # This asks for substring much greater than length of original string
-pasm_output_is( <<'CODE', <<'OUTPUT', 'len>strlen' );
-    set S0, "A string of length 21"
-    set I0, 12
-    set I1, 1000
-    substr S1, S0, I0, I1
-    print  S0
-    print "\n"
-    print S1
-    print "\n"
-    end
-CODE
-A string of length 21
-length 21
-OUTPUT
+.sub len_greater_than_strlen
+    set $S0, "A string of length 21"
+    set $I0, 12
+    set $I1, 1000
+    substr $S1, $S0, $I0, $I1
+    is( $S0, "A string of length 21", '' )
+    is( $S1, "length 21", '' )
+.end
 
 # The same, with a negative offset
-pasm_output_is( <<'CODE', <<'OUTPUT', 'len>strlen, -ve os' );
-    set S0, "A string of length 21"
-    set I0, -9
-    set I1, 1000
-    substr S1, S0, I0, I1
-    print S0
-    print "\n"
-    print S1
-    print "\n"
-    end
-CODE
-A string of length 21
-length 21
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', '5 arg substr, replacement = length' );
-  set S0, "abcdefghijk"
-  set S1, "xyz"
-  substr S2, S0, 4, 3, S1
-  print S0
-  print "\n"
-  print S1
-  print "\n"
-  print S2
-  print "\n"
-  end
-CODE
-abcdxyzhijk
-xyz
-efg
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', '5 arg substr, replacement > length' );
-  set S0, "abcdefghijk"
-  set S1, "xyz0123"
-  substr S2, S0, 4, 3, S1
-  print S0
-  print "\n"
-  print S1
-  print "\n"
-  print S2
-  print "\n"
-  end
-CODE
-abcdxyz0123hijk
-xyz0123
-efg
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', '5 arg substr, replacement < length' );
-  set S0, "abcdefghijk"
-  set S1, "x"
-  substr S2, S0, 4, 3, S1
-  print S0
-  print "\n"
-  print S1
-  print "\n"
-  print S2
-  print "\n"
-  end
-CODE
-abcdxhijk
-x
-efg
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', '5 arg substr, offset at end of string' );
-  set S0, "abcdefghijk"
-  set S1, "xyz"
-  substr S2, S0, 11, 3, S1
-  print S0
-  print "\n"
-  print S1
-  print "\n"
-  print S2
-  print "\n"
-  end
-CODE
-abcdefghijkxyz
-xyz
-
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', '5 arg substr, offset past end of string' );
-  set S0, "abcdefghijk"
-  set S1, "xyz"
-  substr S2, S0, 12, 3, S1
-  print S0
-  print "\n"
-  print S1
-  print "\n"
-  print S2
-  print "\n"
-  end
-CODE
-/^Can only replace inside string or index after end of string/
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', '5 arg substr, -ve offset, repl=length' );
-  set S0, "abcdefghijk"
-  set S1, "xyz"
-  substr S2, S0, -3, 3, S1
-  print S0
-  print "\n"
-  print S1
-  print "\n"
-  print S2
-  print "\n"
-  end
-CODE
-abcdefghxyz
-xyz
-ijk
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', '5 arg substr, -ve offset, repl>length' );
-  set S0, "abcdefghijk"
-  set S1, "xyz"
-  substr S2, S0, -6, 2, S1
-  print S0
-  print "\n"
-  print S1
-  print "\n"
-  print S2
-  print "\n"
-  end
-CODE
-abcdexyzhijk
-xyz
-fg
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', '5 arg substr, -ve offset, repl<length' );
-  set S0, "abcdefghijk"
-  set S1, "xyz"
-  substr S2, S0, -6, 4, S1
-  print S0
-  print "\n"
-  print S1
-  print "\n"
-  print S2
-  print "\n"
-  end
-CODE
-abcdexyzjk
-xyz
-fghi
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', '5 arg substr, -ve offset out of string' );
-  set S0, "abcdefghijk"
-  set S1, "xyz"
-  substr S2, S0, -12, 4, S1
-  print S0
-  print "\n"
-  print S1
-  print "\n"
-  print S2
-  print "\n"
-  end
-CODE
-/^Can only replace inside string or index after end of string/
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', '5 arg substr, length > strlen ' );
-  set S0, "abcdefghijk"
-  set S1, "xyz"
-  substr S2, S0, 3, 11, S1
-  print S0
-  print "\n"
-  print S1
-  print "\n"
-  print S2
-  print "\n"
-  end
-CODE
-abcxyz
-xyz
-defghijk
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', '5 arg substr, length > strlen, -ve offset' );
-  set S0, "abcdefghijk"
-  set S1, "xyz"
-  substr S2, S0, -3, 11, S1
-  print S0
-  print "\n"
-  print S1
-  print "\n"
-  print S2
-  print "\n"
-  end
-CODE
-abcdefghxyz
-xyz
-ijk
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', '4-arg, replacement-only substr' );
-  set S0, "abcdefghijk"
-  set S1, "xyz"
-  substr S0, 3, 3, S1
-  print S0
-  print "\n"
-  print S1
-  print "\n"
-  end
-CODE
-abcxyzghijk
-xyz
-OUTPUT
-
-pasm_output_is( <<'CODE', 'PH', '3-arg substr' );
-  set S0, "JAPH"
-  substr S1, S0, 2
-  print S1
-  end
-CODE
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', "substr, +ve offset, zero-length string" );
-  set S0, ""
-  substr S1, S0, 10, 3
-  print S1
-  end
-CODE
-/Cannot take substr outside string/
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'substr, offset 0, zero-length string' );
-  set S0, ""
-  substr S1, S0, 0, 1
-  print S1
-  print "_\n"
-  end
-CODE
-_
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', "substr, offset -1, zero-length string" );
-  set S0, ""
-  substr S1, S0, -1, 1
-  print S1
-  end
-CODE
-/Cannot take substr outside string/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', "substr, -ve offset, zero-length string" );
-  set S0, ""
-  substr S1, S0, -10, 5
-  print S1
-  end
-CODE
-/Cannot take substr outside string/
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'zero-length substr, zero-length string' );
-  set S0, ""
-  substr S1, S0, 10, 0
-  print S1
-  print "_\n"
-  end
-CODE
-_
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'zero-length substr, zero-length string' );
-  set S0, ""
-  substr S1, S0, -10, 0
-  print S1
-  print "_\n"
-  end
-CODE
-_
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', '3-arg substr, zero-length string' );
-  set S0, ""
-  substr S1, S0, 2
-  print S1
-  print "_\n"
-  end
-CODE
-_
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', '5 arg substr, zero-length string' );
-  set S0, ""
-  set S1, "xyz"
-  substr S2, S0, 0, 3, S1
-  print S0
-  print "\n"
-  print S1
-  print "\n"
-  print S2
-  print "\n"
-
-  set S3, ""
-  set S4, "abcde"
-  substr S5, S3, 0, 0, S4
-  print S3
-  print "\n"
-  print S4
-  print "\n"
-  print S5
-  print "\n"
-  end
-CODE
-xyz
-xyz
-
-abcde
-abcde
-
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', '4 arg substr replace, zero-length string' );
-  set S0, ""
-  set S1, "xyz"
-  substr S0, 0, 3, S1
-  print S0
-  print "\n"
-  print S1
-  print "\n"
-
-  set S2, ""
-  set S3, "abcde"
-  substr S2, 0, 0, S3
-  print S2
-  print "\n"
-  print S3
-  print "\n"
-  end
-CODE
-xyz
-xyz
-abcde
-abcde
-OUTPUT
-
-pasm_output_is( <<'CODE', '<><', 'concat_s_s|sc, null onto null' );
- print "<>"
- concat S0, S0
- concat S1, ""
- print "<"
- end
-CODE
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'concat_s_sc, repeated two-arg concats' );
-  set S12, ""
-  set I0, 0
+.sub len_greater_than_strlen_neg_offset
+    set $S0, "A string of length 21"
+    set $I0, -9
+    set $I1, 1000
+    substr $S1, $S0, $I0, $I1
+    is( $S0, "A string of length 21", '' )
+    is( $S1, "length 21", '' )
+.end
+ 
+.sub five_arg_substr_w_rep_eq_length
+    set $S0, "abcdefghijk"
+    set $S1, "xyz"
+    substr $S2, $S0, 4, 3, $S1
+    is( $S0, "abcdxyzhijk", '' )
+    is( $S1, "xyz", '' )
+    is( $S2, "efg", '' )
+.end
+
+.sub five_arg_substr_w_replacement_gt_length
+    set $S0, "abcdefghijk"
+    set $S1, "xyz0123"
+    substr $S2, $S0, 4, 3, $S1
+    is( $S0, "abcdxyz0123hijk", '' )
+    is( $S1, "xyz0123", '' )
+    is( $S2, "efg", '' )
+.end
+
+.sub five_arg_substr_w_replacement_lt_length
+    set $S0, "abcdefghijk"
+    set $S1, "x"
+    substr $S2, $S0, 4, 3, $S1
+    is( $S0, "abcdxhijk", '' )
+    is( $S1, "x", '' )
+    is( $S2, "efg", '' )
+.end
+
+.sub five_arg_substr__offset_at_end_of_string
+  set $S0, "abcdefghijk"
+  set $S1, "xyz"
+  substr $S2, $S0, 11, 3, $S1
+    is( $S0, "abcdefghijkxyz", '' )
+    is( $S1, "xyz", '' )
+    is( $S2, "", '' )
+.end
+
+.sub exception_five_arg_substr__offset_past_end_of_string
+    set $S0, "abcdefghijk"
+    set $S1, "xyz"
+    push_eh handler
+    substr $S2, $S0, 12, 3, $S1
+    ok(0,"no exception")
+handler:
+    .exception_is( "Can only replace inside string or index after end of string" )
+.end
+
+.sub five_arg_substr_neg_offset_repl_eq_length
+    set $S0, "abcdefghijk"
+    set $S1, "xyz"
+    substr $S2, $S0, -3, 3, $S1
+    is( $S0, "abcdefghxyz", '' )
+    is( $S1, "xyz", '' )
+    is( $S2, "ijk", '' )
+.end
+
+.sub five_arg_substr_neg_offset_repl_gt_length
+    set $S0, "abcdefghijk"
+    set $S1, "xyz"
+    substr $S2, $S0, -6, 2, $S1
+    is( $S0, "abcdexyzhijk", '' )
+    is( $S1, "xyz", '' )
+    is( $S2, "fg", '' )
+.end
+
+.sub five_arg_substr_neg_offset_repl_lt_length
+    set $S0, "abcdefghijk"
+    set $S1, "xyz"
+    substr $S2, $S0, -6, 4, $S1
+    is( $S0, "abcdexyzjk", '' )
+    is( $S1, "xyz", '' )
+    is( $S2, "fghi", '' )
+.end
+
+.sub exception_five_arg_substr_neg_offset_out_of_string
+    set $S0, "abcdefghijk"
+    set $S1, "xyz"
+    push_eh handler
+    substr $S2, $S0, -12, 4, $S1
+    ok(0,"no exception")
+handler:
+    .exception_is( "Can only replace inside string or index after end of string" )
+.end
+
+.sub five_arg_substr_length_gt_strlen
+    set $S0, "abcdefghijk"
+    set $S1, "xyz"
+    substr $S2, $S0, 3, 11, $S1
+    is( $S0, "abcxyz", '' )
+    is( $S1, "xyz", '' )
+    is( $S2, "defghijk", '' )
+.end
+
+.sub five_arg_substr_length_gt_strlen_neg_offset
+    set $S0, "abcdefghijk"
+    set $S1, "xyz"
+    substr $S2, $S0, -3, 11, $S1
+    is( $S0, "abcdefghxyz", '' )
+    is( $S1, "xyz", '' )
+    is( $S2, "ijk", '' )
+.end
+
+.sub four_arg_replacement_only_substr
+    set $S0, "abcdefghijk"
+    set $S1, "xyz"
+    substr $S0, 3, 3, $S1
+    is( $S0, "abcxyzghijk", '' )
+    is( $S1, "xyz", '' )
+.end
+
+.sub three_arg_substr
+    set $S0, "JAPH"
+    substr $S1, $S0, 2
+    is( $S1, "PH", '' )
+.end
+
+.sub exception_substr__pos_offset_zero_length_string
+    set $S0, ""
+    push_eh handler
+    substr $S1, $S0, 10, 3
+    ok(0,"no exception")
+handler:
+    .exception_is( "Cannot take substr outside string" )
+.end
+
+.sub substr_offset_zero_zero_length_string
+    set $S0, ""
+    substr $S1, $S0, 0, 1
+    is( $S1, "", '' )
+.end
+
+.sub exception_substr_offset_one_zero_length_string
+    set $S0, ""
+    push_eh handler
+    substr $S1, $S0, -1, 1
+    ok(0,"no exception")
+handler:
+    .exception_is( "Cannot take substr outside string" )
+.end
+
+.sub exception_substr_neg_offset_zero_length_string
+    set $S0, ""
+    push_eh handler
+    substr $S1, $S0, -10, 5
+handler:
+    .exception_is( "Cannot take substr outside string" )
+.end
+
+.sub zero_length_substr_zero_length_string
+    set $S0, ""
+    substr $S1, $S0, 10, 0
+    is( $S1, "", '' )
+.end
+
+.sub zero_length_substr_zero_length_string
+    set $S0, ""
+    substr $S1, $S0, -10, 0
+    is( $S1, "", '' )
+.end
+
+.sub three_arg_substr_zero_length_string
+    set $S0, ""
+    substr $S1, $S0, 2
+    is( $S1, "", '' )
+.end
+
+.sub five_arg_substr_zero_length_string
+    set $S0, ""
+    set $S1, "xyz"
+    substr $S2, $S0, 0, 3, $S1
+    is( $S0, "xyz", '' )
+    is( $S1, "xyz", '' )
+    is( $S2, "", '' )
+
+    set $S3, ""
+    set $S4, "abcde"
+    substr $S5, $S3, 0, 0, $S4
+    is( $S3, "abcde", '' )
+    is( $S4, "abcde", '' )
+    is( $S5, "", '' )
+.end
+
+.sub four_arg_substr_replace_zero_length_string
+    set $S0, ""
+    set $S1, "xyz"
+    substr $S0, 0, 3, $S1
+    is( $S0, "xyz", '' )
+    is( $S1, "xyz", '' )
+
+    set $S2, ""
+    set $S3, "abcde"
+    substr $S2, 0, 0, $S3
+    is( $S2, "abcde", '' )
+    is( $S3, "abcde", '' )
+.end
+
+.sub concat_s_s_sc_null_onto_null
+    concat $S0, $S0
+    is( $S0, "", '' )
+    concat $S1, ""
+    is( $S1, "", '' )
+.end
+
+.sub concat_s_sc_repeated_two_arg_concats
+    set $S12, ""
+    set $I0, 0
 WHILE:
-  concat S12, "hi"
-  add I0, 1
-  lt I0, 10, WHILE
-  print S12
-  print "\n"
-  end
-CODE
-hihihihihihihihihihi
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'concat_s_s|sc, "foo1" onto null' );
- concat S0, "foo1"
- set S1, "foo2"
- concat S2, S1
- print S0
- print "\n"
- print S2
- print "\n"
- end
-CODE
-foo1
-foo2
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'concat_s_s|sc' );
-    set S1, "fish"
-    set S2, "bone"
-    concat S1, S2
-    print S1
-    concat S1, "\n"
-    print S1
-    end
-CODE
-fishbonefishbone
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'concat_s_s|sc_s|sc' );
-    set S1, "japh"
-    set S2, "JAPH"
-    concat S0, "japh", "JAPH"
-    print S0
-    print "\n"
-    concat S0, S1, "JAPH"
-    print S0
-    print "\n"
-    concat S0, "japh", S2
-    print S0
-    print "\n"
-    concat S0, S1, S2
-    print S0
-    print "\n"
-    end
-CODE
-japhJAPH
-japhJAPH
-japhJAPH
-japhJAPH
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'concat - ensure copy is made' );
-    set S2, "JAPH"
-    concat S0, S2, ""
-    concat S1, "", S2
-    chopn S0, 1
-    chopn S1, 1
-    print S2
-    print "\n"
-    end
-CODE
-JAPH
-OUTPUT
+    concat $S12, "hi"
+    add $I0, 1
+    lt $I0, 10, WHILE
+    is( $S12, "hihihihihihihihihihi", '' )
+.end
+
+.sub concat_s_s_sc_foo_one_onto_null
+    concat $S0, "foo1"
+    set $S1, "foo2"
+    concat $S2, $S1
+    is( $S0, "foo1", '' )
+    is( $S2, "foo2", '' )
+.end
+
+.sub test_concat_s_s_sc
+    set $S1, "fish"
+    set $S2, "bone"
+    concat $S1, $S2
+    is( $S1, "fishbone", '' )
+.end
+
+.sub concat_s_s_sc_s_sc
+    set $S1, "japh"
+    set $S2, "JAPH"
+    concat $S0, "japh", "JAPH"
+    is( $S0, "japhJAPH", '' )
 
-pasm_output_is( <<"CODE", <<'OUTPUT', 'clears' );
-@{[ set_str_regs( sub {"BOO $_[0]\\n"} ) ]}
+    concat $S0, $S1, "JAPH"
+    is( $S0, "japhJAPH", '' )
+
+    concat $S0, "japh", $S2
+    is( $S0, "japhJAPH", '' )
+
+    concat $S0, $S1, $S2
+    is( $S0, "japhJAPH", '' )
+.end
+
+.sub concat_ensure_copy_is_made
+    set $S2, "JAPH"
+    concat $S0, $S2, ""
+    concat $S1, "", $S2
+    chopn $S0, 1
+    chopn $S1, 1
+    is( $S2, "JAPH", '' )
+.end
+
+.sub test_clears
+    set $S0, "BOO 0"
+    set $S1, "BOO 1"
+    set $S2, "BOO 2"
+    set $S3, "BOO 3"
+    set $S4, "BOO 4"
+    set $S5, "BOO 5"
+    set $S6, "BOO 6"
+    set $S7, "BOO 7"
+    set $S8, "BOO 8"
+    set $S9, "BOO 9"
+    set $S10, "BOO 10"
+    set $S11, "BOO 11"
+    set $S12, "BOO 12"
+    set $S13, "BOO 13"
+    set $S14, "BOO 14"
+    set $S15, "BOO 15"
+    set $S16, "BOO 16"
+    set $S17, "BOO 17"
+    set $S18, "BOO 18"
+    set $S19, "BOO 19"
+    set $S20, "BOO 20"
+    set $S21, "BOO 21"
+    set $S22, "BOO 22"
+    set $S23, "BOO 23"
+    set $S24, "BOO 24"
+    set $S25, "BOO 25"
+    set $S26, "BOO 26"
+    set $S27, "BOO 27"
+    set $S28, "BOO 28"
+    set $S29, "BOO 29"
+    set $S30, "BOO 30"
+    set $S31, "BOO 31"
     clears
-@{[ print_str_regs() ]}
-    print "done\\n"
-    end
-CODE
-done
-OUTPUT
-
-my @strings = (
-    "hello",   "hello", "hello", "world", "world", "hello", "hello", "hellooo",
-    "hellooo", "hello", "hello", "hella", "hella", "hello", "hella", "hellooo",
-    "hellooo", "hella", "hElLo", "HeLlO", "hElLo", "hElLo"
-);
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'eq_s_s_ic' );
-@{[ compare_strings( 0, "eq", @strings ) ]}
-    print "ok\\n"
-    end
-ERROR:
-    print "bad\\n"
-    end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'eq_sc_s_ic' );
-@{[ compare_strings( 1, "eq", @strings ) ]}
-    print "ok\\n"
-    end
-ERROR:
-    print "bad\\n"
-    end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'eq_s_sc_ic' );
-@{[ compare_strings( 2, "eq", @strings ) ]}
-    print "ok\\n"
-    end
-ERROR:
-    print "bad\\n"
-    end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'eq_sc_sc_ic' );
-@{[ compare_strings( 3, "eq", @strings ) ]}
-    print "ok\\n"
-    end
-ERROR:
-    print "bad\\n"
-    end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'ne_s_s_ic' );
-@{[ compare_strings( 0, "ne", @strings ) ]}
-    print "ok\\n"
-    end
-ERROR:
-    print "bad\\n"
-    end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'ne_sc_s_ic' );
-@{[ compare_strings( 1, "ne", @strings ) ]}
-    print "ok\\n"
-    end
-ERROR:
-    print "bad\\n"
-    end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'ne_s_sc_ic' );
-@{[ compare_strings( 2, "ne", @strings ) ]}
-    print "ok\\n"
-    end
-ERROR:
-    print "bad\\n"
-    end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'ne_sc_sc_ic' );
-@{[ compare_strings( 3, "ne", @strings ) ]}
-    print "ok\\n"
-    end
-ERROR:
-    print "bad\\n"
-    end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'lt_s_s_ic' );
-@{[ compare_strings( 0, "lt", @strings ) ]}
-    print "ok\\n"
-    end
-ERROR:
-    print "bad\\n"
-    end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'lt_sc_s_ic' );
-@{[ compare_strings( 1, "lt", @strings ) ]}
-    print "ok\\n"
-    end
-ERROR:
-    print "bad\\n"
-    end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'lt_s_sc_ic' );
-@{[ compare_strings( 2, "lt", @strings ) ]}
-    print "ok\\n"
-    end
-ERROR:
-    print "bad\\n"
-    end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'lt_sc_sc_ic' );
-@{[ compare_strings( 3, "lt", @strings ) ]}
-    print "ok\\n"
-    end
-ERROR:
-    print "bad\\n"
-    end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'le_s_s_ic' );
-@{[ compare_strings( 0, "le", @strings ) ]}
-    print "ok\\n"
-    end
-ERROR:
-    print "bad\\n"
-    end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'le_sc_s_ic' );
-@{[ compare_strings( 1, "le", @strings ) ]}
-    print "ok\\n"
-    end
-ERROR:
-    print "bad\\n"
-    end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'le_s_sc_ic' );
-@{[ compare_strings( 2, "le", @strings ) ]}
-    print "ok\\n"
-    end
-ERROR:
-    print "bad\\n"
-    end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'le_sc_sc_ic' );
-@{[ compare_strings( 3, "le", @strings ) ]}
-    print "ok\\n"
-    end
-ERROR:
-    print "bad\\n"
-    end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'gt_s_s_ic' );
-@{[ compare_strings( 0, "gt", @strings ) ]}
-    print "ok\\n"
-    end
-ERROR:
-    print "bad\\n"
-    end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'gt_sc_s_ic' );
-@{[ compare_strings( 1, "gt", @strings ) ]}
-    print "ok\\n"
-    end
-ERROR:
-    print "bad\\n"
-    end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'gt_s_sc_ic' );
-@{[ compare_strings( 2, "gt", @strings ) ]}
-    print "ok\\n"
-    end
-ERROR:
-    print "bad\\n"
-    end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'gt_sc_sc_ic' );
-@{[ compare_strings( 3, "gt", @strings ) ]}
-    print "ok\\n"
-    end
-ERROR:
-    print "bad\\n"
-    end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'ge_s_s_ic' );
-@{[ compare_strings( 0, "ge", @strings ) ]}
-    print "ok\\n"
-    end
-ERROR:
-    print "bad\\n"
-    end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'ge_sc_s_ic' );
-@{[ compare_strings( 1, "ge", @strings ) ]}
-    print "ok\\n"
-    end
-ERROR:
-    print "bad\\n"
-    end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'ge_s_sc_ic' );
-@{[ compare_strings( 2, "ge", @strings ) ]}
-    print "ok\\n"
-    end
-ERROR:
-    print "bad\\n"
-    end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'ge_sc_sc_ic' );
-@{[ compare_strings( 3, "ge", @strings ) ]}
-    print "ok\\n"
-    end
-ERROR:
-    print "bad\\n"
-    end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'same constant twice bug' );
-       set     S0, ""
-       set     S1, ""
-       set     S2, "foo"
-       concat  S1,S1,S2
-       print   S1
-       print   S0
-       print   "\n"
-       end
-CODE
-foo
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', '2-param ord, empty string' );
-    ord I0,""
-    print I0
-    end
-CODE
-/^Cannot get character of empty string/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', '2-param ord, empty string register' );
-    ord I0,S0
-    print I0
-    end
-CODE
-/^Cannot get character of empty string/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', '3-param ord, empty string' );
-    ord I0,"",0
-    print I0
-    end
-CODE
-/^Cannot get character of empty string/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', '3-param ord, empty string register' );
-    ord I0,S0,0
-    print I0
-    end
-CODE
-/^Cannot get character of empty string/
-OUTPUT
-
-pasm_output_is( <<'CODE', ord('a'), '2-param ord, one-character string' );
-    ord I0,"a"
-    print I0
-    end
-CODE
+    is( $S0, "", '' )
+    is( $S1, "", '' )
+    is( $S2, "", '' )
+    is( $S3, "", '' )
+    is( $S4, "", '' )
+    is( $S5, "", '' )
+    is( $S6, "", '' )
+    is( $S7, "", '' )
+    is( $S8, "", '' )
+    is( $S9, "", '' )
+    is( $S10, "", '' )
+    is( $S11, "", '' )
+    is( $S12, "", '' )
+    is( $S13, "", '' )
+    is( $S14, "", '' )
+    is( $S15, "", '' )
+    is( $S16, "", '' )
+    is( $S17, "", '' )
+    is( $S18, "", '' )
+    is( $S19, "", '' )
+    is( $S20, "", '' )
+    is( $S21, "", '' )
+    is( $S22, "", '' )
+    is( $S23, "", '' )
+    is( $S24, "", '' )
+    is( $S25, "", '' )
+    is( $S26, "", '' )
+    is( $S27, "", '' )
+    is( $S28, "", '' )
+    is( $S29, "", '' )
+    is( $S30, "", '' )
+    is( $S31, "", '' )
+.end
 
-pasm_output_is( <<'CODE', ord('a'), '2-param ord, multi-character string' );
-    ord I0,"abc"
-    print I0
-    end
-CODE
+.sub same_constant_twice_bug
+   set     $S0, ""
+   set     $S1, ""
+   set     $S2, "foo"
+   concat  $S1,$S1,$S2
+   is( $S1, "foo", 'same constant twice bug' )
+   is( $S0, "", 'same constant twice bug' )
+.end
 
-pasm_output_is( <<'CODE', ord('a'), '2-param ord, one-character string register' );
-    set S0,"a"
-    ord I0,S0
-    print I0
-    end
-CODE
+.sub exception_two_param_ord_empty_string
+   push_eh handler
+   ord $I0,""
+   ok(0, 'no exception: 2-param ord, empty string' )
+  handler:
+   .exception_is( 'Cannot get character of empty string' )
+.end
 
-pasm_output_is( <<'CODE', ord('a'), '3-param ord, one-character string' );
-    ord I0,"a",0
-    print I0
-    end
-CODE
+.sub exception_two_param_ord_empty_string_register
+   push_eh handler
+   ord $I0,$S0
+   ok( 0, 'no exception: 2-param ord, empty string register' )
+ handler:
+   .exception_is( 'Cannot get character of empty string' )
+.end
 
-pasm_output_is( <<'CODE', ord('a'), '3-param ord, one-character string register' );
-    set S0,"a"
-    ord I0,S0,0
-    print I0
-    end
-CODE
+.sub exception_three_param_ord_empty_string
+   push_eh handler
+   ord $I0,"",0
+   ok(0, 'no exception: 3-param ord, empty string' )
+ handler:
+   .exception_is( 'Cannot get character of empty string' )
+.end
 
-pasm_output_is( <<'CODE', ord('b'), '3-param ord, multi-character string' );
-    ord I0,"ab",1
-    print I0
-    end
-CODE
+.sub exception_three_param_ord_empty_string_register
+   push_eh handler
+   ord $I0,$S0,0
+   ok( 0, 'no exception: 3-param ord, empty string register' )
+ handler:
+   .exception_is( 'Cannot get character of empty string' )
+.end
 
-pasm_output_is( <<'CODE', ord('b'), '3-param ord, multi-character string register' );
-    set S0,"ab"
-    ord I0,S0,1
-    print I0
-    end
-CODE
+.sub two_param_ord_one_character_string
+   ord $I0,"a"
+   is( $I0, "97", '2-param ord, one-character string' )
+.end
 
-pasm_error_output_like( <<'CODE', <<'OUTPUT', '3-param ord, multi-character string' );
-    ord I0,"ab",2
-    print I0
-    end
-CODE
-/^Cannot get character past end of string/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', '3-param ord, multi-character string' );
-    set S0,"ab"
-    ord I0,S0,2
-    print I0
-    end
-CODE
-/^Cannot get character past end of string/
-OUTPUT
-
-pasm_output_is( <<'CODE', ord('a'), '3-param ord, one-character string, from end' );
-    ord I0,"a",-1
-    print I0
-    end
-CODE
+.sub two_param_ord_multi_character_string
+   ord $I0,"abc"
+   is( $I0, "97", '2-param ord, multi-character string' )
+.end
 
-pasm_output_is( <<'CODE', ord('a'), '3-param ord, one-character string register, from end' );
-    set S0,"a"
-    ord I0,S0,-1
-    print I0
-    end
-CODE
+.sub two_param_ord_one_character_string_register
+   set $S0,"a"
+   ord $I0,$S0
+   is( $I0, "97", '2-param ord, one-character string register' )
+.end
 
-pasm_output_is( <<'CODE', ord('b'), '3-param ord, multi-character string, from end' );
-    ord I0,"ab",-1
-    print I0
-    end
-CODE
+.sub three_param_ord_one_character_string
+   ord $I0,"a",0
+   is( $I0, "97", '3-param ord, one-character string' )
+.end
 
-pasm_output_is( <<'CODE', ord('b'), '3-param ord, multi-character string register, from end' );
-    set S0,"ab"
-    ord I0,S0,-1
-    print I0
-    end
-CODE
+.sub three_param_ord_one_character_string_register
+   set $S0,"a"
+   ord $I0,$S0,0
+   is( $I0, "97", '3-param ord, one-character string register' )
+.end
 
-pasm_error_output_like(
-    <<'CODE', <<'OUTPUT', '3-param ord, multi-character string register, from end, OOB' );
-    set S0,"ab"
-    ord I0,S0,-3
-    print I0
-        end
-CODE
-/^Cannot get character before beginning of string/
-OUTPUT
-
-pasm_output_is( <<'CODE', chr(32), 'chr of 32 is space in ASCII' );
-        chr S0, 32
-        print S0
-        end
-CODE
-
-pasm_output_is( <<'CODE', chr(65), 'chr of 65 is A in ASCII' );
-        chr S0, 65
-        print S0
-        end
-CODE
-
-pasm_output_is( <<'CODE', chr(122), 'chr of 122 is z in ASCII' );
-        chr S0, 122
-        print S0
-    end
-CODE
+.sub three_param_ord_multi_character_string
+   ord $I0,"ab",1
+   is( $I0, "98", '3-param ord, multi-character string' )
+.end
 
-pasm_output_is( <<'CODE', <<'OUTPUT', 'if_s_ic' );
-    set S0, "I've told you once, I've told you twice..."
-    if  S0, OK1
-    print   "not "
-OK1:    print   "ok 1\n"
-
-    set S0, "0.0"
-    if  S0, OK2
-    print   "not "
-OK2:    print   "ok 2\n"
-
-    set S0, ""
-    if  S0, BAD3
-    branch OK3
-BAD3:   print   "not "
-OK3:    print   "ok 3\n"
-
-    set S0, "0"
-    if  S0, BAD4
-    branch OK4
-BAD4:   print   "not "
-OK4:    print   "ok 4\n"
-
-    set S0, "0e0"
-    if  S0, OK5
-    print   "not "
-OK5:    print   "ok 5\n"
-
-    set S0, "x"
-    if  S0, OK6
-    print   "not "
-OK6:    print   "ok 6\n"
-
-    set S0, "\\x0"
-    if  S0, OK7
-    print   "not "
-OK7:    print   "ok 7\n"
-
-    set S0, "\n"
-    if  S0, OK8
-    print   "not "
-OK8:    print   "ok 8\n"
-
-    set S0, " "
-    if  S0, OK9
-    print   "not "
-OK9:    print   "ok 9\n"
-
-# An empty register should be false...
-        clears
-        if      S1, BAD10
-        branch  OK10
-BAD10:  print   "not "
-OK10:   print   "ok 10\n"
+.sub three_param_ord_multi_character_string_register
+   set $S0,"ab"
+   ord $I0,$S0,1
+   is( $I0, "98", '3-param ord, multi-character string register' )
+.end
 
-    end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-ok 5
-ok 6
-ok 7
-ok 8
-ok 9
-ok 10
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'repeat_s_s|sc_i|ic' );
-    set S0, "x"
-
-    repeat S1, S0, 12
-    print S0
-    print "\n"
-    print S1
-    print "\n"
-
-    set I0, 12
-    set S2, "X"
-
-    repeat S3, S2, I0
-    print S2
-    print "\n"
-    print S3
-    print "\n"
-
-    repeat S4, "~", 12
-    print S4
-    print "\n"
-
-    repeat S5, "~", I0
-    print S5
-    print "\n"
-
-    print ">"
-    repeat S6, "***", 0
-    print S6
-    print "< done\n"
+.sub exception_three_param_ord_multi_character_string
+   push_eh handler
+   ord $I0,"ab",2
+   ok( 0, 'no exception: 3-param ord, multi-character string' )
+ handler:
+   .exception_is( 'Cannot get character past end of string' )
+.end
 
-    end
-CODE
-x
-xxxxxxxxxxxx
-X
-XXXXXXXXXXXX
-~~~~~~~~~~~~
-~~~~~~~~~~~~
->< done
-OUTPUT
+.sub exception_three_param_ord_multi_character_string
+   push_eh handler
+   set $S0,"ab"
+   ord $I0,$S0,2
+   ok( 0, 'no exception: 3-param ord, multi-character string' )
+ handler:
+   .exception_is( 'Cannot get character past end of string' )
+.end
 
-pasm_error_output_like( <<'CODE', qr/Cannot repeat with negative arg\n/, 'repeat OOB' );
-    repeat S0, "japh", -1
-    end
-CODE
+.sub three_param_ord_one_character_string_from_end
+   ord $I0,"a",-1
+   is( $I0, "97", '3-param ord, one-character string, from end' )
+.end
+
+.sub three_param_ord_one_character_string_register_from_end
+   set $S0,"a"
+   ord $I0,$S0,-1
+   is( $I0, "97", '3-param ord, one-character string register, from end' )
+.end
+
+.sub three_param_ord_multi_character_string_from_end
+   ord $I0,"ab",-1
+   is( $I0, "98", '3-param ord, multi-character string, from end' )
+.end
+
+.sub three_param_ord_multi_character_string_register_from_end
+    set $S0,"ab"
+    ord $I0,$S0,-1
+    is( $I0, "98", '3-param ord, multi-character string register, from end' )
+.end
+
+.sub exception_three_param_ord_multi_character_string_register_from_end_oob
+    push_eh handler
+    set $S0,"ab"
+    ord $I0,$S0,-3
+    ok( 0, 'no exception: 3-param ord, multi-character string register, from end, OOB' )
+  handler:
+    .exception_is( 'Cannot get character before beginning of string' )
+.end
+
+.sub chr_of_thirty_two_is_space_in_ascii
+    chr $S0, 32
+    is( $S0, " ", 'chr of 32 is space in ASCII' )
+.end
+
+.sub chr_of_sixty_five_is_a_in_ascii
+    chr $S0, 65
+    is( $S0, "A", 'chr of 65 is A in ASCII' )
+.end
+
+.sub chr_of_one_hundred_and_twenty_two_is_z_in_ascii
+    chr $S0, 122
+    is( $S0, "z", 'chr of 122 is z in ASCII' )
+.end
+
+.sub test_if_s_ic
+    set $S0, "I've told you once, I've told you twice..."
+    ok( $S0, 'normal strings are true' )
+
+    set $S0, "0.0"
+    ok( $S0, '0.0 is true' )
+
+    set $S0, ""
+    nok( $S0, 'empty string is false' )
+
+    set $S0, "0"
+    nok( $S0, '"0" string is false' )
+
+    set $S0, "0e0"
+    ok( $S0, 'string "0e0" is true' )
+
+    set $S0, "x"
+    ok( $S0, 'string "x" is true' )
+
+    set $S0, "\\x0"
+    ok( $S0, 'string "\\x0" is true' )
+
+    set $S0, "\n"
+    ok( $S0, 'string "\n" is true' )
+
+    set $S0, " "
+    ok( $S0, 'string " " is true' )
+
+    # An empty register should be false...
+    clears
+    nok( $S1, 'empty register is false' )
+.end
 
-pir_error_output_like( <<'CODE', qr/Cannot repeat with negative arg\n/, 'repeat OOB, repeat_p_p_p' );
-.sub main
+.sub repeat_s_s_sc_i_ic
+    set $S0, "x"
+    repeat $S1, $S0, 12
+    is( $S0, "x", 'repeat_s_s|sc_i|ic' )
+    is( $S1, "xxxxxxxxxxxx", 'repeat_s_s|sc_i|ic' )
+    
+    set $I0, 12
+    set $S2, "X"
+    repeat $S3, $S2, $I0
+    is( $S2, "X", 'repeat_s_s|sc_i|ic' )
+    is( $S3, "XXXXXXXXXXXX", 'repeat_s_s|sc_i|ic' )
+    
+    repeat $S4, "~", 12
+    is( $S4, "~~~~~~~~~~~~", 'repeat_s_s|sc_i|ic' )
+    
+    repeat $S5, "~", $I0
+    is( $S5, "~~~~~~~~~~~~", 'repeat_s_s|sc_i|ic' )
+   
+  
+    repeat $S6, "***", 0
+    is( $S6, "", 'repeat_s_s|sc_i|ic' )
+.end
+
+.sub exception_repeat_oob
+    push_eh handler
+    repeat $S0, "japh", -1
+  handler:
+    .exception_is( 'Cannot repeat with negative arg' )
+.end
+
+.sub exception_repeat_oob_repeat_p_p_p
+    push_eh handler
     $P0 = new ['String']
     $P1 = new ['String']
     $P2 = new ['Integer']
-
     $P2 = -1
-
     repeat $P1, $P0, $P2
+  handler:
+    .exception_is( 'Cannot repeat with negative arg' )
 .end
-CODE
 
-pir_error_output_like( <<'CODE', qr/Cannot repeat with negative arg\n/, 'repeat OOB, repeate_p_p_i' );
-.sub main
+.sub exception_repeat_oob_repeate_p_p_i
+    push_eh handler
     $P0 = new ['String']
     $P1 = new ['String']
-
     repeat $P1, $P0, -1
+  handler:
+    .exception_is( 'Cannot repeat with negative arg' )
 .end
-CODE
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'encodingname OOB' );
-.sub main
+.sub encodingname_oob
     $I0 = -1
-
     $S0 = encodingname -1
     $S0 = encodingname $I0
-    say 'ok'
+    ok( 1, "no exceptions in encodingname_oob" )
 .end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'index, 3-arg form' );
-      set S0, "Parrot"
-      set S1, "Par"
-      index I1, S0, S1
-      print I1
-      print "\n"
-
-      set S1, "rot"
-      index I1, S0, S1
-      print I1
-      print "\n"
-
-      set S1, "bar"
-      index I1, S0, S1
-      print I1
-      print "\n"
-
-      end
-CODE
-0
-3
--1
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'index, 4-arg form' );
-      set S0, "Barbarian"
-      set S1, "ar"
-      index I1, S0, S1, 0
-      print I1
-      print "\n"
-
-      index I1, S0, S1, 2
-      print I1
-      print "\n"
-
-      set S1, "qwx"
-      index I1, S0, S1, 0
-      print I1
-      print "\n"
-
-      end
-CODE
-1
-4
--1
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'index, 4-arg form, bug 22718' );
-    set S1, "This is not quite right"
-    set S0, " is "
-    index I0, S1, S0, 0
-    print I0
-    set S0, "is"
-    index I0, S1, S0, 0
-    print I0
-    print "\n"
-    end
-CODE
-42
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'index, null strings' );
-      set S0, "Parrot"
-      set S1, ""
-      index I1, S0, S1
-      print I1
-      print "\n"
-
-      index I1, S0, S1, 0
-      print I1
-      print "\n"
-
-      index I1, S0, S1, 5
-      print I1
-      print "\n"
-
-      index I1, S0, S1, 6
-      print I1
-      print "\n"
-
-      set S0, ""
-      set S1, "a"
-      index I1, S0, S1
-      print I1
-      print "\n"
-
-      index I1, S0, S1, 0
-      print I1
-      print "\n"
-
-      set S0, "Parrot"
-      null S1
-      index I1, S0, S1
-      print I1
-      print "\n"
-
-      null S0
-      null S1
-      index I1, S0, S1
-      print I1
-      print "\n"
-      end
-CODE
--1
--1
--1
--1
--1
--1
--1
--1
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'index, embedded nulls' );
-      set S0, "Par\0\0rot"
-      set S1, "\0"
-      index I1, S0, S1
-      print I1
-      print "\n"
-
-      index I1, S0, S1, 4
-      print I1
-      print "\n"
-
-      end
-CODE
-3
-4
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'index, big strings' );
-      set S0, "a"
-      repeat S0, S0, 10000
-      set S1, "a"
-      repeat S1, S1, 500
-      index I1, S0, S1
-      print I1
-      print "\n"
-
-      index I1, S0, S1, 1234
-      print I1
-      print "\n"
-
-      index I1, S0, S1, 9501
-      print I1
-      print "\n"
-
-      end
-CODE
-0
-1234
--1
-OUTPUT
 
-pasm_output_is( <<'CODE', <<'OUTPUT', 'index, big, hard to match strings' );
-# Builds a 24th iteration fibonacci string (approx. 100K)
-      set S1, "a"
-      set S2, "b"
-      set I0, 0
-LOOP:
-      set S3, S1
-      concat S1, S2, S3
-      set S2, S3
-      inc I0
-      lt I0, 24, LOOP
-
-      index I1, S1, S2
-      print I1
-      print "\n"
-
-      index I1, S1, S2, 50000
-      print I1
-      print "\n"
-      end
-CODE
-46368
--1
-OUTPUT
+.sub index_three_arg_form
+    set $S0, "Parrot"
+    set $S1, "Par"
+    index $I1, $S0, $S1
+    is( $I1, "0", 'index, 3-arg form' )
+
+    set $S1, "rot"
+    index $I1, $S0, $S1
+    is( $I1, "3", 'index, 3-arg form' )
+    
+    set $S1, "bar"
+    index $I1, $S0, $S1
+    is( $I1, "-1", 'index, 3-arg form' )
+.end
+
+.sub index_four_arg_form
+    set $S0, "Barbarian"
+    set $S1, "ar"
+    index $I1, $S0, $S1, 0
+    is( $I1, "1", 'index, 4-arg form' )
+    
+    index $I1, $S0, $S1, 2
+    is( $I1, "4", 'index, 4-arg form' )
+    
+    set $S1, "qwx"
+    index $I1, $S0, $S1, 0
+    is( $I1, "-1", 'index, 4-arg form' )
+.end
+
+.sub index_four_arg_form_bug_twenty_two_thousand_seven_hundred_and_eighteen
+    set $S1, "This is not quite right"
+    set $S0, " is "
+    index $I0, $S1, $S0, 0
+    is( $I0, "4", 'index, 4-arg form, bug 22718' )
+    
+    set $S0, "is"
+    index $I0, $S1, $S0, 0
+    is( $I0, "2", 'index, 4-arg form, bug 22718' )
+.end
+
+.sub index_null_strings
+    set $S0, "Parrot"
+    set $S1, ""
+    index $I1, $S0, $S1
+    is( $I1, "-1", 'index, null strings' )
+    
+    index $I1, $S0, $S1, 0
+    is( $I1, "-1", 'index, null strings' )
+   
+    index $I1, $S0, $S1, 5
+    is( $I1, "-1", 'index, null strings' )
+    
+    index $I1, $S0, $S1, 6
+    is( $I1, "-1", 'index, null strings' )
+    
+    set $S0, ""
+    set $S1, "a"
+    index $I1, $S0, $S1
+    is( $I1, "-1", 'index, null strings' )
+    
+    index $I1, $S0, $S1, 0
+    is( $I1, "-1", 'index, null strings' )
+    
+    set $S0, "Parrot"
+    null $S1
+    index $I1, $S0, $S1
+    is( $I1, "-1", 'index, null strings' )
+    
+    null $S0
+    null $S1
+    index $I1, $S0, $S1
+    is( $I1, "-1", 'index, null strings' )
+.end
 
-pir_output_is( << 'CODE', << 'OUTPUT', 'index with different charsets' );
+.sub index_embedded_nulls
+    set $S0, "Par\0\0rot"
+    set $S1, "\0"
+    index $I1, $S0, $S1
+    is( $I1, "3", 'index, embedded nulls' )
+    
+    index $I1, $S0, $S1, 4
+    is( $I1, "4", 'index, embedded nulls' )
+.end
 
-.sub test :main
+.sub index_big_strings
+    set $S0, "a"
+    repeat $S0, $S0, 10000
+    set $S1, "a"
+    repeat $S1, $S1, 500
+    index $I1, $S0, $S1
+    is( $I1, "0", 'index, big strings' )
+   
+    index $I1, $S0, $S1, 1234
+    is( $I1, "1234", 'index, big strings' )
+    
+    index $I1, $S0, $S1, 9501
+    is( $I1, "-1", 'index, big strings' )
+.end
+
+# Builds a 24th iteration fibonacci string (approx. 100K)
+.sub index_big_hard_to_match_strings
+    set $S1, "a"
+    set $S2, "b"
+    set $I0, 0
+  LOOP:
+    set $S3, $S1
+    concat $S1, $S2, $S3
+    set $S2, $S3
+    inc $I0
+    lt $I0, 24, LOOP
+    index $I1, $S1, $S2
+    is( $I1, "46368", 'index, big, hard to match strings' )
+    index $I1, $S1, $S2, 50000
+    is( $I1, "-1", 'index, big, hard to match strings' )
+.end
 
-    print "default - default:\n"
+.sub index_with_different_charsets
     set $S0, "Parrot"
     set $S1, "rot"
     index $I1, $S0, $S1
-    print $I1
-    print "\n"
+    is( $I1, "3", 'default - default' )
 
-    print "ascii - ascii:\n"
     set $S0, ascii:"Parrot"
     set $S1, ascii:"rot"
     index $I1, $S0, $S1
-    print $I1
-    print "\n"
+    is( $I1, "3", 'ascii - ascii')
 
-    print "default - ascii:\n"
     set $S0, "Parrot"
     set $S1, ascii:"rot"
     index $I1, $S0, $S1
-    print $I1
-    print "\n"
+    is( $I1, "3", 'default - ascii' )
 
-    print "ascii - default:\n"
     set $S0, ascii:"Parrot"
     set $S1, "rot"
     index $I1, $S0, $S1
-    print $I1
-    print "\n"
+    is( $I1, "3", 'ascii - default' )
 
-    print "binary - binary:\n"
     set $S0, binary:"Parrot"
     set $S1, binary:"rot"
     index $I1, $S0, $S1
-    print $I1
-    print "\n"
+    is( $I1, "-1", 'binary - binary' )
+.end
 
+.sub negative_index_bug_35959
+    index $I1, "u", "t", -123456
+    is( $I1, "-1", 'negative index #35959' )
+
+    index $I1, "u", "t", -123456789
+    is( $I1, "-1", 'negative index #35959' )
 .end
-CODE
-default - default:
-3
-ascii - ascii:
-3
-default - ascii:
-3
-ascii - default:
-3
-binary - binary:
--1
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'negative index #35959' );
-    index I1, "u", "t", -123456
-    print I1
-    print "\n"
-    index I1, "u", "t", -123456789
-    print I1
-    print "\n"
-    end
-CODE
--1
--1
-OUTPUT
-
-SKIP: {
-    skip( "Pending rework of creating non-ascii literals", 2 );
-    pasm_output_is( <<'CODE', <<'OUTPUT', 'index, multibyte matching' );
-    set S0, "\xAB"
-    find_chartype I0, "8859-1"
-    set_chartype S0, I0
-    find_encoding I0, "singlebyte"
-    set_encoding S0, I0
-
-    find_encoding I0, "utf8"
-    find_chartype I1, "unicode"
-    transcode S1, S0, I0, I1
-
-    eq S0, S1, equal
-    print "not "
-equal:
-    print "equal\n"
-
-    index I0, S0, S1
-    print I0
-    print "\n"
-    index I0, S1, S0
-    print I0
-    print "\n"
-    end
-CODE
-equal
-0
-0
-OUTPUT
-
-    pasm_output_is( <<'CODE', <<'OUTPUT', 'index, multibyte matching 2' );
-    set S0, "\xAB\xBA"
-    set S1, "foo\xAB\xAB\xBAbar"
-    find_chartype I0, "8859-1"
-    set_chartype S0, I0
-    find_encoding I0, "singlebyte"
-    set_encoding S0, I0
-
-    find_chartype I0, "unicode"
-    find_encoding I1, "utf8"
-    transcode S1, S1, I1, I0
-
-    index I0, S0, S1
-    print I0
-    print "\n"
-    index I0, S1, S0
-    print I0
-    print "\n"
-    end
-CODE
--1
-4
-OUTPUT
-}
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'num to string' );
-    set N0, 80.43
-    set S0, N0
-    print S0
-    print "\n"
-
-    set N0, -1.111111
-    set S0, N0
-    print S0
-    print "\n"
-    end
-CODE
-80.43
--1.111111
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'string to int' );
-    set S0, "123"
-    set I0, S0
-    print   I0
-    print   "\n"
-
-    set S0, " 1"
-    set I0, S0
-    print   I0
-    print   "\n"
-
-    set S0, "-1"
-    set I0, S0
-    print   I0
-    print   "\n"
-
-        set     S0, "Not a number"
-    set I0, S0
-    print   I0
-    print   "\n"
-
-    set S0, ""
-    set I0, S0
-    print   I0
-    print   "\n"
 
-    end
-CODE
-123
-1
--1
-0
-0
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'concat/substr (COW)' );
-    set S0, "<JA"
-    set S1, "PH>"
-    set S2, ""
-    concat S2, S2, S0
-    concat S2, S2, S1
-    print S2
-    print "\n"
-    substr S0, S2, 1, 4
-    print S0
-    print "\n"
-    end
-CODE
-<JAPH>
-JAPH
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'constant to cstring' );
-  stringinfo I0, "\n", 2
-  stringinfo I1, "\n", 2
-  eq I1, I0, ok1
-  print "N"
-ok1:
-  print "OK"
-  print "\n"
-  stringinfo I2, "\n", 2
-  eq I2, I0, ok2
-  print "N"
-ok2:
-  print "OK\n"
-  end
-CODE
-OK
-OK
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'COW with chopn leaving original untouched' );
-  set S0, "ABCD"
-  clone S1, S0
-  chopn S0, 1
-  print S0
-  print "\n"
-  print S1
-  print "\n"
-  end
-CODE
-ABC
-ABCD
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'Check that bug #16874 was fixed' );
-  set S0,  "foo     "
-  set S1,  "bar     "
-  set S2,  "quux    "
-  set S15, ""
-  concat S15, S0
-  concat S15, S1
-  concat S15, S2
-  print "["
-  print S15
-  print "]\n"
-  end
-CODE
-[foo     bar     quux    ]
-OUTPUT
-
-pasm_output_is( <<'CODE', "all ok\n", 'stress concat' );
- set I0, 1000
- set S0, "michael"
-LOOP:
- set S2, I0
- concat S1, S0, S2
- concat S3, "mic", "hael"
- concat S3, S3, S2
- eq S1, S3, BOTTOM
- print "Failed: "
- print S1
- print " ne "
- print S3
- print "\n"
- end
-BOTTOM:
- sub I0, I0, 1
- ne I0, 0, LOOP
- print "all ok\n"
- end
-CODE
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'ord and substring (see #17035)' );
-  set S0, "abcdef"
-  substr S1, S0, 2, 3
-  ord I0, S0, 2
-  ord I1, S1, 0
-  ne I0, I1, fail
-  ord I0, S0, 3
-  ord I1, S1, 1
-  ne I0, I1, fail
-  ord I0, S0, 4
-  ord I1, S1, 2
-  ne I0, I1, fail
-  print "It's all good\n"
-  end
-fail:
-  print "Not good: original string="
-  print I0
-  print ", substring="
-  print I1
-  print "\n"
-  end
-CODE
-It's all good
-OUTPUT
+.sub index_multibyte_matching
+    skip( 3, "Pending rework of creating non-ascii literals" )
 
-pasm_output_is( <<'CODE', <<'OUTPUT', 'sprintf' );
-    branch MAIN
+    # set $S0, "\xAB"
+    # find_chartype $I0, "8859-1"
+    # set_chartype $S0, $I0
+    # find_encoding $I0, "singlebyte"
+    # set_encoding $S0, $I0
+    # find_encoding $I0, "utf8"
+    # find_chartype $I1, "unicode"
+    # transcode $S1, $S0, $I0, $I1
+    # is( $S0, $S1, 'equal' );
 
-NEWARYP:
-    new P1, 'ResizablePMCArray'
-    set P1[0], P0
-    ret
-NEWARYS:
-    new P1, 'ResizablePMCArray'
-    set P1[0], S0
-    ret
-NEWARYI:
-    new P1, 'ResizablePMCArray'
-    set P1[0], I0
-    ret
-NEWARYN:
-    new P1, 'ResizablePMCArray'
-    set P1[0], N0
-    ret
-PRINTF:
-    sprintf S2, S1, P1
-    print S2
-    ret
-
-MAIN:
-    set S1, "Hello, %s\n"
-    set S0, "Parrot!"
-    bsr NEWARYS
-    bsr PRINTF
-
-    set S1, "Hash[0x%x]\n"
-    set I0, 256
-    bsr NEWARYI
-    bsr PRINTF
-
-    set S1, "Hash[0x%lx]\n"
-    set I0, 256
-    bsr NEWARYI
-    bsr PRINTF
-
-    set S1, "Hello, %.2s!\n"
-    set S0, "Parrot"
-    bsr NEWARYS
-    bsr PRINTF
-
-    set S1, "Hello, %Ss"
-    set S0, S2
-    bsr NEWARYS
-    bsr PRINTF
-
-    set S1, "1 == %Pd\n"
-    new P0, 'Integer'
-    set P0, 1
-    bsr NEWARYP
-    bsr PRINTF
-
-    set S1, "-255 == %vd\n"
-    set I0, -255
-    bsr NEWARYI
-    bsr PRINTF
-
-    set S1, "+123 == %+vd\n"
-    set I0, 123
-    bsr NEWARYI
-    bsr PRINTF
-
-    set S1, "256 == %vu\n"
-    set I0, 256
-    bsr NEWARYI
-    bsr PRINTF
-
-    set S1, "1 == %+vu\n"
-    set I0, 1
-    bsr NEWARYI
-    bsr PRINTF
-
-    set S1, "001 == %0.3u\n"
-    set I0, 1
-    bsr NEWARYI
-    bsr PRINTF
-
-    set S1, "001 == %+0.3u\n"
-    set I0, 1
-    bsr NEWARYI
-    bsr PRINTF
-
-    set S1, "0.500000 == %f\n"
-    set N0, 0.5
-    bsr NEWARYN
-    bsr PRINTF
-
-    set S1, "0.500 == %5.3f\n"
-    set N0, 0.5
-    bsr NEWARYN
-    bsr PRINTF
-
-    set S1, "0.001 == %g\n"
-    set N0, 0.001
-    bsr NEWARYN
-    bsr PRINTF
-
-    set S1, "1e+06 == %g\n"
-    set N0, 1.0e6
-    bsr NEWARYN
-    bsr PRINTF
-
-    set S1, "0.5 == %3.3g\n"
-    set N0, 0.5
-    bsr NEWARYN
-    bsr PRINTF
-
-    set S1, "%% == %%\n"
-    set I0, 0
-    bsr NEWARYI
-    bsr PRINTF
-
-    set S1, "That's all, %s\n"
-    set S0, "folks!"
-    bsr NEWARYS
-    bsr PRINTF
+    # index $I0, $S0, $S1
+    # is( $I0, "0", 'index, multibyte matching' )
 
-    end
-CODE
-Hello, Parrot!
-Hash[0x100]
-Hash[0x100]
-Hello, Pa!
-Hello, Hello, Pa!
-1 == 1
--255 == -255
-+123 == +123
-256 == 256
-1 == 1
-001 == 001
-001 == 001
-0.500000 == 0.500000
-0.500 == 0.500
-0.001 == 0.001
-1e+06 == 1e+06
-0.5 == 0.5
-% == %
-That's all, folks!
-OUTPUT
+    # index $I0, $S1, $S0
+    # is( $I0, "0", 'index, multibyte matching' )
+.end
 
-pasm_output_is( <<'CODE', <<'OUTPUT', 'other form of sprintf op' );
-    branch MAIN
+.sub index_multibyte_matching_two
+    skip( 2, "Pending rework of creating non-ascii literals" )
+    # set $S0, "\xAB\xBA"
+    # set $S1, "foo\xAB\xAB\xBAbar"
+    # find_chartype $I0, "8859-1"
+    # set_chartype $S0, $I0
+    # find_encoding $I0, "singlebyte"
+    # set_encoding $S0, $I0
+    # find_chartype $I0, "unicode"
+    # find_encoding $I1, "utf8"
+    # transcode $S1, $S1, $I1, $I0
+    # index $I0, $S0, $S1
+    # is( $I0, "-1", 'index, multibyte matching 2' )
+    # index $I0, $S1, $S0
+    # is( $I0, "4", 'index, multibyte matching 2' )
+.end
 
-PRINTF:
-    sprintf P3, P2, P1
-    print P3
-    ret
-
-MAIN:
-    new P3, 'String'
-
-    new P2, 'String'
-    set P2, "15 is %b\n"
-    new P1, 'ResizablePMCArray'
-    set P1[0], 15
-    bsr PRINTF
-
-    new P2, 'String'
-    set P2, "128 is %o\n"
-    new P1, 'ResizablePMCArray'
-    set P1[0], 128
-    bsr PRINTF
+.sub num_to_string
+    set $N0, 80.43
+    set $S0, $N0
+    is( $S0, "80.43", 'num to string' )
+
+    set $N0, -1.111111
+    set $S0, $N0
+    is( $S0, "-1.111111", 'num to string' )
+.end
 
-    end
-CODE
-15 is 1111
-128 is 200
-OUTPUT
+.sub string_to_int
+    set $S0, "123"
+    set $I0, $S0
+    is( $I0, "123", 'string to int' )
+
+    set $S0, " 1"
+    set $I0, $S0
+    is( $I0, "1", 'string to int' )
+    
+    set $S0, "-1"
+    set $I0, $S0
+    is( $I0, "-1", 'string to int' )
+    
+    set     $S0, "Not a number"
+    set $I0, $S0
+    is( $I0, "0", 'string to int' )
+    
+    set $S0, ""
+    set $I0, $S0
+    is( $I0, "0", 'string to int' )
+.end
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'sprintf - left justify' );
-.sub main :main
-  $P0 = new 'ResizablePMCArray'
-  $P1 = new 'Integer'
-  $P1 = 10
-  $P0[0] = $P1
-  $P1 = new 'String'
-  $P1 = "foo"
-  $P0[1] = $P1
-  $P1 = new 'String'
-  $P1 = "bar"
-  $P0[2] = $P1
-  $S0 = sprintf "%-*s - %s\n", $P0
-  print $S0
-  end
-.end
-CODE
-foo        - bar
-OUTPUT
-
-{
-    my $output = substr( ( 'f' x ( $PConfig{intvalsize} * 2 ) ) . ( ' ' x 20 ), 0, 20 );
-    pir_output_is( <<'CODE', $output, 'Correct precision for %x' ); }
-.sub main :main
-  $P0 = new 'ResizablePMCArray'
-  $P0[0] = -1
-  $S0 = sprintf "%-20x", $P0
-  print $S0
-  end
-.end
-CODE
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'exchange' );
-    set S0, "String #0\n"
-    set S1, "String #1\n"
-    exchange S0, S1
-    print S0
-    print S1
-
-    set S2, "String #2\n"
-    exchange S2, S2
-    print S2
+.sub concat_or_substr_cow
+    set $S0, "<JA"
+    set $S1, "PH>"
+    set $S2, ""
+    concat $S2, $S2, $S0
+    concat $S2, $S2, $S1
+    is( $S2, "<JAPH>", 'concat/substr (COW)' )
+   
+    substr $S0, $S2, 1, 4
+    is( $S0, "JAPH", 'concat/substr (COW)' )
+.end
 
-    end
-CODE
-String #1
-String #0
-String #2
-OUTPUT
-
-SKIP: {
-    skip( "Pending reimplementation of find_encoding", 1 );
-    pasm_output_is( <<'CODE', <<'OUTPUT', 'find_encoding' );
-      find_encoding I0, "singlebyte"
-      print I0
-      print "\n"
-      find_encoding I0, "utf8"
-      print I0
-      print "\n"
-      find_encoding I0, "utf16"
-      print I0
-      print "\n"
-      find_encoding I0, "utf32"
-      print I0
-      print "\n"
-      end
-CODE
-0
-1
-2
-3
-OUTPUT
-}
-
-SKIP: {
-    skip( "no more visible encoding", 1 );
-    pasm_output_is( <<'CODE', <<'OUTPUT', 'string_encoding' );
-      set I0, 0
-      new S0, 0, I0
-      string_encoding I1, S0
-      eq I0, I1, OK1
-      print "not "
-OK1:  print "ok 1\n"
-
-      set I0, 1
-      new S0, 0, I0
-      string_encoding I1, S0
-      eq I0, I1, OK2
-      print "not "
-OK2:  print "ok 2\n"
-
-      set I0, 2
-      new S0, 0, I0
-      string_encoding I1, S0
-      eq I0, I1, OK3
-      print "not "
-OK3:  print "ok 3\n"
-
-      set I0, 3
-      new S0, 0, I0
-      string_encoding I1, S0
-      eq I0, I1, OK4
-      print "not "
-OK4:  print "ok 4\n"
-
-      end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-OUTPUT
-}
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'assign' );
-    set S4, "JAPH\n"
-    assign  S5, S4
-    print   S4
-    print   S5
-    end
-CODE
-JAPH
-JAPH
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'assign & globber' );
-    set S4, "JAPH\n"
-    assign  S5, S4
-    assign  S4, "Parrot\n"
-    print   S4
-    print   S5
-    end
-CODE
-Parrot
-JAPH
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'assign & globber 2' );
-    set S4, "JAPH\n"
-    set     S5, S4
-    assign  S4, "Parrot\n"
-    print   S4
-    print   S5
-    end
-CODE
-Parrot
-Parrot
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'bands NULL string' );
-    null S1
-    set S2, "abc"
-    bands S1, S2
-    null S3
-    eq S1, S3, ok1
-    print "not "
-ok1:    print "ok 1\n"
-    set S1, ""
-    bands S1, S2
-    unless S1, ok2
-    print "not "
-ok2:    print "ok 2\n"
-
-    null S2
-    set S1, "abc"
-    bands S1, S2
-    null S3
-    eq S1, S3, ok3
-    print "not "
-ok3:    print "ok 3\n"
-    set S2, ""
-    bands S1, S2
-    unless S1, ok4
-    print "not "
-ok4:    print "ok 4\n"
-    end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'bands 2' );
-    set S1, "abc"
-    set S2, "EE"
-    bands S1, S2
-    print S1
-    print "\n"
-    print S2
-    print "\n"
-    end
-CODE
-A@
-EE
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'bands 3' );
-    set S1, "abc"
-    set S2, "EE"
-    bands S0, S1, S2
-    print S0
-    print "\n"
-    print S1
-    print "\n"
-    print S2
-    print "\n"
-    end
-CODE
-A@
-abc
-EE
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'bands COW' );
-  set S1, "foo"
-  substr S2, S1, 0, 3
-  bands S1, "bar"
-  print S2
-  print "\n"
-  end
-CODE
-foo
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'bors NULL string' );
-     null S1
-     null S2
-     bors S1, S2
-     null S3
-     eq S1, S3, OK1
-     print "not "
-OK1: print "ok 1\n"
-
-     null S1
-     set S2, ""
-     bors S1, S2
-     null S3
-     eq S1, S3, OK2
-     print "not "
-OK2: print "ok 2\n"
-     bors S2, S1
-     eq S2, S3, OK3
-     print "not "
-OK3: print "ok 3\n"
-
-     null S1
-     set S2, "def"
-     bors S1, S2
-     eq S1, "def", OK4
-     print "not "
-OK4: print "ok 4\n"
-     null S2
-     bors S1, S2
-     eq S1, "def", OK5
-     print "not "
-OK5: print "ok 5\n"
-
-     null S1
-     null S2
-     bors S3, S1, S2
-     null S4
-     eq S3, S4, OK6
-     print "not "
-OK6: print "ok 6\n"
-
-     set S1, ""
-     bors S3, S1, S2
-     eq S3, S4, OK7
-     print "not "
-OK7: print "ok 7\n"
-     bors S3, S2, S1
-     eq S3, S4, OK8
-     print "not "
-OK8: print "ok 8\n"
-
-     set S1, "def"
-     bors S3, S1, S2
-     eq S3, "def", OK9
-     print "not "
-OK9: print "ok 9\n"
-     bors S3, S2, S1
-     eq S3, "def", OK10
-     print "not "
-OK10: print "ok 10\n"
-     end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-ok 5
-ok 6
-ok 7
-ok 8
-ok 9
-ok 10
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'bors 2' );
-    set S1, "abc"
-    set S2, "EE"
-    bors S1, S2
-    print S1
-    print "\n"
-    print S2
-    print "\n"
-    end
-CODE
-egc
-EE
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'bors 3' );
-    set S1, "abc"
-    set S2, "EE"
-    bors S0, S1, S2
-    print S0
-    print "\n"
-    print S1
-    print "\n"
-    print S2
-    print "\n"
-    end
-CODE
-egc
-abc
-EE
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'bors COW' );
-  set S1, "foo"
-  substr S2, S1, 0, 3
-  bors S1, "bar"
-  print S2
-  print "\n"
-  end
-CODE
-foo
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'bxors NULL string' );
-     null S1
-     null S2
-     bxors S1, S2
-     null S3
-     eq S1, S3, OK1
-     print "not "
-OK1: print "ok 1\n"
-
-     null S1
-     set S2, ""
-     bxors S1, S2
-     null S3
-     eq S1, S3, OK2
-     print "not "
-OK2: print "ok 2\n"
-     bxors S2, S1
-     eq S2, S3, OK3
-     print "not "
-OK3: print "ok 3\n"
-
-     null S1
-     set S2, "abc"
-     bxors S1, S2
-     eq S1, "abc", OK4
-     print "not "
-OK4: print "ok 4\n"
-     null S2
-     bxors S1, S2
-     eq S1, "abc", OK5
-     print "not "
-OK5: print "ok 5\n"
-
-     null S1
-     null S2
-     bxors S3, S1, S2
-     null S4
-     eq S3, S4, OK6
-     print "not "
-OK6: print "ok 6\n"
-
-     set S1, ""
-     bxors S3, S1, S2
-     eq S3, S4, OK7
-     print "not "
-OK7: print "ok 7\n"
-     bxors S3, S2, S1
-     eq S3, S4, OK8
-     print "not "
-OK8: print "ok 8\n"
-
-     set S1, "abc"
-     bxors S3, S1, S2
-     eq S3, "abc", OK9
-     print "not "
-OK9: print "ok 9\n"
-     bxors S3, S2, S1
-     eq S3, "abc", OK10
-     print "not "
-OK10: print "ok 10\n"
-     end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-ok 5
-ok 6
-ok 7
-ok 8
-ok 9
-ok 10
-OUTPUT
-
-# string_133.pasm, used for t/native_pbc/string.t
-pasm_output_is( <<'CODE', <<'OUTPUT', 'bxors 2' );
- set S1, "a2c"
- set S2, "Dw"
- bxors S1, S2
- print S1
- print "\n"
- print S2
- print "\n"
-    set S1, "abc"
-    set S2, "   X"
-    bxors S1, S2
-    print S1
- print "\n"
- print S2
- print "\n"
- end
-CODE
-%Ec
-Dw
-ABCX
-   X
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'bxors 3' );
- set S1, "a2c"
- set S2, "Dw"
- bxors S0, S1, S2
- print S0
- print "\n"
- print S1
- print "\n"
- print S2
- print "\n"
-    set S1, "abc"
-    set S2, "   Y"
-    bxors S0, S1, S2
- print S0
- print "\n"
-    print S1
- print "\n"
- print S2
- print "\n"
- end
-CODE
-%Ec
-a2c
-Dw
-ABCY
-abc
-   Y
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'bxors COW' );
-  set S1, "foo"
-  substr S2, S1, 0, 3
-  bxors S1, "bar"
-  print S2
-  print "\n"
-  end
-CODE
-foo
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'bnots NULL string' );
-     null S1
-     null S2
-     bnots S1, S2
-     null S3
-     eq S1, S3, OK1
-     print "not "
-OK1: print "ok 1\n"
-
-     null S1
-     set S2, ""
-     bnots S1, S2
-     null S3
-     eq S1, S3, OK2
-     print "not "
-OK2: print "ok 2\n"
-     bnots S2, S1
-     eq S2, S3, OK3
-     print "not "
-OK3: print "ok 3\n"
-     end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-SKIP: {
-    skip( "No unicode yet", 1 );
-    # This was the previous test used for t/native_pbc/string.t
-    pasm_output_is( <<'CODE', <<'OUTPUT', 'bnots 2' );
- getstdout P0
- push P0, "utf8"
- set S1, "a2c"
- bnots S2, S1
- print S1
- print "\n"
- print S2
- print "\n"
- bnots S1, S1
- print S1
- print "\n"
- bnots S1, S1
- print S1
- print "\n"
- end
-CODE
-a2c
-\xC2\x9E\xC3\x8D\xC2\x9C
-\xC2\x9E\xC3\x8D\xC2\x9C
-a2c
-OUTPUT
-}
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'bnots COW' );
-  set S1, "foo"
-  substr S2, S1, 0, 3
-  bnots S1, S1
-  print S2
-  print "\n"
-  end
-CODE
-foo
-OUTPUT
-
-SKIP: {
-    skip( "no more transcode", 1 );
-    pasm_output_is( <<'CODE', <<'OUTPUT', 'transcode to utf8' );
-  set S1, "ASCII is the same as UTF8\n"
-  find_encoding I1, "utf8"
-  transcode S2, S1, I1
-  print S1
-  print S2
-  end
-CODE
-ASCII is the same as UTF8
-ASCII is the same as UTF8
-OUTPUT
-}
-
-SKIP: {
-    skip( "no more chartype", 1 );
-    pasm_output_is( <<'CODE', <<'OUTPUT', 'string_chartype' );
-    set S0, "Test String"
-    find_chartype I0, "usascii"
-    set_chartype S0, I0
-    string_chartype I1, S0
-    eq I1, I0, OK
-    print I0
-    print "\n"
-    print I1
-    print "\n"
-    print "not "
-OK: print "ok\n"
-    end
-CODE
-ok
-OUTPUT
-}
-
-# Set all string registers to values given by &$_[0](reg num)
-sub set_str_regs {
-    my $code = shift;
-    my $rt;
-    for ( 0 .. 31 ) {
-        $rt .= "\tset S$_, \"" . &$code($_) . "\"\n";
-    }
-    return $rt;
-}
-
-# print string registers, no additional prints
-sub print_str_regs {
-    my $rt;
-    for ( 0 .. 31 ) {
-        $rt .= "\tprint S$_\n";
-    }
-    return $rt;
-}
-
-# Generate code to compare each pair of strings in a list
-sub compare_strings {
-    my $const   = shift;
-    my $op      = shift;
-    my @strings = @_;
-    my $i       = 1;
-    my $rt;
-    while (@strings) {
-        my $s1 = shift @strings;
-        my $s2 = shift @strings;
-        my $arg1;
-        my $arg2;
-        if ( $const == 3 ) {
-            $arg1 = "\"$s1\"";
-            $arg2 = "\"$s2\"";
-        }
-        elsif ( $const == 2 ) {
-            $rt .= "    set S0, \"$s1\"\n";
-            $arg1 = "S0";
-            $arg2 = "\"$s2\"";
-        }
-        elsif ( $const == 1 ) {
-            $rt .= "    set S0, \"$s2\"\n";
-            $arg1 = "\"$s1\"";
-            $arg2 = "S0";
-        }
-        else {
-            $rt .= "    set S0, \"$s1\"\n";
-            $rt .= "    set S1, \"$s2\"\n";
-            $arg1 = "S0";
-            $arg2 = "S1";
-        }
-        if ( eval "\"$s1\" $op \"$s2\"" ) {
-            $rt .= "    $op $arg1, $arg2, OK$i\n";
-            $rt .= "    branch ERROR\n";
-        }
-        else {
-            $rt .= "    $op $arg1, $arg2, ERROR\n";
-        }
-        $rt .= "OK$i:\n";
-        $i++;
-    }
-    return $rt;
-}
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'split on empty string' );
-_main:
-    split P1, "", ""
-    set I1, P1
-    print I1
-    print "\n"
-    split P0, "", "ab"
-    set I0, P0
-    print I0
-    print "\n"
-    set S0, P0[0]
-    print S0
-    set S0, P0[1]
-    print S0
-    print "\n"
-    end
-CODE
-0
-2
-ab
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'split on non-empty string' );
-_main:
-    split P0, "a", "afooabara"
-    set I0, P0
-    print I0
-    print "\n"
-    set I1, 0
-loop:
-    set S0, P0[I1]
-    print S0
-    print "\n"
-    inc I1
-    sub I2, I1, I0
-    if I2, loop
-    end
-CODE
-5
+.sub constant_to_cstring
+    stringinfo $I0, "\n", 2
+    stringinfo $I1, "\n", 2
+    is( $I1, $I0, 'constant to cstring' )
 
-foo
-b
-r
+    stringinfo $I2, "\n", 2
+    is( $I2, $I0, 'constant to cstring' )
+.end
 
-OUTPUT
+.sub cow_with_chopn_leaving_original_untouched
+    set $S0, "ABCD"
+    clone $S1, $S0
+    chopn $S0, 1
+    is( $S0, "ABC", 'COW with chopn leaving original untouched' )
+    is( $S1, "ABCD", 'COW with chopn leaving original untouched' )
+.end
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'split HLL mapped' );
-.HLL 'foohll'
-.sub main
-    .local pmc RSA, fooRSA
-    RSA = get_class ['ResizableStringArray']
-    fooRSA = subclass ['ResizableStringArray'], 'fooRSA'
-    .local pmc interp
+.sub check_that_bug_bug_16874_was_fixed
+    set $S0,  "foo     "
+    set $S1,  "bar     "
+    set $S2,  "quux    "
+    set $S15, ""
+    concat $S15, $S0
+    concat $S15, $S1
+    concat $S15, $S2
+    is( $S15, "foo     bar     quux    ", 'Check that bug #16874 was fixed' )
+.end
+
+.sub stress_concat
+    set $I0, 1000
+    set $S0, "michael"
+  LOOP:
+    set $S2, $I0
+    concat $S1, $S0, $S2
+    concat $S3, "mic", "hael"
+    concat $S3, $S3, $S2
+    eq $S1, $S3, BOTTOM
+    ok(0, 'failed stress concat test')
+    end
+
+  BOTTOM:
+    sub $I0, $I0, 1
+    ne $I0, 0, LOOP
+    ok(1, 'stress concat test')
+.end
+
+.sub ord_and_substring_see_bug_17035
+    set $S0, "abcdef"
+    substr $S1, $S0, 2, 3
+    ord $I0, $S0, 2
+    ord $I1, $S1, 0
+    ne $I0, $I1, fail
+    ord $I0, $S0, 3
+    ord $I1, $S1, 1
+    ne $I0, $I1, fail
+    ord $I0, $S0, 4
+    ord $I1, $S1, 2
+    ne $I0, $I1, fail
+    ok(1, 'ord and substring #17035')
+    goto end
+  fail:
+    ok(0, 'failed: ord and substring #17035')
+  end:
+.end
+
+.sub test_sprintf
+    branch MAIN
+  NEWARYP:
+    new $P1, 'ResizablePMCArray'
+    set $P1[0], $P0
+    local_return $P4
+  NEWARYS:
+    new $P1, 'ResizablePMCArray'
+    set $P1[0], $S0
+    local_return $P4
+  NEWARYI:
+    new $P1, 'ResizablePMCArray'
+    set $P1[0], $I0
+    local_return $P4
+  NEWARYN:
+    new $P1, 'ResizablePMCArray'
+    set $P1[0], $N0
+    local_return $P4
+  PRINTF:
+    sprintf $S2, $S1, $P1
+    is( $S2, $S99, $S1 )
+    local_return $P4
+
+  MAIN:
+    new $P4, 'ResizableIntegerArray'
+    set $S1, "Hello, %s"
+    set $S0, "Parrot!"
+    set $S99, "Hello, Parrot!"
+    local_branch $P4, NEWARYS
+    local_branch $P4, PRINTF
+
+    set $S1, "Hash[0x%x]"
+    set $I0, 256
+    set $S99, "Hash[0x100]"
+    local_branch $P4, NEWARYI
+    local_branch $P4, PRINTF
+
+    set $S1, "Hash[0x%lx]"
+    set $I0, 256
+    set $S99, "Hash[0x100]"
+    local_branch $P4, NEWARYI
+    local_branch $P4, PRINTF
+
+    set $S1, "Hello, %.2s!"
+    set $S0, "Parrot"
+    set $S99, "Hello, Pa!"
+    local_branch $P4, NEWARYS
+    local_branch $P4, PRINTF
+
+    set $S1, "Hello, %Ss"
+    set $S0, $S2
+    set $S99, "Hello, Hello, Pa!"
+    local_branch $P4, NEWARYS
+    local_branch $P4, PRINTF
+
+    set $S1, "1 == %Pd"
+    new $P0, 'Integer'
+    set $P0, 1
+    set $S99, "1 == 1"
+    local_branch $P4, NEWARYP
+    local_branch $P4, PRINTF
+
+    set $S1, "-255 == %vd"
+    set $I0, -255
+    set $S99, "-255 == -255"
+    local_branch $P4, NEWARYI
+    local_branch $P4, PRINTF
+
+    set $S1, "+123 == %+vd"
+    set $I0, 123
+    set $S99, "+123 == +123"
+    local_branch $P4, NEWARYI
+    local_branch $P4, PRINTF
+
+    set $S1, "256 == %vu"
+    set $I0, 256
+    set $S99, "256 == 256"
+    local_branch $P4, NEWARYI
+    local_branch $P4, PRINTF
+
+    set $S1, "1 == %+vu"
+    set $I0, 1
+    set $S99, "1 == 1"
+    local_branch $P4, NEWARYI
+    local_branch $P4, PRINTF
+
+    set $S1, "001 == %0.3u"
+    set $I0, 1
+    set $S99, "001 == 001"
+    local_branch $P4, NEWARYI
+    local_branch $P4, PRINTF
+
+    set $S1, "001 == %+0.3u"
+    set $I0, 1
+    set $S99, "001 == 001"
+    local_branch $P4, NEWARYI
+    local_branch $P4, PRINTF
+
+    set $S1, "0.500000 == %f"
+    set $N0, 0.5
+    set $S99, "0.500000 == 0.500000"
+    local_branch $P4, NEWARYN
+    local_branch $P4, PRINTF
+
+    set $S1, "0.500 == %5.3f"
+    set $N0, 0.5
+    set $S99, "0.500 == 0.500"
+    local_branch $P4, NEWARYN
+    local_branch $P4, PRINTF
+
+    set $S1, "0.001 == %g"
+    set $N0, 0.001
+    set $S99, "0.001 == 0.001"
+    local_branch $P4, NEWARYN
+    local_branch $P4, PRINTF
+
+    set $S1, "1e+06 == %g"
+    set $N0, 1.0e6
+    set $S99, "1e+06 == 1e+06"
+    local_branch $P4, NEWARYN
+    local_branch $P4, PRINTF
+
+    set $S1, "0.5 == %3.3g"
+    set $N0, 0.5
+    set $S99, "0.5 == 0.5"
+    local_branch $P4, NEWARYN
+    local_branch $P4, PRINTF
+
+    set $S1, "%% == %%"
+    set $I0, 0
+    set $S99, "% == %"
+    local_branch $P4, NEWARYI
+    local_branch $P4, PRINTF
+
+    set $S1, "That's all, %s"
+    set $S0, "folks!"
+    set $S99, "That's all, folks!"
+    local_branch $P4, NEWARYS
+    local_branch $P4, PRINTF
+.end
+
+.sub other_form_of_sprintf_op
+    new $P4, 'ResizableIntegerArray'
+    new $P3, 'String'
+    new $P2, 'String'
+    set $P2, "15 is %b"
+    new $P1, 'ResizablePMCArray'
+    set $P1[0], 15
+    sprintf $P3, $P2, $P1
+    is( $P3, "15 is 1111", 'other form of sprintf op' )
+
+    new $P2, 'String'
+    set $P2, "128 is %o"
+    new $P1, 'ResizablePMCArray'
+    set $P1[0], 128
+    sprintf $P3, $P2, $P1
+    is( $P3, "128 is 200", 'other form of sprintf op' )
+.end
+
+.sub sprintf_left_justify
+    $P0 = new 'ResizablePMCArray'
+    $P1 = new 'Integer'
+    $P1 = 10
+    $P0[0] = $P1
+    $P1 = new 'String'
+    $P1 = "foo"
+    $P0[1] = $P1
+    $P1 = new 'String'
+    $P1 = "bar"
+    $P0[2] = $P1
+    $S0 = sprintf "%-*s - %s", $P0
+    is( $S0, "foo        - bar", 'sprintf - left justify' )
+.end
+
+
+.sub correct_precision_for_sprintf_x
+    .include "iglobals.pasm"
+
+    # Create the string via concat
+    .local pmc interp     # a handle to our interpreter object.
     interp = getinterp
-    interp.'hll_map'(RSA, fooRSA)
-    .local pmc a
-    split a, "a", "afooabara"
-    .local string t
-    t = typeof a
-    say t
-    .local int n, i
-    n = a
-    say n
-    i = 0
-loop:
-    .local string s
-    s = a[i]
-    say s
-    inc i
-    if i != n goto loop
-.end
-CODE
-fooRSA
-5
-
-foo
-b
-r
-
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'join' );
-_main:
-    new P0, 'ResizablePMCArray'
-    join S0, "--", P0
-    print S0
-    print "\n"
-    push P0, "a"
-    join S0, "--", P0
-    print S0
-    print "\n"
-    new P0, 'ResizablePMCArray'
-    push P0, "a"
-    push P0, "b"
-    join S0, "--", P0
-    print S0
-    print "\n"
-    end
-CODE
+    .local pmc config
+    config = interp[.IGLOBALS_CONFIG_HASH]
+    .local int intvalsize 
+    intvalsize = config['intvalsize']
+
+    $S0 = ''
+    $I0 = 1
+    $I1 = intvalsize * 2
+  loop:
+    concat $S0, 'f'
+    inc $I0
+    le $I0, $I1, loop
+  padding_loop:
+    concat $S0, ' '
+    inc $I0
+    le $I0, 20, padding_loop
+    
+    # Now see what sprintf comes up with
+    $P0 = new 'ResizablePMCArray'
+    $P0[0] = -1
+    $S1 = sprintf "%-20x", $P0
+    is( $S1, $S0, 'Correct precision for %x' )
+.end
+
+.sub test_exchange
+    set $S0, "String #0"
+    set $S1, "String #1"
+    exchange $S0, $S1
+    is( $S0, "String #1", 'exchange' )
+    is( $S1, "String #0", 'exchange' )
+    
+    set $S2, "String #2"
+    exchange $S2, $S2
+    is( $S2, "String #2", 'exchange' )
+.end
+
+.sub test_find_encoding
+    skip( 4, "Pending reimplementation of find_encoding" )
+    # find_encoding $I0, "singlebyte"
+    # is( $I0, "0", 'find_encoding' )
+    # find_encoding $I0, "utf8"
+    # is( $I0, "1", 'find_encoding' )
+    # find_encoding $I0, "utf16"
+    # is( $I0, "2", 'find_encoding' )
+    # find_encoding $I0, "utf32"
+    # is( $I0, "3", 'find_encoding' )
+.end
+
+.sub test_string_encoding
+    skip(4, "no more visible encoding" )
+    # set $I0, 0
+    # new $S0, 0, $I0
+    # string_encoding $I1, $S0
+    # eq $I0, $I1, OK1
+    # print "not "
+    # OK1:  print "ok 1\n"
+    # set $I0, 1
+    # new $S0, 0, $I0
+    # string_encoding $I1, $S0
+    # eq $I0, $I1, OK2
+    # print "not "
+    # OK2:  print "ok 2\n"
+    # set $I0, 2
+    # new $S0, 0, $I0
+    # string_encoding $I1, $S0
+    # eq $I0, $I1, OK3
+    # print "not "
+    # OK3:  print "ok 3\n"
+    # set $I0, 3
+    # new $S0, 0, $I0
+    # string_encoding $I1, $S0
+    # eq $I0, $I1, OK4
+    # print "not "
+    # OK4:  print "ok 4\n"
+.end
+
+.sub test_assign
+    set $S4, "JAPH"
+    assign  $S5, $S4
+    is( $S4, "JAPH", 'assign' )
+    is( $S5, "JAPH", 'assign' )
+.end
+
+.sub assign_and_globber
+    set $S4, "JAPH"
+    assign  $S5, $S4
+    assign  $S4, "Parrot"
+    is( $S4, "Parrot", 'assign & globber' )
+    is( $S5, "JAPH", 'assign & globber' )
+.end
 
-a
-a--b
-OUTPUT
+.sub assign_and_globber_2
+    set $S4, "JAPH"
+    set     $S5, $S4
+    assign  $S4, "Parrot"
+    is( $S4, "Parrot", 'assign & globber 2' )
+    is( $S5, "Parrot", 'assign & globber 2' )
+.end
+
+.sub bands_null_string
+    null $S1
+    set $S2, "abc"
+    bands $S1, $S2
+    null $S3
+    is( $S1, $S3, 'ok1' )
+
+    set $S1, ""
+    bands $S1, $S2
+    nok( $S1, 'ok2' )
+    
+    null $S2
+    set $S1, "abc"
+    bands $S1, $S2
+    null $S3
+    is( $S1, $S3, 'ok3' )
+    
+    set $S2, ""
+    bands $S1, $S2
+    nok( $S1, 'ok4' )
+.end
+
+.sub bands_2
+    set $S1, "abc"
+    set $S2, "EE"
+    bands $S1, $S2
+    is( $S1, "A@", 'bands 2' )
+    is( $S2, "EE", 'bands 2' )
+.end
+
+.sub bands_3
+    set $S1, "abc"
+    set $S2, "EE"
+    bands $S0, $S1, $S2
+    is( $S0, "A@", 'bands 3' )
+    is( $S1, "abc", 'bands 3' )
+    is( $S2, "EE", 'bands 3' )
+.end
+
+.sub bands_cow
+    set $S1, "foo"
+    substr $S2, $S1, 0, 3
+    bands $S1, "bar"
+    is( $S2, "foo", 'bands COW' )
+.end
+
+.sub bors_null_string
+    null $S1
+    null $S2
+    bors $S1, $S2
+    null $S3
+    is( $S1, $S3, 'bors NULL string' )
+
+    null $S1
+    set $S2, ""
+    bors $S1, $S2
+    null $S3
+    is( $S1, $S3, 'bors NULL string' )
+ 
+    bors $S2, $S1
+    is( $S2, $S3, 'bors NULL string' )
+
+    null $S1
+    set $S2, "def"
+    bors $S1, $S2
+    is( $S1, "def", 'bors NULL string' )
+
+    null $S2
+    bors $S1, $S2
+    is( $S1, "def", 'bors NULL string' )
+
+    null $S1
+    null $S2
+    bors $S3, $S1, $S2
+    null $S4
+    is( $S3, $S4, 'bors NULL string' )
+
+    set $S1, ""
+    bors $S3, $S1, $S2
+    is( $S3, $S4, 'bors NULL string' )
+
+    bors $S3, $S2, $S1
+    is( $S3, $S4, 'bors NULL string' )
+
+    set $S1, "def"
+    bors $S3, $S1, $S2
+    is( $S3, "def", 'bors NULL string' )
+
+    bors $S3, $S2, $S1
+    is( $S3, "def", 'bors NULL string' )
+.end
+
+.sub bors_2
+    set $S1, "abc"
+    set $S2, "EE"
+    bors $S1, $S2
+    is( $S1, "egc", 'bors 2' )
+    is( $S2, "EE", 'bors 2' )
+.end
+
+.sub bors_3
+    set $S1, "abc"
+    set $S2, "EE"
+    bors $S0, $S1, $S2
+    is( $S0, "egc", 'bors 3' )
+    is( $S1, "abc", 'bors 3' )
+    is( $S2, "EE", 'bors 3' )
+.end
+
+.sub bors_cow
+    set $S1, "foo"
+    substr $S2, $S1, 0, 3
+    bors $S1, "bar"
+    is( $S2, "foo", 'bors COW' )
+.end
+
+.sub bxors_null_string
+    null $S1
+    null $S2
+    bxors $S1, $S2
+    null $S3
+    is( $S1, $S3, 'bxors NULL string' )
+
+    null $S1
+    set $S2, ""
+    bxors $S1, $S2
+    null $S3
+    is( $S1, $S3, 'bxors NULL string' )
+
+    bxors $S2, $S1
+    is( $S2, $S3, 'bxors NULL string' )
+
+    null $S1
+    set $S2, "abc"
+    bxors $S1, $S2
+    is( $S1, "abc", 'bxors NULL string' )
+
+    null $S2
+    bxors $S1, $S2
+    is( $S1, "abc", 'bxors NULL string' )
+
+    null $S1
+    null $S2
+    bxors $S3, $S1, $S2
+    null $S4
+    is( $S3, $S4, 'bxors NULL string' )
+
+    set $S1, ""
+    bxors $S3, $S1, $S2
+    is( $S3, $S4, 'bxors NULL string' )
+
+    bxors $S3, $S2, $S1
+    is( $S3, $S4, 'bxors NULL string' )
+
+    set $S1, "abc"
+    bxors $S3, $S1, $S2
+    is( $S3, "abc", 'bxors NULL string' )
+
+    bxors $S3, $S2, $S1
+    is( $S3, "abc", 'bxors NULL string' )
+.end
+
+.sub bxors_2
+    set $S1, "a2c"
+    set $S2, "Dw"
+    bxors $S1, $S2
+    is( $S1, "%Ec", 'bxors 2' )
+    is( $S2, "Dw", 'bxors 2' )
+    
+    set $S1, "abc"
+    set $S2, "   X"
+    bxors $S1, $S2
+    is( $S1, "ABCX", 'bxors 2' )
+    is( $S2, "   X", 'bxors 2' )
+.end
+
+.sub bxors_3
+    set $S1, "a2c"
+    set $S2, "Dw"
+    bxors $S0, $S1, $S2
+    is( $S0, "%Ec", 'bxors 3' )
+    is( $S1, "a2c", 'bxors 3' )
+    is( $S2, "Dw", 'bxors 3' )
+    
+    set $S1, "abc"
+    set $S2, "   Y"
+    bxors $S0, $S1, $S2
+    is( $S0, "ABCY", 'bxors 3' )
+    is( $S1, "abc", 'bxors 3' )
+    is( $S2, "   Y", 'bxors 3' )
+.end
+
+.sub bxors_cow
+    set $S1, "foo"
+    substr $S2, $S1, 0, 3
+    bxors $S1, "bar"
+    is( $S2, "foo", 'bxors COW' )
+.end
+
+.sub bnots_null_string
+    null $S1
+    null $S2
+    bnots $S1, $S2
+    null $S3
+    is( $S1, $S3, 'bnots NULL string' )
+
+    null $S1
+    set $S2, ""
+    bnots $S1, $S2
+    null $S3
+    is( $S1, $S3, 'bnots NULL string' )
+    
+    bnots $S2, $S1
+    is( $S2, $S3, 'bnots NULL string' )
+.end
+
+# This was the previous test used for t/native_pbc/string.t
+.sub bnots_2
+    skip( 4, "No unicode yet" )
+    # getstdout $P0
+    # push $P0, "utf8"
+    # set $S1, "a2c"
+    # bnots $S2, $S1
+    # is( $S1, "a2c", 'bnots 2' )
+    # is( $S2, "\xC2\x9E\xC3\x8D\xC2\x9C", 'bnots 2' )
+    # 
+    # bnots $S1, $S1
+    # is( $S1, "\xC2\x9E\xC3\x8D\xC2\x9C", 'bnots 2' )
+    # 
+    # bnots $S1, $S1
+    # is( $S1, "a2c", 'bnots 2' )
+.end
+
+.sub bnots_cow
+    set $S1, "foo"
+    substr $S2, $S1, 0, 3
+    bnots $S1, $S1
+    is( $S2, "foo", 'bnots COW' )
+.end
+
+.sub transcode_to_utf8
+    skip( 2, "no more transcode" )
+    # set $S1, "ASCII is the same as UTF8\n"
+    # find_encoding $I1, "utf8"
+    # transcode $S2, $S1, $I1
+    # is( $S1, "ASCII is the same as UTF8", 'transcode to utf8' )
+    # is( $S2, "ASCII is the same as UTF8", 'transcode to utf8' )
+.end
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'join: get_string returns a null string' );
+.sub string_chartype
+    skip( 1, "no more chartype" )
 
-.sub _main
-    newclass $P0, "Foo"
+    # set $S0, "Test String"
+    # find_chartype $I0, "usascii"
+    # set_chartype $S0, $I0
+    # string_chartype $I1, $S0
+    # is( $I0, $I1, 'string_chartype' )
+.end
+
+.sub split_on_empty_string
+    split $P1, "", ""
+    set $I1, $P1
+    is( $I1, "0", 'split on empty string' )
+    
+    split $P0, "", "ab"
+    set $I0, $P0
+    is( $I0, "2", 'split on empty string' )
+    
+    set $S0, $P0[0]
+    is( $S0, "a", 'split on empty string' )
+    
+    set $S0, $P0[1]
+    is( $S0, "b", 'split on empty string' )
+.end
 
+.sub split_on_non_empty_string
+    split $P0, "a", "afooabara"
+    set $I0, $P0
+    is( $I0, "5", 'split on non-empty string' )
+    
+    set $S0, $P0[0]
+    is( $S0, "", 'split on non-empty string' )
+    set $S0, $P0[1]
+    is( $S0, "foo", 'split on non-empty string' )
+    set $S0, $P0[2]
+    is( $S0, "b", 'split on non-empty string' )
+    set $S0, $P0[3]
+    is( $S0, "r", 'split on non-empty string' )
+    set $S0, $P0[4]
+    is( $S0, "", 'split on non-empty string' )
+.end
+
+.sub test_join
     new $P0, 'ResizablePMCArray'
+    join $S0, "--", $P0
+    is( $S0, "", 'join' )
 
-    $P1 = new "Foo"
+    push $P0, "a"
+    join $S0, "--", $P0
+    is( $S0, "a", 'join' )
+    
+    new $P0, 'ResizablePMCArray'
+    push $P0, "a"
+    push $P0, "b"
+    join $S0, "--", $P0
+    is( $S0, "a--b", 'join' )
+.end
 
+# join: get_string returns a null string --------
+.namespace ["Foo5"]
+    .sub get_string :vtable :method
+        .local string ret
+        null ret
+        .begin_return
+        .set_return ret
+        .end_return
+    .end
+.namespace []   # revert to root for next test
+.sub join_get_string_returns_a_null_string
+    newclass $P0, "Foo5"
+    new $P0, 'ResizablePMCArray'
+    $P1 = new "Foo5"
     push $P0, $P1
-
-    print "a"
     join $S0, "", $P0
-    print "b"
-    print $S0
-    print "c\n"
-    end
+    is( $S0, "", 'join: get_string returns a null string' )
 .end
 
-.namespace ["Foo"]
+.sub eq_addr_or_ne_addr
+    set $S0, "Test"
+    set $S1, $S0
+
+    set $I99, 1
+    eq_addr $S1, $S0, OK1
+      set $I99, 0
+  OK1:
+    ok($I99, 'eq_addr/ne_addr')
+
+    set $S1, "Test"
+    set $I99, 0
+    eq_addr $S1, $S0, BAD2
+      set $I99, 1
+  BAD2:
+    ok($I99, 'eq_addr/ne_addr')
+
+    set $I99, 1
+    ne_addr $S1, $S0, OK3
+      set $I99, 0
+  OK3:
+    ok($I99, 'eq_addr/ne_addr')
+
+    set $S0, $S1
+    set $I99, 0
+    ne_addr $S1, $S0, BAD4
+      set $I99, 1
+  BAD4:
+    ok($I99, 'eq_addr/ne_addr')
+.end
 
-.sub get_string :vtable :method
-    .local string ret
+.sub test_if_null_s_ic
+    set $S0, "foo"
+    $I99 = 0
+    if_null $S0, ERROR
+      $I99 = 1
+  ERROR:
+    ok($I99, 'if_null s_ic' ) 
+
+    null $S0
+    $I99 = 1
+    if_null $S0, OK
+        $I99 = 0
+  OK: 
+    ok($I99, 'if_null s_ic' ) 
+.end
 
-    null ret
-    .begin_return
-    .set_return ret
-    .end_return
-.end
-CODE
-abc
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'eq_addr/ne_addr' );
-        set S0, "Test"
-        set S1, S0
-        eq_addr S1, S0, OK1
-        print "not "
-OK1:    print "ok 1\n"
-        set S1, "Test"
-        eq_addr S1, S0, BAD2
-        branch OK2
-BAD2:   print "not "
-OK2:    print "ok 2\n"
-
-        ne_addr S1, S0, OK3
-        print "not "
-OK3:    print "ok 3\n"
-        set S0, S1
-        ne_addr S1, S0, BAD4
-        branch OK4
-BAD4:   print "not "
-OK4:    print "ok 4\n"
-        end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'if_null_s_ic' );
-    set S0, "foo"
-    if_null S0, ERROR
-    print "ok 1\n"
-    null S0
-    if_null S0, OK
-ERROR:  print "error\n"
-    end
-OK: print "ok 2\n"
-    end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'upcase' );
-  set S0, "abCD012yz\n"
-  upcase S1, S0
-  print S1
-  upcase S0
-  print S0
-  end
-CODE
-ABCD012YZ
-ABCD012YZ
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'downcase' );
-  set S0, "ABcd012YZ\n"
-  downcase S1, S0
-  print S1
-  downcase S0
-  print S0
-  end
-CODE
-abcd012yz
-abcd012yz
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'titlecase' );
-  set S0, "aBcd012YZ\n"
-  titlecase S1, S0
-  print S1
-  titlecase S0
-  print S0
-  end
-CODE
-Abcd012yz
-Abcd012yz
-OUTPUT
-
-pasm_output_is( <<'CODE', ord('a'), '3-param ord, one-character string register, I' );
-    set S0,"a"
-    set I1, 0
-    ord I0,S0,I1
-    print I0
-    end
-CODE
+.sub test_upcase
+    set $S0, "abCD012yz"
+    upcase $S1, $S0
+    is( $S1, "ABCD012YZ", 'upcase' )
+    
+    upcase $S0
+    is( $S0, "ABCD012YZ", 'upcase inplace' )
+
+    push_eh catch1
+    null $S9
+    null $S0
+    upcase $S1, $S0
+    pop_eh
+    goto null1
+catch1:
+    .get_results($P9)
+    $S9 = $P9['message']
+    pop_eh
+null1:
+    is ($S9, "Can't upcase NULL string", 'upcase null')
+
+    push_eh catch2
+    null $S9
+    null $S0
+    upcase $S0
+    pop_eh
+    goto null2
+catch2:
+    .get_results($P9)
+    $S9 = $P9['message']
+    pop_eh
+null2:
+    is ($S9, "Can't upcase NULL string", 'upcase inplace null')
+.end
 
-pasm_output_is( <<'CODE', ord('b'), '3-param ord, multi-character string, I' );
-    set I1, 1
-    ord I0,"ab",I1
-    print I0
-    end
-CODE
+.sub test_downcase
+    set $S0, "ABcd012YZ"
+    downcase $S1, $S0
+    is( $S1, "abcd012yz", 'downcase' )
+    
+    downcase $S0
+    is( $S0, "abcd012yz", 'downcase inplace' )
+
+    push_eh catch1
+    null $S9
+    null $S0
+    downcase $S1, $S0
+    pop_eh
+    goto null1
+catch1:
+    .get_results($P9)
+    $S9 = $P9['message']
+    pop_eh
+null1:
+    is ($S9, "Can't downcase NULL string", 'downcase null')
+
+    push_eh catch2
+    null $S9
+    null $S0
+    downcase $S0
+    pop_eh
+    goto null2
+catch2:
+    .get_results($P9)
+    $S9 = $P9['message']
+    pop_eh
+null2:
+    is ($S9, "Can't downcase NULL string", 'downcase inplace null')
+.end
 
-pasm_output_is( <<'CODE', ord('b'), '3-param ord, multi-character string register, I' );
-    set I1, 1
-    set S0,"ab"
-    ord I0,S0,I1
-    print I0
-    end
-CODE
+.sub test_titlecase
+    set $S0, "aBcd012YZ"
+    titlecase $S1, $S0
+    is( $S1, "Abcd012yz", 'titlecase' )
+    
+    titlecase $S0
+    is( $S0, "Abcd012yz", 'titlecase inplace' )
+
+    push_eh catch1
+    null $S9
+    null $S0
+    titlecase $S1, $S0
+    pop_eh
+    goto null1
+catch1:
+    .get_results($P9)
+    $S9 = $P9['message']
+    pop_eh
+null1:
+    is ($S9, "Can't titlecase NULL string", 'titlecase null')
+
+    push_eh catch2
+    null $S9
+    null $S0
+    titlecase $S0
+    pop_eh
+    goto null2
+catch2:
+    .get_results($P9)
+    $S9 = $P9['message']
+    pop_eh
+null2:
+    is ($S9, "Can't titlecase NULL string", 'titlecase inplace null')
+.end
 
-pasm_error_output_like( <<'CODE', <<'OUTPUT', '3-param ord, multi-character string, I' );
-    set I1, 2
-    ord I0,"ab",I1
-    print I0
-    end
-CODE
-/^Cannot get character past end of string/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', '3-param ord, multi-character string, I' );
-    set I1, 2
-    set S0,"ab"
-    ord I0,S0,I1
-    print I0
-    end
-CODE
-/^Cannot get character past end of string/
-OUTPUT
-
-pasm_output_is( <<'CODE', ord('a'), '3-param ord, one-character string, from end, I' );
-    set I1, -1
-    ord I0,"a",I1
-    print I0
-    end
-CODE
+.sub three_param_ord_one_character_string_register_i
+    set $S0,"a"
+    set $I1, 0
+    ord $I0,$S0,$I1
+    is( $I0, "97", '3-param ord, one-character string register, I' )
+.end
 
-pasm_output_is( <<'CODE', ord('a'), '3-param ord, one-character string register, from end, I' );
-    set I1, -1
-    set S0,"a"
-    ord I0,S0,I1
-    print I0
-    end
-CODE
+.sub three_param_ord_multi_character_string_i
+    set $I1, 1
+    ord $I0,"ab",$I1
+    is( $I0, "98", '3-param ord, multi-character string, I' )
+.end
 
-pasm_output_is( <<'CODE', ord('b'), '3-param ord, multi-character string, from end, I' );
-    set I1, -1
-    ord I0,"ab",I1
-    print I0
-    end
-CODE
+.sub three_param_ord_multi_character_string_register_i
+    set $I1, 1
+    set $S0,"ab"
+    ord $I0,$S0,$I1
+    is( $I0, "98", '3-param ord, multi-character string register, I' )
+.end
 
-pasm_output_is( <<'CODE', ord('b'), '3-param ord, multi-character string register, from end, I' );
-    set I1, -1
-    set S0,"ab"
-    ord I0,S0,I1
-    print I0
-    end
-CODE
+.sub exception_three_param_ord_multi_character_string_i
+    push_eh handler
+    set $I1, 2
+    ord $I0,"ab",$I1
+    ok( 0, 'no exception: 3-param ord, multi-character string, I' )
+  handler:
+    .exception_is( 'Cannot get character past end of string' )
+.end
+
+.sub exception_three_param_ord_multi_character_string_i
+    push_eh handler
+    set $I1, 2
+    set $S0,"ab"
+    ord $I0,$S0,$I1
+    ok( 0, 'no exception: 3-param ord, multi-character string, I' )
+  handler:
+    .exception_is( 'Cannot get character past end of string' )
+.end
+
+.sub three_param_ord_one_character_string_from_end_i
+    set $I1, -1
+    ord $I0,"a",$I1
+    is( $I0, "97", '3-param ord, one-character string, from end, I' )
+.end
+
+.sub three_param_ord_one_character_string_register_from_end_i
+    set $I1, -1
+    set $S0,"a"
+    ord $I0,$S0,$I1
+    is( $I0, "97", '3-param ord, one-character string register, from end, I' )
+.end
+
+.sub three_param_ord_multi_character_string_from_end_i
+    set $I1, -1
+    ord $I0,"ab",$I1
+    is( $I0, "98", '3-param ord, multi-character string, from end, I' )
+.end
+
+.sub three_param_ord_multi_character_string_register_from_end_i
+    set $I1, -1
+    set $S0,"ab"
+    ord $I0,$S0,$I1
+    is( $I0, "98", '3-param ord, multi-character string register, from end, I' )
+.end
+
+.sub exception_three_param_ord_multi_character_string_register_from_end_oob_i
+    push_eh handler
+    set $I1, -3
+    set $S0,"ab"
+    ord $I0,$S0,$I1
+    ok( 0, 'no exception: 3-param ord, multi-character string register, from end, OOB, I' )
+  handler:
+    .exception_is( 'Cannot get character before beginning of string' )
+.end
 
-pasm_error_output_like(
-    <<'CODE', <<'OUTPUT', '3-param ord, multi-character string register, from end, OOB, I' );
-    set I1, -3
-    set S0,"ab"
-    ord I0,S0,I1
-    print I0
-        end
-CODE
-/^Cannot get character before beginning of string/
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUT', 'more string_to_int' );
-   .sub 'main' :main
-      print_as_integer('-4')
-      print_as_integer('X-4')
-      print_as_integer('--4')
-      print_as_integer('+')
-      print_as_integer('++')
-      print_as_integer('+2')
-      print_as_integer(' +3')
-      print_as_integer('++4')
-      print_as_integer('+ 5')
-      print_as_integer('-')
-      print_as_integer('--56')
-      print_as_integer('  -+67')
-      print_as_integer('+-78')
-      print_as_integer('  -089xyz')
-      print_as_integer('- 89')
-   .end
-
-   .sub 'print_as_integer'
-      .param string s
-      $I0 = s
-      print $I0
-      print "\n"
-   .end
-CODE
--4
-0
-0
-0
-0
-2
-3
-0
-0
-0
-0
-0
-0
--89
-0
-OUT
+# Utility method for more_string_to_int
+.sub 'print_as_integer'
+    .param string s
+    .param string answer
+    $I0 = s
+    concat $S99, 'string to int: ', s
+    is( $I0, answer, $S99 )
+.end
+
+.sub more_string_to_int
+    print_as_integer('-4', "-4")
+    print_as_integer('X-4',"0")
+    print_as_integer('--4',"0")
+    print_as_integer('+',"0")
+    print_as_integer('++',"0")
+    print_as_integer('+2',"2")
+    print_as_integer(' +3',"3")
+    print_as_integer('++4',"0")
+    print_as_integer('+ 5',"0")
+    print_as_integer('-',"0")
+    print_as_integer('--56',"0")
+    print_as_integer('  -+67',"0")
+    print_as_integer('+-78',"0")
+    print_as_integer('  -089xyz',"-89")
+    print_as_integer('- 89',"0")
+.end
 
-pir_output_is( <<'CODE', <<'OUT', 'constant string and modify-in-situ op (RT #60030)' );
-.sub doit
+# Utility sub for constant_string_and_modify_in_situ_op_rt_bug_60030
+.sub doit_sub_for_but_60030
     .param string s
     $I0 = index s, '::'
-    say s
+    is( s, "Foo::Bar", 'bug 60030' )
     substr s, $I0, 2, "/"
-    say s
+    is( s, "Foo/Bar", 'bug 60030' )
     collect
-    say s
+    is( s, "Foo/Bar", 'bug 60030' )
 .end
-
-.sub main :main
-    doit('Foo::Bar')
-
-    # repeat to prove that the constant 'Foo::Bar' remains unchanged
-    doit('Foo::Bar')
+.sub constant_string_and_modify_in_situ_op_rt_bug_60030
+    
+    doit_sub_for_but_60030('Foo::Bar')
+    # repeat to prove that the constant 'Foo4::Bar4' remains unchanged
+    doit_sub_for_but_60030('Foo::Bar')
 .end
-CODE
-Foo::Bar
-Foo/Bar
-Foo/Bar
-Foo::Bar
-Foo/Bar
-Foo/Bar
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', 'Corner cases of numification' );
-.sub main :main
-    say 2147483647.0
-    say -2147483648.0
+.sub corner_cases_of_numification
+    is( 2147483647.0, "2147483647", 'corner cases of numification' )
+    is( -2147483648.0, "-2147483648", 'corner cases of numification' )
 .end
-CODE
-2147483647
--2147483648
-OUT
-pir_output_is( <<'CODE', <<'OUT', 'Non canonical nan and inf' );
-.sub main :main
+
+.sub non_canonical_nan_and_inf
     $N0 = 'nan'
-    say $N0
+    is( $N0, "NaN", 'Non canonical nan and inf' )
+
     $N0 = 'iNf'
-    say $N0
+    is( $N0, "Inf", 'Non canonical nan and inf' )
+
     $N0 = 'INFINITY'
-    say $N0
+    is( $N0, "Inf", 'Non canonical nan and inf' )
+
     $N0 = '-INF'
-    say $N0
+    is( $N0, "-Inf", 'Non canonical nan and inf' )
+
     $N0 = '-Infinity'
-    say $N0
+    is( $N0, "-Inf", 'Non canonical nan and inf' )
 .end
-CODE
-NaN
-Inf
-Inf
--Inf
--Inf
-OUT
 
+.HLL 'foohll'
+.sub split_hll_mapped
+    .include 'test_more.pir'
 
+    .local pmc RSA, fooRSA
+    RSA = get_class ['ResizableStringArray']
+    fooRSA = subclass ['ResizableStringArray'], 'fooRSA'
+
+    .local pmc interp
+    interp = getinterp
+    interp.'hll_map'(RSA, fooRSA)
+
+    .local pmc a
+    split a, "a", "afooabara"
+
+    .local string t
+    t = typeof a
+    is( t, 'fooRSA', 'split - hll mapped' )
+
+    .local int n, i
+    n = a
+    is( n, '5', 'split - hll mapped' )
+
+    .local string s
+    s = a[0]
+    is( s, '', 'split - hll mapped' )
+    s = a[1]
+    is( s, 'foo', 'split - hll mapped' )
+    s = a[2]
+    is( s, 'b', 'split - hll mapped' )
+    s = a[3]
+    is( s, 'r', 'split - hll mapped' )
+    s = a[4]
+    is( s, '', 'split - hll mapped' )
+.end
 
 # Local Variables:
-#   mode: cperl
+#   mode: pir
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir :

Added: branches/orderedhash_revamp/t/op/string_cmp.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/op/string_cmp.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,1172 @@
+#! parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/op/string.t - Parrot Strings
+
+=head1 SYNOPSIS
+
+     % prove t/op/string.t
+
+=head1 DESCRIPTION
+
+Tests Parrot string registers and operations.
+
+=cut
+
+.sub main :main
+    .include 'test_more.pir'
+
+    plan(24)
+
+    test_eq_s_s_ic()
+    test_eq_sc_s_ic()
+    test_eq_s_sc_ic()
+    test_eq_sc_sc_ic()
+    test_ne_s_s_ic()
+    test_ne_sc_s_ic()
+    test_ne_s_sc_ic()
+    test_ne_sc_sc_ic()
+    test_lt_s_s_ic()
+    test_lt_sc_s_ic()
+    test_lt_s_sc_ic()
+    test_lt_sc_sc_ic()
+    test_le_s_s_ic()
+    test_le_sc_s_ic()
+    test_le_s_sc_ic()
+    test_le_sc_sc_ic()
+    test_gt_s_s_ic()
+    test_gt_sc_s_ic()
+    test_gt_s_sc_ic()
+    test_gt_sc_sc_ic()
+    test_ge_s_s_ic()
+    test_ge_sc_s_ic()
+    test_ge_s_sc_ic()
+    test_ge_sc_sc_ic()
+
+.end
+
+.sub test_eq_s_s_ic
+    set $S0, "hello"
+    set $S1, "hello"
+    eq $S0, $S1, OK1
+    branch ERROR
+  OK1:
+    set $S0, "hello"
+    set $S1, "world"
+    eq $S0, $S1, ERROR
+  OK2:
+    set $S0, "world"
+    set $S1, "hello"
+    eq $S0, $S1, ERROR
+  OK3:
+    set $S0, "hello"
+    set $S1, "hellooo"
+    eq $S0, $S1, ERROR
+  OK4:
+    set $S0, "hellooo"
+    set $S1, "hello"
+    eq $S0, $S1, ERROR
+  OK5:
+    set $S0, "hello"
+    set $S1, "hella"
+    eq $S0, $S1, ERROR
+  OK6:
+    set $S0, "hella"
+    set $S1, "hello"
+    eq $S0, $S1, ERROR
+  OK7:
+    set $S0, "hella"
+    set $S1, "hellooo"
+    eq $S0, $S1, ERROR
+  OK8:
+    set $S0, "hellooo"
+    set $S1, "hella"
+    eq $S0, $S1, ERROR
+  OK9:
+    set $S0, "hElLo"
+    set $S1, "HeLlO"
+    eq $S0, $S1, ERROR
+  OK10:
+    set $S0, "hElLo"
+    set $S1, "hElLo"
+    eq $S0, $S1, OK11
+    branch ERROR
+  OK11:
+    ok( 1, 'eq_s_s_ic' )
+    goto END
+  ERROR:
+   ok( 0, 'eq_s_s_ic' ) 
+   END:
+.end
+
+.sub test_eq_sc_s_ic
+    set $S0, "hello"
+    eq "hello", $S0, OK1
+    branch ERROR
+  OK1:
+    set $S0, "world"
+    eq "hello", $S0, ERROR
+  OK2:
+    set $S0, "hello"
+    eq "world", $S0, ERROR
+  OK3:
+    set $S0, "hellooo"
+    eq "hello", $S0, ERROR
+  OK4:
+    set $S0, "hello"
+    eq "hellooo", $S0, ERROR
+  OK5:
+    set $S0, "hella"
+    eq "hello", $S0, ERROR
+  OK6:
+    set $S0, "hello"
+    eq "hella", $S0, ERROR
+  OK7:
+    set $S0, "hellooo"
+    eq "hella", $S0, ERROR
+  OK8:
+    set $S0, "hella"
+    eq "hellooo", $S0, ERROR
+  OK9:
+    set $S0, "HeLlO"
+    eq "hElLo", $S0, ERROR
+  OK10:
+    set $S0, "hElLo"
+    eq "hElLo", $S0, OK11
+    branch ERROR
+  OK11:
+    ok( 1, 'eq_sc_s_ic' )
+    goto END
+  ERROR:
+   ok( 0, 'eq_sc_s_ic' ) 
+   END:
+.end
+
+.sub test_eq_s_sc_ic
+    set $S0, "hello"
+    eq $S0, "hello", OK1
+    branch ERROR
+  OK1:
+    set $S0, "hello"
+    eq $S0, "world", ERROR
+  OK2:
+    set $S0, "world"
+    eq $S0, "hello", ERROR
+  OK3:
+    set $S0, "hello"
+    eq $S0, "hellooo", ERROR
+  OK4:
+    set $S0, "hellooo"
+    eq $S0, "hello", ERROR
+  OK5:
+    set $S0, "hello"
+    eq $S0, "hella", ERROR
+  OK6:
+    set $S0, "hella"
+    eq $S0, "hello", ERROR
+  OK7:
+    set $S0, "hella"
+    eq $S0, "hellooo", ERROR
+  OK8:
+    set $S0, "hellooo"
+    eq $S0, "hella", ERROR
+  OK9:
+    set $S0, "hElLo"
+    eq $S0, "HeLlO", ERROR
+  OK10:
+    set $S0, "hElLo"
+    eq $S0, "hElLo", OK11
+    branch ERROR
+  OK11:
+    ok( 1, 'eq_s_sc_ic' )
+    goto END
+  ERROR:
+   ok( 0, 'eq_s_sc_ic' ) 
+   END:
+.end
+
+.sub test_eq_sc_sc_ic
+    eq "hello", "hello", OK1
+    branch ERROR
+  OK1:
+    eq "hello", "world", ERROR
+  OK2:
+    eq "world", "hello", ERROR
+  OK3:
+    eq "hello", "hellooo", ERROR
+  OK4:
+    eq "hellooo", "hello", ERROR
+  OK5:
+    eq "hello", "hella", ERROR
+  OK6:
+    eq "hella", "hello", ERROR
+  OK7:
+    eq "hella", "hellooo", ERROR
+  OK8:
+    eq "hellooo", "hella", ERROR
+  OK9:
+    eq "hElLo", "HeLlO", ERROR
+  OK10:
+    eq "hElLo", "hElLo", OK11
+    branch ERROR
+  OK11:
+    ok( 1, 'eq_sc_sc_ic' )
+    goto END
+  ERROR:
+   ok( 0, 'eq_sc_sc_ic' ) 
+   END:
+.end
+
+.sub test_ne_s_s_ic
+    set $S0, "hello"
+    set $S1, "hello"
+    ne $S0, $S1, ERROR
+  OK1:
+    set $S0, "hello"
+    set $S1, "world"
+    ne $S0, $S1, OK2
+    branch ERROR
+  OK2:
+    set $S0, "world"
+    set $S1, "hello"
+    ne $S0, $S1, OK3
+    branch ERROR
+  OK3:
+    set $S0, "hello"
+    set $S1, "hellooo"
+    ne $S0, $S1, OK4
+    branch ERROR
+  OK4:
+    set $S0, "hellooo"
+    set $S1, "hello"
+    ne $S0, $S1, OK5
+    branch ERROR
+  OK5:
+    set $S0, "hello"
+    set $S1, "hella"
+    ne $S0, $S1, OK6
+    branch ERROR
+  OK6:
+    set $S0, "hella"
+    set $S1, "hello"
+    ne $S0, $S1, OK7
+    branch ERROR
+  OK7:
+    set $S0, "hella"
+    set $S1, "hellooo"
+    ne $S0, $S1, OK8
+    branch ERROR
+  OK8:
+    set $S0, "hellooo"
+    set $S1, "hella"
+    ne $S0, $S1, OK9
+    branch ERROR
+  OK9:
+    set $S0, "hElLo"
+    set $S1, "HeLlO"
+    ne $S0, $S1, OK10
+    branch ERROR
+  OK10:
+    set $S0, "hElLo"
+    set $S1, "hElLo"
+    ne $S0, $S1, ERROR
+  OK11:
+    ok( 1, 'ne_s_s_ic' )
+    goto END
+  ERROR:
+   ok( 0, 'ne_s_s_ic' ) 
+   END:
+.end
+
+.sub test_ne_sc_s_ic
+    set $S0, "hello"
+    ne "hello", $S0, ERROR
+  OK1:
+    set $S0, "world"
+    ne "hello", $S0, OK2
+    branch ERROR
+  OK2:
+    set $S0, "hello"
+    ne "world", $S0, OK3
+    branch ERROR
+  OK3:
+    set $S0, "hellooo"
+    ne "hello", $S0, OK4
+    branch ERROR
+  OK4:
+    set $S0, "hello"
+    ne "hellooo", $S0, OK5
+    branch ERROR
+  OK5:
+    set $S0, "hella"
+    ne "hello", $S0, OK6
+    branch ERROR
+  OK6:
+    set $S0, "hello"
+    ne "hella", $S0, OK7
+    branch ERROR
+  OK7:
+    set $S0, "hellooo"
+    ne "hella", $S0, OK8
+    branch ERROR
+  OK8:
+    set $S0, "hella"
+    ne "hellooo", $S0, OK9
+    branch ERROR
+  OK9:
+    set $S0, "HeLlO"
+    ne "hElLo", $S0, OK10
+    branch ERROR
+  OK10:
+    set $S0, "hElLo"
+    ne "hElLo", $S0, ERROR
+  OK11:
+    ok( 1, 'ne_sc_s_ic' )
+    goto END
+  ERROR:
+   ok( 0, 'ne_sc_s_ic' ) 
+   END:
+.end
+
+.sub test_ne_s_sc_ic
+    set $S0, "hello"
+    ne $S0, "hello", ERROR
+  OK1:
+    set $S0, "hello"
+    ne $S0, "world", OK2
+    branch ERROR
+  OK2:
+    set $S0, "world"
+    ne $S0, "hello", OK3
+    branch ERROR
+  OK3:
+    set $S0, "hello"
+    ne $S0, "hellooo", OK4
+    branch ERROR
+  OK4:
+    set $S0, "hellooo"
+    ne $S0, "hello", OK5
+    branch ERROR
+  OK5:
+    set $S0, "hello"
+    ne $S0, "hella", OK6
+    branch ERROR
+  OK6:
+    set $S0, "hella"
+    ne $S0, "hello", OK7
+    branch ERROR
+  OK7:
+    set $S0, "hella"
+    ne $S0, "hellooo", OK8
+    branch ERROR
+  OK8:
+    set $S0, "hellooo"
+    ne $S0, "hella", OK9
+    branch ERROR
+  OK9:
+    set $S0, "hElLo"
+    ne $S0, "HeLlO", OK10
+    branch ERROR
+  OK10:
+    set $S0, "hElLo"
+    ne $S0, "hElLo", ERROR
+  OK11:
+    ok( 1, 'ne_s_sc_ic' )
+    goto END
+  ERROR:
+   ok( 0, 'ne_s_sc_ic' ) 
+   END:
+.end
+
+.sub test_ne_sc_sc_ic
+    ne "hello", "hello", ERROR
+  OK1:
+    ne "hello", "world", OK2
+    branch ERROR
+  OK2:
+    ne "world", "hello", OK3
+    branch ERROR
+  OK3:
+    ne "hello", "hellooo", OK4
+    branch ERROR
+  OK4:
+    ne "hellooo", "hello", OK5
+    branch ERROR
+  OK5:
+    ne "hello", "hella", OK6
+    branch ERROR
+  OK6:
+    ne "hella", "hello", OK7
+    branch ERROR
+  OK7:
+    ne "hella", "hellooo", OK8
+    branch ERROR
+  OK8:
+    ne "hellooo", "hella", OK9
+    branch ERROR
+  OK9:
+    ne "hElLo", "HeLlO", OK10
+    branch ERROR
+  OK10:
+    ne "hElLo", "hElLo", ERROR
+  OK11:
+    ok( 1, 'ne_sc_sc_ic' )
+    goto END
+  ERROR:
+   ok( 0, 'ne_sc_sc_ic' ) 
+   END:
+.end
+
+.sub test_lt_s_s_ic
+    set $S0, "hello"
+    set $S1, "hello"
+    lt $S0, $S1, ERROR
+  OK1:
+    set $S0, "hello"
+    set $S1, "world"
+    lt $S0, $S1, OK2
+    branch ERROR
+  OK2:
+    set $S0, "world"
+    set $S1, "hello"
+    lt $S0, $S1, ERROR
+  OK3:
+    set $S0, "hello"
+    set $S1, "hellooo"
+    lt $S0, $S1, OK4
+    branch ERROR
+  OK4:
+    set $S0, "hellooo"
+    set $S1, "hello"
+    lt $S0, $S1, ERROR
+  OK5:
+    set $S0, "hello"
+    set $S1, "hella"
+    lt $S0, $S1, ERROR
+  OK6:
+    set $S0, "hella"
+    set $S1, "hello"
+    lt $S0, $S1, OK7
+    branch ERROR
+  OK7:
+    set $S0, "hella"
+    set $S1, "hellooo"
+    lt $S0, $S1, OK8
+    branch ERROR
+  OK8:
+    set $S0, "hellooo"
+    set $S1, "hella"
+    lt $S0, $S1, ERROR
+  OK9:
+    set $S0, "hElLo"
+    set $S1, "HeLlO"
+    lt $S0, $S1, ERROR
+  OK10:
+    set $S0, "hElLo"
+    set $S1, "hElLo"
+    lt $S0, $S1, ERROR
+  OK11:
+    ok( 1, 'lt_s_s_ic' )
+    goto END
+  ERROR:
+   ok( 0, 'lt_s_s_ic' ) 
+   END:
+.end
+
+.sub test_lt_sc_s_ic
+    set $S0, "hello"
+    lt "hello", $S0, ERROR
+  OK1:
+    set $S0, "world"
+    lt "hello", $S0, OK2
+    branch ERROR
+  OK2:
+    set $S0, "hello"
+    lt "world", $S0, ERROR
+  OK3:
+    set $S0, "hellooo"
+    lt "hello", $S0, OK4
+    branch ERROR
+  OK4:
+    set $S0, "hello"
+    lt "hellooo", $S0, ERROR
+  OK5:
+    set $S0, "hella"
+    lt "hello", $S0, ERROR
+  OK6:
+    set $S0, "hello"
+    lt "hella", $S0, OK7
+    branch ERROR
+  OK7:
+    set $S0, "hellooo"
+    lt "hella", $S0, OK8
+    branch ERROR
+  OK8:
+    set $S0, "hella"
+    lt "hellooo", $S0, ERROR
+  OK9:
+    set $S0, "HeLlO"
+    lt "hElLo", $S0, ERROR
+  OK10:
+    set $S0, "hElLo"
+    lt "hElLo", $S0, ERROR
+  OK11:
+    ok( 1, 'lt_sc_s_ic' )
+    goto END
+  ERROR:
+   ok( 0, 'lt_sc_s_ic' ) 
+   END:
+.end
+
+.sub test_lt_s_sc_ic
+    set $S0, "hello"
+    lt $S0, "hello", ERROR
+  OK1:
+    set $S0, "hello"
+    lt $S0, "world", OK2
+    branch ERROR
+  OK2:
+    set $S0, "world"
+    lt $S0, "hello", ERROR
+  OK3:
+    set $S0, "hello"
+    lt $S0, "hellooo", OK4
+    branch ERROR
+  OK4:
+    set $S0, "hellooo"
+    lt $S0, "hello", ERROR
+  OK5:
+    set $S0, "hello"
+    lt $S0, "hella", ERROR
+  OK6:
+    set $S0, "hella"
+    lt $S0, "hello", OK7
+    branch ERROR
+  OK7:
+    set $S0, "hella"
+    lt $S0, "hellooo", OK8
+    branch ERROR
+  OK8:
+    set $S0, "hellooo"
+    lt $S0, "hella", ERROR
+  OK9:
+    set $S0, "hElLo"
+    lt $S0, "HeLlO", ERROR
+  OK10:
+    set $S0, "hElLo"
+    lt $S0, "hElLo", ERROR
+  OK11:
+    ok( 1, 'lt_s_sc_ic' )
+    goto END
+  ERROR:
+   ok( 0, 'lt_s_sc_ic' ) 
+   END:
+.end
+
+.sub test_lt_sc_sc_ic
+    lt "hello", "hello", ERROR
+  OK1:
+    lt "hello", "world", OK2
+    branch ERROR
+  OK2:
+    lt "world", "hello", ERROR
+  OK3:
+    lt "hello", "hellooo", OK4
+    branch ERROR
+  OK4:
+    lt "hellooo", "hello", ERROR
+  OK5:
+    lt "hello", "hella", ERROR
+  OK6:
+    lt "hella", "hello", OK7
+    branch ERROR
+  OK7:
+    lt "hella", "hellooo", OK8
+    branch ERROR
+  OK8:
+    lt "hellooo", "hella", ERROR
+  OK9:
+    lt "hElLo", "HeLlO", ERROR
+  OK10:
+    lt "hElLo", "hElLo", ERROR
+  OK11:
+    ok( 1, 'lt_sc_sc_ic' )
+    goto END
+  ERROR:
+   ok( 0, 'lt_sc_sc_ic' ) 
+   END:
+.end
+
+.sub test_le_s_s_ic
+    set $S0, "hello"
+    set $S1, "hello"
+    le $S0, $S1, OK1
+    branch ERROR
+  OK1:
+    set $S0, "hello"
+    set $S1, "world"
+    le $S0, $S1, OK2
+    branch ERROR
+  OK2:
+    set $S0, "world"
+    set $S1, "hello"
+    le $S0, $S1, ERROR
+  OK3:
+    set $S0, "hello"
+    set $S1, "hellooo"
+    le $S0, $S1, OK4
+    branch ERROR
+  OK4:
+    set $S0, "hellooo"
+    set $S1, "hello"
+    le $S0, $S1, ERROR
+  OK5:
+    set $S0, "hello"
+    set $S1, "hella"
+    le $S0, $S1, ERROR
+  OK6:
+    set $S0, "hella"
+    set $S1, "hello"
+    le $S0, $S1, OK7
+    branch ERROR
+  OK7:
+    set $S0, "hella"
+    set $S1, "hellooo"
+    le $S0, $S1, OK8
+    branch ERROR
+  OK8:
+    set $S0, "hellooo"
+    set $S1, "hella"
+    le $S0, $S1, ERROR
+  OK9:
+    set $S0, "hElLo"
+    set $S1, "HeLlO"
+    le $S0, $S1, ERROR
+  OK10:
+    set $S0, "hElLo"
+    set $S1, "hElLo"
+    le $S0, $S1, OK11
+    branch ERROR
+  OK11:
+    ok( 1, 'le_s_s_ic' )
+    goto END
+  ERROR:
+   ok( 0, 'le_s_s_ic' ) 
+   END:
+.end
+
+.sub test_le_sc_s_ic
+    set $S0, "hello"
+    le "hello", $S0, OK1
+    branch ERROR
+  OK1:
+    set $S0, "world"
+    le "hello", $S0, OK2
+    branch ERROR
+  OK2:
+    set $S0, "hello"
+    le "world", $S0, ERROR
+  OK3:
+    set $S0, "hellooo"
+    le "hello", $S0, OK4
+    branch ERROR
+  OK4:
+    set $S0, "hello"
+    le "hellooo", $S0, ERROR
+  OK5:
+    set $S0, "hella"
+    le "hello", $S0, ERROR
+  OK6:
+    set $S0, "hello"
+    le "hella", $S0, OK7
+    branch ERROR
+  OK7:
+    set $S0, "hellooo"
+    le "hella", $S0, OK8
+    branch ERROR
+  OK8:
+    set $S0, "hella"
+    le "hellooo", $S0, ERROR
+  OK9:
+    set $S0, "HeLlO"
+    le "hElLo", $S0, ERROR
+  OK10:
+    set $S0, "hElLo"
+    le "hElLo", $S0, OK11
+    branch ERROR
+  OK11:
+    ok( 1, 'le_sc_s_ic' )
+    goto END
+  ERROR:
+   ok( 0, 'le_sc_s_ic' ) 
+   END:
+.end
+
+.sub test_le_s_sc_ic
+    set $S0, "hello"
+    le $S0, "hello", OK1
+    branch ERROR
+  OK1:
+    set $S0, "hello"
+    le $S0, "world", OK2
+    branch ERROR
+  OK2:
+    set $S0, "world"
+    le $S0, "hello", ERROR
+  OK3:
+    set $S0, "hello"
+    le $S0, "hellooo", OK4
+    branch ERROR
+  OK4:
+    set $S0, "hellooo"
+    le $S0, "hello", ERROR
+  OK5:
+    set $S0, "hello"
+    le $S0, "hella", ERROR
+  OK6:
+    set $S0, "hella"
+    le $S0, "hello", OK7
+    branch ERROR
+  OK7:
+    set $S0, "hella"
+    le $S0, "hellooo", OK8
+    branch ERROR
+  OK8:
+    set $S0, "hellooo"
+    le $S0, "hella", ERROR
+  OK9:
+    set $S0, "hElLo"
+    le $S0, "HeLlO", ERROR
+  OK10:
+    set $S0, "hElLo"
+    le $S0, "hElLo", OK11
+    branch ERROR
+  OK11:
+    ok( 1, 'le_s_sc_ic' )
+    goto END
+  ERROR:
+   ok( 0, 'le_s_sc_ic' ) 
+   END:
+.end
+
+.sub test_le_sc_sc_ic
+    le "hello", "hello", OK1
+    branch ERROR
+  OK1:
+    le "hello", "world", OK2
+    branch ERROR
+  OK2:
+    le "world", "hello", ERROR
+  OK3:
+    le "hello", "hellooo", OK4
+    branch ERROR
+  OK4:
+    le "hellooo", "hello", ERROR
+  OK5:
+    le "hello", "hella", ERROR
+  OK6:
+    le "hella", "hello", OK7
+    branch ERROR
+  OK7:
+    le "hella", "hellooo", OK8
+    branch ERROR
+  OK8:
+    le "hellooo", "hella", ERROR
+  OK9:
+    le "hElLo", "HeLlO", ERROR
+  OK10:
+    le "hElLo", "hElLo", OK11
+    branch ERROR
+  OK11:
+    ok( 1, 'le_sc_sc_ic' )
+    goto END
+  ERROR:
+   ok( 0, 'le_sc_sc_ic' ) 
+   END:
+.end
+
+.sub test_gt_s_s_ic
+    set $S0, "hello"
+    set $S1, "hello"
+    gt $S0, $S1, ERROR
+  OK1:
+    set $S0, "hello"
+    set $S1, "world"
+    gt $S0, $S1, ERROR
+  OK2:
+    set $S0, "world"
+    set $S1, "hello"
+    gt $S0, $S1, OK3
+    branch ERROR
+  OK3:
+    set $S0, "hello"
+    set $S1, "hellooo"
+    gt $S0, $S1, ERROR
+  OK4:
+    set $S0, "hellooo"
+    set $S1, "hello"
+    gt $S0, $S1, OK5
+    branch ERROR
+  OK5:
+    set $S0, "hello"
+    set $S1, "hella"
+    gt $S0, $S1, OK6
+    branch ERROR
+  OK6:
+    set $S0, "hella"
+    set $S1, "hello"
+    gt $S0, $S1, ERROR
+  OK7:
+    set $S0, "hella"
+    set $S1, "hellooo"
+    gt $S0, $S1, ERROR
+  OK8:
+    set $S0, "hellooo"
+    set $S1, "hella"
+    gt $S0, $S1, OK9
+    branch ERROR
+  OK9:
+    set $S0, "hElLo"
+    set $S1, "HeLlO"
+    gt $S0, $S1, OK10
+    branch ERROR
+  OK10:
+    set $S0, "hElLo"
+    set $S1, "hElLo"
+    gt $S0, $S1, ERROR
+  OK11:
+    ok( 1, 'gt_s_s_ic' )
+    goto END
+  ERROR:
+   ok( 0, 'gt_s_s_ic' ) 
+   END:
+.end
+
+.sub test_gt_sc_s_ic
+    set $S0, "hello"
+    gt "hello", $S0, ERROR
+  OK1:
+    set $S0, "world"
+    gt "hello", $S0, ERROR
+  OK2:
+    set $S0, "hello"
+    gt "world", $S0, OK3
+    branch ERROR
+  OK3:
+    set $S0, "hellooo"
+    gt "hello", $S0, ERROR
+  OK4:
+    set $S0, "hello"
+    gt "hellooo", $S0, OK5
+    branch ERROR
+  OK5:
+    set $S0, "hella"
+    gt "hello", $S0, OK6
+    branch ERROR
+  OK6:
+    set $S0, "hello"
+    gt "hella", $S0, ERROR
+  OK7:
+    set $S0, "hellooo"
+    gt "hella", $S0, ERROR
+  OK8:
+    set $S0, "hella"
+    gt "hellooo", $S0, OK9
+    branch ERROR
+  OK9:
+    set $S0, "HeLlO"
+    gt "hElLo", $S0, OK10
+    branch ERROR
+  OK10:
+    set $S0, "hElLo"
+    gt "hElLo", $S0, ERROR
+  OK11:
+    ok( 1, 'gt_sc_s_ic' )
+    goto END
+  ERROR:
+   ok( 0, 'gt_sc_s_ic' ) 
+   END:
+.end
+
+.sub test_gt_s_sc_ic
+    set $S0, "hello"
+    gt $S0, "hello", ERROR
+  OK1:
+    set $S0, "hello"
+    gt $S0, "world", ERROR
+  OK2:
+    set $S0, "world"
+    gt $S0, "hello", OK3
+    branch ERROR
+  OK3:
+    set $S0, "hello"
+    gt $S0, "hellooo", ERROR
+  OK4:
+    set $S0, "hellooo"
+    gt $S0, "hello", OK5
+    branch ERROR
+  OK5:
+    set $S0, "hello"
+    gt $S0, "hella", OK6
+    branch ERROR
+  OK6:
+    set $S0, "hella"
+    gt $S0, "hello", ERROR
+  OK7:
+    set $S0, "hella"
+    gt $S0, "hellooo", ERROR
+  OK8:
+    set $S0, "hellooo"
+    gt $S0, "hella", OK9
+    branch ERROR
+  OK9:
+    set $S0, "hElLo"
+    gt $S0, "HeLlO", OK10
+    branch ERROR
+  OK10:
+    set $S0, "hElLo"
+    gt $S0, "hElLo", ERROR
+  OK11:
+    ok( 1, 'gt_s_sc_ic' )
+    goto END
+  ERROR:
+   ok( 0, 'gt_s_sc_ic' ) 
+   END:
+.end
+
+.sub test_gt_sc_sc_ic
+    gt "hello", "hello", ERROR
+  OK1:
+    gt "hello", "world", ERROR
+  OK2:
+    gt "world", "hello", OK3
+    branch ERROR
+  OK3:
+    gt "hello", "hellooo", ERROR
+  OK4:
+    gt "hellooo", "hello", OK5
+    branch ERROR
+  OK5:
+    gt "hello", "hella", OK6
+    branch ERROR
+  OK6:
+    gt "hella", "hello", ERROR
+  OK7:
+    gt "hella", "hellooo", ERROR
+  OK8:
+    gt "hellooo", "hella", OK9
+    branch ERROR
+  OK9:
+    gt "hElLo", "HeLlO", OK10
+    branch ERROR
+  OK10:
+    gt "hElLo", "hElLo", ERROR
+  OK11:
+    ok( 1, 'gt_sc_sc_ic' )
+    goto END
+  ERROR:
+   ok( 0, 'gt_sc_sc_ic' ) 
+   END:
+.end
+
+.sub test_ge_s_s_ic
+    set $S0, "hello"
+    set $S1, "hello"
+    ge $S0, $S1, OK1
+    branch ERROR
+  OK1:
+    set $S0, "hello"
+    set $S1, "world"
+    ge $S0, $S1, ERROR
+  OK2:
+    set $S0, "world"
+    set $S1, "hello"
+    ge $S0, $S1, OK3
+    branch ERROR
+  OK3:
+    set $S0, "hello"
+    set $S1, "hellooo"
+    ge $S0, $S1, ERROR
+  OK4:
+    set $S0, "hellooo"
+    set $S1, "hello"
+    ge $S0, $S1, OK5
+    branch ERROR
+  OK5:
+    set $S0, "hello"
+    set $S1, "hella"
+    ge $S0, $S1, OK6
+    branch ERROR
+  OK6:
+    set $S0, "hella"
+    set $S1, "hello"
+    ge $S0, $S1, ERROR
+  OK7:
+    set $S0, "hella"
+    set $S1, "hellooo"
+    ge $S0, $S1, ERROR
+  OK8:
+    set $S0, "hellooo"
+    set $S1, "hella"
+    ge $S0, $S1, OK9
+    branch ERROR
+  OK9:
+    set $S0, "hElLo"
+    set $S1, "HeLlO"
+    ge $S0, $S1, OK10
+    branch ERROR
+  OK10:
+    set $S0, "hElLo"
+    set $S1, "hElLo"
+    ge $S0, $S1, OK11
+    branch ERROR
+  OK11:
+    ok( 1, 'ge_s_s_ic' )
+    goto END
+  ERROR:
+   ok( 0, 'ge_s_s_ic' ) 
+   END:
+.end
+
+.sub test_ge_sc_s_ic
+    set $S0, "hello"
+    ge "hello", $S0, OK1
+    branch ERROR
+  OK1:
+    set $S0, "world"
+    ge "hello", $S0, ERROR
+  OK2:
+    set $S0, "hello"
+    ge "world", $S0, OK3
+    branch ERROR
+  OK3:
+    set $S0, "hellooo"
+    ge "hello", $S0, ERROR
+  OK4:
+    set $S0, "hello"
+    ge "hellooo", $S0, OK5
+    branch ERROR
+  OK5:
+    set $S0, "hella"
+    ge "hello", $S0, OK6
+    branch ERROR
+  OK6:
+    set $S0, "hello"
+    ge "hella", $S0, ERROR
+  OK7:
+    set $S0, "hellooo"
+    ge "hella", $S0, ERROR
+  OK8:
+    set $S0, "hella"
+    ge "hellooo", $S0, OK9
+    branch ERROR
+  OK9:
+    set $S0, "HeLlO"
+    ge "hElLo", $S0, OK10
+    branch ERROR
+  OK10:
+    set $S0, "hElLo"
+    ge "hElLo", $S0, OK11
+    branch ERROR
+  OK11:
+    ok( 1, 'ge_sc_s_ic' )
+    goto END
+  ERROR:
+   ok( 0, 'ge_sc_s_ic' ) 
+   END:
+.end
+
+.sub test_ge_s_sc_ic
+    set $S0, "hello"
+    ge $S0, "hello", OK1
+    branch ERROR
+  OK1:
+    set $S0, "hello"
+    ge $S0, "world", ERROR
+  OK2:
+    set $S0, "world"
+    ge $S0, "hello", OK3
+    branch ERROR
+  OK3:
+    set $S0, "hello"
+    ge $S0, "hellooo", ERROR
+  OK4:
+    set $S0, "hellooo"
+    ge $S0, "hello", OK5
+    branch ERROR
+  OK5:
+    set $S0, "hello"
+    ge $S0, "hella", OK6
+    branch ERROR
+  OK6:
+    set $S0, "hella"
+    ge $S0, "hello", ERROR
+  OK7:
+    set $S0, "hella"
+    ge $S0, "hellooo", ERROR
+  OK8:
+    set $S0, "hellooo"
+    ge $S0, "hella", OK9
+    branch ERROR
+  OK9:
+    set $S0, "hElLo"
+    ge $S0, "HeLlO", OK10
+    branch ERROR
+  OK10:
+    set $S0, "hElLo"
+    ge $S0, "hElLo", OK11
+    branch ERROR
+  OK11:
+    ok( 1, 'ge_s_sc_ic' )
+    goto END
+  ERROR:
+   ok( 0, 'ge_s_sc_ic' ) 
+   END:
+.end
+
+.sub test_ge_sc_sc_ic
+    ge "hello", "hello", OK1
+    branch ERROR
+  OK1:
+    ge "hello", "world", ERROR
+  OK2:
+    ge "world", "hello", OK3
+    branch ERROR
+  OK3:
+    ge "hello", "hellooo", ERROR
+  OK4:
+    ge "hellooo", "hello", OK5
+    branch ERROR
+  OK5:
+    ge "hello", "hella", OK6
+    branch ERROR
+  OK6:
+    ge "hella", "hello", ERROR
+  OK7:
+    ge "hella", "hellooo", ERROR
+  OK8:
+    ge "hellooo", "hella", OK9
+    branch ERROR
+  OK9:
+    ge "hElLo", "HeLlO", OK10
+    branch ERROR
+  OK10:
+    ge "hElLo", "hElLo", OK11
+    branch ERROR
+  OK11:
+    ok( 1, 'ge_sc_sc_ic' )
+    goto END
+  ERROR:
+   ok( 0, 'ge_sc_sc_ic' )
+   END:
+.end
+
+# Local Variables:
+#   mode: pir
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir :

Modified: branches/orderedhash_revamp/t/op/string_cs.t
==============================================================================
--- branches/orderedhash_revamp/t/op/string_cs.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/string_cs.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -847,7 +847,7 @@
 \u2001\u2002\u2003\u2004\x{e01ef}\u0114
 OUTPUT
 
-pir_output_is(<<'CODE', <<'OUTPUT', 'escape unicode w/ literal 0, RT #60396' );
+pir_output_is(<<'CODE', <<'OUTPUT', 'escape unicode w/ literal 0' );
 .sub 'main'
     $S0 = unicode:"x/\u0445\u0440\u0435\u043d\u044c_09-10.txt"
     $S1 = escape $S0

Modified: branches/orderedhash_revamp/t/op/stringu.t
==============================================================================
--- branches/orderedhash_revamp/t/op/stringu.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/stringu.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -406,7 +406,6 @@
 OUTPUT
 
     # Concatenate unicode: with iso-8859-1
-    # See RT #39930 for discussion
     pir_output_is(
         <<'CODE', <<"OUTPUT", "Concat unicode with iso-8859-1" );
 .sub main
@@ -550,7 +549,7 @@
 OUT
 }
 
-pir_output_is( <<'CODE', <<'OUT', 'concatenation of utf8 and iso-8859-1 (TT#752)' );
+pir_output_is( <<'CODE', <<'OUT', 'concatenation of utf8 and iso-8859-1 (TT #752)' );
 .sub 'main'
 
     $S1 = chr 0xe5

Modified: branches/orderedhash_revamp/t/op/sysinfo.t
==============================================================================
--- branches/orderedhash_revamp/t/op/sysinfo.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/sysinfo.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -116,18 +116,15 @@
     }
 }
 
-# 5 & 6
-if ( $PConfig{osname} eq 'MSWin32' ) {
-    # Windows 5 & 6
+SKIP:
+{
+    $PConfig{osname} eq 'MSWin32'
+        or skip "Tests only meaningful on Win32", 2;
     SKIP:
     {
         eval { require Win32; } or
             skip "requires package Win32 for these tests", 2;
 
-        # specifically don't use $Config{osvers}
-        # because it probably was the system perl was compiled on
-        # and we can do much better than that
-
         my $osname = Win32::GetOSName();
         $osname = 'WinXP' if $osname =~ m/^WinXP/;
         TODO: {
@@ -145,31 +142,9 @@
     print S1
 end
 CODE
-        }
-    }
-}
-else {
-    # Other 5 & 6
-
-    # XXX I know this is wrong on Win32 but is it correct on any others?
-    # XXX also should it be %Config or %PConfig
-    TODO:
-    {
-        local $TODO = "Not Currently Implemented";
-
-        pasm_output_is( <<'CODE', $Config{osvers}, "sysinfo OS version string" );
-    sysinfo_s_ic S1, 5
-    print S1
-end
-CODE
-
-        pasm_output_is( <<'CODE', $Config{osvers}, "sysinfo OS version number string" );
-    sysinfo_s_ic S1, 6
-    print S1
-end
-CODE
-    }
-}
+        } # END TODO block
+    } # END inner SKIP block
+} # END outer SKIP block
 
 SKIP:
 {

Modified: branches/orderedhash_revamp/t/op/time.t
==============================================================================
--- branches/orderedhash_revamp/t/op/time.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/time.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,129 +1,123 @@
-#!perl
+#!parrot
 # Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 7;
-
 =head1 NAME
 
 t/op/time.t - Time and Sleep
 
-=head1 SYNOPSIS
+=cut
 
-    % prove t/op/time.t
+.sub main :main
+    .include 'test_more.pir'
 
-=head1 DESCRIPTION
+    plan(29)
+    test_time_i()
+    test_time_n()
+    test_sleep_i()
+    test_sleep_i_negative()
+    test_sleep_n()
+    test_sleep_n_negative()
+    test_tm_pasm()
+    test_gmtime_s_i()
+    test_time_n_vs_time_i()
+    test_decodetime_p_i()
+    test_localtime_s_i()
+    test_decodelocaltime_p_i()
+.end
 
-Tests the C<time> and C<sleep> operations.
+.sub test_time_i
+    $I0 = time
+    $I2 = isge $I0, 0
+    ok($I2, "Current int time is greater than 0")
+
+    $I1 = time
+    $I2 = isge $I1, $I2
+    ok($I2, "Current int time is greater than older time")
+.end
 
-=cut
+.sub test_time_n
+    $N0 = time
+    $I0 = isge $N0, 0.0
+    ok($I0, "Current num time is greater than 0.0")
+
+    $N1 = time
+    $I0 = isge $N1, $N0
+    ok($I0, "Current num time is greater than older time")
+.end
+
+.sub test_sleep_i
+    $I0 = time
+    sleep 1
+    $I1 = time
+    $I2 = isgt $I1, $I0
+    ok($I2, "sleep_i increases time")
+    $I2 = $I0 + 1
+    $I3 = isge $I1, $I2
+    ok($I3, "sleep_i slept for at least the amount of time specified")
+.end
 
-pasm_output_is( <<'CODE', <<'OUTPUT', "time_i" );
-        time    I0
-        time    I1
-        ge      I0, 0, OK1
-        branch  FAIL
-OK1:    print "ok, (!= 1970) Grateful Dead not\n"
-        ge      I1, I0, OK2
-        branch FAIL
-OK2:    print "ok, (now>before) timelords need not apply\n"
-        branch  OK_ALL
-FAIL:   print "failure\n"
-        print "I0 was: "
-        print I0
-        print "\nI1 was: "
-        print I0
-        print "\n"
-OK_ALL:
-        end
-CODE
-ok, (!= 1970) Grateful Dead not
-ok, (now>before) timelords need not apply
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "time_n" );
-        time    N0
-        time    N1
-        ge      N0, 0.0, OK1
-        branch  FAIL
-OK1:    print "ok, (!= 1970) Grateful Dead not\n"
-        ge      N1, N0, OK2
-        branch FAIL
-OK2:    print "ok, (now>before) timelords need not apply\n"
-        branch  OK_ALL
-FAIL:   print "failure\n"
-OK_ALL:
-        end
-CODE
-ok, (!= 1970) Grateful Dead not
-ok, (now>before) timelords need not apply
-OUTPUT
-
-pasm_output_is( <<CODE, <<OUTPUT, "sleep" );
-        print   "start\\n"
-
-        time    I1
-
-        sleep   1
-        set     I0, 1
-        sleep   I0
-
-        time    I0
-
-        gt      I0, I1, ALLOK
-        print   "no, sleeping made time go the wrong way "
-
-ALLOK:
-        print   "done\\n"
-        end
-CODE
-start
-done
-OUTPUT
-
-pasm_error_output_like( <<CODE, <<OUT , "sleep" );
-        sleep   -1
-        end
-CODE
-/Cannot go back in time/
-OUT
-
-my $year;
-( undef, undef, undef, undef, undef, $year ) = localtime();
-$year += 1900;
-
-# don't run this test 1 tick before the year changes #'
-
-pasm_output_is( <<'CODE', $year, "decodelocaltime" );
-    time I0
-    decodelocaltime P0, I0
+.sub test_sleep_i_negative
+    push_eh cannot_sleep_negative
+    sleep -1
+    pop_eh
+    ok(0, "Guess what? Just time traveled")
+    .return()
+  cannot_sleep_negative:
+    pop_eh
+    ok(1, "Cannot sleep_i backwards")
+.end
+
+.sub test_sleep_n
+    $N0 = time
+    sleep 1.1
+    $N1 = time
+    $I2 = isgt $N1, $N0
+    ok($I2, "sleep_n increases time")
+    $N2 = $N0 + 1.0
+    $I2 = isge $N1, $N2
+    ok($I2, "sleep_n slept for at least the integer amount of time specified")
+.end
+
+.sub test_sleep_n_negative
+    push_eh cannot_sleep_negative
+    sleep -1.2
+    pop_eh
+    ok(0, "Guess what? Just time traveled")
+    .return()
+  cannot_sleep_negative:
+    pop_eh
+    ok(1, "Cannot sleep_n backwards")
+.end
+
+.sub test_tm_pasm
     .include "tm.pasm"
-    set I0, P0[.TM_YEAR]
-    print I0
-    end
-CODE
-
-pir_output_is(<<'CODE', "Tue Jan  1 00:00:00 2008\n25", "gmtime string length");
-.sub _ :main
-$I0 = 1199145600
-$S0 = gmtime $I0
-print $S0
-$I1 = length $S0
-print $I1
+    is(.TM_SEC, 0, "TM_SEC ok")
+    is(.TM_MIN, 1, "TM_MIN ok")
+    is(.TM_HOUR, 2, "TM_HOUR ok")
+    is(.TM_MDAY, 3, "TM_MDAY ok")
+    is(.TM_MON, 4, "TM_MON ok")
+    is(.TM_YEAR, 5, "TM_YEAR ok")
+    is(.TM_WDAY, 6, "TM_WDAY ok")
+    is(.TM_YDAY, 7, "TM_YDAY ok")
+    is(.TM_ISDST, 8, "TM_ISDST ok")
 .end
-CODE
 
-pir_output_is(<<'CODE', <<OUTPUT, "time(FLOATVAL) vs time(INTVAL)");
-.sub main :main
+.sub test_gmtime_s_i
+    $S0 = gmtime 0
+    $I0 = isnull $S0
+    is($I0, 0, "gmtime string is not null")
+    is($S0, "Thu Jan  1 00:00:00 1970\n", "correct epoch")
+    $I1 = length $S0
+    is($I1, 25, "string is the correct length")
+.end
+
+.sub test_time_n_vs_time_i
     .local int time_int
-    time time_int
+    time_int = time
 
     .local num time_float
-    time time_float
+    time_float = time
 
     # check if time_float is within [time_int - 5;time_int + 5]
     .local int time_int_lower
@@ -133,17 +127,37 @@
     time_int_upper = time_int + 5
     if time_float > time_int_upper goto FAIL
 
-    print "ok\n"
-    goto END
+    ok(1, "time_n value corresponds to time_i value")
+    .return()
 
-FAIL: print "not ok\n"
-    goto END
+  FAIL:
+    ok(0, "time_n value does not correspond to time_t value")
+    .return()
+.end
+
+.sub test_decodetime_p_i
+    $P0 = decodetime 0
+    $I0 = $P0
+    is($I0, 9, "decodetime result has 9 values")
+    $S0 = typeof $P0
+    is($S0, "Array", "decodetime returns the correct PMC type")
+.end
+
+.sub test_localtime_s_i
+    $S0 = localtime 0
+    $I0 = isnull $S0
+    is($I0, 0, "localtime string is not a null string")
+    $I0 = length $S0
+    is($I0, 25, "localtime string is the correct length")
+.end
 
-END:
+.sub test_decodelocaltime_p_i
+    $P0 = decodelocaltime 0
+    $I0 = $P0
+    is($I0, 9, "decodelocaltime result has 9 values")
+    $S0 = typeof $P0
+    is($S0, "Array", "decodelocaltime returns the correct PMC type")
 .end
-CODE
-ok
-OUTPUT
 
 
 # Local Variables:
@@ -151,4 +165,4 @@
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 filetype=pir:

Added: branches/orderedhash_revamp/t/op/time_old.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/op/time_old.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,46 @@
+#!perl
+# Copyright (C) 2001-2009, Parrot Foundation.
+# $Id$
+
+use strict;
+use warnings;
+use lib qw( . lib ../lib ../../lib );
+use Test::More;
+use Parrot::Test tests => 1;
+
+=head1 NAME
+
+t/op/time.t - Time and Sleep
+
+=head1 SYNOPSIS
+
+    % prove t/op/time.t
+
+=head1 DESCRIPTION
+
+Tests the C<time> and C<sleep> operations.
+
+=cut
+
+my $year;
+( undef, undef, undef, undef, undef, $year ) = localtime();
+$year += 1900;
+
+# don't run this test 1 tick before the year changes #'
+
+pasm_output_is( <<'CODE', $year, "decodelocaltime" );
+    time I0
+    decodelocaltime P0, I0
+    .include "tm.pasm"
+    set I0, P0[.TM_YEAR]
+    print I0
+    end
+CODE
+
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/t/op/trans.t
==============================================================================
--- branches/orderedhash_revamp/t/op/trans.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/op/trans.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -387,9 +387,6 @@
 ok 16
 OUTPUT
 
-TODO: {
-local $TODO = 'fails on netbsd' if $^O =~ /netbsd/;
-
 pasm_output_is( <<"CODE", <<'OUTPUT', 'atan, part 2' );
         .include 'fp_equality.pasm'
         atan N4, -0.0, -0.0
@@ -402,8 +399,6 @@
 ok 1
 OUTPUT
 
-}
-
 pasm_output_is( <<"CODE", <<OUTPUT, "log2" );
         .include 'fp_equality.pasm'
         set N1, 10.0

Added: branches/orderedhash_revamp/t/op/vivify.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/op/vivify.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,140 @@
+#!parrot
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/op/vivify.t - the vivify opcode
+
+=head1 SYNOPSIS
+
+     % prove t/op/vivify.t
+
+=head1 DESCRIPTION
+
+Tests Parrot's experimental vivify opcode.
+
+=cut
+
+.sub 'main' :main
+    .include 'test_more.pir'
+
+    plan(25)
+
+    test_vivify_keyed_pmc()
+    test_vivify_keyed_int()
+    test_vivify_keyed_str()
+    # END_OF_TESTS
+.end
+
+.sub 'test_vivify_keyed_int'
+    diag( 'test_vivify_keyed_int' )
+    $P0    = new [ 'Hash' ]
+    $P1    = box 111
+    $P0[1] = $P1
+    $P0[3] = $P1
+
+    $P3 = vivify $P0, 1, [ 'Integer' ]
+    is( $P3, 111, 'vivify should return existing element unmodified' )
+    $P1 = 123
+    is( $P3, 123, '... the exact PMC itself' )
+
+    $P4 = $P0[1]
+    $I0 = issame $P1, $P4
+    ok( $I0, ' ... existing entry in Hash should be unmodified')
+
+    $P3 = vivify $P0, 3, [ 'Integer' ]
+    is( $P3, 123, '... even if stored in multiple locations' )
+
+    $P3 = vivify $P0, 2, [ 'Integer' ]
+    is( $P3, 0, 'vivify should create new PMC if not-existent' )
+    isa_ok( $P3, 'Integer', 'new PMC should have requested type' )
+
+    $P4 = $P0[2]
+    $I0 = issame $P3, $P4
+    ok( $I0, ' ... and should be bound in Hash')
+.end
+
+.sub 'test_vivify_keyed_str'
+    diag( 'test_vivify_keyed_str' )
+    $P0          = new [ 'Hash' ]
+    $P1          = box 111
+    $P0['one']   = $P1
+    $P0['three'] = $P1
+
+    $P3 = vivify $P0, 'one', [ 'Integer' ]
+    is( $P3, 111, 'vivify should return existing element unmodified' )
+    $P1 = 123
+    is( $P3, 123, '... the exact PMC itself' )
+
+    $P4 = $P0['one']
+    $I0 = issame $P1, $P4
+    ok( $I0, ' ... existing entry in Hash should be unmodified')
+
+    $P3 = vivify $P0, 'three', [ 'Integer' ]
+    is( $P3, 123, '... even if stored in multiple locations' )
+
+    $P3 = vivify $P0, 'two', [ 'Integer' ]
+    is( $P3, 0, 'vivify should create new PMC if not-existent' )
+    isa_ok( $P3, 'Integer', 'new PMC should have requested type' )
+
+    $P4 = $P0['two']
+    $I0 = issame $P3, $P4
+    ok( $I0, ' ... and should be bound in Hash')
+.end
+
+.sub 'test_vivify_keyed_pmc'
+    diag( 'test_vivify_keyed_pmc' )
+    $P0          = new [ 'Hash' ]
+    $P1          = box 111
+
+    .local pmc str_key
+    str_key      = box 'foo'
+    $P0[str_key] = $P1
+
+    .local pmc int_key
+    int_key      = box 435
+    $P0[int_key] = $P1
+
+    $P3          = vivify $P0, str_key, [ 'String' ]
+    is( $P3, 111, 'vivify should return existing element unmodified' )
+
+    $P1          = 123
+    is( $P3, 123, '... the exact PMC itself' )
+
+    $P4 = $P0[str_key]
+    $I0 = issame $P1, $P4
+    ok( $I0, ' ... existing entry in Hash should be unmodified')
+
+    $P3 = vivify $P0, int_key, [ 'String' ]
+    is( $P3, 123, '... even if stored in multiple locations' )
+
+    $P4 = $P0[int_key]
+    $I0 = issame $P1, $P4
+    ok( $I0, ' ... existing entry in Hash should be unmodified')
+
+    str_key = 'baz'
+    $P3 = vivify $P0, str_key, [ 'String' ]
+    is( $P3, '', 'vivify should return new PMC if keyed PMC is not there' )
+    isa_ok( $P3, 'String', 'new PMC should have given type' )
+
+    $P4 = $P0[str_key]
+    $I0 = issame $P3, $P4
+    ok( $I0, ' ... and should be bound in Hash')
+
+    int_key = 789
+    $P3 = vivify $P0, int_key, [ 'String' ]
+    is( $P3, '', 'vivify should return new PMC if keyed PMC is not there' )
+    isa_ok( $P3, 'String', 'new PMC should have given type' )
+
+    $P4 = $P0[int_key]
+    $I0 = issame $P3, $P4
+    ok( $I0, ' ... and should be bound in Hash')
+.end
+
+# Local Variables:
+#   mode: pir
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir :

Modified: branches/orderedhash_revamp/t/perl/Parrot_Distribution.t
==============================================================================
--- branches/orderedhash_revamp/t/perl/Parrot_Distribution.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/perl/Parrot_Distribution.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -19,6 +19,8 @@
 
 =head1 DESCRIPTION
 
+Test individual Parrot::Distribution methods.
+
 =cut
 
 BEGIN { use_ok('Parrot::Distribution') }

Modified: branches/orderedhash_revamp/t/perl/Parrot_Test.t
==============================================================================
--- branches/orderedhash_revamp/t/perl/Parrot_Test.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/perl/Parrot_Test.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -90,10 +90,6 @@
 is( Parrot::Test::per_test( 0,     undef ), undef, 'per_test() invalid second arg' );
 is( Parrot::Test::per_test( undef, undef ), undef, 'per_test() two invalid args' );
 
-# RT#46893 test write_code_to_file(), plan(), skip(), slurp_file()
-
-# test the test functions from Parrot::Test
-# RT#46893: test the untested test functions
 my ( $desc, $err, $line );
 
 # PASM

Modified: branches/orderedhash_revamp/t/pharness/01-default_tests.t
==============================================================================
--- branches/orderedhash_revamp/t/pharness/01-default_tests.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pharness/01-default_tests.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 #! perl
-# Copyright (C) 2007, Parrot Foundation.
+# Copyright (C) 2007-2009, Parrot Foundation.
 # $Id$
 # 01-default_tests.t
 
@@ -12,7 +12,7 @@
     use Parrot::Config qw( %PConfig );
 };
 plan( skip_all => 't/harness only runs once configuration has completed' ) if $@;
-plan( tests => 30 );
+plan( tests => 29 );
 use Carp;
 use Cwd;
 use File::Temp qw( tempdir );
@@ -21,49 +21,52 @@
 @Parrot::Harness::DefaultTests::runcore_tests = qw( alpha.t );
 @Parrot::Harness::DefaultTests::core_tests = qw( beta.t );
 @Parrot::Harness::DefaultTests::configure_tests = qw( gamma.t );
- at Parrot::Harness::DefaultTests::standard_tests = qw( delta.t );
 @Parrot::Harness::DefaultTests::developing_tests = qw( epsilon.t );
+ at Parrot::Harness::DefaultTests::library_tests = qw( zeta.t );
+
 
 my ($core_tests_only, $runcore_tests_only);
 my (@default_tests, $default_tests_ref);
 my %default_tests_seen;
 
 my $cwd = cwd();
+my $longopts = {};
 {
     # Simulate non-existence of DEVELOPING
     my $tdir1 = tempdir( CLEANUP => 1 );
     ok( chdir $tdir1, "Able to change to tempdir for testing");
 
-    ($core_tests_only, $runcore_tests_only) = (0,1);
+#    ($core_tests_only, $runcore_tests_only) = (0,1);
+    $longopts = { core_tests_only => 0, runcore_tests_only => 1 };
     ok(@default_tests =
-        get_default_tests($core_tests_only, $runcore_tests_only),
-        "get_default_tests() returned successfully");
+        get_common_tests( $longopts ),
+        "get_common_tests() returned successfully");
     is(scalar(@default_tests), 1, "Got expected 1 test");
     is($default_tests[0], q{alpha.t}, "runcore_tests only as expected");
 
     @default_tests = ();
-    ($core_tests_only, $runcore_tests_only) = (1,0);
+    $longopts = { core_tests_only => 1, runcore_tests_only => 0 };
     ok(@default_tests =
-        get_default_tests($core_tests_only, $runcore_tests_only),
-        "get_default_tests() returned successfully");
+        get_common_tests( $longopts ),
+        "get_common_tests() returned successfully");
     is(scalar(@default_tests), 2, "Got expected 2 tests");
     is($default_tests[1], q{beta.t}, "core_tests only as expected");
 
     @default_tests = ();
-    ($core_tests_only, $runcore_tests_only) = (0,0);
+    $longopts = { core_tests_only => 0, runcore_tests_only => 0 };
     ok(@default_tests =
-        get_default_tests($core_tests_only, $runcore_tests_only),
-        "get_default_tests() returned successfully");
-    is(scalar(@default_tests), 3, "Got expected 3 tests");
+        get_common_tests( $longopts ),
+        "get_common_tests() returned successfully");
+    is(scalar(@default_tests), 4, "Got expected 4 tests");
     is($default_tests[0], q{gamma.t}, "Start with configure_tests as expected");
-    is($default_tests[2], q{beta.t}, "End with core_tests as expected");
+    is($default_tests[3], q{zeta.t}, "End with library_tests as expected");
 
     @default_tests = ();
-    ($core_tests_only, $runcore_tests_only) = (0,0);
+    $longopts = { core_tests_only => 0, runcore_tests_only => 0 };
     ok($default_tests_ref =
-        get_default_tests($core_tests_only, $runcore_tests_only),
-        "get_default_tests() returned successfully");
-    is(scalar(@{ $default_tests_ref }), 3, "Got expected 3 tests");
+        get_common_tests( $longopts ),
+        "get_common_tests() returned successfully");
+    is(scalar(@{ $default_tests_ref }), 4, "Got expected 4 tests");
 
     ok(chdir $cwd, "Able to change back to starting directory after testing");
 }
@@ -77,46 +80,37 @@
     print $FH qq{12345\n};
     close $FH or croak "Unable to close file after writing";
 
-    ($core_tests_only, $runcore_tests_only) = (0,1);
+    $longopts = { core_tests_only => 0, runcore_tests_only => 1 };
     ok(@default_tests =
-        get_default_tests($core_tests_only, $runcore_tests_only),
-        "get_default_tests() returned successfully");
+        get_common_tests( $longopts ),
+        "get_common_tests() returned successfully");
     is(scalar(@default_tests), 1, "Got expected 1 test");
     is($default_tests[0], q{alpha.t}, "runcore_tests only as expected");
-    # reset for subsequent tests
-    @Parrot::Harness::DefaultTests::standard_tests = qw( delta.t );
 
     @default_tests = ();
-    ($core_tests_only, $runcore_tests_only) = (1,0);
+    $longopts = { core_tests_only => 1, runcore_tests_only => 0 };
     ok(@default_tests =
-        get_default_tests($core_tests_only, $runcore_tests_only),
-        "get_default_tests() returned successfully");
+        get_common_tests( $longopts ),
+        "get_common_tests() returned successfully");
     is(scalar(@default_tests), 2, "Got expected 2 tests");
     is($default_tests[1], q{beta.t}, "core_tests only as expected");
-    # reset for subsequent tests
-    @Parrot::Harness::DefaultTests::standard_tests = qw( delta.t );
 
     @default_tests = ();
-    ($core_tests_only, $runcore_tests_only) = (0,0);
+    $longopts = { core_tests_only => 0, runcore_tests_only => 0 };
     ok(@default_tests =
-        get_default_tests($core_tests_only, $runcore_tests_only),
-        "get_default_tests() returned successfully");
-    is(scalar(@default_tests), 3, "Got expected 3 tests");
+        get_common_tests( $longopts ),
+        "get_common_tests() returned successfully");
+    is(scalar(@default_tests), 4, "Got expected 4 tests");
     is($default_tests[0], q{gamma.t}, "Start with configure_tests as expected");
-    is($default_tests[2], q{beta.t}, "End with core_tests as expected");
-    is(scalar(@Parrot::Harness::DefaultTests::standard_tests),
-        2, "Got expected 2 coding standards tests");
-    # reset for subsequent tests
-    @Parrot::Harness::DefaultTests::standard_tests = qw( delta.t );
+    is($default_tests[3], q{zeta.t}, "End with library_tests as expected");
 
     @default_tests = ();
-    ($core_tests_only, $runcore_tests_only) = (0,0);
+    $longopts = { core_tests_only => 0, runcore_tests_only => 0 };
     ok($default_tests_ref =
-        get_default_tests($core_tests_only, $runcore_tests_only),
-        "get_default_tests() returned successfully");
-    is(scalar(@{ $default_tests_ref }), 3, "Got expected 3 tests");
+        get_common_tests( $longopts ),
+        "get_common_tests() returned successfully");
+    is(scalar(@{ $default_tests_ref }), 4, "Got expected 4 tests");
     # reset for subsequent tests
-    @Parrot::Harness::DefaultTests::standard_tests = qw( delta.t );
 
     ok(chdir $cwd, "Able to change back to starting directory after testing");
 }
@@ -135,7 +129,7 @@
 
 =head1 DESCRIPTION
 
-This file holds tests for Parrot::Harness::DefaultTests::get_default_tests().
+This file holds tests for Parrot::Harness::DefaultTests::get_common_tests().
 
 =head1 AUTHOR
 

Added: branches/orderedhash_revamp/t/pir/macro.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/pir/macro.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,43 @@
+#! parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/pir/macro.t - Tests for macros in PIR
+
+=head1 SYNOPSIS
+
+    % prove t/pir/macro.t
+
+=head1 DESCRIPTION
+
+Tests for macros in PIR.
+
+=cut
+
+.macro foo()
+    ok(1, 'basic macro')
+.endm
+
+.macro bar(x)
+    ok(x, 'basic macro with argument')
+.endm
+
+.macro_const PI_APPROX 4
+
+.sub main :main
+    .include 'test_more.pir'
+    .local int x
+    plan(3)
+    .foo()
+    .bar(42)
+    is(.PI_APPROX, 4, '.macro_const')
+.end
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 filetype=pir:

Added: branches/orderedhash_revamp/t/pir/registernames.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/pir/registernames.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,36 @@
+#! parrot
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/pir/registernames.t - Tests for PIR register variable names
+
+=head1 SYNOPSIS
+
+    % prove t/pir/registernames.t
+
+=head1 DESCRIPTION
+
+Tests for register variable names in PIR.
+
+=cut
+
+.sub 'main' :main
+    .include 'test_more.pir'
+    plan(1)
+    test_I01_is_not_I1()
+.end
+
+.sub test_I01_is_not_I1
+    $I1  = 1
+    $I01 = 2
+    isnt($I1,$I01, 'Register variables "$I1" and "$I01" are not the same variable')
+.end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
+

Modified: branches/orderedhash_revamp/t/pmc/array.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/array.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/array.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -146,7 +146,7 @@
 .sub defined_sub
     .local pmc foo, bar, baz
     .local int ival
-    
+
     foo = new ['Array']
     defined ival, foo
     is(ival, 1, 'newed array is defined')
@@ -218,7 +218,7 @@
     .local int ival
     .local num nval
     .local string sval, inner
-   
+
     foo = new ['Array']
     foo = 4
     bar = new ['Key']
@@ -387,7 +387,7 @@
 
     p = new ['Array']
     is(p, 0, 'newed array is not true correctly')
-    
+
     p = 4
     is(p, 4, 'resized array is true correctly')
 
@@ -497,4 +497,4 @@
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/t/pmc/arrayiterator.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/arrayiterator.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/arrayiterator.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -8,7 +8,7 @@
 
 =head1 SYNOPSIS
 
-    % prove t/pmc/array.t
+    % prove t/pmc/arrayiterator.t
 
 =head1 DESCRIPTION
 
@@ -23,10 +23,12 @@
 .sub main :main
     .include 'test_more.pir'
 
-    plan(14)
+    plan(21)
 
     iterate_forward() # 8 tests
-    iterate_backward() # 5 tests
+    iterate_backward() # 6 tests
+    iterate_backward_string() # 6 test
+    iterator_init() # 1 test
 .end
 
 
@@ -88,6 +90,49 @@
     ok($I0, "Shifting from finished iterator throws exception")
 .end
 
+.sub 'iterate_backward_string'
+    .local pmc foo, it
+
+    foo = new ['ResizableStringArray']
+    push foo, 'First'
+    push foo, 'Other'
+
+    it = iter foo
+    it = .ITERATE_FROM_END
+    ok(it, "Iterator reset to backward iteration - string")
+    $S0 = pop it
+    ok(it, "Can shift 1st element - string")
+    is($S0, 'Other', "With expected value- string")
+    $S0 = pop it
+    nok(it, "Iterator is finished after second shift - string")
+    is($S0, 'First', "2nd element has correct value - string")
+
+    $I0 = 1
+    push_eh fail
+    $S0 = shift it
+    $I0 = 0
+  fail:
+    pop_eh
+    ok($I0, "Shifting from finished iterator throws exception - string")
+.end
+
+.sub 'iterator_init'
+    .local pmc it, e
+    .local string msg
+    msg = "ArrayIterator can't be directly instantiated, init must throw"
+    push_eh CATCH
+    it = new 'ArrayIterator'
+    pop_eh
+    ok(0, msg)
+    goto DONE
+CATCH:
+    .get_results(e)
+    pop_eh
+    ok(1, msg)
+DONE:
+.end
+
+
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4

Modified: branches/orderedhash_revamp/t/pmc/bigint.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/bigint.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/bigint.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,15 +1,7 @@
-#! perl
-# Copyright (C) 2001-2007, Parrot Foundation.
+#!parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-
-use Test::More;
-use Parrot::Test;
-use Parrot::Config;
-
 =head1 NAME
 
 t/pmc/bigint.t - BigInt PMC
@@ -24,654 +16,875 @@
 
 =cut
 
-if ( $PConfig{gmp} ) {
-    plan tests => 44;
-}
-else {
-    plan skip_all => "No BigInt Lib configured";
-}
-
-my $vers_check = <<'EOP';
 .sub main :main
-    .local pmc b, ar
-    .local string v
-    .local int ma, mi, pa
-    b = new ['BigInt']
-    v = b.'version'()
-    ar = split '.', v
-    ma = ar[0]
-    mi = ar[1]
-    pa = ar[2]
-    if ma >= 4 goto ge_4
-warn:
-    print 'GMP version '
-    print v
-    print " is buggy with huge digit multiply - please upgrade\n"
-    end
-ge_4:
-   if mi >= 2 goto ok
-   if mi == 0 goto warn
-   # test 4.1.x
-   if pa >= 4 goto ok
-   goto warn
-   end
-ok:
+
+    .include 'test_more.pir'
+
+    plan(45)
+    check_libgmp_good()
+
+    set_and_get()
+    addition()
+    subtraction()
+    multiplication()
+    division()
+    division_by_zero()
+    negation()
+    absolute_value()
+    overflow_coercion()
+    interface()
+    boolean()
+    pi()
+    left_shift()
+    right_shift()
+    bugfixes()
+
+.end
+
+.include 'iglobals.pasm'
+.include 'fp_equality.pasm'
+.include 'errors.pasm'
+
+.sub check_libgmp_good
+    # check libgmp included in Parrot build
+    $P0 = getinterp
+    $P1 = $P0[.IGLOBALS_CONFIG_HASH]
+
+    $P2 = $P1['gmp']
+    $I1 = isnull $P2
+    if $I1, NoLibGMP
+    say 'This Parrot uses GMP'
+
+    # check version is >= 4.1.4
+    $P0 = new ['BigInt']
+    $S3 = $P0.'version'()
+    $P1 = split '.', $S3
+    $S0 = $P1[0]
+    $I0 = $S0
+    gt $I0, 4, Config2
+    lt $I0, 4, OldLibGMP
+    $S1 = $P1[1]
+    $I1 = $S1
+    gt $I1, 1, Config2
+    lt $I1, 1, OldLibGMP
+    $S2 = $P1[2]
+    $I2 = $S2
+    lt $I2, 4, OldLibGMP
+
+Config2:
+    print 'Suitable GMP version ['
+    print $S3
+    say '] available'
+    goto ret
+
+NoLibGMP:
+    say 'No BigInt Lib configured'
+    skip(45)
+    exit 0
+
+OldLibGMP:
+    print 'Buggy GMP version ['
+    print $S3
+    say '] with huge digit multiply - please upgrade'
+    skip(45)
+    exit 0
+
+ret:
 .end
-EOP
 
-if ( $PConfig{gmp} ) {
+.sub set_and_get
+    $I1 = 1
+    $P0 = new ['BigInt']
+    $I0 = 999999
+    $P0 = $I0
+    $I2 = $P0
+    eq $I0, $I2, OK1
+    $I1 = 0
+    say 'set_int/get_int 999999 wrong'
+OK1:
+
+    $P0 = new ['BigInt']
+    $I0 = 999999
+    $P0 = $I0
+    $S0 = get_repr $P0
+    $I2 = $S0
+    eq $I0, $I2, OK2
+    $I1 = 0
+    say 'set_int/get_str 999999 wrong'
+OK2:
+
+    $P0 = new ['BigInt']
+    $P0 = 999999
+    $N1 = $P0
+    .fp_eq($N1, 999999.0, OK3)
+    $I1 = 0
+    say 'set_int/get_num 999999 wrong'
+OK3:
+
+    $P0 = -999999
+    $N1 = $P0
+    .fp_eq($N1, -999999.0, OK4)
+    $I1 = 0
+    say 'set_int/get_num -999999 wrong'
+OK4:
+
+    $P0 = 2147483646
+    $N1 = $P0
+    .fp_eq($N1, 2.147483646e9, OK5)
+    $I1 = 0
+    say 'set_int/get_num 2^31-1 wrong'
+OK5:
+
+    $P0 = -2147483646
+    $N1 = $P0
+    .fp_eq($N1, -2.147483646e9, OK6)
+    $I1 = 0
+    say 'set_int/get_num 2-2^31 wrong'
+OK6:
+
+    $P0 = new ['BigInt']
+    $P0 = 1.23e12
+    $S0 = $P0
+    eq $S0, '1230000000000', OK7
+    $I1 = 0
+    say 'set_num/get_str 1230000000000'
+OK7:
+
+    $P0 = new ['BigInt']
+    $P0 = '1230000000000'
+    $S0 = $P0
+    eq $S0, '1230000000000', OK8
+    $I1 = 0
+    say 'set_str/get_str 1230000000000'
+
+OK8:
+    ok($I1, 'set and get combinations')
+.end
+
+.sub addition
+    $I1 = 1
+    $P0 = new ['BigInt']
+    $P0 = 999999
+    $P1 = new ['BigInt']
+    $P1 = 1000000
+    $P2 = new ['BigInt']
+    $P2 = add $P0, $P1
+    $S0 = $P2
+    eq $S0, '1999999', OK1
+    $I1 = 0
+    say 'add 999999+1000000 wrong'
+OK1:
+
+    $P0 = '12345678987654321'
+    $P1 = '10000000000000000'
+    $P2 = add $P1, $P0
+    $S0 = $P2
+    eq $S0,'22345678987654321',OK2
+    $I1 = 0
+    say 'add 12345678987654321+10000000000000000 wrong'
+OK2:
+    ok($I1, 'add(bigint,bigint)')
+
+    $I1 = 1
+    $P0 = 999999
+    $P2 = add $P0, 1000000
+    $S0 = $P2
+    eq $S0,'1999999',OK3
+    $I1 = 0
+    say 'add 999999+1000000 wrong'
+OK3:
+
+    $P0 = '100000000000000000000'
+    $P2 = add $P0, 1000000
+    $S0 = $P2
+    eq $S0,'100000000000001000000',OK4
+    $I1 = 0
+    say 'add 100000000000000000000+1000000 wrong'
+OK4:
+    ok($I1, 'add(bigint,nativeint)')
+
+.end
+
+.sub subtraction
+    $I1 = 1
+    $P0 = new ['BigInt']
+    $P0 = 12345678
+    $P1 = new ['BigInt']
+    $P1 = 5678
+    $P2 = new ['BigInt']
+    $P2 = sub $P0, $P1
+    $I0 = $P2
+    eq $I0, 12340000, OK1
+    $I1 = 0
+    say 'sub 12345678-5678 wrong'
+OK1:
+
+    $P0 = '123456789012345678'
+    $P2 = sub $P0, $P1
+    $P3 = new ['BigInt']
+    $P3 = '123456789012340000'
+    eq $P2, $P3, OK2
+    $I1 = 0
+    say 'sub 123456789012345678-5678 wrong'
+OK2:
+
+    $P1 = '223456789012345678'
+    $P2 = sub $P0, $P1
+    $P3 = '-100000000000000000'
+    eq $P2, $P3, OK3
+    $I1 = 0
+    say 'sub 123456789012345678-(-100000000000000000) wrong'
+OK3:
+    ok($I1, 'sub(bigint,bigint)')
+    $I1 = 1
+
+    $P0 = 12345678
+    $P2 = sub $P0, 5678
+    $I0 = $P2
+    eq $I0, 12340000, OK4
+    $I1 = 0
+    say 'sub 12345678-5678 wrong'
+OK4:
+
+    $P0 = '123456789012345678'
+    $P2 = sub $P0, 5678
+    $P3 = new ['BigInt']
+    $P3 = '123456789012340000'
+    eq $P2, $P3, OK5
+    $I1 = 0
+    say 'sub 123456789012345678-5678 wrong'
+OK5:
+
+    $P0 = new ['BigInt']
+    $P0 = 12345678
+    $P1 = new ['Integer']
+    $P1 = 5678
+    $P2 = new ['BigInt']
+    $P2 = sub $P0, $P1
+    $I0 = $P2
+    eq $I0, 12340000, OK6
+    $I1 = 0
+    say 'sub 12345678-5678 wrong'
+OK6:
+
+    $P0 = '123456789012345678'
+    $P2 = sub $P0, $P1
+    $P3 = new ['BigInt']
+    $P3 = '123456789012340000'
+    eq $P2, $P3, OK7
+    $I1 = 0
+    say 'sub 123456789012345678-5678 wrong'
+OK7:
+
+    $P0 = 9876543
+    $P4 = new ['Integer']
+    $P4 = 44
+    $P2 = sub $P0, $P4
+    $I0 = $P2
+    eq $I0, 9876499, OK8
+    $I1 = 0
+    say 'sub 9876543-44 wrong'
+OK8:
+
+    $P0 = '9876543219876543'
+    $P2 = sub $P0, $P4
+    $P3 = '9876543219876499'
+    eq $P3, $P2, OK9
+    $I1 = 0
+    say 'sub 9876543219876543-44 wrong'
+OK9:
+    ok($I1, 'sub(bigint,integer)')
+.end
+
+.sub multiplication
+    $P0 = new ['BigInt']
+    $P0 = 999999
+    $P1 = new ['BigInt']
+    $P1 = 1000000
+    $P2 = new ['BigInt']
+    $P2 = mul $P0, $P1
+    $S0 = $P2
+    is($S0, '999999000000', 'mul(bigint,bigint)')
+
+    $P0 = new ['BigInt']
+    $P0 = 999999
+    $P2 = new ['BigInt']
+    $P2 = mul $P0, 1000000
+    is($P2, '999999000000', 'mul(bigint,nativeint)')
+.end
 
-    # argh
-    my $parrot = '.' . $PConfig{slash} . 'parrot' . $PConfig{exe};
-    my $test   = 'temp_gmp_vers.pir';
-    open my $O, '>', "$test" or die "can't open $test: $!";
-    print $O $vers_check;
-    close $O;
-    my $warn = `$parrot $test`;
-    diag $warn if $warn;
-    unlink $test;
-}
-
-pasm_output_is( <<'CODE', <<'OUT', "create" );
-   new P0, ['BigInt']
-   print "ok\n"
-   end
-CODE
-ok
-OUT
-
-pasm_output_is( <<'CODE', <<'OUT', "set/get int" );
-   new P0, ['BigInt']
-   set P0, 999999
-   set I1, P0
-   print I1
-   print "\n"
-   get_repr S0, P0
-   print S0
-   print "\n"
-   end
-CODE
-999999
-999999L
-OUT
-
-pasm_output_is( <<"CODE", <<'OUT', "set int, get double" );
-     .include 'fp_equality.pasm'
-     new P0, ['BigInt']
-     set P0, 999999
-     set N1, P0
-     .fp_eq_pasm(N1, 999999.0, OK1)
-     print "not "
-OK1: print "ok 1\\n"
-
-     set P0, -999999
-     set N1, P0
-     .fp_eq_pasm(N1, -999999.0, OK2)
-     print "not "
-OK2: print "ok 2\\n"
-
-     set P0, 2147483646
-     set N1, P0
-     .fp_eq_pasm(N1, 2.147483646e9, OK3)
-     print "not "
-OK3: print "ok 3\\n"
-
-     set P0, -2147483646
-     set N1, P0
-     .fp_eq_pasm(N1, -2.147483646e9, OK4)
-     print "not "
-OK4: print "ok 4\\n"
-     end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-OUT
-
-pasm_output_is( <<'CODE', <<'OUT', "set double, get str" );
-   new P0, ['BigInt']
-   set P0, 1.23e12
-   print P0
-   print "\n"
-   end
-CODE
-1230000000000
-OUT
-
-pasm_output_is( <<'CODE', <<'OUT', "set str, get str" );
-   new P0, ['BigInt']
-   set P0, "1230000000000"
-   print P0
-   print "\n"
-   end
-CODE
-1230000000000
-OUT
-
-pasm_output_is( <<'CODE', <<'OUT', "add" );
-   new P0, ['BigInt']
-   set P0, 999999
-   new P1, ['BigInt']
-   set P1, 1000000
-   new P2, ['BigInt']
-   add P2, P0, P1
-   set S0, P2
-   print S0
-   print "\n"
-   set P0, "12345678987654321"
-   set P1, "10000000000000000"
-   add P2, P1, P0
-   set S0, P2
-   print S0
-   print "\n"
-   end
-CODE
-1999999
-22345678987654321
-OUT
-
-pasm_output_is( <<'CODE', <<'OUT', "add_int" );
-   new P0, ['BigInt']
-   set P0, 999999
-   new P2, ['BigInt']
-   add P2, P0, 1000000
-   set S0, P2
-   print S0
-   print "\n"
-   set P0, "100000000000000000000"
-   add P2, P0, 1000000
-   set S0, P2
-   print S0
-   print "\n"
-   end
-CODE
-1999999
-100000000000001000000
-OUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "sub bigint" );
-     new P0, ['BigInt']
-     set P0, 12345678
-     new P1, ['BigInt']
-     set P1, 5678
-     new P2, ['BigInt']
-     sub P2, P0, P1
-     set I0, P2
-     eq I0, 12340000, OK1
-     print "not "
-OK1: print "ok 1\n"
-     set P0, "123456789012345678"
-     sub P2, P0, P1
-     new P3, ['BigInt']
-     set P3, "123456789012340000"
-     eq P2, P3, OK2
-     print "not "
-OK2: print "ok 2\n"
-     set P1, "223456789012345678"
-     sub P2, P0, P1
-     set P3, "-100000000000000000"
-     eq P2, P3, OK3
-     print "not "
-OK3: print "ok 3\n"
-     end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "sub native int" );
-     new P0, ['BigInt']
-     set P0, 12345678
-     new P2, ['BigInt']
-     sub P2, P0, 5678
-     set I0, P2
-     eq I0, 12340000, OK1
-     print "not "
-OK1: print "ok 1\n"
-     set P0, "123456789012345678"
-     sub P2, P0, 5678
-     new P3, ['BigInt']
-     set P3, "123456789012340000"
-     eq P2, P3, OK2
-     print "not "
-OK2: print "ok 2\n"
-     end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "sub other int" );
-     new P0, ['BigInt']
-     set P0, 12345678
-     new P1, ['Integer']
-     set P1, 5678
-     new P2, ['BigInt']
-     sub P2, P0, P1
-     set I0, P2
-     eq I0, 12340000, OK1
-     print "not "
-OK1: print "ok 1\n"
-     set P0, "123456789012345678"
-     sub P2, P0, P1
-     new P3, ['BigInt']
-     set P3, "123456789012340000"
-     eq P2, P3, OK2
-     print "not "
-OK2: print "ok 2\n"
-     set P0, 9876543
-     new P4, ['Integer']
-     set P4, 44
-     sub P2, P0, P4
-     set I0, P2
-     eq I0, 9876499, OK3
-     print "not "
-OK3: print "ok 3\n"
-     set P0, "9876543219876543"
-     sub P2, P0, P4
-     set P3, "9876543219876499"
-     eq P3, P2, OK4
-     print "not "
-OK4: print "ok 4\n"
-     end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUT', "mul" );
-   new P0, ['BigInt']
-   set P0, 999999
-   new P1, ['BigInt']
-   set P1, 1000000
-   new P2, ['BigInt']
-   mul P2, P0, P1
-   set S0, P2
-   print S0
-   print "\n"
-   end
-CODE
-999999000000
-OUT
-
-pasm_output_is( <<'CODE', <<'OUT', "mul_int" );
-   new P0, ['BigInt']
-   set P0, 999999
-   new P2, ['BigInt']
-   mul P2, P0, 1000000
-   print P2
-   print "\n"
-   end
-CODE
-999999000000
-OUT
-
-pasm_output_is( <<'CODE', <<'OUT', "div bigint" );
-     new P0, ['BigInt']
-     set P0, "100000000000000000000"
-     new P1, ['BigInt']
-     set P1, "100000000000000000000"
-     new P2, ['BigInt']
-     div P2, P0, P1
-     set I0, P2
-     eq I0, 1, OK1
-     print "not "
-OK1: print "ok 1\n"
-
-     new P3, ['BigInt']
-     set P3, "10000000000000"
-     set P1, 10000000
-     div P2, P0, P1
-     eq  P2, P3, OK2
-     print "not "
-OK2: print "ok 2\n"
-
-     set P1, 10
-     set P3, "10000000000000000000"
-     div P2, P0, P1
-     eq  P2, P3, OK3
-     print "not "
-OK3: print "ok 3\n"
-
-     set P1, -1
-     set P3, "-100000000000000000000"
-     div P2, P0, P1
-     eq  P2, P3, OK4
-     print "not "
-OK4: print "ok 4\n"
-     end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-OUT
-
-pasm_output_is( <<'CODE', <<'OUT', "div native int" );
-     new P0, ['BigInt']
-     set P0, "100000000000000000000"
-     new P1, ['BigInt']
-     div P1, P0, 10
-     new P2, ['BigInt']
-     set P2, "10000000000000000000"
-     eq P1, P2, OK1
-     print "not "
-OK1: print "ok 1\n"
-
-     set P0, "100000000000000"
-     div P1, P0, 10000000
-     set P2, 10000000
-     eq  P1, P2, OK2
-     print "not "
-OK2: print "ok 2\n"
-     end
-CODE
-ok 1
-ok 2
-OUT
-
-pasm_output_is( <<'CODE', <<'OUT', "div other int" );
-     new P0, ['BigInt']
-     set P0, "100000000000000000000"
-     new P1, ['BigInt']
-     new P3, ['Integer']
-     set P3, 10
-     div P1, P0, P3
-     new P2, ['BigInt']
-     set P2, "10000000000000000000"
-     eq P1, P2, OK1
-     print "not "
-OK1: print "ok 1\n"
-
-     set P0, "100000000000000"
-     new P4, ['Integer']
-     set P4, 10000000
-     div P1, P0, P4
-     set P2, 10000000
-     eq  P1, P2, OK2
-     print "not "
-OK2: print "ok 2\n"
-     end
-CODE
-ok 1
-ok 2
-OUT
-
-for my $op ( "/", "%" ) {
-    for my $type ( "BigInt", "Integer" ) {
-        pir_output_is( <<"CODE", <<OUTPUT, "bigint $op by zero $type" );
-.sub _main :main
-    \$P0 = new ['BigInt']
-    set \$P0, "1000000000000000000000"
-    \$P1 = new ['BigInt']
-    ## divide by a zero $type
-    \$P2 = new ['$type']
-    set \$P2, 0
-    push_eh OK
-    \$P1 = \$P0 $op \$P2
-    print "fail\\n"
+.sub division
+    $I1 = 1
+    $P0 = new ['BigInt']
+    $P0 = '100000000000000000000'
+    $P1 = new ['BigInt']
+    $P1 = '100000000000000000000'
+    $P2 = new ['BigInt']
+    $P2 = div $P0, $P1
+    $I0 = $P2
+    eq $I0, 1, OK1
+    $I1 = 0
+    say 'div 100000000000000000000/100000000000000000000 wrong'
+OK1:
+
+    $P3 = new ['BigInt']
+    $P3 = '10000000000000'
+    $P1 = 10000000
+    $P2 = div $P0, $P1
+    eq $P2, $P3, OK2
+    $I1 = 0
+    say 'div 100000000000000000000/10000000 wrong'
+OK2:
+
+    $P1 = 10
+    $P3 = '10000000000000000000'
+    $P2 = div $P0, $P1
+    eq $P2, $P3, OK3
+    $I1 = 0
+    say 'div 100000000000000000000/10 wrong'
+OK3:
+
+    $P1 = -1
+    $P3 = '-100000000000000000000'
+    $P2 = div $P0, $P1
+    eq $P2, $P3, OK4
+    $I1 = 0
+    say 'div 100000000000000000000/(-1) wrong'
+OK4:
+    ok($I1, 'div(bigint,bigint)')
+    $I1 = 1
+
+    $P0 = new ['BigInt']
+    $P0 = '100000000000000000000'
+    $P1 = new ['BigInt']
+    $P1 = div $P0, 10
+    $P2 = new ['BigInt']
+    $P2 = '10000000000000000000'
+    eq $P1, $P2, OK5
+    $I1 = 0
+    say 'div 100000000000000000000/10 wrong'
+OK5:
+
+    $P0 = '100000000000000'
+    $P1 = div $P0, 10000000
+    $P2 = 10000000
+    eq $P1, $P2, OK6
+    $I1 = 0
+    say 'div 100000000000000/10000000 wrong'
+OK6:
+    ok($I1, 'div(bigint,nativeint)')
+    $I1 = 1
+
+    $P0 = new ['BigInt']
+    $P0 = '100000000000000000000'
+    $P1 = new ['BigInt']
+    $P3 = new ['Integer']
+    $P3 = 10
+    $P1 = div $P0, $P3
+    $P2 = new ['BigInt']
+    $P2 = '10000000000000000000'
+    eq $P1, $P2, OK7
+    $I1 = 0
+    say 'div 100000000000000000000/10 wrong'
+OK7:
+
+    $P0 = '100000000000000'
+    $P4 = new ['Integer']
+    $P4 = 10000000
+    $P1 = div $P0, $P4
+    $P2 = 10000000
+    eq $P1, $P2, OK8
+    $I1 = 0
+    say 'div 100000000000000/10000000 wrong'
+OK8:
+    ok($I1, 'div(bigint,integer)')
+
+.end
+
+.sub division_by_zero
+    $I1 = 1
+    $P0 = new ['BigInt']
+    $P0 = '1000000000000000000000'
+    $P1 = new ['BigInt']
+    ## divide by a zero BigInt
+    $P2 = new ['BigInt']
+    $P2 = 0
+    push_eh E1
+        $P1 = div $P0, $P2
+        $I1 = 0
+        say 'Failed to throw exception'
+E1:
+    pop_eh
+    get_results '0', $P0
+    $S0 = $P0
+    eq $S0, 'Divide by zero', OK1
+    $I1 = 0
+    print $S0
+    say ' is wrong exception type'
+OK1:
+    ok($I1, 'div(bigint,bigint 0) throws "Divide by zero" exception')
+    $I1 = 1
+
+    $P0 = new ['BigInt']
+    $P0 = '1000000000000000000000'
+    $P1 = new ['BigInt']
+    ## modulus by a zero BigInt
+    $P2 = new ['BigInt']
+    $P2 = 0
+    push_eh E2
+        $P1 = mod $P0, $P2
+        $I1 = 0
+        say 'Failed to throw exception'
+E2:
+    pop_eh
+    get_results '0', $P0
+    $S0 = $P0
+    eq $S0, 'Divide by zero', OK2
+    $I1 = 0
+    print $S0
+    say ' is wrong exception type'
+OK2:
+    ok($I1, 'mod(bigint,bigint 0) throws "Divide by zero" exception')
+    $I1 = 1
+
+    $P0 = new ['BigInt']
+    $P0 = '1000000000000000000000'
+    $P1 = new ['BigInt']
+    ## divide by a zero Integer
+    $P2 = new ['Integer']
+    $P2 = 0
+    push_eh E3
+        $P1 = div $P0, $P2
+        $I1 = 0
+        say 'Failed to throw exception'
+E3:
     pop_eh
-OK:
-    get_results '0', \$P0
-    \$S0 = \$P0
-    print "ok\\n"
-    print \$S0
-    print "\\n"
+    get_results '0', $P0
+    $S0 = $P0
+    eq $S0, 'Divide by zero', OK3
+    $I1 = 0
+    print $S0
+    say ' is wrong exception type'
+OK3:
+    ok($I1, 'div(bigint,integer 0) throws "Divide by zero" exception')
+    $I1 = 1
+
+    $P0 = new ['BigInt']
+    $P0 = '1000000000000000000000'
+    $P1 = new ['BigInt']
+    ## modulus by a zero Integer
+    $P2 = new ['Integer']
+    $P2 = 0
+    push_eh E4
+        $P1 = mod $P0, $P2
+        $I1 = 0
+        say 'Failed to throw exception'
+E4:
+    pop_eh
+    get_results '0', $S0
+    eq $S0, 'Divide by zero', OK4
+    $I1 = 0
+    print $S0
+    say ' is wrong exception type'
+OK4:
+    ok($I1, 'mod(bigint,integer 0) throws "Divide by zero" exception')
+
 .end
-CODE
-ok
-Divide by zero
-OUTPUT
-    }
-}
-
-{
-    my ( $a, $b, $c, $d, $e );
-    if ( $PConfig{intvalsize} == 8 ) {
-        $a = '9223372036854775806';    # 2**63-2
-        $b = '1';
-        $c = '9223372036854775807';    # still Integer
-        $d = '9223372036854775808';    # no more Integer
-        $e = '9223372036854775809';    # still no more Integer
-    }
-    elsif ( $PConfig{intvalsize} == 4 ) {
-        $a = '2147483646';             # 2**31-2
-        $b = '1';
-        $c = '2147483647';             # still Integer
-        $d = '2147483648';             # no more PerlInt
-        $e = '2147483649';             # still no more PerlInt
-    }
-    else {
-        die "\$PConfig{intvalsize} == $PConfig{intvalsize}?\n";
-    }
-
-    pasm_output_is( <<CODE, <<OUT, "add overflow Integer" );
-   new P0, ['Integer']
-   set P0, $a
-   new P1, ['Integer']
-   set P1, $b
-   new P2, ['Integer']
-   new P3, ['BigInt']
-   set I3, 3
-lp:
-   add P2, P0, P1
-   set S0, P2
-   print S0
-   print " "
-   typeof S1, P2
-   print S1
-   print "\\n"
-   add P1, $b
-   dec I3
-   if I3, lp
-   print "ok\\n"
-ex:
-   end
-CODE
-$c Integer
-$d BigInt
-$e BigInt
-ok
-OUT
-
-    pasm_output_is( <<CODE, <<OUT, "add overflow Integer" );
-   new P0, ['Integer']
-   set P0, $a
-   new P1, ['Integer']
-   set P1, $b
-   new P2, ['Integer']
-   new P3, ['BigInt']
-   set I3, 3
-lp:
-   add P2, P0, P1
-   set S0, P2
-   print S0
-   print " "
-   typeof S1, P2
-   print S1
-   print "\\n"
-   add P1, $b
-   dec I3
-   if I3, lp
-   print "ok\\n"
-ex:
-   end
-CODE
-$c Integer
-$d BigInt
-$e BigInt
-ok
-OUT
-}
-
-pasm_output_is( <<'CODE', <<'OUT', "abs" );
-   new P0, ['BigInt']
-   set P0, "-1230000000000"
-   new P1, ['Undef']
-   abs P1, P0
-   print P1
-   print "\n"
-   print P0
-   print "\n"
-   abs P0
-   print P0
-   print "\n"
-   end
-CODE
-1230000000000
--1230000000000
-1230000000000
-OUT
-
-pir_output_is( << 'CODE', << 'OUTPUT', "check whether interface is done" );
-
-.sub _main
-    .local pmc pmc1
-    pmc1 = new ['BigInt']
-    .local int bool1
-    does bool1, pmc1, "scalar"
-    print bool1
-    print "\n"
-    does bool1, pmc1, "no_interface"
-    print bool1
-    print "\n"
-    end
+
+.sub negation
+    $I1 = 1
+    $P0 = new ['BigInt']
+    $P1 = new ['BigInt']
+    $P0 = '123456789123456789'
+    neg $P0
+    $P1 = '-123456789123456789'
+    eq $P0, $P1, OK1
+    $I1 = 0
+OK1:
+    $P0 = '-123456789123456789'
+    neg $P0
+    $P1 = '123456789123456789'
+    eq $P0, $P1, OK2
+    $I1 = 0
+OK2:
+    ok($I1, 'negation')
 .end
-CODE
-1
-0
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', "Truth" );
-     new P0, ['BigInt']
-     set P0, "123456789123456789"
-     if P0, OK1
-     print "not "
-OK1: print "ok 1\\n"
-     set P0, 0
-     unless P0, OK2
-     print "not "
-OK2: print "ok 2\\n"
-     end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', "neg" );
-     new P0, ['BigInt']
-     new P1, ['BigInt']
-     set P0, "123456789123456789"
-     neg P0
-     set P1, "-123456789123456789"
-     eq P0, P1, OK1
-     print "not "
-OK1: print "ok 1\\n"
-     end
-CODE
-ok 1
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', "pi() generator" );
-.sub PI
-    .local pmc k, a, b, a1, b1
-    k = new ['Integer']
-    k = 2
-    a = new ['Integer']
-    a = 4
-    b = new ['Integer']
-    b = 1
-    a1 = new ['Integer']
-    a1 = 12
-    b1 = new ['Integer']
-    b1 = 4
-forever:
-    .local pmc p, q
-    p = mul k, k
-    q = mul k, 2
-    inc q
-    inc k
-    .local pmc ta, tb, ta1, tb1
-    ta = clone a1
-    tb = clone b1
-    $P0 = mul p, a
-    $P1 = mul q, a1
-    ta1 =  add $P0, $P1
-    $P2 = mul p, b
-    $P3 = mul q, b1
-    tb1 =  add $P2, $P3
-    a = ta
-    b = tb
-    a1 = ta1
-    b1 = tb1
-    .local pmc d, d1
-    d = fdiv a, b
-    d1 = fdiv a1, b1
-yield_loop:
-    unless d == d1 goto end_yield
-    .yield(d)
-    $P4 = mod a, b
-    a = mul $P4, 10
-    $P5 = mod a1, b1
-    a1 = mul $P5, 10
-    d = fdiv a, b
-    d1 = fdiv a1, b1
-    goto yield_loop
-end_yield:
-    goto forever
+
+.sub absolute_value
+    $P0 = new ['BigInt']
+    $P0 = '-1230000000000000000000'
+    $P1 = new ['Undef']
+    $P1 = abs $P0
+    $S0 = $P1
+    is($S0,'1230000000000000000000','abs negates negative number')
+    $S0 = $P0
+    is($S0,'-1230000000000000000000','... and original unchanged with 2-arg form')
+    $P1 = abs $P1
+    $S0 = $P1
+    is($S0,'1230000000000000000000','... does not change to positive number')
+    $S0 = $P1
+    abs $P0
+    $S0 = $P0
+    is($S0,'1230000000000000000000','... and in-place works too')
 .end
 
-.sub main :main
-    .local int i
-    .local pmc d
-    null i
-loop:
-    d = PI()
-    print d
-    inc i
-    $I0 = i % 50
-    if $I0 goto no_nl
-    print "\n"
-no_nl:
-    if i < 1000 goto loop
-    print "\n"
+.sub overflow_coercion
+    # check libgmp included in Parrot build
+    $P0 = getinterp
+    $P4 = $P0[.IGLOBALS_CONFIG_HASH]
+    $I0 = $P4['intvalsize']
+    eq $I0, 8, sz8
+    eq $I0, 4, sz4
+    print 'Cannot cope with sizeof(INTVAL) == '
+    say $I0
+    skip(43)
+    exit 1
+
+sz8:
+    $I3 = 0x100000000               # sqrt(2*(MinInt+1))
+    $I4 = 9223372036854775806       # MaxInt-1 == 2**63-2
+    $I5 = 9223372036854775807       # MaxInt
+    $S5 = '9223372036854775807'     # MaxInt
+    $S6 = '9223372036854775808'     # MaxInt+1
+    $S7 = '9223372036854775809'     # MaxInt+2
+    $I8 = -9223372036854775807      # MinInt+1 == 1-2**63
+    $I9 = -9223372036854775808      # MinInt
+    $S9 = '-9223372036854775808'    # MinInt
+    $S10 = '-9223372036854775809'   # MinInt-1
+    $S11 = '-9223372036854775810'   # MinInt-2
+    goto esz
+
+sz4:
+    $I3 = 0x10000                   # sqrt(2*(MinInt+1))
+    $I4 = 2147483646                # MaxInt-1 == 2**31-2
+    $I5 = 2147483647                # MaxInt
+    $S5 = '2147483647'              # MaxInt
+    $S6 = '2147483648'              # MaxInt+1
+    $S7 = '2147483649'              # MaxInt+2
+    $I8 = -2147483647               # MinInt+1 == 1-2**31
+    $I9 = -2147483648               # MinInt
+    $S9 = '-2147483648'             # MinInt
+    $S10 = '-2147483649'            # MinInt-1
+    $S11 = '-2147483650'            # MinInt-2
+    goto esz
+
+esz:
+    print 'Using '
+    $I0 = mul $I0, 8
+    print $I0
+    print '-bit Integers ['
+    print $I9
+    print '...'
+    print $I5
+    say ']'
+
+    # Checking upper bound by incremental increase
+    $I1 = 1
+    $P0 = new ['Integer']
+    $P0 = $I4               # MaxInt-1
+    $P1 = new ['Integer']
+    $P1 = 1
+    $P0 = add $P0, $P1
+    $S0 = typeof $P0
+    eq $S0, 'Integer', k0
+    $I1 = 0
+    say "typeof != 'Integer'"
+k0:
+    $S0 = $P0
+    eq $S0, $S5, k1         # MaxInt
+    $I1 = 0
+    say 'value != MaxInt'
+k1:
+    $P0 = add $P0, $P1
+    $S0 = typeof $P0
+    eq $S0, 'BigInt', k2
+    $I1 = 0
+    say "typeof != 'BigInt'"
+k2:
+    $S0 = $P0
+    eq $S0, $S6, k3         # MaxInt+1
+    $I1 = 0
+    say 'value != MaxInt+1'
+k3:
+    $P0 = add $P0, $P1
+    $S0 = typeof $P0
+    eq $S0, 'BigInt', k4
+    $I1 = 0
+    say "typeof != 'BigInt'"
+k4:
+    $S0 = $P0
+    eq $S0, $S7, k5         # MaxInt+2
+    $I1 = 0
+    say 'value != MaxInt+2'
+k5:
+
+    # Checking upper bound by increased steps
+    $P0 = new ['Integer']
+    $P0 = $I4               # MaxInt-1
+    $P2 = new ['Integer']
+    $P2 = add $P0, $P1
+    $S0 = typeof $P2
+    eq $S0, 'Integer', k6
+    $I1 = 0
+    say "typeof != 'Integer'"
+k6:
+    $S0 = $P2
+    eq $S0, $S5, k7         # MaxInt
+    $I1 = 0
+    say 'value != MaxInt'
+k7:
+    inc $P1
+    $P2 = new ['Integer']
+    $P2 = add $P0, $P1
+    $S0 = typeof $P2
+    eq $S0, 'BigInt', k8
+    $I1 = 0
+    say "typeof != 'BigInt'"
+k8:
+    $S0 = $P2
+    eq $S0, $S6, k9         # MaxInt+1
+    $I1 = 0
+    say 'value != MaxInt+1'
+k9:
+    add $P1, 1
+    $P2 = new ['Integer']
+    $P2 = add $P0, $P1
+    $S0 = typeof $P2
+    eq $S0, 'BigInt', k10
+    $I1 = 0
+    say "typeof != 'BigInt'"
+k10:
+    $S0 = $P2
+    eq $S0, $S7, k11         # MaxInt+2
+    $I1 = 0
+    say 'value != MaxInt+2'
+k11:
+    ok($I1, 'integer addition converts MaxInt+1 to BigInt')
+
+    # Checking lower bound
+    $I1 = 6
+    $P0 = new ['Integer']
+    $P0 = $I8
+    $P1 = -1
+    $P2 = new ['Integer']
+    $P2 = add $P0, $P1
+    $S0 = typeof $P2
+    ne $S0, 'Integer', k12
+    dec $I1
+k12:
+    $S0 = $P2
+    ne $S0, $S9, k13
+    dec $I1
+k13:
+    dec $P1
+    $P2 = new ['Integer']
+    $P2 = add $P0, $P1
+    $S0 = typeof $P2
+    ne $S0, 'BigInt', k14
+    dec $I1
+k14:
+    $S0 = $P2
+    ne $S0, $S10, k15
+    dec $I1
+k15:
+    sub $P1, 1
+    $P2 = new ['Integer']
+    $P2 = add $P0, $P1
+    $S0 = typeof $P2
+    ne $S0, 'BigInt', k16
+    dec $I1
+k16:
+    $S0 = $P2
+    ne $S0, $S11, k17
+    dec $I1
+k17:
+    is($I1, 0, 'integer addition converts MinInt+(-1) to BigInt')
+
+    $I1 = 6
+    $P0 = new ['Integer']
+    $P0 = $I4
+    $P1 = -1
+    $P2 = new ['Integer']
+    $P2 = sub $P0, $P1
+    $S0 = typeof $P2
+    ne $S0, 'Integer', k18
+    dec $I1
+k18:
+    $S0 = $P2
+    ne $S0, $S5, k19
+    dec $I1
+k19:
+    dec $P1
+    $P2 = new ['Integer']
+    $P2 = sub $P0, $P1
+    $S0 = typeof $P2
+    ne $S0, 'BigInt', k20
+    dec $I1
+k20:
+    $S0 = $P2
+    ne $S0, $S6, k21
+    dec $I1
+k21:
+    sub $P1, 1
+    $P2 = new ['Integer']
+    $P2 = sub $P0, $P1
+    $S0 = typeof $P2
+    ne $S0, 'BigInt', k22
+    dec $I1
+k22:
+    $S0 = $P2
+    ne $S0, $S7, k23
+    dec $I1
+k23:
+    is($I1, 0, 'integer subtraction converts MaxInt-(-1) to BigInt')
+
+    $I1 = 0
+    $P0 = new ['Integer']
+    $P0 = $I8   # MinInt
+    dec $P0
+    neg $P0
+    $S0 = typeof $P0
+    ne $S0, 'BigInt', k24
+    inc $I1
+k24:
+    $S0 = $P0
+    ne $S0, $S6, k25
+    inc $I1
+k25:
+    todo($I1, 'integer negation of MinInt converts MaxInt+1 to BigInt')
+
+    $I1 = 0
+    $P0 = new ['Integer']
+    $P0 = $I8   # MinInt
+    dec $P0
+    abs $P0
+    $S0 = typeof $P0
+    ne $S0, 'BigInt', k26
+    inc $I1
+k26:
+    $S0 = $P0
+    ne $S0, $S6, k27
+    inc $I1
+k27:
+    todo($I1, 'integer absolute-value of MinInt converts MaxInt+1 to BigInt')
+
+    $P0 = new ['Integer']
+    $P0 = $I3
+    $P1 = new ['Integer']
+    $P1 = $I3
+
+ex:
 .end
 
-=begin python
+.sub interface
+    $P0 = new ['BigInt']
+    $I0 = does $P0, 'scalar'
+    is($I0,1,'Interface does scalar')
+    $I0 = does $P0, 'no_interface'
+    is($I0,0,'... and does not do bogus')
+.end
 
-class PI(object):
-    def __iter__(self):
-        k, a, b, a1, b1 = 2, 4, 1, 12, 4
-        while 1:
-            p, q, k = k*k, 2*k+1, k+1
-            a, b, a1, b1 = a1, b1, p*a+q*a1, p*b+q*b1
-            d, d1 = a//b, a1//b1
-            while d == d1:
-                yield d
-                a, a1 = 10*(a%b), 10*(a1%b1)
-                d, d1 = a//b, a1//b1
-
-pi = iter(PI())
-ds = ""
-for i in xrange(1, 1001):
-    d = pi.next()
-    ds += str(d)
-    im = i % 50
-    if im == 0:
-        print ds
-        ds = ""
+.sub boolean
+    $P0 = new ['BigInt']
 
-print ds
+    $P0 = '123456789123456789'
+    $I0 = 1
+    if $P0, OK1
+    $I0 = 0
+OK1:
+
+    $P0 = 0
+    unless $P0, OK2
+    $I0 = 0
+OK2:
 
-=end python
+    ok($I0, 'truth and falsehood')
+.end
 
-=cut
+# How this next test was originally written in Python:
+#
+#   class PI(object):
+#       def __iter__(self):
+#           k, a, b, a1, b1 = 2, 4, 1, 12, 4
+#           while 1:
+#               p, q, k = k*k, 2*k+1, k+1
+#               a, b, a1, b1 = a1, b1, p*a+q*a1, p*b+q*b1
+#               d, d1 = a//b, a1//b1
+#               while d == d1:
+#                   yield d
+#                   a, a1 = 10*(a%b), 10*(a1%b1)
+#                   d, d1 = a//b, a1//b1
+#
+#   pi = iter(PI())
+#   ds = ""
+#   for i in xrange(1, 1001):
+#       d = pi.next()
+#       ds += str(d)
+#       im = i % 50
+#       if im == 0:
+#           print ds
+#           ds = ""
+#
+#   print ds
+#
+
+.sub pi_generator
+    # k = $P6
+    $P6 = new ['Integer']
+    $P6 = 2
+    # a = $P7
+    $P7 = new ['Integer']
+    $P7 = 4
+    # b = $P8
+    $P8 = new ['Integer']
+    $P8 = 1
+    # a1 = $P9
+    $P9 = new ['Integer']
+    $P9 = 12
+    # b1 = $P10
+    $P10 = new ['Integer']
+    $P10 = 4
+restart:
+    # p = $P11
+    $P11 = mul $P6, $P6
+    # q = $P12
+    $P12 = mul $P6, 2
+    inc $P12
+    inc $P6
+    # ta  = $P13
+    $P13 = clone $P9
+    # tb  = $P14
+    $P14 = clone $P10
+    $P0 = mul $P11, $P7
+    $P1 = mul $P12, $P9
+    # ta1 = $P15
+    $P15 =  add $P0, $P1
+    $P2 = mul $P11, $P8
+    $P3 = mul $P12, $P10
+    # tb1 = $P16
+    $P16 =  add $P2, $P3
+    $P7 = $P13
+    $P8 = $P14
+    $P9 = $P15
+    $P10 = $P16
+    # d = $P17
+    $P17 = fdiv $P7, $P8
+    # d1 = $P18
+    $P18 = fdiv $P9, $P10
+next:
+    ne $P17, $P18, restart
+    .yield($P17)
+    $P4 = mod $P7, $P8
+    $P7 = mul $P4, 10
+    $P5 = mod $P9, $P10
+    $P9 = mul $P5, 10
+    $P17 = fdiv $P7, $P8
+    $P18 = fdiv $P9, $P10
+    goto next
+.end
 
-CODE
+.sub pi
+    $S0 = <<'EoN'
 31415926535897932384626433832795028841971693993751
 05820974944592307816406286208998628034825342117067
 98214808651328230664709384460955058223172535940812
@@ -692,408 +905,433 @@
 17101000313783875288658753320838142061717766914730
 35982534904287554687311595628638823537875937519577
 81857780532171226806613001927876611195909216420198
+EoN
 
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUT', "shl_bigint" );
-   new P0, ['BigInt']
-   set P0, "2"
-   new P1, ['BigInt']
-   set P1, 2
-   new P2, ['BigInt']
-   shl P2, P0, P1
-   set S0, P2
-   print S0
-   print "\n"
-   set P0, "100000000000"
-   set P1, 10
-   shl P2, P0, P1
-   set S0, P2
-   print S0
-   print "\n"
-   end
-CODE
-8
-102400000000000
-OUT
-
-pir_output_is( <<'CODE', <<'OUT', "shl_bigint with a negative shift" );
-## cf the shr_bigint case.
-.sub main :main
-   $P0 = new ['BigInt']
-   set $P0, 8
-   $P1 = new ['BigInt']
-   set $P1, -2
-   $P2 = new ['BigInt']
-   shl $P2, $P0, $P1
-   say $P2
-   set $P0, "102400000000000"
-   set $P1, -10
-   shl $P2, $P0, $P1
-   say $P2
+    $I3 = 0
+    $I4 = length $S0
+loop:
+    $P0 = pi_generator()
+skip_ws:
+    $S1 = substr $S0,$I3,1
+    eq $S1, '', stop
+    inc $I3
+    eq $S1, '.', skip_ws
+    eq $S1, ' ', skip_ws
+    eq $S1, "\r", skip_ws
+    eq $S1, "\n", skip_ws
+    $I1 = $S1
+    $I0 = $P0
+    eq $I0, $I1, loop
+stop:
+    is($I0, $I1, 'Computed 1000 digits of PI (using coroutine)')
+    eq $I0, $I1, ret
+        print 'Wrong digit '
+        print $I0
+        print ' should have been '
+        print $S1
+        print ' at position '
+        print $I3
+        say '.'
+    ret:
 .end
-CODE
-2
-100000000000
-OUT
-
-pasm_output_is( <<'CODE', <<'OUT', "shl_int" );
-   new P0, ['BigInt']
-   set P0, 2
-   new P1, ['Integer']
-   set P1, 1
-   new P2, ['BigInt']
-   shl P2, P0, P1
-   set S0, P2
-   print S0
-   print "\n"
-   set P0, "100000000000"
-   set P1, 1
-   shl P2, P0, P1
-   set S0, P2
-   print S0
-   print "\n"
-   set P0, "100000000000"
-   set P1, 10
-   shl P2, P0, P1
-   set S0, P2
-   print S0
-   print "\n"
-   end
-CODE
-4
-200000000000
-102400000000000
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "shl_int with a negative shift" );
-## cf the shr_int case.
-.sub main :main
-   $P0 = new ['BigInt']
-   set $P0, 4
-   $P1 =  new ['Integer']
-   set $P1, -1
-   $P2 = new ['BigInt']
-   shl $P2, $P0, $P1
-   say $P2
-   set $P0, "200000000000"
-   set $P1, -1
-   shl $P2, $P0, $P1
-   say $P2
-   set $P0, "102400000000000"
-   set $P1, -10
-   shl $P2, $P0, $P1
-   say $P2
-.end
-CODE
-2
-100000000000
-100000000000
-OUT
-
-pir_output_like( <<'CODE', <<'OUT', "shl_int and i_shl_int promote Integer to Bigint" );
-## The result on the second line is a BigInt on 32-bit systems and still an
-## Integer on 64-bit systems.
-.sub main :main
-   $P0 = new ['Integer']
-   set $P0, 1000001
-   $P1 = new ['Integer']
-   set $P1, 10
-   $P2 = new ['Integer']
-   ## shift by 10 bits . . .
-   shl $P2, $P0, $P1
-   $S2 = typeof $P2
-   print $S2
-   print ' '
-   say $P2
-   ## then by 20 bits . . .
-   $P1 = 20
-   $P3 = new ['Integer']
-   $P3 = 1000001
-   shl $P3, $P0, $P1
-   $S2 = typeof $P3
-   print $S2
-   print ' '
-   say $P3
-   ## then by another 40 bits (total 60) in place.
-   $P1 = 40
-   shl $P3, $P3, $P1
-   $S2 = typeof $P3
-   print $S2
-   print ' '
-   say $P3
-.end
-CODE
-/Integer 1024001024
-(Integer|BigInt) 1048577048576
-BigInt 1152922657528351582846976
-/
-OUT
+.sub left_shift
+    $I1 = 1
 
-pir_error_output_like( <<'CODE', <<'OUT', "shl_int throws an error when promotion is disabled" );
-.include "errors.pasm"
-.sub main :main
-   errorson .PARROT_ERRORS_OVERFLOW_FLAG
-   $P0 = new ['Integer']
-   set $P0, 1000001
-   $P1 = new ['Integer']
-   set $P1, 10
-   $P2 = new ['Integer']
-   ## shift by 10 bits . . .
-   shl $P2, $P0, $P1
-   $S2 = typeof $P2
-   print $S2
-   print ' '
-   say $P2
-   ## then by 60 bits.
-   $P1 = 60
-   $P0 = 1000001
-   shl $P3, $P0, $P1
-   $S2 = typeof $P3
-   print $S2
-   print ' '
-   say $P3
-.end
-CODE
-/Integer 1024001024
-Integer overflow
-current instr/
-OUT
+    $P0 = new ['BigInt']
+    $P1 = new ['BigInt']
+
+# shl with a positive shift
+    $P0 = 2
+    $P1 = 2
+    $P2 = new ['Integer']
+    $P2 = shl $P0, $P1
+    $S0 = $P2
+    eq $S0, '8', OK1
+    $I1 = 0
+    say 'shl(bigint 2,bigint 2) did not return 8'
+OK1:
+    $P0 = '100000000000'
+    $P1 = 10
+    $P2 = new ['Integer']
+    $P2 = shl $P0, $P1
+    $S0 = $P2
+    eq $S0, '102400000000000', OK2
+    $I1 = 0
+    say 'shl(bigint 100000000000,bigint 10) did not return 102400000000000'
+OK2:
+
+# shl with a negative shift
+    $P0 = 8
+    $P1 = -2
+    $P2 = new ['Integer']
+    $P2 = shl $P0, $P1
+    $S0 = $P2
+    is($S0, '2', 'shl(bigint, -bigint)')
+    $P0 = '102400000000000'
+    $P1 = -10
+    $P2 = new ['Integer']
+    $P2 = shl $P0, $P1
+    $S0 = $P2
+    eq $S0, '100000000000', OK3
+    $I1 = 0
+    say 'shl(bigint 102400000000000,bigint -10) did not return 100000000000'
+OK3:
+
+    ok($I1, 'shl(bigint, +bigint)')
+    $I1 = 1
+
+# shl_int with a positive shift
+    $P0 = 2
+    $P1 = 1
+    $P2 = new ['Integer']
+    $P2 = shl $P0, $P1
+    $S0 = $P2
+    eq $S0, '4', OK4
+    $I1 = 0
+    say 'shl(bigint 2,integer 1) did not return 4'
+OK4:
+    $P0 = '100000000000'
+    $P1 = 1
+    $P2 = new ['Integer']
+    $P2 = shl $P0, $P1
+    $S0 = $P2
+    eq $S0, '200000000000', OK5
+    $I1 = 0
+    say 'shl(bigint 100000000000,integer 1) did not return 200000000000'
+OK5:
+    $P0 = '100000000000'
+    $P1 = 10
+    $P2 = new ['Integer']
+    $P2 = shl $P0, $P1
+    $S0 = $P2
+    eq $S0, '102400000000000', OK6
+    $I1 = 0
+    say 'shl(bigint 100000000000,integer 10) did not return 102400000000000'
+OK6:
+
+# shl_int with a negative shift
+
+    $P0 = 4
+    $P1 = -1
+    $P2 = new ['Integer']
+    $P2 = shl $P0, $P1
+    $S0 = $P2
+    eq $S0, '2', OK7
+    $I1 = 0
+    say 'shl(bigint 4,integer -1) did not return 2'
+OK7:
+    $P0 = '200000000000'
+    $P1 = -1
+    $P2 = new ['Integer']
+    $P2 = shl $P0, $P1
+    $S0 = $P2
+    eq $S0, '100000000000', OK8
+    $I1 = 0
+    say 'shl(bigint 200000000000,integer -1) did not return 100000000000'
+OK8:
+    $P0 = '102400000000000'
+    $P1 = -10
+    $P2 = new ['Integer']
+    $P2 = shl $P0, $P1
+    $S0 = $P2
+    eq $S0, '100000000000', OK9
+    $I1 = 0
+    say 'shl(bigint 102400000000000,integer -10) did not return 100000000000'
+OK9:
+    ok($I1, 'shl(bigint,integer)')
+    $I1 = 1
+
+# shl_int throws an error when promotion is disabled
+
+    errorson .PARROT_ERRORS_OVERFLOW_FLAG
+    $P0 = new ['Integer']
+    $P0 = 1000001
+    $P1 = new ['Integer']
+    $P1 = 10
+
+    ## shift by 10 bits . . .
+    $P2 = new ['Integer']
+    $P2 = shl $P0, $P1
+    $S1 = $P2
+    $S2 = typeof $P2
+    eq $S2, 'Integer', OK11
+    $I1 = 0
+    print 'shl(integer 1000001,integer 10) did not return an Integer PMC; got a '
+    print $S2
+    say ' instead.'
+
+OK11:
+    eq $S1,'1024001024', OK12
+    $I1 = 0
+    print 'shl(integer 1000001,integer 10) did not return 1024001024; got '
+    print $S1
+    say ' instead.'
+OK12:
+
+    ## then by 60 bits.
+    $P0 = 1000001
+    $P1 = 60
+    push_eh E1
+        $I1 = 1
+        $P2 = new ['Integer']
+        $P2 = shl $P0, $P1
+        $I1 = 0
+        $S1 = $P2
+        $S2 = typeof $P2
+        print 'Failed to throw exception; return type '
+        print $S2
+        print ', return value '
+        say $P1
+E1:
+    pop_eh
+    get_results '0', $P2
+    $S0 = $P2
+    eq $S0, 'Integer overflow', OK13
+    $I1 = 0
+    say 'shl(integer 1000001, integer 60) throws exception, but wrong type'
+OK13:
+    ok($I1, 'shl(integer 1000001, integer 60) throws "Integer overflow" exception')
+    $I1 = 1
+
+# shl_int and i_shl_int promote Integer to Bigint
+
+    errorsoff .PARROT_ERRORS_OVERFLOW_FLAG
+    ## shift left by 20 bits ...
+    $P0 = new ['Integer']
+    $P0 = 1000001
+    $P1 = new ['Integer']
+    $P1 = 20
+    $P2 = new ['Integer']
+    $P2 = shl $P0, $P1
+    ## ... then by another 40 bits (total 60) in place.
+    $P1 = 40
+    $P2 = shl $P2, $P1
+    $S1 = $P2
+    $S2 = typeof $P2
+    eq $S2, 'BigInt', OK14
+    $S1 = ''
+OK14:
+    is($S1, '1152922657528351582846976', 'shl(shl(integer 1000001, 20), 40) => bigint 1152922657528351582846976')
 
-pir_output_is( <<'CODE', <<'OUT', "shl_int by 64 bits also promotes to Bigint" );
+# shl_int by 64 bits also promotes to Bigint
 ## The C << and >> ops take the right arg modulo the word size in bits (at least
 ## on all the systems I have available), so both 32- and 64-bit systems treat
 ## shifting by 64 bits as shifting by zero.
-.sub main :main
-   $P0 = new ['Integer']
-   set $P0, 1000001
-   $P1 = new ['Integer']
-   set $P1, 64
-   shl $P2, $P0, $P1
-   $S2 = typeof $P2
-   print $S2
-   print ' '
-   say $P2
+    $P0 = new ['Integer']
+    $P0 = 1000001
+    $P1 = new ['Integer']
+    $P1 = 64
+    $P2 = new ['Integer']
+    $P2 = shl $P0, $P1
+    $S1 = $P2
+    $S2 = typeof $P2
+    eq $S2, 'BigInt', OK15
+    $S1 = ''
+OK15:
+    is($S1, '18446762520453625325551616', 'shl(integer 1000001, 64) => bigint 18446762520453625325551616')
 .end
-CODE
-BigInt 18446762520453625325551616
-OUT
 
-pir_output_is(
-    <<'CODE', <<'OUT', "shr_int and i_shr_int with a neg shift promote Integer to Bigint" );
-.sub main :main
-   $P0 = new ['Integer']
-   set $P0, 1000001
-   $P1 = new ['Integer']
-   set $P1, -10
-   $P2 = new ['Integer']
-   ## shift by 10 bits . . .
-   shr $P2, $P0, $P1
-   $S2 = typeof $P2
-   print $S2
-   print ' '
-   say $P2
-   ## then by another 50 bits (total 60) in place.
-   $P1 = -50
-   shr $P2, $P1
-   $S2 = typeof $P2
-   print $S2
-   print ' '
-   say $P2
-.end
-CODE
-Integer 1024001024
-BigInt 1152922657528351582846976
-OUT
-
-pasm_output_is( <<'CODE', <<'OUT', "shr_bigint" );
-   new P0, ['BigInt']
-   set P0, 8
-   new P1, ['BigInt']
-   set P1, 2
-   new P2, ['BigInt']
-   shr P2, P0, P1
-   set S0, P2
-   print S0
-   print "\n"
-   set P0, "102400000000000"
-   set P1, 10
-   shr P2, P0, P1
-   set S0, P2
-   print S0
-   print "\n"
-   end
-CODE
-2
-100000000000
-OUT
+.sub right_shift
+    $I1 = 1
+#shr_int and i_shr_int with a neg shift promote Integer to Bigint
+
+    $P0 = new ['Integer']
+    $P0 = 1000001
+    $P1 = new ['Integer']
+    $P1 = -10
+    $P2 = new ['Integer']
+    ## shift by 10 bits . . .
+    $P2 = shr $P0, $P1
+#   $S2 = typeof $P2
+#   ne $S2, 'Integer', OK2
+
+    ## then by another 50 bits (total 60) in place.
+    $P1 = -50
+    $P2 = shr $P1
+    $S1 = $P2
+    $S2 = typeof $P2
+    eq $S2, 'BigInt', OK2
+    $S1 = ''
+OK2:
+    is($S1, '1152922657528351582846976', 'shr(shr(integer 1000001, integer -10), -50) => bigint 1152922657528351582846976')
+
+#   shr_bigint
+    $P0 = new ['BigInt']
+    $P0 = 8
+    $P1 = new ['BigInt']
+    $P1 = 2
+    $P2 = new ['BigInt']
+    $P2 = shr $P0, $P1
+    $S0 = $P2
+    eq $S0, '2', OK3
+    $I1 = 0
+    say 'shr(bigint 8, bigint 2) did not return 2'
+OK3:
+
+    $P0 = '102400000000000'
+    $P1 = 10
+    $P2 = shr $P0, $P1
+    $S0 = $P2
+    eq $S0, '100000000000', OK4
+    $I1 = 0
+    say 'shr(bigint 102400000000000, bigint 10) did not return 100000000000'
+OK4:
+    ok($I1, 'shr(bigint, +bigint)')
+    $I1 = 1
 
-pir_output_is( <<'CODE', <<'OUT', "shr_bigint with a negative shift" );
+# shr_bigint with a negative shift
 ## cf the shl_bigint case.
-.sub main :main
-   $P0 = new ['BigInt']
-   set $P0, 2
-   $P1 = new['BigInt']
-   set $P1, -2
-   $P2 = new ['BigInt']
-   shr $P2, $P0, $P1
-   say $P2
-   set $P0, "100000000000"
-   set $P1, -10
-   shr $P2, $P0, $P1
-   say $P2
-.end
-CODE
-8
-102400000000000
-OUT
-
-pasm_output_is( <<'CODE', <<'OUT', "shr_int" );
-   new P0, ['BigInt']
-   set P0, 4
-   new P1, ['Integer']
-   set P1, 1
-   new P2, ['BigInt']
-   shr P2, P0, P1
-   set S0, P2
-   print S0
-   print "\n"
-   set P0, "200000000000"
-   set P1, 1
-   shr P2, P0, P1
-   set S0, P2
-   print S0
-   print "\n"
-   set P0, "102400000000000"
-   set P1, 10
-   shr P2, P0, P1
-   set S0, P2
-   print S0
-   print "\n"
-   end
-CODE
-2
-100000000000
-100000000000
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "shr_int with a negative shift" );
-## cf the shl_int case.
-.sub main :main
-   $P0 = new ['BigInt']
-   set $P0, 2
-   $P1 = new ['Integer']
-   set $P1, -1
-   $P2 = new ['BigInt']
-   shr $P2, $P0, $P1
-   say $P2
-   set $P0, "100000000000"
-   set $P1, -1
-   shr $P2, $P0, $P1
-   say $P2
-   set $P1, -10
-   shr $P2, $P0, $P1
-   say $P2
-.end
-CODE
-4
-200000000000
-102400000000000
-OUT
+    $P0 = new ['BigInt']
+    $P0 = 2
+    $P1 = new['BigInt']
+    $P1 = -2
+    $P2 = new ['BigInt']
+    $P2 = shr $P0, $P1
+    $S0 = $P2
+    eq $S0, '8', OK5
+    $I1 = 0
+    say 'shr(bigint 2, bigint -2) did not return 8'
+OK5:
+
+    $P0 = '100000000000'
+    $P1 = -10
+    $P2 = shr $P0, $P1
+    $S0 = $P2
+    eq $S0, '102400000000000', OK6
+    $I1 = 0
+    say 'shr(bigint 100000000000, bigint -10) did not return 102400000000000'
+OK6:
+    ok($I1, 'shr(bigint, -bigint)')
+    $I1 = 1
+
+# shr_int
+    $P0 = new ['BigInt']
+    $P0 = 4
+    $P1 = new ['Integer']
+    $P1 = 1
+    $P2 = new ['BigInt']
+    $P2 = shr $P0, $P1
+    $S0 = $P2
+    eq $S0, '2', OK7
+    $I1 = 0
+    say 'shr(bigint 4, integer 1) did not return 2'
+OK7:
+
+    $P0 = '200000000000'
+    $P1 = 1
+    $P2 = shr $P0, $P1
+    $S0 = $P2
+    eq $S0, '100000000000', OK8
+    $I1 = 0
+    say 'shr(bigint 200000000000, integer 1) did not return 100000000000'
+OK8:
+
+    $P0 = '102400000000000'
+    $P1 = 10
+    $P2 = shr $P0, $P1
+    $S0 = $P2
+    eq $S0, '100000000000', OK9
+    $I1 = 0
+    say 'shr(bigint 102400000000000, integer 10) did not return 100000000000'
+OK9:
 
-pir_output_is( <<'CODE', <<'OUT', "BUG #34949 gt" );
-.sub main :main
-    .local pmc b
-    b = new ['BigInt']
-    b = 1e10
-    if b > 4 goto ok
-    print "never\n"
-    end
-ok:
-    print "ok\n"
-.end
-CODE
-ok
-OUT
+    ok($I1,'shr(bigint, +integer)')
+    $I1 = 1
 
-pir_output_is( <<'CODE', <<'OUT', "BUG #34949 ge" );
-.sub main :main
-    .local pmc b
-    b = new ['BigInt']
-    b = 1e10
-    if b >= 4 goto ok
-    print "never\n"
-    end
-ok:
-    print "ok\n"
-.end
-CODE
-ok
-OUT
+# shr_int with a negative shift
+## cf the shl_int case.
 
-pir_output_is( <<'CODE', <<'OUT', "BUG #34949 ne" );
-.sub main :main
-    .local pmc b
-    b = new ['BigInt']
-    b = 1e10
-    if b != 4 goto ok
-    print "never\n"
-    end
-ok:
-    print "ok\n"
-.end
-CODE
-ok
-OUT
+    $P0 = new ['BigInt']
+    $P0 = 2
+    $P1 = new ['Integer']
+    $P1 = -1
+    $P2 = new ['BigInt']
+    $P2 = shr $P0, $P1
+    $S0 = $P2
+    eq $S0, '4', OK10
+    $I1 = 0
+    say 'shr(bigint 2, int -1) did not return 4'
+OK10:
+
+    $P0 = '100000000000'
+    $P1 = -1
+    $P2 = new ['BigInt']
+    $P2 = shr $P0, $P1
+    $S0 = $P2
+    eq $S0, '200000000000', OK11
+    $I1 = 0
+    say 'shr(bigint 100000000000, int -1) did not return 200000000000'
+OK11:
+
+    $P1 = -10
+    $P2 = new ['BigInt']
+    $P2 = shr $P0, $P1
+    $S0 = $P2
+    eq $S0, '102400000000000', OK12
+    $I1 = 0
+    say 'shr(bigint 100000000000,int -10) did not return 102400000000000'
+OK12:
 
-pir_output_is( <<'CODE', <<'OUT', "BUG #34949 eq" );
-.sub main :main
-    .local pmc b
-    b = new ['BigInt']
-    b = 1e10
-    if b == 4 goto nok
-    print "ok\n"
-    end
-nok:
-    print "nok\n"
+    ok($I1,'shr(bigint, -integer)')
 .end
-CODE
-ok
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', "BUG #34949 le" );
-.sub main :main
-    .local pmc b
-    b = new ['BigInt']
-    b = 1e10
-    if b <= 4 goto nok
-    print "ok\n"
-    end
-nok:
-    print "nok\n"
-.end
-CODE
-ok
-OUT
+.sub bugfixes
+
+    $P0 = new ['BigInt']
+    $P0 = 1e10
+    $I1 = 1
+    gt $P0, 4, OK1
+    $I1 = 0
+OK1:
+    ok($I1, 'BUG #34949 gt')
+
+    $P0 = new ['BigInt']
+    $P0 = 1e10
+    $I1 = 1
+    ge $P0, 4, OK2
+    $I1 = 0
+OK2:
+    ok($I1, 'BUG #34949 ge')
+
+    $P0 = new ['BigInt']
+    $P0 = 1e10
+    $I1 = 1
+    ne $P0, 4, OK3
+    $I1 = 0
+OK3:
+    ok($I1, 'BUG #34949 ne')
+
+    $P0 = new ['BigInt']
+    $P0 = 1e10
+    $I1 = 0
+    eq $P0, 4, NOK4
+    $I1 = 1
+NOK4:
+    ok($I1, 'BUG #34949 eq')
+
+    $P0 = new ['BigInt']
+    $P0 = 1e10
+    $I1 = 0
+    lt $P0, 4, NOK5
+    $I1 = 1
+NOK5:
+    ok($I1, 'BUG #34949 le')
+
+    $P0 = new ['BigInt']
+    $P0 = 1e10
+    $I1 = 0
+    lt $P0, 4, NOK6
+    $I1 = 1
+NOK6:
+    ok($I1, 'BUG #34949 lt')
 
-pir_output_is( <<'CODE', <<'OUT', "BUG #34949 lt" );
-.sub main :main
-    .local pmc b
-    b = new ['BigInt']
-    b = 1e10
-    if b < 4 goto nok
-    print "ok\n"
-    end
-nok:
-    print "nok\n"
 .end
-CODE
-ok
-OUT
 
 # Local Variables:
-#   mode: cperl
+#   mode: pir
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 filetype=pir:

Modified: branches/orderedhash_revamp/t/pmc/boolean.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/boolean.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/boolean.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -19,8 +19,10 @@
 
 .sub main :main
     .include 'test_more.pir'
-    plan(28)
+    plan(31)
+    init_null_tests()
     init_int_tests()
+    instantiate_tests()
     num_tests()
     string_tests()
     pmc_to_pmc_tests()
@@ -30,6 +32,13 @@
     interface_check()
 .end
 
+.sub init_null_tests
+    null $P0
+    $P1 = new ['Boolean'], $P0
+    set $I0, $P1
+    is($I0, 0, "init with null pmc gives false")
+.end
+
 .sub init_int_tests
     $P0 = new ['Boolean']
 
@@ -46,6 +55,21 @@
     is($I0, 1, "Boolean converts negative int to true")
 .end
 
+.sub instantiate_tests
+    $P0 = new ['Boolean']
+
+    $P0 = 1
+    $P2 = get_class ['Boolean']
+    $P1 = new $P2, $P0
+    $I0 = $P1
+    is($I0, 1, "Boolean instantiated to true")
+
+    $P0 = 0
+    $P1 = new ['Boolean'], $P0
+    $I0 = $P1
+    is($I0, 0, "Boolean instantiated to false")
+.end
+
 .sub num_tests
 
     $P0 = new ['Boolean']

Added: branches/orderedhash_revamp/t/pmc/callcontext.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/pmc/callcontext.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,303 @@
+#! parrot
+# Copyright (C) 2006-2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/pmc/callcontext.t - test CallContext PMC
+
+=head1 SYNOPSIS
+
+    % prove t/pmc/callcontext.t
+
+=head1 DESCRIPTION
+
+Tests the CallContext PMC.
+
+=cut
+
+.sub 'main' :main
+    .include 'test_more.pir'
+
+    plan(66)
+
+    test_instantiate()
+    test_get_set_attrs()
+    test_push_pop_indexed_access()
+    test_shift_unshift_indexed_access()
+    test_indexed_access()
+    test_indexed_boxing()
+    test_keyed_access()
+    test_exists()
+    test_clone()
+.end
+
+.sub 'test_instantiate'
+    $P0 = new ['CallContext']
+    ok(1, 'Instantiated CallContext')
+.end
+
+.sub 'test_get_set_attrs'
+    $P0 = new ['CallContext']
+    $P5 = new 'String'
+
+    $P5 = 'moonbomb'
+    setattribute $P0, 'return_flags', $P5
+    ok(1, 'set return_flags attribute')
+    getattribute $P1, $P0, 'return_flags'
+    is($P5,'moonbomb', 'got return_flags attribute')
+
+    $P5 = 'cheese'
+    setattribute $P0, 'arg_flags', $P5
+    ok(1, 'set arg_flags attribute')
+    getattribute $P1, $P0, 'arg_flags'
+    is($P5,'cheese', 'got arg_flags attribute')
+.end
+
+.sub 'test_push_pop_indexed_access'
+    $P0 = new [ 'CallContext' ]
+    $P1 = new [ 'Integer' ]
+    $P1 = 100
+
+    push $P0, $P1
+    $I0 = elements $P0
+    is( $I0, 1, 'elements after push' )
+
+    $P2 = $P0[0]
+    is( $P2, 100, 'push_pmc/get_pmc_keyed_int pair' )
+    $P2 = pop $P0
+    is( $P2, 100, 'push_pmc/pop_pmc pair' )
+
+    $I0 = elements $P0
+    is( $I0, 0, 'elements after pop' )
+
+    push $P0, 200
+    $I0 = $P0[0]
+    is( $I0, 200, 'push_integer/get_integer_keyed_int pair' )
+    $I0 = pop $P0
+    is( $I0, 200, 'push_integer/pop_integer pair' )
+
+    push $P0, 3.03
+    $N0 = $P0[0]
+    is( $N0, 3.03, 'push_number/get_number_keyed_int pair' )
+    $N0 = pop $P0
+    is( $N0, 3.03, 'push_number/pop_number pair' )
+
+    push $P0, 'hello'
+    $S0 = $P0[0]
+    is( $S0, 'hello', 'push_string/get_string_keyed_int pair' )
+    $S0 = pop $P0
+    is( $S0, 'hello', 'push_string/pop_string pair' )
+
+    $I0 = elements $P0
+    is( $I0, 0, 'elements after push/pop' )
+.end
+
+.sub 'test_shift_unshift_indexed_access'
+    $P0 = new [ 'CallContext' ]
+    $P1 = new [ 'Integer' ]
+    $P1 = 100
+
+    unshift $P0, $P1
+
+    $I0 = elements $P0
+    is( $I0, 1, 'elements after unshift' )
+
+    $P2 = $P0[0]
+    is( $P2, 100, 'unshift_pmc/get_pmc_keyed_int pair' )
+    $P2 = shift $P0
+    is( $P2, 100, 'unshift_pmc/shift_pmc pair' )
+
+    $I0 = elements $P0
+    is( $I0, 0, 'elements after unshift/shift' )
+
+    unshift $P0, 200
+    $I0 = $P0[0]
+    is( $I0, 200, 'unshift_integer/get_integer_keyed_int pair' )
+    $I0 = shift $P0
+    is( $I0, 200, 'unshift_integer/shift_integer pair' )
+
+    unshift $P0, 3.03
+    $N0 = $P0[0]
+    is( $N0, 3.03, 'unshift_number/get_number_keyed_int pair' )
+    $N0 = shift $P0
+    is( $N0, 3.03, 'unshift_number/shift_number pair' )
+
+    unshift $P0, 'hello'
+    $S0 = $P0[0]
+    is( $S0, 'hello', 'unshift_string/get_string_keyed_int pair' )
+    $S0 = shift $P0
+    is( $S0, 'hello', 'unshift_string/shift_string pair' )
+
+    $I0 = elements $P0
+    is( $I0, 0, 'elements after unshift/shift' )
+.end
+
+.sub 'test_indexed_access'
+    $P0    = new [ 'CallContext' ]
+    $P0[0] = 100
+
+    $I0 = elements $P0
+    is( $I0, 1, 'elements after set_*_indexed' )
+
+    $P0[1] = 1.11
+
+    $I0 = elements $P0
+    is( $I0, 2, 'elements after set_*_indexed' )
+
+    $S0    = '2.22'
+    $P0[2] = $S0
+
+    $I0 = elements $P0
+    is( $I0, 3, 'elements after set_*_indexed' )
+
+    $P1    = new [ 'Float' ]
+    $P1    = 3.33
+    $P0[3] = $P1
+
+    $I0 = elements $P0
+    is( $I0, 4, 'elements after set_*_indexed' )
+
+    $I1    = $P0[0]
+    is( $I1, 100, 'set_integer_keyed_int/get_integer_keyed_int pair' )
+
+    $N1    = $P0[1]
+    is( $N1, 1.11, 'set_number_keyed_int/get_number_keyed_int pair' )
+
+    $S1    = $P0[2]
+    is( $S1, '2.22', 'set_string_keyed_int/get_string_keyed_int pair' )
+
+    $P1    = $P0[3]
+    is( $P1, 3.33, 'set_pmc_keyed_int/get_pmc_keyed_int pair' )
+
+    $I1 = shift $P0
+    is( $I1, 100, 'set_integer_keyed_int/shift_integer pair' )
+
+    $N1 = $P0[0]
+    is( $N1, 1.11, 'shift_* should remove elements from array' )
+
+    $N1 = shift $P0
+    is( $N1, 1.11, 'set_number_keyed_int/shift_number pair' )
+
+    $S1 = $P0[0]
+    is( $S1, '2.22', 'shift_* should remove elements from array' )
+
+    $S1 = shift $P0
+    is( $S1, '2.22', 'set_string_keyed_int/shift_string pair' )
+
+    $P1 = $P0[0]
+    is( $P1, 3.33, 'shift_* should remove elements from array' )
+
+    $P1 = shift $P0
+    is( $P1, 3.33, 'set_pmc_keyed_int/shift_pmc pair' )
+.end
+
+.sub 'test_indexed_boxing'
+    $P0    = new [ 'CallContext' ]
+    $P0[0] = 100
+    $P0[1] = 1.11
+
+    $S0    = '2.22'
+    $P0[2] = $S0
+
+    $P1    = new [ 'Float' ]
+    $P1    = 3.33
+    $P0[3] = $P1
+
+    $I0    = $P0[1]
+    is( $I0, 1, 'indexed float converted to int on get_integer_keyed_int' )
+    $I0    = $P0[2]
+    is( $I0, 2, 'indexed string converted to int on get_integer_keyed_int' )
+    $I0    = $P0[3]
+    is( $I0, 3, 'indexed PMC converted to int on get_integer_keyed_int' )
+
+    $N0    = $P0[0]
+    is( $N0, 100.0, 'indexed integer converted to num on get_number_keyed_int' )
+    $N0    = $P0[2]
+    is( $N0, 2.22,  'indexed string converted to num on get_number_keyed_int' )
+    $N0    = $P0[3]
+    is( $N0, 3.33,  'indexed PMC converted to int num get_number_keyed_int' )
+
+    $S0    = $P0[0]
+    is( $S0, '100',  'indexed int converted to string on get_string_keyed_int' )
+    $S0    = $P0[1]
+    is( $S0, '1.11', 'indexed num converted to string on get_string_keyed_int' )
+    $S0    = $P0[3]
+    is( $S0, '3.33', 'indexed PMC converted to string get_string_keyed_int' )
+
+    $P1    = $P0[0]
+    is( $P1, 100,  'indexed int converted to PMC on get_pmc_keyed_int' )
+    $P1    = $P0[1]
+    is( $P1, 1.11, 'indexed float converted to PMC on get_pmc_keyed_int' )
+    $P1    = $P0[2]
+    is( $P1, 2.22, 'indexed string converted to PMC on get_pmc_keyed_int' )
+.end
+
+.sub 'test_keyed_access'
+    $P0        = new [ 'CallContext' ]
+
+    $P0['foo'] = 100
+    $P0['bar'] = 1.11
+    $P0['baz'] = '2.22'
+    $P1        = new [ 'Float' ]
+    $P1        = 3.33
+
+    $P0['qux'] = $P1
+
+    $I0 = $P0['foo']
+    is( $I0, 100, 'set/get_intval_keyed_str' )
+
+    $N0 = $P0['bar']
+    is( $N0, 1.11, 'set/get_number_keyed_str' )
+
+    $S0 = $P0['baz']
+    is( $S0, '2.22', 'set/get_string_keyed_str' )
+
+    $P2 = $P0['qux']
+    is( $P2, 3.33, 'set/get_pmc_keyed_str' )
+
+    $P1 = getattribute $P0, 'named'
+    $I0 = elements $P1
+    is( $I0, 4, 'elements after set_*_keyed' )
+.end
+
+.sub 'test_exists'
+    $P0        = new [ 'CallContext' ]
+
+    $P0[0]     = 111
+    $P0['foo'] = 100
+
+    $I0 = exists $P0[0]
+    ok( $I0, 'exists_keyed_int' )
+
+    $I0 = exists $P0['foo']
+    ok( $I0, 'exists_keyed_str' )
+
+    $I0 = exists $P0[100]
+    nok( $I0, 'exists_keyed_int -- non-existant' )
+
+    $I0 = exists $P0['bar']
+    nok( $I0, 'exists_keyed_str -- non-existant' )
+.end
+
+.sub 'test_clone'
+    $P0 = new ['CallContext']
+    $P0[0] = 42
+    $P0[1] = "Hello Parrot"
+    $P0['floatval'] = 3.14159
+
+    $P1 = clone $P0
+
+    $I2 = $P1[0]
+    is($I2, 42, 'clone - integer positional cloned')
+    $S2 = $P1[1]
+    is($S2, "Hello Parrot", 'clone - string positional cloned')
+    $N2 = $P1['floatval']
+    is($N2, 3.14159, 'clone - named number cloned')
+.end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Deleted: branches/orderedhash_revamp/t/pmc/callsignature.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/callsignature.t	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,39 +0,0 @@
-#! parrot
-# Copyright (C) 2006-2008, Parrot Foundation.
-# $Id$
-
-=head1 NAME
-
-t/pmc/callsignature.t - test CallSignature PMC
-
-=head1 SYNOPSIS
-
-    % prove t/pmc/callsignature.t
-
-=head1 DESCRIPTION
-
-Tests the CallSignature PMC.
-
-=cut
-
-.sub main :main
-    .include 'test_more.pir'
-
-    plan(1)
-
-    instantiate()
-.end
-
-
-.sub instantiate
-
-    $P0 = new ['CallSignature']
-    ok(1, 'Instantiated CallSignature')
-
-.end
-
-# Local Variables:
-#   mode: pir
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/t/pmc/capture.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/capture.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/capture.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -8,7 +8,7 @@
 
 =head1 SYNOPSIS
 
-    % prove t/pmc/capture.t
+    % parrot t/pmc/capture.t
 
 =head1 DESCRIPTION
 
@@ -226,12 +226,14 @@
     .return ()
 
   test_get_integer_catch:
+    pop_eh
     .local pmc exception
     .local string message
     .get_results (exception)
 
     message = exception['message']
-    like(message, ':s get_integer\(\) not implemented', 'get_integer not implemented')
+    message = substr message, 0, 29
+    is(message, 'get_integer() not implemented', 'get_integer not implemented')
     .return ()
 .end
 
@@ -251,7 +253,8 @@
     .get_results (exception)
 
     message = exception['message']
-    like(message, ':s get_number\(\) not implemented', 'get_number not implemented')
+    message = substr message, 0, 28
+    is(message, 'get_number() not implemented', 'get_number not implemented')
     .return ()
 .end
 

Modified: branches/orderedhash_revamp/t/pmc/class.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/class.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/class.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -565,7 +565,7 @@
 
 
 # L<PDD15/Class PMC API/=item does>
-.sub 'more does' # RT #42974
+.sub 'more does'
     .local pmc attrs
     attrs = new ['Hash']
 

Modified: branches/orderedhash_revamp/t/pmc/codestring.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/codestring.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/codestring.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -9,7 +9,7 @@
 
 =head1 SYNOPSIS
 
-        % prove t/pmc/codestring.t
+    % prove t/pmc/codestring.t
 
 =head1 DESCRIPTION
 
@@ -93,10 +93,12 @@
     code.'emit'('label_%0:', 1234)
     code.'emit'('    say "%,"', 'Hello')
     code.'emit'('    say "%,"', 'Hello', 'World', 'of', 'Parrot')
+    code.'emit'('    say "%%0"')
     is(code, <<'CODE', "code string with % args looks fine")
 label_1234:
     say "Hello"
     say "Hello, World, of, Parrot"
+    say "%0"
 CODE
 .end
 

Modified: branches/orderedhash_revamp/t/pmc/complex.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/complex.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/complex.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -91,19 +91,6 @@
     is( message, .M, .M )
 .endm
 
-.macro fp_eq_ok( J, K, L )
-    set $N10, .J
-    set $N11, .K
-    sub $N12, $N11, $N10
-    abs $N12, $N12
-
-    set $I0, 0
-    gt  $N12, 0.000001, .$FPEQNOK
-    set $I0, 1
-.label $FPEQNOK:
-    ok( $I0, .L )
-.endm
-
 .sub string_parsing
     $P0 = new ['Complex']
     $P1 = new ['String']
@@ -1174,29 +1161,36 @@
 .end
 
 .sub add_using_subclass_of_complex_bug_59630
-    skip( 3, 'add using subclass of Complex - RT #59630' )
-    .return()
-
     $P0 = subclass 'Complex', 'MyComplex'
     addattribute $P0, "re"
     addattribute $P0, "im"
 
-    .local pmc a, b, c
+    .local pmc a, b, c, expected
     ##   a = 1 + 2i
     a = new ['MyComplex']
     a['real'] = 1
     a['imag'] = 2
-    is( a, "1+2i", '' )
+    is( a, "1+2i", 'a created' )
 
     ##   b = 3 + 4i
     b = new ['MyComplex']
     b['real'] = 3
     b['imag'] = 4
-    is( b, "3+4i" , '' )
+    is( b, "3+4i" , 'b created' )
 
     ##   c = a + b
     c = add a, b
-    is( c, "4+6i", '' )
+    expected = new ['MyComplex']
+    expected['real'] = 4
+    expected['imag'] = 6
+    $I0 = c == expected
+    $S1 = c
+    $S0 = concat $S1, ' != '
+    $S1 = expected
+    $S0 = concat $S0, $S1
+    $S0 = concat $S0, ' - subclassing Complex add returns 0+0i - TT #562'
+    $I0 = not $I0    # invert $I0 so todo does not pass
+    todo( $I0, $S0 )
 .end
 
 .namespace ['MyComplex']

Added: branches/orderedhash_revamp/t/pmc/context.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/pmc/context.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,168 @@
+#! parrot
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/pmc/context.t - test CallContext PMC
+
+=head1 SYNOPSIS
+
+    % prove t/pmc/context.t
+
+=head1 DESCRIPTION
+
+Tests the CallContext PMC.
+
+TODO: Implement real tests when CallContext PMC will be migrated to use ATTRibutes.
+
+=cut
+
+.HLL 'FOO'
+
+.sub main :main
+    .include 'test_more.pir'
+
+    plan(19)
+
+    test_new()
+
+    $P0 = get_hll_global ['Foo'], 'load'
+    $P0()
+    $P0 = new ['Foo']
+    $P0.'test_inspect'() # 16 tests
+
+    test_backtrace()     # 3 tests
+.end
+
+.sub 'test_new'
+    $P0 = new ['CallContext']
+    sweep 1
+    ok(1, 'Instantiated .CallContext')
+.end
+
+# Put test_inspect into Namespace, as method, with outer, etc.
+.namespace ['Foo']
+
+.sub 'load'
+    $P0 = newclass 'Foo'
+.end
+
+.sub 'test_inspect' :method :outer('load')
+    .include 'test_more.pir'
+
+    .local pmc ctx
+
+    # We need LexPad
+    .lex 'foo_ctx', ctx
+
+    $P0 = getinterp
+    ctx = $P0['context']
+    $I0 = defined ctx
+    ok($I0, "Got CallContext")
+
+    # Check current_sub first. Other tests relying on it
+    $P0 = getattribute ctx, 'current_sub'
+    is($P0, 'test_inspect', 'Got CallContext.current_sub')
+
+    $P0 = getattribute ctx, 'caller_ctx'
+    $I0 = isa $P0, 'CallContext'
+    ok($I0, 'Got CallContext.caller_ctx')
+    $P0 = getattribute $P0, 'current_sub'
+    is($P0, 'main', '... from proper Sub')
+
+    $P0 = getattribute ctx, 'outer_ctx'
+    $I0 = isa $P0, 'CallContext'
+    ok($I0, 'Got CallContext.outer_ctx')
+    $P0 = getattribute $P0, 'current_sub'
+    is($P0, 'load', '... from proper Sub')
+
+    $P0 = getattribute ctx, 'lex_pad'
+    $I0 = isa $P0, 'LexPad'
+    ok($I0, 'Got CallContext.lex_pad')
+    $P1 = $P0['foo_ctx']
+    $I0 = defined $P1
+    ok($I0, '... with proper content')
+
+    $P0 = getattribute ctx, 'current_cont'
+    $I0 = isa $P0, 'Continuation'
+    ok($I0, 'Got CallContext.current_cont')
+
+    $P0 = getattribute ctx, 'current_object'
+    $I0 = isa $P0, 'Foo'
+    ok($I0, 'Got CallContext.current_object')
+
+    $P0 = getattribute ctx, 'current_namespace'
+    ok($P0, 'Got CallContext.current_namespace')
+    $P1 = $P0['test_inspect']
+    is($P1, 'test_inspect', '... with proper content')
+
+    # Checking handlers
+    push_eh done
+    $P0 = getattribute ctx, 'handlers'
+    $I0 = elements $P0
+
+    push_eh caught
+    # Now we should have one more handler
+    $P0 = getattribute ctx, 'handlers'
+    $I1 = elements $P0
+    dec $I1
+    is($I0, $I1, 'Got CallContext.handlers')
+
+    # Check absurd fields
+    $I0 = 1
+    $P0 = getattribute ctx, 'world_domination'
+    $I0 = 0
+  caught:
+    pop_eh
+    ok($I0, "No world domination in this CallContext")
+
+    # Current HLL shouldn't be zero
+    $P0 = getattribute ctx, 'current_HLL'
+    $I0 = $P0
+    ok($I0, 'Got CallContext.current_HLL')
+
+    $P0 = getattribute ctx, 'current_hll'
+    ok($P0, 'FOO', 'Got CallContext.current_hll')
+
+  done:
+    pop_eh
+
+.end
+
+.namespace []
+
+.sub 'test_backtrace'
+    .local pmc bt
+    bt = 'test_bt1'()
+    $I0 = defined bt
+    ok($I0, "Got CallContext.backtrace()")
+
+    # We should have more than 3 elements
+    $I0 = elements bt
+    $I1 = $I0 > 3
+    ok($I1, "... got enough elements")
+
+    # First one should be "test_bt2"
+    $P1 = shift bt
+    $P2 = $P1['sub']
+    is($P2, 'test_bt2', "... with correct first element")
+.end
+
+.sub 'test_bt1'
+    $P0 = 'test_bt2'()
+    .return ($P0)
+.end
+
+.sub 'test_bt2'
+    $P0 = getinterp
+    $P1 = $P0['context']
+    $P2 = $P1.'backtrace'()
+    .return ($P2)
+.end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/t/pmc/coroutine.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/coroutine.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/coroutine.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -14,7 +14,7 @@
 
 =head1 SYNOPSIS
 
-    % prove t/pmc/coroutines.t
+    % prove t/pmc/coroutine.t
 
 =head1 DESCRIPTION
 
@@ -308,7 +308,7 @@
 CODE
 
 pir_output_like(
-    <<'CODE', <<'OUTPUT', "Call an exited coroutine", todo => 'goes one iteration too far.' );
+    <<'CODE', <<'OUTPUT', "Call an exited coroutine", todo => 'goes one iteration too far TT #1003' );
 .sub main :main
     .local pmc c
     c = get_global "coro"

Modified: branches/orderedhash_revamp/t/pmc/default.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/default.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/default.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,13 +1,7 @@
-#!perl
-# Copyright (C) 2006-2007, Parrot Foundation.
+#!parrot
+# Copyright (C) 2006-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 2;
-
 =head1 NAME
 
 t/pmc/default.t - test default PMC
@@ -23,17 +17,20 @@
 
 =cut
 
-pir_output_is( <<'CODE', <<'OUT', 'new', todo => 'not implemeted' );
-.sub 'test' :main
-    new P0, ['default']
-    print "ok 1\n"
+.sub main :main
+    .include 'test_more.pir'
+
+    plan(3)
+    test_default()
+    test_inspect_vtable_function()
 .end
-CODE
-ok 1
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', 'inspect vtable function');
-.sub 'test' :main
+.sub test_default
+    #new $P0, ['default']
+    todo(0,'the default PMC does not exist')
+.end
+
+.sub test_inspect_vtable_function
     $P0 = new ['String']
     $P1 = inspect $P0, 'flags'
     $I9 = 1 << 9   # PObj_is_PMC_FLAG
@@ -41,22 +38,11 @@
 
     $I0 = $P1
     $I1 = $I0 & $I9
-
-    if $I1 goto ok_1
-      print "not "
-    ok_1:
-    print "ok 1\n"
+    ok($I1)
 
     $I1 = $I0 & $I29
-    unless $I1 goto ok_2
-      print "not "
-    ok_2:
-    print "ok 2\n"
+    nok($I1)
 .end
-CODE
-ok 1
-ok 2
-OUT
 
 # Local Variables:
 #   mode: cperl

Modified: branches/orderedhash_revamp/t/pmc/env.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/env.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/env.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -176,7 +176,6 @@
     delete env['PARROT_TMP_ADD_3']
 .end
 
-## RT #50186 - shouldn't segfault
 .sub oob_query
     $P0 = new ['Env']
     set $S0, $P0[999]

Modified: branches/orderedhash_revamp/t/pmc/eval.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/eval.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/eval.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 #! perl
-# Copyright (C) 2001-2008, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
 use strict;
@@ -316,9 +316,9 @@
 2 1 1 1
 OUTPUT
 
-(my $fh, $temp_pbc)  = create_tempfile( SUFFIX => '.pbc', UNLINK => 1 ); 
+(my $fh, $temp_pbc)  = create_tempfile( SUFFIX => '.pbc', UNLINK => 1 );
 close $fh;
-        
+
 pir_output_is( <<"CODE", <<'OUTPUT', "eval.get_string - same file" );
 .sub main :main
   .local pmc f1, f2
@@ -499,7 +499,7 @@
 bar
 OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', "catch compile err: RT:#39892" );
+pir_output_is( <<'CODE', <<'OUTPUT', "catch compile err" );
 .sub main :main
      push_eh handler
      $P2 = compreg "PIR"

Added: branches/orderedhash_revamp/t/pmc/exception-old.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/pmc/exception-old.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,726 @@
+#! perl
+# Copyright (C) 2001-2008, Parrot Foundation.
+# $Id$
+
+use strict;
+use warnings;
+use lib qw( . lib ../lib ../../lib );
+use Test::More;
+use Parrot::Test tests => 28;
+
+=head1 NAME
+
+t/pmc/exception.t - Exception Handling
+
+=head1 SYNOPSIS
+
+    % prove t/pmc/exception-old.t
+
+=head1 DESCRIPTION
+
+Tests C<Exception> and C<ExceptionHandler> PMCs.
+
+=cut
+
+
+pasm_output_is( <<'CODE', <<'OUTPUT', "get_results" );
+    print "main\n"
+    push_eh handler
+    new P1, ['Exception']
+    new P2, ['String']
+    set P2, "just pining"
+    setattribute P1, 'message', P2
+    throw P1
+    print "not reached\n"
+    end
+handler:
+    get_results "0", P0
+    set S0, P0
+    print "caught it\n"
+    typeof S1, P0
+    print S1
+    print "\n"
+    print S0
+    print "\n"
+    null P5
+    end
+
+CODE
+main
+caught it
+Exception
+just pining
+OUTPUT
+
+pasm_output_is( <<'CODE', <<'OUTPUT', "exception attributes" );
+    print "main\n"
+    push_eh handler
+    new P1, ['Exception']
+    new P2, ['String']
+    set P2, "just pining"
+    setattribute P1, 'message', P2
+    new P3, ['Integer']
+    set P3, 5
+    setattribute P1, 'severity', P3
+    new P4, ['String']
+    set P4, "additional payload"
+    setattribute P1, 'payload', P4
+    new P5, ['Array']
+    set P5, 2
+    set P5[0], 'backtrace line 1'
+    set P5[1], 'backtrace line 2'
+    setattribute P1, 'backtrace', P5
+
+    throw P1
+    print "not reached\n"
+    end
+handler:
+    get_results "0", P0
+    set S0, P0
+    print "caught it\n"
+    getattribute P16, P0, 'message'
+    print P16
+    print "\n"
+    getattribute P17, P0, 'severity'
+    print P17
+    print "\n"
+    getattribute P18, P0, 'payload'
+    print P18
+    print "\n"
+    getattribute P19, P0, 'backtrace'
+    set P20, P19[0]
+    print P20
+    print "\n"
+    set P20, P19[1]
+    print P20
+    print "\n"
+    null P5
+    end
+
+CODE
+main
+caught it
+just pining
+5
+additional payload
+backtrace line 1
+backtrace line 2
+OUTPUT
+
+pir_output_is( <<'CODE', <<'OUTPUT', 'Exception initialized with String' );
+.sub main :main
+  .local pmc ex, exr
+  .local pmc msg, msgr
+  msg = new ['String']
+  msg = 'Message'
+  ex = new ['Exception'], msg
+  push_eh handler
+  throw ex
+  say 'Never here'
+handler:
+  .get_results(exr)
+  msgr = exr['message']
+  say msgr
+.end
+CODE
+Message
+OUTPUT
+
+pir_output_is( <<'CODE', <<'OUTPUT', 'Exception initialized with Hash' );
+.sub main :main
+  .local pmc ex, exr
+  .local pmc h, msgr
+  h = new ['Hash']
+  h['message'] = 'Message'
+  ex = new ['Exception'], h
+  push_eh handler
+  throw ex
+  say 'Never here'
+handler:
+  .get_results(exr)
+  msgr = exr['message']
+  say msgr
+.end
+CODE
+Message
+OUTPUT
+
+pasm_output_is( <<'CODE', <<'OUTPUT', "get_results - be sure registers are ok" );
+# see also #38459
+    print "main\n"
+    new P0, ['Integer']
+    push_eh handler
+    new P1, ['Exception']
+    new P2, ['String']
+    set P2, "just pining"
+    setattribute P1, 'message', P2
+    throw P1
+    print "not reached\n"
+    end
+handler:
+    get_results "0", P1
+    inc P0
+    print "ok\n"
+    end
+
+CODE
+main
+ok
+OUTPUT
+
+pir_output_is( <<'CODE', <<'OUTPUT', ".get_results() - PIR" );
+.sub main :main
+    print "main\n"
+    push_eh _handler
+    $P1 = new ['Exception']
+    $P2 = new ['String']
+    set $P2, "just pining"
+    setattribute $P1, 'message', $P2
+    throw $P1
+    print "not reached\n"
+    end
+_handler:
+    .local pmc e
+    .local string s
+    .get_results (e)
+    s = e
+    print "caught it\n"
+    typeof $S1, e
+    print $S1
+    print "\n"
+    print s
+    print "\n"
+    null $P5
+.end
+CODE
+main
+caught it
+Exception
+just pining
+OUTPUT
+
+pasm_output_is( <<'CODE', <<'OUTPUT', "push_eh - throw - message" );
+    print "main\n"
+    push_eh _handler
+
+    new P30, ['Exception']
+    new P20, ['String']
+    set P20, "something happened"
+    setattribute P30, "message", P20
+    throw P30
+    print "not reached\n"
+    end
+_handler:
+    get_results "0", P5
+    set S0, P5
+    print "caught it\n"
+    print S0
+    print "\n"
+    end
+CODE
+main
+caught it
+something happened
+OUTPUT
+
+pasm_error_output_like( <<'CODE', <<'OUTPUT', "throw - no handler" );
+    new P0, ['Exception']
+    new P20, ['String']
+    set P20, "something happened"
+    setattribute P0, "message", P20
+    throw P0
+    print "not reached\n"
+    end
+CODE
+/something happened/
+OUTPUT
+
+pasm_error_output_like( <<'CODE', <<'OUTPUT', "throw - no handler, no message" );
+    push_eh _handler
+    new P0, ['Exception']
+    pop_eh
+    throw P0
+    print "not reached\n"
+    end
+_handler:
+    end
+CODE
+/No exception handler and no message/
+OUTPUT
+
+pasm_error_output_like( <<'CODE', <<'OUTPUT', "throw - no handler, no message" );
+    new P0, ['Exception']
+    throw P0
+    print "not reached\n"
+    end
+CODE
+/No exception handler and no message/
+OUTPUT
+
+pasm_output_is( <<'CODE', <<'OUTPUT', "2 exception handlers" );
+    print "main\n"
+    push_eh _handler1
+    push_eh _handler2
+
+    new P30, ['Exception']
+    new P20, ['String']
+    set P20, "something happened"
+    setattribute P30, "message", P20
+    throw P30
+    print "not reached\n"
+    end
+_handler1:
+    get_results "0", P5
+    getattribute P2, P5, "message"
+    print "caught it in 1\n"
+    print P2
+    print "\n"
+    end
+_handler2:
+    get_results "0", P0
+    getattribute P2, P0, "message"
+    print "caught it in 2\n"
+    print P2
+    print "\n"
+    end
+CODE
+main
+caught it in 2
+something happened
+OUTPUT
+
+pasm_output_is( <<'CODE', <<'OUTPUT', "2 exception handlers, throw next" );
+    print "main\n"
+    push_eh _handler1
+    push_eh _handler2
+
+    new P30, ['Exception']
+    new P20, ['String']
+    set P20, "something happened"
+    setattribute P30, "message", P20
+    throw P30
+    print "not reached\n"
+    end
+_handler1:
+    get_results "0", P5
+    set S0, P5
+    print "caught it in 1\n"
+    print S0
+    print "\n"
+    end
+_handler2:
+    get_results "0", P5
+    set S0, P5
+    print "caught it in 2\n"
+    print S0
+    print "\n"
+    rethrow P5
+    end
+CODE
+main
+caught it in 2
+something happened
+caught it in 1
+something happened
+OUTPUT
+
+
+pasm_output_is( <<'CODE', <<OUT, "die, error, severity" );
+    push_eh _handler
+    die 3, 100
+    print "not reached\n"
+    end
+_handler:
+    get_results "0", P5
+    set S0, P5
+    print "caught it\n"
+    set I0, P5['severity']
+    print "severity "
+    print I0
+    print "\n"
+    end
+CODE
+caught it
+severity 3
+OUT
+
+pasm_error_output_like( <<'CODE', <<OUT, "die - no handler" );
+    die 3, 100
+    print "not reached\n"
+    end
+_handler:
+    print "caught it\n"
+    end
+CODE
+/No exception handler and no message/
+OUT
+
+pasm_output_is( <<'CODE', '', "exit exception" );
+    noop
+    exit 0
+    print "not reached\n"
+    end
+CODE
+
+pasm_output_is( <<'CODE', <<'OUTPUT', "push_eh - throw" );
+    print "main\n"
+    push_eh handler
+    print "ok\n"
+    new P30, ['Exception']
+    throw P30
+    print "not reached\n"
+    end
+handler:
+    print "caught it\n"
+    end
+CODE
+main
+ok
+caught it
+OUTPUT
+1;
+
+pasm_output_is( <<'CODE', <<'OUTPUT', "pushmark" );
+    pushmark 10
+    print "ok 1\n"
+    popmark 10
+    print "ok 2\n"
+    end
+CODE
+ok 1
+ok 2
+OUTPUT
+
+pasm_output_is( <<'CODE', <<'OUTPUT', "pushmark nested" );
+    pushmark 10
+    pushmark 11
+    print "ok 1\n"
+    popmark 11
+    popmark 10
+    print "ok 2\n"
+    end
+CODE
+ok 1
+ok 2
+OUTPUT
+
+pasm_error_output_like( <<'CODE', <<'OUTPUT', "pushmark - pop wrong one" );
+    pushmark 10
+    print "ok 1\n"
+    popmark 500
+    print "never\n"
+    end
+CODE
+/Mark 500 not found/
+OUTPUT
+
+# stringification is handled by a vtable method, which runs in a second
+# runloop. when an error in the method tries to go to a Error_Handler defined
+# outside it, it winds up going to the inner runloop, giving strange results.
+pir_output_is( <<'CODE', <<'OUTPUT', 'pop_eh out of context (2)', todo => 'runloop shenanigans' );
+.sub main :main
+        $P0 = get_hll_global ['Foo'], 'load'
+        $P0()
+        $P0 = new ['Foo']
+        push_eh catch
+        $S0 = $P0
+        pop_eh
+        say "huh?"
+        .return()
+
+catch:
+        say "caught"
+        .return()
+.end
+
+.namespace ['Foo']
+
+.sub load
+    $P0 = newclass 'Foo'
+.end
+
+.sub get_string :vtable :method
+    $P0 = new ['Exception']
+    throw $P0
+.end
+CODE
+caught
+OUTPUT
+
+pir_error_output_like( <<'CODE', <<'OUTPUT', "pushaction - throw in main" );
+.sub main :main
+    print "main\n"
+    .const 'Sub' at_exit = "exit_handler"
+    pushaction at_exit
+    $P0 = new ['Exception']
+    throw $P0
+    .return()
+.end
+
+.sub exit_handler
+    .param int flag
+    print "at_exit, flag = "
+    say flag
+.end
+CODE
+/^main
+No exception handler/
+OUTPUT
+
+# exception handlers are still run in an inferior runloop, which messes up
+# nonlocal exit from within handlers.
+pir_output_like(
+    <<'CODE', <<'OUTPUT', "pushaction: error while handling error", todo => 'runloop shenanigans' );
+.sub main :main
+    push_eh h
+    print "main\n"
+    .const 'Sub' at_exit = "exit_handler"
+    pushaction at_exit
+    $P1 = new ['Exception']
+    throw $P1
+    print "never 1\n"
+h:
+    ## this is never actually reached, because exit_handler throws an unhandled
+    ## exception before the handler is entered.
+    print "in outer handler\n"
+.end
+
+.sub exit_handler :outer(main)
+    .param int flag
+    print "at_exit, flag = "
+    say flag
+    $P2 = new ['Exception']
+    throw $P2
+    print "never 2\n"
+.end
+CODE
+/^main
+at_exit, flag = 1
+No exception handler/
+OUTPUT
+
+$ENV{TEST_PROG_ARGS} ||= '';
+my @todo = $ENV{TEST_PROG_ARGS} =~ /--run-pbc/
+    ? ( todo => '.tailcall and lexical maps not thawed from PBC, TT #1172' )
+    : ();
+pir_output_is( <<'CODE', <<'OUTPUT', "exit_handler via exit exception", @todo );
+.sub main :main
+    .local pmc a
+    .lex 'a', a
+    a = new ['Integer']
+    a = 42
+    push_eh handler
+    exit 0
+handler:
+    .tailcall exit_handler()
+.end
+
+.sub exit_handler :outer(main)
+    say "at_exit"
+    .local pmc a
+    a = find_lex 'a'
+    print 'a = '
+    say a
+.end
+CODE
+at_exit
+a = 42
+OUTPUT
+
+## Regression test for r14697.  This probably won't be needed when PDD23 is
+## fully implemented.
+pir_error_output_like( <<'CODE', <<'OUTPUT', "invoke handler in calling sub", todo => "deprecate rethrow" );
+## This tests that error handlers are out of scope when invoked (necessary for
+## rethrow) when the error is signalled in another sub.
+.sub main :main
+    push_eh handler
+    broken()
+    print "not reached.\n"
+handler:
+    .local pmc exception
+    .get_results (exception)
+    $S0 = exception
+    print "in handler.\n"
+    print $S0
+    print "\n"
+    #rethrow exception
+.end
+
+.sub broken
+    $P0 = new ['Exception']
+    new $P2, ['String']
+    set $P2, "something broke"
+    setattribute $P0, "message", $P2
+    throw $P0
+.end
+CODE
+/\Ain handler.
+something broke
+something broke
+current inst/
+OUTPUT
+
+pir_output_is(<<'CODE', <<'OUTPUT', "taking a continuation promotes RetCs");
+## This test creates a continuation in a inner sub and re-invokes it later.  The
+## re-invocation signals an error, which is caught by an intermediate sub.
+## Returning from the "test" sub the second time failed in r28794; invoking
+## parrot with "-D80" shows clearly that the "test" context was being recycled
+## prematurely.  For some reason, it is necessary to signal the error in order
+## to expose the bug.
+.sub main :main
+    .local int redux
+    .local pmc cont
+    ## debug 0x80
+    redux = 0
+    print "calling test\n"
+    cont = test()
+    print "back from test\n"
+    if redux goto done
+    redux = 1
+    print "calling cont\n"
+    cont()
+    print "never.\n"
+done:
+    print "done.\n"
+.end
+.sub test
+    ## Push a handler around the foo() call.
+    push_eh handle_errs
+    print "  calling foo\n"
+    .local pmc cont
+    cont = foo()
+    print "  returning from test.\n"
+    .return (cont)
+handle_errs:
+    pop_eh
+    print "  test:  caught error\n"
+    .return (cont)
+.end
+.sub foo
+    ## Take a continuation.
+    .local pmc cont
+    cont = new ['Continuation']
+    set_addr cont, over_there
+    print "    returning from foo\n"
+    .return (cont)
+over_there:
+    print "    got over there.\n"
+    .local pmc ex
+    ex = new ['Exception']
+    throw ex
+.end
+CODE
+calling test
+  calling foo
+    returning from foo
+  returning from test.
+back from test
+calling cont
+    got over there.
+  test:  caught error
+back from test
+done.
+OUTPUT
+
+pir_error_output_like( <<'CODE', <<'OUTPUT', "throw - no handler" );
+.sub main :main
+    push_eh try
+    failure()
+    pop_eh
+    exit 0
+  try:
+    .get_results($P0)
+    pop_eh
+    $S1 = $P0['backtrace']
+    $S1 .= "\n"
+    say $S1
+.end
+
+.sub failure
+    die 'what'
+.end
+CODE
+/No such string attribute/
+OUTPUT
+
+pir_output_is( <<'CODE', <<'OUTPUT', "catch ex from C-level MULTI function" );
+.sub main :main
+
+.local pmc p, q
+
+    p = new ['Integer']
+    set p, "0"
+
+    push_eh handler
+    #throw an exception from a C-level MULTI function
+    q = p / p
+    goto end
+    pop_eh
+    goto end
+
+handler:
+    .local pmc exception
+    .local string message
+    .get_results (exception)
+
+    message = exception['message']
+    say_something(message)
+end:
+.end
+
+.sub say_something
+    .param string message
+    #Calling this sub is enough to trigger the bug.  If execution reached this
+    #point, the bug is fixed.
+    say "no segfault"
+end:
+.end
+CODE
+no segfault
+OUTPUT
+
+pir_output_is( <<'CODE', <<'OUTPUT', "count_eh" );
+.sub main :main
+    $I0 = count_eh
+    if $I0 == 0 goto right_number1
+        print "not "
+    right_number1:
+    print "ok 1\n"
+    push_eh _handler1
+    push_eh _handler2
+    print "ok 2\n"
+    $I1 = count_eh
+    if $I1 == 2 goto right_number2
+        print "not "
+    right_number2:
+    print "ok 3\n"
+    pop_eh
+    pop_eh
+    print "ok 4\n"
+    $I2 = count_eh
+    if $I2 == 0 goto right_number3
+        print "not "
+    right_number3:
+    print "ok 5\n"
+    end
+_handler1:
+    print "first handler\n"
+    end
+_handler2:
+    print "second handler\n"
+    end
+.end
+CODE
+ok 1
+ok 2
+ok 3
+ok 4
+ok 5
+OUTPUT
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/t/pmc/exception.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/exception.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/exception.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,13 +1,7 @@
-#! perl
-# Copyright (C) 2001-2008, Parrot Foundation.
+#! parrot
+# Copyright (C) 2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 31;
-
 =head1 NAME
 
 t/pmc/exception.t - Exception Handling
@@ -22,740 +16,122 @@
 
 =cut
 
-pasm_output_is( <<'CODE', <<'OUTPUT', "push_eh - pop_eh" );
-    push_eh _handler
-    print "ok 1\n"
-    pop_eh
-    print "ok 2\n"
-    end
-_handler:
-    end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', "push_eh - pop_eh, PMC exception handler" );
 .sub main :main
-    $P0 = new ['ExceptionHandler']
-    set_addr $P0, _handler
-    push_eh $P0
-    print "ok 1\n"
-    pop_eh
-    print "ok 2\n"
-    end
+    .include 'test_more.pir'
+    plan( 14 )
+    test_bool()
+    test_int()
+    test_attrs()
+    test_push_pop_eh()
+    test_push_pop_eh_long()
+    test_push_eh_throw()
+    test_die()
+    test_throw_obj()
+.end
+
+.sub test_throw_obj
+    new $P20, ['ExceptionHandler']
+    set_addr $P20, _handler
+    push_eh $P20
+    new $P30, ['Exception']
+    throw $P30
+    say "not reached"
 _handler:
-    print "caught it\n"
-    end
+    ok(1,'caught exception object thrown')
 .end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "push_eh - throw" );
-    print "main\n"
-    push_eh _handler
-    new P30, ['Exception']
-    throw P30
-    print "not reached\n"
-    end
-_handler:
-    print "caught it\n"
-    end
-CODE
-main
-caught it
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "push_eh - throw, PMC exception handler" );
-    print "main\n"
-    new P20, ['ExceptionHandler']
-    set_addr P20, _handler
-    push_eh P20
-    new P30, ['Exception']
-    throw P30
-    print "not reached\n"
-    end
-_handler:
-    print "caught it\n"
-    end
-CODE
-main
-caught it
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "get_results" );
-    print "main\n"
-    push_eh handler
-    new P1, ['Exception']
-    new P2, ['String']
-    set P2, "just pining"
-    setattribute P1, 'message', P2
-    throw P1
-    print "not reached\n"
-    end
-handler:
-    get_results "0", P0
-    set S0, P0
-    print "caught it\n"
-    typeof S1, P0
-    print S1
-    print "\n"
-    print S0
-    print "\n"
-    null P5
-    end
-
-CODE
-main
-caught it
-Exception
-just pining
-OUTPUT
 
-pasm_output_is( <<'CODE', <<'OUTPUT', "exception attributes" );
-    print "main\n"
-    push_eh handler
-    new P1, ['Exception']
-    new P2, ['String']
-    set P2, "just pining"
-    setattribute P1, 'message', P2
-    new P3, ['Integer']
-    set P3, 5
-    setattribute P1, 'severity', P3
-    new P4, ['String']
-    set P4, "additional payload"
-    setattribute P1, 'payload', P4
-    new P5, ['Array']
-    set P5, 2
-    set P5[0], 'backtrace line 1'
-    set P5[1], 'backtrace line 2'
-    setattribute P1, 'backtrace', P5
-
-    throw P1
-    print "not reached\n"
-    end
-handler:
-    get_results "0", P0
-    set S0, P0
-    print "caught it\n"
-    getattribute P16, P0, 'message'
-    print P16
-    print "\n"
-    getattribute P17, P0, 'severity'
-    print P17
-    print "\n"
-    getattribute P18, P0, 'payload'
-    print P18
-    print "\n"
-    getattribute P19, P0, 'backtrace'
-    set P20, P19[0]
-    print P20
-    print "\n"
-    set P20, P19[1]
-    print P20
-    print "\n"
-    null P5
-    end
-
-CODE
-main
-caught it
-just pining
-5
-additional payload
-backtrace line 1
-backtrace line 2
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "get_results - be sure registers are ok" );
-# see also #38459
-    print "main\n"
-    new P0, ['Integer']
+.sub test_die
     push_eh handler
-    new P1, ['Exception']
-    new P2, ['String']
-    set P2, "just pining"
-    setattribute P1, 'message', P2
-    throw P1
-    print "not reached\n"
-    end
-handler:
-    get_results "0", P1
-    inc P0
-    print "ok\n"
-    end
-
-CODE
-main
-ok
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', ".get_results() - PIR" );
-.sub main :main
-    print "main\n"
-    push_eh _handler
-    $P1 = new ['Exception']
-    $P2 = new ['String']
-    set $P2, "just pining"
-    setattribute $P1, 'message', $P2
-    throw $P1
-    print "not reached\n"
-    end
-_handler:
-    .local pmc e
-    .local string s
-    .get_results (e)
-    s = e
-    print "caught it\n"
-    typeof $S1, e
-    print $S1
-    print "\n"
-    print s
-    print "\n"
-    null $P5
-.end
-CODE
-main
-caught it
-Exception
-just pining
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "push_eh - throw - message" );
-    print "main\n"
-    push_eh _handler
-
-    new P30, ['Exception']
-    new P20, ['String']
-    set P20, "something happened"
-    setattribute P30, "message", P20
-    throw P30
-    print "not reached\n"
-    end
-_handler:
-    get_results "0", P5
-    set S0, P5
-    print "caught it\n"
-    print S0
-    print "\n"
-    end
-CODE
-main
-caught it
-something happened
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', "throw - no handler" );
-    new P0, ['Exception']
-    new P20, ['String']
-    set P20, "something happened"
-    setattribute P0, "message", P20
-    throw P0
-    print "not reached\n"
-    end
-CODE
-/something happened/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', "throw - no handler, no message" );
-    push_eh _handler
-    new P0, ['Exception']
-    pop_eh
-    throw P0
-    print "not reached\n"
-    end
-_handler:
-    end
-CODE
-/No exception handler and no message/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', "throw - no handler, no message" );
-    new P0, ['Exception']
-    throw P0
-    print "not reached\n"
-    end
-CODE
-/No exception handler and no message/
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "2 exception handlers" );
-    print "main\n"
-    push_eh _handler1
-    push_eh _handler2
-
-    new P30, ['Exception']
-    new P20, ['String']
-    set P20, "something happened"
-    setattribute P30, "message", P20
-    throw P30
-    print "not reached\n"
-    end
-_handler1:
-    get_results "0", P5
-    getattribute P2, P5, "message"
-    print "caught it in 1\n"
-    print P2
-    print "\n"
-    end
-_handler2:
-    get_results "0", P0
-    getattribute P2, P0, "message"
-    print "caught it in 2\n"
-    print P2
-    print "\n"
-    end
-CODE
-main
-caught it in 2
-something happened
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "2 exception handlers, throw next" );
-    print "main\n"
-    push_eh _handler1
-    push_eh _handler2
-
-    new P30, ['Exception']
-    new P20, ['String']
-    set P20, "something happened"
-    setattribute P30, "message", P20
-    throw P30
-    print "not reached\n"
-    end
-_handler1:
-    get_results "0", P5
-    set S0, P5
-    print "caught it in 1\n"
-    print S0
-    print "\n"
-    end
-_handler2:
-    get_results "0", P5
-    set S0, P5
-    print "caught it in 2\n"
-    print S0
-    print "\n"
-    rethrow P5
-    end
-CODE
-main
-caught it in 2
-something happened
-caught it in 1
-something happened
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUT, "die" );
-    push_eh _handler
     die 3, 100
-    print "not reached\n"
-    end
-_handler:
-    print "caught it\n"
-    end
-CODE
-caught it
-OUT
-
-pasm_output_is( <<'CODE', <<OUT, "die, error, severity" );
-    push_eh _handler
-    die 3, 100
-    print "not reached\n"
-    end
-_handler:
-    get_results "0", P5
-    set S0, P5
-    print "caught it\n"
-    set I0, P5['severity']
-    print "severity "
-    print I0
-    print "\n"
-    end
-CODE
-caught it
-severity 3
-OUT
-
-pasm_error_output_like( <<'CODE', <<OUT, "die - no handler" );
-    die 3, 100
-    print "not reached\n"
-    end
-_handler:
-    print "caught it\n"
-    end
-CODE
-/No exception handler and no message/
-OUT
-
-pasm_output_is( <<'CODE', '', "exit exception" );
-    noop
-    exit 0
-    print "not reached\n"
-    end
-CODE
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "push_eh - throw" );
-    print "main\n"
-    push_eh handler
-    print "ok\n"
-    new P30, ['Exception']
-    throw P30
-    print "not reached\n"
-    end
+    say "not reached"
+    .return()
 handler:
-    print "caught it\n"
-    end
-CODE
-main
-ok
-caught it
-OUTPUT
-1;
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "pushmark" );
-    pushmark 10
-    print "ok 1\n"
-    popmark 10
-    print "ok 2\n"
-    end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "pushmark nested" );
-    pushmark 10
-    pushmark 11
-    print "ok 1\n"
-    popmark 11
-    popmark 10
-    print "ok 2\n"
-    end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', "pushmark - pop wrong one" );
-    pushmark 10
-    print "ok 1\n"
-    popmark 500
-    print "never\n"
-    end
-CODE
-/Mark 500 not found/
-OUTPUT
-
-# stringification is handled by a vtable method, which runs in a second
-# runloop. when an error in the method tries to go to a Error_Handler defined
-# outside it, it winds up going to the inner runloop, giving strange results.
-pir_output_is( <<'CODE', <<'OUTPUT', 'pop_eh out of context (2)', todo => 'runloop shenanigans' );
-.sub main :main
-        $P0 = get_hll_global ['Foo'], 'load'
-        $P0()
-        $P0 = new ['Foo']
-        push_eh catch
-        $S0 = $P0
-        pop_eh
-        say "huh?"
-        .return()
-
-catch:
-        say "caught"
-        .return()
-.end
-
-.namespace ['Foo']
-
-.sub load
-    $P0 = newclass 'Foo'
+    ok(1,'die works')
 .end
 
-.sub get_string :vtable :method
-    $P0 = new ['Exception']
-    throw $P0
-.end
-CODE
-caught
-OUTPUT
+.sub test_push_pop_eh
+    push_eh handler
+    ok(1,'push_eh works')
 
-pir_error_output_like( <<'CODE', <<'OUTPUT', "pushaction - throw in main" );
-.sub main :main
-    print "main\n"
-    .const 'Sub' at_exit = "exit_handler"
-    pushaction at_exit
-    $P0 = new ['Exception']
-    throw $P0
+    pop_eh
+    ok(1,'pop_eh works')
     .return()
-.end
 
-.sub exit_handler
-    .param int flag
-    print "at_exit, flag = "
-    say flag
-.end
-CODE
-/^main
-No exception handler/
-OUTPUT
-
-# exception handlers are still run in an inferior runloop, which messes up
-# nonlocal exit from within handlers.
-pir_output_like(
-    <<'CODE', <<'OUTPUT', "pushaction: error while handling error", todo => 'runloop shenanigans' );
-.sub main :main
-    push_eh h
-    print "main\n"
-    .const 'Sub' at_exit = "exit_handler"
-    pushaction at_exit
-    $P1 = new ['Exception']
-    throw $P1
-    print "never 1\n"
-h:
-    ## this is never actually reached, because exit_handler throws an unhandled
-    ## exception before the handler is entered.
-    print "in outer handler\n"
-.end
-
-.sub exit_handler :outer(main)
-    .param int flag
-    print "at_exit, flag = "
-    say flag
-    $P2 = new ['Exception']
-    throw $P2
-    print "never 2\n"
-.end
-CODE
-/^main
-at_exit, flag = 1
-No exception handler/
-OUTPUT
-
-$ENV{TEST_PROG_ARGS} ||= '';
-my @todo = $ENV{TEST_PROG_ARGS} =~ /--run-pbc/
-    ? ( todo => '.tailcall and lexical maps not thawed from PBC, RT #60650' )
-    : ();
-pir_output_is( <<'CODE', <<'OUTPUT', "exit_handler via exit exception", @todo );
-.sub main :main
-    .local pmc a
-    .lex 'a', a
-    a = new ['Integer']
-    a = 42
-    push_eh handler
-    exit 0
-handler:
-    .tailcall exit_handler()
+  handler:
+    say "i am the decider"
 .end
 
-.sub exit_handler :outer(main)
-    say "at_exit"
-    .local pmc a
-    a = find_lex 'a'
-    print 'a = '
-    say a
-.end
-CODE
-at_exit
-a = 42
-OUTPUT
-
-## Regression test for r14697.  This probably won't be needed when PDD23 is
-## fully implemented.
-pir_error_output_like( <<'CODE', <<'OUTPUT', "invoke handler in calling sub", todo => "deprecate rethrow" );
-## This tests that error handlers are out of scope when invoked (necessary for
-## rethrow) when the error is signalled in another sub.
-.sub main :main
+.sub test_push_eh_throw
     push_eh handler
-    broken()
-    print "not reached.\n"
-handler:
-    .local pmc exception
-    .get_results (exception)
-    $S0 = exception
-    print "in handler.\n"
-    print $S0
-    print "\n"
-    #rethrow exception
-.end
-
-.sub broken
     $P0 = new ['Exception']
-    new $P2, ['String']
-    set $P2, "something broke"
-    setattribute $P0, "message", $P2
     throw $P0
-.end
-CODE
-/\Ain handler.
-something broke
-something broke
-current inst/
-OUTPUT
-
-pir_output_is(<<'CODE', <<'OUTPUT', "taking a continuation promotes RetCs");
-## This test creates a continuation in a inner sub and re-invokes it later.  The
-## re-invocation signals an error, which is caught by an intermediate sub.
-## Returning from the "test" sub the second time failed in r28794; invoking
-## parrot with "-D80" shows clearly that the "test" context was being recycled
-## prematurely.  For some reason, it is necessary to signal the error in order
-## to expose the bug.
-.sub main :main
-    .local int redux
-    .local pmc cont
-    ## debug 0x80
-    redux = 0
-    print "calling test\n"
-    cont = test()
-    print "back from test\n"
-    if redux goto done
-    redux = 1
-    print "calling cont\n"
-    cont()
-    print "never.\n"
-done:
-    print "done.\n"
-.end
-.sub test
-    ## Push a handler around the foo() call.
-    push_eh handle_errs
-    print "  calling foo\n"
-    .local pmc cont
-    cont = foo()
-    print "  returning from test.\n"
-    .return (cont)
-handle_errs:
-    pop_eh
-    print "  test:  caught error\n"
-    .return (cont)
-.end
-.sub foo
-    ## Take a continuation.
-    .local pmc cont
-    cont = new ['Continuation']
-    set_addr cont, over_there
-    print "    returning from foo\n"
-    .return (cont)
-over_there:
-    print "    got over there.\n"
-    .local pmc ex
-    ex = new ['Exception']
-    throw ex
-.end
-CODE
-calling test
-  calling foo
-    returning from foo
-  returning from test.
-back from test
-calling cont
-    got over there.
-  test:  caught error
-back from test
-done.
-OUTPUT
+    ok(0,'throw does not throw')
 
-pir_error_output_like( <<'CODE', <<'OUTPUT', "throw - no handler" );
-.sub main :main
-    push_eh try
-    failure()
-    pop_eh
-    exit 0
-  try:
-    .get_results($P0)
-    pop_eh
-    $S1 = $P0['backtrace']
-    $S1 .= "\n"
-    say $S1
+  handler:
+    ok(1,'throw can throw')
 .end
 
-.sub failure
-    die 'what'
-.end
-CODE
-/No such string attribute/
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', "catch ex from C-level MULTI function" );
-.sub main :main
-
-.local pmc p, q
-
-    p = new ['Integer']
-    set p, "0"
+.sub test_push_pop_eh_long
+    $P0 = new ['ExceptionHandler']
+    set_addr $P0, handler
+    push_eh $P0
+    ok(1,'push_eh works (long)')
 
-    push_eh handler
-    #throw an exception from a C-level MULTI function
-    q = p / p
-    goto end
     pop_eh
-    goto end
+    ok(1,'pop_eh works (long)')
+    .return()
 
-handler:
-    .local pmc exception
-    .local string message
-    .get_results (exception)
-
-    message = exception['message']
-    say_something(message)
-end:
+  handler:
+    say "i am the decider"
 .end
 
-.sub say_something
-    .param string message
-    #Calling this sub is enough to trigger the bug.  If execution reached this
-    #point, the bug is fixed.
-    say "no segfault"
-end:
+.sub test_bool
+    $P0 = new 'ExceptionHandler'
+    set_addr $P0, _handler
+    ok($P0,'ExceptionHandler objects return true')
+    .return()
+_handler:
+    say "howdy bool!"
 .end
-CODE
-no segfault
-OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', "count_eh" );
-.sub main :main
-    $I0 = count_eh
-    if $I0 == 0 goto right_number1
-        print "not "
-    right_number1:
-    print "ok 1\n"
-    push_eh _handler1
-    push_eh _handler2
-    print "ok 2\n"
-    $I1 = count_eh
-    if $I1 == 2 goto right_number2
-        print "not "
-    right_number2:
-    print "ok 3\n"
-    pop_eh
-    pop_eh
-    print "ok 4\n"
-    $I2 = count_eh
-    if $I2 == 0 goto right_number3
-        print "not "
-    right_number3:
-    print "ok 5\n"
-    end
-_handler1:
-    print "first handler\n"
-    end
-_handler2:
-    print "second handler\n"
-    end
+.sub test_int
+    $P0 = new 'ExceptionHandler'
+    set_addr $P0, _handler
+    push_eh $P0
+    $I0 = $P0
+    ok(1,'get_integer on ExceptionHandler ')
+    .return()
+_handler:
+    say "howdy int!"
+.end
+
+.sub test_attrs
+    $P0 = new 'ExceptionHandler'
+    set_addr $P0, _handler
+    push_eh $P0
+    throw $P0
+_handler:
+    get_results "0", $P0
+    getattribute $P1, $P0, 'type'
+    ok(1,'got type')
+    getattribute $P2, $P0, 'handled'
+    is($P2,0,'got handled')
+    getattribute $P3, $P0, 'exit_code'
+    is($P2,0,'got exit_code')
+    getattribute $P4, $P0, 'severity'
+    ok(1,'got severity')
+
+    push_eh done
+    $I0 = 1
+    getattribute $P5, $P0, 'foo'
+    $I0 = 0
+  done:
+    ok($I0, "Can't fetch non-existent attribute")
 .end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-ok 5
-OUTPUT
 
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/t/pmc/exceptionhandler.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/exceptionhandler.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/exceptionhandler.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -8,7 +8,7 @@
 
 =head1 SYNOPSIS
 
-    % prove t/pmc/exception_handler.t
+    % prove t/pmc/exceptionhandler.t
 
 =head1 DESCRIPTION
 
@@ -22,7 +22,8 @@
 .sub main :main
     .include 'test_more.pir'
 
-    plan(8)
+    # If test exited with "bad plan" MyHandlerCan.can_handle wasn't invoked.
+    plan(9)
 
     .local pmc eh
     eh = new ['ExceptionHandler']
@@ -213,6 +214,7 @@
 
 .sub can_handle :method
     .param pmc ex
+    ok(1, 'MyHandlerCan.can_handle invoked')
     .return(1)
 .end
 

Modified: branches/orderedhash_revamp/t/pmc/exporter.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/exporter.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/exporter.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -49,7 +49,7 @@
     say 'ok 1 - source() returns PMCNULL upon Exporter init'
 
     # get a NameSpace PMC for testing
-    # RT #46859 replace with make_namespace, when implemented
+    # TT #1233 replace with make_namespace, when implemented
     .local pmc ns
     ns = get_namespace ['Eponymous']
 
@@ -80,7 +80,7 @@
 .end
 
 
-# RT #46859 replace with make_namespace, when implemented
+# TT #1233 replace with make_namespace, when implemented
 .namespace ['Eponymous']
 .sub 'Eponymous' :anon
 .end
@@ -107,7 +107,7 @@
     say 'ok 2 - ...which is current namespace at first'
 
     # get a NameSpace PMC for testing
-    # RT #46859 replace with make_namespace, when implemented
+    # TT #1233 replace with make_namespace, when implemented
     .local pmc ns
     ns = get_namespace ['Eponymous']
 
@@ -138,7 +138,7 @@
 .end
 
 
-# RT #46859 replace with make_namespace, when implemented
+# TT #1233 replace with make_namespace, when implemented
 .namespace ['Eponymous']
 .sub 'Eponymous' :anon
 .end
@@ -405,7 +405,8 @@
 ok 1
 OUT
 
-# RT #46861 test exporting mmd subs
+# TODO: Test exporting mmd subs: TT #1205
+# https://trac.parrot.org/parrot/ticket/1205
 
 # Local Variables:
 #   mode: cperl

Modified: branches/orderedhash_revamp/t/pmc/filehandle.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/filehandle.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/filehandle.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -7,7 +7,7 @@
 use lib qw( . lib ../lib ../../lib );
 
 use Test::More;
-use Parrot::Test tests => 17;
+use Parrot::Test tests => 18;
 use Parrot::Test::Util 'create_tempfile';
 use Parrot::Test::Util 'create_tempfile';
 
@@ -95,14 +95,12 @@
 ok 7 - $P7.open($S1, $S2) # new file, write mode succeeds
 OUT
 
-# RT #46827 test open file, close file, delete file, reopen previously opened stream
-
 SKIP: {
     skip 'no asynch calls yet' => 1;
 
     pir_output_is( <<'CODE', <<'OUT', 'open and close - asynchronous' );
 .sub 'test' :main
-    $P1 = # RT #46831 create a callback here
+    $P1 = # TT #1204 create a callback here
     $P0 = new ['FileHandle']
 
     $P0.'open'('README')
@@ -292,11 +290,9 @@
 OUT
 
 
-# RT #46833 test reading/writing code points once supported
-
-# RT #46835 test reading long chunks, eof, and across newlines
+# TT #1204 test reading long chunks, eof, and across newlines
 
-# RT #46837 pir_output_is( <<'CODE', <<'OUT', 'print, read, and readline - asynchronous', todo => 'not yet implemented' );
+# TT #1204 pir_output_is( <<'CODE', <<'OUT', 'print, read, and readline - asynchronous', todo => 'not yet implemented' );
 
 # L<PDD22/I\/O PMC API/=item record_separator>
 pir_output_is( <<'CODE', <<'OUT', 'record_separator', todo => 'not yet implemented' );
@@ -367,9 +363,9 @@
 ok 3 - $S0 = $P1.buffer_type() # full-buffered
 OUT
 
-# RT #46839 test effects of buffer_type, not just set/get
+# TT #1204 test effects of buffer_type, not just set/get
 
-# RT #46841
+# TT #1177
 # L<PDD22/I\/O PMC API/=item buffer_size>
 # NOTES: try setting positive, zero, negative int
 # perform print and read ops
@@ -585,7 +581,49 @@
 utf8
 OUTPUT
 
-# RT #46843
+pir_output_is( <<'CODE', <<"OUTPUT", "exit status" );
+.include 'iglobals.pasm'
+.sub 'main'
+    .local pmc pipe, conf, interp
+    .local string cmd
+    pipe = new ['FileHandle']
+
+    interp = getinterp
+    conf = interp[.IGLOBALS_CONFIG_HASH]
+
+    cmd = conf['build_dir']
+
+    .local string aux
+    aux = conf['slash']
+    cmd .= aux
+    aux = conf['test_prog']
+    cmd .= aux
+    aux = conf['exe']
+    cmd .= aux
+
+    pipe = open cmd, "rp"
+    pipe.'readall'()
+    pipe.'close'()
+    print "expect 0 exit status: "
+    $I0 = pipe.'exit_status'()
+    say $I0
+
+    cmd .= ' --this_is_not_a_valid_option'
+    pipe = open cmd, "rp"
+    pipe.'readall'()
+    pipe.'close'()
+    print "expect 1 exit status: "
+    $I0 = pipe.'exit_status'()
+    $I0 = $I0 != 0
+    say $I0
+
+.end
+CODE
+expect 0 exit status: 0
+expect 1 exit status: 1
+OUTPUT
+
+# TT #1178
 # L<PDD22/I\/O PMC API/=item get_fd>
 # NOTES: this is going to be platform dependent
 

Modified: branches/orderedhash_revamp/t/pmc/fixedbooleanarray.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/fixedbooleanarray.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/fixedbooleanarray.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,20 +1,14 @@
-#! perl
-# Copyright (C) 2001-2007, Parrot Foundation.
+#! parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 14;
-
 =head1 NAME
 
 t/pmc/fixedbooleanarray.t - FixedBooleanArray PMC
 
 =head1 SYNOPSIS
 
-    % prove t/pmc/FixedBooleanArray.t
+    % prove t/pmc/fixedbooleanarray.t
 
 =head1 DESCRIPTION
 
@@ -23,268 +17,211 @@
 
 =cut
 
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting array size" );
-    new P0, ['FixedBooleanArray']
+.const int TESTS = 36
+
+.sub 'test' :main
+    .include 'test_more.pir'
+
+    plan(TESTS)
+
+    setting_array_size()
+    resizing_not_allowed()
+    setting_first_element()
+    setting_second_element()
+    setting_out_of_bounds()
+    getting_out_of_bounds()
+    set_pmc_access_int()
+    set_int_access_pmc()
+    interface()
+    truth()
+    pmc_keys_and_values()
+    freeze_thaw()
+    'clone'()
+    get_iter()
+    fill()
+.end
+
+.sub 'setting_array_size'
+    $P0 = new ['FixedBooleanArray']
+    $I0 = $P0
+    is($I0, 0, 'size is initially zero')
+
+    $P0 = 1
+    $I0 = $P0
+    is($I0, 1, 'size set to 1')
+.end
+
+.sub 'resizing_not_allowed'
+    $P0 = new ['FixedBooleanArray']
+
+    push_eh resizing_not_allowed_handler
+    $P0 = 1
+    $P0 = 2
+    nok(1, 'resizing should not have succeeded')
+    pop_eh
+    .return()
+
+  resizing_not_allowed_handler:
+    pop_eh
+    ok(1, 'resizing does not work on a fixed-size array')
+.end
+
+.sub 'setting_first_element'
+    $P0 = new ['FixedBooleanArray']
+    $P0 = 1
+
+    $P0[0] = -7
+    $I0 = $P0[0]
+    is($I0, 1, 'setting first element to a true int value')
+
+    $P0[0] = 3.7
+    $N0 = $P0[0]
+    is($N0, 1.0, 'setting first element to a true num value')
+
+    $P0[0] = "17"
+    $S0 = $P0[0]
+    is($S0, "1", 'setting first element to a true string value')
+.end
+
+.sub 'setting_second_element'
+    $P0 = new ['FixedBooleanArray']
+    $P0 = 2
+
+    $P0[1] = -7
+    $I0 = $P0[1]
+    is($I0, 1, 'setting second element to a true int value')
+
+    $P0[1] = 3.7
+    $N0 = $P0[1]
+    is($N0, 1.0, 'setting second element to a true num value')
+
+    $P0[1] = "17"
+    $S0 = $P0[1]
+    is($S0, "1", 'setting second element to a true string value')
+.end
+
+.sub 'setting_out_of_bounds'
+    $P0 = new ['FixedBooleanArray']
+    $P0 = 1
+
+    push_eh setting_out_of_bounds_handler
+    $P0[1] = -7
+    pop_eh
+    nok(1, "Setting out-of-bounds element wrongly succeeded")
+    .return()
+
+  setting_out_of_bounds_handler:
+    pop_eh
+    ok(1, "Setting out-of-bounds element did not succeed")
+.end
+
+.sub 'getting_out_of_bounds'
+    $P0 = new ['FixedBooleanArray']
+    $P0 = 1
+
+    push_eh getting_out_of_bounds_handler
+    $I0 = $P0[1]
+    pop_eh
+    nok(1, "Getting out-of-bounds element wrongly succeeded")
+    .return()
+
+  getting_out_of_bounds_handler:
+    pop_eh
+    ok(1, "Getting out-of-bounds element does not succeed")
+.end
+
+.sub 'set_pmc_access_int'
+    $P0 = new ['FixedBooleanArray']
+    $P0 = 3
+    $P1 = new ['Key']
+
+    $P1 = 0
+    $P0[$P1] = 25
 
-    set I0,P0
-    eq I0,0,OK_1
-    print "not "
-OK_1:    print "ok 1\n"
-
-    set P0,1
-    set I0,P0
-    eq I0,1,OK_2
-    print "not "
-OK_2:    print "ok 2\n"
-
-        end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', "Resetting array size (and getting an exception)" );
-    new P0, ['FixedBooleanArray']
-
-    set I0,P0
-    set P0,1
-    set P0,2
-    print "Should have gotten an exception\n"
-
-
-        end
-CODE
-/FixedBooleanArray: Can't resize!
-current instr\.:/
-OUTPUT
-
-#VIM's syntax highlighter needs this line
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting first element" );
-    new P0, ['FixedBooleanArray']
-    set P0, 1
-
-    set P0[0],-7
-    set I0,P0[0]
-    eq I0,1,OK_1
-    print "not "
-OK_1:    print "ok 1\n"
-
-    set P0[0],3.7
-    set N0,P0[0]
-    eq N0,1.0,OK_2
-    print "not "
-OK_2:    print "ok 2\n"
-
-    set P0[0],"17"
-    set S0,P0[0]
-    eq S0,"1",OK_3
-    print "not "
-OK_3:    print "ok 3\n"
-
-    end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting second element" );
-    new P0, ['FixedBooleanArray']
-    set P0, 2
-
-    set P0[1], -7
-    set I0, P0[1]
-    eq I0,1,OK_1
-    print "not "
-OK_1:    print "ok 1\n"
-
-       set P0[1], 3.7
-    set N0, P0[1]
-    eq N0,1.0,OK_2
-    print "not "
-OK_2:    print "ok 2\n"
-
-    set P0[1],"17"
-    set S0, P0[1]
-    eq S0,"1",OK_3
-    print "not "
-OK_3:    print "ok 3\n"
-
-    end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', "Setting out-of-bounds elements" );
-    new P0, ['FixedBooleanArray']
-    set P0, 1
-
-    set P0[1], -7
-
-    end
-CODE
-/FixedBooleanArray: index out of bounds!
-current instr\.:/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', "Getting out-of-bounds elements" );
-    new P0, ['FixedBooleanArray']
-    set P0, 1
-
-    set I0, P0[1]
-    end
-CODE
-/FixedBooleanArray: index out of bounds!
-current instr\.:/
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', "Set via PMC keys, access via INTs" );
-     .include 'fp_equality.pasm'
-     new P0, ['FixedBooleanArray']
-     set P0, 3
-     new P1, ['Key']
-
-     set P1, 0
-     set P0[P1], 25
-
-     set P1, 1
-     set P0[P1], 2.5
-
-     set P1, 2
-     set P0[P1], "17"
-
-     set I0, P0[0]
-     eq I0, 1, OK1
-     print "not "
-OK1: print "ok 1\\n"
-
-     set N0, P0[1]
-     .fp_eq_pasm(N0, 1.0, OK2)
-     print "not "
-OK2: print "ok 2\\n"
-
-     set S0, P0[2]
-     eq S0, "1", OK3
-     print "not "
-OK3: print "ok 3\\n"
-
-     end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', "Set via INTs, access via PMC Keys" );
-     .include 'fp_equality.pasm'
-     new P0, ['FixedBooleanArray']
-     set P0, 1024
-
-     set P0[25], 125
-     set P0[128], 10.2
-     set P0[513], "17"
-     new P1, ['Integer']
-     set P1, 123456
-     set P0[1023], P1
-
-     new P2, ['Key']
-     set P2, 25
-     set I0, P0[P2]
-     eq I0, 1, OK1
-     print "not "
-OK1: print "ok 1\\n"
-
-     set P2, 128
-     set N0, P0[P2]
-     .fp_eq_pasm(N0, 1.0, OK2)
-     print "not "
-OK2: print "ok 2\\n"
-
-     set P2, 513
-     set S0, P0[P2]
-     eq S0, "1", OK3
-     print "not "
-OK3: print "ok 3\\n"
-
-     set P2, 1023
-     set P3, P0[P2]
-     set I1, P3
-     eq I1, 1, OK4
-     print "not "
-OK4: print "ok 4\\n"
-
-     end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-OUTPUT
-
-pir_output_is( << 'CODE', << 'OUTPUT', "check whether interface is done" );
-
-.sub _main
-    .local pmc pmc1
-    pmc1 = new ['FixedBooleanArray']
-    .local int bool1
-    does bool1, pmc1, "scalar"
-    print bool1
-    print "\n"
-    does bool1, pmc1, "array"
-    print bool1
-    print "\n"
-    does bool1, pmc1, "no_interface"
-    print bool1
-    print "\n"
-    end
-.end
-CODE
-0
-1
-0
-OUTPUT
-
-pasm_output_is( << 'CODE', << 'OUTPUT', "Truth" );
-     new P0, ['FixedBooleanArray']
-     unless P0, OK1
-     print "not "
-OK1: print "ok 1\n"
-     set P0, 1
-     if P0, OK2
-     print "not "
-OK2: print "ok 2\n"
-     set P0[0], 0
-     if P0, OK3
-     print "not "
-OK3: print "ok 3\n"
-     end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( << 'CODE', << 'OUTPUT', "PMC keys & values" );
-     new P0, ['FixedBooleanArray']
-     set P0, 2
-     new P1, ['Key']
-     set P1, 1
-     new P2, ['Integer']
-     set P2, 1
-     set P0[P1], P2
-     set I0, P0[P1]
-     print I0
-     print "\n"
-     end
-CODE
-1
-OUTPUT
+    $P1 = 1
+    $P0[$P1] = 2.5
 
-pir_output_is( <<'CODE', <<'OUTPUT', "freeze/thaw" );
-.sub main :main
+    $P1 = 2
+    $P0[$P1] = "17"
+
+    $I0 = $P0[0]
+    is($I0, 1, "Set via PMC keys, access via INTs: int value")
+
+    $N0 = $P0[1]
+    is($N0, 1.0, "Set via PMC keys, access via INTs: num value")
+
+    $S0 = $P0[0]
+    is($S0, "1", "Set via PMC keys, access via INTs: string value")
+.end
+
+.sub 'set_int_access_pmc'
+    $P0 = new ['FixedBooleanArray']
+    $P0 = 1024
+
+    $P0[25] = 125
+    $P0[128] = 10.2
+    $P0[513] = "17"
+    $P1 = new ['Integer']
+    $P1 = 123456
+    $P0[1023] = $P1
+
+    $P2 = new ['Key']
+
+    $P2 = 25
+    $I0 = $P0[$P2]
+    is($I0, 1, 'Set via INTs, access via PMC Keys: int value')
+
+    $P2 = 128
+    $N0 = $P0[$P2]
+    is($N0, 1.0, 'Set via INTs, access via PMC Keys: num value')
+
+    $P2 = 513
+    $S0 = $P0[$P2]
+    is($S0, '1', 'Set via INTs, access via PMC Keys: string value')
+
+    $P2 = 1023
+    $P3 = $P0[$P2]
+    is($P3, 1, 'Set via INTs, access via PMC Keys: PMC value')
+.end
+
+.sub 'interface'
+    $P0 = new ['FixedBooleanArray']
+
+    $I0 = does $P0, 'scalar'
+    nok($I0, 'FixedBooleanArray does not scalar')
+    $I0 = does $P0, 'array'
+    ok($I0, 'FixedBooleanArray does array')
+    $I0 = does $P0, 'no_interface'
+    nok($I0, 'FixedBooleanArray does not no_interface')
+.end
+
+.sub 'truth'
+    $P0 = new ['FixedBooleanArray']
+
+    nok($P0, 'Empty FixedBooleanArray is false')
+
+    $P0 = 1
+    ok($P0, 'Non-empty FixedBooleanArray is true')
+
+    $P0[0] = 0
+    ok($P0, 'FixedBooleanArray is true, no matter what its values are')
+.end
+
+.sub 'pmc_keys_and_values'
+    $P0 = new ['FixedBooleanArray']
+    $P0 = 2
+
+    $P1 = new ['Key']
+    $P1 = 1
+    $P2 = new ['Integer']
+    $P2 = 1
+    $P0[$P1] = $P2
+
+    $I0 = $P0[$P1]
+    is($I0, 1, 'PMC keys & values')
+.end
+
+.sub 'freeze_thaw'
     .local pmc fba
     .local int i
     .local string s
@@ -298,21 +235,16 @@
     fba[12] = 1
     fba[15] = 1
 
-    say fba
+    $S0 = fba
+    is($S0, '01001000100010010', 'FixedBooleanArray before freeze')
     s = freeze fba
     fba.'fill'(0)
     fba = thaw s
-    say fba
-
+    $S0 = fba
+    is($S0, '01001000100010010', 'FixedBooleanArray after thaw')
 .end
 
-CODE
-01001000100010010
-01001000100010010
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', "clone" );
-.sub main :main
+.sub 'clone'
     .local pmc fba1, fba2
     .local int i
     .local string s
@@ -326,40 +258,66 @@
     fba1[12] = 1
     fba1[15] = 1
 
-    say fba1
+    $S0 = fba1
+    is($S0, '01001000100010010', 'FixedBooleanArray before clone')
     fba2 = clone fba1
-    say fba2
-
+    $S1 = fba2
+    is($S0, $S1, "clones have the same string representation")
 .end
 
-CODE
-01001000100010010
-01001000100010010
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', "get_iter" );
-.sub 'main' :main
+.sub 'get_iter'
     $P0 = new ['FixedBooleanArray']
     $P0 = 3
     $P0[0] = 1
     $P0[1] = 0
     $P0[2] = 1
+
     $P1 = iter $P0
-loop:
-    unless $P1 goto loop_end
-    $S2 = shift $P1
-    say $S2
-    goto loop
-loop_end:
-.end
-CODE
-1
-0
-1
-OUTPUT
+    $I2 = shift $P1
+    is($I2, 1, 'get_iter: first element')
+    $I2 = shift $P1
+    is($I2, 0, 'get_iter: second element')
+    $I2 = shift $P1
+    is($I2, 1, 'get_iter: third element')
 
+    nok($P1, 'iterator exhausted')
+.end
+
+.sub 'fill'
+    $P0 = new ['FixedBooleanArray']
+    $P0.'fill'(0)
+    ok(1, 'Filling empty array')
 
-1;
+    .local int result, i, size
+    size = 1564
+    $P0 = size
+
+    $P0.'fill'(0)
+    i = 0
+    result = 0
+    $I1 = 0
+  fill_false_loop:
+    unless i < size goto fill_false_end
+    $I0 = $P0[i]
+    result = or result, $I0
+    inc i
+    goto fill_false_loop
+  fill_false_end:
+    nok(result, "Fill with 0")
+
+    $P0.'fill'(1)
+    i = 0
+    result = 1
+    $I1 = 0
+  fill_true_loop:
+    unless i < size goto fill_true_end
+    $I0 = $P0[i]
+    result = and result, $I0
+    inc i
+    goto fill_true_loop
+  fill_true_end:
+    ok(result, "Fill with 1")
+.end
 
 
 # Local Variables:

Modified: branches/orderedhash_revamp/t/pmc/fixedfloatarray.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/fixedfloatarray.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/fixedfloatarray.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -20,7 +20,7 @@
 .sub main :main
     .include 'fp_equality.pasm'
     .include 'test_more.pir'
-    plan(25)
+    plan(26)
 
     array_size_tests()
     element_set_tests()
@@ -175,6 +175,12 @@
 .sub clone_tests
      set $I30, 2000
      $P0 = new ['FixedFloatArray']
+     $I1 = 0
+     clone $P2, $P0
+     if $P2 goto L0
+     $I1 = 1
+L0:  is($I1, 1, "clone of empty is empty")
+
      set $P0, $I30
      set $I0, 0
 L1:  set $N0, $I0

Modified: branches/orderedhash_revamp/t/pmc/fixedintegerarray.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/fixedintegerarray.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/fixedintegerarray.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,20 +1,14 @@
-#! perl
+#! parrot
 # Copyright (C) 2001-2008, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 12;
-
 =head1 NAME
 
 t/pmc/fixedintegerarray.t - FixedIntegerArray PMC
 
 =head1 SYNOPSIS
 
-    % prove t/pmc/FixedIntegerArray.t
+    % prove t/pmc/fixedintegerarray.t
 
 =head1 DESCRIPTION
 
@@ -23,275 +17,224 @@
 
 =cut
 
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting array size" );
-    new P0, ['FixedIntegerArray']
+.sub 'main' :main
+    .include 'test_more.pir'
+    plan(29)
+
+    'test_set_size'()       # 2 tests
+    'test_reset_size'()     # 1 test
+    'test_set_first'()      # 3 tests
+    'test_set_second'()     # 3 tests
+    'test_out_of_bounds'()  # 4 tests
+    'test_set_via_pmc'()    # 3 tests
+    'test_get_via_pmc'()    # 4 tests
+    'test_interface_done'() # 4 tests
+    'test_get_iter'()       # 1 test
+    'test_equality'()       # 5 tests
+.end
+
+.sub 'test_set_size'
+    $P0 = new ['FixedIntegerArray']
+
+    $I0 = $P0
+    is($I0, 0, "Fresh array has 0 elements")
+
+    $P0 = 42
+    $I0 = $P0
+    is($I0, 42, "Size was set correctly")
+.end
+
+.sub 'test_reset_size'
+    $P0 = new ['FixedIntegerArray']
+
+    $I0 = 1
+    $P0 = 1
+    push_eh handled
+    $P0 = 2
+    $I0 = 0
+  handled:
+    pop_eh
+
+    ok($I0, "Can't resize")
+.end
+
+.sub 'test_set_first'
+    $P0 = new ['FixedIntegerArray']
+    $P0 = 1
+
+    $P0[0] = -7
+    $I0 = $P0[0]
+    is($I0, -7, "First element set to integer properly")
+
+    $P0[0] = 3.7
+    $I0 = $P0[0]
+    is($I0, 3, "First element set to number properly")
+
+    $P0[0] = "17"
+    $I0 = $P0[0]
+    is($I0, 17, "First element set to string properly")
+.end
+
+.sub 'test_set_second'
+    $P0 = new ['FixedIntegerArray']
+    $P0 = 2
+
+    $P0[1] = -7
+    $I0 = $P0[1]
+    is($I0, -7, "Second element set to integer properly")
+
+    $P0[1] = 3.7
+    $I0 = $P0[1]
+    is($I0, 3, "Second element set to number properly")
+
+    $P0[1] = "17"
+    $I0 = $P0[1]
+    is($I0, 17, "Second element set to string properly")
+.end
+
 
-    set I0,P0
-    eq I0,0,OK_1
-    print "not "
-OK_1:    print "ok 1\n"
-
-    set P0,1
-    set I0,P0
-    eq I0,1,OK_2
-    print "not "
-OK_2:    print "ok 2\n"
-
-        end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', "Resetting array size (and getting an exception)" );
-    new P0, ['FixedIntegerArray']
-
-    set I0,P0
-    set P0,1
-    set P0,2
-    print "Should have gotten an exception\n "
-
-
-        end
-CODE
-/FixedIntegerArray: Can't resize!
-current instr\.:/
-OUTPUT
-
-#VIM's syntax highlighter needs this line
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting first element" );
-    new P0, ['FixedIntegerArray']
-    set P0, 1
-
-    set P0[0],-7
-    set I0,P0[0]
-    eq I0,-7,OK_1
-    print "not "
-OK_1:    print "ok 1\n"
-
-    set P0[0],3.7
-    set N0,P0[0]
-    eq N0,3.0,OK_2
-    print "not "
-OK_2:    print "ok 2\n"
-
-    set P0[0],"17"
-    set S0,P0[0]
-    eq S0,"17",OK_3
-    print "not "
-OK_3:    print "ok 3\n"
-
-    end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting second element" );
-    new P0, ['FixedIntegerArray']
-    set P0, 2
-
-    set P0[1], -7
-    set I0, P0[1]
-    eq I0,-7,OK_1
-    print "not "
-OK_1:    print "ok 1\n"
-
-    set P0[1], 3.7
-    set N0, P0[1]
-    eq N0,3.0,OK_2
-    print "not "
-OK_2:    print "ok 2\n"
-
-    set P0[1],"17"
-    set S0, P0[1]
-    eq S0,"17",OK_3
-    print "not "
-OK_3:    print "ok 3\n"
-
-    end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', "Setting out-of-bounds elements" );
-    new P0, ['FixedIntegerArray']
-    set P0, 1
-
-    set P0[1], -7
-
-    end
-CODE
-/FixedIntegerArray: index out of bounds!
-current instr\.:/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', "Getting out-of-bounds elements" );
-    new P0, ['FixedIntegerArray']
-    set P0, 1
-
-    set I0, P0[1]
-    end
-CODE
-/FixedIntegerArray: index out of bounds!
-current instr\.:/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', "Getting out-of-bounds elements, I" );
-    new P0, ['FixedIntegerArray']
-    set P0, 1
-    set I1, 1
-    set I0, P0[I1]
-    end
-CODE
-/FixedIntegerArray: index out of bounds!
-current instr\.:/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', "Getting out-of-bounds elements, -I" );
-    new P0, ['FixedIntegerArray']
-    set P0, 1
-    set I1, -1
-    set I0, P0[I1]
-    end
-CODE
-/FixedIntegerArray: index out of bounds!
-current instr\.:/
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', "Set via PMC keys, access via INTs" );
-     .include 'fp_equality.pasm'
-     new P0, ['FixedIntegerArray']
-     set P0, 3
-     new P1, ['Key']
-
-     set P1, 0
-     set P0[P1], 25
-
-     set P1, 1
-     set P0[P1], 2.5
-
-     set P1, 2
-     set P0[P1], "17"
-
-     set I0, P0[0]
-     eq I0, 25, OK1
-     print "not "
-OK1: print "ok 1\\n"
-
-     set N0, P0[1]
-     .fp_eq_pasm(N0, 2.0, OK2)
-     print "not "
-OK2: print "ok 2\\n"
-
-     set S0, P0[2]
-     eq S0, "17", OK3
-     print "not "
-OK3: print "ok 3\\n"
-
-     end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', "Set via INTs, access via PMC Keys" );
-     .include 'fp_equality.pasm'
-     new P0, ['FixedIntegerArray']
-     set P0, 1024
-
-     set P0[25], 125
-     set P0[128], 10.2
-     set P0[513], "17"
-     new P1, ['Integer']
-     set P1, 123456
-     set P0[1023], P1
-
-     new P2, ['Key']
-     set P2, 25
-     set I0, P0[P2]
-     eq I0, 125, OK1
-     print "not "
-OK1: print "ok 1\\n"
-
-     set P2, 128
-     set N0, P0[P2]
-     .fp_eq_pasm(N0, 10.0, OK2)
-     print "not "
-OK2: print "ok 2\\n"
-
-     set P2, 513
-     set S0, P0[P2]
-     eq S0, "17", OK3
-     print "not "
-OK3: print "ok 3\\n"
-
-     set P2, 1023
-     set P3, P0[P2]
-     set I1, P3
-     eq I1, 123456, OK4
-     print "not "
-OK4: print "ok 4\\n"
-
-     end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-OUTPUT
+.sub 'test_out_of_bounds'
+    $P0 = new ['FixedIntegerArray']
+    $P0 = 1
+
+    $I0 = 1
+    push_eh handle_set
+    $P0[2] = 7
+    $I0 = 0
+  handle_set:
+    ok($I0, "Can't set out-of-bounds element")
+
+    $I0 = 1
+    push_eh handle_set_negative
+    $P0[-42] = 7
+    $I0 = 0
+  handle_set_negative:
+    ok($I0, "Can't set element on negative index")
+
+    $I0 = 1
+    push_eh handle_get
+    $I1 = $P0[2]
+    $I0 = 0
+  handle_get:
+    ok($I0, "Can't get out-of-bounds element")
+
+    $I0 = 1
+    push_eh handle_get_negative
+    $I1 = $P0[-1]
+    $I0 = 0
+  handle_get_negative:
+    ok($I0, "Can't get element with negative index")
 
-pir_output_is( << 'CODE', << 'OUTPUT', "check whether interface is done" );
+.end
+
+# Set via PMC keys, access via INTs
+.sub 'test_set_via_pmc'
+    $P0 = new ['FixedIntegerArray']
+    $P0 = 3
+
+    $P1 = new ['Key']
+
+    $P1 = 0
+    $P0[$P1] = 25
+    $I0 = $P0[0]
+    is($I0, 25, "Set INTVAL via PMC Key works")
+
+    $P1 = 1
+    $P0[$P1] = 2.5
+    $I0 = $P0[1]
+    is($I0, 2, "Set FLOATVAL via PMC Key works")
+
+    $P1 = 2
+    $P0[$P1] = "17"
+    $I0 = $P0[2]
+    is($I0, 17, "Set STRING via PMC Key works")
+.end
 
-.sub _main
+# Set via INTs, access via PMC Keys
+.sub 'test_get_via_pmc'
+    $P0 = new ['FixedIntegerArray']
+    $P0 = 1024
+
+    $P0[25]   = 125
+    $P0[128]  = 10.2
+    $P0[513]  = "17"
+
+    $P1 = new ['Integer']
+    $P1 = 123456
+    $P0[1023] = $P1
+
+    $P2 = new ['Key']
+    
+    $P2 = 25
+    $I0 = $P0[$P2]
+    is($I0, 125, "Get INTVAL via Key works")
+
+    $P2 = 128
+    $N0 = $P0[$P2]
+    is($N0, 10.0, "Get FLOATVAL via Key works")
+
+    $P2 = 513
+    $S0 = $P0[$P2]
+    is($S0, "17", "Get STRING via Key works")
+
+    $P2 = 1023
+    $I0 = $P0[$P2]
+    is($I0, 123456, "Get INTVAL for stored PMC via Key works")
+
+.end
+
+.sub 'test_interface_done'
     .local pmc pmc1
     pmc1 = new ['FixedIntegerArray']
     .local int bool1
     does bool1, pmc1, "scalar"
-    print bool1
-    print "\n"
+    nok(bool1, "Does not scalar")
     does bool1, pmc1, "array"
-    print bool1
-    print "\n"
+    ok(bool1, "Does array")
     does bool1, pmc1, "no_interface"
-    print bool1
-    print "\n"
-    end
-.end
-CODE
-0
-1
-0
-OUTPUT
+    nok(bool1, "Does not no_interface")
+.end
 
-pir_output_is( <<'CODE', <<'OUTPUT', "get_iter" );
-.sub 'main' :main
-    new $P0, ['FixedIntegerArray']
-    set $P0, 3
+.sub 'test_get_iter'
+    $P0 = new ['FixedIntegerArray']
+    $P0 = 3
     $P0[0] = 42
     $P0[1] = 43
     $P0[2] = 44
+    $S0 = ""
     $P1 = iter $P0
-loop:
+  loop:
     unless $P1 goto loop_end
     $S2 = shift $P1
-    say $S2
+    concat $S0, $S2
     goto loop
-loop_end:
+  loop_end:
+    is($S0, "424344", "Iteration works")
 .end
-CODE
-42
-43
-44
-OUTPUT
 
+.sub 'test_equality'
+    .local pmc a1, a2
+    a1 = new ['FixedIntegerArray']
+    a2 = new ['FixedIntegerArray']
+
+    is(a1, a2, "Empty arrays are equal")
+    
+    a1 = 3
+    isnt(a1, a2, "Different size arrays aren't equal")
+
+    a2 = 3
+
+    a1[0] = 42
+    a2[0] = 42
+    is(a1, a2, "Equal with first element set")
+
+    a1[1] = 84
+    isnt(a1, a2, "Not equal when second element differ")
+    
+    a2[1] = 84
+    is(a1, a2, "Equal when second element same")
+.end
 
-1;
 
 # Local Variables:
 #   mode: cperl

Modified: branches/orderedhash_revamp/t/pmc/fixedpmcarray.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/fixedpmcarray.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/fixedpmcarray.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,14 +1,7 @@
-#! perl
+#! parrot
 # Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw(lib . ../lib ../../lib);
-
-use Parrot::Test tests => 21;
-use Test::More;
-
 =head1 NAME
 
 t/pmc/fixedpmcarray.t - FixedPMCArray PMC
@@ -24,323 +17,96 @@
 
 =cut
 
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting array size" );
-    new P0, ['FixedPMCArray']
-
-    set I0,P0
-    eq I0,0,OK_1
-    print "not "
-OK_1:    print "ok 1\n"
-
-    set P0,1
-    set I0,P0
-    eq I0,1,OK_2
-    print "not "
-OK_2:    print "ok 2\n"
-
-        end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', "Resetting array size (and getting an exception)" );
-    new P0, ['FixedPMCArray']
-
-    set I0,P0
-    set P0,1
-    set P0,2
-    print "Should have gotten an exception\n "
-
-
-        end
-CODE
-/FixedPMCArray: Can't resize!
-current instr\.:/
-OUTPUT
-
-#VIM's syntax highlighter needs this line
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Truth and falsehood" );
-        new P0, ['FixedPMCArray']
-
-        set P0, 0
-        if P0, NOK_1
-        branch OK_1
-NOK_1:  print "not "
-OK_1:   print "ok 1\n"
-        unless P0, OK_2
-        print "not "
-OK_2:   print "ok 2\n"
-
-        set P0, 1
-        unless P0, NOK_3
-        branch OK_3
-NOK_3:  print "not "
-OK_3:   print "ok 3\n"
-        if P0, OK_4
-        print "not "
-OK_4:   print "ok 4\n"
-
-        end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting first element" );
-        new P0, ['FixedPMCArray']
-        set P0, 1
-
-    set P0[0],-7
-    set I0,P0[0]
-    eq I0,-7,OK_1
-    print "not "
-OK_1:    print "ok 1\n"
-
-    set P0[0],3.7
-    set N0,P0[0]
-    eq N0,3.7,OK_2
-    print "not "
-OK_2:    print "ok 2\n"
-
-    set P0[0],"muwhahaha"
-    set S0,P0[0]
-    eq S0,"muwhahaha",OK_3
-    print "not "
-OK_3:    print "ok 3\n"
-
-    end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting second element" );
-        new P0, ['FixedPMCArray']
-        set P0, 2
-
-    set P0[1], -7
-    set I0, P0[1]
-    eq I0,-7,OK_1
-    print "not "
-OK_1:    print "ok 1\n"
-
-    set P0[1], 3.7
-    set N0, P0[1]
-    eq N0,3.7,OK_2
-    print "not "
-OK_2:    print "ok 2\n"
-
-    set P0[1],"purple"
-    set S0, P0[1]
-    eq S0,"purple",OK_3
-    print "not "
-OK_3:    print "ok 3\n"
-
-    end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting negatively indexed elements" );
-    new P0, ['FixedPMCArray']
-    set P0, 1
-
-    push_eh caught
-    set P0[-1], -7
-    pop_eh
-    say "no exception"
-    end
-caught:
-    say "caught an exception"
-    end
-CODE
-caught an exception
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Getting negatively indexed elements" );
-    new P0, ['FixedPMCArray']
-    set P0, 1
-
-    push_eh caught
-    set I0, P0[-1]
-    pop_eh
-    say "no exception"
-    end
-caught:
-    say "caught an exception"
-    end
-CODE
-caught an exception
-OUTPUT
-
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting out-of-bounds elements" );
-    new P0, ['FixedPMCArray']
-    set P0, 1
-
-    push_eh caught
-    set P0[1], -7
-    pop_eh
-    say "no exception"
-    end
-caught:
-    say "caught an exception"
-    end
-CODE
-caught an exception
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Getting out-of-bounds elements" );
-    new P0, ['FixedPMCArray']
-    set P0, 1
-
-    push_eh caught
-    set I0, P0[1]
-    pop_eh
-    say "no exception"
-    end
-caught:
-    say "caught an exception"
-    end
-CODE
-caught an exception
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', "Set via PMC keys, access via INTs" );
-     .include 'fp_equality.pasm'
-     new P0, ['FixedPMCArray']
-     set P0, 3
-     new P1, ['Key']
-
-     set P1, 0
-     set P0[P1], 25
-
-     set P1, 1
-     set P0[P1], 2.5
-
-     set P1, 2
-     set P0[P1], "bleep"
-
-     set I0, P0[0]
-     eq I0, 25, OK1
-     print "not "
-OK1: print "ok 1\\n"
-
-     set N0, P0[1]
-     .fp_eq_pasm(N0, 2.5, OK2)
-     print "not "
-OK2: print "ok 2\\n"
-
-     set S0, P0[2]
-     eq S0, "bleep", OK3
-     print "not "
-OK3: print "ok 3\\n"
-
-     end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', "Set via INTs, access via PMC Keys" );
-     .include 'fp_equality.pasm'
-     new P0, ['FixedPMCArray']
-     set P0, 1024
-
-     set P0[25], 125
-     set P0[128], 10.2
-     set P0[513], "cow"
-     new P1, ['Integer']
-     set P1, 123456
-     set P0[1023], P1
-
-     new P2, ['Key']
-     set P2, 25
-     set I0, P0[P2]
-     eq I0, 125, OK1
-     print "not "
-OK1: print "ok 1\\n"
-
-     set P2, 128
-     set N0, P0[P2]
-     .fp_eq_pasm(N0, 10.2, OK2)
-     print "not "
-OK2: print "ok 2\\n"
-
-     set P2, 513
-     set S0, P0[P2]
-     eq S0, "cow", OK3
-     print "not "
-OK3: print "ok 3\\n"
-
-     set P2, 1023
-     set P3, P0[P2]
-     set I1, P3
-     eq I1, 123456, OK4
-     print "not "
-OK4: print "ok 4\\n"
-
-     end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-OUTPUT
+.sub main :main
+    .include 'test_more.pir'
+    plan(76)
+    test_setting_array_size()
+    test_assign_from_another()
+    test_assign_self()
+    test_assign_non_array()
+    test_resize_exception()
+    test_truthiness()
+    test_tt991()
+    test_setting_first_elem()
+    test_setting_second_elem()
+    test_negative_index()
+    test_oob_elem()
+    test_set_pmc_keys_access_ints()
+    test_set_ints_access_pmc_keys()
+    test_interface()
+    test_get_uninitialized()
+    test_get_null_elem()
+    test_definedness()
+    test_splice_oob()
+    test_get_repr()
+    test_elements()
+    test_equality()
+    test_multi_keys()
+    test_splice()
+    test_sort()
+    test_exists()
+.end
 
-pir_output_like(
-    <<'CODE',
+.sub test_exists
+    .local pmc fpa
+    fpa = new ['FixedPMCArray']
+    fpa = 5
+    $I0 = exists fpa[3]
+    nok($I0,'FixedPMCArray element existence')
+    fpa[2] = 42
+    $I0 = exists fpa[2]
+    ok($I0,'FixedPMCArray element existence')
+
+    new $P1, ['Key']
+    set $P1, 0
+    fpa[$P1] = 99
+    $I0 = exists fpa[$P1]
+    ok($I0,'FixedPMCArray element existence')
+.end
 
-.sub main :main
+.sub test_sort
      .local pmc compares, cmp_fun
-     # RT #46855 doesnt work wit prederef of JIT
+     # TT #1317 doesnt work wit prederef of JIT
      bounds 1
      compares = new ['Integer']
      compares = 0
      set_global "compares", compares
-    cmp_fun = get_global "cmp_fun"
+     cmp_fun = get_global "cmp_fun"
      sort_ar()
      sort_ar(cmp_fun)
 .end
+
+# this is used by test_sort
 .sub sort_ar
     .param pmc cmp_fun :optional
     .local pmc compares
     compares = get_global "compares"
     compares = 0
-    .local pmc ar
-    ar = new ['FixedPMCArray']
-    ar = 5
-    ar[0] = 10
-    ar[1] = 2
-    ar[2] = 5
-    ar[3] = 9
-    ar[4] = 1
-    ar."sort"(cmp_fun)
-    print "ok 1\n"
-
-    .local pmc it
-    iter it, ar
-lp:
-    unless it goto done
-    $P0 = shift it
-    print $P0
-    print " "
-    goto lp
-done:
-    print "x\n"
-     print "compares: "
-     print compares
-     print "\n"
+    .local pmc array
+    array = new ['FixedPMCArray']
+    array = 5
+    array[0] = 10
+    array[1] = 2
+    array[2] = 5
+    array[3] = 9
+    array[4] = 1
+    array."sort"(cmp_fun)
+    ok(1,'call sort on FixedPMCArray')
+
+    .local pmc test1
+    test1 = new ['FixedPMCArray']
+    test1 = 5
+    test1[0] = 1
+    test1[1] = 2
+    test1[2] = 5
+    test1[3] = 9
+    test1[4] = 10
+
+    is_deeply( array, test1 )
+
 .end
 
+# this is used by test_sort
 .sub cmp_fun
     .param pmc a
     .param pmc b
@@ -352,58 +118,58 @@
     .set_return $I0
     .end_return
 .end
-CODE
 
-    qr/ok 1
-1 2 5 9 10 x
-compares: 0
-ok 1
-1 2 5 9 10 x
-compares: [1-9]\d*/, "sort"
-);
+.sub test_splice
+    .local pmc one
+    .local pmc test1, test2, test3
+    one = new ['Integer']
+    one = 1
 
-pir_output_is( << 'CODE', << 'OUTPUT', "check whether interface is done" );
+    .local pmc fpa
+    fpa = new ['FixedPMCArray']
+    fpa = 5
 
-.sub _main
-    .local pmc pmc1
-    pmc1 = new ['FixedPMCArray']
-    .local int bool1
-    does bool1, pmc1, "scalar"
-    print bool1
-    print "\n"
-    does bool1, pmc1, "array"
-    print bool1
-    print "\n"
-    does bool1, pmc1, "no_interface"
-    print bool1
-    print "\n"
-    end
-.end
-CODE
-0
-1
-0
-OUTPUT
+    splice fpa, one, 0, 5
+    test1 = new ['FixedPMCArray']
+    test1 = 5
+    test1[0] = 1
+    test1[1] = 1
+    test1[2] = 1
+    test1[3] = 1
+    test1[4] = 1
 
-pir_error_output_like( <<'CODE', <<'OUTPUT', "Getting unitialized elements" );
+    is_deeply(fpa, test1 )
 
-.sub main :main
-    .local pmc arr1
-    arr1 = new ['FixedPMCArray']
-    arr1 = 2005
-    .local pmc elem_1956
-    elem_1956 = arr1[1956]
-    .local string type_1956
-    type_1956 = typeof elem_1956
-    print type_1956
-.end
-CODE
-/Null PMC access in name()/
-OUTPUT
+    .local pmc two
+    two = new ['Integer']
+    two = 2
 
-pir_output_is( << 'CODE', << 'OUTPUT', "Multi keys" );
+    splice fpa, two, 1, 3
+    test2 = new ['FixedPMCArray']
+    test2 = 5
+    test2[0] = 1
+    test2[1] = 2
+    test2[2] = 2
+    test2[3] = 2
+    test2[4] = 1
+    is_deeply(fpa, test2 )
 
-.sub test :main
+    .local pmc three
+    three = new ['Integer']
+    three = 3
+
+    splice fpa, three, 2, 3
+    test3 = new ['FixedPMCArray']
+    test3 = 5
+    test3[0] = 1
+    test3[1] = 2
+    test3[2] = 3
+    test3[3] = 3
+    test3[4] = 3
+    is_deeply(fpa, test3 )
+.end
+
+.sub test_multi_keys
     .local pmc    matrix, row
     .local pmc    elem_in_pmc
     .local pmc    elem_out_pmc
@@ -424,116 +190,62 @@
     matrix[0;3] = "asdf"
 
     elem_out_int = matrix[0;0]
-    print "set_integer_keyed, get_integer_keyed: "
-    print elem_out_int
-    print "\n"
+    is(elem_out_int,128)
 
-    print "set_integer_keyed, get_pmc_keyed: "
     elem_out_pmc = matrix[0;0]
-    print elem_out_pmc
-    print "\n"
+    is(elem_out_pmc,128)
 
-    print "set_integer_keyed, get_number_keyed: "
     elem_out_num = matrix[0;0]
-    print elem_out_num
-    print "\n"
+    is(elem_out_num,128)
 
-    print "set_integer_keyed, get_string_keyed: "
     elem_out_string = matrix[0;0]
-    print elem_out_string
-    print "\n"
+    is(elem_out_string,128)
 
-    print "set_number_keyed, get_pmc_keyed: "
     elem_out_pmc = matrix[0;1]
-    print elem_out_pmc
-    print "\n"
+    is(elem_out_pmc,"128.128")
 
-    print "set_number_keyed, get_number_keyed: "
     elem_out_num = matrix[0;1]
-    print elem_out_num
-    print "\n"
+    is(elem_out_num,"128.128")
 
-    print "set_number_keyed, get_string_keyed: "
     elem_out_string = matrix[0;1]
-    print elem_out_string
-    print "\n"
+    is(elem_out_string,"128.128")
 
     elem_out_int = matrix[0;2]
-    print "set_pmc_keyed, get_integer_keyed: "
-    print elem_out_int
-    print "\n"
+    is(elem_out_int,256)
 
-    print "set_pmc_keyed, get_pmc_keyed: "
     elem_out_pmc = matrix[0;2]
-    print elem_out_pmc
-    print "\n"
+    is(elem_out_pmc,256)
 
-    print "set_pmc_keyed, get_number_keyed: "
     elem_out_num = matrix[0;2]
-    print elem_out_num
-    print "\n"
+    is(elem_out_num,256)
 
-    print "set_pmc_keyed, get_string_keyed: "
     elem_out_string = matrix[0;2]
-    print elem_out_string
-    print "\n"
+    is(elem_out_string,256)
 
     elem_out_int = matrix[0;0]
-    print "set_integer_keyed, get_integer_keyed: "
-    print elem_out_int
-    print "\n"
+    is(elem_out_int,128)
 
-    print "set_integer_keyed, get_pmc_keyed: "
     elem_out_pmc = matrix[0;0]
-    print elem_out_pmc
-    print "\n"
+    is(elem_out_pmc,128)
 
-    print "set_integer_keyed, get_number_keyed: "
     elem_out_num = matrix[0;0]
-    print elem_out_num
-    print "\n"
+    is(elem_out_num,128)
 
-    print "set_integer_keyed, get_string_keyed: "
     elem_out_string = matrix[0;0]
-    print elem_out_string
-    print "\n"
+    is(elem_out_string,128)
 
 .end
-CODE
-set_integer_keyed, get_integer_keyed: 128
-set_integer_keyed, get_pmc_keyed: 128
-set_integer_keyed, get_number_keyed: 128
-set_integer_keyed, get_string_keyed: 128
-set_number_keyed, get_pmc_keyed: 128.128
-set_number_keyed, get_number_keyed: 128.128
-set_number_keyed, get_string_keyed: 128.128
-set_pmc_keyed, get_integer_keyed: 256
-set_pmc_keyed, get_pmc_keyed: 256
-set_pmc_keyed, get_number_keyed: 256
-set_pmc_keyed, get_string_keyed: 256
-set_integer_keyed, get_integer_keyed: 128
-set_integer_keyed, get_pmc_keyed: 128
-set_integer_keyed, get_number_keyed: 128
-set_integer_keyed, get_string_keyed: 128
-OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', "equality" );
-.sub main :main
+.sub test_equality
     .local pmc fpa1, fpa2, p1, p2
     .local int i
     fpa1 = new ['FixedPMCArray']
     fpa2 = new ['FixedPMCArray']
 
-    print "1:"
-    if fpa1 == fpa2 goto L1
-    print "not "
-L1: say "equal"
+    is(fpa1,fpa2)
 
     fpa1 = 3
-    print "2:"
-    if fpa1 == fpa2 goto L2
-    print "not "
-L2: say "equal"
+    isnt(fpa1,fpa2)
 
     fpa2 = 3
 
@@ -545,10 +257,7 @@
     fpa1[0] = p1
     fpa2[0] = p2
 
-    print "3:"
-    if fpa1 == fpa2 goto L3
-    print "not "
-L3: say "equal"
+    is(fpa1,fpa2)
 
     p1 = new ['String']
     p2 = new ['String']
@@ -557,180 +266,362 @@
 
     fpa1[1] = p1
 
-    print "4:"
-    if fpa1 == fpa2 goto L4
-    print "not "
-L4: say "equal"
+    isnt(fpa1,fpa2)
 
     fpa2[1] = p2
 
-    print "5:"
-    if fpa1 == fpa2 goto L5
-    print "not "
-L5: say "equal"
-
-.end
-CODE
-1:equal
-2:not equal
-3:equal
-4:not equal
-5:equal
-OUTPUT
+    is(fpa1,fpa2)
 
-pir_output_is( <<'CODE', <<'OUTPUT', "defined" );
-.sub main :main
-    .local pmc arr1
-    arr1 = new ['FixedPMCArray']
-    arr1 = 2005
-    .local int defined_elem_1956
-    defined_elem_1956 = defined arr1[1956]
-    print defined_elem_1956
-    arr1[1956] = 42
-    defined_elem_1956 = defined arr1[1956]
-    print defined_elem_1956
-    .local pmc val
-    null val
-    arr1[1956] = val
-    defined_elem_1956 = defined arr1[1956]
-    print defined_elem_1956
-    print "\n"
 .end
-CODE
-010
-OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', "elements, get_integer, get_number" );
-.sub 'test' :main
+.sub test_elements
     .local pmc arr1
     .local int elems_i
     .local num elems_f
     arr1 = new ['FixedPMCArray']
     arr1 = 0
     elems_i = elements arr1
-    if elems_i == 0 goto ok_1
-    print 'not '
-  ok_1:
-    say 'ok 1'
+    is(elems_i,0)
 
     elems_i = arr1
-    if elems_i == 0 goto ok_2
-    print 'not '
-  ok_2:
-    say 'ok 2'
+    is(elems_i,0)
 
     elems_f = arr1
-    if elems_f == 0 goto ok_3
-    print 'not '
-  ok_3:
-    say 'ok 3'
+    is(elems_f,0)
 
     arr1 = new ['FixedPMCArray']
     arr1 = 2048
     elems_i = elements arr1
-    if elems_i == 2048 goto ok_4
-    print 'not '
-  ok_4:
-    say 'ok 4'
+    is(elems_i,2048)
 
     elems_i = arr1
-    if elems_i == 2048 goto ok_5
-    print 'not '
-  ok_5:
-    say 'ok 5'
+    is(elems_i,2048)
 
     elems_f = arr1
-    if elems_f == 2048 goto ok_6
-    print 'not '
-  ok_6:
-    say 'ok 6'
-.end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-ok 5
-ok 6
-OUTPUT
+    is(elems_f,2048)
+.end
 
-pir_output_is(<<'CODE', <<'OUTPUT', 'basic splice');
-.sub 'main'
-    .local pmc one
-    one = new ['Integer']
-    one = 1
+.sub test_get_repr
+    .local string s, aux
+    s = get_repr_fpa_n(0)
+    aux = get_repr_fpa_n(1)
+    concat s, aux
+    aux = get_repr_fpa_n(2)
+    concat s, aux
+    aux = get_repr_fpa_n(3)
+    concat s, aux
+    substring(s,'()(0)(0, 1)(0, 1, 2)','get_repr')
+.end
 
-    .local pmc fpa
+.sub get_repr_fpa_n
+    .param int n
+    .local int i
+    .local pmc fpa, p
+    .local string s
     fpa = new ['FixedPMCArray']
-    fpa = 5
+    fpa = n
+    i = 0
+next:
+    if i == n goto done
+    p = box i
+    fpa[i] = p
+    inc i
+    goto next
+done:
+    s = get_repr fpa
+    .return(s)
+.end
 
-    splice fpa, one, 0, 5
-    print_array( fpa )
+.sub test_splice_oob
+    throws_substring(<<'CODE','FixedPMCArray: index out of bounds','splice oob, offset 0')
+    .sub main
+        .local pmc fpa
+        fpa = new ['FixedPMCArray']
+        fpa = 5
 
-    .local pmc two
-    two = new ['Integer']
-    two = 2
+        .local pmc nil
+        nil = new ['Undef']
 
-    splice fpa, two, 1, 3
-    print_array( fpa )
+        splice fpa, nil, 0, 6
+    .end
+CODE
+    throws_substring(<<'CODE','FixedPMCArray: index out of bounds','splice oob, big offset')
+    .sub main
+        .local pmc fpa
+        fpa = new ['FixedPMCArray']
+        fpa = 5
 
-    .local pmc three
-    three = new ['Integer']
-    three = 3
+        .local pmc nil
+        nil = new ['Undef']
 
-    splice fpa, three, 2, 3
-    print_array( fpa )
+        splice fpa, nil, 6, 0
+    .end
+CODE
+.end
+
+.sub test_definedness
+    .local pmc arr1
+    arr1 = new ['FixedPMCArray']
+    arr1 = 2005
+    .local int defined_elem_1956
+    defined_elem_1956 = defined arr1[1956]
+    is(defined_elem_1956,0,'definedness')
+    arr1[1956] = 42
+    defined_elem_1956 = defined arr1[1956]
+    is(defined_elem_1956,1,'definedness')
+    .local pmc val
+    null val
+    arr1[1956] = val
+    defined_elem_1956 = defined arr1[1956]
+    is(defined_elem_1956,0,'definedness')
+.end
+
+.sub test_get_null_elem
+  .local pmc arr1, n
+  .local int i
+  .local string s
+  arr1 = new ['FixedPMCArray']
+  arr1 = 1
+  arr1[0] = n
+  i = arr1[0]
+  is(i,0,'null int is 0')
+  s = arr1[0]
+  is(s,"",'null string is empty string')
+.end
+
+.sub test_get_uninitialized
+    throws_substring(<<'CODE','Null PMC access in name','get uninitialized')
+    .sub main
+        .local pmc arr1
+        arr1 = new ['FixedPMCArray']
+        arr1 = 2005
+        .local pmc elem_1956
+        elem_1956 = arr1[1956]
+        .local string type_1956
+        type_1956 = typeof elem_1956
+        print type_1956
+    .end
+CODE
+.end
+
+.sub test_interface
+    .local pmc pmc1
+    pmc1 = new ['FixedPMCArray']
+    .local int bool1
+    does bool1, pmc1, "scalar"
+    nok(bool1,'FixedPMCArray does not scalar')
+    does bool1, pmc1, "array"
+    ok(bool1,'FixedPMCArray does array')
+    does bool1, pmc1, "no_interface"
+    nok(bool1,'no interface')
+.end
+.sub test_set_ints_access_pmc_keys
+     new $P0, ['FixedPMCArray']
+     set $P0, 1024
+
+     set $P0[25], 125
+     set $P0[128], 10.2
+     set $P0[513], "cow"
+     new $P1, ['Integer']
+     set $P1, 123456
+     set $P0[1023], $P1
+
+     new $P2, ['Key']
+     set $P2, 25
+     set $I0, $P0[$P2]
+     is($I0, 125,'got int with pmc key')
+
+     set $P2, 128
+     set $N0, $P0[$P2]
+     is($N0,10.2,'got float with pmc key',0.00001)
+
+     set $P2, 513
+     set $S0, $P0[$P2]
+     is($S0, "cow", 'got string with pmc key')
+
+     set $P2, 1023
+     set $P3, $P0[$P2]
+     set $I1, $P3
+     is($I1, 123456, 'got another int with pmc key')
+.end
+
+.sub test_set_pmc_keys_access_ints
+     new $P0, ['FixedPMCArray']
+     set $P0, 3
+     new $P1, ['Key']
+
+     set $P1, 0
+     set $P0[$P1], 25
+
+     set $P1, 1
+     set $P0[$P1], 2.5
+
+     set $P1, 2
+     set $P0[$P1], "bleep"
+
+     set $I0, $P0[0]
+     is($I0, 25,'got integer with int lookup')
+     set $N0, $P0[1]
+     is($N0,2.5,'got float with int lookup',0.00001)
+
+     set $S0, $P0[2]
+     is($S0, "bleep",'got string with int lookup')
 .end
 
-.sub 'print_array'
-    .param pmc fpa
+.sub test_oob_elem
+    throws_substring(<<'CODE','FixedPMCArray: index out of bounds!','set out-of-bounds index')
+        .sub main
+            new $P0, ['FixedPMCArray']
+            set $P0, 1
+            set $P0[1], -7
+        .end
+CODE
+    throws_substring(<<'CODE','FixedPMCArray: index out of bounds!','set out-of-bounds index')
+        .sub main
+            new $P0, ['FixedPMCArray']
+            set $P0, 1
+            set $I0, $P0[1]
+        .end
+CODE
 
-    .local pmc it
-    iter it, fpa
+.end
 
-    .local pmc elem
-  iter_start:
-    elem = shift it
-    print elem
-    if it goto iter_start
-  iter_end:
-    print "\n"
+.sub test_negative_index
+    throws_substring(<<'CODE','FixedPMCArray: index out of bounds!','set negative index')
+.sub main
+    new $P0, ['FixedPMCArray']
+    set $P0, 1
+    set $P0[-1], -7
+.end
+CODE
+    throws_substring(<<'CODE','FixedPMCArray: index out of bounds!','get negative index')
+.sub main
+    new $P0, ['FixedPMCArray']
+    set $P0, 1
+    set $I0, $P0[-1]
 .end
 CODE
-11111
-12221
-12333
-OUTPUT
 
-pir_error_output_like(<<'CODE', <<'OUTPUT', 'splice out of bounds, offset 0');
-.sub 'main'
-    .local pmc fpa
-    fpa = new ['FixedPMCArray']
-    fpa = 5
+.end
+
+.sub test_setting_second_elem
+    new $P0, ['FixedPMCArray']
+    set $P0, 2
+
+    set $P0[1],-7
+    set $I0,$P0[1]
+    is($I0,-7,'set second elem to int')
+
+    set $P0[1],3.7
+    set $N0,$P0[1]
+    is($N0,3.7,'set second elem to float')
+
+    set $P0[1],"muwhahaha"
+    set $S0,$P0[1]
+    is($S0,"muwhahaha",'set second elem to string')
+.end
+
+.sub test_setting_first_elem
+    new $P0, ['FixedPMCArray']
+    set $P0, 1
+
+    set $P0[0],-7
+    set $I0,$P0[0]
+    is($I0,-7,'set first elem to int')
 
-    .local pmc nil
-    nil = new ['Undef']
+    set $P0[0],3.7
+    set $N0,$P0[0]
+    is($N0,3.7,'set first elem to float')
+
+    set $P0[0],"muwhahaha"
+    set $S0,$P0[0]
+    is($S0,"muwhahaha",'set first elem to string')
+.end
 
-    splice fpa, nil, 0, 6
+.sub test_truthiness
+    new $P0, ['FixedPMCArray']
+    set $P0, 0
+    nok($P0,'length 0 FixedPMCArray is falsey')
+    set $P0, 1
+    ok($P0, 'length 1 FixedPMCArray is truthy')
 .end
+
+.sub test_tt991
+    throws_substring(<<'CODE','FixedPMCArray: Cannot set array size to a negative number','cannot create a negative length array')
+        .sub main
+            new $P0, ['FixedPMCArray']
+            set $P0, -1
+        .end
 CODE
-/FixedPMCArray: index out of bounds!/
-OUTPUT
+.end
 
-pir_error_output_like(<<'CODE', <<'OUTPUT', 'splice out of bounds, big offset');
-.sub 'main'
-    .local pmc fpa
-    fpa = new ['FixedPMCArray']
-    fpa = 5
+.sub test_resize_exception
+    throws_substring(<<'CODE',"FixedPMCArray: Can't resize",'cannot resize FixedPMCArray')
+        .sub main
+            new $P0, ['FixedPMCArray']
+            set $I0,$P0
+            set $P0,1
+            set $P0,2
+        .end
+CODE
 
-    .local pmc nil
-    nil = new ['Undef']
+    throws_substring(<<'CODE',"set_number_native() not implemented in class 'FixedPMCArray'", 'cannot use float as length to FixedPMCArray')
+        .sub main
+            new $P0, ['FixedPMCArray']
+            set $P0, 42.0
+        .end
+CODE
 
-    splice fpa, nil, 6, 0
+    throws_substring(<<'CODE',"set_string_native() not implemented in class 'FixedPMCArray'", 'cannot use string as length to FixedPMCArray')
+        .sub main
+            new $P0, ['FixedPMCArray']
+            set $P0,"GIGO"
+        .end
+CODE
 .end
+
+.sub test_assign_non_array
+    throws_substring(<<'CODE', "Can't set self from this type",'assign from non-array')
+    .sub main
+        .local pmc arr, other
+        .local int n
+        arr = new ['FixedPMCArray']
+        other = new ['Integer']
+        assign arr, other
+    .end
 CODE
-/FixedPMCArray: index out of bounds!/
-OUTPUT
+.end
+
+.sub test_assign_self
+    .local pmc arr
+    arr = new ['FixedPMCArray']
+    assign arr, arr
+    ok(1, 'Can assign FixedPMCArray to itself')
+.end
+
+.sub test_assign_from_another
+    .local pmc arr1, arr2
+    .local int n
+    arr1 = new ['FixedPMCArray']
+    arr1 = 32
+    arr2 = new ['FixedPMCArray']
+    arr2 = 15
+    assign arr1, arr2
+    n = arr1
+    is(n,15,'assigning to FixedPMCArray from another FixedPMCArray')
+.end
+
+.sub test_setting_array_size
+    new $P0, ['FixedPMCArray']
+
+    set $I0, $P0
+    is($I0,0,'size of new FixedPMCArray is 0')
+
+    set $P0, 1
+    set $I0, $P0
+
+    is($I0,1,'size of FixedPMCArray is 1')
+.end
 
 # Local Variables:
 #   mode: cperl

Modified: branches/orderedhash_revamp/t/pmc/fixedstringarray.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/fixedstringarray.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/fixedstringarray.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,20 +1,14 @@
-#! perl
-# Copyright (C) 2001-2007, Parrot Foundation.
+#! parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 15;
-
 =head1 NAME
 
 t/pmc/fixedstringarray.t - FixedStringArray PMC
 
 =head1 SYNOPSIS
 
-    % prove t/pmc/FixedStringArray.t
+    % prove t/pmc/fixedstringarray.t
 
 =head1 DESCRIPTION
 
@@ -23,335 +17,286 @@
 
 =cut
 
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting array size" );
-    new P0, ['FixedStringArray']
+.sub 'main' :main
+    .include 'test_more.pir'
+    plan(44)
+
+    'test_set_size'()       # 2 tests
+    'test_reset_size'()     # 1 test
+    'test_set_first'()      # 3 tests
+    'test_set_second'()     # 3 tests
+    'test_out_of_bounds'()  # 4 tests
+    'test_set_via_pmc'()    # 3 tests
+    'test_get_via_pmc'()    # 4 tests
+    'test_interface_done'() # 3 tests
+    'test_clone'()          # 3 tests
+    'test_clone_unitialized'() # 2 tests
+    'test_truth'()          # 2 tests
+    'test_get_iter'()       # 1 test
+    'test_freez_thaw'()     # 1 test
+    'test_get_string'()     # 1 test
+    'test_equality'()       # 5 tests
+    'test_gc'()             # 4 tests
+.end
+
+.sub 'test_set_size'
+    $P0 = new ['FixedStringArray']
+
+    $I0 = $P0
+    is($I0, 0, "Fresh array has 0 elements")
+
+    $P0 = 42
+    $I0 = $P0
+    is($I0, 42, "Size was set correctly")
+.end
+
+.sub 'test_reset_size'
+    $P0 = new ['FixedStringArray']
 
-    set I0,P0
-    eq I0,0,OK_1
-    print "not "
-OK_1:    print "ok 1\n"
-
-    set P0,1
-    set I0,P0
-    eq I0,1,OK_2
-    print "not "
-OK_2:    print "ok 2\n"
-
-        end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', "Resetting array size (and getting an exception)" );
-    new P0, ['FixedStringArray']
-
-    set I0,P0
-    set P0,1
-    set P0,2
-    print "Should have gotten an exception\n "
-
-
-        end
-CODE
-/FixedStringArray: Can't resize!
-current instr\.:/
-OUTPUT
-
-#VIM's syntax highlighter needs this line
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting first element" );
-    new P0, ['FixedStringArray']
-    set P0, 1
-
-    set P0[0],-7
-    set I0,P0[0]
-    eq I0,-7,OK_1
-    print "not "
-OK_1:    print "ok 1\n"
-
-    set P0[0],3.7
-    set N0,P0[0]
-    eq N0,3.7,OK_2
-    print "not "
-OK_2:    print "ok 2\n"
-
-    set P0[0],"muwhahaha"
-    set S0,P0[0]
-    eq S0,"muwhahaha",OK_3
-    print "not "
-OK_3:    print "ok 3\n"
-
-    end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting second element" );
-    new P0, ['FixedStringArray']
-    set P0, 2
-
-    set P0[1], -7
-    set I0, P0[1]
-    eq I0,-7,OK_1
-    print "not "
-OK_1:    print "ok 1\n"
-
-    set P0[1], 3.7
-    set N0, P0[1]
-    eq N0,3.7,OK_2
-    print "not "
-OK_2:    print "ok 2\n"
-
-    set P0[1],"purple"
-    set S0, P0[1]
-    eq S0,"purple",OK_3
-    print "not "
-OK_3:    print "ok 3\n"
-
-    end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', "Setting out-of-bounds elements" );
-    new P0, ['FixedStringArray']
-    set P0, 1
-
-    set P0[1], -7
-
-    end
-CODE
-/FixedStringArray: index out of bounds!
-current instr\.:/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', "Getting out-of-bounds elements" );
-    new P0, ['FixedStringArray']
-    set P0, 1
-
-    set I0, P0[1]
-    end
-CODE
-/FixedStringArray: index out of bounds!
-current instr\.:/
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', "Set via PMC keys, access via INTs" );
-     .include 'fp_equality.pasm'
-     new P0, ['FixedStringArray']
-     set P0, 3
-     new P1, ['Key']
-
-     set P1, 0
-     set P0[P1], 25
-
-     set P1, 1
-     set P0[P1], 2.5
-
-     set P1, 2
-     set P0[P1], "bleep"
-
-     set I0, P0[0]
-     eq I0, 25, OK1
-     print "not "
-OK1: print "ok 1\\n"
-
-     set N0, P0[1]
-     .fp_eq_pasm(N0, 2.5, OK2)
-     print "not "
-OK2: print "ok 2\\n"
-
-     set S0, P0[2]
-     eq S0, "bleep", OK3
-     print "not "
-OK3: print "ok 3\\n"
-
-     end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', "Set via INTs, access via PMC Keys" );
-     .include 'fp_equality.pasm'
-     new P0, ['FixedStringArray']
-     set P0, 1024
-
-     set P0[25], 125
-     set P0[128], 10.2
-     set P0[513], "cow"
-     new P1, ['Integer']
-     set P1, 123456
-     set P0[1023], P1
-
-     new P2, ['Key']
-     set P2, 25
-     set I0, P0[P2]
-     eq I0, 125, OK1
-     print "not "
-OK1: print "ok 1\\n"
-
-     set P2, 128
-     set N0, P0[P2]
-     .fp_eq_pasm(N0, 10.2, OK2)
-     print "not "
-OK2: print "ok 2\\n"
-
-     set P2, 513
-     set S0, P0[P2]
-     eq S0, "cow", OK3
-     print "not "
-OK3: print "ok 3\\n"
-
-     set P2, 1023
-     set P3, P0[P2]
-     set I1, P3
-     eq I1, 123456, OK4
-     print "not "
-OK4: print "ok 4\\n"
-
-     end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-OUTPUT
+    $I0 = 1
+    $P0 = 1
+    push_eh handled
+    $P0 = 2
+    $I0 = 0
+  handled:
+    pop_eh
+
+    ok($I0, "Can't resize")
+.end
+
+
+.sub 'test_set_first'
+    $P0 = new ['FixedStringArray']
+    $P0 = 1
+
+    $P0[0] = -7
+    $I0 = $P0[0]
+    is($I0, -7, "First element set to integer properly")
+
+    $P0[0] = 3.7
+    $N0 = $P0[0]
+    is($N0, 3.7, "First element set to number properly")
+
+    $P0[0] = "muwhahaha"
+    $S0 = $P0[0]
+    is($S0, "muwhahaha", "First element set to string properly")
+.end
 
-pir_output_is( << 'CODE', << 'OUTPUT', "check whether interface is done" );
 
-.sub _main
+.sub 'test_set_second'
+    $P0 = new ['FixedStringArray']
+    $P0 = 2
+
+    $P0[1] = -7
+    $I0 = $P0[1]
+    is($I0, -7, "Second element set to integer properly")
+
+    $P0[1] = 3.7
+    $I0 = $P0[1]
+    is($I0, 3, "Second element set to number properly")
+
+    $P0[1] = "purple"
+    $S0 = $P0[1]
+    is($S0, "purple", "Second element set to string properly")
+.end
+
+.sub 'test_out_of_bounds'
+    $P0 = new ['FixedStringArray']
+    $P0 = 1
+
+    $I0 = 1
+    push_eh handle_set
+    $P0[2] = 7
+    $I0 = 0
+  handle_set:
+    ok($I0, "Can't set out-of-bounds element")
+    pop_eh
+
+    $I0 = 1
+    push_eh handle_set_negative
+    $P0[-42] = 7
+    $I0 = 0
+  handle_set_negative:
+    ok($I0, "Can't set element on negative index")
+    pop_eh
+
+    $I0 = 1
+    push_eh handle_get
+    $I1 = $P0[2]
+    $I0 = 0
+  handle_get:
+    ok($I0, "Can't get out-of-bounds element")
+    pop_eh
+
+    $I0 = 1
+    push_eh handle_get_negative
+    $I1 = $P0[-1]
+    $I0 = 0
+  handle_get_negative:
+    ok($I0, "Can't get element with negative index")
+    pop_eh
+
+.end
+
+
+# Set via PMC keys, access via INTs
+.sub 'test_set_via_pmc'
+    $P0 = new ['FixedStringArray']
+    $P0 = 3
+
+    $P1 = new ['Key']
+
+    $P1 = 0
+    $P0[$P1] = 25
+    $S0 = $P0[0]
+    is($S0, "25", "Set INTVAL via PMC Key works")
+
+    $P1 = 1
+    $P0[$P1] = 2.5
+    $S0 = $P0[1]
+    is($S0, "2.5", "Set FLOATVAL via PMC Key works")
+
+    $P1 = 2
+    $P0[$P1] = "bleep"
+    $S0 = $P0[2]
+    is($S0, "bleep", "Set STRING via PMC Key works")
+.end
+
+# Set via INTs, access via PMC Keys
+.sub 'test_get_via_pmc'
+    $P0 = new ['FixedStringArray']
+    $P0 = 1024
+
+    $P0[25]   = 125
+    $P0[128]  = 10.2
+    $P0[513]  = "blah"
+
+    $P1 = new ['Integer']
+    $P1 = 123456
+    $P0[1023] = $P1
+
+    $P2 = new ['Key']
+
+    $P2 = 25
+    $I0 = $P0[$P2]
+    is($I0, 125, "Get INTVAL via Key works")
+
+    $P2 = 128
+    $N0 = $P0[$P2]
+    is($N0, 10.2, "Get FLOATVAL via Key works")
+
+    $P2 = 513
+    $S0 = $P0[$P2]
+    is($S0, "blah", "Get STRING via Key works")
+
+    $P2 = 1023
+    $I0 = $P0[$P2]
+    is($I0, 123456, "Get INTVAL for stored PMC via Key works")
+
+.end
+
+
+.sub 'test_interface_done'
     .local pmc pmc1
     pmc1 = new ['FixedStringArray']
     .local int bool1
     does bool1, pmc1, "scalar"
-    print bool1
-    print "\n"
+    nok(bool1, "Does not scalar")
     does bool1, pmc1, "array"
-    print bool1
-    print "\n"
+    ok(bool1, "Does array")
     does bool1, pmc1, "no_interface"
-    print bool1
-    print "\n"
-    end
-.end
-CODE
-0
-1
-0
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Clone" );
-     new P0, ['FixedStringArray']
-     set P0, 3
-     set P0[0], "abcde"
-     set P0[1], "fghi"
-     set P0[2], "jkl"
-     clone P1, P0
-     set P0[0], ""
-     set P0[1], ""
-     set P0[2], ""
-     set S0, P1[0]
-     print S0
-     set S0, P1[1]
-     print S0
-     set S0, P1[2]
-     print S0
-     print "\n"
-     end
-CODE
-abcdefghijkl
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', "Cloning before size is set" );
-     new P0, ['FixedStringArray']
-     clone P1, P0
-     set P0, 10
-     set P1, 20
-     print "ok\n"
-     clone P2, P0
-     set P2, 30
-     end
-CODE
-/ok
-FixedStringArray: Can't resize!
-current instr\.:/
-OUTPUT
-
-#VIM's syntax highlighter needs this line
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Truth" );
-     new P0, ['FixedStringArray']
-     unless P0, OK1
-     print "not "
-OK1: print "ok 1\n"
-     set P0, 10
-     if P0, OK2
-     print "not "
-OK2: print "ok 2\n"
-     end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Garbage collection" );
-     new P0, ['FixedStringArray']
-     set P0, 8192
-     set I0, 0
-L1:  set P0[I0], I0
-     inc I0
-     lt I0, 8192, L1
-     sweep 1
-     set S0, P0[1000]
-     print S0
-     print "\n"
-     set S0, P0[2000]
-     print S0
-     print "\n"
-     set S0, P0[4000]
-     print S0
-     print "\n"
-     set S0, P0[8000]
-     print S0
-     print "\n"
-     end
-CODE
-1000
-2000
-4000
-8000
-OUTPUT
+    nok(bool1, "Does not no_interface")
+.end
 
-pir_output_is( <<'CODE', <<'OUTPUT', "get_iter" );
-.sub 'main' :main
-    new $P0, ['FixedStringArray']
-    set $P0, 3
-    $P0[0] = 42
-    $P0[1] = 43
-    $P0[2] = 44
+
+.sub 'test_clone'
+     new $P0, ['FixedStringArray']
+     set $P0, 3
+     set $P0[0], "abcde"
+     set $P0[1], "fghi"
+     set $P0[2], "jkl"
+     clone $P1, $P0
+     set $P0[0], ""
+     set $P0[1], ""
+     set $P0[2], ""
+     set $S0, $P1[0]
+     is($S0, "abcde", "First element cloned")
+     set $S0, $P1[1]
+     is($S0, "fghi", "Second element cloned")
+     set $S0, $P1[2]
+     is($S0, "jkl", "Third element cloned")
+.end
+
+.sub 'test_clone_unitialized'
+    $P0 = new ['FixedStringArray']
+    $P1 = clone $P0
+
+    $I0 = 0
+    push_eh clone_1
+    $P0 = 10
+    $P1 = 20
+    $I0 = 1
+  clone_1:
+    pop_eh
+    ok($I0, "Resize of uninitialized clone successful")
+
+    $I1 = 1
+    push_eh clone_2
+    $P2 = clone $P0
+    $P2 = 30
+    $I0 = 0
+  clone_2:
+    ok($I0, "Resize of initialization not successful")
+    pop_eh
+
+.end
+
+.sub 'test_truth'
+    $P0 = new ['FixedStringArray']
+    nok($P0, "Empty array is false")
+    $P0 = 10
+    ok($P0, "Non-empty array is true")
+.end
+
+.sub 'test_gc'
+    $P0 = new ['FixedStringArray']
+    $P0 = 8192
+
+    $I0 = 0
+  loop:
+    $P0[$I0] = $I0
+    inc $I0
+    sweep 1
+    if $I0 < 8192 goto loop
+
+    $S0 = $P0[1000]
+    is($S0, "1000", "1000th element survived")
+    $S0 = $P0[2000]
+    is($S0, "2000", "2000th element survived")
+    $S0 = $P0[4000]
+    is($S0, "4000", "4000th element survived")
+    $S0 = $P0[8000]
+    is($S0, "8000", "8000th element survived")
+.end
+
+.sub 'test_get_iter'
+    $P0 = new ['FixedStringArray']
+    $P0 = 3
+    $P0[0] = "foo"
+    $P0[1] = "bar"
+    $P0[2] = "baz"
+    $S0 = ""
     $P1 = iter $P0
   loop:
     unless $P1 goto loop_end
     $S2 = shift $P1
-    say $S2
+    concat $S0, $S2
     goto loop
   loop_end:
+    is($S0, "foobarbaz", "Iteration works")
 .end
-CODE
-42
-43
-44
-OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', "freeze/thaw" );
-.sub 'main' :main
+.sub 'test_freez_thaw'
     .local pmc fsa, it
     .local string s
 
@@ -367,22 +312,57 @@
     fsa = thaw s
 
     it = iter fsa
+    $S0 = ""
   loop:
     unless it goto loop_end
     s = shift it
-    say s
+    concat $S0, s
     goto loop
   loop_end:
+    is($S0, "42434499101", "get_iter works")
+.end
+
+.sub 'test_get_string'
+    $P0 = new ['FixedStringArray']
+    $P0 = 2
+    $P0[0] = "foo"
+    is($P0, '[ "foo", "" ]', "Array stringified properly")
+.end
+
+.sub 'test_equality'
+    .local pmc a1, a2, other
+    .local int i
+    .local string s
+    a1 = new ['FixedStringArray']
+    a2 = new ['FixedStringArray']
+    other = new ['Integer']
+
+    is(a1, a2, "Empty arrays are equal")
+
+    i = iseq a1, other
+    is(i, 0, "Not equal to other type")
+
+    a1 = 3
+    isnt(a1, a2, "Different size arrays aren't equal")
+
+    a2 = 3
+
+    a1[0] = "foo"
+    a2[0] = "foo"
+    is(a1, a2, "Equal with first element set")
+
+    a1[1] = "bar"
+    a2[1] = "BAR"
+    isnt(a1, a2, "Not equal when second element differ")
+
+    a2[1] = "bar"
+    is(a1, a2, "Equal when second element same")
+
+    null s
+    a2[1] = s
+    isnt(a1, a2, "Not equal when second element is null")
 .end
-CODE
-42
-43
-44
-99
-101
-OUTPUT
 
-1;
 
 # Local Variables:
 #   mode: cperl

Modified: branches/orderedhash_revamp/t/pmc/float.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/float.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/float.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,15 +1,7 @@
-#!perl
+#! parrot
 # Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-
-use Test::More;
-use Parrot::Test tests => 61;
-use Parrot::Config;
-
 =head1 NAME
 
 t/pmc/float.t - Floating-point Numbers
@@ -24,1600 +16,1000 @@
 
 =cut
 
+.const int TESTS = 159
+.const num PRECISION = 0.000001
+
+.sub 'test' :main
+    .include 'test_more.pir'
+
+    plan(TESTS)
+    basic_assignment()
+    add_number_to_self()
+    sub_number_from_self()
+    multiply_number_by_self()
+    divide_number_by_self()
+    divide_by_zero()
+    truth_positive_float()
+    truth_negative_float()
+    truth_positive_integer()
+    truth_negative_integer()
+    falseness_0()
+    'falseness_0.000'()
+    integer_addition()
+    integer_substraction()
+    integer_multiplication()
+    integer_division()
+    number_addition()
+    number_substraction()
+    number_multiplication()
+    number_division()
+    increment_decrement()
+    'neg'()
+    negative_zero()
+    equality()
+    is_interface_done()
+    'abs'()
+    'lt'()
+    'lt_num'()
+    'le'()
+    'le_num'()
+    'gt'()
+    'gt_num'()
+    'ge'()
+    'ge_num'()
+    cmp_p_n()
+    'isgt'()
+    'isge'()
+    'islt'()
+    'isle'()
+    'iseq'()
+    'isne'()
+    instantiate_str()
+    cmp_subclasses()
+    acos_method()
+    cos_method()
+    asec_method()
+    asin_method()
+    atan_method()
+    atan2_method()
+    cosh_method()
+    exp_method()
+    ln_method()
+    log10_method()
+    log2_method()
+    sec_method()
+    sech_method()
+    sin_method()
+    sinh_method()
+    tan_method()
+    tanh_method()
+    sqrt_method()
+.end
+
+.include 'fp_equality.pasm'
+
+.sub 'basic_assignment'
+    $P0 = new ['Float']
+
+    $P0 = 0.001
+    is($P0, 0.001, 'basic float assignment 1', PRECISION)
+
+    $P0 = 12.5
+    is($P0, 12.5, 'basic assignment 2', PRECISION)
+
+    $P0 = 1000
+    is($P0, 1000.0, 'basic integer assignment', PRECISION)
+
+    $P0 = 'Twelve point five'
+    is($P0, 0.0, 'basic string assignment', PRECISION)
+
+    $P0 = 123.45
+    $I0 = $P0
+    is($I0, 123, 'rounding to integer')
+
+    $P0 = 123.45
+    $N0 = $P0
+    is($N0, 123.45, 'get_float_value', PRECISION)
+
+    $P0 = 123.45
+    $S0 = $P0
+    is($S0, '123.45', 'get string')
+
+    $P0 = "12.49"
+    is($P0, 12.49, 'setting value from String', PRECISION)
+.end
+
+.sub 'add_number_to_self'
+    $P0 = new ['Float']
+    $P0 = 0.001
+    $P0 = $P0 + $P0
+
+    is($P0, 0.002, 'add number to self', PRECISION)
+.end
+
+.sub 'sub_number_from_self'
+    $P0 = new ['Float']
+    $P0 = -1000.2
+    $P0 = $P0 - $P0
+
+    is($P0, 0.0, 'sub number from self', PRECISION)
+.end
+
+.sub 'multiply_number_by_self'
+    $P0 = new ['Float']
+    $P0 = 123.4
+    $P0 = $P0 * $P0
+
+    is($P0, 15227.56, 'multiply number by self', PRECISION)
+.end
+
+.sub 'divide_number_by_self'
+    $P0 = new ['Float']
+    $P0 = 1829354.988
+    $P0 = $P0 / $P0
 
-pasm_output_is( <<"CODE", <<OUTPUT, "basic assignment" );
-    .include 'fp_equality.pasm'
-    new P0, ['Float']
-
-    set P0, 0.001
-    .fp_eq_pasm( P0, 0.001, EQ1)
-    print "not "
-EQ1:    print "ok 1\\n"
-
-        set P0, 1000
-        .fp_eq_pasm( P0, 1000.0, EQ2)
-    print "not "
-EQ2:    print "ok 2\\n"
-
-        set P0, "12.5"
-        .fp_eq_pasm( P0, 12.5, EQ3)
-    print "not "
-EQ3:    print "ok 3\\n"
-
-        set P0, "Twelve point five"
-        .fp_eq_pasm( P0, 0.0, EQ4)
-    print "not "
-EQ4:    print "ok 4\\n"
-
-        set P0, 123.45
-        set I0, P0
-        eq I0, 123, EQ5
-    print "not "
-EQ5:    print "ok 5\\n"
-
-        set P0, 123.45
-        set N0, P0
-        .fp_eq_pasm(N0, 123.45, EQ6)
-    print "not "
-EQ6:    print "ok 6\\n"
-
-        set P0, 123.45
-        set S0, P0
-        eq S0, "123.45", EQ7
-    print "not "
-EQ7:    print "ok 7\\n"
-
-    end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-ok 5
-ok 6
-ok 7
-OUTPUT
-
-pasm_output_is( <<"CODE", <<OUTPUT, "add number to self" );
-    .include 'fp_equality.pasm'
-    new P0, ['Float']
-    set P0, 0.001
-    add P0, P0, P0
-    .fp_eq_pasm( P0, 0.002, EQ1)
-    print P0
-    print "not "
-EQ1:    print "ok 1\\n"
-    end
-CODE
-ok 1
-OUTPUT
-
-pasm_output_is( <<"CODE", <<OUTPUT, "sub number from self" );
-    .include 'fp_equality.pasm'
-    new P0, ['Float']
-    set P0, -1000.2
-    sub P0, P0, P0
-    .fp_eq_pasm( P0, 0.0, EQ1)
-    print P0
-    print "not "
-EQ1:    print "ok 1\\n"
-    end
-CODE
-ok 1
-OUTPUT
-
-pasm_output_is( <<"CODE", <<OUTPUT, "multiply number by self" );
-    .include 'fp_equality.pasm'
-    new P0, ['Float']
-    set P0, 123.4
-    mul P0, P0, P0
-    .fp_eq_pasm( P0, 15227.56, EQ1)
-    print P0
-    print "not "
-EQ1:    print "ok 1\\n"
-    end
-CODE
-ok 1
-OUTPUT
-
-pasm_output_is( <<"CODE", <<OUTPUT, "divide number by self" );
-    .include 'fp_equality.pasm'
-    new P0, ['Float']
-    set P0, 1829354.988
-    div P0, P0, P0
-    .fp_eq_pasm( P0, 1.0, EQ1)
-    print P0
-    print "not "
-EQ1:    print "ok 1\\n"
-    end
-CODE
-ok 1
-OUTPUT
+    is($P0, 1.0, 'divide number by self', PRECISION)
+.end
 
-pir_output_is( <<'CODE', <<OUTPUT, "divide by zero" );
-.sub _main :main
+.sub 'divide_by_zero'
     $P0 = new ['Float']
-    set $P0, "12.0"
+    $P0 = 12.0
+
     $P1 = new ['Float']
+
     $P2 = new ['Float']
-    set $P2, "0.0"
-    push_eh OK
+    $P2 = 0.0
+
+    push_eh divide_by_zero_handler
     $P1 = $P0 / $P2
-    print "fail\n"
     pop_eh
-OK:
-    get_results '0', $P0
-    $S0 = $P0
-    print "ok\n"
-    print $S0
-    print "\n"
-.end
-CODE
-ok
-float division by zero
-OUTPUT
+    nok(1, 'divide by zero')
+    .return ()
 
-pir_output_is( << 'CODE', << 'OUTPUT', "Truth of a positive float" );
+  divide_by_zero_handler:
+    ok(1, "divide by zero throws exception")
+.end
 
-.sub _main
+.sub 'truth_positive_float'
     .local pmc float_1
     float_1 = new ['Float']
     float_1 = 123.123
-    print float_1
-    if float_1 goto IS_TRUE
-      print " is false\n"
-    end
-    IS_TRUE:
-      print " is true\n"
-    end
-.end
-CODE
-123.123 is true
-OUTPUT
-
-pir_output_is( << 'CODE', << 'OUTPUT', "Truth of a negative float" );
+    ok(float_1, 'Truth of a positive float')
+.end
 
-.sub _main
+.sub 'truth_negative_float'
     .local pmc float_1
     float_1 = new ['Float']
     float_1 = -123.123
-    print float_1
-    if float_1 goto IS_TRUE
-      print " is false\n"
-    end
-    IS_TRUE:
-      print " is true\n"
-    end
-.end
-CODE
--123.123 is true
-OUTPUT
-
-pir_output_is( << 'CODE', << 'OUTPUT', "Truth of a positive integer" );
+    ok(float_1, 'Truth of a negative float')
+.end
 
-.sub _main
+.sub 'truth_positive_integer'
     .local pmc float_1
     float_1 = new ['Float']
     float_1 = 1
-    print float_1
-    if float_1 goto IS_TRUE
-      print " is false\n"
-    end
-    IS_TRUE:
-      print " is true\n"
-    end
-.end
-CODE
-1 is true
-OUTPUT
-
-pir_output_is( << 'CODE', << 'OUTPUT', "Truth of a negative integer" );
+    ok(float_1, 'Truth of a positive integer')
+.end
 
-.sub _main
+.sub 'truth_negative_integer'
     .local pmc float_1
     float_1 = new ['Float']
     float_1 = -1
-    print float_1
-    if float_1 goto IS_TRUE
-      print " is false\n"
-    end
-    IS_TRUE:
-      print " is true\n"
-    end
-.end
-CODE
--1 is true
-OUTPUT
-
-pir_output_is( << 'CODE', << 'OUTPUT', "Falseness of 0" );
+    ok(float_1, 'Truth of a negative integer')
+.end
 
-.sub _main
+.sub 'falseness_0'
     .local pmc float_1
     float_1 = new ['Float']
     float_1 = 0
-    print float_1
-    if float_1 goto IS_TRUE
-      print " is false\n"
-    end
-    IS_TRUE:
-      print " is true\n"
-    end
-.end
-CODE
-0 is false
-OUTPUT
-
-pir_output_is( << 'CODE', << 'OUTPUT', "Falseness of 0.000" );
+    nok(float_1, 'Falseness of 0')
+.end
 
-.sub _main
+.sub 'falseness_0.000'
     .local pmc float_1
     float_1 = new ['Float']
     float_1 = 0.000
-    print float_1
-    if float_1 goto IS_TRUE
-      print " is false\n"
-    end
-    IS_TRUE:
-      print " is true\n"
-    end
-.end
-CODE
-0 is false
-OUTPUT
-
-pasm_output_is( << "CODE", << 'OUTPUT', "Basic integer arithmetic: addition" );
-    .include 'fp_equality.pasm'
-    new P0, ['Float']
-    set P0, 0.001
-    add P0, 1
-    .fp_eq_pasm(P0, 1.001, EQ1)
-    print P0
-    print "not "
-EQ1:    print "ok 1\\n"
-
-    add P0, -2
-    .fp_eq_pasm(P0, -0.999, EQ2)
-    print P0
-    print "not "
-EQ2:    print "ok 2\\n"
-    end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( << "CODE", << 'OUTPUT', "Basic integer arithmetic: subtraction" );
-    .include 'fp_equality.pasm'
-    new P0, ['Float']
-    set P0, 103.45
-    sub P0, 77
-    .fp_eq_pasm(P0, 26.45, EQ1)
-    print P0
-    print "not "
-EQ1:    print "ok 1\\n"
-
-    sub P0, -24
-    .fp_eq_pasm(P0, 50.45, EQ2)
-    print P0
-    print "not "
-EQ2:    print "ok 2\\n"
-    end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( << "CODE", << 'OUTPUT', "Basic integer arithmetic: multiplication" );
-    .include 'fp_equality.pasm'
-    new P0, ['Float']
-    set P0, 0.001
-    mul P0, 10000
-    .fp_eq_pasm(P0, 10.0, EQ1)
-    print P0
-    print "not "
-EQ1:    print "ok 1\\n"
-
-    mul P0, -1
-    .fp_eq_pasm(P0, -10.0, EQ2)
-    print P0
-    print "not "
-EQ2:    print "ok 2\\n"
-
-    mul P0, 0
-    .fp_eq_pasm(P0, 0.0, EQ3)
-    print P0
-    print "not "
-EQ3:    print "ok 3\\n"
-    end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( << "CODE", << 'OUTPUT', "Basic integer arithmetic: division" );
-    .include 'fp_equality.pasm'
-    new P0, ['Float']
-    set P0, 1e8
-    div P0, 10000
-    .fp_eq_pasm(P0, 10000.0, EQ1)
-    print P0
-    print "not "
-EQ1:    print "ok 1\\n"
-
-    div P0, 1000000
-    .fp_eq_pasm(P0, 0.01, EQ2)
-    print P0
-    print "not "
-EQ2:    print "ok 2\\n"
-    end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( << "CODE", << 'OUTPUT', "Basic numeric arithmetic: addition" );
-    .include 'fp_equality.pasm'
-    new P0, ['Float']
-    set P0, 0.001
-    add P0, 1.2
-    .fp_eq_pasm(P0, 1.201, EQ1)
-    print P0
-    print "not "
-EQ1:    print "ok 1\\n"
-
-    add P0, -2.4
-    .fp_eq_pasm(P0, -1.199, EQ2)
-    print P0
-    print "not "
-EQ2:    print "ok 2\\n"
-    end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( << "CODE", << 'OUTPUT', "Basic numeric arithmetic: subtraction" );
-    .include 'fp_equality.pasm'
-    new P0, ['Float']
-    set P0, 103.45
-    sub P0, 3.46
-    .fp_eq_pasm(P0, 99.99, EQ1)
-    print P0
-    print "not "
-EQ1:    print "ok 1\\n"
-
-    sub P0, -0.01
-    .fp_eq_pasm(P0, 100.00, EQ2)
-    print P0
-    print "not "
-EQ2:    print "ok 2\\n"
-    end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( << "CODE", << 'OUTPUT', "Basic numeric arithmetic: multiplication" );
-    .include 'fp_equality.pasm'
-    new P0, ['Float']
-    set P0, 0.001
-    mul P0, 123.5
-    .fp_eq_pasm(P0, 0.1235, EQ1)
-    print P0
-    print "not "
-EQ1:    print "ok 1\\n"
-
-    mul P0, -2.6
-    .fp_eq_pasm(P0, -0.3211, EQ2)
-    print P0
-    print "not "
-EQ2:    print "ok 2\\n"
-
-    mul P0, 0
-    .fp_eq_pasm(P0, 0.0, EQ3)
-    print P0
-    print "not "
-EQ3:    print "ok 3\\n"
-    end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( << "CODE", << 'OUTPUT', "Basic numeric arithmetic: division" );
-    .include 'fp_equality.pasm'
-    new P0, ['Float']
-    set P0, 1e8
-    div P0, 0.5
-    .fp_eq_pasm(P0, 2e8, EQ1)
-    print P0
-    print "not "
-EQ1:    print "ok 1\\n"
-
-    div P0, 4000.0
-    .fp_eq_pasm(P0, 50000.0, EQ2)
-    print P0
-    print "not "
-EQ2:    print "ok 2\\n"
-    end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( << "CODE", << 'OUTPUT', "Increment & decrement" );
-    .include 'fp_equality.pasm'
-    new P0, ['Float']
-    set P0, 0.5
-    inc P0
-    .fp_eq_pasm(P0, 1.5, EQ1)
-    print P0
-    print "not "
-EQ1:    print "ok 1\\n"
-
-    dec P0
-    .fp_eq_pasm(P0, 0.5, EQ2)
-    print P0
-    print "not "
-EQ2:    print "ok 2\\n"
-
-    dec P0
-    .fp_eq_pasm(P0, -0.5, EQ3)
-    print P0
-    print "not "
-EQ3:    print "ok 3\\n"
-
-    inc P0
-    .fp_eq_pasm(P0, 0.5, EQ4)
-    print P0
-    print "not "
-EQ4:    print "ok 4\\n"
-    end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-OUTPUT
-
-pasm_output_is( << "CODE", << 'OUTPUT', "Neg" );
-    .include 'fp_equality.pasm'
-    new P0, ['Float']
-    set P0, 0.5
-    neg P0
-    .fp_eq_pasm(P0, -0.5, EQ1)
-    print P0
-    print "not "
-EQ1:    print "ok 1\\n"
-
-        new P1, ['Float']
-    neg P1, P0
-    .fp_eq_pasm(P1, 0.5, EQ2)
-    print P1
-    print "not "
-EQ2:    print "ok 2\\n"
-    end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-TODO: {
-    my @todo;
-    @todo = ( todo => '-0.0 not implemented, TT #313' )
-        unless $PConfig{has_negative_zero};
-
-pasm_output_like( <<'CODE', <<'OUTPUT', 'neg 0', @todo );
-    new P0, ['Float']
-    set P0, 0.0
-    neg P0
-    print P0
-    end
-CODE
-/^-0/
-OUTPUT
-}
-
-pasm_output_is( << 'CODE', << 'OUTPUT', "Equality" );
-    new P0, ['Float']
-    set P0, 1e8
-        new P1, ['Float']
-        set P1, 1e8
-        new P2, ['Float']
-        set P2, 2.4
-
-        eq P0, P1, OK1
-        print "not "
-OK1:    print "ok 1\n"
-
-        eq P0, P2, BAD2
-        branch OK2
-BAD2:   print "not "
-OK2:    print "ok 2\n"
-
-        ne P0, P2, OK3
-        print "not "
-OK3:    print "ok 3\n"
-
-        ne P0, P1, BAD4
-        branch OK4
-BAD4:   print "not "
-OK4:    print "ok 4\n"
-
-        eq_num P0, P1, OK5
-        print "not "
-OK5:    print "ok 5\n"
-
-        eq_num P0, P2, BAD6
-        branch OK6
-BAD6:   print "not "
-OK6:    print "ok 6\n"
-
-        ne_num P0, P2, OK7
-        print "not "
-OK7:    print "ok 7\n"
-
-        ne_num P0, P1, BAD8
-        branch OK8
-BAD8:   print "not "
-OK8:    print "ok 8\n"
-    end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-ok 5
-ok 6
-ok 7
-ok 8
-OUTPUT
+    nok(float_1, 'Falseness of 0.000')
+.end
 
-pir_output_is( << 'CODE', << 'OUTPUT', "check whether interface is done" );
+.sub 'integer_addition'
+    $P0 = new ['Float']
 
-.sub _main
-    .local pmc pmc1
-    pmc1 = new ['Float']
-    .local int bool1
-    does bool1, pmc1, "scalar"
-    print bool1
-    print "\n"
-    does bool1, pmc1, "float"
-    print bool1
-    print "\n"
-    does bool1, pmc1, "no_interface"
-    print bool1
-    print "\n"
-    end
-.end
-CODE
-1
-1
-0
-OUTPUT
-
-pasm_output_is( << "CODE", << 'OUTPUT', "Abs" );
-    .include 'fp_equality.pasm'
-    new P0, ['Float']
-    set P0, 1.0
-    abs P0
-        eq P0, P0, OK1
-    print P0
-    print "not "
-OK1:    print "ok 1\\n"
-
-        set P0, -1.0
-        abs P0
-    .fp_eq_pasm(P0, 1.0, OK2)
-    print P0
-    print "not "
-OK2:    print "ok 2\\n"
-
-        new P1, ['Float']
-        set P0, -5.0
-        abs P1, P0
-        .fp_eq_pasm(P1, 5.0, OK3)
-    print P1
-    print "not "
-OK3:    print "ok 3\\n"
-    end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( << 'CODE', << 'OUTPUT', "comparison ops: lt" );
-        new P1, ['Float']
-        set P1, 111.1
-        set N1, P1
-
-        lt P1, 111.2, OK1
-        print "not "
-OK1:    print "ok 1\n"
-
-        lt P1, N1, BAD2
-        branch OK2
-BAD2:   print "not "
-OK2:    print "ok 2\n"
-
-        lt P1, 111.0, BAD3
-        branch OK3
-BAD3:   print "not "
-OK3:    print "ok 3\n"
-        end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( << 'CODE', << 'OUTPUT', "comparison ops: lt_num" );
-        new P1, ['Float']
-        set P1, 1.1
-        new P2, ['Float']
-        set P2, 1.2
-        new P3, ['Float']
-        set P3, 1.0
-        new P4, ['Float']
-        set P4, P1
-
-        lt_num P1, P2, OK1
-        print "not "
-OK1:    print "ok 1\n"
-
-        lt_num P1, P4, BAD2
-        branch OK2
-BAD2:   print "not "
-OK2:    print "ok 2\n"
-
-        lt_num P1, P3, BAD3
-        branch OK3
-BAD3:   print "not "
-OK3:    print "ok 3\n"
-        end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( << 'CODE', << 'OUTPUT', "comparison ops: le" );
-        new P1, ['Float']
-        set P1, 111.1
-        set N1, P1
-
-        le P1, 111.2, OK1
-        print "not "
-OK1:    print "ok 1\n"
-
-        le P1, N1, OK2
-        print "not "
-OK2:    print "ok 2\n"
-
-        le P1, 111.0, BAD3
-        branch OK3
-BAD3:   print "not "
-OK3:    print "ok 3\n"
-        end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( << 'CODE', << 'OUTPUT', "comparison ops: le_num" );
-        new P1, ['Float']
-        set P1, 1.1
-        new P2, ['Float']
-        set P2, 1.2
-        new P3, ['Float']
-        set P3, 1.0
-        new P4, ['Float']
-        set P4, P1
-
-        le_num P1, P2, OK1
-        print "not "
-OK1:    print "ok 1\n"
-
-        le_num P1, P4, OK2
-        print "not "
-OK2:    print "ok 2\n"
-
-        le_num P1, P3, BAD3
-        branch OK3
-BAD3:   print "not "
-OK3:    print "ok 3\n"
-        end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( << 'CODE', << 'OUTPUT', "comparison ops: gt" );
-        new P1, ['Float']
-        set P1, 111.1
-        set N1, P1
-
-        gt P1, 111.2, BAD1
-        branch OK1
-BAD1:   print "not "
-OK1:    print "ok 1\n"
-
-        gt P1, N1, OK2
-        branch OK2
-BAD2:   print "not "
-OK2:    print "ok 2\n"
-
-        gt P1, 111.0, OK3
-        print "not "
-OK3:    print "ok 3\n"
-        end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( << 'CODE', << 'OUTPUT', "comparison ops: gt_num" );
-        new P1, ['Float']
-        set P1, 1.1
-        new P2, ['Float']
-        set P2, 1.2
-        new P3, ['Float']
-        set P3, 1.0
-        new P4, ['Float']
-        set P4, P1
-
-        gt_num P1, P2, BAD1
-        branch OK1
-BAD1:   print "not "
-OK1:    print "ok 1\n"
-
-        gt_num P1, P4, OK2
-        branch OK2
-BAD2:   print "not "
-OK2:    print "ok 2\n"
-
-        gt_num P1, P3, OK3
-        print "not "
-OK3:    print "ok 3\n"
-        end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( << 'CODE', << 'OUTPUT', "comparison ops: ge" );
-        new P1, ['Float']
-        set P1, 111.1
-        set N1, P1
-
-        ge P1, 111.2, BAD1
-        branch OK1
-BAD1:   print "not "
-OK1:    print "ok 1\n"
-
-        ge P1, N1, OK2
-        print "not "
-OK2:    print "ok 2\n"
-
-        ge P1, 111.0, OK3
-        print "not "
-OK3:    print "ok 3\n"
-        end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( << 'CODE', << 'OUTPUT', "comparison ops: ge_num" );
-        new P1, ['Float']
-        set P1, 1.1
-        new P2, ['Float']
-        set P2, 1.2
-        new P3, ['Float']
-        set P3, 1.0
-        new P4, ['Float']
-        set P4, P1
-
-        ge_num P1, P2, BAD1
-        branch OK1
-BAD1:   print "not "
-OK1:    print "ok 1\n"
-
-        ge_num P1, P4, OK2
-        print "not "
-OK2:    print "ok 2\n"
-
-        ge_num P1, P3, OK3
-        print "not "
-OK3:    print "ok 3\n"
-        end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( << 'CODE', << 'OUTPUT', "comparison ops: cmp_p_n" );
-        new P1, ['Float']
-        set P1, 123.45
-        set N1, 123.45
-        set N2, -1.0
-        set N3, 123.54
-
-        cmp I0, P1, N1
-        print I0
-        print "\n"
-        cmp I0, P1, N2
-        print I0
-        print "\n"
-        cmp I0, P1, N3
-        print I0
-        print "\n"
-        end
-CODE
-0
-1
--1
-OUTPUT
-
-pasm_output_is( << 'CODE', << 'OUTPUT', "comparison ops: isgt" );
-        new P1, ['Float']
-        new P2, ['Float']
-        new P3, ['Float']
-        new P4, ['Integer']
-        new P5, ['Integer']
-        new P6, ['Float']
-
-        set P1, 10.0
-        set P2, 20.0
-        set P3, 5.0
-        set P4, 3
-        set P5, 12
-        set P6, 10.0
-
-        isgt I0, P1, P2
-        print I0
-        print "\n"
-        isgt I0, P1, P1
-        print I0
-        print "\n"
-        isgt I0, P1, P3
-        print I0
-        print "\n"
-        isgt I0, P1, P4
-        print I0
-        print "\n"
-        isgt I0, P1, P5
-        print I0
-        print "\n"
-        isgt I0, P1, P6
-        print I0
-        print "\n"
-        end
-CODE
-0
-0
-1
-1
-0
-0
-OUTPUT
-
-pasm_output_is( << 'CODE', << 'OUTPUT', "comparison ops: isge" );
-        new P1, ['Float']
-        new P2, ['Float']
-        new P3, ['Float']
-        new P4, ['Integer']
-        new P5, ['Integer']
-        new P6, ['Float']
-
-        set P1, 10.0
-        set P2, 20.0
-        set P3, 5.0
-        set P4, 3
-        set P5, 12
-        set P6, 10.0
-
-        isge I0, P1, P2
-        print I0
-        print "\n"
-        isge I0, P1, P1
-        print I0
-        print "\n"
-        isge I0, P1, P3
-        print I0
-        print "\n"
-        isge I0, P1, P4
-        print I0
-        print "\n"
-        isge I0, P1, P5
-        print I0
-        print "\n"
-        isge I0, P1, P6
-        print I0
-        print "\n"
-        end
-CODE
-0
-1
-1
-1
-0
-1
-OUTPUT
-
-pasm_output_is( << 'CODE', << 'OUTPUT', "comparison ops: islt" );
-        new P1, ['Float']
-        new P2, ['Float']
-        new P3, ['Float']
-        new P4, ['Integer']
-        new P5, ['Integer']
-        new P6, ['Float']
-
-        set P1, 10.0
-        set P2, 20.0
-        set P3, 5.0
-        set P4, 3
-        set P5, 12
-        set P6, 10.0
-
-        islt I0, P1, P2
-        print I0
-        print "\n"
-        islt I0, P1, P1
-        print I0
-        print "\n"
-        islt I0, P1, P3
-        print I0
-        print "\n"
-        islt I0, P1, P4
-        print I0
-        print "\n"
-        islt I0, P1, P5
-        print I0
-        print "\n"
-        islt I0, P1, P6
-        print I0
-        print "\n"
-        end
-CODE
-1
-0
-0
-0
-1
-0
-OUTPUT
-
-pasm_output_is( << 'CODE', << 'OUTPUT', "comparison ops: isle" );
-        new P1, ['Float']
-        new P2, ['Float']
-        new P3, ['Float']
-        new P4, ['Integer']
-        new P5, ['Integer']
-        new P6, ['Float']
-
-        set P1, 10.0
-        set P2, 20.0
-        set P3, 5.0
-        set P4, 3
-        set P5, 12
-        set P6, 10.0
-
-        isle I0, P1, P2
-        print I0
-        print "\n"
-        isle I0, P1, P1
-        print I0
-        print "\n"
-        isle I0, P1, P3
-        print I0
-        print "\n"
-        isle I0, P1, P4
-        print I0
-        print "\n"
-        isle I0, P1, P5
-        print I0
-        print "\n"
-        isle I0, P1, P6
-        print I0
-        print "\n"
-        end
-CODE
-1
-1
-0
-0
-1
-1
-OUTPUT
-
-pasm_output_is( << 'CODE', << 'OUTPUT', "comparison ops: iseq" );
-        new P1, ['Float']
-        new P2, ['Float']
-        new P3, ['Float']
-        new P4, ['Integer']
-
-        set P1, 2.5
-        set P2, 2.6
-        set P3, 2.5
-        set P4, 2
-
-        iseq I0, P1, P1
-        print I0
-        print "\n"
-        iseq I0, P1, P2
-        print I0
-        print "\n"
-        iseq I0, P1, P3
-        print I0
-        print "\n"
-        iseq I0, P1, P4
-        print I0
-        print "\n"
-        end
-CODE
-1
-0
-1
-0
-OUTPUT
-
-pasm_output_is( << 'CODE', << 'OUTPUT', "comparison ops: isne" );
-        new P1, ['Float']
-        new P2, ['Float']
-        new P3, ['Float']
-        new P4, ['Integer']
-
-        set P1, 2.5
-        set P2, 2.6
-        set P3, 2.5
-        set P4, 2
-
-        isne I0, P1, P1
-        print I0
-        print "\n"
-        isne I0, P1, P2
-        print I0
-        print "\n"
-        isne I0, P1, P3
-        print I0
-        print "\n"
-        isne I0, P1, P4
-        print I0
-        print "\n"
-        end
-CODE
-0
-1
-0
-1
-OUTPUT
+    $P0 = 0.001
+    $P0 += 1
+    is($P0, 1.001, 'Basic integer arithmetic: addition (1)', PRECISION)
 
-pir_output_is( <<'CODE', <<OUTPUT, "instantiate_str" );
-.sub main :main
-    .const 'Float' pi = "3.1"
-    print pi
-    print "\n"
+    $P0 += -2
+    is($P0, -0.999, 'Basic integer arithmetic: addition (2)', PRECISION)
 .end
-CODE
-3.1
-OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'cmp functions for subclasses' );
-.sub main :main
-    $P0 = subclass 'Float', 'Flt'
+.sub 'integer_substraction'
+    $P0 = new ['Float']
 
-    $P1 = new ['Flt']
-    $P1 = 1.5
-    $P2 = new ['Flt']
-    $P2 = 2.73
+    $P0 = 103.45
+    $P0 -= 77
+    is($P0, 26.45, 'Basic integer arithmetic: subtraction (1)', PRECISION)
 
-    $I0 = cmp $P1, $P2
-    say $I0
-    $I0 = cmp $P1, $P1
-    say $I0
-    $I0 = cmp $P2, $P1
-    say $I0
+    $P0 -= -24
+    is($P0, 50.45, 'Basic integer arithmetic: subtraction (2)', PRECISION)
 .end
-CODE
--1
-0
-1
-OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'acos as a method' );
-.include 'fp_equality.pasm'
-.sub main :main
-    .local pmc array
-    array = new 'FixedFloatArray'
-    array = 2
+.sub 'integer_multiplication'
     $P0 = new ['Float']
-    $P0 = 0.0
-    $P1 = $P0.'acos'()
-    array[0] = $P0
-    array[1] = $P1
-    $S0 = sprintf "acos(%.1f) is %.9f", array
-    say $S0
 
-    $P2 = new ['Float']
-    $P2 = 0.5
-    $P3 = $P2.'acos'()
-    array[0] = $P2
-    array[1] = $P3
-    $S0 = sprintf "acos(%.1f) is %.9f", array
-    say $S0
-.end
-CODE
-acos(0.0) is 1.570796327
-acos(0.5) is 1.047197551
-OUTPUT
+    $P0 = 0.001
+    $P0 *= 10000
+    is($P0, 10.0, 'Basic integer arithmetic: multiplication (1)', PRECISION)
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'cos as a method' );
-.include 'fp_equality.pasm'
-.sub main :main
-    .local pmc array
-    array = new 'FixedFloatArray'
-    array = 2
+    $P0 *= -1
+    is($P0, -10.0, 'Basic integer arithmetic: multiplication (2)', PRECISION)
+
+    $P0 *= 0
+    is($P0, 0.0, 'Basic integer arithmetic: multiplication (3)', PRECISION)
+.end
+
+.sub 'integer_division'
     $P0 = new ['Float']
-    $P0 = 0.0
-    $P1 = $P0.'cos'()
-    array[0] = $P0
-    array[1] = $P1
-    $S0 = sprintf "cos(%.1f) is %.9f", array
-    say $S0
 
-    $P2 = new ['Float']
-    $P2 = 0.5
-    $P3 = $P2.'cos'()
-    array[0] = $P2
-    array[1] = $P3
-    $S0 = sprintf "cos(%.1f) is %.9f", array
-    say $S0
-.end
-CODE
-cos(0.0) is 1.000000000
-cos(0.5) is 0.877582562
-OUTPUT
+    $P0 = 1e8
+    $P0 /= 10000
+    is($P0, 10000.0, 'Basic integer arithmetic: division (1)', PRECISION)
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'asec as a method' );
-.include 'fp_equality.pasm'
-.sub main :main
-    .local pmc array
-    array = new 'FixedFloatArray'
-    array = 2
+    $P0 /= 1000000
+    is($P0, 0.01, 'Basic integer arithmetic: division (2)', PRECISION)
+.end
+
+.sub 'number_addition'
     $P0 = new ['Float']
-    $P0 = 1.0
-    $P1 = $P0.'asec'()
-    array[0] = $P0
-    array[1] = $P1
-    $S0 = sprintf "asec(%.1f) is %.9f", array
-    say $S0
 
-    $P2 = new ['Float']
-    $P2 = 3.0
-    $P3 = $P2.'asec'()
-    array[0] = $P2
-    array[1] = $P3
-    $S0 = sprintf "asec(%.1f) is %.9f", array
-    say $S0
-.end
-CODE
-asec(1.0) is 0.000000000
-asec(3.0) is 1.230959417
-OUTPUT
+    $P0 = 0.001
+    $P0 += 1.2
+    is($P0, 1.201, 'Basic numeric arithmetic: addition (1)', PRECISION)
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'asin as a method' );
-.include 'fp_equality.pasm'
-.sub main :main
-    .local pmc array
-    array = new 'FixedFloatArray'
-    array = 2
+    $P0 += -2.4
+    is($P0, -1.199, 'Basic numeric arithmetic: addition (2)', PRECISION)
+.end
+
+.sub 'number_substraction'
     $P0 = new ['Float']
-    $P0 = 0.0
-    $P1 = $P0.'asin'()
-    array[0] = $P0
-    array[1] = $P1
-    $S0 = sprintf "asin(%.1f) is %.9f", array
-    say $S0
 
-    $P2 = new ['Float']
-    $P2 = 0.5
-    $P3 = $P2.'asin'()
-    array[0] = $P2
-    array[1] = $P3
-    $S0 = sprintf "asin(%.1f) is %.9f", array
-    say $S0
-.end
-CODE
-asin(0.0) is 0.000000000
-asin(0.5) is 0.523598776
-OUTPUT
+    $P0 = 103.45
+    $P0 -= 3.46
+    is($P0, 99.99, 'Basic numeric arithmetic: subtraction (1)', PRECISION)
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'atan as a method' );
-.include 'fp_equality.pasm'
-.sub main :main
-    .local pmc array
-    array = new 'FixedFloatArray'
-    array = 2
+    $P0 -= -0.01
+    is($P0, 100.0, 'Basic numeric arithmetic: subtraction (2)', PRECISION)
+.end
+
+.sub 'number_multiplication'
     $P0 = new ['Float']
-    $P0 = 0.0
-    $P1 = $P0.'atan'()
-    array[0] = $P0
-    array[1] = $P1
-    $S0 = sprintf "atan(%.1f) is %.9f", array
-    say $S0
 
-    $P2 = new ['Float']
-    $P2 = 0.5
-    $P3 = $P2.'atan'()
-    array[0] = $P2
-    array[1] = $P3
-    $S0 = sprintf "atan(%.1f) is %.9f", array
-    say $S0
-.end
-CODE
-atan(0.0) is 0.000000000
-atan(0.5) is 0.463647609
-OUTPUT
+    $P0 = 0.001
+    $P0 *= 123.5
+    is($P0, 0.1235, 'Basic numeric arithmetic: multiplication (1)', PRECISION)
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'atan2 as a method' );
-.include 'fp_equality.pasm'
-.sub main :main
-    .local pmc array
-    array = new 'FixedFloatArray'
-    array = 3
+    $P0 *= -2.6
+    is($P0, -0.3211, 'Basic numeric arithmetic: multiplication (2)', PRECISION)
+
+    $P0 *= 0.0
+    is($P0, 0.0, 'Basic numeric arithmetic: multiplication (3)', PRECISION)
+.end
+
+.sub 'number_division'
+    $P0 = new ['Float']
+
+    $P0 = 1e8
+    $P0 /= 0.5
+    is($P0, 2e8, 'Basic numeric arithmetic: division (1)', PRECISION)
+
+    $P0 /= 4000.0
+    is($P0, 50000.0, 'Basic numeric arithmetic: division (2)', PRECISION)
+.end
+
+.sub 'increment_decrement'
+    $P0 = new ['Float']
+
+    $P0 = 0.5
+    inc $P0
+    is($P0, 1.5, 'increment (1)', PRECISION)
+    dec $P0
+    is($P0, 0.5, 'decrement (1)', PRECISION)
+    dec $P0
+    is($P0, -.5, 'decrement (2)', PRECISION)
+    inc $P0
+    is($P0, 0.5, 'increment (2)', PRECISION)
+.end
+
+.sub 'neg'
     $P0 = new ['Float']
+    $P0 = 0.5
+    neg $P0
+    is($P0, -0.5, 'Neg', PRECISION)
+
     $P1 = new ['Float']
-    $P0 = 0.7
-    $P1 = 0.5
-    $P2 = $P0.'atan2'($P1)
-    array[0] = $P0
-    array[1] = $P1
-    array[2] = $P2
-    $S0 = sprintf "atan2(%.1f, %.1f) is %.9f", array
-    say $S0
-.end
-CODE
-atan2(0.7, 0.5) is 0.950546841
-OUTPUT
+    $P1 = - $P0
+    is($P1, 0.5, 'Neg is involutive', PRECISION)
+.end
+
+.sub 'negative_zero'
+    load_bytecode 'config.pbc'
+    $P1 = _config()
+    $P2 = $P1['has_negative_zero']
+    unless $P2 goto negative_zero_todoed
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'cosh as a method' );
-.include 'fp_equality.pasm'
-.sub main :main
-    .local pmc array
-    array = new 'FixedFloatArray'
-    array = 2
     $P0 = new ['Float']
     $P0 = 0.0
-    $P1 = $P0.'cosh'()
-    array[0] = $P0
-    array[1] = $P1
-    $S0 = sprintf "cosh(%.1f) is %.9f", array
-    say $S0
+    neg $P0
 
-    $P2 = new ['Float']
-    $P2 = 0.5
-    $P3 = $P2.'cosh'()
-    array[0] = $P2
-    array[1] = $P3
-    $S0 = sprintf "cosh(%.1f) is %.9f", array
-    say $S0
-.end
-CODE
-cosh(0.0) is 1.000000000
-cosh(0.5) is 1.127625965
-OUTPUT
+    $S0 = $P0
+    is($S0, "-0")
+    .return ()
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'exp as a method' );
-.include 'fp_equality.pasm'
-.sub main :main
-    .local pmc array
-    array = new 'FixedFloatArray'
-    array = 2
+  negative_zero_todoed:
+    todo(0, '-0.0 not implemented, TT #313')
+.end
+
+.sub 'equality'
     $P0 = new ['Float']
-    $P0 = 0.0
-    $P1 = $P0.'exp'()
-    array[0] = $P0
-    array[1] = $P1
-    $S0 = sprintf "exp(%.1f) is %.9f", array
-    say $S0
+    $P0 = 1e8
+
+    $P1 = new ['Float']
+    $P1 = 1e8
 
     $P2 = new ['Float']
-    $P2 = 0.5
-    $P3 = $P2.'exp'()
-    array[0] = $P2
-    array[1] = $P3
-    $S0 = sprintf "exp(%.1f) is %.9f", array
-    say $S0
-.end
-CODE
-exp(0.0) is 1.000000000
-exp(0.5) is 1.648721271
-OUTPUT
+    $P2 = 2.4
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'ln as a method' );
-.include 'fp_equality.pasm'
-.sub main :main
-    .local pmc array
-    array = new 'FixedFloatArray'
-    array = 2
+    $I0 = 1
+    if $P0 == $P1 goto equality_1
+    $I0 = 0
+  equality_1:
+    ok($I0, 'equal floats')
+
+    $I0 = 0
+    if $P0 == $P2 goto equality_2
+    $I0 = 1
+  equality_2:
+    ok($I0, 'different floats are not equal')
+
+    $I0 = 1
+    if $P0 != $P2 goto equality_3
+    $I0 = 0
+  equality_3:
+    ok($I0, "different floats are different")
+
+    $I0 = 0
+    if $P0 != $P1 goto equality_4
+    $I0 = 1
+  equality_4:
+    ok($I0, "equal floats aren't different")
+
+    $I0 = 1
+    eq_num $P0, $P1, equality_5
+    $I0 = 0
+  equality_5:
+    ok($I0, "equal floats are eq_num")
+
+    $I0 = 0
+    eq_num $P0, $P2, equality_6
+    $I0 = 1
+  equality_6:
+    ok($I0, "different floats aren't eq_num")
+
+    $I0 = 1
+    ne_num $P0, $P2, equality_7
+    $I0 = 0
+  equality_7:
+    ok($I0, "different floats are ne_num")
+
+    $I0 = 0
+    ne_num $P0, $P1, equality_8
+    $I0 = 1
+  equality_8:
+    ok($I0, "equal floats aren't ne_num")
+.end
+
+.sub 'is_interface_done'
+    .local pmc pmc1
+    .local int bool1
+    pmc1 = new ['Float']
+
+    bool1 = does pmc1, "scalar"
+    ok(bool1, 'Float does "scalar"')
+
+    bool1 = does pmc1, "float"
+    ok(bool1, 'Float does "float"')
+
+    bool1 = does pmc1, "no_interface"
+    nok(bool1, 'Float does not "no_interface"')
+.end
+
+.sub 'abs'
     $P0 = new ['Float']
-    $P0 = 45.0
-    $P1 = $P0.'ln'()
-    array[0] = $P0
-    array[1] = $P1
-    $S0 = sprintf "ln(%.1f) is %.9f", array
-    say $S0
+    $P0 = 1.0
+    abs $P0
+    is($P0, $P0, 'abs does not change positive floats')
+
+    $P0 = -1.0
+    abs $P0
+    is($P0, 1.0, 'abs of -1.0', PRECISION)
+
+    $P0 = -5.0
+    abs $P0
+    is($P0, 5.0, 'abs of -5.0', PRECISION)
+.end
+
+.sub 'lt'
+    $P1 = new ['Float']
+    $P1 = 111.11
+    $N1 = $P1
+
+    $I0 = 1
+    lt $P1, 111.12, lt_1
+    $I0 = 0
+  lt_1:
+    ok($I0, 'lt ok')
+
+    $I0 = 0
+    lt $P1, $N1, lt_2
+    $I0 = 1
+  lt_2:
+    ok($I0, 'lt irreflexive')
+
+    $I0 = 0
+    lt $P1, 111.0, lt_3
+    $I0 = 1
+  lt_3:
+    ok($I0, 'not lt')
+.end
+
+.sub 'lt_num'
+    $P1 = new ['Float']
+    $P1 = 1.1
 
     $P2 = new ['Float']
-    $P2 = 0.5
-    $P3 = $P2.'ln'()
-    array[0] = $P2
-    array[1] = $P3
-    $S0 = sprintf "ln(%.1f) is %.9f", array
-    say $S0
-.end
-CODE
-ln(45.0) is 3.806662490
-ln(0.5) is -0.693147181
-OUTPUT
+    $P2 = 1.2
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'log10 as a method' );
-.include 'fp_equality.pasm'
-.sub main :main
-    .local pmc array
-    array = new 'FixedFloatArray'
-    array = 2
-    $P0 = new ['Float']
-    $P0 = 1000.0
-    $P1 = $P0.'log10'()
-    array[0] = $P0
-    array[1] = $P1
-    $S0 = sprintf "log10(%.1f) is %.9f", array
-    say $S0
+    $P3 = new ['Float']
+    $P3 = 1.0
+
+    $P4 = new ['Float']
+    $P4 = $P1
+
+    $I0 = 1
+    lt_num $P1, $P2, lt_num_1
+    $I0 = 0
+  lt_num_1:
+    ok($I0, 'lt_num true')
+
+    $I0 = 0
+    lt_num $P1, $P4, lt_num_2
+    $I0 = 1
+  lt_num_2:
+    ok($I0, 'lt_num irreflexive')
+
+    $I0 = 0
+    lt_num $P1, $P3, lt_num_3
+    $I0 = 1
+  lt_num_3:
+    ok($I0, 'lt_num false')
+.end
+
+.sub 'le'
+    $P1 = new ['Float']
+    $P1 = 111.1
+    $N1 = $P1
+
+    $I0 = 1
+    le $P1, 111.2, le_1
+    $I0 = 0
+  le_1:
+    ok($I0, 'le_p_nc')
+
+    $I0 = 1
+    le $P1, $N1, le_2
+    $I0 = 0
+  le_2:
+    ok($I0, 'le_p_n')
+
+    $I0 = 0
+    le $P1, 111.0, le_3
+    $I0 = 1
+  le_3:
+    ok($I0, 'le_p_nc false')
+
+    $I0 = 1
+    le $P1, $P1, le_4
+    $I0 = 0
+  le_4:
+    ok($I0, 'le reflexive')
+.end
+
+.sub 'le_num'
+    $P1 = new ['Float']
+    $P1 = 1.1
 
     $P2 = new ['Float']
-    $P2 = 0.5
-    $P3 = $P2.'log10'()
-    array[0] = $P2
-    array[1] = $P3
-    $S0 = sprintf "log10(%.1f) is %.9f", array
-    say $S0
-.end
-CODE
-log10(1000.0) is 3.000000000
-log10(0.5) is -0.301029996
-OUTPUT
+    $P2 = 1.2
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'log2 as a method' );
-.include 'fp_equality.pasm'
-.sub main :main
-    .local pmc array
-    array = new 'FixedFloatArray'
-    array = 2
-    $P0 = new ['Float']
-    $P0 = 32.0
-    $P1 = $P0.'log2'()
-    array[0] = $P0
-    array[1] = $P1
-    $S0 = sprintf "log2(%.1f) is %.9f", array
-    say $S0
+    $P3 = new ['Float']
+    $P3 = 1.0
+
+    $P4 = new ['Float']
+    $P4 = $P1
+
+    $I0 = 1
+    le_num $P1, $P2, le_num_1
+    $I0 = 0
+  le_num_1:
+    ok($I0, 'le_num true')
+
+    $I0 = 1
+    le_num $P1, $P4, le_num_2
+    $I0 = 0
+  le_num_2:
+    ok($I0, 'le_num reflexive')
+
+    $I0 = 0
+    le_num $P1, $P3, le_num_3
+    $I0 = 1
+  le_num_3:
+    ok($I0, 'le_num false')
+.end
 
+.sub 'gt'
+    $P1 = new ['Float']
+    $P1 = 111.1
+    $N1 = $P1
+
+    $I0 = 0
+    gt $P1, 111.2, gt_1
+    $I0 = 1
+  gt_1:
+    ok($I0, 'comparison ops: gt nok')
+
+    $I0 = 1
+    gt $P1, $N1, gt_2
+    $I0 = 0
+  gt_2:
+    nok($I0, 'comparison ops: gt irreflexive')
+
+    $I0 = 1
+    gt $P1, 111.0, gt_3
+    $I0 = 0
+  gt_3:
+    ok($I0, 'comparison ops: gt ok')
+.end
+
+.sub 'gt_num'
+    $P1 = new ['Float']
     $P2 = new ['Float']
-    $P2 = 0.5
-    $P3 = $P2.'log2'()
-    array[0] = $P2
-    array[1] = $P3
-    $S0 = sprintf "log2(%.1f) is %.9f", array
-    say $S0
-.end
-CODE
-log2(32.0) is 5.000000000
-log2(0.5) is -1.000000000
-OUTPUT
+    $P3 = new ['Float']
+    $P4 = new ['Float']
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'sec as a method' );
-.include 'fp_equality.pasm'
-.sub main :main
-    .local pmc array
-    array = new 'FixedFloatArray'
-    array = 2
-    $P0 = new ['Float']
-    $P0 = 0.0
-    $P1 = $P0.'sec'()
-    array[0] = $P0
-    array[1] = $P1
-    $S0 = sprintf "sec(%.1f) is %.9f", array
-    say $S0
+    $P1 = 1.1
+    $P2 = 1.2
+    $P3 = 1.0
+    $P4 = $P1
+
+    $I0 = 0
+    gt_num $P1, $P2, gt_num_1
+    $I0 = 1
+  gt_num_1:
+    ok($I0, 'comparison ops: gt_num nok')
+
+    $I0 = 0
+    gt_num $P1, $P4, gt_num_2
+    $I0 = 1
+  gt_num_2:
+    ok($I0, 'comparison ops: gt_num irreflexive')
+
+    $I0 = 1
+    gt_num $P1, $P3, gt_num_3
+    $I0 = 0
+  gt_num_3:
+    ok($I0, 'comparison ops: gt_num ok')
+.end
 
+.sub 'ge'
+    $P1 = new ['Float']
+    $P1 = 111.1
+    $N1 = $P1
+
+    $I0 = 0
+    ge $P1, 111.2, ge_1
+    $I0 = 1
+  ge_1:
+    ok($I0, 'comparison ops: ge nok')
+
+    $I0 = 1
+    ge $P1, $N1, ge_2
+    $I0 = 0
+  ge_2:
+    ok($I0, 'comparison ops: ge reflexive')
+
+    $I0 = 1
+    ge $P1, 111.0, ge_3
+    $I0 = 0
+  ge_3:
+    ok($I0, 'comparison ops: ge ok')
+.end
+
+.sub 'ge_num'
+    $P1 = new ['Float']
     $P2 = new ['Float']
-    $P2 = 0.5
-    $P3 = $P2.'sec'()
-    array[0] = $P2
-    array[1] = $P3
-    $S0 = sprintf "sec(%.1f) is %.9f", array
-    say $S0
-.end
-CODE
-sec(0.0) is 1.000000000
-sec(0.5) is 1.139493927
-OUTPUT
+    $P3 = new ['Float']
+    $P4 = new ['Float']
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'sech as a method' );
-.include 'fp_equality.pasm'
-.sub main :main
-    .local pmc array
-    array = new 'FixedFloatArray'
-    array = 2
-    $P0 = new ['Float']
-    $P0 = 0.0
-    $P1 = $P0.'sech'()
-    array[0] = $P0
-    array[1] = $P1
-    $S0 = sprintf "sech(%.1f) is %.9f", array
-    say $S0
+    $P1 = 1.1
+    $P2 = 1.2
+    $P3 = 1.0
+    $P4 = $P1
+
+    $I0 = 0
+    ge_num $P1, $P2, ge_num_1
+    $I0 = 1
+  ge_num_1:
+    ok($I0, 'comparison ops: ge_num nok')
+
+    $I0 = 1
+    ge_num $P1, $P4, ge_num_2
+    $I0 = 0
+  ge_num_2:
+    ok($I0, 'comparison ops: ge_num reflexive')
+
+    $I0 = 1
+    ge_num $P1, $P3, ge_num_3
+    $I0 = 0
+  ge_num_3:
+    ok($I0, 'comparison ops: ge_num ok')
+.end
 
+.sub 'cmp_p_n'
+    $P1 = new ['Float']
+    $P1 = 123.45
+    $N1 = 123.45
+    $N2 = -1.0
+    $N3 = 123.54
+
+    $I0 = cmp $P1, $N1
+    is($I0, 0, 'comparison ops: cmp_p_n: equality')
+
+    $I0 = cmp $P1, $N2
+    is($I0, 1, 'comparison ops: cmp_p_n: gt')
+
+    $I0 = cmp $P1, $N3
+    is($I0, -1, 'comparison ops: cmp_p_n: lt')
+.end
+
+.sub 'isgt'
+    $P1 = new ['Float']
     $P2 = new ['Float']
-    $P2 = 0.5
-    $P3 = $P2.'sech'()
-    array[0] = $P2
-    array[1] = $P3
-    $S0 = sprintf "sech(%.1f) is %.9f", array
-    say $S0
-.end
-CODE
-sech(0.0) is 1.000000000
-sech(0.5) is 0.886818884
-OUTPUT
+    $P3 = new ['Float']
+    $P4 = new ['Integer']
+    $P5 = new ['Integer']
+    $P6 = new ['Float']
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'sin as a method' );
-.include 'fp_equality.pasm'
-.sub main :main
-    .local pmc array
-    array = new 'FixedFloatArray'
-    array = 2
-    $P0 = new ['Float']
-    $P0 = 0.0
-    $P1 = $P0.'sin'()
-    array[0] = $P0
-    array[1] = $P1
-    $S0 = sprintf "sin(%.1f) is %.9f", array
-    say $S0
+    $P1 = 10.0
+    $P2 = 20.0
+    $P3 = 5.0
+    $P4 = 3
+    $P5 = 12
+    $P6 = 10.0
+
+    $I0 = isgt $P1, $P2
+    nok($I0, 'comparison ops: isgt nok')
+
+    $I0 = isgt $P1, $P1
+    nok($I0, 'comparison ops: isgt irreflexive')
+
+    $I0 = isgt $P1, $P3
+    ok($I0, 'comparison ops: isgt ok')
+
+    $I0 = isgt $P1, $P4
+    ok($I0, 'comparison ops: isgt ok with Float and Integer')
 
+    $I0 = isgt $P1, $P5
+    nok($I0, 'comparison ops: isgt nok with Float and Integer')
+
+    $I0 = isgt $P1, $P6
+    nok($I0, 'comparison ops: isgt irreflexive (different PMCs)')
+.end
+
+.sub 'isge'
+    $P1 = new ['Float']
     $P2 = new ['Float']
-    $P2 = 0.5
-    $P3 = $P2.'sin'()
-    array[0] = $P2
-    array[1] = $P3
-    $S0 = sprintf "sin(%.1f) is %.9f", array
-    say $S0
-.end
-CODE
-sin(0.0) is 0.000000000
-sin(0.5) is 0.479425539
-OUTPUT
+    $P3 = new ['Float']
+    $P4 = new ['Integer']
+    $P5 = new ['Integer']
+    $P6 = new ['Float']
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'sinh as a method' );
-.include 'fp_equality.pasm'
-.sub main :main
-    .local pmc array
-    array = new 'FixedFloatArray'
-    array = 2
-    $P0 = new ['Float']
-    $P0 = 0.0
-    $P1 = $P0.'sinh'()
-    array[0] = $P0
-    array[1] = $P1
-    $S0 = sprintf "sinh(%.1f) is %.9f", array
-    say $S0
+    $P1 = 10.0
+    $P2 = 20.0
+    $P3 = 5.0
+    $P4 = 3
+    $P5 = 12
+    $P6 = 10.0
+
+    $I0 = isge $P1, $P2
+    nok($I0, 'comparison ops: isge nok')
+
+    $I0 = isge $P1, $P1
+    ok($I0, 'comparison ops: isge reflexive')
+
+    $I0 = isge $P1, $P3
+    ok($I0, 'comparison ops: isge ok')
+
+    $I0 = isge $P1, $P4
+    ok($I0, 'comparison ops: isge ok with Float and Integer')
+
+    $I0 = isge $P1, $P5
+    nok($I0, 'comparison ops: isge nok with Float and Integer')
+
+    $I0 = isge $P1, $P6
+    ok($I0, 'comparison ops: isge reflexive (different PMCs)')
+.end
 
+.sub 'islt'
+    $P1 = new ['Float']
     $P2 = new ['Float']
-    $P2 = 0.5
-    $P3 = $P2.'sinh'()
-    array[0] = $P2
-    array[1] = $P3
-    $S0 = sprintf "sinh(%.1f) is %.9f", array
-    say $S0
-.end
-CODE
-sinh(0.0) is 0.000000000
-sinh(0.5) is 0.521095305
-OUTPUT
+    $P3 = new ['Float']
+    $P4 = new ['Integer']
+    $P5 = new ['Integer']
+    $P6 = new ['Float']
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'tan as a method' );
-.include 'fp_equality.pasm'
-.sub main :main
-    .local pmc array
-    array = new 'FixedFloatArray'
-    array = 2
-    $P0 = new ['Float']
-    $P0 = 0.0
-    $P1 = $P0.'tan'()
-    array[0] = $P0
-    array[1] = $P1
-    $S0 = sprintf "tan(%.1f) is %.9f", array
-    say $S0
+    $P1 = 10.0
+    $P2 = 20.0
+    $P3 = 5.0
+    $P4 = 3
+    $P5 = 12
+    $P6 = 10.0
+
+    $I0 = islt $P1, $P2
+    ok($I0, 'comparison ops: islt ok')
+
+    $I0 = islt $P1, $P1
+    nok($I0, 'comparison ops: islt irreflexive')
+
+    $I0 = islt $P1, $P3
+    nok($I0, 'comparison ops: islt nok')
+
+    $I0 = islt $P1, $P4
+    nok($I0, 'comparison ops: islt nok with Float and Integer')
 
+    $I0 = islt $P1, $P5
+    ok($I0, 'comparison ops: islt ok with Float and Integer')
+
+    $I0 = islt $P1, $P6
+    nok($I0, 'comparison ops: islt irreflexive (different PMCs)')
+.end
+
+.sub 'isle'
+    $P1 = new ['Float']
     $P2 = new ['Float']
-    $P2 = 0.5
-    $P3 = $P2.'tan'()
-    array[0] = $P2
-    array[1] = $P3
-    $S0 = sprintf "tan(%.1f) is %.9f", array
-    say $S0
-.end
-CODE
-tan(0.0) is 0.000000000
-tan(0.5) is 0.546302490
-OUTPUT
+    $P3 = new ['Float']
+    $P4 = new ['Integer']
+    $P5 = new ['Integer']
+    $P6 = new ['Float']
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'tanh as a method' );
-.include 'fp_equality.pasm'
-.sub main :main
-    .local pmc array
-    array = new 'FixedFloatArray'
-    array = 2
-    $P0 = new ['Float']
-    $P0 = 0.0
-    $P1 = $P0.'tanh'()
-    array[0] = $P0
-    array[1] = $P1
-    $S0 = sprintf "tanh(%.1f) is %.9f", array
-    say $S0
+    $P1 = 10.0
+    $P2 = 20.0
+    $P3 = 5.0
+    $P4 = 3
+    $P5 = 12
+    $P6 = 10.0
+
+    $I0 = isle $P1, $P2
+    ok($I0, 'comparison ops: isle ok')
+
+    $I0 = isle $P1, $P1
+    ok($I0, 'comparison ops: isle reflexive')
 
+    $I0 = isle $P1, $P3
+    nok($I0, 'comparison ops: isle nok')
+
+    $I0 = isle $P1, $P4
+    nok($I0, 'comparison ops: isle nok with Float and Integer')
+
+    $I0 = isle $P1, $P5
+    ok($I0, 'comparison ops: isle ok with Float and Integer')
+
+    $I0 = isle $P1, $P6
+    ok($I0, 'comparison ops: isle reflexive (different PMCs)')
+.end
+
+.sub 'iseq'
+    $P1 = new ['Float']
     $P2 = new ['Float']
-    $P2 = 0.5
-    $P3 = $P2.'tanh'()
-    array[0] = $P2
-    array[1] = $P3
-    $S0 = sprintf "tanh(%.1f) is %.9f", array
-    say $S0
-.end
-CODE
-tanh(0.0) is 0.000000000
-tanh(0.5) is 0.462117157
-OUTPUT
+    $P3 = new ['Float']
+    $P4 = new ['Integer']
+
+    $P1 = 2.5
+    $P2 = 2.6
+    $P3 = 2.5
+    $P4 = 2
+
+    $I0 = iseq $P1, $P1
+    ok($I0, 'iseq reflexive, same PMC')
+
+    $I0 = iseq $P1, $P3
+    ok($I0, 'iseq reflexive, different PMCs')
+
+    $I0 = iseq $P1, $P2
+    nok($I0, 'iseq nok with two Floats')
+
+    $I0 = iseq $P1, $P4
+    nok($I0, 'iseq nok between an Integer and a Float')
+.end
+
+.sub 'isne'
+    $P1 = new ['Float']
+    $P2 = new ['Float']
+    $P3 = new ['Float']
+    $P4 = new ['Integer']
+
+    $P1 = 2.5
+    $P2 = 2.6
+    $P3 = 2.5
+    $P4 = 2
+
+    $I0 = isne $P1, $P1
+    nok($I0, 'isne irreflexive, same PMC')
+
+    $I0 = isne $P1, $P3
+    nok($I0, 'isne irreflexive, different PMCs')
+
+    $I0 = isne $P1, $P2
+    ok($I0, 'isne ok with two Floats')
+
+    $I0 = isne $P1, $P4
+    ok($I0, 'isne ok between an Integer and a Float')
+.end
+
+.sub 'instantiate_str'
+    .const 'Float' pi = "3.1"
+    $P1 = get_class ['Float']
+    isa_ok(pi, $P1)
+    is(pi, 3.1, 'instantiate_str', PRECISION)
+.end
+
+.sub 'cmp_subclasses'
+    $P0 = subclass 'Float', 'Flt'
+
+    $P1 = new ['Flt']
+    $P1 = 1.5
+
+    $P2 = new ['Flt']
+    $P2 = 2.73
+
+    $I0 = cmp $P1, $P2
+    is(-1, $I0, 'cmp functions for subclasses (lt)')
+
+    $I0 = cmp $P1, $P1
+    is(0, $I0, 'cmp functions for subclasses (eq)')
+
+    $I0 = cmp $P2, $P1
+    is(1, $I0, 'cmp functions for subclasses (gt)')
+.end
+
+.sub 'test_method'
+    .param string method
+    .param num number
+    .param num expected
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'sqrt as a method' );
-.include 'fp_equality.pasm'
-.sub main :main
     .local pmc array
-    array = new 'FixedFloatArray'
-    array = 2
+    array = new 'FixedPMCArray'
+    array = 3
+    array[0] = method
+    array[1] = number
+    array[2] = expected
+
     $P0 = new ['Float']
-    $P0 = 16.0
-    $P1 = $P0.'sqrt'()
-    array[0] = $P0
-    array[1] = $P1
-    $S0 = sprintf "sqrt(%.1f) is %.9f", array
-    say $S0
+    $P0 = number
+    $P1 = $P0.method()
 
-    $P2 = new ['Float']
-    $P2 = 2.0
-    $P3 = $P2.'sqrt'()
-    array[0] = $P2
-    array[1] = $P3
-    $S0 = sprintf "sqrt(%.1f) is %.9f", array
-    say $S0
-.end
-CODE
-sqrt(16.0) is 4.000000000
-sqrt(2.0) is 1.414213562
-OUTPUT
+    $S0 = sprintf '%s(%.1f) is %.9f', array
+    is($P1, expected, $S0, PRECISION)
+.end
+
+.sub 'acos_method'
+    test_method('acos', 0.0, 1.570796327)
+    test_method('acos', 0.5, 1.047197551)
+.end
+
+.sub 'cos_method'
+    test_method('cos', 0.0, 1.0)
+    test_method('cos', 0.5, 0.877582562)
+.end
+
+.sub 'asec_method'
+    test_method('asec', 1.0, 0.0)
+    test_method('asec', 3.0, 1.230959417)
+.end
+
+.sub 'asin_method'
+    test_method('asin', 0.0, 0.0)
+    test_method('asin', 0.5, 0.523598776)
+.end
+
+.sub 'atan_method'
+    test_method('atan', 0.0, 0.0)
+    test_method('atan', 0.5, 0.463647609)
+.end
+
+.sub 'atan2_method'
+    $P0 = new ['Float']
+    $P1 = new ['Float']
+
+    $P0 = 0.7
+    $P1 = 0.5
+
+    $P2 = $P0.'atan2'($P1)
+    is($P2, 0.950546841, 'atan2 as a method', PRECISION)
+.end
+
+.sub 'cosh_method'
+    test_method('cosh', 0.0, 1.0)
+    test_method('cosh', 0.5, 1.127625965)
+.end
+
+.sub 'exp_method'
+    test_method('exp', 0.0, 1.0)
+    test_method('exp', 0.5, 1.648721271)
+.end
 
+.sub 'ln_method'
+    test_method('ln', 1.0, 0.0)
+    test_method('ln', 45.0, 3.806662490)
+    test_method('ln', 0.5, -0.693147181)
+.end
+
+.sub 'log10_method'
+    test_method('log10', 1000.0, 3.0)
+    test_method('log10', 0.5, -0.301029996)
+.end
+
+.sub 'log2_method'
+    test_method('log2', 32.0, 5.0)
+    test_method('log2', 0.5, -1.0)
+.end
+
+.sub 'sec_method'
+    test_method('sec', 0.0, 1.0)
+    test_method('sec', 0.5, 1.139493927)
+.end
+
+.sub 'sech_method'
+    test_method('sech', 0.0, 1.0)
+    test_method('sech', 0.5, 0.886818884)
+.end
+
+.sub 'sin_method'
+    test_method('sin', 0.0, 0.0)
+    test_method('sin', 0.5, 0.479425539)
+.end
+
+.sub 'sinh_method'
+    test_method('sinh', 0.0, 0.0)
+    test_method('sinh', 0.5, 0.521095305)
+.end
+
+.sub 'tan_method'
+    test_method('tan', 0.0, 0.0)
+    test_method('tan', 0.5, 0.546302490)
+.end
+
+.sub 'tanh_method'
+    test_method('tanh', 0.0, 0.0)
+    test_method('tanh', 0.5, 0.462117157)
+.end
+
+.sub 'sqrt_method'
+    test_method('sqrt', 16.0, 4.0)
+    test_method('sqrt', 2.0, 1.414213562)
+.end
 
 # Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
+#   mode: pir
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/t/pmc/freeze.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/freeze.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/freeze.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 #! perl
-# Copyright (C) 2001-2008, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
 use strict;
@@ -765,7 +765,7 @@
 .end
 
 .namespace ['Conure']
-.sub __init :method
+.sub init :method :vtable
     $P0 = new ['Integer']
     $P0 = 37
     setattribute self, 'temperature', $P0

Modified: branches/orderedhash_revamp/t/pmc/hash.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/hash.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/hash.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -23,7 +23,7 @@
     .include 'except_types.pasm'
     .include 'datatypes.pasm'
 
-    plan(161)
+    plan(168)
 
     initial_hash_tests()
     more_than_one_hash()
@@ -71,6 +71,9 @@
     integer_keys()
     value_types_convertion()
     elements_in_hash()
+    equality_tests()
+
+    pmc_keys()
 .end
 
 .sub initial_hash_tests
@@ -123,7 +126,6 @@
 .end
 
 .sub null_key
-    # See RT #59542
     new $P0, ['Hash']
     $P0['yum'] = 5
     null $S0
@@ -1204,18 +1206,18 @@
   thash["c"] = "d"
   thash["e"] = "f"
 
-  .local pmc iter
-  iter = new ['Iterator'], thash
-  iter = .ITERATE_FROM_START
+  .local pmc it
+  it = iter thash
+  it = .ITERATE_FROM_START
 
   .local pmc keys, key
   keys = new ['ResizablePMCArray']
 
   # go through the hash, print out all the keys: should be a c and e
 preit_loop:
-  unless iter goto preit_end
+  unless it goto preit_end
 
-  key = shift iter
+  key = shift it
   $S0 = key
   push keys, $S0
 
@@ -1233,15 +1235,15 @@
   # what do we have after deletion?
   result = ""
 
-  iter = new ['Iterator'], thash
-  iter = .ITERATE_FROM_START
+  it = iter thash
+  it = .ITERATE_FROM_START
 
   # go through the hash, print out all the keys... I believe it should be a and e?
   # it actually outputs a, c and e.
 postit_loop:
-  unless iter goto postit_end
+  unless it goto postit_end
 
-  key = shift iter
+  key = shift it
   $S0 = key
   push keys, $S0
 
@@ -1369,6 +1371,79 @@
 
 .end
 
+.sub 'equality_tests'
+    .local pmc hash1, hash2, hash3, hash4, hash5
+    hash1 = new ['Hash']
+    hash2 = new ['Hash']
+    hash3 = new ['Hash']
+    hash4 = new ['Hash']
+
+    hash1['one'] = "Hello Parrot!"
+    hash1['two'] = 1664
+    hash1['three'] = 2.718
+
+    hash2['ONE'] = "Hello Parrot!"
+    hash2['TWO'] = 1664
+    hash2['THREE'] = 2.718
+
+    $P0 = box "Hello Parrot!"
+    hash3['one'] = $P0
+    $P0 = box 1664
+    hash3['two'] = $P0
+    $P0 = box 2.718
+    hash3['three'] = $P0
+
+    hash4['one'] = "Goodbye Parrot!"
+    hash4['two'] = 1664
+    hash4['three'] = 2.718
+
+    hash5 = clone hash1
+
+    isnt(hash1, hash2, 'Hashes with different keys')
+    is(hash1, hash3, 'Equal hashes, physically disjoint')
+    isnt(hash1, hash4, 'Different hash values')
+    is(hash1, hash5, 'Clones are equal')
+.end
+
+# Switch to use PMC keys instead of strings.
+.sub 'pmc_keys'
+    .include "hash_key_type.pasm"
+    .local pmc hash
+    hash = new ['Hash']
+    hash = .Hash_key_type_PMC
+
+    $P0 = new ['ResizableStringArray']
+    push $P0, "foo"
+    hash[$P0] = 'FOO'
+    # Autoconvert INTVAL to Integer
+    hash[42]  = 'bar'
+    $S0       = 'foo'
+    # Autoconvert STRING to String
+    hash[$S0] = 'BAZ'
+
+    $I0 = elements hash
+    is($I0, 3, "Got 3 elements in Hash")
+
+    # Iterate over keys and get types. We should have 3 different types:
+    # ResizableStringArray, Integer and String
+    .local pmc types, it
+    types = new ['Hash']
+    it = iter hash
+  loop:
+    unless it goto done
+    $P0 = shift it
+    $P1 = $P0.'key'()
+    $S0 = typeof $P1
+    types[$S0] = 1
+    goto loop
+  done:
+    
+    $I0 = elements types
+    is($I0, 3, "Got 3 different types of PMC keys")
+    $I0 = types['ResizableStringArray']
+    ok($I0, "Including ResizableStringArray")
+.end
+
 # Local Variables:
 #   mode: pir
 #   fill-column: 100

Modified: branches/orderedhash_revamp/t/pmc/hashiterator.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/hashiterator.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/hashiterator.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -8,7 +8,7 @@
 
 =head1 SYNOPSIS
 
-    % prove t/pmc/hash.t
+    % prove t/pmc/hashiterator.t
 
 =head1 DESCRIPTION
 

Modified: branches/orderedhash_revamp/t/pmc/hashiteratorkey.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/hashiteratorkey.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/hashiteratorkey.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -20,11 +20,19 @@
 .sub 'main'
     .include 'test_more.pir'
 
-    plan(1)
+    plan(3)
 
     $P0 = new ['HashIteratorKey']
     ok(1, "Can create HashIteratorKey directly")
 
+    $P0 = new ['Hash']
+    $P0['foo'] = 'bar'
+    $P1 = iter $P0
+    $P2 = shift $P1
+    $S0 = $P2.'key'()
+    is($S0, 'foo', 'HashIteratorKey.key works')
+    $S0 = $P2.'value'()
+    is($S0, 'bar', 'HashIteratorKey.value works')
 .end
 
 

Modified: branches/orderedhash_revamp/t/pmc/integer.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/integer.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/integer.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,14 +1,7 @@
-#!perl
-# Copyright (C) 2001-2008, Parrot Foundation.
+#!parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-
-use Test::More;
-use Parrot::Test tests => 19;
-
 =head1 NAME
 
 t/pmc/integer.t - Integer basic type
@@ -23,476 +16,370 @@
 
 =cut
 
-pir_output_is( << 'CODE', << 'OUTPUT', "basic math" );
+.sub 'test' :main
+    .include 'test_more.pir'
+
+    plan(62)
+    test_init()
+    test_basic_math()
+    test_truthiness_and_definedness()
+    test_set_string_native()
+    test_isa()
+    test_interface()
+    test_ne()
+    test_gt()
+    test_ge()
+    test_istrue_isfalse()
+    test_if_unless()
+    test_add()
+    test_arithmetic()
+    test_get_as_base()
+    test_get_as_base10()
+    test_get_as_base_various()
+    test_get_as_base_bounds_check()
+    test_cmp_subclass()
+    test_cmp_RT59336()
+.end
+
+.sub test_init
+    .local pmc i1, i2
+    i1 = new ['Integer']
+    is(i1, 0, "Default value of Integer is 0")
+    i1 = 42
+    i2 = new ['Integer'], i1
+    is(i2, 42, "Initialize with argument set correct value")
+.end
+
+.sub test_get_as_base_bounds_check
+    throws_substring(<<'CODE', 'get_as_base: base out of bounds', 'get_as_base lower bound check')
+    .sub main
+        $P0 = new ['Integer']
+        $P0 = 42
+        $S0 = $P0.'get_as_base'(1)
+        say $S0
+    .end
+CODE
+    throws_substring(<<'CODE', 'get_as_base: base out of bounds', 'get_as_base upper bound check')
+    .sub main
+        $P0 = new ['Integer']
+        $P0 = 42
+        $S0 = $P0.'get_as_base'(37)
+        say $S0
+    .end
+CODE
+.end
 
-.sub _main
+.sub test_basic_math
     .local pmc int_1
     int_1 = new ['Integer']
-    print int_1
-    print "\n"
+    is(int_1,0)
     int_1 = 1
-    print int_1
-    print "\n"
+    is(int_1,1)
     int_1 += 777777
     int_1 -= 777776
-    print int_1
-    print "\n"
+    is(int_1,2)
     int_1 *= -333333
     int_1 /= -222222
-    print int_1
-    print "\n"
+    is(int_1,3)
     inc int_1
     inc int_1
     dec int_1
-    print int_1
-    print "\n"
+    is(int_1,4)
     neg int_1
     dec int_1
     neg int_1
-    print int_1
-    print "\n"
-    end
+    is(int_1,5)
 .end
-CODE
-0
-1
-2
-3
-4
-5
-OUTPUT
 
-pir_output_is( << 'CODE', << 'OUTPUT', "truth and definedness" );
 
-.sub _main
+.sub test_truthiness_and_definedness
     .local pmc int_1
     int_1 = new ['Integer']
 
-    print "A newly created Integer is "
-    if int_1 goto LABEL_1
-    print "not "
-LABEL_1:
-    print "true.\n"
+    nok(int_1, "A newly created Integer is not true")
 
     .local int is_defined
 
     is_defined = defined int_1
-    print "A newly created Integer is "
-    if is_defined goto LABEL_2
-    print " not "
-LABEL_2:
-    print "defined.\n"
+
+    nok(int_1, "A newly created Integer is not defined")
 
     int_1 = -999999999
-    print "The Integer "
-    print int_1
-    print " is "
-    if is_defined goto LABEL_3
-    print "not "
-LABEL_3:
-    print "true.\n"
+
+    ok(int_1, "-999999999 is true")
 
     is_defined = defined int_1
-    print "The Integer "
-    print int_1
-    print " is "
-    if is_defined goto LABEL_4
-    print "not "
-LABEL_4:
-    print "defined.\n"
-    end
+
+    ok(int_1, "-999999999 is defined")
+
 .end
-CODE
-A newly created Integer is not true.
-A newly created Integer is defined.
-The Integer -999999999 is true.
-The Integer -999999999 is defined.
-OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', "set_string_native" );
 
-.sub _main
+.sub test_set_string_native
     .local pmc pmc1
     pmc1 = new ['Integer']
     pmc1 = "-123456789"
-    print pmc1
-    print "\n"
-    end
+    is(pmc1, -123456789)
 .end
-CODE
--123456789
-OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', "isa" );
 
-.sub _main
+.sub test_isa
     .local pmc pmc1
     pmc1 = new ['Integer']
 
     .local int pmc1_is_a
     pmc1_is_a = isa pmc1, "Integer"
-    print "A newly created Integer is "
-    if pmc1_is_a goto PMC1_IS_A_INTEGER
-      print "not "
-PMC1_IS_A_INTEGER:
-    print "an Integer.\n"
-
-    end
+    isa_ok(pmc1, "Integer")
 .end
-CODE
-A newly created Integer is an Integer.
-OUTPUT
-
-pir_output_is( << 'CODE', << 'OUTPUT', "check whether interface is done" );
 
-.sub _main
+.sub test_interface
     .local pmc pmc1
     pmc1 = new ['Integer']
     .local int bool1
     does bool1, pmc1, "scalar"
-    print bool1
-    print "\n"
+    is(bool1,1)
     does bool1, pmc1, "integer"
-    print bool1
-    print "\n"
+    is(bool1,1)
     does bool1, pmc1, "no_interface"
-    print bool1
-    print "\n"
-    end
+    is(bool1,0)
 .end
-CODE
-1
-1
-0
-OUTPUT
-
-pir_output_is( << 'CODE', << 'OUTPUT', "Comparison ops: ne" );
 
-.sub _main
+.sub test_ne
     .local pmc pmc1
     pmc1 = new ['Integer']
     .local int int1
     pmc1 = 10
     int1 = 20
     ne pmc1, int1, OK1
-    print "not "
+    ok(0)
+    goto next_test
 OK1:
-    print "ok 1\n"
+    ok(1)
+
+next_test:
+
     int1 = 10
     ne pmc1, int1, BAD2
     branch OK2
 BAD2:
-    print "not "
+    ok(0)
+    goto fin
 OK2:
-    print "ok 2\n"
-    end
+    ok(1)
+fin:
 .end
-CODE
-ok 1
-ok 2
-OUTPUT
 
-pir_output_is( << 'CODE', << 'OUTPUT', "Comparison ops: gt" );
 
-.sub _main
+.sub test_gt
     .local pmc pmc1
     pmc1 = new ['Integer']
     .local int int1
     pmc1 = 10
     int1 = 5
     gt pmc1, int1, OK1
-    print "not "
+    ok(0)
+    goto next_test1
 OK1:
-    print "ok 1\n"
+    ok(1)
+
+next_test1:
     int1 = 10
     gt pmc1, int1, BAD2
     branch OK2
 BAD2:
-    print "not "
+    ok(0)
 OK2:
-    print "ok 2\n"
+    ok(1)
+
+next_test2:
     int1 = 20
     gt pmc1, int1, BAD3
     branch OK3
 BAD3:
-    print "not "
+    ok(0)
+    goto fin
 OK3:
-    print "ok 3\n"
-    end
+    ok(1)
+fin:
 .end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
 
-pir_output_is( << 'CODE', << 'OUTPUT', "Comparison ops: ge" );
 
-.sub _main
+.sub test_ge
     .local pmc pmc1
     pmc1 = new ['Integer']
     .local int int1
     pmc1 = 10
     int1 = 5
     ge pmc1, int1, OK1
-    print "not "
+    ok(0)
+    goto next_test1
 OK1:
-    print "ok 1\n"
+    ok(1)
     int1 = 10
+
+next_test1:
     ge pmc1, int1, OK2
-    print "not "
+    ok(0)
+    goto next_test2
 OK2:
-    print "ok 2\n"
+    ok(1)
     int1 = 20
+next_test2:
     ge pmc1, int1, BAD3
     branch OK3
 BAD3:
-    print "not "
+    ok(0)
+    goto fin
 OK3:
-    print "ok 3\n"
-    end
+    ok(1)
+fin:
 .end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
 
-pir_output_is( << 'CODE', << 'OUTPUT', "Logical ops: istrue & isfalse" );
 
-.sub _main
+.sub test_istrue_isfalse
     .local pmc pmc1
     pmc1 = new ['Integer']
     .local int int1
     pmc1 = 10
     istrue int1, pmc1
-    print int1
-    print "\n"
+    is(1,int1)
     isfalse int1, pmc1
-    print int1
-    print "\n"
+    is(0,int1)
     pmc1 = 0
     istrue int1, pmc1
-    print int1
-    print "\n"
+    is(0,int1)
     isfalse int1, pmc1
-    print int1
-    print "\n"
-
-    end
+    is(1,int1)
 .end
-CODE
-1
-0
-0
-1
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "if/unless with Integer PMC" );
-      new P0, ['Integer']
-      set P0, 10
-      if P0, OK1
-      print "not "
-OK1:  print "ok 1\n"
-      unless P0, BAD2
+
+
+.sub test_if_unless
+      new $P0, ['Integer']
+      set $P0, 10
+      if $P0, OK1
+      ok(0)
+      goto test1
+OK1:
+      ok(1)
+test1:
+      unless $P0, BAD2
       branch OK2
-BAD2: print "not "
-OK2:  print "ok 2\n"
-      set P0, 0
-      if P0, BAD3
+BAD2:
+      ok(0)
+      goto test2
+OK2:
+      ok(1)
+      set $P0, 0
+test2:
+      if $P0, BAD3
       branch OK3
-BAD3: print "not "
-OK3:  print "ok 3\n"
-      unless P0, OK4
-      print "not "
-OK4:  print "ok 4\n"
-      end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUT', "add" );
-   new P0, ['Integer']
-   set P0, 5
-   new P1, ['Integer']
-   set P1, 10
-   new P2, ['Integer']
-   add P2, P0, P1
-   set S0, P2
-   print S0
-   print "\n"
-   set P0, "20"
-   set P1, "30"
-   add P2, P1, P0
-   set S0, P2
-   print S0
-   print "\n"
-   end
-CODE
-15
-50
-OUT
+BAD3:
+      ok(0)
+      goto test3
+OK3:
+      ok(1)
+test3:
+      unless $P0, OK4
+      ok(0)
+      goto fin
+OK4:
+      ok(1)
+fin:
+.end
+
+.sub test_add
+   new $P0, ['Integer']
+   set $P0, 5
+   new $P1, ['Integer']
+   set $P1, 10
+   new $P2, ['Integer']
+   add $P2, $P0, $P1
+   set $S0, $P2
+   is($S0,15)
+   set $P0, "20"
+   set $P1, "30"
+   add $P2, $P1, $P0
+   set $S0, $P2
+   is($S0,50)
+.end
 
-pir_output_is( << 'CODE', << 'OUTPUT', "<oper>" );
-.sub main :main
+.sub test_arithmetic
     $P0 = new ['Integer']
     $P1 = new ['Integer']
     set $P0, 6
     set $P1, 2
 
     add $P2, $P0, $P1
-    print $P2
-    print "\n"
+    is($P2,8)
     $P2 = add $P0, $P1
-    print $P2
-    print "\n"
+    is($P2,8)
     sub $P2, $P0, $P1
-    print $P2
-    print "\n"
+    is($P2,4)
     mul $P2, $P0, $P1
-    print $P2
-    print "\n"
+    is($P2,12)
     div $P2, $P0, $P1
-    print $P2
-    print "\n"
+    is($P2,3)
     mod $P2, $P0, $P1
-    print $P2
-    print "\n"
+    is($P2,0)
     pow $P2, $P0, $P1
-    print $P2
-    print "\n"
+    is($P2,36)
 .end
-CODE
-8
-8
-4
-12
-3
-0
-36
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', "can get_as_base()" );
-.sub main :main
-    $P0 = new ['Integer']
-    $P0 = 42
-    $I0 = can $P0, 'get_as_base'
-    if $I0, OK
-    print "not "
-OK: print "ok\n"
-.end
-CODE
-ok
-OUTPUT
-
-pir_error_output_like( <<'CODE', <<'OUTPUT', "get_as_base() bounds check" );
-.sub main :main
-    $P0 = new ['Integer']
-    $P0 = 42
 
-    $S0 = $P0.'get_as_base'(1)
-
-    print $S0
-    print "\n"
-.end
-CODE
-/get_as_base: base out of bounds
-.*/
-OUTPUT
 
-pir_error_output_like( <<'CODE', <<'OUTPUT', "get_as_base() bounds check" );
-.sub main :main
+.sub test_get_as_base
     $P0 = new ['Integer']
     $P0 = 42
-
-    $S0 = $P0.'get_as_base'(37)
-
-    print $S0
-    print "\n"
+    $I0 = can $P0, 'get_as_base'
+    ok($I0,'Integers can get_as_base')
 .end
-CODE
-/get_as_base: base out of bounds
-.*/
-OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', "get_as_base(10)" );
-.sub main :main
+.sub test_get_as_base10
     $P0 = new ['Integer']
     $P0 = 42
 
     $S0 = $P0.'get_as_base'(10)
-
-    print $S0
-    print "\n"
+    is($S0,42)
 .end
-CODE
-42
-OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', "get_as_base(various)" );
-.sub main :main
+.sub test_get_as_base_various
     $P0 = new ['Integer']
     $P0 = 42
 
     $S0 = $P0.'get_as_base'(2)
-    bsr PRINT
+    is($S0,101010)
 
     $S0 = $P0.'get_as_base'(3)
-    bsr PRINT
+    is($S0,1120)
 
     $S0 = $P0.'get_as_base'(5)
-    bsr PRINT
+    is($S0,132)
 
     $S0 = $P0.'get_as_base'(7)
-    bsr PRINT
+    is($S0,60)
 
     $S0 = $P0.'get_as_base'(11)
-    bsr PRINT
+    is($S0,39)
 
     $S0 = $P0.'get_as_base'(13)
-    bsr PRINT
+    is($S0,33)
 
     $S0 = $P0.'get_as_base'(17)
-    bsr PRINT
+    is($S0,28)
 
     $S0 = $P0.'get_as_base'(19)
-    bsr PRINT
+    is($S0,24)
 
     $S0 = $P0.'get_as_base'(23)
-    bsr PRINT
+    is($S0,'1j')
 
     $S0 = $P0.'get_as_base'(29)
-    bsr PRINT
+    is($S0,'1d')
 
     $S0 = $P0.'get_as_base'(31)
-    bsr PRINT
-    goto END
-
-PRINT:
-    print $S0
-    print "\n"
-    ret
-END:
+    is($S0,'1b')
 .end
-CODE
-101010
-1120
-132
-60
-39
-33
-28
-24
-1j
-1d
-1b
-OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'cmp functions for subclasses' );
-.sub main :main
+.sub test_cmp_subclass
     $P0 = subclass 'Integer', 'Int'
 
     $P1 = new ['Int']
@@ -501,43 +388,32 @@
     $P2 = 2
 
     $I0 = cmp $P1, $P2
-    say $I0
+    is($I0,-1)
     $I0 = cmp $P1, $P1
-    say $I0
+    is($I0,0)
     $I0 = cmp $P2, $P1
-    say $I0
+    is($I0,1)
 .end
-CODE
--1
-0
-1
-OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'cmp for Integers more than 2^31 apart, RT #59336' );
-.sub 'main' :main
+.sub test_cmp_RT59336
     $P0 = new ['Integer']
     $P0 = 2147483600
 
-  test_10:
-    print $P0
-    print " is"
-    if $P0 > -10 goto skip_10
-    print " not"
-  skip_10:
-    say " greater than -10"
-
-  test_1000:
-    print $P0
-    print " is"
-    if $P0 > -1000 goto skip_1000
-    print " not"
-  skip_1000:
-    say " greater than -1000"
+test_10:
+    if $P0 > -10 goto pass
+    ok(0)
+    goto test_1000
+pass:
+    ok(1)
+
+test_1000:
+    if $P0 > -1000 goto pass2
+    ok(0)
+    goto fin
+pass2:
+    ok(1)
+fin:
 .end
-CODE
-2147483600 is greater than -10
-2147483600 is greater than -1000
-OUTPUT
 
 # Local Variables:
 #   mode: cperl

Modified: branches/orderedhash_revamp/t/pmc/io.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/io.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/io.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -68,7 +68,7 @@
 a line
 OUTPUT
 
-# RT #46843
+# TT #1178
 pir_output_is( <<'CODE', <<'OUTPUT', "get_fd()/fdopen" );
 .sub main :main
     getstdout $P0
@@ -86,7 +86,7 @@
 ok
 OUTPUT
 
-# RT #46843
+# TT #1178
 pir_output_is( <<'CODE', <<'OUTPUT', 'fdopen - no close' );
 .sub main :main
     getstdout $P0
@@ -437,7 +437,7 @@
 Successful
 OUTPUT
 
-# RT #46843
+# TT #1178
 pir_output_is( <<'CODE', <<'OUT', 'standard file descriptors' );
 .sub main :main
     getstdin $P0

Modified: branches/orderedhash_revamp/t/pmc/io_iterator.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/io_iterator.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/io_iterator.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -25,19 +25,19 @@
 # L<PDD22/I\/O Iterator PMC API/=item new>
 pir_output_is( <<'CODE', <<'OUT', 'new', todo => 'not yet implemented' );
 .sub 'test' :main
-    $P99 = 1 # RT #46847 replace with io object
-    $P0 = new ['Iterator'], $P99
-    say "ok 1 - $P0 = new ['Iterator'], $P1"
+    $P99 = 1 # TT #1242 replace with io object
+    $P0 = iter $P99
+    say "ok 1 - $P0 = iter $P1"
 .end
 CODE
-ok 1 - $P0 = new ['Iterator'], $P1
+ok 1 - $P0 = iter $P1
 OUT
 
 # L<PDD22/I\/O Iterator PMC API/=item shift>
 pir_output_is( <<'CODE', <<'OUT', 'shift', todo => 'not yet implemented' );
 .sub 'test' :main
-    $P99 = 1 # RT #46847 replace with io object
-    $P0 = new ['Iterator'], $P99
+    $P99 = 1 # TT #1242 replace with io object
+    $P0 = iter $P99
 
     $S0 = shift $P0
 
@@ -46,7 +46,7 @@
   ok_1:
     say 'ok 1 - $S0 = shift $P1 # success'
 
-    # RT #46851 test more return values, including end of file
+    # TT #1206  test more return values, including end of file
 .end
 CODE
 ok 1 - $I0 = shift $P1 # success
@@ -55,8 +55,8 @@
 # L<PDD22/I\/O Iterator PMC API/=item get_bool (vtable)>
 pir_output_is( <<'CODE', <<'OUT', 'get_bool (vtable)', todo => 'not yet implemented' );
 .sub 'test' :main
-    $P99 = 1 # RT #46847 replace with io object
-    $P0 = new ['Iterator'], $P99
+    $P99 = 1 # TT #1242 replace with io object
+    $P0 = iter $P99
 
     # empty i/o object
     unless $P0 goto ok_1
@@ -64,7 +64,7 @@
   ok_1:
     say 'ok 1 - $P0 # empty i/o object returns false'
 
-    # RT #46853 setup i/o object with two lines
+    # TT #1242 setup i/o object with two lines
     if $P0 got ok_2
     print 'not '
   ok_2:

Modified: branches/orderedhash_revamp/t/pmc/iterator.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/iterator.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/iterator.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -23,9 +23,11 @@
 
 =cut
 
+# XXX Split this test into aggregate specific one.
+
 pasm_output_is( <<'CODE', <<'OUTPUT', "new iter" );
     new P2, ['ResizablePMCArray']
-    new P1, ['Iterator'], P2
+    iter P1, P2
     print "ok 1\n"
     end
 CODE
@@ -39,19 +41,19 @@
     push P2, 10
     push P2, 20
     set I0, P2
-    new P1, ['Iterator'], P2
+    iter P1, P2
     print "ok 1\n"
     set I1, P1
     eq I0, I1, ok2        # iter.length() == array.length()
     print "not "
 ok2:    print "ok 2\n"
-    new P1, ['Iterator'], P0
+    iter P1, P0
     set P1, .ITERATE_FROM_START
     print "ok 3\n"
     unless P1, ok4        # if(iter) == false on empty
     print "not "
 ok4:    print "ok 4\n"
-    new P1, ['Iterator'], P2
+    iter P1, P2
     set P1, .ITERATE_FROM_START
     if P1, ok5        # if(iter) == true on non empty
     print "not "
@@ -115,19 +117,19 @@
     set P2["ab"], 100
     set P2["xy"], "value"
     set I0, P2
-    new P1, ['Iterator'], P2
+    iter P1, P2
     print "ok 1\n"
     set I1, P1
     eq I0, I1, ok2        # iter.length() == hash.length()
     print "not "
 ok2:    print "ok 2\n"
-    new P1, ['Iterator'], P0
+    iter P1, P0
     set P1, .ITERATE_FROM_START
     print "ok 3\n"
     unless P1, ok4        # if(iter) == false on empty
     print "not "
 ok4:    print "ok 4\n"
-    new P1, ['Iterator'], P2
+    iter P1, P2
     set P1, .ITERATE_FROM_START
     if P1, ok5        # if(iter) == true on non empty
     print "not "
@@ -169,19 +171,19 @@
     set P2["ab"], 100
     set P2["xy"], "value"
     set I0, P2
-    new P1, ['Iterator'], P2
+    iter P1, P2
     print "ok 1\n"
     set I1, P1
     eq I0, I1, ok2        # iter.length() == hash.length()
     print "not "
 ok2:    print "ok 2\n"
-    new P1, ['Iterator'], P0
+    iter P1, P0
     set P1, .ITERATE_FROM_START
     print "ok 3\n"
     unless P1, ok4        # if(iter) == false on empty
     print "not "
 ok4:    print "ok 4\n"
-    new P1, ['Iterator'], P2
+    iter P1, P2
     set P1, .ITERATE_FROM_START
     if P1, ok5        # if(iter) == true on non empty
     print "not "
@@ -231,7 +233,7 @@
     dec I1
     if I1, fill
 
-    new P1, ['Iterator'], P0
+    iter P1, P0
     set I0, P1
     eq I0, I10, ok1
     print "not "
@@ -260,7 +262,7 @@
     .include "iterator.pasm"
     new P2, ['String']
     set P2, "parrot"
-    new P1, ['Iterator'], P2
+    iter P1, P2
     set P1, .ITERATE_FROM_START
 iter_loop:
         unless P1, iter_end        # while (entries) ...
@@ -281,7 +283,7 @@
     .include "iterator.pasm"
     new P2, ['String']
     set P2, "parrot"
-    new P1, ['Iterator'], P2
+    iter P1, P2
     set P1, .ITERATE_FROM_END
 iter_loop:
         unless P1, iter_end        # while (entries) ...
@@ -302,7 +304,7 @@
     .include "iterator.pasm"
     new P2, ['String']
     set P2, "ABC"
-    new P1, ['Iterator'], P2
+    iter P1, P2
     set P1, .ITERATE_FROM_START
 iter_loop:
         unless P1, iter_end        # while (entries) ...
@@ -323,7 +325,7 @@
 .include "iterator.pasm"
     new P2, ['String']
     set P2, "ABC"
-    new P1, ['Iterator'], P2
+    iter P1, P2
     set P1, .ITERATE_FROM_END
 iter_loop:
         unless P1, iter_end        # while (entries) ...
@@ -351,7 +353,7 @@
     print "\n"
 
     .local pmc iter_1
-    iter_1 = new ['Iterator'], string_1
+    iter_1 = iter string_1
     iter_1 = .ITERATE_FROM_START
 
     .local int code_point_1
@@ -389,7 +391,7 @@
     print "\n"
 
     .local pmc iter_1
-    iter_1 = new ['Iterator'], string_1
+    iter_1 = iter string_1
     iter_1 = .ITERATE_FROM_START
 
     .local int    code_point_1
@@ -447,7 +449,7 @@
     print "\n"
 
     .local pmc iter_1
-    iter_1 = new ['Iterator'], array_1
+    iter_1 = iter array_1
     iter_1 = .ITERATE_FROM_START
 
     .local string elem_1
@@ -502,7 +504,7 @@
     print "\n"
 
     .local pmc iter_2
-    iter_2 = new ['Iterator'], array_1
+    iter_2 = iter array_1
     iter_2 = .ITERATE_FROM_END
 
     print 'Iterator shift_float: '
@@ -543,7 +545,7 @@
     push P2, 20
     push P2, 30
     push P2, 40
-    new P1, ['Iterator'], P2
+    iter P1, P2
     set P1, .ITERATE_FROM_START
 
     set I0, P1        # arr.length
@@ -713,7 +715,7 @@
     .local pmc ar, i1, i2
     ar = new ['ResizableIntegerArray']
     push ar, 17
-    new i1, ['Iterator'], ar
+    i1 = iter ar
     clone i2, i1
 .end
 CODE
@@ -726,7 +728,7 @@
     push ar, 17
     push ar, 42
 
-    new i1, ['Iterator'], ar
+    i1 = iter ar
     clone i2, i1
 
     .local pmc temp
@@ -759,7 +761,7 @@
     ar = new ['ResizableIntegerArray']
     push ar, 1
     push ar, 2
-    new i1, ['Iterator'], ar
+    i1 = iter ar
 
     shift temp, i1
     unless temp == 1 goto fail
@@ -790,7 +792,7 @@
     temp = new ['Integer']
     ar   = new ['ResizableIntegerArray']
     push ar, 1
-    new i1, ['Iterator'], ar
+    i1 = iter ar
 
     # i1 and i2 now "point" to the same element of the same array.
     clone i2, i1

Modified: branches/orderedhash_revamp/t/pmc/key.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/key.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/key.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -111,7 +111,7 @@
     a()
     collect
     a()
-    ok(1, 'register and non-register string keys should be COW (RT #60128)' )
+    ok(1, 'register and non-register string keys should be COW' )
 .end
 
 # support for do_not_collect_string_keys_early_rt_60128
@@ -169,7 +169,6 @@
 .namespace []
 
 .sub prepare_lib :init
-  load_bytecode 'PGE.pbc'
   $P0 = get_class 'Sub'
   $P1 = subclass $P0, 'TclProc'
   $P1 = new ['ResizablePMCArray']

Modified: branches/orderedhash_revamp/t/pmc/lexpad.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/lexpad.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/lexpad.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -19,9 +19,10 @@
 
 .sub main :main
     .include 'test_more.pir'
-    plan(1)
+    plan(4)
 
     new_test()
+    test_iter()
 .end
 
 .sub new_test
@@ -35,6 +36,38 @@
 end:
 .end
 
+
+
+.sub 'test_iter'
+
+    .local pmc str1,str2,str3
+    .lex 'a', str1
+    .lex 'b', str2
+    .lex 'c', str3
+
+    str1 = box 'pants'
+    str2 = box 'pants'
+    str3 = box 'pants'
+
+    .local pmc interp
+    interp = getinterp
+
+    .local pmc dlp
+    dlp    = interp['lexpad']
+
+    .local pmc iterator
+    iterator = iter dlp
+iter_loop:
+    unless iterator goto iter_done
+    .local pmc key
+    key = shift iterator
+    .local pmc value
+    value = dlp[key]
+    is(value, 'pants', "Got value from iterator")
+    goto iter_loop
+iter_done:
+.end
+
 # Local Variables:
 #   mode: pir
 #   cperl-indent-level: 4

Modified: branches/orderedhash_revamp/t/pmc/multidispatch.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/multidispatch.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/multidispatch.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -17,7 +17,7 @@
 
 =head1 SYNOPSIS
 
-    % prove t/pmc/mmd.t
+    % prove t/pmc/multidispatch.t
 
 =head1 DESCRIPTION
 
@@ -413,7 +413,7 @@
 .end
 CODE
 /\A\(_, Float\) method:  1, 9\.5
-No applicable methods/
+No applicable candidates/
 OUT
 
 pir_output_is( <<'CODE', <<'OUT', "MMD on argument count" );
@@ -583,7 +583,7 @@
 PSt ok 2
 PSt ok 3
 String ok 4
-No applicable methods/
+No applicable candidates/
 OUT
 
 pir_output_is( <<'CODE', <<'OUT', 'MMD on PMC types 3' );
@@ -723,7 +723,7 @@
 String ok 4
 OUT
 
-pir_output_is( <<'CODE', <<'OUT', "MMD on PMC types - Any", todo => 'RT #41374' );
+pir_output_is( <<'CODE', <<'OUT', "MMD on PMC types - Any", todo => 'TT #1320' );
 
 .sub main :main
     $P0 = new ['String']
@@ -809,7 +809,7 @@
 42
 OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', "add as method - inherited", todo => 'RT #41374' );
+pir_output_is( <<'CODE', <<'OUTPUT', "add as method - inherited", todo => 'TT #1320' );
 .sub main :main
     .local pmc d, l, r
     .local pmc pint
@@ -998,7 +998,7 @@
 nothing
 OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', "use a core func for an object", todo => 'RT #59628' );
+pir_output_is( <<'CODE', <<'OUTPUT', "use a core func for an object");
 .sub main :main
     .local pmc d, l, r, cl
     cl = newclass "AInt"
@@ -1226,7 +1226,7 @@
 Called multi for class
 OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', "unicode sub names and multi (RT #39254)" );
+pir_output_is( <<'CODE', <<'OUTPUT', "unicode sub names and multi" );
 .sub unicode:"\u7777" :multi(string)
   .param pmc arg
   print 'String:'

Modified: branches/orderedhash_revamp/t/pmc/multisub.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/multisub.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/multisub.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -44,7 +44,7 @@
     push $P0, "goodbye"
     $S0 = foo($P0 :flat)
     is($S0, "testing 42, goodbye", "Int and String :flat")
-    ## Now try double :flat (regression test for RT #43869).
+    ## Now try double :flat
     $P1 = new ['ResizablePMCArray']
     push $P1, 42
     $P2 = new ['ResizablePMCArray']

Added: branches/orderedhash_revamp/t/pmc/namespace-old.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/pmc/namespace-old.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,1288 @@
+#! perl
+# Copyright (C) 2001-2009, Parrot Foundation.
+# $Id$
+
+use strict;
+use warnings;
+use lib qw( . lib ../lib ../../lib );
+use Test::More;
+use Parrot::Test tests => 38;
+use Parrot::Config;
+
+=head1 NAME
+
+t/pmc/namespace.t - test the NameSpace PMC as described in PDD 21.
+
+=head1 SYNOPSIS
+
+    % prove t/pmc/namespace-old.t
+
+=head1 DESCRIPTION
+
+Test the NameSpace PMC as described in PDD21.
+
+=cut
+
+my $temp_a = "temp_a";
+my $temp_b = "temp_b";
+
+END {
+    unlink( "$temp_a.pir", "$temp_a.pbc", "$temp_b.pir", "$temp_b.pbc" );
+}
+
+open my $S, '>', "$temp_a.pir" or die "Can't write $temp_a.pir";
+print $S <<'EOF';
+.HLL "Foo"
+.namespace ["Foo_A"]
+.sub loada :load
+    $P0 = get_global ["Foo_A"], "A"
+    print "ok 1\n"
+    load_bytecode "temp_b.pbc"
+.end
+
+.sub A
+.end
+EOF
+close $S;
+
+open $S, '>', "$temp_b.pir" or die "Can't write $temp_b.pir";
+print $S <<'EOF';
+.namespace ["Foo_B"]
+.sub loadb :load
+    $P0 = get_global ["Foo_B"], "B"
+    print "ok 2\n"
+.end
+
+.sub B
+.end
+EOF
+
+close $S;
+
+system(".$PConfig{slash}parrot$PConfig{exe} -o $temp_a.pbc $temp_a.pir");
+system(".$PConfig{slash}parrot$PConfig{exe} -o $temp_b.pbc $temp_b.pir");
+
+pir_output_is( <<'CODE', <<'OUTPUT', "HLL and load_bytecode - #38888" );
+.sub main :main
+    load_bytecode "temp_a.pbc"
+    print "ok 3\n"
+.end
+CODE
+ok 1
+ok 2
+ok 3
+OUTPUT
+
+pir_output_is( <<'CODE', <<'OUTPUT', "HLL and vars" );
+# initial storage of _tcl global variable...
+
+.HLL '_Tcl'
+
+.sub huh
+  $P0 = new ['Integer']
+  $P0 = 3.14
+  set_global '$variable', $P0
+.end
+
+# start running HLL language
+.HLL 'Tcl'
+
+.sub foo :main
+  huh()
+  $P1 = get_root_namespace ['_tcl']
+  $P2 = $P1['$variable']
+  print $P2
+  print "\n"
+.end
+CODE
+3.14
+OUTPUT
+
+pir_output_is( <<'CODE', <<'OUTPUT', "HLL and namespace directives" );
+.HLL '_Tcl'
+.namespace ['Foo'; 'Bar']
+
+.HLL 'Tcl'
+
+.sub main :main
+  $P0 = get_namespace
+  $P1 = $P0.'get_name'()
+  $S0 = join "::", $P1
+  print $S0
+  print "\n"
+  end
+.end
+CODE
+tcl
+OUTPUT
+
+{
+    my $temp_a = "temp_a.pir";
+
+    END {
+        unlink($temp_a);
+    }
+
+    open $S, '>', $temp_a or die "Can't write $temp_a";
+    print $S <<'EOF';
+.HLL 'eek'
+
+.sub foo :load :anon
+  $P1 = new ['String']
+  $P1 = "3.14\n"
+  set_global '$whee', $P1
+.end
+
+.sub bark
+  $P0 = get_global '$whee'
+  print $P0
+.end
+EOF
+    close $S;
+
+    pir_output_is( <<'CODE', <<'OUTPUT', ":anon subs still get default namespace" );
+.HLL 'cromulent'
+
+.sub what
+   load_bytecode 'temp_a.pir'
+  .local pmc var
+   var = get_root_namespace
+   var = var['eek']
+   var = var['bark']
+
+    var()
+.end
+CODE
+3.14
+OUTPUT
+}
+
+SKIP:
+{
+    skip( "immediate test, doesn't with --run-pbc", 1 )
+        if ( exists $ENV{TEST_PROG_ARGS} and $ENV{TEST_PROG_ARGS} =~ m/--run-pbc/ );
+
+    pir_output_is( <<'CODE', <<'OUTPUT', "get_global in current" );
+.HLL 'bork'
+.namespace []
+
+.sub a :immediate
+  $P1 = new ['String']
+  $P1 = "ok\n"
+  set_global ['sub_namespace'], "eek", $P1
+.end
+
+.namespace [ 'sub_namespace' ]
+
+.sub whee :main
+ $P1 = get_global 'eek'
+ print $P1
+.end
+CODE
+ok
+OUTPUT
+}
+
+open $S, '>', "$temp_b.pir" or die "Can't write $temp_b.pir";
+print $S <<'EOF';
+.HLL 'B'
+.sub b_foo
+    print "b_foo\n"
+.end
+EOF
+close $S;
+
+pir_output_is( <<"CODE", <<'OUTPUT', "export_to -- success with array" );
+.HLL 'A'
+.sub main :main
+    a_foo()
+    load_bytecode "$temp_b.pir"
+    .local pmc nsr, nsa, nsb, ar
+    ar = new ['ResizableStringArray']
+    push ar, "b_foo"
+    nsr = get_root_namespace
+    nsa = nsr['a']
+    nsb = nsr['b']
+    nsb."export_to"(nsa, ar)
+    b_foo()
+.end
+
+.sub a_foo
+    print "a_foo\\n"
+.end
+CODE
+a_foo
+b_foo
+OUTPUT
+
+pir_output_is( <<"CODE", <<'OUTPUT', "export_to -- success with hash (empty value)" );
+.HLL 'A'
+.sub main :main
+    a_foo()
+    load_bytecode "$temp_b.pir"
+    .local pmc nsr, nsa, nsb, ar
+    ar = new ['Hash']
+    ar["b_foo"] = ""
+    nsr = get_root_namespace
+    nsa = nsr['a']
+    nsb = nsr['b']
+    nsb."export_to"(nsa, ar)
+    b_foo()
+.end
+
+.sub a_foo
+    print "a_foo\\n"
+.end
+CODE
+a_foo
+b_foo
+OUTPUT
+
+pir_output_is( <<"CODE", <<'OUTPUT', "export_to -- success with hash (null value)" );
+.HLL 'A'
+.sub main :main
+    a_foo()
+    load_bytecode "$temp_b.pir"
+    .local pmc nsr, nsa, nsb, ar, nul
+    nul = new ['Null']
+    ar  = new ['Hash']
+    ar["b_foo"] = nul
+    nsr = get_root_namespace
+    nsa = nsr['a']
+    nsb = nsr['b']
+    nsb."export_to"(nsa, ar)
+    b_foo()
+.end
+
+.sub a_foo
+    print "a_foo\\n"
+.end
+CODE
+a_foo
+b_foo
+OUTPUT
+
+pir_error_output_like( <<"CODE", <<'OUTPUT', "export_to -- success with hash (and value)" );
+.HLL 'A'
+.sub main :main
+    a_foo()
+    load_bytecode "$temp_b.pir"
+    .local pmc nsr, nsa, nsb, ar
+    ar = new ['Hash']
+    ar["b_foo"] = "c_foo"
+    nsr = get_root_namespace
+    nsa = nsr['a']
+    nsb = nsr['b']
+    nsb."export_to"(nsa, ar)
+    c_foo()
+    b_foo()
+.end
+
+.sub a_foo
+    print "a_foo\\n"
+.end
+CODE
+/^a_foo
+b_foo
+Could not find non-existent sub b_foo/
+OUTPUT
+
+
+pir_output_is( <<'CODE', <<'OUTPUT', "get_parent" );
+.sub main :main
+    .local pmc ns
+    ns = get_hll_namespace ['Foo']
+    ns = ns.'get_parent'()
+    print ns
+    print "\n"
+.end
+.namespace ['Foo']
+.sub dummy
+.end
+CODE
+parrot
+OUTPUT
+
+pir_output_is( <<'CODE', <<'OUTPUT', "get_global [''], \"print_ok\"" );
+.namespace ['']
+
+.sub print_ok
+  print "ok\n"
+  .return()
+.end
+
+.namespace ['foo']
+
+.sub main :main
+  $P0 = get_hll_global [''], 'print_ok'
+  $P0()
+  end
+.end
+CODE
+ok
+OUTPUT
+
+pir_output_is( <<'CODE', <<'OUTPUT', "get_global with array ('')" );
+.namespace ['']
+
+.sub print_ok
+  print "ok\n"
+  .return()
+.end
+
+.namespace ['foo']
+
+.sub main :main
+  $P0 = new ['ResizableStringArray']
+  $P0[0] = ''
+  $P0 = get_hll_global $P0, 'print_ok'
+  $P0()
+  end
+.end
+CODE
+ok
+OUTPUT
+
+pir_output_is( <<'CODE', <<'OUTPUT', "get_global with empty array" );
+.namespace []
+
+.sub print_ok
+  print "ok\n"
+  .return()
+.end
+
+.namespace ['foo']
+
+.sub main :main
+  $P0 = new ['ResizablePMCArray']
+  $P0 = 0
+  $P0 = get_hll_global $P0, 'print_ok'
+  $P0()
+  end
+.end
+CODE
+ok
+OUTPUT
+
+pir_output_is( <<'CODE', <<'OUTPUT', "Namespace.get_global() with array ('')" );
+.namespace ['']
+
+.sub print_ok
+  print "ok\n"
+  .return()
+.end
+
+.namespace ['foo']
+
+.sub main :main
+  $P1 = new ['ResizableStringArray']
+  $P1[0] = ''
+  $P1 = get_hll_global $P1, 'print_ok'
+  $P1()
+  end
+.end
+CODE
+ok
+OUTPUT
+
+pir_output_is( <<'CODE', <<'OUTPUT', "Namespace introspection" );
+.sub main :main
+    .local pmc f
+    f = get_hll_global ['Foo'], 'dummy'
+    f()
+.end
+.namespace ['Foo']
+.sub dummy
+    .local pmc interp, ns_caller
+    interp = getinterp
+    ns_caller = interp['namespace'; 1]
+    print ns_caller
+    print "\n"
+.end
+CODE
+parrot
+OUTPUT
+
+pir_output_is( <<'CODE', <<'OUTPUT', "Nested namespace introspection" );
+.sub main :main
+    .local string no_symbol
+
+    .local pmc foo_ns
+    foo_ns = get_hll_namespace [ 'Foo' ]
+    $S0    = foo_ns
+    print "Found namespace: "
+    print $S0
+    print "\n"
+
+    .local pmc bar_ns
+    bar_ns = foo_ns.'find_namespace'( 'Bar' )
+    $S0    = bar_ns
+    print "Found nested namespace: "
+    print $S0
+    print "\n"
+
+    .local pmc baz_ns
+    baz_ns    = bar_ns.'find_namespace'( 'Baz' )
+    no_symbol = 'Baz'
+
+    .local int is_defined
+    is_defined = defined baz_ns
+    if is_defined goto oops
+    goto find_symbols
+
+  oops:
+    print "Found non-null '"
+    print no_symbol
+    print "'\n"
+    .return()
+
+  find_symbols:
+    .local pmc a_sub
+    a_sub = bar_ns.'find_sub'( 'a_sub' )
+    $S0   = a_sub
+    a_sub()
+    print "Found sub: "
+    print $S0
+    print "\n"
+
+    .local pmc some_sub
+    some_sub  = bar_ns.'find_sub'( 'some_sub' )
+    no_symbol = 'some_sub'
+
+    is_defined = defined some_sub
+    if is_defined goto oops
+
+    .local pmc a_var
+    a_var    = bar_ns.'find_var'( 'a_var' )
+    print "Found var: "
+    print a_var
+    print "\n"
+
+    .local pmc some_var
+    some_var    = bar_ns.'find_var'( 'some_var' )
+    no_symbol = 'some_var'
+
+    is_defined = defined some_var
+    if is_defined goto oops
+
+.end
+
+.namespace ['Foo']
+
+.sub some_sub
+.end
+
+.namespace [ 'Foo'; 'Bar' ]
+
+.sub a_sub
+    .local pmc some_var
+    some_var = new ['String']
+    some_var = 'a string PMC'
+    set_hll_global [ 'Foo'; 'Bar' ], 'a_var', some_var
+.end
+CODE
+Found namespace: Foo
+Found nested namespace: Bar
+Found sub: a_sub
+Found var: a string PMC
+OUTPUT
+
+pir_output_is( <<'CODE', <<'OUTPUT', 'get_root_namespace' );
+.sub main :main
+    .local pmc root_ns
+    root_ns = get_root_namespace
+    .local int is_defined
+    is_defined = defined root_ns
+    unless is_defined goto NO_NAMESPACE_FOUND
+        print "Found root namespace.\n"
+    NO_NAMESPACE_FOUND:
+.end
+CODE
+Found root namespace.
+OUTPUT
+
+pir_output_is( <<'CODE', <<'OUTPUT', 'root namespace is not a class' );
+.sub main :main
+    .local pmc root_ns
+    root_ns = get_root_namespace
+    .local pmc root_class
+    root_class = get_class root_ns
+    .local int is_class
+    is_class = defined root_class
+    say is_class
+.end
+CODE
+0
+OUTPUT
+
+pir_output_is( <<'CODE', <<'OUTPUT', 'get_root_namespace "Foo"' );
+.sub main :main
+    .local pmc foo_ns
+    foo_ns = get_root_namespace [ "foo" ]
+    .local int is_defined
+    is_defined = defined foo_ns
+    unless is_defined goto NO_NAMESPACE_FOUND
+        print "Found root namespace 'foo'.\n"
+    NO_NAMESPACE_FOUND:
+.end
+.HLL 'Foo'
+.sub dummy
+.end
+CODE
+Found root namespace 'foo'.
+OUTPUT
+
+pir_output_is( <<'CODE', <<'OUTPUT', 'get_root_namespace "Foo", not there' );
+.sub main :main
+    .local pmc foo_ns
+    foo_ns = get_root_namespace [ "Foo" ]
+    .local int is_defined
+    is_defined = defined foo_ns
+    if is_defined goto NAMESPACE_FOUND
+        print "Didn't find root namespace 'Foo'.\n"
+    NAMESPACE_FOUND:
+.end
+
+.namespace [ "NotFoo" ]
+CODE
+Didn't find root namespace 'Foo'.
+OUTPUT
+
+my $create_nested_key = <<'CREATE_NESTED_KEY';
+.sub create_nested_key
+    .param string name
+    .param pmc other_names :slurpy
+
+    .local pmc key
+    key = new ['Key']
+    key = name
+
+    .local int elem
+    elem = other_names
+
+    if elem goto nested
+    .return( key )
+
+  nested:
+    .local pmc tail
+    tail = create_nested_key(other_names :flat)
+    push key, tail
+
+    .return( key )
+.end
+CREATE_NESTED_KEY
+
+pir_output_is( <<"CODE", <<'OUTPUT', 'get_name()' );
+$create_nested_key
+
+.sub main :main
+    .local pmc key
+    key = create_nested_key( 'SingleName' )
+    print_namespace( key )
+
+    key = create_nested_key( 'Nested', 'Name', 'Space' )
+    print_namespace( key )
+
+    key = get_namespace
+
+    .local pmc ns
+    ns = key.'get_name'()
+
+    .local string ns_name
+    ns_name = join ';', ns
+    print ns_name
+    print "\\n"
+.end
+
+.sub 'print_namespace'
+    .param pmc key
+
+    .local pmc get_ns
+    get_ns = get_global key, 'get_namespace'
+
+    .local pmc ns
+    ns = get_ns()
+
+    .local pmc name_array
+    name_array = ns.'get_name'()
+
+    .local string name
+    name = join ';', name_array
+
+    print name
+    print "\\n"
+.end
+
+.sub get_namespace
+    .local pmc ns
+    ns = get_namespace
+    .return( ns )
+.end
+
+.namespace [ 'SingleName' ]
+
+.sub get_namespace
+    .local pmc ns
+    ns = get_namespace
+    .return( ns )
+.end
+
+.namespace [ 'Nested'; 'Name'; 'Space' ]
+
+.sub get_namespace
+    .local pmc ns
+    ns = get_namespace
+    .return( ns )
+.end
+
+CODE
+parrot;SingleName
+parrot;Nested;Name;Space
+parrot
+OUTPUT
+
+pir_output_is( <<"CODE", <<'OUTPUT', 'add_namespace()' );
+$create_nested_key
+
+.sub main :main
+    .local pmc root_ns
+    root_ns = get_namespace
+
+    .local pmc child_ns
+    child_ns = new ['NameSpace']
+    root_ns.'add_namespace'( 'Nested', child_ns )
+
+    .local pmc grandchild_ns
+    grandchild_ns = new ['NameSpace']
+    child_ns.'add_namespace'( 'Grandkid', grandchild_ns )
+
+    .local pmc great_grandchild_ns
+    great_grandchild_ns = new ['NameSpace']
+    grandchild_ns.'add_namespace'( 'Greatgrandkid', great_grandchild_ns )
+
+    .local pmc parent
+    parent = great_grandchild_ns.'get_parent'()
+    print_ns_name( parent )
+
+    parent = parent.'get_parent'()
+    print_ns_name( parent )
+
+    parent = parent.'get_parent'()
+    print_ns_name( parent )
+.end
+
+.sub print_ns_name
+    .param pmc namespace
+
+    .local pmc ns
+    ns = namespace.'get_name'()
+
+    .local string ns_name
+    ns_name = join ';', ns
+    print ns_name
+    print "\\n"
+.end
+CODE
+parrot;Nested;Grandkid
+parrot;Nested
+parrot
+OUTPUT
+
+pir_output_like( <<'CODE', <<'OUTPUT', 'add_namespace() with error' );
+.sub main :main
+    .local pmc ns_child
+    ns_child = subclass 'NameSpace', 'NSChild'
+
+    .local pmc child
+    child = new ['NSChild']
+
+    .local pmc root_ns
+    root_ns = get_namespace
+
+    root_ns.'add_namespace'( 'Really nested', child )
+
+    .local pmc not_a_ns
+    not_a_ns = new ['Integer']
+
+    push_eh _invalid_ns
+    root_ns.'add_namespace'( 'Nested', not_a_ns )
+    end
+
+_invalid_ns:
+    .local pmc exception
+    .local string message
+    .get_results( exception )
+
+    message = exception
+    print message
+    print "\n"
+.end
+CODE
+/Invalid type \d+ in add_namespace\(\)/
+OUTPUT
+
+pir_output_is( <<"CODE", <<'OUTPUT', 'add_sub()' );
+$create_nested_key
+
+.sub 'main' :main
+    .local pmc report_ns
+    report_ns = get_global 'report_namespace'
+
+    .local pmc key
+    key = create_nested_key( 'Parent' )
+
+    .local pmc parent_ns
+    parent_ns = get_namespace key
+    parent_ns.'add_sub'( 'report_ns', report_ns )
+
+    key = create_nested_key( 'Parent', 'Child' )
+
+    .local pmc child_ns
+    child_ns = get_namespace key
+    child_ns.'add_sub'( 'report_ns', report_ns )
+
+    .local pmc report_namespace
+    report_namespace = get_global [ 'Parent' ], 'report_ns'
+    report_namespace()
+
+    report_namespace = get_global [ 'Parent'; 'Child' ], 'report_ns'
+    report_namespace()
+.end
+
+.sub 'report_namespace'
+    .local pmc namespace
+    namespace = get_namespace
+
+    .local pmc ns
+    ns = namespace.'get_name'()
+
+    .local string ns_name
+    ns_name = join ';', ns
+    print ns_name
+    print "\\n"
+.end
+
+.namespace [ 'Parent' ]
+
+.sub dummy
+.end
+
+.namespace [ 'Parent'; 'Child' ]
+
+.sub dummy
+.end
+CODE
+parrot
+parrot
+OUTPUT
+
+pir_output_like( <<'CODE', <<'OUTPUT', 'add_sub() with error' );
+.sub main :main
+    .local pmc s_child
+    s_child = subclass 'Sub', 'SubChild'
+
+    .local pmc child
+    child = new ['SubChild']
+
+    .local pmc root_ns
+    root_ns = get_namespace
+
+    root_ns.'add_sub'( 'child', child )
+    print "Added sub child\n"
+
+    child = new ['Coroutine']
+    root_ns.'add_sub'( 'coroutine', child )
+    print "Added coroutine\n"
+
+    child = new ['Eval']
+    root_ns.'add_sub'( 'eval', child )
+    print "Added eval\n"
+
+    .local pmc not_a_sub
+    not_a_sub = new ['Integer']
+
+    push_eh _invalid_sub
+    root_ns.'add_sub'( 'Nested', not_a_sub )
+    end
+
+_invalid_sub:
+    .local pmc exception
+    .local string message
+    .get_results( exception )
+
+    message = exception
+    print message
+    print "\n"
+.end
+CODE
+/Added sub child
+Added coroutine
+Added eval
+Invalid type \d+ in add_sub\(\)/
+OUTPUT
+
+pir_output_is( <<"CODE", <<'OUTPUT', 'add_var()' );
+$create_nested_key
+
+.sub 'main' :main
+    .local pmc foo
+    foo = new ['String']
+    foo = 'Foo'
+
+    .local pmc bar
+    bar = new ['String']
+    bar = 'Bar'
+
+    .local pmc key
+    key = create_nested_key( 'Parent' )
+
+    .local pmc parent_ns
+    parent_ns = get_namespace key
+    parent_ns.'add_var'( 'foo', foo )
+
+    key = create_nested_key( 'Parent', 'Child' )
+
+    .local pmc child_ns
+    child_ns = get_namespace key
+    child_ns.'add_var'( 'bar', bar )
+
+    .local pmc my_var
+    my_var = get_global [ 'Parent' ], 'foo'
+    print "Foo: "
+    print my_var
+    print "\\n"
+
+    my_var = get_global [ 'Parent'; 'Child' ], 'bar'
+    print "Bar: "
+    print my_var
+    print "\\n"
+.end
+
+.namespace [ 'Parent' ]
+
+.sub dummy
+.end
+
+.namespace [ 'Parent'; 'Child' ]
+
+.sub dummy
+.end
+CODE
+Foo: Foo
+Bar: Bar
+OUTPUT
+
+pir_output_is( <<"CODE", <<'OUTPUT', 'del_namespace()' );
+$create_nested_key
+
+.sub 'main' :main
+    .local pmc root_ns
+    root_ns = get_namespace
+
+    .local pmc key
+    key      = create_nested_key( 'Parent' )
+
+    .local pmc child_ns
+    child_ns = root_ns.'find_namespace'( key )
+
+    key      = create_nested_key( 'Child' )
+
+    .local pmc grandchild_ns
+    grandchild_ns = child_ns.'find_namespace'( key )
+
+    child_ns.'del_namespace'( 'Child' )
+
+    key      = create_nested_key( 'Child' )
+
+    grandchild_ns = child_ns.'find_namespace'( key )
+    if_null grandchild_ns, CHECK_SIBLING
+    print "Grandchild still exists\\n"
+
+  CHECK_SIBLING:
+    key      = create_nested_key( 'Sibling' )
+    grandchild_ns = child_ns.'find_namespace'( key )
+    if_null grandchild_ns, DELETE_PARENT
+    print "Sibling not deleted\\n"
+
+  DELETE_PARENT:
+    key      = create_nested_key( 'Parent' )
+    root_ns.'del_namespace'( 'Parent' )
+    child_ns = root_ns.'find_namespace'( key )
+    if_null child_ns, CHECK_UNCLE
+    print "Child still exists\\n"
+
+  CHECK_UNCLE:
+    key      = create_nested_key( 'FunUncle' )
+    grandchild_ns = root_ns.'find_namespace'( key )
+    if_null grandchild_ns, DELETE_PARENT
+    print "Fun uncle stuck around\\n"
+
+  ALL_DONE:
+.end
+
+.namespace [ 'FunUncle' ]
+
+.sub dummy
+.end
+
+.namespace [ 'Parent' ]
+
+.sub dummy
+.end
+
+.namespace [ 'Parent'; 'Child' ]
+
+.sub dummy
+.end
+
+.namespace [ 'Parent'; 'Sibling' ]
+
+.sub dummy
+.end
+CODE
+Sibling not deleted
+Fun uncle stuck around
+OUTPUT
+
+pir_output_like( <<'CODE', <<'OUTPUT', 'del_namespace() with error' );
+.sub dummy
+.end
+
+.sub main :main
+    .local pmc not_a_ns
+    not_a_ns = new ['Array']
+
+    set_global 'Not_A_NS', not_a_ns
+
+    .local pmc root_ns
+    root_ns = get_namespace
+    delete_namespace( root_ns, 'dummy' )
+    delete_namespace( root_ns, 'Not_A_NS' )
+.end
+
+.sub delete_namespace
+    .param pmc    root_ns
+    .param string name
+    push_eh _invalid_ns
+    root_ns.'del_namespace'( name )
+
+_invalid_ns:
+    .local pmc exception
+    .local string message
+    .get_results( exception )
+
+    message = exception
+    print message
+    print "\n"
+    .return()
+.end
+CODE
+/Invalid type \d+ for 'dummy' in del_namespace\(\)
+Invalid type \d+ for 'Not_A_NS' in del_namespace\(\)/
+OUTPUT
+
+pir_output_is( <<"CODE", <<'OUTPUT', 'del_sub()' );
+.sub 'main' :main
+    .local pmc root_ns
+    root_ns = get_namespace
+
+    .local pmc parent_ns
+    parent_ns = root_ns.'find_namespace'( 'Parent' )
+    parent_ns.'del_sub'( 'dummy' )
+
+    .local pmc my_sub
+    my_sub = get_global [ 'Parent' ], 'dummy'
+    if_null my_sub, PARENT_NO_DUMMY
+    print "Parent did not delete dummy\\n"
+
+  PARENT_NO_DUMMY:
+    my_sub = get_global [ 'Parent' ], 'no_dummy'
+    my_sub()
+
+    .local pmc child_ns
+    child_ns = parent_ns.'find_namespace'( 'Child' )
+    child_ns.'del_sub'( 'dummy' )
+
+    my_sub = get_global [ 'Parent'; 'Child' ], 'dummy'
+    if_null my_sub, CHILD_NO_DUMMY
+    print "Child did not delete dummy\\n"
+    my_sub()
+
+  CHILD_NO_DUMMY:
+    my_sub = get_global [ 'Parent'; 'Child' ], 'no_dummy'
+    my_sub()
+.end
+
+.namespace [ 'Parent' ]
+
+.sub dummy
+.end
+
+.sub no_dummy
+    print "Parent is no dummy\\n"
+.end
+
+.namespace [ 'Parent'; 'Child' ]
+
+.sub dummy
+    print "Dummy sub!\\n"
+.end
+
+.sub no_dummy
+    print "Child is no dummy\\n"
+.end
+
+CODE
+Parent is no dummy
+Child is no dummy
+OUTPUT
+
+pir_output_like( <<'CODE', <<'OUTPUT', 'del_sub() with error' );
+.sub main :main
+    .local pmc not_a_ns
+    not_a_ns = new ['Array']
+
+    set_global 'Not_A_Sub', not_a_ns
+
+    .local pmc root_ns
+    root_ns = get_namespace
+
+    push_eh _invalid_sub
+    root_ns.'del_sub'( 'Not_A_Sub' )
+
+_invalid_sub:
+    .local pmc exception
+    .local string message
+    .get_results( exception )
+
+    message = exception
+    print message
+    print "\n"
+    .return()
+.end
+CODE
+/Invalid type \d+ for 'Not_A_Sub' in del_sub\(\)/
+OUTPUT
+
+pir_output_is( <<"CODE", <<'OUTPUT', 'del_var()' );
+.sub 'main' :main
+    .local pmc foo
+    foo = new ['String']
+    foo = 'Foo'
+
+    .local pmc bar
+    bar = new ['String']
+    bar = 'Bar'
+
+    set_global [ 'Parent' ],          'Foo', foo
+    set_global [ 'Parent'; 'Child' ], 'Bar', bar
+
+    .local pmc root_ns
+    root_ns = get_namespace
+
+    .local pmc parent_ns
+    parent_ns = root_ns.'find_namespace'( 'Parent' )
+    parent_ns.'del_var'( 'Foo' )
+
+    .local pmc child_ns
+    child_ns = parent_ns.'find_namespace'( 'Child' )
+    child_ns.'del_var'( 'Bar' )
+
+    .local pmc my_var
+    my_var = get_global [ 'Parent' ], 'Foo'
+    if_null my_var, TEST_CHILD_VAR
+    print "Parent Foo exists: "
+    print my_var
+    print "\\n"
+
+  TEST_CHILD_VAR:
+    my_var = get_global [ 'Parent'; 'Child' ], 'Bar'
+    if_null my_var, ALL_DONE
+    print "Child Bar exists: "
+    print my_var
+    print "\\n"
+
+  ALL_DONE:
+.end
+
+.namespace [ 'Parent' ]
+
+.sub dummy
+.end
+
+.namespace [ 'Parent'; 'Child' ]
+
+CODE
+OUTPUT
+
+pir_error_output_like( <<'CODE', <<'OUTPUT', 'overriding find_method()' );
+.sub 'main' :main
+    $P0 = newclass 'Override'
+    $P1 = new ['Override']
+    $P2 = find_method $P1, 'foo'
+.end
+
+.namespace [ 'Override' ]
+
+.sub 'find_method' :vtable
+    .param string method
+    say "Finding method"
+.end
+CODE
+/Finding method/
+OUTPUT
+
+pir_output_is( <<'CODE', <<OUT, "iterate through a NameSpace PMC" );
+.sub main :main
+     $P0 = new ['String']
+     $P0 = "Ook...BANG!\n"
+     set_root_global [ "DUMMY"; "X"; "Y" ], "Explosion", $P0
+
+     $P1 = new ['Integer']
+     $P1 = 0
+     set_root_global [ "DUMMY"; "X"; "Y" ], "T0", $P0
+
+     .local pmc dummy_x_y_ns, it, res
+     dummy_x_y_ns = get_root_namespace [ "DUMMY"; "X"; "Y" ]
+     it   = iter dummy_x_y_ns
+     res  = new ['ResizablePMCArray']
+loop:
+     unless it goto loop_end
+     $S0 = shift it
+     push res, $S0
+     goto loop
+loop_end:
+
+     res.'sort'()
+     $S0 = join ' ', res
+     say $S0
+
+.end
+CODE
+Explosion T0
+OUT
+
+pir_error_output_like( <<'CODE', <<OUT, "NameSpace with no class" );
+.sub 'main' :main
+    $P1 = new ['NameSpace']
+    set_args '(0)', $P1
+    tailcallmethod $P1, 'bob'
+.end
+CODE
+/Null PMC access in get_string()/
+OUT
+
+pir_output_is( <<'CODE', <<OUT, "iterate through a NameSpace PMC" );
+.namespace [ 'bar' ]
+
+.sub 'main' :main
+    .local pmc res
+    res = new ['ResizablePMCArray']
+
+    $P0 = get_namespace
+    say $P0
+    $I0 = elements $P0
+    say $I0
+    $P1 = iter $P0
+  L1:
+    unless $P1 goto L2
+    $P2 = shift $P1
+    $S0 = $P2
+    push res, $S0
+    goto L1
+  L2:
+    res.'sort'()
+    $S0 = join "\n", res
+    say $S0
+    say 'OK'
+.end
+
+.sub 'foo'
+    say 'foo'
+.end
+CODE
+bar
+2
+foo
+main
+OK
+OUT
+
+pir_output_is( <<'CODE', <<'OUT', "make_namespace method");
+.sub 'main' :main
+    $P0 = split ';', 'perl6;Foo;Bar'
+    $P1 = get_root_namespace
+    $P2 = $P1.'make_namespace'($P0)
+    $I0 = isa $P2, 'NameSpace'
+    say $I0
+    $P3 = get_root_namespace ['perl6';'Foo';'Bar']
+    $I0 = isnull $P3
+    say $I0
+    $I0 = issame $P2, $P3
+    say $I0
+.end
+CODE
+1
+0
+1
+OUT
+
+pir_error_output_like( <<'CODE', <<'OUT', 'adding :anon sub to a namespace, TT #56' );
+.namespace ['Foo']
+.sub main :main
+    .const 'Sub' $P0 = 'bar'
+
+    set_global 'ok', $P0
+    $P1 = get_global 'ok'
+    say $P1
+    $S0 = ok()
+    say $S0
+    $S0 = nok()
+    say $S0
+.end
+
+.namespace []
+.sub 'nok' :anon :subid('bar')
+    .return( 'ok 1' )
+.end
+CODE
+/
+ok 1
+Could not find non-existent sub nok/
+OUT
+
+
+pir_output_is( <<'CODE', <<'OUT', 'HLL_map on namespace', todo => 'TT #867');
+.HLL 'tcl'
+
+.sub 'foo' :anon :init
+  $P1 = get_class 'NameSpace'
+  $P2 = subclass $P1, 'BSNS'
+  $P0 = getinterp
+  $P0.'hll_map'($P1, $P2)
+.end
+
+.namespace ['a';'b';'c']
+
+.sub 'hi'
+  noop
+.end
+
+.namespace []
+
+.sub 'blah' :main
+  $P1 = get_hll_namespace ['a';'b';'c']
+  $S0 = typeof $P1
+  print 'ok 1 - '
+  say $S0
+.end
+CODE
+ok 1 - BSNS
+OUT
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/t/pmc/namespace.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/namespace.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/namespace.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,17 +1,10 @@
-#! perl
-# Copyright (C) 2001-2009, Parrot Foundation.
+#! parrot
+# Copyright (C) 2006-2007, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 67;
-use Parrot::Config;
-
 =head1 NAME
 
-t/pmc/namespace.t - test the NameSpace PMC as described in PDD 21.
+t/pmc/namepspace.t - test NameSpace PMC
 
 =head1 SYNOPSIS
 
@@ -19,1798 +12,651 @@
 
 =head1 DESCRIPTION
 
-Test the NameSpace PMC as described in PDD21.
+Tests the NameSpace PMC. Some things that it tests specifically:
 
-=cut
+=over 4
 
-# L<PDD21/Namespace PMC API/>
-pir_output_is( <<'CODE', <<'OUT', 'new' );
-.sub 'test' :main
-    new $P0, ['NameSpace']
-    say "ok 1 - $P0 = new ['NameSpace']"
-.end
-CODE
-ok 1 - $P0 = new ['NameSpace']
-OUT
+=item* Creating new NameSpace PMCs
 
-# L<PDD21/Namespace PMC API/=head4 Untyped Interface>
-pir_output_is( <<'CODE', <<'OUT', 'NameSpace does "hash"' );
-.sub 'test' :main
-    new $P0, ['NameSpace']
-    $I0 = does $P0, 'hash'
-    if $I0 goto ok_1
-    print 'not '
-  ok_1:
-    say 'ok 1 - NameSpace does "hash"'
-.end
-CODE
-ok 1 - NameSpace does "hash"
-OUT
+=item* Verify that things which are supposed to return a NameSpace actually
+do.
 
-# L<PDD21//>
-pir_output_is( <<'CODE', <<'OUTPUT', "get_global bar" );
-.sub 'main' :main
-    $P0 = get_global "bar"
-    print "ok\n"
-    $P0()
-.end
+=item* Various forms of get_global opcode
 
-.sub 'bar'
-    print "bar\n"
-.end
-CODE
-ok
-bar
-OUTPUT
+=item* Finding and calling Subs which are stored in the NameSpace
 
-pir_output_is( <<'CODE', <<'OUTPUT', "verify NameSpace type" );
-.sub 'main' :main
-    $P0 = get_global "Foo"
-    typeof $S0, $P0
-    print $S0
-    print "\n"
-.end
+=item* Methods on the NameSpace PMC
 
-.namespace ["Foo"]
-.sub 'bar'
-    noop
-.end
-CODE
-NameSpace
-OUTPUT
+=item* Building NameSpace hierarchies on the fly
 
-pir_output_is( <<'CODE', <<'OUTPUT', "get_global Foo::bar" );
-.sub 'main' :main
-    $P0 = get_global ["Foo"], "bar"
-    print "ok\n"
-    $P0()
-.end
+=item* HLL NameSpaces
 
-.namespace ["Foo"]
-.sub 'bar'
-    print "bar\n"
-.end
-CODE
-ok
-bar
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', "get_namespace Foo::bar" );
-.sub 'main' :main
-    $P0 = get_global ["Foo"], "bar"
-    print "ok\n"
-    $P1 = $P0."get_namespace"()
-    print $P1
-    print "\n"
-.end
+=back
 
-.namespace ["Foo"]
-.sub 'bar'
-.end
-CODE
-ok
-Foo
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', "get_global Foo::bar ns" );
-.sub 'main' :main
-    $P1 = get_global ["Foo"], "bar"
-    print "ok\n"
-    $P1()
-.end
+Items that need to be tested according to PDD21, or the current source code
+of the NameSpace PMC:
 
-.namespace ["Foo"]
-.sub 'bar'
-    print "bar\n"
-.end
-CODE
-ok
-bar
-OUTPUT
+=over 4
 
-pir_output_is( <<'CODE', <<'OUTPUT', "get_global Foo::bar hash" );
-.sub 'main' :main
-    $P0 = get_global "Foo"
-    $P1 = $P0["bar"]
-    print "ok\n"
-    $P1()
-.end
+=item* methods: add_sub, del_sub, del_var, del_namespace
 
-.namespace ["Foo"]
-.sub 'bar'
-    print "bar\n"
-.end
-CODE
-ok
-bar
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', "get_global Foo::Bar::baz" );
-.sub 'main' :main
-    $P2 = get_global ["Foo";"Bar"], "baz"
-    print "ok\n"
-    $P2()
-.end
+=item* Typed and Untyped interfaces
 
-.namespace ["Foo" ; "Bar"]
-.sub 'baz'
-    print "baz\n"
-.end
-CODE
-ok
-baz
-OUTPUT
-
-pir_error_output_like( <<'CODE', <<'OUTPUT', "get_global Foo::bazz not found" );
-.sub 'main' :main
-    $P2 = get_global ["Foo"], "bazz"
-    $P2()
-    print "ok\n"
-.end
-CODE
-/Null PMC access in invoke\(\)/
-OUTPUT
+=item* Subclassing NameSpace (If it's possible)
 
-# [this used to behave differently from the previous case.]
-pir_error_output_like( <<'CODE', <<'OUTPUT', "get_global Foo::Bar::bazz not found" );
-.sub 'main' :main
-    $P2 = get_global ["Foo";"Bar"], "bazz"
-    $P2()
-    print "ok\n"
-.end
-CODE
-/Null PMC access in invoke\(\)/
-OUTPUT
+=item* .'export_to'()
 
-pir_output_is( <<'CODE', <<'OUTPUT', "get_global Foo::Bar::baz hash" );
-.sub 'main' :main
-    $P0 = get_global "Foo"
-    $P1 = $P0["Bar"]
-    $P2 = $P1["baz"]
-    print "ok\n"
-    $P2()
-.end
+Although NameSpace.'export_to'() is used in test_more.pir.
 
-.namespace ["Foo"; "Bar"]
-.sub 'baz'
-    print "baz\n"
-.end
-CODE
-ok
-baz
-OUTPUT
+=back
 
-pir_output_is( <<'CODE', <<'OUTPUT', "get_global Foo::Bar::baz hash 2" );
-.sub 'main' :main
-    $P0 = get_global "Foo"
-    $P1 = $P0["Bar" ; "baz"]
-    print "ok\n"
-    $P1()
-.end
+=cut
 
-.namespace ["Foo"; "Bar"]
-.sub 'baz'
-    print "baz\n"
-.end
-CODE
-ok
-baz
-OUTPUT
+.namespace []
 
-pir_output_is( <<'CODE', <<'OUTPUT', "get_global Foo::Bar::baz alias" );
-.sub 'main' :main
-    $P0 = get_global "Foo"
-    $P1 = $P0["Bar"]
-    set_global "TopBar", $P1
-    $P2 = get_global ["TopBar"], "baz"
-    print "ok\n"
-    $P2()
-.end
+.sub main :main
+    .include 'test_more.pir'
+    plan(70)
 
-.namespace ["Foo"; "Bar"]
-.sub 'baz'
-    print "baz\n"
+    create_namespace_pmc()
+    verify_namespace_type()
+    get_namespace_class()
+    get_global_opcode()
+    get_sub_from_namespace_hash()
+    access_sub_in_namespace()
+    get_namespace_from_sub()
+    build_namespaces_at_runtime()
+    hll_namespaces()
+    anon_function_namespace()
+    find_name_opcode()
+    namespace_methods()
+    export_to_method()
 .end
-CODE
-ok
-baz
-OUTPUT
 
-pir_error_output_like( <<'CODE', <<'OUTPUT', "func() namespace resolution" );
-.sub 'main' :main
-    print "calling foo\n"
-    foo()
-    print "calling Foo::foo\n"
-    $P0 = get_global ["Foo"], "foo"
-    $P0()
-    print "calling baz\n"
-    baz()
+# L<PDD21/Namespace PMC API/=head4 Untyped Interface>
+.sub 'create_namespace_pmc'
+    push_eh eh1
+    $P0 = new ['NameSpace']
+    ok(1, "Create new Namespace PMC")
+    goto _end
+  eh1:
+    ok(0, "Could not create Namespace PMC")
+  _end:
+    pop_eh
 .end
 
-.sub 'foo'
-    print "  foo\n"
-    bar()
-.end
+.sub 'verify_namespace_type'
+    $P0 = get_global "Foo"
+    typeof $S0, $P0
+    is($S0, "NameSpace", "A NameSpace is a NameSpace")
 
-.sub 'bar'
-    print "  bar\n"
-.end
+    # root namespace
+    $P0 = get_root_namespace
+    typeof $S0, $P0
+    is($S0, "NameSpace", "Root NameSpace is a NameSpace")
 
-.sub 'fie'
-    print "  fie\n"
-.end
+    # While we're here. Prove that the root namespace stringifies to ""
+    $S0 = $P0
+    is($S0, "", "Root NameSpace stringifies to empty string")
 
-.namespace ["Foo"]
+    # parrot namespace
+    $P1 = $P0["parrot"]
+    typeof $S0, $P1
+    is($S0, "NameSpace", "::parrot NameSpace is a NameSpace")
 
-.sub 'foo'
-    print "  Foo::foo\n"
-    bar()
-    fie()
-.end
+    # get_namespace with no args
+    $P0 = get_namespace
+    typeof $S0, $P1
+    is($S0, "NameSpace", "Current NameSpace is a NameSpace")
 
-.sub 'bar'
-    print "  Foo::bar\n"
-.end
+    # Prove that HLL namespace names are mangled to lower-case
+    $P0 = get_root_namespace ["MyHLL"]
+    $I0 = isnull $P0
+    is($I0, 1, "HLL NameSpace names are stored lowercase")
 
-.sub 'baz'
-    print "  Foo::baz\n"
-.end
-CODE
-/calling foo
-  foo
-  bar
-calling Foo::foo
-  Foo::foo
-  Foo::bar
-  fie
-calling baz
-Could not find non-existent sub baz/
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', 'get namespace of :anon .sub' );
-.namespace ['lib']
-.sub main :main :anon
-    $P0 = get_namespace
-    $P0 = $P0.'get_name'()
-    $S0 = join "::", $P0
-    say $S0
-    end
-.end
-CODE
-parrot::lib
-OUTPUT
+    $P0 = get_root_namespace ["myhll"]
+    $I0 = isnull $P0
+    is($I0, 0, "HLL NameSpaces are name-mangled lowercase")
 
-pir_output_is( <<'CODE', <<'OUTPUT', "get namespace in Foo::bar" );
-.sub 'main' :main
-    $P0 = get_global ["Foo"], "bar"
-    print "ok\n"
-    $P0()
-.end
+    # Get an HLL namespace and verify that it's a NameSpace PMC
+    $P0 = get_root_namespace ["myhll"]
+    $S0 = typeof $P0
+    is($S0, "NameSpace", "HLL NameSpaces are NameSpaces too")
 
-.namespace ["Foo"]
-.sub 'bar'
-    print "bar\n"
-    .include "interpinfo.pasm"
-    $P0 = interpinfo .INTERPINFO_CURRENT_SUB
-    $P1 = $P0."get_namespace"()
-    print $P1
-    print "\n"
 .end
-CODE
-ok
-bar
-Foo
-OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', "get namespace in Foo::Bar::baz" );
-.sub 'main' :main
+.sub 'get_namespace_class'
+    # First, prove that we don't have a class until it's created
     $P0 = get_global "Foo"
-    $P1 = $P0["Bar"]
-    $P2 = $P1["baz"]
-    print "ok\n"
-    $P2()
-.end
+    $P1 = get_class $P0
+    $I0 = isnull $P1
+    is($I0, 1, "NameSpace doesn't have a Class till it's created")
+
+    # Can create a new class from a NameSpace
+    $P1 = newclass $P0
+    $I0 = isnull $P1
+    is($I0, 0, "Create Class from NameSpace")
+
+    # New Class is a Class
+    $S0 = typeof $P1
+    is($S0, "Class", "get_class on a NameSpace returns a Class")
+
+    # Class has same name as namespace
+    $S0 = $P0
+    $S1 = $P1
+    is($S0, $S1, "Class has same name as NameSpace")
+
+    # Now, we do have a class
+    $P1 = get_class $P0
+    $I0 = isnull $P1
+    is($I0, 0, "get_class on a NameSpace returns something")
+
+    # Create object from class from NameSpace
+    push_eh eh
+    $P2 = new $P1
+    ok(1, "Can create a new object from a namespace")
+    goto pmc_is_created
+  eh:
+    ok(0, "Cannot create a new object from a namespace")
+  pmc_is_created:
+    pop_eh
+
+    # Object from Class from NameSpace has right type
+    $S0 = typeof $P2
+    is($S0, "Foo", "Object created from class has name of NameSpace")
 
-.namespace ["Foo" ; "Bar"]
-.sub 'baz'
-    print "baz\n"
-    .include "interpinfo.pasm"
-    .include "pmctypes.pasm"
-    $P0 = interpinfo .INTERPINFO_CURRENT_SUB
-    $P1 = $P0."get_namespace"()
-    $P2 = $P1.'get_name'()
-    $S0 = join '::', $P2
-    print $S0
-    print "\n"
-.end
-CODE
-ok
-baz
-parrot::Foo::Bar
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', "segv in get_name" );
-.namespace ['pugs';'main']
-.sub 'main' :main
-    $P0 = find_name "&say"
-    $P0()
-.end
-.sub "&say"
-    say "ok"
 .end
-CODE
-ok
-OUTPUT
 
-pir_output_is( <<'CODE', <<'OUT', "latin1 namespace, global" );
-.namespace [ iso-8859-1:"François" ]
+# L<PDD21//>
+.sub 'get_global_opcode'
+  test1:
+    push_eh eh1
+    $P0 = get_global "baz"
+    $S0 = $P0()
+    is($S0, "", "Can get_global a .sub")
+    goto end_test1
+  eh1:
+    ok(0, "Cannot get_global a .sub")
+  end_test1:
+    pop_eh
+
+  test2:
+    push_eh eh2
+    $P0 = get_global ["Foo"], "baz"
+    $S0 = $P0()
+    is($S0, "Foo", "Get Sub from NameSpace")
+    goto end_test2
+  eh2:
+    ok(0, "Cannot get Sub from NameSpace Foo")
+  end_test2:
+    pop_eh
+
+  test3:
+    push_eh eh3
+    $P0 = get_global ["Foo";"Bar"], "baz"
+    $S0 = $P0()
+    is($S0, "Foo::Bar", "Get Sub from nested NameSpace")
+    goto end_test3
+  eh3:
+    ok(0, "Cannot get Sub from NameSpace Foo::Bar")
+  end_test3:
+    pop_eh
+
+  test4:
+    throws_substring( <<'CODE', 'Null PMC access in invoke', 'Invoking a non-existent sub')
+        .sub main
+            $P0 = get_global ["Foo"], "SUB_THAT_DOES_NOT_EXIST"
+            $P0()
+        .end
+CODE
+
+  test5:
+    # this used to behave differently from the previous case.
+    throws_substring( <<'CODE', 'Null PMC access in invoke', 'Invoking a non-existent sub')
+        .sub main
+            $P0 = get_global ["Foo";"Bar"], "SUB_THAT_DOES_NOT_EXIST"
+            $P0()
+        .end
+CODE
+
+  test6:
+    push_eh eh6
+    $P0 = get_global [ iso-8859-1:"Fran\x{E7}ois" ], "baz"
+    $S0 = $P0()
+    is($S0, iso-8859-1:"Fran\x{E7}ois", "Found sub in ISO-8859 NameSpace")
+    goto end_test6
+  eh6:
+    ok(0, "Cannot find sub in ISO-8859 NameSpace")
+  end_test6:
+    pop_eh
+
+  test7:
+    push_eh eh7
+    $P0 = get_global [ "Foo";iso-8859-1:"Fran\x{E7}ois" ], "baz"
+    $S0 = $P0()
+    is($S0, iso-8859-1:"Foo::Fran\x{E7}ois", "Found sub in nested ISO-8859 NameSpace")
+    goto end_test7
+  eh7:
+    ok(0, "Cannot find sub in ISO-8859 NameSpace")
+  end_test7:
+    pop_eh
+
+  test8:
+    push_eh eh8
+    $P0 = get_global [ unicode:"Fran\x{00E7}ois" ], "baz"
+    $I0 = isnull $P0
+    is($I0, 0, "Find Sub in an ISO-8859-1 NameSpace looked up by a Unicode name")
+    $S0 = $P0()
+    say $S0
+    is($S0, iso-8859-1:"Fran\x{E7}ois", "ISO-8859 NameSpace with Unicode name")
+    goto end_test8
+  eh8:
+    ok(0, "Cannot find ISO-8859 NameSpace using Unicode name")
+  end_test8:
+    pop_eh
+
+  test9:
+    push_eh eh9
+    $P0 = get_global [ unicode:"\x{20AC}uros" ], "baz"
+    $S0 = $P0()
+    is($S0, unicode:"\x{20AC}uros", "Found sub in Unicode NameSpace")
+    goto end_test9
+  eh9:
+    ok(0, "Cannot find sub in Unicode NameSpace")
+  end_test9:
+    pop_eh
+
+  test10:
+    push_eh eh10
+    $P0 = get_global [ "Foo";unicode:"\x{20AC}uros" ], "baz"
+    $S0 = $P0()
+    is($S0, unicode:"Foo::\x{20AC}uros", "Found sub in nested Unicode NameSpace")
+    goto end_test10
+  eh10:
+    ok(0, "Cannot find sub in nested Unicode NameSpace")
+  end_test10:
+    pop_eh
 
-.sub 'test'
-    print "latin1 namespaces are fun\n"
 .end
 
-.namespace []
+.sub 'get_sub_from_namespace_hash'
+    #See that a NameSpace does Hash
+    $P0 = get_global "Foo"
+    $I0 = does $P0, 'hash'
+    ok($I0, "Namespace does hash")
 
-.sub 'main' :main
-    $P0 = get_global [iso-8859-1:"François"], 'test'
-    $P0()
-.end
-CODE
-latin1 namespaces are fun
-OUT
+    # Use a hash key to get a Sub in a namespace
+    $P1 = $P0["baz"]
+    $S0 = $P1()
+    is($S0, "Foo", "Get the Sub from the NameSpace as a Hash")
 
-pir_output_is( <<'CODE', <<'OUT', "unicode namespace, global" );
-.namespace [ unicode:"Fran\xe7ois" ]
+    # Use hash keys to get Subs and nested NameSpaces in NameSpaces
+    $P1 = $P0["Bar"]
+    $P2 = $P1["baz"]
+    $S0 = $P2()
+    is($S0, "Foo::Bar", "Get the Sub from the nested NameSpace as a Hash")
 
-.sub 'test'
-    print "unicode namespaces are fun\n"
-.end
+    # Use nested keys to access nested NameSpaces
+    $P1 = $P0[ "Bar";"baz" ]
+    $S0 = $P1()
+    is($S0, "Foo::Bar", "Get Sub from nested NameSpace with multi-key")
 
-.namespace []
+    # Alias a namespace and access it by Key
+    $P1 = $P0["Bar"]
+    set_global "TopBar", $P1
+    $P2 = get_global ["TopBar"], "baz"
+    is($S0, "Foo::Bar", "Alias namespace")
 
-.sub 'main' :main
-    $P0 = get_global [unicode:"Fran\xe7ois"], 'test'
-    $P0()
-.end
-CODE
-unicode namespaces are fun
-OUT
+    # Get nested NameSpace with ISO-8859 name
+    $P1 = $P0[ iso-8859-1:"Fran\x{E7}ois" ]
+    $P2 = $P1["baz"]
+    $S0 = $P2()
+    is($S0, iso-8859-1:"Foo::Fran\x{E7}ois", "Hash-get nested ISO-8859 NameSpace")
 
-pir_output_is( <<'CODE', <<'OUTPUT', "verify root and parrot namespaces" );
-# name may change though
-.sub main :main
-    # root namespace
-    $P0 = get_root_namespace
-    typeof $S0, $P0
-    print $S0
-    print "\n"
-    print $P0
-    print "\n"
-    # parrot namespace
-    $P1 = $P0["parrot"]
-    print $P1
-    print "\n"
-    typeof $S0, $P1
-    print $S0
-    print "\n"
-.end
-CODE
-NameSpace
+    $P1 = $P0[ iso-8859-1:"Fran\x{E7}ois";"baz" ]
+    $S0 = $P1()
+    is($S0, iso-8859-1:"Foo::Fran\x{E7}ois", "Hash-get nested ISO-8859 NameSpace Sub")
+
+    $P0 = get_global iso-8859-1:"Fran\x{E7}ois"
+    $P1 = $P0[ "baz" ]
+    $S0 = $P1()
+    is($S0, iso-8859-1:"Fran\x{E7}ois", "Hash-get ISO-8859 NameSpace")
+.end
+
+.sub 'access_sub_in_namespace'
+    # Direct access of sub that does exist in current namespace
+    $S0 = baz()
+    $P0 = get_global "baz"
+    $S1 = $P0()
+    is($S0, $S1, "Direct and Indirect Sub calls")
+
+    # Direct access of sub that doesn't exist in current namespace
+    push_eh eh
+    'SUB_AINT_THERE'()
+    ok(0, "Directly called a sub that doesn't exist")
+    goto _end
+  eh:
+    ok(1, "Can't direct call a sub that doesn't exist")
+  _end:
+    pop_eh
+.end
+
+.sub 'get_namespace_from_sub'
+    # root namespace is "parrot"
+    $P0 = get_global "baz"
+    $P1 = $P0."get_namespace"()
+    $S0 = $P1
+    is($S0, "parrot", "Get the root namespace from a sub in the root namespace")
 
-parrot
-NameSpace
-OUTPUT
+    # Get an explicit namespace
+    $P0 = get_global ["Foo"], "baz"
+    $P1 = $P0."get_namespace"()
+    $S0 = $P1
+    is($S0, "Foo", "Get the namespace from a Sub in the NameSpace")
 
-pir_output_is( <<'CODE', <<'OUTPUT', "ns.name()" );
-.sub main :main
-    .include "interpinfo.pasm"
+    # Get namespace from the current sub
+    .include 'interpinfo.pasm'
+    $P0 = interpinfo .INTERPINFO_CURRENT_SUB
+    $P1 = $P0."get_namespace"()
+    $S0 = $P1
+    is($S0, "parrot", "Get namespace from current sub")
+
+    # Now get the current sub again
+    $P2 = $P1["get_namespace_from_sub"]
+    $S0 = typeof $P2
+    is($S0, "Sub", "Get the current sub from namespace from current sub")
+.end
+
+.sub 'build_namespaces_at_runtime'
     $P0 = get_root_namespace
     $P1 = $P0["parrot"]
     $P3 = new ['NameSpace']
-    $P1["Foo"] = $P3
+    $P1["Temp1"] = $P3
     $P2 = $P3.'get_name'()
-    $I2 = elements $P2
-    print $I2
-    print "\n"
     $S0 = join '::', $P2
-    print $S0
-    print "\n"
+    is($S0, "parrot::Temp1", "Add a NameSpace with a given name")
+
+    # test VTABLE_get_string while we are here
+    $S0 = $P1
+    is($S0, "parrot", "get_string on HLL NameSpace")
+
+    $S0 = $P3
+    is($S0, "Temp1", "get_string on NameSpace")
 .end
-CODE
-2
-parrot::Foo
-OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', "get_namespace_p_p, getnamespace_p_kc" );
-.sub main :main
-    .include "interpinfo.pasm"
-    $P3 = new ['NameSpace']
-    set_hll_global "Foo", $P3
-    # fetch w array
+.sub 'hll_namespaces'
+    # Fetch HLL Global using an RSA. Current HLL == parrot
     $P4 = new ['FixedStringArray']
     $P4 = 1
     $P4[0] = 'Foo'
     $P0 = get_hll_namespace $P4
     $P2 = $P0.'get_name'()
-    $I2 = elements $P2
-    print $I2
-    print "\n"
     $S0 = join '::', $P2
-    print $S0
-    print "\n"
-    # fetch w key
+    is($S0, "parrot::Foo", "get_hll_namespace_p")
+
+    # Get an HLL namespace using a key. Current HLL == parrot
     $P2 = get_hll_namespace ["Foo"]
     $P2 = $P2.'get_name'()
-    $I2 = elements $P2
-    print $I2
-    print "\n"
     $S0 = join '::', $P2
-    print $S0
-    print "\n"
-.end
-CODE
-2
-parrot::Foo
-2
-parrot::Foo
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', "Sub.get_namespace, get_namespace" );
-.sub 'main' :main
-    $P0 = get_global ["Foo"], "bar"
-    print "ok\n"
-    $P1 = $P0."get_namespace"()
-    $P2 = $P1.'get_name'()
-    $S0 = join '::', $P2
-    print $S0
-    print "\n"
-    $P0()
-.end
-
-.namespace ["Foo"]
-.sub 'bar'
-    $P1 = get_namespace
-    print $P1
-    print "\n"
-.end
-CODE
-ok
-parrot::Foo
-Foo
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', "check parrot ns" );
-.sub 'main' :main
-    $P0 = get_global ["String"], "lower"
-    $S0 = $P0("OK\n")
-    print $S0
-.end
-CODE
-ok
-OUTPUT
-
-my $temp_a = "temp_a";
-my $temp_b = "temp_b";
-
-END {
-    unlink( "$temp_a.pir", "$temp_a.pbc", "$temp_b.pir", "$temp_b.pbc" );
-}
-
-open my $S, '>', "$temp_a.pir" or die "Can't write $temp_a.pir";
-print $S <<'EOF';
-.HLL "Foo"
-.namespace ["Foo_A"]
-.sub loada :load
-    $P0 = get_global ["Foo_A"], "A"
-    print "ok 1\n"
-    load_bytecode "temp_b.pbc"
-.end
-
-.sub A
-.end
-EOF
-close $S;
-
-open $S, '>', "$temp_b.pir" or die "Can't write $temp_b.pir";
-print $S <<'EOF';
-.namespace ["Foo_B"]
-.sub loadb :load
-    $P0 = get_global ["Foo_B"], "B"
-    print "ok 2\n"
-.end
-
-.sub B
-.end
-EOF
-
-close $S;
-
-system(".$PConfig{slash}parrot$PConfig{exe} -o $temp_a.pbc $temp_a.pir");
-system(".$PConfig{slash}parrot$PConfig{exe} -o $temp_b.pbc $temp_b.pir");
-
-pir_output_is( <<'CODE', <<'OUTPUT', "HLL and load_bytecode - #38888" );
-.sub main :main
-    load_bytecode "temp_a.pbc"
-    print "ok 3\n"
-.end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', "HLL and vars" );
-# initial storage of _tcl global variable...
-
-.HLL '_Tcl'
-
-.sub huh
-  $P0 = new ['Integer']
-  $P0 = 3.14
-  set_global '$variable', $P0
-.end
-
-# start running HLL language
-.HLL 'Tcl'
-
-.sub foo :main
-  huh()
-  $P1 = get_root_namespace ['_tcl']
-  $P2 = $P1['$variable']
-  print $P2
-  print "\n"
-.end
-CODE
-3.14
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', "HLL and namespace directives" );
-.HLL '_Tcl'
-.namespace ['Foo'; 'Bar']
-
-.HLL 'Tcl'
-
-.sub main :main
-  $P0 = get_namespace
-  $P1 = $P0.'get_name'()
-  $S0 = join "::", $P1
-  print $S0
-  print "\n"
-  end
-.end
-CODE
-tcl
-OUTPUT
-
-{
-    my $temp_a = "temp_a.pir";
-
-    END {
-        unlink($temp_a);
-    }
-
-    open $S, '>', $temp_a or die "Can't write $temp_a";
-    print $S <<'EOF';
-.HLL 'eek'
+    is($S0, "parrot::Foo", "get_hll_namespace_kc")
 
-.sub foo :load :anon
-  $P1 = new ['String']
-  $P1 = "3.14\n"
-  set_global '$whee', $P1
+    # Get a sub from an HLL Namespace using a key. Current HLL == parrot
+    $P0 = get_hll_namespace ["Foo"]
+    $P1 = $P0["baz"]
+    $S0 = $P1()
+    is($S0, "Foo", "get a Sub from a HLL namespace")
+
+    # find something an a different .HLL
+    push_eh eh1
+    $P0 = get_root_namespace ["myhll"]
+    $P1 = $P0["baz"]
+    $S0 = $P1()
+    is($S0, "MyHLL", "Found Sub in HLL namespace by key")
+    goto end_test1
+  eh1:
+    ok(0, "Cannot find sub in HLL NameSpace by key")
+  end_test1:
+    pop_eh
+
+    # get_root_namespace won't return something not a namespace
+    $P0 = get_root_namespace ["myhll";"baz"]
+    $I0 = isnull $P0
+    is($I0, 1, "get_root_namespace only returns NameSpace PMCs")
+.end
+
+.sub 'anon_function_namespace'
+
+    $S0 = <<"CODE"
+        .namespace ["anon_test_internal_ns"]
+        .sub anon_test_internal :main :anon
+            $P0 = get_namespace
+            .return($P0)
+        .end
+CODE
+    $P0 = compreg "PIR"
+    $P1 = $P0($S0)
+    $P2 = $P1()
+    $S0 = typeof $P2
+    is($S0, "NameSpace", "get_namespace from anon sub")
+    $P3 = $P2.'get_name'()
+    $S0 = join "::", $P3
+    is($S0, "parrot::anon_test_internal_ns", "get_namespace name from anon sub")
+.end
+
+.sub 'find_name_opcode'
+
+    $S0 = <<'CODE'
+        .namespace ['pugs';'main']
+        .sub 'main' :main
+            push_eh just_in_case
+            $P0 = find_name "&say"
+            $P0()
+            $I0 = 1
+            goto the_end
+          just_in_case:
+            $I0 = 0
+          the_end:
+            pop_eh
+            .return($I0)
+        .end
+
+        .sub "&say"
+            noop
+        .end
+CODE
+    $P0 = compreg "PIR"
+    $P1 = $P0($S0)
+    $I0 = $P1()
+    is($I0, 1, "find_name sub with sigil in namespace")
 .end
 
-.sub bark
-  $P0 = get_global '$whee'
-  print $P0
-.end
-EOF
-    close $S;
+.sub 'namespace_methods'
+    $P0 = get_namespace
 
-    pir_output_is( <<'CODE', <<'OUTPUT', ":anon subs still get default namespace" );
-.HLL 'cromulent'
+    # make_namespace returns the existing namespace if it exists
+    $P1 = $P0.'make_namespace'("Foo")
+    $P2 = $P1["baz"]
+    $S0 = $P2()
+    is($S0, "Foo", "make_namespace does not overwrite existing NS")
 
-.sub what
-   load_bytecode 'temp_a.pir'
-  .local pmc var
-   var = get_root_namespace
-   var = var['eek']
-   var = var['bark']
+    # First we don't have it...
+    $P1 = $P0["NewNamespace1"]
+    $I0 = isnull $P1
+    is($I0, 1, "something that doesn't exist really doesn't")
+
+    # ...now we do!
+    $P1 = $P0.'make_namespace'("NewNamespace1")
+    $P2 = $P1["baz"]    
+    $I0 = isnull $P2
+    is($I0, 1, "make_namespace also creates new namespaces")
+
+    $P1 = new ["NameSpace"]
+    $P0.'add_namespace'("NewNamespace2", $P1)
+    $P2 = $P0["NewNamespace2"]
+    is($P1, $P2, "add_namespace adds a new namespace")
+
+    # test add_sub
+
+    $P1 = new 'Integer'
+    $P1 = 25
+    $P0.'add_var'("My_Integer", $P1)
+    $P2 = $P0["My_Integer"]
+    is($P1, $P2, "add_var adds a variable to the namespace")
 
-    var()
-.end
-CODE
-3.14
-OUTPUT
-}
-
-SKIP:
-{
-    skip( "immediate test, doesn't with --run-pbc", 1 )
-        if ( exists $ENV{TEST_PROG_ARGS} and $ENV{TEST_PROG_ARGS} =~ m/--run-pbc/ );
+    # We've already tested NameSpace."get_name" elsewhere in this file
 
-    pir_output_is( <<'CODE', <<'OUTPUT', "get_global in current" );
-.HLL 'bork'
-.namespace []
+    $P1 = $P0.'find_namespace'("Foo")
+    $P2 = $P1["baz"]
+    $S0 = $P2()
+    is($S0, "Foo", "find_namespace finds a .namespace constant")
 
-.sub a :immediate
-  $P1 = new ['String']
-  $P1 = "ok\n"
-  set_global ['sub_namespace'], "eek", $P1
-.end
+    $P1 = $P0.'find_namespace'("NewNamespace1")
+    $S0 = typeof $P1
+    is($S0, "NameSpace", "find_namespace finds a namespace added at runtime")
 
-.namespace [ 'sub_namespace' ]
+    $P1 = $P0.'find_sub'("baz")
+    $S0 = $P1()
+    is($S0, "", "find_sub finds a sub like it should")
 
-.sub whee :main
- $P1 = get_global 'eek'
- print $P1
-.end
-CODE
-ok
-OUTPUT
-}
-
-open $S, '>', "$temp_b.pir" or die "Can't write $temp_b.pir";
-print $S <<'EOF';
-.HLL 'B'
-.sub b_foo
-    print "b_foo\n"
-.end
-EOF
-close $S;
-
-pir_error_output_like( <<'CODE', <<'OUTPUT', 'export_to() with null destination throws exception' );
-.sub 'test' :main
-    .local pmc nsa, nsb, ar
-
-    ar = new ['ResizableStringArray']
-    push ar, 'foo'
-    nsa = new ['Null']
-    nsb = get_namespace ['B']
-    nsb.'export_to'(nsa, ar)
-.end
+    $P1 = $P0.'find_sub'("NewNamespace1")
+    $I0 = isnull $P1
+    is($I0, 1, "find_sub won't find a non-sub")
 
-.namespace ['B']
-.sub 'foo' :anon
-.end
-CODE
-/^destination namespace not specified\n/
-OUTPUT
+    $P1 = $P0.'find_sub'("DOESNT EXIST")
+    $I0 = isnull $P1
+    is($I0, 1, "find_sub won't find something that doesn't exist")
 
-pir_error_output_like(
-    <<'CODE', <<'OUTPUT', 'export_to() with null exports default object set !!!UNSPECIFIED!!!' );
-.sub 'test' :main
-    .local pmc nsa, nsb, ar
-
-    ar = new ['Null']
-    nsa = get_namespace
-    nsb = get_namespace ['B']
-    nsb.'export_to'(nsa, ar)
-.end
+    $P1 = $P0.'find_var'("My_Integer")
+    $I0 = $P1
+    is($I0, 25, "find_var finds a variable we've saved in a namespace")
 
-.namespace ['B']
-.sub 'foo'
-.end
-CODE
-/^exporting default object set not yet implemented\n/
-OUTPUT
+    $P1 = $P0.'find_var'("ALSO DOESNT EXIST")
+    $I0 = isnull $P1
+    is($I0, 1, "find_var won't find something that doesn't exist")
 
-pir_error_output_like(
-    <<'CODE', <<'OUTPUT', 'export_to() with empty array exports default object set !!!UNSPECIFIED!!!' );
-.sub 'test' :main
-    .local pmc nsa, nsb, ar
-
-    ar = new ['ResizableStringArray']
-    nsa = get_namespace
-    nsb = get_namespace ['B']
-    nsb.'export_to'(nsa, ar)
-.end
+    $P1 = $P0.'find_var'("baz")
+    $S0 = typeof $P1
+    is($S0, "Sub", "find_var also finds subs")
+    $S0 = $P1()
+    is($S0, "", "find_var finds the correct sub")
 
-.namespace ['B']
-.sub 'foo'
-.end
-CODE
-/^exporting default object set not yet implemented\n/
-OUTPUT
+    # Test del_namespace. Test that it deletes an existing namespace, and that
+    # it won't delete something that isn't a namespace
 
-pir_error_output_like(
-    <<'CODE', <<'OUTPUT', 'export_to() with empty hash exports default object set !!!UNSPECIFIED!!!' );
-.sub 'test' :main
-    .local pmc nsa, nsb, ar
-
-    ar = new ['Hash']
-    nsa = get_namespace
-    nsb = get_namespace ['B']
-    nsb.'export_to'(nsa, ar)
-.end
+    # Test del_sub. Test that it deletes an existing sub and that it
+    # won't delete something that isn't a sub
 
-.namespace ['B']
-.sub 'foo'
+    # Test del_var. It will delete any type of thing
 .end
-CODE
-/^exporting default object set not yet implemented\n/
-OUTPUT
 
-pir_output_is( <<"CODE", <<'OUTPUT', "export_to -- success with array" );
-.HLL 'A'
-.sub main :main
-    a_foo()
-    load_bytecode "$temp_b.pir"
-    .local pmc nsr, nsa, nsb, ar
-    ar = new ['ResizableStringArray']
-    push ar, "b_foo"
-    nsr = get_root_namespace
-    nsa = nsr['a']
-    nsb = nsr['b']
-    nsb."export_to"(nsa, ar)
-    b_foo()
-.end
+.sub 'export_to_method'
+    .local string errormsg, description
 
-.sub a_foo
-    print "a_foo\\n"
-.end
-CODE
-a_foo
-b_foo
-OUTPUT
-
-pir_output_is( <<"CODE", <<'OUTPUT', "export_to -- success with hash (empty value)" );
-.HLL 'A'
-.sub main :main
-    a_foo()
-    load_bytecode "$temp_b.pir"
-    .local pmc nsr, nsa, nsb, ar
-    ar = new ['Hash']
-    ar["b_foo"] = ""
-    nsr = get_root_namespace
-    nsa = nsr['a']
-    nsb = nsr['b']
-    nsb."export_to"(nsa, ar)
-    b_foo()
-.end
+    errormsg = "destination namespace not specified"
+    description = "export_to() Null NameSpace"
+    throws_substring(<<"CODE", errormsg, description)
+        .sub 'test' :main
+            .local pmc nsa, nsb, ar
 
-.sub a_foo
-    print "a_foo\\n"
-.end
+            ar = new ['ResizableStringArray']
+            push ar, 'baz'
+            nsa = new ['Null']
+            nsb = get_namespace ['Foo']
+            nsb.'export_to'(nsa, ar)
+        .end
 CODE
-a_foo
-b_foo
-OUTPUT
 
-pir_output_is( <<"CODE", <<'OUTPUT', "export_to -- success with hash (null value)" );
-.HLL 'A'
-.sub main :main
-    a_foo()
-    load_bytecode "$temp_b.pir"
-    .local pmc nsr, nsa, nsb, ar, nul
-    nul = new ['Null']
-    ar  = new ['Hash']
-    ar["b_foo"] = nul
-    nsr = get_root_namespace
-    nsa = nsr['a']
-    nsb = nsr['b']
-    nsb."export_to"(nsa, ar)
-    b_foo()
-.end
+    errormsg = "exporting default object set not yet implemented"
+    description = 'export_to() with null exports default object set !!!UNSPECIFIED!!!'
+    throws_substring(<<'CODE', errormsg, description)
+        .sub 'test' :main
+            .local pmc nsa, nsb, ar
 
-.sub a_foo
-    print "a_foo\\n"
-.end
+            ar = new ['Null']
+            nsa = get_namespace
+            nsb = get_namespace ['Foo']
+            nsb.'export_to'(nsa, ar)
+        .end
 CODE
-a_foo
-b_foo
-OUTPUT
 
-pir_error_output_like( <<"CODE", <<'OUTPUT', "export_to -- success with hash (and value)" );
-.HLL 'A'
-.sub main :main
-    a_foo()
-    load_bytecode "$temp_b.pir"
-    .local pmc nsr, nsa, nsb, ar
-    ar = new ['Hash']
-    ar["b_foo"] = "c_foo"
-    nsr = get_root_namespace
-    nsa = nsr['a']
-    nsb = nsr['b']
-    nsb."export_to"(nsa, ar)
-    c_foo()
-    b_foo()
-.end
 
-.sub a_foo
-    print "a_foo\\n"
-.end
-CODE
-/^a_foo
-b_foo
-Could not find non-existent sub b_foo/
-OUTPUT
+    errormsg = "exporting default object set not yet implemented"
+    description = 'export_to() with empty array exports default object set !!!UNSPECIFIED!!!'
+    throws_substring(<<'CODE', errormsg, description)
+        .sub 'test' :main
+            .local pmc nsa, nsb, ar
 
-pir_output_is( <<'CODE', <<'OUTPUT', "get_parent" );
-.sub main :main
-    .local pmc ns
-    ns = get_hll_namespace ['Foo']
-    ns = ns.'get_parent'()
-    print ns
-    print "\n"
-.end
-.namespace ['Foo']
-.sub dummy
-.end
+            ar = new ['ResizableStringArray']
+            nsa = get_namespace
+            nsb = get_namespace ['Foo']
+            nsb.'export_to'(nsa, ar)
+        .end
 CODE
-parrot
-OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', "get_global [''], \"print_ok\"" );
-.namespace ['']
+    errormsg = "exporting default object set not yet implemented"
+    description = 'export_to() with empty hash exports default object set !!!UNSPECIFIED!!!'
+    throws_substring(<<'CODE', errormsg, description)
+        .sub 'test' :main
+            .local pmc nsa, nsb, ar
 
-.sub print_ok
-  print "ok\n"
-  .return()
-.end
-
-.namespace ['foo']
-
-.sub main :main
-  $P0 = get_hll_global [''], 'print_ok'
-  $P0()
-  end
-.end
+            ar = new ['Hash']
+            nsa = get_namespace
+            nsb = get_namespace ['Foo']
+            nsb.'export_to'(nsa, ar)
+        .end
 CODE
-ok
-OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', "get_global with array ('')" );
-.namespace ['']
+# Things to add: successful export_to with non-empty array, successful
+# export_to with non-empty hash. both of these things across HLL boundaries
 
-.sub print_ok
-  print "ok\n"
-  .return()
 .end
 
-.namespace ['foo']
-
-.sub main :main
-  $P0 = new ['ResizableStringArray']
-  $P0[0] = ''
-  $P0 = get_hll_global $P0, 'print_ok'
-  $P0()
-  end
-.end
-CODE
-ok
-OUTPUT
+##### TEST NAMESPACES AND FUNCTIONS #####
+# These functions and namespaces are used for the tests above
 
-pir_output_is( <<'CODE', <<'OUTPUT', "get_global with empty array" );
+# The current namespace
 .namespace []
-
-.sub print_ok
-  print "ok\n"
-  .return()
-.end
-
-.namespace ['foo']
-
-.sub main :main
-  $P0 = new ['ResizablePMCArray']
-  $P0 = 0
-  $P0 = get_hll_global $P0, 'print_ok'
-  $P0()
-  end
-.end
-CODE
-ok
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', "Namespace.get_global() with array ('')" );
-.namespace ['']
-
-.sub print_ok
-  print "ok\n"
-  .return()
-.end
-
-.namespace ['foo']
-
-.sub main :main
-  $P1 = new ['ResizableStringArray']
-  $P1[0] = ''
-  $P1 = get_hll_global $P1, 'print_ok'
-  $P1()
-  end
-.end
-CODE
-ok
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', "Namespace introspection" );
-.sub main :main
-    .local pmc f
-    f = get_hll_global ['Foo'], 'dummy'
-    f()
-.end
-.namespace ['Foo']
-.sub dummy
-    .local pmc interp, ns_caller
-    interp = getinterp
-    ns_caller = interp['namespace'; 1]
-    print ns_caller
-    print "\n"
-.end
-CODE
-parrot
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', "Nested namespace introspection" );
-.sub main :main
-    .local string no_symbol
-
-    .local pmc foo_ns
-    foo_ns = get_hll_namespace [ 'Foo' ]
-    $S0    = foo_ns
-    print "Found namespace: "
-    print $S0
-    print "\n"
-
-    .local pmc bar_ns
-    bar_ns = foo_ns.'find_namespace'( 'Bar' )
-    $S0    = bar_ns
-    print "Found nested namespace: "
-    print $S0
-    print "\n"
-
-    .local pmc baz_ns
-    baz_ns    = bar_ns.'find_namespace'( 'Baz' )
-    no_symbol = 'Baz'
-
-    .local int is_defined
-    is_defined = defined baz_ns
-    if is_defined goto oops
-    goto find_symbols
-
-  oops:
-    print "Found non-null '"
-    print no_symbol
-    print "'\n"
-    .return()
-
-  find_symbols:
-    .local pmc a_sub
-    a_sub = bar_ns.'find_sub'( 'a_sub' )
-    $S0   = a_sub
-    a_sub()
-    print "Found sub: "
-    print $S0
-    print "\n"
-
-    .local pmc some_sub
-    some_sub  = bar_ns.'find_sub'( 'some_sub' )
-    no_symbol = 'some_sub'
-
-    is_defined = defined some_sub
-    if is_defined goto oops
-
-    .local pmc a_var
-    a_var    = bar_ns.'find_var'( 'a_var' )
-    print "Found var: "
-    print a_var
-    print "\n"
-
-    .local pmc some_var
-    some_var    = bar_ns.'find_var'( 'some_var' )
-    no_symbol = 'some_var'
-
-    is_defined = defined some_var
-    if is_defined goto oops
-
-.end
-
-.namespace ['Foo']
-
-.sub some_sub
-.end
-
-.namespace [ 'Foo'; 'Bar' ]
-
-.sub a_sub
-    .local pmc some_var
-    some_var = new ['String']
-    some_var = 'a string PMC'
-    set_hll_global [ 'Foo'; 'Bar' ], 'a_var', some_var
-.end
-CODE
-Found namespace: Foo
-Found nested namespace: Bar
-Found sub: a_sub
-Found var: a string PMC
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', 'get_root_namespace' );
-.sub main :main
-    .local pmc root_ns
-    root_ns = get_root_namespace
-    .local int is_defined
-    is_defined = defined root_ns
-    unless is_defined goto NO_NAMESPACE_FOUND
-        print "Found root namespace.\n"
-    NO_NAMESPACE_FOUND:
-.end
-CODE
-Found root namespace.
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', 'root namespace is not a class' );
-.sub main :main
-    .local pmc root_ns
-    root_ns = get_root_namespace
-    .local pmc root_class
-    root_class = get_class root_ns
-    .local int is_class
-    is_class = defined root_class
-    say is_class
-.end
-CODE
-0
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', 'get_root_namespace "Foo"' );
-.sub main :main
-    .local pmc foo_ns
-    foo_ns = get_root_namespace [ "foo" ]
-    .local int is_defined
-    is_defined = defined foo_ns
-    unless is_defined goto NO_NAMESPACE_FOUND
-        print "Found root namespace 'foo'.\n"
-    NO_NAMESPACE_FOUND:
-.end
-.HLL 'Foo'
-.sub dummy
-.end
-CODE
-Found root namespace 'foo'.
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', 'get_root_namespace "Foo", not there' );
-.sub main :main
-    .local pmc foo_ns
-    foo_ns = get_root_namespace [ "Foo" ]
-    .local int is_defined
-    is_defined = defined foo_ns
-    if is_defined goto NAMESPACE_FOUND
-        print "Didn't find root namespace 'Foo'.\n"
-    NAMESPACE_FOUND:
-.end
-
-.namespace [ "NotFoo" ]
-CODE
-Didn't find root namespace 'Foo'.
-OUTPUT
-
-my $create_nested_key = <<'CREATE_NESTED_KEY';
-.sub create_nested_key
-    .param string name
-    .param pmc other_names :slurpy
-
-    .local pmc key
-    key = new ['Key']
-    key = name
-
-    .local int elem
-    elem = other_names
-
-    if elem goto nested
-    .return( key )
-
-  nested:
-    .local pmc tail
-    tail = create_nested_key(other_names :flat)
-    push key, tail
-
-    .return( key )
-.end
-CREATE_NESTED_KEY
-
-pir_output_is( <<"CODE", <<'OUTPUT', 'get_name()' );
-$create_nested_key
-
-.sub main :main
-    .local pmc key
-    key = create_nested_key( 'SingleName' )
-    print_namespace( key )
-
-    key = create_nested_key( 'Nested', 'Name', 'Space' )
-    print_namespace( key )
-
-    key = get_namespace
-
-    .local pmc ns
-    ns = key.'get_name'()
-
-    .local string ns_name
-    ns_name = join ';', ns
-    print ns_name
-    print "\\n"
-.end
-
-.sub 'print_namespace'
-    .param pmc key
-
-    .local pmc get_ns
-    get_ns = get_global key, 'get_namespace'
-
-    .local pmc ns
-    ns = get_ns()
-
-    .local pmc name_array
-    name_array = ns.'get_name'()
-
-    .local string name
-    name = join ';', name_array
-
-    print name
-    print "\\n"
-.end
-
-.sub get_namespace
-    .local pmc ns
-    ns = get_namespace
-    .return( ns )
-.end
-
-.namespace [ 'SingleName' ]
-
-.sub get_namespace
-    .local pmc ns
-    ns = get_namespace
-    .return( ns )
-.end
-
-.namespace [ 'Nested'; 'Name'; 'Space' ]
-
-.sub get_namespace
-    .local pmc ns
-    ns = get_namespace
-    .return( ns )
-.end
-
-CODE
-parrot;SingleName
-parrot;Nested;Name;Space
-parrot
-OUTPUT
-
-pir_output_is( <<"CODE", <<'OUTPUT', 'add_namespace()' );
-$create_nested_key
-
-.sub main :main
-    .local pmc root_ns
-    root_ns = get_namespace
-
-    .local pmc child_ns
-    child_ns = new ['NameSpace']
-    root_ns.'add_namespace'( 'Nested', child_ns )
-
-    .local pmc grandchild_ns
-    grandchild_ns = new ['NameSpace']
-    child_ns.'add_namespace'( 'Grandkid', grandchild_ns )
-
-    .local pmc great_grandchild_ns
-    great_grandchild_ns = new ['NameSpace']
-    grandchild_ns.'add_namespace'( 'Greatgrandkid', great_grandchild_ns )
-
-    .local pmc parent
-    parent = great_grandchild_ns.'get_parent'()
-    print_ns_name( parent )
-
-    parent = parent.'get_parent'()
-    print_ns_name( parent )
-
-    parent = parent.'get_parent'()
-    print_ns_name( parent )
-.end
-
-.sub print_ns_name
-    .param pmc namespace
-
-    .local pmc ns
-    ns = namespace.'get_name'()
-
-    .local string ns_name
-    ns_name = join ';', ns
-    print ns_name
-    print "\\n"
-.end
-CODE
-parrot;Nested;Grandkid
-parrot;Nested
-parrot
-OUTPUT
-
-pir_output_like( <<'CODE', <<'OUTPUT', 'add_namespace() with error' );
-.sub main :main
-    .local pmc ns_child
-    ns_child = subclass 'NameSpace', 'NSChild'
-
-    .local pmc child
-    child = new ['NSChild']
-
-    .local pmc root_ns
-    root_ns = get_namespace
-
-    root_ns.'add_namespace'( 'Really nested', child )
-
-    .local pmc not_a_ns
-    not_a_ns = new ['Integer']
-
-    push_eh _invalid_ns
-    root_ns.'add_namespace'( 'Nested', not_a_ns )
-    end
-
-_invalid_ns:
-    .local pmc exception
-    .local string message
-    .get_results( exception )
-
-    message = exception
-    print message
-    print "\n"
-.end
-CODE
-/Invalid type \d+ in add_namespace\(\)/
-OUTPUT
-
-pir_output_is( <<"CODE", <<'OUTPUT', 'add_sub()' );
-$create_nested_key
-
-.sub 'main' :main
-    .local pmc report_ns
-    report_ns = get_global 'report_namespace'
-
-    .local pmc key
-    key = create_nested_key( 'Parent' )
-
-    .local pmc parent_ns
-    parent_ns = get_namespace key
-    parent_ns.'add_sub'( 'report_ns', report_ns )
-
-    key = create_nested_key( 'Parent', 'Child' )
-
-    .local pmc child_ns
-    child_ns = get_namespace key
-    child_ns.'add_sub'( 'report_ns', report_ns )
-
-    .local pmc report_namespace
-    report_namespace = get_global [ 'Parent' ], 'report_ns'
-    report_namespace()
-
-    report_namespace = get_global [ 'Parent'; 'Child' ], 'report_ns'
-    report_namespace()
-.end
-
-.sub 'report_namespace'
-    .local pmc namespace
-    namespace = get_namespace
-
-    .local pmc ns
-    ns = namespace.'get_name'()
-
-    .local string ns_name
-    ns_name = join ';', ns
-    print ns_name
-    print "\\n"
-.end
-
-.namespace [ 'Parent' ]
-
-.sub dummy
-.end
-
-.namespace [ 'Parent'; 'Child' ]
-
-.sub dummy
-.end
-CODE
-parrot
-parrot
-OUTPUT
-
-pir_output_like( <<'CODE', <<'OUTPUT', 'add_sub() with error' );
-.sub main :main
-    .local pmc s_child
-    s_child = subclass 'Sub', 'SubChild'
-
-    .local pmc child
-    child = new ['SubChild']
-
-    .local pmc root_ns
-    root_ns = get_namespace
-
-    root_ns.'add_sub'( 'child', child )
-    print "Added sub child\n"
-
-    child = new ['Coroutine']
-    root_ns.'add_sub'( 'coroutine', child )
-    print "Added coroutine\n"
-
-    child = new ['Eval']
-    root_ns.'add_sub'( 'eval', child )
-    print "Added eval\n"
-
-    .local pmc not_a_sub
-    not_a_sub = new ['Integer']
-
-    push_eh _invalid_sub
-    root_ns.'add_sub'( 'Nested', not_a_sub )
-    end
-
-_invalid_sub:
-    .local pmc exception
-    .local string message
-    .get_results( exception )
-
-    message = exception
-    print message
-    print "\n"
-.end
-CODE
-/Added sub child
-Added coroutine
-Added eval
-Invalid type \d+ in add_sub\(\)/
-OUTPUT
-
-pir_output_is( <<"CODE", <<'OUTPUT', 'add_var()' );
-$create_nested_key
-
-.sub 'main' :main
-    .local pmc foo
-    foo = new ['String']
-    foo = 'Foo'
-
-    .local pmc bar
-    bar = new ['String']
-    bar = 'Bar'
-
-    .local pmc key
-    key = create_nested_key( 'Parent' )
-
-    .local pmc parent_ns
-    parent_ns = get_namespace key
-    parent_ns.'add_var'( 'foo', foo )
-
-    key = create_nested_key( 'Parent', 'Child' )
-
-    .local pmc child_ns
-    child_ns = get_namespace key
-    child_ns.'add_var'( 'bar', bar )
-
-    .local pmc my_var
-    my_var = get_global [ 'Parent' ], 'foo'
-    print "Foo: "
-    print my_var
-    print "\\n"
-
-    my_var = get_global [ 'Parent'; 'Child' ], 'bar'
-    print "Bar: "
-    print my_var
-    print "\\n"
-.end
-
-.namespace [ 'Parent' ]
-
-.sub dummy
-.end
-
-.namespace [ 'Parent'; 'Child' ]
-
-.sub dummy
-.end
-CODE
-Foo: Foo
-Bar: Bar
-OUTPUT
-
-pir_output_is( <<"CODE", <<'OUTPUT', 'del_namespace()' );
-$create_nested_key
-
-.sub 'main' :main
-    .local pmc root_ns
-    root_ns = get_namespace
-
-    .local pmc key
-    key      = create_nested_key( 'Parent' )
-
-    .local pmc child_ns
-    child_ns = root_ns.'find_namespace'( key )
-
-    key      = create_nested_key( 'Child' )
-
-    .local pmc grandchild_ns
-    grandchild_ns = child_ns.'find_namespace'( key )
-
-    child_ns.'del_namespace'( 'Child' )
-
-    key      = create_nested_key( 'Child' )
-
-    grandchild_ns = child_ns.'find_namespace'( key )
-    if_null grandchild_ns, CHECK_SIBLING
-    print "Grandchild still exists\\n"
-
-  CHECK_SIBLING:
-    key      = create_nested_key( 'Sibling' )
-    grandchild_ns = child_ns.'find_namespace'( key )
-    if_null grandchild_ns, DELETE_PARENT
-    print "Sibling not deleted\\n"
-
-  DELETE_PARENT:
-    key      = create_nested_key( 'Parent' )
-    root_ns.'del_namespace'( 'Parent' )
-    child_ns = root_ns.'find_namespace'( key )
-    if_null child_ns, CHECK_UNCLE
-    print "Child still exists\\n"
-
-  CHECK_UNCLE:
-    key      = create_nested_key( 'FunUncle' )
-    grandchild_ns = root_ns.'find_namespace'( key )
-    if_null grandchild_ns, DELETE_PARENT
-    print "Fun uncle stuck around\\n"
-
-  ALL_DONE:
-.end
-
-.namespace [ 'FunUncle' ]
-
-.sub dummy
-.end
-
-.namespace [ 'Parent' ]
-
-.sub dummy
-.end
-
-.namespace [ 'Parent'; 'Child' ]
-
-.sub dummy
-.end
-
-.namespace [ 'Parent'; 'Sibling' ]
-
-.sub dummy
-.end
-CODE
-Sibling not deleted
-Fun uncle stuck around
-OUTPUT
-
-pir_output_like( <<'CODE', <<'OUTPUT', 'del_namespace() with error' );
-.sub dummy
-.end
-
-.sub main :main
-    .local pmc not_a_ns
-    not_a_ns = new ['Array']
-
-    set_global 'Not_A_NS', not_a_ns
-
-    .local pmc root_ns
-    root_ns = get_namespace
-    delete_namespace( root_ns, 'dummy' )
-    delete_namespace( root_ns, 'Not_A_NS' )
-.end
-
-.sub delete_namespace
-    .param pmc    root_ns
-    .param string name
-    push_eh _invalid_ns
-    root_ns.'del_namespace'( name )
-
-_invalid_ns:
-    .local pmc exception
-    .local string message
-    .get_results( exception )
-
-    message = exception
-    print message
-    print "\n"
-    .return()
-.end
-CODE
-/Invalid type \d+ for 'dummy' in del_namespace\(\)
-Invalid type \d+ for 'Not_A_NS' in del_namespace\(\)/
-OUTPUT
-
-pir_output_is( <<"CODE", <<'OUTPUT', 'del_sub()' );
-.sub 'main' :main
-    .local pmc root_ns
-    root_ns = get_namespace
-
-    .local pmc parent_ns
-    parent_ns = root_ns.'find_namespace'( 'Parent' )
-    parent_ns.'del_sub'( 'dummy' )
-
-    .local pmc my_sub
-    my_sub = get_global [ 'Parent' ], 'dummy'
-    if_null my_sub, PARENT_NO_DUMMY
-    print "Parent did not delete dummy\\n"
-
-  PARENT_NO_DUMMY:
-    my_sub = get_global [ 'Parent' ], 'no_dummy'
-    my_sub()
-
-    .local pmc child_ns
-    child_ns = parent_ns.'find_namespace'( 'Child' )
-    child_ns.'del_sub'( 'dummy' )
-
-    my_sub = get_global [ 'Parent'; 'Child' ], 'dummy'
-    if_null my_sub, CHILD_NO_DUMMY
-    print "Child did not delete dummy\\n"
-    my_sub()
-
-  CHILD_NO_DUMMY:
-    my_sub = get_global [ 'Parent'; 'Child' ], 'no_dummy'
-    my_sub()
-.end
-
-.namespace [ 'Parent' ]
-
-.sub dummy
-.end
-
-.sub no_dummy
-    print "Parent is no dummy\\n"
-.end
-
-.namespace [ 'Parent'; 'Child' ]
-
-.sub dummy
-    print "Dummy sub!\\n"
-.end
-
-.sub no_dummy
-    print "Child is no dummy\\n"
-.end
-
-CODE
-Parent is no dummy
-Child is no dummy
-OUTPUT
-
-pir_output_like( <<'CODE', <<'OUTPUT', 'del_sub() with error' );
-.sub main :main
-    .local pmc not_a_ns
-    not_a_ns = new ['Array']
-
-    set_global 'Not_A_Sub', not_a_ns
-
-    .local pmc root_ns
-    root_ns = get_namespace
-
-    push_eh _invalid_sub
-    root_ns.'del_sub'( 'Not_A_Sub' )
-
-_invalid_sub:
-    .local pmc exception
-    .local string message
-    .get_results( exception )
-
-    message = exception
-    print message
-    print "\n"
-    .return()
-.end
-CODE
-/Invalid type \d+ for 'Not_A_Sub' in del_sub\(\)/
-OUTPUT
-
-pir_output_is( <<"CODE", <<'OUTPUT', 'del_var()' );
-.sub 'main' :main
-    .local pmc foo
-    foo = new ['String']
-    foo = 'Foo'
-
-    .local pmc bar
-    bar = new ['String']
-    bar = 'Bar'
-
-    set_global [ 'Parent' ],          'Foo', foo
-    set_global [ 'Parent'; 'Child' ], 'Bar', bar
-
-    .local pmc root_ns
-    root_ns = get_namespace
-
-    .local pmc parent_ns
-    parent_ns = root_ns.'find_namespace'( 'Parent' )
-    parent_ns.'del_var'( 'Foo' )
-
-    .local pmc child_ns
-    child_ns = parent_ns.'find_namespace'( 'Child' )
-    child_ns.'del_var'( 'Bar' )
-
-    .local pmc my_var
-    my_var = get_global [ 'Parent' ], 'Foo'
-    if_null my_var, TEST_CHILD_VAR
-    print "Parent Foo exists: "
-    print my_var
-    print "\\n"
-
-  TEST_CHILD_VAR:
-    my_var = get_global [ 'Parent'; 'Child' ], 'Bar'
-    if_null my_var, ALL_DONE
-    print "Child Bar exists: "
-    print my_var
-    print "\\n"
-
-  ALL_DONE:
-.end
-
-.namespace [ 'Parent' ]
-
-.sub dummy
-.end
-
-.namespace [ 'Parent'; 'Child' ]
-
-CODE
-OUTPUT
-
-pir_error_output_like( <<'CODE', <<'OUTPUT', 'overriding find_method()' );
-.sub 'main' :main
-    $P0 = newclass 'Override'
-    $P1 = new ['Override']
-    $P2 = find_method $P1, 'foo'
+.sub 'baz'
+    .return("")
 .end
 
-.namespace [ 'Override' ]
-
-.sub 'find_method' :vtable
-    .param string method
-    say "Finding method"
+# NameSpace "Foo"
+.namespace ["Foo"]
+.sub 'baz'
+    .return("Foo")
 .end
-CODE
-/Finding method/
-OUTPUT
-
-pir_output_is( <<'CODE', <<OUT, "iterate through a NameSpace PMC, RT #39978" );
-.sub main :main
-     $P0 = new ['String']
-     $P0 = "Ook...BANG!\n"
-     set_root_global [ "DUMMY"; "X"; "Y" ], "Explosion", $P0
-
-     $P1 = new ['Integer']
-     $P1 = 0
-     set_root_global [ "DUMMY"; "X"; "Y" ], "T0", $P0
-
-     .local pmc dummy_x_y_ns, iter, res
-     dummy_x_y_ns = get_root_namespace [ "DUMMY"; "X"; "Y" ]
-     iter = new ['Iterator'], dummy_x_y_ns
-     res  = new ['ResizablePMCArray']
-loop:
-     unless iter goto loop_end
-     $S0 = shift iter
-     push res, $S0
-     goto loop
-loop_end:
-
-     res.'sort'()
-     $S0 = join ' ', res
-     say $S0
 
+# NameSpace "Foo";"Bar". Nested namespace
+.namespace ["Foo";"Bar"]
+.sub 'baz'
+    .return("Foo::Bar")
 .end
-CODE
-Explosion T0
-OUT
 
-pir_error_output_like( <<'CODE', <<OUT, "NameSpace with no class, RT #55620" );
-.sub 'main' :main
-    $P1 = new ['NameSpace']
-    set_args '(0)', $P1
-    tailcallmethod $P1, 'bob'
+# Namespace specified in ISO-8859-1
+.namespace [ iso-8859-1:"Fran\x{E7}ois" ]
+.sub 'baz'
+    .return(iso-8859-1:"Fran\x{E7}ois")
 .end
-CODE
-/Null PMC access in get_string()/
-OUT
-
-pir_output_is( <<'CODE', <<OUT, "iterate through a NameSpace PMC" );
-.namespace [ 'bar' ]
-
-.sub 'main' :main
-    .local pmc res
-    res = new ['ResizablePMCArray']
 
-    $P0 = get_namespace
-    say $P0
-    $I0 = elements $P0
-    say $I0
-    new $P1 , 'Iterator', $P0
-  L1:
-    unless $P1 goto L2
-    $P2 = shift $P1
-    $S0 = $P2
-    push res, $S0
-    goto L1
-  L2:
-    res.'sort'()
-    $S0 = join "\n", res
-    say $S0
-    say 'OK'
+# Nested namespace specified in ISO-8859
+.namespace [ "Foo"; iso-8859-1:"Fran\x{E7}ois" ]
+.sub 'baz'
+    .return(iso-8859-1:"Foo::Fran\x{E7}ois")
 .end
 
-.sub 'foo'
-    say 'foo'
-.end
-CODE
-bar
-2
-foo
-main
-OK
-OUT
-
-pir_output_is( <<'CODE', <<'OUT', "make_namespace method");
-.sub 'main' :main
-    $P0 = split ';', 'perl6;Foo;Bar'
-    $P1 = get_root_namespace
-    $P2 = $P1.'make_namespace'($P0)
-    $I0 = isa $P2, 'NameSpace'
-    say $I0
-    $P3 = get_root_namespace ['perl6';'Foo';'Bar']
-    $I0 = isnull $P3
-    say $I0
-    $I0 = issame $P2, $P3
-    say $I0
+# Namesace specified in Unicode
+.namespace [ unicode:"\x{20AC}uros" ]
+.sub 'baz'
+    .return(unicode:"\x{20AC}uros")
 .end
-CODE
-1
-0
-1
-OUT
 
-pir_error_output_like( <<'CODE', <<'OUT', 'adding :anon sub to a namespace, TT #56' );
-.namespace ['Foo']
-.sub main :main
-    .const 'Sub' $P0 = 'bar'
-
-    set_global 'ok', $P0
-    $P1 = get_global 'ok'
-    say $P1
-    $S0 = ok()
-    say $S0
-    $S0 = nok()
-    say $S0
+# Nested namespace specified in Unicode
+.namespace [ "Foo";unicode:"\x{20AC}uros" ]
+.sub 'baz'
+    .return(unicode:"Foo::\x{20AC}uros")
 .end
 
-.namespace []
-.sub 'nok' :anon :subid('bar')
-    .return( 'ok 1' )
+.HLL "MyHLL"
+.sub 'baz'
+    .return("MyHLL")
 .end
-CODE
-/
-ok 1
-Could not find non-existent sub nok/
-OUT
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/t/pmc/nci.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/nci.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/nci.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,12 +1,12 @@
 #! perl
-# Copyright (C) 2001-2008, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
 use strict;
 use warnings;
 use lib qw( . lib ../lib ../../lib );
 use Test::More;
-use Parrot::Test tests => 70;
+use Parrot::Test tests => 71;
 use Parrot::Config qw(%PConfig);
 
 =head1 NAME
@@ -1355,7 +1355,32 @@
 31
 OUTPUT
 
-    pasm_output_is( <<'CODE', <<'OUTPUT', "nci_vP" );
+    pir_output_is( << 'CODE', << "OUTPUT", "nci_pi - null" );
+
+.include "datatypes.pasm"
+
+.sub test :main
+
+  # load library
+  .local pmc libnci_test
+  libnci_test = loadlib "libnci_test"
+  unless libnci_test goto FAILED
+
+  # calling a function in libnci_test
+  .local pmc nci_pi
+  dlfunc nci_pi, libnci_test, "nci_pi", "pi"
+  .local pmc result
+  result = nci_pi( 10 )
+  unless_null result, FAILED
+  print "got null"
+FAILED:
+  print "\n"
+.end
+CODE
+got null
+OUTPUT
+
+    pasm_output_is( <<'CODE', <<'OUTPUT', "nci_vP", todo => 'Disabled to avoid linkage problems, see src/nci_test.c' );
   loadlib P1, "libnci_test"
   dlfunc P0, P1, "nci_vP", "vP"
   new P5, ['String']
@@ -1373,7 +1398,7 @@
 
   # Tests with callback functions
   my @todo = $ENV{TEST_PROG_ARGS} =~ /--runcore=jit/ ?
-    ( todo => 'RT #49718, add scheduler tasks to JIT' ) : ();
+    ( todo => 'TT #1316, add scheduler tasks to JIT' ) : ();
 
   pasm_output_is( <<'CODE', <<'OUTPUT', "nci_cb_C1 - PASM", @todo );
 
@@ -2646,11 +2671,6 @@
 3
 OUTPUT
 
-{
-    local $TODO = 0;
-    if ($PConfig{jitcapable}){
-        $TODO = "TT #551 - jitted NCI sig with V is broken";
-    }
 pir_output_is( << 'CODE', << 'OUTPUT', "nci_vVi - void** out parameter" );
 .sub test :main
     .local string library_name
@@ -2665,15 +2685,18 @@
     nci_vp = dlfunc libnci_test, "nci_vp", "vp"
 
     .local pmc opaque
+    null opaque
+    nci_vp(opaque)
+
     opaque = new ['Pointer']
     $I0 = 10
     nci_vVi(opaque, $I0)
     nci_vp(opaque)
 .end
 CODE
+got null
 got 10
 OUTPUT
-}
 
 pir_output_is( << 'CODE', << 'OUTPUT', "nci_ttt - t_tt parameter" );
 .sub test :main
@@ -2711,11 +2734,6 @@
 1
 OUTPUT
 
-{
-    local $TODO = 0;
-    if ($PConfig{jitcapable}){
-        $TODO = "TT #551 - jitted NCI sig with V is broken";
-    }
 pir_output_is( << 'CODE', << 'OUTPUT', "nci_vV - char** out parameter" );
 .sub test :main
     .local string library_name
@@ -2763,7 +2781,6 @@
 It is a beautiful day!
 Go suck a lemon.
 OUTPUT
-}
 
 # Local Variables:
 #   mode: cperl

Modified: branches/orderedhash_revamp/t/pmc/null.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/null.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/null.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -19,10 +19,18 @@
 .sub main :main
     .include 'test_more.pir'
 
-    plan(1)
+    plan(3)
 
     new $P0, ['Null']
     ok(1, 'Instantiated a Null PMC')
+
+    new $P1, ['Null']
+    $I0 = issame $P0, $P1
+    ok ($I0, 'Null is same as Null')
+
+    new $P2, ['Undef']
+    $I0 = issame $P0, $P2
+    nok($I0, 'Null is not same as not Undef')
 .end
 
 # Local Variables:

Modified: branches/orderedhash_revamp/t/pmc/object-meths.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/object-meths.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/object-meths.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 #! perl
-# Copyright (C) 2001-2007, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
 use strict;
@@ -142,71 +142,73 @@
 ok 2
 OUTPUT
 
-pasm_output_is( <<'CODE', <<'OUTPUT', "constructor - init attr" );
-    newclass P1, "Foo"
-    addattribute P1, ".i"
-    new P3, ['Foo']
-    print "ok 2\n"
-    print P3
-    print "\n"
+pir_output_is( <<'CODE', <<'OUTPUT', "constructor - init attr" );
+.sub 'main' :main
+    newclass $P1, "Foo"
+    addattribute $P1, ".i"
+    new $P3, ['Foo']
+    say "ok 2"
+    say $P3
     end
+.end
+
 .namespace ["Foo"]
-.pcc_sub __init:
-    get_params "0", P2
-    print "ok 1\n"
-    new P10, ['Integer']
-    set P10, 42
-    setattribute P2, ".i", P10
-    set_returns ""
-    returncc
-.pcc_sub __get_string:
-    get_params "0", P2
-    getattribute P10, P2, ".i"
-    set_returns "0", P10
-    returncc
+
+.sub 'init' :vtable :method
+    say "ok 1"
+    new $P10, ['Integer']
+    set $P10, 42
+    setattribute self, ".i", $P10
+    .return()
+.end
+
+.sub 'get_string' :vtable :method
+    getattribute $P10, self, ".i"
+    .return( $P10 )
+.end
 CODE
 ok 1
 ok 2
 42
 OUTPUT
 
-pasm_output_is( <<'CODE', <<'OUTPUT', "constructor - parents" );
-    newclass P1, "Foo"
-    subclass P2, P1, "Bar"
-    subclass P3, P2, "Baz"
-    new P3, ['Baz']
-    new P3, ['Bar']
-    get_global P0, "_sub"
-    invokecc P0
-    print "done\n"
+pir_output_is( <<'CODE', <<'OUTPUT', "constructor - parents" );
+.sub 'main' :main
+    newclass $P1, "Foo"
+    subclass $P2, $P1, "Bar"
+    subclass $P3, $P2, "Baz"
+    new $P3, ['Baz']
+    new $P3, ['Bar']
+    _sub()
+    say "done"
     end
+.end
 
-    .namespace ["Foo"]
-.pcc_sub __init:
-    get_params "0", P2
-    print "foo_init\n"
-    typeof S0, P2
-    print S0
-    print "\n"
-    returncc
+.namespace ["Foo"]
 
-    .namespace ["Bar"]
-.pcc_sub __init:
-    get_params "0", P2
-    print "bar_init\n"
-    returncc
+.sub 'init' :vtable :method
+    say "foo_init"
+    typeof $S0, self
+    say $S0
+.end
 
-    .namespace ["Baz"]
-.pcc_sub __init:
-    get_params "0", P2
-    print "baz_init\n"
-    returncc
+.namespace ["Bar"]
 
-    .namespace [] # main again
-.pcc_sub _sub:
-    print "in sub\n"
-    returncc
+.sub 'init' :vtable :method
+    say "bar_init"
+.end
+
+.namespace ["Baz"]
+
+.sub 'init' :vtable :method
+    say "baz_init"
+.end
+
+.namespace [] # main again
 
+.sub '_sub'
+    say "in sub"
+.end
 CODE
 foo_init
 Baz
@@ -443,7 +445,7 @@
 /Method 'nada' not found for invocant of class 'Foo'/
 OUTPUT
 
-pasm_output_is( <<'CODE', <<'OUTPUT', "constructor - diamond parents" );
+pir_output_is( <<'CODE', <<'OUTPUT', "constructor - diamond parents" );
 #
 # A   B A   E
 #  \ /   \ /
@@ -451,115 +453,103 @@
 #    \   /
 #     \ /
 #      F
-    newclass P1, "A"
-    newclass P2, "B"
-    subclass P3, P1, "C"
-    addparent P3, P2
-
-    subclass P4, P1, "D"
-    newclass P5, "E"
-    addparent P4, P5
-
-    subclass P6, P3, "F"
-    addparent P6, P4
-    bsr _check_isa
-
-    print "new F\n"
-    new P16, ['F']
-    print "done\n"
-    end
+.sub 'main' :main
+    newclass $P1, "A"
+    newclass $P2, "B"
+    subclass $P3, $P1, "C"
+    addparent $P3, $P2
+
+    subclass $P4, $P1, "D"
+    newclass $P5, "E"
+    addparent $P4, $P5
+
+    subclass $P6, $P3, "F"
+    addparent $P6, $P4
 
-_check_isa:
     print "F isa D "
-    isa I0, P6, "D"
-    print I0
-    print "\n"
+    isa $I0, $P6, "D"
+    say $I0
     print "D isa F "
-    isa I0, P4, "F"
-    print I0
-    print "\n"
+    isa $I0, $P4, "F"
+    say $I0
     print "F isa C "
-    isa I0, P6, "C"
-    print I0
-    print "\n"
+    isa $I0, $P6, "C"
+    say $I0
     print "C isa F "
-    isa I0, P3, "F"
-    print I0
-    print "\n"
+    isa $I0, $P3, "F"
+    say $I0
     print "F isa E "
-    isa I0, P6, "E"
-    print I0
-    print "\n"
+    isa $I0, $P6, "E"
+    say $I0
     print "E isa F "
-    isa I0, P5, "F"
-    print I0
-    print "\n"
+    isa $I0, $P5, "F"
+    say $I0
     print "F isa A "
-    isa I0, P6, "A"
-    print I0
-    print "\n"
+    isa $I0, $P6, "A"
+    say $I0
     print "A isa F "
-    isa I0, P1, "F"
-    print I0
-    print "\n"
+    isa $I0, $P1, "F"
+    say $I0
     print "F isa B "
-    isa I0, P6, "B"
-    print I0
-    print "\n"
+    isa $I0, $P6, "B"
+    say $I0
     print "B isa F "
-    isa I0, P2, "F"
-    print I0
-    print "\n"
+    isa $I0, $P2, "F"
+    say $I0
 
     print "C isa A "
-    isa I0, P3, "A"
-    print I0
-    print "\n"
+    isa $I0, $P3, "A"
+    say $I0
     print "A isa C "
-    isa I0, P1, "C"
-    print I0
-    print "\n"
+    isa $I0, $P1, "C"
+    say $I0
     print "D isa A "
-    isa I0, P4, "A"
-    print I0
-    print "\n"
+    isa $I0, $P4, "A"
+    say $I0
     print "A isa D "
-    isa I0, P1, "D"
-    print I0
-    print "\n"
-    ret
+    isa $I0, $P1, "D"
+    say $I0
 
+    say "new F"
+    new $P16, ['F']
+    say "done"
+.end
 
 .namespace ["A"]
-.pcc_sub __init:
-    get_params "0", P2
-    print "A init\n"
-    returncc
+
+.sub 'init' :vtable :method
+    say "A init"
+.end
+
 .namespace ["B"]
-.pcc_sub __init:
-    get_params "0", P2
-    print "B init\n"
-    returncc
+
+.sub 'init' :vtable :method
+    say "B init"
+.end
+
 .namespace ["C"]
-.pcc_sub __init:
-    get_params "0", P2
-    print "C init\n"
-    returncc
+
+.sub 'init' :vtable :method
+    say "C init"
+.end
+
 .namespace ["D"]
-.pcc_sub __init:
-    get_params "0", P2
-    print "D init\n"
-    returncc
+
+.sub 'init' :vtable :method
+    say "D init"
+.end
+
 .namespace ["E"]
-.pcc_sub __init:
-    get_params "0", P2
-    print "E init\n"
-    returncc
+
+.sub 'init' :vtable :method
+    say "E init"
+.end
+
 .namespace ["F"]
-.pcc_sub __init:
-    get_params "0", P2
-    print "F init\n"
-    returncc
+
+.sub 'init' :vtable :method
+    say "F init"
+.end
 CODE
 F isa D 1
 D isa F 0
@@ -1108,7 +1098,7 @@
 get_class was called
 OUTPUT
 
-pir_error_output_like( <<'CODE', <<'OUTPUT', "method called on non-object (RT #50440)" );
+pir_error_output_like( <<'CODE', <<'OUTPUT', "method called on non-object" );
 .namespace [ 'Foo' ]
 
 .sub 'blah' :method

Modified: branches/orderedhash_revamp/t/pmc/object-mro.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/object-mro.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/object-mro.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -44,7 +44,7 @@
     subclass F, C, "F"
     addparent F, D
     mro = F.'inspect'('all_parents')
-    it = new ['Iterator'], mro
+    it = iter mro
     it = 0
 loop:
     unless it goto ex
@@ -113,7 +113,7 @@
     .local pmc mro, it, p
 
     mro = A.'inspect'('all_parents')
-    it = new ['Iterator'], mro
+    it = iter mro
     it = 0
 loop:
     unless it goto ex
@@ -183,7 +183,7 @@
     .local pmc mro, it, p
 
     mro = A.'inspect'('all_parents')
-    it = new ['Iterator'], mro
+    it = iter mro
     it = 0
 loop:
     unless it goto ex
@@ -220,7 +220,7 @@
     .local pmc mro, it, p
 
     mro = D.'inspect'('all_parents')
-    it = new ['Iterator'], mro
+    it = iter mro
     it = 0
 loop:
     unless it goto ex
@@ -279,7 +279,7 @@
     .local pmc mro, it, p
 
     mro = Vulcan.'inspect'('all_parents')
-    it = new ['Iterator'], mro
+    it = iter mro
     it = 0
 loop:
     unless it goto ex

Modified: branches/orderedhash_revamp/t/pmc/objects.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/objects.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/objects.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 #! parrot
-# Copyright (C) 2001-2008, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
 =head1 NAME
@@ -1036,7 +1036,6 @@
 
 .namespace []       # Reset to root namespace for next test
 
-#RT #33103
 .sub multiple_anon_classes
      newclass $P0, "City3"
      subclass $P1, $P0
@@ -1313,7 +1312,6 @@
     is( $S0, 'Perl6a;PAST;Node', 'typeof returns objects created from get_class' )
 .end
 
-#RT #39045
 .sub isa_bug
     .local pmc base, o1, o2
     base = subclass 'Hash', ['Perl6b'; 'PAST'; 'Node']
@@ -1351,7 +1349,6 @@
 
 .namespace []   # revert to root for next test
 
-#RT #39056
 .sub vtable_override_once_removed
     .local pmc base
     $P0 = get_class 'Integer'
@@ -1374,14 +1371,13 @@
 
 .namespace []   # revert to root for next test
 
-#RT #40626
 .sub vtable_fails_for_subclasses_of_core_classes
     $P0 = subclass 'Hash', 'Foo41'
     $P0 = subclass 'Hash', 'Bar41'
 
     $P1 = new 'Foo41'
     $S1 = $P1
-    is( $S1, 'Hello world', '__get_string method' )
+    is( $S1, 'Hello world', 'get_string method' )
 
     $P1 = new 'Bar41'
     $S1 = $P1
@@ -1390,7 +1386,7 @@
 
 .namespace [ 'Foo41' ]
 
-.sub '__get_string' :method
+.sub 'get_string' :vtable :method
     .return('Hello world')
 .end
 
@@ -1402,7 +1398,6 @@
 
 .namespace []   # revert to root for next test
 
-#RT #3901
 .sub super___init_called_twice
     $P0 = newclass 'Foo42'
     $P1 = subclass $P0, 'Bar42'
@@ -1484,7 +1479,6 @@
 end:
 .end
 
-# RT #46845
 .sub getting_null_attribute
     newclass $P1, "Foo51"
     addattribute $P1, "i"

Modified: branches/orderedhash_revamp/t/pmc/orderedhash.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/orderedhash.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/orderedhash.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -89,7 +89,7 @@
     set P1, "ok 3\n"
     set P0["j"], P1
 
-    new P2, ['Iterator'], P0
+    iter P2, P0
     set P2, .ITERATE_FROM_START
 iter_loop:
     unless P2, end_iter
@@ -268,7 +268,7 @@
 
     delete P0["a"]
 
-    new P2, ['Iterator'], P0
+    iter P2, P0
     set P2, .ITERATE_FROM_START_KEYS
 iter_loop:
     unless P2, end_iter
@@ -335,7 +335,7 @@
     set P1, "ok 3\n"
     set P0["j"], P1
 
-    new P2, ['Iterator'], P0
+    iter P2, P0
     set P2, .ITERATE_FROM_START_KEYS
 iter_loop:
     unless P2, end_iter
@@ -359,7 +359,7 @@
     set P1, "ok 3\n"
     set P0["j"], P1
 
-    new P2, ['Iterator'], P0
+    iter P2, P0
     set P2, .ITERATE_FROM_START_KEYS
 iter_loop:
     unless P2, end_iter

Modified: branches/orderedhash_revamp/t/pmc/packfile.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/packfile.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/packfile.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 #! parrot
-# Copyright (C) 2006-2008, Parrot Foundation.
+# Copyright (C) 2006-2009, Parrot Foundation.
 # $Id$
 
 =head1 NAME
@@ -32,7 +32,7 @@
     'test_load'()
     'test_pack_fresh_packfile'()
     'test_pack'()
-    # This test will crash on many platforms. See TT#545.
+    # This test will crash on many platforms. See TT #545.
     #'test_synonyms'()
 .end
 
@@ -53,7 +53,7 @@
     pf = new ['Packfile']
     $S0 = pf["uuid"]
     ok(1, 'get_string(uuid)')
-    
+
     # Requesting unknown key should throw exception
     push_eh unknown_key
     $S0 = pf["foo"]
@@ -81,7 +81,7 @@
     $S1 = pf["uuid"]
     $I1 = length $S1
     is($I1, 1, "Fetched length is 1")
-    
+
     # Requesting unknown key should throw exception
     push_eh unknown_key
     pf["foo"] = "fe9ab64082e0f6bbbd7b1e8264127908"
@@ -172,7 +172,7 @@
 # Helper sub to check fields in Packfile header
 .sub '_check_header'
     .param pmc pf
-    
+
     # wordsize always greater than 0
     $I0 = pf["wordsize"]
     ok($I0, "Wordsize set")
@@ -217,7 +217,7 @@
     # Set uuid_type
     pf['uuid_type'] = 1
     $S0 = pf
-    
+
     # Pack it
     ok(1, "PackFile packed")
 
@@ -278,7 +278,7 @@
     .local string second
     # Pack
     second = packfile
-    
+
     $I0 = cmp first, second
     $I0 = not $I0
     todo($I0, 'pack produced same result twice')

Modified: branches/orderedhash_revamp/t/pmc/packfileannotation.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/packfileannotation.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/packfileannotation.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,7 +5,6 @@
 
 t/pmc/packfileannotation.t - test the PackfileAnnotation PMC
 
-
 =head1 SYNOPSIS
 
     % prove t/pmc/packfileannotation.t
@@ -48,3 +47,10 @@
     ok($I0, "Can't fetch wrong value from Annotation")
 
 .end
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/t/pmc/packfileannotations.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/packfileannotations.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/packfileannotations.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -6,7 +6,6 @@
 
 t/pmc/packfileannotations.t - test the PackfileAnnotations PMC
 
-
 =head1 SYNOPSIS
 
     % prove t/pmc/packfileannotations.t
@@ -154,4 +153,4 @@
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/t/pmc/packfileconstanttable.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/packfileconstanttable.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/packfileconstanttable.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -6,7 +6,6 @@
 
 t/pmc/packfileconstanttable.t - test the PackfileConstantTable PMC
 
-
 =head1 SYNOPSIS
 
     % prove t/pmc/packfileconstanttable.t
@@ -27,7 +26,7 @@
 .sub 'main' :main
 .include 'test_more.pir'
 .include 'packfile_constants.pasm'
-    'plan'(14)
+    'plan'(16)
 
     'test_sanity'()
     'test_elements'()
@@ -120,7 +119,7 @@
     ct[0] = "string"
     $I0 = elements ct
     is($I0, 1, "String element added")
-    
+
     ct[1] = 1.0
     $I0 = elements ct
     is($I0, 2, "Number elements added")
@@ -147,7 +146,7 @@
     $I1 = pfc.'get_or_create_constant'('foo')
     $I2 = pfc.'get_or_create_constant'('foo')
     is($I1, $I2, "get_or_create_constant returs same string value for same key")
-    
+
     $I2 = pfc.'get_or_create_constant'('bar')
     $I0 = $I1 != $I2
     ok($I0, "get_or_create_constant returs different string values for different keys")
@@ -156,10 +155,26 @@
     $I1 = pfc.'get_or_create_constant'(1.0)
     $I2 = pfc.'get_or_create_constant'(1.0)
     is($I1, $I2, "get_or_create_constant returs same number value for same key")
-    
+
     $I2 = pfc.'get_or_create_constant'(42.1)
     $I0 = $I1 != $I2
     ok($I0, "get_or_create_constant returs different number values for different keys")
+
+    $P0 = new ['FixedIntegerArray']
+    $P0 = 1
+    $P0[0] = 42
+    $P1 = new ['FixedIntegerArray']
+    $P1 = 1
+    $P1[0] = 42
+    $P2 = new ['FixedIntegerArray']
+    $P2 = 1
+    $P2[0] = 84
+
+    $I0 = pfc.'get_or_create_constant'($P0)
+    $I1 = pfc.'get_or_create_constant'($P1)
+    is($I0, $I1, "get_or_create_constant returns same index for equal PMCs")
+    $I2 = pfc.'get_or_create_constant'($P2)
+    isnt($I0, $I2, "get_or_create_constant returns different index for different PMCs")
 .end
 
 .sub '_get_consttable'
@@ -184,4 +199,4 @@
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/t/pmc/packfiledirectory.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/packfiledirectory.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/packfiledirectory.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -21,7 +21,7 @@
 
 .sub 'main' :main
 .include 'test_more.pir'
-    plan(23)
+    plan(20)
 
     'test_create'()
     'test_typeof'()
@@ -65,7 +65,7 @@
     pf    = _pbc()
     pfdir = pf.'get_directory'()
     $I0   = elements pfdir
-    is($I0, 5, 'PackfileDirectory.elements')
+    is($I0, 4, 'PackfileDirectory.elements')
 .end
 
 
@@ -79,7 +79,6 @@
     expected["BYTECODE"] = 2
     expected["FIXUP"]    = 1
     expected["CONSTANT"] = 1
-    expected["PIC"]      = 1
 
     pf    = _pbc()
     pfdir = pf.'get_directory'()
@@ -136,7 +135,7 @@
   delete_seg:
     delete pfdir[$S0]
     dec $I0
-    $I1   = elements pfdir
+    $I1 = elements pfdir
     is($I0, $I1, "segment deleted")
 
   done:

Modified: branches/orderedhash_revamp/t/pmc/packfilefixupentry.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/packfilefixupentry.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/packfilefixupentry.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -86,4 +86,4 @@
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/t/pmc/packfilefixuptable.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/packfilefixuptable.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/packfilefixuptable.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -66,4 +66,4 @@
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/t/pmc/packfilerawsegment.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/packfilerawsegment.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/packfilerawsegment.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -22,11 +22,14 @@
 # get_integer_keyed_int doesn't return all zeroes either.
 
 .include 't/pmc/testlib/packfile_common.pir'
+.include 'packfile_segments.pasm'
 .sub 'main' :main
 .include 'test_more.pir'
-    plan(2)
+    plan(7)
     test_elements()
     test_get_integer()
+    test_push_integer()
+    test_type()
 .end
 
 # PackfileRawSegment.elements
@@ -60,6 +63,51 @@
     ok($I0, "PackfileRawSegment.get_integer_keyed_int returns some data")
 .end
 
+# PackfileRawSegment.push_integer
+.sub 'test_push_integer'
+    .local pmc pfseg
+    pfseg = new ['PackfileRawSegment']
+
+    push pfseg, 0x1d1
+    push pfseg, 0x002
+    $I0 = pfseg[0]
+    is($I0, 0x1d1, "PackfileRawSegment.push_integer (1)")
+    $I0 = pfseg[1]
+    is($I0, 0x002, "PackfileRawSegment.push_integer (2)")
+.end
+
+# PackfileRawSegment.type
+.sub 'test_type'
+    .local pmc pf, pfdir, pfseg, hash, it
+    pf    = _pbc()
+    pfdir = pf.'get_directory'()
+    hash  = new ['Hash']
+    # annotations.pbc contains all available segments. -1 for directory and unknown.
+    # So, in hash we should have 5 elements.
+    it = iter pfdir
+  loop:
+    unless it goto done
+    $S0 = shift it
+    $P0 = pfdir[$S0]
+    $I0 = $P0.'type'()
+    hash[$I0] = 1
+    goto loop
+
+  done:
+    $I0 = elements hash
+    is($I0, 4, "Got all types of Packfile segments")
+
+    # Now create RawSegment and set type.
+    $P0 = new ['PackfileRawSegment']
+    $I0 = $P0.'type'()
+    is($I0, .PF_BYTEC_SEG, "Default type is PF_BYTEC_SEG")
+
+    $P0.'type'(.PF_DEBUG_SEG)
+    $I0 = $P0.'type'()
+    is($I0, .PF_DEBUG_SEG, "Type successfully changed")
+
+.end
+
 
 # Local Variables:
 #   mode: cperl

Modified: branches/orderedhash_revamp/t/pmc/packfilesegment.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/packfilesegment.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/packfilesegment.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -30,4 +30,4 @@
 #   cperl-indent-level: 4
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/t/pmc/parrotinterpreter.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/parrotinterpreter.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/parrotinterpreter.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,13 +1,7 @@
-#!perl
-# Copyright (C) 2006-2007, Parrot Foundation.
+#!parrot
+# Copyright (C) 2006-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 2;
-
 =head1 NAME
 
 t/pmc/parrotinterpreter.t - test the ParrotInterpreter PMC
@@ -23,19 +17,28 @@
 
 =cut
 
-pir_output_is( <<'CODE', <<'OUT', 'create new interpreter' );
-.sub 'test' :main
+
+.sub main :main
+.include 'test_more.pir'
+
+    plan(12)
+    test_new()      # 1 test
+    test_hll_map()  # 3 tests
+
+# Need for testing
+.annotate 'foo', 'bar'
+    test_inspect()  # 8 tests
+.end
+
+.sub test_new
     new $P0, ['ParrotInterpreter']
-    print "ok 1\n"
+    ok(1,'new')
 .end
-CODE
-ok 1
-OUT
 
-pir_output_is( <<'CODE', <<'OUT', 'setting HLL map dynamically' );
 .HLL 'Perl6'
 
-.sub 'main' :main
+.sub test_hll_map
+.include 'test_more.pir'
     $P0 = get_class 'Integer'
     $P1 = subclass $P0, 'MyInt'
 
@@ -43,18 +46,74 @@
     $P2.'hll_map'($P0, $P1)
 
     $P3 = 'foo'()
-    say $P3                 # "3\n"
+    is($P3, 3)
     $S0 = typeof $P3
-    say $S0                 # "MyInt"
+    is($S0, "MyInt")
+    bar(4)
 .end
 
-.sub 'foo'
+.sub foo
     .return (3)
 .end
-CODE
-3
-MyInt
-OUT
+
+.sub bar
+    .param pmc n
+    $S0 = typeof n
+    is($S0, 'MyInt')
+.end
+
+# Switch back to root namespace
+.HLL 'parrot'
+
+# Test accessors to various Interp fields
+.sub 'test_inspect'
+    .local pmc interp
+    interp = getinterp
+
+    # Enforce creating of lexpad
+    .lex 'foo', interp
+
+    $P0 = interp['sub';0]
+    is($P0, 'test_inspect', 'Got ParrotInterp.sub')
+
+    $P0 = interp['lexpad';0]
+    $I0 = isa $P0, 'LexPad'
+    ok($I0, 'Got ParrotInterp.lexpad')
+
+    $P0 = interp['namespace';0]
+    $I0 = isa $P0, 'NameSpace'
+    ok($I0, 'Got ParrotInterp.namespace')
+    
+    $P0 = interp['continuation';0]
+    $I0 = isa $P0, 'Continuation'
+    ok($I0, 'Got ParrotInterp.continuation')
+    
+    $P0 = interp['annotations';1]
+    $S0 = $P0['foo']
+    is($S0, 'bar', 'Got ParrotInterp.annotations')
+
+    $P0 = interp['context';0]
+    $I0 = isa $P0, 'CallContext'
+    ok($I0, 'Got ParrotInterp.context')
+    # Add more tests for Context. E.g. it is correct Context by inspecting it.
+
+    push_eh caught
+    $I0 = 1
+    $P0 = interp['some_field';0]
+    $I0 = 0
+  caught:
+    pop_eh
+    ok($I0, "Access to non-existent field throws exception")
+
+    push_eh wrong_depth
+    $I0 = 1
+    $P0 = interp['sub';1000]
+    $I0 = 0
+  wrong_depth:
+    pop_eh
+    ok($I0, "Access to wrong depth throws exception")
+
+.end
 
 # Local Variables:
 #   mode: cperl

Modified: branches/orderedhash_revamp/t/pmc/parrotio.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/parrotio.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/parrotio.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -81,14 +81,12 @@
 # should be in the PIR code
 unlink 'new_file';
 
-# RT #46827 test open file, close file, delete file, reopen previously opened stream
-
 SKIP: {
     skip 'no asynch calls yet' => 1;
 
     pir_output_is( <<'CODE', <<'OUT', 'open and close - asynchronous' );
 .sub 'test' :main
-    $P1 = # RT #46831 create a callback here
+    $P1 = # TT #1204 create a callback here
     $P0 = new ['FileHandle']
 
     $P0.open('README')
@@ -168,11 +166,9 @@
 ok 5 - $S0 = $P1.readline($I2) # again on same stream
 OUT
 
-# RT #46833 test reading/writing code points once supported
-
-# RT #46835 test reading long chunks, eof, and across newlines
+# TT #1204 test reading long chunks, eof, and across newlines
 
-# RT #46837 pir_output_is( <<'CODE', <<'OUT', 'print, read, and readline - asynchronous', todo => 'not yet implemented' );
+# TT #1204 pir_output_is( <<'CODE', <<'OUT', 'print, read, and readline - asynchronous', todo => 'not yet implemented' );
 
 # L<PDD22/I\/O PMC API/=item record_separator>
 pir_output_is( <<'CODE', <<'OUT', 'record_separator', todo => 'not yet implemented' );
@@ -268,16 +264,16 @@
 ok 6 - $S0 = $P1.buffer_type() # PIO_FULLBUF
 OUT
 
-# RT #46839 test effects of buffer_type, not just set/get
+# TT #1204 test effects of buffer_type, not just set/get
 
-# RT #46841
+# TT #1177
 # L<PDD22/I\/O PMC API/=item buffer_size>
 # NOTES: try setting positive, zero, negative int
 # perform print and read ops
 # change buffer size while it contains data
 # try with all 'buffer_type' modes
 
-# RT #46843
+# TT #1178
 # L<PDD22/I\/O PMC API/=item get_fd>
 # NOTES: this is going to be platform dependent
 

Modified: branches/orderedhash_revamp/t/pmc/parrotobject.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/parrotobject.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/parrotobject.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -132,7 +132,6 @@
 
 # '
 
-# :vtable inheritance; RT #40626
 pir_output_is( <<'CODE', <<'OUT', ':vtable inheritance from core classes' );
 .sub main :main
     $P0 = subclass 'Hash', 'Foo'
@@ -191,7 +190,7 @@
 1
 OUT
 
-pir_output_is( <<'CODE', <<'OUT', 'RT #41733 - Execution ends after returning from invoke' );
+pir_output_is( <<'CODE', <<'OUT', 'Execution ends after returning from invoke' );
 .namespace ['Foo']
 
 .sub invoke :vtable
@@ -233,7 +232,7 @@
 3
 OUT
 
-pir_error_output_like( <<'CODE', <<'OUT', 'RT #41732' );
+pir_error_output_like( <<'CODE', <<'OUT', 'handle too few positional arguments' );
 .namespace ['Foo']
 
 .sub invoke :vtable
@@ -247,7 +246,7 @@
     $P1()
 .end
 CODE
-/2 params expected/
+/too few positional arguments/
 OUT
 
 # '

Modified: branches/orderedhash_revamp/t/pmc/pccmethod_test.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/pccmethod_test.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/pccmethod_test.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -15,7 +15,7 @@
 
 =head1 SYNOPSIS
 
-    % prove t/pmc/pmethod_test.t
+    % prove t/pmc/pccmethod_test.t
 
 =head1 DESCRIPTION
 

Modified: branches/orderedhash_revamp/t/pmc/pmc.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/pmc.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/pmc.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -24,24 +24,26 @@
 
 =cut
 
-pasm_output_is( <<'CODE', <<'OUTPUT', "newpmc" );
-        print "starting\n"
-        new P0, ['Integer']
-        print "ending\n"
-        end
+pir_output_is( <<'CODE', <<'OUTPUT', "newpmc" );
+.sub main
+    say "starting"
+    new $P0, ['Integer']
+    say "ending"
+.end
 CODE
 starting
 ending
 OUTPUT
 
-pasm_output_is( <<'CODE', <<'OUTPUT', 'typeof' );
-    new P0, ['Integer']
-    typeof S0,P0
-    eq     S0, "Integer", OK_1
+pir_output_is( <<'CODE', <<'OUTPUT', 'typeof' );
+.sub main
+    new $P0, ['Integer']
+    typeof $S0, $P0
+    eq     $S0, "Integer", OK_1
     print  "not "
 OK_1:
     print  "ok 1\n"
-    end
+.end
 CODE
 ok 1
 OUTPUT
@@ -56,203 +58,207 @@
 while ( my ( $type, $id ) = each %pmc_types ) {
     next
         if $types_we_cant_test{$type};
-    my $set_ro = ( $type =~ /^Const\w+/ ) ? <<EOPASM : '';
-    new P10, ['Integer']
-    set P10, 1
-    setprop P0, "_ro", P10
-EOPASM
-    $checkTypes .= <<"CHECK";
-    new P0, '$type'
-    $set_ro
-    set S1, "$type"
-    typeof S0, P0
-    ne S0, S1, L_BadName
+    my $set_ro = ( $type =~ /^Const\w+/ ) ? <<'PIR' : '';
+    new $P10, ['Integer']
+    set $P10, 1
+    setprop $P0, "_ro", $P10
+PIR
+    $checkTypes .= qq{ new \$P0, '$type'\n$set_ro\n};
+    $checkTypes .= qq{ set \$S1, "$type"\n};
+    $checkTypes .= <<'CHECK';
+    typeof $S0, $P0
+    ne $S0, $S1, L_BadName
 CHECK
 }
 
-pasm_output_like( <<"CODE", <<OUTPUT, "PMC type check" );
-    new P10, ['Hash']
-    new P11, ['Hash']
+pir_output_like( <<"CODE", qr/All names ok/, "PMC type check" );
+.sub main
+    new \$P10, ['Hash']
+    new \$P11, ['Hash']
 $checkTypes
-    print "All names ok.\\n"
+    say "All names ok."
     end
 L_BadName:
-    print S1
+    print \$S1
     print " PMCs have incorrect name \\""
-    print S0
+    print \$S0
     print "\\"\\n"
-    end
+.end
 CODE
-/All names ok/
-OUTPUT
 
-pasm_error_output_like( <<'CODE', <<'OUTPUT', 'find_method' );
-    new P1, ['Integer']
-    find_method P0, P1, "no_such_meth"
-    end
+pir_error_output_like( <<'CODE', <<'OUTPUT', 'find_method' );
+.sub main
+    new $P1, ['Integer']
+    find_method $P0, $P1, "no_such_meth"
+.end
 CODE
 /Method 'no_such_meth' not found for invocant of class 'Integer'/
 OUTPUT
 
-pasm_output_is( <<'CODE', <<'OUTPUT', "eq_addr same" );
-      new P0, ['Integer']
-      set P1, P0
-      eq_addr P0, P1, OK1
+pir_output_is( <<'CODE', <<'OUTPUT', "eq_addr same" );
+.sub main
+      new $P0, ['Integer']
+      set $P1, $P0
+      eq_addr $P0, $P1, OK1
       print "not "
 OK1:  print "ok 1\n"
-      ne_addr P0, P1, BAD2
+      ne_addr $P0, $P1, BAD2
       branch OK2
 BAD2: print "not "
 OK2:  print "ok 2\n"
-      end
+.end
 CODE
 ok 1
 ok 2
 OUTPUT
 
-pasm_output_is( <<'CODE', <<'OUTPUT', "eq_addr diff" );
-      new P0, ['Integer']
-      new P1, ['Integer']
-      ne_addr P0, P1, OK1
+pir_output_is( <<'CODE', <<'OUTPUT', "eq_addr diff" );
+.sub main
+      new $P0, ['Integer']
+      new $P1, ['Integer']
+      ne_addr $P0, $P1, OK1
       print "not "
 OK1:  print "ok 1\n"
-      eq_addr P0, P1, BAD2
+      eq_addr $P0, $P1, BAD2
       branch OK2
 BAD2: print "not "
 OK2:  print "ok 2\n"
-      end
+.end
 CODE
 ok 1
 ok 2
 OUTPUT
 
-pasm_output_is( <<'CODE', <<'OUTPUT', "if_null" );
-      null P0
-      if_null P0, OK1
+pir_output_is( <<'CODE', <<'OUTPUT', "if_null" );
+.sub main
+      null $P0
+      if_null $P0, OK1
       print "not "
 OK1:  print "ok 1\n"
-      new P0, ['Integer']
-      if_null P0, BAD2
+      new $P0, ['Integer']
+      if_null $P0, BAD2
       branch OK2
 BAD2: print "not "
 OK2:  print "ok 2\n"
-      end
+.end
 CODE
 ok 1
 ok 2
 OUTPUT
 
-pasm_output_is( <<'CODE', <<'OUTPUT', "Random PMCs are singletons" );
-    new P0, ['Random']
-    new P1, ['Random']
-    eq_addr P0, P1, ok
+pir_output_is( <<'CODE', <<'OUTPUT', "Env PMCs are singletons" );
+.sub main
+    new $P0, ['Env']
+    new $P1, ['Env']
+    eq_addr $P0, $P1, ok
     print "not the same "
 ok: print "ok\n"
-    end
+.end
 CODE
 ok
 OUTPUT
 
-pasm_output_is( <<'CODE', <<'OUTPUT', "issame" );
-    new P0, ['Undef']
-    new P1, ['Undef']
-    set P1, P0
-    issame I0, P0, P1
-    print I0
-    isntsame I0, P0, P1
-    print I0
-    new P2, ['Undef']
-    issame I0, P0, P2
-    print I0
-    isntsame I0, P0, P2
-    print I0
-    print "\n"
-    end
+pir_output_is( <<'CODE', <<'OUTPUT', "issame" );
+.sub main
+    new $P0, ['Undef']
+    new $P1, ['Undef']
+    set $P1, $P0
+    issame $I0, $P0, $P1
+    print $I0
+    isntsame $I0, $P0, $P1
+    print $I0
+    new $P2, ['Undef']
+    issame $I0, $P0, $P2
+    print $I0
+    isntsame $I0, $P0, $P2
+    say $I0
+.end
 CODE
 1001
 OUTPUT
 
-pasm_output_is( <<'CODE', <<'OUT', ".const - Sub constant" );
-.pcc_sub :main main:
+pir_output_is( <<'CODE', <<'OUT', ".const - Sub constant" );
+.sub main
     print "ok 1\n"
-    .const 'Sub' P0 = "foo"
-    invokecc P0
+    .const 'Sub' $P0 = "foo"
+    invokecc $P0
     print "ok 3\n"
-    end
-.pcc_sub foo:
+.end
+.sub foo
     print "ok 2\n"
     returncc
+.end
 CODE
 ok 1
 ok 2
 ok 3
 OUT
 
-pir_output_is( <<'CODE', <<'OUT', "pmc constant 1" );
+pir_output_is( <<'CODE', <<'OUT', "Integer pmc constant " );
 .sub main :main
     .const 'Integer' i = "42"
-    print i
-    print "\n"
+    say i
 .end
 CODE
 42
 OUT
 
-pir_output_is( <<'CODE', <<'OUT', "pmc constant 2" );
+pir_output_is( <<'CODE', <<'OUT', "Float pmc constant " );
 .sub main :main
-    .const 'Integer' i = "42"
-    print i
-    print "\n"
+    .const 'Float' j = "4.2"
+    say j
 .end
 CODE
-42
+4.2
 OUT
 
-pasm_output_is( <<'CODE', <<'OUT', "pmc constant PASM" );
-    .const 'Integer' P0 = "42"
-    print P0
-    print "\n"
-    end
+pir_output_is( <<'CODE', <<'OUT', "pmc constant" );
+.sub main
+    .const 'Integer' $P0 = "42"
+    say $P0
+.end
 CODE
 42
 OUT
 
-pasm_output_is( <<'CODE', <<'OUT', "logical or, and, xor" );
-    new P0, ['Integer']
-    set P0, 2
-    new P1, ['Undef']
-    or P2, P0, P1
-    eq_addr P2, P0, ok1
+pir_output_is( <<'CODE', <<'OUT', "logical or, and, xor" );
+.sub main
+    new $P0, ['Integer']
+    set $P0, 2
+    new $P1, ['Undef']
+    or $P2, $P0, $P1
+    eq_addr $P2, $P0, ok1
     print "not "
 ok1:
     print "ok 1\n"
-    and P2, P0, P1
-    eq_addr P2, P1, ok2
+    and $P2, $P0, $P1
+    eq_addr $P2, $P1, ok2
     print "not "
 ok2:
     print "ok 2\n"
-    xor P2, P0, P1
-    eq_addr P2, P0, ok3
+    xor $P2, $P0, $P1
+    eq_addr $P2, $P0, ok3
     print "not "
 ok3:
     print "ok 3\n"
-    end
+.end
 CODE
 ok 1
 ok 2
 ok 3
 OUT
 
-pasm_output_is( <<'CODE', <<'OUTPUT', "new_p_s" );
-    new P3, ['Integer']
-    set P3, "42"
-    typeof S0, P3
-    print S0
+pir_output_is( <<'CODE', <<'OUTPUT', "new_p_s" );
+.sub main
+    new $P3, ['Integer']
+    set $P3, "42"
+    typeof $S0, $P3
+    print $S0
     print "\n"
-    set I0, P3
-    print I0
+    set $I0, $P3
+    print $I0
     print "\n"
-    end
+.end
 CODE
 String
 42

Modified: branches/orderedhash_revamp/t/pmc/pmcproxy.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/pmcproxy.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/pmcproxy.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -198,7 +198,6 @@
 .end
 
 
-#RT #56816 - issues with PMCProxy, 'typeof', and 'get_class'
 .sub get_class_and_typeof_return_same_pmcproxy
     $P0 = get_class 'Integer'
     $P1 = new $P0

Deleted: branches/orderedhash_revamp/t/pmc/random.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/random.t	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,34 +0,0 @@
-#! parrot
-# Copyright (C) 2001-2008, Parrot Foundation.
-# $Id$
-
-=head1 NAME
-
-t/pmc/random.t - Random numbers
-
-=head1 SYNOPSIS
-
-        % prove t/pmc/random.t
-
-=head1 DESCRIPTION
-
-Tests random number generation
-
-=cut
-
-.sub main :main
-    .include 'test_more.pir'
-
-    plan(2)
-
-    new $P0, ['Random']
-    ok(1, 'Instantiated Random PMC')
-    set $I0, $P0
-    ok(1, 'Got (unknown) random int')
-.end
-
-# Local Variables:
-#   mode: pir
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/t/pmc/resizablebooleanarray.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/resizablebooleanarray.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/resizablebooleanarray.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -393,6 +393,8 @@
 .end
 
 .sub aerobics
+    .local pmc jmpstack
+    jmpstack = new 'ResizableIntegerArray'
     new $P0, ['ResizableBooleanArray']
     set $I10, 10000
 
@@ -470,27 +472,27 @@
     .return()
   errFirstPop:
     print "FAILED: first pop\n"
-    bsr info
+    local_branch jmpstack, info
     .return()
   errSecondPop:
     print "FAILED: second pop\n"
-    bsr info
+    local_branch jmpstack, info
     .return()
   errBuildLen:
     print "FAILED: buildup length\n"
-    bsr info
+    local_branch jmpstack, info
     .return()
   errLeftGet:
     print "FAILED: left get\n"
-    bsr info
+    local_branch jmpstack, info
     .return()
   errRightGet:
     print "FAILED: right get\n"
-    bsr info
+    local_branch jmpstack, info
     .return()
   errTearDown:
     print "FAILED: tear down cap\n"
-    bsr info
+    local_branch jmpstack, info
     .return()
   info:
     ok(0, "aerobics goof:")
@@ -499,7 +501,7 @@
     print "\n#Wanted: "
     print $I3
     print "\n"
-    ret
+    local_return jmpstack
 .end
 
 

Modified: branches/orderedhash_revamp/t/pmc/resizablefloatarray.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/resizablefloatarray.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/resizablefloatarray.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,13 +1,7 @@
-#! perl
-# Copyright (C) 2001-2008, Parrot Foundation.
+#! parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 22;
-
 =head1 NAME
 
 t/pmc/resizablefloatarray.t - ResizableFloatArray PMC
@@ -23,495 +17,450 @@
 
 =cut
 
-pasm_output_is( <<'CODE', <<'OUTPUT', 'creation' );
-    new P0, ['ResizableFloatArray']
-    print "ok\n"
-    end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting array size" );
-    new P0, ['ResizableFloatArray']
-
-    set I0,P0
-    eq I0,0,OK_1
-    print "not "
-OK_1:    print "ok 1\n"
-
-    set P0,1
-    set I0,P0
-    eq I0,1,OK_2
-    print "not "
-OK_2:    print "ok 2\n"
-
-    set P0,5
-    set I0,P0
-    eq I0,5,OK_3
-    print "not "
-OK_3:    print "ok 3\n"
-
-    set P0,9
-    set I0,P0
-    eq I0,9,OK_4
-    print "not "
-OK_4:    print "ok 4\n"
-
-    set P0,7
-    set I0,P0
-    eq I0,7,OK_5
-    print "not "
-OK_5:    print "ok 5\n"
-
-        end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-ok 5
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', "Setting negative array size" );
-    new P0, ['ResizableFloatArray']
-        set P0, -100
-        end
-CODE
-/ResizableFloatArray: Can't resize to negative value!/
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting first element" );
-    new P0, ['ResizableFloatArray']
-    set P0, 1
-
-    set P0[0],-7
-    set I0,P0[0]
-    eq I0,-7,OK_1
-    print "not "
-OK_1:    print "ok 1\n"
-
-    set P0[0],3.7
-    set N0,P0[0]
-    eq N0,3.7,OK_2
-    print "not "
-OK_2:    print "ok 2\n"
-
-    set P0[0],"17.2"
-    set S0,P0[0]
-    eq S0,"17.2",OK_3
-    print "not "
-OK_3:    print "ok 3\n"
-
-    end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting second element" );
-    new P0, ['ResizableFloatArray']
-
-    set P0[1], -7
-    set I0, P0[1]
-    eq I0,-7,OK_1
-    print "not "
-OK_1:    print "ok 1\n"
-
-    set P0[1], 3.7
-    set N0, P0[1]
-    eq N0,3.7,OK_2
-    print "not "
-OK_2:    print "ok 2\n"
-
-    set P0[1],"17.1"
-    set S0, P0[1]
-    eq S0,"17.1",OK_3
-    print "not "
-OK_3:    print "ok 3\n"
-
-    end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting negatively indexed elements" );
-    new P0, ['ResizableFloatArray']
-    set P0, 1
+.const int TESTS = 55
+.const num PRECISION = 1e-6
+
+.sub 'test' :main
+    .include 'test_more.pir'
+    .include 'fp_equality.pasm'
+
+    plan(TESTS)
+
+    creation()
+    setting_size()
+    negative_size()
+    setting_first_element()
+    setting_second_element()
+    setting_negative_index()
+    getting_negative_index()
+    setting_out_of_bounds()
+    getting_out_of_bounds()
+    set_pmc_get_int()
+    set_int_get_pmc()
+    basic_push()
+    push_many_values()
+    basic_pop()
+    pop_many_values()
+    push_pop()
+    pop_empty()
+    shift_empty()
+    push_float()
+    shift_float()
+    unshift_float()
+    check_interface()
+    get_iter()
+    'clone'()
+.end
+
+.sub 'creation'
+    $P0 = new ['ResizableFloatArray']
+    ok(1, 'creation')
+.end
+
+.sub 'setting_size'
+    $P0 = new ['ResizableFloatArray']
+
+    $I0 = $P0
+    is($I0, 0, 'size is initially 0')
+
+    $P0 = 1
+    $I0 = $P0
+    is($I0, 1, 'setting size to 1')
+
+    $P0 = 5
+    $I0 = $P0
+    is($I0, 5, 'resizing to 5')
+
+    $P0 = 9
+    $I0 = $P0
+    is($I0, 9, 'resizing to 9')
+
+    $P0 = 7
+    $I0 = $P0
+    is($I0, 7, 'resizing to 7')
+.end
+
+.sub 'negative_size'
+    $P0 = new ['ResizableFloatArray']
+
+    push_eh negative_size_handler
+    $P0 = -100
+    pop_eh
+    nok(1, 'setting negative array size')
+    .return()
+
+  negative_size_handler:
+    pop_eh
+    ok(1, "cannot set negative array size")
+.end
+
+.sub 'setting_first_element'
+    $P0 = new ['ResizableFloatArray']
+    $P0 = 1
+
+    $P0[0] = -7
+    $I0 = $P0[0]
+    is($I0, -7, 'setting first element from int')
+
+    $P0[0] = 3.7
+    $N0 = $P0[0]
+    is($N0, 3.7, 'setting first element from number')
+
+    $P0[0] = "17.2"
+    $S0 = $P0[0]
+    is($S0, "17.2", 'setting first element from string')
+.end
+
+.sub 'setting_second_element'
+    $P0 = new ['ResizableFloatArray']
+
+    $P0[1] = -7
+    $I0 = $P0[1]
+    is($I0, -7, 'setting second element from int')
+
+    $P0[1] = 3.7
+    $N0 = $P0[1]
+    is($N0, 3.7, 'setting second element from number')
+
+    $P0[1] = "17.1"
+    $S0 = $P0[1]
+    is($S0, "17.1", 'setting second element from string')
+.end
 
-    push_eh caught
-    set P0[-1], -7
+.sub 'setting_negative_index'
+    $P0 = new ['ResizableFloatArray']
+    $P0 = 1
+
+    push_eh setting_negative_index_handler
+    $P0[-1] = -7
     pop_eh
-    print "no exception\n"
-    end
-caught:
-    say "caught something"
-    end
-CODE
-caught something
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Getting negatively indexed elements" );
-    new P0, ['ResizableFloatArray']
-    set P0, 1
+    nok(1, 'setting negatively indexed elements')
+    .return ()
+
+  setting_negative_index_handler:
+    ok(1, 'setting negatively indexed elements')
+.end
 
-    push_eh caught
-    set I0, P0[-1]
+.sub 'getting_negative_index'
+    $P0 = new ['ResizableFloatArray']
+    $P0 = 1
+
+    push_eh getting_negative_index_handler
+    $I0 = $P0[-1]
     pop_eh
-    say "no exception"
-    end
-caught:
-    say "caught an exception"
-    end
-CODE
-caught an exception
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting out-of-bounds elements" );
-    new P0, ['ResizableFloatArray']
-    set P0, 1
-
-    set P0[1], -7
-    print "ok 1\n"
-
-    end
-CODE
-ok 1
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Getting out-of-bounds elements" );
-    new P0, ['ResizableFloatArray']
-    set P0, 1
-
-    set I0, P0[1]
-    print "ok 1\n"
-    end
-CODE
-ok 1
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', "Set via PMC keys, access via INTs" );
-     .include 'fp_equality.pasm'
-     new P0, ['ResizableFloatArray']
-     new P1, ['Key']
-
-     set P1, 0
-     set P0[P1], 25
-
-     set P1, 1
-     set P0[P1], 2.5
-
-     set P1, 2
-     set P0[P1], "17.32"
-
-     set I0, P0[0]
-     eq I0, 25, OK1
-     print "not "
-OK1: print "ok 1\\n"
-
-     set N0, P0[1]
-     .fp_eq_pasm(N0, 2.5, OK2)
-     print "not "
-OK2: print "ok 2\\n"
-
-     set S0, P0[2]
-     eq S0, "17.32", OK3
-     print "not "
-OK3: print "ok 3\\n"
-
-     end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', "Set via INTs, access via PMC Keys" );
-     .include 'fp_equality.pasm'
-     new P0, ['ResizableFloatArray']
-     set P0, 1
-
-     set P0[25], 125
-     set P0[128], 10.2
-     set P0[513], "17.3"
-     new P1, ['Integer']
-     set P1, 123456
-     set P0[1023], P1
-
-     new P2, ['Key']
-     set P2, 25
-     set I0, P0[P2]
-     eq I0, 125, OK1
-     print "not "
-OK1: print "ok 1\\n"
-
-     set P2, 128
-     set N0, P0[P2]
-     .fp_eq_pasm(N0, 10.2, OK2)
-     print "not "
-OK2: print "ok 2\\n"
-
-     set P2, 513
-     set S0, P0[P2]
-     eq S0, "17.3", OK3
-     print "not "
-OK3: print "ok 3\\n"
-
-     set P2, 1023
-     set P3, P0[P2]
-     set I1, P3
-     eq I1, 123456, OK4
-     print "not "
-OK4: print "ok 4\\n"
-
-     end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'basic push' );
-     .include 'fp_equality.pasm'
-     new P0, ['ResizableFloatArray']
-     push P0, 1.0
-     push P0, 2.0
-     push P0, 3.0
-     set N0, P0[0]
-     .fp_eq_pasm(N0, 1.0, OK1)
-     print "not "
-OK1: print "ok 1\\n"
-
-     set N0, P0[1]
-     .fp_eq_pasm(N0, 2.0, OK2)
-     print "not "
-OK2: print "ok 2\\n"
-
-     set N0, P0[2]
-     .fp_eq_pasm(N0, 3.0, OK3)
-     print "not "
-OK3: print "ok 3\\n"
-     end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'push many values' );
-     .include 'fp_equality.pasm'
-     new P0, ['ResizableFloatArray']
-     set I0, 0
-L1:  set N0, I0
-     push P0, N0
-     inc I0
-     lt I0, 100000, L1
-
-     set N0, P0[99999]
-     .fp_eq_pasm(N0, 99999.0, OK1)
-     print N0
-     print "not "
-OK1: print "ok 1\\n"
-     end
-CODE
-ok 1
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'basic pop' );
-     .include 'fp_equality.pasm'
-     new P0, ['ResizableFloatArray']
-     set P0[0], 1.0
-     set P0[1], 2.0
-     set P0[2], 3.0
-     pop N0, P0
-     .fp_eq_pasm(N0, 3.0, OK1)
-     print "not "
-OK1: print "ok 1\\n"
-
-     pop N0, P0
-     .fp_eq_pasm(N0, 2.0, OK2)
-     print "not "
-OK2: print "ok 2\\n"
-
-     pop N0, P0
-     .fp_eq_pasm(N0, 1.0, OK3)
-     print "not "
-OK3: print "ok 3\\n"
-     end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'pop many values' );
-     .include 'fp_equality.pasm'
-     new P0, ['ResizableFloatArray']
-     set I0, 0
-L1:  set N0, I0
-     set P0[I0], N0
-     inc I0
-     lt I0, 100000, L1
-
-L2:  dec I0
-     set N1, I0
-     pop N0, P0
-     .fp_eq_pasm(N0, N1, OK)
-     branch NOT_OK
-OK:  gt I0, 0, L2
-     print "ok\\n"
-     end
-
-NOT_OK:
-     print N0
-     print "\\n"
-     print N1
-     print "\\n"
-     end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'push/pop' );
-     .include 'fp_equality.pasm'
-     new P0, ['ResizableFloatArray']
-     push P0, 1.0
-     push P0, 2.0
-     push P0, 3.0
-     pop N0, P0
-     .fp_eq_pasm(N0, 3.0, OK1)
-     print "not "
-OK1: print "ok 1\\n"
-     end
-CODE
-ok 1
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', 'pop from empty array' );
-     new P0, ['ResizableFloatArray']
-     pop N0, P0
-     end
-CODE
-/ResizableFloatArray: Can't pop from an empty array!/
-OUTPUT
-
-pir_output_is( << 'CODE', << 'OUTPUT', "check whether interface is done" );
-
-.sub _main
-    .local pmc pmc1
-    pmc1 = new ['ResizableFloatArray']
-    .local int bool1
-    does bool1, pmc1, "scalar"
-    print bool1
-    print "\n"
-    does bool1, pmc1, "array"
-    print bool1
-    print "\n"
-    does bool1, pmc1, "no_interface"
-    print bool1
-    print "\n"
-    end
-.end
-CODE
-0
-1
-0
-OUTPUT
-
-pir_output_is( << 'CODE', << 'OUTPUT', "push float" );
-
-.sub _main
-    .local pmc pmc1
-    pmc1 = new ['ResizableFloatArray']
-    pmc1[9999] = 10000.10000
-    push pmc1, 123.123
-    .local int elements
-    elements = pmc1
-    print elements
-    print "\n"
-    .local string last
-    last = pmc1[10000]
-    print last
-    print "\n"
-    end
-.end
-CODE
-10001
-123.123
-OUTPUT
-
-pir_output_is( << 'CODE', << 'OUTPUT', "shift float" );
-.sub test :main
-    .local pmc ar
-    ar = new ['ResizableFloatArray']
-    ar[0] = 10.1
-    ar[1] = 20.2
-    $I0 = elements ar
-    print $I0
-    print ' '
-    $N0 = shift ar
-    print $N0
-    print ' '
-    $I0 = elements ar
-    print $I0
-    print ' '
-    $N0 = shift ar
-    print $N0
-    print ' '
-    $I0 = elements ar
-    print $I0
-    print "\n"
-.end
-CODE
-2 10.1 1 20.2 0
-OUTPUT
-
-pir_output_is( << 'CODE', << 'OUTPUT', "unshift float" );
-.sub test :main
-    .local pmc ar
-    ar = new ['ResizableFloatArray']
-    unshift ar, 10.1
-    unshift ar, 20.2
-    $I0 = elements ar
-    print $I0
-    print ' '
-    $N0 = ar[0]
-    print $N0
-    print ' '
-    $N0 = ar[1]
-    print $N0
-    print "\n"
-.end
-CODE
-2 20.2 10.1
-OUTPUT
+    nok(1, 'getting negatively indexed elements')
+    .return ()
+
+  getting_negative_index_handler:
+    ok(1, 'getting negatively indexed elements')
+.end
 
-pir_output_is( << 'CODE', << 'OUTPUT', "get_iter" );
-.sub main :main
+.sub 'setting_out_of_bounds'
+    $P0 = new ['ResizableFloatArray']
+    $P0 = 1
+
+    $P0[1] = -7
+    ok(1, 'setting out-of-bounds elements')
+.end
+
+.sub 'getting_out_of_bounds'
+    $P0 = new ['ResizableFloatArray']
+    $P0 = 1
+
+    $I0 = $P0[1]
+    ok(1, 'getting out-of-bounds elements')
+.end
+
+.sub 'set_pmc_get_int'
+    $P0 = new ['ResizableFloatArray']
+    $P1 = new ['Key']
+
+    $P1 = 0
+    $P0[$P1] = 25
+
+    $P1 = 1
+    $P0[$P1] = 2.5
+
+    $P1 = 2
+    $P0[$P1] = "17.32"
+
+    $I0 = $P0[0]
+    is($I0, 25, 'Set via PMC keys, access via INTs (1)')
+
+    $N0 = $P0[1]
+    is($N0, 2.5, 'Set via PMC keys, access via INTs (2)', PRECISION)
+
+    $S0 = $P0[2]
+    is($S0, "17.32", 'Set via PMC keys, access via INTs (3)')
+.end
+
+.sub 'set_int_get_pmc'
+    $P0 = new ['ResizableFloatArray']
+    $P0 = 1
+
+    $P0[25] = 125
+    $P0[128] = 10.2
+    $P0[513] = "17.3"
+    $P1 = new ['Integer']
+    $P1 = 123456
+    $P0[1023] = $P1
+
+    $P2 = new ['Key']
+
+    $P2 = 25
+    $I0 = $P0[$P2]
+    is($I0, 125, 'Set via INTs, access via PMC Keys (1)')
+
+    $P2 = 128
+    $N0 = $P0[$P2]
+    is($N0, 10.2, 'Set via INTs, access via PMC Keys (2)', PRECISION)
+
+    $P2 = 513
+    $S0 = $P0[$P2]
+    is($S0, "17.3", 'Set via INTs, access via PMC Keys (3)')
+
+    $P2 = 1023
+    $I0 = $P0[$P2]
+    is($I0, 123456, 'Set via INTs, access via PMC Keys (4)')
+.end
+
+.sub 'basic_push'
+    $P0 = new ['ResizableFloatArray']
+    push $P0, 1.0
+    push $P0, 2.0
+    push $P0, 3.0
+
+    $N0 = $P0[0]
+    is($N0, 1.0, 'basic push (1)', PRECISION)
+
+    $N0 = $P0[1]
+    is($N0, 2.0, 'basic push (2)', PRECISION)
+
+    $N0 = $P0[2]
+    is($N0, 3.0, 'basic push (3)', PRECISION)
+.end
+
+.sub 'push_many_values'
+    $P0 = new ['ResizableFloatArray']
+
+    $I0 = 0
+  push_many_values_fill:
+    $N0 = $I0
+    push $P0, $N0
+    inc $I0
+    if $I0 < 100000 goto push_many_values_fill
+
+  push_many_values_test:
+    dec $I0
+    $N0 = $I0
+    $N1 = $P0[$I0]
+    .fp_ne($N0, $N1, push_many_values_evil)
+    if $I0 > 0 goto push_many_values_test
+
+    ok(1, 'push many values')
+    .return ()
+
+  push_many_values_evil:
+    nok(1, 'push many values is evil')
+.end
+
+.sub 'basic_pop'
+    $P0 = new ['ResizableFloatArray']
+    $P0[0] = 1.0
+    $P0[1] = 2.0
+    $P0[2] = 3.0
+
+    $N0 = pop $P0
+    is($N0, 3.0, 'basic pop (1)', PRECISION)
+
+    $N0 = pop $P0
+    is($N0, 2.0, 'basic pop (2)', PRECISION)
+
+    $N0 = pop $P0
+    is($N0, 1.0, 'basic pop (3)', PRECISION)
+.end
+
+.sub 'pop_many_values'
+    $P0 = new ['ResizableFloatArray']
+
+    $I0 = 0
+  pop_many_values_fill:
+    $N0 = $I0
+    $P0[$I0] = $N0
+    inc $I0
+    if $I0 < 100000 goto pop_many_values_fill
+
+  pop_many_values_test:
+    dec $I0
+    $N0 = $I0
+    $N1 = pop $P0
+    .fp_ne($N0, $N1, pop_many_values_evil)
+    if $I0 > 0 goto pop_many_values_test
+
+    ok(1, 'pop many values')
+    .return ()
+
+  pop_many_values_evil:
+    nok(1, 'pop many values is evil')
+.end
+
+.sub 'push_pop'
+    $P0 = new ['ResizableFloatArray']
+    push $P0, 1.0
+    push $P0, 2.0
+    push $P0, 3.0
+
+    $N0 = pop $P0
+    is($N0, 3.0, 'push/pop (1)')
+
+    $N0 = pop $P0
+    is($N0, 2.0, 'push/pop (2)')
+
+    $N0 = pop $P0
+    is($N0, 1.0, 'push/pop (3)')
+.end
+
+.sub 'pop_empty'
+    $P0 = new ['ResizableFloatArray']
+
+    push_eh pop_empty_handler
+    $N0 = pop $P0
+    pop_eh
+    nok(1, 'pop from empty array')
+    .return()
+
+  pop_empty_handler:
+    pop_eh
+    ok(1, "cannot pop from empty array")
+.end
+
+.sub 'shift_empty'
+    $P0 = new ['ResizableFloatArray']
+
+    push_eh shift_empty_handler
+    $N0 = shift $P0
+    pop_eh
+    nok(1, 'shift from empty array')
+    .return()
+
+  shift_empty_handler:
+    pop_eh
+    ok(1, "cannot shift from empty array")
+.end
+
+.sub 'check_interface'
+    $P0 = new ['ResizableFloatArray']
+
+    $I0 = does $P0, 'scalar'
+    nok($I0, 'ResizableFloatArray does not scalar')
+
+    $I0 = does $P0, 'array'
+    ok($I0, 'ResizableFloatArray does array')
+
+    $I0 = does $P0, 'no_interface'
+    nok($I0, 'ResizableFloatArray does not no_interface')
+.end
+
+.sub 'push_float'
+    $P0 = new ['ResizableFloatArray']
+    $P0[9999] = 10000.10000
+    push $P0, 123.123
+
+    $I0 = elements $P0
+    is($I0, 10001, 'push float: size')
+
+    $N0 = $P0[10000]
+    is($N0, 123.123, 'push float: test pushed element', PRECISION)
+.end
+
+.sub 'shift_float'
+    $P0 = new ['ResizableFloatArray']
+    $P0[0] = 10.1
+    $P0[1] = 20.2
+
+    $I0 = elements $P0
+    is($I0, 2, 'shift float: size')
+
+    $N0 = shift $P0
+    is($N0, 10.1, 'shift float: first element', PRECISION)
+
+    $N0 = shift $P0
+    is($N0, 20.2, 'shift float: second element', PRECISION)
+
+    $I0 = elements $P0
+    is($I0, 0, 'shift float: array now empty')
+.end
+
+.sub 'unshift_float'
+    $P0 = new ['ResizableFloatArray']
+    unshift $P0, 10.1
+    unshift $P0, 20.2
+
+    $I0 = elements $P0
+    is($I0, 2, 'unshift float: size')
+
+    $N0 = $P0[0]
+    is($N0, 20.2, 'unshift float: first element', PRECISION)
+
+    $N0 = $P0[1]
+    is($N0, 10.1, 'unshift float: second element', PRECISION)
+.end
+
+.sub 'get_iter'
     $P0 = new ['ResizableFloatArray']
     $P0[0] = 1.1
     $P0[1] = 99.99
     $P0[2] = -345.001
+
     $P1 = iter $P0
-loop:
-    unless $P1 goto loop_end
-    $S2 = shift $P1
-    say $S2
-    goto loop
-  loop_end:
-.end
-CODE
-1.1
-99.99
--345.001
-OUTPUT
+
+    $N0 = shift $P1
+    is($N0, 1.1, 'get_iter: first element ok', PRECISION)
+
+    $N0 = shift $P1
+    is($N0, 99.99, 'get_iter: second element ok', PRECISION)
+
+    $N0 = shift $P1
+    is($N0, -345.001, 'get_iter: third element ok', PRECISION)
+
+    nok($P1, 'get_iter: iterator emptied')
+.end
+
+.sub 'clone'
+    .local int i
+    $P0 = new ['ResizableFloatArray']
+
+    $I30 = 3000
+    i = 0
+  clone_fill:
+    unless i < $I30 goto clone_filled
+    $N0 = i + 0.01
+    $P0[i] = $N0
+    inc i
+    goto clone_fill
+
+  clone_filled:
+    $P1 = clone $P0
+    $I0 = $P0
+    $I1 = $P1
+    is($I0, $I1, 'clones have the same size')
+
+  clone_iter_loop:
+    dec $I0
+    $N0 = $P1[$I0]
+    $N1 = $I0 + 0.01
+    .fp_ne($N0, $N1, clone_evil)
+    if $I0 > 0 goto clone_iter_loop
+
+    ok(1, 'clone make a good clone')
+    .return()
+
+  clone_evil:
+    nok(0, 'clone made an evil clone')
+.end
 
 # Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
+#   mode: pir
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/t/pmc/resizableintegerarray.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/resizableintegerarray.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/resizableintegerarray.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,455 +1,555 @@
-#! perl
-# Copyright (C) 2001-2007, Parrot Foundation.
+#! parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 18;
-
 =head1 NAME
 
-t/pmc/resizableintegerarray.t - ResizableIntegerArray PMC
+t/pmc/resizableintegerarray.t - Tests for the ResizableIntegerArray PMC
 
 =head1 SYNOPSIS
 
-    % prove t/pmc/ResizableIntegerArray.t
+    % prove t/pmc/resizableintegerarray.t
 
 =head1 DESCRIPTION
 
-Tests C<ResizableIntegerArray> PMC. Checks size, sets various elements, including
-out-of-bounds test. Checks INT and PMC keys.
+This tests the C<ResizableIntegerArray> PMC. It checks size, sets various
+elements, including out-of-bounds test as well as INT and PMC keys.
 
 =cut
 
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting array size" );
-    new P0, ['ResizableIntegerArray']
+=for notes
+
+Coverage plan:
+
+ * Get & Set Size
+
+ * Get & Set Element
+     * Type of value (int, num, string, pmc)
+     * Type of index (int, pmc)
+     * index negative/in-range/beyond-end
+     * Set doesn't clobber other elements
+
+ * Push/Unshift, Pop/Shift
+     * Correct values
+     * Correct sequence
+     * Correctly resized
+
+ * Iterator
+     * Doesn't change array size
+     * Multiple concurrent iterators don't interfere
 
-    set I0,P0
-    eq I0,0,OK_1
-    print "not "
-OK_1:    print "ok 1\n"
-
-    set P0,1
-    set I0,P0
-    eq I0,1,OK_2
-    print "not "
-OK_2:    print "ok 2\n"
-
-    set P0,5
-    set I0,P0
-    eq I0,5,OK_3
-    print "not "
-OK_3:    print "ok 3\n"
-
-    set P0,9
-    set I0,P0
-    eq I0,9,OK_4
-    print "not "
-OK_4:    print "ok 4\n"
-
-    set P0,7
-    set I0,P0
-    eq I0,7,OK_5
-    print "not "
-OK_5:    print "ok 5\n"
-
-        end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-ok 5
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting first element" );
-    new P0, ['ResizableIntegerArray']
-    set P0, 1
-
-    set P0[0],-7
-    set I0,P0[0]
-    eq I0,-7,OK_1
-    print "not "
-OK_1:    print "ok 1\n"
-
-    set P0[0],3.7
-    set N0,P0[0]
-    eq N0,3.0,OK_2
-    print "not "
-OK_2:    print "ok 2\n"
-
-    set P0[0],"17"
-    set S0,P0[0]
-    eq S0,"17",OK_3
-    print "not "
-OK_3:    print "ok 3\n"
-
-    end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting second element" );
-    new P0, ['ResizableIntegerArray']
-
-    set P0[1], -7
-    set I0, P0[1]
-    eq I0,-7,OK_1
-    print "not "
-OK_1:    print "ok 1\n"
-
-    set P0[1], 3.7
-    set N0, P0[1]
-    eq N0,3.0,OK_2
-    print "not "
-OK_2:    print "ok 2\n"
-
-    set P0[1],"17"
-    set S0, P0[1]
-    eq S0,"17",OK_3
-    print "not "
-OK_3:    print "ok 3\n"
-
-    end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting negatively indexed elements" );
-    new P0, ['ResizableIntegerArray']
-    set P0, 1
+=cut
+
+.sub main :main
+    .include 'test_more.pir'
+    plan(41)
+
+    test_does_interfaces()
+
+    test_get_size()
+    test_resize()
+    test_distinct_storage()
+
+    test_cant_set_negative()
+    test_cant_get_negative()
+    test_set_beyond_end()
+    test_get_beyond_end()
+
+    test_conversion()
+    test_conversion_overflow()
+
+    test_set_pmc_index()
+    test_get_pmc_index()
+
+    test_push()
+    test_pop()
+    test_pop_many()
+    test_push_many()
+    test_push_pop()
+    test_cant_pop_empty()
+    test_shift()
+    test_unshift()
+    test_iterator()
+.end
+
+.sub test_does_interfaces
+    $P0 = new ['ResizableIntegerArray']
+    ok( 1, 'Instantiated ResizableIntegerArray PMC' )
+    $I0 = does $P0, 'array'
+    ok( $I0, 'Interface does "array"' )
+    $I0 = does $P0, 'scalar'
+    is( $I0, 0, 'Interface does not do "scalar"' )
+    $I0 = does $P0, 'no_interface'
+    is( $I0, 0, 'Interface does not do "no_interface"' )
+.end
+
+.sub test_get_size
+    $P0 = new ['ResizableIntegerArray']
+    $I0 = $P0
+    is( $I0, 0, 'Initial array size is 0' )
+    $I1 = elements $P0
+    is( $I0, $I1, '... and "elements" opcode agrees' )
+.end
 
+.sub test_resize
+    $P0 = new ['ResizableIntegerArray']
+    $I1 = 0
+
+    $P0 = 1
+    $I0 = $P0
+    ne $I0, 1, X1
+    inc $I1
+
+    $P0 = 9
+    $I0 = $P0
+    ne $I0, 9, X1
+    inc $I1
+
+    $P0 = 5
+    $I0 = $P0
+    ne $I0, 5, X1
+    inc $I1
+
+    $P0 = 99999
+    $I0 = $P0
+    ne $I0, 99999, X1
+    inc $I1
+
+    $P0 = 0
+    $I0 = $P0
+    ne $I0, 0, X1
+    inc $I1
+
+    $P0 = 77
+    $I0 = $P0
+    ne $I0, 77, X1
+    inc $I1
+
+X1:
+    is( $I1, 6, 'Setting array size (four different values, including 0)' )
+
+    $I2 = elements $P0
+    is( $I0, $I2, '... and "elements" opcode still agrees' )
+
+    push_eh E
+    $I1 = 1
+    $P0 = -4
+    $I1 = 0
+E:
+    pop_eh
+    ok( $I1, 'Setting negative size should throw an exception' )
+.end
+
+.sub test_distinct_storage
+    # Walk the array in pseudo-random order
+    # Pick a sample size $I4 and another number $I2, such that
+    #   ∀n: n > 0 ∧ $I2 ⁿ % $I4 = 1 ⇒ n % $I4 = 0
+    $I4 = 17
+    $I2 = 3
+    # Create and fill array in random order
+    $P0 = new ['ResizableIntegerArray']
+    $P0 = $I4
+#   say '\n ... checking that pseudo-random sequence is exhaustive ...'
+    $I0 = 1
+L1:
+#   say $I0
+    $I0 = mul $I0, $I2
+    $I0 = mod $I0, $I4
+    $P0[$I0] = $I0
+    gt $I0, 1, L1
+    $P0[0] = 0
+#   say 0
+    # Read back array and check values match
+    $I0 = 0
+L2:
+    $I1 = $P0[$I0]
+    ne $I1, $I0, X1
+    inc $I0
+    lt $I0, $I4, L2
+X1:
+    is( $I0, $I4, 'All array elements stored separately' )
+.end
+
+.sub test_cant_set_negative
+    $P0 = new ['ResizableIntegerArray']
+    $P0 = 1
+    $I0 = 1
     push_eh eh
-    set P0[-1], -7
+    $P0[-1] = -7
+    $I0 = 0
+eh:
     pop_eh
-    print "no ex\n"
-    end
+    ok( $I0, 'Setting with negative index should throw an exception' )
+.end
+
+.sub test_cant_get_negative
+    $P0 = new ['ResizableIntegerArray']
+    $P0 = 1
+    $I0 = 1
+    push_eh eh
+    $I0 = $P0[-1]
+    $I0 = 0
 eh:
-    say "got an ex"
-    end
-CODE
-got an ex
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Getting negatively indexed elements" );
-    new P0, ['ResizableIntegerArray']
-    set P0, 1
+    pop_eh
+    ok( $I0, 'Getting with negative index should throw an exception' )
+.end
 
+.sub test_set_beyond_end
+    $P0 = new ['ResizableIntegerArray']
+    $P0 = 1
+    $I0 = 0
     push_eh eh
-    set I0, P0[-1]
+    $P0[1] = -7
+    $I0 = 1
+eh:
     pop_eh
-    print "no ex\n"
-    end
+    ok( $I0, 'Setting with too-big index should not throw an exception' )
+
+    $I0 = $P0
+    is( $I0, 2, '... and should extend array' )
+.end
+
+.sub test_get_beyond_end
+    $P0 = new ['ResizableIntegerArray']
+    $P0 = 1
+    $I0 = 1
+    push_eh eh
+    $I1 = $P0[1]
+    $I0 = 1
 eh:
-    say "got an ex"
-    end
-CODE
-got an ex
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting out-of-bounds elements" );
-    new P0, ['ResizableIntegerArray']
-    set P0, 1
-
-    set P0[1], -7
-    print "ok 1\n"
-
-    end
-CODE
-ok 1
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Getting out-of-bounds elements" );
-    new P0, ['ResizableIntegerArray']
-    set P0, 1
-
-    set I0, P0[1]
-    print "ok 1\n"
-    end
-CODE
-ok 1
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', "Set via PMC keys, access via INTs" );
-     .include 'fp_equality.pasm'
-     new P0, ['ResizableIntegerArray']
-     new P1, ['Key']
-
-     set P1, 0
-     set P0[P1], 25
-
-     set P1, 1
-     set P0[P1], 2.5
-
-     set P1, 2
-     set P0[P1], "17"
-
-     set I0, P0[0]
-     eq I0, 25, OK1
-     print "not "
-OK1: print "ok 1\\n"
-
-     set N0, P0[1]
-     .fp_eq_pasm(N0, 2.0, OK2)
-     print "not "
-OK2: print "ok 2\\n"
-
-     set S0, P0[2]
-     eq S0, "17", OK3
-     print "not "
-OK3: print "ok 3\\n"
-
-     end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', "Set via INTs, access via PMC Keys" );
-     .include 'fp_equality.pasm'
-     new P0, ['ResizableIntegerArray']
-     set P0, 1
-
-     set P0[25], 125
-     set P0[128], 10.2
-     set P0[513], "17"
-     new P1, ['Integer']
-     set P1, 123456
-     set P0[1023], P1
-
-     new P2, ['Key']
-     set P2, 25
-     set I0, P0[P2]
-     eq I0, 125, OK1
-     print "not "
-OK1: print "ok 1\\n"
-
-     set P2, 128
-     set N0, P0[P2]
-     .fp_eq_pasm(N0, 10.0, OK2)
-     print "not "
-OK2: print "ok 2\\n"
-
-     set P2, 513
-     set S0, P0[P2]
-     eq S0, "17", OK3
-     print "not "
-OK3: print "ok 3\\n"
-
-     set P2, 1023
-     set P3, P0[P2]
-     set I1, P3
-     eq I1, 123456, OK4
-     print "not "
-OK4: print "ok 4\\n"
-
-     end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-OUTPUT
-
-pir_output_is( << 'CODE', << 'OUTPUT', "check whether interface is done" );
-
-.sub test :main
-    .local pmc pmc1
-    pmc1 = new ['ResizableIntegerArray']
-    .local int bool1
-    does bool1, pmc1, "scalar"
-    print bool1
-    print "\n"
-    does bool1, pmc1, "array"
-    print bool1
-    print "\n"
-    does bool1, pmc1, "no_interface"
-    print bool1
-    print "\n"
-    end
-.end
-CODE
-0
-1
-0
-OUTPUT
-
-pir_output_is( << 'CODE', << 'OUTPUT', "push integer" );
-
-.sub test :main
-    .local pmc pmc1
-    pmc1 = new ['ResizableIntegerArray']
-    pmc1[9999] = 0
-    push pmc1, 10001
-    .local int elements
-    elements = pmc1
-    print elements
-    print "\n"
-    .local string last
-    last = pmc1[10000]
-    print last
-    print "\n"
-    end
-.end
-CODE
-10001
-10001
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'basic pop' );
-     new P0, ['ResizableIntegerArray']
-     set P0[0], 4
-     set P0[1], 8
-     set P0[2], 16
-     pop I0, P0
-     eq I0, 16, OK1
-     print "not "
-     print I0
-OK1: print "ok 1\n"
-
-     pop I0, P0
-     eq I0, 8, OK2
-     print "not "
-     print I0
-OK2: print "ok 2\n"
-
-     pop I0, P0
-     eq I0, 4, OK3
-     print "not "
-     print I0
-OK3: print "ok 3\n"
-     end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'pop many values' );
-     new P0, ['ResizableIntegerArray']
-     set I0, 0
-L1:  set P0[I0], I0
-     inc I0
-     lt I0, 100000, L1
-
-L2:  dec I0
-     pop I1, P0
-     eq I0, I1, OK
-     branch NOT_OK
-OK:  gt I0, 0, L2
-     print "ok\n"
-     end
-
-NOT_OK:
-     print I0
-     print "\n"
-     print I1
-     print "\n"
-     end
-CODE
-ok
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', 'push/pop' );
-     new P0, ['ResizableIntegerArray']
-     push P0, 2
-     push P0, 4
-     push P0, 6
-     pop I0, P0
-     eq I0, 6, OK1
-     print "not "
-OK1: print "ok 1\n"
-     end
-CODE
-ok 1
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', 'pop from empty array' );
-     new P0, ['ResizableIntegerArray']
-     pop I0, P0
-     end
-CODE
-/ResizableIntegerArray: Can't pop from an empty array!/
-OUTPUT
-
-#'
-pir_output_is( << 'CODE', << 'OUTPUT', "shift integer" );
-.sub test :main
-    .local pmc ar
-    ar = new ['ResizableIntegerArray']
-    ar[0] = 10
-    ar[1] = 20
-    $I0 = elements ar
-    print $I0
-    print ' '
-    $I0 = shift ar
-    print $I0
-    print ' '
-    $I0 = elements ar
-    print $I0
-    print ' '
-    $I0 = shift ar
-    print $I0
-    print ' '
-    $I0 = elements ar
-    say $I0
-.end
-CODE
-2 10 1 20 0
-OUTPUT
-
-pir_output_is( << 'CODE', << 'OUTPUT', "unshift integer" );
-.sub test :main
-    .local pmc ar
-    ar = new ['ResizableIntegerArray']
-    unshift ar, 10
-    unshift ar, 20
-    $I0 = elements ar
-    print $I0
-    print ' '
-    $I0 = ar[0]
-    print $I0
-    print ' '
-    $I0 = ar[1]
-    say $I0
-.end
-CODE
-2 20 10
-OUTPUT
+    pop_eh
+    ok( $I0, 'Getting with too-big index should not throw an exception' )
+    is( $I1, 0, '... and result should be 0' )
 
-pir_output_is( <<'CODE', <<'OUTPUT', "get_iter" );
-.sub 'main' :main
+    $I0 = $P0
+    is( $I0, 1, '... and should not extend array' )
+.end
+
+.sub test_conversion
+    $P0 = new ['ResizableIntegerArray']
+    $P0 = 6
+    $P0[0] = -7
+    $P0[1] = 3.7
+    $P0[2] = '17'
+    $P1 = new ['Integer']
+    $P1 = 123456
+    $P0[3] = $P1
+    $P2 = new ['Float']
+    $P2 = 7.3
+    $P0[4] = $P2
+    $P3 = new ['String']
+    $P3 = '987654321'
+    $P0[5] = $P3
+    $I0 = $P0[0]
+    is( $I0, -7, 'Setting element to integer' )
+    $N0 = $P0[1]
+    is( $N0, 3.0, 'Setting element to float (gets truncated)' )
+    $S0 = $P0[2]
+    is( $S0, '17', 'Setting element to string (gets converted to int and back)' )
+    $I0 = $P0[3]
+    is( $I0, 123456, 'Setting element to boxed integer' )
+    $N0 = $P0[4]
+    is( $N0, 7.0, 'Setting element to boxed float (gets truncated)' )
+    $S0 = $P0[5]
+    is( $S0, '987654321', 'Setting element to boxed string (gets converted to int and back)' )
+.end
+
+.sub test_conversion_overflow
+    $P0 = new ['ResizableIntegerArray']
+    $P0 = 1
+
+    $S0 = '12345678901234567890123456789012345678901234567890123456789012345678901234567890'
+
+    push_eh eh0
+    $I1 = 1
+        $P0[0] = $S0
+        $I0 = $P0[0]
+    $I1 = 0
+eh0:
+    pop_eh
+    ok( $I1, 'Throw exception when setting element to too-large digit-string' )
+
+.end
+
+.sub test_set_pmc_index
     $P0 = new ['ResizableIntegerArray']
+    $P1 = new ['Key']
+    $P1 = 0
+    $P0[$P1] = 25
+    $P1 = 1
+    $P0[$P1] = 2.5
+    $P1 = 2
+    $P0[$P1] = '17'
+
+    $I1 = 0
+
+    $I0 = $P0[0]
+    ne $I0, 25, X1
+    inc $I1
+
+    $N0 = $P0[1]
+    ne $N0, 2.0, X1
+    inc $I1
+
+    $S0 = $P0[2]
+    ne $S0, '17', X1
+    inc $I1
+X1:
+    is( $I1, 3, 'Setting via PMC key (3 different types)' )
+.end
+
+.sub test_get_pmc_index
+    $P0 = new ['ResizableIntegerArray']
+    $P0 = 1
+    $P0[25] = 125
+    $P0[128] = 10.2
+    $P0[513] = '17'
+    $P0[1023] = 123456
+
+    $I1 = 0
+
+    $P2 = new ['Key']
+
+    $P2 = 25
+    $I0 = $P0[$P2]
+    ne $I0, 125, X1
+    inc $I1
+
+    $P2 = 128
+    $N0 = $P0[$P2]
+    ne $N0, 10.0, X1
+    inc $I1
+
+    $P2 = 513
+    $S0 = $P0[$P2]
+    ne $S0, '17', X1
+    inc $I1
+
+    $P2 = 1023
+    $I2 = $P0[$P2]
+    ne $I2, 123456, X1
+    inc $I1
+X1:
+    is( $I1, 4, 'Getting via PMC key (4 different types)' )
+.end
+
+.sub test_push
+    $P0 = new ['ResizableIntegerArray']
+    $P0[9999] = 0
+    push $P0, 12345
+    $I0 = $P0
+    is( $I0, 10001, 'Push increases number of elements by one' )
+    $I0 = $P0[10000]
+    is( $I0, 12345, '... and stores correct value' )
+.end
+
+.sub test_pop
+    $P0 = new ['ResizableIntegerArray']
+    $P0[0] = 4
+    $P0[1] = 8
+    $P0[2] = 16
+    $I0 = $P0
+    $I0 = pop $P0
+    is( $I0, 16, 'Pop retrieves correct value' )
+    $I0 = $P0
+    is( $I0, 2, '... and reduces number of elements by one' )
+.end
+
+.sub test_pop_many
+    $P0 = new ['ResizableIntegerArray']
+    $I0 = 0
+l1:
+    $P0[$I0] = $I0
+    inc $I0
+    lt $I0, 100000, l1
+l2:
+    le $I0, 0, e2
+    dec $I0
+    $I1 = pop $P0
+    eq $I0, $I1, l2
+e2:
+    is( $I0, $I1, 'Pop many times retrieves correct values' )
+    $I0 = $P0
+    is( $I0, 0, '... and leaves array empty' )
+.end
+
+.sub test_push_many
+    $P0 = new ['ResizableIntegerArray']
+    $I0 = 0
+l1:
+    push $P0, $I0
+    inc $I0
+    lt $I0, 100000, l1
+    $I1 = $P0
+    is( $I1, 100000, 'Push many values fills array to correct size' )
+l2:
+    le $I0, 0, e2
+    dec $I0
+    $I1 = $P0[$I0]
+    eq $I0, $I1, l2
+e2:
+    is( $I0, $I1, '... and stores correct values')
+.end
+
+.sub test_push_pop
+    $P0 = new ['ResizableIntegerArray']
+    $I1 = 0
+
+    push $P0, 2
+    $I0 = $P0
+    ne $I0, 1, X1
+    inc $I1
+
+    push $P0, 4
+    $I0 = $P0
+    ne $I0, 2, X1
+    inc $I1
+
+    push $P0, 6
+    $I0 = $P0
+    ne $I0, 3, X1
+    inc $I1
+
+    $I0 = pop $P0
+    ne $I0, 6, X1
+    inc $I1
+
+    $I0 = $P0
+    ne $I0, 2, X1
+    inc $I1
+
+    $I0 = pop $P0
+    ne $I0, 4, X1
+    inc $I1
+
+    $I0 = $P0
+    ne $I0, 1, X1
+    inc $I1
+
+    $I0 = pop $P0
+    ne $I0, 2, X1
+    inc $I1
+
+    $I0 = $P0
+    ne $I0, 0, X1
+    inc $I1
+
+X1:
+    is( $I1, 9, 'Push-then-Pop retrieves values in reverse order' )
+.end
+
+.sub test_cant_pop_empty
+    $P0 = new ['ResizableIntegerArray']
+    $I0 = 1
+    push_eh eh
+    $I0 = pop $P0
+    $I0 = 0
+eh:
+    pop_eh
+    ok( $I0, 'Pop from empty array should throw an exception' )
+.end
+
+# .sub test_cant_pop_empty
+# #   test_pass( 'pop from empty array should throw exception' )
+#     throws_like( <<'CODE', 'Can\'t pop from an empty array!', 'pop from empty array should throw exception' )
+# .sub main
+#     $P0 = new ['ResizableIntegerArray']
+#     $I0 = pop $P0
+# .end
+# CODE
+# #   test_test( 'pop from empty array should throw exception' )
+# .end
+
+.sub test_shift
+    $P0 = new ['ResizableIntegerArray']
+    $P0[0] = 10
+    $P0[1] = 20
+
+    $I1 = 0
+
+    $I0 = $P0
+    ne $I0, 2, X1
+    inc $I1
+
+    $I0 = shift $P0
+    ne $I0, 10, X1
+    inc $I1
+
+    $I0 = $P0
+    ne $I0, 1, X1
+    inc $I1
+
+    $I0 = shift $P0
+    ne $I0, 20, X1
+    inc $I1
+
+X1:
+    is( $I1, 4, 'Shift returns values in correct order' )
+
+    $I0 = $P0
+    is( $I0, 0, '... and removes correct number of elements' )
+.end
+
+.sub test_unshift
+    $P0 = new ['ResizableIntegerArray']
+    unshift $P0, 10
+    unshift $P0, 20
+
+    $I0 = $P0
+    is( $I0, 2, 'Unshift adds correct number of elements' )
+
+    $I1 = 0
+
+    $I0 = $P0[0]
+    ne $I0, 20, X1
+    inc $I1
+    $I0 = $P0[1]
+    ne $I0, 10, X1
+    inc $I1
+
+X1:
+    is( $I1, 2, '... and stores values in correct order' )
+.end
+
+.sub test_iterator
+    $P0 = new ['ResizableIntegerArray']
+    push_eh k0
     $P0[0] = 42
     $P0[1] = 43
     $P0[2] = 44
     push $P0, 999
+    $I0 = 0
     $P1 = iter $P0
-loop:
-    unless $P1 goto loop_end
-    $S2 = shift $P1
-    say $S2
-    goto loop
-loop_end:
-.end
-CODE
-42
-43
-44
-999
-OUTPUT
-
+    $I2 = shift $P1
+    inc $I0
+    eq $I2, 42, k3
+    dec $I0
+    say 'Missing 42'
+k3:
+    $I2 = shift $P1
+    inc $I0
+    eq $I2, 43, k2
+    dec $I0
+    say 'Missing 43'
+k2:
+    $I2 = shift $P1
+    inc $I0
+    eq $I2, 44, k1
+    dec $I0
+    say 'Missing 44'
+k1:
+    $I2 = shift $P1
+    inc $I0
+    eq $I2, 999, k0
+    dec $I0
+    say 'Missing 999'
+k0:
+    pop_eh
+    is( $I0, 4, 'get_iter: iterator returns all values in correct sequence' )
+.end
 
 # Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
+#   mode: pir
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/orderedhash_revamp/t/pmc/resizablepmcarray.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/resizablepmcarray.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/resizablepmcarray.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -21,7 +21,7 @@
     .include 'fp_equality.pasm'
     .include 'test_more.pir'
 
-    plan(121)
+    plan(128)
 
     resize_tests()
     negative_array_size()
@@ -30,6 +30,7 @@
     set_keyed_get_keyed_tests()
     interface_check()
     inherited_sort_method()
+    sort_subclass()
     push_pmc()
     push_int()
     push_string()
@@ -48,6 +49,8 @@
     method_forms_of_unshift_etc()
     sort_with_broken_cmp()
     addr_tests()
+    equality_tests()
+    sort_tailcall()
 .end
 
 
@@ -328,6 +331,35 @@
 .end
 
 
+.sub sort_subclass
+    .local pmc subrpa, arr
+    subrpa = subclass ['ResizablePMCArray'], 'ssRPA'
+    arr = new subrpa
+    arr[0] = 'p'
+    arr[1] = 'a'
+    arr[2] = 'z'
+    # Use a comparator that gives a reverse alphabetical order
+    # to make sure sort is using it, and not some default from
+    # elsewhere.
+    .local pmc comparator
+    comparator = get_global 'compare_reverse'
+    arr.'sort'(comparator)
+    .local string s, aux
+    s = typeof arr
+    concat s, ':'
+    aux = join '-', arr
+    concat s, aux
+    is(s, 'ssRPA:z-p-a', "sort works in a pir subclass, TT #218")
+.end
+
+.sub compare_reverse
+    .param string a
+    .param string b
+    $I0 = cmp_str b, a
+    .return($I0)
+.end
+
+
 .sub push_pmc
     .local pmc pmc_arr, pmc_9999, pmc_10000
     pmc_arr = new ['ResizablePMCArray']
@@ -703,7 +735,7 @@
 .sub get_array_string
     .param pmc p
     $S0 = ''
-    $P3 = new ['Iterator'], p
+    $P3 = iter p
 loop:
     unless $P3 goto loop_end
     $P4 = shift $P3
@@ -831,9 +863,8 @@
 .end
 
 
-#RT #40958 - can't iterate subclass of ResizablePMCArray
 .sub iterate_subclass_of_rpa
-    .local pmc arr, iter
+    .local pmc arr, it
     $P0 = subclass 'ResizablePMCArray', 'MyArray'
 
     arr = new ['MyArray']
@@ -844,10 +875,10 @@
     is($I0, 3, "RPA subclass has correct element count")
 
     $S1 = ''
-    iter = new ['Iterator'], arr
+    it = iter arr
 loop:
-    unless iter goto end
-    $P2 = shift iter
+    unless it goto end
+    $P2 = shift it
     $S0 = $P2
     concat $S1, $S0
     concat $S1, ","
@@ -870,7 +901,6 @@
 .end
 
 
-#RT #56636 - segfault from sort if comparison is always 1
 .sub sort_with_broken_cmp
     .local pmc array
     array = new ['ResizablePMCArray']
@@ -912,7 +942,84 @@
     is($I0, $I1, 'Adding element to RPA keeps same addr')
 .end
 
+.sub 'equality_tests'
+    .local pmc array1, array2, array3, array4
+    array1 = new ['ResizablePMCArray']
+    array2 = new ['ResizablePMCArray']
+    array3 = new ['ResizablePMCArray']
+
+    array1[0] = "Hello Parrot!"
+    array1[1] = 1664
+    array1[2] = 2.718
+
+    $P0 = box "Hello Parrot!"
+    array2[0] = $P0
+    $P0 = box 1664
+    array2[1] = $P0
+    $P0 = box 2.718
+    array2[2] = $P0
+
+    array3[0] = "Goodbye Parrot!"
+    array3[1] = 1664
+    array3[2] = 2.718
+
+    array4 = clone array1
+
+    is(array1, array2, 'Physically disjoint, but equal arrays')
+    is(array1, array4, 'Clones are equal')
+    isnt(array1, array3, 'Different arrays')
+.end
+
+.sub sort_tailcall
+    .local pmc array
+    array = new 'ResizablePMCArray'
+    push array, 4
+    push array, 5
+    push array, 3
+    push array, 2
+    push array, 5
+    push array, 1
+   
+    .local string unsorted 
+    unsorted = join ' ', array
+    is(unsorted,"4 5 3 2 5 1", "unsorted array")
+
+    ## sort using a non-tailcall function 
+    .const 'Sub' cmp_normal = 'cmp_normal_tailcall'
+    $P1 = clone array
+    $P1.'sort'(cmp_normal)
+    .local string sorted1
+    sorted1 = join ' ', $P1
+    is (sorted1, "1 2 3 4 5 5", "sorted array, no tailcall")
+
+    ## sort using a tailcall function
+    .const 'Sub' cmp_tailcall = 'cmp_tailcall_tailcall'
+    $P1 = clone array
+    $P1.'sort'(cmp_tailcall)
+    .local string sorted2
+    sorted2 = join ' ', $P1
+    is(sorted2, "1 2 3 4 5 5", "sorted array, with tailcall")
+.end
 
+.sub 'cmp_func_tailcall'
+    .param pmc a
+    .param pmc b
+    $I0 = cmp a, b
+    .return ($I0)
+.end
+
+.sub 'cmp_normal_tailcall'
+    .param pmc a
+    .param pmc b
+    $P0 = 'cmp_func_tailcall'(a, b)
+    .return ($P0)
+.end
+
+.sub 'cmp_tailcall_tailcall'
+    .param pmc a
+    .param pmc b
+    .tailcall 'cmp_func_tailcall'(a, b)
+.end
 # don't forget to change the test plan
 
 # Local Variables:

Modified: branches/orderedhash_revamp/t/pmc/resizablestringarray.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/resizablestringarray.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/resizablestringarray.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -23,7 +23,7 @@
     .include 'test_more.pir'
 
     # set a test plan
-    plan(259)
+    plan(261)
 
     'size/resize'()
     'clone'()
@@ -38,6 +38,8 @@
     'get_integer_keyed'()
     'get_number_keyed'()
 
+    'delete_keyed'()
+
     'push_pmc'()
     'push_string'()
     'push_integer'()
@@ -664,12 +666,33 @@
 .end
 
 #
+# test delete_keyed
+#
+.sub 'delete_keyed'
+    .local pmc array
+    array = new ['ResizableStringArray']
+    array[0] = "one"
+    array[1] = "two"
+    array[2] = "three"
+    $P0 = new ['Integer']
+    $P0 = 1
+    delete array[$P0]
+    $I0 = elements array
+    $S0 = array[1]
+    is($I0, 2,       "delete_keyed - elements")
+    is($S0, "three", "delete_keyed - value")
+.end
+
+#
 # test pushing PMCs onto the array
 #
 .sub 'push_pmc'
     .local pmc array
     array = new ['ResizableStringArray']
 
+    .local pmc array
+    array = new ['ResizableStringArray']
+
     array = 0
     $P0 = new ['String']
     $P0 = "one"
@@ -1351,10 +1374,12 @@
     .local pmc exception
     .local string message
 bad_type:
+    pop_eh
     .get_results (exception)
     message = exception
 still_ok:
-    like(message, 'illegal\ type\ for\ splice', "splice with a different type")
+    message = substr message, 22, 23
+    is(message, 'illegal type for splice', "splice with a different type")
 .end
 
 #

Modified: branches/orderedhash_revamp/t/pmc/ro.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/ro.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/ro.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -225,7 +225,7 @@
 
 =pod
 
-RT #46821: should this work? 
+TT #1036: should this work? 
 
 .sub resizablepmcarray_recursive
     .local pmc foo

Modified: branches/orderedhash_revamp/t/pmc/string.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/string.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/string.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -20,7 +20,7 @@
 .sub main :main
     .include 'test_more.pir'
 
-    plan(165)
+    plan(171)
 
     set_or_get_strings()
     setting_integers()
@@ -71,7 +71,7 @@
     exception_to_int_2()
     exception_to_int_3()
     assign_null_string()
-
+    access_keyed()
     # END_OF_TESTS
 
 .end
@@ -131,21 +131,6 @@
         is( $I0, 0, 'string "foo" -> int' )
 .end
 
-# Macro to ease testing of floating point comparisons
-# borrowed from fp_eq in fp_equality.pasm
-.macro fp_eq_ok (  J, K, L )
-    set $N10, .J
-    set $N11, .K
-    sub $N12, $N11, $N10
-    abs $N12, $N12
-
-    set $I0, 0
-    gt  $N12, 0.000001, .$FPEQNOK
-    set $I0, 1
-.label $FPEQNOK:
-    ok( $I0, .L )
-.endm
-
 .sub setting_numbers
         .include 'fp_equality.pasm'
         new $P0, ['String']
@@ -1033,6 +1018,39 @@
     is( $I0, 0, 'assign null string, TT #729' )
 .end
 
+.sub access_keyed
+    .local pmc s
+    s = new ['String']
+    s = "BAR" # Second character is zero, not 'o'
+
+    # Get
+    $S0 = s[0]
+    is($S0, 'B', 'Get string by index')
+    
+    $I0 = s[1]
+    $I1 = ord 'A'
+    is($I0, $I1, 'Get integer by index')
+    
+    $P0 = s[2]
+    is($P0, 'R', 'Get PMC by index')
+
+    # Set
+    s = new ['String']
+
+    $S0 = 'f'
+    s[0] = $S0
+    is(s, 'f', 'Set string keyed')
+
+    $I0 = ord 'o'
+    s[1] = $I0
+    is(s, 'fo', 'Set integer keyed')
+
+    $P0 = new ['String']
+    $P0 = 'o'
+    s[2] = $P0
+    is(s, 'foo', 'Set PMC keyed')
+.end
+
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4

Modified: branches/orderedhash_revamp/t/pmc/stringhandle.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/stringhandle.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/stringhandle.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -69,14 +69,12 @@
 ok 7 - $P7.open($S1, $S2) # new file, write mode succeeds
 OUT
 
-# RT #46827 test open file, close file, delete file, reopen previously opened stream
-
 SKIP: {
     skip 'no asynch calls yet' => 1;
 
     pir_output_is( <<'CODE', <<'OUT', 'open and close - asynchronous' );
 .sub 'test' :main
-    $P1 = # RT #46831 create a callback here
+    $P1 = # TT #1204 create a callback here
     $P0 = new ['StringHandle']
 
     $P0.'open'('README')
@@ -302,11 +300,9 @@
 OUT
 
 
-# RT #46833 test reading/writing code points once supported
-
-# RT #46835 test reading long chunks, eof, and across newlines
+# TT #1204 test reading long chunks, eof, and across newlines
 
-# RT #46837 pir_output_is( <<'CODE', <<'OUT', 'print, read, and readline - asynchronous', todo => 'not yet implemented' );
+# TT #1204 pir_output_is( <<'CODE', <<'OUT', 'print, read, and readline - asynchronous', todo => 'not yet implemented' );
 
 # L<PDD22/I\/O PMC API/=item record_separator>
 pir_output_is( <<'CODE', <<'OUT', 'record_separator', todo => 'not yet implemented' );
@@ -377,9 +373,9 @@
 ok 3 - $S0 = $P1.buffer_type() # full-buffered
 OUT
 
-# RT #46839 test effects of buffer_type, not just set/get
+# TT #1204 test effects of buffer_type, not just set/get
 
-# RT #46841
+# TT #1177
 # L<PDD22/I\/O PMC API/=item buffer_size>
 # NOTES: try setting positive, zero, negative int
 # perform print and read ops
@@ -593,7 +589,7 @@
 ok
 OUTPUT
 
-# RT #46843
+# TT #1178
 # L<PDD22/I\/O PMC API/=item get_fd>
 # NOTES: this is going to be platform dependent
 

Modified: branches/orderedhash_revamp/t/pmc/stringiterator.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/stringiterator.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/stringiterator.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -8,7 +8,7 @@
 
 =head1 SYNOPSIS
 
-    % prove t/pmc/string.t
+    % prove t/pmc/stringiterator.t
 
 =head1 DESCRIPTION
 

Modified: branches/orderedhash_revamp/t/pmc/sub.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/sub.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/sub.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 #! perl
-# Copyright (C) 2001-2008, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
 use strict;
@@ -648,7 +648,7 @@
   .param int op2
 .end
 CODE
-/too few arguments passed \(1\) - 2 params expected/
+/too few positional arguments: 1 passed, 2 \(or more\) expected/
 OUTPUT
 
 pir_error_output_like( <<'CODE', <<'OUTPUT', "explicit :main with wrong # args." );
@@ -657,7 +657,7 @@
   .param int op2
 .end
 CODE
-/too few arguments passed \(1\) - 2 params expected/
+/too few positional arguments: 1 passed, 2 \(or more\) expected/
 OUTPUT
 
 ($TEMP, $temp_pasm) = create_tempfile(UNLINK => 1);
@@ -688,7 +688,7 @@
 .end
 
 # :load or other pragmas are only evaluated on the first
-# instruction of a compilation unit
+# instruction of a subroutine
 .sub _sub1 :load
   say "in sub1"
   returncc
@@ -835,7 +835,10 @@
 main
 OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', "caller introspection via interp" );
+my @todo = ( todo => 'broken with JIT (TT #983)' )
+    if ( defined $ENV{TEST_PROG_ARGS} and
+        $ENV{TEST_PROG_ARGS} =~ /--runcore=jit/ );
+pir_output_is( <<'CODE', <<'OUTPUT', "caller introspection via interp", @todo );
 .sub main :main
 .include "interpinfo.pasm"
     # this test will fail when run with -Oc
@@ -1130,19 +1133,19 @@
 
 pir_output_is( <<'CODE', <<'OUTPUT', ':postcomp' );
 .sub main :main
-    say "main"
+    say 'main'
 .end
 .sub pc :postcomp
-    print "pc\n"
+    say 'pc'
 .end
 .sub im :immediate
-    print "im\n"
+    say 'im'
 .end
 .sub pc2 :postcomp
-    print "pc2\n"
+    say 'pc2'
 .end
 .sub im2 :immediate
-    print "im2\n"
+    say 'im2'
 .end
 CODE
 im
@@ -1224,38 +1227,6 @@
 ok
 OUTPUT
 
-pir_output_is( <<'CODE', <<'OUTPUT', 'load_bytecode with .pir (RT #39807)' );
-.sub main :main
-    load_bytecode 'PGE.pbc'
-    load_bytecode 'dumper.pir'
-    load_bytecode 'PGE/Dumper.pir'
-
-    $P0 = compreg 'PGE::P5Regex'
-    $P1 = $P0('aabb*')
-    $P2 = $P1('fooaabbbar')
-
-    _dumper($P2)
-.end
-CODE
-"VAR1" => PMC 'PGE;Match' => "aabbb" @ 3
-OUTPUT
-
-pir_output_is( <<'CODE', <<'OUTPUT', 'load_bytecode with .pbc (RT #39807)' );
-.sub main :main
-    load_bytecode 'PGE.pbc'
-    load_bytecode 'dumper.pbc'
-    load_bytecode 'PGE/Dumper.pbc'
-
-    $P0 = compreg 'PGE::P5Regex'
-    $P1 = $P0('aabb*')
-    $P2 = $P1('fooaabbbar')
-
-    _dumper($P2)
-.end
-CODE
-"VAR1" => PMC 'PGE;Match' => "aabbb" @ 3
-OUTPUT
-
 pir_error_output_like( <<'CODE', qr/Null PMC access in invoke()/, 'invoking null pmc' );
 .sub main :main
     null $P0
@@ -1467,8 +1438,8 @@
 OUTPUT
 
 $ENV{TEST_PROG_ARGS} ||= '';
-my @todo = $ENV{TEST_PROG_ARGS} =~ /--run-pbc/
-    ? ( todo => 'lexicals not thawed properly from PBC, RT #60652' )
+ at todo = $ENV{TEST_PROG_ARGS} =~ /--run-pbc/
+    ? ( todo => 'lexicals not thawed properly from PBC, TT #1171' )
     : ();
 pir_output_is( <<'CODE', <<'OUTPUT', ':outer with identical sub names', @todo );
 .sub 'main' :main
@@ -1621,6 +1592,141 @@
 bazsubid
 OUTPUT
 
+pir_output_is( <<'CODE', <<'OUTPUT', 'Thaw PIR subclass', todo => 'See TT #132' );
+.sub main :main
+
+  $P0 = get_class 'Sub'
+  $P1 = subclass $P0, 'myProc'
+
+  .local pmc pirC
+  pirC = compreg 'PIR'
+
+  .local string code
+  code = <<"END_CODE"
+
+.sub bar
+  say "hi"
+.end
+END_CODE
+
+  .local pmc compiled
+  compiled = pirC(code)
+  compiled = compiled[0] # just want the first executable sub here.
+
+  compiled() # works
+
+  .local pmc sub
+  sub = new 'myProc'
+  assign sub, compiled
+  sub() # works
+
+  $S0 = freeze sub
+  say "frozen"
+  $P2 = thaw $S0
+  say "thawed"
+  $P2()
+.end
+CODE
+hi
+hi
+frozen
+thawed
+hi
+OUTPUT
+
+pir_output_is( <<'CODE', <<'OUTPUT', 'init_pmc' );
+.sub 'main'
+    .local pmc init, s, regs, arg_info
+    
+    init = new ['Hash']
+    init['start_offs']  = 42
+    init['end_offs']    = 115200
+    
+    regs = new ['FixedIntegerArray']
+    regs = 4
+    regs[0] = 1
+    regs[1] = 2
+    regs[2] = 6
+    regs[3] = 24
+    init['n_regs_used'] = regs
+
+    arg_info = new ['Hash']
+    arg_info['pos_required']    = 1
+    arg_info['pos_optional']    = 1
+    arg_info['pos_slurpy']      = 2
+    arg_info['named_required']  = 3
+    arg_info['named_optional']  = 5
+    arg_info['named_slurpy']    = 8
+    init['arg_info'] = arg_info
+
+    s = new ['Sub'], init
+
+    $I0 = s.'start_offs'()
+    print 'start_offs '
+    say $I0
+
+    print 'end_offs '
+    $I0 = s.'end_offs'()
+    say $I0
+
+    # Check n_regs_used
+    $I0 = s.'__get_regs_used'('I')
+    print 'I regs '
+    say $I0
+
+    $I0 = s.'__get_regs_used'('N')
+    print 'N regs '
+    say $I0
+
+    $I0 = s.'__get_regs_used'('S')
+    print 'S regs '
+    say $I0
+
+    $I0 = s.'__get_regs_used'('P')
+    print 'P regs '
+    say $I0
+
+    # Check arg_info
+    $P0 = inspect s, 'pos_required'
+    print 'pos_required '
+    say $P0
+
+    $P0 = inspect s, 'pos_optional'
+    print 'pos_optional '
+    say $P0
+    
+    $P0 = inspect s, 'pos_slurpy'
+    print 'pos_slurpy '
+    say $P0
+
+    $P0 = inspect s, 'named_required'
+    print 'named_required '
+    say $P0
+
+    $P0 = inspect s, 'named_optional'
+    print 'named_optional '
+    say $P0
+
+    $P0 = inspect s, 'named_slurpy'
+    print 'named_slurpy '
+    say $P0
+
+    # We need more tests for other fields. And more accessors obviously.
+.end
+CODE
+start_offs 42
+end_offs 115200
+I regs 1
+N regs 2
+S regs 6
+P regs 24
+pos_required 1
+pos_optional 1
+pos_slurpy 2
+named_required 3
+named_optional 5
+named_slurpy 8
+OUTPUT
 
 # Local Variables:
 #   mode: cperl

Modified: branches/orderedhash_revamp/t/pmc/threads.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/threads.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/threads.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 #! perl
-# Copyright (C) 2001-2008, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
 use strict;
@@ -57,7 +57,7 @@
 ok 2
 OUTPUT
 
-# RT #46807 rework tests since we don't really have thread types?
+# TT #1249:  rework tests since we don't really have thread types?
 
 SKIP: {
     skip 'busted on win32' => 2 if $^O eq 'MSWin32';
@@ -168,8 +168,9 @@
     .param pmc passed
     inc $I5
     $S5 = " thread\n"
-    passed = 'hello from'
-    print passed
+    .local pmc salutation
+    salutation = box 'hello from'
+    print salutation
     # print I5 # not done because register initialization is not guaranteed
     print $S5
     $P0 = getinterp
@@ -289,7 +290,7 @@
     .local pmc thread_main
     thread_main = get_global 'thread_main'
     $P0.'run_clone'(thread_main)
-    $P0.'join'() # RT #46813
+    $P0.'join'()
 .end
 
 .sub thread_main
@@ -448,7 +449,7 @@
 OUTPUT
 
 TODO: {
-    local $TODO = "vtable overrides aren't properly cloned RT # 46511";
+    local $TODO = "vtable overrides aren't properly cloned TT # 1248";
 
     pir_output_is( <<'CODE', <<'OUTPUT', "CLONE_CODE | CLONE_CLASSES; superclass not built-in" );
 .namespace [ 'Foo' ]
@@ -508,7 +509,7 @@
     .local pmc thread
     thread = new ['ParrotThread']
     .local pmc _thread_func
-    _thread_func = get_global ['main'], 'thread_test_func'
+    _thread_func = get_hll_global ['main'], 'thread_test_func'
     $I0 = .PARROT_CLONE_CODE
     bor $I0, $I0, .PARROT_CLONE_CLASSES
     print "in thread:\n"
@@ -535,7 +536,7 @@
 OUTPUT
 }
 
-pir_output_is( <<'CODE', <<'OUTPUT', "CLONE_CODE | CLONE_CLASSES; superclass built-in" );
+pir_output_is( <<'CODE', <<'OUTPUT', "CLONE_CODE | CLONE_CLASSES; superclass built-in", todo => 'likely incorrect test TT 1248');
 .namespace [ 'Foo' ]
 
 .sub foometh :method
@@ -679,38 +680,38 @@
 ok 2
 OUTPUT
 
-my @todo;
-
-if ( $ENV{TEST_PROG_ARGS} ) {
-    push @todo, ( todo => 'Broken with CGP' ) if $ENV{TEST_PROG_ARGS} =~ /--runcore=cgp/;
-    push @todo, ( todo => 'Broken with JIT' ) if $ENV{TEST_PROG_ARGS} =~ /--runcore=jit/;
-    push @todo, ( todo => 'Broken with switch core' )  if $ENV{TEST_PROG_ARGS} =~ /--runcore=switch/;
-}
-pir_output_unlike( <<'CODE', qr/not/, "globals + constant table subs issue", @todo );
+# Direct constant access to sub objects commented out, see TT #1120.
+pir_output_unlike( <<'CODE', qr/not/, "globals + constant table subs issue");
 .namespace [ 'Foo' ]
 
 .include 'interpinfo.pasm'
 .sub 'is'
-    .param pmc what
-    .param pmc expect
+    .param pmc    what
+    .param pmc    expect
+    .param string desc      :optional
+    .param int    have_desc :opt_flag
+
+    unless have_desc goto diagnose
+    desc = ' - ' . desc
+
+  diagnose:
     .local pmc number
     number = get_global 'test_num'
     if what == expect goto okay
     print "# got:      "
-    print what
-    print "\n"
+    say what
     print "# expected: "
-    print expect
-    print "\nnot ok "
+    say expect
+    print "not ok "
     print number
-    print "\n"
+    say desc
+    inc number
     $P0 = interpinfo .INTERPINFO_CURRENT_CONT
 loop:
     $I0 = defined $P0
     if $I0 == 0 goto done
     print "    "
-    print $P0
-    print "\n"
+    say $P0
     $P0 = $P0.'continuation'()
     branch loop
 done:
@@ -719,7 +720,7 @@
     print "ok "
     print number
     inc number
-    print "\n"
+    say desc
 .end
 
 .sub setup
@@ -729,9 +730,10 @@
 .end
 
 .sub _check_sanity
+    .param string desc
     $P0 = get_global 'foo'
     $P1 = get_hll_global [ 'Foo' ], 'foo'
-    is($P0, $P1)
+    is($P0, $P1, desc)
 .end
 
 .sub mutate
@@ -741,11 +743,11 @@
 .end
 
 .sub check_sanity
-    _check_sanity()
+#    _check_sanity( 'direct call' )
     $P0 = get_global '_check_sanity'
-    $P0()
+    $P0( 'call from get_global' )
     $P0 = get_hll_global [ 'Foo' ], '_check_sanity'
-    $P0()
+    $P0( 'call from get_hll_global' )
 .end
 
 .sub _check_value
@@ -756,7 +758,7 @@
 
 .sub check_value
     .param int value
-    _check_value(value)
+#    _check_value(value)
     $P0 = get_global '_check_value'
     $P0(value)
     $P0 = get_hll_global [ 'Foo' ], '_check_value'
@@ -764,10 +766,19 @@
 .end
 
 .sub full_check
-    .const 'Sub' c_setup = 'setup'
-    .const 'Sub' c_sanity = 'check_sanity'
-    .const 'Sub' c_mutate = 'mutate'
-    .const 'Sub' c_value = 'check_value'
+#    .const 'Sub' c_setup = 'setup'
+#    .const 'Sub' c_sanity = 'check_sanity'
+#    .const 'Sub' c_mutate = 'mutate'
+#    .const 'Sub' c_value = 'check_value'
+
+    .local pmc c_setup
+    c_setup = get_global  'setup'
+    .local pmc c_sanity
+    c_sanity = get_global 'check_sanity'
+    .local pmc c_mutate
+    c_mutate = get_global 'mutate'
+    .local pmc c_value
+    c_value = get_global  'check_value'
 
     .local pmc g_setup
     g_setup = get_hll_global [ 'Foo' ], 'setup'
@@ -818,25 +829,25 @@
 CODE
 
 pir_output_is(
-    <<'CODE', <<'OUTPUT', "CLONE_CODE|CLONE_GLOBALS|CLONE_HLL|CLONE_LIBRARIES", todo => 'RT #41373' );
+    <<'CODE', <<'OUTPUT', 'CLONE_CODE|CLONE_GLOBALS|CLONE_HLL|CLONE_LIBRARIES - TT # 1250' );
 .HLL 'Perl'
-.loadlib 'perl_group'
 
 .include 'interpinfo.pasm'
 
+.loadlib 'foo_group'
 .loadlib 'myops_ops'
 
 .sub test
     .param pmc passed_value
     .local pmc the_value
-    the_value = new ['PerlInt']
+    the_value = new ['Integer']
     the_value = 42
-    store_global 'Foo', 'x', the_value
-    $I0 = typeof passed_value
-    $I1 = typeof the_value
-    $I0 = $I0 - $I1
-    print $I0
-    print "\n"
+    set_hll_global ['Foo'], 'x', the_value
+    $S0 = typeof passed_value
+    $S1 = typeof the_value
+    $I0 = iseq $S0, $S1
+    say $I0
+
     .local pmc ns
     ns = get_namespace ['Foo']
     $P0 = interpinfo .INTERPINFO_CURRENT_SUB
@@ -846,11 +857,10 @@
     if $P0 == the_value goto okay
     print "not "
 okay:
-    print "ok (equal)\n"
+    say "ok (equal)"
 
-    $I0 = fortytwo
-    print $I0
-    print "\n"
+    $I0 = the_value
+    say $I0
 .end
 
 .include 'cloneflags.pasm'
@@ -865,15 +875,15 @@
     bor flags, flags, .PARROT_CLONE_LIBRARIES
 
     .local pmc passed
-    passed = new ['PerlInt']
+    passed = new ['Foo']
     passed = 15
 
     .local pmc thread_func
     thread_func = get_global 'test'
-    print "in thread:\n"
+    say "in thread:"
     thread.'run'(flags, thread_func, passed)
     thread.'join'()
-    print "in main:\n"
+    say "in main:"
     thread_func(passed)
 .end
 CODE

Modified: branches/orderedhash_revamp/t/pmc/timer.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/timer.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/timer.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -142,7 +142,7 @@
 OUT
 
     my @todo = $ENV{TEST_PROG_ARGS} =~ /--runcore=jit/ ?
-       ( todo => 'RT #49718, add scheduler features to JIT' ) : ();
+       ( todo => 'TT #1316, add scheduler features to JIT' ) : ();
     pasm_output_is( <<'CODE', <<'OUT', "Timer setup - initializer/start/repeat" , @todo );
 .include "timer.pasm"
     new P1, ['FixedPMCArray']

Modified: branches/orderedhash_revamp/t/pmc/undef.t
==============================================================================
--- branches/orderedhash_revamp/t/pmc/undef.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/pmc/undef.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 #! parrot
-# Copyright (C) 2001-2008, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
 =head1 NAME
@@ -19,7 +19,7 @@
 .sub main :main
     .include 'test_more.pir'
 
-    plan(21)
+    plan(24)
 
     morph_to_string()
     undef_pmc_is_false()
@@ -49,9 +49,18 @@
     pmc1 = new ['Undef']
     if pmc1 goto PMC1_IS
       ok( 1, 'PMC Undef created by new is false' )
-      .return()
+      goto logical_not
     PMC1_IS:
     ok( 0, 'PMC Undef created by new is false' )
+
+  logical_not:
+    unless pmc1 goto logical_not_passed
+    ok( 0, 'logical_not of PMC Undef created by new is false' )
+    goto done
+  logical_not_passed:
+    ok( 1, 'logical_not of PMC Undef created by new is true' )
+
+  done:
 .end
 
 .sub undef_pmc_is_not_defined
@@ -161,27 +170,47 @@
     $P1 = new ['Undef']
     $P2 = new ['Undef']
     if $P1 == $P2 goto ok
-        ok( 0, 'Undef == Undef (RT #33603)' )
+        ok( 0, 'Undef == Undef' )
         .return()
   ok:
-    ok( 1, 'Undef == Undef (RT #33603)' )
+    ok( 1, 'Undef == Undef' )
 .end
 
 .sub set_undef_to_object
     $P0 = new "Undef"
+    $P1 = get_class 'Integer'
     $P2 = new 'Integer'
     assign $P0, $P2
-    ok( 1, 'Assign Integer to Undef' )
+    $I0 = isa $P0, $P1
+    ok( $I0, 'Assign Integer to Undef' )
 
     $P0 = new "Undef"
     $P1 = newclass "HI"
     $P2 = new $P1
     assign $P0, $P2
-    ok( 1, 'Assign Object to Undef' )
+    $I0 = isa $P0, $P1
+    ok( $I0, 'Assign Object to Undef' )
+
+    $S0 = $P0
+    is( $S0, 'A string', '... and the right object' )
+
+    $P0 = new "Undef"
+    $P1 = subclass 'ResizablePMCArray', 'FooRPA'
+    $P2 = new $P1
+    assign $P0, $P2
+    $I0 = isa $P0, $P1
+    ok( $I0, 'Assign Object with PMC parent to Undef' )
 
     # TODO: Needs tests to verify that the values and metadata are preserved
     #       across the assignment
 .end
+
+.namespace [ 'HI' ]
+
+.sub get_string :vtable :method
+    .return( 'A string' )
+.end
+
 # Local Variables:
 #   mode: pir
 #   fill-column: 100

Modified: branches/orderedhash_revamp/t/run/options.t
==============================================================================
--- branches/orderedhash_revamp/t/run/options.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/run/options.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -88,10 +88,10 @@
     is( qx{$cmd}, "second\n", "-r option <$cmd>" );
 
     $cmd = qq{"$PARROT" -D 8 -R slow "$second_pir_file" 2>&1};
-    like( qx{$cmd}, qr/Parrot VM: Slow core/, "-r option <$cmd>" );
+    like( qx{$cmd}, qr/Parrot VM: slow core/, "-r option <$cmd>" );
 }
 
-## RT#46815 test remaining options
+## TT #1150 test remaining options
 
 # clean up temporary files
 unlink $first_pir_file;

Modified: branches/orderedhash_revamp/t/src/extend.t
==============================================================================
--- branches/orderedhash_revamp/t/src/extend.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/src/extend.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 #!perl
-# Copyright (C) 2001-2008, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
 use strict;
@@ -12,7 +12,7 @@
 use Parrot::Test;
 use Parrot::Config;
 
-plan tests => 17;
+plan tests => 20;
 
 =head1 NAME
 
@@ -471,6 +471,133 @@
 back
 OUTPUT
 
+c_output_is( <<"CODE", <<'OUTPUT', 'call a parrot sub using the unified interface' );
+
+#include <parrot/parrot.h>
+#include <parrot/embed.h>
+#include <parrot/extend.h>
+
+static opcode_t *the_test(Parrot_Interp, opcode_t *, opcode_t *);
+
+int
+main(int argc, char *argv[])
+{
+    Parrot_Interp interp = Parrot_new(NULL);
+    if (!interp)
+        return 1;
+
+    Parrot_run_native(interp, the_test);
+
+    Parrot_exit(interp, 0);
+    return 0;
+}
+
+/* also both the test PASM and the_test() print to stderr
+ * so that buffering in PIO is not an issue */
+
+static opcode_t*
+the_test(PARROT_INTERP, opcode_t *cur_op, opcode_t *start)
+{
+    PackFile *pf = Parrot_pbc_read(interp, "$temp_pbc", 0);
+    STRING   *name = Parrot_str_new_constant(interp, "_sub1");
+    PMC      *sub, *arg;
+
+    Parrot_pbc_load(interp, pf);
+    sub = Parrot_find_global_cur(interp, name);
+    Parrot_ext_call(interp, sub, "->");
+    Parrot_eprintf(interp, "back\\n");
+
+    /* win32 seems to buffer stderr ? */
+    Parrot_io_flush(interp, Parrot_io_STDERR(interp));
+
+    name = Parrot_str_new_constant(interp, "_sub2");
+    sub  = Parrot_find_global_cur(interp, name);
+    arg  = pmc_new(interp, enum_class_String);
+
+    Parrot_PMC_set_string_native(interp, arg,
+                 Parrot_str_new(interp, "hello ", 0));
+
+    Parrot_ext_call(interp, sub, "P->", arg);
+    Parrot_eprintf(interp, "back\\n");
+
+    return NULL;
+}
+CODE
+in sub1
+back
+hello in sub2
+back
+OUTPUT
+
+($TEMP, my $temp_pir) = create_tempfile( SUFFIX => '.pir', UNLINK => 1 );
+
+print $TEMP <<'EOF';
+  .sub foo
+      .param pmc input
+      printerr input
+      printerr "in sub2\n"
+      $P0 = new "Integer"
+      $P0 = 42
+      .return($P0)
+  .end
+EOF
+close $TEMP;
+
+# compile to pbc
+(undef, $temp_pbc) = create_tempfile( SUFFIX => '.pbc', UNLINK => 1 );
+system(".$PConfig{slash}parrot$PConfig{exe}", '-o', $temp_pbc, $temp_pir);
+
+c_output_is( <<"CODE", <<'OUTPUT', 'call a parrot sub and return an integer' );
+
+#include <parrot/parrot.h>
+#include <parrot/embed.h>
+#include <parrot/extend.h>
+
+static opcode_t *the_test(Parrot_Interp, opcode_t *, opcode_t *);
+
+int
+main(int argc, char *argv[])
+{
+    Parrot_Interp interp = Parrot_new(NULL);
+    if (!interp)
+        return 1;
+
+    Parrot_run_native(interp, the_test);
+
+    Parrot_exit(interp, 0);
+    return 0;
+}
+
+/* also both the test PASM and the_test() print to stderr
+ * so that buffering in PIO is not an issue */
+
+static opcode_t*
+the_test(PARROT_INTERP, opcode_t *cur_op, opcode_t *start)
+{
+    PackFile *pf = Parrot_pbc_read(interp, "$temp_pbc", 0);
+    STRING   *name = Parrot_str_new_constant(interp, "foo");
+    PMC      *sub, *arg;
+    Parrot_Int result;
+
+    Parrot_pbc_load(interp, pf);
+    sub  = Parrot_find_global_cur(interp, name);
+    arg  = pmc_new(interp, enum_class_String);
+
+    Parrot_PMC_set_string_native(interp, arg,
+                 Parrot_str_new(interp, "hello ", 0));
+
+    Parrot_ext_call(interp, sub, "P->I", arg, &result);
+    Parrot_eprintf(interp, "result %d\\n", result);
+    Parrot_eprintf(interp, "back\\n");
+
+    return NULL;
+}
+CODE
+hello in sub2
+result 42
+back
+OUTPUT
+
 ($TEMP, $temp_pasm) = create_tempfile( SUFFIX => '.pasm', UNLINK => 1 );
 
 print $TEMP <<'EOF';
@@ -543,7 +670,7 @@
 back
 OUTPUT
 
-($TEMP, my $temp_pir) = create_tempfile( SUFFIX => '.pir', UNLINK => 1 );
+($TEMP, $temp_pir) = create_tempfile( SUFFIX => '.pir', UNLINK => 1 );
 
 print $TEMP <<'EOF';
 .sub main :main
@@ -637,15 +764,12 @@
     STRING         *code_type;
     STRING         *error;
     STRING         *foo_name;
-    Parrot_PackFile packfile;
 
     if (!interp) {
         printf( "Hiss\n" );
         return 1;
     }
 
-    packfile = PackFile_new_dummy(interp, "dummy");
-
     code_type = Parrot_str_new_constant( interp, "PIR" );
     retval    = Parrot_compile_string( interp, code_type, code, &error );
 
@@ -666,7 +790,39 @@
 Hello from foo!
 OUTPUT
 
-c_output_is( <<"CODE", <<'OUTPUT', 'call multi sub from C - #41511', todo => 'RT #41511' );
+c_output_is( <<"CODE", <<'OUTPUT', 'call multi sub from C - #41511' );
+#include <parrot/parrot.h>
+#include <parrot/embed.h>
+#include <parrot/extend.h>
+
+int
+main(int argc, char* argv[])
+{
+    Parrot_Int      result;
+    Parrot_PMC      sub;
+    Parrot_PackFile pf;
+    Parrot_Interp   interp = Parrot_new(NULL);
+
+    if (!interp) {
+        printf( "No interpreter\\n" );
+        return 1;
+    }
+
+    pf = Parrot_pbc_read( interp, "$temp_pbc", 0 );
+    Parrot_pbc_load( interp, pf );
+
+    sub      = Parrot_find_global_cur( interp, Parrot_str_new_constant( interp, "add" ) );
+    result   = Parrot_call_sub_ret_int( interp, sub, "III", 100, 200 );
+    printf( "Result is %d.\\n", result );
+
+    Parrot_exit(interp, 0);
+    return 0;
+}
+CODE
+Result is 300.
+OUTPUT
+
+c_output_is( <<"CODE", <<'OUTPUT', 'call multi sub from C - unified interface' );
 #include <parrot/parrot.h>
 #include <parrot/embed.h>
 #include <parrot/extend.h>
@@ -688,7 +844,7 @@
     Parrot_pbc_load( interp, pf );
 
     sub      = Parrot_find_global_cur( interp, Parrot_str_new_constant( interp, "add" ) );
-    result   = Parrot_call_sub( interp, sub, "III", 100, 200 );
+    Parrot_ext_call( interp, sub, "II->I", 100, 200, &result );
     printf( "Result is %d.\\n", result );
 
     Parrot_exit(interp, 0);
@@ -731,13 +887,15 @@
 
     for (i = 1; i <= niter; i++) {
         printf("Starting interp %d\n", i);
+        fflush(stdout);
         interp = Parrot_new(NULL);
-        Parrot_set_flag(interp, PARROT_DESTROY_FLAG);
-
         if (!interp)
             return 1;
 
+        Parrot_set_flag(interp, PARROT_DESTROY_FLAG);
+
         printf("Destroying interp %d\n", i);
+        fflush(stdout);
         interp_cleanup(interp, 0);
     }
 

Modified: branches/orderedhash_revamp/t/src/warnings.t
==============================================================================
--- branches/orderedhash_revamp/t/src/warnings.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/src/warnings.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -36,13 +36,11 @@
 int
 main(int argc, char* argv[])
 {
-    Interp *interp;
+    Parrot_Interp interp = Parrot_new(NULL);
     int error_val;
 
-    interp = Parrot_new(NULL);
-    if (!interp) {
+    if (!interp)
         return 1;
-    }
 
     print_pbc_location(interp);
 
@@ -61,13 +59,12 @@
 int
 main(int argc, char* argv[])
 {
-    Interp *interp;
+    Parrot_Interp interp = Parrot_new(NULL);
     int error_val;
 
-    interp = Parrot_new(NULL);
-    if (!interp) {
+    if (!interp)
         return 1;
-    }
+
     PARROT_WARNINGS_on(interp, PARROT_WARNINGS_ALL_FLAG);
 
     error_val = Parrot_warn(interp, PARROT_WARNINGS_ALL_FLAG, "all");

Modified: branches/orderedhash_revamp/t/steps/auto/alignptrs-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/alignptrs-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/alignptrs-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,15 +5,13 @@
 
 use strict;
 use warnings;
-use Test::More tests => 17;
+use Test::More tests => 12;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::auto::alignptrs');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 
@@ -27,12 +25,11 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $serialized = $conf->pcfreeze();
 
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
-
 my $pkg = q{auto::alignptrs};
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );

Modified: branches/orderedhash_revamp/t/steps/auto/alignptrs-02.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/alignptrs-02.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/alignptrs-02.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,15 +5,13 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  18;
+use Test::More tests =>  13;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::auto::alignptrs');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 
@@ -26,9 +24,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
-
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{auto::alignptrs};
 
@@ -39,10 +36,11 @@
 my $serialized = $conf->pcfreeze();
 
 {
-    $conf->data->set_p5( OSNAME => 'hpux' );
+    $conf->data->set( ptr_alignment => undef );
+    $conf->data->set( OSNAME_provisional => 'hpux' );
     my $ret = $step->runstep($conf);
     ok( $ret, "runstep() returned true value" );
-    if ( $conf->data->get_p5('ccflags') !~ /DD64/ ) {
+    if ( $conf->data->get('ccflags_provisional') !~ /DD64/ ) {
         is($conf->data->get('ptr_alignment'), 4,
             "Got expected pointer alignment for HP Unix");
         is($step->result(), qq{for hpux:  4 bytes},

Modified: branches/orderedhash_revamp/t/steps/auto/arch-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/arch-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/arch-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,16 +5,13 @@
 
 use strict;
 use warnings;
-use Test::More tests => 102;
+use Test::More tests =>  81;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::auto::arch');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw| capture |;
@@ -26,40 +23,16 @@
     mode => q{configure},
 } );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $serialized = $conf->pcfreeze();
 
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
-
 my $pkg = q{auto::arch};
 
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 my $step = test_step_constructor_and_description($conf);
-my $errstr;
-{
-    # As the t/configure/ test suite is currently (Dec 25 2007) constructed,
-    # an uninitialized value warning is generated when this test is run on
-    # Darwin because of a hack in config/auto/arch.pm.  We capture the warning
-    # and verify that we did so if on Darwin.  In the future, we will be able
-    # to eliminate this use of the signal handler because the
-    # Parrot::Configure object will have the same information available to it
-    # as it does during regular configuration.
-    local $SIG{__WARN__} = \&_capture;
-    my $ret = $step->runstep($conf);
-    ok( $ret, "runstep() returned true value" );
-    is($step->result(), q{}, "Result was empty string as expected");
-    if ($^O eq 'darwin') {
-        like(
-            $errstr,
-            qr/Uninitialized value/i,
-            "Caught uninitialized value warning as expected"
-        );
-    } else {
-        pass("Test not needed except on Darwin");
-    }
-}
 
 $conf->replenish($serialized);
 
@@ -69,7 +42,7 @@
     argv => [ q{--verbose} ],
     mode => q{configure},
 } );
-rerun_defaults_for_testing($conf, $args );
+
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 $step = test_step_constructor_and_description($conf);
@@ -95,14 +68,14 @@
     argv => [ ],
     mode => q{configure},
 } );
-rerun_defaults_for_testing($conf, $args );
+
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 $step = test_step_constructor_and_description($conf);
 my $pseudoarch = q{foobar};
 $conf->data->set('archname' => $pseudoarch);
 my $ret = $step->runstep($conf);
-ok( $ret, "runstep() returned true value" );
+ok( $ret, "runstep() returned true value: $pseudoarch" );
 is($step->result(), q{}, "Result was empty string as expected");
 is($conf->data->get('cpuarch'), q{},
     "'cpuarch' was set as expected");
@@ -117,7 +90,7 @@
     argv => [ ],
     mode => q{configure},
 } );
-rerun_defaults_for_testing($conf, $args );
+
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 $step = test_step_constructor_and_description($conf);
@@ -126,7 +99,7 @@
 my $pseudobyteorder = 1234;
 $conf->data->set('byteorder' => $pseudobyteorder);
 $ret = $step->runstep($conf);
-ok( $ret, "runstep() returned true value" );
+ok( $ret, "runstep() returned true value: $pseudoarch" );
 is($step->result(), q{}, "Result was empty string as expected");
 is($conf->data->get('cpuarch'), q{i386},
     "'cpuarch' was set as expected");
@@ -141,7 +114,7 @@
     argv => [ ],
     mode => q{configure},
 } );
-rerun_defaults_for_testing($conf, $args );
+
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 $step = test_step_constructor_and_description($conf);
@@ -150,7 +123,7 @@
 $pseudobyteorder = 4321;
 $conf->data->set('byteorder' => $pseudobyteorder);
 $ret = $step->runstep($conf);
-ok( $ret, "runstep() returned true value" );
+ok( $ret, "runstep() returned true value: $pseudoarch" );
 is($step->result(), q{}, "Result was empty string as expected");
 is($conf->data->get('cpuarch'), q{ppc},
     "'cpuarch' was set as expected");
@@ -165,14 +138,14 @@
     argv => [ ],
     mode => q{configure},
 } );
-rerun_defaults_for_testing($conf, $args );
+
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 $step = test_step_constructor_and_description($conf);
 $pseudoarch = q{MSWin32-x64};
 $conf->data->set('archname' => $pseudoarch);
 $ret = $step->runstep($conf);
-ok( $ret, "runstep() returned true value" );
+ok( $ret, "runstep() returned true value: $pseudoarch" );
 is($step->result(), q{}, "Result was empty string as expected");
 is($conf->data->get('cpuarch'), q{amd64},
     "'cpuarch' was set as expected");
@@ -187,14 +160,14 @@
     argv => [ ],
     mode => q{configure},
 } );
-rerun_defaults_for_testing($conf, $args );
+
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 $step = test_step_constructor_and_description($conf);
 $pseudoarch = q{MSWin32-i386};
 $conf->data->set('archname' => $pseudoarch);
 $ret = $step->runstep($conf);
-ok( $ret, "runstep() returned true value" );
+ok( $ret, "runstep() returned true value: $pseudoarch" );
 is($step->result(), q{}, "Result was empty string as expected");
 is($conf->data->get('cpuarch'), q{i386},
     "'cpuarch' was set as expected");
@@ -209,14 +182,14 @@
     argv => [ ],
     mode => q{configure},
 } );
-rerun_defaults_for_testing($conf, $args );
+
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 $step = test_step_constructor_and_description($conf);
 $pseudoarch = q{cygwin};
 $conf->data->set('archname' => $pseudoarch);
 $ret = $step->runstep($conf);
-ok( $ret, "runstep() returned true value" );
+ok( $ret, "runstep() returned true value: $pseudoarch" );
 is($step->result(), q{}, "Result was empty string as expected");
 is($conf->data->get('cpuarch'), q{i386},
     "'cpuarch' was set as expected");
@@ -231,14 +204,14 @@
     argv => [ ],
     mode => q{configure},
 } );
-rerun_defaults_for_testing($conf, $args );
+
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 $step = test_step_constructor_and_description($conf);
 $pseudoarch = q{powerpc-linux};
 $conf->data->set('archname' => $pseudoarch);
 $ret = $step->runstep($conf);
-ok( $ret, "runstep() returned true value" );
+ok( $ret, "runstep() returned true value: $pseudoarch" );
 is($step->result(), q{}, "Result was empty string as expected");
 is($conf->data->get('cpuarch'), q{ppc},
     "'cpuarch' was set as expected");
@@ -253,23 +226,96 @@
     argv => [ ],
     mode => q{configure},
 } );
-rerun_defaults_for_testing($conf, $args );
+
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 $step = test_step_constructor_and_description($conf);
 $pseudoarch = q{cygwin-i486};
 $conf->data->set('archname' => $pseudoarch);
 $ret = $step->runstep($conf);
-ok( $ret, "runstep() returned true value" );
+ok( $ret, "runstep() returned true value: $pseudoarch" );
 is($step->result(), q{}, "Result was empty string as expected");
 is($conf->data->get('cpuarch'), q{i386},
     "'cpuarch' was set as expected");
 is($conf->data->get('osname'), q{cygwin},
     "'osname' was set as expected");
 
-pass("Completed all tests in $0");
+########## mock solaris i86pc ##########
+
+($args, $step_list_ref) = process_options( {
+    argv => [ ],
+    mode => q{configure},
+} );
+
+$conf->add_steps($pkg);
+$conf->options->set( %{$args} );
+$step = test_step_constructor_and_description($conf);
+$pseudoarch = q{i86pc-solaris};
+$conf->data->set('archname' => $pseudoarch);
+$ret = $step->runstep($conf);
+ok( $ret, "runstep() returned true value: $pseudoarch" );
+is($step->result(), q{}, "Result was empty string as expected");
+# Since on this architecture we call uname -p,
+# we cannot test 'cpuarch' easily
+#is($conf->data->get('cpuarch'), q{},
+#    "'cpuarch' was set as expected");
+is($conf->data->get('osname'), q{solaris},
+    "'osname' was set as expected");
+
+########## _get_platform() ##########
+
+my $exp;
 
-sub _capture { $errstr = $_[0]; }
+$conf->data->set( osname => 'msys' );
+$conf->data->set( archname => 'foo' );
+$exp = q{win32};
+is( $step->_get_platform( $conf ), $exp,
+    "Got expected platform for $exp");
+
+$conf->data->set( osname => 'mingw' );
+$conf->data->set( archname => 'foo' );
+$exp = q{win32};
+is( $step->_get_platform( $conf ), $exp,
+    "Got expected platform for $exp");
+
+$conf->data->set( osname => 'MSWin32' );
+$conf->data->set( archname => 'foo' );
+$exp = q{win32};
+is( $step->_get_platform( $conf ), $exp,
+    "Got expected platform for $exp");
+
+$conf->data->set( archname => 'ia64-bar' );
+$exp = q{ia64};
+is( $step->_get_platform( $conf ), $exp,
+    "Got expected platform for $exp");
+
+$conf->data->set( archname => 'foo-bar' );
+$conf->data->set( osname => 'bar' );
+$exp = q{generic};
+is( $step->_get_platform( $conf ), $exp,
+    "Got expected platform for $exp");
+
+########## _report_verbose() ##########
+
+$conf->data->set( osname   => 'foo' );
+$conf->data->set( cpuarch  => 'bar' );
+$conf->data->set( platform => 'baz' );
+$conf->options->set( verbose => 1 );
+{
+    my ($stdout, $stderr);
+    capture(
+        sub { auto::arch::_report_verbose($conf); },
+        \$stdout,
+        \$stderr,
+    );
+    like( $stdout, qr/osname:\s+?foo/s,
+        "Got expected verbose output" );
+    like( $stdout, qr/cpuarch:\s+?bar/s,
+        "Got expected verbose output" );
+    like( $stdout, qr/platform:\s+?baz/s,
+        "Got expected verbose output" );
+}
+pass("Completed all tests in $0");
 
 ################### DOCUMENTATION ###################
 

Modified: branches/orderedhash_revamp/t/steps/auto/attributes-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/attributes-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/attributes-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,15 +5,13 @@
 
 use strict;
 use warnings;
-use Test::More tests => 12;
+use Test::More tests =>  7;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::auto::attributes');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw | capture |;
@@ -23,9 +21,8 @@
     mode            => q{configure},
 } );
 
-my $conf = Parrot::Configure->new();
-
-test_step_thru_runstep($conf, q{init::defaults}, $args);
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{auto::attributes};
 

Modified: branches/orderedhash_revamp/t/steps/auto/backtrace-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/backtrace-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/backtrace-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,15 +5,13 @@
 
 use strict;
 use warnings;
-use Test::More tests => 19;
+use Test::More tests => 14;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::auto::backtrace');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 
@@ -24,9 +22,8 @@
     mode            => q{configure},
 } );
 
-my $conf = Parrot::Configure->new();
-
-test_step_thru_runstep($conf, q{init::defaults}, $args);
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my ($task, $step_name, $step, $ret);
 my $pkg = q{auto::backtrace};

Modified: branches/orderedhash_revamp/t/steps/auto/byteorder-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/byteorder-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/byteorder-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -9,10 +9,9 @@
 use Carp;
 use lib qw( lib t/configure/testlib );
 use_ok('config::auto::byteorder');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 
@@ -25,7 +24,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{auto::byteorder};
 

Modified: branches/orderedhash_revamp/t/steps/auto/cgoto-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/cgoto-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/cgoto-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,16 +5,13 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  56;
+use Test::More tests =>  45;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::auto::cgoto');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw( capture );
@@ -27,12 +24,11 @@
     mode => q{configure},
 } );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $serialized = $conf->pcfreeze();
 
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
-
 my $pkg = q{auto::cgoto};
 
 $conf->add_steps($pkg);
@@ -55,7 +51,7 @@
     argv => [ ],
     mode => q{configure},
 } );
-rerun_defaults_for_testing($conf, $args );
+
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 $step = test_step_constructor_and_description($conf);
@@ -93,7 +89,7 @@
     argv => [ ],
     mode => q{configure},
 } );
-rerun_defaults_for_testing($conf, $args );
+
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 $step = test_step_constructor_and_description($conf);

Modified: branches/orderedhash_revamp/t/steps/auto/cpu-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/cpu-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/cpu-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,16 +5,13 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  22;
+use Test::More tests =>  14;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::auto::cpu');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw( capture );
@@ -26,16 +23,16 @@
     mode => q{configure},
 } );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
+my ($pkg, $step);
 my $serialized = $conf->pcfreeze();
 
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
-
-my $pkg = q{auto::cpu};
+$pkg = q{auto::cpu};
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
-my $step = test_step_constructor_and_description($conf);
+$step = test_step_constructor_and_description($conf);
 {
     $conf->data->set('cpuarch' => 'foobar');
     my ($ret, $stdout);
@@ -52,6 +49,7 @@
 }
 
 $conf->replenish($serialized);
+$conf->options->set( 'verbose' => undef );
 
 ########### mock cpuarch ###########
 
@@ -59,7 +57,7 @@
     argv => [ ],
     mode => q{configure},
 } );
-rerun_defaults_for_testing($conf, $args );
+
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 $step = test_step_constructor_and_description($conf);

Modified: branches/orderedhash_revamp/t/steps/auto/crypto-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/crypto-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/crypto-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -8,11 +8,9 @@
 use Carp;
 use lib qw( lib t/configure/testlib );
 use_ok('config::auto::crypto');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw( capture );
@@ -26,7 +24,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{auto::crypto};
 

Modified: branches/orderedhash_revamp/t/steps/auto/ctags-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/ctags-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/ctags-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -9,10 +9,9 @@
 use Carp;
 use lib qw( lib t/configure/testlib );
 use_ok('config::auto::ctags');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw( capture );
@@ -24,7 +23,8 @@
     mode => q{configure},
 } );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{auto::ctags};
 

Modified: branches/orderedhash_revamp/t/steps/auto/env-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/env-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/env-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,16 +5,13 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  29;
+use Test::More tests =>  24;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::auto::env');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw( capture );
@@ -26,9 +23,8 @@
     mode            => q{configure},
 } );
 
-my $conf = Parrot::Configure->new();
-
-test_step_thru_runstep($conf, q{init::defaults}, $args);
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{auto::env};
 

Deleted: branches/orderedhash_revamp/t/steps/auto/fink-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/fink-01.t	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,289 +0,0 @@
-#! perl
-# Copyright (C) 2007-2009, Parrot Foundation.
-# $Id$
-# auto/fink-01.t
-
-use strict;
-use warnings;
-use Test::More;
-use Carp;
-use File::Temp;
-use lib qw( lib t/configure/testlib );
-
-plan( skip_all => 'fink is Darwin only' ) unless $^O =~ /darwin/i;
-plan( tests => 55 );
-
-use_ok('config::init::defaults');
-use_ok('config::auto::fink');
-
-use Parrot::Configure;
-use Parrot::Configure::Options qw( process_options );
-use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
-    test_step_constructor_and_description
-);
-use IO::CaptureOutput qw( capture );
-
-########## Darwin but no good Fink  ##########
-
-my ($args, $step_list_ref) = process_options( {
-    argv            => [],
-    mode            => q{configure},
-} );
-
-my $conf = Parrot::Configure->new();
-
-test_step_thru_runstep($conf, q{init::defaults}, $args);
-
-my $pkg = q{auto::fink};
-
-$conf->add_steps($pkg);
-
-my $serialized = $conf->pcfreeze();
-
-$conf->options->set(%{$args});
-my $step = test_step_constructor_and_description($conf);
-
-# Success in the following test means:
-# (a) OS is Darwin.
-# (b) Either Fink is not installed or it is installed correctly, i.e., we can
-# locate the Fink subdirectories we need for later Parrot configuration steps.
-ok($step->runstep($conf), "runstep() returned true value");
-
-$conf->replenish($serialized);
-
-########## not Darwin ##########
-
-($args, $step_list_ref) = process_options( {
-    argv            => [],
-    mode            => q{configure},
-} );
-# mock not Darwin
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-$conf->data->set_p5( 'OSNAME' => 'foobar' );
-ok($step->runstep($conf), "runstep() returned true value");
-is($step->result(), q{skipped}, "Got expected result for non-Darwin OS");
-
-$conf->replenish($serialized);
-
-########## no Fink ##########
-
-($args, $step_list_ref) = process_options( {
-    argv            => [],
-    mode            => q{configure},
-} );
-# mock no Fink
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-$step->{fink_conf} = q{my_ridiculous_foobar};
-my $msg = q{Fink not installed};
-
-{
-    ok($step->runstep($conf), "runstep() returned true value");
-    is($step->result(), $msg, "Got expected result for $msg");
-}
-
-$conf->replenish($serialized);
-
-########## Darwin but defective Fink ##########
-
-($args, $step_list_ref) = process_options( {
-    argv            => [],
-    mode            => q{configure},
-} );
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-{
-    # mock Fink config file with no Basepath
-    my $tfile = File::Temp->new();
-    open my $fh, ">", $tfile
-        or croak "Unable to open temporary file for writing";
-    print $fh "Message: Hello world\n";
-    close $fh or croak "Unable to close temporary file after writing";
-    $step->{fink_conf} = $tfile;
-    ok(! defined $step->runstep($conf),
-        "runstep() returned undef due to defective Fink config file");
-    is($step->result(), q{failed},
-        "Got expected result for defective Fink Config file");
-}
-
-$conf->replenish($serialized);
-
-########## Darwin but defective Fink ##########
-
-($args, $step_list_ref) = process_options( {
-    argv            => [],
-    mode            => q{configure},
-} );
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-{
-    # mock Fink config file with non-existent Basepath
-    my $tfile = File::Temp->new();
-    open my $fh, ">", $tfile
-        or croak "Unable to open temporary file for writing";
-    print $fh "Basepath: /my/phony/directory\n";
-    close $fh or croak "Unable to close temporary file after writing";
-    $step->{fink_conf} = $tfile;
-    ok(! defined $step->runstep($conf),
-        "runstep() returned undef due to unlocateable Fink directories");
-    is($step->result(), q{failed},
-        "Got expected result for unlocateable Fink directories");
-}
-
-$conf->replenish($serialized);
-
-########## not Darwin; --verbose ##########
-
-($args, $step_list_ref) = process_options( {
-    argv            => [ q{--verbose} ],
-    mode            => q{configure},
-} );
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-{
-    # mock not Darwin
-    my $phony_OS = q{foobar};
-    $conf->data->set_p5( 'OSNAME' => $phony_OS );
-    my ($rv, $stdout);
-    capture(
-        sub { $rv = $step->runstep($conf); },
-        \$stdout,
-    );
-    ok($rv, "runstep() returned true value");
-    is($step->result(), q{skipped}, "Got expected result for non-Darwin OS");
-    like($stdout,
-        qr/Operating system is $phony_OS; Fink is Darwin only/,
-        "Got expected verbose output when OS is not Darwin");
-}
-
-$conf->replenish($serialized);
-
-########## Darwin; --verbose; no Fink ##########
-
-($args, $step_list_ref) = process_options( {
-    argv            => [ q{--verbose} ],
-    mode            => q{configure},
-} );
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-{
-    # mock no Fink
-    $step->{fink_conf} = q{my_ridiculous_foobar};
-    my $msg = q{Fink not installed};
-    my ($rv, $stdout);
-    capture(
-        sub { $rv = $step->runstep($conf); },
-        \$stdout,
-    );
-    ok($rv, "runstep() returned true value");
-    is($step->result(), $msg,
-        "Got expected result for $msg");
-    like($stdout,
-        qr/Fink configuration file not located/,
-        "Got expected verbose output when OS is not Darwin");
-}
-
-$conf->replenish($serialized);
-
-########## Darwin; --verbose; defective Fink ##########
-
-($args, $step_list_ref) = process_options( {
-    argv            => [ q{--verbose} ],
-    mode            => q{configure},
-} );
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-{
-    # mock Fink config file with no Basepath
-    my $tfile = File::Temp->new();
-    open my $fh, ">", $tfile
-        or croak "Unable to open temporary file for writing";
-    print $fh "Message: Hello world\n";
-    close $fh or croak "Unable to close temporary file after writing";
-    $step->{fink_conf} = $tfile;
-
-    my ($rv, $stdout);
-    capture(
-        sub { $rv = $step->runstep($conf); },
-        \$stdout,
-    );
-    ok(! defined $rv,
-        "runstep() returned undef due to defective Fink config file");
-    is($step->result(), q{failed},
-        "Got expected result for defective Fink Config file");
-    like($stdout,
-        qr/Fink configuration file defective:  no 'Basepath'/,
-        "Got expected verbose output when Fink config file lacked 'Basepath'");
-}
-
-$conf->replenish($serialized);
-
-########## Darwin; --verbose; defective Fink ##########
-
-($args, $step_list_ref) = process_options( {
-    argv            => [ q{--verbose} ],
-    mode            => q{configure},
-} );
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-{
-    # mock Fink config file with non-existent Basepath
-    my $tfile = File::Temp->new();
-    open my $fh, ">", $tfile
-        or croak "Unable to open temporary file for writing";
-    print $fh "Basepath: /my/phony/directory\n";
-    close $fh or croak "Unable to close temporary file after writing";
-    $step->{fink_conf} = $tfile;
-
-    my ($rv, $stdout);
-    capture(
-        sub { $rv = $step->runstep($conf); },
-        \$stdout,
-    );
-    ok(! defined $rv,
-        "runstep() returned undef due to unlocateable Fink directories");
-    is($step->result(), q{failed},
-        "Got expected result for unlocateable Fink directories");
-    like($stdout,
-        qr/Could not locate Fink directories/,
-        "Got expected verbose output for unlocateable Fink directories");
-}
-
-pass("Completed all tests in $0");
-
-################### DOCUMENTATION ###################
-
-=head1 NAME
-
-auto/fink-01.t - test auto::fink
-
-=head1 SYNOPSIS
-
-    % prove t/steps/auto/fink-01.t
-
-=head1 DESCRIPTION
-
-The files in this directory test functionality used by F<Configure.pl>.
-
-The tests in this file test auto::fink.  Some tests will run only on Darwin.
-Others simulate how auto::fink runs on operating systems other than Darwin.
-
-=head1 AUTHOR
-
-James E Keenan
-
-=head1 SEE ALSO
-
-config::auto::fink, F<Configure.pl>.
-
-=cut
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/t/steps/auto/format-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/format-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/format-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,15 +5,15 @@
 
 use strict;
 use warnings;
-use Test::More tests => 16;
+use Test::More tests => 17;
 use Carp;
 use lib qw( lib t/configure/testlib );
+use_ok('config::init::defaults');
 use_ok('config::auto::format');
 use Parrot::BuildUtil;
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 
@@ -24,7 +24,8 @@
     mode            => q{configure},
 } );
 
-my $conf = Parrot::Configure->new();
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my ($task, $step_name, $step, $ret);
 my $pkg = q{auto::format};
@@ -97,15 +98,16 @@
     );
 }
 {
-    use Config;
-    my $p5format = '%.15' . $Config{sPRIgldbl};
+    my $p5format = '%.15' . $conf->data->get('sPRIgldbl_provisional');
     $p5format =~ s/"//g;; # Perl 5's Config value has embedded double quotes
     $conf->data->set( nv => 'long double' );
+    eval {
     auto::format::_set_floatvalfmt_nvsize($conf);
+};
     is($conf->data->get( 'floatvalfmt' ), $p5format,
-        "floatvalfmt set as expected");
+        "floatvalfmt set as expected: nv long double");
     is($conf->data->get( 'nvsize' ), $conf->data->get( 'hugefloatvalsize' ),
-        "nvsize set as expected");
+        "nvsize set as expected: nv long double");
     $conf->data->set(
         nv          => undef,
         floatvalfmt => undef,

Added: branches/orderedhash_revamp/t/steps/auto/frames-01.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/steps/auto/frames-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,170 @@
+#! perl
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+# auto/frames-01.t
+
+use strict;
+use warnings;
+use Test::More tests => 22;
+use lib qw( lib t/configure/testlib );
+use_ok('config::auto::frames');
+use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
+use Parrot::Configure::Test qw(
+    test_step_constructor_and_description
+);
+
+
+my ($args, $step_list_ref) = process_options( {
+    argv => [ ],
+    mode => q{configure},
+} );
+
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
+
+my $serialized = $conf->pcfreeze();
+
+my $pkg = q{auto::frames};
+$conf->add_steps($pkg);
+$conf->options->set( %{$args} );
+my $step = test_step_constructor_and_description($conf);
+
+# To avoid a warning about an unitialized value, we will set nvsize to 8,
+# cpuarch to i386 and osname to linux.
+# This is normally done during earlier configuration steps.
+$conf->data->set( nvsize => 8 );
+$conf->data->set( cpuarch => 'i386' );
+$conf->data->set( osname => 'linux' );
+
+my $ret = $step->runstep($conf);
+ok( $ret, "runstep() returned true value" );
+ok( defined ( $step->result() ),
+    "Got defined result" );
+TODO: {
+    local $TODO =
+        'build frames temporarily disabled at pcc_reapply merge: TT #1132';
+    is( $step->result(), 'yes', "Result is 'yes', as expected" );
+}
+$conf->cc_clean();
+$step->set_result( undef );
+
+$conf->replenish($serialized);
+
+###### _call_frames_buildable() #####
+
+my $can_build_call_frames;
+
+$conf->options->set( buildframes => 1 );
+$can_build_call_frames = auto::frames::_call_frames_buildable($conf);
+ok( $can_build_call_frames,
+    "_call_frames_buildable() returned true value, as expected" );
+
+$conf->options->set( buildframes => 0 );
+$can_build_call_frames = auto::frames::_call_frames_buildable($conf);
+ok( ! $can_build_call_frames,
+    "_call_frames_buildable() returned false value, as expected" );
+
+$conf->options->set( buildframes => undef );
+$conf->data->set( osname =>  'linux' );
+$conf->data->set( cpuarch =>  'i386' );
+$conf->data->set( nvsize =>  8 );
+$can_build_call_frames = auto::frames::_call_frames_buildable($conf);
+TODO: {
+    local $TODO =
+        'build frames temporarily disabled at pcc_reapply merge: TT #1132';
+    ok( $can_build_call_frames,
+        "_call_frames_buildable() returned true value, as expected (i386/non darwin/8)"
+    );
+}
+
+$conf->data->set( osname =>  'darwin' );
+$conf->data->set( cpuarch =>  'i386' );
+$conf->data->set( nvsize =>  8 );
+$can_build_call_frames = auto::frames::_call_frames_buildable($conf);
+ok( ! $can_build_call_frames,
+    "_call_frames_buildable() returned false value, as expected (i386/darwin/8)" );
+
+$conf->data->set( osname =>  'linux' );
+$conf->data->set( cpuarch =>  'ppc' );
+$conf->data->set( nvsize =>  8 );
+$can_build_call_frames = auto::frames::_call_frames_buildable($conf);
+ok( ! $can_build_call_frames,
+    "_call_frames_buildable() returned false value, as expected (ppc/linux/8)" );
+
+$conf->data->set( osname =>  'linux' );
+$conf->data->set( cpuarch =>  'i386' );
+$conf->data->set( nvsize =>  4 );
+$can_build_call_frames = auto::frames::_call_frames_buildable($conf);
+ok( ! $can_build_call_frames,
+    "_call_frames_buildable() returned false value, as expected (i386/linux/4)" );
+
+##### _handle_call_frames_buildable() #####
+
+$conf->data->set( nvsize => 8 );
+$conf->data->set( cpuarch => 'i386' );
+$conf->data->set( osname => 'linux' );
+
+my $rv;
+
+$can_build_call_frames = 0;
+$rv = $step->_handle_can_build_call_frames( $conf, $can_build_call_frames );
+ok( $rv, "_handle_can_build_call_frames() returned true value" );
+ok( ! $conf->data->get( 'cc_build_call_frames'),
+    "cc_build_call_frames not set to true, as expected" );
+ok( ! defined( $conf->data->get( 'has_exec_protect' ) ),
+    "has_exec_protect undefined, as expected" );
+is( $step->result(), 'no', "Result is 'no', as expected" );
+
+$conf->data->set( 'cc_build_call_frames' => undef );
+$conf->data->set( 'has_exec_protect' => undef );
+
+$can_build_call_frames = 1;
+my $realos = $conf->data->get( 'osname' );
+$conf->data->set( 'osname' => 'foobar' );
+$rv = $step->_handle_can_build_call_frames( $conf, $can_build_call_frames );
+ok( $rv, "_handle_can_build_call_frames() returned true value" );
+is( $conf->data->get( 'cc_build_call_frames'), '-DCAN_BUILD_CALL_FRAMES',
+    "cc_build_call_frames set to expected value" );
+is( $conf->data->get( 'has_exec_protect' ), 0,
+    "has_exec_protect is 0, as expected" );
+is( $step->result(), 'yes', "Result is 'yes', as expected" );
+
+$conf->data->set( 'cc_build_call_frames' => undef );
+$conf->data->set( 'has_exec_protect' => undef );
+$conf->data->set( 'osname' => $realos );
+
+pass("Completed all tests in $0");
+
+################### DOCUMENTATION ###################
+
+=head1 NAME
+
+auto/frames-01.t - test auto::frames
+
+=head1 SYNOPSIS
+
+    % prove t/steps/auto/frames-01.t
+
+=head1 DESCRIPTION
+
+The files in this directory test functionality used by F<Configure.pl>.
+
+The tests in this file test auto::frames.
+
+=head1 AUTHOR
+
+Daniel Arbelo Arrocha
+
+=head1 SEE ALSO
+
+config::auto::frames, F<Configure.pl>.
+
+=cut
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Deleted: branches/orderedhash_revamp/t/steps/auto/funcptr-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/funcptr-01.t	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,134 +0,0 @@
-#! perl
-# Copyright (C) 2007, Parrot Foundation.
-# $Id$
-# auto/funcptr-01.t
-
-use strict;
-use warnings;
-use Test::More tests => 28;
-use Carp;
-use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
-use_ok('config::auto::funcptr');
-use Parrot::BuildUtil;
-use Parrot::Configure;
-use Parrot::Configure::Options qw( process_options );
-use Parrot::Configure::Test qw( test_step_thru_runstep);
-use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
-    test_step_constructor_and_description
-);
-use IO::CaptureOutput qw( capture );
-
-########### --jitcapable=0  ###########
-
-my ($args, $step_list_ref) = process_options( {
-    argv            => [ q{--jitcapable=0} ],
-    mode            => q{configure},
-} );
-
-my $conf = Parrot::Configure->new();
-
-my $serialized = $conf->pcfreeze();
-
-test_step_thru_runstep($conf, q{init::defaults}, $args);
-
-my $pkg = q{auto::funcptr};
-
-$conf->add_steps($pkg);
-$conf->options->set(%{$args});
-my $step = test_step_constructor_and_description($conf);
-my $ret = $step->runstep($conf);
-ok($ret, "runstep() returned defined value" );
-
-$conf->replenish($serialized);
-
-########### _cast_void_pointers_msg() ###########
-
-($args, $step_list_ref) = process_options( {
-    argv            => [ ],
-    mode            => q{configure},
-} );
-rerun_defaults_for_testing($conf, $args );
-$conf->add_steps($pkg);
-$conf->options->set( %{$args} );
-$step = test_step_constructor_and_description($conf);
-{
-    my $stdout;
-    my $ret = capture(
-        sub { auto::funcptr::_cast_void_pointers_msg(); },
-        \$stdout,
-    );
-    like($stdout, qr/Although it is not required/s,
-        "Got expected advisory message");
-}
-
-########### _set_positive_result() ###########
-
-{
-    my $stdout;
-    my $ret = capture(
-        sub { auto::funcptr::_set_positive_result($step, $conf); },
-        \$stdout,
-    );
-    is($step->result, q{yes}, "Got expected result");
-    ok(! $stdout, "Nothing printed to STDOUT, as expected");
-}
-
-$conf->replenish($serialized);
-
-########### --verbose; _set_positive_result() ###########
-
-($args, $step_list_ref) = process_options( {
-    argv            => [ q{--verbose} ],
-    mode            => q{configure},
-} );
-rerun_defaults_for_testing($conf, $args );
-$conf->add_steps($pkg);
-$conf->options->set( %{$args} );
-$step = test_step_constructor_and_description($conf);
-{
-    my $stdout;
-    my $ret = capture(
-        sub { auto::funcptr::_set_positive_result($step, $conf); },
-        \$stdout,
-    );
-    is($step->result, q{yes}, "Got expected result");
-    like($stdout, qr/yes/, "Got expected verbose output");
-}
-
-pass("Completed all tests in $0");
-
-################### DOCUMENTATION ###################
-
-=head1 NAME
-
-auto/funcptr-01.t - test auto::funcptr
-
-=head1 SYNOPSIS
-
-    % prove t/steps/auto/funcptr-01.t
-
-=head1 DESCRIPTION
-
-The files in this directory test functionality used by F<Configure.pl>.
-
-The tests in this file test aspects of auto::funcptr.
-
-=head1 AUTHOR
-
-James E Keenan
-
-=head1 SEE ALSO
-
-config::auto::funcptr, F<Configure.pl>.
-
-=cut
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/t/steps/auto/gc-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/gc-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/gc-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,14 +5,12 @@
 
 use strict;
 use warnings;
-use Test::More tests => 35;
+use Test::More tests =>  8;
 use lib qw( lib t/configure/testlib );
 use_ok('config::auto::gc');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw| capture |;
@@ -26,7 +24,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{auto::gc};
 
@@ -48,94 +47,13 @@
         "Got expected value for 'gc_flag'");
 }
 
-$conf->replenish($serialized);
-
-########### --gc=gc ###########
-
-($args, $step_list_ref) = process_options( {
-    argv => [ q{--gc=gc} ],
-    mode => q{configure},
-} );
-$conf->options->set( %{$args} );
-$step = test_step_constructor_and_description($conf);
-my $ret = $step->runstep($conf);
-ok( $ret, "runstep() returned true value" );
-is($conf->data->get('gc_flag'), q{},
-    "Got expected value for 'gc_flag'");
-
-$conf->replenish($serialized);
-
-########### --gc=libc ###########
-
-($args, $step_list_ref) = process_options( {
-    argv => [ q{--gc=libc} ],
-    mode => q{configure},
-} );
-$conf->options->set( %{$args} );
-$step = test_step_constructor_and_description($conf);
-$conf->data->set('i_malloc' => 1);
-$ret = $step->runstep($conf);
-ok( $ret, "runstep() returned true value" );
-is($conf->data->get('gc_flag'), '-DGC_IS_MALLOC',
-    "Got expected value for 'gc_flag'");
-is($conf->data->get('malloc_header'), 'malloc.h',
-    "Got expected value for 'malloc_header'");
-
-$conf->replenish($serialized);
-
-########### --gc=libc ###########
-
-($args, $step_list_ref) = process_options( {
-    argv => [ q{--gc=libc} ],
-    mode => q{configure},
-} );
-$conf->options->set( %{$args} );
-$step = test_step_constructor_and_description($conf);
-$conf->data->set('i_malloc' => undef);
-$ret = $step->runstep($conf);
-ok( $ret, "runstep() returned true value" );
-is($conf->data->get('gc_flag'), '-DGC_IS_MALLOC',
-    "Got expected value for 'gc_flag'");
-is($conf->data->get('malloc_header'), 'stdlib.h',
-    "Got expected value for 'malloc_header'");
-
-$conf->replenish($serialized);
-
-########### --gc=malloc ###########
-
-($args, $step_list_ref) = process_options( {
-    argv => [ q{--gc=malloc} ],
-    mode => q{configure},
-} );
-$conf->options->set( %{$args} );
-$step = test_step_constructor_and_description($conf);
-$ret = $step->runstep($conf);
-ok( $ret, "runstep() returned true value" );
-is($conf->data->get('gc_flag'), '-DGC_IS_MALLOC',
-    "Got expected value for 'gc_flag'");
-
-$conf->replenish($serialized);
-
-########### --gc=malloc-trace ###########
-
-($args, $step_list_ref) = process_options( {
-    argv => [ q{--gc=malloc-trace} ],
-    mode => q{configure},
-} );
-$conf->options->set( %{$args} );
-$step = test_step_constructor_and_description($conf);
-$ret = $step->runstep($conf);
-ok( $ret, "runstep() returned true value" );
-is($conf->data->get('gc_flag'), '-DGC_IS_MALLOC',
-    "Got expected value for 'gc_flag'");
-
 pass("Completed all tests in $0");
 
 ################### DOCUMENTATION ###################
 
 =head1 NAME
 
-auto/gc-01.t - test auto::gc
+auto_gc-01.t - test auto::gc
 
 =head1 SYNOPSIS
 

Modified: branches/orderedhash_revamp/t/steps/auto/gcc-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/gcc-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/gcc-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,17 +5,13 @@
 
 use strict;
 use warnings;
-use Test::More tests => 122;
+use Test::More tests =>  79;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
-use_ok('config::inter::progs');
 use_ok('config::auto::gcc');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw | capture |;
@@ -27,13 +23,11 @@
     mode            => q{configure},
 } );
 
-my $conf = Parrot::Configure->new();
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $serialized = $conf->pcfreeze();
 
-test_step_thru_runstep($conf, q{init::defaults}, $args);
-test_step_thru_runstep( $conf, q{inter::progs},  $args );
-
 my $pkg = q{auto::gcc};
 
 $conf->add_steps($pkg);
@@ -46,7 +40,6 @@
 
 ########## _evaluate_gcc() ##########
 
-rerun_defaults_for_testing($conf, $args );
 $conf->add_steps($pkg);
 $conf->options->set(%{$args});
 $step = test_step_constructor_and_description($conf);
@@ -60,7 +53,6 @@
 
 ########## _evaluate_gcc() ##########
 
-rerun_defaults_for_testing($conf, $args );
 $conf->add_steps($pkg);
 $conf->options->set(%{$args});
 $step = test_step_constructor_and_description($conf);
@@ -81,7 +73,6 @@
     argv            => [ q{--verbose} ],
     mode            => q{configure},
 } );
-rerun_defaults_for_testing($conf, $args );
 $conf->add_steps($pkg);
 $conf->options->set(%{$args});
 $step = test_step_constructor_and_description($conf);
@@ -106,7 +97,6 @@
     argv            => [],
     mode            => q{configure},
 } );
-rerun_defaults_for_testing($conf, $args );
 $conf->add_steps($pkg);
 $conf->options->set(%{$args});
 $step = test_step_constructor_and_description($conf);
@@ -127,7 +117,6 @@
     argv            => [ q{--verbose} ],
     mode            => q{configure},
 } );
-rerun_defaults_for_testing($conf, $args );
 $conf->add_steps($pkg);
 $conf->options->set(%{$args});
 $step = test_step_constructor_and_description($conf);
@@ -148,7 +137,6 @@
 
 ########## _evaluate_gcc() ##########
 
-rerun_defaults_for_testing($conf, $args );
 $conf->add_steps($pkg);
 $conf->options->set(%{$args});
 $step = test_step_constructor_and_description($conf);
@@ -176,7 +164,6 @@
     argv            => [],
     mode            => q{configure},
 } );
-rerun_defaults_for_testing($conf, $args );
 $conf->add_steps($pkg);
 $conf->options->set(%{$args});
 $step = test_step_constructor_and_description($conf);
@@ -203,7 +190,6 @@
     argv            => [ q{--verbose} ],
     mode            => q{configure},
 } );
-rerun_defaults_for_testing($conf, $args );
 $conf->add_steps($pkg);
 $conf->options->set(%{$args});
 $step = test_step_constructor_and_description($conf);
@@ -231,7 +217,6 @@
     argv            => [ ],
     mode            => q{configure},
 } );
-rerun_defaults_for_testing($conf, $args );
 $conf->add_steps($pkg);
 $conf->options->set(%{$args});
 $step = test_step_constructor_and_description($conf);
@@ -251,7 +236,6 @@
     argv            => [ q{--maintainer}, q{--cage} ],
     mode            => q{configure},
 } );
-rerun_defaults_for_testing($conf, $args );
 $conf->add_steps($pkg);
 $conf->options->set(%{$args});
 $step = test_step_constructor_and_description($conf);
@@ -273,7 +257,6 @@
     argv            => [ ],
     mode            => q{configure},
 } );
-rerun_defaults_for_testing($conf, $args );
 $conf->add_steps($pkg);
 $conf->options->set(%{$args});
 $step = test_step_constructor_and_description($conf);
@@ -281,7 +264,7 @@
 $gnucref->{__GNUC__} = q{3};
 $gnucref->{__GNUC_MINOR__} = q{1};
 {
-    $conf->data->set_p5( OSNAME => 'hpux' );
+    $conf->data->set( OSNAME_provisional => 'hpux' );
     ok($step->_evaluate_gcc($conf, $gnucref),
         "_evaluate_gcc() returned true value");
     ok(defined $conf->data->get( 'gccversion' ),

Modified: branches/orderedhash_revamp/t/steps/auto/gdbm-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/gdbm-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/gdbm-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,19 +5,16 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  47;
+use Test::More tests =>  29;
 use Carp;
 use Cwd;
 use File::Spec;
 use File::Temp qw( tempdir );
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::auto::gdbm');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw| capture |;
@@ -37,12 +34,11 @@
     mode => q{configure},
 } );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $serialized = $conf->pcfreeze();
 
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
-
 my $pkg = q{auto::gdbm};
 
 $conf->add_steps($pkg);
@@ -56,24 +52,18 @@
 
 $conf->replenish($serialized);
 
-########## --without-gdbm; _handle_darwin_for_fink() ##########
+########## --without-gdbm ##########
 
 ($args, $step_list_ref) = process_options( {
     argv => [ q{--without-gdbm} ],
     mode => q{configure},
 } );
-rerun_defaults_for_testing($conf, $args );
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 $step = test_step_constructor_and_description($conf);
 my $osname;
 my ($flagsbefore, $flagsafter);
 $osname = 'foobar';
-$flagsbefore = $conf->data->get( 'linkflags' );
-ok($step->_handle_darwin_for_fink($conf, $osname, 'gdbm.h'),
-    "handle_darwin_for_fink() returned true value");
-$flagsafter = $conf->data->get( 'linkflags' );
-is($flagsbefore, $flagsafter, "No change in linkflags, as expected");
 my $cwd = cwd();
 {
     my $tdir = tempdir( CLEANUP => 1 );
@@ -84,12 +74,6 @@
     my $includedir = File::Spec->catdir( $tdir, 'include' );
     $conf->data->set('fink_lib_dir' => $libdir);
     $conf->data->set('fink_include_dir' => $includedir);
-    $osname = 'darwin';
-    $flagsbefore = $conf->data->get( 'linkflags' );
-    ok($step->_handle_darwin_for_fink($conf, $osname, 'gdbm.h'),
-        "handle_darwin_for_fink() returned true value");
-    $flagsafter = $conf->data->get( 'linkflags' );
-    is($flagsbefore, $flagsafter, "No change in linkflags, as expected");
 
     ok(chdir $cwd, "Able to change back to original directory after testing");
 }
@@ -107,15 +91,6 @@
     print $FH "Hello world\n";
     close $FH or croak "Could not close after writing";
 
-    $osname = 'darwin';
-    $flagsbefore = $conf->data->get( 'linkflags' );
-    ok($step->_handle_darwin_for_fink($conf, $osname, 'gdbm.h'),
-        "handle_darwin_for_fink() returned true value");
-    $flagsafter = $conf->data->get( 'linkflags' );
-    isnt($flagsbefore, $flagsafter, "Change in linkflags, as expected");
-    like($conf->data->get( 'linkflags' ), qr/-L\Q$libdir\E/,
-        "'linkflags' modified as expected");
-
     ok(chdir $cwd, "Able to change back to original directory after testing");
 }
 
@@ -127,7 +102,6 @@
     argv => [ q{--without-gdbm} ],
     mode => q{configure},
 } );
-rerun_defaults_for_testing($conf, $args );
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 $step = test_step_constructor_and_description($conf);

Modified: branches/orderedhash_revamp/t/steps/auto/gettext-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/gettext-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/gettext-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,15 +5,13 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  30;
+use Test::More tests =>  32;
 use Carp;
 use lib qw( lib t/configure/testlib );
 use_ok('config::auto::gettext');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw( capture );
@@ -27,7 +25,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{auto::gettext};
 
@@ -160,21 +159,29 @@
 
 $verbose = undef;
 $conf->data->set( ccflags => q{} );
-ok(auto::gettext::_handle_gettext($conf, $verbose),
+$conf->data->set( libs    => q{} );
+my $libs = q{foo bar baz};
+ok(auto::gettext::_handle_gettext($conf, $verbose, $libs),
     "_handle_gettext() returned true value");
 like($conf->data->get( 'ccflags' ), qr/-DHAS_GETTEXT/,
     "HAS_GETTEXT was added to 'ccflags'");
+like($conf->data->get( 'libs' ), qr/$libs/,
+    "Values added to 'libs' as expected");
 
+$conf->data->set( ccflags => q{} );
+$conf->data->set( libs    => q{} );
 {
     my ($stdout, $rv);
     $verbose = 1;
     capture(
-        sub { $rv = auto::gettext::_handle_gettext($conf, $verbose); },
+        sub { $rv = auto::gettext::_handle_gettext($conf, $verbose, $libs); },
         \$stdout,
     );
     ok($rv, "_handle_gettext() returned true value");
     like($conf->data->get( 'ccflags' ), qr/-DHAS_GETTEXT/,
         "HAS_GETTEXT was added to 'ccflags'");
+    like($conf->data->get( 'libs' ), qr/$libs/,
+        "Values added to 'libs' as expected");
     like($stdout,
         qr/ccflags:\s.*-DHAS_GETTEXT/,
         "Got expected verbose output"

Modified: branches/orderedhash_revamp/t/steps/auto/glibc-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/glibc-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/glibc-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,15 +5,13 @@
 
 use strict;
 use warnings;
-use Test::More tests => 18;
+use Test::More tests => 13;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::auto::glibc');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 
@@ -24,9 +22,8 @@
     mode            => q{configure},
 } );
 
-my $conf = Parrot::Configure->new();
-
-test_step_thru_runstep($conf, q{init::defaults}, $args);
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my ($task, $step_name, $step, $ret);
 my $pkg = q{auto::glibc};

Modified: branches/orderedhash_revamp/t/steps/auto/gmp-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/gmp-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/gmp-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,19 +5,16 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  61;
+use Test::More tests =>  26;
 use Carp;
 use Cwd;
 use File::Spec;
 use File::Temp qw( tempdir );
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::auto::gmp');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw( capture );
@@ -35,9 +32,8 @@
     mode => q{configure},
 } );
 
-my $conf = Parrot::Configure->new;
-
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{auto::gmp};
 
@@ -102,63 +98,8 @@
    '-lgmp',
    "_select_lib() returned expected value");
 
-########### _handle_darwin_for_fink() ###########
-
 my ($flagsbefore, $flagsafter);
-$osname = 'foobar';
-$flagsbefore = $conf->data->get( 'linkflags' );
-ok($step->_handle_darwin_for_fink($conf, $osname, 'gmp.h'),
-    "handle_darwin_for_fink() returned true value");
-$flagsafter = $conf->data->get( 'linkflags' );
-is($flagsbefore, $flagsafter, "No change in linkflags, as expected");
-
 my $cwd = cwd();
-{
-    my $tdir = tempdir( CLEANUP => 1 );
-    ok(chdir $tdir, "Able to change to temporary directory");
-    ok( (mkdir 'lib'), "Able to make lib directory");
-    ok( (mkdir 'include'), "Able to make include directory");
-    my $libdir = File::Spec->catdir( $tdir, 'lib' );
-    my $includedir = File::Spec->catdir( $tdir, 'include' );
-    $conf->data->set('fink_lib_dir' => $libdir);
-    $conf->data->set('fink_include_dir' => $includedir);
-    $osname = 'darwin';
-    $flagsbefore = $conf->data->get( 'linkflags' );
-    ok($step->_handle_darwin_for_fink($conf, $osname, 'gmp.h'),
-        "handle_darwin_for_fink() returned true value");
-    $flagsafter = $conf->data->get( 'linkflags' );
-    is($flagsbefore, $flagsafter, "No change in linkflags, as expected");
-
-    ok(chdir $cwd, "Able to change back to original directory after testing");
-}
-
-{
-    my $tdir2 = tempdir( CLEANUP => 1 );
-    ok(chdir $tdir2, "Able to change to temporary directory");
-    ok( (mkdir 'lib'), "Able to make lib directory");
-    ok( (mkdir 'include'), "Able to make include directory");
-    my $libdir = File::Spec->catdir( $tdir2, 'lib' );
-    my $includedir = File::Spec->catdir( $tdir2, 'include' );
-    $conf->data->set('fink_lib_dir' => $libdir);
-    $conf->data->set('fink_include_dir' => $includedir);
-    my $foo = File::Spec->catfile( $includedir, 'gmp.h' );
-    open my $FH, ">", $foo or croak "Could not open for writing";
-    print $FH "Hello world\n";
-    close $FH or croak "Could not close after writing";
-
-    $osname = 'darwin';
-    $flagsbefore = $conf->data->get( 'linkflags' );
-    ok($step->_handle_darwin_for_fink($conf, $osname, 'gmp.h'),
-        "handle_darwin_for_fink() returned true value");
-    $flagsafter = $conf->data->get( 'linkflags' );
-    isnt($flagsbefore, $flagsafter, "Change in linkflags, as expected");
-    like($conf->data->get( 'linkflags' ), qr/-L\Q$libdir\E/,
-        "'linkflags' modified as expected");
-
-    ok(chdir $cwd, "Able to change back to original directory after testing");
-}
-
-$conf->replenish($serialized);
 
 ########### _evaluate_cc_run() ###########
 
@@ -210,66 +151,6 @@
     $step->set_result(undef);
 }
 
-########### _handle_darwin_for_fink() ###########
-
-($args, $step_list_ref) = process_options( {
-    argv => [ ],
-    mode => q{configure},
-} );
-$conf->options->set( %{$args} );
-$step = test_step_constructor_and_description($conf);
-# Mock values for OS
-$osname = 'darwin';
-$conf->data->set( 'linkflags'  => 'foobar' );
-$flagsbefore = $conf->data->get( 'linkflags' );
-$conf->data->set( fink_lib_dir  => undef );
-$conf->data->set( fink_include_dir  => undef );
-ok($step->_handle_darwin_for_fink($conf, $osname, 'gmp.h'),
-    "handle_darwin_for_fink() returned true value");
-$flagsafter = $conf->data->get( 'linkflags' );
-is($flagsbefore, $flagsafter, "No change in linkflags, as expected");
-
-$cwd = cwd();
-{
-    my $tdir = tempdir( CLEANUP => 1 );
-    ok(chdir $tdir, "Able to change to temporary directory");
-    ok( (mkdir 'lib'), "Able to make lib directory");
-#    ok( (mkdir 'include'), "Able to make include directory");
-    my $libdir = File::Spec->catdir( $tdir, 'lib' );
-    my $includedir = File::Spec->catdir( $tdir, 'include' );
-    $conf->data->set('fink_lib_dir' => $libdir);
-    $conf->data->set('fink_include_dir' => $includedir);
-    $osname = 'darwin';
-    $conf->data->set( 'linkflags'  => 'foobar' );
-    $flagsbefore = $conf->data->get( 'linkflags' );
-    ok($step->_handle_darwin_for_fink($conf, $osname, 'gmp.h'),
-        "handle_darwin_for_fink() returned true value");
-    $flagsafter = $conf->data->get( 'linkflags' );
-    is($flagsbefore, $flagsafter, "No change in linkflags, as expected");
-
-    ok(chdir $cwd, "Able to change back to original directory after testing");
-}
-
-{
-    my $tdir1 = tempdir( CLEANUP => 1 );
-    ok(chdir $tdir1, "Able to change to temporary directory");
-#    ok( (mkdir 'lib'), "Able to make lib directory");
-    ok( (mkdir 'include'), "Able to make include directory");
-    my $libdir = File::Spec->catdir( $tdir1, 'lib' );
-    my $includedir = File::Spec->catdir( $tdir1, 'include' );
-    $conf->data->set('fink_lib_dir' => $libdir);
-    $conf->data->set('fink_include_dir' => $includedir);
-    $osname = 'darwin';
-    $conf->data->set( 'linkflags'  => 'foobar' );
-    $flagsbefore = $conf->data->get( 'linkflags' );
-    ok($step->_handle_darwin_for_fink($conf, $osname, 'gmp.h'),
-        "handle_darwin_for_fink() returned true value");
-    $flagsafter = $conf->data->get( 'linkflags' );
-    is($flagsbefore, $flagsafter, "No change in linkflags, as expected");
-
-    ok(chdir $cwd, "Able to change back to original directory after testing");
-}
-
 pass("Completed all tests in $0");
 
 ################### DOCUMENTATION ###################

Modified: branches/orderedhash_revamp/t/steps/auto/headers-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/headers-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/headers-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,16 +5,14 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  30;
+use Test::More tests =>  20;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::auto::headers');
 use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw | capture |;
@@ -28,11 +26,10 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
-
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 my $serialized = $conf->pcfreeze();
 
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
 my $pkg = q{auto::headers};
 
 $conf->add_steps($pkg);
@@ -54,8 +51,6 @@
     }
 );
 
-rerun_defaults_for_testing($conf, $args );
-
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 $step = test_step_constructor_and_description($conf);
@@ -79,8 +74,6 @@
     }
 );
 
-rerun_defaults_for_testing($conf, $args );
-
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 $step = test_step_constructor_and_description($conf);
@@ -89,11 +82,20 @@
 ok(! $conf->data->get('i_niin'), "Mapping made correctly");
 
 {
-    $conf->data->set_p5( OSNAME => "msys" );
+    my $os = 'msys';
+    $conf->data->set( OSNAME_provisional => $os );
+    my %extra_headers =
+        map {$_, 1} auto::headers::_list_extra_headers($conf);
+    ok($extra_headers{'sysmman.h'}, "Special header set for $os");
+    ok($extra_headers{'netdb.h'}, "Special header set for $os");
+}
+
+{
+    my $os = 'MSWin32';
+    $conf->data->set( OSNAME_provisional => $os );
     my %extra_headers =
         map {$_, 1} auto::headers::_list_extra_headers($conf);
-    ok($extra_headers{'sysmman.h'}, "Special header set for msys");
-    ok($extra_headers{'netdb.h'}, "Special header set for msys");
+    ok($extra_headers{'sal.h'}, "Special header set for $os");
 }
 
 pass("Completed all tests in $0");

Modified: branches/orderedhash_revamp/t/steps/auto/inline-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/inline-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/inline-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,16 +5,13 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  37;
+use Test::More tests =>  32;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::auto::inline');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw( capture );
@@ -28,9 +25,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
-
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{auto::inline};
 

Modified: branches/orderedhash_revamp/t/steps/auto/isreg-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/isreg-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/isreg-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,16 +5,13 @@
 
 use strict;
 use warnings;
-use Test::More tests => 23;
+use Test::More tests => 18;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::auto::isreg');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw| capture |;
@@ -26,9 +23,8 @@
     mode            => q{configure},
 } );
 
-my $conf = Parrot::Configure->new();
-
-test_step_thru_runstep($conf, q{init::defaults}, $args);
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{auto::isreg};
 

Modified: branches/orderedhash_revamp/t/steps/auto/jit-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/jit-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/jit-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,20 +5,17 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  51;
+use Test::More tests =>  4;
 use Carp;
 use Cwd;
 use File::Path qw( mkpath );
 use File::Temp qw( tempdir );
 use File::Spec;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::auto::jit');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw( capture );
@@ -29,339 +26,16 @@
     mode => q{configure},
 } );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $serialized = $conf->pcfreeze();
 
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
-
 my $pkg = q{auto::jit};
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 my $step = test_step_constructor_and_description($conf);
 
-########### _check_jitcapability() ###########
-
-my $cwd = cwd();
-{
-    my $tdir = tempdir( CLEANUP => 1 );
-    chdir $tdir or croak "Unable to change to temporary directory";
-    my $jitbase = 'foo';
-    my $cpuarch = 'bar';
-    my $osname = 'baz';
-    my $corejitdir = File::Spec->catdir ( $jitbase, $cpuarch );
-    mkpath( $corejitdir, { mode => 0755 } ) or croak "Unable to make testing directory";
-    my $corejit = File::Spec->catfile( $jitbase, $cpuarch, q{core.jit} );
-    is( $step->_check_jitcapability($corejit, $cpuarch, $osname, 8), 0,
-        "Got expected value for _check_jitcapability(): no core.jit case");
-
-    chdir $cwd or croak "Unable to change back to starting directory";
-}
-
-{
-    my $tdir = tempdir( CLEANUP => 1 );
-    chdir $tdir or croak "Unable to change to temporary directory";
-    my $jitbase = 'foo';
-    my $cpuarch = 'bar';
-    my $osname = 'baz';
-    my $corejitdir = File::Spec->catdir ( $jitbase, $cpuarch );
-    mkpath( $corejitdir, { mode => 0755 } ) or croak "Unable to make testing directory";
-    my $corejit = File::Spec->catfile( $jitbase, $cpuarch, q{core.jit} );
-    open my $FH, '>', $corejit
-        or croak "Unable to open handle to file for testing";
-    print $FH qq{Hello, JIT\n};
-    close $FH or croak "Unable to close handle to file for testing";
-    is( $step->_check_jitcapability($corejit, $cpuarch, $osname, 8), 0,
-        "Got expected value for _check_jitcapability(): no JIT on this architecture case");
-
-    chdir $cwd or croak "Unable to change back to starting directory";
-}
-
-{
-    my $tdir = tempdir( CLEANUP => 1 );
-    chdir $tdir or croak "Unable to change to temporary directory";
-    my $jitbase = 'foo';
-    my $cpuarch = 'bar';
-    my $osname = 'baz';
-    my $corejitdir = File::Spec->catdir ( $jitbase, $cpuarch );
-    mkpath( $corejitdir, { mode => 0755 } ) or croak "Unable to make testing directory";
-    my $corejit = File::Spec->catfile( $jitbase, $cpuarch, q{core.jit} );
-    open my $FH, '>', $corejit
-        or croak "Unable to open handle to file for testing";
-    print $FH qq{Hello, JIT\n};
-    close $FH or croak "Unable to close handle to file for testing";
-    my $orig = $step->{jit_is_working};
-    $step->{jit_is_working} = { $cpuarch => 1 };
-    is( $step->_check_jitcapability($corejit, $cpuarch, $osname, 8), 1,
-        "Got expected value for _check_jitcapability(): mock JIT case");
-    $step->{jit_is_working} = $orig;
-
-    chdir $cwd or croak "Unable to change back to starting directory";
-}
-
-{
-    my $tdir = tempdir( CLEANUP => 1 );
-    chdir $tdir or croak "Unable to change to temporary directory";
-    my $jitbase = 'foo';
-    my $cpuarch = 'i386';
-    my $osname = 'darwin';
-    my $corejitdir = File::Spec->catdir ( $jitbase, $cpuarch );
-    mkpath( $corejitdir, { mode => 0755 } ) or croak "Unable to make testing directory";
-    my $corejit = File::Spec->catfile( $jitbase, $cpuarch, q{core.jit} );
-    open my $FH, '>', $corejit
-        or croak "Unable to open handle to file for testing";
-    print $FH qq{Hello, JIT\n};
-    close $FH or croak "Unable to close handle to file for testing";
-    my $orig = $step->{jit_is_working};
-    $step->{jit_is_working} = { $cpuarch => 1 };
-    is( $step->_check_jitcapability($corejit, $cpuarch, $osname, 8), 0,
-        "Got expected value for _check_jitcapability(): mock darwin-i386 case");
-    $step->{jit_is_working} = $orig;
-
-    chdir $cwd or croak "Unable to change back to starting directory";
-}
-
-{
-    my $tdir = tempdir( CLEANUP => 1 );
-    chdir $tdir or croak "Unable to change to temporary directory";
-    my $jitbase = 'foo';
-    my $cpuarch = 'i386';
-    my $osname = 'MSWin32';
-    my $corejitdir = File::Spec->catdir ( $jitbase, $cpuarch );
-    mkpath( $corejitdir, { mode => 0755 } ) or croak "Unable to make testing directory";
-    my $corejit = File::Spec->catfile( $jitbase, $cpuarch, q{core.jit} );
-    open my $FH, '>', $corejit
-        or croak "Unable to open handle to file for testing";
-    print $FH qq{Hello, JIT\n};
-    close $FH or croak "Unable to close handle to file for testing";
-    my $orig = $step->{jit_is_working};
-    $step->{jit_is_working} = { $cpuarch => 1 };
-    is( $step->_check_jitcapability($corejit, $cpuarch, $osname, 4), 0,
-        "Got expected value for _check_jitcapability(): mock single-float");
-    $step->{jit_is_working} = $orig;
-
-    chdir $cwd or croak "Unable to change back to starting directory";
-}
-
-########### _handle_asm() ###########
-
-{
-    my $tdir = tempdir( CLEANUP => 1 );
-    chdir $tdir or croak "Unable to change to temporary directory";
-    my $jitbase = 'foo';
-    my $cpuarch = 'bar';
-    my $jitarchname = "${cpuarch}-baz";
-    my $asmdir = File::Spec->catdir( $jitbase, $cpuarch );
-    mkpath( $asmdir, { mode => 0755 } ) or croak "Unable to make testing directory";
-    mkpath( q{src}, { mode => 0755 } ) or croak "Unable to make testing directory";
-
-    ok(auto::jit::_handle_asm( {
-        conf        => $conf,
-        jitbase     => $jitbase,
-        cpuarch     => $cpuarch,
-        jitarchname => $jitarchname,
-    } ), "_handle_asm() returned successfully");
-    is( $conf->data->get( 'asmfun_o' ), q{},
-        "Got expected value for asmfun_o: no asm case");
-    $conf->data->set( asmfun_o => undef ); # reset for next test
-
-    chdir $cwd or croak "Unable to change back to starting directory";
-}
-
-{
-    my $tdir = tempdir( CLEANUP => 1 );
-    chdir $tdir or croak "Unable to change to temporary directory";
-    my $jitbase = 'foo';
-    my $cpuarch = 'bar';
-    my $jitarchname = "${cpuarch}-baz";
-    my $asmdir = File::Spec->catdir( $jitbase, $cpuarch );
-    mkpath( $asmdir, { mode => 0755 } ) or croak "Unable to make testing directory";
-    mkpath( q{src}, { mode => 0755 } ) or croak "Unable to make testing directory";
-
-    my $sjit =
-        File::Spec->catfile( $jitbase, $cpuarch, qq{${jitarchname}.s} );
-    open my $FH, '>', $sjit
-        or croak "Unable to open handle to file for testing";
-    print $FH qq{Hello, JIT\n};
-    close $FH or croak "Unable to close handle to file for testing";
-
-    ok(auto::jit::_handle_asm( {
-        conf        => $conf,
-        jitbase     => $jitbase,
-        cpuarch     => $cpuarch,
-        jitarchname => $jitarchname,
-    } ), "_handle_asm() returned successfully");
-    is( $conf->data->get( 'asmfun_o' ), q{src/asmfun$(O)},
-        "Got expected value for asmfun_o: sjit case");
-    $conf->data->set( asmfun_o => undef ); # reset for next test
-
-    chdir $cwd or croak "Unable to change back to starting directory";
-}
-
-{
-    my $tdir = tempdir( CLEANUP => 1 );
-    chdir $tdir or croak "Unable to change to temporary directory";
-    my $jitbase = 'foo';
-    my $cpuarch = 'bar';
-    my $jitarchname = "${cpuarch}-baz";
-    my $asmdir = File::Spec->catdir( $jitbase, $cpuarch );
-    mkpath( $asmdir, { mode => 0755 } ) or croak "Unable to make testing directory";
-    mkpath( q{src}, { mode => 0755 } ) or croak "Unable to make testing directory";
-    my $asm = File::Spec->catfile( $jitbase, $cpuarch, q{asm.s} );
-    open my $FH, '>', $asm
-        or croak "Unable to open handle to file for testing";
-    print $FH qq{Hello, JIT\n};
-    close $FH or croak "Unable to close handle to file for testing";
-
-    ok(auto::jit::_handle_asm( {
-        conf        => $conf,
-        jitbase     => $jitbase,
-        cpuarch     => $cpuarch,
-        jitarchname => $jitarchname,
-    } ), "_handle_asm() returned successfully");
-    is( $conf->data->get( 'asmfun_o' ), q{src/asmfun$(O)},
-        "Got expected value for asmfun_o: asm case");
-    $conf->data->set( asmfun_o => undef ); # reset for next test
-
-    chdir $cwd or croak "Unable to change back to starting directory";
-}
-
-########### _first_probe_for_exec() ###########
-
-is(  $step->_first_probe_for_exec( 'i386', 'foobar' ), 0,
-    "Got expected value for _first_probe_for_exec");
-is(  $step->_first_probe_for_exec( 'i386', 'openbsd' ), 1,
-    "Got expected value for _first_probe_for_exec");
-is(  $step->_first_probe_for_exec( 'foobar', 'openbsd' ), 0,
-    "Got expected value for _first_probe_for_exec");
-
-########### _handle_execcapable() ###########
-
-if (! defined $conf->data->get('cpuarch') ) {
-    $conf->data->set('cpuarch' => 1)
-}
-
-ok(auto::jit::_handle_execcapable($conf, 1),
-    "_handle_execcapable() returned true value");
-is($conf->data->get('execcapable'), 1,
-    "Got expected value for execcapable");
-# prepare for next test
-$conf->data->set('execcapable' => undef);
-
-ok(auto::jit::_handle_execcapable($conf, 0),
-    "_handle_execcapable() returned true value");
-is($conf->data->get('execcapable'), 0,
-    "Got expected value for execcapable");
-$conf->data->set('execcapable' => undef);
-
-########### _handle_exec_protect() ###########
-
-$conf->data->set( has_exec_protect => undef );
-auto::jit::_handle_exec_protect($conf, 0, 0);
-ok( ! defined $conf->data->get( 'has_exec_protect'),
-    "'has_exec_protect' undefined, as expected");
-
-auto::jit::_handle_exec_protect($conf, 1, 0);
-is( $conf->data->get( 'has_exec_protect'), 1,
-    "Got expected value for 'has_exec_protect'");
-$conf->data->set( has_exec_protect => undef );
-
-{
-    my ($stdout, $stderr);
-    capture(
-        sub { auto::jit::_handle_exec_protect($conf, 0, 1); },
-        \$stdout,
-        \$stderr,
-    );
-    ok( ! defined $conf->data->get( 'has_exec_protect'),
-        "'has_exec_protect' undefined, as expected");
-    like($stdout, qr/no\)/, "Got expected verbose output");
-    $conf->data->set( has_exec_protect => undef );
-}
-
-{
-    my ($stdout, $stderr);
-    capture(
-        sub { auto::jit::_handle_exec_protect($conf, 1, 1); },
-        \$stdout,
-        \$stderr,
-    );
-    is( $conf->data->get( 'has_exec_protect'), 1,
-        "Got expected value for 'has_exec_protect'");
-    like($stdout, qr/yes\)/, "Got expected verbose output");
-    $conf->data->set( has_exec_protect => undef );
-}
-
-$conf->replenish($serialized);
-
-($args, $step_list_ref) = process_options( {
-    argv => [ q{--jitcapable=0}, q{--verbose}  ],
-    mode => q{configure},
-} );
-rerun_defaults_for_testing($conf, $args );
-$conf->add_steps($pkg);
-$conf->options->set( %{$args} );
-$step = test_step_constructor_and_description($conf);
-
-# Mock some values so that we can get to the point inside runstep() where the
-# command-line option for jitcapable is relevant.
-
-$cwd = cwd();
-{
-    my $tdir = tempdir( CLEANUP => 1 );
-    chdir $tdir or croak "Unable to change to temporary directory";
-    my $jitbase = 'foo';
-    my $cpuarch = 'i386';
-    my $osname = 'darwin';
-    my $corejitdir = File::Spec->catdir ( $jitbase, $cpuarch );
-    mkpath( $corejitdir, { mode => 0755 } ) or croak "Unable to make testing directory";
-    my $corejit = File::Spec->catfile( $jitbase, $cpuarch, q{core.jit} );
-    open my $FH, '>', $corejit
-        or croak "Unable to open handle to file for testing";
-    print $FH qq{Hello, JIT\n};
-    close $FH or croak "Unable to close handle to file for testing";
-    my $orig = $step->{jit_is_working};
-    $step->{jit_is_working} = { $cpuarch => 1 };
-    $conf->data->set( cpuarch => $cpuarch );
-    $conf->data->set( osname => $osname );
-    {
-        my ($stdout, $stderr, $ret);
-        capture(
-            sub { $ret = $step->runstep($conf); },
-            \$stdout,
-            \$stderr,
-        );
-        ok( $ret, "runstep() returned true value" );
-        like($stdout, qr/yes|no/s, "Got expected verbose output");
-    }
-    $step->{jit_is_working} = $orig;
-    $conf->data->set( cpuarch => undef );
-    $conf->data->set( osname => undef );
-
-    is( $conf->data->get( 'jitarchname' ), 'nojit',
-        "Got expected value for jitarchname");
-    is( $conf->data->get( 'jitcapable' ), 0,
-        "Got expected value for jitcapable");
-    is( $conf->data->get( 'execcapable' ), 0,
-        "Got expected value for execcapable");
-    is( $conf->data->get( 'cc_hasjit' ), '',
-        "Got expected value for cc_hasjit");
-    is( $conf->data->get( 'TEMP_jit_o' ), '',
-        "Got expected value for TEMP_jit_o");
-    is( $conf->data->get( 'TEMP_exec_h' ), '',
-        "Got expected value for TEMP_exec_h");
-    is( $conf->data->get( 'TEMP_exec_o' ), '',
-        "Got expected value for TEMP_exec_o");
-    is( $conf->data->get( 'TEMP_exec_dep' ), '',
-        "Got expected value for TEMP_exec_dep");
-    is( $step->result(), 'no',
-        "Got expected result for no JIT");
-
-    chdir $cwd or croak "Unable to change back to starting directory";
-}
-
-pass("Completed all tests in $0");
-
 ################### DOCUMENTATION ###################
 
 =head1 NAME

Deleted: branches/orderedhash_revamp/t/steps/auto/macports-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/macports-01.t	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,226 +0,0 @@
-#! perl
-# Copyright (C) 2007-2009, Parrot Foundation.
-# $Id$
-# auto/macports-01.t
-
-use strict;
-use warnings;
-use Test::More;
-use Carp;
-use Cwd;
-use File::Spec;
-use File::Temp qw( tempdir );
-use lib qw( lib t/configure/testlib );
-
-plan( skip_all => 'Macports is Darwin only' ) unless $^O =~ /darwin/;
-plan( tests    => 52 );
-
-use_ok('config::init::defaults');
-use_ok('config::auto::macports');
-use Parrot::Configure;
-use Parrot::Configure::Options qw( process_options );
-use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    test_step_constructor_and_description
-);
-use IO::CaptureOutput qw( capture );
-
-########## not Darwin ##########
-
-my ($args, $step_list_ref) = process_options( {
-    argv            => [],
-    mode            => q{configure},
-} );
-
-my $conf = Parrot::Configure->new();
-
-test_step_thru_runstep($conf, q{init::defaults}, $args);
-
-my $pkg = q{auto::macports};
-
-$conf->add_steps($pkg);
-
-my $serialized = $conf->pcfreeze();
-
-$conf->options->set(%{$args});
-my $step = test_step_constructor_and_description($conf);
-
-# mock not Darwin
-$conf->data->set_p5( 'OSNAME' => 'foobar' );
-ok($step->runstep($conf), "runstep() returned true value");
-is($step->result(), q{skipped}, "Got expected result for non-Darwin OS");
-
-$conf->replenish($serialized);
-
-########## Darwin but no Macports ##########
-
-($args, $step_list_ref) = process_options( {
-    argv            => [],
-    mode            => q{configure},
-} );
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-
-# mock no Macports-default directories
-$step->{ports_root} = File::Spec->catdir( qw( / my ridiculous foobar ) );
-ok($step->runstep($conf), "runstep() returned true value");
-is($step->result(), 'no', "Got expected result");
-
-$conf->replenish($serialized);
-
-########## Darwin with Macports ##########
-
-($args, $step_list_ref) = process_options( {
-    argv            => [],
-    mode            => q{configure},
-} );
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-my $cwd = cwd();
-
-my $tdir = tempdir( CLEANUP => 1 );
-$step->{ports_root} = $tdir;
-ok(chdir $tdir, "Able to change to temporary directory");
-ok( (mkdir 'lib'), "Able to make lib directory");
-ok( (mkdir 'include'), "Able to make include directory");
-
-ok($step->runstep($conf), "runstep() returned true value");
-is($step->result(), q{yes}, "Got expected result");
-
-is($conf->data->get('ports_base_dir'), $tdir,
-    "ports base directory set as expected");
-is($conf->data->get('ports_lib_dir'), qq{$tdir/lib},
-    "ports 'lib' directory set as expected");
-is($conf->data->get('ports_include_dir'), qq{$tdir/include},
-    "ports 'include' directory set as expected");
-
-ok(chdir $cwd, "Able to change back to original directory after testing");
-
-$conf->replenish($serialized);
-
-########## not Darwin; --verbose ##########
-
-($args, $step_list_ref) = process_options( {
-    argv            => [ q{--verbose} ],
-    mode            => q{configure},
-} );
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-# mock not Darwin
-my $osname = 'foobar';
-$conf->data->set_p5( 'OSNAME' => $osname );
-{
-    my ($stdout, $stderr);
-    my $ret = capture sub { $step->runstep($conf) }, \$stdout, \$stderr;
-    ok($ret, "runstep() returned true value");
-    is($step->result(), q{skipped}, "Got expected result for non-Darwin OS");
-    like(
-        $stdout,
-        qr/^Operating system is $osname; Macports is Darwin only/,
-        "Got expected verbose output"
-    );
-}
-
-$conf->replenish($serialized);
-
-########## Darwin; --verbose; no Macports ##########
-
-($args, $step_list_ref) = process_options( {
-    argv            => [ q{--verbose} ],
-    mode            => q{configure},
-} );
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-# mock no Macports-default directories
-$step->{ports_root} = File::Spec->catdir( qw( / my ridiculous foobar ) );
-SKIP: {
-    skip 'Macports is Darwin only', 3 unless $^O =~ /darwin/;
-    my ($stdout, $stderr);
-    my $ret = capture sub { $step->runstep($conf) }, \$stdout, \$stderr;
-    ok($ret, "runstep() returned true value");
-    is($step->result(), 'no', "Got expected result");
-    like(
-        $stdout,
-        qr/^Could not locate Macports directories/,
-        "Got expected verbose output"
-    );
-}
-$step->{ports_root} = undef; # prepare for next test
-
-$conf->replenish($serialized);
-
-########## Darwin; defective Macports ##########
-
-($args, $step_list_ref) = process_options( {
-    argv            => [ ],
-    mode            => q{configure},
-} );
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-# mock no Macports root directory
-SKIP: {
-    skip 'Macports is Darwin only', 2 unless $^O =~ /darwin/;
-    $step->{ports_root} = undef;
-    ok($step->runstep($conf), "runstep() returned true value");
-    is($step->result(), 'no', "Got expected result");
-}
-
-$conf->replenish($serialized);
-
-########## Darwin; --verbose; defective Macports ##########
-
-($args, $step_list_ref) = process_options( {
-    argv            => [ q{--verbose} ],
-    mode            => q{configure},
-} );
-$conf->options->set(%{$args});
-$step = test_step_constructor_and_description($conf);
-# mock no Macports root directory
-$step->{ports_root} = undef;
-
-my ($stdout, $stderr);
-my $ret = capture sub { $step->runstep($conf) }, \$stdout, \$stderr;
-ok($ret, "runstep() returned true value");
-is($step->result(), 'no', "Got expected result");
-like(
-    $stdout,
-    qr/^Could not locate Macports root directory/,
-    "Got expected verbose output"
-);
-
-pass("Completed all tests in $0");
-
-################### DOCUMENTATION ###################
-
-=head1 NAME
-
-auto/macports-01.t - test auto::macports
-
-=head1 SYNOPSIS
-
-    % prove t/steps/auto/macports-01.t
-
-=head1 DESCRIPTION
-
-The files in this directory test functionality used by F<Configure.pl>.
-
-The tests in this file test auto::macports.  Some tests run only on Darwin.
-Others simulate what happens on operating systems other than Darwin.
-
-=head1 AUTHOR
-
-James E Keenan
-
-=head1 SEE ALSO
-
-config::auto::macports, F<Configure.pl>.
-
-=cut
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
-

Deleted: branches/orderedhash_revamp/t/steps/auto/macports-02.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/macports-02.t	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,77 +0,0 @@
-#! perl
-# Copyright (C) 2007, Parrot Foundation.
-# $Id$
-# auto/macports-02.t
-
-use strict;
-use warnings;
-use Test::More;
-plan( skip_all => 'Macports is Darwin only' ) unless $^O =~ /darwin/;
-plan( tests => 12 );
-use Carp;
-use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
-$ENV{TEST_MACPORTS} = 'foobar';
-use_ok('config::auto::macports');
-
-use Parrot::Configure;
-use Parrot::Configure::Options qw( process_options );
-use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    test_step_constructor_and_description
-);
-
-my ($args, $step_list_ref) = process_options( {
-    argv            => [],
-    mode            => q{configure},
-} );
-
-my $conf = Parrot::Configure->new();
-
-test_step_thru_runstep($conf, q{init::defaults}, $args);
-
-my $pkg = q{auto::macports};
-
-$conf->add_steps($pkg);
-$conf->options->set(%{$args});
-my $step = test_step_constructor_and_description($conf);
-
-# mock no Macports-default directories
-ok($step->runstep($conf), "runstep() returned true value");
-is($step->result(), 'no', "Got expected result");
-
-pass("Completed all tests in $0");
-
-################### DOCUMENTATION ###################
-
-=head1 NAME
-
-auto/macports-02.t - test auto::macports
-
-=head1 SYNOPSIS
-
-    % prove t/steps/auto/macports-02.t
-
-=head1 DESCRIPTION
-
-The files in this directory test functionality used by F<Configure.pl>.
-
-The tests in this file test auto::macports.
-
-=head1 AUTHOR
-
-James E Keenan
-
-=head1 SEE ALSO
-
-config::auto::macports, F<Configure.pl>.
-
-=cut
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
-

Modified: branches/orderedhash_revamp/t/steps/auto/memalign-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/memalign-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/memalign-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,16 +5,13 @@
 
 use strict;
 use warnings;
-use Test::More tests => 69;
+use Test::More tests => 58;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::auto::memalign');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw| capture |;
@@ -28,12 +25,11 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $serialized = $conf->pcfreeze();
 
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
-
 my $pkg = q{auto::memalign};
 
 $conf->add_steps($pkg);
@@ -58,7 +54,7 @@
         mode => q{configure},
     }
 );
-rerun_defaults_for_testing($conf, $args );
+
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 $step = test_step_constructor_and_description($conf);
@@ -162,7 +158,7 @@
         mode => q{configure},
     }
 );
-rerun_defaults_for_testing($conf, $args );
+
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 $step = test_step_constructor_and_description($conf);

Modified: branches/orderedhash_revamp/t/steps/auto/msvc-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/msvc-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/msvc-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,15 +5,13 @@
 
 use strict;
 use warnings;
-use Test::More tests => 43;
+use Test::More tests => 38;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::auto::msvc');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw| capture |;
@@ -25,9 +23,8 @@
     mode            => q{configure},
 } );
 
-my $conf = Parrot::Configure->new();
-
-test_step_thru_runstep($conf, q{init::defaults}, $args);
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{auto::msvc};
 

Modified: branches/orderedhash_revamp/t/steps/auto/neg_0-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/neg_0-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/neg_0-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,20 +5,13 @@
 
 use strict;
 use warnings;
-
-use Test::More tests => 31;
+use Test::More tests => 23;
 use Carp;
-
 use lib qw( lib t/configure/testlib );
-
-use_ok('config::init::defaults');
 use_ok('config::auto::neg_0');
-
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
 use IO::CaptureOutput 'capture';
@@ -32,9 +25,9 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
-test_step_thru_runstep( $conf, 'init::defaults', $args );
 my $pkg = 'auto::neg_0';
 
 $conf->add_steps($pkg);
@@ -87,7 +80,7 @@
     argv => [ q{--verbose} ],
     mode => q{configure},
 } );
-rerun_defaults_for_testing($conf, $args );
+
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 $step = test_step_constructor_and_description($conf);

Modified: branches/orderedhash_revamp/t/steps/auto/opengl-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/opengl-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/opengl-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,16 +5,13 @@
 
 use strict;
 use warnings;
-use Test::More tests => 43;
+use Test::More tests => 32;
 use Carp;
 use lib qw( lib );
-use_ok('config::init::defaults');
 use_ok('config::auto::opengl');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw| capture |;
@@ -28,12 +25,11 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $serialized = $conf->pcfreeze();
 
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
-
 my $pkg = q{auto::opengl};
 
 $conf->add_steps($pkg);
@@ -54,7 +50,6 @@
         mode => q{configure},
     }
 );
-rerun_defaults_for_testing($conf, $args );
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 $step = test_step_constructor_and_description($conf);
@@ -131,7 +126,6 @@
         mode => q{configure},
     }
 );
-rerun_defaults_for_testing($conf, $args );
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 $step = test_step_constructor_and_description($conf);

Modified: branches/orderedhash_revamp/t/steps/auto/ops-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/ops-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/ops-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -9,10 +9,9 @@
 use Carp;
 use lib qw( lib t/configure/testlib );
 use_ok('config::auto::ops');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 
@@ -25,7 +24,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{auto::ops};
 

Modified: branches/orderedhash_revamp/t/steps/auto/pcre-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/pcre-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/pcre-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,16 +5,13 @@
 
 use strict;
 use warnings;
-use Test::More tests => 34;
+use Test::More tests => 23;
 use Carp;
 use lib qw( lib );
-use_ok('config::init::defaults');
 use_ok('config::auto::pcre');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw| capture |;
@@ -28,12 +25,11 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $serialized = $conf->pcfreeze();
 
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
-
 my $pkg = q{auto::pcre};
 
 $conf->add_steps($pkg);
@@ -52,7 +48,6 @@
     argv => [ ],
     mode => q{configure},
 } );
-rerun_defaults_for_testing($conf, $args );
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 $step = test_step_constructor_and_description($conf);
@@ -122,7 +117,6 @@
     argv => [ q{--verbose} ],
     mode => q{configure},
 } );
-rerun_defaults_for_testing($conf, $args );
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 $step = test_step_constructor_and_description($conf);

Modified: branches/orderedhash_revamp/t/steps/auto/perldoc-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/perldoc-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/perldoc-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,20 +5,16 @@
 
 use strict;
 use warnings;
-use Test::More tests => 32;
+use Test::More tests => 27;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::auto::perldoc');
 use Parrot::BuildUtil;
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
-use IO::CaptureOutput qw| capture |;
 
 ########## regular ##########
 
@@ -27,9 +23,8 @@
     mode            => q{configure},
 } );
 
-my $conf = Parrot::Configure->new();
-
-test_step_thru_runstep($conf, q{init::defaults}, $args);
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{auto::perldoc};
 

Modified: branches/orderedhash_revamp/t/steps/auto/pmc-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/pmc-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/pmc-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,18 +5,16 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  28;
+use Test::More tests =>  23;
 use Carp;
 use Cwd;
 use File::Path qw| mkpath |;
 use File::Temp qw| tempdir |;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::auto::pmc');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 
@@ -29,9 +27,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
-
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{auto::pmc};
 

Modified: branches/orderedhash_revamp/t/steps/auto/pod2man-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/pod2man-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/pod2man-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,20 +5,16 @@
 
 use strict;
 use warnings;
-use Test::More tests => 15;
+use Test::More tests => 10;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::auto::pod2man');
 use Parrot::BuildUtil;
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
-use IO::CaptureOutput qw| capture |;
 
 ########## regular ##########
 
@@ -27,9 +23,8 @@
     mode            => q{configure},
 } );
 
-my $conf = Parrot::Configure->new();
-
-test_step_thru_runstep($conf, q{init::defaults}, $args);
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{auto::pod2man};
 

Modified: branches/orderedhash_revamp/t/steps/auto/readline-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/readline-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/readline-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,18 +5,16 @@
 
 use strict;
 use warnings;
-use Test::More tests => 69;
+use Test::More tests =>  9;
 use Carp;
 use Cwd;
 use File::Spec;
 use File::Temp qw( tempdir );
 use lib qw( lib );
-use_ok('config::init::defaults');
 use_ok('config::auto::readline');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw | capture |;
@@ -30,9 +28,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
-
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{auto::readline};
 
@@ -92,221 +89,6 @@
 like($@, qr/_select_lib\(\) takes hashref/,
     "Bad argument to _select_lib correctly detected");
 
-########## _handle_darwin_for_fink() ##########
-
-my ($flagsbefore, $flagsafter);
-
-$osname = 'foobar';
-$flagsbefore = $conf->data->get( 'linkflags' );
-ok($step->_handle_darwin_for_fink($conf, $osname, 'readline/readline.h'),
-    "handle_darwin_for_fink() returned true value");
-$flagsafter = $conf->data->get( 'linkflags' );
-is($flagsbefore, $flagsafter, "No change in linkflags, as expected");
-
-my $cwd = cwd();
-{
-    my $tdir1 = tempdir( CLEANUP => 1 );
-    ok(chdir $tdir1, "Able to change to temporary directory");
-    ok( (mkdir 'lib'), "Able to make lib directory");
-    ok( (mkdir 'include'), "Able to make include directory");
-    my $libdir = File::Spec->catdir( $tdir1, 'lib' );
-    my $includedir = File::Spec->catdir( $tdir1, 'include' );
-    $conf->data->set('fink_lib_dir' => $libdir);
-    $conf->data->set('fink_include_dir' => $includedir);
-    $osname = 'darwin';
-    $flagsbefore = $conf->data->get( 'linkflags' );
-    ok($step->_handle_darwin_for_fink($conf, $osname, 'readline/readline.h'),
-        "handle_darwin_for_fink() returned true value");
-    $flagsafter = $conf->data->get( 'linkflags' );
-    is($flagsbefore, $flagsafter,
-        "No change in linkflags, as expected, where Fink lib and include directories exist but readline/readline.h does not");
-
-    ok(chdir $cwd, "Able to change back to original directory after testing");
-}
-
-{
-    my $tdir2 = tempdir( CLEANUP => 1 );
-    ok(chdir $tdir2, "Able to change to temporary directory");
-    ok( (mkdir 'lib'), "Able to make lib directory");
-    ok( (mkdir 'include'), "Able to make include directory");
-    ok( (mkdir 'include/readline'), "Able to make include/readline directory");
-    my $libdir = File::Spec->catdir( $tdir2, 'lib' );
-    my $includedir = File::Spec->catdir( $tdir2, 'include' );
-    $conf->data->set('fink_lib_dir' => $libdir);
-    $conf->data->set('fink_include_dir' => $includedir);
-    my $foo = File::Spec->catfile( $includedir, 'readline', 'readline.h' );
-    open my $FH, ">", $foo or croak "Could not open for writing";
-    print $FH "Hello world\n";
-    close $FH or croak "Could not close after writing";
-
-    $osname = 'darwin';
-    $flagsbefore = $conf->data->get( 'linkflags' );
-    ok($step->_handle_darwin_for_fink($conf, $osname, 'readline/readline.h'),
-        "handle_darwin_for_fink() returned true value");
-    $flagsafter = $conf->data->get( 'linkflags' );
-    isnt($flagsbefore, $flagsafter, "Change in linkflags, as expected");
-    like($conf->data->get( 'linkflags' ), qr/-L\Q$libdir\E/,
-        "'linkflags' modified as expected, in case where Fink lib and include dirs exist and readline/readline.h exists");
-    $conf->data->set( linkflags => $flagsbefore ); #reset for next test
-
-    ok(chdir $cwd, "Able to change back to original directory after testing");
-}
-
-{
-    my $tdir3 = tempdir( CLEANUP => 1 );
-    ok(chdir $tdir3, "Able to change to temporary directory");
-    ok( (mkdir 'lib'), "Able to make lib directory");
-    ok( (mkdir 'include'), "Able to make include directory");
-    ok( (mkdir 'include/readline'), "Able to make include/readline directory");
-    my $libdir = File::Spec->catdir( $tdir3, 'lib' );
-    my $includedir = File::Spec->catdir( $tdir3, 'include' );
-    $conf->data->set('fink_lib_dir' => $libdir);
-    $conf->data->set('fink_include_dir' => undef);
-
-    $osname = 'darwin';
-    $flagsbefore = $conf->data->get( 'linkflags' );
-    ok($step->_handle_darwin_for_fink($conf, $osname, 'readline/readline.h'),
-        "handle_darwin_for_fink() returned true value");
-    $flagsafter = $conf->data->get( 'linkflags' );
-    is($flagsbefore, $flagsafter,
-        "No change in linkflags, as expected, where Fink include directory does not exist");
-
-    ok(chdir $cwd, "Able to change back to original directory after testing");
-}
-
-{
-    my $tdir4 = tempdir( CLEANUP => 1 );
-    ok(chdir $tdir4, "Able to change to temporary directory");
-    ok( (mkdir 'lib'), "Able to make lib directory");
-    ok( (mkdir 'include'), "Able to make include directory");
-    ok( (mkdir 'include/readline'), "Able to make include/readline directory");
-    my $libdir = File::Spec->catdir( $tdir4, 'lib' );
-    my $includedir = File::Spec->catdir( $tdir4, 'include' );
-    $conf->data->set('fink_lib_dir' => undef );
-    $conf->data->set('fink_include_dir' => $includedir );
-
-    $osname = 'darwin';
-    $flagsbefore = $conf->data->get( 'linkflags' );
-    ok($step->_handle_darwin_for_fink($conf, $osname, 'readline/readline.h'),
-        "handle_darwin_for_fink() returned true value");
-    $flagsafter = $conf->data->get( 'linkflags' );
-    is($flagsbefore, $flagsafter,
-        "No change in linkflags, as expected, where Fink lib directory does not exist");
-
-    ok(chdir $cwd, "Able to change back to original directory after testing");
-}
-
-########## _handle_darwin_for_macports() ##########
-
-$osname = 'foobar';
-$flagsbefore = $conf->data->get( 'linkflags' );
-ok($step->_handle_darwin_for_macports($conf, $osname, 'readline/readline.h'),
-    "handle_darwin_for_macports() returned true value");
-$flagsafter = $conf->data->get( 'linkflags' );
-is($flagsbefore, $flagsafter, "No change in linkflags, as expected");
-# Get ready for the next test
-$conf->data->set( linkflags => $flagsbefore );
-
-$cwd = cwd();
-{
-    my $xtdir1 = File::Spec->canonpath( tempdir( CLEANUP => 1 ) );
-    ok(chdir $xtdir1, "Able to change to temporary directory");
-    ok( (mkdir 'lib'), "Able to make lib directory");
-    ok( (mkdir 'include'), "Able to make include directory");
-    my $libdir = File::Spec->catdir( $xtdir1, 'lib' );
-    my $includedir = File::Spec->catdir( $xtdir1, 'include' );
-    $conf->data->set( ports_base_dir => $xtdir1 );
-    $conf->data->set( ports_lib_dir => $libdir );
-    $conf->data->set( ports_include_dir => $includedir );
-    ok( (mkdir 'include/readline'), "Able to make include/readline directory");
-    $osname = 'darwin';
-    $flagsbefore = $conf->data->get( 'linkflags' );
-    ok($step->_handle_darwin_for_macports($conf, $osname, 'readline/readline.h'),
-        "handle_darwin_for_macports() returned true value");
-    $flagsafter = $conf->data->get( 'linkflags' );
-    is($flagsbefore, $flagsafter,
-        "No change in linkflags, as expected, where macports lib and include directories exist but readline/readline.h does not");
-
-    chdir $cwd or croak "Unable to change back to original directory";
-}
-
-$cwd = cwd();
-{
-    my $xtdir2 = File::Spec->canonpath( tempdir( CLEANUP => 1 ) );
-    ok(chdir $xtdir2, "Able to change to temporary directory");
-    ok( (mkdir 'lib'), "Able to make lib directory");
-    ok( (mkdir 'include'), "Able to make include directory");
-    my $libdir = File::Spec->catdir( $xtdir2, 'lib' );
-    my $includedir = File::Spec->catdir( $xtdir2, 'include' );
-    $conf->data->set( ports_base_dir => $xtdir2 );
-    $conf->data->set( ports_lib_dir => $libdir );
-    $conf->data->set( ports_include_dir => $includedir );
-    ok( (mkdir 'include/readline'), "Able to make include/readline directory");
-    my $foo = File::Spec->catfile( $includedir, 'readline', 'readline.h' );
-    open my $FH, ">", $foo or croak "Could not open for writing";
-    print $FH "Hello world\n";
-    close $FH or croak "Could not close after writing";
-
-    $osname = 'darwin';
-    $flagsbefore = $conf->data->get( 'linkflags' );
-    ok($step->_handle_darwin_for_macports($conf, $osname, 'readline/readline.h'),
-        "handle_darwin_for_macports() returned true value");
-    $flagsafter = $conf->data->get( 'linkflags' );
-    isnt($flagsbefore, $flagsafter, "Change in linkflags, as expected");
-    like($conf->data->get( 'linkflags' ), qr/-L\Q$libdir\E/,
-        "'linkflags' modified as expected, in case where macports lib and include dirs exist and readline/readline.h exists");
-    $conf->data->set( linkflags => $flagsbefore );
-
-    chdir $cwd or croak "Unable to change back to original directory";
-}
-
-
-$cwd = cwd();
-{
-    my $xtdir3 = File::Spec->canonpath( tempdir( CLEANUP => 1 ) );
-    ok(chdir $xtdir3, "Able to change to temporary directory");
-    ok( (mkdir 'lib'), "Able to make lib directory");
-    ok( (mkdir 'include'), "Able to make include directory");
-    my $libdir = File::Spec->catdir( $xtdir3, 'lib' );
-    my $includedir = File::Spec->catdir( $xtdir3, 'include' );
-    $conf->data->set( ports_base_dir => $xtdir3 );
-    $conf->data->set( ports_lib_dir => $libdir );
-    $conf->data->set( ports_include_dir => undef );
-
-    $osname = 'darwin';
-    $flagsbefore = $conf->data->get( 'linkflags' );
-    ok($step->_handle_darwin_for_macports($conf, $osname, 'readline/readline.h'),
-        "handle_darwin_for_macports() returned true value");
-    $flagsafter = $conf->data->get( 'linkflags' );
-    is($flagsbefore, $flagsafter,
-        "No change in linkflags, as expected, where Macports include directory does not exist");
-
-    chdir $cwd or croak "Unable to change back to original directory";
-}
-
-$cwd = cwd();
-{
-    my $xtdir4 = File::Spec->canonpath( tempdir( CLEANUP => 1 ) );
-    ok(chdir $xtdir4, "Able to change to temporary directory");
-    ok( (mkdir 'lib'), "Able to make lib directory");
-    ok( (mkdir 'include'), "Able to make include directory");
-    my $libdir = File::Spec->catdir( $xtdir4, 'lib' );
-    my $includedir = File::Spec->catdir( $xtdir4, 'include' );
-    $conf->data->set( ports_base_dir => $xtdir4 );
-    $conf->data->set( ports_lib_dir => undef );
-    $conf->data->set( ports_include_dir => $includedir );
-
-    $osname = 'darwin';
-    $flagsbefore = $conf->data->get( 'linkflags' );
-    ok($step->_handle_darwin_for_macports($conf, $osname, 'readline/readline.h'),
-        "handle_darwin_for_macports() returned true value");
-    $flagsafter = $conf->data->get( 'linkflags' );
-    is($flagsbefore, $flagsafter,
-        "No change in linkflags, as expected, where Macports lib directory does not exist");
-
-    chdir $cwd or croak "Unable to change back to original directory";
-}
-
 pass("Completed all tests in $0");
 
 ################### DOCUMENTATION ###################

Modified: branches/orderedhash_revamp/t/steps/auto/readline-02.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/readline-02.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/readline-02.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -10,10 +10,9 @@
 use Cwd;
 use lib qw( lib );
 use_ok('config::auto::readline');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw| capture |;
@@ -25,7 +24,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{auto::readline};
 

Modified: branches/orderedhash_revamp/t/steps/auto/revision-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/revision-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/revision-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -9,10 +9,9 @@
 use Carp;
 use lib qw( lib t/configure/testlib );
 use_ok('config::auto::revision');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 
@@ -25,7 +24,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{auto::revision};
 

Modified: branches/orderedhash_revamp/t/steps/auto/signal-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/signal-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/signal-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,18 +5,15 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  35;
+use Test::More tests =>  27;
 use Carp;
 use Cwd;
 use File::Temp qw(tempdir);
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::auto::signal');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw| capture |;
@@ -28,12 +25,11 @@
     mode => q{configure},
 } );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $serialized = $conf->pcfreeze();
 
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
-
 my $pkg = q{auto::signal};
 
 $conf->add_steps($pkg);
@@ -83,7 +79,7 @@
     argv => [ q{--verbose} ],
     mode => q{configure},
 } );
-rerun_defaults_for_testing($conf, $args );
+
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 $step = test_step_constructor_and_description($conf);

Modified: branches/orderedhash_revamp/t/steps/auto/sizes-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/sizes-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/sizes-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,16 +5,13 @@
 
 use strict;
 use warnings;
-use Test::More tests => 58;
+use Test::More tests => 53;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::auto::sizes');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw | capture |;
@@ -29,12 +26,11 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $serialized = $conf->pcfreeze();
 
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
-
 my $pkg = q{auto::sizes};
 
 $conf->add_steps($pkg);

Modified: branches/orderedhash_revamp/t/steps/auto/snprintf-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/snprintf-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/snprintf-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,18 +5,13 @@
 
 use strict;
 use warnings;
-use Test::More tests => 33;
+use Test::More tests => 18;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
-use_ok('config::init::hints');
-use_ok('config::auto::attributes');
 use_ok('config::auto::snprintf');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw| capture |;
@@ -28,11 +23,8 @@
     mode            => q{configure},
 } );
 
-my $conf = Parrot::Configure->new();
-
-test_step_thru_runstep($conf, q{init::defaults}, $args);
-test_step_thru_runstep($conf, q{init::hints}, $args);
-test_step_thru_runstep($conf, q{auto::attributes}, $args);
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{auto::snprintf};
 

Modified: branches/orderedhash_revamp/t/steps/auto/socklen_t-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/socklen_t-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/socklen_t-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -9,11 +9,9 @@
 use Carp;
 use lib qw( lib t/configure/testlib );
 use_ok('config::auto::socklen_t');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw| capture |;
@@ -27,7 +25,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{auto::socklen_t};
 

Modified: branches/orderedhash_revamp/t/steps/auto/thread-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/thread-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/thread-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -8,14 +8,11 @@
 use Carp;
 use lib qw( lib t/configure/testlib );
 use_ok('config::auto::thread');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
-use IO::CaptureOutput qw( capture );
 
 ########## --without-threads ##########
 
@@ -26,7 +23,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{auto::thread};
 

Modified: branches/orderedhash_revamp/t/steps/auto/va_ptr-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/va_ptr-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/va_ptr-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -9,10 +9,9 @@
 use Carp;
 use lib qw( lib t/configure/testlib );
 use_ok('config::auto::va_ptr');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 
@@ -23,7 +22,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{auto::va_ptr};
 $conf->add_steps($pkg);

Modified: branches/orderedhash_revamp/t/steps/auto/warnings-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/auto/warnings-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/auto/warnings-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,17 +5,13 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  56;
+use Test::More tests =>  41;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
-use_ok('config::init::hints');
-use_ok('config::inter::progs');
 use_ok('config::auto::warnings');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw | capture |;
@@ -27,11 +23,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
-
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
-test_step_thru_runstep( $conf, q{init::hints}, $args );
-test_step_thru_runstep( $conf, q{inter::progs}, $args );
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{auto::warnings};
 

Modified: branches/orderedhash_revamp/t/steps/gen/call_list-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/gen/call_list-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/gen/call_list-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -9,10 +9,9 @@
 use Carp;
 use lib qw( lib );
 use_ok('config::gen::call_list');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 
@@ -25,7 +24,9 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
+
 my $pkg = q{gen::call_list};
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );

Modified: branches/orderedhash_revamp/t/steps/gen/config_h-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/gen/config_h-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/gen/config_h-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -11,11 +11,9 @@
 use File::Temp qw( tempdir );
 use lib qw( lib );
 use_ok('config::gen::config_h');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
 use Parrot::Configure::Utils qw( _slurp );
@@ -29,7 +27,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $serialized = $conf->pcfreeze();
 

Modified: branches/orderedhash_revamp/t/steps/gen/config_pm-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/gen/config_pm-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/gen/config_pm-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -9,10 +9,9 @@
 use Carp;
 use lib qw( lib t/configure/testlib );
 use_ok('config::gen::config_pm');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 
@@ -25,7 +24,9 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
+
 my $pkg = q{gen::config_pm};
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );

Modified: branches/orderedhash_revamp/t/steps/gen/core_pmcs-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/gen/core_pmcs-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/gen/core_pmcs-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,16 +5,14 @@
 
 use strict;
 use warnings;
-use Test::More tests => 16;
+use Test::More tests =>  7;
 use Carp;
 use lib qw( lib );
-use_ok('init::defaults');
 use_ok('auto::pmc');
 use_ok('config::gen::core_pmcs');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 
@@ -27,9 +25,9 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
-test_step_thru_runstep( $conf, q{auto::pmc}, $args );
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
+
 my $pkg = q{gen::core_pmcs};
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );

Modified: branches/orderedhash_revamp/t/steps/gen/crypto-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/gen/crypto-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/gen/crypto-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -9,11 +9,9 @@
 use Carp;
 use lib qw( lib );
 use_ok('config::gen::crypto');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
 
@@ -26,7 +24,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $serialized = $conf->pcfreeze();
 

Modified: branches/orderedhash_revamp/t/steps/gen/makefiles-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/gen/makefiles-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/gen/makefiles-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -83,10 +83,9 @@
 
 use_ok('config::gen::makefiles');
 
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 
@@ -99,7 +98,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new();
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 my $pkg  = 'gen::makefiles';
 
 $conf->add_steps($pkg);

Modified: branches/orderedhash_revamp/t/steps/gen/opengl-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/gen/opengl-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/gen/opengl-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,14 +5,13 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  5;
+use Test::More tests =>  7;
 use Carp;
 use lib qw( lib );
 use_ok('config::gen::opengl');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 
@@ -25,12 +24,20 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
+
 my $pkg = q{gen::opengl};
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 my $step = test_step_constructor_and_description($conf);
 
+##### mock no OpenGL #####
+$conf->data->set( has_opengl => 0 );
+my $result = $step->runstep($conf);
+ok($result, "runstep() returned true value");
+is($step->result(), q{skipped}, "Got expected result when no 'has_opengl'" );
+
 pass("Completed all tests in $0");
 
 ################### DOCUMENTATION ###################

Modified: branches/orderedhash_revamp/t/steps/gen/parrot_include-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/gen/parrot_include-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/gen/parrot_include-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -9,10 +9,9 @@
 use Carp;
 use lib qw( lib );
 use_ok('config::gen::parrot_include');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 
@@ -25,7 +24,9 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
+
 my $pkg = q{gen::parrot_include};
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );

Modified: branches/orderedhash_revamp/t/steps/gen/platform-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/gen/platform-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/gen/platform-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,7 +5,7 @@
 
 use strict;
 use warnings;
-use Test::More tests => 19;
+use Test::More tests => 13;
 use Carp;
 use Cwd;
 use File::Copy;
@@ -14,10 +14,9 @@
 use File::Spec;
 use lib qw( lib );
 use_ok('config::gen::platform');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 use Parrot::Configure::Utils qw( _slurp );
@@ -32,7 +31,9 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
+
 my $pkg = q{gen::platform};
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
@@ -41,52 +42,11 @@
 ok(-f $step->{platform_interface},
     "Located required platform interface header");
 
-my $platform_orig = $conf->data->get_p5('OSNAME');
-my $archname_orig = $conf->data->get_p5('archname');
-$conf->data->set_p5( archname => 'foo-bar' );
+my $platform_orig = $conf->data->get('osname');
+my $archname_orig = $conf->data->get('archname');
+$conf->data->set( archname => 'foo-bar' );
 my $verbose = 0;
 
-########## _get_platform() ##########
-
-$conf->data->set_p5( OSNAME => 'msys' );
-is( $step->_get_platform( $conf, $verbose ), q{win32},
-    "Got expected platform for msys");
-
-$conf->data->set_p5( OSNAME => 'mingw' );
-is( $step->_get_platform( $conf, $verbose ), q{win32},
-    "Got expected platform for mingw");
-
-$conf->data->set_p5( OSNAME => 'MSWin32' );
-is( $step->_get_platform( $conf, $verbose ), q{win32},
-    "Got expected platform for MSWin32");
-
-# re-set to original values
-$conf->data->set_p5( OSNAME => $platform_orig );
-$conf->data->set_p5( archname => $archname_orig );
-
-$conf->data->set_p5( archname => 'ia64-bar' );
-is( $step->_get_platform( $conf, $verbose ), q{ia64},
-    "Got expected platform for ia64");
-
-$conf->data->set_p5( archname => 'foo-bar' );
-$conf->data->set_p5( OSNAME => 'foo' );
-{
-    $verbose = 1;
-    my ($stdout, $stderr, $rv);
-    my $expected = q{generic};
-    capture(
-        sub { $rv = $step->_get_platform( $conf, $verbose ) },
-        \$stdout,
-        \$stderr,
-    );
-    is( $rv, $expected, "Got expected platform for foo");
-    like( $stdout, qr/platform='$expected'/, "Got expected verbose output");
-}
-
-# re-set to original values
-$conf->data->set_p5( archname => $archname_orig );
-$conf->data->set_p5( OSNAME => $platform_orig );
-
 ########## _get_generated() ##########
 
 my $TEMP_generated_orig = $conf->data->get('TEMP_generated');
@@ -120,12 +80,13 @@
     chdir $tdir or croak "Unable to change to temporary directory";
     $conf->data->set( platform_asm => 1 );
     my $platform = 'aix';
+    $conf->data->set( platform => $platform );
     mkpath( 'src', { mode => 0755 } ) or croak "Unable to make testing directory";
     my $asmfile = File::Spec->catfile( 'src', 'platform_asm.s' );
     open my $FH, '>', $asmfile or croak "Unable to open handle for writing";
     print $FH "Hello asm\n";
     close $FH or croak "Unable to close handle after writing";
-    $step->_handle_asm($conf, $platform);
+    $step->_handle_asm($conf);
     my $text = _slurp( $asmfile );
     like($text, qr/Hello asm/s, "File unchanged, as expected");
 
@@ -133,14 +94,17 @@
 }
 # re-set to original values
 $conf->data->set( platform_asm => $platform_asm_orig );
+$conf->data->set( platform     => $platform_orig );
 
 {
     my $tdir = tempdir( CLEANUP => 1 );
     chdir $tdir or croak "Unable to change to temporary directory";
     $conf->data->set( platform_asm => 1 );
     my $platform = 'aix';
+    $conf->data->set( platform => $platform );
 
-    mkpath( 'src', { mode => 0755 } ) or croak "Unable to make testing directory";
+    mkpath( 'src', { mode => 0755 } )
+        or croak "Unable to make testing directory";
 
     my $asmfile = File::Spec->catfile( 'src', 'platform_asm.s' );
     open my $FH, '>', $asmfile or croak "Unable to open handle for writing";
@@ -148,14 +112,15 @@
     close $FH or croak "Unable to close handle after writing";
 
     my $path = File::Spec->catdir( 'config', 'gen', 'platform', $platform );
-    mkpath( $path, { mode => 0755 } ) or croak "Unable to make testing directory";
+    mkpath( $path, { mode => 0755 } )
+        or croak "Unable to make testing directory";
 
     my $configfile = File::Spec->catfile( $path, 'asm.s' );
     open my $FH2, '>', $configfile or croak "Unable to open handle for writing";
     print $FH2 "Goodbye world\n";
     close $FH2 or croak "Unable to close handle after writing";
 
-    $step->_handle_asm($conf, $platform);
+    $step->_handle_asm($conf);
 
     my $text = _slurp( $asmfile );
     like($text, qr/Goodbye world/s, "File changed, as expected");
@@ -164,12 +129,14 @@
 }
 # re-set to original values
 $conf->data->set( platform_asm => $platform_asm_orig );
+$conf->data->set( platform     => $platform_orig );
 
 ########## _handle_begin_c() ##########
 {
     my $tdir = tempdir( CLEANUP => 1 );
     chdir $tdir or croak "Unable to change to temporary directory";
     my $platform = 'darwin';
+    $conf->data->set( platform => $platform );
 
     my $path = File::Spec->catdir( 'config', 'gen', 'platform', $platform );
     mkpath( $path, { mode => 0755 } ) or croak "Unable to make testing directory";

Modified: branches/orderedhash_revamp/t/steps/init/headers-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/init/headers-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/init/headers-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -13,10 +13,12 @@
 use Tie::File;
 use lib qw( lib );
 use_ok('config::init::headers');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
+use Parrot::Configure::Test qw(
+    test_step_constructor_and_description
+);
 
-my $pkg  = q{init::headers};
 my ($args, $step_list_ref) = process_options(
     {
         argv => [],
@@ -24,17 +26,14 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
+
+my $pkg  = q{init::headers};
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
 
-my $task        = $conf->steps->[-1];
-my $step_name   = $task->step;
-
-my $step = $step_name->new();
-ok( defined $step, "$step_name constructor returned defined value" );
-isa_ok( $step, $step_name );
-ok( $step->description(), "$step_name has description" );
+my $step = test_step_constructor_and_description($conf);
 
 my $cwd = cwd();
 {

Modified: branches/orderedhash_revamp/t/steps/init/hints-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/init/hints-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/init/hints-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,19 +5,17 @@
 
 use strict;
 use warnings;
-use Test::More tests => 26;
+use Test::More tests => 21;
 use Carp;
 use Cwd;
 use File::Path ();
 use File::Spec::Functions qw/catfile/;
 use File::Temp qw(tempdir);
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::init::hints');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw | capture |;
@@ -31,9 +29,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
-
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{init::hints};
 
@@ -152,8 +149,8 @@
 $step = test_step_constructor_and_description($conf);
 {
     my ($stdout, $stderr, $ret);
-    $conf->data->set_p5( OSNAME => q{imaginaryOS} );
-    my $osname = lc( $conf->data->get_p5( 'OSNAME' ) );
+    $conf->data->set( OSNAME_provisional => q{imaginaryOS} );
+    my $osname = lc( $conf->data->get( 'OSNAME_provisional' ) );
     my $hints_file = catfile('config', 'init', 'hints', "$osname.pm");
     capture (
         sub { $ret = $step->runstep($conf); },

Modified: branches/orderedhash_revamp/t/steps/init/hints/darwin-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/init/hints/darwin-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/init/hints/darwin-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,9 +5,389 @@
 
 use strict;
 use warnings;
-use Test::More; # tests => 26;
+use Cwd;
+use File::Temp qw( tempdir );
+use Test::More;
 plan( skip_all => 'only needs testing on Darwin' ) unless $^O =~ /darwin/i;
-plan( tests =>  1 );
+plan( tests =>  36 );
+
+use lib qw( lib t/configure/testlib );
+use_ok('config::init::hints');
+use_ok('config::init::hints::darwin');
+use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
+use Parrot::Configure::Test qw(
+    test_step_constructor_and_description
+);
+use IO::CaptureOutput qw | capture |;
+
+my $cwd = cwd();
+my ($args, $step_list_ref) = process_options(
+    {
+        argv => [],
+        mode => q{configure},
+    }
+);
+
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
+
+##### Tests of some internal subroutines #####
+
+##### _precheck() #####
+
+my $problematic_flag = 'ccflags';
+my $stored = $conf->data->get($problematic_flag);
+
+{
+    my ($stdout, $stderr);
+    capture(
+        sub { init::hints::darwin::_precheck(
+            $problematic_flag, $stored, 0
+        ) },
+        \$stdout,
+        \$stderr,
+    );
+    ok( ! $stdout, "_precheck():  Non-verbose mode produced no output" );
+}
+
+{
+    my ($stdout, $stderr);
+    capture(
+        sub { init::hints::darwin::_precheck(
+            $problematic_flag, $stored, 1
+        ) },
+        \$stdout,
+        \$stderr,
+    );
+    ok( $stdout, "_precheck():  Verbose mode produced output" );
+    like($stdout, qr/Checking\s+$problematic_flag/,
+        "_precheck():  Got expected verbose output" );
+    like($stdout, qr/Pre-check:\s+$stored/,
+        "_precheck():  Got expected verbose output" );
+}
+
+{
+    my ($stdout, $stderr);
+    capture(
+        sub { init::hints::darwin::_precheck(
+            $problematic_flag, q{}, 1
+        ) },
+        \$stdout,
+        \$stderr,
+    );
+    ok( $stdout, "_precheck():  Verbose mode produced output" );
+    like($stdout, qr/Checking\s+$problematic_flag/,
+        "_precheck():  Got expected verbose output" );
+    like($stdout, qr/Pre-check:\s+\(nil\)/,
+        "_precheck():  Got expected verbose output" );
+}
+
+##### _strip_arch_flags_engine #####
+
+{
+    my %defaults = (
+        architectures   => [ qw( i386 ppc64 ppc x86_64 ) ],
+    );
+    my $flagsref = {};
+    my $stored = q{-someflag  -arch i386 -someotherflag -arch ppc};
+    my $flag = q{ccflags};
+    $flagsref = init::hints::darwin::_strip_arch_flags_engine(
+      $defaults{architectures}, $stored, $flagsref, $flag
+    );
+    like(
+        $flagsref->{$flag}, 
+        qr{-someflag -someotherflag},
+        "_strip_arch_flags_engine(): '-arch' flags and extra whitespace removed",
+    );
+
+
+}
+
+##### _postcheck #####
+
+{
+    my $flag = 'ccflags';
+    my $flagsref = { 'ccflags' => 'my ccflag' };
+    my ($stdout, $stderr);
+
+    capture(
+        sub { init::hints::darwin::_postcheck(
+            $flagsref, $flag, 0
+        ) },
+        \$stdout,
+        \$stderr,
+    );
+    ok( ! $stdout, "_postcheck():  Non-verbose mode produced no output" );
+
+    capture(
+        sub { init::hints::darwin::_postcheck(
+            $flagsref, $flag, 1
+        ) },
+        \$stdout,
+        \$stderr,
+    );
+    ok( $stdout, "_postcheck():  Verbose mode produced output" );
+    like($stdout, qr/Post-check:\s+$flagsref->{$flag}/,
+        "_postcheck():  Got expected verbose output" );
+
+    $flagsref = { 'ccflags' => undef };
+    capture(
+        sub { init::hints::darwin::_postcheck(
+            $flagsref, $flag, 1
+        ) },
+        \$stdout,
+        \$stderr,
+    );
+    ok( $stdout, "_postcheck():  Verbose mode produced output" );
+    like($stdout, qr/Post-check:\s+\(nil\)/,
+        "_postcheck():  Got expected verbose output" );
+}
+
+##### _strip_arch_flags #####
+
+{
+    my %defaults = (
+        problem_flags   => [ qw( ccflags ldflags ) ],
+        architectures   => [ qw( i386 ppc64 ppc x86_64 ) ],
+    );
+    my $flagsref = {};
+    my $flag = q{ccflags};
+    my $oldflag = $conf->data->get( $flag );
+
+    my $stored = q{-someflag  -arch i386 -someotherflag -arch ppc};
+    $conf->data->set( $flag => $stored );
+
+    $flagsref = init::hints::darwin::_strip_arch_flags($conf, 0);
+    like($flagsref->{$flag},
+        qr/-someflag -someotherflag/,
+        "_strip_arch_flags(): '-arch' flags and extra whitespace removed",
+    );    
+
+    my ($stdout, $stderr);
+    capture(
+        sub {
+            $flagsref = init::hints::darwin::_strip_arch_flags($conf, 1);
+        },
+        \$stdout,
+        \$stderr,
+    );
+    like($flagsref->{$flag},
+        qr/-someflag -someotherflag/,
+        "_strip_arch_flags(): '-arch' flags and extra whitespace removed",
+    );
+    like(
+        $stdout,
+        qr/Stripping -arch flags due to Apple multi-architecture build problems:/,
+        "_strip_arch_flags(): Got expected verbose output",
+    );
+
+    $flag = q{ccflags};
+    $conf->data->set( $flag => undef );
+    $flagsref = init::hints::darwin::_strip_arch_flags($conf, 0);
+    is( $flagsref->{$flag}, q{},
+        "_strip_arch_flags():  Got empty flag when expected" );
+
+    $conf->data->set( $flag => $oldflag );
+}
+
+##### _strip_ldl_as_needed #####
+
+{
+    my $oldflag = $conf->data->get( 'libs ' );
+    my ( $major, $libs );
+
+    $major = '7.99.11';
+    local $init::hints::darwin::defaults{uname} = $major;
+    $conf->data->set( libs => '-somelib -ldl -someotherlib' );
+    $libs = init::hints::darwin::_strip_ldl_as_needed(
+        $conf->data->get( 'libs' )
+    );
+    like( $libs, qr/-somelib\s+-someotherlib/,
+        "_strip_ldl_as_needed(): '-ldl' stripped as expected" );
+
+    $major = '6.99.11';
+    local $init::hints::darwin::defaults{uname} = $major;
+    $conf->data->set( libs => '-somelib -ldl -someotherlib' );
+    $libs = init::hints::darwin::_strip_ldl_as_needed(
+        $conf->data->get( 'libs' )
+    );
+    like( $libs, qr/-somelib\s+-ldl\s+-someotherlib/,
+        "_strip_ldl_as_needed(): '-ldl' not stripped as expected in older darwin" );
+
+    $conf->data->set( libs => $oldflag );
+}
+
+##### _set_deployment_environment() #####
+
+{
+    my $predicted = '10.99';
+    local $ENV{'MACOSX_DEPLOYMENT_TARGET'} = undef;
+    no warnings 'once';
+    local $init::hints::darwin::defaults{sw_vers} = qq{$predicted.11};
+    use warnings;
+    init::hints::darwin::_set_deployment_environment();
+    is($ENV{'MACOSX_DEPLOYMENT_TARGET'}, $predicted,
+        "_set_deployment_environment(): MACOSX_DEPLOYMENT_TARGET set as expected");
+}
+
+##### _probe_for_fink() #####
+
+{
+    my $tdir = tempdir( CLEANUP => 1 );
+    chdir $tdir or die "Unable to change to temporary directory: $!";
+
+    local $init::hints::darwin::defaults{fink_conf} = qq{$tdir/fink.conf};
+    ok( ! defined( init::hints::darwin::_probe_for_fink( $conf ) ),
+        "_probe_for_fink(): returned undefined value for no config file" );
+    $conf->options->set( 'verbose' => 1 );
+    {
+        my ($stdout, $stderr);
+        capture(
+            sub { init::hints::darwin::_probe_for_fink( $conf ); },
+            \$stdout,
+            \$stderr,
+        );
+        like( $stdout, qr/Fink configuration file not located/,
+            "Got expected verbose output when Fink config not located" );
+    }
+    $conf->options->set( 'verbose' => 0 );
+
+    my $fink_conf_file = q{fink.conf};
+    open my $CONF, '>', $fink_conf_file
+        or die "Unable to open $fink_conf_file for writing: $!";
+    print $CONF "Hello, world, but no Fink info\n";
+    close $CONF or die "Unable to close $fink_conf_file after writing: $!";
+    ok( ! defined( init::hints::darwin::_probe_for_fink( $conf ) ),
+        "_probe_for_fink(): returned undefined value for defective config file" );
+
+    $conf->options->set( 'verbose' => 1 );
+    {
+        my ($stdout, $stderr);
+        capture(
+            sub { init::hints::darwin::_probe_for_fink( $conf ); },
+            \$stdout,
+            \$stderr,
+        );
+        like( $stdout, qr/Fink configuration file defective/,
+            "Got expected verbose output when Fink config was defective" );
+    }
+    $conf->options->set( 'verbose' => 0 );
+
+    my $other = qq{$tdir/other_fink.conf};
+    local $init::hints::darwin::defaults{fink_conf} = $other;
+    $fink_conf_file = $other;
+    open my $OCONF, '>', $fink_conf_file
+        or die "Unable to open $fink_conf_file for writing: $!";
+    print $OCONF "Basepath:  /tmp/foobar\n";
+    close $OCONF or die "Unable to close $fink_conf_file after writing: $!";
+    ok( ! defined( init::hints::darwin::_probe_for_fink( $conf ) ),
+        "_probe_for_fink(): returned undefined value for missing directories" );
+
+    $conf->options->set( 'verbose' => 1 );
+    {
+        my ($stdout, $stderr);
+        capture(
+            sub { init::hints::darwin::_probe_for_fink( $conf ); },
+            \$stdout,
+            \$stderr,
+        );
+        like( $stdout, qr/Could not locate Fink directories/,
+            "Got expected verbose output when Fink directories were missing" );
+    }
+    $conf->options->set( 'verbose' => 0 );
+
+    chdir $cwd or die "Unable to change back to starting directory: $!";
+}
+
+##### _probe_for_macports() #####
+
+{
+    my $tdir = tempdir( CLEANUP => 1 );
+    chdir $tdir or die "Unable to change to temporary directory: $!";
+
+    local $init::hints::darwin::defaults{ports_base_dir} = qq{$tdir/foobar};
+    ok( ! defined( init::hints::darwin::_probe_for_macports( $conf ) ),
+        "_probe_for_macports(): returned undefined value for no config file" );
+
+    $conf->options->set( 'verbose' => 1 );
+    {
+        my ($stdout, $stderr);
+        capture(
+            sub { init::hints::darwin::_probe_for_macports( $conf ); },
+            \$stdout,
+            \$stderr,
+        );
+        like( $stdout, qr/Could not locate Macports directories/,
+            "Got expected verbose output when Macports directories not found" );
+    }
+    $conf->options->set( 'verbose' => 0 );
+}
+
+##### _probe_for_libraries() #####
+
+{
+    $conf->options->set( 'darwin_no_fink' => 1 );
+    $conf->options->set( 'verbose' => 0 );
+    my $lib_dir = $conf->data->get('build_dir') . "/blib/lib";
+    my $flagsref = {};
+    $flagsref->{ldflags} .= " -L$lib_dir";
+    $flagsref->{ccflags} .= " -pipe -fno-common -Wno-long-double ";
+    $flagsref->{linkflags} .= " -undefined dynamic_lookup";
+    my %state_before = map { $_ => $flagsref->{$_} } keys %{ $flagsref };
+    ok( ! defined ( init::hints::darwin::_probe_for_libraries(
+        $conf, $flagsref, 'fink')
+    ), "_probe_for_libraries() returned undef as expected" );
+    is_deeply( $flagsref, { %state_before },
+        "No change in flags, as expected" );
+
+    $conf->options->set( 'darwin_no_fink' => 0 );
+}
+
+##### _add_to_flags() #####
+
+{
+    my ( $addl_flags_ref, $flagsref, $title, $verbose );
+    $addl_flags_ref = undef;
+    $flagsref = undef;
+    $title = 'Fink';
+    $verbose = 0;
+    ok( init::hints::darwin::_add_to_flags(
+        $addl_flags_ref, $flagsref, $title, $verbose
+    ), "_add_to_flags(): returned true value when no probes found" );
+
+    $verbose = 1;
+    {
+        my ($stdout, $stderr);
+        capture(
+            sub { init::hints::darwin::_add_to_flags(
+                $addl_flags_ref, $flagsref, $title, $verbose
+            ); },
+            \$stdout,
+            \$stderr,
+        );
+        like( $stdout, qr/Probe for $title unsuccessful/,
+            "_add_to_flags(): got expected verbose output when probe unsuccessful" );
+    }
+
+    $addl_flags_ref = {
+        ldflags   => "-Lfink_lib_dir",
+        ccflags   => "-Lfink_include_dir",
+        linkflags => "-Lfink_lib_dir",
+    };
+    my $lib_dir = $conf->data->get('build_dir') . "/blib/lib";
+    $flagsref = undef;
+    $flagsref->{ldflags} = " -L$lib_dir";
+    $flagsref->{ccflags} = " -pipe -fno-common -Wno-long-double ";
+    $flagsref->{linkflags} = undef;
+    $title = 'Fink';
+    $verbose = 0;
+    my $rv = init::hints::darwin::_add_to_flags(
+        $addl_flags_ref, $flagsref, $title, $verbose
+    );
+    is( $flagsref->{linkflags}, " $addl_flags_ref->{linkflags}",
+        "_add_to_flags():  flag added where not previously populated" );
+}
 
 pass("Completed all tests in $0");
 

Added: branches/orderedhash_revamp/t/steps/init/hints/linux-01.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/steps/init/hints/linux-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,93 @@
+#! perl
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+# init/hints/linux-01.t
+
+use strict;
+use warnings;
+use Cwd;
+use File::Temp qw( tempdir );
+use Test::More;
+plan( skip_all => 'only needs testing on Linux' ) unless $^O =~ /linux/i;
+plan( tests =>   6 );
+
+use lib qw( lib t/configure/testlib );
+use_ok('config::init::hints');
+use_ok('config::init::hints::linux');
+use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
+use Parrot::Configure::Test qw(
+    test_step_constructor_and_description
+);
+use IO::CaptureOutput qw | capture |;
+
+my $cwd = cwd();
+my ($args, $step_list_ref) = process_options(
+    {
+        argv => [],
+        mode => q{configure},
+    }
+);
+
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
+
+##### Tests of some internal subroutines #####
+
+##### _handle_icc_ccflags() #####
+
+my $ccflags = '';
+my $verbose = 0;
+$ccflags = init::hints::linux::_handle_icc_ccflags($ccflags, $verbose);
+like( $ccflags, qr/\s-wd269/, "On icc, 'cc_flags' set as expected" );
+
+$ccflags = '';
+$verbose = 1;
+{
+    my ($stdout, $stderr);
+    capture(
+        sub { $ccflags =
+            init::hints::linux::_handle_icc_ccflags($ccflags, $verbose); },
+        \$stdout,
+        \$stderr,
+    );
+    like( $ccflags, qr/\s-wd269/, "On icc, 'cc_flags' set as expected" );
+    like( $stdout,
+        qr/\sccflags:.*?-wd269/,
+        "On icc, got expected verbose output for 'cc_flags'" );
+}
+
+pass("Completed all tests in $0");
+
+################### DOCUMENTATION ###################
+
+=head1 NAME
+
+init/hints/linux-01.t - test init::hints::linux
+
+=head1 SYNOPSIS
+
+    % prove t/steps/init/hints/linux-01.t
+
+=head1 DESCRIPTION
+
+The files in this directory test functionality used by F<Configure.pl>.
+
+The tests in this file test init::hints::linux.
+
+=head1 AUTHOR
+
+James E Keenan
+
+=head1 SEE ALSO
+
+config::init::hints::linux, F<Configure.pl>.
+
+=cut
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/t/steps/init/optimize-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/init/optimize-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/init/optimize-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -4,15 +4,13 @@
 # init/optimize-01.t
 use strict;
 use warnings;
-use Test::More tests => 33;
+use Test::More tests => 28;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::init::optimize');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 use IO::CaptureOutput qw | capture |;
@@ -24,9 +22,8 @@
     mode => q{configure},
 } );
 
-my $conf = Parrot::Configure->new();
-
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{init::optimize};
 

Modified: branches/orderedhash_revamp/t/steps/inter/charset-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/inter/charset-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/inter/charset-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,15 +5,13 @@
 
 use strict;
 use warnings;
-use Test::More tests => 17;
+use Test::More tests => 12;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::inter::charset');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 use Tie::Filehandle::Preempt::Stdin;
@@ -27,9 +25,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
-
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{inter::charset};
 

Modified: branches/orderedhash_revamp/t/steps/inter/encoding-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/inter/encoding-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/inter/encoding-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,15 +5,13 @@
 
 use strict;
 use warnings;
-use Test::More tests => 17;
+use Test::More tests => 12;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::inter::encoding');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 use Tie::Filehandle::Preempt::Stdin;
@@ -27,9 +25,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
-
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{inter::encoding};
 

Modified: branches/orderedhash_revamp/t/steps/inter/lex-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/inter/lex-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/inter/lex-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,17 +5,14 @@
 
 use strict;
 use warnings;
-use Test::More tests => 31;
+use Test::More tests => 26;
 use Carp;
 use Data::Dumper;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::inter::lex');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
-    rerun_defaults_for_testing
     test_step_constructor_and_description
 );
 use Tie::Filehandle::Preempt::Stdin;
@@ -30,9 +27,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new();
-
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{inter::lex};
 

Modified: branches/orderedhash_revamp/t/steps/inter/lex-02.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/inter/lex-02.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/inter/lex-02.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,16 +5,14 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  12;
+use Test::More tests =>   7;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 $ENV{TEST_LEX} = 'foobar';
 use_ok('config::inter::lex');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 
@@ -27,9 +25,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new();
-
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{inter::lex};
 

Modified: branches/orderedhash_revamp/t/steps/inter/lex-03.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/inter/lex-03.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/inter/lex-03.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,16 +5,14 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  14;
+use Test::More tests =>   9;
 use Carp;
 use Data::Dumper;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::inter::lex');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 use Tie::Filehandle::Preempt::Stdin;
@@ -28,9 +26,9 @@
         mode => q{configure},
     }
 );
-my $conf = Parrot::Configure->new();
 
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my @prompts = q{flex};
 my $object = tie *STDIN, 'Tie::Filehandle::Preempt::Stdin', @prompts;

Modified: branches/orderedhash_revamp/t/steps/inter/libparrot-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/inter/libparrot-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/inter/libparrot-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,16 +5,13 @@
 
 use strict;
 use warnings;
-use Test::More tests => 58;
+use Test::More tests => 48;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
-use_ok('config::init::install');
 use_ok('config::inter::libparrot');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 use Tie::Filehandle::Preempt::Stdin;
@@ -28,10 +25,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
-
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
-test_step_thru_runstep( $conf, q{init::install}, $args );
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{inter::libparrot};
 

Modified: branches/orderedhash_revamp/t/steps/inter/make-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/inter/make-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/inter/make-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,15 +5,14 @@
 
 use strict;
 use warnings;
-use Test::More tests => 18;
+use Test::More tests => 13;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::inter::make');
 use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 use Tie::Filehandle::Preempt::Stdin;
@@ -27,9 +26,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new();
-
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{inter::make};
 

Modified: branches/orderedhash_revamp/t/steps/inter/progs-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/inter/progs-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/inter/progs-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -6,26 +6,21 @@
 use strict;
 use warnings;
 
-use Test::More tests => 24;
+use Test::More tests =>  9;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
-use_ok('config::init::install');
-use_ok('config::init::hints');
 use_ok('config::inter::progs');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 use Tie::Filehandle::Preempt::Stdin;
 use IO::CaptureOutput qw| capture |;
 
 =for hints_for_testing Testing and refactoring of inter::progs should
-entail understanding of issues discussed in the following RT tickets:
-http://rt.perl.org/rt3/Ticket/Display.html?id=43174; and
-http://rt.perl.org/rt3/Ticket/Display.html?id=41168.
+entail understanding of issues discussed in
+https://trac.parrot.org/parrot/ticket/854
 
 =cut
 
@@ -38,11 +33,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
-
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
-test_step_thru_runstep( $conf, q{init::install},  $args );
-test_step_thru_runstep( $conf, q{init::hints},    $args );
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{inter::progs};
 
@@ -77,10 +69,9 @@
 isa_ok( $object, 'Tie::Filehandle::Preempt::Stdin' );
 
 capture( sub {
-    my $verbose = inter::progs::_get_verbose($conf);
     my $ask = inter::progs::_prepare_for_interactivity($conf);
     my $cc;
-    ($conf, $cc) = inter::progs::_get_programs($conf, $verbose, $ask);
+    ($conf, $cc) = inter::progs::_get_programs($conf, $ask);
     $debug = inter::progs::_get_debug($conf, $ask);
     $debug_validity = inter::progs::_is_debug_setting_valid($debug);
 }, \$stdout);

Modified: branches/orderedhash_revamp/t/steps/inter/progs-02.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/inter/progs-02.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/inter/progs-02.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -6,26 +6,21 @@
 use strict;
 use warnings;
 
-use Test::More tests => 24;
+use Test::More tests =>  9;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
-use_ok('config::init::install');
-use_ok('config::init::hints');
 use_ok('config::inter::progs');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 use Tie::Filehandle::Preempt::Stdin;
 use IO::CaptureOutput qw| capture |;
 
 =for hints_for_testing Testing and refactoring of inter::progs should
-entail understanding of issues discussed in the following RT tickets:
-http://rt.perl.org/rt3/Ticket/Display.html?id=43174; and
-http://rt.perl.org/rt3/Ticket/Display.html?id=41168.
+entail understanding of issues discussed in
+https://trac.parrot.org/parrot/ticket/854
 
 =cut
 
@@ -38,11 +33,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
-
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
-test_step_thru_runstep( $conf, q{init::install},  $args );
-test_step_thru_runstep( $conf, q{init::hints},    $args );
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{inter::progs};
 
@@ -77,10 +69,9 @@
 isa_ok( $object, 'Tie::Filehandle::Preempt::Stdin' );
 
 capture( sub {
-    my $verbose = inter::progs::_get_verbose($conf);
     my $ask = inter::progs::_prepare_for_interactivity($conf);
     my $cc;
-    ($conf, $cc) = inter::progs::_get_programs($conf, $verbose, $ask);
+    ($conf, $cc) = inter::progs::_get_programs($conf, $ask);
     $debug = inter::progs::_get_debug($conf, $ask);
     $debug_validity = inter::progs::_is_debug_setting_valid($debug);
 }, \$stdout);

Modified: branches/orderedhash_revamp/t/steps/inter/progs-03.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/inter/progs-03.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/inter/progs-03.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -6,26 +6,21 @@
 use strict;
 use warnings;
 
-use Test::More tests => 24;
+use Test::More tests =>  9;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
-use_ok('config::init::install');
-use_ok('config::init::hints');
 use_ok('config::inter::progs');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 use Tie::Filehandle::Preempt::Stdin;
 use IO::CaptureOutput qw| capture |;
 
 =for hints_for_testing Testing and refactoring of inter::progs should
-entail understanding of issues discussed in the following RT tickets:
-http://rt.perl.org/rt3/Ticket/Display.html?id=43174; and
-http://rt.perl.org/rt3/Ticket/Display.html?id=41168.
+entail understanding of issues discussed in
+https://trac.parrot.org/parrot/ticket/854
 
 =cut
 
@@ -37,11 +32,9 @@
         mode => q{configure},
     }
 );
-my $conf = Parrot::Configure->new;
 
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
-test_step_thru_runstep( $conf, q{init::install},  $args );
-test_step_thru_runstep( $conf, q{init::hints},    $args );
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{inter::progs};
 
@@ -76,10 +69,9 @@
 isa_ok( $object, 'Tie::Filehandle::Preempt::Stdin' );
 
 capture( sub {
-    my $verbose = inter::progs::_get_verbose($conf);
     my $ask = inter::progs::_prepare_for_interactivity($conf);
     my $cc;
-    ($conf, $cc) = inter::progs::_get_programs($conf, $verbose, $ask);
+    ($conf, $cc) = inter::progs::_get_programs($conf, $ask);
     $debug = inter::progs::_get_debug($conf, $ask);
     $debug_validity = inter::progs::_is_debug_setting_valid($debug);
 }, \$stdout);

Modified: branches/orderedhash_revamp/t/steps/inter/progs-04.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/inter/progs-04.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/inter/progs-04.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -6,26 +6,21 @@
 use strict;
 use warnings;
 
-use Test::More tests => 23;
+use Test::More tests =>  8;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
-use_ok('config::init::install');
-use_ok('config::init::hints');
 use_ok('config::inter::progs');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 use Tie::Filehandle::Preempt::Stdin;
 use IO::CaptureOutput qw| capture |;
 
 =for hints_for_testing Testing and refactoring of inter::progs should
-entail understanding of issues discussed in the following RT tickets:
-http://rt.perl.org/rt3/Ticket/Display.html?id=43174; and
-http://rt.perl.org/rt3/Ticket/Display.html?id=41168.
+entail understanding of issues discussed in
+https://trac.parrot.org/parrot/ticket/854
 
 =cut
 
@@ -38,11 +33,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
-
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
-test_step_thru_runstep( $conf, q{init::install},  $args );
-test_step_thru_runstep( $conf, q{init::hints},    $args );
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{inter::progs};
 

Modified: branches/orderedhash_revamp/t/steps/inter/shlibs-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/inter/shlibs-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/inter/shlibs-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,15 +5,13 @@
 
 use strict;
 use warnings;
-use Test::More tests => 21;
+use Test::More tests => 16;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::inter::shlibs');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 use Tie::Filehandle::Preempt::Stdin;
@@ -27,9 +25,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
-
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{inter::shlibs};
 $conf->add_steps($pkg);

Modified: branches/orderedhash_revamp/t/steps/inter/types-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/inter/types-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/inter/types-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -9,10 +9,9 @@
 use Carp;
 use lib qw( lib t/configure/testlib );
 use_ok('config::inter::types');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 use Tie::Filehandle::Preempt::Stdin;
@@ -26,7 +25,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{inter::types};
 

Modified: branches/orderedhash_revamp/t/steps/inter/yacc-01.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/inter/yacc-01.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/inter/yacc-01.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,16 +5,14 @@
 
 use strict;
 use warnings;
-use Test::More tests => 31;
+use Test::More tests => 26;
 use Carp;
 use Data::Dumper;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 use_ok('config::inter::yacc');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 use Tie::Filehandle::Preempt::Stdin;
@@ -29,9 +27,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new();
-
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{inter::yacc};
 

Modified: branches/orderedhash_revamp/t/steps/inter/yacc-02.t
==============================================================================
--- branches/orderedhash_revamp/t/steps/inter/yacc-02.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/steps/inter/yacc-02.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,16 +5,14 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  12;
+use Test::More tests =>   7;
 use Carp;
 use lib qw( lib t/configure/testlib );
-use_ok('config::init::defaults');
 $ENV{TEST_YACC} = 'foobar';
 use_ok('config::inter::yacc');
-use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Step::Test;
 use Parrot::Configure::Test qw(
-    test_step_thru_runstep
     test_step_constructor_and_description
 );
 
@@ -27,9 +25,8 @@
     }
 );
 
-my $conf = Parrot::Configure->new();
-
-test_step_thru_runstep( $conf, q{init::defaults}, $args );
+my $conf = Parrot::Configure::Step::Test->new;
+$conf->include_config_results( $args );
 
 my $pkg = q{inter::yacc};
 

Modified: branches/orderedhash_revamp/t/tools/dev/searchops/samples.pm
==============================================================================
--- branches/orderedhash_revamp/t/tools/dev/searchops/samples.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/tools/dev/searchops/samples.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -17,11 +17,13 @@
 ** pseudo-core.ops
 */
 
+BEGIN_OPS_PREAMBLE
+
 #include "parrot/dynext.h"
 #include "parrot/embed.h"
 #include "../interp/interp_guts.h"
 
-VERSION = PARROT_VERSION;
+END_OPS_PREAMBLE
 
 =head1 NAME
 
@@ -52,8 +54,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
 
@@ -151,8 +153,6 @@
 ** pseudo-debug.ops
 */
 
-VERSION = PARROT_VERSION;
-
 =head1 NAME
 
 pseudo-debug.ops
@@ -270,8 +270,6 @@
 ** pseudo-string.ops
 */
 
-VERSION = PARROT_VERSION;
-
 =head1 NAME
 
 pseudo-string.ops - String Operations

Modified: branches/orderedhash_revamp/t/tools/dump_pbc.t
==============================================================================
--- branches/orderedhash_revamp/t/tools/dump_pbc.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/tools/dump_pbc.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,10 +1,10 @@
 #! perl
-# Copyright (C) 2008, Parrot Foundation.
+# Copyright (C) 2008-2009, Parrot Foundation.
 # $Id$
 
 =head1 NAME
 
-t/tools/dumb_pbc.t - test the script tools/utils/dump_pbc.t
+t/tools/dumb_pbc.t - test the script tools/utils/dump_pbc.pl
 
 =head1 SYNOPSIS
 

Modified: branches/orderedhash_revamp/t/tools/install/01-create_directories.t
==============================================================================
--- branches/orderedhash_revamp/t/tools/install/01-create_directories.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/tools/install/01-create_directories.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -79,9 +79,9 @@
 
 =head1 DESCRIPTION
 
-The files in this directory test functionality used by
-F<tools/dev/install_files.pl> and F<tools/dev/install_dev_files.pl> and
-exported by F<lib/Parrot/Install.pm>.
+The files in this directory test functionality used by the the scripts
+F<tools/dev/install_files.pl>, F<tools/dev/install_doc_files.pl> and F<tools/dev/install_dev_files.pl>
+and are exported by F<lib/Parrot/Install.pm>.
 
 =head1 AUTHOR
 
@@ -89,7 +89,7 @@
 
 =head1 SEE ALSO
 
-Parrot::Install, F<tools/dev/install_files.pl>, F<tools/dev/install_dev_files.pl>
+Parrot::Install, F<tools/dev/install_files.pl>, F<tools/dev/install_doc_files.pl>, F<tools/dev/install_dev_files.pl>
 
 =cut
 

Modified: branches/orderedhash_revamp/t/tools/install/02-install_files.t
==============================================================================
--- branches/orderedhash_revamp/t/tools/install/02-install_files.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/tools/install/02-install_files.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -260,9 +260,9 @@
 
 =head1 DESCRIPTION
 
-The files in this directory test functionality used by
-F<tools/dev/install_files.pl> and F<tools/dev/install_dev_files.pl> and
-exported by F<lib/Parrot/Install.pm>.
+The files in this directory test functionality used by the the scripts
+F<tools/dev/install_files.pl>, F<tools/dev/install_doc_files.pl> and F<tools/dev/install_dev_files.pl>
+and are exported by F<lib/Parrot/Install.pm>.
 
 =head1 AUTHOR
 
@@ -270,7 +270,7 @@
 
 =head1 SEE ALSO
 
-Parrot::Install, F<tools/dev/install_files.pl>, F<tools/dev/install_dev_files.pl>
+Parrot::Install, F<tools/dev/install_files.pl>, F<tools/dev/install_doc_files.pl>, F<tools/dev/install_dev_files.pl>
 
 =cut
 

Modified: branches/orderedhash_revamp/t/tools/install/03-lines_to_files.t
==============================================================================
--- branches/orderedhash_revamp/t/tools/install/03-lines_to_files.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/tools/install/03-lines_to_files.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -209,9 +209,9 @@
 
 =head1 DESCRIPTION
 
-The files in this directory test functionality used by
-F<tools/dev/install_files.pl> and F<tools/dev/install_dev_files.pl> and
-exported by F<lib/Parrot/Install.pm>.
+The files in this directory test functionality used by the the scripts
+F<tools/dev/install_files.pl>, F<tools/dev/install_doc_files.pl> and F<tools/dev/install_dev_files.pl>
+and are exported by F<lib/Parrot/Install.pm>.
 
 =head1 AUTHOR
 

Modified: branches/orderedhash_revamp/t/tools/install/dev_overall.t
==============================================================================
--- branches/orderedhash_revamp/t/tools/install/dev_overall.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/tools/install/dev_overall.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -50,17 +50,6 @@
             end     => File::Spec->catfile(
                         $libdir, $versiondir, 'languages', 'nqp', 'bootstrap', 'actions.pm' ),
         },
-        'docs/compiler_faq.pod' => {
-            start   => File::Spec->catfile( qw| . docs compiler_faq.pod | ),
-            end     => File::Spec->catfile(
-                        $docdir,  $versiondir, 'pod', 'compiler_faq.pod' ),
-        },
-        'docs/pct/past_building_blocks.pod' => {
-            start   => File::Spec->catfile(
-                        qw| . docs pct past_building_blocks.pod | ),
-            end     => File::Spec->catfile(
-                        $docdir,  $versiondir, 'pod', 'pct', 'past_building_blocks.pod' ),
-        },
         'lib/Parrot/Configure.pm' => {
             start   => File::Spec->catfile(
                         qw| . lib Parrot Configure.pm | ),

Modified: branches/orderedhash_revamp/t/tools/install/overall.t
==============================================================================
--- branches/orderedhash_revamp/t/tools/install/overall.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/tools/install/overall.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -53,16 +53,6 @@
             end     => File::Spec->catfile(
                         $docdir, $versiondir, 'LICENSE' )
         },
-        'docs/gettingstarted.pod' => {
-            start   => File::Spec->catfile( qw| . docs gettingstarted.pod | ),
-            end     => File::Spec->catfile(
-                        $docdir,  $versiondir, 'pod', 'gettingstarted.pod' ),
-        },
-        'docs/resources/phony_resource' => {
-            start   => File::Spec->catfile( qw| . docs resources phony_resource | ),
-            end     => File::Spec->catfile(
-                        $docdir,  $versiondir, 'resources', 'phony_resource' ),
-        },
         'include/parrot/charset.h' => {
             start   => File::Spec->catfile( qw| . include parrot charset.h | ),
             end     => File::Spec->catfile(

Modified: branches/orderedhash_revamp/t/tools/ops2cutils/testlib/GenerateCore.pm
==============================================================================
--- branches/orderedhash_revamp/t/tools/ops2cutils/testlib/GenerateCore.pm	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/tools/ops2cutils/testlib/GenerateCore.pm	Sat Jan 23 01:49:53 2010	(r43541)
@@ -100,8 +100,6 @@
 
 =head1 DESCRIPTION
 
-=head2 Purpose
-
 The test suite found in F<t/tools/ops2cutils/> tests the methods of
 Parrot::Ops2c::Utils.  Those methods are invoked by Parrot build tool
 F<tools/build/ops2c.pl>, which in turn is invoked several times by F<make>.
@@ -122,6 +120,8 @@
 (b) creates a temporary copy of Parrot::OpLib::core such that
 C<Parrot::Ops2c::Utils::new()> can successfully execute.
 
+=head1 SUBROUTINES
+
 =head2 C<generate_core()>
 
 =over 4

Modified: branches/orderedhash_revamp/t/tools/ops2pm/04-prepare_ops.t
==============================================================================
--- branches/orderedhash_revamp/t/tools/ops2pm/04-prepare_ops.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/tools/ops2pm/04-prepare_ops.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -19,7 +19,7 @@
     }
     unshift @INC, qq{$topdir/lib};
 }
-use Test::More qw(no_plan); # tests => 70;
+use Test::More tests => 70;
 use Carp;
 use File::Copy;
 use File::Temp (qw| tempdir |);

Modified: branches/orderedhash_revamp/t/tools/ops2pm/08-sort_ops.t
==============================================================================
--- branches/orderedhash_revamp/t/tools/ops2pm/08-sort_ops.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/tools/ops2pm/08-sort_ops.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -222,8 +222,6 @@
 ** dummy.ops
 */
 
-VERSION = PARROT_VERSION;
-
 inline op zzzzzz(inout INT, in INT) :base_core {
   goto NEXT();
 }

Modified: branches/orderedhash_revamp/t/tools/ops2pm/samples/core_ops.original
==============================================================================
--- branches/orderedhash_revamp/t/tools/ops2pm/samples/core_ops.original	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/tools/ops2pm/samples/core_ops.original	Sat Jan 23 01:49:53 2010	(r43541)
@@ -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
 
@@ -1122,7 +1122,7 @@
     if ($1)
         Parrot_do_dod_run(interp, 0);
     else
-        if (interp->arena_base->num_early_DOD_PMCs)
+        if (interp->mem_pools->num_early_DOD_PMCs)
             Parrot_do_dod_run(interp, GC_lazy_FLAG);
 }
 
@@ -1185,7 +1185,7 @@
 
 op needs_destroy(invar PMC) {
      PObj_needs_early_DOD_SET($1);
-     ++interp->arena_base->num_early_DOD_PMCs;
+     ++interp->mem_pools->num_early_DOD_PMCs;
 }
 
 =back

Modified: branches/orderedhash_revamp/t/tools/ops2pm/samples/pic_ops.original
==============================================================================
--- branches/orderedhash_revamp/t/tools/ops2pm/samples/pic_ops.original	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/tools/ops2pm/samples/pic_ops.original	Sat Jan 23 01:49:53 2010	(r43541)
@@ -61,9 +61,6 @@
         if (++lru->u.type == lr_types)
             goto runit_v_pp;
         mic->pic->miss_count++;
-        /*
-         * RT#42353 if we got too often here just do a dynamic lookup
-         */
     }
     parrot_pic_find_infix_v_pp(interp, left, right, mic, cur_opcode);
     /* rerun this opcode */
@@ -106,7 +103,6 @@
                 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ERR_OVERFLOW,
                         "Integer overflow");
             }
-            /* #RT42354 preserve type system */
             VTABLE_morph(interp, left, enum_class_BigInt);
             VTABLE_set_integer_native(interp, left, a);
             mmd_dispatch_p_pip(interp, left, b, left, MMD_SUBTRACT);
@@ -241,7 +237,7 @@
 inline op pic_callr__(inconst PMC) :pic :flow {
     Parrot_MIC *mic;
     Parrot_PIC_lru *lru;
-    void *args[6];      /* RT#42355 ARG_MAX */
+    void *args[6];
     parrot_context_t *ctx;
     opcode_t *pc;
     void **pred_pc;
@@ -290,7 +286,6 @@
     pc = CUR_OPCODE + 2 + n_args + 3 + 3 + 2;
     args[1 + n_args] = pc;
     lru = &mic->lru;
-    /* RT#42356 verify $1 didn't change */
     (void) ((interface_f)lru->f.real_function)(interp, sig_bits, args);
     goto ADDRESS(pc);
 }

Modified: branches/orderedhash_revamp/t/tools/parrot_debugger.t
==============================================================================
--- branches/orderedhash_revamp/t/tools/parrot_debugger.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/tools/parrot_debugger.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 #! perl
-# Copyright (C) 2007-2008, Parrot Foundation.
+# Copyright (C) 2007-2009, Parrot Foundation.
 # $Id$
 
 =head1 NAME
@@ -56,14 +56,252 @@
     print "\\n"
 .end
 PIR
-pdb_output_like( <<PIR, "pir", "r", qr/3\.14159/, 'running the program');
+pdb_output_like( <<PIR, "pir", "r", qr/3\.14159/, 'running the program (pir)');
 .sub main :main
     \$N3 = 3.14159
     print \$N3
     print "\\n"
 .end
 PIR
-BEGIN { $tests += 2 }
+pdb_output_like( <<PASM, "pasm", "run", qr/42/, 'running the program (long,pasm)');
+    set I1,42
+    print I1
+    print "\\n"
+PASM
+pdb_output_like( <<PASM, "pasm", "r", qr/42/, 'running the program (pasm)');
+    set I1,42
+    print I1
+    print "\\n"
+PASM
+pdb_output_like( <<PASM, "pasm", "n", qr/one more time/, 'next instruction (pasm)');
+    print "one more time\\n"
+PASM
+pdb_output_like( <<PASM, "pasm", "next", qr/one more time/, 'next instruction (long,pasm)');
+    print "one more time\\n"
+PASM
+pdb_output_like( <<PIR, "pir", "n", qr/one more time/, 'next instruction (pir)');
+.sub main :main
+    print "one more time\\n"
+.end
+PIR
+pdb_output_like( <<PIR, "pir", "next", qr/one more time/, 'next instruction (long,pir)');
+.sub main :main
+    print "one more time\\n"
+.end
+PIR
+pdb_output_like( <<PIR, "pir", "s", qr/current instr.: 'main'/, 'show stack (pir)');
+.sub main :main
+    \$I1 = 242
+.end
+PIR
+pdb_output_like( <<PIR, "pir", "stack", qr/current instr.: 'main'/, 'show stack (long,pir)');
+.sub main :main
+    \$I1 = 242
+.end
+PIR
+pdb_output_like( <<PASM, "pasm", "s", qr/current instr.: '\(null\)'/, 'show stack (pasm)');
+    set I1, 242
+PASM
+pdb_output_like( <<PASM, "pasm", "info", qr/Total memory allocated =/, 'info (pasm)');
+    set I1, 242
+PASM
+pdb_output_like( <<PASM, "pasm", "b", qr/Breakpoint 1 at.*pos 0/, 'set breakpoint');
+    set I1, 242
+PASM
+pdb_output_like( <<PASM, "pasm", "b\nb\nL", qr/Breakpoint 1 at pos 0\nBreakpoint 2 at pos 0/, 'list breakpoints');
+    set I1, 242
+PASM
+
+pdb_output_like( <<PIR, "pir", "b\nb\nL", qr/Breakpoint 1 at pos 0\nBreakpoint 2 at pos 0/, 'list breakpoints (pir)');
+.sub main :main
+    \$I1 = 242
+.end
+PIR
+
+pdb_output_like( <<PASM, "pasm", "t", qr/set I0, 242/, 'trace');
+    set I0, 242
+PASM
+
+pdb_output_like( <<PIR, "pir", "t", qr/set I0, 242/, 'trace (pir)');
+.sub main :main
+    \$I0 = 242
+.end
+PIR
+
+pdb_output_like( <<PASM, "pasm", "t 2", qr/\d+ set I0, 242\s*I0=-?\d+\s*\d+ set I1, 1982/, 'trace multiple statements');
+    set I0, 242
+    set I1, 1982
+PASM
+
+pdb_output_like( <<PIR, "pir", "t 2", qr/\d+ set I0, 242\s*I0=-?\d+\s*\d+ set I1, 1982/, 'trace multiple statements (pir)');
+.sub main :main
+    \$I0 = 242
+    \$I1 = 1982
+.end
+PIR
+
+pdb_output_like( <<PASM, "pasm", "t\np I0", qr/^242/m, 'print an integer register');
+    set I0, 242
+PASM
+
+pdb_output_like( <<PIR, "pir", "t\np I0", qr/^242/m, 'print an integer register (pir)');
+.sub main :main
+    \$I0 = 242
+.end
+PIR
+
+pdb_output_like( <<PASM, "pasm", "t\np N0", qr/^3.14159/m, 'print a numeric register');
+    set N0, 3.14159
+PASM
+
+pdb_output_like( <<PIR, "pir", "t\np N0", qr/^3.14159/m, 'print a numeric register (pir)');
+.sub main :main
+    \$N0 = 3.14159
+.end
+PIR
+
+pdb_output_like( <<PASM, "pasm", "t\np P0", qr/^ResizablePMCArray/m, 'print a PMC register');
+    new P0, 'ResizablePMCArray'
+PASM
+
+pdb_output_like( <<PIR, "pir", "t\np P0", qr/^ResizablePMCArray=PMC/m, 'print a PMC register (pir)');
+.sub main :main
+    \$P0 = new 'ResizablePMCArray'
+.end
+PIR
+
+pdb_output_like( <<PASM, "pasm", "t\np S0", qr/^ceiling cat/m, 'print a string register');
+    set S0, "ceiling cat"
+PASM
+
+pdb_output_like( <<PIR, "pir", "t\np S0", qr/^ceiling cat/m, 'print a string register (pir)');
+.sub main :main
+    \$S0 = "ceiling cat"
+.end
+PIR
+
+pdb_output_like( <<PASM, "pasm", "t 2\np I", qr/I0 = 242\s*I1 = 1982/, 'print all integer registers');
+    set I0, 242
+    set I1, 1982
+PASM
+
+pdb_output_like( <<PIR, "pir","t 2\np I", qr/I0 = 242\s*I1 = 1982/, 'print all integer registers (pir)');
+.sub main :main
+    \$I0 = 242
+    \$I1 = 1982
+.end
+PIR
+
+pdb_output_like( <<PASM, "pasm", "b\n d 1", qr/Breakpoint 1 deleted/, 'Delete a breakpoint');
+    set I0, 242
+PASM
+
+pdb_output_like( <<PIR, "pir", "b\nd 1", qr/Breakpoint 1 deleted/, 'Delete a breakpoint (pir)');
+.sub main :main
+    \$I0 = 242
+.end
+PIR
+
+pdb_output_like( <<PIR, "pir", "l", qr/\.sub main :main/, 'list source');
+.sub main :main
+    \$I0 = 242
+.end
+PIR
+
+pdb_output_like( <<PIR, "pir", "l 2", qr/N4 = 6.28/, 'list source with start line');
+.sub main :main
+    \$N3 = 3.14
+    \$N4 = 6.28
+    print "\\n"
+.end
+PIR
+
+pdb_output_like( <<PIR, "pir", "d 42", qr/No breakpoint number 42/, 'delete invalid breakpoint');
+.sub main :main
+    \$I0 = 242
+.end
+PIR
+
+TODO: {
+
+local $TODO = 'eval support functions deprecated, TT #872, pending eval reworking';
+
+pdb_output_like( <<PIR, "pir", "e ", qr/Must give a command to eval/, 'eval nothing');
+.sub main :main
+    \$I0 = 242
+.end
+PIR
+
+}
+
+pdb_output_like( <<PIR, "pir", "t\na I0 17", qr/I0 = 17/, 'assign to an integer register');
+.sub main :main
+    \$I0 = 242
+.end
+PIR
+
+pdb_output_like( <<PIR, "pir", "t\na i0 17", qr/I0 = 17/, 'assign to an integer register (lowercase)');
+.sub main :main
+    \$I0 = 242
+.end
+PIR
+
+pdb_output_like( <<PIR, "pir", "a Z0 42", qr/Invalid register type Z/, 'assign to an invalid register');
+.sub main :main
+    \$I0 = 242
+.end
+PIR
+
+pdb_output_like( <<PIR, "pir", "a foo", qr/Must give a register number and value to assign/, 'invalid assignment command');
+.sub main :main
+    \$I0 = 242
+.end
+PIR
+
+pdb_output_like( <<PIR, "pir", "t\na N0 3.14", qr/N0 = 3.14/, 'assign to a numeric register');
+.sub main :main
+    \$N0 = 9.99
+.end
+PIR
+
+pdb_output_like( <<PIR, "pir", "t\np S", qr/S0 = foobar/, 'print string registers');
+.sub main :main
+    \$S0 = "foobar"
+.end
+PIR
+
+pdb_output_like( <<PIR, "pir", "t\na S0 foobar", qr/S0 = no such register/, 'print string registers when none exist');
+.sub main :main
+    new \$P0, 'ResizableIntegerArray'
+.end
+PIR
+
+pdb_output_like( <<PIR, "pir", "r", qr/great job!/, 'run code');
+.sub main :main
+    print "great job!"
+.end
+PIR
+
+TODO: {
+
+local $TODO = 'arguments do not seem to populate $P0';
+pdb_output_like( <<PIR, "pir", "r gomer", qr/gomer/, 'run code with args');
+.sub main :main
+    print \$P0
+.end
+PIR
+
+}
+
+pdb_output_like( <<PIR, "pir", "t\nw I0 == 2\nt", qr/Adding watchpoint/, 'watchpoint');
+.sub main :main
+    \$I0 = 1
+    \$I0 = 2
+    \$I0 = 3
+.end
+PIR
+
+BEGIN { $tests += 45 }
 
 BEGIN { plan tests => $tests; }
 
@@ -75,7 +313,7 @@
 
 Takes 4 arguments: a file to run, the filename-extension of the file
 (probably "pir" or "pasm"), the command or commands to provide to
-parrot_debugger as input, and a regex string to match within
+parrot_debugger as script file, and a regex string to match within
 parrot_debugger's output.
 
 =cut
@@ -95,7 +333,7 @@
     $f->print($input);
     $f->print("\nquit\n");
     $f->close();
-    system("$path_to_pdb $codefn <$stdinfn >$stdoutfn 2>&1");
+    system("$path_to_pdb --script $stdinfn $codefn >$stdoutfn 2>&1");
     $f = IO::File->new($stdoutfn);
 
     my $output = join( '', <$f> );

Added: branches/orderedhash_revamp/t/tools/pbc_disassemble.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/tools/pbc_disassemble.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,106 @@
+#! perl
+# Copyright (C) 2009, Parrot Foundation
+# $Id$
+
+=head1 NAME
+
+t/tools/pbc_disassemble.t - test the Parrot Bytecode (PBC) Disassembler
+
+=head1 SYNOPSIS
+
+    % prove t/tools/pbc_disassemble.t
+
+=head1 DESCRIPTION
+
+Tests the C<pbc_disassemble> tool by providing it with a number of source
+files, and running through it with various commands.
+
+We never actually check the I<full> output of pbc_disassemble.  We simply check
+several smaller components to avoid a test file that is far too unwieldy.
+
+
+=head1 REQUIREMENTS
+
+This test script requires you to build pbc_disassemble, by typing
+"make parrot_utils" (using a suitable make tool for your platform).
+If this requirement has not been met, all tests will be skipped.
+
+=cut
+
+use strict;
+use warnings;
+use lib qw(lib);
+
+use Test::More;
+use IO::File ();
+use Parrot::Config;
+use File::Spec;
+use Parrot::Test;
+
+my $path;
+
+BEGIN {
+    $path = File::Spec->catfile( ".", "pbc_disassemble" );
+    my $exefile = $path . $PConfig{exe};
+    unless ( -f $exefile ) {
+        plan skip_all => "pbc_disassemble hasn't been built. Run make parrot_utils";
+        exit(0);
+    }
+    plan tests => 4;
+}
+
+disassemble_output_like( <<PIR, "pir", qr/PMC_CONST.*set_n_nc.*print_n/ms, 'pbc_disassemble numeric ops');
+.sub main :main
+    \$N3 = 3.14159
+    print \$N3
+    print "\\n"
+.end
+PIR
+
+disassemble_output_like( <<PIR, "pir", qr/PMC_CONST.*set_i_ic.*print_i/ms, 'pbc_disassemble integer ops');
+.sub main :main
+    \$I0 = 1982
+    print \$I0
+    print "\\n"
+.end
+PIR
+
+disassemble_output_like( <<PIR, "pir", qr/PMC_CONST.*new_p_sc.*"ResizablePMCArray".*set_p_kic_ic\s*P.*set_i_p_kic\s*I.*/ms, 'pbc_disassemble pmc ops');
+.sub main :main
+    \$P0    = new 'ResizablePMCArray'
+    \$P0[0] = 42
+    \$I0 = \$P0[0]
+.end
+PIR
+
+disassemble_output_like( <<PIR, "pir", qr/PMC_CONST.*set_s_sc\s*S.*print_s\s*S.*print_sc/ms, 'pbc_disassemble string ops');
+.sub main :main
+    \$S0 = "Wheels within wheels"
+    print \$S0
+    print "\\n"
+.end
+PIR
+
+=head1 HELPER SUBROUTINES
+
+=head2 disassemble_output_like
+
+    disassemble_output_like(<<PASM, "pasm", "some output", "running $file");
+
+Takes 3-4 arguments: a file to run,
+the filename-extension of the file (probably "pir" or "pasm"),
+an arrayref or single regex string to match within pbc_disassemble's output,
+and the optional test diagnostic.
+
+=cut
+
+sub disassemble_output_like {
+    pbc_postprocess_output_like($path, @_ );
+}
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Added: branches/orderedhash_revamp/t/tools/pbc_dump.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/tools/pbc_dump.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,98 @@
+#! perl
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/tools/pbc_dump.t - test the Parrot Bytecode (PBC) Dumper
+
+=head1 SYNOPSIS
+
+    % prove t/tools/pbc_dump.t
+
+=head1 DESCRIPTION
+
+Tests the C<pbc_dump> tool by providing it with a number of source
+files, and running through it with various commands.
+
+We never actually check the I<full> output of pbc_dump.  We simply check
+several smaller components to avoid a test file that is far too unwieldy.
+
+
+=head1 REQUIREMENTS
+
+This test script requires you to build pbc_dump, by typing
+"make parrot_utils" (using a suitable make tool for your platform).
+If this requirement has not been met, all tests will be skipped.
+
+=cut
+
+use strict;
+use warnings;
+use lib qw(lib);
+
+use Test::More;
+use IO::File ();
+use Parrot::Config;
+use Parrot::Test;
+use File::Spec;
+
+my $path;
+
+BEGIN {
+    $path = File::Spec->catfile( ".", "pbc_dump" );
+    my $exefile = $path . $PConfig{exe};
+    unless ( -f $exefile ) {
+        plan skip_all => "pbc_dump hasn't been built. Run make parrot_utils";
+        exit(0);
+    }
+    plan tests => 6;
+}
+
+dump_output_like( <<PIR, "pir", [qr/FIXUP_t/, qr/CONSTANT_t/, qr/BYTECODE_t/], 'pbc_dump basic sanity');
+.sub main :main
+    \$I0 = 42
+.end
+PIR
+
+dump_output_like( <<PIR, "pir", qr/HEADER\s*=>\s*\[.*wordsize.*byteorder.*floattype.*parrot-version.*bytecode-version.*UUID.*\]/ms, 'pbc_dump HEADER sanity');
+.sub main :main
+    \$I0 = 42
+.end
+PIR
+
+dump_output_like( <<PIR, "pir", qr/DIRECTORY\s*=>\s*\[.*offs.*op_count.*itype.*id.*size.*segments/ms, 'pbc_dump DIRECTORY sanity');
+.sub main :main
+    \$I0 = 42
+.end
+PIR
+
+dump_output_like( <<PIR, "pir", qr/BYTECODE_t.*=>.*\[.*offs.*op_count.*itype.*id.*size.*mappings/ms, 'pbc_dump BYTECODE sanity');
+.sub main :main
+    \$I0 = 42
+.end
+PIR
+
+=head1 HELPER SUBROUTINES
+
+=head2 dump_output_like
+
+    dump_output_like(<<PASM, "pasm", "some output", "running $file");
+
+Takes 3-4 arguments: a file to run,
+the filename-extension of the file (probably "pir" or "pasm"),
+an arrayref or single regex string to match within pbc_dump's output,
+and the optional test diagnostic.
+
+=cut
+
+sub dump_output_like {
+    pbc_postprocess_output_like($path, @_ );
+}
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Added: branches/orderedhash_revamp/t/tools/pgegrep.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/tools/pgegrep.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,111 @@
+#! perl
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/tools/pgegrep.t - test the script tools/utils/pgegrep
+
+=head1 SYNOPSIS
+
+    % prove t/tools/pgegrep.t
+
+=head1 DESCRIPTION
+
+Tests the features of of the C<pgegrep> utility.
+
+=cut
+
+use strict;
+use warnings;
+use lib qw( . lib ../lib ../../lib );
+
+use Fatal qw{open close};
+use Test::More;
+use Parrot::Test tests => 10;
+use Parrot::Config;
+use File::Spec   ();
+
+my $testdata = File::Spec->catfile(qw{. t tools testdata });
+my $testdata_escaped = $testdata;
+$testdata_escaped =~ s!\\!\\\\!g;
+
+sub pgegrep_output_like {
+    my ($options, $snippet, $desc)  = @_;
+
+    my $PARROT  = ".$PConfig{slash}$PConfig{test_prog}";
+    my $pgegrep = File::Spec->catfile( qw{. tools util pgegrep} );
+    my $out     = `$PARROT $pgegrep $options`;
+
+    like( $out, $snippet, $desc );
+
+    return;
+}
+
+pgegrep_output_like(
+    '-V',
+    qr!\Qpgegrep v0.0.1\E!,
+    'pge reports correct version'
+);
+
+pgegrep_output_like(
+    "cat $testdata",
+    qr!keyboardcat!,
+    'basic sanity of matching a literal'
+);
+
+pgegrep_output_like(
+    "-n cat $testdata",
+    qr!1:keyboardcat!,
+    'matching a literal with line number'
+);
+
+pgegrep_output_like(
+    "--line-number cat $testdata",
+    qr!1:keyboardcat!,
+    'matching a literal with line number with long option'
+);
+
+pgegrep_output_like(
+    "-H cat $testdata",
+    qr!$testdata_escaped:keyboardcat!,
+    'matching a literal with file name'
+);
+
+pgegrep_output_like(
+    "--with-filename cat $testdata",
+    qr!$testdata_escaped:keyboardcat!,
+    'matching a literal with file name with long option'
+);
+
+
+pgegrep_output_like(
+    "-v cat $testdata",
+    qr!saxophonegiraffe!,
+    'test inversion of match'
+);
+
+pgegrep_output_like(
+    "--invert-match cat $testdata",
+    qr!saxophonegiraffe!,
+    'test inversion of match with long option'
+);
+
+pgegrep_output_like(
+    "-l cat $testdata",
+    qr!$testdata_escaped!,
+    'find files that match'
+);
+
+pgegrep_output_like(
+    "--files-with-matches cat $testdata",
+    qr!$testdata_escaped!,
+    'find files that match with long option'
+);
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Deleted: branches/orderedhash_revamp/t/tools/pmc2c.t
==============================================================================
--- branches/orderedhash_revamp/t/tools/pmc2c.t	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,244 +0,0 @@
-#! perl
-# Copyright (C) 2005-2008, Parrot Foundation.
-# $Id$
-
-=head1 NAME
-
-t/tools/pmc2c.t - test the PMC to C generator
-
-=head1 SYNOPSIS
-
-    % prove t/tools/pmc2c.t
-
-=head1 DESCRIPTION
-
-Tests the C<pmc2c> utility by providing it with a number of source
-pmc files, having it generate the resulting C file and verifying
-the output.
-
-We never actually check the *full* output of the conversion.
-We simply check several smaller components to avoid a test file
-that is far too unwieldy.
-
-=cut
-
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-
-use Fatal qw{open close};
-use Test::More;
-use Parrot::Test tests => 13;
-use Parrot::Config;
-
-my $pmc2c = join $PConfig{slash}, qw(. tools build pmc2c.pl);
-
-sub pmc2c_output_like {
-    my ($pmc, $c, $name)  = @_;
-    my $c_file            = pmc_to_c($pmc);
-
-    open my $c_fh, '<', $c_file;
-    my $c_output = do { local $/; <$c_fh> };
-    close $c_fh;
-
-    unless ( ref $c ) {
-        chomp $c;
-        $c = qr{\Q$c\E};
-    }
-
-    like( $c_output, $c, $name );
-}
-
-{
-    my $counter = 0;
-
-    sub pmc_to_c {
-        my $pmc = shift;
-
-        $counter++;
-
-        my $pmc_file = "$0_$counter.pmc";
-        open my $fh, '>', $pmc_file;
-        print {$fh} $pmc;
-        close $fh;
-
-        system("$^X $pmc2c --dump $pmc_file");
-        system("$^X $pmc2c -c $pmc_file");
-
-        (my $c_file = $pmc_file) =~ s/\.pmc$/\.c/;
-
-        return $c_file;
-    }
-
-}
-
-pmc2c_output_like( <<'END_PMC', qr{DO NOT EDIT THIS FILE}, 'no edit warning' );
-pmclass a { }
-END_PMC
-
-pmc2c_output_like( <<'END_PMC', <<'END_C', 'includes' );
-pmclass a { }
-END_PMC
-#include "parrot/parrot.h"
-#include "parrot/extend.h"
-#include "parrot/dynext.h"
-#include "pmc_a.h"
-#include "pmc_default.h"
-#include "a.str"
-END_C
-
-TODO: {
-    local $TODO = "needs fixing after vtinit merge";
-pmc2c_output_like( <<'END_PMC', <<'END_C', 'class initialization' );
-pmclass a { }
-END_PMC
-void
-Parrot_a_class_init(PARROT_INTERP, int entry, int pass)
-{
-    static const char attr_defs [] =
-        "";
-    const VTABLE temp_base_vtable = {
-END_C
-}
-
-pmc2c_output_like( <<'END_PMC', <<'END_C', 'comment passthrough' );
-pmclass a { }
-/* passthrough */
-END_PMC
-/* passthrough */
-END_C
-
-pmc2c_output_like( <<'END_PMC', <<'END_C', 'pod passthrough' );
-pmclass a { }
-
-=for naught
-
-Documentation
-
-=cut
-END_PMC
-=for naught
-
-Documentation
-
-=cut
-END_C
-
-TODO: {
-    local $TODO = 'needs fixing after vtinit merge';
-
-pmc2c_output_like( <<'END_PMC', <<'END_C', 'provides' );
-pmclass a provides nothing { }
-END_PMC
-vt_clone->provides_str = CONST_STRING_GEN(interp, "nothing");
-END_C
-
-pmc2c_output_like( <<'END_PMC', <<'END_C', 'need_ext' );
-pmclass a need_ext { }
-END_PMC
-   const VTABLE temp_ro_vtable = {
-        NULL,       /* namespace */
-        enum_class_a, /* base_type */
-        NULL,       /* whoami */
-        0|VTABLE_PMC_NEEDS_EXT|VTABLE_IS_READONLY_FLAG, /* flags */
-END_C
-
-}
-
-
-pmc2c_output_like( <<'END_PMC', <<'END_C', 'maps' );
-pmclass a hll dale maps Integer { }
-END_PMC
-            const INTVAL pmc_id = Parrot_get_HLL_id( interp, CONST_STRING_GEN(interp, "dale"));
-            if (pmc_id > 0) {
-                Parrot_register_HLL_type( interp, pmc_id, enum_class_Integer, entry);
-            }
-END_C
-
-pmc2c_output_like( <<'END_PMC', <<'END_C', 'maps, more than one.' );
-pmclass a hll dale maps Integer maps Float { }
-END_PMC
-            const INTVAL pmc_id = Parrot_get_HLL_id( interp, CONST_STRING_GEN(interp, "dale"));
-            if (pmc_id > 0) {
-                Parrot_register_HLL_type( interp, pmc_id, enum_class_Float, entry);
-                Parrot_register_HLL_type( interp, pmc_id, enum_class_Integer, entry);
-            }
-END_C
-
-pmc2c_output_like( <<'END_PMC', <<'END_C', 'maps' );
-pmclass a hll dale maps Integer {
-    void init() {
-    }
-}
-END_PMC
-Parrot_a_init(PARROT_INTERP, PMC *pmc)
-{
-#line 2
-END_C
-
-pmc2c_output_like( <<'END_PMC', <<'END_C', 'maps' );
-pmclass a
-    hll dale
-    maps Integer {
-    void init() {
-    }
-}
-END_PMC
-Parrot_a_init(PARROT_INTERP, PMC *pmc)
-{
-#line 4
-END_C
-
-# test attr/comment line numbering
-pmc2c_output_like( <<'END_PMC', <<'END_C', 'line+pod' );
-pmclass a {
-    ATTR int foo;
-
-    /* Comment comment comment.
-     * Blah blah blah.
-     */
-
-    VTABLE void init() {
-        Parrot_a_attributes * attrs =
-                mem_allocate_zeroed_typed(Parrot_a_attributes);
-
-        attrs->hash = pmc_new(interp, enum_class_Hash);
-
-        PMC_data(SELF) = attrs;
-    }
-}
-END_PMC
-static  void 
-Parrot_a_init(PARROT_INTERP, PMC *pmc)
-{
-#line 8
-END_C
-
-# test EOF/coda line numbering
-# Note: We can't test the whole thing, as the filename component varies
-pmc2c_output_like( <<'END_PMC', <<'END_C', 'line+pod' );
-pmclass a {
-    ATTR int foo;
-
-    /* Comment comment comment.
-     * Blah blah blah.
-     */
-
-    VTABLE void init() {
-        PMC_data(SELF) = NULL;
-    }
-
-}
-
-/* foo bar */
-END_PMC
-} /* Parrot_a_class_init */
-#line 11
-END_C
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/t/tools/pmc2cutils/05-gen_c.t
==============================================================================
--- branches/orderedhash_revamp/t/tools/pmc2cutils/05-gen_c.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/tools/pmc2cutils/05-gen_c.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -19,7 +19,7 @@
     }
     unshift @INC, qq{$topdir/lib};
 }
-use Test::More tests => 44;
+use Test::More tests => 52;
 use Carp;
 use File::Basename;
 use File::Copy;
@@ -44,7 +44,7 @@
     ok( chdir $tdir, 'changed to temp directory for testing' );
 
     my $temppmcdir = qq{$tdir/src/pmc};
-    for ( qq{$tdir/src}, $temppmcdir ) {
+    for ( qq{$tdir/src}, qq{$tdir/include}, qq{$tdir/include/pmc}, $temppmcdir ) {
         ok( mkdir($_), "created $_ under tempdir" );
     }
 
@@ -87,6 +87,8 @@
     ok( chdir $tdir, 'changed to temp directory for testing' );
     my $pmcdir = q{src/pmc};
     ok( ( mkdir qq{$tdir/src} ), "created src/ under tempdir" );
+    ok( ( mkdir qq{$tdir/include} ), "created include/ under tempdir" );
+    ok( ( mkdir qq{$tdir/include/pmc} ), "created include/pmc/ under tempdir" );
     my $temppmcdir = qq{$tdir/src/pmc};
     ok( ( mkdir $temppmcdir ), "created src/pmc/ under tempdir" );
 
@@ -139,6 +141,8 @@
     ok( chdir $tdir, 'changed to temp directory for testing' );
     my $pmcdir = q{src/pmc};
     ok( ( mkdir qq{$tdir/src} ), "created src/ under tempdir" );
+    ok( ( mkdir qq{$tdir/include} ), "created include/ under tempdir" );
+    ok( ( mkdir qq{$tdir/include/pmc} ), "created include/pmc/ under tempdir" );
     my $temppmcdir = qq{$tdir/src/pmc};
     ok( ( mkdir $temppmcdir ), "created src/pmc/ under tempdir" );
 
@@ -190,6 +194,8 @@
     ok( chdir $tdir, 'changed to temp directory for testing' );
     my $pmcdir = q{src/pmc};
     ok( ( mkdir qq{$tdir/src} ), "created src/ under tempdir" );
+    ok( ( mkdir qq{$tdir/include} ), "created include/ under tempdir" );
+    ok( ( mkdir qq{$tdir/include/pmc} ), "created include/pmc/ under tempdir" );
     my $temppmcdir = qq{$tdir/src/pmc};
     ok( ( mkdir $temppmcdir ), "created src/pmc/ under tempdir" );
 

Modified: branches/orderedhash_revamp/t/tools/pmc2cutils/08-pmc-pm.t
==============================================================================
--- branches/orderedhash_revamp/t/tools/pmc2cutils/08-pmc-pm.t	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/t/tools/pmc2cutils/08-pmc-pm.t	Sat Jan 23 01:49:53 2010	(r43541)
@@ -50,6 +50,8 @@
 
 =head1 DESCRIPTION
 
+Test functionality of Parrot::Pmc2c::PMC.
+
 =head1 AUTHOR
 
 Kevin Tew

Added: branches/orderedhash_revamp/t/tools/testdata
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/t/tools/testdata	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,2 @@
+keyboardcat
+saxophonegiraffe

Modified: branches/orderedhash_revamp/tools/build/c2str.pl
==============================================================================
--- branches/orderedhash_revamp/tools/build/c2str.pl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/build/c2str.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -5,7 +5,11 @@
 
 =head1 NAME
 
-tools/build/c2str.pl - constant string support
+tools/build/c2str.pl
+
+=head1 DESCRIPTION
+
+constant string support
 
 =cut
 

Modified: branches/orderedhash_revamp/tools/build/headerizer.pl
==============================================================================
--- branches/orderedhash_revamp/tools/build/headerizer.pl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/build/headerizer.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -14,14 +14,14 @@
 
 =head1 SYNOPSIS
 
-Update the headers in F<include/parrot> with the function declarations in
-the F<*.pmc> or F<*.c> files that correspond to the F<*.o> files passed
-on the command line.
-
     % perl tools/build/headerizer.pl OBJFILES
 
 =head1 DESCRIPTION
 
+Update the headers in F<include/parrot> with the function declarations in
+the F<*.pmc> or F<*.c> files that correspond to the F<*.o> files passed
+on the command line.
+
 =head1 TODO
 
 * Generate docs from funcs
@@ -405,14 +405,15 @@
         if(length($func->{name}) > 29) {
             $assert .= " \\\n    ";
         }
-        $assert .= " __attribute__unused__ int _ASSERT_ARGS_CHECK = ";
+        $assert .= " __attribute__unused__ int _ASSERT_ARGS_CHECK = (";
         if(@asserts) {
             $assert .= "\\\n       ";
-            $assert .= join(" \\\n    || ", @asserts);
+            $assert .= join(" \\\n    , ", @asserts);
         }
         else {
             $assert .= "0";
         }
+        $assert .= ")";
         push(@decls, $assert);
     }
 
@@ -654,6 +655,8 @@
     # In file bar.c
     /* HEADERIZER HFILE: foo.h */
 
+=back
+
 =cut
 
 # Local Variables:

Deleted: branches/orderedhash_revamp/tools/build/jit2c.pl
==============================================================================
--- branches/orderedhash_revamp/tools/build/jit2c.pl	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,530 +0,0 @@
-#! perl
-# Copyright (C) 2001-2006, Parrot Foundation.
-# $Id$
-
-=head1 NAME
-
-tools/build/jit2c.pl - JIT to C
-
-=head1 SYNOPSIS
-
-    % perl tools/build/jit2c.pl <cpu-architecture-name> src/jit_cpu.c
-
-=head1 DESCRIPTION
-
-This script creates F<src/jit_cpu.c>. It parses the JIT file for the
-specified CPU architecture type (F<src/jit/cpu-architecture-name/core.jit>).
-
-=cut
-
-use warnings;
-use strict;
-use lib 'lib';
-
-use Parrot::OpLib::core;
-use Parrot::Op;
-use Parrot::OpTrans::C;
-
-my $trans = Parrot::OpTrans::C->new;
-
-my %type_to_arg = (
-    INT_CONST    => 'ic',
-    NUM_CONST    => 'nc',
-    PMC_CONST    => 'pc',
-    STRING_CONST => 'sc',
-    STR_CONST    => 'sc',
-    INT_REG      => 'i',
-    NUM_REG      => 'n',
-    PMC_REG      => 'p',
-    STRING_REG   => 's',
-    STR_REG      => 's',
-);
-
-my $core_numops = scalar @{$Parrot::OpLib::core::ops};
-my @core_opfunc = map { $_->func_name($trans) } @{$Parrot::OpLib::core::ops};
-my %opcodes;
-
-for ( @{$Parrot::OpLib::core::ops} ) {
-    my $name = join( '_', $_->{NAME}, @{ $_->{ARGS} }[ 0 .. $#{ $_->{ARGS} } ] );
-    $opcodes{$name} = $_->{CODE};
-}
-
-my $cpuarch = shift @ARGV;
-my $genfile = shift @ARGV;
-
-my ( $function, $body, $extern, $header, $asm, $precompiled );
-
-my %templates;
-
-my @jit_funcs;
-my $func_end;
-my ( $normal_op, $cpcf_op, $restart_op );
-my %argmaps;
-my $jit_cpu;
-
-if ( $genfile =~ /jit_cpu.c/ ) {
-    $jit_cpu = 1;
-    push @jit_funcs, "Parrot_jit_fn_info_t _op_jit[$core_numops] = {\n";
-    $func_end   = '_jit';
-    $normal_op  = 'Parrot_jit_normal_op';
-    $cpcf_op    = 'Parrot_jit_cpcf_op';
-    $restart_op = 'Parrot_jit_restart_op';
-    %argmaps    = %Parrot::OpTrans::C::arg_maps;
-}
-else {
-    $jit_cpu = ( $cpuarch eq 'i386' ) ? 0 : 1;
-    push @jit_funcs, "Parrot_jit_fn_info_t op_exec[$core_numops] = {\n";
-    $func_end   = "_exec";
-    $normal_op  = "Parrot_exec_normal_op";
-    $cpcf_op    = "Parrot_exec_cpcf_op";
-    $restart_op = "Parrot_exec_restart_op";
-    %argmaps    = (
-        op => "cur_opcode[%ld]",
-
-        i  => "IREG(%ld)",
-        n  => "NREG(%ld)",
-        p  => "PREG(%ld)",
-        s  => "SREG(%ld)",
-        k  => "PREG(%ld)",
-        ki => "IREG(%ld)",
-
-        ic  => "cur_opcode[%ld]",
-        nc  => "CONST(%ld)",
-        pc  => "CONST(%ld)",
-        sc  => "CONST(%ld)",
-        kc  => "CONST(%ld)",
-        kic => "cur_opcode[%ld]"
-    );
-}
-
-sub readjit {
-    my $file = shift;
-
-    my %ops;
-    my $template;
-
-    local $.;
-
-    open my $IN, '<', $file or die "Can't open file $file: $!";
-    while ( my $line = <$IN> ) {
-        if ( $line =~ m/^#define/ ) {
-            $line =~
-s/PREV_OP\s(..?)\s(\w+)/(jit_info->prev_op) && (*jit_info->prev_op $1 $opcodes{$2})/g;
-            $header .= $line;
-            next;
-        }
-
-        # ignore comment and empty lines
-        next if $line =~ m/^;/ || $line !~ m/\S/;
-
-        if ( !defined($function) && !defined($template) ) {
-            if ( $line =~ m/TEMPLATE\s+(\w+)\s*{/ ) {    #}
-                $template = $1;
-                $asm      = qq{#line $. "$file"\n};
-                next;
-            }
-            else {
-                $line =~ m/(extern\s*)?(\w+)\s*{/;       #}
-                $extern   = ( defined($1) ) ? 1 : 0;
-                $function = $2;
-                $asm      = qq{#line $. "$file"\n};
-                next;
-            }
-        }
-        if ( $line =~ m/^}/ ) {                          #{
-                                                         # 1. check templates
-            while ( my ( $t, $body ) = each %templates ) {
-                if ( $asm =~ /$t\s+/ ) {
-                    my $tbody = $body;
-                    while ( $asm =~ s/\b(s(.).+?\2.*?\2)(?:\s+)?// ) {
-                        eval "\$tbody =~ ${1}g";
-                        die "error in template subst: $@\n" if $@;
-                    }
-                    $asm = $tbody;
-
-                    # reset iterator for next run
-                    keys %templates;
-                    last;
-                }
-            }
-
-            # end of template definition?
-            if ( defined($template) ) {
-                $templates{$template} = $asm;
-                $template = undef;
-                next;
-            }
-
-            # no, end of function
-
-            # then do other substitutions
-            $asm =~ s/([\&\*])([a-zA-Z_]+)\[(\d+)\]/make_subs($1,$2,$3)/ge;
-            $asm =~ s/NEW_FIXUP/Parrot_jit_newfixup(jit_info)/g;
-            $asm =~ s/CUR_FIXUP/jit_info->arena.fixups/g;
-            $asm =~ s/NATIVECODE/jit_info->native_ptr/g;
-            $asm =~ s/CUR_OPCODE/jit_info->cur_op/g;
-            $asm =~ s/cur_opcode/jit_info->cur_op/g;
-            $asm =~ s/MAP\[(\d)\]/MAP($1)/g;
-
-            # set extern if the code calls a function
-            $extern = -1 if $asm =~ /CALL_FUNCTION/;
-            unless ($jit_cpu) {
-
-                # no address of
-                $asm =~ s/&([INSP])REG/$1REG/g;
-                $asm =~ s/&CONST/CONST/g;
-
-                # Use the macro
-                $asm =~ s/CALL_FUNCTION\(\s*jit_info\s*,\s*\(void\*\)\s*(.*)\)/CALL("$1")/g;
-
-                # The ->u.(string|float) is unnecessary.
-                $asm =~ s/\)->u\.(\w+)/)/g;
-                $asm =~
-s/CONST\((\d)\)\s*([><=!]=?)\s*CONST\((\d)\)/RCONST($1)->u.number $2 RCONST($3)->u.number/
-                    if ( $asm =~ /CONST.*CONST/ );
-                $asm =~
-s/(emitm_pushl_m[^\n]*CONST[^\n]*)/$1\\\n        Parrot_exec_add_text_rellocation(jit_info->objfile, jit_info->native_ptr, RTYPE_DATA, "const_table", 0);/g;
-                $asm =~ s/jit_emit_end/exec_emit_end/;
-            }
-            if ( ( $cpuarch eq 'ppc' ) && ( $genfile ne "src/jit_cpu.c" ) ) {
-                $asm =~
-s/jit_emit_mov_ri_i\(jit_info->native_ptr, ISR([12]), &CONST\((\d)\)\);/load_nc(jit_info->native_ptr, ISR$1, ECONST($2));/g;
-            }
-
-            $asm =~ s/PUSH_MAPPED_REG\((\d)\)/Parrot_jit_push_registers(jit_info,$1)/g;
-            $ops{$function} = [ $asm, $extern ];
-            $function = undef;
-        }
-        unless ($jit_cpu) {
-            $line =~ s/emitm_pushl_i/emitm_pushl_m/ if $line =~ /string/;
-        }
-        $asm .= $line;
-    }
-    return %ops;
-}
-
-use Parrot::Vtable;
-my $vtable;
-my $vjit = 0;
-
-sub vtable_num {
-    my $meth = shift;
-    unless ($vtable) {
-        $vtable = parse_vtable();
-    }
-    my $i = 0;
-    $vjit++;
-    for my $entry ( @{$vtable} ) {
-        next if $entry->[4] =~ /MMD_/;    # RT#46915 all
-        return $i if ( $entry->[1] eq $meth );
-        $i++;
-    }
-    die("vtable not found for $meth\n");
-    return;
-}
-
-my $jit_emit_n = ( $genfile =~ /jit_cpu.c/ ) ? 2 : 1;
-
-open my $JITCPU, '>', $genfile or die;
-
-print $JITCPU <<"END_C";
-/* ex: set ro:
- * !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
- *
- * This file is generated automatically from 'src/jit/$cpuarch/core.jit'
- * by $0.
- *
- * Any changes made here will be lost!
- *
- */
-
-/* HEADERIZER HFILE: none */
-/* HEADERIZER STOP */
-
-#include<parrot/parrot.h>
-#ifdef HAVE_COMPUTED_GOTO
-#  include<parrot/oplib/core_ops_cgp.h>
-#endif
-#include"parrot/exec.h"
-#include"jit.h"
-#define JIT_EMIT $jit_emit_n
-
-/* Disable "truncation from 'const int' to 'char'" warning. */
-#if defined (_MSC_VER)
-#pragma warning(disable: 4305)
-#endif
-
-/*
- *define default jit_funcs, if architecture doesn't have these optimizations
- */
-#define Parrot_jit_vtable1_op Parrot_jit_normal_op
-#define Parrot_jit_vtable1r_op Parrot_jit_normal_op
-/*
- * the numbers correspond to the registers
- */
-#define Parrot_jit_vtable_111_op Parrot_jit_normal_op
-#define Parrot_jit_vtable_112_op Parrot_jit_normal_op
-#define Parrot_jit_vtable_221_op Parrot_jit_normal_op
-#define Parrot_jit_vtable_1121_op Parrot_jit_normal_op
-#define Parrot_jit_vtable_1123_op Parrot_jit_normal_op
-#define Parrot_jit_vtable_2231_op Parrot_jit_normal_op
-#define Parrot_jit_vtable_1r223_op Parrot_jit_normal_op
-#define Parrot_jit_vtable_1r332_op Parrot_jit_normal_op
-#define Parrot_jit_vtable_1r221_op Parrot_jit_normal_op
-
-#define Parrot_jit_vtable_ifp_op Parrot_jit_cpcf_op
-#define Parrot_jit_vtable_unlessp_op Parrot_jit_cpcf_op
-#define Parrot_jit_vtable_newp_ic_op Parrot_jit_normal_op
-
-#define Parrot_jit_restart_op Parrot_jit_cpcf_op
-
-#include"jit_emit.h"
-
-#undef CONST
-#ifndef MAP
-# define MAP(i) jit_info->optimizer->map_branch[jit_info->op_i + (i)]
-#endif
-
-#define ROFFS_INT(x) REG_OFFS_INT(jit_info->cur_op[x])
-#define ROFFS_NUM(x) REG_OFFS_NUM(jit_info->cur_op[x])
-#define ROFFS_STR(x) REG_OFFS_STR(jit_info->cur_op[x])
-#define ROFFS_PMC(x) REG_OFFS_PMC(jit_info->cur_op[x])
-#
-END_C
-
-if ($jit_cpu) {
-    print $JITCPU <<'END_C';
-#define IREG(i) REG_INT(interp, jit_info->cur_op[i])
-#define NREG(i) REG_NUM(interp, jit_info->cur_op[i])
-#define PREG(i) REG_PMC(interp, jit_info->cur_op[i])
-#define SREG(i) REG_STR(interp, jit_info->cur_op[i])
-#define CONST(i) interp->code->const_table->constants[jit_info->cur_op[i]]
-END_C
-}
-else {
-    print $JITCPU <<'END_C';
-#define CONST(i) (int *)(jit_info->cur_op[i] * sizeof(PackFile_Constant) + offsetof(PackFile_Constant, u))
-#define RCONST(i) interp->code->const_table->constants[jit_info->cur_op[i]]
-#define CALL(f) Parrot_exec_add_text_rellocation_func(jit_info->objfile, jit_info->native_ptr, f); \
-    emitm_calll(jit_info->native_ptr, EXEC_CALLDISP);
-
-END_C
-}
-if ( $cpuarch eq 'ppc' && $genfile ne 'src/jit_cpu.c' ) {
-    print $JITCPU
-        "#define ECONST(i) (int *)(jit_info->cur_op[i] * sizeof(PackFile_Constant) + 8)\n";
-}
-
-my %core_ops = readjit("src/jit/$cpuarch/core.jit");
-
-print $JITCPU $header if $header;
-
-my $njit = keys %core_ops;
-
-my $jit_fn_retn   = 'void';
-my $jit_fn_params = '(Parrot_jit_info_t *jit_info, Interp *interp)';
-
-for my $i ( 0 .. $core_numops - 1) {
-    $body   = $core_ops{ $core_opfunc[$i] }[0];
-    $extern = $core_ops{ $core_opfunc[$i] }[1];
-
-    my $jit_func;
-    my $op = $Parrot::OpLib::core::ops->[$i];
-
-    $precompiled = 0;
-    if ( !defined $body ) {
-        $precompiled = 1;
-        $extern      = 1;
-        my $opbody = $op->body;
-
-        # retranslate VTABLE_macro to the expanded form
-        $opbody =~ s/
-            \bVTABLE_(\w+)
-            \s*\(
-            interp,\s*
-            {{\@(\d)}}/
-            {{\@$2}}->vtable->$1(interp, {{\@$2}}/x;
-
-        if ( $op->full_name eq 'new_p_ic' ) {
-            $jit_func = "Parrot_jit_vtable_newp_ic_op";
-            $opbody =~ /vtable->(\w+)/;
-            $extern = 2;    # fake number
-                            #print "$jit_func $extern\n";
-        }
-
-        # jitable vtable funcs:
-        # *) $1->vtable->{vtable}(interp, $1)
-        elsif (
-            $opbody =~ /
-        ^(?:.*\.ops")\s+
-        {{\@1}}->vtable->
-        (\w+)
-        \(interp,
-        \s*
-        {{\@1}}
-        \);
-        \s+{{\+=\d}}/xm
-            )
-        {
-            $jit_func = 'Parrot_jit_vtable1_op';
-            $extern   = vtable_num($1);
-
-            #print $op->full_name .": $jit_func $extern\n";
-        }
-
-        # *) $1 = $2->vtable->{vtable}(interp, $2)
-        elsif (
-            $opbody =~ /
-        ^(?:.*\.ops")\s+
-        {{\@1}}\s*=\s*
-        {{\@2}}->vtable->
-        (\w+)
-        \(interp,
-        \s*
-        {{\@2}}
-        \);
-        \s+{{\+=\d}}/xm
-            )
-        {
-            $jit_func = 'Parrot_jit_vtable1r_op';
-            $extern   = vtable_num($1);
-
-            #print $op->full_name .": $jit_func $extern\n";
-        }
-
-        # *) $X->vtable->{vtable}(interp, $Y, $Z)
-        elsif (
-            $opbody =~ /
-        ^(?:.*\.ops")\s+
-        {{\@(\d)}}->vtable->
-        (\w+)
-        \(interp,
-        \s*
-        {{\@(\d)}},\s*{{\@(\d)}}
-        \);
-        \s+{{\+=\d}}/xm
-            )
-        {
-            $jit_func = "Parrot_jit_vtable_$1$3$4_op";
-            $extern   = vtable_num($2);
-
-            #print $op->full_name .": $jit_func $extern\n";
-        }
-
-        # *) $R = $X->vtable->{vtable}(interp, $Y, $Z)
-        elsif (
-            $opbody =~ /
-        ^(?:.*\.ops")\s+
-        {{\@(\d)}}\s*=\s*
-        {{\@(\d)}}->vtable->
-        (\w+)
-        \(interp,
-        \s*
-        {{\@(\d)}},\s*{{\@(\d)}}
-        \);
-        \s+{{\+=\d}}/xm
-            )
-        {
-            $jit_func = "Parrot_jit_vtable_$1r$2$4$5_op";
-            $extern   = vtable_num($3);
-
-            #print $op->full_name .": $jit_func $extern\n";
-        }
-
-        # *) $X->vtable->{vtable}(interp, $Y, $Z, $A)
-        elsif (
-            $opbody =~ /
-        ^(?:.*\.ops")\s+
-        {{\@(\d)}}->vtable->
-        (\w+)
-        \(interp,
-        \s*
-        {{\@(\d)}},\s*{{\@(\d)}},\s*{{\@(\d)}}
-        \);
-        \s+{{\+=\d}}/xm
-            )
-        {
-            $jit_func = "Parrot_jit_vtable_$1$3$4$5_op";
-            $extern   = vtable_num($2);
-
-            #print $op->full_name .": $jit_func $extern\n";
-        }
-
-        # some specials
-        elsif ( $op->full_name eq 'if_p_ic' ) {
-            $jit_func = "Parrot_jit_vtable_ifp_op";
-            $opbody =~ /vtable->(\w+)/;
-            $extern = vtable_num($1);
-
-            #print "$jit_func $extern\n";
-        }
-        elsif ( $op->full_name eq 'unless_p_ic' ) {
-            $jit_func = "Parrot_jit_vtable_unlessp_op";
-            $opbody =~ /vtable->(\w+)/;
-            $extern = vtable_num($1);
-
-            #print "$jit_func $extern\n";
-        }
-
-        elsif ( $op->jump =~ /JUMP_RESTART/ ) {
-            $jit_func = $restart_op;
-        }
-        elsif ( $op->jump ) {
-            $jit_func = $cpcf_op;
-        }
-        else {
-            $jit_func = $normal_op;
-        }
-    }
-    else {
-        $jit_func = "$core_opfunc[$i]$func_end";
-    }
-
-    unless ($precompiled) {
-        print $JITCPU "\nstatic $jit_fn_retn\n"
-            . $core_opfunc[$i]
-            . $func_end
-            . $jit_fn_params . "\n{\n"
-            . $body . "}\n";
-    }
-    push @jit_funcs, "{ $jit_func, $extern },         " . "/* op $i: $core_opfunc[$i] */\n";
-}
-
-print $JITCPU @jit_funcs, "};\n";
-
-if ( $genfile =~ /jit_cpu.c/ ) {
-    print $JITCPU <<"EOC";
-    Parrot_jit_fn_info_t *op_jit = &_op_jit[0];
-
-    extern int jit_op_count(void);
-    int jit_op_count(void) { return $core_numops; }
-EOC
-}
-
-# append the C code coda
-print $JITCPU <<"EOC";
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- *   buffer-read-only: t
- * End:
- * vim: expandtab shiftwidth=4:
- */
-EOC
-
-print("jit2c: JITed $njit (+ $vjit vtable) of $core_numops ops\n");
-
-sub make_subs {
-    my ( $ptr, $type, $index ) = @_;
-
-    return ( ( $ptr eq '&' ? '&' : '' ) . sprintf( $argmaps{ $type_to_arg{$type} }, $index ) );
-}
-
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/tools/build/nativecall.pl
==============================================================================
--- branches/orderedhash_revamp/tools/build/nativecall.pl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/build/nativecall.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -41,9 +41,13 @@
 my %sig_table = (
     p => {
         as_proto => "void *",
-        other_decl => "PMC * const final_destination = pmc_new(interp, enum_class_UnManagedStruct);",
+        other_decl => "PMC * final_destination = PMCNULL;",
         sig_char => "P",
-        ret_assign => "VTABLE_set_pointer(interp, final_destination, return_data);    set_nci_P(interp, &st, final_destination);",
+        ret_assign => "if (return_data != NULL) {\n" .
+             "        final_destination = pmc_new(interp, enum_class_UnManagedStruct);\n" .
+             "        VTABLE_set_pointer(interp, final_destination, return_data);\n" .
+             "    }\n" .
+             "    Parrot_pcc_fill_returns_from_c_args(interp, call_object, \"P\", final_destination);",
     },
     i => { as_proto => "int",    sig_char => "I" },
     l => { as_proto => "long",   sig_char => "I" },
@@ -53,7 +57,7 @@
     d => { as_proto => "double", sig_char => "N" },
     t => { as_proto => "char *",
            other_decl => "STRING *final_destination;",
-           ret_assign => "final_destination = Parrot_str_new(interp, return_data, 0);\n    set_nci_S(interp, &st, final_destination);",
+           ret_assign => "final_destination = Parrot_str_new(interp, return_data, 0);\n    Parrot_pcc_fill_returns_from_c_args(interp, call_object, \"S\", final_destination);",
            sig_char => "S" },
     v => { as_proto => "void",
            return_type => "void *",
@@ -62,24 +66,24 @@
            func_call_assign => ""
          },
     P => { as_proto => "PMC *", sig_char => "P" },
-    O => { as_proto => "PMC *", returns => "", sig_char => "P" },
+    O => { as_proto => "PMC *", returns => "", sig_char => "Pi" },
     J => { as_proto => "PARROT_INTERP", returns => "", sig_char => "" },
     S => { as_proto => "STRING *", sig_char => "S" },
     I => { as_proto => "INTVAL", sig_char => "I" },
     N => { as_proto => "FLOATVAL", sig_char => "N" },
     b => { as_proto => "void *", as_return => "", sig_char => "S" },
-    B => { as_proto => "void **", as_return => "", sig_char => "S" },
+    B => { as_proto => "char **", as_return => "", sig_char => "S" },
     # These should be replaced by modifiers in the future
     2 => { as_proto => "short *",  sig_char => "P", return_type => "short",
-           ret_assign => "set_nci_I(interp, &st, *return_data);" },
+           ret_assign => 'Parrot_pcc_fill_returns_from_c_args(interp, call_object, "I", return_data);' },
     3 => { as_proto => "int *",  sig_char => "P", return_type => "int",
-           ret_assign => "set_nci_I(interp, &st, *return_data);" },
+           ret_assign => 'Parrot_pcc_fill_returns_from_c_args(interp, call_object, "I", return_data);' },
     4 => { as_proto => "long *",  sig_char => "P", return_type => "long",
-           ret_assign => "set_nci_I(interp, &st, *return_data);" },
+           ret_assign => 'Parrot_pcc_fill_returns_from_c_args(interp, call_object, "I", return_data);' },
     L => { as_proto => "long *", as_return => "" },
     T => { as_proto => "char **", as_return => "" },
     V => { as_proto => "void **", as_return => "", sig_char => "P" },
-    '@' => { as_proto => "PMC *", as_return => "", cname => "xAT_", sig_char => '@' },
+    '@' => { as_proto => "PMC *", as_return => "", cname => "xAT_", sig_char => 'Ps' },
 );
 
 for (values %sig_table) {
@@ -87,7 +91,8 @@
     if (not exists $_->{return_type}) { $_->{return_type} = $_->{as_proto} }
     if (not exists $_->{return_type_decl}) { $_->{return_type_decl} = $_->{return_type} }
     if (not exists $_->{ret_assign} and exists $_->{sig_char}) {
-        $_->{ret_assign} = "set_nci_".$_->{sig_char}."(interp, &st, return_data);";
+        $_->{ret_assign} = 'Parrot_pcc_fill_returns_from_c_args(interp, call_object, "'
+                           . $_->{sig_char} . '", return_data);';
     }
     if (not exists $_->{func_call_assign}) {
         $_->{func_call_assign} = "return_data = "
@@ -120,6 +125,7 @@
         next;
     }
 
+    my @fill_params;
     my @extra_preamble;
     my @extra_postamble;
     my @temps;
@@ -132,8 +138,8 @@
             die "Invalid argument signature char '$_' on line $. of $ARGV"
                 unless exists $sig_table{$_}{sig_char};
             push @arg,
-                make_arg( $_, $reg_num++, \$temp_cnt, \@temps, \@extra_preamble,
-                \@extra_postamble );
+                make_arg( $_, $reg_num++, \$temp_cnt, \@temps, \@fill_params,
+                \@extra_preamble, \@extra_postamble );
             $sig .= $sig_table{$_}{sig_char};
             $_ eq 'J' && $reg_num--;
         }
@@ -141,14 +147,14 @@
 
     my $ret_sig = $sig_table{$ret};
 
-    if ($args =~ /[234]/) {
+    if ($args =~ /[234V]/) {
         push @nci_defs, create_function(
             $sig, $ret,
             $args, [@arg],
             $ret_sig->{as_return}, $ret_sig->{return_type_decl},
             $ret_sig->{func_call_assign}, $ret_sig->{other_decl},
             $ret_sig->{ret_assign}, \@temps,
-            \@extra_preamble, \@extra_postamble,
+            \@fill_params, \@extra_preamble, \@extra_postamble,
             \@put_pointer_nci_too,
         );
     }
@@ -159,7 +165,7 @@
             $ret_sig->{as_return}, $ret_sig->{return_type_decl},
             $ret_sig->{func_call_assign}, $ret_sig->{other_decl},
             $ret_sig->{ret_assign}, \@temps,
-            \@extra_preamble, \@extra_postamble,
+            \@fill_params, \@extra_preamble, \@extra_postamble,
             \@put_pointer,
         );
     }
@@ -201,7 +207,7 @@
  */
 
 /* nci.c
- *  Copyright (C) 2001-2007, Parrot Foundation.
+ *  Copyright (C) 2001-2009, Parrot Foundation.
  *  SVN Info
  *     \$Id\$
  *  Overview:
@@ -218,8 +224,8 @@
 #include "pmc/pmc_managedstruct.h"
 #include "pmc/pmc_nci.h"
 #include "pmc/pmc_pointer.h"
+#include "pmc/pmc_callcontext.h"
 #include "nci.str"
-#include "jit.h"
 
 /* HEADERIZER HFILE: none */
 /* HEADERIZER STOP */
@@ -231,122 +237,7 @@
  * - if it returns NULL, the hardcoded version will do the job
  */
 
-#if defined(HAS_JIT) && defined(I386)
-#  include "parrot/exec.h"
-#  include "jit.h"
-#  define CAN_BUILD_CALL_FRAMES
-#endif
-
-/*
- * helper funcs - get argument n
- */
-static INTVAL
-get_nci_I(PARROT_INTERP, ARGMOD(call_state *st), int n)
-{
-    if (n >= st->src.n)
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-            "too few arguments passed to NCI function");
-
-    Parrot_fetch_arg_nci(interp, st);
-
-    return UVal_int(st->val);
-}
-
-static FLOATVAL
-get_nci_N(PARROT_INTERP, ARGMOD(call_state *st), int n)
-{
-    if (n >= st->src.n)
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-            "too few arguments passed to NCI function");
-
-    Parrot_fetch_arg_nci(interp, st);
-
-    return UVal_num(st->val);
-}
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static STRING*
-get_nci_S(PARROT_INTERP, ARGMOD(call_state *st), int n)
-{
-    /* TODO or act like below? */
-    if (n >= st->src.n)
-        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-            "too few arguments passed to NCI function");
-
-    Parrot_fetch_arg_nci(interp, st);
-
-    return UVal_str(st->val);
-}
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static PMC*
-get_nci_P(PARROT_INTERP, ARGMOD(call_state *st), int n)
-{
-    /*
-     * excessive args are passed as NULL
-     * used by e.g. MMD infix like __add
-     */
-    if (n < st->src.n)
-        Parrot_fetch_arg_nci(interp, st);
-    else
-        UVal_pmc(st->val) = PMCNULL;
-
-    return UVal_pmc(st->val);
-}
-
-#define GET_NCI_I(n) get_nci_I(interp, &st, n)
-#define GET_NCI_S(n) get_nci_S(interp, &st, n)
-#define GET_NCI_N(n) get_nci_N(interp, &st, n)
-#define GET_NCI_P(n) get_nci_P(interp, &st, n)
-
-/*
- * set return value
- */
-static void
-set_nci_I(PARROT_INTERP, ARGOUT(call_state *st), INTVAL val)
-{
-    Parrot_init_ret_nci(interp, st, "I");
-    if (st->dest.i < st->dest.n) {
-        UVal_int(st->val) = val;
-        Parrot_convert_arg(interp, st);
-        Parrot_store_arg(interp, st);
-    }
-}
-
-static void
-set_nci_N(PARROT_INTERP, ARGOUT(call_state *st), FLOATVAL val)
-{
-    Parrot_init_ret_nci(interp, st, "N");
-    if (st->dest.i < st->dest.n) {
-        UVal_num(st->val) = val;
-        Parrot_convert_arg(interp, st);
-        Parrot_store_arg(interp, st);
-    }
-}
-
-static void
-set_nci_S(PARROT_INTERP, ARGOUT(call_state *st), STRING *val)
-{
-    Parrot_init_ret_nci(interp, st, "S");
-    if (st->dest.i < st->dest.n) {
-        UVal_str(st->val) = val;
-        Parrot_convert_arg(interp, st);
-        Parrot_store_arg(interp, st);
-    }
-}
-
-static void
-set_nci_P(PARROT_INTERP, ARGOUT(call_state *st), PMC* val)
-{
-    Parrot_init_ret_nci(interp, st, "P");
-    if (st->dest.i < st->dest.n) {
-        UVal_pmc(st->val) = val;
-        Parrot_convert_arg(interp, st);
-        Parrot_store_arg(interp, st);
-    }
-}
+#include "frame_builder.h"
 
 #ifndef CAN_BUILD_CALL_FRAMES
 /* All our static functions that call in various ways. Yes, terribly
@@ -362,75 +253,96 @@
     # we have to fetch all to temps, so that the call code
     # can operate in sequence
     #
-    my ( $argtype, $reg_num, $temp_cnt_ref, $temps_ref, $extra_preamble_ref, $extra_postamble_ref )
+    my ( $argtype, $reg_num, $temp_cnt_ref, $temps_ref, $fill_params_ref, $extra_preamble_ref, $extra_postamble_ref )
         = @_;
 
     local $_ = $argtype;
     my $temp_num = ${$temp_cnt_ref}++;
     /p/ && do {
-        push @{$temps_ref},          "PMC *t_$temp_num;";
-        push @{$extra_preamble_ref}, "t_$temp_num = GET_NCI_P($reg_num);";
-        return "VTABLE_get_pointer(interp, t_$temp_num)";
+        push @{$temps_ref},       "PMC *t_$temp_num;";
+        push @{$fill_params_ref}, "&t_$temp_num";
+        return "PMC_IS_NULL((PMC*)t_$temp_num)? (void*)NULL:VTABLE_get_pointer(interp, t_$temp_num)";
     };
     /V/ && do {
         push @{$temps_ref},          "PMC *t_$temp_num;";
         push @{$temps_ref},          "void *v_$temp_num;";
-        push @{$extra_preamble_ref}, "t_$temp_num = GET_NCI_P($reg_num);";
+        push @{$fill_params_ref},    "&t_$temp_num";
         push @{$extra_preamble_ref}, "v_$temp_num = VTABLE_get_pointer(interp, t_$temp_num);";
         push @{$extra_postamble_ref}, "VTABLE_set_pointer(interp, t_$temp_num, v_$temp_num);";
         return "&v_$temp_num";
     };
-    /[ilIscfdNS]/ && do {
+    /[INS]/ && do {
+        my $ret_type = $sig_table{$_}{return_type};
+        push @{$temps_ref},       "$ret_type t_$temp_num;";
+        push @{$fill_params_ref}, "&t_$temp_num";
+        return "t_$temp_num";
+    };
+    /[ilcs]/ && do {
         my $ret_type = $sig_table{$_}{return_type};
         push @{$temps_ref},          "$ret_type t_$temp_num;";
-        push @{$extra_preamble_ref}, "t_$temp_num = ($ret_type)GET_NCI_$sig_table{$_}{sig_char}($reg_num);";
+        push @{$temps_ref},          "INTVAL ti_$temp_num;";
+        push @{$fill_params_ref},    "&ti_$temp_num";
+        push @{$extra_preamble_ref}, "t_$temp_num = ($ret_type)ti_$temp_num;";
+        return "t_$temp_num";
+    };
+    /[fd]/ && do {
+        my $ret_type = $sig_table{$_}{return_type};
+        push @{$temps_ref},          "$ret_type t_$temp_num;";
+        push @{$temps_ref},          "FLOATVAL tf_$temp_num;";
+        push @{$fill_params_ref},    "&tf_$temp_num";
+        push @{$extra_preamble_ref}, "t_$temp_num = ($ret_type)tf_$temp_num;";
         return "t_$temp_num";
     };
     /[234]/ && do {
         my $ret_type = $sig_table{$_}{return_type};
         push @{$temps_ref},          "PMC *t_$temp_num;";
         push @{$temps_ref},          "$ret_type i_$temp_num;";
-        push @{$extra_preamble_ref}, "t_$temp_num = GET_NCI_P($reg_num);";
+        push @{$fill_params_ref},    "&t_$temp_num";
         push @{$extra_preamble_ref}, "i_$temp_num = ($ret_type) VTABLE_get_integer(interp, t_$temp_num);";
         push @{$extra_postamble_ref}, "VTABLE_set_integer_native(interp, t_$temp_num, i_$temp_num);";
         return "&i_$temp_num";
     };
     /t/ && do {
-        push @{$temps_ref}, "char *t_$temp_num;";
+        push @{$temps_ref},          "char *t_$temp_num;";
+        push @{$temps_ref},          "STRING *ts_$temp_num;";
+        push @{$fill_params_ref},    "&ts_$temp_num";
         push @{$extra_preamble_ref},
-            "{STRING * s= GET_NCI_S($reg_num); t_$temp_num = s ? Parrot_str_to_cstring(interp, s) : (char *) NULL;}";
+            "t_$temp_num = ts_$temp_num ? Parrot_str_to_cstring(interp, ts_$temp_num) : (char *) NULL;";
         push @{$extra_postamble_ref}, "do { if (t_$temp_num) Parrot_str_free_cstring(t_$temp_num); } while (0);";
         return "t_$temp_num";
     };
     /b/ && do {
         push @{$temps_ref},          "STRING *t_$temp_num;";
-        push @{$extra_preamble_ref}, "t_$temp_num = GET_NCI_S($reg_num);";
-        return "PObj_bufstart(t_$temp_num)";
+        push @{$fill_params_ref},    "&t_$temp_num";
+        return "Buffer_bufstart(t_$temp_num)";
     };
     /B/ && do {
-        push @{$temps_ref}, "char *s_$temp_num;\n    char *t_$temp_num;\n    void** v_$temp_num = (void **) &t_$temp_num;";
+        push @{$temps_ref},           "char *t_$temp_num;";
+        push @{$temps_ref},           "char** v_$temp_num = &t_$temp_num;";
+        push @{$temps_ref},           "STRING *ts_$temp_num;";
+        push @{$fill_params_ref},     "&ts_$temp_num";
         push @{$extra_preamble_ref},
-            "{STRING * s= GET_NCI_S($reg_num); t_$temp_num = s ? Parrot_str_to_cstring(interp, s) : (char *) NULL; s_$temp_num = t_$temp_num;}";
-        push @{$extra_postamble_ref}, "do { if (s_$temp_num) Parrot_str_free_cstring(s_$temp_num); } while (0);";
+            "t_$temp_num = ts_$temp_num ? Parrot_str_to_cstring(interp, ts_$temp_num) : (char *) NULL;";
+        push @{$extra_postamble_ref}, "do { if (t_$temp_num) Parrot_str_free_cstring(t_$temp_num); } while (0);";
         return "v_$temp_num";
     };
     /J/ && do {
         return "interp";
     };
     /[OP\@]/ && do {
-        push @{$temps_ref},          "PMC *t_$temp_num;";
-        push @{$extra_preamble_ref}, "t_$temp_num = GET_NCI_P($reg_num);";
-        return "PMC_IS_NULL(t_$temp_num) ? NULL : t_$temp_num";
+        push @{$temps_ref},       "PMC *t_$temp_num;";
+        push @{$fill_params_ref}, "&t_$temp_num";
+        return "t_$temp_num";
     };
     return;
 }
 
 sub create_function {
     my (
-        $sig,          $return,        $params,             $args,
-        $ret_type,     $ret_type_decl, $return_assign,      $other_decl,
-        $final_assign, $temps_ref,     $extra_preamble_ref, $extra_postamble_ref,
-        $put_pointer_ref,
+        $sig,                 $return,          $params,          $args,
+        $ret_type,            $ret_type_decl,   $return_assign,   $other_decl,
+        $final_assign,        $temps_ref,       $fill_params_ref, $extra_preamble_ref,
+        $extra_postamble_ref, $put_pointer_ref,
     ) = @_;
 
     my $func = '';
@@ -438,10 +350,13 @@
     $other_decl ||= "";
 
     $other_decl .= join( "\n    ", @{$temps_ref} );
-    my $call_state      = 'call_state st;';
-    my $extra_preamble  = join( "\n    ", @{$extra_preamble_ref} );
-    my $extra_postamble = join( "\n    ", @{$extra_postamble_ref} );
-    my $return_data =
+    my $call_object_decl = <<"CALLOBJECT";
+    PMC *ctx         = CURRENT_CONTEXT(interp);
+    PMC *call_object = Parrot_pcc_get_signature(interp, ctx);
+CALLOBJECT
+    my $extra_preamble   = join( "\n    ", @{$extra_preamble_ref} );
+    my $extra_postamble  = join( "\n    ", @{$extra_postamble_ref} );
+    my $return_data_decl =
         "$return_assign $final_assign" =~ /return_data/
         ? qq{$ret_type_decl return_data;}
         : q{};
@@ -451,6 +366,8 @@
         my $proto = join ', ', map { $sig_table{$_}{as_proto} } split( m//, $params );
 
         my $call_params = join( ",", @$args );
+        my $fill_params = join( ", ", @$fill_params_ref );
+        $fill_params = ", " . $fill_params if($fill_params);
 
         $func = <<"HEADER";
 static void
@@ -459,10 +376,10 @@
     typedef $ret_type (*func_t)($proto);
     func_t pointer;
     void *orig_func;
-    $call_state
-    $return_data
+    $call_object_decl
+    $return_data_decl
     $other_decl
-    Parrot_init_arg_nci(interp, &st, \"$sig\");
+    Parrot_pcc_fill_params_from_c_args(interp, call_object, \"$sig\"$fill_params);
     $extra_preamble
 
     GETATTR_NCI_orig_func(interp, self, orig_func);
@@ -476,17 +393,15 @@
     else {
 
         # Things are more simple, when there are no params
-        # call state var not needed if there are no params and a void return
-        $call_state = '' if 'v' eq $return;
         $func       = <<"HEADER";
 static void
 pcf_${return}_(PARROT_INTERP, PMC *self)
 {
     $ret_type (*pointer)(void);
     void *orig_func;
-    $return_data
+    $return_data_decl
     $other_decl
-    $call_state
+    $call_object_decl
     $extra_preamble
 
     GETATTR_NCI_orig_func(interp, self, orig_func);

Modified: branches/orderedhash_revamp/tools/build/pmc2c.pl
==============================================================================
--- branches/orderedhash_revamp/tools/build/pmc2c.pl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/build/pmc2c.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -86,8 +86,8 @@
 
 =head2 Other Options
 
-Create fooX.c and pmc_fooX.h from fooX.dump files, also create libfoo.c
-containing the initialization function for all fooX PMCs.
+Create foo.c and pmc_foo.h from foo.dump files, also create libfoo.c
+containing the initialization function for all foo PMCs.
 
     % perl tools/build/pmc2c.pl --library libfoo -c \
            src/pmc/foo1.pmc src/pmc/foo2.pmc ...
@@ -117,6 +117,11 @@
 
 =back
 
+=head1 NOTES
+
+You must use lowercase filenames for C<.pmc> files, and lowercase group
+names in the PMC specification in those files.
+
 =cut
 
 # Local Variables:

Modified: branches/orderedhash_revamp/tools/dev/bench_op.pir
==============================================================================
--- branches/orderedhash_revamp/tools/dev/bench_op.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/dev/bench_op.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -81,7 +81,7 @@
 
     # Specification of command line arguments.
     .local pmc getopts
-    getopts = new "Getopt::Obj"
+    getopts = new ["Getopt";"Obj"]
     # getopts."notOptStop"(1)
     push getopts, "version"
     push getopts, "verbose=i"

Modified: branches/orderedhash_revamp/tools/dev/branch_status.pl
==============================================================================
--- branches/orderedhash_revamp/tools/dev/branch_status.pl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/dev/branch_status.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -2,10 +2,21 @@
 # $Id$
 # Copyright (C) 2009, Parrot Foundation.
 
-=head1 branch_status
+=head1 NAME
+
+tools/dev/branch_status.pl
+
+=head1 DESCRIPTION
 
 Generate a report to help developers determine status of repository branches.
 
+This program uses modules that are not intended to be parrot requirements.
+
+Prerequisites:  Perl 5.10; XML::Twig; Perl6::Form.
+
+Assumes that you have a command line svn in your path, but doesn't have
+to be run in a working copy.
+
 =cut
 
 use v5.10.0;
@@ -101,13 +112,9 @@
 
 say '+', '=' x 68, '+';
 
-__END__
-
-=head1 Notes
-
-This program uses modules that are not intended to be parrot requirements.
-
-Assumes that you have a command line svn in your path, but doesn't have
-to be run in a working copy.
-
-=cut
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Added: branches/orderedhash_revamp/tools/dev/checkdepend.pl
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/tools/dev/checkdepend.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,189 @@
+#! perl
+
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+use strict;
+use warnings;
+
+use Cwd qw(abs_path getcwd realpath);
+use Fatal qw(open);
+use File::Spec;
+use Test::More;
+use Test::Harness;
+
+=head1 NAME
+
+tools/dev/checkdepend.pl
+
+=head1 DESCRIPTION
+
+A braindead script to check that every F<.c> file has makefile deps
+on its includes.
+
+=head1 REQUIREMENTS
+
+A built parrot (Configure and make) to generate all files so we can analyze
+them. Ack is used to find the files. We are not currently requiring ack
+for development, so this is an optional test.
+
+=cut
+
+die 'no Makefile found; This tool requires a full build for analysis.'
+    unless -e 'Makefile';
+
+my $files = `ack -fa {src,compilers,include} | grep '\\.[ch]\$'`;
+
+our %deps;
+
+foreach my $file (sort split /\n/, $files) {
+    # For now, skip any files that have generated dependencies
+    next if $file =~ m{src/(ops|dynoplibs|dynpmc|pmc)/};
+    next if $file =~ m{src/string/(charset|encoding)/};
+
+    open my $fh, '<', $file;
+    my $guts;
+    {
+        local undef $/;
+        $guts = <$fh>;
+    }
+
+    # Ingore anything inside a c-style comment.
+    $guts =~ s{\Q/*\E.*?\Q*/}{}gm;
+
+    my @includes = $guts =~ m/#include "(.*)"/g;
+
+    # Canonicalize each of these includes.
+
+    $deps{$file} = [ ];
+    foreach my $include (@includes) {
+        # same dir as file?
+        my $file_dir = (File::Spec->splitpath($file))[1];
+        my $make_dep = collapse_path(File::Spec->catfile($file_dir,$include));
+        if (defined($make_dep) && -f $make_dep) {
+            push @{$deps{$file}}, $make_dep;
+            next;
+        }
+
+        # global 'include' dir?
+        $make_dep = collapse_path(File::Spec->catfile('include',$include));
+        if (defined($make_dep) && -f $make_dep) {
+            push @{$deps{$file}}, $make_dep;
+            next;
+        }
+
+        diag "couldn't find $include, included from $file";
+    }
+}
+
+plan('no_plan');
+
+open my $mf, '<', "Makefile";
+my $rules;
+{
+    local undef $/;
+    $rules = <$mf>;
+}
+
+# convert all \-newline continuations into single lines for ease of processing.
+$rules =~ s/\\\n//g;
+
+# replace all _DIR variables with their expansions.
+while ($rules =~ s/^([A-Z_]+_DIR)\s*:?=\s*(\S*)$//m) {
+    my ($var,$val) = ($1, $2);
+    $rules =~ s/\$\($var\)/$val/g;
+}
+
+# expand PARROT_H_HEADERS
+$rules =~ m/^PARROT_H_HEADERS\s*:?=\s*(.*)$/m;
+my $phh = $1;
+
+$rules =~ s/\Q$(PARROT_H_HEADERS)/$phh/g;
+
+foreach my $header (sort grep {/\.h$/} (keys %deps)) {
+    # static headers shouldn't depend on anything else.
+    if ($rules =~ /^$header\s*:\s*(.*)\s*$/m) {
+        #is("", $1, "$header should have no dependencies");
+    }
+}
+
+my @files = keys %deps;
+ at files = @ARGV if @ARGV;
+
+foreach my $file (sort grep {/\.c$/} @files) {
+    my $rule = $file;
+    $rule =~ s/\.c$//;
+
+    $rules =~ /^$rule\Q$(O)\E\s*:\s*(.*)\s*$/m;
+    my $declared = $1;
+
+    my $failed = 0;
+    if (!defined($declared)) {
+        $failed = 1;
+        is("", join(' ', (get_deps($file))), "$file has no dependencies");
+        next;
+    }
+    else
+    {
+        $declared =~ s/\s+/ /g;
+        foreach my $inc (sort (get_deps($file))) {
+            next if $declared =~ s/\b\Q$inc\E\b//;
+
+            is($declared, $inc, "$file is missing a dependency.");
+            $failed = 1;
+
+        }
+    }
+    $declared =~ s/^\s+//;
+    $declared =~ s/\s+$//;
+    $declared =~ s/\s+/ /g;
+    if ($declared ne "") {
+       is($declared, '', "$file has extra dependencies.");
+    }
+    elsif (!$failed) {
+        pass($file);
+    }
+}
+
+sub collapse_path {
+    my $path = shift;
+    return $path unless defined $path;
+
+    my $cwd = getcwd();
+    $path = abs_path($path);
+    return $path unless defined $path;
+
+    $path =~ s/^\Q$cwd\E\///;
+    return $path;
+}
+
+sub get_deps {
+    my $file = shift;
+    my %all_deps;
+
+    if (! exists $deps{$file}) {
+        return;
+    }
+
+    # add explicit deps
+    my @pending_deps = @{$deps{$file}};
+
+    while (@pending_deps) {
+        my $dep = shift @pending_deps;
+        if (!exists $all_deps{$dep}) {
+            $all_deps{$dep} = 1;
+            if (exists $deps{$dep}) {
+                push @pending_deps, @{$deps{$dep}};
+            }
+        }
+    }
+
+    return keys %all_deps;
+}
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/tools/dev/create_language.pl
==============================================================================
--- branches/orderedhash_revamp/tools/dev/create_language.pl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/dev/create_language.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -23,14 +23,14 @@
 
     README
     Configure.pl
-    xyz.pir
     build/Makefile.in
-    build/gen_builtins_pir.pl
     build/gen_parrot.pl
-    src/pct/grammar.pg
-    src/pct/grammar-oper.pg
-    src/pct/actions.pm
-    src/builtins/say.pir
+    src/Xyz.pir
+    src/Xyz/Grammar.pm
+    src/Xyz/Actions.pm
+    src/Xyz/Compiler.pm
+    src/Xyz/Runtime.pm
+    src/gen/.gitignore
     t/harness
     t/00-sanity.t
 
@@ -40,6 +40,8 @@
 If all goes well, after creating the language shell one can simply
 change to the language directory and type
 
+    $ perl Configure.pl [--gen-parrot]
+    $ make
     $ make test
 
 to verify that the new language compiles and configures properly.
@@ -61,15 +63,48 @@
 my $lclang = lc $lang;
 my $uclang = uc $lang;
 
-## the name and revision of the script, for use in the generated README
+## the name of the script, for use in the generated README and "reverse"
 my $script = $0;
-my $rev = '$Revision$';
-$rev =~ s/^\D*(\d+)\D*$/r$1/;
 
 ##  get the path from the command line, or if not supplied then
 ##  use languages/$lclang.
 my $path = $ARGV[1] || $lclang;
 
+my $option = $ARGV[2] || '';
+
+if ($option eq 'reverse') {
+    ## instead of using this script to generate the files into $path,
+    ## use the files in $path to generate a new version of this script.
+    open my $fh0, '<', $script or die "Unable to read $script";
+    while (<$fh0>) {
+        print $_;
+        last if /^__DATA__/;
+    }
+    while (<$fh0>) {
+        last if /^__DATA__$/;
+        if (/^__(.*?)__$/) {
+            print;
+            $_ = $1;
+            s{\@lang\@}   {$lang}g;
+            s{\@lclang\@} {$lclang}ig;
+            s{\@UCLANG\@} {$uclang}ig;
+            open my $fh, '<', "$path/$_" or die "Unable to read $path/$_";
+            while (<$fh>) {
+                s{$lang}   {\@lang\@}g;
+                s{$lclang} {\@lclang\@}g;
+                s{$uclang} {\@UCLANG\@}g;
+                s{$script} {\@script\@}g;
+                print;
+            }
+            close $fh;
+        }
+    }
+    print;
+    while (<$fh0>) { print; }
+    close $fh0;
+    exit 0;
+}
+
 ##  now loop through the file information (see below), substituting
 ##  any instances of @lang@, @lclang@, @UCLANG@, and @Id@ with
 ##  the language name or the svn id tag.  If the line has the form
@@ -80,13 +115,16 @@
     s{\@lang\@}   {$lang}g;
     s{\@lclang\@} {$lclang}ig;
     s{\@UCLANG\@} {$uclang}ig;
-    s{\@Id\@}     {\$Id\$}ig;
     s{\@script\@} {$script}ig;
-    s{\@rev\@}    {$rev}ig;
     if (/^__(.*)__$/) { start_new_file("$path/$1"); }
     elsif ($fh) { print $fh $_; }
 }
-##  close the last file
+
+## generate build/PARROT_REVISION
+start_new_file("$path/build/PARROT_REVISION");
+my $rev = '$Revision$';
+$rev =~ s/^\D*(\d+)\D*$/$1/;
+print $fh "$rev\n";
 close($fh) if $fh;
 
 print <<"END";
@@ -95,7 +133,7 @@
 To do an initial build and test of the language:
 
     cd $path
-    perl Configure.pl
+    perl Configure.pl [--gen-parrot]
     make
     make test
 
@@ -132,19 +170,104 @@
 
 __DATA__
 __README__
-Language '@lang@' was created with @script@, @rev at .
+=head1 @lang@
+
+This is @lang@, a compiler for the Parrot virtual machine.
+
+=head2 Build requirements (installing from source)
+
+For building @lang@ you need at least a C compiler, a C<make> utility,
+and Perl 5.8 or newer.  To automatically obtain and build Parrot
+you may also need a subversion (svn) client.
+
+=head2 Building and invoking @lang@
+
+We generally recommend downloading @lang@ directly from
+[XXX: fill in this information for @lang@].
+
+Once you have a copy of @lang@, build it as follows:
+
+    $ cd @lclang@
+    $ perl Configure.pl --gen-parrot
+    $ make
+
+This will create a "@lclang@" or "@lclang at .exe" executable in the
+current directory.  Programs can then be run from the build
+directory using a command like:
+
+    $ ./@lclang@ <source>
+
+The C<--gen-parrot> option above tells Configure.pl to automatically
+download and build the most appropriate version of Parrot into
+a local "parrot/" subdirectory, install that Parrot into
+the "parrot_install/" subdirectory, and use that for building
+ at lang@.  It's okay to use the C<--gen-parrot> option on later
+invocations of Configure.pl; the configure system will re-build
+Parrot only if a newer version is needed for whatever version
+of @lang@ you're working with.
+
+You can use C<--parrot-config=/path/to/parrot_config> instead
+of C<--gen-parrot> to use an already installed Parrot for building
+ at lang@.  This installed Parrot must include its development
+environment; typically this is done via Parrot's C<make install>
+target or by installing prebuilt C<parrot-devel> and/or C<libparrot-dev>
+packages.  The version of the already installed Parrot must satisfy a
+minimum specified by @lang@ -- Configure.pl will verify this for you.
+
+Once built, @lang@'s C<make install> target will install @lang@
+and its libraries into the Parrot installation that was used to
+create it.  Until this step is performed, the "@lclang@" executable
+created by C<make> above can only be reliably run from the root of
+ at lang@'s build directory.  After C<make install> is performed,
+the installed executable can be run from any directory (as long as
+the Parrot installation that was used to create it remains intact).
 
+If the @lang@ compiler is invoked without an explicit script to
+run, it enters a small interactive mode that allows 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 C<make test> will run a test suite that comes bundled
+with @lang at .  This is a simple suite of tests, designed to make sure
+that the compiler is basically working and that it's capable of
+running a simple test harness.
+
+If you want to run the tests in parallel, you need to install a
+fairly recent version of the Perl 5 module L<Test::Harness> (3.16
+works for sure).
+
+=head2 Where to get help or answers to questions
+
+=head2 Reporting bugs
+
+=head2 Submitting patches
+
+=head2 How the compiler works
+
+See F<docs/compiler_overview.pod>.
+
+=head1 AUTHOR
+
+=cut
+
+## vim: expandtab sw=4 ft=pod tw=70:
 __Configure.pl__
 #! perl
+# Copyright (C) 2009 The Perl Foundation
+
 use 5.008;
 use strict;
 use warnings;
 use Getopt::Long;
+use Cwd;
 
 MAIN: {
     my %options;
     GetOptions(\%options, 'help!', 'parrot-config=s',
-               'gen-parrot!', 'gen-parrot-option=s@');
+               'gen-parrot!', 'gen-parrot-prefix=s', 'gen-parrot-option=s@');
 
     # Print help if it's requested
     if ($options{'help'}) {
@@ -152,10 +275,20 @@
         exit(0);
     }
 
+    # Determine the revision of Parrot we require
+    open my $REQ, "build/PARROT_REVISION"
+      || die "cannot open build/PARROT_REVISION\n";
+    my ($reqsvn, $reqpar) = split(' ', <$REQ>);
+    $reqsvn += 0;
+    close $REQ;
+
     # Update/generate parrot build if needed
     if ($options{'gen-parrot'}) {
         my @opts    = @{ $options{'gen-parrot-option'} || [] };
-        my @command = ($^X, "build/gen_parrot.pl", @opts);
+        my $prefix  = $options{'gen-parrot-prefix'} || cwd()."/parrot_install";
+        # parrot's Configure.pl mishandles win32 backslashes in --prefix
+        $prefix =~ s{\\}{/}g;
+        my @command = ($^X, "build/gen_parrot.pl", "--prefix=$prefix", ($^O !~ /win32/i ? "--optimize" : ()), @opts);
 
         print "Generating Parrot ...\n";
         print "@command\n\n";
@@ -164,31 +297,59 @@
 
     # Get a list of parrot-configs to invoke.
     my @parrot_config_exe = qw(
-        parrot/parrot_config
+        parrot_install/bin/parrot_config
         ../../parrot_config
         parrot_config
     );
+    if (exists $options{'gen-parrot-prefix'}) {
+        unshift @parrot_config_exe,
+                $options{'gen-parrot-prefix'} . '/bin/parrot_config';
+    }
 
     if ($options{'parrot-config'} && $options{'parrot-config'} ne '1') {
         @parrot_config_exe = ($options{'parrot-config'});
     }
 
-    #  Get configuration information from parrot_config
+    # Get configuration information from parrot_config
     my %config = read_parrot_config(@parrot_config_exe);
-    unless (%config) {
-        die <<'END';
-Unable to locate parrot_config.
-To automatically checkout (svn) and build a copy of parrot,
+
+    my $parrot_errors = '';
+    if (!%config) {
+        $parrot_errors .= "Unable to locate parrot_config\n";
+    }
+    elsif ($reqsvn > $config{'revision'} &&
+            ($reqpar eq '' || version_int($reqpar) > version_int($config{'VERSION'}))) {
+        $parrot_errors .= "Parrot revision r$reqsvn required (currently r$config{'revision'})\n";
+    }
+
+    if ($parrot_errors) {
+        die <<"END";
+===SORRY!===
+$parrot_errors
+To automatically checkout (svn) and build a copy of parrot r$reqsvn,
 try re-running Configure.pl with the '--gen-parrot' option.
 Or, use the '--parrot-config' option to explicitly specify
-the location of parrot_config.
+the location of parrot_config to be used to build @lang at .
+
 END
     }
 
-#  Create the Makefile using the information we just got
-    create_makefile(%config);
+    # Verify the Parrot installation is sufficient for building @lang@
+    verify_parrot(%config);
 
+    # Create the Makefile using the information we just got
+    create_makefile(%config);
     my $make = $config{'make'};
+
+    {
+        no warnings;
+        print "Cleaning up ...\n";
+        if (open my $CLEAN, '-|', "$make clean") {
+            my @slurp = <$CLEAN>;
+            close $CLEAN;
+        }
+    }
+
     print <<"END";
 
 You can now use '$make' to build @lang at .
@@ -210,7 +371,7 @@
             while (<$PARROT_CONFIG>) {
                 if (/(\w+) => '(.*)'/) { $config{$1} = $2 }
             }
-            close $PARROT_CONFIG;
+            close $PARROT_CONFIG or die $!;
             last if %config;
         }
     }
@@ -218,20 +379,47 @@
 }
 
 
+sub verify_parrot {
+    print "Verifying Parrot installation...\n";
+    my %config = @_;
+    my $PARROT_VERSION = $config{'versiondir'};
+    my $PARROT_BIN_DIR = $config{'bindir'};
+    my $PARROT_LIB_DIR = $config{'libdir'}.$PARROT_VERSION;
+    my $PARROT_SRC_DIR = $config{'srcdir'}.$PARROT_VERSION;
+    my $PARROT_INCLUDE_DIR = $config{'includedir'}.$PARROT_VERSION;
+    my $PARROT_TOOLS_DIR = "$PARROT_LIB_DIR/tools";
+    my @required_files = (
+        "$PARROT_BIN_DIR/parrot-nqp"
+    );
+    my @missing;
+    for my $reqfile (@required_files) {
+        push @missing, "    $reqfile" unless -e $reqfile;
+    }
+    if (@missing) {
+        my $missing = join("\n", @missing);
+        die <<"END";
+
+===SORRY!===
+I'm missing some needed files from the Parrot installation:
+$missing
+(Perhaps you need to use Parrot's "make install" or
+install the "parrot-devel" package for your system?)
+
+END
+    }
+}
+
 #  Generate a Makefile from a configuration
 sub create_makefile {
     my %config = @_;
 
     my $maketext = slurp( 'build/Makefile.in' );
 
-    $config{'win32_libparrot_copy'} = $^O eq 'MSWin32' ? 'copy $(BUILD_DIR)\libparrot.dll .' : '';
+    $config{'win32_libparrot_copy'} = $^O eq 'MSWin32' ? 'copy $(PARROT_BIN_DIR)\libparrot.dll .' : '';
     $maketext =~ s/@(\w+)@/$config{$1}/g;
     if ($^O eq 'MSWin32') {
-        # use backslashes.
         $maketext =~ s{/}{\\}g;
-        # wildcards (for clean rules) need an additional backslash, see Rakudo RT #65006
         $maketext =~ s{\\\*}{\\\\*}g;
-        # use forward slashes again for HTTP URLs
         $maketext =~ s{http:\S+}{ do {my $t = $&; $t =~ s'\\'/'g; $t} }eg;
     }
 
@@ -256,6 +444,10 @@
     return $maketext;
 }
 
+sub version_int {
+    sprintf('%d%03d%03d', split(/\./, $_[0]))
+}
+
 
 #  Print some help text.
 sub print_help {
@@ -264,11 +456,11 @@
 
 General Options:
     --help             Show this text
-    --parrot-config=(config)
-                       Use configuration information from config
     --gen-parrot       Download and build a copy of Parrot to use
     --gen-parrot-option='--option=value'
                        Set parrot config option when using --gen-parrot
+    --parrot-config=(config)
+                       Use configuration information from config
 END
 
     return;
@@ -280,161 +472,124 @@
 #   fill-column: 100
 # End:
 # vim: expandtab shiftwidth=4:
-
-__build/PARROT_REVISION__
- at rev@
 __build/Makefile.in__
+# Copyright (C) 2006-2009, The Perl Foundation.
 # $Id$
 
-# arguments we want to run parrot with
-PARROT_ARGS =
+PARROT_ARGS      =
 
 # values from parrot_config
-BUILD_DIR     = @build_dir@
-LOAD_EXT      = @load_ext@
-O             = @o@
+PARROT_BIN_DIR     = @bindir@
+PARROT_VERSION     = @versiondir@
+PARROT_INCLUDE_DIR = @includedir@$(PARROT_VERSION)
+PARROT_LIB_DIR     = @libdir@$(PARROT_VERSION)
+PARROT_SRC_DIR     = @srcdir@$(PARROT_VERSION)
+PARROT_LIBRARY_DIR = $(PARROT_LIB_DIR)/library
+HAS_ICU            = @has_icu@
+
+CC            = @cc@
+CFLAGS        = @ccflags@ @cc_shared@ @cc_debug@ @ccwarn@ @cc_hasjit@ @cg_flag@ @gc_flag@
 EXE           = @exe@
-MAKE          = @make_c@
+LD            = @ld@
+LDFLAGS       = @ldflags@ @ld_debug@
+LD_LOAD_FLAGS = @ld_load_flags@
+LIBPARROT     = @inst_libparrot_ldflags@
+O             = @o@
+LOAD_EXT      = @load_ext@
 PERL          = @perl@
+CP            = @cp@
+MV            = @mv@
 RM_F          = @rm_f@
-HAS_ICU       = @has_icu@
+MKPATH        = $(PERL) -MExtUtils::Command -e mkpath
+CHMOD         = $(PERL) -MExtUtils::Command -e chmod
 
-# Various paths
-PARROT_DYNEXT = $(BUILD_DIR)/runtime/parrot/dynext
-PERL6GRAMMAR  = $(BUILD_DIR)/runtime/parrot/library/PGE/Perl6Grammar.pbc
-NQP           = $(BUILD_DIR)/compilers/nqp/nqp.pbc
-PCT           = $(BUILD_DIR)/runtime/parrot/library/PCT.pbc
-PMC_DIR       = src/pmc
-OPSDIR        = src/ops
-OPSLIB        = @lclang@
-OPS_FILE      = src/ops/@lclang at .ops
-
-# Setup some commands
-PARROT        = $(BUILD_DIR)/parrot$(EXE)
-CAT           = $(PERL) -MExtUtils::Command -e cat
-BUILD_DYNPMC  = $(PERL) $(BUILD_DIR)/tools/build/dynpmc.pl
-BUILD_DYNOPS  = $(PERL) $(BUILD_DIR)/tools/build/dynoplibs.pl
-PBC_TO_EXE    = $(BUILD_DIR)/pbc_to_exe$(EXE)
-
-SOURCES = @lclang at .pir \
-  src/gen_grammar.pir \
-  src/gen_actions.pir \
-  src/gen_builtins.pir \
-  $(@uclang at _GROUP)
-
-BUILTINS_PIR = \
-  src/builtins/say.pir \
-
-# PMCS        = @lclang@
-# PMC_SOURCES = $(PMC_DIR)/@lclang at .pmc
-# @uclang at _GROUP  = $(PMC_DIR)/@lclang at _group$(LOAD_EXT)
+# locations of parrot resources
+PARROT           = $(PARROT_BIN_DIR)/parrot$(EXE)
+PARROT_NQP       = $(PARROT_BIN_DIR)/parrot-nqp$(EXE)
+PBC_TO_EXE       = $(PARROT_BIN_DIR)/pbc_to_exe$(EXE)
+PARROT_TOOLS_DIR = $(PARROT_LIB_DIR)/tools
+PARROT_PERL_LIB  = $(PARROT_TOOLS_DIR)/lib
+
+ at UCLANG@_LANG_DIR     = $(PARROT_LIB_DIR)/languages/@lclang@
+
+ at UCLANG@_EXE     = @lclang@$(EXE)
+ at UCLANG@_PBC     = @lclang at .pbc
+ at UCLANG@_G_PIR   = src/gen/@lclang at -grammar.pir
+ at UCLANG@_A_PIR   = src/gen/@lclang at -actions.pir
+ at UCLANG@_C_PIR   = src/gen/@lclang at -compiler.pir
+ at UCLANG@_R_PIR   = src/gen/@lclang at -runtime.pir
+
+ at UCLANG@_SOURCES = \
+    src/@lang at .pir \
+    $(@UCLANG at _G_PIR) \
+    $(@UCLANG at _A_PIR) \
+    $(@UCLANG at _C_PIR) \
+    $(@UCLANG at _R_PIR) \
 
 CLEANUPS = \
-  @lclang at .pbc \
-  @lclang at .c \
   *.manifest \
   *.pdb \
-  @lclang@$(O) \
-  @lclang@$(EXE) \
-  src/gen_*.pir \
-  src/gen_*.pm \
-  $(PMC_DIR)/*.h \
-  $(PMC_DIR)/*.c \
-  $(PMC_DIR)/*.dump \
-  $(PMC_DIR)/*$(O) \
-  $(PMC_DIR)/*$(LOAD_EXT) \
-  $(PMC_DIR)/*.exp \
-  $(PMC_DIR)/*.ilk \
-  $(PMC_DIR)/*.manifest \
-  $(PMC_DIR)/*.pdb \
-  $(PMC_DIR)/*.lib \
-  $(PMC_DIR)/objectref.pmc \
-  $(OPSDIR)/*.h \
-  $(OPSDIR)/*.c \
-  $(OPSDIR)/*$(O) \
-  $(OPSDIR)/*$(LOAD_EXT) \
-
-HARNESS = $(PERL) t/harness --keep-exit-code --icu=$(HAS_ICU)
-HARNESS_JOBS = $(HARNESS) --jobs
-
-# the default target
-all: @lclang@$(EXE)
-
-installable: installable_ at lclang@$(EXE)
-
-##  targets for building a standalone executable
- at lclang@$(EXE): @lclang at .pbc
-	$(PBC_TO_EXE) @lclang at .pbc
-	@win32_libparrot_copy@
-
-installable_ at lclang@$(EXE): @lclang at .pbc
-	$(PBC_TO_EXE) @lclang at .pbc --install
-
-# the compiler .pbc
- at lclang@.pbc: Makefile $(PARROT) $(SOURCES) $(BUILTINS_PIR)
-	$(PARROT) $(PARROT_ARGS) -o @lclang at .pbc @lclang at .pir
-
-src/gen_grammar.pir: $(PARROT) $(PERL6GRAMMAR) src/pct/grammar.pg src/pct/grammar-oper.pg
-	$(PARROT) $(PARROT_ARGS) $(PERL6GRAMMAR) \
-	    --output=src/gen_grammar.pir \
-	    src/pct/grammar.pg src/pct/grammar-oper.pg
-
-src/gen_actions.pir: $(PARROT) $(NQP) $(PCT) src/pct/actions.pm
-	$(PARROT) $(PARROT_ARGS) $(NQP) --output=src/gen_actions.pir \
-	    --encoding=fixed_8 --target=pir src/pct/actions.pm
-
-src/gen_builtins.pir: Makefile build/gen_builtins_pir.pl
-	$(PERL) build/gen_builtins_pir.pl $(BUILTINS_PIR) > src/gen_builtins.pir
-
-$(@uclang at _GROUP): Makefile $(PARROT) $(PMC_SOURCES)
-	cd $(PMC_DIR) && $(BUILD_DYNPMC) generate $(PMCS)
-	cd $(PMC_DIR) && $(BUILD_DYNPMC) compile $(PMCS)
-	cd $(PMC_DIR) && $(BUILD_DYNPMC) linklibs $(PMCS)
-	cd $(PMC_DIR) && $(BUILD_DYNPMC) copy --destination=$(PARROT_DYNEXT) $(PMCS)
-
-src/ops/@lclang at _ops$(LOAD_EXT) : $(PARROT) $(OPS_FILE)
-	@cd $(OPSDIR) && $(BUILD_DYNOPS) generate $(OPSLIB)
-	@cd $(OPSDIR) && $(BUILD_DYNOPS) compile $(OPSLIB)
-	@cd $(OPSDIR) && $(BUILD_DYNOPS) linklibs $(OPSLIB)
-	@cd $(OPSDIR) && $(BUILD_DYNOPS) copy "--destination=$(PARROT_DYNEXT)" $(OPSLIB)
-
-##  local copy of Parrot
-parrot: parrot/parrot_config build/PARROT_REVISION
-	$(PERL) build/gen_parrot.pl
-
-parrot/parrot_config:
-	@echo "Don't see parrot/parrot_config."
-
-test: @lclang@$(EXE)
-	$(PERL) t/harness t/
-
-# Run a single test
-t/*.t t/*/*.t t/*/*/*.t: all Test.pir
-	@$(HARNESS_WITH_FUDGE) --verbosity=1 $@
+  *.c\
+  *.o\
+  $(@UCLANG at _EXE) \
+  $(@UCLANG at _PBC) \
+  src/gen/*.pir \
+
+default: $(@UCLANG at _EXE)
+
+all: $(@UCLANG at _EXE)
+
+$(@UCLANG at _EXE) : $(@UCLANG at _SOURCES)
+	$(PARROT) -o $(@UCLANG at _PBC) src/@lang at .pir
+	$(PBC_TO_EXE) $(@UCLANG at _PBC)
+
+$(@UCLANG at _G_PIR): src/@lang@/Grammar.pm
+	$(PARROT_NQP) --target=pir -o $(@UCLANG at _G_PIR) src/@lang@/Grammar.pm
+$(@UCLANG at _A_PIR): src/@lang@/Actions.pm
+	$(PARROT_NQP) --target=pir -o $(@UCLANG at _A_PIR) src/@lang@/Actions.pm
+$(@UCLANG at _C_PIR): src/@lang@/Compiler.pm
+	$(PARROT_NQP) --target=pir -o $(@UCLANG at _C_PIR) src/@lang@/Compiler.pm
+$(@UCLANG at _R_PIR): src/@lang@/Runtime.pm
+	$(PARROT_NQP) --target=pir -o $(@UCLANG at _R_PIR) src/@lang@/Runtime.pm
+
+## testing
+
+test: $(@UCLANG at _EXE)
+	$(PERL) t/harness t
+
+## installation
+
+install: all
+	$(MKPATH)        $(DESTDIR)$(@UCLANG at _LANG_DIR)
+	$(CP) $(@UCLANG at _PBC) $(DESTDIR)$(@UCLANG at _LANG_DIR)
+	$(CP) $(@UCLANG at _EXE) $(DESTDIR)$(PARROT_BIN_DIR)
+	$(CHMOD) 755     $(DESTDIR)$(PARROT_BIN_DIR)/$(@UCLANG at _EXE)
+
+## cleaning
 
-##  cleaning
 clean:
 	$(RM_F) $(CLEANUPS)
 
 distclean: realclean
 
 realclean: clean
-	$(RM_F) src/utils/Makefile Makefile
+	$(RM_F) Makefile
 
 testclean:
 
-
 ##  miscellaneous targets
 # a listing of all targets meant to be called by users
 help:
 	@echo ""
 	@echo "Following targets are available for the user:"
 	@echo ""
-	@echo "  all:               @lclang at .exe"
+	@echo "  all:               $(@UCLANG at _EXE)"
 	@echo "                     This is the default."
+	@echo "  $(@UCLANG at _EXE):        The @lang@ compiler."
+	@echo "  install:           Install compiler into Parrot."
 	@echo ""
 	@echo "Testing:"
-	@echo "  test:              Run Rakudo's sanity tests."
+	@echo "  test:              Run tests."
 	@echo ""
 	@echo "Cleaning:"
 	@echo "  clean:             Basic cleaning up."
@@ -446,47 +601,13 @@
 	@echo "  help:              Print this help message."
 	@echo ""
 
-Makefile: build/Makefile.in
-	@echo ""
-	@echo "warning: Makefile is out of date... re-run Configure.pl"
-	@echo ""
-
-manifest:
-	echo MANIFEST >MANIFEST
-	git ls-files | $(PERL) -ne '/^\./ || print' >>MANIFEST
-
-release: manifest
-	[ -n "$(VERSION)" ] || ( echo "\nTry 'make release VERSION=yyyymm'\n\n"; exit 1 )
-	[ -d @lclang at -$(VERSION) ] || ln -s . @lclang at -$(VERSION)
-	$(PERL) -ne 'print "@lclang at -$(VERSION)/$$_"' MANIFEST | \
-	    tar -zcv -T - -f @lclang at -$(VERSION).tar.gz
-	rm @lclang at -$(VERSION)
-
-__build/gen_builtins_pir.pl__
-#!/usr/bin/perl
-# $Id$
-
-use strict;
-use warnings;
-
-my @files = @ARGV;
-
-print <<"END_PRELUDE";
-# This file automatically generated by $0.
-
-END_PRELUDE
-
-foreach my $file (@files) {
-    print ".include '$file'\n";
-}
-
-
 __build/gen_parrot.pl__
 #! perl
+# Copyright (C) 2009 The Perl Foundation
 
 =head1 TITLE
 
-gen_parrot.pl - script to obtain and build Parrot
+gen_parrot.pl - script to obtain and build Parrot for Rakudo
 
 =head2 SYNOPSIS
 
@@ -510,23 +631,24 @@
 ##  determine what revision of Parrot we require
 open my $REQ, "build/PARROT_REVISION"
   || die "cannot open build/PARROT_REVISION\n";
-my $required = 0+<$REQ>;
+my ($reqsvn, $reqpar) = split(' ', <$REQ>);
+$reqsvn += 0;
 close $REQ;
 
 {
     no warnings;
-    if (open my $REV, '-|', "parrot${slash}parrot_config revision") {
+    if (open my $REV, '-|', "parrot_install${slash}bin${slash}parrot_config revision") {
         my $revision = 0+<$REV>;
         close $REV;
-        if ($revision >= $required) {
-            print "Parrot r$revision already available (r$required required)\n";
+        if ($revision >= $reqsvn) {
+            print "Parrot r$revision already available (r$reqsvn required)\n";
             exit(0);
         }
     }
 }
 
-print "Checking out Parrot r$required via svn...\n";
-system(qw(svn checkout -r),  $required , qw(https://svn.parrot.org/parrot/trunk parrot));
+print "Checking out Parrot r$reqsvn via svn...\n";
+system(qw(svn checkout -r),  $reqsvn , qw(https://svn.parrot.org/parrot/trunk parrot));
 
 chdir('parrot');
 
@@ -549,7 +671,11 @@
 print "\nBuilding Parrot ...\n";
 my %config = read_parrot_config();
 my $make = $config{'make'} or exit(1);
-system($make);
+my @make_opts;
+if ($ENV{GNU_MAKE_JOBS}) {
+    push @make_opts, '-j', $ENV{GNU_MAKE_JOBS}
+}
+system($make, 'install-dev', @make_opts);
 
 sub read_parrot_config {
     my %config = ();
@@ -562,278 +688,155 @@
     %config;
 }
 
-__ at lclang@.pir__
-=head1 TITLE
-
- at lclang@.pir - A @lang@ compiler.
-
-=head2 Description
-
-This is the base file for the @lang@ 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 '@lang@'.
-
-=head2 Functions
-
-=over 4
-
-=item onload()
-
-Creates the @lang@ compiler using a C<PCT::HLLCompiler>
-object.
-
-=cut
-
+__src/@lang at .pir__
 .HLL '@lclang@'
 
-.namespace [ '@lang@';'Compiler' ]
-
-.loadlib '@lclang at _group'
+.namespace []
 
 .sub '' :anon :load :init
-    load_bytecode 'PCT.pbc'
-    .local pmc parrotns, hllns, exports
-    parrotns = get_root_namespace ['parrot']
-    hllns = get_hll_namespace
-    exports = split ' ', 'PAST PCT PGE'
-    parrotns.'export_to'(hllns, exports)
-.end
-
-.include 'src/gen_grammar.pir'
-.include 'src/gen_actions.pir'
+    load_bytecode 'HLL.pbc'
 
-.sub 'onload' :anon :load :init
-    $P0 = get_hll_global ['PCT'], 'HLLCompiler'
-    $P1 = $P0.'new'()
-    $P1.'language'('@lclang@')
-    $P0 = get_hll_namespace ['@lang@';'Grammar']
-    $P1.'parsegrammar'($P0)
-    $P0 = get_hll_namespace ['@lang@';'Grammar';'Actions']
-    $P1.'parseactions'($P0)
+    .local pmc hllns, parrotns, imports
+    hllns = get_hll_namespace
+    parrotns = get_root_namespace ['parrot']
+    imports = split ' ', 'PAST PCT HLL Regex Hash'
+    parrotns.'export_to'(hllns, imports)
 .end
 
-=item main(args :slurpy)  :main
-
-Start compilation by passing any command line C<args>
-to the @lang@ compiler.
-
-=cut
+.include 'src/gen/@lclang at -grammar.pir'
+.include 'src/gen/@lclang at -actions.pir'
+.include 'src/gen/@lclang at -compiler.pir'
+.include 'src/gen/@lclang at -runtime.pir'
 
+.namespace []
 .sub 'main' :main
     .param pmc args
 
-    $P0 = compreg '@lclang@'
+    $P0 = compreg '@lang@'
+    # Cannot tailcall here. (TT #1029)
     $P1 = $P0.'command_line'(args)
+    .return ($P1)
 .end
-
-.include 'src/gen_builtins.pir'
-
-=back
-
-=cut
-
-# Local Variables:
-#   mode: pir
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4 ft=pir:
-
-__src/pct/grammar.pg__
-# @Id@
-
+__src/@lang@/Grammar.pm__
 =begin overview
 
-This is the grammar for @lang@ written as a sequence of Perl 6 rules.
+This is the grammar for @lang@ in Perl 6 rules.
 
 =end overview
 
-grammar @lang@::Grammar is PCT::Grammar;
+grammar @lang@::Grammar is HLL::Grammar;
 
-rule TOP {
-    <statement>*
-    [ $ || <panic: 'Syntax error'> ]
-    {*}
+token TOP {
+    <statementlist>
+    [ $ || <.panic: "Syntax error"> ]
 }
 
-##  this <ws> rule treats # as "comment to eol"
-##  you may want to replace it with something appropriate
+## Lexer items
+
+# This <ws> rule treats # as "comment to eol".
 token ws {
     <!ww>
     [ '#' \N* \n? | \s+ ]*
 }
 
-rule statement {
-    'say' <expression> [ ',' <expression> ]* ';'
-    {*}
-}
-
-rule value {
-    | <integer> {*}                              #= integer
-    | <quote> {*}                                #= quote
-}
-
-token integer { \d+ {*} }
+## Statements
 
-token quote {
-    [ \' <string_literal: '\'' > \' | \" <string_literal: '"' > \" ]
-    {*}
-}
+rule statementlist { [ <statement> | <?> ] ** ';' }
 
-##  terms
-token term {
-    | <value> {*}                                #= value
+rule statement {
+    | <statement_control>
+    | <EXPR>
 }
 
-rule expression is optable { ... }
-
-__src/pct/grammar-oper.pg__
-# @Id@
-
-##  expressions and operators
-proto 'term:'     is precedence('=')     is parsed(&term)      { ... }
+proto token statement_control { <...> }
+rule statement_control:sym<say>   { <sym> [ <EXPR> ] ** ','  }
+rule statement_control:sym<print> { <sym> [ <EXPR> ] ** ','  }
 
-## multiplicative operators
-proto infix:<*>   is looser(term:)       is pirop('mul')     { ... }
-proto infix:</>   is equiv(infix:<*>)    is pirop('div')     { ... }
+## Terms
 
-## additive operators
-proto infix:<+>   is looser(infix:<*>)   is pirop('add')     { ... }
-proto infix:<->   is equiv(infix:<+>)    is pirop('sub')     { ... }
+token term:sym<integer> { <integer> }
+token term:sym<quote> { <quote> }
 
-__src/pct/actions.pm__
-# @Id@
+proto token quote { <...> }
+token quote:sym<'> { <?[']> <quote_EXPR: ':q'> }
+token quote:sym<"> { <?["]> <quote_EXPR: ':qq'> }
 
-=begin comments
+## Operators
 
- at lang@::Grammar::Actions - ast transformations for @lang@
+INIT {
+    @lang@::Grammar.O(':prec<u>, :assoc<left>',  '%multiplicative');
+    @lang@::Grammar.O(':prec<t>, :assoc<left>',  '%additive');
+}
 
-This file contains the methods that are used by the parse grammar
-to build the PAST representation of an @lang@ program.
-Each method below corresponds to a rule in F<src/parser/grammar.pg>,
-and is invoked at the point where C<{*}> appears in the rule,
-with the current match object as the first argument.  If the
-line containing C<{*}> also has a C<#= key> comment, then the
-value of the comment is passed as the second argument to the method.
+token circumfix:sym<( )> { '(' <.ws> <EXPR> ')' }
 
-=end comments
+token infix:sym<*>  { <sym> <O('%multiplicative, :pirop<mul>')> }
+token infix:sym</>  { <sym> <O('%multiplicative, :pirop<div>')> }
 
-class @lang@::Grammar::Actions;
+token infix:sym<+>  { <sym> <O('%additive, :pirop<add>')> }
+token infix:sym<->  { <sym> <O('%additive, :pirop<sub>')> }
+__src/@lang@/Actions.pm__
+class @lang@::Actions is HLL::Actions;
 
 method TOP($/) {
-    my $past := PAST::Block.new( :blocktype('declaration'), :node( $/ ), :hll('@lang@') );
-    for $<statement> {
-        $past.push( $_.ast );
-    }
-    make $past;
+    make PAST::Block.new( $<statementlist>.ast , :hll<@lclang@>, :node($/) );
 }
 
-
-method statement($/) {
-    my $past := PAST::Op.new( :name('say'), :pasttype('call'), :node( $/ ) );
-    for $<expression> {
-        $past.push( $_.ast );
-    }
+method statementlist($/) {
+    my $past := PAST::Stmts.new( :node($/) );
+    for $<statement> { $past.push( $_.ast ); }
     make $past;
 }
 
-##  expression:
-##    This is one of the more complex transformations, because
-##    our grammar is using the operator precedence parser here.
-##    As each node in the expression tree is reduced by the
-##    parser, it invokes this method with the operator node as
-##    the match object and a $key of 'reduce'.  We then build
-##    a PAST::Op node using the information provided by the
-##    operator node.  (Any traits for the node are held in $<top>.)
-##    Finally, when the entire expression is parsed, this method
-##    is invoked with the expression in $<expr> and a $key of 'end'.
-method expression($/, $key) {
-    if ($key eq 'end') {
-        make $<expr>.ast;
-    }
-    else {
-        my $past := PAST::Op.new( :name($<type>),
-                                  :pasttype($<top><pasttype>),
-                                  :pirop($<top><pirop>),
-                                  :lvalue($<top><lvalue>),
-                                  :node($/)
-                                );
-        for @($/) {
-            $past.push( $_.ast );
-        }
-        make $past;
-    }
+method statement($/) {
+    make $<statement_control> ?? $<statement_control>.ast !! $<EXPR>.ast;
 }
 
-
-##  term:
-##    Like 'statement' above, the $key has been set to let us know
-##    which term subrule was matched.
-method term($/, $key) {
-    make $/{$key}.ast;
+method statement_control:sym<say>($/) {
+    my $past := PAST::Op.new( :name<say>, :pasttype<call>, :node($/) );
+    for $<EXPR> { $past.push( $_.ast ); }
+    make $past;
 }
 
-
-method value($/, $key) {
-    make $/{$key}.ast;
+method statement_control:sym<print>($/) {
+    my $past := PAST::Op.new( :name<print>, :pasttype<call>, :node($/) );
+    for $<EXPR> { $past.push( $_.ast ); }
+    make $past;
 }
 
+method term:sym<integer>($/) { make $<integer>.ast; }
+method term:sym<quote>($/) { make $<quote>.ast; }
 
-method integer($/) {
-    make PAST::Val.new( :value( ~$/ ), :returns('Integer'), :node($/) );
-}
+method quote:sym<'>($/) { make $<quote_EXPR>.ast; }
+method quote:sym<">($/) { make $<quote_EXPR>.ast; }
 
+method circumfix:sym<( )>($/) { make $<EXPR>.ast; }
 
-method quote($/) {
-    make PAST::Val.new( :value( $<string_literal>.ast ), :node($/) );
-}
-
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
-
-__src/builtins/say.pir__
-# @Id@
-
-=head1
-
-say.pir -- simple implementation of a say function
-
-=cut
-
-.namespace []
-
-.sub 'say'
-    .param pmc args            :slurpy
-    .local pmc it
-    it = iter args
-  iter_loop:
-    unless it goto iter_end
-    $P0 = shift it
-    print $P0
-    goto iter_loop
-  iter_end:
-    print "\n"
-    .return ()
-.end
+__src/@lang@/Compiler.pm__
+class @lang@::Compiler is HLL::Compiler;
 
+INIT {
+    @lang@::Compiler.language('@lang@');
+    @lang@::Compiler.parsegrammar(@lang@::Grammar);
+    @lang@::Compiler.parseactions(@lang@::Actions);
+}
+__src/@lang@/Runtime.pm__
+# language-specific runtime functions go here
 
-# Local Variables:
-#   mode: pir
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4 ft=pir:
+sub print(*@args) {
+    pir::print(pir::join('', @args));
+    1;
+}
 
+sub say(*@args) {
+    pir::say(pir::join('', @args));
+    1;
+}
+__src/gen/.gitignore__
+*
 __t/harness__
 #! perl
 
-# $Id$
-
 use strict;
 use warnings;
 
@@ -932,7 +935,6 @@
 say 'ok ', 2;
 say 'ok ', 2 + 1;
 say 'ok', ' ', 4;
-
 __DATA__
 
 

Modified: branches/orderedhash_revamp/tools/dev/debian_docs.sh
==============================================================================
--- branches/orderedhash_revamp/tools/dev/debian_docs.sh	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/dev/debian_docs.sh	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# 		debian_docs.sh 	Specified in RT #49274
+# 		debian_docs.sh
 
 
 # A script to generate the file ports/debian/parrot-doc.docs 

Modified: branches/orderedhash_revamp/tools/dev/fetch_languages.pl
==============================================================================
--- branches/orderedhash_revamp/tools/dev/fetch_languages.pl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/dev/fetch_languages.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -60,6 +60,12 @@
     },
 
     {
+        name       => 'blizkost',
+        scm        => 'GIT',
+        repository => 'git://github.com/jnthn/blizkost.git'
+    },
+
+    {
         name       => 'c99',
         scm        => 'SVN',
         repository => 'https://svn.parrot.org/languages/c99/trunk'
@@ -78,6 +84,12 @@
     },
 
     {
+        name       => 'close',
+        scm        => 'SVN',
+        repository => 'http://close.googlecode.com/svn/trunk/'
+    },
+
+    {
         name       => 'dotnet',
         scm        => 'SVN',
         repository => 'https://svn.parrot.org/languages/dotnet/trunk'
@@ -132,6 +144,12 @@
     },
 
     {
+        name       => 'kea',
+        scm        => 'GIT',
+        repository => 'git://github.com/leto/kea.git'
+    },
+
+    {
         name       => 'kea-cl',
         scm        => 'SVN',
         repository => 'https://rgrjr.dyndns.org/svn/kea-cl/trunk'
@@ -175,8 +193,8 @@
 
     {
         name       => 'matrixy',
-        scm        => 'SVN',
-        repository => 'http://matrixy.googlecode.com/svn/trunk'
+        scm        => 'GIT',
+        repository => 'git://github.com/Whiteknight/matrixy.git'
     },
 
     {
@@ -277,8 +295,8 @@
 
     {
         name       => 'tcl',
-        scm        => 'SVN',
-        repository => 'http://partcl.googlecode.com/svn/trunk'
+        scm        => 'GIT',
+        repository => 'git://github.com/partcl/partcl.git'
     },
 
     {
@@ -294,6 +312,12 @@
     },
 
     {
+        name       => 'winexd',
+        scm        => 'SVN',
+        repository => 'http://winxed.googlecode.com/svn/trunk/'
+    },
+
+    {
         name       => 'wmlscript',
         scm        => 'GIT',
         repository => 'git://github.com/fperrad/wmlscript.git'

Modified: branches/orderedhash_revamp/tools/dev/gen_makefile.pl
==============================================================================
--- branches/orderedhash_revamp/tools/dev/gen_makefile.pl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/dev/gen_makefile.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -28,6 +28,10 @@
 my $conf = Parrot::Configure->new();
 $conf->options->set( %{$args} );
 $conf->data()->get_PConfig(); #load configuration data
+foreach (@ARGV) {
+    next unless (/--(\w+)=(\w+)/);
+    $conf->data->set( $1 => $2 );
+}
 $conf->genfile(
     $template           => $makefile,
     file_type           => 'makefile',

Modified: branches/orderedhash_revamp/tools/dev/install_dev_files.pl
==============================================================================
--- branches/orderedhash_revamp/tools/dev/install_dev_files.pl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/dev/install_dev_files.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -65,8 +65,8 @@
     lines_to_files
 );
 
-# When run from the makefile, which is probably the only time this
-# script will ever be used, all of these defaults will get overridden.
+# When run from the makefile, or from a test script, which are probably the only times
+# this script will ever be used, all of these defaults will get overridden.
 my %options = (
     buildprefix => '',
     prefix      => '/usr',
@@ -80,7 +80,7 @@
     srcdir      => '/usr/src/',      # parrot/ subdir added below
     versiondir  => '',
     'dry-run'   => 0,
-    packages    => 'devel|pct|tge|nqp',
+    packages    => 'devel|pct|tge|nqp|data_json',
 );
 
 my @manifests;
@@ -143,7 +143,6 @@
         optiondir => 'doc',
         transform => sub {
             my($filehash) = @_;
-            $filehash->{Dest} =~ s/^docs/pod/; # other docs are actually raw Pod
             $filehash->{DestDirs} = [$parrotdir];
             return($filehash);
         },

Added: branches/orderedhash_revamp/tools/dev/install_doc_files.pl
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/tools/dev/install_doc_files.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,137 @@
+#! perl
+################################################################################
+# Copyright (C) 2001-2009, Parrot Foundation.
+# $Id$
+################################################################################
+
+=head1 TITLE
+
+tools/dev/install_doc_files.pl - Copy documentation files to their correct locations
+
+=head1 SYNOPSIS
+
+    % perl tools/dev/install_doc_files.pl [options]
+
+=head1 DESCRIPTION
+
+Use a detailed MANIFEST to install a set of documentation files.
+
+=head2 Options
+
+=over 4
+
+=item C<buildprefix>
+
+The build prefix. Defaults to ''.
+
+=item C<prefix>
+
+The install prefix. Defaults to '/usr'.
+
+=item C<exec_prefix>
+
+The exec prefix. Defaults to '/usr'.
+
+=item C<bindir>
+
+The executables directory. Defaults to '/usr/bin'.
+
+=item C<libdir>
+
+The library directory. Defaults to '/usr/lib'.
+
+=item C<includedir>
+
+The header directory. Defaults to '/usr/include'.
+
+=back
+
+=head1 SEE ALSO
+
+See F<lib/Parrot/Manifest.pm> for a detailed description of the MANIFEST
+format.
+
+=cut
+
+################################################################################
+
+use strict;
+use warnings;
+use File::Basename qw(basename);
+use lib qw( lib );
+use Parrot::Install qw(
+    install_files
+    create_directories
+    lines_to_files
+);
+
+# When run from the makefile, which is probably the only time this
+# script will ever be used, all of these defaults will get overridden.
+my %options = (
+    buildprefix => '',
+    prefix      => '/usr',
+    destdir     => '',
+    exec_prefix => '/usr',
+    bindir      => '/usr/bin',
+    libdir      => '/usr/lib',       # parrot/ subdir added below
+    includedir  => '/usr/include',   # parrot/ subdir added below
+    docdir      => '/usr/share/doc', # parrot/ subdir added below
+    datadir     => '/usr/share/',    # parrot/ subdir added below
+    srcdir      => '/usr/src/',      # parrot/ subdir added below
+    versiondir  => '',
+    'dry-run'   => 0,
+    packages    => 'doc|examples',
+);
+
+my @manifests;
+foreach (@ARGV) {
+    if (/^--([^=]+)=(.*)/) {
+        $options{$1} = $2;
+    }
+    else {
+        push @manifests, $_;
+    }
+}
+
+my $parrotdir = $options{versiondir};
+
+# Set up transforms on filenames
+my(@transformorder) = (qw(doc examples));
+my(%metatransforms) = (
+    doc => {
+        optiondir => 'doc',
+        transform => sub {
+            my($filehash) = @_;
+            $filehash->{Dest} =~ s#^docs/resources#resources#; # resources go in the top level of docs
+            $filehash->{Dest} =~ s/^docs/pod/; # other docs are actually raw Pod
+            $filehash->{DestDirs} = [$parrotdir];
+            return($filehash);
+        },
+    },
+    examples => {
+        optiondir => 'doc',
+        transform => sub {
+            my($filehash) = @_;
+            $filehash->{DestDirs} = [$parrotdir];
+            return($filehash);
+        },
+    },
+);
+
+my($filehashes, $directories) = lines_to_files(
+    \%metatransforms, \@transformorder, \@manifests, \%options, $parrotdir
+);
+
+unless ( $options{'dry-run'} ) {
+    create_directories($options{destdir}, $directories);
+}
+install_files($options{destdir}, $options{'dry-run'}, $filehashes);
+
+print "Finished install_doc_files.pl\n";
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/tools/dev/install_files.pl
==============================================================================
--- branches/orderedhash_revamp/tools/dev/install_files.pl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/dev/install_files.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -148,8 +148,6 @@
         optiondir => 'doc',
         transform => sub {
             my($filehash) = @_;
-            $filehash->{Dest} =~ s#^docs/resources#resources#; # resources go in the top level of docs
-            $filehash->{Dest} =~ s/^docs/pod/; # other docs are actually raw Pod
             $filehash->{DestDirs} = [$parrotdir];
             return($filehash);
         },

Modified: branches/orderedhash_revamp/tools/dev/list_unjitted.pl
==============================================================================
--- branches/orderedhash_revamp/tools/dev/list_unjitted.pl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/dev/list_unjitted.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -59,7 +59,7 @@
 
 tools/dev/list_unjitted.pl
 
-=head1 ABSTRACT
+=head1 DESCRIPTION
 
 For a given platform, report the number of ops JITted or not JITted.
 

Modified: branches/orderedhash_revamp/tools/dev/mk_inno.pl
==============================================================================
--- branches/orderedhash_revamp/tools/dev/mk_inno.pl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/dev/mk_inno.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -10,9 +10,10 @@
 
     % perl tools/dev/mk_inno.pl
 
-=head1 SEE ALSO
+=head1 DESCRIPTION
 
-http://www.jrsoftware.org/
+From L<http://www.jrsoftware.org/>:  Inno Setup is a free installer for
+Windows programs.
 
 =cut
 

Modified: branches/orderedhash_revamp/tools/dev/mk_inno_language.pl
==============================================================================
--- branches/orderedhash_revamp/tools/dev/mk_inno_language.pl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/dev/mk_inno_language.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -11,9 +11,10 @@
     % cd languages/lang
     % perl ../../tools/dev/mk_inno_language.pl lang
 
-=head1 SEE ALSO
+=head1 DESCRIPTION
 
-http://www.jrsoftware.org/
+From L<http://www.jrsoftware.org/>:  Inno Setup is a free installer for
+Windows programs.
 
 =cut
 
@@ -56,20 +57,19 @@
             ? qq{Source: ".\\parrot-*.exe"; DestDir: "{app}\\bin"; Flags:}
             : '; no .exe'
         );
-my $pbc = <*.pbc>
+my $pbc = <*.pbc> && ! -d $lang
         ? qq{Source: ".\\*.pbc"; DestDir: "{app}\\lib\\parrot\\languages\\$lang"; Flags:}
         : '; no .pbc';
-my $lib = <library/*.pbc>
-#        ? qq{Source: ".\\library\\*.pbc"; DestDir: "{app}\\lib\\parrot\\languages\\$lang\\library"; Flags:}
-        ? qq{Source: ".\\library\\*.pbc"; DestDir: "{app}\\lib\\parrot\\library\\$lang"; Flags:}
-        : '; no .pbc lib';
+my $lng = -d $lang
+        ? qq{Source: ".\\$lang\\*.pbc"; DestDir: "{app}\\lib\\parrot\\languages\\$lang"; Flags: ignoreversion recursesubdirs}
+        : '; no lang';
 my $pmc = <src/pmc/*.dll>
         ? qq{Source: ".\\src\\pmc\\*.dll"; DestDir: "{app}\\lib\\parrot\\dynext"; Flags:}
         : '; no pmc';
 my $ops = <src/ops/*.dll>
         ? qq{Source: ".\\src\\ops\\*.dll"; DestDir: "{app}\\lib\\parrot\\dynext"; Flags:}
         : '; no ops';
-my $dynext = <dynext/*.dll>
+my $dynext = <dynext/*.dll> && !<src/pmc/*.dll> && !<src/ops/*.dll>
            ? qq{Source: ".\\dynext\\*.dll"; DestDir: "{app}\\lib\\parrot\\dynext"; Flags:}
            : '; no dynext';
 my $man = -d 'man'
@@ -109,7 +109,7 @@
 [Files]
 $exe
 $pbc
-$lib
+$lng
 $pmc
 $ops
 $dynext

Modified: branches/orderedhash_revamp/tools/dev/mk_language_shell.pl
==============================================================================
--- branches/orderedhash_revamp/tools/dev/mk_language_shell.pl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/dev/mk_language_shell.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -29,39 +29,31 @@
 files and directories (relative to C<path>, which defaults
 to F<xyz> if an explicit C<path> isn't given):
 
+    PARROT_REVISION
     README
-    Configure.pl
+    setup.pir
     xyz.pir
-    build/PARROT_REVISION
-    build/Makefile.in
-    build/src/ops/Makefile.in
-    build/src/pmc/Makefile.in
-    build/gen_parrot.pl
     doc/running.pod
     doc/Xyz.pod
-    dynext/.ignore
-    library/.ignore
-    src/builtins/say.pir
-    src/parser/grammar.pg
-    src/parser/grammar-oper.pg
-    src/parser/actions.pm
+    src/Xyz.pir
+    src/Xyz/Grammar.pm
+    src/Xyz/Actions.pm
+    src/Xyz/Compiler.pm
+    src/Xyz/Runtime.pm
     src/pmc/xyz.pmc
     src/ops/xyz.ops
-    t/harness
+    src/xyz.pir
     t/00-sanity.t
+    xyz/.ignore
 
 Any files that already exist are skipped, so this script can
 be used to repopulate a language directory with omitted files.
 
-After populating the language directory, the script attempts to
-run Configure.pl to automatically generate the Makefile
-from build/Makefile.in . This step is only executed if the
-optional C<path> argument is not specified.
-
 If all goes well, after creating the language shell one can simply
 change to the language directory and type
 
-    $ make test
+    $ parrot setup.pir
+    $ parrot setup.pir test
 
 to verify that the new language compiles and configures properly.
 
@@ -130,12 +122,6 @@
 ##  close the last file
 close($fh) if $fh;
 
-##  build the initial makefile if no path was specified on command line
-unless ($ARGV[1]) {
-  my $reconfigure = "$PConfig{perl} Configure.pl";
-  system("cd $lclang && $reconfigure");
-}
-
 ##  we're done
 1;
 
@@ -191,576 +177,117 @@
 __README__
 Language '@lang@' was created with @script@, r at rev@.
 
-See doc/@lang at .pod for the documentation, and
-doc/running.pod for the command-line options.
+    $ parrot setup.pir
+    $ parrot setup.pir test
 
-__Configure.pl__
+__setup.pir__
+#!/usr/bin/env parrot
 # @Id@
 
 =head1 NAME
 
-Configure.pl - a configure script for a high level language running on Parrot
-
-=head1 SYNOPSIS
+setup.pir - Python distutils style
 
-  perl Configure.pl --help
+=head1 DESCRIPTION
 
-  perl Configure.pl
+No Configure step, no Makefile generated.
 
-  perl Configure.pl --parrot_config=<path_to_parrot>
+=head1 USAGE
 
-  perl Configure.pl --gen-parrot [ -- --options-for-configure-parrot ]
+    $ parrot setup.pir build
+    $ parrot setup.pir test
+    $ sudo parrot setup.pir install
 
 =cut
 
-use strict;
-use warnings;
-use 5.008;
-
-use Getopt::Long qw(:config auto_help);
-
-our ( $opt_parrot_config, $opt_gen_parrot);
-GetOptions( 'parrot_config=s', 'gen-parrot' );
-
-#  Update/generate parrot build if needed
-if ($opt_gen_parrot) {
-    system($^X, 'build/gen_parrot.pl', @ARGV);
-}
+.sub 'main' :main
+    .param pmc args
+    $S0 = shift args
+    load_bytecode 'distutils.pbc'
 
-#  Get a list of parrot-configs to invoke.
-my @parrot_config_exe = $opt_parrot_config
-                      ? ( $opt_parrot_config )
-                      : (
-                          'parrot/parrot_config',
-                          '../../parrot_config',
-                          'parrot_config',
-                        );
-
-#  Get configuration information from parrot_config
-my %config = read_parrot_config(@parrot_config_exe);
-unless (%config) {
-    die "Unable to locate parrot_config.";
-}
+    .local int reqsvn
+    $P0 = open 'PARROT_REVISION', 'r'
+    $S0 = readline $P0
+    reqsvn = $S0
+    close $P0
+
+    .local pmc config
+    config = get_config()
+    $I0 = config['revision']
+    unless reqsvn > $I0 goto L1
+    $S1 = "Parrot revision r"
+    $S0 = reqsvn
+    $S1 .= $S0
+    $S1 .= " required (currently r"
+    $S0 = $I0
+    $S1 .= $S0
+    $S1 .= ")\n"
+    printerr $S1
+    end
+  L1:
+
+    $P0 = new 'Hash'
+    $P0['name'] = '@lang@'
+    $P0['abstract'] = 'the @lang@ compiler'
+    $P0['description'] = 'the @lang@ for Parrot VM.'
+
+    # build
+ at no_ops@    $P1 = new 'Hash'
+ at no_ops@    $P1['@lclang at _ops'] = 'src/ops/@lclang at .ops'
+ at no_ops@    $P0['dynops'] = $P1
+
+ at no_pmc@    $P2 = new 'Hash'
+ at no_pmc@    $P3 = split ' ', 'src/pmc/@lclang at .pmc'
+ at no_pmc@    $P2['@lclang at _group'] = $P3
+ at no_pmc@    $P0['dynpmc'] = $P2
+
+    $P4 = new 'Hash'
+    $P4['src/gen_actions.pir'] = 'src/@lang@/Actions.pm'
+    $P4['src/gen_compiler.pir'] = 'src/@lang@/Compiler.pm'
+    $P4['src/gen_grammar.pir'] = 'src/@lang@/Grammar.pm'
+    $P4['src/gen_runtime.pir'] = 'src/@lang@/Runtime.pm'
+    $P0['pir_nqp-rx'] = $P4
+
+    $P5 = new 'Hash'
+    $P6 = split "\n", <<'SOURCES'
+src/@lclang at .pir
+src/gen_actions.pir
+src/gen_compiler.pir
+src/gen_grammar.pir
+src/gen_runtime.pir
+SOURCES
+    $S0 = pop $P6
+    $P5['@lclang@/@lclang at .pbc'] = $P6
+    $P5['@lclang at .pbc'] = '@lclang at .pir'
+    $P0['pbc_pir'] = $P5
+
+    $P7 = new 'Hash'
+    $P7['parrot- at lclang@'] = '@lclang at .pbc'
+    $P0['installable_pbc'] = $P7
+
+    # test
+    $S0 = get_parrot()
+    $S0 .= ' @lclang at .pbc'
+    $P0['prove_exec'] = $S0
 
-#  Create the Makefile using the information we just got
-create_makefiles(%config);
+    # install
+    $P0['inst_lang'] = '@lclang@/@lclang at .pbc'
 
-sub read_parrot_config {
-    my @parrot_config_exe = @_;
-    my %config = ();
-    for my $exe (@parrot_config_exe) {
-        no warnings;
-        if (open my $PARROT_CONFIG, '-|', "$exe --dump") {
-            print "Reading configuration information from $exe\n";
-            while (<$PARROT_CONFIG>) {
-                $config{$1} = $2 if (/(\w+) => '(.*)'/);
-            }
-            close $PARROT_CONFIG;
-            last if %config;
-        }
-    }
-    %config;
-}
+    # dist
+    $P0['doc_files'] = 'README'
 
+    .tailcall setup(args :flat, $P0 :flat :named)
+.end
 
-#  Generate Makefiles from a configuration
-sub create_makefiles {
-    my %config = @_;
-    my %makefiles = (
-        'build/Makefile.in'         => 'Makefile',
- at no_pmc@        'build/src/pmc/Makefile.in' => 'src/pmc/Makefile',
- at no_ops@        'build/src/ops/Makefile.in' => 'src/ops/Makefile',
-    );
-    my $build_tool = $config{libdir} . $config{versiondir}
-                   . '/tools/dev/gen_makefile.pl';
-
-    foreach my $template (keys %makefiles) {
-        my $makefile = $makefiles{$template};
-        print "Creating $makefile\n";
-        system($config{perl}, $build_tool, $template, $makefile);
-    }
-}
 
 # Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
+#   mode: pir
 #   fill-column: 100
 # End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 ft=pir:
 
-__build/PARROT_REVISION__
+__PARROT_REVISION__
 @rev@
-__build/src/ops/Makefile.in__
-## @Id@
-
-# values from parrot_config
-VERSION_DIR   := @versiondir@
-INCLUDE_DIR   := @includedir@$(VERSION_DIR)
-LIB_DIR       := @libdir@$(VERSION_DIR)
-#STAGING_DIR   := ../../dynext
-STAGING_DIR   := @build_dir@/runtime/parrot/dynext
-#INSTALL_DIR   := $(LIB_DIR)/languages/@lclang@/dynext
-INSTALL_DIR   := $(LIB_DIR)/dynext
-
-# Set up extensions
-LOAD_EXT      := @load_ext@
-O             := @o@
-
-# Setup some commands
-PERL          := @perl@
-RM_F          := @rm_f@
-CHMOD         := @chmod@
-CP            := @cp@
-CC            := @cc@ -c
-LD            := @ld@
-LDFLAGS       := @ldflags@ @ld_debug@ @rpath_blib@ @linkflags@
-LD_LOAD_FLAGS := @ld_load_flags@
-CFLAGS        := @ccflags@ @cc_shared@ @cc_debug@ @ccwarn@ @cc_hasjit@ @cg_flag@ @gc_flag@
-CC_OUT        := @cc_o_out@
-LD_OUT        := @ld_out@
-LIBPARROT     := @inst_libparrot_ldflags@
-
-OPS2C           := $(PERL) $(LIB_DIR)/tools/build/ops2c.pl
-
-INCLUDES        := -I$(INCLUDE_DIR) -I$(INCLUDE_DIR)/pmc
-LINKARGS        := $(LDFLAGS) $(LD_LOAD_FLAGS) $(LIBPARROT)
-
-OPS_FILE := @lclang at .ops
-
-CLEANUPS := \
-  "*$(LOAD_EXT)" \
-  "*$(O)" \
-  "*.c" \
-  "*.h" \
-  "$(STAGING_DIR)/@lclang at _ops*$(LOAD_EXT)"
-
-
-all: staging
-
-generate: $(OPS_FILE)
-	$(OPS2C) C --dynamic $(OPS_FILE)
-	$(OPS2C) CSwitch --dynamic $(OPS_FILE)
-#IF(cg_flag):	$(OPS2C) CGoto --dynamic $(OPS_FILE)
-#IF(cg_flag):	$(OPS2C) CGP --dynamic $(OPS_FILE)
-
-compile: generate
-	$(CC) $(CC_OUT)@lclang at _ops$(O) $(INCLUDES) $(CFLAGS) @lclang at _ops.c
-	$(CC) $(CC_OUT)@lclang at _ops_switch$(O) $(INCLUDES) $(CFLAGS) @lclang at _ops_switch.c
-#IF(cg_flag):	$(CC) $(CC_OUT)@lclang at _ops_cg$(O) $(INCLUDES) $(CFLAGS) @lclang at _ops_cg.c
-#IF(cg_flag):	$(CC) $(CC_OUT)@lclang at _ops_cgp$(O) $(INCLUDES) $(CFLAGS) @lclang at _ops_cgp.c
-
-linklibs: compile
-	$(LD) $(LD_OUT)@lclang at _ops$(LOAD_EXT) @lclang at _ops$(O) $(LINKARGS)
-	$(LD) $(LD_OUT)@lclang at _ops_switch$(LOAD_EXT) @lclang at _ops_switch$(O) $(LINKARGS)
-#IF(cg_flag):	$(LD) $(LD_OUT)@lclang at _ops_cg$(LOAD_EXT) @lclang at _ops_cg$(O) $(LINKARGS)
-#IF(cg_flag):	$(LD) $(LD_OUT)@lclang at _ops_cgp$(LOAD_EXT) @lclang at _ops_cgp$(O) $(LINKARGS)
-
-staging: linklibs
-#IF(cygwin or hpux):	CHMOD 0775 "*$(LOAD_EXT)"
-	$(CP) "*$(LOAD_EXT)" $(STAGING_DIR)
-
-install:
-#IF(cygwin or hpux):	CHMOD 0775 "*$(LOAD_EXT)"
-	$(CP) "*$(LOAD_EXT)" $(INSTALL_DIR)
-
-uninstall:
-	$(RM_F) "$(INSTALL_DIR)/@lclang at _ops*$(LOAD_EXT)"
-
-Makefile: ../../build/src/ops/Makefile.in
-	cd ../.. && $(PERL) Configure.pl
-
-clean:
-	$(RM_F) $(CLEANUPS)
-
-realclean:
-	$(RM_F) $(CLEANUPS) Makefile
-
-# Local variables:
-#   mode: makefile
-# End:
-# vim: ft=make:
-
-__build/src/pmc/Makefile.in__
-## @Id@
-
-# values from parrot_config
-VERSION_DIR   := @versiondir@
-INCLUDE_DIR   := @includedir@$(VERSION_DIR)
-LIB_DIR       := @libdir@$(VERSION_DIR)
-SRC_DIR       := @srcdir@$(VERSION_DIR)
-TOOLS_DIR     := @libdir@$(VERSION_DIR)/tools/lib
-#STAGING_DIR   := ../../dynext
-STAGING_DIR   := @build_dir@/runtime/parrot/dynext
-#INSTALL_DIR   := $(LIB_DIR)/languages/@lclang@/dynext
-INSTALL_DIR   := $(LIB_DIR)/dynext
-
-# Set up extensions
-LOAD_EXT      := @load_ext@
-O             := @o@
-
-# Setup some commands
-PERL          := @perl@
-RM_F          := @rm_f@
-CHMOD         := @chmod@
-CP            := @cp@
-CC            := @cc@ -c
-LD            := @ld@
-LDFLAGS       := @ldflags@ @ld_debug@
-LD_LOAD_FLAGS := @ld_load_flags@
-CFLAGS        := @ccflags@ @cc_shared@ @cc_debug@ @ccwarn@ @cc_hasjit@ @cg_flag@ @gc_flag@
-CC_OUT        := @cc_o_out@
-LD_OUT        := @ld_out@
-LIBPARROT     := @inst_libparrot_ldflags@
-
-PMC2C_INCLUDES  := --include $(SRC_DIR) --include $(SRC_DIR)/pmc
-PMC2C           := $(PERL) $(LIB_DIR)/tools/build/pmc2c.pl
-PMC2CD          := $(PMC2C) --dump $(PMC2C_INCLUDES)
-PMC2CC          := $(PMC2C) --c $(PMC2C_INCLUDES)
-
-INCLUDES        := -I$(INCLUDE_DIR) -I$(INCLUDE_DIR)/pmc
-LINKARGS        := $(LDFLAGS) $(LD_LOAD_FLAGS) $(LIBPARROT)
-
- at uclang@_GROUP := @lclang at _group
-
-PMC_SOURCES := \
-  @lclang at .pmc
-
-OBJS := \
-  lib-$(@uclang at _GROUP)$(O) \
-  @lclang@$(O)
-
-CLEANUPS := \
-  "*$(LOAD_EXT)" \
-  "*$(O)" \
-  "*.c" \
-  "*.h" \
-  "*.dump" \
-#IF(win32):  "*.exp" \
-#IF(win32):  "*.ilk" \
-#IF(win32):  "*.manifext" \
-#IF(win32):  "*.pdb" \
-#IF(win32):  "*.lib" \
-  $(STAGING_DIR)/$(@uclang at _GROUP)$(LOAD_EXT)
-
-
-all: staging
-
-generate: $(PMC_SOURCES)
-	$(PMC2CD) @lclang at .pmc
-	$(PMC2CC) @lclang at .pmc
-	$(PMC2C) --library $(@uclang at _GROUP) --c $(PMC_SOURCES)
-
-compile: generate
-	$(CC) $(CC_OUT)@lclang@$(O) $(INCLUDES) $(CFLAGS) @lclang at .c
-	$(CC) $(CC_OUT)lib-$(@uclang at _GROUP)$(O) $(INCLUDES) $(CFLAGS) $(@uclang at _GROUP).c
-
-linklibs: compile
-	$(LD) $(LD_OUT)$(@uclang at _GROUP)$(LOAD_EXT) $(OBJS) $(LINKARGS)
-
-staging: linklibs
-#IF(cygwin or hpux):	CHMOD 0775 "*$(LOAD_EXT)"
-	$(CP) "*$(LOAD_EXT)" $(STAGING_DIR)
-
-install:
-#IF(cygwin or hpux):	CHMOD 0775 "*$(LOAD_EXT)"
-	$(CP) "*$(LOAD_EXT)" $(INSTALL_DIR)
-
-uninstall:
-	$(RM_F) $(INSTALL_DIR)/$(@uclang at _GROUP)$(LOAD_EXT)
-
-Makefile: ../../build/src/pmc/Makefile.in
-	cd ../.. && $(PERL) Configure.pl
-
-clean:
-	$(RM_F) $(CLEANUPS)
-
-realclean:
-	$(RM_F) $(CLEANUPS) Makefile
-
-# Local variables:
-#   mode: makefile
-# End:
-# vim: ft=make:
-
-__build/Makefile.in__
-## @Id@
-
-## arguments we want to run parrot with
-PARROT_ARGS   :=
-
-## configuration settings
-VERSION       := @versiondir@
-BIN_DIR       := @bindir@
-LIB_DIR       := @libdir@$(VERSION)
-DOC_DIR       := @docdir@$(VERSION)
-MANDIR        := @mandir@$(VERSION)
-
-# Set up extensions
-LOAD_EXT      := @load_ext@
-O             := @o@
-
-# Various paths
-PERL6GRAMMAR  := $(LIB_DIR)/library/PGE/Perl6Grammar.pbc
-NQP           := $(LIB_DIR)/languages/nqp/nqp.pbc
-PCT           := $(LIB_DIR)/library/PCT.pbc
-PMC_DIR       := src/pmc
-OPS_DIR       := src/ops
-
-## Setup some commands
-MAKE          := @make_c@
-PERL          := @perl@
-CAT           := @cat@
-CHMOD         := @chmod@
-CP            := @cp@
-MKPATH        := @mkpath@
-RM_F          := @rm_f@
-RM_RF         := @rm_rf@
-POD2MAN       := pod2man
-#IF(parrot_is_shared and not(cygwin or win32)):export LD_RUN_PATH := @blib_dir@:$(LD_RUN_PATH)
-PARROT        := $(BIN_DIR)/parrot at exe@
-PBC_TO_EXE    := $(BIN_DIR)/pbc_to_exe at exe@
-#IF(darwin):
-#IF(darwin):# MACOSX_DEPLOYMENT_TARGET must be defined for OS X compilation/linking
-#IF(darwin):export MACOSX_DEPLOYMENT_TARGET := @osx_version@
-
- at UCLANG@_GROUP := $(PMC_DIR)/@lclang at _group$(LOAD_EXT)
- at UCLANG@_OPS := $(OPS_DIR)/@lclang at _ops$(LOAD_EXT)
-
- at no_pmc@PMC_DEPS := build/src/pmc/Makefile.in $(PMC_DIR)/@lclang at .pmc
- at no_ops@OPS_DEPS := build/src/ops/Makefile.in $(OPS_DIR)/@lclang at .ops
-
-SOURCES := \
-  src/gen_grammar.pir \
-  src/gen_actions.pir \
-  src/gen_builtins.pir \
-  @lclang at .pir
-
-BUILTINS_PIR := \
-  src/builtins/say.pir
-
-DOCS := README
-
-BUILD_CLEANUPS := \
-  @lclang at .pbc \
-  "src/gen_*.pir" \
-  "*.c" \
-  "*$(O)" \
-  @lclang@@exe@ \
-#IF(win32):  parrot- at lclang@.exe \
-#IF(win32):  parrot- at lclang@.iss \
-#IF(win32):  "setup-parrot-*.exe" \
-  installable_ at lclang@@exe@
-
-TEST_CLEANUPS :=
-
-# the default target
-build: \
-  $(@UCLANG at _OPS) \
-  $(@UCLANG at _GROUP) \
-  @lclang at .pbc
-
-all: build @lclang@@exe@ installable
-
- at lclang@.pbc: $(SOURCES)
-	$(PARROT) $(PARROT_ARGS) -o @lclang at .pbc @lclang at .pir
-
- at lclang@@exe@: @lclang at .pbc
-	$(PBC_TO_EXE) @lclang at .pbc
-
-src/gen_grammar.pir: $(PERL6GRAMMAR) src/parser/grammar.pg src/parser/grammar-oper.pg
-	$(PARROT) $(PARROT_ARGS) $(PERL6GRAMMAR) \
-	    --output=src/gen_grammar.pir \
-	    src/parser/grammar.pg \
-	    src/parser/grammar-oper.pg
-
-src/gen_actions.pir: $(NQP) src/parser/actions.pm
-	$(PARROT) $(PARROT_ARGS) $(NQP) --output=src/gen_actions.pir \
-	    --target=pir src/parser/actions.pm
-
-src/gen_builtins.pir: $(BUILTINS_PIR)
-	$(CAT) $(BUILTINS_PIR) > src/gen_builtins.pir
-
-$(@UCLANG at _GROUP): $(PMC_DEPS)
- at no_pmc@	$(MAKE) $(PMC_DIR)
-
-$(@UCLANG at _OPS): $(OPS_DEPS)
- at no_ops@	$(MAKE) $(OPS_DIR)
-
-installable: installable_ at lclang@@exe@
-
-installable_ at lclang@@exe@: @lclang at .pbc
-	$(PBC_TO_EXE) @lclang at .pbc --install
-
-Makefile: build/Makefile.in
-	$(PERL) Configure.pl
-
-# This is a listing of all targets, that are meant to be called by users
-help:
-	@echo ""
-	@echo "Following targets are available for the user:"
-	@echo ""
-	@echo "  build:             @lclang at .pbc"
-	@echo "                     This is the default."
-	@echo "  @lclang@@exe@      Self-hosting binary not to be installed."
-	@echo "  all:               @lclang at .pbc @lclang@@exe@ installable"
-	@echo "  installable:       Create libs and self-hosting binaries to be installed."
-	@echo "  install:           Install the installable targets and docs."
-	@echo ""
-	@echo "Testing:"
-	@echo "  test:              Run the test suite."
-	@echo "  test-installable:  Test self-hosting targets."
-	@echo "  testclean:         Clean up test results."
-	@echo ""
-	@echo "Cleaning:"
-	@echo "  clean:             Basic cleaning up."
-	@echo "  realclean:         Removes also files generated by 'Configure.pl'"
-	@echo "  distclean:         Removes also anything built, in theory"
-	@echo ""
-	@echo "Misc:"
-	@echo "  help:              Print this help message."
-	@echo ""
-
-test: build
-	$(PERL) -I$(LIB_DIR)/tools/lib t/harness --bindir=$(BIN_DIR)
-
-# basic run for missing libs
-test-installable: installable
-	echo "1" | ./installable_ at lclang@@exe@
-
-install: installable
- at no_ops@	$(MAKE) $(OPS_DIR) install
- at no_pmc@	$(MAKE) $(PMC_DIR) install
-	$(CP) installable_ at lclang@@exe@ $(BIN_DIR)/parrot- at lclang@@exe@
-	$(CHMOD) 0755 $(BIN_DIR)/parrot- at lclang@@exe@
-	-$(MKPATH) $(LIB_DIR)/languages/@lclang@
-	$(CP) @lclang at .pbc $(LIB_DIR)/languages/@lclang@/@lclang at .pbc
- at no_doc@	-$(MKPATH) $(MANDIR)/man1
- at no_doc@	$(POD2MAN) doc/running.pod > $(MANDIR)/man1/parrot- at lclang@.1
- at no_doc@	-$(MKPATH) $(DOC_DIR)/languages/@lclang@
- at no_doc@	$(CP) $(DOCS) $(DOC_DIR)/languages/@lclang@
-
-uninstall:
- at no_ops@	$(MAKE) $(OPS_DIR) uninstall
- at no_pmc@	$(MAKE) $(PMC_DIR) uninstall
-	$(RM_F) $(BIN_DIR)/parrot- at lclang@@exe@
-	$(RM_RF) $(LIB_DIR)/languages/@lclang@
- at no_doc@	$(RM_F) $(MANDIR)/man1/parrot- at lclang@.1
- at no_doc@	$(RM_RF) $(DOC_DIR)/languages/@lclang@
-
-win32-inno-installer: installable
- at no_doc@	-$(MKPATH) man/man1
- at no_doc@	$(POD2MAN) doc/running.pod > man/man1/parrot- at lclang@.1
- at no_doc@	-$(MKPATH) man/html
- at no_doc@	pod2html --infile doc/running.pod --outfile man/html/parrot- at lclang@.html
-	$(CP) installable_ at lclang@@exe@ parrot- at lclang@.exe
-	$(PERL) -I$(LIB_DIR)/tools/lib $(LIB_DIR)/tools/dev/mk_inno_language.pl @lclang@
-	iscc parrot- at lclang@.iss
-
-testclean:
-	$(RM_F) $(TEST_CLEANUPS)
-
-clean:
- at no_ops@	$(MAKE) $(OPS_DIR) clean
- at no_pmc@	$(MAKE) $(PMC_DIR) clean
-	$(RM_F) $(TEST_CLEANUPS) $(BUILD_CLEANUPS)
-
-realclean:
- at no_ops@	$(MAKE) $(OPS_DIR) realclean
- at no_pmc@	$(MAKE) $(PMC_DIR) realclean
-	$(RM_F) $(TEST_CLEANUPS) $(BUILD_CLEANUPS) Makefile
-
-distclean: realclean
-
-# Local variables:
-#   mode: makefile
-# End:
-# vim: ft=make:
-
-__build/gen_parrot.pl__
-#! perl
-
-=head1 TITLE
-
-gen_parrot.pl - script to obtain and build Parrot for @lang@
-
-=head2 SYNOPSIS
-
-    perl gen_parrot.pl [--option-for-Configure-pl]
-
-=head2 DESCRIPTION
-
-Maintains an appropriate copy of Parrot in the parrot/ subdirectory.
-The revision of Parrot to be used in the build is given by the
-build/PARROT_REVISION file.
-
-=cut
-
-use strict;
-use warnings;
-use 5.008;
-
-##  determine what revision of Parrot we require
-open my $REQ, 'build/PARROT_REVISION'
-    or die "cannot open build/PARROT_REVISION ($!)\n";
-my $required = <$REQ>;
-chomp $required;
-close $REQ;
-
-{
-    no warnings;
-    if (open my $REV, '-|', 'parrot/parrot_config revision') {
-        my $revision = <$REV>;
-        close $REV;
-        chomp $revision;
-        if ($revision >= $required) {
-            print "Parrot r$revision already available (r$required required)\n";
-            exit(0);
-        }
-    }
-}
-
-print "Checking out Parrot r$required via svn...\n";
-system("svn checkout -r $required https://svn.parrot.org/parrot/trunk parrot");
-
-chdir('parrot');
-
-
-##  If we have a Makefile from a previous build, do a 'make realclean'
-if (-f 'Makefile') {
-    my %config = read_parrot_config();
-    my $make = $config{'make'};
-    if ($make) {
-        print "Performing '$make realclean'\n";
-        system($make, 'realclean');
-    }
-}
-
-##  Configure Parrot
-system($^X, 'Configure.pl', @ARGV);
-
-my %config = read_parrot_config();
-my $make = $config{'make'};
-system( $make );
-system( $make, 'install-dev' );
-
-sub read_parrot_config {
-    my %config = ();
-    if (open my $CFG, 'config_lib.pasm') {
-        while (<$CFG>) {
-            $config{$1} = $2 if (/P0\["(.*?)"], "(.*?)"/);
-        }
-        close $CFG;
-    }
-    %config;
-}
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
-
 __doc/@lang at .pod__
 # @Id@
 
@@ -805,7 +332,52 @@
 
 __dynext/.ignore__
 
+__ at lclang@/.ignore__
+
 __ at lclang@.pir__
+# @Id@
+
+=head1 TITLE
+
+ at lclang@.pir - A @lang@ compiler.
+
+=head2 Description
+
+This is the entry point for the @lang@ compiler.
+
+=head2 Functions
+
+=over 4
+
+=item main(args :slurpy)  :main
+
+Start compilation by passing any command line C<args>
+to the @lang@ compiler.
+
+=cut
+
+.sub 'main' :main
+    .param pmc args
+
+    load_language '@lclang@'
+
+    $P0 = compreg '@lang@'
+    $P1 = $P0.'command_line'(args)
+.end
+
+=back
+
+=cut
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
+
+__src/@lclang at .pir__
+# @Id@
+
 =head1 TITLE
 
 @lclang at .pir - A @lang@ compiler.
@@ -829,37 +401,25 @@
 
 =cut
 
-.namespace [ '@lang@::Compiler' ]
-
+.HLL '@lclang@'
 @no_pmc at .loadlib '@lclang at _group'
 
-.sub 'onload' :anon :load :init
-    load_bytecode 'PCT.pbc'
-
-    $P0 = get_hll_global ['PCT'], 'HLLCompiler'
-    $P1 = $P0.'new'()
-    $P1.'language'('@lang@')
-    $P1.'parsegrammar'('@lang@::Grammar')
-    $P1.'parseactions'('@lang@::Grammar::Actions')
-.end
-
-=item main(args :slurpy)  :main
-
-Start compilation by passing any command line C<args>
-to the @lang@ compiler.
-
-=cut
+.namespace []
 
-.sub 'main' :main
-    .param pmc args
+.sub '' :anon :load
+    load_bytecode 'HLL.pbc'
 
-    $P0 = compreg '@lang@'
-    $P1 = $P0.'command_line'(args)
+    .local pmc hllns, parrotns, imports
+    hllns = get_hll_namespace
+    parrotns = get_root_namespace ['parrot']
+    imports = split ' ', 'PAST PCT HLL Regex Hash'
+    parrotns.'export_to'(hllns, imports)
 .end
 
-.include 'src/gen_builtins.pir'
 .include 'src/gen_grammar.pir'
 .include 'src/gen_actions.pir'
+.include 'src/gen_compiler.pir'
+.include 'src/gen_runtime.pir'
 
 =back
 
@@ -871,163 +431,121 @@
 # End:
 # vim: expandtab shiftwidth=4 ft=pir:
 
-__src/parser/grammar.pg__
-# @Id@
-
+__src/@lang@/Grammar.pm__
 =begin overview
 
-This is the grammar for @lang@ written as a sequence of Perl 6 rules.
+This is the grammar for @lang@ in Perl 6 rules.
 
 =end overview
 
-grammar @lang@::Grammar is PCT::Grammar;
+grammar @lang@::Grammar is HLL::Grammar;
 
-rule TOP {
-    <statement>*
-    [ $ || <panic: 'Syntax error'> ]
-    {*}
+token TOP {
+    <statementlist>
+    [ $ || <.panic: "Syntax error"> ]
 }
 
-##  this <ws> rule treats # as "comment to eol"
-##  you may want to replace it with something appropriate
+## Lexer items
+
+# This <ws> rule treats # as "comment to eol".
 token ws {
     <!ww>
     [ '#' \N* \n? | \s+ ]*
 }
 
-rule statement {
-    'say' <expression> [ ',' <expression> ]* ';'
-    {*}
-}
-
-rule value {
-    | <integer> {*}                              #= integer
-    | <quote> {*}                                #= quote
-}
+## Statements
 
-token integer { \d+ {*} }
+rule statementlist { [ <statement> | <?> ] ** ';' }
 
-token quote {
-    [ \' <string_literal: '\'' > \' | \" <string_literal: '"' > \" ]
-    {*}
-}
-
-##  terms
-token term {
-    | <value> {*}                                #= value
+rule statement {
+    | <statement_control>
+    | <EXPR>
 }
 
-rule expression is optable { ... }
-
-__src/parser/grammar-oper.pg__
-# @Id@
+proto token statement_control { <...> }
+rule statement_control:sym<say>   { <sym> [ <EXPR> ] ** ','  }
+rule statement_control:sym<print> { <sym> [ <EXPR> ] ** ','  }
 
-##  expressions and operators
-proto 'term:'     is precedence('=')     is parsed(&term)      { ... }
+## Terms
 
-## multiplicative operators
-proto infix:<*>   is looser(term:)       is pirop('mul')     { ... }
-proto infix:</>   is equiv(infix:<*>)    is pirop('div')     { ... }
-
-## additive operators
-proto infix:<+>   is looser(infix:<*>)   is pirop('add')     { ... }
-proto infix:<->   is equiv(infix:<+>)    is pirop('sub')     { ... }
+token term:sym<integer> { <integer> }
+token term:sym<quote> { <quote> }
 
-__src/parser/actions.pm__
-# @Id@
+proto token quote { <...> }
+token quote:sym<'> { <?[']> <quote_EXPR: ':q'> }
+token quote:sym<"> { <?["]> <quote_EXPR: ':qq'> }
 
-=begin comments
+## Operators
 
- at lang@::Grammar::Actions - ast transformations for @lang@
+INIT {
+    @lang@::Grammar.O(':prec<u>, :assoc<left>',  '%multiplicative');
+    @lang@::Grammar.O(':prec<t>, :assoc<left>',  '%additive');
+}
 
-This file contains the methods that are used by the parse grammar
-to build the PAST representation of an @lang@ program.
-Each method below corresponds to a rule in F<src/parser/grammar.pg>,
-and is invoked at the point where C<{*}> appears in the rule,
-with the current match object as the first argument.  If the
-line containing C<{*}> also has a C<#= key> comment, then the
-value of the comment is passed as the second argument to the method.
+token circumfix:sym<( )> { '(' <.ws> <EXPR> ')' }
 
-=end comments
+token infix:sym<*>  { <sym> <O('%multiplicative, :pirop<mul>')> }
+token infix:sym</>  { <sym> <O('%multiplicative, :pirop<div>')> }
 
-class @lang@::Grammar::Actions;
+token infix:sym<+>  { <sym> <O('%additive, :pirop<add>')> }
+token infix:sym<->  { <sym> <O('%additive, :pirop<sub>')> }
+__src/@lang@/Actions.pm__
+class @lang@::Actions is HLL::Actions;
 
 method TOP($/) {
-    my $past := PAST::Block.new( :blocktype('declaration'), :node( $/ ) );
-    for $<statement> {
-        $past.push( $( $_ ) );
-    }
-    make $past;
+    make PAST::Block.new( $<statementlist>.ast , :hll<@lclang@>, :node($/) );
 }
 
-
-method statement($/) {
-    my $past := PAST::Op.new( :name('say'), :pasttype('call'), :node( $/ ) );
-    for $<expression> {
-        $past.push( $( $_ ) );
-    }
+method statementlist($/) {
+    my $past := PAST::Stmts.new( :node($/) );
+    for $<statement> { $past.push( $_.ast ); }
     make $past;
 }
 
-##  expression:
-##    This is one of the more complex transformations, because
-##    our grammar is using the operator precedence parser here.
-##    As each node in the expression tree is reduced by the
-##    parser, it invokes this method with the operator node as
-##    the match object and a $key of 'reduce'.  We then build
-##    a PAST::Op node using the information provided by the
-##    operator node.  (Any traits for the node are held in $<top>.)
-##    Finally, when the entire expression is parsed, this method
-##    is invoked with the expression in $<expr> and a $key of 'end'.
-method expression($/, $key) {
-    if ($key eq 'end') {
-        make $($<expr>);
-    }
-    else {
-        my $past := PAST::Op.new( :name($<type>),
-                                  :pasttype($<top><pasttype>),
-                                  :pirop($<top><pirop>),
-                                  :lvalue($<top><lvalue>),
-                                  :node($/)
-                                );
-        for @($/) {
-            $past.push( $($_) );
-        }
-        make $past;
-    }
+method statement($/) {
+    make $<statement_control> ?? $<statement_control>.ast !! $<EXPR>.ast;
 }
 
-
-##  term:
-##    Like 'statement' above, the $key has been set to let us know
-##    which term subrule was matched.
-method term($/, $key) {
-    make $( $/{$key} );
+method statement_control:sym<say>($/) {
+    my $past := PAST::Op.new( :name<say>, :pasttype<call>, :node($/) );
+    for $<EXPR> { $past.push( $_.ast ); }
+    make $past;
 }
 
-
-method value($/, $key) {
-    make $( $/{$key} );
+method statement_control:sym<print>($/) {
+    my $past := PAST::Op.new( :name<print>, :pasttype<call>, :node($/) );
+    for $<EXPR> { $past.push( $_.ast ); }
+    make $past;
 }
 
+method term:sym<integer>($/) { make $<integer>.ast; }
+method term:sym<quote>($/) { make $<quote>.ast; }
 
-method integer($/) {
-    make PAST::Val.new( :value( ~$/ ), :returns('Integer'), :node($/) );
-}
+method quote:sym<'>($/) { make $<quote_EXPR>.ast; }
+method quote:sym<">($/) { make $<quote_EXPR>.ast; }
 
+method circumfix:sym<( )>($/) { make $<EXPR>.ast; }
 
-method quote($/) {
-    make PAST::Val.new( :value( $($<string_literal>) ), :node($/) );
-}
+__src/@lang@/Compiler.pm__
+class @lang@::Compiler is HLL::Compiler;
 
+INIT {
+    @lang@::Compiler.language('@lang@');
+    @lang@::Compiler.parsegrammar(@lang@::Grammar);
+    @lang@::Compiler.parseactions(@lang@::Actions);
+}
+__src/@lang@/Runtime.pm__
+# language-specific runtime functions go here
 
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
+sub print(*@args) {
+    pir::print(pir::join('', @args));
+    1;
+}
 
+sub say(*@args) {
+    pir::say(pir::join('', @args));
+    1;
+}
 __src/pmc/@lclang at .pmc__
 /*
 Copyright (C) 20xx, Parrot Foundation.
@@ -1093,7 +611,6 @@
     provides array
     group   @lclang at _group
 
-    need_ext
     dynpmc
     {
 /*
@@ -1106,7 +623,6 @@
 
 */
 
-    /* RT#48194: move any constant string declarations here so we just do them once. */
     void class_init() {
     }
 
@@ -1199,7 +715,6 @@
         } else if (new_size > old_size) {
             pos = 0;
             for (; new_size != old_size; old_size++, pos++) {
-                /* RT#48196 clone this? */
                 VTABLE_push_pmc(INTERP, SELF,
                     VTABLE_get_pmc_keyed_int(INTERP, SELF, pos));
             }
@@ -1228,8 +743,11 @@
  * Copyright (C) 20xx, Parrot Foundation.
  */
 
+BEGIN_OPS_PREAMBLE
+
 #include "parrot/dynext.h"
-VERSION = PARROT_VERSION;
+
+END_OPS_PREAMBLE
 
 /* Op to get the address of a PMC. */
 inline op @lclang at _pmc_addr(out INT, invar PMC) :base_core {
@@ -1243,70 +761,6 @@
  * End:
  * vim: expandtab shiftwidth=4:
  */
-__src/builtins/say.pir__
-# @Id@
-
-=head1
-
-say.pir -- simple implementation of a say function
-
-=cut
-
-.namespace []
-
-.sub 'say'
-    .param pmc args            :slurpy
-    .local pmc it
-    it = iter args
-  iter_loop:
-    unless it goto iter_end
-    $P0 = shift it
-    print $P0
-    goto iter_loop
-  iter_end:
-    print "\n"
-    .return ()
-.end
-
-
-# Local Variables:
-#   mode: pir
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4 ft=pir:
-
-__t/harness__
-#! perl
-
-# @Id@
-
-# pragmata
-use strict;
-use warnings;
-use Getopt::Long;
-use 5.008;
-
-our %harness_args = (
-    language  => '@lang@',
-    verbosity => 0,
-);
-
-GetOptions(
-        'verbosity=i'       => \$harness_args{verbosity},
-        'bindir=s'          => \my $bindir,
-        # A sensible default is num_cores + 1.
-        # Many people have two cores these days.
-        'jobs:3'            => \$harness_args{jobs},
-);
-
-if ($bindir) {
-    $harness_args{exec} = [$bindir.'/parrot', '@lclang at .pbc'];
-}
-else {
-    $harness_args{compiler} = '@lclang at .pbc';
-}
-
-eval 'use Parrot::Test::Harness %harness_args';
 
 __t/00-sanity.t__
 # This just checks that the basic parsing and call to builtin say() works.

Modified: branches/orderedhash_revamp/tools/dev/mk_manifest_and_skip.pl
==============================================================================
--- branches/orderedhash_revamp/tools/dev/mk_manifest_and_skip.pl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/dev/mk_manifest_and_skip.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -10,6 +10,12 @@
 
 my $script = $0;
 
+if (-e '.git') {
+    print "Sorry, this script is not compatible with git-svn\n";
+    print "Patches Welcome!\n";
+    exit 1;
+}
+
 my $mani = Parrot::Manifest->new( { script => $script, } );
 
 my $manifest_lines_ref = $mani->prepare_manifest();

Modified: branches/orderedhash_revamp/tools/dev/mk_native_pbc
==============================================================================
--- branches/orderedhash_revamp/tools/dev/mk_native_pbc	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/dev/mk_native_pbc	Sat Jan 23 01:49:53 2010	(r43541)
@@ -122,15 +122,13 @@
 tail myconfig
 make -s || exit 1
 
-[ -e t/op/number_1.pasm ] || perl t/harness t/op/number.t
-[ -e t/op/string_133.pasm ] || perl t/harness t/op/string.t
 ./parrot -o t/native_pbc/integer_${N}.pbc -a - <<EOF
 print 0x10203040
 end
 EOF
 [ $? -le 0 ] && echo "t/native_pbc/integer_${N}.pbc updated"
-./parrot -o t/native_pbc/number_${N}.pbc t/op/number_1.pasm && echo "t/native_pbc/number_${N}.pbc updated"
-./parrot -o t/native_pbc/string_${N}.pbc t/op/string_133.pasm  && echo "t/native_pbc/string_${N}.pbc updated"
+./parrot -o t/native_pbc/number_${N}.pbc t/native_pbc/testdata/number.pasm && echo "t/native_pbc/number_${N}.pbc updated"
+./parrot -o t/native_pbc/string_${N}.pbc t/native_pbc/testdata/string.pasm  && echo "t/native_pbc/string_${N}.pbc updated"
 
 make pbc_dump$exe
 ./pbc_dump -h t/native_pbc/number_${N}.pbc

Modified: branches/orderedhash_revamp/tools/dev/ops_not_tested.pl
==============================================================================
--- branches/orderedhash_revamp/tools/dev/ops_not_tested.pl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/dev/ops_not_tested.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -12,7 +12,13 @@
 use Parrot::Op;
 use Parrot::OpLib::core;
 
-=head1 The problem
+=head1 NAME
+
+tools/dev/ops_not_tested.pl
+
+=head1 DESCRIPTION
+
+The problem this program addresses is described in this IRC log:
 
 10:23 <toor> # Tests - ~1/3 of opcodes are uncovered by tests <--
              were can I see which ones are not

Modified: branches/orderedhash_revamp/tools/dev/parrot-fuzzer
==============================================================================
--- branches/orderedhash_revamp/tools/dev/parrot-fuzzer	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/dev/parrot-fuzzer	Sat Jan 23 01:49:53 2010	(r43541)
@@ -16,22 +16,22 @@
 
 '''
 
-=head1 Name
+=head1 NAME
 
 parrot-fuzzer
 
-=head1 Description
+=head1 DESCRIPTION
 
 This is a fuzzer for Parrot, written in Python using the fusil library.  It
 attempts to break Parrot by generating calls to random PIR opcodes.
 
-=head1 Dependencies
+=head1 DEPENDENCIES
 
 This script requires Python 2.5+ to run.  The fusil
 L<http://fusil.hachoir.org/trac> and python-ptrace
 L<http://python-ptrace.hachoir.org/trac> libraries are also required.
 
-=head1 Running
+=head1 USAGE
 
 Short version: C<sudo ./tools/dev/parrot-fuzzer>
 
@@ -49,7 +49,7 @@
 of Parrot's source code.  You can use a different dir via
 C<--parrot_root=/some/other/path>.
 
-=head1 Options
+=head1 OPTIONS
 
 =over 4
 
@@ -79,7 +79,7 @@
 
 =back
 
-=head1 License
+=head1 LICENSE
 
 This program is distributed under the same license as Parrot itself.
 
@@ -419,7 +419,6 @@
 class OpfuncGenerator:
     opfunc_list = []
     opfunc_blacklist = [
-            'branch_cs', # TT# 470 - known to segfault
             'check_events', #only for testing
             'check_events__', #not for direct use
             'clears', #clearing all [SPIN] registers isn't useful

Modified: branches/orderedhash_revamp/tools/dev/parrot.supp
==============================================================================
--- branches/orderedhash_revamp/tools/dev/parrot.supp	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/dev/parrot.supp	Sat Jan 23 01:49:53 2010	(r43541)
@@ -42,20 +42,20 @@
 {
    trace_system_stack_2
    Memcheck:Cond
-   fun:pobject_lives
+   fun:Parrot_gc_mark_PObj_alive
    fun:trace_mem_block
 }
 {
    trace_system_stack_3
    Memcheck:Value4
-   fun:pobject_lives
+   fun:Parrot_gc_mark_PObj_alive
    fun:trace_mem_block
 }
 {
    trace_system_stack_4
    Memcheck:Value4
    fun:mark_special
-   fun:pobject_lives
+   fun:Parrot_gc_mark_PObj_alive
    fun:trace_mem_block
 }
 {

Added: branches/orderedhash_revamp/tools/dev/parrot_shell.pl
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/tools/dev/parrot_shell.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,182 @@
+#! perl
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+use 5.008;
+use strict;
+use warnings;
+use FindBin qw($Bin);
+use lib "$Bin/../lib";    # install location
+use lib "$Bin/../../lib"; # build location
+use IO::File ();
+use File::Spec;
+use Parrot::Config;
+use File::Temp qw/ tempfile /;
+use Benchmark qw/timeit timestr :hireswallclock/;
+
+=head1 NAME
+
+tools/dev/parrot_shell.pl - The Parrot Shell
+
+=head1 SYNOPSIS
+
+    % perl tools/dev/parrot_shell.pl
+
+=head1 DESCRIPTION
+
+The Parrot Shell allows you to rapidly prototype Parrot code. It wraps your code
+in a ".sub main" and ".end", so you don't have to, unless your code begins with
+".sub". It reads code from STDIN until it sees a line containing a single ".",
+which is how you tell parrot_shell to run the code you are giving to it:
+
+Example:
+    parrot_shell 0> $I0 = 42
+    $N1 = sqrt $I0
+    say $N1
+    .
+    Output:
+    6.48074069840786
+
+    parrot_shell 1> quit
+    Thanks for visiting the Parrot Shell, come back soon!
+
+Each numbered Parrot Shell session is run in its own interpreter, so no registers
+or variables are shared/leaked between them.
+
+=cut
+
+my $parrot;
+my $session_no = 0;
+
+BEGIN {
+    $parrot = File::Spec->catfile( ".", "parrot");
+    unless (-e $parrot) {
+        warn "$parrot not found, attempting to use an installed parrot";
+        $parrot = 'parrot';
+    }
+    my $exefile = $parrot . $PConfig{exe};
+}
+
+show_welcome();
+
+while(1) {
+    my $code;
+    show_prompt($session_no);
+
+    while( my $line = <STDIN> ) {
+        exit_shell() if $line =~ m/^q(uit)?$/;
+
+        if ($line =~ m/^h(elp)?$/) {
+            show_help();
+            show_prompt($session_no) if !defined $code;
+            next;
+        }
+        if ($line =~ m/^\s*\.\s*$/) { # Run it, baby!
+            print eval_snippet($code);
+            last;
+        }
+        else {
+            $code .= $line;
+        }
+    }
+
+    $session_no++;
+}
+
+sub show_welcome {
+    print <<BIENVENIDO;
+Welcome to the Parrot Shell, it's experimental!
+Type h or help for some basic help
+Type q or quit to flee the madness
+BIENVENIDO
+
+}
+
+sub show_prompt {
+    my ($session_no) = @_;
+    print "\nparrot_shell $session_no> ";
+}
+sub exit_shell {
+    print "Thanks for visiting the Parrot Shell, come back soon!\n";
+    exit 0;
+}
+
+sub show_help {
+    print <<'EX';
+
+The Parrot Shell allows you to rapidly prototype Parrot code. It wraps your code
+in a ".sub main" and ".end", so you don't have to, unless your code begins with
+".sub". It reads code from STDIN until it sees a line containing a single ".",
+which is how you tell parrot_shell to run the code you are giving to it:
+
+Example:
+    parrot_shell> $I0 = 42
+    $N1 = sqrt $I0
+    say $N1
+    .
+    Output:
+    6.48074069840786
+EX
+}
+
+sub eval_snippet {
+    my ($snippet) = @_;
+    my $codefn   = get_tempfile();
+    my $stdoutfn = get_tempfile();
+    my $f        = IO::File->new(">$codefn");
+
+    $f->print(normalize_snippet($snippet || ''));
+    $f->close();
+
+    my $time = timestr(timeit(1, sub { system("$parrot $codefn >$stdoutfn 2>&1") } ));
+    $time =~ s/\(.*//g;
+
+    handle_errors($?) if $?;
+
+    $f = IO::File->new($stdoutfn);
+
+    my $output = join( '', <$f> );
+    return "Time: $time\nOutput:\n$output";
+}
+
+sub handle_errors {
+    my ($exit_code) = @_;
+    if ($exit_code == -1) {
+        print "Error: failed to execute: $!\n";
+    }
+    elsif ($exit_code & 127) {
+        printf "Error: child died with signal %d, %s coredump\n",
+            ($exit_code & 127),  ($exit_code & 128) ? 'with' : 'without';
+    }
+    else {
+        printf "Error: child exited with value %d\n", $? >> 8;
+    }
+}
+
+sub get_tempfile {
+    my (undef, $name)   = tempfile( CLEANUP => 1);
+    return $name;
+}
+
+sub normalize_snippet {
+    my ($snippet) = @_;
+
+    if ($snippet =~ m/^\.sub/) {
+        # don't wrap snippet
+        return $snippet;
+    }
+    else {
+        return <<SNIP;
+.sub main :main
+$snippet
+.end
+SNIP
+    }
+}
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/tools/dev/pbc_header.pl
==============================================================================
--- branches/orderedhash_revamp/tools/dev/pbc_header.pl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/dev/pbc_header.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -99,18 +99,6 @@
     return;
 }
 
-sub pbc_info {
-    for my $f (@ARGV) {
-        open my $F, "<", "$f" or die "Can't open $f: $!";
-        binmode $F;
-        print "$f\n";
-
-        show_pbc_file_info($F);
-    }
-
-    return;
-}
-
 my @pbc_header_type_names;
 BEGIN {
     @pbc_header_type_names = qw( directory default fixup constant

Modified: branches/orderedhash_revamp/tools/dev/pbc_to_exe.pir
==============================================================================
--- branches/orderedhash_revamp/tools/dev/pbc_to_exe.pir	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/dev/pbc_to_exe.pir	Sat Jan 23 01:49:53 2010	(r43541)
@@ -6,6 +6,10 @@
 
 pbc_to_exe
 
+=head1 DESCRIPTION
+
+Compile bytecode to executable.
+
 =head2 SYNOPSIS
 
   pbc_to_exe my.pbc
@@ -31,7 +35,6 @@
     (infile, cfile, objfile, exefile) = 'handle_args'(argv)
     unless infile > '' goto err_infile
 
-
     .local string code_type
     code_type = 'determine_code_type'()
 
@@ -79,6 +82,7 @@
             if (!interp)
                 return 1;
 
+            Parrot_init_stacktop(interp, &interp);
             Parrot_set_executable_name(interp,
                 Parrot_str_new(interp, argv[0], 0));
             Parrot_set_flag(interp, PARROT_DESTROY_FLAG);
@@ -163,7 +167,7 @@
     cfile   = 'replace_pbc_extension'(infile, '.c')
     objfile = 'replace_pbc_extension'(infile, obj)
     $S0     = 'replace_pbc_extension'(infile, exe)
-    exefile = concat 'installable_', $S0
+    exefile = 'prepend_installable'($S0)
 
     .return(infile, cfile, objfile, exefile)
 
@@ -415,9 +419,9 @@
     .local string rc_contents
     rc_contents  = ''
     rc_contents .= rc_constant_defines
-    rc_contents .= 'RESOURCE_NAME_ID_WHOLE_PBC RESOURCE_TYPE_ID_WHOLE_PBC '
+    rc_contents .= 'RESOURCE_NAME_ID_WHOLE_PBC RESOURCE_TYPE_ID_WHOLE_PBC "'
     rc_contents .= pbc_path
-    rc_contents .= "\n"
+    rc_contents .= "\"\n"
 
     .local pmc rc_fh
     rc_fh = open rc_path, 'w'
@@ -652,7 +656,7 @@
     .local pmc file
     file = new 'File'
     .local string manifest_file_name
-    manifest_file_name  = exefile
+    manifest_file_name  = clone exefile
     manifest_file_name .= '.manifest'
     .local pmc manifest_exists
     manifest_exists = file.'exists'( manifest_file_name )
@@ -679,6 +683,26 @@
     .return()
 .end
 
+# handle any directory components
+.sub 'prepend_installable'
+    .param string file
+
+    $P0   = '_config'()
+
+    .local string slash
+    slash = $P0['slash']
+
+    .local pmc path
+    path = split slash, file
+
+    file     = path[-1]
+    file     = concat 'installable_', file
+    path[-1] = file
+
+    file     = join slash, path
+
+    .return( file )
+.end
 
 # Local Variables:
 #   mode: pir

Modified: branches/orderedhash_revamp/tools/dev/pmcrenumber.pl
==============================================================================
--- branches/orderedhash_revamp/tools/dev/pmcrenumber.pl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/dev/pmcrenumber.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -40,7 +40,8 @@
 
 =head1 DESCRIPTION
 
-This program should be used when adding or removing PMCs.
+This program should be used when adding PMCs. Note that it does not remove
+numbers assigned to PMCs that have been removed; this happens very rarely.
 
 =head1 SEE ALSO
 

Added: branches/orderedhash_revamp/tools/dev/pprof2cg.nqp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/tools/dev/pprof2cg.nqp	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,284 @@
+#! parrot-nqp
+
+
+#XXX: can't do main with args yet, so fake it
+
+main();
+
+sub main() {
+
+    my $filename := pir::getinterp__P[2][1];
+
+    my %stats;
+    %stats<global_stats><total_time> := 0;
+
+    my $fh := pir::new__PP("FileHandle");
+    $fh.open($filename, "r");
+    
+    process_input($fh, %stats);
+
+    $fh.close();
+
+    #print_stats(%stats);
+
+    $filename := $filename ~ ".out";
+
+    $fh.open($filename, "w");
+    my @profile := get_cg_profile(%stats);
+    for @profile -> $line {
+        $fh.print($line ~ "\n");
+    }
+    $fh.close();
+    say("all done.");
+}
+
+sub process_input($fh, %stats) {
+    my @call_stack;
+    my $line := $fh.readline();
+
+    while (!$fh.eof()) {
+
+        my $type := pir::substr($line, 0, pir::index($line, ':'));
+        my $data := pir::substr($line, pir::index($line, ':')+1);
+        #say("data is '$data'");
+
+        if ($type eq "OP") {
+            #say("found an op line");
+            
+            my %op_hash := split_line($data);
+            my %cur_ctx := @call_stack[0];
+
+            if (pir::defined__IP(%cur_ctx<line>) && %op_hash<line> == %cur_ctx<line>) {
+                %cur_ctx<op_num>++;
+            }
+            else {
+                %cur_ctx<op_num> := 0;
+            }
+
+            my $op_time     := %op_hash<time>;
+            # += would be nice here
+            my $global_time := $op_time + %stats<global_stats><total_time>;
+            %stats<global_stats><total_time> := $global_time;
+            %cur_ctx<line>  := %op_hash<line>;
+            store_stats(%stats, %cur_ctx, $op_time, %op_hash<op>);
+
+            my $skip_first := 1;
+            for @call_stack {
+                if $skip_first {
+                    $skip_first--;
+                }
+                else {
+                    %stats{ $_<file> }{ $_<ns> }{ $_<line> }[ $_<op_num> ]<time> :=
+                    %stats{ $_<file> }{ $_<ns> }{ $_<line> }[ $_<op_num> ]<time> + $op_time;
+                }
+            }
+        }
+
+        elsif ($type eq "CS") {
+            #say("found a context switch line");
+
+            my %cs_hash := split_line($data);
+            if (@call_stack == 0) {
+                #say("ctx stack is empty");
+                @call_stack[0] := %cs_hash;
+            }
+            else {
+                my %cur_ctx      := @call_stack[0];
+                my $hash_ctx     := %cs_hash<ctx>;
+                my $is_redundant := %cur_ctx<ctx> eq $hash_ctx;
+                my $reused_ctx   := $is_redundant && %cur_ctx<sub> != %cs_hash<sub>;
+
+                if ($reused_ctx) {
+                    #say("is reused: $hash_ctx vs " ~ %cur_ctx<ctx>);
+                    %cur_ctx<ns>  := %cs_hash<ns>;
+                    %cur_ctx<sub> := %cs_hash<sub>;
+                }
+                
+                elsif $is_redundant {
+                    #say("is redundant: $hash_ctx vs " ~ %cur_ctx<ctx>);
+                }
+                else {
+                    my $found_ctx := 0;
+                    for @call_stack {
+                        #would be nice to exit early
+                        $found_ctx := $found_ctx || $_<ctx> eq $hash_ctx;
+                    }
+
+                    if $found_ctx {
+                        pir::shift(@call_stack) while @call_stack[0]<ctx> ne $hash_ctx
+                    }
+                    else {
+                        %cur_ctx<op_num>++;
+                        store_stats(%stats, @call_stack[0], 0, "CALL", :target(%cs_hash<ns>));
+                        pir::unshift(@call_stack, %cs_hash);
+                    }
+                }
+            }
+        }
+
+        elsif ($type eq "VERSION") {
+            my $version_num;
+            Q:PIR {
+                $P0 = find_lex "$data"
+                $I0 = $P0
+                $P0 = box $I0
+                store_lex "$version_num", $P0
+            };
+            #say("found a version line: '$version_num'");
+            if ($version_num != 1) {
+                say("pprof is from an incompatible Parrot version");
+                pir::exit(1);
+            }
+        }
+        elsif ($type eq "CLI") {
+            #say("found a CLI line");
+            %stats<global_stats><cli> := $data;
+        }
+        elsif (pir::index($line, "END_OF_RUNLOOP") == 0) {
+            #say("found an end of runloop line");
+            @call_stack := ();
+        }
+        elsif (pir::index($line, "#") == 0) {
+            #say("found a comment line");
+        }
+        else {
+            say("don't know what to do with this line: \"$line\"");
+        }
+        $line := $fh.readline();
+    }
+}
+
+
+sub store_stats(%stats, %loc, $time, $op_name, :$target?) {
+
+    my %op_stats;
+    if pir::defined__IP( %stats{ %loc<file> }{ %loc<ns> }{ %loc<line> }[ %loc<op_num> ] ) {
+        %op_stats := %stats{ %loc<file> }{ %loc<ns> }{ %loc<line> }[ %loc<op_num> ];
+    }
+    else {
+        %op_stats := %stats{ %loc<file> }{ %loc<ns> }{ %loc<line> }[ %loc<op_num> ] := {};
+    }
+
+    if %op_stats<hits> {
+        %op_stats<hits>++;
+        %op_stats<time> := %op_stats<time> + $time;
+    }
+    else {
+        %op_stats<hits>    := 1;
+        %op_stats<time>    := $time;
+        %op_stats<op_name> := $op_name;
+        %op_stats<target>  := $target if pir::defined__IP($target);
+    }
+}
+
+sub print_stats(%stats) {
+#    for %stats -> $file {
+#        if $file ne 'global_stats' {
+#            for %stats{$file} -> $ns {
+#                for %stats{$file}{$ns} -> $line_num {
+#                    my $max_op := +%stats{$file}{$ns}{$line_num};
+#                    my $cur_op := 0;
+#                    while ($cur_op < $max_op) {
+#                        print("$file  $ns  line/op:$line_num/$cur_op");
+#                        for %stats{$file}{$ns}{$line_num}[$cur_op] -> $attr {
+#                            print(" $attr => " ~ ~%stats{$file}{$ns}{$line_num}[$cur_op]{$attr});
+#                        }
+#                        $cur_op++;
+#                        print("\n");
+#                    }
+#                }
+#                print("\n");
+#            }
+#        }
+#    }
+    pir::load_bytecode("dumper.pbc");
+    _dumper(%stats);
+}
+
+
+sub get_cg_profile(%stats) {
+    my @output;
+    @output.push("version: 1");
+    @output.push("creator: PARROT IS AWESOME");
+    @output.push("pid: 5751");
+    @output.push("cmd: " ~ ~%stats<global_stats><cli>);
+    #@output.push("");
+    @output.push("part: 1");
+    @output.push("desc: I1 cache:");
+    @output.push("desc: D1 cache:");
+    @output.push("desc: L2 cache:");
+    @output.push("desc: Timerange: Basic block 0 - " ~ +%stats<global_stats><total_time>);
+    @output.push("desc: Trigger: Program termination");
+    @output.push("positions: line");
+    @output.push("events: Ir");
+    @output.push("summary: "~ %stats<global_stats><total_time>);
+    @output.push("");
+
+    for %stats -> $file {
+        if $file ne "global_stats" {
+
+            @output.push("fl=$file");
+            for %stats{$file} -> $ns {
+                @output.push("\nfn=$ns");
+
+                #%stats{$file}{$ns}.sort();
+                for %stats{$file}{$ns} -> $line {
+                    my $curr_op    := 0;
+                    my @line_stats := %stats{$file}{$ns}{$line};
+                    my $op_count   := + at line_stats;
+                    my $op_time    := 0;
+
+                    while $curr_op < $op_count && @line_stats[$curr_op]<op_name> ne "CALL"  {
+                        $op_time := $op_time + @line_stats[$curr_op]<time>;
+                        #say("op is "~ @line_stats[$curr_op]<op_name>);
+                        $curr_op++;
+                    }
+                    @output.push(~$line ~ " " ~ ~$op_time);
+                    
+                    if $curr_op < $op_count && @line_stats[$curr_op]<op_name> eq "CALL" {
+                        my $hits   := @line_stats[$curr_op]<hits>;
+                        my $time   := @line_stats[$curr_op]<time>;
+                        my $target := @line_stats[$curr_op]<target>;
+                        @output.push("cfn=$target");
+                        @output.push("calls=$hits $time");
+                        #say("op is "~ @line_stats[$curr_op]<op_name>);
+                    }
+                    
+                    if $curr_op < $op_count {
+                        $op_time := 0;
+                        while $curr_op < $op_count {
+                            $op_time := $op_time + @line_stats[$curr_op]<time>;
+                        #say("op is "~ @line_stats[$curr_op]<op_name>);
+                            $curr_op++;
+                        }
+                        @output.push(~$line ~ " " ~ ~$op_time);
+                    }
+                }
+            }
+        }
+    }
+    @output.push("totals: " ~ ~%stats<global_stats><total_time>);
+    @output;
+}
+
+
+sub split_line($line) {
+    my %values := {};
+
+    #take off the opening and closing {x{ and }x}
+    $line   := pir::substr($line, 3);
+    my $len := pir::length($line);
+    $len    := $len - 4;
+    $line   := pir::substr($line, 0, $len);
+
+    my @attrs := pir::split('}x}{x{', $line);
+
+    for @attrs {
+        my $idx       := pir::index($_, ":");
+        my $key       := pir::substr($_, 0, $idx);
+        my $value     := pir::substr($_, $idx+1);
+        %values{$key} := $value;
+        #say("key is $key, value is $value");
+    }
+    return %values;
+}

Added: branches/orderedhash_revamp/tools/dev/pprof2cg.pl
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/tools/dev/pprof2cg.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,402 @@
+#! perl
+
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+use strict;
+use warnings;
+
+=head1 NAME
+
+tools/dev/pprof2cg.pl
+
+=head1 DESCRIPTION
+
+Convert the output of Parrot's profiling runcore to a Callgrind-compatible
+format.
+
+=head1 SYNOPSIS
+
+perl tools/dev/pprof2cg.pl parrot.pprof.1234
+
+=head1 USAGE
+
+Generate a profile by passing C<-Rprofiling> to parrot, for example C<./parrot
+-Rprofiling perl6.pbc hello.p6>.  Once execution completes, C<parrot> will
+print a message specifying the location of the parrot profile (pprof).  The
+profile will be named parrot.pprof.XXXX, where XXXX is the PID of the parrot
+process unless another name is specified by the B<PARROT_PROFILING_OUTPUT>
+environment variable.
+
+To generate a Callgrind-compatible profile, run this script with the pprof
+filename as the first argument.  The output file usable by kcachegrind will be
+in parrot.out.XXXX, where XXXX again is the PID of the original parrot process.
+
+=head1 ENVIRONMENT VARIABLES
+
+=head2 PARROT_PROFILING_OUTPUT
+
+If the environment variable PARROT_PROFILING_OUTPUT is set, the profiling
+runcore will attempt to use its value as the profile filename.  Note that it
+does not check whether the file already exists and will happily overwrite
+existing files.
+
+=cut
+
+main(\@ARGV);
+
+=head1 INTERNAL DATA STRUCTURES
+
+=over 4
+
+=item notes
+
+Parrot's execution model is built on continuation-passing style and does not
+precisely fit the straightforward function-based format that
+Callgrind-compatible tools expect.  For this reason, the profiling runcore
+captures information about context switches (CS lines in the pprof file) and
+pprof2cg.pl maintains a context stack that functions similarly to a typical
+call stack.  pprof2cg.pl then maps these context switches as if they were
+function calls and returns.  See C<$call_stack> for more information.
+
+=item C<$call_stack>
+
+Variables which are named C<$call_stack> hold a reference to an array of hashes
+which contain information about the currently active contexts.  When collecting
+timing information about an op, it is necessary to add that information to all
+function calls on the stack because Callgrind-compatible tools expect the cost
+of a function call to include the cost of all calls made by that function, etc.
+
+When a context switch is detected, C<process_line> looks at the context stack
+to determine if the context switch looks like a function call (if the context
+hasn't been seen before) or a return (if the context is somewhere on the
+stack).  There are some other cases that the code handles, but these can be
+ignored for now in the interest of simplicity.  If the context has been seen,
+C<process_line> shifts contexts off the stack until it finds the context that
+has been switched to.  When C<process_line> detects a new context, it adds a
+fake op representing a function call to C<$stats> and unshifts a new context
+onto the stack.
+
+Each element of C<@$call_stack> contains the information needed to uniquely
+identify the site of the original context switch.
+
+=item C<$stats>
+
+Variables which are named C<$stats> contain a reference to a deeply nested
+HoHoH.. which contains all information gathered about a profiled PIR program.
+The nested hashes and arrays refer to the file, namespace, line of source code
+and op number, respectively.   The op number is used to allow multiple
+instructions per line because PIR instructions often represent multiple
+low-level instructions.  This also makes it easy to inject pseudo-ops to
+represent function calls.
+
+Each op always has a time value representing the total amount of time spent in
+that op.  Ops may also have an op_name value that gives the name of the op.
+When control flow similar to a function call is detected, a pseudo-op
+representing a function call is injected.  These pseudo-ops have zero cost when
+initialized and are used to determine the total time spent between when the
+context becomes active and when control flow returns to or past the context.
+Although they're not exactly like functions calls, they're close enough that it
+may help to think of them as such.
+
+Uncomment the print_stats line in main to see a representation of the data
+contained in C<$stats>.
+
+=back
+
+=head1 FUNCTIONS
+
+=over 4
+
+=item C<main>
+
+This function is minimal driver for the other functions in this file, taking
+the name of a Parrot profile and writing a Callgrind-compatible profile to a
+similarly-named file.
+
+=cut
+
+sub main {
+    my $argv      = shift;
+    my $stats     = {};
+    my $filename  = $argv->[0];
+
+    $stats->{global_stats}{total_time} = 0;
+
+    open(my $in_fh, '<', $filename) or die "couldn't open $filename for reading: $!";
+
+    process_input($in_fh, $stats);
+
+    close($in_fh) or die "couldn't close $filename: $!";
+
+    #print_stats($stats);
+
+    unless ($filename =~ s/pprof/out/) {
+        $filename = "$filename.out";
+    }
+
+    open(my $out_fh, '>', $filename) or die "couldn't open $filename for writing: $!";
+    my $cg_profile = get_cg_profile($stats);
+    print $out_fh $cg_profile;
+    close($out_fh) or die "couldn't close $filename: $!";
+    print "$filename can now be used with kcachegrind or other callgrind-compatible tools.\n";
+}
+
+=item C<process_input>
+
+This function takes a file handle open to a Parrot profile and a reference
+to a hash of fine-grained statistics about the current PIR program.  It
+modifies the statistics according to the information from the Parrot profile.
+
+=cut
+
+sub process_input {
+    my ($input, $stats) = @_;
+    my $call_stack = [];
+
+    while(my $line = <$input>) {
+        if ($line =~ /^OP:(.*)$/) {
+            # Decode string in the format C<{x{key1:value1}x}{x{key2:value2}x}>
+            my %op_hash = $1 =~ /{x{([^:]+):(.*?)}x}/g
+                or die "invalidly formed line '$line'";
+
+            my $cur_ctx = $call_stack->[0]
+                or die "input file did not specify an initial context";
+
+            # If we've already seen this line, bump the op number.  Otherwise reset it.
+            if (exists $cur_ctx->{line} && $op_hash{line} == $cur_ctx->{line}) {
+                $cur_ctx->{op_num}++;
+            }
+            else {
+                $cur_ctx->{op_num} = 0;
+            }
+
+            $cur_ctx->{line} = $op_hash{line};
+            my $extra = { op_name => $op_hash{op} };
+            my $time  = $op_hash{time};
+
+            $stats->{global_stats}{total_time} += $time;
+            store_stats($stats, $cur_ctx, $time, $extra);
+
+            # Add the time spent by this op to each op on the call "stack".
+            $stats->{ $_->{file} }{ $_->{ns} }{ $_->{line} }[ $_->{op_num} ]{time} += $time
+                for @$call_stack[1 .. $#$call_stack];
+        }
+        #context switch
+        elsif ($line =~ /^CS:(.*)$/) {
+
+            # Decode string in the format C<{x{key1:value1}x}{x{key2:value2}x}>
+            my %cs_hash = $1 =~ /{x{([^:]+):(.*?)}x}/g
+                or die "invalidly formed line '$line'";
+
+            if (!@$call_stack) {
+                $call_stack->[0] = \%cs_hash;
+            }
+            else {
+                my $cur_ctx      = $call_stack->[0];
+                my $hash_ctx     = $cs_hash{ctx};
+                my $is_redundant = $cur_ctx->{ctx} eq $hash_ctx;
+                my $reused_ctx   = $is_redundant && $cur_ctx->{sub} ne $cs_hash{sub};
+
+                # If we're calling a new sub with the same context, modify the
+                # current context to have the name and address of the new sub.
+                if ($reused_ctx) {
+                    $cur_ctx->{ns}  = $cs_hash{ns};
+                    $cur_ctx->{sub} = $cs_hash{sub};
+                }
+
+                # The new context is the same as the old one, so don't modify the call stack.
+                elsif ($is_redundant) {
+                    # This space intentionally left blank.
+                }
+
+                # If the new context isn't in the current call stack, unshift
+                # it onto the start of the stack.
+                elsif (!grep {$_->{ctx} eq $hash_ctx} @$call_stack) {
+                    $cur_ctx->{op_num}++;
+                    my $extra = {
+                                 op_name => "CALL",
+                                 target  => $cs_hash{ns}
+                                };
+                    store_stats($stats, $call_stack->[0], 0, $extra);
+                    unshift @$call_stack, \%cs_hash;
+                }
+                else {
+                    #shift contexts off the stack until one matches the current ctx
+                    shift @$call_stack while $call_stack->[0]{ctx} ne $hash_ctx;
+                }
+            }
+            #print Dumper($call_stack);
+        }
+        elsif ($line =~ /^VERSION:(\d+)$/) {
+            my $version = $1;
+            if ($version != 2) {
+                die "profile was generated by an incompatible version of the profiling runcore.";
+            }
+        }
+        elsif ($line =~ /^CLI:(.*)$/) {
+            $stats->{'global_stats'}{'cli'} = $1;
+        }
+        elsif ($line =~ /^END_OF_RUNLOOP:(.*)$/) {
+            # This is the end of an outermost runloop.  Several of these can
+            # occur during the execution of a script, e.g. for :init subs.
+            @$call_stack = ();
+        }
+        elsif ($line =~ /^AN:/) {
+            #ignore annotations for now
+        }
+        elsif ($line =~ /^#/) {
+            #comments are always ignored
+        }
+        else {
+            die "Unrecognized line format: '$line'";
+        }
+    }
+}
+
+=item C<print_stats>
+
+This function prints a complete, human-readable representation of the
+statistical data that have been collected into the C<$stats> argument to
+stdout.  It is primarily intended to ease debugging and is not necessary to
+create a Callgrind-compatible profile.
+
+=cut
+
+sub print_stats {
+    my $stats = shift;
+
+    for my $file (grep {$_ ne 'global_stats'} sort keys %$stats) {
+        for my $ns (sort keys %{ $stats->{$file} }) {
+            for my $line_num (sort {$a<=>$b} keys %{ $stats->{$file}{$ns} }) {
+                for my $op_num (0 .. $#{$stats->{$file}{$ns}{$line_num}}) {
+
+                    print "$file  $ns  line/op:$line_num/$op_num ";
+
+                    for my $attr (sort keys %{ $stats->{$file}{$ns}{$line_num}[$op_num] }) {
+                        print "{ $attr => $stats->{$file}{$ns}{$line_num}[$op_num]{$attr} } ";
+                    }
+                    print "\n";
+                }
+            }
+            print "\n";
+        }
+    }
+}
+
+=item C<store_stats>
+
+This function adds statistical data to the C<$stats> hash reference.  The
+C<$loc> argument specifies information such as the namespace, file, line
+and op number where the data should go.  C<$time> is an integer representing
+the amount of time spent at the specified location.  C<$extra> contains any
+ancillary data that should be stored in the hash.  This includes data on
+(faked) subroutine calls and op names.
+
+=cut
+
+sub store_stats {
+    my ($stats, $loc, $time, $extra) = @_;
+
+    my $by_op = ( $stats->{ $loc->{file} }{ $loc->{ns} }{ $loc->{line} }[ $loc->{op_num} ] ||= {} );
+
+    if ($by_op->{hits}) {
+        $by_op->{hits} ++;
+        $by_op->{time} += $time;
+    }
+    else {
+        $by_op->{hits} = 1;
+        $by_op->{time} = $time;
+
+        $by_op->{$_} = $extra->{$_} for keys %$extra;
+    }
+}
+
+=item C<get_cg_profile>
+
+This function takes a reference to a hash of statistical information about a
+PIR program and returns a string containing a Callgrind-compatible profile.
+Although some information in the profile may not be accurate (namely PID and
+creator), tools such as kcachegrind are able to consume files generated by this
+function.
+
+=cut
+
+sub get_cg_profile {
+
+    my $stats = shift;
+    my @output = ();
+
+    push @output, <<"HEADER";
+version: 1
+creator: 3.4.1-Debian
+pid: 5751
+cmd: $stats->{'global_stats'}{'cli'}
+
+part: 1
+desc: I1 cache:
+desc: D1 cache:
+desc: L2 cache:
+desc: Timerange: Basic block 0 - $stats->{'global_stats'}{'total_time'}
+desc: Trigger: Program termination
+positions: line
+events: Ir
+summary: $stats->{'global_stats'}{'total_time'}
+
+HEADER
+
+    for my $file (grep {$_ ne 'global_stats'} keys %$stats) {
+
+        push @output, "fl=$file";
+
+        for my $ns (keys %{ $stats->{$file} }) {
+            push @output, "\nfn=$ns";
+
+            for my $line (sort keys %{ $stats->{$file}{$ns} }) {
+
+                my $curr_op    = 0;
+                my $line_stats = $stats->{$file}{$ns}{$line};
+                my $op_count   = scalar(@$line_stats);
+                my $op_time    = 0;
+
+                while ($curr_op < $op_count && $line_stats->[$curr_op]{'op_name'} ne 'CALL') {
+                    $op_time += $line_stats->[$curr_op]{'time'};
+                    $curr_op++;
+                }
+                push @output, "$line $op_time";
+
+                if ($curr_op < $op_count && $line_stats->[$curr_op]{'op_name'} eq 'CALL') {
+                    my $call_target = $line_stats->[$curr_op]{'target'};
+                    my $call_count  = $line_stats->[$curr_op]{'hits'};
+                    my $call_cost   = $line_stats->[$curr_op]{'time'};
+
+                    push @output, "cfn=$call_target";
+                    push @output, "calls=$call_count $call_cost";
+                }
+
+                if ($curr_op < $op_count) {
+                    $op_time = 0;
+                    while ($curr_op < $op_count) {
+                        $op_time += $line_stats->[$curr_op]{'time'};
+                        $curr_op++;
+                    }
+                    push @output, "$line $op_time";
+                }
+            }
+        }
+    }
+
+    push @output, "totals: $stats->{'global_stats'}{'total_time'}";
+    return join("\n", @output);
+}
+
+=back
+
+=cut
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Modified: branches/orderedhash_revamp/tools/dev/search-ops.pl
==============================================================================
--- branches/orderedhash_revamp/tools/dev/search-ops.pl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/dev/search-ops.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -43,7 +43,11 @@
 
 =head1 NAME
 
-tools/dev/search-ops.pl - Get descriptions of ops codes
+tools/dev/search-ops.pl
+
+=head1 DESCRIPTION
+
+Command-line tool to get descriptions of ops codes.
 
 =head1 USAGE
 

Added: branches/orderedhash_revamp/tools/dev/vgp_darwin
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/orderedhash_revamp/tools/dev/vgp_darwin	Sat Jan 23 01:49:53 2010	(r43541)
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+valgrind --suppressions=tools/dev/parrot.supp \
+         --num-callers=50 \
+         --leak-check=full \
+         --leak-resolution=high \
+         --show-reachable=yes \
+         --dsymutil=yes \
+         ./parrot --leak-test $@
+

Modified: branches/orderedhash_revamp/tools/dev/vtablize.pl
==============================================================================
--- branches/orderedhash_revamp/tools/dev/vtablize.pl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/dev/vtablize.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -31,7 +31,6 @@
 s/^(\s*)(void\s+init\(\)\s+{)/$1VTABLE $2/;
 s/^(\s*)(void\s+init_pmc\(PMC\s+\*\w*\)\s+{)/$1VTABLE $2/;
 s/^(\s*)(PMC\s+\*instantiate\(PMC\s+\*\w*\)\s+{)/$1VTABLE $2/;
-s/^(\s*)(PMC\s+\*instantiate_str\(STRING\s+\*\w*,\s+INTVAL\s+\w*\)\s+{)/$1VTABLE $2/;
 s/^(\s*)(void\s+morph\(INTVAL\s+\w*\)\s+{)/$1VTABLE $2/;
 s/^(\s*)(void\s+mark\(\)\s+{)/$1VTABLE $2/;
 s/^(\s*)(void\s+destroy\(\)\s+{)/$1VTABLE $2/;
@@ -243,9 +242,6 @@
 s/^(\s*)(void\s+delete_keyed\(PMC\s+\*\w*\)\s+{)/$1VTABLE $2/;
 s/^(\s*)(void\s+delete_keyed_int\(INTVAL\s+\w*\)\s+{)/$1VTABLE $2/;
 s/^(\s*)(void\s+delete_keyed_str\(STRING\s+\*\w*\)\s+{)/$1VTABLE $2/;
-s/^(\s*)(PMC\s+\*nextkey_keyed\(PMC\s+\*\w*,\s+INTVAL\s+\w*\)\s+{)/$1VTABLE $2/;
-s/^(\s*)(PMC\s+\*nextkey_keyed_int\(INTVAL\s+\w*,\s+INTVAL\s+\w*\)\s+{)/$1VTABLE $2/;
-s/^(\s*)(PMC\s+\*nextkey_keyed_str\(STRING\s+\*\w*,\s+INTVAL\s+\w*\)\s+{)/$1VTABLE $2/;
 s/^(\s*)(PMC\s+\*get_iter\(\)\s+{)/$1VTABLE $2/;
 s/^(\s*)(opcode_t\s+\*invoke\(void\s+\*\w*\)\s+{)/$1VTABLE $2/;
 s/^(\s*)(INTVAL\s+can\(STRING\s+\*\w*\)\s+{)/$1VTABLE $2/;

Modified: branches/orderedhash_revamp/tools/install/smoke.pl
==============================================================================
--- branches/orderedhash_revamp/tools/install/smoke.pl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/install/smoke.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -9,7 +9,7 @@
 use Getopt::Long;
 use File::Spec::Functions;
 
-use Test::More tests => 7;
+use Test::More tests => 8;
 
 =head1 NAME
 
@@ -60,22 +60,30 @@
 
 chdir $DESTDIR if ($DESTDIR);
 
+sub quote {
+    my $exe = shift;
+    $exe .= '.exe' if ($^O eq 'MSWin32');
+    $exe = '"' . $exe . '"' if ($exe =~ / /);
+    return $exe;
+}
+
 my $filename;
 my $exe;
 my $out;
 my $FH;
-my $parrot = catfile($bindir, 'parrot');
-my $pirc = catfile($bindir, 'pirc');
+my $parrot = quote(catfile($bindir, 'parrot'));
+my $pirc = quote(catfile($bindir, 'pirc'));
+my $nqp = quote(catfile($bindir, 'parrot-nqp'));
 
 #
 # parrot executable
 #
 
-$exe = catfile($bindir, 'pbc_merge');
+$exe = quote(catfile($bindir, 'pbc_merge'));
 $out = `$exe`;
 ok($out =~ /^pbc_merge/, "check pbc_merge");
 
-$exe = catfile($bindir, 'pbc_dump');
+$exe = quote(catfile($bindir, 'pbc_dump'));
 $out = `$exe`;
 ok($out =~ /^pbc_dump/, "check pbc_dump");
 
@@ -119,6 +127,15 @@
 ok($out eq "ok\n", "check pirc");
 unlink($filename);
 
+$filename = 'test.nqp';
+open $FH, '>', $filename
+        or die "Can't open $filename ($!).\n";
+print $FH "say('hello world!');\n";
+close $FH;
+$out = `$nqp $filename`;
+ok($out eq "hello world!\n", "check nqp-rx");
+unlink($filename);
+
 # compilers/tge is typically not installed
 $filename = 'test.tg';
 open $FH, '>', $filename

Modified: branches/orderedhash_revamp/tools/install/smoke_languages.pl
==============================================================================
--- branches/orderedhash_revamp/tools/install/smoke_languages.pl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/install/smoke_languages.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -6,10 +6,11 @@
 use warnings;
 use 5.008;
 
+use Cwd;
 use Getopt::Long;
 use File::Spec::Functions;
 
-use Test::More tests => 32;
+use Test::More tests => 33;
 
 =head1 NAME
 
@@ -58,13 +59,21 @@
 
 $bindir = 'bin' unless $bindir;
 
-chdir $DESTDIR if ($DESTDIR);
+chdir($DESTDIR) if ($DESTDIR);
+my $pwd = getcwd();
+
+sub quote {
+    my $exe = shift;
+    $exe .= '.exe' if ($^O eq 'MSWin32');
+    $exe = '"' . $exe . '"' if ($exe =~ / /);
+    return $exe;
+}
 
 my $filename;
 my $exe;
 my $out;
 my $FH;
-my $parrot = catfile($bindir, 'parrot');
+my $parrot = quote(catfile($pwd, $bindir, 'parrot'));
 
 $out = `$parrot -V`;
 $out =~ m/version (\S+) built/;
@@ -80,20 +89,25 @@
 
 SKIP:
 {
-skip("abc", 1) unless (-d "$langdir/abc");
+$exe = quote(catfile($pwd, $bindir, 'parrot-abc'));
+skip("abc", 1) unless (-d "$pwd/$langdir/abc" || -e $exe);
+chdir("$pwd/$langdir/abc");
 $filename = 'test.bc';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "1 + 2\n";
 close $FH;
-$out = `$parrot $langdir/abc/abc.pbc $filename`;
+$exe = "$parrot abc.pbc" unless (-e $exe);
+$out = `$exe $filename`;
 ok($out eq "3\n", "check abc");
 unlink($filename);
 }
 
 SKIP:
 {
-skip("Befunge", 1) unless (-d "$langdir/befunge");
+$exe = quote(catfile($pwd, $bindir, 'parrot-befunge'));
+skip("Befunge", 1) unless (-d "$pwd/$langdir/befunge" || -e $exe);
+chdir("$pwd/$langdir/befunge");
 $filename = 'test.bef';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
@@ -110,117 +124,188 @@
                  > :8- ^
 CODE
 close $FH;
-$out = `$parrot $langdir/befunge/befunge.pbc $filename`;
+$exe = "$parrot befunge.pbc" unless (-e $exe);
+$out = `$exe $filename`;
 ok($out eq "If you can see a 4 here ->4 <- then everything is ok!\n", "check befunge");
 unlink($filename);
 }
 
 SKIP:
 {
-skip("bf", 3) unless (-d "$langdir/bf");
-$out = `$parrot $langdir/bf/bf.pbc`;
+$exe = quote(catfile($pwd, $bindir, 'parrot-bf'));
+skip("bf", 3) unless (-d "$pwd/$langdir/bf" || -e $exe);
+chdir("$pwd/$langdir/bf");
+$exe = "$parrot bf.pbc" unless (-e $exe);
+$out = `$exe`;
 ok($out =~ /^usage/, "check bf");
-$out = `$parrot $langdir/bf/bfc.pbc`;
+$exe = quote(catfile($pwd, $bindir, 'parrot-bfc'));
+$exe = "$parrot bfc.pbc" unless (-e $exe);
+$out = `$exe`;
 ok($out =~ /^usage/, "check bfc");
-$out = `$parrot $langdir/bf/bfco.pbc`;
+$exe = quote(catfile($pwd, $bindir, 'parrot-bfco'));
+$exe = "$parrot bfco.pbc" unless (-e $exe);
+$out = `$exe`;
 ok($out =~ /^usage/, "check bfco");
 }
 
 SKIP:
 {
-skip("Cardinal", 1) unless (-d "$langdir/cardinal");
-$out = `$parrot $langdir/cardinal/cardinal.pbc -e "print 'hello world';"`;
+if (-d "$pwd/$langdir/blizkost") {
+    chdir("$pwd/$langdir/blizkost");
+}
+elsif (-d "$pwd/$langdir/perl5") {
+    chdir("$pwd/$langdir/perl5");
+}
+else {
+    skip("blizkost", 1)
+}
+$exe = quote(catfile($pwd, $bindir, 'parrot-blizkost'));
+$filename = 'test.pl';
+open $FH, '>', $filename
+        or die "Can't open $filename ($!).\n";
+print $FH "print qq{Hello, World!\n};\n";
+close $FH;
+$exe = "$parrot perl5.pbc" unless (-e $exe);
+$out = `$exe $filename`;
+ok($out eq "Hello, World!\n" || $out eq "Hello, World!\r\n", "check blizkost");
+unlink($filename);
+}
+
+SKIP:
+{
+$exe = quote(catfile($pwd, $bindir, 'parrot-cardinal'));
+skip("Cardinal", 1) unless (-d "$pwd/$langdir/cardinal" || -e $exe);
+chdir("$pwd/$langdir/cardinal");
+$exe = "$parrot cardinal.pbc" unless (-e $exe);
+$out = `$exe -e "print 'hello world';"`;
 ok($out eq "hello world", "check cardinal");
 }
 
 SKIP:
 {
-skip("ChitChat", 1) unless (-d "$langdir/chitchat");
+$exe = quote(catfile($pwd, $bindir, 'parrot-chitchat'));
+skip("ChitChat", 1) unless (-d "$pwd/$langdir/chitchat" || -e $exe);
+chdir("$pwd/$langdir/chitchat");
 $filename = 'test.smalltalk';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "Transcript show: 'Hello, world!'.";
 close $FH;
-$out = `$parrot $langdir/chitchat/chitchat.pbc $filename`;
+$exe = "$parrot chitchat.pbc" unless (-e $exe);
+$out = `$exe $filename`;
 ok($out eq "Hello, world!\n", "check chitchat");
 unlink($filename);
 }
 
 SKIP:
 {
-skip(".NET", 1) unless (-d "$langdir/dotnet");
-$out = `$parrot $langdir/dotnet/net2pbc.pbc`;
+skip(".NET", 1) unless (-d "$pwd/$langdir/dotnet");
+chdir("$pwd/$langdir/dotnet");
+$out = `$parrot dotnet/net2pbc.pbc`;
 ok($out =~ /^Usage/, "check dotnet");
 }
 
 SKIP:
 {
-skip("EcmaScript", 1) unless (-d "$langdir/ecmascript");
+$exe = quote(catfile($pwd, $bindir, 'parrot-js'));
+skip("EcmaScript", 1) unless (-d "$pwd/$langdir/ecmascript" || -e $exe);
+chdir("$pwd/$langdir/ecmascript");
 $filename = 'test.js';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "print(\"Hello World from JS\");";
 close $FH;
-$out = `$parrot $langdir/ecmascript/js.pbc $filename`;
+$exe = "$parrot js.pbc" unless (-e $exe);
+$out = `$exe $filename`;
 ok($out eq "Hello World from JS\n", "check ecmascript");
 unlink($filename);
 }
 
 SKIP:
 {
-skip("fun", 1) unless (-d "$langdir/fun");
+$exe = quote(catfile($pwd, $bindir, 'parrot-fun'));
+skip("fun", 1) unless (-d "$pwd/$langdir/fun" || -e $exe);
+chdir("$pwd/$langdir/fun");
 $filename = 'test.fun';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "\"Hello World!\".";
 close $FH;
-$out = `$parrot $langdir/fun/fun.pbc $filename`;
+$exe = "$parrot fun.pbc" unless (-e $exe);
+$out = `$exe $filename`;
 ok($out eq "Hello World!\n", "check fun");
 unlink($filename);
 }
 
 SKIP:
 {
-skip("gil", 1) unless (-d "$langdir/gil");
+$exe = quote(catfile($pwd, $bindir, 'parrot-forth'));
+skip("fun", 1) unless (-d "$pwd/$langdir/forth" || -e $exe);
+chdir("$pwd/$langdir/forth");
+$filename = 'test.frt';
+open $FH, '>', $filename
+        or die "Can't open $filename ($!).\n";
+print $FH ".\" Hello World!\" CR";
+close $FH;
+$exe = "$parrot forth.pbc" unless (-e $exe);
+$out = `$exe $filename`;
+ok($out eq "Hello World!\n", "check forth");
+unlink($filename);
+}
+
+SKIP:
+{
+$exe = quote(catfile($pwd, $bindir, 'parrot-gil'));
+skip("gil", 1) unless (-d "$pwd/$langdir/gil" || -e $exe);
+chdir("$pwd/$langdir/gil");
 $filename = 'test.gil';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH q{say('Hello, world!');};
 close $FH;
-$out = `$parrot $langdir/gil/gil.pbc $filename`;
+$exe = "$parrot gil.pbc" unless (-e $exe);
+$out = `$exe $filename`;
 ok($out eq "Hello, world!\n", "check gil");
 unlink($filename);
 }
 
 SKIP:
 {
-skip("HQ9Plus", 1) unless (-d "$langdir/hq9plus");
+$exe = quote(catfile($pwd, $bindir, 'parrot-hq9plus'));
+skip("HQ9Plus", 1) unless (-d "$pwd/$langdir/hq9plus" || -e $exe);
+chdir("$pwd/$langdir/hq9plus");
 $filename = 'test.HQ9Plus';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "H";
 close $FH;
-$out = `$parrot $langdir/hq9plus/hq9plus.pbc $filename`;
+$exe = "$parrot hq9plus.pbc" unless (-e $exe);
+$out = `$exe $filename`;
 ok($out eq "Hello, world!\n", "check HQ9Plus");
 unlink($filename);
 }
 
 SKIP:
 {
-skip("Lisp", 1) unless (-d "$langdir/lisp");
+$exe = quote(catfile($pwd, $bindir, 'parrot-lisp'));
+skip("Lisp", 1) unless (-d "$pwd/$langdir/lisp" || -e $exe);
+chdir("$pwd/$langdir/lisp");
 $filename = 'test.l';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "( print \"Hello, World!\" )\n";
 close $FH;
-$out = `$parrot $langdir/lisp/lisp.pbc $filename`;
+$exe = "$parrot lisp.pbc" unless (-e $exe);
+$out = `$exe $filename`;
 ok($out eq "Hello, World!\n", "check lisp");
 unlink($filename);
 }
 
 SKIP:
 {
-skip("LOLCODE", 1) unless (-d "$langdir/lolcode");
+$exe = quote(catfile($pwd, $bindir, 'parrot-lolcode'));
+skip("LOLCODE", 1) unless (-d "$pwd/$langdir/lolcode" || -e $exe);
+chdir("$pwd/$langdir/lolcode");
 $filename = 'test.lolcode';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
@@ -230,93 +315,117 @@
 KTHXBYE
 CODE
 close $FH;
-$out = `$parrot $langdir/lolcode/lolcode.pbc $filename`;
+$exe = "$parrot lolcode.pbc" unless (-e $exe);
+$out = `$exe $filename`;
 ok($out eq "HAI WORLD!\n", "check lolcode");
 unlink($filename);
 }
 
 SKIP:
 {
-skip("Lua", 1) unless (-d "$langdir/lua");
-$out = `$parrot $langdir/lua/lua.pbc -e "print(nil)"`;
+$exe = quote(catfile($pwd, $bindir, 'parrot-lua'));
+skip("Lua", 1) unless (-d "$pwd/$langdir/lua" || -e $exe);
+chdir("$pwd/$langdir/lua");
+$exe = "$parrot lua.pbc" unless (-e $exe);
+$out = `$exe -e "print(nil)"`;
 ok($out eq "nil\n", "check lua");
 }
 
 SKIP:
 {
-skip("m4", 1) unless (-d "$langdir/m4");
-$out = `$parrot $langdir/m4/m4.pbc`;
+$exe = quote(catfile($pwd, $bindir, 'parrot-m4'));
+skip("m4", 1) unless (-d "$pwd/$langdir/m4" || -e $exe);
+chdir("$pwd/$langdir/m4");
+$exe = "$parrot m4.pbc" unless (-e $exe);
+$out = `$exe`;
 ok($out =~ /^Usage/, "check m4");
 }
 
 SKIP:
 {
-skip("Markdown", 1) unless (-d "$langdir/markdown");
+$exe = quote(catfile($pwd, $bindir, 'parrot-markdown'));
+skip("Markdown", 1) unless (-d "$pwd/$langdir/markdown" || -e $exe);
+chdir("$pwd/$langdir/markdown");
 $filename = 'test.text';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "Hello, World!\n\n";
 close $FH;
-$out = `$parrot $langdir/markdown/markdown.pbc $filename`;
+$exe = "$parrot markdown.pbc" unless (-e $exe);
+$out = `$exe $filename`;
 ok($out eq "<p>Hello, World!</p>\n", "check markdown");
 unlink($filename);
 }
 
 SKIP:
 {
-skip("matrixy", 1) unless (-d "$langdir/matrixy");
+$exe = quote(catfile($pwd, $bindir, 'parrot-matrixy'));
+skip("matrixy", 1) unless (-d "$pwd/$langdir/matrixy" || -e $exe);
+chdir("$pwd/$langdir/matrixy");
 $filename = 'test.oct';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "printf(\"Hello, world!\n\");";
 close $FH;
-$out = `$parrot $langdir/matrixy/matrixy.pbc $filename`;
+$exe = "$parrot matrixy.pbc" unless (-e $exe);
+$out = `$exe $filename`;
 ok($out eq "Hello, world!\n", "check matrixy");
 unlink($filename);
 }
 
 SKIP:
 {
-skip("Paraplegic", 1) unless (-d "$langdir/paraplegic");
+$exe = quote(catfile($pwd, $bindir, 'parrot-apl'));
+skip("Paraplegic", 1) unless (-d "$pwd/$langdir/paraplegic" || -e $exe);
+chdir("$pwd/$langdir/paraplegic");
 $filename = 'test.apl';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "\"Hello world!\"";
 close $FH;
-$out = `$parrot $langdir/paraplegic/APL.pbc $filename`;
+$exe = "$parrot apl.pbc" unless (-e $exe);
+$out = `$exe $filename`;
 ok($out eq "Hello world!\n", "check Paraplegic");
 unlink($filename);
 }
 
 SKIP:
 {
-skip("Pheme", 1) unless (-d "$langdir/pheme");
+$exe = quote(catfile($pwd, $bindir, 'parrot-pheme'));
+skip("Pheme", 1) unless (-d "$pwd/$langdir/pheme" || -e $exe);
+chdir("$pwd/$langdir/pheme");
 $filename = 'test.l';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "( write \"Hello, World!\\n\" )\n";
 close $FH;
-$out = `$parrot $langdir/pheme/pheme.pbc $filename`;
+$exe = "$parrot pheme.pbc" unless (-e $exe);
+$out = `$exe $filename`;
 ok($out eq "Hello, World!\n", "check pheme");
 unlink($filename);
 }
 
 SKIP:
 {
-skip("Pipp", 1) unless (-d "$langdir/pipp");
+$exe = quote(catfile($pwd, $bindir, 'parrot-pipp'));
+skip("Pipp", 1) unless (-d "$pwd/$langdir/pipp" || -e $exe);
+chdir("$pwd/$langdir/pipp");
 $filename = 'test.php';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "<?php echo \"Hello, World!\\n\"; ?>";
 close $FH;
-$out = `$parrot $langdir/pipp/pipp.pbc $filename`;
+$exe = "$parrot pipp.pbc" unless (-e $exe);
+$out = `$exe $filename`;
 ok($out eq "Hello, World!\n", "check pipp");
 unlink($filename);
 }
 
 SKIP:
 {
-skip("porcupine", 1) unless (-d "$langdir/porcupine");
+$exe = quote(catfile($pwd, $bindir, 'parrot-porcupine'));
+skip("porcupine", 1) unless (-d "$pwd/$langdir/porcupine" || -e $exe);
+chdir("$pwd/$langdir/porcupine");
 $filename = 'test.pas';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
@@ -327,65 +436,75 @@
 end.
 CODE
 close $FH;
-$out = `$parrot $langdir/porcupine/porcupine.pbc $filename`;
+$exe = "$parrot porcupine.pbc" unless (-e $exe);
+$out = `$exe $filename`;
 ok($out eq "Hello, world!\n", "check porcupine");
 unlink($filename);
 }
 
 SKIP:
 {
-skip("primitivearc", 1) unless (-d "$langdir/primitivearc");
+$exe = quote(catfile($pwd, $bindir, 'parrot-primitivearc'));
+skip("primitivearc", 1) unless (-d "$pwd/$langdir/primitivearc" || -e $exe);
+chdir("$pwd/$langdir/primitivearc");
 $filename = 'test.arc';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH q{"Hello, world!\n"};
 close $FH;
-$out = `$parrot $langdir/primitivearc/primitivearc.pbc $filename`;
+$exe = "$parrot primitivearc.pbc" unless (-e $exe);
+$out = `$exe $filename`;
 ok($out eq "Hello, world!\n\n", "check primitivearc");
 unlink($filename);
 }
 
 SKIP:
 {
-skip("Punie", 1) unless (-d "$langdir/punie");
+$exe = quote(catfile($pwd, $bindir, 'parrot-punie'));
+skip("Punie", 1) unless (-d "$pwd/$langdir/punie" || -e $exe);
+chdir("$pwd/$langdir/punie");
 $filename = 'test.p1';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "print \"Hello, World!\";\n";
 close $FH;
-$out = `$parrot $langdir/punie/punie.pbc $filename`;
+$exe = "$parrot punie.pbc" unless (-e $exe);
+$out = `$exe $filename`;
 ok($out eq "Hello, World!", "check punie");
 unlink($filename);
 }
 
 SKIP:
 {
-skip("Pynie", 1) unless (-d "$langdir/pynie");
+$exe = quote(catfile($pwd, $bindir, 'parrot-pynie'));
+skip("Pynie", 1) unless (-d "$pwd/$langdir/pynie" || -e $exe);
+chdir("$pwd/$langdir/pynie");
 $filename = 'test.py';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "print('Hello, World!')\n";
 close $FH;
-$out = `$parrot $langdir/pynie/pynie.pbc $filename`;
+$exe = "$parrot pynie.pbc" unless (-e $exe);
+$out = `$exe $filename`;
 ok($out eq "Hello, World!\n", "check pynie");
 unlink($filename);
 }
 
 SKIP:
 {
-skip("Rakudo", 2) unless (-d "$langdir/rakudo");
-$out = `$parrot $langdir/rakudo/perl6.pbc -e "say 'hello world'"`;
+$exe = quote(catfile($pwd, $bindir, 'perl6'));
+skip("Rakudo", 1) unless (-d "$pwd/$langdir/rakudo" || -e $exe);
+chdir("$pwd/$langdir/rakudo");
+$exe = "$parrot perl6.pbc" unless (-e $exe);
+$out = `$exe -e "say 'hello world'"`;
 ok($out eq "hello world\n", "check rakudo");
-
-skip("perl6 executable", 1) if ($bindir eq '.');
-$exe = catfile($bindir, 'perl6');
-$out = `$exe -v`;
-ok($out =~ /Rakudo/, "check perl6");
 }
 
 SKIP:
 {
-skip("Shakespeare", 1) unless (-d "$langdir/shakespeare");
+$exe = quote(catfile($pwd, $bindir, 'parrot-shakespeare'));
+skip("Shakespeare", 1) unless (-d "$pwd/$langdir/shakespeare" || -e $exe);
+chdir("$pwd/$langdir/shakespeare");
 $filename = 'test.spl';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
@@ -482,40 +601,49 @@
 
 CODE
 close $FH;
-$out = `$parrot $langdir/shakespeare/shakespeare.pbc $filename`;
+$exe = "$parrot shakespeare.pbc" unless (-e $exe);
+$out = `$exe $filename`;
 ok($out eq "Hello World!\n", "check shakespeare");
 unlink($filename);
 }
 
 SKIP:
 {
-skip("steme", 1) unless (-d "$langdir/steme");
+$exe = quote(catfile($pwd, $bindir, 'parrot-steme'));
+skip("steme", 1) unless (-d "$pwd/$langdir/steme" || -e $exe);
+chdir("$pwd/$langdir/steme");
 $filename = 'test.scm';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "( say \"Hello, World!\" )\n";
 close $FH;
-$out = `$parrot $langdir/steme/steme.pbc $filename`;
+$exe = "$parrot steme.pbc" unless (-e $exe);
+$out = `$exe $filename`;
 ok($out eq "Hello, World!\n", "check steme");
 unlink($filename);
 }
 
 SKIP:
 {
-skip("Squaak", 1) unless (-d "$langdir/squaak");
+$exe = quote(catfile($pwd, $bindir, 'parrot-squaak'));
+skip("Squaak", 1) unless (-d "$pwd/$langdir/squaak" || -e $exe);
+chdir("$pwd/$langdir/squaak");
 $filename = 'test.squaak';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
 print $FH "print(\"Hello, World!\")\n";
 close $FH;
-$out = `$parrot $langdir/squaak/squaak.pbc $filename`;
+$exe = "$parrot squaak.pbc" unless (-e $exe);
+$out = `$exe $filename`;
 ok($out eq "Hello, World!\n", "check squaak");
 unlink($filename);
 }
 
 SKIP:
 {
-skip("unlambda", 1) unless (-d "$langdir/unlambda");
+$exe = quote(catfile($pwd, $bindir, 'parrot-unl'));
+skip("unlambda", 1) unless (-d "$pwd/$langdir/unlambda" || -e $exe);
+chdir("$pwd/$langdir/unlambda");
 $filename = 'test.unl';
 open $FH, '>', $filename
         or die "Can't open $filename ($!).\n";
@@ -524,15 +652,18 @@
 `r```````````.H.e.l.l.o. .w.o.r.l.di
 CODE
 close $FH;
-$out = `$parrot $langdir/unlambda/unl.pbc $filename`;
+$exe = "$parrot unl.pbc" unless (-e $exe);
+$out = `$exe $filename`;
 ok($out eq "Hello world\n", "check unlambda");
 unlink($filename);
 }
 
 SKIP:
 {
-skip("WMLScript", 1) unless (-d "$langdir/wmlscript");
+$exe = quote(catfile($pwd, $bindir, 'parrot-wmlsi'));
+skip("WMLScript", 1) unless (-d "$pwd/$langdir/wmlscript" || -e $exe);
 skip("WMLScript, not wmlsc", 1) unless (`wmlsc -h` =~ /wmlsc/);
+chdir("$pwd/$langdir/wmlscript");
 
 $filename = 'test.wmls';
 open $FH, '>', $filename
@@ -545,7 +676,8 @@
 CODE
 close $FH;
 `wmlsc $filename`;
-$out = `$parrot $langdir/wmlscript/wmlsi.pbc ${filename}c main`;
+$exe = "$parrot wmlsi.pbc" unless (-e $exe);
+$out = `$exe ${filename}c main`;
 ok($out eq "Hello World!\n", "check wmlscript");
 unlink($filename);
 unlink($filename . 'c');

Modified: branches/orderedhash_revamp/tools/util/ncidef2pasm.pl
==============================================================================
--- branches/orderedhash_revamp/tools/util/ncidef2pasm.pl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/util/ncidef2pasm.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -3,11 +3,13 @@
 # Copyright (C) 2003-2007, Parrot Foundation.
 # $Id$
 
-=head1 ncidef2asm.pl
+=head1 NAME
 
-Take an NCI library definition file and turn it into a
+F<tools/util/ncidef2asm.pl>
 
-=head1 Sections
+=head1 DESCRIPTION
+
+Take an NCI library definition file and turn it into PASM.
 
 An NCI library definition file provides the information needed to
 generate a parrot wrapper for the named library (or libraries). Its

Modified: branches/orderedhash_revamp/tools/util/perlcritic.conf
==============================================================================
--- branches/orderedhash_revamp/tools/util/perlcritic.conf	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/util/perlcritic.conf	Sat Jan 23 01:49:53 2010	(r43541)
@@ -17,7 +17,6 @@
 [CodeLayout::ProhibitTrailingWhitespace]
 add_themes = parrot
 
-# RT #56892 (watch out for ^L in source)
 [CodeLayout::RequireTidyCode]
 perltidyrc = tools/util/perltidy.conf
 add_themes = extra

Modified: branches/orderedhash_revamp/tools/util/pgegrep
==============================================================================
--- branches/orderedhash_revamp/tools/util/pgegrep	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/util/pgegrep	Sat Jan 23 01:49:53 2010	(r43541)
@@ -88,7 +88,7 @@
 	load_bytecode 'Getopt/Obj.pbc'
 	load_bytecode 'PGE.pbc'
 	.local pmc getopts
-	getopts = new 'Getopt::Obj'
+	getopts = new [ 'Getopt';'Obj' ]
 	getopts.'notOptStop'(1)
 	push getopts, 'with-filename|H'
 	push getopts, 'files-with-matches|l'
@@ -150,7 +150,7 @@
 		$I1 = File.'is_file'(filename)
 		.IfElse($I1, {
 			# Is a file
-			handle = open filename, '<'
+			handle = open filename, 'r'
 		},{
 			# Not a file, hopefully a directory
 			$I1 = File.'is_dir'(filename)
@@ -207,7 +207,7 @@
 	lineno = 1
 	matched = 0 # Only used for --files-without-matches
 	line = readline handle
-	linelen = length line 
+	linelen = length line
 
 	.local pmc p6rule_compile, cntrlchar
 	$S0 = '<+cntrl-[\t\r\n]>'

Modified: branches/orderedhash_revamp/tools/util/release.json
==============================================================================
--- branches/orderedhash_revamp/tools/util/release.json	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/util/release.json	Sat Jan 23 01:49:53 2010	(r43541)
@@ -1,9 +1,9 @@
 {
-    "release.version"  : "1.3.0",
-    "release.name"     : "Andean Swift",
+    "release.version"  : "1.9.0",
+    "release.name"     : "Blue-fronted Amazon",
     "release.day"      : "Tuesday",
-    "release.date"     : "16 June 2009",
-    "release.nextdate" : "21 July 2009",
+    "release.date"     : "15 December 2009",
+    "release.nextdate" : "19 January 2010",
 
     "web.root"         : "http://parrot.org/",
     "web.source"       : "download",
@@ -11,13 +11,13 @@
     "web.repository"   : "https://svn.parrot.org/parrot/trunk/",
 
     "bugday.day"       : "Saturday",
-    "bugday.date"      : "18 July 2009",
+    "bugday.date"      : "16 January 2010",
 
     "wiki.root"        : "https://trac.parrot.org/parrot/wiki/",
-    "wiki.bugday"      : "bug_day_2009_07_18",
+    "wiki.bugday"      : "bug_day_2010_01_19",
 
     "cpan.search"      : "http://search.cpan.org/dist/parrot",
-    "ftp.path"         : "ftp://ftp.parrot.org/pub/parrot/releases/devel/1.3.0/",
+    "ftp.path"         : "ftp://ftp.parrot.org/pub/parrot/releases/devel/1.9.0/",
     "subversion.root"  : "http://subversion.tigris.org/",
     "svk.root"         : "http://svk.bestpractical.com/"
 }

Modified: branches/orderedhash_revamp/tools/util/templates.json
==============================================================================
--- branches/orderedhash_revamp/tools/util/templates.json	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/util/templates.json	Sat Jan 23 01:49:53 2010	(r43541)
@@ -48,12 +48,12 @@
 Bug Day
 
 On @bugday.day@, @bugday.date@, please join us on IRC in #parrot
-(irc.parrot.org) to work on closing out as many RT (https://rt.perl.org/
-rt3/) tickets as possible in the parrot queue. This will help us get
-ready for the next release of parrot: @release.version@, scheduled for @release.day@,
- at release.date@. You'll find C, parrot assembly, perl, documentation,
-and plenty of tasks to go around. Core developers will be available
-most of the day (starting at around 10am GMT) to answer questions.
+(irc.parrot.org) to work on closing out as many Trac tickets
+(https://trac.parrot.org) tickets as possible in the parrot queue. This will
+help us get ready for the next release of parrot: @release.version@, scheduled
+for @release.day@, @release.date at . You'll find C, parrot assembly, perl,
+documentation, and plenty of tasks to go around. Core developers will be
+available most of the day (starting at around 10am GMT) to answer questions.
 
 No experience with parrot necessary.
 

Modified: branches/orderedhash_revamp/tools/util/update_copyright.pl
==============================================================================
--- branches/orderedhash_revamp/tools/util/update_copyright.pl	Sat Jan 23 01:22:07 2010	(r43540)
+++ branches/orderedhash_revamp/tools/util/update_copyright.pl	Sat Jan 23 01:49:53 2010	(r43541)
@@ -7,7 +7,11 @@
 use warnings;
 use Fatal qw( open close );
 
-=head1 PURPOSE
+=head1 NAME
+
+F<tools/util/update_copyright.pl>
+
+=head1 DESCRIPTION
 
 Given a list of files as command line arguments, update the copyright
 notice to go from the earliest year noted to the current year.

Deleted: branches/orderedhash_revamp/xconf/samples/testfoobar
==============================================================================
--- branches/orderedhash_revamp/xconf/samples/testfoobar	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,78 +0,0 @@
-# $Id$
-
-=variables
-
-=general
-
-=steps
-
-init::manifest nomanicheck
-init::defaults
-init::install
-init::hints verbose-step fatal-step
-init::headers
-inter::progs
-inter::make
-inter::lex
-inter::yacc
-auto::gcc
-auto::glibc
-auto::backtrace
-auto::fink
-auto::macports
-auto::msvc
-auto::attributes
-auto::warnings
-init::optimize
-inter::shlibs
-inter::libparrot
-inter::charset
-inter::encoding
-inter::types
-auto::ops
-auto::pmc
-auto::alignptrs
-auto::headers
-auto::sizes
-auto::byteorder
-auto::va_ptr
-auto::format
-auto::isreg
-auto::arch
-auto::jit
-auto::cpu
-auto::funcptr
-auto::cgoto
-auto::inline
-auto::gc
-auto::memalign
-auto::signal
-auto::socklen_t
-auto::neg_0
-auto::env
-auto::gmp
-auto::readline
-auto::gdbm
-auto::pcre
-auto::opengl
-auto::crypto
-auto::gettext
-auto::snprintf
-# auto::perldoc
-# auto::pod2man
-auto::ctags
-auto::revision
-auto::icu
-gen::config_h
-gen::core_pmcs
-gen::crypto
-gen::parrot_include
-gen::opengl
-gen::call_list
-gen::languages
-gen::makefiles
-gen::platform
-gen::config_pm
-
-=cut
-

Deleted: branches/orderedhash_revamp/xconf/samples/yourfoobar
==============================================================================
--- branches/orderedhash_revamp/xconf/samples/yourfoobar	Sat Jan 23 01:49:53 2010	(r43540)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,87 +0,0 @@
-# $Id$
-
-=variables
-
-CC=/usr/bin/gcc
-CX=/usr/bin/g++
-
-=general
-
-cc=$CC
-cxx=$CX
-link=$CX
-ld=/usr/bin/g++
-
-=steps
-
-init::manifest nomanicheck
-init::defaults
-init::install
-init::hints verbose-step
-init::headers
-inter::progs
-inter::make
-inter::lex
-inter::yacc
-auto::gcc
-auto::glibc
-auto::backtrace
-auto::fink
-auto::macports
-auto::msvc
-auto::attributes
-auto::warnings
-init::optimize
-inter::shlibs
-inter::libparrot
-inter::charset
-inter::encoding
-inter::types
-auto::ops
-auto::pmc
-auto::alignptrs
-auto::headers
-auto::sizes
-auto::byteorder
-auto::va_ptr
-auto::format
-auto::isreg
-auto::arch
-auto::jit
-auto::cpu
-auto::funcptr
-auto::cgoto
-auto::inline
-auto::gc
-auto::memalign
-auto::signal
-auto::socklen_t
-auto::neg_0
-auto::env
-auto::gmp
-auto::readline
-auto::gdbm
-auto::pcre
-auto::opengl
-auto::crypto
-auto::gettext
-auto::snprintf
-# auto::perldoc
-# auto::pod2man
-auto::ctags
-auto::revision
-auto::icu
-gen::config_h
-gen::core_pmcs
-gen::crypto
-gen::parrot_include
-gen::opengl
-gen::call_list
-gen::languages
-gen::makefiles
-gen::platform
-gen::config_pm
-
-=cut
-
-


More information about the parrot-commits mailing list